From 16d7dca784dc101e6a87ef6457708104c114e329 Mon Sep 17 00:00:00 2001 From: Cameron Gutman Date: Tue, 26 Jun 2018 22:58:32 -0700 Subject: [PATCH] Fix analog sticks and triggers --- app/streaming/input.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/app/streaming/input.c b/app/streaming/input.c index 16a5090f..e0063bd8 100644 --- a/app/streaming/input.c +++ b/app/streaming/input.c @@ -347,19 +347,19 @@ void SdlHandleControllerAxisEvent(SDL_ControllerAxisEvent* event) state->lsX = event->value; break; case SDL_CONTROLLER_AXIS_LEFTY: - state->lsY = event->value; + state->lsY = -event->value; break; case SDL_CONTROLLER_AXIS_RIGHTX: state->rsX = event->value; break; case SDL_CONTROLLER_AXIS_RIGHTY: - state->rsY = event->value; + state->rsY = -event->value; break; case SDL_CONTROLLER_AXIS_TRIGGERLEFT: - state->lt = (unsigned char)((event->value + 32768UL) * 255 / 65535); + state->lt = (unsigned char)(event->value * 255UL / 32767); break; case SDL_CONTROLLER_AXIS_TRIGGERRIGHT: - state->rt = (unsigned char)((event->value + 32768UL) * 255 / 65535); + state->rt = (unsigned char)(event->value * 255UL / 32767); break; default: SDL_LogInfo(SDL_LOG_CATEGORY_APPLICATION,