Skip to content

Commit

Permalink
Cleanup text output
Browse files Browse the repository at this point in the history
  • Loading branch information
louist103 committed Jan 29, 2024
1 parent c696d2b commit e56f713
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 6 deletions.
8 changes: 4 additions & 4 deletions ZAPD/ZCKeyFrame.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -123,7 +123,7 @@ std::string ZKeyFrameSkel::GetBodySourceCode() const
Globals::Instance->GetSegmentedPtrName(limbsPtr, parent, "KeyFrameFlexLimb", limbStr);


return StringHelper::Sprintf("0x%02X, 0x%02X, %s,", limbCount, dListCount, limbStr.c_str());
return StringHelper::Sprintf("\n\t0x%02X, 0x%02X, %s\n", limbCount, dListCount, limbStr.c_str());

}

Expand Down Expand Up @@ -227,9 +227,9 @@ std::string ZKeyFrameLimbList::GetBodySourceCode() const
std::string declaration;

for (const auto l : limbs)
declaration += StringHelper::Sprintf("\t{ %s },", l->GetBodySourceCode().c_str());

return declaration;
declaration += StringHelper::Sprintf("\t{ %s },\n", l->GetBodySourceCode().c_str());
// Remove last newline
return declaration.substr(0, declaration.length() - 1);
}

std::string ZKeyFrameStandardLimb::GetBodySourceCode() const
Expand Down
6 changes: 4 additions & 2 deletions ZAPD/ZCKeyFrameAnim.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -59,20 +59,21 @@ void ZKeyFrameAnim::DeclareReferencesLate(const std::string& prefix)
}
declaration.clear();

declaration += "\t";

for (const auto kf : keyFrames)
{
declaration += StringHelper::Sprintf(" \t { %i, %i, %i, },\n", kf.frame, kf.value,
kf.velocity);
}
declaration = declaration.substr(0, declaration.length() - 1);
parent->AddDeclarationArray(
GETSEGOFFSET(keyFramesAddr), DeclarationAlignment::Align4, keyFrames.size() * 6, "KeyFrame",
StringHelper::Sprintf("%s_KeyFrame_%06X", prefix.c_str(), rawDataIndex), keyFrames.size(),
declaration);

declaration.clear();


declaration += "\t";

for (const auto kfNum : kfNums)
Expand All @@ -84,6 +85,7 @@ void ZKeyFrameAnim::DeclareReferencesLate(const std::string& prefix)
GETSEGOFFSET(kfNumsAddr), DeclarationAlignment::Align4, kfNums.size() * 2, "s16",
StringHelper::Sprintf("%s_kfNums_%06X", prefix.c_str(), rawDataIndex), kfNums.size(),
declaration);
declaration += "\n";

declaration.clear();

Expand All @@ -93,7 +95,7 @@ void ZKeyFrameAnim::DeclareReferencesLate(const std::string& prefix)
{
declaration += StringHelper::Sprintf("0x%04X, ", pv);
}

declaration += "\n";
parent->AddDeclarationArray(
GETSEGOFFSET(presentValuesAddr), DeclarationAlignment::Align4, presentValues.size() * 2,
"s16", StringHelper::Sprintf("%s_presetValues_%06X", prefix.c_str(), rawDataIndex),
Expand Down

0 comments on commit e56f713

Please sign in to comment.