diff options
author | Juan Linietsky <reduzio@gmail.com> | 2018-07-29 15:09:42 -0300 |
---|---|---|
committer | Juan Linietsky <reduzio@gmail.com> | 2018-07-29 15:09:42 -0300 |
commit | 7b63c6323d2eeade5a6d6e82b44e72ff4e1b6d0c (patch) | |
tree | e722609fd37c27ee643a44e7b1da7af6a92b241f /servers | |
parent | c752c2642720820e17ed7d0ca223f60aee3b2739 (diff) |
Clear color was not correctly being set, fixes #4939
Diffstat (limited to 'servers')
-rw-r--r-- | servers/visual/visual_server_raster.cpp | 1 | ||||
-rw-r--r-- | servers/visual/visual_server_viewport.cpp | 8 | ||||
-rw-r--r-- | servers/visual/visual_server_viewport.h | 1 |
3 files changed, 9 insertions, 1 deletions
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<Image> &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<ViewportSort>(); @@ -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); |