diff --git a/polymer/eduke32/build/src/polymost.c b/polymer/eduke32/build/src/polymost.c index 2e1439c42..dbe58fba2 100644 --- a/polymer/eduke32/build/src/polymost.c +++ b/polymer/eduke32/build/src/polymost.c @@ -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