diff options
author | Torbjörn Andersson | 2006-04-11 11:55:27 +0000 |
---|---|---|
committer | Torbjörn Andersson | 2006-04-11 11:55:27 +0000 |
commit | d846f9a5e1ca9e430b61341eb72d65ab969a1259 (patch) | |
tree | 75d6c041a93ec620a83ef4d0853243503034f058 /engines/lure | |
parent | cba4871140cec8a976c240fb9de87c16712e99cc (diff) | |
download | scummvm-rg350-d846f9a5e1ca9e430b61341eb72d65ab969a1259.tar.gz scummvm-rg350-d846f9a5e1ca9e430b61341eb72d65ab969a1259.tar.bz2 scummvm-rg350-d846f9a5e1ca9e430b61341eb72d65ab969a1259.zip |
Added delays to the main and menu event loops to keep Lure from gobbling up all
available CPU time.
svn-id: r21787
Diffstat (limited to 'engines/lure')
-rw-r--r-- | engines/lure/game.cpp | 4 | ||||
-rw-r--r-- | 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; |