diff options
| author | untodesu <kirill@untode.su> | 2025-06-25 00:44:36 +0500 |
|---|---|---|
| committer | untodesu <kirill@untode.su> | 2025-06-25 00:44:36 +0500 |
| commit | 88c01588aa0830e219eaa62588839e4d1e2883ce (patch) | |
| tree | 602bb27dd3399aab4aae8c19630e3b7a8dac824b /game/shared/voxel_storage.cc | |
| parent | 99cf6cca8dbbc1e563c10cf0167432d3d8af9783 (diff) | |
| download | voxelius-88c01588aa0830e219eaa62588839e4d1e2883ce.tar.bz2 voxelius-88c01588aa0830e219eaa62588839e4d1e2883ce.zip | |
Clang-format the entire source code
Diffstat (limited to 'game/shared/voxel_storage.cc')
| -rw-r--r-- | game/shared/voxel_storage.cc | 11 |
1 files changed, 7 insertions, 4 deletions
diff --git a/game/shared/voxel_storage.cc b/game/shared/voxel_storage.cc index eb51347..f2c4d42 100644 --- a/game/shared/voxel_storage.cc +++ b/game/shared/voxel_storage.cc @@ -1,9 +1,10 @@ #include "shared/pch.hh" + #include "shared/voxel_storage.hh" #include "core/buffer.hh" -void VoxelStorage::serialize(WriteBuffer &buffer) const +void VoxelStorage::serialize(WriteBuffer& buffer) const { auto bound = mz_compressBound(sizeof(VoxelStorage)); auto zdata = std::vector<unsigned char>(bound); @@ -22,17 +23,19 @@ void VoxelStorage::serialize(WriteBuffer &buffer) const buffer.write_UI64(bound); // Write all the compressed data into the buffer - for(std::size_t i = 0; i < bound; buffer.write_UI8(zdata[i++])); + for(std::size_t i = 0; i < bound; buffer.write_UI8(zdata[i++])) + ; } -void VoxelStorage::deserialize(ReadBuffer &buffer) +void VoxelStorage::deserialize(ReadBuffer& buffer) { auto size = static_cast<mz_ulong>(sizeof(VoxelStorage)); auto bound = static_cast<mz_ulong>(buffer.read_UI64()); auto zdata = std::vector<unsigned char>(bound); // Read all the compressed data from the buffer - for(std::size_t i = 0; i < bound; zdata[i++] = buffer.read_UI8()); + for(std::size_t i = 0; i < bound; zdata[i++] = buffer.read_UI8()) + ; mz_uncompress(reinterpret_cast<unsigned char*>(data()), &size, zdata.data(), bound); |
