aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorEugene Sandulenko2014-05-03 11:37:13 +0300
committerEugene Sandulenko2014-05-03 11:37:13 +0300
commit9630e28bd986494b3f8cc3059685ced27705df94 (patch)
treeec9624e1ee40f0f25a736a754028e1597d32fcd1
parenta708e4ffc9daaece6a2fae8512c0f754101ec945 (diff)
downloadscummvm-rg350-9630e28bd986494b3f8cc3059685ced27705df94.tar.gz
scummvm-rg350-9630e28bd986494b3f8cc3059685ced27705df94.tar.bz2
scummvm-rg350-9630e28bd986494b3f8cc3059685ced27705df94.zip
FULLPIPE: Implement FullpipeEngine::restartGame()
-rw-r--r--engines/fullpipe/fullpipe.cpp35
-rw-r--r--engines/fullpipe/gameloader.cpp4
-rw-r--r--engines/fullpipe/gameloader.h2
3 files changed, 40 insertions, 1 deletions
diff --git a/engines/fullpipe/fullpipe.cpp b/engines/fullpipe/fullpipe.cpp
index 5369c05de7..539781679d 100644
--- a/engines/fullpipe/fullpipe.cpp
+++ b/engines/fullpipe/fullpipe.cpp
@@ -37,6 +37,7 @@
#include "fullpipe/scenes.h"
#include "fullpipe/floaters.h"
#include "fullpipe/console.h"
+#include "fullpipe/constants.h"
namespace Fullpipe {
@@ -205,7 +206,39 @@ void FullpipeEngine::initialize() {
}
void FullpipeEngine::restartGame() {
- warning("STUB: FullpipeEngine::restartGame()");
+ _floaters->stopAll();
+
+ clearGlobalMessageQueueList();
+ clearMessages();
+
+ initObjectStates();
+
+ if (_scene2) {
+ _scene2->getAniMan();
+ _scene2 = 0;
+ }
+
+ if (_currentScene) {
+ _gameLoader->unloadScene(_currentScene->_sceneId);
+
+ _currentScene = 0;
+ }
+
+ _gameLoader->restoreDefPicAniInfos();
+
+ getGameLoaderInventory()->clear();
+ getGameLoaderInventory()->addItem(ANI_INV_MAP, 1);
+ getGameLoaderInventory()->rebuildItemRects();
+
+ initMap();
+
+ if (_flgPlayIntro) {
+ _gameLoader->loadScene(SC_INTRO1);
+ _gameLoader->gotoScene(SC_INTRO1, TrubaUp);
+ } else {
+ _gameLoader->loadScene(SC_1);
+ _gameLoader->gotoScene(SC_1, TrubaLeft);
+ }
}
Common::Error FullpipeEngine::run() {
diff --git a/engines/fullpipe/gameloader.cpp b/engines/fullpipe/gameloader.cpp
index 5c528c41f8..c8b01939dd 100644
--- a/engines/fullpipe/gameloader.cpp
+++ b/engines/fullpipe/gameloader.cpp
@@ -634,6 +634,10 @@ bool readSavegameHeader(Common::InSaveFile *in, FullpipeSavegameHeader &header)
return true;
}
+void GameLoader::restoreDefPicAniInfos() {
+ warning("STUB: restoreDefPicAniInfos()");
+}
+
GameVar *FullpipeEngine::getGameLoaderGameVar() {
if (_gameLoader)
return _gameLoader->_gameVar;
diff --git a/engines/fullpipe/gameloader.h b/engines/fullpipe/gameloader.h
index 0796396549..772cc51130 100644
--- a/engines/fullpipe/gameloader.h
+++ b/engines/fullpipe/gameloader.h
@@ -100,6 +100,8 @@ class GameLoader : public CObject {
void readSavegame(const char *fname);
void writeSavegame(Scene *sc, const char *fname);
+ void restoreDefPicAniInfos();
+
GameProject *_gameProject;
InteractionController *_interactionController;
InputController *_inputController;