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 | |
---|
14 | typedef unsigned char uint8; |
---|
15 | typedef unsigned short uint16; |
---|
16 | typedef unsigned int uint32; |
---|
17 | |
---|
18 | class Liquid; |
---|
19 | |
---|
20 | typedef struct { |
---|
21 | float x; |
---|
22 | float y; |
---|
23 | float z; |
---|
24 | }svec; |
---|
25 | |
---|
26 | typedef struct { |
---|
27 | double x; |
---|
28 | double y; |
---|
29 | double z; |
---|
30 | }vec; |
---|
31 | |
---|
32 | typedef struct{ |
---|
33 | vec v[3]; |
---|
34 | |
---|
35 | }triangle; |
---|
36 | |
---|
37 | typedef struct{ |
---|
38 | float v9[16*8+1][16*8+1]; |
---|
39 | float v8[16*8][16*8]; |
---|
40 | }Cell; |
---|
41 | |
---|
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; |
---|
50 | |
---|
51 | typedef struct |
---|
52 | { |
---|
53 | chunk ch[16][16]; |
---|
54 | }mcell; |
---|
55 | |
---|
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; |
---|
90 | }; |
---|
91 | |
---|
92 | |
---|
93 | class ADTFile |
---|
94 | { |
---|
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(); |
---|
104 | |
---|
105 | //uint32 wmo_count; |
---|
106 | /* |
---|
107 | const mcell& Getmcell() const |
---|
108 | { |
---|
109 | return Mcell; |
---|
110 | } |
---|
111 | */ |
---|
112 | private: |
---|
113 | //size_t mcnk_offsets[256], mcnk_sizes[256]; |
---|
114 | MPQFile ADT; |
---|
115 | //mcell Mcell; |
---|
116 | string Adtfilename; |
---|
117 | }; |
---|
118 | |
---|
119 | void fixnamen(char *name, size_t len); |
---|
120 | //void fixMapNamen(char *name, size_t len); |
---|
121 | |
---|
122 | |
---|
123 | #endif |
---|
124 | |
---|