diff options
| author | Léo Lam <leo@leolam.fr> | 2021-03-12 01:17:24 +0100 |
|---|---|---|
| committer | Léo Lam <leo@leolam.fr> | 2021-03-12 01:23:14 +0100 |
| commit | 1e4f1902c05abbe57932f27e7469e91c74812ce9 (patch) | |
| tree | 6d73a523702a4812f92fa9d7a61e349e205ee242 /src/KingSystem/ActorSystem | |
| parent | b90017bf3b3e0839dc45caed5f8f8f6ed6bbec9d (diff) | |
ksys/act: Fix pre-delete function signature
Tiny differences you only notice when doing matching decomp.
Diffstat (limited to 'src/KingSystem/ActorSystem')
| -rw-r--r-- | src/KingSystem/ActorSystem/actBaseProc.cpp | 12 | ||||
| -rw-r--r-- | src/KingSystem/ActorSystem/actBaseProc.h | 13 |
2 files changed, 15 insertions, 10 deletions
diff --git a/src/KingSystem/ActorSystem/actBaseProc.cpp b/src/KingSystem/ActorSystem/actBaseProc.cpp index 6e1bea55..4342a9d9 100644 --- a/src/KingSystem/ActorSystem/actBaseProc.cpp +++ b/src/KingSystem/ActorSystem/actBaseProc.cpp @@ -189,7 +189,7 @@ void BaseProc::onEnterDelete_() {} void BaseProc::onEnterSleep_() {} -void BaseProc::preDelete3_(bool*) {} +void BaseProc::preDelete3_(const PreDeleteArg& arg) {} bool BaseProc::prepareInit_(sead::Heap*, BaseProc::PrepareArg&) { return true; @@ -197,7 +197,7 @@ bool BaseProc::prepareInit_(sead::Heap*, BaseProc::PrepareArg&) { void BaseProc::onPreDeleteStart_(PrepareArg&) {} -void BaseProc::preDelete2_(bool*) {} +void BaseProc::preDelete2_(const PreDeleteArg& arg) {} void BaseProc::preDelete1_() {} @@ -475,12 +475,12 @@ void BaseProc::freeLinkData() { BaseProcLinkDataMgr::instance()->releaseLink(this); } -void BaseProc::doPreDelete(bool* do_not_destruct_immediately) { +void BaseProc::doPreDelete(const PreDeleteArg& arg) { preDelete1_(); - preDelete2_(do_not_destruct_immediately); - preDelete3_(do_not_destruct_immediately); + preDelete2_(arg); + preDelete3_(arg); - if (*do_not_destruct_immediately) + if (arg.do_not_destruct_immediately) return; mFlags.set(Flags::Destructed); diff --git a/src/KingSystem/ActorSystem/actBaseProc.h b/src/KingSystem/ActorSystem/actBaseProc.h index ae81149c..34847d13 100644 --- a/src/KingSystem/ActorSystem/actBaseProc.h +++ b/src/KingSystem/ActorSystem/actBaseProc.h @@ -69,6 +69,10 @@ public: }; KSYS_CHECK_SIZE_NX150(CreateArg, 0x28); + struct PreDeleteArg { + bool do_not_destruct_immediately = false; + }; + explicit BaseProc(const CreateArg& arg); virtual ~BaseProc(); @@ -127,6 +131,9 @@ public: onJobPush2_(type); } + /// Actually pre-delete the actor. Called from BaseProcDeleter. + void doPreDelete(const PreDeleteArg& arg); + protected: friend class BaseProcLinkDataMgr; friend class BaseProcMgr; @@ -232,14 +239,14 @@ protected: virtual void onEnterSleep_(); /// Called to actually pre-delete (third and final callback). - virtual void preDelete3_(bool* do_not_destruct_immediately); + virtual void preDelete3_(const PreDeleteArg& arg); virtual bool prepareInit_(sead::Heap* heap, PrepareArg& arg); /// Called when pre-delete actually starts (after preparation, before requesting it). virtual void onPreDeleteStart_(PrepareArg&); /// Called to actually pre-delete (second callback). - virtual void preDelete2_(bool* do_not_destruct_immediately); + virtual void preDelete2_(const PreDeleteArg& arg); /// Called to actually pre-delete (first callback). virtual void preDelete1_(); @@ -258,8 +265,6 @@ protected: bool processStateUpdate(u8 counter); void processPreDelete(); - /// Actually pre-delete the actor. Called from BaseProcDeleter. - void doPreDelete(bool* do_not_destruct_immediately); void startDelete_(); /// Called from BaseProcMgr when a job for this process is invoked. |
