mirror of
https://github.com/zeldaret/oot.git
synced 2025-08-12 01:40:47 +00:00
ZAPD Update (#1605)
* git subrepo pull --force tools/ZAPD subrepo: subdir: "tools/ZAPD" merged: "2b6f459b9" upstream: origin: "https://github.com/zeldaret/ZAPD.git" branch: "master" commit: "2b6f459b9" git-subrepo: version: "0.4.6" origin: "???" commit: "???" * Update ZAPD Co-authored-by: Yanis42 <35189056+Yanis42@users.noreply.github.com> --------- Co-authored-by: Yanis42 <35189056+Yanis42@users.noreply.github.com>
This commit is contained in:
parent
dcab429bf2
commit
c1a499c3ae
7 changed files with 270 additions and 61 deletions
|
@ -214,6 +214,15 @@ void GameConfig::ConfigFunc_EnumData(const tinyxml2::XMLElement& element)
|
|||
else if (enumKey == "naviQuestHintType")
|
||||
enumData.naviQuestHintType[itemIndex] = itemID;
|
||||
|
||||
else if (enumKey == "ocarinaSongActionId")
|
||||
enumData.ocarinaSongActionId[itemIndex] = itemID;
|
||||
|
||||
else if (enumKey == "seqId")
|
||||
enumData.seqId[itemIndex] = itemID;
|
||||
|
||||
else if (enumKey == "playerCueId")
|
||||
enumData.playerCueId[itemIndex] = itemID;
|
||||
|
||||
// MM
|
||||
else if (enumKey == "modifySeqType")
|
||||
enumData.modifySeqType[itemIndex] = itemID;
|
||||
|
|
|
@ -31,10 +31,13 @@ public:
|
|||
std::map<uint16_t, std::string> fadeOutSeqPlayer;
|
||||
std::map<uint16_t, std::string> transitionType;
|
||||
std::map<uint16_t, std::string> naviQuestHintType;
|
||||
std::map<uint16_t, std::string> ocarinaSongActionId;
|
||||
std::map<uint16_t, std::string> seqId;
|
||||
|
||||
// OoT
|
||||
std::map<uint16_t, std::string> textType;
|
||||
std::map<uint16_t, std::string> destination;
|
||||
std::map<uint16_t, std::string> playerCueId;
|
||||
|
||||
// MM
|
||||
std::map<uint16_t, std::string> modifySeqType;
|
||||
|
|
|
@ -14,13 +14,13 @@ const std::unordered_map<CutsceneMM_CommandType, CsCommandListDescriptor> csComm
|
|||
{CutsceneMM_CommandType::CS_CMD_TRANSITION, {"CS_TRANSITION", "(%s, %i, %i)"}},
|
||||
{CutsceneMM_CommandType::CS_CMD_MOTION_BLUR, {"CS_MOTION_BLUR", "(%s, %i, %i)"}},
|
||||
{CutsceneMM_CommandType::CS_CMD_GIVE_TATL, {"CS_GIVE_TATL", "(%s, %i, %i)"}},
|
||||
{CutsceneMM_CommandType::CS_CMD_START_SEQ, {"CS_START_SEQ", "(0x%04X, %i, %i)"}},
|
||||
{CutsceneMM_CommandType::CS_CMD_START_SEQ, {"CS_START_SEQ", "(%s, %i, %i)"}},
|
||||
{CutsceneMM_CommandType::CS_CMD_SFX_REVERB_INDEX_2,
|
||||
{"CS_SFX_REVERB_INDEX_2", "(0x%04X, %i, %i)"}},
|
||||
{CutsceneMM_CommandType::CS_CMD_SFX_REVERB_INDEX_1,
|
||||
{"CS_SFX_REVERB_INDEX_1", "(0x%04X, %i, %i)"}},
|
||||
{CutsceneMM_CommandType::CS_CMD_MODIFY_SEQ, {"CS_MODIFY_SEQ", "(%s, %i, %i)"}},
|
||||
{CutsceneMM_CommandType::CS_CMD_STOP_SEQ, {"CS_STOP_SEQ", "(0x%04X, %i, %i, %i)"}},
|
||||
{CutsceneMM_CommandType::CS_CMD_STOP_SEQ, {"CS_STOP_SEQ", "(%s, %i, %i, %i)"}},
|
||||
{CutsceneMM_CommandType::CS_CMD_START_AMBIENCE, {"CS_START_AMBIENCE", "(0x%04X, %i, %i)"}},
|
||||
{CutsceneMM_CommandType::CS_CMD_FADE_OUT_AMBIENCE,
|
||||
{"CS_FADE_OUT_AMBIENCE", "(0x%04X, %i, %i)"}},
|
||||
|
@ -41,6 +41,7 @@ std::string CutsceneMMSubCommandEntry_GenericCmd::GetBodySourceCode() const
|
|||
const auto& element = csCommandsDescMM.find(commandId);
|
||||
std::string entryFmt = "CS_UNK_DATA(0x%02X, %i, %i, %i)";
|
||||
std::string type = "";
|
||||
bool isIndexInSeqId = enumData->seqId.find(base - 1) != enumData->seqId.end();
|
||||
|
||||
if (element != csCommandsDescMM.end())
|
||||
{
|
||||
|
@ -72,6 +73,11 @@ std::string CutsceneMMSubCommandEntry_GenericCmd::GetBodySourceCode() const
|
|||
enumData->chooseCreditsSceneType.find(base) != enumData->chooseCreditsSceneType.end())
|
||||
type = enumData->chooseCreditsSceneType[base];
|
||||
|
||||
else if ((commandId == CutsceneMM_CommandType::CS_CMD_START_SEQ ||
|
||||
commandId == CutsceneMM_CommandType::CS_CMD_STOP_SEQ) &&
|
||||
isIndexInSeqId)
|
||||
type = enumData->seqId[base - 1];
|
||||
|
||||
else if (commandId == CutsceneMM_CommandType::CS_CMD_GIVE_TATL)
|
||||
type = base ? "true" : "false";
|
||||
|
||||
|
@ -339,16 +345,18 @@ CutsceneMMSubCommandEntry_Text::CutsceneMMSubCommandEntry_Text(const std::vector
|
|||
|
||||
std::string CutsceneMMSubCommandEntry_Text::GetBodySourceCode() const
|
||||
{
|
||||
EnumData* enumData = &Globals::Instance->cfg.enumData;
|
||||
|
||||
if (type == 0xFFFF)
|
||||
{
|
||||
return StringHelper::Sprintf("CS_TEXT_NONE(%i, %i)", startFrame, endFrame);
|
||||
}
|
||||
|
||||
if (type == 2)
|
||||
if (type == 2 &&
|
||||
enumData->ocarinaSongActionId.find(base) != enumData->ocarinaSongActionId.end())
|
||||
{
|
||||
// TODO: set the enum name when it will be documented
|
||||
// (https://github.com/Decompollaborate/mm/blob/3e1c568c084671c17836ced904714ea49d989621/include/z64ocarina.h#L35-L118)
|
||||
return StringHelper::Sprintf("CS_TEXT_OCARINA_ACTION(%i, %i, %i, 0x%X)", base, startFrame,
|
||||
return StringHelper::Sprintf("CS_TEXT_OCARINA_ACTION(%s, %i, %i, 0x%X)",
|
||||
enumData->ocarinaSongActionId[base].c_str(), startFrame,
|
||||
endFrame, textId1);
|
||||
}
|
||||
|
||||
|
@ -425,23 +433,24 @@ CutsceneMMSubCommandEntry_ActorCue::CutsceneMMSubCommandEntry_ActorCue(
|
|||
|
||||
std::string CutsceneMMSubCommandEntry_ActorCue::GetBodySourceCode() const
|
||||
{
|
||||
std::string result;
|
||||
EnumData* enumData = &Globals::Instance->cfg.enumData;
|
||||
|
||||
if (static_cast<CutsceneMM_CommandType>(commandID) == CutsceneMM_CommandType::CS_CMD_PLAYER_CUE)
|
||||
{
|
||||
result = "CS_PLAYER_CUE";
|
||||
return StringHelper::Sprintf("CS_PLAYER_CUE(%s, %i, %i, 0x%04X, 0x%04X, 0x%04X, %i, %i, "
|
||||
"%i, %i, %i, %i, %.8ef, %.8ef, %.8ef)",
|
||||
enumData->playerCueId[base].c_str(), startFrame, endFrame,
|
||||
rotX, rotY, rotZ, startPosX, startPosY, startPosZ, endPosX,
|
||||
endPosY, endPosZ, normalX, normalY, normalZ);
|
||||
}
|
||||
else
|
||||
{
|
||||
result = "CS_ACTOR_CUE";
|
||||
return StringHelper::Sprintf("CS_ACTOR_CUE(%i, %i, %i, 0x%04X, 0x%04X, 0x%04X, %i, %i, "
|
||||
"%i, %i, %i, %i, %.8ef, %.8ef, %.8ef)",
|
||||
base, startFrame, endFrame, rotX, rotY, rotZ, startPosX,
|
||||
startPosY, startPosZ, endPosX, endPosY, endPosZ, normalX,
|
||||
normalY, normalZ);
|
||||
}
|
||||
|
||||
result +=
|
||||
StringHelper::Sprintf("(%i, %i, %i, 0x%04X, 0x%04X, 0x%04X, %i, %i, "
|
||||
"%i, %i, %i, %i, %.8ef, %.8ef, %.8ef)",
|
||||
base, startFrame, endFrame, rotX, rotY, rotZ, startPosX, startPosY,
|
||||
startPosZ, endPosX, endPosY, endPosZ, normalX, normalY, normalZ);
|
||||
return result;
|
||||
}
|
||||
|
||||
size_t CutsceneMMSubCommandEntry_ActorCue::GetRawSize() const
|
||||
|
|
|
@ -15,9 +15,9 @@ const std::unordered_map<CutsceneOoT_CommandType, CsCommandListDescriptor> csCom
|
|||
{CutsceneOoT_CommandType::CS_CMD_LIGHT_SETTING,
|
||||
{"CS_LIGHT_SETTING", "(0x%02X, %i, %i, %i, %i, %i, %i, %i, %i, %i, %i)"}},
|
||||
{CutsceneOoT_CommandType::CS_CMD_START_SEQ,
|
||||
{"CS_START_SEQ", "(%i, %i, %i, %i, %i, %i, %i, %i, %i, %i, %i)"}},
|
||||
{"CS_START_SEQ", "(%s, %i, %i, %i, %i, %i, %i, %i, %i, %i, %i)"}},
|
||||
{CutsceneOoT_CommandType::CS_CMD_STOP_SEQ,
|
||||
{"CS_STOP_SEQ", "(%i, %i, %i, %i, %i, %i, %i, %i, %i, %i, %i)"}},
|
||||
{"CS_STOP_SEQ", "(%s, %i, %i, %i, %i, %i, %i, %i, %i, %i, %i)"}},
|
||||
{CutsceneOoT_CommandType::CS_CMD_FADE_OUT_SEQ,
|
||||
{"CS_FADE_OUT_SEQ", "(%s, %i, %i, %i, %i, %i, %i, %i, %i, %i, %i)"}},
|
||||
};
|
||||
|
@ -51,6 +51,7 @@ std::string CutsceneOoTSubCommandEntry_GenericCmd::GetBodySourceCode() const
|
|||
bool isIndexInMisc = enumData->miscType.find(base) != enumData->miscType.end();
|
||||
bool isIndexInFade =
|
||||
enumData->fadeOutSeqPlayer.find(base) != enumData->fadeOutSeqPlayer.end();
|
||||
bool isIndexInSeqId = enumData->seqId.find(base - 1) != enumData->seqId.end();
|
||||
std::string entryFmt = element->second.cmdMacro;
|
||||
std::string firstArg;
|
||||
entryFmt += element->second.args;
|
||||
|
@ -59,14 +60,15 @@ std::string CutsceneOoTSubCommandEntry_GenericCmd::GetBodySourceCode() const
|
|||
firstArg = enumData->miscType[base];
|
||||
else if (commandId == CutsceneOoT_CommandType::CS_CMD_FADE_OUT_SEQ && isIndexInFade)
|
||||
firstArg = enumData->fadeOutSeqPlayer[base];
|
||||
else if (commandId == CutsceneOoT_CommandType::CS_CMD_START_SEQ && isIndexInSeqId)
|
||||
firstArg = enumData->seqId[base - 1];
|
||||
else if (commandId == CutsceneOoT_CommandType::CS_CMD_STOP_SEQ && isIndexInSeqId)
|
||||
firstArg = enumData->seqId[base - 1];
|
||||
else
|
||||
{
|
||||
bool baseOne = (commandId == CutsceneOoT_CommandType::CS_CMD_LIGHT_SETTING ||
|
||||
commandId == CutsceneOoT_CommandType::CS_CMD_START_SEQ ||
|
||||
commandId == CutsceneOoT_CommandType::CS_CMD_STOP_SEQ);
|
||||
return StringHelper::Sprintf(entryFmt.c_str(), baseOne ? base - 1 : base, startFrame,
|
||||
endFrame, pad, unused1, unused2, unused3, unused4, unused5,
|
||||
unused6, unused7, unused8, unused9, unused10);
|
||||
return StringHelper::Sprintf(entryFmt.c_str(), base - 1, startFrame, endFrame, pad,
|
||||
unused1, unused2, unused3, unused4, unused5, unused6,
|
||||
unused7, unused8, unused9, unused10);
|
||||
}
|
||||
return StringHelper::Sprintf(entryFmt.c_str(), firstArg.c_str(), startFrame, endFrame, pad,
|
||||
unused1, unused2, unused3, unused4, unused5, unused6, unused7,
|
||||
|
@ -270,9 +272,11 @@ std::string CutsceneOoTSubCommandEntry_Text::GetBodySourceCode() const
|
|||
{
|
||||
return StringHelper::Sprintf("CS_TEXT_NONE(%i, %i)", startFrame, endFrame);
|
||||
}
|
||||
if (type == 2)
|
||||
if (type == 2 &&
|
||||
enumData->ocarinaSongActionId.find(base) != enumData->ocarinaSongActionId.end())
|
||||
{
|
||||
return StringHelper::Sprintf("CS_TEXT_OCARINA_ACTION(%i, %i, %i, 0x%X)", base, startFrame,
|
||||
return StringHelper::Sprintf("CS_TEXT_OCARINA_ACTION(%s, %i, %i, 0x%X)",
|
||||
enumData->ocarinaSongActionId[base].c_str(), startFrame,
|
||||
endFrame, textId1);
|
||||
}
|
||||
|
||||
|
@ -333,24 +337,25 @@ CutsceneOoTSubCommandEntry_ActorCue::CutsceneOoTSubCommandEntry_ActorCue(
|
|||
|
||||
std::string CutsceneOoTSubCommandEntry_ActorCue::GetBodySourceCode() const
|
||||
{
|
||||
std::string result;
|
||||
EnumData* enumData = &Globals::Instance->cfg.enumData;
|
||||
|
||||
if (static_cast<CutsceneOoT_CommandType>(commandID) ==
|
||||
CutsceneOoT_CommandType::CS_CMD_PLAYER_CUE)
|
||||
{
|
||||
result = "CS_PLAYER_CUE";
|
||||
return StringHelper::Sprintf("CS_PLAYER_CUE(%s, %i, %i, 0x%04X, 0x%04X, 0x%04X, %i, %i, "
|
||||
"%i, %i, %i, %i, %.8ef, %.8ef, %.8ef)",
|
||||
enumData->playerCueId[base].c_str(), startFrame, endFrame,
|
||||
rotX, rotY, rotZ, startPosX, startPosY, startPosZ, endPosX,
|
||||
endPosY, endPosZ, normalX, normalY, normalZ);
|
||||
}
|
||||
else
|
||||
{
|
||||
result = "CS_ACTOR_CUE";
|
||||
return StringHelper::Sprintf("CS_ACTOR_CUE(%i, %i, %i, 0x%04X, 0x%04X, 0x%04X, %i, %i, "
|
||||
"%i, %i, %i, %i, %.8ef, %.8ef, %.8ef)",
|
||||
base, startFrame, endFrame, rotX, rotY, rotZ, startPosX,
|
||||
startPosY, startPosZ, endPosX, endPosY, endPosZ, normalX,
|
||||
normalY, normalZ);
|
||||
}
|
||||
|
||||
result +=
|
||||
StringHelper::Sprintf("(%i, %i, %i, 0x%04X, 0x%04X, 0x%04X, %i, %i, "
|
||||
"%i, %i, %i, %i, %.8ef, %.8ef, %.8ef)",
|
||||
base, startFrame, endFrame, rotX, rotY, rotZ, startPosX, startPosY,
|
||||
startPosZ, endPosX, endPosY, endPosZ, normalX, normalY, normalZ);
|
||||
return result;
|
||||
}
|
||||
|
||||
size_t CutsceneOoTSubCommandEntry_ActorCue::GetRawSize() const
|
||||
|
|
|
@ -8,9 +8,9 @@
|
|||
|
||||
enum class ZLimbSkinType
|
||||
{
|
||||
SkinType_Null, // SkinLimb segment = NULL
|
||||
SkinType_Animated = 4, // SkinLimb segment = SkinAnimatedLimbData*
|
||||
SkinType_Normal = 11, // SkinLimb segment = Gfx*
|
||||
SkinType_Null, // SkinLimb segment = NULL
|
||||
SkinType_Animated = 4, // SkinLimb segment = SkinAnimatedLimbData*
|
||||
SkinType_Normal = 11, // SkinLimb segment = Gfx*
|
||||
};
|
||||
|
||||
class SkinVertex : public ZResource
|
||||
|
@ -75,11 +75,11 @@ public:
|
|||
size_t GetRawDataSize() const override;
|
||||
|
||||
protected:
|
||||
uint16_t vtxCount; // Number of vertices in this modif entry
|
||||
uint16_t transformCount; // Length of limbTransformations
|
||||
uint16_t unk_4; // 0 or 1, used as an index for limbTransformations
|
||||
segptr_t skinVertices; // SkinVertex*
|
||||
segptr_t limbTransformations; // SkinTransformation*
|
||||
uint16_t vtxCount; // Number of vertices in this modif entry
|
||||
uint16_t transformCount; // Length of limbTransformations
|
||||
uint16_t unk_4; // 0 or 1, used as an index for limbTransformations
|
||||
segptr_t skinVertices; // SkinVertex*
|
||||
segptr_t limbTransformations; // SkinTransformation*
|
||||
|
||||
std::vector<SkinVertex> skinVertices_arr;
|
||||
std::vector<SkinTransformation> limbTransformations_arr;
|
||||
|
@ -102,9 +102,9 @@ public:
|
|||
|
||||
protected:
|
||||
uint16_t totalVtxCount;
|
||||
uint16_t limbModifCount; // Length of limbModifications
|
||||
segptr_t limbModifications; // SkinLimbModif*
|
||||
segptr_t dlist; // Gfx*
|
||||
uint16_t limbModifCount; // Length of limbModifications
|
||||
segptr_t limbModifications; // SkinLimbModif*
|
||||
segptr_t dlist; // Gfx*
|
||||
|
||||
std::vector<SkinLimbModif> limbModifications_arr;
|
||||
// ZDisplayList* unk_8_dlist = nullptr;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue