diff options
author | mrb0nk500 <b0nk@b0nk.xyz> | 2023-02-03 13:40:49 -0400 |
---|---|---|
committer | mrb0nk500 <b0nk@b0nk.xyz> | 2023-02-03 13:40:49 -0400 |
commit | 5937b25df15a233a32da19083a54140741ef6d56 (patch) | |
tree | e2478b6aac0c3479f86c28ffaecca845d6f75722 | |
parent | a68704403ab88657d4abaad25f673bf40267931a (diff) |
TMainTask: Add, and match `run_task()`
-rw-r--r-- | include/pso/TMainTask.h | 1 | ||||
-rw-r--r-- | src/pso/TMainTask.cpp | 24 |
2 files changed, 25 insertions, 0 deletions
diff --git a/include/pso/TMainTask.h b/include/pso/TMainTask.h index 6a4944d..8e7243a 100644 --- a/include/pso/TMainTask.h +++ b/include/pso/TMainTask.h @@ -13,6 +13,7 @@ public: public: TMainTask(); virtual ~TMainTask(); + virtual void run_task(); private: void set_task_flags(u32 flags) { this->task_flags |= flags; diff --git a/src/pso/TMainTask.cpp b/src/pso/TMainTask.cpp index 88216e5..c0a6f88 100644 --- a/src/pso/TMainTask.cpp +++ b/src/pso/TMainTask.cpp @@ -1,6 +1,30 @@ #include "pso/TMainTask.h" #include "pso/TObject.h" +u32 some_main_task_flag = 1; +u32 main_task_flags; +u32 old_main_task_flags; + +void TMainTask::run_task() { + if (main_task_flags != old_main_task_flags) { + TMainTask *child; + u32 bit = 1; + FOREACH_NODE_NODECL_MULTI_ITER(TMainTask, main_task.down, child, bit <<= 1) { + if (main_task_flags & bit) { + child->set_flag_3(); + } else { + child->clear_flag_3(); + } + } + old_main_task_flags = main_task_flags; + } + some_main_task_flag = 0; + set_task_flags(1); + run_tasks(); + clear_task_flags(1); + set_task_flags(0x80); +} + TMainTask::~TMainTask() { this->delete_children(); } |