mirror of
https://github.com/Relintai/sdl2_frt.git
synced 2024-12-16 11:06:49 +01:00
Fixed incorrect axis scaling for Nintendo Switch controllers
This commit is contained in:
parent
75725608f3
commit
3fcaf5b4b3
@ -717,11 +717,7 @@ static Sint16 ApplyStickCalibrationCentered(SDL_DriverSwitch_Context *ctx, int n
|
|||||||
ctx->m_StickExtents[nStick].axis[nAxis].sMin = sRawValue;
|
ctx->m_StickExtents[nStick].axis[nAxis].sMin = sRawValue;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (sRawValue > 0) {
|
return (Sint16)HIDAPI_RemapVal(sRawValue, ctx->m_StickExtents[nStick].axis[nAxis].sMin, ctx->m_StickExtents[nStick].axis[nAxis].sMax, SDL_MIN_SINT16, SDL_MAX_SINT16);
|
||||||
return (Sint16)HIDAPI_RemapVal(sRawValue, 0, ctx->m_StickExtents[nStick].axis[nAxis].sMax, 0, SDL_MAX_SINT16);
|
|
||||||
} else {
|
|
||||||
return (Sint16)HIDAPI_RemapVal(sRawValue, ctx->m_StickExtents[nStick].axis[nAxis].sMin, 0, SDL_MIN_SINT16, 0);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
static Sint16 ApplyStickCalibration(SDL_DriverSwitch_Context *ctx, int nStick, int nAxis, Sint16 sRawValue)
|
static Sint16 ApplyStickCalibration(SDL_DriverSwitch_Context *ctx, int nStick, int nAxis, Sint16 sRawValue)
|
||||||
|
Loading…
Reference in New Issue
Block a user