diff --git a/configure.py b/configure.py index 8603c456..50678e80 100755 --- a/configure.py +++ b/configure.py @@ -951,7 +951,7 @@ config.libs = [ Object(NonMatching, "Kyoto/Math/CFrustumPlanes.cpp"), Object(NonMatching, "Kyoto/Graphics/CCubeMaterial.cpp"), Object(Matching, "Kyoto/Graphics/CCubeSurface.cpp"), - Object(NonMatching, "Kyoto/Animation/CCharAnimTime.cpp"), + Object(Matching, "Kyoto/Animation/CCharAnimTime.cpp"), Object(Matching, "Kyoto/Animation/CSegIdList.cpp"), Object(Matching, "Kyoto/Input/CFinalInput.cpp"), Object(Matching, "Kyoto/Graphics/CColor.cpp"), diff --git a/include/Kyoto/Animation/CCharAnimTime.hpp b/include/Kyoto/Animation/CCharAnimTime.hpp index 18eb1089..adeaa95c 100644 --- a/include/Kyoto/Animation/CCharAnimTime.hpp +++ b/include/Kyoto/Animation/CCharAnimTime.hpp @@ -36,10 +36,10 @@ public: bool GreaterThanZero() const; bool EqualsZero() const; void PutTo(COutputStream& out) const; - //static CCharAnimTime Infinity() { return CCharAnimTime(kT_Infinity, 1.0f); } + static CCharAnimTime Infinity() { return CCharAnimTime(kT_Infinity, 1.0f); } static CCharAnimTime ZeroFlat() { return CCharAnimTime(kT_ZeroSteady, 0.f); } - //static CCharAnimTime ZeroPlus() { return CCharAnimTime(kT_ZeroIncreasing, 0.f); } - //static CCharAnimTime ZeroMinus() { return CCharAnimTime(kT_ZeroDecreasing, 0.f); } + static CCharAnimTime ZeroPlus() { return CCharAnimTime(kT_ZeroIncreasing, 0.f); } + static CCharAnimTime ZeroMinus() { return CCharAnimTime(kT_ZeroDecreasing, 0.f); } int ZeroOrdering() const { if (x4_type == kT_ZeroDecreasing) { @@ -62,6 +62,15 @@ public: return kT_ZeroIncreasing; } + CCharAnimTime ZeroSignScale(float other) const { + if (other > 0.f) { + return *this; + } else if (other < 0.f) { + return CCharAnimTime(ZeroTypeFromOrdering(-ZeroOrdering()), 0.f); + } + return ZeroFlat(); + } + private: float x0_time; EType x4_type; diff --git a/src/Kyoto/Animation/CCharAnimTime.cpp b/src/Kyoto/Animation/CCharAnimTime.cpp index d076e036..76fa6d31 100644 --- a/src/Kyoto/Animation/CCharAnimTime.cpp +++ b/src/Kyoto/Animation/CCharAnimTime.cpp @@ -91,12 +91,7 @@ CCharAnimTime CCharAnimTime::operator*(const float& other) const { } if (EqualsZero()) { - if (other > 0.f) { - return *this; - } else if (other < 0.f) { - return CCharAnimTime(ZeroTypeFromOrdering(-ZeroOrdering()), 0.f); - } - return ZeroFlat(); + return ZeroSignScale(other); } return CCharAnimTime(x0_time * other);