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

This commit is contained in:
Mitchell Richters 2020-11-15 20:54:59 +11:00 committed by Christoph Oelckers
parent 94bd45569c
commit 512bb29ed9

View file

@ -65,8 +65,8 @@ int MultiClipMove(PLAYERp pp, int z, int floor_dist)
xs = pp->posx; xs = pp->posx;
ys = pp->posy; ys = pp->posy;
xvect = (sop->clipbox_vdist[i] * sintable[NORM_ANGLE(ang + 512)]); xvect = sop->clipbox_vdist[i] * bcos(ang);
yvect = (sop->clipbox_vdist[i] * sintable[ang]); yvect = sop->clipbox_vdist[i] * bsin(ang);
clipmoveboxtracenum = 1; clipmoveboxtracenum = 1;
ret_start = clipmove_old(&xs, &ys, &z, &pp->cursectnum, xvect, yvect, (int)sop->clipbox_dist[i], Z(4), floor_dist, CLIPMASK_PLAYER); ret_start = clipmove_old(&xs, &ys, &z, &pp->cursectnum, xvect, yvect, (int)sop->clipbox_dist[i], Z(4), floor_dist, CLIPMASK_PLAYER);
clipmoveboxtracenum = 3; clipmoveboxtracenum = 3;
@ -77,8 +77,8 @@ int MultiClipMove(PLAYERp pp, int z, int floor_dist)
min_dist = 0; min_dist = 0;
min_ndx = i; min_ndx = i;
// ox is where it should be // ox is where it should be
ox[i] = x[i] = pp->posx + (sop->clipbox_vdist[i] * sintable[NORM_ANGLE(ang + 512)] >> 14); ox[i] = x[i] = pp->posx + mulscale14(sop->clipbox_vdist[i], bcos(ang));
oy[i] = y[i] = pp->posy + (sop->clipbox_vdist[i] * sintable[ang] >> 14); oy[i] = y[i] = pp->posy + mulscale14(sop->clipbox_vdist[i], bsin(ang));
// xs is where it hit // xs is where it hit
x[i] = xs; x[i] = xs;
@ -144,8 +144,8 @@ short MultiClipTurn(PLAYERp pp, short new_ang, int z, int floor_dist)
x = pp->posx; x = pp->posx;
y = pp->posy; y = pp->posy;
xvect = (sop->clipbox_vdist[i] * sintable[NORM_ANGLE(ang + 512)]); xvect = sop->clipbox_vdist[i] * bcos(ang);
yvect = (sop->clipbox_vdist[i] * sintable[ang]); yvect = sop->clipbox_vdist[i] * bsin(ang);
// move the box // move the box
ret = clipmove_old(&x, &y, &z, &cursectnum, xvect, yvect, (int)sop->clipbox_dist[i], Z(4), floor_dist, CLIPMASK_PLAYER); ret = clipmove_old(&x, &y, &z, &cursectnum, xvect, yvect, (int)sop->clipbox_dist[i], Z(4), floor_dist, CLIPMASK_PLAYER);
@ -156,8 +156,8 @@ short MultiClipTurn(PLAYERp pp, short new_ang, int z, int floor_dist)
{ {
// attempt to move a bit when turning against a wall // attempt to move a bit when turning against a wall
//ang = NORM_ANGLE(ang + 1024); //ang = NORM_ANGLE(ang + 1024);
//pp->xvect += 20 * sintable[NORM_ANGLE(ang + 512)]; //pp->xvect += 20 * bcos(ang);
//pp->yvect += 20 * sintable[ang]; //pp->yvect += 20 * bsin(ang);
return false; return false;
} }
} }