2018-10-07 03:42:33 +00:00
|
|
|
#pragma once
|
2016-04-10 04:49:02 +00:00
|
|
|
|
|
|
|
#include "RetroTypes.hpp"
|
|
|
|
|
2018-12-08 05:30:43 +00:00
|
|
|
namespace urde {
|
2016-04-10 04:49:02 +00:00
|
|
|
|
2018-12-08 05:30:43 +00:00
|
|
|
class CPASAnimParm {
|
2016-04-10 04:49:02 +00:00
|
|
|
public:
|
2018-12-08 05:30:43 +00:00
|
|
|
enum class EParmType { None = -1, Int32 = 0, UInt32 = 1, Float = 2, Bool = 3, Enum = 4 };
|
|
|
|
union UParmValue {
|
|
|
|
s32 m_int;
|
|
|
|
u32 m_uint;
|
|
|
|
float m_float;
|
|
|
|
bool m_bool;
|
|
|
|
};
|
2016-04-10 04:49:02 +00:00
|
|
|
|
|
|
|
private:
|
2018-12-08 05:30:43 +00:00
|
|
|
UParmValue x0_value;
|
|
|
|
EParmType x4_type;
|
|
|
|
|
2016-04-10 04:49:02 +00:00
|
|
|
public:
|
2018-12-08 05:30:43 +00:00
|
|
|
CPASAnimParm(UParmValue val, EParmType tp) : x0_value(val), x4_type(tp) {}
|
2016-04-10 04:49:02 +00:00
|
|
|
|
2018-12-08 05:30:43 +00:00
|
|
|
EParmType GetParameterType() const { return x4_type; }
|
|
|
|
s32 GetEnumValue() const { return x0_value.m_int; }
|
|
|
|
bool GetBoolValue() const { return x0_value.m_bool; }
|
|
|
|
float GetReal32Value() const { return x0_value.m_float; }
|
|
|
|
u32 GetUint32Value() const { return x0_value.m_uint; }
|
|
|
|
s32 GetInt32Value() const { return x0_value.m_int; }
|
2016-04-10 04:49:02 +00:00
|
|
|
|
2018-12-08 05:30:43 +00:00
|
|
|
static CPASAnimParm FromEnum(s32 val) {
|
|
|
|
UParmValue valin;
|
|
|
|
valin.m_int = val;
|
|
|
|
return CPASAnimParm(valin, EParmType::Enum);
|
|
|
|
}
|
2016-04-10 04:49:02 +00:00
|
|
|
|
2018-12-08 05:30:43 +00:00
|
|
|
static CPASAnimParm FromBool(bool val) {
|
|
|
|
UParmValue valin;
|
|
|
|
valin.m_bool = val;
|
|
|
|
return CPASAnimParm(valin, EParmType::Bool);
|
|
|
|
}
|
2016-04-10 04:49:02 +00:00
|
|
|
|
2018-12-08 05:30:43 +00:00
|
|
|
static CPASAnimParm FromReal32(float val) {
|
|
|
|
UParmValue valin;
|
|
|
|
valin.m_float = val;
|
|
|
|
return CPASAnimParm(valin, EParmType::Float);
|
|
|
|
}
|
2016-04-10 04:49:02 +00:00
|
|
|
|
2018-12-08 05:30:43 +00:00
|
|
|
static CPASAnimParm FromUint32(u32 val) {
|
|
|
|
UParmValue valin;
|
|
|
|
valin.m_uint = val;
|
|
|
|
return CPASAnimParm(valin, EParmType::UInt32);
|
|
|
|
}
|
2016-04-10 04:49:02 +00:00
|
|
|
|
2018-12-08 05:30:43 +00:00
|
|
|
static CPASAnimParm FromInt32(s32 val) {
|
|
|
|
UParmValue valin;
|
|
|
|
valin.m_int = val;
|
|
|
|
return CPASAnimParm(valin, EParmType::Int32);
|
|
|
|
}
|
2016-04-10 04:49:02 +00:00
|
|
|
|
2018-12-08 05:30:43 +00:00
|
|
|
static CPASAnimParm NoParameter() {
|
|
|
|
UParmValue valin;
|
|
|
|
valin.m_int = -1;
|
|
|
|
return CPASAnimParm(valin, EParmType::None);
|
|
|
|
}
|
2016-04-10 04:49:02 +00:00
|
|
|
};
|
|
|
|
|
2018-12-08 05:30:43 +00:00
|
|
|
} // namespace urde
|