diff options
Diffstat (limited to 'engines/gob/map.h')
-rw-r--r-- | engines/gob/map.h | 20 |
1 files changed, 20 insertions, 0 deletions
diff --git a/engines/gob/map.h b/engines/gob/map.h index 8a94de8da9..4a211f205d 100644 --- a/engines/gob/map.h +++ b/engines/gob/map.h @@ -101,6 +101,9 @@ public: void loadMapsInitGobs(void); + virtual int16 getItem(int x, int y) = 0; + virtual void setItem(int x, int y, int16 item) = 0; + virtual int8 getPass(int x, int y, int heightOff = -1) = 0; virtual void setPass(int x, int y, int8 pass, int heightOff = -1) = 0; @@ -127,6 +130,23 @@ 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; + } + virtual int8 getPass(int x, int y, int heightOff = -1) { if (!_passMap) return 0; |