fix a bug if XINPUTGETBATTERYINFORMATION is nullptr
This commit is contained in:
parent
f42291ce68
commit
cfbeb438c1
1 changed files with 3 additions and 1 deletions
|
@ -338,10 +338,12 @@ RAWINPUT_UpdateXInput()
|
||||||
xinput_state[user_index].connected = SDL_FALSE;
|
xinput_state[user_index].connected = SDL_FALSE;
|
||||||
}
|
}
|
||||||
xinput_state[user_index].battery.BatteryType = BATTERY_TYPE_UNKNOWN;
|
xinput_state[user_index].battery.BatteryType = BATTERY_TYPE_UNKNOWN;
|
||||||
|
if (XINPUTGETBATTERYINFORMATION) {
|
||||||
XINPUTGETBATTERYINFORMATION(user_index, BATTERY_DEVTYPE_GAMEPAD, &xinput_state[user_index].battery);
|
XINPUTGETBATTERYINFORMATION(user_index, BATTERY_DEVTYPE_GAMEPAD, &xinput_state[user_index].battery);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue