From fd46865a502036b9e4414e7ec4950faf551b1f14 Mon Sep 17 00:00:00 2001 From: Adam Moss Date: Tue, 2 Dec 2008 20:35:40 +0000 Subject: QAR-1040 maint-viewer-11 + OpenAL combo mergeme svn merge -c104451 svn+ssh://svn.lindenlab.com/svn/linden/branches/moss/openal-maint-viewer-11-combo-r104448 --- indra/CMakeLists.txt | 4 +- indra/cmake/CMakeLists.txt | 1 + indra/cmake/LLAudio.cmake | 2 +- indra/cmake/OPENAL.cmake | 28 + indra/develop.py | 26 +- indra/llaudio/CMakeLists.txt | 18 + indra/llmath/v2math.h | 4 +- indra/llmath/v3color.h | 2 +- indra/llmath/v3math.h | 4 +- indra/llmessage/llassetstorage.cpp | 17 +- indra/llui/lltexteditor.cpp | 4 +- indra/llvfs/lldir.h | 4 +- indra/llvfs/lldir_win32.cpp | 18 +- indra/llwindow/llwindowsdl.cpp | 626 +++------------------ indra/llwindow/llwindowsdl.h | 12 - indra/newview/CMakeLists.txt | 9 +- indra/newview/app_settings/settings.xml | 31 +- indra/newview/app_settings/settings_files.xml | 103 +++- .../installers/windows/installer_template.nsi | 6 +- indra/newview/linux_tools/client-readme-voice.txt | 10 +- indra/newview/linux_tools/client-readme.txt | 18 +- indra/newview/linux_tools/wrapper.sh | 19 +- indra/newview/llagent.cpp | 114 ++-- indra/newview/llagent.h | 3 - indra/newview/llappviewer.cpp | 245 +++++--- indra/newview/llappviewer.h | 16 +- indra/newview/llchatbar.cpp | 1 + indra/newview/llfloaterabout.cpp | 6 + indra/newview/llfloaterproperties.cpp | 11 +- indra/newview/llimpanel.cpp | 4 +- indra/newview/llpanelobject.cpp | 2 +- indra/newview/llpanelpermissions.cpp | 15 +- indra/newview/llpanelvolume.cpp | 2 +- indra/newview/llstartup.cpp | 41 +- indra/newview/lltooldraganddrop.cpp | 36 +- indra/newview/lltooldraganddrop.h | 7 +- indra/newview/lltoolpie.cpp | 21 +- indra/newview/llvieweraudio.cpp | 10 +- indra/newview/llviewermenu.cpp | 13 +- indra/newview/llviewerwindow.cpp | 30 +- indra/newview/viewer_manifest.py | 16 +- indra/win_updater/updater.cpp | 12 +- 42 files changed, 746 insertions(+), 825 deletions(-) create mode 100644 indra/cmake/OPENAL.cmake (limited to 'indra') diff --git a/indra/CMakeLists.txt b/indra/CMakeLists.txt index 19efc952ac..9f8c504409 100644 --- a/indra/CMakeLists.txt +++ b/indra/CMakeLists.txt @@ -13,7 +13,9 @@ if(COMMAND cmake_policy) cmake_policy(SET CMP0003 OLD) endif(COMMAND cmake_policy) -project(SecondLife) +set(ROOT_PROJECT_NAME "SecondLife" CACHE STRING + "The root project/makefile/solution name. Defaults to SecondLife.") +project(${ROOT_PROJECT_NAME}) set(CMAKE_MODULE_PATH "${CMAKE_SOURCE_DIR}/cmake") diff --git a/indra/cmake/CMakeLists.txt b/indra/cmake/CMakeLists.txt index 46b9b52f3f..34b8046a17 100644 --- a/indra/cmake/CMakeLists.txt +++ b/indra/cmake/CMakeLists.txt @@ -62,6 +62,7 @@ set(cmake_SOURCE_FILES Mozlib.cmake MySQL.cmake NDOF.cmake + OPENAL.cmake OpenGL.cmake OpenJPEG.cmake OpenSSL.cmake diff --git a/indra/cmake/LLAudio.cmake b/indra/cmake/LLAudio.cmake index eff643d381..89b790c6b0 100644 --- a/indra/cmake/LLAudio.cmake +++ b/indra/cmake/LLAudio.cmake @@ -6,4 +6,4 @@ set(LLAUDIO_INCLUDE_DIRS ${LIBS_OPEN_DIR}/llaudio ) -set(LLAUDIO_LIBRARIES llaudio) +set(LLAUDIO_LIBRARIES llaudio ${OPENAL_LIBRARIES}) diff --git a/indra/cmake/OPENAL.cmake b/indra/cmake/OPENAL.cmake new file mode 100644 index 0000000000..eb195a06a0 --- /dev/null +++ b/indra/cmake/OPENAL.cmake @@ -0,0 +1,28 @@ +# -*- cmake -*- +include(Linking) +include(Prebuilt) + +if (LINUX) + set(OPENAL ON CACHE BOOL "Enable OpenAL") +else (LINUX) + set(OPENAL OFF CACHE BOOL "Enable OpenAL") +endif (LINUX) + +if (OPENAL) + if (STANDALONE) + include(FindPkgConfig) + include(FindOpenAL) + pkg_check_modules(OPENAL_LIB REQUIRED openal) + pkg_check_modules(FREEALUT_LIB REQUIRED freealut) + else (STANDALONE) + use_prebuilt_binary(openal) + endif (STANDALONE) + set(OPENAL_LIBRARIES + openal + alut + ) +endif (OPENAL) + +if (OPENAL) + message(STATUS "Building with OpenAL audio support") +endif (OPENAL) diff --git a/indra/develop.py b/indra/develop.py index 90e1003d70..a1eeff0e01 100755 --- a/indra/develop.py +++ b/indra/develop.py @@ -75,6 +75,7 @@ class PlatformSetup(object): build_type = build_types['relwithdebinfo'] standalone = 'OFF' unattended = 'OFF' + project_name = 'SecondLife' distcc = True cmake_opts = [] @@ -272,7 +273,8 @@ class LinuxSetup(UnixSetup): opts=quote(opts), standalone=self.standalone, unattended=self.unattended, - type=self.build_type.upper() + type=self.build_type.upper(), + project_name=self.project_name ) if not self.is_internal_tree(): args.update({'cxx':'g++', 'server':'OFF', 'viewer':'ON'}) @@ -298,6 +300,7 @@ class LinuxSetup(UnixSetup): '-G %(generator)r -DSERVER:BOOL=%(server)s ' '-DVIEWER:BOOL=%(viewer)s -DSTANDALONE:BOOL=%(standalone)s ' '-DUNATTENDED:BOOL=%(unattended)s ' + '-DROOT_PROJECT_NAME:STRING=%(project_name)s ' '%(opts)s %(dir)r') % args) if 'CXX' not in os.environ: @@ -400,6 +403,7 @@ class DarwinSetup(UnixSetup): opts=quote(opts), standalone=self.standalone, unattended=self.unattended, + project_name=self.project_name, universal='', type=self.build_type.upper() ) @@ -411,6 +415,7 @@ class DarwinSetup(UnixSetup): '-DCMAKE_BUILD_TYPE:STRING=%(type)s ' '-DSTANDALONE:BOOL=%(standalone)s ' '-DUNATTENDED:BOOL=%(unattended)s ' + '-DROOT_PROJECT_NAME:STRING=%(project_name)s ' '%(universal)s ' '%(opts)s %(dir)r' % args) @@ -486,12 +491,14 @@ class WindowsSetup(PlatformSetup): opts=quote(opts), standalone=self.standalone, unattended=self.unattended, + project_name=self.project_name ) #if simple: # return 'cmake %(opts)s "%(dir)s"' % args return ('cmake -G "%(generator)s" ' '-DSTANDALONE:BOOL=%(standalone)s ' '-DUNATTENDED:BOOL=%(unattended)s ' + '-DROOT_PROJECT_NAME:STRING=%(project_name)s ' '%(opts)s "%(dir)s"' % args) def find_visual_studio(self, gen=None): @@ -522,11 +529,11 @@ class WindowsSetup(PlatformSetup): if self.gens[self.generator]['ver'] in [ r'8.0', r'9.0' ]: config = '\"%s|Win32\"' % config - return "buildconsole Secondlife.sln /build %s" % config + return "buildconsole %s.sln /build %s" % (self.project_name, config) # devenv.com is CLI friendly, devenv.exe... not so much. - return ('"%sdevenv.com" Secondlife.sln /build %s' % - (self.find_visual_studio(), self.build_type)) + return ('"%sdevenv.com" %s.sln /build %s' % + (self.find_visual_studio(), self.project_name, self.build_type)) # this override of run exists because the PlatformSetup version # uses Unix/Mac only calls. Freakin' os module! @@ -596,12 +603,14 @@ class CygwinSetup(WindowsSetup): opts=quote(opts), standalone=self.standalone, unattended=self.unattended, + project_name=self.project_name ) #if simple: # return 'cmake %(opts)s "%(dir)s"' % args return ('cmake -G "%(generator)s" ' '-DUNATTENDED:BOOl=%(unattended)s ' '-DSTANDALONE:BOOL=%(standalone)s ' + '-DROOT_PROJECT_NAME:STRING=%(project_name)s ' '%(opts)s "%(dir)s"' % args) setup_platform = { @@ -627,6 +636,8 @@ Options: VC90 (VS2008) Mac OS X: Xcode (default), Unix Makefiles Linux: Unix Makefiles (default), KDevelop3 + -p | --project=NAME set the root project name. (Doesn't effect makefiles) + Commands: build configure and build default target clean delete all build directories, does not affect sources @@ -652,13 +663,14 @@ def main(arguments): try: opts, args = getopt.getopt( arguments, - '?hNt:G:', - ['help', 'standalone', 'no-distcc', 'unattended', 'type=', 'incredibuild', 'generator=']) + '?hNt:p:G:', + ['help', 'standalone', 'no-distcc', 'unattended', 'type=', 'incredibuild', 'generator=', 'project=']) except getopt.GetoptError, err: print >> sys.stderr, 'Error:', err print >> sys.stderr, """ Note: You must pass -D options to cmake after the "configure" command For example: develop.py configure -DSERVER:BOOL=OFF""" + print >> sys.stderr, usage_msg.strip() sys.exit(1) for o, a in opts: @@ -684,6 +696,8 @@ For example: develop.py configure -DSERVER:BOOL=OFF""" setup.generator = a elif o in ('-N', '--no-distcc'): setup.distcc = False + elif o in ('-p', '--project'): + setup.project_name = a elif o in ('--incredibuild'): setup.incredibuild = True else: diff --git a/indra/llaudio/CMakeLists.txt b/indra/llaudio/CMakeLists.txt index ebedcab4bf..235248ee73 100644 --- a/indra/llaudio/CMakeLists.txt +++ b/indra/llaudio/CMakeLists.txt @@ -5,10 +5,12 @@ project(llaudio) include(00-Common) include(Audio) include(FMOD) +include(OPENAL) include(LLCommon) include(LLMath) include(LLMessage) include(LLVFS) +include(LLMedia) include_directories( ${FMOD_INCLUDE_DIR} @@ -20,6 +22,9 @@ include_directories( ${VORBISENC_INCLUDE_DIRS} ${VORBISFILE_INCLUDE_DIRS} ${VORBIS_INCLUDE_DIRS} + ${OPENAL_LIB_INCLUDE_DIRS} + ${FREEAULT_LIB_INCLUDE_DIRS} + ${LLMEDIA_INCLUDE_DIRS} ) set(llaudio_SOURCE_FILES @@ -38,6 +43,7 @@ set(llaudio_HEADER_FILES llaudiodecodemgr.h vorbisdecode.h vorbisencode.h + windgen.h ) if (FMOD) @@ -59,6 +65,18 @@ if (FMOD) endif (LINUX) endif (FMOD) +if (OPENAL) + list(APPEND llaudio_SOURCE_FILES + audioengine_openal.cpp + listener_openal.cpp + ) + + list(APPEND llaudio_HEADER_FILES + audioengine_openal.h + listener_openal.h + ) +endif (OPENAL) + set_source_files_properties(${llaudio_HEADER_FILES} PROPERTIES HEADER_FILE_ONLY TRUE) diff --git a/indra/llmath/v2math.h b/indra/llmath/v2math.h index c896b80977..ab4840dadf 100644 --- a/indra/llmath/v2math.h +++ b/indra/llmath/v2math.h @@ -115,8 +115,8 @@ class LLVector2 F32 angle_between(const LLVector2 &a, const LLVector2 &b); // Returns angle (radians) between a and b BOOL are_parallel(const LLVector2 &a, const LLVector2 &b, F32 epsilon=F_APPROXIMATELY_ZERO); // Returns TRUE if a and b are very close to parallel F32 dist_vec(const LLVector2 &a, const LLVector2 &b); // Returns distance between a and b -F32 dist_vec_squared(const LLVector2 &a, const LLVector2 &b);// Returns distance sqaured between a and b -F32 dist_vec_squared2D(const LLVector2 &a, const LLVector2 &b);// Returns distance sqaured between a and b ignoring Z component +F32 dist_vec_squared(const LLVector2 &a, const LLVector2 &b);// Returns distance squared between a and b +F32 dist_vec_squared2D(const LLVector2 &a, const LLVector2 &b);// Returns distance squared between a and b ignoring Z component LLVector2 lerp(const LLVector2 &a, const LLVector2 &b, F32 u); // Returns a vector that is a linear interpolation between a and b // Constructors diff --git a/indra/llmath/v3color.h b/indra/llmath/v3color.h index 05f6186893..2b9f48bd43 100644 --- a/indra/llmath/v3color.h +++ b/indra/llmath/v3color.h @@ -160,7 +160,7 @@ void LLColor3::clamp() // Non-member functions F32 distVec(const LLColor3 &a, const LLColor3 &b); // Returns distance between a and b -F32 distVec_squared(const LLColor3 &a, const LLColor3 &b);// Returns distance sqaured between a and b +F32 distVec_squared(const LLColor3 &a, const LLColor3 &b);// Returns distance squared between a and b inline LLColor3::LLColor3(void) { diff --git a/indra/llmath/v3math.h b/indra/llmath/v3math.h index 42ca1f88b2..e5c9f8e885 100644 --- a/indra/llmath/v3math.h +++ b/indra/llmath/v3math.h @@ -160,8 +160,8 @@ typedef LLVector3 LLSimLocalVec; F32 angle_between(const LLVector3 &a, const LLVector3 &b); // Returns angle (radians) between a and b BOOL are_parallel(const LLVector3 &a, const LLVector3 &b, F32 epsilon=F_APPROXIMATELY_ZERO); // Returns TRUE if a and b are very close to parallel F32 dist_vec(const LLVector3 &a, const LLVector3 &b); // Returns distance between a and b -F32 dist_vec_squared(const LLVector3 &a, const LLVector3 &b);// Returns distance sqaured between a and b -F32 dist_vec_squared2D(const LLVector3 &a, const LLVector3 &b);// Returns distance sqaured between a and b ignoring Z component +F32 dist_vec_squared(const LLVector3 &a, const LLVector3 &b);// Returns distance squared between a and b +F32 dist_vec_squared2D(const LLVector3 &a, const LLVector3 &b);// Returns distance squared between a and b ignoring Z component LLVector3 projected_vec(const LLVector3 &a, const LLVector3 &b); // Returns vector a projected on vector b LLVector3 lerp(const LLVector3 &a, const LLVector3 &b, F32 u); // Returns a vector that is a linear interpolation between a and b diff --git a/indra/llmessage/llassetstorage.cpp b/indra/llmessage/llassetstorage.cpp index af149d0f62..7f47dfec92 100644 --- a/indra/llmessage/llassetstorage.cpp +++ b/indra/llmessage/llassetstorage.cpp @@ -539,8 +539,19 @@ void LLAssetStorage::downloadCompleteCallback( return; } - req->setUUID(file_id); - req->setType(file_type); + // Inefficient since we're doing a find through a list that may have thousands of elements. + // This is due for refactoring; we will probably change mPendingDownloads into a set. + request_list_t::iterator download_iter = std::find(gAssetStorage->mPendingDownloads.begin(), + gAssetStorage->mPendingDownloads.end(), + req); + // If the LLAssetRequest doesn't exist in the downloads queue, then it either has already been deleted + // by _cleanupRequests, or it's a transfer. + if (download_iter != gAssetStorage->mPendingDownloads.end()) + { + req->setUUID(file_id); + req->setType(file_type); + } + if (LL_ERR_NOERR == result) { // we might have gotten a zero-size file @@ -563,7 +574,7 @@ void LLAssetStorage::downloadCompleteCallback( { request_list_t::iterator curiter = iter++; LLAssetRequest* tmp = *curiter; - if ((tmp->getUUID() == req->getUUID()) && (tmp->getType()== req->getType())) + if ((tmp->getUUID() == file_id) && (tmp->getType()== file_type)) { requests.push_front(tmp); iter = gAssetStorage->mPendingDownloads.erase(curiter); diff --git a/indra/llui/lltexteditor.cpp b/indra/llui/lltexteditor.cpp index 197f8d98cf..92b6cc8bb6 100644 --- a/indra/llui/lltexteditor.cpp +++ b/indra/llui/lltexteditor.cpp @@ -3384,7 +3384,9 @@ void LLTextEditor::endOfLine() void LLTextEditor::endOfDoc() { - mScrollbar->setDocPos( mScrollbar->getDocPosMax() ); + mScrollbar->setDocPos(mScrollbar->getDocPosMax()); + mScrolledToBottom = true; + S32 len = getLength(); if( len ) { diff --git a/indra/llvfs/lldir.h b/indra/llvfs/lldir.h index a884ea7c76..ea5186d092 100644 --- a/indra/llvfs/lldir.h +++ b/indra/llvfs/lldir.h @@ -140,8 +140,8 @@ protected: std::string mChatLogsDir; // Location for chat logs. std::string mCAFile; // Location of the TLS certificate authority PEM file. std::string mTempDir; - std::string mCacheDir; - std::string mOSCacheDir; + std::string mCacheDir; // cache directory as set by user preference + std::string mOSCacheDir; // operating system cache dir std::string mDirDelimiter; std::string mSkinDir; // Location for current skin info. std::string mDefaultSkinDir; // Location for default skin info. diff --git a/indra/llvfs/lldir_win32.cpp b/indra/llvfs/lldir_win32.cpp index 6e124002bc..ae2cd36072 100644 --- a/indra/llvfs/lldir_win32.cpp +++ b/indra/llvfs/lldir_win32.cpp @@ -58,14 +58,18 @@ LLDir_Win32::LLDir_Win32() mOSUserDir = utf16str_to_utf8str(llutf16string(w_str)); - // Local Settings\Application Data is where cache files should - // go, they don't get copied to the server if the user moves his - // profile around on the network. JC + // We want cache files to go on the local disk, even if the + // user is on a network with a "roaming profile". // - // TODO: patch the installer to remove old cache files on update, then - // enable this code. - //SHGetSpecialFolderPath(NULL, w_str, CSIDL_LOCAL_APPDATA, TRUE); - //mOSUserCacheDir = utf16str_to_utf8str(llutf16string(w_str)); + // On XP this is: + // C:\Docments and Settings\James\Local Settings\Application Data + // On Vista this is: + // C:\Users\James\AppData\Local + // + // We used to store the cache in AppData\Roaming, and the installer + // cleans up that version on upgrade. JC + SHGetSpecialFolderPath(NULL, w_str, CSIDL_LOCAL_APPDATA, TRUE); + mOSCacheDir = utf16str_to_utf8str(llutf16string(w_str)); if (GetTempPath(MAX_PATH, w_str)) { diff --git a/indra/llwindow/llwindowsdl.cpp b/indra/llwindow/llwindowsdl.cpp index 6a0ef141f5..5240bb62fd 100644 --- a/indra/llwindow/llwindowsdl.cpp +++ b/indra/llwindow/llwindowsdl.cpp @@ -1,6 +1,7 @@ /** * @file llwindowsdl.cpp * @brief SDL implementation of LLWindow class + * @author This module has many fathers, and it shows. * * $LicenseInfo:firstyear=2001&license=viewergpl$ * @@ -156,6 +157,8 @@ bool LLWindowSDL::ll_try_gtk_init(void) llwarns << "- GTK COMPATIBILITY WARNING: " << gtk_warning << llendl; gtk_is_good = FALSE; + } else { + llinfos << "- GTK version is good." << llendl; } done_gtk_diag = TRUE; @@ -188,11 +191,12 @@ Display* LLWindowSDL::get_SDL_Display(void) LLWindowSDL::LLWindowSDL(const std::string& title, S32 x, S32 y, S32 width, - S32 height, U32 flags, - BOOL fullscreen, BOOL clearBg, - BOOL disable_vsync, BOOL use_gl, - BOOL ignore_pixel_depth, U32 fsaa_samples) - : LLWindow(fullscreen, flags), mGamma(1.0f) + S32 height, U32 flags, + BOOL fullscreen, BOOL clearBg, + BOOL disable_vsync, BOOL use_gl, + BOOL ignore_pixel_depth, U32 fsaa_samples) + : LLWindow(fullscreen, flags), Lock_Display(NULL), + Unlock_Display(NULL), mGamma(1.0f) { // Initialize the keyboard gKeyboard = new LLKeyboardSDL(); @@ -200,10 +204,6 @@ LLWindowSDL::LLWindowSDL(const std::string& title, S32 x, S32 y, S32 width, // Ignore use_gl for now, only used for drones on PC mWindow = NULL; - mCursorDecoupled = FALSE; - mCursorLastEventDeltaX = 0; - mCursorLastEventDeltaY = 0; - mCursorIgnoreNextDelta = FALSE; mNeedsResize = FALSE; mOverrideAspectRatio = 0.f; mGrabbyKeyFlags = 0; @@ -717,9 +717,33 @@ BOOL LLWindowSDL::createContext(int x, int y, int width, int height, int bits, B #endif #if LL_X11 - init_x11clipboard(); + /* Grab the window manager specific information */ + SDL_SysWMinfo info; + SDL_VERSION(&info.version); + if ( SDL_GetWMInfo(&info) ) + { + /* Save the information for later use */ + if ( info.subsystem == SDL_SYSWM_X11 ) + { + mSDL_Display = info.info.x11.display; + mSDL_XWindowID = info.info.x11.wmwindow; + Lock_Display = info.info.x11.lock_func; + Unlock_Display = info.info.x11.unlock_func; + } + else + { + llwarns << "We're not running under X11? Wild." + << llendl; + } + } + else + { + llwarns << "We're not running under any known WM. Wild." + << llendl; + } #endif // LL_X11 + //make sure multisampling is disabled by default glDisable(GL_MULTISAMPLE_ARB); @@ -763,8 +787,12 @@ BOOL LLWindowSDL::switchContext(BOOL fullscreen, const LLCoordScreen &size, BOOL void LLWindowSDL::destroyContext() { llinfos << "destroyContext begins" << llendl; + #if LL_X11 - quit_x11clipboard(); + mSDL_Display = NULL; + mSDL_XWindowID = None; + Lock_Display = NULL; + Unlock_Display = NULL; #endif // LL_X11 // Clean up remaining GL state before blowing away window @@ -984,11 +1012,7 @@ BOOL LLWindowSDL::isCursorHidden() // Constrains the mouse to the window. void LLWindowSDL::setMouseClipping( BOOL b ) { - //llinfos << "LLWindowSDL::setMouseClipping " << b << llendl; - // Just stash the requested state. We'll simulate this when the cursor is hidden by decoupling. - mIsMouseClipping = b; //SDL_WM_GrabInput(b ? SDL_GRAB_ON : SDL_GRAB_OFF); - adjustCursorDecouple(); } BOOL LLWindowSDL::setCursorPosition(const LLCoordWindow position) @@ -1003,10 +1027,10 @@ BOOL LLWindowSDL::setCursorPosition(const LLCoordWindow position) //llinfos << "setCursorPosition(" << screen_pos.mX << ", " << screen_pos.mY << ")" << llendl; - SDL_WarpMouse(screen_pos.mX, screen_pos.mY); - - // Under certain circumstances, this will trigger us to decouple the cursor. - adjustCursorDecouple(true); + // do the actual forced cursor move. + SDL_WarpMouse(screen_pos.mX, screen_pos.mY); + + //llinfos << llformat("llcw %d,%d -> scr %d,%d", position.mX, position.mY, screen_pos.mX, screen_pos.mY) << llendl; return result; } @@ -1026,33 +1050,6 @@ BOOL LLWindowSDL::getCursorPosition(LLCoordWindow *position) return convertCoords(screen_pos, position); } -void LLWindowSDL::adjustCursorDecouple(bool warpingMouse) -{ - if(mIsMouseClipping && mCursorHidden) - { - if(warpingMouse) - { - // The cursor should be decoupled. Make sure it is. - if(!mCursorDecoupled) - { - // llinfos << "adjustCursorDecouple: decoupling cursor" << llendl; - //CGAssociateMouseAndMouseCursorPosition(false); - mCursorDecoupled = true; - mCursorIgnoreNextDelta = TRUE; - } - } - } - else - { - // The cursor should not be decoupled. Make sure it isn't. - if(mCursorDecoupled) - { - // llinfos << "adjustCursorDecouple: recoupling cursor" << llendl; - //CGAssociateMouseAndMouseCursorPosition(true); - mCursorDecoupled = false; - } - } -} F32 LLWindowSDL::getNativeAspectRatio() { @@ -1212,506 +1209,50 @@ void LLWindowSDL::flashIcon(F32 seconds) #endif // LL_X11 } -#if LL_X11 -/* Lots of low-level X11 stuff to handle X11 copy-and-paste */ - -/* Our X11 clipboard support is a bit bizarre in various - organically-grown ways. Ideally it should be fixed to do - real string-type negotiation (this would make pasting to - xterm faster and pasting to UTF-8 emacs work properly), but - right now it has the rare and desirable trait of being - generally stable and working. */ - -typedef Atom x11clipboard_type; - -/* PRIMARY and CLIPBOARD are the two main kinds of - X11 clipboard. A third are the CUT_BUFFERs which an - obsolete holdover from X10 days and use a quite orthogonal - mechanism. CLIPBOARD is the type whose design most - closely matches SL's own win32-alike explicit copy-and-paste - paradigm. - - Pragmatically we support all three to varying degrees. When - we paste into SL, it is strictly from CLIPBOARD. When we copy, - we support (to as full an extent as the clipboard content type - allows) CLIPBOARD, PRIMARY, and CUT_BUFFER0. - */ -static x11clipboard_type get_x11_readwrite_clipboard_type(void) -{ - return XInternAtom(LLWindowSDL::get_SDL_Display(), "CLIPBOARD", False); -} - -static x11clipboard_type get_x11_write_clipboard_type(void) -{ - return XA_PRIMARY; -} - -/* This is where our own private cutbuffer goes - we don't use - a regular cutbuffer (XA_CUT_BUFFER0 etc) for intermediate - storage because their use isn't really defined for holding UTF8. */ -static x11clipboard_type get_x11_cutbuffer_clipboard_type(void) -{ - return XInternAtom(LLWindowSDL::get_SDL_Display(), "SECONDLIFE_CUTBUFFER", False); -} - -/* Some X11 atom-generators */ -static Atom get_x11_targets_atom(void) -{ - return XInternAtom(LLWindowSDL::get_SDL_Display(), "TARGETS", False); -} - -static Atom get_x11_text_atom(void) -{ - return XInternAtom(LLWindowSDL::get_SDL_Display(), "TEXT", False); -} - -/* These defines, and convert_data/convert_x11clipboard, - mostly exist to support non-text or unusually-encoded - clipboard data, which we don't really have a need for at - the moment. */ -#define SDLCLIPTYPE(A, B, C, D) (int)(((A)<<24)|((B)<<16)|((C)<<8)|((D)<<0)) -#define FORMAT_PREFIX "SECONDLIFE_x11clipboard_0x" -static -x11clipboard_type convert_format(int type) -{ - if (!gWindowImplementation) - { - llwarns << "!gWindowImplementation in convert_format()" - << llendl; - return XA_STRING; - } - - switch (type) - { - case SDLCLIPTYPE('T', 'E', 'X', 'T'): - // old-style X11 clipboard, strictly only ISO 8859-1 encoding - return XA_STRING; - case SDLCLIPTYPE('U', 'T', 'F', '8'): - // newer de-facto UTF8 clipboard atom - return XInternAtom(gWindowImplementation->mSDL_Display, - "UTF8_STRING", False); - default: - { - /* completely arbitrary clipboard types... we don't actually use - these right now, and support is skeletal. */ - char format[sizeof(FORMAT_PREFIX)+8+1]; /* Flawfinder: ignore */ - - snprintf(format, sizeof(format), "%s%08lx", FORMAT_PREFIX, (unsigned long)type); - return XInternAtom(gWindowImplementation->mSDL_Display, - format, False); - } - } -} - -/* convert platform string to x11 clipboard format. for our - purposes this is pretty trivial right now. */ -static int -convert_data(int type, char *dst, const char *src, int srclen) -{ - int dstlen; - - dstlen = 0; - switch (type) - { - case SDLCLIPTYPE('T', 'E', 'X', 'T'): - case SDLCLIPTYPE('U', 'T', 'F', '8'): - if (src == NULL) - { - break; - } - if ( srclen == 0 ) - srclen = strlen(src); /* Flawfinder: ignore */ - - dstlen = srclen + 1; - - if ( dst ) // assume caller made it big enough by asking us - { - memcpy(dst, src, srclen); /* Flawfinder: ignore */ - dst[srclen] = '\0'; - } - break; - - default: - llwarns << "convert_data: Unknown medium type" << llendl; - break; - } - return(dstlen); -} - -/* Convert x11clipboard data to platform string. This too is - pretty trivial for our needs right now, and just about identical - to above. */ -static int -convert_x11clipboard(int type, char *dst, const char *src, int srclen) -{ - int dstlen; - - dstlen = 0; - switch (type) - { - case SDLCLIPTYPE('U', 'T', 'F', '8'): - case SDLCLIPTYPE('T', 'E', 'X', 'T'): - if (src == NULL) - { - break; - } - if ( srclen == 0 ) - srclen = strlen(src); /* Flawfinder: ignore */ - - dstlen = srclen + 1; - - if ( dst ) // assume caller made it big enough by asking us - { - memcpy(dst, src, srclen); /* Flawfinder: ignore */ - dst[srclen] = '\0'; - } - break; - - default: - llwarns << "convert_x11clipboard: Unknown medium type" << llendl; - break; - } - return dstlen; -} - -int -LLWindowSDL::is_empty_x11clipboard(void) -{ - int retval; - - maybe_lock_display(); - retval = ( XGetSelectionOwner(mSDL_Display, get_x11_readwrite_clipboard_type()) == None ); - maybe_unlock_display(); - - return(retval); -} - -void -LLWindowSDL::put_x11clipboard(int type, int srclen, const char *src) +#if LL_GTK +BOOL LLWindowSDL::isClipboardTextAvailable() { - x11clipboard_type format; - int dstlen; - char *dst; - - format = convert_format(type); - dstlen = convert_data(type, NULL, src, srclen); - - dst = (char *)malloc(dstlen); - if ( dst != NULL ) + if (ll_try_gtk_init()) { - maybe_lock_display(); - Window root = DefaultRootWindow(mSDL_Display); - convert_data(type, dst, src, srclen); - // Cutbuffers are only allowed to have STRING atom types, - // but Emacs puts UTF8 inside them anyway. We cautiously - // don't. - if (type == SDLCLIPTYPE('T','E','X','T')) - { - // dstlen-1 so we don't include the trailing \0 - llinfos << "X11: Populating cutbuffer." <event.xevent; - - if ( (xevent.type == SelectionNotify)&& - (xevent.xselection.requestor == owner) ) - selection_response = 1; - } - } else { - llinfos << "X11: Waiting for SYSWM event..." << llendl; - } - } - llinfos << "X11: Clipboard arrived." <type != SDL_SYSWMEVENT ) - { - return(1); - } - - /* Handle window-manager specific clipboard events */ - switch (event->syswm.msg->event.xevent.type) { - /* Copy the selection from SECONDLIFE_CUTBUFFER to the requested property */ - case SelectionRequest: { - XSelectionRequestEvent *req; - XEvent sevent; - int seln_format; - unsigned long nbytes; - unsigned long overflow; - unsigned char *seln_data; - - req = &event->syswm.msg->event.xevent.xselectionrequest; - sevent.xselection.type = SelectionNotify; - sevent.xselection.display = req->display; - sevent.xselection.selection = req->selection; - sevent.xselection.target = None; - sevent.xselection.property = None; - sevent.xselection.requestor = req->requestor; - sevent.xselection.time = req->time; - if ( XGetWindowProperty(LLWindowSDL::get_SDL_Display(), DefaultRootWindow(LLWindowSDL::get_SDL_Display()), - get_x11_cutbuffer_clipboard_type(), 0, INT_MAX/4, False, req->target, - &sevent.xselection.target, &seln_format, - &nbytes, &overflow, &seln_data) == Success ) - { - if ( sevent.xselection.target == req->target) - { - if ( sevent.xselection.target == XA_STRING || - sevent.xselection.target == - convert_format(SDLCLIPTYPE('U','T','F','8')) ) - { - if ( seln_data[nbytes-1] == '\0' ) - --nbytes; - } - XChangeProperty(LLWindowSDL::get_SDL_Display(), req->requestor, req->property, - req->target, seln_format, PropModeReplace, - seln_data, nbytes); - sevent.xselection.property = req->property; - } else if (get_x11_targets_atom() == req->target) { - /* only advertise what we currently support */ - const int num_supported = 3; - Atom supported[num_supported] = { - XA_STRING, // will be over-written below - get_x11_text_atom(), - get_x11_targets_atom() - }; - supported[0] = sevent.xselection.target; - XChangeProperty(LLWindowSDL::get_SDL_Display(), req->requestor, - req->property, XA_ATOM, 32, PropModeReplace, - (unsigned char*)supported, - num_supported); - sevent.xselection.property = req->property; - llinfos << "Clipboard: An app asked us what selections format we offer." << llendl; - } else { - llinfos << "Clipboard: An app requested an unsupported selection format " << req->target << ", we have " << sevent.xselection.target << llendl; - sevent.xselection.target = None; - } - XFree(seln_data); + text = LLWString(utf8str_to_wstring(data)); + g_free(data); + return TRUE; } - int sendret = - XSendEvent(LLWindowSDL::get_SDL_Display(),req->requestor,False,0,&sevent); - if ((sendret==BadValue) || (sendret==BadWindow)) - llwarns << "Clipboard SendEvent failed" << llendl; - XSync(LLWindowSDL::get_SDL_Display(), False); } - break; - } - - /* Post the event for X11 clipboard reading above */ - return(1); + return FALSE; // failure } -int -LLWindowSDL::init_x11clipboard(void) +BOOL LLWindowSDL::copyTextToClipboard(const LLWString &text) { - SDL_SysWMinfo info; - int retval; - - /* Grab the window manager specific information */ - retval = -1; - SDL_SetError("SDL is not running on known window manager"); - - SDL_VERSION(&info.version); - if ( SDL_GetWMInfo(&info) ) + if (ll_try_gtk_init()) { - /* Save the information for later use */ - if ( info.subsystem == SDL_SYSWM_X11 ) - { - mSDL_Display = info.info.x11.display; - mSDL_XWindowID = info.info.x11.wmwindow; - Lock_Display = info.info.x11.lock_func; - Unlock_Display = info.info.x11.unlock_func; - - /* Enable the special window hook events */ - SDL_EventState(SDL_SYSWMEVENT, SDL_ENABLE); - SDL_SetEventFilter(clipboard_filter_callback); - - retval = 0; - } - else - { - SDL_SetError("SDL is not running on X11"); - } - } - return(retval); -} - -void -LLWindowSDL::quit_x11clipboard(void) -{ - mSDL_Display = NULL; - mSDL_XWindowID = None; - Lock_Display = NULL; - Unlock_Display = NULL; - - SDL_SetEventFilter(NULL); // Stop custom event filtering -} - -/************************************************/ - -BOOL LLWindowSDL::isClipboardTextAvailable() -{ - return !is_empty_x11clipboard(); -} - -BOOL LLWindowSDL::pasteTextFromClipboard(LLWString &dst) -{ - int cliplen; // seems 1 or 2 bytes longer than expected - char *cliptext = NULL; - get_x11clipboard(SDLCLIPTYPE('U','T','F','8'), &cliplen, &cliptext); - if (cliptext) - { - llinfos << "X11: Got UTF8 clipboard text." << llendl; - // at some future time we can use cliplen instead of relying on \0, - // if we ever grok non-ascii, non-utf8 encodings on the clipboard. - std::string clip_str(cliptext); - // we can't necessarily trust the incoming text to be valid UTF-8, - // but utf8str_to_wstring() seems to do an appropriate level of - // validation for avoiding over-reads. - dst = utf8str_to_wstring(clip_str); - /*llinfos << "X11 pasteTextFromClipboard: cliplen=" << cliplen << - " strlen(cliptext)=" << strlen(cliptext) << - " clip_str.length()=" << clip_str.length() << - " dst.length()=" << dst.length() << - llendl;*/ - free(cliptext); - return TRUE; // success - } - get_x11clipboard(SDLCLIPTYPE('T','E','X','T'), &cliplen, &cliptext); - if (cliptext) - { - llinfos << "X11: Got ISO 8859-1 clipboard text." << llendl; - std::string clip_str(cliptext); - std::string utf8_str = rawstr_to_utf8(clip_str); - dst = utf8str_to_wstring(utf8_str); - free(cliptext); + const std::string utf8 = wstring_to_utf8str(text); + GtkClipboard * const clipboard = + gtk_clipboard_get(GDK_NONE); + gtk_clipboard_set_text(clipboard, utf8.c_str(), utf8.length()); + return TRUE; } return FALSE; // failure } -BOOL LLWindowSDL::copyTextToClipboard(const LLWString &s) -{ - std::string utf8text = wstring_to_utf8str(s); - const char* cstr = utf8text.c_str(); - if (cstr == NULL) - { - return FALSE; - } - int cstrlen = strlen(cstr); /* Flawfinder: ignore */ - int i; - for (i=0; ihandleMouseDown(this, openGlCoord, mask); } - else if (event.button.button == SDL_BUTTON_RIGHT) // right ... yes, it's 3, not 2, in SDL... + else if (event.button.button == SDL_BUTTON_RIGHT) // right { - // right double click isn't handled right now in Second Life ... if (isDoubleClick) - mCallbacks->handleRightMouseDown(this, openGlCoord, mask); + mCallbacks->handleRightMouseDown(this, openGlCoord, mask); } else if (event.button.button == SDL_BUTTON_MIDDLE) // middle @@ -2112,13 +1654,11 @@ void LLWindowSDL::gatherInput() MASK mask = gKeyboard->currentMask(TRUE); if (event.button.button == SDL_BUTTON_LEFT) // left - mCallbacks->handleMouseUp(this, openGlCoord, mask); - else if (event.button.button == SDL_BUTTON_RIGHT) // right ... yes, it's 3, not 2, in SDL... - mCallbacks->handleRightMouseUp(this, openGlCoord, mask); + mCallbacks->handleMouseUp(this, openGlCoord, mask); + else if (event.button.button == SDL_BUTTON_RIGHT) // right + mCallbacks->handleRightMouseUp(this, openGlCoord, mask); else if (event.button.button == SDL_BUTTON_MIDDLE) // middle - { mCallbacks->handleMiddleMouseUp(this, openGlCoord, mask); - } // don't handle mousewheel here... break; @@ -2426,8 +1966,6 @@ void LLWindowSDL::hideCursor() { // llinfos << "hideCursor: already hidden" << llendl; } - - adjustCursorDecouple(); } void LLWindowSDL::showCursor() @@ -2443,8 +1981,6 @@ void LLWindowSDL::showCursor() { // llinfos << "showCursor: already visible" << llendl; } - - adjustCursorDecouple(); } void LLWindowSDL::showCursorFromMouseMove() diff --git a/indra/llwindow/llwindowsdl.h b/indra/llwindow/llwindowsdl.h index 091b0de1e0..52afea71ae 100644 --- a/indra/llwindow/llwindowsdl.h +++ b/indra/llwindow/llwindowsdl.h @@ -123,7 +123,6 @@ public: // Not great that these are public, but they have to be accessible // by non-class code and it's better than making them global. #if LL_X11 - // These are set up by the X11 clipboard initialization code Window mSDL_XWindowID; Display *mSDL_Display; #endif @@ -173,7 +172,6 @@ protected: BOOL createContext(int x, int y, int width, int height, int bits, BOOL fullscreen, BOOL disable_vsync); void destroyContext(); void setupFailure(const std::string& text, const std::string& caption, U32 type); - void adjustCursorDecouple(bool warpingMouse = false); void fixWindowSize(void); U32 SDLCheckGrabbyKeys(SDLKey keysym, BOOL gain); BOOL SDLReallyCaptureInput(BOOL capture); @@ -186,10 +184,6 @@ protected: SDL_Surface * mWindow; std::string mWindowTitle; double mOriginalAspectRatio; - BOOL mCursorDecoupled; - S32 mCursorLastEventDeltaX; - S32 mCursorLastEventDeltaY; - BOOL mCursorIgnoreNextDelta; BOOL mNeedsResize; // Constructor figured out the window is too big, it needs a resize. LLCoordScreen mNeedsResizeSize; F32 mOverrideAspectRatio; @@ -206,12 +200,6 @@ protected: #if LL_X11 private: - // more X11 clipboard stuff - int init_x11clipboard(void); - void quit_x11clipboard(void); - int is_empty_x11clipboard(void); - void put_x11clipboard(int type, int srclen, const char *src); - void get_x11clipboard(int type, int *dstlen, char **dst); void x11_set_urgent(BOOL urgent); BOOL mFlashing; LLTimer mFlashTimer; diff --git a/indra/newview/CMakeLists.txt b/indra/newview/CMakeLists.txt index 4dd4c74ea3..e62e4be0f1 100644 --- a/indra/newview/CMakeLists.txt +++ b/indra/newview/CMakeLists.txt @@ -9,6 +9,7 @@ include(DBusGlib) include(DirectX) include(ELFIO) include(FMOD) +include(OPENAL) include(FindOpenGL) include(LLAudio) include(LLCharacter) @@ -1257,8 +1258,12 @@ if (WINDOWS) list(APPEND viewer_SOURCE_FILES ${viewer_INSTALLER_FILES}) endif (WINDOWS) +if (OPENAL) + set(LLSTARTUP_COMPILE_FLAGS "${LLSTARTUP_COMPILE_FLAGS} -DLL_OPENAL") +endif (OPENAL) + if (FMOD) - set_source_files_properties(llstartup.cpp PROPERTIES COMPILE_FLAGS -DLL_FMOD) + set(LLSTARTUP_COMPILE_FLAGS "${LLSTARTUP_COMPILE_FLAGS} -DLL_FMOD") if (NOT WINDOWS) set(fmodwrapper_SOURCE_FILES fmodwrapper.cpp) @@ -1278,6 +1283,8 @@ if (FMOD) endif (NOT WINDOWS) endif (FMOD) +set_source_files_properties(llstartup.cpp PROPERTIES COMPILE_FLAGS "${LLSTARTUP_COMPILE_FLAGS}") + list(APPEND viewer_SOURCE_FILES ${viewer_HEADER_FILES}) set_source_files_properties(${viewer_HEADER_FILES} diff --git a/indra/newview/app_settings/settings.xml b/indra/newview/app_settings/settings.xml index 62bc827bb1..e6943869db 100644 --- a/indra/newview/app_settings/settings.xml +++ b/indra/newview/app_settings/settings.xml @@ -2611,9 +2611,9 @@ Rect Value - 50 + 0 220 - 450 + 700 0 @@ -2627,9 +2627,9 @@ Rect Value - 50 - 220 - 450 + 0 + 240 + 700 0 @@ -2819,9 +2819,9 @@ Rect Value - 50 - 450 - 300 + 0 + 646 + 275 0 @@ -2835,9 +2835,9 @@ Rect Value - 50 + 0 150 - 650 + 600 0 @@ -4769,6 +4769,17 @@ Value 410 + MigrateCacheDirectory + + Comment + Check for old version of disk cache to migrate to current location + Persist + 1 + Type + Boolean + Value + 1 + MiniMapRotate Comment diff --git a/indra/newview/app_settings/settings_files.xml b/indra/newview/app_settings/settings_files.xml index 997bb0c33c..ec55745358 100644 --- a/indra/newview/app_settings/settings_files.xml +++ b/indra/newview/app_settings/settings_files.xml @@ -1,22 +1,91 @@ - Files + Locations + + + Comment + List location from which to load files, and the rules about loading those files. + Persist + 0 + Type + LLSD + Value + + Default - Comment - List of settings files to load. Key is the identifier, value is the filename - Persist - 0 - Type - LLSD - Value - - Global - settings.xml - PerAccount - settings_per_account.xml - CrashSettings - settings_crash_behavior.xml - - + PathIndex + 2 + Files + + Global + + Name + settings.xml + Requirement + 1 + + PerAccount + + Name + settings_per_account.xml + Requirement + 1 + + CrashSettings + + Name + settings_crash_behavior.xml + Requirement + 1 + + + + User + + PathIndex + 1 + Files + + Global + + Name + settings.xml + NameFromSetting + ClientSettingsFile + + CrashSettings + + Name + settings_crash_behavior.xml + + + + Account + + PathIndex + 3 + Files + + PerAccount + + Name + settings_per_account.xml + + + + + diff --git a/indra/newview/installers/windows/installer_template.nsi b/indra/newview/installers/windows/installer_template.nsi index 495012aac2..0a68d6badc 100644 --- a/indra/newview/installers/windows/installer_template.nsi +++ b/indra/newview/installers/windows/installer_template.nsi @@ -371,9 +371,11 @@ Push $2 StrCmp $INSTFLAGS "" RM_ALL RM_CACHE RM_ALL: RMDir /r "$2\Application Data\SecondLife" - GoTo CONTINUE RM_CACHE: - RMDir /r "$2\Application Data\SecondLife\Cache" + # Local Settings directory is the cache, there is no "cache" subdir + RMDir /r "$2\Local Settings\Application Data\SecondLife" + # Vista version of the same + RMDir /r "$2\AppData\Local\SecondLife" Delete "$2\Application Data\SecondLife\user_settings\settings_windlight.xml" CONTINUE: diff --git a/indra/newview/linux_tools/client-readme-voice.txt b/indra/newview/linux_tools/client-readme-voice.txt index 7754a3a734..23a42f484b 100644 --- a/indra/newview/linux_tools/client-readme-voice.txt +++ b/indra/newview/linux_tools/client-readme-voice.txt @@ -21,15 +21,13 @@ REQUIREMENTS Success with Linux Voice support has been reported on the following systems: -* Ubuntu 7.04 (Feisty) with USB Plantronics headset -* Ubuntu 7.04 (Feisty) with Intel HDA audio chipset * Ubuntu 6.06 (Dapper) with Intel ICH5/CMI9761A+ audio chipset * Ubuntu 6.06 (Dapper) with SigmaTel STAC2997 audio chipset -* Fedora Core 6 with (unknown) audio chipset - -Problems with Linux Voice support have been reported on the following -systems: * Ubuntu 6.06 (Dapper) with Creative EMU10K1 audio chipset +* Ubuntu 7.04 (Feisty) with USB Plantronics headset +* Ubuntu 7.04 (Feisty) with Intel HDA audio chipset +* Fedora Core 6 with (unknown) audio chipset +* Ubuntu 8.04 (Hardy) with (unknown) audio chipset KNOWN PROBLEMS -=-=-=-=-=-=-= diff --git a/indra/newview/linux_tools/client-readme.txt b/indra/newview/linux_tools/client-readme.txt index c4e193bd9b..543a7a1881 100644 --- a/indra/newview/linux_tools/client-readme.txt +++ b/indra/newview/linux_tools/client-readme.txt @@ -15,7 +15,7 @@ Life itself - please see . 5.3. Blank window after minimizing it 5.4. Audio 5.5. 'Alt' key for camera controls doesn't work - 5.6. In-world movie playback + 5.6. In-world streaming movie/music playback 6. Advanced Troubleshooting 6.1. Audio 6.2. OpenGL @@ -173,11 +173,11 @@ SOLUTION:- Some window managers eat the Alt key for their own purposes; you example, the 'Windows' key!) which will allow the Alt key to function properly with mouse actions in Second Life and other applications. -PROBLEM 6:- In-world movie playback doesn't work for me. +PROBLEM 6:- In-world movie and/or music playback doesn't work for me. SOLUTION:- You need to have a working installation of GStreamer 0.10; this is usually an optional package for most versions of Linux. If you have - installed GStreamer 0.10 and you can play some movies but not others then - you need to install a wider selection of GStreamer plugins, either + installed GStreamer 0.10 and you can play some music/movies but not others + then you need to install a wider selection of GStreamer plugins, either from your vendor or an appropriate third party. @@ -187,11 +187,11 @@ SOLUTION:- You need to have a working installation of GStreamer 0.10; this The 'secondlife' script which launches Second Life contains some configuration options for advanced troubleshooters. -* AUDIO - Edit the 'secondlife' script and you will see three audio - options: LL_BAD_ESD, LL_BAD_OSS, LL_BAD_ALSA. Second Life tries to - use ESD, OSS, then ALSA audio drivers in this order; you may uncomment - the corresponding LL_BAD_* option to skip an audio driver which you - believe may be causing you trouble. +* AUDIO - Edit the 'secondlife' script and you will see these audio + options: LL_BAD_OPENAL_DRIVER, LL_BAD_FMOD_ESD, LL_BAD_FMOD_OSS, and + LL_BAD_FMOD_ALSA. Second Life tries to use OpenAL, ESD, OSS, then ALSA + audio drivers in this order; you may uncomment the corresponding LL_BAD_* + option to skip an audio driver which you believe may be causing you trouble. * OPENGL - For advanced troubleshooters, the LL_GL_BLACKLIST option lets you disable specific GL extensions, each of which is represented by a diff --git a/indra/newview/linux_tools/wrapper.sh b/indra/newview/linux_tools/wrapper.sh index 9d2e06b31e..d7b17edbc3 100755 --- a/indra/newview/linux_tools/wrapper.sh +++ b/indra/newview/linux_tools/wrapper.sh @@ -4,14 +4,17 @@ ## These options are for self-assisted troubleshooting during this beta ## testing phase; you should not usually need to touch them. -## - Avoids using the ESD audio driver. -#export LL_BAD_ESD=x - -## - Avoids using the OSS audio driver. -#export LL_BAD_OSS=x - -## - Avoids using the ALSA audio driver. -#export LL_BAD_ALSA=x +## - Avoids using any OpenAL audio driver. +#export LL_BAD_OPENAL_DRIVER=x +## - Avoids using any FMOD audio driver. +#export LL_BAD_FMOD_DRIVER=x + +## - Avoids using the FMOD ESD audio driver. +#export LL_BAD_FMOD_ESD=x +## - Avoids using the FMOD OSS audio driver. +#export LL_BAD_FMOD_OSS=x +## - Avoids using the FMOD ALSA audio driver. +#export LL_BAD_FMOD_ALSA=x ## - Avoids the optional OpenGL extensions which have proven most problematic ## on some hardware. Disabling this option may cause BETTER PERFORMANCE but diff --git a/indra/newview/llagent.cpp b/indra/newview/llagent.cpp index 0fa680e753..ab2f06ef53 100644 --- a/indra/newview/llagent.cpp +++ b/indra/newview/llagent.cpp @@ -36,6 +36,7 @@ #include "llagent.h" +#include "llcamera.h" #include "llcoordframe.h" #include "indra_constants.h" #include "llmath.h" @@ -270,35 +271,42 @@ void LLAgentFriendObserver::changed(U32 mask) //----------------------------------------------------------------------------- // LLAgent() //----------------------------------------------------------------------------- -LLAgent::LLAgent() -: mDrawDistance( DEFAULT_FAR_PLANE ), +LLAgent::LLAgent() : + mDrawDistance( DEFAULT_FAR_PLANE ), - mDoubleTapRunTimer(), - mDoubleTapRunMode(DOUBLETAP_NONE), - - mbAlwaysRun(false), - mbRunning(false), - - mAccess(SIM_ACCESS_PG), mGroupPowers(0), + mHideGroupTitle(FALSE), mGroupID(), - //mGroupInsigniaID(), - mMapOriginX(0), - mMapOriginY(0), + + mMapOriginX(0.F), + mMapOriginY(0.F), mMapWidth(0), mMapHeight(0), + mLookAt(NULL), mPointAt(NULL), + + mHUDTargetZoom(1.f), + mHUDCurZoom(1.f), mInitialized(FALSE), mNumPendingQueries(0), + mActiveCacheQueries(NULL), mForceMouselook(FALSE), + + mDoubleTapRunTimer(), + mDoubleTapRunMode(DOUBLETAP_NONE), + + mbAlwaysRun(false), + mbRunning(false), + + mAccess(SIM_ACCESS_PG), mTeleportState( TELEPORT_NONE ), mRegionp(NULL), mAgentOriginGlobal(), mPositionGlobal(), - mDistanceTraveled(0), + mDistanceTraveled(0.F), mLastPositionGlobal(LLVector3d::zero), mAvatarObject(NULL), @@ -310,43 +318,68 @@ LLAgent::LLAgent() mLastCameraMode( CAMERA_MODE_THIRD_PERSON ), mViewsPushed(FALSE), + mCustomAnim(FALSE), mShowAvatar(TRUE), - mCameraAnimating( FALSE ), mAnimationCameraStartGlobal(), mAnimationFocusStartGlobal(), mAnimationTimer(), mAnimationDuration(0.33f), + mCameraFOVZoomFactor(0.f), mCameraCurrentFOVZoomFactor(0.f), mCameraFocusOffset(), + mCameraFOVDefault(DEFAULT_FIELD_OF_VIEW), + mCameraOffsetDefault(), -// mCameraOffsetNorm(), mCameraCollidePlane(), + mCurrentCameraDistance(2.f), // meters, set in init() mTargetCameraDistance(2.f), mCameraZoomFraction(1.f), // deprecated mThirdPersonHeadOffset(0.f, 0.f, 1.f), mSitCameraEnabled(FALSE), - mHUDTargetZoom(1.f), - mHUDCurZoom(1.f), + mCameraSmoothingLastPositionGlobal(), + mCameraSmoothingLastPositionAgent(), + mCameraSmoothingStop(FALSE), + + mCameraUpVector(LLVector3::z_axis), // default is straight up + mFocusOnAvatar(TRUE), mFocusGlobal(), mFocusTargetGlobal(), mFocusObject(NULL), + mFocusObjectDist(0.f), mFocusObjectOffset(), mFocusDotRadius( 0.1f ), // meters mTrackFocusObject(TRUE), - mCameraSmoothingLastPositionGlobal(), - mCameraSmoothingLastPositionAgent(), - mCameraSmoothingStop(FALSE), + mUIOffset(0.f), mFrameAgent(), mCrouching(FALSE), mIsBusy(FALSE), - // movement keys below + mAtKey(0), // Either 1, 0, or -1... indicates that movement-key is pressed + mWalkKey(0), // like AtKey, but causes less forward thrust + mLeftKey(0), + mUpKey(0), + mYawKey(0.f), + mPitchKey(0), + + mOrbitLeftKey(0.f), + mOrbitRightKey(0.f), + mOrbitUpKey(0.f), + mOrbitDownKey(0.f), + mOrbitInKey(0.f), + mOrbitOutKey(0.f), + + mPanUpKey(0.f), + mPanDownKey(0.f), + mPanLeftKey(0.f), + mPanRightKey(0.f), + mPanInKey(0.f), + mPanOutKey(0.f), mControlFlags(0x00000000), mbFlagsDirty(FALSE), @@ -361,27 +394,29 @@ LLAgent::LLAgent() mAutoPilotUseRotation(FALSE), mAutoPilotTargetFacing(LLVector3::zero), mAutoPilotTargetDist(0.f), + mAutoPilotNoProgressFrameCount(0), + mAutoPilotRotationThreshold(0.f), mAutoPilotFinishedCallback(NULL), mAutoPilotCallbackData(NULL), - mEffectColor(0.f, 1.f, 1.f, 1.f), + mHaveHomePosition(FALSE), mHomeRegionHandle( 0 ), mNearChatRadius(CHAT_NORMAL_RADIUS / 2.f), - mGodLevel( GOD_NOT ), - + mAdminOverride(FALSE), + mGodLevel( GOD_NOT ), mNextFidgetTime(0.f), mCurrentFidget(0), mFirstLogin(FALSE), mGenderChosen(FALSE), + mAgentWearablesUpdateSerialNum(0), mWearablesLoaded(FALSE), mTextureCacheQueryID(0), mAppearanceSerialNum(0) { - U32 i; for (i = 0; i < TOTAL_CONTROLS; i++) { @@ -389,40 +424,13 @@ LLAgent::LLAgent() mControlsTakenPassedOnCount[i] = 0; } - // Initialize movement keys - mAtKey = 0; // Either 1, 0, or -1... indicates that movement-key is pressed - mWalkKey = 0; // like AtKey, but causes less forward thrust - mLeftKey = 0; - mUpKey = 0; - mYawKey = 0.f; - mPitchKey = 0; - - mOrbitLeftKey = 0.f; - mOrbitRightKey = 0.f; - mOrbitUpKey = 0.f; - mOrbitDownKey = 0.f; - mOrbitInKey = 0.f; - mOrbitOutKey = 0.f; - - mPanUpKey = 0.f; - mPanDownKey = 0.f; - mPanLeftKey = 0.f; - mPanRightKey = 0.f; - mPanInKey = 0.f; - mPanOutKey = 0.f; - mActiveCacheQueries = new S32[BAKED_TEXTURE_COUNT]; for (i = 0; i < (U32)BAKED_TEXTURE_COUNT; i++) { mActiveCacheQueries[i] = 0; } - //Ventrella - mCameraUpVector = LLVector3::z_axis;// default is straight up mFollowCam.setMaxCameraDistantFromSubject( MAX_CAMERA_DISTANCE_FROM_AGENT ); - //end ventrella - - mCustomAnim = FALSE ; } // Requires gSavedSettings to be initialized. @@ -3255,7 +3263,7 @@ void LLAgent::updateCamera() } // smoothing - if (TRUE) + if (TRUE) { LLVector3d agent_pos = getPositionGlobal(); LLVector3d camera_pos_agent = camera_pos_global - agent_pos; diff --git a/indra/newview/llagent.h b/indra/newview/llagent.h index f6d983b3a3..e8537f2fba 100644 --- a/indra/newview/llagent.h +++ b/indra/newview/llagent.h @@ -795,10 +795,7 @@ private: LLVector3d mCameraSmoothingLastPositionAgent; BOOL mCameraSmoothingStop; - - //Ventrella LLVector3 mCameraUpVector; // camera's up direction in world coordinates (determines the 'roll' of the view) - //End Ventrella LLPointer mSitCameraReferenceObject; // object to which camera is related when sitting diff --git a/indra/newview/llappviewer.cpp b/indra/newview/llappviewer.cpp index 0ee3b148d0..5699ac42e2 100644 --- a/indra/newview/llappviewer.cpp +++ b/indra/newview/llappviewer.cpp @@ -423,7 +423,7 @@ static void settings_modify() LLRenderTarget::sUseFBO = gSavedSettings.getBOOL("RenderUseFBO"); LLVOAvatar::sUseImpostors = gSavedSettings.getBOOL("RenderUseImpostors"); LLVOSurfacePatch::sLODFactor = gSavedSettings.getF32("RenderTerrainLODFactor"); - LLVOSurfacePatch::sLODFactor *= LLVOSurfacePatch::sLODFactor; //sqaure lod factor to get exponential range of [1,4] + LLVOSurfacePatch::sLODFactor *= LLVOSurfacePatch::sLODFactor; //square lod factor to get exponential range of [1,4] gDebugGL = gSavedSettings.getBOOL("RenderDebugGL"); gDebugPipeline = gSavedSettings.getBOOL("RenderDebugPipeline"); @@ -1166,16 +1166,26 @@ bool LLAppViewer::cleanup() llinfos << "Global stuff deleted" << llendflush; -#if !LL_RELEASE_FOR_DOWNLOAD if (gAudiop) { - gAudiop->shutdown(); +#if LL_RELEASE_FOR_DOWNLOAD + bool want_longname = false; + if (gAudiop->getDriverName(want_longname) == "FMOD") + { + // This hack exists because fmod likes to occasionally + // hang forever when shutting down, for no apparent + // reason. + llwarns << "Hack, skipping FMOD audio engine cleanup" << llendflush; + } + else +#endif // LL_RELEASE_FOR_DOWNLOAD + { + gAudiop->shutdown(); + } + + delete gAudiop; + gAudiop = NULL; } -#else - // This hack exists because fmod likes to occasionally hang forever - // when shutting down for no apparent reason. - llwarns << "Hack, skipping audio engine cleanup" << llendflush; -#endif // Note: this is where LLFeatureManager::getInstance()-> used to be deleted. @@ -1186,9 +1196,6 @@ bool LLAppViewer::cleanup() cleanupSavedSettings(); llinfos << "Settings patched up" << llendflush; - delete gAudiop; - gAudiop = NULL; - // delete some of the files left around in the cache. removeCacheFiles("*.wav"); removeCacheFiles("*.tmp"); @@ -1476,46 +1483,78 @@ bool LLAppViewer::initLogging() return true; } -bool LLAppViewer::loadSettingsFromDirectory(ELLPath path_index, bool set_defaults) +bool LLAppViewer::loadSettingsFromDirectory(const std::string& location_key, + bool set_defaults) { - for(LLSD::map_iterator itr = mSettingsFileList.beginMap(); itr != mSettingsFileList.endMap(); ++itr) + // Find and vet the location key. + if(!mSettingsLocationList.has(location_key)) { - std::string settings_name = (*itr).first; - std::string settings_file = mSettingsFileList[settings_name].asString(); + llerrs << "Requested unknown location: " << location_key << llendl; + return false; + } + + LLSD location = mSettingsLocationList.get(location_key); - std::string full_settings_path = gDirUtilp->getExpandedFilename(path_index, settings_file); + if(!location.has("PathIndex")) + { + llerrs << "Settings location is missing PathIndex value. Settings cannot be loaded." << llendl; + return false; + } + ELLPath path_index = (ELLPath)(location.get("PathIndex").asInteger()); + if(path_index <= LL_PATH_NONE || path_index >= LL_PATH_LAST) + { + llerrs << "Out of range path index in app_settings/settings_files.xml" << llendl; + return false; + } - if(settings_name == sGlobalSettingsName - && path_index == LL_PATH_USER_SETTINGS) + // Iterate through the locations list of files. + LLSD files = location.get("Files"); + for(LLSD::map_iterator itr = files.beginMap(); itr != files.endMap(); ++itr) + { + std::string settings_group = (*itr).first; + llinfos << "Attempting to load settings for the group " << settings_group + << " - from location " << location_key << llendl; + + if(gSettings.find(settings_group) == gSettings.end()) { - // The non-persistent setting, ClientSettingsFile, specifies a - // custom name to use for the global settings file. - // Only apply this setting if this method is setting the 'Global' - // settings from the user_settings path. - std::string custom_path; - if(gSettings[sGlobalSettingsName]->controlExists("ClientSettingsFile")) - { - custom_path = - gSettings[sGlobalSettingsName]->getString("ClientSettingsFile"); - } - if(!custom_path.empty()) + llwarns << "No matching settings group for name " << settings_group << llendl; + continue; + } + + LLSD file = (*itr).second; + + std::string full_settings_path; + if(file.has("NameFromSetting")) + { + std::string custom_name_setting = file.get("NameFromSetting"); + // *NOTE: Regardless of the group currently being lodaed, + // this setting is always read from the Global settings. + if(gSettings[sGlobalSettingsName]->controlExists(custom_name_setting)) { - full_settings_path = custom_path; + std::string file_name = + gSettings[sGlobalSettingsName]->getString(custom_name_setting); + full_settings_path = file_name; } } - if(gSettings.find(settings_name) == gSettings.end()) + if(full_settings_path.empty()) { - llwarns << "Cannot load " << settings_file << " - No matching settings group for name " << settings_name << llendl; - continue; + std::string file_name = file.get("Name"); + full_settings_path = gDirUtilp->getExpandedFilename(path_index, file_name); } - if(!gSettings[settings_name]->loadFromFile(full_settings_path, set_defaults)) + + int requirement = 0; + if(file.has("Requirement")) { - // If attempting to load the default global settings (app_settings/settings.xml) - // fails, the app should error and quit. - if(path_index == LL_PATH_APP_SETTINGS && settings_name == sGlobalSettingsName) + requirement = file.get("Requirement").asInteger(); + } + + if(!gSettings[settings_group]->loadFromFile(full_settings_path, set_defaults)) + { + if(requirement == 1) { - llwarns << "Error: Cannot load default settings from: " << full_settings_path << llendl; + llwarns << "Error: Cannot load required settings file from: " + << full_settings_path << llendl; return false; } else @@ -1528,14 +1567,24 @@ bool LLAppViewer::loadSettingsFromDirectory(ELLPath path_index, bool set_default llinfos << "Loaded settings file " << full_settings_path << llendl; } } + return true; } -std::string LLAppViewer::getSettingsFileName(const std::string& file) +std::string LLAppViewer::getSettingsFilename(const std::string& location_key, + const std::string& file) { - if(mSettingsFileList.has(file)) + if(mSettingsLocationList.has(location_key)) { - return mSettingsFileList[file].asString(); + LLSD location = mSettingsLocationList.get(location_key); + if(location.has("Files")) + { + LLSD files = location.get("Files"); + if(files.has(file) && files[file].has("Name")) + { + return files.get(file).get("Name").asString(); + } + } } return std::string(); } @@ -1556,8 +1605,8 @@ bool LLAppViewer::initConfiguration() llerrs << "Cannot load default configuration file " << settings_file_list << llendl; } - mSettingsFileList = settings_control.getLLSD("Files"); - + mSettingsLocationList = settings_control.getLLSD("Locations"); + // The settings and command line parsing have a fragile // order-of-operation: // - load defaults from app_settings @@ -1570,11 +1619,11 @@ bool LLAppViewer::initConfiguration() // - load defaults bool set_defaults = true; - if(!loadSettingsFromDirectory(LL_PATH_APP_SETTINGS, set_defaults)) + if(!loadSettingsFromDirectory("Default", set_defaults)) { std::ostringstream msg; msg << "Second Life could not load its default settings file. \n" - << "The installation may be corrupted. \n"; + << "The installation may be corrupted. \n"; OSMessageBox( msg.str(), @@ -1586,7 +1635,7 @@ bool LLAppViewer::initConfiguration() // - set procedural settings gSavedSettings.setString("ClientSettingsFile", - gDirUtilp->getExpandedFilename(LL_PATH_USER_SETTINGS, getSettingsFileName("Global"))); + gDirUtilp->getExpandedFilename(LL_PATH_USER_SETTINGS, getSettingsFilename("Default", "Global"))); gSavedSettings.setString("VersionChannelName", LL_CHANNEL); @@ -1700,7 +1749,7 @@ bool LLAppViewer::initConfiguration() } // - load overrides from user_settings - loadSettingsFromDirectory(LL_PATH_USER_SETTINGS); + loadSettingsFromDirectory("User"); #if LL_DYNAMIC_FONT_DISCOVERY // Linux does *dynamic* font discovery which is preferable to @@ -2622,6 +2671,75 @@ void LLAppViewer::abortQuit() mQuitRequested = false; } +void LLAppViewer::migrateCacheDirectory() +{ +#if LL_WINDOWS || LL_DARWIN + // NOTE: (Nyx) as of 1.21, cache for mac is moving to /library/caches/SecondLife from + // /library/application support/SecondLife/cache This should clear/delete the old dir. + + // As of 1.23 the Windows cache moved from + // C:\Documents and Settings\James\Application Support\SecondLife\cache + // to + // C:\Documents and Settings\James\Local Settings\Application Support\SecondLife + // + // The Windows Vista equivalent is from + // C:\Users\James\AppData\Roaming\SecondLife\cache + // to + // C:\Users\James\AppData\Local\SecondLife + // + // Note the absence of \cache on the second path. James. + + // Only do this once per fresh install of this version. + if (gSavedSettings.getBOOL("MigrateCacheDirectory")) + { + gSavedSettings.setBOOL("MigrateCacheDirectory", FALSE); + + std::string delimiter = gDirUtilp->getDirDelimiter(); + std::string old_cache_dir = gDirUtilp->getOSUserAppDir() + delimiter + "cache"; + std::string new_cache_dir = gDirUtilp->getCacheDir(true); + + if (gDirUtilp->fileExists(old_cache_dir)) + { + llinfos << "Migrating cache from " << old_cache_dir << " to " << new_cache_dir << llendl; + + // Migrate inventory cache to avoid pain to inventory database after mass update + S32 file_count = 0; + std::string file_name; + std::string mask = delimiter + "*.*"; + while (gDirUtilp->getNextFileInDir(old_cache_dir, mask, file_name, false)) + { + if (file_name == "." || file_name == "..") continue; + std::string source_path = old_cache_dir + delimiter + file_name; + std::string dest_path = new_cache_dir + delimiter + file_name; + if (!LLFile::rename(source_path, dest_path)) + { + file_count++; + } + } + llinfos << "Moved " << file_count << " files" << llendl; + + // Nuke the old cache + gDirUtilp->setCacheDir(old_cache_dir); + purgeCache(); + gDirUtilp->setCacheDir(new_cache_dir); + +#if LL_DARWIN + // Clean up Mac files not deleted by removing *.* + std::string ds_store = old_cache_dir + "/.DS_Store"; + if (gDirUtilp->fileExists(ds_store)) + { + LLFile::remove(ds_store); + } +#endif + if (LLFile::rmdir(old_cache_dir) != 0) + { + llwarns << "could not delete old cache directory " << old_cache_dir << llendl; + } + } + } +#endif // LL_WINDOWS || LL_DARWIN +} + bool LLAppViewer::initCache() { mPurgeCache = false; @@ -2643,37 +2761,8 @@ bool LLAppViewer::initCache() } } - // Delete old cache directory -#ifdef LL_DARWIN - if (LL_VERSION_MAJOR >= 1 && LL_VERSION_MINOR >= 21) - { - if (gLastRunVersion != gCurrentVersion) - { - // NOTE: (Nyx) as of 1.21, cache for mac is moving to /library/caches/SecondLife from - // /library/application support/SecondLife/cache This should clear/delete the old dir. - std::string cache_dir = gDirUtilp->getOSUserAppDir(); - std::string new_cache_dir = gDirUtilp->getOSCacheDir(); - cache_dir = cache_dir + "/cache"; - new_cache_dir = new_cache_dir + "/SecondLife"; - if (gDirUtilp->fileExists(cache_dir)) - { - gDirUtilp->setCacheDir(cache_dir); - purgeCache(); - gDirUtilp->setCacheDir(new_cache_dir); - - std::string ds_store = cache_dir + "/.DS_Store"; - if (gDirUtilp->fileExists(ds_store.c_str())) - { - LLFile::remove(ds_store.c_str()); - } - if (LLFile::remove(cache_dir.c_str()) != 0) - { - llwarns << "could not delete old cache directory" << llendl; - } - } - } - } -#endif + // We have moved the location of the cache directory over time. + migrateCacheDirectory(); // Setup and verify the cache location std::string cache_location = gSavedSettings.getString("CacheLocation"); diff --git a/indra/newview/llappviewer.h b/indra/newview/llappviewer.h index b1262c3e5e..e6856e9744 100644 --- a/indra/newview/llappviewer.h +++ b/indra/newview/llappviewer.h @@ -122,10 +122,14 @@ public: static const std::string sPerAccountSettingsName; static const std::string sCrashSettingsName; - // returns false if loading a *required* settings file fails. - bool loadSettingsFromDirectory(ELLPath path_index, bool set_defaults = false); + // Load settings from the location specified by loction_key. + // Key availale and rules for loading, are specified in + // 'app_settings/settings_files.xml' + bool loadSettingsFromDirectory(const std::string& location_key, + bool set_defaults = false); - std::string getSettingsFileName(const std::string& file); + std::string getSettingsFilename(const std::string& location_key, + const std::string& file); // For thread debugging. // llstartup needs to control init. @@ -160,6 +164,10 @@ private: bool initCache(); // Initialize local client cache. void purgeCache(); // Clear the local cache. + // We have switched locations of both Mac and Windows cache, make sure + // files migrate and old cache is cleared out. + void migrateCacheDirectory(); + void cleanupSavedSettings(); // Sets some config data to current or default values during cleanup. void removeCacheFiles(const std::string& filemask); // Deletes cached files the match the given wildcard. @@ -207,7 +215,7 @@ private: bool mQuitRequested; // User wants to quit, may have modified documents open. bool mLogoutRequestSent; // Disconnect message sent to simulator, no longer safe to send messages to the sim. S32 mYieldTime; - LLSD mSettingsFileList; + LLSD mSettingsLocationList; LLWatchdogTimeout* mMainloopTimeout; diff --git a/indra/newview/llchatbar.cpp b/indra/newview/llchatbar.cpp index 9138ad2644..2844b888dc 100644 --- a/indra/newview/llchatbar.cpp +++ b/indra/newview/llchatbar.cpp @@ -114,6 +114,7 @@ LLChatBar::LLChatBar() LLChatBar::~LLChatBar() { + gGestureManager.removeObserver(mObserver); delete mObserver; mObserver = NULL; // LLView destructor cleans up children diff --git a/indra/newview/llfloaterabout.cpp b/indra/newview/llfloaterabout.cpp index 9d3a108baa..a686353156 100644 --- a/indra/newview/llfloaterabout.cpp +++ b/indra/newview/llfloaterabout.cpp @@ -41,6 +41,7 @@ #include "llcurl.h" #include "llimagej2c.h" +#include "audioengine.h" #include "llviewertexteditor.h" #include "llviewercontrol.h" @@ -197,6 +198,11 @@ LLFloaterAbout::LLFloaterAbout() support.append( LLImageJ2C::getEngineInfo() ); support.append("\n"); + support.append("Audio Driver Version: "); + bool want_fullname = true; + support.append( gAudiop ? gAudiop->getDriverName(want_fullname) : "(none)" ); + support.append("\n"); + LLMediaManager *mgr = LLMediaManager::getInstance(); if (mgr) { diff --git a/indra/newview/llfloaterproperties.cpp b/indra/newview/llfloaterproperties.cpp index 4a996a9c06..41c0792b89 100644 --- a/indra/newview/llfloaterproperties.cpp +++ b/indra/newview/llfloaterproperties.cpp @@ -876,10 +876,13 @@ void LLFloaterProperties::updateSaleInfo() { LLPointer new_item = new LLViewerInventoryItem(item); - // Force an update on the sale price. - U32 flags = new_item->getFlags(); - flags |= LLInventoryItem::II_FLAGS_OBJECT_SLAM_SALE; - new_item->setFlags(flags); + // Force an update on the sale price at rez + if (item->getType() == LLAssetType::AT_OBJECT) + { + U32 flags = new_item->getFlags(); + flags |= LLInventoryItem::II_FLAGS_OBJECT_SLAM_SALE; + new_item->setFlags(flags); + } new_item->setSaleInfo(sale_info); if(mObjectID.isNull()) diff --git a/indra/newview/llimpanel.cpp b/indra/newview/llimpanel.cpp index 9538efdc37..51b0470e07 100644 --- a/indra/newview/llimpanel.cpp +++ b/indra/newview/llimpanel.cpp @@ -1644,9 +1644,7 @@ BOOL LLFloaterIMPanel::handleDragAndDrop(S32 x, S32 y, MASK mask, BOOL drop, accepted = true; if(drop) { - LLToolDragAndDrop::giveInventory(mOtherParticipantUUID, inv_item); - LLStringUtil::format_map_t args; - gIMMgr->addSystemMessage(mSessionUUID, "inventory_item_offered", args); + LLToolDragAndDrop::giveInventory(mOtherParticipantUUID, inv_item, mSessionUUID); } } } diff --git a/indra/newview/llpanelobject.cpp b/indra/newview/llpanelobject.cpp index aebed45081..f7f33cb66b 100644 --- a/indra/newview/llpanelobject.cpp +++ b/indra/newview/llpanelobject.cpp @@ -328,7 +328,7 @@ void LLPanelObject::getState( ) // *FIX: shouldn't we just keep the child? if (objectp) { - LLViewerObject* parentp = objectp->getSubParent(); + LLViewerObject* parentp = objectp->getRootEdit(); if (parentp) { diff --git a/indra/newview/llpanelpermissions.cpp b/indra/newview/llpanelpermissions.cpp index 3dab6e62c6..fff5c1985b 100644 --- a/indra/newview/llpanelpermissions.cpp +++ b/indra/newview/llpanelpermissions.cpp @@ -357,17 +357,19 @@ void LLPanelPermissions::refresh() { edit_name_desc = TRUE; } + + childSetEnabled("Name:",true); + LLLineEditor* LineEditorObjectName = getChild("Object Name"); + childSetEnabled("Description:",true); + LLLineEditor* LineEditorObjectDesc = getChild("Object Description"); + if(is_one_object) { - childSetEnabled("Name:",true); - LLLineEditor* LineEditorObjectName = getChild("Object Name"); if(keyboard_focus_view != LineEditorObjectName) { childSetText("Object Name",nodep->mName); } - childSetEnabled("Description:",true); - LLLineEditor* LineEditorObjectDesc = getChild("Object Description"); if(LineEditorObjectDesc) { if(keyboard_focus_view != LineEditorObjectDesc) @@ -376,6 +378,11 @@ void LLPanelPermissions::refresh() } } } + else + { + childSetText("Object Name",LLStringUtil::null); + LineEditorObjectDesc->setText(LLStringUtil::null); + } if(edit_name_desc) { diff --git a/indra/newview/llpanelvolume.cpp b/indra/newview/llpanelvolume.cpp index 7681514257..2ec63dbaa7 100644 --- a/indra/newview/llpanelvolume.cpp +++ b/indra/newview/llpanelvolume.cpp @@ -147,7 +147,7 @@ void LLPanelVolume::getState( ) // *FIX: shouldn't we just keep the child? if (objectp) { - LLViewerObject* parentp = objectp->getSubParent(); + LLViewerObject* parentp = objectp->getRootEdit(); if (parentp) { diff --git a/indra/newview/llstartup.cpp b/indra/newview/llstartup.cpp index 8206699932..21af491408 100644 --- a/indra/newview/llstartup.cpp +++ b/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" @@ -581,10 +585,28 @@ bool idle_startup() if (FALSE == gSavedSettings.getBOOL("NoAudio")) { -#ifdef LL_FMOD - gAudiop = (LLAudioEngine *) new LLAudioEngine_FMOD(); -#else 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) @@ -597,11 +619,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); } } @@ -820,12 +847,12 @@ bool idle_startup() // Set PerAccountSettingsFile to the default value. gSavedSettings.setString("PerAccountSettingsFile", gDirUtilp->getExpandedFilename(LL_PATH_PER_SL_ACCOUNT, - LLAppViewer::instance()->getSettingsFileName("PerAccount") + LLAppViewer::instance()->getSettingsFilename("Default", "PerAccount") ) ); // Overwrite default user settings with user settings - LLAppViewer::instance()->loadSettingsFromDirectory(LL_PATH_PER_SL_ACCOUNT); + LLAppViewer::instance()->loadSettingsFromDirectory("Account"); // Need to set the LastLogoff time here if we don't have one. LastLogoff is used for "Recent Items" calculation // and startup time is close enough if we don't have a real value. diff --git a/indra/newview/lltooldraganddrop.cpp b/indra/newview/lltooldraganddrop.cpp index fd6d3e77a4..25b58e1409 100644 --- a/indra/newview/lltooldraganddrop.cpp +++ b/indra/newview/lltooldraganddrop.cpp @@ -66,6 +66,7 @@ #include "llvolume.h" #include "llworld.h" #include "object_flags.h" +#include "llimview.h" // MAX ITEMS is based on (sizeof(uuid)+2) * count must be < MTUBYTES @@ -1478,12 +1479,18 @@ struct LLGiveInventoryInfo { LLUUID mToAgentID; LLUUID mInventoryObjectID; - LLGiveInventoryInfo(const LLUUID& to_agent, const LLUUID& obj_id) : - mToAgentID(to_agent), mInventoryObjectID(obj_id) {} + LLUUID mIMSessionID; + LLGiveInventoryInfo(const LLUUID& to_agent, const LLUUID& obj_id, const LLUUID &im_session_id = LLUUID::null) : + mToAgentID(to_agent), + mInventoryObjectID(obj_id), + mIMSessionID(im_session_id) + {} }; void LLToolDragAndDrop::giveInventory(const LLUUID& to_agent, - LLInventoryItem* item) + LLInventoryItem* item, + const LLUUID& im_session_id) + { llinfos << "LLToolDragAndDrop::giveInventory()" << llendl; if(!isInventoryGiveAcceptable(item)) @@ -1493,17 +1500,18 @@ void LLToolDragAndDrop::giveInventory(const LLUUID& to_agent, if(item->getPermissions().allowCopyBy(gAgent.getID())) { // just give it away. - LLToolDragAndDrop::commitGiveInventoryItem(to_agent, item); + LLToolDragAndDrop::commitGiveInventoryItem(to_agent, item, im_session_id); } else { // ask if the agent is sure. LLGiveInventoryInfo* info = new LLGiveInventoryInfo(to_agent, - item->getUUID()); + item->getUUID(), + im_session_id); gViewerWindow->alertXml("CannotCopyWarning", - &LLToolDragAndDrop::handleCopyProtectedItem, - (void*)info); + &LLToolDragAndDrop::handleCopyProtectedItem, + (void*)info); } } @@ -1519,7 +1527,8 @@ void LLToolDragAndDrop::handleCopyProtectedItem(S32 option, void* data) if(item) { LLToolDragAndDrop::commitGiveInventoryItem(info->mToAgentID, - item); + item, + info->mIMSessionID); // delete it for now - it will be deleted on the server // quickly enough. gInventory.deleteObject(info->mInventoryObjectID); @@ -1539,7 +1548,8 @@ void LLToolDragAndDrop::handleCopyProtectedItem(S32 option, void* data) // static void LLToolDragAndDrop::commitGiveInventoryItem(const LLUUID& to_agent, - LLInventoryItem* item) + LLInventoryItem* item, + const LLUUID &im_session_id) { if(!item) return; std::string name; @@ -1578,6 +1588,14 @@ void LLToolDragAndDrop::commitGiveInventoryItem(const LLUUID& to_agent, gFloaterTools->dirty(); LLMuteList::getInstance()->autoRemove(to_agent, LLMuteList::AR_INVENTORY); + + // If this item was given by drag-and-drop into an IM panel, log this action in the IM panel chat. + if (im_session_id != LLUUID::null) + { + LLStringUtil::format_map_t args; + gIMMgr->addSystemMessage(im_session_id, "inventory_item_offered", args); + } + } void LLToolDragAndDrop::giveInventoryCategory(const LLUUID& to_agent, diff --git a/indra/newview/lltooldraganddrop.h b/indra/newview/lltooldraganddrop.h index f9e1d75754..627ef86c38 100644 --- a/indra/newview/lltooldraganddrop.h +++ b/indra/newview/lltooldraganddrop.h @@ -211,7 +211,8 @@ protected: // give inventory item functionality static void handleCopyProtectedItem(S32 option, void* data); static void commitGiveInventoryItem(const LLUUID& to_agent, - LLInventoryItem* item); + LLInventoryItem* item, + const LLUUID &im_session_id = LLUUID::null); // give inventory category functionality static void handleCopyProtectedCategory(S32 option, void* data); @@ -251,7 +252,9 @@ public: ESource source, const LLUUID& src_id); - static void giveInventory(const LLUUID& to_agent, LLInventoryItem* item); + static void giveInventory(const LLUUID& to_agent, + LLInventoryItem* item, + const LLUUID &session_id = LLUUID::null); static void giveInventoryCategory(const LLUUID& to_agent, LLInventoryCategory* item); }; diff --git a/indra/newview/lltoolpie.cpp b/indra/newview/lltoolpie.cpp index 6bdc7e9656..7771024d17 100644 --- a/indra/newview/lltoolpie.cpp +++ b/indra/newview/lltoolpie.cpp @@ -178,8 +178,7 @@ BOOL LLToolPie::pickAndShowMenu(BOOL always_show) switch(mClickAction) { case CLICK_ACTION_TOUCH: - default: - // nothing + // touch behavior down below... break; case CLICK_ACTION_SIT: if ((gAgent.getAvatarObject() != NULL) && (!gAgent.getAvatarObject()->mIsSitting)) // agent not already sitting @@ -195,18 +194,33 @@ BOOL LLToolPie::pickAndShowMenu(BOOL always_show) // pay event goes to object actually clicked on mClickActionObject = object; mLeftClickSelection = LLToolSelect::handleObjectSelection(mPick, FALSE, TRUE); + if (LLSelectMgr::getInstance()->selectGetAllValid()) + { + // call this right away, since we have all the info we need to continue the action + selectionPropertiesReceived(); + } return TRUE; } break; case CLICK_ACTION_BUY: mClickActionObject = parent; mLeftClickSelection = LLToolSelect::handleObjectSelection(mPick, FALSE, TRUE, TRUE); + if (LLSelectMgr::getInstance()->selectGetAllValid()) + { + // call this right away, since we have all the info we need to continue the action + selectionPropertiesReceived(); + } return TRUE; case CLICK_ACTION_OPEN: if (parent && parent->allowOpen()) { mClickActionObject = parent; mLeftClickSelection = LLToolSelect::handleObjectSelection(mPick, FALSE, TRUE, TRUE); + if (LLSelectMgr::getInstance()->selectGetAllValid()) + { + // call this right away, since we have all the info we need to continue the action + selectionPropertiesReceived(); + } } return TRUE; case CLICK_ACTION_PLAY: @@ -216,6 +230,9 @@ BOOL LLToolPie::pickAndShowMenu(BOOL always_show) // mClickActionObject = object; handle_click_action_open_media(object); return TRUE; + default: + // nothing + break; } } diff --git a/indra/newview/llvieweraudio.cpp b/indra/newview/llvieweraudio.cpp index 0d250d97f6..021591bd5b 100644 --- a/indra/newview/llvieweraudio.cpp +++ b/indra/newview/llvieweraudio.cpp @@ -238,10 +238,12 @@ void audio_update_wind(bool force_update) // don't use the setter setMaxWindGain() because we don't // want to screw up the fade-in on startup by setting actual source gain // outside the fade-in. - F32 ambient_volume = gSavedSettings.getF32("AudioLevelAmbient"); - gAudiop->mMaxWindGain = gSavedSettings.getBOOL("MuteAmbient") - ? 0.f - : ambient_volume * ambient_volume; + F32 master_volume = gSavedSettings.getBOOL("MuteAudio") ? 0.f : gSavedSettings.getF32("AudioLevelMaster"); + F32 ambient_volume = gSavedSettings.getBOOL("MuteAmbient") ? 0.f : gSavedSettings.getF32("AudioLevelAmbient"); + + F32 wind_volume = master_volume * ambient_volume; + gAudiop->mMaxWindGain = wind_volume; + last_camera_water_height = camera_water_height; gAudiop->updateWind(gRelativeWindVec, camera_water_height); diff --git a/indra/newview/llviewermenu.cpp b/indra/newview/llviewermenu.cpp index 645d68a13a..e8ce3e02ea 100644 --- a/indra/newview/llviewermenu.cpp +++ b/indra/newview/llviewermenu.cpp @@ -5368,7 +5368,15 @@ class LLPromptShowURL : public view_listener_t std::string alert = param.substr(0, offset); std::string url = param.substr(offset+1); std::string* url_copy = new std::string(url); - gViewerWindow->alertXml(alert, callback_show_url, url_copy); + + if(gSavedSettings.getBOOL("UseExternalBrowser")) + { + gViewerWindow->alertXml(alert, callback_show_url, url_copy); + } + else + { + callback_show_url(0, url_copy); + } } else { @@ -5777,8 +5785,7 @@ class LLAttachmentEnableDrop : public view_listener_t { bool handleEvent(LLPointer event, const LLSD& userdata) { - LLParcel* parcel = LLViewerParcelMgr::getInstance()->getAgentParcel(); - BOOL can_build = gAgent.isGodlike() || (parcel && parcel->getAllowModify()); + BOOL can_build = gAgent.isGodlike() || (LLViewerParcelMgr::getInstance()->agentCanBuild()); //Add an inventory observer to only allow dropping the newly attached item //once it exists in your inventory. Look at Jira 2422. diff --git a/indra/newview/llviewerwindow.cpp b/indra/newview/llviewerwindow.cpp index 2aff4281ad..38e376b511 100644 --- a/indra/newview/llviewerwindow.cpp +++ b/indra/newview/llviewerwindow.cpp @@ -1722,13 +1722,24 @@ void adjust_rect_top_right(const std::string& control, const LLRect& window) } } +// *TODO: Adjust based on XUI XML +const S32 TOOLBAR_HEIGHT = 64; + +void adjust_rect_bottom_left(const std::string& control, const LLRect& window) +{ + LLRect r = gSavedSettings.getRect(control); + if (r.mLeft == 0 && r.mBottom == 0) + { + r.setOriginAndSize(0, TOOLBAR_HEIGHT, r.getWidth(), r.getHeight()); + gSavedSettings.setRect(control, r); + } +} + void adjust_rect_bottom_center(const std::string& control, const LLRect& window) { LLRect r = gSavedSettings.getRect(control); if (r.mLeft == 0 && r.mBottom == 0) { - // *TODO: Adjust based on XUI XML - const S32 TOOLBAR_HEIGHT = 64; r.setOriginAndSize( window.getWidth()/2 - r.getWidth()/2, TOOLBAR_HEIGHT, @@ -1787,6 +1798,21 @@ void LLViewerWindow::adjustRectanglesForFirstUse(const LLRect& window) adjust_rect_top_left("FloaterBuildOptionsRect", window); + adjust_rect_bottom_left("FloaterActiveSpeakersRect", window); + + adjust_rect_bottom_left("FloaterBumpRect", window); + + adjust_rect_bottom_left("FloaterRegionInfo", window); + + adjust_rect_bottom_left("FloaterEnvRect", window); + + adjust_rect_bottom_left("FloaterAdvancedSkyRect", window); + + adjust_rect_bottom_left("FloaterAdvancedWaterRect", window); + + adjust_rect_bottom_left("FloaterDayCycleRect", window); + + // bottom-right r = gSavedSettings.getRect("FloaterInventoryRect"); if (r.mLeft == 0 && r.mBottom == 0) diff --git a/indra/newview/viewer_manifest.py b/indra/newview/viewer_manifest.py index ca601dea54..a7037e0199 100755 --- a/indra/newview/viewer_manifest.py +++ b/indra/newview/viewer_manifest.py @@ -186,7 +186,7 @@ class WindowsManifest(ViewerManifest): self.path("openjpeg.dll") self.end_prefix() - # Mozilla appears to force a dependency on these files so we need to ship it (CP) + # Mozilla appears to force a dependency on these files so we need to ship it (CP) - updated to vc8 versions (nyx) # These need to be installed as a SxS assembly, currently a 'private' assembly. # See http://msdn.microsoft.com/en-us/library/ms235291(VS.80).aspx if self.prefix(src=self.args['configuration'], dst=""): @@ -375,9 +375,17 @@ class WindowsManifest(ViewerManifest): "%%INSTALL_FILES%%":self.nsi_file_commands(True), "%%DELETE_FILES%%":self.nsi_file_commands(False)}) + # We use the Unicode version of NSIS, available from + # http://www.scratchpaper.com/ NSIS_path = 'C:\\Program Files\\NSIS\\Unicode\\makensis.exe' self.run_command('"' + proper_windows_path(NSIS_path) + '" ' + self.dst_path_of(tempfile)) # self.remove(self.dst_path_of(tempfile)) + # If we're on a build machine, sign the code using our Authenticode certificate. JC + sign_py = 'C:\\buildscripts\\code-signing\\sign.py' + if os.path.exists(sign_py): + self.run_command(sign_py + ' ' + self.dst_path_of(installer_file)) + else: + print "Skipping code signing,", sign_py, "does not exist" self.created_path(self.dst_path_of(installer_file)) self.package_file = installer_file @@ -645,9 +653,9 @@ class Linux_i686Manifest(LinuxManifest): self.path("libSDL-1.2.so.0") self.path("libELFIO.so") self.path("libopenjpeg.so.2") - #self.path("libtcmalloc.so.0") - bugged - #self.path("libstacktrace.so.0") - probably bugged self.path("libllkdu.so", "../bin/libllkdu.so") # llkdu goes in bin for some reason + self.path("libalut.so") + self.path("libopenal.so", "libopenal.so.1") self.end_prefix("lib") # Vivox runtimes @@ -655,10 +663,8 @@ class Linux_i686Manifest(LinuxManifest): self.path("SLVoice") self.end_prefix() if self.prefix(src="vivox-runtime/i686-linux", dst="lib"): - self.path("libopenal.so.1") self.path("libortp.so") self.path("libvivoxsdk.so") - self.path("libalut.so") self.end_prefix("lib") class Linux_x86_64Manifest(LinuxManifest): diff --git a/indra/win_updater/updater.cpp b/indra/win_updater/updater.cpp index 4bd07ead96..1355486db5 100644 --- a/indra/win_updater/updater.cpp +++ b/indra/win_updater/updater.cpp @@ -33,10 +33,14 @@ // Usage: updater -url // -#include "linden_common.h" +// We use dangerous fopen, strtok, mbstowcs, sprintf +// which generates warnings on VC2005. +// *TODO: Switch to fopen_s, strtok_s, etc. +#define _CRT_SECURE_NO_DEPRECATE #include #include +#include #define BUFSIZE 8192 @@ -44,7 +48,7 @@ int gTotalBytesRead = 0; DWORD gTotalBytes = -1; HWND gWindow = NULL; WCHAR gProgress[256]; -char* gUpdateURL; +char* gUpdateURL = NULL; #if _DEBUG FILE* logfile = 0; @@ -352,7 +356,7 @@ WinMain (HINSTANCE hInstance, HINSTANCE hPrevInstance, LPSTR lpCmdLine, int nSho int parse_args_result = parse_args(argc, argv); WNDCLASSEX wndclassex = { 0 }; - DEVMODE dev_mode = { 0 }; + //DEVMODE dev_mode = { 0 }; char update_exec_path[MAX_PATH]; /* Flawfinder: ignore */ const int WINDOW_WIDTH = 250; @@ -371,7 +375,7 @@ WinMain (HINSTANCE hInstance, HINSTANCE hPrevInstance, LPSTR lpCmdLine, int nSho RegisterClassEx(&wndclassex); // Get the size of the screen - EnumDisplaySettings(NULL, ENUM_CURRENT_SETTINGS, &dev_mode); + //EnumDisplaySettings(NULL, ENUM_CURRENT_SETTINGS, &dev_mode); gWindow = CreateWindowEx(NULL, win_class_name, L"Second Life Updater", -- cgit v1.2.3