summaryrefslogtreecommitdiff
path: root/ZAPD/ZAnimation.cpp
diff options
context:
space:
mode:
authorAnghelo Carvajal <angheloalf95@gmail.com>2021-10-01 22:19:47 -0300
committerGitHub <noreply@github.com>2021-10-01 21:19:47 -0400
commit6b06266eb8d35a7865aa1f942ecbe393e7cde740 (patch)
tree6b23ec1617f1ae76f49079ccc9c93c7f4d06eff3 /ZAPD/ZAnimation.cpp
parent26b00a2431a70ff190a2b22ee1faf77afa75a034 (diff)
Add `--static` flag (#193)
* remove static from every extracted asset * fix makefile * Move a bunch of code to Declaration * make static enablalble * fix texture static * clean up * minor fixes * Format * add small docs * fix * add table * add note in the readme * typo * maybe_unused * Add warning to ZSymbol * format * fix
Diffstat (limited to 'ZAPD/ZAnimation.cpp')
-rw-r--r--ZAPD/ZAnimation.cpp31
1 files changed, 18 insertions, 13 deletions
diff --git a/ZAPD/ZAnimation.cpp b/ZAPD/ZAnimation.cpp
index 63a87ce..d6645d0 100644
--- a/ZAPD/ZAnimation.cpp
+++ b/ZAPD/ZAnimation.cpp
@@ -51,9 +51,10 @@ std::string ZNormalAnimation::GetSourceOutputCode([[maybe_unused]] const std::st
headerStr += StringHelper::Sprintf("\t%sFrameData,\n", defaultPrefix.c_str());
headerStr += StringHelper::Sprintf("\t%sJointIndices,\n", defaultPrefix.c_str());
headerStr += StringHelper::Sprintf("\t%i\n", limit);
- parent->AddDeclaration(rawDataIndex, DeclarationAlignment::Align4, GetRawDataSize(),
- GetSourceTypeName(), StringHelper::Sprintf("%s", name.c_str()),
- headerStr);
+ Declaration* decl = parent->AddDeclaration(
+ rawDataIndex, DeclarationAlignment::Align4, GetRawDataSize(), GetSourceTypeName(),
+ StringHelper::Sprintf("%s", name.c_str()), headerStr);
+ decl->staticConf = staticConf;
std::string indicesStr = "";
std::string valuesStr = " ";
@@ -79,12 +80,12 @@ std::string ZNormalAnimation::GetSourceOutputCode([[maybe_unused]] const std::st
}
parent->AddDeclarationArray(rotationValuesOffset, DeclarationAlignment::Align16,
- rotationValues.size() * 2, "static s16",
+ rotationValues.size() * 2, "s16",
StringHelper::Sprintf("%sFrameData", defaultPrefix.c_str()),
rotationValues.size(), valuesStr);
parent->AddDeclarationArray(rotationIndicesOffset, DeclarationAlignment::Align16,
- rotationIndices.size() * 6, "static JointIndex",
+ rotationIndices.size() * 6, "JointIndex",
StringHelper::Sprintf("%sJointIndices", defaultPrefix.c_str()),
rotationIndices.size(), indicesStr);
}
@@ -287,8 +288,9 @@ void ZCurveAnimation::ExtractFromXML(tinyxml2::XMLElement* reader, uint32_t nRaw
{
ZResource::ExtractFromXML(reader, nRawDataIndex);
- parent->AddDeclaration(rawDataIndex, DeclarationAlignment::Align16, GetRawDataSize(),
- GetSourceTypeName(), name, "");
+ Declaration* decl = parent->AddDeclaration(rawDataIndex, DeclarationAlignment::Align16,
+ GetRawDataSize(), GetSourceTypeName(), name, "");
+ decl->staticConf = staticConf;
}
void ZCurveAnimation::DeclareReferences(const std::string& prefix)
@@ -447,13 +449,14 @@ std::string ZCurveAnimation::GetSourceOutputCode(const std::string& prefix)
Declaration* decl = parent->GetDeclaration(address);
if (decl == nullptr)
{
- parent->AddDeclaration(address, DeclarationAlignment::Align4, GetRawDataSize(),
- GetSourceTypeName(), name, bodyStr);
+ decl = parent->AddDeclaration(address, DeclarationAlignment::Align4, GetRawDataSize(),
+ GetSourceTypeName(), name, bodyStr);
}
else
{
decl->text = bodyStr;
}
+ decl->staticConf = staticConf;
return "";
}
@@ -473,8 +476,9 @@ void ZLegacyAnimation::ExtractFromXML(tinyxml2::XMLElement* reader, uint32_t nRa
{
ZAnimation::ExtractFromXML(reader, nRawDataIndex);
- parent->AddDeclaration(rawDataIndex, DeclarationAlignment::Align4, GetRawDataSize(),
- GetSourceTypeName(), name, "");
+ Declaration* decl = parent->AddDeclaration(rawDataIndex, DeclarationAlignment::Align4,
+ GetRawDataSize(), GetSourceTypeName(), name, "");
+ decl->staticConf = staticConf;
}
void ZLegacyAnimation::ParseRawData()
@@ -586,10 +590,11 @@ std::string ZLegacyAnimation::GetSourceOutputCode([[maybe_unused]] const std::st
Declaration* decl = parent->GetDeclaration(rawDataIndex);
if (decl == nullptr || decl->isPlaceholder)
- parent->AddDeclaration(rawDataIndex, DeclarationAlignment::Align4, GetRawDataSize(),
- GetSourceTypeName(), name, body);
+ decl = parent->AddDeclaration(rawDataIndex, DeclarationAlignment::Align4, GetRawDataSize(),
+ GetSourceTypeName(), name, body);
else
decl->text = body;
+ decl->staticConf = staticConf;
return "";
}