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.115 by root, Wed Nov 4 14:45:30 2009 UTC vs.
Revision 1.116 by root, Thu Nov 5 15:57:15 2009 UTC

30#ifndef MAP_H 30#ifndef MAP_H
31#define MAP_H 31#define MAP_H
32 32
33#include <tr1/unordered_map> 33#include <tr1/unordered_map>
34 34
35//+GPL
36
35#include "region.h" 37#include "region.h"
36#include "cfperl.h" 38#include "cfperl.h"
37 39
38/* We set this size - this is to make magic map work properly on 40/* We set this size - this is to make magic map work properly on
39 * tiled maps. There is no requirement that this matches the 41 * tiled maps. There is no requirement that this matches the
132 MoveType ACC (RW, move_block); /* What movement types this space blocks */ 134 MoveType ACC (RW, move_block); /* What movement types this space blocks */
133 MoveType ACC (RW, move_slow); /* What movement types this space slows */ 135 MoveType ACC (RW, move_slow); /* What movement types this space slows */
134 MoveType ACC (RW, move_on); /* What movement types are activated */ 136 MoveType ACC (RW, move_on); /* What movement types are activated */
135 MoveType ACC (RW, move_off); /* What movement types are activated */ 137 MoveType ACC (RW, move_off); /* What movement types are activated */
136 138
139//-GPL
140
137 void update_ (); 141 void update_ ();
138 MTH void update () 142 MTH void update ()
139 { 143 {
140 if (expect_false (!(flags_ & P_UPTODATE))) 144 if (expect_false (!(flags_ & P_UPTODATE)))
141 update_ (); 145 update_ ();
185 maptile *m; 189 maptile *m;
186 int x0, y0; 190 int x0, y0;
187 int x1, y1; 191 int x1, y1;
188 int dx, dy; // offset to go from local coordinates to original tile */ 192 int dx, dy; // offset to go from local coordinates to original tile */
189}; 193};
194
195//+GPL
190 196
191struct shopitems : zero_initialised 197struct shopitems : zero_initialised
192{ 198{
193 const char *name; /* name of the item in question, null if it is the default item */ 199 const char *name; /* name of the item in question, null if it is the default item */
194 const char *name_pl; /* plural name */ 200 const char *name_pl; /* plural name */
272 maptile *ACC (RW, tile_map[4]); /* Next map, linked list */ 278 maptile *ACC (RW, tile_map[4]); /* Next map, linked list */
273 shstr ACC (RW, path); /* Filename of the map */ 279 shstr ACC (RW, path); /* Filename of the map */
274 int ACC (RW, max_nrof); // maximum nrof of any single item on a mapspace 280 int ACC (RW, max_nrof); // maximum nrof of any single item on a mapspace
275 uint64 ACC (RW, max_volume); // maximum volume for all items on a mapspace 281 uint64 ACC (RW, max_volume); // maximum volume for all items on a mapspace
276 282
283//-GPL
284
277 // the maptile:: is neccessary here for the perl interface to work 285 // the maptile:: is neccessary here for the perl interface to work
278 MTH sint8 darklevel (sint8 outside = maptile::outdoor_darkness) const 286 MTH sint8 darklevel (sint8 outside = maptile::outdoor_darkness) const
279 { 287 {
280 return clamp (outdoor ? darkness + outside : darkness, 0, MAX_DARKNESS); 288 return clamp (outdoor ? darkness + outside : darkness, 0, MAX_DARKNESS);
281 } 289 }
378 // a 0 map pointer. 386 // a 0 map pointer.
379 // the array will be stored in a static memory area, 387 // the array will be stored in a static memory area,
380 // so recursion is not atm. supported 388 // so recursion is not atm. supported
381 maprect *split_to_tiles (int x0, int y0, int x1, int y1); 389 maprect *split_to_tiles (int x0, int y0, int x1, int y1);
382}; 390};
391
392//+GPL
383 393
384/* This is used by get_rangevector to determine where the other 394/* This is used by get_rangevector to determine where the other
385 * creature is. get_rangevector takes into account map tiling, 395 * creature is. get_rangevector takes into account map tiling,
386 * so you just can not look the the map coordinates and get the 396 * so you just can not look the the map coordinates and get the
387 * righte value. distance_x/y are distance away, which 397 * righte value. distance_x/y are distance away, which
418 return 428 return
419 (IN_RANGE_EXC (x, 0, map->width) && IN_RANGE_EXC (y, 0, map->height)) 429 (IN_RANGE_EXC (x, 0, map->width) && IN_RANGE_EXC (y, 0, map->height))
420 || !(get_map_flags (map, &map, x, y, &x, &y) & P_OUT_OF_MAP); 430 || !(get_map_flags (map, &map, x, y, &x, &y) & P_OUT_OF_MAP);
421} 431}
422// comaptibility cruft end 432// comaptibility cruft end
433
434//-GPL
423 435
424inline mapspace & 436inline mapspace &
425object::ms () const 437object::ms () const
426{ 438{
427 return map->at (x, y); 439 return map->at (x, y);

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines