Skip to content

Commit

Permalink
Merge pull request #16 from BSzili/master
Browse files Browse the repository at this point in the history
  • Loading branch information
jonof committed Dec 25, 2021
2 parents 08d06eb + ddc9310 commit 2169411
Show file tree
Hide file tree
Showing 4 changed files with 14 additions and 14 deletions.
2 changes: 1 addition & 1 deletion src/astub.c
Original file line number Diff line number Diff line change
Expand Up @@ -2293,7 +2293,7 @@ void faketimerhandler(void)
dist = ksqrt(oposx*oposx+oposy*oposy);
if (ototalclock > timoff+32) dist = 0;

daang = mulscale(dist,angvel,9);
daang = mulscale9(dist,angvel);
posz += (daang<<6);
if (posz > loz-(4<<8)) posz = loz-(4<<8), hvel = 0;
if (posz < hiz+(4<<8)) posz = hiz+(4<<8), hvel = 0;
Expand Down
4 changes: 2 additions & 2 deletions src/gamedef.c
Original file line number Diff line number Diff line change
Expand Up @@ -2071,8 +2071,8 @@ void move()
}
else
{
ps[g_p].posxv = mulscale(ps[g_p].posxv,dukefriction-0x2000,16);
ps[g_p].posyv = mulscale(ps[g_p].posyv,dukefriction-0x2000,16);
ps[g_p].posxv = mulscale16(ps[g_p].posxv,dukefriction-0x2000);
ps[g_p].posyv = mulscale16(ps[g_p].posyv,dukefriction-0x2000);
}
}
else if(g_sp->picnum != DRONE && g_sp->picnum != SHARK && g_sp->picnum != COMMANDER)
Expand Down
6 changes: 3 additions & 3 deletions src/menues.c
Original file line number Diff line number Diff line change
Expand Up @@ -4243,8 +4243,8 @@ void drawoverheadmap(int cposx, int cposy, int czoom, short cang)
ox = sprite[ps[p].i].x-cposx; oy = sprite[ps[p].i].y-cposy;
daang = (sprite[ps[p].i].ang-cang)&2047;
if (p == screenpeek) { ox = 0; 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 || ud.coop == 1 )
{
Expand All @@ -4254,7 +4254,7 @@ void drawoverheadmap(int cposx, int cposy, int czoom, short cang)
i = APLAYERTOP;

j = klabs(ps[p].truefz-ps[p].posz)>>8;
j = mulscale(czoom*(sprite[ps[p].i].yrepeat+j),yxaspect,16);
j = mulscale16(czoom*(sprite[ps[p].i].yrepeat+j),yxaspect);

if(j < 22000) j = 22000;
else if(j > (65536<<1)) j = (65536<<1);
Expand Down
16 changes: 8 additions & 8 deletions src/player.c
Original file line number Diff line number Diff line change
Expand Up @@ -283,7 +283,7 @@ short aim(spritetype *s,short aang)
if( (dy1*xv) <= (dx1*yv) )
if( ( dy2*xv ) >= (dx2*yv) )
{
sdist = mulscale(dx3,xv,14) + mulscale(dy3,yv,14);
sdist = mulscale14(dx3,xv) + mulscale14(dy3,yv);
if( sdist > 512 && sdist < smax )
{
if(s->picnum == APLAYER)
Expand Down Expand Up @@ -3270,20 +3270,20 @@ void processinput(short snum)

if( ( p->curr_weapon == KNEE_WEAPON && *kb > 10 && p->on_ground ) || ( p->on_ground && (sb_snum&2) ) )
{
p->posxv = mulscale(p->posxv,dukefriction-0x2000,16);
p->posyv = mulscale(p->posyv,dukefriction-0x2000,16);
p->posxv = mulscale16(p->posxv,dukefriction-0x2000);
p->posyv = mulscale16(p->posyv,dukefriction-0x2000);
}
else
{
if(psectlotag == 2)
{
p->posxv = mulscale(p->posxv,dukefriction-0x1400,16);
p->posyv = mulscale(p->posyv,dukefriction-0x1400,16);
p->posxv = mulscale16(p->posxv,dukefriction-0x1400);
p->posyv = mulscale16(p->posyv,dukefriction-0x1400);
}
else
{
p->posxv = mulscale(p->posxv,dukefriction,16);
p->posyv = mulscale(p->posyv,dukefriction,16);
p->posxv = mulscale16(p->posxv,dukefriction);
p->posyv = mulscale16(p->posyv,dukefriction);
}
}

Expand Down Expand Up @@ -3736,7 +3736,7 @@ void processinput(short snum)
int lGrenadeLifetimeVar=NAM_GRENADE_LIFETIME_VAR;
// set timer. blows up when at zero....
sprite[j].extra=lGrenadeLifetime // FIXME: bug
+ mulscale(krand(),lGrenadeLifetimeVar, 14)
+ mulscale14(krand(),lGrenadeLifetimeVar)
- lGrenadeLifetimeVar;
}

Expand Down

0 comments on commit 2169411

Please sign in to comment.