From 8ce4f655f4b4a76cdac8c4479a60a70255bf7e5f Mon Sep 17 00:00:00 2001 From: clayjohn Date: Fri, 12 Jul 2024 09:57:44 -0700 Subject: [PATCH] Only print physics sync warning on dev builds to avoid warning spam from using move_and_slide The check should be restored once we implement move_and_slide in a way that doesn't sync the physics thread --- servers/physics_server_2d_wrap_mt.h | 4 ++++ servers/physics_server_3d_wrap_mt.h | 4 ++++ 2 files changed, 8 insertions(+) diff --git a/servers/physics_server_2d_wrap_mt.h b/servers/physics_server_2d_wrap_mt.h index f0c36a906f8..5c757264b3b 100644 --- a/servers/physics_server_2d_wrap_mt.h +++ b/servers/physics_server_2d_wrap_mt.h @@ -45,7 +45,11 @@ #endif #ifdef DEBUG_ENABLED +#ifdef DEV_ENABLED #define MAIN_THREAD_SYNC_WARN WARN_PRINT("Call to " + String(__FUNCTION__) + " causing PhysicsServer2D synchronizations on every frame. This significantly affects performance."); +#else +#define MAIN_THREAD_SYNC_WARN +#endif #endif class PhysicsServer2DWrapMT : public PhysicsServer2D { diff --git a/servers/physics_server_3d_wrap_mt.h b/servers/physics_server_3d_wrap_mt.h index 0909c46b55c..2fd39546a59 100644 --- a/servers/physics_server_3d_wrap_mt.h +++ b/servers/physics_server_3d_wrap_mt.h @@ -44,7 +44,11 @@ #endif #ifdef DEBUG_ENABLED +#ifdef DEV_ENABLED #define MAIN_THREAD_SYNC_WARN WARN_PRINT("Call to " + String(__FUNCTION__) + " causing PhysicsServer3D synchronizations on every frame. This significantly affects performance."); +#else +#define MAIN_THREAD_SYNC_WARN +#endif #endif class PhysicsServer3DWrapMT : public PhysicsServer3D {