diff --git a/include/Kyoto/Animation/CCharAnimTime.hpp b/include/Kyoto/Animation/CCharAnimTime.hpp index d8efe96a..bc2aad72 100644 --- a/include/Kyoto/Animation/CCharAnimTime.hpp +++ b/include/Kyoto/Animation/CCharAnimTime.hpp @@ -25,8 +25,8 @@ public: bool operator==(const CCharAnimTime& other) const; bool operator!=(const CCharAnimTime& other) const; bool operator<(const CCharAnimTime& other) const; - CCharAnimTime operator/(const CCharAnimTime& other) const; - CCharAnimTime operator*(const float& other) const; + float operator/(const CCharAnimTime& other) const; + float operator*(const float& other) const; CCharAnimTime operator-(const CCharAnimTime& other) const; CCharAnimTime operator+(const CCharAnimTime& other) const; const CCharAnimTime& operator+=(const CCharAnimTime& other); diff --git a/src/Kyoto/Animation/CCharAnimTime.cpp b/src/Kyoto/Animation/CCharAnimTime.cpp index 02fd7b37..7b401728 100644 --- a/src/Kyoto/Animation/CCharAnimTime.cpp +++ b/src/Kyoto/Animation/CCharAnimTime.cpp @@ -9,22 +9,29 @@ CCharAnimTime::CCharAnimTime(CInputStream& in) CCharAnimTime::CCharAnimTime(float time) : x0_time(time) { if (time == 0.f) { x4_type = kT_ZeroSteady; - return; + } else { + x4_type = kT_NonZero; } - x4_type = kT_NonZero; } bool CCharAnimTime::operator<(const CCharAnimTime& other) const {} bool CCharAnimTime::operator==(const CCharAnimTime& other) const {} -bool CCharAnimTime::operator!=(const CCharAnimTime& other) const {} +bool CCharAnimTime::operator!=(const CCharAnimTime& other) const { return !(*this == other); } -bool CCharAnimTime::operator>(const CCharAnimTime& other) const {} +bool CCharAnimTime::operator>(const CCharAnimTime& other) const { + return !(*this == other) && !(*this < other); +} -CCharAnimTime CCharAnimTime::operator/(const CCharAnimTime& other) const {} +float CCharAnimTime::operator/(const CCharAnimTime& other) const { + if (EqualsZero()) + return 0.f; -CCharAnimTime CCharAnimTime::operator*(const float& other) const {} + return x0_time / other.x0_time; +} + +float CCharAnimTime::operator*(const float& other) const {} CCharAnimTime CCharAnimTime::operator-(const CCharAnimTime& other) const {}