From 102d79440d2847803c43187aebe4ff4ca4254cbe Mon Sep 17 00:00:00 2001 From: Christopher Page Date: Thu, 26 Jun 2008 05:04:42 +0000 Subject: Touche now uses the new _quit flag svn-id: r32795 --- engines/touche/menu.cpp | 8 ++++---- engines/touche/saveload.cpp | 2 +- engines/touche/touche.cpp | 10 +++++----- 3 files changed, 10 insertions(+), 10 deletions(-) (limited to 'engines/touche') diff --git a/engines/touche/menu.cpp b/engines/touche/menu.cpp index 6d2d90a572..3e4d5226df 100644 --- a/engines/touche/menu.cpp +++ b/engines/touche/menu.cpp @@ -297,7 +297,7 @@ void ToucheEngine::handleMenuAction(void *menu, int actionId) { menuData->quit = true; break; case kActionQuitGame: - _flagsTable[611] = 1; + _quit = 1; menuData->quit = true; break; case kActionTextOnly: @@ -398,7 +398,7 @@ void ToucheEngine::handleOptions(int forceDisplay) { case Common::EVENT_QUIT: menuData.quit = true; menuData.exit = true; - _flagsTable[611] = 1; + _quit = 1; break; case Common::EVENT_LBUTTONDOWN: button = menuData.findButtonUnderCursor(event.mouse.x, event.mouse.y); @@ -433,8 +433,8 @@ void ToucheEngine::handleOptions(int forceDisplay) { _system->delayMillis(10); } _fullRedrawCounter = 2; - if (!menuData.exit && _flagsTable[611] != 0) { - _flagsTable[611] = displayQuitDialog(); + if (!menuData.exit && _quit != 0) { + _quit = displayQuitDialog(); } } } diff --git a/engines/touche/saveload.cpp b/engines/touche/saveload.cpp index eb647a1b42..386b043654 100644 --- a/engines/touche/saveload.cpp +++ b/engines/touche/saveload.cpp @@ -295,7 +295,7 @@ void ToucheEngine::loadGameStateData(Common::ReadStream *stream) { if (stream->readUint32LE() != saveLoadEndMarker) { warning("Corrupted gamestate data"); // if that ever happens, exit the game - _flagsTable[611] = 1; + _quit = 1; } _flagsTable[614] = roomOffsX; _flagsTable[615] = roomOffsY; diff --git a/engines/touche/touche.cpp b/engines/touche/touche.cpp index 06ee28dae8..5813943da5 100644 --- a/engines/touche/touche.cpp +++ b/engines/touche/touche.cpp @@ -115,7 +115,7 @@ int ToucheEngine::go() { res_deallocateTables(); res_closeDataFile(); - return 0; + return _rtl; } void ToucheEngine::restart() { @@ -262,7 +262,7 @@ void ToucheEngine::mainLoop() { } uint32 frameTimeStamp = _system->getMillis(); - for (uint32 cycleCounter = 0; _flagsTable[611] == 0; ++cycleCounter) { + for (uint32 cycleCounter = 0; _quit == 0; ++cycleCounter) { if ((cycleCounter % 3) == 0) { runCycle(); } @@ -292,7 +292,7 @@ void ToucheEngine::processEvents(bool handleKeyEvents) { while (_eventMan->pollEvent(event)) { switch (event.type) { case Common::EVENT_QUIT: - _flagsTable[611] = 1; + _quit = 1; break; case Common::EVENT_KEYDOWN: if (!handleKeyEvents) { @@ -301,7 +301,7 @@ void ToucheEngine::processEvents(bool handleKeyEvents) { _flagsTable[600] = event.kbd.keycode; if (event.kbd.keycode == Common::KEYCODE_ESCAPE) { if (_displayQuitDialog) { - _flagsTable[611] = displayQuitDialog(); + _quit = displayQuitDialog(); } } else if (event.kbd.keycode == Common::KEYCODE_F5) { if (_flagsTable[618] == 0 && !_hideInventoryTexts) { @@ -1832,7 +1832,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 && _flagsTable[611] == 0) { + while (_inp_rightMouseButtonPressed && _quit == 0) { Common::Point mousePos = getMousePos(); if (rect.contains(mousePos)) { int c = (mousePos.y - y) / kTextHeight; -- cgit v1.2.3