From 7b63c6323d2eeade5a6d6e82b44e72ff4e1b6d0c Mon Sep 17 00:00:00 2001 From: Juan Linietsky Date: Sun, 29 Jul 2018 15:09:42 -0300 Subject: Clear color was not correctly being set, fixes #4939 --- servers/visual/visual_server_raster.cpp | 1 + servers/visual/visual_server_viewport.cpp | 8 +++++++- servers/visual/visual_server_viewport.h | 1 + 3 files changed, 9 insertions(+), 1 deletion(-) (limited to 'servers') diff --git a/servers/visual/visual_server_raster.cpp b/servers/visual/visual_server_raster.cpp index 6bf3670e5a..c7d33ec43c 100644 --- a/servers/visual/visual_server_raster.cpp +++ b/servers/visual/visual_server_raster.cpp @@ -161,6 +161,7 @@ void VisualServerRaster::set_boot_image(const Ref &p_image, const Color & VSG::rasterizer->set_boot_image(p_image, p_color, p_scale); } void VisualServerRaster::set_default_clear_color(const Color &p_color) { + VSG::viewport->set_default_clear_color(p_color); } bool VisualServerRaster::has_feature(Features p_feature) const { diff --git a/servers/visual/visual_server_viewport.cpp b/servers/visual/visual_server_viewport.cpp index dd6bc3cf26..a700fcf11b 100644 --- a/servers/visual/visual_server_viewport.cpp +++ b/servers/visual/visual_server_viewport.cpp @@ -252,7 +252,9 @@ void VisualServerViewport::draw_viewports() { // process all our active interfaces ARVRServer::get_singleton()->_process(); - clear_color = GLOBAL_GET("rendering/environment/default_clear_color"); + if (Engine::get_singleton()->is_editor_hint()) { + clear_color = GLOBAL_GET("rendering/environment/default_clear_color"); + } //sort viewports active_viewports.sort_custom(); @@ -660,5 +662,9 @@ bool VisualServerViewport::free(RID p_rid) { return false; } +void VisualServerViewport::set_default_clear_color(const Color &p_color) { + clear_color = p_color; +} + VisualServerViewport::VisualServerViewport() { } diff --git a/servers/visual/visual_server_viewport.h b/servers/visual/visual_server_viewport.h index c0c83c0450..f915e26b81 100644 --- a/servers/visual/visual_server_viewport.h +++ b/servers/visual/visual_server_viewport.h @@ -188,6 +188,7 @@ public: virtual int viewport_get_render_info(RID p_viewport, VS::ViewportRenderInfo p_info); virtual void viewport_set_debug_draw(RID p_viewport, VS::ViewportDebugDraw p_draw); + void set_default_clear_color(const Color &p_color); void draw_viewports(); bool free(RID p_rid); -- cgit v1.2.3