summaryrefslogtreecommitdiff
path: root/ZAPD/ZAnimation.cpp
diff options
context:
space:
mode:
authorYanis42 <35189056+Yanis42@users.noreply.github.com>2023-10-17 05:56:49 +0200
committerGitHub <noreply@github.com>2023-10-16 23:56:49 -0400
commit094e797349c86d0baef4a624962f4287aefdfef2 (patch)
treeee08bc4d0cba7fe53732d056627532bb2ffd605d /ZAPD/ZAnimation.cpp
parent338e35f89afc905399ad90c952d154ae7b20bf75 (diff)
Update old names to newer ones (#305)JackMaster
* JointKey -> LegacyJointKey * CamData -> BgCamInfo * TransformData -> CurveInterpKnot * TransformUpdateIndex -> CurveAnimationHeader * SkelCurveLimbList -> CurveSkeletonHeader * LightSettings -> EnvLightSettings * EntranceEntry -> Spawn * PolygonDlist -> RoomShapeDListsEntry * PolygonType0 -> RoomShapeNormal, MeshHeader1Single -> RoomShapeImageSingle * BgImage -> RoomShapeImageMultiBgEntry * MeshHeader1Multi -> RoomShapeImageMulti PolygonDlist2 -> RoomShapeCullableEntry * PolygonType2 -> RoomShapeCullable * SCENE_CMD_MESH -> SCENE_CMD_ROOM_SHAPE * implement enum parsing + use NaviQuestHintFileId * Struct_800A57C0 -> SkinVertex * Struct_800A598C_2 -> SkinTransformation * Struct_800A5E28 -> SkinAnimatedLimbData * Struct_800A598C -> SkinLimbModif * fix MM issues * LinkAnimationHeader -> PlayerAnimationHeader (MM) * CsCameraEntry -> ActorCsCamInfo (MM) * remaining scene commands (MM) * format * removed useless comment * name skinlimb members * format * fixed indentation
Diffstat (limited to 'ZAPD/ZAnimation.cpp')
-rw-r--r--ZAPD/ZAnimation.cpp45
1 files changed, 24 insertions, 21 deletions
diff --git a/ZAPD/ZAnimation.cpp b/ZAPD/ZAnimation.cpp
index 0d72344..959fff8 100644
--- a/ZAPD/ZAnimation.cpp
+++ b/ZAPD/ZAnimation.cpp
@@ -153,7 +153,10 @@ size_t ZLinkAnimation::GetRawDataSize() const
std::string ZLinkAnimation::GetSourceTypeName() const
{
- return "LinkAnimationHeader";
+ if (Globals::Instance->game == ZGame::MM_RETAIL)
+ return "PlayerAnimationHeader";
+ else
+ return "LinkAnimationHeader";
}
void ZLinkAnimation::ParseRawData()
@@ -174,8 +177,8 @@ std::string ZLinkAnimation::GetBodySourceCode() const
/* ZCurveAnimation */
-TransformData::TransformData(ZFile* parent, const std::vector<uint8_t>& rawData,
- uint32_t fileOffset)
+CurveInterpKnot::CurveInterpKnot(ZFile* parent, const std::vector<uint8_t>& rawData,
+ uint32_t fileOffset)
: parent(parent)
{
unk_00 = BitConverter::ToUInt16BE(rawData, fileOffset + 0);
@@ -185,26 +188,26 @@ TransformData::TransformData(ZFile* parent, const std::vector<uint8_t>& rawData,
unk_08 = BitConverter::ToFloatBE(rawData, fileOffset + 8);
}
-TransformData::TransformData(ZFile* parent, const std::vector<uint8_t>& rawData,
- uint32_t fileOffset, size_t index)
- : TransformData(parent, rawData, fileOffset + index * GetRawDataSize())
+CurveInterpKnot::CurveInterpKnot(ZFile* parent, const std::vector<uint8_t>& rawData,
+ uint32_t fileOffset, size_t index)
+ : CurveInterpKnot(parent, rawData, fileOffset + index * GetRawDataSize())
{
}
-std::string TransformData::GetBody([[maybe_unused]] const std::string& prefix) const
+std::string CurveInterpKnot::GetBody([[maybe_unused]] const std::string& prefix) const
{
return StringHelper::Sprintf("0x%04X, 0x%04X, %i, %i, %ff", unk_00, unk_02, unk_04, unk_06,
unk_08);
}
-size_t TransformData::GetRawDataSize() const
+size_t CurveInterpKnot::GetRawDataSize() const
{
return 0x0C;
}
-std::string TransformData::GetSourceTypeName()
+std::string CurveInterpKnot::GetSourceTypeName()
{
- return "TransformData";
+ return "CurveInterpKnot";
}
ZCurveAnimation::ZCurveAnimation(ZFile* nParent) : ZAnimation(nParent)
@@ -369,7 +372,7 @@ std::string ZCurveAnimation::GetBodySourceCode() const
std::string refIndexStr;
Globals::Instance->GetSegmentedPtrName(refIndex, parent, "u8", refIndexStr);
std::string transformDataStr;
- Globals::Instance->GetSegmentedPtrName(transformData, parent, "TransformData",
+ Globals::Instance->GetSegmentedPtrName(transformData, parent, "CurveInterpKnot",
transformDataStr);
std::string copyValuesStr;
Globals::Instance->GetSegmentedPtrName(copyValues, parent, "s16", copyValuesStr);
@@ -390,7 +393,7 @@ DeclarationAlignment ZCurveAnimation::GetDeclarationAlignment() const
std::string ZCurveAnimation::GetSourceTypeName() const
{
- return "TransformUpdateIndex";
+ return "CurveAnimationHeader";
}
/* ZLegacyAnimation */
@@ -423,7 +426,7 @@ void ZLegacyAnimation::ParseRawData()
ptr = jointKeyOffset;
for (int32_t i = 0; i < limbCount + 1; i++)
{
- JointKey key(parent);
+ LegacyJointKey key(parent);
key.ExtractFromFile(ptr);
jointKeyArray.push_back(key);
@@ -495,7 +498,7 @@ std::string ZLegacyAnimation::GetBodySourceCode() const
std::string frameDataName;
std::string jointKeyName;
Globals::Instance->GetSegmentedPtrName(frameData, parent, "s16", frameDataName);
- Globals::Instance->GetSegmentedPtrName(jointKey, parent, "JointKey", jointKeyName);
+ Globals::Instance->GetSegmentedPtrName(jointKey, parent, "LegacyJointKey", jointKeyName);
body += StringHelper::Sprintf("\t%i, %i,\n", frameCount, limbCount);
body += StringHelper::Sprintf("\t%s,\n", frameDataName.c_str());
@@ -514,11 +517,11 @@ size_t ZLegacyAnimation::GetRawDataSize() const
return 0x0C;
}
-JointKey::JointKey(ZFile* nParent) : ZResource(nParent)
+LegacyJointKey::LegacyJointKey(ZFile* nParent) : ZResource(nParent)
{
}
-void JointKey::ParseRawData()
+void LegacyJointKey::ParseRawData()
{
ZResource::ParseRawData();
@@ -531,23 +534,23 @@ void JointKey::ParseRawData()
z = BitConverter::ToInt16BE(rawData, rawDataIndex + 0x0A);
}
-std::string JointKey::GetBodySourceCode() const
+std::string LegacyJointKey::GetBodySourceCode() const
{
return StringHelper::Sprintf("%6i, %6i, %6i, %6i, %6i, %6i", xMax, x, yMax, y, zMax, z);
}
-std::string JointKey::GetSourceTypeName() const
+std::string LegacyJointKey::GetSourceTypeName() const
{
- return "JointKey";
+ return "LegacyJointKey";
}
-ZResourceType JointKey::GetResourceType() const
+ZResourceType LegacyJointKey::GetResourceType() const
{
// TODO
return ZResourceType::Error;
}
-size_t JointKey::GetRawDataSize() const
+size_t LegacyJointKey::GetRawDataSize() const
{
return 0x0C;
}