diff options
author | Christopher Page | 2008-07-13 22:00:39 +0000 |
---|---|---|
committer | Christopher Page | 2008-07-13 22:00:39 +0000 |
commit | 796e606971cf20aabd1fd8fdbc31d2210b7a5a3b (patch) | |
tree | 9d501a9b2e37f2925af6aee88134263455adc2a1 /engines/sword2 | |
parent | e7d7f8df95fc45c9fedb5238e6634080cb8f49cf (diff) | |
download | scummvm-rg350-796e606971cf20aabd1fd8fdbc31d2210b7a5a3b.tar.gz scummvm-rg350-796e606971cf20aabd1fd8fdbc31d2210b7a5a3b.tar.bz2 scummvm-rg350-796e606971cf20aabd1fd8fdbc31d2210b7a5a3b.zip |
SWORD2 works with the new GMM implementation
svn-id: r33044
Diffstat (limited to 'engines/sword2')
-rw-r--r-- | engines/sword2/animation.cpp | 3 | ||||
-rw-r--r-- | engines/sword2/controls.cpp | 8 | ||||
-rw-r--r-- | engines/sword2/function.cpp | 2 | ||||
-rw-r--r-- | engines/sword2/palette.cpp | 2 | ||||
-rw-r--r-- | engines/sword2/resman.cpp | 2 | ||||
-rw-r--r-- | engines/sword2/screen.cpp | 8 | ||||
-rw-r--r-- | engines/sword2/sword2.cpp | 13 | ||||
-rw-r--r-- | engines/sword2/sword2.h | 1 |
8 files changed, 15 insertions, 24 deletions
diff --git a/engines/sword2/animation.cpp b/engines/sword2/animation.cpp index 48196a2f7d..47b71f4a33 100644 --- a/engines/sword2/animation.cpp +++ b/engines/sword2/animation.cpp @@ -358,7 +358,6 @@ bool MoviePlayer::userInterrupt() { handleScreenChanged(); break; case Common::EVENT_QUIT: - _vm->closeGame(); terminate = true; break; case Common::EVENT_KEYDOWN: @@ -379,7 +378,7 @@ void MoviePlayer::play(SequenceTextInfo *textList, uint32 numLines, int32 leadIn bool startNextText = false; // This happens if the user quits during the "eye" cutscene. - if (_vm->_quit) + if (_vm->quit()) return; _numSpeechLines = numLines; diff --git a/engines/sword2/controls.cpp b/engines/sword2/controls.cpp index 6b466d6be0..dcacbc78d4 100644 --- a/engines/sword2/controls.cpp +++ b/engines/sword2/controls.cpp @@ -396,7 +396,7 @@ int Dialog::runModal() { _vm->_system->delayMillis(20); - if (_vm->_quit) + if (_vm->quit()) setResult(0); } @@ -842,7 +842,7 @@ int StartDialog::runModal() { if (startDialog.runModal()) return 1; - if (_vm->_quit) + if (_vm->quit()) return 0; RestoreDialog restoreDialog(_vm); @@ -850,7 +850,7 @@ int StartDialog::runModal() { if (restoreDialog.runModal()) return 0; - if (_vm->_quit) + if (_vm->quit()) return 0; } @@ -882,7 +882,7 @@ int QuitDialog::runModal() { int result = MiniDialog::runModal(); if (result) - _vm->closeGame(); + _vm->quitGame(); return result; } diff --git a/engines/sword2/function.cpp b/engines/sword2/function.cpp index 84a5b5af76..31b799386f 100644 --- a/engines/sword2/function.cpp +++ b/engines/sword2/function.cpp @@ -2388,7 +2388,7 @@ int32 Logic::fnPlayCredits(int32 *params) { // params: none if (readVar(DEMO)) { - _vm->closeGame(); + _vm->quitGame(); return IR_STOP; } diff --git a/engines/sword2/palette.cpp b/engines/sword2/palette.cpp index 81f93c77ae..b66a3c9a81 100644 --- a/engines/sword2/palette.cpp +++ b/engines/sword2/palette.cpp @@ -212,7 +212,7 @@ uint8 Screen::getFadeStatus() { } void Screen::waitForFade() { - while (getFadeStatus() != RDFADE_NONE && getFadeStatus() != RDFADE_BLACK && !_vm->_quit) { + while (getFadeStatus() != RDFADE_NONE && getFadeStatus() != RDFADE_BLACK && !_vm->quit()) { updateDisplay(); _vm->_system->delayMillis(20); } diff --git a/engines/sword2/resman.cpp b/engines/sword2/resman.cpp index d6b8025cda..04205e8d0e 100644 --- a/engines/sword2/resman.cpp +++ b/engines/sword2/resman.cpp @@ -413,7 +413,7 @@ Common::File *ResourceManager::openCluFile(uint16 fileNum) { // quit while the game is asking for the user to insert a CD. // But recovering from this situation gracefully is just too // much trouble, so quit now. - if (_vm->_quit) + if (_vm->quit()) g_system->quit(); // If the file is supposed to be on hard disk, or we're diff --git a/engines/sword2/screen.cpp b/engines/sword2/screen.cpp index fdabb3ee6f..b2fcc45c9c 100644 --- a/engines/sword2/screen.cpp +++ b/engines/sword2/screen.cpp @@ -389,7 +389,7 @@ void Screen::displayMsg(byte *text, int time) { uint32 targetTime = _vm->getMillis() + (time * 1000); _vm->sleepUntil(targetTime); } else { - while (!_vm->_quit) { + while (!_vm->quit()) { MouseEvent *me = _vm->mouseEvent(); if (me && (me->buttons & (RD_LEFTBUTTONDOWN | RD_RIGHTBUTTONDOWN))) break; @@ -1035,7 +1035,7 @@ void Screen::rollCredits() { uint32 musicLength = MAX((int32)(1000 * (_vm->_sound->musicTimeRemaining() - 3)), 25 * (int32)scrollSteps); - while (scrollPos < scrollSteps && !_vm->_quit) { + while (scrollPos < scrollSteps && !_vm->quit()) { clearScene(); for (i = startLine; i < lineCount; i++) { @@ -1123,13 +1123,13 @@ void Screen::rollCredits() { // The music should either have stopped or be about to stop, so // wait for it to really happen. - while (_vm->_sound->musicTimeRemaining() && !_vm->_quit) { + while (_vm->_sound->musicTimeRemaining() && !_vm->quit()) { updateDisplay(false); _vm->_system->delayMillis(100); } } - if (_vm->_quit) + if (_vm->quit()) return; waitForFade(); diff --git a/engines/sword2/sword2.cpp b/engines/sword2/sword2.cpp index dc52bc5630..fc0da92248 100644 --- a/engines/sword2/sword2.cpp +++ b/engines/sword2/sword2.cpp @@ -370,7 +370,7 @@ int Sword2Engine::init() { // player will kill the music for us. Otherwise, the restore // will either have killed the music, or done a crossfade. - if (_quit) + if (quit()) return 0; if (result) @@ -442,7 +442,7 @@ int Sword2Engine::go() { // because we want the break to happen before updating the // screen again. - if (_quit) + if (quit()) break; // creates the debug text blocks @@ -459,11 +459,7 @@ int Sword2Engine::go() { #endif } - return _rtl; -} - -void Sword2Engine::closeGame() { - _quit = true; + return _eventMan->shouldRTL(); } void Sword2Engine::restartGame() { @@ -609,9 +605,6 @@ void Sword2Engine::parseInputEvents() { _mouseEvent.buttons = RD_WHEELDOWN; } break; - case Common::EVENT_QUIT: - closeGame(); - break; default: break; } diff --git a/engines/sword2/sword2.h b/engines/sword2/sword2.h index 15923cf822..9b589c347e 100644 --- a/engines/sword2/sword2.h +++ b/engines/sword2/sword2.h @@ -208,7 +208,6 @@ public: void startGame(); void gameCycle(); - void closeGame(); void restartGame(); void sleepUntil(uint32 time); |