packets: Make bools take up 1 byte

This commit is contained in:
Nick Renieris 2022-06-28 13:26:26 +03:00
parent 951844e428
commit 0e9fde9289
5 changed files with 7 additions and 5 deletions

View file

@ -5,7 +5,7 @@
struct PACKED GameInf : Packet { struct PACKED GameInf : Packet {
GameInf() : Packet() {this->mType = PacketType::GAMEINF; mPacketSize = sizeof(GameInf) - sizeof(Packet);}; GameInf() : Packet() {this->mType = PacketType::GAMEINF; mPacketSize = sizeof(GameInf) - sizeof(Packet);};
bool4 is2D = false; bool1 is2D = false;
u8 scenarioNo = -1; u8 scenarioNo = -1;
char stageName[0x40] = {}; char stageName[0x40] = {};

View file

@ -6,6 +6,6 @@ struct PACKED HackCapInf : Packet {
HackCapInf() : Packet() {this->mType = PacketType::HACKCAPINF; mPacketSize = sizeof(HackCapInf) - sizeof(Packet);}; HackCapInf() : Packet() {this->mType = PacketType::HACKCAPINF; mPacketSize = sizeof(HackCapInf) - sizeof(Packet);};
sead::Vector3f capPos; sead::Vector3f capPos;
sead::Quatf capQuat; sead::Quatf capQuat;
bool4 isCapVisible = false; bool1 isCapVisible = false;
char capAnim[PACKBUFSIZE] = {}; char capAnim[PACKBUFSIZE] = {};
}; };

View file

@ -5,5 +5,5 @@
struct PACKED ShineCollect : Packet { struct PACKED ShineCollect : Packet {
ShineCollect() : Packet() {this->mType = PacketType::SHINECOLL; mPacketSize = sizeof(ShineCollect) - sizeof(Packet);}; ShineCollect() : Packet() {this->mType = PacketType::SHINECOLL; mPacketSize = sizeof(ShineCollect) - sizeof(Packet);};
int shineId = -1; int shineId = -1;
bool4 isGrand = false; bool1 isGrand = false;
}; };

View file

@ -11,7 +11,7 @@ enum TagUpdateType : u8 {
struct PACKED TagInf : Packet { struct PACKED TagInf : Packet {
TagInf() : Packet() { this->mType = PacketType::TAGINF; mPacketSize = sizeof(TagInf) - sizeof(Packet);}; TagInf() : Packet() { this->mType = PacketType::TAGINF; mPacketSize = sizeof(TagInf) - sizeof(Packet);};
TagUpdateType updateType; TagUpdateType updateType;
bool4 isIt = false; bool1 isIt = false;
u8 seconds; u8 seconds;
u16 minutes; u16 minutes;
}; };

View file

@ -18,7 +18,9 @@ typedef signed int s32;
typedef int64_t s64; typedef int64_t s64;
typedef __int128_t s128; typedef __int128_t s128;
typedef u32 bool4; // guaranteed to be 4 bytes, 'bool' is impl. defined // bool size is implementation defined, so use these where it's important
typedef u8 bool1;
typedef u32 bool4;
typedef float f32; typedef float f32;
typedef double f64; typedef double f64;