mirror of
https://github.com/encounter/SDL.git
synced 2025-12-09 21:47:44 +00:00
Implemented SDL_GetHintBoolean() to make it easier to check boolean hints
This commit is contained in:
@@ -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
|
||||
|
||||
@@ -91,9 +91,7 @@ SDL_QuitInit_Internal(void)
|
||||
int
|
||||
SDL_QuitInit(void)
|
||||
{
|
||||
const char *hint = SDL_GetHint(SDL_HINT_NO_SIGNAL_HANDLERS);
|
||||
disable_signals = hint && (SDL_atoi(hint) == 1);
|
||||
if (!disable_signals) {
|
||||
if (!SDL_GetHintBoolean(SDL_HINT_NO_SIGNAL_HANDLERS, SDL_FALSE)) {
|
||||
return SDL_QuitInit_Internal();
|
||||
}
|
||||
return 0;
|
||||
|
||||
Reference in New Issue
Block a user