Fix ambiguous type deduction
This commit is contained in:
parent
fc51984f7f
commit
8bdd862262
@ -35,7 +35,10 @@ void VoxelGeneratorImage::set_image(Ref<Image> im) {
|
||||
return;
|
||||
}
|
||||
_image = im;
|
||||
Ref<Image> copy = im.is_valid() ? im->duplicate() : Ref<Image>();
|
||||
Ref<Image> copy;
|
||||
if (im.is_valid()) {
|
||||
copy = im->duplicate();
|
||||
}
|
||||
RWLockWrite wlock(_parameters_lock);
|
||||
// lock() prevents us from reading the same image from multiple threads, so we lock it up-front.
|
||||
// This might no longer be needed in Godot 4.
|
||||
|
@ -22,8 +22,12 @@ void VoxelGeneratorNoise2D::set_noise(Ref<OpenSimplexNoise> noise) {
|
||||
return;
|
||||
}
|
||||
_noise = noise;
|
||||
Ref<OpenSimplexNoise> copy;
|
||||
if (noise.is_valid()) {
|
||||
copy = noise->duplicate();
|
||||
}
|
||||
RWLockWrite wlock(_parameters_lock);
|
||||
_parameters.noise = _noise.is_valid() ? _noise->duplicate() : Ref<OpenSimplexNoise>();
|
||||
_parameters.noise = copy;
|
||||
}
|
||||
|
||||
Ref<OpenSimplexNoise> VoxelGeneratorNoise2D::get_noise() const {
|
||||
|
Loading…
x
Reference in New Issue
Block a user