From: Holger Schemel Date: Thu, 10 Sep 2020 18:09:55 +0000 (+0200) Subject: added support for tape property bits (not used yet) X-Git-Tag: 4.2.0.3~56 X-Git-Url: https://git.artsoft.org/?p=rocksndiamonds.git;a=commitdiff_plain;h=679bbca85df5a07faae177d729305a70e7b86199 added support for tape property bits (not used yet) --- diff --git a/graphics/gfx_classic/RocksIcon32x32.png b/graphics/gfx_classic/RocksIcon32x32.png deleted file mode 100644 index dcd51125..00000000 Binary files a/graphics/gfx_classic/RocksIcon32x32.png and /dev/null differ diff --git a/src/files.c b/src/files.c index ba5b8f58..283ebf0f 100644 --- a/src/files.c +++ b/src/files.c @@ -58,7 +58,7 @@ #define TAPE_CHUNK_VERS_SIZE 8 // size of file version chunk #define TAPE_CHUNK_HEAD_SIZE 20 // size of tape file header -#define TAPE_CHUNK_HEAD_UNUSED 2 // unused tape header bytes +#define TAPE_CHUNK_HEAD_UNUSED 1 // unused tape header bytes #define LEVEL_CHUNK_CNT3_SIZE(x) (LEVEL_CHUNK_CNT3_HEADER + (x)) #define LEVEL_CHUNK_CUS3_SIZE(x) (2 + (x) * LEVEL_CPART_CUS3_SIZE) @@ -7610,6 +7610,8 @@ static void setTapeInfoToDefaults(void) // at least one (default: the first) player participates in every tape tape.num_participating_players = 1; + tape.property_bits = TAPE_PROPERTY_NONE; + tape.level_nr = level_nr; tape.counter = 0; tape.changed = FALSE; @@ -7694,6 +7696,8 @@ static int LoadTape_HEAD(File *file, int chunk_size, struct TapeInfo *tape) setTapeActionFlags(tape, getFile8Bit(file)); + tape->property_bits = getFile8Bit(file); + ReadUnusedBytesFromFile(file, TAPE_CHUNK_HEAD_UNUSED); engine_version = getFileVersion(file); @@ -8095,6 +8099,8 @@ static void SaveTape_HEAD(FILE *file, struct TapeInfo *tape) putFile8Bit(file, getTapeActionValue(tape)); + putFile8Bit(file, tape->property_bits); + // unused bytes not at the end here for 4-byte alignment of engine_version WriteUnusedBytesToFile(file, TAPE_CHUNK_HEAD_UNUSED); diff --git a/src/tape.h b/src/tape.h index 4847931c..c8c06759 100644 --- a/src/tape.h +++ b/src/tape.h @@ -35,6 +35,9 @@ #define TAPE_ACTIONS_DEFAULT TAPE_USE_KEY_ACTIONS_ONLY +// values for tape properties stored in tape file +#define TAPE_PROPERTY_NONE 0 + // some positions in the video tape control window #define VIDEO_DISPLAY1_XPOS 5 #define VIDEO_DISPLAY1_YPOS 5 @@ -202,6 +205,9 @@ struct TapeInfo boolean use_key_actions; boolean use_mouse_actions; + // bits to indicate which tape properties are stored in this tape + byte property_bits; + struct { byte action[MAX_TAPE_ACTIONS];