52 #define MAGIC_MAP_SIZE 50
53 #define MAGIC_MAP_HALF MAGIC_MAP_SIZE/2
68 #define MAP_LAYER_FLOOR 0
69 #define MAP_LAYER_NO_PICK1 1
70 #define MAP_LAYER_NO_PICK2 2
71 #define MAP_LAYER_ITEM1 3
72 #define MAP_LAYER_ITEM2 4
73 #define MAP_LAYER_ITEM3 5
74 #define MAP_LAYER_LIVING1 6
75 #define MAP_LAYER_LIVING2 7
76 #define MAP_LAYER_FLY1 8
77 #define MAP_LAYER_FLY2 9
81 #define MAP_WHEN_RESET(m) ((m)->reset_time)
83 #define MAP_RESET_TIMEOUT(m) ((m)->reset_timeout)
84 #define MAP_DIFFICULTY(m) ((m)->difficulty)
85 #define MAP_TIMEOUT(m) ((m)->timeout)
86 #define MAP_SWAP_TIME(m) ((m)->swap_time)
87 #define MAP_OUTDOORS(m) ((m)->outdoor)
94 #define MAP_DARKNESS(m) (m)->darkness
97 #define MAP_WIDTH(m) (m)->width
99 #define MAP_HEIGHT(m) (m)->height
101 #define MAP_SIZE(m) ((m)->width*(m)->height)
104 #define MAP_ENTER_X(m) (m)->enter_x
106 #define MAP_ENTER_Y(m) (m)->enter_y
108 #define MAP_NOSMOOTH(m) (m)->nosmooth
116 #define MAP_FLUSH 0x1
117 #define MAP_PLAYER_UNIQUE 0x2
118 #define MAP_BLOCK 0x4
119 #define MAP_STYLE 0x8
120 #define MAP_OVERLAY 0x10
131 #define SAVE_FLAG_SAVE_UNPAID 1
132 #define SAVE_FLAG_NO_REMOVE 2
141 #define SAVE_MODE_NORMAL 0
142 #define SAVE_MODE_INPLACE 1
143 #define SAVE_MODE_OVERLAY 2
151 #define MAP_IN_MEMORY 1
152 #define MAP_SWAPPED 2
153 #define MAP_LOADING 3
164 #define SAVE_ERROR_OK 0
165 #define SAVE_ERROR_RCREATION -1
166 #define SAVE_ERROR_UCREATION -2
167 #define SAVE_ERROR_WRITE -3
168 #define SAVE_ERROR_NO_PATH -4
169 #define SAVE_ERROR_URENAME -5
170 #define SAVE_ERROR_CLOSE -6
171 #define SAVE_ERROR_RRENAME -7
172 #define SAVE_ERROR_NOT_IN_MEMORY -10
173 #define SAVE_ERROR_PLAYER -11
182 #define GET_MAP_FLAGS(M, X, Y) ((M)->spaces[(X)+(M)->width*(Y)].flags)
184 #define SET_MAP_FLAGS(M, X, Y, C) ((M)->spaces[(X)+(M)->width*(Y)].flags = C)
186 #define GET_MAP_LIGHT(M, X, Y) ((M)->spaces[(X)+(M)->width*(Y)].light)
188 #define SET_MAP_LIGHT(M, X, Y, L) ((M)->spaces[(X)+(M)->width*(Y)].light = L)
189 #define GET_MAP_PLAYER(M, X, Y) ((M)->spaces[(X)+(M)->width*(Y)].pl)
190 #define SET_MAP_PLAYER(M, X, Y, C) ((M)->spaces[(X)+(M)->width*(Y)].pl = C)
193 #define GET_MAP_OB(M, X, Y) ((M)->spaces[(X)+(M)->width*(Y)].bottom)
195 #define GET_MAP_TOP(M, X, Y) ((M)->spaces[(X)+(M)->width*(Y)].top)
198 #define SET_MAP_OB(M, X, Y, tmp) ((M)->spaces[(X)+(M)->width*(Y)].bottom = (tmp))
200 #define SET_MAP_TOP(M, X, Y, tmp) ((M)->spaces[(X)+(M)->width*(Y)].top = (tmp))
203 #define SET_MAP_FACE_OBJ(M, X, Y, C, L) ((M)->spaces[(X)+(M)->width*(Y)].faces_obj[L] = C)
205 #define GET_MAP_FACE_OBJ(M, X, Y, L) ((M)->spaces[(X)+(M)->width*(Y)].faces_obj[L])
210 #define GET_MAP_FACE_OBJS(M, X, Y) ((M)->spaces[(X)+(M)->width*(Y)].faces_obj)
213 #define GET_MAP_MOVE_BLOCK(M, X, Y) ((M)->spaces[(X)+(M)->width*(Y)].move_block)
215 #define SET_MAP_MOVE_BLOCK(M, X, Y, C) ((M)->spaces[(X)+(M)->width*(Y)].move_block = C)
218 #define GET_MAP_MOVE_SLOW(M, X, Y) ((M)->spaces[(X)+(M)->width*(Y)].move_slow)
220 #define SET_MAP_MOVE_SLOW(M, X, Y, C) ((M)->spaces[(X)+(M)->width*(Y)].move_slow = C)
223 #define GET_MAP_MOVE_ON(M, X, Y) ((M)->spaces[(X)+(M)->width*(Y)].move_on)
225 #define SET_MAP_MOVE_ON(M, X, Y, C) ((M)->spaces[(X)+(M)->width*(Y)].move_on = C)
228 #define GET_MAP_MOVE_OFF(M, X, Y) ((M)->spaces[(X)+(M)->width*(Y)].move_off)
230 #define SET_MAP_MOVE_OFF(M, X, Y, C) ((M)->spaces[(X)+(M)->width*(Y)].move_off = C)
238 #define OUT_OF_REAL_MAP(M, X, Y) ((X) < 0 || (Y) < 0 || (X) >= (M)->width || (Y) >= (M)->height)
247 #define P_BLOCKSVIEW 0x01
248 #define P_NO_MAGIC 0x02
256 #define AB_NO_PASS 0x04
257 #define P_PLAYER 0x08
258 #define P_IS_ALIVE 0x10
259 #define P_NO_CLERIC 0x20
260 #define P_NEED_UPDATE 0x40
261 #define P_NO_ERROR 0x80
270 #define P_OUT_OF_MAP 0x100
271 #define P_NEW_MAP 0x200
struct mapdef * tile_map[4]
const char * map_layer_name[MAP_LAYERS]
object * faces_obj[MAP_LAYERS]
struct timeval last_reset_time
struct shopitem shopitems
struct regiondef * parent
struct rv_vector rv_vector
struct shopitem * shopitems
struct regiondef * region