From 98a8e95036df3ed4440cf9742b9aabd7e9e0e7e3 Mon Sep 17 00:00:00 2001 From: Holger Schemel Date: Sun, 19 Jan 2020 14:02:51 +0100 Subject: [PATCH] removed options to prevent initial rolling objects in native EM levels When reading, converting and playing native Emerald Mine levels, always allow initial rolling objects now. Compile-time switches to deactivate this behaviour have been removed now. (A special switch to handle rolling springs when playing has been kept.) --- src/game_em/convert.c | 75 ++------------------------------------ src/game_em/emerald.h | 15 -------- src/game_em/synchro_2.c | 22 +++-------- src/game_em/tab_generate.c | 24 ------------ src/tools.c | 4 -- 5 files changed, 10 insertions(+), 130 deletions(-) diff --git a/src/game_em/convert.c b/src/game_em/convert.c index d8157a69..d009b740 100644 --- a/src/game_em/convert.c +++ b/src/game_em/convert.c @@ -11,8 +11,6 @@ #include "main_em.h" -#define ALLOW_ROLLING_SPRING - static unsigned char remap_v6[256] = { /* filter crap for v6 */ @@ -22,11 +20,7 @@ static unsigned char remap_v6[256] = 0,16,2,18, 36,37,37,37, 40,41,42,43, 44,45,128,128, 128,148,148, 148,45,45,45, 148,0,57,58, 59,60,61,62,63, -#ifdef ALLOW_ROLLING_SPRING 64,65,66,67, 68,69,69,71, 72,73,74,75, 118,75,75,75, -#else - 64,65,66,67, 68,69,69,69, 69,73,74,75, 118,75,75,75, -#endif 75,75,75,75, 75,153,153,153, 153,153,153,153, 153,153,153,153, 153,153,153,99, 100,68,68,68, 68,68,68,68, 68,118,118,118, 118,118,114,115, 131,118,118,119, 120,121,122,118, 118,118,118,118, @@ -517,6 +511,10 @@ int cleanup_em_level(unsigned char *src, int length, char *filename) * - introduced ALLOW_ROLLING_SPRING; if defined, do NOT turn rolling spring * into regular spring, because this breaks at least E.M.C. Mine 3, level 79 * (see comment directly above) + * + * 2020-01-19 + * - always use BAD_ROLL and ALLOW_ROLLING_SPRING code when converting caves + * (that is, always allow initial rolling objects in caves now) */ static unsigned short remap_emerald[256] = @@ -541,25 +539,16 @@ static unsigned short remap_emerald[256] = Xstone, Xslidewall_ew, Xslidewall_ns, Xdynamite_1, Xdynamite_2, Xdynamite_3, Xdynamite_4, Xacid_s, -#ifdef ALLOW_ROLLING_SPRING Xexit_1, Xexit_2, Xexit_3, Xballoon, Xplant, Xspring, Xspring_fall, Xspring_w, Xspring_e, Xball_1, Xball_2, Xandroid, Xblank, Xandroid, Xandroid, Xandroid, -#else - Xexit_1, Xexit_2, Xexit_3, Xballoon, - Xplant, Xspring, Xspring, Xspring, - Xspring, Xball_1, Xball_2, Xandroid, - Xblank, Xandroid, Xandroid, Xandroid, -#endif Xandroid, Xandroid, Xandroid, Xandroid, Xandroid, Xblank, Xblank, Xblank, Xblank, Xblank, Xblank, Xblank, Xblank, Xblank, Xblank, Xblank, -#ifdef BAD_ROLL - Xblank, Xblank, Xblank, Xpush_spring_w, Xpush_spring_e, Xacid_1, Xacid_2, Xacid_3, Xacid_4, Xacid_5, Xacid_6, Xacid_7, @@ -570,20 +559,6 @@ static unsigned short remap_emerald[256] = Xpush_bomb_e, Xpush_stone_w, Xpush_stone_e, Xblank, Xblank, Xblank, Xblank, Xblank, -#else - - Xblank, Xblank, Xblank, Xspring, - Xspring, Xacid_1, Xacid_2, Xacid_3, - Xacid_4, Xacid_5, Xacid_6, Xacid_7, - Xacid_8, Xblank, Xblank, Xblank, - - Xblank, Xblank, Xnut, Xnut, - Xsteel_1, Xblank, Xblank, Xbomb, - Xbomb, Xstone, Xstone, Xblank, - Xblank, Xblank, Xblank, Xblank, - -#endif - Xblank, Xroundwall_1, Xgrass, Xsteel_1, Xwall_1, Xkey_1, Xkey_2, Xkey_3, Xkey_4, Xdoor_1, Xdoor_2, Xdoor_3, @@ -925,48 +900,6 @@ void convert_em_level(unsigned char *src, int file_version) lev.wheel_cnt_initial = lev.wheel_time; break; -#ifndef BAD_ROLL - case 0x63: /* spring roll left */ - src[temp - 1] = 0x45; - src[temp] = 0x80; - break; - - case 0x64: /* spring roll right */ - src[temp + 1] = 0x45; - src[temp] = 0x80; - break; - - case 0x72: /* nut roll left */ - src[temp - 1] = 0x25; - src[temp] = 0x80; - break; - - case 0x73: /* nut roll right */ - src[temp + 1] = 0x25; - src[temp] = 0x80; - break; - - case 0x77: /* bomb roll left */ - src[temp - 1] = 0x10; - src[temp] = 0x80; - break; - - case 0x78: /* bomb roll right */ - src[temp + 1] = 0x10; - src[temp] = 0x80; - break; - - case 0x79: /* stone roll left */ - src[temp - 1] = 0x00; - src[temp] = 0x80; - break; - - case 0x7A: /* stone roll right */ - src[temp + 1] = 0x00; - src[temp] = 0x80; - break; -#endif - case 0xA3: /* fake blank */ lev.lenses_cnt_initial = 9999; break; diff --git a/src/game_em/emerald.h b/src/game_em/emerald.h index e16fcae4..6faa9e61 100644 --- a/src/game_em/emerald.h +++ b/src/game_em/emerald.h @@ -48,22 +48,9 @@ SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. // constant definitions // ---------------------------------------------------------------------------- -/* define these for backwards compatibility */ -#define EM_ENGINE_BAD_ROLL -#define EM_ENGINE_BAD_SPRING - /* define these to use additional elements */ #define EM_ENGINE_USE_ADDITIONAL_ELEMENTS -/* internal definitions for EM engine */ -#ifdef EM_ENGINE_BAD_ROLL -#define BAD_ROLL -#endif - -#ifdef EM_ENGINE_BAD_SPRING -#define BAD_SPRING -#endif - /* one border for Zborder elements, one border for steelwall, if needed */ #define EM_MAX_CAVE_WIDTH (MAX_PLAYFIELD_WIDTH + 2 + 2) #define EM_MAX_CAVE_HEIGHT (MAX_PLAYFIELD_HEIGHT + 2 + 2) @@ -85,7 +72,6 @@ enum Xacid_splash_e, Xacid_splash_w, -#ifdef EM_ENGINE_BAD_ROLL Xpush_stone_e, Xpush_stone_w, Xpush_nut_e, @@ -98,7 +84,6 @@ enum Xpush_diamond_w, Xpush_bomb_e, Xpush_bomb_w, -#endif Xstone, Xstone_pause, diff --git a/src/game_em/synchro_2.c b/src/game_em/synchro_2.c index 60044374..25805d16 100644 --- a/src/game_em/synchro_2.c +++ b/src/game_em/synchro_2.c @@ -11,6 +11,8 @@ #include "main_em.h" +#define SPRING_ROLL /* spring rolling off round things continues to roll */ + #define RANDOM (random = random << 31 | random >> 1) static void set_nearest_player_xy(int x, int y, int *dx, int *dy) @@ -63,7 +65,6 @@ void synchro_2(void) /* --------------------------------------------------------------------- */ -#ifdef BAD_ROLL case Xpush_stone_e: switch (Cave[y][x+1]) { @@ -175,12 +176,7 @@ void synchro_2(void) Cave[y][x] = Yspring_eB; Cave[y][x+1] = Yspring_e; Next[y][x] = Xblank; - -#ifdef BAD_SPRING Next[y][x+1] = Xspring_e; -#else - Next[y][x+1] = Xspring_pause; -#endif goto loop; } @@ -204,12 +200,7 @@ void synchro_2(void) Cave[y][x] = Yspring_wB; Cave[y][x-1] = Yspring_w; Next[y][x] = Xblank; - -#ifdef BAD_SPRING Next[y][x-1] = Xspring_w; -#else - Next[y][x-1] = Xspring_pause; -#endif goto loop; } @@ -350,7 +341,6 @@ void synchro_2(void) Next[y][x-1] = Xbomb_pause; goto loop; } -#endif /* BAD_ROLL */ /* --------------------------------------------------------------------- */ @@ -2461,7 +2451,7 @@ void synchro_2(void) Cave[y+1][x] = XbumperB; Next[y][x] = Xblank; -#ifdef BAD_SPRING +#ifdef SPRING_ROLL Next[y][x+1] = Xspring_e; #else Next[y][x+1] = Xspring_pause; @@ -2478,7 +2468,7 @@ void synchro_2(void) Cave[y+1][x] = XbumperB; Next[y][x] = Xblank; -#ifdef BAD_SPRING +#ifdef SPRING_ROLL Next[y][x-1] = Xspring_w; #else Next[y][x-1] = Xspring_pause; @@ -2497,7 +2487,7 @@ void synchro_2(void) Cave[y+1][x] = XbumperB; Next[y][x] = Xblank; -#ifdef BAD_SPRING +#ifdef SPRING_ROLL Next[y][x-1] = Xspring_w; #else Next[y][x-1] = Xspring_pause; @@ -2514,7 +2504,7 @@ void synchro_2(void) Cave[y+1][x] = XbumperB; Next[y][x] = Xblank; -#ifdef BAD_SPRING +#ifdef SPRING_ROLL Next[y][x+1] = Xspring_e; #else Next[y][x+1] = Xspring_pause; diff --git a/src/game_em/tab_generate.c b/src/game_em/tab_generate.c index bcdecfe5..69e9036b 100644 --- a/src/game_em/tab_generate.c +++ b/src/game_em/tab_generate.c @@ -243,8 +243,6 @@ int obj_map[] = Xstone_fall, 5, Xstone_fall, 6, Xstone_fall, 7, - -#ifdef BAD_ROLL Xpush_stone_e, 0, Xpush_stone_e, 1, Xpush_stone_e, 2, @@ -261,8 +259,6 @@ int obj_map[] = Xpush_stone_w, 5, Xpush_stone_w, 6, Xpush_stone_w, 7, -#endif - Ystone_s, 7, Xsand_stoneout_2, 7, Xsand_stonein_1, 0, @@ -363,8 +359,6 @@ int obj_map[] = Xnut_fall, 5, Xnut_fall, 6, Xnut_fall, 7, - -#ifdef BAD_ROLL Xpush_nut_e, 0, Xpush_nut_e, 1, Xpush_nut_e, 2, @@ -381,8 +375,6 @@ int obj_map[] = Xpush_nut_w, 5, Xpush_nut_w, 6, Xpush_nut_w, 7, -#endif - -1, -1, Ynut_s, 6, @@ -1457,8 +1449,6 @@ int obj_map[] = Xspring_fall, 5, Xspring_fall, 6, Xspring_fall, 7, - -#ifdef BAD_ROLL Xpush_spring_e, 0, Xpush_spring_e, 1, Xpush_spring_e, 2, @@ -1475,8 +1465,6 @@ int obj_map[] = Xpush_spring_w, 5, Xpush_spring_w, 6, Xpush_spring_w, 7, -#endif - -1, Yspring_sB, 6, -1, @@ -1919,8 +1907,6 @@ int obj_map[] = Xemerald_fall, 5, Xemerald_fall, 6, Xemerald_fall, 7, - -#ifdef BAD_ROLL Xpush_emerald_e, 0, Xpush_emerald_e, 1, Xpush_emerald_e, 2, @@ -1937,8 +1923,6 @@ int obj_map[] = Xpush_emerald_w, 5, Xpush_emerald_w, 6, Xpush_emerald_w, 7, -#endif - Xemerald_shine, 0, Xemerald_shine, 7, Ynut_stone, 7, @@ -2078,8 +2062,6 @@ int obj_map[] = Xdiamond_fall, 5, Xdiamond_fall, 6, Xdiamond_fall, 7, - -#ifdef BAD_ROLL Xpush_diamond_e, 0, Xpush_diamond_e, 1, Xpush_diamond_e, 2, @@ -2096,8 +2078,6 @@ int obj_map[] = Xpush_diamond_w, 5, Xpush_diamond_w, 6, Xpush_diamond_w, 7, -#endif - Xdiamond_shine, 0, Xdiamond_shine, 7, Ydiamond_s, 7, @@ -2338,8 +2318,6 @@ int obj_map[] = Xbomb_fall, 5, Xbomb_fall, 6, Xbomb_fall, 7, - -#ifdef BAD_ROLL Xpush_bomb_e, 0, Xpush_bomb_e, 1, Xpush_bomb_e, 2, @@ -2356,8 +2334,6 @@ int obj_map[] = Xpush_bomb_w, 5, Xpush_bomb_w, 6, Xpush_bomb_w, 7, -#endif - Ybomb_s, 7, Ybomb_e, 7, Ybomb_w, 7, diff --git a/src/tools.c b/src/tools.c index c3668807..ffcc1f66 100644 --- a/src/tools.c +++ b/src/tools.c @@ -5752,8 +5752,6 @@ em_object_mapping_list[] = Xacid_splash_w, FALSE, FALSE, EL_ACID_SPLASH_LEFT, -1, -1 }, - -#ifdef EM_ENGINE_BAD_ROLL { Xpush_stone_e, FALSE, FALSE, EL_ROCK, -1, MV_BIT_RIGHT @@ -5802,8 +5800,6 @@ em_object_mapping_list[] = Xpush_bomb_w, FALSE, FALSE, EL_BOMB, -1, MV_BIT_LEFT }, -#endif // EM_ENGINE_BAD_ROLL - { Xstone, TRUE, FALSE, EL_ROCK, -1, -1 -- 2.34.1