From 9634309c46742c13cbd198b223fe5301dab53632 Mon Sep 17 00:00:00 2001 From: mrb0nk500 Date: Fri, 3 Mar 2023 14:59:27 -0400 Subject: TMenuList, TPlyGuildCardTag: Add constructors --- context.h | 5 +++++ include/pso/TMenuList.h | 2 ++ include/pso/TPlyGuildCardTag.h | 3 +++ src/pso/TPlyGuildCardTag.cpp | 9 +++++++++ 4 files changed, 19 insertions(+) diff --git a/context.h b/context.h index 2539293..76183b7 100644 --- a/context.h +++ b/context.h @@ -333,6 +333,8 @@ class TMenuListEntry : public TPlyGuildCardTag { public: T entry; + TMenuListEntry() : TPlyGuildCardTag() {}; + void bswap(); void assign(const TMenuListEntry &src); @@ -623,6 +625,9 @@ static inline void operator|=(object_flags &a, object_flags b) { a = a | b; }; class TPlyGuildCardTag { public: + TPlyGuildCardTag(); + TPlyGuildCardTag(u16 tag2, u32 guildcard_number); + void bswap(); void assign(const TPlyGuildCardTag &src); void assign(const TPlyGuildCardTag *src); diff --git a/include/pso/TMenuList.h b/include/pso/TMenuList.h index 54ca441..af71a87 100644 --- a/include/pso/TMenuList.h +++ b/include/pso/TMenuList.h @@ -13,6 +13,8 @@ class TMenuListEntry : public TPlyGuildCardTag { public: T entry; + TMenuListEntry() : TPlyGuildCardTag() {}; + void bswap(); void assign(const TMenuListEntry &src); diff --git a/include/pso/TPlyGuildCardTag.h b/include/pso/TPlyGuildCardTag.h index 815685d..5808e56 100644 --- a/include/pso/TPlyGuildCardTag.h +++ b/include/pso/TPlyGuildCardTag.h @@ -13,6 +13,9 @@ struct gc_tag { class TPlyGuildCardTag { public: + TPlyGuildCardTag(); + TPlyGuildCardTag(u16 tag2, u32 guildcard_number); + void bswap(); void assign(const TPlyGuildCardTag &src); void assign(const TPlyGuildCardTag *src); diff --git a/src/pso/TPlyGuildCardTag.cpp b/src/pso/TPlyGuildCardTag.cpp index d1341c5..2626adc 100644 --- a/src/pso/TPlyGuildCardTag.cpp +++ b/src/pso/TPlyGuildCardTag.cpp @@ -2,6 +2,15 @@ #include "pso/protocol.h" #include +TPlyGuildCardTag::TPlyGuildCardTag() {} + +TPlyGuildCardTag::TPlyGuildCardTag(u16 tag2, u32 guildcard_number) { + m_tag.tag0 = 0; + m_tag.tag1 = 0; + m_tag.tag2 = tag2; + m_guildcard_number = guildcard_number; +} + void TPlyGuildCardTag::bswap() { bswap_32(&m_guildcard_number); bswap_16(&m_tag.tag2); -- cgit v1.2.3-13-gbd6f