diff options
Diffstat (limited to 'engines/sword1/control.cpp')
-rw-r--r-- | engines/sword1/control.cpp | 12 |
1 files changed, 7 insertions, 5 deletions
diff --git a/engines/sword1/control.cpp b/engines/sword1/control.cpp index d0808d3ece..980e0b4f9f 100644 --- a/engines/sword1/control.cpp +++ b/engines/sword1/control.cpp @@ -215,7 +215,7 @@ void Control::askForCd(void) { notAccepted = false; } } - } while (notAccepted && (!g_engine->quit())); + } while (notAccepted && (!SwordEngine::_systemVars.engineQuit)); _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) && (!SwordEngine::_systemVars.engineQuit)); if (SwordEngine::_systemVars.controlPanelMode == CP_NORMAL) { uint8 volL, volR; @@ -425,7 +425,7 @@ uint8 Control::handleButtonClick(uint8 id, uint8 mode, uint8 *retVal) { _buttons[5]->setSelected(SwordEngine::_systemVars.showText); } else if (id == BUTTON_QUIT) { if (getConfirm(_lStrings[STR_QUIT])) - g_engine->quitGame(); + SwordEngine::_systemVars.engineQuit = true; return mode; } break; @@ -703,7 +703,7 @@ void Control::handleSaveKey(Common::KeyState kbd) { bool Control::saveToFile(void) { if ((_selectedSavegame == 255) || !strlen((char*)_saveNames[_selectedSavegame])) return false; // no saveslot selected or no name entered - saveGameToFile(_numSaves); + saveGameToFile(_selectedSavegame); writeSavegameDescriptions(); return true; } @@ -741,7 +741,6 @@ void Control::readSavegameDescriptions(void) { curFileNum++; } while ((ch != 255) && (!inf->eos())); _saveFiles = curFileNum; - _numSaves = _saveFiles; } delete inf; } @@ -1092,6 +1091,9 @@ void Control::delay(uint32 msecs) { _mouseDown = false; _mouseState |= BS1_WHEEL_DOWN; break; + case Common::EVENT_QUIT: + SwordEngine::_systemVars.engineQuit = true; + break; default: break; } |