From: Holger Schemel Date: Tue, 19 Nov 2024 23:04:58 +0000 (+0100) Subject: changed BD engine to match new GDash code (extra ckdelay for animations) X-Git-Tag: 4.4.0.0-test-4~38 X-Git-Url: https://git.artsoft.org/?a=commitdiff_plain;h=35d45ac64ff5423fc2303c087f4ffcb16c60441e;p=rocksndiamonds.git changed BD engine to match new GDash code (extra ckdelay for animations) --- diff --git a/src/game_bd/bd_cave.c b/src/game_bd/bd_cave.c index 492b6882..fe1ce911 100644 --- a/src/game_bd/bd_cave.c +++ b/src/game_bd/bd_cave.c @@ -1191,11 +1191,15 @@ static void cave_set_ckdelay_extra_for_animation(GdCave *cave) int x, y; boolean has_amoeba = FALSE, has_firefly = FALSE, has_butterfly = FALSE; + cave->ckdelay_current = 0; + for (y = 0; y < cave->h; y++) { for (x = 0; x < cave->w; x++) { - switch (non_scanned_pair(cave->map[y][x])) + cave->ckdelay_current += gd_element_properties[cave->map[y][x]].ckdelay; + + switch (cave->map[y][x]) { case O_FIREFLY_1: case O_FIREFLY_2: @@ -1216,12 +1220,15 @@ static void cave_set_ckdelay_extra_for_animation(GdCave *cave) break; default: + // other animated elements are not important, + // because they were not present in bd2. break; } } } cave->ckdelay_extra_for_animation = 0; + if (has_amoeba) cave->ckdelay_extra_for_animation += 2600; if (has_firefly)