From 41fa6c32b41b9b5f84aa55c53b4643ea8298a5cb Mon Sep 17 00:00:00 2001 From: kobewi Date: Wed, 11 Oct 2023 13:21:29 +0200 Subject: [PATCH] Disable update spinner when debug redraw is active --- editor/editor_node.cpp | 2 +- servers/rendering/renderer_canvas_cull.cpp | 4 ++++ servers/rendering/renderer_canvas_cull.h | 1 + servers/rendering/rendering_server_default.h | 1 + servers/rendering_server.h | 1 + 5 files changed, 8 insertions(+), 1 deletion(-) diff --git a/editor/editor_node.cpp b/editor/editor_node.cpp index 5b003ffdc06..665e609cb06 100644 --- a/editor/editor_node.cpp +++ b/editor/editor_node.cpp @@ -790,7 +790,7 @@ void EditorNode::_notification(int p_what) { } void EditorNode::_update_update_spinner() { - update_spinner->set_visible(EDITOR_GET("interface/editor/show_update_spinner")); + update_spinner->set_visible(!RenderingServer::get_singleton()->canvas_item_get_debug_redraw() && EDITOR_GET("interface/editor/show_update_spinner")); const bool update_continuously = EDITOR_GET("interface/editor/update_continuously"); PopupMenu *update_popup = update_spinner->get_popup(); diff --git a/servers/rendering/renderer_canvas_cull.cpp b/servers/rendering/renderer_canvas_cull.cpp index 75192132c72..c5206017f7a 100644 --- a/servers/rendering/renderer_canvas_cull.cpp +++ b/servers/rendering/renderer_canvas_cull.cpp @@ -1623,6 +1623,10 @@ void RendererCanvasCull::canvas_item_set_debug_redraw(bool p_enabled) { RSG::canvas_render->set_debug_redraw(p_enabled, debug_redraw_time, debug_redraw_color); } +bool RendererCanvasCull::canvas_item_get_debug_redraw() const { + return debug_redraw; +} + void RendererCanvasCull::canvas_item_set_canvas_group_mode(RID p_item, RS::CanvasGroupMode p_mode, float p_clear_margin, bool p_fit_empty, float p_fit_margin, bool p_blur_mipmaps) { Item *canvas_item = canvas_item_owner.get_or_null(p_item); ERR_FAIL_NULL(canvas_item); diff --git a/servers/rendering/renderer_canvas_cull.h b/servers/rendering/renderer_canvas_cull.h index f81dabc1d2e..0f51abbb266 100644 --- a/servers/rendering/renderer_canvas_cull.h +++ b/servers/rendering/renderer_canvas_cull.h @@ -265,6 +265,7 @@ public: void canvas_item_set_canvas_group_mode(RID p_item, RS::CanvasGroupMode p_mode, float p_clear_margin = 5.0, bool p_fit_empty = false, float p_fit_margin = 0.0, bool p_blur_mipmaps = false); void canvas_item_set_debug_redraw(bool p_enabled); + bool canvas_item_get_debug_redraw() const; RID canvas_light_allocate(); void canvas_light_initialize(RID p_rid); diff --git a/servers/rendering/rendering_server_default.h b/servers/rendering/rendering_server_default.h index 85d932e5980..3d75ced3e3b 100644 --- a/servers/rendering/rendering_server_default.h +++ b/servers/rendering/rendering_server_default.h @@ -895,6 +895,7 @@ public: FUNC6(canvas_item_set_canvas_group_mode, RID, CanvasGroupMode, float, bool, float, bool) FUNC1(canvas_item_set_debug_redraw, bool) + FUNC0RC(bool, canvas_item_get_debug_redraw) FUNCRIDSPLIT(canvas_light) diff --git a/servers/rendering_server.h b/servers/rendering_server.h index b08f7653371..ba8cc3ba80e 100644 --- a/servers/rendering_server.h +++ b/servers/rendering_server.h @@ -1413,6 +1413,7 @@ public: virtual void canvas_item_set_canvas_group_mode(RID p_item, CanvasGroupMode p_mode, float p_clear_margin = 5.0, bool p_fit_empty = false, float p_fit_margin = 0.0, bool p_blur_mipmaps = false) = 0; virtual void canvas_item_set_debug_redraw(bool p_enabled) = 0; + virtual bool canvas_item_get_debug_redraw() const = 0; /* CANVAS LIGHT */ virtual RID canvas_light_create() = 0;