[Scummvm-git-logs] scummvm master -> c278677d07e855071bb64d7005594db94ac1a103

csnover csnover at users.noreply.github.com
Tue Nov 28 03:39:36 CET 2017


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:
c278677d07 SDL: Store fake mouse warp event in virtual coordinates


Commit: c278677d07e855071bb64d7005594db94ac1a103
    https://github.com/scummvm/scummvm/commit/c278677d07e855071bb64d7005594db94ac1a103
Author: Colin Snover (github.com at zetafleet.com)
Date: 2017-11-27T20:39:21-06:00

Commit Message:
SDL: Store fake mouse warp event in virtual coordinates

Normally, notifyMousePosition converts real mouse events into the
virtual coordinate system, but events only get sent through
notifyMousePosition if they are real events from SDL since that
method also decides if the real mouse is inside the content area or
not. As such, these fake events need to be pre-converted to virtual
coordinates or else the wrong values are sent through to the engine
when a scaler or AR correction is in use.

Changed paths:
    backends/graphics/sdl/sdl-graphics.cpp


diff --git a/backends/graphics/sdl/sdl-graphics.cpp b/backends/graphics/sdl/sdl-graphics.cpp
index 864fc10..336b16a 100644
--- a/backends/graphics/sdl/sdl-graphics.cpp
+++ b/backends/graphics/sdl/sdl-graphics.cpp
@@ -221,7 +221,8 @@ bool SdlGraphicsManager::notifyMousePosition(Common::Point &mouse) {
 void SdlGraphicsManager::setSystemMousePosition(const int x, const int y) {
 	assert(_window);
 	if (!_window->warpMouseInWindow(x, y)) {
-		_eventSource->fakeWarpMouse(x, y);
+		const Common::Point mouse = convertWindowToVirtual(x, y);
+		_eventSource->fakeWarpMouse(mouse.x, mouse.y);
 	}
 }
 





More information about the Scummvm-git-logs mailing list