[Scummvm-git-logs] scummvm branch-2-5 -> 4849a4a2eecffc599afe6ad8121b4a692c1fc51d
eriktorbjorn
noreply at scummvm.org
Sun Dec 12 16:14:56 UTC 2021
This automated email contains information about 1 new commit which have been
pushed to the 'scummvm' repo located at https://github.com/scummvm/scummvm .
Summary:
4849a4a2ee SHERLOCK: Get mouse position from event manager, not from every event
Commit: 4849a4a2eecffc599afe6ad8121b4a692c1fc51d
https://github.com/scummvm/scummvm/commit/4849a4a2eecffc599afe6ad8121b4a692c1fc51d
Author: Torbjörn Andersson (eriktorbjorn at users.sourceforge.net)
Date: 2021-12-12T17:14:43+01:00
Commit Message:
SHERLOCK: Get mouse position from event manager, not from every event
Not every event has mouse position information. This was causing
problems on the city map, because whenever I moved the mouse cursor
outside the ScummVM window it would scroll to the upper left corner.
Changed paths:
engines/sherlock/events.cpp
diff --git a/engines/sherlock/events.cpp b/engines/sherlock/events.cpp
index 39208d45fe..8a4ba03abf 100644
--- a/engines/sherlock/events.cpp
+++ b/engines/sherlock/events.cpp
@@ -195,10 +195,6 @@ void Events::pollEvents() {
Common::Event event;
while (g_system->getEventManager()->pollEvent(event)) {
- _mousePos = event.mouse;
- if (_vm->_isScreenDoubled)
- _mousePos = Common::Point(_mousePos.x / 2, _mousePos.y / 2);
-
// Handle events
switch (event.type) {
case Common::EVENT_QUIT:
@@ -226,6 +222,10 @@ void Events::pollEvents() {
break;
}
}
+
+ _mousePos = g_system->getEventManager()->getMousePos();
+ if (_vm->_isScreenDoubled)
+ _mousePos = Common::Point(_mousePos.x / 2, _mousePos.y / 2);
}
void Events::pollEventsAndWait() {
More information about the Scummvm-git-logs
mailing list