From 90c3a49422dd88de77ffc7b8dd1d4f1d73d0d9a3 Mon Sep 17 00:00:00 2001 From: Holger Schemel Date: Sat, 19 Aug 2006 13:33:34 +0200 Subject: [PATCH] rnd-20060819-2-src * code cleanup (removed many annoying "#if 0" blocks) --- ChangeLog | 3 + src/cartoons.c | 2 +- src/cartoons.h | 2 +- src/config.c | 2 +- src/config.h | 2 +- src/conftime.h | 2 +- src/editor.c | 880 ++------------------------------------------ src/editor.h | 6 +- src/engines.h | 2 +- src/events.c | 53 +-- src/events.h | 2 +- src/files.c | 977 +----------------------------------------------- src/files.h | 2 +- src/game.c | 978 +------------------------------------------------ src/game.h | 4 +- src/init.c | 97 ----- src/init.h | 2 +- src/main.c | 4 - src/main.h | 29 +- src/netserv.h | 2 +- src/network.c | 14 +- src/network.h | 2 +- src/screens.c | 387 +------------------ src/screens.h | 2 +- src/tape.c | 5 - src/tape.h | 2 +- src/tools.c | 106 ------ src/tools.h | 2 +- 28 files changed, 84 insertions(+), 3487 deletions(-) diff --git a/ChangeLog b/ChangeLog index 287a460e..085de46f 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,6 @@ +2006-08-19 + * code cleanup (removed many annoying "#if 0" blocks) + 2006-08-18 * fixed bug that caused broken tapes when manually appending to tapes using the "pause before death" functionality, followed by recording diff --git a/src/cartoons.c b/src/cartoons.c index 9b6626b6..c2b6e76a 100644 --- a/src/cartoons.c +++ b/src/cartoons.c @@ -1,7 +1,7 @@ /*********************************************************** * Rocks'n'Diamonds -- McDuffin Strikes Back! * *----------------------------------------------------------* -* (c) 1995-2002 Artsoft Entertainment * +* (c) 1995-2006 Artsoft Entertainment * * Holger Schemel * * Detmolder Strasse 189 * * 33604 Bielefeld * diff --git a/src/cartoons.h b/src/cartoons.h index 44cfb6d2..073cc52b 100644 --- a/src/cartoons.h +++ b/src/cartoons.h @@ -1,7 +1,7 @@ /*********************************************************** * Rocks'n'Diamonds -- McDuffin Strikes Back! * *----------------------------------------------------------* -* (c) 1995-2002 Artsoft Entertainment * +* (c) 1995-2006 Artsoft Entertainment * * Holger Schemel * * Detmolder Strasse 189 * * 33604 Bielefeld * diff --git a/src/config.c b/src/config.c index ec09d329..deea1f84 100644 --- a/src/config.c +++ b/src/config.c @@ -1,7 +1,7 @@ /*********************************************************** * Rocks'n'Diamonds -- McDuffin Strikes Back! * *----------------------------------------------------------* -* (c) 1995-2002 Artsoft Entertainment * +* (c) 1995-2006 Artsoft Entertainment * * Holger Schemel * * Detmolder Strasse 189 * * 33604 Bielefeld * diff --git a/src/config.h b/src/config.h index 01ea5064..326ca276 100644 --- a/src/config.h +++ b/src/config.h @@ -1,7 +1,7 @@ /*********************************************************** * Rocks'n'Diamonds -- McDuffin Strikes Back! * *----------------------------------------------------------* -* (c) 1995-2002 Artsoft Entertainment * +* (c) 1995-2006 Artsoft Entertainment * * Holger Schemel * * Detmolder Strasse 189 * * 33604 Bielefeld * diff --git a/src/conftime.h b/src/conftime.h index 2d69a2ab..a8569826 100644 --- a/src/conftime.h +++ b/src/conftime.h @@ -1 +1 @@ -#define COMPILE_DATE_STRING "[2006-08-19 00:14]" +#define COMPILE_DATE_STRING "[2006-08-19 12:53]" diff --git a/src/editor.c b/src/editor.c index 04c6a46c..6ec3cd8f 100644 --- a/src/editor.c +++ b/src/editor.c @@ -1,7 +1,7 @@ /*********************************************************** * Rocks'n'Diamonds -- McDuffin Strikes Back! * *----------------------------------------------------------* -* (c) 1995-2002 Artsoft Entertainment * +* (c) 1995-2006 Artsoft Entertainment * * Holger Schemel * * Detmolder Strasse 189 * * 33604 Bielefeld * @@ -3135,28 +3135,10 @@ static int editor_hl_boulderdash[] = EL_CHAR('B'), EL_CHAR('D'), EL_EMPTY, - -#if 0 - EL_CHAR('B'), - EL_CHAR('O'), - EL_CHAR('U'), - EL_CHAR('L'), - - EL_CHAR('-'), - EL_CHAR('D'), - EL_CHAR('E'), - EL_CHAR('R'), - - EL_CHAR('D'), - EL_CHAR('A'), - EL_CHAR('S'), - EL_CHAR('H'), -#endif }; static int editor_el_boulderdash[] = { -#if 1 EL_EMPTY, EL_SAND, EL_BD_ROCK, @@ -3181,34 +3163,6 @@ static int editor_el_boulderdash[] = EL_BD_BUTTERFLY_DOWN, EL_BD_FIREFLY_DOWN, EL_EXIT_OPEN, - -#else - - EL_PLAYER_1, - EL_EMPTY, - EL_SAND, - EL_STEELWALL, - - EL_BD_WALL, - EL_BD_MAGIC_WALL, - EL_EXIT_CLOSED, - EL_EXIT_OPEN, - - EL_BD_DIAMOND, - EL_BD_BUTTERFLY_UP, - EL_BD_FIREFLY_UP, - EL_BD_ROCK, - - EL_BD_BUTTERFLY_LEFT, - EL_BD_FIREFLY_LEFT, - EL_BD_BUTTERFLY_RIGHT, - EL_BD_FIREFLY_RIGHT, - - EL_BD_AMOEBA, - EL_BD_BUTTERFLY_DOWN, - EL_BD_FIREFLY_DOWN, - EL_BD_EXPANDABLE_WALL, -#endif }; static int *editor_hl_boulderdash_ptr = editor_hl_boulderdash; static int *editor_el_boulderdash_ptr = editor_el_boulderdash; @@ -3221,28 +3175,10 @@ static int editor_hl_emerald_mine[] = EL_CHAR('E'), EL_CHAR('M'), EL_EMPTY, - -#if 0 - EL_CHAR('E'), - EL_CHAR('M'), - EL_CHAR('E'), - EL_CHAR('-'), - - EL_CHAR('R'), - EL_CHAR('A'), - EL_CHAR('L'), - EL_CHAR('D'), - - EL_CHAR('M'), - EL_CHAR('I'), - EL_CHAR('N'), - EL_CHAR('E'), -#endif }; static int editor_el_emerald_mine[] = { -#if 1 EL_SAND, EL_ROCK, EL_QUICKSAND_EMPTY, @@ -3302,79 +3238,6 @@ static int editor_el_emerald_mine[] = EL_EM_GATE_2_GRAY, EL_EM_GATE_3_GRAY, EL_EM_GATE_4_GRAY, - -#else - - EL_PLAYER_1, - EL_PLAYER_2, - EL_SAND, - EL_ROCK, - - EL_STEELWALL, - EL_WALL, - EL_WALL_SLIPPERY, - EL_MAGIC_WALL, - - EL_EMERALD, - EL_DIAMOND, - EL_NUT, - EL_BOMB, - - EL_WALL_EMERALD, - EL_WALL_DIAMOND, - EL_QUICKSAND_EMPTY, - EL_QUICKSAND_FULL, - - EL_DYNAMITE, - EL_DYNAMITE_ACTIVE, - EL_EXIT_CLOSED, - EL_EXIT_OPEN, - - EL_YAMYAM, - EL_BUG_UP, - EL_SPACESHIP_UP, - EL_ROBOT, - - EL_BUG_LEFT, - EL_SPACESHIP_LEFT, - EL_BUG_RIGHT, - EL_SPACESHIP_RIGHT, - - EL_ROBOT_WHEEL, - EL_BUG_DOWN, - EL_SPACESHIP_DOWN, - EL_INVISIBLE_WALL, - - EL_ACID_POOL_TOPLEFT, - EL_ACID, - EL_ACID_POOL_TOPRIGHT, - EL_EMPTY, - - EL_ACID_POOL_BOTTOMLEFT, - EL_ACID_POOL_BOTTOM, - EL_ACID_POOL_BOTTOMRIGHT, - EL_EMPTY, - - EL_AMOEBA_DROP, - EL_AMOEBA_DEAD, - EL_AMOEBA_WET, - EL_AMOEBA_DRY, - - EL_EM_KEY_1, - EL_EM_KEY_2, - EL_EM_KEY_3, - EL_EM_KEY_4, - - EL_EM_GATE_1, - EL_EM_GATE_2, - EL_EM_GATE_3, - EL_EM_GATE_4, - - EL_EM_GATE_1_GRAY, - EL_EM_GATE_2_GRAY, - EL_EM_GATE_3_GRAY, - EL_EM_GATE_4_GRAY, -#endif }; static int *editor_hl_emerald_mine_ptr = editor_hl_emerald_mine; static int *editor_el_emerald_mine_ptr = editor_el_emerald_mine; @@ -3387,33 +3250,10 @@ static int editor_hl_emerald_mine_club[] = EL_CHAR('E'), EL_CHAR('M'), EL_CHAR('C'), - -#if 0 - EL_CHAR('E'), - EL_CHAR('M'), - EL_CHAR('E'), - EL_CHAR('-'), - - EL_CHAR('R'), - EL_CHAR('A'), - EL_CHAR('L'), - EL_CHAR('D'), - - EL_CHAR('M'), - EL_CHAR('I'), - EL_CHAR('N'), - EL_CHAR('E'), - - EL_CHAR('C'), - EL_CHAR('L'), - EL_CHAR('U'), - EL_CHAR('B'), -#endif }; static int editor_el_emerald_mine_club[] = { -#if 1 EL_EMC_KEY_5, EL_EMC_KEY_6, EL_EMC_KEY_7, @@ -3488,89 +3328,6 @@ static int editor_el_emerald_mine_club[] = EL_YAMYAM_DOWN, EL_BALLOON_SWITCH_DOWN, EL_BALLOON_SWITCH_NONE, - -#else - - EL_EMC_KEY_5, - EL_EMC_KEY_6, - EL_EMC_KEY_7, - EL_EMC_KEY_8, - - EL_EMC_GATE_5, - EL_EMC_GATE_6, - EL_EMC_GATE_7, - EL_EMC_GATE_8, - - EL_EMC_GATE_5_GRAY, - EL_EMC_GATE_6_GRAY, - EL_EMC_GATE_7_GRAY, - EL_EMC_GATE_8_GRAY, - - EL_EMC_STEELWALL_1, - EL_EMC_STEELWALL_2, - EL_EMC_STEELWALL_3, - EL_EMC_STEELWALL_4, - - EL_EMC_WALL_13, - EL_EMC_WALL_14, - EL_EMC_WALL_15, - EL_EMC_WALL_16, - - EL_EMC_WALL_SLIPPERY_1, - EL_EMC_WALL_SLIPPERY_2, - EL_EMC_WALL_SLIPPERY_3, - EL_EMC_WALL_SLIPPERY_4, - - EL_EMC_WALL_1, - EL_EMC_WALL_2, - EL_EMC_WALL_3, - EL_EMC_WALL_4, - - EL_EMC_WALL_5, - EL_EMC_WALL_6, - EL_EMC_WALL_7, - EL_EMC_WALL_8, - - EL_EMC_WALL_9, - EL_EMC_WALL_10, - EL_EMC_WALL_11, - EL_EMC_WALL_12, - - EL_EMC_ANDROID, - EL_BALLOON, - EL_BALLOON_SWITCH_ANY, - EL_BALLOON_SWITCH_NONE, - - EL_BALLOON_SWITCH_LEFT, - EL_BALLOON_SWITCH_RIGHT, - EL_BALLOON_SWITCH_UP, - EL_BALLOON_SWITCH_DOWN, - - EL_EMC_GRASS, - EL_EMC_PLANT, - EL_EMC_LENSES, - EL_EMC_MAGNIFIER, - - EL_EMC_MAGIC_BALL, - EL_EMC_MAGIC_BALL_SWITCH, - EL_SPRING, - EL_EMC_SPRING_BUMPER, - - EL_EMC_DRIPPER, - EL_EMC_FAKE_GRASS, - EL_EMPTY, - EL_EMPTY, - - EL_EM_DYNAMITE, - EL_EM_DYNAMITE_ACTIVE, - EL_EMPTY, - EL_EMPTY, - - EL_YAMYAM_LEFT, - EL_YAMYAM_RIGHT, - EL_YAMYAM_UP, - EL_YAMYAM_DOWN, -#endif }; static int *editor_hl_emerald_mine_club_ptr = editor_hl_emerald_mine_club; static int *editor_el_emerald_mine_club_ptr = editor_el_emerald_mine_club; @@ -3583,18 +3340,10 @@ static int editor_hl_rnd[] = EL_CHAR('R'), EL_CHAR('N'), EL_CHAR('D'), - -#if 0 - EL_CHAR('M'), - EL_CHAR('O'), - EL_CHAR('R'), - EL_CHAR('E'), -#endif }; static int editor_el_rnd[] = { -#if 1 EL_KEY_1, EL_KEY_2, EL_KEY_3, @@ -3674,99 +3423,11 @@ static int editor_el_rnd[] = EL_EXPANDABLE_WALL_HORIZONTAL, EL_EXPANDABLE_WALL_VERTICAL, EL_EXPANDABLE_WALL_ANY, - -#else - - EL_KEY_1, - EL_KEY_2, - EL_KEY_3, - EL_KEY_4, - - EL_GATE_1, - EL_GATE_2, - EL_GATE_3, - EL_GATE_4, - - EL_GATE_1_GRAY, - EL_GATE_2_GRAY, - EL_GATE_3_GRAY, - EL_GATE_4_GRAY, - - EL_ARROW_LEFT, - EL_ARROW_RIGHT, - EL_ARROW_UP, - EL_ARROW_DOWN, - - EL_AMOEBA_DEAD, - EL_AMOEBA_DRY, - EL_AMOEBA_FULL, - EL_EMPTY, - - EL_EMPTY, - EL_EMERALD_YELLOW, - EL_EMERALD_RED, - EL_EMERALD_PURPLE, - - EL_WALL_BD_DIAMOND, - EL_WALL_EMERALD_YELLOW, - EL_WALL_EMERALD_RED, - EL_WALL_EMERALD_PURPLE, - - EL_GAME_OF_LIFE, - EL_PACMAN_UP, - EL_TIME_ORB_FULL, - EL_TIME_ORB_EMPTY, - - EL_PACMAN_LEFT, - EL_DARK_YAMYAM, - EL_PACMAN_RIGHT, - EL_EXPANDABLE_WALL, - - EL_BIOMAZE, - EL_PACMAN_DOWN, - EL_LAMP, - EL_LAMP_ACTIVE, - - EL_DYNABOMB_INCREASE_NUMBER, - EL_DYNABOMB_INCREASE_SIZE, - EL_DYNABOMB_INCREASE_POWER, - EL_STONEBLOCK, - - EL_MOLE, - EL_PENGUIN, - EL_PIG, - EL_DRAGON, - - EL_BUG, - EL_MOLE_UP, - EL_BD_BUTTERFLY, - EL_BD_FIREFLY, - - EL_MOLE_LEFT, - EL_EMPTY, - EL_MOLE_RIGHT, - EL_PACMAN, - - EL_SPACESHIP, - EL_MOLE_DOWN, - EL_EMPTY, - EL_EMPTY, - - EL_SATELLITE, - EL_EXPANDABLE_WALL_HORIZONTAL, - EL_EXPANDABLE_WALL_VERTICAL, - EL_EXPANDABLE_WALL_ANY, - - EL_INVISIBLE_STEELWALL, - EL_INVISIBLE_WALL, - EL_SPEED_PILL, - EL_BLACK_ORB, -#endif -}; -static int *editor_hl_rnd_ptr = editor_hl_rnd; -static int *editor_el_rnd_ptr = editor_el_rnd; -static int num_editor_hl_rnd = SIZEOF_ARRAY_INT(editor_hl_rnd); -static int num_editor_el_rnd = SIZEOF_ARRAY_INT(editor_el_rnd); +}; +static int *editor_hl_rnd_ptr = editor_hl_rnd; +static int *editor_el_rnd_ptr = editor_el_rnd; +static int num_editor_hl_rnd = SIZEOF_ARRAY_INT(editor_hl_rnd); +static int num_editor_el_rnd = SIZEOF_ARRAY_INT(editor_el_rnd); static int editor_hl_sokoban[] = { @@ -3774,18 +3435,6 @@ static int editor_hl_sokoban[] = EL_CHAR('S'), EL_CHAR('B'), EL_EMPTY, - -#if 0 - EL_CHAR('S'), - EL_CHAR('O'), - EL_CHAR('K'), - EL_CHAR('O'), - - EL_CHAR('-'), - EL_CHAR('B'), - EL_CHAR('A'), - EL_CHAR('N'), -#endif }; static int editor_el_sokoban[] = @@ -3806,23 +3455,10 @@ static int editor_hl_supaplex[] = EL_CHAR('S'), EL_CHAR('P'), EL_EMPTY, - -#if 0 - EL_CHAR('S'), - EL_CHAR('U'), - EL_CHAR('P'), - EL_CHAR('A'), - - EL_CHAR('P'), - EL_CHAR('L'), - EL_CHAR('E'), - EL_CHAR('X'), -#endif }; static int editor_el_supaplex[] = { -#if 1 EL_SP_MURPHY, EL_EMPTY, EL_SP_BASE, @@ -3866,175 +3502,28 @@ static int editor_el_supaplex[] = EL_SP_HARDWARE_BASE_5, EL_SP_HARDWARE_BASE_6, EL_SP_HARDWARE_YELLOW, - EL_SP_CHIP_TOP, - - EL_SP_CHIP_SINGLE, - EL_SP_CHIP_LEFT, - EL_SP_CHIP_RIGHT, - EL_SP_CHIP_BOTTOM, - -#else - -#if 1 - EL_EMPTY, -#else - EL_SP_EMPTY, -#endif - EL_SP_ZONK, - EL_SP_BASE, - EL_SP_MURPHY, - - EL_SP_INFOTRON, - EL_SP_CHIP_SINGLE, - EL_SP_HARDWARE_GRAY, - EL_SP_EXIT_CLOSED, - - EL_SP_DISK_ORANGE, - EL_SP_PORT_RIGHT, - EL_SP_PORT_DOWN, - EL_SP_PORT_LEFT, - - EL_SP_PORT_UP, - EL_SP_GRAVITY_PORT_RIGHT, - EL_SP_GRAVITY_PORT_DOWN, - EL_SP_GRAVITY_PORT_LEFT, - - EL_SP_GRAVITY_PORT_UP, - EL_SP_SNIKSNAK, - EL_SP_DISK_YELLOW, - EL_SP_TERMINAL, - - EL_SP_DISK_RED, - EL_SP_PORT_VERTICAL, - EL_SP_PORT_HORIZONTAL, - EL_SP_PORT_ANY, - - EL_SP_ELECTRON, - EL_SP_BUGGY_BASE, - EL_SP_CHIP_LEFT, - EL_SP_CHIP_RIGHT, - - EL_SP_HARDWARE_BASE_1, - EL_SP_HARDWARE_GREEN, - EL_SP_HARDWARE_BLUE, - EL_SP_HARDWARE_RED, - - EL_SP_HARDWARE_YELLOW, - EL_SP_HARDWARE_BASE_2, - EL_SP_HARDWARE_BASE_3, - EL_SP_HARDWARE_BASE_4, - - EL_SP_HARDWARE_BASE_5, - EL_SP_HARDWARE_BASE_6, - EL_SP_CHIP_TOP, - EL_SP_CHIP_BOTTOM, -#endif -}; -static int *editor_hl_supaplex_ptr = editor_hl_supaplex; -static int *editor_el_supaplex_ptr = editor_el_supaplex; -static int num_editor_hl_supaplex = SIZEOF_ARRAY_INT(editor_hl_supaplex); -static int num_editor_el_supaplex = SIZEOF_ARRAY_INT(editor_el_supaplex); - -static int editor_hl_diamond_caves[] = -{ - EL_INTERNAL_CASCADE_DC_ACTIVE, - EL_CHAR('D'), - EL_CHAR('C'), - EL_CHAR('2'), - -#if 0 - EL_CHAR('D'), - EL_CHAR('I'), - EL_CHAR('A'), - EL_CHAR('-'), - - EL_CHAR('M'), - EL_CHAR('O'), - EL_CHAR('N'), - EL_CHAR('D'), - - EL_CHAR('C'), - EL_CHAR('A'), - EL_CHAR('V'), - EL_CHAR('E'), - - EL_CHAR('S'), - EL_CHAR(' '), - EL_CHAR('I'), - EL_CHAR('I'), -#endif -}; - -static int editor_el_diamond_caves[] = -{ -#if 1 - EL_PEARL, - EL_CRYSTAL, - EL_WALL_PEARL, - EL_WALL_CRYSTAL, - - EL_CONVEYOR_BELT_1_LEFT, - EL_CONVEYOR_BELT_1_MIDDLE, - EL_CONVEYOR_BELT_1_RIGHT, - EL_CONVEYOR_BELT_1_SWITCH_MIDDLE, - - EL_CONVEYOR_BELT_2_LEFT, - EL_CONVEYOR_BELT_2_MIDDLE, - EL_CONVEYOR_BELT_2_RIGHT, - EL_CONVEYOR_BELT_2_SWITCH_MIDDLE, - - EL_CONVEYOR_BELT_3_LEFT, - EL_CONVEYOR_BELT_3_MIDDLE, - EL_CONVEYOR_BELT_3_RIGHT, - EL_CONVEYOR_BELT_3_SWITCH_MIDDLE, - - EL_CONVEYOR_BELT_4_LEFT, - EL_CONVEYOR_BELT_4_MIDDLE, - EL_CONVEYOR_BELT_4_RIGHT, - EL_CONVEYOR_BELT_4_SWITCH_MIDDLE, - - EL_CONVEYOR_BELT_1_SWITCH_LEFT, - EL_CONVEYOR_BELT_2_SWITCH_LEFT, - EL_CONVEYOR_BELT_3_SWITCH_LEFT, - EL_CONVEYOR_BELT_4_SWITCH_LEFT, - - EL_CONVEYOR_BELT_1_SWITCH_RIGHT, - EL_CONVEYOR_BELT_2_SWITCH_RIGHT, - EL_CONVEYOR_BELT_3_SWITCH_RIGHT, - EL_CONVEYOR_BELT_4_SWITCH_RIGHT, - - EL_SWITCHGATE_CLOSED, - EL_SWITCHGATE_OPEN, - EL_SWITCHGATE_SWITCH_UP, - EL_SWITCHGATE_SWITCH_DOWN, - - EL_TIMEGATE_CLOSED, - EL_TIMEGATE_OPEN, - EL_TIMEGATE_SWITCH, - EL_EMPTY, - - EL_SIGN_EXCLAMATION, - EL_SIGN_STOP, - EL_LIGHT_SWITCH, - EL_LIGHT_SWITCH_ACTIVE, - - EL_STEELWALL_SLIPPERY, - EL_INVISIBLE_SAND, - EL_LANDMINE, - EL_EMPTY, - - EL_SHIELD_NORMAL, - EL_SHIELD_DEADLY, - EL_EXTRA_TIME, - EL_EMPTY, - - EL_ENVELOPE_1, - EL_ENVELOPE_2, - EL_ENVELOPE_3, - EL_ENVELOPE_4, + EL_SP_CHIP_TOP, -#else + EL_SP_CHIP_SINGLE, + EL_SP_CHIP_LEFT, + EL_SP_CHIP_RIGHT, + EL_SP_CHIP_BOTTOM, +}; +static int *editor_hl_supaplex_ptr = editor_hl_supaplex; +static int *editor_el_supaplex_ptr = editor_el_supaplex; +static int num_editor_hl_supaplex = SIZEOF_ARRAY_INT(editor_hl_supaplex); +static int num_editor_el_supaplex = SIZEOF_ARRAY_INT(editor_el_supaplex); + +static int editor_hl_diamond_caves[] = +{ + EL_INTERNAL_CASCADE_DC_ACTIVE, + EL_CHAR('D'), + EL_CHAR('C'), + EL_CHAR('2'), +}; +static int editor_el_diamond_caves[] = +{ EL_PEARL, EL_CRYSTAL, EL_WALL_PEARL, @@ -4070,37 +3559,35 @@ static int editor_el_diamond_caves[] = EL_CONVEYOR_BELT_3_SWITCH_RIGHT, EL_CONVEYOR_BELT_4_SWITCH_RIGHT, - EL_SWITCHGATE_OPEN, EL_SWITCHGATE_CLOSED, + EL_SWITCHGATE_OPEN, EL_SWITCHGATE_SWITCH_UP, EL_SWITCHGATE_SWITCH_DOWN, - EL_ENVELOPE_1, - EL_ENVELOPE_2, - EL_ENVELOPE_3, - EL_ENVELOPE_4, - EL_TIMEGATE_CLOSED, EL_TIMEGATE_OPEN, EL_TIMEGATE_SWITCH, EL_EMPTY, - EL_LANDMINE, - EL_INVISIBLE_SAND, - EL_STEELWALL_SLIPPERY, - EL_EMPTY, - EL_SIGN_EXCLAMATION, EL_SIGN_STOP, EL_LIGHT_SWITCH, EL_LIGHT_SWITCH_ACTIVE, + EL_STEELWALL_SLIPPERY, + EL_INVISIBLE_SAND, + EL_LANDMINE, + EL_EMPTY, + EL_SHIELD_NORMAL, EL_SHIELD_DEADLY, EL_EXTRA_TIME, EL_EMPTY, -#endif + EL_ENVELOPE_1, + EL_ENVELOPE_2, + EL_ENVELOPE_3, + EL_ENVELOPE_4, }; static int *editor_hl_diamond_caves_ptr = editor_hl_diamond_caves; static int *editor_el_diamond_caves_ptr = editor_el_diamond_caves; @@ -4113,28 +3600,6 @@ static int editor_hl_dx_boulderdash[] = EL_CHAR('D'), EL_CHAR('X'), EL_EMPTY, - -#if 0 - EL_CHAR('D'), - EL_CHAR('X'), - EL_CHAR('-'), - EL_CHAR(' '), - - EL_CHAR('B'), - EL_CHAR('O'), - EL_CHAR('U'), - EL_CHAR('L'), - - EL_CHAR('-'), - EL_CHAR('D'), - EL_CHAR('E'), - EL_CHAR('R'), - - EL_CHAR('D'), - EL_CHAR('A'), - EL_CHAR('S'), - EL_CHAR('H'), -#endif }; static int editor_el_dx_boulderdash[] = @@ -4170,13 +3635,6 @@ static int editor_hl_chars[] = EL_CHAR('T'), EL_CHAR('X'), EL_CHAR('T'), - -#if 0 - EL_CHAR('T'), - EL_CHAR('E'), - EL_CHAR('X'), - EL_CHAR('T'), -#endif }; static int editor_el_chars[] = @@ -4282,28 +3740,6 @@ static int editor_hl_custom[] = EL_CHAR('C'), EL_CHAR('E'), EL_EMPTY, - -#if 0 - EL_CHAR('C'), - EL_CHAR('U'), - EL_CHAR('S'), - EL_CHAR('-'), - - EL_CHAR('T'), - EL_CHAR('O'), - EL_CHAR('M'), - EL_CHAR(' '), - - EL_CHAR('E'), - EL_CHAR('L'), - EL_CHAR('E'), - EL_CHAR('M'), - - EL_CHAR('E'), - EL_CHAR('N'), - EL_CHAR('T'), - EL_CHAR('S'), -#endif }; static int editor_el_custom[] = @@ -4639,28 +4075,6 @@ static int editor_hl_group[] = EL_CHAR('G'), EL_CHAR('E'), EL_EMPTY, - -#if 0 - EL_CHAR('G'), - EL_CHAR('R'), - EL_CHAR('O'), - EL_CHAR('U'), - - EL_CHAR('P'), - EL_CHAR(' '), - EL_CHAR(' '), - EL_CHAR(' '), - - EL_CHAR('E'), - EL_CHAR('L'), - EL_CHAR('E'), - EL_CHAR('M'), - - EL_CHAR('E'), - EL_CHAR('N'), - EL_CHAR('T'), - EL_CHAR('S'), -#endif }; static int editor_el_group[] = @@ -4761,23 +4175,6 @@ static int editor_hl_user_defined[] = EL_CHAR('M'), EL_CHAR('Y'), EL_EMPTY, - -#if 0 - EL_CHAR('U'), - EL_CHAR('S'), - EL_CHAR('E'), - EL_CHAR('R'), - - EL_CHAR('D'), - EL_CHAR('E'), - EL_CHAR('F'), - EL_CHAR('I'), - - EL_CHAR('-'), - EL_CHAR('N'), - EL_CHAR('E'), - EL_CHAR('D'), -#endif }; static int *editor_hl_user_defined_ptr = editor_hl_user_defined; @@ -4974,11 +4371,7 @@ static char *getElementInfoText(int element) { char *info_text = NULL; -#if 1 if (element < MAX_NUM_ELEMENTS) -#else - if (element < NUM_FILE_ELEMENTS) -#endif { if (strlen(element_info[element].description) > 0) info_text = element_info[element].description; @@ -6364,11 +5757,7 @@ static void MapCounterButtons(int id) int yoffset_above = MINI_TILEX + ED_GADGET_DISTANCE; int yoffset = ED_BORDER_SIZE; int x_left = gi_down->x - xoffset_left; -#if 1 int x_right; /* set after gadget position was modified */ -#else - int x_right = gi_up->x + gi_up->width + xoffset_right; -#endif int y_above = gi_down->y - yoffset_above; int x = gi_down->x; int y; /* set after gadget position was modified */ @@ -6828,22 +6217,12 @@ static void setSelectboxSpecialActionVariablesIfNeeded() /* only change if corresponding selectbox has changed */ if (selectbox_info[ED_SELECTBOX_ID_ACTION_MODE].options != action_arg_modes[mode]) -#if 0 - custom_element_change.action_mode = - (action_arg_modes[mode])[0].value; -#else custom_element_change.action_mode = -1; -#endif /* only change if corresponding selectbox has changed */ if (selectbox_info[ED_SELECTBOX_ID_ACTION_ARG].options != action_arg_options[i].options) -#if 0 - custom_element_change.action_arg = - action_arg_options[i].options[0].value; -#else custom_element_change.action_arg = -1; -#endif break; } @@ -6875,8 +6254,6 @@ static void setSelectboxSpecialActionOptions() } } -#if 1 - static void copy_custom_element_settings(int element_from, int element_to) { struct ElementInfo *ei_from = &element_info[element_from]; @@ -6885,85 +6262,6 @@ static void copy_custom_element_settings(int element_from, int element_to) copyElementInfo(ei_from, ei_to); } -#else - -static void copy_custom_element_settings(int element_from, int element_to) -{ - struct ElementInfo *ei_from = &element_info[element_from]; - struct ElementInfo *ei_to = &element_info[element_to]; - int i, x, y; - - /* ---------- copy element description ---------- */ - for (i = 0; i < MAX_ELEMENT_NAME_LEN + 1; i++) - ei_to->description[i] = ei_from->description[i]; - - /* ---------- copy element base properties ---------- */ -#if 1 - ei_to->properties[EP_BITFIELD_BASE_NR] = - ei_from->properties[EP_BITFIELD_BASE_NR]; -#else - Properties[element_to][EP_BITFIELD_BASE_NR] = - Properties[element_from][EP_BITFIELD_BASE_NR]; -#endif - - /* ---------- copy custom property values ---------- */ - - ei_to->use_gfx_element = ei_from->use_gfx_element; - ei_to->gfx_element = ei_from->gfx_element; - - ei_to->access_direction = ei_from->access_direction; - - ei_to->collect_score_initial = ei_from->collect_score_initial; - ei_to->collect_count_initial = ei_from->collect_count_initial; - - ei_to->ce_value_fixed_initial = ei_from->ce_value_fixed_initial; - ei_to->ce_value_random_initial = ei_from->ce_value_random_initial; - ei_to->use_last_ce_value = ei_from->use_last_ce_value; - - ei_to->push_delay_fixed = ei_from->push_delay_fixed; - ei_to->push_delay_random = ei_from->push_delay_random; - ei_to->drop_delay_fixed = ei_from->drop_delay_fixed; - ei_to->drop_delay_random = ei_from->drop_delay_random; - ei_to->move_delay_fixed = ei_from->move_delay_fixed; - ei_to->move_delay_random = ei_from->move_delay_random; - - ei_to->move_pattern = ei_from->move_pattern; - ei_to->move_direction_initial = ei_from->move_direction_initial; - ei_to->move_stepsize = ei_from->move_stepsize; - - ei_to->move_enter_element = ei_from->move_enter_element; - ei_to->move_leave_element = ei_from->move_leave_element; - ei_to->move_leave_type = ei_from->move_leave_type; - - ei_to->slippery_type = ei_from->slippery_type; - - ei_to->explosion_type = ei_from->explosion_type; - ei_to->explosion_delay = ei_from->explosion_delay; - ei_to->ignition_delay = ei_from->ignition_delay; - - for (y = 0; y < 3; y++) - for (x = 0; x < 3; x++) - ei_to->content.e[x][y] = ei_from->content.e[x][y]; - - /* ---------- reinitialize and copy change pages ---------- */ - - ei_to->num_change_pages = ei_from->num_change_pages; - ei_to->current_change_page = ei_from->current_change_page; - - setElementChangePages(ei_to, ei_to->num_change_pages); - - for (i = 0; i < ei_to->num_change_pages; i++) - ei_to->change_page[i] = ei_from->change_page[i]; - - /* ---------- copy group element info ---------- */ - if (ei_from->group != NULL && ei_to->group != NULL) /* group or internal */ - *ei_to->group = *ei_from->group; - - /* mark this custom element as modified */ - ei_to->modified_settings = TRUE; -} -#endif - static void replace_custom_element_in_settings(int element_from, int element_to) { @@ -8104,7 +7402,6 @@ static void DrawPropertiesInfo() int screen_line = 0; int i, x, y; -#if 1 if (setup.editor.show_element_token) { DrawTextF(pad_x, pad_y + screen_line++ * font2_height, FONT_TEXT_3, @@ -8112,24 +7409,6 @@ static void DrawPropertiesInfo() screen_line++; } -#else - -#if DEBUG - if (IS_CUSTOM_ELEMENT(properties_element)) - { - DrawTextF(pad_x, pad_y + screen_line++ * font2_height, FONT_TEXT_3, - "[Custom Element %d]", properties_element - EL_CUSTOM_START + 1); - screen_line++; - } - else if (IS_GROUP_ELEMENT(properties_element)) - { - DrawTextF(pad_x, pad_y + screen_line++ * font2_height, FONT_TEXT_3, - "[Group Element %d]", properties_element - EL_GROUP_START + 1); - screen_line++; - } -#endif -#endif - /* ----- print number of elements / percentage of this element in level */ num_elements_in_level = 0; @@ -8270,7 +7549,6 @@ static struct { EL_BD_MAGIC_WALL, &level.time_magic_wall, TEXT_DURATION }, { EL_ROBOT_WHEEL, &level.time_wheel, TEXT_DURATION }, -#if 1 { EL_TIMEGATE_SWITCH, &level.time_timegate, TEXT_DURATION }, { EL_LIGHT_SWITCH, &level.time_light, TEXT_DURATION }, { EL_LIGHT_SWITCH_ACTIVE, &level.time_light, TEXT_DURATION }, @@ -8286,9 +7564,7 @@ static struct { EL_BIOMAZE, &level.biomaze[1], TEXT_GAME_OF_LIFE_2 }, { EL_BIOMAZE, &level.biomaze[2], TEXT_GAME_OF_LIFE_3 }, { EL_BIOMAZE, &level.biomaze[3], TEXT_GAME_OF_LIFE_4 }, -#endif -#if 1 { EL_EMC_ANDROID, &level.android_move_time, TEXT_MOVE_SPEED }, { EL_EMC_ANDROID, &level.android_clone_time, TEXT_CLONE_SPEED }, { EL_EMC_MAGIC_BALL, &level.ball_time, TEXT_BALL_DELAY }, @@ -8297,7 +7573,6 @@ static struct { EL_SPRING, &level.slurp_score, TEXT_SLURPING }, { EL_EMC_LENSES, &level.lenses_time, TEXT_DURATION }, { EL_EMC_MAGNIFIER, &level.magnify_time, TEXT_DURATION }, -#endif { -1, NULL, NULL } }; @@ -8473,11 +7748,6 @@ static void DrawPropertiesConfig() if (properties_element == EL_TIME_ORB_FULL) MapCheckbuttonGadget(ED_CHECKBUTTON_ID_USE_TIME_ORB_BUG); -#if 0 - if (properties_element == EL_BALLOON) - MapSelectboxGadget(ED_SELECTBOX_ID_WIND_DIRECTION); -#endif - if (CAN_GROW(properties_element)) { checkbutton_info[ED_CHECKBUTTON_ID_GROW_INTO_DIGGABLE].y = @@ -8729,26 +7999,14 @@ static void DrawPropertiesWindow() "Element Settings", FONT_TITLE_1); #endif -#if 1 FrameCounter = 0; /* restart animation frame counter */ -#endif DrawElementBorder(SX + xstart * MINI_TILEX, SY + ystart * MINI_TILEY + MINI_TILEY / 2, TILEX, TILEY, FALSE); -#if 1 + DrawEditorElementAnimation(SX + xstart * MINI_TILEX, SY + ystart * MINI_TILEY + MINI_TILEY / 2); -#else - DrawGraphicAnimationExt(drawto, - SX + xstart * MINI_TILEX, - SY + ystart * MINI_TILEY + MINI_TILEY / 2, - el2img(properties_element), -1, NO_MASKING); -#endif - -#if 0 - FrameCounter = 0; /* restart animation frame counter */ -#endif DrawEditorElementName((xstart + 3) * MINI_TILEX + 1, (ystart + 1) * MINI_TILEY + 1, @@ -9491,10 +8749,8 @@ static void HandleDrawingAreas(struct GadgetInfo *gi) if (!started_inside_drawing_area) return; -#if 1 if (!IS_VALID_BUTTON(button)) return; -#endif if (!button && !button_release_event) return; @@ -9835,14 +9091,7 @@ static void HandleSelectboxGadgets(struct GadgetInfo *gi) { /* when changing action type, also check action mode and action arg */ if (value_old != value_new) - { -#if 1 setSelectboxSpecialActionVariablesIfNeeded(); -#else - custom_element_change.action_mode = -1; - custom_element_change.action_arg = -1; -#endif - } DrawPropertiesChange(); } @@ -10015,14 +9264,6 @@ static void HandleControlButtons(struct GadgetInfo *gi) int new_element = BUTTON_ELEMENT(button); int x, y; -#if 0 - /* MAKES PROBLEMS WITH ELEMENT LIST SCROLLBAR AND IS PROBABLY NOT NEEDED */ - /* !!! CHECK WHAT HAPPENS WHEN MOUSE WHEEL IS USED OVER ELEMENT LIST !!! */ - - if (!IS_VALID_BUTTON(button)) - return; -#endif - if (edit_mode == ED_MODE_DRAWING && drawing_function == GADGET_ID_TEXT) DrawLevelText(0, 0, 0, TEXT_END); @@ -10569,15 +9810,8 @@ void HandleLevelEditorIdle() if (!DelayReached(&action_delay, action_delay_value)) return; -#if 1 DrawEditorElementAnimation(SX + xpos * TILEX, SY + ypos * TILEY + MINI_TILEY / 2); -#else - DrawGraphicAnimationExt(drawto, - SX + xpos * TILEX, - SY + ypos * TILEY + MINI_TILEY / 2, - el2img(properties_element), -1, NO_MASKING); -#endif MarkTileDirty(xpos, ypos); MarkTileDirty(xpos, ypos + 1); @@ -10629,11 +9863,6 @@ void PrintEditorGadgetInfoText(struct GadgetInfo *gi) void HandleEditorGadgetInfoText(void *ptr) { struct GadgetInfo *gi = (struct GadgetInfo *)ptr; -#if 0 - char infotext[MAX_OUTPUT_LINESIZE + 1]; - char shortcut[MAX_OUTPUT_LINESIZE + 1]; - int max_infotext_len = getMaxInfoTextLength(); -#endif if (game_status != GAME_MODE_EDITOR) return; @@ -10647,38 +9876,7 @@ void HandleEditorGadgetInfoText(void *ptr) if (edit_mode == ED_MODE_DRAWING && draw_with_brush) DeleteBrushFromCursor(); -#if 1 PrintEditorGadgetInfoText(gi); -#else - if (gi == NULL || gi->info_text == NULL) - return; - - strncpy(infotext, gi->info_text, max_infotext_len); - infotext[max_infotext_len] = '\0'; - - if (gi->custom_id < ED_NUM_CTRL_BUTTONS) - { - int key = control_info[gi->custom_id].shortcut; - - if (key) - { - if (gi->custom_id == GADGET_ID_SINGLE_ITEMS) /* special case 1 */ - sprintf(shortcut, " ('.' or '%c')", key); - else if (gi->custom_id == GADGET_ID_PICK_ELEMENT) /* special case 2 */ - sprintf(shortcut, " ('%c' or 'Ctrl')", key); - else if (gi->custom_id == GADGET_ID_TEST) /* special case 3 */ - sprintf(shortcut, " ('Enter' or 'Shift-%c')", key); - else /* normal case */ - sprintf(shortcut, " ('%s%c')", - (key >= 'A' && key <= 'Z' ? "Shift-" : ""), key); - - if (strlen(infotext) + strlen(shortcut) <= max_infotext_len) - strcat(infotext, shortcut); - } - } - - DrawText(INFOTEXT_XPOS, INFOTEXT_YPOS, infotext, FONT_TEXT_2); -#endif } static void HandleDrawingAreaInfo(struct GadgetInfo *gi) @@ -10842,12 +10040,8 @@ void RequestExitLevelEditor(boolean ask_if_level_has_changed) Request("Level has changed ! Exit without saving ?", REQ_ASK | REQ_STAY_OPEN)) { -#if 1 CloseDoor(DOOR_CLOSE_1); SetDoorState(DOOR_CLOSE_2); -#else - CloseDoor(DOOR_CLOSE_ALL); -#endif game_status = GAME_MODE_MAIN; DrawMainMenu(); } diff --git a/src/editor.h b/src/editor.h index 62617108..245e0566 100644 --- a/src/editor.h +++ b/src/editor.h @@ -1,7 +1,7 @@ /*********************************************************** * Rocks'n'Diamonds -- McDuffin Strikes Back! * *----------------------------------------------------------* -* (c) 1995-2002 Artsoft Entertainment * +* (c) 1995-2006 Artsoft Entertainment * * Holger Schemel * * Detmolder Strasse 189 * * 33604 Bielefeld * @@ -16,10 +16,6 @@ #include "main.h" -/* number of element button columns and rows in the edit window */ -#define MAX_ELEM_X 4 -#define MAX_ELEM_Y 10 - void CreateLevelEditorGadgets(); void FreeLevelEditorGadgets(); void UnmapLevelEditorGadgets(); diff --git a/src/engines.h b/src/engines.h index 8559dc55..4f894e92 100644 --- a/src/engines.h +++ b/src/engines.h @@ -1,7 +1,7 @@ /*********************************************************** * Artsoft Retro-Game Library * *----------------------------------------------------------* -* (c) 1994-2004 Artsoft Entertainment * +* (c) 1994-2006 Artsoft Entertainment * * Holger Schemel * * Detmolder Strasse 189 * * 33604 Bielefeld * diff --git a/src/events.c b/src/events.c index 4cb4b109..c0bfafa1 100644 --- a/src/events.c +++ b/src/events.c @@ -24,6 +24,9 @@ #include "network.h" +#define DEBUG_EVENTS 0 + + static boolean cursor_inside_playfield = FALSE; static boolean playfield_cursor_set = FALSE; static unsigned long playfield_cursor_delay = 0; @@ -315,7 +318,7 @@ void HandleExposeEvent(ExposeEvent *event) void HandleButtonEvent(ButtonEvent *event) { -#if 0 +#if DEBUG_EVENTS printf("::: BUTTON EVENT: button %d %s\n", event->button, event->type == EVENT_BUTTONPRESS ? "pressed" : "released"); #endif @@ -350,7 +353,7 @@ void HandleKeyEvent(KeyEvent *event) Key key = GetEventKey(event, with_modifiers); Key keymod = (with_modifiers ? GetEventKey(event, FALSE) : key); -#if 0 +#if DEBUG_EVENTS printf("::: KEY EVENT: %d %s\n", GetEventKey(event, TRUE), event->type == EVENT_KEYPRESS ? "pressed" : "released"); #endif @@ -512,7 +515,7 @@ static void HandleKeysSpecial(Key key) cheat_input[cheat_input_len++] = letter; cheat_input[cheat_input_len] = '\0'; -#if 0 +#if DEBUG_EVENTS printf("::: '%s' [%d]\n", cheat_input, cheat_input_len); #endif @@ -700,13 +703,7 @@ void HandleKey(Key key, int key_status) if (game_status == GAME_MODE_PLAYING && AllPlayersGone && (key == KSYM_Return || key == setup.shortcut.toggle_pause)) { -#if 1 GameEnd(); -#else - CloseDoor(DOOR_CLOSE_1); - game_status = GAME_MODE_MAIN; - DrawMainMenu(); -#endif return; } @@ -837,38 +834,6 @@ void HandleKey(Key key, int key_status) } break; -#if 0 - case GAME_MODE_SCORES: - switch(key) - { - case KSYM_space: - case KSYM_Return: - HandleHallOfFame(0, 0, 0, 0, MB_MENU_CHOICE); - break; - - case KSYM_Escape: -#if 1 - HandleHallOfFame(0, 0, 0, 0, MB_MENU_LEAVE); -#else - game_status = GAME_MODE_MAIN; - DrawMainMenu(); -#endif - break; - - case KSYM_Page_Up: - HandleHallOfFame(0, 0, 0, -1 * SCROLL_PAGE, MB_MENU_MARK); - break; - - case KSYM_Page_Down: - HandleHallOfFame(0, 0, 0, +1 * SCROLL_PAGE, MB_MENU_MARK); - break; - - default: - break; - } - break; -#endif - case GAME_MODE_EDITOR: if (!anyTextGadgetActiveOrJustFinished || key == KSYM_Escape) HandleLevelEditorKeyInput(key); @@ -1082,13 +1047,7 @@ void HandleJoystick() if (AllPlayersGone && newbutton) { -#if 1 GameEnd(); -#else - CloseDoor(DOOR_CLOSE_1); - game_status = GAME_MODE_MAIN; - DrawMainMenu(); -#endif return; } diff --git a/src/events.h b/src/events.h index da370708..16b15ebd 100644 --- a/src/events.h +++ b/src/events.h @@ -1,7 +1,7 @@ /*********************************************************** * Rocks'n'Diamonds -- McDuffin Strikes Back! * *----------------------------------------------------------* -* (c) 1995-2002 Artsoft Entertainment * +* (c) 1995-2006 Artsoft Entertainment * * Holger Schemel * * Detmolder Strasse 189 * * 33604 Bielefeld * diff --git a/src/files.c b/src/files.c index 16fbe2bc..8c2b6e1b 100644 --- a/src/files.c +++ b/src/files.c @@ -1398,16 +1398,10 @@ static void copyConfigFromConfigList(struct LevelFileConfigInfo *conf) } } -#if 1 void copyElementInfo(struct ElementInfo *ei_from, struct ElementInfo *ei_to) { -#if 1 int i; -#else - int i, x, y; -#endif -#if 1 xx_ei = *ei_from; /* copy element data into temporary buffer */ yy_ei = *ei_to; /* copy element data into temporary buffer */ @@ -1415,56 +1409,6 @@ void copyElementInfo(struct ElementInfo *ei_from, struct ElementInfo *ei_to) *ei_from = xx_ei; *ei_to = yy_ei; -#endif - -#if 0 - /* ---------- copy element description ---------- */ - for (i = 0; i < MAX_ELEMENT_NAME_LEN + 1; i++) - ei_to->description[i] = ei_from->description[i]; - - /* ---------- copy element base properties ---------- */ - ei_to->properties[EP_BITFIELD_BASE_NR] = - ei_from->properties[EP_BITFIELD_BASE_NR]; - - /* ---------- copy custom property values ---------- */ - - ei_to->use_gfx_element = ei_from->use_gfx_element; - ei_to->gfx_element = ei_from->gfx_element; - - ei_to->access_direction = ei_from->access_direction; - - ei_to->collect_score_initial = ei_from->collect_score_initial; - ei_to->collect_count_initial = ei_from->collect_count_initial; - - ei_to->ce_value_fixed_initial = ei_from->ce_value_fixed_initial; - ei_to->ce_value_random_initial = ei_from->ce_value_random_initial; - ei_to->use_last_ce_value = ei_from->use_last_ce_value; - - ei_to->push_delay_fixed = ei_from->push_delay_fixed; - ei_to->push_delay_random = ei_from->push_delay_random; - ei_to->drop_delay_fixed = ei_from->drop_delay_fixed; - ei_to->drop_delay_random = ei_from->drop_delay_random; - ei_to->move_delay_fixed = ei_from->move_delay_fixed; - ei_to->move_delay_random = ei_from->move_delay_random; - - ei_to->move_pattern = ei_from->move_pattern; - ei_to->move_direction_initial = ei_from->move_direction_initial; - ei_to->move_stepsize = ei_from->move_stepsize; - - ei_to->move_enter_element = ei_from->move_enter_element; - ei_to->move_leave_element = ei_from->move_leave_element; - ei_to->move_leave_type = ei_from->move_leave_type; - - ei_to->slippery_type = ei_from->slippery_type; - - ei_to->explosion_type = ei_from->explosion_type; - ei_to->explosion_delay = ei_from->explosion_delay; - ei_to->ignition_delay = ei_from->ignition_delay; - - for (y = 0; y < 3; y++) - for (x = 0; x < 3; x++) - ei_to->content.e[x][y] = ei_from->content.e[x][y]; -#endif /* ---------- reinitialize and copy change pages ---------- */ @@ -1483,7 +1427,6 @@ void copyElementInfo(struct ElementInfo *ei_from, struct ElementInfo *ei_to) /* mark this custom element as modified */ ei_to->modified_settings = TRUE; } -#endif void setElementChangePages(struct ElementInfo *ei, int change_pages) { @@ -1502,11 +1445,6 @@ void setElementChangePages(struct ElementInfo *ei, int change_pages) void setElementChangeInfoToDefaults(struct ElementChangeInfo *change) { -#if 0 - int i, x, y; -#endif - -#if 1 xx_change = *change; /* copy change data into temporary buffer */ xx_num_contents = 1; @@ -1515,42 +1453,6 @@ void setElementChangeInfoToDefaults(struct ElementChangeInfo *change) *change = xx_change; resetEventFlags(change); -#endif - -#if 0 - change->can_change = FALSE; - - for (i = 0; i < NUM_CHANGE_EVENTS; i++) - change->has_event[i] = FALSE; - - change->trigger_player = CH_PLAYER_ANY; - change->trigger_side = CH_SIDE_ANY; - change->trigger_page = CH_PAGE_ANY; - - change->target_element = EL_EMPTY_SPACE; - - change->delay_fixed = 0; - change->delay_random = 0; - change->delay_frames = FRAMES_PER_SECOND; - - change->trigger_element = EL_EMPTY_SPACE; - - change->explode = FALSE; - change->use_target_content = FALSE; - change->only_if_complete = FALSE; - change->use_random_replace = FALSE; - change->random_percentage = 100; - change->replace_when = CP_WHEN_EMPTY; - - change->has_action = FALSE; - change->action_type = CA_NO_ACTION; - change->action_mode = CA_MODE_UNDEFINED; - change->action_arg = CA_ARG_UNDEFINED; - - for (x = 0; x < 3; x++) - for (y = 0; y < 3; y++) - change->target_content.e[x][y] = EL_EMPTY_SPACE; -#endif change->direct_action = 0; change->other_action = 0; @@ -1563,142 +1465,34 @@ void setElementChangeInfoToDefaults(struct ElementChangeInfo *change) static void setLevelInfoToDefaults(struct LevelInfo *level) { static boolean clipboard_elements_initialized = FALSE; -#if 0 - int i, j, x, y; -#else int i, x, y; -#endif -#if 1 InitElementPropertiesStatic(); -#endif -#if 1 li = *level; /* copy level data into temporary buffer */ setConfigToDefaultsFromConfigList(chunk_config_INFO); setConfigToDefaultsFromConfigList(chunk_config_ELEM); *level = li; /* copy temporary buffer back to level data */ -#endif setLevelInfoToDefaults_EM(); level->native_em_level = &native_em_level; -#if 0 - level->game_engine_type = GAME_ENGINE_TYPE_RND; -#endif - level->file_version = FILE_VERSION_ACTUAL; level->game_version = GAME_VERSION_ACTUAL; level->creation_date = getCurrentDate(); -#if 1 level->encoding_16bit_field = TRUE; level->encoding_16bit_yamyam = TRUE; level->encoding_16bit_amoeba = TRUE; -#else - level->encoding_16bit_field = FALSE; /* default: only 8-bit elements */ - level->encoding_16bit_yamyam = FALSE; /* default: only 8-bit elements */ - level->encoding_16bit_amoeba = FALSE; /* default: only 8-bit elements */ -#endif - -#if 0 - level->fieldx = STD_LEV_FIELDX; - level->fieldy = STD_LEV_FIELDY; -#endif for (x = 0; x < MAX_LEV_FIELDX; x++) for (y = 0; y < MAX_LEV_FIELDY; y++) level->field[x][y] = EL_SAND; -#if 0 - level->time = 100; - level->gems_needed = 0; - - level->amoeba_speed = 10; - - level->time_magic_wall = 10; - level->time_wheel = 10; -#endif -#if 0 - level->time_light = 10; - level->time_timegate = 10; -#endif - -#if 0 - level->amoeba_content = EL_DIAMOND; -#endif - -#if 0 - level->game_of_life[0] = 2; - level->game_of_life[1] = 3; - level->game_of_life[2] = 3; - level->game_of_life[3] = 3; - - level->biomaze[0] = 2; - level->biomaze[1] = 3; - level->biomaze[2] = 3; - level->biomaze[3] = 3; -#endif - -#if 0 - level->double_speed = FALSE; -#endif -#if 0 - level->initial_gravity = FALSE; - level->em_slippery_gems = FALSE; - level->instant_relocation = FALSE; - level->can_pass_to_walkable = FALSE; - level->grow_into_diggable = TRUE; -#endif - -#if 0 - level->block_snap_field = TRUE; -#endif - -#if 0 - level->block_last_field = FALSE; /* EM does not block by default */ - level->sp_block_last_field = TRUE; /* SP blocks the last field */ - - level->can_move_into_acid_bits = ~0; /* everything can move into acid */ - level->dont_collide_with_bits = ~0; /* always deadly when colliding */ - - level->use_spring_bug = FALSE; - level->use_time_orb_bug = FALSE; - - level->use_step_counter = FALSE; -#endif - - /* values for the new EMC elements */ -#if 0 - level->android_move_time = 10; - level->android_clone_time = 10; - level->ball_time = 10; - level->lenses_score = 10; - level->lenses_time = 10; - level->magnify_score = 10; - level->magnify_time = 10; - level->slurp_score = 10; - level->wind_direction_initial = MV_NONE; - level->ball_random = FALSE; - level->ball_state_initial = FALSE; - - for (i = 0; i < MAX_ELEMENT_CONTENTS; i++) - for (x = 0; x < 3; x++) - for (y = 0; y < 3; y++) - level->ball_content[i].e[x][y] = EL_EMPTY; - - for (i = 0; i < 16; i++) - level->android_array[i] = FALSE; -#endif - -#if 0 - level->use_custom_template = FALSE; -#endif - for (i = 0; i < MAX_LEVEL_NAME_LEN; i++) level->name[i] = '\0'; for (i = 0; i < MAX_LEVEL_AUTHOR_LEN; i++) @@ -1707,29 +1501,6 @@ static void setLevelInfoToDefaults(struct LevelInfo *level) strcpy(level->name, NAMELESS_LEVEL_NAME); strcpy(level->author, ANONYMOUS_NAME); -#if 0 - for (i = 0; i < 4; i++) - { - level->envelope_text[i][0] = '\0'; - level->envelope_xsize[i] = MAX_ENVELOPE_XSIZE; - level->envelope_ysize[i] = MAX_ENVELOPE_YSIZE; - } -#endif - -#if 0 - for (i = 0; i < LEVEL_SCORE_ELEMENTS; i++) - level->score[i] = (i == SC_TIME_BONUS ? 1 : 10); -#endif - -#if 0 - level->num_yamyam_contents = STD_ELEMENT_CONTENTS; - for (i = 0; i < MAX_ELEMENT_CONTENTS; i++) - for (x = 0; x < 3; x++) - for (y = 0; y < 3; y++) - level->yamyam_content[i].e[x][y] = - (i < STD_ELEMENT_CONTENTS ? EL_ROCK : EL_EMPTY); -#endif - level->field[0][0] = EL_PLAYER_1; level->field[STD_LEV_FIELDX - 1][STD_LEV_FIELDY - 1] = EL_EXIT_CLOSED; @@ -1752,7 +1523,6 @@ static void setLevelInfoToDefaults(struct LevelInfo *level) level->envelope[envelope_nr] = xx_envelope; } -#if 1 if (IS_CUSTOM_ELEMENT(element) || IS_GROUP_ELEMENT(element) || IS_INTERNAL_ELEMENT(element)) @@ -1763,7 +1533,6 @@ static void setLevelInfoToDefaults(struct LevelInfo *level) *ei = xx_ei; } -#endif setElementChangePages(ei, 1); setElementChangeInfoToDefaults(ei->change); @@ -1772,22 +1541,7 @@ static void setLevelInfoToDefaults(struct LevelInfo *level) IS_GROUP_ELEMENT(element) || IS_INTERNAL_ELEMENT(element)) { -#if 1 setElementDescriptionToDefault(ei); -#else - for (j = 0; j < MAX_ELEMENT_NAME_LEN + 1; j++) - ei->description[j] = '\0'; - - if (ei->custom_description != NULL) - strncpy(ei->description, ei->custom_description,MAX_ELEMENT_NAME_LEN); - else - strcpy(ei->description, ei->editor_description); -#endif - -#if 0 - ei->use_gfx_element = FALSE; - ei->gfx_element = EL_EMPTY_SPACE; -#endif ei->modified_settings = FALSE; } @@ -1795,46 +1549,6 @@ static void setLevelInfoToDefaults(struct LevelInfo *level) if (IS_CUSTOM_ELEMENT(element) || IS_INTERNAL_ELEMENT(element)) { -#if 0 - ei->access_direction = MV_ALL_DIRECTIONS; - - ei->collect_score_initial = 10; /* special default */ - ei->collect_count_initial = 1; /* special default */ - - ei->ce_value_fixed_initial = 0; - ei->ce_value_random_initial = 0; - ei->use_last_ce_value = FALSE; - -#endif -#if 0 - ei->push_delay_fixed = -1; /* initialize later */ - ei->push_delay_random = -1; /* initialize later */ -#endif -#if 0 - ei->drop_delay_fixed = 0; - ei->drop_delay_random = 0; - ei->move_delay_fixed = 0; - ei->move_delay_random = 0; - - ei->move_pattern = MV_ALL_DIRECTIONS; - ei->move_direction_initial = MV_START_AUTOMATIC; - ei->move_stepsize = TILEX / 8; - - ei->move_enter_element = EL_EMPTY_SPACE; - ei->move_leave_element = EL_EMPTY_SPACE; - ei->move_leave_type = LEAVE_TYPE_UNLIMITED; - - ei->slippery_type = SLIPPERY_ANY_RANDOM; - - ei->explosion_type = EXPLODES_3X3; - ei->explosion_delay = 16; - ei->ignition_delay = 8; - - for (x = 0; x < 3; x++) - for (y = 0; y < 3; y++) - ei->content.e[x][y] = EL_EMPTY_SPACE; -#endif - /* internal values used in level editor */ ei->access_type = 0; @@ -1849,24 +1563,6 @@ static void setLevelInfoToDefaults(struct LevelInfo *level) ei->can_explode_impact = FALSE; ei->current_change_page = 0; - -#if 0 - /* !!! now done in InitElementPropertiesStatic() (see above) !!! */ - /* !!! (else properties set there will be overwritten here) !!! */ - /* start with no properties at all */ -#if 1 - for (j = 0; j < NUM_EP_BITFIELDS; j++) - ei->properties[j] = EP_BITMASK_DEFAULT; -#else - for (j = 0; j < NUM_EP_BITFIELDS; j++) - Properties[element][j] = EP_BITMASK_DEFAULT; -#endif -#endif - -#if 0 - /* now set default properties */ - SET_PROPERTY(element, EP_CAN_MOVE_INTO_ACID, TRUE); -#endif } if (IS_GROUP_ELEMENT(element) || @@ -1880,23 +1576,11 @@ static void setLevelInfoToDefaults(struct LevelInfo *level) group = ei->group; -#if 1 xx_group = *group; /* copy group data into temporary buffer */ setConfigToDefaultsFromConfigList(chunk_config_GRPX); *group = xx_group; -#endif - -#if 0 - for (j = 0; j < MAX_ELEMENTS_IN_GROUP; j++) - group->element[j] = EL_EMPTY_SPACE; - - /* default: only one element in group */ - group->num_elements = 1; - - group->choice_mode = ANIM_RANDOM; -#endif } } @@ -1953,15 +1637,9 @@ static void setFileInfoToDefaults(struct LevelFileInfo *level_file_info) static void ActivateLevelTemplate() { -#if 1 /* Currently there is no special action needed to activate the template data, because 'element_info' property settings overwrite the original level data, while all other variables do not change. */ -#else - /* Currently there is no special action needed to activate the template - data, because 'element_info' and 'Properties' overwrite the original - level data, while all other variables do not change. */ -#endif } static char *getLevelFilenameFromBasename(char *basename) @@ -2569,28 +2247,15 @@ static int LoadLevel_CUS1(FILE *file, int chunk_size, struct LevelInfo *level) int element = getMappedElement(getFile16BitBE(file)); int properties = getFile32BitBE(file); -#if 1 if (IS_CUSTOM_ELEMENT(element)) element_info[element].properties[EP_BITFIELD_BASE_NR] = properties; else Error(ERR_WARN, "invalid custom element number %d", element); -#else - if (IS_CUSTOM_ELEMENT(element)) - Properties[element][EP_BITFIELD_BASE_NR] = properties; - else - Error(ERR_WARN, "invalid custom element number %d", element); -#endif -#if 1 /* older game versions that wrote level files with CUS1 chunks used different default push delay values (not yet stored in level file) */ element_info[element].push_delay_fixed = 2; element_info[element].push_delay_random = 8; -#else - /* needed for older levels (see src/init.c for details) */ - element_info[element].push_delay_fixed = -1; /* initialize later */ - element_info[element].push_delay_random = -1; /* initialize later */ -#endif } return chunk_size; @@ -2651,11 +2316,7 @@ static int LoadLevel_CUS3(FILE *file, int chunk_size, struct LevelInfo *level) ei->description[j] = getFile8Bit(file); ei->description[MAX_ELEMENT_NAME_LEN] = 0; -#if 1 ei->properties[EP_BITFIELD_BASE_NR] = getFile32BitBE(file); -#else - Properties[element][EP_BITFIELD_BASE_NR] = getFile32BitBE(file); -#endif /* some free bytes for future properties and padding */ ReadUnusedBytesFromFile(file, 7); @@ -2742,11 +2403,8 @@ static int LoadLevel_CUS4(FILE *file, int chunk_size, struct LevelInfo *level) ei->description[i] = getFile8Bit(file); ei->description[MAX_ELEMENT_NAME_LEN] = 0; -#if 1 ei->properties[EP_BITFIELD_BASE_NR] = getFile32BitBE(file); -#else - Properties[element][EP_BITFIELD_BASE_NR] = getFile32BitBE(file); -#endif + ReadUnusedBytesFromFile(file, 4); /* reserved for more base properties */ ei->num_change_pages = getFile8Bit(file); @@ -2928,10 +2586,6 @@ static int LoadLevel_MicroChunk(FILE *file, struct LevelFileConfigInfo *conf, int num_bytes = getFile16BitBE(file); byte *buffer = checked_malloc(num_bytes); -#if 0 - printf("::: - found multi bytes\n"); -#endif - ReadBytesFromFile(file, buffer, num_bytes); for (i = 0; conf[i].data_type != -1; i++) @@ -3001,10 +2655,6 @@ static int LoadLevel_MicroChunk(FILE *file, struct LevelFileConfigInfo *conf, byte_mask == CONF_MASK_2_BYTE ? getFile16BitBE(file) : byte_mask == CONF_MASK_4_BYTE ? getFile32BitBE(file) : 0); -#if 0 - printf("::: - found single bytes\n"); -#endif - for (i = 0; conf[i].data_type != -1; i++) { if (conf[i].element == element && @@ -3091,131 +2741,20 @@ static int LoadLevel_ELEM(FILE *file, int chunk_size, struct LevelInfo *level) { int real_chunk_size = 0; -#if 1 li = *level; /* copy level data into temporary buffer */ -#endif while (!feof(file)) { int element = getMappedElement(getFile16BitBE(file)); -#if 1 + real_chunk_size += 2; real_chunk_size += LoadLevel_MicroChunk(file, chunk_config_ELEM, element, element); -#else - int conf_type = getFile8Bit(file); - int byte_mask = conf_type & CONF_MASK_BYTES; - boolean element_found = FALSE; - int i; - - real_chunk_size += 3; - -#if 0 - li = *level; /* copy level data into temporary buffer */ -#endif - - if (byte_mask == CONF_MASK_MULTI_BYTES) - { - int num_bytes = getFile16BitBE(file); - byte *buffer = checked_malloc(num_bytes); - - ReadBytesFromFile(file, buffer, num_bytes); - - for (i = 0; chunk_config_ELEM[i].data_type != -1; i++) - { - if (chunk_config_ELEM[i].element == element && - chunk_config_ELEM[i].conf_type == conf_type) - { - int data_type = chunk_config_ELEM[i].data_type; - int num_entities = num_bytes / CONF_ENTITY_NUM_BYTES(data_type); - int max_num_entities = chunk_config_ELEM[i].max_num_entities; - - if (num_entities > max_num_entities) - { - Error(ERR_WARN, - "truncating number of entities for element %d from %d to %d", - element, num_entities, max_num_entities); - - num_entities = max_num_entities; - } - - *(int *)(chunk_config_ELEM[i].num_entities) = num_entities; - - element_found = TRUE; - - if (data_type == TYPE_ELEMENT_LIST) - { - int *element_array = (int *)(chunk_config_ELEM[i].value); - int j; - - for (j = 0; j < num_entities; j++) - element_array[j] = - getMappedElement(CONF_ELEMENTS_ELEMENT(buffer, j)); - } - else if (data_type == TYPE_CONTENT_LIST) - { - struct Content *content= (struct Content *)(chunk_config_ELEM[i].value); - int c, x, y; - - for (c = 0; c < num_entities; c++) - for (y = 0; y < 3; y++) - for (x = 0; x < 3; x++) - content[c].e[x][y] = - getMappedElement(CONF_CONTENTS_ELEMENT(buffer, c, x, y)); - } - else - element_found = FALSE; - - break; - } - } - - checked_free(buffer); - - real_chunk_size += 2 + num_bytes; - } - else /* constant size configuration data (1, 2 or 4 bytes) */ - { - int value = (byte_mask == CONF_MASK_1_BYTE ? getFile8Bit (file) : - byte_mask == CONF_MASK_2_BYTE ? getFile16BitBE(file) : - byte_mask == CONF_MASK_4_BYTE ? getFile32BitBE(file) : 0); - - for (i = 0; chunk_config_ELEM[i].data_type != -1; i++) - { - if (chunk_config_ELEM[i].element == element && - chunk_config_ELEM[i].conf_type == conf_type) - { - int data_type = chunk_config_ELEM[i].data_type; - - if (data_type == TYPE_BOOLEAN) - *(boolean *)(chunk_config_ELEM[i].value) = value; - else - *(int *) (chunk_config_ELEM[i].value) = value; - - element_found = TRUE; - - break; - } - } - - real_chunk_size += CONF_VALUE_NUM_BYTES(byte_mask); - } - - if (!element_found) - Error(ERR_WARN, "cannot load CONF value for element %d", element); -#endif - -#if 0 - *level = li; /* copy temporary buffer back to level data */ -#endif - if (real_chunk_size >= chunk_size) break; } -#if 1 *level = li; /* copy temporary buffer back to level data */ -#endif return real_chunk_size; } @@ -3247,10 +2786,6 @@ static int LoadLevel_CUSX(FILE *file, int chunk_size, struct LevelInfo *level) struct ElementInfo *ei = &element_info[element]; int i; -#if 0 - printf("::: CUSX: loading element '%s' ...\n", EL_NAME(element)); -#endif - xx_ei = *ei; /* copy element data into temporary buffer */ xx_ei.num_change_pages = -1; @@ -3259,11 +2794,6 @@ static int LoadLevel_CUSX(FILE *file, int chunk_size, struct LevelInfo *level) { real_chunk_size += LoadLevel_MicroChunk(file, chunk_config_CUSX_base, -1, element); - -#if 0 - printf("::: - real_chunk_size now %d\n", real_chunk_size); -#endif - if (xx_ei.num_change_pages != -1) break; @@ -3930,14 +3460,6 @@ void CopyNativeLevel_RND_to_EM(struct LevelInfo *level) struct PLAYER **ply = level_em->ply; int i, j, x, y; -#if 0 - printf("::: A\n"); - for (i = 0; i < MAX_ELEMENT_CONTENTS; i++) - for (j = 0; j < 8; j++) - printf("::: ball %d, %d: %d\n", i, j, - level->ball_content[i].e[ball_xy[j][0]][ball_xy[j][1]]); -#endif - lev->width = MIN(level->fieldx, EM_MAX_CAVE_WIDTH); lev->height = MIN(level->fieldy, EM_MAX_CAVE_HEIGHT); @@ -3990,41 +3512,13 @@ void CopyNativeLevel_RND_to_EM(struct LevelInfo *level) map_element_RND_to_EM(level-> ball_content[i].e[ball_xy[j][0]][ball_xy[j][1]]); -#if 0 - for (i = 0; i < MAX_ELEMENT_CONTENTS; i++) - for (j = 0; j < 8; j++) - printf("::: ball %d, %d: %d\n", i, j, - level->ball_content[i].e[ball_xy[j][0]][ball_xy[j][1]]); -#endif - map_android_clone_elements_RND_to_EM(level); -#if 0 - for (i = 0; i < 16; i++) - lev->android_array[i] = FALSE; /* !!! YET TO COME !!! */ -#endif - /* first fill the complete playfield with the default border element */ for (y = 0; y < EM_MAX_CAVE_HEIGHT; y++) for (x = 0; x < EM_MAX_CAVE_WIDTH; x++) level_em->cave[x][y] = ZBORDER; -#if 1 - -#if 0 -#if 1 - LoadLevel_InitPlayfield(); -#else - lev_fieldx = lev->width; /* !!! also in LoadLevel_InitPlayfield() !!! */ - lev_fieldy = lev->height; /* !!! also in LoadLevel_InitPlayfield() !!! */ - SetBorderElement(); /* !!! also in LoadLevel_InitPlayfield() !!! */ -#endif -#endif - -#if 0 - printf("::: BorderElement == %d\n", BorderElement); -#endif - if (BorderElement == EL_STEELWALL) { for (y = 0; y < lev->height + 2; y++) @@ -4046,93 +3540,33 @@ void CopyNativeLevel_RND_to_EM(struct LevelInfo *level) level_em->cave[xx][yy] = new_element; } -#else - - /* then copy the real level contents from level file into the playfield */ - for (y = 0; y < lev->height; y++) for (x = 0; x < lev->width; x++) - { - int new_element = map_element_RND_to_EM(level->field[x][y]); - - if (level->field[x][y] == EL_AMOEBA_DEAD) - new_element = map_element_RND_to_EM(EL_AMOEBA_WET); - - level_em->cave[x + 1][y + 1] = new_element; - } - -#endif - -#if 1 - for (i = 0; i < MAX_PLAYERS; i++) { ply[i]->x_initial = 0; ply[i]->y_initial = 0; } -#else - - ply1->x_initial = 0; - ply1->y_initial = 0; - - ply2->x_initial = 0; - ply2->y_initial = 0; - -#endif - /* initialize player positions and delete players from the playfield */ for (y = 0; y < lev->height; y++) for (x = 0; x < lev->width; x++) { - -#if 1 if (ELEM_IS_PLAYER(level->field[x][y])) { int player_nr = GET_PLAYER_NR(level->field[x][y]); int offset = (BorderElement == EL_STEELWALL ? 1 : 0); int xx = x + 1 + offset; - int yy = y + 1 + offset; - - ply[player_nr]->x_initial = xx; - ply[player_nr]->y_initial = yy; - - level_em->cave[xx][yy] = map_element_RND_to_EM(EL_EMPTY); - } - -#else - -#if 1 - /* !!! CURRENTLY ONLY SUPPORT FOR ONE PLAYER !!! */ - if (ELEM_IS_PLAYER(level->field[x][y])) - { - ply1->x_initial = x + 1; - ply1->y_initial = y + 1; - level_em->cave[x + 1][y + 1] = map_element_RND_to_EM(EL_EMPTY); - } -#else - /* !!! ADD SUPPORT FOR MORE THAN ONE PLAYER !!! */ - if (level->field[x][y] == EL_PLAYER_1) - { - ply1->x_initial = x + 1; - ply1->y_initial = y + 1; - level_em->cave[x + 1][y + 1] = map_element_RND_to_EM(EL_EMPTY); - } - else if (level->field[x][y] == EL_PLAYER_2) - { - ply2->x_initial = x + 1; - ply2->y_initial = y + 1; - level_em->cave[x + 1][y + 1] = map_element_RND_to_EM(EL_EMPTY); - } -#endif + int yy = y + 1 + offset; -#endif + ply[player_nr]->x_initial = xx; + ply[player_nr]->y_initial = yy; + level_em->cave[xx][yy] = map_element_RND_to_EM(EL_EMPTY); + } } if (BorderElement == EL_STEELWALL) { -#if 1 lev->width += 2; lev->height += 2; -#endif } } @@ -4202,34 +3636,13 @@ void CopyNativeLevel_EM_to_RND(struct LevelInfo *level) level->wind_direction_initial = map_direction_EM_to_RND(lev->wind_direction_initial); -#if 0 - printf("::: foo\n"); - for (i = 0; i < MAX_ELEMENT_CONTENTS; i++) - for (j = 0; j < 8; j++) - printf("::: ball %d, %d: %d\n", i, j, - level->ball_content[i].e[ball_xy[j][0]][ball_xy[j][1]]); -#endif - for (i = 0; i < MAX_ELEMENT_CONTENTS; i++) for (j = 0; j < 8; j++) level->ball_content[i].e[ball_xy[j][0]][ball_xy[j][1]] = map_element_EM_to_RND(lev->ball_array[i][j]); -#if 0 - printf("::: bar\n"); - for (i = 0; i < MAX_ELEMENT_CONTENTS; i++) - for (j = 0; j < 8; j++) - printf("::: ball %d, %d: %d\n", i, j, - level->ball_content[i].e[ball_xy[j][0]][ball_xy[j][1]]); -#endif - map_android_clone_elements_EM_to_RND(level); -#if 0 - for (i = 0; i < 16; i++) - level->android_array[i] = FALSE; /* !!! YET TO COME !!! */ -#endif - /* convert the playfield (some elements need special treatment) */ for (y = 0; y < level->fieldy; y++) for (x = 0; x < level->fieldx; x++) { @@ -4241,16 +3654,6 @@ void CopyNativeLevel_EM_to_RND(struct LevelInfo *level) level->field[x][y] = new_element; } -#if 0 - printf("::: bar 0\n"); - for (i = 0; i < MAX_ELEMENT_CONTENTS; i++) - for (j = 0; j < 8; j++) - printf("::: ball %d, %d: %d\n", i, j, - level->ball_content[i].e[ball_xy[j][0]][ball_xy[j][1]]); -#endif - -#if 1 - for (i = 0; i < MAX_PLAYERS; i++) { /* in case of all players set to the same field, use the first player */ @@ -4258,33 +3661,9 @@ void CopyNativeLevel_EM_to_RND(struct LevelInfo *level) int jx = ply[nr]->x_initial - 1; int jy = ply[nr]->y_initial - 1; -#if 0 - printf("::: player %d: %d, %d\n", nr, jx, jy); -#endif - if (jx != -1 && jy != -1) level->field[jx][jy] = EL_PLAYER_1 + nr; } - -#else - - /* in case of both players set to the same field, use the first player */ - level->field[ply2->x_initial - 1][ply2->y_initial - 1] = EL_PLAYER_2; - level->field[ply1->x_initial - 1][ply1->y_initial - 1] = EL_PLAYER_1; - -#endif - -#if 0 - printf("::: native Emerald Mine file version: %d\n", level_em->file_version); -#endif - -#if 0 - printf("::: bar 2\n"); - for (i = 0; i < MAX_ELEMENT_CONTENTS; i++) - for (j = 0; j < 8; j++) - printf("::: ball %d, %d: %d\n", i, j, - level->ball_content[i].e[ball_xy[j][0]][ball_xy[j][1]]); -#endif } static void LoadLevelFromFileInfo_EM(struct LevelInfo *level, @@ -4302,30 +3681,6 @@ void CopyNativeLevel_RND_to_Native(struct LevelInfo *level) void CopyNativeLevel_Native_to_RND(struct LevelInfo *level) { - -#if 0 - { - static int ball_xy[8][2] = - { - { 0, 0 }, - { 1, 0 }, - { 2, 0 }, - { 0, 1 }, - { 2, 1 }, - { 0, 2 }, - { 1, 2 }, - { 2, 2 }, - }; - int i, j; - - printf("::: A6\n"); - for (i = 0; i < MAX_ELEMENT_CONTENTS; i++) - for (j = 0; j < 8; j++) - printf("::: ball %d, %d: %d\n", i, j, - level->ball_content[i].e[ball_xy[j][0]][ball_xy[j][1]]); - } -#endif - if (level->game_engine_type == GAME_ENGINE_TYPE_EM) CopyNativeLevel_EM_to_RND(level); } @@ -4490,7 +3845,7 @@ static void LoadLevelFromFileStream_SP(FILE *file, struct LevelInfo *level, /* original Supaplex does not use score values -- use default values */ #else for (i = 0; i < LEVEL_SCORE_ELEMENTS; i++) - level->score[i] = 0; /* !!! CORRECT THIS !!! */ + level->score[i] = 0; #endif /* there are no yamyams in supaplex levels */ @@ -4716,15 +4071,8 @@ void LoadLevelFromFileInfo(struct LevelInfo *level, if (level->game_engine_type == GAME_ENGINE_TYPE_UNKNOWN) level->game_engine_type = GAME_ENGINE_TYPE_RND; -#if 1 if (level_file_info->type != LEVEL_FILE_TYPE_RND) CopyNativeLevel_Native_to_RND(level); -#else - if (level_file_info->type == LEVEL_FILE_TYPE_RND) - CopyNativeLevel_RND_to_Native(level); - else - CopyNativeLevel_Native_to_RND(level); -#endif } void LoadLevelFromFilename(struct LevelInfo *level, char *filename) @@ -4749,13 +4097,11 @@ static void LoadLevel_InitVersion(struct LevelInfo *level, char *filename) return; /* all engine modifications also valid for levels which use latest engine */ -#if 1 if (level->game_version < VERSION_IDENT(3,2,0,5)) { /* time bonus score was given for 10 s instead of 1 s before 3.2.0-5 */ level->score[SC_TIME_BONUS] /= 10; } -#endif #if 0 leveldir_current->latest_engine = TRUE; /* !!! TEST ONLY !!! */ @@ -4870,7 +4216,6 @@ static void LoadLevel_InitVersion(struct LevelInfo *level, char *filename) } } -#if 1 /* try to detect and fix "Snake Bite" levels, which are broken with 3.2.0 */ { int element = EL_CUSTOM_START + 255; @@ -4892,7 +4237,6 @@ static void LoadLevel_InitVersion(struct LevelInfo *level, char *filename) change->target_element == EL_SOKOBAN_FIELD_PLAYER) change->target_element = EL_PLAYER_1; } -#endif } static void LoadLevel_InitElements(struct LevelInfo *level, char *filename) @@ -4954,20 +4298,9 @@ static void LoadLevel_InitElements(struct LevelInfo *level, char *filename) if (ei->access_direction == MV_NO_DIRECTION) ei->access_direction = MV_ALL_DIRECTIONS; - -#if 0 - for (j = 0; j < ei->num_change_pages; j++) - { - struct ElementChangeInfo *change = &ei->change_page[j]; - - if (change->trigger_side == CH_SIDE_NONE) - change->trigger_side = CH_SIDE_ANY; - } -#endif } } -#if 1 /* correct custom element values (fix invalid values for all versions) */ if (1) { @@ -4988,7 +4321,6 @@ static void LoadLevel_InitElements(struct LevelInfo *level, char *filename) } } } -#endif /* initialize "can_explode" field for old levels which did not store this */ /* !!! CHECK THIS -- "<= 3,1,0,0" IS PROBABLY WRONG !!! */ @@ -5065,15 +4397,8 @@ static void LoadLevel_InitNativeEngines(struct LevelInfo *level,char *filename) { struct LevelFileInfo *level_file_info = &level->file_info; -#if 1 if (level_file_info->type == LEVEL_FILE_TYPE_RND) CopyNativeLevel_RND_to_Native(level); -#else - if (level_file_info->type == LEVEL_FILE_TYPE_RND) - CopyNativeLevel_RND_to_Native(level); - else - CopyNativeLevel_Native_to_RND(level); -#endif } void LoadLevelTemplate(int nr) @@ -5342,7 +4667,6 @@ static void SaveLevel_CUS1(FILE *file, struct LevelInfo *level, { int element = EL_CUSTOM_START + i; -#if 1 struct ElementInfo *ei = &element_info[element]; if (ei->properties[EP_BITFIELD_BASE_NR] != EP_BITMASK_DEFAULT) @@ -5355,18 +4679,6 @@ static void SaveLevel_CUS1(FILE *file, struct LevelInfo *level, check++; } -#else - if (Properties[element][EP_BITFIELD_BASE_NR] != EP_BITMASK_DEFAULT) - { - if (check < num_changed_custom_elements) - { - putFile16BitBE(file, element); - putFile32BitBE(file, Properties[element][EP_BITFIELD_BASE_NR]); - } - - check++; - } -#endif } if (check != num_changed_custom_elements) /* should not happen */ @@ -5425,11 +4737,7 @@ static void SaveLevel_CUS3(FILE *file, struct LevelInfo *level, for (j = 0; j < MAX_ELEMENT_NAME_LEN; j++) putFile8Bit(file, ei->description[j]); -#if 1 putFile32BitBE(file, ei->properties[EP_BITFIELD_BASE_NR]); -#else - putFile32BitBE(file, Properties[element][EP_BITFIELD_BASE_NR]); -#endif /* some free bytes for future properties and padding */ WriteUnusedBytesToFile(file, 7); @@ -5503,11 +4811,8 @@ static void SaveLevel_CUS4(FILE *file, struct LevelInfo *level, int element) for (i = 0; i < MAX_ELEMENT_NAME_LEN; i++) putFile8Bit(file, ei->description[i]); -#if 1 putFile32BitBE(file, ei->properties[EP_BITFIELD_BASE_NR]); -#else - putFile32BitBE(file, Properties[element][EP_BITFIELD_BASE_NR]); -#endif + WriteUnusedBytesToFile(file, 4); /* reserved for more base properties */ putFile8Bit(file, ei->num_change_pages); @@ -5759,116 +5064,6 @@ static int SaveLevel_MicroChunk(FILE *file, struct LevelFileConfigInfo *entry, return num_bytes; } -#if 0 - -static int SaveLevel_MicroChunk_SingleValue(FILE *file, - struct LevelFileConfigInfo *entry) -{ - int default_value = entry->default_value; - int element = entry->element; - int data_type = entry->data_type; - int conf_type = entry->conf_type; - int byte_mask = conf_type & CONF_MASK_BYTES; - void *value_ptr = entry->value; - int value = (data_type == TYPE_BOOLEAN ? *(boolean *)value_ptr : - *(int *)value_ptr); - int num_bytes = 0; - boolean modified = FALSE; - - /* check if any settings have been modified before saving them */ - if (value != default_value) - modified = TRUE; - - if (!modified) /* do not save unmodified default settings */ - return 0; - -#if 0 - printf("::: %02x, %d: %d != %d\n", - byte_mask, conf_type & CONF_MASK_TOKEN, - value, default_value); -#endif - - if (element != -1) - num_bytes += putFile16BitBE(file, element); - - num_bytes += putFile8Bit(file, conf_type); - num_bytes += (byte_mask == CONF_MASK_1_BYTE ? putFile8Bit (file, value) : - byte_mask == CONF_MASK_2_BYTE ? putFile16BitBE(file, value) : - byte_mask == CONF_MASK_4_BYTE ? putFile32BitBE(file, value) :0); - - return num_bytes; -} - -static int SaveLevel_MicroChunk_ElementList(FILE *file, - struct LevelFileConfigInfo *entry) -{ - int *element_array = (int *)(entry->value); - int num_elements = *(int *)(entry->num_entities); - int default_value = entry->default_value; - int element = entry->element; - int conf_type = entry->conf_type; - int num_bytes = 0; - boolean modified = FALSE; - int i; - - /* check if any settings have been modified before saving them */ - for (i = 0; i < num_elements; i++) - if (element_array[i] != default_value) - modified = TRUE; - - if (!modified) /* do not save unmodified default settings */ - return 0; - - if (element != -1) - num_bytes += putFile16BitBE(file, element); - - num_bytes += putFile8Bit(file, conf_type); - num_bytes += putFile16BitBE(file, num_elements * CONF_ELEMENT_NUM_BYTES); - - for (i = 0; i < num_elements; i++) - num_bytes += putFile16BitBE(file, element_array[i]); - - return num_bytes; -} - -static int SaveLevel_MicroChunk_ContentList(FILE *file, - struct LevelFileConfigInfo *entry) -{ - struct Content *content = (struct Content *)(entry->value); - int num_contents = *(int *)(entry->num_entities); - int default_value = entry->default_value; - int element = entry->element; - int conf_type = entry->conf_type; - int num_bytes = 0; - boolean modified = FALSE; - int i, x, y; - - /* check if any settings have been modified before saving them */ - for (i = 0; i < num_contents; i++) - for (y = 0; y < 3; y++) - for (x = 0; x < 3; x++) - if (content[i].e[x][y] != default_value) - modified = TRUE; - - if (!modified) /* do not save unmodified default settings */ - return 0; - - if (element != -1) - num_bytes += putFile16BitBE(file, element); - - num_bytes += putFile8Bit(file, conf_type); - num_bytes += putFile16BitBE(file, num_contents * CONF_CONTENT_NUM_BYTES); - - for (i = 0; i < num_contents; i++) - for (y = 0; y < 3; y++) - for (x = 0; x < 3; x++) - num_bytes += putFile16BitBE(file, content[i].e[x][y]); - - return num_bytes; -} - -#endif - static int SaveLevel_INFO(FILE *file, struct LevelInfo *level) { int chunk_size = 0; @@ -5890,23 +5085,7 @@ static int SaveLevel_ELEM(FILE *file, struct LevelInfo *level) li = *level; /* copy level data into temporary buffer */ for (i = 0; chunk_config_ELEM[i].data_type != -1; i++) - { -#if 1 chunk_size += SaveLevel_MicroChunk(file, &chunk_config_ELEM[i], TRUE); -#else - struct LevelFileConfigInfo *conf = &chunk_config_ELEM[i]; - int data_type = conf->data_type; - int conf_type = conf->conf_type; - int byte_mask = conf_type & CONF_MASK_BYTES; - - if (byte_mask != CONF_MASK_MULTI_BYTES) - chunk_size += SaveLevel_MicroChunk_SingleValue(file, conf); - else if (data_type == TYPE_ELEMENT_LIST) - chunk_size += SaveLevel_MicroChunk_ElementList(file, conf); - else if (data_type == TYPE_CONTENT_LIST) - chunk_size += SaveLevel_MicroChunk_ContentList(file, conf); -#endif - } return chunk_size; } @@ -5944,17 +5123,9 @@ static int SaveLevel_CUSX(FILE *file, struct LevelInfo *level, int element) /* set (fixed) number of content areas (may have been overwritten earlier) */ xx_num_contents = 1; -#if 0 - printf("::: - element config\n"); -#endif - for (i = 0; chunk_config_CUSX_base[i].data_type != -1; i++) chunk_size += SaveLevel_MicroChunk(file, &chunk_config_CUSX_base[i], FALSE); -#if 0 - printf("::: - change pages\n"); -#endif - for (i = 0; i < ei->num_change_pages; i++) { struct ElementChangeInfo *change = &ei->change_page[i]; @@ -5963,25 +5134,12 @@ static int SaveLevel_CUSX(FILE *file, struct LevelInfo *level, int element) xx_change = *change; /* copy change data into temporary buffer */ -#if 0 - printf("::: %d: xx_change.action_mode == %d\n", - i, xx_change.action_mode); - printf("::: %d: xx_change.action_arg == %d\n", - i, xx_change.action_arg); -#endif - resetEventBits(); setEventBitsFromEventFlags(change); for (j = 0; chunk_config_CUSX_change[j].data_type != -1; j++) chunk_size += SaveLevel_MicroChunk(file, &chunk_config_CUSX_change[j], FALSE); - -#if 0 - if (element == EL_CUSTOM_START) - printf("::: - saving change page %d / %d (%d bytes)\n", - i, ei->num_change_pages, chunk_size); -#endif } return chunk_size; @@ -6011,11 +5169,7 @@ static int SaveLevel_GRPX(FILE *file, struct LevelInfo *level, int element) static void SaveLevelFromFilename(struct LevelInfo *level, char *filename) { int chunk_size; -#if 1 int i; -#else - int i, x, y; -#endif FILE *file; if (!(file = fopen(filename, MODE_WRITE))) @@ -6029,38 +5183,6 @@ static void SaveLevelFromFilename(struct LevelInfo *level, char *filename) level->creation_date = getCurrentDate(); -#if 0 - /* check level field for 16-bit elements */ - level->encoding_16bit_field = FALSE; - for (y = 0; y < level->fieldy; y++) - for (x = 0; x < level->fieldx; x++) - if (level->field[x][y] > 255) - level->encoding_16bit_field = TRUE; -#endif - -#if 0 - /* check yamyam content for 16-bit elements */ - level->encoding_16bit_yamyam = FALSE; - for (i = 0; i < level->num_yamyam_contents; i++) - for (y = 0; y < 3; y++) - for (x = 0; x < 3; x++) - if (level->yamyam_content[i].e[x][y] > 255) - level->encoding_16bit_yamyam = TRUE; -#endif - -#if 0 - /* check amoeba content for 16-bit elements */ - level->encoding_16bit_amoeba = FALSE; - if (level->amoeba_content > 255) - level->encoding_16bit_amoeba = TRUE; -#endif - -#if 0 - /* calculate size of "BODY" chunk */ - body_chunk_size = - level->fieldx * level->fieldy * (level->encoding_16bit_field ? 2 : 1); -#endif - putFileChunkBE(file, "RND1", CHUNK_SIZE_UNDEFINED); putFileChunkBE(file, "CAVE", CHUNK_SIZE_NONE); @@ -6072,11 +5194,6 @@ static void SaveLevelFromFilename(struct LevelInfo *level, char *filename) putFileChunkBE(file, "DATE", chunk_size); SaveLevel_DATE(file, level); -#if 0 - putFileChunkBE(file, "HEAD", LEVEL_CHUNK_HEAD_SIZE); - SaveLevel_HEAD(file, level); -#endif - chunk_size = SaveLevel_NAME(NULL, level); putFileChunkBE(file, "NAME", chunk_size); SaveLevel_NAME(file, level); @@ -6093,65 +5210,6 @@ static void SaveLevelFromFilename(struct LevelInfo *level, char *filename) putFileChunkBE(file, "BODY", chunk_size); SaveLevel_BODY(file, level); -#if 0 - if (level->encoding_16bit_yamyam || - level->num_yamyam_contents != STD_ELEMENT_CONTENTS) - { - putFileChunkBE(file, "CNT2", LEVEL_CHUNK_CNT2_SIZE); - SaveLevel_CNT2(file, level, EL_YAMYAM); - } - - if (level->encoding_16bit_amoeba) - { - putFileChunkBE(file, "CNT2", LEVEL_CHUNK_CNT2_SIZE); - SaveLevel_CNT2(file, level, EL_BD_AMOEBA); - } -#endif - -#if 0 - /* check for envelope content */ - for (i = 0; i < 4; i++) - { - if (strlen(level->envelope_text[i]) > 0) - { - int envelope_len = strlen(level->envelope_text[i]) + 1; - - putFileChunkBE(file, "CNT3", LEVEL_CHUNK_CNT3_SIZE(envelope_len)); - SaveLevel_CNT3(file, level, EL_ENVELOPE_1 + i); - } - } -#endif - -#if 0 - /* if not using template level, check for non-default custom/group elements */ - if (!level->use_custom_template) - { - for (i = 0; i < NUM_CUSTOM_ELEMENTS; i++) - { - int element = EL_CUSTOM_START + i; - - if (element_info[element].modified_settings) - { - int num_change_pages = element_info[element].num_change_pages; - - putFileChunkBE(file, "CUS4", LEVEL_CHUNK_CUS4_SIZE(num_change_pages)); - SaveLevel_CUS4(file, level, element); - } - } - - for (i = 0; i < NUM_GROUP_ELEMENTS; i++) - { - int element = EL_GROUP_START + i; - - if (element_info[element].modified_settings) - { - putFileChunkBE(file, "GRP1", LEVEL_CHUNK_GRP1_SIZE); - SaveLevel_GRP1(file, level, element); - } - } - } -#endif - chunk_size = SaveLevel_ELEM(NULL, level); if (chunk_size > LEVEL_CHUNK_ELEM_UNCHANGED) /* save if changed */ { @@ -6159,7 +5217,6 @@ static void SaveLevelFromFilename(struct LevelInfo *level, char *filename) SaveLevel_ELEM(file, level); } -#if 1 for (i = 0; i < NUM_ENVELOPES; i++) { int element = EL_ENVELOPE_1 + i; @@ -6171,9 +5228,7 @@ static void SaveLevelFromFilename(struct LevelInfo *level, char *filename) SaveLevel_NOTE(file, level, element); } } -#endif -#if 1 /* if not using template level, check for non-default custom/group elements */ if (!level->use_custom_template) { @@ -6201,7 +5256,6 @@ static void SaveLevelFromFilename(struct LevelInfo *level, char *filename) } } } -#endif fclose(file); @@ -6252,11 +5306,6 @@ void DumpLevel(struct LevelInfo *level) printf("Amoeba speed: %d\n", level->amoeba_speed); printf("\n"); -#if 0 - printf("Initial gravity: %s\n", (level->initial_gravity ? "yes" : "no")); - printf("Initial player stepsize: %d\n", level->initial_player_stepsize); -#endif - printf("EM style slippery gems: %s\n", (level->em_slippery_gems ? "yes" : "no")); printf("Player blocks last field: %s\n", (level->block_last_field ? "yes" : "no")); printf("SP player blocks last field: %s\n", (level->sp_block_last_field ? "yes" : "no")); @@ -7552,7 +6601,6 @@ void LoadSpecialMenuDesignSettings() get_auto_parameter_value(image_config_vars[i].token, image_config[j].value); -#if 1 if (!SETUP_OVERRIDE_ARTWORK(setup, ARTWORK_TYPE_GRAPHICS)) { /* first look for special settings configured in level series config */ @@ -7566,13 +6614,6 @@ void LoadSpecialMenuDesignSettings() if (filename_local != NULL && !strEqual(filename_base, filename_local)) LoadSpecialMenuDesignSettingsFromFilename(filename_local); - -#else - - filename_local = getCustomArtworkConfigFilename(ARTWORK_TYPE_GRAPHICS); - - LoadSpecialMenuDesignSettingsFromFilename(filename_local); -#endif } void LoadUserDefinedEditorElementList(int **elements, int *num_elements) diff --git a/src/files.h b/src/files.h index 1eadf1eb..a3781bed 100644 --- a/src/files.h +++ b/src/files.h @@ -1,7 +1,7 @@ /*********************************************************** * Rocks'n'Diamonds -- McDuffin Strikes Back! * *----------------------------------------------------------* -* (c) 1995-2002 Artsoft Entertainment * +* (c) 1995-2006 Artsoft Entertainment * * Holger Schemel * * Detmolder Strasse 189 * * 33604 Bielefeld * diff --git a/src/game.c b/src/game.c index c1dc0863..73c01c7b 100644 --- a/src/game.c +++ b/src/game.c @@ -80,8 +80,6 @@ #define EX_TYPE_DYNA (1 << 4) #define EX_TYPE_SINGLE_TILE (EX_TYPE_CENTER | EX_TYPE_BORDER) -#if 1 - #define PANEL_DEACTIVATED(p) ((p).x < 0 || (p).y < 0) /* special positions in the game control window (relative to control window) */ @@ -100,25 +98,6 @@ #define XX_TIME2 (game.panel.time.x + 1) #define YY_TIME (game.panel.time.y) -#else - -/* special positions in the game control window (relative to control window) */ -#define XX_LEVEL 37 -#define YY_LEVEL 20 -#define XX_EMERALDS 29 -#define YY_EMERALDS 54 -#define XX_DYNAMITE 29 -#define YY_DYNAMITE 89 -#define XX_KEYS 18 -#define YY_KEYS 123 -#define XX_SCORE 15 -#define YY_SCORE 159 -#define XX_TIME1 29 -#define XX_TIME2 30 -#define YY_TIME 194 - -#endif - /* special positions in the game control window (relative to main window) */ #define DX_LEVEL1 (DX + XX_LEVEL1) #define DX_LEVEL2 (DX + XX_LEVEL2) @@ -150,14 +129,10 @@ #define MOVE_DELAY_HIGH_SPEED 4 #define MOVE_DELAY_MAX_SPEED 1 -#if 0 -#define DOUBLE_MOVE_DELAY(x) (x = (x <= MOVE_DELAY_HIGH_SPEED ? x * 2 : x)) -#define HALVE_MOVE_DELAY(x) (x = (x >= MOVE_DELAY_HIGH_SPEED ? x / 2 : x)) -#else #define DOUBLE_MOVE_DELAY(x) (x = (x < MOVE_DELAY_MIN_SPEED ? x * 2 : x)) #define HALVE_MOVE_DELAY(x) (x = (x > MOVE_DELAY_MAX_SPEED ? x / 2 : x)) -#endif -#define DOUBLE_PLAYER_SPEED(p) (HALVE_MOVE_DELAY((p)->move_delay_value)) + +#define DOUBLE_PLAYER_SPEED(p) (HALVE_MOVE_DELAY( (p)->move_delay_value)) #define HALVE_PLAYER_SPEED(p) (DOUBLE_MOVE_DELAY((p)->move_delay_value)) /* values for other actions */ @@ -187,13 +162,8 @@ RND((c)->delay_random)) -#if 1 #define GET_VALID_RUNTIME_ELEMENT(e) \ ((e) >= NUM_RUNTIME_ELEMENTS ? EL_UNKNOWN : (e)) -#else -#define GET_VALID_FILE_ELEMENT(e) \ - ((e) >= NUM_FILE_ELEMENTS ? EL_UNKNOWN : (e)) -#endif #define RESOLVED_REFERENCE_ELEMENT(be, e) \ ((be) + (e) - EL_SELF < EL_CUSTOM_START ? EL_CUSTOM_START : \ @@ -283,15 +253,6 @@ (IN_LEV_FIELD(x, y) && (Feld[x][y] == EL_EMC_SPRING_BUMPER || \ Feld[x][y] == EL_EMC_SPRING_BUMPER_ACTIVE)) -#if 0 -#define GROUP_NR(e) ((e) - EL_GROUP_START) -#define IS_IN_GROUP(e, nr) (element_info[e].in_group[nr] == TRUE) -#define IS_IN_GROUP_EL(e, ge) (IS_IN_GROUP(e, (ge) - EL_GROUP_START)) - -#define IS_EQUAL_OR_IN_GROUP(e, ge) \ - (IS_GROUP_ELEMENT(ge) ? IS_IN_GROUP(e, GROUP_NR(ge)) : (e) == (ge)) -#endif - #define MOVE_ENTER_EL(e) (element_info[e].move_enter_element) #define CE_ENTER_FIELD_COND(e, x, y) \ @@ -436,8 +397,6 @@ static void RunTimegateWheel(int, int); static void InitMagicBallDelay(int, int); static void ActivateMagicBall(int, int); -static void InitDiagonalMovingElement(int, int); - struct ChangingElementInfo { int element; @@ -633,7 +592,7 @@ static struct ChangingElementInfo change_delay_list[] = 0, NULL, NULL, - InitDiagonalMovingElement + NULL, }, { @@ -1194,7 +1153,6 @@ static void InitField(int x, int y, boolean init_game) break; default: -#if 1 if (IS_CUSTOM_ELEMENT(element)) { if (CAN_MOVE(element)) @@ -1205,60 +1163,18 @@ static void InitField(int x, int y, boolean init_game) CustomValue[x][y] = GET_NEW_CE_VALUE(Feld[x][y]); #endif } -#else - if (IS_CUSTOM_ELEMENT(element) && CAN_MOVE(element)) - InitMovDir(x, y); -#endif else if (IS_GROUP_ELEMENT(element)) { -#if 1 Feld[x][y] = get_element_from_group_element(element); InitField(x, y, init_game); -#else - struct ElementGroupInfo *group = element_info[element].group; - int last_anim_random_frame = gfx.anim_random_frame; - int element_pos; - - if (group->choice_mode == ANIM_RANDOM) - gfx.anim_random_frame = RND(group->num_elements_resolved); - - element_pos = getAnimationFrame(group->num_elements_resolved, 1, - group->choice_mode, 0, - group->choice_pos); - - if (group->choice_mode == ANIM_RANDOM) - gfx.anim_random_frame = last_anim_random_frame; - - group->choice_pos++; - - Feld[x][y] = group->element_resolved[element_pos]; - - InitField(x, y, init_game); -#endif } break; } -#if 1 if (!init_game) CheckTriggeredElementChange(x, y, element, CE_CREATION_OF_X); -#endif - -#if 0 - -#if USE_NEW_CUSTOM_VALUE - -#if 1 - CustomValue[x][y] = GET_NEW_CE_VALUE(Feld[x][y]); -#else - CustomValue[x][y] = element_info[Feld[x][y]].custom_value_initial; -#endif - -#endif - -#endif } static inline void InitField_WithBug1(int x, int y, boolean init_game) @@ -1373,27 +1289,7 @@ inline void DrawGameValue_Level(int value) if (level_nr < 100) DrawText(DX_LEVEL1, DY_LEVEL, int2str(value, 2), FONT_TEXT_2); else -#if 1 DrawText(DX_LEVEL2, DY_LEVEL, int2str(value, 3), FONT_LEVEL_NUMBER); -#else - { - /* misuse area for displaying emeralds to draw bigger level number */ - DrawTextExt(drawto, DX_EMERALDS, DY_EMERALDS, - int2str(value, 3), FONT_LEVEL_NUMBER, BLIT_OPAQUE); - - /* now copy it to the area for displaying level number */ - BlitBitmap(drawto, drawto, - DX_EMERALDS, DY_EMERALDS + 1, - getFontWidth(FONT_LEVEL_NUMBER) * 3, - getFontHeight(FONT_LEVEL_NUMBER) - 1, - DX_LEVEL - 1, DY_LEVEL + 1); - - /* restore the area for displaying emeralds */ - DrawGameValue_Emeralds(local_player->gems_still_needed); - - /* yes, this is all really ugly :-) */ - } -#endif } void DrawAllGameValues(int emeralds, int dynamite, int score, int time, @@ -1413,6 +1309,8 @@ void DrawAllGameValues(int emeralds, int dynamite, int score, int time, DrawGameValue_Time(time); DrawGameValue_Keys(key); + + redraw_mask |= REDRAW_DOOR_1; } void DrawGameDoorValues() @@ -1429,16 +1327,6 @@ void DrawGameDoorValues() return; } -#if 0 - DrawGameValue_Level(level_nr); - - DrawGameValue_Emeralds(local_player->gems_still_needed); - DrawGameValue_Dynamite(local_player->inventory_size); - DrawGameValue_Score(local_player->score); - DrawGameValue_Time(TimeLeft); - -#else - if (game.centered_player_nr == -1) { for (i = 0; i < MAX_PLAYERS; i++) @@ -1449,10 +1337,6 @@ void DrawGameDoorValues() dynamite_state += stored_player[i].inventory_size; } - -#if 0 - DrawGameValue_Keys(stored_player[i].key); -#endif } else { @@ -1467,66 +1351,8 @@ void DrawGameDoorValues() DrawAllGameValues(local_player->gems_still_needed, dynamite_state, local_player->score, time_value, key_bits); -#endif -} - -#if 0 -static void resolve_group_element(int group_element, int recursion_depth) -{ - static int group_nr; - static struct ElementGroupInfo *group; - struct ElementGroupInfo *actual_group = element_info[group_element].group; - int i; - - if (recursion_depth > NUM_GROUP_ELEMENTS) /* recursion too deep */ - { - Error(ERR_WARN, "recursion too deep when resolving group element %d", - group_element - EL_GROUP_START + 1); - - /* replace element which caused too deep recursion by question mark */ - group->element_resolved[group->num_elements_resolved++] = EL_UNKNOWN; - - return; - } - - if (recursion_depth == 0) /* initialization */ - { - group = element_info[group_element].group; - group_nr = group_element - EL_GROUP_START; - - group->num_elements_resolved = 0; - group->choice_pos = 0; - } - - for (i = 0; i < actual_group->num_elements; i++) - { - int element = actual_group->element[i]; - - if (group->num_elements_resolved == NUM_FILE_ELEMENTS) - break; - - if (IS_GROUP_ELEMENT(element)) - resolve_group_element(element, recursion_depth + 1); - else - { - group->element_resolved[group->num_elements_resolved++] = element; - element_info[element].in_group[group_nr] = TRUE; - } - } } -#endif -#if 0 -static void replace_reference_element(int base_element, int *element) -{ - if (*element >= EL_LAST_CE_8 && *element <= EL_NEXT_CE_8) - { - *element = base_element + *element - EL_SELF; - *element = (*element < EL_CUSTOM_START ? EL_CUSTOM_START : - *element > EL_CUSTOM_END ? EL_CUSTOM_END : *element); - } -} -#endif /* ============================================================================= @@ -1658,29 +1484,12 @@ static void InitGameEngine() printf(" => game.engine_version == %06d\n", game.engine_version); #endif -#if 0 - /* ---------- recursively resolve group elements ------------------------- */ - - for (i = 0; i < MAX_NUM_ELEMENTS; i++) - for (j = 0; j < NUM_GROUP_ELEMENTS; j++) - element_info[i].in_group[j] = FALSE; - - for (i = 0; i < NUM_GROUP_ELEMENTS; i++) - resolve_group_element(EL_GROUP_START + i, 0); -#endif - /* ---------- initialize player's initial move delay --------------------- */ -#if 1 /* dynamically adjust player properties according to level information */ for (i = 0; i < MAX_PLAYERS; i++) game.initial_move_delay_value[i] = get_move_delay_from_stepsize(level.initial_player_stepsize[i]); -#else - /* dynamically adjust player properties according to level information */ - game.initial_move_delay_value = - (level.double_speed ? MOVE_DELAY_HIGH_SPEED : MOVE_DELAY_NORMAL_SPEED); -#endif /* dynamically adjust player properties according to game engine version */ for (i = 0; i < MAX_PLAYERS; i++) @@ -1830,11 +1639,9 @@ static void InitGameEngine() for (l = 0; l < group->num_elements_resolved; l++) trigger_events[group->element_resolved[l]][k] = TRUE; } -#if 1 else if (trigger_element == EL_ANY_ELEMENT) for (l = 0; l < MAX_NUM_ELEMENTS; l++) trigger_events[l][k] = TRUE; -#endif else trigger_events[trigger_element][k] = TRUE; } @@ -1850,7 +1657,6 @@ static void InitGameEngine() { if (!IS_CUSTOM_ELEMENT(i)) { -#if 1 /* set default push delay values (corrected since version 3.0.7-1) */ if (game.engine_version < VERSION_IDENT(3,0,7,1)) { @@ -1862,10 +1668,6 @@ static void InitGameEngine() element_info[i].push_delay_fixed = 8; element_info[i].push_delay_random = 8; } -#else - element_info[i].push_delay_fixed = game.default_push_delay_fixed; - element_info[i].push_delay_random = game.default_push_delay_random; -#endif } } @@ -1972,29 +1774,6 @@ static void InitGameEngine() EL_EMPTY); } } - -#if 0 - /* ---------- initialize reference elements ------------------------------- */ - for (i = 0; i < NUM_CUSTOM_ELEMENTS; i++) - { - int element = EL_CUSTOM_START + i; - struct ElementInfo *ei = &element_info[element]; - - for (y = 0; y < 3; y++) for (x = 0; x < 3; x++) - replace_reference_element(element, &ei->content.e[x][y]); - - for (j = 0; j < ei->num_change_pages; j++) - { - struct ElementChangeInfo *change = &ei->change_page[j]; - - replace_reference_element(element, &change->target_element); - replace_reference_element(element, &change->trigger_element); - - for (y = 0; y < 3; y++) for (x = 0; x < 3; x++) - replace_reference_element(element, &change->target_content.e[x][y]); - } - } -#endif } int get_num_special_action(int element, int action_first, int action_last) @@ -2017,13 +1796,10 @@ int get_num_special_action(int element, int action_first, int action_last) break; } -#if 0 - printf("::: %d->%d: %d\n", action_first, action_last, num_special_action); -#endif - return num_special_action; } + /* ============================================================================= InitGame() @@ -2130,18 +1906,6 @@ void InitGame() player->special_action_bored = ACTION_DEFAULT; player->special_action_sleeping = ACTION_DEFAULT; -#if 1 - /* cannot be set here -- could be modified in Init[Player]Field() below */ -#else - /* set number of special actions for bored and sleeping animation */ - player->num_special_action_bored = - get_num_special_action(player->artwork_element, - ACTION_BORING_1, ACTION_BORING_LAST); - player->num_special_action_sleeping = - get_num_special_action(player->artwork_element, - ACTION_SLEEPING_1, ACTION_SLEEPING_LAST); -#endif - player->switch_x = -1; player->switch_y = -1; @@ -2150,18 +1914,7 @@ void InitGame() player->show_envelope = 0; -#if 1 SetPlayerMoveSpeed(player, level.initial_player_stepsize[i], TRUE); -#else - player->move_delay = game.initial_move_delay; - player->move_delay_value = game.initial_move_delay_value; - - player->move_delay_value_next = -1; - - player->move_delay_reset_counter = 0; - - player->cannot_move = FALSE; -#endif player->push_delay = -1; /* initialized when pushing starts */ player->push_delay_value = game.initial_push_delay_value; @@ -2223,11 +1976,7 @@ void InitGame() game.wind_direction = level.wind_direction_initial; #if !USE_PLAYER_GRAVITY -#if 1 game.gravity = FALSE; -#else - game.gravity = level.initial_gravity; -#endif game.explosions_delayed = TRUE; #endif @@ -2251,11 +2000,6 @@ void InitGame() tape.set_centered_player = TRUE; } -#if 0 - printf("::: focus set to player %d [%d]\n", - game.centered_player_nr, local_player->index_nr); -#endif - for (i = 0; i < NUM_BELTS; i++) { game.belt_dir[i] = MV_NONE; @@ -2265,11 +2009,7 @@ void InitGame() for (i = 0; i < MAX_NUM_AMOEBA; i++) AmoebaCnt[i] = AmoebaCnt2[i] = 0; -#if 1 SCAN_PLAYFIELD(x, y) -#else - for (x = 0; x < lev_fieldx; x++) for (y = 0; y < lev_fieldy; y++) -#endif { Feld[x][y] = level.field[x][y]; MovPos[x][y] = MovDir[x][y] = MovDelay[x][y] = 0; @@ -2303,11 +2043,7 @@ void InitGame() GfxDir[x][y] = MV_NONE; } -#if 1 SCAN_PLAYFIELD(x, y) -#else - for (y = 0; y < lev_fieldy; y++) for (x = 0; x < lev_fieldx; x++) -#endif { if (emulate_bd && !IS_BD_ELEMENT(Feld[x][y])) emulate_bd = FALSE; @@ -2325,7 +2061,6 @@ void InitGame() { struct PlayerInfo *player = &stored_player[i]; -#if 1 /* set number of special actions for bored and sleeping animation */ player->num_special_action_bored = get_num_special_action(player->artwork_element, @@ -2333,8 +2068,6 @@ void InitGame() player->num_special_action_sleeping = get_num_special_action(player->artwork_element, ACTION_SLEEPING_1, ACTION_SLEEPING_LAST); -#endif - } game.emulation = (emulate_bd ? EMU_BOULDERDASH : @@ -2415,10 +2148,6 @@ void InitGame() some_player->present = FALSE; some_player->active = FALSE; -#if 0 - player->element_nr = some_player->element_nr; -#endif - player->artwork_element = some_player->artwork_element; player->block_last_field = some_player->block_last_field; @@ -2531,11 +2260,7 @@ void InitGame() int found_element = EL_UNDEFINED; int player_nr = local_player->index_nr; -#if 1 SCAN_PLAYFIELD(x, y) -#else - for (y = 0; y < lev_fieldy; y++) for (x = 0; x < lev_fieldx; x++) -#endif { int element = Feld[x][y]; int content; @@ -2645,10 +2370,8 @@ void InitGame() { InitGameEngine_EM(); -#if 1 /* blit playfield from scroll buffer to normal back buffer for fading in */ BlitScreenToBitmap_EM(backbuffer); -#endif } else { @@ -2664,10 +2387,6 @@ void InitGame() BlitBitmap(fieldbuffer, backbuffer, FX, FY, SXSIZE, SYSIZE, SX, SY); redraw_mask |= REDRAW_FROM_BACKBUFFER; - -#if 0 - FadeToFront(); -#endif } /* !!! FIX THIS (END) !!! */ @@ -2683,10 +2402,8 @@ void InitGame() DOOR_GFX_PAGEX5, DOOR_GFX_PAGEY1, DXSIZE, DYSIZE, DX, DY); } -#if 1 SetPanelBackground(); SetDrawBackgroundMask(REDRAW_DOOR_1); -#endif DrawGameDoorValues(); @@ -2984,11 +2701,6 @@ void GameWon() DrawGameValue_Time(TimeLeft); -#if 0 - if (!tape.playing) - Delay(10); -#endif - if (TimeLeft <= 0 && !tape.playing && setup.sound_loops) StopSound(SND_GAME_LEVELTIME_BONUS); } @@ -3220,13 +2932,6 @@ void GameWon() BackToFront(); -#if 0 - if (tape.playing) - printf("::: TAPE PLAYING -> DO NOT SAVE SCORE\n"); - else - printf("::: NO TAPE PLAYING -> SAVING SCORE\n"); -#endif - if (tape.playing) return; @@ -3348,19 +3053,11 @@ inline static int getElementMoveStepsize(int x, int y) /* special values for move stepsize for spring and things on conveyor belt */ if (horiz_move) { -#if 0 - if (element == EL_SPRING) - step = sign * MOVE_STEPSIZE_NORMAL * 2; - else if (CAN_FALL(element) && !CAN_MOVE(element) && - y < lev_fieldy - 1 && IS_BELT_ACTIVE(Feld[x][y + 1])) - step = sign * MOVE_STEPSIZE_NORMAL / 2; -#else if (CAN_FALL(element) && y < lev_fieldy - 1 && IS_BELT_ACTIVE(Feld[x][y + 1])) step = sign * MOVE_STEPSIZE_NORMAL / 2; else if (element == EL_SPRING) step = sign * MOVE_STEPSIZE_NORMAL * 2; -#endif } return step; @@ -3405,28 +3102,10 @@ static void ResetGfxFrame(int x, int y, boolean redraw) static void ResetGfxAnimation(int x, int y) { -#if 0 - int element, graphic; -#endif - GfxAction[x][y] = ACTION_DEFAULT; GfxDir[x][y] = MovDir[x][y]; GfxFrame[x][y] = 0; -#if 0 - element = Feld[x][y]; - graphic = el_act_dir2img(element, GfxAction[x][y], GfxDir[x][y]); - - if (graphic_info[graphic].anim_global_sync) - GfxFrame[x][y] = FrameCounter; - else if (ANIM_MODE(graphic) == ANIM_CE_VALUE) - GfxFrame[x][y] = CustomValue[x][y]; - else if (ANIM_MODE(graphic) == ANIM_CE_SCORE) - GfxFrame[x][y] = element_info[element].collect_score; - else if (ANIM_MODE(graphic) == ANIM_CE_DELAY) - GfxFrame[x][y] = ChangeDelay[x][y]; -#endif - #if USE_GFX_RESET_GFX_ANIMATION ResetGfxFrame(x, y, FALSE); #endif @@ -3440,9 +3119,6 @@ static void ResetRandomAnimationValue(int x, int y) void InitMovingField(int x, int y, int direction) { int element = Feld[x][y]; -#if 0 - int graphic; -#endif int dx = (direction == MV_LEFT ? -1 : direction == MV_RIGHT ? +1 : 0); int dy = (direction == MV_UP ? -1 : direction == MV_DOWN ? +1 : 0); int newx = x + dx; @@ -3456,19 +3132,6 @@ void InitMovingField(int x, int y, int direction) GfxAction[x][y] = (direction == MV_DOWN && CAN_FALL(element) ? ACTION_FALLING : ACTION_MOVING); -#if 0 - graphic = el_act_dir2img(element, GfxAction[x][y], GfxDir[x][y]); - - if (graphic_info[graphic].anim_global_sync) - GfxFrame[x][y] = FrameCounter; - else if (ANIM_MODE(graphic) == ANIM_CE_VALUE) - GfxFrame[x][y] = CustomValue[x][y]; - else if (ANIM_MODE(graphic) == ANIM_CE_SCORE) - GfxFrame[x][y] = element_info[element].collect_score; - else if (ANIM_MODE(graphic) == ANIM_CE_DELAY) - GfxFrame[x][y] = ChangeDelay[x][y]; -#endif - /* this is needed for CEs with property "can move" / "not moving" */ if (getElementMoveStepsize(x, y) != 0) /* moving or being moved */ @@ -3492,13 +3155,8 @@ void InitMovingField(int x, int y, int direction) void Moving2Blocked(int x, int y, int *goes_to_x, int *goes_to_y) { int direction = MovDir[x][y]; -#if 1 int newx = x + (direction & MV_LEFT ? -1 : direction & MV_RIGHT ? +1 : 0); int newy = y + (direction & MV_UP ? -1 : direction & MV_DOWN ? +1 : 0); -#else - int newx = x + (direction == MV_LEFT ? -1 : direction == MV_RIGHT ? +1 : 0); - int newy = y + (direction == MV_UP ? -1 : direction == MV_DOWN ? +1 : 0); -#endif *goes_to_x = newx; *goes_to_y = newy; @@ -3685,8 +3343,6 @@ void CheckDynamite(int x, int y) Bang(x, y); } -#if 1 - static void setMinimalPlayerBoundaries(int *sx1, int *sy1, int *sx2, int *sy2) { boolean num_checked_players = 0; @@ -3737,33 +3393,6 @@ static void setScreenCenteredToAllPlayers(int *sx, int *sy) *sy = (sy1 + sy2) / 2; } -#if 0 -static void setMaxCenterDistanceForAllPlayers(int *max_dx, int *max_dy, - int center_x, int center_y) -{ - int sx1 = center_x, sy1 = center_y, sx2 = center_x, sy2 = center_y; - - setMinimalPlayerBoundaries(&sx1, &sy1, &sx2, &sy2); - - *max_dx = MAX(ABS(sx1 - center_x), ABS(sx2 - center_x)); - *max_dy = MAX(ABS(sy1 - center_y), ABS(sy2 - center_y)); -} - -static boolean checkIfAllPlayersAreVisible(int center_x, int center_y) -{ - int max_dx, max_dy; - - setMaxCenterDistanceForAllPlayers(&max_dx, &max_dy, center_x, center_y); - - return (max_dx <= SCR_FIELDX / 2 && - max_dy <= SCR_FIELDY / 2); -} -#endif - -#endif - -#if 1 - void DrawRelocateScreen(int x, int y, int move_dir, boolean center_screen, boolean quick_relocation) { @@ -3776,11 +3405,6 @@ void DrawRelocateScreen(int x, int y, int move_dir, boolean center_screen, { int offset = (setup.scroll_delay ? 3 : 0); -#if 0 - if (center_screen) - offset = 0; -#endif - if (!IN_VIS_FIELD(SCREENX(x), SCREENY(y)) || center_screen) { scroll_x = (x < SBX_Left + MIDPOSX ? SBX_Left : @@ -3860,102 +3484,6 @@ void DrawRelocateScreen(int x, int y, int move_dir, boolean center_screen, } } -#else - -void DrawRelocatePlayer(struct PlayerInfo *player, boolean quick_relocation) -{ - boolean ffwd_delay = (tape.playing && tape.fast_forward); - boolean no_delay = (tape.warp_forward); - int frame_delay_value = (ffwd_delay ? FfwdFrameDelay : GameFrameDelay); - int wait_delay_value = (no_delay ? 0 : frame_delay_value); - int jx = player->jx; - int jy = player->jy; - - if (quick_relocation) - { - int offset = (setup.scroll_delay ? 3 : 0); - - if (!IN_VIS_FIELD(SCREENX(jx), SCREENY(jy))) - { - scroll_x = (player->jx < SBX_Left + MIDPOSX ? SBX_Left : - player->jx > SBX_Right + MIDPOSX ? SBX_Right : - player->jx - MIDPOSX); - - scroll_y = (player->jy < SBY_Upper + MIDPOSY ? SBY_Upper : - player->jy > SBY_Lower + MIDPOSY ? SBY_Lower : - player->jy - MIDPOSY); - } - else - { - if ((player->MovDir == MV_LEFT && scroll_x > jx - MIDPOSX + offset) || - (player->MovDir == MV_RIGHT && scroll_x < jx - MIDPOSX - offset)) - scroll_x = jx - MIDPOSX + (scroll_x < jx-MIDPOSX ? -offset : +offset); - - if ((player->MovDir == MV_UP && scroll_y > jy - MIDPOSY + offset) || - (player->MovDir == MV_DOWN && scroll_y < jy - MIDPOSY - offset)) - scroll_y = jy - MIDPOSY + (scroll_y < jy-MIDPOSY ? -offset : +offset); - - /* don't scroll over playfield boundaries */ - if (scroll_x < SBX_Left || scroll_x > SBX_Right) - scroll_x = (scroll_x < SBX_Left ? SBX_Left : SBX_Right); - - /* don't scroll over playfield boundaries */ - if (scroll_y < SBY_Upper || scroll_y > SBY_Lower) - scroll_y = (scroll_y < SBY_Upper ? SBY_Upper : SBY_Lower); - } - - RedrawPlayfield(TRUE, 0,0,0,0); - } - else - { - int scroll_xx = (player->jx < SBX_Left + MIDPOSX ? SBX_Left : - player->jx > SBX_Right + MIDPOSX ? SBX_Right : - player->jx - MIDPOSX); - - int scroll_yy = (player->jy < SBY_Upper + MIDPOSY ? SBY_Upper : - player->jy > SBY_Lower + MIDPOSY ? SBY_Lower : - player->jy - MIDPOSY); - - ScrollScreen(NULL, SCROLL_GO_ON); /* scroll last frame to full tile */ - - while (scroll_x != scroll_xx || scroll_y != scroll_yy) - { - int dx = 0, dy = 0; - int fx = FX, fy = FY; - - dx = (scroll_xx < scroll_x ? +1 : scroll_xx > scroll_x ? -1 : 0); - dy = (scroll_yy < scroll_y ? +1 : scroll_yy > scroll_y ? -1 : 0); - - if (dx == 0 && dy == 0) /* no scrolling needed at all */ - break; - - scroll_x -= dx; - scroll_y -= dy; - - fx += dx * TILEX / 2; - fy += dy * TILEY / 2; - - ScrollLevel(dx, dy); - DrawAllPlayers(); - - /* scroll in two steps of half tile size to make things smoother */ - BlitBitmap(drawto_field, window, fx, fy, SXSIZE, SYSIZE, SX, SY); - FlushDisplay(); - Delay(wait_delay_value); - - /* scroll second step to align at full tile size */ - BackToFront(); - Delay(wait_delay_value); - } - - DrawPlayer(player); - BackToFront(); - Delay(wait_delay_value); - } -} - -#endif - void RelocatePlayer(int jx, int jy, int el_player_raw) { int el_player = GET_PLAYER_ELEMENT(el_player_raw); @@ -4031,19 +3559,9 @@ void RelocatePlayer(int jx, int jy, int el_player_raw) InitField(jx, jy, FALSE); } -#if 1 /* only visually relocate centered player */ -#if 1 DrawRelocateScreen(player->jx, player->jy, player->MovDir, FALSE, level.instant_relocation); -#else - if (player->index_nr == game.centered_player_nr) - DrawRelocatePlayer(player, level.instant_relocation); -#endif -#else - if (player == local_player) /* only visually relocate local player */ - DrawRelocatePlayer(player, level.instant_relocation); -#endif TestIfPlayerTouchesBadThing(jx, jy); TestIfPlayerTouchesCustomElement(jx, jy); @@ -4129,11 +3647,7 @@ void Explode(int ex, int ey, int phase, int mode) PlayLevelSoundElementAction(ex, ey, artwork_element, ACTION_EXPLODING); #endif -#if 1 last_phase = element_info[explosion_element].explosion_delay + 1; -#else - last_phase = element_info[center_element].explosion_delay + 1; -#endif for (y = ey - 1; y <= ey + 1; y++) for (x = ex - 1; x <= ex + 1; x++) { @@ -4206,33 +3720,14 @@ void Explode(int ex, int ey, int phase, int mode) if (IS_PLAYER(ex, ey) && !PLAYER_EXPLOSION_PROTECTED(ex, ey)) { -#if 1 int player_nr = StorePlayer[ex][ey] - EL_PLAYER_1; Store[x][y] = EL_PLAYER_IS_EXPLODING_1 + player_nr; -#else - switch(StorePlayer[ex][ey]) - { - case EL_PLAYER_2: - Store[x][y] = EL_PLAYER_IS_EXPLODING_2; - break; - case EL_PLAYER_3: - Store[x][y] = EL_PLAYER_IS_EXPLODING_3; - break; - case EL_PLAYER_4: - Store[x][y] = EL_PLAYER_IS_EXPLODING_4; - break; - case EL_PLAYER_1: - default: - Store[x][y] = EL_PLAYER_IS_EXPLODING_1; - break; - } -#endif if (PLAYERINFO(ex, ey)->use_murphy) Store[x][y] = EL_EMPTY; } -#if 1 + /* !!! check this case -- currently needed for rnd_rado_negundo_v, !!! levels 015 018 019 020 021 022 023 026 027 028 !!! */ else if (ELEM_IS_PLAYER(center_element)) @@ -4253,45 +3748,6 @@ void Explode(int ex, int ey, int phase, int mode) #endif else Store[x][y] = EL_EMPTY; -#else - else if (center_element == EL_MOLE) - Store[x][y] = EL_EMERALD_RED; - else if (center_element == EL_PENGUIN) - Store[x][y] = EL_EMERALD_PURPLE; - else if (center_element == EL_BUG) - Store[x][y] = ((x == ex && y == ey) ? EL_DIAMOND : EL_EMERALD); - else if (center_element == EL_BD_BUTTERFLY) - Store[x][y] = EL_BD_DIAMOND; - else if (center_element == EL_SP_ELECTRON) - Store[x][y] = EL_SP_INFOTRON; - else if (center_element == EL_AMOEBA_TO_DIAMOND) - Store[x][y] = level.amoeba_content; - else if (center_element == EL_YAMYAM) - Store[x][y] = level.yamyam_content[game.yamyam_content_nr].e[xx][yy]; - else if (IS_CUSTOM_ELEMENT(center_element) && - element_info[center_element].content.e[xx][yy] != EL_EMPTY) - Store[x][y] = element_info[center_element].content.e[xx][yy]; - else if (element == EL_WALL_EMERALD) - Store[x][y] = EL_EMERALD; - else if (element == EL_WALL_DIAMOND) - Store[x][y] = EL_DIAMOND; - else if (element == EL_WALL_BD_DIAMOND) - Store[x][y] = EL_BD_DIAMOND; - else if (element == EL_WALL_EMERALD_YELLOW) - Store[x][y] = EL_EMERALD_YELLOW; - else if (element == EL_WALL_EMERALD_RED) - Store[x][y] = EL_EMERALD_RED; - else if (element == EL_WALL_EMERALD_PURPLE) - Store[x][y] = EL_EMERALD_PURPLE; - else if (element == EL_WALL_PEARL) - Store[x][y] = EL_PEARL; - else if (element == EL_WALL_CRYSTAL) - Store[x][y] = EL_CRYSTAL; - else if (IS_CUSTOM_ELEMENT(element) && !CAN_EXPLODE(element)) - Store[x][y] = element_info[element].content.e[1][1]; - else - Store[x][y] = EL_EMPTY; -#endif if (x != ex || y != ey || mode == EX_TYPE_BORDER || center_element == EL_AMOEBA_TO_DIAMOND) @@ -4300,11 +3756,6 @@ void Explode(int ex, int ey, int phase, int mode) Feld[x][y] = EL_EXPLOSION; GfxElement[x][y] = artwork_element; -#if 0 - printf(":: setting gfx(%d,%d) to %d ['%s']\n", - x, y, artwork_element, EL_NAME(artwork_element)); -#endif - ExplodePhase[x][y] = 1; ExplodeDelay[x][y] = last_phase; @@ -4642,11 +4093,7 @@ static void InitBeltMovement() } } -#if 1 SCAN_PLAYFIELD(x, y) -#else - for (y = 0; y < lev_fieldy; y++) for (x = 0; x < lev_fieldx; x++) -#endif { int element = Feld[x][y]; @@ -4726,11 +4173,7 @@ static void ToggleBeltSwitch(int x, int y) graphic_info[graphic].anim_mode |= ANIM_REVERSE; } -#if 1 SCAN_PLAYFIELD(xx, yy) -#else - for (yy = 0; yy < lev_fieldy; yy++) for (xx = 0; xx < lev_fieldx; xx++) -#endif { int element = Feld[xx][yy]; @@ -4777,11 +4220,7 @@ static void ToggleSwitchgateSwitch(int x, int y) game.switchgate_pos = !game.switchgate_pos; -#if 1 SCAN_PLAYFIELD(xx, yy) -#else - for (yy = 0; yy < lev_fieldy; yy++) for (xx = 0; xx < lev_fieldx; xx++) -#endif { int element = Feld[xx][yy]; @@ -4841,11 +4280,7 @@ static void RedrawAllLightSwitchesAndInvisibleElements() { int x, y; -#if 1 SCAN_PLAYFIELD(x, y) -#else - for (y = 0; y < lev_fieldy; y++) for (x = 0; x < lev_fieldx; x++) -#endif { int element = Feld[x][y]; @@ -4906,11 +4341,7 @@ static void RedrawAllInvisibleElementsForLenses() { int x, y; -#if 1 SCAN_PLAYFIELD(x, y) -#else - for (y = 0; y < lev_fieldy; y++) for (x = 0; x < lev_fieldx; x++) -#endif { int element = Feld[x][y]; @@ -4959,11 +4390,7 @@ static void RedrawAllInvisibleElementsForMagnifier() { int x, y; -#if 1 SCAN_PLAYFIELD(x, y) -#else - for (y = 0; y < lev_fieldy; y++) for (x = 0; x < lev_fieldx; x++) -#endif { int element = Feld[x][y]; @@ -5023,11 +4450,7 @@ static void ActivateTimegateSwitch(int x, int y) game.timegate_time_left = level.time_timegate * FRAMES_PER_SECOND; -#if 1 SCAN_PLAYFIELD(xx, yy) -#else - for (yy = 0; yy < lev_fieldy; yy++) for (xx = 0; xx < lev_fieldx; xx++) -#endif { int element = Feld[xx][yy]; @@ -5154,11 +4577,7 @@ void Impact(int x, int y) EL_BD_MAGIC_WALL_ACTIVE); /* activate magic wall / mill */ -#if 1 SCAN_PLAYFIELD(xx, yy) -#else - for (yy = 0; yy < lev_fieldy; yy++) for (xx = 0; xx < lev_fieldx; xx++) -#endif if (Feld[xx][yy] == smashed) Feld[xx][yy] = activated_magic_wall; @@ -6109,9 +5528,6 @@ inline static void TurnRoundExt(int x, int y) static void TurnRound(int x, int y) { int direction = MovDir[x][y]; -#if 0 - int element, graphic; -#endif TurnRoundExt(x, y); @@ -6123,21 +5539,7 @@ static void TurnRound(int x, int y) if (MovDelay[x][y]) GfxAction[x][y] = ACTION_TURNING_FROM_LEFT + MV_DIR_TO_BIT(direction); -#if 1 ResetGfxFrame(x, y, FALSE); -#else - element = Feld[x][y]; - graphic = el_act_dir2img(element, GfxAction[x][y], GfxDir[x][y]); - - if (graphic_info[graphic].anim_global_sync) - GfxFrame[x][y] = FrameCounter; - else if (ANIM_MODE(graphic) == ANIM_CE_VALUE) - GfxFrame[x][y] = CustomValue[x][y]; - else if (ANIM_MODE(graphic) == ANIM_CE_SCORE) - GfxFrame[x][y] = element_info[element].collect_score; - else if (ANIM_MODE(graphic) == ANIM_CE_DELAY) - GfxFrame[x][y] = ChangeDelay[x][y]; -#endif } static boolean JustBeingPushed(int x, int y) @@ -7158,29 +6560,17 @@ void ContinueMoving(int x, int y) MovDelay[newx][newy] = 0; -#if 1 if (CAN_CHANGE_OR_HAS_ACTION(element)) -#else - if (CAN_CHANGE(element)) -#endif { /* copy element change control values to new field */ ChangeDelay[newx][newy] = ChangeDelay[x][y]; ChangePage[newx][newy] = ChangePage[x][y]; ChangeCount[newx][newy] = ChangeCount[x][y]; ChangeEvent[newx][newy] = ChangeEvent[x][y]; - -#if 0 -#if USE_NEW_CUSTOM_VALUE - CustomValue[newx][newy] = CustomValue[x][y]; -#endif -#endif } -#if 1 #if USE_NEW_CUSTOM_VALUE CustomValue[newx][newy] = CustomValue[x][y]; -#endif #endif ChangeDelay[x][y] = 0; @@ -7346,12 +6736,10 @@ void ContinueMoving(int x, int y) TestIfPlayerTouchesCustomElement(newx, newy); TestIfElementTouchesCustomElement(newx, newy); -#if 1 if (IS_CUSTOM_ELEMENT(element) && ei->move_enter_element != EL_EMPTY && IS_EQUAL_OR_IN_GROUP(stored_new, ei->move_enter_element)) CheckElementChangeBySide(newx, newy, element, stored_new, CE_DIGGING_X, MV_DIR_OPPOSITE(direction)); -#endif } int AmoebeNachbarNr(int ax, int ay) @@ -7420,11 +6808,7 @@ void AmoebenVereinigen(int ax, int ay) AmoebaCnt2[new_group_nr] += AmoebaCnt2[old_group_nr]; AmoebaCnt2[old_group_nr] = 0; -#if 1 SCAN_PLAYFIELD(xx, yy) -#else - for (yy = 0; yy < lev_fieldy; yy++) for (xx = 0; xx < lev_fieldx; xx++) -#endif { if (AmoebaNr[xx][yy] == old_group_nr) AmoebaNr[xx][yy] = new_group_nr; @@ -7450,11 +6834,7 @@ void AmoebeUmwandeln(int ax, int ay) } #endif -#if 1 SCAN_PLAYFIELD(x, y) -#else - for (y = 0; y < lev_fieldy; y++) for (x = 0; x < lev_fieldx; x++) -#endif { if (Feld[x][y] == EL_AMOEBA_DEAD && AmoebaNr[x][y] == group_nr) { @@ -7512,11 +6892,7 @@ void AmoebeUmwandelnBD(int ax, int ay, int new_element) } #endif -#if 1 - SCAN_PLAYFIELD(x, y) -#else - for (y = 0; y < lev_fieldy; y++) for (x = 0; x < lev_fieldx; x++) -#endif + SCAN_PLAYFIELD(x, y) { if (AmoebaNr[x][y] == group_nr && (Feld[x][y] == EL_AMOEBA_DEAD || @@ -7765,9 +7141,6 @@ void AmoebeAbleger(int ax, int ay) void Life(int ax, int ay) { int x1, y1, x2, y2; -#if 0 - static int life[4] = { 2, 3, 3, 3 }; /* parameters for "game of life" */ -#endif int life_time = 40; int element = Feld[ax][ay]; int graphic = el2img(element); @@ -7912,13 +7285,6 @@ static void ActivateMagicBall(int bx, int by) game.ball_content_nr = (game.ball_content_nr + 1) % level.num_ball_contents; } -static void InitDiagonalMovingElement(int x, int y) -{ -#if 0 - MovDelay[x][y] = level.android_move_time; -#endif -} - void CheckExit(int x, int y) { if (local_player->gems_still_needed > 0 || @@ -7967,11 +7333,7 @@ static void CloseAllOpenTimegates() { int x, y; -#if 1 SCAN_PLAYFIELD(x, y) -#else - for (y = 0; y < lev_fieldy; y++) for (x = 0; x < lev_fieldx; x++) -#endif { int element = Feld[x][y]; @@ -8366,7 +7728,7 @@ static void ExecuteCustomElementAction(int x, int y, int element, int page) action_type == CA_SET_LEVEL_GEMS ? level.gems_needed : action_type == CA_SET_LEVEL_TIME ? level.time : action_type == CA_SET_LEVEL_SCORE ? 0 : -#if 1 +#if USE_NEW_CUSTOM_VALUE action_type == CA_SET_CE_VALUE ? GET_NEW_CE_VALUE(element) : #else action_type == CA_SET_CE_VALUE ? ei->custom_value_initial : @@ -8550,13 +7912,7 @@ static void ExecuteCustomElementAction(int x, int y, int element, int page) { stored_player[i].key[KEY_NR(element)] = key_state; -#if 1 DrawGameDoorValues(); -#else - DrawGameValue_Keys(stored_player[i].key); -#endif - - redraw_mask |= REDRAW_DOOR_1; } } } @@ -8596,18 +7952,7 @@ static void ExecuteCustomElementAction(int x, int y, int element, int page) action_arg_number_min, action_arg_number_max); -#if 1 SetPlayerMoveSpeed(&stored_player[i], move_stepsize, FALSE); -#else - /* make sure that value is power of 2 */ - move_stepsize = (1 << log_2(move_stepsize)); - - /* do no immediately change -- the player might just be moving */ - stored_player[i].move_delay_value_next = TILEX / move_stepsize; - - stored_player[i].cannot_move = - (action_arg == CA_ARG_SPEED_NOT_MOVING ? TRUE : FALSE); -#endif } } @@ -8698,10 +8043,6 @@ static void ExecuteCustomElementAction(int x, int y, int element, int page) CustomValue[x][y] = action_arg_number_new; -#if 0 - printf("::: CE value == %d\n", CustomValue[x][y]); -#endif - if (CustomValue[x][y] != last_ce_value) { CheckElementChange(x, y, element, EL_UNDEFINED, CE_VALUE_CHANGES); @@ -8709,19 +8050,10 @@ static void ExecuteCustomElementAction(int x, int y, int element, int page) if (CustomValue[x][y] == 0) { -#if 0 - printf("::: CE_VALUE_GETS_ZERO\n"); -#endif - CheckElementChange(x, y, element, EL_UNDEFINED, CE_VALUE_GETS_ZERO); CheckTriggeredElementChange(x, y, element, CE_VALUE_GETS_ZERO_OF_X); - -#if 0 - printf("::: RESULT: %d, %d\n", Feld[x][y], ChangePage[x][y]); -#endif } } - #endif break; @@ -8734,10 +8066,6 @@ static void ExecuteCustomElementAction(int x, int y, int element, int page) ei->collect_score = action_arg_number_new; -#if 0 - printf("::: CE score == %d\n", ei->collect_score); -#endif - if (ei->collect_score != last_ce_score) { CheckElementChange(x, y, element, EL_UNDEFINED, CE_SCORE_CHANGES); @@ -8747,18 +8075,9 @@ static void ExecuteCustomElementAction(int x, int y, int element, int page) { int xx, yy; -#if 0 - printf("::: CE_SCORE_GETS_ZERO\n"); -#endif - CheckElementChange(x, y, element, EL_UNDEFINED, CE_SCORE_GETS_ZERO); CheckTriggeredElementChange(x, y, element, CE_SCORE_GETS_ZERO_OF_X); -#if 0 - printf("::: RESULT: %d, %d\n", Feld[x][y], ChangePage[x][y]); -#endif - -#if 1 /* This is a very special case that seems to be a mixture between CheckElementChange() and CheckTriggeredElementChange(): while @@ -8776,10 +8095,8 @@ static void ExecuteCustomElementAction(int x, int y, int element, int page) CheckElementChange(xx, yy, element, EL_UNDEFINED, CE_SCORE_GETS_ZERO); } -#endif } } - #endif break; @@ -9304,11 +8621,7 @@ static boolean CheckTriggeredElementChangeExt(int trigger_x, int trigger_y, { int x, y; -#if 1 SCAN_PLAYFIELD(x, y) -#else - for (y = 0; y < lev_fieldy; y++) for (x = 0; x < lev_fieldx; x++) -#endif { if (Feld[x][y] == element) { @@ -9513,11 +8826,7 @@ static void SetPlayerWaiting(struct PlayerInfo *player, boolean is_waiting) game.player_sleeping_delay_fixed + SimpleRND(game.player_sleeping_delay_random); -#if 1 InitPlayerGfxAnimation(player, ACTION_WAITING, move_dir); -#else - InitPlayerGfxAnimation(player, ACTION_WAITING, player->MovDir); -#endif } if (game.player_sleeping_delay_fixed + @@ -9535,7 +8844,6 @@ static void SetPlayerWaiting(struct PlayerInfo *player, boolean is_waiting) player->is_bored ? ACTION_BORING : ACTION_WAITING); -#if 1 if (player->is_sleeping && player->use_murphy) { /* special case for sleeping Murphy when leaning against non-free tile */ @@ -9553,7 +8861,6 @@ static void SetPlayerWaiting(struct PlayerInfo *player, boolean is_waiting) player->dir_waiting = move_dir; } -#endif if (player->is_sleeping) { @@ -9784,11 +9091,6 @@ void AdvanceFrameAndPlayerCounters(int player_nr) { int i; -#if 0 - Error(ERR_NETWORK_CLIENT, "advancing frame counter from %d to %d", - FrameCounter, FrameCounter + 1); -#endif - /* advance frame counters (global frame counter and time frame counter) */ FrameCounter++; TimeFrames++; @@ -9928,9 +9230,7 @@ void GameActions() /* at this point we know that we really continue executing the game */ -#if 1 network_player_action_received = FALSE; -#endif /* when playing tape, read previously recorded player input from tape data */ recorded_player_action = (tape.playing ? TapePlayAction() : NULL); @@ -9941,17 +9241,6 @@ void GameActions() return; #endif -#if 0 - if (tape.playing) - { - if (recorded_player_action == NULL) - printf("!!! THIS SHOULD NOT HAPPEN !!!\n"); - else - printf("::: %05d: TAPE PLAYING: %08x\n", - FrameCounter, recorded_player_action[0]); - } -#endif - if (tape.set_centered_player) { game.centered_player_nr_next = tape.centered_player_nr_next; @@ -9998,12 +9287,6 @@ void GameActions() if (tape.recording) TapeRecordAction(tape_action); -#if 0 - if (tape.recording) - printf("::: %05d: TAPE RECORDING: %08x\n", - FrameCounter, tape_action[0]); -#endif - if (level.game_engine_type == GAME_ENGINE_TYPE_EM) { GameActions_EM_Main(); @@ -10023,10 +9306,6 @@ void GameActions_EM_Main() for (i = 0; i < MAX_PLAYERS; i++) effective_action[i] = stored_player[i].effective_action; -#if 0 - printf("::: %04d: %08x\n", FrameCounter, effective_action[0]); -#endif - GameActions_EM(effective_action, warp_mode); CheckLevelTime(); @@ -10052,7 +9331,6 @@ void GameActions_RND() } #endif -#if 1 if (game.set_centered_player) { boolean all_players_fit_to_screen = checkIfAllPlayersFitToScreen_RND(); @@ -10094,7 +9372,6 @@ void GameActions_RND() DrawRelocateScreen(sx, sy, MV_NONE, TRUE, setup.quick_switch); DrawGameDoorValues(); } -#endif for (i = 0; i < MAX_PLAYERS; i++) { @@ -10115,22 +9392,11 @@ void GameActions_RND() if (stored_player[i].programmed_action) actual_player_action = stored_player[i].programmed_action; -#if 1 PlayerActions(&stored_player[i], actual_player_action); -#else - tape_action[i] = PlayerActions(&stored_player[i], actual_player_action); - - if (tape.recording && tape_action[i] && !tape.player_participates[i]) - tape.player_participates[i] = TRUE; /* player just appeared from CE */ -#endif ScrollPlayer(&stored_player[i], SCROLL_GO_ON); } -#if 0 - network_player_action_received = FALSE; -#endif - ScrollScreen(NULL, SCROLL_GO_ON); /* for backwards compatibility, the following code emulates a fixed bug that @@ -10165,11 +9431,7 @@ void GameActions_RND() } } -#if 1 SCAN_PLAYFIELD(x, y) -#else - for (y = 0; y < lev_fieldy; y++) for (x = 0; x < lev_fieldx; x++) -#endif { ChangeCount[x][y] = 0; ChangeEvent[x][y] = -1; @@ -10241,61 +9503,12 @@ void GameActions_RND() #endif } -#if 1 SCAN_PLAYFIELD(x, y) -#else - for (y = 0; y < lev_fieldy; y++) for (x = 0; x < lev_fieldx; x++) -#endif { element = Feld[x][y]; graphic = el_act_dir2img(element, GfxAction[x][y], GfxDir[x][y]); -#if 0 - printf("::: %d,%d\n", x, y); - - if (element == EL_ROCK) - printf("::: Yo man! Rocks can fall!\n"); -#endif - -#if 1 ResetGfxFrame(x, y, TRUE); -#else - if (graphic_info[graphic].anim_global_sync) - GfxFrame[x][y] = FrameCounter; - else if (ANIM_MODE(graphic) == ANIM_CE_VALUE) - { - int old_gfx_frame = GfxFrame[x][y]; - - GfxFrame[x][y] = CustomValue[x][y]; - -#if 1 - if (GfxFrame[x][y] != old_gfx_frame) -#endif - DrawLevelGraphicAnimation(x, y, graphic); - } - else if (ANIM_MODE(graphic) == ANIM_CE_SCORE) - { - int old_gfx_frame = GfxFrame[x][y]; - - GfxFrame[x][y] = element_info[element].collect_score; - -#if 1 - if (GfxFrame[x][y] != old_gfx_frame) -#endif - DrawLevelGraphicAnimation(x, y, graphic); - } - else if (ANIM_MODE(graphic) == ANIM_CE_DELAY) - { - int old_gfx_frame = GfxFrame[x][y]; - - GfxFrame[x][y] = ChangeDelay[x][y]; - -#if 1 - if (GfxFrame[x][y] != old_gfx_frame) -#endif - DrawLevelGraphicAnimation(x, y, graphic); - } -#endif if (ANIM_MODE(graphic) == ANIM_RANDOM && IS_NEXT_FRAME(GfxFrame[x][y], graphic)) @@ -10318,18 +9531,6 @@ void GameActions_RND() (game.engine_version < VERSION_IDENT(3,0,7,1) || !Stop[x][y])) { int page = element_info[element].event_page_nr[CE_DELAY]; -#if 0 - HandleElementChange(x, y, ChangePage[x][y] != -1 ? ChangePage[x][y] : page); -#else - -#if 0 - printf("::: ChangeDelay == %d\n", ChangeDelay[x][y]); -#endif - -#if 0 - if (element == EL_CUSTOM_255) - printf("::: ChangeDelay == %d\n", ChangeDelay[x][y]); -#endif #if 1 HandleElementChange(x, y, page); @@ -10339,8 +9540,6 @@ void GameActions_RND() if (HAS_ACTION(element)) ExecuteCustomElementAction(x, y, element, page); -#endif - #endif element = Feld[x][y]; @@ -10408,21 +9607,13 @@ void GameActions_RND() element == EL_DIAGONAL_SHRINKING || element == EL_DIAGONAL_GROWING) { -#if 1 graphic = el_act_dir2img(GfxElement[x][y], GfxAction[x][y],GfxDir[x][y]); DrawLevelGraphicAnimationIfNeeded(x, y, graphic); -#endif } else if (IS_ANIMATED(graphic) && !IS_CHANGING(x, y)) DrawLevelGraphicAnimationIfNeeded(x, y, graphic); -#if 0 - if (element == EL_CUSTOM_255 || - element == EL_CUSTOM_256) - DrawLevelGraphicAnimation(x, y, graphic); -#endif - if (IS_BELT_ACTIVE(element)) PlayLevelSoundAction(x, y, ACTION_ACTIVE); @@ -10482,11 +9673,7 @@ void GameActions_RND() { game.explosions_delayed = FALSE; -#if 1 SCAN_PLAYFIELD(x, y) -#else - for (y = 0; y < lev_fieldy; y++) for (x = 0; x < lev_fieldx; x++) -#endif { element = Feld[x][y]; @@ -10520,11 +9707,7 @@ void GameActions_RND() game.magic_wall_time_left--; if (!game.magic_wall_time_left) { -#if 1 SCAN_PLAYFIELD(x, y) -#else - for (y = 0; y < lev_fieldy; y++) for (x = 0; x < lev_fieldx; x++) -#endif { element = Feld[x][y]; @@ -10819,7 +10002,6 @@ boolean MovePlayerOneStep(struct PlayerInfo *player, if (!player_can_move) { -#if 1 if (player->MovPos == 0) { player->is_moving = FALSE; @@ -10828,14 +10010,6 @@ boolean MovePlayerOneStep(struct PlayerInfo *player, player->is_snapping = FALSE; player->is_pushing = FALSE; } -#else - DigField(player, 0, 0, 0, 0, 0, 0, DF_NO_PUSH); - SnapField(player, 0, 0); -#endif - -#if 0 - return MP_NO_ACTION; -#endif } #if 1 @@ -10870,18 +10044,9 @@ boolean MovePlayerOneStep(struct PlayerInfo *player, #endif can_move = DigField(player, jx, jy, new_jx, new_jy, real_dx,real_dy, DF_DIG); -#if 0 -#if USE_FIXED_DONT_RUN_INTO - if (can_move == MP_DONT_RUN_INTO) - return MP_MOVING; -#endif -#endif if (can_move != MP_MOVING) return can_move; -#if USE_FIXED_DONT_RUN_INTO -#endif - /* check if DigField() has caused relocation of the player */ if (player->jx != jx || player->jy != jy) return MP_NO_ACTION; /* <-- !!! CHECK THIS [-> MP_ACTION ?] !!! */ @@ -11207,12 +10372,6 @@ void ScrollPlayer(struct PlayerInfo *player, int mode) else if (!FrameReached(&player->actual_frame_counter, 1)) return; -#if 0 - printf("::: player->MovPos: %d -> %d\n", - player->MovPos, - player->MovPos + (player->MovPos > 0 ? -1 : 1) * move_stepsize); -#endif - #if USE_NEW_PLAYER_SPEED if (player->MovPos != 0) { @@ -11234,10 +10393,6 @@ void ScrollPlayer(struct PlayerInfo *player, int mode) if (player->MovPos == 0) /* player reached destination field */ { -#if 0 - printf("::: player reached destination field\n"); -#endif - if (player->move_delay_reset_counter > 0) { player->move_delay_reset_counter--; @@ -12109,31 +11264,6 @@ int DigField(struct PlayerInfo *player, game.engine_version >= VERSION_IDENT(2,2,0,0)) old_element = Back[jx][jy]; - /* checking here causes player to move into acid even if the current field - cannot be left to that direction */ -#if 0 -#if USE_FIXED_DONT_RUN_INTO - if (player_can_move && DONT_RUN_INTO(element)) - { - if (element == EL_ACID && dx == 0 && dy == 1) - { - SplashAcid(x, y); - Feld[jx][jy] = EL_PLAYER_1; - InitMovingField(jx, jy, MV_DOWN); - Store[jx][jy] = EL_ACID; - ContinueMoving(jx, jy); - BuryPlayer(player); - } - else - TestIfPlayerRunsIntoBadThing(jx, jy, player->MovDir); - - return MP_DONT_RUN_INTO; - } -#endif -#endif - -#if 1 /* ------------------------------ NEW ------------------------------ */ - if (IS_WALKABLE(old_element) && !ACCESS_FROM(old_element, move_direction)) return MP_NO_ACTION; /* field has no opening in this direction */ @@ -12144,11 +11274,8 @@ int DigField(struct PlayerInfo *player, if (player_can_move && element == EL_ACID && move_direction == MV_DOWN) { SplashAcid(x, y); -#if 1 + Feld[jx][jy] = player->artwork_element; -#else - Feld[jx][jy] = EL_PLAYER_1; -#endif InitMovingField(jx, jy, MV_DOWN); Store[jx][jy] = EL_ACID; ContinueMoving(jx, jy); @@ -12167,65 +11294,6 @@ int DigField(struct PlayerInfo *player, } #endif -#else /* ------------------------------ OLD ------------------------------ */ - -#if 1 -#if USE_FIXED_DONT_RUN_INTO - if (player_can_move && DONT_RUN_INTO(element)) - { - TestIfPlayerRunsIntoBadThing(jx, jy, player->MovDir); - - return MP_DONT_RUN_INTO; - } -#endif -#endif - - if (IS_WALKABLE(old_element) && !ACCESS_FROM(old_element, move_direction)) - return MP_NO_ACTION; /* field has no opening in this direction */ - - if (IS_PASSABLE(old_element) && !ACCESS_FROM(old_element,opposite_direction)) - return MP_NO_ACTION; /* field has no opening in this direction */ - - /* checking here causes player to explode when moving into acid */ -#if 1 -#if USE_FIXED_DONT_RUN_INTO - if (player_can_move && element == EL_ACID && move_direction == MV_DOWN) - { - SplashAcid(x, y); - Feld[jx][jy] = EL_PLAYER_1; - InitMovingField(jx, jy, MV_DOWN); - Store[jx][jy] = EL_ACID; - ContinueMoving(jx, jy); - BuryPlayer(player); - - return MP_DONT_RUN_INTO; - } -#endif -#endif - -#endif /* ------------------------------ END ------------------------------ */ - -#if 0 -#if USE_FIXED_DONT_RUN_INTO - if (player_can_move && DONT_RUN_INTO(element)) - { - if (element == EL_ACID && dx == 0 && dy == 1) - { - SplashAcid(x, y); - Feld[jx][jy] = EL_PLAYER_1; - InitMovingField(jx, jy, MV_DOWN); - Store[jx][jy] = EL_ACID; - ContinueMoving(jx, jy); - BuryPlayer(player); - } - else - TestIfPlayerRunsIntoBadThing(jx, jy, player->MovDir); - - return MP_DONT_RUN_INTO; - } -#endif -#endif - #if USE_FIXED_DONT_RUN_INTO if (IS_MOVING(x, y) || IS_PLAYER(x, y)) return MP_NO_ACTION; @@ -12451,11 +11519,7 @@ int DigField(struct PlayerInfo *player, if (player->inventory_size < MAX_INVENTORY_SIZE) player->inventory_element[player->inventory_size++] = element; -#if 1 DrawGameDoorValues(); -#else - DrawGameValue_Dynamite(local_player->inventory_size); -#endif } else if (element == EL_DYNABOMB_INCREASE_NUMBER) { @@ -12474,13 +11538,7 @@ int DigField(struct PlayerInfo *player, { player->key[KEY_NR(element)] = TRUE; -#if 1 DrawGameDoorValues(); -#else - DrawGameValue_Keys(player->key); -#endif - - redraw_mask |= REDRAW_DOOR_1; } else if (IS_ENVELOPE(element)) { @@ -12510,11 +11568,7 @@ int DigField(struct PlayerInfo *player, if (player->inventory_size < MAX_INVENTORY_SIZE) player->inventory_element[player->inventory_size++] = element; -#if 1 DrawGameDoorValues(); -#else - DrawGameValue_Dynamite(local_player->inventory_size); -#endif } else if (collect_count > 0) { @@ -12707,11 +11761,7 @@ int DigField(struct PlayerInfo *player, { int xx, yy; -#if 1 SCAN_PLAYFIELD(xx, yy) -#else - for (yy = 0; yy < lev_fieldy; yy++) for (xx = 0; xx < lev_fieldx; xx++) -#endif { if (Feld[xx][yy] == EL_SP_DISK_YELLOW) Bang(xx, yy); @@ -12779,11 +11829,7 @@ int DigField(struct PlayerInfo *player, game.ball_state = !game.ball_state; -#if 1 SCAN_PLAYFIELD(xx, yy) -#else - for (yy = 0; yy < lev_fieldy; yy++) for (xx = 0; xx < lev_fieldx; xx++) -#endif { int e = Feld[xx][yy]; @@ -13004,11 +12050,7 @@ boolean DropElement(struct PlayerInfo *player) { player->inventory_size--; -#if 1 DrawGameDoorValues(); -#else - DrawGameValue_Dynamite(local_player->inventory_size); -#endif if (new_element == EL_DYNAMITE) new_element = EL_DYNAMITE_ACTIVE; diff --git a/src/game.h b/src/game.h index f855387a..4190c9ec 100644 --- a/src/game.h +++ b/src/game.h @@ -1,7 +1,7 @@ /*********************************************************** * Rocks'n'Diamonds -- McDuffin Strikes Back! * *----------------------------------------------------------* -* (c) 1995-2002 Artsoft Entertainment * +* (c) 1995-2006 Artsoft Entertainment * * Holger Schemel * * Detmolder Strasse 189 * * 33604 Bielefeld * @@ -67,13 +67,11 @@ struct GameInfo boolean explosions_delayed; boolean envelope_active; -#if 1 /* values for the new EMC elements */ int lenses_time_left; int magnify_time_left; boolean ball_state; int ball_content_nr; -#endif /* values for player idle animation (no effect on engine) */ int player_boring_delay_fixed; diff --git a/src/init.c b/src/init.c index bcfcdea3..b25a9408 100644 --- a/src/init.c +++ b/src/init.c @@ -1817,7 +1817,6 @@ boolean getBitfieldProperty(int *bitfield, int property_bit_nr, int element) return FALSE; } -#if 1 static void resolve_group_element(int group_element, int recursion_depth) { static int group_nr; @@ -1864,7 +1863,6 @@ static void resolve_group_element(int group_element, int recursion_depth) } } } -#endif void InitElementPropertiesStatic() { @@ -3712,7 +3710,6 @@ void InitElementPropertiesEngine(int engine_version) property (which means that conditional property changes must be set to a reliable default value before) */ -#if 1 /* ---------- recursively resolve group elements ------------------------- */ for (i = 0; i < MAX_NUM_ELEMENTS; i++) @@ -3721,7 +3718,6 @@ void InitElementPropertiesEngine(int engine_version) for (i = 0; i < NUM_GROUP_ELEMENTS; i++) resolve_group_element(EL_GROUP_START + i, 0); -#endif /* set all special, combined or engine dependent element properties */ for (i = 0; i < MAX_NUM_ELEMENTS; i++) @@ -3924,58 +3920,6 @@ void InitElementPropertiesEngine(int engine_version) engine_version > VERSION_IDENT(2,0,1,0))); } -#if 0 - /* set default push delay values (corrected since version 3.0.7-1) */ - if (engine_version < VERSION_IDENT(3,0,7,1)) - { - game.default_push_delay_fixed = 2; - game.default_push_delay_random = 8; - } - else - { - game.default_push_delay_fixed = 8; - game.default_push_delay_random = 8; - } -#endif - -#if 0 - /* set uninitialized push delay values of custom elements in older levels */ - for (i = 0; i < NUM_CUSTOM_ELEMENTS; i++) - { - int element = EL_CUSTOM_START + i; - - if (element_info[element].push_delay_fixed == -1) - element_info[element].push_delay_fixed = game.default_push_delay_fixed; - if (element_info[element].push_delay_random == -1) - element_info[element].push_delay_random = game.default_push_delay_random; - } -#endif - -#if 0 - /* set some other uninitialized values of custom elements in older levels */ - if (engine_version < VERSION_IDENT(3,1,0,0)) - { - for (i = 0; i < NUM_CUSTOM_ELEMENTS; i++) - { - int element = EL_CUSTOM_START + i; - - element_info[element].access_direction = MV_ALL_DIRECTIONS; - - element_info[element].explosion_delay = 17; - element_info[element].ignition_delay = 8; - } - } -#endif - -#if 0 - /* set element properties that were handled incorrectly in older levels */ - if (engine_version < VERSION_IDENT(3,1,0,0)) - { - SET_PROPERTY(EL_SP_SNIKSNAK, EP_DONT_COLLIDE_WITH, FALSE); - SET_PROPERTY(EL_SP_ELECTRON, EP_DONT_COLLIDE_WITH, FALSE); - } -#endif - /* this is needed because some graphics depend on element properties */ if (game_status == GAME_MODE_PLAYING) InitElementGraphicInfo(); @@ -3985,34 +3929,6 @@ void InitElementPropertiesAfterLoading(int engine_version) { int i; -#if 0 - /* set default push delay values (corrected since version 3.0.7-1) */ - if (engine_version < VERSION_IDENT(3,0,7,1)) - { - game.default_push_delay_fixed = 2; - game.default_push_delay_random = 8; - } - else - { - game.default_push_delay_fixed = 8; - game.default_push_delay_random = 8; - } -#endif - -#if 0 - /* set uninitialized push delay values of custom elements in older levels */ - for (i = 0; i < NUM_CUSTOM_ELEMENTS; i++) - { - int element = EL_CUSTOM_START + i; - - if (element_info[element].push_delay_fixed == -1) - element_info[element].push_delay_fixed = game.default_push_delay_fixed; - if (element_info[element].push_delay_random == -1) - element_info[element].push_delay_random = game.default_push_delay_random; - } -#endif - -#if 1 /* set some other uninitialized values of custom elements in older levels */ if (engine_version < VERSION_IDENT(3,1,0,0)) { @@ -4026,7 +3942,6 @@ void InitElementPropertiesAfterLoading(int engine_version) element_info[element].ignition_delay = 8; } } -#endif } static void InitGlobal() @@ -4799,11 +4714,7 @@ void ReloadCustomArtwork(int force_reload) if (redraw_screen) { -#if 1 RedrawBackground(); -#else - InitGfxBackground(); -#endif /* force redraw of (open or closed) door graphics */ SetDoorState(DOOR_OPEN_ALL); @@ -4892,15 +4803,7 @@ void OpenAll() game_status = GAME_MODE_MAIN; -#if 0 - em_open_all(); -#endif - -#if 0 - DrawMainMenuExt(REDRAW_ALL); -#else DrawMainMenu(); -#endif InitNetworkServer(); } diff --git a/src/init.h b/src/init.h index 1bfd49bc..165c2a78 100644 --- a/src/init.h +++ b/src/init.h @@ -1,7 +1,7 @@ /*********************************************************** * Rocks'n'Diamonds -- McDuffin Strikes Back! * *----------------------------------------------------------* -* (c) 1995-2002 Artsoft Entertainment * +* (c) 1995-2006 Artsoft Entertainment * * Holger Schemel * * Detmolder Strasse 189 * * 33604 Bielefeld * diff --git a/src/main.c b/src/main.c index f09dbd62..ddc3042f 100644 --- a/src/main.c +++ b/src/main.c @@ -68,10 +68,6 @@ short ExplodeDelay[MAX_LEV_FIELDX][MAX_LEV_FIELDY]; int RunnerVisit[MAX_LEV_FIELDX][MAX_LEV_FIELDY]; int PlayerVisit[MAX_LEV_FIELDX][MAX_LEV_FIELDY]; -#if 0 -unsigned long Properties[MAX_NUM_ELEMENTS][NUM_EP_BITFIELDS]; -#endif - int GfxFrame[MAX_LEV_FIELDX][MAX_LEV_FIELDY]; int GfxRandom[MAX_LEV_FIELDX][MAX_LEV_FIELDY]; int GfxElement[MAX_LEV_FIELDX][MAX_LEV_FIELDY]; diff --git a/src/main.h b/src/main.h index cd6ffe2b..9ba274dd 100644 --- a/src/main.h +++ b/src/main.h @@ -1,7 +1,7 @@ /*********************************************************** * Rocks'n'Diamonds -- McDuffin Strikes Back! * *----------------------------------------------------------* -* (c) 1995-2002 Artsoft Entertainment * +* (c) 1995-2006 Artsoft Entertainment * * Holger Schemel * * Detmolder Strasse 189 * * 33604 Bielefeld * @@ -177,11 +177,7 @@ #define EP_BITMASK_DEFAULT 0 #define PROPERTY_BIT(p) (1 << ((p) % 32)) -#if 1 #define PROPERTY_VAR(e,p) (element_info[e].properties[(p) / 32]) -#else -#define PROPERTY_VAR(e,p) (Properties[e][(p) / 32]) -#endif #define HAS_PROPERTY(e,p) ((PROPERTY_VAR(e, p) & PROPERTY_BIT(p)) != 0) #define SET_PROPERTY(e,p,v) ((v) ? \ (PROPERTY_VAR(e,p) |= PROPERTY_BIT(p)) : \ @@ -710,21 +706,13 @@ #define SND_ELEMENT(e) (e) #endif -#if 1 #define GROUP_NR(e) ((e) - EL_GROUP_START) #define IS_IN_GROUP(e, nr) (element_info[e].in_group[nr] == TRUE) #define IS_IN_GROUP_EL(e, ge) (IS_IN_GROUP(e, (ge) - EL_GROUP_START)) -#if 1 #define IS_EQUAL_OR_IN_GROUP(e, ge) \ (ge == EL_ANY_ELEMENT ? TRUE : \ IS_GROUP_ELEMENT(ge) ? IS_IN_GROUP(e, GROUP_NR(ge)) : (e) == (ge)) -#else -#define IS_EQUAL_OR_IN_GROUP(e, ge) \ - (IS_GROUP_ELEMENT(ge) ? IS_IN_GROUP(e, GROUP_NR(ge)) : (e) == (ge)) -#endif - -#endif #define IS_PLAYER(x, y) (ELEM_IS_PLAYER(StorePlayer[x][y])) @@ -816,12 +804,6 @@ #define MAX_NUM_AMOEBA 100 -#if 0 /* game.h */ -#define MAX_INVENTORY_SIZE 1000 -#define STD_NUM_KEYS 4 -#define MAX_NUM_KEYS 8 -#endif - #define NUM_BELTS 4 #define NUM_BELT_PARTS 3 #define NUM_ENVELOPES 4 @@ -1968,7 +1950,6 @@ struct LevelInfo int explosion_element[MAX_PLAYERS]; boolean use_explosion_element[MAX_PLAYERS]; -#if 1 /* values for the new EMC elements */ int android_move_time; int android_clone_time; @@ -1985,12 +1966,8 @@ struct LevelInfo struct Content ball_content[MAX_ELEMENT_CONTENTS]; int num_ball_contents; -#if 0 - boolean android_array[16]; -#endif int num_android_clone_elements; int android_clone_element[MAX_ANDROID_ELEMENTS]; -#endif int can_move_into_acid_bits; /* bitfield to store property for elements */ int dont_collide_with_bits; /* bitfield to store property for elements */ @@ -2396,10 +2373,6 @@ extern short ExplodeDelay[MAX_LEV_FIELDX][MAX_LEV_FIELDY]; extern int RunnerVisit[MAX_LEV_FIELDX][MAX_LEV_FIELDY]; extern int PlayerVisit[MAX_LEV_FIELDX][MAX_LEV_FIELDY]; -#if 0 -extern unsigned long Properties[MAX_NUM_ELEMENTS][NUM_EP_BITFIELDS]; -#endif - extern int GfxFrame[MAX_LEV_FIELDX][MAX_LEV_FIELDY]; extern int GfxRandom[MAX_LEV_FIELDX][MAX_LEV_FIELDY]; extern int GfxElement[MAX_LEV_FIELDX][MAX_LEV_FIELDY]; diff --git a/src/netserv.h b/src/netserv.h index 5efcb803..69eeaefa 100644 --- a/src/netserv.h +++ b/src/netserv.h @@ -1,7 +1,7 @@ /*********************************************************** * Rocks'n'Diamonds -- McDuffin Strikes Back! * *----------------------------------------------------------* -* (c) 1995-2002 Artsoft Entertainment * +* (c) 1995-2006 Artsoft Entertainment * * Holger Schemel * * Detmolder Strasse 189 * * 33604 Bielefeld * diff --git a/src/network.c b/src/network.c index 1733aba9..6f1855c1 100644 --- a/src/network.c +++ b/src/network.c @@ -431,18 +431,11 @@ static void Handle_OP_NUMBER_WANTED() } else if (old_client_nr == first_player.nr) /* failed -- local player? */ { -#if 0 - char *color[] = { "yellow", "red", "green", "blue" }; -#endif char request[100]; -#if 1 sprintf(request, "Sorry ! Player %d already exists ! You are player %d !", index_nr_wanted + 1, new_index_nr + 1); -#else - sprintf(request, "Sorry ! %s player still exists ! You are %s player !", - color[index_nr_wanted], color[new_index_nr]); -#endif + Request(request, REQ_CONFIRM); Error(ERR_NETWORK_CLIENT, "cannot switch -- you keep client # %d", @@ -602,16 +595,11 @@ static void Handle_OP_MOVE_PLAYER(unsigned int len) Error(ERR_RETURN, "client and servers frame counters out of sync"); Error(ERR_RETURN, "frame counter of client is %d", FrameCounter); Error(ERR_RETURN, "frame counter of server is %d", server_frame_counter); - -#if 1 Error(ERR_RETURN, "this should not happen -- please debug"); stop_network_game = TRUE; return; -#else - Error(ERR_EXIT, "this should not happen -- please debug"); -#endif } /* copy valid player actions */ diff --git a/src/network.h b/src/network.h index 72c58445..569ad5bb 100644 --- a/src/network.h +++ b/src/network.h @@ -1,7 +1,7 @@ /*********************************************************** * Rocks'n'Diamonds -- McDuffin Strikes Back! * *----------------------------------------------------------* -* (c) 1995-2002 Artsoft Entertainment * +* (c) 1995-2006 Artsoft Entertainment * * Holger Schemel * * Detmolder Strasse 189 * * 33604 Bielefeld * diff --git a/src/screens.c b/src/screens.c index 8e09ecc9..6e770327 100644 --- a/src/screens.c +++ b/src/screens.c @@ -304,11 +304,7 @@ void DrawMainMenuExt(int redraw_mask, boolean do_fading) static LevelDirTree *leveldir_last_valid = NULL; boolean levelset_has_changed = FALSE; char *name_text = (!options.network && setup.team_mode ? "Team:" : "Name:"); -#if 1 char *level_text = "Levelset"; -#else - char *level_text = "Level:"; -#endif int name_width, level_width; int i; @@ -323,9 +319,7 @@ void DrawMainMenuExt(int redraw_mask, boolean do_fading) audio.sound_deactivated = FALSE; -#if 1 GetPlayerConfig(); -#endif /* needed if last screen was the playing screen, invoked from level editor */ if (level_editor_test_game) @@ -369,18 +363,10 @@ void DrawMainMenuExt(int redraw_mask, boolean do_fading) return; } -#if 0 - /* map gadgets for main menu screen */ - MapTapeButtons(); -#endif - /* level_nr may have been set to value over handicap with level editor */ if (setup.handicap && level_nr > leveldir_current->handicap_level) level_nr = leveldir_current->handicap_level; -#if 0 - GetPlayerConfig(); -#endif LoadLevel(level_nr); SetMainBackgroundImage(IMG_BACKGROUND_MAIN); @@ -399,44 +385,19 @@ void DrawMainMenuExt(int redraw_mask, boolean do_fading) /* calculated after (possible) reload of custom artwork */ name_width = getTextWidth(name_text, FONT_MENU_1); -#if 1 level_width = 9 * 32; -#else -#if 1 - level_width = 9 * getFontWidth(FONT_MENU_1); -#else - level_width = getTextWidth(level_text, FONT_MENU_1); -#endif -#endif DrawText(mSX + 32 + name_width, mSY + 2 * 32, setup.player_name, FONT_INPUT_1); -#if 1 DrawText(mSX + getCurrentLevelTextPos() * 32, mSY + 3 * 32, int2str(level_nr, 3), FONT_VALUE_1); -#else -#if 1 - DrawText(mSX + level_width + 2 * 32, mSY + 3 * 32, int2str(level_nr, 3), - FONT_VALUE_1); -#else - DrawText(mSX + level_width + 5 * 32, mSY + 3 * 32, int2str(level_nr, 3), - FONT_VALUE_1); -#endif -#endif DrawPreviewLevel(TRUE); -#if 1 - -#if 1 { int text_height = getFontHeight(FONT_TEXT_3); -#if 1 int xpos = getLevelRangeTextPos() * 32; -#else - int xpos = level_width + 6 * 32; -#endif int ypos2 = -SY + 3 * 32 + 16; int ypos1 = ypos2 - text_height; @@ -445,56 +406,13 @@ void DrawMainMenuExt(int redraw_mask, boolean do_fading) DrawTextF(mSX + xpos, mSY + ypos2, FONT_TEXT_3, "%03d", leveldir_current->last_level); } -#else - DrawTextF(mSX + level_width + 6 * 32, mSY + 3 * 32 + 1, FONT_TEXT_3, - "%d", leveldir_current->levels); -#endif - -#else - DrawTextF(mSX + 32 + level_width - 2, mSY + 3 * 32 + 1, FONT_TEXT_3, "%d-%d", - leveldir_current->first_level, leveldir_current->last_level); -#endif - -#if 0 - if (leveldir_current->readonly) - { - DrawTextS(mSX + level_width + 9 * 32 - 2, - mSY + 3 * 32 + 1 - 7, FONT_TEXT_3, "READ"); - DrawTextS(mSX + level_width + 9 * 32 - 2, - mSY + 3 * 32 + 1 + 7, FONT_TEXT_3, "ONLY"); - } -#endif for (i = 0; i < 8; i++) initCursor(i, (i == 1 || i == 4 || i == 6 ? IMG_MENU_BUTTON_ENTER_MENU : IMG_MENU_BUTTON)); -#if 0 - -#if 1 - drawCursorXY(getLastLevelButtonPos(), 1, IMG_MENU_BUTTON_LAST_LEVEL); - drawCursorXY(getNextLevelButtonPos(), 1, IMG_MENU_BUTTON_NEXT_LEVEL); -#else -#if 1 - drawCursorXY(level_width / 32 + 1, 1, IMG_MENU_BUTTON_LEFT); - drawCursorXY(level_width / 32 + 5, 1, IMG_MENU_BUTTON_RIGHT); -#else - drawCursorXY(level_width / 32 + 4, 1, IMG_MENU_BUTTON_LEFT); - drawCursorXY(level_width / 32 + 8, 1, IMG_MENU_BUTTON_RIGHT); -#endif -#endif - -#endif - DrawTextSCentered(326, FONT_TITLE_2, "A Game by Artsoft Entertainment"); -#if 0 - FadeToFront(); -#endif -#if 0 - InitAnimation(); -#endif - HandleMainMenu(0, 0, 0, 0, MB_MENU_INITIALIZE); TapeStop(); @@ -505,22 +423,6 @@ void DrawMainMenuExt(int redraw_mask, boolean do_fading) PlayMenuSound(); PlayMenuMusic(); -#if 0 -#if 1 - OpenDoor(DOOR_CLOSE_1 | DOOR_OPEN_2); -#else - if (fade_delay > 0) - OpenDoor(DOOR_CLOSE_1 | DOOR_OPEN_2 | DOOR_NO_DELAY | DOOR_FORCE_REDRAW); - else - OpenDoor(DOOR_CLOSE_1 | DOOR_OPEN_2); -#endif -#endif - -#if 0 - InitAnimation(); -#endif - -#if 1 /* create gadgets for main menu screen */ FreeScreenGadgets(); CreateScreenGadgets(); @@ -528,26 +430,15 @@ void DrawMainMenuExt(int redraw_mask, boolean do_fading) /* map gadgets for main menu screen */ MapTapeButtons(); MapScreenMenuGadgets(SCREEN_MASK_MAIN); -#endif -#if 1 -#if 1 if (do_fading) FadeIn(redraw_mask); else BackToFront(); -#else - BackToFront(); -#endif -#endif -#if 1 InitAnimation(); -#endif -#if 1 OpenDoor(DOOR_CLOSE_1 | DOOR_OPEN_2); -#endif } void DrawAndFadeInMainMenu(int redraw_mask) @@ -656,18 +547,10 @@ void HandleTitleScreen(int mx, int my, int dx, int dy, int button) if (title_nr < MAX_NUM_TITLE_SCREENS && graphic_info[IMG_TITLESCREEN_1 + title_nr].bitmap != NULL) { - Bitmap *drawto_last = drawto; - -#if 1 if (use_cross_fading) FadeCrossSaveBackbuffer(); -#else - if (use_cross_fading) - drawto = bitmap_db_cross; -#endif - DrawTitleScreenImage(title_nr); - drawto = drawto_last; + DrawTitleScreenImage(title_nr); if (use_cross_fading) FadeCross(REDRAW_ALL); @@ -750,10 +633,6 @@ void HandleMainMenu_SelectLevel(int step, int direction) void HandleMainMenu(int mx, int my, int dx, int dy, int button) { -#if 0 - static unsigned long level_delay = 0; - static unsigned long level_delay_value = GADGET_FRAME_DELAY; -#endif static int choice = 5; int x = 0; int y = choice; @@ -782,75 +661,10 @@ void HandleMainMenu(int mx, int my, int dx, int dy, int button) y = choice + dy; } -#if 0 - /* start gadget delay with longer delay after first click on gadget */ - if (button == 0) - pressed_delay_value = GADGET_FRAME_DELAY_FIRST; -#endif - -#if 1 - if (y == 1 && dx != 0 && button) { HandleMainMenu_SelectLevel(1, dx < 0 ? -1 : +1); } - -#else - - if (y == 1 && ((x == 10 && level_nr > leveldir_current->first_level) || - (x == 14 && level_nr < leveldir_current->last_level)) && - button && DelayReached(&level_delay, level_delay_value)) - { - int step = (button == 1 ? 1 : button == 2 ? 5 : 10); - int old_level_nr = level_nr; - int new_level_nr; - - new_level_nr = level_nr + (x == 10 ? -step : +step); - if (new_level_nr < leveldir_current->first_level) - new_level_nr = leveldir_current->first_level; - if (new_level_nr > leveldir_current->last_level) - new_level_nr = leveldir_current->last_level; - - if (setup.handicap && new_level_nr > leveldir_current->handicap_level) - { - /* skipping levels is only allowed when trying to skip single level */ - if (setup.skip_levels && step == 1 && - Request("Level still unsolved ! Skip despite handicap ?", REQ_ASK)) - { - leveldir_current->handicap_level++; - SaveLevelSetup_SeriesInfo(); - } - - new_level_nr = leveldir_current->handicap_level; - } - - if (new_level_nr != old_level_nr) - { - level_nr = new_level_nr; - - DrawText(mSX + 11 * 32, mSY + 3 * 32, int2str(level_nr, 3), - FONT_VALUE_1); - - LoadLevel(level_nr); - DrawPreviewLevel(TRUE); - - TapeErase(); - LoadTape(level_nr); - DrawCompleteVideoDisplay(); - - /* needed because DrawPreviewLevel() takes some time */ - BackToFront(); - SyncDisplay(); - - DelayReached(&level_delay, 0); /* reset delay counter */ -#if 0 - pressed_delay_value = GADGET_FRAME_DELAY_FIRST; -#endif - } - } - -#endif - else if (IN_VIS_FIELD(x, y) && y >= 0 && y <= 7 && (y != 1 || x < 10)) { @@ -1006,11 +820,7 @@ static void DrawInfoScreen_Main(boolean do_fading) ClearWindow(); -#if 1 DrawTextSCentered(mSY - SY + 16, FONT_TITLE_1, "Info Screen"); -#else - DrawText(mSX + 16, mSY + 16, "Info Screen", FONT_TITLE_1); -#endif info_info = info_info_main; num_info_info = 0; @@ -1033,8 +843,6 @@ static void DrawInfoScreen_Main(boolean do_fading) num_info_info++; } -#if 1 - HandleInfoScreen_Main(0, 0, 0, 0, MB_MENU_INITIALIZE); PlayMenuSound(); @@ -1046,17 +854,6 @@ static void DrawInfoScreen_Main(boolean do_fading) BackToFront(); InitAnimation(); - -#else - - FadeToFront(); - InitAnimation(); - - PlayMenuSound(); - PlayMenuMusic(); - - HandleInfoScreen_Main(0, 0, 0, 0, MB_MENU_INITIALIZE); -#endif } void HandleInfoScreen_Main(int mx, int my, int dx, int dy, int button) @@ -1455,7 +1252,6 @@ void HandleInfoScreen_Music(int button) if (button_released || button == MB_MENU_INITIALIZE) { - Bitmap *drawto_last = drawto; int y = 0; if (button != MB_MENU_INITIALIZE) @@ -1472,13 +1268,8 @@ void HandleInfoScreen_Music(int button) FadeSoundsAndMusic(); -#if 1 if (button != MB_MENU_INITIALIZE) FadeCrossSaveBackbuffer(); -#else - if (button != MB_MENU_INITIALIZE) - drawto = bitmap_db_cross; -#endif ClearWindow(); DrawHeadline(); @@ -1542,8 +1333,6 @@ void HandleInfoScreen_Music(int button) DrawTextSCentered(ybottom, FONT_TEXT_4, "Press any key or button for next page"); - drawto = drawto_last; - if (button != MB_MENU_INITIALIZE) FadeCross(REDRAW_FIELD); } @@ -1750,20 +1539,13 @@ void HandleInfoScreen_Credits(int button) } else if (button == MB_MENU_CHOICE) { - Bitmap *drawto_last = drawto; boolean show_screen; screen_nr++; -#if 1 FadeCrossSaveBackbuffer(); -#else - drawto = bitmap_db_cross; -#endif show_screen = DrawInfoScreen_CreditsScreen(screen_nr); - - drawto = drawto_last; if (show_screen) { @@ -2065,34 +1847,15 @@ static void drawChooseTreeList(int first_entry, int num_page_entries, { int i; char *title_string = NULL; -#if 0 - int xoffset_sets = 16; -#endif int yoffset_sets = MENU_TITLE1_YPOS; -#if 0 - int xoffset_setup = 16; -#endif int yoffset_setup = 16; -#if 1 -#if 0 - int xoffset = (ti->type == TREE_TYPE_LEVEL_DIR ? xoffset_sets : - xoffset_setup); -#endif int yoffset = (ti->type == TREE_TYPE_LEVEL_DIR ? yoffset_sets : yoffset_setup); -#else - int xoffset = (ti->type == TREE_TYPE_LEVEL_DIR ? 0 : xoffset_setup); - int yoffset = (ti->type == TREE_TYPE_LEVEL_DIR ? 0 : yoffset_setup); -#endif int last_game_status = game_status; /* save current game status */ title_string = ti->infotext; -#if 1 DrawTextSCentered(mSY - SY + yoffset, FONT_TITLE_1, title_string); -#else - DrawText(SX + xoffset, SY + yoffset, title_string, FONT_TITLE_1); -#endif /* force LEVELS font on artwork setup screen */ game_status = GAME_MODE_LEVELS; @@ -2143,11 +1906,7 @@ static void drawChooseTreeInfo(int entry_pos, TreeInfo *ti) { TreeInfo *node, *node_first; int x, last_redraw_mask = redraw_mask; -#if 1 int ypos = MENU_TITLE2_YPOS; -#else - int ypos = 40; -#endif if (ti->type != TREE_TYPE_LEVEL_DIR) return; @@ -2438,9 +2197,6 @@ void DrawHallOfFame(int highlight_position) FadeOut(REDRAW_FIELD); -#if 0 - FadeToFront(); -#endif InitAnimation(); PlayMenuSound(); @@ -2458,15 +2214,9 @@ static void drawHallOfFameList(int first_entry, int highlight_position) SetMainBackgroundImage(IMG_BACKGROUND_SCORES); ClearWindow(); -#if 1 DrawTextSCentered(MENU_TITLE1_YPOS, FONT_TITLE_1, "Hall Of Fame"); DrawTextFCentered(MENU_TITLE2_YPOS, FONT_TITLE_2, "HighScores of Level %d", level_nr); -#else - DrawText(mSX + 80, mSY + MENU_TITLE1_YPOS, "Hall Of Fame", FONT_TITLE_1); - DrawTextFCentered(MENU_TITLE2_YPOS, FONT_TITLE_2, - "HighScores of Level %d", level_nr); -#endif for (i = 0; i < NUM_MENU_ENTRIES_ON_SCREEN; i++) { @@ -2981,18 +2731,11 @@ static void drawSetupValue(int pos) if (type & TYPE_KEY) { -#if 1 xpos = MENU_SCREEN_START_XPOS; -#else - xpos = 3; -#endif if (type & TYPE_QUERY) { value_string = ""; -#if 0 - font_nr = FONT_INPUT_1_ACTIVE; -#endif } } else if (type & TYPE_STRING) @@ -3000,25 +2743,10 @@ static void drawSetupValue(int pos) int max_value_len = (SCR_FIELDX - 2) * 2; xpos = MENU_SCREEN_START_XPOS; -#if 0 - font_nr = FONT_VALUE_2; -#endif if (strlen(value_string) > max_value_len) value_string[max_value_len] = '\0'; } - else if (type & TYPE_ECS_AGA) - { -#if 0 - font_nr = FONT_VALUE_1; -#endif - } - else if (type & TYPE_BOOLEAN_STYLE) - { -#if 0 - font_nr = (*(boolean *)value ? FONT_OPTION_ON : FONT_OPTION_OFF); -#endif - } startx = mSX + xpos * 32; starty = mSY + ypos * 32; @@ -3045,12 +2773,6 @@ static void drawSetupValue(int pos) startx + font2_xoffset < text_startx + text_width + text_font_xoffset) correct_font_draw_xoffset = TRUE; -#if 0 - printf("::: %d + %d < %d + %d + %d\n", - startx, font_xoffset, text_startx, text_width, text_font_xoffset); - printf("::: => need correction == %d\n", correct_font_draw_xoffset); -#endif - /* check if setup value would overlap with setup text when printed */ /* (this can happen for extreme/wrong values for font draw offset) */ if (correct_font_draw_xoffset) @@ -3066,18 +2788,8 @@ static void drawSetupValue(int pos) } } -#if 1 for (i = 0; i <= MENU_SCREEN_MAX_XPOS - xpos; i++) DrawText(startx + i * font_width, starty, " ", font_nr); -#else -#if 1 - for (i = xpos; i <= MENU_SCREEN_MAX_XPOS; i++) - DrawText(mSX + i * 32, starty, " ", font_nr); -#else - DrawText(startx, starty, - (xpos == 3 ? " " : " "), font_nr); -#endif -#endif DrawText(startx, starty, value_string, font_nr); @@ -3158,11 +2870,7 @@ static void DrawSetupScreen_Generic() title_string = "Setup Shortcuts"; } -#if 1 DrawTextSCentered(mSY - SY + 16, FONT_TITLE_1, title_string); -#else - DrawText(mSX + 16, mSY + 16, title_string, FONT_TITLE_1); -#endif num_setup_info = 0; for (i = 0; setup_info[i].type != 0 && i < NUM_MENU_ENTRIES_ON_SCREEN; i++) @@ -3170,11 +2878,7 @@ static void DrawSetupScreen_Generic() void *value_ptr = setup_info[i].value; int xpos = MENU_SCREEN_START_XPOS; int ypos = MENU_SCREEN_START_YPOS + i; -#if 1 int font_nr; -#else - int font_nr = FONT_MENU_1; -#endif /* set some entries to "unchangeable" according to other variables */ if ((value_ptr == &setup.sound_simple && !audio.sound_available) || @@ -3184,21 +2888,7 @@ static void DrawSetupScreen_Generic() (value_ptr == &screen_mode_text && !video.fullscreen_available)) setup_info[i].type |= TYPE_GHOSTED; -#if 1 font_nr = getSetupTextFont(setup_info[i].type); -#else -#if 1 - if (setup_info[i].type & (TYPE_SWITCH | - TYPE_YES_NO | - TYPE_STRING | - TYPE_ECS_AGA | - TYPE_KEYTEXT)) - font_nr = FONT_MENU_2; -#else - if (setup_info[i].type & TYPE_STRING) - font_nr = FONT_MENU_2; -#endif -#endif DrawText(mSX + xpos * 32, mSY + ypos * 32, setup_info[i].text, font_nr); @@ -3285,7 +2975,6 @@ void HandleSetupScreen_Generic(int mx, int my, int dx, int dy, int button) y += dy; } -#if 1 if (IN_VIS_FIELD(x, y) && y >= 0 && y < num_setup_info) { if (button) @@ -3322,61 +3011,19 @@ void HandleSetupScreen_Generic(int mx, int my, int dx, int dy, int button) } } } -#else - if (IN_VIS_FIELD(x, y) && - y >= 0 && y < num_setup_info && setup_info[y].type & ~TYPE_SKIP_ENTRY) - { - if (button) - { - if (y != choice) - { - drawCursor(y, FC_RED); - drawCursor(choice, FC_BLUE); - choice = choice_store[setup_mode] = y; - } - } - else if (!(setup_info[y].type & TYPE_GHOSTED)) - { - if (setup_info[y].type & TYPE_ENTER_OR_LEAVE) - { - void (*menu_callback_function)(void) = setup_info[choice].value; - - menu_callback_function(); - } - else - { - if (setup_info[y].type & TYPE_KEYTEXT && - setup_info[y + 1].type & TYPE_KEY) - y++; - - if (setup_info[y].type & TYPE_VALUE) - changeSetupValue(y); - } - } - } -#endif } void DrawSetupScreen_Input() { ClearWindow(); -#if 1 DrawTextSCentered(mSY - SY + 16, FONT_TITLE_1, "Setup Input"); -#else - DrawText(mSX + 16, mSY + 16, "Setup Input", FONT_TITLE_1); -#endif initCursor(0, IMG_MENU_BUTTON); initCursor(1, IMG_MENU_BUTTON); initCursor(2, IMG_MENU_BUTTON_ENTER_MENU); initCursor(13, IMG_MENU_BUTTON_LEAVE_MENU); -#if 0 - drawCursorXY(10, 0, IMG_MENU_BUTTON_LEFT); - drawCursorXY(12, 0, IMG_MENU_BUTTON_RIGHT); -#endif - DrawText(mSX + 32, mSY + 2 * 32, "Player:", FONT_MENU_1); DrawText(mSX + 32, mSY + 3 * 32, "Device:", FONT_MENU_1); DrawText(mSX + 32, mSY + 15 * 32, "Back", FONT_MENU_1); @@ -3389,14 +3036,12 @@ void DrawSetupScreen_Input() "Joysticks deactivated on this screen"); #endif -#if 1 /* create gadgets for setup input menu screen */ FreeScreenGadgets(); CreateScreenGadgets(); /* map gadgets for setup input menu screen */ MapScreenMenuGadgets(SCREEN_MASK_INPUT); -#endif HandleSetupScreen_Input(0, 0, 0, 0, MB_MENU_INITIALIZE); FadeToFront(); @@ -3568,31 +3213,10 @@ void HandleSetupScreen_Input(int mx, int my, int dx, int dy, int button) y = (dy > 0 ? pos_empty2 + 1 : pos_empty1 - 1); } -#if 1 - if (y == 0 && dx != 0 && button) { HandleSetupScreen_Input_Player(1, dx < 0 ? -1 : +1); } - -#else - - if (IN_VIS_FIELD(x, y) && - y == 0 && ((x < 10 && !button) || ((x == 10 || x == 12) && button))) - { - static unsigned long delay = 0; - - if (!DelayReached(&delay, GADGET_FRAME_DELAY)) - return; - - input_player_nr = - (input_player_nr + (x == 10 ? -1 : +1) + MAX_PLAYERS) % MAX_PLAYERS; - - drawPlayerSetupInputInfo(input_player_nr); - } - -#endif - else if (IN_VIS_FIELD(x, y) && y >= pos_start && y <= pos_end && !(y >= pos_empty1 && y <= pos_empty2)) @@ -3678,11 +3302,7 @@ void CustomizeKeyboard(int player_nr) ClearWindow(); -#if 1 DrawTextSCentered(mSY - SY + 16, FONT_TITLE_1, "Keyboard Input"); -#else - DrawText(mSX + 16, mSY + 16, "Keyboard Input", FONT_TITLE_1); -#endif BackToFront(); InitAnimation(); @@ -4447,11 +4067,6 @@ static void HandleScreenGadgets(struct GadgetInfo *gi) int button = gi->event.button; int step = (button == 1 ? 1 : button == 2 ? 5 : 10); -#if 0 - if (game_status != GAME_MODE_LEVELS && game_status != GAME_MODE_SETUP) - return; -#endif - switch (id) { case SCREEN_CTRL_ID_LAST_LEVEL: diff --git a/src/screens.h b/src/screens.h index f54106e2..6f8cb1fb 100644 --- a/src/screens.h +++ b/src/screens.h @@ -1,7 +1,7 @@ /*********************************************************** * Rocks'n'Diamonds -- McDuffin Strikes Back! * *----------------------------------------------------------* -* (c) 1995-2002 Artsoft Entertainment * +* (c) 1995-2006 Artsoft Entertainment * * Holger Schemel * * Detmolder Strasse 189 * * 33604 Bielefeld * diff --git a/src/tape.c b/src/tape.c index 9387b3a5..e55be65d 100644 --- a/src/tape.c +++ b/src/tape.c @@ -833,11 +833,6 @@ void TapeStop() DrawVideoDisplay(VIDEO_STATE_DATE_ON, tape.date); DrawVideoDisplay(VIDEO_STATE_TIME_ON, tape.length_seconds); } - -#if 0 - if (tape.auto_play) - AutoPlayTape(); /* continue automatically playing next tape */ -#endif } unsigned int GetTapeLength() diff --git a/src/tape.h b/src/tape.h index 18107add..fe636495 100644 --- a/src/tape.h +++ b/src/tape.h @@ -1,7 +1,7 @@ /*********************************************************** * Rocks'n'Diamonds -- McDuffin Strikes Back! * *----------------------------------------------------------* -* (c) 1995-2002 Artsoft Entertainment * +* (c) 1995-2006 Artsoft Entertainment * * Holger Schemel * * Detmolder Strasse 189 * * 33604 Bielefeld * diff --git a/src/tools.c b/src/tools.c index c808a904..9dff9b9e 100644 --- a/src/tools.c +++ b/src/tools.c @@ -141,10 +141,8 @@ void RedrawPlayfield(boolean force_redraw, int x, int y, int width, int height) RedrawPlayfield_EM(TRUE); -#if 1 /* blit playfield from scroll buffer to normal back buffer for fading in */ BlitScreenToBitmap_EM(backbuffer); -#endif } else if (game_status == GAME_MODE_PLAYING && !game.envelope_active) { @@ -580,17 +578,6 @@ inline int getGraphicAnimationFrame(int graphic, int sync_frame) if (graphic_info[graphic].anim_global_sync || sync_frame < 0) sync_frame = FrameCounter; -#if 0 - if (graphic == element_info[EL_CUSTOM_START + 255].graphic[ACTION_DEFAULT] && - sync_frame == 0 && - FrameCounter > 10) - { - int x = 1 / 0; - - printf("::: FOO!\n"); - } -#endif - return getAnimationFrame(graphic_info[graphic].anim_frames, graphic_info[graphic].anim_delay, graphic_info[graphic].anim_mode, @@ -1070,34 +1057,20 @@ static void DrawLevelFieldCrumbledSandExt(int x, int y, int graphic, int frame) int sxx = sx + xy[i][0]; int syy = sy + xy[i][1]; -#if 1 if (!IN_LEV_FIELD(xx, yy) || !IN_SCR_FIELD(sxx, syy) || IS_MOVING(xx, yy)) continue; -#if 1 if (Feld[xx][yy] == EL_ELEMENT_SNAPPING) continue; -#endif element = TILE_GFX_ELEMENT(xx, yy); if (!GFX_CRUMBLED(element)) continue; -#else - if (!IN_LEV_FIELD(xx, yy) || - !IN_SCR_FIELD(sxx, syy) || - !GFX_CRUMBLED(Feld[xx][yy]) || - IS_MOVING(xx, yy)) - continue; -#endif -#if 1 graphic = el_act2crm(element, ACTION_DEFAULT); -#else - graphic = el_act2crm(Feld[xx][yy], ACTION_DEFAULT); -#endif crumbled_border_size = graphic_info[graphic].border_size; getGraphicSource(graphic, frame, &src_bitmap, &src_x, &src_y); @@ -1971,12 +1944,10 @@ void DrawPlayer(struct PlayerInfo *player) int last_player_frame = player->Frame; int frame = 0; -#if 1 /* GfxElement[][] is set to the element the player is digging or collecting; remove also for off-screen player if the player is not moving anymore */ if (IN_LEV_FIELD(jx, jy) && !player_is_moving) GfxElement[jx][jy] = EL_UNDEFINED; -#endif if (!player->active || !IN_SCR_FIELD(SCREENX(last_jx), SCREENY(last_jy))) return; @@ -2002,10 +1973,8 @@ void DrawPlayer(struct PlayerInfo *player) player->is_dropping ? ACTION_DROPPING : player->is_waiting ? player->action_waiting : ACTION_DEFAULT); -#if 1 if (player->is_waiting) move_dir = player->dir_waiting; -#endif InitPlayerGfxAnimation(player, action, move_dir); @@ -2729,17 +2698,8 @@ unsigned int MoveDoor(unsigned int door_state) int door_size = (handle_door_1 ? door_size_1 : door_size_2); int max_door_size = (handle_door_1 ? max_door_size_1 : max_door_size_2); int door_skip = max_door_size - door_size; -#if 1 int end = door_size; -#else - int end = (door_state & DOOR_ACTION_1 && door_1.anim_mode & ANIM_VERTICAL ? - DYSIZE : DXSIZE); -#endif -#if 1 int start = ((door_state & DOOR_NO_DELAY) ? end : 0); -#else - int start = ((door_state & DOOR_NO_DELAY) ? end : offset_skip); -#endif int k; if (!(door_state & DOOR_NO_DELAY) && !setup.quick_doors) @@ -2851,15 +2811,9 @@ unsigned int MoveDoor(unsigned int door_state) if (door_state & DOOR_ACTION_2) { -#if 1 int a = MIN(x * door_2.step_offset, door_size); int p = (door_state & DOOR_OPEN_2 ? door_size - a : a); int i = p + door_skip; -#else - int a = MIN(x * door_2.step_offset, door_size_2); - int p = (door_state & DOOR_OPEN_2 ? door_size_2 - a : a); - int i = p + door_skip; -#endif if (door_2.anim_mode & ANIM_STATIC_PANEL) { @@ -5319,37 +5273,6 @@ int font2baseimg(int font_nr) return font_info[font_nr].special_graphic[GFX_SPECIAL_ARG_DEFAULT]; } -#if 0 -void setCenteredPlayerNr_EM(int centered_player_nr) -{ - game.centered_player_nr = game.centered_player_nr_next = centered_player_nr; -} - -int getCenteredPlayerNr_EM() -{ -#if 0 - if (game.centered_player_nr_next >= 0 && - !native_em_level.ply[game.centered_player_nr_next]->alive) - game.centered_player_nr_next = game.centered_player_nr; -#endif - - if (game.centered_player_nr != game.centered_player_nr_next) - game.centered_player_nr = game.centered_player_nr_next; - - return game.centered_player_nr; -} - -void setSetCenteredPlayer_EM(boolean set_centered_player) -{ - game.set_centered_player = set_centered_player; -} - -boolean getSetCenteredPlayer_EM() -{ - return game.set_centered_player; -} -#endif - int getNumActivePlayers_EM() { int num_players = 0; @@ -5365,7 +5288,6 @@ int getNumActivePlayers_EM() return num_players; } -#if 1 int getGameFrameDelay_EM(int native_em_game_frame_delay) { int game_frame_delay_value; @@ -5380,7 +5302,6 @@ int getGameFrameDelay_EM(int native_em_game_frame_delay) return game_frame_delay_value; } -#endif unsigned int InitRND(long seed) { @@ -5785,7 +5706,6 @@ void InitGraphicInfo_EM(void) g_em->height = TILEY - cy * step; } -#if 1 /* create unique graphic identifier to decide if tile must be redrawn */ /* bit 31 - 16 (16 bit): EM style graphic bit 15 - 12 ( 4 bit): EM style frame @@ -5793,29 +5713,12 @@ void InitGraphicInfo_EM(void) bit 5 - 0 ( 6 bit): graphic height */ g_em->unique_identifier = (graphic << 16) | (frame << 12) | (g_em->width << 6) | g_em->height; -#else - /* create unique graphic identifier to decide if tile must be redrawn */ - /* bit 31 - 16 (16 bit): EM style element - bit 15 - 12 ( 4 bit): EM style frame - bit 11 - 6 ( 6 bit): graphic width - bit 5 - 0 ( 6 bit): graphic height */ - g_em->unique_identifier = - (i << 16) | (j << 12) | (g_em->width << 6) | g_em->height; -#endif - -#if 0 - if (effective_element == EL_ROCK) - printf("::: EL_ROCK(%d, %d): %d, %d => %d\n", - effective_action, j, graphic, frame, g_em->unique_identifier); -#endif #if DEBUG_EM_GFX -#if 1 /* skip check for EMC elements not contained in original EMC artwork */ if (element == EL_EMC_FAKE_ACID) continue; -#endif if (g_em->bitmap != debug_bitmap || g_em->src_x != debug_src_x || @@ -5889,13 +5792,8 @@ void InitGraphicInfo_EM(void) int action = object_mapping[i].action; int direction = object_mapping[i].direction; boolean is_backside = object_mapping[i].is_backside; -#if 1 int graphic_action = el_act_dir2img(element, action, direction); int graphic_default = el_act_dir2img(element, ACTION_DEFAULT, direction); -#else - int graphic_action = element_info[element].graphic[action]; - int graphic_default = element_info[element].graphic[ACTION_DEFAULT]; -#endif if ((action == ACTION_SMASHED_BY_ROCK || action == ACTION_SMASHED_BY_SPRING || @@ -5921,9 +5819,7 @@ void InitGraphicInfo_EM(void) g_em->dst_offset_y = g_xx->dst_offset_y; g_em->width = g_xx->width; g_em->height = g_xx->height; -#if 1 g_em->unique_identifier = g_xx->unique_identifier; -#endif if (!is_backside) g_em->preserve_background = TRUE; @@ -5979,12 +5875,10 @@ void InitGraphicInfo_EM(void) #if DEBUG_EM_GFX -#if 1 /* skip check for EMC elements not contained in original EMC artwork */ if (element == EL_PLAYER_3 || element == EL_PLAYER_4) continue; -#endif if (g_em->bitmap != debug_bitmap || g_em->src_x != debug_src_x || diff --git a/src/tools.h b/src/tools.h index 676f083d..7a29b910 100644 --- a/src/tools.h +++ b/src/tools.h @@ -1,7 +1,7 @@ /*********************************************************** * Rocks'n'Diamonds -- McDuffin Strikes Back! * *----------------------------------------------------------* -* (c) 1995-2002 Artsoft Entertainment * +* (c) 1995-2006 Artsoft Entertainment * * Holger Schemel * * Detmolder Strasse 189 * * 33604 Bielefeld * -- 2.34.1