Fixed left-button-up event handled with one second delay if the game does not redraw the screen

This commit is contained in:
pelya
2017-04-02 23:16:11 +03:00
committed by Sergii Pylypenko
parent 0bcb37fc60
commit bb0f09fddc

View File

@@ -155,7 +155,11 @@ static void CheckPaletteAnim()
static void DrawSurfaceToScreen()
{
int n = _num_dirty_rects;
#ifdef __ANDROID__
if (n == 0 && !_left_button_down) return; // We have to update the screen regularly to receive mouse_up event on Android
#else
if (n == 0) return;
#endif
static int frameskip = 0;
#ifdef __ANDROID__
@@ -179,7 +183,9 @@ static void DrawSurfaceToScreen()
SDL_CALL SDL_BlitSurface(_sdl_screen, &_dirty_rects[i], _sdl_realscreen, &_dirty_rects[i]);
}
}
SDL_CALL SDL_UpdateRects(_sdl_realscreen, n, _dirty_rects);
static SDL_Rect dummy_rect = { 0, 0, 8, 8 };
if (n > 0) SDL_CALL SDL_UpdateRects(_sdl_realscreen, n, _dirty_rects);
else SDL_CALL SDL_UpdateRects(_sdl_realscreen, 1, &dummy_rect);
}
}