+2007-03-21
+ * improved menu fading, adding separate fading definitions for entering
+ and leaving a menu and for fading between menu and "content" screens
+
2007-03-20
* improved menu fading, adding separate fading definitions for fading
between menu screens and fading between menu and "destination" screens
{ ".name", ARG_UNDEFINED, TYPE_STRING },
{ ".scale_up_factor", ARG_UNDEFINED, TYPE_INTEGER },
{ ".clone_from", ARG_UNDEFINED, TYPE_TOKEN },
+ { ".fade_mode", ARG_UNDEFINED, TYPE_INTEGER },
{ ".fade_delay", ARG_UNDEFINED, TYPE_INTEGER },
{ ".post_delay", ARG_UNDEFINED, TYPE_INTEGER },
{ ".auto_delay", ARG_UNDEFINED, TYPE_INTEGER },
/* keyword to start parser: "CONFIG_VARS_START" <-- do not change! */
- { "[title_initial].anim_mode", "fade" },
+ { "[title_initial].fade_mode", "fade" },
{ "[title_initial].fade_delay", "500" },
{ "[title_initial].post_delay", "250" },
{ "[title_initial].auto_delay", "-1" },
- { "[title].anim_mode", "fade" },
+ { "[title].fade_mode", "fade" },
{ "[title].fade_delay", "500" },
{ "[title].post_delay", "250" },
{ "[title].auto_delay", "-1" },
{ "[titlemessage_initial].centered", "false" },
{ "[titlemessage_initial].parse_comments", "false" },
{ "[titlemessage_initial].sort_priority", "0" },
- { "[titlemessage_initial].anim_mode", ARG_DEFAULT },
+ { "[titlemessage_initial].fade_mode", ARG_DEFAULT },
{ "[titlemessage_initial].fade_delay", ARG_DEFAULT },
{ "[titlemessage_initial].post_delay", ARG_DEFAULT },
{ "[titlemessage_initial].auto_delay", ARG_DEFAULT },
{ "[titlemessage].centered", "false" },
{ "[titlemessage].parse_comments", "false" },
{ "[titlemessage].sort_priority", "0" },
- { "[titlemessage].anim_mode", ARG_DEFAULT },
+ { "[titlemessage].fade_mode", ARG_DEFAULT },
{ "[titlemessage].fade_delay", ARG_DEFAULT },
{ "[titlemessage].post_delay", ARG_DEFAULT },
{ "[titlemessage].auto_delay", ARG_DEFAULT },
{ "titlemessage_initial_1.centered", ARG_DEFAULT },
{ "titlemessage_initial_1.parse_comments", ARG_DEFAULT },
{ "titlemessage_initial_1.sort_priority", ARG_DEFAULT },
- { "titlemessage_initial_1.anim_mode", ARG_DEFAULT },
+ { "titlemessage_initial_1.fade_mode", ARG_DEFAULT },
{ "titlemessage_initial_1.fade_delay", ARG_DEFAULT },
{ "titlemessage_initial_1.post_delay", ARG_DEFAULT },
{ "titlemessage_initial_1.auto_delay", ARG_DEFAULT },
{ "titlemessage_initial_2.centered", ARG_DEFAULT },
{ "titlemessage_initial_2.parse_comments", ARG_DEFAULT },
{ "titlemessage_initial_2.sort_priority", ARG_DEFAULT },
- { "titlemessage_initial_2.anim_mode", ARG_DEFAULT },
+ { "titlemessage_initial_2.fade_mode", ARG_DEFAULT },
{ "titlemessage_initial_2.fade_delay", ARG_DEFAULT },
{ "titlemessage_initial_2.post_delay", ARG_DEFAULT },
{ "titlemessage_initial_2.auto_delay", ARG_DEFAULT },
{ "titlemessage_initial_3.centered", ARG_DEFAULT },
{ "titlemessage_initial_3.parse_comments", ARG_DEFAULT },
{ "titlemessage_initial_3.sort_priority", ARG_DEFAULT },
- { "titlemessage_initial_3.anim_mode", ARG_DEFAULT },
+ { "titlemessage_initial_3.fade_mode", ARG_DEFAULT },
{ "titlemessage_initial_3.fade_delay", ARG_DEFAULT },
{ "titlemessage_initial_3.post_delay", ARG_DEFAULT },
{ "titlemessage_initial_3.auto_delay", ARG_DEFAULT },
{ "titlemessage_initial_4.centered", ARG_DEFAULT },
{ "titlemessage_initial_4.parse_comments", ARG_DEFAULT },
{ "titlemessage_initial_4.sort_priority", ARG_DEFAULT },
- { "titlemessage_initial_4.anim_mode", ARG_DEFAULT },
+ { "titlemessage_initial_4.fade_mode", ARG_DEFAULT },
{ "titlemessage_initial_4.fade_delay", ARG_DEFAULT },
{ "titlemessage_initial_4.post_delay", ARG_DEFAULT },
{ "titlemessage_initial_4.auto_delay", ARG_DEFAULT },
{ "titlemessage_initial_5.centered", ARG_DEFAULT },
{ "titlemessage_initial_5.parse_comments", ARG_DEFAULT },
{ "titlemessage_initial_5.sort_priority", ARG_DEFAULT },
- { "titlemessage_initial_5.anim_mode", ARG_DEFAULT },
+ { "titlemessage_initial_5.fade_mode", ARG_DEFAULT },
{ "titlemessage_initial_5.fade_delay", ARG_DEFAULT },
{ "titlemessage_initial_5.post_delay", ARG_DEFAULT },
{ "titlemessage_initial_5.auto_delay", ARG_DEFAULT },
{ "titlemessage_1.centered", ARG_DEFAULT },
{ "titlemessage_1.parse_comments", ARG_DEFAULT },
{ "titlemessage_1.sort_priority", ARG_DEFAULT },
- { "titlemessage_1.anim_mode", ARG_DEFAULT },
+ { "titlemessage_1.fade_mode", ARG_DEFAULT },
{ "titlemessage_1.fade_delay", ARG_DEFAULT },
{ "titlemessage_1.post_delay", ARG_DEFAULT },
{ "titlemessage_1.auto_delay", ARG_DEFAULT },
{ "titlemessage_2.centered", ARG_DEFAULT },
{ "titlemessage_2.parse_comments", ARG_DEFAULT },
{ "titlemessage_2.sort_priority", ARG_DEFAULT },
- { "titlemessage_2.anim_mode", ARG_DEFAULT },
+ { "titlemessage_2.fade_mode", ARG_DEFAULT },
{ "titlemessage_2.fade_delay", ARG_DEFAULT },
{ "titlemessage_2.post_delay", ARG_DEFAULT },
{ "titlemessage_2.auto_delay", ARG_DEFAULT },
{ "titlemessage_3.centered", ARG_DEFAULT },
{ "titlemessage_3.parse_comments", ARG_DEFAULT },
{ "titlemessage_3.sort_priority", ARG_DEFAULT },
- { "titlemessage_3.anim_mode", ARG_DEFAULT },
+ { "titlemessage_3.fade_mode", ARG_DEFAULT },
{ "titlemessage_3.fade_delay", ARG_DEFAULT },
{ "titlemessage_3.post_delay", ARG_DEFAULT },
{ "titlemessage_3.auto_delay", ARG_DEFAULT },
{ "titlemessage_4.centered", ARG_DEFAULT },
{ "titlemessage_4.parse_comments", ARG_DEFAULT },
{ "titlemessage_4.sort_priority", ARG_DEFAULT },
- { "titlemessage_4.anim_mode", ARG_DEFAULT },
+ { "titlemessage_4.fade_mode", ARG_DEFAULT },
{ "titlemessage_4.fade_delay", ARG_DEFAULT },
{ "titlemessage_4.post_delay", ARG_DEFAULT },
{ "titlemessage_4.auto_delay", ARG_DEFAULT },
{ "titlemessage_5.centered", ARG_DEFAULT },
{ "titlemessage_5.parse_comments", ARG_DEFAULT },
{ "titlemessage_5.sort_priority", ARG_DEFAULT },
- { "titlemessage_5.anim_mode", ARG_DEFAULT },
+ { "titlemessage_5.fade_mode", ARG_DEFAULT },
{ "titlemessage_5.fade_delay", ARG_DEFAULT },
{ "titlemessage_5.post_delay", ARG_DEFAULT },
{ "titlemessage_5.auto_delay", ARG_DEFAULT },
{ "border.draw_masked.PLAYING", "false" },
{ "border.draw_masked.DOOR", "false" },
- { "menu.navigation.anim_mode", "none" },
- { "menu.navigation.fade_delay", "250" },
- { "menu.navigation.post_delay", "125" },
- { "menu.destination.anim_mode", "fade" },
- { "menu.destination.fade_delay", "250" },
- { "menu.destination.post_delay", "125" },
+ { "menu.enter_menu.fade_mode", "none" },
+ { "menu.enter_menu.fade_delay", "250" },
+ { "menu.enter_menu.post_delay", "125" },
+ { "menu.leave_menu.fade_mode", "none" },
+ { "menu.leave_menu.fade_delay", "250" },
+ { "menu.leave_menu.post_delay", "125" },
+ { "menu.start_item.fade_mode", "fade" },
+ { "menu.start_item.fade_delay", "250" },
+ { "menu.start_item.post_delay", "125" },
{ "menu.draw_xoffset", "0" },
{ "menu.draw_yoffset", "0" },
struct TokenIntPtrInfo image_config_vars[] =
{
{
- "[title_initial].anim_mode",
- &title_initial_default.anim_mode
+ "[title_initial].fade_mode",
+ &title_initial_default.fade_mode
},
{
"[title_initial].fade_delay",
&title_initial_default.auto_delay
},
{
- "[title].anim_mode",
- &title_default.anim_mode
+ "[title].fade_mode",
+ &title_default.fade_mode
},
{
"[title].fade_delay",
&titlemessage_initial_default.sort_priority
},
{
- "[titlemessage_initial].anim_mode",
- &titlemessage_initial_default.anim_mode
+ "[titlemessage_initial].fade_mode",
+ &titlemessage_initial_default.fade_mode
},
{
"[titlemessage_initial].fade_delay",
&titlemessage_default.sort_priority
},
{
- "[titlemessage].anim_mode",
- &titlemessage_default.anim_mode
+ "[titlemessage].fade_mode",
+ &titlemessage_default.fade_mode
},
{
"[titlemessage].fade_delay",
&titlemessage_initial[0].sort_priority
},
{
- "titlemessage_initial_1.anim_mode",
- &titlemessage_initial[0].anim_mode
+ "titlemessage_initial_1.fade_mode",
+ &titlemessage_initial[0].fade_mode
},
{
"titlemessage_initial_1.fade_delay",
&titlemessage_initial[1].sort_priority
},
{
- "titlemessage_initial_2.anim_mode",
- &titlemessage_initial[1].anim_mode
+ "titlemessage_initial_2.fade_mode",
+ &titlemessage_initial[1].fade_mode
},
{
"titlemessage_initial_2.fade_delay",
&titlemessage_initial[2].sort_priority
},
{
- "titlemessage_initial_3.anim_mode",
- &titlemessage_initial[2].anim_mode
+ "titlemessage_initial_3.fade_mode",
+ &titlemessage_initial[2].fade_mode
},
{
"titlemessage_initial_3.fade_delay",
&titlemessage_initial[3].sort_priority
},
{
- "titlemessage_initial_4.anim_mode",
- &titlemessage_initial[3].anim_mode
+ "titlemessage_initial_4.fade_mode",
+ &titlemessage_initial[3].fade_mode
},
{
"titlemessage_initial_4.fade_delay",
&titlemessage_initial[4].sort_priority
},
{
- "titlemessage_initial_5.anim_mode",
- &titlemessage_initial[4].anim_mode
+ "titlemessage_initial_5.fade_mode",
+ &titlemessage_initial[4].fade_mode
},
{
"titlemessage_initial_5.fade_delay",
&titlemessage[0].sort_priority
},
{
- "titlemessage_1.anim_mode",
- &titlemessage[0].anim_mode
+ "titlemessage_1.fade_mode",
+ &titlemessage[0].fade_mode
},
{
"titlemessage_1.fade_delay",
&titlemessage[1].sort_priority
},
{
- "titlemessage_2.anim_mode",
- &titlemessage[1].anim_mode
+ "titlemessage_2.fade_mode",
+ &titlemessage[1].fade_mode
},
{
"titlemessage_2.fade_delay",
&titlemessage[2].sort_priority
},
{
- "titlemessage_3.anim_mode",
- &titlemessage[2].anim_mode
+ "titlemessage_3.fade_mode",
+ &titlemessage[2].fade_mode
},
{
"titlemessage_3.fade_delay",
&titlemessage[3].sort_priority
},
{
- "titlemessage_4.anim_mode",
- &titlemessage[3].anim_mode
+ "titlemessage_4.fade_mode",
+ &titlemessage[3].fade_mode
},
{
"titlemessage_4.fade_delay",
&titlemessage[4].sort_priority
},
{
- "titlemessage_5.anim_mode",
- &titlemessage[4].anim_mode
+ "titlemessage_5.fade_mode",
+ &titlemessage[4].fade_mode
},
{
"titlemessage_5.fade_delay",
&border.draw_masked[GFX_SPECIAL_ARG_DOOR]
},
{
- "menu.navigation.anim_mode",
- &menu.navigation.anim_mode
+ "menu.enter_menu.fade_mode",
+ &menu.enter_menu.fade_mode
},
{
- "menu.navigation.fade_delay",
- &menu.navigation.fade_delay
+ "menu.enter_menu.fade_delay",
+ &menu.enter_menu.fade_delay
},
{
- "menu.navigation.post_delay",
- &menu.navigation.post_delay
+ "menu.enter_menu.post_delay",
+ &menu.enter_menu.post_delay
},
{
- "menu.destination.anim_mode",
- &menu.destination.anim_mode
+ "menu.leave_menu.fade_mode",
+ &menu.leave_menu.fade_mode
},
{
- "menu.destination.fade_delay",
- &menu.destination.fade_delay
+ "menu.leave_menu.fade_delay",
+ &menu.leave_menu.fade_delay
},
{
- "menu.destination.post_delay",
- &menu.destination.post_delay
+ "menu.leave_menu.post_delay",
+ &menu.leave_menu.post_delay
+ },
+ {
+ "menu.start_item.fade_mode",
+ &menu.start_item.fade_mode
+ },
+ {
+ "menu.start_item.fade_delay",
+ &menu.start_item.fade_delay
+ },
+ {
+ "menu.start_item.post_delay",
+ &menu.start_item.post_delay
},
{
"menu.draw_xoffset",
-#define COMPILE_DATE_STRING "2007-03-20 21:54"
+#define COMPILE_DATE_STRING "2007-03-21 20:42"
#endif
MapControlButtons();
-#if 0
- fading = menu.navigation;
-#endif
-
#if 1
- if (fading.anim_mode == ANIM_CROSSFADE)
- FadeCrossSaveBackbuffer();
- else
- FadeOut(REDRAW_FIELD);
+ FadeOut(REDRAW_FIELD);
#endif
DrawEditModeWindow();
#if 1
- if (fading.anim_mode == ANIM_CROSSFADE)
- FadeCross(REDRAW_FIELD);
- else
- FadeIn(REDRAW_FIELD);
+ FadeIn(REDRAW_FIELD);
#endif
/* copy actual editor door content to door double buffer for OpenDoor() */
CloseDoor(DOOR_CLOSE_1);
SetDoorState(DOOR_CLOSE_2);
+#if 1
+ if (quick_quit)
+ FadeSkipNextFadeIn();
+#else
if (quick_quit)
fading = fading_none;
+#endif
game_status = GAME_MODE_MAIN;
#if 1
break;
case KSYM_Escape:
+ FadeSkipNextFadeIn();
+
if (game_status == GAME_MODE_TITLE)
HandleTitleScreen(0, 0, 0, 0, MB_MENU_LEAVE);
else if (game_status == GAME_MODE_LEVELS)
{ TYPE_BOOLEAN, &tmi.centered, ".centered" },
{ TYPE_BOOLEAN, &tmi.parse_comments, ".parse_comments" },
{ TYPE_INTEGER, &tmi.sort_priority, ".sort_priority" },
- { TYPE_INTEGER, &tmi.anim_mode, ".anim_mode" },
+ { TYPE_INTEGER, &tmi.fade_mode, ".fade_mode" },
{ TYPE_INTEGER, &tmi.fade_delay, ".fade_delay" },
{ TYPE_INTEGER, &tmi.post_delay, ".post_delay" },
{ TYPE_INTEGER, &tmi.auto_delay, ".auto_delay" },
}
/* special case: initialize with default values that may be overwritten */
- /* (e.g., init "titlemessage_1.anim_mode" from "[titlemessage].anim_mode") */
+ /* (e.g., init "titlemessage_1.fade_mode" from "[titlemessage].fade_mode") */
for (i = 0; titlemessage_arrays[i].array != NULL; i++)
{
struct TitleMessageInfo *array = titlemessage_arrays[i].array;
/* the following initializes hierarchical values from static configuration */
/* special case: initialize "ARG_DEFAULT" values in static default config */
- /* (e.g., initialize "[titlemessage].anim_mode" from "[title].anim_mode") */
- titlemessage_initial_default.anim_mode = title_initial_default.anim_mode;
+ /* (e.g., initialize "[titlemessage].fade_mode" from "[title].fade_mode") */
+ titlemessage_initial_default.fade_mode = title_initial_default.fade_mode;
titlemessage_initial_default.fade_delay = title_initial_default.fade_delay;
titlemessage_initial_default.post_delay = title_initial_default.post_delay;
titlemessage_initial_default.auto_delay = title_initial_default.auto_delay;
- titlemessage_default.anim_mode = title_default.anim_mode;
+ titlemessage_default.fade_mode = title_default.fade_mode;
titlemessage_default.fade_delay = title_default.fade_delay;
titlemessage_default.post_delay = title_default.post_delay;
titlemessage_default.auto_delay = title_default.auto_delay;
/* special case: initialize "ARG_DEFAULT" values in static default config */
- /* (e.g., init "titlemessage_1.anim_mode" from "[titlemessage].anim_mode") */
+ /* (e.g., init "titlemessage_1.fade_mode" from "[titlemessage].fade_mode") */
for (i = 0; i < MAX_NUM_TITLE_MESSAGES; i++)
{
titlemessage_initial[i] = titlemessage_initial_default;
boolean emulate_bd = TRUE; /* unless non-BOULDERDASH elements found */
boolean emulate_sb = TRUE; /* unless non-SOKOBAN elements found */
boolean emulate_sp = TRUE; /* unless non-SUPAPLEX elements found */
+#if 0
boolean do_fading = (game_status == GAME_MODE_MAIN);
+#endif
int i, j, x, y;
game_status = GAME_MODE_PLAYING;
if (!game.restart_level)
CloseDoor(DOOR_CLOSE_1);
+#if 1
+ if (level_editor_test_game)
+ FadeSkipNextFadeIn();
+ else
+ FadeSetStartItem();
+#else
if (level_editor_test_game)
fading = fading_none;
else
fading = menu.destination;
+#endif
#if 1
- if (fading.anim_mode == ANIM_CROSSFADE)
- FadeCrossSaveBackbuffer();
- else
- FadeOut(REDRAW_FIELD);
+ FadeOut(REDRAW_FIELD);
#else
if (do_fading)
FadeOut(REDRAW_FIELD);
/* !!! FIX THIS (END) !!! */
#if 1
- if (fading.anim_mode == ANIM_CROSSFADE)
- FadeCross(redraw_mask);
- else
- FadeIn(redraw_mask);
+ FadeIn(REDRAW_FIELD);
#else
if (do_fading)
FadeIn(REDRAW_FIELD);
if (!local_player->LevelSolved_SaveScore)
{
#if 1
- if (fading.anim_mode == ANIM_CROSSFADE)
- FadeCrossSaveBackbuffer();
- else
- FadeOut(REDRAW_FIELD);
-#else
FadeOut(REDRAW_FIELD);
#endif
else
{
#if 1
- if (fading.anim_mode == ANIM_CROSSFADE)
- FadeCrossSaveBackbuffer();
- else
- FadeOut(REDRAW_FIELD);
-#else
FadeOut(REDRAW_FIELD);
#endif
if (quick_quit)
{
#if 1
+
+#if 1
+ FadeSkipNextFadeIn();
+#else
fading = fading_none;
+#endif
+
#else
OpenDoor(DOOR_CLOSE_1);
#endif
else
{
#if 0
-#if 1
- if (fading.anim_mode == ANIM_CROSSFADE)
- FadeCrossSaveBackbuffer();
- else
- FadeOut(REDRAW_FIELD);
-#else
FadeOut(REDRAW_FIELD);
-#endif
#endif
game_status = GAME_MODE_MAIN;
graphic_info[graphic].anim_delay_random = 0;
graphic_info[graphic].post_delay_fixed = 0;
graphic_info[graphic].post_delay_random = 0;
+ graphic_info[graphic].fade_mode = FADE_MODE_DEFAULT;
graphic_info[graphic].fade_delay = -1;
graphic_info[graphic].post_delay = -1;
graphic_info[graphic].auto_delay = -1;
if (parameter[GFX_ARG_CLONE_FROM] != ARG_UNDEFINED_VALUE)
graphic_info[graphic].clone_from = parameter[GFX_ARG_CLONE_FROM];
- /* optional settings for drawing title screens */
+ /* optional settings for drawing title screens and title messages */
+ if (parameter[GFX_ARG_FADE_MODE] != ARG_UNDEFINED_VALUE)
+ graphic_info[graphic].fade_mode = parameter[GFX_ARG_FADE_MODE];
if (parameter[GFX_ARG_FADE_DELAY] != ARG_UNDEFINED_VALUE)
graphic_info[graphic].fade_delay = parameter[GFX_ARG_FADE_DELAY];
if (parameter[GFX_ARG_POST_DELAY] != ARG_UNDEFINED_VALUE)
SetDoorState(DOOR_OPEN_ALL);
CloseDoor(DOOR_CLOSE_ALL | DOOR_NO_DELAY);
+#if 1
+#if 1
+ FadeSetStartItem();
+ // FadeSkipNextFadeOut();
+ // FadeSetDisabled();
+#else
+ FadeSkipNext();
+#endif
+#else
fading = fading_none;
+#endif
}
}
return;
}
+#if 1
+ FadeSetStartItem();
+ FadeSkipNextFadeOut();
+ // FadeSetDisabled();
+#else
fading = fading_none;
+#endif
game_status = GAME_MODE_MAIN;
string_has_parameter(value, "horizontal") ? ANIM_HORIZONTAL :
string_has_parameter(value, "vertical") ? ANIM_VERTICAL :
string_has_parameter(value, "centered") ? ANIM_CENTERED :
- string_has_parameter(value, "fade") ? ANIM_FADE :
- string_has_parameter(value, "crossfade") ? ANIM_CROSSFADE :
ANIM_DEFAULT);
if (string_has_parameter(value, "reverse"))
if (string_has_parameter(value, "static_panel"))
result |= ANIM_STATIC_PANEL;
}
+ else if (strEqual(suffix, ".fade_mode"))
+ {
+ result = (string_has_parameter(value, "none") ? FADE_MODE_NONE :
+ string_has_parameter(value, "fade") ? FADE_MODE_FADE :
+ string_has_parameter(value, "crossfade") ? FADE_MODE_CROSSFADE :
+ FADE_MODE_DEFAULT);
+ }
else if (strEqual(suffix, ".font"))
{
result = gfx.get_font_from_token_function(value);
#define ANIM_VERTICAL (1 << 11)
#define ANIM_CENTERED (1 << 12)
#define ANIM_STATIC_PANEL (1 << 13)
-#define ANIM_FADE (1 << 14)
-#define ANIM_CROSSFADE (1 << 15)
#define ANIM_DEFAULT ANIM_LOOP
+/* values for fade mode */
+#define FADE_TYPE_NONE 0
+#define FADE_TYPE_FADE_IN (1 << 0)
+#define FADE_TYPE_FADE_OUT (1 << 1)
+#define FADE_TYPE_CROSS (1 << 2)
+#define FADE_TYPE_SKIP (1 << 3)
+
+#define FADE_MODE_NONE (FADE_TYPE_NONE)
+#define FADE_MODE_FADE_IN (FADE_TYPE_FADE_IN)
+#define FADE_MODE_FADE_OUT (FADE_TYPE_FADE_OUT)
+#define FADE_MODE_FADE (FADE_TYPE_FADE_IN | FADE_TYPE_FADE_OUT)
+#define FADE_MODE_CROSSFADE (FADE_TYPE_FADE_IN | FADE_TYPE_CROSS)
+#define FADE_MODE_SKIP_FADE_IN (FADE_TYPE_SKIP | FADE_TYPE_FADE_IN)
+#define FADE_MODE_SKIP_FADE_OUT (FADE_TYPE_SKIP | FADE_TYPE_FADE_OUT)
+
+#define FADE_MODE_DEFAULT FADE_MODE_FADE
+
/* values for text alignment */
#define ALIGN_LEFT (1 << 0)
#define ALIGN_RIGHT (1 << 1)
#define REDRAW_FPS (1 << 11)
#define REDRAWTILES_THRESHOLD (SCR_FIELDX * SCR_FIELDY / 2)
-#define FADE_MODE_FADE_IN 0
-#define FADE_MODE_FADE_OUT 1
-#define FADE_MODE_CROSSFADE 2
-
#define IN_GFX_SCREEN(x, y) (x >= gfx.sx && x < gfx.sx + gfx.sxsize && \
y >= gfx.sy && y < gfx.sy + gfx.sysize)
#define IN_GFX_DOOR(x, y) (x >= gfx.dx && x < gfx.dx + gfx.dxsize && \
{ NULL, 0 }
};
-struct TitleFadingInfo fading_none =
-{
- ANIM_NONE,
- 0,
- 0,
- 0
-};
-
/* ========================================================================= */
/* main() */
#define GFX_ARG_NAME 36
#define GFX_ARG_SCALE_UP_FACTOR 37
#define GFX_ARG_CLONE_FROM 38
-#define GFX_ARG_FADE_DELAY 39
-#define GFX_ARG_POST_DELAY 40
-#define GFX_ARG_AUTO_DELAY 41
-#define GFX_ARG_ALIGN 42
-#define GFX_ARG_VALIGN 43
-#define GFX_ARG_SORT_PRIORITY 44
+#define GFX_ARG_FADE_MODE 39
+#define GFX_ARG_FADE_DELAY 40
+#define GFX_ARG_POST_DELAY 41
+#define GFX_ARG_AUTO_DELAY 42
+#define GFX_ARG_ALIGN 43
+#define GFX_ARG_VALIGN 44
+#define GFX_ARG_SORT_PRIORITY 45
-#define NUM_GFX_ARGS 45
+#define NUM_GFX_ARGS 46
/* values for sound configuration suffixes */
struct TitleFadingInfo
{
- int anim_mode;
+ int fade_mode;
int fade_delay;
int post_delay;
int auto_delay;
boolean parse_comments;
int sort_priority;
- int anim_mode;
+ int fade_mode;
int fade_delay;
int post_delay;
int auto_delay;
int list_size[NUM_SPECIAL_GFX_ARGS];
- struct TitleFadingInfo navigation;
- struct TitleFadingInfo destination;
+ struct TitleFadingInfo enter_menu;
+ struct TitleFadingInfo leave_menu;
+ struct TitleFadingInfo start_item;
int sound[NUM_SPECIAL_GFX_ARGS];
int music[NUM_SPECIAL_GFX_ARGS];
int draw_masked; /* optional setting for drawing envelope gfx */
+ int fade_mode; /* optional setting for drawing title screens */
int fade_delay; /* optional setting for drawing title screens */
int post_delay; /* optional setting for drawing title screens */
int auto_delay; /* optional setting for drawing title screens */
{ -1, NULL },
};
-#define XFADE 1
-
#define DRAW_MODE(s) ((s) >= GAME_MODE_MAIN && \
(s) <= GAME_MODE_SETUP ? (s) : \
(s) == GAME_MODE_PSEUDO_TYPENAME ? \
ti = (initial ? title_initial_default : title_default);
/* override default settings with image config settings, if defined */
- if (graphic_info[graphic].anim_mode != ANIM_DEFAULT)
- ti.anim_mode = graphic_info[graphic].anim_mode;
+ if (graphic_info[graphic].fade_mode != FADE_MODE_DEFAULT)
+ ti.fade_mode = graphic_info[graphic].fade_mode;
if (graphic_info[graphic].fade_delay > -1)
ti.fade_delay = graphic_info[graphic].fade_delay;
if (graphic_info[graphic].post_delay > -1)
{
if (initial)
{
- ti.anim_mode = titlemessage_initial[nr].anim_mode;
+ ti.fade_mode = titlemessage_initial[nr].fade_mode;
ti.fade_delay = titlemessage_initial[nr].fade_delay;
ti.post_delay = titlemessage_initial[nr].post_delay;
ti.auto_delay = titlemessage_initial[nr].auto_delay;
}
else
{
- ti.anim_mode = titlemessage[nr].anim_mode;
+ ti.fade_mode = titlemessage[nr].fade_mode;
ti.fade_delay = titlemessage[nr].fade_delay;
ti.post_delay = titlemessage[nr].post_delay;
ti.auto_delay = titlemessage[nr].auto_delay;
#endif
#if 1
-#if XFADE
- if (fading.anim_mode == ANIM_CROSSFADE)
- FadeCrossSaveBackbuffer();
- else
- FadeOut(redraw_mask);
-#endif
+ FadeOut(redraw_mask);
#endif
UnmapAllGadgets();
SetMainBackgroundImage(IMG_BACKGROUND_MAIN);
#if 0
-#if XFADE
- if (fading.anim_mode == ANIM_CROSSFADE)
- FadeCrossSaveBackbuffer();
- else
- FadeOut(redraw_mask);
-#endif
+ FadeOut(redraw_mask);
#endif
#if 1
if (redraw_mask == REDRAW_ALL)
{
+#if 0
int door_state = GetDoorState();
+#endif
RedrawBackground();
}
#endif
-#if XFADE
- if (fading.anim_mode == ANIM_CROSSFADE)
- FadeCross(redraw_mask);
- else
- FadeIn(redraw_mask);
+#if 1
+ FadeIn(redraw_mask);
#else
#if 1
if (!do_fading)
#endif
#if 1
- fading = menu.navigation;
+ FadeSetEnterMenu();
#else
fading = title_default;
#endif
#endif
#endif
struct TitleControlInfo *tci;
+ struct TitleFadingInfo fading_last = fading;
struct TitleFadingInfo fading_next;
int sound, music;
if (button == MB_MENU_INITIALIZE)
{
-#if 1
+#if 0
boolean use_cross_fading = (fading.anim_mode == ANIM_CROSSFADE);
#endif
FadeSoundsAndMusic();
#if 1
- if (use_cross_fading)
- FadeCrossSaveBackbuffer();
- else
- FadeOut(REDRAW_ALL);
-#else
FadeOut(REDRAW_ALL);
#endif
}
else
DrawTitleScreenMessage(tci->local_nr, tci->initial);
- fading = getTitleFading(tci);
+ fading = fading_next = getTitleFading(tci);
+
+ if (fading_last.fade_mode != FADE_MODE_CROSSFADE &&
+ fading_next.fade_mode == FADE_MODE_CROSSFADE)
+ fading.fade_mode = FADE_MODE_FADE;
#if 1
sound = getTitleSound(tci);
SetMouseCursor(CURSOR_NONE);
#if 1
- if (use_cross_fading)
- FadeCross(REDRAW_ALL);
- else
- FadeIn(REDRAW_ALL);
-#else
FadeIn(REDRAW_ALL);
#endif
+ fading = fading_next;
+
DelayReached(&title_delay, 0); /* reset delay counter */
return;
}
else if (button == MB_MENU_CHOICE)
{
-#if 1
+#if 0
boolean use_cross_fading = (fading.anim_mode == ANIM_CROSSFADE);
#endif
if (game_status == GAME_MODE_INFO && num_title_screens == 0)
{
#if 0
-#if XFADE
- if (fading.anim_mode == ANIM_CROSSFADE)
- FadeCrossSaveBackbuffer();
- else
- FadeOut(REDRAW_FIELD);
-#else
FadeOut(REDRAW_FIELD);
-#endif
#endif
- fading = menu.destination;
+ FadeSetStartItem();
info_mode = INFO_MODE_MAIN;
DrawAndFadeInInfoScreen(REDRAW_FIELD);
if (music == MUS_UNDEFINED || music != last_music)
FadeMusic();
- if (use_cross_fading)
- FadeCrossSaveBackbuffer();
- else
- FadeOut(REDRAW_ALL);
+#if 1
+ FadeOut(REDRAW_ALL);
+#endif
if (tci->is_image)
DrawTitleScreenImage(tci->local_nr, tci->initial);
last_music = music;
#endif
+#if 0
+ printf("::: %d -> %d\n", fading.fade_mode, fading_next.fade_mode);
+#endif
+
/* last screen already faded out, next screen has no animation */
- if (!use_cross_fading && fading_next.anim_mode == ANIM_NONE)
+ if (fading.fade_mode != FADE_MODE_CROSSFADE &&
+ fading_next.fade_mode == FADE_MODE_NONE)
fading = fading_next;
- if (use_cross_fading)
- FadeCross(REDRAW_ALL);
- else
- FadeIn(REDRAW_ALL);
+#if 1
+ FadeIn(REDRAW_ALL);
+#endif
fading = fading_next;
boolean use_cross_fading = (fading.anim_mode == ANIM_CROSSFADE);
#endif
- if (use_cross_fading)
- FadeCrossSaveBackbuffer();
- else
- FadeOut(REDRAW_ALL);
+#if 1
+ FadeOut(REDRAW_ALL);
+#endif
}
#else
FadeOut(REDRAW_ALL);
game_status = GAME_MODE_EDITOR;
- fading = menu.destination;
+ FadeSetStartItem();
DrawLevelEd();
}
game_status = GAME_MODE_INFO;
info_mode = INFO_MODE_MAIN;
+#if 0
fading = menu.navigation;
+#endif
DrawInfoScreen();
}
static void execInfoTitleScreen()
{
- fading = menu.destination;
+#if 0
+ FadeSetStartItem();
+#endif
info_mode = INFO_MODE_TITLE;
DrawInfoScreen();
static void execInfoElements()
{
- fading = menu.destination;
+#if 0
+ FadeSetStartItem();
+#endif
info_mode = INFO_MODE_ELEMENTS;
DrawInfoScreen();
static void execInfoMusic()
{
- fading = menu.destination;
+#if 0
+ FadeSetStartItem();
+#endif
info_mode = INFO_MODE_MUSIC;
DrawInfoScreen();
static void execInfoCredits()
{
- fading = menu.destination;
+#if 0
+ FadeSetStartItem();
+#endif
info_mode = INFO_MODE_CREDITS;
DrawInfoScreen();
static void execInfoProgram()
{
- fading = menu.destination;
+#if 0
+ FadeSetStartItem();
+#endif
info_mode = INFO_MODE_PROGRAM;
DrawInfoScreen();
static void execInfoVersion()
{
- fading = menu.destination;
+#if 0
+ FadeSetStartItem();
+#endif
info_mode = INFO_MODE_VERSION;
DrawInfoScreen();
static void execInfoLevelSet()
{
- fading = menu.destination;
+#if 0
+ FadeSetStartItem();
+#endif
info_mode = INFO_MODE_LEVELSET;
DrawInfoScreen();
static void execExitInfo()
{
- fading = menu.navigation;
+#if 0
+ FadeSetLeaveMenu();
+#endif
game_status = GAME_MODE_MAIN;
#if 1
UnmapAllGadgets();
CloseDoor(DOOR_CLOSE_2);
-#if XFADE
- if (fading.anim_mode == ANIM_CROSSFADE)
- FadeCrossSaveBackbuffer();
- else
- FadeOut(redraw_mask);
+#if 1
+ FadeOut(redraw_mask);
#endif
#if 1
PlayMenuSound();
PlayMenuMusic();
- DrawMaskedBorder(REDRAW_ALL);
+ DrawMaskedBorder(redraw_mask);
-#if XFADE
- if (fading.anim_mode == ANIM_CROSSFADE)
- FadeCross(redraw_mask);
- else
- FadeIn(redraw_mask);
+#if 1
+ FadeIn(redraw_mask);
#else
#if 1
if (!do_fading)
{
void (*menu_callback_function)(void) = info_info[y].value;
+ FadeSetLeaveMenu();
+
menu_callback_function();
break; /* absolutely needed because function changes 'info_info'! */
{
void (*menu_callback_function)(void) = info_info[choice].value;
+ FadeSetFromType(info_info[y].type);
+
menu_callback_function();
}
}
SetMainBackgroundImageIfDefined(IMG_BACKGROUND_INFO_LEVELSET);
-#if XFADE
- if (fading.anim_mode == ANIM_CROSSFADE)
- FadeCrossSaveBackbuffer();
- else
- FadeOut(REDRAW_FIELD);
-#else
+#if 1
FadeOut(REDRAW_FIELD);
#endif
DrawTextSCentered(ybottom, FONT_TEXT_4,
"Press any key or button for info menu");
-#if XFADE
- if (fading.anim_mode == ANIM_CROSSFADE)
- FadeCross(REDRAW_FIELD);
- else
- FadeIn(REDRAW_FIELD);
-#else
+#if 1
FadeIn(REDRAW_FIELD);
#endif
}
{
SetMainBackgroundImageIfDefined(IMG_BACKGROUND_INFO_ELEMENTS);
-#if XFADE
- if (fading.anim_mode == ANIM_CROSSFADE)
- FadeCrossSaveBackbuffer();
- else
- FadeOut(REDRAW_FIELD);
-#else
+#if 1
FadeOut(REDRAW_FIELD);
#endif
HandleInfoScreen_Elements(MB_MENU_INITIALIZE);
-#if XFADE
- if (fading.anim_mode == ANIM_CROSSFADE)
- FadeCross(REDRAW_FIELD);
- else
- FadeIn(REDRAW_FIELD);
-#else
+#if 1
FadeIn(REDRAW_FIELD);
#endif
FadeSoundsAndMusic();
#if 0
-#if XFADE
- if (fading.anim_mode == ANIM_CROSSFADE)
- FadeCrossSaveBackbuffer();
- else
- FadeOut(REDRAW_FIELD);
-#else
FadeOut(REDRAW_FIELD);
-#endif
#endif
info_mode = INFO_MODE_MAIN;
{
SetMainBackgroundImageIfDefined(IMG_BACKGROUND_INFO_MUSIC);
-#if XFADE
- if (fading.anim_mode == ANIM_CROSSFADE)
- FadeCrossSaveBackbuffer();
- else
- FadeOut(REDRAW_FIELD);
-#else
+#if 1
FadeOut(REDRAW_FIELD);
#endif
HandleInfoScreen_Music(MB_MENU_INITIALIZE);
-#if XFADE
- if (fading.anim_mode == ANIM_CROSSFADE)
- FadeCross(REDRAW_FIELD);
- else
- FadeIn(REDRAW_FIELD);
-#else
+#if 1
FadeIn(REDRAW_FIELD);
#endif
}
FadeSoundsAndMusic();
#if 0
-#if XFADE
- if (fading.anim_mode == ANIM_CROSSFADE)
- FadeCrossSaveBackbuffer();
- else
- FadeOut(REDRAW_FIELD);
-#else
FadeOut(REDRAW_FIELD);
-#endif
#endif
info_mode = INFO_MODE_MAIN;
FadeSoundsAndMusic();
-#if XFADE
- if (fading.anim_mode == ANIM_CROSSFADE)
- FadeCrossSaveBackbuffer();
- else
- FadeOut(REDRAW_FIELD);
-#else
+#if 1
FadeOut(REDRAW_FIELD);
#endif
HandleInfoScreen_Credits(MB_MENU_INITIALIZE);
-#if XFADE
- if (fading.anim_mode == ANIM_CROSSFADE)
- FadeCross(REDRAW_FIELD);
- else
- FadeIn(REDRAW_FIELD);
-#else
+#if 1
FadeIn(REDRAW_FIELD);
#endif
}
FadeSoundsAndMusic();
#if 0
-#if XFADE
- if (fading.anim_mode == ANIM_CROSSFADE)
- FadeCrossSaveBackbuffer();
- else
- FadeOut(REDRAW_FIELD);
-#else
FadeOut(REDRAW_FIELD);
-#endif
#endif
info_mode = INFO_MODE_MAIN;
SetMainBackgroundImageIfDefined(IMG_BACKGROUND_INFO_PROGRAM);
-#if XFADE
- if (fading.anim_mode == ANIM_CROSSFADE)
- FadeCrossSaveBackbuffer();
- else
- FadeOut(REDRAW_FIELD);
-#else
+#if 1
FadeOut(REDRAW_FIELD);
#endif
DrawTextSCentered(ybottom, FONT_TEXT_4,
"Press any key or button for info menu");
-#if XFADE
- if (fading.anim_mode == ANIM_CROSSFADE)
- FadeCross(REDRAW_FIELD);
- else
- FadeIn(REDRAW_FIELD);
-#else
+#if 1
FadeIn(REDRAW_FIELD);
#endif
}
FadeSoundsAndMusic();
#if 0
-#if XFADE
- if (fading.anim_mode == ANIM_CROSSFADE)
- FadeCrossSaveBackbuffer();
- else
- FadeOut(REDRAW_FIELD);
-#else
FadeOut(REDRAW_FIELD);
-#endif
#endif
info_mode = INFO_MODE_MAIN;
SetMainBackgroundImageIfDefined(IMG_BACKGROUND_INFO_VERSION);
-#if XFADE
- if (fading.anim_mode == ANIM_CROSSFADE)
- FadeCrossSaveBackbuffer();
- else
- FadeOut(REDRAW_FIELD);
-#else
+#if 1
FadeOut(REDRAW_FIELD);
#endif
DrawTextSCentered(ybottom, FONT_TEXT_4,
"Press any key or button for info menu");
-#if XFADE
- if (fading.anim_mode == ANIM_CROSSFADE)
- FadeCross(REDRAW_FIELD);
- else
- FadeIn(REDRAW_FIELD);
-#else
+#if 1
FadeIn(REDRAW_FIELD);
#endif
}
FadeSoundsAndMusic();
#if 0
-#if XFADE
- if (fading.anim_mode == ANIM_CROSSFADE)
- FadeCrossSaveBackbuffer();
- else
- FadeOut(REDRAW_FIELD);
-#else
FadeOut(REDRAW_FIELD);
-#endif
#endif
info_mode = INFO_MODE_MAIN;
SetMainBackgroundImageIfDefined(IMG_BACKGROUND_INFO_LEVELSET);
-#if XFADE
- if (fading.anim_mode == ANIM_CROSSFADE)
- FadeCrossSaveBackbuffer();
- else
- FadeOut(REDRAW_FIELD);
-#else
+#if 1
FadeOut(REDRAW_FIELD);
#endif
DrawTextCentered(mSY + SYSIZE - 20, FONT_TEXT_4,
"Press any key or button for info menu");
-#if XFADE
- if (fading.anim_mode == ANIM_CROSSFADE)
- FadeCross(REDRAW_FIELD);
- else
- FadeIn(REDRAW_FIELD);
-#else
+#if 1
FadeIn(REDRAW_FIELD);
#endif
}
FadeSoundsAndMusic();
#if 0
-#if XFADE
- if (fading.anim_mode == ANIM_CROSSFADE)
- FadeCrossSaveBackbuffer();
- else
- FadeOut(REDRAW_FIELD);
-#else
FadeOut(REDRAW_FIELD);
-#endif
#endif
info_mode = INFO_MODE_MAIN;
void DrawInfoScreen()
{
- DrawInfoScreenExt(REDRAW_ALL, FALSE);
+ DrawInfoScreenExt(REDRAW_FIELD, FALSE);
}
void HandleInfoScreen(int mx, int my, int dx, int dy, int button)
CloseDoor(DOOR_CLOSE_2);
-#if XFADE
- if (fading.anim_mode == ANIM_CROSSFADE)
- FadeCrossSaveBackbuffer();
- else
- FadeOut(REDRAW_FIELD);
+#if 1
+ FadeOut(REDRAW_FIELD);
#endif
ClearWindow();
HandleChooseTree(0, 0, 0, 0, MB_MENU_INITIALIZE, ti_ptr);
MapScreenTreeGadgets(*ti_ptr);
-#if XFADE
- if (fading.anim_mode == ANIM_CROSSFADE)
- FadeCross(redraw_mask);
- else
- FadeIn(redraw_mask);
-#else
- FadeToFront();
+#if 1
+ FadeIn(REDRAW_FIELD);
#endif
InitAnimation();
}
else if (button == MB_MENU_LEAVE)
{
+ FadeSetLeaveMenu();
+
PlaySound(SND_MENU_ITEM_SELECTING);
if (ti->node_parent)
if (node_cursor->node_group)
{
+ FadeSetEnterMenu();
+
PlaySound(SND_MENU_ITEM_SELECTING);
node_cursor->cl_first = ti->cl_first;
}
else if (dx == -1 && ti->node_parent)
{
+ FadeSetLeaveMenu();
+
PlaySound(SND_MENU_ITEM_SELECTING);
*ti_ptr = ti->node_parent;
if (node_cursor->node_group)
{
+ FadeSetEnterMenu();
+
node_cursor->cl_first = ti->cl_first;
node_cursor->cl_cursor = ti->cl_cursor;
*ti_ptr = node_cursor->node_group;
}
else if (node_cursor->parent_link)
{
+ FadeSetLeaveMenu();
+
*ti_ptr = node_cursor->node_parent;
DrawChooseTree(ti_ptr);
}
else
{
+ FadeSetStartItem();
+
node_cursor->cl_first = ti->cl_first;
node_cursor->cl_cursor = ti->cl_cursor;
*ti_ptr = node_cursor;
if (highlight_position < 0)
LoadScore(level_nr);
- fading = menu.destination;
+ FadeSetStartItem();
-#if XFADE
- if (fading.anim_mode == ANIM_CROSSFADE)
- FadeCrossSaveBackbuffer();
- else
- FadeOut(REDRAW_FIELD);
-#else
+#if 1
FadeOut(REDRAW_FIELD);
#endif
HandleHallOfFame(highlight_position, 0, 0, 0, MB_MENU_INITIALIZE);
-#if XFADE
- if (fading.anim_mode == ANIM_CROSSFADE)
- FadeCross(REDRAW_FIELD);
- else
- FadeIn(REDRAW_FIELD);
-#else
+#if 1
FadeIn(REDRAW_FIELD);
#endif
}
FadeSound(SND_BACKGROUND_SCORES);
#if 0
-#if XFADE
- if (fading.anim_mode == ANIM_CROSSFADE)
- FadeCrossSaveBackbuffer();
- else
- FadeOut(REDRAW_FIELD);
-#else
FadeOut(REDRAW_FIELD);
-#endif
#endif
game_status = GAME_MODE_MAIN;
static void execSetupMain()
{
+#if 0
+ FadeSetLeaveMenu();
+#endif
+
setup_mode = SETUP_MODE_MAIN;
DrawSetupScreen();
}
static void execSetupGame()
{
+#if 0
+ FadeSetEnterMenu();
+#endif
+
if (game_speeds == NULL)
{
int i;
static void execSetupChooseGameSpeed()
{
+#if 0
+ FadeSetEnterMenu();
+#endif
+
setup_mode = SETUP_MODE_CHOOSE_GAME_SPEED;
DrawSetupScreen();
}
static void execSetupEditor()
{
+#if 0
+ FadeSetEnterMenu();
+#endif
+
setup_mode = SETUP_MODE_EDITOR;
DrawSetupScreen();
}
static void execSetupGraphics()
{
+#if 0
+ FadeSetEnterMenu();
+#endif
+
if (video.fullscreen_available && screen_modes == NULL)
{
int i;
static void execSetupChooseScreenMode()
{
+#if 0
+ FadeSetEnterMenu();
+#endif
+
if (!video.fullscreen_available)
return;
static void execSetupSound()
{
+#if 0
+ FadeSetEnterMenu();
+#endif
+
setup_mode = SETUP_MODE_SOUND;
DrawSetupScreen();
}
static void execSetupArtwork()
{
+#if 0
+ FadeSetEnterMenu();
+#endif
+
setup.graphics_set = artwork.gfx_current->identifier;
setup.sounds_set = artwork.snd_current->identifier;
setup.music_set = artwork.mus_current->identifier;
static void execSetupChooseGraphics()
{
+#if 0
+ FadeSetEnterMenu();
+#endif
+
setup_mode = SETUP_MODE_CHOOSE_GRAPHICS;
DrawSetupScreen();
}
static void execSetupChooseSounds()
{
+#if 0
+ FadeSetEnterMenu();
+#endif
+
setup_mode = SETUP_MODE_CHOOSE_SOUNDS;
DrawSetupScreen();
}
static void execSetupChooseMusic()
{
+#if 0
+ FadeSetEnterMenu();
+#endif
+
setup_mode = SETUP_MODE_CHOOSE_MUSIC;
DrawSetupScreen();
}
static void execSetupInput()
{
+#if 0
+ FadeSetEnterMenu();
+#endif
+
setup_mode = SETUP_MODE_INPUT;
DrawSetupScreen();
}
static void execSetupShortcut1()
{
+#if 0
+ FadeSetEnterMenu();
+#endif
+
setup_mode = SETUP_MODE_SHORTCUT_1;
DrawSetupScreen();
}
static void execSetupShortcut2()
{
+#if 0
+ FadeSetEnterMenu();
+#endif
+
setup_mode = SETUP_MODE_SHORTCUT_2;
DrawSetupScreen();
}
static void execExitSetup()
{
+#if 0
+ FadeSetLeaveMenu();
+#endif
+
game_status = GAME_MODE_MAIN;
#if 1
DrawMainMenuExt(REDRAW_FIELD, FALSE);
UnmapAllGadgets();
CloseDoor(DOOR_CLOSE_2);
-#if XFADE
- if (fading.anim_mode == ANIM_CROSSFADE)
- FadeCrossSaveBackbuffer();
- else
- FadeOut(REDRAW_FIELD);
+#if 1
+ FadeOut(REDRAW_FIELD);
#endif
ClearWindow();
HandleSetupScreen_Generic(0, 0, 0, 0, MB_MENU_INITIALIZE);
#endif
-#if XFADE
- if (fading.anim_mode == ANIM_CROSSFADE)
- FadeCross(redraw_mask);
- else
- FadeIn(redraw_mask);
-#else
- FadeToFront();
+#if 1
+ FadeIn(REDRAW_FIELD);
#endif
InitAnimation();
{
void (*menu_callback_function)(void) = setup_info[y].value;
+ FadeSetLeaveMenu();
+
menu_callback_function();
break; /* absolutely needed because function changes 'setup_info'! */
{
void (*menu_callback_function)(void) = setup_info[y].value;
+ FadeSetFromType(setup_info[y].type);
+
menu_callback_function();
}
else
int i;
#endif
-#if XFADE
- if (fading.anim_mode == ANIM_CROSSFADE)
- FadeCrossSaveBackbuffer();
- else
- FadeOut(REDRAW_FIELD);
+#if 1
+ FadeOut(REDRAW_FIELD);
#endif
ClearWindow();
HandleSetupScreen_Input(0, 0, 0, 0, MB_MENU_INITIALIZE);
-#if XFADE
- if (fading.anim_mode == ANIM_CROSSFADE)
- FadeCross(redraw_mask);
- else
- FadeIn(redraw_mask);
-#else
- FadeToFront();
+#if 1
+ FadeIn(REDRAW_FIELD);
#endif
InitAnimation();
{
InitJoysticks();
+ FadeSetLeaveMenu();
+
setup_mode = SETUP_MODE_MAIN;
DrawSetupScreen();
}
/* read existing key bindings from player setup */
custom_key = setup.input[player_nr].key;
+ FadeSetEnterMenu();
+ FadeOut(REDRAW_FIELD);
+
ClearWindow();
DrawTextSCentered(mSY - SY + 16, FONT_TITLE_1, "Keyboard Input");
+#if 0
BackToFront();
InitAnimation();
+#endif
step_nr = 0;
DrawText(mSX, mSY + (2 + 2 * step_nr) * 32,
DrawText(mSX + 4 * 32, mSY + (2 + 2 * step_nr + 1) * 32,
getKeyNameFromKey(*customize_step[step_nr].key), FONT_VALUE_OLD);
+#if 1
+ FadeIn(REDRAW_FIELD);
+
+ InitAnimation();
+#endif
+
while (!finished)
{
if (PendingEvent()) /* got event */
if (key == KSYM_Escape || (key == KSYM_Return && step_nr == 6))
{
+ if (key == KSYM_Escape)
+ FadeSkipNextFadeIn();
+
finished = TRUE;
break;
}
if (joystick_fd < 0 || !setup.input[player_nr].use_joystick)
return FALSE;
+ FadeSetEnterMenu();
+ FadeOut(REDRAW_FIELD);
+
ClearWindow();
for (y = 0; y < 3; y++)
new_joystick_ymiddle = joy_y;
DrawGraphic(xpos + last_x, ypos + last_y, IMG_MENU_CALIBRATE_RED, 0);
+
+#if 1
+ FadeIn(REDRAW_FIELD);
+#else
BackToFront();
+#endif
while (Joystick(player_nr) & JOY_BUTTON); /* wait for released button */
InitAnimation();
break;
case KSYM_Escape:
+ FadeSkipNextFadeIn();
result = 0;
break;
void FadeExt(int fade_mask, int fade_mode)
{
+ static int fade_mode_skip = FADE_MODE_NONE;
void (*draw_border_function)(void) = NULL;
Bitmap *bitmap = (fade_mode == FADE_MODE_CROSSFADE ? bitmap_db_cross : NULL);
int x, y, width, height;
int fade_delay, post_delay;
+ redraw_mask |= fade_mask;
+
+ if (fade_mode & FADE_TYPE_SKIP)
+ {
+ fade_mode_skip = fade_mode;
+
+ return;
+ }
+
+ if (fade_mode_skip & FADE_TYPE_SKIP)
+ {
+#if 0
+ printf("::: skipping %d ... [%d]\n", fade_mode, fade_mode_skip);
+#endif
+
+ /* skip all fade operations until specified fade operation */
+ if (fade_mode & fade_mode_skip)
+ fade_mode_skip = FADE_MODE_NONE;
+
+ return;
+ }
+
+#if 1
+ if (fading.fade_mode == FADE_MODE_NONE)
+ return;
+#endif
+
if (fade_mask & REDRAW_FIELD)
{
x = REAL_SX;
post_delay = (fade_mode == FADE_MODE_FADE_OUT ? fading.post_delay : 0);
}
- redraw_mask |= fade_mask;
-
-#if 1
- if (fading.anim_mode == ANIM_NONE)
- return;
-#endif
-
#if 1
if (!setup.fade_screens || fade_delay == 0)
#else
void FadeIn(int fade_mask)
{
+#if 1
+ if (fading.fade_mode == FADE_MODE_CROSSFADE)
+ FadeExt(fade_mask, FADE_MODE_CROSSFADE);
+ else
+ FadeExt(fade_mask, FADE_MODE_FADE_IN);
+#else
FadeExt(fade_mask, FADE_MODE_FADE_IN);
+#endif
}
void FadeOut(int fade_mask)
{
+#if 1
+ if (fading.fade_mode == FADE_MODE_CROSSFADE)
+ FadeCrossSaveBackbuffer();
+ else
+ FadeExt(fade_mask, FADE_MODE_FADE_OUT);
+#else
FadeExt(fade_mask, FADE_MODE_FADE_OUT);
+#endif
}
void FadeCross(int fade_mask)
BlitBitmap(backbuffer, bitmap_db_cross, 0, 0, WIN_XSIZE, WIN_YSIZE, 0, 0);
}
+void FadeSetEnterMenu()
+{
+ fading = menu.enter_menu;
+}
+
+void FadeSetLeaveMenu()
+{
+ fading = menu.leave_menu;
+}
+
+void FadeSetStartItem()
+{
+ fading = menu.start_item;
+}
+
+void FadeSetFromType(int type)
+{
+ if (type & TYPE_ENTER_SCREEN)
+ FadeSetStartItem();
+ else if (type & TYPE_ENTER)
+ FadeSetEnterMenu();
+ else if (type & TYPE_LEAVE)
+ FadeSetLeaveMenu();
+}
+
+void FadeSetDisabled()
+{
+ static struct TitleFadingInfo fading_none = { FADE_MODE_NONE, -1, -1, -1 };
+
+ fading = fading_none;
+}
+
+void FadeSkipNextFadeIn()
+{
+ FadeExt(0, FADE_MODE_SKIP_FADE_IN);
+}
+
+void FadeSkipNextFadeOut()
+{
+ FadeExt(0, FADE_MODE_SKIP_FADE_OUT);
+}
+
void SetWindowBackgroundImageIfDefined(int graphic)
{
if (graphic_info[graphic].bitmap)
void FadeOut(int);
void FadeCross(int);
void FadeCrossSaveBackbuffer();
+void FadeSetEnterMenu();
+void FadeSetLeaveMenu();
+void FadeSetStartItem();
+void FadeSetFromType(int);
+void FadeSetDisabled();
+void FadeSkipNextFadeIn();
+void FadeSkipNextFadeOut();
void ClearWindow();
void SetWindowBackgroundImageIfDefined(int);