From 97e6c15e935666c1b295b7508a182d0da4b481f1 Mon Sep 17 00:00:00 2001 From: Jacek Antonelli Date: Wed, 19 Nov 2008 12:51:29 -0600 Subject: VWR-2662: OpenAL support (patch by Tofu Linden) --- linden/indra/newview/llstartup.cpp | 24 ++++++++++++++++++++---- 1 file changed, 20 insertions(+), 4 deletions(-) (limited to 'linden/indra/newview/llstartup.cpp') 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 @@ # include "audioengine_fmod.h" #endif +#ifdef LL_OPENAL +#include "audioengine_openal.h" +#endif + #include "llares.h" #include "llcachename.h" #include "llviewercontrol.h" @@ -579,10 +583,17 @@ bool idle_startup() if (FALSE == gSavedSettings.getBOOL("NoAudio")) { + gAudiop = NULL; + #ifdef LL_FMOD gAudiop = (LLAudioEngine *) new LLAudioEngine_FMOD(); -#else - gAudiop = NULL; +#endif + +#ifdef LL_OPENAL + if (!gAudiop) + { + gAudiop = (LLAudioEngine *) new LLAudioEngine_OpenAL(); + } #endif if (gAudiop) @@ -595,11 +606,16 @@ bool idle_startup() void* window_handle = NULL; #endif bool init = gAudiop->init(kAUDIO_NUM_SOURCES, window_handle); - if(!init) + if(init) + { + gAudiop->setMuted(TRUE); + } + else { LL_WARNS("AppInit") << "Unable to initialize audio engine" << LL_ENDL; + delete gAudiop; + gAudiop = NULL; } - gAudiop->setMuted(TRUE); } } -- cgit v1.1 From 0b208f1539f79f5154a61214876b74a11374bec5 Mon Sep 17 00:00:00 2001 From: McCabe Maxsted Date: Sat, 6 Dec 2008 11:27:57 -0700 Subject: openal on windows branch --- linden/indra/newview/llstartup.cpp | 45 +++++++++++++++----------------------- 1 file changed, 18 insertions(+), 27 deletions(-) (limited to 'linden/indra/newview/llstartup.cpp') diff --git a/linden/indra/newview/llstartup.cpp b/linden/indra/newview/llstartup.cpp index 941787b..636cf31 100644 --- a/linden/indra/newview/llstartup.cpp +++ b/linden/indra/newview/llstartup.cpp @@ -583,43 +583,28 @@ bool idle_startup() if (FALSE == gSavedSettings.getBOOL("NoAudio")) { - gAudiop = NULL; - -#ifdef LL_FMOD - gAudiop = (LLAudioEngine *) new LLAudioEngine_FMOD(); -#endif - -#ifdef LL_OPENAL - if (!gAudiop) - { - gAudiop = (LLAudioEngine *) new LLAudioEngine_OpenAL(); - } -#endif + + gAudiop = (LLAudioEngine *) new LLAudioEngine_OpenAL(); if (gAudiop) { -#if LL_WINDOWS - // FMOD on Windows needs the window handle to stop playing audio - // when window is minimized. JC - void* window_handle = (HWND)gViewerWindow->getPlatformWindow(); -#else - void* window_handle = NULL; -#endif - bool init = gAudiop->init(kAUDIO_NUM_SOURCES, window_handle); - if(init) + BOOL init = gAudiop->init(kAUDIO_NUM_SOURCES); + if(!init) { - gAudiop->setMuted(TRUE); + LL_WARNS("AppInit") << "Unable to initialize audio engine" << LL_ENDL; + gAudiop=NULL; } else { - LL_WARNS("AppInit") << "Unable to initialize audio engine" << LL_ENDL; - delete gAudiop; - gAudiop = NULL; + gAudiop->setMuted(TRUE); + LL_INFOS("AppInit") << "Audio Engine Initialized." << LL_ENDL; } } } - - LL_INFOS("AppInit") << "Audio Engine Initialized." << LL_ENDL; + else + { + gAudiop = NULL; + } if (LLTimer::knownBadTimer()) { @@ -766,6 +751,12 @@ bool idle_startup() gLoginMenuBarView->setVisible( TRUE ); gLoginMenuBarView->setEnabled( TRUE ); + // DEV-16927. The following code removes errant keystrokes that happen while the window is being + // first made visible. +#ifdef _WIN32 + MSG msg; + while( PeekMessage( &msg, /*All hWnds owned by this thread */ NULL, WM_KEYFIRST, WM_KEYLAST, PM_REMOVE ) ); +#endif timeout.reset(); return FALSE; } -- cgit v1.1 From b29b13ad98c5c79fd63bae10b4b099a03fa9dc35 Mon Sep 17 00:00:00 2001 From: Jacek Antonelli Date: Sat, 6 Dec 2008 14:03:10 -0600 Subject: Updated audio engine to LL's openal branch r1532. --- linden/indra/newview/llstartup.cpp | 51 +++++++++++++++++++++++++++++--------- 1 file changed, 39 insertions(+), 12 deletions(-) (limited to 'linden/indra/newview/llstartup.cpp') diff --git a/linden/indra/newview/llstartup.cpp b/linden/indra/newview/llstartup.cpp index 636cf31..11e4ac5 100644 --- a/linden/indra/newview/llstartup.cpp +++ b/linden/indra/newview/llstartup.cpp @@ -583,28 +583,55 @@ bool idle_startup() if (FALSE == gSavedSettings.getBOOL("NoAudio")) { - - gAudiop = (LLAudioEngine *) new LLAudioEngine_OpenAL(); + gAudiop = NULL; + +#ifdef LL_OPENAL + if (!gAudiop +#if !LL_WINDOWS + && NULL == getenv("LL_BAD_OPENAL_DRIVER") +#endif // !LL_WINDOWS + ) + { + gAudiop = (LLAudioEngine *) new LLAudioEngine_OpenAL(); + } +#endif + +#ifdef LL_FMOD + if (!gAudiop +#if !LL_WINDOWS + && NULL == getenv("LL_BAD_FMOD_DRIVER") +#endif // !LL_WINDOWS + ) + { + gAudiop = (LLAudioEngine *) new LLAudioEngine_FMOD(); + } +#endif if (gAudiop) { - BOOL init = gAudiop->init(kAUDIO_NUM_SOURCES); - if(!init) +#if LL_WINDOWS + // FMOD on Windows needs the window handle to stop playing audio + // when window is minimized. JC + void* window_handle = (HWND)gViewerWindow->getPlatformWindow(); +#else + void* window_handle = NULL; +#endif + bool init = gAudiop->init(kAUDIO_NUM_SOURCES, window_handle); + if(init) { - LL_WARNS("AppInit") << "Unable to initialize audio engine" << LL_ENDL; - gAudiop=NULL; + gAudiop->setMuted(TRUE); } else { - gAudiop->setMuted(TRUE); - LL_INFOS("AppInit") << "Audio Engine Initialized." << LL_ENDL; + LL_WARNS("AppInit") << "Unable to initialize audio engine" << LL_ENDL; + delete gAudiop; + gAudiop = NULL; } } } - else - { - gAudiop = NULL; - } + + LL_INFOS("AppInit") << "Audio Engine Initialized." << LL_ENDL; + if (LLTimer::knownBadTimer()) { -- cgit v1.1