- buildutils: Replace sintable[] use within SW's coolg.cpp with bsin()/bcos().

This commit is contained in:
Mitchell Richters 2020-11-15 20:34:08 +11:00 committed by Christoph Oelckers
parent 4192416268
commit c2c49bd0b9

View file

@ -697,7 +697,7 @@ int DoCoolgMatchPlayerZ(short SpriteNum)
u->sz = max(u->sz, hiz + u->ceiling_dist); u->sz = max(u->sz, hiz + u->ceiling_dist);
u->Counter = (u->Counter + (ACTORMOVETICS<<3)) & 2047; u->Counter = (u->Counter + (ACTORMOVETICS<<3)) & 2047;
sp->z = u->sz + ((COOLG_BOB_AMT * (int)sintable[u->Counter]) >> 14); sp->z = u->sz + mulscale14(COOLG_BOB_AMT, bsin(u->Counter));
bound = u->hiz + u->ceiling_dist + COOLG_BOB_AMT; bound = u->hiz + u->ceiling_dist + COOLG_BOB_AMT;
if (sp->z < bound) if (sp->z < bound)
@ -751,8 +751,8 @@ int DoCoolgCircle(short SpriteNum)
sp->ang = NORM_ANGLE(sp->ang + u->Counter2); sp->ang = NORM_ANGLE(sp->ang + u->Counter2);
nx = sp->xvel * (int) sintable[NORM_ANGLE(sp->ang + 512)] >> 14; nx = mulscale14(sp->xvel, bcos(sp->ang));
ny = sp->xvel * (int) sintable[sp->ang] >> 14; ny = mulscale14(sp->xvel, bsin(sp->ang));
if (!move_actor(SpriteNum, nx, ny, 0L)) if (!move_actor(SpriteNum, nx, ny, 0L))
{ {
@ -812,8 +812,8 @@ DoCoolgDeath(short SpriteNum)
DoActorSlide(SpriteNum); DoActorSlide(SpriteNum);
// slide while falling // slide while falling
nx = sp->xvel * (int) sintable[NORM_ANGLE(sp->ang + 512)] >> 14; nx = mulscale14(sp->xvel, bcos(sp->ang));
ny = sp->xvel * (int) sintable[sp->ang] >> 14; ny = mulscale14(sp->xvel, bsin(sp->ang));
u->ret = move_sprite(SpriteNum, nx, ny, 0L, u->ceiling_dist, u->floor_dist, CLIPMASK_MISSILE, ACTORMOVETICS); u->ret = move_sprite(SpriteNum, nx, ny, 0L, u->ceiling_dist, u->floor_dist, CLIPMASK_MISSILE, ACTORMOVETICS);
DoFindGroundPoint(SpriteNum); DoFindGroundPoint(SpriteNum);