polymost.c: fix display of floor-aligned sprites ornameted to the ceiling.

git-svn-id: https://svn.eduke32.com/eduke32@5158 1a8010ca-5511-0410-912e-c29ae57300e0
This commit is contained in:
helixhorned 2015-04-18 21:59:20 +00:00
parent 77c5056f22
commit d9c171d499

View file

@ -4425,8 +4425,10 @@ void polymost_drawsprite(int32_t snum)
if (j == tspr->owner) if (j == tspr->owner)
break; break;
const int foff_sign = (tspr->z > globalposz) ? -1 : 1;
{ {
float const f = ((float) (tspr->z - globalposz) - (i * r_fspr_offset)) * gyxscale; float const f = ((float) (tspr->z - globalposz) + foff_sign*(i * r_fspr_offset)) * gyxscale;
for (int j = 0; j < npoints; j++) for (int j = 0; j < npoints; j++)
{ {
@ -4439,7 +4441,7 @@ void polymost_drawsprite(int32_t snum)
// gd? Copied from floor rendering code // gd? Copied from floor rendering code
xtex.d = 0; xtex.d = 0;
ytex.d = gxyaspect / (double)(tspr->z - globalposz - (i * r_fspr_offset)); ytex.d = gxyaspect / (double)(tspr->z - globalposz + foff_sign*(i * r_fspr_offset));
otex.d = -ghoriz * ytex.d; otex.d = -ghoriz * ytex.d;
// copied&modified from relative alignment // copied&modified from relative alignment