diff options
| author | Anghelo Carvajal <angheloalf95@gmail.com> | 2021-05-26 20:04:02 -0400 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2021-05-26 20:04:02 -0400 |
| commit | 4410b554e835ab7844c8eb78fd54fa3842d50f16 (patch) | |
| tree | 065b8f53d6e1052c9f7ad1917c1b3b66d5eef645 /ZAPD/ZVector.cpp | |
| parent | 769f5702a422d14bfb0a60a39319da4b4bf9ec1f (diff) | |
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
Diffstat (limited to 'ZAPD/ZVector.cpp')
| -rw-r--r-- | ZAPD/ZVector.cpp | 14 |
1 files changed, 4 insertions, 10 deletions
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<uint8_t>& 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() |
