summaryrefslogtreecommitdiff
path: root/ZAPD/Main.cpp
diff options
context:
space:
mode:
authorAnghelo Carvajal <angheloalf95@gmail.com>2021-03-19 15:20:30 -0300
committerGitHub <noreply@github.com>2021-03-19 14:20:30 -0400
commit7dcac473ed1fe1d1c90f2c80bfc9bab786335d17 (patch)
tree823ccfb80bab03f62f69aafaeec649126fadd3d2 /ZAPD/Main.cpp
parent7e866e8afe94e7fe2e5316d99edf15c81722f506 (diff)
Fix repo warnings (#97)
* Fix extra params in some macros Signed-off-by: Angie <angheloalf95@gmail.com> * Add missing * entries.size(); Signed-off-by: Angie <angheloalf95@gmail.com> * add CS_PLAYER_ACTION Signed-off-by: Angie <angheloalf95@gmail.com> * Remove an extra ampersand Signed-off-by: Angie <angheloalf95@gmail.com> * Add a trailling \n to blobs Signed-off-by: Angie <angheloalf95@gmail.com> * Add trailling \n to ZTexture Signed-off-by: Angie <angheloalf95@gmail.com> * Add 'Standard' as a valid ZSkeleton type Signed-off-by: angie <angheloalf95@gmail.com> * print an error on invalid xml files instead of failing silently Signed-off-by: angie <angheloalf95@gmail.com> * Change limbs array type to void* Signed-off-by: angie <angheloalf95@gmail.com>
Diffstat (limited to 'ZAPD/Main.cpp')
-rw-r--r--ZAPD/Main.cpp13
1 files changed, 10 insertions, 3 deletions
diff --git a/ZAPD/Main.cpp b/ZAPD/Main.cpp
index 9e0195c..45f3118 100644
--- a/ZAPD/Main.cpp
+++ b/ZAPD/Main.cpp
@@ -187,7 +187,10 @@ int NewMain(int argc, char* argv[])
if (fileMode == ZFileMode::Build || fileMode == ZFileMode::Extract || fileMode == ZFileMode::BuildSourceFile)
{
- Parse(Globals::Instance->inputPath, Globals::Instance->baseRomPath, Globals::Instance->outputPath, fileMode);
+ bool parseSuccessful = Parse(Globals::Instance->inputPath, Globals::Instance->baseRomPath, Globals::Instance->outputPath, fileMode);
+ if (!parseSuccessful) {
+ return 1;
+ }
}
else if (fileMode == ZFileMode::BuildTexture)
{
@@ -228,13 +231,17 @@ bool Parse(const std::string& xmlFilePath, const std::string& basePath, const st
XMLDocument doc;
XMLError eResult = doc.LoadFile(xmlFilePath.c_str());
- if (eResult != tinyxml2::XML_SUCCESS)
+ if (eResult != tinyxml2::XML_SUCCESS) {
+ fprintf(stderr, "Invalid xml file: '%s'\n", xmlFilePath.c_str());
return false;
+ }
XMLNode* root = doc.FirstChild();
- if (root == nullptr)
+ if (root == nullptr) {
+ fprintf(stderr, "Missing Root tag in xml file: '%s'\n", xmlFilePath.c_str());
return false;
+ }
for (XMLElement* child = root->FirstChildElement(); child != NULL; child = child->NextSiblingElement())
{