I think this is as optimised as it's gonna get. Now onto the flag!
This commit is contained in:
parent
2d3ebc5e49
commit
ce8ae48222
|
@ -1258,7 +1258,7 @@ static void R_ProjectSprite(mobj_t *thing)
|
||||||
|
|
||||||
if (flatsprite)
|
if (flatsprite)
|
||||||
{
|
{
|
||||||
fixed_t yscale2;
|
fixed_t yscale2, cosmul, sinmul;
|
||||||
INT32 range;
|
INT32 range;
|
||||||
|
|
||||||
if (ang >= ANGLE_180)
|
if (ang >= ANGLE_180)
|
||||||
|
@ -1266,23 +1266,25 @@ static void R_ProjectSprite(mobj_t *thing)
|
||||||
offset *= -1;
|
offset *= -1;
|
||||||
offset2 *= -1;
|
offset2 *= -1;
|
||||||
}
|
}
|
||||||
offset2 += offset;
|
|
||||||
|
|
||||||
tr_x = thing->x + FixedMul(offset, FINECOSINE(thing->angle>>ANGLETOFINESHIFT)) - viewx;
|
cosmul = FINECOSINE(thing->angle>>ANGLETOFINESHIFT);
|
||||||
tr_y = thing->y + FixedMul(offset, FINESINE(thing->angle>>ANGLETOFINESHIFT)) - viewy;
|
sinmul = FINESINE(thing->angle>>ANGLETOFINESHIFT);
|
||||||
|
|
||||||
|
tr_x += FixedMul(offset, cosmul);
|
||||||
|
tr_y += FixedMul(offset, sinmul);
|
||||||
gxt = FixedMul(tr_x, viewcos);
|
gxt = FixedMul(tr_x, viewcos);
|
||||||
gyt = -FixedMul(tr_y, viewsin);
|
gyt = -FixedMul(tr_y, viewsin);
|
||||||
tz = gxt-gyt;
|
tz = gxt-gyt;
|
||||||
yscale = FixedDiv(projectiony, tz);
|
yscale = FixedDiv(projectiony, tz);
|
||||||
if (yscale < 64) return; // Fix some funky visuals
|
if (yscale < 64) return; // Fix some funky visuals
|
||||||
|
|
||||||
tr_x = thing->x + FixedMul(offset2, FINECOSINE(thing->angle>>ANGLETOFINESHIFT)) - viewx;
|
tr_x += FixedMul(offset2, cosmul);
|
||||||
tr_y = thing->y + FixedMul(offset2, FINESINE(thing->angle>>ANGLETOFINESHIFT)) - viewy;
|
tr_y += FixedMul(offset2, sinmul);
|
||||||
gxt = FixedMul(tr_x, viewcos);
|
gxt = FixedMul(tr_x, viewcos);
|
||||||
gyt = -FixedMul(tr_y, viewsin);
|
gyt = -FixedMul(tr_y, viewsin);
|
||||||
tz = gxt-gyt;
|
tz = gxt-gyt;
|
||||||
yscale2 = FixedDiv(projectiony, tz);
|
yscale2 = FixedDiv(projectiony, tz);
|
||||||
if (yscale2 < 64) return; // Fix some funky visuals
|
if (yscale2 < 64) return; // ditto
|
||||||
|
|
||||||
if (x2 > x1)
|
if (x2 > x1)
|
||||||
range = (x2 - x1);
|
range = (x2 - x1);
|
||||||
|
|
Loading…
Reference in a new issue