Fixed the between-objects sorting problem previously mentioned in the merge request. Now they're sorted by whichever sprite has an end closest to the camera, instead of the middle point previously used.

http://i.imgur.com/UyOKX5u.png <-- this common glitch with crawlas given MF_PAPER (THEY'RE NOT GOOD AT TURNING NEAR EDGES) used to show the behind-crawlas in front of the front-crawlas.

Unfortunately, I've just discovered this issue (which happens with the old version of the sorting code too): http://i.imgur.com/QNjbATB.png but to be fair these crawlas have gotten stuck inside the edges of this platform, so I'm not sure I can do anything about this without cutting off Sonic's feet when he stands on the ground? shrug
This commit is contained in:
toasterbabe 2016-08-19 12:26:26 +01:00
parent 66a845a33a
commit fbff05bd17

View file

@ -1152,7 +1152,7 @@ static void R_ProjectSprite(mobj_t *thing)
// aspect ratio stuff
xscale = FixedDiv(projection, tz);
sortscale = FixedDiv(projectiony, tz);
yscale = FixedDiv(projectiony, tz);
// decide which patch to use for sprite relative to player
#ifdef RANGECHECK
@ -1292,11 +1292,13 @@ static void R_ProjectSprite(mobj_t *thing)
range = 1;
scalestep = (yscale2 - yscale)/range;
sortscale = max(yscale, yscale2);
}
else
{
yscale = sortscale;
scalestep = 0;
sortscale = yscale;
}
xscale = FixedMul(xscale, ang_scale);