changed global animations (esp. toons) to be controlled by game mode
[rocksndiamonds.git] / src / main.h
index fd07d4e26882093e4a6be0aaef6cb07fdc4be127..05c28b8e69d35675e26fa997a6c1490281ff470f 100644 (file)
 
 #define IS_SPECIAL_GFX_ARG(a)  ((a) >= 0 && (a) < NUM_SPECIAL_GFX_ARGS)
 
+#define IS_GLOBAL_ANIM_PART(a) ((a) >= 0 && (a) < NUM_GLOBAL_ANIM_PARTS)
+
 #define EL_CASCADE_ACTIVE(e)   (IS_EDITOR_CASCADE_INACTIVE(e) ? (e) + 1 : (e))
 #define EL_CASCADE_INACTIVE(e) (IS_EDITOR_CASCADE_ACTIVE(e)   ? (e) - 1 : (e))
 #define EL_CASCADE_TOGGLE(e)   (IS_EDITOR_CASCADE_INACTIVE(e) ? (e) + 1 :    \
 #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_MENU           18
+#define GFX_SPECIAL_ARG_TOONS          19
+#define GFX_SPECIAL_ARG_QUIT           20
 
-#define NUM_SPECIAL_GFX_ARGS           17
+#define NUM_SPECIAL_GFX_ARGS           21
 
 /* these additional definitions are currently only used for draw offsets */
 #define GFX_SPECIAL_ARG_INFO_MAIN      0
 #define GFX_ARG_DRAW_XOFFSET           31
 #define GFX_ARG_DRAW_YOFFSET           32
 #define GFX_ARG_DRAW_MASKED            33
-#define GFX_ARG_ANIM_DELAY_FIXED       34
-#define GFX_ARG_ANIM_DELAY_RANDOM      35
-#define GFX_ARG_POST_DELAY_FIXED       36
-#define GFX_ARG_POST_DELAY_RANDOM      37
-#define GFX_ARG_NAME                   38
-#define GFX_ARG_SCALE_UP_FACTOR                39
-#define GFX_ARG_TILE_SIZE              40
-#define GFX_ARG_CLONE_FROM             41
-#define GFX_ARG_FADE_MODE              42
-#define GFX_ARG_FADE_DELAY             43
-#define GFX_ARG_POST_DELAY             44
-#define GFX_ARG_AUTO_DELAY             45
-#define GFX_ARG_ALIGN                  46
-#define GFX_ARG_VALIGN                 47
-#define GFX_ARG_SORT_PRIORITY          48
-#define GFX_ARG_CLASS                  49
-#define GFX_ARG_STYLE                  50
-#define GFX_ARG_ACTIVE_XOFFSET         51
-#define GFX_ARG_ACTIVE_YOFFSET         52
-#define GFX_ARG_PRESSED_XOFFSET                53
-#define GFX_ARG_PRESSED_YOFFSET                54
-
-#define NUM_GFX_ARGS                   55
+#define GFX_ARG_DRAW_ORDER             34
+#define GFX_ARG_INIT_DELAY_FIXED       35
+#define GFX_ARG_INIT_DELAY_RANDOM      36
+#define GFX_ARG_ANIM_DELAY_FIXED       37
+#define GFX_ARG_ANIM_DELAY_RANDOM      38
+#define GFX_ARG_POST_DELAY_FIXED       39
+#define GFX_ARG_POST_DELAY_RANDOM      40
+#define GFX_ARG_NAME                   41
+#define GFX_ARG_SCALE_UP_FACTOR                42
+#define GFX_ARG_TILE_SIZE              43
+#define GFX_ARG_CLONE_FROM             44
+#define GFX_ARG_FADE_MODE              45
+#define GFX_ARG_FADE_DELAY             46
+#define GFX_ARG_POST_DELAY             47
+#define GFX_ARG_AUTO_DELAY             48
+#define GFX_ARG_ALIGN                  49
+#define GFX_ARG_VALIGN                 50
+#define GFX_ARG_SORT_PRIORITY          51
+#define GFX_ARG_CLASS                  52
+#define GFX_ARG_STYLE                  53
+#define GFX_ARG_ACTIVE_XOFFSET         54
+#define GFX_ARG_ACTIVE_YOFFSET         55
+#define GFX_ARG_PRESSED_XOFFSET                56
+#define GFX_ARG_PRESSED_YOFFSET                57
+
+#define NUM_GFX_ARGS                   58
 
 
 /* values for sound configuration suffixes */
 #define NUM_FONTS                      38
 #define NUM_INITIAL_FONTS              4
 
+/* values for toon animation configuration */
+#define MAX_NUM_TOONS                  20
+
 /* values for global animation configuration (must match those from main.c) */
 #define NUM_GLOBAL_ANIMS               8
 #define NUM_GLOBAL_ANIM_PARTS          8
+#define NUM_GLOBAL_ANIM_PARTS_ALL      (NUM_GLOBAL_ANIM_PARTS + 1)
+#define NUM_GLOBAL_ANIM_TOKENS         (2 * NUM_GLOBAL_ANIMS)
+
+#define GLOBAL_ANIM_ID_GRAPHIC_FIRST   0
+#define GLOBAL_ANIM_ID_GRAPHIC_LAST    7
+#define GLOBAL_ANIM_ID_CONTROL_FIRST   (NUM_GLOBAL_ANIMS + 0)
+#define GLOBAL_ANIM_ID_CONTROL_LAST    (NUM_GLOBAL_ANIMS + 7)
+
+#define GLOBAL_ANIM_ID_PART_FIRST      0
+#define GLOBAL_ANIM_ID_PART_LAST       7
+#define GLOBAL_ANIM_ID_PART_BASE       8
+
+/* values for global border graphics */
+#define IMG_GLOBAL_BORDER_FIRST                IMG_GLOBAL_BORDER
+#define IMG_GLOBAL_BORDER_LAST         IMG_GLOBAL_BORDER_PLAYING
 
 /* values for game_status (must match special image configuration suffixes) */
 #define GAME_MODE_DEFAULT              0
 #define GAME_MODE_PSEUDO_PANEL         14
 #define GAME_MODE_PSEUDO_PREVIEW       15
 #define GAME_MODE_PSEUDO_CRUMBLED      16
-
-/* there are no special config file suffixes for these modes */
 #define GAME_MODE_PSEUDO_TYPENAME      17
-#define GAME_MODE_QUIT                 18
+#define GAME_MODE_PSEUDO_MENU          18
+#define GAME_MODE_PSEUDO_TOONS         19
+#define GAME_MODE_QUIT                 20
+
+#define NUM_GAME_MODES                 21
 
 /* special definitions currently only used for custom artwork configuration */
 #define MUSIC_PREFIX_BACKGROUND                0
@@ -2761,8 +2790,8 @@ struct GlobalAnimInfo
 {
   char *token_name;            /* global animation token in config files */
 
-  /* global animation parts for certain screens */
-  int graphic[NUM_GLOBAL_ANIM_PARTS][NUM_SPECIAL_GFX_ARGS];
+  /* global animation graphic and control definitions */
+  int graphic[NUM_GLOBAL_ANIM_PARTS_ALL][NUM_SPECIAL_GFX_ARGS];
 };
 
 struct GraphicInfo
@@ -2800,10 +2829,12 @@ struct GraphicInfo
 
   int clone_from;              /* graphic for cloning *all* settings */
 
-  int anim_delay_fixed;                /* optional delay values for bored and   */
-  int anim_delay_random;       /* sleeping player animations (animation */
-  int post_delay_fixed;                /* intervall and following pause before  */
-  int post_delay_random;       /* next intervall (bored animation only) */
+  int init_delay_fixed;                /* optional initial delay values for global */
+  int init_delay_random;       /* animations (pause interval before start) */
+  int anim_delay_fixed;                /* optional delay values for bored/sleeping */
+  int anim_delay_random;       /* and global animations (animation length) */
+  int post_delay_fixed;                /* optional delay values after bored/global */
+  int post_delay_random;       /* animations (pause before next animation) */
 
   int step_offset;             /* optional step offset of toon animations */
   int step_xoffset;            /* optional step offset of toon animations */
@@ -2811,11 +2842,14 @@ struct GraphicInfo
   int step_delay;              /* optional step delay of toon animations */
   int direction;               /* optional move direction of toon animations */
   int position;                        /* optional draw position of toon animations */
+  int x;                       /* optional draw position of toon animations */
+  int y;                       /* optional draw position of toon animations */
 
   int draw_xoffset;            /* optional offset for drawing font chars */
   int draw_yoffset;            /* optional offset for drawing font chars */
 
   int draw_masked;             /* optional setting for drawing envelope gfx */
+  int draw_order;              /* optional draw order for global animations */
 
   int fade_mode;               /* optional setting for drawing title screens */
   int fade_delay;              /* optional setting for drawing title screens */