summaryrefslogtreecommitdiff
path: root/scene/main
diff options
context:
space:
mode:
Diffstat (limited to 'scene/main')
-rw-r--r--scene/main/resource_preloader.cpp6
-rw-r--r--scene/main/viewport.cpp40
-rw-r--r--scene/main/window.cpp12
3 files changed, 29 insertions, 29 deletions
diff --git a/scene/main/resource_preloader.cpp b/scene/main/resource_preloader.cpp
index b3595c6227..71e62fe804 100644
--- a/scene/main/resource_preloader.cpp
+++ b/scene/main/resource_preloader.cpp
@@ -62,9 +62,9 @@ Array ResourcePreloader::_get_resources() const {
}
int i = 0;
- for (RBSet<String>::Element *E = sorted_names.front(); E; E = E->next()) {
- names.set(i, E->get());
- arr[i] = resources[E->get()];
+ for (const String &E : sorted_names) {
+ names.set(i, E);
+ arr[i] = resources[E];
i++;
}
diff --git a/scene/main/viewport.cpp b/scene/main/viewport.cpp
index 0be4216e99..590c73de0b 100644
--- a/scene/main/viewport.cpp
+++ b/scene/main/viewport.cpp
@@ -412,9 +412,9 @@ void Viewport::_notification(int p_what) {
#ifndef _3D_DISABLED
if (audio_listener_3d_set.size() && !audio_listener_3d) {
AudioListener3D *first = nullptr;
- for (RBSet<AudioListener3D *>::Element *E = audio_listener_3d_set.front(); E; E = E->next()) {
- if (first == nullptr || first->is_greater_than(E->get())) {
- first = E->get();
+ for (AudioListener3D *E : audio_listener_3d_set) {
+ if (first == nullptr || first->is_greater_than(E)) {
+ first = E;
}
}
@@ -426,9 +426,9 @@ void Viewport::_notification(int p_what) {
if (camera_3d_set.size() && !camera_3d) {
// There are cameras but no current camera, pick first in tree and make it current.
Camera3D *first = nullptr;
- for (RBSet<Camera3D *>::Element *E = camera_3d_set.front(); E; E = E->next()) {
- if (first == nullptr || first->is_greater_than(E->get())) {
- first = E->get();
+ for (Camera3D *E : camera_3d_set) {
+ if (first == nullptr || first->is_greater_than(E)) {
+ first = E;
}
}
@@ -647,13 +647,13 @@ void Viewport::_process_picking() {
uint64_t frame = get_tree()->get_frame();
PhysicsDirectSpaceState2D::ShapeResult res[64];
- for (RBSet<CanvasLayer *>::Element *E = canvas_layers.front(); E; E = E->next()) {
+ for (const CanvasLayer *E : canvas_layers) {
Transform2D canvas_transform;
ObjectID canvas_layer_id;
- if (E->get()) {
+ if (E) {
// A descendant CanvasLayer.
- canvas_transform = E->get()->get_transform();
- canvas_layer_id = E->get()->get_instance_id();
+ canvas_transform = E->get_transform();
+ canvas_layer_id = E->get_instance_id();
} else {
// This Viewport's builtin canvas.
canvas_transform = get_canvas_transform();
@@ -3202,18 +3202,18 @@ void Viewport::_audio_listener_3d_remove(AudioListener3D *p_listener) {
void Viewport::_audio_listener_3d_make_next_current(AudioListener3D *p_exclude) {
if (audio_listener_3d_set.size() > 0) {
- for (RBSet<AudioListener3D *>::Element *E = audio_listener_3d_set.front(); E; E = E->next()) {
- if (p_exclude == E->get()) {
+ for (AudioListener3D *E : audio_listener_3d_set) {
+ if (p_exclude == E) {
continue;
}
- if (!E->get()->is_inside_tree()) {
+ if (!E->is_inside_tree()) {
continue;
}
if (audio_listener_3d != nullptr) {
return;
}
- E->get()->make_current();
+ E->make_current();
}
} else {
// Attempt to reset listener to the camera position.
@@ -3290,18 +3290,18 @@ void Viewport::_camera_3d_remove(Camera3D *p_camera) {
}
void Viewport::_camera_3d_make_next_current(Camera3D *p_exclude) {
- for (RBSet<Camera3D *>::Element *E = camera_3d_set.front(); E; E = E->next()) {
- if (p_exclude == E->get()) {
+ for (Camera3D *E : camera_3d_set) {
+ if (p_exclude == E) {
continue;
}
- if (!E->get()->is_inside_tree()) {
+ if (!E->is_inside_tree()) {
continue;
}
if (camera_3d != nullptr) {
return;
}
- E->get()->make_current();
+ E->make_current();
}
}
@@ -3936,8 +3936,8 @@ Viewport::Viewport() {
Viewport::~Viewport() {
// Erase itself from viewport textures.
- for (RBSet<ViewportTexture *>::Element *E = viewport_textures.front(); E; E = E->next()) {
- E->get()->vp = nullptr;
+ for (ViewportTexture *E : viewport_textures) {
+ E->vp = nullptr;
}
RenderingServer::get_singleton()->free(viewport);
}
diff --git a/scene/main/window.cpp b/scene/main/window.cpp
index d8264e7d33..193f18c075 100644
--- a/scene/main/window.cpp
+++ b/scene/main/window.cpp
@@ -263,9 +263,9 @@ void Window::_make_window() {
DisplayServer::get_singleton()->window_set_transient(window_id, transient_parent->window_id);
}
- for (RBSet<Window *>::Element *E = transient_children.front(); E; E = E->next()) {
- if (E->get()->window_id != DisplayServer::INVALID_WINDOW_ID) {
- DisplayServer::get_singleton()->window_set_transient(E->get()->window_id, transient_parent->window_id);
+ for (const Window *E : transient_children) {
+ if (E->window_id != DisplayServer::INVALID_WINDOW_ID) {
+ DisplayServer::get_singleton()->window_set_transient(E->window_id, transient_parent->window_id);
}
}
@@ -290,9 +290,9 @@ void Window::_clear_window() {
DisplayServer::get_singleton()->window_set_transient(window_id, DisplayServer::INVALID_WINDOW_ID);
}
- for (RBSet<Window *>::Element *E = transient_children.front(); E; E = E->next()) {
- if (E->get()->window_id != DisplayServer::INVALID_WINDOW_ID) {
- DisplayServer::get_singleton()->window_set_transient(E->get()->window_id, DisplayServer::INVALID_WINDOW_ID);
+ for (const Window *E : transient_children) {
+ if (E->window_id != DisplayServer::INVALID_WINDOW_ID) {
+ DisplayServer::get_singleton()->window_set_transient(E->window_id, DisplayServer::INVALID_WINDOW_ID);
}
}