diff options
| author | Anghelo Carvajal <angheloalf95@gmail.com> | 2021-10-05 13:55:55 -0300 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2021-10-05 12:55:55 -0400 |
| commit | 4994e732406ffa2942f9c9ea6ff14c424cd0b896 (patch) | |
| tree | 0b40b20db17139c58f5c205643940494c20cbc43 /ZAPD/ZFile.cpp | |
| parent | 17fca1e0cdda5476c4158940ca405b7eb250ec72 (diff) | |
ZResource cleanup (#178)
* Add some general use methods to ZResource
* change zarray
* adapt ztexture
* Clean up ZCollision, ZPath, ZScalar and ZVector
* cleanup background
* cleanup zmtx
* Clean up skeleton and limb
* mark GetSourceTypeName as abstract
* Remove redundant ExtractFromXML
* Reorder stuff to minimize changes in github
* remove extra ZDisplayList constructor
* Remove using namespace tinyxml2;
* run formatter
* Add some brief descriptions, and remove some methods
* Remove trivials GetSourceOutputCode and a bit of cleanup
* Add more descriptions to methods
* Fix blob build
* improve descriptions a bit
* Run formatter
* Now builds
* Add attributes and fix some warnings
* format
* fix merge issues
* fix merge issues and some clang warnings
* format
* Run formatter
* Fix merge issues
* Format
* add SEGMENTED_NULL
* Fix merge issues
* Run format
* dumb fix
* whoops
* format
* whoops
Diffstat (limited to 'ZAPD/ZFile.cpp')
| -rw-r--r-- | ZAPD/ZFile.cpp | 24 |
1 files changed, 12 insertions, 12 deletions
diff --git a/ZAPD/ZFile.cpp b/ZAPD/ZFile.cpp index 8f74806..f209653 100644 --- a/ZAPD/ZFile.cpp +++ b/ZAPD/ZFile.cpp @@ -1,9 +1,11 @@ #include "ZFile.h" -#include <Utils/BinaryWriter.h> -#include <Utils/MemoryStream.h> + #include <algorithm> #include <cassert> #include <unordered_set> + +#include <Utils/BinaryWriter.h> +#include <Utils/MemoryStream.h> #include "Globals.h" #include "OutputFormatter.h" #include "Utils/Directory.h" @@ -26,8 +28,6 @@ #include "ZVector.h" #include "ZVtx.h" -using namespace tinyxml2; - ZFile::ZFile() { resources = std::vector<ZResource*>(); @@ -71,7 +71,7 @@ ZFile::~ZFile() } } -void ZFile::ParseXML(ZFileMode mode, XMLElement* reader, std::string filename, +void ZFile::ParseXML(ZFileMode mode, tinyxml2::XMLElement* reader, std::string filename, [[maybe_unused]] bool placeholderMode) { if (filename == "") @@ -143,7 +143,7 @@ void ZFile::ParseXML(ZFileMode mode, XMLElement* reader, std::string filename, auto nodeMap = *GetNodeMap(); uint32_t rawDataIndex = 0; - for (XMLElement* child = reader->FirstChildElement(); child != nullptr; + for (tinyxml2::XMLElement* child = reader->FirstChildElement(); child != nullptr; child = child->NextSiblingElement()) { const char* nameXml = child->Attribute("Name"); @@ -353,7 +353,7 @@ std::vector<ZResource*> ZFile::GetResourcesOfType(ZResourceType resType) return resList; } -Declaration* ZFile::AddDeclaration(uint32_t address, DeclarationAlignment alignment, size_t size, +Declaration* ZFile::AddDeclaration(offset_t address, DeclarationAlignment alignment, size_t size, std::string varType, std::string varName, std::string body) { assert(GETSEGNUM(address) == 0); @@ -376,7 +376,7 @@ Declaration* ZFile::AddDeclaration(uint32_t address, DeclarationAlignment alignm return decl; } -Declaration* ZFile::AddDeclarationArray(uint32_t address, DeclarationAlignment alignment, +Declaration* ZFile::AddDeclarationArray(offset_t address, DeclarationAlignment alignment, size_t size, std::string varType, std::string varName, size_t arrayItemCnt, std::string body) { @@ -405,7 +405,7 @@ Declaration* ZFile::AddDeclarationArray(uint32_t address, DeclarationAlignment a return decl; } -Declaration* ZFile::AddDeclarationArray(uint32_t address, DeclarationAlignment alignment, +Declaration* ZFile::AddDeclarationArray(offset_t address, DeclarationAlignment alignment, size_t size, std::string varType, std::string varName, std::string arrayItemCntStr, std::string body) { @@ -449,7 +449,7 @@ Declaration* ZFile::AddDeclarationPlaceholder(uint32_t address) return decl; } -Declaration* ZFile::AddDeclarationPlaceholder(uint32_t address, std::string varName) +Declaration* ZFile::AddDeclarationPlaceholder(offset_t address, std::string varName) { assert(GETSEGNUM(address) == 0); AddDeclarationDebugChecks(address); @@ -467,7 +467,7 @@ Declaration* ZFile::AddDeclarationPlaceholder(uint32_t address, std::string varN return decl; } -Declaration* ZFile::AddDeclarationInclude(uint32_t address, std::string includePath, size_t size, +Declaration* ZFile::AddDeclarationInclude(offset_t address, std::string includePath, size_t size, std::string varType, std::string varName) { assert(GETSEGNUM(address) == 0); @@ -489,7 +489,7 @@ Declaration* ZFile::AddDeclarationInclude(uint32_t address, std::string includeP return decl; } -Declaration* ZFile::AddDeclarationIncludeArray(uint32_t address, std::string includePath, +Declaration* ZFile::AddDeclarationIncludeArray(offset_t address, std::string includePath, size_t size, std::string varType, std::string varName, size_t arrayItemCnt) { |
