added command line function to write element collecting image to directory
[rocksndiamonds.git] / src / main.h
index c3029da06b48620deb840d8c00048e27ab4760d0..2c2125f4ce2ea115b32e84deba925cfd95810073 100644 (file)
 #define CH_SIDE_TOP_BOTTOM             MV_VERTICAL
 #define CH_SIDE_ANY                    MV_ANY_DIRECTION
 
+#define CH_SIDE_FROM_BUTTON(b) ((b) == MB_LEFTBUTTON   ? CH_SIDE_LEFT :       \
+                                (b) == MB_RIGHTBUTTON  ? CH_SIDE_RIGHT :      \
+                                (b) == MB_MIDDLEBUTTON ? CH_SIDE_TOP_BOTTOM : \
+                                CH_SIDE_NONE)
+
 // values for change player for custom elements
 #define CH_PLAYER_NONE                 PLAYER_BITS_NONE
 #define CH_PLAYER_1                    PLAYER_BITS_1
@@ -2570,15 +2575,15 @@ enum
 // program information and versioning definitions
 #define PROGRAM_VERSION_SUPER          4
 #define PROGRAM_VERSION_MAJOR          2
-#define PROGRAM_VERSION_MINOR          2
-#define PROGRAM_VERSION_PATCH          0
+#define PROGRAM_VERSION_MINOR          3
+#define PROGRAM_VERSION_PATCH          2
 #define PROGRAM_VERSION_EXTRA          ""
 
 #define PROGRAM_TITLE_STRING           "Rocks'n'Diamonds"
 #define PROGRAM_AUTHOR_STRING          "Holger Schemel"
 #define PROGRAM_EMAIL_STRING           "info@artsoft.org"
 #define PROGRAM_WEBSITE_STRING         "https://www.artsoft.org/"
-#define PROGRAM_COPYRIGHT_STRING       "Copyright \xa9""1995-2020 by Holger Schemel"
+#define PROGRAM_COPYRIGHT_STRING       "Copyright \xa9""1995-2021 by Holger Schemel"
 #define PROGRAM_COMPANY_STRING         "A Game by Artsoft Entertainment"
 
 #define PROGRAM_ICON_FILENAME          "RocksIcon32x32.png"
@@ -3033,10 +3038,30 @@ struct ViewportInfo
   struct RectWithBorder door_2[NUM_SPECIAL_GFX_ARGS];
 };
 
-struct HiScore
+struct ScoreEntry
 {
-  char Name[MAX_PLAYER_NAME_LEN + 1];
-  int Score;
+  char tape_basename[MAX_FILENAME_LEN + 1];
+  char name[MAX_PLAYER_NAME_LEN + 1];
+  int score;
+  int time;            // time (in frames) or steps played
+};
+
+struct ScoreInfo
+{
+  int file_version;    // file format version the score is stored with
+  int game_version;    // game release version the score was created with
+
+  char level_identifier[MAX_FILENAME_LEN + 1];
+  int level_nr;
+
+  int num_entries;
+  int last_added;
+  int last_added_local;
+
+  boolean updated;
+  boolean force_last_added;
+
+  struct ScoreEntry entry[MAX_SCORE_ENTRIES];
 };
 
 struct Content
@@ -3102,6 +3127,7 @@ struct LevelInfo
   int time;                            // available time (seconds)
   int gems_needed;
   boolean auto_count_gems;
+  boolean rate_time_over_score;
 
   char name[MAX_LEVEL_NAME_LEN + 1];
   char author[MAX_LEVEL_AUTHOR_LEN + 1];
@@ -3186,6 +3212,7 @@ struct LevelInfo
   boolean sb_objects_needed;   // all Sokoban objects must be solved
   boolean auto_exit_sokoban;   // automatically finish solved Sokoban levels
   boolean solved_by_one_player;        // level is solved if one player enters exit
+  boolean finish_dig_collect;  // only finished dig/collect triggers ce action
 
   boolean continuous_snapping; // repeated snapping without releasing key
   boolean block_snap_field;    // snapping blocks field to show animation
@@ -3203,6 +3230,8 @@ struct LevelInfo
   // ('int' instead of 'boolean' because used as selectbox value in editor)
   int use_step_counter;                // count steps instead of seconds for level
 
+  int time_score_base;         // use time score for 1 or 10 seconds/steps
+
   short field[MAX_LEV_FIELDX][MAX_LEV_FIELDY];
 
   boolean use_custom_template; // use custom properties from template file
@@ -3244,7 +3273,14 @@ struct GlobalInfo
   char *convert_leveldir;
   int convert_level_nr;
 
-  char *create_images_dir;
+  char *dumplevel_leveldir;
+  int dumplevel_level_nr;
+
+  char *dumptape_leveldir;
+  int dumptape_level_nr;
+
+  char *create_sketch_images_dir;
+  char *create_collect_images_dir;
 
   int num_toons;
 
@@ -3394,6 +3430,8 @@ struct ElementInfo
   int drop_delay_random;       // additional random delay after dropping
   int move_delay_fixed;                // constant delay after moving
   int move_delay_random;       // additional random delay after moving
+  int step_delay_fixed;                // constant delay while moving
+  int step_delay_random;       // additional random delay while moving
 
   int move_pattern;            // direction movable element moves to
   int move_direction_initial;  // initial direction element moves to
@@ -3739,7 +3777,7 @@ extern boolean                    network_player_action_received;
 extern int                     graphics_action_mapping[];
 
 extern struct LevelInfo                level, level_template;
-extern struct HiScore          highscore[];
+extern struct ScoreInfo                scores, server_scores;
 extern struct TapeInfo         tape;
 extern struct GlobalInfo       global;
 extern struct BorderInfo       border;