diff --git a/launcher/scenery_list.h b/launcher/scenery_list.h index 70df4cd8..da5ee7eb 100644 --- a/launcher/scenery_list.h +++ b/launcher/scenery_list.h @@ -15,5 +15,7 @@ class scenerylist_panel : public ui_panel private: scenery_scanner scanner; scenery_desc const *selected_scenery = nullptr; + + vehicles_bank &bank; }; } // namespace ui diff --git a/launcher/textures_scanner.cpp b/launcher/textures_scanner.cpp index 0e6d53c5..14140cb2 100644 --- a/launcher/textures_scanner.cpp +++ b/launcher/textures_scanner.cpp @@ -1,41 +1,7 @@ #include "stdafx.h" #include "textures_scanner.h" -#include "renderer.h" #include "utilities.h" -GLuint ui::deferred_image::get() const -{ - if (!path.empty()) { - image = GfxRenderer.Fetch_Texture(path, true); - path.clear(); - } - - if (image != null_handle) { - opengl_texture &tex = GfxRenderer.Texture(image); - tex.create(); - - if (tex.is_ready) - return tex.id; - } - - return -1; -} - -ui::deferred_image::operator bool() const -{ - return image != null_handle || !path.empty(); -} - -glm::ivec2 ui::deferred_image::size() const -{ - if (image != null_handle) { - opengl_texture &tex = GfxRenderer.Texture(image); - return glm::ivec2(tex.width(), tex.height()); - } - return glm::ivec2(); -} - - void ui::vehicles_bank::scan_textures() { for (auto &f : std::filesystem::recursive_directory_iterator("dynamic")) { diff --git a/launcher/textures_scanner.h b/launcher/textures_scanner.h index 4aaa17bc..2599d51a 100644 --- a/launcher/textures_scanner.h +++ b/launcher/textures_scanner.h @@ -1,6 +1,6 @@ #pragma once -#include "Texture.h" +#include "deferred_image.h" namespace ui { enum class vehicle_type { @@ -22,23 +22,6 @@ enum class vehicle_type { unknown }; -class deferred_image { -public: - deferred_image() = default; - deferred_image(const std::string &p) : path(p) { } - deferred_image(const deferred_image&) = delete; - deferred_image(deferred_image&&) = default; - deferred_image &operator=(deferred_image&&) = default; - operator bool() const; - - GLuint get() const; - glm::ivec2 size() const; - -private: - mutable std::string path; - mutable texture_handle image = 0; -}; - struct skin_set { std::vector skins; deferred_image mini;