diff options
Diffstat (limited to 'main')
-rw-r--r-- | main/main.cpp | 21 | ||||
-rw-r--r-- | main/tests/test_main.cpp | 6 | ||||
-rw-r--r-- | main/tests/test_sound.cpp | 5 |
3 files changed, 20 insertions, 12 deletions
diff --git a/main/main.cpp b/main/main.cpp index e7dca04c2a..6f27595f06 100644 --- a/main/main.cpp +++ b/main/main.cpp @@ -42,7 +42,7 @@ #include "input_map.h" #include "io/resource_loader.h" #include "scene/main/scene_main_loop.h" - +#include "servers/audio_server.h" #include "script_language.h" #include "io/resource_loader.h" @@ -63,8 +63,6 @@ #include "tools/doc/doc_data.h" -#include "servers/spatial_sound_server.h" -#include "servers/spatial_sound_2d_server.h" #include "servers/physics_2d_server.h" @@ -83,6 +81,7 @@ static Engine *engine=NULL; static InputMap *input_map=NULL; static bool _start_success=false; static ScriptDebugger *script_debugger=NULL; +AudioServer *audio_server=NULL; static MessageQueue *message_queue=NULL; static Performance *performance = NULL; @@ -908,6 +907,11 @@ Error Main::setup2() { OS::get_singleton()->set_window_position(init_custom_pos); } + //right moment to create and initialize the audio server + + audio_server = memnew( AudioServer ); + audio_server->init(); + OS::get_singleton()->set_use_vsync(use_vsync); register_core_singletons(); @@ -1657,11 +1661,6 @@ bool Main::iteration() { OS::get_singleton()->get_main_loop()->idle( step*time_scale ); message_queue->flush(); - if (SpatialSoundServer::get_singleton()) - SpatialSoundServer::get_singleton()->update( step*time_scale ); - if (SpatialSound2DServer::get_singleton()) - SpatialSound2DServer::get_singleton()->update( step*time_scale ); - VisualServer::get_singleton()->sync(); //sync if still drawing from previous frames. @@ -1764,6 +1763,11 @@ void Main::cleanup() { OS::get_singleton()->_execpath=""; OS::get_singleton()->_local_clipboard=""; + if (audio_server) { + memdelete(audio_server); + } + + #ifdef TOOLS_ENABLED EditorNode::unregister_editor_types(); #endif @@ -1775,6 +1779,7 @@ void Main::cleanup() { OS::get_singleton()->finalize(); + if (packed_data) memdelete(packed_data); if (file_access_network_client) diff --git a/main/tests/test_main.cpp b/main/tests/test_main.cpp index 1f7f2d7dda..763616dd46 100644 --- a/main/tests/test_main.cpp +++ b/main/tests/test_main.cpp @@ -104,10 +104,10 @@ MainLoop* test_main(String p_test,const List<String>& p_args) { } #endif - if (p_test=="sound") { + //if (p_test=="sound") { - return TestSound::test(); - } + // return TestSound::test(); + //} if (p_test=="io") { diff --git a/main/tests/test_sound.cpp b/main/tests/test_sound.cpp index 44cc117e02..6b0cf0a324 100644 --- a/main/tests/test_sound.cpp +++ b/main/tests/test_sound.cpp @@ -30,11 +30,13 @@ #include "servers/visual_server.h" #include "os/main_loop.h" #include "math_funcs.h" -#include "scene/resources/sample.h" + #include "io/resource_loader.h" #include "print_string.h" #include "servers/audio_server.h" #include "os/os.h" + +#if 0 namespace TestSound { @@ -93,3 +95,4 @@ MainLoop* test() { } } +#endif |