From: Holger Schemel Date: Tue, 3 Sep 2024 19:28:26 +0000 (+0200) Subject: removed code which has no effect anymore X-Git-Tag: 4.4.0.0-test-4~276 X-Git-Url: https://git.artsoft.org/?a=commitdiff_plain;h=9f9fbec05b1066a589582d71ceef7bfed717caad;p=rocksndiamonds.git removed code which has no effect anymore --- diff --git a/src/game_bd/bd_cave.c b/src/game_bd/bd_cave.c index b56e2ac7..3cd4c64f 100644 --- a/src/game_bd/bd_cave.c +++ b/src/game_bd/bd_cave.c @@ -1662,7 +1662,7 @@ void gd_cave_adler_checksum_more(GdCave *cave, unsigned int *a, unsigned int *b) for (y = 0; y < cave->h; y++) for (x = 0; x < cave->w; x++) { - *a += gd_element_properties[cave->map[y][x] & O_MASK].character; + *a += gd_element_properties[cave->map[y][x]].character; *b += *a; *a %= 65521; diff --git a/src/game_bd/bd_caveengine.c b/src/game_bd/bd_caveengine.c index ab9b3d61..252ff9f1 100644 --- a/src/game_bd/bd_caveengine.c +++ b/src/game_bd/bd_caveengine.c @@ -135,7 +135,7 @@ static inline boolean has_property(int element, const int property) if (use_old_game_engine) element = non_scanned_pair(element); - return (gd_element_properties[element & O_MASK].properties & property) != 0; + return (gd_element_properties[element].properties & property) != 0; } // returns true if the element can fall @@ -589,7 +589,7 @@ static inline boolean is_element_dir(const GdCave *cave, const int x, const int static inline boolean is_space_dir(const GdCave *cave, const int x, const int y, const GdDirection dir) { - GdElement e = get_dir(cave, x, y, dir) & O_MASK; + GdElement e = get_dir(cave, x, y, dir); return (e == O_SPACE || e == O_LAVA); } @@ -825,7 +825,7 @@ static void bomb_explode(GdCave *cave, const int x, const int y) */ static void explode(GdCave *cave, int x, int y) { - GdElement e = get(cave, x, y) & O_MASK; + GdElement e = get(cave, x, y); switch (e) { @@ -1789,7 +1789,7 @@ void gd_cave_iterate(GdCave *cave, GdDirection player_move, boolean player_fire, } // add the ckdelay correction value for every element seen. - cave->ckdelay += gd_element_properties[get(cave, x, y) & O_MASK].ckdelay; + cave->ckdelay += gd_element_properties[get(cave, x, y)].ckdelay; switch (get(cave, x, y)) { @@ -4061,7 +4061,7 @@ void set_initial_cave_speed(GdCave *cave) for (x = 0; x < cave->w; x++) { // add the ckdelay correction value for every element seen. - cave->ckdelay += gd_element_properties[get(cave, x, y) & O_MASK].ckdelay; + cave->ckdelay += gd_element_properties[get(cave, x, y)].ckdelay; } } diff --git a/src/game_bd/bd_elements.h b/src/game_bd/bd_elements.h index 99bfa717..d318699e 100644 --- a/src/game_bd/bd_elements.h +++ b/src/game_bd/bd_elements.h @@ -405,12 +405,7 @@ typedef enum _element O_OUT, O_EXCLAMATION_MARK, - O_MAX_ALL, - - SCANNED = 0x400, - - // binary AND this to elements to get rid of properties above. - O_MASK = ~SCANNED + O_MAX_ALL } GdElement; typedef enum _sound diff --git a/src/game_bd/bd_graphics.c b/src/game_bd/bd_graphics.c index 9138620a..7bca4511 100644 --- a/src/game_bd/bd_graphics.c +++ b/src/game_bd/bd_graphics.c @@ -545,7 +545,7 @@ Bitmap *gd_get_tile_bitmap(Bitmap *bitmap) // returns true if the element has a certain property static inline boolean has_property(const int element, const int property) { - return (gd_element_properties[element & O_MASK].properties & property) != 0; + return (gd_element_properties[element].properties & property) != 0; } // returns true if the element is a player diff --git a/src/tools.c b/src/tools.c index d94e5e0d..7d1201e0 100644 --- a/src/tools.c +++ b/src/tools.c @@ -8013,9 +8013,6 @@ int map_element_BD_to_RND_cave(int element_bd) mapping_initialized = TRUE; } - // always map (scanned) run-time elements to normal elements - element_bd &= O_MASK; - if (element_bd < 0 || element_bd >= O_MAX_ALL) { Warn("invalid BD element %d", element_bd); @@ -8046,9 +8043,6 @@ int map_element_BD_to_RND_game(int element_bd) mapping_initialized = TRUE; } - // always map (scanned) run-time elements to normal elements - element_bd &= O_MASK; - if (element_bd < 0 || element_bd >= O_MAX_ALL) { Warn("invalid BD element %d", element_bd);