Implemented SDL_GetHintBoolean() to make it easier to check boolean hints

This commit is contained in:
Sam Lantinga
2016-10-07 23:40:44 -07:00
parent 92d700f199
commit 27d4f09929
26 changed files with 68 additions and 136 deletions

View File

@@ -564,21 +564,11 @@ SDL_WarpMouseGlobal(int x, int y)
static SDL_bool
ShouldUseRelativeModeWarp(SDL_Mouse *mouse)
{
const char *hint;
if (!mouse->SetRelativeMouseMode) {
return SDL_TRUE;
}
hint = SDL_GetHint(SDL_HINT_MOUSE_RELATIVE_MODE_WARP);
if (hint) {
if (*hint == '0') {
return SDL_FALSE;
} else {
return SDL_TRUE;
}
}
return SDL_FALSE;
return SDL_GetHintBoolean(SDL_HINT_MOUSE_RELATIVE_MODE_WARP, SDL_FALSE);
}
int