- WHaven: Replace all *mulscale*() function calls with ones in m_fixed.h.

This commit is contained in:
Mitchell Richters 2021-01-01 19:30:04 +11:00
parent 24e09055ca
commit e8894eeab0
9 changed files with 28 additions and 28 deletions

View file

@ -198,12 +198,12 @@ void potionpic(PLAYER& plr, int currentpotion, int x, int y, int scale) {
return;
#pragma message("fix potionpic")
#if 0
x = x + mulscale(200, scale, 16);
y = y - mulscale(94, scale, 16);
x = x + MulScale(200, scale, 16);
y = y - MulScale(94, scale, 16);
engine.rotatesprite(x<<16,y<<16,scale,0,SPOTIONBACKPIC,0, 0, 8 | 16, 0, 0, xdim, ydim-1);
engine.rotatesprite((x - mulscale(4, scale, 16))<<16,(y - mulscale(7, scale, 16))<<16,scale,0,SPOTIONARROW+currentpotion,0, 0, 8 | 16, 0, 0, xdim, ydim-1);
engine.rotatesprite((x - MulScale(4, scale, 16))<<16,(y - MulScale(7, scale, 16))<<16,scale,0,SPOTIONARROW+currentpotion,0, 0, 8 | 16, 0, 0, xdim, ydim-1);
x += mulscale(4, scale, 16);
x += MulScale(4, scale, 16);
for(int i = 0; i < MAXPOTIONS; i++) {
if(plr.potion[i] < 0)
plr.potion[i] = 0;
@ -224,15 +224,15 @@ void potionpic(PLAYER& plr, int currentpotion, int x, int y, int scale) {
}
potiontilenum=tilenum;
engine.rotatesprite((x + mulscale(i*20, scale, 16))<<16,(y + mulscale(19, scale, 16))<<16,scale,0,potiontilenum,0, 0, 8 | 16, 0, 0, xdim, ydim-1);
engine.rotatesprite((x + MulScale(i*20, scale, 16))<<16,(y + MulScale(19, scale, 16))<<16,scale,0,potiontilenum,0, 0, 8 | 16, 0, 0, xdim, ydim-1);
char potionbuf[50];
Bitoa(plr.potion[i],potionbuf);
fancyfont((266<<1)+(i*20),394,SPOTIONFONT-26,potionbuf,0);
//game.getFont(3).drawText(x + mulscale(7 +(i*20), scale, 16),y+mulscale(7, scale, 16), potionbuf, scale, 0, 0, TextAlign.Left, 0, false);
//game.getFont(3).drawText(x + MulScale(7 +(i*20), scale, 16),y+MulScale(7, scale, 16), potionbuf, scale, 0, 0, TextAlign.Left, 0, false);
}
else
engine.rotatesprite((x + mulscale(i*20, scale, 16))<<16,(y + mulscale(19, scale, 16))<<16,scale,0,SFLASKBLACK,0, 0, 8 | 16, 0, 0, xdim, ydim-1);
engine.rotatesprite((x + MulScale(i*20, scale, 16))<<16,(y + MulScale(19, scale, 16))<<16,scale,0,SFLASKBLACK,0, 0, 8 | 16, 0, 0, xdim, ydim-1);
}
#endif
}

View file

@ -211,7 +211,7 @@ void aiProcess() {
PLAYER& plr = player[0];
// short daang = plr.angle.ang.asbuild();
// int daz2 = -mulscale16(plr.horizon.horiz.asq16(), 2000);
// int daz2 = -MulScale(plr.horizon.horiz.asq16(), 2000, 16);
// hitscan(plr.x, plr.y, plr.z, plr.sector, // Start position
// bcos(daang), // X vector of 3D ang
// bsin(daang), // Y vector of 3D ang
@ -426,8 +426,8 @@ int aimove(short i) {
if (((zr_florz - oz) >> 4) > tileHeight(sprite[i].picnum) + (sprite[i].yrepeat << 2)
|| (movestate & kHitTypeMask) == kHitWall) {
// changespritesect(i, osect);
// setsprite(i, ox + mulscale((sprite[i].clipdist) << 2, -bcos(sprite[i].ang), 16),
// oy + mulscale((sprite[i].clipdist) << 2, -bsin(sprite[i].ang), 16), oz);
// setsprite(i, ox + MulScale((sprite[i].clipdist) << 2, -bcos(sprite[i].ang), 16),
// oy + MulScale((sprite[i].clipdist) << 2, -bsin(sprite[i].ang), 16), oz);
setsprite(i, ox, oy, oz);

View file

@ -26,10 +26,10 @@ void analyzesprites(PLAYER& plr, int dasmoothratio)
short nAngle = oldLoc.ang;
// interpolate sprite position
x += mulscale(tspr.x - oldLoc.x, dasmoothratio, 16);
y += mulscale(tspr.y - oldLoc.y, dasmoothratio, 16);
z += mulscale(tspr.z - oldLoc.z, dasmoothratio, 16);
nAngle += mulscale(((tspr.ang - oldLoc.ang + 1024) & 2047) - 1024, dasmoothratio, 16);
x += MulScale(tspr.x - oldLoc.x, dasmoothratio, 16);
y += MulScale(tspr.y - oldLoc.y, dasmoothratio, 16);
z += MulScale(tspr.z - oldLoc.z, dasmoothratio, 16);
nAngle += MulScale(((tspr.ang - oldLoc.ang + 1024) & 2047) - 1024, dasmoothratio, 16);
tspr.x = x;
tspr.y = y;
@ -362,8 +362,8 @@ void analyzesprites(PLAYER& plr, int dasmoothratio)
SPRITE& tshadow = tsprite[spritesortcnt];
tshadow = tspr;
int camangle = getangle(plr.x - tshadow.x, plr.y - tshadow.y);
tshadow.x -= mulscale(bcos(camangle), 100, 16);
tshadow.y += mulscale(-bsin(camangle), 100, 16);
tshadow.x -= MulScale(bcos(camangle), 100, 16);
tshadow.y += MulScale(-bsin(camangle), 100, 16);
tshadow.z = fz + 1;
tshadow.statnum = 99;

View file

@ -176,8 +176,8 @@ void GameInterface::GetInput(InputPacket* packet, ControlInfo* const hidInput)
yvel = (yvel / len) * (keymove << 14);
}
lPlayerXVel = fmulscale16(lPlayerXVel + (xvel * k), 0xD000);
lPlayerYVel = fmulscale16(lPlayerYVel + (yvel * k), 0xD000);
lPlayerXVel = MulScaleF(lPlayerXVel + (xvel * k), 0xD000, 16);
lPlayerYVel = MulScaleF(lPlayerYVel + (yvel * k), 0xD000, 16);
if (abs(lPlayerXVel) < 2048 && abs(lPlayerYVel) < 2048)
{

View file

@ -24,9 +24,9 @@ void drawscreen(int num, double dasmoothratio, bool sceneonly)
{
auto& prevloc = gPrevPlayerLoc[num];
cposx = prevloc.x + mulscale16(cposx - prevloc.x, dasmoothratio);
cposy = prevloc.y + mulscale16(cposy - prevloc.y, dasmoothratio);
cposz = prevloc.z + mulscale16(cposz - prevloc.z, dasmoothratio);
cposx = prevloc.x + MulScale(cposx - prevloc.x, dasmoothratio, 16);
cposy = prevloc.y + MulScale(cposy - prevloc.y, dasmoothratio, 16);
cposz = prevloc.z + MulScale(cposz - prevloc.z, dasmoothratio, 16);
if (cl_syncinput)
{

View file

@ -901,7 +901,7 @@ void shootgun(PLAYER& plr, float ang, int guntype) {
Hitscan pHitInfo;
switch (guntype) {
case 0:
daz2 = -mulscale16(plr.horizon.horiz.asq16(), 2000);
daz2 = -MulScale(plr.horizon.horiz.asq16(), 2000, 16);
hitscan(plr.x, plr.y, plr.z, plr.sector, // Start position
bcos(daang), // X vector of 3D ang
@ -1673,7 +1673,7 @@ void shootgun(PLAYER& plr, float ang, int guntype) {
}
break;
case 1: //bow's arrow
daz2 = -mulscale16(plr.horizon.horiz.asq16(), 2000);
daz2 = -MulScale(plr.horizon.horiz.asq16(), 2000, 16);
hitscan(plr.x, plr.y, plr.z, plr.sector, // Start position
bcos(daang), // X vector of 3D ang
@ -1887,7 +1887,7 @@ void shootgun(PLAYER& plr, float ang, int guntype) {
break;
case 7: // KNOCKSPELL
{
daz2 = -mulscale16(plr.horizon.horiz.asq16(), 2000);
daz2 = -MulScale(plr.horizon.horiz.asq16(), 2000, 16);
Neartag ntag;
hitscan(plr.x, plr.y, plr.z, plr.sector, // Start position

View file

@ -48,8 +48,8 @@ Point rotatepoint(int xpivot, int ypivot, int x, int y, short daang) { // jfBuil
int dasin = bsin(daang);
x -= xpivot;
y -= ypivot;
rotatepoint.x = dmulscale(x, dacos, -y, dasin, 14) + xpivot;
rotatepoint.y = dmulscale(y, dacos, x, dasin, 14) + ypivot;
rotatepoint.x = DMulScale(x, dacos, -y, dasin, 14) + xpivot;
rotatepoint.y = DMulScale(y, dacos, x, dasin, 14) + ypivot;
return rotatepoint;
}

View file

@ -663,7 +663,7 @@ void dofx() {
GLRenderer gl = glrender();
if (gl != nullptr) {
if (player[pyrn].poisoned != 0) {
int tilt = mulscale(bsin(3 * lockclock), 20, 16);
int tilt = MulScale(bsin(3 * lockclock), 20, 16);
if (tilt != 0)
gl.setdrunk(tilt);
} else

View file

@ -244,7 +244,7 @@ void plruse(PLAYER& plr) {
operatesector(plr, nt.tagsector);
} else {
short daang = plr.angle.ang.asbuild();
int daz2 = -mulscale16(plr.horizon.horiz.asq16(), 2000);
int daz2 = -MulScale(plr.horizon.horiz.asq16(), 2000, 16);
Hitscan pHitInfo;
hitscan(plr.x, plr.y, plr.z, plr.sector, // Start position
bcos(daang), // X vector of 3D ang