diff options
Diffstat (limited to 'engines/hdb')
-rw-r--r-- | engines/hdb/draw-manager.cpp | 23 | ||||
-rw-r--r-- | engines/hdb/draw-manager.h | 1 |
2 files changed, 24 insertions, 0 deletions
diff --git a/engines/hdb/draw-manager.cpp b/engines/hdb/draw-manager.cpp index 564e178f35..85c313ab14 100644 --- a/engines/hdb/draw-manager.cpp +++ b/engines/hdb/draw-manager.cpp @@ -78,6 +78,29 @@ bool DrawMan::init() { return true; } +bool DrawMan::cacheTile(int index) { + + if (index < 0) { + return false; + } + if (index > _numTiles) { + return false; + } + if (_tLookupArray[index].skyIndex) { + // We don't draw Sky Tiles, so return true + return true; + } + + if (_tLookupArray[index].tData == NULL) { + Common::SeekableReadStream *stream = g_hdb->_fileMan->findFirstData(_tLookupArray[index].filename, TYPE_TILE32); + Tile *tile = new Tile; + tile->load(stream); + _tLookupArray[index].tData = tile; + } + + return true; +} + Picture::~Picture() { _surface.free(); } diff --git a/engines/hdb/draw-manager.h b/engines/hdb/draw-manager.h index 2c651dd816..fac91c78ad 100644 --- a/engines/hdb/draw-manager.h +++ b/engines/hdb/draw-manager.h @@ -48,6 +48,7 @@ public: DrawMan(); bool init(); + bool cacheTile(int index); private: int _numTiles; |