[Patcher] Allow loading patches from non-utf8 paths
This commit is contained in:
parent
6e1e62378f
commit
fd78ab4dfc
|
@ -9,7 +9,6 @@
|
||||||
|
|
||||||
#include "config.h"
|
#include "config.h"
|
||||||
|
|
||||||
#include "third_party/cpptoml/include/cpptoml.h"
|
|
||||||
#include "third_party/fmt/include/fmt/format.h"
|
#include "third_party/fmt/include/fmt/format.h"
|
||||||
#include "xenia/base/assert.h"
|
#include "xenia/base/assert.h"
|
||||||
#include "xenia/base/cvar.h"
|
#include "xenia/base/cvar.h"
|
||||||
|
|
|
@ -11,6 +11,10 @@
|
||||||
#define XENIA_CONFIG_H_
|
#define XENIA_CONFIG_H_
|
||||||
|
|
||||||
#include <filesystem>
|
#include <filesystem>
|
||||||
|
#include "third_party/cpptoml/include/cpptoml.h"
|
||||||
|
|
||||||
|
std::shared_ptr<cpptoml::table> ParseFile(
|
||||||
|
const std::filesystem::path& filename);
|
||||||
|
|
||||||
namespace config {
|
namespace config {
|
||||||
void SetupConfig(const std::filesystem::path& config_folder);
|
void SetupConfig(const std::filesystem::path& config_folder);
|
||||||
|
|
|
@ -8,6 +8,7 @@
|
||||||
*/
|
*/
|
||||||
#include <regex>
|
#include <regex>
|
||||||
|
|
||||||
|
#include "xenia/config.h"
|
||||||
#include "xenia/base/cvar.h"
|
#include "xenia/base/cvar.h"
|
||||||
#include "xenia/base/filesystem.h"
|
#include "xenia/base/filesystem.h"
|
||||||
#include "xenia/base/logging.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;
|
std::shared_ptr<cpptoml::table> patch_toml_fields;
|
||||||
|
|
||||||
try {
|
try {
|
||||||
patch_toml_fields = cpptoml::parse_file(path_to_utf8(file_path));
|
patch_toml_fields = ParseFile(file_path);
|
||||||
} catch (...) {
|
} catch (...) {
|
||||||
XELOGE("PatchDB: Cannot load patch file: {}", path_to_utf8(file_path));
|
XELOGE("PatchDB: Cannot load patch file: {}", path_to_utf8(file_path));
|
||||||
patch_file.title_id = -1;
|
patch_file.title_id = -1;
|
||||||
|
|
Loading…
Reference in New Issue