Rearranged the SerialPacket and serialization code
The serialization code is now using macros to simplify each line, and to prevent errors. It should be noted that, apart from the region content, the serialization and deserialization code is essentially identical.
This commit is contained in:
@@ -27,10 +27,10 @@
|
||||
/* NOTE: Keep the PACKET_BUFFER_SIZE up to date
|
||||
* NOTE: REGION_CONTENT is currently the largest type of packet
|
||||
* map content: REGION_WIDTH * REGION_HEIGHT * REGION_DEPTH * sizoeof(region::type_t)
|
||||
* map format: sizeof(int) * 2
|
||||
* map format: sizeof(int) * 3
|
||||
* metadata: sizeof(metadata)
|
||||
*/
|
||||
#define PACKET_BUFFER_SIZE REGION_WIDTH * REGION_HEIGHT * REGION_DEPTH * sizeof(Region::type_t) + sizeof(int) * 2 + sizeof(SerialPacket::Metadata)
|
||||
#define PACKET_BUFFER_SIZE REGION_WIDTH * REGION_HEIGHT * REGION_DEPTH * sizeof(Region::type_t) + sizeof(int) * 3 + sizeof(SerialPacket::Metadata)
|
||||
|
||||
void serialize(SerialPacket* const, void*);
|
||||
void deserialize(SerialPacket* const, void*);
|
||||
|
||||
Reference in New Issue
Block a user