From d846f9a5e1ca9e430b61341eb72d65ab969a1259 Mon Sep 17 00:00:00 2001 From: Torbjörn Andersson Date: Tue, 11 Apr 2006 11:55:27 +0000 Subject: Added delays to the main and menu event loops to keep Lure from gobbling up all available CPU time. svn-id: r21787 --- engines/lure/game.cpp | 4 +++- engines/lure/menu.cpp | 4 +++- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/engines/lure/game.cpp b/engines/lure/game.cpp index ec5b604dcd..32f6878025 100644 --- a/engines/lure/game.cpp +++ b/engines/lure/game.cpp @@ -109,7 +109,7 @@ void Game::execute() { } res.delayList().tick(); - if (events.pollEvent()) { + while (events.pollEvent()) { if (events.type() == OSystem::EVENT_KEYDOWN) { uint16 roomNum = r.roomNumber(); @@ -171,6 +171,8 @@ void Game::execute() { if (destRoom != 0) { playerChangeRoom(); } + + system.delayMillis(10); } r.leaveRoom(); diff --git a/engines/lure/menu.cpp b/engines/lure/menu.cpp index 2f881934cc..ff6a6f4c4b 100644 --- a/engines/lure/menu.cpp +++ b/engines/lure/menu.cpp @@ -110,7 +110,7 @@ uint8 Menu::execute() { _selectedIndex = 0; while (mouse.lButton() || mouse.rButton()) { - if (events.pollEvent()) { + while (events.pollEvent()) { if (events.quitFlag) return MENUITEM_NONE; if (mouse.y() < MENUBAR_Y_SIZE) @@ -155,6 +155,8 @@ uint8 Menu::execute() { if (_selectedIndex != 0) toggleHighlightItem(_selectedIndex); } } + + system.delayMillis(10); } if (_surfaceMenu) delete _surfaceMenu; -- cgit v1.2.3