From 9f7d939aba3402c7f3b2f38633d0784fe7485fb7 Mon Sep 17 00:00:00 2001 From: Phillip Stephens Date: Mon, 18 Mar 2024 17:07:06 -0700 Subject: [PATCH] CCharAnimTime progress --- configure.py | 2 +- include/Kyoto/Animation/CCharAnimTime.hpp | 10 +++++ src/Kyoto/Animation/CCharAnimTime.cpp | 50 ++++++++++++++++++++++- 3 files changed, 59 insertions(+), 3 deletions(-) diff --git a/configure.py b/configure.py index f66d64ed..8603c456 100755 --- a/configure.py +++ b/configure.py @@ -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" diff --git a/include/Kyoto/Animation/CCharAnimTime.hpp b/include/Kyoto/Animation/CCharAnimTime.hpp index bc2aad72..81e79f62 100644 --- a/include/Kyoto/Animation/CCharAnimTime.hpp +++ b/include/Kyoto/Animation/CCharAnimTime.hpp @@ -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; diff --git a/src/Kyoto/Animation/CCharAnimTime.cpp b/src/Kyoto/Animation/CCharAnimTime.cpp index 7b401728..4355b7c1 100644 --- a/src/Kyoto/Animation/CCharAnimTime.cpp +++ b/src/Kyoto/Animation/CCharAnimTime.cpp @@ -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); }