feat(profile): refactor lua, bc code

This commit is contained in:
phaneron 2026-04-01 17:37:40 -04:00
parent e79ee08905
commit 37db5336e4
40 changed files with 3424 additions and 0 deletions

View file

@ -0,0 +1,180 @@
#ifndef MAP_ADT_CHUNKS_H
#define MAP_ADT_CHUNKS_H
DECLARE_STRUCT(SMMapHeader);
DECLARE_STRUCT(SMChunkInfo);
DECLARE_STRUCT(SMDoodadDef);
DECLARE_STRUCT(SMMapObjDef);
DECLARE_STRUCT(SMChunk);
DECLARE_STRUCT(SLVert);
DECLARE_STRUCT(SMLayer);
DECLARE_STRUCT(SLTiles);
DECLARE_STRUCT(SWFlowv);
DECLARE_STRUCT(SOVert);
DECLARE_STRUCT(SMVert);
DECLARE_STRUCT(SWVert);
DECLARE_STRUCT(SMLiquidChunk);
DECLARE_STRUCT(CWSoundEmitter);
#include "tempest/box.h"
#include "tempest/sphere.h"
#include "tempest/vector.h"
struct SMMapHeader {
uint32_t flags;
uint32_t mcin; // MCIN*, Cata+: obviously gone. probably all offsets gone, except mh2o(which
// remains in root file).
uint32_t mtex; // MTEX*
uint32_t mmdx; // MMDX*
uint32_t mmid; // MMID*
uint32_t mwmo; // MWMO*
uint32_t mwid; // MWID*
uint32_t mddf; // MDDF*
uint32_t modf; // MODF*
uint32_t mfbo; // MFBO* this is only set if flags & mhdr_MFBO.
uint32_t mh2o; // MH2O*
uint32_t mtxf; // MTXF*
uint8_t mamp_value; // Cata+, explicit MAMP chunk overrides data
uint8_t padding[3];
uint32_t unused[3];
};
struct SMChunkInfo {
uint32_t offset; // absolute offset.
uint32_t size; // the size of the MCNK chunk, this is refering to.
uint32_t flags; // always 0. only set in the client., FLAG_LOADED = 1
union {
char pad[4];
uint32_t asyncId; // not in the adt file. client use only
};
};
struct SMDoodadDef {
uint32_t nameId; // references an entry in the MMID chunk, specifying the model t // if flag
// mddf_entry_is_filedata_id is set, a file data id instead, ignoring MMID.
uint32_t uniqueId; // this ID should be unique for all ADTs currently loaded. Best, they are
// unique for the whole map. Blizzar // these
// unique for the whole game.
C3Vector position; // This is relative to a corner of the map. Subtract 17066 from the non
// vertical values and you should start t //
// something that makes sense. You'll then likely have to negate one of the
// non vertical values in wha // coordinate
// system you're using to finally move it into place.
C3Vector rotation; // degrees. This is not the same coordinate system orientation like the ADT
// itself! (see history.)
uint16_t scale; // 1024 is the default size equaling 1.0f.
uint16_t flags; // values from enum MDDFFlags.
};
struct SMMapObjDef {
uint32_t nameId; // references an entry in the MWID chunk, specifying the model to use.
uint32_t uniqueId; // this ID should be unique for all ADTs currently loaded. Best, they are
// unique for the whole map.
C3Vector position;
C3Vector rotation; // same as in MDDF.
CAaBox extents; // position plus the transformed wmo bounding box. used for defining if they are
// rendered as well as collision.
uint16_t flags; // values from enum MODFFlags.
uint16_t doodadSet; // which WMO doodad set is used. Traditionally references WMO#MODS_chunk, if
// modf_use_sets_from_mwds is set, references #MWDR_.28Shadowlands.2B.29
uint16_t nameSet; // which WMO name set is used. Used for renaming goldshire inn to northshire
// inn while using the same model.
uint16_t scale; // Legion+: scale, 1024 means 1 (same as MDDF). Padding in 0.5.3 alpha.
};
struct SMChunk {
uint32_t flags;
C2iVector index;
uint32_t nLayers;
uint32_t nDoodadRefs;
uint32_t ofsHeight;
uint32_t ofsNormal;
uint32_t ofsLayer;
uint32_t ofsRefs;
uint32_t ofsAlpha;
uint32_t sizeAlpha;
uint32_t ofsShadow;
uint32_t sizeShadow;
uint32_t areaid;
uint32_t nMapObjRefs;
uint32_t holes;
uint8_t low_quality_texture_map[0x10];
uint32_t predTex;
uint32_t nEffectDoodad;
uint32_t ofsSndEmitters;
uint32_t nSndEmitters;
uint32_t ofsLiquid;
uint32_t sizeLiquid;
C3Vector position;
uint32_t ofsMCCV;
uint32_t unused1;
uint32_t unused2;
};
struct SMLayer {
uint32_t textureId;
uint32_t flags;
uint32_t offsetInMCAL;
uint32_t offectId;
};
struct SWVert {
char depth;
char flow0Pct;
char flow1Pct;
char filler;
float height;
};
struct SOVert {
char depth;
char foam;
char wet;
char filler;
};
struct SMVert {
uint16_t s;
uint16_t t;
float height;
};
struct SLVert {
union {
SWVert waterVert;
SOVert oceanVert;
SMVert magmaVert;
};
};
struct SLTiles {
char tiles[8][8];
};
struct SWFlowv {
CAaSphere sphere;
C3Vector dir;
float velocity;
float amplitude;
float frequency;
};
struct SMLiquidChunk {
float minHeight;
float maxHeight;
SLVert verts[9 * 9];
SLTiles tiles;
uint32_t nFlowvs;
SWFlowv flowvs[2];
};
struct CWSoundEmitter {
uint32_t entry_id;
C3Vector position;
C3Vector size;
};
#endif

View file

@ -0,0 +1,29 @@
#ifndef MAP_CHUNK_GEOM_FACTORY_H
#define MAP_CHUNK_GEOM_FACTORY_H
DECLARE_STRUCT(CChunkGeomFactory);
#include "map/chunkliquid.h"
#include "map/mapchunkbuf.h"
#include "tempest/matrix.h"
struct CChunkGeomFactory {
void** vtable;
uint32_t unk_04;
uint32_t unk_08;
uint32_t unk_0C;
uint32_t unk_10;
CChunkLiquid* liquidChunk;
uint32_t unk_18;
CMapChunkBuf* mapChunkBuf;
uint32_t unk_20;
uint32_t unk_24;
uint32_t unk_28;
uint16_t unk_flags_2C;
uint16_t unk_flags_2E;
uint32_t unk_30;
C44Matrix matrix;
};
#endif

View file

@ -0,0 +1,40 @@
#ifndef MAP_CHUNK_LIQUID_H
#define MAP_CHUNK_LIQUID_H
#include "storm/list.h"
DECLARE_STRUCT(CChunkLiquid);
STORM_TS_LIST(CChunkLiquid);
#include "map/mapchunk.h"
#include "tempest/vector.h"
struct CChunkLiquid {
int32_t objectIndex;
int32_t unk_004;
int32_t unk_008;
C3Vector topLeftCoords;
C3Vector center;
float radius;
C2Vector height;
float resPurgeTimer;
C2iVector tileBegin;
C2iVector tileEnd;
int32_t unk_044;
int32_t unk_048;
int32_t unk_04C;
int32_t unk_050;
uint8_t* tiles;
uint8_t* liquidInstPtr;
CMapChunk* owner;
CChunkLiquid* prev;
CChunkLiquid* next;
int32_t unk_068;
int32_t unk_06C;
int32_t unk_070;
int32_t unk_074;
C3Vector verts[81];
};
#endif

View file

@ -0,0 +1,45 @@
#ifndef MAP_DETAIL_DOODAD_H
#define MAP_DETAIL_DOODAD_H
DECLARE_STRUCT(CDetailDoodadGeomVertex);
DECLARE_STRUCT(CDetailDoodadGeom);
DECLARE_STRUCT(CDetailDoodadInst);
#include "map/mapchunk.h"
#include "storm/array.h"
#include "system/types.h"
#include "tempest/vector.h"
#include "texture/texture.h"
struct CDetailDoodadGeomVertex {
uint16_t unk_00;
uint16_t unk_02;
uint32_t unk_04;
C3Vector pos;
float angle;
float scale;
C3Vector unkVec;
uint32_t color;
};
STORM_TS_GROWABLE_ARRAY(CDetailDoodadGeomVertex);
struct CDetailDoodadGeom {
CTexture* texture;
int32_t unkVertexCount;
int32_t unkIndexCount;
void* unkVertBufStream;
void* unkIdxBufStream;
TSGrowableArray_CDetailDoodadGeomVertex data;
};
struct CDetailDoodadInst {
int32_t objectIndex;
CDetailDoodadGeom geom[4];
int32_t unkCounter;
CMapChunk* mapChunkOwner;
int32_t unk_09C;
int32_t unk_0A0;
};
#endif

View file

@ -0,0 +1,13 @@
#ifndef MAP_LIQUID_PARTICLE_H
#define MAP_LIQUID_PARTICLE_H
DECLARE_STRUCT(LiquidParticle);
#include "tempest/vector.h"
struct LiquidParticle {
C3Vector position;
float size;
};
#endif

View file

@ -0,0 +1,86 @@
#ifndef MAP_MAP_AREA_H
#define MAP_MAP_AREA_H
DECLARE_STRUCT(CMapArea);
DECLARE_STRUCT(CMapAreaTexture);
DECLARE_STRUCT(CMapAreaLink);
DECLARE_STRUCT(CMapAreaChunkLink);
#include "map/adt_chunks.h"
#include "map/mapchunk.h"
#include "storm/array.h"
#include "storm/list.h"
#include "tempest/vector.h"
#include "texture/texture.h"
STORM_TS_GROWABLE_ARRAY(CMapAreaTexture);
struct CMapAreaTexture {
char* textureName;
CTexture* texture;
};
STORM_TS_LIST(CMapAreaLink);
struct CMapAreaLink {
uint32_t objectIndex; // 0x00
CMapArea* owner; // 0x04
void* ref; // 0x08
TSLink_CMapAreaLink refLink; // 0x0C - 0x14
TSLink_CMapAreaLink ownerLink; // 0x14 - 0x1C
};
STORM_TS_LIST(CMapAreaChunkLink);
struct CMapAreaChunkLink {
uint32_t objectIndex; // 0x00
CMapChunk* owner; // 0x04
CMapArea* ref; // 0x08
TSLink_CMapAreaChunkLink refLink; // 0x0C - 0x14
TSLink_CMapAreaChunkLink ownerLink; // 0x14 - 0x1C
};
struct CMapArea {
void** vtable;
uint32_t objectIndex;
uint16_t type;
uint16_t refCount;
uint32_t unk_0C;
CMapArea* prev;
CMapArea* next;
TSExplicitList_CMapAreaLink linkList;
C3Vector bottomRight;
C3Vector topLeft;
C3Vector topLeft2;
C2iVector index;
C2iVector tileChunkIndex;
TSGrowableArray_CMapAreaTexture textures;
SMMapHeader* header;
int32_t unk_6C;
CAsyncObject* asyncObject;
TSExplicitList_CMapAreaChunkLink chunkLinkList;
void* filePtr;
int32_t fileSize;
SMChunkInfo* chunkInfo;
int32_t unk_8C;
SMDoodadDef* doodadDef;
SMMapObjDef* mapObjDef;
int32_t doodadDefCount;
int32_t mapObjDefCount;
char* m2FileNames;
char* wmoFileNames;
uint32_t* modelFilenamesOffsets;
uint32_t* wmoFilenamesOffsets;
int16_t* flyingBbox;
int32_t* textureFlags;
uint8_t* unk_B8; // MH20
CMapChunk* mapChunks[256];
};
#endif

View file

@ -0,0 +1,33 @@
#ifndef MAP_MAP_BASE_OBJ_H
#define MAP_MAP_BASE_OBJ_H
DECLARE_STRUCT(CMapBaseObj);
DECLARE_STRUCT(CMapBaseObjLink);
#include "storm/list.h"
STORM_TS_LIST(CMapBaseObjLink);
struct CMapBaseObjLink {
uint32_t objectIndex; // 0x00
CMapBaseObj* owner; // 0x04
CMapBaseObj* ref; // 0x08
TSLink_CMapBaseObjLink refLink; // 0x0C - 0x14
TSLink_CMapBaseObjLink ownerLink; // 0x14 - 0x1C
};
struct CMapBaseObj {
void** vtable; // 0x00
int32_t objectIndex; // 0x04
uint16_t type; // 0x08
uint16_t refCount; // 0x0A
int32_t unk_C; // 0x0C
CMapBaseObj* prev; // 0x10
CMapBaseObj* next; // 0x14
TSExplicitList_CMapBaseObjLink list; // 0x18 - 0x24
};
#endif

View file

@ -0,0 +1,120 @@
#ifndef MAP_MAP_CHUNK_H
#define MAP_MAP_CHUNK_H
DECLARE_STRUCT(CMapChunk);
DECLARE_STRUCT(CMapChunkLink);
DECLARE_STRUCT(CMapChunkDoodadDefLink);
DECLARE_STRUCT(CMapChunkMapObjDefLink);
#include "map/maparea.h"
#include "map/mapdoodaddef.h"
#include "map/mapobjdef.h"
#include "storm/list.h"
STORM_TS_LIST(CMapChunkLink);
struct CMapChunkLink {
uint32_t objectIndex; // 0x00
CMapChunk* owner; // 0x04
CMapArea* ref; // 0x08
TSLink_CMapChunkLink refLink; // 0x0C - 0x14
TSLink_CMapChunkLink ownerLink; // 0x14 - 0x1C
};
typedef struct CMapChunkDoodadDefLink CMapChunkDoodadDefLink;
STORM_TS_LIST(CMapChunkDoodadDefLink);
struct CMapChunkDoodadDefLink {
uint32_t objectIndex; // 0x00
CMapDoodadDef* owner; // 0x04
CMapChunk* ref; // 0x08
TSLink_CMapChunkDoodadDefLink refLink; // 0x0C - 0x14
TSLink_CMapChunkDoodadDefLink ownerLink; // 0x14 - 0x1C
};
typedef struct CMapChunkMapObjDefLink CMapChunkMapObjDefLink;
STORM_TS_LIST(CMapChunkMapObjDefLink);
struct CMapChunkMapObjDefLink {
uint32_t objectIndex; // 0x00
CMapObjDef* owner; // 0x04
CMapChunk* ref; // 0x08
TSLink_CMapChunkMapObjDefLink refLink; // 0x0C - 0x14
TSLink_CMapChunkMapObjDefLink ownerLink; // 0x14 - 0x1C
};
struct CMapChunk {
void** vtable;
uint32_t objectIndex;
uint16_t type;
uint16_t refCount;
uint32_t unk_0C;
CMapChunk* prev;
CMapChunk* next;
TSExplicitList_CMapChunkLink linkList;
C2iVector aIndex;
C2iVector sOffset;
C2iVector cOffset;
C3Vector center;
float radius;
CAaBox bbox;
C3Vector bottomRight;
C3Vector topLeft;
C3Vector topLeftCoords;
float distToCamera;
CAaBox bbox2;
void* detailDoodadInst;
void* renderChunk;
int32_t unk_AC;
int32_t areaId;
int32_t unk_B4;
int32_t unk_B8;
int32_t unk_BC;
int32_t unk_C0;
TSExplicitList_CMapChunkDoodadDefLink doodadDefLinkList;
TSExplicitList_CMapChunkMapObjDefLink mapObjDefLinkList;
int32_t TSExplicitList__m_linkoffset_DC;
void* TSExplicitList__ptr_E0;
void* TSExplicitList__ptr2_E4;
// Light
int32_t TSExplicitList__m_linkoffset_E8;
void* TSExplicitList__ptr_EC;
void* TSExplicitList__ptr2_F0;
// CMapSoundEmitter
int32_t TSExplicitList__m_linkoffset_F4;
void* TSExplicitList__ptr_F8;
void* TSExplicitList__ptr2_FC;
// CChunkLiquid
TSExplicitList_CChunkLiquid liquidChunkLinkList;
uint8_t* chunkInfoBeginPtr;
SMChunk* header;
uint8_t* lowQualityTexMap;
uint8_t* predTexture;
float* vertices;
uint32_t* vertexShading;
int8_t* normals;
uint8_t* shadowMap;
SMLayer* layers;
uint8_t* additionalShadowmap;
uint8_t* MCRF_ptr;
SMLiquidChunk* liquid;
CWSoundEmitter* soundEmitters;
// liquid related fields
int32_t unk_140;
int32_t unk_144;
int32_t unk_148;
int32_t unk_14C;
int32_t unk_150;
int32_t unk_154;
};
#endif

View file

@ -0,0 +1,23 @@
#ifndef MAP_MAP_CHUNK_BUF_H
#define MAP_MAP_CHUNK_BUF_H
DECLARE_STRUCT(CMapChunkBuf);
#include "gx/buffer.h"
struct CMapChunkBuf {
uint32_t unk_00;
float flushTimer;
uint32_t vertexDataSize;
uint32_t indexDataSize;
CGxBuf* vertexBuf;
CGxBuf* indexBuf;
CGxPool* vertexPool;
CGxPool* indexPool;
uint32_t unk_20;
uint32_t unk_24;
};
#endif

View file

@ -0,0 +1,79 @@
#ifndef MAP_MAP_DOODAD_DEF_H
#define MAP_MAP_DOODAD_DEF_H
DECLARE_STRUCT(CMapDoodadDef);
DECLARE_STRUCT(CMapDoodadDefMapChunkLink);
#include "m2/model.h"
#include "map/maparea.h"
#include "map/mapbaseobj.h"
#include "storm/list.h"
#include "tempest/box.h"
#include "tempest/matrix.h"
#include "tempest/sphere.h"
#include "tempest/vector.h"
STORM_TS_LIST(CMapDoodadDefMapChunkLink);
struct CMapDoodadDefMapChunkLink {
uint32_t objectIndex; // 0x00
CMapDoodadDef* owner; // 0x04
CMapBaseObj* ref; // 0x08 //could be CMapChunk* or CMapObjDefGroup*
TSLink_CMapDoodadDefMapChunkLink refLink; // 0x0C - 0x14
TSLink_CMapDoodadDefMapChunkLink ownerLink; // 0x14 - 0x1C
};
struct CMapDoodadDef {
void** vtable; // 0x00
int32_t objectIndex; // 0x04
uint16_t type; // 0x08
uint16_t refCount; // 0x0A
int32_t unk_C; // 0x0C
CMapDoodadDef* prev; // 0x10
CMapDoodadDef* next; // 0x14
TSExplicitList_CMapDoodadDefMapChunkLink linkList;
// CMapStaticEntity fields
int32_t unk_024; // 0x24
uint32_t unkFlags_28; // 0x28
int32_t unkCounter; // 0x2C
float unk_030; // 0x30
CM2Model* model;
CAaSphere sphere;
CAaBox bboxStaticEntity;
C3Vector vec2;
C3Vector position;
float scale; // 0x78
int32_t unk_07C; // 0x7C
int32_t unk_080; // 0x80
CImVector m2AmbietColor; // 0x84
CImVector m2DiffuseColor; // 0x88
float unk_08C; // 0x8C
// end
// CMapDoodadDef fields
uint32_t unkFlags_090; // 0x90
void* unk_094; // 0x94
void* unk_098; // 0x98
void* prevMapDoodadDef_09C; // 0x9C
void* nextMapDoodadDef_0A0; // 0xA0
int32_t unk_0A4; // 0xA4
int32_t unk_0A8; // 0xA8
int32_t unk_0AC; // 0xAC
int32_t unk_0B0; // 0xB0
int32_t unk_0B4; // 0xB4
int32_t unk_0B8; // 0xB8
int32_t unk_0BC; // 0xBC
CAaBox bboxDoodadDef;
C44Matrix mat;
C44Matrix identity;
int32_t unk_158; // 0x158 sound
int32_t unk_15C; // 0x15C
int32_t unk_160; // 0x160
int32_t unk_164; // 0x164
int32_t unk_168; // 0x168
int32_t unk_16C; // 0x16C
// end
};
#endif

View file

@ -0,0 +1,70 @@
#ifndef MAP_MAP_ENTITY_H
#define MAP_MAP_ENTITY_H
DECLARE_STRUCT(CMapEntityMapChunkLink);
DECLARE_STRUCT(CMapEntity);
#include "m2/model.h"
#include "storm/list.h"
STORM_TS_LIST(CMapEntityMapChunkLink);
struct CMapEntityMapChunkLink {
uint32_t objectIndex; // 0x00
CMapEntity* owner; // 0x04
void* ref; // 0x08 //could be CMapChunk* or CMapObjDefGroup*
TSLink_CMapEntityMapChunkLink refLink; // 0x0C - 0x14
TSLink_CMapEntityMapChunkLink ownerLink; // 0x14 - 0x1C
};
struct CMapEntity {
// CMapBaseObj fields
void** vtable; // 0x00
int32_t objectIndex; // 0x04
uint16_t type; // 0x08
uint16_t refCount; // 0x0A
int32_t unk_C; // 0x0C
CMapEntity* prev; // 0x10
CMapEntity* next; // 0x14
TSExplicitList_CMapEntityMapChunkLink linkList;
// end
// CMapStaticEntity fields
int32_t unk_024; // 0x24
uint32_t unkFlags_28; // 0x28
int32_t unkCounter; // 0x2C
float unk_030; // 0x30
CM2Model* model;
CAaSphere sphere;
CAaBox bboxStaticEntity;
C3Vector vec2;
C3Vector position;
float scale; // 0x78
int32_t unk_07C; // 0x7C
int32_t unk_080; // 0x80
CImVector m2AmbietColor; // 0x84
CImVector m2DiffuseColor; // 0x88
float unk_08C; // 0x8C
// end
// CMapEntity fields
int32_t unk_090; // 0x90
int32_t unk_094; // 0x94
uint64_t guid; // 0x98
int32_t unk_0A0; // 0xA0
int32_t unk_0A4; // 0xA4
int32_t unk_0A8; // 0xA8
int32_t unk_0AC; // 0xAC
int32_t unk_0B0; // 0xB0
int32_t unk_0B4; // 0xB4
int32_t unk_0B8; // 0xB8
int32_t unk_0BC; // 0xBC
CImVector ambientTarget;
float dirLightScaleTarget;
int32_t unk_0C8; // 0xC8
int32_t unk_0CC; // 0xCC
// end
};
#endif

View file

@ -0,0 +1,177 @@
#ifndef MAP_MAP_OBJ_H
#define MAP_MAP_OBJ_H
DECLARE_STRUCT(CMapObjGroup);
DECLARE_STRUCT(CMapObj);
#include "async/object.h"
#include "map/vbb_list.h"
#include "map/wmo_chunks.h"
#include "storm/list.h"
#include "tempest/box.h"
#include "tempest/vector.h"
STORM_TS_LIST(CMapObjGroup);
struct CMapObjGroup {
int32_t objectIndex;
VBBList_Block* vertsBlock;
VBBList_Block* transparencyVertsBlock;
VBBList_Block* indicesBlock;
VBBList_Block* liquidVertsBlock;
VBBList_Block* liquidIndicesBlock;
float timer;
void* unk_1C;
int32_t unk_20;
int32_t unk_24;
int32_t unk_28;
int16_t unk_2C[2];
int32_t flags;
CAaBox bbox;
float distToCamera;
int32_t portalStart;
int32_t portalCount;
int32_t fogs;
uint16_t transparencyBatchesCount;
uint16_t intBatchCount;
int32_t extBatchCount;
void* CAaBspNodePtr1;
void* CAaBspNodePtr2;
uint16_t* nodeFaceIndices;
int32_t bspNodesCount;
int32_t nodeFaceIndicesCount;
int32_t unk_7C;
int32_t unk_80;
int32_t unk_84;
int32_t unk_88;
int32_t unk_8C;
int32_t unk_90;
int32_t unk_94;
int32_t unk_98;
int32_t unk_9C;
int32_t unk_A0;
int32_t unk_A4;
int32_t unk_A8;
int32_t unk_AC;
int32_t unk_B0;
CAaBox bbox2;
int32_t unk_CC;
int32_t unkFlags;
int32_t unk_D4;
int32_t minimapTag;
char* groupName;
SMOPoly* polyList;
uint16_t* indices;
int32_t unk_E8;
C3Vector* vertexList;
C3Vector* normalList;
C2Vector* textureVertexList;
int32_t unk_F8;
SMOBatch* batchList;
int32_t unk_100;
int32_t unk_104;
uint16_t* doodadRefList;
CImVector* colorVertexList;
CImVector* colorVertexListExtra;
int32_t unk_114;
C2iVector liquidVerts;
C2iVector liquidTiles;
C3Vector liquidCorner;
int32_t luquidMaterialId;
SMOLiquidVert* liquidVertexList;
SMOLTile* liquidTileList;
float liquidHeight;
int32_t unk_144;
int32_t unk_148;
int32_t unkFlag;
int32_t unk_150;
int32_t polyListSize;
int32_t indicesCount;
int32_t unk_15C;
int32_t vertexListCount;
int32_t normalListCount;
int32_t textureVertexListCount;
int32_t unk_16C;
int32_t batchListCount;
int32_t unk_174;
int32_t doodadRefListCount;
int32_t colorVertexListSize;
int32_t colorVertexListExtraSize;
int32_t wmoGroupId;
void* filePtr;
int32_t fileSize;
CMapObj* parent;
int32_t unk_194;
CAsyncObject* asyncObjPtr;
int32_t unkLoadedFlag;
int32_t unkIndexMin1;
int32_t unkIndexMax1;
uint16_t unkIndexMin2;
uint16_t unkIndexMax2;
int32_t TSExplicitList__m_linkoffset;
void* TSExplicitList__ptr;
void* TSExplicitList__ptr2;
CMapObjGroup* perv;
CMapObjGroup* next;
};
struct CMapObj {
int32_t objectIndex;
int32_t unk_04;
int32_t unk_08;
CMapObj* mapObjPtr1;
int32_t unk_10;
CMapObj* mapObjPtr2;
int32_t unk_18;
char m_wmoName[260];
SMOHeader* header;
char* textureNameList;
char* groupNameList;
char* skybox;
SMOGroupInfo* groupInfo;
C3Vector* portalVertexList;
SMOPortal* portalList;
SMOPortalRef* portalRefList;
C3Vector* visBlockVertList;
SMOVisibleBlock* visBlockList;
SMOLight* lightList;
SMODoodadSet* doodadSetList;
char* doodadNameList;
SMODoodadDef* doodadDefList;
SMOFog* fogList;
C4Plane* convexVolumePlanes;
SMOMaterial* materialList;
int32_t texturesSize;
int32_t groupNameSize;
int32_t groupInfoCount;
int32_t planeVertCount;
int32_t portalsCount;
int32_t portalRefCount;
int32_t visBlockVertCount;
int32_t visBlockCount;
int32_t ligtsCount;
int32_t doodadSetCount;
int32_t doodadNameSize;
int32_t doodadDefCount;
int32_t fogsCount;
int32_t convexVolumePlaneCount;
int32_t materialsCount;
uint32_t argb_color;
int32_t unk_1A4;
CAaBox bbox;
float distToCamera;
int32_t unk_1C4;
int32_t unk_1C8;
void* pWmoData;
int32_t wmoFileSize;
int32_t refCount;
float flushTimer;
CAsyncObject* asyncObject;
int32_t isGroupLoaded;
int32_t unk_1E4;
TSExplicitList_CMapObjGroup mapObjGroupList;
int32_t mapObjGroupCount;
CMapObjGroup* mapObjGroupArray[512];
};
#endif

View file

@ -0,0 +1,169 @@
#ifndef MAP_MAP_OBJ_DEF_H
#define MAP_MAP_OBJ_DEF_H
DECLARE_STRUCT(CMapObjDef);
DECLARE_STRUCT(CMapObjDefGroup);
DECLARE_STRUCT(CMapObjDefGroupMapObjDefLink);
DECLARE_STRUCT(CMapObjDefMapChunkLink);
DECLARE_STRUCT(CMapObjDefGroupDoodadDefLink);
DECLARE_STRUCT(CMapObjDefGroupMapEntityLink);
DECLARE_STRUCT(CMapObjDefMapObjDefGroupLink);
#include "map/maparea.h"
#include "map/mapdoodaddef.h"
#include "map/mapentity.h"
#include "map/mapobj.h"
#include "storm/array.h"
#include "storm/list.h"
#include "tempest/box.h"
#include "tempest/matrix.h"
#include "tempest/sphere.h"
#include "tempest/vector.h"
STORM_TS_LIST(CMapObjDefMapObjDefGroupLink);
struct CMapObjDefMapObjDefGroupLink {
uint32_t objectIndex; // 0x00
CMapObjDefGroup* owner; // 0x04
CMapObjDef* ref; // 0x08
TSLink_CMapObjDefMapObjDefGroupLink refLink; // 0x0C - 0x14
TSLink_CMapObjDefMapObjDefGroupLink ownerLink; // 0x14 - 0x1C
};
STORM_TS_LIST(CMapObjDefGroupMapObjDefLink);
struct CMapObjDefGroupMapObjDefLink {
uint32_t objectIndex; // 0x00
CMapObjDefGroup* owner; // 0x04
CMapObjDef* ref; // 0x08
TSLink_CMapObjDefGroupMapObjDefLink refLink; // 0x0C - 0x14
TSLink_CMapObjDefGroupMapObjDefLink ownerLink; // 0x14 - 0x1C
};
STORM_TS_LIST(CMapObjDefGroupDoodadDefLink);
struct CMapObjDefGroupDoodadDefLink {
uint32_t objectIndex; // 0x00
CMapDoodadDef* owner; // 0x04
CMapObjDef* ref; // 0x08
TSLink_CMapObjDefGroupDoodadDefLink refLink; // 0x0C - 0x14
TSLink_CMapObjDefGroupDoodadDefLink ownerLink; // 0x14 - 0x1C
};
STORM_TS_LIST(CMapObjDefGroupMapEntityLink);
struct CMapObjDefGroupMapEntityLink {
uint32_t objectIndex; // 0x00
CMapEntity* owner; // 0x04
CMapObjDef* ref; // 0x08
TSLink_CMapObjDefGroupMapEntityLink refLink; // 0x0C - 0x14
TSLink_CMapObjDefGroupMapEntityLink ownerLink; // 0x14 - 0x1C
};
STORM_TS_GROWABLE_ARRAY(CMapObjDefGroup);
struct CMapObjDefGroup {
void* vtable; // 0x00
int32_t objectIndex; // 0x04
uint16_t type; // 0x08
uint16_t refCount; // 0x0A
int32_t unk_C; // 0x0C
CMapObjDefGroup* prev; // 0x10
CMapObjDefGroup* next; // 0x14
TSExplicitList_CMapObjDefGroupMapObjDefLink linkList;
CAaBox bbox;
CAaSphere sphere;
float unk_4C; // 0x4C
uint32_t groupNum; // 0x50
uint32_t unkFlags; // 0x54
int32_t unk_58; // 0x58
uint32_t ambientColor; // 0x5C
int32_t unk_60; // 0x60
int32_t unk_64; // 0x64
int32_t unk_68; // 0x68
// CWFrustum
int32_t TSExplicitList__m_linkoffset_unk_6C; // 0x6C
void* TSExplicitList__m_ptr1_unk_70; // 0x70
void* TSExplicitList__m_ptr2_unk_74; // 0x74
TSExplicitList_CMapObjDefGroupDoodadDefLink doodadDefLinkList;
TSExplicitList_CMapObjDefGroupMapEntityLink mapEntityLinkList;
int32_t TSExplicitList__m_linkoffset_unk_90; // 0x90
void* TSExplicitList__m_ptr1_unk_94; // 0x94
void* TSExplicitList__m_ptr2_unk_98; // 0x98
int32_t TSExplicitList__m_linkoffset_unk_9C; // 0x9C
void* TSExplicitList__m_ptr1_unk_A0; // 0xA0
void* TSExplicitList__m_ptr2_unk_A4; // 0xA4
int32_t unk_A8; // 0xA8
int32_t unk_AC; // 0xAC
int32_t unk_B0; // 0xB0
int32_t unk_B4; // 0xB4
int32_t unk_B8; // 0xB8
int32_t unk_BC; // 0xBC
};
STORM_TS_LIST(CMapObjDefMapChunkLink);
struct CMapObjDefMapChunkLink {
uint32_t objectIndex; // 0x00
CMapObjDef* owner; // 0x04
CMapChunk* ref; // 0x08
TSLink_CMapObjDefMapChunkLink refLink; // 0x0C - 0x14
TSLink_CMapObjDefMapChunkLink ownerLink; // 0x14 - 0x1C
};
struct CMapObjDef {
void** vtable; // 0x00
int32_t objectIndex; // 0x04
uint16_t type; // 0x08
uint16_t refCount; // 0x0A
int32_t unk_C; // 0x0C
CMapObjDef* prev; // 0x10
CMapObjDef* next; // 0x14
TSExplicitList_CMapObjDefMapChunkLink linkList;
void* unk_24; // 0x24
void* unk_28; // 0x28
void* unk_2C; // 0x2C
void* unk_30; // 0x30
void* unk_34; // 0x34
int32_t unk_38; // 0x38
C3Vector position;
CAaBox bbox;
CAaSphere sphere;
C44Matrix mat;
C44Matrix invMat;
int32_t unk_F0; // 0xF0
CMapObj* owner; // 0xF4
int32_t unk_F8; // 0xF8
uint32_t unkFlags; // 0xFC
int32_t unk_100; // 0x100
int32_t unk_104; // 0x104
int32_t unk_108; // 0x108
int32_t unk_10C; // 0x10C
int32_t unk_110; // 0x110
TSExplicitList_CMapObjDefMapObjDefGroupLink mapObjDefGroupLinkList;
TSGrowableArray_CMapObjDefGroup defGroups;
void* unk_130; // 0x130
int32_t TSGrowableArray__m_alloc; // 0x134
int32_t TSGrowableArray__m_count; // 0x138
void* TSGrowableArray__m_data; // 0x13C
int32_t TSGrowableArray__m_chunk; // 0x140
uint32_t argbColor; // 0x144
int32_t unk_148; // 0x148
int32_t unk_14C; // 0x14C
int32_t unk_150; // 0x150
void* unk_154; // 0x154
};
#endif

View file

@ -0,0 +1,53 @@
#ifndef MAP_MAP_RENDER_CHUNK_H
#define MAP_MAP_RENDER_CHUNK_H
DECLARE_STRUCT(CMapRenderChunkLayer);
DECLARE_STRUCT(CMapRenderChunk);
#include "gx/buffer.h"
#include "map/mapchunk.h"
#include "system/types.h"
#include "tempest/vector.h"
#include "texture/texture.h"
struct CMapRenderChunkLayer {
int16_t flags;
int16_t layerIndex;
CTexture* texture;
int32_t unkIndex;
int32_t unkValue;
CMapRenderChunk* owner;
};
struct CMapRenderChunk {
CMapRenderChunk* renderChunkPtr1;
CMapRenderChunk* renderChunkPtr2;
uint8_t unkFlags;
uint8_t layersCount;
int16_t unk_0A;
int32_t unk_0C;
CMapChunk* mapChunkPtr1;
CMapChunk* mapChunkPtr2;
C3Vector vec1;
C3Vector vec2;
float radius;
CMapRenderChunkLayer layers[4];
CTexture* terrainBlendTexture;
CTexture* shadowTexture;
CGxBuf* vertexBuf;
CGxBuf* indicesBuf;
int32_t unk_94;
int32_t unk_98;
int16_t unk_9C;
int16_t unk_9E;
int32_t unk_A0;
int32_t unk_A4;
};
#endif

View file

@ -0,0 +1,52 @@
#ifndef MAP_MAP_STATIC_ENTITY_H
#define MAP_MAP_STATIC_ENTITY_H
DECLARE_STRUCT(CMapStaticEntityMapChunkLink);
DECLARE_STRUCT(CMapStaticEntity);
#include "m2/model.h"
#include "map/mapbaseobj.h"
#include "storm/list.h"
#include "system/types.h"
#include "tempest/box.h"
#include "tempest/sphere.h"
#include "tempest/vector.h"
STORM_TS_LIST(CMapStaticEntityMapChunkLink);
struct CMapStaticEntityMapChunkLink {
uint32_t objectIndex; // 0x00
CMapStaticEntity* owner; // 0x04
void* ref; // 0x08 //could be CMapChunk* or CMapObjDefGroup*
TSLink_CMapStaticEntityMapChunkLink refLink; // 0x0C - 0x14
TSLink_CMapStaticEntityMapChunkLink ownerLink; // 0x14 - 0x1C
};
struct CMapStaticEntity {
void** vtable; // 0x00
int32_t objectIndex; // 0x04
uint16_t type; // 0x08
uint16_t refCount; // 0x0A
int32_t unk_C; // 0x0C
CMapStaticEntity* prev; // 0x10
CMapStaticEntity* next; // 0x14
TSExplicitList_CMapStaticEntityMapChunkLink linkList;
int32_t unk_024; // 0x24
uint32_t unkFlags_28; // 0x28
int32_t unkCounter; // 0x2C
float unk_030; // 0x30
CM2Model* model;
CAaSphere sphere;
CAaBox bbox;
C3Vector vec2;
C3Vector position;
float scale; // 0x78
int32_t unk_07C; // 0x7C
int32_t unk_080; // 0x80
CImVector m2AmbietColor; // 0x84
CImVector m2DiffuseColor; // 0x88
float unk_08C; // 0x8C
};
#endif

View file

@ -0,0 +1,26 @@
#ifndef MAP_PARTICULATE_H
#define MAP_PARTICULATE_H
DECLARE_STRUCT(Particulate);
#include "map/liquidparticle.h"
#include "texture/texture.h"
struct Particulate {
LiquidParticle particles[4000];
uint32_t maxParticles;
C3Vector prevCameraPos;
CTexture* texture;
uint8_t unk_byte;
uint8_t padding[3];
float particleSize;
float spawnAreaSize;
float unk_float1;
uint32_t unkValue; // liquid type of particle type
C3Vector direction;
float speed;
float timer;
float rotationSpeed;
};
#endif

View file

@ -0,0 +1,41 @@
#ifndef MAP_VBB_LIST_H
#define MAP_VBB_LIST_H
DECLARE_STRUCT(VBBList);
DECLARE_STRUCT(VBBList_Block);
#include "gx/buffer.h"
#include "system/types.h"
struct VBBList_Block {
VBBList_Block* next;
VBBList_Block* prev;
EGxPoolUsage poolUsage;
uint32_t offset;
uint32_t capacity;
CGxPool* pool;
CGxBuf* buffer;
VBBList_Block** listHead;
};
struct VBBList {
int32_t singlePool;
EGxPoolTarget target;
EGxPoolUsage usage;
CGxPool* pool;
uint32_t unk_10;
// singlePool == true
VBBList_Block* listHeadA;
VBBList_Block* freeCandidate;
uint32_t unk_1C;
// singlePool == false
VBBList_Block* listHeadB;
VBBList_Block* allBlocks;
};
#endif

View file

@ -0,0 +1,332 @@
#ifndef MAP_WEATHER_H
#define MAP_WEATHER_H
DECLARE_STRUCT(Weather);
DECLARE_STRUCT(Mists);
DECLARE_STRUCT(Rain);
DECLARE_STRUCT(Snow);
DECLARE_STRUCT(Sand);
DECLARE_STRUCT(PacketList_Packet_RainDrop);
DECLARE_STRUCT(Packet_RainDrop);
DECLARE_STRUCT(RainDropParticle);
DECLARE_STRUCT(RainParticleBuffer);
DECLARE_STRUCT(PacketList_Packet_RainPatter);
DECLARE_STRUCT(Packet_RainPatter);
DECLARE_STRUCT(RainPatterParticle);
DECLARE_STRUCT(RainPatterParticleBuffer);
DECLARE_STRUCT(PacketList_Packet_SnowFlake);
DECLARE_STRUCT(Packet_SnowFlake);
DECLARE_STRUCT(SnowFlakeParticle);
DECLARE_STRUCT(SnowFlakeParticleBuffer);
DECLARE_STRUCT(PacketList_Packet_SandGrain);
DECLARE_STRUCT(Packet_SandGrain);
DECLARE_STRUCT(SandGrainParticle);
DECLARE_STRUCT(SandGrainParticleBuffer);
#include "gx/buffer.h"
#include "gx/shader.h"
#include "system/types.h"
#include "tempest/box.h"
#include "tempest/vector.h"
#include "texture/texture.h"
struct Mists {
void** vtable;
C3Vector position;
uint32_t unk_10;
uint32_t unk_14;
uint32_t unk_18;
float scale;
uint32_t unk_20;
float rotationSpeed;
float fadeSpeed;
uint32_t unk_2C;
float opacity;
float lifeTime;
float spawnRate;
uint8_t unk_3C;
uint8_t padding[3];
CTexture* mistTexture;
uint32_t particleCount;
uint32_t unk_48;
uint32_t unk_4C;
uint32_t unk_50;
};
struct SandGrainParticle {
C3Vector position;
C3Vector velocity;
float lifetime;
float size;
};
struct SandGrainParticleBuffer {
uint32_t particleCount;
SandGrainParticle particles[6144];
};
struct Packet_SandGrain {
Packet_SandGrain* prev;
Packet_SandGrain* next;
SandGrainParticleBuffer particlesBuffer;
uint32_t currParticle;
uint32_t packetStartTick;
uint32_t packetEndTick;
float packetBuildTime;
uint32_t field_C007;
uint32_t field_C008;
uint32_t field_C009;
CGxPool* gxPool;
CGxBuf* vertexBufHandle;
};
struct PacketList_Packet_SandGrain {
int32_t unk_00;
Packet_SandGrain* prev;
Packet_SandGrain* next;
int32_t activePacketsCount;
int32_t freePacketsCount;
int32_t unk_14;
Packet_SandGrain* unk_18;
Packet_SandGrain* unk_1C;
};
struct Sand {
int32_t useWeatherShaders;
CAaBox bbox;
Mists mists;
PacketList_Packet_SandGrain sandGrainPacketList;
Packet_SandGrain* sandGrainPacketPtr;
float unk_94;
CGxShader* shader;
float unk_9C;
};
struct SnowFlakeParticle {
C3Vector position;
C3Vector velocity;
float lifetime;
float size;
};
struct SnowFlakeParticleBuffer {
uint32_t particleCount;
SnowFlakeParticle particles[6144];
};
struct Packet_SnowFlake {
Packet_SnowFlake* prev;
Packet_SnowFlake* next;
SnowFlakeParticleBuffer particlesBuffer;
uint32_t currParticle;
uint32_t packetStartTick;
uint32_t packetEndTick;
float packetBuildTime;
uint32_t field_C007;
uint32_t field_C008;
uint32_t field_C009;
CGxPool* gxPool;
CGxBuf* vertexBufHandle;
};
struct PacketList_Packet_SnowFlake {
int32_t unk_00;
Packet_SnowFlake* prev;
Packet_SnowFlake* next;
int32_t activePacketsCount;
int32_t freePacketsCount;
int32_t unk_14;
Packet_SnowFlake* unk_18;
Packet_SnowFlake* unk_1C;
};
struct Snow {
int32_t useWeatherShaders;
CAaBox bbox;
Mists mists;
// PacketList_Packet_SnowFlake snowFlakePacketList;
int32_t unk_70;
void* unk_74;
void* unk_78;
int32_t activePacketsCount;
int32_t freePacketsCount;
int32_t unk_84;
void* unk_88;
void* unk_8C;
// end
Packet_SnowFlake* snowFlakePacketPtr;
float unk_94;
CTexture* snowFlakeTex;
CGxShader* shaderPtr;
int32_t unk_A0;
int32_t unk_A4;
};
struct RainPatterParticle {
C3Vector position;
float lifetime;
float size;
float unk;
};
struct RainPatterParticleBuffer {
uint32_t particleCount;
RainPatterParticle particles[6144];
};
struct Packet_RainPatter {
Packet_RainPatter* prev;
Packet_RainPatter* next;
RainPatterParticleBuffer particlesBuffer;
uint32_t currParticle;
uint32_t packetStartTick;
uint32_t packetEndTick;
float packetBuildTime;
uint32_t field_9007;
uint32_t field_9008;
uint32_t field_9009;
CGxPool* gxPool;
CGxBuf* vertexBufHandle;
};
struct PacketList_Packet_RainPatter {
int32_t unk_00;
Packet_RainPatter* prev;
Packet_RainPatter* next;
int32_t activePacketsCount;
int32_t freePacketsCount;
int32_t unk_14;
Packet_RainPatter* unk_18;
Packet_RainPatter* unk_1C;
};
struct RainDropParticle {
C3Vector position;
C3Vector velocity;
CImVector color;
float size;
float unk;
};
struct RainParticleBuffer {
uint32_t particleCount;
RainDropParticle particles[6144];
};
struct Packet_RainDrop {
Packet_RainDrop* prev;
Packet_RainDrop* next;
RainParticleBuffer particlesBuffer;
uint32_t currParticle;
uint32_t packetStartTick;
uint32_t packetEndTick;
float packetBuildTime;
uint32_t field_D807;
uint32_t field_D808;
uint32_t field_D809;
CGxPool* gxPool;
CGxBuf* vertexBufHandle;
};
struct PacketList_Packet_RainDrop {
int32_t unk_00;
Packet_RainDrop* prev;
Packet_RainDrop* next;
int32_t activePacketsCount;
int32_t freePacketsCount;
int32_t unk_14;
Packet_RainDrop* unk_18;
Packet_RainDrop* unk_1C;
};
struct Rain {
int32_t useWeatherShaders;
CAaBox bbox;
Mists mists;
PacketList_Packet_RainDrop rainDropPacketList;
PacketList_Packet_RainPatter rainPatterPacketList;
Packet_RainDrop* rainDropPacketPtr;
float unk_B4; // particle lifetime?
Packet_RainPatter* rainPatterPacketPtr;
CTexture* rainDropTex;
CGxShader* shaderRain;
CTexture* rainDropSplashTex;
CGxShader* shaderPatter;
float particlesPerFrame;
float intensity;
};
struct Weather {
float intensity;
float lastIntensity;
float currStormItensity;
float targetSkyDark;
float startSkyDark;
float currSkyDark;
uint32_t weatherStartMs;
uint32_t weatherStartMs2;
uint32_t weatherType;
uint32_t abrupt;
float transitionSkyBox;
float transitionSkyBoxNotAbrupt;
float transitionSkyBoxNoWeather;
CImVector color;
char texturePath[260];
Rain* rain;
Snow* snow;
Sand* sand;
void* unkObject;
int32_t unk_14C;
void* unk_ptr_150;
void* unk_ptr_154;
int32_t unk_158;
void* unk_ptr_15C;
void* unk_ptr_160;
C3Vector velocity;
C3Vector unkVec;
C3Vector playerPos;
int32_t unk_188;
float facingAngle;
float moveSpeed;
int32_t unk_194;
};
#endif

View file

@ -0,0 +1,226 @@
#ifndef MAP_WMO_CHUNKS_H
#define MAP_WMO_CHUNKS_H
#include "tempest/box.h"
#include "tempest/plane.h"
#include "tempest/quaternion.h"
DECLARE_STRUCT(SMOHeader);
DECLARE_STRUCT(SMOGroupInfo);
DECLARE_STRUCT(SMOPortal);
DECLARE_STRUCT(SMOPortalRef);
DECLARE_STRUCT(SMOVisibleBlock);
DECLARE_STRUCT(SMOLight);
DECLARE_STRUCT(SMODoodadSet);
DECLARE_STRUCT(SMODoodadDef);
DECLARE_STRUCT(SMOFog);
DECLARE_STRUCT(SMOMaterial);
DECLARE_STRUCT(SMOPoly);
DECLARE_STRUCT(SMOBatch);
DECLARE_STRUCT(SMOLiquidVert);
DECLARE_STRUCT(SMOLTile);
DECLARE_STRUCT(SMOWVert);
DECLARE_STRUCT(SMOMVert);
struct SMOHeader {
uint32_t nTextures;
uint32_t nGroups;
uint32_t nPortals;
uint32_t nLights;
uint32_t nDoodadNames;
uint32_t nDoodadDefs;
uint32_t nDoodadSets;
uint32_t ambColor;
uint32_t wmoID;
CAaBox bounding_box;
#if defined(BITFIELDS_SUPPORTED)
uint16_t flag_do_not_attenuate_vertices_based_on_distance_to_portal : 1;
uint16_t flag_use_unified_render_path : 1;
uint16_t flag_use_liquid_type_dbc_id : 1;
uint16_t flag_do_not_fix_vertex_color_alpha : 1;
uint16_t flag_lod : 1;
uint16_t flag_default_max_lod : 1;
uint16_t : 10;
#else
uint16_t flags;
#endif
uint16_t numLod;
};
struct SMOGroupInfo {
uint32_t flags;
CAaBox bbox;
uint32_t nameOffset;
};
struct SMOPortal {
uint16_t startVertex;
uint16_t count;
C4Plane plane;
};
struct SMOPortalRef {
uint16_t portalIndex;
uint16_t groupIndex;
int16_t side;
uint16_t filler;
};
struct SMOVisibleBlock {
uint16_t firstVertex;
uint16_t count;
};
struct SMOLight {
uint8_t type;
uint8_t atten;
uint8_t pad[2];
CImVector color;
C3Vector position;
float intensity;
C4Quaternion rotation;
float attenStart;
float attenEnd;
};
struct SMODoodadSet {
char name[0x14];
uint32_t startIdx;
uint32_t count;
uint32_t pad;
};
struct SMODoodadDef {
#if defined(BITFIELDS_SUPPORTED)
uint32_t nameIndex : 24;
uint32_t flag_AcceptProjTex : 1;
uint32_t flag_0x2 : 1;
uint32_t flag_0x4 : 1;
uint32_t flag_0x8 : 1;
uint32_t unk : 4;
#else
uint32_t flags;
#endif
C3Vector position;
C4Quaternion orientation;
float scale;
CImVector color;
};
struct SMOFog {
#if defined(BITFIELDS_SUPPORTED)
uint32_t flag_infinite_radius : 1;
uint32_t : 3;
uint32_t flag_0x10 : 1;
uint32_t : 27;
#else
uint32_t flags;
#endif
C3Vector position;
float smallerRadius;
float largerRadius;
float fogEnd;
float fogStartScalar;
CImVector fogColor;
// under water
float uwFogEnd;
float uwFogStartScalar;
CImVector uwFogColor;
};
struct SMOMaterial {
/*uint32_t F_UNLIT : 1;
uint32_t F_UNFOGGED : 1;
uint32_t F_UNCULLED : 1;
uint32_t F_EXTLIGHT : 1;
uint32_t F_SIDN : 1;
uint32_t F_WINDOW : 1;
uint32_t F_CLAMP_S : 1;
uint32_t F_CLAMP_T : 1;
uint32_t flag_0x100 : 1;
uint32_t : 23;*/
uint32_t flags;
uint32_t shader;
uint32_t blendMode;
uint32_t texture1;
CImVector sidnColor;
CImVector frameSidnColor;
uint32_t texture2;
CImVector diffColor;
uint32_t groundType;
uint32_t texture3;
uint32_t color2;
uint32_t flags2;
uint32_t runTimeData[4];
};
struct SMOPoly {
/*uint8_t F_UNK_0x01: 1;
uint8_t F_NOCAMCOLLIDE : 1;
uint8_t F_DETAIL : 1;
uint8_t F_COLLISION : 1;
uint8_t F_HINT : 1;
uint8_t F_RENDER : 1;
uint8_t F_CULL_OBJECTS : 1;
uint8_t F_COLLIDE_HIT : 1;*/
uint8_t flags;
uint8_t materialId;
};
struct SMOBatch {
int8_t unused[12];
uint32_t indexStart;
uint16_t indexCount;
uint16_t vertexStart;
uint16_t vertexEnd;
uint8_t flags;
uint8_t texture;
};
struct SMOWVert {
uint8_t flow1;
uint8_t flow2;
uint8_t flow1Pct;
uint8_t filler;
float height;
};
struct SMOMVert {
int16_t s;
int16_t t;
float height;
};
struct SMOLiquidVert {
union {
SMOWVert waterVert;
SMOMVert magmaVert;
};
};
struct SMOLTile {
#if defined(BITFIELDS_SUPPORTED)
uint8_t legacyLiquidType : 4;
uint8_t unknown1 : 1;
uint8_t unknown2 : 1;
uint8_t fishable : 1;
uint8_t shared : 1;
#else
uint8_t flags;
#endif
};
#endif