diff options
Diffstat (limited to 'engines/hdb/map-loader.cpp')
-rw-r--r-- | engines/hdb/map-loader.cpp | 22 |
1 files changed, 22 insertions, 0 deletions
diff --git a/engines/hdb/map-loader.cpp b/engines/hdb/map-loader.cpp index c6de98e148..090dbf3abb 100644 --- a/engines/hdb/map-loader.cpp +++ b/engines/hdb/map-loader.cpp @@ -228,4 +228,26 @@ void Map::draw() { */ } +void Map::getMapXY(int *x, int *y) { + *x = _mapX; + *y = _mapY; +} + +void Map::setMapXY(int x, int y) { + if (x < 0) { + x = 0; + } else if (x > (_width * kTileWidth - 480)) { + x = _width * kTileWidth - 480; + } + + if (y < 0) { + y = 0; + } else if (y > (_height * kTileHeight - 480)) { + y = _height * kTileHeight - 480; + } + + _mapX = x; + _mapY = y; +} + } |