mirror of
https://github.com/libsdl-org/SDL.git
synced 2025-10-16 14:56:00 +00:00
Removed SDL_INIT_TIMER
This is no longer necessary before calling SDL_AddTimer()
This commit is contained in:
23
src/SDL.c
23
src/SDL.c
@@ -307,20 +307,6 @@ SDL_bool SDL_InitSubSystem(SDL_InitFlags flags)
|
||||
flags_initialized |= SDL_INIT_EVENTS;
|
||||
}
|
||||
|
||||
// Initialize the timer subsystem
|
||||
if (flags & SDL_INIT_TIMER) {
|
||||
if (SDL_ShouldInitSubsystem(SDL_INIT_TIMER)) {
|
||||
SDL_IncrementSubsystemRefCount(SDL_INIT_TIMER);
|
||||
if (!SDL_InitTimers()) {
|
||||
SDL_DecrementSubsystemRefCount(SDL_INIT_TIMER);
|
||||
goto quit_and_error;
|
||||
}
|
||||
} else {
|
||||
SDL_IncrementSubsystemRefCount(SDL_INIT_TIMER);
|
||||
}
|
||||
flags_initialized |= SDL_INIT_TIMER;
|
||||
}
|
||||
|
||||
// Initialize the video subsystem
|
||||
if (flags & SDL_INIT_VIDEO) {
|
||||
#ifndef SDL_VIDEO_DISABLED
|
||||
@@ -573,13 +559,6 @@ void SDL_QuitSubSystem(SDL_InitFlags flags)
|
||||
}
|
||||
#endif
|
||||
|
||||
if (flags & SDL_INIT_TIMER) {
|
||||
if (SDL_ShouldQuitSubsystem(SDL_INIT_TIMER)) {
|
||||
SDL_QuitTimers();
|
||||
}
|
||||
SDL_DecrementSubsystemRefCount(SDL_INIT_TIMER);
|
||||
}
|
||||
|
||||
if (flags & SDL_INIT_EVENTS) {
|
||||
if (SDL_ShouldQuitSubsystem(SDL_INIT_EVENTS)) {
|
||||
SDL_QuitEvents();
|
||||
@@ -632,6 +611,8 @@ void SDL_Quit(void)
|
||||
SDL_DBus_Quit();
|
||||
#endif
|
||||
|
||||
SDL_QuitTimers();
|
||||
|
||||
SDL_SetObjectsInvalid();
|
||||
SDL_AssertionsQuit();
|
||||
|
||||
|
@@ -178,8 +178,6 @@ static Uint64 SDLTest_GenerateExecKey(const char *runSeed, const char *suiteName
|
||||
/**
|
||||
* Set timeout handler for test.
|
||||
*
|
||||
* Note: SDL_Init(SDL_INIT_TIMER) will be called if it wasn't done so before.
|
||||
*
|
||||
* \param timeout Timeout interval in seconds.
|
||||
* \param callback Function that will be called after timeout has elapsed.
|
||||
*
|
||||
@@ -200,14 +198,6 @@ static SDL_TimerID SDLTest_SetTestTimeout(int timeout, SDL_TimerCallback callbac
|
||||
return 0;
|
||||
}
|
||||
|
||||
/* Init SDL timer if not initialized before */
|
||||
if (!SDL_WasInit(SDL_INIT_TIMER)) {
|
||||
if (!SDL_InitSubSystem(SDL_INIT_TIMER)) {
|
||||
SDLTest_LogError("Failed to init timer subsystem: %s", SDL_GetError());
|
||||
return 0;
|
||||
}
|
||||
}
|
||||
|
||||
/* Set timer */
|
||||
timeoutInMilliseconds = timeout * 1000;
|
||||
timerID = SDL_AddTimer(timeoutInMilliseconds, callback, 0x0);
|
||||
|
Reference in New Issue
Block a user