+2007-03-31
+ * improved menu fading, adding separate fading definitions for entering
+ and leaving a "content" screen (in general), and optional definitions
+ for the special "content" screens SCORES, EDITOR, INFO and PLAYING
+
2007-03-30
* added (currently invisible) setup option to define scroll delay value
* fixed small bug in priority handling when auto-detecting level start
{ "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.enter_screen.fade_mode", "fade" },
+ { "menu.enter_screen.fade_delay", "250" },
+ { "menu.enter_screen.post_delay", "125" },
+ { "menu.leave_screen.fade_mode", "fade" },
+ { "menu.leave_screen.fade_delay", "250" },
+ { "menu.leave_screen.post_delay", "125" },
+ { "menu.enter_screen.SCORES.fade_mode", ARG_DEFAULT },
+ { "menu.enter_screen.SCORES.fade_delay", ARG_DEFAULT },
+ { "menu.enter_screen.SCORES.post_delay", ARG_DEFAULT },
+ { "menu.enter_screen.EDITOR.fade_mode", ARG_DEFAULT },
+ { "menu.enter_screen.EDITOR.fade_delay", ARG_DEFAULT },
+ { "menu.enter_screen.EDITOR.post_delay", ARG_DEFAULT },
+ { "menu.enter_screen.INFO.fade_mode", ARG_DEFAULT },
+ { "menu.enter_screen.INFO.fade_delay", ARG_DEFAULT },
+ { "menu.enter_screen.INFO.post_delay", ARG_DEFAULT },
+ { "menu.enter_screen.PLAYING.fade_mode", ARG_DEFAULT },
+ { "menu.enter_screen.PLAYING.fade_delay", ARG_DEFAULT },
+ { "menu.enter_screen.PLAYING.post_delay", ARG_DEFAULT },
+ { "menu.leave_screen.SCORES.fade_mode", ARG_DEFAULT },
+ { "menu.leave_screen.SCORES.fade_delay", ARG_DEFAULT },
+ { "menu.leave_screen.SCORES.post_delay", ARG_DEFAULT },
+ { "menu.leave_screen.EDITOR.fade_mode", ARG_DEFAULT },
+ { "menu.leave_screen.EDITOR.fade_delay", ARG_DEFAULT },
+ { "menu.leave_screen.EDITOR.post_delay", ARG_DEFAULT },
+ { "menu.leave_screen.INFO.fade_mode", ARG_DEFAULT },
+ { "menu.leave_screen.INFO.fade_delay", ARG_DEFAULT },
+ { "menu.leave_screen.INFO.post_delay", ARG_DEFAULT },
+ { "menu.leave_screen.PLAYING.fade_mode", ARG_DEFAULT },
+ { "menu.leave_screen.PLAYING.fade_delay", ARG_DEFAULT },
+ { "menu.leave_screen.PLAYING.post_delay", ARG_DEFAULT },
{ "menu.draw_xoffset", "0" },
{ "menu.draw_yoffset", "0" },
&menu.leave_menu.post_delay
},
{
- "menu.start_item.fade_mode",
- &menu.start_item.fade_mode
+ "menu.enter_screen.fade_mode",
+ &menu.enter_screen[GFX_SPECIAL_ARG_DEFAULT].fade_mode
},
{
- "menu.start_item.fade_delay",
- &menu.start_item.fade_delay
+ "menu.enter_screen.fade_delay",
+ &menu.enter_screen[GFX_SPECIAL_ARG_DEFAULT].fade_delay
},
{
- "menu.start_item.post_delay",
- &menu.start_item.post_delay
+ "menu.enter_screen.post_delay",
+ &menu.enter_screen[GFX_SPECIAL_ARG_DEFAULT].post_delay
+ },
+ {
+ "menu.leave_screen.fade_mode",
+ &menu.leave_screen[GFX_SPECIAL_ARG_DEFAULT].fade_mode
+ },
+ {
+ "menu.leave_screen.fade_delay",
+ &menu.leave_screen[GFX_SPECIAL_ARG_DEFAULT].fade_delay
+ },
+ {
+ "menu.leave_screen.post_delay",
+ &menu.leave_screen[GFX_SPECIAL_ARG_DEFAULT].post_delay
+ },
+ {
+ "menu.enter_screen.SCORES.fade_mode",
+ &menu.enter_screen[GFX_SPECIAL_ARG_SCORES].fade_mode
+ },
+ {
+ "menu.enter_screen.SCORES.fade_delay",
+ &menu.enter_screen[GFX_SPECIAL_ARG_SCORES].fade_delay
+ },
+ {
+ "menu.enter_screen.SCORES.post_delay",
+ &menu.enter_screen[GFX_SPECIAL_ARG_SCORES].post_delay
+ },
+ {
+ "menu.enter_screen.EDITOR.fade_mode",
+ &menu.enter_screen[GFX_SPECIAL_ARG_EDITOR].fade_mode
+ },
+ {
+ "menu.enter_screen.EDITOR.fade_delay",
+ &menu.enter_screen[GFX_SPECIAL_ARG_EDITOR].fade_delay
+ },
+ {
+ "menu.enter_screen.EDITOR.post_delay",
+ &menu.enter_screen[GFX_SPECIAL_ARG_EDITOR].post_delay
+ },
+ {
+ "menu.enter_screen.INFO.fade_mode",
+ &menu.enter_screen[GFX_SPECIAL_ARG_INFO].fade_mode
+ },
+ {
+ "menu.enter_screen.INFO.fade_delay",
+ &menu.enter_screen[GFX_SPECIAL_ARG_INFO].fade_delay
+ },
+ {
+ "menu.enter_screen.INFO.post_delay",
+ &menu.enter_screen[GFX_SPECIAL_ARG_INFO].post_delay
+ },
+ {
+ "menu.enter_screen.PLAYING.fade_mode",
+ &menu.enter_screen[GFX_SPECIAL_ARG_PLAYING].fade_mode
+ },
+ {
+ "menu.enter_screen.PLAYING.fade_delay",
+ &menu.enter_screen[GFX_SPECIAL_ARG_PLAYING].fade_delay
+ },
+ {
+ "menu.enter_screen.PLAYING.post_delay",
+ &menu.enter_screen[GFX_SPECIAL_ARG_PLAYING].post_delay
+ },
+ {
+ "menu.leave_screen.SCORES.fade_mode",
+ &menu.leave_screen[GFX_SPECIAL_ARG_SCORES].fade_mode
+ },
+ {
+ "menu.leave_screen.SCORES.fade_delay",
+ &menu.leave_screen[GFX_SPECIAL_ARG_SCORES].fade_delay
+ },
+ {
+ "menu.leave_screen.SCORES.post_delay",
+ &menu.leave_screen[GFX_SPECIAL_ARG_SCORES].post_delay
+ },
+ {
+ "menu.leave_screen.EDITOR.fade_mode",
+ &menu.leave_screen[GFX_SPECIAL_ARG_EDITOR].fade_mode
+ },
+ {
+ "menu.leave_screen.EDITOR.fade_delay",
+ &menu.leave_screen[GFX_SPECIAL_ARG_EDITOR].fade_delay
+ },
+ {
+ "menu.leave_screen.EDITOR.post_delay",
+ &menu.leave_screen[GFX_SPECIAL_ARG_EDITOR].post_delay
+ },
+ {
+ "menu.leave_screen.INFO.fade_mode",
+ &menu.leave_screen[GFX_SPECIAL_ARG_INFO].fade_mode
+ },
+ {
+ "menu.leave_screen.INFO.fade_delay",
+ &menu.leave_screen[GFX_SPECIAL_ARG_INFO].fade_delay
+ },
+ {
+ "menu.leave_screen.INFO.post_delay",
+ &menu.leave_screen[GFX_SPECIAL_ARG_INFO].post_delay
+ },
+ {
+ "menu.leave_screen.PLAYING.fade_mode",
+ &menu.leave_screen[GFX_SPECIAL_ARG_PLAYING].fade_mode
+ },
+ {
+ "menu.leave_screen.PLAYING.fade_delay",
+ &menu.leave_screen[GFX_SPECIAL_ARG_PLAYING].fade_delay
+ },
+ {
+ "menu.leave_screen.PLAYING.post_delay",
+ &menu.leave_screen[GFX_SPECIAL_ARG_PLAYING].post_delay
},
{
"menu.draw_xoffset",
-#define COMPILE_DATE_STRING "2007-03-31 01:45"
+#define COMPILE_DATE_STRING "2007-04-01 02:29"
menu.draw_yoffset_info[i] = get_integer_from_string(value_2);
}
+ /* special case: initialize with default values that may be overwritten */
+ /* (eg, init "menu.enter_screen.SCORES.xyz" from "menu.enter_screen.xyz") */
+ for (i = 0; i < NUM_SPECIAL_GFX_ARGS; i++)
+ {
+ char *token_1 = "menu.enter_screen.fade_mode";
+ char *token_2 = "menu.enter_screen.fade_delay";
+ char *token_3 = "menu.enter_screen.post_delay";
+ char *token_4 = "menu.leave_screen.fade_mode";
+ char *token_5 = "menu.leave_screen.fade_delay";
+ char *token_6 = "menu.leave_screen.post_delay";
+ char *value_1 = getHashEntry(setup_file_hash, token_1);
+ char *value_2 = getHashEntry(setup_file_hash, token_2);
+ char *value_3 = getHashEntry(setup_file_hash, token_3);
+ char *value_4 = getHashEntry(setup_file_hash, token_4);
+ char *value_5 = getHashEntry(setup_file_hash, token_5);
+ char *value_6 = getHashEntry(setup_file_hash, token_6);
+
+ if (value_1 != NULL)
+ menu.enter_screen[i].fade_mode = get_token_parameter_value(token_1,
+ value_1);
+ if (value_2 != NULL)
+ menu.enter_screen[i].fade_delay = get_token_parameter_value(token_2,
+ value_2);
+ if (value_3 != NULL)
+ menu.enter_screen[i].post_delay = get_token_parameter_value(token_3,
+ value_3);
+ if (value_4 != NULL)
+ menu.leave_screen[i].fade_mode = get_token_parameter_value(token_4,
+ value_4);
+ if (value_5 != NULL)
+ menu.leave_screen[i].fade_delay = get_token_parameter_value(token_5,
+ value_5);
+ if (value_6 != NULL)
+ menu.leave_screen[i].post_delay = get_token_parameter_value(token_6,
+ value_6);
+ }
+
/* special case: initialize with default values that may be overwritten */
/* (e.g., init "titlemessage_1.fade_mode" from "[titlemessage].fade_mode") */
for (i = 0; titlemessage_arrays[i].array != NULL; i++)
titlemessage[i] = titlemessage_default;
}
+ /* special case: initialize "ARG_DEFAULT" values in static default config */
+ /* (eg, init "menu.enter_screen.SCORES.xyz" from "menu.enter_screen.xyz") */
+ for (i = 0; i < NUM_SPECIAL_GFX_ARGS; i++)
+ {
+ menu.enter_screen[i] = menu.enter_screen[GFX_SPECIAL_ARG_DEFAULT];
+ menu.leave_screen[i] = menu.leave_screen[GFX_SPECIAL_ARG_DEFAULT];
+ }
+
if (!SETUP_OVERRIDE_ARTWORK(setup, ARTWORK_TYPE_GRAPHICS))
{
/* first look for special settings configured in level series config */
if (level_editor_test_game)
FadeSkipNextFadeIn();
else
- FadeSetStartItem();
+ FadeSetEnterScreen();
#else
if (level_editor_test_game)
fading = fading_none;
#if 1
#if 1
- FadeSetStartItem();
+ FadeSetEnterScreen();
// FadeSkipNextFadeOut();
// FadeSetDisabled();
#else
return;
}
+ game_status = GAME_MODE_MAIN;
+
#if 1
- FadeSetStartItem();
+ FadeSetEnterScreen();
if (!(fading.fade_mode & FADE_TYPE_TRANSFORM))
FadeSkipNextFadeOut();
// FadeSetDisabled();
fading = fading_none;
#endif
- game_status = GAME_MODE_MAIN;
-
DrawMainMenu();
InitNetworkServer();
struct TitleFadingInfo enter_menu;
struct TitleFadingInfo leave_menu;
- struct TitleFadingInfo start_item;
+ struct TitleFadingInfo enter_screen[NUM_SPECIAL_GFX_ARGS];
+ struct TitleFadingInfo leave_screen[NUM_SPECIAL_GFX_ARGS];
int sound[NUM_SPECIAL_GFX_ARGS];
int music[NUM_SPECIAL_GFX_ARGS];
redraw_mask == REDRAW_ALL);
#endif
+ FadeSetLeaveScreen();
+
#if 1
FadeOut(redraw_mask);
#endif
FadeOut(REDRAW_FIELD);
#endif
- FadeSetStartItem();
+ FadeSetEnterScreen();
info_mode = INFO_MODE_MAIN;
DrawAndFadeInInfoScreen(REDRAW_FIELD);
game_status = GAME_MODE_EDITOR;
- FadeSetStartItem();
+ FadeSetEnterScreen();
DrawLevelEd();
}
static void execInfoTitleScreen()
{
#if 0
- FadeSetStartItem();
+ FadeSetEnterScreen();
#endif
info_mode = INFO_MODE_TITLE;
static void execInfoElements()
{
#if 0
- FadeSetStartItem();
+ FadeSetEnterScreen();
#endif
info_mode = INFO_MODE_ELEMENTS;
static void execInfoMusic()
{
#if 0
- FadeSetStartItem();
+ FadeSetEnterScreen();
#endif
info_mode = INFO_MODE_MUSIC;
static void execInfoCredits()
{
#if 0
- FadeSetStartItem();
+ FadeSetEnterScreen();
#endif
info_mode = INFO_MODE_CREDITS;
static void execInfoProgram()
{
#if 0
- FadeSetStartItem();
+ FadeSetEnterScreen();
#endif
info_mode = INFO_MODE_PROGRAM;
static void execInfoVersion()
{
#if 0
- FadeSetStartItem();
+ FadeSetEnterScreen();
#endif
info_mode = INFO_MODE_VERSION;
static void execInfoLevelSet()
{
#if 0
- FadeSetStartItem();
+ FadeSetEnterScreen();
#endif
info_mode = INFO_MODE_LEVELSET;
/* (needed after displaying title screens which disable auto repeat) */
KeyboardAutoRepeatOn();
+ FadeSetLeaveScreen();
+
#if 1
FadeOut(redraw_mask);
#endif
}
else
{
- FadeSetStartItem();
+ FadeSetEnterScreen();
node_cursor->cl_first = ti->cl_first;
node_cursor->cl_cursor = ti->cl_cursor;
if (highlight_position < 0)
LoadScore(level_nr);
- FadeSetStartItem();
+ FadeSetEnterScreen();
+
+ // printf("::: %d: %d\n", game_status, menu.enter_screen[game_status]);
#if 1
FadeOut(REDRAW_FIELD);
BlitBitmap(backbuffer, bitmap_db_cross, 0, 0, WIN_XSIZE, WIN_YSIZE, 0, 0);
}
+static void FadeSetLeaveNext(struct TitleFadingInfo fading_leave, boolean set)
+{
+ static struct TitleFadingInfo fading_leave_stored;
+
+ if (set)
+ fading_leave_stored = fading_leave;
+ else
+ fading = fading_leave_stored;
+}
+
void FadeSetEnterMenu()
{
fading = menu.enter_menu;
+
+ FadeSetLeaveNext(fading, TRUE); /* (keep same fade mode) */
}
void FadeSetLeaveMenu()
{
fading = menu.leave_menu;
+
+ FadeSetLeaveNext(fading, TRUE); /* (keep same fade mode) */
+}
+
+void FadeSetEnterScreen()
+{
+ fading = menu.enter_screen[game_status];
+
+ FadeSetLeaveNext(menu.leave_screen[game_status], TRUE); /* store */
}
-void FadeSetStartItem()
+void FadeSetLeaveScreen()
{
- fading = menu.start_item;
+ FadeSetLeaveNext(menu.leave_screen[game_status], FALSE); /* recall */
}
void FadeSetFromType(int type)
{
if (type & TYPE_ENTER_SCREEN)
- FadeSetStartItem();
+ FadeSetEnterScreen();
else if (type & TYPE_ENTER)
FadeSetEnterMenu();
else if (type & TYPE_LEAVE)
void FadeCrossSaveBackbuffer();
void FadeSetEnterMenu();
void FadeSetLeaveMenu();
-void FadeSetStartItem();
+void FadeSetEnterScreen();
+void FadeSetLeaveScreen();
void FadeSetFromType(int);
void FadeSetDisabled();
void FadeSkipNextFadeIn();