summaryrefslogtreecommitdiff
path: root/ZAPD/ZPath.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/ZPath.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/ZPath.cpp')
-rw-r--r--ZAPD/ZPath.cpp18
1 files changed, 12 insertions, 6 deletions
diff --git a/ZAPD/ZPath.cpp b/ZAPD/ZPath.cpp
index 849b4ed..8ea6d29 100644
--- a/ZAPD/ZPath.cpp
+++ b/ZAPD/ZPath.cpp
@@ -6,7 +6,8 @@
#include "WarningHandler.h"
#include "ZFile.h"
-REGISTER_ZFILENODE(Path, ZPath);
+REGISTER_ZFILENODE(Path, ZPath); // Old name that is being kept for backwards compatability
+REGISTER_ZFILENODE(PathList, ZPath); // New name that may be used in future XMLs
ZPath::ZPath(ZFile* nParent) : ZResource(nParent)
{
@@ -145,7 +146,7 @@ void PathwayEntry::DeclareReferences(const std::string& prefix)
std::string pointsName;
bool addressFound = Globals::Instance->GetSegmentedPtrName(listSegmentAddress, parent, "Vec3s",
- pointsName, parent->workerID);
+ pointsName, false, parent->workerID);
if (addressFound)
return;
@@ -172,21 +173,26 @@ void PathwayEntry::DeclareReferences(const std::string& prefix)
points.size(), declaration);
}
else
- decl->text = declaration;
+ decl->declBody = declaration;
}
std::string PathwayEntry::GetBodySourceCode() const
{
std::string declaration;
std::string listName;
- Globals::Instance->GetSegmentedPtrName(listSegmentAddress, parent, "Vec3s", listName,
- parent->workerID);
+ Globals::Instance->GetSegmentedPtrName(listSegmentAddress, parent, "Vec3s", listName, parent->workerID);
if (Globals::Instance->game == ZGame::MM_RETAIL)
declaration +=
StringHelper::Sprintf("%i, %i, %i, %s", numPoints, unk1, unk2, listName.c_str());
else
- declaration += StringHelper::Sprintf("%i, %s", numPoints, listName.c_str());
+ {
+ if (numPoints > 0)
+ declaration +=
+ StringHelper::Sprintf("ARRAY_COUNT(%s), %s", listName.c_str(), listName.c_str());
+ else
+ declaration += StringHelper::Sprintf("%i, %s", numPoints, listName.c_str());
+ }
return declaration;
}