summaryrefslogtreecommitdiff
path: root/ZAPD/ZRoom/Commands/SetCutscenes.cpp
diff options
context:
space:
mode:
authorbriaguya <70942617+briaguya-ai@users.noreply.github.com>2023-10-18 00:09:24 -0400
committerbriaguya <70942617+briaguya-ai@users.noreply.github.com>2023-10-18 00:09:24 -0400
commit3f878d401fdcff6e7f898524f3bcf5cf4c2b2532 (patch)
tree2f0a7e29ec2dd17d0cbe70e8ee52c96f88608bfa /ZAPD/ZRoom/Commands/SetCutscenes.cpp
parente9f4fc638ed904cc0dcdac24ea7708c9a220a702 (diff)
parent094e797349c86d0baef4a624962f4287aefdfef2 (diff)
Merge branch 'JackMaster' into mergeJackOntoSquash
Conflicts: ZAPD/Declaration.h ZAPD/Globals.cpp ZAPD/Globals.h ZAPD/Main.cpp ZAPD/OtherStructs/SkinLimbStructs.cpp ZAPD/OtherStructs/SkinLimbStructs.h ZAPD/ZAnimation.cpp ZAPD/ZCollision.cpp ZAPD/ZCollision.h ZAPD/ZDisplayList.cpp ZAPD/ZFile.cpp ZAPD/ZLimb.cpp ZAPD/ZLimb.h ZAPD/ZPath.cpp ZAPD/ZResource.h ZAPD/ZRoom/Commands/SetCsCamera.cpp ZAPD/ZRoom/Commands/SetCutsceneEntryList.cpp ZAPD/ZRoom/Commands/SetCutscenes.cpp ZAPD/ZRoom/Commands/SetCutscenes.h ZAPD/ZRoom/Commands/SetEntranceList.cpp ZAPD/ZRoom/Commands/SetLightingSettings.cpp ZAPD/ZRoom/Commands/SetMesh.cpp ZAPD/ZRoom/Commands/SetMinimapList.cpp ZAPD/ZTexture.cpp ZAPDUtils/Makefile ZAPDUtils/Utils/BitConverter.h ZAPDUtils/Utils/Directory.h ZAPDUtils/Utils/File.h ZAPDUtils/Utils/Path.h ZAPDUtils/Utils/StringHelper.h ZAPDUtils/ZAPDUtils.vcxproj
Diffstat (limited to 'ZAPD/ZRoom/Commands/SetCutscenes.cpp')
-rw-r--r--ZAPD/ZRoom/Commands/SetCutscenes.cpp28
1 files changed, 16 insertions, 12 deletions
diff --git a/ZAPD/ZRoom/Commands/SetCutscenes.cpp b/ZAPD/ZRoom/Commands/SetCutscenes.cpp
index 68ff58c..e9192f0 100644
--- a/ZAPD/ZRoom/Commands/SetCutscenes.cpp
+++ b/ZAPD/ZRoom/Commands/SetCutscenes.cpp
@@ -23,11 +23,11 @@ void SetCutscenes::ParseRawData()
cutsceneEntries.reserve(numCutscenes);
for (uint8_t i = 0; i < numCutscenes; i++)
{
- CutsceneEntry entry(parent->GetRawData(), currentPtr);
+ CutsceneScriptEntry entry(parent->GetRawData(), currentPtr);
cutsceneEntries.push_back(entry);
currentPtr += 8;
}
- }
+ }
else if (Globals::Instance->game == ZGame::OOT_RETAIL || Globals::Instance->game == ZGame::OOT_SW97)
{
ZCutscene* cutscene = new ZCutscene(parent);
@@ -45,6 +45,7 @@ void SetCutscenes::ParseRawData()
void SetCutscenes::DeclareReferences(const std::string& prefix)
{
+ EnumData* enumData = &Globals::Instance->cfg.enumData;
std::string varPrefix = name;
if (varPrefix == "")
varPrefix = prefix;
@@ -75,10 +76,14 @@ void SetCutscenes::DeclareReferences(const std::string& prefix)
Globals::Instance->GetSegmentedPtrName(entry.segmentPtr, parent, "CutsceneData",
csName, parent->workerID);
- declaration +=
- StringHelper::Sprintf(" { %s, 0x%04X, 0x%02X, 0x%02X },", csName.c_str(),
- entry.exit, entry.entrance, entry.flag);
-
+ if (enumData->spawnFlag.find(entry.flag) != enumData->spawnFlag.end())
+ declaration += StringHelper::Sprintf(" { %s, 0x%04X, 0x%02X, %s },",
+ csName.c_str(), entry.exit, entry.entrance,
+ enumData->spawnFlag[entry.flag].c_str());
+ else
+ declaration +=
+ StringHelper::Sprintf(" { %s, 0x%04X, 0x%02X, 0x%02X },", csName.c_str(),
+ entry.exit, entry.entrance, entry.flag);
if (i + 1 < numCutscenes)
declaration += "\n";
@@ -86,8 +91,8 @@ void SetCutscenes::DeclareReferences(const std::string& prefix)
}
parent->AddDeclarationArray(segmentOffset, DeclarationAlignment::Align4,
- cutsceneEntries.size() * 8, "CutsceneEntry",
- StringHelper::Sprintf("%sCutsceneEntryList_%06X",
+ cutsceneEntries.size() * 8, "CutsceneScriptEntry",
+ StringHelper::Sprintf("%sCutsceneScriptEntryList_%06X",
zRoom->GetName().c_str(), segmentOffset),
cutsceneEntries.size(), declaration);
}
@@ -117,9 +122,8 @@ std::string SetCutscenes::GetBodySourceCode() const
if (Globals::Instance->game == ZGame::MM_RETAIL)
{
- Globals::Instance->GetSegmentedPtrName(cmdArg2, parent, "CutsceneEntry", listName,
- parent->workerID);
- return StringHelper::Sprintf("SCENE_CMD_CUTSCENE_LIST(%i, %s)", numCutscenes,
+ Globals::Instance->GetSegmentedPtrName(cmdArg2, parent, "CutsceneScriptEntry", listName, parent->workerID);
+ return StringHelper::Sprintf("SCENE_CMD_CUTSCENE_SCRIPT_LIST(%i, %s)", numCutscenes,
listName.c_str());
}
@@ -138,7 +142,7 @@ RoomCommand SetCutscenes::GetRoomCommand() const
return RoomCommand::SetCutscenes;
}
-CutsceneEntry::CutsceneEntry(const std::vector<uint8_t>& rawData, uint32_t rawDataIndex)
+CutsceneScriptEntry::CutsceneScriptEntry(const std::vector<uint8_t>& rawData, uint32_t rawDataIndex)
: segmentPtr(BitConverter::ToInt32BE(rawData, rawDataIndex + 0)),
exit(BitConverter::ToInt16BE(rawData, rawDataIndex + 4)), entrance(rawData[rawDataIndex + 6]),
flag(rawData[rawDataIndex + 7])