diff options
author | Bastien Bouclet | 2017-12-19 06:27:32 +0100 |
---|---|---|
committer | Bastien Bouclet | 2017-12-26 21:11:04 +0100 |
commit | 5838894f2434b027003a876ce795e2662597ce97 (patch) | |
tree | 31b974b0560e86ce2fcfe5534eb42191b4ad6614 /backends/events | |
parent | ee4ff8ca08faf2bfbc14fe4a905b311d48049cf6 (diff) | |
download | scummvm-rg350-5838894f2434b027003a876ce795e2662597ce97.tar.gz scummvm-rg350-5838894f2434b027003a876ce795e2662597ce97.tar.bz2 scummvm-rg350-5838894f2434b027003a876ce795e2662597ce97.zip |
PSP2: Remove identical to base class joystick axis event handling
Diffstat (limited to 'backends/events')
-rw-r--r-- | backends/events/psp2sdl/psp2sdl-events.cpp | 40 | ||||
-rw-r--r-- | backends/events/psp2sdl/psp2sdl-events.h | 1 |
2 files changed, 0 insertions, 41 deletions
diff --git a/backends/events/psp2sdl/psp2sdl-events.cpp b/backends/events/psp2sdl/psp2sdl-events.cpp index f5554599d6..ac3115a642 100644 --- a/backends/events/psp2sdl/psp2sdl-events.cpp +++ b/backends/events/psp2sdl/psp2sdl-events.cpp @@ -272,46 +272,6 @@ bool PSP2EventSource::handleJoyButtonUp(SDL_Event &ev, Common::Event &event) { return true; } -bool PSP2EventSource::handleJoyAxisMotion(SDL_Event &ev, Common::Event &event) { - - int axis = ev.jaxis.value; - - // conversion factor between keyboard mouse and joy axis value - int vel_to_axis = (1500 / MULTIPLIER); - - if (ev.jaxis.axis == JOY_XAXIS) { - _km.joy_x = axis; - } else if (ev.jaxis.axis == JOY_YAXIS) { - axis = -axis; - _km.joy_y = -axis; - } - - // radial and scaled deadzone - - float analogX = (float)_km.joy_x; - float analogY = (float)_km.joy_y; - float deadZone = (float)JOY_DEADZONE; - if (g_system->hasFeature(OSystem::kFeatureJoystickDeadzone)) - deadZone = (float)ConfMan.getInt("joystick_deadzone") * 1000.0f; - float scalingFactor = 1.0f; - float magnitude = 0.0f; - - magnitude = sqrt(analogX * analogX + analogY * analogY); - - if (magnitude >= deadZone) { - _km.x_down_count = 0; - _km.y_down_count = 0; - scalingFactor = 1.0f / magnitude * (magnitude - deadZone) / (32769.0f - deadZone); - _km.x_vel = (int16)(analogX * scalingFactor * 32768.0f / (float) vel_to_axis); - _km.y_vel = (int16)(analogY * scalingFactor * 32768.0f / (float) vel_to_axis); - } else { - _km.x_vel = 0; - _km.y_vel = 0; - } - - return false; -} - void PSP2EventSource::preprocessEvents(SDL_Event *event) { // prevent suspend (scummvm games contains a lot of cutscenes..) diff --git a/backends/events/psp2sdl/psp2sdl-events.h b/backends/events/psp2sdl/psp2sdl-events.h index 001312e1d5..e01a3b9ebc 100644 --- a/backends/events/psp2sdl/psp2sdl-events.h +++ b/backends/events/psp2sdl/psp2sdl-events.h @@ -32,7 +32,6 @@ class PSP2EventSource : public SdlEventSource { protected: bool handleJoyButtonDown(SDL_Event &ev, Common::Event &event); bool handleJoyButtonUp(SDL_Event &ev, Common::Event &event); - bool handleJoyAxisMotion(SDL_Event &ev, Common::Event &event); void preprocessEvents(SDL_Event *event); }; |