Skip to content

Commit

Permalink
CCharAnimTime progress
Browse files Browse the repository at this point in the history
  • Loading branch information
Antidote committed Mar 19, 2024
1 parent 7eaafd5 commit 9f7d939
Show file tree
Hide file tree
Showing 3 changed files with 59 additions and 3 deletions.
2 changes: 1 addition & 1 deletion configure.py
Original file line number Diff line number Diff line change
Expand Up @@ -126,7 +126,7 @@

# Tool versions
config.compilers_tag = "20231018"
config.dtk_tag = "v0.6.2"
config.dtk_tag = "v0.7.5"
config.sjiswrap_tag = "v1.1.1"
config.wibo_tag = "0.6.9"

Expand Down
10 changes: 10 additions & 0 deletions include/Kyoto/Animation/CCharAnimTime.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,16 @@ class CCharAnimTime {
void PutTo(COutputStream& out) const;
static CCharAnimTime Infinity() { return CCharAnimTime(kT_Infinity, 1.0f); }

int ZeroOrdering() const {
if (x4_type == kT_ZeroDecreasing) {
return -1;
}
if (x4_type == kT_ZeroSteady) {
return 0;
}
return 1;
}

private:
float x0_time;
EType x4_type;
Expand Down
50 changes: 48 additions & 2 deletions src/Kyoto/Animation/CCharAnimTime.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -14,9 +14,55 @@ CCharAnimTime::CCharAnimTime(float time) : x0_time(time) {
}
}

bool CCharAnimTime::operator<(const CCharAnimTime& other) const {}
bool CCharAnimTime::operator<(const CCharAnimTime& other) const {
if (x4_type == kT_NonZero) {
if (other.x4_type == kT_NonZero) {
return x0_time < other.x0_time;
}

bool CCharAnimTime::operator==(const CCharAnimTime& other) const {}
return other.EqualsZero() ? x0_time < 0.f : other.x0_time > 0.f;
}

if (EqualsZero()) {
if (other.EqualsZero()) {

return ZeroOrdering() < ZeroOrdering();
if (other.x4_type == kT_NonZero) {
return other.x0_time > 0.f;
}
}
return other.x0_time > 0.f;
}

if (other.x4_type == kT_Infinity) {
return 0.f < x0_time || other.x0_time > 0.f;
}

return x0_time < 0.f;
}

bool CCharAnimTime::operator==(const CCharAnimTime& other) const {
int iVar1;
int iVar3;
if (x4_type == kT_NonZero) {
if (other.x4_type == kT_NonZero) {
return x0_time == other.x0_time;
}
return other.EqualsZero() ? false : false;
}

if (EqualsZero()) {
if (other.EqualsZero()) {
return ZeroOrdering() == other.ZeroOrdering();
}
return false;
}

if (other.x4_type == kT_Infinity) {
return x0_time * other.x0_time > 0.f;
}
return false;
}

bool CCharAnimTime::operator!=(const CCharAnimTime& other) const { return !(*this == other); }

Expand Down

0 comments on commit 9f7d939

Please sign in to comment.