mirror of
https://github.com/PrimeDecomp/prime.git
synced 2025-07-04 12:35:53 +00:00
Add CCharAnimTime
Former-commit-id: f7e3f059b2bfad84bfb8a7349dc255c9c7108f6d
This commit is contained in:
parent
0f49d0bf5e
commit
4a96415237
@ -645,7 +645,7 @@ LIBS = [
|
|||||||
"Kyoto/Math/CFrustumPlanes",
|
"Kyoto/Math/CFrustumPlanes",
|
||||||
["Kyoto/Graphics/CCubeMaterial", False],
|
["Kyoto/Graphics/CCubeMaterial", False],
|
||||||
["Kyoto/Graphics/CCubeSurface", False],
|
["Kyoto/Graphics/CCubeSurface", False],
|
||||||
"Kyoto/Animation/CCharAnimTime",
|
["Kyoto/Animation/CCharAnimTime", False],
|
||||||
["Kyoto/Animation/CSegIdList", False],
|
["Kyoto/Animation/CSegIdList", False],
|
||||||
["Kyoto/Input/CFinalInput", True],
|
["Kyoto/Input/CFinalInput", True],
|
||||||
["Kyoto/Graphics/CColor", True],
|
["Kyoto/Graphics/CColor", True],
|
||||||
|
@ -3,6 +3,7 @@
|
|||||||
|
|
||||||
#include "types.h"
|
#include "types.h"
|
||||||
|
|
||||||
|
class COutputStream;
|
||||||
class CInputStream;
|
class CInputStream;
|
||||||
class CCharAnimTime {
|
class CCharAnimTime {
|
||||||
public:
|
public:
|
||||||
@ -16,13 +17,25 @@ public:
|
|||||||
float GetSeconds() const { return x0_time; }
|
float GetSeconds() const { return x0_time; }
|
||||||
|
|
||||||
explicit CCharAnimTime(CInputStream& in);
|
explicit CCharAnimTime(CInputStream& in);
|
||||||
|
explicit CCharAnimTime(float time);
|
||||||
explicit CCharAnimTime(EType type, float time) : x0_time(time), x4_type(type) {}
|
explicit CCharAnimTime(EType type, float time) : x0_time(time), x4_type(type) {}
|
||||||
CCharAnimTime(const CCharAnimTime& other) : x0_time(other.x0_time), x4_type(other.x4_type) {}
|
CCharAnimTime(const CCharAnimTime& other) : x0_time(other.x0_time), x4_type(other.x4_type) {}
|
||||||
|
|
||||||
bool operator!=(const CCharAnimTime& other) const;
|
|
||||||
bool operator>(const CCharAnimTime& other) const;
|
bool operator>(const CCharAnimTime& other) const;
|
||||||
|
bool operator==(const CCharAnimTime& other) const;
|
||||||
|
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;
|
||||||
|
CCharAnimTime operator-(const CCharAnimTime& other) const;
|
||||||
|
CCharAnimTime operator+(const CCharAnimTime& other) const;
|
||||||
|
const CCharAnimTime& operator+=(const CCharAnimTime& other);
|
||||||
|
const CCharAnimTime& operator-=(const CCharAnimTime& other);
|
||||||
|
bool operator<=(const CCharAnimTime& other) const;
|
||||||
|
bool operator>=(const CCharAnimTime& other) const;
|
||||||
|
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); }
|
||||||
|
|
||||||
private:
|
private:
|
||||||
|
63
src/Kyoto/Animation/CCharAnimTime.cpp
Normal file
63
src/Kyoto/Animation/CCharAnimTime.cpp
Normal file
@ -0,0 +1,63 @@
|
|||||||
|
#include "Kyoto/Animation/CCharAnimTime.hpp"
|
||||||
|
|
||||||
|
#include "Kyoto/Streams/CInputStream.hpp"
|
||||||
|
#include "Kyoto/Streams/COutputStream.hpp"
|
||||||
|
|
||||||
|
CCharAnimTime::CCharAnimTime(CInputStream& in)
|
||||||
|
: x0_time(in.Get< float >()), x4_type(EType(in.Get< int >())) {}
|
||||||
|
|
||||||
|
CCharAnimTime::CCharAnimTime(float time) : x0_time(time) {
|
||||||
|
if (time == 0.f) {
|
||||||
|
x4_type = kT_ZeroSteady;
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
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 {}
|
||||||
|
|
||||||
|
CCharAnimTime CCharAnimTime::operator/(const CCharAnimTime& other) const {}
|
||||||
|
|
||||||
|
CCharAnimTime CCharAnimTime::operator*(const float& other) const {}
|
||||||
|
|
||||||
|
CCharAnimTime CCharAnimTime::operator-(const CCharAnimTime& other) const {}
|
||||||
|
|
||||||
|
CCharAnimTime CCharAnimTime::operator+(const CCharAnimTime& other) const {}
|
||||||
|
|
||||||
|
const CCharAnimTime& CCharAnimTime::operator+=(const CCharAnimTime& other) {
|
||||||
|
return *this = *this + other;
|
||||||
|
}
|
||||||
|
|
||||||
|
const CCharAnimTime& CCharAnimTime::operator-=(const CCharAnimTime& other) {
|
||||||
|
return *this = *this - other;
|
||||||
|
}
|
||||||
|
|
||||||
|
bool CCharAnimTime::operator<=(const CCharAnimTime& other) const {
|
||||||
|
return *this == other || *this < other;
|
||||||
|
}
|
||||||
|
|
||||||
|
bool CCharAnimTime::operator>=(const CCharAnimTime& other) const {
|
||||||
|
return *this == other || *this > other;
|
||||||
|
}
|
||||||
|
|
||||||
|
bool CCharAnimTime::GreaterThanZero() const {
|
||||||
|
if (EqualsZero())
|
||||||
|
return false;
|
||||||
|
return x0_time > 0.f;
|
||||||
|
}
|
||||||
|
|
||||||
|
bool CCharAnimTime::EqualsZero() const {
|
||||||
|
return x4_type == kT_ZeroIncreasing || x4_type == kT_ZeroSteady || x4_type == kT_ZeroDecreasing ||
|
||||||
|
x0_time == 0.f;
|
||||||
|
}
|
||||||
|
|
||||||
|
void CCharAnimTime::PutTo(COutputStream& out) const {
|
||||||
|
out.WriteReal32(x0_time);
|
||||||
|
out.WriteUint32(x4_type);
|
||||||
|
}
|
Loading…
x
Reference in New Issue
Block a user