d/config: re-organize decompiler/config and eliminate most of the duplication (#2185)

Reasons for doing so include:
1. This should stop the confusion around editing the wrong config file's
flags -- when for example, extracting a level. Common settings can be in
one central place, with bespoke overrides being provided for each
version
2. Less verbose way of supporting multiple game versions. You don't have
to duplicate the entire `type_casts` file for example, just add or
override the json objects required.
3. Makes the folder structure consistent, Jak 1's `all-types` is now in
a `jak1` folder, etc.
This commit is contained in:
Tyler Wilding
2023-03-08 20:07:26 -05:00
committed by GitHub
parent 0b8b927315
commit 6d99f1bfc1
84 changed files with 1905 additions and 13241 deletions
+7 -2
View File
@@ -44,12 +44,13 @@ int main(int argc, char** argv) {
fs::path in_folder;
fs::path out_folder;
std::string config_game_version = "";
std::string config_override = "{}";
CLI::App app{"OpenGOAL Decompiler"};
app.add_option("config-path", config_path,
"Path to the decompiler config .jsonc file. ie. "
"./decompiler/config/jak1_ntsc_black_label.jsonc")
"./decompiler/config/jak1/jak1_config.jsonc")
->required();
app.add_option("in-folder", in_folder,
"The path containing the iso_data folders. ie. ./iso_data/. Assumes the "
@@ -59,6 +60,10 @@ int main(int argc, char** argv) {
"The path for where the decompiler should place it's outputs. Assumes the "
"'gameName' from the config as a sub-directory")
->required();
app.add_option("--version", config_game_version,
"The name of the game version to update the config with, ie. ntsc_v2")
->required();
app.add_option("--config-override", config_override,
"JSON provided will be merged with the specified config, use to override options");
app.validate_positionals();
@@ -69,7 +74,7 @@ int main(int argc, char** argv) {
Config config;
try {
config = read_config_file(config_path, config_override);
config = read_config_file(config_path, config_game_version, config_override);
} catch (const std::exception& e) {
lg::error("Failed to parse config: {}", e.what());
return 1;