+2006-10-20
+ * added configuration directives for control of title screens:
+ - "title.fade_delay" for fading time
+ - "title.post_delay" for pause between screens (when not crossfading)
+ - "title.auto_delay" to automatically continue after some time
+ these settings can each be overridden by specifying them with titles:
+ - "titlescreen_initial_{1-5}.{fade_delay,post_delay,auto_delay}"
+ - "titlescreen_{1-5}.{fade_delay,post_delay,auto_delay}"
+ fading mode can also be specified:
+ - "titlescreen_initial_{1-5}.anim_mode: {fade,crossfade}
+ - "titlescreen_{1-5}.anim_mode: {fade,crossfade}
+ default is using normal fading for menues and initial title screens,
+ while using cross-fading for level set title screens
+
2006-10-18
* added configuration directives for the remaining main menu items
{ ".name", ARG_UNDEFINED, TYPE_STRING },
{ ".scale_up_factor", ARG_UNDEFINED, TYPE_INTEGER },
{ ".clone_from", ARG_UNDEFINED, TYPE_TOKEN },
+ { ".fade_delay", ARG_UNDEFINED, TYPE_INTEGER },
+ { ".post_delay", ARG_UNDEFINED, TYPE_INTEGER },
+ { ".auto_delay", ARG_UNDEFINED, TYPE_INTEGER },
{ NULL, NULL, 0 }
};
{ "border.draw_masked.PLAYING", "false" },
{ "border.draw_masked.DOOR", "false" },
+ { "title.fade_delay", "500" },
+ { "title.post_delay", "250" },
+ { "title.auto_delay", "-1" },
+
+ { "menu.fade_delay", "250" },
+ { "menu.post_delay", "125" },
+ { "menu.auto_delay", "-1" },
+
{ "menu.draw_xoffset", "0" },
{ "menu.draw_yoffset", "0" },
{ "menu.draw_xoffset.MAIN", "0" },
{ "menu.list_size.SCORES", "-1" },
{ "menu.list_size.INFO", "-1" },
- { "menu.fade_delay", "250" },
- { "menu.post_delay", "125" },
- { "menu.auto_delay", "0" },
-
{ "main.button.name.x", "0" },
{ "main.button.name.y", "64" },
{ "main.button.levels.x", "0" },
-#define COMPILE_DATE_STRING "[2006-10-19 19:44]"
+#define COMPILE_DATE_STRING "[2006-10-20 19:44]"
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_delay = -1;
+ graphic_info[graphic].post_delay = -1;
+ graphic_info[graphic].auto_delay = -1;
/* optional x and y tile position of animation frame sequence */
if (parameter[GFX_ARG_XPOS] != ARG_UNDEFINED_VALUE)
/* optional graphic for cloning all graphics settings */
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 */
+ 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)
+ graphic_info[graphic].post_delay = parameter[GFX_ARG_POST_DELAY];
+ if (parameter[GFX_ARG_AUTO_DELAY] != ARG_UNDEFINED_VALUE)
+ graphic_info[graphic].auto_delay = parameter[GFX_ARG_AUTO_DELAY];
}
static void set_cloned_graphic_parameters(int graphic)
struct GameInfo game;
struct GlobalInfo global;
struct BorderInfo border;
+struct TitleInfo title;
struct MenuInfo menu;
struct DoorInfo door_1, door_2;
struct PreviewInfo preview;
{ "border.draw_masked.PLAYING",&border.draw_masked[GFX_SPECIAL_ARG_PLAYING] },
{ "border.draw_masked.DOOR", &border.draw_masked[GFX_SPECIAL_ARG_DOOR] },
+ { "title.fade_delay", &title.fade_delay },
+ { "title.post_delay", &title.post_delay },
+ { "title.auto_delay", &title.auto_delay },
+
+ { "menu.fade_delay", &menu.fade_delay },
+ { "menu.post_delay", &menu.post_delay },
+ { "menu.auto_delay", &menu.auto_delay },
+
{ "menu.draw_xoffset", &menu.draw_xoffset[GFX_SPECIAL_ARG_DEFAULT] },
{ "menu.draw_yoffset", &menu.draw_yoffset[GFX_SPECIAL_ARG_DEFAULT] },
{ "menu.draw_xoffset.MAIN", &menu.draw_xoffset[GFX_SPECIAL_ARG_MAIN] },
{ "menu.list_size.SCORES", &menu.list_size[GFX_SPECIAL_ARG_SCORES] },
{ "menu.list_size.INFO", &menu.list_size[GFX_SPECIAL_ARG_INFO] },
- { "menu.fade_delay", &menu.fade_delay },
- { "menu.post_delay", &menu.post_delay },
- { "menu.auto_delay", &menu.auto_delay },
-
{ "main.button.name.x", &menu.main.button.name.x },
{ "main.button.name.y", &menu.main.button.name.y },
{ "main.button.levels.x", &menu.main.button.levels.x },
#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 NUM_GFX_ARGS 39
+#define NUM_GFX_ARGS 42
/* values for sound configuration suffixes */
struct MenuMainInputInfo input;
};
+struct TitleInfo
+{
+ int fade_delay;
+ int post_delay;
+ int auto_delay;
+
+ int fade_delay_final;
+ int post_delay_final;
+ int auto_delay_final;
+};
+
struct MenuInfo
{
int draw_xoffset[NUM_SPECIAL_GFX_ARGS];
int draw_masked; /* optional setting for drawing envelope gfx */
+ 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 */
+
#if defined(TARGET_X11_NATIVE_PERFORMANCE_WORKAROUND)
Pixmap clip_mask; /* single-graphic-only clip mask for X11 */
GC clip_gc; /* single-graphic-only clip gc for X11 */
extern struct TapeInfo tape;
extern struct GlobalInfo global;
extern struct BorderInfo border;
+extern struct TitleInfo title;
extern struct MenuInfo menu;
extern struct DoorInfo door_1, door_2;
extern struct PreviewInfo preview;
BlitBitmap(bitmap, drawto, src_x, src_y, width, height, dst_x, dst_y);
redraw_mask = REDRAW_ALL;
+
+ /* reset fading control values to default config settings */
+ 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].fade_delay > -1)
+ title.fade_delay_final = graphic_info[graphic].fade_delay;
+ if (graphic_info[graphic].post_delay > -1)
+ title.post_delay_final = graphic_info[graphic].post_delay;
+ if (graphic_info[graphic].auto_delay > -1)
+ title.auto_delay_final = graphic_info[graphic].auto_delay;
}
void DrawTitleScreen()
boolean return_to_main_menu = FALSE;
boolean use_fading_main_menu = TRUE;
boolean use_cross_fading = !show_titlescreen_initial; /* default */
- int auto_delay = menu.auto_delay;
if (button == MB_MENU_INITIALIZE)
{
title_delay = 0;
title_nr = 0;
+ if (show_titlescreen_initial &&
+ graphic_info[IMG_TITLESCREEN_INITIAL_1].bitmap == NULL)
+ show_titlescreen_initial = FALSE;
+
if (game_status == GAME_MODE_INFO)
{
if (graphic_info[IMG_TITLESCREEN_1].bitmap == NULL)
return;
}
- int anim_delay = graphic_info[getTitleScreenGraphic() + title_nr].anim_delay;
- if (anim_delay > 1)
- auto_delay = anim_delay;
-
- if (auto_delay > 0 && DelayReached(&title_delay, auto_delay))
+ if (title.auto_delay_final > -1 &&
+ DelayReached(&title_delay, title.auto_delay_final))
button = MB_MENU_CHOICE;
if (button == MB_MENU_LEAVE)
}
else if (button == MB_MENU_CHOICE)
{
+ int anim_mode;
+
if (game_status == GAME_MODE_INFO &&
graphic_info[IMG_TITLESCREEN_1].bitmap == NULL)
{
title_nr = 0; /* restart with title screens for current level set */
}
- int anim_mode = graphic_info[getTitleScreenGraphic() + title_nr].anim_mode;
+ anim_mode = graphic_info[getTitleScreenGraphic() + title_nr].anim_mode;
use_cross_fading = (anim_mode == ANIM_FADE ? FALSE :
anim_mode == ANIM_CROSSFADE ? TRUE :
if (return_to_main_menu)
{
+ show_titlescreen_initial = FALSE;
+
RedrawBackground();
if (game_status == GAME_MODE_INFO)
static int num_pages;
static int page;
int anims_per_page = MAX_INFO_ELEMENTS_ON_SCREEN;
- int button_released = !button;
int i;
if (button == MB_MENU_INITIALIZE)
boolean new_element = TRUE;
num_anims = 0;
+
for (i = 0; helpanim_info[i].element != HELPANIM_LIST_END; i++)
{
if (helpanim_info[i].element == HELPANIM_LIST_NEXT)
num_pages = (num_anims + anims_per_page - 1) / anims_per_page;
page = 0;
}
- else if (button == MB_MENU_LEAVE)
+
+ if (button == MB_MENU_LEAVE)
{
info_mode = INFO_MODE_MAIN;
DrawInfoScreen();
return;
}
-
- if (button_released || button == MB_MENU_INITIALIZE)
+ else if (button == MB_MENU_CHOICE || button == MB_MENU_INITIALIZE)
{
if (button != MB_MENU_INITIALIZE)
page++;
static struct MusicFileInfo *list = NULL;
int ystart = 150, dy = 30;
int ybottom = SYSIZE - 20;
- int button_released = !button;
if (button == MB_MENU_INITIALIZE)
{
return;
}
}
- else if (button == MB_MENU_LEAVE)
+
+ if (button == MB_MENU_LEAVE)
{
info_mode = INFO_MODE_MAIN;
DrawInfoScreen();
return;
}
-
- if (button_released || button == MB_MENU_INITIALIZE)
+ else if (button == MB_MENU_CHOICE || button == MB_MENU_INITIALIZE)
{
int y = 0;
void HandleInfoScreen_Program(int button)
{
- int button_released = !button;
-
if (button == MB_MENU_LEAVE)
{
info_mode = INFO_MODE_MAIN;
return;
}
-
- if (button_released)
+ else if (button == MB_MENU_CHOICE)
{
FadeSoundsAndMusic();
FadeOut(REDRAW_FIELD);
void HandleInfoScreen_LevelSet(int button)
{
- int button_released = !button;
-
if (button == MB_MENU_LEAVE)
{
info_mode = INFO_MODE_MAIN;
return;
}
-
- if (button_released)
+ else if (button == MB_MENU_CHOICE)
{
FadeSoundsAndMusic();
FadeOut(REDRAW_FIELD);
{
void (*draw_border_function)(void) = NULL;
Bitmap *bitmap = (fade_mode == FADE_MODE_CROSSFADE ? bitmap_db_cross : NULL);
- int fade_delay = menu.fade_delay;
- int post_delay = (fade_mode == FADE_MODE_FADE_OUT ? menu.post_delay : 0);
int x, y, width, height;
+ int fade_delay, post_delay;
if (fade_mask & REDRAW_FIELD)
{
width = FULL_SXSIZE;
height = FULL_SYSIZE;
+ fade_delay = menu.fade_delay;
+ post_delay = (fade_mode == FADE_MODE_FADE_OUT ? menu.post_delay : 0);
+
draw_border_function = DrawMaskedBorder_FIELD;
}
else /* REDRAW_ALL */
y = 0;
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);
}
redraw_mask |= fade_mask;