Skip to content

Commit

Permalink
Fixed incorrect vpaths in game_sa
Browse files Browse the repository at this point in the history
Replaced instances of C_ASSERT with static_assert
  • Loading branch information
sbx320 committed Aug 1, 2016
1 parent 2489dfb commit cee2501
Show file tree
Hide file tree
Showing 20 changed files with 30 additions and 30 deletions.
2 changes: 1 addition & 1 deletion Client/game_sa/CAudioContainerLookupTableSA.h
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,6 @@ struct SAudioLookupEntrySA
uint32 offset;
uint32 length;
}; // size = 12 = 0xC
C_ASSERT ( sizeof ( SAudioLookupEntrySA ) == 0xC );
static_assert ( sizeof ( SAudioLookupEntrySA ) == 0xC, "Invalid size for SAudioLookupEntrySA");

#endif
11 changes: 6 additions & 5 deletions Client/game_sa/CAudioContainerSA.h
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ struct SAudioEntrySA
uint16 sampleRate;
uint16 unknown2;
};
C_ASSERT ( sizeof ( SAudioEntrySA ) == 0xC );
static_assert ( sizeof ( SAudioEntrySA ) == 0xC, "Invalid size for SAudioLookupEntrySA");

struct SAudioBankHeaderSA
{
Expand All @@ -56,28 +56,29 @@ struct SRiffWavePCMHeader
uint32 subchunk2Id; // big-endian // 36
uint32 subchunk2Size; // 40
}; // size = 44 = 0x2C
C_ASSERT ( sizeof ( SRiffWavePCMHeader ) == 0x2C );
static_assert (sizeof(SRiffWavePCMHeader) == 0x2C, "Invalid size for SRiffWavePCMHeader");


// Documentation by SAAT //
// http://pdescobar.home.comcast.net/~pdescobar/gta/saat/ //
struct SBeatEntry {
int32 timing;
int32 control;
};
C_ASSERT ( sizeof ( SBeatEntry ) == 8 );
static_assert(sizeof(SBeatEntry) == 0x8, "Invalid size for SBeatEntry");

struct SLengthEntry {
uint32 length;
uint32 extra;
};
C_ASSERT ( sizeof ( SBeatEntry ) == 8 );
static_assert(sizeof(SLengthEntry) == 0x8, "Invalid size for SLengthEntry");

struct SRadioTrackHeader {
SBeatEntry beats[NUM_BEAT_ENTRIES];
SLengthEntry lengths[NUM_LENGTH_ENTRIES];
uint32 trailer;
};
C_ASSERT ( sizeof ( SRadioTrackHeader ) == 8068 );
static_assert(sizeof(SRadioTrackHeader) == 8068, "Invalid size for SRadioTrackHeader");

// End of documentation by SAAT //
// http://pdescobar.home.comcast.net/~pdescobar/gta/saat/ //
Expand Down
2 changes: 1 addition & 1 deletion Client/game_sa/CAutomobileSA.h
Original file line number Diff line number Diff line change
Expand Up @@ -169,7 +169,7 @@ class CAutomobileSAInterface : public CVehicleSAInterface
FLOAT GasPedalAudioRevs; // 1480
DWORD m_aWheelState[4]; // 1484
};
// C_ASSERT(sizeof(CAutomobileSAInterface) == 0x988);
// static_assert(sizeof(CAutomobileSAInterface) == 0x988, "Invalid size for CAutomobileSAInterface");

class CAutomobileSA : public virtual CAutomobile, public virtual CVehicleSA
{
Expand Down
2 changes: 1 addition & 1 deletion Client/game_sa/CBuildingSA.h
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
class CBuildingSAInterface : public CEntitySAInterface
{
};
C_ASSERT(sizeof(CBuildingSAInterface) == sizeof(CEntitySAInterface));
static_assert(sizeof(CBuildingSAInterface) == sizeof(CEntitySAInterface), "Invalid size for CBuildingSAInterface");

class CBuildingSA : public virtual CBuilding, public virtual CEntitySA
{
Expand Down
2 changes: 1 addition & 1 deletion Client/game_sa/CBuoyancySA.h
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,6 @@ class CBuoyancySA
CVector vecMoveForce; // 192
uint32 pad8; // 204
};
C_ASSERT(sizeof(CBuoyancySA) == 0xD0);
static_assert(sizeof(CBuoyancySA) == 0xD0, "Invalid size for CBuoyancySA");

#endif
2 changes: 1 addition & 1 deletion Client/game_sa/CCamSA.h
Original file line number Diff line number Diff line change
Expand Up @@ -159,7 +159,7 @@ class CCamSAInterface
CPedSAInterface *m_pLastPedLookedAt;// So interpolation works
bool m_bFirstPersonRunAboutActive; // 564
};
C_ASSERT(sizeof(CCamSAInterface) == 0x238);
static_assert(sizeof(CCamSAInterface) == 0x238, "Invalid size for CCamSAInterface");

class CCamSA : public CCam
{
Expand Down
2 changes: 1 addition & 1 deletion Client/game_sa/CCameraSA.h
Original file line number Diff line number Diff line change
Expand Up @@ -398,7 +398,7 @@ class CCameraSAInterface
DWORD m_uiFadeTimeStarted;
DWORD m_uiFadeTimeStartedMusic;
};
// C_ASSERT(sizeof(CCameraSAInterface) == 0xD78);
// static_assert(sizeof(CCameraSAInterface) == 0xD78, "Invalid size for CCameraSAInterface");

class CCameraSA : public CCamera
{
Expand Down
2 changes: 1 addition & 1 deletion Client/game_sa/CColPointSA.h
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ class CColPointSAInterface
uint8 pad2; // 39
float fDepth; // 40
};
C_ASSERT(sizeof(CColPointSAInterface) == 0x2C);
static_assert(sizeof(CColPointSAInterface) == 0x2C, "Invalid size for CColPointSAInterface");

class CColPointSA : public CColPoint
{
Expand Down
6 changes: 3 additions & 3 deletions Client/game_sa/CEntitySA.h
Original file line number Diff line number Diff line change
Expand Up @@ -100,7 +100,7 @@ class XYZ
XYZ * pPrev;
XYZ * pNext;
};
C_ASSERT(sizeof(XYZ) == 0x54);
static_assert(sizeof(XYZ) == 0x54, "Invalid size for XYZ");

class XYZStore
{
Expand All @@ -113,7 +113,7 @@ class XYZStore
XYZ freeListTail;
XYZ * pPool;
};
C_ASSERT(sizeof(XYZStore) == 0x1FC);
static_assert(sizeof(XYZStore) == 0x1FC, "Invalid size for XYZStore");


class CSimpleTransformSAInterface // 16 bytes
Expand Down Expand Up @@ -239,7 +239,7 @@ class CEntitySAInterface
return -1;
}
};
C_ASSERT(sizeof(CEntitySAInterface) == 0x38);
static_assert(sizeof(CEntitySAInterface) == 0x38, "Invalid size for CEntitySAInterface");

class CEntitySA : public virtual CEntity
{
Expand Down
2 changes: 1 addition & 1 deletion Client/game_sa/CFxManagerSA.h
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ class CFxManagerSAInterface // FxManager_c
RwMatrix * apmatMatrices[8]; // 0x8C
CFxMemoryPoolSAInterface fxMemoryPool; // 0xAC
};
C_ASSERT(sizeof(CFxManagerSAInterface) == 0xB8);
static_assert(sizeof(CFxManagerSAInterface) == 0xB8, "Invalid size for CFxManagerSAInterface");

class CFxManagerSA : public CFxManager
{
Expand Down
2 changes: 1 addition & 1 deletion Client/game_sa/CFxSystemBPSA.h
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,6 @@ class CFxSystemBPSAInterface
void ** pPrims; // 0x1C (pPrims[0] to pPrims[cNumOfPrims-1])
void * pBoundingSphere; // 0x20
};
C_ASSERT(sizeof(CFxSystemBPSAInterface) == 0x24);
static_assert(sizeof(CFxSystemBPSAInterface) == 0x24, "Invalid size for CFxSystemBPSAInterface");

#endif
4 changes: 2 additions & 2 deletions Client/game_sa/CFxSystemSA.h
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ class CAEFireAudioEntitySAInterface
// todo: reverse this structure and CAEAudioEntity
int unk[0x22];
};
C_ASSERT(sizeof(CAEFireAudioEntitySAInterface) == 0x88);
static_assert(sizeof(CAEFireAudioEntitySAInterface) == 0x88, "Invalid size for CAEFireAudioEntitySAInterface");

class CFxSystemBPSAInterface;
class CFxSystemSAInterface // Internal SA Name: FxSystem_c
Expand Down Expand Up @@ -77,7 +77,7 @@ class CFxSystemSAInterface // Internal SA Name: FxSystem_c
void ** ppParticleEmitters; // 0x78 (Array of particle emitters, amount is defined by the blueprint)
CAEFireAudioEntitySAInterface audioEntity; // 0x7C
};
C_ASSERT(sizeof(CFxSystemSAInterface) == 0x104);
static_assert(sizeof(CFxSystemSAInterface) == 0x104, "Invalid size for CFxSystemSAInterface");

class CFxSystemSA : public CFxSystem
{
Expand Down
4 changes: 2 additions & 2 deletions Client/game_sa/CObjectSA.h
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ class CObjectInfo
uint32 uiSparksOnImpact; // 76
};
// TODO: Find out correct size
//C_ASSERT(sizeof(CObjectInfo) == 0x50);
//static_assert(sizeof(CObjectInfo) == 0x50, "Invalid size for CObjectInfo");

class CObjectSAInterface : public CPhysicalSAInterface
{
Expand Down Expand Up @@ -123,7 +123,7 @@ class CObjectSAInterface : public CPhysicalSAInterface
uint32 pad21; // 372
uint32 pad22; // 376
};
C_ASSERT(sizeof(CObjectSAInterface) == 0x17C);
static_assert(sizeof(CObjectSAInterface) == 0x17C, "Invalid size for CObjectSAInterface");

class CObjectSA : public virtual CObject, public virtual CPhysicalSA
{
Expand Down
2 changes: 1 addition & 1 deletion Client/game_sa/CPhysicalSA.h
Original file line number Diff line number Diff line change
Expand Up @@ -111,7 +111,7 @@ class CPhysicalSAInterface : public CEntitySAInterface
float m_fLighting2; // 304
class CShadowDataSA *m_pShadowData; // 308
};
C_ASSERT(sizeof(CPhysicalSAInterface) == 0x138);
static_assert(sizeof(CPhysicalSAInterface) == 0x138, "Invalid size for CPhysicalSAInterface");

class CPhysicalSA : public virtual CPhysical, public virtual CEntitySA
{
Expand Down
2 changes: 1 addition & 1 deletion Client/game_sa/CPlayerInfoSA.h
Original file line number Diff line number Diff line change
Expand Up @@ -153,7 +153,7 @@ class CPlayerPedDataSAInterface
CPedSAInterface * m_pCurrentProstitutePed;
CPedSAInterface * m_pLastProstituteShagged;
};
C_ASSERT(sizeof(CPlayerPedDataSAInterface) == 172 );
static_assert(sizeof(CPlayerPedDataSAInterface) == 172 , "Invalid size for CPlayerPedDataSAInterface");
#pragma pack(pop)

class CPlayerInfoSAInterface
Expand Down
2 changes: 1 addition & 1 deletion Client/game_sa/CRopesSA.h
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ class CRopesSAInterface
uint8 m_ucFlags1;
uint8 m_ucFlags2;
};
C_ASSERT(sizeof(CRopesSAInterface) == 0x328);
static_assert(sizeof(CRopesSAInterface) == 0x328, "Invalid size for CRopesSAInterface");

class CRopesSA : public CRopes
{
Expand Down
2 changes: 1 addition & 1 deletion Client/game_sa/CVehicleSA.h
Original file line number Diff line number Diff line change
Expand Up @@ -508,7 +508,7 @@ class CVehicleSAInterface : public CPhysicalSAInterface
// 2276
float m_fBurningTime;
};
C_ASSERT(sizeof(CVehicleSAInterface) == 1688 + 576 + 4 );
static_assert(sizeof(CVehicleSAInterface) == 1688 + 576 + 4 , "Invalid size for CVehicleSAInterface");

class CVehicleSA : public virtual CVehicle, public virtual CPhysicalSA
{
Expand Down
2 changes: 1 addition & 1 deletion Client/game_sa/CWeaponInfoSA.h
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ class CFlameShotInfo
uint8 ucFlag2;
uint16 usPad;
};
C_ASSERT(sizeof(CFlameShotInfo) == 0x2c );
static_assert(sizeof(CFlameShotInfo) == 0x2c , "Invalid size for CFlameShotInfo");

class CWeaponInfoSAInterface // 112 byte long class
{
Expand Down
3 changes: 1 addition & 2 deletions Client/game_sa/premake5.lua
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,7 @@ project "Game SA"
pchsource "StdInc.cpp"

vpaths {
["Headers/*"] = "**.h",
["Headers/*"] = "**.hpp",
["Headers/*"] = { "**.h", "**.hpp" },
["Sources/*"] = "**.cpp",
["*"] = "premake5.lua"
}
Expand Down
4 changes: 2 additions & 2 deletions Client/loader/CExePatchedStatus.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -458,8 +458,8 @@ namespace
0x00000000, 0x4e000000, 0x74704f76, 0x73756d69, // .......NvOptimus
0x62616e45, 0x656d656c, 0x0000746e, 0x00000000 }; // Enablement......

C_ASSERT( sizeof( oldExportDir ) == sizeof( newExportDir ) );
C_ASSERT( sizeof( oldExportTable ) == sizeof( newExportTable ) );
static_assert( sizeof( oldExportDir ) == sizeof( newExportDir ), "Invalid export dir size" );
static_assert( sizeof( oldExportTable ) == sizeof( newExportTable ), "Invalid export table size" );

struct SDataumRow
{
Expand Down

0 comments on commit cee2501

Please sign in to comment.