mirror of
https://github.com/ZDoom/raze-gles.git
synced 2024-12-29 04:50:42 +00:00
- Duke: Changed some downscaled and upscaled Q16.16 variables missed when doing 46810ec490
.
This commit is contained in:
parent
0746b98886
commit
e7de0da36c
5 changed files with 29 additions and 27 deletions
|
@ -2504,7 +2504,7 @@ static void greenslime(int i)
|
||||||
|
|
||||||
s->z = ps[p].posz + ps[p].pyoff - t[2] + (8 << 8);
|
s->z = ps[p].posz + ps[p].pyoff - t[2] + (8 << 8);
|
||||||
|
|
||||||
s->z += (100 - ps[p].gethoriz()) << 4;
|
s->z += (IntToFixed(100) - ps[p].getq16horiz()) >> 12;
|
||||||
|
|
||||||
if (t[2] > 512)
|
if (t[2] > 512)
|
||||||
t[2] -= 128;
|
t[2] -= 128;
|
||||||
|
|
|
@ -166,7 +166,7 @@ void shoot_d(int i, int atwith)
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
zvel = 98 * (100 - ps[p].gethorizsum());
|
zvel = xs_CRoundToInt((IntToFixed(100) - ps[p].getq16horizsum()) * (98. / 65536.));
|
||||||
sx += sintable[(sa + 860) & 0x7FF] / 448;
|
sx += sintable[(sa + 860) & 0x7FF] / 448;
|
||||||
sy += sintable[(sa + 348) & 0x7FF] / 448;
|
sy += sintable[(sa + 348) & 0x7FF] / 448;
|
||||||
sz += (3 << 8);
|
sz += (3 << 8);
|
||||||
|
@ -224,7 +224,7 @@ void shoot_d(int i, int atwith)
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
zvel = (int)(100 - ps[p].gethorizsum()) * 81;
|
zvel = xs_CRoundToInt((IntToFixed(100) - ps[p].getq16horizsum()) * (81. / 65536.));
|
||||||
if (sprite[ps[p].i].xvel != 0)
|
if (sprite[ps[p].i].xvel != 0)
|
||||||
vel = (int)((((512 - (1024
|
vel = (int)((((512 - (1024
|
||||||
- abs(abs(getangle(sx - ps[p].oposx, sy - ps[p].oposy) - sa) - 1024)))
|
- abs(abs(getangle(sx - ps[p].oposx, sy - ps[p].oposy) - sa) - 1024)))
|
||||||
|
@ -292,7 +292,7 @@ void shoot_d(int i, int atwith)
|
||||||
{
|
{
|
||||||
if (p >= 0)
|
if (p >= 0)
|
||||||
{
|
{
|
||||||
zvel = (100 - ps[p].gethorizsum()) << 5;
|
zvel = (IntToFixed(100) - ps[p].getq16horizsum()) >> 11;
|
||||||
sz += (6 << 8);
|
sz += (6 << 8);
|
||||||
sa += 15;
|
sa += 15;
|
||||||
}
|
}
|
||||||
|
@ -464,14 +464,14 @@ void shoot_d(int i, int atwith)
|
||||||
if (j == -1)
|
if (j == -1)
|
||||||
{
|
{
|
||||||
// no target
|
// no target
|
||||||
zvel = (100 - ps[p].gethorizsum()) << 5;
|
zvel = (IntToFixed(100) - ps[p].getq16horizsum()) >> 11;
|
||||||
}
|
}
|
||||||
zvel += (zRange / 2) - (krand() & (zRange - 1));
|
zvel += (zRange / 2) - (krand() & (zRange - 1));
|
||||||
}
|
}
|
||||||
else if (j == -1 || atwith != SHOTSPARK1)
|
else if (j == -1 || atwith != SHOTSPARK1)
|
||||||
{
|
{
|
||||||
sa += 16 - (krand() & 31);
|
sa += 16 - (krand() & 31);
|
||||||
zvel = (100 - ps[p].gethorizsum()) << 5;
|
zvel = (IntToFixed(100) - ps[p].getq16horizsum()) >> 11;
|
||||||
zvel += 128 - (krand() & 255);
|
zvel += 128 - (krand() & 255);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -681,7 +681,7 @@ void shoot_d(int i, int atwith)
|
||||||
sa = getangle(sprite[j].x - sx, sprite[j].y - sy);
|
sa = getangle(sprite[j].x - sx, sprite[j].y - sy);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
zvel = (100 - ps[p].gethorizsum()) * 98;
|
zvel = xs_CRoundToInt((IntToFixed(100) - ps[p].getq16horizsum()) * (98. / 65536.));
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
@ -769,7 +769,7 @@ void shoot_d(int i, int atwith)
|
||||||
if (sprite[j].picnum != RECON)
|
if (sprite[j].picnum != RECON)
|
||||||
sa = getangle(sprite[j].x - sx, sprite[j].y - sy);
|
sa = getangle(sprite[j].x - sx, sprite[j].y - sy);
|
||||||
}
|
}
|
||||||
else zvel = (100 - ps[p].gethorizsum()) * 81;
|
else zvel = xs_CRoundToInt((IntToFixed(100) - ps[p].getq16horizsum()) * (81. / 65536.));
|
||||||
if (atwith == RPG)
|
if (atwith == RPG)
|
||||||
S_PlayActorSound(RPG_SHOOT, i);
|
S_PlayActorSound(RPG_SHOOT, i);
|
||||||
|
|
||||||
|
@ -914,7 +914,7 @@ void shoot_d(int i, int atwith)
|
||||||
case HANDHOLDINGLASER:
|
case HANDHOLDINGLASER:
|
||||||
|
|
||||||
if (p >= 0)
|
if (p >= 0)
|
||||||
zvel = (100 - ps[p].gethorizsum()) * 32;
|
zvel = (IntToFixed(100) - ps[p].getq16horizsum()) >> 11;
|
||||||
else zvel = 0;
|
else zvel = 0;
|
||||||
|
|
||||||
hitscan(sx, sy, sz - ps[p].pyoff, sect,
|
hitscan(sx, sy, sz - ps[p].pyoff, sect,
|
||||||
|
@ -1015,7 +1015,7 @@ void shoot_d(int i, int atwith)
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
sa += 16 - (krand() & 31);
|
sa += 16 - (krand() & 31);
|
||||||
zvel = (100 - ps[p].gethorizsum()) << 5;
|
zvel = (IntToFixed(100) - ps[p].getq16horizsum()) >> 11;
|
||||||
zvel += 128 - (krand() & 255);
|
zvel += 128 - (krand() & 255);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1090,7 +1090,7 @@ void shoot_d(int i, int atwith)
|
||||||
zvel = ((sprite[j].z - sz - dal - (4 << 8)) * 768) / (ldist(&sprite[ps[p].i], &sprite[j]));
|
zvel = ((sprite[j].z - sz - dal - (4 << 8)) * 768) / (ldist(&sprite[ps[p].i], &sprite[j]));
|
||||||
sa = getangle(sprite[j].x - sx, sprite[j].y - sy);
|
sa = getangle(sprite[j].x - sx, sprite[j].y - sy);
|
||||||
}
|
}
|
||||||
else zvel = (100 - ps[p].gethorizsum()) * 98;
|
else zvel = xs_CRoundToInt((IntToFixed(100) - ps[p].getq16horizsum()) * (98. / 65536.));
|
||||||
}
|
}
|
||||||
else if (s->statnum != 3)
|
else if (s->statnum != 3)
|
||||||
{
|
{
|
||||||
|
@ -1940,7 +1940,7 @@ int operateTripbomb(int snum)
|
||||||
|
|
||||||
hitscan(p->posx, p->posy, p->posz,
|
hitscan(p->posx, p->posy, p->posz,
|
||||||
p->cursectnum, sintable[(p->getang() + 512) & 2047],
|
p->cursectnum, sintable[(p->getang() + 512) & 2047],
|
||||||
sintable[p->getang() & 2047], (100 - p->gethorizsum()) * 32,
|
sintable[p->getang() & 2047], (IntToFixed(100) - p->getq16horizsum()) >> 11,
|
||||||
§, &hw, &hitsp, &sx, &sy, &sz, CLIPMASK1);
|
§, &hw, &hitsp, &sx, &sy, &sz, CLIPMASK1);
|
||||||
|
|
||||||
if (sect < 0 || hitsp >= 0)
|
if (sect < 0 || hitsp >= 0)
|
||||||
|
@ -2122,12 +2122,12 @@ static void operateweapon(int snum, ESyncBits actions, int psect)
|
||||||
if (p->on_ground && (actions & SB_CROUCH))
|
if (p->on_ground && (actions & SB_CROUCH))
|
||||||
{
|
{
|
||||||
k = 15;
|
k = 15;
|
||||||
i = ((p->gethorizsum() - 100) * 20);
|
i = xs_CRoundToInt((p->getq16horizsum() - IntToFixed(100)) * (20. / 65536.));
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
k = 140;
|
k = 140;
|
||||||
i = -512 - ((p->gethorizsum() - 100) * 20);
|
i = -512 - xs_CRoundToInt((p->getq16horizsum() - IntToFixed(100)) * (20. / 65536.));
|
||||||
}
|
}
|
||||||
|
|
||||||
j = EGS(p->cursectnum,
|
j = EGS(p->cursectnum,
|
||||||
|
|
|
@ -154,7 +154,7 @@ void shoot_r(int i, int atwith)
|
||||||
{
|
{
|
||||||
if (p >= 0)
|
if (p >= 0)
|
||||||
{
|
{
|
||||||
zvel = (100 - ps[p].gethorizsum()) << 5;
|
zvel = (IntToFixed(100) - ps[p].getq16horizsum()) >> 11;
|
||||||
sz += (6 << 8);
|
sz += (6 << 8);
|
||||||
sa += 15;
|
sa += 15;
|
||||||
}
|
}
|
||||||
|
@ -333,7 +333,7 @@ void shoot_r(int i, int atwith)
|
||||||
if (j == -1)
|
if (j == -1)
|
||||||
{
|
{
|
||||||
sa += 16 - (krand() & 31);
|
sa += 16 - (krand() & 31);
|
||||||
zvel = (100 - ps[p].gethorizsum()) << 5;
|
zvel = (IntToFixed(100) - ps[p].getq16horizsum()) >> 11;
|
||||||
zvel += 128 - (krand() & 255);
|
zvel += 128 - (krand() & 255);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -343,7 +343,7 @@ void shoot_r(int i, int atwith)
|
||||||
sa += 64 - (krand() & 127);
|
sa += 64 - (krand() & 127);
|
||||||
else
|
else
|
||||||
sa += 16 - (krand() & 31);
|
sa += 16 - (krand() & 31);
|
||||||
if (j == -1) zvel = (100 - ps[p].gethorizsum()) << 5;
|
if (j == -1) zvel = (IntToFixed(100) - ps[p].getq16horizsum()) >> 11;
|
||||||
zvel += 128 - (krand() & 255);
|
zvel += 128 - (krand() & 255);
|
||||||
}
|
}
|
||||||
sz -= (2 << 8);
|
sz -= (2 << 8);
|
||||||
|
@ -602,7 +602,7 @@ void shoot_r(int i, int atwith)
|
||||||
sa = getangle(sprite[j].x - sx, sprite[j].y - sy);
|
sa = getangle(sprite[j].x - sx, sprite[j].y - sy);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
zvel = (100 - ps[p].gethorizsum()) * 98;
|
zvel = xs_CRoundToInt((IntToFixed(100) - ps[p].getq16horizsum()) * (98. / 65536.));
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
@ -693,7 +693,7 @@ void shoot_r(int i, int atwith)
|
||||||
{
|
{
|
||||||
sx += sintable[(s->ang + 512 + 160) & 2047] >> 7;
|
sx += sintable[(s->ang + 512 + 160) & 2047] >> 7;
|
||||||
sy += sintable[(s->ang + 160) & 2047] >> 7;
|
sy += sintable[(s->ang + 160) & 2047] >> 7;
|
||||||
zvel = (100 - ps[p].gethorizsum()) * 98;
|
zvel = xs_CRoundToInt((IntToFixed(100) - ps[p].getq16horizsum()) * (98. / 65536.));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
|
@ -804,7 +804,7 @@ void shoot_r(int i, int atwith)
|
||||||
if (sprite[j].picnum != RECON)
|
if (sprite[j].picnum != RECON)
|
||||||
sa = getangle(sprite[j].x - sx, sprite[j].y - sy);
|
sa = getangle(sprite[j].x - sx, sprite[j].y - sy);
|
||||||
}
|
}
|
||||||
else zvel = (100 - ps[p].gethorizsum()) * 81;
|
else zvel = xs_CRoundToInt((IntToFixed(100) - ps[p].getq16horizsum()) * (81. / 65536.));
|
||||||
if (atwith == RPG)
|
if (atwith == RPG)
|
||||||
S_PlayActorSound(RPG_SHOOT, i);
|
S_PlayActorSound(RPG_SHOOT, i);
|
||||||
else if (isRRRA())
|
else if (isRRRA())
|
||||||
|
@ -2843,12 +2843,12 @@ static void operateweapon(int snum, ESyncBits actions, int psect)
|
||||||
if (p->on_ground && (actions & SB_CROUCH) && !p->OnMotorcycle)
|
if (p->on_ground && (actions & SB_CROUCH) && !p->OnMotorcycle)
|
||||||
{
|
{
|
||||||
k = 15;
|
k = 15;
|
||||||
i = ((p->gethorizsum() - 100) * 20);
|
i = xs_CRoundToInt((p->getq16horizsum() - IntToFixed(100)) * (20. / 65536.));
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
k = 140;
|
k = 140;
|
||||||
i = -512 - ((p->gethorizsum() - 100) * 20);
|
i = -512 - xs_CRoundToInt((p->getq16horizsum() - IntToFixed(100)) * (20. / 65536.));
|
||||||
}
|
}
|
||||||
|
|
||||||
j = EGS(p->cursectnum,
|
j = EGS(p->cursectnum,
|
||||||
|
@ -3253,12 +3253,12 @@ static void operateweapon(int snum, ESyncBits actions, int psect)
|
||||||
if (p->on_ground && (actions & SB_CROUCH) && !p->OnMotorcycle)
|
if (p->on_ground && (actions & SB_CROUCH) && !p->OnMotorcycle)
|
||||||
{
|
{
|
||||||
k = 15;
|
k = 15;
|
||||||
i = ((p->gethorizsum() - 100) * 20);
|
i = xs_CRoundToInt((p->getq16horizsum() - IntToFixed(100)) * (20. / 65536.));
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
k = 32;
|
k = 32;
|
||||||
i = -512 - ((p->gethorizsum() - 100) * 20);
|
i = -512 - xs_CRoundToInt((p->getq16horizsum() - IntToFixed(100)) * (20. / 65536.));
|
||||||
}
|
}
|
||||||
|
|
||||||
j = EGS(p->cursectnum,
|
j = EGS(p->cursectnum,
|
||||||
|
|
|
@ -333,12 +333,12 @@ void operateweapon_ww(int snum, ESyncBits actions, int psect)
|
||||||
if (p->on_ground && (actions & SB_CROUCH))
|
if (p->on_ground && (actions & SB_CROUCH))
|
||||||
{
|
{
|
||||||
k = 15;
|
k = 15;
|
||||||
i = ((p->gethorizsum() - 100) * 20);
|
i = xs_CRoundToInt((p->getq16horizsum() - IntToFixed(100)) * (20. / 65536.));
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
k = 140;
|
k = 140;
|
||||||
i = -512 - ((p->gethorizsum() - 100) * 20);
|
i = -512 - xs_CRoundToInt((p->getq16horizsum() - IntToFixed(100)) * (20. / 65536.));
|
||||||
}
|
}
|
||||||
|
|
||||||
j = EGS(p->cursectnum,
|
j = EGS(p->cursectnum,
|
||||||
|
|
|
@ -232,7 +232,9 @@ struct player_struct
|
||||||
int gethoriz() { return FixedToInt(q16horiz); }
|
int gethoriz() { return FixedToInt(q16horiz); }
|
||||||
int gethorizof() { return FixedToInt(q16horizoff); }
|
int gethorizof() { return FixedToInt(q16horizoff); }
|
||||||
int gethorizsum() { return FixedToInt(q16horiz + q16horizoff); }
|
int gethorizsum() { return FixedToInt(q16horiz + q16horizoff); }
|
||||||
|
int getq16horiz() { return q16horiz; }
|
||||||
|
int getq16horizof() { return q16horizoff; }
|
||||||
|
int getq16horizsum() { return q16horiz + q16horizoff; }
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue