From: Holger Schemel Date: Sat, 9 Apr 2016 00:34:16 +0000 (+0200) Subject: added support for separate animations for single title screens X-Git-Tag: 4.0.0.0-rc1~9 X-Git-Url: https://git.artsoft.org/?a=commitdiff_plain;h=da028195db34242cd7a82d82de768109963509cb;p=rocksndiamonds.git added support for separate animations for single title screens --- diff --git a/src/cartoons.c b/src/cartoons.c index 9b80de87..c2072a20 100644 --- a/src/cartoons.c +++ b/src/cartoons.c @@ -24,17 +24,27 @@ #define NUM_GLOBAL_ANIM_PARTS_AND_TOONS MAX(NUM_GLOBAL_ANIM_PARTS_ALL, \ NUM_GLOBAL_TOON_PARTS) -#define ANIM_CLASS_BIT_SUBMENU 0 -#define ANIM_CLASS_BIT_MENU 1 -#define ANIM_CLASS_BIT_TOONS 2 +#define ANIM_CLASS_BIT_TITLE_INITIAL 0 +#define ANIM_CLASS_BIT_TITLE 1 +#define ANIM_CLASS_BIT_SUBMENU 2 +#define ANIM_CLASS_BIT_MENU 3 +#define ANIM_CLASS_BIT_TOONS 4 -#define NUM_ANIM_CLASSES 3 +#define NUM_ANIM_CLASSES 5 #define ANIM_CLASS_NONE 0 +#define ANIM_CLASS_TITLE_INITIAL (1 << ANIM_CLASS_BIT_TITLE_INITIAL) +#define ANIM_CLASS_TITLE (1 << ANIM_CLASS_BIT_TITLE) #define ANIM_CLASS_SUBMENU (1 << ANIM_CLASS_BIT_SUBMENU) #define ANIM_CLASS_MENU (1 << ANIM_CLASS_BIT_MENU) #define ANIM_CLASS_TOONS (1 << ANIM_CLASS_BIT_TOONS) +#define ANIM_CLASS_TOONS_MENU (ANIM_CLASS_TOONS | \ + ANIM_CLASS_MENU) + +#define ANIM_CLASS_TOONS_MENU_SUBMENU (ANIM_CLASS_TOONS | \ + ANIM_CLASS_MENU | \ + ANIM_CLASS_SUBMENU) struct GlobalAnimPartControlInfo { @@ -104,14 +114,24 @@ struct GameModeAnimClass int class; } game_mode_anim_classes_list[] = { - { GAME_MODE_LEVELS, ANIM_CLASS_TOONS | ANIM_CLASS_MENU | ANIM_CLASS_SUBMENU }, - { GAME_MODE_LEVELNR,ANIM_CLASS_TOONS | ANIM_CLASS_MENU | ANIM_CLASS_SUBMENU }, - { GAME_MODE_INFO, ANIM_CLASS_TOONS | ANIM_CLASS_MENU | ANIM_CLASS_SUBMENU }, - { GAME_MODE_SETUP, ANIM_CLASS_TOONS | ANIM_CLASS_MENU | ANIM_CLASS_SUBMENU }, - { GAME_MODE_MAIN, ANIM_CLASS_TOONS | ANIM_CLASS_MENU }, - { GAME_MODE_SCORES, ANIM_CLASS_TOONS }, - - { -1, -1 } + { GAME_MODE_TITLE_INITIAL_1, ANIM_CLASS_TITLE_INITIAL }, + { GAME_MODE_TITLE_INITIAL_2, ANIM_CLASS_TITLE_INITIAL }, + { GAME_MODE_TITLE_INITIAL_3, ANIM_CLASS_TITLE_INITIAL }, + { GAME_MODE_TITLE_INITIAL_4, ANIM_CLASS_TITLE_INITIAL }, + { GAME_MODE_TITLE_INITIAL_5, ANIM_CLASS_TITLE_INITIAL }, + { GAME_MODE_TITLE_1, ANIM_CLASS_TITLE }, + { GAME_MODE_TITLE_2, ANIM_CLASS_TITLE }, + { GAME_MODE_TITLE_3, ANIM_CLASS_TITLE }, + { GAME_MODE_TITLE_4, ANIM_CLASS_TITLE }, + { GAME_MODE_TITLE_5, ANIM_CLASS_TITLE }, + { GAME_MODE_LEVELS, ANIM_CLASS_TOONS_MENU_SUBMENU }, + { GAME_MODE_LEVELNR, ANIM_CLASS_TOONS_MENU_SUBMENU }, + { GAME_MODE_INFO, ANIM_CLASS_TOONS_MENU_SUBMENU }, + { GAME_MODE_SETUP, ANIM_CLASS_TOONS_MENU_SUBMENU }, + { GAME_MODE_MAIN, ANIM_CLASS_TOONS_MENU }, + { GAME_MODE_SCORES, ANIM_CLASS_TOONS }, + + { -1, -1 } }; struct AnimClassGameMode @@ -120,11 +140,13 @@ struct AnimClassGameMode int game_mode; } anim_class_game_modes_list[] = { - { ANIM_CLASS_BIT_SUBMENU, GAME_MODE_PSEUDO_SUBMENU }, - { ANIM_CLASS_BIT_MENU, GAME_MODE_PSEUDO_MENU }, - { ANIM_CLASS_BIT_TOONS, GAME_MODE_PSEUDO_TOONS }, + { ANIM_CLASS_BIT_TITLE_INITIAL, GAME_MODE_TITLE_INITIAL }, + { ANIM_CLASS_BIT_TITLE, GAME_MODE_TITLE }, + { ANIM_CLASS_BIT_SUBMENU, GAME_MODE_PSEUDO_SUBMENU }, + { ANIM_CLASS_BIT_MENU, GAME_MODE_PSEUDO_MENU }, + { ANIM_CLASS_BIT_TOONS, GAME_MODE_PSEUDO_TOONS }, - { -1, -1 } + { -1, -1 } }; /* forward declaration for internal use */ diff --git a/src/main.c b/src/main.c index 665504da..71cc74d6 100644 --- a/src/main.c +++ b/src/main.c @@ -5475,7 +5475,17 @@ struct SpecialSuffixInfo special_suffix_info[NUM_SPECIAL_GFX_ARGS + 1 + 1] = { ".[DEFAULT]", GFX_SPECIAL_ARG_DEFAULT, }, { ".LOADING", GFX_SPECIAL_ARG_LOADING, }, { ".TITLE_INITIAL", GFX_SPECIAL_ARG_TITLE_INITIAL, }, + { ".TITLE_INITIAL_1", GFX_SPECIAL_ARG_TITLE_INITIAL_1, }, + { ".TITLE_INITIAL_2", GFX_SPECIAL_ARG_TITLE_INITIAL_2, }, + { ".TITLE_INITIAL_3", GFX_SPECIAL_ARG_TITLE_INITIAL_3, }, + { ".TITLE_INITIAL_4", GFX_SPECIAL_ARG_TITLE_INITIAL_4, }, + { ".TITLE_INITIAL_5", GFX_SPECIAL_ARG_TITLE_INITIAL_5, }, { ".TITLE", GFX_SPECIAL_ARG_TITLE, }, + { ".TITLE_1", GFX_SPECIAL_ARG_TITLE_1, }, + { ".TITLE_2", GFX_SPECIAL_ARG_TITLE_2, }, + { ".TITLE_3", GFX_SPECIAL_ARG_TITLE_3, }, + { ".TITLE_4", GFX_SPECIAL_ARG_TITLE_4, }, + { ".TITLE_5", GFX_SPECIAL_ARG_TITLE_5, }, { ".MAIN", GFX_SPECIAL_ARG_MAIN, }, { ".LEVELS", GFX_SPECIAL_ARG_LEVELS }, { ".LEVELNR", GFX_SPECIAL_ARG_LEVELNR }, diff --git a/src/main.h b/src/main.h index 496bfaab..b0da6fd3 100644 --- a/src/main.h +++ b/src/main.h @@ -1785,28 +1785,38 @@ #define GFX_SPECIAL_ARG_DEFAULT 0 #define GFX_SPECIAL_ARG_LOADING 1 #define GFX_SPECIAL_ARG_TITLE_INITIAL 2 -#define GFX_SPECIAL_ARG_TITLE 3 -#define GFX_SPECIAL_ARG_MAIN 4 -#define GFX_SPECIAL_ARG_LEVELS 5 -#define GFX_SPECIAL_ARG_LEVELNR 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_TAPE 13 -#define GFX_SPECIAL_ARG_PANEL 14 -#define GFX_SPECIAL_ARG_PREVIEW 15 -#define GFX_SPECIAL_ARG_CRUMBLED 16 -#define GFX_SPECIAL_ARG_TYPENAME 17 -#define GFX_SPECIAL_ARG_SUBMENU 18 -#define GFX_SPECIAL_ARG_MENU 19 -#define GFX_SPECIAL_ARG_TOONS 20 -#define GFX_SPECIAL_ARG_FADING 21 -#define GFX_SPECIAL_ARG_QUIT 22 - -#define NUM_SPECIAL_GFX_ARGS 23 +#define GFX_SPECIAL_ARG_TITLE_INITIAL_1 3 +#define GFX_SPECIAL_ARG_TITLE_INITIAL_2 4 +#define GFX_SPECIAL_ARG_TITLE_INITIAL_3 5 +#define GFX_SPECIAL_ARG_TITLE_INITIAL_4 6 +#define GFX_SPECIAL_ARG_TITLE_INITIAL_5 7 +#define GFX_SPECIAL_ARG_TITLE 8 +#define GFX_SPECIAL_ARG_TITLE_1 9 +#define GFX_SPECIAL_ARG_TITLE_2 10 +#define GFX_SPECIAL_ARG_TITLE_3 11 +#define GFX_SPECIAL_ARG_TITLE_4 12 +#define GFX_SPECIAL_ARG_TITLE_5 13 +#define GFX_SPECIAL_ARG_MAIN 14 +#define GFX_SPECIAL_ARG_LEVELS 15 +#define GFX_SPECIAL_ARG_LEVELNR 16 +#define GFX_SPECIAL_ARG_SCORES 17 +#define GFX_SPECIAL_ARG_EDITOR 18 +#define GFX_SPECIAL_ARG_INFO 19 +#define GFX_SPECIAL_ARG_SETUP 20 +#define GFX_SPECIAL_ARG_PLAYING 21 +#define GFX_SPECIAL_ARG_DOOR 22 +#define GFX_SPECIAL_ARG_TAPE 23 +#define GFX_SPECIAL_ARG_PANEL 24 +#define GFX_SPECIAL_ARG_PREVIEW 25 +#define GFX_SPECIAL_ARG_CRUMBLED 26 +#define GFX_SPECIAL_ARG_TYPENAME 27 +#define GFX_SPECIAL_ARG_SUBMENU 28 +#define GFX_SPECIAL_ARG_MENU 29 +#define GFX_SPECIAL_ARG_TOONS 30 +#define GFX_SPECIAL_ARG_FADING 31 +#define GFX_SPECIAL_ARG_QUIT 32 + +#define NUM_SPECIAL_GFX_ARGS 33 /* these additional definitions are currently only used for draw offsets */ #define GFX_SPECIAL_ARG_INFO_MAIN 0 @@ -1992,28 +2002,38 @@ #define GAME_MODE_DEFAULT 0 #define GAME_MODE_LOADING 1 #define GAME_MODE_TITLE_INITIAL 2 -#define GAME_MODE_TITLE 3 -#define GAME_MODE_MAIN 4 -#define GAME_MODE_LEVELS 5 -#define GAME_MODE_LEVELNR 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_TAPE 13 -#define GAME_MODE_PSEUDO_PANEL 14 -#define GAME_MODE_PSEUDO_PREVIEW 15 -#define GAME_MODE_PSEUDO_CRUMBLED 16 -#define GAME_MODE_PSEUDO_TYPENAME 17 -#define GAME_MODE_PSEUDO_SUBMENU 18 -#define GAME_MODE_PSEUDO_MENU 19 -#define GAME_MODE_PSEUDO_TOONS 20 -#define GAME_MODE_PSEUDO_FADING 21 -#define GAME_MODE_QUIT 22 - -#define NUM_GAME_MODES 23 +#define GAME_MODE_TITLE_INITIAL_1 3 +#define GAME_MODE_TITLE_INITIAL_2 4 +#define GAME_MODE_TITLE_INITIAL_3 5 +#define GAME_MODE_TITLE_INITIAL_4 6 +#define GAME_MODE_TITLE_INITIAL_5 7 +#define GAME_MODE_TITLE 8 +#define GAME_MODE_TITLE_1 9 +#define GAME_MODE_TITLE_2 10 +#define GAME_MODE_TITLE_3 11 +#define GAME_MODE_TITLE_4 12 +#define GAME_MODE_TITLE_5 13 +#define GAME_MODE_MAIN 14 +#define GAME_MODE_LEVELS 15 +#define GAME_MODE_LEVELNR 16 +#define GAME_MODE_SCORES 17 +#define GAME_MODE_EDITOR 18 +#define GAME_MODE_INFO 19 +#define GAME_MODE_SETUP 20 +#define GAME_MODE_PLAYING 21 +#define GAME_MODE_PSEUDO_DOOR 22 +#define GAME_MODE_PSEUDO_TAPE 23 +#define GAME_MODE_PSEUDO_PANEL 24 +#define GAME_MODE_PSEUDO_PREVIEW 25 +#define GAME_MODE_PSEUDO_CRUMBLED 26 +#define GAME_MODE_PSEUDO_TYPENAME 27 +#define GAME_MODE_PSEUDO_SUBMENU 28 +#define GAME_MODE_PSEUDO_MENU 29 +#define GAME_MODE_PSEUDO_TOONS 30 +#define GAME_MODE_PSEUDO_FADING 31 +#define GAME_MODE_QUIT 32 + +#define NUM_GAME_MODES 33 /* special definitions currently only used for custom artwork configuration */ #define MUSIC_PREFIX_BACKGROUND 0 diff --git a/src/screens.c b/src/screens.c index b86aa1c9..c01a99d7 100644 --- a/src/screens.c +++ b/src/screens.c @@ -725,6 +725,13 @@ static int getTitleMessageGameMode(boolean initial) return (initial ? GAME_MODE_TITLE_INITIAL : GAME_MODE_TITLE); } +static int getTitleAnimMode(struct TitleControlInfo *tci) +{ + int base = (tci->initial ? GAME_MODE_TITLE_INITIAL_1 : GAME_MODE_TITLE_1); + + return base + tci->local_nr; +} + #if 0 static int getTitleScreenBackground(boolean initial) { @@ -1565,6 +1572,8 @@ void HandleTitleScreen(int mx, int my, int dx, int dy, int button) title_screen_nr = 0; tci = &title_controls[title_screen_nr]; + SetAnimStatus(getTitleAnimMode(tci)); + last_sound = SND_UNDEFINED; last_music = MUS_UNDEFINED; @@ -1645,10 +1654,13 @@ void HandleTitleScreen(int mx, int my, int dx, int dy, int button) } title_screen_nr++; - tci = &title_controls[title_screen_nr]; if (title_screen_nr < num_title_screens) { + tci = &title_controls[title_screen_nr]; + + SetAnimStatus(getTitleAnimMode(tci)); + sound = getTitleSound(tci); music = getTitleMusic(tci);