From af6e132b37e8b7e89e4c0c7a52e5bb81e4b1b9a8 Mon Sep 17 00:00:00 2001 From: bigbossbro08 Date: Sun, 10 May 2020 19:54:37 +0600 Subject: defined out asserts. --- src/render/2dEffect.h | 3 +++ src/render/Coronas.h | 3 +++ src/render/Glass.h | 2 ++ src/render/Particle.h | 4 +++- src/render/ParticleMgr.h | 6 +++++- src/render/Shadows.h | 11 +++++++++++ 6 files changed, 27 insertions(+), 2 deletions(-) (limited to 'src/render') diff --git a/src/render/2dEffect.h b/src/render/2dEffect.h index a24a3f4f..8c583799 100644 --- a/src/render/2dEffect.h +++ b/src/render/2dEffect.h @@ -89,4 +89,7 @@ public: } } }; + +#ifdef CHECK_STRUCT_SIZES static_assert(sizeof(C2dEffect) == 0x34, "C2dEffect: error"); +#endif \ No newline at end of file diff --git a/src/render/Coronas.h b/src/render/Coronas.h index 4b49e40e..d2e79079 100644 --- a/src/render/Coronas.h +++ b/src/render/Coronas.h @@ -38,7 +38,10 @@ struct CRegisteredCorona void Update(void); }; + +#ifdef CHECK_STRUCT_SIZES static_assert(sizeof(CRegisteredCorona) == 0x80, "CRegisteredCorona: error"); +#endif class CCoronas { diff --git a/src/render/Glass.h b/src/render/Glass.h index 51c5aae9..0c715c27 100644 --- a/src/render/Glass.h +++ b/src/render/Glass.h @@ -21,7 +21,9 @@ public: void Render(void); }; +#ifdef CHECK_STRUCT_SIZES VALIDATE_SIZE(CFallingGlassPane, 0x70); +#endif enum { diff --git a/src/render/Particle.h b/src/render/Particle.h index b71dc717..ed1528d2 100644 --- a/src/render/Particle.h +++ b/src/render/Particle.h @@ -91,4 +91,6 @@ public: static void AddYardieDoorSmoke(CVector const &vecPos, CMatrix const &matMatrix); }; -VALIDATE_SIZE(CParticle, 0x68); \ No newline at end of file +#ifdef CHECK_STRUCT_SIZES +VALIDATE_SIZE(CParticle, 0x68); +#endif \ No newline at end of file diff --git a/src/render/ParticleMgr.h b/src/render/ParticleMgr.h index 70845a56..42e3f132 100644 --- a/src/render/ParticleMgr.h +++ b/src/render/ParticleMgr.h @@ -64,8 +64,10 @@ struct tParticleSystemData RwRaster **m_ppRaster; CParticle *m_pParticles; }; -VALIDATE_SIZE(tParticleSystemData, 0x88); +#ifdef CHECK_STRUCT_SIZES +VALIDATE_SIZE(tParticleSystemData, 0x88); +#endif class cParticleSystemMgr { @@ -125,6 +127,8 @@ public: void RangeCheck(tParticleSystemData *pData) { } }; +#ifdef CHECK_STRUCT_SIZES VALIDATE_SIZE(cParticleSystemMgr, 0x2420); +#endif extern cParticleSystemMgr mod_ParticleSystemManager; \ No newline at end of file diff --git a/src/render/Shadows.h b/src/render/Shadows.h index 39be343e..8e89024d 100644 --- a/src/render/Shadows.h +++ b/src/render/Shadows.h @@ -51,7 +51,10 @@ public: CStoredShadow() { } }; + +#ifdef CHECK_STRUCT_SIZES VALIDATE_SIZE(CStoredShadow, 0x30); +#endif class CPolyBunch { @@ -65,7 +68,10 @@ public: CPolyBunch() { } }; + +#ifdef CHECK_STRUCT_SIZES VALIDATE_SIZE(CPolyBunch, 0x6C); +#endif class CStaticShadow { @@ -93,7 +99,10 @@ public: void Free(); }; + +#ifdef CHECK_STRUCT_SIZES VALIDATE_SIZE(CStaticShadow, 0x40); +#endif class CPermanentShadow { @@ -115,7 +124,9 @@ public: CPermanentShadow() { } }; +#ifdef CHECK_STRUCT_SIZES VALIDATE_SIZE(CPermanentShadow, 0x38); +#endif class CPtrList; class CAutomobile; -- cgit v1.2.3 From c798e1bacdaabaf140ff3904948fd7cec46c09bb Mon Sep 17 00:00:00 2001 From: bigbossbro08 Date: Sun, 10 May 2020 21:49:33 +0600 Subject: Fixed typos and made all assert functions optional --- src/render/2dEffect.h | 4 +--- src/render/Coronas.h | 4 +--- src/render/Glass.h | 2 -- src/render/Particle.h | 2 -- src/render/PointLights.h | 2 +- src/render/Shadows.h | 3 +-- src/render/WaterCannon.h | 2 +- 7 files changed, 5 insertions(+), 14 deletions(-) (limited to 'src/render') diff --git a/src/render/2dEffect.h b/src/render/2dEffect.h index 8c583799..2a71a8d5 100644 --- a/src/render/2dEffect.h +++ b/src/render/2dEffect.h @@ -90,6 +90,4 @@ public: } }; -#ifdef CHECK_STRUCT_SIZES -static_assert(sizeof(C2dEffect) == 0x34, "C2dEffect: error"); -#endif \ No newline at end of file +VALIDATE_SIZE(C2dEffect, 0x34); diff --git a/src/render/Coronas.h b/src/render/Coronas.h index d2e79079..46eb4315 100644 --- a/src/render/Coronas.h +++ b/src/render/Coronas.h @@ -39,9 +39,7 @@ struct CRegisteredCorona void Update(void); }; -#ifdef CHECK_STRUCT_SIZES -static_assert(sizeof(CRegisteredCorona) == 0x80, "CRegisteredCorona: error"); -#endif +VALIDATE_SIZE(CRegisteredCorona, 0x80); class CCoronas { diff --git a/src/render/Glass.h b/src/render/Glass.h index 0c715c27..51c5aae9 100644 --- a/src/render/Glass.h +++ b/src/render/Glass.h @@ -21,9 +21,7 @@ public: void Render(void); }; -#ifdef CHECK_STRUCT_SIZES VALIDATE_SIZE(CFallingGlassPane, 0x70); -#endif enum { diff --git a/src/render/Particle.h b/src/render/Particle.h index ed1528d2..7f02e318 100644 --- a/src/render/Particle.h +++ b/src/render/Particle.h @@ -91,6 +91,4 @@ public: static void AddYardieDoorSmoke(CVector const &vecPos, CMatrix const &matMatrix); }; -#ifdef CHECK_STRUCT_SIZES VALIDATE_SIZE(CParticle, 0x68); -#endif \ No newline at end of file diff --git a/src/render/PointLights.h b/src/render/PointLights.h index 56b84f71..9e94328f 100644 --- a/src/render/PointLights.h +++ b/src/render/PointLights.h @@ -13,7 +13,7 @@ public: int8 fogType; bool castExtraShadows; }; -static_assert(sizeof(CRegisteredPointLight) == 0x2C, "CRegisteredPointLight: error"); +VALIDATE_SIZE(CRegisteredPointLight, 0x2C); class CPointLights { diff --git a/src/render/Shadows.h b/src/render/Shadows.h index 8e89024d..ef56d336 100644 --- a/src/render/Shadows.h +++ b/src/render/Shadows.h @@ -124,9 +124,8 @@ public: CPermanentShadow() { } }; -#ifdef CHECK_STRUCT_SIZES + VALIDATE_SIZE(CPermanentShadow, 0x38); -#endif class CPtrList; class CAutomobile; diff --git a/src/render/WaterCannon.h b/src/render/WaterCannon.h index d2d20863..a37bdd12 100644 --- a/src/render/WaterCannon.h +++ b/src/render/WaterCannon.h @@ -25,7 +25,7 @@ public: void PushPeds(void); }; -static_assert(sizeof(CWaterCannon) == 412, "CWaterCannon: error"); +VALIDATE_SIZE(CWaterCannon, 412); class CWaterCannons { -- cgit v1.2.3