mirror of
https://github.com/zeldaret/botw
synced 2026-10-21 09:10:57 -04:00
ksys, uking: move four definitions to match link order
calc_ goes before leave_ in ForceSetCameraPos and InWaterSelForkASPlay, and RailRoute's dtor goes after getCheckPointName (an unnamed row there is likely its D0). BaseProcJobHandler's ctor is linked right before BaseProc's ctor, so it moves into actBaseProc.cpp, and the class moves into actBaseProc.h so that its declaration stays with its definition. (AI assisted using Claude Opus 5.5)
This commit is contained in:
@@ -14,14 +14,14 @@ void ForceSetCameraPos::enter_(ksys::act::ai::InlineParamPack* params) {
|
||||
ksys::act::ai::Action::enter_(params);
|
||||
}
|
||||
|
||||
void ForceSetCameraPos::calc_() {
|
||||
ksys::act::ai::Action::calc_();
|
||||
}
|
||||
|
||||
void ForceSetCameraPos::leave_() {
|
||||
ksys::act::ai::Action::leave_();
|
||||
}
|
||||
|
||||
void ForceSetCameraPos::loadParams_() {}
|
||||
|
||||
void ForceSetCameraPos::calc_() {
|
||||
ksys::act::ai::Action::calc_();
|
||||
}
|
||||
|
||||
} // namespace uking::action
|
||||
|
||||
@@ -14,6 +14,10 @@ void InWaterSelForkASPlay::enter_(ksys::act::ai::InlineParamPack* params) {
|
||||
ksys::act::ai::Action::enter_(params);
|
||||
}
|
||||
|
||||
void InWaterSelForkASPlay::calc_() {
|
||||
ksys::act::ai::Action::calc_();
|
||||
}
|
||||
|
||||
void InWaterSelForkASPlay::leave_() {
|
||||
ksys::act::ai::Action::leave_();
|
||||
}
|
||||
@@ -28,8 +32,4 @@ void InWaterSelForkASPlay::loadParams_() {
|
||||
getStaticParam(&mASName_s, "ASName");
|
||||
}
|
||||
|
||||
void InWaterSelForkASPlay::calc_() {
|
||||
ksys::act::ai::Action::calc_();
|
||||
}
|
||||
|
||||
} // namespace uking::action
|
||||
|
||||
@@ -77,8 +77,6 @@ target_sources(uking PRIVATE
|
||||
actBaseProcInitializer.h
|
||||
actBaseProcJob.cpp
|
||||
actBaseProcJob.h
|
||||
actBaseProcJobHandler.cpp
|
||||
actBaseProcJobHandler.h
|
||||
actBaseProcJobQue.cpp
|
||||
actBaseProcJobQue.h
|
||||
actBaseProcLink.cpp
|
||||
|
||||
@@ -11,7 +11,6 @@
|
||||
#include <xlink2/xlink2Handle.h>
|
||||
#include "KingSystem/ActorSystem/actActorEditorNode.h"
|
||||
#include "KingSystem/ActorSystem/actBaseProc.h"
|
||||
#include "KingSystem/ActorSystem/actBaseProcJobHandler.h"
|
||||
#include "KingSystem/ActorSystem/actBaseProcLink.h"
|
||||
#include "KingSystem/ActorSystem/actPhysicsConstraints.h"
|
||||
#include "KingSystem/ActorSystem/actPhysicsUserTag.h"
|
||||
|
||||
@@ -3,7 +3,6 @@
|
||||
#include <time/seadTickSpan.h>
|
||||
#include "KingSystem/ActorSystem/actBaseProcAccessor.h"
|
||||
#include "KingSystem/ActorSystem/actBaseProcHandle.h"
|
||||
#include "KingSystem/ActorSystem/actBaseProcJobHandler.h"
|
||||
#include "KingSystem/ActorSystem/actBaseProcLink.h"
|
||||
#include "KingSystem/ActorSystem/actBaseProcMgr.h"
|
||||
#include "KingSystem/Terrain/teraSystem.h"
|
||||
@@ -13,6 +12,8 @@ namespace ksys::act {
|
||||
|
||||
static util::InitTimeInfo sInfo;
|
||||
|
||||
BaseProcJobHandler::BaseProcJobHandler(BaseProc* proc) : mLink(proc, proc->getPriority()) {}
|
||||
|
||||
BaseProc::BaseProc(const CreateArg& arg)
|
||||
: mName(arg.actor_name), mPriority(arg.class_info->priority) {
|
||||
BaseProcMgr* mgr = BaseProcMgr::instance();
|
||||
|
||||
@@ -5,6 +5,7 @@
|
||||
#include <container/seadSafeArray.h>
|
||||
#include <math/seadMathCalcCommon.h>
|
||||
#include <prim/seadBitFlag.h>
|
||||
#include <prim/seadDelegate.h>
|
||||
#include <prim/seadRuntimeTypeInfo.h>
|
||||
#include <prim/seadSafeString.h>
|
||||
#include <prim/seadTypedBitFlag.h>
|
||||
@@ -332,4 +333,46 @@ private:
|
||||
};
|
||||
KSYS_CHECK_SIZE_NX150(BaseProc, 0x180);
|
||||
|
||||
class BaseProcJobHandler {
|
||||
public:
|
||||
explicit BaseProcJobHandler(BaseProc* proc);
|
||||
virtual ~BaseProcJobHandler() = default;
|
||||
virtual void invoke() = 0;
|
||||
virtual void invokeSpecial() {}
|
||||
|
||||
BaseProcJobLink& getLink() { return mLink; }
|
||||
const BaseProcJobLink& getLink() const { return mLink; }
|
||||
|
||||
protected:
|
||||
BaseProcJobLink mLink;
|
||||
};
|
||||
KSYS_CHECK_SIZE_NX150(BaseProcJobHandler, 0x30);
|
||||
|
||||
/// For binding actor member functions.
|
||||
template <typename T>
|
||||
class BaseProcJobHandlerT : public BaseProcJobHandler {
|
||||
public:
|
||||
BaseProcJobHandlerT(T* proc, void (T::*fn)()) : BaseProcJobHandler(proc), mDelegate(proc, fn) {}
|
||||
|
||||
void invoke() override { mDelegate.invoke(); }
|
||||
|
||||
private:
|
||||
sead::Delegate<T> mDelegate;
|
||||
};
|
||||
|
||||
/// For binding two actor member functions.
|
||||
template <typename T>
|
||||
class BaseProcJobHandlerDualT : public BaseProcJobHandler {
|
||||
public:
|
||||
BaseProcJobHandlerDualT(T* proc, void (T::*fn)(), void (T::*fn_special)())
|
||||
: BaseProcJobHandler(proc), mDelegate(proc, fn), mDelegateSpecial(proc, fn_special) {}
|
||||
|
||||
void invoke() override { mDelegate.invoke(); }
|
||||
void invokeSpecial() override { mDelegateSpecial.invoke(); }
|
||||
|
||||
private:
|
||||
sead::Delegate<T> mDelegate;
|
||||
sead::Delegate<T> mDelegateSpecial;
|
||||
};
|
||||
|
||||
} // namespace ksys::act
|
||||
|
||||
@@ -1,8 +0,0 @@
|
||||
#include "KingSystem/ActorSystem/actBaseProcJobHandler.h"
|
||||
#include "KingSystem/ActorSystem/actBaseProc.h"
|
||||
|
||||
namespace ksys::act {
|
||||
|
||||
BaseProcJobHandler::BaseProcJobHandler(BaseProc* proc) : mLink(proc, proc->getPriority()) {}
|
||||
|
||||
} // namespace ksys::act
|
||||
@@ -1,51 +0,0 @@
|
||||
#pragma once
|
||||
|
||||
#include <prim/seadDelegate.h>
|
||||
#include "KingSystem/ActorSystem/actBaseProcJob.h"
|
||||
#include "KingSystem/Utils/Types.h"
|
||||
|
||||
namespace ksys::act {
|
||||
|
||||
class BaseProcJobHandler {
|
||||
public:
|
||||
explicit BaseProcJobHandler(BaseProc* proc);
|
||||
virtual ~BaseProcJobHandler() = default;
|
||||
virtual void invoke() = 0;
|
||||
virtual void invokeSpecial() {}
|
||||
|
||||
BaseProcJobLink& getLink() { return mLink; }
|
||||
const BaseProcJobLink& getLink() const { return mLink; }
|
||||
|
||||
protected:
|
||||
BaseProcJobLink mLink;
|
||||
};
|
||||
KSYS_CHECK_SIZE_NX150(BaseProcJobHandler, 0x30);
|
||||
|
||||
/// For binding actor member functions.
|
||||
template <typename T>
|
||||
class BaseProcJobHandlerT : public BaseProcJobHandler {
|
||||
public:
|
||||
BaseProcJobHandlerT(T* proc, void (T::*fn)()) : BaseProcJobHandler(proc), mDelegate(proc, fn) {}
|
||||
|
||||
void invoke() override { mDelegate.invoke(); }
|
||||
|
||||
private:
|
||||
sead::Delegate<T> mDelegate;
|
||||
};
|
||||
|
||||
/// For binding two actor member functions.
|
||||
template <typename T>
|
||||
class BaseProcJobHandlerDualT : public BaseProcJobHandler {
|
||||
public:
|
||||
BaseProcJobHandlerDualT(T* proc, void (T::*fn)(), void (T::*fn_special)())
|
||||
: BaseProcJobHandler(proc), mDelegate(proc, fn), mDelegateSpecial(proc, fn_special) {}
|
||||
|
||||
void invoke() override { mDelegate.invoke(); }
|
||||
void invokeSpecial() override { mDelegateSpecial.invoke(); }
|
||||
|
||||
private:
|
||||
sead::Delegate<T> mDelegate;
|
||||
sead::Delegate<T> mDelegateSpecial;
|
||||
};
|
||||
|
||||
} // namespace ksys::act
|
||||
@@ -3,10 +3,10 @@
|
||||
#include <prim/seadScopedLock.h>
|
||||
#include <thread/seadThread.h>
|
||||
#include "KingSystem/ActorSystem/actActorSystem.h"
|
||||
#include "KingSystem/ActorSystem/actBaseProc.h"
|
||||
#include "KingSystem/ActorSystem/actBaseProcDeleter.h"
|
||||
#include "KingSystem/ActorSystem/actBaseProcHeapMgr.h"
|
||||
#include "KingSystem/ActorSystem/actBaseProcInitializer.h"
|
||||
#include "KingSystem/ActorSystem/actBaseProcJobHandler.h"
|
||||
#include "KingSystem/ActorSystem/actBaseProcJobQue.h"
|
||||
#include "KingSystem/ActorSystem/actBaseProcLink.h"
|
||||
|
||||
|
||||
@@ -226,8 +226,6 @@ RailRoute::RailRoute() {
|
||||
mFlags.set(Flag::Walkable);
|
||||
}
|
||||
|
||||
RailRoute::~RailRoute() = default;
|
||||
|
||||
bool RailRoute::isRenderEnabled() const {
|
||||
return mFlags.isOn(Flag::RenderEnabled);
|
||||
}
|
||||
@@ -252,6 +250,8 @@ const char* RailRoute::getCheckPointName(s32 idx) const {
|
||||
return static_cast<RailRoutePoint*>(mRailPoints[idx])->mCheckPointName;
|
||||
}
|
||||
|
||||
RailRoute::~RailRoute() = default;
|
||||
|
||||
bool RailRoute::parse(MubinIter* iter) {
|
||||
int success = Rail::parse(iter);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user