This commit is contained in:
milek7
2019-08-15 15:08:17 +02:00
parent 7f0dfa708e
commit 878b8621f0
3 changed files with 3 additions and 52 deletions

View File

@@ -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")) {