From 602e609c8036fd4e5dbd3aa2e1a6df59fa6a07ef Mon Sep 17 00:00:00 2001 From: Anghelo Carvajal Date: Thu, 10 Jun 2021 15:29:09 -0400 Subject: Add `OutName` attribute to `` node (#146) * create attribute * Minor fixes * Remove redundant `outputPath` * Add `OutName` to docs * Whoops, wrong branch --- ZAPD/Main.cpp | 18 ++++++++---------- 1 file changed, 8 insertions(+), 10 deletions(-) (limited to 'ZAPD/Main.cpp') 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 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])); -- cgit v1.2.3