diff options
author | bigbossbro08 <bigbossbro08@gmail.com> | 2020-05-10 17:49:33 +0200 |
---|---|---|
committer | bigbossbro08 <bigbossbro08@gmail.com> | 2020-05-10 17:49:33 +0200 |
commit | c798e1bacdaabaf140ff3904948fd7cec46c09bb (patch) | |
tree | ef6d50874117bcc819b90dcd231d74f23fa0108d /src/core | |
parent | defined out asserts. (diff) | |
download | re3-c798e1bacdaabaf140ff3904948fd7cec46c09bb.tar re3-c798e1bacdaabaf140ff3904948fd7cec46c09bb.tar.gz re3-c798e1bacdaabaf140ff3904948fd7cec46c09bb.tar.bz2 re3-c798e1bacdaabaf140ff3904948fd7cec46c09bb.tar.lz re3-c798e1bacdaabaf140ff3904948fd7cec46c09bb.tar.xz re3-c798e1bacdaabaf140ff3904948fd7cec46c09bb.tar.zst re3-c798e1bacdaabaf140ff3904948fd7cec46c09bb.zip |
Diffstat (limited to 'src/core')
-rw-r--r-- | src/core/Camera.h | 4 | ||||
-rw-r--r-- | src/core/CdStream.cpp | 2 | ||||
-rw-r--r-- | src/core/CdStream.h | 2 | ||||
-rw-r--r-- | src/core/Frontend.h | 2 | ||||
-rw-r--r-- | src/core/Placeable.h | 4 | ||||
-rw-r--r-- | src/core/PlayerInfo.h | 4 | ||||
-rw-r--r-- | src/core/Radar.cpp | 2 | ||||
-rw-r--r-- | src/core/Radar.h | 2 | ||||
-rw-r--r-- | src/core/Wanted.h | 4 | ||||
-rw-r--r-- | src/core/World.h | 5 |
10 files changed, 10 insertions, 21 deletions
diff --git a/src/core/Camera.h b/src/core/Camera.h index d69b1be4..b197aed3 100644 --- a/src/core/Camera.h +++ b/src/core/Camera.h @@ -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 diff --git a/src/core/CdStream.cpp b/src/core/CdStream.cpp index 3b9eaac5..666041e1 100644 --- a/src/core/CdStream.cpp +++ b/src/core/CdStream.cpp @@ -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; diff --git a/src/core/CdStream.h b/src/core/CdStream.h index ba74be31..ba6c63a3 100644 --- a/src/core/CdStream.h +++ b/src/core/CdStream.h @@ -25,9 +25,7 @@ struct Queue int32 size; }; -#ifdef CHECK_STRUCT_SIZES VALIDATE_SIZE(Queue, 0x10); -#endif void CdStreamInitThread(void); void CdStreamInit(int32 numChannels); diff --git a/src/core/Frontend.h b/src/core/Frontend.h index 3286f275..e496f9c0 100644 --- a/src/core/Frontend.h +++ b/src/core/Frontend.h @@ -658,7 +658,7 @@ public: }; #ifndef IMPROVED_VIDEOMODE -static_assert(sizeof(CMenuManager) == 0x564, "CMenuManager: error"); +VALIDATE_SIZE(CMenuManager, 0x564); #endif extern CMenuManager FrontEndMenuManager; diff --git a/src/core/Placeable.h b/src/core/Placeable.h index 110a1542..970c0d48 100644 --- a/src/core/Placeable.h +++ b/src/core/Placeable.h @@ -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
\ No newline at end of file +VALIDATE_SIZE(CPlaceable, 0x4C); diff --git a/src/core/PlayerInfo.h b/src/core/PlayerInfo.h index ae089032..94410753 100644 --- a/src/core/PlayerInfo.h +++ b/src/core/PlayerInfo.h @@ -81,6 +81,4 @@ public: ~CPlayerInfo() { }; }; -#ifdef CHECK_STRUCT_SIZES -static_assert(sizeof(CPlayerInfo) == 0x13C, "CPlayerInfo: error"); -#endif +VALIDATE_SIZE(CPlayerInfo, 0x13C); diff --git a/src/core/Radar.cpp b/src/core/Radar.cpp index 9406f1bd..ac2712c9 100644 --- a/src/core/Radar.cpp +++ b/src/core/Radar.cpp @@ -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) diff --git a/src/core/Radar.h b/src/core/Radar.h index e39a17f0..7d07671d 100644 --- a/src/core/Radar.h +++ b/src/core/Radar.h @@ -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) diff --git a/src/core/Wanted.h b/src/core/Wanted.h index 802c3673..de36c442 100644 --- a/src/core/Wanted.h +++ b/src/core/Wanted.h @@ -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); diff --git a/src/core/World.h b/src/core/World.h index 6fc6681d..2bcc4e43 100644 --- a/src/core/World.h +++ b/src/core/World.h @@ -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; |