diff --git a/source/games/duke/src/actors.cpp b/source/games/duke/src/actors.cpp index 195dc35da..c5901ab9b 100644 --- a/source/games/duke/src/actors.cpp +++ b/source/games/duke/src/actors.cpp @@ -309,7 +309,7 @@ void movecyclers(void) auto sect = c->sector; int shade = c->shade2; - int j = shade + bsin(c->lotag, -10); + int j = shade + int(BobVal(c->lotag) * 16); int cshade = c->shade1; if (j < cshade) j = cshade; @@ -1296,7 +1296,7 @@ void bounce(DDukeActor* actor) void movetongue(DDukeActor *actor, int tongue, int jaw) { - actor->temp_data[0] = bsin(actor->temp_data[1], -9); + actor->temp_data[0] = int(BobVal(actor->temp_data[1]) * 32); actor->temp_data[1] += 32; if (actor->temp_data[1] > 2047) { @@ -4233,7 +4233,7 @@ void handle_se26(DDukeActor* actor) double zvel = actor->vel.Z; actor->vel.X = 2; - DVector2 vect = 2 * actor->spr.angle.ToVector(); // was: (32 * bsin) >> 14 + DVector2 vect = 2 * actor->spr.angle.ToVector(); // was: (32 * b sin) >> 14 actor->spr.shade++; if (actor->spr.shade > 7) diff --git a/source/games/duke/src/actors_d.cpp b/source/games/duke/src/actors_d.cpp index fdbb6e297..0eba74741 100644 --- a/source/games/duke/src/actors_d.cpp +++ b/source/games/duke/src/actors_d.cpp @@ -2217,8 +2217,9 @@ static void greenslime(DDukeActor *actor) actor->temp_data[3] = 1; } - actor->spr.xrepeat = 20 + bsin(actor->temp_data[1], -13); - actor->spr.yrepeat = 15 + bsin(actor->temp_data[1], -13); + int add = int(BobVal(actor->temp_data[1]) * 2); + actor->spr.xrepeat = 20 + add; + actor->spr.yrepeat = 15 + add; actor->spr.pos.XY() = ps[p].pos.XY() + ps[p].angle.ang.ToVector() * 8; return; } diff --git a/source/games/duke/src/animatesprites_d.cpp b/source/games/duke/src/animatesprites_d.cpp index b9d38b142..e4db6c4fb 100644 --- a/source/games/duke/src/animatesprites_d.cpp +++ b/source/games/duke/src/animatesprites_d.cpp @@ -232,7 +232,7 @@ void animatesprites_d(tspriteArray& tsprites, const DVector2& viewVec, DAngle vi t->pos.Z -= 4; break; case CRYSTALAMMO: - t->shade = bsin(PlayClock << 4, -10); + t->shade = int(BobVal(PlayClock << 4) * 16); continue; case VIEWSCREEN: case VIEWSCREEN2: diff --git a/source/games/duke/src/animatesprites_r.cpp b/source/games/duke/src/animatesprites_r.cpp index 079c471c1..09d7c3847 100644 --- a/source/games/duke/src/animatesprites_r.cpp +++ b/source/games/duke/src/animatesprites_r.cpp @@ -226,7 +226,7 @@ void animatesprites_r(tspriteArray& tsprites, const DVector2& viewVec, DAngle vi t->pos.Z -= 4; break; case CRYSTALAMMO: - t->shade = bsin(PlayClock << 4, -10); + t->shade = int(BobVal(PlayClock << 4) * 16); break; case SHRINKSPARK: if (OwnerAc && (OwnerAc->spr.picnum == CHEER || OwnerAc->spr.picnum == CHEERSTAYPUT) && isRRRA()) diff --git a/source/games/duke/src/hudweapon_d.cpp b/source/games/duke/src/hudweapon_d.cpp index d4d10cb86..8a2e48cdf 100644 --- a/source/games/duke/src/hudweapon_d.cpp +++ b/source/games/duke/src/hudweapon_d.cpp @@ -70,9 +70,9 @@ static void displayloogie(player_struct* p, double const interpfrac) for (int i = 0; i < p->numloogs; i++) { - const double a = fabs(bsinf((loogi + i) * 32., -5)); + const double a = fabs(BobVal((loogi + i) * 32.) * 512); const double z = 4096. + ((loogi + i) * 512.); - const double x = -getavel(p->GetPlayerNum()) + bsinf((loogi + i) * 64., -10); + const double x = -getavel(p->GetPlayerNum()) + BobVal((loogi + i) * 64.) * 16; hud_drawsprite((p->loogie[i].X + x), (200 + p->loogie[i].Y - y), z - (i << 8), 256 - a, LOOGIE, 0, 0, 2); } @@ -91,7 +91,7 @@ static bool animatefist(int gs, player_struct* p, double look_anghalf, double lo hud_drawsprite( (-fisti + 222 + plravel), - (looking_arc + 194 + bsinf((6 + fisti) * 128., -9)), + (looking_arc + 194 + BobVal((6 + fisti) * 128.) * 32), clamp(65536. - bcosf(fisti * 64., 2), 40920., 90612.), 0, FIST, gs, fistpal, 2); return true; @@ -236,7 +236,7 @@ void displayweapon_d(int snum, double interpfrac) looking_arc = p->angle.looking_arc(interpfrac); hard_landing *= 8.; - gun_pos -= fabs(p->GetActor()->spr.xrepeat < 32 ? bsinf(weapon_sway * 4., -9) : bsinf(weapon_sway * 0.5, -10)); + gun_pos -= fabs(p->GetActor()->spr.xrepeat < 32 ? BobVal(weapon_sway * 4.) * 32 : BobVal(weapon_sway * 0.5) * 16); gun_pos -= hard_landing; weapon_xoffset = (160)-90;