aboutsummaryrefslogtreecommitdiff
path: root/engines
diff options
context:
space:
mode:
authorNipun Garg2019-06-07 23:23:58 +0530
committerEugene Sandulenko2019-09-03 17:16:44 +0200
commit853489ff2402f1944cfac545b30d3a100eb5b19e (patch)
tree83a90e261edcaaf27bbad0b8e661f4459d9e4283 /engines
parent32af03ab9929f32ae2535902d3d54aaca69d40b8 (diff)
downloadscummvm-rg350-853489ff2402f1944cfac545b30d3a100eb5b19e.tar.gz
scummvm-rg350-853489ff2402f1944cfac545b30d3a100eb5b19e.tar.bz2
scummvm-rg350-853489ff2402f1944cfac545b30d3a100eb5b19e.zip
HDB: Change cacheTile() to getTile()
getTile() caches the tile automatically if it hasn't been cached yet
Diffstat (limited to 'engines')
-rw-r--r--engines/hdb/draw-manager.cpp15
-rw-r--r--engines/hdb/draw-manager.h2
2 files changed, 7 insertions, 10 deletions
diff --git a/engines/hdb/draw-manager.cpp b/engines/hdb/draw-manager.cpp
index 85c313ab14..56d53bbdbd 100644
--- a/engines/hdb/draw-manager.cpp
+++ b/engines/hdb/draw-manager.cpp
@@ -78,17 +78,14 @@ bool DrawMan::init() {
return true;
}
-bool DrawMan::cacheTile(int index) {
+Tile *DrawMan::getTile(int index) {
- if (index < 0) {
- return false;
- }
- if (index > _numTiles) {
- return false;
+ if (index < 0 || index > _numTiles) {
+ return NULL;
}
if (_tLookupArray[index].skyIndex) {
- // We don't draw Sky Tiles, so return true
- return true;
+ // We don't draw Sky Tiles, so return NULL
+ return NULL;
}
if (_tLookupArray[index].tData == NULL) {
@@ -98,7 +95,7 @@ bool DrawMan::cacheTile(int index) {
_tLookupArray[index].tData = tile;
}
- return true;
+ return _tLookupArray[index].tData;
}
Picture::~Picture() {
diff --git a/engines/hdb/draw-manager.h b/engines/hdb/draw-manager.h
index 03abfb9d2b..238d36e939 100644
--- a/engines/hdb/draw-manager.h
+++ b/engines/hdb/draw-manager.h
@@ -48,7 +48,7 @@ public:
DrawMan();
bool init();
- bool cacheTile(int index);
+ Tile *getTile(int index);
private:
int _numTiles;