+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
/***********************************************************
* Rocks'n'Diamonds -- McDuffin Strikes Back! *
*----------------------------------------------------------*
-* (c) 1995-2002 Artsoft Entertainment *
+* (c) 1995-2006 Artsoft Entertainment *
* Holger Schemel *
* Detmolder Strasse 189 *
* 33604 Bielefeld *
/***********************************************************
* Rocks'n'Diamonds -- McDuffin Strikes Back! *
*----------------------------------------------------------*
-* (c) 1995-2002 Artsoft Entertainment *
+* (c) 1995-2006 Artsoft Entertainment *
* Holger Schemel *
* Detmolder Strasse 189 *
* 33604 Bielefeld *
/***********************************************************
* Rocks'n'Diamonds -- McDuffin Strikes Back! *
*----------------------------------------------------------*
-* (c) 1995-2002 Artsoft Entertainment *
+* (c) 1995-2006 Artsoft Entertainment *
* Holger Schemel *
* Detmolder Strasse 189 *
* 33604 Bielefeld *
/***********************************************************
* Rocks'n'Diamonds -- McDuffin Strikes Back! *
*----------------------------------------------------------*
-* (c) 1995-2002 Artsoft Entertainment *
+* (c) 1995-2006 Artsoft Entertainment *
* Holger Schemel *
* Detmolder Strasse 189 *
* 33604 Bielefeld *
-#define COMPILE_DATE_STRING "[2006-08-19 00:14]"
+#define COMPILE_DATE_STRING "[2006-08-19 12:53]"
/***********************************************************
* Rocks'n'Diamonds -- McDuffin Strikes Back! *
*----------------------------------------------------------*
-* (c) 1995-2002 Artsoft Entertainment *
+* (c) 1995-2006 Artsoft Entertainment *
* Holger Schemel *
* Detmolder Strasse 189 *
* 33604 Bielefeld *
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,
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;
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,
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;
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,
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;
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,
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[] =
{
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[] =
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,
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,
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;
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[] =
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[] =
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[] =
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[] =
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;
{
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;
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 */
/* 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;
}
}
}
-#if 1
-
static void copy_custom_element_settings(int element_from, int element_to)
{
struct ElementInfo *ei_from = &element_info[element_from];
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)
{
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,
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;
{ 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 },
{ 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 },
{ 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 }
};
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 =
"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,
if (!started_inside_drawing_area)
return;
-#if 1
if (!IS_VALID_BUTTON(button))
return;
-#endif
if (!button && !button_release_event)
return;
{
/* 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();
}
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);
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);
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;
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)
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();
}
/***********************************************************
* Rocks'n'Diamonds -- McDuffin Strikes Back! *
*----------------------------------------------------------*
-* (c) 1995-2002 Artsoft Entertainment *
+* (c) 1995-2006 Artsoft Entertainment *
* Holger Schemel *
* Detmolder Strasse 189 *
* 33604 Bielefeld *
#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();
/***********************************************************
* Artsoft Retro-Game Library *
*----------------------------------------------------------*
-* (c) 1994-2004 Artsoft Entertainment *
+* (c) 1994-2006 Artsoft Entertainment *
* Holger Schemel *
* Detmolder Strasse 189 *
* 33604 Bielefeld *
#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;
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
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
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
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;
}
}
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);
if (AllPlayersGone && newbutton)
{
-#if 1
GameEnd();
-#else
- CloseDoor(DOOR_CLOSE_1);
- game_status = GAME_MODE_MAIN;
- DrawMainMenu();
-#endif
return;
}
/***********************************************************
* Rocks'n'Diamonds -- McDuffin Strikes Back! *
*----------------------------------------------------------*
-* (c) 1995-2002 Artsoft Entertainment *
+* (c) 1995-2006 Artsoft Entertainment *
* Holger Schemel *
* Detmolder Strasse 189 *
* 33604 Bielefeld *
}
}
-#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 */
*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 ---------- */
/* mark this custom element as modified */
ei_to->modified_settings = TRUE;
}
-#endif
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;
*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;
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++)
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;
level->envelope[envelope_nr] = xx_envelope;
}
-#if 1
if (IS_CUSTOM_ELEMENT(element) ||
IS_GROUP_ELEMENT(element) ||
IS_INTERNAL_ELEMENT(element))
*ei = xx_ei;
}
-#endif
setElementChangePages(ei, 1);
setElementChangeInfoToDefaults(ei->change);
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;
}
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;
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) ||
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
}
}
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)
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;
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);
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);
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++)
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 &&
{
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;
}
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;
{
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;
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);
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++)
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
}
}
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++)
{
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 */
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,
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);
}
/* 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 */
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)
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 !!! */
}
}
-#if 1
/* try to detect and fix "Snake Bite" levels, which are broken with 3.2.0 */
{
int element = EL_CUSTOM_START + 255;
change->target_element == EL_SOKOBAN_FIELD_PLAYER)
change->target_element = EL_PLAYER_1;
}
-#endif
}
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)
{
}
}
}
-#endif
/* initialize "can_explode" field for old levels which did not store this */
/* !!! CHECK THIS -- "<= 3,1,0,0" IS PROBABLY WRONG !!! */
{
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)
{
int element = EL_CUSTOM_START + i;
-#if 1
struct ElementInfo *ei = &element_info[element];
if (ei->properties[EP_BITFIELD_BASE_NR] != EP_BITMASK_DEFAULT)
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 */
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);
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);
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;
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;
}
/* 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];
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;
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)))
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);
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);
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 */
{
SaveLevel_ELEM(file, level);
}
-#if 1
for (i = 0; i < NUM_ENVELOPES; i++)
{
int element = EL_ENVELOPE_1 + i;
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)
{
}
}
}
-#endif
fclose(file);
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"));
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 */
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)
/***********************************************************
* Rocks'n'Diamonds -- McDuffin Strikes Back! *
*----------------------------------------------------------*
-* (c) 1995-2002 Artsoft Entertainment *
+* (c) 1995-2006 Artsoft Entertainment *
* Holger Schemel *
* Detmolder Strasse 189 *
* 33604 Bielefeld *
#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) */
#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)
#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 */
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 : \
(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) \
static void InitMagicBallDelay(int, int);
static void ActivateMagicBall(int, int);
-static void InitDiagonalMovingElement(int, int);
-
struct ChangingElementInfo
{
int element;
0,
NULL,
NULL,
- InitDiagonalMovingElement
+ NULL,
},
{
break;
default:
-#if 1
if (IS_CUSTOM_ELEMENT(element))
{
if (CAN_MOVE(element))
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)
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,
DrawGameValue_Time(time);
DrawGameValue_Keys(key);
+
+ redraw_mask |= REDRAW_DOOR_1;
}
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++)
dynamite_state += stored_player[i].inventory_size;
}
-
-#if 0
- DrawGameValue_Keys(stored_player[i].key);
-#endif
}
else
{
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
/*
=============================================================================
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++)
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;
}
{
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))
{
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
}
}
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)
break;
}
-#if 0
- printf("::: %d->%d: %d\n", action_first, action_last, num_special_action);
-#endif
-
return num_special_action;
}
+
/*
=============================================================================
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;
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;
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
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;
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;
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;
{
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,
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 :
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;
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;
{
InitGameEngine_EM();
-#if 1
/* blit playfield from scroll buffer to normal back buffer for fading in */
BlitScreenToBitmap_EM(backbuffer);
-#endif
}
else
{
BlitBitmap(fieldbuffer, backbuffer, FX, FY, SXSIZE, SYSIZE, SX, SY);
redraw_mask |= REDRAW_FROM_BACKBUFFER;
-
-#if 0
- FadeToFront();
-#endif
}
/* !!! FIX THIS (END) !!! */
DOOR_GFX_PAGEX5, DOOR_GFX_PAGEY1, DXSIZE, DYSIZE, DX, DY);
}
-#if 1
SetPanelBackground();
SetDrawBackgroundMask(REDRAW_DOOR_1);
-#endif
DrawGameDoorValues();
DrawGameValue_Time(TimeLeft);
-#if 0
- if (!tape.playing)
- Delay(10);
-#endif
-
if (TimeLeft <= 0 && !tape.playing && setup.sound_loops)
StopSound(SND_GAME_LEVELTIME_BONUS);
}
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;
/* 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;
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
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;
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 */
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;
Bang(x, y);
}
-#if 1
-
static void setMinimalPlayerBoundaries(int *sx1, int *sy1, int *sx2, int *sy2)
{
boolean num_checked_players = 0;
*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)
{
{
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 :
}
}
-#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);
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);
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++)
{
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))
#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)
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;
}
}
-#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];
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];
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];
{
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];
{
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];
{
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];
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];
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;
static void TurnRound(int x, int y)
{
int direction = MovDir[x][y];
-#if 0
- int element, graphic;
-#endif
TurnRoundExt(x, 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)
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;
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)
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;
}
#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)
{
}
#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 ||
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);
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 ||
{
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];
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 :
{
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;
}
}
}
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
}
}
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);
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;
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);
{
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
CheckElementChange(xx, yy, element, EL_UNDEFINED,
CE_SCORE_GETS_ZERO);
}
-#endif
}
}
-
#endif
break;
{
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)
{
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 +
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 */
player->dir_waiting = move_dir;
}
-#endif
if (player->is_sleeping)
{
{
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++;
/* 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);
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;
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();
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();
}
#endif
-#if 1
if (game.set_centered_player)
{
boolean all_players_fit_to_screen = checkIfAllPlayersFitToScreen_RND();
DrawRelocateScreen(sx, sy, MV_NONE, TRUE, setup.quick_switch);
DrawGameDoorValues();
}
-#endif
for (i = 0; i < MAX_PLAYERS; i++)
{
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
}
}
-#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;
#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))
(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);
if (HAS_ACTION(element))
ExecuteCustomElementAction(x, y, element, page);
-#endif
-
#endif
element = Feld[x][y];
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);
{
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];
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];
if (!player_can_move)
{
-#if 1
if (player->MovPos == 0)
{
player->is_moving = FALSE;
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
#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 ?] !!! */
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)
{
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--;
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 */
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);
}
#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;
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)
{
{
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))
{
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)
{
{
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);
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];
{
player->inventory_size--;
-#if 1
DrawGameDoorValues();
-#else
- DrawGameValue_Dynamite(local_player->inventory_size);
-#endif
if (new_element == EL_DYNAMITE)
new_element = EL_DYNAMITE_ACTIVE;
/***********************************************************
* Rocks'n'Diamonds -- McDuffin Strikes Back! *
*----------------------------------------------------------*
-* (c) 1995-2002 Artsoft Entertainment *
+* (c) 1995-2006 Artsoft Entertainment *
* Holger Schemel *
* Detmolder Strasse 189 *
* 33604 Bielefeld *
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;
return FALSE;
}
-#if 1
static void resolve_group_element(int group_element, int recursion_depth)
{
static int group_nr;
}
}
}
-#endif
void InitElementPropertiesStatic()
{
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++)
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++)
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();
{
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))
{
element_info[element].ignition_delay = 8;
}
}
-#endif
}
static void InitGlobal()
if (redraw_screen)
{
-#if 1
RedrawBackground();
-#else
- InitGfxBackground();
-#endif
/* force redraw of (open or closed) door graphics */
SetDoorState(DOOR_OPEN_ALL);
game_status = GAME_MODE_MAIN;
-#if 0
- em_open_all();
-#endif
-
-#if 0
- DrawMainMenuExt(REDRAW_ALL);
-#else
DrawMainMenu();
-#endif
InitNetworkServer();
}
/***********************************************************
* Rocks'n'Diamonds -- McDuffin Strikes Back! *
*----------------------------------------------------------*
-* (c) 1995-2002 Artsoft Entertainment *
+* (c) 1995-2006 Artsoft Entertainment *
* Holger Schemel *
* Detmolder Strasse 189 *
* 33604 Bielefeld *
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];
/***********************************************************
* Rocks'n'Diamonds -- McDuffin Strikes Back! *
*----------------------------------------------------------*
-* (c) 1995-2002 Artsoft Entertainment *
+* (c) 1995-2006 Artsoft Entertainment *
* Holger Schemel *
* Detmolder Strasse 189 *
* 33604 Bielefeld *
#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)) : \
#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]))
#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
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;
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 */
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];
/***********************************************************
* Rocks'n'Diamonds -- McDuffin Strikes Back! *
*----------------------------------------------------------*
-* (c) 1995-2002 Artsoft Entertainment *
+* (c) 1995-2006 Artsoft Entertainment *
* Holger Schemel *
* Detmolder Strasse 189 *
* 33604 Bielefeld *
}
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",
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 */
/***********************************************************
* Rocks'n'Diamonds -- McDuffin Strikes Back! *
*----------------------------------------------------------*
-* (c) 1995-2002 Artsoft Entertainment *
+* (c) 1995-2006 Artsoft Entertainment *
* Holger Schemel *
* Detmolder Strasse 189 *
* 33604 Bielefeld *
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;
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)
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);
/* 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;
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();
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();
/* 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)
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);
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;
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))
{
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;
num_info_info++;
}
-#if 1
-
HandleInfoScreen_Main(0, 0, 0, 0, MB_MENU_INITIALIZE);
PlayMenuSound();
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)
if (button_released || button == MB_MENU_INITIALIZE)
{
- Bitmap *drawto_last = drawto;
int y = 0;
if (button != MB_MENU_INITIALIZE)
FadeSoundsAndMusic();
-#if 1
if (button != MB_MENU_INITIALIZE)
FadeCrossSaveBackbuffer();
-#else
- if (button != MB_MENU_INITIALIZE)
- drawto = bitmap_db_cross;
-#endif
ClearWindow();
DrawHeadline();
DrawTextSCentered(ybottom, FONT_TEXT_4,
"Press any key or button for next page");
- drawto = drawto_last;
-
if (button != MB_MENU_INITIALIZE)
FadeCross(REDRAW_FIELD);
}
}
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)
{
{
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;
{
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;
FadeOut(REDRAW_FIELD);
-#if 0
- FadeToFront();
-#endif
InitAnimation();
PlayMenuSound();
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++)
{
if (type & TYPE_KEY)
{
-#if 1
xpos = MENU_SCREEN_START_XPOS;
-#else
- xpos = 3;
-#endif
if (type & TYPE_QUERY)
{
value_string = "<press key>";
-#if 0
- font_nr = FONT_INPUT_1_ACTIVE;
-#endif
}
}
else if (type & TYPE_STRING)
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;
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)
}
}
-#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);
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++)
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) ||
(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);
y += dy;
}
-#if 1
if (IN_VIS_FIELD(x, y) && y >= 0 && y < num_setup_info)
{
if (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);
"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();
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))
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();
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:
/***********************************************************
* Rocks'n'Diamonds -- McDuffin Strikes Back! *
*----------------------------------------------------------*
-* (c) 1995-2002 Artsoft Entertainment *
+* (c) 1995-2006 Artsoft Entertainment *
* Holger Schemel *
* Detmolder Strasse 189 *
* 33604 Bielefeld *
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()
/***********************************************************
* Rocks'n'Diamonds -- McDuffin Strikes Back! *
*----------------------------------------------------------*
-* (c) 1995-2002 Artsoft Entertainment *
+* (c) 1995-2006 Artsoft Entertainment *
* Holger Schemel *
* Detmolder Strasse 189 *
* 33604 Bielefeld *
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)
{
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,
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);
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;
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);
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)
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)
{
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;
return num_players;
}
-#if 1
int getGameFrameDelay_EM(int native_em_game_frame_delay)
{
int game_frame_delay_value;
return game_frame_delay_value;
}
-#endif
unsigned int InitRND(long seed)
{
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
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 ||
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 ||
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;
#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 ||
/***********************************************************
* Rocks'n'Diamonds -- McDuffin Strikes Back! *
*----------------------------------------------------------*
-* (c) 1995-2002 Artsoft Entertainment *
+* (c) 1995-2006 Artsoft Entertainment *
* Holger Schemel *
* Detmolder Strasse 189 *
* 33604 Bielefeld *