summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authormrb0nk500 <b0nk@b0nk.xyz>2023-02-08 13:13:04 -0400
committermrb0nk500 <b0nk@b0nk.xyz>2023-02-08 13:13:04 -0400
commit21778cb0c7a64e0712bbfcadb5993965f70d4b49 (patch)
treee237800f4e87d73bef0307b3dd017b54e4dddf5c /src
parentf251a13351647a754431fb049ca8046f2a4df868 (diff)
TObject: Add, and make use of `enum object_flags`
Diffstat (limited to 'src')
-rw-r--r--src/pso/TObject.cpp28
-rw-r--r--src/pso/TObject2.cpp16
2 files changed, 22 insertions, 22 deletions
diff --git a/src/pso/TObject.cpp b/src/pso/TObject.cpp
index 753b952..f8a643d 100644
--- a/src/pso/TObject.cpp
+++ b/src/pso/TObject.cpp
@@ -19,7 +19,7 @@ void debug_print(const char *fmt) {
}
bool TObject::toggle_flag_9_if_flag_10_is_clear() {
- if (get_flags(0x400)) {
+ if (get_flags(BIT_10)) {
return false;
}
if (!get_flag_9()) {
@@ -42,7 +42,7 @@ void *TObject::alloc(unsigned long size) {
bool TObject::is_flag_0_clear_for_all_parents() {
for (TObject *parent = this; parent != NULL; parent = parent->up) {
- if (parent->get_flags(1)) {
+ if (parent->get_flags(QUEUE_DESTRUCTION)) {
return false;
}
}
@@ -90,7 +90,7 @@ void TObject::empty_func() {
void TObject::render_nodes2() {
FOREACH_NODE(TObject, this->down, child) {
- if (child->get_flags(0x200)) {
+ if (child->get_flags(BIT_9)) {
child->render();
child->clear_flag_9();
}
@@ -100,7 +100,7 @@ void TObject::render_nodes2() {
void TObject::render_shadows_for_each_node() {
FOREACH_NODE(TObject, this->down, child) {
- if (!child->get_flags(0x100)) {
+ if (!child->get_flags(BIT_8)) {
child->render_shadows();
child->render_shadows_for_each_node();
}
@@ -109,7 +109,7 @@ void TObject::render_shadows_for_each_node() {
void TObject::render_nodes() {
FOREACH_NODE(TObject, this->down, child) {
- if (!child->get_flags(0x10)) {
+ if (!child->get_flags(DISALLOW_RENDER)) {
child->render();
child->render_nodes();
}
@@ -122,22 +122,22 @@ void TObject::run_tasks() {
while (this->down != NULL && child != NULL) {
TObject *node = child;
child = child->next;
- if (node->get_flags(0x0f)) {
+ if (node->get_flags(DISALLOW_UPDATE)) {
// Clearing flag 0 in the if statement is required to match.
- if (node->get_flags(1) && (node->clear_flags(1), !node->get_flags(0x20))) {
+ if (node->get_flags(QUEUE_DESTRUCTION) && (node->clear_flags(QUEUE_DESTRUCTION), !node->get_flags(DISALLOW_DESTRUCTION))) {
delete node;
} else {
- if (node->get_flags(2)) {
+ if (node->get_flags(CHILD_QUEUE_DESTRUCTION)) {
node->delete_children();
node->run_task();
- node->clear_flags(2);
+ node->clear_flags(CHILD_QUEUE_DESTRUCTION);
}
- if (!node->get_flags(4)) {
+ if (!node->get_flags(BIT_2)) {
// Adding this here somehow causes the
// dead code to be compiled.
// `volatile` typecast is required to match.
- (vu16)node->get_flags(1);
+ (vu16)node->get_flags(QUEUE_DESTRUCTION);
}
}
} else {
@@ -159,15 +159,15 @@ void TObject::delete_children() {
}
TObject::~TObject() {
- if (!get_flags(0x20)) {
- set_flags(0x20);
+ if (!get_flags(DISALLOW_DESTRUCTION)) {
+ set_flags(DISALLOW_DESTRUCTION);
_delete_children();
remove_parent();
}
}
TObject::TObject(TObject *parent) {
- flags = 0;
+ flags = NONE;
up = parent;
down = NULL;
name = TObject_name;
diff --git a/src/pso/TObject2.cpp b/src/pso/TObject2.cpp
index 60eec0b..ede8c53 100644
--- a/src/pso/TObject2.cpp
+++ b/src/pso/TObject2.cpp
@@ -1,33 +1,33 @@
#include "pso/TObject.h"
void TObject::clear_flag_9() {
- clear_flags(0x200);
+ clear_flags(BIT_9);
}
void TObject::set_flag_9() {
- set_flags(0x200);
+ set_flags(BIT_9);
}
u32 TObject::get_flag_9() {
- return get_flags(0x200);
+ return get_flags(BIT_9);
}
void TObject::set_flag_0() {
- set_flags(1);
+ set_flags(QUEUE_DESTRUCTION);
}
void TObject::clear_flag_3() {
- clear_flags(8);
+ clear_flags(BIT_3);
}
void TObject::set_flag_3() {
- set_flags(8);
+ set_flags(BIT_3);
}
void TObject::clear_flag_4() {
- clear_flags(0x10);
+ clear_flags(DISALLOW_RENDER);
}
void TObject::set_flag_4() {
- set_flags(0x10);
+ set_flags(DISALLOW_RENDER);
}