From 85b80f4be7595b6644203756a9574ee62de735e3 Mon Sep 17 00:00:00 2001 From: Deukhoofd Date: Sun, 29 Aug 2021 12:14:27 +0200 Subject: [PATCH] Bunch of fixes for Windows. --- BuildItems.cpp | 4 ++-- BuildLibrary.cpp | 16 ++++++++-------- 2 files changed, 10 insertions(+), 10 deletions(-) diff --git a/BuildItems.cpp b/BuildItems.cpp index d578ae8..4d96dd8 100644 --- a/BuildItems.cpp +++ b/BuildItems.cpp @@ -54,10 +54,10 @@ PkmnLib::Library::ItemLibrary* BuildItems::Build(const std::string& path) { GET(val, flingPower, i); auto itemTypeStr = _itemType.get(); CreatureLib::Library::ItemCategory itemType = ParseItemCategory(itemTypeStr); - if (static_cast(itemType) == 255) + if (static_cast(itemType) == 255) return nullptr; - auto flags = std::unordered_set(); + auto flags = std::unordered_set(); for (auto& flagIndex : _flags.items()) { flags.insert(ArbUt::StringView(flagIndex.value().get().c_str())); } diff --git a/BuildLibrary.cpp b/BuildLibrary.cpp index 3f9a226..2e1641f 100644 --- a/BuildLibrary.cpp +++ b/BuildLibrary.cpp @@ -21,38 +21,38 @@ void BuildLibrary::LogBuildTimes() { std::cout << "\tScripts Time: " << ScriptsTimeMs << "ms" << std::endl; } - BattleLibrary* BuildLibrary::Build(const std::string& pathString, std::function onScriptInitialize) { auto path = std::filesystem::path(pathString); std::chrono::steady_clock::time_point begin = std::chrono::steady_clock::now(); - auto* typesLibrary = BuildTypes::Build(path / "Types.csv"); + auto* typesLibrary = BuildTypes::Build((path / "Types.csv").generic_string()); TypeTimeMs = std::chrono::duration_cast(std::chrono::steady_clock::now() - begin).count(); begin = std::chrono::steady_clock::now(); - auto* natureLibrary = BuildNatures::Build(path / "Natures.csv"); + auto* natureLibrary = BuildNatures::Build((path / "Natures.csv").generic_string()); NaturesTimeMs = std::chrono::duration_cast(std::chrono::steady_clock::now() - begin).count(); begin = std::chrono::steady_clock::now(); - auto* movesLibrary = BuildMoves::Build(path / "Moves.json", typesLibrary); + auto* movesLibrary = BuildMoves::Build((path / "Moves.json").generic_string(), typesLibrary); MovesTimeMs = std::chrono::duration_cast(std::chrono::steady_clock::now() - begin).count(); begin = std::chrono::steady_clock::now(); - auto* speciesLibrary = BuildSpecies::BuildLibrary(path / "Pokemon.json", typesLibrary, movesLibrary); + auto* speciesLibrary = + BuildSpecies::BuildLibrary((path / "Pokemon.json").generic_string(), typesLibrary, movesLibrary); SpeciesTimeMs = std::chrono::duration_cast(std::chrono::steady_clock::now() - begin).count(); begin = std::chrono::steady_clock::now(); - auto* itemsLibrary = BuildItems::Build(path / "Items.json"); + auto* itemsLibrary = BuildItems::Build((path / "Items.json").generic_string()); ItemsTimeMs = std::chrono::duration_cast(std::chrono::steady_clock::now() - begin).count(); begin = std::chrono::steady_clock::now(); - auto* growthRates = GrowthRatesBuilder::Build(path / "GrowthRates.json"); + auto* growthRates = GrowthRatesBuilder::Build((path / "GrowthRates.json").generic_string()); GrowthRateTimeMs = std::chrono::duration_cast(std::chrono::steady_clock::now() - begin).count(); @@ -89,7 +89,7 @@ BattleLibrary* BuildLibrary::Build(const std::string& pathString, continue; std::ifstream in(dirEntry.path()); std::string contents((std::istreambuf_iterator(in)), std::istreambuf_iterator()); - asScriptResolver->CreateScript(dirEntry.path().c_str(), contents.c_str()); + asScriptResolver->CreateScript((const char*)dirEntry.path().c_str(), contents.c_str()); } asScriptResolver->FinalizeModule(); ScriptsTimeMs =