Skip to content

Commit a8476db

Browse files
committed
Make Math::fast_ftoi thread-safe
1 parent 34284fe commit a8476db

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

include/godot_cpp/core/math.hpp

+1-1
Original file line numberDiff line numberDiff line change
@@ -766,7 +766,7 @@ inline double pingpong(double value, double length) {
766766

767767
// This function should be as fast as possible and rounding mode should not matter.
768768
inline int fast_ftoi(float a) {
769-
static int b;
769+
int b;
770770

771771
#if (defined(_WIN32_WINNT) && _WIN32_WINNT >= 0x0603) || (defined(WINAPI_FAMILY) && WINAPI_FAMILY == WINAPI_FAMILY_PHONE_APP) // windows 8 phone?
772772
b = (int)((a > 0.0) ? (a + 0.5) : (a - 0.5));

0 commit comments

Comments
 (0)