void ReCreateBitmap(Bitmap **bitmap, int width, int height)
{
+ if (*bitmap != NULL)
+ {
+ /* if new bitmap size fits into old one, no need to re-create it */
+ if (width <= (*bitmap)->width &&
+ height <= (*bitmap)->height)
+ return;
+
+ /* else adjust size so that old and new bitmap size fit into it */
+ width = MAX(width, (*bitmap)->width);
+ height = MAX(height, (*bitmap)->height);
+ }
+
Bitmap *new_bitmap = CreateBitmap(width, height, DEFAULT_DEPTH);
if (*bitmap == NULL)
return FALSE;
}
+boolean DrawingDeactivatedField()
+{
+ if (program.headless)
+ return TRUE;
+
+ if (gfx.draw_deactivation_mask & REDRAW_FIELD)
+ return TRUE;
+
+ return FALSE;
+}
+
boolean DrawingDeactivated(int x, int y, int width, int height)
{
return CheckDrawingArea(x, y, width, height, gfx.draw_deactivation_mask);
return (SDL_PollEvent(NULL) ? TRUE : FALSE);
}
-void NextEvent(Event *event)
+void WaitEvent(Event *event)
{
- SDLNextEvent(event);
+ SDLWaitEvent(event);
}
void PeekEvent(Event *event)
#endif
}
+void CheckQuitEvent(void)
+{
+ if (SDL_QuitRequested())
+ program.exit_function(0);
+}
+
Key GetEventKey(KeyEvent *event, boolean with_modifiers)
{
#if defined(TARGET_SDL2)