FINALLY match and link CCharAnimTime

This commit is contained in:
Phillip Stephens 2024-03-19 18:20:58 -07:00
parent 1e7dc8884b
commit fb1a193a90
3 changed files with 14 additions and 10 deletions

View File

@ -951,7 +951,7 @@ config.libs = [
Object(NonMatching, "Kyoto/Math/CFrustumPlanes.cpp"), Object(NonMatching, "Kyoto/Math/CFrustumPlanes.cpp"),
Object(NonMatching, "Kyoto/Graphics/CCubeMaterial.cpp"), Object(NonMatching, "Kyoto/Graphics/CCubeMaterial.cpp"),
Object(Matching, "Kyoto/Graphics/CCubeSurface.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/Animation/CSegIdList.cpp"),
Object(Matching, "Kyoto/Input/CFinalInput.cpp"), Object(Matching, "Kyoto/Input/CFinalInput.cpp"),
Object(Matching, "Kyoto/Graphics/CColor.cpp"), Object(Matching, "Kyoto/Graphics/CColor.cpp"),

View File

@ -36,10 +36,10 @@ public:
bool GreaterThanZero() const; bool GreaterThanZero() const;
bool EqualsZero() const; bool EqualsZero() const;
void PutTo(COutputStream& out) 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 ZeroFlat() { return CCharAnimTime(kT_ZeroSteady, 0.f); }
//static CCharAnimTime ZeroPlus() { return CCharAnimTime(kT_ZeroIncreasing, 0.f); } static CCharAnimTime ZeroPlus() { return CCharAnimTime(kT_ZeroIncreasing, 0.f); }
//static CCharAnimTime ZeroMinus() { return CCharAnimTime(kT_ZeroDecreasing, 0.f); } static CCharAnimTime ZeroMinus() { return CCharAnimTime(kT_ZeroDecreasing, 0.f); }
int ZeroOrdering() const { int ZeroOrdering() const {
if (x4_type == kT_ZeroDecreasing) { if (x4_type == kT_ZeroDecreasing) {
@ -62,6 +62,15 @@ public:
return kT_ZeroIncreasing; 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: private:
float x0_time; float x0_time;
EType x4_type; EType x4_type;

View File

@ -91,12 +91,7 @@ CCharAnimTime CCharAnimTime::operator*(const float& other) const {
} }
if (EqualsZero()) { if (EqualsZero()) {
if (other > 0.f) { return ZeroSignScale(other);
return *this;
} else if (other < 0.f) {
return CCharAnimTime(ZeroTypeFromOrdering(-ZeroOrdering()), 0.f);
}
return ZeroFlat();
} }
return CCharAnimTime(x0_time * other); return CCharAnimTime(x0_time * other);