From 4994e732406ffa2942f9c9ea6ff14c424cd0b896 Mon Sep 17 00:00:00 2001 From: Anghelo Carvajal Date: Tue, 5 Oct 2021 13:55:55 -0300 Subject: 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 --- ZAPD/ZFile.cpp | 24 ++++++++++++------------ 1 file changed, 12 insertions(+), 12 deletions(-) (limited to 'ZAPD/ZFile.cpp') 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 -#include + #include #include #include + +#include +#include #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(); @@ -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 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) { -- cgit v1.2.3