You've already forked godot
mirror of
https://github.com/godotengine/godot.git
synced 2025-11-06 12:20:30 +00:00
Prevent crash on startup if no audio server
This commit is contained in:
@@ -822,8 +822,10 @@ Rect2 Viewport::get_visible_rect() const {
|
|||||||
}
|
}
|
||||||
|
|
||||||
void Viewport::_update_listener_2d() {
|
void Viewport::_update_listener_2d() {
|
||||||
|
if (AudioServer::get_singleton()) {
|
||||||
AudioServer::get_singleton()->notify_listener_changed();
|
AudioServer::get_singleton()->notify_listener_changed();
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
void Viewport::set_as_audio_listener_2d(bool p_enable) {
|
void Viewport::set_as_audio_listener_2d(bool p_enable) {
|
||||||
if (p_enable == audio_listener_2d) {
|
if (p_enable == audio_listener_2d) {
|
||||||
@@ -3075,8 +3077,10 @@ bool Viewport::is_audio_listener_3d() const {
|
|||||||
}
|
}
|
||||||
|
|
||||||
void Viewport::_update_listener_3d() {
|
void Viewport::_update_listener_3d() {
|
||||||
|
if (AudioServer::get_singleton()) {
|
||||||
AudioServer::get_singleton()->notify_listener_changed();
|
AudioServer::get_singleton()->notify_listener_changed();
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
void Viewport::_listener_transform_3d_changed_notify() {
|
void Viewport::_listener_transform_3d_changed_notify() {
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user