summaryrefslogtreecommitdiff
path: root/ZAPD/Declaration.cpp
diff options
context:
space:
mode:
authorEllipticEllipsis <elliptic.ellipsis@gmail.com>2023-05-03 22:29:19 +0100
committerGitHub <noreply@github.com>2023-05-03 17:29:19 -0400
commitae0c2038007558d087418ff6ad2b3cd5e3cf6579 (patch)
treeb9f426cb9b1da4527f85046578efc8ba8cd9d7bb /ZAPD/Declaration.cpp
parentfcfa28901e91d756ad22f05e6827d7646e484061 (diff)
Defines for texture dimensions (#233)
* Create functions to produce and add defines to the header * Format * Fix Jenkinsfile * Make gcc shut up about fallthrough * Fix symbols that start with g but are not global
Diffstat (limited to 'ZAPD/Declaration.cpp')
-rw-r--r--ZAPD/Declaration.cpp17
1 files changed, 17 insertions, 0 deletions
diff --git a/ZAPD/Declaration.cpp b/ZAPD/Declaration.cpp
index 34ab953..ef651db 100644
--- a/ZAPD/Declaration.cpp
+++ b/ZAPD/Declaration.cpp
@@ -61,6 +61,14 @@ Declaration::Declaration(offset_t nAddress, const std::string& nIncludePath, siz
varName = nVarName;
}
+Declaration::Declaration(offset_t nAddress, const std::string& nIncludePath, size_t nSize,
+ const std::string& nVarType, const std::string& nVarName,
+ const std::string& nDefines)
+ : Declaration(nAddress, nIncludePath, nSize, nVarType, nVarName)
+{
+ defines = nDefines;
+}
+
bool Declaration::IsStatic() const
{
switch (staticConf)
@@ -195,6 +203,15 @@ std::string Declaration::GetExternStr() const
return StringHelper::Sprintf("extern %s %s;\n", varType.c_str(), varName.c_str());
}
+std::string Declaration::GetDefinesStr() const
+{
+ if (IsStatic() || (varType == ""))
+ {
+ return "";
+ }
+ return StringHelper::Sprintf("%s", defines.c_str());
+}
+
std::string Declaration::GetStaticForwardDeclarationStr() const
{
if (!IsStatic() || isUnaccounted)