From: Holger Schemel Date: Tue, 17 Sep 2024 17:58:03 +0000 (+0200) Subject: minor changes X-Git-Tag: 4.4.0.0-test-4~215 X-Git-Url: https://git.artsoft.org/?a=commitdiff_plain;h=a380c13fed8c2d8358a5121a18b2ad00120d7d86;p=rocksndiamonds.git minor changes --- diff --git a/src/game_bd/bd_cave.c b/src/game_bd/bd_cave.c index 6c87444b..2b2023c2 100644 --- a/src/game_bd/bd_cave.c +++ b/src/game_bd/bd_cave.c @@ -1829,11 +1829,18 @@ void gd_unscan_cave(GdCave *cave) void gd_update_scheduling_cave_speed(GdCave *cave) { - // update timing calculated by iterating and counting elements which were slow to process on c64 + // SCHEDULING + + // update timing calculated by iterating and counting elements which were slow to process on c64. + // some caves were delay loop based. + // some had proper timing routine - but if the cave was too complex, + // it ran slower than the time requested. + // this is were MAX() is used, to select the slower. + switch (cave->scheduling) { case GD_SCHEDULING_MILLISECONDS: - // cave->speed already contains the milliseconds value, do not touch it + // speed already contains the milliseconds value, do not touch it break; case GD_SCHEDULING_BD1: @@ -1856,12 +1863,12 @@ void gd_update_scheduling_cave_speed(GdCave *cave) if (!cave->intermission) { // non-intermissions - cave->speed = (74 + 3.2 * cave->ckdelay + (cave->ckdelay_current) / 1000); + cave->speed = (74 + 3.2 * cave->ckdelay + cave->ckdelay_current / 1000); } else { // for intermissions - cave->speed = (65 + 2.88 * cave->ckdelay + (cave->ckdelay_current) / 1000); + cave->speed = (65 + 2.88 * cave->ckdelay + cave->ckdelay_current / 1000); } break; @@ -1872,7 +1879,7 @@ void gd_update_scheduling_cave_speed(GdCave *cave) break; case GD_SCHEDULING_PLCK: - // 65 is totally empty cave in construction kit, with delay = 0) + // 65 is totally empty cave in construction kit, with delay = 0 cave->speed = MAX(65 + cave->ckdelay_current / 1000, cave->ckdelay * 20); break; @@ -1889,6 +1896,7 @@ void gd_update_scheduling_cave_speed(GdCave *cave) break; case GD_SCHEDULING_MAX: + // to avoid compiler warning break; } } diff --git a/src/game_bd/bd_caveobject.c b/src/game_bd/bd_caveobject.c index a07a91c6..23beaf22 100644 --- a/src/game_bd/bd_caveobject.c +++ b/src/game_bd/bd_caveobject.c @@ -1561,7 +1561,9 @@ GdCave *gd_cave_new_rendered(const GdCave *data, const int level, const unsigned // check if we use c64 ckdelay or milliseconds for timing if (cave->scheduling == GD_SCHEDULING_MILLISECONDS) + { cave->speed = data->level_speed[level]; // exact timing + } else { // delay loop based timing... set something for first iteration,