Add Kyoto headers

This commit is contained in:
Henrique Gemignani Passos Lima
2023-08-08 02:18:41 +03:00
parent 3d13f8a787
commit 6dbdf40b06
157 changed files with 7813 additions and 0 deletions
@@ -0,0 +1,24 @@
#ifndef _CANIMSYSCONTEXT
#define _CANIMSYSCONTEXT
#include "Kyoto/TToken.hpp"
#include "rstl/rc_ptr.hpp"
class CTransitionDatabaseGame;
class CRandom16;
class CSimplePool;
class CAnimSysContext {
public:
CAnimSysContext(const TToken< CTransitionDatabaseGame >& transDb,
const rstl::ncrc_ptr< CRandom16 >& random, CSimplePool& store)
: x0_transDb(transDb), x8_random(random), xc_store(store) {}
private:
TToken< CTransitionDatabaseGame > x0_transDb;
rstl::rc_ptr< CRandom16 > x8_random;
CSimplePool& xc_store;
};
#endif // _CANIMSYSCONTEXT
+14
View File
@@ -0,0 +1,14 @@
#ifndef _CANIMTREENODE
#define _CANIMTREENODE
#include "Kyoto/Animation/IAnimReader.hpp"
class CAnimTreeNode : public IAnimReader {
public:
virtual CAnimTreeEffectiveContribution VGetContributionOfHighestInfluence() const = 0;
CAnimTreeEffectiveContribution GetContributionOfHighestInfluence() const {
return VGetContributionOfHighestInfluence();
}
};
#endif // _CANIMTREENODE
+20
View File
@@ -0,0 +1,20 @@
#ifndef _CANIMATION
#define _CANIMATION
#include "rstl/rc_ptr.hpp"
#include "rstl/string.hpp"
class IMetaAnim;
class CInputStream;
class CAnimation {
public:
CAnimation(CInputStream& in);
const rstl::rc_ptr< IMetaAnim >& GetMetaAnim() const { return x10_anim; }
private:
rstl::string x0_name;
rstl::rc_ptr< IMetaAnim > x10_anim;
};
#endif // _CANIMATION
@@ -0,0 +1,17 @@
#ifndef _CANIMATIONMANAGER
#define _CANIMATIONMANAGER
#include "Kyoto/TToken.hpp"
class CAnimationManager {
public:
//CAnimationManager(const TToken<CAnimationDatabase>& animDB, const CAnimSysContext& sysCtx);
private:
//TToken< CAnimationDatabase > x0_animDB;
//CAnimSysContext x8_sysCtx;
};
#endif // _CANIMATIONMANAGER
+21
View File
@@ -0,0 +1,21 @@
#ifndef _CBOOLPOINODE
#define _CBOOLPOINODE
#include "Kyoto/Animation/CPOINode.hpp"
class CBoolPOINode : public CPOINode {
public:
CBoolPOINode(rstl::string name, ushort type, const CCharAnimTime& time, int index, bool unique,
float weight, int charIdx, int flags, bool value);
// : CPOINode(name, type, time, index, unique, weight, charIdx, flags), x38_val(value) {}
CBoolPOINode(CInputStream& in);
static CBoolPOINode CopyNodeMinusStartTime(const CBoolPOINode& node,
const CCharAnimTime& startTime);
bool GetValue() const { return x38_val; }
private:
bool x38_val;
};
#endif // _CBOOLPOINODE
@@ -0,0 +1,17 @@
#ifndef _CCHARANIMMEMORYMETRICS
#define _CCHARANIMMEMORYMETRICS
#include <types.h>
class CCharAnimMemoryMetrics {
public:
enum EAnimSubSystem {
kASS_Zero,
kASS_One,
kASS_Two,
};
static void AddToTotalSize(uint size, EAnimSubSystem subSystem);
};
#endif // _CCHARANIMMEMORYMETRICS
+47
View File
@@ -0,0 +1,47 @@
#ifndef _CCHARANIMTIME
#define _CCHARANIMTIME
#include "types.h"
class COutputStream;
class CInputStream;
class CCharAnimTime {
public:
enum EType {
kT_NonZero,
kT_ZeroIncreasing,
kT_ZeroSteady,
kT_ZeroDecreasing,
kT_Infinity,
};
float GetSeconds() const { return x0_time; }
explicit CCharAnimTime(CInputStream& in);
explicit CCharAnimTime(float time);
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) {}
bool operator>(const CCharAnimTime& other) const;
bool operator==(const CCharAnimTime& other) const;
bool operator!=(const CCharAnimTime& other) const;
bool operator<(const CCharAnimTime& other) const;
float operator/(const CCharAnimTime& other) const;
float 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); }
private:
float x0_time;
EType x4_type;
};
CHECK_SIZEOF(CCharAnimTime, 0x8)
#endif // _CCHARANIMTIME
@@ -0,0 +1,47 @@
#ifndef _CCHARACTERINFO
#define _CCHARACTERINFO
#include "types.h"
#include "Kyoto/Animation/CEffectComponent.hpp"
#include "Kyoto/Animation/CPASDatabase.hpp"
#include "Kyoto/IObjectStore.hpp"
#include "Kyoto/Math/CAABox.hpp"
#include "rstl/pair.hpp"
#include "rstl/string.hpp"
#include "rstl/vector.hpp"
class CCharacterInfo {
public:
class CParticleResData {
private:
rstl::vector< CAssetId > x0_part;
rstl::vector< CAssetId > x10_swhc;
rstl::vector< CAssetId > x20_elsc;
rstl::vector< CAssetId > x30_elsc;
};
const CPASDatabase& GetPASDatabase() const { return x30_pasDatabase; }
const rstl::vector< rstl::pair< rstl::string, CAABox > >& GetAnimBBoxList() const { return x88_aabbs; }
private:
ushort x0_tableCount;
rstl::string x4_name;
CAssetId x14_cmdl;
CAssetId x18_cksr;
CAssetId x1c_cinf;
rstl::vector< rstl::pair< int, rstl::pair< rstl::string, rstl::string > > > x20_animInfo;
CPASDatabase x30_pasDatabase;
CParticleResData x44_partRes;
uint x84_unk;
rstl::vector< rstl::pair< rstl::string, CAABox > > x88_aabbs;
rstl::vector< rstl::pair< rstl::string, rstl::vector< CEffectComponent > > > x98_effects;
uint xa8_cmdlOverlay;
uint xac_cksrOverlay;
rstl::vector< int > xb0_animIdxs;
};
CHECK_SIZEOF(CCharacterInfo, 0xc0)
#endif // _CCHARACTERINFO
@@ -0,0 +1,18 @@
#ifndef _CEFFECTCOMPONENT
#define _CEFFECTCOMPONENT
#include "types.h"
#include "Kyoto/Particles/CParticleData.hpp"
class CEffectComponent {
private:
rstl::string x0_name;
SObjectTag x10_tag;
rstl::string x18_boneName;
float x28_scale;
CParticleData::EParentedMode x2c_parentedMode;
uint x30_flags;
};
#endif // _CEFFECTCOMPONENT
@@ -0,0 +1,17 @@
#ifndef _CHALFTRANSITION
#define _CHALFTRANSITION
#include "rstl/rc_ptr.hpp"
class IMetaTrans;
class CInputStream;
class CHalfTransition {
public:
explicit CHalfTransition(CInputStream& in);
private:
uint x0_id;
rstl::rc_ptr<IMetaTrans> x4_trans;
};
#endif // _CHALFTRANSITION
+27
View File
@@ -0,0 +1,27 @@
#ifndef _CINT32POINODE
#define _CINT32POINODE
#include "Kyoto/Animation/CPOINode.hpp"
class CInt32POINode : public CPOINode {
public:
CInt32POINode(rstl::string name, ushort type, const CCharAnimTime& time, int index, bool unique,
float weight, int charIdx, int flags, int value, const rstl::string& locatorName);
/*: CPOINode(name, type, time, index, unique, weight, charIdx, flags)
, x38_val(value)
, x3c_lctrName(locatorName) {} */
explicit CInt32POINode(CInputStream& in);
static CInt32POINode CopyNodeMinusStartTime(const CInt32POINode& node,
const CCharAnimTime& startTime);
int GetValue() const { return x38_val; }
const rstl::string& GetLocatorName() const { return x3c_lctrName; }
private:
int x38_val;
rstl::string x3c_lctrName;
};
#endif // _CINT32POINODE
@@ -0,0 +1,13 @@
#ifndef _CMETAANIMFACTORY
#define _CMETAANIMFACTORY
#include "rstl/rc_ptr.hpp"
class IMetaAnim;
class CInputStream;
class CMetaAnimFactory {
public:
static rstl::rc_ptr< IMetaAnim > CreateMetaAnim(CInputStream& in);
};
#endif // _CMETAANIMFACTORY
@@ -0,0 +1,13 @@
#ifndef _CMETATRANSFACTORY
#define _CMETATRANSFACTORY
#include "rstl/rc_ptr.hpp"
class IMetaTrans;
class CInputStream;
class CMetaTransFactory {
public:
static rstl::rc_ptr< IMetaTrans > CreateMetaTrans(CInputStream& in);
};
#endif // _CMETATRANSFACTORY
+21
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
+46
View File
@@ -0,0 +1,46 @@
#ifndef _CPASANIMPARM
#define _CPASANIMPARM
#include "types.h"
class CPASAnimParm {
public:
enum EParmType {
kPT_None = -1,
kPT_Int32 = 0,
kPT_UInt32 = 1,
kPT_Float = 2,
kPT_Bool = 3,
kPT_Enum = 4,
};
union UParmValue {
int m_int;
uint m_uint;
float m_float;
bool m_bool;
};
CPASAnimParm(UParmValue value, EParmType type);
static CPASAnimParm NoParameter();
static CPASAnimParm FromInt32(int value);
static CPASAnimParm FromUint32(uint value);
static CPASAnimParm FromReal32(float value);
static CPASAnimParm FromBool(bool val);
static CPASAnimParm FromEnum(int value);
int GetInt32Value() const;
uint GetUint32Value() const;
float GetReal32Value() const;
bool GetBoolValue() const;
int GetEnumValue() const;
UParmValue GetParameter() { return x0_value; }
private:
UParmValue x0_value;
EParmType x4_type;
};
#endif // _CPASANIMPARM
@@ -0,0 +1,42 @@
#ifndef _CPASANIMPARMDATA
#define _CPASANIMPARMDATA
#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);
}
*/
~CPASAnimParmData() {}
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
+29
View File
@@ -0,0 +1,29 @@
#ifndef _CPASANIMSTATE
#define _CPASANIMSTATE
#include "types.h"
#include "Kyoto/Animation/CPASAnimInfo.hpp"
#include "Kyoto/Animation/CPASAnimParm.hpp"
#include "Kyoto/Animation/CPASParmInfo.hpp"
#include "Kyoto/Animation/CharacterCommon.hpp"
#include "rstl/reserved_vector.hpp"
#include "rstl/vector.hpp"
class CPASAnimState {
public:
CPASAnimParm GetAnimParmData(int, unsigned int) const;
pas::EAnimationState GetStateId() const { return x0_id; }
bool HasAnims() const { return static_cast< uint >(x14_anims.size()) != 0; }
private:
pas::EAnimationState x0_id;
rstl::vector< CPASParmInfo > x4_parms;
rstl::vector< CPASAnimInfo > x14_anims;
rstl::vector< int > x24_selectionCache;
};
CHECK_SIZEOF(CPASAnimState, 0x34)
#endif // _CPASANIMSTATE
+39
View File
@@ -0,0 +1,39 @@
#ifndef _CPASDATABASE
#define _CPASDATABASE
#include "types.h"
#include "Kyoto/Animation/CPASAnimState.hpp"
#include "rstl/pair.hpp"
#include "rstl/vector.hpp"
class CPASAnimParmData;
class CRandom16;
class CPASDatabase {
public:
bool HasState(int id) const;
const CPASAnimState* GetAnimState(int) const;
rstl::pair< float, int > FindBestAnimation(const CPASAnimParmData& data, int ignoreAnim) const;
rstl::pair< float, int > FindBestAnimation(const CPASAnimParmData&, CRandom16&, int) const;
size_t GetNumAnimStates() const; // { return x0_states.size(); }
const CPASAnimState* GetAnimStateByIndex(int index) const; /* {
if (index >= x0_states.size()) {
return nullptr;
}
return &x0_states[index];
}*/
int GetDefaultState() const { return x10_defaultState; }
private:
rstl::vector< CPASAnimState > x0_states;
int x10_defaultState;
};
CHECK_SIZEOF(CPASDatabase, 0x14)
#endif // _CPASDATABASE
+33
View File
@@ -0,0 +1,33 @@
#ifndef _CPASPARMINFO
#define _CPASPARMINFO
#include "Kyoto/Animation/CPASAnimParm.hpp"
class CInputStream;
class CPASParmInfo {
public:
enum EWeightFunction {
kWF_Invalid = -1,
kWF_ExactMatch,
kWF_PercentError,
kWF_AngularPercent,
kWF_NoWeight,
};
CPASParmInfo(CInputStream& in);
CPASAnimParm::EParmType GetParameterType() const { return x0_type; }
EWeightFunction GetWeightFunction() const { return x4_weightFunction; }
float GetWeight() const { return x8_weight; }
CPASAnimParm::UParmValue GetParameterMinValue() const { return xc_min; }
CPASAnimParm::UParmValue GetParameterMaxValue() const { return x10_max; }
private:
CPASAnimParm::EParmType x0_type;
EWeightFunction x4_weightFunction;
float x8_weight;
CPASAnimParm::UParmValue xc_min;
CPASAnimParm::UParmValue x10_max;
};
#endif // _CPASPARMINFO
+55
View File
@@ -0,0 +1,55 @@
#ifndef _CPOINODE
#define _CPOINODE
#include "types.h"
#include "Kyoto/Animation/CCharAnimTime.hpp"
#include "rstl/string.hpp"
enum EPOIType {
kPT_Loop = 0,
kPT_EmptyBool = 1,
kPT_EmptyInt32 = 2,
kPT_SoundInt32 = 4,
kPT_Particle = 5,
kPT_UserEvent = 6,
kPT_RandRate = 7,
kPT_Sound = 8,
};
class CInputStream;
class CPOINode {
public:
CPOINode(const rstl::string& name, ushort type, const CCharAnimTime& time, int index, bool unique,
float weight, int charIdx, int flags);
CPOINode(CInputStream& in);
virtual ~CPOINode() {}
const rstl::string& GetString() const { return x8_name; }
const EPOIType GetPoiType() const { return static_cast< EPOIType >(x18_type); }
const CCharAnimTime& GetTime() const { return x1c_time; }
const int GetIndex() const { return x24_index; }
const bool GetSaveState() const { return x28_unique; }
const float GetWeight() const { return x2c_weight; }
const int GetCharacterIndex() const { return x30_charIdx; }
const int GetFlags() const { return x34_flags; }
bool operator>(const CPOINode& other) const;
bool operator<(const CPOINode& other) const;
static int compare(const void* a, const void* b);
protected:
ushort x4_;
rstl::string x8_name;
ushort x18_type;
CCharAnimTime x1c_time;
int x24_index;
bool x28_unique;
float x2c_weight;
int x30_charIdx;
int x34_flags;
};
CHECK_SIZEOF(CPOINode, 0x38)
#endif // _CPOINODE

Some files were not shown because too many files have changed in this diff Show More