rnd-20070407-2-src
[rocksndiamonds.git] / src / main.h
index 11ee9c0fb79ee6465a938610c3e75778abaeffe9..1e62cc61186a8ab658c32be77c43875a7ff6d2ab 100644 (file)
 #define MAX_LEV_FIELDX                 MAX_PLAYFIELD_WIDTH
 #define MAX_LEV_FIELDY                 MAX_PLAYFIELD_HEIGHT
 
+#define MIN_SCROLL_DELAY               0
+#define STD_SCROLL_DELAY               3
+#define MAX_SCROLL_DELAY               8
+
 #define SCREENX(a)                     ((a) - scroll_x)
 #define SCREENY(a)                     ((a) - scroll_y)
 #define LEVELX(a)                      ((a) + scroll_x)
 #define EM_KEY_NR(e)           ((e) - EL_EM_KEY_1)
 #define EMC_KEY_NR(e)          ((e) - EL_EMC_KEY_5 + 4)
 #define KEY_NR(e)              (IS_RND_KEY(e) ? RND_KEY_NR(e) :        \
-                                IS_EM_KEY(e) ?  EM_KEY_NR(e) :         \
+                                IS_EM_KEY(e)  ? EM_KEY_NR(e)  :        \
                                 IS_EMC_KEY(e) ? EMC_KEY_NR(e) : 0)
 
 #define IS_RND_GATE(e)         ((e) >= EL_GATE_1 &&                    \
                                 (d) == MV_UP    ? "MV_UP"    :         \
                                 (d) == MV_DOWN  ? "MV_DOWN"  : "(various)")
 
+#define ELEMENT_ACTIVE(e)      (ActiveElement[e])
+
+#define FONT_ACTIVE(f)         (ActiveFont[f])
+
+
 /* fundamental game speed values */
 #define MICROLEVEL_SCROLL_DELAY        50      /* delay for scrolling micro level */
 #define MICROLEVEL_LABEL_DELAY 250     /* delay for micro level label */
 
 #define MAX_NUM_AMOEBA         100
 
-#define NUM_BELTS              4
-#define NUM_BELT_PARTS         3
 #define NUM_ENVELOPES          4
 #define MIN_ENVELOPE_XSIZE     1
 #define MIN_ENVELOPE_YSIZE     1
 #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 GFX_SPECIAL_ARG_PANEL          11
+#define GFX_SPECIAL_ARG_PREVIEW                12
+#define GFX_SPECIAL_ARG_CRUMBLED       13
 
-#define NUM_SPECIAL_GFX_ARGS           13
+#define NUM_SPECIAL_GFX_ARGS           14
 
 /* these additional definitions are currently only used for draw offsets */
 #define GFX_SPECIAL_ARG_INFO_MAIN      0
 #define GFX_ARG_NAME                   36
 #define GFX_ARG_SCALE_UP_FACTOR                37
 #define GFX_ARG_CLONE_FROM             38
-#define GFX_ARG_FADE_DELAY             39
-#define GFX_ARG_POST_DELAY             40
-#define GFX_ARG_AUTO_DELAY             41
-#define GFX_ARG_ALIGN                  42
-#define GFX_ARG_VALIGN                 43
-#define GFX_ARG_SORT_PRIORITY          44
+#define GFX_ARG_FADE_MODE              39
+#define GFX_ARG_FADE_DELAY             40
+#define GFX_ARG_POST_DELAY             41
+#define GFX_ARG_AUTO_DELAY             42
+#define GFX_ARG_ALIGN                  43
+#define GFX_ARG_VALIGN                 44
+#define GFX_ARG_SORT_PRIORITY          45
 
-#define NUM_GFX_ARGS                   45
+#define NUM_GFX_ARGS                   46
 
 
 /* values for sound configuration suffixes */
 #define NUM_FONTS                      37
 #define NUM_INITIAL_FONTS              4
 
+#if 0
 #define FONT_ACTIVE(f)                                                   \
        ((f) == FONT_MENU_1             ? FONT_MENU_1_ACTIVE            : \
         (f) == FONT_MENU_2             ? FONT_MENU_2_ACTIVE            : \
         (f) == FONT_INPUT_2            ? FONT_INPUT_2_ACTIVE           : \
         (f) == FONT_LEVEL_NUMBER       ? FONT_LEVEL_NUMBER_ACTIVE      : \
         (f))
-
+#endif
 
 /* values for game_status (must match special image configuration suffixes) */
 #define GAME_MODE_DEFAULT              0
 #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
+#define GAME_MODE_PSEUDO_PANEL         11
+#define GAME_MODE_PSEUDO_PREVIEW       12
+#define GAME_MODE_PSEUDO_CRUMBLED      13
 
 /* there are no special config file suffixes for these modes */
-#define GAME_MODE_PSEUDO_TYPENAME      13
-#define GAME_MODE_QUIT                 14
+#define GAME_MODE_PSEUDO_TYPENAME      14
+#define GAME_MODE_QUIT                 15
 
 /* special definitions currently only used for custom artwork configuration */
 #define MUSIC_PREFIX_BACKGROUND                0
@@ -2049,7 +2060,7 @@ struct MenuMainInfo
 
 struct TitleFadingInfo
 {
-  int anim_mode;
+  int fade_mode;
   int fade_delay;
   int post_delay;
   int auto_delay;
@@ -2067,7 +2078,7 @@ struct TitleMessageInfo
   boolean parse_comments;
   int sort_priority;
 
-  int anim_mode;
+  int fade_mode;
   int fade_delay;
   int post_delay;
   int auto_delay;
@@ -2084,8 +2095,10 @@ struct MenuInfo
 
   int list_size[NUM_SPECIAL_GFX_ARGS];
 
-  struct TitleFadingInfo navigation;
-  struct TitleFadingInfo destination;
+  struct TitleFadingInfo enter_menu;
+  struct TitleFadingInfo leave_menu;
+  struct TitleFadingInfo enter_screen[NUM_SPECIAL_GFX_ARGS];
+  struct TitleFadingInfo leave_screen[NUM_SPECIAL_GFX_ARGS];
 
   int sound[NUM_SPECIAL_GFX_ARGS];
   int music[NUM_SPECIAL_GFX_ARGS];
@@ -2247,6 +2260,7 @@ struct LevelInfo
   boolean use_spring_bug;      /* for compatibility with old levels */
   boolean use_time_orb_bug;    /* for compatibility with old levels */
   boolean instant_relocation;  /* no visual delay when relocating player */
+  boolean shifted_relocation;  /* no level centering when relocating player */
   boolean can_pass_to_walkable;        /* player can pass to empty or walkable tile */
   boolean grow_into_diggable;  /* amoeba can grow into anything diggable */
 
@@ -2518,6 +2532,7 @@ struct GraphicInfo
 
   int draw_masked;             /* optional setting for drawing envelope gfx */
 
+  int fade_mode;               /* optional setting for drawing title screens */
   int fade_delay;              /* optional setting for drawing title screens */
   int post_delay;              /* optional setting for drawing title screens */
   int auto_delay;              /* optional setting for drawing title screens */
@@ -2656,6 +2671,9 @@ extern int                        GfxElement[MAX_LEV_FIELDX][MAX_LEV_FIELDY];
 extern int                     GfxAction[MAX_LEV_FIELDX][MAX_LEV_FIELDY];
 extern int                     GfxDir[MAX_LEV_FIELDX][MAX_LEV_FIELDY];
 
+extern int                     ActiveElement[MAX_NUM_ELEMENTS];
+extern int                     ActiveFont[NUM_FONTS];
+
 extern int                     lev_fieldx, lev_fieldy;
 extern int                     scroll_x, scroll_y;
 
@@ -2686,6 +2704,7 @@ extern struct TapeInfo            tape;
 extern struct GlobalInfo       global;
 extern struct BorderInfo       border;
 extern struct TitleFadingInfo  fading;
+extern struct TitleFadingInfo  fading_none;
 extern struct TitleFadingInfo  title_initial_default;
 extern struct TitleFadingInfo  title_default;
 extern struct TitleMessageInfo titlemessage_initial_default;