From b72cc00ee1b45aaa5c0589094571ff9e5dd0b104 Mon Sep 17 00:00:00 2001 From: Relintai Date: Tue, 30 Aug 2022 19:22:22 +0200 Subject: [PATCH] Small fixes to the World override system. Still needs work though. --- scene/main/world.cpp | 10 +++++----- scene/main/world.h | 9 +++++---- 2 files changed, 10 insertions(+), 9 deletions(-) diff --git a/scene/main/world.cpp b/scene/main/world.cpp index afaf66fed..3bd355431 100644 --- a/scene/main/world.cpp +++ b/scene/main/world.cpp @@ -223,7 +223,7 @@ void World::set_override_world(World *p_world) { if (_override_world) { _override_world->_overriding_world = this; - _add_override_cameras_into(_override_world); + _add_override_cameras(_override_world); } _on_after_world_override_changed(); @@ -380,7 +380,7 @@ void World::_world_3d_remove_camera_no_override(Camera *p_camera) { } void World::_world_3d_register_camera_as_override(Camera *p_camera) { - find_world_3d_no_override()->_register_camera(p_camera); + //find_world_3d_no_override()->_register_camera(p_camera); _override_cameras.push_back(p_camera); @@ -388,7 +388,7 @@ void World::_world_3d_register_camera_as_override(Camera *p_camera) { } void World::_world_3d_remove_camera_as_override(Camera *p_camera) { - find_world_3d_no_override()->_remove_camera(p_camera); + //find_world_3d_no_override()->_remove_camera(p_camera); _override_cameras.erase(p_camera); @@ -404,10 +404,10 @@ void World::_clear_override_cameras() { _own_active_camera = NULL; } -void World::_add_override_cameras_into(World *p_from) { +void World::_add_override_cameras(World *p_from) { _own_active_camera = camera; - Ref w3d = find_world_3d_no_override(); + Ref w3d = p_from->find_world_3d_no_override(); ERR_FAIL_COND(!w3d.is_valid()); diff --git a/scene/main/world.h b/scene/main/world.h index 62d762e4a..a23588a13 100644 --- a/scene/main/world.h +++ b/scene/main/world.h @@ -44,7 +44,7 @@ public: // Viewport root // -- World w1 - // ---- PanelContainer pc + // ---- PanelContainer pc // w1 is set as override for the root. // pc's CanvasItem will use the canvas in w1, and will likely call gui_reset_canvas_sort_index() in w1 at least some point. @@ -85,7 +85,7 @@ public: void _world_3d_register_camera_as_override(Camera *p_camera); void _world_3d_remove_camera_as_override(Camera *p_camera); void _clear_override_cameras(); - void _add_override_cameras_into(World *p_from); + void _add_override_cameras(World *p_from); World(); ~World(); @@ -126,11 +126,12 @@ protected: World *_override_world; World *_overriding_world; - Vector _override_cameras; - Camera *camera; Set cameras; Camera *_own_active_camera; + Vector _override_cameras; + + //override canvas layers vec remove /add on override set, and unset Size2 size; };