WDT: Difference between revisions
Line 141: | Line 141: | ||
} mslt[]; | } mslt[]; | ||
===MTEX (Legion+)=== | ===MTEX (Legion+)=== | ||
uint32_t textureFileDataIds[]; | |||
[[Category:Format]] | [[Category:Format]] |
Revision as of 05:06, 22 November 2015
WDT files specify exactly which map tiles are present in a world, if any, and can also reference a "global" WMO. They have a chunked file structure.
MPHD chunk
Contains 8 32-bit integers.
uint32 flags; uint32 something; uint32 unused[6];
These are the only flags checked:
Flag Description 0x01 Use global map object definition. 0x02 vertexBufferFormat = PNC. (adds color: ADT.MCNK.MCCV) 0x04 shader = 2. Decides whether to use _env terrain shaders or not: funky and if MCAL has 4096 instead of 2048(?) 0x08 Disables something. No idea what. Another rendering thing. Someone may check all them in wild life.. 0x10 vertexBufferFormat = PNC2. (adds second color: ADT.MCNK.MCLV) 0x20 Flips the ground display upside down to create a ceiling (Cataclysm) 0x40 ??? (???) 0x80 shader = 6. Decides whether to influence alpha maps by _h+MTXP: (without with) (MoP+) -- also changes MCAL size to 4096 for uncompressed entries 0x100 (Legion+) -- implicitly sets 0x8000 0x8000 (Legion+) -- implicitly set for map ids 0, 1, 571, 870, 1116 (continents)
See a list here.
The second integer is not ignored but stores something too:
for( int i = 0; i < WDT_MPHD.something/8; i++ ) { WDT_MAIN[i].flags = 0; WDT_MAIN[i].somedata = 0; }
The other bytes seem to be unused from what I can tell.
MAIN chunk
- Map tile table. Needs to contain 64x64 = 4096 entries of sizeof(SMAreaInfo) ( 8 ) bytes each.
struct SMAreaInfo // -> CMapAreaTableEntry { uint32 m_flags; void* m_area; // only set during runtime. };
- Flags:
- CMapAreaTableEntry::Flag_HasADT = 1,
- <cata: CMapAreaTableEntry::Flag_Loaded = 2,
- >=cata: CMapAreaTableEntry::Flag_AllWater = 2 // no idea which flag Loaded is, most likely 4.
On Cataclysm, 2 on a tile displays "fake water" ingame. If only one "fake water tile" is activated, "fake water" will appear everywhere you don't have an ADT loaded. (seen on 4.3.4.15595)
MWMO, MODF chunks
For worlds with terrain, parsing ends here. If it has none, there is one MWMO and one MODF chunk here. The MODF chunk is limited to one entry. See the ADT format description for details.
MWMO chunk
- A filename for one WMO (world map object) that appears in this map. A zero-terminated string. 0x100 is the maximum size for this chunk due to being copied into a stack allocated array (at least in MOP)! (including \0).
MODF chunk
- Placement information for the global WMO. 64 bytes. Only one instance is possible.
Offset Type Description 0x00 uint32 ID (index in the MWID list) 0x04 uint32 unique identifier for this instance 0x08 3 floats Position (X,Y,Z) 0x14 3 floats Orientation (A,B,C) 0x20 3 floats Upper Extents 0x2C 3 floats Lower Extents 0x38 uint16 Flags 0x3A uint16 Doodad set index 0x3C uint16 Name set? 0x3E uint16 Padding
struct SMMapObjDef // 03-29-2005 By ObscuR { /*000h*/ UINT32 nameId; /*004h*/ UINT32 uniqueId; /*008h*/ float pos[3]; /*00Ch*/ /*010h*/ /*014h*/ float rot[3]; /*018h*/ /*01Ch*/ /*020h*/ float extents[6]; /*024h*/ /*028h*/ /*02Ch*/ /*030h*/ /*034h*/ /*038h*/ UINT16 flags; /*03Ah*/ UINT16 doodadSetIndex; /*03Ch*/ UINT16 nameSet; /*03Eh*/ UINT16 pad; };
_occ, _lgt
WoD added _occ.wdt (occlusion) and _lgt.wdt (lights) for each .wdt. They are only used for adt-maps, not WMO-only ones.
occ
MAOI and MAOH might be zero size. (WMO-only WDTs)
MVER
struct { uint32_t version; // 18, just as all others } mver;
MAOI
struct { uint16_t tile_x; // MAOH entries are per ADT tile uint16_t tile_y; uint32_t offset; // in MAOH uint32_t size; // always (17*17+16*16)*2 } maoi[];
MAOH
unknown. blocks referenced from MAOI. Possibly shorts. either really huge or small values. possibly a 2d map for something.
short interleaved_map[17*17+16*16];
lgt
Might only have MVER for WMO-only WDTs.
MVER
struct { uint32_t version; // 18, just as all others } mver;
MPLT
struct { uint32 id; uint16 tile_x; uint16 tile_y; CArgb color; C3Vector position; float unknown[3]; // intensity, and stuff } mplt[];
MPL2 (Legion+)
- appears to be either, not both MPLT and MPL2, or they need to have the same size.
struct { char _[0x34]; } mpl2[];
MSLT (Legion+)
struct { char _[0x34]; } mslt[];
MTEX (Legion+)
uint32_t textureFileDataIds[];