summaryrefslogtreecommitdiff
path: root/ZAPD/Declaration.cpp
diff options
context:
space:
mode:
authorAnghelo Carvajal <angheloalf95@gmail.com>2021-10-16 18:55:56 -0300
committerGitHub <noreply@github.com>2021-10-16 17:55:56 -0400
commite7a8a48cf361a7591b88592eb3e333ddf8d3ab34 (patch)
tree4f63eac4c2136dd74e05593ea200b2c24c284a3f /ZAPD/Declaration.cpp
parent3e9ed72e202b1165152d42f7d160695f9f2f233a (diff)
`ExternalFile`: Expose other XML's declarations during extraction (#151)
* proof of concept * fix header include paths * GetDeclarationAlignment and others * this should fix this * minor * DeclareVar in ExtractFromXML * fix vtx intersections * Fix segmented vtxs * --version * zcollision changes * Use GetSegmentedPtrName a lot more * memory related stuff * minor style fixes and use the actual symbol for zlinkanimation instead of the hex address * Simplify lots of GetSourceOutputCode * ZSkeleton cleanup and other changes * Elevate unknown types in skeleton to errors * ZAnimation cleanup * Add ExternalFile to config * delete some code * Remove unused code * fix conflicts * format * remove redundant constructors * minor fixes * fix vtx warnings * extract every vtx as standalone files * format * uups * Bugfix: don't create extra blank files * Fix some Vtx warnings and remove "defaulting to normal" in skeleton error * Refactor ZLimb * Make each limb to look up in every file for dlists * Use GetSegmentedArrayIndexedName in VTX references in dlists * simplify simple condition * search by type * run format * Revert "search by type" This reverts commit a049bdfc94c4ab04613b354f466dee836a20508a. * Add range checks * uups * Always set rangeEnd * special case zsymbol * Revert "Revert "search by type"" This reverts commit 3f6e77c780bd30dc7000614304021a0940168316. * symbol fix and IsOffsetInFileRange * Bugfix and minor checks * run format * Don't extract data from external files * Fix extraction of overly big tluts * Minor changes * More minor fixes * Fix clang warnings * Remove unused parameter * Fix merge issues * Fix ZLimbTable::DeclareVar * Fix limbs not naming properly their DLists * Remove segment number check * Fix merge problems * Run formatter * Maybe fix? * path * empty commit * Fix a typo * Fix merge issues * Fix null ptr dereferencing * Fix merge issues and some clang warnings * Format * Fix not-matching * Format * Fix merge issues * Fix exporter * Last fixes I hope * Fix merge issues * format * fix * fix * I'm dumb * format * static fix * Whoops * fix asan * Fix? * fix * reduce artificial changes * reduce artificial changes 2 * reorder more stuff * format * fix borken thing * Remove redundant stuff in zfile * fix * Format * Fix conflict issues * format * cleanup header includes * format * Add error checks in for ExternalXMLFolder * format
Diffstat (limited to 'ZAPD/Declaration.cpp')
-rw-r--r--ZAPD/Declaration.cpp39
1 files changed, 21 insertions, 18 deletions
diff --git a/ZAPD/Declaration.cpp b/ZAPD/Declaration.cpp
index eafe948..d2a86ff 100644
--- a/ZAPD/Declaration.cpp
+++ b/ZAPD/Declaration.cpp
@@ -3,26 +3,29 @@
#include "Globals.h"
#include "Utils/StringHelper.h"
-Declaration::Declaration(DeclarationAlignment nAlignment, size_t nSize, const std::string& nText)
+Declaration::Declaration(offset_t nAddress, DeclarationAlignment nAlignment, size_t nSize,
+ const std::string& nText)
{
+ address = nAddress;
alignment = nAlignment;
size = nSize;
text = nText;
}
-Declaration::Declaration(DeclarationAlignment nAlignment, size_t nSize, const std::string& nVarType,
- const std::string& nVarName, bool nIsArray, const std::string& nText)
- : Declaration(nAlignment, nSize, nText)
+Declaration::Declaration(offset_t nAddress, DeclarationAlignment nAlignment, size_t nSize,
+ const std::string& nVarType, const std::string& nVarName, bool nIsArray,
+ const std::string& nText)
+ : Declaration(nAddress, nAlignment, nSize, nText)
{
varType = nVarType;
varName = nVarName;
isArray = nIsArray;
}
-Declaration::Declaration(DeclarationAlignment nAlignment, size_t nSize, const std::string& nVarType,
- const std::string& nVarName, bool nIsArray, size_t nArrayItemCnt,
- const std::string& nText)
- : Declaration(nAlignment, nSize, nText)
+Declaration::Declaration(offset_t nAddress, DeclarationAlignment nAlignment, size_t nSize,
+ const std::string& nVarType, const std::string& nVarName, bool nIsArray,
+ size_t nArrayItemCnt, const std::string& nText)
+ : Declaration(nAddress, nAlignment, nSize, nText)
{
varType = nVarType;
varName = nVarName;
@@ -30,10 +33,10 @@ Declaration::Declaration(DeclarationAlignment nAlignment, size_t nSize, const st
arrayItemCnt = nArrayItemCnt;
}
-Declaration::Declaration(DeclarationAlignment nAlignment, size_t nSize, const std::string& nVarType,
- const std::string& nVarName, bool nIsArray,
+Declaration::Declaration(offset_t nAddress, DeclarationAlignment nAlignment, size_t nSize,
+ const std::string& nVarType, const std::string& nVarName, bool nIsArray,
const std::string& nArrayItemCntStr, const std::string& nText)
- : Declaration(nAlignment, nSize, nText)
+ : Declaration(nAddress, nAlignment, nSize, nText)
{
varType = nVarType;
varName = nVarName;
@@ -41,17 +44,17 @@ Declaration::Declaration(DeclarationAlignment nAlignment, size_t nSize, const st
arrayItemCntStr = nArrayItemCntStr;
}
-Declaration::Declaration(DeclarationAlignment nAlignment, size_t nSize, const std::string& nVarType,
- const std::string& nVarName, bool nIsArray, size_t nArrayItemCnt,
- const std::string& nText, bool nIsExternal)
- : Declaration(nAlignment, nSize, nVarType, nVarName, nIsArray, nArrayItemCnt, nText)
+Declaration::Declaration(offset_t nAddress, DeclarationAlignment nAlignment, size_t nSize,
+ const std::string& nVarType, const std::string& nVarName, bool nIsArray,
+ size_t nArrayItemCnt, const std::string& nText, bool nIsExternal)
+ : Declaration(nAddress, nAlignment, nSize, nVarType, nVarName, nIsArray, nArrayItemCnt, nText)
{
isExternal = nIsExternal;
}
-Declaration::Declaration(const std::string& nIncludePath, size_t nSize, const std::string& nVarType,
- const std::string& nVarName)
- : Declaration(DeclarationAlignment::Align4, nSize, "")
+Declaration::Declaration(offset_t nAddress, const std::string& nIncludePath, size_t nSize,
+ const std::string& nVarType, const std::string& nVarName)
+ : Declaration(nAddress, DeclarationAlignment::Align4, nSize, "")
{
includePath = nIncludePath;
varType = nVarType;