diff --git a/source/build/include/build.h b/source/build/include/build.h index 05ff2638b..3d6f62de1 100644 --- a/source/build/include/build.h +++ b/source/build/include/build.h @@ -288,15 +288,6 @@ int32_t md_definehud (int32_t modelid, int32_t tilex, FVector3 add, int32_t md_undefinetile(int32_t tile); int32_t md_undefinemodel(int32_t modelid); -static vec2_t const zerovec = { 0, 0 }; - -#define SET_AND_RETURN(Lval, Rval) \ - do \ - { \ - (Lval) = (Rval); \ - return; \ - } while (0) - static inline int64_t compat_maybe_truncate_to_int32(int64_t val) { return enginecompatibility_mode != ENGINECOMPATIBILITY_NONE ? (int32_t)val : val; diff --git a/source/core/sectorgeometry.cpp b/source/core/sectorgeometry.cpp index 6f26d0bbb..7bd870c97 100644 --- a/source/core/sectorgeometry.cpp +++ b/source/core/sectorgeometry.cpp @@ -158,7 +158,8 @@ public: // To calculate the inverse Build performs an integer division with significant loss of precision // that can cause the texture to be shifted by multiple pixels. // The code below calculates the amount of this deviation so that it can be added back to the formula. - int len = ksqrt(uhypsq(ix2 - ix1, iy2 - iy1)); + int x = ix2 - ix1, y = iy2 - iy1; + int len = int(sqrt(double(x) * x + double(y) * y)); if (len != 0) { int i = 1048576 / len;