Fixed typos and made all assert functions optional

This commit is contained in:
bigbossbro08
2020-05-10 21:49:33 +06:00
parent af6e132b37
commit c798e1bacd
73 changed files with 110 additions and 184 deletions

View File

@ -261,8 +261,8 @@ public:
void Process_FollowCar_SA(const CVector &CameraTarget, float TargetOrientation, float, float);
};
#ifdef CHECK_STRUCT_SIZES
static_assert(sizeof(CCam) == 0x1A4, "CCam: wrong size");
VALIDATE_SIZE(CCam, 0x1A4);
#ifdef CHECK_STRUCT_SIZES
static_assert(offsetof(CCam, Alpha) == 0xA8, "CCam: error");
static_assert(offsetof(CCam, Front) == 0x140, "CCam: error");
#endif

View File

@ -23,9 +23,7 @@ struct CdReadInfo
OVERLAPPED Overlapped;
};
#ifdef CHECK_STRUCT_SIZES
VALIDATE_SIZE(CdReadInfo, 0x30);
#endif
char gCdImageNames[MAX_CDIMAGES+1][64];
int32 gNumImages;

View File

@ -25,9 +25,7 @@ struct Queue
int32 size;
};
#ifdef CHECK_STRUCT_SIZES
VALIDATE_SIZE(Queue, 0x10);
#endif
void CdStreamInitThread(void);
void CdStreamInit(int32 numChannels);

View File

@ -658,7 +658,7 @@ public:
};
#ifndef IMPROVED_VIDEOMODE
static_assert(sizeof(CMenuManager) == 0x564, "CMenuManager: error");
VALIDATE_SIZE(CMenuManager, 0x564);
#endif
extern CMenuManager FrontEndMenuManager;

View File

@ -32,6 +32,4 @@ public:
bool IsWithinArea(float x1, float y1, float z1, float x2, float y2, float z2);
};
#ifdef CHECK_STRUCT_SIZES
static_assert(sizeof(CPlaceable) == 0x4C, "CPlaceable: error");
#endif
VALIDATE_SIZE(CPlaceable, 0x4C);

View File

@ -81,6 +81,4 @@ public:
~CPlayerInfo() { };
};
#ifdef CHECK_STRUCT_SIZES
static_assert(sizeof(CPlayerInfo) == 0x13C, "CPlayerInfo: error");
#endif
VALIDATE_SIZE(CPlayerInfo, 0x13C);

View File

@ -76,7 +76,9 @@ CSprite2d *CRadar::RadarSprites[RADAR_SPRITE_COUNT] = {
#define RADAR_NUM_TILES (8)
#define RADAR_TILE_SIZE (RADAR_SIZE_X / RADAR_NUM_TILES)
#ifdef CHECK_STRUCT_SIZES
static_assert(RADAR_TILE_SIZE == (RADAR_SIZE_Y / RADAR_NUM_TILES), "CRadar: not a square");
#endif
#define RADAR_MIN_RANGE (120.0f)
#define RADAR_MAX_RANGE (350.0f)

View File

@ -71,7 +71,7 @@ struct sRadarTrace
uint16 m_eBlipDisplay; // eBlipDisplay
uint16 m_eRadarSprite; // eRadarSprite
};
static_assert(sizeof(sRadarTrace) == 0x30, "sRadarTrace: error");
VALIDATE_SIZE(sRadarTrace, 0x30);
// Values for screen space
#define RADAR_LEFT (40.0f)

View File

@ -54,6 +54,4 @@ public:
static void SetMaximumWantedLevel(int32 level);
};
#ifdef CHECK_STRUCT_SIZES
static_assert(sizeof(CWanted) == 0x204, "CWanted: error");
#endif
VALIDATE_SIZE(CWanted, 0x204);

View File

@ -46,10 +46,7 @@ public:
CPtrList m_lists[NUMSECTORENTITYLISTS];
};
#ifdef CHECK_STRUCT_SIZES
static_assert(sizeof(CSector) == 0x28, "CSector: error");
#endif
VALIDATE_SIZE(CSector, 0x28);
class CEntity;
struct CColPoint;