fix windows build
This commit is contained in:
parent
8a12ff5879
commit
94bae83de6
@ -761,7 +761,7 @@ void ContentLoader::load() {
|
|||||||
auto folder = pack->folder;
|
auto folder = pack->folder;
|
||||||
|
|
||||||
// Load world generators
|
// Load world generators
|
||||||
io::path generatorsDir = folder / fs::u8path("generators");
|
io::path generatorsDir = folder / "generators";
|
||||||
foreach_file(generatorsDir, [this](const io::path& file) {
|
foreach_file(generatorsDir, [this](const io::path& file) {
|
||||||
std::string name = file.stem();
|
std::string name = file.stem();
|
||||||
auto [packid, full, filename] = create_unit_id(pack->id, name);
|
auto [packid, full, filename] = create_unit_id(pack->id, name);
|
||||||
@ -816,7 +816,7 @@ void ContentLoader::load() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Load skeletons
|
// Load skeletons
|
||||||
io::path skeletonsDir = folder / fs::u8path("skeletons");
|
io::path skeletonsDir = folder / "skeletons";
|
||||||
foreach_file(skeletonsDir, [this](const io::path& file) {
|
foreach_file(skeletonsDir, [this](const io::path& file) {
|
||||||
std::string name = pack->id + ":" + file.stem();
|
std::string name = pack->id + ":" + file.stem();
|
||||||
std::string text = io::read_string(file);
|
std::string text = io::read_string(file);
|
||||||
@ -875,7 +875,7 @@ void ContentLoader::loadScripts(Content& content) {
|
|||||||
);
|
);
|
||||||
}
|
}
|
||||||
// Load entity components
|
// Load entity components
|
||||||
io::path componentsDir = folder / fs::u8path("scripts/components");
|
io::path componentsDir = folder / "scripts/components";
|
||||||
foreach_file(componentsDir, [&pack](const io::path& file) {
|
foreach_file(componentsDir, [&pack](const io::path& file) {
|
||||||
auto name = pack.id + ":" + file.stem();
|
auto name = pack.id + ":" + file.stem();
|
||||||
scripting::load_entity_component(
|
scripting::load_entity_component(
|
||||||
|
|||||||
@ -326,8 +326,8 @@ void Engine::loadAssets() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
static void load_configs(const io::path& root) {
|
static void load_configs(const io::path& root) {
|
||||||
auto configFolder = root/io::path("config");
|
auto configFolder = root / "config";
|
||||||
auto bindsFile = configFolder/io::path("bindings.toml");
|
auto bindsFile = configFolder / "bindings.toml";
|
||||||
if (io::is_regular_file(bindsFile)) {
|
if (io::is_regular_file(bindsFile)) {
|
||||||
Events::loadBindings(
|
Events::loadBindings(
|
||||||
bindsFile.string(), io::read_string(bindsFile), BindType::BIND
|
bindsFile.string(), io::read_string(bindsFile), BindType::BIND
|
||||||
|
|||||||
@ -98,10 +98,8 @@ io::path EnginePaths::getNewScreenshotFile(const std::string& ext) {
|
|||||||
auto file = folder / ("screenshot-" + datetimestr + "." + ext);
|
auto file = folder / ("screenshot-" + datetimestr + "." + ext);
|
||||||
uint index = 0;
|
uint index = 0;
|
||||||
while (io::exists(file)) {
|
while (io::exists(file)) {
|
||||||
file = folder / fs::u8path(
|
file = folder / ("screenshot-" + datetimestr + "-" +
|
||||||
"screenshot-" + datetimestr + "-" +
|
std::to_string(index) + "." + ext);
|
||||||
std::to_string(index) + "." + ext
|
|
||||||
);
|
|
||||||
index++;
|
index++;
|
||||||
}
|
}
|
||||||
return file;
|
return file;
|
||||||
|
|||||||
@ -45,7 +45,7 @@ static int l_get_list(lua::State* L) {
|
|||||||
const auto& folder = worlds[i];
|
const auto& folder = worlds[i];
|
||||||
|
|
||||||
auto root =
|
auto root =
|
||||||
json::parse(io::read_string(folder / fs::u8path("world.json")));
|
json::parse(io::read_string(folder / "world.json"));
|
||||||
const auto& versionMap = root["version"];
|
const auto& versionMap = root["version"];
|
||||||
int versionMajor = versionMap["major"].asInteger();
|
int versionMajor = versionMap["major"].asInteger();
|
||||||
int versionMinor = versionMap["minor"].asInteger();
|
int versionMinor = versionMap["minor"].asInteger();
|
||||||
@ -59,8 +59,8 @@ static int l_get_list(lua::State* L) {
|
|||||||
if (!engine->isHeadless() && !AssetsLoader::loadExternalTexture(
|
if (!engine->isHeadless() && !AssetsLoader::loadExternalTexture(
|
||||||
assets,
|
assets,
|
||||||
icon,
|
icon,
|
||||||
{worlds[i] / fs::path("icon.png"),
|
{worlds[i] / "icon.png",
|
||||||
worlds[i] / fs::path("preview.png")}
|
worlds[i] / "preview.png"}
|
||||||
)) {
|
)) {
|
||||||
icon = "gui/no_world_icon";
|
icon = "gui/no_world_icon";
|
||||||
}
|
}
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user