X-Git-Url: https://git.artsoft.org/?a=blobdiff_plain;f=src%2Flibgame%2Fsystem.c;h=f9cc4fe894708219c0f1af1e383c251c10608fab;hb=92736512b4fedc65254597f1b3e85a885b0e6e62;hp=3eb9c62d55dc4e42d32de21e5459c876d7542f3d;hpb=746d91a67b5059c607e8e6bd0453e6e0738ffe45;p=rocksndiamonds.git diff --git a/src/libgame/system.c b/src/libgame/system.c index 3eb9c62d..f9cc4fe8 100644 --- a/src/libgame/system.c +++ b/src/libgame/system.c @@ -273,7 +273,7 @@ void InitGfxClipRegion(boolean enabled, int x, int y, int width, int height) gfx.clip_height = height; } -void InitGfxDrawBusyAnimFunction(void (*draw_busy_anim_function)(void)) +void InitGfxDrawBusyAnimFunction(void (*draw_busy_anim_function)(boolean)) { gfx.draw_busy_anim_function = draw_busy_anim_function; } @@ -1845,6 +1845,24 @@ void PushUserEvent(int code, int value1, int value2) SDL_PushEvent((SDL_Event *)&event); } +boolean PendingEscapeKeyEvent(void) +{ + if (PendingEvent()) + { + Event event; + + // check if any key press event is pending + if (SDL_PeepEvents(&event, 1, SDL_PEEKEVENT, SDL_KEYDOWN, SDL_KEYDOWN) != 1) + return FALSE; + + // check if pressed key is "Escape" key + if (event.key.keysym.sym == KSYM_Escape) + return TRUE; + } + + return FALSE; +} + // ============================================================================ // joystick functions