[Scummvm-cvs-logs] SF.net SVN: scummvm: [32772] scummvm/branches/gsoc2008-rtl/engines
cpage88 at users.sourceforge.net
cpage88 at users.sourceforge.net
Wed Jun 25 02:55:19 CEST 2008
Revision: 32772
http://scummvm.svn.sourceforge.net/scummvm/?rev=32772&view=rev
Author: cpage88
Date: 2008-06-24 17:55:18 -0700 (Tue, 24 Jun 2008)
Log Message:
-----------
Kyra and Lure are now using the new _quit flag
Modified Paths:
--------------
scummvm/branches/gsoc2008-rtl/engines/kyra/gui_hof.cpp
scummvm/branches/gsoc2008-rtl/engines/kyra/gui_lok.cpp
scummvm/branches/gsoc2008-rtl/engines/kyra/gui_mr.cpp
scummvm/branches/gsoc2008-rtl/engines/kyra/gui_v2.cpp
scummvm/branches/gsoc2008-rtl/engines/kyra/kyra_hof.cpp
scummvm/branches/gsoc2008-rtl/engines/kyra/kyra_lok.cpp
scummvm/branches/gsoc2008-rtl/engines/kyra/kyra_mr.cpp
scummvm/branches/gsoc2008-rtl/engines/kyra/kyra_v1.cpp
scummvm/branches/gsoc2008-rtl/engines/kyra/kyra_v1.h
scummvm/branches/gsoc2008-rtl/engines/kyra/kyra_v2.cpp
scummvm/branches/gsoc2008-rtl/engines/kyra/saveload.cpp
scummvm/branches/gsoc2008-rtl/engines/kyra/saveload_lok.cpp
scummvm/branches/gsoc2008-rtl/engines/kyra/scene_hof.cpp
scummvm/branches/gsoc2008-rtl/engines/kyra/scene_mr.cpp
scummvm/branches/gsoc2008-rtl/engines/kyra/script_mr.cpp
scummvm/branches/gsoc2008-rtl/engines/kyra/sequences_hof.cpp
scummvm/branches/gsoc2008-rtl/engines/kyra/sequences_lok.cpp
scummvm/branches/gsoc2008-rtl/engines/kyra/text_hof.cpp
scummvm/branches/gsoc2008-rtl/engines/kyra/text_mr.cpp
scummvm/branches/gsoc2008-rtl/engines/lure/events.cpp
scummvm/branches/gsoc2008-rtl/engines/lure/events.h
scummvm/branches/gsoc2008-rtl/engines/lure/fights.cpp
scummvm/branches/gsoc2008-rtl/engines/lure/game.cpp
scummvm/branches/gsoc2008-rtl/engines/lure/intro.cpp
scummvm/branches/gsoc2008-rtl/engines/lure/lure.cpp
scummvm/branches/gsoc2008-rtl/engines/lure/menu.cpp
scummvm/branches/gsoc2008-rtl/engines/lure/scripts.cpp
scummvm/branches/gsoc2008-rtl/engines/lure/surface.cpp
Modified: scummvm/branches/gsoc2008-rtl/engines/kyra/gui_hof.cpp
===================================================================
--- scummvm/branches/gsoc2008-rtl/engines/kyra/gui_hof.cpp 2008-06-24 23:19:23 UTC (rev 32771)
+++ scummvm/branches/gsoc2008-rtl/engines/kyra/gui_hof.cpp 2008-06-25 00:55:18 UTC (rev 32772)
@@ -500,7 +500,7 @@
showBookPage();
_bookShown = true;
- while (_bookShown && !_quitFlag) {
+ while (_bookShown && !_quit) {
checkInput(buttonList);
removeInputTop();
Modified: scummvm/branches/gsoc2008-rtl/engines/kyra/gui_lok.cpp
===================================================================
--- scummvm/branches/gsoc2008-rtl/engines/kyra/gui_lok.cpp 2008-06-24 23:19:23 UTC (rev 32771)
+++ scummvm/branches/gsoc2008-rtl/engines/kyra/gui_lok.cpp 2008-06-25 00:55:18 UTC (rev 32772)
@@ -459,7 +459,7 @@
updateAllMenuButtons();
}
- while (_displayMenu && !_vm->_quitFlag) {
+ while (_displayMenu && !_vm->_quit) {
Common::Point mouse = _vm->getMousePos();
processHighlights(_menu[_toplevelMenu], mouse.x, mouse.y);
processButtonList(_menuButtonList, 0, 0);
@@ -582,7 +582,7 @@
_displaySubMenu = true;
_cancelSubMenu = false;
- while (_displaySubMenu && !_vm->_quitFlag) {
+ while (_displaySubMenu && !_vm->_quit) {
getInput();
Common::Point mouse = _vm->getMousePos();
processHighlights(_menu[2], mouse.x, mouse.y);
@@ -631,7 +631,7 @@
_vm->_gameToLoad = -1;
- while (_displaySubMenu && !_vm->_quitFlag) {
+ while (_displaySubMenu && !_vm->_quit) {
getInput();
Common::Point mouse = _vm->getMousePos();
processHighlights(_menu[2], mouse.x, mouse.y);
@@ -719,7 +719,7 @@
}
redrawTextfield();
- while (_displaySubMenu && !_vm->_quitFlag) {
+ while (_displaySubMenu && !_vm->_quit) {
getInput();
updateSavegameString();
Common::Point mouse = _vm->getMousePos();
@@ -795,7 +795,7 @@
_displaySubMenu = true;
_cancelSubMenu = true;
- while (_displaySubMenu && !_vm->_quitFlag) {
+ while (_displaySubMenu && !_vm->_quit) {
getInput();
Common::Point mouse = _vm->getMousePos();
processHighlights(_menu[1], mouse.x, mouse.y);
@@ -861,7 +861,7 @@
_displaySubMenu = true;
_cancelSubMenu = false;
- while (_displaySubMenu && !_vm->_quitFlag) {
+ while (_displaySubMenu && !_vm->_quit) {
getInput();
Common::Point mouse = _vm->getMousePos();
processHighlights(_menu[5], mouse.x, mouse.y);
Modified: scummvm/branches/gsoc2008-rtl/engines/kyra/gui_mr.cpp
===================================================================
--- scummvm/branches/gsoc2008-rtl/engines/kyra/gui_mr.cpp 2008-06-24 23:19:23 UTC (rev 32771)
+++ scummvm/branches/gsoc2008-rtl/engines/kyra/gui_mr.cpp 2008-06-25 00:55:18 UTC (rev 32772)
@@ -868,7 +868,7 @@
albumNewPage();
_album.running = true;
- while (_album.running && !_quitFlag) {
+ while (_album.running && !_quit) {
updateInput();
checkInput(buttonList);
removeInputTop();
Modified: scummvm/branches/gsoc2008-rtl/engines/kyra/gui_v2.cpp
===================================================================
--- scummvm/branches/gsoc2008-rtl/engines/kyra/gui_v2.cpp 2008-06-24 23:19:23 UTC (rev 32771)
+++ scummvm/branches/gsoc2008-rtl/engines/kyra/gui_v2.cpp 2008-06-25 00:55:18 UTC (rev 32772)
@@ -822,12 +822,12 @@
while (_vm->_eventMan->pollEvent(event) && running) {
switch (event.type) {
case Common::EVENT_QUIT:
- _vm->_quitFlag = true;
+ _vm->_quit = true;
break;
case Common::EVENT_KEYDOWN:
if (event.kbd.keycode == 'q' && event.kbd.flags == Common::KBD_CTRL)
- _vm->_quitFlag = true;
+ _vm->_quit = true;
else
_keyPressed = event.kbd;
running = false;
Modified: scummvm/branches/gsoc2008-rtl/engines/kyra/kyra_hof.cpp
===================================================================
--- scummvm/branches/gsoc2008-rtl/engines/kyra/kyra_hof.cpp 2008-06-24 23:19:23 UTC (rev 32771)
+++ scummvm/branches/gsoc2008-rtl/engines/kyra/kyra_hof.cpp 2008-06-25 00:55:18 UTC (rev 32772)
@@ -311,7 +311,7 @@
seq_playSequences(kSequenceFunters, kSequenceFrash);
}
- return 0;
+ return _rtl;
}
void KyraEngine_HoF::startup() {
@@ -440,9 +440,9 @@
void KyraEngine_HoF::runLoop() {
_screen->updateScreen();
- _quitFlag = false;
+ _quit = false;
_runFlag = true;
- while (!_quitFlag && _runFlag) {
+ while (!_quit && _runFlag) {
if (_deathHandler >= 0) {
removeHandItem();
delay(5);
@@ -1603,7 +1603,7 @@
_invWsa.timer = _system->getMillis();
if (run) {
- while (_invWsa.running && !skipFlag() && !_quitFlag) {
+ while (_invWsa.running && !skipFlag() && !_quit) {
update();
_system->delayMillis(10);
}
@@ -1977,7 +1977,7 @@
return;
_tim->resetFinishedFlag();
- while (!_quitFlag && !_tim->finished()) {
+ while (!_quit && !_tim->finished()) {
_tim->exec(tim, 0);
if (_chatText)
updateWithText();
Modified: scummvm/branches/gsoc2008-rtl/engines/kyra/kyra_lok.cpp
===================================================================
--- scummvm/branches/gsoc2008-rtl/engines/kyra/kyra_lok.cpp 2008-06-24 23:19:23 UTC (rev 32771)
+++ scummvm/branches/gsoc2008-rtl/engines/kyra/kyra_lok.cpp 2008-06-25 00:55:18 UTC (rev 32772)
@@ -300,8 +300,8 @@
if (_gameToLoad == -1) {
setGameFlag(0xEF);
seq_intro();
- if (_quitFlag)
- return 0;
+ if (_quit)
+ return _rtl;
if (_skipIntroFlag && _abortIntroFlag)
resetGameFlag(0xEF);
}
@@ -309,7 +309,7 @@
resetGameFlag(0xEF);
mainLoop();
}
- return 0;
+ return _rtl;
}
@@ -399,7 +399,7 @@
void KyraEngine_LoK::mainLoop() {
debugC(9, kDebugLevelMain, "KyraEngine_LoK::mainLoop()");
- while (!_quitFlag) {
+ while (!_quit) {
int32 frameTime = (int32)_system->getMillis();
_skipFlag = false;
@@ -444,7 +444,7 @@
}
void KyraEngine_LoK::delayUntil(uint32 timestamp, bool updateTimers, bool update, bool isMainLoop) {
- while (_system->getMillis() < timestamp && !_quitFlag) {
+ while (_system->getMillis() < timestamp && !_quit) {
if (updateTimers)
_timer->update();
@@ -476,7 +476,7 @@
if (event.kbd.keycode == 'd')
_debugger->attach();
else if (event.kbd.keycode == 'q')
- _quitFlag = true;
+ _quit = true;
} else if (event.kbd.keycode == '.') {
_skipFlag = true;
} else if (event.kbd.keycode == Common::KEYCODE_RETURN || event.kbd.keycode == Common::KEYCODE_SPACE || event.kbd.keycode == Common::KEYCODE_ESCAPE) {
@@ -529,19 +529,19 @@
if (_skipFlag && !_abortIntroFlag && !queryGameFlag(0xFE))
_skipFlag = false;
- if (amount > 0 && !_skipFlag && !_quitFlag)
+ if (amount > 0 && !_skipFlag && !_quit)
_system->delayMillis(10);
if (_skipFlag)
_sound->voiceStop();
- } while (!_skipFlag && _system->getMillis() < start + amount && !_quitFlag);
+ } while (!_skipFlag && _system->getMillis() < start + amount && !_quit);
}
void KyraEngine_LoK::waitForEvent() {
bool finished = false;
Common::Event event;
- while (!finished && !_quitFlag) {
+ while (!finished && !_quit) {
while (_eventMan->pollEvent(event)) {
switch (event.type) {
case Common::EVENT_KEYDOWN:
Modified: scummvm/branches/gsoc2008-rtl/engines/kyra/kyra_mr.cpp
===================================================================
--- scummvm/branches/gsoc2008-rtl/engines/kyra/kyra_mr.cpp 2008-06-24 23:19:23 UTC (rev 32771)
+++ scummvm/branches/gsoc2008-rtl/engines/kyra/kyra_mr.cpp 2008-06-25 00:55:18 UTC (rev 32772)
@@ -263,7 +263,7 @@
running = false;
}
- while (running && !_quitFlag) {
+ while (running && !_quit) {
_screen->_curPage = 0;
_screen->clearPage(0);
@@ -272,14 +272,14 @@
// XXX
playMenuAudioFile();
- for (int i = 0; i < 64 && !_quitFlag; ++i) {
+ for (int i = 0; i < 64 && !_quit; ++i) {
uint32 nextRun = _system->getMillis() + 3 * _tickLength;
_menuAnim->displayFrame(i, 0);
_screen->updateScreen();
delayUntil(nextRun);
}
- for (int i = 64; i > 29 && !_quitFlag; --i) {
+ for (int i = 64; i > 29 && !_quit; --i) {
uint32 nextRun = _system->getMillis() + 3 * _tickLength;
_menuAnim->displayFrame(i, 0);
_screen->updateScreen();
@@ -324,7 +324,7 @@
if (_showOutro)
playVQA("CREDITS");
- return 0;
+ return _rtl;
}
void KyraEngine_MR::initMainMenu() {
@@ -987,7 +987,7 @@
_eventList.clear();
_runFlag = true;
- while (_runFlag && !_quitFlag) {
+ while (_runFlag && !_quit) {
if (_deathHandler >= 0) {
removeHandItem();
delay(5);
Modified: scummvm/branches/gsoc2008-rtl/engines/kyra/kyra_v1.cpp
===================================================================
--- scummvm/branches/gsoc2008-rtl/engines/kyra/kyra_v1.cpp 2008-06-24 23:19:23 UTC (rev 32771)
+++ scummvm/branches/gsoc2008-rtl/engines/kyra/kyra_v1.cpp 2008-06-25 00:55:18 UTC (rev 32772)
@@ -52,8 +52,6 @@
_gameSpeed = 60;
_tickLength = (uint8)(1000.0 / _gameSpeed);
- _quitFlag = false;
-
_speechFile = "";
_trackMap = 0;
_trackMapSize = 0;
@@ -220,7 +218,7 @@
void KyraEngine_v1::quitGame() {
debugC(9, kDebugLevelMain, "KyraEngine_v1::quitGame()");
- _quitFlag = true;
+ _quit = true;
// Nothing to do here
}
@@ -258,7 +256,7 @@
}
void KyraEngine_v1::delayUntil(uint32 timestamp, bool updateTimers, bool update, bool isMainLoop) {
- while (_system->getMillis() < timestamp && !_quitFlag) {
+ while (_system->getMillis() < timestamp && !_quit) {
if (timestamp - _system->getMillis() >= 10)
delay(10, update, isMainLoop);
}
Modified: scummvm/branches/gsoc2008-rtl/engines/kyra/kyra_v1.h
===================================================================
--- scummvm/branches/gsoc2008-rtl/engines/kyra/kyra_v1.h 2008-06-24 23:19:23 UTC (rev 32771)
+++ scummvm/branches/gsoc2008-rtl/engines/kyra/kyra_v1.h 2008-06-25 00:55:18 UTC (rev 32772)
@@ -112,7 +112,7 @@
virtual void pauseEngineIntern(bool pause);
- bool quit() const { return _quitFlag; }
+ bool quit() const { return _quit; }
uint8 game() const { return _flags.gameID; }
const GameFlags &gameFlags() const { return _flags; }
@@ -172,9 +172,6 @@
virtual int go() = 0;
virtual int init();
- // quit Handling
- bool _quitFlag;
-
// intern
Resource *_res;
Sound *_sound;
Modified: scummvm/branches/gsoc2008-rtl/engines/kyra/kyra_v2.cpp
===================================================================
--- scummvm/branches/gsoc2008-rtl/engines/kyra/kyra_v2.cpp 2008-06-24 23:19:23 UTC (rev 32771)
+++ scummvm/branches/gsoc2008-rtl/engines/kyra/kyra_v2.cpp 2008-06-25 00:55:18 UTC (rev 32772)
@@ -127,7 +127,7 @@
if (amount > 0)
_system->delayMillis(amount > 10 ? 10 : amount);
- } while (!skipFlag() && _system->getMillis() < start + amount && !_quitFlag);
+ } while (!skipFlag() && _system->getMillis() < start + amount && !_quit);
}
int KyraEngine_v2::checkInput(Button *buttonList, bool mainLoop) {
@@ -207,14 +207,14 @@
while (_eventMan->pollEvent(event)) {
switch (event.type) {
case Common::EVENT_QUIT:
- _quitFlag = true;
+ _quit = true;
break;
case Common::EVENT_KEYDOWN:
if (event.kbd.keycode == '.' || event.kbd.keycode == Common::KEYCODE_ESCAPE)
_eventList.push_back(Event(event, true));
else if (event.kbd.keycode == 'q' && event.kbd.flags == Common::KBD_CTRL)
- _quitFlag = true;
+ _quit = true;
else
_eventList.push_back(event);
break;
Modified: scummvm/branches/gsoc2008-rtl/engines/kyra/saveload.cpp
===================================================================
--- scummvm/branches/gsoc2008-rtl/engines/kyra/saveload.cpp 2008-06-24 23:19:23 UTC (rev 32771)
+++ scummvm/branches/gsoc2008-rtl/engines/kyra/saveload.cpp 2008-06-25 00:55:18 UTC (rev 32772)
@@ -161,7 +161,7 @@
Common::OutSaveFile *KyraEngine_v1::openSaveForWriting(const char *filename, const char *saveName) const {
debugC(9, kDebugLevelMain, "KyraEngine_v1::openSaveForWriting('%s', '%s')", filename, saveName);
- if (_quitFlag)
+ if (_quit)
return 0;
Common::OutSaveFile *out = 0;
Modified: scummvm/branches/gsoc2008-rtl/engines/kyra/saveload_lok.cpp
===================================================================
--- scummvm/branches/gsoc2008-rtl/engines/kyra/saveload_lok.cpp 2008-06-24 23:19:23 UTC (rev 32771)
+++ scummvm/branches/gsoc2008-rtl/engines/kyra/saveload_lok.cpp 2008-06-25 00:55:18 UTC (rev 32772)
@@ -221,7 +221,7 @@
void KyraEngine_LoK::saveGame(const char *fileName, const char *saveName) {
debugC(9, kDebugLevelMain, "KyraEngine_LoK::saveGame('%s', '%s')", fileName, saveName);
- if (_quitFlag)
+ if (_quit)
return;
Common::OutSaveFile *out = openSaveForWriting(fileName, saveName);
Modified: scummvm/branches/gsoc2008-rtl/engines/kyra/scene_hof.cpp
===================================================================
--- scummvm/branches/gsoc2008-rtl/engines/kyra/scene_hof.cpp 2008-06-24 23:19:23 UTC (rev 32771)
+++ scummvm/branches/gsoc2008-rtl/engines/kyra/scene_hof.cpp 2008-06-25 00:55:18 UTC (rev 32772)
@@ -277,7 +277,7 @@
int changedScene = 0;
const int *moveTableStart = moveTable;
_unk4 = 0;
- while (running && !_quitFlag) {
+ while (running && !_quit) {
if (*moveTable >= 0 && *moveTable <= 7) {
_mainCharacter.facing = getOppositeFacingDirection(*moveTable);
unkFlag = true;
Modified: scummvm/branches/gsoc2008-rtl/engines/kyra/scene_mr.cpp
===================================================================
--- scummvm/branches/gsoc2008-rtl/engines/kyra/scene_mr.cpp 2008-06-24 23:19:23 UTC (rev 32771)
+++ scummvm/branches/gsoc2008-rtl/engines/kyra/scene_mr.cpp 2008-06-25 00:55:18 UTC (rev 32772)
@@ -653,7 +653,7 @@
const int *moveTableStart = moveTable;
_unk4 = 0;
- while (running && !_quitFlag) {
+ while (running && !_quit) {
if (*moveTable >= 0 && *moveTable <= 7) {
_mainCharacter.facing = getOppositeFacingDirection(*moveTable);
unkFlag = true;
Modified: scummvm/branches/gsoc2008-rtl/engines/kyra/script_mr.cpp
===================================================================
--- scummvm/branches/gsoc2008-rtl/engines/kyra/script_mr.cpp 2008-06-24 23:19:23 UTC (rev 32771)
+++ scummvm/branches/gsoc2008-rtl/engines/kyra/script_mr.cpp 2008-06-25 00:55:18 UTC (rev 32772)
@@ -786,7 +786,7 @@
_screen->_curPage = curPageBackUp;
_screen->showMouse();
- while (!_quitFlag) {
+ while (!_quit) {
int keys = checkInput(0);
removeInputTop();
Modified: scummvm/branches/gsoc2008-rtl/engines/kyra/sequences_hof.cpp
===================================================================
--- scummvm/branches/gsoc2008-rtl/engines/kyra/sequences_hof.cpp 2008-06-24 23:19:23 UTC (rev 32771)
+++ scummvm/branches/gsoc2008-rtl/engines/kyra/sequences_hof.cpp 2008-06-25 00:55:18 UTC (rev 32772)
@@ -75,7 +75,7 @@
_seqEndTime = 0;
_menuChoice = 0;
- for (int seqNum = startSeq; seqNum <= endSeq && !((skipFlag() && allowSkip) || _quitFlag || (_abortIntroFlag && allowSkip) || _menuChoice); seqNum++) {
+ for (int seqNum = startSeq; seqNum <= endSeq && !((skipFlag() && allowSkip) || _quit || (_abortIntroFlag && allowSkip) || _menuChoice); seqNum++) {
_screen->clearPage(0);
_screen->clearPage(8);
memcpy(_screen->getPalette(1), _screen->getPalette(0), 0x300);
@@ -131,7 +131,7 @@
seq_sequenceCommand(cseq.startupCommand);
- if (!((skipFlag() && allowSkip) || _quitFlag || (_abortIntroFlag && allowSkip) || _menuChoice)) {
+ if (!((skipFlag() && allowSkip) || _quit || (_abortIntroFlag && allowSkip) || _menuChoice)) {
_screen->copyPage(2, 0);
_screen->updateScreen();
}
@@ -165,7 +165,7 @@
_seqWsaCurrentFrame = cseq.startFrame;
bool loop = true;
- while (loop && !((skipFlag() && allowSkip) || _quitFlag || (_abortIntroFlag && allowSkip) || _menuChoice)) {
+ while (loop && !((skipFlag() && allowSkip) || _quit || (_abortIntroFlag && allowSkip) || _menuChoice)) {
_seqEndTime = _system->getMillis() + _seqFrameDelay * _tickLength;
if (_seqWsa || !cb)
@@ -189,16 +189,16 @@
seq_processWSAs();
seq_processText();
- if ((_seqWsa || !cb) && !((skipFlag() && allowSkip) || _quitFlag || (_abortIntroFlag && allowSkip) || _menuChoice)) {
+ if ((_seqWsa || !cb) && !((skipFlag() && allowSkip) || _quit || (_abortIntroFlag && allowSkip) || _menuChoice)) {
_screen->copyPage(2, 0);
_screen->updateScreen();
}
bool loop2 = true;
- while (loop2 && !((skipFlag() && allowSkip) || _quitFlag || (_abortIntroFlag && allowSkip) || _menuChoice)) {
+ while (loop2 && !((skipFlag() && allowSkip) || _quit || (_abortIntroFlag && allowSkip) || _menuChoice)) {
if (_seqWsa) {
seq_processText();
- if (!((skipFlag() && allowSkip) || _quitFlag || (_abortIntroFlag && allowSkip) || _menuChoice)) {
+ if (!((skipFlag() && allowSkip) || _quit || (_abortIntroFlag && allowSkip) || _menuChoice)) {
_screen->copyPage(2, 0);
_screen->updateScreen();
}
@@ -230,7 +230,7 @@
} else {
_seqFrameDelay = cseq.frameDelay;
_seqEndTime = _system->getMillis() + _seqFrameDelay * _tickLength;
- while (!((skipFlag() && allowSkip) || _quitFlag || (_abortIntroFlag && allowSkip) || _menuChoice)) {
+ while (!((skipFlag() && allowSkip) || _quit || (_abortIntroFlag && allowSkip) || _menuChoice)) {
_seqSubFrameStartTime = _system->getMillis();
seq_processWSAs();
if (cb)
@@ -262,7 +262,7 @@
dl = ct;
_seqEndTime = _system->getMillis() + dl;
- while (!((skipFlag() && allowSkip) || _quitFlag || (_abortIntroFlag && allowSkip) || _menuChoice)) {
+ while (!((skipFlag() && allowSkip) || _quit || (_abortIntroFlag && allowSkip) || _menuChoice)) {
_seqSubFrameStartTime = _system->getMillis();
seq_processWSAs();
@@ -2093,7 +2093,7 @@
void KyraEngine_HoF::seq_nestedSequenceFrame(int command, int wsaNum) {
int xa = 0, ya = 0;
command--;
- if (!_activeWSA[wsaNum].movie || skipFlag() || _quitFlag || _abortIntroFlag)
+ if (!_activeWSA[wsaNum].movie || skipFlag() || _quit || _abortIntroFlag)
return;
switch (command) {
@@ -2293,7 +2293,7 @@
void KyraEngine_HoF::seq_printCreditsString(uint16 strIndex, int x, int y, const uint8 *colorMap, uint8 textcolor) {
uint8 colormap[16];
- if (skipFlag() || _quitFlag || _abortIntroFlag || _menuChoice)
+ if (skipFlag() || _quit || _abortIntroFlag || _menuChoice)
return;
memset(&_screen->getPalette(0)[0x2fa], 0x3f, 6);
@@ -2774,7 +2774,7 @@
++_invWsa.curFrame;
- if (_invWsa.curFrame >= _invWsa.lastFrame && !_quitFlag)
+ if (_invWsa.curFrame >= _invWsa.lastFrame && !_quit)
break;
switch (_invWsa.curFrame) {
Modified: scummvm/branches/gsoc2008-rtl/engines/kyra/sequences_lok.cpp
===================================================================
--- scummvm/branches/gsoc2008-rtl/engines/kyra/sequences_lok.cpp 2008-06-24 23:19:23 UTC (rev 32771)
+++ scummvm/branches/gsoc2008-rtl/engines/kyra/sequences_lok.cpp 2008-06-25 00:55:18 UTC (rev 32772)
@@ -164,7 +164,7 @@
_screen->updateScreen();
_screen->fadeFromBlack();
- if (_seq->playSequence(_seq_WestwoodLogo, _skipFlag) || _quitFlag) {
+ if (_seq->playSequence(_seq_WestwoodLogo, _skipFlag) || _quit) {
_screen->fadeToBlack();
_screen->clearPage(0);
return;
@@ -176,14 +176,14 @@
_screen->setScreenPalette(_screen->_currentPalette);
}
- if ((_seq->playSequence(_seq_KyrandiaLogo, _skipFlag) && !seq_skipSequence()) || _quitFlag) {
+ if ((_seq->playSequence(_seq_KyrandiaLogo, _skipFlag) && !seq_skipSequence()) || _quit) {
_screen->fadeToBlack();
_screen->clearPage(0);
return;
}
_screen->fillRect(0, 179, 319, 199, 0);
- if (_quitFlag)
+ if (_quit)
return;
if (_flags.platform == Common::kPlatformAmiga) {
@@ -223,10 +223,10 @@
oldDistance = distance;
delay(10);
- } while (!doneFlag && !_quitFlag && !_abortIntroFlag);
+ } while (!doneFlag && !_quit && !_abortIntroFlag);
}
- if (_quitFlag)
+ if (_quit)
return;
_seq->playSequence(_seq_Forest, true);
@@ -1030,7 +1030,7 @@
void KyraEngine_LoK::seq_playEnding() {
debugC(9, kDebugLevelMain, "KyraEngine_LoK::seq_playEnding()");
- if (_quitFlag)
+ if (_quit)
return;
_screen->hideMouse();
_screen->_curPage = 0;
@@ -1211,7 +1211,7 @@
bool KyraEngine_LoK::seq_skipSequence() const {
debugC(9, kDebugLevelMain, "KyraEngine_LoK::seq_skipSequence()");
- return _quitFlag || _abortIntroFlag;
+ return _quit || _abortIntroFlag;
}
int KyraEngine_LoK::handleMalcolmFlag() {
Modified: scummvm/branches/gsoc2008-rtl/engines/kyra/text_hof.cpp
===================================================================
--- scummvm/branches/gsoc2008-rtl/engines/kyra/text_hof.cpp 2008-06-24 23:19:23 UTC (rev 32771)
+++ scummvm/branches/gsoc2008-rtl/engines/kyra/text_hof.cpp 2008-06-25 00:55:18 UTC (rev 32772)
@@ -335,7 +335,7 @@
const uint32 endTime = _chatEndTime;
resetSkipFlag();
- while (running && !_quitFlag) {
+ while (running && !_quit) {
if (!_emc->isValid(&_chatScriptState))
_emc->start(&_chatScriptState, 1);
@@ -353,7 +353,7 @@
uint32 nextFrame = _system->getMillis() + delayTime * _tickLength;
- while (_system->getMillis() < nextFrame && !_quitFlag) {
+ while (_system->getMillis() < nextFrame && !_quit) {
updateWithText();
const uint32 curTime = _system->getMillis();
@@ -593,7 +593,7 @@
if (_currentTalkSections.STATim) {
_tim->resetFinishedFlag();
- while (!_quitFlag && !_tim->finished()) {
+ while (!_quit && !_tim->finished()) {
_tim->exec(_currentTalkSections.STATim, false);
if (_chatText)
updateWithText();
@@ -609,7 +609,7 @@
if (_currentTalkSections.ENDTim) {
_tim->resetFinishedFlag();
- while (!_quitFlag && !_tim->finished()) {
+ while (!_quit && !_tim->finished()) {
_tim->exec(_currentTalkSections.ENDTim, false);
if (_chatText)
updateWithText();
@@ -647,10 +647,10 @@
_chatVocHigh = _chatVocLow = -1;
}
- while (((textEnabled() && _chatEndTime > _system->getMillis()) || (speechEnabled() && snd_voiceIsPlaying())) && !(_quitFlag || skipFlag())) {
+ while (((textEnabled() && _chatEndTime > _system->getMillis()) || (speechEnabled() && snd_voiceIsPlaying())) && !(_quit || skipFlag())) {
if ((!speechEnabled() && chatAnimEndTime > _system->getMillis()) || (speechEnabled() && snd_voiceIsPlaying())) {
_tim->resetFinishedFlag();
- while (!_tim->finished() && !skipFlag() && !_quitFlag) {
+ while (!_tim->finished() && !skipFlag() && !_quit) {
if (_currentTalkSections.TLKTim)
_tim->exec(_currentTalkSections.TLKTim, false);
else
Modified: scummvm/branches/gsoc2008-rtl/engines/kyra/text_mr.cpp
===================================================================
--- scummvm/branches/gsoc2008-rtl/engines/kyra/text_mr.cpp 2008-06-24 23:19:23 UTC (rev 32771)
+++ scummvm/branches/gsoc2008-rtl/engines/kyra/text_mr.cpp 2008-06-25 00:55:18 UTC (rev 32772)
@@ -349,7 +349,7 @@
const uint32 endTime = _chatEndTime;
resetSkipFlag();
- while (running && !_quitFlag) {
+ while (running && !_quit) {
if (!_emc->isValid(&_chatScriptState))
_emc->start(&_chatScriptState, 1);
@@ -367,7 +367,7 @@
uint32 nextFrame = _system->getMillis() + delayTime * _tickLength;
- while (_system->getMillis() < nextFrame && !_quitFlag) {
+ while (_system->getMillis() < nextFrame && !_quit) {
updateWithText();
const uint32 curTime = _system->getMillis();
@@ -419,7 +419,7 @@
uint32 nextFrame = _system->getMillis() + _rnd.getRandomNumberRng(4, 8) * _tickLength;
int frame = _badConscienceFrameTable[_badConscienceAnim+24];
- while (running && !_quitFlag) {
+ while (running && !_quit) {
if (nextFrame < _system->getMillis()) {
++frame;
if (_badConscienceFrameTable[_badConscienceAnim+32] < frame)
@@ -477,7 +477,7 @@
uint32 nextFrame = _system->getMillis() + _rnd.getRandomNumberRng(3, 6) * _tickLength;
int frame = _goodConscienceFrameTable[_goodConscienceAnim+15];
- while (running && !_quitFlag) {
+ while (running && !_quit) {
if (nextFrame < _system->getMillis()) {
++frame;
if (_goodConscienceFrameTable[_goodConscienceAnim+20] < frame)
@@ -597,7 +597,7 @@
uint32 nextFrame = 0;
int frame = 12;
- while (running && !_quitFlag) {
+ while (running && !_quit) {
if (nextFrame < _system->getMillis()) {
++frame;
if (frame > 22)
Modified: scummvm/branches/gsoc2008-rtl/engines/lure/events.cpp
===================================================================
--- scummvm/branches/gsoc2008-rtl/engines/lure/events.cpp 2008-06-24 23:19:23 UTC (rev 32771)
+++ scummvm/branches/gsoc2008-rtl/engines/lure/events.cpp 2008-06-25 00:55:18 UTC (rev 32772)
@@ -29,6 +29,7 @@
#include "graphics/cursorman.h"
#include "lure/events.h"
+#include "lure/lure.h"
#include "lure/res.h"
namespace Lure {
@@ -137,11 +138,12 @@
void Mouse::waitForRelease() {
Events &e = Events::getReference();
+ LureEngine &engine = LureEngine::getReference();
do {
- while (e.pollEvent() && !e.quitFlag) ;
+ while (e.pollEvent() && !engine._quit) ;
g_system->delayMillis(20);
- } while (!e.quitFlag && (lButton() || rButton() || mButton()));
+ } while (!engine._quit && (lButton() || rButton() || mButton()));
}
/*--------------------------------------------------------------------------*/
@@ -150,7 +152,6 @@
Events::Events() {
int_events = this;
- quitFlag = false;
}
Events &Events::getReference() {
@@ -159,12 +160,14 @@
bool Events::pollEvent() {
+ LureEngine &engine = LureEngine::getReference();
+
if (!g_system->getEventManager()->pollEvent(_event)) return false;
// Handle keypress
switch (_event.type) {
case Common::EVENT_QUIT:
- quitFlag = true;
+ engine._quit = true;
break;
case Common::EVENT_LBUTTONDOWN:
@@ -210,10 +213,11 @@
bool Events::interruptableDelay(uint32 milliseconds) {
Events &events = Events::getReference();
+ LureEngine &engine = LureEngine::getReference();
uint32 delayCtr = g_system->getMillis() + milliseconds;
while (g_system->getMillis() < delayCtr) {
- if (events.quitFlag) return true;
+ if (engine._quit) return true;
if (events.pollEvent()) {
if (((events.type() == Common::EVENT_KEYDOWN) && (events.event().kbd.ascii != 0)) ||
Modified: scummvm/branches/gsoc2008-rtl/engines/lure/events.h
===================================================================
--- scummvm/branches/gsoc2008-rtl/engines/lure/events.h 2008-06-24 23:19:23 UTC (rev 32771)
+++ scummvm/branches/gsoc2008-rtl/engines/lure/events.h 2008-06-25 00:55:18 UTC (rev 32772)
@@ -66,8 +66,6 @@
private:
Common::Event _event;
public:
- bool quitFlag;
-
Events();
static Events &getReference();
Modified: scummvm/branches/gsoc2008-rtl/engines/lure/fights.cpp
===================================================================
--- scummvm/branches/gsoc2008-rtl/engines/lure/fights.cpp 2008-06-24 23:19:23 UTC (rev 32771)
+++ scummvm/branches/gsoc2008-rtl/engines/lure/fights.cpp 2008-06-25 00:55:18 UTC (rev 32772)
@@ -22,6 +22,7 @@
#include "lure/fights.h"
#include "lure/luredefs.h"
#include "lure/game.h"
+#include "lure/lure.h"
#include "lure/res.h"
#include "lure/room.h"
#include "lure/sound.h"
@@ -108,6 +109,7 @@
}
void FightsManager::fightLoop() {
+ LureEngine &engine = LureEngine::getReference();
Resources &res = Resources::getReference();
Game &game = Game::getReference();
Room &room = Room::getReference();
@@ -116,7 +118,7 @@
uint32 timerVal = g_system->getMillis();
// Loop for the duration of the battle
- while (!events.quitFlag && (playerFight.fwhits != GENERAL_MAGIC_ID)) {
+ while (!engine._quit && (playerFight.fwhits != GENERAL_MAGIC_ID)) {
checkEvents();
if (g_system->getMillis() > timerVal + GAME_FRAME_DELAY) {
@@ -184,6 +186,7 @@
{Common::KEYCODE_INVALID, 0}};
void FightsManager::checkEvents() {
+ LureEngine &engine = LureEngine::getReference();
Game &game = Game::getReference();
Events &events = Events::getReference();
Mouse &mouse = Mouse::getReference();
@@ -196,7 +199,7 @@
if (events.type() == Common::EVENT_KEYDOWN) {
switch (events.event().kbd.keycode) {
case Common::KEYCODE_ESCAPE:
- events.quitFlag = true;
+ engine._quit = true;
return;
case Common::KEYCODE_d:
Modified: scummvm/branches/gsoc2008-rtl/engines/lure/game.cpp
===================================================================
--- scummvm/branches/gsoc2008-rtl/engines/lure/game.cpp 2008-06-24 23:19:23 UTC (rev 32771)
+++ scummvm/branches/gsoc2008-rtl/engines/lure/game.cpp 2008-06-25 00:55:18 UTC (rev 32772)
@@ -23,10 +23,10 @@
*
*/
-#include "lure/lure.h"
#include "lure/game.h"
#include "lure/animseq.h"
#include "lure/fights.h"
+#include "lure/lure.h"
#include "lure/res_struct.h"
#include "lure/room.h"
#include "lure/scripts.h"
@@ -125,6 +125,7 @@
void Game::execute() {
OSystem &system = *g_system;
+ LureEngine &engine = LureEngine::getReference();
Room &room = Room::getReference();
Resources &res = Resources::getReference();
Events &events = Events::getReference();
@@ -142,7 +143,7 @@
setState(GS_RESTART);
bool initialRestart = true;
- while (!events.quitFlag) {
+ while (!engine._quit) {
if ((_state & GS_RESTART) != 0) {
res.reset();
@@ -162,7 +163,7 @@
mouse.cursorOn();
// Main game loop
- while (!events.quitFlag && ((_state & GS_RESTART) == 0)) {
+ while (!engine._quit && ((_state & GS_RESTART) == 0)) {
// If time for next frame, allow everything to update
if (system.getMillis() > timerVal + GAME_FRAME_DELAY) {
timerVal = system.getMillis();
@@ -294,7 +295,7 @@
} else if ((_state & GS_RESTART) == 0)
// Exiting game
- events.quitFlag = true;
+ engine._quit = true;
}
}
@@ -892,7 +893,7 @@
void Game::doQuit() {
Sound.pause();
if (getYN())
- Events::getReference().quitFlag = true;
+ LureEngine::getReference()._quit = true;
Sound.resume();
}
@@ -977,6 +978,7 @@
Events &events = Events::getReference();
Screen &screen = Screen::getReference();
Resources &res = Resources::getReference();
+ LureEngine &engine = LureEngine::getReference();
Common::Language l = LureEngine::getReference().getLanguage();
Common::KeyCode y = Common::KEYCODE_y;
@@ -1018,7 +1020,7 @@
}
g_system->delayMillis(10);
- } while (!events.quitFlag && !breakFlag);
+ } while (!engine._quit && !breakFlag);
screen.update();
if (!vKbdFlag)
Modified: scummvm/branches/gsoc2008-rtl/engines/lure/intro.cpp
===================================================================
--- scummvm/branches/gsoc2008-rtl/engines/lure/intro.cpp 2008-06-24 23:19:23 UTC (rev 32771)
+++ scummvm/branches/gsoc2008-rtl/engines/lure/intro.cpp 2008-06-25 00:55:18 UTC (rev 32772)
@@ -65,7 +65,7 @@
else screen.paletteFadeIn(&p);
bool result = interruptableDelay(delaySize);
- if (events.quitFlag) return true;
+ if (LureEngine::getReference()._quit) return true;
if (!isEGA)
screen.paletteFadeOut();
Modified: scummvm/branches/gsoc2008-rtl/engines/lure/lure.cpp
===================================================================
--- scummvm/branches/gsoc2008-rtl/engines/lure/lure.cpp 2008-06-24 23:19:23 UTC (rev 32771)
+++ scummvm/branches/gsoc2008-rtl/engines/lure/lure.cpp 2008-06-25 00:55:18 UTC (rev 32772)
@@ -126,8 +126,8 @@
CopyProtectionDialog *dialog = new CopyProtectionDialog();
bool result = dialog->show();
delete dialog;
- if (_events->quitFlag)
- return 0;
+ if (_quit)
+ return _rtl;
if (!result)
error("Sorry - copy protection failed");
@@ -145,14 +145,14 @@
}
// Play the game
- if (!_events->quitFlag) {
+ if (!_quit) {
// Play the game
Sound.loadSection(Sound.isRoland() ? ROLAND_MAIN_SOUND_RESOURCE_ID : ADLIB_MAIN_SOUND_RESOURCE_ID);
gameInstance->execute();
}
delete gameInstance;
- return 0;
+ return _rtl;
}
void LureEngine::pauseEngineIntern(bool pause) {
Modified: scummvm/branches/gsoc2008-rtl/engines/lure/menu.cpp
===================================================================
--- scummvm/branches/gsoc2008-rtl/engines/lure/menu.cpp 2008-06-24 23:19:23 UTC (rev 32771)
+++ scummvm/branches/gsoc2008-rtl/engines/lure/menu.cpp 2008-06-25 00:55:18 UTC (rev 32772)
@@ -116,6 +116,7 @@
uint8 Menu::execute() {
OSystem &system = *g_system;
+ LureEngine &engine = LureEngine::getReference();
Mouse &mouse = Mouse::getReference();
Events &events = Events::getReference();
Screen &screen = Screen::getReference();
@@ -130,7 +131,7 @@
while (mouse.lButton() || mouse.rButton()) {
while (events.pollEvent()) {
- if (events.quitFlag) return MENUITEM_NONE;
+ if (engine._quit) return MENUITEM_NONE;
if (mouse.y() < MENUBAR_Y_SIZE) {
MenuRecord *p = getMenuAt(mouse.x());
@@ -467,6 +468,7 @@
uint16 PopupMenu::Show(int numEntries, const char *actions[]) {
if (numEntries == 0) return 0xffff;
+ LureEngine &engine = LureEngine::getReference();
Events &e = Events::getReference();
Mouse &mouse = Mouse::getReference();
OSystem &system = *g_system;
@@ -545,7 +547,7 @@
}
while (e.pollEvent()) {
- if (e.quitFlag) {
+ if (engine._quit) {
selectedIndex = 0xffff;
goto bail_out;
Modified: scummvm/branches/gsoc2008-rtl/engines/lure/scripts.cpp
===================================================================
--- scummvm/branches/gsoc2008-rtl/engines/lure/scripts.cpp 2008-06-24 23:19:23 UTC (rev 32771)
+++ scummvm/branches/gsoc2008-rtl/engines/lure/scripts.cpp 2008-06-25 00:55:18 UTC (rev 32772)
@@ -26,6 +26,7 @@
#include "lure/animseq.h"
#include "lure/fights.h"
#include "lure/game.h"
+#include "lure/lure.h"
#include "lure/res.h"
#include "lure/room.h"
#include "lure/screen.h"
@@ -190,6 +191,7 @@
}
void Script::endgameSequence(uint16 v1, uint16 v2, uint16 v3) {
+ LureEngine &engine = LureEngine::getReference();
Screen &screen = Screen::getReference();
Mouse &mouse = Mouse::getReference();
Events &events = Events::getReference();
@@ -219,7 +221,7 @@
anim->show();
if (!events.interruptableDelay(30000)) {
// No key yet pressed, so keep waiting
- while (Sound.musicInterface_CheckPlaying(6) && !events.quitFlag) {
+ while (Sound.musicInterface_CheckPlaying(6) && !engine._quit) {
if (events.interruptableDelay(20))
break;
}
@@ -227,7 +229,7 @@
delete anim;
screen.paletteFadeOut();
- events.quitFlag = true;
+ engine._quit = true;
}
// Setup the pig fight in the cave
Modified: scummvm/branches/gsoc2008-rtl/engines/lure/surface.cpp
===================================================================
--- scummvm/branches/gsoc2008-rtl/engines/lure/surface.cpp 2008-06-24 23:19:23 UTC (rev 32771)
+++ scummvm/branches/gsoc2008-rtl/engines/lure/surface.cpp 2008-06-25 00:55:18 UTC (rev 32772)
@@ -506,6 +506,7 @@
bool Surface::getString(Common::String &line, int maxSize, bool isNumeric, bool varLength, int16 x, int16 y) {
OSystem &system = *g_system;
+ LureEngine &engine = LureEngine::getReference();
Mouse &mouse = Mouse::getReference();
Events &events = Events::getReference();
Screen &screen = Screen::getReference();
@@ -533,7 +534,7 @@
// Loop until the input string changes
refreshFlag = false;
while (!refreshFlag && !abortFlag) {
- abortFlag = events.quitFlag;
+ abortFlag = engine._quit;
if (abortFlag) break;
while (events.pollEvent()) {
@@ -975,7 +976,7 @@
// Provide highlighting of lines to select a save slot
while (!abortFlag && !(mouse.lButton() && (selectedLine != -1))
&& !mouse.rButton() && !mouse.mButton()) {
- abortFlag = events.quitFlag;
+ abortFlag = engine._quit;
if (abortFlag) break;
while (events.pollEvent()) {
@@ -1178,7 +1179,7 @@
// Event loop for making selection
bool buttonPressed = false;
- while (!events.quitFlag) {
+ while (!engine._quit) {
// Handle events
while (events.pollEvent()) {
if ((events.type() == Common::EVENT_LBUTTONDOWN) && (highlightedButton != -1)) {
@@ -1230,7 +1231,7 @@
Sound.killSounds();
- if (!restartFlag && !events.quitFlag) {
+ if (!restartFlag && !engine._quit) {
// Need to show Restore game dialog
if (!SaveRestoreDialog::show(false))
// User cancelled, so fall back on Restart
@@ -1299,6 +1300,7 @@
Screen &screen = Screen::getReference();
Events &events = Events::getReference();
Common::RandomSource rnd;
+ LureEngine &engine = LureEngine::getReference();
screen.setPaletteEmpty();
Palette p(COPY_PROTECTION_RESOURCE_ID - 1);
@@ -1349,7 +1351,7 @@
// Clear any prior try
_charIndex = 0;
- while (!events.quitFlag) {
+ while (!engine._quit) {
while (events.pollEvent() && (_charIndex < 4)) {
if (events.type() == Common::EVENT_KEYDOWN) {
if ((events.event().kbd.keycode == Common::KEYCODE_BACKSPACE) && (_charIndex > 0)) {
@@ -1383,7 +1385,7 @@
break;
}
- if (events.quitFlag)
+ if (engine._quit)
return false;
// At this point, two page numbers have been entered - validate them
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