Move CPASDatabase to Kyoto/Animation

Former-commit-id: 38e19caf18
This commit is contained in:
Henrique Gemignani Passos Lima 2022-10-07 02:10:07 +03:00
parent 01c1b77b2e
commit e75876c5ea
5 changed files with 59 additions and 10 deletions

View File

@ -0,0 +1,39 @@
#ifndef _CPASANIMPARMDATA_HPP
#define _CPASANIMPARMDATA_HPP
#include "Kyoto/Animation/CPASAnimState.hpp"
class CPASAnimParmData {
pas::EAnimationState x0_stateId;
rstl::reserved_vector< CPASAnimParm, 8 > x4_parms;
public:
CPASAnimParmData(pas::EAnimationState stateId,
const CPASAnimParm& parm1 = CPASAnimParm::NoParameter(),
const CPASAnimParm& parm2 = CPASAnimParm::NoParameter(),
const CPASAnimParm& parm3 = CPASAnimParm::NoParameter(),
const CPASAnimParm& parm4 = CPASAnimParm::NoParameter(),
const CPASAnimParm& parm5 = CPASAnimParm::NoParameter(),
const CPASAnimParm& parm6 = CPASAnimParm::NoParameter(),
const CPASAnimParm& parm7 = CPASAnimParm::NoParameter(),
const CPASAnimParm& parm8 = CPASAnimParm::NoParameter())
: x0_stateId(stateId) {
x4_parms.push_back(parm1);
x4_parms.push_back(parm2);
x4_parms.push_back(parm3);
x4_parms.push_back(parm4);
x4_parms.push_back(parm5);
x4_parms.push_back(parm6);
x4_parms.push_back(parm7);
x4_parms.push_back(parm8);
}
pas::EAnimationState GetStateId() const { return x0_stateId; }
const rstl::reserved_vector< CPASAnimParm, 8 >& GetAnimParmData() const { return x4_parms; }
static CPASAnimParmData NoParameters(pas::EAnimationState stateId) {
return CPASAnimParmData(stateId);
}
};
#endif // _CPASANIMPARMDATA_HPP

View File

@ -54,6 +54,13 @@ public:
bool m_bool;
};
static CPASAnimParm FromEnum(s32 val);
static CPASAnimParm FromBool(bool val);
static CPASAnimParm FromReal32(float val);
static CPASAnimParm FromUint32(u32 val);
static CPASAnimParm FromInt32(s32 val);
static CPASAnimParm NoParameter();
private:
UParmValue x0_value;
EParmType x4_type;

View File

@ -3,7 +3,7 @@
#include "types.h"
#include "MetroidPrime/CPASAnimState.hpp"
#include "Kyoto/Animation/CPASAnimState.hpp"
#include "rstl/vector.hpp"
#include "rstl/pair.hpp"

View File

@ -4,10 +4,10 @@
#include "types.h"
#include "MetroidPrime/CEffectComponent.hpp"
#include "MetroidPrime/CPASDatabase.hpp"
#include "Kyoto/IObjectStore.hpp"
#include "Kyoto/Math/CAABox.hpp"
#include "Kyoto/Animation/CPASDatabase.hpp"
#include "rstl/pair.hpp"
#include "rstl/string.hpp"

View File

@ -2,9 +2,12 @@
#include "MetroidPrime/CAnimRes.hpp"
#include "MetroidPrime/CAnimData.hpp"
#include "MetroidPrime/CPASDatabase.hpp"
#include "MetroidPrime/CStateManager.hpp"
#include "Kyoto/Animation/CPASDatabase.hpp"
#include "Kyoto/Animation/CPASAnimParmData.hpp"
CGunMotion::CGunMotion(CAssetId ancsId, const CVector3f& scale)
: x0_modelData(CAnimRes(ancsId, 0, scale, 0, false))
, x4c_gunController(x0_modelData)
@ -21,22 +24,22 @@ bool CGunMotion::PlayPasAnim(SamusGun::EAnimationState state, CStateManager& mgr
bool loop = true;
switch (state) {
case SamusGun::kAS_Wander: {
CPASAnimParmData* parms; //((pas::EAnimationState(state)));
rstl::pair<float, int> anim = pas.FindBestAnimation(*parms, *mgr.GetActiveRandom(), -1);
CPASAnimParmData parms((pas::EAnimationState(state)));
rstl::pair<float, int> anim = pas.FindBestAnimation(parms, *mgr.GetActiveRandom(), -1);
animId = anim.second;
break;
}
case SamusGun::kAS_Idle: {
CPASAnimParmData* parms; //(pas::EAnimationState(state), CPASAnimParm::FromEnum(0));
rstl::pair<float, int> anim = pas.FindBestAnimation(*parms, *mgr.GetActiveRandom(), -1);
CPASAnimParmData parms(pas::EAnimationState(state), CPASAnimParm::FromEnum(0));
rstl::pair<float, int> anim = pas.FindBestAnimation(parms, *mgr.GetActiveRandom(), -1);
animId = anim.second;
break;
}
case SamusGun::kAS_Struck: {
CPASAnimParmData* parms; /*(pas::EAnimationState(state), CPASAnimParm::FromInt32(0),
CPASAnimParmData parms(pas::EAnimationState(state), CPASAnimParm::FromInt32(0),
CPASAnimParm::FromReal32(angle), CPASAnimParm::FromBool(bigStrike),
CPASAnimParm::FromBool(false));*/
rstl::pair<float, int> anim = pas.FindBestAnimation(*parms, *mgr.GetActiveRandom(), -1);
CPASAnimParm::FromBool(false));
rstl::pair<float, int> anim = pas.FindBestAnimation(parms, *mgr.GetActiveRandom(), -1);
animId = anim.second;
loop = false;
break;