From 820678b4e97958d59b45597951841c129044cd45 Mon Sep 17 00:00:00 2001 From: louist103 <35883445+louist103@users.noreply.github.com> Date: Sun, 25 Jul 2021 07:59:05 -0400 Subject: Add options for warning or erroring on missing "Offset" node (#156) * done * Fixes * Change * revert --- ZAPD/ZFile.cpp | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) (limited to 'ZAPD/ZFile.cpp') diff --git a/ZAPD/ZFile.cpp b/ZAPD/ZFile.cpp index 9502214..b09dc55 100644 --- a/ZAPD/ZFile.cpp +++ b/ZAPD/ZFile.cpp @@ -161,6 +161,15 @@ void ZFile::ParseXML(ZFileMode mode, XMLElement* reader, std::string filename, b } offsetSet.insert(offsetXml); } + else if (Globals::Instance->warnNoOffset) + { + fprintf(stderr, "Warning No offset specified for: %s", nameXml); + } + else if (Globals::Instance->errorNoOffset) + { + throw std::runtime_error( + StringHelper::Sprintf("Error no offset specified for %s", nameXml)); + } if (outNameXml != nullptr) { if (outNameSet.find(outNameXml) != outNameSet.end()) @@ -589,7 +598,7 @@ void ZFile::GenerateSourceFiles(fs::path outputDir) Globals::Instance->cfg.texturePool.end()) { incStr = Globals::Instance->cfg.texturePool[tex->hash].path.string() + "." + - res->GetExternalExtension() + ".inc"; + res->GetExternalExtension() + ".inc"; } } -- cgit v1.2.3