diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index dd82ae9f..e70f063c 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -42,6 +42,10 @@ Metaforce is a non-matching decompilation, and often uses modern C++ features th ### Converting types Metaforce -> decomp +- `s8` -> `char` +- `u8` -> `uchar` +- `s16` -> `short` +- `u16` -> `ushort` - `s32` -> `int` - `u32` -> `uint` - `zeus::CTransform` -> `CTransform4f` diff --git a/include/Collision/CCollidableAABox.hpp b/include/Collision/CCollidableAABox.hpp index e454d426..e795401b 100644 --- a/include/Collision/CCollidableAABox.hpp +++ b/include/Collision/CCollidableAABox.hpp @@ -12,7 +12,7 @@ public: : CCollisionPrimitive(matList), x10_aabb(box) {} // TODO - u32 GetTableIndex() const override; + uint GetTableIndex() const override; CAABox CalculateAABox(const CTransform4f&) const override; CAABox CalculateLocalAABox() const override; FourCC GetPrimType() const override; diff --git a/include/Collision/CCollidableSphere.hpp b/include/Collision/CCollidableSphere.hpp index 1fd7859b..d503fba9 100644 --- a/include/Collision/CCollidableSphere.hpp +++ b/include/Collision/CCollidableSphere.hpp @@ -12,7 +12,7 @@ public: CCollidableSphere(const CSphere& sphere, const CMaterialList& material) : CCollisionPrimitive(material), x10_sphere(sphere) {} - u32 GetTableIndex() const override; + uint GetTableIndex() const override; CAABox CalculateAABox(const CTransform4f&) const override; CAABox CalculateLocalAABox() const override; FourCC GetPrimType() const override; diff --git a/include/Collision/CCollisionPrimitive.hpp b/include/Collision/CCollisionPrimitive.hpp index 790e4218..b22f168e 100644 --- a/include/Collision/CCollisionPrimitive.hpp +++ b/include/Collision/CCollisionPrimitive.hpp @@ -16,7 +16,7 @@ class CCollisionPrimitive { public: CCollisionPrimitive(const CMaterialList& list); - virtual u32 GetTableIndex() const = 0; + virtual uint GetTableIndex() const = 0; virtual void SetMaterial(const CMaterialList&); virtual const CMaterialList& GetMaterial() const; virtual CAABox CalculateAABox(const CTransform4f&) const = 0; diff --git a/include/Collision/CMaterialList.hpp b/include/Collision/CMaterialList.hpp index 31be0e95..045ecb8d 100644 --- a/include/Collision/CMaterialList.hpp +++ b/include/Collision/CMaterialList.hpp @@ -116,7 +116,7 @@ public: // HasMaterials__13CMaterialListCFv weak // GetField__13CMaterialListCFUxUx weak // Intersection__13CMaterialListCFRC13CMaterialList weak - static s32 BitPosition(u64 flags); + static int BitPosition(u64 flags); // GetMaterialString__13CMaterialListCFv weak bool SharesMaterials(const CMaterialList& other) const { return (other.value & value) ? true : false; diff --git a/include/Collision/CRayCastResult.hpp b/include/Collision/CRayCastResult.hpp index ac4f07dc..680e5ac3 100644 --- a/include/Collision/CRayCastResult.hpp +++ b/include/Collision/CRayCastResult.hpp @@ -15,7 +15,7 @@ public: kI_Valid, }; - f32 GetTime() const { return x0_t; } + float GetTime() const { return x0_t; } bool IsValid() const { return x20_valid; } // GetPlane__14CRayCastResultCFv // GetPoint__14CRayCastResultCFv @@ -25,7 +25,7 @@ public: // MakeInvalid__14CRayCastResultFv private: - f32 x0_t; + float x0_t; CVector3f x4_point; CPlane x10_plane; bool x20_valid; diff --git a/include/GuiSys/CGuiSys.hpp b/include/GuiSys/CGuiSys.hpp index e0d07f92..3cec4083 100644 --- a/include/GuiSys/CGuiSys.hpp +++ b/include/GuiSys/CGuiSys.hpp @@ -26,7 +26,7 @@ public: } private: - u8 pad[0x14]; + uchar pad[0x14]; static CGuiSys* spGuiSys; }; diff --git a/include/Kyoto/Alloc/CCircularBuffer.hpp b/include/Kyoto/Alloc/CCircularBuffer.hpp index 220dd361..82f14a49 100644 --- a/include/Kyoto/Alloc/CCircularBuffer.hpp +++ b/include/Kyoto/Alloc/CCircularBuffer.hpp @@ -14,12 +14,12 @@ public: int GetAllocatedAmount() const; private: - u8 x0_owned; + uchar x0_owned; void* x4_ptr; - s32 x8_bufferLen; - s32 xc_; - s32 x10_nextFreeAddr; - s32 x14_; + int x8_bufferLen; + int xc_; + int x10_nextFreeAddr; + int x14_; }; #endif // _CCIRCULARBUFFER diff --git a/include/Kyoto/Alloc/CGameAllocator.hpp b/include/Kyoto/Alloc/CGameAllocator.hpp index 996ca90d..eea7123b 100644 --- a/include/Kyoto/Alloc/CGameAllocator.hpp +++ b/include/Kyoto/Alloc/CGameAllocator.hpp @@ -37,8 +37,8 @@ public: x14_next = next; x14_next = (SGameMemInfo*)(((size_t)ptr & 31) | ((size_t)x14_next & ~31)); } - u32 GetPrevMaskedFlags(); - u32 GetNextMaskedFlags(); + uint GetPrevMaskedFlags(); + uint GetNextMaskedFlags(); void SetTopOfHeapAllocated(bool topOfHeap); size_t GetLength() const { return x4_len; } SGameMemInfo* GetNextFree() const { return (SGameMemInfo*)((size_t)x18_nextFree & ~31); } @@ -95,16 +95,16 @@ public: size_t GetLargestFreeChunk() const; private: - SGameMemInfo** GetBinPtr(u32 bin) { return &x14_bins[bin]; } - u8 x4_; - u8 x5_; - u8 x6_; - u8 x7_; - u32 x8_heapSize; + SGameMemInfo** GetBinPtr(uint bin) { return &x14_bins[bin]; } + uchar x4_; + uchar x5_; + uchar x6_; + uchar x7_; + uint x8_heapSize; SGameMemInfo* xc_first; SGameMemInfo* x10_last; SGameMemInfo* x14_bins[16]; - u32 x54_; + uint x54_; FOutOfMemoryCb x58_oomCallback; const void* x5c_oomTarget; CSmallAllocPool* x60_smallAllocPool; diff --git a/include/Kyoto/Alloc/CMediumAllocPool.hpp b/include/Kyoto/Alloc/CMediumAllocPool.hpp index f86e4c89..4c5be428 100644 --- a/include/Kyoto/Alloc/CMediumAllocPool.hpp +++ b/include/Kyoto/Alloc/CMediumAllocPool.hpp @@ -6,7 +6,7 @@ class CMediumAllocPool { public: struct SMediumAllocPuddle { - u8 unk; + uchar unk; void* x4_mainData; void* x8_bookKeeping; void* xc_cachedBookKeepingOffset; @@ -24,7 +24,7 @@ public: void AddPuddle(uint, void*, int); void ClearPuddles(); - s32 Free(const void* ptr); + int Free(const void* ptr); uint GetTotalEntries(); uint GetNumBlocksAvailable(); diff --git a/include/Kyoto/Alloc/CSmallAllocPool.hpp b/include/Kyoto/Alloc/CSmallAllocPool.hpp index 1c8c4486..1a4366db 100644 --- a/include/Kyoto/Alloc/CSmallAllocPool.hpp +++ b/include/Kyoto/Alloc/CSmallAllocPool.hpp @@ -13,16 +13,16 @@ public: bool Free(const void* ptr); bool PtrWithinPool(const void* ptr) const { - return u32((reinterpret_cast< const u8* >(ptr) - reinterpret_cast< u8* >(x0_mainData)) / 4) < - x8_numBlocks; + return uint((reinterpret_cast< const uchar* >(ptr) - reinterpret_cast< uchar* >(x0_mainData)) / + 4) < x8_numBlocks; } uint GetIndexFromPtr(const void* ptr) const { - return ((const u8*)ptr - x0_mainData) / kPointerSize; + return ((const uchar*)ptr - x0_mainData) / kPointerSize; } - long GetEntryValue(uint idx) const { return (long)*((u8*)x4_bookKeeping + idx); } - u8* GetPtrFromIndex(unsigned int idx) const { - return static_cast< u8* >(x0_mainData) + (idx << 3); + long GetEntryValue(uint idx) const { return (long)*((uchar*)x4_bookKeeping + idx); } + uchar* GetPtrFromIndex(unsigned int idx) const { + return static_cast< uchar* >(x0_mainData) + (idx << 3); } uint GetNumBlocksAvailable() const { return x18_numBlocksAvailable; } diff --git a/include/Kyoto/Animation/CPASAnimState.hpp b/include/Kyoto/Animation/CPASAnimState.hpp index 437284c4..6831bdfb 100644 --- a/include/Kyoto/Animation/CPASAnimState.hpp +++ b/include/Kyoto/Animation/CPASAnimState.hpp @@ -50,16 +50,16 @@ public: union UParmValue { int m_int; uint m_uint; - f32 m_float; + float m_float; bool m_bool; }; CPASAnimParm(const CPASAnimParm& other) : x0_value(other.x0_value), x4_type(other.x4_type) {} - static CPASAnimParm FromEnum(s32 val); + static CPASAnimParm FromEnum(int val); static CPASAnimParm FromBool(bool val); static CPASAnimParm FromReal32(float val); - static CPASAnimParm FromUint32(u32 val); - static CPASAnimParm FromInt32(s32 val); + static CPASAnimParm FromUint32(uint val); + static CPASAnimParm FromInt32(int val); static CPASAnimParm NoParameter(); int GetInt32Value() const; diff --git a/include/Kyoto/Audio/CAudioSys.hpp b/include/Kyoto/Audio/CAudioSys.hpp index bc95eaed..936683ed 100644 --- a/include/Kyoto/Audio/CAudioSys.hpp +++ b/include/Kyoto/Audio/CAudioSys.hpp @@ -15,17 +15,17 @@ enum ETRKRepeatMode { class CAudioSys { public: - CAudioSys(u8, u8, u8, u8, uint); + CAudioSys(uchar, uchar, uchar, uchar, uint); ~CAudioSys(); - static void SysSetVolume(u8, uint, u8); - static void SetDefaultVolumeScale(s16); - static void SetVolumeScale(s16); + static void SysSetVolume(uchar, uint, uchar); + static void SetDefaultVolumeScale(short); + static void SetVolumeScale(short); static void TrkSetSampleRate(ETRKSampleRate); - static s16 GetDefaultVolumeScale(); + static short GetDefaultVolumeScale(); - static const u8 kMaxVolume; + static const uchar kMaxVolume; }; #endif // _CAUDIOSYS diff --git a/include/Kyoto/Audio/CSfxManager.hpp b/include/Kyoto/Audio/CSfxManager.hpp index 6327de82..6e0171b3 100644 --- a/include/Kyoto/Audio/CSfxManager.hpp +++ b/include/Kyoto/Audio/CSfxManager.hpp @@ -8,28 +8,28 @@ class CVector3f; class CSfxManager { public: - static void Update(f32 dt); + static void Update(float dt); static void RemoveEmitter(CSfxHandle handle); static void UpdateEmitter(CSfxHandle handle, const CVector3f& pos, const CVector3f& dir, uchar maxVol); - static const s16 kMaxPriority; // 0xFF - static const s16 kMedPriority; // 0x7F - static const u16 kInternalInvalidSfxId; // 0xFFFF - static const int kAllAreas; // 0xFFFFFFFF - static CSfxHandle AddEmitter(u16 id, const CVector3f& pos, const CVector3f& dir, - bool useAcoustics, bool looped, s16 prio = kMedPriority, + static const short kMaxPriority; // 0xFF + static const short kMedPriority; // 0x7F + static const ushort kInternalInvalidSfxId; // 0xFFFF + static const int kAllAreas; // 0xFFFFFFFF + static CSfxHandle AddEmitter(ushort id, const CVector3f& pos, const CVector3f& dir, + bool useAcoustics, bool looped, short prio = kMedPriority, int areaId = kAllAreas); - static CSfxHandle AddEmitter(u16 id, const CVector3f& pos, const CVector3f& dir, uchar vol, - bool useAcoustics, bool looped, s16 prio = kMedPriority, + static CSfxHandle AddEmitter(ushort id, const CVector3f& pos, const CVector3f& dir, uchar vol, + bool useAcoustics, bool looped, short prio = kMedPriority, int areaId = kAllAreas); static void Shutdown(); - static u16 TranslateSFXID(u16); + static ushort TranslateSFXID(ushort); static void PitchBend(CSfxHandle handle, int pitch); - static CSfxHandle SfxStart(u16 id, u8 vol, u8 pan, bool useAcoustics, s16 prio, bool looped, - s32 areaId); + static CSfxHandle SfxStart(ushort id, uchar vol, uchar pan, bool useAcoustics, short prio, + bool looped, int areaId); static bool IsPlaying(const CSfxHandle& handle); }; diff --git a/include/Kyoto/Audio/CStreamAudioManager.hpp b/include/Kyoto/Audio/CStreamAudioManager.hpp index 279ee6bf..6c182c4c 100644 --- a/include/Kyoto/Audio/CStreamAudioManager.hpp +++ b/include/Kyoto/Audio/CStreamAudioManager.hpp @@ -5,9 +5,9 @@ class CStreamAudioManager { public: - static void Update(f32 dt); + static void Update(float dt); static void StopAll(); - static void SetMusicVolume(u8); + static void SetMusicVolume(uchar); private: }; diff --git a/include/Kyoto/Basics/CCast.hpp b/include/Kyoto/Basics/CCast.hpp index c60ade6f..13e998c6 100644 --- a/include/Kyoto/Basics/CCast.hpp +++ b/include/Kyoto/Basics/CCast.hpp @@ -7,10 +7,10 @@ namespace CCast { #ifdef __MWERKS__ -inline u8 ToUint8(register f32 in) { - u8 a; - register u8* ptr = &a; - register u8 r; +inline uchar ToUint8(register float in) { + uchar a; + register uchar* ptr = &a; + register uchar r; asm { psq_st in, 0(ptr), 1, OS_FASTCAST_U8 @@ -19,17 +19,17 @@ inline u8 ToUint8(register f32 in) { return r; } -inline f32 ToReal32(register const u8& in) { - register f32 r; +inline float ToReal32(register const uchar& in) { + register float r; asm { psq_l r, 0(in), 1, 2 } return r; } -inline s16 FtoS(register f32 in) { - s16 a; - register s16* ptr = &a; +inline short FtoS(register float in) { + short a; + register short* ptr = &a; asm { psq_st in, 0(ptr), 1, OS_FASTCAST_S16 @@ -37,9 +37,9 @@ inline s16 FtoS(register f32 in) { return *ptr; } #else -inline u8 ToUint8(f32 in) { return static_cast< u8 >(in); } -inline f32 ToReal32(u8 in) { return static_cast< f32 >(in); } -inline s16 FtoS(f32 in) { return static_cast< s16 >(in); } +inline uchar ToUint8(float in) { return static_cast< uchar >(in); } +inline float ToReal32(uchar in) { return static_cast< float >(in); } +inline short FtoS(float in) { return static_cast< short >(in); } #endif } // namespace CCast diff --git a/include/Kyoto/Basics/CStopwatch.hpp b/include/Kyoto/Basics/CStopwatch.hpp index ab0a875b..e14b15a4 100644 --- a/include/Kyoto/Basics/CStopwatch.hpp +++ b/include/Kyoto/Basics/CStopwatch.hpp @@ -12,17 +12,17 @@ public: CSWData() : x0_timerFreq(0), x8_timerFreqO1M(0), x10_timerPeriod(0.f) {} bool Initialize(); - void Wait(f32) const; + void Wait(float) const; s64 GetTimerFreq() const { return x0_timerFreq; } s64 GetTimerFreqO1M() const { return x8_timerFreqO1M; } - f32 GetTimerPeriod() const { return x10_timerPeriod; } + float GetTimerPeriod() const { return x10_timerPeriod; } s64 GetCPUCycles() const { return OSGetTime(); } private: s64 x0_timerFreq; s64 x8_timerFreqO1M; - f32 x10_timerPeriod; + float x10_timerPeriod; }; CStopwatch() : x0_startTime(mData.GetCPUCycles()) {} @@ -34,14 +34,14 @@ public: } x0_startTime = mData.GetCPUCycles(); } - inline f32 GetElapsedTime() const { + inline float GetElapsedTime() const { return (mData.GetCPUCycles() - x0_startTime) * mData.GetTimerPeriod(); } inline s64 GetElapsedMicros() const { return (mData.GetCPUCycles() - x0_startTime) / mData.GetTimerFreqO1M(); } - static void Wait(f32); + static void Wait(float); private: static CSWData mData; diff --git a/include/Kyoto/CARAMManager.hpp b/include/Kyoto/CARAMManager.hpp index 163f2420..d1d6e084 100644 --- a/include/Kyoto/CARAMManager.hpp +++ b/include/Kyoto/CARAMManager.hpp @@ -11,7 +11,7 @@ public: static void Initialize(uint); private: - static u32 mPreInitializeAlloc; + static uint mPreInitializeAlloc; }; #endif // _CARAMMANAGER diff --git a/include/Kyoto/CDvdFile.hpp b/include/Kyoto/CDvdFile.hpp index 43b2073d..f19c8870 100644 --- a/include/Kyoto/CDvdFile.hpp +++ b/include/Kyoto/CDvdFile.hpp @@ -8,7 +8,7 @@ public: static bool FileExists(const char*); private: - u8 pad[0x28]; + uchar pad[0x28]; }; #endif // _CDVDFILE diff --git a/include/Kyoto/CFactoryMgr.hpp b/include/Kyoto/CFactoryMgr.hpp index f2609c3b..ec9873fc 100644 --- a/include/Kyoto/CFactoryMgr.hpp +++ b/include/Kyoto/CFactoryMgr.hpp @@ -10,7 +10,7 @@ class CFactoryMgr { public: private: - u8 pad[0x38]; + uchar pad[0x38]; }; class CFactoryFnReturn { diff --git a/include/Kyoto/CMemorySys.hpp b/include/Kyoto/CMemorySys.hpp index cf05246f..93a1dff5 100644 --- a/include/Kyoto/CMemorySys.hpp +++ b/include/Kyoto/CMemorySys.hpp @@ -14,7 +14,7 @@ public: static IAllocator& GetGameAllocator(); private: - u8 x0_unk; + uchar x0_unk; }; #endif // _CMEMORYSYS diff --git a/include/Kyoto/CObjectReference.hpp b/include/Kyoto/CObjectReference.hpp index f641365f..76d37e02 100644 --- a/include/Kyoto/CObjectReference.hpp +++ b/include/Kyoto/CObjectReference.hpp @@ -23,9 +23,9 @@ public: bool IsLoaded() const { return x10_object != nullptr; } private: - u16 x0_refCount; + ushort x0_refCount; bool x2_locked : 1; - u16 x2_lockCount : 15; + ushort x2_lockCount : 15; SObjectTag x4_objTag; IObjectStore* xc_objectStore; IObj* x10_object; diff --git a/include/Kyoto/CPakFile.hpp b/include/Kyoto/CPakFile.hpp index 4d87bd5a..5595fb14 100644 --- a/include/Kyoto/CPakFile.hpp +++ b/include/Kyoto/CPakFile.hpp @@ -25,7 +25,7 @@ private: bool x28_27_stashedInARAM : 1; int x2c_asyncLoadPhase; // EAsyncPhase rstl::auto_ptr< void > x30_dvdReq; // IDvdRequest - rstl::vector< u8 > x38_headerData; + rstl::vector< uchar > x38_headerData; uint x48_resTableOffset; uint x4c_resTableCount; int x50_aramBase; diff --git a/include/Kyoto/CSimplePool.hpp b/include/Kyoto/CSimplePool.hpp index dab938dc..0ee0823a 100644 --- a/include/Kyoto/CSimplePool.hpp +++ b/include/Kyoto/CSimplePool.hpp @@ -27,8 +27,8 @@ public: virtual void ObjectUnreferenced(const SObjectTag& tag); private: - u8 x4_; - u8 x5_; + uchar x4_; + uchar x5_; rstl::hash_map< unkptr, unkptr, void, void > x8_resources; unkptr x18_factory; rstl::rc_ptr< CVParamTransfer > x1c_paramXfr; diff --git a/include/Kyoto/Graphics/CColor.hpp b/include/Kyoto/Graphics/CColor.hpp index b744b2a2..91327df6 100644 --- a/include/Kyoto/Graphics/CColor.hpp +++ b/include/Kyoto/Graphics/CColor.hpp @@ -17,8 +17,8 @@ public: CColor() {} CColor(uint col) : mRgba(col) {} CColor(CInputStream& in); - CColor(f32 r, f32 g, f32 b, f32 a = 1.f); - CColor(u8 r, u8 g, u8 b, u8 a = 255) { + CColor(float r, float g, float b, float a = 1.f); + CColor(uchar r, uchar g, uchar b, uchar a = 255) { mR = r; mG = g; mB = b; @@ -32,15 +32,15 @@ public: static uint Lerp(uint a, uint b, float t); static CColor Modulate(const CColor& a, const CColor& b); static CColor Add(const CColor& a, const CColor& b); - f32 GetRed() const { return CCast::ToReal32(mR) * (1 / 255.f); } - f32 GetGreen() const { return CCast::ToReal32(mG) * (1 / 255.f); } - f32 GetBlue() const { return CCast::ToReal32(mB) * (1 / 255.f); } - f32 GetAlpha() const { return CCast::ToReal32(mA) * (1 / 255.f); } - u8 GetRedu8() const { return mR; } - u8 GetGreenu8() const { return mG; } - u8 GetBlueu8() const { return mB; } - u8 GetAlphau8() const { return mA; } - u16 ToRGB5A3() const; + float GetRed() const { return CCast::ToReal32(mR) * (1 / 255.f); } + float GetGreen() const { return CCast::ToReal32(mG) * (1 / 255.f); } + float GetBlue() const { return CCast::ToReal32(mB) * (1 / 255.f); } + float GetAlpha() const { return CCast::ToReal32(mA) * (1 / 255.f); } + uchar GetReduchar() const { return mR; } + uchar GetGreenuchar() const { return mG; } + uchar GetBlueuchar() const { return mB; } + uchar GetAlphauchar() const { return mA; } + ushort ToRGB5A3() const; GXColor ToGX(uint); static const CColor& Black(); @@ -56,10 +56,10 @@ public: private: union { struct { - u8 mR; - u8 mG; - u8 mB; - u8 mA; + uchar mR; + uchar mG; + uchar mB; + uchar mA; }; uint mRgba; }; diff --git a/include/Kyoto/Graphics/CGX.hpp b/include/Kyoto/Graphics/CGX.hpp index 4dc9ca3a..5f0e5984 100644 --- a/include/Kyoto/Graphics/CGX.hpp +++ b/include/Kyoto/Graphics/CGX.hpp @@ -17,8 +17,8 @@ public: uint xc_alphaOps; uint x10_indFlags; uint x14_tevOrderFlags; - u8 x18_kColorSel; - u8 x19_kAlphaSel; + uchar x18_kColorSel; + uchar x19_kAlphaSel; STevState(); }; @@ -30,10 +30,10 @@ public: }; struct SFogParams { - f32 x0_fogStartZ; - f32 x4_fogEndZ; - f32 x8_fogNearZ; - f32 xc_fogFarZ; + float x0_fogStartZ; + float x4_fogEndZ; + float x8_fogNearZ; + float xc_fogFarZ; GXColor x10_fogColor; SFogParams() : x0_fogStartZ(0.f), x4_fogEndZ(1.f), x8_fogNearZ(0.1f), xc_fogFarZ(1.f) { @@ -46,28 +46,28 @@ public: struct SGXState { const void* x0_arrayPtrs[12]; - u16 x30_prevChanCtrls[2]; - u16 x34_chanCtrls[2]; + ushort x30_prevChanCtrls[2]; + ushort x34_chanCtrls[2]; GXColor x38_chanAmbColors[2]; GXColor x40_chanMatColors[2]; uint x48_descList; union { - u8 x4c_chanFlags; + uchar x4c_chanFlags; struct { - u8 unused : 5; - u8 chansDirty : 2; - u8 numDirty : 1; + uchar unused : 5; + uchar chansDirty : 2; + uchar numDirty : 1; } x4c_flags; }; - u8 x4d_prevNumChans; - u8 x4e_numChans; - u8 x4f_numTexGens; - u8 x50_numTevStages; - u8 x51_numIndStages; - u8 x52_zmode; - u8 x53_fogType; - u16 x54_lineWidthAndOffset; - u16 x56_blendMode; + uchar x4d_prevNumChans; + uchar x4e_numChans; + uchar x4f_numTexGens; + uchar x50_numTevStages; + uchar x51_numIndStages; + uchar x52_zmode; + uchar x53_fogType; + ushort x54_lineWidthAndOffset; + ushort x56_blendMode; GXColor x58_kColors[4]; STevState x68_tevStates[16]; STexState x228_texStates[8]; @@ -82,10 +82,10 @@ public: Channel1, // GX_COLOR1 }; - static void SetNumChans(u8 num); - static void SetNumTexGens(u8 num); - static void SetNumTevStages(u8 num); - static void SetNumIndStages(u8 num); + static void SetNumChans(uchar num); + static void SetNumTexGens(uchar num); + static void SetNumTevStages(uchar num); + static void SetNumIndStages(uchar num); static void SetChanAmbColor(EChannelId channel, const GXColor& color); static void SetChanMatColor(EChannelId channel, const GXColor& color); static void SetChanCtrl(EChannelId channel, GXBool enable, GXColorSrc ambSrc, GXColorSrc matSrc, @@ -108,7 +108,8 @@ public: static void SetBlendMode(GXBlendMode mode, GXBlendFactor srcFac, GXBlendFactor dstFac, GXLogicOp op); static void SetZMode(bool compareEnable, GXCompare func, bool updateEnable); - static void SetAlphaCompare(GXCompare comp0, u8 ref0, GXAlphaOp op, GXCompare comp1, u8 ref1); + static void SetAlphaCompare(GXCompare comp0, uchar ref0, GXAlphaOp op, GXCompare comp1, + uchar ref1); static void SetTevIndirect(GXTevStageID stageId, GXIndTexStageID indStage, GXIndTexFormat fmt, GXIndTexBiasSel biasSel, GXIndTexMtxID mtxSel, GXIndTexWrap wrapS, GXIndTexWrap wrapT, GXBool addPrev, GXBool indLod, @@ -116,10 +117,10 @@ public: static void SetTevDirect(GXTevStageID stageId); static void SetTexCoordGen(GXTexCoordID dstCoord, GXTexGenType fn, GXTexGenSrc src, GXTexMtx mtx, GXBool normalize, GXPTTexMtx postMtx); - static void SetArray(GXAttr attr, const void* data, u8 stride); - static void SetFog(GXFogType type, f32 startZ, f32 endZ, f32 nearZ, f32 farZ, + static void SetArray(GXAttr attr, const void* data, uchar stride); + static void SetFog(GXFogType type, float startZ, float endZ, float nearZ, float farZ, const GXColor& color); - static void SetLineWidth(u8 width, GXTexOffset offset); + static void SetLineWidth(uchar width, GXTexOffset offset); static void SetIndTexMtxSTPointFive(GXIndTexMtxID id, s8 scaleExp); static void SetVtxDescv_Compressed(uint flags); static void SetVtxDesc(GXAttr attr, GXAttrType type); // name? @@ -130,18 +131,18 @@ public: static void SetStandardTevColorAlphaOp(GXTevStageID stageId); static void CallDisplayList(const void* ptr, size_t size); - static void Begin(GXPrimitive prim, GXVtxFmt fmt, u16 numVtx); + static void Begin(GXPrimitive prim, GXVtxFmt fmt, ushort numVtx); static void End(); static void ResetGXStates(); static void ResetGXStatesFull(); // name? - static inline void LoadTexMtxImm(const f32 mtx[][4], unsigned long id, GXTexMtxType type) { + static inline void LoadTexMtxImm(const float mtx[][4], unsigned long id, GXTexMtxType type) { GXLoadTexMtxImm(const_cast< MtxPtr >(mtx), id, type); } static GXColor GetChanAmbColor(EChannelId channel); - static void GetFog(GXFogType* fogType, f32* fogStartZ, f32* fogEndZ, f32* fogNearZ, f32* fogFarZ, - GXColor* fogColor); + static void GetFog(GXFogType* fogType, float* fogStartZ, float* fogEndZ, float* fogNearZ, + float* fogFarZ, GXColor* fogColor); static inline bool CompareGXColors(const GXColor& lhs, const GXColor& rhs) { return *reinterpret_cast< const uint* >(&lhs) == *reinterpret_cast< const uint* >(&rhs); diff --git a/include/Kyoto/Graphics/CGraphics.hpp b/include/Kyoto/Graphics/CGraphics.hpp index 75ff66e4..fba249bb 100644 --- a/include/Kyoto/Graphics/CGraphics.hpp +++ b/include/Kyoto/Graphics/CGraphics.hpp @@ -49,7 +49,7 @@ public: static void SetTevOp(ERglTevStage stage, const CTevCombiners::CTevPass& pass); static void StreamBegin(ERglPrimitive primitive); static void StreamColor(const CColor& color); - static void StreamTexcoord(f32 u, f32 v); + static void StreamTexcoord(float u, float v); static void StreamVertex(const CVector3f& vtx); static void StreamEnd(); diff --git a/include/Kyoto/Graphics/CLight.hpp b/include/Kyoto/Graphics/CLight.hpp index fb94c13c..c9bc8635 100644 --- a/include/Kyoto/Graphics/CLight.hpp +++ b/include/Kyoto/Graphics/CLight.hpp @@ -43,7 +43,7 @@ public: float GetAngleAttenuationQuadratic() const { return x38_angleQ; } ELightType GetType() const { return x1c_type; } - u32 GetId() const { return x40_lightId; } + uint GetId() const { return x40_lightId; } float GetIntensity() const; float GetRadius() const; const CColor& GetColor() const { return x18_color; } @@ -64,17 +64,17 @@ private: CVector3f xc_dir; CColor x18_color; ELightType x1c_type; - f32 x20_spotCutoff; - f32 x24_distC; - f32 x28_distL; - f32 x2c_distQ; - f32 x30_angleC; - f32 x34_angleL; - f32 x38_angleQ; + float x20_spotCutoff; + float x24_distC; + float x28_distL; + float x2c_distQ; + float x30_angleC; + float x34_angleL; + float x38_angleQ; uint x3c_priority; uint x40_lightId; - mutable f32 x44_cachedRadius; - mutable f32 x48_cachedIntensity; + mutable float x44_cachedRadius; + mutable float x48_cachedIntensity; mutable bool x4c_24_intensityDirty : 1; mutable bool x4c_25_radiusDirty : 1; }; diff --git a/include/Kyoto/Graphics/CModelFlags.hpp b/include/Kyoto/Graphics/CModelFlags.hpp index 9fb4ef0b..d0928433 100644 --- a/include/Kyoto/Graphics/CModelFlags.hpp +++ b/include/Kyoto/Graphics/CModelFlags.hpp @@ -23,7 +23,7 @@ public: kF_ThermalUnsortedOnly = 0x40, }; - CModelFlags(ETrans trans, f32 rgba) + CModelFlags(ETrans trans, float rgba) : x0_blendMode(trans) , x1_matSetIdx(0) , x2_flags(kF_DepthCompare | kF_DepthUpdate) @@ -34,7 +34,7 @@ public: , x2_flags(kF_DepthCompare | kF_DepthUpdate) , x4_color(color) {} - CModelFlags(ETrans blendMode, u8 shadIdx, EFlags flags, const CColor& col) + CModelFlags(ETrans blendMode, uchar shadIdx, EFlags flags, const CColor& col) : x0_blendMode(blendMode), x1_matSetIdx(shadIdx), x2_flags(flags), x4_color(col) {} CModelFlags(const CModelFlags& flags, uint otherFlags) @@ -89,17 +89,17 @@ public: CColor GetColor() const { return x4_color; } static CModelFlags Normal() { return CModelFlags(kT_Opaque, 1.f); } - static CModelFlags AlphaBlended(f32 alpha) { return CModelFlags(kT_Blend, alpha); } + static CModelFlags AlphaBlended(float alpha) { return CModelFlags(kT_Blend, alpha); } static CModelFlags AlphaBlended(const CColor& color); - static CModelFlags Additive(f32 f); + static CModelFlags Additive(float 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; + uchar x0_blendMode; + uchar x1_matSetIdx; + ushort x2_flags; CColor x4_color; }; CHECK_SIZEOF(CModelFlags, 0x8) diff --git a/include/Kyoto/Graphics/CTexture.hpp b/include/Kyoto/Graphics/CTexture.hpp index bcb12796..b6acc87d 100644 --- a/include/Kyoto/Graphics/CTexture.hpp +++ b/include/Kyoto/Graphics/CTexture.hpp @@ -27,14 +27,14 @@ public: static void InvalidateTexmap(GXTexMapID id); - s16 GetWidth() const { return mWidth; } - s16 GetHeight() const { return mHeight; } + short GetWidth() const { return mWidth; } + short GetHeight() const { return mHeight; } private: - u32 mTexelFormat; // TODO: Enum - s16 mWidth; - s16 mHeight; - u8 pad[0x60]; + uint mTexelFormat; // TODO: Enum + short mWidth; + short mHeight; + uchar pad[0x60]; }; #endif // _CTEXTURE diff --git a/include/Kyoto/Input/CDolphinController.hpp b/include/Kyoto/Input/CDolphinController.hpp index 00788a88..a7ce667d 100644 --- a/include/Kyoto/Input/CDolphinController.hpp +++ b/include/Kyoto/Input/CDolphinController.hpp @@ -26,16 +26,16 @@ private: void ProcessInputData(); void ProcessAxis(int controller, EJoyAxis axis); void ProcessButtons(int controller); - void ProcessDigitalButton(int value, CControllerButton& button, u16 mapping); + void ProcessDigitalButton(int value, CControllerButton& button, ushort mapping); void ProcessAnalogButton(float value, CControllerAxis& axis); PADStatus x4_status[4]; CControllerGamepadData x34_gamepadStates[4]; EMotorState x194_motorStates[4]; uint x1a4_controllerTypes[4]; - u32 x1b4_controllerTypePollTime[4]; - u32 x1c4_; - u32 x1c8_invalidControllers; - u32 x1cc_; + uint x1b4_controllerTypePollTime[4]; + uint x1c4_; + uint x1c8_invalidControllers; + uint x1cc_; }; #endif // _CDOLPHINCONTROLLER diff --git a/include/Kyoto/Input/CRumbleGenerator.hpp b/include/Kyoto/Input/CRumbleGenerator.hpp index 7efce828..c2a0f722 100644 --- a/include/Kyoto/Input/CRumbleGenerator.hpp +++ b/include/Kyoto/Input/CRumbleGenerator.hpp @@ -9,8 +9,8 @@ class CRumbleGenerator { private: CRumbleVoice x0_voices[4]; - f32 xc0_periodTime[4]; - f32 xd0_onTime[4]; + float xc0_periodTime[4]; + float xd0_onTime[4]; EMotorState xe0_commandArray[4]; bool xf0_24_disabled : 1; }; diff --git a/include/Kyoto/Input/CRumbleVoice.hpp b/include/Kyoto/Input/CRumbleVoice.hpp index b85f99bf..041ff016 100644 --- a/include/Kyoto/Input/CRumbleVoice.hpp +++ b/include/Kyoto/Input/CRumbleVoice.hpp @@ -36,12 +36,12 @@ struct SAdsrData { SAdsrData(float attackGain, float autoReleaseDur, float attackDur, float decayDur, float sustainGain, float releaseDur, bool hasSustain, bool autoRelease); - f32 x0_attackGain; - f32 x4_autoReleaseDur; - f32 x8_attackDur; - f32 xc_decayDur; - f32 x10_sustainGain; - f32 x14_releaseDur; + float x0_attackGain; + float x4_autoReleaseDur; + float x8_attackDur; + float xc_decayDur; + float x10_sustainGain; + float x14_releaseDur; bool x18_24_hasSustain : 1; bool x18_25_autoRelease : 1; }; @@ -61,13 +61,13 @@ struct SAdsrDelta { static SAdsrDelta Stopped(); static SAdsrDelta Start(ERumblePriority priority, bool prePulse); - f32 x0_curIntensity; - f32 x4_attackTime; - f32 x8_decayTime; - f32 xc_releaseTime; - f32 x10_autoReleaseTime; - f32 x14_attackIntensity; - f32 x18_sustainIntensity; + float x0_curIntensity; + float x4_attackTime; + float x8_decayTime; + float xc_releaseTime; + float x10_autoReleaseTime; + float x14_attackIntensity; + float x18_sustainIntensity; ERumblePriority x1c_priority; EPhase x20_phase; }; @@ -76,21 +76,21 @@ class CRumbleVoice { private: rstl::vector< SAdsrData > x0_datas; rstl::vector< SAdsrDelta > x10_deltas; - rstl::reserved_vector< u16, 4 > x20_handleIds; - u16 x2c_usedChannels; - u8 x2e_lastId; + rstl::reserved_vector< ushort, 4 > x20_handleIds; + ushort x2c_usedChannels; + uchar x2e_lastId; CRumbleVoice(); - s16 Activate(const SAdsrData& data, u16 idx, float gain, ERumblePriority prio); - void Deactivate(s16 id, bool b1); + short Activate(const SAdsrData& data, ushort idx, float gain, ERumblePriority prio); + void Deactivate(short id, bool b1); void HardReset(); bool UpdateChannel(SAdsrDelta& delta, const SAdsrData& data, float dt); bool Update(float dt); uint GetFreeChannel() const; float GetIntensity() const; - bool OwnsSustained(s16 id) const; - s16 CreateRumbleHandle(u16 idx); + bool OwnsSustained(short id) const; + short CreateRumbleHandle(ushort idx); }; #endif // _CRUMBLEVOICE diff --git a/include/Kyoto/Math/CAABox.hpp b/include/Kyoto/Math/CAABox.hpp index ac78a2d0..06054206 100644 --- a/include/Kyoto/Math/CAABox.hpp +++ b/include/Kyoto/Math/CAABox.hpp @@ -35,7 +35,7 @@ public: }; CAABox(const CVector3f& min, const CVector3f& max); - CAABox(f32 minX, f32 minY, f32 minZ, f32 maxX, f32 maxY, f32 maxZ) + CAABox(float minX, float minY, float minZ, float maxX, float maxY, float maxZ) : min(minX, minY, minZ), max(maxX, maxY, maxZ) {} CAABox(CInputStream& in); // CAABox(const CAABox& other) @@ -60,7 +60,7 @@ public: bool Invalid() const; bool PointInside(const CVector3f& vec) const; bool DoBoundsOverlap(const CAABox&) const; - f32 GetVolume() const; + float GetVolume() const; CAABox GetBooleanIntersection(const CAABox& other) const; bool Inside(const CAABox& other) const; bool InsidePlane(const CPlane& plane) const; @@ -93,7 +93,7 @@ public: static const CAABox& Identity() { return mskNullBox; } static const CAABox& MakeMaxInvertedBox() { return mskInvertedBox; } // MakeNullBox__6CAABoxFv ?? - static f32 DistanceBetween(const CAABox& a, const CAABox& b); + static float DistanceBetween(const CAABox& a, const CAABox& b); private: CVector3f min; diff --git a/include/Kyoto/Math/CAbsAngle.hpp b/include/Kyoto/Math/CAbsAngle.hpp index f5e10d14..3e386537 100644 --- a/include/Kyoto/Math/CAbsAngle.hpp +++ b/include/Kyoto/Math/CAbsAngle.hpp @@ -7,8 +7,8 @@ class CAbsAngle { public: - f32 AsDegrees() const { return x0_angle * (180.f / M_PIF); } - f32 AsRadians() const { return x0_angle; } + float AsDegrees() const { return x0_angle * (180.f / M_PIF); } + float AsRadians() const { return x0_angle; } // ArcCosine__9CAbsAngleFf weak // -> calls ArcCosineR__5CMathFf @@ -20,11 +20,11 @@ public: x0_angle -= v.x0_angle; return *this; } - CAbsAngle& operator*=(f32 v) { + CAbsAngle& operator*=(float v) { x0_angle *= v; return *this; } - CAbsAngle& operator/=(f32 v) { + CAbsAngle& operator/=(float v) { x0_angle /= v; return *this; } @@ -32,13 +32,13 @@ public: // __apl__9CAbsAngleFRC9CRelAngle // __ami__9CAbsAngleFRC9CRelAngle - static CAbsAngle FromDegrees(f32 deg) { + static CAbsAngle FromDegrees(float deg) { return CAbsAngle(CMath::ClampRadians(deg * (M_PIF / 180.f))); } - static CAbsAngle FromRadians(f32 rad) { return CAbsAngle(CMath::ClampRadians(rad)); } + static CAbsAngle FromRadians(float rad) { return CAbsAngle(CMath::ClampRadians(rad)); } private: - CAbsAngle(f32 rad) : x0_angle(rad) {} + CAbsAngle(float rad) : x0_angle(rad) {} float x0_angle; }; @@ -46,6 +46,6 @@ CHECK_SIZEOF(CAbsAngle, 0x4) // __mi__FRC9CAbsAngleRC9CAbsAngle -static inline f32 cosine(const CAbsAngle& angle) { return cos(angle.AsRadians()); } +static inline float cosine(const CAbsAngle& angle) { return cos(angle.AsRadians()); } #endif // _CABSANGLE diff --git a/include/Kyoto/Math/CFrustumPlanes.hpp b/include/Kyoto/Math/CFrustumPlanes.hpp index 3799724b..244376ee 100644 --- a/include/Kyoto/Math/CFrustumPlanes.hpp +++ b/include/Kyoto/Math/CFrustumPlanes.hpp @@ -13,10 +13,10 @@ class CSphere; class CPlane { private: - f32 x; - f32 y; - f32 z; - f32 d; + float x; + float y; + float z; + float d; }; class CFrustumPlanes { diff --git a/include/Kyoto/Math/CMath.hpp b/include/Kyoto/Math/CMath.hpp index 798a7e6a..8d103011 100644 --- a/include/Kyoto/Math/CMath.hpp +++ b/include/Kyoto/Math/CMath.hpp @@ -10,26 +10,26 @@ class CMath { public: - static f32 FastCosR(f32 v); - static f32 FastSinR(f32 v); - static inline f32 FastFmod(f32 x, f32 y) { + static float FastCosR(float v); + static float FastSinR(float v); + static inline float FastFmod(float x, float y) { int v = static_cast< int >(x * (1.f / y)); return x - v * y; } template < typename T > static const T& Clamp(const T& min, const T& val, const T& max); // TODO: weak - static f32 SqrtF(f32 v); - static inline f32 Limit(f32 v, f32 h) { return fabs(v) > h ? h * Sign(v) : v; } - static inline f32 Sign(f32 v) { return FastFSel(v, 1.f, -1.f); } - static inline f32 FastFSel(register f32 v, register f32 h, register f32 l) { - register f32 out; + static float SqrtF(float v); + static inline float Limit(float v, float h) { return fabs(v) > h ? h * Sign(v) : v; } + static inline float Sign(float v) { return FastFSel(v, 1.f, -1.f); } + static inline float FastFSel(register float v, register float h, register float l) { + register float out; asm { fsel out, v, h, l } return out; } - static inline f32 AbsF(f32 v) { return fabs(v); } - static inline f64 AbsD(f64 v) { return fabs(v); } + static inline float AbsF(float v) { return fabs(v); } + static inline double AbsD(double v) { return fabs(v); } static inline int AbsI(int v) { return abs(v); } // WrapPi__5CMathFf weak // WrapTwoPi__5CMathFf weak @@ -43,17 +43,17 @@ public: // SlowSineR__5CMathFf global // FastCosR__5CMathFf global // GetBezierPoint__5CMathFRC9CVector3fRC9CVector3fRC9CVector3fRC9CVector3ff global - static f32 ClampRadians(f32 rad) { - f32 value = FastFmod(rad, M_2PIF); + static float ClampRadians(float rad) { + float value = FastFmod(rad, M_2PIF); if (value < 0.f) { value += M_2PIF; } return value; } // ModF__5CMathFff weak - static f32 Deg2Rad(f32 deg) { return Deg2Rev(deg) * M_2PIF; } - static f32 Deg2Rev(f32 deg) { return deg * (1.f / 360.f); } - static f32 ArcCosineR(f32 v); + static float Deg2Rad(float deg) { return Deg2Rev(deg) * M_2PIF; } + static float Deg2Rev(float deg) { return deg * (1.f / 360.f); } + static float ArcCosineR(float v); // FloorF__5CMathFf global // BaryToWorld__5CMathFRC9CVector3fRC9CVector3fRC9CVector3fRC9CVector3f global // GetCatmullRomSplinePoint__5CMathFRC9CVector3fRC9CVector3fRC9CVector3fRC9CVector3ff global @@ -66,8 +66,8 @@ public: // Rev2Deg__5CMathFf weak // GetCatmullRomSplinePoint__5CMathFfffff global // SlowTangentR__5CMathFf global - static f32 Rad2Deg(f32 rad) { return rad * (180.f / M_PIF); } - static f32 Rad2Rev(f32 rad) { return rad * (1.f / M_2PIF); } + static float Rad2Deg(float rad) { return rad * (180.f / M_PIF); } + static float Rad2Rev(float rad) { return rad * (1.f / M_2PIF); } // CeilingF__5CMathFf global // ArcTangentR__5CMathFf global // Swap__5CMathFRfRf weak diff --git a/include/Kyoto/Math/CMatrix3f.hpp b/include/Kyoto/Math/CMatrix3f.hpp index 95701972..9269e377 100644 --- a/include/Kyoto/Math/CMatrix3f.hpp +++ b/include/Kyoto/Math/CMatrix3f.hpp @@ -15,7 +15,7 @@ public: static const CMatrix3f& Identity() { return sIdentity; } private: - // TODO maybe individual f32s + // TODO maybe individual floats CVector3f m0; CVector3f m1; CVector3f m2; diff --git a/include/Kyoto/Math/CMatrix4f.hpp b/include/Kyoto/Math/CMatrix4f.hpp index fd57a2e6..337181b2 100644 --- a/include/Kyoto/Math/CMatrix4f.hpp +++ b/include/Kyoto/Math/CMatrix4f.hpp @@ -5,22 +5,22 @@ 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; + float m00; + float m01; + float m02; + float m03; + float m10; + float m11; + float m12; + float m13; + float m20; + float m21; + float m22; + float m23; + float m30; + float m31; + float m32; + float m33; }; CHECK_SIZEOF(CMatrix4f, 0x40); diff --git a/include/Kyoto/Math/CNUQuaternion.hpp b/include/Kyoto/Math/CNUQuaternion.hpp index f9593dfb..71fb02c5 100644 --- a/include/Kyoto/Math/CNUQuaternion.hpp +++ b/include/Kyoto/Math/CNUQuaternion.hpp @@ -6,16 +6,16 @@ class CMatrix3f; class CNUQuaternion { public: - CNUQuaternion(f32 w, f32 x, f32 y, f32 z) : w(w), x(x), y(y), z(z) {} + CNUQuaternion(float w, float x, float y, float z) : w(w), x(x), y(y), z(z) {} static CNUQuaternion BuildFromMatrix3f(const CMatrix3f& matrix); static CNUQuaternion BuildFromQuaternion(const CQuaternion& quat); private: - f32 w; - f32 x; - f32 y; - f32 z; + float w; + float x; + float y; + float z; }; #endif // _CNUQUATERNION diff --git a/include/Kyoto/Math/CPlane.hpp b/include/Kyoto/Math/CPlane.hpp index d4094bbd..58f6f657 100644 --- a/include/Kyoto/Math/CPlane.hpp +++ b/include/Kyoto/Math/CPlane.hpp @@ -14,14 +14,14 @@ public: // TODO const CUnitVector3f& GetNormal() const { return x0_normal; } - f32 GetConstant() const { return xc_constant; } + float GetConstant() const { return xc_constant; } // GetHeight__6CPlaneCFRC9CVector3f // IsFacing__6CPlaneCFRC9CVector3f float ClipLineSegment(const CVector3f& start, const CVector3f& end) const; private: CUnitVector3f x0_normal; - f32 xc_constant; + float xc_constant; }; CHECK_SIZEOF(CPlane, 0x10) diff --git a/include/Kyoto/Math/CQuaternion.hpp b/include/Kyoto/Math/CQuaternion.hpp index 49431e60..6e2a7847 100644 --- a/include/Kyoto/Math/CQuaternion.hpp +++ b/include/Kyoto/Math/CQuaternion.hpp @@ -11,7 +11,7 @@ class CUnitVector3f; class CQuaternion { public: - CQuaternion(f32 w, f32 x, f32 y, f32 z) : w(w), x(x), y(y), z(z) {} + CQuaternion(float w, float x, float y, float z) : w(w), x(x), y(y), z(z) {} // __ct__11CQuaternionFfRC9CVector3f // CQuaternion(const CQuaternion& other) @@ -47,10 +47,10 @@ public: CTransform4f BuildTransform4f() const; CTransform4f BuildTransform4f(const CVector3f&) const; CQuaternion BuildInverted() const { - // f64 w = this->w; - // f64 x = -this->x; - // f64 y = -this->y; - // f64 z = -this->z; + // double w = this->w; + // double x = -this->x; + // double y = -this->y; + // double z = -this->z; return CQuaternion(w, -x, -y, -z); } @@ -61,10 +61,10 @@ public: static const CQuaternion& NoRotation() { return sNoRotation; } private: - f32 w; - f32 x; - f32 y; - f32 z; + float w; + float x; + float y; + float z; static const CQuaternion sNoRotation; }; diff --git a/include/Kyoto/Math/CRelAngle.hpp b/include/Kyoto/Math/CRelAngle.hpp index 19c7e8d4..247a716a 100644 --- a/include/Kyoto/Math/CRelAngle.hpp +++ b/include/Kyoto/Math/CRelAngle.hpp @@ -7,8 +7,8 @@ class CRelAngle { public: - f32 AsDegrees() const { return x0_angle * (180.f / M_PIF); } - f32 AsRadians() const { return x0_angle; } + float AsDegrees() const { return x0_angle * (180.f / M_PIF); } + float AsRadians() const { return x0_angle; } // ArcCosine__9CRelAngleFf weak CRelAngle& operator+=(const CRelAngle& v) { @@ -19,22 +19,22 @@ public: x0_angle -= v.x0_angle; return *this; } - CRelAngle& operator*=(f32 v) { + CRelAngle& operator*=(float v) { x0_angle *= v; return *this; } - CRelAngle& operator/=(f32 v) { + CRelAngle& operator/=(float v) { x0_angle /= v; return *this; } // __lt__9CRelAngleCFRC9CRelAngle - static CRelAngle FromDegrees(f32 deg) { return CRelAngle(deg * (M_PIF / 180.f)); } - static CRelAngle FromRadians(f32 rad) { return CRelAngle(rad); } + static CRelAngle FromDegrees(float deg) { return CRelAngle(deg * (M_PIF / 180.f)); } + static CRelAngle FromRadians(float rad) { return CRelAngle(rad); } private: - CRelAngle(f32 rad) : x0_angle(rad) {} + CRelAngle(float rad) : x0_angle(rad) {} float x0_angle; }; diff --git a/include/Kyoto/Math/CSphere.hpp b/include/Kyoto/Math/CSphere.hpp index 9273241d..579d25c4 100644 --- a/include/Kyoto/Math/CSphere.hpp +++ b/include/Kyoto/Math/CSphere.hpp @@ -8,13 +8,13 @@ class CSphere { public: - CSphere(const CVector3f& pos, f32 radius) : x0_pos(pos), xc_radius(radius) {} + CSphere(const CVector3f& pos, float radius) : x0_pos(pos), xc_radius(radius) {} CUnitVector3f GetSurfaceNormal(const CVector3f& v) const; private: CVector3f x0_pos; - f32 xc_radius; + float xc_radius; }; CHECK_SIZEOF(CSphere, 0x10) diff --git a/include/Kyoto/Math/CTransform4f.hpp b/include/Kyoto/Math/CTransform4f.hpp index 7c599549..76a57594 100644 --- a/include/Kyoto/Math/CTransform4f.hpp +++ b/include/Kyoto/Math/CTransform4f.hpp @@ -5,7 +5,7 @@ #include "Kyoto/Math/CVector3f.hpp" -typedef const f32 (*ConstMtxPtr)[4]; +typedef const float (*ConstMtxPtr)[4]; class CInputStream; class CMatrix3f; @@ -18,7 +18,7 @@ public: // } CTransform4f(const CVector3f& m0, const CVector3f& m1, const CVector3f& m2, const CVector3f& pos) : m0(m0), posX(pos.GetX()), m1(m1), posY(pos.GetY()), m2(m2), posZ(pos.GetZ()) {} - CTransform4f(f32, f32, f32, f32, f32, f32, f32, f32, f32, f32, f32, f32); + CTransform4f(float, float, float, float, float, float, float, float, float, float, float, float); CTransform4f(CInputStream& in); CTransform4f(const CMatrix3f& rotation, const CVector3f& translation); CTransform4f(const CTransform4f& other); @@ -31,18 +31,18 @@ public: ConstMtxPtr GetCStyleMatrix() const { return reinterpret_cast< ConstMtxPtr >(this); } CMatrix3f BuildMatrix3f() const; - f32 Get00() const { return m0.GetX(); } - f32 Get01() const { return m0.GetY(); } - f32 Get02() const { return m0.GetZ(); } - f32 Get03() const { return posX; } - f32 Get10() const { return m1.GetX(); } - f32 Get11() const { return m1.GetY(); } - f32 Get12() const { return m1.GetZ(); } - f32 Get13() const { return posY; } - f32 Get20() const { return m2.GetX(); } - f32 Get21() const { return m2.GetY(); } - f32 Get22() const { return m2.GetZ(); } - f32 Get23() const { return posZ; } + float Get00() const { return m0.GetX(); } + float Get01() const { return m0.GetY(); } + float Get02() const { return m0.GetZ(); } + float Get03() const { return posX; } + float Get10() const { return m1.GetX(); } + float Get11() const { return m1.GetY(); } + float Get12() const { return m1.GetZ(); } + float Get13() const { return posY; } + float Get20() const { return m2.GetX(); } + float Get21() const { return m2.GetY(); } + float Get22() const { return m2.GetZ(); } + float Get23() const { return posZ; } CVector3f GetColumn(EDimX dim) const { return CVector3f(m0[dim], m1[dim], m2[dim]); } CVector3f GetColumn(EDimY dim) const { return CVector3f(m0[dim], m1[dim], m2[dim]); } CVector3f GetColumn(EDimZ dim) const { return CVector3f(m0[dim], m1[dim], m2[dim]); } @@ -87,7 +87,7 @@ public: posY += vec.GetY(); posZ += vec.GetZ(); } - void AddTranslationZ(f32 z) { posZ += z; } + void AddTranslationZ(float z) { posZ += z; } CTransform4f& operator*=(const CTransform4f& other); CTransform4f operator*(const CTransform4f& vec) const; @@ -95,18 +95,18 @@ public: static CTransform4f FromColumns(const CVector3f&, const CVector3f&, const CVector3f&, const CVector3f&); - static CTransform4f Translate(f32 x, f32 y, f32 z); + static CTransform4f Translate(float x, float y, float z); static CTransform4f Translate(const CVector3f& vec); static const CTransform4f& Identity() { return sIdentity; } private: CVector3f m0; - f32 posX; + float posX; CVector3f m1; - f32 posY; + float posY; CVector3f m2; - f32 posZ; + float posZ; static CTransform4f sIdentity; }; diff --git a/include/Kyoto/Math/CUnitVector3f.hpp b/include/Kyoto/Math/CUnitVector3f.hpp index 014c4d57..8785b188 100644 --- a/include/Kyoto/Math/CUnitVector3f.hpp +++ b/include/Kyoto/Math/CUnitVector3f.hpp @@ -7,7 +7,7 @@ class CUnitVector3f : public CVector3f { public: - CUnitVector3f(f32 x, f32 y, f32 z) : CVector3f(x, y, z) { Normalize(); } + CUnitVector3f(float x, float y, float z) : CVector3f(x, y, z) { Normalize(); } CUnitVector3f(const CVector3f& vec); // : CVector3f(vec) { Normalize(); } // TODO }; diff --git a/include/Kyoto/Math/CVector2f.hpp b/include/Kyoto/Math/CVector2f.hpp index 062d8486..96db5b31 100644 --- a/include/Kyoto/Math/CVector2f.hpp +++ b/include/Kyoto/Math/CVector2f.hpp @@ -7,9 +7,9 @@ class CVector2f { static const CVector2f skZeroVector; public: - CVector2f(f32 x, f32 y); - f32 GetX() const { return mX; } - f32 GetY() const { return mY; } + CVector2f(float x, float y); + float GetX() const { return mX; } + float GetY() const { return mY; } CVector2f& operator+=(const CVector2f& rhs); CVector2f& operator-=(const CVector2f& rhs); @@ -18,16 +18,16 @@ public: CVector2f& Normalize(); - f32 Magnitude() const; - f32 MagSquared() const; + float Magnitude() const; + float MagSquared() const; CVector2f AsNormalized() const; static float GetAngleDiff(const CVector2f& a, const CVector2f& b); static float Dot(const CVector2f& a, const CVector2f& b); private: - f32 mX; - f32 mY; + float mX; + float mY; }; CVector2f operator+(const CVector2f& lhs, const CVector2f& rhs); diff --git a/include/Kyoto/Math/CVector3f.hpp b/include/Kyoto/Math/CVector3f.hpp index bc94c211..ad0d6394 100644 --- a/include/Kyoto/Math/CVector3f.hpp +++ b/include/Kyoto/Math/CVector3f.hpp @@ -17,30 +17,30 @@ enum EDimZ { kDZ }; class CVector3f { public: - 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) {} + explicit CVector3f(float x, float y, float z) : mX(x), mY(y), mZ(z) {} + CVector3f(const CVector2f& v, float 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; } + float GetX() const { return mX; } + float GetY() const { return mY; } + float GetZ() const { return mZ; } - void SetX(f32 x) { mX = x; } - void SetY(f32 y) { mY = y; } - void SetZ(f32 z) { mZ = z; } + void SetX(float x) { mX = x; } + void SetY(float y) { mY = y; } + void SetZ(float z) { mZ = z; } // ByElementMultiply__9CVector3fFRC9CVector3fRC9CVector3f static CVector3f Slerp(const CVector3f& a, const CVector3f& b, const CRelAngle& angle); CVector3f& Normalize(); - f32 Magnitude() const; + float Magnitude() const; CVector3f AsNormalized() const; bool IsNotInf() const; bool IsMagnitudeSafe() const; bool CanBeNormalized() const; static float GetAngleDiff(const CVector3f& a, const CVector3f& b); - bool IsEqu(const CVector3f& other, f32 epsilon = FLT_EPSILON) const; + bool IsEqu(const CVector3f& other, float epsilon = FLT_EPSILON) const; // Lerp__9CVector3fFRC9CVector3fRC9CVector3ff inline float MagSquared() const { return GetX() * GetX() + GetY() * GetY() + GetZ() * GetZ(); } static CVector3f Cross(const CVector3f& lhs, const CVector3f& rhs) { @@ -50,15 +50,15 @@ public: return CVector3f(x, y, z); } - f32& operator[](EDimX dim) { return mX; } - f32& operator[](EDimY dim) { return mY; } - f32& operator[](EDimZ dim) { return mZ; } - const f32& operator[](EDimX) const { return mX; } - const f32& operator[](EDimY) const { return mY; } - const f32& operator[](EDimZ) const { return mZ; } + float& operator[](EDimX dim) { return mX; } + float& operator[](EDimY dim) { return mY; } + float& operator[](EDimZ dim) { return mZ; } + const float& operator[](EDimX) const { return mX; } + const float& operator[](EDimY) const { return mY; } + const float& operator[](EDimZ) const { return mZ; } - f32& operator[](int i) { return (&mX)[i]; } - f32 operator[](int i) const { return (&mX)[i]; } + float& operator[](int i) { return (&mX)[i]; } + float operator[](int i) const { return (&mX)[i]; } bool IsNonZero() const { return mX != 0.f || mY != 0.f || mZ != 0.f; } CVector3f DropZ() const { return CVector3f(mX, mY, 0.f); } @@ -75,20 +75,20 @@ public: mZ -= other.mZ; return *this; } - CVector3f& operator*=(f32 v) { + CVector3f& operator*=(float v) { mX *= v; mY *= v; mZ *= v; return *this; } - CVector3f& operator/=(f32 v) { + CVector3f& operator/=(float v) { mX /= v; mY /= v; mZ /= v; return *this; } - static f32 Dot(const CVector3f& a, const CVector3f& b) { + static float Dot(const CVector3f& a, const CVector3f& b) { return (a.GetX() * b.GetX()) + (a.GetY() * b.GetY()) + (a.GetZ() * b.GetZ()); } @@ -101,9 +101,9 @@ public: static const CVector3f& Back() { return sBackVector; } protected: - f32 mX; - f32 mY; - f32 mZ; + float mX; + float mY; + float mZ; static CVector3f sZeroVector; static int sUnkData[18]; @@ -127,35 +127,35 @@ 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) { - f32 x = lhs.GetX() - rhs.GetX(); - f32 y = lhs.GetY() - rhs.GetY(); - f32 z = lhs.GetZ() - rhs.GetZ(); + float x = lhs.GetX() - rhs.GetX(); + float y = lhs.GetY() - rhs.GetY(); + float z = lhs.GetZ() - rhs.GetZ(); return CVector3f(x, y, z); } inline CVector3f operator+(const CVector3f& lhs, const CVector3f& rhs) { - f32 x = lhs.GetX() + rhs.GetX(); - f32 y = lhs.GetY() + rhs.GetY(); - f32 z = lhs.GetZ() + rhs.GetZ(); + float x = lhs.GetX() + rhs.GetX(); + float y = lhs.GetY() + rhs.GetY(); + float z = lhs.GetZ() + rhs.GetZ(); return CVector3f(x, y, z); } -inline CVector3f operator*(const CVector3f& vec, f32 f) { - f32 x = vec.GetX() * f; - f32 y = vec.GetY() * f; - f32 z = vec.GetZ() * f; +inline CVector3f operator*(const CVector3f& vec, float f) { + float x = vec.GetX() * f; + float y = vec.GetY() * f; + float z = vec.GetZ() * f; return CVector3f(x, y, z); } -inline CVector3f operator*(f32 f, const CVector3f& vec) { - f32 x = f * vec.GetX(); - f32 y = f * vec.GetY(); - f32 z = f * vec.GetZ(); +inline CVector3f operator*(float f, const CVector3f& vec) { + float x = f * vec.GetX(); + float y = f * vec.GetY(); + float z = f * vec.GetZ(); return CVector3f(x, y, z); } -inline CVector3f operator/(const CVector3f& vec, f32 f) { - f32 x = vec.GetX() / f; - f32 y = vec.GetY() / f; - f32 z = vec.GetZ() / f; +inline CVector3f operator/(const CVector3f& vec, float f) { + float x = vec.GetX() / f; + float y = vec.GetY() / f; + float z = vec.GetZ() / f; return CVector3f(x, y, z); } inline CVector3f operator-(const CVector3f& vec) { diff --git a/include/Kyoto/Particles/CElementGen.hpp b/include/Kyoto/Particles/CElementGen.hpp index f85bb0a7..155166e7 100644 --- a/include/Kyoto/Particles/CElementGen.hpp +++ b/include/Kyoto/Particles/CElementGen.hpp @@ -49,7 +49,7 @@ public: static void ShutDown(); private: - u8 x4_pad[0x33C]; + uchar x4_pad[0x33C]; }; CHECK_SIZEOF(CElementGen, 0x340) diff --git a/include/Kyoto/Streams/CInputStream.hpp b/include/Kyoto/Streams/CInputStream.hpp index d5637d9c..67f3b5d0 100644 --- a/include/Kyoto/Streams/CInputStream.hpp +++ b/include/Kyoto/Streams/CInputStream.hpp @@ -16,12 +16,12 @@ public: virtual ~CInputStream(); virtual uint Read(void* dest, uint len) = 0; - f32 ReadFloat(); + float ReadFloat(); u64 ReadLongLong(); uint ReadLong(); - u16 ReadShort(); + ushort ReadShort(); bool ReadBool(); - u8 ReadChar(); + uchar ReadChar(); uint ReadBits(uint len); uint ReadBytes(void* dest, unsigned long len); void Get(void* dest, unsigned long len); @@ -40,7 +40,7 @@ private: uint x4_blockOffset; uint x8_blockLen; uint xc_len; - u8* x10_ptr; + uchar* x10_ptr; bool x14_owned; uint x18_readPosition; uint x1c_bitWord; diff --git a/include/Kyoto/Streams/CZipInputStream.hpp b/include/Kyoto/Streams/CZipInputStream.hpp index 4092aefb..1e3b03bf 100644 --- a/include/Kyoto/Streams/CZipInputStream.hpp +++ b/include/Kyoto/Streams/CZipInputStream.hpp @@ -14,7 +14,7 @@ public: uint Read(void* dest, uint len) override; private: - u8* x24_compBuf; + uchar* x24_compBuf; rstl::auto_ptr< CInputStream > x28_stream; unkptr x30_zstream; }; diff --git a/include/Kyoto/TOneStatic.hpp b/include/Kyoto/TOneStatic.hpp index 1803cdf2..4a403104 100644 --- a/include/Kyoto/TOneStatic.hpp +++ b/include/Kyoto/TOneStatic.hpp @@ -15,7 +15,7 @@ public: private: static void* GetAllocSpace() { - static u8 sAllocSpace[sizeof(T)]; + static uchar sAllocSpace[sizeof(T)]; return &sAllocSpace; } static uint& ReferenceCount() { diff --git a/include/Kyoto/Text/CStringTable.hpp b/include/Kyoto/Text/CStringTable.hpp index 5453b61d..730ebb39 100644 --- a/include/Kyoto/Text/CStringTable.hpp +++ b/include/Kyoto/Text/CStringTable.hpp @@ -9,7 +9,7 @@ class CStringTable { int x0_stringCount; - rstl::single_ptr< u8 > x4_data; + rstl::single_ptr< uchar > x4_data; public: CStringTable(CInputStream& in); diff --git a/include/MetaRender/CCubeRenderer.hpp b/include/MetaRender/CCubeRenderer.hpp index a3af46cd..d9a47721 100644 --- a/include/MetaRender/CCubeRenderer.hpp +++ b/include/MetaRender/CCubeRenderer.hpp @@ -43,7 +43,8 @@ public: virtual void SetWorldViewpoint(); virtual void SetPerspective1(); virtual void SetPerspective2(); - virtual rstl::pair< CVector2f, CVector2f > SetViewportOrtho(bool centered, f32 znear, f32 zfar); + virtual rstl::pair< CVector2f, CVector2f > SetViewportOrtho(bool centered, float znear, + float zfar); virtual void SetClippingPlanes(); virtual void SetViewport(); virtual void SetDepthReadWrite(bool read, bool update); @@ -65,7 +66,7 @@ public: virtual void BeginTriangleFan(int nverts); virtual void PrimVertex(const CVector3f& vtx); virtual void PrimNormal(const CVector3f& nrm); - virtual void PrimColor(f32 r, f32 g, f32 b, f32 a); + virtual void PrimColor(float r, float g, float b, float a); virtual void PrimColor(const CColor& color); virtual void EndPrimitive(); virtual void SetAmbientColor(const CColor& color); diff --git a/include/MetroidPrime/CActor.hpp b/include/MetroidPrime/CActor.hpp index 2301d39c..85719087 100644 --- a/include/MetroidPrime/CActor.hpp +++ b/include/MetroidPrime/CActor.hpp @@ -241,14 +241,14 @@ public: CAdvancementDeltas UpdateAnimation(float dt, CStateManager& mgr, bool advTree); - void ProcessSoundEvent(int sfxId, f32 weight, int flags, f32 fallOff, f32 maxDist, u8 minVol, - u8 maxVol, const CVector3f& toListener, const CVector3f& position, int aid, - CStateManager& mgr, bool translateId); + void ProcessSoundEvent(int sfxId, float weight, int flags, float fallOff, float maxDist, + uchar minVol, uchar maxVol, const CVector3f& toListener, + const CVector3f& position, int aid, CStateManager& mgr, bool translateId); void UpdateSfxEmitters(); void RemoveEmitter(); void SetModelData(const CModelData& modelData); - f32 GetAverageAnimVelocity(int anim); + float GetAverageAnimVelocity(int anim); void EnsureRendered(const CStateManager& mgr) const; void EnsureRendered(const CStateManager& mgr, const CVector3f& pos, const CAABox& bounds) const; void DrawTouchBounds() const; @@ -359,14 +359,14 @@ protected: rstl::single_ptr< TCachedToken< CScannableObjectInfo > > x98_scanObjectInfo; CAABox x9c_renderBounds; CModelFlags xb4_drawFlags; - f32 xbc_time; + float xbc_time; uint xc0_pitchBend; TUniqueId xc4_fluidId; TUniqueId xc6_nextDrawNode; int xc8_drawnToken; int xcc_addedToken; - f32 xd0_damageMag; - u8 xd4_maxVol; + float xd0_damageMag; + uchar xd4_maxVol; rstl::reserved_vector< CSfxHandle, 2 > xd8_nonLoopingSfxHandles; uint xe4_24_nextNonLoopingSfxHandle : 3; uint xe4_27_notInSortedLists : 1; diff --git a/include/MetroidPrime/CActorLights.hpp b/include/MetroidPrime/CActorLights.hpp index c6aa5668..19c7c5f1 100644 --- a/include/MetroidPrime/CActorLights.hpp +++ b/include/MetroidPrime/CActorLights.hpp @@ -29,7 +29,7 @@ public: bool GetNeedsRelight() const { return x298_24_dirty == TRUE; } bool HasShadowLight() const { return x29c_shadowLightArrIdx != -1; } - s32 GetShadowLightIndex() const { return x2a0_shadowLightIdx; } + int GetShadowLightIndex() const { return x2a0_shadowLightIdx; } void SetFindShadowLight(bool v) { x298_27_findShadowLight = v; } void SetShadowDynamicRangeThreshold(float t) { x2d0_shadowDynamicRangeThreshold = t; } @@ -59,9 +59,9 @@ private: int x2b8_maxAreaLights; int x2bc_maxDynamicLights; CVector3f x2c0_lastActorPos; - f32 x2cc_actorPositionDeltaUpdateThreshold; - f32 x2d0_shadowDynamicRangeThreshold; - f32 x2d4_worldLightingLevel; + float x2cc_actorPositionDeltaUpdateThreshold; + float x2d0_shadowDynamicRangeThreshold; + float x2d4_worldLightingLevel; int x2d8_brightLightIdx; uint x2dc_brightLightLag; }; diff --git a/include/MetroidPrime/CActorParameters.hpp b/include/MetroidPrime/CActorParameters.hpp index f51fde73..676fa990 100644 --- a/include/MetroidPrime/CActorParameters.hpp +++ b/include/MetroidPrime/CActorParameters.hpp @@ -47,10 +47,10 @@ public: private: bool x4_castShadow; - f32 x8_shadowScale; + float x8_shadowScale; EShadowTesselation xc_shadowTesselation; - f32 x10_shadowAlpha; - f32 x14_maxShadowHeight; + float x10_shadowAlpha; + float x14_maxShadowHeight; CColor x18_noLightsAmbient; bool x1c_makeLights; bool x1d_ambientChannelOverflow; @@ -80,10 +80,10 @@ public: CVisorParameters() { // TODO } - CVisorParameters(u8 mask, bool b1, bool scanPassthrough) + CVisorParameters(uchar mask, bool b1, bool scanPassthrough) : x0_mask(mask), x0_4_b1(b1), x0_5_scanPassthrough(scanPassthrough) {} - u8 GetMask() const { return x0_mask; } + uchar GetMask() const { return x0_mask; } // TODO: GetIsBlockXRay__16CVisorParametersCFv? bool GetBool1() const { return x0_4_b1; } bool GetScanPassthrough() const { return x0_5_scanPassthrough; } @@ -108,13 +108,13 @@ public: 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; } + float 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; } - f32 GetFadeInTime() const { return x5c_fadeInTime; } - f32 GetFadeOutTime() const { return x60_fadeOutTime; } + float GetFadeInTime() const { return x5c_fadeInTime; } + float GetFadeOutTime() const { return x60_fadeOutTime; } static CActorParameters None(); @@ -128,9 +128,9 @@ private: bool x58_25_thermalHeat : 1; bool x58_26_renderUnsorted : 1; bool x58_27_noSortThermal : 1; - f32 x5c_fadeInTime; - f32 x60_fadeOutTime; - f32 x64_thermalMag; + float x5c_fadeInTime; + float x60_fadeOutTime; + float x64_thermalMag; }; CHECK_SIZEOF(CActorParameters, 0x68) diff --git a/include/MetroidPrime/CAdditiveAnimPlayback.hpp b/include/MetroidPrime/CAdditiveAnimPlayback.hpp index db0f4dc5..444e5c6c 100644 --- a/include/MetroidPrime/CAdditiveAnimPlayback.hpp +++ b/include/MetroidPrime/CAdditiveAnimPlayback.hpp @@ -9,8 +9,8 @@ class CAnimTreeNode; class CAdditiveAnimationInfo { private: - f32 x0_fadeInDur; - f32 x4_fadeOutDur; + float x0_fadeInDur; + float x4_fadeOutDur; }; class CAdditiveAnimPlayback { @@ -26,10 +26,10 @@ public: private: CAdditiveAnimationInfo x0_info; rstl::ncrc_ptr< CAnimTreeNode > x8_anim; - f32 xc_targetWeight; - f32 x10_curWeight; + float xc_targetWeight; + float x10_curWeight; bool x14_active; - f32 x18_weightTimer; + float x18_weightTimer; EPlaybackPhase x1c_phase; bool x20_needsFadeOut; }; diff --git a/include/MetroidPrime/CAnimData.hpp b/include/MetroidPrime/CAnimData.hpp index 4f009540..a71dda0e 100644 --- a/include/MetroidPrime/CAnimData.hpp +++ b/include/MetroidPrime/CAnimData.hpp @@ -43,7 +43,7 @@ public: } int GetCharacterIndex() const { return x204_charIdx; } - f32 GetAverageVelocity(int idx) const; + float GetAverageVelocity(int idx) const; const CBoolPOINode* GetBoolPOIList(int& count) const { count = x20c_passedBoolCount; @@ -121,7 +121,7 @@ public: // GetAnimationManager__9CAnimDataFv // SetPoseValid__9CAnimDataFb - s16 GetDefaultAnimation() const { return x208_defaultAnim; } + short GetDefaultAnimation() const { return x208_defaultAnim; } const CCharacterInfo& GetCharacterInfo() const { return xc_charInfo; } // GetCharLayoutInfo__9CAnimDataCFv // GetDeltaRotation__9CAnimDataCFv @@ -182,23 +182,23 @@ private: CQuaternion x1e8_alignRot; rstl::rc_ptr< CAnimTreeNode > x1f8_animRoot; rstl::rc_ptr< CTransitionManager > x1fc_transMgr; - f32 x200_speedScale; + float x200_speedScale; int x204_charIdx; - s16 x208_defaultAnim; - s16 x20a_padding; + short x208_defaultAnim; + short x20a_padding; int x20c_passedBoolCount; int x210_passedIntCount; int x214_passedParticleCount; int x218_passedSoundCount; int x21c_particleLightIdx; - u8 x220_24_animating : 1; - u8 x220_25_loop : 1; - u8 x220_26_aligningPos : 1; - u8 x220_27_ : 1; - u8 x220_28_ : 1; - u8 x220_29_animationJustStarted : 1; - u8 x220_30_poseBuilt : 1; - u8 x220_31_poseCached : 1; + uchar x220_24_animating : 1; + uchar x220_25_loop : 1; + uchar x220_26_aligningPos : 1; + uchar x220_27_ : 1; + uchar x220_28_ : 1; + uchar x220_29_animationJustStarted : 1; + uchar x220_30_poseBuilt : 1; + uchar x220_31_poseCached : 1; CPoseAsTransforms x224_pose; CHierarchyPoseBuilder x2fc_poseBuilder; CAnimPlaybackParms x40c_playbackParms; diff --git a/include/MetroidPrime/CAnimPlaybackParms.hpp b/include/MetroidPrime/CAnimPlaybackParms.hpp index 0d4d9555..94cbbe02 100644 --- a/include/MetroidPrime/CAnimPlaybackParms.hpp +++ b/include/MetroidPrime/CAnimPlaybackParms.hpp @@ -11,7 +11,7 @@ class CAnimPlaybackParms { private: int x0_animA; int x4_animB; - f32 x8_blendWeight; + float x8_blendWeight; bool xc_animating; int x10_; CVector3f* x14_targetPos; diff --git a/include/MetroidPrime/CAreaFog.hpp b/include/MetroidPrime/CAreaFog.hpp index 85907950..6c1dbb23 100644 --- a/include/MetroidPrime/CAreaFog.hpp +++ b/include/MetroidPrime/CAreaFog.hpp @@ -22,7 +22,7 @@ private: CColor x28_colorTarget; unkptr x2c_; unkptr x30_; - f32 x34_colorDelta; + float x34_colorDelta; }; CHECK_SIZEOF(CAreaFog, 0x38) diff --git a/include/MetroidPrime/CAxisAngle.hpp b/include/MetroidPrime/CAxisAngle.hpp index 42dd0e2c..e8078ce7 100644 --- a/include/MetroidPrime/CAxisAngle.hpp +++ b/include/MetroidPrime/CAxisAngle.hpp @@ -18,7 +18,7 @@ public: CAxisAngle() : mVector(CVector3f::Zero()) {} explicit CAxisAngle(const CVector3f& vec); explicit CAxisAngle(const CUnitVector3f& vec, float); - CAxisAngle(f32 x, f32 y, f32 z) : mVector(x, y, z) {} + CAxisAngle(float x, float y, float z) : mVector(x, y, z) {} void FromVector(const CVector3f& angle); static const CAxisAngle& Identity(); diff --git a/include/MetroidPrime/CCharAnimTime.hpp b/include/MetroidPrime/CCharAnimTime.hpp index 1326edb8..ce1c8df8 100644 --- a/include/MetroidPrime/CCharAnimTime.hpp +++ b/include/MetroidPrime/CCharAnimTime.hpp @@ -14,7 +14,7 @@ public: }; private: - f32 x0_time; + float x0_time; EType x4_type; }; CHECK_SIZEOF(CCharAnimTime, 0x8) diff --git a/include/MetroidPrime/CCharacterInfo.hpp b/include/MetroidPrime/CCharacterInfo.hpp index 67a47c13..0be0ce62 100644 --- a/include/MetroidPrime/CCharacterInfo.hpp +++ b/include/MetroidPrime/CCharacterInfo.hpp @@ -26,7 +26,7 @@ public: const CPASDatabase& GetPASDatabase() const { return x30_pasDatabase; } private: - u16 x0_tableCount; + ushort x0_tableCount; rstl::string x4_name; CAssetId x14_cmdl; CAssetId x18_cksr; diff --git a/include/MetroidPrime/CConsoleOutputWindow.hpp b/include/MetroidPrime/CConsoleOutputWindow.hpp index 87f9d044..73d6b2c5 100644 --- a/include/MetroidPrime/CConsoleOutputWindow.hpp +++ b/include/MetroidPrime/CConsoleOutputWindow.hpp @@ -7,7 +7,7 @@ class CConsoleOutputWindow : public CIOWin { public: - CConsoleOutputWindow(int, f32, f32); + CConsoleOutputWindow(int, float, float); ~CConsoleOutputWindow() override; EMessageReturn OnMessage(const CArchitectureMessage&, CArchitectureQueue&) override; diff --git a/include/MetroidPrime/CEffectComponent.hpp b/include/MetroidPrime/CEffectComponent.hpp index e9a6fc51..9fa072dd 100644 --- a/include/MetroidPrime/CEffectComponent.hpp +++ b/include/MetroidPrime/CEffectComponent.hpp @@ -10,7 +10,7 @@ private: rstl::string x0_name; SObjectTag x10_tag; rstl::string x18_boneName; - f32 x28_scale; + float x28_scale; CParticleData::EParentedMode x2c_parentedMode; uint x30_flags; }; diff --git a/include/MetroidPrime/CEntity.hpp b/include/MetroidPrime/CEntity.hpp index 37fa9266..d8481c03 100644 --- a/include/MetroidPrime/CEntity.hpp +++ b/include/MetroidPrime/CEntity.hpp @@ -15,8 +15,8 @@ class CEntity { public: virtual ~CEntity(); virtual void Accept(IVisitor& visitor) = 0; - virtual void PreThink(f32 dt, CStateManager& mgr); - virtual void Think(f32 dt, CStateManager& mgr); + virtual void PreThink(float dt, CStateManager& mgr); + virtual void Think(float dt, CStateManager& mgr); virtual void AcceptScriptMsg(EScriptObjectMessage msg, TUniqueId uid, CStateManager& mgr); virtual void SetActive(bool active); diff --git a/include/MetroidPrime/CEnvFxManager.hpp b/include/MetroidPrime/CEnvFxManager.hpp index 2d449bcb..7fc37787 100644 --- a/include/MetroidPrime/CEnvFxManager.hpp +++ b/include/MetroidPrime/CEnvFxManager.hpp @@ -20,38 +20,38 @@ class CTexture; class CVectorFixed8_8 { private: - s16 x; - s16 y; - s16 z; + short x; + short y; + short 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 */ + CVector2i x4_position; /* 8.8 fixed point */ + CVector2i xc_extent; /* 8.8 fixed point */ + rstl::pair< bool, float > x14_block; /* Blocked-bool, Z-coordinate */ rstl::vector< CVectorFixed8_8 > x1c_particles; }; class CEnvFxManager { public: static void Initialize(); - void SetFxDensity(s32, float); + void SetFxDensity(int, float); private: CAABox x0_particleBounds; CVector3f x18_focusCellPosition; bool x24_enableSplash; - f32 x28_firstSnowForce; + float x28_firstSnowForce; int x2c_lastBlockedGridIdx; - f32 x30_fxDensity; - f32 x34_targetFxDensity; - f32 x38_maxDensityDeltaSpeed; + float x30_fxDensity; + float x34_targetFxDensity; + float x38_maxDensityDeltaSpeed; bool x3c_snowflakeTextureMipBlanked; TLockedToken< CTexture > x40_txtrEnvGradient; rstl::reserved_vector< CEnvFxManagerGrid, 64 > x50_grids; - f32 xb54_baseSplashRate; + float xb54_baseSplashRate; TLockedToken< CGenDescription > xb58_envRainSplash; bool xb64_; TUniqueId xb68_envRainSplashId; diff --git a/include/MetroidPrime/CExplosion.hpp b/include/MetroidPrime/CExplosion.hpp index 241f3a86..3e9eb7da 100644 --- a/include/MetroidPrime/CExplosion.hpp +++ b/include/MetroidPrime/CExplosion.hpp @@ -20,7 +20,7 @@ public: // CEntity ~CExplosion(); void Accept(IVisitor& visitor) override; - void Think(f32 dt, CStateManager& mgr) override; + void Think(float dt, CStateManager& mgr) override; void AcceptScriptMsg(EScriptObjectMessage msg, TUniqueId uid, CStateManager& mgr) override; // CActor diff --git a/include/MetroidPrime/CFluidPlaneManager.hpp b/include/MetroidPrime/CFluidPlaneManager.hpp index f520346e..10e77485 100644 --- a/include/MetroidPrime/CFluidPlaneManager.hpp +++ b/include/MetroidPrime/CFluidPlaneManager.hpp @@ -11,7 +11,7 @@ class CFluidPlaneManager { private: class CSplashRecord { - f32 x0_time; + float x0_time; TUniqueId x4_id; }; diff --git a/include/MetroidPrime/CGameArchitectureSupport.hpp b/include/MetroidPrime/CGameArchitectureSupport.hpp index 0c05cdc1..5dfe2701 100644 --- a/include/MetroidPrime/CGameArchitectureSupport.hpp +++ b/include/MetroidPrime/CGameArchitectureSupport.hpp @@ -42,9 +42,9 @@ private: CGuiSys x44_guiSys; CIOWinManager x58_ioWinMgr; int x78_gameFrameCount; - f32 x7c_; - f32 x80_; - f32 x84_; + float x7c_; + float x80_; + float x84_; uint x88_; rstl::vector< CToken > x90_; OSAlarm xa0_infiniteLoopAlarm; diff --git a/include/MetroidPrime/CGameArea.hpp b/include/MetroidPrime/CGameArea.hpp index 81d19c57..37ed8b3c 100644 --- a/include/MetroidPrime/CGameArea.hpp +++ b/include/MetroidPrime/CGameArea.hpp @@ -25,7 +25,7 @@ public: virtual bool IIsActive() const = 0; virtual CAssetId IGetAreaAssetId() const = 0; virtual int IGetAreaSaveId() const = 0; - virtual rstl::pair< rstl::auto_ptr< u8 >, int > IGetScriptingMemoryAlways() const = 0; + virtual rstl::pair< rstl::auto_ptr< uchar >, int > IGetScriptingMemoryAlways() const = 0; }; class Dock; @@ -42,7 +42,7 @@ public: bool IIsActive() const override; CAssetId IGetAreaAssetId() const override; int IGetAreaSaveId() const override; - rstl::pair< rstl::auto_ptr< u8 >, int > IGetScriptingMemoryAlways() const override; + rstl::pair< rstl::auto_ptr< uchar >, int > IGetScriptingMemoryAlways() const override; bool IsLoaded() const { return xf0_24_postConstructed; } bool IsActive() const { return xf0_25_active; } @@ -62,7 +62,7 @@ private: CAABox x6c_aabb; CAssetId x84_mrea; int x88_areaId; - rstl::vector< u16 > x8c_attachedAreaIndices; + rstl::vector< ushort > x8c_attachedAreaIndices; rstl::vector< SObjectTag > x9c_deps1; rstl::vector< SObjectTag > xac_deps2; rstl::vector< uint > xbc_layerDepOffsets; diff --git a/include/MetroidPrime/CGameCollision.hpp b/include/MetroidPrime/CGameCollision.hpp index 4a87af2b..e07ce566 100644 --- a/include/MetroidPrime/CGameCollision.hpp +++ b/include/MetroidPrime/CGameCollision.hpp @@ -24,7 +24,7 @@ public: static bool DetectCollision_Cached_Moving(const CStateManager&, CAreaCollisionCache&, const CCollisionPrimitive&, const CTransform4f&, const CMaterialFilter&, const TEntityList&, CVector3f, - TUniqueId&, CCollisionInfo&, f64&); + TUniqueId&, CCollisionInfo&, double&); }; #endif // _CGAMECOLLISION diff --git a/include/MetroidPrime/CHealthInfo.hpp b/include/MetroidPrime/CHealthInfo.hpp index 258e33f2..721f5a3d 100644 --- a/include/MetroidPrime/CHealthInfo.hpp +++ b/include/MetroidPrime/CHealthInfo.hpp @@ -5,14 +5,14 @@ class CHealthInfo { public: - CHealthInfo(f32 hp, f32 resist) : x0_health(hp), x4_knockbackResistance(resist) {} + CHealthInfo(float hp, float resist) : x0_health(hp), x4_knockbackResistance(resist) {} void SetHP(float hp) { x0_health = hp; } void SetKnockbackResistance(float resist) { x4_knockbackResistance = resist; } float GetHP() const { return x0_health; } private: - f32 x0_health; - f32 x4_knockbackResistance; + float x0_health; + float x4_knockbackResistance; }; CHECK_SIZEOF(CHealthInfo, 0x8) diff --git a/include/MetroidPrime/CHierarchyPoseBuilder.hpp b/include/MetroidPrime/CHierarchyPoseBuilder.hpp index 603c8ef9..1d0ac5e3 100644 --- a/include/MetroidPrime/CHierarchyPoseBuilder.hpp +++ b/include/MetroidPrime/CHierarchyPoseBuilder.hpp @@ -32,7 +32,7 @@ public: class CScaledLayoutDescription { private: TCachedToken< CCharLayoutInfo > x0_layoutToken; - f32 xc_scale; + float xc_scale; rstl::optional_object< CVector3f > x10_scaleVec; }; diff --git a/include/MetroidPrime/CInGameTweakManager.hpp b/include/MetroidPrime/CInGameTweakManager.hpp index cc6e1f83..b62e959c 100644 --- a/include/MetroidPrime/CInGameTweakManager.hpp +++ b/include/MetroidPrime/CInGameTweakManager.hpp @@ -10,24 +10,24 @@ class CTweakValue { public: struct Audio { public: - Audio(f32 fadeIn, f32 fadeOut, f32 vol, const rstl::string& fileName, u32 handle) + Audio(float fadeIn, float fadeOut, float vol, const rstl::string& fileName, uint handle) : x0_fadeIn(fadeIn) , x4_fadeOut(fadeOut) , x8_volume(vol) , xc_fileName(fileName) , x1c_res(handle) {} - f32 GetFadeIn() const { return x0_fadeIn; } - f32 GetFadeOut() const { return x4_fadeOut; } - f32 GetVolume() const { return x8_volume; } + float GetFadeIn() const { return x0_fadeIn; } + float GetFadeOut() const { return x4_fadeOut; } + float GetVolume() const { return x8_volume; } const rstl::string& GetFileName() const { return xc_fileName; } CAssetId GetResId() const { return x1c_res; } // static Audio None() { return Audio(0.f, 0.f, 0.f, "", 0); } private: - f32 x0_fadeIn; - f32 x4_fadeOut; - f32 x8_volume; + float x0_fadeIn; + float x4_fadeOut; + float x8_volume; rstl::string xc_fileName; CAssetId x1c_res; }; @@ -49,8 +49,8 @@ private: rstl::string x14_str; Audio x24_audio; union { - u32 x44_int; - f32 x44_flt; + uint x44_int; + float x44_flt; }; }; diff --git a/include/MetroidPrime/CInputGenerator.hpp b/include/MetroidPrime/CInputGenerator.hpp index 830575cb..b6d81eb8 100644 --- a/include/MetroidPrime/CInputGenerator.hpp +++ b/include/MetroidPrime/CInputGenerator.hpp @@ -12,7 +12,7 @@ class IController; class CInputGenerator { public: - CInputGenerator(COsContext*, f32, f32); + CInputGenerator(COsContext*, float, float); IController* GetController() const { return x4_controller.get(); } @@ -20,8 +20,8 @@ private: COsContext* x0_context; rstl::single_ptr< IController > x4_controller; bool x8_connectedControllers[4]; - f32 xc_leftDiv; - f32 x10_rightDiv; + float xc_leftDiv; + float x10_rightDiv; }; CHECK_SIZEOF(CInputGenerator, 0x14) diff --git a/include/MetroidPrime/CMain.hpp b/include/MetroidPrime/CMain.hpp index 3ec0156f..898a89df 100644 --- a/include/MetroidPrime/CMain.hpp +++ b/include/MetroidPrime/CMain.hpp @@ -99,14 +99,14 @@ private: CMemorySys x6d_memorySys; CDvdRequestSys x6e_dvdRequestSys; CTweaks x70_tweaks; - u8 pad[0x14]; - f64 xe8_; - TReservedAverage< f32, 4 > xf0_; - TReservedAverage< f32, 4 > x104_; - f32 x118_; - f32 x11c_; - f32 x120_; - f32 x124_; + uchar pad[0x14]; + double xe8_; + TReservedAverage< float, 4 > xf0_; + TReservedAverage< float, 4 > x104_; + float x118_; + float x11c_; + float x120_; + float x124_; CGameGlobalObjects* x128_gameGlobalObjects; ERestartMode x12c_restartMode; rstl::reserved_vector< uint, 10 > x130_frameTimes; diff --git a/include/MetroidPrime/CMemoryCard.hpp b/include/MetroidPrime/CMemoryCard.hpp index 6d82ed5a..71cb2a8b 100644 --- a/include/MetroidPrime/CMemoryCard.hpp +++ b/include/MetroidPrime/CMemoryCard.hpp @@ -17,13 +17,13 @@ public: ~CMemoryCard(); // TODO - rstl::pair< CAssetId, TAreaId > GetAreaAndWorldIdForSaveId(s32 saveId) const; + rstl::pair< CAssetId, TAreaId > GetAreaAndWorldIdForSaveId(int saveId) const; typedef rstl::pair< CAssetId, CWorldSaveGameInfo::EScanCategory > ScanState; const rstl::vector< ScanState >& GetScanStates() const { return x20_scanStates; } private: - u8 x0_pad[0x20]; + uchar x0_pad[0x20]; rstl::vector< ScanState > x20_scanStates; }; diff --git a/include/MetroidPrime/CObjectList.hpp b/include/MetroidPrime/CObjectList.hpp index 91c495e1..63ee7572 100644 --- a/include/MetroidPrime/CObjectList.hpp +++ b/include/MetroidPrime/CObjectList.hpp @@ -23,8 +23,8 @@ class CEntity; class CObjectList { struct SObjectListEntry { CEntity* mEnt; - s16 mNext; - s16 mPrev; + short mNext; + short mPrev; SObjectListEntry(); }; @@ -56,8 +56,8 @@ public: private: SObjectListEntry mObjects[1024]; EGameObjectList mListType; - s16 mFirstId; - s16 mCount; + short mFirstId; + short mCount; }; CHECK_SIZEOF(CObjectList, 0x200c) diff --git a/include/MetroidPrime/CPOINode.hpp b/include/MetroidPrime/CPOINode.hpp index 65e3f3c6..11b4470b 100644 --- a/include/MetroidPrime/CPOINode.hpp +++ b/include/MetroidPrime/CPOINode.hpp @@ -26,18 +26,18 @@ public: const rstl::string& GetString() const { return x8_name; } EPOIType GetPoiType() const { return static_cast< EPOIType >(x18_type); } const CCharAnimTime& GetTime() const { return x1c_time; } - f32 GetWeight() const { return x2c_weight; } + float GetWeight() const { return x2c_weight; } int GetCharacterIndex() const { return x30_charIdx; } int GetFlags() const { return x34_flags; } protected: - u16 x4_; + ushort x4_; rstl::string x8_name; - u16 x18_type; + ushort x18_type; CCharAnimTime x1c_time; int x24_index; bool x28_unique; - f32 x2c_weight; + float x2c_weight; int x30_charIdx; int x34_flags; }; @@ -76,13 +76,13 @@ private: class CSoundPOINode : public CPOINode { public: uint GetSoundId() const { return x38_sfxId; } - f32 GetFallOff() const { return x3c_falloff; } - f32 GetMaxDistance() const { return x40_maxDist; } + float GetFallOff() const { return x3c_falloff; } + float GetMaxDistance() const { return x40_maxDist; } private: uint x38_sfxId; - f32 x3c_falloff; - f32 x40_maxDist; + float x3c_falloff; + float x40_maxDist; }; #endif // _CPOINODE diff --git a/include/MetroidPrime/CParticleData.hpp b/include/MetroidPrime/CParticleData.hpp index f6a8add6..0060108a 100644 --- a/include/MetroidPrime/CParticleData.hpp +++ b/include/MetroidPrime/CParticleData.hpp @@ -20,7 +20,7 @@ private: uint x0_duration; SObjectTag x4_particle; rstl::string xc_boneName; - f32 x1c_scale; + float x1c_scale; EParentedMode x20_parentMode; }; @@ -29,7 +29,7 @@ private: uint x0_duration; SObjectTag x4_particle; CVector3f xc_translation; - f32 x18_scale; + float x18_scale; }; #endif // _CPARTICLEDATA diff --git a/include/MetroidPrime/CPhysicsActor.hpp b/include/MetroidPrime/CPhysicsActor.hpp index 1db6de47..396872d1 100644 --- a/include/MetroidPrime/CPhysicsActor.hpp +++ b/include/MetroidPrime/CPhysicsActor.hpp @@ -21,9 +21,9 @@ struct SMoverData { CAxisAngle xc_angularVelocity; CVector3f x18_momentum; CAxisAngle x24_; - f32 x30_mass; + float x30_mass; - SMoverData(f32 mass, const CVector3f& velocity, const CAxisAngle& angularVelocity, + SMoverData(float mass, const CVector3f& velocity, const CAxisAngle& angularVelocity, const CVector3f& momentum, const CAxisAngle& unk) : x0_velocity(velocity) , xc_angularVelocity(angularVelocity) @@ -58,22 +58,22 @@ public: CPhysicsActor(TUniqueId uid, bool active, const rstl::string& name, const CEntityInfo& info, const CTransform4f& xf, const CModelData& mData, const CMaterialList& matList, const CAABox& aabb, const SMoverData& moverData, const CActorParameters& actParams, - f32 stepUp, f32 stepDown); + float stepUp, float stepDown); // CActor ~CPhysicsActor() override; void Render(const CStateManager&) const override; CVector3f GetOrbitPosition(const CStateManager& mgr) const override; - CVector3f GetAimPosition(const CStateManager& mgr, f32 val) const override; + CVector3f GetAimPosition(const CStateManager& mgr, float val) const override; // CPhysicsActor virtual const CCollisionPrimitive* GetCollisionPrimitive() const; virtual CTransform4f GetPrimitiveTransform() const; virtual void CollidedWith(const TUniqueId& id, const CCollisionInfoList& list, CStateManager& mgr); - virtual f32 GetStepDownHeight() const; - virtual f32 GetStepUpHeight() const; - virtual f32 GetWeight() const; + virtual float GetStepDownHeight() const; + virtual float GetStepUpHeight() const; + virtual float GetWeight() const; float GetMass() const { return xe8_mass; } void SetMass(float mass); @@ -145,10 +145,10 @@ public: static float GetGravityConstant() { return skGravityConstant; } private: - f32 xe8_mass; - f32 xec_massRecip; - f32 xf0_inertiaTensor; - f32 xf4_inertiaTensorRecip; + float xe8_mass; + float xec_massRecip; + float xf0_inertiaTensor; + float xf4_inertiaTensorRecip; bool xf8_24_movable : 1; bool xf8_25_angularEnabled : 1; bool xf9_standardCollider; @@ -169,11 +169,11 @@ private: CVector3f x1e8_primitiveOffset; CMotionState x1f4_lastNonCollidingState; rstl::optional_object< CVector3f > x228_lastFloorPlaneNormal; - f32 x238_maximumCollisionVelocity; - f32 x23c_stepUpHeight; - f32 x240_stepDownHeight; - f32 x244_restitutionCoefModifier; - f32 x248_collisionAccuracyModifier; + float x238_maximumCollisionVelocity; + float x23c_stepUpHeight; + float x240_stepDownHeight; + float x244_restitutionCoefModifier; + float x248_collisionAccuracyModifier; uint x24c_numTicksStuck; uint x250_numTicksPartialUpdate; uint x254_; diff --git a/include/MetroidPrime/CRainSplashGenerator.hpp b/include/MetroidPrime/CRainSplashGenerator.hpp index 5fba09b3..31540af1 100644 --- a/include/MetroidPrime/CRainSplashGenerator.hpp +++ b/include/MetroidPrime/CRainSplashGenerator.hpp @@ -14,8 +14,8 @@ class CRainSplashGenerator { float x8_yEnd; float xc_speed; float x10_zParabolaHeight; - u8 x14_; - u8 x15_length; + uchar x14_; + uchar x15_length; bool x16_active : 1; SSplashLine(); void Update(float dt, CStateManager& mgr); @@ -43,7 +43,7 @@ private: rstl::vector< SRainSplash > x0_rainSplashes; CRandom16 x10_random; CVector3f x14_scale; - u8 x0_pad[0x2c]; + uchar x0_pad[0x2c]; }; CHECK_SIZEOF(CRainSplashGenerator, 0x4c) diff --git a/include/MetroidPrime/CRippleManager.hpp b/include/MetroidPrime/CRippleManager.hpp index 845678fa..aa50d4b2 100644 --- a/include/MetroidPrime/CRippleManager.hpp +++ b/include/MetroidPrime/CRippleManager.hpp @@ -9,9 +9,9 @@ class CRipple; class CRippleManager { private: - f32 x0_maxTimeFalloff; + float x0_maxTimeFalloff; rstl::vector< CRipple > x4_ripples; - f32 x14_alpha; + float x14_alpha; }; #endif // _CRIPPLEMANAGER diff --git a/include/MetroidPrime/CSortedLists.hpp b/include/MetroidPrime/CSortedLists.hpp index 26e5d041..7a02c580 100644 --- a/include/MetroidPrime/CSortedLists.hpp +++ b/include/MetroidPrime/CSortedLists.hpp @@ -13,14 +13,14 @@ namespace SL { struct SNode { CActor* x0_actor; CAABox x4_box; - s16 x1c_selfIdxs[6]; - s16 x28_next; + short x1c_selfIdxs[6]; + short x28_next; bool x2a_populated; }; CHECK_SIZEOF(SNode, 0x2c); struct SSortedList { - s16 x0_ids[kMaxObjects]; + short x0_ids[kMaxObjects]; uint x800_size; }; CHECK_SIZEOF(SSortedList, 0x804); diff --git a/include/MetroidPrime/CStateManager.hpp b/include/MetroidPrime/CStateManager.hpp index 7788fb16..9ea2d1f8 100644 --- a/include/MetroidPrime/CStateManager.hpp +++ b/include/MetroidPrime/CStateManager.hpp @@ -114,7 +114,7 @@ public: bool RayCollideWorld(const CVector3f& start, const CVector3f& end, const TEntityList& nearList, const CMaterialFilter& filter, const CActor* damagee) const; CRayCastResult RayWorldIntersection(TUniqueId& idOut, const CVector3f& pos, const CVector3f& dir, - f32 length, const CMaterialFilter& filter, + float length, const CMaterialFilter& filter, const TEntityList& list) const; void BuildColliderList(TEntityList& out, const CActor& actor, const CAABox& aabb) const; @@ -159,8 +159,8 @@ public: return xb84_camFilterPasses[size_t(stage)]; } - f32 GetThermalColdScale1() const { return xf24_thermColdScale1; } - f32 GetThermalColdScale2() const { return xf28_thermColdScale2; } + float GetThermalColdScale1() const { return xf24_thermColdScale1; } + float GetThermalColdScale2() const { return xf28_thermColdScale2; } bool IsGeneratingObject() const { return xf94_26_generatingObject; } void SetIsGeneratingObject(bool gen) { xf94_26_generatingObject = gen; } @@ -190,7 +190,7 @@ public: return xf90_deferredTransition == kSMT_MessageScreen; } - void SetEnergyBarActorInfo(TUniqueId bossId, float maxEnergy, u32 stringIdx); + void SetEnergyBarActorInfo(TUniqueId bossId, float maxEnergy, uint stringIdx); void SetPendingOnScreenTex(CAssetId texId, const CVector2i& origin, const CVector2i& extent); /* { xef4_pendingScreenTex.x0_id = texId; xef4_pendingScreenTex.x4_origin = origin; @@ -205,11 +205,11 @@ public: void SetInSaveUI(bool b) { xf94_28_inSaveUI = b; } bool GetInSaveUI() const { return xf94_28_inSaveUI; } void SetIsFullThreat(bool v) { xf94_30_fullThreat = v; } - u32 GetInputFrameIdx() const { return x8d4_inputFrameIdx; } + uint GetInputFrameIdx() const { return x8d4_inputFrameIdx; } private: - u16 x0_nextFreeIndex; - rstl::reserved_vector< u16, 1024 > x8_objectIndexArray; + ushort x0_nextFreeIndex; + rstl::reserved_vector< ushort, 1024 > x8_objectIndexArray; rstl::reserved_vector< rstl::auto_ptr< CObjectList >, 8 > x808_objectLists; CPlayer* x84c_player; rstl::single_ptr< CWorld > x850_world; @@ -226,7 +226,7 @@ private: // TODO // rstl::multimap< TEditorId, TUniqueId > x890_scriptIdMap; // rstl::map< TEditorId, SScriptObjectStream > x8a4_loadedScriptObjects; - u8 pad[0x28]; + uchar pad[0x28]; rstl::rc_ptr< CPlayerState > x8b8_playerState; rstl::rc_ptr< CScriptMailbox > x8bc_mailbox; rstl::rc_ptr< CMapWorldInfo > x8c0_mapWorldInfo; @@ -235,9 +235,9 @@ private: TAreaId x8cc_nextAreaId; TAreaId x8d0_prevAreaId; - u32 x8d4_inputFrameIdx; - u32 x8d8_updateFrameIdx; - u32 x8dc_objectDrawToken; + uint x8d4_inputFrameIdx; + uint x8d8_updateFrameIdx; + uint x8dc_objectDrawToken; rstl::vector< CLight > x8e0_dynamicLights; @@ -245,7 +245,7 @@ private: CRandom16 x8fc_random; CRandom16* x900_random; - u8 x904_pad[0x280]; + uchar x904_pad[0x280]; rstl::reserved_vector< CCameraFilterPass, kCFS_Max > xb84_camFilterPasses; rstl::reserved_vector< CCameraBlurPass, kCFS_Max > xd14_camBlurPasses; @@ -253,14 +253,14 @@ private: uint xef0_hintPeriods; SOnScreenTex xef4_pendingScreenTex; CAssetId xf08_pauseHudMessage; - f32 xf0c_escapeTimer; - f32 xf10_escapeTotalTime; - f32 xf14_curTimeMod900; + float xf0c_escapeTimer; + float xf10_escapeTotalTime; + float xf14_curTimeMod900; TUniqueId xf18_bossId; - f32 xf1c_totalBossEnergy; + float xf1c_totalBossEnergy; uint xf20_bossStringIdx; - f32 xf24_thermColdScale1; - f32 xf28_thermColdScale2; + float xf24_thermColdScale1; + float xf28_thermColdScale2; CVector2f xf2c_viewportScale; EThermalDrawFlag xf34_thermalFlag; TUniqueId xf38_skipCineSpecialFunc; @@ -270,12 +270,12 @@ private: rstl::single_ptr< CMazeState > xf70_currentMaze; TUniqueId xf74_lastTrigger; TUniqueId xf76_lastRelay; - f32 xf78_hudMessageTime; + float xf78_hudMessageTime; unkptr xf7c_projectedShadow; uint xf80_hudMessageFrameCount; CAssetId xf84_; CAssetId xf88_; - f32 xf8c_; + float xf8c_; EStateManagerTransition xf90_deferredTransition; bool xf94_24_readyToRender : 1; bool xf94_25_quitGame : 1; diff --git a/include/MetroidPrime/CWorld.hpp b/include/MetroidPrime/CWorld.hpp index a438aa9f..c72872cf 100644 --- a/include/MetroidPrime/CWorld.hpp +++ b/include/MetroidPrime/CWorld.hpp @@ -62,7 +62,7 @@ public: const CGameArea* GetArea(TAreaId id) const { return x18_areas[id.Value()].get(); } bool IsAreaValid(TAreaId id) const { return x18_areas[id.Value()]->IsLoaded(); } CAssetId GetWorldAssetId() const { return x8_mlvlId; } - TAreaId GetAreaIdForSaveId(s32 saveId) const; + TAreaId GetAreaIdForSaveId(int saveId) const; private: enum Phase { @@ -83,7 +83,7 @@ private: CMapWorld* x28_mapWorld; rstl::vector< CRelay > x2c_relays; rstl::rc_ptr< IDvdRequest > x3c_loadToken; - rstl::single_ptr< u8 > x40_loadBuf; + rstl::single_ptr< uchar > x40_loadBuf; uint x44_bufSz; uint x48_chainCount; CGameArea* x4c_chainHeads[5]; diff --git a/include/MetroidPrime/CWorldShadow.hpp b/include/MetroidPrime/CWorldShadow.hpp index 01862a66..3bbe5f52 100644 --- a/include/MetroidPrime/CWorldShadow.hpp +++ b/include/MetroidPrime/CWorldShadow.hpp @@ -18,7 +18,7 @@ class CWorldShadow { CVector3f x68_objPos; CVector3f x74_lightPos; TAreaId x80_aid; - s32 x84_lightIdx; + int x84_lightIdx; bool x88_blurReset; public: diff --git a/include/MetroidPrime/Cameras/CBallCamera.hpp b/include/MetroidPrime/Cameras/CBallCamera.hpp index bdaef058..a9f48f4b 100644 --- a/include/MetroidPrime/Cameras/CBallCamera.hpp +++ b/include/MetroidPrime/Cameras/CBallCamera.hpp @@ -10,23 +10,23 @@ class CCameraSpring { public: - CCameraSpring(f32 k, f32 max, f32 tardis) + CCameraSpring(float k, float max, float tardis) : x0_k(k), x4_k2Sqrt(CMath::SqrtF(k) * 2.f), x8_max(max), xc_tardis(tardis), x10_dx(0.f) {} void Reset(); - f32 ApplyDistanceSpringNoMax(f32 targetX, f32 curX, f32 dt); - f32 ApplyDistanceSpring(f32 targetX, f32 curX, f32 dt); + float ApplyDistanceSpringNoMax(float targetX, float curX, float dt); + float ApplyDistanceSpring(float targetX, float curX, float dt); private: - f32 x0_k; - f32 x4_k2Sqrt; - f32 x8_max; - f32 xc_tardis; - f32 x10_dx; + float x0_k; + float x4_k2Sqrt; + float x8_max; + float xc_tardis; + float x10_dx; }; class CCameraCollider { public: - CCameraCollider(f32 radius, CVector3f vec, const CCameraSpring& spring, f32 scale) + CCameraCollider(float radius, CVector3f vec, const CCameraSpring& spring, float scale) : x4_radius(radius) , x8_lastLocalPos(vec) , x14_localPos(vec) @@ -37,7 +37,7 @@ public: , x50_scale(scale) {} virtual ~CCameraCollider() {} - f32 GetRadius() const { return x4_radius; } + float GetRadius() const { return x4_radius; } // TODO const CVector3f& GetRealPosition() const { return x2c_lastWorldPos; } const CVector3f& GetDesiredPosition() const { return x14_localPos; } @@ -45,9 +45,9 @@ public: const CVector3f& GetLineOfSight() const; const CVector3f& GetPosition() const { return x8_lastLocalPos; } int GetOcclusionCount() const { return x4c_occlusionCount; } - f32 GetScale() const { return x50_scale; } + float GetScale() const { return x50_scale; } - void SetRadius(f32 radius) { this->x4_radius = radius; } + void SetRadius(float radius) { this->x4_radius = radius; } // TODO void SetPosition(CVector3f vec) { x8_lastLocalPos = vec; } void SetRealPosition(CVector3f vec) { x2c_lastWorldPos = vec; } @@ -55,17 +55,17 @@ public: void SetLookAtPosition(CVector3f vec) { x20_scaledWorldPos = vec; } void SetLineOfSight(); void SetOcclusionCount(int val) { x4c_occlusionCount = val; } - void SetScale(f32 val) { x50_scale = val; } + void SetScale(float val) { x50_scale = val; } private: - f32 x4_radius; + float x4_radius; CVector3f x8_lastLocalPos; // position CVector3f x14_localPos; // desired position CVector3f x20_scaledWorldPos; // look at position CVector3f x2c_lastWorldPos; // real position CCameraSpring x38_spring; int x4c_occlusionCount; - f32 x50_scale; + float x50_scale; }; class CBallCamera : public CGameCamera { @@ -95,13 +95,13 @@ public: kBSS_Arc, }; - CBallCamera(TUniqueId uid, TUniqueId watchedId, const CTransform4f& xf, f32 fovY, f32 nearZ, - f32 farZ, f32 aspect); + CBallCamera(TUniqueId uid, TUniqueId watchedId, const CTransform4f& xf, float fovY, float nearZ, + float farZ, float aspect); // CEntity ~CBallCamera() override; void Accept(IVisitor& visitor) override; - void Think(f32 dt, CStateManager& mgr) override; + void Think(float dt, CStateManager& mgr) override; void AcceptScriptMsg(EScriptObjectMessage msg, TUniqueId uid, CStateManager& mgr) override; // CActor @@ -112,19 +112,19 @@ public: void Reset(const CTransform4f&, CStateManager& mgr) override; // CBallCamera - void SetupColliders(rstl::vector< CCameraCollider >& out, f32 xMag, f32 zMag, f32 radius, - int count, f32 k, f32 max, f32 startAngle); + void SetupColliders(rstl::vector< CCameraCollider >& out, float xMag, float zMag, float radius, + int count, float k, float max, float startAngle); void TeleportColliders(rstl::vector< CCameraCollider >& colliderList, CVector3f pos); void TeleportCamera(const CVector3f& pos, CStateManager& mgr); void TeleportCamera(const CTransform4f& xf, CStateManager& mgr); void ResetPosition(CStateManager& mgr); void ResetToTweaks(CStateManager& mgr); - CVector3f FindDesiredPosition(f32 distance, f32 elevation, CVector3f dir, CStateManager& mgr, + CVector3f FindDesiredPosition(float distance, float elevation, CVector3f dir, CStateManager& mgr, bool fullTest); - void UpdateCollidersDistances(rstl::vector< CCameraCollider >& colliderList, f32 xMag, f32 zMag, - f32 angOffset); + void UpdateCollidersDistances(rstl::vector< CCameraCollider >& colliderList, float xMag, + float zMag, float angOffset); void UpdateColliders(const CTransform4f& xf, rstl::vector< CCameraCollider >& colliderList, - int& idx, int count, float tolerance, const TEntityList& nearList, f32 dt, + int& idx, int count, float tolerance, const TEntityList& nearList, float dt, CStateManager& mgr); CVector3f CalculateCollidersCentroid(const rstl::vector< CCameraCollider >& colliderList, int numObscured) const; @@ -132,30 +132,30 @@ public: int CountObscuredColliders(const rstl::vector< CCameraCollider >& colliderList) const; CAABox CalculateCollidersBoundingBox(const rstl::vector< CCameraCollider >& colliderList, const CStateManager&) const; - CVector3f AvoidGeometryFull(const CTransform4f& xf, const TEntityList& nearList, f32 dt, + CVector3f AvoidGeometryFull(const CTransform4f& xf, const TEntityList& nearList, float dt, CStateManager& mgr); - CVector3f AvoidGeometry(const CTransform4f& xf, const TEntityList& nearList, f32 dt, + CVector3f AvoidGeometry(const CTransform4f& xf, const TEntityList& nearList, float dt, CStateManager& mgr); - bool DetectCollision(const CVector3f& from, const CVector3f& to, f32 radius, f32& d, + bool DetectCollision(const CVector3f& from, const CVector3f& to, float radius, float& d, CStateManager& mgr); const CVector3f& GetLookAtPosition() const { return x1d8_lookPos; } - f32 GetDistance() const { return x190_curMinDistance; } - f32 GetElevation() const { return x1a0_elevation; } + float GetDistance() const { return x190_curMinDistance; } + float GetElevation() const { return x1a0_elevation; } void SetBehaviourType(EBallCameraBehaviour type) { x188_behaviour = type; } void SetAllowChaseCamera(bool v) { x18c_25_chaseAllowed = v; } void SetAllowBoostCamera(bool v) { x18c_26_boostAllowed = v; } // void SetLineOfSightCheck(bool v); void SetGeometryAvoidance(bool v) { x18c_27_obscureAvoidance = true; } - void SetMinDistance(f32 v) { x194_targetMinDistance = v; } - void SetMaxDistance(f32 v) { x198_maxDistance = v; } - void SetBackwardsDistance(f32 v) { x19c_backwardsDistance = v; } + void SetMinDistance(float v) { x194_targetMinDistance = v; } + void SetMaxDistance(float v) { x198_maxDistance = v; } + void SetBackwardsDistance(float v) { x19c_backwardsDistance = v; } void SetDistanceSpring(const CCameraSpring& spring) { x214_ballCameraSpring = spring; } void SetCentroidDistanceSpring(const CCameraSpring& spring) { x250_ballCameraCentroidDistanceSpring = spring; } - void SetElevation(f32 v) { x1a0_elevation = v; } + void SetElevation(float v) { x1a0_elevation = v; } void SetLookAtOffset(CVector3f vec) { x1b4_lookAtOffset = vec; } void SetChaseLookAtOffset(CVector3f vec) { x410_chaseLookAtOffset = vec; } void SetWorldOffset(CVector3f vec); // TODO @@ -198,15 +198,15 @@ private: bool x18e_26_ : 1; bool x18e_27_nearbyDoorClosed : 1; bool x18e_28_nearbyDoorClosing : 1; - f32 x190_curMinDistance; - f32 x194_targetMinDistance; - f32 x198_maxDistance; - f32 x19c_backwardsDistance; - f32 x1a0_elevation; - f32 x1a4_curAnglePerSecond; - f32 x1a8_targetAnglePerSecond; - f32 x1ac_attitudeRange; - f32 x1b0_azimuthRange; + float x190_curMinDistance; + float x194_targetMinDistance; + float x198_maxDistance; + float x19c_backwardsDistance; + float x1a0_elevation; + float x1a4_curAnglePerSecond; + float x1a8_targetAnglePerSecond; + float x1ac_attitudeRange; + float x1b0_azimuthRange; CVector3f x1b4_lookAtOffset; CVector3f x1c0_lookPosAhead; CVector3f x1cc_fixedLookPos; @@ -230,57 +230,57 @@ private: int x2d4_mediumColliderIt; int x2d8_largeColliderIt; CVector3f x2dc_prevBallPos; - f32 x2e8_ballVelFlat; - f32 x2ec_maxBallVel; + float x2e8_ballVelFlat; + float x2ec_maxBallVel; CVector3f x2f0_ballDelta; CVector3f x2fc_ballDeltaFlat; - f32 x308_speedFactor; - f32 x30c_speedingTime; + float x308_speedFactor; + float x30c_speedingTime; CVector3f x310_idealLookVec; CVector3f x31c_predictedLookPos; int x328_avoidGeomCycle; - f32 x32c_colliderMag; - f32 x330_clearColliderThreshold; + float x32c_colliderMag; + float x330_clearColliderThreshold; CAABox x334_collidersAABB; - f32 x34c_obscuredTime; + float x34c_obscuredTime; CMaterialList x350_obscuringMaterial; - f32 x358_unobscureMag; + float x358_unobscureMag; CVector3f x35c_splineIntermediatePos; TUniqueId x368_obscuringObjectId; ESplineState x36c_splineState; bool x370_24_reevalSplineEnd : 1; - f32 x374_splineCtrl; - f32 x378_splineCtrlRange; + float x374_splineCtrl; + float x378_splineCtrlRange; CCameraSpline x37c_camSpline; CMaterialList x3c8_collisionExcludeList; bool x3d0_24_camBehindFloorOrWall : 1; - f32 x3d4_elevInterpTimer; - f32 x3d8_elevInterpStart; + float x3d4_elevInterpTimer; + float x3d8_elevInterpStart; TUniqueId x3dc_tooCloseActorId; - f32 x3e0_tooCloseActorDist; + float x3e0_tooCloseActorDist; bool x3e4_pendingFailsafe; - f32 x3e8_; - f32 x3ec_; - f32 x3f0_; - f32 x3f4_; - f32 x3f8_; - f32 x3fc_; + float x3e8_; + float x3ec_; + float x3f0_; + float x3f4_; + float x3f8_; + float x3fc_; EBallCameraState x400_state; - f32 x404_chaseElevation; - f32 x408_chaseDistance; - f32 x40c_chaseAnglePerSecond; + float x404_chaseElevation; + float x408_chaseDistance; + float x40c_chaseAnglePerSecond; CVector3f x410_chaseLookAtOffset; CCameraSpring x41c_ballCameraChaseSpring; - f32 x430_boostElevation; - f32 x434_boostDistance; - f32 x438_boostAnglePerSecond; + float x430_boostElevation; + float x434_boostDistance; + float x438_boostAnglePerSecond; CVector3f x43c_boostLookAtOffset; CCameraSpring x448_ballCameraBoostSpring; CVector3f x45c_overrideBallToCam; - f32 x468_conservativeDoorCamDistance; + float x468_conservativeDoorCamDistance; TUniqueId x46c_collisionActorId; - f32 x470_clampVelTimer; - f32 x474_clampVelRange; + float x470_clampVelTimer; + float x474_clampVelRange; uint x478_shortMoveCount; rstl::single_ptr< SFailsafeState > x47c_failsafeState; rstl::single_ptr< SUnknown > x480_; diff --git a/include/MetroidPrime/Cameras/CCameraBlurPass.hpp b/include/MetroidPrime/Cameras/CCameraBlurPass.hpp index 81739b14..f70104df 100644 --- a/include/MetroidPrime/Cameras/CCameraBlurPass.hpp +++ b/include/MetroidPrime/Cameras/CCameraBlurPass.hpp @@ -22,7 +22,7 @@ public: kBT_XRay, }; - static void DrawWideScreen(const CColor& color, const CTexture* tex, f32 v); + static void DrawWideScreen(const CColor& color, const CTexture* tex, float v); private: rstl::optional_object< TLockedToken< CTexture > > x0_paletteTex; diff --git a/include/MetroidPrime/Cameras/CCameraFilterPass.hpp b/include/MetroidPrime/Cameras/CCameraFilterPass.hpp index c0195dc2..9a79e0c4 100644 --- a/include/MetroidPrime/Cameras/CCameraFilterPass.hpp +++ b/include/MetroidPrime/Cameras/CCameraFilterPass.hpp @@ -42,7 +42,7 @@ public: CAssetId txtr); void DisableFilter(float time); - static void DrawWideScreen(const CColor& color, const CTexture* tex, f32 v); + static void DrawWideScreen(const CColor& color, const CTexture* tex, float v); private: EFilterType x0_curType; diff --git a/include/MetroidPrime/Cameras/CCameraManager.hpp b/include/MetroidPrime/Cameras/CCameraManager.hpp index c1b27d92..a404b628 100644 --- a/include/MetroidPrime/Cameras/CCameraManager.hpp +++ b/include/MetroidPrime/Cameras/CCameraManager.hpp @@ -30,7 +30,7 @@ public: void SetFogDensity(float fogDensityTarget, float fogDensitySpeed); bool IsInCinematicCamera() const; - static f32 DefaultThirdPersonFov(); + static float DefaultThirdPersonFov(); private: TUniqueId x0_curCameraId; @@ -45,11 +45,11 @@ private: CBallCamera* x80_ballCamera; int x84_rumbleId; CInterpolationCamera* x88_interpCamera; - s16 x8c_; - f32 x90_rumbleCooldown; - f32 x94_fogDensityFactor; - f32 x98_fogDensitySpeed; - f32 x9c_fogDensityFactorTarget; + short x8c_; + float x90_rumbleCooldown; + float x94_fogDensityFactor; + float x98_fogDensitySpeed; + float x9c_fogDensityFactorTarget; bool xa0_24_pendingRumble : 1; bool xa0_25_rumbling : 1; bool xa0_26_inWater : 1; @@ -62,7 +62,7 @@ private: rstl::reserved_vector< TUniqueId, 64 > x334_activeCameraHints; bool x3b8_24_ : 1; bool x3b8_25_ : 1; - f32 x3bc_curFov; + float x3bc_curFov; }; CHECK_SIZEOF(CCameraManager, 0x3c0) diff --git a/include/MetroidPrime/Cameras/CCameraShakeData.hpp b/include/MetroidPrime/Cameras/CCameraShakeData.hpp index f42fccaa..a4bef5e4 100644 --- a/include/MetroidPrime/Cameras/CCameraShakeData.hpp +++ b/include/MetroidPrime/Cameras/CCameraShakeData.hpp @@ -7,11 +7,11 @@ struct SCameraShakePoint { bool x0_useEnvelope; - f32 x4_value; - f32 x8_magnitude; - f32 xc_attackTime; - f32 x10_sustainTime; - f32 x14_duration; + float x4_value; + float x8_magnitude; + float xc_attackTime; + float x10_sustainTime; + float x14_duration; }; CHECK_SIZEOF(SCameraShakePoint, 0x18) @@ -23,21 +23,21 @@ private: bool x4_useModulation; SCameraShakePoint x8_am; SCameraShakePoint x20_fm; - f32 x38_value; + float x38_value; }; CHECK_SIZEOF(CCameraShakerComponent, 0x3c) class CCameraShakeData { private: - f32 x0_duration; - f32 x4_curTime; + float x0_duration; + float x4_curTime; CCameraShakerComponent x8_shakerX; CCameraShakerComponent x44_shakerY; CCameraShakerComponent x80_shakerZ; uint xbc_shakerId; uint xc0_flags; CVector3f xc4_sfxPos; - f32 xd0_sfxDist; + float xd0_sfxDist; }; CHECK_SIZEOF(CCameraShakeData, 0xd4) diff --git a/include/MetroidPrime/Cameras/CCameraSpline.hpp b/include/MetroidPrime/Cameras/CCameraSpline.hpp index 643f08f7..058c5957 100644 --- a/include/MetroidPrime/Cameras/CCameraSpline.hpp +++ b/include/MetroidPrime/Cameras/CCameraSpline.hpp @@ -19,9 +19,9 @@ public: private: rstl::vector< CVector3f > x4_positions; rstl::vector< TUniqueId > x14_wpTracker; - rstl::vector< f32 > x24_t; + rstl::vector< float > x24_t; rstl::vector< CVector3f > x34_directions; - f32 x44_length; + float x44_length; bool x48_closedLoop; }; CHECK_SIZEOF(CCameraSpline, 0x4c) diff --git a/include/MetroidPrime/Cameras/CGameCamera.hpp b/include/MetroidPrime/Cameras/CGameCamera.hpp index eeddaac6..627897ab 100644 --- a/include/MetroidPrime/Cameras/CGameCamera.hpp +++ b/include/MetroidPrime/Cameras/CGameCamera.hpp @@ -27,26 +27,26 @@ public: virtual void Reset(const CTransform4f&, CStateManager& mgr) = 0; TUniqueId GetWatchedObject() const { return xe8_watchedObject; } - f32 GetFov() const { return x15c_currentFov; } - void SetFov(f32 fov) { x15c_currentFov = fov; } - void SetFovInterpolation(f32 start, f32 fov, f32 time, f32 delayTime); + float GetFov() const { return x15c_currentFov; } + void SetFov(float fov) { x15c_currentFov = fov; } + void SetFovInterpolation(float start, float fov, float time, float delayTime); private: TUniqueId xe8_watchedObject; mutable CMatrix4f xec_perspectiveMatrix; CTransform4f x12c_origXf; - f32 x15c_currentFov; - f32 x160_znear; - f32 x164_zfar; - f32 x168_aspect; + float x15c_currentFov; + float x160_znear; + float x164_zfar; + float x168_aspect; uint 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; + float x174_delayTime; + float x178_perspInterpRemTime; + float x17c_perspInterpDur; + float x180_perspInterpStartFov; + float x184_perspInterpEndFov; }; CHECK_SIZEOF(CGameCamera, 0x188) diff --git a/include/MetroidPrime/Enemies/CAiFuncMap.hpp b/include/MetroidPrime/Enemies/CAiFuncMap.hpp index d0c66f97..cf4fb957 100644 --- a/include/MetroidPrime/Enemies/CAiFuncMap.hpp +++ b/include/MetroidPrime/Enemies/CAiFuncMap.hpp @@ -9,7 +9,7 @@ public: ~CAiFuncMap(); private: - u8 pad[0x20]; + uchar pad[0x20]; }; #endif // _CAIFUNCMAP diff --git a/include/MetroidPrime/Factories/CCharacterFactoryBuilder.hpp b/include/MetroidPrime/Factories/CCharacterFactoryBuilder.hpp index 74286292..4a4c5a65 100644 --- a/include/MetroidPrime/Factories/CCharacterFactoryBuilder.hpp +++ b/include/MetroidPrime/Factories/CCharacterFactoryBuilder.hpp @@ -9,7 +9,7 @@ public: ~CCharacterFactoryBuilder(); private: - u8 pad[0x24]; + uchar pad[0x24]; }; extern CCharacterFactoryBuilder* gpCharacterFactoryBuilder; diff --git a/include/MetroidPrime/Player/CGameState.hpp b/include/MetroidPrime/Player/CGameState.hpp index 4deab129..44c189f6 100644 --- a/include/MetroidPrime/Player/CGameState.hpp +++ b/include/MetroidPrime/Player/CGameState.hpp @@ -28,7 +28,7 @@ public: CHintOptions& HintOptions() { return x1f8_hintOptions; } uint& SaveIdx() { return x20c_saveIdx; } u64& CardSerial() { return x210_cardSerial; } - rstl::vector< u8 >& BackupBuf() { return x218_backupBuf; } + rstl::vector< uchar >& BackupBuf() { return x218_backupBuf; } private: rstl::reserved_vector< bool, 128 > x0_; @@ -36,13 +36,13 @@ private: rstl::vector< CWorldState > x88_worldStates; rstl::rc_ptr< CPlayerState > x98_playerState; rstl::rc_ptr< CWorldTransManager > x9c_transManager; - f64 xa0_playTime; + double xa0_playTime; CSystemOptions xa8_systemOptions; CGameOptions x17c_gameOptions; CHintOptions x1f8_hintOptions; uint x20c_saveIdx; u64 x210_cardSerial; - rstl::vector< u8 > x218_backupBuf; + rstl::vector< uchar > x218_backupBuf; bool x228_24_hardMode : 1; bool x228_25_initPowerupsAtFirstSpawn : 1; }; diff --git a/include/MetroidPrime/Player/CGrappleArm.hpp b/include/MetroidPrime/Player/CGrappleArm.hpp index 0c0bf08b..ce76015c 100644 --- a/include/MetroidPrime/Player/CGrappleArm.hpp +++ b/include/MetroidPrime/Player/CGrappleArm.hpp @@ -21,8 +21,8 @@ public: bool IsSuitLoading() const { return x3b2_29_suitLoading; } private: - u8 x0_pad[0x3b0]; - s16 x3b0_rumbleHandle; + uchar x0_pad[0x3b0]; + short x3b0_rumbleHandle; bool x3b2_24_active : 1; bool x3b2_25_beamActive : 1; bool x3b2_26_grappleHit : 1; diff --git a/include/MetroidPrime/Player/CHintOptions.hpp b/include/MetroidPrime/Player/CHintOptions.hpp index 3f064187..c2ea6b2e 100644 --- a/include/MetroidPrime/Player/CHintOptions.hpp +++ b/include/MetroidPrime/Player/CHintOptions.hpp @@ -9,7 +9,7 @@ enum EHintState { kHS_Zero, kHS_Waiting, kHS_Displaying, kHS_Delayed }; struct SHintState { EHintState x0_state; - f32 x4_time; + float x4_time; bool x8_dismissed; }; diff --git a/include/MetroidPrime/Player/CPlayer.hpp b/include/MetroidPrime/Player/CPlayer.hpp index 86c4ca74..8efa2247 100644 --- a/include/MetroidPrime/Player/CPlayer.hpp +++ b/include/MetroidPrime/Player/CPlayer.hpp @@ -117,8 +117,8 @@ public: // CEntity ~CPlayer() override; void Accept(IVisitor& visitor) override; - void PreThink(f32 dt, CStateManager& mgr) override; - void Think(f32 dt, CStateManager& mgr) override; + void PreThink(float dt, CStateManager& mgr) override; + void Think(float dt, CStateManager& mgr) override; void AcceptScriptMsg(EScriptObjectMessage msg, TUniqueId uid, CStateManager& mgr) override; // CActor @@ -142,9 +142,9 @@ public: CTransform4f GetPrimitiveTransform() const override; void CollidedWith(const TUniqueId& id, const CCollisionInfoList& list, CStateManager& mgr) override; - f32 GetStepDownHeight() const override; - f32 GetStepUpHeight() const override; - f32 GetWeight() const override; + float GetStepDownHeight() const override; + float GetStepUpHeight() const override; + float GetWeight() const override; // CPlayer virtual bool IsTransparent(); @@ -186,163 +186,163 @@ public: private: struct CVisorSteam { - f32 x0_curTargetAlpha; - f32 x4_curAlphaInDur; - f32 x8_curAlphaOutDur; + float x0_curTargetAlpha; + float x4_curAlphaInDur; + float x8_curAlphaOutDur; CAssetId xc_tex; - f32 x10_nextTargetAlpha; - f32 x14_nextAlphaInDur; - f32 x18_nextAlphaOutDur; + float x10_nextTargetAlpha; + float x14_nextAlphaInDur; + float x18_nextAlphaOutDur; CAssetId x1c_txtr; - f32 x20_alpha; - f32 x24_delayTimer; + float x20_alpha; + float x24_delayTimer; bool x28_affectsThermal; public: - CVisorSteam(f32 targetAlpha, f32 alphaInDur, f32 alphaOutDur, CAssetId tex) + CVisorSteam(float targetAlpha, float alphaInDur, float alphaOutDur, CAssetId tex) : x0_curTargetAlpha(targetAlpha) , x4_curAlphaInDur(alphaInDur) , x8_curAlphaOutDur(alphaOutDur) , xc_tex(tex) {} CAssetId GetTextureId() const; - void SetSteam(f32 targetAlpha, f32 alphaInDur, f32 alphaOutDur, CAssetId txtr, + void SetSteam(float targetAlpha, float alphaInDur, float alphaOutDur, CAssetId txtr, bool affectsThermal); - void Update(f32 dt); - f32 GetAlpha() const { return x20_alpha; } + void Update(float dt); + float GetAlpha() const { return x20_alpha; } bool AffectsThermal() const { return x28_affectsThermal; } }; NPlayer::EPlayerMovementState x258_movementState; rstl::vector< CToken > x25c_ballTransitionsRes; TUniqueId x26c_attachedActor; - f32 x270_attachedActorTime; + float x270_attachedActorTime; CPlayerEnergyDrain x274_energyDrain; - f32 x288_startingJumpTimeout; - f32 x28c_sjTimer; - f32 x290_minJumpTimeout; - f32 x294_jumpCameraTimer; + float x288_startingJumpTimeout; + float x28c_sjTimer; + float x290_minJumpTimeout; + float x294_jumpCameraTimer; uint x298_jumpPresses; - f32 x29c_fallCameraTimer; - f32 x2a0_; + float x29c_fallCameraTimer; + float x2a0_; bool x2a4_cancelCameraPitch; - f32 x2a8_timeSinceJump; + float x2a8_timeSinceJump; ESurfaceRestraints x2ac_surfaceRestraint; uint x2b0_outOfWaterTicks; - rstl::reserved_vector< f32, 6 > x2b4_accelerationTable; + rstl::reserved_vector< float, 6 > x2b4_accelerationTable; uint x2d0_curAcceleration; - f32 x2d4_accelerationChangeTimer; + float x2d4_accelerationChangeTimer; CAABox x2d8_fpBounds; - f32 x2f0_ballTransHeight; + float x2f0_ballTransHeight; EPlayerCameraState x2f4_cameraState; EPlayerMorphBallState x2f8_morphBallState; EPlayerMorphBallState x2fc_spawnedMorphBallState; - f32 x300_fallingTime; + float x300_fallingTime; EPlayerOrbitState x304_orbitState; EPlayerOrbitType x308_orbitType; EPlayerOrbitRequest x30c_orbitRequest; TUniqueId x310_orbitTargetId; CVector3f x314_orbitPoint; CVector3f x320_orbitVector; - f32 x32c_orbitModeTimer; + float x32c_orbitModeTimer; EPlayerZoneInfo x330_orbitZoneMode; EPlayerZoneType x334_orbitType; uint x338_; TUniqueId x33c_orbitNextTargetId; bool m_deferredOrbitObject; - f32 x340_; + float x340_; rstl::vector< TUniqueId > x344_nearbyOrbitObjects; rstl::vector< TUniqueId > x354_onScreenOrbitObjects; rstl::vector< TUniqueId > x364_offScreenOrbitObjects; bool x374_orbitLockEstablished; - f32 x378_orbitPreventionTimer; + float x378_orbitPreventionTimer; bool x37c_sidewaysDashing; - f32 x380_strafeInputAtDash; - f32 x384_dashTimer; - f32 x388_dashButtonHoldTime; + float x380_strafeInputAtDash; + float x384_dashTimer; + float x388_dashButtonHoldTime; bool x38c_doneSidewaysDashing; uint x390_orbitSource; bool x394_orbitingEnemy; - f32 x398_dashSpeedMultiplier; + float x398_dashSpeedMultiplier; bool x39c_noStrafeDashBlend; - f32 x3a0_dashDuration; - f32 x3a4_strafeDashBlendDuration; + float x3a0_dashDuration; + float x3a4_strafeDashBlendDuration; EPlayerScanState x3a8_scanState; - f32 x3ac_scanningTime; - f32 x3b0_curScanTime; + float x3ac_scanningTime; + float x3b0_curScanTime; TUniqueId x3b4_scanningObject; EGrappleState x3b8_grappleState; - f32 x3bc_grappleSwingTimer; + float x3bc_grappleSwingTimer; CVector3f x3c0_grappleSwingAxis; - f32 x3cc_; - f32 x3d0_; - f32 x3d4_; - f32 x3d8_grappleJumpTimeout; + float x3cc_; + float x3d0_; + float x3d4_; + float x3d8_grappleJumpTimeout; bool x3dc_inFreeLook; bool x3dd_lookButtonHeld; bool x3de_lookAnalogHeld; - f32 x3e0_curFreeLookCenteredTime; - f32 x3e4_freeLookYawAngle; - f32 x3e8_horizFreeLookAngleVel; - f32 x3ec_freeLookPitchAngle; - f32 x3f0_vertFreeLookAngleVel; + float x3e0_curFreeLookCenteredTime; + float x3e4_freeLookYawAngle; + float x3e8_horizFreeLookAngleVel; + float x3ec_freeLookPitchAngle; + float x3f0_vertFreeLookAngleVel; TUniqueId x3f4_aimTarget; CVector3f x3f8_targetAimPosition; TReservedAverage< CVector3f, 10 > x404_aimTargetAverage; CVector3f x480_assistedTargetAim; - f32 x48c_aimTargetTimer; + float x48c_aimTargetTimer; rstl::single_ptr< CPlayerGun > x490_gun; - f32 x494_gunAlpha; + float x494_gunAlpha; EGunHolsterState x498_gunHolsterState; - f32 x49c_gunHolsterRemTime; + float x49c_gunHolsterRemTime; rstl::single_ptr< CFailsafeTest > x4a0_failsafeTest; - TReservedAverage< f32, 20 > x4a4_moveSpeedAvg; - f32 x4f8_moveSpeed; - f32 x4fc_flatMoveSpeed; + TReservedAverage< float, 20 > x4a4_moveSpeedAvg; + float x4f8_moveSpeed; + float x4fc_flatMoveSpeed; CVector3f x500_lookDir; CVector3f x50c_moveDir; CVector3f x518_leaveMorphDir; CVector3f x524_lastPosForDirCalc; CVector3f x530_gunDir; - f32 x53c_timeMoving; + float x53c_timeMoving; CVector3f x540_controlDir; CVector3f x54c_controlDirFlat; bool x558_wasDamaged; - f32 x55c_damageAmt; - f32 x560_prevDamageAmt; + float x55c_damageAmt; + float x560_prevDamageAmt; CVector3f x564_damageLocation; - f32 x570_immuneTimer; - f32 x574_morphTime; - f32 x578_morphDuration; + float x570_immuneTimer; + float x574_morphTime; + float x578_morphDuration; uint x57c_; uint x580_; int x584_ballTransitionAnim; - f32 x588_alpha; - f32 x58c_transitionVel; + float x588_alpha; + float x58c_transitionVel; bool x590_leaveMorphballAllowed; TReservedAverage< CTransform4f, 4 > x594_transisionBeamXfs; TReservedAverage< CTransform4f, 4 > x658_transitionModelXfs; - TReservedAverage< f32, 4 > x71c_transitionModelAlphas; + TReservedAverage< float, 4 > x71c_transitionModelAlphas; rstl::vector< rstl::auto_ptr< CModelData > > x730_transitionModels; - f32 x740_staticTimer; - f32 x744_staticOutSpeed; - f32 x748_staticInSpeed; - f32 x74c_visorStaticAlpha; - f32 x750_frozenTimeout; - s32 x754_iceBreakJumps; - f32 x758_frozenTimeoutBias; - s32 x75c_additionalIceBreakJumps; + float x740_staticTimer; + float x744_staticOutSpeed; + float x748_staticInSpeed; + float x74c_visorStaticAlpha; + float x750_frozenTimeout; + int x754_iceBreakJumps; + float x758_frozenTimeoutBias; + int x75c_additionalIceBreakJumps; bool x760_controlsFrozen; - f32 x764_controlsFrozenTimeout; + float x764_controlsFrozenTimeout; rstl::single_ptr< CMorphBall > x768_morphball; rstl::single_ptr< CPlayerCameraBob > x76c_cameraBob; CSfxHandle x770_damageLoopSfx; - f32 x774_samusVoiceTimeout; + float x774_samusVoiceTimeout; CSfxHandle x778_dashSfx; CSfxHandle x77c_samusVoiceSfx; int x780_samusVoicePriority; - f32 x784_damageSfxTimer; - u16 x788_damageLoopSfxId; - f32 x78c_footstepSfxTimer; + float x784_damageSfxTimer; + ushort x788_damageLoopSfxId; + float x78c_footstepSfxTimer; EFootstepSfx x790_footstepSfxSel; CVector3f x794_lastVelocity; CVisorSteam x7a0_visorSteam; @@ -354,8 +354,8 @@ private: CPlayerState::EBeamId x7ec_beam; rstl::single_ptr< CModelData > x7f0_ballTransitionBeamModel; CTransform4f x7f4_gunWorldXf; - f32 x824_transitionFilterTimer; - f32 x828_distanceUnderWater; + float x824_transitionFilterTimer; + float x828_distanceUnderWater; bool x82c_inLava; TUniqueId x82e_ridingPlatform; TUniqueId x830_playerHint; @@ -389,28 +389,28 @@ private: bool x9c6_31_overrideRadarRadius : 1; bool x9c7_24_noDamageLoopSfx : 1; bool x9c7_25_outOfBallLookAtHintActor : 1; - f32 x9c8_eyeZBias; - f32 x9cc_stepCameraZBias; + float x9c8_eyeZBias; + float x9cc_stepCameraZBias; uint x9d0_bombJumpCount; - s32 x9d4_bombJumpCheckDelayFrames; + int x9d4_bombJumpCheckDelayFrames; CVector3f x9d8_controlDirOverrideDir; rstl::reserved_vector< TUniqueId, 5 > x9e4_orbitDisableList; - f32 x9f4_deathTime; - f32 x9f8_controlDirInterpTime; - f32 x9fc_controlDirInterpDur; + float x9f4_deathTime; + float x9f8_controlDirInterpTime; + float x9fc_controlDirInterpDur; TUniqueId xa00_deathPowerBomb; - f32 xa04_preThinkDt; + float xa04_preThinkDt; CAssetId xa08_steamTextureId; CAssetId xa0c_iceTextureId; uint xa10_envDmgCounter; - f32 xa14_envDmgCameraShakeTimer; - f32 xa18_phazonDamageLag; - f32 xa1c_threatOverride; - f32 xa20_radarXYRadiusOverride; - f32 xa24_radarZRadiusOverride; - f32 xa28_attachedActorStruggle; + float xa14_envDmgCameraShakeTimer; + float xa18_phazonDamageLag; + float xa1c_threatOverride; + float xa20_radarXYRadiusOverride; + float xa24_radarZRadiusOverride; + float xa28_attachedActorStruggle; int xa2c_damageLoopSfxDelayTicks; - f32 xa30_samusExhaustedVoiceTimer; + float xa30_samusExhaustedVoiceTimer; }; CHECK_SIZEOF(CPlayer, 0xa38) diff --git a/include/MetroidPrime/Player/CPlayerEnergyDrain.hpp b/include/MetroidPrime/Player/CPlayerEnergyDrain.hpp index bc3544eb..87f22916 100644 --- a/include/MetroidPrime/Player/CPlayerEnergyDrain.hpp +++ b/include/MetroidPrime/Player/CPlayerEnergyDrain.hpp @@ -9,20 +9,20 @@ class CEnergyDrainSource { public: - CEnergyDrainSource(TUniqueId src, f32 intensity); + CEnergyDrainSource(TUniqueId src, float intensity); TUniqueId GetEnergyDrainSourceId() const { return x0_source; } - void SetEnergyDrainIntensity(f32 in) { x4_intensity = in; } - f32 GetEnergyDrainIntensity() const { return x4_intensity; } + void SetEnergyDrainIntensity(float in) { x4_intensity = in; } + float GetEnergyDrainIntensity() const { return x4_intensity; } private: TUniqueId x0_source; - f32 x4_intensity; + float x4_intensity; }; class CPlayerEnergyDrain { private: rstl::vector< CEnergyDrainSource > x0_sources; - f32 x10_energyDrainTime; + float x10_energyDrainTime; }; CHECK_SIZEOF(CPlayerEnergyDrain, 0x14) diff --git a/include/MetroidPrime/Player/CPlayerGun.hpp b/include/MetroidPrime/Player/CPlayerGun.hpp index 1c085d82..0ad1a26c 100644 --- a/include/MetroidPrime/Player/CPlayerGun.hpp +++ b/include/MetroidPrime/Player/CPlayerGun.hpp @@ -176,8 +176,8 @@ public: static float GetTractorBeamFactor() { return skTractorBeamFactor; } - s32 GetStateFlags() const { return x2f8_stateFlags; } - void SetStateFlags(s32 flags) { x2f8_stateFlags = flags; } + int GetStateFlags() const { return x2f8_stateFlags; } + void SetStateFlags(int flags) { x2f8_stateFlags = flags; } private: class CGunMorph { @@ -277,7 +277,7 @@ private: uint x2f0_pressedFireButtonStates; uint x2f4_fireButtonStates; // 0x1: beam mode, 0x2: missile mode, 0x4: missile ready, 0x8: morphing, 0x10: combo fire - s32 x2f8_stateFlags; + int x2f8_stateFlags; uint x2fc_fidgetAnimBits; uint x300_remainingMissiles; uint x304_; @@ -340,7 +340,7 @@ private: float x664_; float x668_aimVerticalSpeed; float x66c_aimHorizontalSpeed; - rstl::pair< u16, CSfxHandle > x670_animSfx; + rstl::pair< ushort, CSfxHandle > x670_animSfx; CGunMorph x678_morph; CMotionState x6a0_motionState; CAABox x6c8_hologramClipCube; @@ -366,7 +366,7 @@ private: rstl::reserved_vector< TLockedToken< CGenDescription >, 5 > x7c0_auxMuzzleEffects; rstl::reserved_vector< rstl::auto_ptr< CElementGen >, 5 > x800_auxMuzzleGenerators; rstl::single_ptr< CWorldShadow > x82c_shadow; - s16 x830_chargeRumbleHandle; + short x830_chargeRumbleHandle; bool x832_24_coolingCharge : 1; bool x832_25_chargeEffectVisible : 1; diff --git a/include/MetroidPrime/Player/CSystemOptions.hpp b/include/MetroidPrime/Player/CSystemOptions.hpp index a564cc34..61451831 100644 --- a/include/MetroidPrime/Player/CSystemOptions.hpp +++ b/include/MetroidPrime/Player/CSystemOptions.hpp @@ -26,7 +26,7 @@ public: void SetAllItemsCollected(bool); private: - rstl::reserved_vector< u8, 98 > x0_nesState; + rstl::reserved_vector< uchar, 98 > x0_nesState; rstl::reserved_vector< bool, 64 > x68_; rstl::vector< rstl::pair< CAssetId, TEditorId > > xac_cinematicStates; int xbc_autoMapperKeyState; diff --git a/include/MetroidPrime/Player/CWorldState.hpp b/include/MetroidPrime/Player/CWorldState.hpp index 54508e4e..49a28301 100644 --- a/include/MetroidPrime/Player/CWorldState.hpp +++ b/include/MetroidPrime/Player/CWorldState.hpp @@ -6,7 +6,7 @@ class CWorldState { public: private: - u8 pad[0x18]; + uchar pad[0x18]; }; #endif // _CWORLDSTATE diff --git a/include/MetroidPrime/Player/CWorldTransManager.hpp b/include/MetroidPrime/Player/CWorldTransManager.hpp index accf3e6b..83b956b5 100644 --- a/include/MetroidPrime/Player/CWorldTransManager.hpp +++ b/include/MetroidPrime/Player/CWorldTransManager.hpp @@ -6,7 +6,7 @@ class CWorldTransManager { public: private: - u8 pad[0x48]; + uchar pad[0x48]; }; #endif // _CWORLDTRANSMANAGER diff --git a/include/MetroidPrime/ScriptObjects/CScriptMazeNode.hpp b/include/MetroidPrime/ScriptObjects/CScriptMazeNode.hpp index b0d4b1bd..53484e93 100644 --- a/include/MetroidPrime/ScriptObjects/CScriptMazeNode.hpp +++ b/include/MetroidPrime/ScriptObjects/CScriptMazeNode.hpp @@ -82,7 +82,7 @@ public: void Accept(IVisitor& visitor) override; void AcceptScriptMsg(EScriptObjectMessage msg, TUniqueId uid, CStateManager& mgr) override; - void Think(f32 dt, CStateManager& mgr) override; + void Think(float dt, CStateManager& mgr) override; static void LoadMazeSeeds(); @@ -99,7 +99,7 @@ private: int xec_row; ESide xf0_side; TUniqueId xf4_gateEffectId; - f32 xf8_msgTimer; + float xf8_msgTimer; TUniqueId xfc_actorId; CVector3f x100_actorPos; TUniqueId x10c_triggerId; diff --git a/include/MetroidPrime/ScriptObjects/CScriptPlatform.hpp b/include/MetroidPrime/ScriptObjects/CScriptPlatform.hpp index 140caf52..5f82e687 100644 --- a/include/MetroidPrime/ScriptObjects/CScriptPlatform.hpp +++ b/include/MetroidPrime/ScriptObjects/CScriptPlatform.hpp @@ -21,7 +21,7 @@ class CFluidPlane; struct SRiders { TUniqueId x0_uid; - f32 x4_decayTimer; + float x4_decayTimer; CTransform4f x8_transform; SRiders(TUniqueId uid) @@ -33,8 +33,8 @@ class CScriptPlatform : public CPhysicsActor { public: CScriptPlatform( TUniqueId uid, const rstl::string& name, const CEntityInfo& info, const CTransform4f& xf, - const CModelData& mData, const CActorParameters& actParams, const CAABox& aabb, f32 speed, - bool detectCollision, f32 xrayAlpha, bool active, const CHealthInfo& hInfo, + const CModelData& mData, const CActorParameters& actParams, const CAABox& aabb, float speed, + bool detectCollision, float xrayAlpha, bool active, const CHealthInfo& hInfo, const CDamageVulnerability& dVuln, const rstl::optional_object< TLockedToken< CCollidableOBBTreeGroupContainer > >& dcln, bool rainSplashes, uint maxRainSplashes, uint rainGenRate); @@ -42,8 +42,8 @@ public: // CEntity ~CScriptPlatform() override; void Accept(IVisitor& visitor) override; - void PreThink(f32 dt, CStateManager& mgr) override; - void Think(f32 dt, CStateManager& mgr) override; + void PreThink(float dt, CStateManager& mgr) override; + void Think(float dt, CStateManager& mgr) override; void AcceptScriptMsg(EScriptObjectMessage msg, TUniqueId uid, CStateManager& mgr) override; // CActor @@ -73,8 +73,8 @@ public: const CPhysicsActor* ridee, CStateManager& mgr); static TEntityList BuildNearListFromRiders(CStateManager& mgr, const rstl::vector< SRiders >& riders); - static void DecayRiders(rstl::vector< SRiders >& riders, f32 dt, CStateManager& mgr); - static void MoveRiders(CStateManager& mgr, f32 dt, bool active, rstl::vector< SRiders >& riders, + static void DecayRiders(rstl::vector< SRiders >& riders, float dt, CStateManager& mgr); + static void MoveRiders(CStateManager& mgr, float dt, bool active, rstl::vector< SRiders >& riders, rstl::vector< SRiders >& collidedRiders, const CTransform4f& oldXf, const CTransform4f& newXf, const CVector3f& dragDelta, CQuaternion rotDelta); @@ -82,11 +82,11 @@ public: private: TUniqueId x258_currentWaypoint; TUniqueId x25a_targetWaypoint; - f32 x25c_currentSpeed; - f32 x260_moveDelay; - f32 x264_collisionRecoverDelay; - f32 x268_fadeInTime; - f32 x26c_fadeOutTime; + float x25c_currentSpeed; + float x260_moveDelay; + float x264_collisionRecoverDelay; + float x268_fadeInTime; + float x26c_fadeOutTime; CVector3f x270_dragDelta; CQuaternion x27c_rotDelta; CHealthInfo x28c_initialHealth; @@ -97,7 +97,7 @@ private: rstl::vector< SRiders > x318_riders; rstl::vector< SRiders > x328_slavesStatic; rstl::vector< SRiders > x338_slavesDynamic; - f32 x348_xrayAlpha; + float x348_xrayAlpha; uint x34c_maxRainSplashes; uint x350_rainGenRate; TUniqueId x354_boundsTrigger; diff --git a/include/MetroidPrime/ScriptObjects/CScriptSpecialFunction.hpp b/include/MetroidPrime/ScriptObjects/CScriptSpecialFunction.hpp index e816d3bf..2be1f09e 100644 --- a/include/MetroidPrime/ScriptObjects/CScriptSpecialFunction.hpp +++ b/include/MetroidPrime/ScriptObjects/CScriptSpecialFunction.hpp @@ -88,20 +88,20 @@ private: float x138_; CTransform4f x13c_spinnerInitialXf; float x16c_; - u16 x170_sfx1; - u16 x172_sfx2; - u16 x174_sfx3; + ushort x170_sfx1; + ushort x172_sfx2; + ushort x174_sfx3; CSfxHandle x178_sfxHandle; uint x17c_; float x180_; - TAverage< f32 > x184_; + TAverage< float > x184_; float x194_; rstl::vector< SRingController > x198_ringControllers; ERingState x1a8_ringState; CVector3f x1ac_ringRotateTarget; bool x1b8_ringReverse; - s32 x1bc_areaSaveId; - s32 x1c0_layerIdx; + int x1bc_areaSaveId; + int x1c0_layerIdx; CPlayerState::EItemType x1c4_item; rstl::optional_object< CAABox > x1c8_touchBounds; bool x1e4_24_spinnerInitializedXf : 1; @@ -121,7 +121,7 @@ public: CScriptSpecialFunction(TUniqueId, const rstl::string&, const CEntityInfo&, const CTransform4f&, ESpecialFunction, const rstl::string&, float, float, float, float, const CVector3f&, const CColor&, bool, const CDamageInfo&, int, int, - CPlayerState::EItemType, u16, u16, u16); + CPlayerState::EItemType, ushort, ushort, ushort); void Accept(IVisitor& visitor) override; void Think(float, CStateManager&) override; @@ -149,7 +149,7 @@ public: void DeleteEmitter(CSfxHandle& handle); int GetSpecialEnding(const CStateManager&) const; - void AddOrUpdateEmitter(float pitch, CSfxHandle& handle, u16 id, CVector3f pos, u8 vol); + void AddOrUpdateEmitter(float pitch, CSfxHandle& handle, ushort id, CVector3f pos, uchar vol); }; #endif // _CSCRIPTSPECIALFUNCTION diff --git a/include/MetroidPrime/ScriptObjects/CScriptSwitch.hpp b/include/MetroidPrime/ScriptObjects/CScriptSwitch.hpp index b5d230a1..5807dbd3 100644 --- a/include/MetroidPrime/ScriptObjects/CScriptSwitch.hpp +++ b/include/MetroidPrime/ScriptObjects/CScriptSwitch.hpp @@ -14,8 +14,8 @@ public: ~CScriptSwitch(); private: - u8 mOpened; - u8 mCloseOnOpened; + uchar mOpened; + uchar mCloseOnOpened; }; #endif // _CSCRIPTSWITCH diff --git a/include/MetroidPrime/ScriptObjects/CScriptWaypoint.hpp b/include/MetroidPrime/ScriptObjects/CScriptWaypoint.hpp index 7b0329eb..1cd9186d 100644 --- a/include/MetroidPrime/ScriptObjects/CScriptWaypoint.hpp +++ b/include/MetroidPrime/ScriptObjects/CScriptWaypoint.hpp @@ -25,26 +25,26 @@ public: TUniqueId NextWaypoint(const CStateManager& mgr) const; void FollowWaypoint(const CStateManager& mgr) const; - f32 GetSpeed() const { return xe8_speed; } + float GetSpeed() const { return xe8_speed; } uint GetAnimation() const { return xec_animation; } - f32 GetPause() const { return xf0_pause; } - u8 GetPatternTranslate() const { return xf4_patternTranslate; } - u8 GetPatternOrient() const { return xf5_patternOrient; } - u8 GetPatternFit() const { return xf6_patternFit; } - u8 GetBehaviour() const { return xf7_behaviour; } - u8 GetBehaviourOrient() const { return xf8_behaviourOrient; } - u16 GetBehaviourModifiers() const { return xfa_behaviourModifiers; } + float GetPause() const { return xf0_pause; } + uchar GetPatternTranslate() const { return xf4_patternTranslate; } + uchar GetPatternOrient() const { return xf5_patternOrient; } + uchar GetPatternFit() const { return xf6_patternFit; } + uchar GetBehaviour() const { return xf7_behaviour; } + uchar GetBehaviourOrient() const { return xf8_behaviourOrient; } + ushort GetBehaviourModifiers() const { return xfa_behaviourModifiers; } private: - f32 xe8_speed; + float xe8_speed; uint xec_animation; - f32 xf0_pause; - u8 xf4_patternTranslate; - u8 xf5_patternOrient; - u8 xf6_patternFit; - u8 xf7_behaviour; - u8 xf8_behaviourOrient; - u16 xfa_behaviourModifiers; + float xf0_pause; + uchar xf4_patternTranslate; + uchar xf5_patternOrient; + uchar xf6_patternFit; + uchar xf7_behaviour; + uchar xf8_behaviourOrient; + ushort xfa_behaviourModifiers; }; #endif // _CSCRIPTWAYPOINT diff --git a/include/MetroidPrime/TGameTypes.hpp b/include/MetroidPrime/TGameTypes.hpp index 2962826a..df204203 100644 --- a/include/MetroidPrime/TGameTypes.hpp +++ b/include/MetroidPrime/TGameTypes.hpp @@ -44,11 +44,11 @@ struct TEditorId { CHECK_SIZEOF(TEditorId, 0x4) struct TUniqueId { - u16 value; + ushort value; - TUniqueId(u16 version, u16 id) : value(((version & 0x3F) << 10) | (id & 0x3FF)) {} - u16 Value() const { return value & 0x3FF; } - u16 Version() const { return (value >> 10) & 0x3F; } + TUniqueId(ushort version, ushort id) : value(((version & 0x3F) << 10) | (id & 0x3FF)) {} + ushort Value() const { return value & 0x3FF; } + ushort Version() const { return (value >> 10) & 0x3F; } bool operator==(const TUniqueId& other) const { return value == other.value; } bool operator!=(const TUniqueId& other) const { return value != other.value; } @@ -64,12 +64,12 @@ CHECK_SIZEOF(TUniqueId, 0x2) // }; // CHECK_SIZEOF(TGameScriptId, 0x8) -typedef u16 TSfxId; +typedef ushort TSfxId; static TSfxId InvalidSfxId = 0xFFFFu; class CSegId { private: - u8 x0_id; + uchar x0_id; }; #define ALIGN_UP(x, a) (((x) + (a - 1)) & ~(a - 1)) diff --git a/include/MetroidPrime/Tweaks/CTweakBall.hpp b/include/MetroidPrime/Tweaks/CTweakBall.hpp index 07299174..c3fda1a5 100644 --- a/include/MetroidPrime/Tweaks/CTweakBall.hpp +++ b/include/MetroidPrime/Tweaks/CTweakBall.hpp @@ -13,80 +13,80 @@ class CTweakBall : public ITweakObject { public: ~CTweakBall() override; - f32 GetMaxBallTranslationAcceleration(int s) const { return x4_maxTranslationAcceleration[s]; } - f32 GetBallTranslationFriction(int s) const { return x24_translationFriction[s]; } - f32 GetBallTranslationMaxSpeed(int s) const { return x44_translationMaxSpeed[s]; } - f32 GetBallCameraElevation() const { return 2.736f; } - f32 GetBallCameraAnglePerSecond() const { return x74_ballCameraAnglePerSecond; } + float GetMaxBallTranslationAcceleration(int s) const { return x4_maxTranslationAcceleration[s]; } + float GetBallTranslationFriction(int s) const { return x24_translationFriction[s]; } + float GetBallTranslationMaxSpeed(int s) const { return x44_translationMaxSpeed[s]; } + float GetBallCameraElevation() const { return 2.736f; } + float GetBallCameraAnglePerSecond() const { return x74_ballCameraAnglePerSecond; } const CVector3f& GetBallCameraOffset() const { return x78_ballCameraOffset; } - f32 GetBallCameraMinSpeedDistance() const { return x84_ballCameraMinSpeedDistance; } - f32 GetBallCameraMaxSpeedDistance() const { return x88_ballCameraMaxSpeedDistance; } - f32 GetBallCameraBackwardsDistance() const { return x8c_ballCameraBackwardsDistance; } - f32 GetBallCameraSpringConstant() const { return x94_ballCameraSpringConstant; } - f32 GetBallCameraSpringMax() const { return x98_ballCameraSpringMax; } - f32 GetBallCameraSpringTardis() const { return x9c_ballCameraSpringTardis; } - f32 GetBallCameraCentroidSpringConstant() const { return xa0_ballCameraCentroidSpringConstant; } - f32 GetBallCameraCentroidSpringMax() const { return xa4_ballCameraCentroidSpringMax; } - f32 GetBallCameraCentroidSpringTardis() const { return xa8_ballCameraCentroidSpringTardis; } - f32 GetBallCameraCentroidDistanceSpringConstant() const { + float GetBallCameraMinSpeedDistance() const { return x84_ballCameraMinSpeedDistance; } + float GetBallCameraMaxSpeedDistance() const { return x88_ballCameraMaxSpeedDistance; } + float GetBallCameraBackwardsDistance() const { return x8c_ballCameraBackwardsDistance; } + float GetBallCameraSpringConstant() const { return x94_ballCameraSpringConstant; } + float GetBallCameraSpringMax() const { return x98_ballCameraSpringMax; } + float GetBallCameraSpringTardis() const { return x9c_ballCameraSpringTardis; } + float GetBallCameraCentroidSpringConstant() const { return xa0_ballCameraCentroidSpringConstant; } + float GetBallCameraCentroidSpringMax() const { return xa4_ballCameraCentroidSpringMax; } + float GetBallCameraCentroidSpringTardis() const { return xa8_ballCameraCentroidSpringTardis; } + float GetBallCameraCentroidDistanceSpringConstant() const { return xac_ballCameraCentroidDistanceSpringConstant; } - f32 GetBallCameraCentroidDistanceSpringMax() const { + float GetBallCameraCentroidDistanceSpringMax() const { return xb0_ballCameraCentroidDistanceSpringMax; } - f32 GetBallCameraCentroidDistanceSpringTardis() const { + float GetBallCameraCentroidDistanceSpringTardis() const { return xb4_ballCameraCentroidDistanceSpringTardis; } - f32 GetBallCameraLookAtSpringConstant() const { return xb8_ballCameraLookAtSpringConstant; } - f32 GetBallCameraLookAtSpringMax() const { return xbc_ballCameraLookAtSpringMax; } - f32 GetBallCameraLookAtSpringTardis() const { return xc0_ballCameraLookAtSpringTardis; } - f32 GetBallForwardBrakingAcceleration(int s) const { + float GetBallCameraLookAtSpringConstant() const { return xb8_ballCameraLookAtSpringConstant; } + float GetBallCameraLookAtSpringMax() const { return xbc_ballCameraLookAtSpringMax; } + float GetBallCameraLookAtSpringTardis() const { return xc0_ballCameraLookAtSpringTardis; } + float GetBallForwardBrakingAcceleration(int s) const { return xc4_ballForwardBrakingAcceleration[s]; } - f32 GetBallGravity() const { return xe4_ballGravity; } - f32 GetBallWaterGravity() const { return xe8_ballWaterGravity; } - f32 GetBallSlipFactor(int s) const { return x12c_ballSlipFactor[s]; } - f32 GetConservativeDoorCameraDistance() const { return x170_conservativeDoorCamDistance; } - f32 GetBallCameraChaseElevation() const { return x178_ballCameraChaseElevation; } - f32 GetBallCameraChaseDampenAngle() const { return x17c_ballCameraChaseDampenAngle; } - f32 GetBallCameraChaseDistance() const { return x180_ballCameraChaseDistance; } - f32 GetBallCameraChaseYawSpeed() const { return x184_ballCameraChaseYawSpeed; } - f32 GetBallCameraChaseAnglePerSecond() const { return x188_ballCameraChaseAnglePerSecond; } + float GetBallGravity() const { return xe4_ballGravity; } + float GetBallWaterGravity() const { return xe8_ballWaterGravity; } + float GetBallSlipFactor(int s) const { return x12c_ballSlipFactor[s]; } + float GetConservativeDoorCameraDistance() const { return x170_conservativeDoorCamDistance; } + float GetBallCameraChaseElevation() const { return x178_ballCameraChaseElevation; } + float GetBallCameraChaseDampenAngle() const { return x17c_ballCameraChaseDampenAngle; } + float GetBallCameraChaseDistance() const { return x180_ballCameraChaseDistance; } + float GetBallCameraChaseYawSpeed() const { return x184_ballCameraChaseYawSpeed; } + float GetBallCameraChaseAnglePerSecond() const { return x188_ballCameraChaseAnglePerSecond; } const CVector3f& GetBallCameraChaseLookAtOffset() const { return x18c_ballCameraChaseLookAtOffset; } - f32 GetBallCameraChaseSpringConstant() const { return x198_ballCameraChaseSpringConstant; } - f32 GetBallCameraChaseSpringMax() const { return x19c_ballCameraChaseSpringMax; } - f32 GetBallCameraChaseSpringTardis() const { return x1a0_ballCameraChaseSpringTardis; } - f32 GetBallCameraBoostElevation() const { return x1a4_ballCameraBoostElevation; } - f32 GetBallCameraBoostDampenAngle() const { return x1a8_ballCameraBoostDampenAngle; } - f32 GetBallCameraBoostDistance() const { return x1ac_ballCameraBoostDistance; } - f32 GetBallCameraBoostYawSpeed() const { return x1b0_ballCameraBoostYawSpeed; } - f32 GetBallCameraBoostAnglePerSecond() const { return x1b4_ballCameraBoostAnglePerSecond; } + float GetBallCameraChaseSpringConstant() const { return x198_ballCameraChaseSpringConstant; } + float GetBallCameraChaseSpringMax() const { return x19c_ballCameraChaseSpringMax; } + float GetBallCameraChaseSpringTardis() const { return x1a0_ballCameraChaseSpringTardis; } + float GetBallCameraBoostElevation() const { return x1a4_ballCameraBoostElevation; } + float GetBallCameraBoostDampenAngle() const { return x1a8_ballCameraBoostDampenAngle; } + float GetBallCameraBoostDistance() const { return x1ac_ballCameraBoostDistance; } + float GetBallCameraBoostYawSpeed() const { return x1b0_ballCameraBoostYawSpeed; } + float GetBallCameraBoostAnglePerSecond() const { return x1b4_ballCameraBoostAnglePerSecond; } const CVector3f& GetBallCameraBoostLookAtOffset() const { return x1b8_ballCameraBoostLookAtOffset; } - f32 GetBallCameraBoostSpringConstant() const { return x1c4_ballCameraBoostSpringConstant; } - f32 GetBallCameraBoostSpringMax() const { return x1c8_ballCameraBoostSpringMax; } - f32 GetBallCameraBoostSpringTardis() const { return x1cc_ballCameraBoostSpringTardis; } - f32 GetBallCameraControlDistance() const { return x1d0_ballCameraControlDistance; } - f32 GetMinimumAlignmentSpeed() const { return x1dc_minimumAlignmentSpeed; } - f32 GetTireness() const { return x1e0_tireness; } - f32 GetMaxLeanAngle() const { return x1ec_maxLeanAngle; } - f32 GetTireToMarbleThresholdSpeed() const { return x1f0_tireToMarbleThresholdSpeed; } - f32 GetMarbleToTireThresholdSpeed() const { return x1f4_marbleToTireThresholdSpeed; } - f32 GetForceToLeanGain() const { return x1f8_forceToLeanGain; } - f32 GetLeanTrackingGain() const { return x1fc_leanTrackingGain; } - f32 GetLeftStickDivisor() const { return x1e4_leftStickDivisor; } - f32 GetRightStickDivisor() const { return x1e8_rightStickDivisor; } - f32 GetBallTouchRadius() const { return x204_ballTouchRadius; } - f32 GetBoostBallDrainTime() const { return x20c_boostBallDrainTime; } - f32 GetBoostBallMaxChargeTime() const { return x210_boostBallMaxChargeTime; } - f32 GetBoostBallMinChargeTime() const { return x218_boostBallMinChargeTime; } - f32 GetBoostBallMinRelativeSpeedForDamage() const { + float GetBallCameraBoostSpringConstant() const { return x1c4_ballCameraBoostSpringConstant; } + float GetBallCameraBoostSpringMax() const { return x1c8_ballCameraBoostSpringMax; } + float GetBallCameraBoostSpringTardis() const { return x1cc_ballCameraBoostSpringTardis; } + float GetBallCameraControlDistance() const { return x1d0_ballCameraControlDistance; } + float GetMinimumAlignmentSpeed() const { return x1dc_minimumAlignmentSpeed; } + float GetTireness() const { return x1e0_tireness; } + float GetMaxLeanAngle() const { return x1ec_maxLeanAngle; } + float GetTireToMarbleThresholdSpeed() const { return x1f0_tireToMarbleThresholdSpeed; } + float GetMarbleToTireThresholdSpeed() const { return x1f4_marbleToTireThresholdSpeed; } + float GetForceToLeanGain() const { return x1f8_forceToLeanGain; } + float GetLeanTrackingGain() const { return x1fc_leanTrackingGain; } + float GetLeftStickDivisor() const { return x1e4_leftStickDivisor; } + float GetRightStickDivisor() const { return x1e8_rightStickDivisor; } + float GetBallTouchRadius() const { return x204_ballTouchRadius; } + float GetBoostBallDrainTime() const { return x20c_boostBallDrainTime; } + float GetBoostBallMaxChargeTime() const { return x210_boostBallMaxChargeTime; } + float GetBoostBallMinChargeTime() const { return x218_boostBallMinChargeTime; } + float GetBoostBallMinRelativeSpeedForDamage() const { return x21c_boostBallMinRelativeSpeedForDamage; } - f32 GetBoostBallChargeTimeTable(int i) const { + float GetBoostBallChargeTimeTable(int i) const { switch (i) { default: case 0: @@ -97,7 +97,7 @@ public: return x228_boostBallChargeTime2; } } - f32 GetBoostBallIncrementalSpeedTable(int i) const { + float GetBoostBallIncrementalSpeedTable(int i) const { switch (i) { default: case 0: @@ -110,105 +110,105 @@ public: } private: - f32 x4_maxTranslationAcceleration[8]; - f32 x24_translationFriction[8]; - f32 x44_translationMaxSpeed[8]; - f32 x64_; - f32 x68_; - f32 x6c_; - f32 x70_; - f32 x74_ballCameraAnglePerSecond; + float x4_maxTranslationAcceleration[8]; + float x24_translationFriction[8]; + float x44_translationMaxSpeed[8]; + float x64_; + float x68_; + float x6c_; + float x70_; + float x74_ballCameraAnglePerSecond; CVector3f x78_ballCameraOffset; - f32 x84_ballCameraMinSpeedDistance; - f32 x88_ballCameraMaxSpeedDistance; - f32 x8c_ballCameraBackwardsDistance; - f32 x90_; - f32 x94_ballCameraSpringConstant; - f32 x98_ballCameraSpringMax; - f32 x9c_ballCameraSpringTardis; - f32 xa0_ballCameraCentroidSpringConstant; - f32 xa4_ballCameraCentroidSpringMax; - f32 xa8_ballCameraCentroidSpringTardis; - f32 xac_ballCameraCentroidDistanceSpringConstant; - f32 xb0_ballCameraCentroidDistanceSpringMax; - f32 xb4_ballCameraCentroidDistanceSpringTardis; - f32 xb8_ballCameraLookAtSpringConstant; - f32 xbc_ballCameraLookAtSpringMax; - f32 xc0_ballCameraLookAtSpringTardis; - f32 xc4_ballForwardBrakingAcceleration[8]; - f32 xe4_ballGravity; - f32 xe8_ballWaterGravity; - f32 xec_; - f32 xf0_; - f32 xf4_; - f32 xf8_; - f32 xfc_; - f32 x100_; - f32 x104_; - f32 x108_; - f32 x10c_; - f32 x110_; - f32 x114_; - f32 x118_; - f32 x11c_; - f32 x120_; - f32 x124_; - f32 x128_; - f32 x12c_ballSlipFactor[8]; - f32 x14c_; - f32 x150_; - f32 x158_; - f32 x154_; - f32 x15c_; - f32 x160_; - f32 x164_; - f32 x168_; - f32 x16c_; - f32 x170_conservativeDoorCamDistance; - f32 x174_; - f32 x178_ballCameraChaseElevation; - f32 x17c_ballCameraChaseDampenAngle; - f32 x180_ballCameraChaseDistance; - f32 x184_ballCameraChaseYawSpeed; - f32 x188_ballCameraChaseAnglePerSecond; + float x84_ballCameraMinSpeedDistance; + float x88_ballCameraMaxSpeedDistance; + float x8c_ballCameraBackwardsDistance; + float x90_; + float x94_ballCameraSpringConstant; + float x98_ballCameraSpringMax; + float x9c_ballCameraSpringTardis; + float xa0_ballCameraCentroidSpringConstant; + float xa4_ballCameraCentroidSpringMax; + float xa8_ballCameraCentroidSpringTardis; + float xac_ballCameraCentroidDistanceSpringConstant; + float xb0_ballCameraCentroidDistanceSpringMax; + float xb4_ballCameraCentroidDistanceSpringTardis; + float xb8_ballCameraLookAtSpringConstant; + float xbc_ballCameraLookAtSpringMax; + float xc0_ballCameraLookAtSpringTardis; + float xc4_ballForwardBrakingAcceleration[8]; + float xe4_ballGravity; + float xe8_ballWaterGravity; + float xec_; + float xf0_; + float xf4_; + float xf8_; + float xfc_; + float x100_; + float x104_; + float x108_; + float x10c_; + float x110_; + float x114_; + float x118_; + float x11c_; + float x120_; + float x124_; + float x128_; + float x12c_ballSlipFactor[8]; + float x14c_; + float x150_; + float x158_; + float x154_; + float x15c_; + float x160_; + float x164_; + float x168_; + float x16c_; + float x170_conservativeDoorCamDistance; + float x174_; + float x178_ballCameraChaseElevation; + float x17c_ballCameraChaseDampenAngle; + float x180_ballCameraChaseDistance; + float x184_ballCameraChaseYawSpeed; + float x188_ballCameraChaseAnglePerSecond; CVector3f x18c_ballCameraChaseLookAtOffset; - f32 x198_ballCameraChaseSpringConstant; - f32 x19c_ballCameraChaseSpringMax; - f32 x1a0_ballCameraChaseSpringTardis; - f32 x1a4_ballCameraBoostElevation; - f32 x1a8_ballCameraBoostDampenAngle; - f32 x1ac_ballCameraBoostDistance; - f32 x1b0_ballCameraBoostYawSpeed; - f32 x1b4_ballCameraBoostAnglePerSecond; + float x198_ballCameraChaseSpringConstant; + float x19c_ballCameraChaseSpringMax; + float x1a0_ballCameraChaseSpringTardis; + float x1a4_ballCameraBoostElevation; + float x1a8_ballCameraBoostDampenAngle; + float x1ac_ballCameraBoostDistance; + float x1b0_ballCameraBoostYawSpeed; + float x1b4_ballCameraBoostAnglePerSecond; CVector3f x1b8_ballCameraBoostLookAtOffset; - f32 x1c4_ballCameraBoostSpringConstant; - f32 x1c8_ballCameraBoostSpringMax; - f32 x1cc_ballCameraBoostSpringTardis; - f32 x1d0_ballCameraControlDistance; - f32 x1d4_; - f32 x1d8_; - f32 x1dc_minimumAlignmentSpeed; - f32 x1e0_tireness; - f32 x1ec_maxLeanAngle; - f32 x1f0_tireToMarbleThresholdSpeed; - f32 x1f4_marbleToTireThresholdSpeed; - f32 x1f8_forceToLeanGain; - f32 x1fc_leanTrackingGain; - f32 x1e4_leftStickDivisor; - f32 x1e8_rightStickDivisor; - f32 x200_; - f32 x204_ballTouchRadius; - f32 x208_; - f32 x20c_boostBallDrainTime; - f32 x218_boostBallMinChargeTime; - f32 x21c_boostBallMinRelativeSpeedForDamage; - f32 x220_boostBallChargeTime0; - f32 x224_boostBallChargeTime1; - f32 x228_boostBallChargeTime2; - f32 x210_boostBallMaxChargeTime; - f32 x22c_boostBallIncrementalSpeed0; - f32 x230_boostBallIncrementalSpeed1; - f32 x234_boostBallIncrementalSpeed2; + float x1c4_ballCameraBoostSpringConstant; + float x1c8_ballCameraBoostSpringMax; + float x1cc_ballCameraBoostSpringTardis; + float x1d0_ballCameraControlDistance; + float x1d4_; + float x1d8_; + float x1dc_minimumAlignmentSpeed; + float x1e0_tireness; + float x1ec_maxLeanAngle; + float x1f0_tireToMarbleThresholdSpeed; + float x1f4_marbleToTireThresholdSpeed; + float x1f8_forceToLeanGain; + float x1fc_leanTrackingGain; + float x1e4_leftStickDivisor; + float x1e8_rightStickDivisor; + float x200_; + float x204_ballTouchRadius; + float x208_; + float x20c_boostBallDrainTime; + float x218_boostBallMinChargeTime; + float x21c_boostBallMinRelativeSpeedForDamage; + float x220_boostBallChargeTime0; + float x224_boostBallChargeTime1; + float x228_boostBallChargeTime2; + float x210_boostBallMaxChargeTime; + float x22c_boostBallIncrementalSpeed0; + float x230_boostBallIncrementalSpeed1; + float x234_boostBallIncrementalSpeed2; }; extern CTweakBall* gpTweakBall; diff --git a/include/MetroidPrime/Tweaks/CTweakGame.hpp b/include/MetroidPrime/Tweaks/CTweakGame.hpp index b27a037c..f2fc498b 100644 --- a/include/MetroidPrime/Tweaks/CTweakGame.hpp +++ b/include/MetroidPrime/Tweaks/CTweakGame.hpp @@ -14,45 +14,45 @@ public: const rstl::string& GetWorldPrefix() { return x4_worldPrefix; } const rstl::string& GetDefaultRoom() const { return x14_defaultRoom; } bool GetSplashScreensDisabled() const { return x2b_splashScreensDisabled; } - f32 GetFirstPersonFOV() const { return x24_fov; } - f32 GetPressStartDelay() const { return x30_pressStartDelay; } - f32 GetWavecapIntensityNormal() const { return x34_wavecapIntensityNormal; } - f32 GetWavecapIntensityPoison() const { return x38_wavecapIntensityPoison; } - f32 GetWavecapIntensityLava() const { return x3c_wavecapIntensityLava; } - f32 GetRippleIntensityNormal() const { return x40_rippleIntensityNormal; } - f32 GetRippleIntensityPoison() const { return x44_rippleIntensityPoison; } - f32 GetRippleIntensityLava() const { return x48_rippleIntensityLava; } - f32 GetFluidEnvBumpScale() const { return x4c_fluidEnvBumpScale; } - f32 GetWaterFogDistanceBase() const { return x50_waterFogDistanceBase; } - f32 GetWaterFogDistanceRange() const { return x54_waterFogDistanceRange; } - f32 GetGravityWaterFogDistanceBase() const { return x58_gravityWaterFogDistanceBase; } - f32 GetGravityWaterFogDistanceRange() const { return x5c_gravityWaterFogDistanceRange; } - f32 GetHardModeDamageMultiplier() const { return x60_hardmodeDamageMult; } - f32 GetHardModeWeaponMultiplier() const { return x64_hardmodeWeaponMult; } + float GetFirstPersonFOV() const { return x24_fov; } + float GetPressStartDelay() const { return x30_pressStartDelay; } + float GetWavecapIntensityNormal() const { return x34_wavecapIntensityNormal; } + float GetWavecapIntensityPoison() const { return x38_wavecapIntensityPoison; } + float GetWavecapIntensityLava() const { return x3c_wavecapIntensityLava; } + float GetRippleIntensityNormal() const { return x40_rippleIntensityNormal; } + float GetRippleIntensityPoison() const { return x44_rippleIntensityPoison; } + float GetRippleIntensityLava() const { return x48_rippleIntensityLava; } + float GetFluidEnvBumpScale() const { return x4c_fluidEnvBumpScale; } + float GetWaterFogDistanceBase() const { return x50_waterFogDistanceBase; } + float GetWaterFogDistanceRange() const { return x54_waterFogDistanceRange; } + float GetGravityWaterFogDistanceBase() const { return x58_gravityWaterFogDistanceBase; } + float GetGravityWaterFogDistanceRange() const { return x5c_gravityWaterFogDistanceRange; } + float GetHardModeDamageMultiplier() const { return x60_hardmodeDamageMult; } + float GetHardModeWeaponMultiplier() const { return x64_hardmodeWeaponMult; } private: rstl::string x4_worldPrefix; rstl::string x14_defaultRoom; - f32 x24_fov; + float x24_fov; bool x28_unknown1; bool x29_unknown2; bool x2a_unknown3; bool x2b_splashScreensDisabled; - f32 x2c_unknown5; - f32 x30_pressStartDelay; - f32 x34_wavecapIntensityNormal; - f32 x38_wavecapIntensityPoison; - f32 x3c_wavecapIntensityLava; - f32 x40_rippleIntensityNormal; - f32 x44_rippleIntensityPoison; - f32 x48_rippleIntensityLava; - f32 x4c_fluidEnvBumpScale; - f32 x50_waterFogDistanceBase; - f32 x54_waterFogDistanceRange; - f32 x58_gravityWaterFogDistanceBase; - f32 x5c_gravityWaterFogDistanceRange; - f32 x60_hardmodeDamageMult; - f32 x64_hardmodeWeaponMult; + float x2c_unknown5; + float x30_pressStartDelay; + float x34_wavecapIntensityNormal; + float x38_wavecapIntensityPoison; + float x3c_wavecapIntensityLava; + float x40_rippleIntensityNormal; + float x44_rippleIntensityPoison; + float x48_rippleIntensityLava; + float x4c_fluidEnvBumpScale; + float x50_waterFogDistanceBase; + float x54_waterFogDistanceRange; + float x58_gravityWaterFogDistanceBase; + float x5c_gravityWaterFogDistanceRange; + float x60_hardmodeDamageMult; + float x64_hardmodeWeaponMult; }; extern CTweakGame* gpTweakGame; diff --git a/include/MetroidPrime/Tweaks/CTweakPlayer.hpp b/include/MetroidPrime/Tweaks/CTweakPlayer.hpp index d3be2635..9ed7e29c 100644 --- a/include/MetroidPrime/Tweaks/CTweakPlayer.hpp +++ b/include/MetroidPrime/Tweaks/CTweakPlayer.hpp @@ -12,74 +12,74 @@ public: ~CTweakPlayer() override; // TODO CPlayer::ESurfaceRestraints - f32 GetMaxTranslationalAcceleration(int s) const { return x4_maxTranslationalAcceleration[s]; } - f32 GetMaxRotationalAcceleration(int s) const { return x24_maxRotationalAcceleration[s]; } - f32 GetPlayerTranslationFriction(int s) const { return x44_translationFriction[s]; } - f32 GetPlayerRotationFriction(int s) const { return x64_rotationFriction[s]; } - f32 GetPlayerRotationMaxSpeed(int s) const { return x84_rotationMaxSpeed[s]; } - f32 GetPlayerTranslationMaxSpeed(int s) const { return xa4_translationMaxSpeed[s]; } - f32 GetNormalGravAccel() const { return xc4_normalGravAccel; } - f32 GetFluidGravAccel() const { return xc8_fluidGravAccel; } - f32 GetVerticalJumpAccel() const { return xcc_verticalJumpAccel; } - f32 GetHorizontalJumpAccel() const { return xd0_horizontalJumpAccel; } - f32 GetVerticalDoubleJumpAccel() const { return xd4_verticalDoubleJumpAccel; } - f32 GetHorizontalDoubleJumpAccel() const { return xd8_horizontalDoubleJumpAccel; } - f32 GetWaterJumpFactor() const { return xdc_waterJumpFactor; } - f32 GetWaterBallJumpFactor() const { return xe0_waterBallJumpFactor; } - f32 GetLavaJumpFactor() const { return xe4_lavaJumpFactor; } - f32 GetLavaBallJumpFactor() const { return xe8_lavaBallJumpFactor; } - f32 GetPhazonJumpFactor() const { return xec_phazonJumpFactor; } - f32 GetPhazonBallJumpFactor() const { return xf0_phazonBallJumpFactor; } - f32 GetAllowedJumpTime() const { return xf4_allowedJumpTime; } - f32 GetAllowedDoubleJumpTime() const { return xf8_allowedDoubleJumpTime; } - f32 GetMinDoubleJumpWindow() const { return xfc_minDoubleJumpWindow; } - f32 GetMaxDoubleJumpWindow() const { return x100_maxDoubleJumpWindow; } - f32 GetMinJumpTime() const { return x108_minJumpTime; } - f32 GetMinDoubleJumpTime() const { return x10c_minDoubleJumpTime; } - f32 GetAllowedLedgeTime() const { return x110_allowedLedgeTime; } - f32 GetDoubleJumpImpulse() const { return x114_doubleJumpImpulse; } - f32 GetBackwardsForceMultiplier() const { return x118_backwardsForceMultiplier; } - f32 GetBombJumpRadius() const { return x11c_bombJumpRadius; } - f32 GetBombJumpHeight() const { return x120_bombJumpHeight; } - f32 GetEyeOffset() const { return x124_eyeOffset; } - f32 GetTurnSpeedMultiplier() const { return x128_turnSpeedMultiplier; } - f32 GetFreeLookTurnSpeedMultiplier() const { return x12c_freeLookTurnSpeedMultiplier; } - f32 GetFreeLookSpeed() const { return x138_freeLookSpeed; } - f32 GetFreeLookSnapSpeed() const { return x13c_freeLookSnapSpeed; } - f32 GetFreeLookCenteredThresholdAngle() const { return x144_freeLookCenteredThresholdAngle; } - f32 GetFreeLookCenteredTime() const { return x148_freeLookCenteredTime; } - f32 GetOrbitModeTimer() const { return x180_orbitModeTimer; } - f32 GetOrbitUpperAngle() const { return x188_orbitUpperAngle; } - f32 GetOrbitLowerAngle() const { return x18c_orbitLowerAngle; } - f32 GetOrbitHorizAngle() const { return x190_orbitHorizAngle; } - f32 GetOrbitMaxTargetDistance() const { return x19c_orbitMaxTargetDistance; } - f32 GetOrbitMaxLockDistance() const { return x1a0_orbitMaxLockDistance; } - f32 GetOrbitDistanceThreshold() const { return x1a4_orbitDistanceThreshold; } + float GetMaxTranslationalAcceleration(int s) const { return x4_maxTranslationalAcceleration[s]; } + float GetMaxRotationalAcceleration(int s) const { return x24_maxRotationalAcceleration[s]; } + float GetPlayerTranslationFriction(int s) const { return x44_translationFriction[s]; } + float GetPlayerRotationFriction(int s) const { return x64_rotationFriction[s]; } + float GetPlayerRotationMaxSpeed(int s) const { return x84_rotationMaxSpeed[s]; } + float GetPlayerTranslationMaxSpeed(int s) const { return xa4_translationMaxSpeed[s]; } + float GetNormalGravAccel() const { return xc4_normalGravAccel; } + float GetFluidGravAccel() const { return xc8_fluidGravAccel; } + float GetVerticalJumpAccel() const { return xcc_verticalJumpAccel; } + float GetHorizontalJumpAccel() const { return xd0_horizontalJumpAccel; } + float GetVerticalDoubleJumpAccel() const { return xd4_verticalDoubleJumpAccel; } + float GetHorizontalDoubleJumpAccel() const { return xd8_horizontalDoubleJumpAccel; } + float GetWaterJumpFactor() const { return xdc_waterJumpFactor; } + float GetWaterBallJumpFactor() const { return xe0_waterBallJumpFactor; } + float GetLavaJumpFactor() const { return xe4_lavaJumpFactor; } + float GetLavaBallJumpFactor() const { return xe8_lavaBallJumpFactor; } + float GetPhazonJumpFactor() const { return xec_phazonJumpFactor; } + float GetPhazonBallJumpFactor() const { return xf0_phazonBallJumpFactor; } + float GetAllowedJumpTime() const { return xf4_allowedJumpTime; } + float GetAllowedDoubleJumpTime() const { return xf8_allowedDoubleJumpTime; } + float GetMinDoubleJumpWindow() const { return xfc_minDoubleJumpWindow; } + float GetMaxDoubleJumpWindow() const { return x100_maxDoubleJumpWindow; } + float GetMinJumpTime() const { return x108_minJumpTime; } + float GetMinDoubleJumpTime() const { return x10c_minDoubleJumpTime; } + float GetAllowedLedgeTime() const { return x110_allowedLedgeTime; } + float GetDoubleJumpImpulse() const { return x114_doubleJumpImpulse; } + float GetBackwardsForceMultiplier() const { return x118_backwardsForceMultiplier; } + float GetBombJumpRadius() const { return x11c_bombJumpRadius; } + float GetBombJumpHeight() const { return x120_bombJumpHeight; } + float GetEyeOffset() const { return x124_eyeOffset; } + float GetTurnSpeedMultiplier() const { return x128_turnSpeedMultiplier; } + float GetFreeLookTurnSpeedMultiplier() const { return x12c_freeLookTurnSpeedMultiplier; } + float GetFreeLookSpeed() const { return x138_freeLookSpeed; } + float GetFreeLookSnapSpeed() const { return x13c_freeLookSnapSpeed; } + float GetFreeLookCenteredThresholdAngle() const { return x144_freeLookCenteredThresholdAngle; } + float GetFreeLookCenteredTime() const { return x148_freeLookCenteredTime; } + float GetOrbitModeTimer() const { return x180_orbitModeTimer; } + float GetOrbitUpperAngle() const { return x188_orbitUpperAngle; } + float GetOrbitLowerAngle() const { return x18c_orbitLowerAngle; } + float GetOrbitHorizAngle() const { return x190_orbitHorizAngle; } + float GetOrbitMaxTargetDistance() const { return x19c_orbitMaxTargetDistance; } + float GetOrbitMaxLockDistance() const { return x1a0_orbitMaxLockDistance; } + float GetOrbitDistanceThreshold() const { return x1a4_orbitDistanceThreshold; } uint GetOrbitScreenBoxHalfExtentX(int zone) const { return x1a8_orbitScreenBoxHalfExtentX[zone]; } uint GetOrbitScreenBoxHalfExtentY(int zone) const { return x1b0_orbitScreenBoxHalfExtentY[zone]; } uint GetOrbitScreenBoxCenterX(int zone) const { return x1b8_orbitScreenBoxCenterX[zone]; } uint GetOrbitScreenBoxCenterY(int zone) const { return x1c0_orbitScreenBoxCenterY[zone]; } uint GetOrbitZoneIdealX(int zone) const { return x1c8_orbitZoneIdealX[zone]; } uint GetOrbitZoneIdealY(int zone) const { return x1d0_orbitZoneIdealY[zone]; } - f32 GetOrbitNearX() const { return x1d8_orbitNearX; } - f32 GetOrbitNearZ() const { return x1dc_orbitNearZ; } - f32 GetOrbitFixedOffsetZDiff() const { return x1e8_orbitFixedOffsetZDiff; } - f32 GetOrbitZRange() const { return x1ec_orbitZRange; } + float GetOrbitNearX() const { return x1d8_orbitNearX; } + float GetOrbitNearZ() const { return x1dc_orbitNearZ; } + float GetOrbitFixedOffsetZDiff() const { return x1e8_orbitFixedOffsetZDiff; } + float GetOrbitZRange() const { return x1ec_orbitZRange; } bool GetDashEnabled() const { return x200_24_dashEnabled; } bool GetDashOnButtonRelease() const { return x200_25_dashOnButtonRelease; } - f32 GetDashButtonHoldCancelTime() const { return x204_dashButtonHoldCancelTime; } - f32 GetDashStrafeInputThreshold() const { return x208_dashStrafeInputThreshold; } - f32 GetSidewaysDoubleJumpImpulse() const { return x20c_sidewaysDoubleJumpImpulse; } - f32 GetSidewaysVerticalDoubleJumpAccel() const { return x210_sidewaysVerticalDoubleJumpAccel; } - f32 GetSidewaysHorizontalDoubleJumpAccel() const { + float GetDashButtonHoldCancelTime() const { return x204_dashButtonHoldCancelTime; } + float GetDashStrafeInputThreshold() const { return x208_dashStrafeInputThreshold; } + float GetSidewaysDoubleJumpImpulse() const { return x20c_sidewaysDoubleJumpImpulse; } + float GetSidewaysVerticalDoubleJumpAccel() const { return x210_sidewaysVerticalDoubleJumpAccel; } + float GetSidewaysHorizontalDoubleJumpAccel() const { return x214_sidewaysHorizontalDoubleJumpAccel; } - f32 GetScanningRange() const { return x218_scanningRange; } + float GetScanningRange() const { return x218_scanningRange; } bool GetScanRetention() const { return x21c_24_scanRetention; } bool GetScanFreezesGame() const { return x21c_25_scanFreezesGame; } bool GetOrbitWhileScanning() const { return x21c_26_orbitWhileScanning; } - f32 GetScanMaxTargetDistance() const { return x220_scanMaxTargetDistance; } - f32 GetScanMaxLockDistance() const { return x224_scanMaxLockDistance; } + float GetScanMaxTargetDistance() const { return x220_scanMaxTargetDistance; } + float GetScanMaxLockDistance() const { return x224_scanMaxLockDistance; } bool GetMoveDuringFreeLook() const { return x228_27_moveDuringFreeLook; } bool GetHoldButtonsForFreeLook() const { return x228_28_holdButtonsForFreeLook; } bool GetTwoButtonsForFreeLook() const { return x228_29_twoButtonsForFreeLook; } @@ -93,150 +93,150 @@ public: bool GetFiringCancelsCameraPitch() const { return x22a_26_firingCancelsCameraPitch; } bool GetAssistedAimingIgnoreHorizontal() const { return x22a_27_assistedAimingIgnoreHorizontal; } bool GetAssistedAimingIgnoreVertical() const { return x22a_28_assistedAimingIgnoreVertical; } - f32 GetAimMaxDistance() const { return x234_aimMaxDistance; } - f32 GetAimThresholdDistance() const { return x24c_aimThresholdDistance; } - f32 GetAimBoxWidth() const { return x258_aimBoxWidth; } - f32 GetAimBoxHeight() const { return x25c_aimBoxHeight; } - f32 GetAimTargetTimer() const { return x260_aimTargetTimer; } - f32 GetAimAssistHorizontalAngle() const { return x264_aimAssistHorizontalAngle; } - f32 GetAimAssistVerticalAngle() const { return x268_aimAssistVerticalAngle; } - f32 GetPlayerHeight() const { return x26c_playerHeight; } - f32 GetPlayerXYHalfExtent() const { return x270_playerXYHalfExtent; } - f32 GetStepUpHeight() const { return x274_stepUpHeight; } - f32 GetStepDownHeight() const { return x278_stepDownHeight; } - f32 GetPlayerBallHalfExtent() const { return x27c_playerBallHalfExtent; } - f32 GetOrbitDistanceMax() const { return x2a0_orbitDistanceMax; } - f32 GetGrappleSwingLength() const { return x2a4_grappleSwingLength; } - f32 GetGrappleSwingPeriod() const { return x2a8_grappleSwingPeriod; } - f32 GetGrapplePullSpeedMin() const { return x2ac_grapplePullSpeedMin; } - f32 GetMaxGrappleLockedTurnAlignDistance() const { + float GetAimMaxDistance() const { return x234_aimMaxDistance; } + float GetAimThresholdDistance() const { return x24c_aimThresholdDistance; } + float GetAimBoxWidth() const { return x258_aimBoxWidth; } + float GetAimBoxHeight() const { return x25c_aimBoxHeight; } + float GetAimTargetTimer() const { return x260_aimTargetTimer; } + float GetAimAssistHorizontalAngle() const { return x264_aimAssistHorizontalAngle; } + float GetAimAssistVerticalAngle() const { return x268_aimAssistVerticalAngle; } + float GetPlayerHeight() const { return x26c_playerHeight; } + float GetPlayerXYHalfExtent() const { return x270_playerXYHalfExtent; } + float GetStepUpHeight() const { return x274_stepUpHeight; } + float GetStepDownHeight() const { return x278_stepDownHeight; } + float GetPlayerBallHalfExtent() const { return x27c_playerBallHalfExtent; } + float GetOrbitDistanceMax() const { return x2a0_orbitDistanceMax; } + float GetGrappleSwingLength() const { return x2a4_grappleSwingLength; } + float GetGrappleSwingPeriod() const { return x2a8_grappleSwingPeriod; } + float GetGrapplePullSpeedMin() const { return x2ac_grapplePullSpeedMin; } + float GetMaxGrappleLockedTurnAlignDistance() const { return x2b4_maxGrappleLockedTurnAlignDistance; } - f32 GetGrapplePullSpeedProportion() const { return x2b8_grapplePullSpeedProportion; } - f32 GetGrapplePullSpeedMax() const { return x2bc_grapplePullSpeedMax; } - f32 GetGrappleLookCenterSpeed() const { return x2c0_grappleLookCenterSpeed; } - f32 GetMaxGrappleTurnSpeed() const { return x2c4_maxGrappleTurnSpeed; } - f32 GetGrappleJumpForce() const { return x2c8_grappleJumpForce; } - f32 GetGrappleReleaseTime() const { return x2cc_grappleReleaseTime; } + float GetGrapplePullSpeedProportion() const { return x2b8_grapplePullSpeedProportion; } + float GetGrapplePullSpeedMax() const { return x2bc_grapplePullSpeedMax; } + float GetGrappleLookCenterSpeed() const { return x2c0_grappleLookCenterSpeed; } + float GetMaxGrappleTurnSpeed() const { return x2c4_maxGrappleTurnSpeed; } + float GetGrappleJumpForce() const { return x2c8_grappleJumpForce; } + float GetGrappleReleaseTime() const { return x2cc_grappleReleaseTime; } uint GetGrappleJumpMode() const { return x2d0_grappleJumpMode; } bool GetOrbitReleaseBreaksGrapple() const { return x2d4_orbitReleaseBreaksGrapple; } bool GetInvertGrappleTurn() const { return x2d5_invertGrappleTurn; } - f32 GetGrappleBeamSpeed() const { return x2d8_grappleBeamSpeed; } - f32 GetGrappleBeamXWaveAmplitude() const { return x2dc_grappleBeamXWaveAmplitude; } - f32 GetGrappleBeamZWaveAmplitude() const { return x2e0_grappleBeamZWaveAmplitude; } - f32 GetGrappleBeamAnglePhaseDelta() const { return x2e4_grappleBeamAnglePhaseDelta; } - f32 GetHorizontalFreeLookAngleVel() const { return x130_horizontalFreeLookAngleVel; } - f32 GetVerticalFreeLookAngleVel() const { return x134_verticalFreeLookAngleVel; } - f32 GetOrbitCameraSpeed() const { return x184_orbitCameraSpeed; } - f32 GetOrbitPreventionTime() const { return x1fc_orbitPreventionTime; } + float GetGrappleBeamSpeed() const { return x2d8_grappleBeamSpeed; } + float GetGrappleBeamXWaveAmplitude() const { return x2dc_grappleBeamXWaveAmplitude; } + float GetGrappleBeamZWaveAmplitude() const { return x2e0_grappleBeamZWaveAmplitude; } + float GetGrappleBeamAnglePhaseDelta() const { return x2e4_grappleBeamAnglePhaseDelta; } + float GetHorizontalFreeLookAngleVel() const { return x130_horizontalFreeLookAngleVel; } + float GetVerticalFreeLookAngleVel() const { return x134_verticalFreeLookAngleVel; } + float GetOrbitCameraSpeed() const { return x184_orbitCameraSpeed; } + float GetOrbitPreventionTime() const { return x1fc_orbitPreventionTime; } bool GetFreeLookTurnsPlayer() const { return x228_24_freelookTurnsPlayer; } - f32 GetJumpCameraPitchDownStart() const { return x288_jumpCameraPitchDownStart; } - f32 GetJumpCameraPitchDownFull() const { return x28c_jumpCameraPitchDownFull; } - f32 GetJumpCameraPitchDownAngle() const { return x290_jumpCameraPitchDownAngle; } - f32 GetFallCameraPitchDownStart() const { return x294_fallCameraPitchDownStart; } - f32 GetFallCameraPitchDownFull() const { return x298_fallCameraPitchDownFull; } - f32 GetFallCameraPitchDownAngle() const { return x29c_fallCameraPitchDownAngle; } - f32 GetFirstPersonCameraSpeed() const { return x280_firstPersonCameraSpeed; } - f32 GetGrappleCameraSpeed() const { return x2b0_grappleCameraSpeed; } - f32 GetFreeLookDampenFactor() const { return x14c_freeLookDampenFactor; } - f32 GetLeftAnalogMax() const { return x150_leftDiv; } - f32 GetRightAnalogMax() const { return x154_rightDiv; } - f32 GetOrbitMinDistance(int type) const { return x158_orbitMinDistance[type]; } - f32 GetOrbitNormalDistance(int type) const { return x164_orbitNormalDistance[type]; } - f32 GetOrbitMaxDistance(int type) const { return x170_orbitMaxDistance[type]; } - f32 GetFrozenTimeout() const { return x2f8_frozenTimeout; } + float GetJumpCameraPitchDownStart() const { return x288_jumpCameraPitchDownStart; } + float GetJumpCameraPitchDownFull() const { return x28c_jumpCameraPitchDownFull; } + float GetJumpCameraPitchDownAngle() const { return x290_jumpCameraPitchDownAngle; } + float GetFallCameraPitchDownStart() const { return x294_fallCameraPitchDownStart; } + float GetFallCameraPitchDownFull() const { return x298_fallCameraPitchDownFull; } + float GetFallCameraPitchDownAngle() const { return x29c_fallCameraPitchDownAngle; } + float GetFirstPersonCameraSpeed() const { return x280_firstPersonCameraSpeed; } + float GetGrappleCameraSpeed() const { return x2b0_grappleCameraSpeed; } + float GetFreeLookDampenFactor() const { return x14c_freeLookDampenFactor; } + float GetLeftAnalogMax() const { return x150_leftDiv; } + float GetRightAnalogMax() const { return x154_rightDiv; } + float GetOrbitMinDistance(int type) const { return x158_orbitMinDistance[type]; } + float GetOrbitNormalDistance(int type) const { return x164_orbitNormalDistance[type]; } + float GetOrbitMaxDistance(int type) const { return x170_orbitMaxDistance[type]; } + float GetFrozenTimeout() const { return x2f8_frozenTimeout; } uint GetIceBreakJumpCount() const { return x2fc_iceBreakJumpCount; } - f32 GetVariaDamageReduction() const { return x300_variaDamageReduction; } - f32 GetGravityDamageReduction() const { return x304_gravityDamageReduction; } - f32 GetPhazonDamageReduction() const { return x308_phazonDamageReduction; } + float GetVariaDamageReduction() const { return x300_variaDamageReduction; } + float GetGravityDamageReduction() const { return x304_gravityDamageReduction; } + float GetPhazonDamageReduction() const { return x308_phazonDamageReduction; } private: - f32 x4_maxTranslationalAcceleration[8]; - f32 x24_maxRotationalAcceleration[8]; - f32 x44_translationFriction[8]; - f32 x64_rotationFriction[8]; - f32 x84_rotationMaxSpeed[8]; - f32 xa4_translationMaxSpeed[8]; - f32 xc4_normalGravAccel; - f32 xc8_fluidGravAccel; - f32 xcc_verticalJumpAccel; - f32 xd0_horizontalJumpAccel; - f32 xd4_verticalDoubleJumpAccel; - f32 xd8_horizontalDoubleJumpAccel; - f32 xdc_waterJumpFactor; - f32 xe0_waterBallJumpFactor; - f32 xe4_lavaJumpFactor; - f32 xe8_lavaBallJumpFactor; - f32 xec_phazonJumpFactor; - f32 xf0_phazonBallJumpFactor; - f32 xf4_allowedJumpTime; - f32 xf8_allowedDoubleJumpTime; - f32 xfc_minDoubleJumpWindow; - f32 x100_maxDoubleJumpWindow; - f32 x104_; - f32 x108_minJumpTime; - f32 x10c_minDoubleJumpTime; - f32 x110_allowedLedgeTime; - f32 x114_doubleJumpImpulse; - f32 x118_backwardsForceMultiplier; - f32 x11c_bombJumpRadius; - f32 x120_bombJumpHeight; - f32 x124_eyeOffset; - f32 x128_turnSpeedMultiplier; - f32 x12c_freeLookTurnSpeedMultiplier; - f32 x130_horizontalFreeLookAngleVel; - f32 x134_verticalFreeLookAngleVel; - f32 x138_freeLookSpeed; - f32 x13c_freeLookSnapSpeed; - f32 x140_; - f32 x144_freeLookCenteredThresholdAngle; - f32 x148_freeLookCenteredTime; - f32 x14c_freeLookDampenFactor; - f32 x150_leftDiv; - f32 x154_rightDiv; - f32 x158_orbitMinDistance[3]; - f32 x164_orbitNormalDistance[3]; - f32 x170_orbitMaxDistance[3]; - f32 x17c_; - f32 x180_orbitModeTimer; - f32 x184_orbitCameraSpeed; - f32 x188_orbitUpperAngle; - f32 x18c_orbitLowerAngle; - f32 x190_orbitHorizAngle; - f32 x194_; - f32 x198_; - f32 x19c_orbitMaxTargetDistance; - f32 x1a0_orbitMaxLockDistance; - f32 x1a4_orbitDistanceThreshold; + float x4_maxTranslationalAcceleration[8]; + float x24_maxRotationalAcceleration[8]; + float x44_translationFriction[8]; + float x64_rotationFriction[8]; + float x84_rotationMaxSpeed[8]; + float xa4_translationMaxSpeed[8]; + float xc4_normalGravAccel; + float xc8_fluidGravAccel; + float xcc_verticalJumpAccel; + float xd0_horizontalJumpAccel; + float xd4_verticalDoubleJumpAccel; + float xd8_horizontalDoubleJumpAccel; + float xdc_waterJumpFactor; + float xe0_waterBallJumpFactor; + float xe4_lavaJumpFactor; + float xe8_lavaBallJumpFactor; + float xec_phazonJumpFactor; + float xf0_phazonBallJumpFactor; + float xf4_allowedJumpTime; + float xf8_allowedDoubleJumpTime; + float xfc_minDoubleJumpWindow; + float x100_maxDoubleJumpWindow; + float x104_; + float x108_minJumpTime; + float x10c_minDoubleJumpTime; + float x110_allowedLedgeTime; + float x114_doubleJumpImpulse; + float x118_backwardsForceMultiplier; + float x11c_bombJumpRadius; + float x120_bombJumpHeight; + float x124_eyeOffset; + float x128_turnSpeedMultiplier; + float x12c_freeLookTurnSpeedMultiplier; + float x130_horizontalFreeLookAngleVel; + float x134_verticalFreeLookAngleVel; + float x138_freeLookSpeed; + float x13c_freeLookSnapSpeed; + float x140_; + float x144_freeLookCenteredThresholdAngle; + float x148_freeLookCenteredTime; + float x14c_freeLookDampenFactor; + float x150_leftDiv; + float x154_rightDiv; + float x158_orbitMinDistance[3]; + float x164_orbitNormalDistance[3]; + float x170_orbitMaxDistance[3]; + float x17c_; + float x180_orbitModeTimer; + float x184_orbitCameraSpeed; + float x188_orbitUpperAngle; + float x18c_orbitLowerAngle; + float x190_orbitHorizAngle; + float x194_; + float x198_; + float x19c_orbitMaxTargetDistance; + float x1a0_orbitMaxLockDistance; + float x1a4_orbitDistanceThreshold; uint x1a8_orbitScreenBoxHalfExtentX[2]; uint x1b0_orbitScreenBoxHalfExtentY[2]; uint x1b8_orbitScreenBoxCenterX[2]; uint x1c0_orbitScreenBoxCenterY[2]; uint x1c8_orbitZoneIdealX[2]; uint x1d0_orbitZoneIdealY[2]; - f32 x1d8_orbitNearX; - f32 x1dc_orbitNearZ; - f32 x1e0_; - f32 x1e4_; - f32 x1e8_orbitFixedOffsetZDiff; - f32 x1ec_orbitZRange; - f32 x1f0_; - f32 x1f4_; - f32 x1f8_; - f32 x1fc_orbitPreventionTime; + float x1d8_orbitNearX; + float x1dc_orbitNearZ; + float x1e0_; + float x1e4_; + float x1e8_orbitFixedOffsetZDiff; + float x1ec_orbitZRange; + float x1f0_; + float x1f4_; + float x1f8_; + float x1fc_orbitPreventionTime; bool x200_24_dashEnabled : 1; bool x200_25_dashOnButtonRelease : 1; - f32 x204_dashButtonHoldCancelTime; - f32 x208_dashStrafeInputThreshold; - f32 x20c_sidewaysDoubleJumpImpulse; - f32 x210_sidewaysVerticalDoubleJumpAccel; - f32 x214_sidewaysHorizontalDoubleJumpAccel; - f32 x218_scanningRange; + float x204_dashButtonHoldCancelTime; + float x208_dashStrafeInputThreshold; + float x20c_sidewaysDoubleJumpImpulse; + float x210_sidewaysVerticalDoubleJumpAccel; + float x214_sidewaysHorizontalDoubleJumpAccel; + float x218_scanningRange; bool x21c_24_scanRetention : 1; bool x21c_25_scanFreezesGame : 1; bool x21c_26_orbitWhileScanning : 1; - f32 x220_scanMaxTargetDistance; - f32 x224_scanMaxLockDistance; + float x220_scanMaxTargetDistance; + float x224_scanMaxLockDistance; bool x228_24_freelookTurnsPlayer : 1; bool x228_25_ : 1; bool x228_26_ : 1; @@ -258,63 +258,63 @@ private: bool x22a_26_firingCancelsCameraPitch : 1; bool x22a_27_assistedAimingIgnoreHorizontal : 1; bool x22a_28_assistedAimingIgnoreVertical : 1; - f32 x22c_; - f32 x230_; - f32 x234_aimMaxDistance; - f32 x238_; - f32 x23c_; - f32 x240_; - f32 x244_; - f32 x248_; - f32 x24c_aimThresholdDistance; - f32 x250_; - f32 x254_; - f32 x258_aimBoxWidth; - f32 x25c_aimBoxHeight; - f32 x260_aimTargetTimer; - f32 x264_aimAssistHorizontalAngle; - f32 x268_aimAssistVerticalAngle; - f32 x26c_playerHeight; - f32 x270_playerXYHalfExtent; - f32 x274_stepUpHeight; - f32 x278_stepDownHeight; - f32 x27c_playerBallHalfExtent; - f32 x280_firstPersonCameraSpeed; - f32 x284_; - f32 x288_jumpCameraPitchDownStart; - f32 x28c_jumpCameraPitchDownFull; - f32 x290_jumpCameraPitchDownAngle; - f32 x294_fallCameraPitchDownStart; - f32 x298_fallCameraPitchDownFull; - f32 x29c_fallCameraPitchDownAngle; - f32 x2a0_orbitDistanceMax; - f32 x2a4_grappleSwingLength; - f32 x2a8_grappleSwingPeriod; - f32 x2ac_grapplePullSpeedMin; - f32 x2b0_grappleCameraSpeed; - f32 x2b4_maxGrappleLockedTurnAlignDistance; - f32 x2b8_grapplePullSpeedProportion; - f32 x2bc_grapplePullSpeedMax; - f32 x2c0_grappleLookCenterSpeed; - f32 x2c4_maxGrappleTurnSpeed; - f32 x2c8_grappleJumpForce; - f32 x2cc_grappleReleaseTime; + float x22c_; + float x230_; + float x234_aimMaxDistance; + float x238_; + float x23c_; + float x240_; + float x244_; + float x248_; + float x24c_aimThresholdDistance; + float x250_; + float x254_; + float x258_aimBoxWidth; + float x25c_aimBoxHeight; + float x260_aimTargetTimer; + float x264_aimAssistHorizontalAngle; + float x268_aimAssistVerticalAngle; + float x26c_playerHeight; + float x270_playerXYHalfExtent; + float x274_stepUpHeight; + float x278_stepDownHeight; + float x27c_playerBallHalfExtent; + float x280_firstPersonCameraSpeed; + float x284_; + float x288_jumpCameraPitchDownStart; + float x28c_jumpCameraPitchDownFull; + float x290_jumpCameraPitchDownAngle; + float x294_fallCameraPitchDownStart; + float x298_fallCameraPitchDownFull; + float x29c_fallCameraPitchDownAngle; + float x2a0_orbitDistanceMax; + float x2a4_grappleSwingLength; + float x2a8_grappleSwingPeriod; + float x2ac_grapplePullSpeedMin; + float x2b0_grappleCameraSpeed; + float x2b4_maxGrappleLockedTurnAlignDistance; + float x2b8_grapplePullSpeedProportion; + float x2bc_grapplePullSpeedMax; + float x2c0_grappleLookCenterSpeed; + float x2c4_maxGrappleTurnSpeed; + float x2c8_grappleJumpForce; + float x2cc_grappleReleaseTime; uint x2d0_grappleJumpMode; bool x2d4_orbitReleaseBreaksGrapple; bool x2d5_invertGrappleTurn; - f32 x2d8_grappleBeamSpeed; - f32 x2dc_grappleBeamXWaveAmplitude; - f32 x2e0_grappleBeamZWaveAmplitude; - f32 x2e4_grappleBeamAnglePhaseDelta; - f32 x2e8_; - f32 x2ec_; - f32 x2f0_; + float x2d8_grappleBeamSpeed; + float x2dc_grappleBeamXWaveAmplitude; + float x2e0_grappleBeamZWaveAmplitude; + float x2e4_grappleBeamAnglePhaseDelta; + float x2e8_; + float x2ec_; + float x2f0_; bool x2f4_; - f32 x2f8_frozenTimeout; + float x2f8_frozenTimeout; uint x2fc_iceBreakJumpCount; - f32 x300_variaDamageReduction; - f32 x304_gravityDamageReduction; - f32 x308_phazonDamageReduction; + float x300_variaDamageReduction; + float x304_gravityDamageReduction; + float x308_phazonDamageReduction; }; extern CTweakPlayer* gpTweakPlayer; diff --git a/include/MetroidPrime/Weapons/CAuxWeapon.hpp b/include/MetroidPrime/Weapons/CAuxWeapon.hpp index aadf3391..275c310f 100644 --- a/include/MetroidPrime/Weapons/CAuxWeapon.hpp +++ b/include/MetroidPrime/Weapons/CAuxWeapon.hpp @@ -12,7 +12,7 @@ public: bool IsComboFxActive(const CStateManager& mgr) const; private: - u8 x0_pad[0x84]; + uchar x0_pad[0x84]; }; CHECK_SIZEOF(CAuxWeapon, 0x84) diff --git a/include/MetroidPrime/Weapons/CEnergyProjectile.hpp b/include/MetroidPrime/Weapons/CEnergyProjectile.hpp index 2dc2c258..e9b4dc58 100644 --- a/include/MetroidPrime/Weapons/CEnergyProjectile.hpp +++ b/include/MetroidPrime/Weapons/CEnergyProjectile.hpp @@ -16,7 +16,7 @@ public: // CEntity ~CEnergyProjectile() override; void Accept(IVisitor& visitor) override; - void Think(f32 dt, CStateManager& mgr) override; + void Think(float dt, CStateManager& mgr) override; void AcceptScriptMsg(EScriptObjectMessage msg, TUniqueId uid, CStateManager& mgr) override; // CActor diff --git a/include/MetroidPrime/Weapons/CGameProjectile.hpp b/include/MetroidPrime/Weapons/CGameProjectile.hpp index bf1a5a7f..ff7ee6d9 100644 --- a/include/MetroidPrime/Weapons/CGameProjectile.hpp +++ b/include/MetroidPrime/Weapons/CGameProjectile.hpp @@ -36,7 +36,7 @@ public: private: rstl::optional_object< TLockedToken< CGenDescription > > x158_visorParticle; - u16 x168_visorSfx; + ushort x168_visorSfx; CProjectileWeapon x170_projectile; CVector3f x298_previousPos; float x2a4_projExtent; diff --git a/include/MetroidPrime/Weapons/CGunWeapon.hpp b/include/MetroidPrime/Weapons/CGunWeapon.hpp index 7194aa91..c22bb28f 100644 --- a/include/MetroidPrime/Weapons/CGunWeapon.hpp +++ b/include/MetroidPrime/Weapons/CGunWeapon.hpp @@ -104,7 +104,7 @@ private: rstl::reserved_vector< TCachedToken< CGenDescription >, 2 > x16c_muzzleEffects; rstl::reserved_vector< TCachedToken< CGenDescription >, 2 > x188_frozenEffects; rstl::reserved_vector< rstl::single_ptr< CElementGen >, 2 > x1a4_muzzleGenerators; - u8 x1b0_pad[8]; + uchar x1b0_pad[8]; rstl::single_ptr< CElementGen > x1b8_frozenGenerator; CRainSplashGenerator* x1bc_rainSplashGenerator; EWeaponType x1c0_weaponType; diff --git a/include/MetroidPrime/Weapons/CIceBeam.hpp b/include/MetroidPrime/Weapons/CIceBeam.hpp index bb7a2313..7a38e276 100644 --- a/include/MetroidPrime/Weapons/CIceBeam.hpp +++ b/include/MetroidPrime/Weapons/CIceBeam.hpp @@ -12,7 +12,7 @@ public: ~CIceBeam(); private: - u8 x21c_pad[0x30]; + uchar x21c_pad[0x30]; }; CHECK_SIZEOF(CIceBeam, 0x24c) diff --git a/include/MetroidPrime/Weapons/CPhazonBeam.hpp b/include/MetroidPrime/Weapons/CPhazonBeam.hpp index 24da9c29..7167eac2 100644 --- a/include/MetroidPrime/Weapons/CPhazonBeam.hpp +++ b/include/MetroidPrime/Weapons/CPhazonBeam.hpp @@ -12,7 +12,7 @@ public: ~CPhazonBeam(); private: - u8 x21c_pad[0x60]; + uchar x21c_pad[0x60]; }; CHECK_SIZEOF(CPhazonBeam, 0x27c) diff --git a/include/MetroidPrime/Weapons/CPlasmaBeam.hpp b/include/MetroidPrime/Weapons/CPlasmaBeam.hpp index d201a91d..7b422a00 100644 --- a/include/MetroidPrime/Weapons/CPlasmaBeam.hpp +++ b/include/MetroidPrime/Weapons/CPlasmaBeam.hpp @@ -12,7 +12,7 @@ public: ~CPlasmaBeam(); private: - u8 x21c_pad[0x24]; + uchar x21c_pad[0x24]; }; CHECK_SIZEOF(CPlasmaBeam, 0x240) diff --git a/include/MetroidPrime/Weapons/CPowerBeam.hpp b/include/MetroidPrime/Weapons/CPowerBeam.hpp index cb628501..ca621dfe 100644 --- a/include/MetroidPrime/Weapons/CPowerBeam.hpp +++ b/include/MetroidPrime/Weapons/CPowerBeam.hpp @@ -12,7 +12,7 @@ public: ~CPowerBeam(); private: - u8 x21c_pad[0x2C]; + uchar x21c_pad[0x2C]; }; CHECK_SIZEOF(CPowerBeam, 0x248) diff --git a/include/MetroidPrime/Weapons/CWaveBeam.hpp b/include/MetroidPrime/Weapons/CWaveBeam.hpp index b4e88342..9d6f977e 100644 --- a/include/MetroidPrime/Weapons/CWaveBeam.hpp +++ b/include/MetroidPrime/Weapons/CWaveBeam.hpp @@ -12,7 +12,7 @@ public: ~CWaveBeam(); private: - u8 x21c_pad[0x40]; + uchar x21c_pad[0x40]; }; CHECK_SIZEOF(CWaveBeam, 0x25c) diff --git a/include/MetroidPrime/Weapons/CWeapon.hpp b/include/MetroidPrime/Weapons/CWeapon.hpp index 80ae7878..5f078950 100644 --- a/include/MetroidPrime/Weapons/CWeapon.hpp +++ b/include/MetroidPrime/Weapons/CWeapon.hpp @@ -13,7 +13,7 @@ public: // CEntity ~CWeapon() override; - void Think(f32 dt, CStateManager& mgr) override; + void Think(float dt, CStateManager& mgr) override; // CActor void Render(const CStateManager&) const override; diff --git a/include/MetroidPrime/Weapons/GunController/CGunController.hpp b/include/MetroidPrime/Weapons/GunController/CGunController.hpp index fcda9356..ac021ee7 100644 --- a/include/MetroidPrime/Weapons/GunController/CGunController.hpp +++ b/include/MetroidPrime/Weapons/GunController/CGunController.hpp @@ -25,7 +25,7 @@ class CGunController { CGSFreeLook x4_freeLook; // CGSComboFire x1c_comboFire; // CGSFidget x30_fidget; - u8 x1c_pad[0x34]; + uchar x1c_pad[0x34]; EGunState x50_gunState; int x54_curAnimId; bool x58_24_animDone : 1; diff --git a/include/MetroidPrime/Weapons/WeaponCommon.hpp b/include/MetroidPrime/Weapons/WeaponCommon.hpp index 7b6790f2..61f33c53 100644 --- a/include/MetroidPrime/Weapons/WeaponCommon.hpp +++ b/include/MetroidPrime/Weapons/WeaponCommon.hpp @@ -24,7 +24,7 @@ enum EGunAnimType { kGAT_ToBeam }; -CSfxHandle play_sfx(u16 sfx, bool underwater, bool looped, short pan); +CSfxHandle play_sfx(ushort sfx, bool underwater, bool looped, short pan); void get_token_vector(const CAnimData& animData, int begin, int end, rstl::vector< CToken >& tokensOut, bool preLock); diff --git a/include/Weapons/CDecal.hpp b/include/Weapons/CDecal.hpp index 5f8b44df..cb668c8e 100644 --- a/include/Weapons/CDecal.hpp +++ b/include/Weapons/CDecal.hpp @@ -35,7 +35,7 @@ public: float x8_rotation; }; - static void SetGlobalSeed(u16 seed); + static void SetGlobalSeed(ushort seed); CDecal(const TToken< CDecalDescription >& desc, const CTransform4f& xf); void RenderQuad(CQuadDecal& quad, const CDecalDescription::SQuadDescr& quadDesc) const; diff --git a/include/WorldFormat/CAreaOctTree.hpp b/include/WorldFormat/CAreaOctTree.hpp index 0b1f6e28..afea9d3e 100644 --- a/include/WorldFormat/CAreaOctTree.hpp +++ b/include/WorldFormat/CAreaOctTree.hpp @@ -19,17 +19,17 @@ public: struct SRayResult { CPlane x0_plane; rstl::optional_object< CCollisionSurface > x10_surface; - f32 x3c_t; + float x3c_t; }; class TriListReference { public: - explicit TriListReference(const u16* ptr) : m_ptr(ptr) {} - u16 GetAt(int idx) const { return m_ptr[idx + 1]; } - u16 GetSize() const { return m_ptr[0]; } + explicit TriListReference(const ushort* ptr) : m_ptr(ptr) {} + ushort GetAt(int idx) const { return m_ptr[idx + 1]; } + ushort GetSize() const { return m_ptr[0]; } private: - const u16* m_ptr; + const ushort* m_ptr; }; class Node { @@ -38,35 +38,35 @@ public: Node(const void* ptr, const CAABox& aabb, const CAreaOctTree& owner, ETreeType type) : x0_aabb(aabb) - , x18_ptr(reinterpret_cast< const u8* >(ptr)) + , x18_ptr(reinterpret_cast< const uchar* >(ptr)) , x1c_owner(owner) , x20_nodeType(type) {} - bool LineTest(const CLine& line, const CMaterialFilter& filter, f32 length) const; + bool LineTest(const CLine& line, const CMaterialFilter& filter, float length) const; void LineTestEx(const CLine& line, const CMaterialFilter& filter, SRayResult& res, - f32 length) const; + float length) const; const CAreaOctTree& GetOwner() const { return x1c_owner; } const CAABox& GetBoundingBox() const { return x0_aabb; } - u16 GetChildFlags() const { return *reinterpret_cast< const u16* >(x18_ptr); } + ushort GetChildFlags() const { return *reinterpret_cast< const ushort* >(x18_ptr); } Node GetChild(int idx) const; TriListReference GetTriangleArray() const; ETreeType GetChildType(int idx) const { - u16 flags = *reinterpret_cast< const u16* >(x18_ptr); + ushort flags = *reinterpret_cast< const ushort* >(x18_ptr); return ETreeType((flags >> (2 * idx)) & 0x3); } ETreeType GetTreeType() const { return x20_nodeType; } private: CAABox x0_aabb; - const u8* x18_ptr; + const uchar* x18_ptr; const CAreaOctTree& x1c_owner; ETreeType x20_nodeType; - bool LineTestInternal(const CLine& line, const CMaterialFilter& filter, f32 lT, f32 hT, - f32 maxT, const CVector3f& vec) const; + bool LineTestInternal(const CLine& line, const CMaterialFilter& filter, float lT, float hT, + float maxT, const CVector3f& vec) const; void LineTestExInternal(const CLine& line, const CMaterialFilter& filter, SRayResult& res, - f32 lT, f32 hT, f32 maxT, const CVector3f& dirRecip) const; + float lT, float hT, float maxT, const CVector3f& dirRecip) const; }; // TODO @@ -74,17 +74,17 @@ public: private: CAABox x0_aabb; Node::ETreeType x18_treeType; - const u8* x1c_buf; - const u8* x20_treeBuf; + const uchar* x1c_buf; + const uchar* x20_treeBuf; uint x24_matCount; const uint* x28_materials; - const u8* x2c_vertMats; - const u8* x30_edgeMats; - const u8* x34_polyMats; + const uchar* x2c_vertMats; + const uchar* x30_edgeMats; + const uchar* x34_polyMats; uint x38_edgeCount; const CCollisionEdge* x3c_edges; uint x40_polyCount; - const u16* x44_polyEdges; + const ushort* x44_polyEdges; uint x48_vertCount; const float* x4c_verts; }; diff --git a/include/WorldFormat/CCollidableOBBTreeGroup.hpp b/include/WorldFormat/CCollidableOBBTreeGroup.hpp index 2b664be9..e55931b5 100644 --- a/include/WorldFormat/CCollidableOBBTreeGroup.hpp +++ b/include/WorldFormat/CCollidableOBBTreeGroup.hpp @@ -26,7 +26,7 @@ public: CCollidableOBBTreeGroup(CCollidableOBBTreeGroupContainer* container, const CMaterialList& matList); - u32 GetTableIndex() const override; + uint GetTableIndex() const override; CAABox CalculateAABox(const CTransform4f&) const override; CAABox CalculateLocalAABox() const override; FourCC GetPrimType() const override; diff --git a/include/WorldFormat/CMetroidAreaCollider.hpp b/include/WorldFormat/CMetroidAreaCollider.hpp index a1abf28c..f1b05e71 100644 --- a/include/WorldFormat/CMetroidAreaCollider.hpp +++ b/include/WorldFormat/CMetroidAreaCollider.hpp @@ -15,7 +15,7 @@ public: public: COctreeLeafCache(const CAreaOctTree& octTree); void AddLeaf(const CAreaOctTree::Node& node); - u32 GetNumLeaves() const { return x4_nodeCache.size(); } + uint GetNumLeaves() const { return x4_nodeCache.size(); } bool HasCacheOverflowed() const { return x908_24_overflow; } const CAreaOctTree& GetOctTree() const { return x0_octTree; } rstl::reserved_vector< CAreaOctTree::Node, 64 >::const_iterator begin() const { @@ -45,7 +45,7 @@ public: const CAABox& GetCacheBounds() const { return x0_aabb; } void SetCacheBounds(const CAABox& aabb) { x0_aabb = aabb; } void AddOctreeLeafCache(const CMetroidAreaCollider::COctreeLeafCache& leafCache); - u32 GetNumCaches() const { return x18_leafCaches.size(); } + uint GetNumCaches() const { return x18_leafCaches.size(); } const CMetroidAreaCollider::COctreeLeafCache& GetOctreeLeafCache(int idx) { return x18_leafCaches[idx]; } diff --git a/include/rstl/construction_deferred.hpp b/include/rstl/construction_deferred.hpp index 92595de4..fd05da74 100644 --- a/include/rstl/construction_deferred.hpp +++ b/include/rstl/construction_deferred.hpp @@ -27,7 +27,7 @@ public: T& operator*() { return data(); } private: - u8 x0_data[sizeof(T)]; + uchar x0_data[sizeof(T)]; bool m_valid __attribute__((aligned(4))); void makeValid() { m_valid = true; } diff --git a/include/rstl/list.hpp b/include/rstl/list.hpp index 94707f56..edf451ba 100644 --- a/include/rstl/list.hpp +++ b/include/rstl/list.hpp @@ -25,7 +25,7 @@ private: node* x4_next; union { T* x8_item; - u32 x8_count; + uint x8_count; }; node(node* prev, node* next) : x0_prev(prev), x4_next(next), x8_count(0) {} diff --git a/include/rstl/optional_object.hpp b/include/rstl/optional_object.hpp index 95a7abfb..06abc8aa 100644 --- a/include/rstl/optional_object.hpp +++ b/include/rstl/optional_object.hpp @@ -53,7 +53,7 @@ public: T* operator->() { return &data(); } private: - u8 m_data[sizeof(T)]; + uchar m_data[sizeof(T)]; bool m_valid ATTRIBUTE_ALIGN(4); void assign(const T& item) { diff --git a/include/rstl/red_black_tree.hpp b/include/rstl/red_black_tree.hpp index 64e452b0..14ed0d4c 100644 --- a/include/rstl/red_black_tree.hpp +++ b/include/rstl/red_black_tree.hpp @@ -47,8 +47,8 @@ public: }; private: - u8 x0_; - u8 x1_; + uchar x0_; + uchar x1_; uint x4_; uint x8_; uint xc_; diff --git a/include/rstl/reserved_vector.hpp b/include/rstl/reserved_vector.hpp index 67e435b0..389e2840 100644 --- a/include/rstl/reserved_vector.hpp +++ b/include/rstl/reserved_vector.hpp @@ -10,7 +10,7 @@ namespace rstl { template < typename T, int N > class reserved_vector { int x0_count; - u8 x4_data[N * sizeof(T)]; + uchar x4_data[N * sizeof(T)]; public: typedef pointer_iterator< T, reserved_vector< T, N >, void > iterator; diff --git a/include/rstl/rmemory_allocator.hpp b/include/rstl/rmemory_allocator.hpp index 5ccfddb3..52b55cf8 100644 --- a/include/rstl/rmemory_allocator.hpp +++ b/include/rstl/rmemory_allocator.hpp @@ -15,7 +15,7 @@ struct rmemory_allocator { if (size == 0) { out = nullptr; } else { - out = reinterpret_cast< T* >(new u8[size]); + out = reinterpret_cast< T* >(new uchar[size]); } } // TODO: this fixes a regswap in vector::reserve @@ -25,13 +25,13 @@ struct rmemory_allocator { if (size == 0) { return nullptr; } else { - return reinterpret_cast< T* >(new u8[size]); + return reinterpret_cast< T* >(new uchar[size]); } } template < typename T > static void deallocate(T* ptr) { if (ptr != nullptr) { - delete[] reinterpret_cast< u8* >(ptr); + delete[] reinterpret_cast< uchar* >(ptr); } } }; diff --git a/include/rstl/string.hpp b/include/rstl/string.hpp index 36e26310..9e64308d 100644 --- a/include/rstl/string.hpp +++ b/include/rstl/string.hpp @@ -13,20 +13,20 @@ template < typename _CharTp, typename Traits = char_traits< _CharTp >, typename Alloc = rmemory_allocator > class basic_string { struct COWData { - u32 x0_capacity; - u32 x4_refCount; + uint x0_capacity; + uint x4_refCount; _CharTp* x8_data; }; const _CharTp* x0_ptr; COWData* x4_cow; - u32 x8_size; - u32 _pad; // Alloc? + uint x8_size; + uint _pad; // Alloc? // void internal_allocate(int size) // { - // x4_cow = reinterpret_cast(new u8[size * sizeof(_CharTp) + - // 8]); x0_ptr = x4_cow->x8_data; x4_cow->x0_capacity = u32(size); + // x4_cow = reinterpret_cast(new uchar[size * sizeof(_CharTp) + + // 8]); x0_ptr = x4_cow->x8_data; x4_cow->x0_capacity = uint(size); // x4_cow->x4_refCount = 1; // } @@ -52,7 +52,7 @@ public: // while (*it) // ++it; - // x8_size = u32((it - data) / sizeof(_CharTp)); + // x8_size = uint((it - data) / sizeof(_CharTp)); // } basic_string(const basic_string& str); @@ -75,7 +75,7 @@ public: // } // const _CharTp* it = data; - // u32 len = 0; + // uint len = 0; // while (*it) // { // if (size != -1 && len >= size) diff --git a/include/types.h b/include/types.h index 6c27a93c..35b3f2ae 100644 --- a/include/types.h +++ b/include/types.h @@ -11,6 +11,7 @@ extern "C" { // Dolphin u32 is unsigned long typedef unsigned int uint; +typedef unsigned short ushort; typedef unsigned char uchar; // Pointer to unknown, to be determined at a later date. diff --git a/src/Collision/CMaterialList.cpp b/src/Collision/CMaterialList.cpp index 956927fa..aeb03708 100644 --- a/src/Collision/CMaterialList.cpp +++ b/src/Collision/CMaterialList.cpp @@ -1,6 +1,6 @@ #include "Collision/CMaterialList.hpp" -s32 CMaterialList::BitPosition(u64 flags) { +int CMaterialList::BitPosition(u64 flags) { for (int ret = 0, i = 0; i < 32; ++i) { if ((flags & 1) != 0) { return ret; diff --git a/src/Kyoto/Alloc/CCircularBuffer.cpp b/src/Kyoto/Alloc/CCircularBuffer.cpp index 76fe20cb..c64405c6 100644 --- a/src/Kyoto/Alloc/CCircularBuffer.cpp +++ b/src/Kyoto/Alloc/CCircularBuffer.cpp @@ -15,14 +15,14 @@ bool CCircularBuffer::IsWrappedMemory(int offset, int len) { } void* CCircularBuffer::Alloc(int len) { - u8* ret; + uchar* ret; if ((x8_bufferLen - x10_nextFreeAddr) >= len && !IsWrappedMemory(x10_nextFreeAddr, len)) { - s32 offset = x10_nextFreeAddr; - u8* ptr = (u8*)x4_ptr; + int offset = x10_nextFreeAddr; + uchar* ptr = (uchar*)x4_ptr; x10_nextFreeAddr = offset + len; return ptr + offset; } else if (xc_ >= len && !IsWrappedMemory(0, len)) { - u32 r3 = xc_; + uint r3 = xc_; xc_ = 0; x10_nextFreeAddr = len; x14_ = r3; diff --git a/src/Kyoto/Alloc/CGameAllocator.cpp b/src/Kyoto/Alloc/CGameAllocator.cpp index 64b2d8a7..37de8470 100644 --- a/src/Kyoto/Alloc/CGameAllocator.cpp +++ b/src/Kyoto/Alloc/CGameAllocator.cpp @@ -18,7 +18,7 @@ static inline U1 T_round_up(U2 val, int align) { } CGameAllocator::SGameMemInfo* CGameAllocator::GetMemInfoFromBlockPtr(const void* ptr) const { - return (SGameMemInfo*)((u8*)(ptr) - sizeof(SGameMemInfo)); + return (SGameMemInfo*)((uchar*)(ptr) - sizeof(SGameMemInfo)); } CGameAllocator::CGameAllocator() @@ -85,7 +85,7 @@ void* CGameAllocator::Alloc(size_t size, EHint hint, EScope scope, EType type, if (bVar1) { void* buf = x60_smallAllocPool->Alloc(size); - u32 tmp = x60_smallAllocPool->GetAllocatedSize(); + uint tmp = x60_smallAllocPool->GetAllocatedSize(); if (xac_ < tmp) { xac_ = tmp; static int sLastSmallAllocSize = 0; @@ -255,7 +255,7 @@ void CGameAllocator::ReleaseAll() { while (iter != nullptr) { SGameMemInfo* next = iter->GetNext(); if (iter->IsAllocated()) { - FreeNormalAllocation(((u8*)iter) + sizeof(SGameMemInfo)); + FreeNormalAllocation(((uchar*)iter) + sizeof(SGameMemInfo)); } iter = next; } @@ -286,15 +286,15 @@ IAllocator::SAllocInfo CGameAllocator::GetAllocInfo(const void* ptr) const { }; IAllocator::SMetrics CGameAllocator::GetMetrics() const { - u32 mediumAllocTotalAllocated = + uint mediumAllocTotalAllocated = x74_mediumPool != nullptr ? x74_mediumPool->GetTotalEntries() * 32 : 0; - u32 mediumAllocBlocksAvailable = + uint mediumAllocBlocksAvailable = x74_mediumPool != nullptr ? x74_mediumPool->GetNumBlocksAvailable() : 0; - u32 mediumAllocAllocatedSize = + uint mediumAllocAllocatedSize = x74_mediumPool != nullptr ? x74_mediumPool->GetTotalEntries() - x74_mediumPool->GetNumBlocksAvailable() : 0; - u32 mediumAllocNumAllocs = x74_mediumPool != nullptr ? x74_mediumPool->GetNumAllocs() : 0; + uint mediumAllocNumAllocs = x74_mediumPool != nullptr ? x74_mediumPool->GetNumAllocs() : 0; SMetrics ret(x8_heapSize, x80_, x84_, x88_, x8c_, x90_heapSize2, x94_, x98_, x9c_, xa0_, xa4_, x60_smallAllocPool != nullptr ? x60_smallAllocPool->GetNumAllocs() : 0, x60_smallAllocPool != nullptr ? x60_smallAllocPool->GetAllocatedSize() : 0, @@ -354,7 +354,7 @@ void CGameAllocator::AddFreeEntryToFreeList(SGameMemInfo* info) { } void CGameAllocator::RemoveFreeEntryFromFreeList(SGameMemInfo* memInfo) { - u32 bin = GetFreeBinEntryForSize(memInfo->GetLength()); + uint bin = GetFreeBinEntryForSize(memInfo->GetLength()); SGameMemInfo* curBin = nullptr; SGameMemInfo* binIt = x14_bins[bin]; @@ -377,7 +377,7 @@ static inline bool DoWait(int v) { return (v % 4) == 0; } void CGameAllocator::DumpAllocations() const { GetLargestFreeChunk(); - u32 i = 0; + uint i = 0; SGameMemInfo* iter = xc_first; while (iter != nullptr) { diff --git a/src/Kyoto/Alloc/CSmallAllocPool.cpp b/src/Kyoto/Alloc/CSmallAllocPool.cpp index 710d5ec6..bc3e8a41 100644 --- a/src/Kyoto/Alloc/CSmallAllocPool.cpp +++ b/src/Kyoto/Alloc/CSmallAllocPool.cpp @@ -14,30 +14,30 @@ CSmallAllocPool::CSmallAllocPool(uint len, void* mainData, void* bookKeeping) } void* CSmallAllocPool::FindFree(int len) { - u8* bookKeepingPtr; - s32 size = (s32)len / 2; + uchar* bookKeepingPtr; + int size = (int)len / 2; if (xc_cachedBookKeepingOffset == nullptr) { xc_cachedBookKeepingOffset = x4_bookKeeping; } - u8* curKeepingOffset = static_cast< u8* >(xc_cachedBookKeepingOffset); - bookKeepingPtr = static_cast< u8* >(x4_bookKeeping); - u8* bookKeepingEndPtr = bookKeepingPtr + ((u32)x8_numBlocks >> 1); - u8* curKeepingIter = curKeepingOffset; + uchar* curKeepingOffset = static_cast< uchar* >(xc_cachedBookKeepingOffset); + bookKeepingPtr = static_cast< uchar* >(x4_bookKeeping); + uchar* bookKeepingEndPtr = bookKeepingPtr + ((uint)x8_numBlocks >> 1); + uchar* curKeepingIter = curKeepingOffset; while (true) { - u8* iter; - if (static_cast< u8* >(curKeepingIter)[0] != 0 || curKeepingIter == bookKeepingEndPtr) { + uchar* iter; + if (static_cast< uchar* >(curKeepingIter)[0] != 0 || curKeepingIter == bookKeepingEndPtr) { if (curKeepingIter == bookKeepingEndPtr) { curKeepingIter = bookKeepingPtr; } else { - s32 tmp = static_cast< u8* >(curKeepingIter)[0]; - s32 reg = tmp >> 4; + int tmp = static_cast< uchar* >(curKeepingIter)[0]; + int reg = tmp >> 4; curKeepingIter += (reg / 2); } } else { - u8* tempIter = curKeepingIter + size; + uchar* tempIter = curKeepingIter + size; iter = curKeepingIter + 1; while (iter != curKeepingOffset && iter != bookKeepingEndPtr && iter != tempIter) { - if (static_cast< u8* >(iter)[0] == 0) { + if (static_cast< uchar* >(iter)[0] == 0) { iter++; } else { break; @@ -69,22 +69,22 @@ void* CSmallAllocPool::FindFree(int len) { } void* CSmallAllocPool::Alloc(uint size) { - u32 len = size >= 4 ? len = (size + 3) / 4 : 1; + uint len = size >= 4 ? len = (size + 3) / 4 : 1; if ((len & 1) != 0) { len += 1; } - u8* freePtr = static_cast< u8* >(FindFree(len)); + uchar* freePtr = static_cast< uchar* >(FindFree(len)); if (freePtr == nullptr) { return nullptr; } - s32 sub = len - 2; - u8* bufPtr = GetPtrFromIndex(freePtr - static_cast< u8* >(x4_bookKeeping)); - *static_cast< u8* >(freePtr) = (len << 4) | 0xf; - s32 blockSize = sub / 2; - u8* freePtrIter = freePtr + 1; + int sub = len - 2; + uchar* bufPtr = GetPtrFromIndex(freePtr - static_cast< uchar* >(x4_bookKeeping)); + *static_cast< uchar* >(freePtr) = (len << 4) | 0xf; + int blockSize = sub / 2; + uchar* freePtrIter = freePtr + 1; while (blockSize--) { *freePtrIter = 0xff; ++freePtrIter; @@ -97,20 +97,20 @@ void* CSmallAllocPool::Alloc(uint size) { } bool CSmallAllocPool::Free(const void* arg0) { - s32 temp_r8 = GetIndexFromPtr(arg0); - s32 mask = (temp_r8 & 1) ? 0 : 4; - u32 temp_r9 = (u32)temp_r8 / 2; - s32 temp_r4_2 = GetEntryValue(temp_r9); + int temp_r8 = GetIndexFromPtr(arg0); + int mask = (temp_r8 & 1) ? 0 : 4; + size_t temp_r9 = (size_t)temp_r8 / 2; + long temp_r4_2 = GetEntryValue(temp_r9); temp_r4_2 = (temp_r4_2 >> mask) & 0xF; x18_numBlocksAvailable += temp_r4_2; - s32 var_r5 = temp_r4_2; + int var_r5 = temp_r4_2; x1c_numAllocs -= 1; x14_ = temp_r8; - if ((u32)temp_r8 == (u32)x10_) { + if ((size_t)temp_r8 == (size_t)x10_) { x10_ = -1; } - u8* var_r3 = ((u8*)x4_bookKeeping) + temp_r9; + uchar* var_r3 = ((uchar*)x4_bookKeeping) + temp_r9; while (var_r5 != 0) { *var_r3 = 0; var_r5 -= 2; diff --git a/src/Kyoto/Basics/COsContextDolphin.cpp b/src/Kyoto/Basics/COsContextDolphin.cpp index 8e8de126..0d4f6299 100644 --- a/src/Kyoto/Basics/COsContextDolphin.cpp +++ b/src/Kyoto/Basics/COsContextDolphin.cpp @@ -66,7 +66,8 @@ int COsContext::OpenWindow(const char* title, int x, int y, int w, int h, bool f x0_right = x30_renderMode.viWidth; x4_bottom = x30_renderMode.viHeight; - x2c_frameBufferSize = (u16)((x30_renderMode.fbWidth + 15) & ~15) * x30_renderMode.xfbHeight * 2; + x2c_frameBufferSize = + (ushort)((x30_renderMode.fbWidth + 15) & ~15) * x30_renderMode.xfbHeight * 2; x24_frameBuffer1 = OSAllocFromArenaLo(x2c_frameBufferSize, 32); x28_frameBuffer2 = OSAllocFromArenaLo(x2c_frameBufferSize, 32); x20_arenaLo2 = OSGetArenaLo(); @@ -78,7 +79,7 @@ int COsContext::OpenWindow(const char* title, int x, int y, int w, int h, bool f if (mProgressiveMode) { x30_renderMode.viTVmode = VI_TVMODE_NTSC_PROG; x30_renderMode.xFBmode = VI_XFBMODE_SF; - u8 progressiveFilterPattern[7] = {4, 4, 16, 16, 16, 4, 4}; + uchar progressiveFilterPattern[7] = {4, 4, 16, 16, 16, 4, 4}; memcpy(x30_renderMode.vfilter, progressiveFilterPattern, 7); } VIConfigure(&x30_renderMode); diff --git a/src/Kyoto/Basics/CSWDataDolphin.cpp b/src/Kyoto/Basics/CSWDataDolphin.cpp index 5e962b2b..073392dc 100644 --- a/src/Kyoto/Basics/CSWDataDolphin.cpp +++ b/src/Kyoto/Basics/CSWDataDolphin.cpp @@ -2,7 +2,7 @@ #include "dolphin/os.h" -void CStopwatch::CSWData::Wait(f32 v) const { +void CStopwatch::CSWData::Wait(float v) const { OSTime duration = OSSecondsToTicks(v); OSTime end = OSGetTime() + duration; volatile OSTime current; @@ -16,6 +16,6 @@ void CStopwatch::CSWData::Wait(f32 v) const { bool CStopwatch::CSWData::Initialize() { x0_timerFreq = OS_TIMER_CLOCK; x8_timerFreqO1M = x0_timerFreq / 1000000ll; - x10_timerPeriod = 1.f / static_cast< f32 >(x0_timerFreq); + x10_timerPeriod = 1.f / static_cast< float >(x0_timerFreq); return true; } diff --git a/src/Kyoto/Basics/RAssertDolphin.cpp b/src/Kyoto/Basics/RAssertDolphin.cpp index 92d44a5d..253d0d9d 100644 --- a/src/Kyoto/Basics/RAssertDolphin.cpp +++ b/src/Kyoto/Basics/RAssertDolphin.cpp @@ -89,7 +89,7 @@ void ErrorHandler(OSError code, OSContext* context, int arg1, int arg2) { OSReport("\nAddress: Back Chain LR Save\n"); - u32 stackPtr = context->gpr[1]; + uint stackPtr = context->gpr[1]; bool check; i = 0; while (true) { @@ -101,7 +101,7 @@ void ErrorHandler(OSError code, OSContext* context, int arg1, int arg2) { sprintf(rs_debugger_buffer + j, "0x%08x: BAD PTR\n", stackPtr); break; } - u32* asPtr = (u32*)stackPtr; + uint* asPtr = (uint*)stackPtr; OSReport("0x%08x: 0x%08x 0x%08x\n", stackPtr, *asPtr, asPtr[1]); bufferIndex += diff --git a/src/Kyoto/CCrc32.cpp b/src/Kyoto/CCrc32.cpp index ff64a618..1e93f485 100644 --- a/src/Kyoto/CCrc32.cpp +++ b/src/Kyoto/CCrc32.cpp @@ -37,7 +37,7 @@ static const uint gkCRC32Table[256] = { uint CCRC32::Calculate(const void* data, uint length) { uint checksum = 0xFFFFFFFF; - const s8* buf = static_cast< const s8* >(data); + const char* buf = static_cast< const char* >(data); while ((length--) > 0) { checksum = (checksum >> 8) ^ gkCRC32Table[(checksum ^ *(buf++)) & 0xFF]; } diff --git a/src/Kyoto/CRandom16.cpp b/src/Kyoto/CRandom16.cpp index 600605fa..59b764ee 100644 --- a/src/Kyoto/CRandom16.cpp +++ b/src/Kyoto/CRandom16.cpp @@ -42,7 +42,7 @@ int CRandom16::Next() { return (mSeed >> 16) & 0xffff; } -f32 CRandom16::Float() { +float CRandom16::Float() { int next = Next(); return 1.52590222E-5f * next; } diff --git a/src/Kyoto/Graphics/CCubeMaterial.cpp b/src/Kyoto/Graphics/CCubeMaterial.cpp index 9c0ea1ae..c4ffa0e7 100644 --- a/src/Kyoto/Graphics/CCubeMaterial.cpp +++ b/src/Kyoto/Graphics/CCubeMaterial.cpp @@ -6,7 +6,8 @@ #include -inline void CGX::SetAlphaCompare(GXCompare comp0, u8 ref0, GXAlphaOp op, GXCompare comp1, u8 ref1) { +inline void CGX::SetAlphaCompare(GXCompare comp0, uchar ref0, GXAlphaOp op, GXCompare comp1, + uchar ref1) { uint flags = MaskAndShiftLeft(comp0, 7, 0) | MaskAndShiftLeft(ref0, 0xFF, 3) | MaskAndShiftLeft(op, 7, 11) | MaskAndShiftLeft(comp1, 7, 14) | MaskAndShiftLeft(ref1, 0xFF, 17); @@ -109,7 +110,7 @@ uint HandleAnimatedUV(const uint* uvAnim, GXTexMtx texMtx, GXPTTexMtx ptTexMtx) {0.0f, 0.0f, 0.0f, 1.0f}, }; uint type = SBig(*uvAnim); - const f32* params = reinterpret_cast< const f32* >(uvAnim + 1); + const float* params = reinterpret_cast< const float* >(uvAnim + 1); switch (type) { case 0: { CTransform4f xf = CGraphics::GetViewMatrix().GetQuickInverse().MultiplyIgnoreTranslation( @@ -126,23 +127,23 @@ uint HandleAnimatedUV(const uint* uvAnim, GXTexMtx texMtx, GXPTTexMtx ptTexMtx) return 1; } case 2: { - const f32 f1 = SBig(params[0]); - const f32 f2 = SBig(params[1]); - const f32 f3 = SBig(params[2]); - const f32 f4 = SBig(params[3]); - const f32 seconds = CGraphics::GetSecondsMod900(); + const float f1 = SBig(params[0]); + const float f2 = SBig(params[1]); + const float f3 = SBig(params[2]); + const float f4 = SBig(params[3]); + const float seconds = CGraphics::GetSecondsMod900(); translateMtx[0][3] = f1 + seconds * f3; translateMtx[1][3] = f2 + seconds * f4; CGX::LoadTexMtxImm(translateMtx, texMtx, GX_MTX3x4); return 5; } case 3: { - const f32 f1 = SBig(params[0]); - const f32 f2 = SBig(params[1]); - const f32 seconds = CGraphics::GetSecondsMod900(); - const f32 angle = f1 + seconds * f2; - const f32 asin = CMath::FastSinR(angle); - const f32 acos = CMath::FastCosR(angle); + const float f1 = SBig(params[0]); + const float f2 = SBig(params[1]); + const float seconds = CGraphics::GetSecondsMod900(); + const float angle = f1 + seconds * f2; + const float asin = CMath::FastSinR(angle); + const float acos = CMath::FastCosR(angle); Mtx mtx = { {acos, -asin, 0.f, (1.f - (acos - asin)) * 0.5f}, {asin, acos, 0.f, (1.f - (asin + acos)) * 0.5f}, @@ -153,14 +154,14 @@ uint HandleAnimatedUV(const uint* uvAnim, GXTexMtx texMtx, GXPTTexMtx ptTexMtx) } case 4: case 5: { - const f32 f1 = SBig(params[0]); - const f32 f2 = SBig(params[1]); - const f32 f3 = SBig(params[2]); - const f32 f4 = SBig(params[3]); - const f32 value = (f4 + CGraphics::GetSecondsMod900()) * f1 * f3; - const f32 fmod = CMath::FastFmod(value, 1.f); - const f32 fs = CCast::FtoS(fmod * f2); - const f32 v2 = fs * f3; + const float f1 = SBig(params[0]); + const float f2 = SBig(params[1]); + const float f3 = SBig(params[2]); + const float f4 = SBig(params[3]); + const float value = (f4 + CGraphics::GetSecondsMod900()) * f1 * f3; + const float fmod = CMath::FastFmod(value, 1.f); + const float fs = CCast::FtoS(fmod * f2); + const float v2 = fs * f3; if (type == 4) { translateMtx[0][3] = v2; translateMtx[1][3] = 0.f; @@ -212,11 +213,11 @@ uint HandleAnimatedUV(const uint* uvAnim, GXTexMtx texMtx, GXPTTexMtx ptTexMtx) const CTransform4f& vm = CGraphics::GetViewMatrix(); CTransform4f xf = CGraphics::GetViewMatrix().GetQuickInverse().MultiplyIgnoreTranslation( CGraphics::GetModelMatrix()); - f32 v = SBig(params[0]) / 2.f; - f32 v03 = 0.025f * (vm.Get03() + vm.Get13()) * SBig(params[1]); - f32 v13 = 0.05f * vm.Get23() * SBig(params[1]); - f32 v03f = CMath::FastFmod(v03, 1.f); - f32 v13f = CMath::FastFmod(v13, 1.f); + float v = SBig(params[0]) / 2.f; + float v03 = 0.025f * (vm.Get03() + vm.Get13()) * SBig(params[1]); + float v13 = 0.05f * vm.Get23() * SBig(params[1]); + float v03f = CMath::FastFmod(v03, 1.f); + float v13f = CMath::FastFmod(v13, 1.f); xf.SetTranslation(CVector3f::Zero()); Mtx tmpPtMtx; __memcpy(&tmpPtMtx, &sPtMtx, sizeof(Mtx)); diff --git a/src/Kyoto/Graphics/CGX.cpp b/src/Kyoto/Graphics/CGX.cpp index fb01df6f..c1d1129f 100644 --- a/src/Kyoto/Graphics/CGX.cpp +++ b/src/Kyoto/Graphics/CGX.cpp @@ -13,12 +13,12 @@ static GXVtxDescList sVtxDescList[12]; static GXVtxDescList sVtxDescList[30]; #endif -void CGX::SetNumChans(u8 num) { +void CGX::SetNumChans(uchar num) { sGXState.x4e_numChans = num; sGXState.x4c_flags.numDirty = sGXState.x4e_numChans != sGXState.x4d_prevNumChans; } -void CGX::SetNumTexGens(u8 num) { +void CGX::SetNumTexGens(uchar num) { if (num != sGXState.x4f_numTexGens) { sGXState.x4f_numTexGens = num; GXSetNumTexGens(num); @@ -43,8 +43,8 @@ void CGX::SetChanMatColor(EChannelId channel, const GXColor& color) { void CGX::SetChanCtrl(EChannelId channel, GXBool enable, GXColorSrc ambSrc, GXColorSrc matSrc, GXLightID lights, GXDiffuseFn diffFn, GXAttnFn attnFn) { - u16& state = sGXState.x34_chanCtrls[channel]; - u16 prevFlags = sGXState.x30_prevChanCtrls[channel]; + ushort& state = sGXState.x34_chanCtrls[channel]; + ushort prevFlags = sGXState.x30_prevChanCtrls[channel]; if (lights == GX_LIGHT_NULL) { enable = GX_FALSE; } @@ -56,7 +56,7 @@ void CGX::SetChanCtrl(EChannelId channel, GXBool enable, GXColorSrc ambSrc, GXCo ((flags != prevFlags) << (channel + 1)) | (sGXState.x4c_chanFlags & ~(1 << (channel + 1))); } -void CGX::SetNumTevStages(u8 num) { +void CGX::SetNumTevStages(uchar num) { if (sGXState.x50_numTevStages != num) { sGXState.x50_numTevStages = num; GXSetNumTevStages(num); @@ -179,14 +179,14 @@ void CGX::SetBlendMode(GXBlendMode mode, GXBlendFactor srcFac, GXBlendFactor dst void CGX::SetZMode(bool compareEnable, GXCompare func, bool updateEnable) { // ?? - u8 flags = compareEnable | MaskAndShiftLeft(updateEnable, 0xFF, 1) | (func & 0xFF) << 2; + uchar flags = compareEnable | MaskAndShiftLeft(updateEnable, 0xFF, 1) | (func & 0xFF) << 2; if (flags != sGXState.x52_zmode) { sGXState.x52_zmode = flags; GXSetZMode(compareEnable, func, updateEnable); } } -void CGX::SetAlphaCompare(GXCompare comp0, u8 ref0, GXAlphaOp op, GXCompare comp1, u8 ref1) { +void CGX::SetAlphaCompare(GXCompare comp0, uchar ref0, GXAlphaOp op, GXCompare comp1, uchar ref1) { uint flags = MaskAndShiftLeft(comp0, 7, 0) | MaskAndShiftLeft(ref0, 0xFF, 3) | MaskAndShiftLeft(op, 7, 11) | MaskAndShiftLeft(comp1, 7, 14) | MaskAndShiftLeft(ref1, 0xFF, 17); @@ -240,14 +240,14 @@ void CGX::SetTexCoordGen(GXTexCoordID dstCoord, GXTexGenType fn, GXTexGenSrc src } } -void CGX::SetNumIndStages(u8 num) { +void CGX::SetNumIndStages(uchar num) { if (sGXState.x51_numIndStages != num) { sGXState.x51_numIndStages = num; GXSetNumIndStages(num); } } -void CGX::SetArray(GXAttr attr, const void* data, u8 stride) { +void CGX::SetArray(GXAttr attr, const void* data, uchar stride) { uint idx = attr - GX_VA_POS; if (data == nullptr || sGXState.x0_arrayPtrs[idx] == data) { return; @@ -263,7 +263,7 @@ void CGX::CallDisplayList(const void* ptr, size_t size) { GXCallDisplayList(ptr, size); } -void CGX::Begin(GXPrimitive prim, GXVtxFmt fmt, u16 numVtx) { +void CGX::Begin(GXPrimitive prim, GXVtxFmt fmt, ushort numVtx) { if (sGXState.x4c_chanFlags != 0) { FlushState(); } @@ -272,7 +272,8 @@ void CGX::Begin(GXPrimitive prim, GXVtxFmt fmt, u16 numVtx) { void CGX::End() {} -void CGX::SetFog(GXFogType type, f32 startZ, f32 endZ, f32 nearZ, f32 farZ, const GXColor& color) { +void CGX::SetFog(GXFogType type, float startZ, float endZ, float nearZ, float farZ, + const GXColor& color) { sGXState.x53_fogType = type; sGXState.x24c_fogParams.x0_fogStartZ = startZ; sGXState.x24c_fogParams.x4_fogEndZ = endZ; @@ -282,8 +283,8 @@ void CGX::SetFog(GXFogType type, f32 startZ, f32 endZ, f32 nearZ, f32 farZ, cons apply_fog(); } -void CGX::SetLineWidth(u8 width, GXTexOffset offset) { - u16 flags = width | offset << 8; +void CGX::SetLineWidth(uchar width, GXTexOffset offset) { + ushort flags = width | offset << 8; if (flags != sGXState.x54_lineWidthAndOffset) { sGXState.x54_lineWidthAndOffset = flags; GXSetLineWidth(width, offset); @@ -370,7 +371,7 @@ void CGX::FlushState() { sGXState.x4d_prevNumChans = sGXState.x4e_numChans; } if (sGXState.x4c_chanFlags & 2) { - u16 flags = sGXState.x34_chanCtrls[0]; + ushort flags = sGXState.x34_chanCtrls[0]; GXBool enable = ShiftRightAndMask(flags, 1, 0); GXColorSrc ambSrc = static_cast< GXColorSrc >(ShiftRightAndMask(flags, 1, 1)); GXColorSrc matSrc = static_cast< GXColorSrc >(ShiftRightAndMask(flags, 1, 2)); @@ -381,7 +382,7 @@ void CGX::FlushState() { sGXState.x30_prevChanCtrls[0] = sGXState.x34_chanCtrls[0]; } if (sGXState.x4c_chanFlags & 4) { - u16 flags = sGXState.x34_chanCtrls[1]; + ushort flags = sGXState.x34_chanCtrls[1]; GXBool enable = ShiftRightAndMask(flags, 1, 0); GXColorSrc ambSrc = static_cast< GXColorSrc >(ShiftRightAndMask(flags, 1, 1)); GXColorSrc matSrc = static_cast< GXColorSrc >(ShiftRightAndMask(flags, 1, 2)); @@ -395,11 +396,11 @@ void CGX::FlushState() { } void CGX::SetIndTexMtxSTPointFive(GXIndTexMtxID id, s8 scaleExp) { - static const f32 indMtx[2][3] = { + static const float indMtx[2][3] = { {0.5f, 0.f, 0.f}, {0.f, 0.5f, 0.f}, }; - GXSetIndTexMtx(id, const_cast< f32(*)[3] >(indMtx), scaleExp); + GXSetIndTexMtx(id, const_cast< float(*)[3] >(indMtx), scaleExp); } void CGX::SetVtxDescv_Compressed(uint flags) { @@ -492,8 +493,8 @@ void CGX::SetStandardTevColorAlphaOp(GXTevStageID stageId) { } } -void CGX::GetFog(GXFogType* fogType, f32* fogStartZ, f32* fogEndZ, f32* fogNearZ, f32* fogFarZ, - GXColor* fogColor) { +void CGX::GetFog(GXFogType* fogType, float* fogStartZ, float* fogEndZ, float* fogNearZ, + float* fogFarZ, GXColor* fogColor) { if (fogType != nullptr) { *fogType = static_cast< GXFogType >(sGXState.x53_fogType); } diff --git a/src/Kyoto/Graphics/DolphinCColor.cpp b/src/Kyoto/Graphics/DolphinCColor.cpp index 5e7e36d5..e74bdbf4 100644 --- a/src/Kyoto/Graphics/DolphinCColor.cpp +++ b/src/Kyoto/Graphics/DolphinCColor.cpp @@ -68,24 +68,25 @@ uint CColor::Lerp(uint a, uint b, float t) { } CColor CColor::Modulate(const CColor& a, const CColor& b) { - return CColor( - (u8)((a.GetRedu8() * b.GetRedu8()) / (u8)255), (a.GetGreenu8() * b.GetGreenu8()) / (u8)255, - (a.GetBlueu8() * b.GetBlueu8()) / (u8)255, (a.GetAlphau8() * b.GetAlphau8()) / (u8)255); + return CColor((uchar)((a.GetReduchar() * b.GetReduchar()) / (uchar)255), + (a.GetGreenuchar() * b.GetGreenuchar()) / (uchar)255, + (a.GetBlueuchar() * b.GetBlueuchar()) / (uchar)255, + (a.GetAlphauchar() * b.GetAlphauchar()) / (uchar)255); } CColor CColor::Add(const CColor& arg0, const CColor& arg1) { - return CColor((u8)rstl::min_val< uint >(255, arg0.GetRedu8() + arg1.GetRedu8()), - (u8)rstl::min_val< uint >(255, arg0.GetGreenu8() + arg1.GetGreenu8()), - (u8)rstl::min_val< uint >(255, arg0.GetBlueu8() + arg1.GetBlueu8()), - (u8)rstl::min_val< uint >(255, arg0.GetAlphau8() + arg1.GetAlphau8())); + return CColor((uchar)rstl::min_val< uint >(255, arg0.GetReduchar() + arg1.GetReduchar()), + (uchar)rstl::min_val< uint >(255, arg0.GetGreenuchar() + arg1.GetGreenuchar()), + (uchar)rstl::min_val< uint >(255, arg0.GetBlueuchar() + arg1.GetBlueuchar()), + (uchar)rstl::min_val< uint >(255, arg0.GetAlphauchar() + arg1.GetAlphauchar())); } -u16 CColor::ToRGB5A3() const { - u8 r = GetRedu8(); - u8 g = GetGreenu8(); - u8 b = GetBlueu8(); - u8 a = GetAlphau8(); - u16 ret = (1 << 15) | ((b & 0xf8) >> 3) | ((g & 0xf8) << 2) | ((r & 0xf8) << 7); +ushort CColor::ToRGB5A3() const { + uchar r = GetReduchar(); + uchar g = GetGreenuchar(); + uchar b = GetBlueuchar(); + uchar a = GetAlphauchar(); + ushort ret = (1 << 15) | ((b & 0xf8) >> 3) | ((g & 0xf8) << 2) | ((r & 0xf8) << 7); if (a != 0xFF) { ret = ((a & 0xe0) << 7) | ((b & 0xf0) >> 4) | (g & 0xf0) | ((r & 0xf0) << 4); } diff --git a/src/Kyoto/Input/CDolphinController.cpp b/src/Kyoto/Input/CDolphinController.cpp index 976e3ab2..1e052753 100644 --- a/src/Kyoto/Input/CDolphinController.cpp +++ b/src/Kyoto/Input/CDolphinController.cpp @@ -64,7 +64,7 @@ void CDolphinController::ReadDevices() { if (x1b4_controllerTypePollTime[i] != 0) { --x1b4_controllerTypePollTime[i]; } else { - const u32 type = SIProbe(i); + const uint type = SIProbe(i); if ((type & (SI_ERROR_NO_RESPONSE | SI_ERROR_UNKNOWN | SI_ERROR_BUSY)) != 0) { if (x1b4_controllerTypePollTime[i] == 0) { x1a4_controllerTypes[i] = skTypeUnknown; @@ -136,14 +136,14 @@ void CDolphinController::ProcessAxis(int controller, EJoyAxis axis) { data.SetAbsoluteValue(absolute); } -static u16 mButtonMapping[size_t(kBU_MAX)] = { +static ushort mButtonMapping[size_t(kBU_MAX)] = { PAD_BUTTON_A, PAD_BUTTON_B, PAD_BUTTON_X, PAD_BUTTON_Y, PAD_BUTTON_START, PAD_TRIGGER_Z, PAD_BUTTON_UP, PAD_BUTTON_RIGHT, PAD_BUTTON_DOWN, PAD_BUTTON_LEFT, PAD_TRIGGER_L, PAD_TRIGGER_R, }; void CDolphinController::ProcessButtons(int controller) { - for (s32 i = 0; i < s32(kBU_MAX); ++i) { + for (int i = 0; i < int(kBU_MAX); ++i) { ProcessDigitalButton(controller, x34_gamepadStates[controller].GetButton(EButton(i)), mButtonMapping[i]); } @@ -155,7 +155,7 @@ void CDolphinController::ProcessButtons(int controller) { } void CDolphinController::ProcessDigitalButton(int controller, CControllerButton& button, - u16 mapping) { + ushort mapping) { bool btnPressed = (x4_status[controller].button & mapping); button.SetPressEvent(PADButtonDown(button.GetIsPressed(), btnPressed)); button.SetReleaseEvent(PADButtonUp(button.GetIsPressed(), btnPressed)); diff --git a/src/Kyoto/Input/CRumbleVoice.cpp b/src/Kyoto/Input/CRumbleVoice.cpp index 912c94e0..c821a8d8 100644 --- a/src/Kyoto/Input/CRumbleVoice.cpp +++ b/src/Kyoto/Input/CRumbleVoice.cpp @@ -8,7 +8,7 @@ CRumbleVoice::CRumbleVoice() , x2c_usedChannels(0) , x2e_lastId(0) {} -s16 CRumbleVoice::Activate(const SAdsrData& data, u16 idx, float gain, ERumblePriority prio) { +short CRumbleVoice::Activate(const SAdsrData& data, ushort idx, float gain, ERumblePriority prio) { if (gain > 0.f) { x0_datas[idx] = data; x10_deltas[idx] = SAdsrDelta::Start(prio, x2c_usedChannels == 0); @@ -21,7 +21,7 @@ s16 CRumbleVoice::Activate(const SAdsrData& data, u16 idx, float gain, ERumblePr return -1; } -void CRumbleVoice::Deactivate(s16 id, bool b1) { +void CRumbleVoice::Deactivate(short id, bool b1) { if (id == -1) return; if (OwnsSustained(id)) { @@ -34,7 +34,7 @@ void CRumbleVoice::Deactivate(s16 id, bool b1) { void CRumbleVoice::HardReset() { x2c_usedChannels = 0; - for (u16 i = 0; i < 4; ++i) { + for (ushort i = 0; i < 4; ++i) { x10_deltas[i] = SAdsrDelta::Stopped(); x20_handleIds[i] = 0; } @@ -117,7 +117,7 @@ bool CRumbleVoice::UpdateChannel(SAdsrDelta& delta, const SAdsrData& data, float } bool CRumbleVoice::Update(float dt) { if (x2c_usedChannels != 0) { - for (u16 i = 0; i < 4; ++i) { + for (ushort i = 0; i < 4; ++i) { if (x2c_usedChannels & (1 << i)) { if (UpdateChannel(x10_deltas[i], x0_datas[i], dt)) { x2c_usedChannels &= ~(1 << i); @@ -131,7 +131,7 @@ bool CRumbleVoice::Update(float dt) { } uint CRumbleVoice::GetFreeChannel() const { - for (u16 i = 0; i < 4; ++i) { + for (ushort i = 0; i < 4; ++i) { if ((x2c_usedChannels & (1 << i)) == 0) { return i; } @@ -158,14 +158,14 @@ float CRumbleVoice::GetIntensity() const { return ret; } -bool CRumbleVoice::OwnsSustained(s16 handle) const { - u16 idx = (((u16)handle >> 8) & 0xff); +bool CRumbleVoice::OwnsSustained(short handle) const { + ushort idx = (((ushort)handle >> 8) & 0xff); if (idx < 4) return x20_handleIds[idx] == (idx & 0xf); return false; } -s16 CRumbleVoice::CreateRumbleHandle(u16 idx) { +short CRumbleVoice::CreateRumbleHandle(ushort idx) { ++x2e_lastId; if (x2e_lastId == 0) x2e_lastId = 1; diff --git a/src/Kyoto/Math/CAABox.cpp b/src/Kyoto/Math/CAABox.cpp index 91d232cd..c77f61b4 100644 --- a/src/Kyoto/Math/CAABox.cpp +++ b/src/Kyoto/Math/CAABox.cpp @@ -164,9 +164,9 @@ CAABox CAABox::GetTransformedAABox(const CTransform4f& xf) const { CVector3f newMax = xf.GetTranslation(); for (int x = 0; x < 3; ++x) { for (int y = 0; y < 3; ++y) { - f32 mul = xf.GetRow(x)[y]; - f32 minMul = mul * GetMinPoint()[y]; - f32 maxMul = mul * GetMaxPoint()[y]; + float mul = xf.GetRow(x)[y]; + float minMul = mul * GetMinPoint()[y]; + float maxMul = mul * GetMaxPoint()[y]; if (minMul < maxMul) { newMin[x] += maxMul; newMax[x] += minMul; @@ -223,7 +223,7 @@ bool CAABox::Invalid() const { return false; } -f32 CAABox::GetVolume() const { +float CAABox::GetVolume() const { CVector3f delta = max - min; return delta.GetX() * delta.GetY() * delta.GetZ(); } @@ -241,13 +241,13 @@ bool CAABox::PointInside(const CVector3f& vec) const { vec.GetY() <= max.GetY() && vec.GetZ() >= min.GetZ() && vec.GetZ() <= max.GetZ(); } -f32 CAABox::DistanceBetween(const CAABox& a, const CAABox& b) { - f32 minX = b.GetMaxPoint().GetX(); - f32 maxX = a.GetMinPoint().GetX(); - f32 minY = b.GetMaxPoint().GetY(); - f32 maxY = a.GetMinPoint().GetY(); - f32 minZ = b.GetMaxPoint().GetZ(); - f32 maxZ = a.GetMinPoint().GetZ(); +float CAABox::DistanceBetween(const CAABox& a, const CAABox& b) { + float minX = b.GetMaxPoint().GetX(); + float maxX = a.GetMinPoint().GetX(); + float minY = b.GetMaxPoint().GetY(); + float maxY = a.GetMinPoint().GetY(); + float minZ = b.GetMaxPoint().GetZ(); + float maxZ = a.GetMinPoint().GetZ(); bool xi = b.GetMinPoint().GetX() < a.GetMaxPoint().GetX() && maxX < minX; bool yi = b.GetMinPoint().GetY() < a.GetMaxPoint().GetY() && maxY < minY; diff --git a/src/Kyoto/Math/CVector2f.cpp b/src/Kyoto/Math/CVector2f.cpp index d2106cf3..e0202a42 100644 --- a/src/Kyoto/Math/CVector2f.cpp +++ b/src/Kyoto/Math/CVector2f.cpp @@ -77,14 +77,14 @@ float CVector2f::Dot(const CVector2f& a, const CVector2f& b) { } CVector2f operator+(const CVector2f& lhs, const CVector2f& rhs) { - f32 x = lhs.GetX() + rhs.GetX(); - f32 y = lhs.GetY() + rhs.GetY(); + float x = lhs.GetX() + rhs.GetX(); + float y = lhs.GetY() + rhs.GetY(); return CVector2f(x, y); } CVector2f operator-(const CVector2f& lhs, const CVector2f& rhs) { - f32 x = lhs.GetX() - rhs.GetX(); - f32 y = lhs.GetY() - rhs.GetY(); + float x = lhs.GetX() - rhs.GetX(); + float y = lhs.GetY() - rhs.GetY(); return CVector2f(x, y); } @@ -93,20 +93,20 @@ bool operator==(const CVector2f& lhs, const CVector2f& rhs) { } CVector2f operator*(const CVector2f& lhs, const float& rhs) { - f32 x = lhs.GetX() * rhs; - f32 y = lhs.GetY() * rhs; + float x = lhs.GetX() * rhs; + float y = lhs.GetY() * rhs; return CVector2f(x, y); } CVector2f operator*(const float& lhs, const CVector2f& rhs) { - f32 x = lhs * rhs.GetX(); - f32 y = lhs * rhs.GetY(); + float x = lhs * rhs.GetX(); + float y = lhs * rhs.GetY(); return CVector2f(x, y); } CVector2f operator/(const CVector2f& lhs, const float& rhs) { float v = 1.f / rhs; - f32 x = lhs.GetX() * v; - f32 y = lhs.GetY() * v; + float x = lhs.GetX() * v; + float y = lhs.GetY() * v; return CVector2f(x, y); } diff --git a/src/Kyoto/Streams/CInputStream.cpp b/src/Kyoto/Streams/CInputStream.cpp index cf7f87a2..14e87ea8 100644 --- a/src/Kyoto/Streams/CInputStream.cpp +++ b/src/Kyoto/Streams/CInputStream.cpp @@ -8,7 +8,7 @@ CInputStream::CInputStream(int len) : x4_blockOffset(0) , x8_blockLen(0) , xc_len(len) -, x10_ptr(new u8[len]) +, x10_ptr(new uchar[len]) , x14_owned(true) , x18_readPosition(0) , x1c_bitWord(0) @@ -18,7 +18,7 @@ CInputStream::CInputStream(const void* ptr, int len, bool owned) : x4_blockOffset(0) , x8_blockLen(len) , xc_len(len) -, x10_ptr(const_cast< u8* >(reinterpret_cast< const u8* >(ptr))) +, x10_ptr(const_cast< uchar* >(reinterpret_cast< const uchar* >(ptr))) , x14_owned(owned) , x18_readPosition(0) , x1c_bitWord(0) @@ -48,12 +48,12 @@ void CInputStream::Get(void* dest, unsigned long len) { blockLen = remain < blockLen ? remain : blockLen; if (blockLen != 0) { - memcpy(reinterpret_cast< u8* >(dest) + readCount, x10_ptr + x4_blockOffset, blockLen); + memcpy(reinterpret_cast< uchar* >(dest) + readCount, x10_ptr + x4_blockOffset, blockLen); remain -= blockLen; readCount += blockLen; x4_blockOffset += blockLen; } else if (remain > 256) { - uint readLen = Read(reinterpret_cast< u8* >(dest) + readCount, remain); + uint readLen = Read(reinterpret_cast< uchar* >(dest) + readCount, remain); remain -= readLen; readCount += readLen; } else { @@ -87,7 +87,7 @@ uint CInputStream::ReadBytes(void* dest, unsigned long len) { } uint sz = curLen < remain ? curLen : remain; - memcpy(reinterpret_cast< u8* >(dest) + curReadLen, x10_ptr + x4_blockOffset, sz); + memcpy(reinterpret_cast< uchar* >(dest) + curReadLen, x10_ptr + x4_blockOffset, sz); curReadLen += sz; curLen -= sz; x4_blockOffset += sz; @@ -144,17 +144,17 @@ uint CInputStream::ReadBits(uint bitCount) { return ret; } -u8 CInputStream::ReadChar() { - static u8 c; - Get(&c, sizeof(u8)); +uchar CInputStream::ReadChar() { + static uchar c; + Get(&c, sizeof(uchar)); return c; } bool CInputStream::ReadBool() { return static_cast< bool >(ReadChar()); } -u16 CInputStream::ReadShort() { - static u16 s; - Get(&s, sizeof(u16)); +ushort CInputStream::ReadShort() { + static ushort s; + Get(&s, sizeof(ushort)); return s; } @@ -170,8 +170,8 @@ u64 CInputStream::ReadLongLong() { return ll; } -f32 CInputStream::ReadFloat() { - static f32 f; - Get(&f, sizeof(f32)); +float CInputStream::ReadFloat() { + static float f; + Get(&f, sizeof(float)); return f; } diff --git a/src/Kyoto/Streams/COutputStream.cpp b/src/Kyoto/Streams/COutputStream.cpp index 90041760..5be8ec84 100644 --- a/src/Kyoto/Streams/COutputStream.cpp +++ b/src/Kyoto/Streams/COutputStream.cpp @@ -7,7 +7,7 @@ COutputStream::COutputStream(int len) : mPosition(0) , mBufLen(len) -, mBufPtr(len > 64 ? new u8[len] : &mScratch[32 - (u32)(mScratch) % 31]) +, mBufPtr(len > 64 ? new uchar[len] : &mScratch[32 - (uint)(mScratch) % 31]) , mNumWrites(0) , mShiftRegister(0) , mShiftRegisterOffset(32) {} @@ -24,20 +24,20 @@ void COutputStream::DoPut(const void* ptr, size_t len) { } mNumWrites += len; - u32 curLen = len; + uint curLen = len; if (mBufLen <= len + mPosition) { - memcpy((u8*)mBufPtr + mPosition, ptr, len); + memcpy((uchar*)mBufPtr + mPosition, ptr, len); mPosition += len; } else { while (curLen != 0) { - u32 count = mBufLen - mPosition; + uint count = mBufLen - mPosition; if (curLen < count) { count = curLen; } if (count == 0) { DoFlush(); } else { - memcpy((u8*)mBufPtr + mPosition, (u8*)ptr + (len - curLen), count); + memcpy((uchar*)mBufPtr + mPosition, (uchar*)ptr + (len - curLen), count); mPosition += count; curLen -= count; } diff --git a/src/Kyoto/Text/CStringTable.cpp b/src/Kyoto/Text/CStringTable.cpp index 6a3aa6a2..c99cacbb 100644 --- a/src/Kyoto/Text/CStringTable.cpp +++ b/src/Kyoto/Text/CStringTable.cpp @@ -30,7 +30,7 @@ CStringTable::CStringTable(CInputStream& in) : x0_stringCount(0), x4_data(NULL) } uint dataLen = in.Get(TType< uint >()); - x4_data = new u8[dataLen]; + x4_data = new uchar[dataLen]; in.ReadBytes(x4_data.get(), dataLen); } diff --git a/src/MetroidPrime/CActor.cpp b/src/MetroidPrime/CActor.cpp index b700c8c6..58eeadb5 100644 --- a/src/MetroidPrime/CActor.cpp +++ b/src/MetroidPrime/CActor.cpp @@ -109,7 +109,7 @@ CAdvancementDeltas CActor::UpdateAnimation(float dt, CStateManager& mgr, bool ad ModelData()->AdvanceParticles(GetTransform(), dt, mgr); UpdateSfxEmitters(); if (HasAnimation()) { - u16 maxVol = xd4_maxVol; + ushort maxVol = xd4_maxVol; int aid = x4_areaId.Value(); const CGameCamera* camera = mgr.GetCameraManager()->GetCurrentCamera(mgr); @@ -191,7 +191,7 @@ void CActor::DoUserAnimEvent(CStateManager& mgr, const CInt32POINode& node, EUse } } -f32 CActor::GetAverageAnimVelocity(int anim) { +float CActor::GetAverageAnimVelocity(int anim) { return HasAnimation() ? GetAnimationData()->GetAverageVelocity(anim) : 0.f; } @@ -336,7 +336,7 @@ void CActor::Render(const CStateManager& mgr) const { if (xe5_29_globalTimeProvider) { RenderInternal(mgr); } else { - const f32 timeSince = CGraphics::GetSecondsMod900() - xbc_time; + const float timeSince = CGraphics::GetSecondsMod900() - xbc_time; CTimeProvider tp(CMath::FastFmod(timeSince, 900.f)); RenderInternal(mgr); } @@ -357,8 +357,8 @@ void CActor::RenderInternal(const CStateManager& mgr) const { CModelData::EWhichModel which = CModelData::GetRenderingModel(mgr); if (which == CModelData::kWM_ThermalHot) { if (GetModelData()->GetSortThermal()) { - u8 addMag; - u8 mulMag = 255; + uchar addMag; + uchar mulMag = 255; if (xd0_damageMag <= 1.f) { mulMag = CCast::ToUint8(xd0_damageMag * 255.f); addMag = 0.f; @@ -368,17 +368,17 @@ void CActor::RenderInternal(const CStateManager& mgr) const { addMag = 255; } - const u8 rgb = mulMag * xb4_drawFlags.GetColor().GetAlphau8(); - CColor mulColor(rgb, rgb, rgb, xb4_drawFlags.GetColor().GetAlphau8()); - CColor addColor(addMag, addMag, addMag, xb4_drawFlags.GetColor().GetAlphau8() / 4); + const uchar rgb = mulMag * xb4_drawFlags.GetColor().GetAlphauchar(); + CColor mulColor(rgb, rgb, rgb, xb4_drawFlags.GetColor().GetAlphauchar()); + CColor addColor(addMag, addMag, addMag, xb4_drawFlags.GetColor().GetAlphauchar() / 4); GetModelData()->RenderThermal(x34_transform, mulColor, addColor, xb4_drawFlags); return; } else if (mgr.GetThermalColdScale2() > 0.0001f && xb4_drawFlags.GetTrans() == 0) { - const f32 scale = rstl::min_val< f32 >( + const float scale = rstl::min_val< float >( (mgr.GetThermalColdScale2() + mgr.GetThermalColdScale1()) * mgr.GetThermalColdScale2(), mgr.GetThermalColdScale2()); - const f32 rgbf = CMath::Clamp(0.f, scale * 255.f, 255.f); - const u8 rgb = CCast::ToUint8(rgbf); + const float rgbf = CMath::Clamp(0.f, scale * 255.f, 255.f); + const uchar rgb = CCast::ToUint8(rgbf); CColor color(rgb, rgb, rgb, 255); CModelFlags flags(xb4_drawFlags, CModelFlags::kT_Two, color); GetModelData()->Render(which, x34_transform, x90_actorLights.get(), flags); diff --git a/src/MetroidPrime/CDamageVulnerability.cpp b/src/MetroidPrime/CDamageVulnerability.cpp index adf2441f..fe0c7ed8 100644 --- a/src/MetroidPrime/CDamageVulnerability.cpp +++ b/src/MetroidPrime/CDamageVulnerability.cpp @@ -25,7 +25,7 @@ const CDamageVulnerability CDamageVulnerability::sPassThroughVulnerability( kVN_PassThrough, kVN_PassThrough, kVN_PassThrough, kVN_PassThrough, kVN_PassThrough, kDT_None); static inline bool is_deflect_direct(EVulnerability vuln) { - return vuln == kVN_Deflect || (EVulnerability(u32(vuln) - u32(kVN_DirectWeak)) < kVN_Deflect) || + return vuln == kVN_Deflect || (EVulnerability(uint(vuln) - uint(kVN_DirectWeak)) < kVN_Deflect) || vuln == kVN_DirectImmune; } @@ -35,7 +35,7 @@ static inline bool is_normal_or_weak(EVulnerability vuln) { static inline bool is_not_deflect(EVulnerability vuln) { return vuln != kVN_Deflect; } CDamageVulnerability::CDamageVulnerability(CInputStream& in) { - u32 propCount = in.ReadLong(); + uint propCount = in.ReadLong(); if (propCount == 11) { for (int i = 0; i < 15; ++i) { x0_normal[i] = EVulnerability(in.ReadLong()); @@ -136,12 +136,12 @@ bool CDamageVulnerability::WeaponHurts(const CWeaponMode& mode, int ignoreDirect return true; } - bool normalHurts = check_hurts(x0_normal[u32(mode.GetType())], ignoreDirect); + bool normalHurts = check_hurts(x0_normal[uint(mode.GetType())], ignoreDirect); bool chargedHurts = (mode.GetType() < kWT_Bomb) - ? check_hurts(x3c_charged[u32(mode.GetType())], ignoreDirect) + ? check_hurts(x3c_charged[uint(mode.GetType())], ignoreDirect) : true; bool comboedHurts = (mode.GetType() < kWT_Bomb) - ? check_hurts(x4c_combo[u32(mode.GetType())], ignoreDirect) + ? check_hurts(x4c_combo[uint(mode.GetType())], ignoreDirect) : true; return (normalHurts && !mode.IsCharged() && !mode.IsComboed()) || @@ -152,7 +152,7 @@ static inline bool check_hits(EVulnerability vuln, int direct) { if (!direct) { return is_not_deflect(vuln); } - if (vuln == kVN_Deflect || ((u32)vuln - kVN_DirectWeak <= kVN_Normal) || + if (vuln == kVN_Deflect || ((uint)vuln - kVN_DirectWeak <= kVN_Normal) || vuln == kVN_DirectImmune) { return false; } @@ -167,11 +167,11 @@ bool CDamageVulnerability::WeaponHits(const CWeaponMode& mode, int checkDirect) return true; } - bool normalHits = check_hits(x0_normal[u32(mode.GetType())], checkDirect); + bool normalHits = check_hits(x0_normal[uint(mode.GetType())], checkDirect); bool chargedHits = - mode.GetType() < kWT_Bomb ? check_hits(x3c_charged[u32(mode.GetType())], checkDirect) : true; + mode.GetType() < kWT_Bomb ? check_hits(x3c_charged[uint(mode.GetType())], checkDirect) : true; bool comboedHits = - mode.GetType() < kWT_Bomb ? check_hits(x4c_combo[u32(mode.GetType())], checkDirect) : true; + mode.GetType() < kWT_Bomb ? check_hits(x4c_combo[uint(mode.GetType())], checkDirect) : true; bool result = false; if ((normalHits && !mode.IsCharged() && !mode.IsComboed()) || (chargedHits && mode.IsCharged()) || (comboedHits && mode.IsComboed())) { @@ -205,14 +205,14 @@ EVulnerability CDamageVulnerability::GetVulnerability(const CWeaponMode& mode, return kVN_Normal; } - EVulnerability vuln = x0_normal[u32(mode.GetType())]; + EVulnerability vuln = x0_normal[uint(mode.GetType())]; EWeaponType type = mode.GetType(); if (mode.IsCharged()) { - vuln = type < kWT_Bomb ? x3c_charged[u32(type)] : kVN_Normal; + vuln = type < kWT_Bomb ? x3c_charged[uint(type)] : kVN_Normal; } if (mode.IsComboed()) { - vuln = type < kWT_Bomb ? x4c_combo[u32(type)] : kVN_Normal; + vuln = type < kWT_Bomb ? x4c_combo[uint(type)] : kVN_Normal; } if (ignoreDirect == 1) { return vuln; diff --git a/src/MetroidPrime/CObjectList.cpp b/src/MetroidPrime/CObjectList.cpp index 8bb9ede9..eca09163 100644 --- a/src/MetroidPrime/CObjectList.cpp +++ b/src/MetroidPrime/CObjectList.cpp @@ -14,7 +14,7 @@ bool CObjectList::IsQualified(CEntity& ent) { return true; } void CObjectList::AddObject(CEntity& ent) { if (IsQualified(ent)) { - s16 next = -1; + short next = -1; if (mFirstId != -1) { mObjects[this->mFirstId].mPrev = ent.GetUniqueId().Value(); next = mFirstId; diff --git a/src/MetroidPrime/CPhysicsActor.cpp b/src/MetroidPrime/CPhysicsActor.cpp index c23adca1..3a88b1d5 100644 --- a/src/MetroidPrime/CPhysicsActor.cpp +++ b/src/MetroidPrime/CPhysicsActor.cpp @@ -8,7 +8,7 @@ CPhysicsActor::CPhysicsActor(TUniqueId uid, bool active, const rstl::string& nam const CEntityInfo& info, const CTransform4f& xf, const CModelData& mData, const CMaterialList& matList, const CAABox& aabb, const SMoverData& moverData, - const CActorParameters& actParams, f32 stepUp, f32 stepDown) + const CActorParameters& actParams, float stepUp, float stepDown) : CActor(uid, active, name, info, xf, mData, matList, actParams, kInvalidUniqueId) , xe8_mass(moverData.x30_mass) , xec_massRecip(moverData.x30_mass > 0.f ? 1.f / moverData.x30_mass : 1.f) diff --git a/src/MetroidPrime/Cameras/CBallCamera.cpp b/src/MetroidPrime/Cameras/CBallCamera.cpp index f4dd501a..27452725 100644 --- a/src/MetroidPrime/Cameras/CBallCamera.cpp +++ b/src/MetroidPrime/Cameras/CBallCamera.cpp @@ -22,8 +22,8 @@ static CMaterialFilter kLineOfSightFilter = CMaterialFilter::MakeIncludeExclude(kLineOfSightIncludeList, kLineOfSightExcludeList); // TODO non-matching -CBallCamera::CBallCamera(TUniqueId uid, TUniqueId watchedId, const CTransform4f& xf, f32 fovY, - f32 nearZ, f32 farZ, f32 aspect) +CBallCamera::CBallCamera(TUniqueId uid, TUniqueId watchedId, const CTransform4f& xf, float fovY, + float nearZ, float farZ, float aspect) : CGameCamera(uid, true, rstl::string_l("Ball Camera"), CEntityInfo(kInvalidAreaId, CEntity::NullConnectionList, kInvalidEditorId), xf, fovY, nearZ, farZ, aspect, watchedId, false, 0) @@ -216,18 +216,18 @@ void CBallCamera::ResetToTweaks(CStateManager& mgr) { } // TODO non-matching -void CBallCamera::SetupColliders(rstl::vector< CCameraCollider >& out, f32 xMag, f32 zMag, - f32 radius, int count, f32 k, f32 max, f32 startAngle) { +void CBallCamera::SetupColliders(rstl::vector< CCameraCollider >& out, float xMag, float zMag, + float radius, int count, float k, float max, float startAngle) { out.reserve(count); - f32 theta = startAngle; + float theta = startAngle; for (int i = 0; i < count; ++i) { - f32 z = cos(theta) * zMag; + float z = cos(theta) * zMag; if (theta > M_PIF / 2.f) { z *= 0.25f; } out.push_back(CCameraCollider(radius, CVector3f(xMag * sin(theta), 0.f, z), CCameraSpring(k, max, 1.f), 1.f)); - theta += 2.f * M_PIF / f32(count); + theta += 2.f * M_PIF / float(count); } } @@ -286,15 +286,15 @@ void CBallCamera::Reset(const CTransform4f& xf, CStateManager& mgr) { } } -void CBallCamera::UpdateCollidersDistances(rstl::vector< CCameraCollider >& colliderList, f32 xMag, - f32 zMag, f32 angOffset) { - f32 theta = angOffset; +void CBallCamera::UpdateCollidersDistances(rstl::vector< CCameraCollider >& colliderList, + float xMag, float zMag, float angOffset) { + float theta = angOffset; for (int i = 0; i < colliderList.size(); ++i) { - f32 z = cosf(theta) * zMag; + float z = cosf(theta) * zMag; if (theta > M_PIF / 2.f) { z *= 0.25f; } - f32 x = CMath::Limit(sinf(theta), 1.f) * xMag; + float x = CMath::Limit(sinf(theta), 1.f) * xMag; CVector3f pos(x, 0.f, z); colliderList[i].SetDesiredPosition(pos); theta += 2.f * M_PIF / colliderList.size(); @@ -304,7 +304,7 @@ void CBallCamera::UpdateCollidersDistances(rstl::vector< CCameraCollider >& coll // TODO non-matching void CBallCamera::UpdateColliders(const CTransform4f& xf, rstl::vector< CCameraCollider >& colliderList, int& idx, - int count, float tolerance, const TEntityList& nearList, f32 dt, + int count, float tolerance, const TEntityList& nearList, float dt, CStateManager& mgr) { if (idx < colliderList.size()) { const CPlayer& player = *mgr.GetPlayer(); @@ -325,14 +325,14 @@ void CBallCamera::UpdateColliders(const CTransform4f& xf, worldPos = colliderList[idx].GetRealPosition(); } CVector3f centerToCollider = worldPos - predictedLookPos; - f32 mag = centerToCollider.Magnitude(); + float mag = centerToCollider.Magnitude(); if (centerToCollider.CanBeNormalized()) { centerToCollider.Normalize(); TUniqueId intersectId = kInvalidUniqueId; const CRayCastResult& result = mgr.RayWorldIntersection( intersectId, predictedLookXf.GetTranslation(), centerToCollider, mag + colliderList[idx].GetRadius(), kLineOfSightFilter, nearList); - f32 t = result.GetTime(); + float t = result.GetTime(); if (result.IsValid()) { worldPos = predictedLookXf.GetTranslation() + centerToCollider * (t - colliderList[idx].GetRadius()); @@ -370,18 +370,18 @@ CBallCamera::CalculateCollidersCentroid(const rstl::vector< CCameraCollider >& c int clearColliders = 0; int prevCol = colliderList.size() - 1; - f32 accumCross = 0.f; - f32 accumX = 0.f; - f32 accumZ = 0.f; + float accumCross = 0.f; + float accumX = 0.f; + float accumZ = 0.f; for (int i = 0; i < colliderList.size(); ++i) { if (colliderList[prevCol].GetOcclusionCount() < 2 && colliderList[i].GetOcclusionCount() < 2) { - f32 scale = colliderList[prevCol].GetScale(); - f32 z0 = scale * colliderList[prevCol].GetPosition().GetZ(); - f32 x0 = scale * colliderList[prevCol].GetPosition().GetX(); - f32 x1 = scale * colliderList[i].GetPosition().GetX(); - f32 z1 = scale * colliderList[i].GetPosition().GetZ(); + float scale = colliderList[prevCol].GetScale(); + float z0 = scale * colliderList[prevCol].GetPosition().GetZ(); + float x0 = scale * colliderList[prevCol].GetPosition().GetX(); + float x1 = scale * colliderList[i].GetPosition().GetX(); + float z1 = scale * colliderList[i].GetPosition().GetZ(); - f32 cross = x0 * z1 - x1 * z0; + float cross = x0 * z1 - x1 * z0; accumCross += cross; accumX += cross * (x1 + x0); accumZ += cross * (z1 + z0); @@ -391,13 +391,13 @@ CBallCamera::CalculateCollidersCentroid(const rstl::vector< CCameraCollider >& c prevCol = i; } - if (static_cast< f32 >(clearColliders) / static_cast< f32 >(colliderList.size()) <= + if (static_cast< float >(clearColliders) / static_cast< float >(colliderList.size()) <= x330_clearColliderThreshold) { return CVector3f(0.f, 1.f, 0.f); } if (accumCross != 0.f) { - f32 baryCross = 3.f * accumCross; + float baryCross = 3.f * accumCross; return CVector3f(accumX / baryCross, 0.f, accumZ / baryCross); } @@ -497,7 +497,7 @@ CBallCamera::CalculateCollidersBoundingBox(const rstl::vector< CCameraCollider > } CVector3f CBallCamera::AvoidGeometryFull(const CTransform4f& xf, const TEntityList& nearList, - f32 dt, CStateManager& mgr) { + float dt, CStateManager& mgr) { UpdateColliders(xf, x264_smallColliders, x2d0_smallColliderIt, x264_smallColliders.size(), 4.f, nearList, dt, mgr); UpdateColliders(xf, x274_mediumColliders, x2d4_mediumColliderIt, x274_mediumColliders.size(), 4.f, @@ -507,7 +507,7 @@ CVector3f CBallCamera::AvoidGeometryFull(const CTransform4f& xf, const TEntityLi return ApplyColliders(); } -CVector3f CBallCamera::AvoidGeometry(const CTransform4f& xf, const TEntityList& nearList, f32 dt, +CVector3f CBallCamera::AvoidGeometry(const CTransform4f& xf, const TEntityList& nearList, float dt, CStateManager& mgr) { switch (x328_avoidGeomCycle) { case 0: @@ -536,15 +536,15 @@ CVector3f CBallCamera::AvoidGeometry(const CTransform4f& xf, const TEntityList& } // TODO non-matching regswaps -bool CBallCamera::DetectCollision(const CVector3f& from, const CVector3f& to, f32 radius, f32& d, - CStateManager& mgr) { +bool CBallCamera::DetectCollision(const CVector3f& from, const CVector3f& to, float radius, + float& d, CStateManager& mgr) { CVector3f delta = to - from; - f32 deltaMag = delta.Magnitude(); + float deltaMag = delta.Magnitude(); CVector3f deltaNorm = delta * (1.f / deltaMag); bool clear = true; if (deltaMag > 0.000001f) { - f32 margin = 2.f * radius; + float margin = 2.f * radius; CAABox aabb = CAABox::MakeMaxInvertedBox(); aabb.AccumulateBounds(from); aabb.AccumulateBounds(to); @@ -571,7 +571,7 @@ bool CBallCamera::DetectCollision(const CVector3f& from, const CVector3f& to, f3 if (clear) { TUniqueId intersectId = kInvalidUniqueId; CCollisionInfo info; - f64 dTmp = deltaMag; + double dTmp = deltaMag; if (CGameCollision::DetectCollision_Cached_Moving( mgr, cache, CCollidableSphere(CSphere(CVector3f::Zero(), radius), CMaterialList(kMT_Solid)), @@ -580,7 +580,7 @@ bool CBallCamera::DetectCollision(const CVector3f& from, const CVector3f& to, f3 CMaterialList(kMT_Solid), CMaterialList(kMT_ProjectilePassthrough, kMT_Player, kMT_Character, kMT_CameraPassthrough)), nearList, deltaNorm, intersectId, info, dTmp)) { - d = static_cast< f32 >(dTmp); + d = static_cast< float >(dTmp); clear = false; } } diff --git a/src/MetroidPrime/Cameras/CCameraFilter.cpp b/src/MetroidPrime/Cameras/CCameraFilter.cpp index 4befceec..db76153c 100644 --- a/src/MetroidPrime/Cameras/CCameraFilter.cpp +++ b/src/MetroidPrime/Cameras/CCameraFilter.cpp @@ -6,15 +6,15 @@ #include "stdlib.h" // FIXME non-matching https://decomp.me/scratch/8N81d -void CCameraFilterPass::DrawWideScreen(const CColor& color, const CTexture* tex, f32 lod) { +void CCameraFilterPass::DrawWideScreen(const CColor& color, const CTexture* tex, float lod) { const rstl::pair< CVector2f, CVector2f > vp = gpRender->SetViewportOrtho(true, -4096.f, 4096.f); - f32 left = vp.first.GetX(); - f32 dVar5 = -((vp.second.GetX() - vp.first.GetX()) * 0.0625f * 9.f - - (vp.second.GetY() - vp.first.GetY())) * - 0.5f; - f32 bottom = vp.first.GetY(); - f32 right = vp.second.GetX(); - f32 top = vp.second.GetY(); + float left = vp.first.GetX(); + float dVar5 = -((vp.second.GetX() - vp.first.GetX()) * 0.0625f * 9.f - + (vp.second.GetY() - vp.first.GetY())) * + 0.5f; + float bottom = vp.first.GetY(); + float right = vp.second.GetX(); + float top = vp.second.GetY(); gpRender->SetDepthReadWrite(false, false); gpRender->SetModelMatrix(CTransform4f::Identity()); if (tex != nullptr) { @@ -25,7 +25,7 @@ void CCameraFilterPass::DrawWideScreen(const CColor& color, const CTexture* tex, { CGraphics::StreamBegin(kP_TriangleStrip); - f32 v = (f32)(rand() % 4000) / 16384.f; + float v = (float)(rand() % 4000) / 16384.f; CGraphics::StreamColor(color); CGraphics::StreamTexcoord(v, 1.f); CGraphics::StreamVertex(CVector3f(left - 10.f, 0.f, bottom + (dVar5 * lod))); @@ -39,7 +39,7 @@ void CCameraFilterPass::DrawWideScreen(const CColor& color, const CTexture* tex, } { CGraphics::StreamBegin(kP_TriangleStrip); - f32 v = (f32)(rand() % 4000) / 16384.f; + float v = (float)(rand() % 4000) / 16384.f; CGraphics::StreamColor(color); CGraphics::StreamTexcoord(v, 0.f); CGraphics::StreamVertex(CVector3f(left - 10.f, 0.f, top)); diff --git a/src/MetroidPrime/Player/CPlayerGun.cpp b/src/MetroidPrime/Player/CPlayerGun.cpp index 2c40aa00..76255344 100644 --- a/src/MetroidPrime/Player/CPlayerGun.cpp +++ b/src/MetroidPrime/Player/CPlayerGun.cpp @@ -69,28 +69,28 @@ static const CPlayerState::EItemType skBeamComboArr[4] = { // ControlMapper::kC_PlasmaBeam, // }; -// constexpr std::array skFromMissileSound{ +// constexpr std::array skFromMissileSound{ // SFXwpn_from_missile_power, // SFXwpn_from_missile_ice, // SFXwpn_from_missile_wave, // SFXwpn_from_missile_plasma, // }; -// constexpr std::array skFromBeamSound{ +// constexpr std::array skFromBeamSound{ // SFXsfx0000, // SFXwpn_from_beam_ice, // SFXwpn_from_beam_wave, // SFXwpn_from_beam_plasma, // }; -// constexpr std::array skToMissileSound{ +// constexpr std::array skToMissileSound{ // SFXwpn_to_missile_power, // SFXwpn_to_missile_ice, // SFXwpn_to_missile_wave, // SFXwpn_to_missile_plasma, // }; -// constexpr std::array skIntoBeamSound{ +// constexpr std::array skIntoBeamSound{ // SFXsfx0000, // SFXwpn_into_beam_ice, // SFXwpn_into_beam_wave, @@ -102,7 +102,7 @@ static const float kChargeFxStart = 1.f / CPlayerState::GetMissileComboChargeFac static const float kChargeAnimStart = 0.25f / CPlayerState::GetMissileComboChargeFactor(); static const float kChargeStart = 0.025f / CPlayerState::GetMissileComboChargeFactor(); -// constexpr std::array skBeamChargeUpSound{ +// constexpr std::array skBeamChargeUpSound{ // SFXwpn_chargeup_power, // SFXwpn_chargeup_ice, // SFXwpn_chargeup_wave, @@ -673,11 +673,11 @@ CPlayerGun::CGunMorph::EMorphEvent CPlayerGun::CGunMorph::Update(float inY, floa } void CPlayerGun::UpdateWeaponFire(float dt, CPlayerState& playerState, CStateManager& mgr) { - u32 oldFiring = x2ec_lastFireButtonStates; + uint oldFiring = x2ec_lastFireButtonStates; x2ec_lastFireButtonStates = x2f4_fireButtonStates; - u32 pressedStates = x2f4_fireButtonStates & (oldFiring ^ x2f4_fireButtonStates); + uint pressedStates = x2f4_fireButtonStates & (oldFiring ^ x2f4_fireButtonStates); x2f0_pressedFireButtonStates = pressedStates; - u32 releasedStates = oldFiring & (oldFiring ^ x2f4_fireButtonStates); + uint releasedStates = oldFiring & (oldFiring ^ x2f4_fireButtonStates); x832_28_readyForShot = false; CPlayer& player = *mgr.Player(); @@ -738,7 +738,7 @@ void CPlayerGun::UpdateWeaponFire(float dt, CPlayerState& playerState, CStateMan player.GetMorphballTransitionState() == CPlayer::kMS_Unmorphed) { if ((pressedStates & 0x2) != 0 && x318_comboAmmoIdx == 0 && (x2f8_stateFlags & 0x2) != 0x2 && x32c_chargePhase == kCP_NotCharging) { - u32 missileCount = playerState.GetItemAmount(CPlayerState::kIT_Missiles); + uint missileCount = playerState.GetItemAmount(CPlayerState::kIT_Missiles); if (x338_nextState != kNS_EnterMissile && x338_nextState != kNS_ExitMissile) { if (playerState.HasPowerUp(CPlayerState::kIT_Missiles) && missileCount > 0) { x300_remainingMissiles = missileCount; diff --git a/src/MetroidPrime/Player/CPlayerState.cpp b/src/MetroidPrime/Player/CPlayerState.cpp index 391db105..b122d9cb 100644 --- a/src/MetroidPrime/Player/CPlayerState.cpp +++ b/src/MetroidPrime/Player/CPlayerState.cpp @@ -86,9 +86,9 @@ CPlayerState::CPlayerState(CInputStream& stream) , x180_scanCompletionRateFirst(0) , x184_scanCompletionRateSecond(0) , x188_staticIntf(5) { - x4_enabledItems = u32(stream.ReadBits(32)); + x4_enabledItems = uint(stream.ReadBits(32)); - const u32 integralHP = u32(stream.ReadBits(32)); + const uint integralHP = uint(stream.ReadBits(32)); xc_health.SetHP(*(float*)(&integralHP)); xc_health.SetKnockbackResistance(kDefaultKnockbackResistance); @@ -118,8 +118,8 @@ CPlayerState::CPlayerState(CInputStream& stream) x170_scanTimes.push_back(rstl::pair< CAssetId, float >(it->first, time)); } - x180_scanCompletionRateFirst = u32(stream.ReadBits(GetBitCount(0x100u))); - x184_scanCompletionRateSecond = u32(stream.ReadBits(GetBitCount(0x100u))); + x180_scanCompletionRateFirst = uint(stream.ReadBits(GetBitCount(0x100u))); + x184_scanCompletionRateSecond = uint(stream.ReadBits(GetBitCount(0x100u))); } void CPlayerState::PutTo(COutputStream& stream) { @@ -155,7 +155,7 @@ void CPlayerState::PutTo(COutputStream& stream) { } void CPlayerState::ReInitializePowerUp(CPlayerState::EItemType type, int capacity) { - x24_powerups[u32(type)].x4_capacity = 0; + x24_powerups[uint(type)].x4_capacity = 0; InitializePowerUp(type, capacity); } @@ -163,8 +163,8 @@ void CPlayerState::InitializePowerUp(CPlayerState::EItemType type, int capacity) if (type < kIT_PowerBeam || type > kIT_Max - 1) return; - CPowerUp& pup = x24_powerups[u32(type)]; - pup.x4_capacity = CMath::Clamp(0, capacity + pup.x4_capacity, kPowerUpMax[u32(type)]); + CPowerUp& pup = x24_powerups[uint(type)]; + pup.x4_capacity = CMath::Clamp(0, capacity + pup.x4_capacity, kPowerUpMax[uint(type)]); pup.x0_amount = rstl::min_val(pup.x0_amount, pup.x4_capacity); if (type >= kIT_PowerSuit && type <= kIT_PhazonSuit) { if (HasPowerUp(kIT_PhazonSuit)) @@ -183,7 +183,7 @@ float CPlayerState::CalculateHealth() { } void CPlayerState::ResetAndIncrPickUp(CPlayerState::EItemType type, int amount) { - x24_powerups[u32(type)].x0_amount = 0; + x24_powerups[uint(type)].x0_amount = 0; IncrPickUp(type, amount); } @@ -270,7 +270,7 @@ uint CPlayerState::GetItemAmount(CPlayerState::EItemType type) const { case kIT_World: case kIT_Spirit: case kIT_Newborn: - return x24_powerups[u32(type)].x0_amount; + return x24_powerups[uint(type)].x0_amount; } return 0; @@ -280,36 +280,36 @@ int CPlayerState::GetItemCapacity(CPlayerState::EItemType type) const { if (type < 0 || kIT_Max - 1 < type) { return 0; } - return x24_powerups[u32(type)].x4_capacity; + return x24_powerups[uint(type)].x4_capacity; } bool CPlayerState::HasPowerUp(CPlayerState::EItemType type) const { if (type < 0 || kIT_Max - 1 < type) { return false; } - return x24_powerups[u32(type)].x4_capacity > 0; + return x24_powerups[uint(type)].x4_capacity > 0; } uint CPlayerState::GetPowerUp(CPlayerState::EItemType type) { if (type < 0 || kIT_Max - 1 < type) { return 0; } - return x24_powerups[u32(type)].x4_capacity; + return x24_powerups[uint(type)].x4_capacity; } void CPlayerState::EnableItem(CPlayerState::EItemType type) { if (HasPowerUp(type)) - x4_enabledItems |= (1 << u32(type)); + x4_enabledItems |= (1 << uint(type)); } void CPlayerState::DisableItem(CPlayerState::EItemType type) { if (HasPowerUp(type)) - x4_enabledItems &= ~(1 << u32(type)); + x4_enabledItems &= ~(1 << uint(type)); } bool CPlayerState::ItemEnabled(CPlayerState::EItemType type) const { if (HasPowerUp(type)) - return (x4_enabledItems & (1 << u32(type))); + return (x4_enabledItems & (1 << uint(type))); return false; } diff --git a/src/MetroidPrime/ScriptObjects/CScriptPlatform.cpp b/src/MetroidPrime/ScriptObjects/CScriptPlatform.cpp index 48958937..010fe9ed 100644 --- a/src/MetroidPrime/ScriptObjects/CScriptPlatform.cpp +++ b/src/MetroidPrime/ScriptObjects/CScriptPlatform.cpp @@ -14,13 +14,13 @@ #ifndef TARGET_PC struct GXData { - u16 cpSRreg; - u16 cpCRreg; + ushort cpSRreg; + ushort cpCRreg; }; extern GXData* __GXData; static inline void write_bp_cmd(u32 cmd) { - GXWGFifo.u8 = GX_LOAD_BP_REG; + GXWGFifo.uchar = GX_LOAD_BP_REG; GXWGFifo.u32 = cmd; __GXData->cpCRreg = 0; } @@ -53,8 +53,8 @@ void CGX::update_fog(uint flags) { CScriptPlatform::CScriptPlatform( TUniqueId uid, const rstl::string& name, const CEntityInfo& info, const CTransform4f& xf, - const CModelData& mData, const CActorParameters& actParams, const CAABox& aabb, f32 speed, - bool detectCollision, f32 xrayAlpha, bool active, const CHealthInfo& hInfo, + const CModelData& mData, const CActorParameters& actParams, const CAABox& aabb, float speed, + bool detectCollision, float xrayAlpha, bool active, const CHealthInfo& hInfo, const CDamageVulnerability& dVuln, const rstl::optional_object< TLockedToken< CCollidableOBBTreeGroupContainer > >& dcln, bool rainSplashes, uint maxRainSplashes, uint rainGenRate) @@ -168,7 +168,7 @@ TEntityList CScriptPlatform::BuildNearListFromRiders(CStateManager& mgr, return result; } -void CScriptPlatform::DecayRiders(rstl::vector< SRiders >& riders, f32 dt, CStateManager& mgr) { +void CScriptPlatform::DecayRiders(rstl::vector< SRiders >& riders, float dt, CStateManager& mgr) { rstl::vector< SRiders >::iterator it = riders.begin(); while (it != riders.end()) { it->x4_decayTimer -= dt; @@ -188,7 +188,7 @@ void CScriptPlatform::DecayRiders(rstl::vector< SRiders >& riders, f32 dt, CStat } // TODO: minor regswap -void CScriptPlatform::MoveRiders(CStateManager& mgr, f32 dt, bool active, +void CScriptPlatform::MoveRiders(CStateManager& mgr, float dt, bool active, rstl::vector< SRiders >& riders, rstl::vector< SRiders >& collidedRiders, const CTransform4f& oldXf, const CTransform4f& newXf, const CVector3f& dragDelta, @@ -232,7 +232,7 @@ void CScriptPlatform::MoveRiders(CStateManager& mgr, f32 dt, bool active, } // TODO non-matching -void CScriptPlatform::PreThink(f32 dt, CStateManager& mgr) { +void CScriptPlatform::PreThink(float dt, CStateManager& mgr) { DecayRiders(x318_riders, dt, mgr); x264_collisionRecoverDelay -= dt; x260_moveDelay -= dt; diff --git a/src/MetroidPrime/ScriptObjects/CScriptSpecialFunction.cpp b/src/MetroidPrime/ScriptObjects/CScriptSpecialFunction.cpp index 37faff36..1684e9c8 100644 --- a/src/MetroidPrime/ScriptObjects/CScriptSpecialFunction.cpp +++ b/src/MetroidPrime/ScriptObjects/CScriptSpecialFunction.cpp @@ -48,7 +48,7 @@ CScriptSpecialFunction::CScriptSpecialFunction( TUniqueId uid, const rstl::string& name, const CEntityInfo& info, const CTransform4f& xf, ESpecialFunction func, const rstl::string& lcName, float f1, float f2, float f3, float f4, const CVector3f& vec, const CColor& col, bool active, const CDamageInfo& dInfo, int aId1, - int aId2, CPlayerState::EItemType itemType, u16 sId1, u16 sId2, u16 sId3) + int aId2, CPlayerState::EItemType itemType, ushort sId1, ushort sId2, ushort sId3) : CActor(uid, active, name, info, xf, CModelData::CModelDataNull(), CMaterialList(), CActorParameters::None(), kInvalidUniqueId) , xe8_function(func) @@ -406,7 +406,7 @@ void CScriptSpecialFunction::AcceptScriptMsg(EScriptObjectMessage msg, TUniqueId } case kSF_BossEnergyBar: { if (msg == kSM_Increment) { - mgr.SetEnergyBarActorInfo(uid, xfc_float1, u32(x100_float2) + 86); + mgr.SetEnergyBarActorInfo(uid, xfc_float1, uint(x100_float2) + 86); } else if (msg == kSM_Decrement) { mgr.SetEnergyBarActorInfo(kInvalidUniqueId, 0.f, 0); } @@ -1070,7 +1070,7 @@ void CScriptSpecialFunction::ThinkActorScale(float dt, CStateManager& mgr) { if (CActor* act = TCastToPtr< CActor >(mgr.ObjectById(uid))) { if (act->HasModelData()) { CVector3f scale = act->GetModelData()->GetScale(); - f32 x, y, z; + float x, y, z; if (deltaScale > 0.f) { x = CMath::Min(deltaScale + scale.GetX(), f2); y = CMath::Min(deltaScale + scale.GetY(), f2); @@ -1100,13 +1100,13 @@ void CScriptSpecialFunction::ThinkPlayerInArea(float dt, CStateManager& mgr) { } } -void CScriptSpecialFunction::AddOrUpdateEmitter(float pitch, CSfxHandle& handle, u16 id, - CVector3f pos, u8 vol) { +void CScriptSpecialFunction::AddOrUpdateEmitter(float pitch, CSfxHandle& handle, ushort id, + CVector3f pos, uchar vol) { if (!handle) { handle = CSfxManager::AddEmitter(id, pos, CVector3f::Zero(), vol, true, true); } else { CSfxManager::UpdateEmitter(handle, pos, CVector3f::Zero(), vol); - CSfxManager::PitchBend(handle, static_cast< s16 >(8192.f * pitch + 8192.f)); + CSfxManager::PitchBend(handle, static_cast< short >(8192.f * pitch + 8192.f)); } } diff --git a/src/MetroidPrime/Weapons/GunController/CGunMotion.cpp b/src/MetroidPrime/Weapons/GunController/CGunMotion.cpp index e8d58c25..f93fd753 100644 --- a/src/MetroidPrime/Weapons/GunController/CGunMotion.cpp +++ b/src/MetroidPrime/Weapons/GunController/CGunMotion.cpp @@ -21,7 +21,7 @@ bool CGunMotion::PlayPasAnim(SamusGun::EAnimationState state, CStateManager& mgr bool bigStrike) { const CPASDatabase& pas = x0_modelData.GetAnimationData()->GetCharacterInfo().GetPASDatabase(); - s32 animId = -1; + int animId = -1; bool loop = true; switch (state) { case SamusGun::kAS_Wander: { diff --git a/src/MetroidPrime/main.cpp b/src/MetroidPrime/main.cpp index 4d9c4f8c..23e63bcb 100644 --- a/src/MetroidPrime/main.cpp +++ b/src/MetroidPrime/main.cpp @@ -75,12 +75,12 @@ unkptr gpDefaultFont; unkptr lbl_805A8C50; unkptr lbl_805A8C54; bool COsContext::mProgressiveMode; -u32 sARAMMemArray[2]; -f32 sInfiniteLoopTime; +uint sARAMMemArray[2]; +float sInfiniteLoopTime; #define GRAPHICS_FIFO_SIZE 0x60000 -static u8 sGraphicsFifo[GRAPHICS_FIFO_SIZE]; -static u8 sMainSpace[sizeof(CMain)]; +static uchar sGraphicsFifo[GRAPHICS_FIFO_SIZE]; +static uchar sMainSpace[sizeof(CMain)]; const char* s0 = "Misc_AGSC"; const char* s1 = "MiscSamus_AGSC"; @@ -161,18 +161,18 @@ void CMain::InitializeSubsystems() { ARQInit(); OSThread* thread = OSGetCurrentThread(); printf("Protecting stack... "); - u8* stackEnd = - reinterpret_cast< u8* >(ALIGN_UP(reinterpret_cast< uintptr_t >(thread->stackEnd), 0x400)); - u8* stackBase = thread->stackBase; + uchar* stackEnd = + reinterpret_cast< uchar* >(ALIGN_UP(reinterpret_cast< uintptr_t >(thread->stackEnd), 0x400)); + uchar* stackBase = thread->stackBase; OSProtectRange(OS_PROTECT_CHAN3, stackEnd, 0x400, OS_PROTECT_CONTROL_NONE); - u8* end = stackBase - 0x2000; - u8* ptr = stackEnd + 0x400; + uchar* end = stackBase - 0x2000; + uchar* ptr = stackEnd + 0x400; for (; ptr < end; ptr += 4) { *reinterpret_cast< int* >(ptr) = UNUSED_STACK_VAL; } - DCFlushRange(stackEnd + 0x400, static_cast< u32 >(end - (stackEnd + 0x400))); + DCFlushRange(stackEnd + 0x400, static_cast< uint >(end - (stackEnd + 0x400))); printf("Stack: 0x%8.8x down to 0x%8.8x\n", thread->stackBase, thread->stackEnd); CElementGen::Initialize(); CAnimData::InitializeCache(); @@ -188,19 +188,19 @@ void CMain::ShutdownSubsystems() { CAnimData::FreeCache(); OSThread* thread = OSGetCurrentThread(); - u8* stackEnd = - reinterpret_cast< u8* >(ALIGN_UP(reinterpret_cast< uintptr_t >(thread->stackEnd), 0x400)); - u8* stackBase = thread->stackBase; + uchar* stackEnd = + reinterpret_cast< uchar* >(ALIGN_UP(reinterpret_cast< uintptr_t >(thread->stackEnd), 0x400)); + uchar* stackBase = thread->stackBase; - u8* ptr = stackEnd + 0x400; - u8* end = stackBase - 0x2000; + uchar* ptr = stackEnd + 0x400; + uchar* end = stackBase - 0x2000; for (; ptr < end; ptr += 4) { - if (*reinterpret_cast< u32* >(ptr) != UNUSED_STACK_VAL) { + if (*reinterpret_cast< uint* >(ptr) != UNUSED_STACK_VAL) { break; } } OSReport("Stack usage: %d bytes (%dk)\n", (int)(stackBase - ptr), - ((u32)((int)stackBase - (int)ptr) / 1024)); + ((uint)((int)stackBase - (int)ptr) / 1024)); } CGameGlobalObjects::CGameGlobalObjects(COsContext& osContext, CMemorySys& memorySys) @@ -217,7 +217,7 @@ CGameGlobalObjects::CGameGlobalObjects(COsContext& osContext, CMemorySys& memory gpDefaultFont = &x154_defaultFont; } -const u8 sDefaultFontData[] = { +const uchar sDefaultFontData[] = { 0x78, 0xDA, 0x8D, 0x57, 0x5B, 0x6F, 0x54, 0x55, 0x14, 0x5E, 0xA5, 0x74, 0x3A, 0x9D, 0x96, 0x82, 0x18, 0x85, 0x48, 0xD2, 0x40, 0xB9, 0x28, 0xD7, 0x52, 0x29, 0xA5, 0xB7, 0xD9, 0x5B, 0x6B, 0x69, 0xA1, 0x42, 0xB9, 0xB4, 0x94, 0x8A, 0xD0, 0xD2, 0x4E, 0xE7, 0xD6, 0x4E, 0x67, 0xDA, 0xB9, 0x74, @@ -320,7 +320,7 @@ const u8 sDefaultFontData[] = { 0xB0, 0x37, 0x71, 0x5E, 0x86, 0xDE, 0x32, 0xF8, 0xCB, 0xB0, 0x2B, 0x8F, 0xF7, 0x79, 0xE4, 0x57, 0x1E, 0xEF, 0x57, 0xF0, 0xBD, 0x2B, 0xB8, 0xC7, 0xAA, 0xC1, 0xFF, 0x01, 0xCB, 0xC9, 0xBA, 0xB0, }; -const u8 sDefaultFontTexture[] = { +const uchar sDefaultFontTexture[] = { 0x78, 0xDA, 0xED, 0x59, 0xDB, 0x92, 0x14, 0x31, 0x08, 0x05, 0xCB, 0x07, 0x1F, 0xC3, 0x1F, 0xF9, 0xAB, 0x7E, 0xA9, 0x4E, 0x37, 0x77, 0x02, 0xE9, 0x99, 0xD2, 0x37, 0xB7, 0xB7, 0x70, 0xA7, 0x77, 0x12, 0x42, 0x08, 0x07, 0x0E, 0x11, 0x00, 0xBE, 0x23, 0xC0, 0x4F, 0x00, 0x78, 0xFD, 0x82, 0x6F, @@ -458,7 +458,7 @@ CGameArchitectureSupport::CGameArchitectureSupport(COsContext& osContext) gpController = x30_inputGenerator.GetController(); gpGameState->GameOptions().EnsureOptions(); sInfiniteLoopTime = 0.f; - OSSetPeriodicAlarm(&xa0_infiniteLoopAlarm, OSGetTime(), (f32)OS_TIMER_CLOCK, InfiniteLoopAlarm); + OSSetPeriodicAlarm(&xa0_infiniteLoopAlarm, OSGetTime(), (float)OS_TIMER_CLOCK, InfiniteLoopAlarm); xc8_infiniteLoopAlarmSet = true; } @@ -508,9 +508,9 @@ void CMain::StreamNewGameState(CInputStream& in, int saveIdx) { // 80004590 void CMain::RefreshGameState() { CSystemOptions systemOptions = gpGameState->SystemOptions(); - u32 saveIdx = gpGameState->SaveIdx(); + uint saveIdx = gpGameState->SaveIdx(); u64 cardSerial = gpGameState->CardSerial(); - rstl::vector< u8 > backupBuf = gpGameState->BackupBuf(); + rstl::vector< uchar > backupBuf = gpGameState->BackupBuf(); CGameOptions gameOptions = gpGameState->GameOptions(); x128_gameGlobalObjects->GameState() = nullptr; gpGameState = nullptr; @@ -636,7 +636,7 @@ int CMain::RsMain(int argc, const char* const* argv) { if (!archSupport->UpdateTicks()) { x160_24_finished = true; } - f64 t1 = archSupport->GetStopwatch2().GetElapsedTime(); + double t1 = archSupport->GetStopwatch2().GetElapsedTime(); xf0_.AddValue(t1 / dt); x118_ = xf0_.GetAverage().data(); archSupport->GetStopwatch2().Reset(); @@ -651,12 +651,12 @@ int CMain::RsMain(int argc, const char* const* argv) { archSupport->GetIOWinManager().Draw(); DrawDebugMetrics(t1, archSupport->GetStopwatch2()); - f64 t2 = archSupport->GetStopwatch2().GetElapsedTime(); + double t2 = archSupport->GetStopwatch2().GetElapsedTime(); x104_.AddValue(t2 / dt); x11c_ = x104_.GetAverage().data(); uint idleMicros; - f64 idleTime = (dt - (t1 + t2)) - 0.00075; + double idleTime = (dt - (t1 + t2)) - 0.00075; if (idleTime > 0) idleMicros = idleTime * 1000000; else diff --git a/src/Weapons/CDecal.cpp b/src/Weapons/CDecal.cpp index 5b9aa6ed..d7a42a94 100644 --- a/src/Weapons/CDecal.cpp +++ b/src/Weapons/CDecal.cpp @@ -5,7 +5,7 @@ CRandom16 CDecal::sDecalRandom(99); bool CDecal::sMoveRedToAlpha = false; -void CDecal::SetGlobalSeed(u16 seed) { sDecalRandom.SetSeed(seed); } +void CDecal::SetGlobalSeed(ushort seed) { sDecalRandom.SetSeed(seed); } CDecal::CDecal(const TToken< CDecalDescription >& desc, const CTransform4f& xf) : x0_description(desc)