mirror of
https://github.com/MaSzyna-EU07/maszyna.git
synced 2026-03-22 15:05:03 +01:00
work
This commit is contained in:
@@ -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
|
||||
|
||||
@@ -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")) {
|
||||
|
||||
@@ -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<std::filesystem::path> skins;
|
||||
deferred_image mini;
|
||||
|
||||
Reference in New Issue
Block a user