diff options
author | Nipun Garg | 2019-06-07 22:27:29 +0530 |
---|---|---|
committer | Eugene Sandulenko | 2019-09-03 17:16:44 +0200 |
commit | a0b6b08ecd294003eaceb8b2aba037bb4d56f069 (patch) | |
tree | b2e89bc10af2e770a17dacdef3887d662f410787 /engines/hdb | |
parent | f512307f70840439dcd85739bd6190ec21bfbaf9 (diff) | |
download | scummvm-rg350-a0b6b08ecd294003eaceb8b2aba037bb4d56f069.tar.gz scummvm-rg350-a0b6b08ecd294003eaceb8b2aba037bb4d56f069.tar.bz2 scummvm-rg350-a0b6b08ecd294003eaceb8b2aba037bb4d56f069.zip |
HDB: Add TileLookup struct and _tLookupArray
_tLookupArray is a reference needed to cache
the tiles in the current level
Diffstat (limited to 'engines/hdb')
-rw-r--r-- | engines/hdb/draw-manager.cpp | 40 | ||||
-rw-r--r-- | engines/hdb/draw-manager.h | 12 |
2 files changed, 51 insertions, 1 deletions
diff --git a/engines/hdb/draw-manager.cpp b/engines/hdb/draw-manager.cpp index 85ee4ec9aa..564e178f35 100644 --- a/engines/hdb/draw-manager.cpp +++ b/engines/hdb/draw-manager.cpp @@ -25,17 +25,55 @@ namespace HDB { DrawMan::DrawMan() { + _tLookupArray = NULL; _systemInit = false; } bool DrawMan::init() { + // Read total number of tiles in game _numTiles = g_hdb->_fileMan->getCount("t32_", TYPE_TILE32); - if (!_numTiles) { return false; } + // Setup Tile Lookup Array + _tLookupArray = new TileLookup[_numTiles]; + Common::Array<const char *> tileData = *g_hdb->_fileMan->findFiles("t32_", TYPE_TILE32); + + int index = 0, skyIndex = 0; + for (; index < _numTiles; index++) { + _tLookupArray[index].filename = tileData[index]; + _tLookupArray[index].tData = NULL; + _tLookupArray[index].skyIndex = 0; + _tLookupArray[index].animIndex = index; + // Check if the loaded Tile is a Sky Tile + if (((Common::String)tileData[index]).contains("sky") && (skyIndex < kMaxSkies)) { + _tLookupArray[index].skyIndex = skyIndex + 1; + _skyTiles[skyIndex] = index; + skyIndex++; + } + } + + /* + TODO: Add Animating Tile Info + */ + + // Init Sky Data + _currentSky = 0; + + /* + TODO: Setup Gamma Table + */ + + /* + TODO: Load Mouse Pointer and Display Cursor + */ + + /* + TODO: Load all 4 levels of star colors and the snowflake + */ + _systemInit = true; return true; } diff --git a/engines/hdb/draw-manager.h b/engines/hdb/draw-manager.h index c3e6d91eb6..2c651dd816 100644 --- a/engines/hdb/draw-manager.h +++ b/engines/hdb/draw-manager.h @@ -33,6 +33,15 @@ enum { kMaxSkies = 10, }; +class Tile; + +struct TileLookup { + const char *filename; + Tile *tData; + uint16 skyIndex; + uint16 animIndex; +}; + class DrawMan { public: @@ -42,6 +51,9 @@ public: private: int _numTiles; + TileLookup *_tLookupArray; + uint16 _skyTiles[kMaxSkies]; + int _currentSky; // 0 if no Sky, 1+ for which Sky to use bool _systemInit; }; |