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

@ -141,7 +141,7 @@ int32_t r_parallaxskypanning = 0;
// this was faster in MSVC but slower with GCC... currently unknown on ARM where both
// the FPU and possibly the optimization path in the compiler need improvement
#if 0
static inline int32_t __float_as_int(float f) { return *(int32_t *) &f; }
static inline int32_t __float_as_int(float f) { return *(int32_t *) &f; }
static inline float __int_as_float(int32_t d) { return *(float *) &d; }
static inline float Bfabsf(float f) { return __int_as_float(__float_as_int(f)&0x7fffffff); }
#else
@ -4425,8 +4425,10 @@ void polymost_drawsprite(int32_t snum)
if (j == tspr->owner)
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++)
{
@ -4439,7 +4441,7 @@ void polymost_drawsprite(int32_t snum)
// gd? Copied from floor rendering code
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;
// copied&modified from relative alignment