mirror of
https://github.com/PrimeDecomp/prime.git
synced 2025-12-08 15:04:54 +00:00
Merge branch 'main' of github.com:PrimeDecomp/prime
This commit is contained in:
32
include/Collision/CMaterialFilter.hpp
Normal file
32
include/Collision/CMaterialFilter.hpp
Normal file
@@ -0,0 +1,32 @@
|
||||
#ifndef _CMATERIALFILTER_HPP
|
||||
#define _CMATERIALFILTER_HPP
|
||||
|
||||
#include "types.h"
|
||||
|
||||
#include "Collision/CMaterialList.hpp"
|
||||
|
||||
class CMaterialFilter {
|
||||
public:
|
||||
enum EFilterType {
|
||||
kFT_Always,
|
||||
kFT_Include,
|
||||
kFT_Exclude,
|
||||
kFT_IncludeExclude,
|
||||
};
|
||||
|
||||
CMaterialFilter() : type(kFT_Always) {}
|
||||
CMaterialFilter(const CMaterialList& include, const CMaterialList& exclude, EFilterType type)
|
||||
: include(include), exclude(exclude), type(type) {}
|
||||
|
||||
static CMaterialFilter MakeIncludeExclude(const CMaterialList& include, const CMaterialList& exclude) {
|
||||
return CMaterialFilter(include, exclude, kFT_IncludeExclude);
|
||||
}
|
||||
|
||||
private:
|
||||
CMaterialList include;
|
||||
CMaterialList exclude;
|
||||
EFilterType type;
|
||||
};
|
||||
CHECK_SIZEOF(CMaterialFilter, 0x18)
|
||||
|
||||
#endif
|
||||
91
include/Collision/CMaterialList.hpp
Normal file
91
include/Collision/CMaterialList.hpp
Normal file
@@ -0,0 +1,91 @@
|
||||
#ifndef _CMATERIALLIST_HPP
|
||||
#define _CMATERIALLIST_HPP
|
||||
|
||||
#include "types.h"
|
||||
|
||||
enum EMaterialTypes {
|
||||
kMT_NoStepLogic = 0,
|
||||
kMT_Stone = 1,
|
||||
kMT_Metal = 2,
|
||||
kMT_Grass = 3,
|
||||
kMT_Ice = 4,
|
||||
kMT_Pillar = 5,
|
||||
kMT_MetalGrating = 6,
|
||||
kMT_Phazon = 7,
|
||||
kMT_Dirt = 8,
|
||||
kMT_Lava = 9,
|
||||
kMT_LavaStone = 10,
|
||||
kMT_Snow = 11,
|
||||
kMT_MudSlow = 12,
|
||||
kMT_HalfPipe = 13,
|
||||
kMT_Mud = 14,
|
||||
kMT_Glass = 15,
|
||||
kMT_Shield = 16,
|
||||
kMT_Sand = 17,
|
||||
kMT_ProjectilePassthrough = 18,
|
||||
kMT_Solid = 19,
|
||||
kMT_NoPlatformCollision = 20,
|
||||
kMT_CameraPassthrough = 21,
|
||||
kMT_Wood = 22,
|
||||
kMT_Organic = 23,
|
||||
kMT_NoEdgeCollision = 24,
|
||||
kMT_RedundantEdgeOrFlippedTri = 25,
|
||||
kMT_SeeThrough = 26,
|
||||
kMT_ScanPassthrough = 27,
|
||||
kMT_AIPassthrough = 28,
|
||||
kMT_Ceiling = 29,
|
||||
kMT_Wall = 30,
|
||||
kMT_Floor = 31,
|
||||
kMT_Player = 32,
|
||||
kMT_Character = 33,
|
||||
kMT_Trigger = 34,
|
||||
kMT_Projectile = 35,
|
||||
kMT_Bomb = 36,
|
||||
kMT_GroundCollider = 37,
|
||||
kMT_NoStaticCollision = 38,
|
||||
kMT_Scannable = 39,
|
||||
kMT_Target = 40,
|
||||
kMT_Orbit = 41,
|
||||
kMT_Occluder = 42,
|
||||
kMT_Immovable = 43,
|
||||
kMT_Debris = 44,
|
||||
kMT_PowerBomb = 45,
|
||||
kMT_Unknown46 = 46,
|
||||
kMT_CollisionActor = 47,
|
||||
kMT_AIBlock = 48,
|
||||
kMT_Platform = 49,
|
||||
kMT_NonSolidDamageable = 50,
|
||||
kMT_RadarObject = 51,
|
||||
kMT_PlatformSlave = 52,
|
||||
kMT_AIJoint = 53,
|
||||
kMT_Unknown54 = 54,
|
||||
kMT_SolidCharacter = 55,
|
||||
kMT_ExcludeFromLineOfSightTest = 56,
|
||||
kMT_ExcludeFromRadar = 57,
|
||||
kMT_NoPlayerCollision = 58,
|
||||
kMT_SixtyThree = 63
|
||||
};
|
||||
|
||||
// TODO: how else would they end up in .data?
|
||||
static EMaterialTypes SolidMaterial = kMT_Solid;
|
||||
|
||||
class CMaterialList {
|
||||
public:
|
||||
CMaterialList() : value(0) {}
|
||||
CMaterialList(EMaterialTypes material) : value(u64(1) << material) {}
|
||||
CMaterialList(u64 value) : value(value) {}
|
||||
|
||||
void Add(EMaterialTypes material) {
|
||||
value |= u64(1) << material;
|
||||
}
|
||||
const CMaterialList& Union(const CMaterialList& other) {
|
||||
value |= other.value;
|
||||
return *this;
|
||||
}
|
||||
|
||||
private:
|
||||
u64 value;
|
||||
};
|
||||
CHECK_SIZEOF(CMaterialList, 0x8)
|
||||
|
||||
#endif
|
||||
11
include/Kyoto/Audio/CAudioSys.hpp
Normal file
11
include/Kyoto/Audio/CAudioSys.hpp
Normal file
@@ -0,0 +1,11 @@
|
||||
#ifndef _CAUDIOSYS_HPP
|
||||
#define _CAUDIOSYS_HPP
|
||||
|
||||
#include "types.h"
|
||||
|
||||
class CAudioSys {
|
||||
public:
|
||||
static const u8 kMaxVolume;
|
||||
};
|
||||
|
||||
#endif
|
||||
@@ -3,7 +3,7 @@
|
||||
|
||||
#include "types.h"
|
||||
|
||||
#include "Kyoto/CToken.hpp"
|
||||
#include "Kyoto/TToken.hpp"
|
||||
#include "Kyoto/IObjectStore.hpp"
|
||||
#include "Kyoto/Streams/CInputStream.hpp"
|
||||
|
||||
@@ -21,7 +21,7 @@ public:
|
||||
// : obj(TToken< T >::GetIObjObjectFor(ptr).release()) {}
|
||||
|
||||
private:
|
||||
rstl::auto_ptr< TObjOwnerDerivedFromIObjUntyped > obj;
|
||||
rstl::auto_ptr< CObjOwnerDerivedFromIObjUntyped > obj;
|
||||
};
|
||||
|
||||
CFactoryFnReturn FStringTableFactory(const SObjectTag& tag, CInputStream& in, const CVParamTransfer& xfer);
|
||||
|
||||
@@ -5,11 +5,20 @@
|
||||
|
||||
#include "rstl/map.hpp"
|
||||
|
||||
#include "Kyoto/CToken.hpp"
|
||||
#include "Kyoto/IObjectStore.hpp"
|
||||
|
||||
class CSimplePool {
|
||||
public:
|
||||
virtual ~CSimplePool() {}
|
||||
virtual CToken GetObj(const SObjectTag& tag, CVParamTransfer xfer);
|
||||
virtual CToken GetObj(const SObjectTag& tag);
|
||||
virtual CToken GetObj(const char* name);
|
||||
virtual CToken GetObj(const char* name, CVParamTransfer xfer);
|
||||
virtual bool HasObject(const SObjectTag& tag);
|
||||
virtual bool ObjectIsLive(const SObjectTag& tag);
|
||||
virtual unkptr GetFactory();
|
||||
virtual void Flush();
|
||||
virtual void ObjectUnreferenced(const SObjectTag& tag);
|
||||
|
||||
private:
|
||||
u8 x4_;
|
||||
|
||||
@@ -5,58 +5,18 @@
|
||||
|
||||
#include "Kyoto/IObjectStore.hpp"
|
||||
|
||||
#include "rstl/auto_ptr.hpp"
|
||||
|
||||
class CToken {
|
||||
public:
|
||||
CToken() {}
|
||||
CToken(IObj* obj) : x0_objRef(new CObjectReference(obj)), x4_lockHeld(false) {}
|
||||
CToken(const CToken& other);
|
||||
~CToken();
|
||||
|
||||
void Lock();
|
||||
|
||||
private:
|
||||
CObjectReference* x0_objRef;
|
||||
bool x4_lockHeld;
|
||||
};
|
||||
|
||||
class IObj {
|
||||
public:
|
||||
virtual ~IObj() {}
|
||||
};
|
||||
|
||||
class TObjOwnerDerivedFromIObjUntyped : public IObj {
|
||||
public:
|
||||
template < typename T >
|
||||
TObjOwnerDerivedFromIObjUntyped(const rstl::auto_ptr< T >& obj) : m_objPtr(obj.release()) {}
|
||||
|
||||
protected:
|
||||
void* m_objPtr;
|
||||
};
|
||||
|
||||
template < typename T >
|
||||
class TObjOwnerDerivedFromIObj : public TObjOwnerDerivedFromIObjUntyped {
|
||||
TObjOwnerDerivedFromIObj(const rstl::auto_ptr< T >& obj) : TObjOwnerDerivedFromIObjUntyped(obj) {}
|
||||
|
||||
public:
|
||||
static rstl::auto_ptr< TObjOwnerDerivedFromIObj< T > > GetNewDerivedObject(const rstl::auto_ptr< T >& obj) {
|
||||
return new TObjOwnerDerivedFromIObj< T >(obj);
|
||||
}
|
||||
~TObjOwnerDerivedFromIObj() override { delete Owned(); }
|
||||
T* Owned() { return static_cast< T* >(m_objPtr); }
|
||||
};
|
||||
|
||||
template < typename T >
|
||||
class TToken : public CToken {
|
||||
public:
|
||||
static rstl::auto_ptr< TObjOwnerDerivedFromIObj< T > > GetIObjObjectFor(const rstl::auto_ptr< T >& obj) {
|
||||
return TObjOwnerDerivedFromIObj< T >::GetNewDerivedObject(obj);
|
||||
}
|
||||
};
|
||||
|
||||
template < typename T >
|
||||
class TCachedToken : public TToken< T > {
|
||||
private:
|
||||
T* x8_item;
|
||||
};
|
||||
|
||||
template < typename T >
|
||||
class TLockedToken : public TCachedToken< T > {};
|
||||
|
||||
#endif
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
|
||||
#include "types.h"
|
||||
|
||||
#include "Kyoto/Math/CColor.hpp"
|
||||
#include "Kyoto/Graphics/CColor.hpp"
|
||||
#include "Kyoto/Math/CVector3f.hpp"
|
||||
|
||||
#include "Kyoto/Graphics/CTevCombiners.hpp"
|
||||
|
||||
38
include/Kyoto/IObj.hpp
Normal file
38
include/Kyoto/IObj.hpp
Normal file
@@ -0,0 +1,38 @@
|
||||
#ifndef _IOBJ_HPP
|
||||
#define _IOBJ_HPP
|
||||
|
||||
#include "types.h"
|
||||
|
||||
#include "rstl/auto_ptr.hpp"
|
||||
|
||||
class IObj {
|
||||
public:
|
||||
virtual ~IObj() {}
|
||||
};
|
||||
|
||||
class CObjOwnerDerivedFromIObjUntyped : public IObj {
|
||||
public:
|
||||
template < typename T >
|
||||
CObjOwnerDerivedFromIObjUntyped(T* obj) : m_objPtr(obj) {}
|
||||
template < typename T >
|
||||
CObjOwnerDerivedFromIObjUntyped(const rstl::auto_ptr< T >& obj) : m_objPtr(obj.release()) {}
|
||||
|
||||
protected:
|
||||
void* m_objPtr;
|
||||
};
|
||||
|
||||
template < typename T >
|
||||
class TObjOwnerDerivedFromIObj : public CObjOwnerDerivedFromIObjUntyped {
|
||||
TObjOwnerDerivedFromIObj(T* obj) : CObjOwnerDerivedFromIObjUntyped(obj) {}
|
||||
TObjOwnerDerivedFromIObj(const rstl::auto_ptr< T >& obj) : CObjOwnerDerivedFromIObjUntyped(obj) {}
|
||||
|
||||
public:
|
||||
static rstl::auto_ptr< TObjOwnerDerivedFromIObj< T > > GetNewDerivedObject(T* obj) { return new TObjOwnerDerivedFromIObj< T >(obj); }
|
||||
static rstl::auto_ptr< TObjOwnerDerivedFromIObj< T > > GetNewDerivedObject(const rstl::auto_ptr< T >& obj) {
|
||||
return new TObjOwnerDerivedFromIObj< T >(obj);
|
||||
}
|
||||
~TObjOwnerDerivedFromIObj() override { delete Owned(); }
|
||||
T* Owned() { return static_cast< T* >(m_objPtr); }
|
||||
};
|
||||
|
||||
#endif
|
||||
@@ -3,8 +3,11 @@
|
||||
|
||||
#include "types.h"
|
||||
|
||||
#include "rstl/auto_ptr.hpp"
|
||||
#include "rstl/rc_ptr.hpp"
|
||||
|
||||
#define kInvalidAssetId 0xFFFFFFFFu
|
||||
|
||||
typedef u32 CAssetId;
|
||||
typedef u32 FourCC;
|
||||
|
||||
@@ -12,17 +15,36 @@ struct SObjectTag {
|
||||
FourCC type;
|
||||
CAssetId id;
|
||||
|
||||
SObjectTag() {}
|
||||
SObjectTag(FourCC type, CAssetId id) : type(type), id(id) {}
|
||||
SObjectTag(const SObjectTag& other) : type(other.type), id(other.id) {}
|
||||
};
|
||||
|
||||
class IObjectStore;
|
||||
class IObj;
|
||||
class CVParamTransfer {
|
||||
public:
|
||||
static CVParamTransfer Null();
|
||||
|
||||
private:
|
||||
rstl::rc_ptr< void > x0_;
|
||||
};
|
||||
class CObjectReference {
|
||||
public:
|
||||
CObjectReference(const rstl::auto_ptr< IObj >& obj);
|
||||
// : x0_refCount(0)
|
||||
// , x2_locked(false)
|
||||
// , x2_lockCount(0)
|
||||
// , xc_objectStore(nullptr)
|
||||
// , x10_object(obj.release())
|
||||
// , x14_params(CVParamTransfer::Null()) {}
|
||||
|
||||
CObjectReference(IObjectStore* store, const rstl::auto_ptr< IObj >& obj, SObjectTag tag, CVParamTransfer xfer);
|
||||
|
||||
private:
|
||||
u16 x0_refCount;
|
||||
u16 x2_lockCount;
|
||||
bool x2_locked : 1;
|
||||
u16 x2_lockCount : 15;
|
||||
SObjectTag x4_objTag;
|
||||
IObjectStore* xc_objectStore;
|
||||
IObj* x10_object;
|
||||
|
||||
23
include/Kyoto/Input/CRumbleGenerator.hpp
Normal file
23
include/Kyoto/Input/CRumbleGenerator.hpp
Normal file
@@ -0,0 +1,23 @@
|
||||
#ifndef _CRUMBLEGENERATOR_HPP
|
||||
#define _CRUMBLEGENERATOR_HPP
|
||||
|
||||
#include "types.h"
|
||||
|
||||
#include "Kyoto/Input/CRumbleVoice.hpp"
|
||||
|
||||
enum EMotorState {
|
||||
kMS_Stop, // = PAD_MOTOR_STOP,
|
||||
kMS_Rumble, // = PAD_MOTOR_RUMBLE,
|
||||
kMS_StopHard, // = PAD_MOTOR_STOP_HARD,
|
||||
};
|
||||
|
||||
class CRumbleGenerator {
|
||||
private:
|
||||
CRumbleVoice x0_voices[4];
|
||||
f32 xc0_periodTime[4];
|
||||
f32 xd0_onTime[4];
|
||||
EMotorState xe0_commandArray[4];
|
||||
bool xf0_24_disabled : 1;
|
||||
};
|
||||
|
||||
#endif
|
||||
57
include/Kyoto/Input/CRumbleVoice.hpp
Normal file
57
include/Kyoto/Input/CRumbleVoice.hpp
Normal file
@@ -0,0 +1,57 @@
|
||||
#ifndef _CRUMBLEVOICE_HPP
|
||||
#define _CRUMBLEVOICE_HPP
|
||||
|
||||
#include "types.h"
|
||||
|
||||
#include "rstl/reserved_vector.hpp"
|
||||
#include "rstl/vector.hpp"
|
||||
|
||||
enum ERumblePriority {
|
||||
kRP_None,
|
||||
kRP_One,
|
||||
kRP_Two,
|
||||
kRP_Three,
|
||||
};
|
||||
|
||||
struct SAdsrData {
|
||||
f32 x0_attackGain;
|
||||
f32 x4_autoReleaseDur;
|
||||
f32 x8_attackDur;
|
||||
f32 xc_decayDur;
|
||||
f32 x10_sustainGain;
|
||||
f32 x14_releaseDur;
|
||||
bool x18_24_hasSustain : 1;
|
||||
bool x18_25_autoRelease : 1;
|
||||
};
|
||||
|
||||
struct SAdsrDelta {
|
||||
enum EPhase {
|
||||
kP_Stop,
|
||||
kP_PrePulse,
|
||||
kP_Attack,
|
||||
kP_Decay,
|
||||
kP_Sustain,
|
||||
kP_Release,
|
||||
};
|
||||
|
||||
f32 x0_curIntensity;
|
||||
f32 x4_attackTime;
|
||||
f32 x8_decayTime;
|
||||
f32 xc_releaseTime;
|
||||
f32 x10_autoReleaseTime;
|
||||
f32 x14_attackIntensity;
|
||||
f32 x18_sustainIntensity;
|
||||
ERumblePriority x1c_priority;
|
||||
EPhase x20_phase;
|
||||
};
|
||||
|
||||
class CRumbleVoice {
|
||||
private:
|
||||
rstl::vector< SAdsrData > x0_datas;
|
||||
rstl::vector< SAdsrDelta > x10_deltas;
|
||||
rstl::reserved_vector< s16, 4 > x20_handleIds;
|
||||
s16 x2c_usedChannels;
|
||||
u8 x2e_lastId;
|
||||
};
|
||||
|
||||
#endif
|
||||
@@ -4,8 +4,18 @@
|
||||
#include "Kyoto/Math/CVector3f.hpp"
|
||||
|
||||
class CAABox {
|
||||
CVector3f min;
|
||||
CVector3f max;
|
||||
public:
|
||||
CAABox() {
|
||||
// TODO
|
||||
}
|
||||
|
||||
static CAABox mskInvertedBox;
|
||||
static CAABox mskNullBox;
|
||||
|
||||
private:
|
||||
CVector3f min;
|
||||
CVector3f max;
|
||||
};
|
||||
CHECK_SIZEOF(CAABox, 0x18)
|
||||
|
||||
#endif // __CAABOX_HPP__
|
||||
|
||||
27
include/Kyoto/Math/CMatrix4f.hpp
Normal file
27
include/Kyoto/Math/CMatrix4f.hpp
Normal file
@@ -0,0 +1,27 @@
|
||||
#ifndef _CMATRIX4F_HPP
|
||||
#define _CMATRIX4F_HPP
|
||||
|
||||
#include "types.h"
|
||||
|
||||
class CMatrix4f {
|
||||
private:
|
||||
f32 m00;
|
||||
f32 m01;
|
||||
f32 m02;
|
||||
f32 m03;
|
||||
f32 m10;
|
||||
f32 m11;
|
||||
f32 m12;
|
||||
f32 m13;
|
||||
f32 m20;
|
||||
f32 m21;
|
||||
f32 m22;
|
||||
f32 m23;
|
||||
f32 m30;
|
||||
f32 m31;
|
||||
f32 m32;
|
||||
f32 m33;
|
||||
};
|
||||
CHECK_SIZEOF(CMatrix4f, 0x40);
|
||||
|
||||
#endif
|
||||
14
include/Kyoto/Math/CQuaternion.hpp
Normal file
14
include/Kyoto/Math/CQuaternion.hpp
Normal file
@@ -0,0 +1,14 @@
|
||||
#ifndef _CQUATERNION_HPP
|
||||
#define _CQUATERNION_HPP
|
||||
|
||||
#include "types.h"
|
||||
|
||||
class CQuaternion {
|
||||
private:
|
||||
f32 w;
|
||||
f32 x;
|
||||
f32 y;
|
||||
f32 z;
|
||||
};
|
||||
|
||||
#endif
|
||||
@@ -5,8 +5,93 @@
|
||||
|
||||
#include "Kyoto/Math/CVector3f.hpp"
|
||||
|
||||
class CInputStream;
|
||||
class CMatrix3f;
|
||||
|
||||
class CTransform4f {
|
||||
public:
|
||||
CTransform4f() {
|
||||
// TODO
|
||||
}
|
||||
CTransform4f(f32, f32, f32, f32, f32, f32, f32, f32, f32, f32, f32, f32);
|
||||
CTransform4f(const CInputStream& in);
|
||||
CTransform4f(const CMatrix3f& rotation, const CVector3f& translation);
|
||||
CTransform4f(const CTransform4f& other);
|
||||
CTransform4f& operator=(const CTransform4f& other);
|
||||
|
||||
CVector3f GetTranslation() const { return CVector3f(posX, posY, posZ); }
|
||||
CVector3f GetRight() const { return CVector3f(m0.GetX(), m1.GetX(), m2.GetX()); }
|
||||
CVector3f GetForward() const { return CVector3f(m0.GetY(), m1.GetY(), m2.GetY()); }
|
||||
CVector3f GetUp() const { return CVector3f(m0.GetZ(), m1.GetZ(), m2.GetZ()); }
|
||||
|
||||
CMatrix3f BuildMatrix3f() const;
|
||||
// Get00__12CTransform4fCFv
|
||||
// Get01__12CTransform4fCFv
|
||||
// Get02__12CTransform4fCFv
|
||||
// Get03__12CTransform4fCFv
|
||||
// Get10__12CTransform4fCFv
|
||||
// Get11__12CTransform4fCFv
|
||||
// Get12__12CTransform4fCFv
|
||||
// Get13__12CTransform4fCFv
|
||||
// Get20__12CTransform4fCFv
|
||||
// Get21__12CTransform4fCFv
|
||||
// Get22__12CTransform4fCFv
|
||||
// Get23__12CTransform4fCFv
|
||||
// GetColumn__12CTransform4fCF5EDimX
|
||||
// GetColumn__12CTransform4fCF5EDimY
|
||||
// GetColumn__12CTransform4fCF5EDimZ
|
||||
// GetColumn__12CTransform4fCFi
|
||||
// GetCStyleMatrix__12CTransform4fCFv
|
||||
// GetInverse__12CTransform4fCFv
|
||||
// GetQuickInverse__12CTransform4fCFv
|
||||
// GetRotation__12CTransform4fCFv
|
||||
// GetRow__12CTransform4fCF5EDimX
|
||||
// GetRow__12CTransform4fCF5EDimY
|
||||
// GetRow__12CTransform4fCF5EDimZ
|
||||
// GetRow__12CTransform4fCFi
|
||||
// GetUp__12CTransform4fCFv
|
||||
// LookAt__12CTransform4fFRC9CVector3fRC9CVector3fRC9CVector3f
|
||||
// MakeRotationsBasedOnY__12CTransform4fFRC13CUnitVector3f
|
||||
// MultiplyIgnoreTranslation__12CTransform4fCFRC12CTransform4f
|
||||
// Orthonormalize__12CTransform4fFv
|
||||
// Rotate__12CTransform4fCFRC9CVector3f
|
||||
// RotateLocalX__12CTransform4fFRC9CRelAngle
|
||||
// RotateLocalY__12CTransform4fFRC9CRelAngle
|
||||
// RotateLocalZ__12CTransform4fFRC9CRelAngle
|
||||
// RotateX__12CTransform4fFRC9CRelAngle
|
||||
// RotateY__12CTransform4fFRC9CRelAngle
|
||||
// RotateZ__12CTransform4fFRC9CRelAngle
|
||||
// Scale__12CTransform4fFf
|
||||
// Scale__12CTransform4fFfff
|
||||
// Scale__12CTransform4fFRC9CVector3f
|
||||
// ScaleBy__12CTransform4fFf
|
||||
// SetRotation__12CTransform4fFRC12CTransform4f
|
||||
// SetRotation__12CTransform4fFRC9CMatrix3f
|
||||
// Translate__12CTransform4fFfff
|
||||
// Translate__12CTransform4fFRC9CVector3f
|
||||
// TransposeMultiply__12CTransform4fCFRC9CVector3f
|
||||
// TransposeRotate__12CTransform4fCFRC9CVector3f
|
||||
|
||||
void SetTranslation(const CVector3f& vec) {
|
||||
posX = vec.GetX();
|
||||
posY = vec.GetY();
|
||||
posZ = vec.GetZ();
|
||||
}
|
||||
void AddTranslation(const CVector3f& vec) {
|
||||
posX += vec.GetX();
|
||||
posY += vec.GetY();
|
||||
posZ += vec.GetZ();
|
||||
}
|
||||
void AddTranslationZ(f32 z) { posZ += z; }
|
||||
|
||||
CTransform4f& operator*=(const CTransform4f& other);
|
||||
CTransform4f& operator*(const CTransform4f& vec);
|
||||
CTransform4f& operator*(const CVector3f& vec);
|
||||
|
||||
static CTransform4f FromColumns(const CVector3f&, const CVector3f&, const CVector3f&, const CVector3f&);
|
||||
static CTransform4f sIdentity;
|
||||
|
||||
private:
|
||||
CVector3f m0;
|
||||
f32 posX;
|
||||
CVector3f m1;
|
||||
@@ -15,6 +100,8 @@ public:
|
||||
f32 posZ;
|
||||
};
|
||||
|
||||
extern CTransform4f skIdentity4f;
|
||||
inline bool operator==(const CTransform4f& lhs, const CTransform4f& rhs);
|
||||
|
||||
CHECK_SIZEOF(CTransform4f, 0x30)
|
||||
|
||||
#endif // __CTRANSFORM4F_HPP__
|
||||
|
||||
12
include/Kyoto/Math/CVector2i.hpp
Normal file
12
include/Kyoto/Math/CVector2i.hpp
Normal file
@@ -0,0 +1,12 @@
|
||||
#ifndef _CVECTOR2I_HPP
|
||||
#define _CVECTOR2I_HPP
|
||||
|
||||
#include "types.h"
|
||||
|
||||
class CVector2i {
|
||||
private:
|
||||
s32 x;
|
||||
s32 y;
|
||||
};
|
||||
|
||||
#endif
|
||||
@@ -3,18 +3,109 @@
|
||||
|
||||
#include "types.h"
|
||||
|
||||
#include "Kyoto/Math/CVector2f.hpp"
|
||||
|
||||
class CInputStream;
|
||||
class COutputStream;
|
||||
|
||||
class CVector3f {
|
||||
public:
|
||||
CVector3f() : mX(0.f), mY(0.f), mZ(0.f) {}
|
||||
explicit CVector3f(f32 x, f32 y, f32 z) : mX(x), mY(y), mZ(z) {}
|
||||
CVector3f(const CVector2f& v, f32 z) : mX(v.GetX()), mY(v.GetY()), mZ(z) {}
|
||||
|
||||
CVector3f(CInputStream& in);
|
||||
void PutTo(COutputStream& out) const;
|
||||
|
||||
f32 GetX() const { return mX; }
|
||||
f32 GetY() const { return mY; }
|
||||
f32 GetZ() const { return mZ; }
|
||||
|
||||
// private:
|
||||
void SetX(f32 x) { mX = x; }
|
||||
void SetY(f32 y) { mY = y; }
|
||||
void SetZ(f32 z) { mZ = z; }
|
||||
|
||||
// ByElementMultiply__9CVector3fFRC9CVector3fRC9CVector3f
|
||||
// Slerp__9CVector3fFRC9CVector3fRC9CVector3fRC9CRelAngle
|
||||
// Normalize__9CVector3fFv
|
||||
// Magnitude__9CVector3fCFv
|
||||
// AsNormalized__9CVector3fCFv
|
||||
// CanBeNormalized__9CVector3fCFv
|
||||
// GetAngleDiff__9CVector3fFRC9CVector3fRC9CVector3f
|
||||
// IsEqu__9CVector3fCFRC9CVector3ff
|
||||
// Lerp__9CVector3fFRC9CVector3fRC9CVector3ff
|
||||
|
||||
f32& operator[](s32 i) { return *(&mX + i); }
|
||||
f32 operator[](s32 i) const { return *(&mX + i); }
|
||||
bool IsNonZero() const { return mX != 0.f || mY != 0.f || mZ != 0.f; }
|
||||
|
||||
void DropZ() { mZ = 0.f; }
|
||||
|
||||
CVector3f& operator+=(const CVector3f& other) {
|
||||
mX += other.mX;
|
||||
mY += other.mY;
|
||||
mZ += other.mZ;
|
||||
return *this;
|
||||
}
|
||||
CVector3f& operator-=(const CVector3f& other) {
|
||||
mX -= other.mX;
|
||||
mY -= other.mY;
|
||||
mZ -= other.mZ;
|
||||
return *this;
|
||||
}
|
||||
CVector3f& operator*=(f32 v) {
|
||||
mX *= v;
|
||||
mY *= v;
|
||||
mZ *= v;
|
||||
return *this;
|
||||
}
|
||||
CVector3f& operator/=(f32 v) {
|
||||
mX /= v;
|
||||
mY /= v;
|
||||
mZ /= v;
|
||||
return *this;
|
||||
}
|
||||
|
||||
static const CVector3f& Zero() { return sZeroVector; }
|
||||
static const CVector3f& Up() { return sUpVector; }
|
||||
static const CVector3f& Down() { return sDownVector; }
|
||||
static const CVector3f& Left() { return sLeftVector; }
|
||||
static const CVector3f& Right() { return sRightVector; }
|
||||
static const CVector3f& Forward() { return sForwardVector; }
|
||||
static const CVector3f& Back() { return sBackVector; }
|
||||
|
||||
private:
|
||||
f32 mX;
|
||||
f32 mY;
|
||||
f32 mZ;
|
||||
|
||||
static CVector3f sZeroVector;
|
||||
static CVector3f sUpVector;
|
||||
static CVector3f sDownVector;
|
||||
static CVector3f sLeftVector;
|
||||
static CVector3f sRightVector;
|
||||
static CVector3f sForwardVector;
|
||||
static CVector3f sBackVector;
|
||||
};
|
||||
|
||||
// ClassifyVector__FRC9CVector3f
|
||||
// TGetType<9CVector3f>__FRC9CVector3f
|
||||
// close_enough__FRC9CVector3fRC9CVector3ff in CloseEnough.cpp
|
||||
|
||||
inline bool operator==(const CVector3f& lhs, const CVector3f& rhs) {
|
||||
return lhs.GetX() == rhs.GetX() && lhs.GetY() == rhs.GetY() && lhs.GetZ() == rhs.GetZ();
|
||||
}
|
||||
inline bool operator!=(const CVector3f& lhs, const CVector3f& rhs) {
|
||||
return lhs.GetX() != rhs.GetX() || lhs.GetY() != rhs.GetY() || lhs.GetZ() != rhs.GetZ();
|
||||
}
|
||||
inline CVector3f operator-(const CVector3f& lhs, const CVector3f& rhs) {
|
||||
return CVector3f(lhs.GetX() - rhs.GetX(), lhs.GetY() - rhs.GetY(), lhs.GetZ() - rhs.GetZ());
|
||||
}
|
||||
inline CVector3f operator+(const CVector3f& lhs, const CVector3f& rhs) {
|
||||
return CVector3f(lhs.GetX() + rhs.GetX(), lhs.GetY() + rhs.GetY(), lhs.GetZ() + rhs.GetZ());
|
||||
}
|
||||
inline CVector3f operator*(const CVector3f& vec, f32 f) { return CVector3f(vec.GetX() * f, vec.GetY() * f, vec.GetZ() * f); }
|
||||
inline CVector3f operator/(const CVector3f& vec, f32 f) { return CVector3f(vec.GetX() / f, vec.GetY() / f, vec.GetZ() / f); }
|
||||
inline CVector3f operator-(const CVector3f& vec) { return CVector3f(-vec.GetX(), -vec.GetY(), -vec.GetZ()); }
|
||||
|
||||
#endif // __CVECTOR3F_HPP__
|
||||
|
||||
@@ -1,11 +1,11 @@
|
||||
#ifndef _CPARTICLEGEN_HPP
|
||||
#define _CPARTICLEGEN_HPP
|
||||
|
||||
#include "Kyoto/Math/CTransform4f.hpp"
|
||||
#include "Kyoto/Math/CVector3f.hpp"
|
||||
#include "Kyoto/Math/CAABox.hpp"
|
||||
#include "Kyoto/Graphics/CColor.hpp"
|
||||
#include "Kyoto/Graphics/CLight.hpp"
|
||||
#include "Kyoto/Math/CAABox.hpp"
|
||||
#include "Kyoto/Math/CTransform4f.hpp"
|
||||
#include "Kyoto/Math/CVector3f.hpp"
|
||||
|
||||
class CWarp;
|
||||
class CParticleGen {
|
||||
|
||||
45
include/Kyoto/TToken.hpp
Normal file
45
include/Kyoto/TToken.hpp
Normal file
@@ -0,0 +1,45 @@
|
||||
#ifndef _TTOKEN_HPP
|
||||
#define _TTOKEN_HPP
|
||||
|
||||
#include "types.h"
|
||||
|
||||
#include "Kyoto/CSimplePool.hpp"
|
||||
#include "Kyoto/CToken.hpp"
|
||||
#include "Kyoto/IObj.hpp"
|
||||
|
||||
#include "rstl/auto_ptr.hpp"
|
||||
|
||||
template < typename T >
|
||||
class TToken : public CToken {
|
||||
public:
|
||||
TToken() {}
|
||||
TToken(const CToken& token) : CToken(token) {}
|
||||
TToken(T* obj) : CToken(GetIObjObjectFor(obj).release()) {}
|
||||
TToken(const rstl::auto_ptr< T >& obj) : CToken(GetIObjObjectFor(obj).release()) {}
|
||||
|
||||
static rstl::auto_ptr< TObjOwnerDerivedFromIObj< T > > GetIObjObjectFor(T* obj) {
|
||||
return TObjOwnerDerivedFromIObj< T >::GetNewDerivedObject(obj);
|
||||
}
|
||||
static rstl::auto_ptr< TObjOwnerDerivedFromIObj< T > > GetIObjObjectFor(const rstl::auto_ptr< T >& obj) {
|
||||
return TObjOwnerDerivedFromIObj< T >::GetNewDerivedObject(obj);
|
||||
}
|
||||
};
|
||||
|
||||
template < typename T >
|
||||
class TCachedToken : public TToken< T > {
|
||||
public:
|
||||
TCachedToken() {}
|
||||
TCachedToken(const CToken& token) : TToken(token), x8_item(nullptr) {}
|
||||
|
||||
private:
|
||||
T* x8_item;
|
||||
};
|
||||
|
||||
template < typename T >
|
||||
class TLockedToken : public TCachedToken< T > {
|
||||
public:
|
||||
TLockedToken() {}
|
||||
TLockedToken(const CToken& token) : TCachedToken(token) { Lock(); }
|
||||
};
|
||||
|
||||
#endif
|
||||
@@ -4,7 +4,7 @@
|
||||
#include "gx_enum.h"
|
||||
#include "types.h"
|
||||
|
||||
#include "Kyoto/Math/CColor.hpp"
|
||||
#include "Kyoto/Graphics/CColor.hpp"
|
||||
#include "Kyoto/Math/CTransform4f.hpp"
|
||||
#include "Kyoto/Math/CVector2f.hpp"
|
||||
#include "rstl/pair.hpp"
|
||||
|
||||
103
include/MetroidPrime/CActor.hpp
Normal file
103
include/MetroidPrime/CActor.hpp
Normal file
@@ -0,0 +1,103 @@
|
||||
#ifndef _CACTOR_HPP
|
||||
#define _CACTOR_HPP
|
||||
|
||||
#include "types.h"
|
||||
|
||||
#include "Collision/CMaterialFilter.hpp"
|
||||
#include "Collision/CMaterialList.hpp"
|
||||
|
||||
#include "MetroidPrime/CEntity.hpp"
|
||||
#include "MetroidPrime/CModelFlags.hpp"
|
||||
#include "MetroidPrime/CSfxHandle.hpp"
|
||||
|
||||
#include "Kyoto/Graphics/CColor.hpp"
|
||||
#include "Kyoto/Math/CAABox.hpp"
|
||||
#include "Kyoto/Math/CTransform4f.hpp"
|
||||
#include "Kyoto/Math/CQuaternion.hpp"
|
||||
#include "Kyoto/TToken.hpp"
|
||||
|
||||
#include "rstl/pair.hpp"
|
||||
#include "rstl/reserved_vector.hpp"
|
||||
#include "rstl/single_ptr.hpp"
|
||||
|
||||
class CActorLights;
|
||||
class CActorParameters;
|
||||
class CModelData;
|
||||
class CScannableObjectInfo;
|
||||
class CSimpleShadow;
|
||||
|
||||
// TODO move
|
||||
struct SAdvancementDeltas {
|
||||
CVector3f x0_posDelta;
|
||||
CQuaternion xc_rotDelta;
|
||||
};
|
||||
CHECK_SIZEOF(SAdvancementDeltas, 0x1c)
|
||||
|
||||
class CActor : public CEntity {
|
||||
public:
|
||||
enum EThermalFlags {
|
||||
kTF_None = 0,
|
||||
kTF_Cold = 1,
|
||||
kTF_Hot = 2,
|
||||
};
|
||||
|
||||
CActor(TUniqueId uid, bool active, const rstl::string& name, const CEntityInfo& info, const CTransform4f& xf, const CModelData& mData,
|
||||
const CMaterialList& list, const CActorParameters& params, TUniqueId nextDrawNode);
|
||||
~CActor();
|
||||
|
||||
SAdvancementDeltas UpdateAnimation(float dt, CStateManager& mgr, bool advTree);
|
||||
|
||||
void UpdateSfxEmitters();
|
||||
void RemoveEmitter();
|
||||
|
||||
const CTransform4f& GetTransform() const { return x34_transform; }
|
||||
|
||||
protected:
|
||||
CTransform4f x34_transform;
|
||||
rstl::single_ptr< CModelData > x64_modelData;
|
||||
CMaterialList x68_material;
|
||||
CMaterialFilter x70_materialFilter;
|
||||
TSfxId x88_sfxId;
|
||||
CSfxHandle x8c_loopingSfxHandle;
|
||||
rstl::single_ptr< CActorLights > x90_actorLights;
|
||||
rstl::single_ptr< CSimpleShadow > x94_simpleShadow;
|
||||
rstl::single_ptr< TCachedToken< CScannableObjectInfo > > x98_scanObjectInfo;
|
||||
CAABox x9c_renderBounds;
|
||||
CModelFlags xb4_drawFlags;
|
||||
f32 xbc_time;
|
||||
u32 xc0_pitchBend;
|
||||
TUniqueId xc4_fluidId;
|
||||
TUniqueId xc6_nextDrawNode;
|
||||
s32 xc8_drawnToken;
|
||||
s32 xcc_addedToken;
|
||||
f32 xd0_damageMag;
|
||||
u8 xd4_maxVol;
|
||||
rstl::reserved_vector< CSfxHandle, 2 > xd8_nonLoopingSfxHandles;
|
||||
u32 xe4_24_nextNonLoopingSfxHandle : 3;
|
||||
u32 xe4_27_notInSortedLists : 1;
|
||||
u32 xe4_28_transformDirty : 1;
|
||||
u32 xe4_29_actorLightsDirty : 1;
|
||||
u32 xe4_30_outOfFrustum : 1;
|
||||
u32 xe4_31_calculateLighting : 1;
|
||||
u32 xe5_24_shadowEnabled : 1;
|
||||
u32 xe5_25_shadowDirty : 1;
|
||||
u32 xe5_26_muted : 1;
|
||||
u32 xe5_27_useInSortedLists : 1;
|
||||
u32 xe5_28_callTouch : 1;
|
||||
u32 xe5_29_globalTimeProvider : 1;
|
||||
u32 xe5_30_renderUnsorted : 1;
|
||||
u32 xe5_31_pointGeneratorParticles : 1;
|
||||
u32 xe6_24_fluidCounter : 3;
|
||||
EThermalFlags xe6_27_thermalVisorFlags : 2;
|
||||
u32 xe6_29_renderParticleDBInside : 1;
|
||||
u32 xe6_30_enablePitchBend : 1;
|
||||
u32 xe6_31_targetableVisorFlags : 4;
|
||||
u32 xe7_27_enableRender : 1;
|
||||
u32 xe7_28_worldLightingDirty : 1;
|
||||
u32 xe7_29_drawEnabled : 1;
|
||||
u32 xe7_30_doTargetDistanceTest : 1;
|
||||
u32 xe7_31_targetable : 1;
|
||||
};
|
||||
CHECK_SIZEOF(CActor, 0xe8)
|
||||
|
||||
#endif
|
||||
11
include/MetroidPrime/CActorLights.hpp
Normal file
11
include/MetroidPrime/CActorLights.hpp
Normal file
@@ -0,0 +1,11 @@
|
||||
#ifndef _CACTORLIGHTS_HPP
|
||||
#define _CACTORLIGHTS_HPP
|
||||
|
||||
#include "types.h"
|
||||
|
||||
class CActorLights {
|
||||
public:
|
||||
~CActorLights();
|
||||
};
|
||||
|
||||
#endif
|
||||
11
include/MetroidPrime/CActorModelParticles.hpp
Normal file
11
include/MetroidPrime/CActorModelParticles.hpp
Normal file
@@ -0,0 +1,11 @@
|
||||
#ifndef _CACTORMODELPARTICLES_HPP
|
||||
#define _CACTORMODELPARTICLES_HPP
|
||||
|
||||
#include "types.h"
|
||||
|
||||
class CActorModelParticles {
|
||||
private:
|
||||
// TODO
|
||||
};
|
||||
|
||||
#endif
|
||||
132
include/MetroidPrime/CActorParameters.hpp
Normal file
132
include/MetroidPrime/CActorParameters.hpp
Normal file
@@ -0,0 +1,132 @@
|
||||
#ifndef _CACTORPARAMETERS_HPP
|
||||
#define _CACTORPARAMETERS_HPP
|
||||
|
||||
#include "types.h"
|
||||
|
||||
#include "Kyoto/IObjectStore.hpp"
|
||||
#include "Kyoto/Graphics/CColor.hpp"
|
||||
#include "Kyoto/Math/CVector3f.hpp"
|
||||
|
||||
#include "rstl/auto_ptr.hpp"
|
||||
#include "rstl/pair.hpp"
|
||||
|
||||
class CActorLights;
|
||||
|
||||
class CLightParameters {
|
||||
public:
|
||||
enum EShadowTesselation {
|
||||
kST_Invalid = -1,
|
||||
kST_Zero,
|
||||
};
|
||||
|
||||
enum EWorldLightingOptions {
|
||||
kLO_Zero,
|
||||
kLO_NormalWorld,
|
||||
kLO_NoShadowCast,
|
||||
kLO_DisableWorld,
|
||||
};
|
||||
|
||||
enum ELightRecalculationOptions {
|
||||
kLR_LargeFrameCount,
|
||||
kLR_EightFrames,
|
||||
kLR_FourFrames,
|
||||
kLR_OneFrame,
|
||||
};
|
||||
|
||||
CLightParameters() {
|
||||
// TODO
|
||||
}
|
||||
|
||||
virtual ~CLightParameters();
|
||||
|
||||
const CColor& GetAmbientColor() const { return x18_noLightsAmbient; }
|
||||
bool ShouldMakeLights() const { return x1c_makeLights; }
|
||||
s32 GetMaxAreaLights() const { return x3c_maxAreaLights; }
|
||||
|
||||
rstl::auto_ptr< CActorLights > MakeActorLights() const;
|
||||
|
||||
private:
|
||||
bool x4_castShadow;
|
||||
f32 x8_shadowScale;
|
||||
EShadowTesselation xc_shadowTesselation;
|
||||
f32 x10_shadowAlpha;
|
||||
f32 x14_maxShadowHeight;
|
||||
CColor x18_noLightsAmbient;
|
||||
bool x1c_makeLights;
|
||||
bool x1d_ambientChannelOverflow;
|
||||
EWorldLightingOptions x20_worldLightingOptions;
|
||||
ELightRecalculationOptions x24_lightRecalcOpts;
|
||||
s32 x28_layerIdx;
|
||||
CVector3f x2c_actorPosBias;
|
||||
s32 x38_maxDynamicLights;
|
||||
s32 x3c_maxAreaLights;
|
||||
};
|
||||
CHECK_SIZEOF(CLightParameters, 0x40)
|
||||
|
||||
class CScannableParameters {
|
||||
public:
|
||||
CScannableParameters() {}
|
||||
CScannableParameters(CAssetId scanId) : x0_scanId(scanId) {}
|
||||
|
||||
CAssetId GetScannableObject0() const { return x0_scanId; }
|
||||
|
||||
private:
|
||||
CAssetId x0_scanId;
|
||||
};
|
||||
CHECK_SIZEOF(CScannableParameters, 0x4)
|
||||
|
||||
class CVisorParameters {
|
||||
public:
|
||||
CVisorParameters() {
|
||||
// TODO
|
||||
}
|
||||
CVisorParameters(u8 mask, bool b1, bool scanPassthrough) : x0_mask(mask), x0_4_b1(b1), x0_5_scanPassthrough(scanPassthrough) {}
|
||||
|
||||
u8 GetMask() const { return x0_mask; }
|
||||
// TODO: GetIsBlockXRay__16CVisorParametersCFv?
|
||||
bool GetBool1() const { return x0_4_b1; }
|
||||
bool GetScanPassthrough() const { return x0_5_scanPassthrough; }
|
||||
|
||||
static CVisorParameters None();
|
||||
|
||||
private:
|
||||
u32 x0_mask : 4;
|
||||
u32 x0_4_b1 : 1;
|
||||
u32 x0_5_scanPassthrough : 1;
|
||||
};
|
||||
CHECK_SIZEOF(CVisorParameters, 0x4)
|
||||
|
||||
class CActorParameters {
|
||||
public:
|
||||
CActorParameters() {
|
||||
// TODO
|
||||
}
|
||||
|
||||
const CLightParameters& GetLighting() const { return x0_lightParams; }
|
||||
const CScannableParameters& GetScannable() const { return x40_scanParams; }
|
||||
const rstl::pair< CAssetId, CAssetId >& GetXRay() const { return x44_xrayAssets; }
|
||||
const rstl::pair< CAssetId, CAssetId >& GetInfra() const { return x4c_thermalAssets; }
|
||||
const CVisorParameters& GetVisorParameters() const { return x54_visorParams; }
|
||||
f32 GetThermalMag() const { return x64_thermalMag; }
|
||||
bool GetUseGlobalRenderTime() const { return x58_24_globalTimeProvider; }
|
||||
bool IsHotInThermal() const { return x58_25_thermalHeat; }
|
||||
bool ForceRenderUnsorted() const { return x58_26_renderUnsorted; }
|
||||
bool NoSortThermal() const { return x58_27_noSortThermal; }
|
||||
|
||||
private:
|
||||
CLightParameters x0_lightParams;
|
||||
CScannableParameters x40_scanParams;
|
||||
rstl::pair< CAssetId, CAssetId > x44_xrayAssets;
|
||||
rstl::pair< CAssetId, CAssetId > x4c_thermalAssets;
|
||||
CVisorParameters x54_visorParams;
|
||||
bool x58_24_globalTimeProvider : 1;
|
||||
bool x58_25_thermalHeat : 1;
|
||||
bool x58_26_renderUnsorted : 1;
|
||||
bool x58_27_noSortThermal : 1;
|
||||
f32 x5c_fadeInTime;
|
||||
f32 x60_fadeOutTime;
|
||||
f32 x64_thermalMag;
|
||||
};
|
||||
CHECK_SIZEOF(CActorParameters, 0x68)
|
||||
|
||||
#endif
|
||||
10
include/MetroidPrime/CAnimData.hpp
Normal file
10
include/MetroidPrime/CAnimData.hpp
Normal file
@@ -0,0 +1,10 @@
|
||||
#ifndef _CANIMDATA_HPP
|
||||
#define _CANIMDATA_HPP
|
||||
|
||||
#include "types.h"
|
||||
|
||||
class CAnimData {
|
||||
// TODO
|
||||
};
|
||||
|
||||
#endif
|
||||
29
include/MetroidPrime/CAreaFog.hpp
Normal file
29
include/MetroidPrime/CAreaFog.hpp
Normal file
@@ -0,0 +1,29 @@
|
||||
#ifndef _CAREAFOG_HPP
|
||||
#define _CAREAFOG_HPP
|
||||
|
||||
#include "types.h"
|
||||
|
||||
#include "Kyoto/Graphics/CColor.hpp"
|
||||
#include "Kyoto/Math/CVector2f.hpp"
|
||||
|
||||
enum ERglFogMode {
|
||||
// TODO
|
||||
};
|
||||
|
||||
class CAreaFog {
|
||||
private:
|
||||
ERglFogMode x0_fogMode;
|
||||
CVector2f x4_rangeCur;
|
||||
CVector2f xc_rangeTarget;
|
||||
CVector2f x14_rangeDelta;
|
||||
CColor x1c_colorCur;
|
||||
unkptr x20_;
|
||||
unkptr x24_;
|
||||
CColor x28_colorTarget;
|
||||
unkptr x2c_;
|
||||
unkptr x30_;
|
||||
f32 x34_colorDelta;
|
||||
};
|
||||
CHECK_SIZEOF(CAreaFog, 0x38)
|
||||
|
||||
#endif
|
||||
@@ -40,4 +40,6 @@ protected:
|
||||
bool x30_27_notInArea : 1;
|
||||
};
|
||||
|
||||
CHECK_SIZEOF(CEntity, 0x34)
|
||||
|
||||
#endif
|
||||
|
||||
64
include/MetroidPrime/CEnvFxManager.hpp
Normal file
64
include/MetroidPrime/CEnvFxManager.hpp
Normal file
@@ -0,0 +1,64 @@
|
||||
#ifndef _CENVFXMANAGER_HPP
|
||||
#define _CENVFXMANAGER_HPP
|
||||
|
||||
#include "types.h"
|
||||
|
||||
#include "MetroidPrime/CSfxHandle.hpp"
|
||||
#include "MetroidPrime/TGameTypes.hpp"
|
||||
|
||||
#include "Kyoto/Math/CAABox.hpp"
|
||||
#include "Kyoto/Math/CVector2i.hpp"
|
||||
#include "Kyoto/Math/CVector3f.hpp"
|
||||
#include "Kyoto/TToken.hpp"
|
||||
|
||||
#include "rstl/pair.hpp"
|
||||
#include "rstl/reserved_vector.hpp"
|
||||
#include "rstl/vector.hpp"
|
||||
|
||||
class CGenDescription;
|
||||
class CTexture;
|
||||
|
||||
class CVectorFixed8_8 {
|
||||
private:
|
||||
s16 x;
|
||||
s16 y;
|
||||
s16 z;
|
||||
};
|
||||
|
||||
class CEnvFxManagerGrid {
|
||||
private:
|
||||
bool x0_24_blockDirty;
|
||||
CVector2i x4_position; /* 8.8 fixed point */
|
||||
CVector2i xc_extent; /* 8.8 fixed point */
|
||||
rstl::pair< bool, f32 > x14_block; /* Blocked-bool, Z-coordinate */
|
||||
rstl::vector< CVectorFixed8_8 > x1c_particles;
|
||||
};
|
||||
|
||||
class CEnvFxManager {
|
||||
private:
|
||||
CAABox x0_particleBounds;
|
||||
CVector3f x18_focusCellPosition;
|
||||
bool x24_enableSplash;
|
||||
f32 x28_firstSnowForce;
|
||||
s32 x2c_lastBlockedGridIdx;
|
||||
f32 x30_fxDensity;
|
||||
f32 x34_targetFxDensity;
|
||||
f32 x38_maxDensityDeltaSpeed;
|
||||
bool x3c_snowflakeTextureMipBlanked;
|
||||
TLockedToken< CTexture > x40_txtrEnvGradient;
|
||||
rstl::reserved_vector< CEnvFxManagerGrid, 64 > x50_grids;
|
||||
f32 xb54_baseSplashRate;
|
||||
TLockedToken< CGenDescription > xb58_envRainSplash;
|
||||
bool xb64_ = true;
|
||||
TUniqueId xb68_envRainSplashId = kInvalidUniqueId;
|
||||
bool xb6a_rainSoundActive;
|
||||
CSfxHandle xb6c_leftRainSound;
|
||||
CSfxHandle xb70_rightRainSound;
|
||||
TLockedToken< CTexture > xb74_txtrSnowFlake;
|
||||
bool xb80_;
|
||||
rstl::reserved_vector< CVector3f, 16 > xb84_snowZDeltas;
|
||||
TLockedToken< CTexture > xc48_underwaterFlake;
|
||||
bool xc54_;
|
||||
};
|
||||
|
||||
#endif
|
||||
25
include/MetroidPrime/CFluidPlaneManager.hpp
Normal file
25
include/MetroidPrime/CFluidPlaneManager.hpp
Normal file
@@ -0,0 +1,25 @@
|
||||
#ifndef _CFLUIDPLANEMANAGER_HPP
|
||||
#define _CFLUIDPLANEMANAGER_HPP
|
||||
|
||||
#include "types.h"
|
||||
|
||||
#include "MetroidPrime/CRippleManager.hpp"
|
||||
#include "MetroidPrime/TGameTypes.hpp"
|
||||
|
||||
#include "rstl/reserved_vector.hpp"
|
||||
|
||||
class CFluidPlaneManager {
|
||||
private:
|
||||
class CSplashRecord {
|
||||
f32 x0_time;
|
||||
TUniqueId x4_id;
|
||||
};
|
||||
|
||||
CRippleManager x0_rippleManager;
|
||||
rstl::reserved_vector< CSplashRecord, 32 > x18_splashes;
|
||||
float x11c_uvT;
|
||||
bool x120_;
|
||||
bool x121_;
|
||||
};
|
||||
|
||||
#endif
|
||||
51
include/MetroidPrime/CModelData.hpp
Normal file
51
include/MetroidPrime/CModelData.hpp
Normal file
@@ -0,0 +1,51 @@
|
||||
#ifndef _CMODELDATA_HPP
|
||||
#define _CMODELDATA_HPP
|
||||
|
||||
#include "types.h"
|
||||
|
||||
#include "MetroidPrime/TGameTypes.hpp"
|
||||
|
||||
#include "Kyoto/Graphics/CColor.hpp"
|
||||
#include "Kyoto/Math/CVector3f.hpp"
|
||||
#include "Kyoto/Math/CTransform4f.hpp"
|
||||
#include "Kyoto/TToken.hpp"
|
||||
|
||||
#include "rstl/auto_ptr.hpp"
|
||||
#include "rstl/optional_object.hpp"
|
||||
#include "rstl/pair.hpp"
|
||||
|
||||
class CAnimData;
|
||||
class CModel;
|
||||
|
||||
class CModelData {
|
||||
public:
|
||||
bool IsStaticModel() const { return xc_animData.get() == nullptr && !x1c_normalModel; }
|
||||
|
||||
CModelData() {
|
||||
// TODO
|
||||
}
|
||||
CModelData(const CModelData& other);
|
||||
~CModelData();
|
||||
|
||||
SAdvancementDeltas AdvanceAnimation(float dt, CStateManager& mgr, TAreaId aid, bool advTree);
|
||||
void AdvanceParticles(const CTransform4f& xf, float dt, CStateManager& mgr);
|
||||
|
||||
rstl::auto_ptr< CAnimData >& GetAnimData() { return xc_animData; }
|
||||
|
||||
void SetXRayModel(const rstl::pair< CAssetId, CAssetId >& assets);
|
||||
void SetInfraModel(const rstl::pair< CAssetId, CAssetId >& assets);
|
||||
void SetAmbientColor(const CColor& color) { x18_ambientColor = color; }
|
||||
void SetSortThermal(bool b) { x14_25_sortThermal = b; }
|
||||
|
||||
private:
|
||||
CVector3f x0_scale;
|
||||
rstl::auto_ptr< CAnimData > xc_animData;
|
||||
bool x14_24_renderSorted : 1;
|
||||
bool x14_25_sortThermal : 1;
|
||||
CColor x18_ambientColor;
|
||||
rstl::optional_object< TCachedToken< CModel > > x1c_normalModel;
|
||||
rstl::optional_object< TCachedToken< CModel > > x2c_xrayModel;
|
||||
rstl::optional_object< TCachedToken< CModel > > x3c_infraModel;
|
||||
};
|
||||
|
||||
#endif
|
||||
73
include/MetroidPrime/CModelFlags.hpp
Normal file
73
include/MetroidPrime/CModelFlags.hpp
Normal file
@@ -0,0 +1,73 @@
|
||||
#ifndef _CMODELFLAGS_HPP
|
||||
#define _CMODELFLAGS_HPP
|
||||
|
||||
#include "types.h"
|
||||
|
||||
#include "Kyoto/Graphics/CColor.hpp"
|
||||
|
||||
class CModelFlags {
|
||||
public:
|
||||
enum ETrans {
|
||||
kT_Opaque = 0,
|
||||
kT_Blend = 5,
|
||||
kT_Additive = 7,
|
||||
};
|
||||
enum EFlags {
|
||||
kF_DepthCompare = 0x1,
|
||||
kF_DepthUpdate = 0x2,
|
||||
kF_NoTextureLock = 0x4,
|
||||
kF_DepthGreater = 0x8,
|
||||
kF_DepthNonInclusive = 0x10,
|
||||
kF_DrawNormal = 0x20,
|
||||
kF_ThermalUnsortedOnly = 0x40,
|
||||
};
|
||||
|
||||
CModelFlags(ETrans trans, f32 rgba)
|
||||
: x0_blendMode(trans), x1_matSetIdx(0), x2_flags(kF_DepthCompare | kF_DepthUpdate), x4_color(rgba, rgba, rgba, rgba) {}
|
||||
CModelFlags(ETrans trans, CColor color)
|
||||
: x0_blendMode(trans), x1_matSetIdx(0), x2_flags(kF_DepthCompare | kF_DepthUpdate), x4_color(color) {}
|
||||
CModelFlags(const CModelFlags& flags, u32 otherFlags)
|
||||
: x0_blendMode(flags.x0_blendMode), x1_matSetIdx(flags.x1_matSetIdx), x2_flags(otherFlags), x4_color(flags.x4_color) {}
|
||||
CModelFlags(const CModelFlags& flags, bool b /* TODO what's this? */, s32 shaderSet)
|
||||
: x0_blendMode(flags.x0_blendMode), x1_matSetIdx(shaderSet), x2_flags(flags.x2_flags), x4_color(flags.x4_color) {}
|
||||
|
||||
CModelFlags UseShaderSet(s32 matSet) { return CModelFlags(*this, false, matSet); }
|
||||
CModelFlags DontLoadTextures() { return CModelFlags(*this, GetOtherFlags() | kF_NoTextureLock); }
|
||||
CModelFlags DepthCompareUpdate(bool compare, bool update) {
|
||||
u32 flags = GetOtherFlags();
|
||||
if (compare) {
|
||||
flags |= kF_DepthCompare;
|
||||
} else {
|
||||
flags &= ~kF_DepthCompare;
|
||||
}
|
||||
if (update) {
|
||||
flags |= kF_DepthUpdate;
|
||||
} else {
|
||||
flags &= ~kF_DepthUpdate;
|
||||
}
|
||||
return CModelFlags(*this, flags);
|
||||
}
|
||||
CModelFlags DepthBackwards() { return CModelFlags(*this, GetOtherFlags() | kF_DepthGreater); }
|
||||
|
||||
ETrans GetTrans() const { return static_cast< ETrans >(x0_blendMode); }
|
||||
s32 GetShaderSet() const { return x1_matSetIdx; }
|
||||
u32 GetOtherFlags() const { return x2_flags; }
|
||||
CColor GetColor() const { return x4_color; }
|
||||
|
||||
static CModelFlags Normal() { return CModelFlags(kT_Opaque, 1.f); }
|
||||
static CModelFlags AlphaBlended(f32 f);
|
||||
static CModelFlags AlphaBlended(const CColor& color);
|
||||
static CModelFlags Additive(f32 f);
|
||||
static CModelFlags Additive(const CColor& color);
|
||||
static CModelFlags AdditiveRGB(const CColor& color);
|
||||
static CModelFlags ColorModulate(const CColor& color);
|
||||
|
||||
private:
|
||||
u8 x0_blendMode;
|
||||
u8 x1_matSetIdx;
|
||||
u16 x2_flags;
|
||||
CColor x4_color;
|
||||
};
|
||||
CHECK_SIZEOF(CModelFlags, 0x8)
|
||||
|
||||
#endif
|
||||
@@ -1,7 +1,12 @@
|
||||
#ifndef __COBJECTLIST_HPP__
|
||||
#define __COBJECTLIST_HPP__
|
||||
|
||||
#include "types.h"
|
||||
|
||||
#include "MetroidPrime/TGameTypes.hpp"
|
||||
|
||||
#define kMaxObjects 1024
|
||||
|
||||
enum EGameObjectList {
|
||||
kGOL_Invalid = -1,
|
||||
kGOL_All,
|
||||
@@ -25,7 +30,7 @@ class CObjectList {
|
||||
|
||||
public:
|
||||
CObjectList(EGameObjectList list);
|
||||
bool IsQualified(CEntity& ent);
|
||||
bool IsQualified(CEntity& ent);
|
||||
void AddObject(CEntity& ent);
|
||||
void RemoveObject(TUniqueId uid);
|
||||
CEntity* GetObjectById();
|
||||
@@ -36,11 +41,12 @@ public:
|
||||
const CEntity* operator[](s32 idx) const;
|
||||
const CEntity* GetValidObjectByIndex(s32 idx) const;
|
||||
s32 size() const { return mCount; }
|
||||
|
||||
private:
|
||||
SObjectListEntry mObjects[1024];
|
||||
EGameObjectList mListType;
|
||||
s16 mFirstId = -1;
|
||||
s16 mCount = 0;
|
||||
}
|
||||
};
|
||||
|
||||
#endif // __COBJECTLIST_HPP__
|
||||
|
||||
17
include/MetroidPrime/CRippleManager.hpp
Normal file
17
include/MetroidPrime/CRippleManager.hpp
Normal file
@@ -0,0 +1,17 @@
|
||||
#ifndef _CRIPPLEMANAGER_HPP
|
||||
#define _CRIPPLEMANAGER_HPP
|
||||
|
||||
#include "types.h"
|
||||
|
||||
#include "rstl/vector.hpp"
|
||||
|
||||
class CRipple;
|
||||
|
||||
class CRippleManager {
|
||||
private:
|
||||
f32 x0_maxTimeFalloff;
|
||||
rstl::vector< CRipple > x4_ripples;
|
||||
f32 x14_alpha;
|
||||
};
|
||||
|
||||
#endif
|
||||
13
include/MetroidPrime/CRumbleManager.hpp
Normal file
13
include/MetroidPrime/CRumbleManager.hpp
Normal file
@@ -0,0 +1,13 @@
|
||||
#ifndef _CRUMBLEMANAGER_HPP
|
||||
#define _CRUMBLEMANAGER_HPP
|
||||
|
||||
#include "types.h"
|
||||
|
||||
#include "Kyoto/Input/CRumbleGenerator.hpp"
|
||||
|
||||
class CRumbleManager {
|
||||
private:
|
||||
CRumbleGenerator x0_rumbleGenerator;
|
||||
};
|
||||
|
||||
#endif
|
||||
16
include/MetroidPrime/CSfxHandle.hpp
Normal file
16
include/MetroidPrime/CSfxHandle.hpp
Normal file
@@ -0,0 +1,16 @@
|
||||
#ifndef _CSFXHANDLE_HPP
|
||||
#define _CSFXHANDLE_HPP
|
||||
|
||||
#include "types.h"
|
||||
|
||||
class CSfxHandle {
|
||||
public:
|
||||
CSfxHandle() : value(0) {}
|
||||
CSfxHandle(u32 value) : value(value) {}
|
||||
|
||||
private:
|
||||
u32 value;
|
||||
};
|
||||
CHECK_SIZEOF(CSfxHandle, 0x4)
|
||||
|
||||
#endif
|
||||
35
include/MetroidPrime/CSortedLists.hpp
Normal file
35
include/MetroidPrime/CSortedLists.hpp
Normal file
@@ -0,0 +1,35 @@
|
||||
#ifndef _CSORTEDLISTS_HPP
|
||||
#define _CSORTEDLISTS_HPP
|
||||
|
||||
#include "types.h"
|
||||
|
||||
#include "MetroidPrime/CObjectList.hpp"
|
||||
|
||||
#include "Kyoto/Math/CAABox.hpp"
|
||||
|
||||
class CActor;
|
||||
|
||||
namespace SL {
|
||||
struct SNode {
|
||||
CActor* x0_actor;
|
||||
CAABox x4_box;
|
||||
s16 x1c_selfIdxs[6];
|
||||
s16 x28_next;
|
||||
bool x2a_populated;
|
||||
};
|
||||
CHECK_SIZEOF(SNode, 0x2c);
|
||||
|
||||
struct SSortedList {
|
||||
s16 x0_ids[kMaxObjects];
|
||||
u32 x800_size;
|
||||
};
|
||||
CHECK_SIZEOF(SSortedList, 0x804);
|
||||
|
||||
class CSortedListManager {
|
||||
SNode x0_nodes[kMaxObjects];
|
||||
SSortedList xb000_sortedLists[6];
|
||||
};
|
||||
CHECK_SIZEOF(CSortedListManager, 0xe018);
|
||||
} // namespace SL
|
||||
|
||||
#endif
|
||||
@@ -3,9 +3,50 @@
|
||||
|
||||
#include "types.h"
|
||||
|
||||
#include "MetroidPrime/CEntityInfo.hpp"
|
||||
#include "MetroidPrime/TGameTypes.hpp"
|
||||
|
||||
#include "rstl/auto_ptr.hpp"
|
||||
#include "rstl/list.hpp"
|
||||
#include "rstl/reserved_vector.hpp"
|
||||
#include "rstl/single_ptr.hpp"
|
||||
|
||||
class CActorModelParticles;
|
||||
class CCameraManager;
|
||||
class CEnvFxManager;
|
||||
class CFluidPlaneManager;
|
||||
class CObjectList;
|
||||
class CPlayer;
|
||||
class CRumbleManager;
|
||||
class CStateManagerContainer;
|
||||
class CWeaponMgr;
|
||||
class CWorld;
|
||||
|
||||
namespace SL {
|
||||
class CSortedListManager;
|
||||
} // namespace SL
|
||||
|
||||
class CStateManager {
|
||||
public:
|
||||
void SendScriptMsg(TUniqueId uid, TEditorId target, EScriptObjectMessage msg, EScriptObjectState state);
|
||||
|
||||
CCameraManager& GetCameraManager() { return *x870_cameraManager; }
|
||||
|
||||
private:
|
||||
u16 x0_nextFreeIndex;
|
||||
rstl::reserved_vector< u16, 1024 > x8_objectIndexArray;
|
||||
rstl::reserved_vector< rstl::auto_ptr< CObjectList >, 8 > x808_objectLists;
|
||||
CPlayer* x84c_player;
|
||||
rstl::single_ptr< CWorld > x850_world;
|
||||
rstl::list< rstl::reserved_vector< TUniqueId, 32 > > x854_graveyard;
|
||||
rstl::single_ptr< CStateManagerContainer > x86c_stateManagerContainer;
|
||||
CCameraManager* x870_cameraManager;
|
||||
SL::CSortedListManager* x874_sortedListManager;
|
||||
CWeaponMgr* x878_weaponMgr;
|
||||
CFluidPlaneManager* x87c_fluidPlaneManager;
|
||||
CEnvFxManager* x880_envFxManager;
|
||||
rstl::auto_ptr< CActorModelParticles > x884_actorModelParticles;
|
||||
CRumbleManager* x88c_rumbleManager;
|
||||
};
|
||||
|
||||
#endif
|
||||
|
||||
30
include/MetroidPrime/CStateManagerContainer.hpp
Normal file
30
include/MetroidPrime/CStateManagerContainer.hpp
Normal file
@@ -0,0 +1,30 @@
|
||||
#ifndef _CSTATEMANAGERCONTAINER_HPP
|
||||
#define _CSTATEMANAGERCONTAINER_HPP
|
||||
|
||||
#include "types.h"
|
||||
|
||||
#include "MetroidPrime/CActorModelParticles.hpp"
|
||||
#include "MetroidPrime/CEnvFxManager.hpp"
|
||||
#include "MetroidPrime/CFluidPlaneManager.hpp"
|
||||
#include "MetroidPrime/CRumbleManager.hpp"
|
||||
#include "MetroidPrime/CSortedLists.hpp"
|
||||
#include "MetroidPrime/CWeaponMgr.hpp"
|
||||
#include "MetroidPrime/Cameras/CCameraManager.hpp"
|
||||
#include "MetroidPrime/TGameTypes.hpp"
|
||||
|
||||
#include "rstl/reserved_vector.hpp"
|
||||
|
||||
class CStateManagerContainer {
|
||||
CCameraManager x0_cameraManager;
|
||||
SL::CSortedListManager x3c0_sortedListManager;
|
||||
CWeaponMgr xe3d8_weaponManager;
|
||||
CFluidPlaneManager xe3ec_fluidPlaneManager;
|
||||
CEnvFxManager xe510_envFxManager;
|
||||
CActorModelParticles xf168_actorModelParticles;
|
||||
CRumbleManager xf250_rumbleManager;
|
||||
rstl::reserved_vector< TUniqueId, 20 > xf344_;
|
||||
rstl::reserved_vector< TUniqueId, 20 > xf370_;
|
||||
rstl::reserved_vector< TUniqueId, 20 > xf39c_renderLast;
|
||||
};
|
||||
|
||||
#endif
|
||||
17
include/MetroidPrime/CWeaponMgr.hpp
Normal file
17
include/MetroidPrime/CWeaponMgr.hpp
Normal file
@@ -0,0 +1,17 @@
|
||||
#ifndef _CWEAPONMANAGER_HPP
|
||||
#define _CWEAPONMANAGER_HPP
|
||||
|
||||
#include "types.h"
|
||||
|
||||
#include "MetroidPrime/TGameTypes.hpp"
|
||||
|
||||
#include "rstl/map.hpp"
|
||||
#include "rstl/reserved_vector.hpp"
|
||||
|
||||
class CWeaponMgr {
|
||||
private:
|
||||
rstl::map< TUniqueId, rstl::reserved_vector< s32, 15 > > x0_weapons;
|
||||
};
|
||||
CHECK_SIZEOF(CWeaponMgr, 0x14);
|
||||
|
||||
#endif
|
||||
@@ -3,7 +3,7 @@
|
||||
|
||||
#include "types.h"
|
||||
|
||||
#include "Kyoto/Math/CColor.hpp"
|
||||
#include "Kyoto/Graphics/CColor.hpp"
|
||||
|
||||
#include "CTexture.hpp"
|
||||
|
||||
|
||||
61
include/MetroidPrime/Cameras/CCameraManager.hpp
Normal file
61
include/MetroidPrime/Cameras/CCameraManager.hpp
Normal file
@@ -0,0 +1,61 @@
|
||||
#ifndef _CCAMERAMANAGER_HPP
|
||||
#define _CCAMERAMANAGER_HPP
|
||||
|
||||
#include "types.h"
|
||||
|
||||
#include "MetroidPrime/CAreaFog.hpp"
|
||||
#include "MetroidPrime/TGameTypes.hpp"
|
||||
|
||||
#include "Kyoto/Math/CVector3f.hpp"
|
||||
|
||||
#include "rstl/list.hpp"
|
||||
#include "rstl/pair.hpp"
|
||||
#include "rstl/reserved_vector.hpp"
|
||||
#include "rstl/vector.hpp"
|
||||
|
||||
class CBallCamera;
|
||||
class CCameraShakeData;
|
||||
class CFirstPersonCamera;
|
||||
class CGameCamera;
|
||||
class CInterpolationCamera;
|
||||
class CStateManager;
|
||||
|
||||
class CCameraManager {
|
||||
public:
|
||||
CGameCamera* GetCurrentCamera(CStateManager& mgr);
|
||||
|
||||
private:
|
||||
TUniqueId x0_curCameraId;
|
||||
rstl::vector< TUniqueId > x4_cineCameras;
|
||||
rstl::list< CCameraShakeData > x14_shakers;
|
||||
u32 x2c_lastShakeId;
|
||||
CVector3f x30_shakeOffset;
|
||||
CAreaFog x3c_fog;
|
||||
s32 x74_fluidCounter;
|
||||
TUniqueId x78_fluidId;
|
||||
CFirstPersonCamera* x7c_fpCamera;
|
||||
CBallCamera* x80_ballCamera;
|
||||
s32 x84_rumbleId;
|
||||
CInterpolationCamera* x88_interpCamera;
|
||||
s16 x8c_;
|
||||
f32 x90_rumbleCooldown;
|
||||
f32 x94_fogDensityFactor;
|
||||
f32 x98_fogDensitySpeed;
|
||||
f32 x9c_fogDensityFactorTarget;
|
||||
bool xa0_24_pendingRumble : 1;
|
||||
bool xa0_25_rumbling : 1;
|
||||
bool xa0_26_inWater : 1;
|
||||
TUniqueId xa2_spindleCamId;
|
||||
TUniqueId xa4_pathCamId;
|
||||
TUniqueId xa6_camHintId;
|
||||
s32 xa8_hintPriority;
|
||||
rstl::reserved_vector< rstl::pair< s32, TUniqueId >, 64 > xac_cameraHints;
|
||||
rstl::reserved_vector< TUniqueId, 64 > x2b0_inactiveCameraHints;
|
||||
rstl::reserved_vector< TUniqueId, 64 > x334_activeCameraHints;
|
||||
bool x3b8_24_ : 1;
|
||||
bool x3b8_25_ : 1;
|
||||
f32 x3bc_curFov;
|
||||
};
|
||||
CHECK_SIZEOF(CCameraManager, 0x3c0)
|
||||
|
||||
#endif
|
||||
44
include/MetroidPrime/Cameras/CCameraShakeData.hpp
Normal file
44
include/MetroidPrime/Cameras/CCameraShakeData.hpp
Normal file
@@ -0,0 +1,44 @@
|
||||
#ifndef _CCAMERASHAKEDATA_HPP
|
||||
#define _CCAMERASHAKEDATA_HPP
|
||||
|
||||
#include "types.h"
|
||||
|
||||
#include "Kyoto/Math/CVector3f.hpp"
|
||||
|
||||
struct SCameraShakePoint {
|
||||
bool x0_useEnvelope;
|
||||
f32 x4_value;
|
||||
f32 x8_magnitude;
|
||||
f32 xc_attackTime;
|
||||
f32 x10_sustainTime;
|
||||
f32 x14_duration;
|
||||
};
|
||||
CHECK_SIZEOF(SCameraShakePoint, 0x18)
|
||||
|
||||
class CCameraShakerComponent {
|
||||
public:
|
||||
virtual ~CCameraShakerComponent();
|
||||
|
||||
private:
|
||||
bool x4_useModulation;
|
||||
SCameraShakePoint x8_am;
|
||||
SCameraShakePoint x20_fm;
|
||||
f32 x38_value;
|
||||
};
|
||||
CHECK_SIZEOF(CCameraShakerComponent, 0x3c)
|
||||
|
||||
class CCameraShakeData {
|
||||
private:
|
||||
f32 x0_duration;
|
||||
f32 x4_curTime;
|
||||
CCameraShakerComponent x8_shakerX;
|
||||
CCameraShakerComponent x44_shakerY;
|
||||
CCameraShakerComponent x80_shakerZ;
|
||||
u32 xbc_shakerId;
|
||||
u32 xc0_flags;
|
||||
CVector3f xc4_sfxPos;
|
||||
f32 xd0_sfxDist;
|
||||
};
|
||||
CHECK_SIZEOF(CCameraShakeData, 0xd4)
|
||||
|
||||
#endif
|
||||
31
include/MetroidPrime/Cameras/CGameCamera.hpp
Normal file
31
include/MetroidPrime/Cameras/CGameCamera.hpp
Normal file
@@ -0,0 +1,31 @@
|
||||
#ifndef _CGAMECAMERA_HPP
|
||||
#define _CGAMECAMERA_HPP
|
||||
|
||||
#include "types.h"
|
||||
|
||||
#include "MetroidPrime/CActor.hpp"
|
||||
|
||||
#include "Kyoto/Math/CTransform4f.hpp"
|
||||
#include "Kyoto/Math/CMatrix4f.hpp"
|
||||
|
||||
class CGameCamera : public CActor {
|
||||
private:
|
||||
TUniqueId xe8_watchedObject;
|
||||
mutable CMatrix4f xec_perspectiveMatrix;
|
||||
CTransform4f x12c_origXf;
|
||||
f32 x15c_currentFov;
|
||||
f32 x160_znear;
|
||||
f32 x164_zfar;
|
||||
f32 x168_aspect;
|
||||
u32 x16c_controllerIdx;
|
||||
mutable bool x170_24_perspDirty : 1;
|
||||
bool x170_25_disablesInput : 1;
|
||||
f32 x174_delayTime;
|
||||
f32 x178_perspInterpRemTime;
|
||||
f32 x17c_perspInterpDur;
|
||||
f32 x180_perspInterpStartFov;
|
||||
f32 x184_perspInterpEndFov;
|
||||
};
|
||||
CHECK_SIZEOF(CGameCamera, 0x188)
|
||||
|
||||
#endif
|
||||
@@ -21,6 +21,7 @@ struct TAreaId {
|
||||
bool operator==(const TAreaId& other) const { return value == other.value; }
|
||||
bool operator!=(const TAreaId& other) const { return value != other.value; }
|
||||
};
|
||||
CHECK_SIZEOF(TAreaId, 0x4)
|
||||
|
||||
struct TEditorId {
|
||||
u32 value;
|
||||
@@ -32,6 +33,7 @@ struct TEditorId {
|
||||
bool operator==(const TEditorId& other) const { return value == other.value; }
|
||||
bool operator!=(const TEditorId& other) const { return value != other.value; }
|
||||
};
|
||||
CHECK_SIZEOF(TEditorId, 0x4)
|
||||
|
||||
struct TUniqueId {
|
||||
union {
|
||||
@@ -49,5 +51,9 @@ struct TUniqueId {
|
||||
bool operator==(const TUniqueId& other) const { return value == other.value; }
|
||||
bool operator!=(const TUniqueId& other) const { return value != other.value; }
|
||||
};
|
||||
CHECK_SIZEOF(TUniqueId, 0x2)
|
||||
|
||||
typedef u16 TSfxId;
|
||||
static TSfxId InvalidSfxId = 0xFFFFu;
|
||||
|
||||
#endif
|
||||
|
||||
@@ -28,11 +28,14 @@ public:
|
||||
// other.x0_has = false;
|
||||
// }
|
||||
T* get() { return x4_item; }
|
||||
const T* get() const { return x4_item; }
|
||||
T* operator->() { return get(); }
|
||||
const T* operator->() const { return get(); }
|
||||
T* release() const {
|
||||
x0_has = false;
|
||||
return x4_item;
|
||||
}
|
||||
operator bool() const { return x0_has; }
|
||||
};
|
||||
} // namespace rstl
|
||||
|
||||
|
||||
@@ -72,6 +72,13 @@ inline void uninitialized_copy_n(D* dest, S* src, size_t count) {
|
||||
}
|
||||
// destroy(src, src + count); ??
|
||||
}
|
||||
|
||||
template < typename D, typename S >
|
||||
inline void uninitialized_fill_n(D dest, int count, const S& value) {
|
||||
for (int i = 0; i < count; ++dest, ++i) {
|
||||
construct(dest, value);
|
||||
}
|
||||
}
|
||||
} // namespace rstl
|
||||
|
||||
#endif
|
||||
|
||||
@@ -6,7 +6,10 @@
|
||||
#include "rstl/rmemory_allocator.hpp"
|
||||
|
||||
namespace rstl {
|
||||
template < typename K, typename V, typename Alloc = rmemory_allocator >
|
||||
template < typename T >
|
||||
struct less {};
|
||||
|
||||
template < typename K, typename V, typename Cmp = less< K >, typename Alloc = rmemory_allocator >
|
||||
class map {
|
||||
u8 pad[0x10];
|
||||
};
|
||||
|
||||
@@ -10,17 +10,19 @@ namespace rstl {
|
||||
template < typename T, size_t N >
|
||||
class reserved_vector {
|
||||
size_t x0_count;
|
||||
T x4_items[N];
|
||||
u8 x4_data[N * sizeof(T)];
|
||||
|
||||
public:
|
||||
typedef pointer_iterator< T, reserved_vector< T, N >, void > iterator;
|
||||
typedef const_pointer_iterator< T, reserved_vector< T, N >, void > const_iterator;
|
||||
|
||||
inline iterator begin() { return iterator(x4_items); }
|
||||
inline const_iterator begin() const { return const_iterator(x4_items); }
|
||||
inline iterator end() { return iterator(x4_items + x0_count); }
|
||||
inline const_iterator end() const { return const_iterator(x4_items + x0_count); }
|
||||
inline iterator begin() { return iterator(data()); }
|
||||
inline const_iterator begin() const { return const_iterator(data()); }
|
||||
inline iterator end() { return iterator(data() + x0_count); }
|
||||
inline const_iterator end() const { return const_iterator(data() + x0_count); }
|
||||
|
||||
reserved_vector() : x0_count(0) {}
|
||||
reserved_vector(const T& value) : x0_count(N) { rstl::uninitialized_fill_n(data(), N, value); }
|
||||
reserved_vector(const reserved_vector& other) {
|
||||
x0_count = other.size();
|
||||
rstl::uninitialized_copy_n(data(), other.data(), size());
|
||||
@@ -35,14 +37,12 @@ public:
|
||||
}
|
||||
void clear() {
|
||||
for (size_t i = 0; i < x0_count; ++i) {
|
||||
rstl::destroy(&x4_items[i]);
|
||||
rstl::destroy(&data()[i]);
|
||||
}
|
||||
x0_count = 0;
|
||||
}
|
||||
|
||||
~reserved_vector() {
|
||||
clear();
|
||||
}
|
||||
~reserved_vector() { clear(); }
|
||||
|
||||
void push_back(const T& in) {
|
||||
if (x0_count < N) {
|
||||
@@ -52,14 +52,14 @@ public:
|
||||
}
|
||||
}
|
||||
|
||||
inline T* data() { return x4_items; }
|
||||
inline const T* data() const { return x4_items; }
|
||||
inline T* data() { return reinterpret_cast< T* >(x4_data); }
|
||||
inline const T* data() const { return reinterpret_cast< const T* >(x4_data); }
|
||||
inline size_t size() const { return x0_count; }
|
||||
inline size_t capacity() const { return N; }
|
||||
inline T& front() { return x4_items[0]; }
|
||||
inline const T& front() const { return x4_items[0]; }
|
||||
inline T& back() { return x4_items[x0_count - 1]; }
|
||||
inline const T& back() const { return x4_items[x0_count - 1]; }
|
||||
inline T& front() { return data()[0]; }
|
||||
inline const T& front() const { return data()[0]; }
|
||||
inline T& back() { return data()[x0_count - 1]; }
|
||||
inline const T& back() const { return data()[x0_count - 1]; }
|
||||
inline T& operator[](size_t idx) { return data()[idx]; }
|
||||
inline const T& operator[](size_t idx) const { return data()[idx]; }
|
||||
};
|
||||
|
||||
@@ -19,7 +19,13 @@ public:
|
||||
delete x0_ptr;
|
||||
x0_ptr = ptr;
|
||||
}
|
||||
operator bool() const { return x0_ptr != nullptr; }
|
||||
T& operator*() { return *x0_ptr; }
|
||||
const T& operator*() const { return *x0_ptr; }
|
||||
};
|
||||
|
||||
typedef single_ptr<void> unk_singleptr;
|
||||
CHECK_SIZEOF(unk_singleptr, 0x4);
|
||||
} // namespace rstl
|
||||
|
||||
#endif
|
||||
|
||||
@@ -115,6 +115,8 @@ string string_l(const char* data);
|
||||
// {
|
||||
// return string(string::literal_t(), data);
|
||||
// }
|
||||
|
||||
CHECK_SIZEOF(string, 0x10)
|
||||
} // namespace rstl
|
||||
|
||||
#endif
|
||||
|
||||
@@ -106,6 +106,9 @@ void vector< T, Alloc >::reserve(size_t size) {
|
||||
xc_items = newData;
|
||||
x8_capacity = size;
|
||||
}
|
||||
|
||||
typedef vector<void> unk_vector;
|
||||
CHECK_SIZEOF(unk_vector, 0x10)
|
||||
} // namespace rstl
|
||||
|
||||
#endif
|
||||
|
||||
33
include/static_assert.hpp
Normal file
33
include/static_assert.hpp
Normal file
@@ -0,0 +1,33 @@
|
||||
// C++98 static assert
|
||||
|
||||
template < bool expr >
|
||||
struct do_static_assert;
|
||||
|
||||
template <>
|
||||
struct do_static_assert< true > {
|
||||
static const char test;
|
||||
};
|
||||
|
||||
struct false_type {
|
||||
static const bool value = false;
|
||||
};
|
||||
|
||||
struct true_type {
|
||||
static const bool value = true;
|
||||
};
|
||||
|
||||
template < int A, int B >
|
||||
struct _n_is_equal : false_type {};
|
||||
|
||||
template < int A >
|
||||
struct _n_is_equal< A, A > : true_type {};
|
||||
|
||||
template < class T, int N >
|
||||
struct check_sizeof : _n_is_equal< sizeof(T), N > {};
|
||||
|
||||
#ifdef __MWERKS__
|
||||
#define CHECK_SIZEOF(cls, size) \
|
||||
static void cls##_check() { do_static_assert< check_sizeof< cls, size >::value >::test; }
|
||||
#else
|
||||
#define CHECK_SIZEOF(cls, size)
|
||||
#endif
|
||||
@@ -2,6 +2,8 @@
|
||||
#define __TYPES_H__
|
||||
|
||||
#ifdef __cplusplus
|
||||
#include "static_assert.hpp"
|
||||
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
|
||||
Reference in New Issue
Block a user