From: Holger Schemel Date: Wed, 25 May 2016 19:36:30 +0000 (+0200) Subject: removed using cross-fading buffer (not needed anymore after recent changes) X-Git-Tag: 4.0.0.0-rc3~54 X-Git-Url: https://git.artsoft.org/?a=commitdiff_plain;h=0c454763268d571be71d2c7a633f5bd855d0ad0b;p=rocksndiamonds.git removed using cross-fading buffer (not needed anymore after recent changes) --- diff --git a/src/libgame/sdl.c b/src/libgame/sdl.c index 48a3e374..a860eeb9 100644 --- a/src/libgame/sdl.c +++ b/src/libgame/sdl.c @@ -924,7 +924,7 @@ void PrepareFadeBitmap(int draw_target) FinalizeScreen(draw_target); } -void SDLFadeRectangle(Bitmap *bitmap_cross, int x, int y, int width, int height, +void SDLFadeRectangle(int x, int y, int width, int height, int fade_mode, int fade_delay, int post_delay, void (*draw_border_function)(void)) { diff --git a/src/libgame/sdl.h b/src/libgame/sdl.h index 8c4ae076..4d70bfcd 100644 --- a/src/libgame/sdl.h +++ b/src/libgame/sdl.h @@ -453,7 +453,7 @@ void SDLFreeBitmapPointers(Bitmap *); void SDLCopyArea(Bitmap *, Bitmap *, int, int, int, int, int, int, int); void SDLBlitTexture(Bitmap *, int, int, int, int, int, int, int); void SDLFillRectangle(Bitmap *, int, int, int, int, Uint32); -void SDLFadeRectangle(Bitmap *, int, int, int, int, int, int, int, +void SDLFadeRectangle(int, int, int, int, int, int, int, void (*draw_border_function)(void)); void SDLDrawSimpleLine(Bitmap *, int, int, int, int, Uint32); void SDLDrawLine(Bitmap *, int, int, int, int, Uint32); diff --git a/src/libgame/system.c b/src/libgame/system.c index 02938e35..4e53f626 100644 --- a/src/libgame/system.c +++ b/src/libgame/system.c @@ -671,7 +671,7 @@ void BlitBitmapTiled(Bitmap *src_bitmap, Bitmap *dst_bitmap, } } -void FadeRectangle(Bitmap *bitmap_cross, int x, int y, int width, int height, +void FadeRectangle(int x, int y, int width, int height, int fade_mode, int fade_delay, int post_delay, void (*draw_border_function)(void)) { @@ -679,7 +679,7 @@ void FadeRectangle(Bitmap *bitmap_cross, int x, int y, int width, int height, if (!InClippedRectangle(backbuffer, &x, &y, &width, &height, TRUE)) return; - SDLFadeRectangle(bitmap_cross, x, y, width, height, + SDLFadeRectangle(x, y, width, height, fade_mode, fade_delay, post_delay, draw_border_function); } diff --git a/src/libgame/system.h b/src/libgame/system.h index 7abe7328..f155c212 100644 --- a/src/libgame/system.h +++ b/src/libgame/system.h @@ -1389,7 +1389,7 @@ void ReCreateBitmap(Bitmap **, int, int, int); void FreeBitmap(Bitmap *); void BlitBitmap(Bitmap *, Bitmap *, int, int, int, int, int, int); void BlitBitmapTiled(Bitmap *, Bitmap *, int, int, int, int, int, int, int,int); -void FadeRectangle(Bitmap *bitmap, int, int, int, int, int, int, int, +void FadeRectangle(int, int, int, int, int, int, int, void (*draw_border_function)(void)); void FillRectangle(Bitmap *, int, int, int, int, Pixel); void ClearRectangle(Bitmap *, int, int, int, int); diff --git a/src/tools.c b/src/tools.c index ac83cfd5..ec059e12 100644 --- a/src/tools.c +++ b/src/tools.c @@ -598,26 +598,10 @@ void BackToFront_WithFrameDelay(unsigned int frame_delay_value) SetVideoFrameDelay(frame_delay_value_old); } -static void FadeCrossSaveBackbuffer() -{ - BlitBitmap(backbuffer, bitmap_db_cross, 0, 0, WIN_XSIZE, WIN_YSIZE, 0, 0); -} - -static void FadeCrossRestoreBackbuffer() -{ - int redraw_mask_last = redraw_mask; - - BlitBitmap(bitmap_db_cross, backbuffer, 0, 0, WIN_XSIZE, WIN_YSIZE, 0, 0); - - // do not change redraw mask when restoring backbuffer after cross-fading - redraw_mask = redraw_mask_last; -} - static void FadeExt(int fade_mask, int fade_mode, int fade_type) { static int fade_type_skip = FADE_TYPE_NONE; void (*draw_border_function)(void) = NULL; - Bitmap *bitmap = (fade_mode & FADE_TYPE_TRANSFORM ? bitmap_db_cross : NULL); int x, y, width, height; int fade_delay, post_delay; @@ -632,18 +616,8 @@ static void FadeExt(int fade_mask, int fade_mode, int fade_type) return; } -#if 1 - FadeCrossSaveBackbuffer(); -#endif - if (fading.fade_mode & FADE_TYPE_TRANSFORM) - { -#if 0 - FadeCrossSaveBackbuffer(); -#endif - return; - } } redraw_mask |= fade_mask; @@ -706,12 +680,9 @@ static void FadeExt(int fade_mask, int fade_mode, int fade_type) return; } - FadeRectangle(bitmap, x, y, width, height, fade_mode, fade_delay, post_delay, + FadeRectangle(x, y, width, height, fade_mode, fade_delay, post_delay, draw_border_function); - if (fade_type == FADE_TYPE_FADE_OUT) - FadeCrossRestoreBackbuffer(); - redraw_mask &= ~fade_mask; }