improve pollevent
This commit is contained in:
parent
aac891a977
commit
d04324372d
12
inc/lzy.h
12
inc/lzy.h
|
@ -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;
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue