From d9f39115e59293918996baa8236ee3784d80a313 Mon Sep 17 00:00:00 2001 From: Holger Schemel Date: Tue, 30 May 2006 21:24:17 +0200 Subject: [PATCH] rnd-20060530-1-src * fixed some bugs when displaying title screens from info screen menu --- ChangeLog | 7 +++++- src/conftime.h | 2 +- src/main.h | 2 +- src/screens.c | 60 +++++++++++++++++++++++++++++++++++++++++++------- 4 files changed, 60 insertions(+), 11 deletions(-) diff --git a/ChangeLog b/ChangeLog index 7d04fe14..49f4d9af 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,11 +1,16 @@ +2006-05-30 + * fixed some bugs when displaying title screens from info screen menu + 2006-05-20 - * changed file version identifier to reflect recent level file changes + * changed file major version to 3 to reflect level file format changes + * uploaded pre-release (test) version 3.2.0-8 binary and source code 2006-05-19 * added new chunk "NAME" to level file format for level name settings * added new chunk "NOTE" to level file format for envelope settings * changed name of chunk "CONF" to "ELEM" (for normal element settings) * updated magic(5) file to recognize changed and new level file chunks + * removed change events "change when CE value/score changes" as unneeded 2006-05-17 * changed gravity (which only affects the player) from level property diff --git a/src/conftime.h b/src/conftime.h index 511b2356..a4f17902 100644 --- a/src/conftime.h +++ b/src/conftime.h @@ -1 +1 @@ -#define COMPILE_DATE_STRING "[2006-05-20 01:03]" +#define COMPILE_DATE_STRING "[2006-05-30 21:20]" diff --git a/src/main.h b/src/main.h index a18e8484..53fa767f 100644 --- a/src/main.h +++ b/src/main.h @@ -1708,7 +1708,7 @@ #define PROGRAM_VERSION_MAJOR 3 #define PROGRAM_VERSION_MINOR 2 #define PROGRAM_VERSION_PATCH 0 -#define PROGRAM_VERSION_BUILD 8 +#define PROGRAM_VERSION_BUILD 9 #define PROGRAM_TITLE_STRING "Rocks'n'Diamonds" #define PROGRAM_AUTHOR_STRING "Holger Schemel" diff --git a/src/screens.c b/src/screens.c index 9dcf4dd7..dc0a14eb 100644 --- a/src/screens.c +++ b/src/screens.c @@ -48,7 +48,7 @@ /* screens on the info screen */ #define INFO_MODE_MAIN 0 -#define INFO_MODE_TITLESCREEN 1 +#define INFO_MODE_TITLE 1 #define INFO_MODE_ELEMENTS 2 #define INFO_MODE_MUSIC 3 #define INFO_MODE_CREDITS 4 @@ -117,6 +117,7 @@ static void DrawInfoScreen(void); static void DrawSetupScreen(void); static void DrawInfoScreenExt(int); +static void DrawInfoScreen_NotAvailable(char *, char *); static void DrawInfoScreen_HelpAnim(int, int, boolean); static void DrawInfoScreen_HelpText(int, int, int, int); static void HandleInfoScreen_Main(int, int, int, int, int); @@ -299,9 +300,6 @@ void DrawTitleScreen() SetMainBackgroundImage(IMG_BACKGROUND_TITLE); - PlayMenuSound(); - PlayMenuMusic(); - HandleTitleScreen(0, 0, 0, 0, MB_MENU_INITIALIZE); StopAnimation(); @@ -593,15 +591,32 @@ void HandleTitleScreen(int mx, int my, int dx, int dy, int button) if (button == MB_MENU_INITIALIZE) { + int last_game_status = game_status; /* save current game status */ title_nr = 0; if (game_status == GAME_MODE_INFO) { + if (graphic_info[IMG_TITLESCREEN_1].bitmap == NULL) + { + DrawInfoScreen_NotAvailable("Title screen information:", + "No title screen for this level set."); + + return; + } + FadeSoundsAndMusic(); FadeOut(fade_delay, post_delay); } + /* force TITLE music on title info screen */ + game_status = GAME_MODE_TITLE; + + PlayMenuSound(); + PlayMenuMusic(); + + game_status = last_game_status; /* restore current game status */ + DrawTitleScreenImage(title_nr); FadeIn(fade_delay); @@ -615,6 +630,15 @@ void HandleTitleScreen(int mx, int my, int dx, int dy, int button) } else if (button == MB_MENU_CHOICE) { + if (game_status == GAME_MODE_INFO && + graphic_info[IMG_TITLESCREEN_1].bitmap == NULL) + { + info_mode = INFO_MODE_MAIN; + DrawInfoScreen(); + + return; + } + title_nr++; if (!use_cross_fading) @@ -840,7 +864,7 @@ static int num_info_info; static void execInfoTitleScreen() { - info_mode = INFO_MODE_TITLESCREEN; + info_mode = INFO_MODE_TITLE; DrawInfoScreen(); } @@ -1035,6 +1059,24 @@ void HandleInfoScreen_Main(int mx, int my, int dx, int dy, int button) } } +void DrawInfoScreen_NotAvailable(char *text_title, char *text_error) +{ + int ystart = 150; + int ybottom = SYSIZE - 20; + + SetMainBackgroundImageIfDefined(IMG_BACKGROUND_INFO_LEVELSET); + + ClearWindow(); + DrawHeadline(); + + DrawTextSCentered(100, FONT_TEXT_1, text_title); + + DrawTextSCentered(ybottom, FONT_TEXT_4, + "Press any key or button for info menu"); + + DrawTextSCentered(ystart, FONT_TEXT_2, text_error); +} + void DrawInfoScreen_HelpAnim(int start, int max_anims, boolean init) { static int infoscreen_step[MAX_INFO_ELEMENTS_ON_SCREEN]; @@ -1754,7 +1796,7 @@ static void DrawInfoScreenExt(int fade_delay) { SetMainBackgroundImage(IMG_BACKGROUND_INFO); - if (info_mode == INFO_MODE_TITLESCREEN) + if (info_mode == INFO_MODE_TITLE) DrawInfoScreen_TitleScreen(); else if (info_mode == INFO_MODE_ELEMENTS) DrawInfoScreen_Elements(); @@ -1769,7 +1811,9 @@ static void DrawInfoScreenExt(int fade_delay) else DrawInfoScreen_Main(fade_delay); - if (info_mode != INFO_MODE_MUSIC) + if (info_mode != INFO_MODE_MAIN && + info_mode != INFO_MODE_TITLE && + info_mode != INFO_MODE_MUSIC) { PlayMenuSound(); PlayMenuMusic(); @@ -1783,7 +1827,7 @@ void DrawInfoScreen() void HandleInfoScreen(int mx, int my, int dx, int dy, int button) { - if (info_mode == INFO_MODE_TITLESCREEN) + if (info_mode == INFO_MODE_TITLE) HandleInfoScreen_TitleScreen(button); else if (info_mode == INFO_MODE_ELEMENTS) HandleInfoScreen_Elements(button); -- 2.34.1