diff options
author | Eugene Sandulenko | 2016-01-03 21:44:04 +0100 |
---|---|---|
committer | Eugene Sandulenko | 2016-01-03 21:44:04 +0100 |
commit | 562355e62dddedaddb40555b0e5dff5468322bb4 (patch) | |
tree | d4262ce84c471451c3354a887936be8028b6e8ef /engines/wage | |
parent | d66c3a21f1b2305fe30640213ff8dba0a20595c5 (diff) | |
download | scummvm-rg350-562355e62dddedaddb40555b0e5dff5468322bb4.tar.gz scummvm-rg350-562355e62dddedaddb40555b0e5dff5468322bb4.tar.bz2 scummvm-rg350-562355e62dddedaddb40555b0e5dff5468322bb4.zip |
WAGE: Graceful engine quitting
Diffstat (limited to 'engines/wage')
-rw-r--r-- | engines/wage/wage.cpp | 11 | ||||
-rw-r--r-- | engines/wage/wage.h | 1 |
2 files changed, 10 insertions, 2 deletions
diff --git a/engines/wage/wage.cpp b/engines/wage/wage.cpp index 3269039a1e..e8658101ef 100644 --- a/engines/wage/wage.cpp +++ b/engines/wage/wage.cpp @@ -78,6 +78,8 @@ WageEngine::WageEngine(OSystem *syst, const ADGameDescription *desc) : Engine(sy _commandWasQuick = false; + _shouldQuit = false; + debug("WageEngine::WageEngine()"); } @@ -85,6 +87,9 @@ WageEngine::~WageEngine() { debug("WageEngine::~WageEngine()"); DebugMan.clearAllDebugChannels(); + delete _world; + delete _resManager; + delete _gui; delete _rnd; } @@ -113,7 +118,9 @@ Common::Error WageEngine::run() { processTurn(&input, NULL); _temporarilyHidden = false; - while (true) { + _shouldQuit = false; + + while (!_shouldQuit) { processEvents(); _gui->draw(); @@ -138,7 +145,7 @@ void WageEngine::processEvents() { while (_eventMan->pollEvent(event)) { switch (event.type) { case Common::EVENT_QUIT: - error("Exiting"); + _shouldQuit = true; break; case Common::EVENT_MOUSEMOVE: _gui->mouseMove(event.mouse.x, event.mouse.y); diff --git a/engines/wage/wage.h b/engines/wage/wage.h index 724f39ab91..0c6f2e03c8 100644 --- a/engines/wage/wage.h +++ b/engines/wage/wage.h @@ -163,6 +163,7 @@ private: bool _commandWasQuick; + bool _shouldQuit; }; // Example console class |