diff options
Diffstat (limited to 'scene/3d')
-rw-r--r-- | scene/3d/audio_stream_player_3d.cpp | 10 | ||||
-rw-r--r-- | scene/3d/collision_shape.cpp | 2 | ||||
-rw-r--r-- | scene/3d/collision_shape.h | 2 | ||||
-rw-r--r-- | scene/3d/gi_probe.cpp | 4 | ||||
-rw-r--r-- | scene/3d/immediate_geometry.h | 2 | ||||
-rw-r--r-- | scene/3d/remote_transform.cpp | 3 |
6 files changed, 13 insertions, 10 deletions
diff --git a/scene/3d/audio_stream_player_3d.cpp b/scene/3d/audio_stream_player_3d.cpp index 6efdf25f0d..a69bec2fc8 100644 --- a/scene/3d/audio_stream_player_3d.cpp +++ b/scene/3d/audio_stream_player_3d.cpp @@ -183,7 +183,7 @@ void AudioStreamPlayer3D::_mix_audio() { float AudioStreamPlayer3D::_get_attenuation_db(float p_distance) const { - float att; + float att = 0; switch (attenuation_model) { case ATTENUATION_INVERSE_DISTANCE: { att = Math::linear2db(1.0 / ((p_distance / unit_size) + 000001)); @@ -196,6 +196,10 @@ float AudioStreamPlayer3D::_get_attenuation_db(float p_distance) const { case ATTENUATION_LOGARITHMIC: { att = -20 * Math::log(p_distance / unit_size + 000001); } break; + default: { + ERR_PRINT("Unknown attenuation type"); + break; + } } att += unit_db; @@ -555,12 +559,12 @@ void AudioStreamPlayer3D::set_stream(Ref<AudioStream> p_stream) { stream = p_stream; stream_playback = p_stream->instance_playback(); + AudioServer::get_singleton()->unlock(); + if (stream_playback.is_null()) { stream.unref(); ERR_FAIL_COND(stream_playback.is_null()); } - - AudioServer::get_singleton()->unlock(); } Ref<AudioStream> AudioStreamPlayer3D::get_stream() const { diff --git a/scene/3d/collision_shape.cpp b/scene/3d/collision_shape.cpp index 4d4ed30d03..5f1151f8e9 100644 --- a/scene/3d/collision_shape.cpp +++ b/scene/3d/collision_shape.cpp @@ -1,5 +1,5 @@ /*************************************************************************/ -/* body_shape.cpp */ +/* collision_shape.cpp */ /*************************************************************************/ /* This file is part of: */ /* GODOT ENGINE */ diff --git a/scene/3d/collision_shape.h b/scene/3d/collision_shape.h index 6d849f42af..94621177cb 100644 --- a/scene/3d/collision_shape.h +++ b/scene/3d/collision_shape.h @@ -1,5 +1,5 @@ /*************************************************************************/ -/* body_shape.h */ +/* collision_shape.h */ /*************************************************************************/ /* This file is part of: */ /* GODOT ENGINE */ diff --git a/scene/3d/gi_probe.cpp b/scene/3d/gi_probe.cpp index 0232ce7653..bb54a43028 100644 --- a/scene/3d/gi_probe.cpp +++ b/scene/3d/gi_probe.cpp @@ -548,8 +548,8 @@ void GIProbe::_plot_face(int p_idx, int p_level, int p_x, int p_y, int p_z, cons //plot the face by guessing it's albedo and emission value //find best axis to map to, for scanning values - int closest_axis; - float closest_dot; + int closest_axis = 0; + float closest_dot = 0; Plane plane = Plane(p_vtx[0], p_vtx[1], p_vtx[2]); Vector3 normal = plane.normal; diff --git a/scene/3d/immediate_geometry.h b/scene/3d/immediate_geometry.h index b2bcb5af1a..6db825bf54 100644 --- a/scene/3d/immediate_geometry.h +++ b/scene/3d/immediate_geometry.h @@ -1,5 +1,5 @@ /*************************************************************************/ -/* immediate_geometry.h */ +/* immediate_geometry.h */ /*************************************************************************/ /* This file is part of: */ /* GODOT ENGINE */ diff --git a/scene/3d/remote_transform.cpp b/scene/3d/remote_transform.cpp index 3d402fa5af..8faf985b11 100644 --- a/scene/3d/remote_transform.cpp +++ b/scene/3d/remote_transform.cpp @@ -1,6 +1,5 @@ - /*************************************************************************/ -/* remote_transform.cpp */ +/* remote_transform.cpp */ /*************************************************************************/ /* This file is part of: */ /* GODOT ENGINE */ |