- replaced the one use of uhypsq to delete the function.

This commit is contained in:
Christoph Oelckers 2022-09-30 23:20:27 +02:00
parent a6b55dca74
commit 4becce9bf4
2 changed files with 1 additions and 6 deletions

View file

@ -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_

View file

@ -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 };