mirror of
https://github.com/libsdl-org/SDL.git
synced 2025-10-05 17:36:25 +00:00
Implemented SDL_GetHintBoolean() to make it easier to check boolean hints
This commit is contained in:
@@ -40,8 +40,7 @@ SDL_XInputUseOldJoystickMapping()
|
||||
{
|
||||
static int s_XInputUseOldJoystickMapping = -1;
|
||||
if (s_XInputUseOldJoystickMapping < 0) {
|
||||
const char *hint = SDL_GetHint(SDL_HINT_XINPUT_USE_OLD_JOYSTICK_MAPPING);
|
||||
s_XInputUseOldJoystickMapping = (hint && *hint == '1') ? 1 : 0;
|
||||
s_XInputUseOldJoystickMapping = SDL_GetHintBoolean(SDL_HINT_XINPUT_USE_OLD_JOYSTICK_MAPPING, SDL_FALSE);
|
||||
}
|
||||
return (s_XInputUseOldJoystickMapping > 0);
|
||||
}
|
||||
@@ -54,10 +53,7 @@ SDL_bool SDL_XINPUT_Enabled(void)
|
||||
int
|
||||
SDL_XINPUT_JoystickInit(void)
|
||||
{
|
||||
const char *env = SDL_GetHint(SDL_HINT_XINPUT_ENABLED);
|
||||
if (env && !SDL_atoi(env)) {
|
||||
s_bXInputEnabled = SDL_FALSE;
|
||||
}
|
||||
s_bXInputEnabled = SDL_GetHintBoolean(SDL_HINT_XINPUT_ENABLED, SDL_TRUE);
|
||||
|
||||
if (s_bXInputEnabled && WIN_LoadXInputDLL() < 0) {
|
||||
s_bXInputEnabled = SDL_FALSE; /* oh well. */
|
||||
|
Reference in New Issue
Block a user