Fix errors in iw3 commands and structs

This commit is contained in:
Jan 2021-04-15 10:37:39 +02:00
parent ecef868903
commit 4e05bc6b44
4 changed files with 29 additions and 18 deletions

View File

@ -192,7 +192,7 @@ namespace IW3
UShortVec* _2; UShortVec* _2;
}; };
struct __declspec(align(4)) XAnimPartTransFrames struct type_align(4) XAnimPartTransFrames
{ {
float mins[3]; float mins[3];
float size[3]; float size[3];
@ -215,7 +215,7 @@ namespace IW3
typedef tdef_align(4) short XQuat[2]; typedef tdef_align(4) short XQuat[2];
struct __declspec(align(4)) XAnimDeltaPartQuatDataFrames struct type_align(4) XAnimDeltaPartQuatDataFrames
{ {
XQuat *frames; XQuat *frames;
XAnimDynamicIndices indices; XAnimDynamicIndices indices;
@ -283,7 +283,7 @@ namespace IW3
uint16_t maxs[3]; uint16_t maxs[3];
}; };
struct XSurfaceCollisionNode struct type_align(16) XSurfaceCollisionNode
{ {
XSurfaceCollisionAabb aabb; XSurfaceCollisionAabb aabb;
uint16_t childBeginIndex; uint16_t childBeginIndex;
@ -331,7 +331,7 @@ namespace IW3
char array[4]; char array[4];
}; };
struct GfxPackedVertex struct type_align(16) GfxPackedVertex
{ {
float xyz[3]; float xyz[3];
float binormalSign; float binormalSign;
@ -501,7 +501,7 @@ namespace IW3
unsigned int loadBits[2]; unsigned int loadBits[2];
}; };
struct MaterialConstantDef struct type_align(16) MaterialConstantDef
{ {
unsigned int nameHash; unsigned int nameHash;
char name[12]; char name[12];
@ -607,7 +607,7 @@ namespace IW3
union MaterialArgumentDef union MaterialArgumentDef
{ {
const float* literalConst; const float(*literalConst)[4];
MaterialArgumentCodeConst codeConst; MaterialArgumentCodeConst codeConst;
unsigned int codeSampler; unsigned int codeSampler;
unsigned int nameHash; unsigned int nameHash;
@ -734,7 +734,7 @@ namespace IW3
char platform[2]; char platform[2];
}; };
struct __declspec(align(4)) GfxImageLoadDef struct type_align(4) GfxImageLoadDef
{ {
char levelCount; char levelCount;
char flags; char flags;
@ -1083,6 +1083,8 @@ namespace IW3
typedef unsigned short LeafBrush; typedef unsigned short LeafBrush;
typedef tdef_align(16) cbrush_t cbrush_array_t;
struct clipMap_t struct clipMap_t
{ {
const char* name; const char* name;
@ -1121,13 +1123,13 @@ namespace IW3
unsigned int numSubModels; unsigned int numSubModels;
cmodel_t* cmodels; cmodel_t* cmodels;
uint16_t numBrushes; uint16_t numBrushes;
cbrush_t* brushes; cbrush_array_t* brushes;
int numClusters; int numClusters;
int clusterBytes; int clusterBytes;
char* visibility; char* visibility;
int vised; int vised;
MapEnts* mapEnts; MapEnts* mapEnts;
cbrush_t* box_brush; cbrush_array_t* box_brush;
cmodel_t box_model; cmodel_t box_model;
uint16_t dynEntCount[2]; uint16_t dynEntCount[2];
DynEntityDef* dynEntDefList[2]; DynEntityDef* dynEntDefList[2];
@ -1185,7 +1187,7 @@ namespace IW3
pathnode_tree_info_t u; pathnode_tree_info_t u;
}; };
struct pathbasenode_t struct type_align(16) pathbasenode_t
{ {
float vOrigin[3]; float vOrigin[3];
unsigned int type; unsigned int type;
@ -1454,14 +1456,14 @@ namespace IW3
GfxImage* secondary; GfxImage* secondary;
}; };
struct GfxLightGridEntry struct type_align(4) GfxLightGridEntry
{ {
uint16_t colorsIndex; uint16_t colorsIndex;
char primaryLightIndex; char primaryLightIndex;
char needsTrace; char needsTrace;
}; };
struct GfxLightGridColors struct type_align(4) GfxLightGridColors
{ {
char rgb[56][3]; char rgb[56][3];
}; };
@ -1547,7 +1549,7 @@ namespace IW3
uint16_t surfId; uint16_t surfId;
}; };
struct GfxSceneDynBrush struct type_align(4) GfxSceneDynBrush
{ {
BModelDrawInfo info; BModelDrawInfo info;
uint16_t dynEntId; uint16_t dynEntId;
@ -1675,6 +1677,8 @@ namespace IW3
char pad; char pad;
}; };
typedef tdef_align(4) GfxSceneDynModel GfxSceneDynModel4;
struct GfxWorld struct GfxWorld
{ {
const char* name; const char* name;
@ -1721,7 +1725,7 @@ namespace IW3
float outdoorLookupMatrix[4][4]; float outdoorLookupMatrix[4][4];
GfxImage* outdoorImage; GfxImage* outdoorImage;
unsigned int* cellCasterBits; unsigned int* cellCasterBits;
GfxSceneDynModel* sceneDynModel; GfxSceneDynModel4* sceneDynModel;
GfxSceneDynBrush* sceneDynBrush; GfxSceneDynBrush* sceneDynBrush;
unsigned int* primaryLightEntityShadowVis; unsigned int* primaryLightEntityShadowVis;
unsigned int* primaryLightDynEntShadowVis[2]; unsigned int* primaryLightDynEntShadowVis[2];

View File

@ -29,8 +29,15 @@ use PhysGeomList;
set reusable geoms; set reusable geoms;
set count geoms count; set count geoms count;
// PhysGeomInfo // BrushWrapper
use PhysGeomInfo; 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 // XSurface
use XSurface; use XSurface;

View File

@ -442,7 +442,7 @@ class ZoneLoadTemplate::Internal final : BaseTemplate
if (member->m_type && !member->m_type->m_is_leaf && !computations.IsInRuntimeBlock()) 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(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) if (member->m_type->m_post_load_action)
{ {

View File

@ -320,7 +320,7 @@ class ZoneWriteTemplate::Internal final : BaseTemplate
if (member->m_type && !member->m_type->m_is_leaf && !computations.IsInRuntimeBlock()) 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(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 else
{ {