summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--context.h25
-rw-r--r--include/pso/TMainTask.h4
-rw-r--r--include/pso/TObject.h21
-rw-r--r--include/pso/macros.h8
-rw-r--r--src/pso/TMainTask.cpp4
5 files changed, 12 insertions, 50 deletions
diff --git a/context.h b/context.h
index f4a4a17..95824e4 100644
--- a/context.h
+++ b/context.h
@@ -147,7 +147,7 @@ typedef long ptrdiff_t;
if (flags != old_flags) { \
TMainTask *child; \
u32 bit = 1; \
- FOREACH_NODE_NODECL_MULTI_ITER(TMainTask, main_task.down(), child, bit <<= 1) { \
+ FOREACH_NODE_NODECL_MULTI_ITER(TMainTask, main_task.m_down, child, bit <<= 1) { \
if (flags & bit) { \
child->one_prefix##_##suffix(); \
} else { \
@@ -1029,9 +1029,8 @@ private:
};
-protected:
+public:
const char *m_name;
-private:
union {
object_flags m_flags;
u16 m_flags_u16;
@@ -1060,24 +1059,6 @@ public:
void *operator new (size_t size) { return alloc(size); };
void operator delete(void *ptr) { free(ptr); };
- const char *name() { return m_name; };
- object_flags flags() { return m_flags; };
- u16 flags_u16() { return m_flags_u16; };
- u16 id() { return m_id; };
- TObject *prev() { return m_prev; };
- TObject *next() { return m_next; };
- TObject *up() { return m_up; };
- TObject *down() { return m_down; };
-
- void set_name(const char *name) { m_name = name; };
- void set_obj_flags(object_flags flags) { m_flags = flags; };
- void set_flags_u16(u16 flags) { m_flags_u16 = flags; };
- void set_id(u16 id) { m_id = id; };
- void set_prev(TObject *node) { m_prev = node; };
- void set_next(TObject *node) { m_next = node; };
- void set_up(TObject *node) { m_up = node; };
- void set_down(TObject *node) { m_down = node; };
-
void delete_children();
void queue_destruction_for_each_node();
void run_tasks();
@@ -1202,7 +1183,7 @@ public:
};
// pso/TMainTask.h
-class TMainTask : public TObject {
+class TMainTask : private TObject {
public:
u32 task_flags;
u32 mbr_0x20;
diff --git a/include/pso/TMainTask.h b/include/pso/TMainTask.h
index b97192b..b73d69d 100644
--- a/include/pso/TMainTask.h
+++ b/include/pso/TMainTask.h
@@ -10,7 +10,7 @@
if (flags != old_flags) { \
TMainTask *child; \
u32 bit = 1; \
- FOREACH_NODE_NODECL_MULTI_ITER(TMainTask, main_task.down(), child, bit <<= 1) { \
+ FOREACH_NODE_NODECL_MULTI_ITER(TMainTask, main_task.m_down, child, bit <<= 1) { \
if (flags & bit) { \
child->one_prefix##_##suffix(); \
} else { \
@@ -34,7 +34,7 @@ TL_OBJECTS
TL_OBJECTS
#undef o
-class TMainTask : public TObject {
+class TMainTask : private TObject {
public:
u32 task_flags;
u32 mbr_0x20;
diff --git a/include/pso/TObject.h b/include/pso/TObject.h
index ef2cf66..1478871 100644
--- a/include/pso/TObject.h
+++ b/include/pso/TObject.h
@@ -110,9 +110,8 @@ private:
};
-protected:
+public:
const char *m_name;
-private:
union {
object_flags m_flags;
u16 m_flags_u16;
@@ -141,24 +140,6 @@ public:
void *operator new (size_t size) { return alloc(size); };
void operator delete(void *ptr) { free(ptr); };
- const char *name() { return m_name; };
- object_flags flags() { return m_flags; };
- u16 flags_u16() { return m_flags_u16; };
- u16 id() { return m_id; };
- TObject *prev() { return m_prev; };
- TObject *next() { return m_next; };
- TObject *up() { return m_up; };
- TObject *down() { return m_down; };
-
- void set_name(const char *name) { m_name = name; };
- void set_obj_flags(object_flags flags) { m_flags = flags; };
- void set_flags_u16(u16 flags) { m_flags_u16 = flags; };
- void set_id(u16 id) { m_id = id; };
- void set_prev(TObject *node) { m_prev = node; };
- void set_next(TObject *node) { m_next = node; };
- void set_up(TObject *node) { m_up = node; };
- void set_down(TObject *node) { m_down = node; };
-
void delete_children();
void queue_destruction_for_each_node();
void run_tasks();
diff --git a/include/pso/macros.h b/include/pso/macros.h
index 5901143..291a550 100644
--- a/include/pso/macros.h
+++ b/include/pso/macros.h
@@ -51,11 +51,11 @@
o(tl_fade, TL_FADE) \
o(tl_fadeafter, TL_FADEAFTER)
-#define FOREACH_NODE(type, first, varname) for (type *varname = (type *)(first); varname != NULL; varname = (type *)(varname->next()))
-#define FOREACH_NODE_NODECL(type, first, varname) for (varname = (type *)(first); varname != NULL; varname = (type *)(varname->next()))
+#define FOREACH_NODE(type, first, varname) for (type *varname = (type *)(first); varname != NULL; varname = (type *)(varname->m_next))
+#define FOREACH_NODE_NODECL(type, first, varname) for (varname = (type *)(first); varname != NULL; varname = (type *)(varname->m_next))
-#define FOREACH_NODE_MULTI_ITER(type, first, varname, ...) for (type *varname = (type *)(first); varname != NULL; varname = (type *)(varname->next()), __VA_ARGS__)
-#define FOREACH_NODE_NODECL_MULTI_ITER(type, first, varname, ...) for (varname = (type *)(first); varname != NULL; varname = (type *)(varname->next()), __VA_ARGS__)
+#define FOREACH_NODE_MULTI_ITER(type, first, varname, ...) for (type *varname = (type *)(first); varname != NULL; varname = (type *)(varname->m_next), __VA_ARGS__)
+#define FOREACH_NODE_NODECL_MULTI_ITER(type, first, varname, ...) for (varname = (type *)(first); varname != NULL; varname = (type *)(varname->m_next), __VA_ARGS__)
#define __packed__
#define WEAK_FUNC __declspec(weak)
diff --git a/src/pso/TMainTask.cpp b/src/pso/TMainTask.cpp
index 931a3ce..0458c3e 100644
--- a/src/pso/TMainTask.cpp
+++ b/src/pso/TMainTask.cpp
@@ -377,13 +377,13 @@ void TMainTask::init_main_task() {
alt_heap = new THeap(0x17000, 16);
#define o(var, dummy) \
var = new TObject(this); \
- var->set_name(var##_name);
+ var->m_name = var##_name;
TL_OBJECTS
#undef o
}
TMainTask::TMainTask() : TObject(NULL) {
- set_name(TMainTask_name);
+ m_name = TMainTask_name;
task_flags = 0;
mbr_0x20 = 0;
mbr_0x24 = 0;