浏览代码

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
clayjohn 1 年之前
父节点
当前提交
8ce4f655f4
共有 2 个文件被更改,包括 8 次插入0 次删除
  1. 4 0
      servers/physics_server_2d_wrap_mt.h
  2. 4 0
      servers/physics_server_3d_wrap_mt.h

+ 4 - 0
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 {

+ 4 - 0
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 {