Skip to content
Open
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
11 changes: 7 additions & 4 deletions core/error_macros.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -125,7 +125,7 @@ void _err_flush_stdout() {
// Prevent error spam by limiting the warnings to a certain frequency.
void _physics_interpolation_warning(const char *p_function, const char *p_file, int p_line, ObjectID p_id, const char *p_warn_string) {
#if defined(DEBUG_ENABLED) && defined(TOOLS_ENABLED)
const uint32_t warn_max = 2048;
const uint32_t warn_max = 256;
const uint32_t warn_timeout_seconds = 15;

static uint32_t warn_count = warn_max;
Expand All @@ -139,10 +139,12 @@ void _physics_interpolation_warning(const char *p_function, const char *p_file,

if (!warn_count) {
time_now = OS::get_singleton()->get_ticks_msec() / 1000;
}

if ((warn_count == 0) && (time_now >= warn_timeout)) {
warn_count = warn_max;

if (time_now < warn_timeout) {
return;
}

warn_timeout = time_now + warn_timeout_seconds;

if (GLOBAL_GET("debug/settings/physics_interpolation/enable_warnings")) {
Expand All @@ -166,5 +168,6 @@ void _physics_interpolation_warning(const char *p_function, const char *p_file,
}
}
}

#endif
}
4 changes: 4 additions & 0 deletions scene/2d/camera_2d.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -308,6 +308,10 @@ void Camera2D::_notification(int p_what) {
_ensure_update_interpolation_data();
if (Engine::get_singleton()->is_in_physics_frame()) {
_interpolation_data.xform_curr = get_camera_transform();
} else {
#if defined(DEBUG_ENABLED) && defined(TOOLS_ENABLED)
PHYSICS_INTERPOLATION_NODE_WARNING(get_instance_id(), "Interpolated Camera2D transformed from outside physics process");
#endif
}
}

Expand Down
6 changes: 6 additions & 0 deletions servers/visual/visual_server_canvas.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -958,6 +958,12 @@ void VisualServerCanvas::canvas_item_set_transform(RID p_item, const Transform2D
} else {
DEV_ASSERT(_interpolation_data.canvas_item_transform_update_list_curr->size());
}

#if defined(DEBUG_ENABLED) && defined(TOOLS_ENABLED)
if (!Engine::get_singleton()->is_in_physics_frame()) {
PHYSICS_INTERPOLATION_WARNING("Interpolated CanvasItem set_transform called from outside physics process");
}
#endif
}

canvas_item->xform_curr = p_transform;
Expand Down