From: Holger Schemel Date: Sun, 27 Apr 2003 00:03:42 +0000 (+0200) Subject: rnd-20030427-1-src X-Git-Tag: 3.0.0^2~79 X-Git-Url: https://git.artsoft.org/?a=commitdiff_plain;h=d5224fde97c235c903f631a4eccb9904c2ddf9c3;p=rocksndiamonds.git rnd-20030427-1-src --- diff --git a/src/conftime.h b/src/conftime.h index c8aa1774..5ec2ce07 100644 --- a/src/conftime.h +++ b/src/conftime.h @@ -1 +1 @@ -#define COMPILE_DATE_STRING "[2003-04-26 20:44]" +#define COMPILE_DATE_STRING "[2003-04-27 01:52]" diff --git a/src/editor.c b/src/editor.c index 7e47789d..884ca0fa 100644 --- a/src/editor.c +++ b/src/editor.c @@ -3696,7 +3696,6 @@ static void DrawPropertiesInfo() { EP_CAN_SMASH, "- can smash" }, { EP_CAN_CHANGE, "- can change" }, { EP_CAN_MOVE, "- can move" }, - { EP_COULD_MOVE, "- could move" }, { EP_DONT_TOUCH, "- don't touch" }, { EP_DONT_GO_TO, "- don't go to" }, { EP_FOOD_DARK_YAMYAM, "- food for dark yamyam" }, diff --git a/src/files.c b/src/files.c index 87c4204f..41cc1271 100644 --- a/src/files.c +++ b/src/files.c @@ -1900,47 +1900,38 @@ void LoadSpecialMenuDesignSettings() { char *filename = getCustomArtworkConfigFilename(ARTWORK_TYPE_GRAPHICS); SetupFileHash *setup_file_hash; - char *value; + int i, j; - /* !!! CHANGE THIS !!! (redundant initialization) !!! */ - global.num_toons = 20; - global.menu_draw_xoffset = 0; - global.menu_draw_yoffset = 0; - global.menu_draw_xoffset_MAIN = 0; - global.menu_draw_yoffset_MAIN = 0; - global.door_step_offset = 2; - global.door_step_delay = 10; + /* always start with reliable default values from default config */ + for (i=0; image_config_vars[i].token != NULL; i++) + for (j=0; image_config[j].token != NULL; j++) + if (strcmp(image_config_vars[i].token, image_config[j].token) == 0) + *image_config_vars[i].value = + get_integer_from_string(image_config[j].value); if ((setup_file_hash = loadSetupFileHash(filename)) == NULL) return; - value = getHashEntry(setup_file_hash, "global.num_toons"); - if (value != NULL) - global.num_toons = get_integer_from_string(value); - - value = getHashEntry(setup_file_hash, "menu.draw_xoffset"); - if (value != NULL) - global.menu_draw_xoffset = get_integer_from_string(value); - - value = getHashEntry(setup_file_hash, "menu.draw_yoffset"); - if (value != NULL) - global.menu_draw_yoffset = get_integer_from_string(value); - - value = getHashEntry(setup_file_hash, "menu.draw_xoffset.MAIN"); - if (value != NULL) - global.menu_draw_xoffset_MAIN = get_integer_from_string(value); + /* special case: initialize with default values that may be overwrittem */ + for (i=0; i < NUM_SPECIAL_GFX_ARGS; i++) + { + char *value_x = getHashEntry(setup_file_hash, "menu.draw_xoffset"); + char *value_y = getHashEntry(setup_file_hash, "menu.draw_yoffset"); - value = getHashEntry(setup_file_hash, "menu.draw_yoffset.MAIN"); - if (value != NULL) - global.menu_draw_yoffset_MAIN = get_integer_from_string(value); + if (value_x != NULL) + menu.draw_xoffset[i] = get_integer_from_string(value_x); + if (value_y != NULL) + menu.draw_yoffset[i] = get_integer_from_string(value_y); + } - value = getHashEntry(setup_file_hash, "door.step_offset"); - if (value != NULL) - global.door_step_offset = get_integer_from_string(value); + /* read (and overwrite with) values that may be specified in config file */ + for (i=0; image_config_vars[i].token != NULL; i++) + { + char *value = getHashEntry(setup_file_hash, image_config_vars[i].token); - value = getHashEntry(setup_file_hash, "door.step_delay"); - if (value != NULL) - global.door_step_delay = get_integer_from_string(value); + if (value != NULL) + *image_config_vars[i].value = get_integer_from_string(value); + } freeSetupFileHash(setup_file_hash); } diff --git a/src/game.c b/src/game.c index 436751f6..d42afb32 100644 --- a/src/game.c +++ b/src/game.c @@ -1702,7 +1702,11 @@ void Explode(int ex, int ey, int phase, int mode) MovDir[x][y] = MovPos[x][y] = MovDelay[x][y] = 0; InitField(x, y, FALSE); +#if 1 + if (CAN_MOVE(element)) +#else if (CAN_MOVE(element) || COULD_MOVE(element)) +#endif InitMovDir(x, y); DrawLevelField(x, y); @@ -2804,7 +2808,7 @@ static boolean JustBeingPushed(int x, int y) void StartMoving(int x, int y) { - static boolean use_spring_bug = TRUE; + boolean use_spring_bug = (game.engine_version < VERSION_IDENT(2,2,0)); boolean started_moving = FALSE; /* some elements can fall _and_ move */ int element = Feld[x][y]; @@ -3110,14 +3114,8 @@ void StartMoving(int x, int y) int sx = SCREENX(xx), sy = SCREENY(yy); int flame_graphic = graphic + (i - 1); -#if 1 if (!IN_LEV_FIELD(xx, yy) || IS_DRAGONFIRE_PROOF(Feld[xx][yy])) break; -#else - if (!IN_LEV_FIELD(xx, yy) || - IS_HISTORIC_SOLID(Feld[xx][yy]) || Feld[xx][yy] == EL_EXPLOSION) - break; -#endif if (MovDelay[x][y]) { @@ -5711,7 +5709,6 @@ void RemoveHero(struct PlayerInfo *player) static boolean checkDiagonalPushing(struct PlayerInfo *player, int x, int y, int real_dx, int real_dy) { -#if 1 int jx, jy, dx, dy, xx, yy; if (real_dx == 0 || real_dy == 0) /* no diagonal direction => push */ @@ -5725,32 +5722,7 @@ static boolean checkDiagonalPushing(struct PlayerInfo *player, xx = jx + (dx == 0 ? real_dx : 0); yy = jy + (dy == 0 ? real_dy : 0); - return (!IN_LEV_FIELD(xx, yy) || IS_SOLID(Feld[xx][yy])); -#else - - if (real_dx && real_dy) /* diagonal direction input => do check */ - { - /* diagonal direction: check alternative direction */ - int jx = player->jx, jy = player->jy; - int dx = x - jx, dy = y - jy; - int xx = jx + (dx == 0 ? real_dx : 0); - int yy = jy + (dy == 0 ? real_dy : 0); - - if (IN_LEV_FIELD(xx, yy)) - { - int element = Feld[xx][yy]; - - if (game.engine_version < VERSION_IDENT(2,2,0)) - return IS_HISTORIC_SOLID(element); - else - return !(IS_WALKABLE(element) || - IS_DIGGABLE(element) || - IS_COLLECTIBLE(element)); - } - } - - return TRUE; /* no diagonal direction input => push object */ -#endif + return (!IN_LEV_FIELD(xx, yy) || IS_SOLID_FOR_PUSHING(Feld[xx][yy])); } /* @@ -6106,17 +6078,8 @@ int DigField(struct PlayerInfo *player, if (!IN_LEV_FIELD(x+dx, y+dy) || !IS_FREE(x+dx, y+dy)) return MF_NO_ACTION; -#if 1 if (!checkDiagonalPushing(player, x, y, real_dx, real_dy)) return MF_NO_ACTION; -#else - if (real_dy) - { - if (IN_LEV_FIELD(jx, jy+real_dy) && - !IS_HISTORIC_SOLID(Feld[jx][jy+real_dy])) - return MF_NO_ACTION; - } -#endif if (player->push_delay == 0) player->push_delay = FrameCounter; @@ -6358,23 +6321,8 @@ int DigField(struct PlayerInfo *player, || !IS_SB_ELEMENT(element)))) return MF_NO_ACTION; -#if 1 if (!checkDiagonalPushing(player, x, y, real_dx, real_dy)) return MF_NO_ACTION; -#else - if (dx && real_dy) - { - if (IN_LEV_FIELD(jx, jy+real_dy) && - !IS_HISTORIC_SOLID(Feld[jx][jy+real_dy])) - return MF_NO_ACTION; - } - else if (dy && real_dx) - { - if (IN_LEV_FIELD(jx+real_dx, jy) && - !IS_HISTORIC_SOLID(Feld[jx+real_dx][jy])) - return MF_NO_ACTION; - } -#endif if (player->push_delay == 0) player->push_delay = FrameCounter; @@ -6474,23 +6422,8 @@ int DigField(struct PlayerInfo *player, if (!IN_LEV_FIELD(x+dx, y+dy) || !IS_FREE(x+dx, y+dy)) return MF_NO_ACTION; -#if 1 if (!checkDiagonalPushing(player, x, y, real_dx, real_dy)) return MF_NO_ACTION; -#else - if (dx && real_dy) - { - if (IN_LEV_FIELD(jx, jy+real_dy) && - !IS_HISTORIC_SOLID(Feld[jx][jy+real_dy])) - return MF_NO_ACTION; - } - else if (dy && real_dx) - { - if (IN_LEV_FIELD(jx+real_dx, jy) && - !IS_HISTORIC_SOLID(Feld[jx+real_dx][jy])) - return MF_NO_ACTION; - } -#endif if (player->push_delay == 0) player->push_delay = FrameCounter; diff --git a/src/init.c b/src/init.c index d327a93d..9a68e2ad 100644 --- a/src/init.c +++ b/src/init.c @@ -1070,207 +1070,53 @@ static void ReinitializeMusic() void InitElementPropertiesStatic() { - static int ep_amoebalive[] = - { - EL_AMOEBA_WET, - EL_AMOEBA_DRY, - EL_AMOEBA_FULL, - EL_BD_AMOEBA, - -1 - }; - - static int ep_amoeboid[] = - { - EL_AMOEBA_DEAD, - EL_AMOEBA_WET, - EL_AMOEBA_DRY, - EL_AMOEBA_FULL, - EL_BD_AMOEBA, - -1 - }; - - static int ep_keygate[] = - { - 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_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, - -1 - }; - - static int ep_can_be_crumbled[] = + static int ep_diggable[] = { EL_SAND, - EL_LANDMINE, + EL_SP_BASE, + EL_SP_BUGGY_BASE, + EL_SP_BUGGY_BASE_ACTIVATING, EL_TRAP, + EL_INVISIBLE_SAND, + EL_INVISIBLE_SAND_ACTIVE, +#if 1 + EL_LANDMINE, EL_TRAP_ACTIVE, + EL_SP_BUGGY_BASE_ACTIVE, +#endif -1 }; - static int ep_historic_solid[] = + static int ep_collectible[] = { - EL_WALL, - EL_EXPANDABLE_WALL, - EL_EXPANDABLE_WALL_HORIZONTAL, - EL_EXPANDABLE_WALL_VERTICAL, - EL_EXPANDABLE_WALL_ANY, - EL_BD_WALL, - EL_WALL_CRUMBLED, - EL_EXIT_CLOSED, - EL_EXIT_OPENING, - EL_EXIT_OPEN, - EL_AMOEBA_DEAD, - EL_AMOEBA_WET, - EL_AMOEBA_DRY, - EL_AMOEBA_FULL, - EL_BD_AMOEBA, - EL_QUICKSAND_EMPTY, - EL_QUICKSAND_FULL, - EL_QUICKSAND_FILLING, - EL_QUICKSAND_EMPTYING, - EL_MAGIC_WALL, - EL_MAGIC_WALL_ACTIVE, - EL_MAGIC_WALL_EMPTYING, - EL_MAGIC_WALL_FILLING, - EL_MAGIC_WALL_FULL, - EL_MAGIC_WALL_DEAD, - EL_BD_MAGIC_WALL, - EL_BD_MAGIC_WALL_ACTIVE, - EL_BD_MAGIC_WALL_EMPTYING, - EL_BD_MAGIC_WALL_FULL, - EL_BD_MAGIC_WALL_FILLING, - EL_BD_MAGIC_WALL_DEAD, - EL_GAME_OF_LIFE, - EL_BIOMAZE, - EL_SP_CHIP_SINGLE, - EL_SP_CHIP_LEFT, - EL_SP_CHIP_RIGHT, - EL_SP_CHIP_TOP, - EL_SP_CHIP_BOTTOM, - EL_SP_TERMINAL, - EL_SP_TERMINAL_ACTIVE, - EL_SP_EXIT_CLOSED, - EL_SP_EXIT_OPEN, - EL_INVISIBLE_WALL, - EL_INVISIBLE_WALL_ACTIVE, - EL_SWITCHGATE_SWITCH_UP, - EL_SWITCHGATE_SWITCH_DOWN, - EL_TIMEGATE_SWITCH, - EL_TIMEGATE_SWITCH_ACTIVE, - 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_WALL_PEARL, - EL_WALL_CRYSTAL, - - /* the following elements are a direct copy of "indestructible" elements, - except "EL_ACID", which is "indestructible", but not "solid"! */ -#if 0 - EL_ACID, -#endif - EL_STEELWALL, - EL_ACID_POOL_TOPLEFT, - EL_ACID_POOL_TOPRIGHT, - EL_ACID_POOL_BOTTOMLEFT, - EL_ACID_POOL_BOTTOM, - EL_ACID_POOL_BOTTOMRIGHT, - EL_SP_HARDWARE_GRAY, - EL_SP_HARDWARE_GREEN, - EL_SP_HARDWARE_BLUE, - EL_SP_HARDWARE_RED, - EL_SP_HARDWARE_YELLOW, - EL_SP_HARDWARE_BASE_1, - 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_INVISIBLE_STEELWALL, - EL_INVISIBLE_STEELWALL_ACTIVE, - EL_CONVEYOR_BELT_1_SWITCH_LEFT, - EL_CONVEYOR_BELT_1_SWITCH_MIDDLE, - EL_CONVEYOR_BELT_1_SWITCH_RIGHT, - EL_CONVEYOR_BELT_2_SWITCH_LEFT, - EL_CONVEYOR_BELT_2_SWITCH_MIDDLE, - EL_CONVEYOR_BELT_2_SWITCH_RIGHT, - EL_CONVEYOR_BELT_3_SWITCH_LEFT, - EL_CONVEYOR_BELT_3_SWITCH_MIDDLE, - EL_CONVEYOR_BELT_3_SWITCH_RIGHT, - EL_CONVEYOR_BELT_4_SWITCH_LEFT, - EL_CONVEYOR_BELT_4_SWITCH_MIDDLE, - EL_CONVEYOR_BELT_4_SWITCH_RIGHT, - EL_LIGHT_SWITCH, - EL_LIGHT_SWITCH_ACTIVE, - EL_SIGN_EXCLAMATION, - EL_SIGN_RADIOACTIVITY, - EL_SIGN_STOP, - EL_SIGN_WHEELCHAIR, - EL_SIGN_PARKING, - EL_SIGN_ONEWAY, - EL_SIGN_HEART, - EL_SIGN_TRIANGLE, - EL_SIGN_ROUND, - EL_SIGN_EXIT, - EL_SIGN_YINYANG, - EL_SIGN_OTHER, - EL_STEELWALL_SLANTED, - EL_EMC_STEELWALL_1, - EL_EMC_STEELWALL_2, - EL_EMC_STEELWALL_3, - EL_EMC_STEELWALL_4, + EL_BD_DIAMOND, + EL_EMERALD, + EL_DIAMOND, + EL_EMERALD_YELLOW, + EL_EMERALD_RED, + EL_EMERALD_PURPLE, + EL_KEY_1, + EL_KEY_2, + EL_KEY_3, + EL_KEY_4, + EL_EM_KEY_1, + EL_EM_KEY_2, + EL_EM_KEY_3, + EL_EM_KEY_4, + EL_DYNAMITE, + EL_DYNABOMB_INCREASE_NUMBER, + EL_DYNABOMB_INCREASE_SIZE, + EL_DYNABOMB_INCREASE_POWER, + EL_SP_INFOTRON, + EL_SP_DISK_RED, + EL_PEARL, EL_CRYSTAL, - 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_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, - EL_SWITCHGATE_OPEN, - EL_SWITCHGATE_OPENING, - EL_SWITCHGATE_CLOSED, - EL_SWITCHGATE_CLOSING, - EL_TIMEGATE_OPEN, - EL_TIMEGATE_OPENING, - EL_TIMEGATE_CLOSED, - EL_TIMEGATE_CLOSING, - EL_TUBE_ANY, - EL_TUBE_VERTICAL, - EL_TUBE_HORIZONTAL, - EL_TUBE_VERTICAL_LEFT, - EL_TUBE_VERTICAL_RIGHT, - EL_TUBE_HORIZONTAL_UP, - EL_TUBE_HORIZONTAL_DOWN, - EL_TUBE_LEFT_UP, - EL_TUBE_LEFT_DOWN, - EL_TUBE_RIGHT_UP, - EL_TUBE_RIGHT_DOWN, + EL_KEY_WHITE, + EL_SHIELD_NORMAL, + EL_SHIELD_DEADLY, + EL_EXTRA_TIME, + EL_ENVELOPE, + EL_SPEED_PILL, -1 }; @@ -1403,92 +1249,7 @@ void InitElementPropertiesStatic() -1 }; - static int ep_enemy[] = - { - EL_BUG, - EL_SPACESHIP, - EL_BD_BUTTERFLY, - EL_BD_FIREFLY, - EL_YAMYAM, - EL_DARK_YAMYAM, - EL_ROBOT, - EL_PACMAN, - EL_SP_SNIKSNAK, - EL_SP_ELECTRON, - -1 - }; - - static int ep_historic_wall[] = - { - EL_STEELWALL, - 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_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, - EL_EXIT_CLOSED, - EL_EXIT_OPENING, - EL_EXIT_OPEN, - EL_WALL, - EL_WALL_CRUMBLED, - EL_EXPANDABLE_WALL, - EL_EXPANDABLE_WALL_HORIZONTAL, - EL_EXPANDABLE_WALL_VERTICAL, - EL_EXPANDABLE_WALL_ANY, - EL_EXPANDABLE_WALL_GROWING, - EL_BD_WALL, - EL_SP_CHIP_SINGLE, - EL_SP_CHIP_LEFT, - EL_SP_CHIP_RIGHT, - EL_SP_CHIP_TOP, - EL_SP_CHIP_BOTTOM, - EL_SP_HARDWARE_GRAY, - EL_SP_HARDWARE_GREEN, - EL_SP_HARDWARE_BLUE, - EL_SP_HARDWARE_RED, - EL_SP_HARDWARE_YELLOW, - EL_SP_HARDWARE_BASE_1, - 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_TERMINAL, - EL_SP_TERMINAL_ACTIVE, - EL_SP_EXIT_CLOSED, - EL_SP_EXIT_OPEN, - EL_INVISIBLE_STEELWALL, - EL_INVISIBLE_STEELWALL_ACTIVE, - EL_INVISIBLE_WALL, - EL_INVISIBLE_WALL_ACTIVE, - EL_STEELWALL_SLANTED, - EL_EMC_STEELWALL_1, - EL_EMC_STEELWALL_2, - EL_EMC_STEELWALL_3, - EL_EMC_STEELWALL_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, - -1 - }; - - static int ep_can_fall[] = + static int ep_can_fall[] = { EL_ROCK, EL_BD_ROCK, @@ -1541,43 +1302,121 @@ void InitElementPropertiesStatic() -1 }; - static int ep_can_change[] = + static int ep_walkable_over[] = { - EL_ROCK, - EL_BD_ROCK, - EL_EMERALD, - EL_BD_DIAMOND, - EL_EMERALD_YELLOW, - EL_EMERALD_RED, - EL_EMERALD_PURPLE, - EL_DIAMOND, + EL_EMPTY_SPACE, + EL_SP_EMPTY_SPACE, + EL_SOKOBAN_FIELD_EMPTY, + EL_EXIT_OPEN, + EL_SP_EXIT_OPEN, + 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, -1 }; - static int ep_can_move[] = + static int ep_walkable_inside[] = { - EL_BUG, - EL_SPACESHIP, - EL_BD_BUTTERFLY, - EL_BD_FIREFLY, - EL_YAMYAM, - EL_DARK_YAMYAM, - EL_ROBOT, - EL_PACMAN, - EL_MOLE, - EL_PENGUIN, - EL_PIG, - EL_DRAGON, + EL_TUBE_ANY, + EL_TUBE_VERTICAL, + EL_TUBE_HORIZONTAL, + EL_TUBE_VERTICAL_LEFT, + EL_TUBE_VERTICAL_RIGHT, + EL_TUBE_HORIZONTAL_UP, + EL_TUBE_HORIZONTAL_DOWN, + EL_TUBE_LEFT_UP, + EL_TUBE_LEFT_DOWN, + EL_TUBE_RIGHT_UP, + EL_TUBE_RIGHT_DOWN, + -1 + }; + + static int ep_walkable_under[] = + { + -1 + }; + + static int ep_passable_over[] = + { + 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, + EL_SWITCHGATE_OPEN, + EL_TIMEGATE_OPEN, + -1 + }; + + static int ep_passable_inside[] = + { + EL_SP_PORT_LEFT, + EL_SP_PORT_RIGHT, + EL_SP_PORT_UP, + EL_SP_PORT_DOWN, + EL_SP_PORT_HORIZONTAL, + EL_SP_PORT_VERTICAL, + EL_SP_PORT_ANY, + EL_SP_GRAVITY_PORT_LEFT, + EL_SP_GRAVITY_PORT_RIGHT, + EL_SP_GRAVITY_PORT_UP, + EL_SP_GRAVITY_PORT_DOWN, + -1 + }; + + static int ep_passable_under[] = + { + -1 + }; + + static int ep_pushable[] = + { + EL_ROCK, + EL_BD_ROCK, + EL_BOMB, + EL_NUT, + EL_TIME_ORB_EMPTY, + EL_SOKOBAN_FIELD_FULL, + EL_SOKOBAN_OBJECT, EL_SATELLITE, - EL_SP_SNIKSNAK, - EL_SP_ELECTRON, + EL_SP_ZONK, + EL_SP_DISK_ORANGE, + EL_SP_DISK_YELLOW, EL_BALLOON, EL_SPRING, + EL_DX_SUPABOMB, + -1 + }; + + static int ep_player[] = + { + EL_PLAYER_1, + EL_PLAYER_2, + EL_PLAYER_3, + EL_PLAYER_4, + -1 + }; + + static int ep_can_be_crumbled[] = + { + EL_SAND, + EL_LANDMINE, + EL_TRAP, + EL_TRAP_ACTIVE, -1 }; - static int ep_could_move[] = + static int ep_can_move[] = { + /* only stored in level file */ EL_BUG_RIGHT, EL_BUG_UP, EL_BUG_LEFT, @@ -1598,6 +1437,38 @@ void InitElementPropertiesStatic() EL_PACMAN_UP, EL_PACMAN_LEFT, EL_PACMAN_DOWN, + + /* level file and runtime elements */ + EL_BUG, + EL_SPACESHIP, + EL_BD_BUTTERFLY, + EL_BD_FIREFLY, + EL_YAMYAM, + EL_DARK_YAMYAM, + EL_ROBOT, + EL_PACMAN, + EL_MOLE, + EL_PENGUIN, + EL_PIG, + EL_DRAGON, + EL_SATELLITE, + EL_SP_SNIKSNAK, + EL_SP_ELECTRON, + EL_BALLOON, + EL_SPRING, + -1 + }; + + static int ep_can_change[] = + { + EL_ROCK, + EL_BD_ROCK, + EL_EMERALD, + EL_BD_DIAMOND, + EL_EMERALD_YELLOW, + EL_EMERALD_RED, + EL_EMERALD_PURPLE, + EL_DIAMOND, -1 }; @@ -1610,7 +1481,7 @@ void InitElementPropertiesStatic() -1 }; - static int ep_dont_go_to[] = + static int ep_enemy[] = { EL_BUG, EL_SPACESHIP, @@ -1620,51 +1491,67 @@ void InitElementPropertiesStatic() EL_DARK_YAMYAM, EL_ROBOT, EL_PACMAN, - EL_AMOEBA_DROP, - EL_ACID, EL_SP_SNIKSNAK, EL_SP_ELECTRON, - EL_SP_BUGGY_BASE_ACTIVE, - EL_TRAP_ACTIVE, - EL_LANDMINE, -1 }; - static int ep_food_dark_yamyam[] = + static int ep_dont_go_to[] = { - EL_SAND, EL_BUG, EL_SPACESHIP, EL_BD_BUTTERFLY, EL_BD_FIREFLY, EL_YAMYAM, + EL_DARK_YAMYAM, EL_ROBOT, EL_PACMAN, EL_AMOEBA_DROP, - EL_AMOEBA_DEAD, - EL_AMOEBA_WET, - EL_AMOEBA_DRY, - EL_AMOEBA_FULL, - EL_BD_AMOEBA, - EL_EMERALD, - EL_BD_DIAMOND, - EL_EMERALD_YELLOW, - EL_EMERALD_RED, - EL_EMERALD_PURPLE, - EL_DIAMOND, - EL_PEARL, - EL_CRYSTAL, + EL_ACID, + EL_SP_SNIKSNAK, + EL_SP_ELECTRON, + EL_SP_BUGGY_BASE_ACTIVE, + EL_TRAP_ACTIVE, + EL_LANDMINE, -1 }; - static int ep_bd_element[] = + static int ep_explosive[] = { - EL_EMPTY, - EL_SAND, - EL_WALL_CRUMBLED, - EL_BD_WALL, - EL_ROCK, - EL_BD_ROCK, + EL_BOMB, + EL_DYNAMITE_ACTIVE, + EL_DYNAMITE, + EL_DYNABOMB_PLAYER_1_ACTIVE, + EL_DYNABOMB_PLAYER_2_ACTIVE, + EL_DYNABOMB_PLAYER_3_ACTIVE, + EL_DYNABOMB_PLAYER_4_ACTIVE, + EL_DYNABOMB_INCREASE_NUMBER, + EL_DYNABOMB_INCREASE_SIZE, + EL_DYNABOMB_INCREASE_POWER, + EL_SP_DISK_RED_ACTIVE, + EL_BUG, + EL_MOLE, + EL_PENGUIN, + EL_PIG, + EL_DRAGON, + EL_SATELLITE, + EL_SP_DISK_RED, + EL_SP_DISK_ORANGE, + EL_SP_DISK_YELLOW, + EL_SP_SNIKSNAK, + EL_SP_ELECTRON, + EL_DX_SUPABOMB, + -1 + }; + + static int ep_bd_element[] = + { + EL_EMPTY, + EL_SAND, + EL_WALL_CRUMBLED, + EL_BD_WALL, + EL_ROCK, + EL_BD_ROCK, EL_BD_DIAMOND, EL_BD_MAGIC_WALL, EL_EXIT_CLOSED, @@ -1686,6 +1573,56 @@ void InitElementPropertiesStatic() -1 }; + static int ep_sp_element[] = + { + EL_SP_EMPTY, + 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_EXIT_OPEN, + 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, + /* additional elements that appeared in newer Supaplex levels */ + EL_INVISIBLE_WALL, + /* more than one murphy in a level results in an inactive clone */ + EL_SP_MURPHY_CLONE, + -1 + }; + static int ep_sb_element[] = { EL_EMPTY, @@ -1709,26 +1646,49 @@ void InitElementPropertiesStatic() -1 }; - static int ep_inactive[] = + static int ep_food_dark_yamyam[] = { - EL_EMPTY, EL_SAND, - EL_WALL, - EL_BD_WALL, - EL_WALL_CRUMBLED, - EL_STEELWALL, + EL_BUG, + EL_SPACESHIP, + EL_BD_BUTTERFLY, + EL_BD_FIREFLY, + EL_YAMYAM, + EL_ROBOT, + EL_PACMAN, + EL_AMOEBA_DROP, EL_AMOEBA_DEAD, - EL_QUICKSAND_EMPTY, - EL_STONEBLOCK, - EL_ROBOT_WHEEL, - EL_KEY_1, - EL_KEY_2, - EL_KEY_3, - EL_KEY_4, - EL_EM_KEY_1, - EL_EM_KEY_2, - EL_EM_KEY_3, - EL_EM_KEY_4, + EL_AMOEBA_WET, + EL_AMOEBA_DRY, + EL_AMOEBA_FULL, + EL_BD_AMOEBA, + EL_EMERALD, + EL_BD_DIAMOND, + EL_EMERALD_YELLOW, + EL_EMERALD_RED, + EL_EMERALD_PURPLE, + EL_DIAMOND, + EL_PEARL, + EL_CRYSTAL, + -1 + }; + + static int ep_food_penguin[] = + { + EL_EMERALD, + EL_BD_DIAMOND, + EL_EMERALD_YELLOW, + EL_EMERALD_RED, + EL_EMERALD_PURPLE, + EL_DIAMOND, + EL_PEARL, + EL_CRYSTAL, + -1 + }; + + static int ep_historic_wall[] = + { + EL_STEELWALL, EL_GATE_1, EL_GATE_2, EL_GATE_3, @@ -1745,50 +1705,17 @@ void InitElementPropertiesStatic() EL_EM_GATE_2_GRAY, EL_EM_GATE_3_GRAY, EL_EM_GATE_4_GRAY, - EL_DYNAMITE, - EL_INVISIBLE_STEELWALL, - EL_INVISIBLE_WALL, - EL_INVISIBLE_SAND, - EL_LAMP, - EL_LAMP_ACTIVE, - EL_WALL_EMERALD, - EL_WALL_DIAMOND, - EL_WALL_BD_DIAMOND, - EL_WALL_EMERALD_YELLOW, - EL_DYNABOMB_INCREASE_NUMBER, - EL_DYNABOMB_INCREASE_SIZE, - EL_DYNABOMB_INCREASE_POWER, - EL_SOKOBAN_OBJECT, - EL_SOKOBAN_FIELD_EMPTY, - EL_SOKOBAN_FIELD_FULL, - EL_WALL_EMERALD_RED, - EL_WALL_EMERALD_PURPLE, - EL_ACID_POOL_TOPLEFT, - EL_ACID_POOL_TOPRIGHT, - EL_ACID_POOL_BOTTOMLEFT, - EL_ACID_POOL_BOTTOM, - EL_ACID_POOL_BOTTOMRIGHT, - EL_MAGIC_WALL, - EL_MAGIC_WALL_DEAD, - EL_BD_MAGIC_WALL, - EL_BD_MAGIC_WALL_DEAD, - EL_AMOEBA_TO_DIAMOND, - EL_BLOCKED, - EL_SP_EMPTY, - EL_SP_BASE, - 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_PORT_HORIZONTAL, - EL_SP_PORT_VERTICAL, - EL_SP_PORT_ANY, - EL_SP_DISK_RED, - EL_SP_DISK_YELLOW, + EL_EXIT_CLOSED, + EL_EXIT_OPENING, + EL_EXIT_OPEN, + EL_WALL, + EL_WALL_CRUMBLED, + EL_EXPANDABLE_WALL, + EL_EXPANDABLE_WALL_HORIZONTAL, + EL_EXPANDABLE_WALL_VERTICAL, + EL_EXPANDABLE_WALL_ANY, + EL_EXPANDABLE_WALL_GROWING, + EL_BD_WALL, EL_SP_CHIP_SINGLE, EL_SP_CHIP_LEFT, EL_SP_CHIP_RIGHT, @@ -1805,30 +1732,14 @@ void InitElementPropertiesStatic() EL_SP_HARDWARE_BASE_4, EL_SP_HARDWARE_BASE_5, EL_SP_HARDWARE_BASE_6, - EL_CONVEYOR_BELT_1_SWITCH_LEFT, - EL_CONVEYOR_BELT_1_SWITCH_MIDDLE, - EL_CONVEYOR_BELT_1_SWITCH_RIGHT, - EL_CONVEYOR_BELT_2_SWITCH_LEFT, - EL_CONVEYOR_BELT_2_SWITCH_MIDDLE, - EL_CONVEYOR_BELT_2_SWITCH_RIGHT, - EL_CONVEYOR_BELT_3_SWITCH_LEFT, - EL_CONVEYOR_BELT_3_SWITCH_MIDDLE, - EL_CONVEYOR_BELT_3_SWITCH_RIGHT, - EL_CONVEYOR_BELT_4_SWITCH_LEFT, - EL_CONVEYOR_BELT_4_SWITCH_MIDDLE, - EL_CONVEYOR_BELT_4_SWITCH_RIGHT, - EL_SIGN_EXCLAMATION, - EL_SIGN_RADIOACTIVITY, - EL_SIGN_STOP, - EL_SIGN_WHEELCHAIR, - EL_SIGN_PARKING, - EL_SIGN_ONEWAY, - EL_SIGN_HEART, - EL_SIGN_TRIANGLE, - EL_SIGN_ROUND, - EL_SIGN_EXIT, - EL_SIGN_YINYANG, - EL_SIGN_OTHER, + EL_SP_TERMINAL, + EL_SP_TERMINAL_ACTIVE, + EL_SP_EXIT_CLOSED, + EL_SP_EXIT_OPEN, + EL_INVISIBLE_STEELWALL, + EL_INVISIBLE_STEELWALL_ACTIVE, + EL_INVISIBLE_WALL, + EL_INVISIBLE_WALL_ACTIVE, EL_STEELWALL_SLANTED, EL_EMC_STEELWALL_1, EL_EMC_STEELWALL_2, @@ -1845,82 +1756,123 @@ void InitElementPropertiesStatic() -1 }; - static int ep_explosive[] = + static int ep_historic_solid[] = { - EL_BOMB, - EL_DYNAMITE_ACTIVE, - EL_DYNAMITE, - EL_DYNABOMB_PLAYER_1_ACTIVE, - EL_DYNABOMB_PLAYER_2_ACTIVE, - EL_DYNABOMB_PLAYER_3_ACTIVE, - EL_DYNABOMB_PLAYER_4_ACTIVE, - EL_DYNABOMB_INCREASE_NUMBER, - EL_DYNABOMB_INCREASE_SIZE, - EL_DYNABOMB_INCREASE_POWER, - EL_SP_DISK_RED_ACTIVE, - EL_BUG, - EL_MOLE, - EL_PENGUIN, - EL_PIG, - EL_DRAGON, - EL_SATELLITE, - EL_SP_DISK_RED, - EL_SP_DISK_ORANGE, - EL_SP_DISK_YELLOW, - EL_SP_SNIKSNAK, - EL_SP_ELECTRON, - EL_DX_SUPABOMB, - -1 - }; - - static int ep_food_penguin[] = - { - EL_EMERALD, - EL_BD_DIAMOND, - EL_EMERALD_YELLOW, - EL_EMERALD_RED, - EL_EMERALD_PURPLE, - EL_DIAMOND, - EL_PEARL, - EL_CRYSTAL, - -1 - }; - - static int ep_pushable[] = - { - EL_ROCK, - EL_BD_ROCK, - EL_BOMB, - EL_NUT, - EL_TIME_ORB_EMPTY, - EL_SOKOBAN_FIELD_FULL, - EL_SOKOBAN_OBJECT, - EL_SATELLITE, - EL_SP_ZONK, - EL_SP_DISK_ORANGE, - EL_SP_DISK_YELLOW, - EL_BALLOON, - EL_SPRING, - EL_DX_SUPABOMB, - -1 - }; - - static int ep_player[] = - { - EL_PLAYER_1, - EL_PLAYER_2, - EL_PLAYER_3, - EL_PLAYER_4, - -1 - }; - - static int ep_walkable_over[] = - { - EL_EMPTY_SPACE, - EL_SP_EMPTY_SPACE, - EL_SOKOBAN_FIELD_EMPTY, + EL_WALL, + EL_EXPANDABLE_WALL, + EL_EXPANDABLE_WALL_HORIZONTAL, + EL_EXPANDABLE_WALL_VERTICAL, + EL_EXPANDABLE_WALL_ANY, + EL_BD_WALL, + EL_WALL_CRUMBLED, + EL_EXIT_CLOSED, + EL_EXIT_OPENING, EL_EXIT_OPEN, + EL_AMOEBA_DEAD, + EL_AMOEBA_WET, + EL_AMOEBA_DRY, + EL_AMOEBA_FULL, + EL_BD_AMOEBA, + EL_QUICKSAND_EMPTY, + EL_QUICKSAND_FULL, + EL_QUICKSAND_FILLING, + EL_QUICKSAND_EMPTYING, + EL_MAGIC_WALL, + EL_MAGIC_WALL_ACTIVE, + EL_MAGIC_WALL_EMPTYING, + EL_MAGIC_WALL_FILLING, + EL_MAGIC_WALL_FULL, + EL_MAGIC_WALL_DEAD, + EL_BD_MAGIC_WALL, + EL_BD_MAGIC_WALL_ACTIVE, + EL_BD_MAGIC_WALL_EMPTYING, + EL_BD_MAGIC_WALL_FULL, + EL_BD_MAGIC_WALL_FILLING, + EL_BD_MAGIC_WALL_DEAD, + EL_GAME_OF_LIFE, + EL_BIOMAZE, + EL_SP_CHIP_SINGLE, + EL_SP_CHIP_LEFT, + EL_SP_CHIP_RIGHT, + EL_SP_CHIP_TOP, + EL_SP_CHIP_BOTTOM, + EL_SP_TERMINAL, + EL_SP_TERMINAL_ACTIVE, + EL_SP_EXIT_CLOSED, EL_SP_EXIT_OPEN, + EL_INVISIBLE_WALL, + EL_INVISIBLE_WALL_ACTIVE, + EL_SWITCHGATE_SWITCH_UP, + EL_SWITCHGATE_SWITCH_DOWN, + EL_TIMEGATE_SWITCH, + EL_TIMEGATE_SWITCH_ACTIVE, + 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_WALL_PEARL, + EL_WALL_CRYSTAL, + + /* the following elements are a direct copy of "indestructible" elements, + except "EL_ACID", which is "indestructible", but not "solid"! */ +#if 0 + EL_ACID, +#endif + EL_STEELWALL, + EL_ACID_POOL_TOPLEFT, + EL_ACID_POOL_TOPRIGHT, + EL_ACID_POOL_BOTTOMLEFT, + EL_ACID_POOL_BOTTOM, + EL_ACID_POOL_BOTTOMRIGHT, + EL_SP_HARDWARE_GRAY, + EL_SP_HARDWARE_GREEN, + EL_SP_HARDWARE_BLUE, + EL_SP_HARDWARE_RED, + EL_SP_HARDWARE_YELLOW, + EL_SP_HARDWARE_BASE_1, + 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_INVISIBLE_STEELWALL, + EL_INVISIBLE_STEELWALL_ACTIVE, + EL_CONVEYOR_BELT_1_SWITCH_LEFT, + EL_CONVEYOR_BELT_1_SWITCH_MIDDLE, + EL_CONVEYOR_BELT_1_SWITCH_RIGHT, + EL_CONVEYOR_BELT_2_SWITCH_LEFT, + EL_CONVEYOR_BELT_2_SWITCH_MIDDLE, + EL_CONVEYOR_BELT_2_SWITCH_RIGHT, + EL_CONVEYOR_BELT_3_SWITCH_LEFT, + EL_CONVEYOR_BELT_3_SWITCH_MIDDLE, + EL_CONVEYOR_BELT_3_SWITCH_RIGHT, + EL_CONVEYOR_BELT_4_SWITCH_LEFT, + EL_CONVEYOR_BELT_4_SWITCH_MIDDLE, + EL_CONVEYOR_BELT_4_SWITCH_RIGHT, + EL_LIGHT_SWITCH, + EL_LIGHT_SWITCH_ACTIVE, + EL_SIGN_EXCLAMATION, + EL_SIGN_RADIOACTIVITY, + EL_SIGN_STOP, + EL_SIGN_WHEELCHAIR, + EL_SIGN_PARKING, + EL_SIGN_ONEWAY, + EL_SIGN_HEART, + EL_SIGN_TRIANGLE, + EL_SIGN_ROUND, + EL_SIGN_EXIT, + EL_SIGN_YINYANG, + EL_SIGN_OTHER, + EL_STEELWALL_SLANTED, + EL_EMC_STEELWALL_1, + EL_EMC_STEELWALL_2, + EL_EMC_STEELWALL_3, + EL_EMC_STEELWALL_4, + EL_CRYSTAL, EL_GATE_1, EL_GATE_2, EL_GATE_3, @@ -1929,11 +1881,22 @@ void InitElementPropertiesStatic() EL_GATE_2_GRAY, EL_GATE_3_GRAY, EL_GATE_4_GRAY, - -1 - }; - - static int ep_walkable_inside[] = - { + 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, + EL_SWITCHGATE_OPEN, + EL_SWITCHGATE_OPENING, + EL_SWITCHGATE_CLOSED, + EL_SWITCHGATE_CLOSING, + EL_TIMEGATE_OPEN, + EL_TIMEGATE_OPENING, + EL_TIMEGATE_CLOSED, + EL_TIMEGATE_CLOSING, EL_TUBE_ANY, EL_TUBE_VERTICAL, EL_TUBE_HORIZONTAL, @@ -1948,171 +1911,201 @@ void InitElementPropertiesStatic() -1 }; - static int ep_walkable_under[] = - { - -1 - }; - - static int ep_passable_over[] = + static int ep_belt[] = { - 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, - EL_SWITCHGATE_OPEN, - EL_TIMEGATE_OPEN, + EL_CONVEYOR_BELT_1_LEFT, + EL_CONVEYOR_BELT_1_MIDDLE, + EL_CONVEYOR_BELT_1_RIGHT, + EL_CONVEYOR_BELT_2_LEFT, + EL_CONVEYOR_BELT_2_MIDDLE, + EL_CONVEYOR_BELT_2_RIGHT, + EL_CONVEYOR_BELT_3_LEFT, + EL_CONVEYOR_BELT_3_MIDDLE, + EL_CONVEYOR_BELT_3_RIGHT, + EL_CONVEYOR_BELT_4_LEFT, + EL_CONVEYOR_BELT_4_MIDDLE, + EL_CONVEYOR_BELT_4_RIGHT, -1 }; - static int ep_passable_inside[] = + static int ep_belt_active[] = { - EL_SP_PORT_LEFT, - EL_SP_PORT_RIGHT, - EL_SP_PORT_UP, - EL_SP_PORT_DOWN, - EL_SP_PORT_HORIZONTAL, - EL_SP_PORT_VERTICAL, - EL_SP_PORT_ANY, - EL_SP_GRAVITY_PORT_LEFT, - EL_SP_GRAVITY_PORT_RIGHT, - EL_SP_GRAVITY_PORT_UP, - EL_SP_GRAVITY_PORT_DOWN, + EL_CONVEYOR_BELT_1_LEFT_ACTIVE, + EL_CONVEYOR_BELT_1_MIDDLE_ACTIVE, + EL_CONVEYOR_BELT_1_RIGHT_ACTIVE, + EL_CONVEYOR_BELT_2_LEFT_ACTIVE, + EL_CONVEYOR_BELT_2_MIDDLE_ACTIVE, + EL_CONVEYOR_BELT_2_RIGHT_ACTIVE, + EL_CONVEYOR_BELT_3_LEFT_ACTIVE, + EL_CONVEYOR_BELT_3_MIDDLE_ACTIVE, + EL_CONVEYOR_BELT_3_RIGHT_ACTIVE, + EL_CONVEYOR_BELT_4_LEFT_ACTIVE, + EL_CONVEYOR_BELT_4_MIDDLE_ACTIVE, + EL_CONVEYOR_BELT_4_RIGHT_ACTIVE, -1 }; - static int ep_passable_under[] = + static int ep_belt_switch[] = { + EL_CONVEYOR_BELT_1_SWITCH_LEFT, + EL_CONVEYOR_BELT_1_SWITCH_MIDDLE, + EL_CONVEYOR_BELT_1_SWITCH_RIGHT, + EL_CONVEYOR_BELT_2_SWITCH_LEFT, + EL_CONVEYOR_BELT_2_SWITCH_MIDDLE, + EL_CONVEYOR_BELT_2_SWITCH_RIGHT, + EL_CONVEYOR_BELT_3_SWITCH_LEFT, + EL_CONVEYOR_BELT_3_SWITCH_MIDDLE, + EL_CONVEYOR_BELT_3_SWITCH_RIGHT, + EL_CONVEYOR_BELT_4_SWITCH_LEFT, + EL_CONVEYOR_BELT_4_SWITCH_MIDDLE, + EL_CONVEYOR_BELT_4_SWITCH_RIGHT, -1 }; - static int ep_diggable[] = + static int ep_tube[] = { - EL_SAND, - EL_SP_BASE, - EL_SP_BUGGY_BASE, - EL_SP_BUGGY_BASE_ACTIVATING, - EL_TRAP, - EL_INVISIBLE_SAND, - EL_INVISIBLE_SAND_ACTIVE, -#if 1 - EL_LANDMINE, - EL_TRAP_ACTIVE, - EL_SP_BUGGY_BASE_ACTIVE, -#endif + EL_TUBE_LEFT_UP, + EL_TUBE_LEFT_DOWN, + EL_TUBE_RIGHT_UP, + EL_TUBE_RIGHT_DOWN, + EL_TUBE_HORIZONTAL, + EL_TUBE_HORIZONTAL_UP, + EL_TUBE_HORIZONTAL_DOWN, + EL_TUBE_VERTICAL, + EL_TUBE_VERTICAL_LEFT, + EL_TUBE_VERTICAL_RIGHT, + EL_TUBE_ANY, -1 }; - static int ep_collectible[] = + static int ep_keygate[] = { - EL_BD_DIAMOND, - EL_EMERALD, - EL_DIAMOND, - EL_EMERALD_YELLOW, - EL_EMERALD_RED, - EL_EMERALD_PURPLE, - EL_KEY_1, - EL_KEY_2, - EL_KEY_3, - EL_KEY_4, - EL_EM_KEY_1, - EL_EM_KEY_2, - EL_EM_KEY_3, - EL_EM_KEY_4, - EL_DYNAMITE, - EL_DYNABOMB_INCREASE_NUMBER, - EL_DYNABOMB_INCREASE_SIZE, - EL_DYNABOMB_INCREASE_POWER, - EL_SP_INFOTRON, - EL_SP_DISK_RED, - EL_PEARL, - EL_CRYSTAL, - EL_KEY_WHITE, - EL_SHIELD_NORMAL, - EL_SHIELD_DEADLY, - EL_EXTRA_TIME, - EL_ENVELOPE, - EL_SPEED_PILL, + 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_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, -1 }; - static int ep_active_bomb[] = + static int ep_amoeboid[] = { - EL_DYNAMITE_ACTIVE, - EL_DYNABOMB_PLAYER_1_ACTIVE, - EL_DYNABOMB_PLAYER_2_ACTIVE, - EL_DYNABOMB_PLAYER_3_ACTIVE, - EL_DYNABOMB_PLAYER_4_ACTIVE, - EL_SP_DISK_RED_ACTIVE, + EL_AMOEBA_DEAD, + EL_AMOEBA_WET, + EL_AMOEBA_DRY, + EL_AMOEBA_FULL, + EL_BD_AMOEBA, -1 }; - static int ep_belt[] = + static int ep_amoebalive[] = { - EL_CONVEYOR_BELT_1_LEFT, - EL_CONVEYOR_BELT_1_MIDDLE, - EL_CONVEYOR_BELT_1_RIGHT, - EL_CONVEYOR_BELT_2_LEFT, - EL_CONVEYOR_BELT_2_MIDDLE, - EL_CONVEYOR_BELT_2_RIGHT, - EL_CONVEYOR_BELT_3_LEFT, - EL_CONVEYOR_BELT_3_MIDDLE, - EL_CONVEYOR_BELT_3_RIGHT, - EL_CONVEYOR_BELT_4_LEFT, - EL_CONVEYOR_BELT_4_MIDDLE, - EL_CONVEYOR_BELT_4_RIGHT, + EL_AMOEBA_WET, + EL_AMOEBA_DRY, + EL_AMOEBA_FULL, + EL_BD_AMOEBA, -1 }; - static int ep_belt_active[] = + static int ep_has_content[] = { - EL_CONVEYOR_BELT_1_LEFT_ACTIVE, - EL_CONVEYOR_BELT_1_MIDDLE_ACTIVE, - EL_CONVEYOR_BELT_1_RIGHT_ACTIVE, - EL_CONVEYOR_BELT_2_LEFT_ACTIVE, - EL_CONVEYOR_BELT_2_MIDDLE_ACTIVE, - EL_CONVEYOR_BELT_2_RIGHT_ACTIVE, - EL_CONVEYOR_BELT_3_LEFT_ACTIVE, - EL_CONVEYOR_BELT_3_MIDDLE_ACTIVE, - EL_CONVEYOR_BELT_3_RIGHT_ACTIVE, - EL_CONVEYOR_BELT_4_LEFT_ACTIVE, - EL_CONVEYOR_BELT_4_MIDDLE_ACTIVE, - EL_CONVEYOR_BELT_4_RIGHT_ACTIVE, + EL_YAMYAM, + EL_AMOEBA_WET, + EL_AMOEBA_DRY, + EL_AMOEBA_FULL, + EL_BD_AMOEBA, -1 }; - static int ep_belt_switch[] = + static int ep_active_bomb[] = { - EL_CONVEYOR_BELT_1_SWITCH_LEFT, - EL_CONVEYOR_BELT_1_SWITCH_MIDDLE, - EL_CONVEYOR_BELT_1_SWITCH_RIGHT, - EL_CONVEYOR_BELT_2_SWITCH_LEFT, - EL_CONVEYOR_BELT_2_SWITCH_MIDDLE, - EL_CONVEYOR_BELT_2_SWITCH_RIGHT, - EL_CONVEYOR_BELT_3_SWITCH_LEFT, - EL_CONVEYOR_BELT_3_SWITCH_MIDDLE, - EL_CONVEYOR_BELT_3_SWITCH_RIGHT, - EL_CONVEYOR_BELT_4_SWITCH_LEFT, - EL_CONVEYOR_BELT_4_SWITCH_MIDDLE, - EL_CONVEYOR_BELT_4_SWITCH_RIGHT, + EL_DYNAMITE_ACTIVE, + EL_DYNABOMB_PLAYER_1_ACTIVE, + EL_DYNABOMB_PLAYER_2_ACTIVE, + EL_DYNABOMB_PLAYER_3_ACTIVE, + EL_DYNABOMB_PLAYER_4_ACTIVE, + EL_SP_DISK_RED_ACTIVE, -1 }; - static int ep_sp_element[] = + static int ep_inactive[] = { + EL_EMPTY, + EL_SAND, + EL_WALL, + EL_BD_WALL, + EL_WALL_CRUMBLED, + EL_STEELWALL, + EL_AMOEBA_DEAD, + EL_QUICKSAND_EMPTY, + EL_STONEBLOCK, + EL_ROBOT_WHEEL, + EL_KEY_1, + EL_KEY_2, + EL_KEY_3, + EL_KEY_4, + EL_EM_KEY_1, + EL_EM_KEY_2, + EL_EM_KEY_3, + EL_EM_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_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, + EL_DYNAMITE, + EL_INVISIBLE_STEELWALL, + EL_INVISIBLE_WALL, + EL_INVISIBLE_SAND, + EL_LAMP, + EL_LAMP_ACTIVE, + EL_WALL_EMERALD, + EL_WALL_DIAMOND, + EL_WALL_BD_DIAMOND, + EL_WALL_EMERALD_YELLOW, + EL_DYNABOMB_INCREASE_NUMBER, + EL_DYNABOMB_INCREASE_SIZE, + EL_DYNABOMB_INCREASE_POWER, + EL_SOKOBAN_OBJECT, + EL_SOKOBAN_FIELD_EMPTY, + EL_SOKOBAN_FIELD_FULL, + EL_WALL_EMERALD_RED, + EL_WALL_EMERALD_PURPLE, + EL_ACID_POOL_TOPLEFT, + EL_ACID_POOL_TOPRIGHT, + EL_ACID_POOL_BOTTOMLEFT, + EL_ACID_POOL_BOTTOM, + EL_ACID_POOL_BOTTOMRIGHT, + EL_MAGIC_WALL, + EL_MAGIC_WALL_DEAD, + EL_BD_MAGIC_WALL, + EL_BD_MAGIC_WALL_DEAD, + EL_AMOEBA_TO_DIAMOND, + EL_BLOCKED, EL_SP_EMPTY, - 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_EXIT_OPEN, - EL_SP_DISK_ORANGE, EL_SP_PORT_RIGHT, EL_SP_PORT_DOWN, EL_SP_PORT_LEFT, @@ -2121,59 +2114,64 @@ void InitElementPropertiesStatic() 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_VERTICAL, EL_SP_PORT_ANY, - EL_SP_ELECTRON, - EL_SP_BUGGY_BASE, + EL_SP_DISK_RED, + EL_SP_DISK_YELLOW, + EL_SP_CHIP_SINGLE, EL_SP_CHIP_LEFT, EL_SP_CHIP_RIGHT, - EL_SP_HARDWARE_BASE_1, + EL_SP_CHIP_TOP, + EL_SP_CHIP_BOTTOM, + EL_SP_HARDWARE_GRAY, EL_SP_HARDWARE_GREEN, EL_SP_HARDWARE_BLUE, EL_SP_HARDWARE_RED, EL_SP_HARDWARE_YELLOW, + EL_SP_HARDWARE_BASE_1, 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, - /* additional elements that appeared in newer Supaplex levels */ - EL_INVISIBLE_WALL, - /* more than one murphy in a level results in an inactive clone */ - EL_SP_MURPHY_CLONE, - -1 - }; - - static int ep_has_content[] = - { - EL_YAMYAM, - EL_AMOEBA_WET, - EL_AMOEBA_DRY, - EL_AMOEBA_FULL, - EL_BD_AMOEBA, - -1 - }; - - static int ep_tube[] = - { - EL_TUBE_LEFT_UP, - EL_TUBE_LEFT_DOWN, - EL_TUBE_RIGHT_UP, - EL_TUBE_RIGHT_DOWN, - EL_TUBE_HORIZONTAL, - EL_TUBE_HORIZONTAL_UP, - EL_TUBE_HORIZONTAL_DOWN, - EL_TUBE_VERTICAL, - EL_TUBE_VERTICAL_LEFT, - EL_TUBE_VERTICAL_RIGHT, - EL_TUBE_ANY, + EL_CONVEYOR_BELT_1_SWITCH_LEFT, + EL_CONVEYOR_BELT_1_SWITCH_MIDDLE, + EL_CONVEYOR_BELT_1_SWITCH_RIGHT, + EL_CONVEYOR_BELT_2_SWITCH_LEFT, + EL_CONVEYOR_BELT_2_SWITCH_MIDDLE, + EL_CONVEYOR_BELT_2_SWITCH_RIGHT, + EL_CONVEYOR_BELT_3_SWITCH_LEFT, + EL_CONVEYOR_BELT_3_SWITCH_MIDDLE, + EL_CONVEYOR_BELT_3_SWITCH_RIGHT, + EL_CONVEYOR_BELT_4_SWITCH_LEFT, + EL_CONVEYOR_BELT_4_SWITCH_MIDDLE, + EL_CONVEYOR_BELT_4_SWITCH_RIGHT, + EL_SIGN_EXCLAMATION, + EL_SIGN_RADIOACTIVITY, + EL_SIGN_STOP, + EL_SIGN_WHEELCHAIR, + EL_SIGN_PARKING, + EL_SIGN_ONEWAY, + EL_SIGN_HEART, + EL_SIGN_TRIANGLE, + EL_SIGN_ROUND, + EL_SIGN_EXIT, + EL_SIGN_YINYANG, + EL_SIGN_OTHER, + EL_STEELWALL_SLANTED, + EL_EMC_STEELWALL_1, + EL_EMC_STEELWALL_2, + EL_EMC_STEELWALL_3, + EL_EMC_STEELWALL_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, -1 }; @@ -2183,47 +2181,47 @@ void InitElementPropertiesStatic() int property; } element_properties[] = { - { ep_amoebalive, EP_AMOEBALIVE }, - { ep_amoeboid, EP_AMOEBOID }, - { ep_keygate, EP_KEYGATE }, - { ep_can_be_crumbled, EP_CAN_BE_CRUMBLED }, - { ep_historic_solid, EP_HISTORIC_SOLID }, + { ep_diggable, EP_DIGGABLE }, + { ep_collectible, EP_COLLECTIBLE }, { ep_indestructible, EP_INDESTRUCTIBLE }, { ep_slippery, EP_SLIPPERY }, - { ep_enemy, EP_ENEMY }, - { ep_historic_wall, EP_HISTORIC_WALL }, { ep_can_fall, EP_CAN_FALL }, { ep_can_smash, EP_CAN_SMASH }, - { ep_can_change, EP_CAN_CHANGE }, - { ep_can_move, EP_CAN_MOVE }, - { ep_could_move, EP_COULD_MOVE }, - { ep_dont_touch, EP_DONT_TOUCH }, - { ep_dont_go_to, EP_DONT_GO_TO }, - { ep_food_dark_yamyam, EP_FOOD_DARK_YAMYAM }, - { ep_bd_element, EP_BD_ELEMENT }, - { ep_sb_element, EP_SB_ELEMENT }, - { ep_gem, EP_GEM }, - { ep_inactive, EP_INACTIVE }, - { ep_explosive, EP_EXPLOSIVE }, - { ep_food_penguin, EP_FOOD_PENGUIN }, - { ep_pushable, EP_PUSHABLE }, - { ep_player, EP_PLAYER }, { ep_walkable_over, EP_WALKABLE_OVER }, { ep_walkable_inside, EP_WALKABLE_INSIDE }, { ep_walkable_under, EP_WALKABLE_UNDER }, { ep_passable_over, EP_PASSABLE_OVER }, { ep_passable_inside, EP_PASSABLE_INSIDE }, { ep_passable_under, EP_PASSABLE_UNDER }, + { ep_pushable, EP_PUSHABLE }, - { ep_diggable, EP_DIGGABLE }, - { ep_collectible, EP_COLLECTIBLE }, - { ep_active_bomb, EP_ACTIVE_BOMB }, + { ep_player, EP_PLAYER }, + { ep_can_be_crumbled, EP_CAN_BE_CRUMBLED }, + { ep_can_move, EP_CAN_MOVE }, + { ep_can_change, EP_CAN_CHANGE }, + { ep_dont_touch, EP_DONT_TOUCH }, + { ep_enemy, EP_ENEMY }, + { ep_dont_go_to, EP_DONT_GO_TO }, + { ep_explosive, EP_EXPLOSIVE }, + { ep_bd_element, EP_BD_ELEMENT }, + { ep_sp_element, EP_SP_ELEMENT }, + { ep_sb_element, EP_SB_ELEMENT }, + { ep_gem, EP_GEM }, + { ep_food_dark_yamyam, EP_FOOD_DARK_YAMYAM }, + { ep_food_penguin, EP_FOOD_PENGUIN }, + { ep_historic_wall, EP_HISTORIC_WALL }, + { ep_historic_solid, EP_HISTORIC_SOLID }, { ep_belt, EP_BELT }, { ep_belt_active, EP_BELT_ACTIVE }, { ep_belt_switch, EP_BELT_SWITCH }, - { ep_sp_element, EP_SP_ELEMENT }, - { ep_has_content, EP_HAS_CONTENT }, { ep_tube, EP_TUBE }, + { ep_keygate, EP_KEYGATE }, + { ep_amoeboid, EP_AMOEBOID }, + { ep_amoebalive, EP_AMOEBALIVE }, + { ep_has_content, EP_HAS_CONTENT }, + { ep_active_bomb, EP_ACTIVE_BOMB }, + { ep_inactive, EP_INACTIVE }, + { NULL, -1 } }; @@ -2249,14 +2247,12 @@ void InitElementPropertiesEngine(int engine_version) EP_AMOEBALIVE, EP_AMOEBOID, EP_PFORTE, - EP_SOLID, EP_ENEMY, EP_MAUER, EP_CAN_FALL, EP_CAN_SMASH, EP_CAN_CHANGE, EP_CAN_MOVE, - EP_COULD_MOVE, EP_DONT_TOUCH, EP_DONT_GO_TO, EP_GEM, @@ -2287,7 +2283,6 @@ void InitElementPropertiesEngine(int engine_version) EP_CAN_FALL, EP_CAN_SMASH, EP_CAN_MOVE, - EP_COULD_MOVE, EP_DONT_GO_TO, EP_FOOD_DARK_YAMYAM, EP_GEM, @@ -2343,16 +2338,17 @@ void InitElementPropertiesEngine(int engine_version) if (IS_HISTORIC_WALL(i)) SET_PROPERTY(i, EP_WALL, TRUE); - /* ---------- SOLID ---------------------------------------------------- */ + /* ---------- SOLID_FOR_PUSHING ---------------------------------------- */ if (engine_version < VERSION_IDENT(2,2,0)) - SET_PROPERTY(i, EP_SOLID, IS_HISTORIC_SOLID(i)); + SET_PROPERTY(i, EP_SOLID_FOR_PUSHING, IS_HISTORIC_SOLID(i)); else - SET_PROPERTY(i, EP_SOLID, (!IS_WALKABLE(i) && - !IS_DIGGABLE(i) && - !IS_COLLECTIBLE(i))); + SET_PROPERTY(i, EP_SOLID_FOR_PUSHING, (!IS_WALKABLE(i) && + !IS_DIGGABLE(i) && + !IS_COLLECTIBLE(i))); /* ---------- DRAGONFIRE_PROOF ----------------------------------------- */ - if (IS_HISTORIC_SOLID(i) || i == EL_EXPLOSION) + if (IS_HISTORIC_SOLID(i) || i == EL_EXPLOSION || + (IS_CUSTOM_ELEMENT(i) && IS_INDESTRUCTIBLE(i))) SET_PROPERTY(i, EP_DRAGONFIRE_PROOF, TRUE); /* ---------- EXPLOSION_PROOF ------------------------------------------ */ @@ -2559,37 +2555,43 @@ static void InitArtworkConfig() static char *direction_id_suffix[NUM_DIRECTIONS + 1]; static char *special_id_suffix[NUM_SPECIAL_GFX_ARGS + 1]; static char *dummy[1] = { NULL }; - static char *ignore_image_tokens[] = - { - "name", - "sort_priority", - "global.num_toons", - "menu.draw_xoffset", - "menu.draw_yoffset", - "menu.draw_xoffset.MAIN", - "menu.draw_yoffset.MAIN", - "menu.draw_xoffset.LEVELS", - "menu.draw_yoffset.LEVELS", - "menu.draw_xoffset.SCORES", - "menu.draw_yoffset.SCORES", - "menu.draw_xoffset.EDITOR", - "menu.draw_yoffset.EDITOR", - "menu.draw_xoffset.INFO", - "menu.draw_yoffset.INFO", - "menu.draw_xoffset.SETUP", - "menu.draw_yoffset.SETUP", - "door.step_offset", - "door.step_delay", - NULL - }; - static char *ignore_sound_tokens[] = + static char *ignore_generic_tokens[] = { "name", "sort_priority", NULL }; + static char **ignore_image_tokens, **ignore_sound_tokens; + int num_ignore_generic_tokens; + int num_ignore_image_tokens, num_ignore_sound_tokens; int i; + /* dynamically determine list of generic tokens to be ignored */ + num_ignore_generic_tokens = 0; + for (i=0; ignore_generic_tokens[i] != NULL; i++) + num_ignore_generic_tokens++; + + /* dynamically determine list of image tokens to be ignored */ + num_ignore_image_tokens = num_ignore_generic_tokens; + for (i=0; image_config_vars[i].token != NULL; i++) + num_ignore_image_tokens++; + ignore_image_tokens = + checked_malloc((num_ignore_image_tokens + 1) * sizeof(char *)); + for (i=0; i < num_ignore_generic_tokens; i++) + ignore_image_tokens[i] = ignore_generic_tokens[i]; + for (i=0; i < num_ignore_image_tokens - num_ignore_generic_tokens; i++) + ignore_image_tokens[num_ignore_generic_tokens + i] = + image_config_vars[i].token; + ignore_image_tokens[num_ignore_image_tokens] = NULL; + + /* dynamically determine list of sound tokens to be ignored */ + num_ignore_sound_tokens = num_ignore_generic_tokens; + ignore_sound_tokens = + checked_malloc((num_ignore_sound_tokens + 1) * sizeof(char *)); + for (i=0; i < num_ignore_generic_tokens; i++) + ignore_sound_tokens[i] = ignore_generic_tokens[i]; + ignore_sound_tokens[num_ignore_sound_tokens] = NULL; + for (i=0; i=BX1 && (x)<=BX2 && (y)>=BY1 &&(y)<=BY2) #define IN_LEV_FIELD(x,y) ((x)>=0 && (x)=0 &&(y)= GAME_MODE_MAIN && \ + game_status <= GAME_MODE_SETUP ? \ + menu.draw_xoffset[game_status] : menu.draw_xoffset_default)) +#define mSY (SY + (game_status >= GAME_MODE_MAIN && \ + game_status <= GAME_MODE_SETUP ? \ + menu.draw_yoffset[game_status] : menu.draw_yoffset_default)) #if defined(TARGET_X11_NATIVE_PERFORMANCE_WORKAROUND) #define NUM_SCROLLBAR_BITMAPS 2 @@ -106,14 +103,9 @@ static void drawCursorExt(int xpos, int ypos, int color, int graphic) ypos += MENU_SCREEN_START_YPOS; -#if 1 DrawBackground(mSX + xpos * TILEX, mSY + ypos * TILEY, TILEX, TILEY); DrawGraphicThruMaskExt(drawto, mSX + xpos * TILEX, mSY + ypos * TILEY, graphic, 0); -#else - DrawBackground(SX + xpos * 32, SY + ypos * 32, TILEX, TILEY); - DrawGraphicThruMask(xpos, ypos, graphic, 0); -#endif } static void initCursor(int ypos, int graphic) @@ -189,11 +181,6 @@ void DrawMainMenu() int level_width = font_width * strlen("Level:"); int i; -#if 0 - mSX = SX + global.menu_draw_xoffset; - mSY = SY + global.menu_draw_yoffset; -#endif - UnmapAllGadgets(); FadeSounds(); @@ -252,7 +239,7 @@ void DrawMainMenu() DrawText(mSX + 32, mSY + 3*32, "Level:", FONT_MENU_1); DrawText(mSX + 32, mSY + 4*32, "Hall Of Fame", FONT_MENU_1); DrawText(mSX + 32, mSY + 5*32, "Level Creator", FONT_MENU_1); - DrawText(mSY + 32, mSY + 6*32, "Info Screen", FONT_MENU_1); + DrawText(mSX + 32, mSY + 6*32, "Info Screen", FONT_MENU_1); DrawText(mSX + 32, mSY + 7*32, "Start Game", FONT_MENU_1); DrawText(mSX + 32, mSY + 8*32, "Setup", FONT_MENU_1); DrawText(mSX + 32, mSY + 9*32, "Quit", FONT_MENU_1); @@ -343,8 +330,8 @@ void HandleMainMenu(int mx, int my, int dx, int dy, int button) if (mx || my) /* mouse input */ { - x = (mx - SX) / 32; - y = (my - SY) / 32 - MENU_SCREEN_START_YPOS; + x = (mx - mSX) / 32; + y = (my - mSY) / 32 - MENU_SCREEN_START_YPOS; } else if (dx || dy) /* keyboard input */ { @@ -1221,7 +1208,10 @@ static void drawChooseTreeList(int first_entry, int num_page_entries, int max_buffer_len = (SCR_FIELDX - 2) * 2; int num_entries = numTreeInfoInGroup(ti); char *title_string = NULL; - int offset = (ti->type == TREE_TYPE_LEVEL_DIR ? 0 : 16); + int xoffset_setup = 16; + int yoffset_setup = 0; + int xoffset = (ti->type == TREE_TYPE_LEVEL_DIR ? 0 : xoffset_setup); + int yoffset = (ti->type == TREE_TYPE_LEVEL_DIR ? 0 : yoffset_setup); int last_game_status = game_status; /* save current game status */ DrawBackground(SX, SY, SXSIZE - 32, SYSIZE); @@ -1233,7 +1223,7 @@ static void drawChooseTreeList(int first_entry, int num_page_entries, ti->type == TREE_TYPE_SOUNDS_DIR ? "Custom Sounds" : ti->type == TREE_TYPE_MUSIC_DIR ? "Custom Music" : ""); - DrawText(SX + offset, SY + offset, title_string, FONT_TITLE_1); + DrawText(SX + xoffset, SY + yoffset, title_string, FONT_TITLE_1); /* force LEVELS font on artwork setup screen */ game_status = GAME_MODE_LEVELS; @@ -1264,16 +1254,18 @@ static void drawChooseTreeList(int first_entry, int num_page_entries, { int ypos = 1; - DrawBackground(SX, SY + ypos * 32, TILEX, TILEY); - DrawGraphicThruMask(0, ypos, IMG_MENU_BUTTON_UP, 0); + DrawBackground(mSX, mSY + ypos * TILEY, TILEX, TILEY); + DrawGraphicThruMaskExt(drawto, mSX, mSY + ypos * TILEY, + IMG_MENU_BUTTON_UP, 0); } if (first_entry + num_page_entries < num_entries) { int ypos = MAX_MENU_ENTRIES_ON_SCREEN + 1; - DrawBackground(SX, SY + ypos * 32, TILEX, TILEY); - DrawGraphicThruMask(0, ypos, IMG_MENU_BUTTON_DOWN, 0); + DrawBackground(mSX, mSY + ypos * TILEY, TILEX, TILEY); + DrawGraphicThruMaskExt(drawto, mSX, mSY + ypos * TILEY, + IMG_MENU_BUTTON_DOWN, 0); } game_status = last_game_status; /* restore current game status */ @@ -1368,8 +1360,8 @@ static void HandleChooseTree(int mx, int my, int dx, int dy, int button, if (mx || my) /* mouse input */ { - x = (mx - SX) / 32; - y = (my - SY) / 32 - MENU_SCREEN_START_YPOS; + x = (mx - mSX) / 32; + y = (my - mSY) / 32 - MENU_SCREEN_START_YPOS; } else if (dx || dy) /* keyboard input */ { @@ -2071,8 +2063,8 @@ void HandleSetupScreen_Generic(int mx, int my, int dx, int dy, int button) if (mx || my) /* mouse input */ { - x = (mx - SX) / 32; - y = (my - SY) / 32 - MENU_SCREEN_START_YPOS; + x = (mx - mSX) / 32; + y = (my - mSY) / 32 - MENU_SCREEN_START_YPOS; } else if (dx || dy) /* keyboard input */ { @@ -2282,8 +2274,8 @@ void HandleSetupScreen_Input(int mx, int my, int dx, int dy, int button) if (mx || my) /* mouse input */ { - x = (mx - SX) / 32; - y = (my - SY) / 32 - MENU_SCREEN_START_YPOS; + x = (mx - mSX) / 32; + y = (my - mSY) / 32 - MENU_SCREEN_START_YPOS; } else if (dx || dy) /* keyboard input */ { @@ -3017,16 +3009,16 @@ static void HandleScreenGadgets(struct GadgetInfo *gi) { case SCREEN_CTRL_ID_SCROLL_UP: if (game_status == GAME_MODE_LEVELS) - HandleChooseLevel(SX,SY + 32, 0,0, MB_MENU_MARK); + HandleChooseLevel(mSX,mSY + 32, 0,0, MB_MENU_MARK); else if (game_status == GAME_MODE_SETUP) - HandleSetupScreen(SX,SY + 32, 0,0, MB_MENU_MARK); + HandleSetupScreen(mSX,mSY + 32, 0,0, MB_MENU_MARK); break; case SCREEN_CTRL_ID_SCROLL_DOWN: if (game_status == GAME_MODE_LEVELS) - HandleChooseLevel(SX,SY + SYSIZE - 32, 0,0, MB_MENU_MARK); + HandleChooseLevel(mSX,mSY + SYSIZE - 32, 0,0, MB_MENU_MARK); else if (game_status == GAME_MODE_SETUP) - HandleSetupScreen(SX,SY + SYSIZE - 32, 0,0, MB_MENU_MARK); + HandleSetupScreen(mSX,mSY + SYSIZE - 32, 0,0, MB_MENU_MARK); break; case SCREEN_CTRL_ID_SCROLL_VERTICAL: diff --git a/src/tools.c b/src/tools.c index 89de2f61..31a555d6 100644 --- a/src/tools.c +++ b/src/tools.c @@ -2010,8 +2010,8 @@ unsigned int MoveDoor(unsigned int door_state) static int door1 = DOOR_OPEN_1; static int door2 = DOOR_CLOSE_2; static unsigned long door_delay = 0; - int x, start, stepsize = global.door_step_offset; - unsigned long door_delay_value = global.door_step_delay; + int x, start, stepsize = door.step_offset; + unsigned long door_delay_value = door.step_delay; if (door_state == DOOR_GET_STATE) return(door1 | door2);