1 | #ifndef WMO_H |
---|
2 | #define WMO_H |
---|
3 | #define __STORMLIB_SELF__ |
---|
4 | #define TILESIZE (533.33333f) |
---|
5 | #define CHUNKSIZE ((TILESIZE) / 16.0f) |
---|
6 | |
---|
7 | #include "Stormlib.h" |
---|
8 | #include <string> |
---|
9 | #include "vec3d.h" |
---|
10 | #include <set> |
---|
11 | #include "mpq.h" |
---|
12 | |
---|
13 | |
---|
14 | class WMOInstance; |
---|
15 | class WMOManager; |
---|
16 | |
---|
17 | typedef unsigned char uint8; |
---|
18 | typedef unsigned short uint16; |
---|
19 | typedef unsigned int uint32; |
---|
20 | |
---|
21 | |
---|
22 | class WMORoot |
---|
23 | { |
---|
24 | public: |
---|
25 | int nTextures, nGroups, nP, nLights, nModels, nDoodads, nDoodadSets, RootID; |
---|
26 | unsigned int col; |
---|
27 | int bbcorn1[3]; |
---|
28 | int bbcorn2[3]; |
---|
29 | |
---|
30 | WMORoot(std::string &filename); |
---|
31 | ~WMORoot(); |
---|
32 | |
---|
33 | bool open(); |
---|
34 | bool ConvertToVMAPRootWmo(FILE *output); |
---|
35 | private: |
---|
36 | std::string filename; |
---|
37 | char outfilename; |
---|
38 | |
---|
39 | }; |
---|
40 | |
---|
41 | class WMOGroup |
---|
42 | { |
---|
43 | public: |
---|
44 | |
---|
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; |
---|
67 | |
---|
68 | WMOGroup(std::string &filename); |
---|
69 | ~WMOGroup(); |
---|
70 | |
---|
71 | bool open(); |
---|
72 | int ConvertToVMAPGroupWmo(FILE *output, bool pPreciseVectorData); |
---|
73 | |
---|
74 | private: |
---|
75 | std::string filename; |
---|
76 | char outfilename; |
---|
77 | |
---|
78 | }; |
---|
79 | |
---|
80 | struct WMOLiquidHeader |
---|
81 | { |
---|
82 | int xverts, yverts, xtiles, ytiles; |
---|
83 | float pos_x; |
---|
84 | float pos_y; |
---|
85 | float pos_z; |
---|
86 | short type; |
---|
87 | }; |
---|
88 | |
---|
89 | class WMOInstance |
---|
90 | { |
---|
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; |
---|
101 | |
---|
102 | WMOInstance(MPQFile &f,const char* WmoInstName,const char*MapName, FILE *pDirfile); |
---|
103 | |
---|
104 | static void reset(); |
---|
105 | }; |
---|
106 | |
---|
107 | #endif |
---|