Skip to content

Commit

Permalink
Formatting
Browse files Browse the repository at this point in the history
  • Loading branch information
Zylann committed Jun 9, 2024
1 parent d585a14 commit 2cb6bc7
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 6 deletions.
15 changes: 11 additions & 4 deletions streams/vox/vox_loader.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,12 @@

namespace zylann::voxel {

int /*Error*/ VoxelVoxLoader::load_from_file(String fpath, Ref<godot::VoxelBuffer> p_voxels,
Ref<VoxelColorPalette> palette, godot::VoxelBuffer::ChannelId dst_channel) {
int /*Error*/ VoxelVoxLoader::load_from_file(
String fpath,
Ref<godot::VoxelBuffer> p_voxels,
Ref<VoxelColorPalette> palette,
godot::VoxelBuffer::ChannelId dst_channel
) {
ZN_DSTACK();
ERR_FAIL_INDEX_V(dst_channel, godot::VoxelBuffer::MAX_CHANNELS, ERR_INVALID_PARAMETER);
ERR_FAIL_COND_V(p_voxels.is_null(), ERR_INVALID_PARAMETER);
Expand Down Expand Up @@ -76,8 +80,11 @@ int /*Error*/ VoxelVoxLoader::load_from_file(String fpath, Ref<godot::VoxelBuffe
}

void VoxelVoxLoader::_bind_methods() {
ClassDB::bind_method(D_METHOD("load_from_file", "fpath", "voxels", "palette", "dst_channel"),
&VoxelVoxLoader::load_from_file, DEFVAL(godot::VoxelBuffer::CHANNEL_COLOR));
ClassDB::bind_method(
D_METHOD("load_from_file", "fpath", "voxels", "palette", "dst_channel"),
&VoxelVoxLoader::load_from_file,
DEFVAL(godot::VoxelBuffer::CHANNEL_COLOR)
);
}

} // namespace zylann::voxel
8 changes: 6 additions & 2 deletions streams/vox/vox_loader.h
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,12 @@ class VoxelVoxLoader : public RefCounted {

public:
// TODO GDX: Can't bind functions returning a `godot::Error` enum
int /*Error*/ load_from_file(String fpath, Ref<godot::VoxelBuffer> p_voxels, Ref<VoxelColorPalette> palette,
godot::VoxelBuffer::ChannelId dst_channel);
int /*Error*/ load_from_file(
String fpath,
Ref<godot::VoxelBuffer> p_voxels,
Ref<VoxelColorPalette> palette,
godot::VoxelBuffer::ChannelId dst_channel
);
// TODO Have chunked loading for better memory usage
// TODO Saving

Expand Down

0 comments on commit 2cb6bc7

Please sign in to comment.