1
0
Fork 0
mirror of https://github.com/zeldaret/oot.git synced 2025-08-12 09:50:50 +00:00

git subrepo pull --force tools/ZAPD (#742)

subrepo:
  subdir:   "tools/ZAPD"
  merged:   "c4773301a"
upstream:
  origin:   "https://github.com/zeldaret/ZAPD.git"
  branch:   "master"
  commit:   "c4773301a"
git-subrepo:
  version:  "0.4.3"
  origin:   "https://github.com/ingydotnet/git-subrepo.git"
  commit:   "2f68596"
This commit is contained in:
fig02 2021-03-27 23:57:14 -04:00 committed by GitHub
parent b338f12498
commit 71bbaab485
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
7 changed files with 66 additions and 21 deletions

View file

@ -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)

View file

@ -51,6 +51,8 @@ public:
std::string GetSourceOutputCode(const std::string& prefix) override;
int GetRawDataSize() override;
std::string GetSourceTypeName() override;
static ZNormalAnimation* ExtractFromXML(tinyxml2::XMLElement* reader,
std::vector<uint8_t> nRawData, int rawDataIndex,
const std::string& nRelPath);
@ -69,6 +71,8 @@ public:
std::string GetSourceOutputCode(const std::string& prefix) override;
int GetRawDataSize() override;
std::string GetSourceTypeName() override;
static ZLinkAnimation* ExtractFromXML(tinyxml2::XMLElement* reader,
std::vector<uint8_t> nRawData, int rawDataIndex,
const std::string& nRelPath);

View file

@ -207,6 +207,10 @@ std::string ZSkeleton::GetSourceOutputCode(const std::string& prefix)
{
// Table
string tblStr = "";
string limbArrTypeStr = "static void*";
if (limbType == ZLimbType::Curve) {
limbArrTypeStr = StringHelper::Sprintf("static %s*", ZLimb::GetSourceTypeName(limbType));
}
for (size_t i = 0; i < limbs.size(); i++)
{
@ -222,7 +226,7 @@ std::string ZSkeleton::GetSourceOutputCode(const std::string& prefix)
tblStr += decl;
}
parent->AddDeclarationArray(ptr, DeclarationAlignment::None, 4 * limbCount, "static void*",
parent->AddDeclarationArray(ptr, DeclarationAlignment::None, 4 * limbCount, limbArrTypeStr,
StringHelper::Sprintf("%sLimbs", defaultPrefix.c_str()),
limbCount, tblStr);
}