diff --git a/navy-apps/libs/libminiSDL/src/event.c b/navy-apps/libs/libminiSDL/src/event.c index 1c8c3dc..6f06b17 100644 --- a/navy-apps/libs/libminiSDL/src/event.c +++ b/navy-apps/libs/libminiSDL/src/event.c @@ -1,5 +1,6 @@ #include #include +#include #define keyname(k) #k, @@ -17,6 +18,22 @@ int SDL_PollEvent(SDL_Event *ev) { } int SDL_WaitEvent(SDL_Event *event) { + char buf[64]; + while (NDL_PollEvent(buf, sizeof(buf))) { + if (buf[0] == 'k') { + if (buf[1] == 'd') { + event->type = SDL_KEYDOWN; + } else if (buf[1] == 'u') { + event->type = SDL_KEYUP; + } + for (int i = 0; i < sizeof(keyname) / sizeof(keyname[0]); i ++ ) { + if (strcmp(buf + 3, keyname[i]) == 0) { + event->key.keysym.sym = i; + break; + } + } + } + } return 1; } diff --git a/navy-apps/libs/libminiSDL/src/video.c b/navy-apps/libs/libminiSDL/src/video.c index 43ae97c..031cf07 100644 --- a/navy-apps/libs/libminiSDL/src/video.c +++ b/navy-apps/libs/libminiSDL/src/video.c @@ -7,7 +7,6 @@ void SDL_BlitSurface(SDL_Surface *src, SDL_Rect *srcrect, SDL_Surface *dst, SDL_Rect *dstrect) { assert(dst && src); assert(dst->format->BitsPerPixel == src->format->BitsPerPixel == 32); - assert(0); SDL_Rect rect = { .w = srcrect ? srcrect->w : src->w, .h = srcrect ? srcrect->h : src->h,