summaryrefslogtreecommitdiff
path: root/servers/visual/visual_server_raster.cpp
diff options
context:
space:
mode:
authorromulox_x <romulox_x@yahoo.com>2015-02-21 13:57:12 -0800
committerromulox_x <romulox_x@yahoo.com>2015-02-21 13:57:12 -0800
commit2ac767b1f52f2d5d9d6b2dc00e8c3d065b9fc9bb (patch)
tree28b4493652dc3d66f87aa913b33761ff4bd92167 /servers/visual/visual_server_raster.cpp
parent1d7337ba10ad593f0786d3e356cf0b05aa9be2b4 (diff)
changed viewport clearing to use the alpha value of the clear color, and made the transparent bg option of viewport force a clear color of 0,0,0,0
Diffstat (limited to 'servers/visual/visual_server_raster.cpp')
-rw-r--r--servers/visual/visual_server_raster.cpp7
1 files changed, 6 insertions, 1 deletions
diff --git a/servers/visual/visual_server_raster.cpp b/servers/visual/visual_server_raster.cpp
index 764a969e77..feb14d8a9d 100644
--- a/servers/visual/visual_server_raster.cpp
+++ b/servers/visual/visual_server_raster.cpp
@@ -6641,7 +6641,12 @@ void VisualServerRaster::_draw_viewport(Viewport *p_viewport,int p_ofs_x, int p_
//clear the viewport black because of no camera? i seriously should..
if (p_viewport->render_target_clear_on_new_frame || p_viewport->render_target_clear) {
- rasterizer->clear_viewport(clear_color);
+ if (p_viewport->transparent_bg) {
+ rasterizer->clear_viewport(Color(0,0,0,0));
+ }
+ else {
+ rasterizer->clear_viewport(clear_color);
+ }
p_viewport->render_target_clear=false;
}
}