ViewVC Help
View File | Revision Log | Show Annotations | Download File
/cvs/deliantra/server/include/map.h
(Generate patch)

Comparing deliantra/server/include/map.h (file contents):
Revision 1.98 by root, Sun Aug 17 22:46:26 2008 UTC vs.
Revision 1.101 by root, Tue Dec 23 01:51:28 2008 UTC

63 * where it is known the map is not tiled or the values are known 63 * where it is known the map is not tiled or the values are known
64 * consistent (eg, op->map, op->x, op->y) 64 * consistent (eg, op->map, op->x, op->y)
65 */ 65 */
66// all those macros are herewith declared legacy 66// all those macros are herewith declared legacy
67#define GET_MAP_FLAGS(M,X,Y) (M)->at((X),(Y)).flags () 67#define GET_MAP_FLAGS(M,X,Y) (M)->at((X),(Y)).flags ()
68#define GET_MAP_LIGHT(M,X,Y) (M)->at((X),(Y)).light
69#define GET_MAP_OB(M,X,Y) (M)->at((X),(Y)).bot 68#define GET_MAP_OB(M,X,Y) (M)->at((X),(Y)).bot
70#define GET_MAP_TOP(M,X,Y) (M)->at((X),(Y)).top 69#define GET_MAP_TOP(M,X,Y) (M)->at((X),(Y)).top
71#define GET_MAP_FACE_OBJ(M,X,Y,L) (M)->at((X),(Y)).faces_obj[L] 70#define GET_MAP_FACE_OBJ(M,X,Y,L) (M)->at((X),(Y)).faces_obj[L]
72#define GET_MAP_MOVE_BLOCK(M,X,Y) (M)->at((X),(Y)).move_block 71#define GET_MAP_MOVE_BLOCK(M,X,Y) (M)->at((X),(Y)).move_block
73#define GET_MAP_MOVE_SLOW(M,X,Y) (M)->at((X),(Y)).move_slow 72#define GET_MAP_MOVE_SLOW(M,X,Y) (M)->at((X),(Y)).move_slow
134 133
135 MTH uint8 flags () 134 MTH uint8 flags ()
136 { 135 {
137 update (); 136 update ();
138 return flags_; 137 return flags_;
138 }
139
140 MTH void invalidate ()
141 {
142 flags_ = 0;
139 } 143 }
140 144
141 MTH object *player () 145 MTH object *player ()
142 { 146 {
143 object *op; 147 object *op;
223 227
224 bool ACC (RW, per_player); 228 bool ACC (RW, per_player);
225 bool ACC (RW, per_party); 229 bool ACC (RW, per_party);
226 bool ACC (RW, outdoor); /* True if an outdoor map */ 230 bool ACC (RW, outdoor); /* True if an outdoor map */
227 bool ACC (RW, no_drop); /* avoid auto-dropping (on death) anything on this map */ 231 bool ACC (RW, no_drop); /* avoid auto-dropping (on death) anything on this map */
228 uint8 ACC (RW, darkness); /* indicates level of darkness of map */ 232 sint8 ACC (RW, darkness); /* indicates level of darkness of map */
233 static sint8 outdoor_darkness; /* the global darkness level outside */
229 234
230 uint16 ACC (RW, enter_x); /* enter_x and enter_y are default entrance location */ 235 uint16 ACC (RW, enter_x); /* enter_x and enter_y are default entrance location */
231 uint16 ACC (RW, enter_y); /* on the map if none are set in the exit */ 236 uint16 ACC (RW, enter_y); /* on the map if none are set in the exit */
232 oblinkpt *buttons; /* Linked list of linked lists of buttons */ 237 oblinkpt *buttons; /* Linked list of linked lists of buttons */
233 sint16 ACC (RW, temp); /* base temperature of this tile (F) */ 238 sint16 ACC (RW, temp); /* base temperature of this tile (F) */
248 maptile *ACC (RW, tile_map[4]); /* Next map, linked list */ 253 maptile *ACC (RW, tile_map[4]); /* Next map, linked list */
249 shstr ACC (RW, path); /* Filename of the map */ 254 shstr ACC (RW, path); /* Filename of the map */
250 int ACC (RW, max_nrof); // maximum nrof of any single item on a mapspace 255 int ACC (RW, max_nrof); // maximum nrof of any single item on a mapspace
251 uint64 ACC (RW, max_volume); // maximum volume for all items on a mapspace 256 uint64 ACC (RW, max_volume); // maximum volume for all items on a mapspace
252 257
258 MTH sint8 darklevel () const
259 {
260 return clamp (outdoor ? darkness + outdoor_darkness : darkness, 0, MAX_DARKNESS);
261 }
262
253 MTH void activate (); 263 MTH void activate ();
254 MTH void deactivate (); 264 MTH void deactivate ();
255 265
256 // allocates all (empty) mapspace 266 // allocates all (empty) mapspace
257 MTH void alloc (); 267 MTH void alloc ();
334 static maptile *find_async (const char *path, maptile *original = 0, bool load = true);//PERL 344 static maptile *find_async (const char *path, maptile *original = 0, bool load = true);//PERL
335 static maptile *find_sync (const char *path, maptile *original = 0);//PERL 345 static maptile *find_sync (const char *path, maptile *original = 0);//PERL
336 static maptile *find_style_sync (const char *dir, const char *file = 0);//PERL 346 static maptile *find_style_sync (const char *dir, const char *file = 0);//PERL
337 object *pick_random_object (rand_gen &gen = rndm) const; 347 object *pick_random_object (rand_gen &gen = rndm) const;
338 348
339 mapspace const &at (uint32 x, uint32 y) const { return spaces [x * height + y]; } 349 mapspace &at (uint32 x, uint32 y) const { return spaces [x * height + y]; }
340 mapspace &at (uint32 x, uint32 y) { return spaces [x * height + y]; }
341}; 350};
342 351
343/* This is used by get_rangevector to determine where the other 352/* This is used by get_rangevector to determine where the other
344 * creature is. get_rangevector takes into account map tiling, 353 * creature is. get_rangevector takes into account map tiling,
345 * so you just can not look the the map coordinates and get the 354 * so you just can not look the the map coordinates and get the

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines