mirror of
https://git.do.srb2.org/STJr/SRB2.git
synced 2025-01-31 05:30:48 +00:00
resolved issue where the sides had the opposite scales over ANGLE_180.
also, i've sussed out WHAT'S going wrong here - the topleft pixel of the sprite will always be rendered at the height on the screen it would be rendered otherwise, which is causing the waving. now to figure out what to change to get that to move appropriately...
This commit is contained in:
parent
a2b26c3bf4
commit
10a8682620
1 changed files with 12 additions and 2 deletions
|
@ -1256,6 +1256,7 @@ static void R_ProjectSprite(mobj_t *thing)
|
|||
|
||||
if (1) // (flatsprite)
|
||||
{
|
||||
fixed_t yscale1;
|
||||
fixed_t yscale2;
|
||||
INT32 range;
|
||||
|
||||
|
@ -1264,7 +1265,7 @@ static void R_ProjectSprite(mobj_t *thing)
|
|||
gxt = FixedMul(tr_x, viewcos);
|
||||
gyt = -FixedMul(tr_y, viewsin);
|
||||
tz = gxt-gyt;
|
||||
yscale = FixedDiv(projectiony, tz);
|
||||
yscale1 = FixedDiv(projectiony, tz);
|
||||
|
||||
leftoffset += spritecachedinfo[lump].width;
|
||||
tr_x = thing->x + FixedMul(leftoffset, FINECOSINE(ang>>ANGLETOFINESHIFT)) - viewx;
|
||||
|
@ -1274,11 +1275,20 @@ static void R_ProjectSprite(mobj_t *thing)
|
|||
tz = gxt-gyt;
|
||||
yscale2 = FixedDiv(projectiony, tz);
|
||||
|
||||
if (ang >= ANGLE_180)
|
||||
{
|
||||
fixed_t temp = yscale2;
|
||||
yscale2 = yscale1;
|
||||
yscale1 = temp;
|
||||
}
|
||||
|
||||
if (x2 > x1)
|
||||
range = (x2 - x1);
|
||||
else
|
||||
range = 1;
|
||||
scalestep = (yscale2 - yscale)/range;
|
||||
scalestep = (yscale2 - yscale1)/range;
|
||||
yscale = yscale1;
|
||||
//this_scale = FixedMul(this_scale, FixedDiv(yscale, yscale1));
|
||||
}
|
||||
|
||||
xscale = FixedMul(xscale, ang_scale);
|
||||
|
|
Loading…
Reference in a new issue