Solid data is moving from the server to the client, read more
The APIs have access to the solid data, and I fixed a bug: Basically, the template parameter for std::bitset expects an integer representing the number of bits to hold, but I initially misread it as the number of bytes. This has been corrected. I've also added a sandy beach to the generated island. I'm tempted to start working on some simple generators soon.
This commit is contained in:
@@ -40,7 +40,7 @@ void serializeRegionContent(RegionPacket* packet, void* buffer) {
|
||||
SERIALIZE(buffer, &packet->x, sizeof(int));
|
||||
SERIALIZE(buffer, &packet->y, sizeof(int));
|
||||
|
||||
//content
|
||||
//tiles
|
||||
for (register int i = 0; i < REGION_WIDTH; i++) {
|
||||
for (register int j = 0; j < REGION_HEIGHT; j++) {
|
||||
for (register int k = 0; k < REGION_DEPTH; k++) {
|
||||
@@ -50,7 +50,8 @@ void serializeRegionContent(RegionPacket* packet, void* buffer) {
|
||||
}
|
||||
}
|
||||
|
||||
//TODO: serialize collision map
|
||||
//solids
|
||||
SERIALIZE(buffer, packet->region->GetSolidBitset(), REGION_SOLID_FOOTPRINT);
|
||||
}
|
||||
|
||||
void deserializeRegionFormat(RegionPacket* packet, void* buffer) {
|
||||
@@ -73,7 +74,7 @@ void deserializeRegionContent(RegionPacket* packet, void* buffer) {
|
||||
//an object to work on
|
||||
packet->region = new Region(packet->x, packet->y);
|
||||
|
||||
//content
|
||||
//tiles
|
||||
for (register int i = 0; i < REGION_WIDTH; i++) {
|
||||
for (register int j = 0; j < REGION_HEIGHT; j++) {
|
||||
for (register int k = 0; k < REGION_DEPTH; k++) {
|
||||
@@ -83,5 +84,6 @@ void deserializeRegionContent(RegionPacket* packet, void* buffer) {
|
||||
}
|
||||
}
|
||||
|
||||
//TODO: deserialize collision map
|
||||
//solids
|
||||
DESERIALIZE(buffer, packet->region->GetSolidBitset(), REGION_SOLID_FOOTPRINT);
|
||||
}
|
||||
Reference in New Issue
Block a user