From 45889a40a1324e38ef276b1468cc18d7fc8fdbcf Mon Sep 17 00:00:00 2001 From: jerrrrycho Date: Thu, 29 Jan 2026 08:06:49 +0100 Subject: [PATCH] remove legacy background loading --- launcher/launcheruilayer.cpp | 1 - scenarioloaderuilayer.cpp | 1 - uilayer.cpp | 14 -------------- uilayer.h | 1 - 4 files changed, 17 deletions(-) diff --git a/launcher/launcheruilayer.cpp b/launcher/launcheruilayer.cpp index 291f612d..5700bf95 100644 --- a/launcher/launcheruilayer.cpp +++ b/launcher/launcheruilayer.cpp @@ -15,7 +15,6 @@ launcher_ui::launcher_ui() : m_scenery_scanner(m_vehicles_bank), m_scenerylist_p open_panel(&m_vehiclepicker_panel); m_suppress_menu = true; - load_random_background(); } bool launcher_ui::on_key(const int Key, const int Action) diff --git a/scenarioloaderuilayer.cpp b/scenarioloaderuilayer.cpp index 8d6d9610..b9bbd289 100644 --- a/scenarioloaderuilayer.cpp +++ b/scenarioloaderuilayer.cpp @@ -19,7 +19,6 @@ using json = nlohmann::json; scenarioloader_ui::scenarioloader_ui() { m_suppress_menu = true; - load_random_background(); generate_gradient_tex(); load_wheel_frames(); diff --git a/uilayer.cpp b/uilayer.cpp index 803167bd..bbdf4f65 100644 --- a/uilayer.cpp +++ b/uilayer.cpp @@ -129,20 +129,6 @@ bool ui_layer::mouse_button_callback(int button, int action, int mods) return m_imguiio->WantCaptureMouse; } -void ui_layer::load_random_background() -{ - std::vector images; - for (auto &f : std::filesystem::directory_iterator("textures/logo")) - if (f.is_regular_file()) - images.emplace_back(std::filesystem::relative(f.path(), "textures/").string()); - - if (!images.empty()) - { - std::string &selected = images[std::lround(LocalRandom(images.size() - 1))]; - set_background(selected); - } -} - static ImVec4 imvec_lerp(const ImVec4 &a, const ImVec4 &b, float t) { return ImVec4(a.x + (b.x - a.x) * t, a.y + (b.y - a.y) * t, a.z + (b.z - a.z) * t, a.w + (b.w - a.w) * t); diff --git a/uilayer.h b/uilayer.h index 3cb4ddbf..c78a6d49 100644 --- a/uilayer.h +++ b/uilayer.h @@ -129,7 +129,6 @@ protected: static ImGuiIO *m_imguiio; static bool m_cursorvisible; - void load_random_background(); virtual void render_menu_contents(); ui_log_panel m_logpanel { "Log", true }; bool m_suppress_menu = false; // if `true`, the menu at the top of the window will not be present