Match and link CPASAnimInfo

Former-commit-id: a51e53a6f9
This commit is contained in:
Phillip Stephens 2023-01-11 19:00:40 -08:00
parent a955577934
commit 3eda1af145
4 changed files with 53 additions and 7 deletions

View File

@ -492,7 +492,7 @@ LIBS = [
"Kyoto/Animation/CMetaTransPhaseTrans",
"Kyoto/Animation/CMetaTransSnap",
"Kyoto/Animation/CMetaTransTrans",
"Kyoto/Animation/CPASAnimInfo",
["Kyoto/Animation/CPASAnimInfo", True],
["Kyoto/Animation/CPASAnimParm", True],
"Kyoto/Animation/CPASAnimState",
"Kyoto/Animation/CPASDatabase",

View File

@ -0,0 +1,21 @@
#ifndef _CPASANIMINFO
#define _CPASANIMINFO
#include "Kyoto/Animation/CPASAnimParm.hpp"
#include "rstl/reserved_vector.hpp"
class CPASAnimInfo {
public:
CPASAnimInfo(int id);
CPASAnimInfo(int id, const rstl::reserved_vector<CPASAnimParm::UParmValue, 8>& parms);
int GetAnimId() const { return x0_id; }
CPASAnimParm GetAnimParmData(uint idx, CPASAnimParm::EParmType type) const;
const CPASAnimParm::UParmValue& GetAnimParmValue(uint idx) const;
private:
uint x0_id;
rstl::reserved_vector< CPASAnimParm::UParmValue, 8 > x4_parms;
};
#endif // _CPASANIMINFO

View File

@ -3,6 +3,7 @@
#include "types.h"
#include "Kyoto/Animation/CPASAnimInfo.hpp"
#include "Kyoto/Animation/CPASAnimParm.hpp"
#include "Kyoto/Animation/CPASParmInfo.hpp"
#include "Kyoto/Animation/CharacterCommon.hpp"
@ -10,12 +11,6 @@
#include "rstl/reserved_vector.hpp"
#include "rstl/vector.hpp"
class CPASAnimInfo {
private:
uint x0_id;
rstl::reserved_vector< CPASAnimParm::UParmValue, 8 > x4_parms;
};
class CPASAnimState {
public:
CPASAnimParm GetAnimParmData(int, unsigned int) const;

View File

@ -0,0 +1,30 @@
#include "Kyoto/Animation/CPASAnimInfo.hpp"
CPASAnimInfo::CPASAnimInfo(int id) : x0_id(id) {}
CPASAnimInfo::CPASAnimInfo(int id,
const rstl::reserved_vector< CPASAnimParm::UParmValue, 8 >& parms)
: x0_id(id), x4_parms(parms) {}
CPASAnimParm CPASAnimInfo::GetAnimParmData(uint idx, CPASAnimParm::EParmType type) const {
const CPASAnimParm::UParmValue& parm = x4_parms[idx];
switch (type) {
case CPASAnimParm::kPT_Int32:
return CPASAnimParm::FromInt32(parm.m_int);
case CPASAnimParm::kPT_UInt32:
return CPASAnimParm::FromUint32(parm.m_uint);
case CPASAnimParm::kPT_Float:
return CPASAnimParm::FromReal32(parm.m_float);
case CPASAnimParm::kPT_Bool:
return CPASAnimParm::FromBool(parm.m_bool);
case CPASAnimParm::kPT_Enum:
return CPASAnimParm::FromEnum(parm.m_int);
default:
return CPASAnimParm::NoParameter();
}
}
const CPASAnimParm::UParmValue& CPASAnimInfo::GetAnimParmValue(uint idx) const {
return x4_parms[idx];
}