rnd-20030304-1-src
[rocksndiamonds.git] / src / main.h
index 12d5ea2398ec471420627234ed5e6f1a1c0f4c1c..772176a84f786523fa9669a1edc2b6e19facd101 100644 (file)
@@ -66,7 +66,7 @@
 #define EP_BIT_SCHLUESSEL      (1 << 2)
 #define EP_BIT_PFORTE          (1 << 3)
 #define EP_BIT_SOLID           (1 << 4)
-#define EP_BIT_MASSIVE         (1 << 5)
+#define EP_BIT_INDESTRUCTIBLE  (1 << 5)
 #define EP_BIT_SLIPPERY                (1 << 6)
 #define EP_BIT_ENEMY           (1 << 7)
 #define EP_BIT_MAUER           (1 << 8)
 #define IS_SCHLUESSEL(e)       (Properties1[e] & EP_BIT_SCHLUESSEL)
 #define IS_PFORTE(e)           (Properties1[e] & EP_BIT_PFORTE)
 #define IS_SOLID(e)            (Properties1[e] & EP_BIT_SOLID)
-#define IS_MASSIVE(e)          (Properties1[e] & EP_BIT_MASSIVE)
+#define IS_INDESTRUCTIBLE(e)   (Properties1[e] & EP_BIT_INDESTRUCTIBLE)
 #define IS_SLIPPERY(e)         (Properties1[e] & EP_BIT_SLIPPERY)
 #define IS_ENEMY(e)            (Properties1[e] & EP_BIT_ENEMY)
 #define IS_MAUER(e)            (Properties1[e] & EP_BIT_MAUER)
 #define EL_MOLE                                110
 #define EL_PENGUIN                     111
 #define EL_SATELLITE                   112
-#define EL_ARROW_BLUE_LEFT             113
-#define EL_ARROW_BLUE_RIGHT            114
-#define EL_ARROW_BLUE_UP               115
-#define EL_ARROW_BLUE_DOWN             116
+#define EL_ARROW_LEFT                  113
+#define EL_ARROW_RIGHT                 114
+#define EL_ARROW_UP                    115
+#define EL_ARROW_DOWN                  116
 #define EL_PIG                         117
 #define EL_DRAGON                      118
 
 #define EL_DYNABOMB_PLAYER2_ACTIVE     (EL_FIRST_RUNTIME_REAL + 5)
 #define EL_DYNABOMB_PLAYER3_ACTIVE     (EL_FIRST_RUNTIME_REAL + 6)
 #define EL_DYNABOMB_PLAYER4_ACTIVE     (EL_FIRST_RUNTIME_REAL + 7)
-#define EL_SWITCHGATE_OPENING          (EL_FIRST_RUNTIME_REAL + 8)
-#define EL_SWITCHGATE_CLOSING          (EL_FIRST_RUNTIME_REAL + 9)
-#define EL_TIMEGATE_OPENING            (EL_FIRST_RUNTIME_REAL + 10)
-#define EL_TIMEGATE_CLOSING            (EL_FIRST_RUNTIME_REAL + 11)
-#define EL_PEARL_BREAKING              (EL_FIRST_RUNTIME_REAL + 12)
-#define EL_TRAP_ACTIVE                 (EL_FIRST_RUNTIME_REAL + 13)
-#define EL_INVISIBLE_STEELWALL_ACTIVE  (EL_FIRST_RUNTIME_REAL + 14)
-#define EL_INVISIBLE_WALL_ACTIVE       (EL_FIRST_RUNTIME_REAL + 15)
-#define EL_INVISIBLE_SAND_ACTIVE       (EL_FIRST_RUNTIME_REAL + 16)
-#define EL_CONVEYOR_BELT1_LEFT_ACTIVE  (EL_FIRST_RUNTIME_REAL + 17)
-#define EL_CONVEYOR_BELT1_MIDDLE_ACTIVE        (EL_FIRST_RUNTIME_REAL + 18)
-#define EL_CONVEYOR_BELT1_RIGHT_ACTIVE (EL_FIRST_RUNTIME_REAL + 19)
-#define EL_CONVEYOR_BELT2_LEFT_ACTIVE  (EL_FIRST_RUNTIME_REAL + 20)
-#define EL_CONVEYOR_BELT2_MIDDLE_ACTIVE        (EL_FIRST_RUNTIME_REAL + 21)
-#define EL_CONVEYOR_BELT2_RIGHT_ACTIVE (EL_FIRST_RUNTIME_REAL + 22)
-#define EL_CONVEYOR_BELT3_LEFT_ACTIVE  (EL_FIRST_RUNTIME_REAL + 23)
-#define EL_CONVEYOR_BELT3_MIDDLE_ACTIVE        (EL_FIRST_RUNTIME_REAL + 24)
-#define EL_CONVEYOR_BELT3_RIGHT_ACTIVE (EL_FIRST_RUNTIME_REAL + 25)
-#define EL_CONVEYOR_BELT4_LEFT_ACTIVE  (EL_FIRST_RUNTIME_REAL + 26)
-#define EL_CONVEYOR_BELT4_MIDDLE_ACTIVE        (EL_FIRST_RUNTIME_REAL + 27)
-#define EL_CONVEYOR_BELT4_RIGHT_ACTIVE (EL_FIRST_RUNTIME_REAL + 28)
-#define EL_EXIT_OPENING                        (EL_FIRST_RUNTIME_REAL + 29)
-#define EL_SP_EXIT_OPEN                        (EL_FIRST_RUNTIME_REAL + 30)
-#define EL_SP_TERMINAL_ACTIVE          (EL_FIRST_RUNTIME_REAL + 31)
-#define EL_SP_BUGGY_BASE_ACTIVATING    (EL_FIRST_RUNTIME_REAL + 32)
-#define EL_SP_BUGGY_BASE_ACTIVE                (EL_FIRST_RUNTIME_REAL + 33)
-#define EL_SP_MURPHY_CLONE             (EL_FIRST_RUNTIME_REAL + 34)
-#define EL_AMOEBA_DRIPPING             (EL_FIRST_RUNTIME_REAL + 35)
-#define EL_QUICKSAND_EMPTYING          (EL_FIRST_RUNTIME_REAL + 36)
-#define EL_MAGIC_WALL_ACTIVE           (EL_FIRST_RUNTIME_REAL + 37)
-#define EL_BD_MAGIC_WALL_ACTIVE                (EL_FIRST_RUNTIME_REAL + 38)
-#define EL_MAGIC_WALL_FULL             (EL_FIRST_RUNTIME_REAL + 39)
-#define EL_BD_MAGIC_WALL_FULL          (EL_FIRST_RUNTIME_REAL + 40)
-#define EL_MAGIC_WALL_EMPTYING         (EL_FIRST_RUNTIME_REAL + 41)
-#define EL_BD_MAGIC_WALL_EMPTYING      (EL_FIRST_RUNTIME_REAL + 42)
-#define EL_MAGIC_WALL_DEAD             (EL_FIRST_RUNTIME_REAL + 43)
-#define EL_BD_MAGIC_WALL_DEAD          (EL_FIRST_RUNTIME_REAL + 44)
+#define EL_SP_DISK_RED_ACTIVE          (EL_FIRST_RUNTIME_REAL + 8)
+#define EL_SWITCHGATE_OPENING          (EL_FIRST_RUNTIME_REAL + 9)
+#define EL_SWITCHGATE_CLOSING          (EL_FIRST_RUNTIME_REAL + 10)
+#define EL_TIMEGATE_OPENING            (EL_FIRST_RUNTIME_REAL + 11)
+#define EL_TIMEGATE_CLOSING            (EL_FIRST_RUNTIME_REAL + 12)
+#define EL_PEARL_BREAKING              (EL_FIRST_RUNTIME_REAL + 13)
+#define EL_TRAP_ACTIVE                 (EL_FIRST_RUNTIME_REAL + 14)
+#define EL_INVISIBLE_STEELWALL_ACTIVE  (EL_FIRST_RUNTIME_REAL + 15)
+#define EL_INVISIBLE_WALL_ACTIVE       (EL_FIRST_RUNTIME_REAL + 16)
+#define EL_INVISIBLE_SAND_ACTIVE       (EL_FIRST_RUNTIME_REAL + 17)
+#define EL_CONVEYOR_BELT1_LEFT_ACTIVE  (EL_FIRST_RUNTIME_REAL + 18)
+#define EL_CONVEYOR_BELT1_MIDDLE_ACTIVE        (EL_FIRST_RUNTIME_REAL + 19)
+#define EL_CONVEYOR_BELT1_RIGHT_ACTIVE (EL_FIRST_RUNTIME_REAL + 20)
+#define EL_CONVEYOR_BELT2_LEFT_ACTIVE  (EL_FIRST_RUNTIME_REAL + 21)
+#define EL_CONVEYOR_BELT2_MIDDLE_ACTIVE        (EL_FIRST_RUNTIME_REAL + 22)
+#define EL_CONVEYOR_BELT2_RIGHT_ACTIVE (EL_FIRST_RUNTIME_REAL + 23)
+#define EL_CONVEYOR_BELT3_LEFT_ACTIVE  (EL_FIRST_RUNTIME_REAL + 24)
+#define EL_CONVEYOR_BELT3_MIDDLE_ACTIVE        (EL_FIRST_RUNTIME_REAL + 25)
+#define EL_CONVEYOR_BELT3_RIGHT_ACTIVE (EL_FIRST_RUNTIME_REAL + 26)
+#define EL_CONVEYOR_BELT4_LEFT_ACTIVE  (EL_FIRST_RUNTIME_REAL + 27)
+#define EL_CONVEYOR_BELT4_MIDDLE_ACTIVE        (EL_FIRST_RUNTIME_REAL + 28)
+#define EL_CONVEYOR_BELT4_RIGHT_ACTIVE (EL_FIRST_RUNTIME_REAL + 29)
+#define EL_EXIT_OPENING                        (EL_FIRST_RUNTIME_REAL + 30)
+#define EL_SP_EXIT_OPEN                        (EL_FIRST_RUNTIME_REAL + 31)
+#define EL_SP_TERMINAL_ACTIVE          (EL_FIRST_RUNTIME_REAL + 32)
+#define EL_SP_BUGGY_BASE_ACTIVATING    (EL_FIRST_RUNTIME_REAL + 33)
+#define EL_SP_BUGGY_BASE_ACTIVE                (EL_FIRST_RUNTIME_REAL + 34)
+#define EL_SP_MURPHY_CLONE             (EL_FIRST_RUNTIME_REAL + 35)
+#define EL_AMOEBA_DRIPPING             (EL_FIRST_RUNTIME_REAL + 36)
+#define EL_QUICKSAND_EMPTYING          (EL_FIRST_RUNTIME_REAL + 37)
+#define EL_MAGIC_WALL_ACTIVE           (EL_FIRST_RUNTIME_REAL + 38)
+#define EL_BD_MAGIC_WALL_ACTIVE                (EL_FIRST_RUNTIME_REAL + 39)
+#define EL_MAGIC_WALL_FULL             (EL_FIRST_RUNTIME_REAL + 40)
+#define EL_BD_MAGIC_WALL_FULL          (EL_FIRST_RUNTIME_REAL + 41)
+#define EL_MAGIC_WALL_EMPTYING         (EL_FIRST_RUNTIME_REAL + 42)
+#define EL_BD_MAGIC_WALL_EMPTYING      (EL_FIRST_RUNTIME_REAL + 43)
+#define EL_MAGIC_WALL_DEAD             (EL_FIRST_RUNTIME_REAL + 44)
+#define EL_BD_MAGIC_WALL_DEAD          (EL_FIRST_RUNTIME_REAL + 45)
 
 /* "unreal" (and therefore not drawable) runtime elements */
-#define EL_FIRST_RUNTIME_UNREAL                (EL_FIRST_RUNTIME_REAL + 45)
+#define EL_FIRST_RUNTIME_UNREAL                (EL_FIRST_RUNTIME_REAL + 46)
 
 #define EL_BLOCKED                     (EL_FIRST_RUNTIME_UNREAL + 0)
 #define EL_EXPLOSION                   (EL_FIRST_RUNTIME_UNREAL + 1)
 #define EL_DYNABOMB_ACTIVE                     (EL_FIRST_DUMMY + 13)
 #define EL_SHIELD_NORMAL_ACTIVE                        (EL_FIRST_DUMMY + 14)
 #define EL_SHIELD_DEADLY_ACTIVE                        (EL_FIRST_DUMMY + 15)
-#define EL_ARROW_RED_LEFT                      (EL_FIRST_DUMMY + 16)
-#define EL_ARROW_RED_RIGHT                     (EL_FIRST_DUMMY + 17)
-#define EL_ARROW_RED_UP                                (EL_FIRST_DUMMY + 18)
-#define EL_ARROW_RED_DOWN                      (EL_FIRST_DUMMY + 19)
 
-#define MAX_NUM_ELEMENTS                       (EL_FIRST_DUMMY + 20)
+#define MAX_NUM_ELEMENTS                       (EL_FIRST_DUMMY + 16)
 
 
 /* values for graphics/sounds action types */
 #define NUM_ACTIONS                            21
 
 /* values for special image configuration suffixes */
-#define GFX_SPECIAL_ARG_EDITOR                 0
-#define GFX_SPECIAL_ARG_PREVIEW                        1
+#define GFX_SPECIAL_ARG_MAIN                   0
+#define GFX_SPECIAL_ARG_LEVELS                 1
+#define GFX_SPECIAL_ARG_SCORES                 2
+#define GFX_SPECIAL_ARG_EDITOR                 3
+#define GFX_SPECIAL_ARG_INFO                   4
+#define GFX_SPECIAL_ARG_SETUP                  5
+#define GFX_SPECIAL_ARG_DOOR                   6
+#define GFX_SPECIAL_ARG_PREVIEW                        7
 
-#define NUM_SPECIAL_GFX_ARGS                   2
+#define NUM_SPECIAL_GFX_ARGS                   8
 
 
 /* values for image configuration suffixes */
 #define GFX_ARG_XOFFSET                                8
 #define GFX_ARG_YOFFSET                                9
 #define GFX_ARG_FRAMES                         10
-#define GFX_ARG_START_FRAME                    11
-#define GFX_ARG_DELAY                          12
-#define GFX_ARG_MODE_LOOP                      13
-#define GFX_ARG_MODE_LINEAR                    14
-#define GFX_ARG_MODE_PINGPONG                  15
-#define GFX_ARG_MODE_PINGPONG2                 16
-#define GFX_ARG_MODE_RANDOM                    17
-#define GFX_ARG_MODE_REVERSE                   18
-#define GFX_ARG_GLOBAL_SYNC                    19
-#define GFX_ARG_STEP_OFFSET                    20
-#define GFX_ARG_STEP_DELAY                     21
-
-#define NUM_GFX_ARGS                           22
+#define GFX_ARG_FRAMES_PER_LINE                        11
+#define GFX_ARG_START_FRAME                    12
+#define GFX_ARG_DELAY                          13
+#define GFX_ARG_ANIM_MODE                      14
+#define GFX_ARG_GLOBAL_SYNC                    15
+#define GFX_ARG_STEP_OFFSET                    16
+#define GFX_ARG_STEP_DELAY                     17
+#define GFX_ARG_DIRECTION                      18
+#define GFX_ARG_POSITION                       19
+#define GFX_ARG_DRAW_XOFFSET                   20
+#define GFX_ARG_DRAW_YOFFSET                   21
+#define GFX_ARG_FORMAT                         22
+#define GFX_ARG_NAME                           23
+
+#define NUM_GFX_ARGS                           24
 
 
 /* values for sound configuration suffixes */
 #define NUM_SND_ARGS                           1
 
 
+/* values for font configuration */
+
+#define FONT_INITIAL_1                         0
+#define FONT_INITIAL_2                         1
+#define FONT_INITIAL_3                         2
+#define FONT_INITIAL_4                         3
+#define FONT_TITLE_1                           4
+#define FONT_TITLE_2                           5
+#define FONT_MENU_1                            6
+#define FONT_MENU_2                            7
+#define FONT_TEXT_1                            8
+#define FONT_TEXT_2                            9
+#define FONT_TEXT_3                            10
+#define FONT_TEXT_4                            11
+#define FONT_INPUT                             12
+#define FONT_INPUT_ACTIVE                      13
+#define FONT_OPTION_OFF                                14
+#define FONT_OPTION_ON                         15
+#define FONT_VALUE_1                           16
+#define FONT_VALUE_2                           17
+#define FONT_VALUE_OLD                         18
+#define FONT_TAPE_RECORDER                     19
+#define FONT_LEVEL_NUMBER                      20
+
+#define NUM_FONTS                              21
+#define NUM_INITIAL_FONTS                      4
+
+
 /* values for game_status */
 #define EXITGAME               0
 #define MAINMENU               1
 #define TYPENAME               6
 #define HALLOFFAME             7
 #define SETUP                  8
+#define PSEUDO_PREVIEW         9
+#define PSEUDO_DOOR            10
 
 #define PROGRAM_VERSION_MAJOR  2
 #define PROGRAM_VERSION_MINOR  2
 #define PROGRAM_VERSION_PATCH  0
-#define PROGRAM_VERSION_STRING "2.2.0rc3"
+#define PROGRAM_VERSION_STRING "2.2.0rc4"
 
 #define PROGRAM_TITLE_STRING   "Rocks'n'Diamonds"
 #define PROGRAM_AUTHOR_STRING  "Holger Schemel"
@@ -883,13 +918,21 @@ struct PlayerInfo
   int MovDir, MovPos, GfxPos;
   int Frame;
 
+  int GfxAction;
+
+  boolean use_murphy_graphic;
+  boolean use_disk_red_graphic;
+
   boolean Pushing;
   boolean Switching;
   boolean LevelSolved, GameOver;
   boolean snapped;
 
   int last_move_dir;
-  int is_moving;
+  boolean is_moving;
+
+  boolean is_digging;
+  boolean is_waiting;
 
   unsigned long move_delay;
   int move_delay_value;
@@ -897,8 +940,6 @@ struct PlayerInfo
   unsigned long push_delay;
   unsigned long push_delay_value;
 
-  int frame_reset_delay;
-
   unsigned long actual_frame_counter;
 
   int score;
@@ -1002,6 +1043,8 @@ struct GlobalInfo
   char *autoplay_leveldir;
   int autoplay_level_nr;
 
+  int num_toons;
+
   float frames_per_second;
   boolean fps_slowdown;
   int fps_slowdown_factor;
@@ -1009,21 +1052,31 @@ struct GlobalInfo
 
 struct ElementInfo
 {
-  char *token_name;            /* element token prefix used in config files */
+  char *token_name;            /* element token used in config files */
   char *sound_class_name;      /* classification for custom sound effects */
   char *editor_description;    /* short description for level editor */
   char *custom_description;    /* custom description for level editor */
 
   int graphic[NUM_ACTIONS];    /* default graphics for several actions */
-                               /* special graphics for left/right/up/down */
   int direction_graphic[NUM_ACTIONS][NUM_DIRECTIONS];
-
-  int editor_graphic;          /* graphic displayed in level editor */
-  int preview_graphic;         /* graphic displayed in level preview */
+                               /* special graphics for left/right/up/down */
+  int special_graphic[NUM_SPECIAL_GFX_ARGS];
+                               /* special graphics for certain screens */
 
   int sound[NUM_ACTIONS];      /* default sounds for several actions */
 };
 
+struct FontInfo
+{
+  char *token_name;            /* font token used in config files */
+
+  int graphic;                 /* default graphic for this font */
+  int special_graphic[NUM_SPECIAL_GFX_ARGS];
+                               /* special graphics for certain screens */
+  int special_bitmap_id[NUM_SPECIAL_GFX_ARGS];
+                               /* internal bitmap ID for special graphics */
+};
+
 struct GraphicInfo
 {
   Bitmap *bitmap;
@@ -1035,9 +1088,12 @@ struct GraphicInfo
   int anim_delay;              /* important: delay of 1 means "no delay"! */
   int anim_mode;
   boolean anim_global_sync;
+
   int step_offset;             /* optional step offset of toon animations */
   int step_delay;              /* optional step delay of toon animations */
 
+  int draw_x, draw_y;          /* optional offset for drawing fonts chars */
+
 #if defined(TARGET_X11_NATIVE_PERFORMANCE_WORKAROUND)
   Pixmap clip_mask;            /* single-graphic-only clip mask for X11 */
   GC clip_gc;                  /* single-graphic-only clip gc for X11 */
@@ -1145,6 +1201,7 @@ extern struct ElementInfo element_info[];
 extern struct ElementActionInfo        element_action_info[];
 extern struct ElementDirectionInfo element_direction_info[];
 extern struct SpecialSuffixInfo special_suffix_info[];
+extern struct FontInfo         font_info[];
 extern struct GraphicInfo      *graphic_info;
 extern struct SoundInfo               *sound_info;
 extern struct ConfigInfo       image_config[], sound_config[];