aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTorbjörn Andersson2007-03-17 09:37:47 +0000
committerTorbjörn Andersson2007-03-17 09:37:47 +0000
commitc1f4dbda7794fbc174668def400cbfe315f71f51 (patch)
tree340477634e95dffb0ea2f3413e2095386375b80e
parentcb5c3840ed2233040a28cf5d99e17cb64d422a96 (diff)
downloadscummvm-rg350-c1f4dbda7794fbc174668def400cbfe315f71f51.tar.gz
scummvm-rg350-c1f4dbda7794fbc174668def400cbfe315f71f51.tar.bz2
scummvm-rg350-c1f4dbda7794fbc174668def400cbfe315f71f51.zip
Use the new getButtonState() function to test if the mouse button is still
pressed. This way, it won't matter if we've already missed the "mouse up" event. Fixes bug #1510038 ("BASS: Possible glitch when examining inventory items". svn-id: r26162
-rw-r--r--engines/sky/mouse.cpp18
1 files changed, 10 insertions, 8 deletions
diff --git a/engines/sky/mouse.cpp b/engines/sky/mouse.cpp
index d655bb4e08..5eb570840e 100644
--- a/engines/sky/mouse.cpp
+++ b/engines/sky/mouse.cpp
@@ -175,22 +175,24 @@ void Mouse::waitMouseNotPressed(int minDelay) {
OSystem::Event event;
while (mousePressed || _system->getMillis() < now + minDelay) {
Common::EventManager *eventMan = _system->getEventManager();
+
+ if (eventMan->shouldQuit()) {
+ SkyEngine::_systemVars.quitGame = true;
+ minDelay = 0;
+ mousePressed = false;
+ }
+
+ if (!eventMan->getButtonState())
+ mousePressed = false;
+
while (eventMan->pollEvent(event)) {
switch (event.type) {
- case OSystem::EVENT_LBUTTONUP:
- mousePressed = false;
- break;
case OSystem::EVENT_KEYDOWN:
if (event.kbd.ascii == 27) {
minDelay = 0;
mousePressed = false;
}
break;
- case OSystem::EVENT_QUIT:
- SkyEngine::_systemVars.quitGame = true;
- minDelay = 0;
- mousePressed = false;
- break;
default:
break;
}