Add xdelta3 and file patching interface

This commit is contained in:
ManDude
2022-06-20 22:45:30 +01:00
parent d89a97b57c
commit f017106da1
108 changed files with 38670 additions and 49 deletions
+11
View File
@@ -240,6 +240,17 @@ Config read_config_file(const std::string& path_to_config_file,
config.import_deps_by_file =
import_deps.get<std::unordered_map<std::string, std::vector<std::string>>>();
config.write_patches = cfg.at("write_patches").get<bool>();
config.apply_patches = cfg.at("apply_patches").get<bool>();
const auto& object_patches = cfg.at("object_patches");
for (auto& [obj, pch] : object_patches.items()) {
ObjectPatchInfo new_pch;
new_pch.crc = (u32)std::stoull(pch.at("crc32").get<std::string>(), nullptr, 16);
new_pch.target_file = pch.at("in").get<std::string>();
new_pch.patch_file = pch.at("out").get<std::string>();
config.object_patches.insert({obj, new_pch});
}
return config;
}