summaryrefslogtreecommitdiff
path: root/src/pso/TObject.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/pso/TObject.cpp')
-rw-r--r--src/pso/TObject.cpp32
1 files changed, 17 insertions, 15 deletions
diff --git a/src/pso/TObject.cpp b/src/pso/TObject.cpp
index ed56035..c832ebe 100644
--- a/src/pso/TObject.cpp
+++ b/src/pso/TObject.cpp
@@ -1,7 +1,8 @@
+#define TOBJECT_CPP
+
#include "pso/THeap.h"
#include "pso/TMainTask.h"
#include "pso/TObject.h"
-#define MATCHING
TMainTask main_task;
TObject global_obj1;
@@ -20,7 +21,7 @@ void debug_print(const char *fmt) {
}
bool TObject::toggle_flag_9_if_flag_10_is_clear() {
- if (get_flags(BIT_10)) {
+ if (m_flags & BIT_10) {
return false;
}
if (!get_flag_9()) {
@@ -40,10 +41,9 @@ void *TObject::operator new(size_t size) {
return obj_heap->heap_alloc(size);
}
-
int TObject::all_parents_unqueued_for_destruction() {
for (TObject *parent = this; parent != NULL; parent = parent->m_up) {
- if (parent->get_flags(QUEUE_DESTRUCTION)) {
+ if (parent->m_flags & QUEUE_DESTRUCTION) {
return false;
}
}
@@ -91,7 +91,7 @@ void TObject::empty_func() {
void TObject::render_nodes2() {
FOREACH_NODE(TObject, this->m_down, child) {
- if (child->get_flags(BIT_9)) {
+ if (child->m_flags & BIT_9) {
child->render();
child->clear_flag_9();
}
@@ -101,7 +101,7 @@ void TObject::render_nodes2() {
void TObject::render_shadows_for_each_node() {
FOREACH_NODE(TObject, this->m_down, child) {
- if (!child->get_flags(DISALLOW_RENDER_SHADOWS)) {
+ if (!(child->m_flags & DISALLOW_RENDER_SHADOWS)) {
child->render_shadows();
child->render_shadows_for_each_node();
}
@@ -110,7 +110,7 @@ void TObject::render_shadows_for_each_node() {
void TObject::render_nodes() {
FOREACH_NODE(TObject, this->m_down, child) {
- if (!child->get_flags(DISALLOW_RENDER)) {
+ if (!(child->m_flags & DISALLOW_RENDER)) {
child->render();
child->render_nodes();
}
@@ -123,22 +123,22 @@ void TObject::run_tasks() {
while (this->m_down != NULL && child != NULL) {
TObject *node = child;
child = child->m_next;
- if (node->get_flags(DISALLOW_UPDATE)) {
+ if (node->m_flags & DISALLOW_UPDATE) {
// Clearing flag 0 in the if statement is required to match.
- if (node->get_flags(QUEUE_DESTRUCTION) && (node->clear_flags(QUEUE_DESTRUCTION), !node->get_flags(DISALLOW_DESTRUCTION))) {
+ if (node->m_flags & QUEUE_DESTRUCTION && (node->m_flags &= ~QUEUE_DESTRUCTION, !(node->m_flags & DISALLOW_DESTRUCTION))) {
delete node;
} else {
- if (node->get_flags(CHILD_QUEUE_DESTRUCTION)) {
+ if (node->m_flags & CHILD_QUEUE_DESTRUCTION) {
node->delete_children();
node->run_task();
- node->clear_flags(CHILD_QUEUE_DESTRUCTION);
+ node->m_flags &= ~CHILD_QUEUE_DESTRUCTION;
}
- if (!node->get_flags(BIT_2)) {
+ if (!(node->m_flags & BIT_2)) {
// Adding this here somehow causes the
// dead code to be compiled.
// `volatile` typecast is required to match.
- (vu16)node->get_flags(QUEUE_DESTRUCTION);
+ (vu16)node->m_flags & QUEUE_DESTRUCTION;
}
}
} else {
@@ -160,8 +160,8 @@ void TObject::delete_children() {
}
TObject::~TObject() {
- if (!get_flags(DISALLOW_DESTRUCTION)) {
- set_flags(DISALLOW_DESTRUCTION);
+ if (!(m_flags & DISALLOW_DESTRUCTION)) {
+ m_flags |= DISALLOW_DESTRUCTION;
_delete_children();
remove_parent();
}
@@ -174,3 +174,5 @@ TObject::TObject(TObject *parent) {
m_name = TObject_name;
add_parent(parent, false);
}
+
+#undef TOBJECT_CPP