From 4ba74f73e1315430de0d86e3712a8ad2298f16f8 Mon Sep 17 00:00:00 2001 From: Vladimir Menshakov Date: Sun, 12 Jun 2011 18:58:00 +0400 Subject: DREAMWEB: moved quit() into engine's method --- engines/dreamweb/dreamweb.cpp | 17 ++++++++++------- engines/dreamweb/dreamweb.h | 2 ++ 2 files changed, 12 insertions(+), 7 deletions(-) (limited to 'engines') diff --git a/engines/dreamweb/dreamweb.cpp b/engines/dreamweb/dreamweb.cpp index 60462dc463..68cb902ea1 100644 --- a/engines/dreamweb/dreamweb.cpp +++ b/engines/dreamweb/dreamweb.cpp @@ -102,13 +102,18 @@ void DreamWebEngine::waitForVSync() { _system->updateScreen(); } +void DreamWebEngine::quit() { + warning("Engine should quit gracefully (but doesn't yet)"); + g_system->quit(); +} + void DreamWebEngine::processEvents() { Common::EventManager *event_manager = _system->getEventManager(); - Common::Event event; if (event_manager->shouldQuit()) { - warning("Engine should quit gracefully (but doesn't yet)"); - g_system->quit(); + quit(); + return; } + Common::Event event; while (event_manager->pollEvent(event)) { switch(event.type) { case Common::EVENT_LBUTTONDOWN: @@ -407,13 +412,11 @@ void randomnumber(Context &context) { } void quickquit(Context &context) { - assert(0); - ::error("quickquit"); + context.engine->quit(); } void quickquit2(Context &context) { - assert(0); - ::error("quickquit2"); + context.engine->quit(); } void keyboardread(Context &context) { diff --git a/engines/dreamweb/dreamweb.h b/engines/dreamweb/dreamweb.h index 8cd489cc7e..455791d2c3 100644 --- a/engines/dreamweb/dreamweb.h +++ b/engines/dreamweb/dreamweb.h @@ -97,6 +97,8 @@ public: void setShakePos(int pos) { _system->setShakePos(pos); } + void quit(); + private: void keyPressed(uint16 ascii); -- cgit v1.2.3