root/trunk/contrib/vmap_extractor_v2/vmapextract/wmo.h

Revision 2, 1.8 kB (checked in by yumileroy, 17 years ago)

[svn] * Proper SVN structure

Original author: Neo2003
Date: 2008-10-02 16:23:55-05:00

Line 
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
14class WMOInstance;
15class WMOManager;
16
17typedef unsigned char uint8;
18typedef unsigned short uint16;
19typedef unsigned int uint32;
20
21
22class WMORoot
23{
24public:
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);
35private:
36        std::string filename;
37        char outfilename;
38
39};
40
41class WMOGroup
42{
43public:
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
74private:
75        std::string filename;
76        char outfilename;
77
78};
79
80struct 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
89class WMOInstance
90{
91        static std::set<int> ids;
92public:
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
Note: See TracBrowser for help on using the browser.