diff options
Diffstat (limited to 'linden/indra/newview/llstartup.cpp')
-rw-r--r-- | linden/indra/newview/llstartup.cpp | 44 |
1 files changed, 39 insertions, 5 deletions
diff --git a/linden/indra/newview/llstartup.cpp b/linden/indra/newview/llstartup.cpp index 6371f2b..c863d19 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,28 @@ bool idle_startup() | |||
579 | 583 | ||
580 | if (FALSE == gSavedSettings.getBOOL("NoAudio")) | 584 | if (FALSE == gSavedSettings.getBOOL("NoAudio")) |
581 | { | 585 | { |
582 | #ifdef LL_FMOD | ||
583 | gAudiop = (LLAudioEngine *) new LLAudioEngine_FMOD(); | ||
584 | #else | ||
585 | gAudiop = NULL; | 586 | gAudiop = NULL; |
587 | |||
588 | #ifdef LL_OPENAL | ||
589 | if (!gAudiop | ||
590 | #if !LL_WINDOWS | ||
591 | && NULL == getenv("LL_BAD_OPENAL_DRIVER") | ||
592 | #endif // !LL_WINDOWS | ||
593 | ) | ||
594 | { | ||
595 | gAudiop = (LLAudioEngine *) new LLAudioEngine_OpenAL(); | ||
596 | } | ||
597 | #endif | ||
598 | |||
599 | #ifdef LL_FMOD | ||
600 | if (!gAudiop | ||
601 | #if !LL_WINDOWS | ||
602 | && NULL == getenv("LL_BAD_FMOD_DRIVER") | ||
603 | #endif // !LL_WINDOWS | ||
604 | ) | ||
605 | { | ||
606 | gAudiop = (LLAudioEngine *) new LLAudioEngine_FMOD(); | ||
607 | } | ||
586 | #endif | 608 | #endif |
587 | 609 | ||
588 | if (gAudiop) | 610 | if (gAudiop) |
@@ -595,15 +617,21 @@ bool idle_startup() | |||
595 | void* window_handle = NULL; | 617 | void* window_handle = NULL; |
596 | #endif | 618 | #endif |
597 | bool init = gAudiop->init(kAUDIO_NUM_SOURCES, window_handle); | 619 | bool init = gAudiop->init(kAUDIO_NUM_SOURCES, window_handle); |
598 | if(!init) | 620 | if(init) |
621 | { | ||
622 | gAudiop->setMuted(TRUE); | ||
623 | } | ||
624 | else | ||
599 | { | 625 | { |
600 | LL_WARNS("AppInit") << "Unable to initialize audio engine" << LL_ENDL; | 626 | LL_WARNS("AppInit") << "Unable to initialize audio engine" << LL_ENDL; |
627 | delete gAudiop; | ||
628 | gAudiop = NULL; | ||
601 | } | 629 | } |
602 | gAudiop->setMuted(TRUE); | ||
603 | } | 630 | } |
604 | } | 631 | } |
605 | 632 | ||
606 | LL_INFOS("AppInit") << "Audio Engine Initialized." << LL_ENDL; | 633 | LL_INFOS("AppInit") << "Audio Engine Initialized." << LL_ENDL; |
634 | |||
607 | 635 | ||
608 | if (LLTimer::knownBadTimer()) | 636 | if (LLTimer::knownBadTimer()) |
609 | { | 637 | { |
@@ -750,6 +778,12 @@ bool idle_startup() | |||
750 | gLoginMenuBarView->setVisible( TRUE ); | 778 | gLoginMenuBarView->setVisible( TRUE ); |
751 | gLoginMenuBarView->setEnabled( TRUE ); | 779 | gLoginMenuBarView->setEnabled( TRUE ); |
752 | 780 | ||
781 | // DEV-16927. The following code removes errant keystrokes that happen while the window is being | ||
782 | // first made visible. | ||
783 | #ifdef _WIN32 | ||
784 | MSG msg; | ||
785 | while( PeekMessage( &msg, /*All hWnds owned by this thread */ NULL, WM_KEYFIRST, WM_KEYLAST, PM_REMOVE ) ); | ||
786 | #endif | ||
753 | timeout.reset(); | 787 | timeout.reset(); |
754 | return FALSE; | 788 | return FALSE; |
755 | } | 789 | } |