BackToFront();
}
-void FadeIn(int fade_delay)
+void FadeExt(int fade_mask, int fade_mode)
{
- if (fade_delay == 0)
- {
- BackToFront();
+ 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;
- return;
+ if (fade_mask & REDRAW_ALL)
+ {
+ x = 0;
+ y = 0;
+ width = WIN_XSIZE;
+ height = WIN_YSIZE;
+ }
+ else if (fade_mask & REDRAW_FIELD)
+ {
+ x = REAL_SX;
+ y = REAL_SY;
+ width = FULL_SXSIZE;
+ height = FULL_SYSIZE;
}
- FadeScreen(NULL, FADE_MODE_FADE_IN, fade_delay, 0);
-
- redraw_mask = REDRAW_NONE;
-}
+ redraw_mask |= fade_mask;
-void FadeOut(int fade_delay, int post_delay)
-{
- if (fade_delay == 0)
+ if (!setup.fading || fade_delay == 0)
{
- ClearRectangle(backbuffer, 0, 0, WIN_XSIZE, WIN_YSIZE);
+ if (fade_mode == FADE_MODE_FADE_OUT)
+ ClearRectangle(backbuffer, x, y, width, height);
+
BackToFront();
return;
}
- FadeScreen(NULL, FADE_MODE_FADE_OUT, fade_delay, post_delay);
+ FadeRectangle(bitmap, x, y, width, height, fade_mode, fade_delay, post_delay);
- redraw_mask = REDRAW_NONE;
+ redraw_mask &= ~fade_mask;
}
-void FadeCross(int fade_delay)
+void FadeIn(int fade_mask)
{
- if (fade_delay == 0)
- {
- BlitBitmap(bitmap_db_title, backbuffer, 0, 0, WIN_XSIZE, WIN_YSIZE, 0, 0);
- BackToFront();
+ FadeExt(fade_mask, FADE_MODE_FADE_IN);
+}
- return;
- }
+void FadeOut(int fade_mask)
+{
+ FadeExt(fade_mask, FADE_MODE_FADE_OUT);
+}
- FadeScreen(bitmap_db_title, FADE_MODE_CROSSFADE, fade_delay, 0);
+void FadeCross(int fade_mask)
+{
+ FadeExt(fade_mask, FADE_MODE_CROSSFADE);
+}
- redraw_mask = REDRAW_NONE;
+void FadeCrossSaveBackbuffer()
+{
+ BlitBitmap(backbuffer, bitmap_db_cross, 0, 0, WIN_XSIZE, WIN_YSIZE, 0, 0);
}
void SetMainBackgroundImageIfDefined(int graphic)
graphic_info[IMG_BACKGROUND].bitmap);
}
+void SetPanelBackground()
+{
+ BlitBitmap(graphic_info[IMG_GLOBAL_DOOR].bitmap, bitmap_db_panel,
+ DOOR_GFX_PAGEX5, DOOR_GFX_PAGEY1, DXSIZE, DYSIZE, 0, 0);
+
+ SetDoorBackgroundBitmap(bitmap_db_panel);
+}
+
void DrawBackground(int dst_x, int dst_y, int width, int height)
{
+#if 1
+ ClearRectangleOnBackground(drawto, dst_x, dst_y, width, height);
+#else
ClearRectangleOnBackground(backbuffer, dst_x, dst_y, width, height);
+#endif
redraw_mask |= REDRAW_FIELD;
}
GfxElement[jx][jy] = EL_UNDEFINED;
/* make sure that pushed elements are drawn with correct frame rate */
+#if 1
+ graphic = el_act_dir2img(element, ACTION_PUSHING, move_dir);
+
+ if (player->is_pushing && player->is_moving && !IS_ANIM_MODE_CE(graphic))
+ GfxFrame[jx][jy] = player->StepFrame;
+#else
if (player->is_pushing && player->is_moving)
GfxFrame[jx][jy] = player->StepFrame;
+#endif
DrawLevelField(jx, jy);
}
int px = SCREENX(jx), py = SCREENY(jy);
int pxx = (TILEX - ABS(sxx)) * dx;
int pyy = (TILEY - ABS(syy)) * dy;
+ int gfx_frame = GfxFrame[jx][jy];
int graphic;
+ int sync_frame;
int frame;
if (!IS_MOVING(jx, jy)) /* push movement already finished */
+ {
element = Feld[next_jx][next_jy];
+ gfx_frame = GfxFrame[next_jx][next_jy];
+ }
graphic = el_act_dir2img(element, ACTION_PUSHING, move_dir);
+
+#if 1
+ sync_frame = (IS_ANIM_MODE_CE(graphic) ? gfx_frame : player->StepFrame);
+ frame = getGraphicAnimationFrame(graphic, sync_frame);
+#else
frame = getGraphicAnimationFrame(graphic, player->StepFrame);
+#endif
/* draw background element under pushed element (like the Sokoban field) */
if (Back[next_jx][next_jy])
DOOR_GFX_PAGEX2, DOOR_GFX_PAGEY1);
}
+#if 1
+ SetDoorBackgroundImage(IMG_BACKGROUND_DOOR);
+#endif
+
SetDrawBackgroundMask(REDRAW_FIELD | REDRAW_DOOR_1);
/* clear door drawing field */
if (!(req_state & REQUEST_WAIT_FOR_INPUT))
{
- SetDrawBackgroundMask(REDRAW_FIELD);
+ if (game_status == GAME_MODE_PLAYING)
+ {
+ SetPanelBackground();
+ SetDrawBackgroundMask(REDRAW_DOOR_1);
+ }
+ else
+ {
+ SetDrawBackgroundMask(REDRAW_FIELD);
+ }
return FALSE;
}
RemapAllGadgets();
- SetDrawBackgroundMask(REDRAW_FIELD);
+ if (game_status == GAME_MODE_PLAYING)
+ {
+ SetPanelBackground();
+ SetDrawBackgroundMask(REDRAW_DOOR_1);
+ }
+ else
+ {
+ SetDrawBackgroundMask(REDRAW_FIELD);
+ }
#if defined(NETWORK_AVALIABLE)
/* continue network game after request */