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.51 by root, Sat Jan 13 23:06:13 2007 UTC vs.
Revision 1.52 by root, Mon Jan 15 00:40:49 2007 UTC

372 int distance_y; 372 int distance_y;
373 int direction; 373 int direction;
374 object *part; 374 object *part;
375}; 375};
376 376
377//TODO: these should be refactored into things like xy_normalise
378// and so on.
379int get_map_flags(maptile *oldmap, maptile **newmap, sint16 x, sint16 y, sint16 *nx, sint16 *ny);
380int ob_blocked(const object *ob, maptile *m, sint16 x, sint16 y);
381int out_of_map(maptile *m, int x, int y);
382maptile *get_map_from_coord(maptile *m, sint16 *x, sint16 *y);
383void get_rangevector(object *op1, object *op2, rv_vector *retval, int flags);
384void get_rangevector_from_mapcoord(const maptile *m, int x, int y, const object *op2, rv_vector *retval, int flags);
385int on_same_map(const object *op1, const object *op2);
386
387// adjust map, x and y for tiled maps and return true if the position is valid at all
388inline bool
389xy_normalise (maptile *&map, sint16 &x, sint16 &y)
390{
391 // when in range, do a quick return, otherwise go the slow route
392 return
393 (IN_RANGE_EXC (x, 0, map->width) && IN_RANGE_EXC (y, 0, map->height))
394 || !(get_map_flags (map, &map, x, y, &x, &y) & P_OUT_OF_MAP);
395}
396
377inline mapspace & 397inline mapspace &
378object::ms () const 398object::ms () const
379{ 399{
380 return map->at (x, y); 400 return map->at (x, y);
381} 401}

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines