{
void (*draw_border_function)(void) = NULL;
Bitmap *bitmap = (fade_mode == FADE_MODE_CROSSFADE ? bitmap_db_cross : NULL);
- int fade_delay = menu.fade_delay;
- int post_delay = (fade_mode == FADE_MODE_FADE_OUT ? menu.post_delay : 0);
int x, y, width, height;
+ int fade_delay, post_delay;
if (fade_mask & REDRAW_FIELD)
{
width = FULL_SXSIZE;
height = FULL_SYSIZE;
+ fade_delay = menu.fade_delay;
+ post_delay = (fade_mode == FADE_MODE_FADE_OUT ? menu.post_delay : 0);
+
draw_border_function = DrawMaskedBorder_FIELD;
}
else /* REDRAW_ALL */
y = 0;
width = WIN_XSIZE;
height = WIN_YSIZE;
+
+ fade_delay = title.fade_delay_final;
+ post_delay = (fade_mode == FADE_MODE_FADE_OUT ? title.post_delay_final : 0);
}
redraw_mask |= fade_mask;
SetDoorBackgroundBitmap(bitmap_db_panel);
}
-void DrawBackground(int dst_x, int dst_y, int width, int height)
+void DrawBackground(int x, int y, int width, int height)
{
-#if 1
- ClearRectangleOnBackground(drawto, dst_x, dst_y, width, height);
+ /* !!! "drawto" might still point to playfield buffer here (see below) !!! */
+ /* (when entering hall of fame after playing) */
+#if 0
+ ClearRectangleOnBackground(drawto, x, y, width, height);
#else
- ClearRectangleOnBackground(backbuffer, dst_x, dst_y, width, height);
+ ClearRectangleOnBackground(backbuffer, x, y, width, height);
#endif
redraw_mask |= REDRAW_FIELD;
}
+void DrawBackgroundForFont(int x, int y, int width, int height, int font_nr)
+{
+ struct FontBitmapInfo *font = getFontBitmapInfo(font_nr);
+
+ if (font->bitmap == NULL)
+ return;
+
+ DrawBackground(x, y, width, height);
+}
+
+void DrawBackgroundForGraphic(int x, int y, int width, int height, int graphic)
+{
+ struct GraphicInfo *g = &graphic_info[graphic];
+
+ if (g->bitmap == NULL)
+ return;
+
+ DrawBackground(x, y, width, height);
+}
+
void ClearWindow()
{
+ /* !!! "drawto" might still point to playfield buffer here (see above) !!! */
+ /* (when entering hall of fame after playing) */
DrawBackground(REAL_SX, REAL_SY, FULL_SXSIZE, FULL_SYSIZE);
+ /* !!! maybe this should be done before clearing the background !!! */
if (setup.soft_scrolling && game_status == GAME_MODE_PLAYING)
{
ClearRectangle(fieldbuffer, 0, 0, FXSIZE, FYSIZE);
NextEvent(&event);
- switch(event.type)
+ switch (event.type)
{
case EVENT_BUTTONPRESS:
case EVENT_BUTTONRELEASE:
/* this sets 'request_gadget_id' */
HandleGadgets(mx, my, button_status);
- switch(request_gadget_id)
+ switch (request_gadget_id)
{
case TOOL_CTRL_ID_YES:
result = TRUE;
}
case EVENT_KEYPRESS:
- switch(GetEventKey((KeyEvent *)&event, TRUE))
+ switch (GetEventKey((KeyEvent *)&event, TRUE))
{
case KSYM_Return:
result = 1;
int get_next_element(int element)
{
- switch(element)
+ switch (element)
{
case EL_QUICKSAND_FILLING: return EL_QUICKSAND_FULL;
case EL_QUICKSAND_EMPTYING: return EL_QUICKSAND_EMPTY;