mirror of https://github.com/zeldaret/botw.git
ksys/util: Make TaskMgr task type checks optional
They are not always done.
This commit is contained in:
parent
69c78356b3
commit
b90017bf3b
|
@ -42,8 +42,8 @@ public:
|
||||||
void init(s32 num_tasks, sead::Heap* heap, ManagedTaskFactory& factory);
|
void init(s32 num_tasks, sead::Heap* heap, ManagedTaskFactory& factory);
|
||||||
|
|
||||||
template <typename TaskType>
|
template <typename TaskType>
|
||||||
void init(s32 num_tasks, sead::Heap* heap) {
|
void init(s32 num_tasks, sead::Heap* heap, bool check_task_type = false) {
|
||||||
initImpl_<TaskType>(num_tasks, heap);
|
initImpl_<TaskType>(num_tasks, heap, check_task_type);
|
||||||
}
|
}
|
||||||
|
|
||||||
void finalize();
|
void finalize();
|
||||||
|
@ -87,11 +87,11 @@ protected:
|
||||||
}
|
}
|
||||||
|
|
||||||
template <typename TaskType>
|
template <typename TaskType>
|
||||||
void initImpl_(s32 num_tasks, sead::Heap* heap) {
|
void initImpl_(s32 num_tasks, sead::Heap* heap, bool check_task_type) {
|
||||||
sead::Delegate1<TaskMgr, ManagedTask**> factory{this, &TaskMgr::makeTaskType_<TaskType>};
|
sead::Delegate1<TaskMgr, ManagedTask**> factory{this, &TaskMgr::makeTaskType_<TaskType>};
|
||||||
init(num_tasks, heap, factory);
|
init(num_tasks, heap, factory);
|
||||||
|
|
||||||
if (hasTasks()) {
|
if (check_task_type && hasTasks()) {
|
||||||
Task* task = nullptr;
|
Task* task = nullptr;
|
||||||
if (mFreeTaskLists[0].size() >= 1)
|
if (mFreeTaskLists[0].size() >= 1)
|
||||||
task = mFreeTaskLists[0].front();
|
task = mFreeTaskLists[0].front();
|
||||||
|
|
Loading…
Reference in New Issue