diff options
| author | inspectredc <78732756+inspectredc@users.noreply.github.com> | 2025-01-17 23:32:09 +0000 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2025-01-17 17:32:09 -0600 |
| commit | cc3063afe6168bb19bc5b37580716e2b2465c87d (patch) | |
| tree | 81cb8cb68a392dc80469897e4dbd26300f0c2336 /src/main.cpp | |
| parent | db4cb9a493e0dfee8e8fa6dc529390bb3321a771 (diff) | |
fix modding and headers (#171)
Diffstat (limited to 'src/main.cpp')
| -rw-r--r-- | src/main.cpp | 25 |
1 files changed, 19 insertions, 6 deletions
diff --git a/src/main.cpp b/src/main.cpp index 53c2c52..d3f6b44 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -72,11 +72,14 @@ int main(int argc, char *argv[]) { header->add_option("<baserom.z64>", filename, "")->required()->check(CLI::ExistingFile); header->add_flag("-o,--otr", otrModeSelected, "OTR/O2R Mode"); - if (otrModeSelected) { - otrMode = ArchiveType::OTR; - } header->parse_complete_callback([&] { + if (otrModeSelected) { + otrMode = ArchiveType::OTR; + } else { + otrMode = ArchiveType::None; + } + const auto instance = Companion::Instance = new Companion(filename, otrMode, debug); instance->Init(ExportType::Header); }); @@ -110,14 +113,24 @@ int main(int argc, char *argv[]) { const auto modding_import = modding_root->add_subcommand("import", "Import - Import modified files to generate C code\n"); const auto modding_export = modding_root->add_subcommand("export", "Export - Export modified files to a folder\n"); - modding_import->add_option("mode", mode, "code, binary or header")->required(); + modding_import->add_option("mode", mode, "code, otr, o2r or header")->required(); modding_import->add_option("<baserom.z64>", filename, "")->required()->check(CLI::ExistingFile); modding_import->parse_complete_callback([&] { - const auto instance = Companion::Instance = new Companion(filename, ArchiveType::None, debug, true); + ArchiveType otrMode; + + if (mode == "otr") { + otrMode = ArchiveType::OTR; + } else if (mode == "o2r") { + otrMode = ArchiveType::O2R; + } else { + otrMode = ArchiveType::None; + } + + const auto instance = Companion::Instance = new Companion(filename, otrMode, debug, true); if (mode == "code") { instance->Init(ExportType::Code); - } else if (mode == "binary") { + } else if (mode == "otr" || mode == "o2r") { instance->Init(ExportType::Binary); } else if (mode == "header") { instance->Init(ExportType::Header); |
