Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -908,8 +908,13 @@ Real BaseHeightMapRenderObjClass::getHeightMapHeight(Real x, Real y, Coord3D* no
float xdiv = x * MAP_XY_FACTOR_INV;
float ydiv = y * MAP_XY_FACTOR_INV;

float ixf = FAST_REAL_FLOOR(xdiv);
float iyf = FAST_REAL_FLOOR(ydiv);
#if RTS_ZEROHOUR && RETAIL_COMPATIBLE_CRC

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

RTS_ZEROHOUR instead of RTS_GENERALS is intentional. The goal is to get rid of fast_float_floor in all builds that do not need it, because fast_float_floor is flawed. See #3645 for more details.

float ixf = fast_float_floor(xdiv);
float iyf = fast_float_floor(ydiv);
#else
float ixf = WWMath::Floorf(xdiv);
float iyf = WWMath::Floorf(ydiv);
#endif
Comment thread
coderabbitai[bot] marked this conversation as resolved.
Resolved

float fx = xdiv - ixf; //get fraction
float fy = ydiv - iyf; //get fraction
Expand Down
4 changes: 0 additions & 4 deletions Core/Libraries/Source/Lib/Include/Lib/BaseFunctions.h
Original file line number Diff line number Diff line change
Expand Up @@ -101,10 +101,6 @@ __forceinline float fast_float_ceil(float f)
#define REAL_TO_INT_FLOOR(x) (fast_float2long_round(fast_float_floor(x)))
#endif

#define FAST_REAL_TRUNC(x) fast_float_trunc(x)
#define FAST_REAL_CEIL(x) fast_float_ceil(x)
#define FAST_REAL_FLOOR(x) fast_float_floor(x)

//-------------------------------------------------------------------------------------------------
// Checking whether a size matches the bit flags count from an enum definition:
// enum MyEnum
Expand Down
Loading