aboutsummaryrefslogtreecommitdiff
path: root/engines/cine
diff options
context:
space:
mode:
authorEugene Sandulenko2010-05-19 12:34:10 +0000
committerEugene Sandulenko2010-05-19 12:34:10 +0000
commit15c533d2c2b1464f2d55d3f6c48a9e21c85a2e7f (patch)
tree524634239484d5447b41815ff48b811bccee965b /engines/cine
parent2be9bb3d5fc90962cd672aaa99a3d1eea2898c82 (diff)
downloadscummvm-rg350-15c533d2c2b1464f2d55d3f6c48a9e21c85a2e7f.tar.gz
scummvm-rg350-15c533d2c2b1464f2d55d3f6c48a9e21c85a2e7f.tar.bz2
scummvm-rg350-15c533d2c2b1464f2d55d3f6c48a9e21c85a2e7f.zip
Implement FR #2841445: FW: Restart doesn't work
svn-id: r49096
Diffstat (limited to 'engines/cine')
-rw-r--r--engines/cine/cine.cpp19
-rw-r--r--engines/cine/cine.h2
-rw-r--r--engines/cine/main_loop.cpp2
-rw-r--r--engines/cine/various.cpp3
-rw-r--r--engines/cine/various.h1
5 files changed, 17 insertions, 10 deletions
diff --git a/engines/cine/cine.cpp b/engines/cine/cine.cpp
index c33349173a..c50af52901 100644
--- a/engines/cine/cine.cpp
+++ b/engines/cine/cine.cpp
@@ -90,13 +90,20 @@ Common::Error CineEngine::run() {
}
g_saveFileMan = _saveFileMan;
- initialize();
+ _restartRequested = false;
- CursorMan.showMouse(true);
- mainLoop(1);
+ do {
+ initialize();
+
+ _restartRequested = false;
+
+ CursorMan.showMouse(true);
+ mainLoop(1);
+
+ delete renderer;
+ delete[] collisionPage;
+ } while (_restartRequested);
- delete renderer;
- delete[] collisionPage;
delete g_sound;
return Common::kNoError;
@@ -186,7 +193,7 @@ void CineEngine::initialize() {
currentDatName[0] = 0;
_preLoad = false;
- if (ConfMan.hasKey("save_slot")) {
+ if (ConfMan.hasKey("save_slot") && !_restartRequested) {
char saveNameBuffer[256];
sprintf(saveNameBuffer, "%s.%1d", _targetName.c_str(), ConfMan.getInt("save_slot"));
diff --git a/engines/cine/cine.h b/engines/cine/cine.h
index 77d4866363..6f7b409ad7 100644
--- a/engines/cine/cine.h
+++ b/engines/cine/cine.h
@@ -134,6 +134,8 @@ public:
StringPtrHashMap _volumeEntriesMap;
TextHandler _textHandler;
+ bool _restartRequested;
+
private:
void initialize();
void resetEngine();
diff --git a/engines/cine/main_loop.cpp b/engines/cine/main_loop.cpp
index 47cade105c..414aed394c 100644
--- a/engines/cine/main_loop.cpp
+++ b/engines/cine/main_loop.cpp
@@ -422,7 +422,7 @@ void CineEngine::mainLoop(int bootScriptIdx) {
manageEvents();
- } while (!shouldQuit() && _danKeysPressed != 7);
+ } while (!shouldQuit() && !_restartRequested);
hideMouse();
g_sound->stopMusic();
diff --git a/engines/cine/various.cpp b/engines/cine/various.cpp
index 6e4637e0ca..9a10c2b5d7 100644
--- a/engines/cine/various.cpp
+++ b/engines/cine/various.cpp
@@ -78,7 +78,6 @@ uint16 waitForPlayerClick;
uint16 menuCommandLen;
bool _paletteNeedUpdate;
uint16 _messageLen;
-byte _danKeysPressed;
int16 playerCommand;
@@ -375,7 +374,7 @@ void CineEngine::makeSystemMenu() {
{
getMouseData(mouseUpdateStatus, (uint16 *)&mouseButton, (uint16 *)&mouseX, (uint16 *)&mouseY);
if (!makeMenuChoice(confirmMenu, 2, mouseX, mouseY + 8, 100)) {
- //reinitEngine();
+ _restartRequested = true;
}
break;
}
diff --git a/engines/cine/various.h b/engines/cine/various.h
index d07fc73b13..3f362b1ad6 100644
--- a/engines/cine/various.h
+++ b/engines/cine/various.h
@@ -92,7 +92,6 @@ extern uint16 waitForPlayerClick;
extern uint16 menuCommandLen;
extern bool _paletteNeedUpdate;
extern uint16 _messageLen;
-extern byte _danKeysPressed;
extern int16 playerCommand;