diff options
author | Torbjörn Andersson | 2006-02-26 13:02:25 +0000 |
---|---|---|
committer | Torbjörn Andersson | 2006-02-26 13:02:25 +0000 |
commit | 686d463defce92fafd8eb80c1230da5dd90d48f7 (patch) | |
tree | 51b53bb09fe5a381d58d8d85a5f7e4efb3dd6df2 /engines/lure | |
parent | 0a898d14331b7c896f4fc43d54942e21e388db59 (diff) | |
download | scummvm-rg350-686d463defce92fafd8eb80c1230da5dd90d48f7.tar.gz scummvm-rg350-686d463defce92fafd8eb80c1230da5dd90d48f7.tar.bz2 scummvm-rg350-686d463defce92fafd8eb80c1230da5dd90d48f7.zip |
Added delays to the waitForRelease() and waitForPress() busy-wait loops.
svn-id: r20912
Diffstat (limited to 'engines/lure')
-rw-r--r-- | engines/lure/events.cpp | 6 | ||||
-rw-r--r-- | engines/lure/events.h | 6 | ||||
-rw-r--r-- | engines/lure/lure.cpp | 4 |
3 files changed, 10 insertions, 6 deletions
diff --git a/engines/lure/events.cpp b/engines/lure/events.cpp index 1a27848d9f..185884d755 100644 --- a/engines/lure/events.cpp +++ b/engines/lure/events.cpp @@ -32,7 +32,7 @@ Mouse &Mouse::getReference() { return *int_mouse; } -Mouse::Mouse() { +Mouse::Mouse(OSystem &system) : _system(system) { int_mouse = this; _lButton = false; @@ -103,6 +103,7 @@ void Mouse::waitForRelease() { do { e.pollEvent(); + _system.delayMillis(20); } while (!e.quitFlag && (lButton() || rButton())); } @@ -110,7 +111,7 @@ void Mouse::waitForRelease() { static Events *int_events = NULL; -Events::Events() { +Events::Events(OSystem &system) : _system(system) { int_events = this; quitFlag = false; } @@ -158,6 +159,7 @@ void Events::waitForPress() { Mouse::getReference().waitForRelease(); } } + _system.delayMillis(20); } } diff --git a/engines/lure/events.h b/engines/lure/events.h index 0287b6de19..547fa1826f 100644 --- a/engines/lure/events.h +++ b/engines/lure/events.h @@ -32,11 +32,12 @@ namespace Lure { class Mouse { private: + OSystem &_system; uint8 _cursorNum; int16 _x, _y; bool _lButton, _rButton; public: - Mouse(); + Mouse(OSystem &system); ~Mouse(); static Mouse &getReference(); void handleEvent(OSystem::Event event); @@ -56,11 +57,12 @@ public: class Events { private: + OSystem &_system; OSystem::Event _event; public: bool quitFlag; - Events(); + Events(OSystem &system); static Events &getReference(); bool pollEvent(); diff --git a/engines/lure/lure.cpp b/engines/lure/lure.cpp index 2fc47f7d62..c72b1a6ae3 100644 --- a/engines/lure/lure.cpp +++ b/engines/lure/lure.cpp @@ -251,8 +251,8 @@ int LureEngine::init(GameDetector &detector) { _resources = new Resources(); _strings = new StringData(); _screen = new Screen(*_system); - _mouse = new Mouse(); - _events = new Events(); + _mouse = new Mouse(*_system); + _events = new Events(*_system); _menu = new Menu(); Surface::initialise(); _room = new Room(); |