Code formatting

This commit is contained in:
Marc Gilleron 2019-04-28 01:34:00 +01:00
parent d6bb354bd9
commit c837ca4dd0
4 changed files with 11 additions and 4 deletions

View File

@ -13,6 +13,7 @@ class Voxel : public Resource {
GDCLASS(Voxel, Resource) GDCLASS(Voxel, Resource)
public: public:
// TODO Conflicts with VoxelBuffer::ChannelId, we need to have only one enum
enum ChannelMode { enum ChannelMode {
// For mapping to a Voxel type // For mapping to a Voxel type
CHANNEL_TYPE = 0, CHANNEL_TYPE = 0,

View File

@ -28,7 +28,7 @@ public:
// TODO Quantification options // TODO Quantification options
// enum ChannelFormat { // enum ChannelFormat {
// FORMAT_I8_Q255U, // 0..255 integer // FORMAT_I8_Q256U, // 0..255 integer
// FORMAT_F8_Q1S, // -1..1 float stored in 8 bits // FORMAT_F8_Q1S, // -1..1 float stored in 8 bits
// FORMAT_F16_Q128S // -128..128 float stored in 16 bits // FORMAT_F16_Q128S // -128..128 float stored in 16 bits
// }; // };

View File

@ -170,7 +170,11 @@ void VoxelMap::get_buffer_copy(Vector3i min_pos, VoxelBuffer &dst_buffer, unsign
VoxelBuffer &src_buffer = **block->voxels; VoxelBuffer &src_buffer = **block->voxels;
Vector3i offset = block_to_voxel(bpos); Vector3i offset = block_to_voxel(bpos);
// Note: copy_from takes care of clamping the area if it's on an edge // Note: copy_from takes care of clamping the area if it's on an edge
dst_buffer.copy_from(src_buffer, min_pos - offset, max_pos - offset, offset - min_pos, channel); dst_buffer.copy_from(src_buffer,
min_pos - offset,
max_pos - offset,
offset - min_pos,
channel);
} else { } else {
Vector3i offset = block_to_voxel(bpos); Vector3i offset = block_to_voxel(bpos);

View File

@ -89,8 +89,9 @@ void VoxelMeshUpdater::push(const Input &input) {
should_run = !_shared_input.is_empty(); should_run = !_shared_input.is_empty();
} }
if (replaced_blocks > 0) if (replaced_blocks > 0) {
print_line(String("VoxelMeshUpdater: {0} blocks already in queue were replaced").format(varray(replaced_blocks))); print_line(String("VoxelMeshUpdater: {0} blocks already in queue were replaced").format(varray(replaced_blocks)));
}
if (should_run) { if (should_run) {
_semaphore->post(); _semaphore->post();
@ -167,8 +168,9 @@ void VoxelMeshUpdater::thread_func() {
} }
} }
if (_thread_exit) if (_thread_exit) {
break; break;
}
// Wait for future wake-up // Wait for future wake-up
_semaphore->wait(); _semaphore->wait();