Fix VoxelStreamBlockFiles always showing a warning about channels

This commit is contained in:
Marc Gilleron 2021-09-18 01:44:33 +01:00
parent 6a6682dfd5
commit f0c59acf0b
3 changed files with 8 additions and 1 deletions

View File

@ -44,6 +44,7 @@ Ongoing development - `master`
- `VoxelInstancer`: fixed no instances generated when density is 1 in vertex emission mode
- `VoxelTerrain`: fixed materials shown under the wrong inspector category
- `VoxelStreamRegionFiles`: fixed errors caused by meta file being sometimes written with wrong depth values
- `VoxelStreamBlockFiles`: fixed warning about channels always shown in the scene tree
- Fix some crashes occurring when all PoolVector allocs are in use (Godot 3.x limitation), it will print errors instead

View File

@ -26,7 +26,6 @@ VoxelStreamBlockFiles::VoxelStreamBlockFiles() {
VoxelStream::Result VoxelStreamBlockFiles::emerge_block(
Ref<VoxelBuffer> out_buffer, Vector3i origin_in_voxels, int lod) {
ERR_FAIL_COND_V(out_buffer.is_null(), RESULT_ERROR);
if (_directory_path.empty()) {
@ -158,6 +157,11 @@ void VoxelStreamBlockFiles::immerge_block(Ref<VoxelBuffer> buffer, Vector3i orig
}
}
int VoxelStreamBlockFiles::get_used_channels_mask() const {
// Assuming all, since that stream can store anything.
return VoxelBuffer::ALL_CHANNELS_MASK;
}
String VoxelStreamBlockFiles::get_directory() const {
return _directory_path;
}

View File

@ -18,6 +18,8 @@ public:
Result emerge_block(Ref<VoxelBuffer> out_buffer, Vector3i origin_in_voxels, int lod) override;
void immerge_block(Ref<VoxelBuffer> buffer, Vector3i origin_in_voxels, int lod) override;
int get_used_channels_mask() const override;
String get_directory() const;
void set_directory(String dirpath);