aboutsummaryrefslogtreecommitdiff
path: root/engines/hdb/hdb.cpp
diff options
context:
space:
mode:
authorEugene Sandulenko2019-07-03 17:01:00 +0200
committerEugene Sandulenko2019-09-03 17:17:09 +0200
commit74eb242b5a0606a274b38e1fdc12b9b8fb908368 (patch)
tree6a25512ffa51b285c182016f97199721f877bb81 /engines/hdb/hdb.cpp
parent34a3e1685bef4b57f10d4acdbf568a217315fa32 (diff)
downloadscummvm-rg350-74eb242b5a0606a274b38e1fdc12b9b8fb908368.tar.gz
scummvm-rg350-74eb242b5a0606a274b38e1fdc12b9b8fb908368.tar.bz2
scummvm-rg350-74eb242b5a0606a274b38e1fdc12b9b8fb908368.zip
HDB: Unstub HDBGame::restartMap()
Diffstat (limited to 'engines/hdb/hdb.cpp')
-rw-r--r--engines/hdb/hdb.cpp39
1 files changed, 38 insertions, 1 deletions
diff --git a/engines/hdb/hdb.cpp b/engines/hdb/hdb.cpp
index 0d10b506d9..fdbacecb2f 100644
--- a/engines/hdb/hdb.cpp
+++ b/engines/hdb/hdb.cpp
@@ -56,6 +56,10 @@ HDBGame::HDBGame(OSystem *syst, const ADGameDescription *gameDesc) : Engine(syst
_currentMapname[0] = _currentLuaName[0] = 0;
+ _monkeystone7 = STARS_MONKEYSTONE_7_FAKE;
+ _monkeystone14 = STARS_MONKEYSTONE_14_FAKE;
+ _monkeystone21 = STARS_MONKEYSTONE_21_FAKE;
+
DebugMan.addDebugChannel(kDebugExample1, "Example1", "This is just an example to test");
DebugMan.addDebugChannel(kDebugExample2, "Example2", "This is also an example");
}
@@ -153,7 +157,40 @@ bool HDBGame::restartMap() {
if (!_currentMapname[0])
return false;
- warning("STUB: HDBGame::restartMap()");
+ _gfx->emptyGfxCaches();
+ _lua->callFunction("level_shutdown", 0);
+
+ _gfx->turnOffSnow();
+ _window->restartSystem();
+ _ai->restartSystem();
+ _lua->init();
+ _lua->loadLua(_currentLuaName);
+
+ _sound->markSoundCacheFreeable();
+ _map->restartSystem();
+
+ if (!_map->loadMap(_currentMapname))
+ return false;
+
+ _ai->initAnimInfo();
+
+ // if there are Secret Stars here, stick the variable in Lua
+ if (!_menu->_starWarp && getStarsMonkeystone7() == STARS_MONKEYSTONE_7)
+ _lua->setLuaGlobalValue("secretstars", 1);
+ if (_menu->_starWarp == 1 && getStarsMonkeystone14() == STARS_MONKEYSTONE_14)
+ _lua->setLuaGlobalValue("secretstars", 2);
+ if (_menu->_starWarp == 2 && getStarsMonkeystone21() == STARS_MONKEYSTONE_21)
+ _lua->setLuaGlobalValue("secretstars", 3);
+
+ _lua->callFunction("level_loaded", 0);
+ if (!_ai->cinematicsActive())
+ _gfx->turnOffFade();
+
+ // center the player on the screen
+ int x, y;
+
+ _ai->getPlayerXY(&x, &y);
+ _map->centerMapXY(x + 16, y + 16);
return true;
}