From 914528180f5a95d61d544d2bed42c03a880d82d7 Mon Sep 17 00:00:00 2001 From: kobewi Date: Thu, 25 Apr 2024 23:42:44 +0200 Subject: [PATCH] Misc code cleanup --- editor/editor_about.cpp | 1 - scene/gui/texture_progress_bar.cpp | 12 ++++++------ servers/rendering/rendering_server_default.h | 4 ---- 3 files changed, 6 insertions(+), 11 deletions(-) diff --git a/editor/editor_about.cpp b/editor/editor_about.cpp index 61c4eed6691a..af0419a81a68 100644 --- a/editor/editor_about.cpp +++ b/editor/editor_about.cpp @@ -63,7 +63,6 @@ void EditorAbout::_notification(int p_what) { _logo->set_texture(get_editor_theme_icon(SNAME("Logo"))); - Ref empty_stylebox = memnew(StyleBoxEmpty); for (ItemList *il : name_lists) { for (int i = 0; i < il->get_item_count(); i++) { if (il->get_item_metadata(i)) { diff --git a/scene/gui/texture_progress_bar.cpp b/scene/gui/texture_progress_bar.cpp index 5261cbe3eb56..fc9ac2ab18a8 100644 --- a/scene/gui/texture_progress_bar.cpp +++ b/scene/gui/texture_progress_bar.cpp @@ -494,7 +494,7 @@ void TextureProgressBar::_notification(int p_what) { Rect2 source = Rect2(Point2(), progress->get_size()); draw_texture_rect_region(progress, region, source, tint_progress); } else if (val != 0) { - Array pts; + LocalVector pts; float direction = mode == FILL_COUNTER_CLOCKWISE ? -1 : 1; float start; @@ -507,11 +507,11 @@ void TextureProgressBar::_notification(int p_what) { float end = start + direction * val; float from = MIN(start, end); float to = MAX(start, end); - pts.append(from); + pts.push_back(from); for (float corner = Math::floor(from * 4 + 0.5) * 0.25 + 0.125; corner < to; corner += 0.25) { - pts.append(corner); + pts.push_back(corner); } - pts.append(to); + pts.push_back(to); Ref atlas_progress = progress; bool valid_atlas_progress = atlas_progress.is_valid() && atlas_progress->get_atlas().is_valid(); @@ -524,8 +524,8 @@ void TextureProgressBar::_notification(int p_what) { Vector uvs; Vector points; - for (int i = 0; i < pts.size(); i++) { - Point2 uv = unit_val_to_uv(pts[i]); + for (const float &f : pts) { + Point2 uv = unit_val_to_uv(f); if (uvs.find(uv) >= 0) { continue; } diff --git a/servers/rendering/rendering_server_default.h b/servers/rendering/rendering_server_default.h index f94323f198e4..8de76c7dbcd0 100644 --- a/servers/rendering/rendering_server_default.h +++ b/servers/rendering/rendering_server_default.h @@ -105,10 +105,6 @@ class RenderingServerDefault : public RenderingServer { _changes_changed(); } -#define DISPLAY_CHANGED \ - changes++; \ - _changes_changed(); - #else _FORCE_INLINE_ static void redraw_request() { changes++;