diff options
| author | Anghelo Carvajal <angheloalf95@gmail.com> | 2021-06-10 15:29:09 -0400 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2021-06-10 15:29:09 -0400 |
| commit | 602e609c8036fd4e5dbd3aa2e1a6df59fa6a07ef (patch) | |
| tree | 6c3d80434649e2a085df975ad99a57d3996369bc /ZAPD/Main.cpp | |
| parent | 17fb7de37389f80285360b05e3fa188a97d77cb6 (diff) | |
Add `OutName` attribute to `<File>` node (#146)
* create attribute
* Minor fixes
* Remove redundant `outputPath`
* Add `OutName` to docs
* Whoops, wrong branch
Diffstat (limited to 'ZAPD/Main.cpp')
| -rw-r--r-- | ZAPD/Main.cpp | 18 |
1 files changed, 8 insertions, 10 deletions
diff --git a/ZAPD/Main.cpp b/ZAPD/Main.cpp index 4728c7a..54ea447 100644 --- a/ZAPD/Main.cpp +++ b/ZAPD/Main.cpp @@ -27,8 +27,7 @@ using namespace tinyxml2; -bool Parse(const fs::path& xmlFilePath, const fs::path& basePath, const fs::path& outPath, - ZFileMode fileMode); +bool Parse(const fs::path& xmlFilePath, const fs::path& basePath, ZFileMode fileMode); void BuildAssetTexture(const fs::path& pngFilePath, TextureType texType, const fs::path& outPath); void BuildAssetBackground(const fs::path& imageFilePath, const fs::path& outPath); @@ -249,8 +248,8 @@ int main(int argc, char* argv[]) if (fileMode == ZFileMode::Extract || fileMode == ZFileMode::BuildSourceFile) { - bool parseSuccessful = Parse(Globals::Instance->inputPath, Globals::Instance->baseRomPath, - Globals::Instance->outputPath, fileMode); + bool parseSuccessful = + Parse(Globals::Instance->inputPath, Globals::Instance->baseRomPath, fileMode); if (!parseSuccessful) return 1; @@ -292,8 +291,7 @@ int main(int argc, char* argv[]) return 0; } -bool Parse(const fs::path& xmlFilePath, const fs::path& basePath, const fs::path& outPath, - ZFileMode fileMode) +bool Parse(const fs::path& xmlFilePath, const fs::path& basePath, ZFileMode fileMode) { XMLDocument doc; XMLError eResult = doc.LoadFile(xmlFilePath.string().c_str()); @@ -317,7 +315,7 @@ bool Parse(const fs::path& xmlFilePath, const fs::path& basePath, const fs::path { if (std::string(child->Name()) == "File") { - ZFile* file = new ZFile(fileMode, child, basePath, outPath, "", xmlFilePath, false); + ZFile* file = new ZFile(fileMode, child, basePath, "", xmlFilePath, false); Globals::Instance->files.push_back(file); } else @@ -332,9 +330,9 @@ bool Parse(const fs::path& xmlFilePath, const fs::path& basePath, const fs::path for (ZFile* file : Globals::Instance->files) { if (fileMode == ZFileMode::BuildSourceFile) - file->BuildSourceFile(outPath); + file->BuildSourceFile(); else - file->ExtractResources(outPath); + file->ExtractResources(); } // All done, free files @@ -397,7 +395,7 @@ void BuildAssetModelIntermediette(const fs::path& outPath) void BuildAssetAnimationIntermediette(const fs::path& animPath, const fs::path& outPath) { std::vector<std::string> split = StringHelper::Split(outPath.string(), "/"); - ZFile* file = new ZFile("", split[split.size() - 2]); + ZFile* file = new ZFile(split[split.size() - 2]); HLAnimationIntermediette* anim = HLAnimationIntermediette::FromXML(animPath.string()); ZAnimation* zAnim = anim->ToZAnimation(); zAnim->SetName(Path::GetFileNameWithoutExtension(split[split.size() - 1])); |
