aboutsummaryrefslogtreecommitdiff
path: root/backends/events/gph
diff options
context:
space:
mode:
authorrsn88872017-02-16 03:19:59 -0600
committerrsn88872017-02-17 17:55:09 -0600
commit613c6f4f7f3a64f857ca59e453b5e53d01e64899 (patch)
treeb43962e434d4d657e5e0140110b49b5c09ded421 /backends/events/gph
parentc0d155db972323b87af0964f59676be091c76be6 (diff)
downloadscummvm-rg350-613c6f4f7f3a64f857ca59e453b5e53d01e64899.tar.gz
scummvm-rg350-613c6f4f7f3a64f857ca59e453b5e53d01e64899.tar.bz2
scummvm-rg350-613c6f4f7f3a64f857ca59e453b5e53d01e64899.zip
SDL: More fixes to jerky analog joystick pointer
For some engines such as Dreamweb that a previous fix did not apply to, this fixes bug 6996: Android: Mouse pointer control with analog joystick is unusable
Diffstat (limited to 'backends/events/gph')
-rw-r--r--backends/events/gph/gph-events.cpp74
1 files changed, 37 insertions, 37 deletions
diff --git a/backends/events/gph/gph-events.cpp b/backends/events/gph/gph-events.cpp
index 88fc97d3d1..06acfa489e 100644
--- a/backends/events/gph/gph-events.cpp
+++ b/backends/events/gph/gph-events.cpp
@@ -230,116 +230,116 @@ bool GPHEventSource::handleJoyButtonDown(SDL_Event &ev, Common::Event &event) {
switch (ev.jbutton.button) {
case BUTTON_UP:
if (_km.y_down_count != 2) {
- _km.y_vel = -1;
+ _km.y_vel = -1 * _km.multiplier;
_km.y_down_count = 1;
} else {
- _km.y_vel = -4;
+ _km.y_vel = -4 * _km.multiplier;
}
event.type = Common::EVENT_MOUSEMOVE;
- processMouseEvent(event, _km.x, _km.y);
+ processMouseEvent(event, _km.x / _km.multiplier, _km.y / _km.multiplier);
break;
case BUTTON_DOWN:
if (_km.y_down_count != 2) {
- _km.y_vel = 1;
+ _km.y_vel = 1 * _km.multiplier;
_km.y_down_count = 1;
} else {
- _km.y_vel = 4;
+ _km.y_vel = 4 * _km.multiplier;
}
event.type = Common::EVENT_MOUSEMOVE;
- processMouseEvent(event, _km.x, _km.y);
+ processMouseEvent(event, _km.x / _km.multiplier, _km.y / _km.multiplier);
break;
case BUTTON_LEFT:
if (_km.x_down_count != 2) {
- _km.x_vel = -1;
+ _km.x_vel = -1 * _km.multiplier;
_km.x_down_count = 1;
} else {
- _km.x_vel = -4;
+ _km.x_vel = -4 * _km.multiplier;
}
event.type = Common::EVENT_MOUSEMOVE;
- processMouseEvent(event, _km.x, _km.y);
+ processMouseEvent(event, _km.x / _km.multiplier, _km.y / _km.multiplier);
break;
case BUTTON_RIGHT:
if (_km.x_down_count != 3) {
- _km.x_vel = 1;
+ _km.x_vel = 1 * _km.multiplier;
_km.x_down_count = 1;
} else {
- _km.x_vel = 4;
+ _km.x_vel = 4 * _km.multiplier;
}
event.type = Common::EVENT_MOUSEMOVE;
- processMouseEvent(event, _km.x, _km.y);
+ processMouseEvent(event, _km.x / _km.multiplier, _km.y / _km.multiplier);
break;
case BUTTON_UPLEFT:
if (_km.x_down_count != 2) {
- _km.x_vel = -1;
+ _km.x_vel = -1 * _km.multiplier;
_km.x_down_count = 1;
} else {
- _km.x_vel = -4;
+ _km.x_vel = -4 * _km.multiplier;
}
if (_km.y_down_count != 2) {
- _km.y_vel = -1;
+ _km.y_vel = -1 * _km.multiplier;
_km.y_down_count = 1;
} else {
- _km.y_vel = -4;
+ _km.y_vel = -4 * _km.multiplier;
}
event.type = Common::EVENT_MOUSEMOVE;
- processMouseEvent(event, _km.x, _km.y);
+ processMouseEvent(event, _km.x / _km.multiplier, _km.y / _km.multiplier);
break;
case BUTTON_UPRIGHT:
if (_km.x_down_count != 2) {
- _km.x_vel = 1;
+ _km.x_vel = 1 * _km.multiplier;
_km.x_down_count = 1;
} else {
- _km.x_vel = 4;
+ _km.x_vel = 4 * _km.multiplier;
}
if (_km.y_down_count != 2) {
- _km.y_vel = -1;
+ _km.y_vel = -1 * _km.multiplier;
_km.y_down_count = 1;
} else {
- _km.y_vel = -4;
+ _km.y_vel = -4 * _km.multiplier;
}
event.type = Common::EVENT_MOUSEMOVE;
- processMouseEvent(event, _km.x, _km.y);
+ processMouseEvent(event, _km.x / _km.multiplier, _km.y / _km.multiplier);
break;
case BUTTON_DOWNLEFT:
if (_km.x_down_count != 2) {
- _km.x_vel = -1;
+ _km.x_vel = -1 * _km.multiplier;
_km.x_down_count = 1;
} else {
- _km.x_vel = -4;
+ _km.x_vel = -4 * _km.multiplier;
}
if (_km.y_down_count != 2) {
- _km.y_vel = 1;
+ _km.y_vel = 1 * _km.multiplier;
_km.y_down_count = 1;
} else {
- _km.y_vel = 4;
+ _km.y_vel = 4 * _km.multiplier;
}
event.type = Common::EVENT_MOUSEMOVE;
- processMouseEvent(event, _km.x, _km.y);
+ processMouseEvent(event, _km.x / _km.multiplier, _km.y / _km.multiplier);
break;
case BUTTON_DOWNRIGHT:
if (_km.x_down_count != 2) {
- _km.x_vel = 1;
+ _km.x_vel = 1 * _km.multiplier;
_km.x_down_count = 1;
} else {
- _km.x_vel = 4;
+ _km.x_vel = 4 * _km.multiplier;
}
if (_km.y_down_count != 2) {
- _km.y_vel = 1;
+ _km.y_vel = 1 * _km.multiplier;
_km.y_down_count = 1;
} else {
- _km.y_vel = 4;
+ _km.y_vel = 4 * _km.multiplier;
}
event.type = Common::EVENT_MOUSEMOVE;
- processMouseEvent(event, _km.x, _km.y);
+ processMouseEvent(event, _km.x / _km.multiplier, _km.y / _km.multiplier);
break;
case BUTTON_B:
case BUTTON_CLICK:
event.type = Common::EVENT_LBUTTONDOWN;
- processMouseEvent(event, _km.x, _km.y);
+ processMouseEvent(event, _km.x / _km.multiplier, _km.y / _km.multiplier);
break;
case BUTTON_X:
event.type = Common::EVENT_RBUTTONDOWN;
- processMouseEvent(event, _km.x, _km.y);
+ processMouseEvent(event, _km.x / _km.multiplier, _km.y / _km.multiplier);
break;
case BUTTON_L:
BUTTON_STATE_L = true;
@@ -454,16 +454,16 @@ bool GPHEventSource::handleJoyButtonUp(SDL_Event &ev, Common::Event &event) {
_km.x_vel = 0;
_km.x_down_count = 0;
event.type = Common::EVENT_MOUSEMOVE;
- processMouseEvent(event, _km.x, _km.y);
+ processMouseEvent(event, _km.x / _km.multiplier, _km.y / _km.multiplier);
break;
case BUTTON_B:
case BUTTON_CLICK:
event.type = Common::EVENT_LBUTTONUP;
- processMouseEvent(event, _km.x, _km.y);
+ processMouseEvent(event, _km.x / _km.multiplier, _km.y / _km.multiplier);
break;
case BUTTON_X:
event.type = Common::EVENT_RBUTTONUP;
- processMouseEvent(event, _km.x, _km.y);
+ processMouseEvent(event, _km.x / _km.multiplier, _km.y / _km.multiplier);
break;
case BUTTON_L:
BUTTON_STATE_L = false;