summaryrefslogtreecommitdiff
path: root/scene/main
diff options
context:
space:
mode:
authorJuan Linietsky <reduzio@gmail.com>2017-06-24 08:58:27 -0300
committerJuan Linietsky <reduzio@gmail.com>2017-06-24 08:58:27 -0300
commit0cac32910a1026517b9fc782d72824c80baf676e (patch)
tree67b03361c481f24eefabfdc2eb55ab0cdf86b3e9 /scene/main
parent6ba1e4677ba15992c750bddffcb9f1eacd1558a1 (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.cpp11
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) {