[Scummvm-cvs-logs] SF.net SVN: scummvm:[36301] scummvm/branches/branch-0-13-0/engines/agi
thebluegr at users.sourceforge.net
thebluegr at users.sourceforge.net
Fri Feb 13 12:45:12 CET 2009
Revision: 36301
http://scummvm.svn.sourceforge.net/scummvm/?rev=36301&view=rev
Author: thebluegr
Date: 2009-02-13 11:45:12 +0000 (Fri, 13 Feb 2009)
Log Message:
-----------
(backport of #36279) Fix for bug #2541237 - "AGI: Restart quits ScummVM"
Modified Paths:
--------------
scummvm/branches/branch-0-13-0/engines/agi/agi.cpp
scummvm/branches/branch-0-13-0/engines/agi/agi.h
scummvm/branches/branch-0-13-0/engines/agi/cycle.cpp
scummvm/branches/branch-0-13-0/engines/agi/keyboard.cpp
scummvm/branches/branch-0-13-0/engines/agi/op_cmd.cpp
scummvm/branches/branch-0-13-0/engines/agi/op_test.cpp
scummvm/branches/branch-0-13-0/engines/agi/saveload.cpp
scummvm/branches/branch-0-13-0/engines/agi/text.cpp
Property Changed:
----------------
scummvm/branches/branch-0-13-0/engines/agi/
Property changes on: scummvm/branches/branch-0-13-0/engines/agi
___________________________________________________________________
Added: svn:mergeinfo
+ /scummvm/trunk/engines/agi:36279
Modified: scummvm/branches/branch-0-13-0/engines/agi/agi.cpp
===================================================================
--- scummvm/branches/branch-0-13-0/engines/agi/agi.cpp 2009-02-13 10:06:27 UTC (rev 36300)
+++ scummvm/branches/branch-0-13-0/engines/agi/agi.cpp 2009-02-13 11:45:12 UTC (rev 36301)
@@ -382,6 +382,8 @@
initWords();
+ restartGame = false;
+
if (!_menu)
_menu = new Menu(this, _gfx, _picture);
Modified: scummvm/branches/branch-0-13-0/engines/agi/agi.h
===================================================================
--- scummvm/branches/branch-0-13-0/engines/agi/agi.h 2009-02-13 10:06:27 UTC (rev 36300)
+++ scummvm/branches/branch-0-13-0/engines/agi/agi.h 2009-02-13 11:45:12 UTC (rev 36301)
@@ -165,7 +165,6 @@
errNotEnoughMemory,
errBadResource,
errUnknownAGIVersion,
- errRestartGame,
errNoLoopsInView,
errViewDataError,
errNoGameList,
@@ -799,6 +798,7 @@
uint8 *_intobj;
int _oldMode;
+ bool restartGame;
Menu* _menu;
Modified: scummvm/branches/branch-0-13-0/engines/agi/cycle.cpp
===================================================================
--- scummvm/branches/branch-0-13-0/engines/agi/cycle.cpp 2009-02-13 10:06:27 UTC (rev 36300)
+++ scummvm/branches/branch-0-13-0/engines/agi/cycle.cpp 2009-02-13 11:45:12 UTC (rev 36301)
@@ -115,7 +115,7 @@
oldSound = getflag(fSoundOn);
_game.exitAllLogics = false;
- while (runLogic(0) == 0 && !shouldQuit()) {
+ while (runLogic(0) == 0 && !(shouldQuit() || restartGame)) {
_game.vars[vWordNotFound] = 0;
_game.vars[vBorderTouchObj] = 0;
_game.vars[vBorderCode] = 0;
@@ -361,16 +361,11 @@
_game.vars[vKey] = 0;
}
- // FIXME: This has been broken with the merge of the RTL GSoC project. shouldQuit() returns a boolean, and we're trying to
- // check it against 0xff, which is never going to be true
- //if (shouldQuit() == 0xff)
- // ec = errRestartGame;
-
if (shouldPerformAutoSave(_lastSaveTime)) {
saveGame(getSavegameFilename(0), "Autosave");
}
- } while (shouldQuit() == 0);
+ } while (!(shouldQuit() || restartGame));
_sound->stopSound();
@@ -390,8 +385,11 @@
if (agiInit() != errOK)
break;
- if (ec == errRestartGame)
+
+ if (restartGame) {
setflag(fRestartGame, true);
+ restartGame = false;
+ }
// Set computer type (v20 i.e. vComputer)
switch (getPlatform()) {
@@ -444,7 +442,7 @@
ec = playGame();
_game.state = STATE_LOADED;
agiDeinit();
- } while (ec == errRestartGame);
+ } while (restartGame);
delete _menu;
_menu = NULL;
Modified: scummvm/branches/branch-0-13-0/engines/agi/keyboard.cpp
===================================================================
--- scummvm/branches/branch-0-13-0/engines/agi/keyboard.cpp 2009-02-13 10:06:27 UTC (rev 36300)
+++ scummvm/branches/branch-0-13-0/engines/agi/keyboard.cpp 2009-02-13 11:45:12 UTC (rev 36301)
@@ -373,7 +373,7 @@
}
debugC(3, kDebugLevelInput, "waiting...");
- while (!shouldQuit()) {
+ while (!(shouldQuit() || restartGame)) {
_gfx->pollTimer(); /* msdos driver -> does nothing */
key = doPollKeyboard();
if (key == KEY_ENTER || key == KEY_ESCAPE || key == BUTTON_LEFT)
@@ -396,7 +396,7 @@
}
debugC(3, kDebugLevelInput, "waiting...");
- while (!shouldQuit()) {
+ while (!(shouldQuit() || restartGame)) {
_gfx->pollTimer(); /* msdos driver -> does nothing */
key = doPollKeyboard();
if (key)
Modified: scummvm/branches/branch-0-13-0/engines/agi/op_cmd.cpp
===================================================================
--- scummvm/branches/branch-0-13-0/engines/agi/op_cmd.cpp 2009-02-13 10:06:27 UTC (rev 36300)
+++ scummvm/branches/branch-0-13-0/engines/agi/op_cmd.cpp 2009-02-13 11:45:12 UTC (rev 36301)
@@ -1231,7 +1231,7 @@
g_agi->selectionBox(" Restart game, or continue? \n\n\n", buttons);
if (sel == 0) {
- g_agi->quitGame();
+ g_agi->restartGame = true;
g_agi->setflag(fRestartGame, true);
g_agi->_menu->enableAll();
}
@@ -1331,7 +1331,7 @@
do {
g_agi->mainCycle();
- } while (game.inputMode == INPUT_GETSTRING && !g_agi->shouldQuit());
+ } while (game.inputMode == INPUT_GETSTRING && !(g_agi->shouldQuit() || g_agi->restartGame));
}
cmd(get_num) {
@@ -1349,7 +1349,7 @@
do {
g_agi->mainCycle();
- } while (game.inputMode == INPUT_GETSTRING && !g_agi->shouldQuit());
+ } while (game.inputMode == INPUT_GETSTRING && !(g_agi->shouldQuit() || g_agi->restartGame));
_v[p1] = atoi(game.strings[MAX_STRINGS]);
debugC(4, kDebugLevelScripts, "[%s] -> %d", game.strings[MAX_STRINGS], _v[p1]);
@@ -1745,7 +1745,7 @@
curLogic->cIP = curLogic->sIP;
timerHack = 0;
- while (ip < _game.logics[n].size && !shouldQuit()) {
+ while (ip < _game.logics[n].size && !(shouldQuit() || restartGame)) {
if (_debug.enabled) {
if (_debug.steps > 0) {
if (_debug.logic0 || n) {
Modified: scummvm/branches/branch-0-13-0/engines/agi/op_test.cpp
===================================================================
--- scummvm/branches/branch-0-13-0/engines/agi/op_test.cpp 2009-02-13 10:06:27 UTC (rev 36300)
+++ scummvm/branches/branch-0-13-0/engines/agi/op_test.cpp 2009-02-13 11:45:12 UTC (rev 36301)
@@ -231,7 +231,7 @@
uint8 p[16] = { 0 };
bool end_test = false;
- while (retval && !shouldQuit() && !end_test) {
+ while (retval && !(shouldQuit() || restartGame) && !end_test) {
if (_debug.enabled && (_debug.logic0 || lognum))
debugConsole(lognum, lTEST_MODE, NULL);
Modified: scummvm/branches/branch-0-13-0/engines/agi/saveload.cpp
===================================================================
--- scummvm/branches/branch-0-13-0/engines/agi/saveload.cpp 2009-02-13 10:06:27 UTC (rev 36300)
+++ scummvm/branches/branch-0-13-0/engines/agi/saveload.cpp 2009-02-13 11:45:12 UTC (rev 36301)
@@ -566,7 +566,7 @@
int oldFirstSlot = _firstSlot + 1;
int oldActive = active + 1;
- while (!shouldQuit()) {
+ while (!(shouldQuit() || restartGame)) {
int sbPos = 0;
// Use the extreme scrollbar positions only if the extreme
Modified: scummvm/branches/branch-0-13-0/engines/agi/text.cpp
===================================================================
--- scummvm/branches/branch-0-13-0/engines/agi/text.cpp 2009-02-13 10:06:27 UTC (rev 36300)
+++ scummvm/branches/branch-0-13-0/engines/agi/text.cpp 2009-02-13 11:45:12 UTC (rev 36301)
@@ -376,7 +376,7 @@
AllowSyntheticEvents on(this);
debugC(4, kDebugLevelText, "selectionBox(): waiting...");
- while (!shouldQuit()) {
+ while (!(shouldQuit() || restartGame)) {
for (i = 0; b[i]; i++)
_gfx->drawCurrentStyleButton(bx[i], by[i], b[i], i == active, false, i == 0);
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
More information about the Scummvm-git-logs
mailing list