{
// 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;
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:
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
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++)
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++)
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
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);
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);
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
}
// 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))
{
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;
}
}