summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--scene/2d/audio_stream_player_2d.cpp4
-rw-r--r--scene/3d/audio_stream_player_3d.cpp4
-rw-r--r--scene/audio/audio_stream_player.cpp4
-rw-r--r--scene/main/viewport.cpp2
4 files changed, 10 insertions, 4 deletions
diff --git a/scene/2d/audio_stream_player_2d.cpp b/scene/2d/audio_stream_player_2d.cpp
index 18a50ae098..f73d52152e 100644
--- a/scene/2d/audio_stream_player_2d.cpp
+++ b/scene/2d/audio_stream_player_2d.cpp
@@ -78,7 +78,6 @@ void AudioStreamPlayer2D::_notification(int p_what) {
Vector<Ref<AudioStreamPlayback>> playbacks_to_remove;
for (Ref<AudioStreamPlayback> &playback : stream_playbacks) {
if (playback.is_valid() && !AudioServer::get_singleton()->is_playback_active(playback) && !AudioServer::get_singleton()->is_playback_paused(playback)) {
- emit_signal(SNAME("finished"));
playbacks_to_remove.push_back(playback);
}
}
@@ -91,6 +90,9 @@ void AudioStreamPlayer2D::_notification(int p_what) {
active.clear();
set_physics_process_internal(false);
}
+ if (!playbacks_to_remove.is_empty()) {
+ emit_signal(SNAME("finished"));
+ }
}
while (stream_playbacks.size() > max_polyphony) {
diff --git a/scene/3d/audio_stream_player_3d.cpp b/scene/3d/audio_stream_player_3d.cpp
index 261acbeeb9..b5e4eac5d5 100644
--- a/scene/3d/audio_stream_player_3d.cpp
+++ b/scene/3d/audio_stream_player_3d.cpp
@@ -292,7 +292,6 @@ void AudioStreamPlayer3D::_notification(int p_what) {
Vector<Ref<AudioStreamPlayback>> playbacks_to_remove;
for (Ref<AudioStreamPlayback> &playback : stream_playbacks) {
if (playback.is_valid() && !AudioServer::get_singleton()->is_playback_active(playback) && !AudioServer::get_singleton()->is_playback_paused(playback)) {
- emit_signal(SNAME("finished"));
playbacks_to_remove.push_back(playback);
}
}
@@ -305,6 +304,9 @@ void AudioStreamPlayer3D::_notification(int p_what) {
active.clear();
set_physics_process_internal(false);
}
+ if (!playbacks_to_remove.is_empty()) {
+ emit_signal(SNAME("finished"));
+ }
}
while (stream_playbacks.size() > max_polyphony) {
diff --git a/scene/audio/audio_stream_player.cpp b/scene/audio/audio_stream_player.cpp
index 5065f21604..43c4ce4c82 100644
--- a/scene/audio/audio_stream_player.cpp
+++ b/scene/audio/audio_stream_player.cpp
@@ -45,7 +45,6 @@ void AudioStreamPlayer::_notification(int p_what) {
Vector<Ref<AudioStreamPlayback>> playbacks_to_remove;
for (Ref<AudioStreamPlayback> &playback : stream_playbacks) {
if (playback.is_valid() && !AudioServer::get_singleton()->is_playback_active(playback) && !AudioServer::get_singleton()->is_playback_paused(playback)) {
- emit_signal(SNAME("finished"));
playbacks_to_remove.push_back(playback);
}
}
@@ -58,6 +57,9 @@ void AudioStreamPlayer::_notification(int p_what) {
active.clear();
set_process_internal(false);
}
+ if (!playbacks_to_remove.is_empty()) {
+ emit_signal(SNAME("finished"));
+ }
}
if (p_what == NOTIFICATION_EXIT_TREE) {
diff --git a/scene/main/viewport.cpp b/scene/main/viewport.cpp
index 5f8e66e337..6388b375d9 100644
--- a/scene/main/viewport.cpp
+++ b/scene/main/viewport.cpp
@@ -3860,7 +3860,7 @@ void SubViewport::_bind_methods() {
ADD_PROPERTY(PropertyInfo(Variant::BOOL, "size_2d_override_stretch"), "set_size_2d_override_stretch", "is_size_2d_override_stretch_enabled");
ADD_GROUP("Render Target", "render_target_");
ADD_PROPERTY(PropertyInfo(Variant::INT, "render_target_clear_mode", PROPERTY_HINT_ENUM, "Always,Never,Next Frame"), "set_clear_mode", "get_clear_mode");
- ADD_PROPERTY(PropertyInfo(Variant::INT, "render_target_update_mode", PROPERTY_HINT_ENUM, "Disabled,Once,When Visible,Always"), "set_update_mode", "get_update_mode");
+ ADD_PROPERTY(PropertyInfo(Variant::INT, "render_target_update_mode", PROPERTY_HINT_ENUM, "Disabled,Once,When Visible,When Parent Visible,Always"), "set_update_mode", "get_update_mode");
BIND_ENUM_CONSTANT(CLEAR_MODE_ALWAYS);
BIND_ENUM_CONSTANT(CLEAR_MODE_NEVER);