added support for separate animations for single title screens
authorHolger Schemel <info@artsoft.org>
Sat, 9 Apr 2016 00:34:16 +0000 (02:34 +0200)
committerHolger Schemel <info@artsoft.org>
Sat, 9 Apr 2016 00:34:16 +0000 (02:34 +0200)
src/cartoons.c
src/main.c
src/main.h
src/screens.c

index 9b80de87e3ed2685a6da1247c970b6cb37f3c856..c2072a2067c51cc279d018e135b2df5ac7c94524 100644 (file)
 #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 */
index 665504da737c031a13d00298ee2d54f59f828b03..71cc74d617c182e3ea55d6f5c6e1b562b9b51d13 100644 (file)
@@ -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                 },
index 496bfaabea1defccddf5b650ef291fcfe961124a..b0da6fd3115d8615f95dcdd98707f1dcda2ec369 100644 (file)
 #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
 #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
index b86aa1c92c535d7e762efa4b44baeffd187e0ac3..c01a99d711a640b175858a7e03dce7e8de5eb9cd 100644 (file)
@@ -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);