diff options
| author | Anghelo Carvajal <angheloalf95@gmail.com> | 2021-10-05 13:55:55 -0300 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2021-10-05 12:55:55 -0400 |
| commit | 4994e732406ffa2942f9c9ea6ff14c424cd0b896 (patch) | |
| tree | 0b40b20db17139c58f5c205643940494c20cbc43 /ZAPD/ZCutscene.cpp | |
| parent | 17fca1e0cdda5476c4158940ca405b7eb250ec72 (diff) | |
ZResource cleanup (#178)
* Add some general use methods to ZResource
* change zarray
* adapt ztexture
* Clean up ZCollision, ZPath, ZScalar and ZVector
* cleanup background
* cleanup zmtx
* Clean up skeleton and limb
* mark GetSourceTypeName as abstract
* Remove redundant ExtractFromXML
* Reorder stuff to minimize changes in github
* remove extra ZDisplayList constructor
* Remove using namespace tinyxml2;
* run formatter
* Add some brief descriptions, and remove some methods
* Remove trivials GetSourceOutputCode and a bit of cleanup
* Add more descriptions to methods
* Fix blob build
* improve descriptions a bit
* Run formatter
* Now builds
* Add attributes and fix some warnings
* format
* fix merge issues
* fix merge issues and some clang warnings
* format
* Run formatter
* Fix merge issues
* Format
* add SEGMENTED_NULL
* Fix merge issues
* Run format
* dumb fix
* whoops
* format
* whoops
Diffstat (limited to 'ZAPD/ZCutscene.cpp')
| -rw-r--r-- | ZAPD/ZCutscene.cpp | 47 |
1 files changed, 14 insertions, 33 deletions
diff --git a/ZAPD/ZCutscene.cpp b/ZAPD/ZCutscene.cpp index 673a161..1157f08 100644 --- a/ZAPD/ZCutscene.cpp +++ b/ZAPD/ZCutscene.cpp @@ -104,33 +104,6 @@ std::string ZCutscene::GetBodySourceCode() const return output; } -std::string ZCutscene::GetSourceOutputCode(const std::string& prefix) -{ - std::string bodyStr = GetBodySourceCode(); - - Declaration* decl = parent->GetDeclaration(rawDataIndex); - - if (decl == nullptr) - DeclareVar(prefix, bodyStr); - else - decl->text = bodyStr; - - return ""; -} - -void ZCutscene::DeclareVar(const std::string& prefix, const std::string& bodyStr) const -{ - std::string auxName = name; - - if (auxName == "") - auxName = StringHelper::Sprintf("%sCutsceneData0x%06X", prefix.c_str(), rawDataIndex); - - Declaration* decl = - parent->AddDeclarationArray(getSegmentOffset(), DeclarationAlignment::Align4, - GetRawDataSize(), GetSourceTypeName(), auxName, 0, bodyStr); - decl->staticConf = staticConf; -} - size_t ZCutscene::GetRawDataSize() const { size_t size = 0; @@ -151,12 +124,6 @@ size_t ZCutscene::GetRawDataSize() const return size; } -void ZCutscene::ExtractFromXML(tinyxml2::XMLElement* reader, uint32_t nRawDataIndex) -{ - ZResource::ExtractFromXML(reader, nRawDataIndex); - DeclareVar(parent->GetName(), ""); -} - void ZCutscene::ParseRawData() { ZResource::ParseRawData(); @@ -1268,6 +1235,20 @@ ZCutsceneBase::ZCutsceneBase(ZFile* nParent) : ZResource(nParent) { } +Declaration* ZCutsceneBase::DeclareVar(const std::string& prefix, const std::string& bodyStr) +{ + std::string auxName = name; + + if (name == "") + auxName = GetDefaultName(prefix); + + Declaration* decl = + parent->AddDeclarationArray(rawDataIndex, GetDeclarationAlignment(), GetRawDataSize(), + GetSourceTypeName(), auxName, 0, bodyStr); + decl->staticConf = staticConf; + return decl; +} + std::string ZCutsceneBase::GetSourceTypeName() const { return "CutsceneData"; |
