diff options
author | Juan Linietsky <reduzio@gmail.com> | 2017-06-24 08:58:27 -0300 |
---|---|---|
committer | Juan Linietsky <reduzio@gmail.com> | 2017-06-24 08:58:27 -0300 |
commit | 0cac32910a1026517b9fc782d72824c80baf676e (patch) | |
tree | 67b03361c481f24eefabfdc2eb55ab0cdf86b3e9 /scene/main | |
parent | 6ba1e4677ba15992c750bddffcb9f1eacd1558a1 (diff) |
-Restored support for Canvas BG mode on Environment
-Improved ease of use of WorldEnvironment (no longer extends Spatial)
-2D editor viewport can now work in HDR!
Diffstat (limited to 'scene/main')
-rw-r--r-- | scene/main/viewport.cpp | 11 |
1 files changed, 5 insertions, 6 deletions
diff --git a/scene/main/viewport.cpp b/scene/main/viewport.cpp index 714327c5b7..a87c83f17c 100644 --- a/scene/main/viewport.cpp +++ b/scene/main/viewport.cpp @@ -49,6 +49,7 @@ #include "scene/scene_string_names.h" #include "global_config.h" +#include "scene/3d/scenario_fx.h" void ViewportTexture::setup_local_to_scene() { @@ -1017,10 +1018,9 @@ void Viewport::_propagate_enter_world(Node *p_node) { if (!p_node->is_inside_tree()) //may not have entered scene yet return; - Spatial *s = p_node->cast_to<Spatial>(); - if (s) { + if (p_node->cast_to<Spatial>() || p_node->cast_to<WorldEnvironment>()) { - s->notification(Spatial::NOTIFICATION_ENTER_WORLD); + p_node->notification(Spatial::NOTIFICATION_ENTER_WORLD); } else { Viewport *v = p_node->cast_to<Viewport>(); if (v) { @@ -1055,10 +1055,9 @@ void Viewport::_propagate_exit_world(Node *p_node) { if (!p_node->is_inside_tree()) //may have exited scene already return; - Spatial *s = p_node->cast_to<Spatial>(); - if (s) { + if (p_node->cast_to<Spatial>() || p_node->cast_to<WorldEnvironment>()) { - s->notification(Spatial::NOTIFICATION_EXIT_WORLD, true); + p_node->notification(Spatial::NOTIFICATION_EXIT_WORLD); } else { Viewport *v = p_node->cast_to<Viewport>(); if (v) { |