aboutsummaryrefslogtreecommitdiff
path: root/engines/agi
diff options
context:
space:
mode:
Diffstat (limited to 'engines/agi')
-rw-r--r--engines/agi/agi.cpp4
-rw-r--r--engines/agi/agi.h2
-rw-r--r--engines/agi/cycle.cpp10
-rw-r--r--engines/agi/keyboard.cpp4
-rw-r--r--engines/agi/op_cmd.cpp8
-rw-r--r--engines/agi/op_test.cpp2
-rw-r--r--engines/agi/saveload.cpp2
-rw-r--r--engines/agi/text.cpp2
8 files changed, 17 insertions, 17 deletions
diff --git a/engines/agi/agi.cpp b/engines/agi/agi.cpp
index 9b3e335238..7c908eb56b 100644
--- a/engines/agi/agi.cpp
+++ b/engines/agi/agi.cpp
@@ -394,8 +394,6 @@ int AgiEngine::agiInit() {
initWords();
- restartGame = false;
-
if (!_menu)
_menu = new Menu(this, _gfx, _picture);
@@ -679,6 +677,8 @@ AgiEngine::AgiEngine(OSystem *syst, const AGIGameDescription *gameDesc) : AgiBas
_objects = NULL;
+ _restartGame = false;
+
_oldMode = -1;
_predictiveDialogRunning = false;
diff --git a/engines/agi/agi.h b/engines/agi/agi.h
index f22c4ade58..01925d3491 100644
--- a/engines/agi/agi.h
+++ b/engines/agi/agi.h
@@ -808,7 +808,7 @@ public:
uint8 *_intobj;
int _oldMode;
- bool restartGame;
+ bool _restartGame;
Menu* _menu;
diff --git a/engines/agi/cycle.cpp b/engines/agi/cycle.cpp
index 09df39248f..92efbfebb5 100644
--- a/engines/agi/cycle.cpp
+++ b/engines/agi/cycle.cpp
@@ -120,7 +120,7 @@ void AgiEngine::interpretCycle() {
oldSound = getflag(fSoundOn);
_game.exitAllLogics = false;
- while (runLogic(0) == 0 && !(shouldQuit() || restartGame)) {
+ while (runLogic(0) == 0 && !(shouldQuit() || _restartGame)) {
_game.vars[vWordNotFound] = 0;
_game.vars[vBorderTouchObj] = 0;
_game.vars[vBorderCode] = 0;
@@ -369,7 +369,7 @@ int AgiEngine::playGame() {
saveGame(getSavegameFilename(0), "Autosave");
}
- } while (!(shouldQuit() || restartGame));
+ } while (!(shouldQuit() || _restartGame));
_sound->stopSound();
@@ -390,9 +390,9 @@ int AgiEngine::runGame() {
if (agiInit() != errOK)
break;
- if (restartGame) {
+ if (_restartGame) {
setflag(fRestartGame, true);
- restartGame = false;
+ _restartGame = false;
}
// Set computer type (v20 i.e. vComputer)
@@ -446,7 +446,7 @@ int AgiEngine::runGame() {
ec = playGame();
_game.state = STATE_LOADED;
agiDeinit();
- } while (restartGame);
+ } while (_restartGame);
delete _menu;
_menu = NULL;
diff --git a/engines/agi/keyboard.cpp b/engines/agi/keyboard.cpp
index b498466442..bc30224918 100644
--- a/engines/agi/keyboard.cpp
+++ b/engines/agi/keyboard.cpp
@@ -385,7 +385,7 @@ int AgiEngine::waitKey() {
}
debugC(3, kDebugLevelInput, "waiting...");
- while (!(shouldQuit() || restartGame || getflag(fRestoreJustRan))) {
+ while (!(shouldQuit() || _restartGame || getflag(fRestoreJustRan))) {
_gfx->pollTimer(); // msdos driver -> does nothing
key = doPollKeyboard();
if (key == KEY_ENTER || key == KEY_ESCAPE || key == BUTTON_LEFT)
@@ -408,7 +408,7 @@ int AgiEngine::waitAnyKey() {
}
debugC(3, kDebugLevelInput, "waiting... (any key)");
- while (!(shouldQuit() || restartGame)) {
+ while (!(shouldQuit() || _restartGame)) {
_gfx->pollTimer(); // msdos driver -> does nothing
key = doPollKeyboard();
if (key)
diff --git a/engines/agi/op_cmd.cpp b/engines/agi/op_cmd.cpp
index 07078100a8..a0824c850d 100644
--- a/engines/agi/op_cmd.cpp
+++ b/engines/agi/op_cmd.cpp
@@ -1242,7 +1242,7 @@ cmd(restart_game) {
g_agi->selectionBox(" Restart game, or continue? \n\n\n", buttons);
if (sel == 0) {
- g_agi->restartGame = true;
+ g_agi->_restartGame = true;
g_agi->setflag(fRestartGame, true);
g_agi->_menu->enableAll();
}
@@ -1346,7 +1346,7 @@ cmd(get_string) {
do {
g_agi->mainCycle();
- } while (game.inputMode == INPUT_GETSTRING && !(g_agi->shouldQuit() || g_agi->restartGame));
+ } while (game.inputMode == INPUT_GETSTRING && !(g_agi->shouldQuit() || g_agi->_restartGame));
}
cmd(get_num) {
@@ -1366,7 +1366,7 @@ cmd(get_num) {
do {
g_agi->mainCycle();
- } while (game.inputMode == INPUT_GETSTRING && !(g_agi->shouldQuit() || g_agi->restartGame));
+ } while (game.inputMode == INPUT_GETSTRING && !(g_agi->shouldQuit() || g_agi->_restartGame));
_v[p1] = atoi(game.strings[MAX_STRINGS]);
@@ -1770,7 +1770,7 @@ int AgiEngine::runLogic(int n) {
curLogic->cIP = curLogic->sIP;
timerHack = 0;
- while (ip < _game.logics[n].size && !(shouldQuit() || restartGame)) {
+ while (ip < _game.logics[n].size && !(shouldQuit() || _restartGame)) {
if (_debug.enabled) {
if (_debug.steps > 0) {
if (_debug.logic0 || n) {
diff --git a/engines/agi/op_test.cpp b/engines/agi/op_test.cpp
index 9c18bf705c..952d66278c 100644
--- a/engines/agi/op_test.cpp
+++ b/engines/agi/op_test.cpp
@@ -230,7 +230,7 @@ int AgiEngine::testIfCode(int lognum) {
uint8 p[16] = { 0 };
bool end_test = false;
- while (retval && !(shouldQuit() || restartGame) && !end_test) {
+ while (retval && !(shouldQuit() || _restartGame) && !end_test) {
if (_debug.enabled && (_debug.logic0 || lognum))
debugConsole(lognum, lTEST_MODE, NULL);
diff --git a/engines/agi/saveload.cpp b/engines/agi/saveload.cpp
index 6a6281e88c..e4cf4afd2c 100644
--- a/engines/agi/saveload.cpp
+++ b/engines/agi/saveload.cpp
@@ -574,7 +574,7 @@ int AgiEngine::selectSlot() {
int oldFirstSlot = _firstSlot + 1;
int oldActive = active + 1;
- while (!(shouldQuit() || restartGame)) {
+ while (!(shouldQuit() || _restartGame)) {
int sbPos = 0;
// Use the extreme scrollbar positions only if the extreme
diff --git a/engines/agi/text.cpp b/engines/agi/text.cpp
index dad1add53a..1383419b24 100644
--- a/engines/agi/text.cpp
+++ b/engines/agi/text.cpp
@@ -379,7 +379,7 @@ int AgiEngine::selectionBox(const char *m, const char **b) {
AllowSyntheticEvents on(this);
debugC(4, kDebugLevelText, "selectionBox(): waiting...");
- while (!(shouldQuit() || restartGame)) {
+ while (!(shouldQuit() || _restartGame)) {
for (i = 0; b[i]; i++)
_gfx->drawCurrentStyleButton(bx[i], by[i], b[i], i == active, false, i == 0);