Added a macro SDL_TICKS_PASSED() to correctly compare two 32-bit tick values.
Went through the code and used the macro and fixed a couple places that were using incorrect timestamp comparisons.
This commit is contained in:
parent
84561c952a
commit
367ffcc3af
12 changed files with 23 additions and 21 deletions
|
@ -443,7 +443,7 @@ SDL_WaitEventTimeout(SDL_Event * event, int timeout)
|
|||
/* Polling and no events, just return */
|
||||
return 0;
|
||||
}
|
||||
if (timeout > 0 && ((int) (SDL_GetTicks() - expiration) >= 0)) {
|
||||
if (timeout > 0 && SDL_TICKS_PASSED(SDL_GetTicks(), expiration)) {
|
||||
/* Timeout expired and no events */
|
||||
return 0;
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue