Implement/match MxStreamController::FindNextActionDataStartFromStreamingAction (#368)

* Implement/match MxStreamController::FUN_100c1f00

* Implement/match MxStreamController::FindNextActionDataStartFromStreamingAction
This commit is contained in:
Christian Semmler 2023-12-26 20:39:48 -05:00 committed by GitHub
parent cfe28a2b26
commit 88d267f9f3
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
3 changed files with 17 additions and 5 deletions

View file

@ -215,7 +215,7 @@ MxResult MxStreamController::VTable0x30(MxDSAction* p_action)
MxResult result = FAILURE;
MxDSAction* action = m_unk0x3c.Find(p_action, TRUE);
if (action != NULL) {
MxNextActionDataStart* data = m_nextActionList.Find(action->GetObjectId(), action->GetUnknown24());
MxNextActionDataStart* data = m_nextActionList.FindAndErase(action->GetObjectId(), action->GetUnknown24());
delete action;
delete data;
result = SUCCESS;
@ -284,10 +284,10 @@ MxResult MxStreamController::FUN_100c1f00(MxDSAction* p_action)
return SUCCESS;
}
// STUB: LEGO1 0x100c20b0
// FUNCTION: LEGO1 0x100c20b0
MxNextActionDataStart* MxStreamController::FindNextActionDataStartFromStreamingAction(MxDSStreamingAction* p_action)
{
return NULL;
return m_nextActionList.Find(p_action->GetObjectId(), p_action->GetUnknown24());
}
// STUB: LEGO1 0x100c20d0

View file

@ -30,8 +30,19 @@ MxDSAction* MxStreamListMxDSAction::Find(MxDSAction* p_action, MxBool p_delete)
return found;
}
// FUNCTION: LEGO1 0x100c2240
// FUNCTION: LEGO1 0x100c21e0
MxNextActionDataStart* MxStreamListMxNextActionDataStart::Find(MxU32 p_id, MxS16 p_value)
{
for (iterator it = begin(); it != end(); it++) {
if (p_id == (*it)->GetObjectId() && p_value == (*it)->GetUnknown24())
return *it;
}
return NULL;
}
// FUNCTION: LEGO1 0x100c2240
MxNextActionDataStart* MxStreamListMxNextActionDataStart::FindAndErase(MxU32 p_id, MxS16 p_value)
{
MxNextActionDataStart* match = NULL;

View file

@ -41,7 +41,8 @@ class MxStreamListMxDSAction : public MxStreamList<MxDSAction*> {
// SIZE 0xc
class MxStreamListMxNextActionDataStart : public MxStreamList<MxNextActionDataStart*> {
public:
MxNextActionDataStart* Find(MxU32, MxS16);
MxNextActionDataStart* Find(MxU32 p_id, MxS16 p_value);
MxNextActionDataStart* FindAndErase(MxU32 p_id, MxS16 p_value);
};
// SIZE 0xc