diff options
| author | Nipun Garg | 2019-06-07 23:25:06 +0530 | 
|---|---|---|
| committer | Eugene Sandulenko | 2019-09-03 17:16:44 +0200 | 
| commit | 7cca1f0e1c5ca4806fc90085a2b72b9b456c46a4 (patch) | |
| tree | fb073a32f41670fe7e0e25fb8b2088c93c9ca93a | |
| parent | 853489ff2402f1944cfac545b30d3a100eb5b19e (diff) | |
| download | scummvm-rg350-7cca1f0e1c5ca4806fc90085a2b72b9b456c46a4.tar.gz scummvm-rg350-7cca1f0e1c5ca4806fc90085a2b72b9b456c46a4.tar.bz2 scummvm-rg350-7cca1f0e1c5ca4806fc90085a2b72b9b456c46a4.zip | |
HDB: Add isSky()
It checks if the tile at a given index is a Sky
tile.
| -rw-r--r-- | engines/hdb/draw-manager.cpp | 14 | ||||
| -rw-r--r-- | engines/hdb/draw-manager.h | 1 | 
2 files changed, 15 insertions, 0 deletions
| diff --git a/engines/hdb/draw-manager.cpp b/engines/hdb/draw-manager.cpp index 56d53bbdbd..35c2b4ce4a 100644 --- a/engines/hdb/draw-manager.cpp +++ b/engines/hdb/draw-manager.cpp @@ -98,6 +98,20 @@ Tile *DrawMan::getTile(int index) {  	return _tLookupArray[index].tData;  } +int DrawMan::isSky(int index) { +	if (!index) { +		return 0; +	} + +	for (int i = 0; i < kMaxSkies; i++) { +		if(_skyTiles[i] == index) { +			return index + 1; // The skyTiles are indexed from 1. 0 => No Sky tile +		} +	} + +	return 0; +} +  Picture::~Picture() {  	_surface.free();  } diff --git a/engines/hdb/draw-manager.h b/engines/hdb/draw-manager.h index 238d36e939..025b594c74 100644 --- a/engines/hdb/draw-manager.h +++ b/engines/hdb/draw-manager.h @@ -49,6 +49,7 @@ public:  	bool init();  	Tile *getTile(int index); +	int isSky(int skyIndex);  private:  	int _numTiles; | 
