early-access version 2847
This commit is contained in:
13
externals/SDL/src/timer/os2/SDL_systimer.c
vendored
13
externals/SDL/src/timer/os2/SDL_systimer.c
vendored
@@ -39,7 +39,6 @@
|
||||
|
||||
typedef unsigned long long ULLONG;
|
||||
|
||||
static SDL_bool ticks_started = SDL_FALSE;
|
||||
static ULONG ulTmrFreq = 0;
|
||||
static ULLONG ullTmrStart = 0;
|
||||
|
||||
@@ -47,14 +46,7 @@ void
|
||||
SDL_TicksInit(void)
|
||||
{
|
||||
ULONG ulTmrStart; /* for 32-bit fallback. */
|
||||
ULONG ulRC;
|
||||
|
||||
if (ticks_started) {
|
||||
return;
|
||||
}
|
||||
ticks_started = SDL_TRUE;
|
||||
|
||||
ulRC = DosTmrQueryFreq(&ulTmrFreq);
|
||||
ULONG ulRC = DosTmrQueryFreq(&ulTmrFreq);
|
||||
if (ulRC != NO_ERROR) {
|
||||
debug_os2("DosTmrQueryFreq() failed, rc = %u", ulRC);
|
||||
} else {
|
||||
@@ -73,7 +65,6 @@ SDL_TicksInit(void)
|
||||
void
|
||||
SDL_TicksQuit(void)
|
||||
{
|
||||
ticks_started = SDL_FALSE;
|
||||
}
|
||||
|
||||
Uint64
|
||||
@@ -82,7 +73,7 @@ SDL_GetTicks64(void)
|
||||
Uint64 ui64Result;
|
||||
ULLONG ullTmrNow;
|
||||
|
||||
if (!ticks_started) {
|
||||
if (ulTmrFreq == 0) { /* Was not initialized. */
|
||||
SDL_TicksInit();
|
||||
}
|
||||
|
||||
|
15
externals/SDL/src/timer/unix/SDL_systimer.c
vendored
15
externals/SDL/src/timer/unix/SDL_systimer.c
vendored
@@ -187,6 +187,13 @@ SDL_GetPerformanceFrequency(void)
|
||||
void
|
||||
SDL_Delay(Uint32 ms)
|
||||
{
|
||||
#ifdef __EMSCRIPTEN__
|
||||
if (emscripten_has_asyncify() && SDL_GetHintBoolean(SDL_HINT_EMSCRIPTEN_ASYNCIFY, SDL_TRUE)) {
|
||||
/* pseudo-synchronous pause, used directly or through e.g. SDL_WaitEvent */
|
||||
emscripten_sleep(ms);
|
||||
return;
|
||||
}
|
||||
#endif
|
||||
int was_error;
|
||||
|
||||
#if HAVE_NANOSLEEP
|
||||
@@ -196,14 +203,6 @@ SDL_Delay(Uint32 ms)
|
||||
Uint64 then, now, elapsed;
|
||||
#endif
|
||||
|
||||
#ifdef __EMSCRIPTEN__
|
||||
if (emscripten_has_asyncify() && SDL_GetHintBoolean(SDL_HINT_EMSCRIPTEN_ASYNCIFY, SDL_TRUE)) {
|
||||
/* pseudo-synchronous pause, used directly or through e.g. SDL_WaitEvent */
|
||||
emscripten_sleep(ms);
|
||||
return;
|
||||
}
|
||||
#endif
|
||||
|
||||
/* Set the timeout interval */
|
||||
#if HAVE_NANOSLEEP
|
||||
elapsed.tv_sec = ms / 1000;
|
||||
|
Reference in New Issue
Block a user