Fixed some typos, updated areaflags enum
[getmangos.git] / contrib / extractor / adt.h
blob800be80a16cd9515dc0990bc3337735875f13056
1 #ifndef ADT_H
2 #define ADT_H
4 #define TILESIZE (533.33333f)
5 #define CHUNKSIZE ((TILESIZE) / 16.0f)
6 #define UNITSIZE (CHUNKSIZE / 8.0f)
8 typedef unsigned char uint8;
9 typedef unsigned short uint16;
10 typedef unsigned int uint32;
11 class Liquid;
12 typedef struct {
13 float x;
14 float y;
15 float z;
16 } svec;
18 typedef struct {
19 double x;
20 double y;
21 double z;
22 } vec;
24 typedef struct{
25 vec v[3];
26 } triangle;
28 typedef struct{
29 float v9[16*8+1][16*8+1];
30 float v8[16*8][16*8];
31 } Cell;
33 typedef struct{
34 double v9[9][9];
35 double v8[8][8];
36 uint16 area_id;
37 } chunk;
39 class WMO;
40 class WMOManager;
41 void fixname(std::string &name);
43 typedef struct
45 chunk ch[16][16];
46 } mcell;
48 struct MapChunkHeader {
49 uint32 flags;
50 uint32 ix;
51 uint32 iy;
52 uint32 nLayers;
53 uint32 nDoodadRefs;
54 uint32 ofsHeight;
55 uint32 ofsNormal;
56 uint32 ofsLayer;
57 uint32 ofsRefs;
58 uint32 ofsAlpha;
59 uint32 sizeAlpha;
60 uint32 ofsShadow;
61 uint32 sizeShadow;
62 uint32 areaid;
63 uint32 nMapObjRefs;
64 uint32 holes;
65 uint16 s1;
66 uint16 s2;
67 uint32 d1;
68 uint32 d2;
69 uint32 d3;
70 uint32 predTex;
71 uint32 nEffectDoodad;
72 uint32 ofsSndEmitters;
73 uint32 nSndEmitters;
74 uint32 ofsLiquid; // not use in WotLK
75 uint32 sizeLiquid; // not use in WotLK
76 float zpos;
77 float xpos;
78 float ypos;
79 uint32 textureId; // new offsColorValues in WotLK
80 uint32 props;
81 uint32 effectId;
84 typedef struct {
85 uint32 offsData1;
86 uint32 used;
87 uint32 offsData2;
88 } MH2O_offsData;
90 typedef struct {
91 uint16 flags;
92 uint16 type;
93 float heightLevel1;
94 float heightLevel2;
95 byte xOffset;
96 byte yOffset;
97 byte width;
98 byte height;
99 uint32 ofsData2a;
100 uint32 ofsData2b;
101 } MH2O_Data1;
103 class MPQFile;
105 bool MH2O_presence;
106 MH2O_offsData *LiqOffsData;
107 MH2O_Data1 *LiqChunkData1;
108 float *ChunkLiqHeight, *MapLiqHeight;
109 char* MapLiqFlag;
110 uint32 k, m, chunk_num;
111 void LoadMapChunk(MPQFile &, chunk*);
112 bool LoadWMO(char* filename);
113 #endif