mirror of https://github.com/encounter/SDL.git
Fixed whitespace
This commit is contained in:
parent
7f728f3eb6
commit
dd5d89505d
|
@ -794,7 +794,7 @@ SDL_PollEvent(SDL_Event * event)
|
||||||
static int
|
static int
|
||||||
SDL_WaitEventTimeout_Device(_THIS, SDL_Window *wakeup_window, SDL_Event * event, Uint32 start, int timeout)
|
SDL_WaitEventTimeout_Device(_THIS, SDL_Window *wakeup_window, SDL_Event * event, Uint32 start, int timeout)
|
||||||
{
|
{
|
||||||
int loop_timeout = timeout;
|
int loop_timeout = timeout;
|
||||||
|
|
||||||
for (;;) {
|
for (;;) {
|
||||||
/* Pump events on entry and each time we wake to ensure:
|
/* Pump events on entry and each time we wake to ensure:
|
||||||
|
@ -825,15 +825,15 @@ SDL_WaitEventTimeout_Device(_THIS, SDL_Window *wakeup_window, SDL_Event * event,
|
||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
/* No events found in the queue, call WaitEventTimeout to wait for an event. */
|
/* No events found in the queue, call WaitEventTimeout to wait for an event. */
|
||||||
if (timeout > 0) {
|
if (timeout > 0) {
|
||||||
Uint32 elapsed = SDL_GetTicks() - start;
|
Uint32 elapsed = SDL_GetTicks() - start;
|
||||||
if (elapsed >= (Uint32)timeout) {
|
if (elapsed >= (Uint32)timeout) {
|
||||||
/* Set wakeup_window to NULL without holding the lock. */
|
/* Set wakeup_window to NULL without holding the lock. */
|
||||||
_this->wakeup_window = NULL;
|
_this->wakeup_window = NULL;
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
loop_timeout = (int)((Uint32)timeout - elapsed);
|
loop_timeout = (int)((Uint32)timeout - elapsed);
|
||||||
}
|
}
|
||||||
status = _this->WaitEventTimeout(_this, loop_timeout);
|
status = _this->WaitEventTimeout(_this, loop_timeout);
|
||||||
/* Set wakeup_window to NULL without holding the lock. */
|
/* Set wakeup_window to NULL without holding the lock. */
|
||||||
_this->wakeup_window = NULL;
|
_this->wakeup_window = NULL;
|
||||||
|
@ -889,7 +889,7 @@ SDL_WaitEventTimeout(SDL_Event * event, int timeout)
|
||||||
{
|
{
|
||||||
SDL_VideoDevice *_this = SDL_GetVideoDevice();
|
SDL_VideoDevice *_this = SDL_GetVideoDevice();
|
||||||
SDL_Window *wakeup_window;
|
SDL_Window *wakeup_window;
|
||||||
Uint32 start = 0;
|
Uint32 start = 0;
|
||||||
Uint32 expiration = 0;
|
Uint32 expiration = 0;
|
||||||
|
|
||||||
/* First check for existing events */
|
/* First check for existing events */
|
||||||
|
@ -901,16 +901,16 @@ SDL_WaitEventTimeout(SDL_Event * event, int timeout)
|
||||||
default:
|
default:
|
||||||
/* Check whether we have reached the end of the poll cycle, and no more events are left */
|
/* Check whether we have reached the end of the poll cycle, and no more events are left */
|
||||||
if (timeout == 0 && event && event->type == SDL_POLLSENTINEL) {
|
if (timeout == 0 && event && event->type == SDL_POLLSENTINEL) {
|
||||||
return SDL_PeepEvents(event, 1, SDL_GETEVENT, SDL_FIRSTEVENT, SDL_LASTEVENT) == 1;
|
return (SDL_PeepEvents(event, 1, SDL_GETEVENT, SDL_FIRSTEVENT, SDL_LASTEVENT) == 1);
|
||||||
}
|
}
|
||||||
/* Has existing events */
|
/* Has existing events */
|
||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (timeout > 0) {
|
if (timeout > 0) {
|
||||||
start = SDL_GetTicks();
|
start = SDL_GetTicks();
|
||||||
expiration = start + timeout;
|
expiration = start + timeout;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (timeout != 0 && _this && _this->WaitEventTimeout && _this->SendWakeupEvent && !SDL_events_need_polling()) {
|
if (timeout != 0 && _this && _this->WaitEventTimeout && _this->SendWakeupEvent && !SDL_events_need_polling()) {
|
||||||
/* Look if a shown window is available to send the wakeup event. */
|
/* Look if a shown window is available to send the wakeup event. */
|
||||||
|
|
Loading…
Reference in New Issue