From eb09b9aa5521e286723c668030825cd0e3470c3c Mon Sep 17 00:00:00 2001 From: Holger Schemel Date: Sun, 18 Mar 2007 20:14:57 +0100 Subject: [PATCH] rnd-20070318-2-src * added configurability of graphics, sounds and music for title screens --- ChangeLog | 3 ++ src/conf_g2m.c | 88 +++++++++++++++++++++++++++++++++++++---- src/conf_g2s.c | 48 ++++++++++------------- src/conf_gfx.c | 84 ++++++++++++++++++++++++++++++--------- src/conf_gfx.h | 84 +++++++++++++++++++++++---------------- src/conf_mus.c | 42 ++++++++++---------- src/conf_mus.h | 56 +++++++++++++------------- src/conf_snd.c | 42 ++++++++++---------- src/conf_snd.h | 56 +++++++++++++------------- src/conf_var.c | 104 +++++++++++++++++++++++++++++++++++++++++++++++++ src/conftime.h | 2 +- src/files.c | 95 ++++++++++++++++++++++++++++++++++++-------- src/init.c | 2 - src/main.c | 4 +- src/main.h | 54 +++++++++++++------------ src/screens.c | 58 ++++++++++++++++++--------- 16 files changed, 565 insertions(+), 257 deletions(-) diff --git a/ChangeLog b/ChangeLog index 5b5d2656..5a20b4ec 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,6 @@ +2007-03-18 + * added configurability of graphics, sounds and music for title screens + 2007-03-14 * added full configurability of "readme.txt" screen appearance: - readme.x: diff --git a/src/conf_g2m.c b/src/conf_g2m.c index 754145b8..0286002b 100644 --- a/src/conf_g2m.c +++ b/src/conf_g2m.c @@ -38,14 +38,6 @@ gamemode_to_music[] = GFX_SPECIAL_ARG_TITLE, MUS_BACKGROUND_TITLE }, - { - GFX_SPECIAL_ARG_MESSAGE_INITIAL, - MUS_BACKGROUND_MESSAGE_INITIAL - }, - { - GFX_SPECIAL_ARG_MESSAGE, - MUS_BACKGROUND_MESSAGE - }, { GFX_SPECIAL_ARG_MAIN, MUS_BACKGROUND_MAIN @@ -70,6 +62,86 @@ gamemode_to_music[] = GFX_SPECIAL_ARG_SETUP, MUS_BACKGROUND_SETUP }, + { + -1, + MUS_BACKGROUND_TITLESCREEN_INITIAL_1 + }, + { + -1, + MUS_BACKGROUND_TITLESCREEN_INITIAL_2 + }, + { + -1, + MUS_BACKGROUND_TITLESCREEN_INITIAL_3 + }, + { + -1, + MUS_BACKGROUND_TITLESCREEN_INITIAL_4 + }, + { + -1, + MUS_BACKGROUND_TITLESCREEN_INITIAL_5 + }, + { + -1, + MUS_BACKGROUND_TITLESCREEN_1 + }, + { + -1, + MUS_BACKGROUND_TITLESCREEN_2 + }, + { + -1, + MUS_BACKGROUND_TITLESCREEN_3 + }, + { + -1, + MUS_BACKGROUND_TITLESCREEN_4 + }, + { + -1, + MUS_BACKGROUND_TITLESCREEN_5 + }, + { + -1, + MUS_BACKGROUND_TITLEMESSAGE_INITIAL_1 + }, + { + -1, + MUS_BACKGROUND_TITLEMESSAGE_INITIAL_2 + }, + { + -1, + MUS_BACKGROUND_TITLEMESSAGE_INITIAL_3 + }, + { + -1, + MUS_BACKGROUND_TITLEMESSAGE_INITIAL_4 + }, + { + -1, + MUS_BACKGROUND_TITLEMESSAGE_INITIAL_5 + }, + { + -1, + MUS_BACKGROUND_TITLEMESSAGE_1 + }, + { + -1, + MUS_BACKGROUND_TITLEMESSAGE_2 + }, + { + -1, + MUS_BACKGROUND_TITLEMESSAGE_3 + }, + { + -1, + MUS_BACKGROUND_TITLEMESSAGE_4 + }, + { + -1, + MUS_BACKGROUND_TITLEMESSAGE_5 + }, { -1, -1 diff --git a/src/conf_g2s.c b/src/conf_g2s.c index 6f9ba392..41b7296f 100644 --- a/src/conf_g2s.c +++ b/src/conf_g2s.c @@ -34,14 +34,6 @@ gamemode_to_sound[] = GFX_SPECIAL_ARG_TITLE, SND_BACKGROUND_TITLE }, - { - GFX_SPECIAL_ARG_MESSAGE_INITIAL, - SND_BACKGROUND_MESSAGE_INITIAL - }, - { - GFX_SPECIAL_ARG_MESSAGE, - SND_BACKGROUND_MESSAGE - }, { GFX_SPECIAL_ARG_MAIN, SND_BACKGROUND_MAIN @@ -68,83 +60,83 @@ gamemode_to_sound[] = }, { -1, - SND_TITLESCREEN_INITIAL_1 + SND_BACKGROUND_TITLESCREEN_INITIAL_1 }, { -1, - SND_TITLESCREEN_INITIAL_2 + SND_BACKGROUND_TITLESCREEN_INITIAL_2 }, { -1, - SND_TITLESCREEN_INITIAL_3 + SND_BACKGROUND_TITLESCREEN_INITIAL_3 }, { -1, - SND_TITLESCREEN_INITIAL_4 + SND_BACKGROUND_TITLESCREEN_INITIAL_4 }, { -1, - SND_TITLESCREEN_INITIAL_5 + SND_BACKGROUND_TITLESCREEN_INITIAL_5 }, { -1, - SND_TITLESCREEN_1 + SND_BACKGROUND_TITLESCREEN_1 }, { -1, - SND_TITLESCREEN_2 + SND_BACKGROUND_TITLESCREEN_2 }, { -1, - SND_TITLESCREEN_3 + SND_BACKGROUND_TITLESCREEN_3 }, { -1, - SND_TITLESCREEN_4 + SND_BACKGROUND_TITLESCREEN_4 }, { -1, - SND_TITLESCREEN_5 + SND_BACKGROUND_TITLESCREEN_5 }, { -1, - SND_TITLEMESSAGE_INITIAL_1 + SND_BACKGROUND_TITLEMESSAGE_INITIAL_1 }, { -1, - SND_TITLEMESSAGE_INITIAL_2 + SND_BACKGROUND_TITLEMESSAGE_INITIAL_2 }, { -1, - SND_TITLEMESSAGE_INITIAL_3 + SND_BACKGROUND_TITLEMESSAGE_INITIAL_3 }, { -1, - SND_TITLEMESSAGE_INITIAL_4 + SND_BACKGROUND_TITLEMESSAGE_INITIAL_4 }, { -1, - SND_TITLEMESSAGE_INITIAL_5 + SND_BACKGROUND_TITLEMESSAGE_INITIAL_5 }, { -1, - SND_TITLEMESSAGE_1 + SND_BACKGROUND_TITLEMESSAGE_1 }, { -1, - SND_TITLEMESSAGE_2 + SND_BACKGROUND_TITLEMESSAGE_2 }, { -1, - SND_TITLEMESSAGE_3 + SND_BACKGROUND_TITLEMESSAGE_3 }, { -1, - SND_TITLEMESSAGE_4 + SND_BACKGROUND_TITLEMESSAGE_4 }, { -1, - SND_TITLEMESSAGE_5 + SND_BACKGROUND_TITLEMESSAGE_5 }, { -1, diff --git a/src/conf_gfx.c b/src/conf_gfx.c index 7b2b9190..2782ed7d 100644 --- a/src/conf_gfx.c +++ b/src/conf_gfx.c @@ -4897,6 +4897,44 @@ struct ConfigInfo image_config[] = { "editor.cascade_list.active.y", "80" }, { "editor.cascade_list.active.frames", "1" }, + { "background", UNDEFINED_FILENAME }, + { "background.TITLE_INITIAL", UNDEFINED_FILENAME }, + { "background.TITLE", UNDEFINED_FILENAME }, + { "background.MAIN", UNDEFINED_FILENAME }, + { "background.LEVELS", UNDEFINED_FILENAME }, + { "background.SCORES", UNDEFINED_FILENAME }, + { "background.EDITOR", UNDEFINED_FILENAME }, + { "background.INFO", UNDEFINED_FILENAME }, + { "background.INFO[ELEMENTS]", UNDEFINED_FILENAME }, + { "background.INFO[MUSIC]", UNDEFINED_FILENAME }, + { "background.INFO[CREDITS]", UNDEFINED_FILENAME }, + { "background.INFO[PROGRAM]", UNDEFINED_FILENAME }, + { "background.INFO[VERSION]", UNDEFINED_FILENAME }, + { "background.INFO[LEVELSET]", UNDEFINED_FILENAME }, + { "background.SETUP", UNDEFINED_FILENAME }, + { "background.DOOR", UNDEFINED_FILENAME }, + + { "background.titlescreen_initial_1", UNDEFINED_FILENAME }, + { "background.titlescreen_initial_2", UNDEFINED_FILENAME }, + { "background.titlescreen_initial_3", UNDEFINED_FILENAME }, + { "background.titlescreen_initial_4", UNDEFINED_FILENAME }, + { "background.titlescreen_initial_5", UNDEFINED_FILENAME }, + { "background.titlescreen_1", UNDEFINED_FILENAME }, + { "background.titlescreen_2", UNDEFINED_FILENAME }, + { "background.titlescreen_3", UNDEFINED_FILENAME }, + { "background.titlescreen_4", UNDEFINED_FILENAME }, + { "background.titlescreen_5", UNDEFINED_FILENAME }, + { "background.titlemessage_initial_1", UNDEFINED_FILENAME }, + { "background.titlemessage_initial_2", UNDEFINED_FILENAME }, + { "background.titlemessage_initial_3", UNDEFINED_FILENAME }, + { "background.titlemessage_initial_4", UNDEFINED_FILENAME }, + { "background.titlemessage_initial_5", UNDEFINED_FILENAME }, + { "background.titlemessage_1", UNDEFINED_FILENAME }, + { "background.titlemessage_2", UNDEFINED_FILENAME }, + { "background.titlemessage_3", UNDEFINED_FILENAME }, + { "background.titlemessage_4", UNDEFINED_FILENAME }, + { "background.titlemessage_5", UNDEFINED_FILENAME }, + { "background.envelope_1", "RocksScreen.pcx" }, { "background.envelope_1.x", "0" }, { "background.envelope_1.y", "0" }, @@ -4926,25 +4964,6 @@ struct ConfigInfo image_config[] = { "background.envelope_4.anim_mode", "default" }, { "background.envelope_4.draw_masked", "false" }, - { "background", UNDEFINED_FILENAME }, - { "background.TITLE_INITIAL", UNDEFINED_FILENAME }, - { "background.TITLE", UNDEFINED_FILENAME }, - { "background.MESSAGE_INITIAL", UNDEFINED_FILENAME }, - { "background.MESSAGE", UNDEFINED_FILENAME }, - { "background.MAIN", UNDEFINED_FILENAME }, - { "background.LEVELS", UNDEFINED_FILENAME }, - { "background.SCORES", UNDEFINED_FILENAME }, - { "background.EDITOR", UNDEFINED_FILENAME }, - { "background.INFO", UNDEFINED_FILENAME }, - { "background.INFO[ELEMENTS]", UNDEFINED_FILENAME }, - { "background.INFO[MUSIC]", UNDEFINED_FILENAME }, - { "background.INFO[CREDITS]", UNDEFINED_FILENAME }, - { "background.INFO[PROGRAM]", UNDEFINED_FILENAME }, - { "background.INFO[VERSION]", UNDEFINED_FILENAME }, - { "background.INFO[LEVELSET]", UNDEFINED_FILENAME }, - { "background.SETUP", UNDEFINED_FILENAME }, - { "background.DOOR", UNDEFINED_FILENAME }, - { "titlescreen_initial_1", UNDEFINED_FILENAME }, { "titlescreen_initial_2", UNDEFINED_FILENAME }, { "titlescreen_initial_3", UNDEFINED_FILENAME }, @@ -4961,6 +4980,33 @@ struct ConfigInfo image_config[] = /* keyword to start parser: "CONFIG_VARS_START" <-- do not change! */ + { "[titlemessage_initial].x", "336" }, + { "[titlemessage_initial].y", "280" }, + { "[titlemessage_initial].width", "640" }, + { "[titlemessage_initial].height", "512" }, + { "[titlemessage_initial].chars", "-1" }, + { "[titlemessage_initial].lines", "-1" }, + { "[titlemessage_initial].align", "center" }, + { "[titlemessage_initial].valign", "middle" }, + { "[titlemessage_initial].font", "font.text_1" }, + { "[titlemessage_initial].autowrap", "false" }, + { "[titlemessage_initial].centered", "false" }, + { "[titlemessage_initial].skip_comments", "false" }, + { "[titlemessage_initial].sort_priority", "0" }, + { "[titlemessage].x", "336" }, + { "[titlemessage].y", "280" }, + { "[titlemessage].width", "640" }, + { "[titlemessage].height", "512" }, + { "[titlemessage].chars", "-1" }, + { "[titlemessage].lines", "-1" }, + { "[titlemessage].align", "center" }, + { "[titlemessage].valign", "middle" }, + { "[titlemessage].font", "font.text_1" }, + { "[titlemessage].autowrap", "false" }, + { "[titlemessage].centered", "false" }, + { "[titlemessage].skip_comments", "false" }, + { "[titlemessage].sort_priority", "0" }, + { "titlemessage_initial_1.x", "336" }, { "titlemessage_initial_1.y", "280" }, { "titlemessage_initial_1.width", "640" }, diff --git a/src/conf_gfx.h b/src/conf_gfx.h index 271c38f0..fe72c69f 100644 --- a/src/conf_gfx.h +++ b/src/conf_gfx.h @@ -1730,39 +1730,57 @@ #define IMG_EDITOR_ELEMENT_BORDER_INPUT 1709 #define IMG_EDITOR_CASCADE_LIST 1710 #define IMG_EDITOR_CASCADE_LIST_ACTIVE 1711 -#define IMG_BACKGROUND_ENVELOPE_1 1712 -#define IMG_BACKGROUND_ENVELOPE_2 1713 -#define IMG_BACKGROUND_ENVELOPE_3 1714 -#define IMG_BACKGROUND_ENVELOPE_4 1715 -#define IMG_BACKGROUND 1716 -#define IMG_BACKGROUND_TITLE_INITIAL 1717 -#define IMG_BACKGROUND_TITLE 1718 -#define IMG_BACKGROUND_MESSAGE_INITIAL 1719 -#define IMG_BACKGROUND_MESSAGE 1720 -#define IMG_BACKGROUND_MAIN 1721 -#define IMG_BACKGROUND_LEVELS 1722 -#define IMG_BACKGROUND_SCORES 1723 -#define IMG_BACKGROUND_EDITOR 1724 -#define IMG_BACKGROUND_INFO 1725 -#define IMG_BACKGROUND_INFO_ELEMENTS 1726 -#define IMG_BACKGROUND_INFO_MUSIC 1727 -#define IMG_BACKGROUND_INFO_CREDITS 1728 -#define IMG_BACKGROUND_INFO_PROGRAM 1729 -#define IMG_BACKGROUND_INFO_VERSION 1730 -#define IMG_BACKGROUND_INFO_LEVELSET 1731 -#define IMG_BACKGROUND_SETUP 1732 -#define IMG_BACKGROUND_DOOR 1733 -#define IMG_TITLESCREEN_INITIAL_1 1734 -#define IMG_TITLESCREEN_INITIAL_2 1735 -#define IMG_TITLESCREEN_INITIAL_3 1736 -#define IMG_TITLESCREEN_INITIAL_4 1737 -#define IMG_TITLESCREEN_INITIAL_5 1738 -#define IMG_TITLESCREEN_1 1739 -#define IMG_TITLESCREEN_2 1740 -#define IMG_TITLESCREEN_3 1741 -#define IMG_TITLESCREEN_4 1742 -#define IMG_TITLESCREEN_5 1743 +#define IMG_BACKGROUND 1712 +#define IMG_BACKGROUND_TITLE_INITIAL 1713 +#define IMG_BACKGROUND_TITLE 1714 +#define IMG_BACKGROUND_MAIN 1715 +#define IMG_BACKGROUND_LEVELS 1716 +#define IMG_BACKGROUND_SCORES 1717 +#define IMG_BACKGROUND_EDITOR 1718 +#define IMG_BACKGROUND_INFO 1719 +#define IMG_BACKGROUND_INFO_ELEMENTS 1720 +#define IMG_BACKGROUND_INFO_MUSIC 1721 +#define IMG_BACKGROUND_INFO_CREDITS 1722 +#define IMG_BACKGROUND_INFO_PROGRAM 1723 +#define IMG_BACKGROUND_INFO_VERSION 1724 +#define IMG_BACKGROUND_INFO_LEVELSET 1725 +#define IMG_BACKGROUND_SETUP 1726 +#define IMG_BACKGROUND_DOOR 1727 +#define IMG_BACKGROUND_TITLESCREEN_INITIAL_1 1728 +#define IMG_BACKGROUND_TITLESCREEN_INITIAL_2 1729 +#define IMG_BACKGROUND_TITLESCREEN_INITIAL_3 1730 +#define IMG_BACKGROUND_TITLESCREEN_INITIAL_4 1731 +#define IMG_BACKGROUND_TITLESCREEN_INITIAL_5 1732 +#define IMG_BACKGROUND_TITLESCREEN_1 1733 +#define IMG_BACKGROUND_TITLESCREEN_2 1734 +#define IMG_BACKGROUND_TITLESCREEN_3 1735 +#define IMG_BACKGROUND_TITLESCREEN_4 1736 +#define IMG_BACKGROUND_TITLESCREEN_5 1737 +#define IMG_BACKGROUND_TITLEMESSAGE_INITIAL_1 1738 +#define IMG_BACKGROUND_TITLEMESSAGE_INITIAL_2 1739 +#define IMG_BACKGROUND_TITLEMESSAGE_INITIAL_3 1740 +#define IMG_BACKGROUND_TITLEMESSAGE_INITIAL_4 1741 +#define IMG_BACKGROUND_TITLEMESSAGE_INITIAL_5 1742 +#define IMG_BACKGROUND_TITLEMESSAGE_1 1743 +#define IMG_BACKGROUND_TITLEMESSAGE_2 1744 +#define IMG_BACKGROUND_TITLEMESSAGE_3 1745 +#define IMG_BACKGROUND_TITLEMESSAGE_4 1746 +#define IMG_BACKGROUND_TITLEMESSAGE_5 1747 +#define IMG_BACKGROUND_ENVELOPE_1 1748 +#define IMG_BACKGROUND_ENVELOPE_2 1749 +#define IMG_BACKGROUND_ENVELOPE_3 1750 +#define IMG_BACKGROUND_ENVELOPE_4 1751 +#define IMG_TITLESCREEN_INITIAL_1 1752 +#define IMG_TITLESCREEN_INITIAL_2 1753 +#define IMG_TITLESCREEN_INITIAL_3 1754 +#define IMG_TITLESCREEN_INITIAL_4 1755 +#define IMG_TITLESCREEN_INITIAL_5 1756 +#define IMG_TITLESCREEN_1 1757 +#define IMG_TITLESCREEN_2 1758 +#define IMG_TITLESCREEN_3 1759 +#define IMG_TITLESCREEN_4 1760 +#define IMG_TITLESCREEN_5 1761 -#define NUM_IMAGE_FILES 1744 +#define NUM_IMAGE_FILES 1762 #endif /* CONF_GFX_H */ diff --git a/src/conf_mus.c b/src/conf_mus.c index ac4fa911..934fd825 100644 --- a/src/conf_mus.c +++ b/src/conf_mus.c @@ -31,8 +31,6 @@ struct ConfigInfo music_config[] = { "background", UNDEFINED_FILENAME }, { "background.TITLE_INITIAL", UNDEFINED_FILENAME }, { "background.TITLE", UNDEFINED_FILENAME }, - { "background.MESSAGE_INITIAL", UNDEFINED_FILENAME }, - { "background.MESSAGE", UNDEFINED_FILENAME }, { "background.MAIN", UNDEFINED_FILENAME }, { "background.LEVELS", UNDEFINED_FILENAME }, { "background.SCORES", UNDEFINED_FILENAME }, @@ -40,26 +38,26 @@ struct ConfigInfo music_config[] = { "background.INFO", "rhythmloop.wav" }, { "background.SETUP", UNDEFINED_FILENAME }, - { "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 }, - { "titlescreen_4", UNDEFINED_FILENAME }, - { "titlescreen_5", UNDEFINED_FILENAME }, - { "titlemessage_initial_1", UNDEFINED_FILENAME }, - { "titlemessage_initial_2", UNDEFINED_FILENAME }, - { "titlemessage_initial_3", UNDEFINED_FILENAME }, - { "titlemessage_initial_4", UNDEFINED_FILENAME }, - { "titlemessage_initial_5", UNDEFINED_FILENAME }, - { "titlemessage_1", UNDEFINED_FILENAME }, - { "titlemessage_2", UNDEFINED_FILENAME }, - { "titlemessage_3", UNDEFINED_FILENAME }, - { "titlemessage_4", UNDEFINED_FILENAME }, - { "titlemessage_5", UNDEFINED_FILENAME }, + { "background.titlescreen_initial_1", UNDEFINED_FILENAME }, + { "background.titlescreen_initial_2", UNDEFINED_FILENAME }, + { "background.titlescreen_initial_3", UNDEFINED_FILENAME }, + { "background.titlescreen_initial_4", UNDEFINED_FILENAME }, + { "background.titlescreen_initial_5", UNDEFINED_FILENAME }, + { "background.titlescreen_1", UNDEFINED_FILENAME }, + { "background.titlescreen_2", UNDEFINED_FILENAME }, + { "background.titlescreen_3", UNDEFINED_FILENAME }, + { "background.titlescreen_4", UNDEFINED_FILENAME }, + { "background.titlescreen_5", UNDEFINED_FILENAME }, + { "background.titlemessage_initial_1",UNDEFINED_FILENAME }, + { "background.titlemessage_initial_2",UNDEFINED_FILENAME }, + { "background.titlemessage_initial_3",UNDEFINED_FILENAME }, + { "background.titlemessage_initial_4",UNDEFINED_FILENAME }, + { "background.titlemessage_initial_5",UNDEFINED_FILENAME }, + { "background.titlemessage_1", UNDEFINED_FILENAME }, + { "background.titlemessage_2", UNDEFINED_FILENAME }, + { "background.titlemessage_3", UNDEFINED_FILENAME }, + { "background.titlemessage_4", UNDEFINED_FILENAME }, + { "background.titlemessage_5", UNDEFINED_FILENAME }, /* there is no definition for "background.PLAYING", because this would prevent selecting music from music directory that is not defined in diff --git a/src/conf_mus.h b/src/conf_mus.h index 2ab1461e..1c3c5531 100644 --- a/src/conf_mus.h +++ b/src/conf_mus.h @@ -21,35 +21,33 @@ #define MUS_BACKGROUND 0 #define MUS_BACKGROUND_TITLE_INITIAL 1 #define MUS_BACKGROUND_TITLE 2 -#define MUS_BACKGROUND_MESSAGE_INITIAL 3 -#define MUS_BACKGROUND_MESSAGE 4 -#define MUS_BACKGROUND_MAIN 5 -#define MUS_BACKGROUND_LEVELS 6 -#define MUS_BACKGROUND_SCORES 7 -#define MUS_BACKGROUND_EDITOR 8 -#define MUS_BACKGROUND_INFO 9 -#define MUS_BACKGROUND_SETUP 10 -#define MUS_TITLESCREEN_INITIAL_1 11 -#define MUS_TITLESCREEN_INITIAL_2 12 -#define MUS_TITLESCREEN_INITIAL_3 13 -#define MUS_TITLESCREEN_INITIAL_4 14 -#define MUS_TITLESCREEN_INITIAL_5 15 -#define MUS_TITLESCREEN_1 16 -#define MUS_TITLESCREEN_2 17 -#define MUS_TITLESCREEN_3 18 -#define MUS_TITLESCREEN_4 19 -#define MUS_TITLESCREEN_5 20 -#define MUS_TITLEMESSAGE_INITIAL_1 21 -#define MUS_TITLEMESSAGE_INITIAL_2 22 -#define MUS_TITLEMESSAGE_INITIAL_3 23 -#define MUS_TITLEMESSAGE_INITIAL_4 24 -#define MUS_TITLEMESSAGE_INITIAL_5 25 -#define MUS_TITLEMESSAGE_1 26 -#define MUS_TITLEMESSAGE_2 27 -#define MUS_TITLEMESSAGE_3 28 -#define MUS_TITLEMESSAGE_4 29 -#define MUS_TITLEMESSAGE_5 30 +#define MUS_BACKGROUND_MAIN 3 +#define MUS_BACKGROUND_LEVELS 4 +#define MUS_BACKGROUND_SCORES 5 +#define MUS_BACKGROUND_EDITOR 6 +#define MUS_BACKGROUND_INFO 7 +#define MUS_BACKGROUND_SETUP 8 +#define MUS_BACKGROUND_TITLESCREEN_INITIAL_1 9 +#define MUS_BACKGROUND_TITLESCREEN_INITIAL_2 10 +#define MUS_BACKGROUND_TITLESCREEN_INITIAL_3 11 +#define MUS_BACKGROUND_TITLESCREEN_INITIAL_4 12 +#define MUS_BACKGROUND_TITLESCREEN_INITIAL_5 13 +#define MUS_BACKGROUND_TITLESCREEN_1 14 +#define MUS_BACKGROUND_TITLESCREEN_2 15 +#define MUS_BACKGROUND_TITLESCREEN_3 16 +#define MUS_BACKGROUND_TITLESCREEN_4 17 +#define MUS_BACKGROUND_TITLESCREEN_5 18 +#define MUS_BACKGROUND_TITLEMESSAGE_INITIAL_1 19 +#define MUS_BACKGROUND_TITLEMESSAGE_INITIAL_2 20 +#define MUS_BACKGROUND_TITLEMESSAGE_INITIAL_3 21 +#define MUS_BACKGROUND_TITLEMESSAGE_INITIAL_4 22 +#define MUS_BACKGROUND_TITLEMESSAGE_INITIAL_5 23 +#define MUS_BACKGROUND_TITLEMESSAGE_1 24 +#define MUS_BACKGROUND_TITLEMESSAGE_2 25 +#define MUS_BACKGROUND_TITLEMESSAGE_3 26 +#define MUS_BACKGROUND_TITLEMESSAGE_4 27 +#define MUS_BACKGROUND_TITLEMESSAGE_5 28 -#define NUM_MUSIC_FILES 31 +#define NUM_MUSIC_FILES 29 #endif /* CONF_MUS_H */ diff --git a/src/conf_snd.c b/src/conf_snd.c index ea26f961..763f31d9 100644 --- a/src/conf_snd.c +++ b/src/conf_snd.c @@ -258,8 +258,6 @@ struct ConfigInfo sound_config[] = { "background.TITLE_INITIAL", UNDEFINED_FILENAME }, { "background.TITLE", UNDEFINED_FILENAME }, - { "background.MESSAGE_INITIAL", UNDEFINED_FILENAME }, - { "background.MESSAGE", UNDEFINED_FILENAME }, { "background.MAIN", UNDEFINED_FILENAME }, { "background.LEVELS", UNDEFINED_FILENAME }, { "background.SCORES", "halloffame.wav" }, @@ -268,26 +266,26 @@ struct ConfigInfo sound_config[] = { "background.INFO", UNDEFINED_FILENAME }, { "background.SETUP", UNDEFINED_FILENAME }, - { "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 }, - { "titlescreen_4", UNDEFINED_FILENAME }, - { "titlescreen_5", UNDEFINED_FILENAME }, - { "titlemessage_initial_1", UNDEFINED_FILENAME }, - { "titlemessage_initial_2", UNDEFINED_FILENAME }, - { "titlemessage_initial_3", UNDEFINED_FILENAME }, - { "titlemessage_initial_4", UNDEFINED_FILENAME }, - { "titlemessage_initial_5", UNDEFINED_FILENAME }, - { "titlemessage_1", UNDEFINED_FILENAME }, - { "titlemessage_2", UNDEFINED_FILENAME }, - { "titlemessage_3", UNDEFINED_FILENAME }, - { "titlemessage_4", UNDEFINED_FILENAME }, - { "titlemessage_5", UNDEFINED_FILENAME }, + { "background.titlescreen_initial_1", UNDEFINED_FILENAME }, + { "background.titlescreen_initial_2", UNDEFINED_FILENAME }, + { "background.titlescreen_initial_3", UNDEFINED_FILENAME }, + { "background.titlescreen_initial_4", UNDEFINED_FILENAME }, + { "background.titlescreen_initial_5", UNDEFINED_FILENAME }, + { "background.titlescreen_1", UNDEFINED_FILENAME }, + { "background.titlescreen_2", UNDEFINED_FILENAME }, + { "background.titlescreen_3", UNDEFINED_FILENAME }, + { "background.titlescreen_4", UNDEFINED_FILENAME }, + { "background.titlescreen_5", UNDEFINED_FILENAME }, + { "background.titlemessage_initial_1",UNDEFINED_FILENAME }, + { "background.titlemessage_initial_2",UNDEFINED_FILENAME }, + { "background.titlemessage_initial_3",UNDEFINED_FILENAME }, + { "background.titlemessage_initial_4",UNDEFINED_FILENAME }, + { "background.titlemessage_initial_5",UNDEFINED_FILENAME }, + { "background.titlemessage_1", UNDEFINED_FILENAME }, + { "background.titlemessage_2", UNDEFINED_FILENAME }, + { "background.titlemessage_3", UNDEFINED_FILENAME }, + { "background.titlemessage_4", UNDEFINED_FILENAME }, + { "background.titlemessage_5", UNDEFINED_FILENAME }, #if 0 { "[not used]", "antigrav.wav" }, diff --git a/src/conf_snd.h b/src/conf_snd.h index f6059d73..08fe1a95 100644 --- a/src/conf_snd.h +++ b/src/conf_snd.h @@ -216,35 +216,33 @@ #define SND_MENU_ITEM_SELECTING 195 #define SND_BACKGROUND_TITLE_INITIAL 196 #define SND_BACKGROUND_TITLE 197 -#define SND_BACKGROUND_MESSAGE_INITIAL 198 -#define SND_BACKGROUND_MESSAGE 199 -#define SND_BACKGROUND_MAIN 200 -#define SND_BACKGROUND_LEVELS 201 -#define SND_BACKGROUND_SCORES 202 -#define SND_BACKGROUND_EDITOR 203 -#define SND_BACKGROUND_INFO 204 -#define SND_BACKGROUND_SETUP 205 -#define SND_TITLESCREEN_INITIAL_1 206 -#define SND_TITLESCREEN_INITIAL_2 207 -#define SND_TITLESCREEN_INITIAL_3 208 -#define SND_TITLESCREEN_INITIAL_4 209 -#define SND_TITLESCREEN_INITIAL_5 210 -#define SND_TITLESCREEN_1 211 -#define SND_TITLESCREEN_2 212 -#define SND_TITLESCREEN_3 213 -#define SND_TITLESCREEN_4 214 -#define SND_TITLESCREEN_5 215 -#define SND_TITLEMESSAGE_INITIAL_1 216 -#define SND_TITLEMESSAGE_INITIAL_2 217 -#define SND_TITLEMESSAGE_INITIAL_3 218 -#define SND_TITLEMESSAGE_INITIAL_4 219 -#define SND_TITLEMESSAGE_INITIAL_5 220 -#define SND_TITLEMESSAGE_1 221 -#define SND_TITLEMESSAGE_2 222 -#define SND_TITLEMESSAGE_3 223 -#define SND_TITLEMESSAGE_4 224 -#define SND_TITLEMESSAGE_5 225 +#define SND_BACKGROUND_MAIN 198 +#define SND_BACKGROUND_LEVELS 199 +#define SND_BACKGROUND_SCORES 200 +#define SND_BACKGROUND_EDITOR 201 +#define SND_BACKGROUND_INFO 202 +#define SND_BACKGROUND_SETUP 203 +#define SND_BACKGROUND_TITLESCREEN_INITIAL_1 204 +#define SND_BACKGROUND_TITLESCREEN_INITIAL_2 205 +#define SND_BACKGROUND_TITLESCREEN_INITIAL_3 206 +#define SND_BACKGROUND_TITLESCREEN_INITIAL_4 207 +#define SND_BACKGROUND_TITLESCREEN_INITIAL_5 208 +#define SND_BACKGROUND_TITLESCREEN_1 209 +#define SND_BACKGROUND_TITLESCREEN_2 210 +#define SND_BACKGROUND_TITLESCREEN_3 211 +#define SND_BACKGROUND_TITLESCREEN_4 212 +#define SND_BACKGROUND_TITLESCREEN_5 213 +#define SND_BACKGROUND_TITLEMESSAGE_INITIAL_1 214 +#define SND_BACKGROUND_TITLEMESSAGE_INITIAL_2 215 +#define SND_BACKGROUND_TITLEMESSAGE_INITIAL_3 216 +#define SND_BACKGROUND_TITLEMESSAGE_INITIAL_4 217 +#define SND_BACKGROUND_TITLEMESSAGE_INITIAL_5 218 +#define SND_BACKGROUND_TITLEMESSAGE_1 219 +#define SND_BACKGROUND_TITLEMESSAGE_2 220 +#define SND_BACKGROUND_TITLEMESSAGE_3 221 +#define SND_BACKGROUND_TITLEMESSAGE_4 222 +#define SND_BACKGROUND_TITLEMESSAGE_5 223 -#define NUM_SOUND_FILES 226 +#define NUM_SOUND_FILES 224 #endif /* CONF_SND_H */ diff --git a/src/conf_var.c b/src/conf_var.c index f8ddce17..ed053adf 100644 --- a/src/conf_var.c +++ b/src/conf_var.c @@ -20,6 +20,110 @@ struct TokenIntPtrInfo image_config_vars[] = { + { + "[titlemessage_initial].x", + &titlemessage_initial_default.x + }, + { + "[titlemessage_initial].y", + &titlemessage_initial_default.y + }, + { + "[titlemessage_initial].width", + &titlemessage_initial_default.width + }, + { + "[titlemessage_initial].height", + &titlemessage_initial_default.height + }, + { + "[titlemessage_initial].chars", + &titlemessage_initial_default.chars + }, + { + "[titlemessage_initial].lines", + &titlemessage_initial_default.lines + }, + { + "[titlemessage_initial].align", + &titlemessage_initial_default.align + }, + { + "[titlemessage_initial].valign", + &titlemessage_initial_default.valign + }, + { + "[titlemessage_initial].font", + &titlemessage_initial_default.font + }, + { + "[titlemessage_initial].autowrap", + &titlemessage_initial_default.autowrap + }, + { + "[titlemessage_initial].centered", + &titlemessage_initial_default.centered + }, + { + "[titlemessage_initial].skip_comments", + &titlemessage_initial_default.skip_comments + }, + { + "[titlemessage_initial].sort_priority", + &titlemessage_initial_default.sort_priority + }, + { + "[titlemessage].x", + &titlemessage_default.x + }, + { + "[titlemessage].y", + &titlemessage_default.y + }, + { + "[titlemessage].width", + &titlemessage_default.width + }, + { + "[titlemessage].height", + &titlemessage_default.height + }, + { + "[titlemessage].chars", + &titlemessage_default.chars + }, + { + "[titlemessage].lines", + &titlemessage_default.lines + }, + { + "[titlemessage].align", + &titlemessage_default.align + }, + { + "[titlemessage].valign", + &titlemessage_default.valign + }, + { + "[titlemessage].font", + &titlemessage_default.font + }, + { + "[titlemessage].autowrap", + &titlemessage_default.autowrap + }, + { + "[titlemessage].centered", + &titlemessage_default.centered + }, + { + "[titlemessage].skip_comments", + &titlemessage_default.skip_comments + }, + { + "[titlemessage].sort_priority", + &titlemessage_default.sort_priority + }, { "titlemessage_initial_1.x", &titlemessage_initial[0].x diff --git a/src/conftime.h b/src/conftime.h index cdb199ce..ad38c00e 100644 --- a/src/conftime.h +++ b/src/conftime.h @@ -1 +1 @@ -#define COMPILE_DATE_STRING "2007-03-17 21:32" +#define COMPILE_DATE_STRING "2007-03-18 20:13" diff --git a/src/files.c b/src/files.c index 979bd4f6..a0389f43 100644 --- a/src/files.c +++ b/src/files.c @@ -8350,8 +8350,39 @@ static int get_token_parameter_value(char *token, char *value_raw) static void LoadSpecialMenuDesignSettingsFromFilename(char *filename) { + static struct TitleMessageInfo tmi; + static struct TokenInfo titlemessage_tokens[] = + { + { TYPE_INTEGER, &tmi.x, ".x" }, + { TYPE_INTEGER, &tmi.y, ".y" }, + { TYPE_INTEGER, &tmi.width, ".width" }, + { TYPE_INTEGER, &tmi.height, ".height" }, + { TYPE_INTEGER, &tmi.chars, ".chars" }, + { TYPE_INTEGER, &tmi.lines, ".lines" }, + { TYPE_INTEGER, &tmi.align, ".align" }, + { TYPE_INTEGER, &tmi.valign, ".valign" }, + { TYPE_INTEGER, &tmi.font, ".font" }, + { TYPE_BOOLEAN, &tmi.autowrap, ".autowrap" }, + { TYPE_BOOLEAN, &tmi.centered, ".centered" }, + { TYPE_BOOLEAN, &tmi.skip_comments, ".skip_comments" }, + { TYPE_INTEGER, &tmi.sort_priority, ".sort_priority" }, + + { -1, NULL, NULL } + }; + static struct + { + struct TitleMessageInfo *array; + char *text; + } + titlemessage_arrays[] = + { + { titlemessage_initial, "[titlemessage_initial]" }, + { titlemessage, "[titlemessage]" }, + + { NULL, NULL } + }; SetupFileHash *setup_file_hash; - int i; + int i, j, k; #if 0 printf("LoadSpecialMenuDesignSettings from file '%s' ...\n", filename); @@ -8363,28 +8394,60 @@ static void LoadSpecialMenuDesignSettingsFromFilename(char *filename) /* special case: initialize with default values that may be overwritten */ for (i = 0; i < NUM_SPECIAL_GFX_ARGS; i++) { - char *value_x = getHashEntry(setup_file_hash, "menu.draw_xoffset"); - char *value_y = getHashEntry(setup_file_hash, "menu.draw_yoffset"); - char *list_size = getHashEntry(setup_file_hash, "menu.list_size"); + char *value_1 = getHashEntry(setup_file_hash, "menu.draw_xoffset"); + char *value_2 = getHashEntry(setup_file_hash, "menu.draw_yoffset"); + char *value_3 = getHashEntry(setup_file_hash, "menu.list_size"); - if (value_x != NULL) - menu.draw_xoffset[i] = get_integer_from_string(value_x); - if (value_y != NULL) - menu.draw_yoffset[i] = get_integer_from_string(value_y); - if (list_size != NULL) - menu.list_size[i] = get_integer_from_string(list_size); + if (value_1 != NULL) + menu.draw_xoffset[i] = get_integer_from_string(value_1); + if (value_2 != NULL) + menu.draw_yoffset[i] = get_integer_from_string(value_2); + if (value_3 != NULL) + menu.list_size[i] = get_integer_from_string(value_3); } /* special case: initialize with default values that may be overwritten */ for (i = 0; i < NUM_SPECIAL_GFX_INFO_ARGS; i++) { - char *value_x = getHashEntry(setup_file_hash, "menu.draw_xoffset.INFO"); - char *value_y = getHashEntry(setup_file_hash, "menu.draw_yoffset.INFO"); + char *value_1 = getHashEntry(setup_file_hash, "menu.draw_xoffset.INFO"); + char *value_2 = getHashEntry(setup_file_hash, "menu.draw_yoffset.INFO"); + + if (value_1 != NULL) + menu.draw_xoffset_info[i] = get_integer_from_string(value_1); + if (value_2 != NULL) + menu.draw_yoffset_info[i] = get_integer_from_string(value_2); + } + + /* special case: initialize with default values that may be overwritten */ + for (i = 0; titlemessage_arrays[i].array != NULL; i++) + { + struct TitleMessageInfo *array = titlemessage_arrays[i].array; + char *base_token = titlemessage_arrays[i].text; - if (value_x != NULL) - menu.draw_xoffset_info[i] = get_integer_from_string(value_x); - if (value_y != NULL) - menu.draw_yoffset_info[i] = get_integer_from_string(value_y); + for (j = 0; titlemessage_tokens[j].type != -1; j++) + { + char *token = getStringCat2(base_token, titlemessage_tokens[j].text); + char *value = getHashEntry(setup_file_hash, token); + + if (value != NULL) + { + int parameter_value = get_token_parameter_value(token, value); + + for (k = 0; k < MAX_NUM_TITLE_MESSAGES; k++) + { + tmi = array[k]; + + if (titlemessage_tokens[j].type == TYPE_INTEGER) + *(boolean *)titlemessage_tokens[j].value = (boolean)parameter_value; + else + *(int *)titlemessage_tokens[j].value = (int)parameter_value; + + array[k] = tmi; + } + } + + free(token); + } } /* read (and overwrite with) values that may be specified in config file */ diff --git a/src/init.c b/src/init.c index 7ec7446a..cb5e0661 100644 --- a/src/init.c +++ b/src/init.c @@ -1290,8 +1290,6 @@ static void InitGraphicInfo() IMG_BACKGROUND, IMG_BACKGROUND_TITLE_INITIAL, IMG_BACKGROUND_TITLE, - IMG_BACKGROUND_MESSAGE_INITIAL, - IMG_BACKGROUND_MESSAGE, IMG_BACKGROUND_MAIN, IMG_BACKGROUND_LEVELS, IMG_BACKGROUND_SCORES, diff --git a/src/main.c b/src/main.c index f49c8c6b..4640ac83 100644 --- a/src/main.c +++ b/src/main.c @@ -107,7 +107,9 @@ struct GameInfo game; struct GlobalInfo global; struct BorderInfo border; struct TitleInfo title; +struct TitleMessageInfo titlemessage_initial_default; struct TitleMessageInfo titlemessage_initial[MAX_NUM_TITLE_MESSAGES]; +struct TitleMessageInfo titlemessage_default; struct TitleMessageInfo titlemessage[MAX_NUM_TITLE_MESSAGES]; struct TitleMessageInfo readme; struct MenuInfo menu; @@ -5364,8 +5366,6 @@ struct SpecialSuffixInfo special_suffix_info[NUM_SPECIAL_GFX_ARGS + 1 + 1] = { ".[DEFAULT]", GFX_SPECIAL_ARG_DEFAULT, }, { ".TITLE_INITIAL", GFX_SPECIAL_ARG_TITLE_INITIAL, }, { ".TITLE", GFX_SPECIAL_ARG_TITLE, }, - { ".MESSAGE_INITIAL", GFX_SPECIAL_ARG_MESSAGE_INITIAL, }, - { ".MESSAGE", GFX_SPECIAL_ARG_MESSAGE, }, { ".MAIN", GFX_SPECIAL_ARG_MAIN, }, { ".LEVELS", GFX_SPECIAL_ARG_LEVELS }, { ".SCORES", GFX_SPECIAL_ARG_SCORES, }, diff --git a/src/main.h b/src/main.h index 29858c32..a0aec463 100644 --- a/src/main.h +++ b/src/main.h @@ -1722,20 +1722,18 @@ #define GFX_SPECIAL_ARG_DEFAULT 0 #define GFX_SPECIAL_ARG_TITLE_INITIAL 1 #define GFX_SPECIAL_ARG_TITLE 2 -#define GFX_SPECIAL_ARG_MESSAGE_INITIAL 3 -#define GFX_SPECIAL_ARG_MESSAGE 4 -#define GFX_SPECIAL_ARG_MAIN 5 -#define GFX_SPECIAL_ARG_LEVELS 6 -#define GFX_SPECIAL_ARG_SCORES 7 -#define GFX_SPECIAL_ARG_EDITOR 8 -#define GFX_SPECIAL_ARG_INFO 9 -#define GFX_SPECIAL_ARG_SETUP 10 -#define GFX_SPECIAL_ARG_PLAYING 11 -#define GFX_SPECIAL_ARG_DOOR 12 -#define GFX_SPECIAL_ARG_PREVIEW 13 -#define GFX_SPECIAL_ARG_CRUMBLED 14 - -#define NUM_SPECIAL_GFX_ARGS 15 +#define GFX_SPECIAL_ARG_MAIN 3 +#define GFX_SPECIAL_ARG_LEVELS 4 +#define GFX_SPECIAL_ARG_SCORES 5 +#define GFX_SPECIAL_ARG_EDITOR 6 +#define GFX_SPECIAL_ARG_INFO 7 +#define GFX_SPECIAL_ARG_SETUP 8 +#define GFX_SPECIAL_ARG_PLAYING 9 +#define GFX_SPECIAL_ARG_DOOR 10 +#define GFX_SPECIAL_ARG_PREVIEW 11 +#define GFX_SPECIAL_ARG_CRUMBLED 12 + +#define NUM_SPECIAL_GFX_ARGS 13 /* these additional definitions are currently only used for draw offsets */ #define GFX_SPECIAL_ARG_INFO_MAIN 0 @@ -1873,22 +1871,20 @@ #define GAME_MODE_DEFAULT 0 #define GAME_MODE_TITLE_INITIAL 1 #define GAME_MODE_TITLE 2 -#define GAME_MODE_MESSAGE_INITIAL 3 -#define GAME_MODE_MESSAGE 4 -#define GAME_MODE_MAIN 5 -#define GAME_MODE_LEVELS 6 -#define GAME_MODE_SCORES 7 -#define GAME_MODE_EDITOR 8 -#define GAME_MODE_INFO 9 -#define GAME_MODE_SETUP 10 -#define GAME_MODE_PLAYING 11 -#define GAME_MODE_PSEUDO_DOOR 12 -#define GAME_MODE_PSEUDO_PREVIEW 13 -#define GAME_MODE_PSEUDO_CRUMBLED 14 +#define GAME_MODE_MAIN 3 +#define GAME_MODE_LEVELS 4 +#define GAME_MODE_SCORES 5 +#define GAME_MODE_EDITOR 6 +#define GAME_MODE_INFO 7 +#define GAME_MODE_SETUP 8 +#define GAME_MODE_PLAYING 9 +#define GAME_MODE_PSEUDO_DOOR 10 +#define GAME_MODE_PSEUDO_PREVIEW 11 +#define GAME_MODE_PSEUDO_CRUMBLED 12 /* there are no special config file suffixes for these modes */ -#define GAME_MODE_PSEUDO_TYPENAME 15 -#define GAME_MODE_QUIT 16 +#define GAME_MODE_PSEUDO_TYPENAME 13 +#define GAME_MODE_QUIT 14 /* special definitions currently only used for custom artwork configuration */ #define MUSIC_PREFIX_BACKGROUND 0 @@ -2689,7 +2685,9 @@ extern struct TapeInfo tape; extern struct GlobalInfo global; extern struct BorderInfo border; extern struct TitleInfo title; +extern struct TitleMessageInfo titlemessage_initial_default; extern struct TitleMessageInfo titlemessage_initial[]; +extern struct TitleMessageInfo titlemessage_default; extern struct TitleMessageInfo titlemessage[]; extern struct TitleMessageInfo readme; extern struct MenuInfo menu; diff --git a/src/screens.c b/src/screens.c index 5ae63dad..5c8baa81 100644 --- a/src/screens.c +++ b/src/screens.c @@ -503,28 +503,51 @@ static int getTitleScreenGameMode(boolean initial) static int getTitleMessageGameMode(boolean initial) { - return (initial ? GAME_MODE_MESSAGE_INITIAL : GAME_MODE_MESSAGE); + return (initial ? GAME_MODE_TITLE_INITIAL : GAME_MODE_TITLE); } +#if 0 static int getTitleScreenBackground(boolean initial) { return (initial ? IMG_BACKGROUND_TITLE_INITIAL : IMG_BACKGROUND_TITLE); } +#endif -static int getTitleMessageBackground(boolean initial) +#if 0 +static int getTitleMessageBackground(int nr, boolean initial) { - return (initial ? IMG_BACKGROUND_MESSAGE_INITIAL : IMG_BACKGROUND_MESSAGE); + return (initial ? IMG_BACKGROUND_TITLE_INITIAL : IMG_BACKGROUND_TITLE); } +#endif -static int getTitleSound(int nr, boolean initial, boolean is_image) +static int getTitleBackground(int nr, boolean initial, boolean is_image) { - int mode = (is_image ? - (initial ? GAME_MODE_TITLE_INITIAL : GAME_MODE_TITLE) : - (initial ? GAME_MODE_MESSAGE_INITIAL : GAME_MODE_MESSAGE)); int base = (is_image ? - (initial ? SND_TITLESCREEN_INITIAL_1 : SND_TITLESCREEN_1) : - (initial ? SND_TITLEMESSAGE_INITIAL_1 : SND_TITLEMESSAGE_1)); + (initial ? IMG_BACKGROUND_TITLESCREEN_INITIAL_1 : + IMG_BACKGROUND_TITLESCREEN_1) : + (initial ? IMG_BACKGROUND_TITLEMESSAGE_INITIAL_1 : + IMG_BACKGROUND_TITLEMESSAGE_1)); + int graphic_global = (initial ? IMG_BACKGROUND_TITLE_INITIAL : + IMG_BACKGROUND_TITLE); + int graphic_local = base + nr; + + if (graphic_info[graphic_local].bitmap != NULL) + return graphic_local; + if (graphic_info[graphic_global].bitmap != NULL) + return graphic_global; + + return IMG_UNDEFINED; +} + +static int getTitleSound(int nr, boolean initial, boolean is_image) +{ + int mode = (initial ? GAME_MODE_TITLE_INITIAL : GAME_MODE_TITLE); + int base = (is_image ? + (initial ? SND_BACKGROUND_TITLESCREEN_INITIAL_1 : + SND_BACKGROUND_TITLESCREEN_1) : + (initial ? SND_BACKGROUND_TITLEMESSAGE_INITIAL_1 : + SND_BACKGROUND_TITLEMESSAGE_1)); int sound_global = menu.sound[mode]; int sound_local = base + nr; @@ -546,13 +569,12 @@ static int getTitleSound(int nr, boolean initial, boolean is_image) static int getTitleMusic(int nr, boolean initial, boolean is_image) { - int mode = (is_image ? - (initial ? GAME_MODE_TITLE_INITIAL : GAME_MODE_TITLE) : - (initial ? GAME_MODE_MESSAGE_INITIAL : GAME_MODE_MESSAGE)); + int mode = (initial ? GAME_MODE_TITLE_INITIAL : GAME_MODE_TITLE); int base = (is_image ? - (initial ? MUS_TITLESCREEN_INITIAL_1 : MUS_TITLESCREEN_1) : - (initial ? MUS_TITLEMESSAGE_INITIAL_1 : MUS_TITLEMESSAGE_1)); - + (initial ? MUS_BACKGROUND_TITLESCREEN_INITIAL_1 : + MUS_BACKGROUND_TITLESCREEN_1) : + (initial ? MUS_BACKGROUND_TITLEMESSAGE_INITIAL_1 : + MUS_BACKGROUND_TITLEMESSAGE_1)); int music_global = menu.music[mode]; int music_local = base + nr; @@ -1009,7 +1031,7 @@ void DrawTitleScreenImage(int nr, boolean initial) dst_y = (WIN_YSIZE - height) / 2; SetDrawBackgroundMask(REDRAW_ALL); - SetWindowBackgroundImage(getTitleScreenBackground(initial)); + SetWindowBackgroundImage(getTitleBackground(nr, initial, TRUE)); ClearRectangleOnBackground(drawto, 0, 0, WIN_XSIZE, WIN_YSIZE); @@ -1054,7 +1076,7 @@ void DrawTitleScreenMessage(int nr, boolean initial) if (filename == NULL) return; - /* force MESSAGE font on title message screen */ + /* force TITLE font on title message screen */ game_status = getTitleMessageGameMode(initial); /* if chars set to "-1", automatically determine by text and font width */ @@ -1070,7 +1092,7 @@ void DrawTitleScreenMessage(int nr, boolean initial) tmi->height = tmi->lines * getFontHeight(tmi->font); SetDrawBackgroundMask(REDRAW_ALL); - SetWindowBackgroundImage(getTitleMessageBackground(initial)); + SetWindowBackgroundImage(getTitleBackground(nr, initial, FALSE)); ClearRectangleOnBackground(drawto, 0, 0, WIN_XSIZE, WIN_YSIZE); -- 2.34.1