diff options
author | KikooDX <kikoodx@paranoici.org> | 2022-03-12 22:11:00 +0100 |
---|---|---|
committer | KikooDX <kikoodx@paranoici.org> | 2022-03-12 22:11:00 +0100 |
commit | d04324372d4293c9044961eb04140fd5a5cde006 (patch) | |
tree | 8ecd9a2a837f30519f87fb4ee2687f6bda142cb2 | |
parent | aac891a977028cc4b0bd135933f52f63232ecdef (diff) | |
download | lzy-d04324372d4293c9044961eb04140fd5a5cde006.tar.gz |
improve pollevent
-rw-r--r-- | inc/lzy.h | 12 |
1 files changed, 5 insertions, 7 deletions
@@ -403,7 +403,7 @@ int LZY_PollEvent(LZY_Event *e) { e->u.key.scancode = gk_e.key; return 1; default: - return -1; + break; } } } @@ -895,7 +895,7 @@ int LZY_SoundPlay(LZY_Sound *sound, int loops) { int LZY_PollEvent(LZY_Event *e) { SDL_Event sdl_e; - if (SDL_PollEvent(&sdl_e) != 0) { + while (SDL_PollEvent(&sdl_e) != 0) { switch (sdl_e.type) { case SDL_QUIT: e->type = LZY_QUIT; @@ -923,8 +923,7 @@ int LZY_PollEvent(LZY_Event *e) { !fullscreen); } } - return -1; - } + } break; case SDL_KEYUP: { int i = LZYK_COUNT; while (i-- > 0) { @@ -935,10 +934,9 @@ int LZY_PollEvent(LZY_Event *e) { return 1; } } - return -1; - } + } break; default: - return -1; + break; } } |