diff options
author | Christopher Page | 2008-06-24 21:15:30 +0000 |
---|---|---|
committer | Christopher Page | 2008-06-24 21:15:30 +0000 |
commit | f878820bbee1e7e4659ca601872674082334fa63 (patch) | |
tree | d1b05985a2b1758e8648fe86a64a5ef2562f1765 /engines/agi | |
parent | 65abece4c67c4fb574caac717fff24bfb5f31d69 (diff) | |
download | scummvm-rg350-f878820bbee1e7e4659ca601872674082334fa63.tar.gz scummvm-rg350-f878820bbee1e7e4659ca601872674082334fa63.tar.bz2 scummvm-rg350-f878820bbee1e7e4659ca601872674082334fa63.zip |
Created Global Main Menu Dialog. Made a uniform _quit flag for engines. So far agi, agos, and cine are now using the new _quit flag.
svn-id: r32770
Diffstat (limited to 'engines/agi')
-rw-r--r-- | engines/agi/agi.cpp | 4 | ||||
-rw-r--r-- | engines/agi/agi.h | 1 | ||||
-rw-r--r-- | engines/agi/cycle.cpp | 7 | ||||
-rw-r--r-- | engines/agi/op_cmd.cpp | 8 | ||||
-rw-r--r-- | engines/agi/op_test.cpp | 2 | ||||
-rw-r--r-- | engines/agi/saveload.cpp | 4 |
6 files changed, 12 insertions, 14 deletions
diff --git a/engines/agi/agi.cpp b/engines/agi/agi.cpp index 9d88dd73ef..3619b08c9d 100644 --- a/engines/agi/agi.cpp +++ b/engines/agi/agi.cpp @@ -62,7 +62,7 @@ void AgiEngine::processEvents() { while (_eventMan->pollEvent(event)) { switch (event.type) { case Common::EVENT_QUIT: - _game.quitProgNow = true; + _quit = true; break; case Common::EVENT_PREDICTIVE_DIALOG: if (_predictiveDialogRunning) @@ -809,7 +809,7 @@ int AgiEngine::go() { runGame(); - return 0; + return _rtl; } } // End of namespace Agi diff --git a/engines/agi/agi.h b/engines/agi/agi.h index 9240d562af..9f12ccd57c 100644 --- a/engines/agi/agi.h +++ b/engines/agi/agi.h @@ -530,7 +530,6 @@ struct AgiGame { /* internal flags */ int playerControl; /**< player is in control */ - int quitProgNow; /**< quit now */ int statusLine; /**< status line on/off */ int clockEnabled; /**< clock is on/off */ int exitAllLogics; /**< break cycle after new.room */ diff --git a/engines/agi/cycle.cpp b/engines/agi/cycle.cpp index e0babdf926..dc0e50cff2 100644 --- a/engines/agi/cycle.cpp +++ b/engines/agi/cycle.cpp @@ -116,7 +116,7 @@ void AgiEngine::interpretCycle() { oldSound = getflag(fSoundOn); _game.exitAllLogics = false; - while (runLogic(0) == 0 && !_game.quitProgNow) { + while (runLogic(0) == 0 && !_quit) { _game.vars[vWordNotFound] = 0; _game.vars[vBorderTouchObj] = 0; _game.vars[vBorderCode] = 0; @@ -314,7 +314,6 @@ int AgiEngine::playGame() { setvar(vTimeDelay, 2); /* "normal" speed */ _game.gfxMode = true; - _game.quitProgNow = false; _game.clockEnabled = true; _game.lineUserInput = 22; @@ -354,10 +353,10 @@ int AgiEngine::playGame() { _game.vars[vKey] = 0; } - if (_game.quitProgNow == 0xff) + if (_quit == 0xff) ec = errRestartGame; - } while (_game.quitProgNow == 0); + } while (_quit == 0); _sound->stopSound(); diff --git a/engines/agi/op_cmd.cpp b/engines/agi/op_cmd.cpp index 7ecedfbc8c..e3629699ca 100644 --- a/engines/agi/op_cmd.cpp +++ b/engines/agi/op_cmd.cpp @@ -1213,11 +1213,11 @@ cmd(quit) { g_sound->stopSound(); if (p0) { - game.quitProgNow = true; + g_agi->_quit = true; } else { if (g_agi->selectionBox (" Quit the game, or continue? \n\n\n", buttons) == 0) { - game.quitProgNow = true; + g_agi->_quit = true; } } } @@ -1231,7 +1231,7 @@ cmd(restart_game) { g_agi->selectionBox(" Restart game, or continue? \n\n\n", buttons); if (sel == 0) { - game.quitProgNow = 0xff; + g_agi->_quit = 0xff; g_agi->setflag(fRestartGame, true); g_agi->_menu->enableAll(); } @@ -1739,7 +1739,7 @@ int AgiEngine::runLogic(int n) { curLogic->cIP = curLogic->sIP; timerHack = 0; - while (ip < _game.logics[n].size && !_game.quitProgNow) { + while (ip < _game.logics[n].size && !g_agi->_quit) { 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 7ba3e625bf..098a7730a7 100644 --- a/engines/agi/op_test.cpp +++ b/engines/agi/op_test.cpp @@ -232,7 +232,7 @@ int AgiEngine::testIfCode(int lognum) { uint8 p[16] = { 0 }; bool end_test = false; - while (retval && !game.quitProgNow && !end_test) { + while (retval && !_quit && !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 db7bba13e4..5dc2523424 100644 --- a/engines/agi/saveload.cpp +++ b/engines/agi/saveload.cpp @@ -91,7 +91,7 @@ int AgiEngine::saveGame(const char *fileName, const char *description) { out->writeSint16BE((int16)_game.lognum); out->writeSint16BE((int16)_game.playerControl); - out->writeSint16BE((int16)_game.quitProgNow); + out->writeSint16BE((int16)_quit); out->writeSint16BE((int16)_game.statusLine); out->writeSint16BE((int16)_game.clockEnabled); out->writeSint16BE((int16)_game.exitAllLogics); @@ -281,7 +281,7 @@ int AgiEngine::loadGame(const char *fileName, bool checkId) { _game.lognum = in->readSint16BE(); _game.playerControl = in->readSint16BE(); - _game.quitProgNow = in->readSint16BE(); + _quit = in->readSint16BE(); _game.statusLine = in->readSint16BE(); _game.clockEnabled = in->readSint16BE(); _game.exitAllLogics = in->readSint16BE(); |