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/core/Camera.h | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'src/core/Camera.h') diff --git a/src/core/Camera.h b/src/core/Camera.h index 51138f99..d69b1be4 100644 --- a/src/core/Camera.h +++ b/src/core/Camera.h @@ -260,9 +260,12 @@ public: void Process_FollowPed_Rotation(const CVector &CameraTarget, float TargetOrientation, float, float); void Process_FollowCar_SA(const CVector &CameraTarget, float TargetOrientation, float, float); }; + +#ifdef CHECK_STRUCT_SIZES static_assert(sizeof(CCam) == 0x1A4, "CCam: wrong size"); static_assert(offsetof(CCam, Alpha) == 0xA8, "CCam: error"); static_assert(offsetof(CCam, Front) == 0x140, "CCam: error"); +#endif class CCamPathSplines { @@ -637,6 +640,8 @@ uint32 unknown; // some counter having to do with music bool IsSphereVisible(const CVector ¢er, float radius); bool IsBoxVisible(RwV3d *box, const CMatrix *mat); }; + +#ifdef CHECK_STRUCT_SIZES static_assert(offsetof(CCamera, DistanceToWater) == 0xe4, "CCamera: error"); static_assert(offsetof(CCamera, m_WideScreenOn) == 0x70, "CCamera: error"); static_assert(offsetof(CCamera, WorldViewerBeingUsed) == 0x75, "CCamera: error"); @@ -650,6 +655,7 @@ static_assert(offsetof(CCamera, m_PreviousCameraPosition) == 0x6B0, "CCamera: er static_assert(offsetof(CCamera, m_vecCutSceneOffset) == 0x6F8, "CCamera: error"); static_assert(offsetof(CCamera, m_arrPathArray) == 0x7a8, "CCamera: error"); static_assert(sizeof(CCamera) == 0xE9D8, "CCamera: wrong size"); +#endif extern CCamera TheCamera; -- 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/core/Camera.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'src/core/Camera.h') 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 -- cgit v1.2.3 From b4abb6ddd8c2daee13cc9f83f17286fdf286c798 Mon Sep 17 00:00:00 2001 From: bigbossbro08 Date: Sun, 10 May 2020 22:04:36 +0600 Subject: fixed few more typos --- src/core/Camera.h | 20 +------------------- 1 file changed, 1 insertion(+), 19 deletions(-) (limited to 'src/core/Camera.h') diff --git a/src/core/Camera.h b/src/core/Camera.h index b197aed3..94bcbd23 100644 --- a/src/core/Camera.h +++ b/src/core/Camera.h @@ -262,10 +262,6 @@ public: }; 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 class CCamPathSplines { @@ -641,21 +637,7 @@ uint32 unknown; // some counter having to do with music bool IsBoxVisible(RwV3d *box, const CMatrix *mat); }; -#ifdef CHECK_STRUCT_SIZES -static_assert(offsetof(CCamera, DistanceToWater) == 0xe4, "CCamera: error"); -static_assert(offsetof(CCamera, m_WideScreenOn) == 0x70, "CCamera: error"); -static_assert(offsetof(CCamera, WorldViewerBeingUsed) == 0x75, "CCamera: error"); -static_assert(offsetof(CCamera, m_uiNumberOfTrainCamNodes) == 0x84, "CCamera: error"); -static_assert(offsetof(CCamera, m_uiTransitionState) == 0x89, "CCamera: error"); -static_assert(offsetof(CCamera, m_uiTimeTransitionStart) == 0x94, "CCamera: error"); -static_assert(offsetof(CCamera, m_BlurBlue) == 0x9C, "CCamera: error"); -static_assert(offsetof(CCamera, Cams) == 0x1A4, "CCamera: error"); -static_assert(offsetof(CCamera, pToGarageWeAreIn) == 0x690, "CCamera: error"); -static_assert(offsetof(CCamera, m_PreviousCameraPosition) == 0x6B0, "CCamera: error"); -static_assert(offsetof(CCamera, m_vecCutSceneOffset) == 0x6F8, "CCamera: error"); -static_assert(offsetof(CCamera, m_arrPathArray) == 0x7a8, "CCamera: error"); -static_assert(sizeof(CCamera) == 0xE9D8, "CCamera: wrong size"); -#endif +VALIDATE_SIZE(CCamera, 0xE9D8); extern CCamera TheCamera; -- cgit v1.2.3