diff options
author | Nipun Garg | 2019-06-21 06:15:17 +0530 |
---|---|---|
committer | Eugene Sandulenko | 2019-09-03 17:16:53 +0200 |
commit | 55b5acb959f42d737f75d96d361f38cbedb8e017 (patch) | |
tree | 0018d8d705c3270ce132db15976c1a5c259e556b /engines | |
parent | be5b717c85933eeb34ceb708424ba580e2bd17c8 (diff) | |
download | scummvm-rg350-55b5acb959f42d737f75d96d361f38cbedb8e017.tar.gz scummvm-rg350-55b5acb959f42d737f75d96d361f38cbedb8e017.tar.bz2 scummvm-rg350-55b5acb959f42d737f75d96d361f38cbedb8e017.zip |
HDB: Add setter functions for BG/FG tile indices
Diffstat (limited to 'engines')
-rw-r--r-- | engines/hdb/map-loader.cpp | 14 | ||||
-rw-r--r-- | engines/hdb/map-loader.h | 3 |
2 files changed, 17 insertions, 0 deletions
diff --git a/engines/hdb/map-loader.cpp b/engines/hdb/map-loader.cpp index 0d105d8085..f5e2fded8a 100644 --- a/engines/hdb/map-loader.cpp +++ b/engines/hdb/map-loader.cpp @@ -642,6 +642,20 @@ uint16 Map::getMapFGTileIndex(int x, int y) { return _foreground[y * _width + x]; } +void Map::setMapBGTileIndex(int x, int y, int index) { + if (x < 0 || x >= _width || y < 0 || y >= _height) { + return; + } + _background[y * _width + x] = index; +} + +void Map::setMapFGTileIndex(int x, int y, int index) { + if (x < 0 || x >= _width || y < 0 || y >= _height) { + return; + } + _foreground[y * _width + x] = index; +} + void Map::getMapXY(int *x, int *y) { *x = _mapX; *y = _mapY; diff --git a/engines/hdb/map-loader.h b/engines/hdb/map-loader.h index 12c481fa53..0e2f3d0c50 100644 --- a/engines/hdb/map-loader.h +++ b/engines/hdb/map-loader.h @@ -67,6 +67,9 @@ public: uint32 getMapFGTileFlags(int x, int y); uint16 getMapBGTileIndex(int x, int y); uint16 getMapFGTileIndex(int x, int y); + void setMapBGTileIndex(int x, int y, int index); + void setMapFGTileIndex(int x, int y, int index); + void getMapXY(int *x, int *y); void setMapXY(int x, int y); void centerMapXY(int x, int y); |