From 430ab335dee966736b0e967cb453e5f52f175262 Mon Sep 17 00:00:00 2001 From: Falco Girgis Date: Fri, 28 Feb 2025 23:01:15 -0600 Subject: [PATCH] Fixed really stupid mistake. - Whoops, accidentally took x to the 4th power in MATH_Fast_Invert(). --- vendor/librw/src/dc/rwdc.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/vendor/librw/src/dc/rwdc.cpp b/vendor/librw/src/dc/rwdc.cpp index b2dad91e..89721d78 100644 --- a/vendor/librw/src/dc/rwdc.cpp +++ b/vendor/librw/src/dc/rwdc.cpp @@ -166,13 +166,13 @@ static_assert(alignof(pvr_vertex16_t) == 32, "pvr_vertex16_t alignof mismatch"); #define MATH_Very_Fast_Invert(x) ({ 1.0f / sqrtf((x) * (x)); }) -static inline __attribute__((always_inline)) float MATH_Fast_Invert(float x) { +__always_inline float MATH_Fast_Invert(float x) { bool neg = 0; if(x < 0.0f) neg = true; - x = MATH_Very_Fast_Invert(x*x); // 1.0f / sqrt(x^2) + x = MATH_Very_Fast_Invert(x); // 1.0f / sqrt(x^2) return (neg)? -x : x; }