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

Revision 2, 1.7 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 ADT_H
2#define ADT_H
3
4#include "mpq.h"
5#include "wmo.h"
6#include "model.h"
7
8#define __STORMLIB_SELF__
9
10#define TILESIZE (533.33333f)
11#define CHUNKSIZE ((TILESIZE) / 16.0f)
12#define UNITSIZE (CHUNKSIZE / 8.0f)
13
14typedef unsigned char uint8;
15typedef unsigned short uint16;
16typedef unsigned int uint32;
17
18class Liquid;
19
20typedef struct {
21float x;
22float y;
23float z;
24}svec;
25
26typedef struct {
27double x;
28double y;
29double z;
30}vec;
31
32typedef struct{
33        vec v[3];
34
35}triangle;     
36
37typedef struct{
38float v9[16*8+1][16*8+1];
39float v8[16*8][16*8];
40}Cell;
41
42typedef struct{
43double v9[9][9];
44double v8[8][8];
45uint16 area_id;
46//Liquid *lq;
47float waterlevel[9][9];
48uint8 flag;
49}chunk;
50
51typedef struct
52{
53chunk ch[16][16];
54}mcell;
55
56struct 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;
90};
91
92
93class ADTFile
94{
95public:
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();
104
105        //uint32 wmo_count;
106/*
107        const mcell& Getmcell() const
108        {
109                return Mcell;
110        }
111*/
112private:
113        //size_t mcnk_offsets[256], mcnk_sizes[256];
114        MPQFile ADT;
115        //mcell Mcell;
116        string Adtfilename;
117};
118
119void fixnamen(char *name, size_t len);
120//void fixMapNamen(char *name, size_t len);
121
122
123#endif
124
Note: See TracBrowser for help on using the browser.