diff options
author | Jaromir Wysoglad | 2019-05-30 12:00:28 +0200 |
---|---|---|
committer | Thierry Crozat | 2019-07-28 15:09:14 +0100 |
commit | 3cb1cf16991b28df96738ae03818a767dd26eb91 (patch) | |
tree | d11c5e50a51633f2c220ea2429cfeb5be11e375f | |
parent | 3300c358dbd6f7df1f20d56be5ddf61ae10436c3 (diff) | |
download | scummvm-rg350-3cb1cf16991b28df96738ae03818a767dd26eb91.tar.gz scummvm-rg350-3cb1cf16991b28df96738ae03818a767dd26eb91.tar.bz2 scummvm-rg350-3cb1cf16991b28df96738ae03818a767dd26eb91.zip |
SUPERNOVA2: Add drawMapExits from supernova
I am keeping there the TODO from the original code,
which can be resolved pretty easily, but I want to
leave the code as similar to supernova engine as possible
so it could eventualy be merged together.
-rw-r--r-- | engines/supernova2/state.cpp | 23 | ||||
-rw-r--r-- | engines/supernova2/state.h | 1 |
2 files changed, 21 insertions, 3 deletions
diff --git a/engines/supernova2/state.cpp b/engines/supernova2/state.cpp index 49fba402a6..6a4c855d19 100644 --- a/engines/supernova2/state.cpp +++ b/engines/supernova2/state.cpp @@ -522,6 +522,23 @@ void GameManager::showMenu() { drawInventory(); } +void GameManager::drawMapExits() { +// TODO: Preload _exitList on room entry instead on every call + _vm->renderBox(281, 161, 39, 39, kColorWhite25); + + for (int i = 0; i < 25; i++) + _exitList[i] = -1; + for (int i = 0; i < kMaxObject; i++) { + if (_currentRoom->getObject(i)->hasProperty(EXIT)) { + byte r = _currentRoom->getObject(i)->_direction; + _exitList[r] = i; + int x = 284 + 7 * (r % 5); + int y = 164 + 7 * (r / 5); + _vm->renderBox(x, y, 5, 5, kColorDarkRed); + } + } +} + void GameManager::drawStatus() { int index = static_cast<int>(_inputVerb); _vm->renderBox(0, 140, 320, 9, kColorWhite25); @@ -671,14 +688,14 @@ void GameManager::executeRoom() { g_system->fillScreen(kColorBlack); _vm->renderRoom(*_currentRoom); } -// drawMapExits(); + drawMapExits(); drawInventory(); drawStatus(); drawCommandBox(); } - //if (_vm->_screen->getViewportBrightness() == 0) - // _vm->paletteFadeIn(); + if (_vm->_screen->getViewportBrightness() == 0) + _vm->paletteFadeIn(); if (!_currentRoom->hasSeen() && _newRoom) { _newRoom = false; diff --git a/engines/supernova2/state.h b/engines/supernova2/state.h index b32d2d24c0..4569b24ad9 100644 --- a/engines/supernova2/state.h +++ b/engines/supernova2/state.h @@ -158,6 +158,7 @@ public: void waitOnInput(int ticks); bool waitOnInput(int ticks, Common::KeyCode &keycode); void showMenu(); + void drawMapExits(); void drawStatus(); void drawCommandBox(); void drawInventory(); |