mirror of https://github.com/AxioDL/metaforce.git
Merge pull request #228 from lioncash/time
CCharAnimTime: Make constructors constexpr where applicable
This commit is contained in:
commit
79f6dbac73
|
@ -5,10 +5,6 @@
|
||||||
|
|
||||||
namespace urde {
|
namespace urde {
|
||||||
|
|
||||||
CCharAnimTime CCharAnimTime::Infinity() {
|
|
||||||
return {EType::Infinity, 1.f};
|
|
||||||
}
|
|
||||||
|
|
||||||
bool CCharAnimTime::EqualsZero() const {
|
bool CCharAnimTime::EqualsZero() const {
|
||||||
if (x4_type == EType::ZeroIncreasing || x4_type == EType::ZeroSteady || x4_type == EType::ZeroDecreasing)
|
if (x4_type == EType::ZeroIncreasing || x4_type == EType::ZeroSteady || x4_type == EType::ZeroDecreasing)
|
||||||
return true;
|
return true;
|
||||||
|
|
|
@ -16,13 +16,12 @@ private:
|
||||||
EType x4_type = EType::ZeroSteady;
|
EType x4_type = EType::ZeroSteady;
|
||||||
|
|
||||||
public:
|
public:
|
||||||
CCharAnimTime() = default;
|
constexpr CCharAnimTime() = default;
|
||||||
CCharAnimTime(CInputStream& in) : x0_time(in.readFloatBig()), x4_type(EType(in.readUint32Big())) {}
|
constexpr CCharAnimTime(float time) : x0_time(time), x4_type(x0_time != 0.f ? EType::NonZero : EType::ZeroSteady) {}
|
||||||
CCharAnimTime(float time) : x0_time(time), x4_type(x0_time != 0.f ? EType::NonZero : EType::ZeroSteady) {}
|
constexpr CCharAnimTime(EType type, float t) : x0_time(t), x4_type(type) {}
|
||||||
|
explicit CCharAnimTime(CInputStream& in) : x0_time(in.readFloatBig()), x4_type(EType(in.readUint32Big())) {}
|
||||||
|
|
||||||
CCharAnimTime(EType type, const float& t) : x0_time(t), x4_type(type) {}
|
static constexpr CCharAnimTime Infinity() { return {EType::Infinity, 1.0f}; }
|
||||||
|
|
||||||
static CCharAnimTime Infinity();
|
|
||||||
float GetSeconds() const { return x0_time; }
|
float GetSeconds() const { return x0_time; }
|
||||||
|
|
||||||
bool EqualsZero() const;
|
bool EqualsZero() const;
|
||||||
|
|
Loading…
Reference in New Issue