MaNGOS 0.12 release.
[getmangos.git] / contrib / vmap_extractor_v2 / vmapextract / wmo.h
blobb8f6439e381774fff324a32574a59ef6bc681582
1 #ifndef WMO_H
2 #define WMO_H
3 #define __STORMLIB_SELF__
4 #define TILESIZE (533.33333f)
5 #define CHUNKSIZE ((TILESIZE) / 16.0f)
7 #include "Stormlib.h"
8 #include <string>
9 #include "vec3d.h"
10 #include <set>
11 #include "mpq.h"
14 class WMOInstance;
15 class WMOManager;
17 typedef unsigned char uint8;
18 typedef unsigned short uint16;
19 typedef unsigned int uint32;
22 class WMORoot
24 public:
25 int nTextures, nGroups, nP, nLights, nModels, nDoodads, nDoodadSets, RootID;
26 unsigned int col;
27 int bbcorn1[3];
28 int bbcorn2[3];
30 WMORoot(std::string &filename);
31 ~WMORoot();
33 bool open();
34 bool ConvertToVMAPRootWmo(FILE *output);
35 private:
36 std::string filename;
37 char outfilename;
41 class WMOGroup
43 public:
45 int offsize,flag,flag1,Xid,Xid2,Xid3,zero1,Xflag,nTexture,GroupID;
46 int mopy_size,moba_size,hlq_xverts,hlq_yverts;
47 int MopyEx_size,IndexExTr_size,LiquEx_size;
48 unsigned int nVertices; // number when loaded
49 int nTriangles; // number when loaded
50 int bbcorn1[3];
51 int bbcorn2[3];
52 int * IndexExTr;
53 char* MOPY;
54 char* MopyEx;
55 uint16* MOVI;
56 uint16* MoviEx;
57 uint16* MoviExSort;
58 float* MOVT;
59 float* MovtEx;
60 uint16* MovtExSort;
61 float* MONR;
62 float* MonrEx;
63 uint16* MOBA;
64 int* MobaEx;
65 float* LiquEx;
66 uint32 liquflags;
68 WMOGroup(std::string &filename);
69 ~WMOGroup();
71 bool open();
72 int ConvertToVMAPGroupWmo(FILE *output, bool pPreciseVectorData);
74 private:
75 std::string filename;
76 char outfilename;
80 struct WMOLiquidHeader
82 int xverts, yverts, xtiles, ytiles;
83 float pos_x;
84 float pos_y;
85 float pos_z;
86 short type;
89 class WMOInstance
91 static std::set<int> ids;
92 public:
93 string MapName;
94 int currx;
95 int curry;
96 WMOGroup *wmo;
97 Vec3D pos;
98 Vec3D pos2, pos3, rot;
99 int indx,id, d2, d3;
100 int doodadset;
102 WMOInstance(MPQFile &f,const char* WmoInstName,const char*MapName, FILE *pDirfile);
104 static void reset();
107 #endif