{ "background.envelope_4.anim_mode", "default" },
{ "background.envelope_4.draw_masked", "false" },
+ { "titlescreen_initial_1", UNDEFINED_FILENAME },
+ { "titlescreen_initial_2", UNDEFINED_FILENAME },
+ { "titlescreen_initial_3", UNDEFINED_FILENAME },
+ { "titlescreen_initial_4", UNDEFINED_FILENAME },
+ { "titlescreen_initial_5", UNDEFINED_FILENAME },
{ "titlescreen_1", UNDEFINED_FILENAME },
{ "titlescreen_2", UNDEFINED_FILENAME },
{ "titlescreen_3", UNDEFINED_FILENAME },
{ "menu.fade_delay", "250" },
{ "menu.post_delay", "125" },
+ { "menu.auto_delay", "0" },
{ "main.button.name.x", "0" },
{ "main.button.name.y", "64" },
#define IMG_BACKGROUND_ENVELOPE_2 1542
#define IMG_BACKGROUND_ENVELOPE_3 1543
#define IMG_BACKGROUND_ENVELOPE_4 1544
-#define IMG_TITLESCREEN_1 1545
-#define IMG_TITLESCREEN_2 1546
-#define IMG_TITLESCREEN_3 1547
-#define IMG_TITLESCREEN_4 1548
-#define IMG_TITLESCREEN_5 1549
-#define IMG_BACKGROUND 1550
-#define IMG_BACKGROUND_TITLE 1551
-#define IMG_BACKGROUND_MAIN 1552
-#define IMG_BACKGROUND_LEVELS 1553
-#define IMG_BACKGROUND_SCORES 1554
-#define IMG_BACKGROUND_EDITOR 1555
-#define IMG_BACKGROUND_INFO 1556
-#define IMG_BACKGROUND_INFO_ELEMENTS 1557
-#define IMG_BACKGROUND_INFO_MUSIC 1558
-#define IMG_BACKGROUND_INFO_CREDITS 1559
-#define IMG_BACKGROUND_INFO_PROGRAM 1560
-#define IMG_BACKGROUND_INFO_LEVELSET 1561
-#define IMG_BACKGROUND_SETUP 1562
-#define IMG_BACKGROUND_DOOR 1563
+#define IMG_TITLESCREEN_INITIAL_1 1545
+#define IMG_TITLESCREEN_INITIAL_2 1546
+#define IMG_TITLESCREEN_INITIAL_3 1547
+#define IMG_TITLESCREEN_INITIAL_4 1548
+#define IMG_TITLESCREEN_INITIAL_5 1549
+#define IMG_TITLESCREEN_1 1550
+#define IMG_TITLESCREEN_2 1551
+#define IMG_TITLESCREEN_3 1552
+#define IMG_TITLESCREEN_4 1553
+#define IMG_TITLESCREEN_5 1554
+#define IMG_BACKGROUND 1555
+#define IMG_BACKGROUND_TITLE 1556
+#define IMG_BACKGROUND_MAIN 1557
+#define IMG_BACKGROUND_LEVELS 1558
+#define IMG_BACKGROUND_SCORES 1559
+#define IMG_BACKGROUND_EDITOR 1560
+#define IMG_BACKGROUND_INFO 1561
+#define IMG_BACKGROUND_INFO_ELEMENTS 1562
+#define IMG_BACKGROUND_INFO_MUSIC 1563
+#define IMG_BACKGROUND_INFO_CREDITS 1564
+#define IMG_BACKGROUND_INFO_PROGRAM 1565
+#define IMG_BACKGROUND_INFO_LEVELSET 1566
+#define IMG_BACKGROUND_SETUP 1567
+#define IMG_BACKGROUND_DOOR 1568
-#define NUM_IMAGE_FILES 1564
+#define NUM_IMAGE_FILES 1569
#endif /* CONF_GFX_H */
-#define COMPILE_DATE_STRING "[2006-10-19 00:36]"
+#define COMPILE_DATE_STRING "[2006-10-19 19:44]"
while (NextValidEvent(&event))
{
- switch(event.type)
+ switch (event.type)
{
case EVENT_BUTTONPRESS:
case EVENT_BUTTONRELEASE:
void HandleOtherEvents(Event *event)
{
- switch(event->type)
+ switch (event->type)
{
case EVENT_EXPOSE:
HandleExposeEvent((ExposeEvent *) event);
NextEvent(&event);
- switch(event.type)
+ switch (event.type)
{
case EVENT_BUTTONRELEASE:
button_status = MB_RELEASED;
NextEvent(&event);
- switch(event.type)
+ switch (event.type)
{
case EVENT_BUTTONRELEASE:
button_status = MB_RELEASED;
key = KSYM_UNDEFINED;
}
- switch(game_status)
+ switch (game_status)
{
case GAME_MODE_PSEUDO_TYPENAME:
HandleTypeName(0, key);
case GAME_MODE_SETUP:
case GAME_MODE_INFO:
case GAME_MODE_SCORES:
- switch(key)
+ switch (key)
{
case KSYM_space:
case KSYM_Return:
case GAME_MODE_PLAYING:
{
- switch(key)
+ switch (key)
{
case KSYM_Escape:
RequestQuitGame(setup.ask_on_escape);
int dx = (left ? -1 : right ? 1 : 0);
int dy = (up ? -1 : down ? 1 : 0);
- switch(game_status)
+ switch (game_status)
{
case GAME_MODE_TITLE:
case GAME_MODE_MAIN:
{ MV_LEFT, MV_RIGHT, MV_UP, MV_DOWN }
};
- switch(element)
+ switch (element)
{
case EL_BUG_RIGHT:
case EL_BUG_UP:
}
}
- switch(element)
+ switch (element)
{
case EL_BUG:
case EL_SPACESHIP:
/* ---------- execute action -------------------------------------------- */
- switch(action_type)
+ switch (action_type)
{
case CA_NO_ACTION:
{
void RaiseScoreElement(int element)
{
- switch(element)
+ switch (element)
{
case EL_EMERALD:
case EL_BD_DIAMOND:
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"))
#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
{ "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 },
int fade_delay;
int post_delay;
+ int auto_delay;
int sound[NUM_SPECIAL_GFX_ARGS];
int music[NUM_SPECIAL_GFX_ARGS];
break;
}
- switch(buffer[1])
+ switch (buffer[1])
{
case OP_PLAYER_NAME:
Handle_OP_PLAYER_NAME(player, len);
nread -= 4 + message_length;
memmove(readbuffer, readbuffer + 4 + message_length, nread);
- switch(buffer[1])
+ switch (buffer[1])
{
case OP_BAD_PROTOCOL_VERSION:
Handle_OP_BAD_PROTOCOL_VERSION();
static void MapScreenTreeGadgets(TreeInfo *);
static struct GadgetInfo *screen_gadget[NUM_SCREEN_GADGETS];
+
+static boolean show_titlescreen_initial = TRUE;
+
static int setup_mode = SETUP_MODE_MAIN;
static int info_mode = INFO_MODE_MAIN;
static boolean insideMenuPosRect(struct MenuPosInfo *rect, int x, int y)
{
+ if (rect == NULL)
+ return FALSE;
+
int rect_x = ALIGNED_XPOS(rect->x, rect->width, rect->align);
int rect_y = rect->y;
- return (rect != NULL &&
- x >= rect_x && x < rect_x + rect->width &&
+ return (x >= rect_x && x < rect_x + rect->width &&
y >= rect_y && y < rect_y + rect->height);
}
}
#endif
+static int getTitleScreenGraphic()
+{
+ return (show_titlescreen_initial ? IMG_TITLESCREEN_INITIAL_1 :
+ IMG_TITLESCREEN_1);
+}
+
void DrawTitleScreenImage(int nr)
{
- int graphic = IMG_TITLESCREEN_1 + nr;
+ int graphic = getTitleScreenGraphic() + nr;
Bitmap *bitmap = graphic_info[graphic].bitmap;
int width = graphic_info[graphic].src_image_width;
int height = graphic_info[graphic].src_image_height;
#endif
if (setup.show_titlescreen &&
- levelset_has_changed &&
- graphic_info[IMG_TITLESCREEN_1].bitmap != NULL)
+ ((levelset_has_changed &&
+ graphic_info[IMG_TITLESCREEN_1].bitmap != NULL) ||
+ (show_titlescreen_initial &&
+ graphic_info[IMG_TITLESCREEN_INITIAL_1].bitmap != NULL)))
{
game_status = GAME_MODE_TITLE;
void HandleTitleScreen(int mx, int my, int dx, int dy, int button)
{
+ static unsigned long title_delay = 0;
static int title_nr = 0;
boolean return_to_main_menu = FALSE;
boolean use_fading_main_menu = TRUE;
- boolean use_cross_fading = TRUE;
+ boolean use_cross_fading = !show_titlescreen_initial; /* default */
+ int auto_delay = menu.auto_delay;
if (button == MB_MENU_INITIALIZE)
{
int last_game_status = game_status; /* save current game status */
+
+ title_delay = 0;
title_nr = 0;
if (game_status == GAME_MODE_INFO)
FadeIn(REDRAW_ALL);
+ DelayReached(&title_delay, 0); /* reset delay counter */
+
return;
}
- else if (button == MB_MENU_LEAVE)
+
+ 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))
+ button = MB_MENU_CHOICE;
+
+ if (button == MB_MENU_LEAVE)
{
return_to_main_menu = TRUE;
use_fading_main_menu = FALSE;
title_nr++;
+ if (show_titlescreen_initial &&
+ (title_nr >= MAX_NUM_TITLE_SCREENS ||
+ graphic_info[IMG_TITLESCREEN_INITIAL_1 + title_nr].bitmap == NULL))
+ {
+ show_titlescreen_initial = FALSE;
+
+ title_nr = 0; /* restart with title screens for current level set */
+ }
+
+ int anim_mode = graphic_info[getTitleScreenGraphic() + title_nr].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_SCREENS &&
- graphic_info[IMG_TITLESCREEN_1 + title_nr].bitmap != NULL)
+ graphic_info[getTitleScreenGraphic() + title_nr].bitmap != NULL)
{
if (use_cross_fading)
FadeCrossSaveBackbuffer();
FadeCross(REDRAW_ALL);
else
FadeIn(REDRAW_ALL);
+
+ DelayReached(&title_delay, 0); /* reset delay counter */
}
else
{
NextEvent(&event);
- switch(event.type)
+ switch (event.type)
{
case EVENT_KEYPRESS:
{
NextEvent(&event);
- switch(event.type)
+ switch (event.type)
{
case EVENT_KEYPRESS:
{
NextEvent(&event);
- switch(event.type)
+ switch (event.type)
{
case EVENT_KEYPRESS:
- switch(GetEventKey((KeyEvent *)&event, TRUE))
+ switch (GetEventKey((KeyEvent *)&event, TRUE))
{
case KSYM_Return:
if (check_remaining == 0)
NextEvent(&event);
- switch(event.type)
+ switch (event.type)
{
case EVENT_BUTTONPRESS:
case EVENT_BUTTONRELEASE:
/* this sets 'request_gadget_id' */
HandleGadgets(mx, my, button_status);
- switch(request_gadget_id)
+ switch (request_gadget_id)
{
case TOOL_CTRL_ID_YES:
result = TRUE;
}
case EVENT_KEYPRESS:
- switch(GetEventKey((KeyEvent *)&event, TRUE))
+ switch (GetEventKey((KeyEvent *)&event, TRUE))
{
case KSYM_Return:
result = 1;
int get_next_element(int element)
{
- switch(element)
+ switch (element)
{
case EL_QUICKSAND_FILLING: return EL_QUICKSAND_FULL;
case EL_QUICKSAND_EMPTYING: return EL_QUICKSAND_EMPTY;