From 4410b554e835ab7844c8eb78fd54fa3842d50f16 Mon Sep 17 00:00:00 2001 From: Anghelo Carvajal Date: Wed, 26 May 2021 20:04:02 -0400 Subject: Check XML resource attributes (#126) * register attibutes * fix array problems * cutscene problems * Set inner * fix merge * ups * Run format * small cleaning * A small blob cleanup * Simplify the logic a bit * ups * Fix merge problem * Fix merge issues * Fix merge issues * fix merge-produced type * Fix merge issues * run format and update easteregg * register ZPath attributes * dumb problems * How dumb can I be? * future proof change * empty commit * Check if Width and Height attributes of ZTexture has only decimal digits --- ZAPD/ZVector.cpp | 14 ++++---------- 1 file changed, 4 insertions(+), 10 deletions(-) (limited to 'ZAPD/ZVector.cpp') diff --git a/ZAPD/ZVector.cpp b/ZAPD/ZVector.cpp index 51c8452..3584580 100644 --- a/ZAPD/ZVector.cpp +++ b/ZAPD/ZVector.cpp @@ -12,23 +12,17 @@ ZVector::ZVector(ZFile* nParent) : ZResource(nParent) { scalarType = ZScalarType::ZSCALAR_NONE; dimensions = 0; -} - -void ZVector::ExtractFromXML(tinyxml2::XMLElement* reader, const std::vector& nRawData, - const uint32_t nRawDataIndex) -{ - ZResource::ExtractFromXML(reader, nRawData, nRawDataIndex); + RegisterRequiredAttribute("Type"); + RegisterRequiredAttribute("Dimensions"); } void ZVector::ParseXML(tinyxml2::XMLElement* reader) { ZResource::ParseXML(reader); - std::string type = reader->Attribute("Type"); - this->scalarType = ZScalar::MapOutputTypeToScalarType(type); + this->scalarType = ZScalar::MapOutputTypeToScalarType(registeredAttributes.at("Type").value); - std::string dimensions = reader->Attribute("Dimensions"); - this->dimensions = strtol(dimensions.c_str(), NULL, 16); + this->dimensions = StringHelper::StrToL(registeredAttributes.at("Dimensions").value, 16); } void ZVector::ParseRawData() -- cgit v1.2.3