diff --git a/src/Common/Game/IW3/IW3_Assets.h b/src/Common/Game/IW3/IW3_Assets.h index d6d3b1a2..48fbda1e 100644 --- a/src/Common/Game/IW3/IW3_Assets.h +++ b/src/Common/Game/IW3/IW3_Assets.h @@ -192,7 +192,7 @@ namespace IW3 UShortVec* _2; }; - struct __declspec(align(4)) XAnimPartTransFrames + struct type_align(4) XAnimPartTransFrames { float mins[3]; float size[3]; @@ -215,7 +215,7 @@ namespace IW3 typedef tdef_align(4) short XQuat[2]; - struct __declspec(align(4)) XAnimDeltaPartQuatDataFrames + struct type_align(4) XAnimDeltaPartQuatDataFrames { XQuat *frames; XAnimDynamicIndices indices; @@ -283,7 +283,7 @@ namespace IW3 uint16_t maxs[3]; }; - struct XSurfaceCollisionNode + struct type_align(16) XSurfaceCollisionNode { XSurfaceCollisionAabb aabb; uint16_t childBeginIndex; @@ -331,7 +331,7 @@ namespace IW3 char array[4]; }; - struct GfxPackedVertex + struct type_align(16) GfxPackedVertex { float xyz[3]; float binormalSign; @@ -501,7 +501,7 @@ namespace IW3 unsigned int loadBits[2]; }; - struct MaterialConstantDef + struct type_align(16) MaterialConstantDef { unsigned int nameHash; char name[12]; @@ -607,7 +607,7 @@ namespace IW3 union MaterialArgumentDef { - const float* literalConst; + const float(*literalConst)[4]; MaterialArgumentCodeConst codeConst; unsigned int codeSampler; unsigned int nameHash; @@ -734,7 +734,7 @@ namespace IW3 char platform[2]; }; - struct __declspec(align(4)) GfxImageLoadDef + struct type_align(4) GfxImageLoadDef { char levelCount; char flags; @@ -1083,6 +1083,8 @@ namespace IW3 typedef unsigned short LeafBrush; + typedef tdef_align(16) cbrush_t cbrush_array_t; + struct clipMap_t { const char* name; @@ -1121,13 +1123,13 @@ namespace IW3 unsigned int numSubModels; cmodel_t* cmodels; uint16_t numBrushes; - cbrush_t* brushes; + cbrush_array_t* brushes; int numClusters; int clusterBytes; char* visibility; int vised; MapEnts* mapEnts; - cbrush_t* box_brush; + cbrush_array_t* box_brush; cmodel_t box_model; uint16_t dynEntCount[2]; DynEntityDef* dynEntDefList[2]; @@ -1185,7 +1187,7 @@ namespace IW3 pathnode_tree_info_t u; }; - struct pathbasenode_t + struct type_align(16) pathbasenode_t { float vOrigin[3]; unsigned int type; @@ -1454,14 +1456,14 @@ namespace IW3 GfxImage* secondary; }; - struct GfxLightGridEntry + struct type_align(4) GfxLightGridEntry { uint16_t colorsIndex; char primaryLightIndex; char needsTrace; }; - struct GfxLightGridColors + struct type_align(4) GfxLightGridColors { char rgb[56][3]; }; @@ -1547,7 +1549,7 @@ namespace IW3 uint16_t surfId; }; - struct GfxSceneDynBrush + struct type_align(4) GfxSceneDynBrush { BModelDrawInfo info; uint16_t dynEntId; @@ -1675,6 +1677,8 @@ namespace IW3 char pad; }; + typedef tdef_align(4) GfxSceneDynModel GfxSceneDynModel4; + struct GfxWorld { const char* name; @@ -1721,7 +1725,7 @@ namespace IW3 float outdoorLookupMatrix[4][4]; GfxImage* outdoorImage; unsigned int* cellCasterBits; - GfxSceneDynModel* sceneDynModel; + GfxSceneDynModel4* sceneDynModel; GfxSceneDynBrush* sceneDynBrush; unsigned int* primaryLightEntityShadowVis; unsigned int* primaryLightDynEntShadowVis[2]; diff --git a/src/ZoneCode/Game/IW3/XAssets/XModel.txt b/src/ZoneCode/Game/IW3/XAssets/XModel.txt index 3d9bdd7c..7661d792 100644 --- a/src/ZoneCode/Game/IW3/XAssets/XModel.txt +++ b/src/ZoneCode/Game/IW3/XAssets/XModel.txt @@ -29,8 +29,15 @@ use PhysGeomList; set reusable geoms; set count geoms count; -// PhysGeomInfo -use PhysGeomInfo; +// BrushWrapper +use BrushWrapper; +set count sides numsides; +set count baseAdjacentSide totalEdgeCount; +set reusable planes; +set count planes numsides; + +// cbrushside_t +set reusable cbrushside_t::plane; // XSurface use XSurface; diff --git a/src/ZoneCodeGeneratorLib/Generating/Templates/ZoneLoadTemplate.cpp b/src/ZoneCodeGeneratorLib/Generating/Templates/ZoneLoadTemplate.cpp index 11b871d0..9dd4f5a2 100644 --- a/src/ZoneCodeGeneratorLib/Generating/Templates/ZoneLoadTemplate.cpp +++ b/src/ZoneCodeGeneratorLib/Generating/Templates/ZoneLoadTemplate.cpp @@ -442,7 +442,7 @@ class ZoneLoadTemplate::Internal final : BaseTemplate if (member->m_type && !member->m_type->m_is_leaf && !computations.IsInRuntimeBlock()) { LINE(MakeTypeVarName(member->m_member->m_type_declaration->m_type) << " = " << MakeMemberAccess(info, member, modifier) << ";") - LINE("Load_" << MakeSafeTypeName(member->m_member->m_type_declaration->m_type) << "(true);") + LINE("Load_" << MakeSafeTypeName(member->m_type->m_definition) << "(true);") if (member->m_type->m_post_load_action) { diff --git a/src/ZoneCodeGeneratorLib/Generating/Templates/ZoneWriteTemplate.cpp b/src/ZoneCodeGeneratorLib/Generating/Templates/ZoneWriteTemplate.cpp index d027ebec..64915c63 100644 --- a/src/ZoneCodeGeneratorLib/Generating/Templates/ZoneWriteTemplate.cpp +++ b/src/ZoneCodeGeneratorLib/Generating/Templates/ZoneWriteTemplate.cpp @@ -320,7 +320,7 @@ class ZoneWriteTemplate::Internal final : BaseTemplate if (member->m_type && !member->m_type->m_is_leaf && !computations.IsInRuntimeBlock()) { LINE(MakeTypeVarName(member->m_member->m_type_declaration->m_type) << " = " << MakeMemberAccess(info, member, modifier) << ";") - LINE("Write_" << MakeSafeTypeName(member->m_member->m_type_declaration->m_type) << "(true);") + LINE("Write_" << MakeSafeTypeName(member->m_type->m_definition) << "(true);") } else {