diff options
author | Sven Hesse | 2010-10-30 17:28:54 +0000 |
---|---|---|
committer | Sven Hesse | 2010-10-30 17:28:54 +0000 |
commit | 14d8d589e24c64370ed2ba8fb5254066b7ab1d47 (patch) | |
tree | 55449488029080527eae94df0a6c7a52109febe9 /engines | |
parent | 0f3ed50cfc6d1542d95a9d07c557572043c3060b (diff) | |
download | scummvm-rg350-14d8d589e24c64370ed2ba8fb5254066b7ab1d47.tar.gz scummvm-rg350-14d8d589e24c64370ed2ba8fb5254066b7ab1d47.tar.bz2 scummvm-rg350-14d8d589e24c64370ed2ba8fb5254066b7ab1d47.zip |
GOB: Make Map::getItem()/setItem() nonvirtual
svn-id: r53953
Diffstat (limited to 'engines')
-rw-r--r-- | engines/gob/map.cpp | 18 | ||||
-rw-r--r-- | engines/gob/map.h | 22 |
2 files changed, 20 insertions, 20 deletions
diff --git a/engines/gob/map.cpp b/engines/gob/map.cpp index 3efa18c264..500f6515ec 100644 --- a/engines/gob/map.cpp +++ b/engines/gob/map.cpp @@ -146,6 +146,24 @@ const WayPoint &Map::getWayPoint(int n) const { return _wayPoints[n]; } +int16 Map::getItem(int x, int y) const { + assert(_itemsMap); + + x = CLIP<int>(x, 0, _mapWidth - 1); + y = CLIP<int>(y, 0, _mapHeight - 1); + + return _itemsMap[y][x]; +} + +void Map::setItem(int x, int y, int16 item) { + assert(_itemsMap); + + x = CLIP<int>(x, 0, _mapWidth - 1); + y = CLIP<int>(y, 0, _mapHeight - 1); + + _itemsMap[y][x] = item; +} + void Map::placeItem(int16 x, int16 y, int16 id) { if ((getItem(x, y) & 0xFF00) != 0) setItem(x, y, (getItem(x, y) & 0xFF00) | id); diff --git a/engines/gob/map.h b/engines/gob/map.h index 4866b9b7f8..4bf2dc6228 100644 --- a/engines/gob/map.h +++ b/engines/gob/map.h @@ -107,6 +107,8 @@ public: void findNearestWalkable(int16 &gobDestX, int16 &gobDestY, int16 mouseX, int16 mouseY); + int16 getItem(int x, int y) const; + void setItem(int x, int y, int16 item); void placeItem(int16 x, int16 y, int16 id); Direction getDirection(int16 x0, int16 y0, int16 x1, int16 y1); @@ -118,9 +120,6 @@ public: void loadMapsInitGobs(); - virtual int16 getItem(int x, int y) = 0; - virtual void setItem(int x, int y, int16 item) = 0; - virtual void loadMapObjects(const char *avjFile) = 0; virtual void findNearestToGob(Mult::Mult_Object *obj) = 0; virtual void findNearestToDest(Mult::Mult_Object *obj) = 0; @@ -168,23 +167,6 @@ public: virtual void findNearestToDest(Mult::Mult_Object *obj); virtual void optimizePoints(Mult::Mult_Object *obj, int16 x, int16 y); - virtual int16 getItem(int x, int y) { - assert(_itemsMap); - - x = CLIP<int>(x, 0, _mapWidth - 1); - y = CLIP<int>(y, 0, _mapHeight - 1); - - return _itemsMap[y][x]; - } - virtual void setItem(int x, int y, int16 item) { - assert(_itemsMap); - - x = CLIP<int>(x, 0, _mapWidth - 1); - y = CLIP<int>(y, 0, _mapHeight - 1); - - _itemsMap[y][x] = item; - } - Map_v1(GobEngine *vm); virtual ~Map_v1(); |