From 4becce9bf4fe77a79a06741704ec984249b5309b Mon Sep 17 00:00:00 2001 From: Christoph Oelckers Date: Fri, 30 Sep 2022 23:20:27 +0200 Subject: [PATCH] - replaced the one use of uhypsq to delete the function. --- source/build/include/build.h | 5 ----- source/build/src/clip.cpp | 2 +- 2 files changed, 1 insertion(+), 6 deletions(-) diff --git a/source/build/include/build.h b/source/build/include/build.h index 49d14817c..2600eaaa7 100644 --- a/source/build/include/build.h +++ b/source/build/include/build.h @@ -46,9 +46,4 @@ inline int32_t ksqrt(uint64_t num) return int(sqrt(double(num))); } -inline constexpr uint32_t uhypsq(int32_t const dx, int32_t const dy) -{ - return (uint32_t)dx*dx + (uint32_t)dy*dy; -} - #endif // build_h_ diff --git a/source/build/src/clip.cpp b/source/build/src/clip.cpp index e77e6bb87..ed0facc24 100644 --- a/source/build/src/clip.cpp +++ b/source/build/src/clip.cpp @@ -286,7 +286,7 @@ CollisionBase clipmove_(vec3_t * const pos, int * const sectnum, int32_t xvect, //Extra walldist for sprites on sector lines vec2_t const diff = { goal.X - (pos->X), goal.Y - (pos->Y) }; - int32_t const rad = ksqrt(uhypsq(diff.X, diff.Y)) + MAXCLIPDIST + walldist + 8; + int32_t const rad = ksqrt((int64_t)diff.X * diff.X + (int64_t)diff.Y * diff.Y) + MAXCLIPDIST + walldist + 8; vec2_t const clipMin = { cent.X - rad, cent.Y - rad }; vec2_t const clipMax = { cent.X + rad, cent.Y + rad };