From: Holger Schemel Date: Tue, 17 Sep 2024 17:37:28 +0000 (+0200) Subject: renamed variable X-Git-Tag: 4.4.0.0-test-4~217 X-Git-Url: https://git.artsoft.org/?a=commitdiff_plain;h=847bb9c60940736b433d74620447725ae5d6a0a8;p=rocksndiamonds.git renamed variable --- diff --git a/src/game_bd/bd_cave.c b/src/game_bd/bd_cave.c index 31437736..8aa3d778 100644 --- a/src/game_bd/bd_cave.c +++ b/src/game_bd/bd_cave.c @@ -1841,13 +1841,13 @@ void gd_update_scheduling_cave_speed(GdCave *cave) { // non-intermissions cave->speed = (88 + 3.66 * cave->c64_timing + - (cave->ckdelay + cave->ckdelay_extra_for_animation) / 1000); + (cave->ckdelay_current + cave->ckdelay_extra_for_animation) / 1000); } else { // intermissions were quicker, as only lines 1-12 were processed by the engine. cave->speed = (60 + 3.66 * cave->c64_timing + - (cave->ckdelay + cave->ckdelay_extra_for_animation) / 1000); + (cave->ckdelay_current + cave->ckdelay_extra_for_animation) / 1000); } break; @@ -1856,36 +1856,36 @@ void gd_update_scheduling_cave_speed(GdCave *cave) if (!cave->intermission) { // non-intermissions - cave->speed = (74 + 3.2 * cave->c64_timing + (cave->ckdelay) / 1000); + cave->speed = (74 + 3.2 * cave->c64_timing + (cave->ckdelay_current) / 1000); } else { // for intermissions - cave->speed = (65 + 2.88 * cave->c64_timing + (cave->ckdelay) / 1000); + cave->speed = (65 + 2.88 * cave->c64_timing + (cave->ckdelay_current) / 1000); } break; case GD_SCHEDULING_BD2: // 60 is a guess. - cave->speed = MAX(60 + (cave->ckdelay + cave->ckdelay_extra_for_animation) / 1000, + cave->speed = MAX(60 + (cave->ckdelay_current + cave->ckdelay_extra_for_animation) / 1000, cave->c64_timing * 20); break; case GD_SCHEDULING_PLCK: // 65 is totally empty cave in construction kit, with delay = 0) - cave->speed = MAX(65 + cave->ckdelay / 1000, cave->c64_timing * 20); + cave->speed = MAX(65 + cave->ckdelay_current / 1000, cave->c64_timing * 20); break; case GD_SCHEDULING_BD2_PLCK_ATARI: // a really fast engine; timing works like c64 plck. // 40 ms was measured in the construction kit, with delay = 0 - cave->speed = MAX(40 + cave->ckdelay / 1000, cave->c64_timing * 20); + cave->speed = MAX(40 + cave->ckdelay_current / 1000, cave->c64_timing * 20); break; case GD_SCHEDULING_CRDR: if (cave->hammered_walls_reappear) // this made the engine very slow. - cave->ckdelay += 60000; - cave->speed = MAX(130 + cave->ckdelay / 1000, cave->c64_timing * 20); + cave->ckdelay_current += 60000; + cave->speed = MAX(130 + cave->ckdelay_current / 1000, cave->c64_timing * 20); break; case GD_SCHEDULING_MAX: diff --git a/src/game_bd/bd_cave.h b/src/game_bd/bd_cave.h index a499947c..1366b990 100644 --- a/src/game_bd/bd_cave.h +++ b/src/game_bd/bd_cave.h @@ -580,12 +580,12 @@ typedef struct _gd_cave int speed; // Time between game cycles in ms int c64_timing; // a ckdelay value for the level this cave is rendered for - int ckdelay; // ckdelay value for the current iteration + int ckdelay_current; // ckdelay value for the current iteration int ckdelay_extra_for_animation; // bd1 and similar engines had animation bits in cave data, // to set which elements to animate (firefly, butterfly, // amoeba). // animating an element also caused some delay each frame; - // according to my measurements, around 2.6 ms/element. + // according to my measurements, around 2.6 ms/element. int frame; // XXX diff --git a/src/game_bd/bd_caveengine.c b/src/game_bd/bd_caveengine.c index 4a26b171..42f3b3eb 100644 --- a/src/game_bd/bd_caveengine.c +++ b/src/game_bd/bd_caveengine.c @@ -766,7 +766,7 @@ static void creature_explode(GdCave *cave, int x, int y, GdElement explode_to) int xx, yy; // the processing of an explosion took pretty much time: processing 3x3 = 9 elements - cave->ckdelay += 1200; + cave->ckdelay_current += 1200; gd_sound_play(cave, GD_S_EXPLODING, get(cave, x, y), x, y); for (yy = y - 1; yy <= y + 1; yy++) @@ -780,7 +780,7 @@ static void nitro_explode(GdCave *cave, int x, int y) int xx, yy; // the processing of an explosion took pretty much time: processing 3x3 = 9 elements - cave->ckdelay += 1200; + cave->ckdelay_current += 1200; gd_sound_play(cave, GD_S_NITRO_PACK_EXPLODING, get(cave, x, y), x, y); for (yy = y - 1; yy <= y + 1; yy++) @@ -801,7 +801,7 @@ static void voodoo_explode(GdCave *cave, int x, int y) cave->voodoo_touched = TRUE; // the processing of an explosion took pretty much time: processing 3x3 = 9 elements - cave->ckdelay += 1000; + cave->ckdelay_current += 1000; gd_sound_play(cave, GD_S_VOODOO_EXPLODING, get(cave, x, y), x, y); // voodoo explodes to 3x3 steel @@ -836,7 +836,7 @@ static void cell_explode_skip_voodoo(GdCave *cave, const int x, const int y, con static void ghost_explode(GdCave *cave, const int x, const int y) { // the processing of an explosion took pretty much time: processing 5 elements - cave->ckdelay += 650; + cave->ckdelay_current += 650; gd_sound_play(cave, GD_S_GHOST_EXPLODING, get(cave, x, y), x, y); cell_explode_skip_voodoo(cave, x, y, O_GHOST_EXPL_1); @@ -850,7 +850,7 @@ static void ghost_explode(GdCave *cave, const int x, const int y) static void bomb_explode(GdCave *cave, const int x, const int y) { // the processing of an explosion took pretty much time: processing 5 elements - cave->ckdelay += 650; + cave->ckdelay_current += 650; gd_sound_play(cave, GD_S_BOMB_EXPLODING, get(cave, x, y), x, y); cell_explode_skip_voodoo(cave, x, y, O_BOMB_EXPL_1); @@ -1872,7 +1872,7 @@ void gd_cave_iterate(GdCave *cave, GdDirection player_move, boolean player_fire, amoeba_count = 0; amoeba_2_count = 0; found_water = FALSE; - cave->ckdelay = 0; + cave->ckdelay_current = 0; time_decrement_sec = 0; // check whether to scan the first and last line @@ -1902,7 +1902,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)].ckdelay; + cave->ckdelay_current += gd_element_properties[get(cave, x, y)].ckdelay; switch (get(cave, x, y)) { @@ -4255,7 +4255,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)].ckdelay; + cave->ckdelay_current += gd_element_properties[get(cave, x, y)].ckdelay; } }