From b3a1cad0e1aaae1cbc8afd89cec0d70fc0a6e94c Mon Sep 17 00:00:00 2001 From: MihailRis Date: Mon, 6 May 2024 17:15:48 +0300 Subject: [PATCH] msvc build fix --- src/assets/assetload_funcs.cpp | 4 ++-- src/frontend/screens/LevelScreen.cpp | 2 +- src/graphics/ui/elements/Container.cpp | 2 ++ src/graphics/ui/elements/Panel.cpp | 2 ++ src/world/Level.cpp | 4 ++-- 5 files changed, 9 insertions(+), 5 deletions(-) diff --git a/src/assets/assetload_funcs.cpp b/src/assets/assetload_funcs.cpp index 0d1aa152..336f2067 100644 --- a/src/assets/assetload_funcs.cpp +++ b/src/assets/assetload_funcs.cpp @@ -93,7 +93,7 @@ assetload::postfunc assetload::atlas( ) { AtlasBuilder builder; for (const auto& file : paths->listdir(directory)) { - if (!imageio::is_read_supported(file.extension())) + if (!imageio::is_read_supported(file.extension().u8string())) continue; if (!append_atlas(builder, file)) continue; @@ -289,7 +289,7 @@ static bool animation( read_anim_file(animFile, frameList); } for (const auto& file : paths->listdir(animsDir + "/" + name)) { - if (!frameList.empty() && !contains(frameList, file.stem())) { + if (!frameList.empty() && !contains(frameList, file.stem().u8string())) { continue; } if (!append_atlas(builder, file)) diff --git a/src/frontend/screens/LevelScreen.cpp b/src/frontend/screens/LevelScreen.cpp index 10fed5e5..0eaaf820 100644 --- a/src/frontend/screens/LevelScreen.cpp +++ b/src/frontend/screens/LevelScreen.cpp @@ -84,7 +84,7 @@ void LevelScreen::saveWorldPreview() { worldRenderer->draw(ctx, &camera, false, postProcessing.get()); auto image = postProcessing->toImage(); image->flipY(); - imageio::write(paths->resolve("world:preview.png"), image.get()); + imageio::write(paths->resolve("world:preview.png").u8string(), image.get()); } catch (const std::exception& err) { logger.error() << err.what(); } diff --git a/src/graphics/ui/elements/Container.cpp b/src/graphics/ui/elements/Container.cpp index 7f547c24..a95ef9ac 100644 --- a/src/graphics/ui/elements/Container.cpp +++ b/src/graphics/ui/elements/Container.cpp @@ -3,6 +3,8 @@ #include "../../core/DrawContext.hpp" #include "../../core/Batch2D.hpp" +#include + using namespace gui; Container::Container(glm::vec2 size) : UINode(size) { diff --git a/src/graphics/ui/elements/Panel.cpp b/src/graphics/ui/elements/Panel.cpp index 036161ed..2e09ac7c 100644 --- a/src/graphics/ui/elements/Panel.cpp +++ b/src/graphics/ui/elements/Panel.cpp @@ -1,5 +1,7 @@ #include "Panel.hpp" +#include + using namespace gui; Panel::Panel(glm::vec2 size, glm::vec4 padding, float interval) diff --git a/src/world/Level.cpp b/src/world/Level.cpp index f4b7610c..db376190 100644 --- a/src/world/Level.cpp +++ b/src/world/Level.cpp @@ -53,8 +53,8 @@ Level::~Level(){ void Level::loadMatrix(int32_t x, int32_t z, uint32_t radius) { chunks->setCenter(x, z); uint32_t diameter = std::min( - radius*2L, - (settings.chunks.loadDistance.get() + settings.chunks.padding.get()) * 2 + radius*2LL, + (settings.chunks.loadDistance.get() + settings.chunks.padding.get()) * 2LL ); if (chunks->w != diameter) { chunks->resize(diameter, diameter);