Skip to content

Commit

Permalink
Make VoxelVoxLoader method static
Browse files Browse the repository at this point in the history
  • Loading branch information
Zylann committed Jun 9, 2024
1 parent 2cb6bc7 commit bb99835
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 2 deletions.
3 changes: 3 additions & 0 deletions doc/source/changelog.md
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,9 @@ Semver is not yet in place, so each version can have breaking changes, although
- Fixed slow loading when the database path contains `res:https://` or `user:https://`
- `VoxelInstancer`: Fixed instances with LOD > 0 were generated on `VoxelTerrain` even though LOD isn't supported (ending up in weird positions). No instances should generate.

- Breaking changes
- `VoxelVoxLoader`: methods are now static, so no instance of the class need to be created


1.2 - 20/04/2024 - branch `1.2` - tag `v1.2.0`
------------------------------------------------
Expand Down
3 changes: 2 additions & 1 deletion streams/vox/vox_loader.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,8 @@ int /*Error*/ VoxelVoxLoader::load_from_file(
}

void VoxelVoxLoader::_bind_methods() {
ClassDB::bind_method(
ClassDB::bind_static_method(
VoxelVoxLoader::get_class_static(),
D_METHOD("load_from_file", "fpath", "voxels", "palette", "dst_channel"),
&VoxelVoxLoader::load_from_file,
DEFVAL(godot::VoxelBuffer::CHANNEL_COLOR)
Expand Down
2 changes: 1 addition & 1 deletion streams/vox/vox_loader.h
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ class VoxelVoxLoader : public RefCounted {

public:
// TODO GDX: Can't bind functions returning a `godot::Error` enum
int /*Error*/ load_from_file(
static int /*Error*/ load_from_file(
String fpath,
Ref<godot::VoxelBuffer> p_voxels,
Ref<VoxelColorPalette> palette,
Expand Down

0 comments on commit bb99835

Please sign in to comment.