Skip to content

Commit

Permalink
Merge pull request #94279 from clayjohn/physics-sync-warn
Browse files Browse the repository at this point in the history
Only print physics sync warning on dev builds to avoid warning spam from using `move_and_slide`
  • Loading branch information
akien-mga committed Jul 17, 2024
2 parents ed13b2a + 8ce4f65 commit 82b5720
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 0 deletions.
4 changes: 4 additions & 0 deletions servers/physics_server_2d_wrap_mt.h
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down
4 changes: 4 additions & 0 deletions servers/physics_server_3d_wrap_mt.h
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down

0 comments on commit 82b5720

Please sign in to comment.