Match and link CStateMachineFactory

Former-commit-id: fdf57fb977840449171779a3d788b13af7c6c5fc
This commit is contained in:
Phillip Stephens 2023-10-17 12:25:54 -07:00
parent 602ed2b570
commit 79d5df69e1
5 changed files with 21 additions and 14 deletions

View File

@ -5934,11 +5934,11 @@ fn_800DE758 = .text:0x800DE758; // type:function size:0x74
__sinit_CSamusDoll_cpp = .text:0x800DE7CC; // type:function size:0x30 scope:local
FAiFiniteStateMachineFactory__FRC10SObjectTagR12CInputStreamRC15CVParamTransfer = .text:0x800DE7FC; // type:function size:0x64 scope:global
__ct<13CStateMachine>__16CFactoryFnReturnFP13CStateMachine = .text:0x800DE860; // type:function size:0xA4 scope:global
fn_800DE904 = .text:0x800DE904; // type:function size:0x90
fn_800DE994 = .text:0x800DE994; // type:function size:0xDC
__dt__41TObjOwnerDerivedFromIObj<13CStateMachine>Fv = .text:0x800DE904; // type:function size:0x90
__dt__13CStateMachineFv = .text:0x800DE994; // type:function size:0xDC
GetIObjObjectFor__23TToken<13CStateMachine>FRCQ24rstl25auto_ptr<13CStateMachine> = .text:0x800DEA70; // type:function size:0x2C scope:global
GetNewDerivedObject__41TObjOwnerDerivedFromIObj<13CStateMachine>FRCQ24rstl25auto_ptr<13CStateMachine> = .text:0x800DEA9C; // type:function size:0x9C scope:global
__dt__Q24rstl53auto_ptr<41TObjOwnerDerivedFromIObj<13CStateMachine>>Fv = .text:0x800DEB38; // type:function size:0x64 scope:global
__dt__Q24rstl25auto_ptr<13CStateMachine>Fv = .text:0x800DEB38; // type:function size:0x64 scope:global
SetWorldLighting__11CPlasmaBeamFR13CStateManager7TAreaIdff = .text:0x800DEB9C; // type:function size:0x130 scope:global
EnableSecondaryFx__11CPlasmaBeamFQ210CGunWeapon16ESecondaryFxType = .text:0x800DECCC; // type:function size:0x134 scope:global
IsLoaded__11CPlasmaBeamCFv = .text:0x800DEE00; // type:function size:0x54 scope:global
@ -18208,7 +18208,7 @@ lbl_803DF580 = .data:0x803DF580; // type:object size:0x84
jumptable_803DF604 = .data:0x803DF604; // type:object size:0x80 scope:local
lbl_803DF688 = .data:0x803DF688; // type:object size:0x6C
lbl_803DF6F4 = .data:0x803DF6F4; // type:object size:0xC
lbl_803DF700 = .data:0x803DF700; // type:object size:0x10
__vt__41TObjOwnerDerivedFromIObj<13CStateMachine> = .data:0x803DF700; // type:object size:0x10
__vt__11CPlasmaBeam = .data:0x803DF710; // type:object size:0x44 scope:global
__vt__10CPowerBeam = .data:0x803DF758; // type:object size:0x48 scope:global
__vt__9CWaveBeam = .data:0x803DF7A0; // type:object size:0x48 scope:global

View File

@ -5936,8 +5936,8 @@ fn_800DE758 = .text:0x800DE7D4; // type:function size:0x74 scope:global
__sinit_CSamusDoll_cpp = .text:0x800DE848; // type:function size:0x30 scope:global
FAiFiniteStateMachineFactory__FRC10SObjectTagR12CInputStreamRC15CVParamTransfer = .text:0x800DE878; // type:function size:0x64 scope:global
__ct<13CStateMachine>__16CFactoryFnReturnFP13CStateMachine = .text:0x800DE8DC; // type:function size:0xA4 scope:global
fn_800DE904 = .text:0x800DE980; // type:function size:0x90 scope:global
fn_800DE994 = .text:0x800DEA10; // type:function size:0xDC scope:global
__dt__41TObjOwnerDerivedFromIObj<13CStateMachine>Fv = .text:0x800DE980; // type:function size:0x90 scope:global
__dt__13CStateMachineFv = .text:0x800DEA10; // type:function size:0xDC scope:global
GetIObjObjectFor__23TToken<13CStateMachine>FRCQ24rstl25auto_ptr<13CStateMachine> = .text:0x800DEAEC; // type:function size:0x2C scope:global
GetNewDerivedObject__41TObjOwnerDerivedFromIObj<13CStateMachine>FRCQ24rstl25auto_ptr<13CStateMachine> = .text:0x800DEB18; // type:function size:0x9C scope:global
__dt__Q24rstl53auto_ptr<41TObjOwnerDerivedFromIObj<13CStateMachine>>Fv = .text:0x800DEBB4; // type:function size:0x64 scope:global
@ -18261,7 +18261,7 @@ lbl_803DF580 = .data:0x803DF760; // type:object size:0x84 scope:global
lbl_803DF604 = .data:0x803DF7E4; // type:object size:0x80 scope:global
lbl_803DF688 = .data:0x803DF868; // type:object size:0x6C scope:global
lbl_803DF6F4 = .data:0x803DF8D4; // type:object size:0xC scope:global
lbl_803DF700 = .data:0x803DF8E0; // type:object size:0x10 scope:global
__vt__41TObjOwnerDerivedFromIObj<13CStateMachine> = .data:0x803DF8E0; // type:object size:0x10 scope:global
__vt__11CPlasmaBeam = .data:0x803DF8F0; // type:object size:0x48 scope:global
__vt__10CPowerBeam = .data:0x803DF938; // type:object size:0x48 scope:global
__vt__9CWaveBeam = .data:0x803DF980; // type:object size:0x48 scope:global

View File

@ -371,7 +371,7 @@ config.libs = [
Object(NonMatching, "MetroidPrime/ScriptObjects/CScriptCameraHint.cpp"),
Object(NonMatching, "MetroidPrime/ScriptLoader.cpp"),
Object(NonMatching, "MetroidPrime/CSamusDoll.cpp"),
Object(NonMatching, "MetroidPrime/Factories/CStateMachineFactory.cpp"),
Object(Matching, "MetroidPrime/Factories/CStateMachineFactory.cpp"),
Object(Matching, "MetroidPrime/Weapons/CPlasmaBeam.cpp"),
Object(Matching, "MetroidPrime/Weapons/CPowerBeam.cpp"),
Object(NonMatching, "MetroidPrime/Weapons/CWaveBeam.cpp"),

View File

@ -55,8 +55,10 @@ private:
class CAiState {
public:
CAiState(CAiStateFunc func, const char* name) {
x0_func = func;
CAiState(CAiStateFunc func, const char* name)
: x0_func(func)
, x2c_numTriggers(0)
, x30_firstTrigger(nullptr) {
strncpy(xc_name, name, 31);
}

View File

@ -115,6 +115,10 @@ CStateMachine::CStateMachine(CInputStream& in) {
continue;
}
for (uint i = 0; i < x0_states[i].GetNumTriggers(); ++i) {
x10_triggers.push_back(CAiTrigger());
}
CAiTrigger* firstTrig = x10_triggers.data() + x10_triggers.size();
x0_states[i].SetTriggers(firstTrig);
@ -133,17 +137,18 @@ CStateMachine::CStateMachine(CInputStream& in) {
}
}
const bool isNot = name[0] == '!';
const CAiTriggerFunc func = CAi::GetTriggerFunc(isNot ? name + 1 : name);
name[nameLen] = '\0';
const CAiTriggerFunc func = CAi::GetTriggerFunc(name[0] == '!' ? name + 1 : name);
const float arg = in.Get< float >();
const bool isNot = name[0] == '!';
CAiTrigger* newTrig;
if (k < lastTriggerIdx) {
x10_triggers.push_back(CAiTrigger());
newTrig = &x10_triggers.back();
} else {
newTrig = &firstTrig[j];
newTrig = x0_states[i].GetTrig(j);
}
if (k == 0) {
newTrig->Setup(func, isNot, arg, &x0_states[in.Get< int >()]);
} else {