From 4ccd0a55cfdddaf73573bbe4fb842fbfa3457460 Mon Sep 17 00:00:00 2001 From: Jan Laupetin Date: Sun, 27 Apr 2025 21:05:22 +0200 Subject: [PATCH] chore: adjust game structs to have custom alignment when they are platform independent --- src/Common/Game/IW3/IW3_Assets.h | 14 +++++++------- src/Common/Game/IW4/IW4_Assets.h | 18 +++++++++--------- src/Common/Game/IW5/IW5_Assets.h | 18 +++++++++--------- src/Common/Game/T5/T5_Assets.h | 22 +++++++++++----------- src/Common/Game/T6/T6_Assets.h | 24 ++++++++++++------------ 5 files changed, 48 insertions(+), 48 deletions(-) diff --git a/src/Common/Game/IW3/IW3_Assets.h b/src/Common/Game/IW3/IW3_Assets.h index 772b757c..510aead7 100644 --- a/src/Common/Game/IW3/IW3_Assets.h +++ b/src/Common/Game/IW3/IW3_Assets.h @@ -296,7 +296,7 @@ namespace IW3 uint16_t maxs[3]; }; - struct type_align32(16) XSurfaceCollisionNode + struct type_align(16) XSurfaceCollisionNode { XSurfaceCollisionAabb aabb; uint16_t childBeginIndex; @@ -344,7 +344,7 @@ namespace IW3 char array[4]; }; - struct type_align32(16) GfxPackedVertex + struct type_align(16) GfxPackedVertex { float xyz[3]; float binormalSign; @@ -633,7 +633,7 @@ namespace IW3 unsigned int loadBits[2]; }; - struct type_align32(16) MaterialConstantDef + struct type_align(16) MaterialConstantDef { unsigned int nameHash; char name[12]; @@ -1775,7 +1775,7 @@ namespace IW3 pathnode_tree_info_t u; }; - struct type_align32(16) pathbasenode_t + struct type_align(16) pathbasenode_t { float vOrigin[3]; unsigned int type; @@ -2044,14 +2044,14 @@ namespace IW3 GfxImage* secondary; }; - struct type_align32(4) GfxLightGridEntry + struct type_align(4) GfxLightGridEntry { uint16_t colorsIndex; char primaryLightIndex; char needsTrace; }; - struct type_align32(4) GfxLightGridColors + struct type_align(4) GfxLightGridColors { char rgb[56][3]; }; @@ -2137,7 +2137,7 @@ namespace IW3 uint16_t surfId; }; - struct type_align32(4) GfxSceneDynBrush + struct type_align(4) GfxSceneDynBrush { BModelDrawInfo info; uint16_t dynEntId; diff --git a/src/Common/Game/IW4/IW4_Assets.h b/src/Common/Game/IW4/IW4_Assets.h index 0b8c44c0..03493a12 100644 --- a/src/Common/Game/IW4/IW4_Assets.h +++ b/src/Common/Game/IW4/IW4_Assets.h @@ -442,7 +442,7 @@ namespace IW4 char array[4]; }; - struct type_align32(16) GfxPackedVertex + struct type_align(16) GfxPackedVertex { float xyz[3]; float binormalSign; @@ -458,7 +458,7 @@ namespace IW4 uint16_t maxs[3]; }; - struct type_align32(16) XSurfaceCollisionNode + struct type_align(16) XSurfaceCollisionNode { XSurfaceCollisionAabb aabb; uint16_t childBeginIndex; @@ -673,7 +673,7 @@ namespace IW4 MaterialTextureDefInfo u; }; - struct type_align32(16) MaterialConstantDef + struct type_align(16) MaterialConstantDef { unsigned int nameHash; char name[12]; @@ -2824,7 +2824,7 @@ namespace IW4 int partitionIndex; }; - struct type_align32(16) CollisionAabbTree + struct type_align(16) CollisionAabbTree { float midPoint[3]; uint16_t materialIndex; @@ -3116,7 +3116,7 @@ namespace IW4 pathnode_transient_t transient; }; - struct type_align32(16) pathbasenode_t + struct type_align(16) pathbasenode_t { float vOrigin[3]; unsigned int type; @@ -3313,7 +3313,7 @@ namespace IW4 char endVertIndex; }; - union type_align32(4) FxGlassGeometryData + union type_align(4) FxGlassGeometryData { FxGlassVertex vert; FxGlassHoleHeader hole; @@ -3505,14 +3505,14 @@ namespace IW4 r_index_t* indices; }; - struct type_align32(4) GfxLightGridEntry + struct type_align(4) GfxLightGridEntry { uint16_t colorsIndex; char primaryLightIndex; char needsTrace; }; - struct type_align32(4) GfxLightGridColors + struct type_align(4) GfxLightGridColors { char rgb[56][3]; }; @@ -3599,7 +3599,7 @@ namespace IW4 uint16_t surfId; }; - struct type_align32(4) GfxSceneDynBrush + struct type_align(4) GfxSceneDynBrush { BModelDrawInfo info; uint16_t dynEntId; diff --git a/src/Common/Game/IW5/IW5_Assets.h b/src/Common/Game/IW5/IW5_Assets.h index 1e52e7af..ef9a37b6 100644 --- a/src/Common/Game/IW5/IW5_Assets.h +++ b/src/Common/Game/IW5/IW5_Assets.h @@ -491,7 +491,7 @@ namespace IW5 unsigned char array[4]; }; - struct type_align32(16) GfxPackedVertex + struct type_align(16) GfxPackedVertex { vec3_t xyz; float binormalSign; @@ -507,7 +507,7 @@ namespace IW5 unsigned short maxs[3]; }; - struct type_align32(16) XSurfaceCollisionNode + struct type_align(16) XSurfaceCollisionNode { XSurfaceCollisionAabb aabb; unsigned short childBeginIndex; @@ -822,7 +822,7 @@ namespace IW5 MaterialTextureDefInfo u; }; - struct type_align32(16) MaterialConstantDef + struct type_align(16) MaterialConstantDef { unsigned int nameHash; char name[12]; @@ -1410,7 +1410,7 @@ namespace IW5 int partitionIndex; }; - struct type_align32(16) CollisionAabbTree + struct type_align(16) CollisionAabbTree { float midPoint[3]; unsigned short materialIndex; @@ -1761,7 +1761,7 @@ namespace IW5 pathnode_transient_t transient; }; - struct type_align32(16) pathbasenode_t + struct type_align(16) pathbasenode_t { float vOrigin[3]; unsigned int type; @@ -1948,7 +1948,7 @@ namespace IW5 unsigned char endVertIndex; }; - union type_align32(4) FxGlassGeometryData + union type_align(4) FxGlassGeometryData { FxGlassVertex vert; FxGlassHoleHeader hole; @@ -2155,14 +2155,14 @@ namespace IW5 r_index_t* indices; }; - struct type_align32(4) GfxLightGridEntry + struct type_align(4) GfxLightGridEntry { unsigned short colorsIndex; unsigned char primaryLightIndex; unsigned char needsTrace; }; - struct type_align32(4) GfxLightGridColors + struct type_align(4) GfxLightGridColors { unsigned char rgb[56][3]; }; @@ -2250,7 +2250,7 @@ namespace IW5 unsigned short surfId; }; - struct type_align32(4) GfxSceneDynBrush + struct type_align(4) GfxSceneDynBrush { BModelDrawInfo info; unsigned short dynEntId; diff --git a/src/Common/Game/T5/T5_Assets.h b/src/Common/Game/T5/T5_Assets.h index 95da5a75..fa562d38 100644 --- a/src/Common/Game/T5/T5_Assets.h +++ b/src/Common/Game/T5/T5_Assets.h @@ -490,7 +490,7 @@ namespace T5 char array[4]; }; - struct type_align32(16) GfxPackedVertex + struct type_align(16) GfxPackedVertex { vec3_t xyz; float binormalSign; @@ -511,7 +511,7 @@ namespace T5 uint16_t maxs[3]; }; - struct type_align32(16) XSurfaceCollisionNode + struct type_align(16) XSurfaceCollisionNode { XSurfaceCollisionAabb aabb; uint16_t childBeginIndex; @@ -796,7 +796,7 @@ namespace T5 MaterialTextureDefInfo u; }; - struct type_align32(16) MaterialConstantDef + struct type_align(16) MaterialConstantDef { unsigned int nameHash; char name[12]; @@ -1254,7 +1254,7 @@ namespace T5 int sequence; }; - struct type_align32(4) SndIndexEntry + struct type_align(4) SndIndexEntry { uint16_t value; uint16_t next; @@ -1409,7 +1409,7 @@ namespace T5 int partitionIndex; }; - struct type_align32(16) CollisionAabbTree + struct type_align(16) CollisionAabbTree { float origin[3]; uint16_t materialIndex; @@ -1687,7 +1687,7 @@ namespace T5 int maxy; }; - struct type_align32(4) ComWaterCell + struct type_align(4) ComWaterCell { int16_t waterheight; char flooroffset; @@ -1826,7 +1826,7 @@ namespace T5 pathnode_transient_t transient; }; - struct type_align32(16) pathbasenode_t + struct type_align(16) pathbasenode_t { float vOrigin[3]; unsigned int type; @@ -1926,7 +1926,7 @@ namespace T5 GfxWorldSunColor sunSettings[1]; }; - struct type_align32(16) float44 + struct type_align(16) float44 { union { @@ -2130,14 +2130,14 @@ namespace T5 uint16_t* indices; }; - struct type_align32(4) GfxLightGridEntry + struct type_align(4) GfxLightGridEntry { uint16_t colorsIndex; char primaryLightIndex; char needsTrace; }; - struct type_align32(4) GfxCompressedLightGridColors + struct type_align(4) GfxCompressedLightGridColors { char rgb[56][3]; }; @@ -2227,7 +2227,7 @@ namespace T5 uint16_t surfId; }; - struct type_align32(4) GfxSceneDynBrush + struct type_align(4) GfxSceneDynBrush { BModelDrawInfo info; uint16_t dynEntId; diff --git a/src/Common/Game/T6/T6_Assets.h b/src/Common/Game/T6/T6_Assets.h index c61a3885..b607c7cc 100644 --- a/src/Common/Game/T6/T6_Assets.h +++ b/src/Common/Game/T6/T6_Assets.h @@ -2883,7 +2883,7 @@ namespace T6 GfxImage* image; }; - struct type_align32(16) MaterialConstantDef + struct type_align(16) MaterialConstantDef { unsigned int nameHash; char name[12]; @@ -3076,7 +3076,7 @@ namespace T6 int sequence; }; - struct type_align32(4) SndIndexEntry + struct type_align(4) SndIndexEntry { uint16_t value; uint16_t next; @@ -3261,7 +3261,7 @@ namespace T6 int partitionIndex; }; - struct type_align32(16) CollisionAabbTree + struct type_align(16) CollisionAabbTree { vec3_t origin; uint16_t materialIndex; @@ -3526,7 +3526,7 @@ namespace T6 pathnode_transient_t transient; }; - struct type_align32(16) pathbasenode_t + struct type_align(16) pathbasenode_t { vec3_t vOrigin; unsigned int type; @@ -3573,7 +3573,7 @@ namespace T6 float halfSize; }; - struct type_align32(16) GfxStreamingAabbTree + struct type_align(16) GfxStreamingAabbTree { vec4_t mins; vec4_t maxs; @@ -3586,7 +3586,7 @@ namespace T6 uint16_t surfaceCount; }; - struct type_align32(16) float44 + struct type_align(16) float44 { union { @@ -3734,14 +3734,14 @@ namespace T6 { };*/ - struct type_align32(4) GfxLightGridEntry + struct type_align(4) GfxLightGridEntry { uint16_t colorsIndex; char primaryLightIndex; char visibility; }; - struct type_align32(4) GfxCompressedLightGridColors + struct type_align(4) GfxCompressedLightGridColors { char rgb[56][3]; }; @@ -3769,7 +3769,7 @@ namespace T6 float padding2; }; - struct type_align32(16) GfxBrushModel + struct type_align(16) GfxBrushModel { GfxBrushModelWritable writable; vec3_t bounds[2]; @@ -3808,7 +3808,7 @@ namespace T6 uint16_t surfId; }; - struct type_align32(4) GfxSceneDynBrush + struct type_align(4) GfxSceneDynBrush { BModelDrawInfo info; uint16_t dynEntId; @@ -5712,7 +5712,7 @@ namespace T6 unsigned int packed; }; - struct type_align32(16) GfxPackedVertex + struct type_align(16) GfxPackedVertex { vec3_t xyz; float binormalSign; @@ -6994,7 +6994,7 @@ namespace T6 uint16_t maxs[3]; }; - struct type_align32(16) XSurfaceCollisionNode + struct type_align(16) XSurfaceCollisionNode { XSurfaceCollisionAabb aabb; uint16_t childBeginIndex;