diff --git a/source/duke3d/src/player.cpp b/source/duke3d/src/player.cpp index bf770721f..ea34b60f7 100644 --- a/source/duke3d/src/player.cpp +++ b/source/duke3d/src/player.cpp @@ -268,7 +268,7 @@ static int A_FindTargetSprite(const spritetype *pSprite, int projAng, int projec if ((d1.y * vd.x <= d1.x * vd.y) && (d2.y * vd.x >= d2.x * vd.y)) { - int const spriteDist = mulscale(d3.x, vd.x, 14) + mulscale(d3.y, vd.y, 14); + int const spriteDist = mulscale14(d3.x, vd.x) + mulscale14(d3.y, vd.y); if (spriteDist > 512 && spriteDist < lastDist) { @@ -1446,7 +1446,7 @@ static int32_t A_ShootHardcoded(int spriteNum, int projecTile, int shootAng, vec = Gv_GetVarByLabel("STICKYBOMB_LIFETIME_VAR", NAM_GRENADE_LIFETIME_VAR, g_player[playerNum].ps->i, playerNum); #endif // set timer. blows up when at zero.... - actor[spawnedSprite].t_data[7] = lLifetime + mulscale(krand(), lLifetimeVar, 14) - lLifetimeVar; + actor[spawnedSprite].t_data[7] = lLifetime + mulscale14(krand(), lLifetimeVar) - lLifetimeVar; // TIMER_CONTROL actor[spawnedSprite].t_data[6] = 1; } @@ -4012,7 +4012,7 @@ static void P_ProcessWeapon(int playerNum) int pipeLifeVariance = Gv_GetVarByLabel("GRENADE_LIFETIME_VAR", NAM_GRENADE_LIFETIME_VAR, -1, playerNum); #endif actor[pipeSpriteNum].t_data[7]= pipeLifeTime - + mulscale(krand(),pipeLifeVariance, 14) + + mulscale14(krand(), pipeLifeVariance) - pipeLifeVariance; // TIMER_CONTROL actor[pipeSpriteNum].t_data[6]=1; diff --git a/source/duke3d/src/screens.cpp b/source/duke3d/src/screens.cpp index 1be728988..bac9547a2 100644 --- a/source/duke3d/src/screens.cpp +++ b/source/duke3d/src/screens.cpp @@ -581,8 +581,8 @@ static void G_DrawOverheadMap(int32_t cposx, int32_t cposy, int32_t czoom, int16 oy = 0; daang = 0; } - x1 = mulscale(ox, xvect, 16) - mulscale(oy, yvect, 16); - y1 = mulscale(oy, xvect2, 16) + mulscale(ox, yvect2, 16); + x1 = mulscale16(ox, xvect) - mulscale16(oy, yvect); + y1 = mulscale16(oy, xvect2) + mulscale16(ox, yvect2); if (p == screenpeek || GTFLAGS(GAMETYPE_OTHERPLAYERSINMAP)) { @@ -592,7 +592,7 @@ static void G_DrawOverheadMap(int32_t cposx, int32_t cposy, int32_t czoom, int16 i = APLAYERTOP; j = klabs(g_player[p].ps->truefz-g_player[p].ps->pos.z)>>8; - j = mulscale(czoom*(sprite[g_player[p].ps->i].yrepeat+j), yxaspect, 16); + j = mulscale16(czoom*(sprite[g_player[p].ps->i].yrepeat+j), yxaspect); if (j < 22000) j = 22000; else if (j >(65536<<1)) j = (65536<<1); diff --git a/source/sw/src/draw.cpp b/source/sw/src/draw.cpp index 751d2e434..342df29de 100644 --- a/source/sw/src/draw.cpp +++ b/source/sw/src/draw.cpp @@ -737,9 +737,9 @@ analyzesprites(int viewx, int viewy, int viewz, SWBOOL mirror) { if (tsp->statnum <= STAT_SKIP4_INTERP_END) { - tsp->x = tu->ox + mulscale(tsp->x - tu->ox, smr4, 18); - tsp->y = tu->oy + mulscale(tsp->y - tu->oy, smr4, 18); - tsp->z = tu->oz + mulscale(tsp->z - tu->oz, smr4, 18); + tsp->x = tu->ox + mulscale18(tsp->x - tu->ox, smr4); + tsp->y = tu->oy + mulscale18(tsp->y - tu->oy, smr4); + tsp->z = tu->oz + mulscale18(tsp->z - tu->oz, smr4); } } @@ -747,9 +747,9 @@ analyzesprites(int viewx, int viewy, int viewz, SWBOOL mirror) { if (tsp->statnum <= STAT_SKIP2_INTERP_END) { - tsp->x = tu->ox + mulscale(tsp->x - tu->ox, smr2, 17); - tsp->y = tu->oy + mulscale(tsp->y - tu->oy, smr2, 17); - tsp->z = tu->oz + mulscale(tsp->z - tu->oz, smr2, 17); + tsp->x = tu->ox + mulscale17(tsp->x - tu->ox, smr2); + tsp->y = tu->oy + mulscale17(tsp->y - tu->oy, smr2); + tsp->z = tu->oz + mulscale17(tsp->z - tu->oz, smr2); } } } @@ -2328,11 +2328,11 @@ drawscreen(PLAYERp pp) else camerapp = pp; - tx = camerapp->oposx + mulscale(camerapp->posx - camerapp->oposx, smoothratio, 16); - ty = camerapp->oposy + mulscale(camerapp->posy - camerapp->oposy, smoothratio, 16); - tz = camerapp->oposz + mulscale(camerapp->posz - camerapp->oposz, smoothratio, 16); - tang = camerapp->oang + mulscale(((camerapp->pang + 1024 - camerapp->oang) & 2047) - 1024, smoothratio, 16); - thoriz = camerapp->ohoriz + mulscale(camerapp->horiz - camerapp->ohoriz, smoothratio, 16); + tx = camerapp->oposx + mulscale16(camerapp->posx - camerapp->oposx, smoothratio); + ty = camerapp->oposy + mulscale16(camerapp->posy - camerapp->oposy, smoothratio); + tz = camerapp->oposz + mulscale16(camerapp->posz - camerapp->oposz, smoothratio); + tang = camerapp->oang + mulscale16(((camerapp->pang + 1024 - camerapp->oang) & 2047) - 1024, smoothratio); + thoriz = camerapp->ohoriz + mulscale16(camerapp->horiz - camerapp->ohoriz, smoothratio); tsectnum = camerapp->cursectnum; //ASSERT(tsectnum >= 0 && tsectnum <= MAXSECTORS); diff --git a/source/sw/src/game.cpp b/source/sw/src/game.cpp index 009196ea4..02eb62644 100644 --- a/source/sw/src/game.cpp +++ b/source/sw/src/game.cpp @@ -5247,11 +5247,11 @@ getinput(SW_PACKET *loc) if (angvel > MAXANGVEL) angvel = MAXANGVEL; - momx = mulscale(vel, sintable[NORM_ANGLE(newpp->pang + 512)], 9); - momy = mulscale(vel, sintable[NORM_ANGLE(newpp->pang)], 9); + momx = mulscale9(vel, sintable[NORM_ANGLE(newpp->pang + 512)]); + momy = mulscale9(vel, sintable[NORM_ANGLE(newpp->pang)]); - momx += mulscale(svel, sintable[NORM_ANGLE(newpp->pang)], 9); - momy += mulscale(svel, sintable[NORM_ANGLE(newpp->pang + 1536)], 9); + momx += mulscale9(svel, sintable[NORM_ANGLE(newpp->pang)]); + momy += mulscale9(svel, sintable[NORM_ANGLE(newpp->pang + 1536)]); loc->vel = momx; loc->svel = momy; @@ -5515,8 +5515,8 @@ void drawoverheadmap(int cposx, int cposy, int czoom, short cang) xvect = sintable[(2048 - cang) & 2047] * czoom; yvect = sintable[(1536 - cang) & 2047] * czoom; - xvect2 = mulscale(xvect, yxaspect, 16); - yvect2 = mulscale(yvect, yxaspect, 16); + xvect2 = mulscale16(xvect, yxaspect); + yvect2 = mulscale16(yvect, yxaspect); // Draw red lines for (i = 0; i < numsectors; i++) @@ -5562,14 +5562,14 @@ void drawoverheadmap(int cposx, int cposy, int czoom, short cang) ox = wal->x - cposx; oy = wal->y - cposy; - x1 = mulscale(ox, xvect, 16) - mulscale(oy, yvect, 16); - y1 = mulscale(oy, xvect2, 16) + mulscale(ox, yvect2, 16); + x1 = mulscale16(ox, xvect) - mulscale16(oy, yvect); + y1 = mulscale16(oy, xvect2) + mulscale16(ox, yvect2); wal2 = &wall[wal->point2]; ox = wal2->x - cposx; oy = wal2->y - cposy; - x2 = mulscale(ox, xvect, 16) - mulscale(oy, yvect, 16); - y2 = mulscale(oy, xvect2, 16) + mulscale(ox, yvect2, 16); + x2 = mulscale16(ox, xvect) - mulscale16(oy, yvect); + y2 = mulscale16(oy, xvect2) + mulscale16(ox, yvect2); drawline256(x1 + (xdim << 11), y1 + (ydim << 11), x2 + (xdim << 11), y2 + (ydim << 11), col); } @@ -5619,15 +5619,15 @@ SHOWSPRITE: { ox = sprx - cposx; oy = spry - cposy; - x1 = mulscale(ox, xvect, 16) - mulscale(oy, yvect, 16); - y1 = mulscale(oy, xvect2, 16) + mulscale(ox, yvect2, 16); + x1 = mulscale16(ox, xvect) - mulscale16(oy, yvect); + y1 = mulscale16(oy, xvect2) + mulscale16(ox, yvect2); if (dimensionmode == 5 && (gNet.MultiGameType != MULTI_GAME_COMMBAT || j == Player[screenpeek].PlayerSprite)) { ox = (sintable[(spr->ang + 512) & 2047] >> 7); oy = (sintable[(spr->ang) & 2047] >> 7); - x2 = mulscale(ox, xvect, 16) - mulscale(oy, yvect, 16); - y2 = mulscale(oy, xvect, 16) + mulscale(ox, yvect, 16); + x2 = mulscale16(ox, xvect) - mulscale16(oy, yvect); + y2 = mulscale16(oy, xvect) + mulscale16(ox, yvect); if (j == Player[screenpeek].PlayerSprite) { @@ -5635,8 +5635,8 @@ SHOWSPRITE: y2 = -(czoom << 5); } - x3 = mulscale(x2, yxaspect, 16); - y3 = mulscale(y2, yxaspect, 16); + x3 = mulscale16(x2, yxaspect); + y3 = mulscale16(y2, yxaspect); drawline256(x1 - x2 + (xdim << 11), y1 - y3 + (ydim << 11), x1 + x2 + (xdim << 11), y1 + y3 + (ydim << 11), col); @@ -5664,10 +5664,10 @@ SHOWSPRITE: if (sprisplayer) { if (gNet.MultiGameType != MULTI_GAME_COMMBAT || j == Player[screenpeek].PlayerSprite) - rotatesprite((x1 << 4) + (xdim << 15), (y1 << 4) + (ydim << 15), mulscale(czoom * (spr->yrepeat), yxaspect, 16), daang, 1196+pspr_ndx[myconnectindex], spr->shade, spr->pal, (spr->cstat & 2) >> 1, windowxy1.x, windowxy1.y, windowxy2.x, windowxy2.y); + rotatesprite((x1 << 4) + (xdim << 15), (y1 << 4) + (ydim << 15), mulscale16(czoom * (spr->yrepeat), yxaspect), daang, 1196+pspr_ndx[myconnectindex], spr->shade, spr->pal, (spr->cstat & 2) >> 1, windowxy1.x, windowxy1.y, windowxy2.x, windowxy2.y); } else - rotatesprite((x1 << 4) + (xdim << 15), (y1 << 4) + (ydim << 15), mulscale(czoom * (spr->yrepeat), yxaspect, 16), daang, spr->picnum, spr->shade, spr->pal, (spr->cstat & 2) >> 1, windowxy1.x, windowxy1.y, windowxy2.x, windowxy2.y); + rotatesprite((x1 << 4) + (xdim << 15), (y1 << 4) + (ydim << 15), mulscale16(czoom * (spr->yrepeat), yxaspect), daang, spr->picnum, spr->shade, spr->pal, (spr->cstat & 2) >> 1, windowxy1.x, windowxy1.y, windowxy2.x, windowxy2.y); } } } @@ -5685,20 +5685,20 @@ SHOWSPRITE: day = sintable[(k + 1536) & 2047] * l; l = tilesiz[tilenum].x; k = (l >> 1) + xoff; - x1 -= mulscale(dax, k, 16); - x2 = x1 + mulscale(dax, l, 16); - y1 -= mulscale(day, k, 16); - y2 = y1 + mulscale(day, l, 16); + x1 -= mulscale16(dax, k); + x2 = x1 + mulscale16(dax, l); + y1 -= mulscale16(day, k); + y2 = y1 + mulscale16(day, l); ox = x1 - cposx; oy = y1 - cposy; - x1 = mulscale(ox, xvect, 16) - mulscale(oy, yvect, 16); - y1 = mulscale(oy, xvect2, 16) + mulscale(ox, yvect2, 16); + x1 = mulscale16(ox, xvect) - mulscale16(oy, yvect); + y1 = mulscale16(oy, xvect2) + mulscale16(ox, yvect2); ox = x2 - cposx; oy = y2 - cposy; - x2 = mulscale(ox, xvect, 16) - mulscale(oy, yvect, 16); - y2 = mulscale(oy, xvect2, 16) + mulscale(ox, yvect2, 16); + x2 = mulscale16(ox, xvect) - mulscale16(oy, yvect); + y2 = mulscale16(oy, xvect2) + mulscale16(ox, yvect2); drawline256(x1 + (xdim << 11), y1 + (ydim << 11), x2 + (xdim << 11), y2 + (ydim << 11), col); @@ -5725,38 +5725,38 @@ SHOWSPRITE: dax = ((xspan >> 1) + xoff) * xrepeat; day = ((yspan >> 1) + yoff) * yrepeat; - x1 = sprx + mulscale(sinang, dax, 16) + mulscale(cosang, day, 16); - y1 = spry + mulscale(sinang, day, 16) - mulscale(cosang, dax, 16); + x1 = sprx + mulscale16(sinang, dax) + mulscale16(cosang, day); + y1 = spry + mulscale16(sinang, day) - mulscale16(cosang, dax); l = xspan * xrepeat; - x2 = x1 - mulscale(sinang, l, 16); - y2 = y1 + mulscale(cosang, l, 16); + x2 = x1 - mulscale16(sinang, l); + y2 = y1 + mulscale16(cosang, l); l = yspan * yrepeat; - k = -mulscale(cosang, l, 16); + k = -mulscale16(cosang, l); x3 = x2 + k; x4 = x1 + k; - k = -mulscale(sinang, l, 16); + k = -mulscale16(sinang, l); y3 = y2 + k; y4 = y1 + k; ox = x1 - cposx; oy = y1 - cposy; - x1 = mulscale(ox, xvect, 16) - mulscale(oy, yvect, 16); - y1 = mulscale(oy, xvect2, 16) + mulscale(ox, yvect2, 16); + x1 = mulscale16(ox, xvect) - mulscale16(oy, yvect); + y1 = mulscale16(oy, xvect2) + mulscale16(ox, yvect2); ox = x2 - cposx; oy = y2 - cposy; - x2 = mulscale(ox, xvect, 16) - mulscale(oy, yvect, 16); - y2 = mulscale(oy, xvect2, 16) + mulscale(ox, yvect2, 16); + x2 = mulscale16(ox, xvect) - mulscale16(oy, yvect); + y2 = mulscale16(oy, xvect2) + mulscale16(ox, yvect2); ox = x3 - cposx; oy = y3 - cposy; - x3 = mulscale(ox, xvect, 16) - mulscale(oy, yvect, 16); - y3 = mulscale(oy, xvect2, 16) + mulscale(ox, yvect2, 16); + x3 = mulscale16(ox, xvect) - mulscale16(oy, yvect); + y3 = mulscale16(oy, xvect2) + mulscale16(ox, yvect2); ox = x4 - cposx; oy = y4 - cposy; - x4 = mulscale(ox, xvect, 16) - mulscale(oy, yvect, 16); - y4 = mulscale(oy, xvect2, 16) + mulscale(ox, yvect2, 16); + x4 = mulscale16(ox, xvect) - mulscale16(oy, yvect); + y4 = mulscale16(oy, xvect2) + mulscale16(ox, yvect2); drawline256(x1 + (xdim << 11), y1 + (ydim << 11), x2 + (xdim << 11), y2 + (ydim << 11), col); @@ -5796,14 +5796,14 @@ SHOWSPRITE: ox = wal->x - cposx; oy = wal->y - cposy; - x1 = mulscale(ox, xvect, 16) - mulscale(oy, yvect, 16); - y1 = mulscale(oy, xvect2, 16) + mulscale(ox, yvect2, 16); + x1 = mulscale16(ox, xvect) - mulscale16(oy, yvect); + y1 = mulscale16(oy, xvect2) + mulscale16(ox, yvect2); wal2 = &wall[wal->point2]; ox = wal2->x - cposx; oy = wal2->y - cposy; - x2 = mulscale(ox, xvect, 16) - mulscale(oy, yvect, 16); - y2 = mulscale(oy, xvect2, 16) + mulscale(ox, yvect2, 16); + x2 = mulscale16(ox, xvect) - mulscale16(oy, yvect); + y2 = mulscale16(oy, xvect2) + mulscale16(ox, yvect2); drawline256(x1 + (xdim << 11), y1 + (ydim << 11), x2 + (xdim << 11), y2 + (ydim << 11), 24); } diff --git a/source/sw/src/game.h b/source/sw/src/game.h index 5450a3834..f2d0b7f18 100644 --- a/source/sw/src/game.h +++ b/source/sw/src/game.h @@ -494,8 +494,8 @@ int StdRandomRange(int range); // two vectors // can determin direction -#define DOT_PRODUCT_2D(x1,y1,x2,y2) (mulscale((x1),(x2),16) + mulscale((y1),(y2),16)) -#define DOT_PRODUCT_3D(x1,y1,z1,x2,y2,z2) (mulscale((x1),(x2),16) + mulscale((y1),(y2),16) + mulscale((z1),(z2),16)) +#define DOT_PRODUCT_2D(x1,y1,x2,y2) (mulscale16((x1), (x2)) + mulscale16((y1), (y2))) +#define DOT_PRODUCT_3D(x1,y1,z1,x2,y2,z2) (mulscale16((x1), (x2)) + mulscale16((y1), (y2)) + mulscale16((z1), (z2))) // just determine if the player is moving #define PLAYER_MOVING(pp) ((pp)->xvect|(pp)->yvect) diff --git a/source/sw/src/jsector.cpp b/source/sw/src/jsector.cpp index 8b9c07e4a..0c810e620 100644 --- a/source/sw/src/jsector.cpp +++ b/source/sw/src/jsector.cpp @@ -689,10 +689,10 @@ JS_DrawMirrors(PLAYERp pp, int tx, int ty, int tz, short tpang, int tphoriz) mirrorinview = TRUE; -// tx = pp->oposx + mulscale(pp->posx - pp->oposx, smoothratio, 16); -// ty = pp->oposy + mulscale(pp->posy - pp->oposy, smoothratio, 16); -// tz = pp->oposz + mulscale(pp->posz - pp->oposz, smoothratio, 16); -// tpang = pp->oang + mulscale(((pp->pang + 1024 - pp->oang) & 2047) - 1024, smoothratio, 16); +// tx = pp->oposx + mulscale16(pp->posx - pp->oposx, smoothratio); +// ty = pp->oposy + mulscale16(pp->posy - pp->oposy, smoothratio); +// tz = pp->oposz + mulscale16(pp->posz - pp->oposz, smoothratio); +// tpang = pp->oang + mulscale16(((pp->pang + 1024 - pp->oang) & 2047) - 1024, smoothratio); dist = 0x7fffffff; diff --git a/source/sw/src/player.cpp b/source/sw/src/player.cpp index 7b0d08087..41f3ed8d5 100644 --- a/source/sw/src/player.cpp +++ b/source/sw/src/player.cpp @@ -2310,8 +2310,8 @@ DoPlayerSlide(PLAYERp pp) if (pp->sop) return; - pp->slide_xvect = mulscale(pp->slide_xvect, PLAYER_SLIDE_FRICTION,16); - pp->slide_yvect = mulscale(pp->slide_yvect, PLAYER_SLIDE_FRICTION,16); + pp->slide_xvect = mulscale16(pp->slide_xvect, PLAYER_SLIDE_FRICTION); + pp->slide_yvect = mulscale16(pp->slide_yvect, PLAYER_SLIDE_FRICTION); if (labs(pp->slide_xvect) < 12800 && labs(pp->slide_yvect) < 12800) pp->slide_xvect = pp->slide_yvect = 0; @@ -2507,11 +2507,11 @@ MoveScrollMode2D(PLAYERp pp) if (mfsvel > MAXSVEL) mfsvel = MAXSVEL; - momx = mulscale(mfvel, sintable[NORM_ANGLE(pp->pang + 512)], 9); - momy = mulscale(mfvel, sintable[NORM_ANGLE(pp->pang)], 9); + momx = mulscale9(mfvel, sintable[NORM_ANGLE(pp->pang + 512)]); + momy = mulscale9(mfvel, sintable[NORM_ANGLE(pp->pang)]); - momx += mulscale(mfsvel, sintable[NORM_ANGLE(pp->pang)], 9); - momy += mulscale(mfsvel, sintable[NORM_ANGLE(pp->pang + 1536)], 9); + momx += mulscale9(mfsvel, sintable[NORM_ANGLE(pp->pang)]); + momy += mulscale9(mfsvel, sintable[NORM_ANGLE(pp->pang + 1536)]); //mfvel = momx; //mfsvel = momy; @@ -2611,8 +2611,8 @@ DoPlayerMove(PLAYERp pp) friction -= pp->WadeDepth * 100L; } - pp->xvect = mulscale(pp->xvect,friction,16); - pp->yvect = mulscale(pp->yvect,friction,16); + pp->xvect = mulscale16(pp->xvect, friction); + pp->yvect = mulscale16(pp->yvect, friction); if (TEST(pp->Flags, PF_FLYING)) { @@ -2875,8 +2875,8 @@ DoPlayerMoveBoat(PLAYERp pp) pp->xvect += ((pp->input.vel*synctics*2)<<6); pp->yvect += ((pp->input.svel*synctics*2)<<6); - pp->xvect = mulscale(pp->xvect,BOAT_FRICTION,16); - pp->yvect = mulscale(pp->yvect,BOAT_FRICTION,16); + pp->xvect = mulscale16(pp->xvect, BOAT_FRICTION); + pp->yvect = mulscale16(pp->yvect, BOAT_FRICTION); // does sliding/momentum pp->xvect = (pp->xvect + (pp->oxvect*5))/6; @@ -3280,8 +3280,8 @@ DoPlayerMoveTank(PLAYERp pp) pp->xvect += ((pp->input.vel*synctics*2)<<6); pp->yvect += ((pp->input.svel*synctics*2)<<6); - pp->xvect = mulscale(pp->xvect,TANK_FRICTION,16); - pp->yvect = mulscale(pp->yvect,TANK_FRICTION,16); + pp->xvect = mulscale16(pp->xvect, TANK_FRICTION); + pp->yvect = mulscale16(pp->yvect, TANK_FRICTION); pp->xvect = (pp->xvect + (pp->oxvect*1))/2; pp->yvect = (pp->yvect + (pp->oyvect*1))/2; @@ -3880,8 +3880,8 @@ DoPlayerClimb(PLAYERp pp) pp->xvect += ((pp->input.vel*synctics*2)<<6); pp->yvect += ((pp->input.svel*synctics*2)<<6); - pp->xvect = mulscale(pp->xvect,PLAYER_CLIMB_FRICTION,16); - pp->yvect = mulscale(pp->yvect,PLAYER_CLIMB_FRICTION,16); + pp->xvect = mulscale16(pp->xvect, PLAYER_CLIMB_FRICTION); + pp->yvect = mulscale16(pp->yvect, PLAYER_CLIMB_FRICTION); if (labs(pp->xvect) < 12800 && labs(pp->yvect) < 12800) pp->xvect = pp->yvect = 0; diff --git a/source/sw/src/sprite.cpp b/source/sw/src/sprite.cpp index eecf4d6a4..a271f1638 100644 --- a/source/sw/src/sprite.cpp +++ b/source/sw/src/sprite.cpp @@ -4783,13 +4783,13 @@ getzrangepoint(int x, int y, int z, short sectnum, x1 = spr->x + dmulscale16(sinang, dax, cosang, day) - x; y1 = spr->y + dmulscale16(sinang, day, -cosang, dax) - y; l = xspan * spr->xrepeat; - x2 = x1 - mulscale(sinang, l, 16); - y2 = y1 + mulscale(cosang, l, 16); + x2 = x1 - mulscale16(sinang, l); + y2 = y1 + mulscale16(cosang, l); l = yspan * spr->yrepeat; - k = -mulscale(cosang, l, 16); + k = -mulscale16(cosang, l); x3 = x2 + k; x4 = x1 + k; - k = -mulscale(sinang, l, 16); + k = -mulscale16(sinang, l); y3 = y2 + k; y4 = y1 + k; diff --git a/source/sw/src/weapon.cpp b/source/sw/src/weapon.cpp index 5715799dd..e87004ca4 100644 --- a/source/sw/src/weapon.cpp +++ b/source/sw/src/weapon.cpp @@ -16208,12 +16208,12 @@ WallSpriteInsideSprite(SPRITEp wsp, SPRITEp sp) mid_dist = DIV2(xsiz) + xoff; // starting from the center find the first point - x1 -= mulscale(dax, mid_dist, 16); + x1 -= mulscale16(dax, mid_dist); // starting from the first point find the end point - x2 = x1 + mulscale(dax, xsiz, 16); + x2 = x1 + mulscale16(dax, xsiz); - y1 -= mulscale(day, mid_dist, 16); - y2 = y1 + mulscale(day, xsiz, 16); + y1 -= mulscale16(day, mid_dist); + y2 = y1 + mulscale16(day, xsiz); return clipinsideboxline(sp->x, sp->y, x1, y1, x2, y2, ((int) sp->clipdist) << 2); }