Renamed Engine::quit to Engine::shouldQuit (previously, it was easily confused with Engine::quitGame); also cleaned up engine.h a bit

svn-id: r34700
This commit is contained in:
Max Horn 2008-09-30 12:27:38 +00:00
parent 87917e06d9
commit 9b160804ab
97 changed files with 293 additions and 272 deletions

View file

@ -115,7 +115,7 @@ void AgiEngine::interpretCycle() {
oldSound = getflag(fSoundOn);
_game.exitAllLogics = false;
while (runLogic(0) == 0 && !quit()) {
while (runLogic(0) == 0 && !shouldQuit()) {
_game.vars[vWordNotFound] = 0;
_game.vars[vBorderTouchObj] = 0;
_game.vars[vBorderCode] = 0;
@ -352,16 +352,16 @@ int AgiEngine::playGame() {
_game.vars[vKey] = 0;
}
// FIXME: This has been broken with the merge of the RTL GSoC project. quit() returns a boolean, and we're trying to
// 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 (quit() == 0xff)
//if (shouldQuit() == 0xff)
// ec = errRestartGame;
if (shouldPerformAutoSave(_lastSaveTime)) {
saveGame(getSavegameFilename(0), "Autosave");
}
} while (quit() == 0);
} while (shouldQuit() == 0);
_sound->stopSound();

View file

@ -1739,7 +1739,7 @@ int AgiEngine::runLogic(int n) {
curLogic->cIP = curLogic->sIP;
timerHack = 0;
while (ip < _game.logics[n].size && !quit()) {
while (ip < _game.logics[n].size && !shouldQuit()) {
if (_debug.enabled) {
if (_debug.steps > 0) {
if (_debug.logic0 || n) {

View file

@ -231,7 +231,7 @@ int AgiEngine::testIfCode(int lognum) {
uint8 p[16] = { 0 };
bool end_test = false;
while (retval && !quit() && !end_test) {
while (retval && !shouldQuit() && !end_test) {
if (_debug.enabled && (_debug.logic0 || lognum))
debugConsole(lognum, lTEST_MODE, NULL);

View file

@ -120,7 +120,7 @@ void PreAgiEngine::printStrXOR(char *szMsg) {
int PreAgiEngine::getSelection(SelectionTypes type) {
Common::Event event;
while (!quit()) {
while (!shouldQuit()) {
while (_eventMan->pollEvent(event)) {
switch(event.type) {
case Common::EVENT_RTL:

View file

@ -2160,7 +2160,7 @@ void Mickey::run() {
intro();
// Game loop
while (!_vm->quit()) {
while (!_vm->shouldQuit()) {
drawRoom();
if (_game.fIntro) {

View file

@ -56,7 +56,7 @@ bool Troll::getMenuSel(const char *szMenu, int *iSel, int nSel) {
drawMenu(szMenu, *iSel);
while (!_vm->quit()) {
while (!_vm->shouldQuit()) {
while (_vm->_system->getEventManager()->pollEvent(event)) {
switch(event.type) {
case Common::EVENT_RTL:
@ -268,7 +268,7 @@ void Troll::tutorial() {
int iSel = 0;
//char szTreasure[16] = {0};
while (!_vm->quit()) {
while (!_vm->shouldQuit()) {
_vm->clearScreen(0xFF);
_vm->printStr(IDS_TRO_TUTORIAL_0);

View file

@ -796,7 +796,7 @@ void Winnie::getMenuSel(char *szMenu, int *iSel, int fCanSel[]) {
// Show the mouse cursor for the menu
CursorMan.showMouse(true);
while (!_vm->quit()) {
while (!_vm->shouldQuit()) {
while (_vm->_system->getEventManager()->pollEvent(event)) {
switch(event.type) {
case Common::EVENT_RTL:
@ -1013,7 +1013,7 @@ phase2:
if (parser(hdr.ofsDesc[iBlock] - _roomOffset, iBlock, roomdata) == IDI_WTP_PAR_BACK)
goto phase1;
}
while (!_vm->quit()) {
while (!_vm->shouldQuit()) {
for (iBlock = 0; iBlock < IDI_WTP_MAX_BLOCK; iBlock++) {
switch(parser(hdr.ofsBlock[iBlock] - _roomOffset, iBlock, roomdata)) {
case IDI_WTP_PAR_GOTO:

View file

@ -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)quit());
out->writeSint16BE((int16)shouldQuit());
out->writeSint16BE((int16)_game.statusLine);
out->writeSint16BE((int16)_game.clockEnabled);
out->writeSint16BE((int16)_game.exitAllLogics);

View file

@ -951,7 +951,7 @@ void AGOSEngine::pauseEngineIntern(bool pauseIt) {
void AGOSEngine::pause() {
pauseEngine(true);
while (_pause && !quit()) {
while (_pause && !shouldQuit()) {
delay(1);
if (_keyPressed.keycode == Common::KEYCODE_p)
pauseEngine(false);
@ -988,7 +988,7 @@ int AGOSEngine::go() {
(getFeatures() & GF_DEMO)) {
int i;
while (!quit()) {
while (!shouldQuit()) {
for (i = 0; i < 4; i++) {
setWindowImage(3, 9902 + i);
debug(0, "Displaying image %d", 9902 + i);
@ -1017,7 +1017,7 @@ int AGOSEngine::go() {
runSubroutine101();
permitInput();
while (!quit()) {
while (!shouldQuit()) {
waitForInput();
handleVerbClicked(_verbHitArea);
delay(100);
@ -1074,7 +1074,7 @@ void AGOSEngine::shutdown() {
delete _moviePlay;
delete _sound;
_system->quit();
_system->shouldQuit();
}
*/

View file

@ -150,7 +150,7 @@ void MoviePlayer::play() {
startSound();
while (_frameNum < _framesCount && !_vm->quit())
while (_frameNum < _framesCount && !_vm->shouldQuit())
handleNextFrame();
closeFile();

View file

@ -142,7 +142,7 @@ bool AGOSEngine::kickoffTimeEvents() {
cur_time = getTime() - _gameStoppedClock;
while ((te = _firstTimeStruct) != NULL && te->time <= cur_time && !quit()) {
while ((te = _firstTimeStruct) != NULL && te->time <= cur_time && !shouldQuit()) {
result = true;
_pendingDeleteTimeEvent = te;
invokeTimeEvent(te);
@ -544,7 +544,7 @@ void AGOSEngine::delay(uint amount) {
_system->delayMillis(this_delay);
cur = _system->getMillis();
} while (cur < start + amount && !quit());
} while (cur < start + amount && !shouldQuit());
}
void AGOSEngine::timer_callback() {

View file

@ -1286,7 +1286,7 @@ void AGOSEngine::setWindowImageEx(uint16 mode, uint16 vga_res) {
if (getGameType() == GType_WW && (mode == 6 || mode == 8 || mode == 9)) {
setWindowImage(mode, vga_res);
} else {
while (_copyScnFlag && !quit())
while (_copyScnFlag && !shouldQuit())
delay(1);
setWindowImage(mode, vga_res);

View file

@ -123,7 +123,7 @@ void AGOSEngine::setup_cond_c_helper() {
clearName();
_lastNameOn = last;
while (!quit()) {
while (!shouldQuit()) {
_lastHitArea = NULL;
_lastHitArea3 = 0;
_leftButtonDown = 0;
@ -145,7 +145,7 @@ void AGOSEngine::setup_cond_c_helper() {
}
delay(100);
} while ((_lastHitArea3 == (HitArea *) -1 || _lastHitArea3 == 0) && !quit());
} while ((_lastHitArea3 == (HitArea *) -1 || _lastHitArea3 == 0) && !shouldQuit());
if (_lastHitArea == NULL) {
} else if (_lastHitArea->id == 0x7FFB) {
@ -189,12 +189,12 @@ void AGOSEngine::waitForInput() {
resetVerbs();
}
while (!quit()) {
while (!shouldQuit()) {
_lastHitArea = NULL;
_lastHitArea3 = NULL;
_dragAccept = 1;
while (!quit()) {
while (!shouldQuit()) {
if ((getGameType() == GType_SIMON1 || getGameType() == GType_SIMON2) &&
_keyPressed.keycode == Common::KEYCODE_F10)
displayBoxStars();

View file

@ -459,7 +459,7 @@ void AGOSEngine_Feeble::saveUserGame(int slot) {
}
windowPutChar(window, 0x7f);
while (!quit()) {
while (!shouldQuit()) {
_keyPressed.reset();
delay(1);

View file

@ -279,11 +279,11 @@ restart:
name = buf;
_saveGameNameLen = 0;
while (!quit()) {
while (!shouldQuit()) {
windowPutChar(window, 128);
_keyPressed.reset();
while (!quit()) {
while (!shouldQuit()) {
delay(10);
if (_keyPressed.ascii && _keyPressed.ascii < 128) {
i = _keyPressed.ascii;
@ -443,7 +443,7 @@ void AGOSEngine_Elvira2::userGame(bool load) {
name = buf + 192;
while (!quit()) {
while (!shouldQuit()) {
windowPutChar(window, 128);
_saveLoadEdit = true;
@ -516,7 +516,7 @@ int AGOSEngine_Elvira2::userGameGetKey(bool *b, char *buf, uint maxChar) {
_keyPressed.reset();
while (!quit()) {
while (!shouldQuit()) {
_lastHitArea = NULL;
_lastHitArea3 = NULL;
@ -526,7 +526,7 @@ int AGOSEngine_Elvira2::userGameGetKey(bool *b, char *buf, uint maxChar) {
return _keyPressed.ascii;
}
delay(10);
} while (_lastHitArea3 == 0 && !quit());
} while (_lastHitArea3 == 0 && !shouldQuit());
ha = _lastHitArea;
if (ha == NULL || ha->id < 200) {
@ -708,7 +708,7 @@ restart:;
_saveGameNameLen++;
}
while (!quit()) {
while (!shouldQuit()) {
windowPutChar(window, 127);
_saveLoadEdit = true;
@ -787,7 +787,7 @@ int AGOSEngine_Simon1::userGameGetKey(bool *b, char *buf, uint maxChar) {
_keyPressed.reset();
while (!quit()) {
while (!shouldQuit()) {
_lastHitArea = NULL;
_lastHitArea3 = NULL;
@ -797,7 +797,7 @@ int AGOSEngine_Simon1::userGameGetKey(bool *b, char *buf, uint maxChar) {
return _keyPressed.ascii;
}
delay(10);
} while (_lastHitArea3 == 0 && !quit());
} while (_lastHitArea3 == 0 && !shouldQuit());
ha = _lastHitArea;
if (ha == NULL || ha->id < 205) {

View file

@ -965,7 +965,7 @@ void AGOSEngine::writeVariable(uint16 variable, uint16 contents) {
int AGOSEngine::runScript() {
bool flag;
if (quit())
if (shouldQuit())
return 1;
do {
@ -1010,9 +1010,9 @@ int AGOSEngine::runScript() {
error("Invalid opcode '%d' encountered", _opcode);
executeOpcode(_opcode);
} while (getScriptCondition() != flag && !getScriptReturn() && !quit());
} while (getScriptCondition() != flag && !getScriptReturn() && !shouldQuit());
return (quit()) ? 1 : getScriptReturn();
return (shouldQuit()) ? 1 : getScriptReturn();
}
Child *nextSub(Child *sub, int16 key) {
@ -1066,7 +1066,7 @@ void AGOSEngine::waitForSync(uint a) {
_exitCutscene = false;
_rightButtonDown = false;
while (_vgaWaitFor != 0 && !quit()) {
while (_vgaWaitFor != 0 && !shouldQuit()) {
if (_rightButtonDown) {
if (_vgaWaitFor == 200 && (getGameType() == GType_FF || !getBitFlag(14))) {
skipSpeech();

View file

@ -1052,11 +1052,11 @@ uint AGOSEngine::confirmYesOrNo(uint16 x, uint16 y) {
ha->priority = 999;
ha->window = 0;
while (!quit()) {
while (!shouldQuit()) {
_lastHitArea = NULL;
_lastHitArea3 = NULL;
while (!quit()) {
while (!shouldQuit()) {
if (_lastHitArea3 != 0)
break;
delay(1);
@ -1101,11 +1101,11 @@ uint AGOSEngine::continueOrQuit() {
ha->priority = 999;
ha->window = 0;
while (!quit()) {
while (!shouldQuit()) {
_lastHitArea = NULL;
_lastHitArea3 = NULL;
while (!quit()) {
while (!shouldQuit()) {
if (_lastHitArea3 != 0)
break;
delay(1);

View file

@ -370,11 +370,11 @@ void AGOSEngine_Elvira2::oe2_pauseGame() {
uint32 pauseTime = getTime();
haltAnimation();
while (!quit()) {
while (!shouldQuit()) {
_lastHitArea = NULL;
_lastHitArea3 = NULL;
while (!quit()) {
while (!shouldQuit()) {
if (processSpecialKeys() != 0 || _lastHitArea3 != 0)
break;
delay(1);

View file

@ -338,7 +338,7 @@ void AGOSEngine_Simon1::os1_pauseGame() {
break;
}
while (!quit()) {
while (!shouldQuit()) {
delay(1);
if (_keyPressed.keycode == keyYes)
quitGame();

View file

@ -368,11 +368,11 @@ void AGOSEngine_Waxworks::oww_pauseGame() {
uint32 pauseTime = getTime();
haltAnimation();
while (!quit()) {
while (!shouldQuit()) {
_lastHitArea = NULL;
_lastHitArea3 = NULL;
while (!quit()) {
while (!shouldQuit()) {
if (_lastHitArea3 != 0)
break;
delay(1);

View file

@ -555,7 +555,7 @@ int AGOSEngine::startSubroutine(Subroutine *sub) {
_currentTable = sub;
restart:
if (quit())
if (shouldQuit())
return result;
while ((byte *)sl != (byte *)sub) {

View file

@ -343,7 +343,7 @@ void AGOSEngine::handleVerbClicked(uint verb) {
Subroutine *sub;
int result;
if (quit())
if (shouldQuit())
return;
_objectItem = _hitAreaObjectItem;

View file

@ -298,11 +298,11 @@ void AGOSEngine::waitWindow(WindowBlock *window) {
ha->id = 0x7FFF;
ha->priority = 999;
while (!quit()) {
while (!shouldQuit()) {
_lastHitArea = NULL;
_lastHitArea3 = NULL;
while (!quit()) {
while (!shouldQuit()) {
if (_lastHitArea3 != 0)
break;
delay(1);

View file

@ -419,7 +419,7 @@ void CineEngine::mainLoop(int bootScriptIdx) {
manageEvents();
} while (!quit() && _danKeysPressed != 7);
} while (!shouldQuit() && _danKeysPressed != 7);
hideMouse();
g_sound->stopMusic();

View file

@ -168,7 +168,7 @@ void Engine::checkCD() {
GUI::MessageDialog dialog(
"You appear to be playing this game directly\n"
"from the CD. This is known to cause problems,\n"
"and it's therefore recommended that you copy\n"
"and it is therefore recommended that you copy\n"
"the data files to your hard disk instead.\n"
"See the README file for details.", "OK");
dialog.runModal();
@ -224,11 +224,8 @@ void Engine::mainMenuDialog() {
}
int Engine::runDialog(Dialog &dialog) {
pauseEngine(true);
int result = dialog.runModal();
pauseEngine(false);
return result;
@ -254,6 +251,7 @@ void Engine::quitGame() {
}
bool Engine::hasFeature(int f) {
// TODO: In each engine, keep a ref to the corresponding MetaEngine?
const EnginePlugin *plugin = 0;
Common::String gameid = ConfMan.get("gameid");
gameid.toLowercase();

View file

@ -79,6 +79,13 @@ private:
int _pauseLevel;
public:
/** @name Overloadable methods
*
* All Engine subclasses should consider overloading some or all of the following methods.
*/
//@{
Engine(OSystem *syst);
virtual ~Engine();
@ -96,7 +103,9 @@ public:
*/
virtual int go() = 0;
/** Specific for each engine: prepare error string. */
/**
* Prepare an error string, which is printed by the error() function.
*/
virtual void errorString(const char *buf_input, char *buf_output);
/**
@ -105,6 +114,35 @@ public:
*/
virtual GUI::Debugger *getDebugger() { return 0; }
/** Sync the engine's sound settings with the config manager
*/
virtual void syncSoundSettings();
protected:
/**
* Actual implementation of pauseEngine by subclasses. See there
* for details.
*/
virtual void pauseEngineIntern(bool pause);
//@}
public:
/**
* Quit the engine, sends a Quit event to the Event Manager
*/
void quitGame();
// TODO: Rename "quit" to "shouldQuit"
/**
* Return whether or not the ENGINE should quit
*/
bool shouldQuit() const { return (_eventMan->shouldQuit() || _eventMan->shouldRTL()); }
/**
* Pause or resume the engine. This should stop/resume any audio playback
* and other stuff. Called right before the system runs a global dialog
@ -118,36 +156,27 @@ public:
*/
void pauseEngine(bool pause);
/**
* Quit the engine, sends a Quit event to the Event Manager
*/
void quitGame();
/**
* Return whether the engine is currently paused or not.
*/
bool isPaused() const { return _pauseLevel != 0; }
/**
* Return whether or not the ENGINE should quit
* Run the Global Main Menu Dialog
*/
bool quit() const { return (_eventMan->shouldQuit() || _eventMan->shouldRTL()); }
void mainMenuDialog();
/** Run the Global Main Menu Dialog
/**
* Determine whether the engine supports the specified MetaEngine feature.
*/
virtual void mainMenuDialog();
/** Sync the engine's sound settings with the config manager
*/
virtual void syncSoundSettings();
/** Determine whether the engine supports the specified MetaEngine feature
*/
virtual bool hasFeature(int f);
bool hasFeature(int f);
public:
/** Setup the backend's graphics mode. */
/**
* Setup the backend's graphics mode.
* @todo Must be public because e.g. Saga's Gfx class wants to invoke it. Move it to a better place?
*/
void initCommonGFX(bool defaultTo1XScaler);
/** On some systems, check if the game appears to be run from CD. */
@ -156,14 +185,12 @@ public:
/** Indicate whether an autosave should be performed. */
bool shouldPerformAutoSave(int lastSaveTime);
/** Initialized graphics and shows error message. */
void GUIErrorMessage(const Common::String msg);
/**
* Actual implementation of pauseEngine by subclasses. See there
* for details.
* Initialized graphics and shows error message.
* @todo Move this to a better place (not just engines need to access it, so it neither
* needs to nor should be contained in class Engine)
*/
virtual void pauseEngineIntern(bool pause);
void GUIErrorMessage(const Common::String msg);
};
extern Engine *g_engine;

View file

@ -63,7 +63,7 @@ void Game_v1::playTot(int16 skipPlay) {
strcpy(savedTotName, _curTotFile);
if (skipPlay <= 0) {
while (!_vm->quit()) {
while (!_vm->shouldQuit()) {
for (int i = 0; i < 4; i++) {
_vm->_draw->_fontToSprite[i].sprite = -1;
_vm->_draw->_fontToSprite[i].base = -1;
@ -997,7 +997,7 @@ void Game_v1::collisionsBlock(void) {
WRITE_VAR(16, 0);
_activeCollResId = 0;
}
while ((_activeCollResId == 0) && !_vm->_inter->_terminate && !_vm->quit());
while ((_activeCollResId == 0) && !_vm->_inter->_terminate && !_vm->shouldQuit());
if (((uint16) _activeCollResId & ~0x8000) == collResId) {
collStackPos = 0;

View file

@ -70,7 +70,7 @@ void Game_v2::playTot(int16 skipPlay) {
strcpy(savedTotName, _curTotFile);
if (skipPlay <= 0) {
while (!_vm->quit()) {
while (!_vm->shouldQuit()) {
if (_vm->_inter->_variables)
_vm->_draw->animateCursor(4);
@ -438,7 +438,7 @@ int16 Game_v2::checkCollisions(byte handleMouse, int16 deltaTime, int16 *pResId,
timeKey = _vm->_util->getTimeKey();
while (1) {
if (_vm->_inter->_terminate || _vm->quit()) {
if (_vm->_inter->_terminate || _vm->shouldQuit()) {
if (handleMouse)
_vm->_draw->blitCursor();
return 0;
@ -1043,7 +1043,7 @@ void Game_v2::collisionsBlock(void) {
WRITE_VAR(16, 0);
_activeCollResId = 0;
}
while ((_activeCollResId == 0) && !_vm->_inter->_terminate && !_vm->quit());
while ((_activeCollResId == 0) && !_vm->_inter->_terminate && !_vm->shouldQuit());
if ((_activeCollResId & 0xFFF) == collResId) {
collStackPos = 0;
@ -1465,7 +1465,7 @@ int16 Game_v2::inputArea(int16 xPos, int16 yPos, int16 width, int16 height,
key = checkCollisions(handleMouse, -300, collResId, collIndex);
if ((key != 0) || (*collResId != 0) ||
_vm->_inter->_terminate || _vm->quit())
_vm->_inter->_terminate || _vm->shouldQuit())
break;
if (*pTotTime > 0) {
@ -1479,7 +1479,7 @@ int16 Game_v2::inputArea(int16 xPos, int16 yPos, int16 width, int16 height,
}
if ((key == 0) || (*collResId != 0) ||
_vm->_inter->_terminate || _vm->quit())
_vm->_inter->_terminate || _vm->shouldQuit())
return 0;
switch (key) {

View file

@ -259,7 +259,7 @@ void Inter::funcBlock(int16 retFlag) {
if (executeFuncOpcode(cmd2, cmd, params))
return;
if (_vm->quit())
if (_vm->shouldQuit())
break;
if (_break) {
@ -279,7 +279,7 @@ void Inter::funcBlock(int16 retFlag) {
void Inter::callSub(int16 retFlag) {
byte block;
while (!_vm->quit() && _vm->_global->_inter_execPtr &&
while (!_vm->shouldQuit() && _vm->_global->_inter_execPtr &&
(_vm->_global->_inter_execPtr != _vm->_game->_totFileData)) {
block = *_vm->_global->_inter_execPtr;

View file

@ -750,7 +750,7 @@ void Inter_Bargon::oBargon_intro2(OpGobParams &params) {
for (i = 320; i >= 0; i--) {
_vm->_util->setScrollOffset(i, 0);
if ((_vm->_game->checkKeys(&mouseX, &mouseY, &buttons, 0) == 0x11B) ||
_vm->quit()) {
_vm->shouldQuit()) {
_vm->_palAnim->fade(0, -2, 0);
_vm->_video->clearSurf(_vm->_draw->_frontSurface);
memset((char *) _vm->_draw->_vgaPalette, 0, 768);
@ -760,7 +760,7 @@ void Inter_Bargon::oBargon_intro2(OpGobParams &params) {
break;
}
}
if (!_vm->quit())
if (!_vm->shouldQuit())
_vm->_util->setScrollOffset(0, 0);
surface = 0;
if (VAR(57) == ((uint32) -1))
@ -799,7 +799,7 @@ void Inter_Bargon::oBargon_intro3(OpGobParams &params) {
_vm->_util->longDelay(_vm->_util->getRandom(200));
}
if ((_vm->_game->checkKeys(&mouseX, &mouseY, &buttons, 0) == 0x11B) ||
_vm->quit()) {
_vm->shouldQuit()) {
_vm->_sound->blasterStop(10);
_vm->_palAnim->fade(0, -2, 0);
_vm->_video->clearSurf(_vm->_draw->_frontSurface);

View file

@ -1234,7 +1234,7 @@ bool Inter_v1::o1_repeatUntil(OpFuncParams &params) {
funcBlock(1);
_vm->_global->_inter_execPtr = blockPtr + size + 1;
flag = evalBoolResult();
} while (!flag && !_break && !_terminate && !_vm->quit());
} while (!flag && !_break && !_terminate && !_vm->shouldQuit());
_nestLevel[0]--;
@ -1269,7 +1269,7 @@ bool Inter_v1::o1_whileDo(OpFuncParams &params) {
} else
_vm->_global->_inter_execPtr += size;
if (_break || _terminate || _vm->quit()) {
if (_break || _terminate || _vm->shouldQuit()) {
_vm->_global->_inter_execPtr = blockPtr;
_vm->_global->_inter_execPtr += size;
break;

View file

@ -1490,7 +1490,7 @@ void Inter_v2::o2_scroll() {
curX = startX;
curY = startY;
while (!_vm->quit() && ((curX != endX) || (curY != endY))) {
while (!_vm->shouldQuit() && ((curX != endX) || (curY != endY))) {
curX = stepX > 0 ? MIN(curX + stepX, (int) endX) :
MAX(curX + stepX, (int) endX);
curY = stepY > 0 ? MIN(curY + stepY, (int) endY) :

View file

@ -209,7 +209,7 @@ void Mult::playMult(int16 startFrame, int16 endFrame, char checkEscape,
_frame++;
_vm->_util->waitEndFrame();
} while (!stop && !stopNoClear && !_vm->quit());
} while (!stop && !stopNoClear && !_vm->shouldQuit());
if (!stopNoClear) {
if (_animDataAllocated) {

View file

@ -132,7 +132,7 @@ void PalAnim::fade(Video::PalDesc *palDesc, int16 fadeV, int16 allColors) {
bool stop;
int16 i;
if (_vm->quit())
if (_vm->shouldQuit())
return;
_fadeValue = (fadeV < 0) ? -fadeV : 2;

View file

@ -369,7 +369,7 @@ void Sound::blasterWaitEndPlay(bool interruptible, bool stopComp) {
if (stopComp)
_blaster->endComposition();
while (_blaster->isPlaying() && !_vm->quit()) {
while (_blaster->isPlaying() && !_vm->shouldQuit()) {
if (interruptible && (_vm->_util->checkKey() == 0x11B)) {
WRITE_VAR(57, (uint32) -1);
return;

View file

@ -71,7 +71,7 @@ void Util::longDelay(uint16 msecs) {
_vm->_video->waitRetrace();
processInput();
delay(15);
} while (!_vm->quit() &&
} while (!_vm->shouldQuit() &&
((g_system->getMillis() * _vm->_global->_speedFactor) < time));
}

View file

@ -569,7 +569,7 @@ bool VideoPlayer::doPlay(int16 frame, int16 breakKey,
_vm->_util->processInput();
if (_vm->quit()) {
if (_vm->shouldQuit()) {
_primaryVideo->getVideo()->disableSound();
return true;
}

View file

@ -427,7 +427,7 @@ int MainMenu::handle(int dim) {
Common::Rect menuRect(x + 16, y + 4, x + width - 16, y + 4 + fh * 4);
while (!_vm->quit()) {
while (!_vm->shouldQuit()) {
updateAnimation();
bool mousePressed = getInput();
@ -458,7 +458,7 @@ int MainMenu::handle(int dim) {
_system->delayMillis(10);
}
if (_vm->quit())
if (_vm->shouldQuit())
command = -1;
_screen->copyRegion(backUpX, backUpY, backUpX, backUpY, backUpWidth, backUpHeight, 3, 0);

View file

@ -514,7 +514,7 @@ void KyraEngine_HoF::bookLoop() {
showBookPage();
_bookShown = true;
while (_bookShown && !quit()) {
while (_bookShown && !shouldQuit()) {
checkInput(buttonList);
removeInputTop();

View file

@ -473,7 +473,7 @@ int GUI_LoK::buttonMenuCallback(Button *caller) {
updateAllMenuButtons();
}
while (_displayMenu && !_vm->quit()) {
while (_displayMenu && !_vm->shouldQuit()) {
Common::Point mouse = _vm->getMousePos();
processHighlights(_menu[_toplevelMenu], mouse.x, mouse.y);
processButtonList(_menuButtonList, 0, 0);
@ -593,7 +593,7 @@ int GUI_LoK::saveGameMenu(Button *button) {
_displaySubMenu = true;
_cancelSubMenu = false;
while (_displaySubMenu && !_vm->quit()) {
while (_displaySubMenu && !_vm->shouldQuit()) {
getInput();
Common::Point mouse = _vm->getMousePos();
processHighlights(_menu[2], mouse.x, mouse.y);
@ -642,7 +642,7 @@ int GUI_LoK::loadGameMenu(Button *button) {
_vm->_gameToLoad = -1;
while (_displaySubMenu && !_vm->quit()) {
while (_displaySubMenu && !_vm->shouldQuit()) {
getInput();
Common::Point mouse = _vm->getMousePos();
processHighlights(_menu[2], mouse.x, mouse.y);
@ -730,7 +730,7 @@ int GUI_LoK::saveGame(Button *button) {
}
redrawTextfield();
while (_displaySubMenu && !_vm->quit()) {
while (_displaySubMenu && !_vm->shouldQuit()) {
getInput();
updateSavegameString();
Common::Point mouse = _vm->getMousePos();
@ -810,7 +810,7 @@ bool GUI_LoK::quitConfirm(const char *str) {
_displaySubMenu = true;
_cancelSubMenu = true;
while (_displaySubMenu && !_vm->quit()) {
while (_displaySubMenu && !_vm->shouldQuit()) {
getInput();
Common::Point mouse = _vm->getMousePos();
processHighlights(_menu[1], mouse.x, mouse.y);
@ -876,7 +876,7 @@ int GUI_LoK::gameControlsMenu(Button *button) {
_displaySubMenu = true;
_cancelSubMenu = false;
while (_displaySubMenu && !_vm->quit()) {
while (_displaySubMenu && !_vm->shouldQuit()) {
getInput();
Common::Point mouse = _vm->getMousePos();
processHighlights(_menu[5], mouse.x, mouse.y);

View file

@ -870,7 +870,7 @@ void KyraEngine_MR::processAlbum() {
albumNewPage();
_album.running = true;
while (_album.running && !quit()) {
while (_album.running && !shouldQuit()) {
updateInput();
checkInput(buttonList);
removeInputTop();

View file

@ -409,7 +409,7 @@ void GUI_v2::getInput() {
_vm->checkInput(_menuButtonList);
_vm->removeInputTop();
if (_vm->quit()) {
if (_vm->shouldQuit()) {
_displayMenu = false;
_isLoadMenu = false;
_isSaveMenu = false;
@ -749,7 +749,7 @@ const char *GUI_v2::nameInputProcess(char *buffer, int x, int y, uint8 c1, uint8
_keyPressed.reset();
_cancelNameInput = _finishNameInput = false;
while (running && !_vm->quit()) {
while (running && !_vm->shouldQuit()) {
processHighlights(_savenameMenu, _vm->_mouseX, _vm->_mouseY);
checkTextfieldInput();
if (_keyPressed.keycode == Common::KEYCODE_RETURN || _keyPressed.keycode == Common::KEYCODE_KP_ENTER || _finishNameInput) {

View file

@ -317,7 +317,7 @@ int KyraEngine_HoF::go() {
if (_menuChoice & 1) {
startup();
if (!quit())
if (!shouldQuit())
runLoop();
cleanup();
@ -455,7 +455,7 @@ void KyraEngine_HoF::runLoop() {
_screen->updateScreen();
_runFlag = true;
while (!quit() && _runFlag) {
while (!shouldQuit() && _runFlag) {
if (_deathHandler >= 0) {
removeHandItem();
delay(5);
@ -463,7 +463,7 @@ void KyraEngine_HoF::runLoop() {
_gui->optionsButton(0);
_deathHandler = -1;
if (!_runFlag || !quit())
if (!_runFlag || !shouldQuit())
break;
}
@ -1630,7 +1630,7 @@ void KyraEngine_HoF::loadInvWsa(const char *filename, int run, int delayTime, in
_invWsa.timer = _system->getMillis();
if (run) {
while (_invWsa.running && !skipFlag() && !quit()) {
while (_invWsa.running && !skipFlag() && !shouldQuit()) {
update();
_system->delayMillis(10);
}
@ -2004,7 +2004,7 @@ void KyraEngine_HoF::playTim(const char *filename) {
return;
_tim->resetFinishedFlag();
while (!quit() && !_tim->finished()) {
while (!shouldQuit() && !_tim->finished()) {
_tim->exec(tim, 0);
if (_chatText)
updateWithText();

View file

@ -303,7 +303,7 @@ int KyraEngine_LoK::go() {
if (_gameToLoad == -1) {
setGameFlag(0xEF);
seq_intro();
if (quit())
if (shouldQuit())
return 0;
if (_skipIntroFlag && _abortIntroFlag)
resetGameFlag(0xEF);
@ -402,7 +402,7 @@ void KyraEngine_LoK::startup() {
void KyraEngine_LoK::mainLoop() {
debugC(9, kDebugLevelMain, "KyraEngine_LoK::mainLoop()");
while (!quit()) {
while (!shouldQuit()) {
int32 frameTime = (int32)_system->getMillis();
_skipFlag = false;
@ -449,7 +449,7 @@ void KyraEngine_LoK::mainLoop() {
}
void KyraEngine_LoK::delayUntil(uint32 timestamp, bool updateTimers, bool update, bool isMainLoop) {
while (_system->getMillis() < timestamp && !quit()) {
while (_system->getMillis() < timestamp && !shouldQuit()) {
if (updateTimers)
_timer->update();
@ -531,19 +531,19 @@ void KyraEngine_LoK::delay(uint32 amount, bool update, bool isMainLoop) {
if (_skipFlag && !_abortIntroFlag && !queryGameFlag(0xFE))
_skipFlag = false;
if (amount > 0 && !_skipFlag && !quit())
if (amount > 0 && !_skipFlag && !shouldQuit())
_system->delayMillis(10);
if (_skipFlag)
_sound->voiceStop();
} while (!_skipFlag && _system->getMillis() < start + amount && !quit());
} while (!_skipFlag && _system->getMillis() < start + amount && !shouldQuit());
}
void KyraEngine_LoK::waitForEvent() {
bool finished = false;
Common::Event event;
while (!finished && !quit()) {
while (!finished && !shouldQuit()) {
while (_eventMan->pollEvent(event)) {
switch (event.type) {
case Common::EVENT_KEYDOWN:

View file

@ -263,7 +263,7 @@ int KyraEngine_MR::go() {
running = false;
}
while (running && !quit()) {
while (running && !shouldQuit()) {
_screen->_curPage = 0;
_screen->clearPage(0);
@ -272,14 +272,14 @@ int KyraEngine_MR::go() {
// XXX
playMenuAudioFile();
for (int i = 0; i < 64 && !quit(); ++i) {
for (int i = 0; i < 64 && !shouldQuit(); ++i) {
uint32 nextRun = _system->getMillis() + 3 * _tickLength;
_menuAnim->displayFrame(i, 0);
_screen->updateScreen();
delayUntil(nextRun);
}
for (int i = 64; i > 29 && !quit(); --i) {
for (int i = 64; i > 29 && !shouldQuit(); --i) {
uint32 nextRun = _system->getMillis() + 3 * _tickLength;
_menuAnim->displayFrame(i, 0);
_screen->updateScreen();
@ -1001,7 +1001,7 @@ void KyraEngine_MR::runLoop() {
_eventList.clear();
_runFlag = true;
while (_runFlag && !quit()) {
while (_runFlag && !shouldQuit()) {
if (_deathHandler >= 0) {
removeHandItem();
delay(5);
@ -1009,7 +1009,7 @@ void KyraEngine_MR::runLoop() {
_gui->optionsButton(0);
_deathHandler = -1;
if (quit())
if (shouldQuit())
break;
}

View file

@ -235,7 +235,7 @@ int KyraEngine_v1::resetGameFlag(int flag) {
}
void KyraEngine_v1::delayUntil(uint32 timestamp, bool updateTimers, bool update, bool isMainLoop) {
while (_system->getMillis() < timestamp && !quit()) {
while (_system->getMillis() < timestamp && !shouldQuit()) {
if (timestamp - _system->getMillis() >= 10)
delay(10, update, isMainLoop);
}

View file

@ -159,7 +159,7 @@ void KyraEngine_v2::delay(uint32 amount, bool updateGame, bool isMainLoop) {
if (amount > 0)
_system->delayMillis(amount > 10 ? 10 : amount);
} while (!skipFlag() && _system->getMillis() < start + amount && !quit());
} while (!skipFlag() && _system->getMillis() < start + amount && !shouldQuit());
}
int KyraEngine_v2::checkInput(Button *buttonList, bool mainLoop) {

View file

@ -297,7 +297,7 @@ void LoLEngine::showIntro() {
_screen->hideMouse();
uint32 palNextFadeStep = 0;
while (!_tim->finished() && !quit() && !skipFlag()) {
while (!_tim->finished() && !shouldQuit() && !skipFlag()) {
updateInput();
_tim->exec(intro, false);
_screen->checkedPageUpdate(8, 4);
@ -375,14 +375,14 @@ int LoLEngine::chooseCharacter() {
_screen->fadePalette(_screen->getPalette(0), 30, 0);
bool kingIntro = true;
while (!quit()) {
while (!shouldQuit()) {
if (kingIntro)
kingSelectionIntro();
if (_charSelection < 0)
processCharacterSelection();
if (quit())
if (shouldQuit())
break;
if (_charSelection == 100) {
@ -403,11 +403,11 @@ int LoLEngine::chooseCharacter() {
}
}
if (quit())
if (shouldQuit())
return -1;
uint32 waitTime = _system->getMillis() + 420 * _tickLength;
while (waitTime > _system->getMillis() && !skipFlag() && !quit()) {
while (waitTime > _system->getMillis() && !skipFlag() && !shouldQuit()) {
updateInput();
_system->delayMillis(10);
}
@ -439,7 +439,7 @@ void LoLEngine::kingSelectionIntro() {
_chargenWSA->setDrawPage(0);
int index = 4;
while (_sound->voiceIsPlaying("KING01") && _charSelection == -1 && !quit() && !skipFlag()) {
while (_sound->voiceIsPlaying("KING01") && _charSelection == -1 && !shouldQuit() && !skipFlag()) {
index = MAX(index, 4);
_chargenWSA->displayFrame(_chargenFrameTable[index], 0, 0, 0);
@ -450,7 +450,7 @@ void LoLEngine::kingSelectionIntro() {
_screen->updateScreen();
uint32 waitEnd = _system->getMillis() + 7 * _tickLength;
while (waitEnd > _system->getMillis() && _charSelection == -1 && !quit() && !skipFlag()) {
while (waitEnd > _system->getMillis() && _charSelection == -1 && !shouldQuit() && !skipFlag()) {
_charSelection = getCharSelection();
_system->delayMillis(10);
}
@ -481,7 +481,7 @@ void LoLEngine::kingSelectionReminder() {
_chargenWSA->setDrawPage(0);
int index = 0;
while (_sound->voiceIsPlaying("KING02") && _charSelection == -1 && !quit() && index < 15) {
while (_sound->voiceIsPlaying("KING02") && _charSelection == -1 && !shouldQuit() && index < 15) {
_chargenWSA->displayFrame(_chargenFrameTable[index+9], 0, 0, 0);
_screen->copyRegion(_selectionPosTable[_reminderChar1IdxTable[index]*2+0], _selectionPosTable[_reminderChar1IdxTable[index]*2+1], _charPreviews[0].x, _charPreviews[0].y, 32, 32, 4, 0);
_screen->copyRegion(_selectionPosTable[_reminderChar2IdxTable[index]*2+0], _selectionPosTable[_reminderChar2IdxTable[index]*2+1], _charPreviews[1].x, _charPreviews[1].y, 32, 32, 4, 0);
@ -490,7 +490,7 @@ void LoLEngine::kingSelectionReminder() {
_screen->updateScreen();
uint32 waitEnd = _system->getMillis() + 8 * _tickLength;
while (waitEnd > _system->getMillis() && !quit()) {
while (waitEnd > _system->getMillis() && !shouldQuit()) {
_charSelection = getCharSelection();
_system->delayMillis(10);
}
@ -511,14 +511,14 @@ void LoLEngine::kingSelectionOutro() {
_chargenWSA->setDrawPage(0);
int index = 0;
while (_sound->voiceIsPlaying("KING03") && !quit() && !skipFlag()) {
while (_sound->voiceIsPlaying("KING03") && !shouldQuit() && !skipFlag()) {
index = MAX(index, 4);
_chargenWSA->displayFrame(_chargenFrameTable[index], 0, 0, 0);
_screen->updateScreen();
uint32 waitEnd = _system->getMillis() + 8 * _tickLength;
while (waitEnd > _system->getMillis() && !quit() && !skipFlag()) {
while (waitEnd > _system->getMillis() && !shouldQuit() && !skipFlag()) {
updateInput();
_system->delayMillis(10);
}
@ -537,10 +537,10 @@ void LoLEngine::processCharacterSelection() {
debugC(9, kDebugLevelMain, "LoLEngine::processCharacterSelection()");
_charSelection = -1;
while (!quit() && _charSelection == -1) {
while (!shouldQuit() && _charSelection == -1) {
uint32 nextKingMessage = _system->getMillis() + 900 * _tickLength;
while (nextKingMessage > _system->getMillis() && _charSelection == -1 && !quit()) {
while (nextKingMessage > _system->getMillis() && _charSelection == -1 && !shouldQuit()) {
updateSelectionAnims();
_charSelection = getCharSelection();
_system->delayMillis(10);
@ -659,12 +659,12 @@ void LoLEngine::selectionCharInfoIntro(char *file) {
int index = 0;
file[4] = '0';
while (_charSelectionInfoResult == -1 && !quit()) {
while (_charSelectionInfoResult == -1 && !shouldQuit()) {
if (!_sound->voicePlay(file))
break;
int i = 0;
while (_sound->voiceIsPlaying(file) && _charSelectionInfoResult == -1 && !quit()) {
while (_sound->voiceIsPlaying(file) && _charSelectionInfoResult == -1 && !shouldQuit()) {
_screen->drawShape(0, _screen->getPtrToShape(_screen->getCPagePtr(9), _charInfoFrameTable[i]), 11, 130, 0, 0);
_screen->updateScreen();

View file

@ -179,7 +179,7 @@ Common::SeekableReadStream *KyraEngine_v1::openSaveForReading(const char *filena
Common::WriteStream *KyraEngine_v1::openSaveForWriting(const char *filename, const char *saveName, const Graphics::Surface *thumbnail) const {
debugC(9, kDebugLevelMain, "KyraEngine_v1::openSaveForWriting('%s', '%s', %p)", filename, saveName, (const void *)thumbnail);
if (quit())
if (shouldQuit())
return 0;
Common::WriteStream *out = 0;

View file

@ -221,7 +221,7 @@ void KyraEngine_LoK::loadGame(const char *fileName) {
void KyraEngine_LoK::saveGame(const char *fileName, const char *saveName, const Graphics::Surface *thumb) {
debugC(9, kDebugLevelMain, "KyraEngine_LoK::saveGame('%s', '%s', %p)", fileName, saveName, (const void *)thumb);
if (quit())
if (shouldQuit())
return;
Common::OutSaveFile *out = openSaveForWriting(fileName, saveName, thumb);

View file

@ -277,7 +277,7 @@ int KyraEngine_HoF::trySceneChange(int *moveTable, int unk1, int updateChar) {
int changedScene = 0;
const int *moveTableStart = moveTable;
_unk4 = 0;
while (running && !quit()) {
while (running && !shouldQuit()) {
if (*moveTable >= 0 && *moveTable <= 7) {
_mainCharacter.facing = getOppositeFacingDirection(*moveTable);
unkFlag = true;

View file

@ -654,7 +654,7 @@ int KyraEngine_MR::trySceneChange(int *moveTable, int unk1, int updateChar) {
const int *moveTableStart = moveTable;
_unk4 = 0;
while (running && !quit()) {
while (running && !shouldQuit()) {
if (*moveTable >= 0 && *moveTable <= 7) {
_mainCharacter.facing = getOppositeFacingDirection(*moveTable);
unkFlag = true;

View file

@ -384,7 +384,7 @@ void Screen::fadePalette(const uint8 *palData, int delay, const UpdateFunctor *u
getFadeParams(palData, delay, delayInc, diff);
int delayAcc = 0;
while (!_vm->quit()) {
while (!_vm->shouldQuit()) {
delayAcc += delayInc;
int refreshed = fadePalStep(palData, diff);
@ -401,7 +401,7 @@ void Screen::fadePalette(const uint8 *palData, int delay, const UpdateFunctor *u
delayAcc &= 0xFF;
}
if (_vm->quit()) {
if (_vm->shouldQuit()) {
setScreenPalette(palData);
if (upFunc && upFunc->isValid())
(*upFunc)();
@ -750,7 +750,7 @@ void Screen::shuffleScreen(int sx, int sy, int w, int h, int srcPage, int dstPag
int32 start, now;
int wait;
for (y = 0; y < h && !_vm->quit(); ++y) {
for (y = 0; y < h && !_vm->shouldQuit(); ++y) {
start = (int32)_system->getMillis();
int y_cur = y;
for (x = 0; x < w; ++x) {
@ -775,7 +775,7 @@ void Screen::shuffleScreen(int sx, int sy, int w, int h, int srcPage, int dstPag
copyOverlayRegion(sx, sy, sx, sy, w, h, srcPage, dstPage);
if (_vm->quit()) {
if (_vm->shouldQuit()) {
copyRegion(sx, sy, sx, sy, w, h, srcPage, dstPage);
_system->updateScreen();
}

View file

@ -178,7 +178,7 @@ bool EMCInterpreter::start(EMCState *script, int function) {
}
bool EMCInterpreter::isValid(EMCState *script) {
if (!script->ip || !script->dataPtr || _vm->quit())
if (!script->ip || !script->dataPtr || _vm->shouldQuit())
return false;
return true;
}

View file

@ -23,7 +23,6 @@
*
*/
#include "common/endian.h"
#include "common/system.h"

View file

@ -786,7 +786,7 @@ int KyraEngine_MR::o3_daggerWarning(EMCState *script) {
_screen->_curPage = curPageBackUp;
_screen->showMouse();
while (!quit()) {
while (!shouldQuit()) {
int keys = checkInput(0);
removeInputTop();

View file

@ -625,7 +625,7 @@ bool SeqPlayer::playSequence(const uint8 *seqData, bool skipSeq) {
memset(_seqMovies, 0, sizeof(_seqMovies));
_screen->_curPage = 0;
while (!_seqQuitFlag && !_vm->quit()) {
while (!_seqQuitFlag && !_vm->shouldQuit()) {
if (skipSeq && _vm->seq_skipSequence()) {
while (1) {
uint8 code = *_seqData;

View file

@ -75,7 +75,7 @@ void KyraEngine_HoF::seq_playSequences(int startSeq, int endSeq) {
_seqEndTime = 0;
_menuChoice = 0;
for (int seqNum = startSeq; seqNum <= endSeq && !((skipFlag() && allowSkip) || quit() || (_abortIntroFlag && allowSkip) || _menuChoice); seqNum++) {
for (int seqNum = startSeq; seqNum <= endSeq && !((skipFlag() && allowSkip) || shouldQuit() || (_abortIntroFlag && allowSkip) || _menuChoice); seqNum++) {
_screen->clearPage(0);
_screen->clearPage(8);
memcpy(_screen->getPalette(1), _screen->getPalette(0), 0x300);
@ -131,7 +131,7 @@ void KyraEngine_HoF::seq_playSequences(int startSeq, int endSeq) {
seq_sequenceCommand(cseq.startupCommand);
if (!((skipFlag() && allowSkip) || quit() || (_abortIntroFlag && allowSkip) || _menuChoice)) {
if (!((skipFlag() && allowSkip) || shouldQuit() || (_abortIntroFlag && allowSkip) || _menuChoice)) {
_screen->copyPage(2, 0);
_screen->updateScreen();
}
@ -165,7 +165,7 @@ void KyraEngine_HoF::seq_playSequences(int startSeq, int endSeq) {
_seqWsaCurrentFrame = cseq.startFrame;
bool loop = true;
while (loop && !((skipFlag() && allowSkip) || quit() || (_abortIntroFlag && allowSkip) || _menuChoice)) {
while (loop && !((skipFlag() && allowSkip) || shouldQuit() || (_abortIntroFlag && allowSkip) || _menuChoice)) {
_seqEndTime = _system->getMillis() + _seqFrameDelay * _tickLength;
if (_seqWsa || !cb)
@ -189,16 +189,16 @@ void KyraEngine_HoF::seq_playSequences(int startSeq, int endSeq) {
seq_processWSAs();
seq_processText();
if ((_seqWsa || !cb) && !((skipFlag() && allowSkip) || quit() || (_abortIntroFlag && allowSkip) || _menuChoice)) {
if ((_seqWsa || !cb) && !((skipFlag() && allowSkip) || shouldQuit() || (_abortIntroFlag && allowSkip) || _menuChoice)) {
_screen->copyPage(2, 0);
_screen->updateScreen();
}
bool loop2 = true;
while (loop2 && !((skipFlag() && allowSkip) || quit() || (_abortIntroFlag && allowSkip) || _menuChoice)) {
while (loop2 && !((skipFlag() && allowSkip) || shouldQuit() || (_abortIntroFlag && allowSkip) || _menuChoice)) {
if (_seqWsa) {
seq_processText();
if (!((skipFlag() && allowSkip) || quit() || (_abortIntroFlag && allowSkip) || _menuChoice)) {
if (!((skipFlag() && allowSkip) || shouldQuit() || (_abortIntroFlag && allowSkip) || _menuChoice)) {
_screen->copyPage(2, 0);
_screen->updateScreen();
}
@ -230,7 +230,7 @@ void KyraEngine_HoF::seq_playSequences(int startSeq, int endSeq) {
} else {
_seqFrameDelay = cseq.frameDelay;
_seqEndTime = _system->getMillis() + _seqFrameDelay * _tickLength;
while (!((skipFlag() && allowSkip) || quit() || (_abortIntroFlag && allowSkip) || _menuChoice)) {
while (!((skipFlag() && allowSkip) || shouldQuit() || (_abortIntroFlag && allowSkip) || _menuChoice)) {
_seqSubFrameStartTime = _system->getMillis();
seq_processWSAs();
if (cb)
@ -262,7 +262,7 @@ void KyraEngine_HoF::seq_playSequences(int startSeq, int endSeq) {
dl = ct;
_seqEndTime = _system->getMillis() + dl;
while (!((skipFlag() && allowSkip) || quit() || (_abortIntroFlag && allowSkip) || _menuChoice)) {
while (!((skipFlag() && allowSkip) || shouldQuit() || (_abortIntroFlag && allowSkip) || _menuChoice)) {
_seqSubFrameStartTime = _system->getMillis();
seq_processWSAs();
@ -2267,7 +2267,7 @@ void KyraEngine_HoF::seq_loadNestedSequence(int wsaNum, int seqNum) {
void KyraEngine_HoF::seq_nestedSequenceFrame(int command, int wsaNum) {
int xa = 0, ya = 0;
command--;
if (!_activeWSA[wsaNum].movie || skipFlag() || quit() || _abortIntroFlag)
if (!_activeWSA[wsaNum].movie || skipFlag() || shouldQuit() || _abortIntroFlag)
return;
switch (command) {
@ -2467,7 +2467,7 @@ bool KyraEngine_HoF::seq_processNextSubFrame(int wsaNum) {
void KyraEngine_HoF::seq_printCreditsString(uint16 strIndex, int x, int y, const uint8 *colorMap, uint8 textcolor) {
uint8 colormap[16];
if (skipFlag() || quit() || _abortIntroFlag || _menuChoice)
if (skipFlag() || shouldQuit() || _abortIntroFlag || _menuChoice)
return;
memset(&_screen->getPalette(0)[0x2fa], 0x3f, 6);
@ -2957,7 +2957,7 @@ void KyraEngine_HoF::seq_makeBookAppear() {
++_invWsa.curFrame;
if (_invWsa.curFrame >= _invWsa.lastFrame && !quit())
if (_invWsa.curFrame >= _invWsa.lastFrame && !shouldQuit())
break;
switch (_invWsa.curFrame) {

View file

@ -163,7 +163,7 @@ void KyraEngine_LoK::seq_introLogos() {
_screen->updateScreen();
_screen->fadeFromBlack();
if (_seq->playSequence(_seq_WestwoodLogo, _skipFlag) || quit()) {
if (_seq->playSequence(_seq_WestwoodLogo, _skipFlag) || shouldQuit()) {
_screen->fadeToBlack();
_screen->clearPage(0);
return;
@ -175,14 +175,14 @@ void KyraEngine_LoK::seq_introLogos() {
_screen->setScreenPalette(_screen->_currentPalette);
}
if ((_seq->playSequence(_seq_KyrandiaLogo, _skipFlag) && !seq_skipSequence()) || quit()) {
if ((_seq->playSequence(_seq_KyrandiaLogo, _skipFlag) && !seq_skipSequence()) || shouldQuit()) {
_screen->fadeToBlack();
_screen->clearPage(0);
return;
}
_screen->fillRect(0, 179, 319, 199, 0);
if (quit())
if (shouldQuit())
return;
if (_flags.platform == Common::kPlatformAmiga) {
@ -222,10 +222,10 @@ void KyraEngine_LoK::seq_introLogos() {
oldDistance = distance;
delay(10);
} while (!doneFlag && !quit() && !_abortIntroFlag);
} while (!doneFlag && !shouldQuit() && !_abortIntroFlag);
}
if (quit())
if (shouldQuit())
return;
_seq->playSequence(_seq_Forest, true);
@ -1029,7 +1029,7 @@ void KyraEngine_LoK::seq_brandonToStone() {
void KyraEngine_LoK::seq_playEnding() {
debugC(9, kDebugLevelMain, "KyraEngine_LoK::seq_playEnding()");
if (quit())
if (shouldQuit())
return;
_screen->hideMouse();
_screen->_curPage = 0;
@ -1210,7 +1210,7 @@ void KyraEngine_LoK::seq_playCredits() {
bool KyraEngine_LoK::seq_skipSequence() const {
debugC(9, kDebugLevelMain, "KyraEngine_LoK::seq_skipSequence()");
return quit() || _abortIntroFlag;
return shouldQuit() || _abortIntroFlag;
}
int KyraEngine_LoK::handleMalcolmFlag() {

View file

@ -23,8 +23,6 @@
*
*/
#include "kyra/kyra_v1.h"
#include "kyra/screen.h"
#include "kyra/text.h"

View file

@ -335,7 +335,7 @@ void KyraEngine_HoF::objectChatWaitToFinish() {
const uint32 endTime = _chatEndTime;
resetSkipFlag();
while (running && !quit()) {
while (running && !shouldQuit()) {
if (!_emc->isValid(&_chatScriptState))
_emc->start(&_chatScriptState, 1);
@ -353,7 +353,7 @@ void KyraEngine_HoF::objectChatWaitToFinish() {
uint32 nextFrame = _system->getMillis() + delayTime * _tickLength;
while (_system->getMillis() < nextFrame && !quit()) {
while (_system->getMillis() < nextFrame && !shouldQuit()) {
updateWithText();
const uint32 curTime = _system->getMillis();
@ -593,7 +593,7 @@ void KyraEngine_HoF::initTalkObject(int index) {
if (_currentTalkSections.STATim) {
_tim->resetFinishedFlag();
while (!quit() && !_tim->finished()) {
while (!shouldQuit() && !_tim->finished()) {
_tim->exec(_currentTalkSections.STATim, false);
if (_chatText)
updateWithText();
@ -609,7 +609,7 @@ void KyraEngine_HoF::deinitTalkObject(int index) {
if (_currentTalkSections.ENDTim) {
_tim->resetFinishedFlag();
while (!quit() && !_tim->finished()) {
while (!shouldQuit() && !_tim->finished()) {
_tim->exec(_currentTalkSections.ENDTim, false);
if (_chatText)
updateWithText();
@ -647,10 +647,10 @@ void KyraEngine_HoF::npcChatSequence(const char *str, int objectId, int vocHigh,
_chatVocHigh = _chatVocLow = -1;
}
while (((textEnabled() && _chatEndTime > _system->getMillis()) || (speechEnabled() && snd_voiceIsPlaying())) && !(quit() || skipFlag())) {
while (((textEnabled() && _chatEndTime > _system->getMillis()) || (speechEnabled() && snd_voiceIsPlaying())) && !(shouldQuit() || skipFlag())) {
if ((!speechEnabled() && chatAnimEndTime > _system->getMillis()) || (speechEnabled() && snd_voiceIsPlaying())) {
_tim->resetFinishedFlag();
while (!_tim->finished() && !skipFlag() && !quit()) {
while (!_tim->finished() && !skipFlag() && !shouldQuit()) {
if (_currentTalkSections.TLKTim)
_tim->exec(_currentTalkSections.TLKTim, false);
else

View file

@ -349,7 +349,7 @@ void KyraEngine_MR::objectChatWaitToFinish() {
const uint32 endTime = _chatEndTime;
resetSkipFlag();
while (running && !quit()) {
while (running && !shouldQuit()) {
if (!_emc->isValid(&_chatScriptState))
_emc->start(&_chatScriptState, 1);
@ -367,7 +367,7 @@ void KyraEngine_MR::objectChatWaitToFinish() {
uint32 nextFrame = _system->getMillis() + delayTime * _tickLength;
while (_system->getMillis() < nextFrame && !quit()) {
while (_system->getMillis() < nextFrame && !shouldQuit()) {
updateWithText();
const uint32 curTime = _system->getMillis();
@ -419,7 +419,7 @@ void KyraEngine_MR::badConscienceChatWaitToFinish() {
uint32 nextFrame = _system->getMillis() + _rnd.getRandomNumberRng(4, 8) * _tickLength;
int frame = _badConscienceFrameTable[_badConscienceAnim+24];
while (running && !quit()) {
while (running && !shouldQuit()) {
if (nextFrame < _system->getMillis()) {
++frame;
if (_badConscienceFrameTable[_badConscienceAnim+32] < frame)
@ -477,7 +477,7 @@ void KyraEngine_MR::goodConscienceChatWaitToFinish() {
uint32 nextFrame = _system->getMillis() + _rnd.getRandomNumberRng(3, 6) * _tickLength;
int frame = _goodConscienceFrameTable[_goodConscienceAnim+15];
while (running && !quit()) {
while (running && !shouldQuit()) {
if (nextFrame < _system->getMillis()) {
++frame;
if (_goodConscienceFrameTable[_goodConscienceAnim+20] < frame)
@ -597,7 +597,7 @@ void KyraEngine_MR::albumChatWaitToFinish() {
uint32 nextFrame = 0;
int frame = 12;
while (running && !quit()) {
while (running && !shouldQuit()) {
if (nextFrame < _system->getMillis()) {
++frame;
if (frame > 22)

View file

@ -141,9 +141,9 @@ void Mouse::waitForRelease() {
LureEngine &engine = LureEngine::getReference();
do {
while (e.pollEvent() && !engine.quit()) ;
while (e.pollEvent() && !engine.shouldQuit()) ;
g_system->delayMillis(20);
} while (!engine.quit() && (lButton() || rButton() || mButton()));
} while (!engine.shouldQuit() && (lButton() || rButton() || mButton()));
}
/*--------------------------------------------------------------------------*/
@ -211,7 +211,7 @@ bool Events::interruptableDelay(uint32 milliseconds) {
uint32 delayCtr = g_system->getMillis() + milliseconds;
while (g_system->getMillis() < delayCtr) {
if (engine.quit()) return true;
if (engine.shouldQuit()) return true;
if (events.pollEvent()) {
if (((events.type() == Common::EVENT_KEYDOWN) && (events.event().kbd.ascii != 0)) ||

View file

@ -117,7 +117,7 @@ void FightsManager::fightLoop() {
uint32 timerVal = g_system->getMillis();
// Loop for the duration of the battle
while (!engine.quit() && (playerFight.fwhits != GENERAL_MAGIC_ID)) {
while (!engine.shouldQuit() && (playerFight.fwhits != GENERAL_MAGIC_ID)) {
checkEvents();
if (g_system->getMillis() > timerVal + GAME_FRAME_DELAY) {

View file

@ -151,7 +151,7 @@ void Game::execute() {
bool initialRestart = true;
while (!engine.quit()) {
while (!engine.shouldQuit()) {
if ((_state & GS_RESTART) != 0) {
res.reset();
@ -171,7 +171,7 @@ void Game::execute() {
mouse.cursorOn();
// Main game loop
while (!engine.quit() && ((_state & GS_RESTART) == 0)) {
while (!engine.shouldQuit() && ((_state & GS_RESTART) == 0)) {
// If time for next frame, allow everything to update
if (system.getMillis() > timerVal + GAME_FRAME_DELAY) {
timerVal = system.getMillis();
@ -1025,7 +1025,7 @@ bool Game::getYN() {
}
g_system->delayMillis(10);
} while (!engine.quit() && !breakFlag);
} while (!engine.shouldQuit() && !breakFlag);
screen.update();
if (!vKbdFlag)

View file

@ -60,13 +60,13 @@ bool Introduction::showScreen(uint16 screenId, uint16 paletteId, uint16 delaySiz
screen.update();
Palette p(paletteId);
if (LureEngine::getReference().quit()) return true;
if (LureEngine::getReference().shouldQuit()) return true;
if (isEGA) screen.setPalette(&p);
else screen.paletteFadeIn(&p);
bool result = interruptableDelay(delaySize);
if (LureEngine::getReference().quit()) return true;
if (LureEngine::getReference().shouldQuit()) return true;
if (!isEGA)
screen.paletteFadeOut();
@ -84,7 +84,7 @@ bool Introduction::interruptableDelay(uint32 milliseconds) {
if (events.interruptableDelay(milliseconds)) {
if (events.type() == Common::EVENT_KEYDOWN)
return events.event().kbd.keycode == 27;
else if (LureEngine::getReference().quit())
else if (LureEngine::getReference().shouldQuit())
return true;
else if (events.type() == Common::EVENT_LBUTTONDOWN)
return false;

View file

@ -136,7 +136,7 @@ int LureEngine::go() {
CopyProtectionDialog *dialog = new CopyProtectionDialog();
bool result = dialog->show();
delete dialog;
if (quit())
if (shouldQuit())
return 0;
if (!result)
@ -153,7 +153,7 @@ int LureEngine::go() {
}
// Play the game
if (!quit()) {
if (!shouldQuit()) {
// Play the game
Sound.loadSection(Sound.isRoland() ? ROLAND_MAIN_SOUND_RESOURCE_ID : ADLIB_MAIN_SOUND_RESOURCE_ID);
gameInstance->execute();

View file

@ -131,7 +131,7 @@ uint8 Menu::execute() {
while (mouse.lButton() || mouse.rButton()) {
while (events.pollEvent()) {
if (engine.quit()) return MENUITEM_NONE;
if (engine.shouldQuit()) return MENUITEM_NONE;
if (mouse.y() < MENUBAR_Y_SIZE) {
MenuRecord *p = getMenuAt(mouse.x());
@ -547,7 +547,7 @@ uint16 PopupMenu::Show(int numEntries, const char *actions[]) {
}
while (e.pollEvent()) {
if (engine.quit()) {
if (engine.shouldQuit()) {
selectedIndex = 0xffff;
goto bail_out;

View file

@ -221,7 +221,7 @@ void Script::endgameSequence(uint16 v1, uint16 v2, uint16 v3) {
anim->show();
if (!events.interruptableDelay(30000)) {
// No key yet pressed, so keep waiting
while (Sound.musicInterface_CheckPlaying(6) && !engine.quit()) {
while (Sound.musicInterface_CheckPlaying(6) && !engine.shouldQuit()) {
if (events.interruptableDelay(20))
break;
}

View file

@ -534,7 +534,7 @@ bool Surface::getString(Common::String &line, int maxSize, bool isNumeric, bool
// Loop until the input string changes
refreshFlag = false;
while (!refreshFlag && !abortFlag) {
abortFlag = engine.quit();
abortFlag = engine.shouldQuit();
if (abortFlag) break;
while (events.pollEvent()) {
@ -976,7 +976,7 @@ bool SaveRestoreDialog::show(bool saveDialog) {
// Provide highlighting of lines to select a save slot
while (!abortFlag && !(mouse.lButton() && (selectedLine != -1))
&& !mouse.rButton() && !mouse.mButton()) {
abortFlag = engine.quit();
abortFlag = engine.shouldQuit();
if (abortFlag) break;
while (events.pollEvent()) {
@ -1179,7 +1179,7 @@ bool RestartRestoreDialog::show() {
// Event loop for making selection
bool buttonPressed = false;
while (!engine.quit()) {
while (!engine.shouldQuit()) {
// Handle events
while (events.pollEvent()) {
if ((events.type() == Common::EVENT_LBUTTONDOWN) && (highlightedButton != -1)) {
@ -1231,7 +1231,7 @@ bool RestartRestoreDialog::show() {
Sound.killSounds();
if (!restartFlag && !engine.quit()) {
if (!restartFlag && !engine.shouldQuit()) {
// Need to show Restore game dialog
if (!SaveRestoreDialog::show(false))
// User cancelled, so fall back on Restart
@ -1351,7 +1351,7 @@ bool CopyProtectionDialog::show() {
// Clear any prior try
_charIndex = 0;
while (!engine.quit()) {
while (!engine.shouldQuit()) {
while (events.pollEvent() && (_charIndex < 4)) {
if (events.type() == Common::EVENT_KEYDOWN) {
if ((events.event().kbd.keycode == Common::KEYCODE_BACKSPACE) && (_charIndex > 0)) {
@ -1385,7 +1385,7 @@ bool CopyProtectionDialog::show() {
break;
}
if (engine.quit())
if (engine.shouldQuit())
return false;
// At this point, two page numbers have been entered - validate them

View file

@ -357,7 +357,7 @@ void CommandExec::runList(CommandList::iterator first, CommandList::iterator las
_ctxt.suspend = false;
for ( ; first != last; first++) {
if (_vm->quit())
if (_vm->shouldQuit())
break;
CommandPtr cmd = *first;

View file

@ -326,7 +326,7 @@ void Parallaction::processInput(int event) {
void Parallaction::runGame() {
int event = _input->updateInput();
if (quit())
if (shouldQuit())
return;
runGuiFrame();
@ -337,7 +337,7 @@ void Parallaction::runGame() {
processInput(event);
runPendingZones();
if (quit())
if (shouldQuit())
return;
if (_engineFlags & kEngineChangeLocation) {

View file

@ -104,7 +104,7 @@ int Parallaction_br::go() {
bool splash = true;
while (!quit()) {
while (!shouldQuit()) {
if (getFeatures() & GF_DEMO) {
scheduleLocationSwitch("camalb.1");
@ -117,7 +117,7 @@ int Parallaction_br::go() {
// initCharacter();
while (((_engineFlags & kEngineReturn) == 0) && (!quit())) {
while (((_engineFlags & kEngineReturn) == 0) && (!shouldQuit())) {
runGame();
}
_engineFlags &= ~kEngineReturn;

View file

@ -231,7 +231,7 @@ int Parallaction_ns::go() {
startGui();
while (!quit()) {
while (!shouldQuit()) {
runGame();
}

View file

@ -2076,7 +2076,7 @@ bool LogicDemo::changeToSpecialRoom() {
displayRoom(currentRoom(), RDM_FADE_NOJOE, 100, 2, true);
playCutaway("CLOGO.CUT");
sceneReset();
if (_vm->quit())
if (_vm->shouldQuit())
return true;
currentRoom(ROOM_HOTEL_LOBBY);
entryObj(584);
@ -2131,10 +2131,10 @@ bool LogicGame::changeToSpecialRoom() {
} else if (currentRoom() == FOTAQ_LOGO && gameState(VAR_INTRO_PLAYED) == 0) {
displayRoom(currentRoom(), RDM_FADE_NOJOE, 100, 2, true);
playCutaway("COPY.CUT");
if (_vm->quit())
if (_vm->shouldQuit())
return true;
playCutaway("CLOGO.CUT");
if (_vm->quit())
if (_vm->shouldQuit())
return true;
if (_vm->resource()->getPlatform() != Common::kPlatformAmiga) {
if (ConfMan.getBool("alt_intro") && _vm->resource()->isCD()) {
@ -2143,10 +2143,10 @@ bool LogicGame::changeToSpecialRoom() {
playCutaway("CDINT.CUT");
}
}
if (_vm->quit())
if (_vm->shouldQuit())
return true;
playCutaway("CRED.CUT");
if (_vm->quit())
if (_vm->shouldQuit())
return true;
_vm->display()->palSetPanel();
sceneReset();

View file

@ -437,7 +437,7 @@ int QueenEngine::go() {
}
_lastSaveTime = _lastUpdateTime = _system->getMillis();
while (!quit()) {
while (!shouldQuit()) {
if (_logic->newRoom() > 0) {
_logic->update();
_logic->oldRoom(_logic->currentRoom());

View file

@ -807,7 +807,7 @@ void Talk::speakSegment(
switch (command) {
case SPEAK_PAUSE:
for (i = 0; i < 10 && !_vm->input()->talkQuit() && !_vm->quit(); i++) {
for (i = 0; i < 10 && !_vm->input()->talkQuit() && !_vm->shouldQuit(); i++) {
_vm->update();
}
return;

View file

@ -59,11 +59,11 @@ int Scene::IHNMStartProc() {
// Play Cyberdreams logo for 168 frames
if (!playTitle(0, logoLength, true)) {
if (_vm->quit())
if (_vm->shouldQuit())
return !SUCCESS;
// Play Dreamers Guild logo for 10 seconds
if (!playLoopingTitle(1, 10)) {
if (_vm->quit())
if (_vm->shouldQuit())
return !SUCCESS;
// Play the title music
_vm->_music->play(1, MUSIC_NORMAL);
@ -74,7 +74,7 @@ int Scene::IHNMStartProc() {
} else {
_vm->_music->play(1, MUSIC_NORMAL);
playTitle(0, 10);
if (_vm->quit())
if (_vm->shouldQuit())
return !SUCCESS;
playTitle(2, 12);
}
@ -193,7 +193,7 @@ bool Scene::playTitle(int title, int time, int mode) {
_vm->_gfx->getCurrentPal(pal_cut);
while (!done && !_vm->quit()) {
while (!done && !_vm->shouldQuit()) {
curTime = _vm->_system->getMillis();
switch (phase) {

View file

@ -270,7 +270,7 @@ int SagaEngine::go() {
uint32 currentTicks;
while (!quit()) {
while (!shouldQuit()) {
if (_console->isAttached())
_console->onFrame();

View file

@ -99,7 +99,7 @@ void CUP_Player::play() {
debug(1, "rate %d width %d height %d", _playbackRate, _width, _height);
int ticks = _system->getMillis();
while (_dataSize != 0 && !_vm->quit()) {
while (_dataSize != 0 && !_vm->shouldQuit()) {
while (parseNextBlockTag(_fileStream)) {
if (_fileStream.ioFailed()) {
return;
@ -190,7 +190,7 @@ void CUP_Player::waitForSfxChannel(int channel) {
CUP_SfxChannel *sfxChannel = &_sfxChannels[channel];
debug(1, "waitForSfxChannel %d", channel);
if ((sfxChannel->flags & kSfxFlagLoop) == 0) {
while (_mixer->isSoundHandleActive(sfxChannel->handle) && !_vm->quit()) {
while (_mixer->isSoundHandleActive(sfxChannel->handle) && !_vm->shouldQuit()) {
_vm->parseEvents();
_system->delayMillis(10);
}

View file

@ -24,7 +24,6 @@
*/
#include "common/config-manager.h"
#include "common/md5.h"
#include "common/events.h"
@ -1726,7 +1725,7 @@ int ScummEngine::go() {
int diff = 0; // Duration of one loop iteration
while (!quit()) {
while (!shouldQuit()) {
if (_debugger->isAttached())
_debugger->onFrame();
@ -1759,7 +1758,7 @@ int ScummEngine::go() {
diff = _system->getMillis() - diff;
if (quit()) {
if (shouldQuit()) {
// TODO: Maybe perform an autosave on exit?
}
}
@ -1777,7 +1776,7 @@ void ScummEngine::waitForTimer(int msec_delay) {
start_time = _system->getMillis();
while (!quit()) {
while (!shouldQuit()) {
_sound->updateCD(); // Loop CD Audio if needed
parseEvents();
_system->updateScreen();
@ -1900,7 +1899,7 @@ load_game:
checkExecVerbs();
checkAndRunSentenceScript();
if (quit())
if (shouldQuit())
return;
// HACK: If a load was requested, immediately perform it. This avoids

View file

@ -1254,7 +1254,7 @@ void SmushPlayer::play(const char *filename, int32 speed, int32 offset, int32 st
}
if (_endOfFile)
break;
if (_vm->quit() || _vm->_saveLoadFlag || _vm->_smushVideoShouldFinish) {
if (_vm->shouldQuit() || _vm->_saveLoadFlag || _vm->_smushVideoShouldFinish) {
_smixer->stop();
_vm->_mixer->stopHandle(_compressedFileSoundHandle);
_vm->_mixer->stopHandle(_IACTchannel);

View file

@ -496,7 +496,7 @@ void Control::doControlPanel(void) {
_curButtonText = 0;
uint16 clickRes = 0;
while (!quitPanel && !g_engine->quit()) {
while (!quitPanel && !g_engine->shouldQuit()) {
_text->drawToScreen(WITH_MASK);
_system->updateScreen();
_mouseClicked = false;
@ -528,7 +528,7 @@ void Control::doControlPanel(void) {
}
memset(_screenBuf, 0, GAME_SCREEN_WIDTH * FULL_SCREEN_HEIGHT);
_system->copyRectToScreen(_screenBuf, GAME_SCREEN_WIDTH, 0, 0, GAME_SCREEN_WIDTH, FULL_SCREEN_HEIGHT);
if (!g_engine->quit())
if (!g_engine->shouldQuit())
_system->updateScreen();
_skyScreen->forceRefresh();
_skyScreen->setPaletteEndian((uint8 *)_skyCompact->fetchCpt(SkyEngine::_systemVars.currentPalette));
@ -879,7 +879,7 @@ uint16 Control::saveRestorePanel(bool allowSave) {
bool refreshNames = true;
bool refreshAll = true;
uint16 clickRes = 0;
while (!quitPanel && !g_engine->quit()) {
while (!quitPanel && !g_engine->shouldQuit()) {
clickRes = 0;
if (refreshNames || refreshAll) {
if (refreshAll) {

View file

@ -365,7 +365,7 @@ int SkyEngine::go() {
introSkipped = !_skyIntro->doIntro(_floppyIntro);
}
if (!quit()) {
if (!shouldQuit()) {
_skyLogic->initScreen0();
if (introSkipped)
_skyControl->restartGame();
@ -375,7 +375,7 @@ int SkyEngine::go() {
_lastSaveTime = _system->getMillis();
uint32 delayCount = _system->getMillis();
while (!quit()) {
while (!shouldQuit()) {
if (_debugger->isAttached())
_debugger->onFrame();

View file

@ -302,7 +302,7 @@ void MoviePlayer::play(void) {
break;
}
}
if (_vm->quit())
if (_vm->shouldQuit())
terminated = true;
}

View file

@ -215,7 +215,7 @@ void Control::askForCd(void) {
notAccepted = false;
}
}
} while (notAccepted && (!g_engine->quit()));
} while (notAccepted && (!g_engine->shouldQuit()));
_resMan->resClose(fontId);
free(_screenBuf);
@ -317,7 +317,7 @@ uint8 Control::runPanel(void) {
}
delay(1000 / 12);
newMode = getClicks(mode, &retVal);
} while ((newMode != BUTTON_DONE) && (retVal == 0) && (!g_engine->quit()));
} while ((newMode != BUTTON_DONE) && (retVal == 0) && (!g_engine->shouldQuit()));
if (SwordEngine::_systemVars.controlPanelMode == CP_NORMAL) {
uint8 volL, volR;

View file

@ -125,7 +125,7 @@ void CreditsPlayer::play(void) {
uint16 renderY = BUFSIZE_Y / 2;
uint16 clearY = 0xFFFF;
bool clearLine = false;
while (((*textData != FNT_EOB) || (scrollY != renderY)) && !g_engine->quit()) {
while (((*textData != FNT_EOB) || (scrollY != renderY)) && !g_engine->shouldQuit()) {
if ((int32)_mixer->getSoundElapsedTime(bgSound) - relDelay < (SCROLL_TIMING * 2)) { // sync to audio
if (scrollY < BUFSIZE_Y - CREDITS_Y)
_system->copyRectToScreen(screenBuf + scrollY * CREDITS_X, CREDITS_X, START_X, START_Y, CREDITS_X, CREDITS_Y);
@ -175,7 +175,7 @@ void CreditsPlayer::play(void) {
uint8 *revoBuf = credFile.decompressFile(REVO_LOGO);
uint8 *revoPal = credFile.fetchFile(REVO_PAL, &_palLen);
_palLen /= 3;
while ((_mixer->getSoundElapsedTime(bgSound) < LOGO_FADEUP_TIME) && !g_engine->quit()) {
while ((_mixer->getSoundElapsedTime(bgSound) < LOGO_FADEUP_TIME) && !g_engine->shouldQuit()) {
delay(100);
}
memset(_palette, 0, 256 * 4);
@ -184,13 +184,13 @@ void CreditsPlayer::play(void) {
_system->updateScreen();
fadePalette(revoPal, true, _palLen);
while ((_mixer->getSoundElapsedTime(bgSound) < LOGO_FADEDOWN_TIME) && !g_engine->quit()) {
while ((_mixer->getSoundElapsedTime(bgSound) < LOGO_FADEDOWN_TIME) && !g_engine->shouldQuit()) {
delay(100);
}
fadePalette(revoPal, false, _palLen);
delay(3000);
if (g_engine->quit())
if (g_engine->shouldQuit())
_mixer->stopAll();
free(revoBuf);
}
@ -200,7 +200,7 @@ void CreditsPlayer::fadePalette(uint8 *srcPal, bool fadeup, uint16 len) {
int fadeStart = fadeup ? 0 : 12;
int relDelay = _system->getMillis();
for (int fadeStep = fadeStart; (fadeStep >= 0) && (fadeStep <= 12) && !g_engine->quit(); fadeStep += fadeDir) {
for (int fadeStep = fadeStart; (fadeStep >= 0) && (fadeStep <= 12) && !g_engine->shouldQuit(); fadeStep += fadeDir) {
for (uint16 cnt = 0; cnt < len * 3; cnt++)
_palette[(cnt / 3) * 4 + (cnt % 3)] = (srcPal[cnt] * fadeStep) / 12;
_system->setPalette(_palette, 0, 256);
@ -293,7 +293,7 @@ void CreditsPlayer::delay(int msecs) {
if (msecs > 0)
_system->delayMillis(10);
} while ((_system->getMillis() < start + msecs) && !g_engine->quit());
} while ((_system->getMillis() < start + msecs) && !g_engine->shouldQuit());
}
ArcFile::ArcFile(void) {

View file

@ -703,7 +703,7 @@ int SwordEngine::go() {
_systemVars.controlPanelMode = CP_NEWGAME;
if (_control->runPanel() == CONTROL_GAME_RESTORED)
_control->doRestore();
else if (!quit())
else if (!shouldQuit())
_logic->startPositions(0);
} else {
// no savegames, start new game.
@ -712,10 +712,10 @@ int SwordEngine::go() {
}
_systemVars.controlPanelMode = CP_NORMAL;
while (!quit()) {
while (!shouldQuit()) {
uint8 action = mainLoop();
if (!quit()) {
if (!shouldQuit()) {
// the mainloop was left, we have to reinitialize.
reinitialize();
if (action == CONTROL_GAME_RESTORED)
@ -756,7 +756,7 @@ uint8 SwordEngine::mainLoop(void) {
uint8 retCode = 0;
_keyPressed.reset();
while ((retCode == 0) && (!quit())) {
while ((retCode == 0) && (!shouldQuit())) {
// do we need the section45-hack from sword.c here?
checkCd();
@ -805,9 +805,9 @@ uint8 SwordEngine::mainLoop(void) {
}
_mouseState = 0;
_keyPressed.reset();
} while ((Logic::_scriptVars[SCREEN] == Logic::_scriptVars[NEW_SCREEN]) && (retCode == 0) && (!quit()));
} while ((Logic::_scriptVars[SCREEN] == Logic::_scriptVars[NEW_SCREEN]) && (retCode == 0) && (!shouldQuit()));
if ((retCode == 0) && (Logic::_scriptVars[SCREEN] != 53) && _systemVars.wantFade && (!quit())) {
if ((retCode == 0) && (Logic::_scriptVars[SCREEN] != 53) && _systemVars.wantFade && (!shouldQuit())) {
_screen->fadeDownPalette();
int32 relDelay = (int32)_system->getMillis();
while (_screen->stillFading()) {

View file

@ -379,7 +379,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->shouldQuit())
return;
_numSpeechLines = numLines;

View file

@ -396,7 +396,7 @@ int Dialog::runModal() {
_vm->_system->delayMillis(20);
if (_vm->quit())
if (_vm->shouldQuit())
setResult(0);
}
@ -842,7 +842,7 @@ int StartDialog::runModal() {
if (startDialog.runModal())
return 1;
if (_vm->quit())
if (_vm->shouldQuit())
return 0;
RestoreDialog restoreDialog(_vm);
@ -850,7 +850,7 @@ int StartDialog::runModal() {
if (restoreDialog.runModal())
return 0;
if (_vm->quit())
if (_vm->shouldQuit())
return 0;
}

View file

@ -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->shouldQuit()) {
updateDisplay();
_vm->_system->delayMillis(20);
}

View file

@ -412,7 +412,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->shouldQuit())
g_system->quit();
// If the file is supposed to be on hard disk, or we're

View file

@ -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->shouldQuit()) {
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->shouldQuit()) {
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->shouldQuit()) {
updateDisplay(false);
_vm->_system->delayMillis(100);
}
}
if (_vm->quit())
if (_vm->shouldQuit())
return;
waitForFade();

View file

@ -421,7 +421,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 (shouldQuit())
return 0;
if (result)
@ -493,7 +493,7 @@ int Sword2Engine::go() {
// because we want the break to happen before updating the
// screen again.
if (quit())
if (shouldQuit())
break;
// creates the debug text blocks

View file

@ -740,7 +740,7 @@ int TinselEngine::go() {
// Foreground loop
while (!quit()) {
while (!shouldQuit()) {
assert(_console);
if (_console->isAttached())
_console->onFrame();

View file

@ -433,7 +433,7 @@ void ToucheEngine::handleOptions(int forceDisplay) {
_system->delayMillis(10);
}
_fullRedrawCounter = 2;
if (!menuData.exit && quit()) {
if (!menuData.exit && shouldQuit()) {
if (displayQuitDialog())
quitGame();
}

View file

@ -268,7 +268,7 @@ void ToucheEngine::mainLoop() {
}
uint32 frameTimeStamp = _system->getMillis();
for (uint32 cycleCounter = 0; !quit(); ++cycleCounter) {
for (uint32 cycleCounter = 0; !shouldQuit(); ++cycleCounter) {
if ((cycleCounter % 3) == 0) {
runCycle();
}
@ -1837,7 +1837,7 @@ int ToucheEngine::handleActionMenuUnderCursor(const int16 *actions, int offs, in
_menuRedrawCounter = 2;
Common::Rect rect(0, y, kScreenWidth, y + h);
i = -1;
while (_inp_rightMouseButtonPressed && !quit()) {
while (_inp_rightMouseButtonPressed && !shouldQuit()) {
Common::Point mousePos = getMousePos();
if (rect.contains(mousePos)) {
int c = (mousePos.y - y) / kTextHeight;