From: Holger Schemel Date: Fri, 20 Apr 2007 18:09:45 +0000 (+0200) Subject: rnd-20070420-2-src X-Git-Tag: 3.2.4^2~29 X-Git-Url: https://git.artsoft.org/?a=commitdiff_plain;h=643bbf5bfe5db8cf56ff57f7e835e67053bb30ff;p=rocksndiamonds.git rnd-20070420-2-src * added graphics engine directive "border.draw_masked_when_fading" that enables/disables drawing of border mask over screen that is just faded --- diff --git a/ChangeLog b/ChangeLog index 247a18ac..c746ab0c 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,7 @@ +2007-04-19 + * added graphics engine directive "border.draw_masked_when_fading" that + enables/disables drawing of border mask over screen that is just faded + 2007-04-18 * fixed small problem with separate fading definition for game screen diff --git a/src/conftime.h b/src/conftime.h index 2bd6083e..6e192a2b 100644 --- a/src/conftime.h +++ b/src/conftime.h @@ -1 +1 @@ -#define COMPILE_DATE_STRING "2007-04-20 00:04" +#define COMPILE_DATE_STRING "2007-04-20 20:09" diff --git a/src/events.c b/src/events.c index 2dc5a016..811d8f9a 100644 --- a/src/events.c +++ b/src/events.c @@ -811,7 +811,8 @@ void HandleKey(Key key, int key_status) break; case KSYM_Escape: - FadeSkipNextFadeIn(); + if (game_status != GAME_MODE_MAIN) + FadeSkipNextFadeIn(); if (game_status == GAME_MODE_TITLE) HandleTitleScreen(0, 0, 0, 0, MB_MENU_LEAVE); diff --git a/src/init.c b/src/init.c index d1316588..148f927d 100644 --- a/src/init.c +++ b/src/init.c @@ -4462,8 +4462,10 @@ static void InitGlobal() global.fps_slowdown_factor = 1; global.border_status = GAME_MODE_MAIN; +#if 0 global.fading_status = GAME_MODE_MAIN; global.fading_type = TYPE_ENTER_MENU; +#endif } void Execute_Command(char *command) diff --git a/src/libgame/system.c b/src/libgame/system.c index 09c804f0..c77567a9 100644 --- a/src/libgame/system.c +++ b/src/libgame/system.c @@ -839,13 +839,10 @@ Bitmap *ZoomBitmap(Bitmap *src_bitmap, int zoom_width, int zoom_height) return dst_bitmap; } -#define MORE_ZOOM 1 - static void CreateScaledBitmaps(Bitmap *old_bitmap, int zoom_factor, boolean create_small_bitmaps) { Bitmap swap_bitmap; -#if MORE_ZOOM Bitmap *new_bitmap; Bitmap *tmp_bitmap_1; Bitmap *tmp_bitmap_2; @@ -859,10 +856,6 @@ static void CreateScaledBitmaps(Bitmap *old_bitmap, int zoom_factor, int width_8, height_8; int width_16, height_16; int width_32, height_32; -#else - Bitmap *new_bitmap, *tmp_bitmap_1, *tmp_bitmap_2, *tmp_bitmap_4,*tmp_bitmap_8; - int width_1, height_1, width_2, height_2, width_4, height_4, width_8,height_8; -#endif int new_width, new_height; /* calculate new image dimensions for normal sized image */ @@ -876,12 +869,11 @@ static void CreateScaledBitmaps(Bitmap *old_bitmap, int zoom_factor, tmp_bitmap_1 = old_bitmap; /* this is only needed to make compilers happy */ -#if MORE_ZOOM - tmp_bitmap_2 = tmp_bitmap_4 = tmp_bitmap_8 = tmp_bitmap_16 = NULL; + tmp_bitmap_2 = NULL; + tmp_bitmap_4 = NULL; + tmp_bitmap_8 = NULL; + tmp_bitmap_16 = NULL; tmp_bitmap_32 = NULL; -#else - tmp_bitmap_2 = tmp_bitmap_4 = tmp_bitmap_8 = NULL; -#endif if (create_small_bitmaps) { @@ -892,12 +884,10 @@ static void CreateScaledBitmaps(Bitmap *old_bitmap, int zoom_factor, height_4 = height_1 / 4; width_8 = width_1 / 8; height_8 = height_1 / 8; -#if MORE_ZOOM width_16 = width_1 / 16; height_16 = height_1 / 16; width_32 = width_1 / 32; height_32 = height_1 / 32; -#endif /* get image with 1/2 of normal size (for use in the level editor) */ if (zoom_factor != 2) @@ -917,7 +907,6 @@ static void CreateScaledBitmaps(Bitmap *old_bitmap, int zoom_factor, else tmp_bitmap_8 = old_bitmap; -#if MORE_ZOOM /* get image with 1/16 of normal size (for use on the preview screen) */ if (zoom_factor != 16) tmp_bitmap_16 = ZoomBitmap(tmp_bitmap_8, width_8 / 2, height_8 / 2); @@ -929,9 +918,9 @@ static void CreateScaledBitmaps(Bitmap *old_bitmap, int zoom_factor, tmp_bitmap_32 = ZoomBitmap(tmp_bitmap_16, width_16 / 2, height_16 / 2); else tmp_bitmap_32 = old_bitmap; -#endif } +#if 0 /* if image was scaled up, create new clipmask for normal size image */ if (zoom_factor != 1) { @@ -956,6 +945,7 @@ static void CreateScaledBitmaps(Bitmap *old_bitmap, int zoom_factor, SDL_SetColorKey(tmp_surface_1, 0, 0); /* reset transparent pixel */ #endif } +#endif if (create_small_bitmaps) { @@ -971,12 +961,10 @@ static void CreateScaledBitmaps(Bitmap *old_bitmap, int zoom_factor, width_1 / 2, height_1); BlitBitmap(tmp_bitmap_8, new_bitmap, 0, 0, width_1 / 8, height_1 / 8, 3 * width_1 / 4, height_1); -#if MORE_ZOOM BlitBitmap(tmp_bitmap_16, new_bitmap, 0, 0, width_1 / 16, height_1 / 16, 7 * width_1 / 8, height_1); BlitBitmap(tmp_bitmap_32, new_bitmap, 0, 0, width_1 / 32, height_1 / 32, 15 * width_1 / 16, height_1); -#endif } else { @@ -1001,12 +989,11 @@ static void CreateScaledBitmaps(Bitmap *old_bitmap, int zoom_factor, if (zoom_factor != 8) FreeBitmap(tmp_bitmap_8); -#if MORE_ZOOM if (zoom_factor != 16) FreeBitmap(tmp_bitmap_16); + if (zoom_factor != 32) FreeBitmap(tmp_bitmap_32); -#endif } /* replace image with extended image (containing 1/1, 1/2, 1/4, 1/8 size) */ @@ -1024,7 +1011,7 @@ static void CreateScaledBitmaps(Bitmap *old_bitmap, int zoom_factor, old_bitmap->height = new_bitmap->height; #if 1 - /* !!! THIS URGENTLY NEEDS OPTIMIZATION -- DO NOT CREATE MASKS BEFORE !!! */ + /* this replaces all blit masks created when loading -- maybe optimize this */ { #if defined(TARGET_X11) if (old_bitmap->clip_mask) diff --git a/src/main.h b/src/main.h index 61932a5d..76304e2a 100644 --- a/src/main.h +++ b/src/main.h @@ -1948,7 +1948,7 @@ #define PROGRAM_VERSION_MAJOR 3 #define PROGRAM_VERSION_MINOR 2 #define PROGRAM_VERSION_PATCH 4 -#define PROGRAM_VERSION_BUILD 1 +#define PROGRAM_VERSION_BUILD 2 #define PROGRAM_TITLE_STRING "Rocks'n'Diamonds" #define PROGRAM_AUTHOR_STRING "Holger Schemel" @@ -2338,8 +2338,10 @@ struct GlobalInfo /* global values for fading screens and masking borders */ int border_status; +#if 0 int fading_status; int fading_type; +#endif }; struct ElementChangeInfo diff --git a/src/screens.c b/src/screens.c index 4289203c..4989985a 100644 --- a/src/screens.c +++ b/src/screens.c @@ -1529,7 +1529,9 @@ void DrawMainMenuExt(int redraw_mask, boolean do_fading) MapTapeButtons(); MapScreenMenuGadgets(SCREEN_MASK_MAIN); +#if 0 DrawMaskedBorder(REDRAW_ALL); +#endif #if 1 if (redraw_mask == REDRAW_ALL) @@ -6065,21 +6067,6 @@ void HandleGameActions() AutoPlayTape(); /* continue automatically playing next tape */ } -#if 0 -void ChangeGameStatus(int new_game_status) -{ - /* for fading out last screen, use the last game status */ - global.border_status = game_status; - global.fading_status = game_status; - - /* ... */ - - /* for fading in next screen, use the new game status */ - global.border_status = new_game_status; - global.fading_status = new_game_status; -} -#endif - /* ---------- new screen button stuff -------------------------------------- */