added support for separate animations for 'main only' and 'type name' screen
authorHolger Schemel <info@artsoft.org>
Thu, 14 Apr 2016 19:25:46 +0000 (21:25 +0200)
committerHolger Schemel <info@artsoft.org>
Thu, 14 Apr 2016 19:25:46 +0000 (21:25 +0200)
src/cartoons.c
src/main.c
src/main.h
src/tools.c

index e90b2e58f9228644446b08233649f91a75c2a8fb..2e74c72b92a5683da4063eb88a88ff1fd6381775 100644 (file)
 
 #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 ANIM_CLASS_BIT_MAIN            2
+#define ANIM_CLASS_BIT_SUBMENU         3
+#define ANIM_CLASS_BIT_MENU            4
+#define ANIM_CLASS_BIT_TOONS           5
 
-#define NUM_ANIM_CLASSES               5
+#define NUM_ANIM_CLASSES               6
 
 #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_MAIN                        (1 << ANIM_CLASS_BIT_MAIN)
 #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_MAIN     (ANIM_CLASS_TOONS |     \
+                                        ANIM_CLASS_MENU  |     \
+                                        ANIM_CLASS_MAIN)
 
 #define ANIM_CLASS_TOONS_MENU_SUBMENU  (ANIM_CLASS_TOONS |     \
                                         ANIM_CLASS_MENU  |     \
@@ -130,7 +133,8 @@ struct GameModeAnimClass
   { 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_PSEUDO_MAINONLY,         ANIM_CLASS_TOONS_MENU_MAIN      },
+  { GAME_MODE_PSEUDO_TYPENAME,         ANIM_CLASS_TOONS_MENU_MAIN      },
   { GAME_MODE_SCORES,                  ANIM_CLASS_TOONS                },
 
   { -1,                                        -1                              }
@@ -144,6 +148,7 @@ struct AnimClassGameMode
 {
   { ANIM_CLASS_BIT_TITLE_INITIAL,      GAME_MODE_TITLE_INITIAL         },
   { ANIM_CLASS_BIT_TITLE,              GAME_MODE_TITLE                 },
+  { ANIM_CLASS_BIT_MAIN,               GAME_MODE_MAIN                  },
   { ANIM_CLASS_BIT_SUBMENU,            GAME_MODE_PSEUDO_SUBMENU        },
   { ANIM_CLASS_BIT_MENU,               GAME_MODE_PSEUDO_MENU           },
   { ANIM_CLASS_BIT_TOONS,              GAME_MODE_PSEUDO_TOONS          },
index 71cc74d617c182e3ea55d6f5c6e1b562b9b51d13..69b72b4e6764156f8842ac875515f13e64d0944b 100644 (file)
@@ -5499,6 +5499,7 @@ struct SpecialSuffixInfo special_suffix_info[NUM_SPECIAL_GFX_ARGS + 1 + 1] =
   { ".PANEL",                  GFX_SPECIAL_ARG_PANEL,                  },
   { ".PREVIEW",                        GFX_SPECIAL_ARG_PREVIEW,                },
   { ".CRUMBLED",               GFX_SPECIAL_ARG_CRUMBLED,               },
+  { ".MAINONLY",               GFX_SPECIAL_ARG_MAINONLY,               },
   { ".TYPENAME",               GFX_SPECIAL_ARG_TYPENAME,               },
   { ".SUBMENU",                        GFX_SPECIAL_ARG_SUBMENU,                },
   { ".MENU",                   GFX_SPECIAL_ARG_MENU,                   },
index cea3c982528be42e849f087ed373acbcc01c59ca..ec4a4679642512ef409998c50f0f2d849ffd1a43 100644 (file)
 #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 GFX_SPECIAL_ARG_MAINONLY       27
+#define GFX_SPECIAL_ARG_TYPENAME       28
+#define GFX_SPECIAL_ARG_SUBMENU                29
+#define GFX_SPECIAL_ARG_MENU           30
+#define GFX_SPECIAL_ARG_TOONS          31
+#define GFX_SPECIAL_ARG_FADING         32
+#define GFX_SPECIAL_ARG_QUIT           33
 
-#define NUM_SPECIAL_GFX_ARGS           33
+#define NUM_SPECIAL_GFX_ARGS           34
 
 /* these additional definitions are currently only used for draw offsets */
 #define GFX_SPECIAL_ARG_INFO_MAIN      0
 #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
+#define GAME_MODE_PSEUDO_MAINONLY      27
+#define GAME_MODE_PSEUDO_TYPENAME      28
+#define GAME_MODE_PSEUDO_SUBMENU       29
+#define GAME_MODE_PSEUDO_MENU          30
+#define GAME_MODE_PSEUDO_TOONS         31
+#define GAME_MODE_PSEUDO_FADING                32
+#define GAME_MODE_QUIT                 33
+
+#define NUM_GAME_MODES                 34
 
 /* special definitions currently only used for custom artwork configuration */
 #define MUSIC_PREFIX_BACKGROUND                0
index bd235f94435c6eac8ed3f23086235b05ac84c8f2..8610e5103476b976aa2731326f38226e22fb99a8 100644 (file)
@@ -8277,7 +8277,17 @@ void JoinRectangles(int *x, int *y, int *width, int *height,
 
 void SetAnimStatus(int anim_status_new)
 {
+  if (anim_status_new == GAME_MODE_MAIN)
+    anim_status_new = GAME_MODE_PSEUDO_MAINONLY;
+
   global.anim_status_next = anim_status_new;
+
+  // directly set screen modes that are entered without fading
+  if ((global.anim_status      == GAME_MODE_PSEUDO_MAINONLY &&
+       global.anim_status_next == GAME_MODE_PSEUDO_TYPENAME) ||
+      (global.anim_status      == GAME_MODE_PSEUDO_TYPENAME &&
+       global.anim_status_next == GAME_MODE_PSEUDO_MAINONLY))
+    global.anim_status = global.anim_status_next;
 }
 
 void SetGameStatus(int game_status_new)