From 09c901655db3bb42d2aac4b506846b18833d777c Mon Sep 17 00:00:00 2001 From: mrb0nk500 Date: Tue, 7 Mar 2023 15:23:51 -0400 Subject: global: Completly disable inlining This is because it looks more, and more clear that the entire codebase was compiled without inlining. Likely to reduce code size from all the byteswap functions, only present on the GameCube version. --- include/pso/TMenuList.h | 135 ++++++++++++++---------------------------------- 1 file changed, 40 insertions(+), 95 deletions(-) (limited to 'include/pso/TMenuList.h') diff --git a/include/pso/TMenuList.h b/include/pso/TMenuList.h index af71a87..d065622 100644 --- a/include/pso/TMenuList.h +++ b/include/pso/TMenuList.h @@ -10,120 +10,65 @@ template class TMenuListEntry : public TPlyGuildCardTag { - public: - T entry; - +public: TMenuListEntry() : TPlyGuildCardTag() {}; - void bswap(); - void assign(const TMenuListEntry &src); - - TMenuListEntry &operator=(const TMenuListEntry &src) { - _assign(src); - return *this; + void bswap() { + TPlyGuildCardTag::bswap(); + entry.bswap(); }; - - private: - void _assign(const TMenuListEntry &src); +public: + T entry; } __packed__; template class TMenuList { - public: +public: + void bswap() { + header.bswap(); + if (num_pad_entries) { + for (int i = 0; i < num_pad_entries; i++) { + pad_entries[i].bswap(); + } + } + if (num_entries) { + for (int i = 0; i < num_entries; i++) { + entries[i].bswap(); + } + } + }; +public: packet_header header; - TArray, num_pad_entries> pad_entries; - TArray, num_entries> entries; - - void bswap(); - TMenuList &assign(const TMenuList &src); + TMenuListEntry pad_entries[num_pad_entries]; + TMenuListEntry entries[num_entries]; } __packed__; template class TMenuList { - public: +public: + void bswap() { + header.bswap(); + for (int i = 0; i < num_entries; i++) { + entries[i].bswap(); + } + }; +public: packet_header header; - TArray, num_entries> entries; - - void bswap(); - TMenuList &assign(const TMenuList &src); + TMenuListEntry entries[num_entries]; } __packed__; template class TMenuList { - public: - packet_header header; - TArray, num_pad_entries> pad_entries; - - void bswap(); - TMenuList &assign(const TMenuList &src); -} __packed__; - - -template -void TMenuList::bswap() { - header.bswap(); - for (int i = 0; i < num_entries; i++) { - entries[i].bswap(); - } -} - -template -void TMenuList::bswap() { - header.bswap(); - for (int i = 0; i < num_pad_entries; i++) { - pad_entries[i].bswap(); - } -} - -template -void TMenuList::bswap() { - header.bswap(); - if (num_pad_entries) { +public: + void bswap() { + header.bswap(); for (int i = 0; i < num_pad_entries; i++) { pad_entries[i].bswap(); } - } - if (num_entries) { - for (int i = 0; i < num_entries; i++) { - entries[i].bswap(); - } - } -} - -template -void TMenuListEntry::bswap() { - TPlyGuildCardTag::bswap(); - entry.bswap(); -} - -template -TMenuList &TMenuList::assign(const TMenuList &src) { - *this = src; - return *this; -} - -template -TMenuList &TMenuList::assign(const TMenuList &src) { - *this = src; - return *this; -} - -template -TMenuList &TMenuList::assign(const TMenuList &src) { - *this = src; - return *this; -} - -template -void TMenuListEntry::_assign(const TMenuListEntry &src) { - TPlyGuildCardTag::assign(src); - entry = src.entry; -} - -template -void TMenuListEntry::assign(const TMenuListEntry &src) { - TPlyGuildCardTag::operator=(src); - entry = src.entry; -} + }; +public: + packet_header header; + TMenuListEntry pad_entries[num_pad_entries]; +} __packed__; #endif -- cgit v1.2.3-13-gbd6f