InitGfxDrawGlobalAnimFunction(DrawGlobalAnim);
InitGfxDrawGlobalBorderFunction(DrawMaskedBorderToTarget);
+ gfx.fade_border_source_status = global.border_status;
+ gfx.fade_border_target_status = global.border_status;
gfx.masked_border_bitmap_ptr = backbuffer;
/* use copy of busy animation to prevent change while reloading artwork */
{
SDL_BlitSurface(surface_cross, &src_rect, surface_source, &src_rect);
SDL_BlitSurface(surface_screen, &dst_rect, surface_target, &src_rect);
+
+ draw_global_border_function(DRAW_BORDER_TO_FADE_SOURCE);
+ draw_global_border_function(DRAW_BORDER_TO_FADE_TARGET);
}
else if (fade_mode & FADE_TYPE_FADE_IN)
{
SDL_BlitSurface(surface_black, &src_rect, surface_source, &src_rect);
SDL_BlitSurface(surface_screen, &dst_rect, surface_target, &src_rect);
+
+ draw_global_border_function(DRAW_BORDER_TO_FADE_TARGET);
}
else /* FADE_TYPE_FADE_OUT */
{
SDL_BlitSurface(surface_screen, &dst_rect, surface_source, &src_rect);
SDL_BlitSurface(surface_black, &src_rect, surface_target, &src_rect);
+
+ draw_global_border_function(DRAW_BORDER_TO_FADE_SOURCE);
}
time_current = SDL_GetTicks();
/* values for drawing target for global border */
#define DRAW_BORDER_TO_BACKBUFFER 0
#define DRAW_BORDER_TO_SCREEN 1
+#define DRAW_BORDER_TO_FADE_SOURCE 2
+#define DRAW_BORDER_TO_FADE_TARGET 3
/* values for move directions and special "button" key bitmasks */
#define MV_NONE 0
Bitmap *fade_bitmap_target;
Bitmap *fade_bitmap_black;
+ int fade_border_source_status;
+ int fade_border_target_status;
Bitmap *masked_border_bitmap_ptr;
#if USE_FINAL_SCREEN_BITMAP
void DrawMaskedBorderToTarget(int draw_target)
{
- DrawMaskedBorderExt(REDRAW_ALL, draw_target);
+ if (draw_target == DRAW_BORDER_TO_SCREEN)
+ {
+ DrawMaskedBorderExt(REDRAW_ALL, draw_target);
+ }
+ else
+ {
+ int last_border_status = global.border_status;
+
+ if (draw_target == DRAW_BORDER_TO_FADE_SOURCE)
+ {
+ global.border_status = gfx.fade_border_source_status;
+ gfx.masked_border_bitmap_ptr = gfx.fade_bitmap_source;
+ }
+ else
+ {
+ global.border_status = gfx.fade_border_target_status;
+ gfx.masked_border_bitmap_ptr = gfx.fade_bitmap_target;
+ }
+
+ DrawMaskedBorderExt(REDRAW_ALL, draw_target);
+
+ global.border_status = last_border_status;
+ gfx.masked_border_bitmap_ptr = backbuffer;
+ }
}
void BlitScreenToBitmap_RND(Bitmap *target_bitmap)
static void SetScreenStates_AfterFadingIn()
{
+ // store new source screen (to use correct masked border for fading)
+ gfx.fade_border_source_status = global.border_status;
+
global.anim_status = global.anim_status_next;
// force update of global animation status in case of rapid screen changes
static void SetScreenStates_BeforeFadingOut()
{
+ // store new target screen (to use correct masked border for fading)
+ gfx.fade_border_target_status = game_status;
+
global.anim_status = GAME_MODE_PSEUDO_FADING;
}