Pol  Revision:cb584c9
ustruct.h
Go to the documentation of this file.
1 
7 #ifndef __USTRUCT_H
8 #define __USTRUCT_H
9 
10 #include "../clib/rawtypes.h"
11 
12 namespace Pol
13 {
14 namespace Core
15 {
16 #pragma pack( push, 1 )
17 
19 {
25 };
26 static_assert( sizeof( USTRUCT_VERSION ) == 20, "size missmatch" );
27 
29 {
33  s8 z;
35 };
36 static_assert( sizeof( USTRUCT_STATIC ) == 7, "size missmatch" );
37 
39 {
43 };
44 static_assert( sizeof( USTRUCT_IDX ) == 12, "size missmatch" );
45 
46 const unsigned STAIDX_CHUNK = 8;
47 
49 {
61  char name[20];
62 
63  enum
64  {
65  FLAG_FLOOR = 0x00000001,
66  FLAG_WEAPON = 0x00000002,
67  FLAG_TRANSPARENT = 0x00000004,
68  FLAG_TRANSLUCENT = 0x00000008,
69  FLAG_WALL = 0x00000010,
70  FLAG__DAMAGING = 0x00000020,
71  FLAG_BLOCKING = 0x00000040,
72  FLAG_LIQUID = 0x00000080,
73  // 0x00000100
74  FLAG_PLATFORM = 0x00000200,
75  FLAG_HALF_HEIGHT = 0x00000400,
76  FLAG_STACKABLE = 0x00000800,
77  FLAG_WINDOW = 0x00001000,
78  FLAG_NO_SHOOT = 0x00002000,
79  FLAG_DESC_NEEDS_A = 0x00004000,
80  FLAG_DESC_NEEDS_AN = 0x00008000,
81  FLAG__DESCRIPTIONAL = 0x00010000,
82  FLAG__TRANSPARENT = 0x00020000,
83  // 0x00040000
84  // 0x00080000
85  FLAG__MAP = 0x00100000,
86  FLAG__CONTAINER = 0x00200000,
87  FLAG_EQUIPPABLE = 0x00400000,
88  FLAG__LIGHTSOURCE = 0x00800000,
89  FLAG_ANIMATED = 0x01000000,
90  FLAG_HOVEROVER = 0x02000000,
91  FLAG__WALK = 0x04000000,
92  FLAG__WHOLE_BODY = 0x08000000,
93  FLAG_ROOF = 0x10000000,
94  FLAG_DOOR = 0x20000000,
95  // 0x40000000
96  // 0x80000000
97  FLAG_WALKBLOCK = FLAG_BLOCKING | FLAG_PLATFORM | FLAG_HALF_HEIGHT,
98  FLAG_PASSABLE_WATER = FLAG_FLOOR | FLAG_LIQUID
99  };
100 };
101 static_assert( sizeof( USTRUCT_TILE ) == 37, "size missmatch" );
102 
104 {
117  char name[20];
118 };
119 static_assert( sizeof( USTRUCT_TILE_HSA ) == 41, "size missmatch" );
120 /* notes:
121  flag1:
122  bit 0x80: liquid? wet? (blood, water, water troughs, swamp,
123  bit 0x40: block? (tileblock)
124  bit 0x20: damaging?. palisade, bees, muck, cactus, lava, fire, spell fields, brambles, campfire,
125  forged metal
126  bit 0x10: unknown.
127  bit 0x08: unknown.
128  bit 0x04:
129  bit 0x02:
130  bit 0x01: floor?
131  */
132 /*
133  flag2:
134  bit 0x80: should be preceded by 'an ' in description
135  bit 0x40: should be preceded by 'a ' in description
136  bit 0x20: unknown
137  bit 0x10: unknown. windows, arches, arrow loops, curtains, barred metal doors.
138  bit 0x08: stackable bit? (not sure)
139  bit 0x04: divide height by 2 (ladders/stairs?)
140  bit 0x02: unknown
141  bit 0x01: nothing has this set!
142  */
143 //#define UOTILE_FLAG2_HALF_HEIGHT 0x4
144 /*
145  flag3:
146  bit 0x80: lightsource?
147  bit 0x40: equippable?
148  bit 0x20: container?
149  bit 0x10: map?
150  bit 0x08:
151  bit 0x04:
152  bit 0x02: transparent?
153  bit 0x01: descriptional?
154  flag4:
155  bit 0x80:
156  bit 0x40:
157  bit 0x20: door?
158  bit 0x10:
159  bit 0x08: whole-body item?
160  bit 0x04: walk? (tilewalk)
161  bit 0x02:
162  bit 0x01:
163  weight: 255 is unmoveable
164  */
165 
166 //#define UOBJ_FLAG2_DESC_NEEDS_AN 0x80
167 //#define UOBJ_FLAG2_DESC_NEEDS_A 0x40
168 
170 {
172  u16 unk; // texid
173  char name[20];
174 };
175 
177 {
180  u16 unk; // texid
181  char name[20];
182 };
183 
185 {
187 };
188 
190 {
196 };
197 static_assert( sizeof( USTRUCT_MULTI_ELEMENT ) == 12, "size missmatch" );
198 
200 {
207 };
208 static_assert( sizeof( USTRUCT_MULTI_ELEMENT_HSA ) == 16, "size missmatch" );
209 
211 {
213  s8 z;
214 
215  enum
216  {
217  WATER__LOWEST = 0xA8,
218  WATER__HIGHEST = 0xAB
219  };
220 };
221 static_assert( sizeof( USTRUCT_MAPINFO ) == 3, "size missmatch" );
222 
224 {
225  unsigned int hdr;
226  USTRUCT_MAPINFO cell[8][8];
227 };
228 static_assert( sizeof( USTRUCT_MAPINFO_BLOCK ) == 196, "size missmatch" );
229 
231 {
232  signed char z[8][8];
233  unsigned char walkok[8]; // x=index, y=bit
234  unsigned char water[8];
235 };
236 static_assert( sizeof( USTRUCT_POL_MAPINFO_BLOCK ) == 8 * 8 + 16, "size missmatch" );
237 
238 #pragma pack( pop )
239 }
240 }
241 #endif /* __USTRUCT_H */
unsigned char u8
Definition: rawtypes.h:25
const unsigned STAIDX_CHUNK
Definition: ustruct.h:46
unsigned short u16
Definition: rawtypes.h:26
unsigned int u32
Definition: rawtypes.h:27
signed short s16
Definition: rawtypes.h:30
std::set< unsigned int > water
Definition: uofile04.cpp:18
signed char s8
Definition: rawtypes.h:29
std::string name
Definition: osmod.cpp:943
Definition: berror.cpp:12