mirror of
https://github.com/Relintai/godot_voxel.git
synced 2024-11-19 02:47:18 +01:00
Code formatting
This commit is contained in:
parent
d6bb354bd9
commit
c837ca4dd0
1
voxel.h
1
voxel.h
@ -13,6 +13,7 @@ class Voxel : public Resource {
|
||||
GDCLASS(Voxel, Resource)
|
||||
|
||||
public:
|
||||
// TODO Conflicts with VoxelBuffer::ChannelId, we need to have only one enum
|
||||
enum ChannelMode {
|
||||
// For mapping to a Voxel type
|
||||
CHANNEL_TYPE = 0,
|
||||
|
@ -28,7 +28,7 @@ public:
|
||||
|
||||
// TODO Quantification options
|
||||
// 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_F16_Q128S // -128..128 float stored in 16 bits
|
||||
// };
|
||||
|
@ -170,7 +170,11 @@ void VoxelMap::get_buffer_copy(Vector3i min_pos, VoxelBuffer &dst_buffer, unsign
|
||||
VoxelBuffer &src_buffer = **block->voxels;
|
||||
Vector3i offset = block_to_voxel(bpos);
|
||||
// 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 {
|
||||
Vector3i offset = block_to_voxel(bpos);
|
||||
|
@ -89,8 +89,9 @@ void VoxelMeshUpdater::push(const Input &input) {
|
||||
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)));
|
||||
}
|
||||
|
||||
if (should_run) {
|
||||
_semaphore->post();
|
||||
@ -167,8 +168,9 @@ void VoxelMeshUpdater::thread_func() {
|
||||
}
|
||||
}
|
||||
|
||||
if (_thread_exit)
|
||||
if (_thread_exit) {
|
||||
break;
|
||||
}
|
||||
|
||||
// Wait for future wake-up
|
||||
_semaphore->wait();
|
||||
|
Loading…
Reference in New Issue
Block a user