From e56f713e573d9a71d4253e84bded0cd9c41213ab Mon Sep 17 00:00:00 2001 From: louist103 <35883445+louist103@users.noreply.github.com> Date: Sun, 28 Jan 2024 19:04:58 -0500 Subject: [PATCH] Cleanup text output --- ZAPD/ZCKeyFrame.cpp | 8 ++++---- ZAPD/ZCKeyFrameAnim.cpp | 6 ++++-- 2 files changed, 8 insertions(+), 6 deletions(-) diff --git a/ZAPD/ZCKeyFrame.cpp b/ZAPD/ZCKeyFrame.cpp index 2b241414..ece78368 100644 --- a/ZAPD/ZCKeyFrame.cpp +++ b/ZAPD/ZCKeyFrame.cpp @@ -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()); } @@ -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 diff --git a/ZAPD/ZCKeyFrameAnim.cpp b/ZAPD/ZCKeyFrameAnim.cpp index 65359a60..be4d86ec 100644 --- a/ZAPD/ZCKeyFrameAnim.cpp +++ b/ZAPD/ZCKeyFrameAnim.cpp @@ -59,13 +59,13 @@ 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(), @@ -73,6 +73,7 @@ void ZKeyFrameAnim::DeclareReferencesLate(const std::string& prefix) declaration.clear(); + declaration += "\t"; for (const auto kfNum : kfNums) @@ -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(); @@ -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),