Migrate s32->int, u32->uint; fix dolphin/types.h

This commit is contained in:
Luke Street
2022-09-05 00:01:22 -04:00
parent 78022784ef
commit 7eb08b6ee8
73 changed files with 413 additions and 410 deletions
+29 -29
View File
@@ -19,44 +19,44 @@ public:
enum EType { kTP_Unk0 };
struct SMetrics {
u32 x0_heapSize;
u32 x4_;
u32 x8_;
u32 xc_;
u32 x10_;
u32 x14_heapSize2; // Remaining heap size?
u32 x18_;
u32 x1c_;
u32 x20_;
u32 x24_;
u32 x28_;
u32 x2c_smallNumAllocs;
u32 x30_smallAllocatedSize;
u32 x34_smallRemainingSize;
u32 x38_mediumNumAllocs;
u32 x3c_mediumAllocatedSize;
u32 x40_mediumBlocksAvailable;
u32 x44_;
u32 x48_;
u32 x4c_;
u32 x50_mediumTotalAllocated;
u32 x54_fakeStatics;
SMetrics(u32 heapSize, u32 unk1, u32 unk2, u32 unk3, u32 unk4, u32 heapSize2, u32 unk5, u32 unk6, u32 unk7, u32 unk8, u32 unk9,
u32 smallAllocNumAllocs, u32 smallAllocAllocatedSize, u32 smallAllocRemainingSize, u32 mediumAllocNumAllocs,
u32 mediumAllocAllocatedSize, u32 mediumAllocBlocksAvailable, u32 unk10, u32 unk11, u32 unk12, u32 mediumAllocTotalAllocated,
u32 fakeStatics);
uint x0_heapSize;
uint x4_;
uint x8_;
uint xc_;
uint x10_;
uint x14_heapSize2; // Remaining heap size?
uint x18_;
uint x1c_;
uint x20_;
uint x24_;
uint x28_;
uint x2c_smallNumAllocs;
uint x30_smallAllocatedSize;
uint x34_smallRemainingSize;
uint x38_mediumNumAllocs;
uint x3c_mediumAllocatedSize;
uint x40_mediumBlocksAvailable;
uint x44_;
uint x48_;
uint x4c_;
uint x50_mediumTotalAllocated;
uint x54_fakeStatics;
SMetrics(uint heapSize, uint unk1, uint unk2, uint unk3, uint unk4, uint heapSize2, uint unk5, uint unk6, uint unk7, uint unk8, uint unk9,
uint smallAllocNumAllocs, uint smallAllocAllocatedSize, uint smallAllocRemainingSize, uint mediumAllocNumAllocs,
uint mediumAllocAllocatedSize, uint mediumAllocBlocksAvailable, uint unk10, uint unk11, uint unk12, uint mediumAllocTotalAllocated,
uint fakeStatics);
};
struct SAllocInfo {
void* x0_infoPtr;
u32 x4_len;
uint x4_len;
bool x8_hasPrevious;
bool x9_;
const char* xc_fileAndLne;
const char* x10_type;
};
typedef const bool (*FOutOfMemoryCb)(void*, u32);
typedef const bool (*FOutOfMemoryCb)(void*, uint);
typedef const bool (*FEnumAllocationsCb)(const SAllocInfo& info, const void* ptr);
virtual ~IAllocator();
@@ -71,7 +71,7 @@ public:
virtual void SetOutOfMemoryCallback(FOutOfMemoryCb cb, const void* data) = 0;
virtual void EnumAllocations(FEnumAllocationsCb func, const void* ptr, bool b) const = 0;
virtual SAllocInfo GetAllocInfo(const void* ptr) const = 0;
virtual void OffsetFakeStatics(s32 offset) = 0;
virtual void OffsetFakeStatics(int offset) = 0;
virtual SMetrics GetMetrics() const = 0;
};
+2 -2
View File
@@ -6,7 +6,7 @@
class CSfxHandle {
public:
CSfxHandle() : value(0) {}
CSfxHandle(u32 value) : value(value) {}
CSfxHandle(uint value) : value(value) {}
// GetIndex__10CSfxHandleCFv
// NullHandle__10CSfxHandleFv
@@ -16,7 +16,7 @@ public:
operator bool() const { return value != 0; }
private:
u32 value;
uint value;
};
CHECK_SIZEOF(CSfxHandle, 0x4)
+1 -1
View File
@@ -4,7 +4,7 @@
class CCRC32 {
public:
static u32 Calculate(const void* data, u32 length);
static uint Calculate(const void* data, uint length);
};
#endif // __CCRC32_HPP__
+4 -4
View File
@@ -26,13 +26,13 @@ private:
int x2c_asyncLoadPhase; // EAsyncPhase
rstl::auto_ptr< void > x30_dvdReq; // IDvdRequest
rstl::vector< u8 > x38_headerData;
u32 x48_resTableOffset;
u32 x4c_resTableCount;
s32 x50_aramBase;
uint x48_resTableOffset;
uint x4c_resTableCount;
int x50_aramBase;
rstl::vector< rstl::pair< rstl::string, SObjectTag > > x54_nameList;
rstl::vector< CAssetId > x64_depList;
rstl::vector< SResInfo > x74_resList;
mutable s32 x84_currentSeek;
mutable int x84_currentSeek;
};
#endif
+5 -5
View File
@@ -21,14 +21,14 @@ class CRandom16 {
static void _SetRandomNumber(CRandom16* rnd);
public:
static CRandom16* GetRandomNumber();
CRandom16(u32 seed = 99);
void SetSeed(u32 seed);
s32 Range(s32 min, s32 max);
CRandom16(uint seed = 99);
void SetSeed(uint seed);
int Range(int min, int max);
float Range(float min, float max);
s32 Next();
int Next();
float Float();
private:
u32 mSeed;
uint mSeed;
};
#endif // __CRANDOM16_HPP__
+8 -8
View File
@@ -12,20 +12,20 @@ class CResFactory {
public:
virtual ~CResFactory() {}
void AsyncIdle(u32 time);
void AsyncIdle(uint time);
CResLoader& GetResLoader() { return x4_resLoader; }
private:
CResLoader x4_resLoader;
CFactoryMgr x5c_factoryMgr;
u32 x94_;
u32 x98_;
u32 x9c_;
u32 xa0_;
u32 xa4_;
u32 xa8_;
u32 xac_;
uint x94_;
uint x98_;
uint x9c_;
uint xa0_;
uint xa4_;
uint xa8_;
uint xac_;
rstl::list< void > xb0_;
};
+3 -3
View File
@@ -14,13 +14,13 @@ struct SResInfo {
CAssetId x0_id;
bool x4_compressed : 1;
int x4_typeIdx; // CFactoryMgr::ETypeTable
u32 x5_offsetDiv32 : 27;
u32 x7_sizeDiv32 : 27;
uint x5_offsetDiv32 : 27;
uint x7_sizeDiv32 : 27;
};
class CResLoader {
public:
s32 GetPakCount() const;
int GetPakCount() const;
CPakFile& GetPakFile(int idx) const;
void AddPakFileAsync(const rstl::string&, bool, bool);
void AsyncIdlePakLoading();
+4 -4
View File
@@ -15,7 +15,7 @@ class CInputStream;
class CColor {
public:
CColor() {}
CColor(u32 col) : mRgba(col) {}
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) {
@@ -29,7 +29,7 @@ public:
void Get(float& r, float& g, float& b, float& a) const;
void Get(float& r, float& g, float& b) const;
static CColor Lerp(const CColor& a, const CColor& b, float t);
static u32 Lerp(u32 a, u32 b, float t);
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); }
@@ -41,7 +41,7 @@ public:
u8 GetBlueu8() const { return mB; }
u8 GetAlphau8() const { return mA; }
u16 ToRGB5A3() const;
GXColor ToGX(u32);
GXColor ToGX(uint);
static const CColor& Black();
static const CColor& White();
@@ -61,7 +61,7 @@ private:
u8 mB;
u8 mA;
};
u32 mRgba;
uint mRgba;
};
static const CColor sBlackColor;
+1 -1
View File
@@ -11,7 +11,7 @@ extern CVector3f sPlayerPosition;
class CCubeMaterial {
public:
private:
static void SetupBlendMode(u32 blendFactors, const CModelFlags& flags, bool alphaTest);
static void SetupBlendMode(uint blendFactors, const CModelFlags& flags, bool alphaTest);
static CVector3f sViewingFrom;
};
+18 -18
View File
@@ -11,12 +11,12 @@
class CGX {
public:
struct STevState {
u32 x0_colorInArgs;
u32 x4_alphaInArgs;
u32 x8_colorOps;
u32 xc_alphaOps;
u32 x10_indFlags;
u32 x14_tevOrderFlags;
uint x0_colorInArgs;
uint x4_alphaInArgs;
uint x8_colorOps;
uint xc_alphaOps;
uint x10_indFlags;
uint x14_tevOrderFlags;
u8 x18_kColorSel;
u8 x19_kAlphaSel;
@@ -24,7 +24,7 @@ public:
};
struct STexState {
u32 x0_coordGen;
uint x0_coordGen;
STexState();
};
@@ -50,7 +50,7 @@ public:
u16 x34_chanCtrls[2];
GXColor x38_chanAmbColors[2];
GXColor x40_chanMatColors[2];
u32 x48_descList;
uint x48_descList;
union {
u8 x4c_chanFlags;
struct {
@@ -71,7 +71,7 @@ public:
GXColor x58_kColors[4];
STevState x68_tevStates[16];
STexState x228_texStates[8];
u32 x248_alphaCompare;
uint x248_alphaCompare;
SFogParams x24c_fogParams;
SGXState();
@@ -94,9 +94,9 @@ public:
static void SetTevColorIn(GXTevStageID stageId, GXTevColorArg a, GXTevColorArg b, GXTevColorArg c, GXTevColorArg d);
static void SetTevAlphaIn(GXTevStageID stageId, GXTevAlphaArg a, GXTevAlphaArg b, GXTevAlphaArg c, GXTevAlphaArg d);
static void SetTevColorOp(GXTevStageID stageId, GXTevOp op, GXTevBias bias, GXTevScale scale, GXBool clamp, GXTevRegID outReg);
static void SetTevColorOp_Compressed(GXTevStageID stageId, u32 flags);
static void SetTevColorOp_Compressed(GXTevStageID stageId, uint flags);
static void SetTevAlphaOp(GXTevStageID stageId, GXTevOp op, GXTevBias bias, GXTevScale scale, GXBool clamp, GXTevRegID outReg);
static void SetTevAlphaOp_Compressed(GXTevStageID stageId, u32 flags);
static void SetTevAlphaOp_Compressed(GXTevStageID stageId, uint flags);
static void SetTevKColorSel(GXTevStageID stageId, GXTevKColorSel sel);
static void SetTevKAlphaSel(GXTevStageID stageId, GXTevKAlphaSel sel);
static void SetTevOrder(GXTevStageID stageId, GXTexCoordID texCoord, GXTexMapID texMap, GXChannelID color);
@@ -112,11 +112,11 @@ public:
static void SetFog(GXFogType type, f32 startZ, f32 endZ, f32 nearZ, f32 farZ, const GXColor& color);
static void SetLineWidth(u8 width, GXTexOffset offset);
static void SetIndTexMtxSTPointFive(GXIndTexMtxID id, s8 scaleExp);
static void SetVtxDescv_Compressed(u32 flags);
static void SetVtxDescv_Compressed(uint flags);
static void SetVtxDesc(GXAttr attr, GXAttrType type); // name?
static void ResetVtxDescv(); // name?
static void SetVtxDescv(const GXVtxDescList* list);
static void SetStandardDirectTev_Compressed(GXTevStageID stageId, u32 colorArgs, u32 alphaArgs, u32 colorOps, u32 alphaOps);
static void SetStandardDirectTev_Compressed(GXTevStageID stageId, uint colorArgs, uint alphaArgs, uint colorOps, uint alphaOps);
static void SetStandardTevColorAlphaOp(GXTevStageID stageId);
static void CallDisplayList(const void* ptr, size_t size);
@@ -133,17 +133,17 @@ public:
static void GetFog(GXFogType* fogType, f32* fogStartZ, f32* fogEndZ, f32* fogNearZ, f32* fogFarZ, GXColor* fogColor);
static inline bool CompareGXColors(const GXColor& lhs, const GXColor& rhs) {
return *reinterpret_cast< const u32* >(&lhs) == *reinterpret_cast< const u32* >(&rhs);
return *reinterpret_cast< const uint* >(&lhs) == *reinterpret_cast< const uint* >(&rhs);
}
static inline void CopyGXColor(GXColor& dst, const GXColor& src) {
*reinterpret_cast< u32* >(&dst) = *reinterpret_cast< const u32* >(&src);
*reinterpret_cast< uint* >(&dst) = *reinterpret_cast< const uint* >(&src);
}
static inline u32 MaskAndShiftLeft(u32 v, u32 m, u32 s) { return (v & m) << s; }
static inline u32 ShiftRightAndMask(u32 v, u32 m, u32 s) { return (v >> s) & m; }
static inline uint MaskAndShiftLeft(uint v, uint m, uint s) { return (v & m) << s; }
static inline uint ShiftRightAndMask(uint v, uint m, uint s) { return (v >> s) & m; }
private:
static void FlushState();
static void update_fog(u32 flags);
static void update_fog(uint flags);
static void apply_fog() {
static const GXColor black = {0, 0, 0, 0};
GXSetFog(static_cast< GXFogType >(sGXState.x53_fogType), sGXState.x24c_fogParams.x0_fogStartZ, sGXState.x24c_fogParams.x4_fogEndZ,
+1 -1
View File
@@ -8,7 +8,7 @@ public:
~CGraphicsSys();
private:
u32 pad;
uint pad;
};
#endif
+6 -6
View File
@@ -26,15 +26,15 @@ public:
: x0_blendMode(trans), x1_matSetIdx(0), x2_flags(kF_DepthCompare | kF_DepthUpdate), x4_color(rgba, rgba, rgba, rgba) {}
CModelFlags(ETrans trans, CColor color)
: x0_blendMode(trans), x1_matSetIdx(0), x2_flags(kF_DepthCompare | kF_DepthUpdate), x4_color(color) {}
CModelFlags(const CModelFlags& flags, u32 otherFlags)
CModelFlags(const CModelFlags& flags, uint otherFlags)
: x0_blendMode(flags.x0_blendMode), x1_matSetIdx(flags.x1_matSetIdx), x2_flags(otherFlags), x4_color(flags.x4_color) {}
CModelFlags(const CModelFlags& flags, bool b /* TODO what's this? */, s32 shaderSet)
CModelFlags(const CModelFlags& flags, bool b /* TODO what's this? */, int shaderSet)
: x0_blendMode(flags.x0_blendMode), x1_matSetIdx(shaderSet), x2_flags(flags.x2_flags), x4_color(flags.x4_color) {}
CModelFlags UseShaderSet(s32 matSet) { return CModelFlags(*this, false, matSet); }
CModelFlags UseShaderSet(int matSet) { return CModelFlags(*this, false, matSet); }
CModelFlags DontLoadTextures() { return CModelFlags(*this, GetOtherFlags() | kF_NoTextureLock); }
CModelFlags DepthCompareUpdate(bool compare, bool update) {
u32 flags = GetOtherFlags();
uint flags = GetOtherFlags();
if (compare) {
flags |= kF_DepthCompare;
} else {
@@ -50,8 +50,8 @@ public:
CModelFlags DepthBackwards() { return CModelFlags(*this, GetOtherFlags() | kF_DepthGreater); }
ETrans GetTrans() const { return static_cast< ETrans >(x0_blendMode); }
s32 GetShaderSet() const { return x1_matSetIdx; }
u32 GetOtherFlags() const { return x2_flags; }
int GetShaderSet() const { return x1_matSetIdx; }
uint GetOtherFlags() const { return x2_flags; }
CColor GetColor() const { return x4_color; }
static CModelFlags Normal() { return CModelFlags(kT_Opaque, 1.f); }
+1 -1
View File
@@ -87,7 +87,7 @@ public:
class CTevPass {
public:
u32 x0_id;
uint x0_id;
ColorPass x4_colorPass;
AlphaPass x14_alphaPass;
CTevOp x24_colorOp;
+2 -2
View File
@@ -8,8 +8,8 @@
#define kInvalidAssetId 0xFFFFFFFFu
typedef u32 CAssetId;
typedef u32 FourCC;
typedef uint CAssetId;
typedef uint FourCC;
struct SObjectTag {
FourCC type;
+1 -1
View File
@@ -8,7 +8,7 @@ public:
static f32 FastCosR(f32 v);
static f32 FastSinR(f32 v);
static inline f32 FastFmod(f32 x, f32 y) {
s32 v = static_cast<s32>(x * (1.f / y));
int v = static_cast<int>(x * (1.f / y));
return x - v * y;
}
};
+2 -2
View File
@@ -5,8 +5,8 @@
class CVector2i {
private:
s32 x;
s32 y;
int x;
int y;
};
#endif
+2 -2
View File
@@ -48,8 +48,8 @@ public:
f32 operator[](EDimY) const { return mY; }
f32 operator[](EDimZ) const { return mZ; }
f32& operator[](s32 i) { return *(&mX + i); }
// f32 operator[](s32 i) const { return *(&mX + i); }
f32& operator[](int i) { return *(&mX + i); }
// f32 operator[](int i) const { return *(&mX + i); }
bool IsNonZero() const { return mX != 0.f || mY != 0.f || mZ != 0.f; }
void DropZ() { mZ = 0.f; }
+2 -2
View File
@@ -32,12 +32,12 @@ public:
virtual float GetGeneratorRate() const { return 1.f; }
virtual bool IsSystemDeletable() const = 0;
virtual CAABox GetBounds() const = 0;
virtual s32 GetParticleCOunt() const = 0;
virtual int GetParticleCOunt() const = 0;
virtual bool SystemHasLight() const = 0;
virtual CLight GetLight() = 0;
virtual void DestroyParticles() = 0;
virtual void AddModifier(CWarp*) = 0;
virtual u32 Get4CharId() const = 0;
virtual uint Get4CharId() const = 0;
};
#endif // _CPARTICLEGEN_HPP
+15 -15
View File
@@ -11,19 +11,19 @@ inline T cinput_stream_helper(const TType< T >& type, CInputStream& in);
class CInputStream {
public:
CInputStream(s32 len);
CInputStream(const void* ptr, s32 len, bool owned);
CInputStream(int len);
CInputStream(const void* ptr, int len, bool owned);
virtual ~CInputStream();
virtual u32 Read(void* dest, u32 len) = 0;
virtual uint Read(void* dest, uint len) = 0;
f32 ReadFloat();
u64 ReadLongLong();
u32 ReadLong();
uint ReadLong();
u16 ReadShort();
bool ReadBool();
u8 ReadChar();
u32 ReadBits(u32 len);
u32 ReadBytes(void* dest, unsigned long len);
uint ReadBits(uint len);
uint ReadBytes(void* dest, unsigned long len);
void Get(void* dest, unsigned long len);
template < typename T >
@@ -35,26 +35,26 @@ private:
bool GrabAnotherBlock();
bool InternalReadNext();
u32 x4_blockOffset;
u32 x8_blockLen;
u32 xc_len;
uint x4_blockOffset;
uint x8_blockLen;
uint xc_len;
u8* x10_ptr;
bool x14_owned;
u32 x18_readPosition;
u32 x1c_bitWord;
u32 x20_bitOffset;
uint x18_readPosition;
uint x1c_bitWord;
uint x20_bitOffset;
};
template <>
inline s32 cinput_stream_helper(const TType< s32 >& type, CInputStream& in) {
inline int cinput_stream_helper(const TType< int >& type, CInputStream& in) {
return in.ReadLong();
}
template <>
inline u32 cinput_stream_helper(const TType< u32 >& type, CInputStream& in) {
inline uint cinput_stream_helper(const TType< uint >& type, CInputStream& in) {
return in.ReadLong();
}
template <>
inline unsigned int cinput_stream_helper(const TType< unsigned int >& type, CInputStream& in) {
inline unsigned long cinput_stream_helper(const TType< unsigned long >& type, CInputStream& in) {
return in.ReadLong();
}
template <>
+1 -1
View File
@@ -13,7 +13,7 @@ public:
CMemoryInStream(const void* ptr, unsigned long len);
CMemoryInStream(const void* ptr, unsigned long len, EOwnerShip ownership);
virtual ~CMemoryInStream() override {}
virtual u32 Read(void* dest, u32 len) override;
virtual uint Read(void* dest, uint len) override;
};
#endif

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