aboutsummaryrefslogtreecommitdiff
path: root/backends/events/sdl
diff options
context:
space:
mode:
authorBastien Bouclet2017-12-19 06:18:24 +0100
committerBastien Bouclet2017-12-26 21:11:04 +0100
commit1fb748e97480dc64ed27ebe75490c1b938cdbed4 (patch)
treebcf5ab6212c83878fe8bb92a742a1695de3e5f09 /backends/events/sdl
parent6fb50d562f9716a930ecb4fe3d20047d506e4ed5 (diff)
downloadscummvm-rg350-1fb748e97480dc64ed27ebe75490c1b938cdbed4.tar.gz
scummvm-rg350-1fb748e97480dc64ed27ebe75490c1b938cdbed4.tar.bz2
scummvm-rg350-1fb748e97480dc64ed27ebe75490c1b938cdbed4.zip
SDL: Move the non analog joystick code to the Symbian port
Symbian was the only user of that code.
Diffstat (limited to 'backends/events/sdl')
-rw-r--r--backends/events/sdl/sdl-events.cpp38
-rw-r--r--backends/events/sdl/sdl-events.h2
2 files changed, 1 insertions, 39 deletions
diff --git a/backends/events/sdl/sdl-events.cpp b/backends/events/sdl/sdl-events.cpp
index 09530675c4..6d48b8d372 100644
--- a/backends/events/sdl/sdl-events.cpp
+++ b/backends/events/sdl/sdl-events.cpp
@@ -30,18 +30,10 @@
#include "common/config-manager.h"
#include "common/textconsole.h"
-#ifdef JOY_ANALOG
-#include "math.h"
-#endif
-
// FIXME move joystick defines out and replace with confile file options
// we should really allow users to map any key to a joystick button
#define JOY_DEADZONE 3200
-#ifndef __SYMBIAN32__ // Symbian wants dialog joystick i.e cursor for movement/selection
- #define JOY_ANALOG
-#endif
-
// #define JOY_INVERT_Y
#define JOY_XAXIS 0
#define JOY_YAXIS 1
@@ -1023,7 +1015,6 @@ bool SdlEventSource::handleAxisToMouseMotion(int16 xAxis, int16 yAxis) {
yAxis = -yAxis;
#endif
-#ifdef JOY_ANALOG
// conversion factor between keyboard mouse and joy axis value
int vel_to_axis = (1500 / MULTIPLIER);
@@ -1047,35 +1038,6 @@ bool SdlEventSource::handleAxisToMouseMotion(int16 xAxis, int16 yAxis) {
_km.x_vel = 0;
_km.y_vel = 0;
}
-#else
- if (xAxis > JOY_DEADZONE) {
- xAxis -= JOY_DEADZONE;
- } else if (xAxis < -JOY_DEADZONE) {
- xAxis += JOY_DEADZONE;
- } else
- xAxis = 0;
- if (yAxis > JOY_DEADZONE) {
- yAxis -= JOY_DEADZONE;
- } else if (yAxis < -JOY_DEADZONE) {
- yAxis += JOY_DEADZONE;
- } else
- yAxis = 0;
-
- if (xAxis != 0) {
- _km.x_vel = (xAxis > 0) ? 1 * MULTIPLIER:-1 * MULTIPLIER;
- _km.x_down_count = 1;
- } else {
- _km.x_vel = 0;
- _km.x_down_count = 0;
- }
- if (yAxis != 0) {
- _km.y_vel = (yAxis > 0) ? 1 * MULTIPLIER: -1 * MULTIPLIER;
- _km.y_down_count = 1;
- } else {
- _km.y_vel = 0;
- _km.y_down_count = 0;
- }
-#endif
return false;
}
diff --git a/backends/events/sdl/sdl-events.h b/backends/events/sdl/sdl-events.h
index cea944fb1a..33d971a605 100644
--- a/backends/events/sdl/sdl-events.h
+++ b/backends/events/sdl/sdl-events.h
@@ -132,7 +132,7 @@ protected:
/**
* Update the virtual mouse according to a joystick or game controller axis position change
*/
- bool handleAxisToMouseMotion(int16 xAxis, int16 yAxis);
+ virtual bool handleAxisToMouseMotion(int16 xAxis, int16 yAxis);
/**
* Assigns the mouse coords to the mouse event. Furthermore notify the