Use better default values for Switch controller calibration

This commit is contained in:
Sam Lantinga 2022-09-26 18:39:18 -07:00
parent a205c5e26c
commit 2c98c8af01
1 changed files with 3 additions and 3 deletions

View File

@ -759,13 +759,13 @@ static SDL_bool LoadStickCalibration(SDL_DriverSwitch_Context *ctx, Uint8 input_
for (stick = 0; stick < 2; ++stick) {
for (axis = 0; axis < 2; ++axis) {
if (ctx->m_StickCalData[stick].axis[axis].sCenter == 0xFFF) {
ctx->m_StickCalData[stick].axis[axis].sCenter = 0;
ctx->m_StickCalData[stick].axis[axis].sCenter = 2048;
}
if (ctx->m_StickCalData[stick].axis[axis].sMax == 0xFFF) {
ctx->m_StickCalData[stick].axis[axis].sMax = 0;
ctx->m_StickCalData[stick].axis[axis].sMax = (Sint16)(ctx->m_StickCalData[stick].axis[axis].sCenter * 0.7f);
}
if (ctx->m_StickCalData[stick].axis[axis].sMin == 0xFFF) {
ctx->m_StickCalData[stick].axis[axis].sMin = 0;
ctx->m_StickCalData[stick].axis[axis].sMin = (Sint16)(ctx->m_StickCalData[stick].axis[axis].sCenter * 0.7f);
}
}
}