struct DObjAnimMat
{
    float quat[4];
    float trans[3];
    float transWeight;
};

struct XSurfaceVertexInfo
{
    __int16 vertCount[4];
    unsigned __int16 *vertsBlend;
};

union GfxColor
{
    unsigned int packed;
    unsigned __int8 array[4];
};

union PackedTexCoords
{
    unsigned int packed;
};

union PackedUnitVec
{
    unsigned int packed;
};

struct GfxPackedVertex
{
    float xyz[3];
    float binormalSign;
    GfxColor color;
    PackedTexCoords texCoord;
    PackedUnitVec normal;
    PackedUnitVec tangent;
};

struct D3DResource
{
    unsigned int Common;
    unsigned int ReferenceCount;
    unsigned int Fence;
    unsigned int ReadFence;
    unsigned int Identifier;
    unsigned int BaseFlush;
};

struct $E41E24A1CD47CDFA361AA9F99910948B
{
    unsigned __int32 Type : 2;
    unsigned __int32 BaseAddress : 30;
    unsigned __int32 Endian : 2;
    unsigned __int32 Size : 24;
    unsigned __int32 AddressClamp : 1;
    unsigned __int32 : 1;
    unsigned __int32 RequestSize : 2;
    unsigned __int32 ClampDisable : 2;
};

union GPUVERTEX_FETCH_CONSTANT
{
    $E41E24A1CD47CDFA361AA9F99910948B __s0;
    unsigned int dword[2];
};

struct D3DVertexBuffer : D3DResource
{
    GPUVERTEX_FETCH_CONSTANT Format;
};

struct XSurfaceCollisionAabb
{
    unsigned __int16 mins[3];
    unsigned __int16 maxs[3];
};

struct XSurfaceCollisionNode
{
    XSurfaceCollisionAabb aabb;
    unsigned __int16 childBeginIndex;
    unsigned __int16 childCount;
};

struct XSurfaceCollisionLeaf
{
    unsigned __int16 triangleBeginIndex;
};

struct XSurfaceCollisionTree
{
    float trans[3];
    float scale[3];
    unsigned int nodeCount;
    XSurfaceCollisionNode *nodes;
    unsigned int leafCount;
    XSurfaceCollisionLeaf *leafs;
};

struct XRigidVertList
{
    unsigned __int16 boneOffset;
    unsigned __int16 vertCount;
    unsigned __int16 triOffset;
    unsigned __int16 triCount;
    XSurfaceCollisionTree *collisionTree;
};

struct D3DIndexBuffer : D3DResource
{
    unsigned int Address;
    unsigned int Size;
};

struct XSurface
{
    unsigned __int8 tileMode;
    bool deformed;
    unsigned __int16 vertCount;
    unsigned __int16 triCount;
    unsigned __int16 *triIndices;
    XSurfaceVertexInfo vertInfo;
    GfxPackedVertex *verts0;
    D3DVertexBuffer vb0;
    unsigned int vertListCount;
    XRigidVertList *vertList;
    D3DIndexBuffer indexBuffer;
    int partBits[4];
};

struct GfxDrawSurfFields
{
    unsigned __int64 objectId : 16;
    unsigned __int64 reflectionProbeIndex : 8;
    unsigned __int64 customIndex : 5;
    unsigned __int64 materialSortedIndex : 11;
    unsigned __int64 prepass : 2;
    unsigned __int64 primaryLightIndex : 8;
    unsigned __int64 surfType : 4;
    unsigned __int64 primarySortKey : 6;
    unsigned __int64 unused : 4;
};


union GfxDrawSurf
{
    GfxDrawSurfFields fields;
    unsigned __int64 packed;
};

struct __declspec(align(8)) MaterialInfo
{
    const char *name;
    unsigned __int8 gameFlags;
    unsigned __int8 sortKey;
    unsigned __int8 textureAtlasRowCount;
    unsigned __int8 textureAtlasColumnCount;
    GfxDrawSurf drawSurf;
    unsigned int surfaceTypeBits;
};

struct MaterialStreamRouting
{
    unsigned __int8 source;
    unsigned __int8 dest;
};

struct D3DVertexDeclaration : D3DResource
{
};

union MaterialVertexStreamRouting
{
    MaterialStreamRouting data[16];
    D3DVertexDeclaration *decl[15];
};

struct MaterialVertexDeclaration
{
    unsigned __int8 streamCount;
    bool hasOptionalSource;
    MaterialVertexStreamRouting routing;
};

struct D3DVertexShader : D3DResource
{
};

struct GfxVertexShaderLoadDef
{
    unsigned __int8 *cachedPart;
    unsigned __int8 *physicalPart;
    unsigned __int16 cachedPartSize;
    unsigned __int16 physicalPartSize;
};

union MaterialVertexShaderProgram
{
    D3DVertexShader *vs;
    GfxVertexShaderLoadDef loadDef;
};

struct MaterialVertexShader
{
    const char *name;
    MaterialVertexShaderProgram prog;
};

struct D3DPixelShader : D3DResource
{
};

struct GfxPixelShaderLoadDef
{
    unsigned __int8 *cachedPart;
    unsigned __int8 *physicalPart;
    unsigned __int16 cachedPartSize;
    unsigned __int16 physicalPartSize;
};

union MaterialPixelShaderProgram
{
    D3DPixelShader *ps;
    GfxPixelShaderLoadDef loadDef;
};

struct MaterialPixelShader
{
    const char *name;
    MaterialPixelShaderProgram prog;
};

struct MaterialArgumentCodeConst
{
    unsigned __int16 index;
    unsigned __int8 firstRow;
    unsigned __int8 rowCount;
};

union MaterialArgumentDef
{
    const float *literalConst;
    MaterialArgumentCodeConst codeConst;
    unsigned int codeSampler;
    unsigned int nameHash;
};

struct MaterialShaderArgument
{
    unsigned __int16 type;
    unsigned __int16 dest;
    MaterialArgumentDef u;
};

struct MaterialPass
{
    MaterialVertexDeclaration *vertexDecl;
    MaterialVertexShader *vertexShaderArray[15];
    MaterialVertexShader *vertexShader;
    MaterialPixelShader *pixelShader;
    unsigned __int8 perPrimArgCount;
    unsigned __int8 perObjArgCount;
    unsigned __int8 stableArgCount;
    unsigned __int8 customSamplerFlags;
    unsigned __int8 precompiledIndex;
    MaterialShaderArgument *args;
};

struct MaterialTechnique
{
    const char *name;
    unsigned __int16 flags;
    unsigned __int16 passCount;
    MaterialPass passArray[1];
};

struct MaterialTechniqueSet
{
    const char *name;
    unsigned __int8 worldVertFormat;
    unsigned __int8 unused[2];
    MaterialTechniqueSet *remappedTechniqueSet;
    MaterialTechnique *techniques[26];
};

enum MapType : __int32
{
    MAPTYPE_NONE = 0x0,
    MAPTYPE_INVALID1 = 0x1,
    MAPTYPE_INVALID2 = 0x2,
    MAPTYPE_2D = 0x3,
    MAPTYPE_3D = 0x4,
    MAPTYPE_CUBE = 0x5,
    MAPTYPE_COUNT = 0x6,
};

union GfxTexture
{
    D3DBaseTexture *basemap;
    D3DTexture *map;
    D3DVolumeTexture *volmap;
    D3DCubeTexture *cubemap;
    GfxImageLoadDef *loadDef;
};

struct CardMemory
{
    int platform[1];
};

struct GfxImage
{
    MapType mapType;
    GfxTexture texture;
    unsigned __int8 semantic;
    CardMemory cardMemory;
    unsigned __int16 width;
    unsigned __int16 height;
    unsigned __int16 depth;
    unsigned __int8 category;
    bool delayLoadPixels;
    unsigned __int8 *pixels;
    unsigned int baseSize;
    unsigned __int16 streamSlot;
    bool streaming;
    const char *name;
};

struct WaterWritable
{
    float floatTime;
};

struct water_t
{
    WaterWritable writable;
    float *H0X;
    float *H0Y;
    float *wTerm;
    int M;
    int N;
    float Lx;
    float Lz;
    float gravity;
    float windvel;
    float winddir[2];
    float amplitude;
    float codeConstant[4];
    GfxImage *image;
};

union MaterialTextureDefInfo
{
    GfxImage *image;
    water_t *water;
};

struct MaterialTextureDef
{
    unsigned int nameHash;
    char nameStart;
    char nameEnd;
    unsigned __int8 samplerState;
    unsigned __int8 semantic;
    MaterialTextureDefInfo u;
};

struct MaterialConstantDef
{
    unsigned int nameHash;
    char name[12];
    float literal[4];
};

struct GfxStateBits
{
    unsigned int loadBits[2];
};

struct Material
{
    MaterialInfo info;
    unsigned __int8 stateBitsEntry[26];
    unsigned __int8 textureCount;
    unsigned __int8 constantCount;
    unsigned __int8 stateBitsCount;
    unsigned __int8 stateFlags;
    unsigned __int8 cameraRegion;
    MaterialTechniqueSet *techniqueSet;
    MaterialTextureDef *textureTable;
    MaterialConstantDef *constantTable;
    GfxStateBits *stateBitsTable;
};

struct XModelLodInfo
{
    float dist;
    unsigned __int16 numsurfs;
    unsigned __int16 surfIndex;
    int partBits[4];
};

struct XModelCollSurf_s
{
    float mins[3];
    float maxs[3];
    int boneIdx;
    int contents;
    int surfFlags;
};

struct XBoneInfo
{
    float bounds[2][3];
    float offset[3];
    float radiusSquared;
};

struct XModelHighMipBounds
{
    float mins[3];
    float maxs[3];
};

struct XModelStreamInfo
{
    XModelHighMipBounds *highMipBounds;
};

struct __declspec(align(4)) PhysPreset
{
    const char *name;
    int type;
    float mass;
    float bounce;
    float friction;
    float bulletForceScale;
    float explosiveForceScale;
    const char *sndAliasPrefix;
    float piecesSpreadFraction;
    float piecesUpwardVelocity;
    bool tempDefaultToCylinder;
};

struct cplane_s
{
    float normal[3];
    float dist;
    unsigned __int8 type;
    unsigned __int8 signbits;
    unsigned __int8 pad[2];
};

struct __declspec(align(2)) cbrushside_t
{
    cplane_s *plane;
    unsigned int materialNum;
    __int16 firstAdjacentSideOffset;
    unsigned __int8 edgeCount;
};

struct BrushWrapper
{
    float mins[3];
    int contents;
    float maxs[3];
    unsigned int numsides;
    cbrushside_t *sides;
    __int16 axialMaterialNum[2][3];
    unsigned __int8 *baseAdjacentSide;
    __int16 firstAdjacentSideOffsets[2][3];
    unsigned __int8 edgeCount[2][3];
    int totalEdgeCount;
    cplane_s *planes;
};

struct PhysGeomInfo
{
    BrushWrapper *brush;
    int type;
    float orientation[3][3];
    float offset[3];
    float halfLengths[3];
};

struct PhysMass
{
    float centerOfMass[3];
    float momentsOfInertia[3];
    float productsOfInertia[3];
};

struct PhysGeomList
{
    unsigned int count;
    PhysGeomInfo *geoms;
    PhysMass mass;
};

struct XModel
{
    const char *name;
    unsigned __int8 numBones;
    unsigned __int8 numRootBones;
    unsigned __int8 numsurfs;
    unsigned __int8 lodRampType;
    unsigned __int16 *boneNames;
    unsigned __int8 *parentList;
    __int16 *quats;
    float *trans;
    unsigned __int8 *partClassification;
    DObjAnimMat *baseMat;
    XSurface *surfs;
    Material **materialHandles;
    XModelLodInfo lodInfo[4];
    XModelCollSurf_s *collSurfs;
    int numCollSurfs;
    int contents;
    XBoneInfo *boneInfo;
    float radius;
    float mins[3];
    float maxs[3];
    __int16 numLods;
    __int16 collLod;
    XModelStreamInfo streamInfo;
    int memUsage;
    unsigned __int8 flags;
    PhysPreset *physPreset;
    PhysGeomList *physGeoms;
};

struct XModelPiece
{
    XModel *model;
    float offset[3];
};

struct XModelPieces
{
    const char *name;
    int numpieces;
    XModelPiece *pieces;
};

union XAnimIndices
{
    unsigned __int8 *_1;
    unsigned __int16 *_2;
    void *data;
};

struct XAnimNotifyInfo
{
    unsigned __int16 name;
    float time;
};

union XAnimDynamicFrames
{
    unsigned __int8 (*_1)[3];
    unsigned __int16 (*_2)[3];
};

union XAnimDynamicIndices
{
    unsigned __int8 _1[1];
    unsigned __int16 _2[1];
};

struct __declspec(align(4)) XAnimPartTransFrames
{
    float mins[3];
    float size[3];
    XAnimDynamicFrames frames;
    XAnimDynamicIndices indices;
};

union XAnimPartTransData
{
    XAnimPartTransFrames frames;
    float frame0[3];
};

struct XAnimPartTrans
{
    unsigned __int16 size;
    unsigned __int8 smallTrans;
    XAnimPartTransData u;
};

struct __declspec(align(4)) XAnimDeltaPartQuatDataFrames
{
    __int16 (*frames)[2];
    XAnimDynamicIndices indices;
};

union XAnimDeltaPartQuatData
{
    XAnimDeltaPartQuatDataFrames frames;
    __int16 frame0[2];
};

struct XAnimDeltaPartQuat
{
    unsigned __int16 size;
    XAnimDeltaPartQuatData u;
};

struct XAnimDeltaPart
{
    XAnimPartTrans *trans;
    XAnimDeltaPartQuat *quat;
};

struct XAnimParts
{
    const char *name;
    unsigned __int16 dataByteCount;
    unsigned __int16 dataShortCount;
    unsigned __int16 dataIntCount;
    unsigned __int16 randomDataByteCount;
    unsigned __int16 randomDataIntCount;
    unsigned __int16 numframes;
    bool bLoop;
    bool bDelta;
    unsigned __int8 boneCount[12];
    unsigned __int8 notifyCount;
    unsigned __int8 assetType;
    bool pad;
    unsigned int randomDataShortCount;
    unsigned int indexCount;
    float framerate;
    float frequency;
    unsigned __int16 *names;
    unsigned __int8 *dataByte;
    __int16 *dataShort;
    int *dataInt;
    __int16 *randomDataShort;
    unsigned __int8 *randomDataByte;
    int *randomDataInt;
    XAnimIndices indices;
    XAnimNotifyInfo *notify;
    XAnimDeltaPart *deltaPart;
};

struct __declspec(align(4)) XMALOOPREGION
{
    unsigned int LoopStart;
    unsigned int LoopEnd;
    unsigned __int8 LoopSubframeEnd;
    unsigned __int8 LoopSubframeSkip;
};

struct XAUDIOPACKET_ALIGNED
{
    char *pBuffer;
    unsigned int BufferSize;
    unsigned int LoopCount;
    XMALOOPREGION XMALoop[6];
    char *pContext;
};

union AudioStreamMeta
{
    unsigned __int8 NumStreams;
    unsigned __int8 ChannelCount;
};

struct __declspec(align(4)) XAUDIOXMAFORMAT
{
    unsigned int SampleRate;
    unsigned __int8 ChannelCount;
    unsigned __int8 DecodeBufferSize;
};

union SoundFormatData
{
    XAUDIOXMAFORMAT Stream[6];
    unsigned int SampleRate;
};

struct XAUDIOSOURCEFORMAT
{
    unsigned __int8 SampleType;
    __declspec(align(4)) AudioStreamMeta ___u1;
    SoundFormatData ___u2;
};

struct XaIwXmaDataInfo
{
    int totalMsec;
};

struct XaSeekTable
{
    int size;
    unsigned int *data;
};

struct XaSound
{
    XAUDIOPACKET_ALIGNED packet;
    XAUDIOSOURCEFORMAT format;
    XaIwXmaDataInfo xaIwXmaDataInfo;
    XaSeekTable seekTable;
};

struct LoadedSound
{
    const char *name;
    XaSound sound;
};

struct StreamFileNameRaw
{
    const char *dir;
    const char *name;
};

struct StreamFileNamePacked
{
    unsigned int offset;
    unsigned int length;
};

union StreamFileInfo
{
    StreamFileNameRaw raw;
    StreamFileNamePacked packed;
};

struct StreamFileName
{
    unsigned int fileIndex;
    StreamFileInfo info;
};

struct StreamedSound
{
    StreamFileName filename;
};

union SoundFileRef
{
    LoadedSound *loadSnd;
    StreamedSound streamSnd;
};

struct SoundFile
{
    unsigned __int8 type;
    unsigned __int8 exists;
    SoundFileRef u;
};

struct SndCurve
{
    const char *filename;
    int knotCount;
    float knots[8][2];
};

struct XAUDIOCHANNELMAPENTRY
{
    unsigned __int8 InputChannel;
    unsigned __int8 OutputChannel;
    float Volume;
};

struct XAUDIOCHANNELMAP
{
    unsigned __int8 EntryCount;
    XAUDIOCHANNELMAPENTRY *paEntries;
};

struct SpeakerMap
{
    bool isDefault;
    const char *name;
    XAUDIOCHANNELMAP channelMaps[2][2];
};

struct snd_alias_t
{
    const char *aliasName;
    const char *subtitle;
    const char *secondaryAliasName;
    const char *chainAliasName;
    SoundFile *soundFile;
    int sequence;
    float volMin;
    float volMax;
    float pitchMin;
    float pitchMax;
    float distMin;
    float distMax;
    int flags;
    float slavePercentage;
    float probability;
    float lfePercentage;
    float centerPercentage;
    int startDelay;
    SndCurve *volumeFalloffCurve;
    float envelopMin;
    float envelopMax;
    float envelopPercentage;
    SpeakerMap *speakerMap;
};

struct snd_alias_list_t
{
    const char *aliasName;
    snd_alias_t *head;
    int count;
};

struct cStaticModelWritable
{
    unsigned __int16 nextModelInWorldSector;
};

struct cStaticModel_s
{
    cStaticModelWritable writable;
    XModel *xmodel;
    float origin[3];
    float invScaledAxis[3][3];
    float absmin[3];
    float absmax[3];
};

struct dmaterial_t
{
    char material[64];
    int surfaceFlags;
    int contentFlags;
};

struct cNode_t
{
    cplane_s *plane;
    __int16 children[2];
};

struct __declspec(align(4)) cLeaf_t
{
    unsigned __int16 firstCollAabbIndex;
    unsigned __int16 collAabbCount;
    int brushContents;
    int terrainContents;
    float mins[3];
    float maxs[3];
    int leafBrushNode;
    __int16 cluster;
};

struct cLeafBrushNodeLeaf_t
{
    unsigned __int16 *brushes;
};

struct cLeafBrushNodeChildren_t
{
    float dist;
    float range;
    unsigned __int16 childOffset[2];
};

union cLeafBrushNodeData_t
{
    cLeafBrushNodeLeaf_t leaf;
    cLeafBrushNodeChildren_t children;
};

struct cLeafBrushNode_s
{
    unsigned __int8 axis;
    __int16 leafBrushCount;
    int contents;
    cLeafBrushNodeData_t data;
};

struct CollisionBorder
{
    float distEq[3];
    float zBase;
    float zSlope;
    float start;
    float length;
};

struct CollisionPartition
{
    unsigned __int8 triCount;
    unsigned __int8 borderCount;
    int firstTri;
    CollisionBorder *borders;
};

union CollisionAabbTreeIndex
{
    int firstChildIndex;
    int partitionIndex;
};

struct CollisionAabbTree
{
    float origin[3];
    float halfSize[3];
    unsigned __int16 materialIndex;
    unsigned __int16 childCount;
    CollisionAabbTreeIndex u;
};

struct cmodel_t
{
    float mins[3];
    float maxs[3];
    float radius;
    cLeaf_t leaf;
};

struct __declspec(align(16)) cbrush_t
{
    float mins[3];
    int contents;
    float maxs[3];
    unsigned int numsides;
    cbrushside_t *sides;
    __int16 axialMaterialNum[2][3];
    unsigned __int8 *baseAdjacentSide;
    __int16 firstAdjacentSideOffsets[2][3];
    unsigned __int8 edgeCount[2][3];
};

struct MapEnts
{
    const char *name;
    char *entityString;
    int numEntityChars;
};

enum DynEntityType : __int32
{
    DYNENT_TYPE_INVALID = 0x0,
    DYNENT_TYPE_CLUTTER = 0x1,
    DYNENT_TYPE_DESTRUCT = 0x2,
    DYNENT_TYPE_COUNT = 0x3,
};

struct GfxPlacement
{
    float quat[4];
    float origin[3];
};

struct FxSpawnDefLooping
{
    int intervalMsec;
    int count;
};

struct FxIntRange
{
    int base;
    int amplitude;
};

struct FxSpawnDefOneShot
{
    FxIntRange count;
};

union FxSpawnDef
{
    FxSpawnDefLooping looping;
    FxSpawnDefOneShot oneShot;
};

struct FxFloatRange
{
    float base;
    float amplitude;
};

struct FxElemAtlas
{
    unsigned __int8 behavior;
    unsigned __int8 index;
    unsigned __int8 fps;
    unsigned __int8 loopCount;
    unsigned __int8 colIndexBits;
    unsigned __int8 rowIndexBits;
    __int16 entryCount;
};

struct FxElemVec3Range
{
    float base[3];
    float amplitude[3];
};

struct FxElemVelStateInFrame
{
    FxElemVec3Range velocity;
    FxElemVec3Range totalDelta;
};

const struct FxElemVelStateSample
{
    FxElemVelStateInFrame local;
    FxElemVelStateInFrame world;
};

union FxEffectDefRef
{
    const FxEffectDef *handle;
    const char *name;
};

union FxElemVisuals
{
    const void *anonymous;
    Material *material;
    XModel *model;
    FxEffectDefRef effectDef;
    const char *soundName;
};

struct FxElemMarkVisuals
{
    Material *materials[2];
};

union FxElemDefVisuals
{
    FxElemMarkVisuals *markArray;
    FxElemVisuals *array;
    FxElemVisuals instance;
};

struct FxElemVisualState
{
    unsigned __int8 color[4];
    float rotationDelta;
    float rotationTotal;
    float size[2];
    float scale;
};

const struct FxElemVisStateSample
{
    FxElemVisualState base;
    FxElemVisualState amplitude;
};

struct FxTrailVertex
{
    float pos[2];
    float normal[2];
    float texCoord;
};

struct FxTrailDef
{
    int scrollTimeMsec;
    int repeatDist;
    int splitDist;
    int vertCount;
    FxTrailVertex *verts;
    int indCount;
    unsigned __int16 *inds;
};

const struct FxElemDef
{
    int flags;
    FxSpawnDef spawn;
    FxFloatRange spawnRange;
    FxFloatRange fadeInRange;
    FxFloatRange fadeOutRange;
    float spawnFrustumCullRadius;
    FxIntRange spawnDelayMsec;
    FxIntRange lifeSpanMsec;
    FxFloatRange spawnOrigin[3];
    FxFloatRange spawnOffsetRadius;
    FxFloatRange spawnOffsetHeight;
    FxFloatRange spawnAngles[3];
    FxFloatRange angularVelocity[3];
    FxFloatRange initialRotation;
    FxFloatRange gravity;
    FxFloatRange reflectionFactor;
    FxElemAtlas atlas;
    unsigned __int8 elemType;
    unsigned __int8 visualCount;
    unsigned __int8 velIntervalCount;
    unsigned __int8 visStateIntervalCount;
    const FxElemVelStateSample *velSamples;
    const FxElemVisStateSample *visSamples;
    FxElemDefVisuals visuals;
    float collMins[3];
    float collMaxs[3];
    FxEffectDefRef effectOnImpact;
    FxEffectDefRef effectOnDeath;
    FxEffectDefRef effectEmitted;
    FxFloatRange emitDist;
    FxFloatRange emitDistVariance;
    FxTrailDef *trailDef;
    unsigned __int8 sortOrder;
    unsigned __int8 lightingFrac;
    unsigned __int8 useItemClip;
    unsigned __int8 unused[1];
};

const struct FxEffectDef
{
    const char *name;
    int flags;
    int totalSize;
    int msecLoopingLife;
    int elemDefCountLooping;
    int elemDefCountOneShot;
    int elemDefCountEmission;
    const FxElemDef *elemDefs;
};

struct DynEntityDef
{
    DynEntityType type;
    GfxPlacement pose;
    XModel *xModel;
    unsigned __int16 brushModel;
    unsigned __int16 physicsBrushModel;
    const FxEffectDef *destroyFx;
    XModelPieces *destroyPieces;
    PhysPreset *physPreset;
    int health;
    PhysMass mass;
    int contents;
};

struct DynEntityPose
{
    GfxPlacement pose;
    float radius;
};

struct DynEntityClient
{
    int physObjId;
    unsigned __int16 flags;
    unsigned __int16 lightingHandle;
    int health;
};

struct DynEntityColl
{
    unsigned __int16 sector;
    unsigned __int16 nextEntInSector;
    float linkMins[2];
    float linkMaxs[2];
};

struct clipMap_t
{
    const char *name;
    int isInUse;
    int planeCount;
    cplane_s *planes;
    unsigned int numStaticModels;
    cStaticModel_s *staticModelList;
    unsigned int numMaterials;
    dmaterial_t *materials;
    unsigned int numBrushSides;
    cbrushside_t *brushsides;
    unsigned int numBrushEdges;
    unsigned __int8 *brushEdges;
    unsigned int numNodes;
    cNode_t *nodes;
    unsigned int numLeafs;
    cLeaf_t *leafs;
    unsigned int leafbrushNodesCount;
    cLeafBrushNode_s *leafbrushNodes;
    unsigned int numLeafBrushes;
    unsigned __int16 *leafbrushes;
    unsigned int numLeafSurfaces;
    unsigned int *leafsurfaces;
    unsigned int vertCount;
    float (*verts)[3];
    int triCount;
    unsigned __int16 *triIndices;
    unsigned __int8 *triEdgeIsWalkable;
    int borderCount;
    CollisionBorder *borders;
    int partitionCount;
    CollisionPartition *partitions;
    int aabbTreeCount;
    CollisionAabbTree *aabbTrees;
    unsigned int numSubModels;
    cmodel_t *cmodels;
    unsigned __int16 numBrushes;
    cbrush_t *brushes;
    int numClusters;
    int clusterBytes;
    unsigned __int8 *visibility;
    int vised;
    MapEnts *mapEnts;
    cbrush_t *box_brush;
    cmodel_t box_model;
    unsigned __int16 dynEntCount[2];
    DynEntityDef *dynEntDefList[2];
    DynEntityPose *dynEntPoseList[2];
    DynEntityClient *dynEntClientList[2];
    DynEntityColl *dynEntCollList[2];
    unsigned int checksum;
};

struct ComPrimaryLight
{
    unsigned __int8 type;
    unsigned __int8 canUseShadowMap;
    unsigned __int8 exponent;
    unsigned __int8 unused;
    float color[3];
    float dir[3];
    float origin[3];
    float radius;
    float cosHalfFovOuter;
    float cosHalfFovInner;
    float cosHalfFovExpanded;
    float rotationLimit;
    float translationLimit;
    const char *defName;
};

struct ComWorld
{
    const char *name;
    int isInUse;
    unsigned int primaryLightCount;
    ComPrimaryLight *primaryLights;
};

enum nodeType : __int32
{
    NODE_BADNODE = 0x0,
    NODE_PATHNODE = 0x1,
    NODE_COVER_STAND = 0x2,
    NODE_COVER_CROUCH = 0x3,
    NODE_COVER_CROUCH_WINDOW = 0x4,
    NODE_COVER_PRONE = 0x5,
    NODE_COVER_RIGHT = 0x6,
    NODE_COVER_LEFT = 0x7,
    NODE_COVER_WIDE_RIGHT = 0x8,
    NODE_COVER_WIDE_LEFT = 0x9,
    NODE_CONCEALMENT_STAND = 0xA,
    NODE_CONCEALMENT_CROUCH = 0xB,
    NODE_CONCEALMENT_PRONE = 0xC,
    NODE_REACQUIRE = 0xD,
    NODE_BALCONY = 0xE,
    NODE_SCRIPTED = 0xF,
    NODE_NEGOTIATION_BEGIN = 0x10,
    NODE_NEGOTIATION_END = 0x11,
    NODE_TURRET = 0x12,
    NODE_GUARD = 0x13,
    NODE_NUMTYPES = 0x14,
    NODE_DONTLINK = 0x14,
};

struct pathlink_s
{
    float fDist;
    unsigned __int16 nodeNum;
    unsigned __int8 disconnectCount;
    unsigned __int8 negotiationLink;
    unsigned __int8 ubBadPlaceCount[4];
};

struct pathnode_constant_t
{
    nodeType type;
    unsigned __int16 spawnflags;
    unsigned __int16 targetname;
    unsigned __int16 script_linkName;
    unsigned __int16 script_noteworthy;
    unsigned __int16 target;
    unsigned __int16 animscript;
    int animscriptfunc;
    float vOrigin[3];
    float fAngle;
    float forward[2];
    float fRadius;
    float minUseDistSq;
    __int16 wOverlapNode[2];
    __int16 wChainId;
    __int16 wChainDepth;
    __int16 wChainParent;
    unsigned __int16 totalLinkCount;
    pathlink_s *Links;
};

struct pathnode_dynamic_t
{
    void *pOwner;
    int iFreeTime;
    int iValidTime[3];
    int inPlayerLOSTime;
    __int16 wLinkCount;
    __int16 wOverlapCount;
    __int16 turretEntNumber;
    __int16 userCount;
};

struct pathnode_t;

struct pathnode_transient_t
{
    int iSearchFrame;
    pathnode_t *pNextOpen;
    pathnode_t *pPrevOpen;
    pathnode_t *pParent;
    float fCost;
    float fHeuristic;
    float costFactor;
};

struct pathnode_t
{
    pathnode_constant_t constant;
    pathnode_dynamic_t dynamic;
    pathnode_transient_t transient;
};

struct pathbasenode_t
{
    float vOrigin[3];
    unsigned int type;
};

struct pathnode_tree_nodes_t
{
    int nodeCount;
    unsigned __int16 *nodes;
};

union pathnode_tree_info_t;
struct pathnode_tree_t
{
    int axis;
    float dist;
    pathnode_tree_info_t u;
};

union pathnode_tree_info_t
{
    pathnode_tree_t *child[2];
    pathnode_tree_nodes_t s;
};

struct PathData
{
    unsigned int nodeCount;
    pathnode_t *nodes;
    pathbasenode_t *basenodes;
    unsigned int chainNodeCount;
    unsigned __int16 *chainNodeForNode;
    unsigned __int16 *nodeForChainNode;
    int visBytes;
    unsigned __int8 *pathVis;
    int nodeTreeCount;
    pathnode_tree_t *nodeTree;
};

struct GameWorldSp
{
    const char *name;
    PathData path;
};

struct GameWorldMp
{
    const char *name;
};

struct GfxStreamingAabbTree
{
    unsigned __int16 firstItem;
    unsigned __int16 itemCount;
    unsigned __int16 firstChild;
    unsigned __int16 childCount;
    float mins[3];
    float maxs[3];
};

struct GfxWorldStreamInfo
{
    int aabbTreeCount;
    GfxStreamingAabbTree *aabbTrees;
    int leafRefCount;
    int *leafRefs;
};

struct GfxWorldVertex
{
    float xyz[3];
    float binormalSign;
    GfxColor color;
    float texCoord[2];
    float lmapCoord[2];
    PackedUnitVec normal;
    PackedUnitVec tangent;
};

struct GfxWorldVertexData
{
    GfxWorldVertex *vertices;
    D3DVertexBuffer worldVb;
};

struct GfxWorldVertexLayerData
{
    unsigned __int8 *data;
    D3DVertexBuffer layerVb;
};

struct SunLightParseParams
{
    char name[64];
    float ambientScale;
    float ambientColor[3];
    float diffuseFraction;
    float sunLight;
    float sunColor[3];
    float diffuseColor[3];
    bool diffuseColorHasBeenSet;
    float angles[3];
};

struct __declspec(align(4)) GfxLightImage
{
    GfxImage *image;
    unsigned __int8 samplerState;
};

struct GfxLightDef
{
    const char *name;
    GfxLightImage attenuation;
    int lmapLookupStart;
};

struct GfxLight
{
    unsigned __int8 type;
    unsigned __int8 canUseShadowMap;
    unsigned __int8 unused[2];
    float color[3];
    float dir[3];
    float origin[3];
    float radius;
    float cosHalfFovOuter;
    float cosHalfFovInner;
    int exponent;
    unsigned int spotShadowIndex;
    GfxLightDef *def;
};

struct GfxReflectionProbe
{
    float origin[3];
    GfxImage *reflectionImage;
};

struct GfxWorldDpvsPlanes
{
    int cellCount;
    cplane_s *planes;
    unsigned __int16 *nodes;
    unsigned int *sceneEntCellBits;
};

struct GfxAabbTree
{
    float mins[3];
    float maxs[3];
    unsigned __int16 childCount;
    unsigned __int16 surfaceCount;
    unsigned __int16 startSurfIndex;
    unsigned __int16 smodelIndexCount;
    unsigned __int16 *smodelIndexes;
    int childrenOffset;
};

struct GfxPortal;
struct GfxPortalWritable
{
    bool isQueued;
    bool isAncestor;
    unsigned __int8 recursionDepth;
    unsigned __int8 hullPointCount;
    float (*hullPoints)[2];
    GfxPortal *queuedParent;
};

struct DpvsPlane
{
    float coeffs[4];
    unsigned __int8 side[3];
    unsigned __int8 pad;
};

struct GfxCell;
struct GfxPortal
{
    GfxPortalWritable writable;
    DpvsPlane plane;
    GfxCell *cell;
    float (*vertices)[3];
    unsigned __int8 vertexCount;
    float hullAxis[2][3];
};

struct GfxCell
{
    float mins[3];
    float maxs[3];
    int aabbTreeCount;
    GfxAabbTree *aabbTree;
    int portalCount;
    GfxPortal *portals;
    int cullGroupCount;
    int *cullGroups;
    unsigned __int8 reflectionProbeCount;
    unsigned __int8 *reflectionProbes;
};

struct GfxLightmapArray
{
    GfxImage *primary;
    GfxImage *secondary;
};

struct GfxLightGridEntry
{
    unsigned __int16 colorsIndex;
    unsigned __int8 primaryLightIndex;
    unsigned __int8 needsTrace;
};

struct GfxLightGridColors
{
    unsigned __int8 rgb[56][3];
};

struct GfxLightGrid
{
    bool hasLightRegions;
    unsigned int sunPrimaryLightIndex;
    unsigned __int16 mins[3];
    unsigned __int16 maxs[3];
    unsigned int rowAxis;
    unsigned int colAxis;
    unsigned __int16 *rowDataStart;
    unsigned int rawRowDataSize;
    unsigned __int8 *rawRowData;
    unsigned int entryCount;
    GfxLightGridEntry *entries;
    unsigned int colorCount;
    GfxLightGridColors *colors;
};

/* 9014 */
struct GfxBrushModelWritable
{
    float mins[3];
    float maxs[3];
};

struct GfxBrushModel
{
    GfxBrushModelWritable writable;
    float bounds[2][3];
    unsigned int surfaceCount;
    unsigned int startSurfIndex;
};

struct MaterialMemory
{
    Material *material;
    int memory;
};

struct sunflare_t
{
    bool hasValidData;
    Material *spriteMaterial;
    Material *flareMaterial;
    float spriteSize;
    float flareMinSize;
    float flareMinDot;
    float flareMaxSize;
    float flareMaxDot;
    float flareMaxAlpha;
    int flareFadeInTime;
    int flareFadeOutTime;
    float blindMinDot;
    float blindMaxDot;
    float blindMaxDarken;
    int blindFadeInTime;
    int blindFadeOutTime;
    float glareMinDot;
    float glareMaxDot;
    float glareMaxLighten;
    int glareFadeInTime;
    int glareFadeOutTime;
    float sunFxPosition[3];
};

struct XModelDrawInfo
{
    unsigned __int16 lod;
    unsigned __int16 surfId;
};

struct GfxSceneDynModel
{
    XModelDrawInfo info;
    unsigned __int16 dynEntId;
};

struct BModelDrawInfo
{
    unsigned __int16 surfId;
};

struct GfxSceneDynBrush
{
    BModelDrawInfo info;
    unsigned __int16 dynEntId;
};

struct GfxShadowGeometry
{
    unsigned __int16 surfaceCount;
    unsigned __int16 smodelCount;
    unsigned __int16 *sortedSurfIndex;
    unsigned __int16 *smodelIndex;
};

struct GfxLightRegionAxis
{
    float dir[3];
    float midPoint;
    float halfSize;
};

struct GfxLightRegionHull
{
    float kdopMidPoint[9];
    float kdopHalfSize[9];
    unsigned int axisCount;
    GfxLightRegionAxis *axis;
};

struct GfxLightRegion
{
    unsigned int hullCount;
    GfxLightRegionHull *hulls;
};

struct GfxWorldDpvsStatic
{
    unsigned int smodelCount;
    unsigned int staticSurfaceCount;
    unsigned int litSurfsBegin;
    unsigned int litSurfsEnd;
    unsigned int decalSurfsBegin;
    unsigned int decalSurfsEnd;
    unsigned int emissiveSurfsBegin;
    unsigned int emissiveSurfsEnd;
    unsigned int smodelVisDataCount;
    unsigned int surfaceVisDataCount;
    unsigned __int8 *smodelVisData[3];
    unsigned __int8 *surfaceVisData[3];
    unsigned int *lodData;
    unsigned __int16 *sortedSurfIndex;
    GfxStaticModelInst *smodelInsts;
    GfxSurface *surfaces;
    GfxCullGroup *cullGroups;
    GfxStaticModelDrawInst *smodelDrawInsts;
    GfxDrawSurf *surfaceMaterials;
    unsigned int *surfaceCastsSunShadow;
    volatile int usageCount;
};

struct GfxWorld
{
    const char *name;
    const char *baseName;
    int planeCount;
    int nodeCount;
    int indexCount;
    unsigned __int16 *indices;
    D3DIndexBuffer indexBuffer;
    int surfaceCount;
    GfxWorldStreamInfo streamInfo;
    int skySurfCount;
    int *skyStartSurfs;
    GfxImage *skyImage;
    unsigned __int8 skySamplerState;
    unsigned int vertexCount;
    GfxWorldVertexData vd;
    unsigned int vertexLayerDataSize;
    GfxWorldVertexLayerData vld;
    SunLightParseParams sunParse;
    GfxLight *sunLight;
    float sunColorFromBsp[3];
    unsigned int sunPrimaryLightIndex;
    unsigned int primaryLightCount;
    int cullGroupCount;
    unsigned int reflectionProbeCount;
    GfxReflectionProbe *reflectionProbes;
    GfxTexture *reflectionProbeTextures;
    GfxWorldDpvsPlanes dpvsPlanes;
    int cellBitsCount;
    GfxCell *cells;
    int lightmapCount;
    GfxLightmapArray *lightmaps;
    GfxLightGrid lightGrid;
    GfxTexture *lightmapPrimaryTextures;
    GfxTexture *lightmapSecondaryTextures;
    int modelCount;
    GfxBrushModel *models;
    float mins[3];
    float maxs[3];
    unsigned int checksum;
    int materialMemoryCount;
    MaterialMemory *materialMemory;
    sunflare_t sun;
    float outdoorLookupMatrix[4][4];
    GfxImage *outdoorImage;
    unsigned int *cellCasterBits;
    GfxSceneDynModel *sceneDynModel;
    GfxSceneDynBrush *sceneDynBrush;
    unsigned int *primaryLightEntityShadowVis;
    unsigned int *primaryLightDynEntShadowVis[2];
    unsigned __int8 *nonSunPrimaryLightForModelDynEnt;
    GfxShadowGeometry *shadowGeom;
    GfxLightRegion *lightRegion;
    GfxWorldDpvsStatic dpvs;
    GfxWorldDpvsDynamic dpvsDyn;
};

union XAssetHeader
{
    XModelPieces *xmodelPieces;
    PhysPreset *physPreset;
    XAnimParts *parts;
    XModel *model;
    Material *material;
    MaterialPixelShader *pixelShader;
    MaterialVertexShader *vertexShader;
    MaterialTechniqueSet *techniqueSet;
    GfxImage *image;
    snd_alias_list_t *sound;
    SndCurve *sndCurve;
    LoadedSound *loadSnd;
    clipMap_t *clipMap;
    ComWorld *comWorld;
    GameWorldSp *gameWorldSp;
    GameWorldMp *gameWorldMp;
    MapEnts *mapEnts;
    GfxWorld *gfxWorld;
    GfxLightDef *lightDef;
    Font_s *font;
    MenuList *menuList;
    menuDef_t *menu;
    LocalizeEntry *localize;
    WeaponDef *weapon;
    SndDriverGlobals *sndDriverGlobals;
    const FxEffectDef *fx;
    FxImpactTable *impactFx;
    RawFile *rawfile;
    StringTable *stringTable;
    void *data;
};
