- buildutils: Replace sintable[] use within remainder of WHaven's files with bsin()/bcos().

This commit is contained in:
Mitchell Richters 2021-01-01 19:16:29 +11:00
parent 96aa6452ef
commit 449714667b
7 changed files with 21 additions and 21 deletions

View file

@ -362,8 +362,8 @@ void analyzesprites(PLAYER& plr, int dasmoothratio)
SPRITE& tshadow = tsprite[spritesortcnt]; SPRITE& tshadow = tsprite[spritesortcnt];
tshadow = tspr; tshadow = tspr;
int camangle = getangle(plr.x - tshadow.x, plr.y - tshadow.y); int camangle = getangle(plr.x - tshadow.x, plr.y - tshadow.y);
tshadow.x -= mulscale(sintable[(camangle + 512) & 2047], 100, 16); tshadow.x -= mulscale(bcos(camangle), 100, 16);
tshadow.y += mulscale(sintable[(camangle + 1024) & 2047], 100, 16); tshadow.y += mulscale(-bsin(camangle), 100, 16);
tshadow.z = fz + 1; tshadow.z = fz + 1;
tshadow.statnum = 99; tshadow.statnum = 99;

View file

@ -477,7 +477,7 @@ void processinput(int num) {
dist >>= 2; dist >>= 2;
if (dist > 0 && feetoffground <= (plr.height << 8) || onsprite != -1) { if (dist > 0 && feetoffground <= (plr.height << 8) || onsprite != -1) {
oldhoriz = ((dist * sintable[(lockclock << 5) & 2047]) >> 19) >> 2; oldhoriz = ((dist * bsin(lockclock << 5)) >> 19) >> 2;
plr.horizon.addadjustment(oldhoriz); plr.horizon.addadjustment(oldhoriz);
} }
else else

View file

@ -358,11 +358,11 @@ void GameInterface::Ticker()
if (followmode) { if (followmode) {
followa += followang; followa += followang;
followx += (followvel * sintable[(512 + 2048 - followa) & 2047]) >> 10; followx += MulScale(-bsin(followa), followvel, 10);
followy += (followvel * sintable[(512 + 1024 - 512 - followa) & 2047]) >> 10; followy += MulScale(-bcos(followa), followvel, 10);
followx += (followsvel * sintable[(512 + 1024 - 512 - followa) & 2047]) >> 10; followx += MulScale(-bcos(followa), followsvel, 10);
followy -= (followsvel * sintable[(512 + 2048 - followa) & 2047]) >> 10; followy -= MulScale(-bsin(followa), followsvel, 10);
} }
lockclock += TICSPERFRAME; lockclock += TICSPERFRAME;

View file

@ -44,8 +44,8 @@ int hitscan(int xs, int ys, int zs, short sectnum, int vx, int vy, int vz, Hitsc
Point rotatepoint(int xpivot, int ypivot, int x, int y, short daang) { // jfBuild Point rotatepoint(int xpivot, int ypivot, int x, int y, short daang) { // jfBuild
Point rotatepoint; Point rotatepoint;
int dacos = sintable[(daang + 2560) & 2047]; int dacos = bcos(daang);
int dasin = sintable[(daang + 2048) & 2047]; int dasin = bsin(daang);
x -= xpivot; x -= xpivot;
y -= ypivot; y -= ypivot;
rotatepoint.x = dmulscale(x, dacos, -y, dasin, 14) + xpivot; rotatepoint.x = dmulscale(x, dacos, -y, dasin, 14) + xpivot;

View file

@ -398,7 +398,7 @@ void revolvefx() {
void bobbingsector() { void bobbingsector() {
for (int i = 0; i < bobbingsectorcnt; i++) { for (int i = 0; i < bobbingsectorcnt; i++) {
short dasector = bobbingsectorlist[i]; short dasector = bobbingsectorlist[i];
sector[dasector].floorz += (sintable[(lockclock << 4) & 2047] >> 6); sector[dasector].floorz += bsin(lockclock << 4, -6);
} }
} }
@ -663,7 +663,7 @@ void dofx() {
GLRenderer gl = glrender(); GLRenderer gl = glrender();
if (gl != nullptr) { if (gl != nullptr) {
if (player[pyrn].poisoned != 0) { if (player[pyrn].poisoned != 0) {
int tilt = mulscale(sintable[(3 * lockclock) & 2047], 20, 16); int tilt = mulscale(bsin(3 * lockclock), 20, 16);
if (tilt != 0) if (tilt != 0)
gl.setdrunk(tilt); gl.setdrunk(tilt);
} else } else
@ -826,8 +826,8 @@ void makeasplash(int picnum, PLAYER& plr) {
break; break;
} }
movesprite((short) j, ((sintable[(sprite[j].ang + 512) & 2047]) * TICSPERFRAME) << 3, movesprite((short) j, (bcos(sprite[j].ang) * TICSPERFRAME) << 3,
((sintable[sprite[j].ang & 2047]) * TICSPERFRAME) << 3, 0, 4 << 8, 4 << 8, 0); (bsin(sprite[j].ang) * TICSPERFRAME) << 3, 0, 4 << 8, 4 << 8, 0);
} }
void makemonstersplash(int picnum, int i) { void makemonstersplash(int picnum, int i) {
@ -1020,8 +1020,8 @@ void warpfxsprite(int s) {
int daz = (((sprite[j].zvel) * TICSPERFRAME) >> 3); int daz = (((sprite[j].zvel) * TICSPERFRAME) >> 3);
movesprite((short) j, ((sintable[(daang + 512) & 2047]) * TICSPERFRAME) << 3, movesprite((short) j, (bcos(daang) * TICSPERFRAME) << 3,
((sintable[daang & 2047]) * TICSPERFRAME) << 3, daz, 4 << 8, 4 << 8, 1); (bsin(daang) * TICSPERFRAME) << 3, daz, 4 << 8, 4 << 8, 1);
} }
void FadeInit() { void FadeInit() {

View file

@ -247,8 +247,8 @@ void plruse(PLAYER& plr) {
int daz2 = -mulscale16(plr.horizon.horiz.asq16(), 2000); int daz2 = -mulscale16(plr.horizon.horiz.asq16(), 2000);
Hitscan pHitInfo; Hitscan pHitInfo;
hitscan(plr.x, plr.y, plr.z, plr.sector, // Start position hitscan(plr.x, plr.y, plr.z, plr.sector, // Start position
sintable[(daang + 2560) & 2047], // X vector of 3D ang bcos(daang), // X vector of 3D ang
sintable[(daang + 2048) & 2047], // Y vector of 3D ang bsin(daang), // Y vector of 3D ang
daz2, // Z vector of 3D ang daz2, // Z vector of 3D ang
pHitInfo, CLIPMASK1); pHitInfo, CLIPMASK1);
@ -430,8 +430,8 @@ void chunksofmeat(PLAYER& plr, int hitsprite, int hitx, int hity, int hitz, shor
sprite[j].lotag = 512; sprite[j].lotag = 512;
sprite[j].hitag = 0; sprite[j].hitag = 0;
sprite[j].pal = 0; sprite[j].pal = 0;
movesprite((short) j, ((sintable[(sprite[j].ang + 512) & 2047]) * TICSPERFRAME) << 3, movesprite((short) j, (bcos(sprite[j].ang) * TICSPERFRAME) << 3,
((sintable[sprite[j].ang & 2047]) * TICSPERFRAME) << 3, 0, 4 << 8, 4 << 8, 0); (bsin(sprite[j].ang) * TICSPERFRAME) << 3, 0, 4 << 8, 4 << 8, 0);
} }
} }
@ -612,7 +612,7 @@ void dophysics(PLAYER& plr, int goalz, int flyupdn, int v) {
if (flyupdn < 0) { if (flyupdn < 0) {
plr.hvel += (TICSPERFRAME << 7); plr.hvel += (TICSPERFRAME << 7);
} }
plr.hvel += (sintable[(lockclock << 4) & 2047] >> 6); plr.hvel += bsin(lockclock << 4, -6);
plr.fallz = 0; plr.fallz = 0;
} }

View file

@ -938,7 +938,7 @@ void animatetags(int nPlayer) {
#pragma message ("setinterpolation") #pragma message ("setinterpolation")
//game.pInt.setceilinterpolate(dasector, sector[dasector]); //game.pInt.setceilinterpolate(dasector, sector[dasector]);
sector[dasector].floorz = dragfloorz[i] + (sintable[(lockclock << 4) & 2047] >> 3); sector[dasector].floorz = dragfloorz[i] + bsin(lockclock << 4, -3);
if (plr.sector == dasector) { if (plr.sector == dasector) {