diff options
Diffstat (limited to 'include/pso/TPlyDispData.h')
-rw-r--r-- | include/pso/TPlyDispData.h | 96 |
1 files changed, 64 insertions, 32 deletions
diff --git a/include/pso/TPlyDispData.h b/include/pso/TPlyDispData.h index 679e329..daca8d9 100644 --- a/include/pso/TPlyDispData.h +++ b/include/pso/TPlyDispData.h @@ -7,9 +7,14 @@ #include <pso/TMath.h> #include <pso/TPlyGuildCardTag.h> +#define bswap16(var) bswap_16(as(u16 *, var)) +#define bswap32(var) bswap_32(as(u32 *, var)) + +#define bswap16_ref(var) bswap16(&var) +#define bswap32_ref(var) bswap32(&var) + struct stats { void bswap(); - stats &assign(const stats &src); short atp; short mst; @@ -21,8 +26,21 @@ struct stats { }; struct player_stats { - void bswap(); - player_stats &assign(const player_stats &src); + void bswap() { + bswap16(&stats.atp); + bswap16(&stats.mst); + bswap16(&stats.evp); + bswap16(&stats.hp); + bswap16(&stats.dfp); + bswap16(&stats.ata); + bswap16(&stats.lck); + bswap16(&mbr_0xe); + bswap32(&proportions); + bswap32(&mbr_0x14); + bswap32(&level); + bswap32(&exp); + bswap32(&meseta); + }; struct stats stats; short mbr_0xe; @@ -34,8 +52,21 @@ struct player_stats { }; struct disp_data_part2 { - void bswap(); - disp_data_part2 &assign(const disp_data_part2 &src); + void bswap() { + bswap_32(&name_colour); + bswap_32(&name_colour_checksum); + bswap_32(&v1_flags); + for (int i = 0; i < 8; ++i) { + bswap_16(&appearance_data[i]); + } + + bswap32(&proportions.x); + bswap32(&proportions.y); + }; + bool is_valid() { + // TODO: Actually decompile it. + return false; + }; char name[16]; u32 smth[2]; @@ -48,43 +79,45 @@ struct disp_data_part2 { u8 v2_flags; u8 version; u32 v1_flags; - u16 costume; - u16 skin; - u16 face; - u16 head; - u16 hair; - u16 hair_r; - u16 hair_g; - u16 hair_b; + union { + struct { + u16 costume; + u16 skin; + u16 face; + u16 head; + u16 hair; + u16 hair_r; + u16 hair_g; + u16 hair_b; + } appearance; + u16 appearance_data[8]; + }; vec2f proportions; }; -class TPlyDispConfigSmthTag { -public: - //TPlyDispConfigSmthTag(); - //~TPlyDispConfigSmthTag(); - - void bswap(); - TPlyDispConfigSmthTag &assign(const TPlyDispConfigSmthTag &src); -public: - gc_tag m_tag; -}; - class TPlyDispConfigSmth { public: - void bswap(); - TPlyDispConfigSmth &assign(const TPlyDispConfigSmth &src); + TPlyDispConfigSmth() { m_mbr_0x0 = 0; }; + void bswap() { + bswap_32(&m_mbr_0x0); + for (int i = 0; i < 4; ++i) { + m_tags[i].bswap(); + m_tags1[i].bswap(); + } + }; public: u32 m_mbr_0x0; - TPlyDispConfigSmthTag m_tags[4]; - TPlyDispConfigSmthTag m_tags1[4]; + gc_tag m_tags[4]; + gc_tag m_tags1[4]; }; class TPlyDispConfig { public: - void bswap(); - TPlyDispConfig &assign(const TPlyDispConfig &src); -private: + void bswap() { + m_smth.bswap(); + m_smth1.bswap(); + }; +public: TPlyDispConfigSmth m_smth; TPlyDispConfigSmth m_smth1; }; @@ -92,7 +125,6 @@ private: class TPlyDispData { public: void bswap(); - TPlyDispData &assign(const TPlyDispData &src); public: player_stats m_stats; disp_data_part2 m_disp_part2; |