diff options
| author | Nicholas Estelami <NEstelami@users.noreply.github.com> | 2020-05-20 15:02:10 -0400 |
|---|---|---|
| committer | Nicholas Estelami <NEstelami@users.noreply.github.com> | 2020-05-20 15:02:10 -0400 |
| commit | b6cd0f3217ea67e48cd7eb5367888f8a69521a99 (patch) | |
| tree | c55f3600c907e1a996dcc472930e27b476f68747 /ZAP2/Main.cpp | |
| parent | 904692d0c48ebf33a7bc5971d78d762278f59055 (diff) | |
Cleaned up some code, fixed a matching issue.
Diffstat (limited to 'ZAP2/Main.cpp')
| -rw-r--r-- | ZAP2/Main.cpp | 64 |
1 files changed, 1 insertions, 63 deletions
diff --git a/ZAP2/Main.cpp b/ZAP2/Main.cpp index 68ea940..9e3b906 100644 --- a/ZAP2/Main.cpp +++ b/ZAP2/Main.cpp @@ -61,8 +61,6 @@ int main(int argc, char* argv[]) //return 0; #endif - - //return OldMain(argc, argv); return NewMain(argc, argv); return 0; @@ -71,6 +69,7 @@ int main(int argc, char* argv[]) int NewMain(int argc, char* argv[]) { // Syntax: ZAP2.exe [mode (b/btex/bovl/e)] (Arbritrary Number of Arguments) + printf("ZAPD: Zelda Asset Processor For Decomp\n"); // Parse File Mode string buildMode = argv[1]; @@ -158,67 +157,6 @@ int NewMain(int argc, char* argv[]) return 0; } -int OldMain(int argc, char* argv[]) -{ - if (argc != 3 && argc != 4 && argc != 5 && argc != 6) - { - cout << "ZAP2: Zelda Asset Processor (2)" << "\n"; - cout << "Usage: ZAP2.exe [mode (b/btex/bovl/e)] [Input XML/Texture File/Bin File] [outputPath]" << "\n"; - return 1; - } - - // Parse File Mode - string buildMode = argv[1]; - ZFileMode fileMode = ZFileMode::Invalid; - - if (buildMode == "b") - fileMode = ZFileMode::Build; - else if (buildMode == "btex") - fileMode = ZFileMode::BuildTexture; - else if (buildMode == "bovl") - fileMode = ZFileMode::BuildOverlay; - else - fileMode = ZFileMode::Extract; - - if (fileMode == ZFileMode::Invalid) - { - cout << "Error: Invalid file mode.\n"; - return 1; - } - - if (fileMode == ZFileMode::Build || fileMode == ZFileMode::Extract) - { - // Syntax: ZAP2.exe e [input xml file] [baseromPath] [outputPath] [(OPTIONAL) shouldGenerateSourceFile (0/1)] - if (fileMode == ZFileMode::Extract && argc == 6) - Globals::Instance->genSourceFile = argv[5][0] == '1'; - - Parse(argv[2], argv[3], argv[4], fileMode); - } - else if (fileMode == ZFileMode::BuildTexture) - { - // Syntax: ZAP2.exe btex [texType] [pngFilePath] [outFilePath] - string texTypeStr = argv[2]; - string pngFilePath = argv[3]; - string outFilePath = argv[4]; - - TextureType texType = ZTexture::GetTextureTypeFromString(texTypeStr); - - BuildAssetTexture(pngFilePath, texType, outFilePath); - } - else if (fileMode == ZFileMode::BuildOverlay) - { - // Syntax: ZAP2.exe bovl [elfFilePath] [cfgFolderPath] [outputFilePath] - ZOverlay* overlay = ZOverlay::FromBuild(Path::GetDirectoryName(argv[2]), Path::GetDirectoryName(argv[3])); - if (overlay) - { - string source = overlay->GetSourceOutputCode(""); - File::WriteAllText(argv[4], source); - } - } - - return 0; -} - bool Parse(string xmlFilePath, string basePath, string outPath, ZFileMode fileMode) { XMLDocument doc; |
