summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--context.h122
-rw-r--r--include/pso/TObject.h122
2 files changed, 122 insertions, 122 deletions
diff --git a/context.h b/context.h
index 24a211d..8b00bac 100644
--- a/context.h
+++ b/context.h
@@ -193,6 +193,67 @@ public:
class TObject {
private:
+ void _delete_children() {
+ while (m_down != NULL) {
+ delete m_down;
+ }
+ };
+ void add_parent(TObject *parent, bool set_parent) {
+ if (set_parent) {
+ m_up = parent;
+ }
+ TObject *child;
+ if (parent == NULL) {
+ m_prev = this;
+ m_next = NULL;
+ return;
+ }
+ child = parent->m_down;
+ if (child != NULL) {
+ m_prev = child->m_next;
+ m_next = NULL;
+ child->m_prev->m_next = this;
+ child->m_prev = this;
+ } else {
+ m_prev = this;
+ parent->m_down = this;
+ m_next = NULL;
+ }
+ };
+ void remove_parent() {
+ if (m_up != NULL) {
+ if (m_prev == this) {
+ m_up->m_down = NULL;
+ } else if (m_up->m_down == this) {
+ m_up->m_down = m_next;
+ m_prev->m_next = NULL;
+ if (m_next != NULL) {
+ m_next->m_prev = m_prev;
+ }
+ } else {
+ m_prev->m_next = m_next;
+ if (m_next != NULL) {
+ m_next->m_prev = m_prev;
+ } else {
+ m_up->m_down->m_prev = m_prev;
+ }
+ }
+ }
+ };
+
+ void set_flags(object_flags flags) {
+ m_flags |= flags;
+ }
+
+ void clear_flags(object_flags flags) {
+ m_flags_u16 &= ~static_cast<u16>(flags);
+ }
+
+ u32 get_flags(object_flags flags) {
+ return m_flags & flags;
+ };
+
+
const char *m_name;
union {
object_flags m_flags;
@@ -259,67 +320,6 @@ public:
static void *alloc(size_t size);
static void free(void *ptr);
bool toggle_flag_9_if_flag_10_is_clear();
-
-private:
- void _delete_children() {
- while (m_down != NULL) {
- delete m_down;
- }
- };
- void add_parent(TObject *parent, bool set_parent) {
- if (set_parent) {
- m_up = parent;
- }
- TObject *child;
- if (parent == NULL) {
- m_prev = this;
- m_next = NULL;
- return;
- }
- child = parent->m_down;
- if (child != NULL) {
- m_prev = child->m_next;
- m_next = NULL;
- child->m_prev->m_next = this;
- child->m_prev = this;
- } else {
- m_prev = this;
- parent->m_down = this;
- m_next = NULL;
- }
- };
- void remove_parent() {
- if (m_up != NULL) {
- if (m_prev == this) {
- m_up->m_down = NULL;
- } else if (m_up->m_down == this) {
- m_up->m_down = m_next;
- m_prev->m_next = NULL;
- if (m_next != NULL) {
- m_next->m_prev = m_prev;
- }
- } else {
- m_prev->m_next = m_next;
- if (m_next != NULL) {
- m_next->m_prev = m_prev;
- } else {
- m_up->m_down->m_prev = m_prev;
- }
- }
- }
- };
-
- void set_flags(object_flags flags) {
- m_flags |= flags;
- }
-
- void clear_flags(object_flags flags) {
- m_flags_u16 &= ~static_cast<u16>(flags);
- }
-
- u32 get_flags(object_flags flags) {
- return m_flags & flags;
- };
};
class TMainTask : public TObject {
diff --git a/include/pso/TObject.h b/include/pso/TObject.h
index 797218c..f399d7b 100644
--- a/include/pso/TObject.h
+++ b/include/pso/TObject.h
@@ -45,6 +45,67 @@ static inline void operator|=(object_flags &a, object_flags b) { a = a | b; };
class TObject {
private:
+ void _delete_children() {
+ while (m_down != NULL) {
+ delete m_down;
+ }
+ };
+ void add_parent(TObject *parent, bool set_parent) {
+ if (set_parent) {
+ m_up = parent;
+ }
+ TObject *child;
+ if (parent == NULL) {
+ m_prev = this;
+ m_next = NULL;
+ return;
+ }
+ child = parent->m_down;
+ if (child != NULL) {
+ m_prev = child->m_next;
+ m_next = NULL;
+ child->m_prev->m_next = this;
+ child->m_prev = this;
+ } else {
+ m_prev = this;
+ parent->m_down = this;
+ m_next = NULL;
+ }
+ };
+ void remove_parent() {
+ if (m_up != NULL) {
+ if (m_prev == this) {
+ m_up->m_down = NULL;
+ } else if (m_up->m_down == this) {
+ m_up->m_down = m_next;
+ m_prev->m_next = NULL;
+ if (m_next != NULL) {
+ m_next->m_prev = m_prev;
+ }
+ } else {
+ m_prev->m_next = m_next;
+ if (m_next != NULL) {
+ m_next->m_prev = m_prev;
+ } else {
+ m_up->m_down->m_prev = m_prev;
+ }
+ }
+ }
+ };
+
+ void set_flags(object_flags flags) {
+ m_flags |= flags;
+ }
+
+ void clear_flags(object_flags flags) {
+ m_flags_u16 &= ~static_cast<u16>(flags);
+ }
+
+ u32 get_flags(object_flags flags) {
+ return m_flags & flags;
+ };
+
+
const char *m_name;
union {
object_flags m_flags;
@@ -111,67 +172,6 @@ public:
static void *alloc(size_t size);
static void free(void *ptr);
bool toggle_flag_9_if_flag_10_is_clear();
-
-private:
- void _delete_children() {
- while (m_down != NULL) {
- delete m_down;
- }
- };
- void add_parent(TObject *parent, bool set_parent) {
- if (set_parent) {
- m_up = parent;
- }
- TObject *child;
- if (parent == NULL) {
- m_prev = this;
- m_next = NULL;
- return;
- }
- child = parent->m_down;
- if (child != NULL) {
- m_prev = child->m_next;
- m_next = NULL;
- child->m_prev->m_next = this;
- child->m_prev = this;
- } else {
- m_prev = this;
- parent->m_down = this;
- m_next = NULL;
- }
- };
- void remove_parent() {
- if (m_up != NULL) {
- if (m_prev == this) {
- m_up->m_down = NULL;
- } else if (m_up->m_down == this) {
- m_up->m_down = m_next;
- m_prev->m_next = NULL;
- if (m_next != NULL) {
- m_next->m_prev = m_prev;
- }
- } else {
- m_prev->m_next = m_next;
- if (m_next != NULL) {
- m_next->m_prev = m_prev;
- } else {
- m_up->m_down->m_prev = m_prev;
- }
- }
- }
- };
-
- void set_flags(object_flags flags) {
- m_flags |= flags;
- }
-
- void clear_flags(object_flags flags) {
- m_flags_u16 &= ~static_cast<u16>(flags);
- }
-
- u32 get_flags(object_flags flags) {
- return m_flags & flags;
- };
};
#endif