X-Git-Url: https://git.artsoft.org/?a=blobdiff_plain;f=src%2Fmain.h;h=bf92901f8f1b74d62bc51b3481a2fa3080d5bb5d;hb=5ef03dad78a0ee430c749e2697d78f1ca1d19faa;hp=d8bdb3f37540a406f1672bb091f1227b3b071579;hpb=f88131af631131b4e65ab5b4d31d867f6258f170;p=rocksndiamonds.git diff --git a/src/main.h b/src/main.h index d8bdb3f3..bf92901f 100644 --- a/src/main.h +++ b/src/main.h @@ -331,6 +331,11 @@ #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 @@ -591,7 +596,7 @@ #define GFX_CRUMBLED(e) HAS_PROPERTY(GFX_ELEMENT(e), EP_GFX_CRUMBLED) // macros for pre-defined properties -#define ELEM_IS_PLAYER(e) HAS_PROPERTY(e, EP_PLAYER) +#define IS_PLAYER_ELEMENT(e) HAS_PROPERTY(e, EP_PLAYER) #define CAN_PASS_MAGIC_WALL(e) HAS_PROPERTY(e, EP_CAN_PASS_MAGIC_WALL) #define CAN_PASS_DC_MAGIC_WALL(e) HAS_PROPERTY(e, EP_CAN_PASS_DC_MAGIC_WALL) #define IS_SWITCHABLE(e) HAS_PROPERTY(e, EP_SWITCHABLE) @@ -845,7 +850,7 @@ (ge == EL_ANY_ELEMENT ? TRUE : \ IS_GROUP_ELEMENT(ge) ? IS_IN_GROUP(e, GROUP_NR(ge)) : (e) == (ge)) -#define IS_PLAYER(x, y) (ELEM_IS_PLAYER(StorePlayer[x][y])) +#define IS_PLAYER(x, y) (IS_PLAYER_ELEMENT(StorePlayer[x][y])) #define IS_FREE(x, y) (Tile[x][y] == EL_EMPTY && !IS_PLAYER(x, y)) #define IS_FREE_OR_PLAYER(x, y) (Tile[x][y] == EL_EMPTY) @@ -2569,8 +2574,8 @@ enum // program information and versioning definitions #define PROGRAM_VERSION_SUPER 4 -#define PROGRAM_VERSION_MAJOR 2 -#define PROGRAM_VERSION_MINOR 2 +#define PROGRAM_VERSION_MAJOR 3 +#define PROGRAM_VERSION_MINOR 0 #define PROGRAM_VERSION_PATCH 2 #define PROGRAM_VERSION_EXTRA "" @@ -2578,7 +2583,7 @@ enum #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" @@ -2619,7 +2624,7 @@ enum // values for game_emulation #define EMU_NONE 0 #define EMU_BOULDERDASH 1 -#define EMU_SOKOBAN 2 +#define EMU_UNUSED_2 2 #define EMU_SUPAPLEX 3 // values for level file type identifier @@ -2650,7 +2655,9 @@ enum #define AUTOPLAY_FFWD (1 << 1) #define AUTOPLAY_WARP (1 << 2) #define AUTOPLAY_TEST (1 << 3) -#define AUTOPLAY_FIX (1 << 4) +#define AUTOPLAY_SAVE (1 << 4) +#define AUTOPLAY_UPLOAD (1 << 5) +#define AUTOPLAY_FIX (1 << 6) #define AUTOPLAY_WARP_NO_DISPLAY AUTOPLAY_TEST #define AUTOPLAY_MODE_NONE 0 @@ -2658,6 +2665,8 @@ enum #define AUTOPLAY_MODE_FFWD (AUTOPLAY_MODE_PLAY | AUTOPLAY_FFWD) #define AUTOPLAY_MODE_WARP (AUTOPLAY_MODE_FFWD | AUTOPLAY_WARP) #define AUTOPLAY_MODE_TEST (AUTOPLAY_MODE_WARP | AUTOPLAY_TEST) +#define AUTOPLAY_MODE_SAVE (AUTOPLAY_MODE_TEST | AUTOPLAY_SAVE) +#define AUTOPLAY_MODE_UPLOAD (AUTOPLAY_MODE_TEST | AUTOPLAY_UPLOAD) #define AUTOPLAY_MODE_FIX (AUTOPLAY_MODE_TEST | AUTOPLAY_FIX) #define AUTOPLAY_MODE_WARP_NO_DISPLAY AUTOPLAY_MODE_TEST @@ -3033,10 +3042,31 @@ 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 uploaded; + boolean force_last_added; + + struct ScoreEntry entry[MAX_SCORE_ENTRIES]; }; struct Content @@ -3102,6 +3132,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]; @@ -3187,6 +3218,7 @@ struct LevelInfo 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 keep_walkable_ce; // keep walkable CE if it changes to the player boolean continuous_snapping; // repeated snapping without releasing key boolean block_snap_field; // snapping blocks field to show animation @@ -3236,8 +3268,9 @@ struct GlobalInfo { char *autoplay_leveldir; int autoplay_level[MAX_TAPES_PER_SET]; + int autoplay_mode; boolean autoplay_all; - boolean autoplay_mode; + time_t autoplay_time; char *patchtapes_mode; char *patchtapes_leveldir; @@ -3247,7 +3280,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; @@ -3397,6 +3437,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 @@ -3742,7 +3784,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;