[Scummvm-git-logs] scummvm master -> 62c2e13650466445489249d344e752e586ed3460
antoniou79
noreply at scummvm.org
Sun Dec 26 20:27:18 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:
62c2e13650 ANDROID: Set relMouse for touch scroll events
Commit: 62c2e13650466445489249d344e752e586ed3460
https://github.com/scummvm/scummvm/commit/62c2e13650466445489249d344e752e586ed3460
Author: antoniou79 (a.antoniou79 at gmail.com)
Date: 2021-12-26T22:22:15+02:00
Commit Message:
ANDROID: Set relMouse for touch scroll events
Needed for Myst 3 mouse look, probably other games too
This should be followed up by similar update of relMouse for the cases of mouse look using a hardware mouse, a joystick, trackball, pen etc. We should also check if we need to do this for the cases of moving the mouse while holding down a button and for multitouch events that emulate that (eg. hold two fingers down and move).
Changed paths:
backends/platform/android/events.cpp
backends/platform/android/org/scummvm/scummvm/ScummVMEventsBase.java
diff --git a/backends/platform/android/events.cpp b/backends/platform/android/events.cpp
index 66b09c4cc34..b26f7fd8174 100644
--- a/backends/platform/android/events.cpp
+++ b/backends/platform/android/events.cpp
@@ -628,11 +628,12 @@ void OSystem_Android::pushEvent(int type, int arg1, int arg2, int arg3,
e.mouse.x = (arg3 - _touch_pt_scroll.x) * 100 / _touchpad_scale;
e.mouse.y = (arg4 - _touch_pt_scroll.y) * 100 / _touchpad_scale;
e.mouse += _touch_pt_down;
-
} else {
e.mouse.x = arg3;
e.mouse.y = arg4;
}
+ e.relMouse.x = arg5;
+ e.relMouse.y = arg6;
pushEvent(e);
@@ -695,6 +696,9 @@ void OSystem_Android::pushEvent(int type, int arg1, int arg2, int arg3,
}
if (!_touchpad_mode) {
+ // In this case the mouse move is done in "direct mode"
+ // ie. the cursor jumps to where the tap occured
+ // so we don't have relMouse coordinates to set for the event
_event_queue.push(e);
}
diff --git a/backends/platform/android/org/scummvm/scummvm/ScummVMEventsBase.java b/backends/platform/android/org/scummvm/scummvm/ScummVMEventsBase.java
index 76b3e8e2fb1..b3d0e7be814 100644
--- a/backends/platform/android/org/scummvm/scummvm/ScummVMEventsBase.java
+++ b/backends/platform/android/org/scummvm/scummvm/ScummVMEventsBase.java
@@ -550,8 +550,11 @@ public class ScummVMEventsBase implements
float distanceX, float distanceY) {
// Log.d(ScummVM.LOG_TAG, "onScroll");
if (!_touch3DMode) {
+ // typical use:
+ // - move mouse cursor around (most traditional point and click games)
+ // - mouse look (eg. Myst 3)
_scummvm.pushEvent(JE_SCROLL, (int)e1.getX(), (int)e1.getY(),
- (int)e2.getX(), (int)e2.getY(), 0, 0);
+ (int)e2.getX(), (int)e2.getY(), (int)distanceX, (int)distanceY);
}
return true;
}
More information about the Scummvm-git-logs
mailing list