summaryrefslogtreecommitdiff
path: root/include/pso/TMenuList.h
diff options
context:
space:
mode:
authormrb0nk500 <b0nk@b0nk.xyz>2023-03-09 18:09:14 -0400
committermrb0nk500 <b0nk@b0nk.xyz>2023-03-09 18:09:14 -0400
commitdacfbade1476d79bf7484b8817592d61ba62ee2f (patch)
treeebf296e1e152fcfc09aeab9488f0d57e2b6211e7 /include/pso/TMenuList.h
parentb80218a8c1fafb174e3f05c0b51c61005531bf05 (diff)
TProtocol: Start adding, and matching more command handlers
Also found out alot more assumptions I had were wrong.
Diffstat (limited to 'include/pso/TMenuList.h')
-rw-r--r--include/pso/TMenuList.h28
1 files changed, 14 insertions, 14 deletions
diff --git a/include/pso/TMenuList.h b/include/pso/TMenuList.h
index 3a38a66..90a7423 100644
--- a/include/pso/TMenuList.h
+++ b/include/pso/TMenuList.h
@@ -7,18 +7,16 @@
#include "pso/TPlyGuildCardTag.h"
#include <global_types.h>
-template <typename T>
-class TMenuListEntry : public TPlyGuildCardTag {
-public:
- TMenuListEntry() : TPlyGuildCardTag() {};
-
- void bswap() {
- TPlyGuildCardTag::bswap();
- entry.bswap();
- };
-public:
- T entry;
-} __packed__;
+#define TMenuListEntry(name, members) \
+class name { \
+public: \
+ void bswap() { \
+ tag.bswap(); \
+ }; \
+public: \
+ TPlyGuildCardTag tag; \
+ members \
+} __packed__
template <typename T, int num_entries, int num_pad_entries>
class TMenuList {
@@ -38,10 +36,11 @@ public:
};
public:
packet_header header;
- TMenuListEntry<T> pad_entries[num_pad_entries];
- TMenuListEntry<T> entries[num_entries];
+ T pad_entries[num_pad_entries];
+ T entries[num_entries];
} __packed__;
+#ifdef __MWCC__
template <typename T, int num_entries>
class TMenuList<T, num_entries, 0> {
public:
@@ -69,5 +68,6 @@ public:
packet_header header;
TMenuListEntry<T> pad_entries[num_pad_entries];
} __packed__;
+#endif
#endif