2007-03-19
* titlemessage_initial_x and titlemessage_x set to "[DEFAULT]" in static
configuration (set from "[titlemessage_initial]" and "[titlemessage]")
+ * fading settings of "[titlemessage_initial]" and "[titlemessage]" set
+ to "[DEFAULT]" in static configuration (set from "[title_initial]" and
+ "[title]")
+ * improved title fading, allowing fading animation types "none", "fade"
+ and "crossfade" (including cross-fading of last title to main menu)
2007-03-18
* added configurability of graphics, sounds and music for title screens,
/* keyword to start parser: "CONFIG_VARS_START" <-- do not change! */
+ { "[title_initial].anim_mode", "fade" },
+ { "[title_initial].fade_delay", "500" },
+ { "[title_initial].post_delay", "250" },
+ { "[title_initial].auto_delay", "-1" },
+ { "[title].anim_mode", "fade" },
+ { "[title].fade_delay", "500" },
+ { "[title].post_delay", "250" },
+ { "[title].auto_delay", "-1" },
+
{ "[titlemessage_initial].x", "336" },
{ "[titlemessage_initial].y", "280" },
{ "[titlemessage_initial].width", "640" },
{ "[titlemessage_initial].centered", "false" },
{ "[titlemessage_initial].parse_comments", "false" },
{ "[titlemessage_initial].sort_priority", "0" },
+ { "[titlemessage_initial].anim_mode", ARG_DEFAULT },
+ { "[titlemessage_initial].fade_delay", ARG_DEFAULT },
+ { "[titlemessage_initial].post_delay", ARG_DEFAULT },
+ { "[titlemessage_initial].auto_delay", ARG_DEFAULT },
{ "[titlemessage].x", "336" },
{ "[titlemessage].y", "280" },
{ "[titlemessage].width", "640" },
{ "[titlemessage].centered", "false" },
{ "[titlemessage].parse_comments", "false" },
{ "[titlemessage].sort_priority", "0" },
+ { "[titlemessage].anim_mode", ARG_DEFAULT },
+ { "[titlemessage].fade_delay", ARG_DEFAULT },
+ { "[titlemessage].post_delay", ARG_DEFAULT },
+ { "[titlemessage].auto_delay", ARG_DEFAULT },
{ "titlemessage_initial_1.x", ARG_DEFAULT },
{ "titlemessage_initial_1.y", 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_delay", ARG_DEFAULT },
+ { "titlemessage_initial_1.post_delay", ARG_DEFAULT },
+ { "titlemessage_initial_1.auto_delay", ARG_DEFAULT },
{ "titlemessage_initial_2.x", ARG_DEFAULT },
{ "titlemessage_initial_2.y", ARG_DEFAULT },
{ "titlemessage_initial_2.width", 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_delay", ARG_DEFAULT },
+ { "titlemessage_initial_2.post_delay", ARG_DEFAULT },
+ { "titlemessage_initial_2.auto_delay", ARG_DEFAULT },
{ "titlemessage_initial_3.x", ARG_DEFAULT },
{ "titlemessage_initial_3.y", ARG_DEFAULT },
{ "titlemessage_initial_3.width", 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_delay", ARG_DEFAULT },
+ { "titlemessage_initial_3.post_delay", ARG_DEFAULT },
+ { "titlemessage_initial_3.auto_delay", ARG_DEFAULT },
{ "titlemessage_initial_4.x", ARG_DEFAULT },
{ "titlemessage_initial_4.y", ARG_DEFAULT },
{ "titlemessage_initial_4.width", 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_delay", ARG_DEFAULT },
+ { "titlemessage_initial_4.post_delay", ARG_DEFAULT },
+ { "titlemessage_initial_4.auto_delay", ARG_DEFAULT },
{ "titlemessage_initial_5.x", ARG_DEFAULT },
{ "titlemessage_initial_5.y", ARG_DEFAULT },
{ "titlemessage_initial_5.width", 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_delay", ARG_DEFAULT },
+ { "titlemessage_initial_5.post_delay", ARG_DEFAULT },
+ { "titlemessage_initial_5.auto_delay", ARG_DEFAULT },
{ "titlemessage_1.x", ARG_DEFAULT },
{ "titlemessage_1.y", ARG_DEFAULT },
{ "titlemessage_1.width", 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_delay", ARG_DEFAULT },
+ { "titlemessage_1.post_delay", ARG_DEFAULT },
+ { "titlemessage_1.auto_delay", ARG_DEFAULT },
{ "titlemessage_2.x", ARG_DEFAULT },
{ "titlemessage_2.y", ARG_DEFAULT },
{ "titlemessage_2.width", 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_delay", ARG_DEFAULT },
+ { "titlemessage_2.post_delay", ARG_DEFAULT },
+ { "titlemessage_2.auto_delay", ARG_DEFAULT },
{ "titlemessage_3.x", ARG_DEFAULT },
{ "titlemessage_3.y", ARG_DEFAULT },
{ "titlemessage_3.width", 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_delay", ARG_DEFAULT },
+ { "titlemessage_3.post_delay", ARG_DEFAULT },
+ { "titlemessage_3.auto_delay", ARG_DEFAULT },
{ "titlemessage_4.x", ARG_DEFAULT },
{ "titlemessage_4.y", ARG_DEFAULT },
{ "titlemessage_4.width", 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_delay", ARG_DEFAULT },
+ { "titlemessage_4.post_delay", ARG_DEFAULT },
+ { "titlemessage_4.auto_delay", ARG_DEFAULT },
{ "titlemessage_5.x", ARG_DEFAULT },
{ "titlemessage_5.y", ARG_DEFAULT },
{ "titlemessage_5.width", 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_delay", ARG_DEFAULT },
+ { "titlemessage_5.post_delay", ARG_DEFAULT },
+ { "titlemessage_5.auto_delay", ARG_DEFAULT },
{ "readme.x", "272" },
{ "readme.y", "150" },
{ "border.draw_masked.PLAYING", "false" },
{ "border.draw_masked.DOOR", "false" },
- { "title.fade_delay", "500" },
- { "title.post_delay", "250" },
- { "title.auto_delay", "-1" },
+#if 0
+ { "[title].fade_delay", "500" },
+ { "[title].post_delay", "250" },
+ { "[title].auto_delay", "-1" },
+#endif
{ "menu.fade_delay", "250" },
{ "menu.post_delay", "125" },
{ "game.panel.gems.x", "50" },
{ "game.panel.gems.y", "54" },
{ "game.panel.gems.align", "center" },
- { "game.panel.gems.valign", "top" },
+ { "game.panel.gems.valign", "top" },
{ "game.panel.gems.chars", "3" },
{ "game.panel.gems.font", "font.text_2" },
struct TokenIntPtrInfo image_config_vars[] =
{
+ {
+ "[title_initial].anim_mode",
+ &title_initial_default.anim_mode
+ },
+ {
+ "[title_initial].fade_delay",
+ &title_initial_default.fade_delay
+ },
+ {
+ "[title_initial].post_delay",
+ &title_initial_default.post_delay
+ },
+ {
+ "[title_initial].auto_delay",
+ &title_initial_default.auto_delay
+ },
+ {
+ "[title].anim_mode",
+ &title_default.anim_mode
+ },
+ {
+ "[title].fade_delay",
+ &title_default.fade_delay
+ },
+ {
+ "[title].post_delay",
+ &title_default.post_delay
+ },
+ {
+ "[title].auto_delay",
+ &title_default.auto_delay
+ },
{
"[titlemessage_initial].x",
&titlemessage_initial_default.x
"[titlemessage_initial].sort_priority",
&titlemessage_initial_default.sort_priority
},
+ {
+ "[titlemessage_initial].anim_mode",
+ &titlemessage_initial_default.anim_mode
+ },
+ {
+ "[titlemessage_initial].fade_delay",
+ &titlemessage_initial_default.fade_delay
+ },
+ {
+ "[titlemessage_initial].post_delay",
+ &titlemessage_initial_default.post_delay
+ },
+ {
+ "[titlemessage_initial].auto_delay",
+ &titlemessage_initial_default.auto_delay
+ },
{
"[titlemessage].x",
&titlemessage_default.x
"[titlemessage].sort_priority",
&titlemessage_default.sort_priority
},
+ {
+ "[titlemessage].anim_mode",
+ &titlemessage_default.anim_mode
+ },
+ {
+ "[titlemessage].fade_delay",
+ &titlemessage_default.fade_delay
+ },
+ {
+ "[titlemessage].post_delay",
+ &titlemessage_default.post_delay
+ },
+ {
+ "[titlemessage].auto_delay",
+ &titlemessage_default.auto_delay
+ },
{
"titlemessage_initial_1.x",
&titlemessage_initial[0].x
"titlemessage_initial_1.sort_priority",
&titlemessage_initial[0].sort_priority
},
+ {
+ "titlemessage_initial_1.anim_mode",
+ &titlemessage_initial[0].anim_mode
+ },
+ {
+ "titlemessage_initial_1.fade_delay",
+ &titlemessage_initial[0].fade_delay
+ },
+ {
+ "titlemessage_initial_1.post_delay",
+ &titlemessage_initial[0].post_delay
+ },
+ {
+ "titlemessage_initial_1.auto_delay",
+ &titlemessage_initial[0].auto_delay
+ },
{
"titlemessage_initial_2.x",
&titlemessage_initial[1].x
"titlemessage_initial_2.sort_priority",
&titlemessage_initial[1].sort_priority
},
+ {
+ "titlemessage_initial_2.anim_mode",
+ &titlemessage_initial[1].anim_mode
+ },
+ {
+ "titlemessage_initial_2.fade_delay",
+ &titlemessage_initial[1].fade_delay
+ },
+ {
+ "titlemessage_initial_2.post_delay",
+ &titlemessage_initial[1].post_delay
+ },
+ {
+ "titlemessage_initial_2.auto_delay",
+ &titlemessage_initial[1].auto_delay
+ },
{
"titlemessage_initial_3.x",
&titlemessage_initial[2].x
"titlemessage_initial_3.sort_priority",
&titlemessage_initial[2].sort_priority
},
+ {
+ "titlemessage_initial_3.anim_mode",
+ &titlemessage_initial[2].anim_mode
+ },
+ {
+ "titlemessage_initial_3.fade_delay",
+ &titlemessage_initial[2].fade_delay
+ },
+ {
+ "titlemessage_initial_3.post_delay",
+ &titlemessage_initial[2].post_delay
+ },
+ {
+ "titlemessage_initial_3.auto_delay",
+ &titlemessage_initial[2].auto_delay
+ },
{
"titlemessage_initial_4.x",
&titlemessage_initial[3].x
"titlemessage_initial_4.sort_priority",
&titlemessage_initial[3].sort_priority
},
+ {
+ "titlemessage_initial_4.anim_mode",
+ &titlemessage_initial[3].anim_mode
+ },
+ {
+ "titlemessage_initial_4.fade_delay",
+ &titlemessage_initial[3].fade_delay
+ },
+ {
+ "titlemessage_initial_4.post_delay",
+ &titlemessage_initial[3].post_delay
+ },
+ {
+ "titlemessage_initial_4.auto_delay",
+ &titlemessage_initial[3].auto_delay
+ },
{
"titlemessage_initial_5.x",
&titlemessage_initial[4].x
"titlemessage_initial_5.sort_priority",
&titlemessage_initial[4].sort_priority
},
+ {
+ "titlemessage_initial_5.anim_mode",
+ &titlemessage_initial[4].anim_mode
+ },
+ {
+ "titlemessage_initial_5.fade_delay",
+ &titlemessage_initial[4].fade_delay
+ },
+ {
+ "titlemessage_initial_5.post_delay",
+ &titlemessage_initial[4].post_delay
+ },
+ {
+ "titlemessage_initial_5.auto_delay",
+ &titlemessage_initial[4].auto_delay
+ },
{
"titlemessage_1.x",
&titlemessage[0].x
"titlemessage_1.sort_priority",
&titlemessage[0].sort_priority
},
+ {
+ "titlemessage_1.anim_mode",
+ &titlemessage[0].anim_mode
+ },
+ {
+ "titlemessage_1.fade_delay",
+ &titlemessage[0].fade_delay
+ },
+ {
+ "titlemessage_1.post_delay",
+ &titlemessage[0].post_delay
+ },
+ {
+ "titlemessage_1.auto_delay",
+ &titlemessage[0].auto_delay
+ },
{
"titlemessage_2.x",
&titlemessage[1].x
"titlemessage_2.sort_priority",
&titlemessage[1].sort_priority
},
+ {
+ "titlemessage_2.anim_mode",
+ &titlemessage[1].anim_mode
+ },
+ {
+ "titlemessage_2.fade_delay",
+ &titlemessage[1].fade_delay
+ },
+ {
+ "titlemessage_2.post_delay",
+ &titlemessage[1].post_delay
+ },
+ {
+ "titlemessage_2.auto_delay",
+ &titlemessage[1].auto_delay
+ },
{
"titlemessage_3.x",
&titlemessage[2].x
"titlemessage_3.sort_priority",
&titlemessage[2].sort_priority
},
+ {
+ "titlemessage_3.anim_mode",
+ &titlemessage[2].anim_mode
+ },
+ {
+ "titlemessage_3.fade_delay",
+ &titlemessage[2].fade_delay
+ },
+ {
+ "titlemessage_3.post_delay",
+ &titlemessage[2].post_delay
+ },
+ {
+ "titlemessage_3.auto_delay",
+ &titlemessage[2].auto_delay
+ },
{
"titlemessage_4.x",
&titlemessage[3].x
"titlemessage_4.sort_priority",
&titlemessage[3].sort_priority
},
+ {
+ "titlemessage_4.anim_mode",
+ &titlemessage[3].anim_mode
+ },
+ {
+ "titlemessage_4.fade_delay",
+ &titlemessage[3].fade_delay
+ },
+ {
+ "titlemessage_4.post_delay",
+ &titlemessage[3].post_delay
+ },
+ {
+ "titlemessage_4.auto_delay",
+ &titlemessage[3].auto_delay
+ },
{
"titlemessage_5.x",
&titlemessage[4].x
"titlemessage_5.sort_priority",
&titlemessage[4].sort_priority
},
+ {
+ "titlemessage_5.anim_mode",
+ &titlemessage[4].anim_mode
+ },
+ {
+ "titlemessage_5.fade_delay",
+ &titlemessage[4].fade_delay
+ },
+ {
+ "titlemessage_5.post_delay",
+ &titlemessage[4].post_delay
+ },
+ {
+ "titlemessage_5.auto_delay",
+ &titlemessage[4].auto_delay
+ },
{
"readme.x",
&readme.x
&border.draw_masked[GFX_SPECIAL_ARG_DOOR]
},
{
- "title.fade_delay",
- &title.fade_delay
+ "[title].fade_delay",
+ &title_default.fade_delay
},
{
- "title.post_delay",
- &title.post_delay
+ "[title].post_delay",
+ &title_default.post_delay
},
{
- "title.auto_delay",
- &title.auto_delay
+ "[title].auto_delay",
+ &title_default.auto_delay
},
{
"menu.fade_delay",
-#define COMPILE_DATE_STRING "2007-03-19 15:16"
+#define COMPILE_DATE_STRING "2007-03-20 00:07"
{ 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_delay, ".fade_delay" },
+ { TYPE_INTEGER, &tmi.post_delay, ".post_delay" },
+ { TYPE_INTEGER, &tmi.auto_delay, ".auto_delay" },
{ -1, NULL, NULL }
};
if ((setup_file_hash = loadSetupFileHash(filename)) == NULL)
return;
+ /* the following initializes hierarchical values from dynamic configuration */
+
/* special case: initialize with default values that may be overwritten */
+ /* (e.g., init "menu.draw_xoffset.INFO" from "menu.draw_xoffset") */
for (i = 0; i < NUM_SPECIAL_GFX_ARGS; i++)
{
char *value_1 = getHashEntry(setup_file_hash, "menu.draw_xoffset");
}
/* special case: initialize with default values that may be overwritten */
+ /* (eg, init "menu.draw_xoffset.INFO[MUSIC]" from "menu.draw_xoffset.INFO") */
for (i = 0; i < NUM_SPECIAL_GFX_INFO_ARGS; i++)
{
char *value_1 = getHashEntry(setup_file_hash, "menu.draw_xoffset.INFO");
}
/* special case: initialize with default values that may be overwritten */
+ /* (e.g., init "titlemessage_1.anim_mode" from "[titlemessage].anim_mode") */
for (i = 0; titlemessage_arrays[i].array != NULL; i++)
{
struct TitleMessageInfo *array = titlemessage_arrays[i].array;
get_token_parameter_value(image_config_vars[i].token,
image_config[j].value);
- /* special case: initialize with default values that may be overwritten */
+ /* 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;
+ 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_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") */
for (i = 0; i < MAX_NUM_TITLE_MESSAGES; i++)
{
titlemessage_initial[i] = titlemessage_initial_default;
struct GameInfo game;
struct GlobalInfo global;
struct BorderInfo border;
+struct TitleInfo title_initial_default;
+struct TitleInfo title_default;
struct TitleInfo title;
struct TitleMessageInfo titlemessage_initial_default;
struct TitleMessageInfo titlemessage_initial[MAX_NUM_TITLE_MESSAGES];
struct TitleInfo
{
+ int anim_mode;
int fade_delay;
int post_delay;
int auto_delay;
-
- int fade_delay_final;
- int post_delay_final;
- int auto_delay_final;
};
struct TitleMessageInfo
boolean centered;
boolean parse_comments;
int sort_priority;
+
+ int anim_mode;
+ int fade_delay;
+ int post_delay;
+ int auto_delay;
};
struct MenuInfo
extern struct TapeInfo tape;
extern struct GlobalInfo global;
extern struct BorderInfo border;
+extern struct TitleInfo title_initial_default;
+extern struct TitleInfo title_default;
extern struct TitleInfo title;
extern struct TitleMessageInfo titlemessage_initial_default;
extern struct TitleMessageInfo titlemessage_initial[];
struct TitleControlInfo title_controls[MAX_NUM_TITLE_SCREENS];
-
/* main menu display and control definitions */
#define MAIN_CONTROL_NAME 0
return IMG_UNDEFINED;
}
-static int getTitleSound(int nr, boolean initial, boolean is_image)
+static int getTitleSound(struct TitleControlInfo *tci)
{
+ boolean is_image = tci->is_image;
+ int initial = tci->initial;
+ int nr = tci->local_nr;
int mode = (initial ? GAME_MODE_TITLE_INITIAL : GAME_MODE_TITLE);
int base = (is_image ?
(initial ? SND_BACKGROUND_TITLESCREEN_INITIAL_1 :
return SND_UNDEFINED;
}
-static int getTitleMusic(int nr, boolean initial, boolean is_image)
+static int getTitleMusic(struct TitleControlInfo *tci)
{
+ boolean is_image = tci->is_image;
+ int initial = tci->initial;
+ int nr = tci->local_nr;
int mode = (initial ? GAME_MODE_TITLE_INITIAL : GAME_MODE_TITLE);
int base = (is_image ?
(initial ? MUS_BACKGROUND_TITLESCREEN_INITIAL_1 :
return MUS_UNDEFINED;
}
+static struct TitleInfo getTitleFading(struct TitleControlInfo *tci)
+{
+ boolean is_image = tci->is_image;
+ int initial = tci->initial;
+ int nr = tci->local_nr;
+ struct TitleInfo ti;
+
+ if (is_image)
+ {
+ int graphic = getTitleScreenGraphic(nr, initial);
+
+ /* initialize fading control values to default title config settings */
+ 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_delay > -1)
+ ti.fade_delay = graphic_info[graphic].fade_delay;
+ if (graphic_info[graphic].post_delay > -1)
+ ti.post_delay = graphic_info[graphic].post_delay;
+ if (graphic_info[graphic].auto_delay > -1)
+ ti.auto_delay = graphic_info[graphic].auto_delay;
+ }
+ else
+ {
+ if (initial)
+ {
+ ti.anim_mode = titlemessage_initial[nr].anim_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_delay = titlemessage[nr].fade_delay;
+ ti.post_delay = titlemessage[nr].post_delay;
+ ti.auto_delay = titlemessage[nr].auto_delay;
+ }
+ }
+
+ if (ti.anim_mode == ANIM_NONE)
+ ti.fade_delay = ti.post_delay = 0;
+
+ return ti;
+}
+
static int compareTitleControlInfo(const void *object1, const void *object2)
{
const struct TitleControlInfo *tci1 = (struct TitleControlInfo *)object1;
redraw_mask = REDRAW_ALL;
/* reset fading control values to default config settings */
+#if 1
+
+#if 0
+ title = getTitleFading(nr, initial, TRUE);
+#endif
+
+#else
+
title.fade_delay_final = title.fade_delay;
title.post_delay_final = title.post_delay;
title.auto_delay_final = title.auto_delay;
/* override default settings with image config settings, if defined */
+ if (graphic_info[graphic].anim_mode != ANIM_DEFAULT)
+ title.anim_mode = graphic_info[graphic].anim_mode;
if (graphic_info[graphic].fade_delay > -1)
- title.fade_delay_final = graphic_info[graphic].fade_delay;
+ title.fade_delay = graphic_info[graphic].fade_delay;
if (graphic_info[graphic].post_delay > -1)
- title.post_delay_final = graphic_info[graphic].post_delay;
+ title.post_delay = graphic_info[graphic].post_delay;
if (graphic_info[graphic].auto_delay > -1)
- title.auto_delay_final = graphic_info[graphic].auto_delay;
+ title.auto_delay = graphic_info[graphic].auto_delay;
+#endif
}
void DrawTitleScreenMessage(int nr, boolean initial)
int i;
#endif
+#if 0
+ /* !!! CHANGE THIS !!! */
+ title = title_default;
+#endif
+
UnmapAllGadgets();
FadeSoundsAndMusic();
SetDrawtoField(DRAW_BACKBUFFER);
#endif
+#if 1
+ if (levelset_has_changed)
+ title = title_default;
+#endif
+
#if 1
if (CheckTitleScreen(levelset_has_changed))
{
DrawMaskedBorder(REDRAW_ALL);
+#if 1
+ if (!do_fading)
+ BackToFront();
+ else if (title.anim_mode == ANIM_CROSSFADE)
+ FadeCross(redraw_mask);
+ else
+ FadeIn(redraw_mask);
+#else
if (do_fading)
FadeIn(redraw_mask);
else
BackToFront();
+#endif
+
+#if 1
+ title = title_default;
+#endif
SetMouseCursor(CURSOR_DEFAULT);
}
#endif
-#if 1
void HandleTitleScreen(int mx, int my, int dx, int dy, int button)
{
static unsigned long title_delay = 0;
static int last_sound = -1, last_music = -1;
boolean return_to_main_menu = FALSE;
boolean use_fading_main_menu = TRUE;
+#if 0
#if 1
boolean use_cross_fading = FALSE;
#else
boolean use_cross_fading = !show_title_initial; /* default */
+#endif
#endif
struct TitleControlInfo *tci;
+ struct TitleInfo title_fading_next;
int sound, music;
if (button == MB_MENU_INITIALIZE)
DrawInfoScreen_NotAvailable("Title screen information:",
"No title screen for this level set.");
- title.auto_delay_final = -1;
+ /* use default settings for fading, but always disable auto delay */
+ title = title_default;
+ title.auto_delay = -1;
return;
}
}
if (tci->is_image)
- {
DrawTitleScreenImage(tci->local_nr, tci->initial);
- }
else
- {
DrawTitleScreenMessage(tci->local_nr, tci->initial);
- title.fade_delay_final = title.fade_delay;
- title.post_delay_final = title.post_delay;
- title.auto_delay_final = -1;
- }
+ title = getTitleFading(tci);
#if 1
- sound = getTitleSound(tci->local_nr, tci->initial, tci->is_image);
- music = getTitleMusic(tci->local_nr, tci->initial, tci->is_image);
+ sound = getTitleSound(tci);
+ music = getTitleMusic(tci);
if (sound != last_sound)
PlayMenuSoundExt(sound);
return;
}
- if (title.auto_delay_final > -1 &&
- DelayReached(&title_delay, title.auto_delay_final))
+ if (title.auto_delay > -1 && DelayReached(&title_delay, title.auto_delay))
button = MB_MENU_CHOICE;
if (button == MB_MENU_LEAVE)
}
else if (button == MB_MENU_CHOICE)
{
- int anim_mode;
+#if 1
+ boolean use_cross_fading = (title.anim_mode == ANIM_CROSSFADE);
+#endif
if (game_status == GAME_MODE_INFO && num_title_screens == 0)
{
title_screen_nr++;
tci = &title_controls[title_screen_nr];
- if (tci->is_image)
- anim_mode =
- graphic_info[getTitleScreenGraphic(tci->local_nr,
- tci->initial)].anim_mode;
- else
- anim_mode = ANIM_FADE; /* ??? */
-
- use_cross_fading = (anim_mode == ANIM_FADE ? FALSE :
- anim_mode == ANIM_CROSSFADE ? TRUE :
- use_cross_fading);
-
if (title_screen_nr < num_title_screens)
{
- sound = getTitleSound(tci->local_nr, tci->initial, tci->is_image);
- music = getTitleMusic(tci->local_nr, tci->initial, tci->is_image);
+#if 1
+#if 0
+ boolean use_cross_fading = (title.anim_mode == ANIM_CROSSFADE);
+#endif
+#else
+ int anim_mode;
+
+ if (tci->is_image)
+ anim_mode =
+ graphic_info[getTitleScreenGraphic(tci->local_nr,
+ tci->initial)].anim_mode;
+ else
+ anim_mode = ANIM_FADE; /* ??? */
+
+ use_cross_fading = (anim_mode == ANIM_FADE ? FALSE :
+ anim_mode == ANIM_CROSSFADE ? TRUE :
+ use_cross_fading);
+#endif
+
+ sound = getTitleSound(tci);
+ music = getTitleMusic(tci);
if (sound == SND_UNDEFINED || sound != last_sound)
FadeSounds();
else
DrawTitleScreenMessage(tci->local_nr, tci->initial);
+ title_fading_next = getTitleFading(tci);
+
#if 1
- sound = getTitleSound(tci->local_nr, tci->initial, tci->is_image);
- music = getTitleMusic(tci->local_nr, tci->initial, tci->is_image);
+ sound = getTitleSound(tci);
+ music = getTitleMusic(tci);
if (sound != last_sound)
PlayMenuSoundExt(sound);
last_music = music;
#endif
+ /* last screen already faded out, next screen has no animation */
+ if (!use_cross_fading && title_fading_next.anim_mode == ANIM_NONE)
+ title = title_fading_next;
+
if (use_cross_fading)
FadeCross(REDRAW_ALL);
else
FadeIn(REDRAW_ALL);
+ title = title_fading_next;
+
DelayReached(&title_delay, 0); /* reset delay counter */
}
else
{
FadeSoundsAndMusic();
- FadeOut(REDRAW_ALL);
-
- return_to_main_menu = TRUE;
- }
- }
-
- if (return_to_main_menu)
- {
- RedrawBackground();
-
- SetMouseCursor(CURSOR_DEFAULT);
-
- if (game_status == GAME_MODE_INFO)
- {
- OpenDoor(DOOR_CLOSE_1 | DOOR_CLOSE_2 | DOOR_NO_DELAY | DOOR_FORCE_REDRAW);
-
- info_mode = INFO_MODE_MAIN;
- DrawInfoScreenExt(REDRAW_ALL, use_fading_main_menu);
- }
- else /* default: return to main menu */
- {
- OpenDoor(DOOR_CLOSE_1 | DOOR_OPEN_2 | DOOR_NO_DELAY | DOOR_FORCE_REDRAW);
-
- game_status = GAME_MODE_MAIN;
- DrawMainMenuExt(REDRAW_ALL, use_fading_main_menu);
- }
- }
-}
-
-#else
-
-void HandleTitleScreen(int mx, int my, int dx, int dy, int button)
-{
- static unsigned long title_delay = 0;
- static int title_nr = 0;
- static boolean showing_message = FALSE;
- char *filename = getLevelSetMessageFilename();
- boolean return_to_main_menu = FALSE;
- boolean use_fading_main_menu = TRUE;
- boolean use_cross_fading = !show_title_initial; /* default */
- boolean no_title_info = (graphic_info[IMG_TITLESCREEN_1].bitmap == NULL &&
- getLevelSetMessageFilename(1, FALSE) == NULL);
-
- if (button == MB_MENU_INITIALIZE)
- {
- int last_game_status = game_status; /* save current game status */
-
- title_delay = 0;
- title_nr = 0;
- showing_message = FALSE;
-
- if (show_title_initial &&
- graphic_info[IMG_TITLESCREEN_INITIAL_1].bitmap == NULL &&
- getLevelSetMessageFilename(1, TRUE) == NULL)
- show_title_initial = FALSE;
-
- if (game_status == GAME_MODE_INFO)
- {
- if (no_title_info)
+#if 1
{
- DrawInfoScreen_NotAvailable("Title screen information:",
- "No title screen for this level set.");
-
- title.auto_delay_final = -1;
+#if 0
+ boolean use_cross_fading = (title.anim_mode == ANIM_CROSSFADE);
+#endif
- return;
+ if (use_cross_fading)
+ FadeCrossSaveBackbuffer();
+ else
+ FadeOut(REDRAW_ALL);
}
-
- FadeSoundsAndMusic();
-
- FadeOut(REDRAW_ALL);
- }
-
- /* force TITLE music on title info screen */
- game_status = GAME_MODE_TITLE;
-
- PlayMenuSound();
- PlayMenuMusic();
-
- game_status = last_game_status; /* restore current game status */
-
- if (graphic_info[getTitleScreenGraphic(0, show_title_initial)].bitmap != NULL)
- {
- DrawTitleScreenImage(title_nr, show_title_initial);
- }
- else
- {
- DrawTitleScreenMessage(filename);
-
- showing_message = TRUE;
-
- title.fade_delay_final = title.fade_delay;
- title.post_delay_final = title.post_delay;
- title.auto_delay_final = -1;
- }
-
- FadeIn(REDRAW_ALL);
-
- DelayReached(&title_delay, 0); /* reset delay counter */
-
- return;
- }
-
- if (title.auto_delay_final > -1 &&
- DelayReached(&title_delay, title.auto_delay_final))
- button = MB_MENU_CHOICE;
-
- if (button == MB_MENU_LEAVE)
- {
- return_to_main_menu = TRUE;
- use_fading_main_menu = FALSE;
- }
- else if (button == MB_MENU_CHOICE)
- {
- int anim_mode;
-
- if (game_status == GAME_MODE_INFO && no_title_info)
- {
- FadeOut(REDRAW_FIELD);
-
- info_mode = INFO_MODE_MAIN;
- DrawAndFadeInInfoScreen(REDRAW_FIELD);
-
- return;
- }
-
- title_nr++;
-
- if (show_title_initial &&
- (title_nr >= MAX_NUM_TITLE_IMAGES ||
- graphic_info[IMG_TITLESCREEN_INITIAL_1 + title_nr].bitmap == NULL))
- {
- show_title_initial = FALSE;
-
- title_nr = 0; /* restart with title screens for current level set */
- }
-
- anim_mode = graphic_info[getTitleScreenGraphic(title_nr, show_title_initial)].anim_mode;
-
- use_cross_fading = (anim_mode == ANIM_FADE ? FALSE :
- anim_mode == ANIM_CROSSFADE ? TRUE :
- use_cross_fading);
-
- if (!use_cross_fading)
- FadeOut(REDRAW_ALL);
-
- if (title_nr < MAX_NUM_TITLE_IMAGES &&
- graphic_info[getTitleScreenGraphic(title_nr, show_title_initial)].bitmap != NULL)
- {
- if (use_cross_fading)
- FadeCrossSaveBackbuffer();
-
- DrawTitleScreenImage(title_nr, show_title_initial);
-
- if (use_cross_fading)
- FadeCross(REDRAW_ALL);
- else
- FadeIn(REDRAW_ALL);
-
- DelayReached(&title_delay, 0); /* reset delay counter */
- }
- else if (!showing_message && filename != NULL)
- {
- if (use_cross_fading)
- FadeCrossSaveBackbuffer();
-
- DrawTitleScreenMessage(filename);
-
- if (use_cross_fading)
- FadeCross(REDRAW_ALL);
- else
- FadeIn(REDRAW_ALL);
-
- DelayReached(&title_delay, 0); /* reset delay counter */
-
- showing_message = TRUE;
- }
- else
- {
- FadeSoundsAndMusic();
-
+#else
FadeOut(REDRAW_ALL);
+#endif
return_to_main_menu = TRUE;
}
if (return_to_main_menu)
{
- show_title_initial = FALSE;
-
RedrawBackground();
+ SetMouseCursor(CURSOR_DEFAULT);
+
if (game_status == GAME_MODE_INFO)
{
OpenDoor(DOOR_CLOSE_1 | DOOR_CLOSE_2 | DOOR_NO_DELAY | DOOR_FORCE_REDRAW);
}
}
}
-#endif
void HandleMainMenu_SelectLevel(int step, int direction)
{
DrawMaskedBorder(REDRAW_ALL);
+#if 1
+ if (!do_fading)
+ BackToFront();
+ else if (title.anim_mode == ANIM_CROSSFADE)
+ FadeCross(redraw_mask);
+ else
+ FadeIn(redraw_mask);
+#else
if (do_fading)
FadeIn(redraw_mask);
else
BackToFront();
+#endif
InitAnimation();
}
width = WIN_XSIZE;
height = WIN_YSIZE;
- fade_delay = title.fade_delay_final;
- post_delay = (fade_mode == FADE_MODE_FADE_OUT ? title.post_delay_final : 0);
+ fade_delay = title.fade_delay;
+ post_delay = (fade_mode == FADE_MODE_FADE_OUT ? title.post_delay : 0);
}
redraw_mask |= fade_mask;