X-Git-Url: https://git.artsoft.org/?p=rocksndiamonds.git;a=blobdiff_plain;f=src%2Flibgame%2Fsystem.c;h=222b6f609a19d9d1fb899891b064e6f0dfa14f8e;hp=df401b5a57a6ebea20d8f539f6eedff4be5076b9;hb=a1fabab3e5db1baab46a95a318b27fdf33d470cc;hpb=6c674ccdd458314ced75459649c6acf1489b6056 diff --git a/src/libgame/system.c b/src/libgame/system.c index df401b5a..222b6f60 100644 --- a/src/libgame/system.c +++ b/src/libgame/system.c @@ -387,6 +387,10 @@ void InitVideoBuffer(int width, int height, int depth, boolean fullscreen) video.frame_delay_value = GAME_FRAME_DELAY; video.shifted_up = FALSE; + video.shifted_up_pos = 0; + video.shifted_up_pos_last = 0; + video.shifted_up_delay = 0; + video.shifted_up_delay_value = ONE_SECOND_DELAY / 4; SDLInitVideoBuffer(fullscreen); @@ -1397,16 +1401,6 @@ void SetAudioMode(boolean enabled) /* event functions */ /* ========================================================================= */ -void InitEventFilter(EventFilter filter_function) -{ - /* set event filter to filter out certain events */ -#if defined(TARGET_SDL2) - SDL_SetEventFilter(filter_function, NULL); -#else - SDL_SetEventFilter(filter_function); -#endif -} - boolean PendingEvent(void) { return (SDL_PollEvent(NULL) ? TRUE : FALSE); @@ -1513,14 +1507,18 @@ KeyMod GetKeyModStateFromEvents() return HandleKeyModState(KSYM_UNDEFINED, 0); } -void StartTextInput(int x, int y) +void StartTextInput(int x, int y, int width, int height) { #if defined(TARGET_SDL2) SDL_StartTextInput(); #if defined(HAS_SCREEN_KEYBOARD) - if (y > video.height / 2) + if (y + height > SCREEN_KEYBOARD_POS(video.height)) + { + video.shifted_up_pos = y + height - SCREEN_KEYBOARD_POS(video.height); + video.shifted_up_delay = SDL_GetTicks(); video.shifted_up = TRUE; + } #endif #endif } @@ -1531,7 +1529,12 @@ void StopTextInput() SDL_StopTextInput(); #if defined(HAS_SCREEN_KEYBOARD) - video.shifted_up = FALSE; + if (video.shifted_up) + { + video.shifted_up_pos = 0; + video.shifted_up_delay = SDL_GetTicks(); + video.shifted_up = FALSE; + } #endif #endif }