diff options
| -rw-r--r-- | engines/hdb/map-loader.cpp | 10 | ||||
| -rw-r--r-- | engines/hdb/map-loader.h | 3 | 
2 files changed, 13 insertions, 0 deletions
diff --git a/engines/hdb/map-loader.cpp b/engines/hdb/map-loader.cpp index 0cf84e4f69..17da352e27 100644 --- a/engines/hdb/map-loader.cpp +++ b/engines/hdb/map-loader.cpp @@ -916,4 +916,14 @@ void Map::centerMapXY(int x, int y) {  	setMapXY(x, y);  } +bool Map::checkOneTileExistInRange(int tileIndex, int count) { +	for (int i = 0; i < _width*_height;i++) { +		if (_background[i] >= tileIndex && _background[i] < tileIndex + count) +			return true; +		if (_foreground[i] >= tileIndex && _foreground[i] < tileIndex + count) +			return true; +	} +	return true; +} +  } diff --git a/engines/hdb/map-loader.h b/engines/hdb/map-loader.h index da8b7d6713..f59159a699 100644 --- a/engines/hdb/map-loader.h +++ b/engines/hdb/map-loader.h @@ -92,6 +92,9 @@ public:  	void setMapXY(int x, int y);  	void centerMapXY(int x, int y); +	// Check if one of the tiles in a range exists in the map on either layer +	bool checkOneTileExistInRange(int tileIndex, int count); +  	int _mapX, _mapY; // Coordinates of Map  	int _mapTileX, _mapTileY; // Tile Coordinates of Map  	int _mapTileXOff, _mapTileYOff; // Tile Coordinates Offset (0-31)  | 
