mirror of https://github.com/zeldaret/botw.git
non request BaseProcHandle stuff
refactoring baseProcHandle.cpp refactoring
This commit is contained in:
parent
aff4047630
commit
965d34c712
|
@ -89504,14 +89504,14 @@
|
||||||
0x00000071011bb7f4,sub_71011BB7F4,52,
|
0x00000071011bb7f4,sub_71011BB7F4,52,
|
||||||
0x00000071011bb828,sub_71011BB828,92,
|
0x00000071011bb828,sub_71011BB828,92,
|
||||||
0x00000071011bb884,sub_71011BB884,32,
|
0x00000071011bb884,sub_71011BB884,32,
|
||||||
0x00000071011bb8a4,BaseProcHandle::ctor,12,
|
0x00000071011bb8a4,BaseProcHandle::ctor,12,_ZN4ksys3act14BaseProcHandleC1Ev
|
||||||
0x00000071011bb8b0,BaseProcHandle::actorReady,32,
|
0x00000071011bb8b0,BaseProcHandle::actorReady,32,_ZN4ksys3act14BaseProcHandle9procReadyEv
|
||||||
0x00000071011bb8d0,BaseProcHandle::hasActorAndFlags5,84,
|
0x00000071011bb8d0,BaseProcHandle::hasActorAndFlags5,84,
|
||||||
0x00000071011bb924,BaseProcHandle::x,52,
|
0x00000071011bb924,BaseProcHandle::x,52,
|
||||||
0x00000071011bb958,BaseProcHandle::deleteActor,112,
|
0x00000071011bb958,BaseProcHandle::deleteActor,112,
|
||||||
0x00000071011bb9c8,BaseProcHandle::dtor,56,
|
0x00000071011bb9c8,BaseProcHandle::dtor,56,_ZN4ksys3act14BaseProcHandleD1Ev
|
||||||
0x00000071011bba00,BaseProcUnit::deleteActor,316,
|
0x00000071011bba00,BaseProcUnit::deleteActor,316,
|
||||||
0x00000071011bbb3c,BaseProcHandle::getActor,24,
|
0x00000071011bbb3c,BaseProcHandle::getActor,24,_ZN4ksys3act14BaseProcHandle7getProcEv
|
||||||
0x00000071011bbb54,BaseProcHandle::setProcStateFlag8000,184,
|
0x00000071011bbb54,BaseProcHandle::setProcStateFlag8000,184,
|
||||||
0x00000071011bbc0c,BaseProcHandle::wakeUpActorAndReleaseUnit,184,
|
0x00000071011bbc0c,BaseProcHandle::wakeUpActorAndReleaseUnit,184,
|
||||||
0x00000071011bbcc4,BaseProcHandle::getBaseProcEvent,48,
|
0x00000071011bbcc4,BaseProcHandle::getBaseProcEvent,48,
|
||||||
|
|
Can't render this file because it is too large.
|
|
@ -12,7 +12,6 @@ public:
|
||||||
~SetInstEventFlagAction() override;
|
~SetInstEventFlagAction() override;
|
||||||
|
|
||||||
void oneShot() override;
|
void oneShot() override;
|
||||||
|
|
||||||
};
|
};
|
||||||
KSYS_CHECK_SIZE_NX150(SetInstEventFlagAction, 0x20);
|
KSYS_CHECK_SIZE_NX150(SetInstEventFlagAction, 0x20);
|
||||||
|
|
||||||
|
|
|
@ -9,9 +9,9 @@
|
||||||
#include <prim/seadSafeString.h>
|
#include <prim/seadSafeString.h>
|
||||||
#include <prim/seadTypedBitFlag.h>
|
#include <prim/seadTypedBitFlag.h>
|
||||||
#include <thread/seadAtomic.h>
|
#include <thread/seadAtomic.h>
|
||||||
|
#include "KingSystem/ActorSystem/actBaseProcHandle.h"
|
||||||
#include "KingSystem/ActorSystem/actBaseProcJob.h"
|
#include "KingSystem/ActorSystem/actBaseProcJob.h"
|
||||||
#include "KingSystem/ActorSystem/actBaseProcMap.h"
|
#include "KingSystem/ActorSystem/actBaseProcMap.h"
|
||||||
#include "KingSystem/ActorSystem/actBaseProcHandle.h"
|
|
||||||
#include "KingSystem/Utils/StrTreeMap.h"
|
#include "KingSystem/Utils/StrTreeMap.h"
|
||||||
#include "KingSystem/Utils/Types.h"
|
#include "KingSystem/Utils/Types.h"
|
||||||
|
|
||||||
|
|
|
@ -0,0 +1,29 @@
|
||||||
|
#include "KingSystem/ActorSystem/actBaseProcHandle.h"
|
||||||
|
|
||||||
|
namespace ksys::act {
|
||||||
|
|
||||||
|
BaseProcHandle::BaseProcHandle() {
|
||||||
|
mUnit = nullptr;
|
||||||
|
mFlag = 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
BaseProcHandle::~BaseProcHandle() {
|
||||||
|
if (mUnit) {
|
||||||
|
mUnit->deleteProc(0, this);
|
||||||
|
mUnit = nullptr;
|
||||||
|
}
|
||||||
|
mFlag = 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
bool BaseProcHandle::procReady() {
|
||||||
|
return mUnit && mUnit->isReady();
|
||||||
|
}
|
||||||
|
|
||||||
|
BaseProc* BaseProcHandle::getProc() {
|
||||||
|
if (mUnit)
|
||||||
|
return mUnit->getProc();
|
||||||
|
|
||||||
|
return nullptr;
|
||||||
|
}
|
||||||
|
|
||||||
|
} // namespace ksys::act
|
|
@ -1,19 +1,26 @@
|
||||||
#pragma once
|
#pragma once
|
||||||
|
|
||||||
#include <basis/seadTypes.h>
|
#include <basis/seadTypes.h>
|
||||||
#include "actBaseProcUnit.h"
|
#include "KingSystem/ActorSystem/actBaseProc.h"
|
||||||
|
#include "KingSystem/ActorSystem/actBaseProcUnit.h"
|
||||||
#include "KingSystem/Utils/Types.h"
|
#include "KingSystem/Utils/Types.h"
|
||||||
|
|
||||||
namespace ksys::act {
|
namespace ksys::act {
|
||||||
|
|
||||||
class BaseProcUnit;
|
class BaseProcUnit;
|
||||||
|
class BaseProc;
|
||||||
|
|
||||||
class BaseProcHandle {
|
class BaseProcHandle {
|
||||||
public:
|
public:
|
||||||
BaseProcHandle();
|
BaseProcHandle();
|
||||||
~BaseProcHandle();
|
~BaseProcHandle();
|
||||||
|
|
||||||
static BaseProcHandle sDummyBaseProcHandle;
|
bool procReady();
|
||||||
|
|
||||||
|
BaseProc* getProc();
|
||||||
|
|
||||||
|
static BaseProcHandle sDummyHandle;
|
||||||
|
|
||||||
private:
|
private:
|
||||||
BaseProcUnit* mUnit;
|
BaseProcUnit* mUnit;
|
||||||
u8 mFlag;
|
u8 mFlag;
|
||||||
|
|
|
@ -4,6 +4,7 @@
|
||||||
#include "KingSystem/ActorSystem/actActorLinkConstDataAccess.h"
|
#include "KingSystem/ActorSystem/actActorLinkConstDataAccess.h"
|
||||||
#include "KingSystem/ActorSystem/actBaseProc.h"
|
#include "KingSystem/ActorSystem/actBaseProc.h"
|
||||||
#include "KingSystem/Utils/Debug.h"
|
#include "KingSystem/Utils/Debug.h"
|
||||||
|
|
||||||
namespace ksys::act {
|
namespace ksys::act {
|
||||||
|
|
||||||
// NON_MATCHING: Equivalent but branches are off.
|
// NON_MATCHING: Equivalent but branches are off.
|
||||||
|
@ -15,7 +16,7 @@ bool BaseProcUnit::setProc(BaseProc* proc) {
|
||||||
if (mProc)
|
if (mProc)
|
||||||
mProc = nullptr;
|
mProc = nullptr;
|
||||||
|
|
||||||
if (mHandle == &BaseProcHandle::sDummyBaseProcHandle)
|
if (mHandle == &BaseProcHandle::sDummyHandle)
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
if (mHandle) {
|
if (mHandle) {
|
||||||
|
@ -51,7 +52,7 @@ bool BaseProcUnit::setProc(BaseProc* proc) {
|
||||||
}
|
}
|
||||||
|
|
||||||
bool BaseProcUnit::isParentHandleDefault() const {
|
bool BaseProcUnit::isParentHandleDefault() const {
|
||||||
return mHandle == &BaseProcHandle::sDummyBaseProcHandle;
|
return mHandle == &BaseProcHandle::sDummyHandle;
|
||||||
}
|
}
|
||||||
|
|
||||||
} // namespace ksys::act
|
} // namespace ksys::act
|
|
@ -1,9 +1,10 @@
|
||||||
#pragma once
|
#pragma once
|
||||||
|
|
||||||
#include <basis/seadTypes.h>
|
#include <basis/seadTypes.h>
|
||||||
|
#include <thread/seadAtomic.h>
|
||||||
#include <thread/seadCriticalSection.h>
|
#include <thread/seadCriticalSection.h>
|
||||||
#include "KingSystem/ActorSystem/actBaseProcHandle.h"
|
#include "KingSystem/ActorSystem/actBaseProcHandle.h"
|
||||||
#include <thread/seadAtomic.h>
|
|
||||||
namespace ksys::act {
|
namespace ksys::act {
|
||||||
|
|
||||||
class BaseProc;
|
class BaseProc;
|
||||||
|
@ -11,12 +12,15 @@ class BaseProcHandle;
|
||||||
|
|
||||||
class BaseProcUnit {
|
class BaseProcUnit {
|
||||||
public:
|
public:
|
||||||
bool deleteProc(void*, BaseProcHandle* handle);
|
bool deleteProc(u32, BaseProcHandle* handle);
|
||||||
bool setProc(BaseProc* proc);
|
bool setProc(BaseProc* proc);
|
||||||
void unlinkProc(BaseProc* proc);
|
void unlinkProc(BaseProc* proc);
|
||||||
void cleanUp(BaseProc* proc, bool set_flag_5);
|
void cleanUp(BaseProc* proc, bool set_flag_5);
|
||||||
bool isParentHandleDefault() const;
|
bool isParentHandleDefault() const;
|
||||||
|
|
||||||
|
BaseProc* getProc() const { return mProc; }
|
||||||
|
bool isReady() const { return mFlags == 2; }
|
||||||
|
|
||||||
private:
|
private:
|
||||||
u32 mFlags;
|
u32 mFlags;
|
||||||
sead::Atomic<BaseProcHandle*> mHandle;
|
sead::Atomic<BaseProcHandle*> mHandle;
|
||||||
|
|
Loading…
Reference in New Issue