diff options
| author | Nicholas Estelami <NEstelami@users.noreply.github.com> | 2021-01-05 19:00:52 -0500 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2021-01-05 19:00:52 -0500 |
| commit | d205c406add5d6e2275006130ff0f182f3f5257f (patch) | |
| tree | 57c3116e5c61c64eabb2407018f32ed09415f3ae /ZAPD/ZAnimation.cpp | |
| parent | 05be09c56e4fa3460e93ec767690c988781302d2 (diff) | |
Made a bunch of declarations static. Removed external writes to declarations dictionary. (#55)
* Fixed bug with extraction of ci4 textures
* Made a bunch of declarations static
* Avoid unnecessary copies (#46)
Pass some parameters by reference to avoid unnecessary copies.
When the parameter is intended to be copied into a member variable,
pass it by value and move it into the member instead.
This doesn't fix every occurrence of the issue but this diff is already
getting big so let's stop here for the moment.
* Removed manual writes to declarations dictionary from external classes.
Co-authored-by: Léo Lam <leo@leolam.fr>
Diffstat (limited to 'ZAPD/ZAnimation.cpp')
| -rw-r--r-- | ZAPD/ZAnimation.cpp | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/ZAPD/ZAnimation.cpp b/ZAPD/ZAnimation.cpp index 1d8ae04..3a70f0e 100644 --- a/ZAPD/ZAnimation.cpp +++ b/ZAPD/ZAnimation.cpp @@ -62,7 +62,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->declarations[rawDataIndex] = new Declaration(DeclarationAlignment::None, 16, "AnimationHeader", StringHelper::Sprintf("%s", name.c_str()), false, headerStr); + parent->AddDeclaration(rawDataIndex, DeclarationAlignment::None, 16, "AnimationHeader", StringHelper::Sprintf("%s", name.c_str()), headerStr); string indicesStr = ""; string valuesStr = " "; @@ -152,7 +152,7 @@ std::string ZLinkAnimation::GetSourceOutputCode(const std::string& prefix) string segSymbol = segmentAddress == 0 ? "NULL" : parent->GetDeclarationName(segmentAddress, StringHelper::Sprintf("%sSeg%06X", name.c_str(), segmentAddress)); string headerStr = StringHelper::Sprintf("{ %i }, 0x%08X", frameCount, segmentAddress); - parent->declarations[rawDataIndex] = new Declaration(DeclarationAlignment::None, 16, "LinkAnimationHeader", StringHelper::Sprintf("%s", name.c_str()), false, headerStr); + parent->AddDeclaration(rawDataIndex, DeclarationAlignment::None, 16, "LinkAnimationHeader", StringHelper::Sprintf("%s", name.c_str()), headerStr); } return ""; |
