blob: 429a369a861596c00818b388c35714dba1c5c180 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
|
#include "SetPathways.h"
#include "Globals.h"
#include "Utils/BitConverter.h"
#include "Utils/StringHelper.h"
#include "ZFile.h"
#include "ZRoom/ZRoom.h"
SetPathways::SetPathways(ZFile* nParent) : ZRoomCommand(nParent), pathwayList(nParent)
{
}
void SetPathways::DeclareReferences([[maybe_unused]] const std::string& prefix)
{
if (segmentOffset != 0)
{
std::string varName =
StringHelper::Sprintf("%sPathway_%06X", prefix.c_str(), segmentOffset);
parent->AddDeclarationPlaceholder(segmentOffset, varName);
}
}
void SetPathways::ParseRawDataLate()
{
if (Globals::Instance->game == ZGame::MM_RETAIL)
{
auto numPaths = zRoom->parent->GetDeclarationSizeFromNeighbor(segmentOffset) / 8;
pathwayList.SetNumPaths(numPaths);
}
if (Globals::Instance->otrMode)
{
auto zPath = (ZPath*)parent->FindResource(segmentOffset);
if (zPath != nullptr)
pathwayList = *zPath;
}
pathwayList.ExtractFromFile(segmentOffset);
}
void SetPathways::DeclareReferencesLate(const std::string& prefix)
{
std::string varName = StringHelper::Sprintf("%sPathway_%06X", prefix.c_str(), segmentOffset);
pathwayList.SetName(varName);
pathwayList.DeclareReferences(prefix);
pathwayList.GetSourceOutputCode(prefix);
}
std::string SetPathways::GetBodySourceCode() const
{
std::string listName;
Globals::Instance->GetSegmentedPtrName(cmdArg2, parent, "Path", listName, parent->workerID);
return StringHelper::Sprintf("SCENE_CMD_PATH_LIST(%s)", listName.c_str());
}
std::string SetPathways::GetCommandCName() const
{
return "SCmdPathList";
}
RoomCommand SetPathways::GetRoomCommand() const
{
return RoomCommand::SetPathways;
}
|