diff options
Diffstat (limited to 'engines/hdb/draw-manager.cpp')
-rw-r--r-- | engines/hdb/draw-manager.cpp | 23 |
1 files changed, 23 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(); } |