diff options
author | mrb0nk500 <b0nk@b0nk.xyz> | 2023-02-03 17:28:10 -0400 |
---|---|---|
committer | mrb0nk500 <b0nk@b0nk.xyz> | 2023-02-03 17:28:10 -0400 |
commit | 96254c41f8fc023501014d36295839fcacb4be10 (patch) | |
tree | 675eb708a57dd6b8b5cc7e7c1a663f7b1651fce4 /include | |
parent | 9263a77c9b4ab9ae0e7e32d1358a6f80185fb328 (diff) |
TMainTask: Add `SET_OR_CLEAR_CHILD_FLAGS` macro
Diffstat (limited to 'include')
-rw-r--r-- | include/pso/TMainTask.h | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/include/pso/TMainTask.h b/include/pso/TMainTask.h index 8e7243a..34c2d6c 100644 --- a/include/pso/TMainTask.h +++ b/include/pso/TMainTask.h @@ -5,6 +5,20 @@ #include "pso/macros.h" #include "pso/TObject.h" +#define SET_OR_CLEAR_CHILD_FLAGS(flags, old_flags, flag_bit) \ + if (flags != old_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_##flag_bit(); \ + } else { \ + child->clear_flag_##flag_bit(); \ + } \ + } \ + old_flags = flags; \ + } + class TMainTask : public TObject { public: u32 task_flags; |