From 64082fd5a5296aac6389d58fcf76d3e93680fd25 Mon Sep 17 00:00:00 2001 From: Holger Schemel Date: Sun, 15 Sep 2024 15:51:38 +0200 Subject: [PATCH] added tape property bit for tapes using the old BD game engine This tape property bit is either set when loading old BD replays that are explicitly tagged to use the old BD game engine, or can manually be set for existing tape files by using the "patch tapes" command (by using the patch command from the following commit). --- src/files.c | 6 ++++++ src/tape.h | 2 +- src/tools.c | 5 ++--- 3 files changed, 9 insertions(+), 4 deletions(-) diff --git a/src/files.c b/src/files.c index 9089e9a0..2edc3157 100644 --- a/src/files.c +++ b/src/files.c @@ -4692,6 +4692,10 @@ static void CopyNativeTape_BD_to_RND(struct LevelInfo *level) tape.bd_replay = TRUE; + // use old BD game engine if playing specifically tagged BD replays + if (leveldir_current->replay_with_old_engine) + tape.property_bits |= TAPE_PROPERTY_BD_OLD_ENGINE; + // all time calculations only used to display approximate tape time int cave_speed = cave->speed; int milliseconds_game = 0; @@ -9911,6 +9915,8 @@ void DumpTape(struct TapeInfo *tape) Print("Special tape properties: "); if (tape->property_bits == TAPE_PROPERTY_NONE) Print("[none]"); + if (tape->property_bits & TAPE_PROPERTY_BD_OLD_ENGINE) + Print("[bd_old_engine]"); if (tape->property_bits & TAPE_PROPERTY_EM_RANDOM_BUG) Print("[em_random_bug]"); if (tape->property_bits & TAPE_PROPERTY_GAME_SPEED) diff --git a/src/tape.h b/src/tape.h index 1b67f8dc..dc10d986 100644 --- a/src/tape.h +++ b/src/tape.h @@ -38,7 +38,7 @@ // values for tape properties stored in tape file #define TAPE_PROPERTY_NONE 0 #define TAPE_PROPERTY_LEVEL_SOLVED (1 << 0) -#define TAPE_PROPERTY_UNUSED_BIT_1 (1 << 1) +#define TAPE_PROPERTY_BD_OLD_ENGINE (1 << 1) #define TAPE_PROPERTY_UNUSED_BIT_2 (1 << 2) #define TAPE_PROPERTY_UNUSED_BIT_3 (1 << 3) #define TAPE_PROPERTY_UNUSED_BIT_4 (1 << 4) diff --git a/src/tools.c b/src/tools.c index b473d9f8..e91257c6 100644 --- a/src/tools.c +++ b/src/tools.c @@ -10666,9 +10666,8 @@ int getBeltSwitchElementFromBeltNrAndBeltDir(int belt_nr, int belt_dir) boolean useOldEngine_BD(void) { - return (tape.playing && - tape.bd_replay && - leveldir_current->replay_with_old_engine); + // only use old BD game engine if playing specifically tagged tapes + return (tape.playing && (tape.property_bits & TAPE_PROPERTY_BD_OLD_ENGINE)); } boolean swapTiles_EM(boolean is_pre_emc_cave) -- 2.34.1