Fixed sensor axes in vertical mode

main
Sam Lantinga 2022-10-02 10:15:39 -07:00
parent b4c25f5714
commit bd6afc2317
1 changed files with 2 additions and 2 deletions

View File

@ -1793,7 +1793,7 @@ static void SendSensorUpdate(SDL_Joystick *joystick, SDL_DriverSwitch_Context *c
} }
if (ctx->m_eControllerType == k_eSwitchDeviceInfoControllerType_JoyConLeft && if (ctx->m_eControllerType == k_eSwitchDeviceInfoControllerType_JoyConLeft &&
!ctx->device->parent) { !ctx->device->parent && !ctx->m_bVerticalMode) {
/* Mini-gamepad mode, swap some axes around */ /* Mini-gamepad mode, swap some axes around */
float tmp = data[2]; float tmp = data[2];
data[2] = -data[0]; data[2] = -data[0];
@ -1801,7 +1801,7 @@ static void SendSensorUpdate(SDL_Joystick *joystick, SDL_DriverSwitch_Context *c
} }
if (ctx->m_eControllerType == k_eSwitchDeviceInfoControllerType_JoyConRight && if (ctx->m_eControllerType == k_eSwitchDeviceInfoControllerType_JoyConRight &&
!ctx->device->parent) { !ctx->device->parent && !ctx->m_bVerticalMode) {
/* Mini-gamepad mode, swap some axes around */ /* Mini-gamepad mode, swap some axes around */
float tmp = data[2]; float tmp = data[2];
data[2] = data[0]; data[2] = data[0];