[4057] added: Line of sight (vmaps) [part 2] (last part)
[mangos-git.git] / contrib / vmap_extractor_v2 / vmapextract / adtfile.h
blobd841452e893fd2acc3420527be57a6b442c085a6
1 #ifndef ADT_H
2 #define ADT_H
4 #include "mpq.h"
5 #include "wmo.h"
6 #include "model.h"
8 #define __STORMLIB_SELF__
10 #define TILESIZE (533.33333f)
11 #define CHUNKSIZE ((TILESIZE) / 16.0f)
12 #define UNITSIZE (CHUNKSIZE / 8.0f)
14 typedef unsigned char uint8;
15 typedef unsigned short uint16;
16 typedef unsigned int uint32;
18 class Liquid;
20 typedef struct {
21 float x;
22 float y;
23 float z;
24 }svec;
26 typedef struct {
27 double x;
28 double y;
29 double z;
30 }vec;
32 typedef struct{
33 vec v[3];
35 }triangle;
37 typedef struct{
38 float v9[16*8+1][16*8+1];
39 float v8[16*8][16*8];
40 }Cell;
42 typedef struct{
43 double v9[9][9];
44 double v8[8][8];
45 uint16 area_id;
46 //Liquid *lq;
47 float waterlevel[9][9];
48 uint8 flag;
49 }chunk;
51 typedef struct
53 chunk ch[16][16];
54 }mcell;
56 struct MapChunkHeader {
57 uint32 flags;
58 uint32 ix;
59 uint32 iy;
60 uint32 nLayers;
61 uint32 nDoodadRefs;
62 uint32 ofsHeight;
63 uint32 ofsNormal;
64 uint32 ofsLayer;
65 uint32 ofsRefs;
66 uint32 ofsAlpha;
67 uint32 sizeAlpha;
68 uint32 ofsShadow;
69 uint32 sizeShadow;
70 uint32 areaid;
71 uint32 nMapObjRefs;
72 uint32 holes;
73 uint16 s1;
74 uint16 s2;
75 uint32 d1;
76 uint32 d2;
77 uint32 d3;
78 uint32 predTex;
79 uint32 nEffectDoodad;
80 uint32 ofsSndEmitters;
81 uint32 nSndEmitters;
82 uint32 ofsLiquid;
83 uint32 sizeLiquid;
84 float zpos;
85 float xpos;
86 float ypos;
87 uint32 textureId;
88 uint32 props;
89 uint32 effectId;
93 class ADTFile
95 public:
96 ADTFile(char* filename);
97 ~ADTFile();
98 int nWMO;
99 int nMDX;
100 string* WmoInstansName;
101 string* ModelInstansName;
102 bool init(char *map_id);
103 //void LoadMapChunks();
105 //uint32 wmo_count;
107 const mcell& Getmcell() const
109 return Mcell;
112 private:
113 //size_t mcnk_offsets[256], mcnk_sizes[256];
114 MPQFile ADT;
115 //mcell Mcell;
116 string Adtfilename;
119 void fixnamen(char *name, size_t len);
120 //void fixMapNamen(char *name, size_t len);
123 #endif