WDT: Difference between revisions

From wowdev
Jump to navigation Jump to search
(→‎MAIN chunk: On Cataclysm, 2 on a tile displays "fake water" ingame.)
(→‎MPHD chunk: flag 0x10)
Line 12: Line 12:
  0x04 Decides whether to use _env terrain shaders or not: [http://imagr.eu/upload/66886112164390_WoWScrnShot_022809_122447.jpg funky] and if MCAL has 4096 instead of 2048(?)
  0x04 Decides whether to use _env terrain shaders or not: [http://imagr.eu/upload/66886112164390_WoWScrnShot_022809_122447.jpg 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..
  0x08 Disables something. No idea what. Another rendering thing. Someone may check all them in wild life..
  0x10 if( flags & 0x02 && CMap::enableTerrainShaderVertex ) CMapRenderChunk::SetVertexFormat( 16 ); // cataclysm?
  0x10 if( flags & 0x02 && CMap::enableTerrainShaderVertex ) CMapRenderChunk::SetVertexFormat( 16 ); -- Cataclysm : Use vertex lighting (ADT.MCNK.MCLV)
  0x20 Flips the ground display upside down to create a ceiling (Cataclysm)
  0x20 Flips the ground display upside down to create a ceiling (Cataclysm)



Revision as of 23:23, 4 February 2012

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		CMapRenderChunk::SetVertexFormat( 2 ); (else: 1) -- Use vertex shading (ADT.MCNK.MCCV)
0x04 		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		if( flags & 0x02 && CMap::enableTerrainShaderVertex ) CMapRenderChunk::SetVertexFormat( 16 );  -- Cataclysm : Use vertex lighting (ADT.MCNK.MCLV)
0x20 		Flips the ground display upside down to create a ceiling (Cataclysm)

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,
    • CMapAreaTableEntry::Flag_Loaded = 2,

On Cataclysm, 2 on a tile displays "fake water" ingame.

Blizzard was just too lazy to compress the files here. A simple bool array and adding the fields when parsing would the alternative. We just need to know the &1 flag.

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. Only one is possible!

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; 
};