diff options
| author | Juan Linietsky | 2015-05-04 13:24:02 -0300 |
|---|---|---|
| committer | Juan Linietsky | 2015-05-04 13:24:02 -0300 |
| commit | fbbe7dcdfbd09fc6ef5614dea2183481a27e4f4e (patch) | |
| tree | 4e783f0e4347a2f612e6b85398c83a492d7b090f /platform/x11/os_x11.cpp | |
| parent | 7f5b744b92256e42aa3c700ee88d8318732935c6 (diff) | |
| parent | 6f8bd899311d459b9e391b4acf72ccfa5cc1d806 (diff) | |
| download | godot-fbbe7dcdfbd09fc6ef5614dea2183481a27e4f4e.tar.gz godot-fbbe7dcdfbd09fc6ef5614dea2183481a27e4f4e.tar.zst godot-fbbe7dcdfbd09fc6ef5614dea2183481a27e4f4e.zip | |
Merge remote-tracking branch 'origin/master'
Conflicts:
drivers/windows/dir_access_windows.cpp
Diffstat (limited to 'platform/x11/os_x11.cpp')
| -rw-r--r-- | platform/x11/os_x11.cpp | 21 |
1 files changed, 19 insertions, 2 deletions
diff --git a/platform/x11/os_x11.cpp b/platform/x11/os_x11.cpp index 92b0abff3..67ec33f3a 100644 --- a/platform/x11/os_x11.cpp +++ b/platform/x11/os_x11.cpp @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2014 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2015 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ @@ -258,9 +258,26 @@ void OS_X11::initialize(const VideoMode& p_desired,int p_video_driver,int p_audi AudioDriverManagerSW::get_driver(p_audio_driver)->set_singleton(); + audio_driver_index=p_audio_driver; if (AudioDriverManagerSW::get_driver(p_audio_driver)->init()!=OK) { - ERR_PRINT("Initializing audio failed."); + bool success=false; + audio_driver_index=-1; + for(int i=0;i<AudioDriverManagerSW::get_driver_count();i++) { + if (i==p_audio_driver) + continue; + if (AudioDriverManagerSW::get_driver(i)->init()==OK) { + success=true; + print_line("Audio Driver Failed: "+String(AudioDriverManagerSW::get_driver(p_audio_driver)->get_name())); + print_line("Using alternate audio driver: "+String(AudioDriverManagerSW::get_driver(i)->get_name())); + audio_driver_index=i; + break; + } + } + if (!success) { + ERR_PRINT("Initializing audio failed."); + } + } sample_manager = memnew( SampleManagerMallocSW ); |
