mirror of https://github.com/zeldaret/botw.git
ksys: Add EventFlowBinder
This commit is contained in:
parent
1f628bb94a
commit
4014329dc2
|
@ -94501,9 +94501,9 @@
|
||||||
0x0000007101272f24,sub_7101272F24,100,
|
0x0000007101272f24,sub_7101272F24,100,
|
||||||
0x0000007101272f88,sub_7101272F88,52,
|
0x0000007101272f88,sub_7101272F88,52,
|
||||||
0x0000007101272fbc,sub_7101272FBC,52,
|
0x0000007101272fbc,sub_7101272FBC,52,
|
||||||
0x0000007101272ff0,evt::ActorBinder::init,64,
|
0x0000007101272ff0,evt::ActorBinder::init,64,_ZN4ksys3res20EventFlowActorBinder4bindEPN4evfl12ActorBindingEPKNS2_8ResActorE
|
||||||
0x0000007101273030,evt::ActorActionBinder::bind,56,
|
0x0000007101273030,evt::ActorActionBinder::bind,56,_ZN4ksys3res21EventFlowActionBinder4bindEPN4evfl12ActorBinding6ActionEPKNS2_9ResActionEPKNS2_8ResActorEPNS_3evt12ActorBindingE
|
||||||
0x0000007101273068,sub_7101273068,56,
|
0x0000007101273068,sub_7101273068,56,_ZN4ksys3res20EventFlowQueryBinder4bindEPN4evfl12ActorBinding5QueryEPKNS2_8ResQueryEPKNS2_8ResActorEPNS_3evt12ActorBindingE
|
||||||
0x00000071012730a0,EventMgrStruct1::ctor,312,
|
0x00000071012730a0,EventMgrStruct1::ctor,312,
|
||||||
0x00000071012731d8,sub_71012731D8,348,
|
0x00000071012731d8,sub_71012731D8,348,
|
||||||
0x0000007101273334,sub_7101273334,60,
|
0x0000007101273334,sub_7101273334,60,
|
||||||
|
|
Can't render this file because it is too large.
|
|
@ -1 +1 @@
|
||||||
Subproject commit e2978fa46508b16d12817d5ccc05455906a4b4e1
|
Subproject commit 18dcfd780faf1d5af5b089b92db5cfd329a306d6
|
|
@ -3,6 +3,8 @@ target_sources(uking PRIVATE
|
||||||
evtActorBinding.h
|
evtActorBinding.h
|
||||||
evtActorBindings.cpp
|
evtActorBindings.cpp
|
||||||
evtActorBindings.h
|
evtActorBindings.h
|
||||||
|
evtActorManager.cpp
|
||||||
|
evtActorManager.h
|
||||||
evtDemoInfo.cpp
|
evtDemoInfo.cpp
|
||||||
evtDemoInfo.h
|
evtDemoInfo.h
|
||||||
evtEvent.cpp
|
evtEvent.cpp
|
||||||
|
|
|
@ -0,0 +1 @@
|
||||||
|
#include "KingSystem/Event/evtActorManager.h"
|
|
@ -0,0 +1,18 @@
|
||||||
|
#pragma once
|
||||||
|
|
||||||
|
namespace evfl {
|
||||||
|
struct ActionArg;
|
||||||
|
class ActionDoneHandler;
|
||||||
|
struct QueryArg;
|
||||||
|
} // namespace evfl
|
||||||
|
|
||||||
|
namespace ksys::evt {
|
||||||
|
|
||||||
|
// TODO
|
||||||
|
class ActorManager {
|
||||||
|
public:
|
||||||
|
static void actionHandler(const evfl::ActionArg& arg, evfl::ActionDoneHandler handler);
|
||||||
|
static int queryHandler(const evfl::QueryArg& arg);
|
||||||
|
};
|
||||||
|
|
||||||
|
} // namespace ksys::evt
|
|
@ -194,6 +194,8 @@ target_sources(uking PRIVATE
|
||||||
Actor/resResourceUMii.cpp
|
Actor/resResourceUMii.cpp
|
||||||
Actor/resResourceUMii.h
|
Actor/resResourceUMii.h
|
||||||
|
|
||||||
|
Event/resEventFlowBinder.cpp
|
||||||
|
Event/resEventFlowBinder.h
|
||||||
Event/resDemoASLoader.cpp
|
Event/resDemoASLoader.cpp
|
||||||
Event/resDemoASLoader.h
|
Event/resDemoASLoader.h
|
||||||
Event/resResourceDemo.cpp
|
Event/resResourceDemo.cpp
|
||||||
|
|
|
@ -0,0 +1,37 @@
|
||||||
|
#include "KingSystem/Resource/Event/resEventFlowBinder.h"
|
||||||
|
#include "KingSystem/Event/evtActorBinding.h"
|
||||||
|
#include "KingSystem/Event/evtActorBindings.h"
|
||||||
|
#include "KingSystem/Event/evtActorManager.h"
|
||||||
|
|
||||||
|
namespace ksys::res {
|
||||||
|
|
||||||
|
void EventFlowActorBinder::bind(evfl::ActorBinding* evfl_binding,
|
||||||
|
const evfl::ResActor* evfl_actor) {
|
||||||
|
auto* binding = mBindings->bindActor(evfl_actor, mHeap);
|
||||||
|
if (binding) {
|
||||||
|
evfl_binding->SetUserData(binding);
|
||||||
|
evfl_binding->SetInitialized(true);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
void EventFlowActionBinder::bind(evfl::ActorBinding::Action* evfl_binding,
|
||||||
|
const evfl::ResAction* evfl_action,
|
||||||
|
const evfl::ResActor* evfl_actor, evt::ActorBinding* binding) {
|
||||||
|
if (binding)
|
||||||
|
binding->bindAction(evfl_action);
|
||||||
|
|
||||||
|
evfl_binding->handler = evt::ActorManager::actionHandler;
|
||||||
|
evfl_binding->user_data = nullptr;
|
||||||
|
}
|
||||||
|
|
||||||
|
void EventFlowQueryBinder::bind(evfl::ActorBinding::Query* evfl_binding,
|
||||||
|
const evfl::ResQuery* evfl_query, const evfl::ResActor* evfl_actor,
|
||||||
|
evt::ActorBinding* binding) {
|
||||||
|
if (binding)
|
||||||
|
binding->bindQuery(evfl_query);
|
||||||
|
|
||||||
|
evfl_binding->handler = evt::ActorManager::queryHandler;
|
||||||
|
evfl_binding->user_data = nullptr;
|
||||||
|
}
|
||||||
|
|
||||||
|
} // namespace ksys::res
|
|
@ -0,0 +1,44 @@
|
||||||
|
#pragma once
|
||||||
|
|
||||||
|
#include <evfl/ResActor.h>
|
||||||
|
|
||||||
|
namespace sead {
|
||||||
|
class Heap;
|
||||||
|
}
|
||||||
|
|
||||||
|
namespace ksys::evt {
|
||||||
|
class ActorBinding;
|
||||||
|
class ActorBindings;
|
||||||
|
} // namespace ksys::evt
|
||||||
|
|
||||||
|
namespace ksys::res {
|
||||||
|
|
||||||
|
class EventFlowBinder {
|
||||||
|
public:
|
||||||
|
EventFlowBinder(evt::ActorBindings* bindings, sead::Heap* heap)
|
||||||
|
: mBindings(bindings), mHeap(heap) {}
|
||||||
|
virtual ~EventFlowBinder() = default;
|
||||||
|
|
||||||
|
protected:
|
||||||
|
evt::ActorBindings* mBindings;
|
||||||
|
sead::Heap* mHeap;
|
||||||
|
};
|
||||||
|
|
||||||
|
class EventFlowActorBinder : public EventFlowBinder {
|
||||||
|
public:
|
||||||
|
void bind(evfl::ActorBinding* evfl_binding, const evfl::ResActor* evfl_actor);
|
||||||
|
};
|
||||||
|
|
||||||
|
class EventFlowActionBinder : public EventFlowBinder {
|
||||||
|
public:
|
||||||
|
void bind(evfl::ActorBinding::Action* evfl_binding, const evfl::ResAction* evfl_action,
|
||||||
|
const evfl::ResActor* evfl_actor, evt::ActorBinding* binding);
|
||||||
|
};
|
||||||
|
|
||||||
|
class EventFlowQueryBinder : public EventFlowBinder {
|
||||||
|
public:
|
||||||
|
void bind(evfl::ActorBinding::Query* evfl_binding, const evfl::ResQuery* evfl_query,
|
||||||
|
const evfl::ResActor* evfl_actor, evt::ActorBinding* binding);
|
||||||
|
};
|
||||||
|
|
||||||
|
} // namespace ksys::res
|
Loading…
Reference in New Issue