diff options
author | Jacek Antonelli | 2008-11-19 12:51:29 -0600 |
---|---|---|
committer | Jacek Antonelli | 2008-11-19 16:55:13 -0600 |
commit | 97e6c15e935666c1b295b7508a182d0da4b481f1 (patch) | |
tree | ef1d5e6a33a71b51a3deadb6de54a67b6a8c7f5e /linden/indra/newview | |
parent | Changed to Imprudence.exec_marker to match llappviewer.cpp. (diff) | |
download | meta-impy-97e6c15e935666c1b295b7508a182d0da4b481f1.zip meta-impy-97e6c15e935666c1b295b7508a182d0da4b481f1.tar.gz meta-impy-97e6c15e935666c1b295b7508a182d0da4b481f1.tar.bz2 meta-impy-97e6c15e935666c1b295b7508a182d0da4b481f1.tar.xz |
VWR-2662: OpenAL support (patch by Tofu Linden)
Diffstat (limited to 'linden/indra/newview')
-rw-r--r-- | linden/indra/newview/CMakeLists.txt | 7 | ||||
-rw-r--r-- | linden/indra/newview/llappviewer.cpp | 3 | ||||
-rw-r--r-- | linden/indra/newview/llstartup.cpp | 24 |
3 files changed, 29 insertions, 5 deletions
diff --git a/linden/indra/newview/CMakeLists.txt b/linden/indra/newview/CMakeLists.txt index ddf6897..4bfbf02 100644 --- a/linden/indra/newview/CMakeLists.txt +++ b/linden/indra/newview/CMakeLists.txt | |||
@@ -8,6 +8,7 @@ include(BuildVersion) | |||
8 | include(DirectX) | 8 | include(DirectX) |
9 | include(ELFIO) | 9 | include(ELFIO) |
10 | include(FMOD) | 10 | include(FMOD) |
11 | include(OPENAL) | ||
11 | include(FindOpenGL) | 12 | include(FindOpenGL) |
12 | include(LLAudio) | 13 | include(LLAudio) |
13 | include(LLCharacter) | 14 | include(LLCharacter) |
@@ -56,6 +57,7 @@ include_directories( | |||
56 | ${LLXML_INCLUDE_DIRS} | 57 | ${LLXML_INCLUDE_DIRS} |
57 | ${LSCRIPT_INCLUDE_DIRS} | 58 | ${LSCRIPT_INCLUDE_DIRS} |
58 | ${LSCRIPT_INCLUDE_DIRS}/lscript_compile | 59 | ${LSCRIPT_INCLUDE_DIRS}/lscript_compile |
60 | ${GSTREAMER_INCLUDE_DIRS} | ||
59 | ) | 61 | ) |
60 | 62 | ||
61 | set(viewer_SOURCE_FILES | 63 | set(viewer_SOURCE_FILES |
@@ -1239,6 +1241,11 @@ set_source_files_properties(${viewer_CHARACTER_FILES} | |||
1239 | 1241 | ||
1240 | list(APPEND viewer_SOURCE_FILES ${viewer_CHARACTER_FILES}) | 1242 | list(APPEND viewer_SOURCE_FILES ${viewer_CHARACTER_FILES}) |
1241 | 1243 | ||
1244 | |||
1245 | if (OPENAL) | ||
1246 | set_source_files_properties(llstartup.cpp PROPERTIES COMPILE_FLAGS -DLL_OPENAL) | ||
1247 | endif (OPENAL) | ||
1248 | |||
1242 | if (FMOD) | 1249 | if (FMOD) |
1243 | set_source_files_properties(llstartup.cpp PROPERTIES COMPILE_FLAGS -DLL_FMOD) | 1250 | set_source_files_properties(llstartup.cpp PROPERTIES COMPILE_FLAGS -DLL_FMOD) |
1244 | 1251 | ||
diff --git a/linden/indra/newview/llappviewer.cpp b/linden/indra/newview/llappviewer.cpp index 6301421..f442f38 100644 --- a/linden/indra/newview/llappviewer.cpp +++ b/linden/indra/newview/llappviewer.cpp | |||
@@ -1178,7 +1178,8 @@ bool LLAppViewer::cleanup() | |||
1178 | 1178 | ||
1179 | llinfos << "Global stuff deleted" << llendflush; | 1179 | llinfos << "Global stuff deleted" << llendflush; |
1180 | 1180 | ||
1181 | #if !LL_RELEASE_FOR_DOWNLOAD | 1181 | #if (!defined(LL_FMOD)) || (!LL_RELEASE_FOR_DOWNLOAD) |
1182 | // OpenAL likes to crash on exit if we *don't* explicitly shut it down. | ||
1182 | if (gAudiop) | 1183 | if (gAudiop) |
1183 | { | 1184 | { |
1184 | gAudiop->shutdown(); | 1185 | gAudiop->shutdown(); |
diff --git a/linden/indra/newview/llstartup.cpp b/linden/indra/newview/llstartup.cpp index 0978fbb..941787b 100644 --- a/linden/indra/newview/llstartup.cpp +++ b/linden/indra/newview/llstartup.cpp | |||
@@ -45,6 +45,10 @@ | |||
45 | # include "audioengine_fmod.h" | 45 | # include "audioengine_fmod.h" |
46 | #endif | 46 | #endif |
47 | 47 | ||
48 | #ifdef LL_OPENAL | ||
49 | #include "audioengine_openal.h" | ||
50 | #endif | ||
51 | |||
48 | #include "llares.h" | 52 | #include "llares.h" |
49 | #include "llcachename.h" | 53 | #include "llcachename.h" |
50 | #include "llviewercontrol.h" | 54 | #include "llviewercontrol.h" |
@@ -579,10 +583,17 @@ bool idle_startup() | |||
579 | 583 | ||
580 | if (FALSE == gSavedSettings.getBOOL("NoAudio")) | 584 | if (FALSE == gSavedSettings.getBOOL("NoAudio")) |
581 | { | 585 | { |
586 | gAudiop = NULL; | ||
587 | |||
582 | #ifdef LL_FMOD | 588 | #ifdef LL_FMOD |
583 | gAudiop = (LLAudioEngine *) new LLAudioEngine_FMOD(); | 589 | gAudiop = (LLAudioEngine *) new LLAudioEngine_FMOD(); |
584 | #else | 590 | #endif |
585 | gAudiop = NULL; | 591 | |
592 | #ifdef LL_OPENAL | ||
593 | if (!gAudiop) | ||
594 | { | ||
595 | gAudiop = (LLAudioEngine *) new LLAudioEngine_OpenAL(); | ||
596 | } | ||
586 | #endif | 597 | #endif |
587 | 598 | ||
588 | if (gAudiop) | 599 | if (gAudiop) |
@@ -595,11 +606,16 @@ bool idle_startup() | |||
595 | void* window_handle = NULL; | 606 | void* window_handle = NULL; |
596 | #endif | 607 | #endif |
597 | bool init = gAudiop->init(kAUDIO_NUM_SOURCES, window_handle); | 608 | bool init = gAudiop->init(kAUDIO_NUM_SOURCES, window_handle); |
598 | if(!init) | 609 | if(init) |
610 | { | ||
611 | gAudiop->setMuted(TRUE); | ||
612 | } | ||
613 | else | ||
599 | { | 614 | { |
600 | LL_WARNS("AppInit") << "Unable to initialize audio engine" << LL_ENDL; | 615 | LL_WARNS("AppInit") << "Unable to initialize audio engine" << LL_ENDL; |
616 | delete gAudiop; | ||
617 | gAudiop = NULL; | ||
601 | } | 618 | } |
602 | gAudiop->setMuted(TRUE); | ||
603 | } | 619 | } |
604 | } | 620 | } |
605 | 621 | ||