diff --git a/src/io/engine_paths.cpp b/src/io/engine_paths.cpp index 39cc8882..5a0f0cb6 100644 --- a/src/io/engine_paths.cpp +++ b/src/io/engine_paths.cpp @@ -17,13 +17,13 @@ namespace fs = std::filesystem; static debug::Logger logger("engine-paths"); -static inline auto SCREENSHOTS_FOLDER = std::filesystem::u8path("screenshots"); -static inline auto CONTENT_FOLDER = std::filesystem::u8path("content"); -static inline auto WORLDS_FOLDER = std::filesystem::u8path("worlds"); -static inline auto CONFIG_FOLDER = io::path("config"); -static inline auto EXPORT_FOLDER = io::path("export"); -static inline auto CONTROLS_FILE = std::filesystem::u8path("controls.toml"); -static inline auto SETTINGS_FILE = std::filesystem::u8path("settings.toml"); +static inline io::path SCREENSHOTS_FOLDER = "screenshots"; +static inline io::path CONTENT_FOLDER = "content"; +static inline io::path WORLDS_FOLDER = "worlds"; +static inline io::path CONFIG_FOLDER = "config"; +static inline io::path EXPORT_FOLDER = "export"; +static inline io::path CONTROLS_FILE = "controls.toml"; +static inline io::path SETTINGS_FILE = "settings.toml"; static io::path toCanonic(io::path path) { std::stack parts; @@ -46,7 +46,7 @@ static io::path toCanonic(io::path path) { throw files_access_error("entry point reached"); } - path = path / std::filesystem::path(part); + path = path / part; } return path; } @@ -118,7 +118,7 @@ io::path EnginePaths::getCurrentWorldFolder() { } io::path EnginePaths::getWorldFolderByName(const std::string& name) { - return getWorldsFolder() / std::filesystem::path(name); + return getWorldsFolder() / name; } io::path EnginePaths::getControlsFile() const { @@ -230,7 +230,7 @@ std::vector ResPaths::listdirRaw(const std::string& folderName) con std::vector entries; for (int i = roots.size() - 1; i >= 0; i--) { auto& root = roots[i]; - auto folder = root.path / fs::u8path(folderName); + auto folder = root.path / folderName; if (!io::is_directory(folder)) continue; for (const auto& file : io::directory_iterator(folder)) { entries.emplace_back(root.name + ":" + folderName + "/" + file.name()); diff --git a/src/logic/scripting/lua/lua_engine.cpp b/src/logic/scripting/lua/lua_engine.cpp index 59b9cc39..251f789b 100644 --- a/src/logic/scripting/lua/lua_engine.cpp +++ b/src/logic/scripting/lua/lua_engine.cpp @@ -125,7 +125,7 @@ void lua::initialize(const EnginePaths& paths, const CoreParameters& params) { main_thread = create_state( paths, params.headless ? StateType::SCRIPT : StateType::BASE ); - lua::pushstring(main_thread, params.scriptFile.stem()); + lua::pushstring(main_thread, params.scriptFile.stem().u8string()); lua::setglobal(main_thread, "__VC_SCRIPT_NAME"); }