From 751188bcd88612ecfba0c74bd4aa9d12a00f9915 Mon Sep 17 00:00:00 2001 From: Alug Date: Wed, 13 Mar 2024 09:57:05 +0100 Subject: [PATCH] remove xs_CRoundToInt while ye, less exact stuff doesent matter too much in the context of doom, it matters more in kart, due to polygon rendering and seg processing being extremely heavy and also generally more complex maps --- src/hardware/hw_clip.c | 2 +- src/m_fixed.h | 35 ----------------------------------- 2 files changed, 1 insertion(+), 36 deletions(-) diff --git a/src/hardware/hw_clip.c b/src/hardware/hw_clip.c index be8b21dcd..de27433c4 100644 --- a/src/hardware/hw_clip.c +++ b/src/hardware/hw_clip.c @@ -339,7 +339,7 @@ angle_t gld_FrustumAngle(angle_t tiltangle) floatangle = 2.0f + (45.0f + (tilt / 1.9f)) * clipfov / 90.0f; if (floatangle >= 180.0) return 0xffffffff; - a1 = (angle_t)xs_CRoundToInt(ANG1 * floatangle); + a1 = ANG1 * (int)floatangle; return a1; } diff --git a/src/m_fixed.h b/src/m_fixed.h index 9fe35c91d..4e4c79c65 100644 --- a/src/m_fixed.h +++ b/src/m_fixed.h @@ -260,41 +260,6 @@ typedef struct fixed_t y; } vector2_t; -// Source: "Know Your FPU: Fixing Floating Fast" -// http://www.stereopsis.com/sree/fpu2006.html -// -// xs_CRoundToInt: Round toward nearest, but ties round toward even (just like FISTP) -// taken from prboom+ for OpenGL big room fix -#ifndef _xs_DEFAULT_CONVERSION -#define _xs_DEFAULT_CONVERSION 0 -#endif //_xs_DEFAULT_CONVERSION - -#ifdef WORDS_BIGENDIAN - #define _xs_iexp_ 0 - #define _xs_iman_ 1 -#else - #define _xs_iexp_ 1 //intel is little endian - #define _xs_iman_ 0 -#endif //BigEndian_ - -typedef double real64; -typedef union _xs_doubleints -{ - real64 val; - unsigned ival[2]; -} _xs_doubleints; - -FUNCMATH FUNCINLINE ATTRINLINE int xs_CRoundToInt(real64 val) -{ -#if _xs_DEFAULT_CONVERSION==0 - _xs_doubleints uval; - uval.val = val + 6755399441055744.0; - return uval.ival[_xs_iman_]; -#else - return int(floor(val+.5)); -#endif -} - vector2_t *FV2_Load(vector2_t *vec, fixed_t x, fixed_t y); vector2_t *FV2_UnLoad(vector2_t *vec, fixed_t *x, fixed_t *y); vector2_t *FV2_Copy(vector2_t *a_o, const vector2_t *a_i);