summaryrefslogtreecommitdiff
path: root/ZAPD/ZRoom/Commands/SetCutscenes.cpp
diff options
context:
space:
mode:
authorAnghelo Carvajal <angheloalf95@gmail.com>2021-04-19 12:43:52 -0400
committerGitHub <noreply@github.com>2021-04-19 12:43:52 -0400
commit301e17dadb5f6e9212ebcb704eb9cff75883002e (patch)
treec1b28712d3e52f0dc5888344c28a6efc0a719a5f /ZAPD/ZRoom/Commands/SetCutscenes.cpp
parent0d79edb291f7fdeafb2aca8edc81c4f90837977d (diff)
Deprecate Hint system (#116)
* remove unnecessary param * Fix Cutscene tag * Fix a missing declaration * Add Path as a node * run format
Diffstat (limited to 'ZAPD/ZRoom/Commands/SetCutscenes.cpp')
-rw-r--r--ZAPD/ZRoom/Commands/SetCutscenes.cpp28
1 files changed, 10 insertions, 18 deletions
diff --git a/ZAPD/ZRoom/Commands/SetCutscenes.cpp b/ZAPD/ZRoom/Commands/SetCutscenes.cpp
index 4c9a7e0..0ed124f 100644
--- a/ZAPD/ZRoom/Commands/SetCutscenes.cpp
+++ b/ZAPD/ZRoom/Commands/SetCutscenes.cpp
@@ -19,9 +19,14 @@ SetCutscenes::SetCutscenes(ZRoom* nZRoom, std::vector<uint8_t> rawData, int rawD
if (Globals::Instance->game == ZGame::OOT_RETAIL || Globals::Instance->game == ZGame::OOT_SW97)
{
ZCutscene* cutscene = new ZCutscene(nZRoom->parent);
- cutscene->ExtractFromXML(
- nullptr, rawData, segmentOffset,
- ""); // TODO: Use ExtractFromFile() here when that gets implemented
+ cutscene->ExtractFromFile(rawData, segmentOffset, "");
+
+ auto decl = nZRoom->parent->GetDeclaration(segmentOffset);
+ if (decl == nullptr)
+ {
+ cutscene->DeclareVar(zRoom->GetName().c_str(), "");
+ }
+
cutscenes.push_back(cutscene);
}
else
@@ -59,29 +64,16 @@ SetCutscenes::SetCutscenes(ZRoom* nZRoom, std::vector<uint8_t> rawData, int rawD
for (ZCutsceneBase* cutscene : cutscenes)
{
- string output = "";
-
- output += cutscene->GetSourceOutputCode(zRoom->GetName());
-
if (cutscene->getSegmentOffset() != 0)
{
Declaration* decl = zRoom->parent->GetDeclaration(cutscene->getSegmentOffset());
if (decl == nullptr)
{
- DeclarationPadding padding = (Globals::Instance->game == ZGame::MM_RETAIL) ?
- DeclarationPadding::None :
- DeclarationPadding::Pad16;
-
- zRoom->parent->AddDeclarationArray(
- cutscene->getSegmentOffset(), DeclarationAlignment::None, padding,
- cutscene->GetRawDataSize(), "s32",
- StringHelper::Sprintf("%sCutsceneData0x%06X", zRoom->GetName().c_str(),
- cutscene->getSegmentOffset()),
- 0, output);
+ cutscene->GetSourceOutputCode(zRoom->GetName());
}
else if (decl->text == "")
{
- decl->text = output;
+ decl->text = cutscene->GetBodySourceCode();
}
}
}