X-Git-Url: https://git.artsoft.org/?a=blobdiff_plain;f=src%2Fscreens.c;h=9dcf4dd7cd19a985c675eaee4d6649282e0e6bea;hb=1847b9f73a9189758958980912c005dc289e1b08;hp=6dc458835bef9177d46d3f1caaf9d5d476228eed;hpb=ec942b1c9df306ed468fdc42ba3b5f7f0d9b330f;p=rocksndiamonds.git diff --git a/src/screens.c b/src/screens.c index 6dc45883..9dcf4dd7 100644 --- a/src/screens.c +++ b/src/screens.c @@ -48,13 +48,14 @@ /* screens on the info screen */ #define INFO_MODE_MAIN 0 -#define INFO_MODE_ELEMENTS 1 -#define INFO_MODE_MUSIC 2 -#define INFO_MODE_CREDITS 3 -#define INFO_MODE_PROGRAM 4 -#define INFO_MODE_LEVELSET 5 +#define INFO_MODE_TITLESCREEN 1 +#define INFO_MODE_ELEMENTS 2 +#define INFO_MODE_MUSIC 3 +#define INFO_MODE_CREDITS 4 +#define INFO_MODE_PROGRAM 5 +#define INFO_MODE_LEVELSET 6 -#define MAX_INFO_MODES 6 +#define MAX_INFO_MODES 7 /* for various menu stuff */ #define MENU_SCREEN_START_XPOS 1 @@ -115,9 +116,11 @@ static void DrawChooseLevel(void); static void DrawInfoScreen(void); static void DrawSetupScreen(void); +static void DrawInfoScreenExt(int); static void DrawInfoScreen_HelpAnim(int, int, boolean); static void DrawInfoScreen_HelpText(int, int, int, int); static void HandleInfoScreen_Main(int, int, int, int, int); +static void HandleInfoScreen_TitleScreen(int); static void HandleInfoScreen_Elements(int); static void HandleInfoScreen_Music(int); static void HandleInfoScreen_Credits(int); @@ -491,6 +494,8 @@ static void DrawMainMenuExt(int fade_delay) #if 0 FadeToFront(); +#endif +#if 0 InitAnimation(); #endif @@ -504,6 +509,7 @@ static void DrawMainMenuExt(int fade_delay) PlayMenuSound(); PlayMenuMusic(); +#if 0 #if 1 OpenDoor(DOOR_CLOSE_1 | DOOR_OPEN_2); #else @@ -512,22 +518,37 @@ static void DrawMainMenuExt(int fade_delay) else OpenDoor(DOOR_CLOSE_1 | DOOR_OPEN_2); #endif +#endif + +#if 0 + InitAnimation(); +#endif #if 1 /* map gadgets for main menu screen */ MapTapeButtons(); #endif +#if 1 #if 1 FadeIn(fade_delay); +#else + BackToFront(); +#endif +#endif +#if 1 InitAnimation(); #endif + +#if 1 + OpenDoor(DOOR_CLOSE_1 | DOOR_OPEN_2); +#endif } void DrawMainMenu() { - DrawMainMenuExt(FALSE); + DrawMainMenuExt(0); } #if 0 @@ -574,6 +595,13 @@ void HandleTitleScreen(int mx, int my, int dx, int dy, int button) { title_nr = 0; + if (game_status == GAME_MODE_INFO) + { + FadeSoundsAndMusic(); + + FadeOut(fade_delay, post_delay); + } + DrawTitleScreenImage(title_nr); FadeIn(fade_delay); @@ -621,14 +649,24 @@ void HandleTitleScreen(int mx, int my, int dx, int dy, int button) if (return_to_main_menu) { + int menu_fade_delay = (use_fading_main_menu ? fade_delay : 0); + RedrawBackground(); -#if 1 - OpenDoor(DOOR_CLOSE_1 | DOOR_OPEN_2 | DOOR_NO_DELAY | DOOR_FORCE_REDRAW); -#endif + if (game_status == GAME_MODE_INFO) + { + OpenDoor(DOOR_CLOSE_1 | DOOR_CLOSE_2 | DOOR_NO_DELAY | DOOR_FORCE_REDRAW); - game_status = GAME_MODE_MAIN; - DrawMainMenuExt(use_fading_main_menu ? fade_delay : 0); + info_mode = INFO_MODE_MAIN; + DrawInfoScreenExt(menu_fade_delay); + } + 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(menu_fade_delay); + } } } @@ -800,6 +838,12 @@ void HandleMainMenu(int mx, int my, int dx, int dy, int button) static struct TokenInfo *info_info; static int num_info_info; +static void execInfoTitleScreen() +{ + info_mode = INFO_MODE_TITLESCREEN; + DrawInfoScreen(); +} + static void execInfoElements() { info_mode = INFO_MODE_ELEMENTS; @@ -838,6 +882,7 @@ static void execExitInfo() static struct TokenInfo info_info_main[] = { + { TYPE_ENTER_SCREEN, execInfoTitleScreen, "Title Screen" }, { TYPE_ENTER_SCREEN, execInfoElements, "Elements Info" }, { TYPE_ENTER_SCREEN, execInfoMusic, "Music Info" }, { TYPE_ENTER_SCREEN, execInfoCredits, "Credits" }, @@ -849,7 +894,7 @@ static struct TokenInfo info_info_main[] = { 0, NULL, NULL } }; -static void DrawInfoScreen_Main() +static void DrawInfoScreen_Main(int fade_delay) { int i; @@ -885,6 +930,18 @@ static void DrawInfoScreen_Main() num_info_info++; } +#if 1 + + HandleInfoScreen_Main(0, 0, 0, 0, MB_MENU_INITIALIZE); + + PlayMenuSound(); + PlayMenuMusic(); + + FadeIn(fade_delay); + InitAnimation(); + +#else + FadeToFront(); InitAnimation(); @@ -892,6 +949,7 @@ static void DrawInfoScreen_Main() PlayMenuMusic(); HandleInfoScreen_Main(0, 0, 0, 0, MB_MENU_INITIALIZE); +#endif } void HandleInfoScreen_Main(int mx, int my, int dx, int dy, int button) @@ -1137,6 +1195,16 @@ void DrawInfoScreen_HelpText(int element, int action, int direction, int ypos) max_chars_per_line, max_lines_per_text); } +void DrawInfoScreen_TitleScreen() +{ + DrawTitleScreen(); +} + +void HandleInfoScreen_TitleScreen(int button) +{ + HandleTitleScreen(0, 0, 0, 0, button); +} + void DrawInfoScreen_Elements() { SetMainBackgroundImageIfDefined(IMG_BACKGROUND_INFO_ELEMENTS); @@ -1345,49 +1413,213 @@ void HandleInfoScreen_Music(int button) PlaySoundLoop(list->music); } -void DrawInfoScreen_Credits() +static boolean DrawInfoScreen_CreditsScreen(int screen_nr) { int ystart = 150, ystep = 30; int ybottom = SYSIZE - 20; - SetMainBackgroundImageIfDefined(IMG_BACKGROUND_INFO_CREDITS); - - FadeSoundsAndMusic(); - ClearWindow(); DrawHeadline(); DrawTextSCentered(100, FONT_TEXT_1, "Credits:"); - DrawTextSCentered(ystart + 0 * ystep, FONT_TEXT_2, "DOS port of the game:"); - DrawTextSCentered(ystart + 1 * ystep, FONT_TEXT_3, "Guido Schulz"); - DrawTextSCentered(ystart + 2 * ystep, FONT_TEXT_2, "Additional toons:"); - DrawTextSCentered(ystart + 3 * ystep, FONT_TEXT_3, "Karl Hörnell"); - DrawTextSCentered(ystart + 5 * ystep, FONT_TEXT_2, - "...and many thanks to all contributors"); - DrawTextSCentered(ystart + 6 * ystep, FONT_TEXT_2, "of new levels!"); + + if (screen_nr == 0) + { + DrawTextSCentered(ystart + 0 * ystep, FONT_TEXT_2, + "Special thanks to"); + DrawTextSCentered(ystart + 1 * ystep, FONT_TEXT_3, + "Peter Liepa"); + DrawTextSCentered(ystart + 2 * ystep, FONT_TEXT_2, + "for creating"); + DrawTextSCentered(ystart + 3 * ystep, FONT_TEXT_3, + "\"Boulder Dash\""); + DrawTextSCentered(ystart + 4 * ystep, FONT_TEXT_2, + "in the year"); + DrawTextSCentered(ystart + 5 * ystep, FONT_TEXT_3, + "1984"); + DrawTextSCentered(ystart + 6 * ystep, FONT_TEXT_2, + "published by"); + DrawTextSCentered(ystart + 7 * ystep, FONT_TEXT_3, + "First Star Software"); + } + else if (screen_nr == 1) + { + DrawTextSCentered(ystart + 0 * ystep, FONT_TEXT_2, + "Special thanks to"); + DrawTextSCentered(ystart + 1 * ystep, FONT_TEXT_3, + "Klaus Heinz & Volker Wertich"); + DrawTextSCentered(ystart + 2 * ystep, FONT_TEXT_2, + "for creating"); + DrawTextSCentered(ystart + 3 * ystep, FONT_TEXT_3, + "\"Emerald Mine\""); + DrawTextSCentered(ystart + 4 * ystep, FONT_TEXT_2, + "in the year"); + DrawTextSCentered(ystart + 5 * ystep, FONT_TEXT_3, + "1987"); + DrawTextSCentered(ystart + 6 * ystep, FONT_TEXT_2, + "published by"); + DrawTextSCentered(ystart + 7 * ystep, FONT_TEXT_3, + "Kingsoft"); + } + else if (screen_nr == 2) + { + DrawTextSCentered(ystart + 0 * ystep, FONT_TEXT_2, + "Special thanks to"); + DrawTextSCentered(ystart + 1 * ystep, FONT_TEXT_3, + "Michael Stopp & Philip Jespersen"); + DrawTextSCentered(ystart + 2 * ystep, FONT_TEXT_2, + "for creating"); + DrawTextSCentered(ystart + 3 * ystep, FONT_TEXT_3, + "\"Supaplex\""); + DrawTextSCentered(ystart + 4 * ystep, FONT_TEXT_2, + "in the year"); + DrawTextSCentered(ystart + 5 * ystep, FONT_TEXT_3, + "1991"); + DrawTextSCentered(ystart + 6 * ystep, FONT_TEXT_2, + "published by"); + DrawTextSCentered(ystart + 7 * ystep, FONT_TEXT_3, + "Digital Integration"); + } + else if (screen_nr == 3) + { + DrawTextSCentered(ystart + 0 * ystep, FONT_TEXT_2, + "Special thanks to"); + DrawTextSCentered(ystart + 1 * ystep, FONT_TEXT_3, + "Hiroyuki Imabayashi"); + DrawTextSCentered(ystart + 2 * ystep, FONT_TEXT_2, + "for creating"); + DrawTextSCentered(ystart + 3 * ystep, FONT_TEXT_3, + "\"Sokoban\""); + DrawTextSCentered(ystart + 4 * ystep, FONT_TEXT_2, + "in the year"); + DrawTextSCentered(ystart + 5 * ystep, FONT_TEXT_3, + "1982"); + DrawTextSCentered(ystart + 6 * ystep, FONT_TEXT_2, + "published by"); + DrawTextSCentered(ystart + 7 * ystep, FONT_TEXT_3, + "Thinking Rabbit"); + } + else if (screen_nr == 4) + { + DrawTextSCentered(ystart + 0 * ystep, FONT_TEXT_2, + "Special thanks to"); + DrawTextSCentered(ystart + 1 * ystep, FONT_TEXT_3, + "Alan Bond"); + DrawTextSCentered(ystart + 2 * ystep, FONT_TEXT_2, + "and"); + DrawTextSCentered(ystart + 3 * ystep, FONT_TEXT_3, + "Jürgen Bonhagen"); + DrawTextSCentered(ystart + 4 * ystep, FONT_TEXT_2, + "for the continuous creation"); + DrawTextSCentered(ystart + 5 * ystep, FONT_TEXT_2, + "of outstanding level sets"); + } + else if (screen_nr == 5) + { + DrawTextSCentered(ystart + 0 * ystep, FONT_TEXT_2, + "Thanks to"); + DrawTextSCentered(ystart + 1 * ystep, FONT_TEXT_3, + "Peter Elzner"); + DrawTextSCentered(ystart + 2 * ystep, FONT_TEXT_2, + "for ideas and inspiration by"); + DrawTextSCentered(ystart + 3 * ystep, FONT_TEXT_3, + "Diamond Caves"); + + DrawTextSCentered(ystart + 5 * ystep, FONT_TEXT_2, + "Thanks to"); + DrawTextSCentered(ystart + 6 * ystep, FONT_TEXT_3, + "Steffest"); + DrawTextSCentered(ystart + 7 * ystep, FONT_TEXT_2, + "for ideas and inspiration by"); + DrawTextSCentered(ystart + 8 * ystep, FONT_TEXT_3, + "DX-Boulderdash"); + } + else if (screen_nr == 6) + { + DrawTextSCentered(ystart + 0 * ystep, FONT_TEXT_2, + "Thanks to"); + DrawTextSCentered(ystart + 1 * ystep, FONT_TEXT_3, + "David Tritscher"); + DrawTextSCentered(ystart + 2 * ystep, FONT_TEXT_2, + "for the new Emerald Mine engine"); + } + else if (screen_nr == 7) + { + DrawTextSCentered(ystart + 0 * ystep, FONT_TEXT_2, + "Thanks to"); + DrawTextSCentered(ystart + 1 * ystep, FONT_TEXT_3, + "Guido Schulz"); + DrawTextSCentered(ystart + 2 * ystep, FONT_TEXT_2, + "for the initial DOS port"); + + DrawTextSCentered(ystart + 4 * ystep, FONT_TEXT_2, + "Thanks to"); + DrawTextSCentered(ystart + 5 * ystep, FONT_TEXT_3, + "Karl Hörnell"); + DrawTextSCentered(ystart + 6 * ystep, FONT_TEXT_2, + "for some additional toons"); + } + else if (screen_nr == 8) + { + DrawTextSCentered(ystart + 0 * ystep, FONT_TEXT_2, + "And not to forget:"); + DrawTextSCentered(ystart + 1 * ystep, FONT_TEXT_2, + "Many thanks to"); + DrawTextSCentered(ystart + 2 * ystep, FONT_TEXT_3, + "All those who contributed"); + DrawTextSCentered(ystart + 3 * ystep, FONT_TEXT_3, + "levels to this game"); + DrawTextSCentered(ystart + 4 * ystep, FONT_TEXT_3, + "since 1995"); + } + else + { + return FALSE; + } DrawTextSCentered(ybottom, FONT_TEXT_4, - "Press any key or button for info menu"); + "Press any key or button for next page"); + + return TRUE; +} + +void DrawInfoScreen_Credits() +{ + SetMainBackgroundImageIfDefined(IMG_BACKGROUND_INFO_CREDITS); + + FadeSoundsAndMusic(); + + HandleInfoScreen_Credits(MB_MENU_INITIALIZE); } void HandleInfoScreen_Credits(int button) { - int button_released = !button; + static int screen_nr = 0; - if (button == MB_MENU_LEAVE) + if (button == MB_MENU_INITIALIZE) + { + screen_nr = 0; + + DrawInfoScreen_CreditsScreen(screen_nr); + } + else if (button == MB_MENU_LEAVE) { info_mode = INFO_MODE_MAIN; DrawInfoScreen(); return; } - - if (button_released) + else if (button == MB_MENU_CHOICE) { - FadeSoundsAndMusic(); + screen_nr++; - info_mode = INFO_MODE_MAIN; - DrawInfoScreen(); + if (!DrawInfoScreen_CreditsScreen(screen_nr)) + { + FadeSoundsAndMusic(); + + info_mode = INFO_MODE_MAIN; + DrawInfoScreen(); + } } else { @@ -1518,11 +1750,13 @@ void HandleInfoScreen_LevelSet(int button) } } -void DrawInfoScreen() +static void DrawInfoScreenExt(int fade_delay) { SetMainBackgroundImage(IMG_BACKGROUND_INFO); - if (info_mode == INFO_MODE_ELEMENTS) + if (info_mode == INFO_MODE_TITLESCREEN) + DrawInfoScreen_TitleScreen(); + else if (info_mode == INFO_MODE_ELEMENTS) DrawInfoScreen_Elements(); else if (info_mode == INFO_MODE_MUSIC) DrawInfoScreen_Music(); @@ -1533,7 +1767,7 @@ void DrawInfoScreen() else if (info_mode == INFO_MODE_LEVELSET) DrawInfoScreen_LevelSet(); else - DrawInfoScreen_Main(); + DrawInfoScreen_Main(fade_delay); if (info_mode != INFO_MODE_MUSIC) { @@ -1542,9 +1776,16 @@ void DrawInfoScreen() } } +void DrawInfoScreen() +{ + DrawInfoScreenExt(0); +} + void HandleInfoScreen(int mx, int my, int dx, int dy, int button) { - if (info_mode == INFO_MODE_ELEMENTS) + if (info_mode == INFO_MODE_TITLESCREEN) + HandleInfoScreen_TitleScreen(button); + else if (info_mode == INFO_MODE_ELEMENTS) HandleInfoScreen_Elements(button); else if (info_mode == INFO_MODE_MUSIC) HandleInfoScreen_Music(button);