From 54d0b4c2918e9d7a7dc72ebf6556f2b8b8aad421 Mon Sep 17 00:00:00 2001 From: Mitchell Richters Date: Sun, 15 Nov 2020 21:17:13 +1100 Subject: [PATCH] - buildutils: Replace `sintable[]` use within SW's ripper.cpp with `bsin()`/`bcos()`. --- source/sw/src/ripper.cpp | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/source/sw/src/ripper.cpp b/source/sw/src/ripper.cpp index 0ebea3656..c7647cd9d 100644 --- a/source/sw/src/ripper.cpp +++ b/source/sw/src/ripper.cpp @@ -953,9 +953,9 @@ InitRipperHang(short SpriteNum) tang = NORM_ANGLE(sp->ang + dang); FAFhitscan(sp->x, sp->y, sp->z - SPRITEp_SIZE_Z(sp), sp->sectnum, // Start position - sintable[NORM_ANGLE(tang + 512)], // X vector of 3D ang - sintable[tang], // Y vector of 3D ang - 0, // Z vector of 3D ang + bcos(tang), // X vector of 3D ang + bsin(tang), // Y vector of 3D ang + 0, // Z vector of 3D ang &hitinfo, CLIPMASK_MISSILE); //ASSERT(hitinfo.sect >= 0); @@ -1020,8 +1020,8 @@ DoRipperMoveHang(short SpriteNum) int nx, ny; // Move while jumping - nx = sp->xvel * (int) sintable[NORM_ANGLE(sp->ang + 512)] >> 14; - ny = sp->xvel * (int) sintable[sp->ang] >> 14; + nx = mulscale14(sp->xvel, bcos(sp->ang)); + ny = mulscale14(sp->xvel, bsin(sp->ang)); // if cannot move the sprite if (!move_actor(SpriteNum, nx, ny, 0L)) @@ -1093,7 +1093,7 @@ DoRipperBeginJumpAttack(short SpriteNum) tang = getangle(psp->x - sp->x, psp->y - sp->y); - if (move_sprite(SpriteNum, sintable[NORM_ANGLE(tang+512)] >> 7, sintable[tang] >> 7, + if (move_sprite(SpriteNum, bcos(tang, -7), bsin(tang, -7), 0L, u->ceiling_dist, u->floor_dist, CLIPMASK_ACTOR, ACTORMOVETICS)) sp->ang = NORM_ANGLE((sp->ang + 1024) + (RANDOM_NEG(256, 6) >> 6)); else