[Patcher] Allow loading patches from non-utf8 paths

This commit is contained in:
Gliniak 2022-07-18 08:46:04 +02:00
parent 6e1e62378f
commit fd78ab4dfc
3 changed files with 6 additions and 2 deletions

View File

@ -9,7 +9,6 @@
#include "config.h"
#include "third_party/cpptoml/include/cpptoml.h"
#include "third_party/fmt/include/fmt/format.h"
#include "xenia/base/assert.h"
#include "xenia/base/cvar.h"

View File

@ -11,6 +11,10 @@
#define XENIA_CONFIG_H_
#include <filesystem>
#include "third_party/cpptoml/include/cpptoml.h"
std::shared_ptr<cpptoml::table> ParseFile(
const std::filesystem::path& filename);
namespace config {
void SetupConfig(const std::filesystem::path& config_folder);

View File

@ -8,6 +8,7 @@
*/
#include <regex>
#include "xenia/config.h"
#include "xenia/base/cvar.h"
#include "xenia/base/filesystem.h"
#include "xenia/base/logging.h"
@ -61,7 +62,7 @@ PatchFileEntry PatchDB::ReadPatchFile(const std::filesystem::path& file_path) {
std::shared_ptr<cpptoml::table> patch_toml_fields;
try {
patch_toml_fields = cpptoml::parse_file(path_to_utf8(file_path));
patch_toml_fields = ParseFile(file_path);
} catch (...) {
XELOGE("PatchDB: Cannot load patch file: {}", path_to_utf8(file_path));
patch_file.title_id = -1;