summaryrefslogtreecommitdiff
path: root/ZAPD/ZAnimation.cpp
diff options
context:
space:
mode:
authorAnghelo Carvajal <angheloalf95@gmail.com>2021-03-23 11:28:37 -0300
committerGitHub <noreply@github.com>2021-03-23 10:28:37 -0400
commit769b045ba4990729e025d4ba16135a7a22d5944e (patch)
treedd849a937ad8c17844542a2926934ea2cc7fffc3 /ZAPD/ZAnimation.cpp
parent4751db5c9ee0a25a26379ca5b44efad72215d256 (diff)
Fix CurveLimbs warning and the "Intersection detected" warning (#101)
* fix curve limb warning Signed-off-by: Angie <angheloalf95@gmail.com> * Fix the intersection detected warning Signed-off-by: Angie <angheloalf95@gmail.com> * Implement GetSourceTypeName in ZAnimation Signed-off-by: Angie <angheloalf95@gmail.com>
Diffstat (limited to 'ZAPD/ZAnimation.cpp')
-rw-r--r--ZAPD/ZAnimation.cpp14
1 files changed, 12 insertions, 2 deletions
diff --git a/ZAPD/ZAnimation.cpp b/ZAPD/ZAnimation.cpp
index 4ae07e1..417a26f 100644
--- a/ZAPD/ZAnimation.cpp
+++ b/ZAPD/ZAnimation.cpp
@@ -66,7 +66,7 @@ std::string ZNormalAnimation::GetSourceOutputCode(const std::string& prefix)
string headerStr =
StringHelper::Sprintf("{ %i }, %sFrameData, %sJointIndices, %i", frameCount,
defaultPrefix.c_str(), defaultPrefix.c_str(), limit);
- parent->AddDeclaration(rawDataIndex, DeclarationAlignment::None, 16, "AnimationHeader",
+ parent->AddDeclaration(rawDataIndex, DeclarationAlignment::None, GetRawDataSize(), GetSourceTypeName(),
StringHelper::Sprintf("%s", name.c_str()), headerStr);
string indicesStr = "";
@@ -111,6 +111,11 @@ int ZNormalAnimation::GetRawDataSize()
return 16;
}
+std::string ZNormalAnimation::GetSourceTypeName()
+{
+ return "AnimationHeader";
+}
+
ZNormalAnimation* ZNormalAnimation::ExtractFromXML(tinyxml2::XMLElement* reader,
std::vector<uint8_t> nRawData, int rawDataIndex,
const std::string& nRelPath)
@@ -170,7 +175,7 @@ std::string ZLinkAnimation::GetSourceOutputCode(const std::string& prefix)
segmentAddress, StringHelper::Sprintf("%sSeg%06X", name.c_str(),
segmentAddress));
string headerStr = StringHelper::Sprintf("{ %i }, 0x%08X", frameCount, segmentAddress);
- parent->AddDeclaration(rawDataIndex, DeclarationAlignment::None, 16, "LinkAnimationHeader",
+ parent->AddDeclaration(rawDataIndex, DeclarationAlignment::None, GetRawDataSize(), GetSourceTypeName(),
StringHelper::Sprintf("%s", name.c_str()), headerStr);
}
@@ -182,6 +187,11 @@ int ZLinkAnimation::GetRawDataSize()
return 8;
}
+std::string ZLinkAnimation::GetSourceTypeName()
+{
+ return "LinkAnimationHeader";
+}
+
ZLinkAnimation* ZLinkAnimation::ExtractFromXML(tinyxml2::XMLElement* reader,
std::vector<uint8_t> nRawData, int rawDataIndex,
const std::string& nRelPath)