diff --git a/src/Common/Game/IW3/IW3_Assets.h b/src/Common/Game/IW3/IW3_Assets.h index 9e3ae951..772b757c 100644 --- a/src/Common/Game/IW3/IW3_Assets.h +++ b/src/Common/Game/IW3/IW3_Assets.h @@ -135,7 +135,7 @@ namespace IW3 typedef float vec2_t[2]; typedef float vec3_t[3]; typedef float vec4_t[4]; - typedef tdef_align(128) unsigned int raw_uint128; + typedef tdef_align32(128) unsigned int raw_uint128; struct XModelPiece { @@ -179,7 +179,7 @@ namespace IW3 }; typedef unsigned char ByteVec[3]; - typedef tdef_align(4) unsigned short UShortVec[3]; + typedef tdef_align32(4) unsigned short UShortVec[3]; union XAnimDynamicIndicesTrans { @@ -214,7 +214,7 @@ namespace IW3 XAnimPartTransData u; }; - typedef tdef_align(4) short XQuat[2]; + typedef tdef_align32(4) short XQuat[2]; union XAnimDynamicIndicesQuat { @@ -296,7 +296,7 @@ namespace IW3 uint16_t maxs[3]; }; - struct type_align(16) XSurfaceCollisionNode + struct type_align32(16) XSurfaceCollisionNode { XSurfaceCollisionAabb aabb; uint16_t childBeginIndex; @@ -344,7 +344,7 @@ namespace IW3 char array[4]; }; - struct type_align(16) GfxPackedVertex + struct type_align32(16) GfxPackedVertex { float xyz[3]; float binormalSign; @@ -360,7 +360,7 @@ namespace IW3 uint16_t* vertsBlend; }; - typedef tdef_align(16) uint16_t r_index16_t; + typedef tdef_align32(16) uint16_t r_index16_t; struct XSurface { @@ -633,7 +633,7 @@ namespace IW3 unsigned int loadBits[2]; }; - struct type_align(16) MaterialConstantDef + struct type_align32(16) MaterialConstantDef { unsigned int nameHash; char name[12]; @@ -709,7 +709,7 @@ namespace IW3 MaterialTextureDefInfo u; }; - struct gcc_align(8) GfxDrawSurfFields + struct gcc_align32(8) GfxDrawSurfFields { uint64_t objectId : 16; uint64_t reflectionProbeIndex : 8; @@ -724,8 +724,8 @@ namespace IW3 union GfxDrawSurf { - gcc_align(8) GfxDrawSurfFields fields; - gcc_align(8) uint64_t packed; + gcc_align32(8) GfxDrawSurfFields fields; + gcc_align32(8) uint64_t packed; }; enum materialSurfType_t @@ -1605,7 +1605,7 @@ namespace IW3 cLeaf_t leaf; }; - struct type_align(16) cbrush_t + struct type_align32(16) cbrush_t { float mins[3]; int contents; @@ -1671,7 +1671,7 @@ namespace IW3 typedef unsigned short LeafBrush; - typedef tdef_align(16) cbrush_t cbrush_array_t; + typedef tdef_align32(16) cbrush_t cbrush_array_t; struct clipMap_t { @@ -1775,7 +1775,7 @@ namespace IW3 pathnode_tree_info_t u; }; - struct type_align(16) pathbasenode_t + struct type_align32(16) pathbasenode_t { float vOrigin[3]; unsigned int type; @@ -2044,14 +2044,14 @@ namespace IW3 GfxImage* secondary; }; - struct type_align(4) GfxLightGridEntry + struct type_align32(4) GfxLightGridEntry { uint16_t colorsIndex; char primaryLightIndex; char needsTrace; }; - struct type_align(4) GfxLightGridColors + struct type_align32(4) GfxLightGridColors { char rgb[56][3]; }; @@ -2137,7 +2137,7 @@ namespace IW3 uint16_t surfId; }; - struct type_align(4) GfxSceneDynBrush + struct type_align32(4) GfxSceneDynBrush { BModelDrawInfo info; uint16_t dynEntId; @@ -2265,7 +2265,7 @@ namespace IW3 char pad; }; - typedef tdef_align(4) GfxSceneDynModel GfxSceneDynModel4; + typedef tdef_align32(4) GfxSceneDynModel GfxSceneDynModel4; struct GfxWorld { diff --git a/src/Common/Game/IW4/IW4_Assets.h b/src/Common/Game/IW4/IW4_Assets.h index 2eda44b9..0b8c44c0 100644 --- a/src/Common/Game/IW4/IW4_Assets.h +++ b/src/Common/Game/IW4/IW4_Assets.h @@ -155,10 +155,10 @@ namespace IW4 void* data; }; - typedef tdef_align(16) char raw_byte16; - typedef tdef_align(16) float raw_float16; + typedef tdef_align32(16) char raw_byte16; + typedef tdef_align32(16) float raw_float16; typedef unsigned int raw_uint; - typedef tdef_align(128) unsigned int raw_uint128; + typedef tdef_align32(128) unsigned int raw_uint128; typedef unsigned char cbrushedge_t; typedef unsigned short r_index_t; typedef float vec2_t[2]; @@ -289,7 +289,7 @@ namespace IW4 }; typedef unsigned char ByteVec[3]; - typedef tdef_align(4) unsigned short UShortVec[3]; + typedef tdef_align32(4) unsigned short UShortVec[3]; union XAnimDynamicFrames { @@ -303,7 +303,7 @@ namespace IW4 uint16_t _2[1]; }; - struct type_align(4) XAnimPartTransFrames + struct type_align32(4) XAnimPartTransFrames { float mins[3]; float size[3]; @@ -330,9 +330,9 @@ namespace IW4 uint16_t _2[1]; }; - typedef tdef_align(4) short XQuat2[2]; + typedef tdef_align32(4) short XQuat2[2]; - struct type_align(4) XAnimDeltaPartQuatDataFrames2 + struct type_align32(4) XAnimDeltaPartQuatDataFrames2 { XQuat2* frames; XAnimDynamicIndicesQuat2 indices; @@ -356,7 +356,7 @@ namespace IW4 uint16_t _2[1]; }; - typedef tdef_align(4) short XQuat[4]; + typedef tdef_align32(4) short XQuat[4]; struct XAnimDeltaPartQuatDataFrames { @@ -442,7 +442,7 @@ namespace IW4 char array[4]; }; - struct type_align(16) GfxPackedVertex + struct type_align32(16) GfxPackedVertex { float xyz[3]; float binormalSign; @@ -458,7 +458,7 @@ namespace IW4 uint16_t maxs[3]; }; - struct type_align(16) XSurfaceCollisionNode + struct type_align32(16) XSurfaceCollisionNode { XSurfaceCollisionAabb aabb; uint16_t childBeginIndex; @@ -489,7 +489,7 @@ namespace IW4 XSurfaceCollisionTree* collisionTree; }; - typedef tdef_align(16) uint16_t r_index16_t; + typedef tdef_align32(16) uint16_t r_index16_t; struct XSurface { @@ -673,7 +673,7 @@ namespace IW4 MaterialTextureDefInfo u; }; - struct type_align(16) MaterialConstantDef + struct type_align32(16) MaterialConstantDef { unsigned int nameHash; char name[12]; @@ -843,7 +843,7 @@ namespace IW4 unsigned int toolFlags; }; - struct gcc_align(8) GfxDrawSurfFields + struct gcc_align32(8) GfxDrawSurfFields { uint64_t objectId : 16; uint64_t reflectionProbeIndex : 8; @@ -860,8 +860,8 @@ namespace IW4 union GfxDrawSurf { - gcc_align(8) GfxDrawSurfFields fields; - gcc_align(8) uint64_t packed; + gcc_align32(8) GfxDrawSurfFields fields; + gcc_align32(8) uint64_t packed; }; // The sort key is translated to a numeric value inside the material templates @@ -993,7 +993,7 @@ namespace IW4 GfxStateBits* stateBitsTable; }; - struct type_align(4) GfxImageLoadDef + struct type_align32(4) GfxImageLoadDef { char levelCount; char pad[3]; @@ -2824,7 +2824,7 @@ namespace IW4 int partitionIndex; }; - struct type_align(16) CollisionAabbTree + struct type_align32(16) CollisionAabbTree { float midPoint[3]; uint16_t materialIndex; @@ -2918,8 +2918,8 @@ namespace IW4 float linkMaxs[2]; }; - typedef tdef_align(128) cbrush_t cbrush_array_t; - typedef tdef_align(128) Bounds BoundsArray; + typedef tdef_align32(128) cbrush_t cbrush_array_t; + typedef tdef_align32(128) Bounds BoundsArray; struct clipMap_t { @@ -3116,7 +3116,7 @@ namespace IW4 pathnode_transient_t transient; }; - struct type_align(16) pathbasenode_t + struct type_align32(16) pathbasenode_t { float vOrigin[3]; unsigned int type; @@ -3313,7 +3313,7 @@ namespace IW4 char endVertIndex; }; - union type_align(4) FxGlassGeometryData + union type_align32(4) FxGlassGeometryData { FxGlassVertex vert; FxGlassHoleHeader hole; @@ -3505,14 +3505,14 @@ namespace IW4 r_index_t* indices; }; - struct type_align(4) GfxLightGridEntry + struct type_align32(4) GfxLightGridEntry { uint16_t colorsIndex; char primaryLightIndex; char needsTrace; }; - struct type_align(4) GfxLightGridColors + struct type_align32(4) GfxLightGridColors { char rgb[56][3]; }; @@ -3539,7 +3539,7 @@ namespace IW4 Bounds bounds; }; - struct type_align(4) GfxBrushModel + struct type_align32(4) GfxBrushModel { GfxBrushModelWritable writable; Bounds bounds; @@ -3599,7 +3599,7 @@ namespace IW4 uint16_t surfId; }; - struct type_align(4) GfxSceneDynBrush + struct type_align32(4) GfxSceneDynBrush { BModelDrawInfo info; uint16_t dynEntId; @@ -3744,8 +3744,8 @@ namespace IW4 int exponent; }; - typedef tdef_align(128) GfxCellTree GfxCellTree128; - typedef tdef_align(4) GfxSceneDynModel GfxSceneDynModel4; + typedef tdef_align32(128) GfxCellTree GfxCellTree128; + typedef tdef_align32(4) GfxSceneDynModel GfxSceneDynModel4; struct GfxWorld { diff --git a/src/Common/Game/IW5/IW5_Assets.h b/src/Common/Game/IW5/IW5_Assets.h index c506f3f2..1e52e7af 100644 --- a/src/Common/Game/IW5/IW5_Assets.h +++ b/src/Common/Game/IW5/IW5_Assets.h @@ -221,9 +221,9 @@ namespace IW5 }; }; - typedef tdef_align(16) char raw_byte16; - typedef tdef_align(16) float raw_float16; - typedef tdef_align(128) unsigned int raw_uint128; + typedef tdef_align32(16) char raw_byte16; + typedef tdef_align32(16) float raw_float16; + typedef tdef_align32(128) unsigned int raw_uint128; typedef unsigned char raw_byte; typedef unsigned int raw_uint; typedef unsigned short r_index_t; @@ -338,7 +338,7 @@ namespace IW5 }; typedef unsigned char ByteVec[3]; - typedef tdef_align(4) unsigned short UShortVec[3]; + typedef tdef_align32(4) unsigned short UShortVec[3]; union XAnimDynamicFrames { @@ -352,7 +352,7 @@ namespace IW5 uint16_t _2[1]; }; - struct type_align(4) XAnimPartTransFrames + struct type_align32(4) XAnimPartTransFrames { float mins[3]; float size[3]; @@ -379,9 +379,9 @@ namespace IW5 uint16_t _2[1]; }; - typedef tdef_align(4) short XQuat2[2]; + typedef tdef_align32(4) short XQuat2[2]; - struct type_align(4) XAnimDeltaPartQuatDataFrames2 + struct type_align32(4) XAnimDeltaPartQuatDataFrames2 { XQuat2* frames; XAnimDynamicIndicesQuat2 indices; @@ -405,7 +405,7 @@ namespace IW5 uint16_t _2[1]; }; - typedef tdef_align(4) short XQuat[4]; + typedef tdef_align32(4) short XQuat[4]; struct XAnimDeltaPartQuatDataFrames { @@ -491,7 +491,7 @@ namespace IW5 unsigned char array[4]; }; - struct type_align(16) GfxPackedVertex + struct type_align32(16) GfxPackedVertex { vec3_t xyz; float binormalSign; @@ -507,7 +507,7 @@ namespace IW5 unsigned short maxs[3]; }; - struct type_align(16) XSurfaceCollisionNode + struct type_align32(16) XSurfaceCollisionNode { XSurfaceCollisionAabb aabb; unsigned short childBeginIndex; @@ -543,7 +543,7 @@ namespace IW5 uint16_t i[3]; }; - typedef tdef_align(16) XSurfaceTri XSurfaceTri16; + typedef tdef_align32(16) XSurfaceTri XSurfaceTri16; struct XSurface { @@ -653,7 +653,7 @@ namespace IW5 float quantization; }; - struct gcc_align(8) GfxDrawSurfFields + struct gcc_align32(8) GfxDrawSurfFields { uint64_t unused : 1; uint64_t primarySortKey : 6; @@ -671,8 +671,8 @@ namespace IW5 union GfxDrawSurf { - gcc_align(8) GfxDrawSurfFields fields; - gcc_align(8) uint64_t packed; + gcc_align32(8) GfxDrawSurfFields fields; + gcc_align32(8) uint64_t packed; }; enum MaterialGameFlags @@ -822,7 +822,7 @@ namespace IW5 MaterialTextureDefInfo u; }; - struct type_align(16) MaterialConstantDef + struct type_align32(16) MaterialConstantDef { unsigned int nameHash; char name[12]; @@ -1127,7 +1127,7 @@ namespace IW5 MaterialTechnique* techniques[54]; }; - struct type_align(4) GfxImageLoadDef + struct type_align32(4) GfxImageLoadDef { char levelCount; char pad[3]; @@ -1339,8 +1339,8 @@ namespace IW5 unsigned char edgeCount[2][3]; }; - typedef tdef_align(128) cbrush_t cbrush_array_t; - typedef tdef_align(128) Bounds BoundsArray; + typedef tdef_align32(128) cbrush_t cbrush_array_t; + typedef tdef_align32(128) Bounds BoundsArray; struct ClipInfo { @@ -1410,7 +1410,7 @@ namespace IW5 int partitionIndex; }; - struct type_align(16) CollisionAabbTree + struct type_align32(16) CollisionAabbTree { float midPoint[3]; unsigned short materialIndex; @@ -1761,7 +1761,7 @@ namespace IW5 pathnode_transient_t transient; }; - struct type_align(16) pathbasenode_t + struct type_align32(16) pathbasenode_t { float vOrigin[3]; unsigned int type; @@ -1948,7 +1948,7 @@ namespace IW5 unsigned char endVertIndex; }; - union type_align(4) FxGlassGeometryData + union type_align32(4) FxGlassGeometryData { FxGlassVertex vert; FxGlassHoleHeader hole; @@ -2155,14 +2155,14 @@ namespace IW5 r_index_t* indices; }; - struct type_align(4) GfxLightGridEntry + struct type_align32(4) GfxLightGridEntry { unsigned short colorsIndex; unsigned char primaryLightIndex; unsigned char needsTrace; }; - struct type_align(4) GfxLightGridColors + struct type_align32(4) GfxLightGridColors { unsigned char rgb[56][3]; }; @@ -2190,7 +2190,7 @@ namespace IW5 Bounds bounds; }; - struct type_align(4) GfxBrushModel + struct type_align32(4) GfxBrushModel { GfxBrushModelWritable writable; Bounds bounds; @@ -2250,7 +2250,7 @@ namespace IW5 unsigned short surfId; }; - struct type_align(4) GfxSceneDynBrush + struct type_align32(4) GfxSceneDynBrush { BModelDrawInfo info; unsigned short dynEntId; @@ -2396,7 +2396,7 @@ namespace IW5 int exponent; }; - typedef tdef_align(128) GfxCellTree GfxCellTree128; + typedef tdef_align32(128) GfxCellTree GfxCellTree128; struct GfxWorld { @@ -3446,7 +3446,7 @@ namespace IW5 SndAliasCustom projIgnitionSound; }; - typedef tdef_align(4) AttSight AttSight4; + typedef tdef_align32(4) AttSight AttSight4; struct WeaponAttachment { diff --git a/src/Common/Game/T5/T5_Assets.h b/src/Common/Game/T5/T5_Assets.h index 03235510..95da5a75 100644 --- a/src/Common/Game/T5/T5_Assets.h +++ b/src/Common/Game/T5/T5_Assets.h @@ -193,20 +193,20 @@ namespace T5 void* data; }; - typedef tdef_align(16) char char16; - typedef tdef_align(32) char byte32; - typedef tdef_align(128) char byte128; + typedef tdef_align32(16) char char16; + typedef tdef_align32(32) char byte32; + typedef tdef_align32(128) char byte128; - typedef tdef_align(4) char char_align4; - typedef tdef_align(128) char char_align128; + typedef tdef_align32(4) char char_align4; + typedef tdef_align32(128) char char_align128; - typedef tdef_align(16) char raw_byte16; - typedef tdef_align(128) char raw_byte128; + typedef tdef_align32(16) char raw_byte16; + typedef tdef_align32(128) char raw_byte128; - typedef tdef_align(128) float float_align128; + typedef tdef_align32(128) float float_align128; typedef char cbrushedge_t; - typedef tdef_align(128) unsigned int raw_uint128; + typedef tdef_align32(128) unsigned int raw_uint128; typedef uint16_t ScriptString; @@ -350,7 +350,7 @@ namespace T5 }; typedef unsigned char ByteVec[3]; - typedef tdef_align(4) unsigned short UShortVec[3]; + typedef tdef_align32(4) unsigned short UShortVec[3]; union XAnimDynamicFrames { @@ -385,7 +385,7 @@ namespace T5 XAnimPartTransData u; }; - typedef tdef_align(4) short XQuat[2]; + typedef tdef_align32(4) short XQuat[2]; union XAnimDynamicIndicesQuat { @@ -490,7 +490,7 @@ namespace T5 char array[4]; }; - struct type_align(16) GfxPackedVertex + struct type_align32(16) GfxPackedVertex { vec3_t xyz; float binormalSign; @@ -511,7 +511,7 @@ namespace T5 uint16_t maxs[3]; }; - struct type_align(16) XSurfaceCollisionNode + struct type_align32(16) XSurfaceCollisionNode { XSurfaceCollisionAabb aabb; uint16_t childBeginIndex; @@ -542,7 +542,7 @@ namespace T5 uint16_t i[3]; }; - typedef tdef_align(16) XSurfaceTri XSurfaceTri16; + typedef tdef_align32(16) XSurfaceTri XSurfaceTri16; struct XSurface { @@ -627,7 +627,7 @@ namespace T5 int sflags; }; - struct type_align(16) BrushWrapper + struct type_align32(16) BrushWrapper { vec3_t mins; int contents; @@ -650,7 +650,7 @@ namespace T5 vec3_t halfLengths; }; - typedef tdef_align(16) PhysGeomInfo PhysGeomInfo16; + typedef tdef_align32(16) PhysGeomInfo PhysGeomInfo16; struct PhysGeomList { @@ -713,7 +713,7 @@ namespace T5 PhysConstraints* physConstraints; }; - struct gcc_align(8) GfxDrawSurfFields + struct gcc_align32(8) GfxDrawSurfFields { uint64_t objectId : 16; uint64_t fade : 4; @@ -732,8 +732,8 @@ namespace T5 union GfxDrawSurf { - gcc_align(8) GfxDrawSurfFields fields; - gcc_align(8) uint64_t packed; + gcc_align32(8) GfxDrawSurfFields fields; + gcc_align32(8) uint64_t packed; }; struct MaterialInfo @@ -796,7 +796,7 @@ namespace T5 MaterialTextureDefInfo u; }; - struct type_align(16) MaterialConstantDef + struct type_align32(16) MaterialConstantDef { unsigned int nameHash; char name[12]; @@ -1138,7 +1138,7 @@ namespace T5 SND_ASSET_FLAG_PAD_LOOP_BUFFER = 0x2, }; - typedef tdef_align(2048) char snd_align_char; + typedef tdef_align32(2048) char snd_align_char; struct snd_asset { @@ -1164,7 +1164,7 @@ namespace T5 snd_asset sound; }; - typedef tdef_align(2048) char char_align_2048; + typedef tdef_align32(2048) char char_align_2048; struct PrimedSound { @@ -1254,7 +1254,7 @@ namespace T5 int sequence; }; - struct type_align(4) SndIndexEntry + struct type_align32(4) SndIndexEntry { uint16_t value; uint16_t next; @@ -1409,7 +1409,7 @@ namespace T5 int partitionIndex; }; - struct type_align(16) CollisionAabbTree + struct type_align32(16) CollisionAabbTree { float origin[3]; uint16_t materialIndex; @@ -1426,7 +1426,7 @@ namespace T5 cLeaf_s leaf; }; - struct type_align(16) cbrush_t + struct type_align32(16) cbrush_t { float mins[3]; int contents; @@ -1687,7 +1687,7 @@ namespace T5 int maxy; }; - struct type_align(4) ComWaterCell + struct type_align32(4) ComWaterCell { int16_t waterheight; char flooroffset; @@ -1826,7 +1826,7 @@ namespace T5 pathnode_transient_t transient; }; - struct type_align(16) pathbasenode_t + struct type_align32(16) pathbasenode_t { float vOrigin[3]; unsigned int type; @@ -1926,7 +1926,7 @@ namespace T5 GfxWorldSunColor sunSettings[1]; }; - struct type_align(16) float44 + struct type_align32(16) float44 { union { @@ -1935,7 +1935,7 @@ namespace T5 }; }; - struct type_align(16) GfxLight + struct type_align32(16) GfxLight { char type; char canUseShadowMap; @@ -2130,19 +2130,19 @@ namespace T5 uint16_t* indices; }; - struct type_align(4) GfxLightGridEntry + struct type_align32(4) GfxLightGridEntry { uint16_t colorsIndex; char primaryLightIndex; char needsTrace; }; - struct type_align(4) GfxCompressedLightGridColors + struct type_align32(4) GfxCompressedLightGridColors { char rgb[56][3]; }; - typedef tdef_align(4) char aligned_byte_pointer; + typedef tdef_align32(4) char aligned_byte_pointer; struct GfxLightGrid { @@ -2220,14 +2220,14 @@ namespace T5 uint16_t dynEntId; }; - typedef tdef_align(4) GfxSceneDynModel GfxSceneDynModel4; + typedef tdef_align32(4) GfxSceneDynModel GfxSceneDynModel4; struct BModelDrawInfo { uint16_t surfId; }; - struct type_align(4) GfxSceneDynBrush + struct type_align32(4) GfxSceneDynBrush { BModelDrawInfo info; uint16_t dynEntId; @@ -2283,7 +2283,7 @@ namespace T5 int stream2ByteOffset; }; - struct type_align(16) GfxSurface + struct type_align32(16) GfxSurface { srfTriangles_t tris; Material* material; @@ -2935,7 +2935,7 @@ namespace T5 ITEM_TYPE_MENUMODEL = 0x27 }; - struct type_align(8) itemDef_s + struct type_align32(8) itemDef_s { windowDef_t window; int type; @@ -2949,15 +2949,15 @@ namespace T5 menuDef_t* parent; rectData_s* rectExpData; ExpressionStatement visibleExp; - gcc_align(8) uint64_t showBits; - gcc_align(8) uint64_t hideBits; + gcc_align32(8) uint64_t showBits; + gcc_align32(8) uint64_t hideBits; ExpressionStatement forecolorAExp; int ui3dWindowId; GenericEventHandler* onEvent; UIAnimInfo* animInfo; }; - struct type_align(8) menuDef_t + struct type_align32(8) menuDef_t { windowDef_t window; const char* font; @@ -2984,8 +2984,8 @@ namespace T5 GenericEventHandler* onEvent; ItemKeyHandler* onKey; ExpressionStatement visibleExp; - gcc_align(8) uint64_t showBits; - gcc_align(8) uint64_t hideBits; + gcc_align32(8) uint64_t showBits; + gcc_align32(8) uint64_t hideBits; const char* allowedBinding; const char* soundName; int imageTrack; diff --git a/src/Common/Game/T6/T6_Assets.h b/src/Common/Game/T6/T6_Assets.h index 628ce514..c61a3885 100644 --- a/src/Common/Game/T6/T6_Assets.h +++ b/src/Common/Game/T6/T6_Assets.h @@ -10,17 +10,17 @@ namespace T6 { #endif - typedef tdef_align(16) char char16; - typedef tdef_align(32) char byte32; - typedef tdef_align(128) char byte128; + typedef tdef_align32(16) char char16; + typedef tdef_align32(32) char byte32; + typedef tdef_align32(128) char byte128; - typedef tdef_align(4) char char_align4; - typedef tdef_align(128) char char_align128; + typedef tdef_align32(4) char char_align4; + typedef tdef_align32(128) char char_align128; - typedef tdef_align(16) char raw_byte16; - typedef tdef_align(128) char raw_byte128; + typedef tdef_align32(16) char raw_byte16; + typedef tdef_align32(128) char raw_byte128; - typedef tdef_align(128) float float_align128; + typedef tdef_align32(128) float float_align128; typedef uint16_t ScriptString; @@ -643,7 +643,7 @@ namespace T6 float lightingOriginRange; }; - struct gcc_align(8) GfxDrawSurfFields + struct gcc_align32(8) GfxDrawSurfFields { uint64_t objectId : 16; uint64_t customIndex : 9; @@ -658,8 +658,8 @@ namespace T6 union GfxDrawSurf { - gcc_align(8) GfxDrawSurfFields fields; - gcc_align(8) uint64_t packed; + gcc_align32(8) GfxDrawSurfFields fields; + gcc_align32(8) uint64_t packed; }; // The sort key is translated to a numeric value inside the material templates @@ -702,7 +702,7 @@ namespace T6 MTL_GAMEFLAG_1000 = 0x1000, }; - struct type_align(8) MaterialInfo + struct type_align32(8) MaterialInfo { const char* name; unsigned int gameFlags; @@ -735,7 +735,7 @@ namespace T6 CAMERA_REGION_NONE = CAMERA_REGION_COUNT, }; - typedef tdef_align(8) GfxStateBits GfxStateBitsTable; + typedef tdef_align32(8) GfxStateBits GfxStateBitsTable; struct Material { @@ -960,9 +960,9 @@ namespace T6 unsigned int entryCount; unsigned int dependencyCount; unsigned int pad32; - gcc_align(8) int64_t fileSize; - gcc_align(8) int64_t entryOffset; - gcc_align(8) int64_t checksumOffset; + gcc_align32(8) int64_t fileSize; + gcc_align32(8) int64_t entryOffset; + gcc_align32(8) int64_t checksumOffset; char checksumChecksum[16]; char dependencies[512]; char padding[1464]; @@ -970,7 +970,7 @@ namespace T6 #pragma pack(push, 1) - struct type_align(2) SndRuntimeAssetBank + struct type_align32(2) SndRuntimeAssetBank { const char* zone; const char* language; @@ -985,7 +985,7 @@ namespace T6 #pragma pack(pop) - typedef tdef_align(2048) char SndChar2048; + typedef tdef_align32(2048) char SndChar2048; struct SndLoadedAssets { @@ -1041,8 +1041,8 @@ namespace T6 }; typedef unsigned short LeafBrush; - typedef tdef_align(128) cbrush_t cbrush_array_t; - typedef tdef_align(128) Bounds BoundsArray; + typedef tdef_align32(128) cbrush_t cbrush_array_t; + typedef tdef_align32(128) Bounds BoundsArray; struct ClipInfo { @@ -1066,7 +1066,7 @@ namespace T6 int* brushContents; }; - struct type_align(4) cLeaf_s + struct type_align32(4) cLeaf_s { uint16_t firstCollAabbIndex; uint16_t collAabbCount; @@ -1273,8 +1273,8 @@ namespace T6 void /*ID3D11Buffer*/* indexBuffer; }; - typedef tdef_align(4) char aligned_byte_pointer; - typedef tdef_align(4) GfxCompressedLightGridCoeffs GfxCompressedLightGridCoeffs_align4; + typedef tdef_align32(4) char aligned_byte_pointer; + typedef tdef_align32(4) GfxCompressedLightGridCoeffs GfxCompressedLightGridCoeffs_align4; struct GfxLightGrid { @@ -1323,7 +1323,7 @@ namespace T6 vec3_t sunFxPosition; }; - typedef tdef_align(4) GfxDrawSurf GfxDrawSurf_align4; + typedef tdef_align32(4) GfxDrawSurf GfxDrawSurf_align4; struct GfxWorldDpvsStatic { @@ -1449,7 +1449,7 @@ namespace T6 int lightingQuality; }; - struct type_align(4) GfxLightImage + struct type_align32(4) GfxLightImage { GfxImage* image; char samplerState; @@ -1535,7 +1535,7 @@ namespace T6 expressionRpn* rpn; }; - struct type_align(8) menuDef_t + struct type_align32(8) menuDef_t { windowDef_t window; const char* font; @@ -1562,8 +1562,8 @@ namespace T6 GenericEventHandler* onEvent; ItemKeyHandler* onKey; ExpressionStatement visibleExp; - gcc_align(8) uint64_t showBits; - gcc_align(8) uint64_t hideBits; + gcc_align32(8) uint64_t showBits; + gcc_align32(8) uint64_t hideBits; const char* allowedBinding; const char* soundName; int imageTrack; @@ -2753,9 +2753,9 @@ namespace T6 uint16_t i[3]; }; - typedef tdef_align(16) XSurfaceTri XSurfaceTri16; + typedef tdef_align32(16) XSurfaceTri XSurfaceTri16; - struct type_align(16) XSurface + struct type_align32(16) XSurface { char tileMode; unsigned char vertListCount; @@ -2783,7 +2783,7 @@ namespace T6 int surfFlags; }; - struct type_align(4) XBoneInfo + struct type_align32(4) XBoneInfo { vec3_t bounds[2]; vec3_t offset; @@ -2883,7 +2883,7 @@ namespace T6 GfxImage* image; }; - struct type_align(16) MaterialConstantDef + struct type_align32(16) MaterialConstantDef { unsigned int nameHash; char name[12]; @@ -3058,7 +3058,7 @@ namespace T6 { };*/ - struct type_align(4) GfxImageLoadDef + struct type_align32(4) GfxImageLoadDef { char levelCount; char flags; @@ -3076,7 +3076,7 @@ namespace T6 int sequence; }; - struct type_align(4) SndIndexEntry + struct type_align32(4) SndIndexEntry { uint16_t value; uint16_t next; @@ -3104,7 +3104,7 @@ namespace T6 float returnHighpass; }; - typedef tdef_align(16) float SndFloatAlign16; + typedef tdef_align32(16) float SndFloatAlign16; struct SndDuck { @@ -3206,7 +3206,7 @@ namespace T6 cLeafBrushNodeData_t data; }; - struct type_align(16) cbrush_t + struct type_align32(16) cbrush_t { vec3_t mins; int contents; @@ -3261,7 +3261,7 @@ namespace T6 int partitionIndex; }; - struct type_align(16) CollisionAabbTree + struct type_align32(16) CollisionAabbTree { vec3_t origin; uint16_t materialIndex; @@ -3352,7 +3352,7 @@ namespace T6 ROPE_CENTITY_CONSTRAINT = 0x3, }; - struct type_align(4) constraint_t + struct type_align32(4) constraint_t { vec3_t p; rope_constraint_e type; @@ -3374,7 +3374,7 @@ namespace T6 unsigned int frame_index; }; - struct type_align(4) rope_t + struct type_align32(4) rope_t { par_t m_particles[25]; constraint_t m_constraints[30]; @@ -3489,7 +3489,7 @@ namespace T6 uint16_t infoIndex; }; - struct type_align(4) pathnode_dynamic_t + struct type_align32(4) pathnode_dynamic_t { SentientHandle pOwner; int iFreeTime; @@ -3526,7 +3526,7 @@ namespace T6 pathnode_transient_t transient; }; - struct type_align(16) pathbasenode_t + struct type_align32(16) pathbasenode_t { vec3_t vOrigin; unsigned int type; @@ -3573,7 +3573,7 @@ namespace T6 float halfSize; }; - struct type_align(16) GfxStreamingAabbTree + struct type_align32(16) GfxStreamingAabbTree { vec4_t mins; vec4_t maxs; @@ -3586,7 +3586,7 @@ namespace T6 uint16_t surfaceCount; }; - struct type_align(16) float44 + struct type_align32(16) float44 { union { @@ -3595,7 +3595,7 @@ namespace T6 }; }; - struct type_align(16) GfxLight + struct type_align32(16) GfxLight { char type; char canUseShadowMap; @@ -3734,14 +3734,14 @@ namespace T6 { };*/ - struct type_align(4) GfxLightGridEntry + struct type_align32(4) GfxLightGridEntry { uint16_t colorsIndex; char primaryLightIndex; char visibility; }; - struct type_align(4) GfxCompressedLightGridColors + struct type_align32(4) GfxCompressedLightGridColors { char rgb[56][3]; }; @@ -3769,7 +3769,7 @@ namespace T6 float padding2; }; - struct type_align(16) GfxBrushModel + struct type_align32(16) GfxBrushModel { GfxBrushModelWritable writable; vec3_t bounds[2]; @@ -3808,14 +3808,14 @@ namespace T6 uint16_t surfId; }; - struct type_align(4) GfxSceneDynBrush + struct type_align32(4) GfxSceneDynBrush { BModelDrawInfo info; uint16_t dynEntId; }; // Usually __m128, but that is not portable - union gcc_align(8) custom_m128 + union gcc_align32(8) custom_m128 { float m128_f32[4]; uint64_t m128_u64[2]; @@ -3836,7 +3836,7 @@ namespace T6 custom_m128 w; }; - struct type_align(16) SSkinInstance + struct type_align32(16) SSkinInstance { union { @@ -3888,7 +3888,7 @@ namespace T6 int baseIndex; }; - struct type_align(16) GfxSurface + struct type_align32(16) GfxSurface { srfTriangles_t tris; Material* material; @@ -3913,7 +3913,7 @@ namespace T6 uint16_t V2[4]; }; - struct type_align(4) GfxStaticModelLmapVertexInfo + struct type_align32(4) GfxStaticModelLmapVertexInfo { unsigned int* lmapVertexColors; void /*ID3D11Buffer*/* lmapVertexColorsVB; @@ -4113,7 +4113,7 @@ namespace T6 void* data; }; - struct type_align(8) itemDef_s + struct type_align32(8) itemDef_s { windowDef_t window; int type; @@ -5587,7 +5587,7 @@ namespace T6 LOCAL_CLIENT_COUNT = 0x1, }; - struct type_align(4) DevGraph + struct type_align32(4) DevGraph { vec2_t* knots; int* knotCount; @@ -5609,7 +5609,7 @@ namespace T6 }; typedef char ByteVec[3]; - typedef tdef_align(4) uint16_t UShortVec[3]; + typedef tdef_align32(4) uint16_t UShortVec[3]; union XAnimDynamicFrames { @@ -5623,7 +5623,7 @@ namespace T6 uint16_t _2[1]; }; - struct type_align(4) XAnimPartTransFrames + struct type_align32(4) XAnimPartTransFrames { vec3_t mins; vec3_t size; @@ -5650,9 +5650,9 @@ namespace T6 uint16_t _2[1]; }; - typedef tdef_align(4) int16_t XQuat2[2]; + typedef tdef_align32(4) int16_t XQuat2[2]; - struct type_align(4) XAnimDeltaPartQuatDataFrames2 + struct type_align32(4) XAnimDeltaPartQuatDataFrames2 { XQuat2* frames; XAnimDynamicIndicesDeltaQuat2 indices; @@ -5676,9 +5676,9 @@ namespace T6 uint16_t _2[1]; }; - typedef tdef_align(4) int16_t XQuat[4]; + typedef tdef_align32(4) int16_t XQuat[4]; - struct type_align(4) XAnimDeltaPartQuatDataFrames + struct type_align32(4) XAnimDeltaPartQuatDataFrames { XQuat* frames; XAnimDynamicIndicesDeltaQuat indices; @@ -5712,7 +5712,7 @@ namespace T6 unsigned int packed; }; - struct type_align(16) GfxPackedVertex + struct type_align32(16) GfxPackedVertex { vec3_t xyz; float binormalSign; @@ -5738,7 +5738,7 @@ namespace T6 vec4_t tvec; }; - typedef tdef_align(16) PhysGeomInfo PhysGeomInfo16; + typedef tdef_align32(16) PhysGeomInfo PhysGeomInfo16; struct PhysGeomList { @@ -6295,7 +6295,7 @@ namespace T6 static_assert(sizeof(SndAliasFlags) == 8); #endif - struct type_align(4) pathlink_s + struct type_align32(4) pathlink_s { float fDist; uint16_t nodeNum; @@ -6404,7 +6404,7 @@ namespace T6 unsigned int v; }; - struct type_align(4) SSkinVert + struct type_align32(4) SSkinVert { half4 pos_bone; PackedUnitVec normal; @@ -6495,7 +6495,7 @@ namespace T6 } vector; }; - struct type_align(8) dvar_t + struct type_align32(8) dvar_t { const char* name; const char* description; @@ -6994,7 +6994,7 @@ namespace T6 uint16_t maxs[3]; }; - struct type_align(16) XSurfaceCollisionNode + struct type_align32(16) XSurfaceCollisionNode { XSurfaceCollisionAabb aabb; uint16_t childBeginIndex; @@ -7006,7 +7006,7 @@ namespace T6 uint16_t triangleBeginIndex; }; - struct type_align(16) BrushWrapper + struct type_align32(16) BrushWrapper { vec3_t mins; int contents; diff --git a/src/Common/Utils/TypeAlignment.h b/src/Common/Utils/TypeAlignment.h index e3eabcd4..4e2c2bd4 100644 --- a/src/Common/Utils/TypeAlignment.h +++ b/src/Common/Utils/TypeAlignment.h @@ -7,9 +7,6 @@ #ifdef tdef_align #undef tdef_align #endif -#ifdef memb_align -#undef memb_align -#endif #ifdef gcc_align #undef gcc_align #endif @@ -17,25 +14,44 @@ #ifdef __zonecodegenerator #define type_align(x) alignas(x) #define tdef_align(x) alignas(x) -#define memb_align(x) alignas(x) #define gcc_align(x) #else #ifdef __ida #define type_align(x) __declspec(align(x)) #define tdef_align(x) __declspec(align(x)) -#define memb_align(x) __declspec(align(x)) #define gcc_align(x) #else #ifdef _MSVC_LANG -#define type_align(x) /* __declspec(align(x)) */ -#define tdef_align(x) /* __declspec(align(x)) */ -#define memb_align(x) /* __declspec(align(x)) */ +#define type_align(x) __declspec(align(x)) +#define tdef_align(x) __declspec(align(x)) #define gcc_align(x) #else #define type_align(x) __attribute__((__aligned__(x))) #define tdef_align(x) -#define memb_align(x) __attribute__((__aligned__(x))) #define gcc_align(x) __attribute__((__aligned__(x))) #endif #endif #endif + +#if defined(__zonecodegenerator) || defined(__ida) +#define type_align32(x) type_align(x) +#define tdef_align32(x) tdef_align(x) +#define gcc_align32(x) gcc_align(x) +#define type_align64(x) type_align(x) +#define tdef_align64(x) tdef_align(x) +#define gcc_align64(x) gcc_align(x) +#elif defined(ARCH_x86) +#define type_align32(x) type_align(x) +#define tdef_align32(x) tdef_align(x) +#define gcc_align32(x) gcc_align(x) +#define type_align64(x) +#define tdef_align64(x) +#define gcc_align64(x) +#elif defined(ARCH_x64) +#define type_align32(x) +#define tdef_align32(x) +#define gcc_align32(x) +#define type_align64(x) type_align(x) +#define tdef_align64(x) tdef_align(x) +#define gcc_align64(x) gcc_align(x) +#endif