diff --git a/indra/CMakeLists.txt b/indra/CMakeLists.txt index 30a443be5..0fdf5b198 100644 --- a/indra/CMakeLists.txt +++ b/indra/CMakeLists.txt @@ -32,7 +32,7 @@ include(UnixInstall) if (NOT CMAKE_CONFIGURATION_TYPES AND NOT CMAKE_BUILD_TYPE) set(CMAKE_BUILD_TYPE RelWithDebInfo CACHE STRING - "Build type. One of: Debug Release RelWithDebInfo" FORCE) + "Build type. One of: Debug Release ReleaseSSE2 RelWithDebInfo" FORCE) endif (NOT CMAKE_CONFIGURATION_TYPES AND NOT CMAKE_BUILD_TYPE) # Create a 'prepare' target in which to perform setup actions. This diff --git a/indra/cmake/00-Common.cmake b/indra/cmake/00-Common.cmake index f6752a26c..d6847330e 100644 --- a/indra/cmake/00-Common.cmake +++ b/indra/cmake/00-Common.cmake @@ -10,13 +10,15 @@ include(Variables) set(CMAKE_CXX_FLAGS_DEBUG "-D_DEBUG -DLL_DEBUG=1") set(CMAKE_CXX_FLAGS_RELEASE "-DLL_RELEASE=1 -DLL_RELEASE_FOR_DOWNLOAD=1 -D_SECURE_SCL=0 -DLL_SEND_CRASH_REPORTS=1 -DNDEBUG") +set(CMAKE_CXX_FLAGS_RELEASESSE2 + "-DLL_RELEASE=1 -DLL_RELEASE_FOR_DOWNLOAD=1 -D_SECURE_SCL=0 -DLL_SEND_CRASH_REPORTS=1 -DNDEBUG") set(CMAKE_CXX_FLAGS_RELWITHDEBINFO "-DLL_RELEASE=1 -D_SECURE_SCL=0 -DLL_SEND_CRASH_REPORTS=0 -DNDEBUG -DLL_RELEASE_WITH_DEBUG_INFO=1") # Don't bother with a MinSizeRel build. -set(CMAKE_CONFIGURATION_TYPES "RelWithDebInfo;Release;Debug" CACHE STRING +set(CMAKE_CONFIGURATION_TYPES "RelWithDebInfo;Release;ReleaseSSE2;Debug" CACHE STRING "Supported build types." FORCE) # Platform-specific compilation flags. @@ -33,7 +35,10 @@ if (WINDOWS) set(CMAKE_CXX_FLAGS_RELEASE "${CMAKE_CXX_FLAGS_RELEASE} ${LL_CXX_FLAGS} /O2 /Zi /MD /MP" CACHE STRING "C++ compiler release options" FORCE) - + set(CMAKE_CXX_FLAGS_RELEASESSE2 + "${CMAKE_CXX_FLAGS_RELEASESSE2} ${LL_CXX_FLAGS} /O2 /Zi /MD /MP /arch:SSE2" + CACHE STRING "C++ compiler release-SSE2 options" FORCE) + set(CMAKE_CXX_STANDARD_LIBRARIES "") set(CMAKE_C_STANDARD_LIBRARIES "") @@ -50,15 +55,18 @@ if (WINDOWS) /Oy- ) - if(MSVC80 OR MSVC90) + if(MSVC80 OR MSVC90 OR MSVC100) set(CMAKE_CXX_FLAGS_RELEASE "${CMAKE_CXX_FLAGS_RELEASE} -D_SECURE_STL=0 -D_HAS_ITERATOR_DEBUGGING=0" CACHE STRING "C++ compiler release options" FORCE) + set(CMAKE_CXX_FLAGS_RELEASESSE2 + "${CMAKE_CXX_FLAGS_RELEASESSE2} -D_SECURE_STL=0 -D_HAS_ITERATOR_DEBUGGING=0" + CACHE STRING "C++ compiler release-SSE2 options" FORCE) add_definitions( /Zc:wchar_t- ) - endif (MSVC80 OR MSVC90) + endif (MSVC80 OR MSVC90 OR MSVC100) # Are we using the crummy Visual Studio KDU build workaround? if (NOT VS_DISABLE_FATAL_WARNINGS) @@ -160,10 +168,12 @@ if (LINUX) # this stops us requiring a really recent glibc at runtime add_definitions(-fno-stack-protector) endif (NOT STANDALONE) + set(CMAKE_CXX_FLAGS_RELEASESSE2 "${CMAKE_CXX_FLAGS_RELEASESSE2} -mfpmath=sse2 -msse2") endif (VIEWER) set(CMAKE_CXX_FLAGS_DEBUG "-fno-inline ${CMAKE_CXX_FLAGS_DEBUG}") set(CMAKE_CXX_FLAGS_RELEASE "-O2 ${CMAKE_CXX_FLAGS_RELEASE}") + set(CMAKE_CXX_FLAGS_RELEASESSE2 "-O2 ${CMAKE_CXX_FLAGS_RELEASESSE2}") endif (LINUX) @@ -177,6 +187,8 @@ if (DARWIN) # NOTE: it's critical to have both CXX_FLAGS and C_FLAGS covered. set(CMAKE_CXX_FLAGS_RELWITHDEBINFO "-O0 ${CMAKE_CXX_FLAGS_RELWITHDEBINFO}") set(CMAKE_C_FLAGS_RELWITHDEBINFO "-O0 ${CMAKE_C_FLAGS_RELWITHDEBINFO}") + set(CMAKE_CXX_FLAGS_RELEASESSE2 "-msse2 -mfpmath=sse ${CMAKE_CXX_FLAGS_RELEASESSE2}") + set(CMAKE_C_FLAGS_RELEASESSE2 "-msse2 -mfpmath=sse ${CMAKE_C_FLAGS_RELEASESSE2}") endif (DARWIN) @@ -228,3 +240,17 @@ endif(1 EQUAL 1) if(SERVER) include_directories(${LIBS_PREBUILT_DIR}/include/havok) endif(SERVER) + +SET( CMAKE_EXE_LINKER_FLAGS_RELEASESSE2 + "${CMAKE_EXE_LINKER_FLAGS_RELEASE}" CACHE STRING + "Flags used for linking binaries under SSE2 build." + FORCE ) +SET( CMAKE_SHARED_LINKER_FLAGS_RELEASESSE2 + "${CMAKE_SHARED_LINKER_FLAGS_RELEASE}" CACHE STRING + "Flags used by the shared libraries linker under SSE2 build." + FORCE ) +MARK_AS_ADVANCED( + CMAKE_CXX_FLAGS_RELEASESSE2 + CMAKE_C_FLAGS_RELEASESSE2 + CMAKE_EXE_LINKER_FLAGS_RELEASESSE2 + CMAKE_SHARED_LINKER_FLAGS_RELEASESSE2 ) diff --git a/indra/cmake/Boost.cmake b/indra/cmake/Boost.cmake index ac15bedad..915f4939c 100644 --- a/indra/cmake/Boost.cmake +++ b/indra/cmake/Boost.cmake @@ -36,6 +36,16 @@ else (STANDALONE) set(BOOST_SIGNALS_LIBRARY optimized libboost_signals-vc90-mt-${BOOST_VERSION} debug libboost_signals-vc90-mt-gd-${BOOST_VERSION}) + elseif (MSVC100) + set(BOOST_PROGRAM_OPTIONS_LIBRARY + optimized libboost_program_options-vc100-mt-${BOOST_VERSION} + debug libboost_program_options-vc100-mt-gd-${BOOST_VERSION}) + set(BOOST_REGEX_LIBRARY + optimized libboost_regex-vc100-mt-${BOOST_VERSION} + debug libboost_regex-vc100-mt-gd-${BOOST_VERSION}) + set(BOOST_SIGNALS_LIBRARY + optimized libboost_signals-vc100-mt-${BOOST_VERSION} + debug libboost_signals-vc100-mt-gd-${BOOST_VERSION}) endif (MSVC80) elseif (DARWIN) set(BOOST_PROGRAM_OPTIONS_LIBRARY boost_program_options-mt) diff --git a/indra/cmake/CopyWinLibs.cmake b/indra/cmake/CopyWinLibs.cmake index 858395551..d5174721e 100644 --- a/indra/cmake/CopyWinLibs.cmake +++ b/indra/cmake/CopyWinLibs.cmake @@ -109,6 +109,14 @@ copy_if_different( ) set(all_targets ${all_targets} ${out_targets}) +copy_if_different( + ${plugintest_release_src_dir} + "${CMAKE_CURRENT_BINARY_DIR}/../test_apps/llplugintest/ReleaseSSE2" + out_targets + ${plugintest_release_files} + ) +set(all_targets ${all_targets} ${out_targets}) + copy_if_different( ${plugintest_release_src_dir} "${CMAKE_CURRENT_BINARY_DIR}/../test_apps/llplugintest/RelWithDebInfo" @@ -135,6 +143,14 @@ copy_if_different( ) set(all_targets ${all_targets} ${out_targets}) +copy_if_different( + ${plugintest_release_src_dir} + "${CMAKE_CURRENT_BINARY_DIR}/../test_apps/llplugintest/ReleaseSSE2/imageformats" + out_targets + ${plugintest_release_files} + ) +set(all_targets ${all_targets} ${out_targets}) + copy_if_different( ${plugintest_release_src_dir} "${CMAKE_CURRENT_BINARY_DIR}/../test_apps/llplugintest/RelWithDebInfo/imageformats" @@ -151,6 +167,14 @@ copy_if_different( ) set(all_targets ${all_targets} ${out_targets}) +copy_if_different( + ${plugintest_release_src_dir} + "${CMAKE_CURRENT_BINARY_DIR}/ReleaseSSE2/llplugin/imageformats" + out_targets + ${plugintest_release_files} + ) +set(all_targets ${all_targets} ${out_targets}) + copy_if_different( ${plugintest_release_src_dir} "${CMAKE_CURRENT_BINARY_DIR}/RelWithDebInfo/llplugin/imageformats" @@ -197,6 +221,14 @@ copy_if_different( ) set(all_targets ${all_targets} ${out_targets}) +copy_if_different( + ${plugins_release_src_dir} + "${CMAKE_CURRENT_BINARY_DIR}/ReleaseSSE2/llplugin" + out_targets + ${plugins_release_files} + ) +set(all_targets ${all_targets} ${out_targets}) + copy_if_different( ${plugins_release_src_dir} "${CMAKE_CURRENT_BINARY_DIR}/RelWithDebInfo/llplugin" @@ -226,6 +258,22 @@ copy_if_different( ) set(all_targets ${all_targets} ${out_targets}) +copy_if_different( + ${release_src_dir} + "${CMAKE_CURRENT_BINARY_DIR}/ReleaseSSE2" + out_targets + ${release_files} + ) +set(all_targets ${all_targets} ${out_targets}) + +copy_if_different( + ${vivox_src_dir} + "${CMAKE_CURRENT_BINARY_DIR}/ReleaseSSE2" + out_targets + ${vivox_files} + ) +set(all_targets ${all_targets} ${out_targets}) + copy_if_different( ${release_src_dir} "${CMAKE_CURRENT_BINARY_DIR}/RelWithDebInfo" @@ -276,6 +324,15 @@ else(EXISTS ${internal_llkdu_path}) COMMENT "Copying llkdu.dll ${CMAKE_CURRENT_BINARY_DIR}/Release" ) set(all_targets ${all_targets} ${release_llkdu_dst}) + + set(releasesse2_llkdu_dst "${CMAKE_CURRENT_BINARY_DIR}/ReleaseSSE2/llkdu.dll") + ADD_CUSTOM_COMMAND( + OUTPUT ${releasesse2_llkdu_dst} + COMMAND ${CMAKE_COMMAND} -E copy_if_different ${release_llkdu_src} ${releasesse2_llkdu_dst} + DEPENDS ${release_llkdu_src} + COMMENT "Copying llkdu.dll ${CMAKE_CURRENT_BINARY_DIR}/ReleaseSSE2" + ) + set(all_targets ${all_targets} ${releasesse2_llkdu_dst}) set(relwithdebinfo_llkdu_dst "${CMAKE_CURRENT_BINARY_DIR}/RelWithDebInfo/llkdu.dll") ADD_CUSTOM_COMMAND( @@ -351,6 +408,14 @@ if (MSVC80) ) set(all_targets ${all_targets} ${out_targets}) + copy_if_different( + ${release_msvc8_redist_path} + "${CMAKE_CURRENT_BINARY_DIR}/ReleaseSSE2" + out_targets + ${release_msvc8_files} + ) + set(all_targets ${all_targets} ${out_targets}) + copy_if_different( ${release_msvc8_redist_path} "${CMAKE_CURRENT_BINARY_DIR}/RelWithDebInfo" @@ -372,6 +437,19 @@ if (MSVC80) COMMENT "Creating release app config file" ) + set(releasesse2_appconfig_file ${CMAKE_CURRENT_BINARY_DIR}/ReleaseSSE2/Ascent.exe.config) + add_custom_command( + OUTPUT ${releasesse2_appconfig_file} + COMMAND ${PYTHON_EXECUTABLE} + ARGS + ${CMAKE_CURRENT_SOURCE_DIR}/build_win32_appConfig.py + ${CMAKE_CURRENT_BINARY_DIR}/ReleaseSSE2/Microsoft.VC80.CRT.manifest + ${CMAKE_CURRENT_SOURCE_DIR}/SecondLife.exe.config + ${releasesse2_appconfig_file} + DEPENDS ${CMAKE_CURRENT_BINARY_DIR}/ReleaseSSE2/Microsoft.VC80.CRT.manifest + COMMENT "Creating release-sse2 app config file" + ) + set(relwithdebinfo_appconfig_file ${CMAKE_CURRENT_BINARY_DIR}/RelWithDebInfo/Ascent.exe.config) add_custom_command( OUTPUT ${relwithdebinfo_appconfig_file} @@ -392,6 +470,7 @@ add_custom_target(copy_win_libs ALL DEPENDS ${all_targets} ${release_appconfig_file} + ${releasesse2_appconfig_file} ${relwithdebinfo_appconfig_file} ${debug_appconfig_file} ) diff --git a/indra/cmake/DirectX.cmake b/indra/cmake/DirectX.cmake index 29724ee2f..5f538c80a 100644 --- a/indra/cmake/DirectX.cmake +++ b/indra/cmake/DirectX.cmake @@ -3,6 +3,7 @@ if (VIEWER AND WINDOWS) find_path(DIRECTX_INCLUDE_DIR dxdiag.h "$ENV{DXSDK_DIR}/Include" + "$ENV{PROGRAMFILES}/Microsoft DirectX SDK (June 2010)/Include" "$ENV{PROGRAMFILES}/Microsoft DirectX SDK (March 2009)/Include" "$ENV{PROGRAMFILES}/Microsoft DirectX SDK (August 2008)/Include" "$ENV{PROGRAMFILES}/Microsoft DirectX SDK (June 2008)/Include" @@ -24,6 +25,7 @@ if (VIEWER AND WINDOWS) find_path(DIRECTX_LIBRARY_DIR dxguid.lib "$ENV{DXSDK_DIR}/Lib/x86" + "$ENV{PROGRAMFILES}/Microsoft DirectX SDK (June 2010)/Lib/x86" "$ENV{PROGRAMFILES}/Microsoft DirectX SDK (March 2009)/Lib/x86" "$ENV{PROGRAMFILES}/Microsoft DirectX SDK (August 2008)/Lib/x86" "$ENV{PROGRAMFILES}/Microsoft DirectX SDK (June 2008)/Lib/x86" diff --git a/indra/develop.py b/indra/develop.py index 0549b2f56..c391a3f53 100755 --- a/indra/develop.py +++ b/indra/develop.py @@ -70,7 +70,7 @@ def quote(opts): class PlatformSetup(object): generator = None build_types = {} - for t in ('Debug', 'Release', 'RelWithDebInfo'): + for t in ('Debug', 'Release', 'ReleaseSSE2', 'RelWithDebInfo'): build_types[t.lower()] = t build_type = build_types['relwithdebinfo'] @@ -483,11 +483,16 @@ class WindowsSetup(PlatformSetup): 'vc90' : { 'gen' : r'Visual Studio 9 2008', 'ver' : r'9.0' + }, + 'vc100' : { + 'gen' : r'Visual Studio 10', + 'ver' : r'10.0' } } gens['vs2003'] = gens['vc71'] gens['vs2005'] = gens['vc80'] gens['vs2008'] = gens['vc90'] + gens['vs2010'] = gens['vc100'] search_path = r'C:\windows' exe_suffixes = ('.exe', '.bat', '.com') @@ -499,14 +504,14 @@ class WindowsSetup(PlatformSetup): def _get_generator(self): if self._generator is None: - for version in 'vc80 vc90 vc71'.split(): + for version in 'vc80 vc90 vc100 vc71'.split(): if self.find_visual_studio(version): self._generator = version print 'Building with ', self.gens[version]['gen'] break else: print >> sys.stderr, 'Cannot find a Visual Studio installation, testing for express editions' - for version in 'vc80 vc90 vc71'.split(): + for version in 'vc80 vc90 vc100 vc71'.split(): if self.find_visual_studio_express(version): self._generator = version self.using_express = True @@ -725,12 +730,12 @@ Options: --standalone build standalone, without Linden prebuild libraries --unattended build unattended, do not invoke any tools requiring a human response - -t | --type=NAME build type ("Debug", "Release", or "RelWithDebInfo") + -t | --type=NAME build type ("Debug", "Release", "ReleaseSSE2", or "RelWithDebInfo") -m32 | -m64 build architecture (32-bit or 64-bit) -N | --no-distcc disable use of distcc -G | --generator=NAME generator name - Windows: VC71 or VS2003 (default), VC80 (VS2005) or - VC90 (VS2008) + Windows: VC71 or VS2003 (default), VC80 (VS2005) + VC90 (VS2008), or VC100 (VS2010) Mac OS X: Xcode (default), Unix Makefiles Linux: Unix Makefiles (default), KDevelop3 -p | --project=NAME set the root project name. (Doesn't effect makefiles) diff --git a/indra/lib/python/indra/util/llmanifest.py b/indra/lib/python/indra/util/llmanifest.py index 033839672..4c0f7f749 100644 --- a/indra/lib/python/indra/util/llmanifest.py +++ b/indra/lib/python/indra/util/llmanifest.py @@ -120,7 +120,7 @@ ARGUMENTS=[ On Linux this would try to use Linux_i686Manifest.""", default=""), dict(name='build', description='Build directory.', default=DEFAULT_SRCTREE), - dict(name='buildtype', description="""The build type used. ('Debug', 'Release', or 'RelWithDebInfo') + dict(name='buildtype', description="""The build type used. ('Debug', 'Release', 'ReleaseSSE2' or 'RelWithDebInfo') Default is Release """, default="Release"), dict(name='branding_id', description="""Identifier for the branding set to diff --git a/indra/llaudio/llaudiodecodemgr.cpp b/indra/llaudio/llaudiodecodemgr.cpp index 8725b2317..b80ce5306 100644 --- a/indra/llaudio/llaudiodecodemgr.cpp +++ b/indra/llaudio/llaudiodecodemgr.cpp @@ -45,6 +45,7 @@ #include "vorbis/codec.h" #include "vorbis/vorbisfile.h" #include "llvorbisencode.h" +#include //VS2010 extern LLAudioEngine *gAudiop; diff --git a/indra/llaudio/llaudioengine.cpp b/indra/llaudio/llaudioengine.cpp index c2be9ebab..cf61609b7 100644 --- a/indra/llaudio/llaudioengine.cpp +++ b/indra/llaudio/llaudioengine.cpp @@ -992,7 +992,8 @@ LLAudioData * LLAudioEngine::getAudioData(const LLUUID &audio_uuid) delete sourcep; if(chan) chan->cleanup(); - mAllSources.erase(iter2++); } + mAllSources.erase(iter2++); + } else ++iter2; } diff --git a/indra/llcommon/llqueuedthread.cpp b/indra/llcommon/llqueuedthread.cpp index 8a4ede86e..7fb9a8ab8 100644 --- a/indra/llcommon/llqueuedthread.cpp +++ b/indra/llcommon/llqueuedthread.cpp @@ -435,6 +435,7 @@ S32 LLQueuedThread::processNextRequest() { lockData(); req->setStatus(STATUS_COMPLETE); + req->finishRequest(true); diff --git a/indra/llcommon/llsd.h b/indra/llcommon/llsd.h index d2845a375..b8d83033f 100644 --- a/indra/llcommon/llsd.h +++ b/indra/llcommon/llsd.h @@ -113,6 +113,7 @@ public: typedef bool Boolean; typedef S32 Integer; typedef F64 Real; + typedef F32 Float; //casting to F32 was broken, so.. typedef std::string String; typedef LLUUID UUID; typedef LLDate Date; @@ -187,6 +188,7 @@ public: Boolean asBoolean() const; Integer asInteger() const; Real asReal() const; + Float asFloat() const {return (F32)asReal();} String asString() const; UUID asUUID() const; Date asDate() const; @@ -196,6 +198,7 @@ public: operator Boolean() const { return asBoolean(); } operator Integer() const { return asInteger(); } operator Real() const { return asReal(); } + operator Float() const { return asFloat(); } operator String() const { return asString(); } operator UUID() const { return asUUID(); } operator Date() const { return asDate(); } diff --git a/indra/llimage/llimage.cpp b/indra/llimage/llimage.cpp index 6805dbb25..d6ff49217 100644 --- a/indra/llimage/llimage.cpp +++ b/indra/llimage/llimage.cpp @@ -196,6 +196,7 @@ U8* LLImageBase::reallocateData(S32 size) } else llwarns << "Out of memory in LLImageBase::reallocateData" << llendl; + return data; } diff --git a/indra/llimage/llimagepng.cpp b/indra/llimage/llimagepng.cpp index 31c0a3479..2518dbe8f 100644 --- a/indra/llimage/llimagepng.cpp +++ b/indra/llimage/llimagepng.cpp @@ -48,10 +48,6 @@ LLImagePNG::LLImagePNG() LLImagePNG::~LLImagePNG() { - /*if (mTmpWriteBuffer) - { - delete[] mTmpWriteBuffer; -Shyotl - }*/ } // Virtual @@ -121,6 +117,7 @@ BOOL LLImagePNG::encode(const LLImageRaw* raw_image, F32 encode_time) setSize(raw_image->getWidth(), raw_image->getHeight(), raw_image->getComponents()); U32 bufferSize = getWidth() * getHeight() * getComponents() + 1024; + //New implementation allocateData(bufferSize); //Set to largest possible size. if(isBufferInvalid()) //Checking @@ -128,13 +125,15 @@ BOOL LLImagePNG::encode(const LLImageRaw* raw_image, F32 encode_time) setLastError("LLImagePNG::encode failed allocateData"); return FALSE; } - // Delegate actual encoding work to wrapper + + // Delegate actual encoding work to wrapper LLPngWrapper pngWrapper; if (! pngWrapper.writePng(raw_image, getData())) { setLastError(pngWrapper.getErrorMessage()); - return FALSE; - } + return FALSE; + } + // Resize internal buffer. if(!reallocateData(pngWrapper.getFinalSize())) //Shrink. Returns NULL on failure. { @@ -142,7 +141,9 @@ BOOL LLImagePNG::encode(const LLImageRaw* raw_image, F32 encode_time) return FALSE; } return TRUE; - /*U8* mTmpWriteBuffer = new U8[ bufferSize ]; + + + /*U8* mTmpWriteBuffer = new U8[ bufferSize ]; // Delegate actual encoding work to wrapper LLPngWrapper pngWrapper; diff --git a/indra/llimage/llimagepng.h b/indra/llimage/llimagepng.h index 26ca7dddb..4d6e2ee70 100644 --- a/indra/llimage/llimagepng.h +++ b/indra/llimage/llimagepng.h @@ -47,8 +47,6 @@ public: /*virtual*/ BOOL updateData(); /*virtual*/ BOOL decode(LLImageRaw* raw_image, F32 decode_time); /*virtual*/ BOOL encode(const LLImageRaw* raw_image, F32 encode_time); - -private: }; #endif diff --git a/indra/llimagej2coj/llimagej2coj.cpp b/indra/llimagej2coj/llimagej2coj.cpp index 93790b591..a9dda75a8 100644 --- a/indra/llimagej2coj/llimagej2coj.cpp +++ b/indra/llimagej2coj/llimagej2coj.cpp @@ -330,7 +330,7 @@ BOOL LLImageJ2COJ::encodeImpl(LLImageJ2C &base, const LLImageRaw &raw_image, con OPJ_COLOR_SPACE color_space = CLRSPC_SRGB; opj_image_cmptparm_t cmptparm[MAX_COMPS]; opj_image_t * image = NULL; - S32 numcomps = raw_image.getComponents() > MAX_COMPS ? MAX_COMPS : raw_image.getComponents(); //Clamp avoid overrunning buffer -Shyotl + S32 numcomps = llmin((S32)raw_image.getComponents(),(S32)MAX_COMPS); //Clamp avoid overrunning buffer -Shyotl S32 width = raw_image.getWidth(); S32 height = raw_image.getHeight(); diff --git a/indra/llmath/llvolume.cpp b/indra/llmath/llvolume.cpp index c091e6c7c..65d134bc0 100644 --- a/indra/llmath/llvolume.cpp +++ b/indra/llmath/llvolume.cpp @@ -4875,57 +4875,20 @@ BOOL LLVolumeFace::createCap(LLVolume* volume, BOOL partial_build) else { // Not hollow, generate the triangle fan. + U16 v1 = 2; + U16 v2 = 1; + if (mTypeMask & TOP_MASK) { - if (mTypeMask & OPEN_MASK) - { - // SOLID OPEN TOP - // Generate indices - // This is a tri-fan, so we reuse the same first point for all triangles. - for (S32 i = 0; i < (num_vertices - 2); i++) - { - mIndices[3*i] = num_vertices - 1; - mIndices[3*i+1] = i; - mIndices[3*i+2] = i + 1; - } - } - else - { - // SOLID CLOSED TOP - for (S32 i = 0; i < (num_vertices - 2); i++) - { - //MSMSM fix these caps but only for the un-cut case - mIndices[3*i] = num_vertices - 1; - mIndices[3*i+1] = i; - mIndices[3*i+2] = i + 1; - } - } + v1 = 1; + v2 = 2; } - else + + for (S32 i = 0; i < (num_vertices - 2); i++) { - if (mTypeMask & OPEN_MASK) - { - // SOLID OPEN BOTTOM - // Generate indices - // This is a tri-fan, so we reuse the same first point for all triangles. - for (S32 i = 0; i < (num_vertices - 2); i++) - { - mIndices[3*i] = num_vertices - 1; - mIndices[3*i+1] = i + 1; - mIndices[3*i+2] = i; - } - } - else - { - // SOLID CLOSED BOTTOM - for (S32 i = 0; i < (num_vertices - 2); i++) - { - //MSMSM fix these caps but only for the un-cut case - mIndices[3*i] = num_vertices - 1; - mIndices[3*i+1] = i + 1; - mIndices[3*i+2] = i; - } - } + mIndices[3*i] = num_vertices - 1; + mIndices[3*i+v1] = i; + mIndices[3*i+v2] = i + 1; } } return TRUE; @@ -5189,31 +5152,20 @@ BOOL LLVolumeFace::createSide(LLVolume* volume, BOOL partial_build) //generate normals for (U32 i = 0; i < mIndices.size()/3; i++) //for each triangle { - const S32 i0 = mIndices[i*3+0]; - const S32 i1 = mIndices[i*3+1]; - const S32 i2 = mIndices[i*3+2]; - const VertexData& v0 = mVertices[i0]; - const VertexData& v1 = mVertices[i1]; - const VertexData& v2 = mVertices[i2]; + const U16* idx = &(mIndices[i*3]); + + VertexData* v[] = + { &mVertices[idx[0]], &mVertices[idx[1]], &mVertices[idx[2]] }; //calculate triangle normal - LLVector3 norm = (v0.mPosition-v1.mPosition) % (v0.mPosition-v2.mPosition); + LLVector3 norm = (v[0]->mPosition-v[1]->mPosition) % (v[0]->mPosition-v[2]->mPosition); - for (U32 j = 0; j < 3; j++) - { //add triangle normal to vertices - const S32 idx = mIndices[i*3+j]; - mVertices[idx].mNormal += norm; // * (weight_sum - d[j])/weight_sum; - } + v[0]->mNormal += norm; + v[1]->mNormal += norm; + v[2]->mNormal += norm; //even out quad contributions - if ((i & 1) == 0) - { - mVertices[i2].mNormal += norm; - } - else - { - mVertices[i1].mNormal += norm; - } + v[i%2+1]->mNormal += norm; } // adjust normals based on wrapping and stitching diff --git a/indra/llmessage/llbuffer.cpp b/indra/llmessage/llbuffer.cpp index 1ffcecd84..1924fcdf5 100644 --- a/indra/llmessage/llbuffer.cpp +++ b/indra/llmessage/llbuffer.cpp @@ -38,6 +38,7 @@ #include "llmath.h" #include "llmemtype.h" #include "llstl.h" +#include //VS2010 /** * LLSegment diff --git a/indra/llmessage/lldispatcher.cpp b/indra/llmessage/lldispatcher.cpp index 6632fbb67..c5ee86992 100644 --- a/indra/llmessage/lldispatcher.cpp +++ b/indra/llmessage/lldispatcher.cpp @@ -37,6 +37,7 @@ #include #include "llstl.h" #include "message.h" +#include //VS2010 ///---------------------------------------------------------------------------- /// Class lldispatcher diff --git a/indra/llmessage/llinstantmessage.cpp b/indra/llmessage/llinstantmessage.cpp index 44be3ae38..3205ddfae 100644 --- a/indra/llmessage/llinstantmessage.cpp +++ b/indra/llmessage/llinstantmessage.cpp @@ -357,7 +357,7 @@ LLPointer llsd_to_im_info(const LLSD& im_info_sd) param_message["message"].asString(), param_message["id"].asUUID(), (U32) param_message["parent_estate_id"].asInteger(), - im_info->mRegionID = param_message["region_id"].asUUID(), + param_message["region_id"].asUUID(), ll_vector3_from_sd(param_message["position"]), param_message["data"], (U8) param_message["offline"].asInteger(), diff --git a/indra/llmessage/llmessagetemplateparser.cpp b/indra/llmessage/llmessagetemplateparser.cpp index 283547ea0..2ddbf3e0d 100644 --- a/indra/llmessage/llmessagetemplateparser.cpp +++ b/indra/llmessage/llmessagetemplateparser.cpp @@ -403,6 +403,10 @@ LLTemplateParser::LLTemplateParser(LLTemplateTokenizer & tokens): { mMessages.push_back(templatep); } + else + { + delete templatep; + } } if(!tokens.wantEOF()) diff --git a/indra/llmessage/llnamevalue.cpp b/indra/llmessage/llnamevalue.cpp index 01e922eba..43429b0ab 100644 --- a/indra/llmessage/llnamevalue.cpp +++ b/indra/llmessage/llnamevalue.cpp @@ -963,6 +963,7 @@ std::ostream& operator<<(std::ostream& s, const LLNameValue &a) U64_to_str(*a.mNameValueReference.u64, u64_string, sizeof(u64_string)); s << u64_string; } + break; case NVT_VEC3: s << *(a.mNameValueReference.vec3); break; diff --git a/indra/llmessage/llpacketbuffer.cpp b/indra/llmessage/llpacketbuffer.cpp index 027d35cf8..9eb0b7ab0 100644 --- a/indra/llmessage/llpacketbuffer.cpp +++ b/indra/llmessage/llpacketbuffer.cpp @@ -42,6 +42,9 @@ LLPacketBuffer::LLPacketBuffer(const LLHost &host, const char *datap, const S32 size) : mHost(host) { + mSize = 0; + mData[0] = '!'; + if (size > NET_BUFFER_SIZE) { llerrs << "Sending packet > " << NET_BUFFER_SIZE << " of size " << size << llendl; diff --git a/indra/llmessage/llpumpio.cpp b/indra/llmessage/llpumpio.cpp index 3e3f0b37a..06135d556 100644 --- a/indra/llmessage/llpumpio.cpp +++ b/indra/llmessage/llpumpio.cpp @@ -43,6 +43,7 @@ #include "llmemtype.h" #include "llstl.h" #include "llstat.h" +#include //VS2010 // These should not be enabled in production, but they can be // intensely useful during development for finding certain kinds of diff --git a/indra/llmessage/llservicebuilder.cpp b/indra/llmessage/llservicebuilder.cpp index 3f07147eb..194c4e257 100644 --- a/indra/llmessage/llservicebuilder.cpp +++ b/indra/llmessage/llservicebuilder.cpp @@ -98,7 +98,9 @@ std::string LLServiceBuilder::buildServiceURI(const std::string& service_name) { std::ostringstream service_url; // Find the service builder - if(mServiceMap.find(service_name) != mServiceMap.end()) + std::map::const_iterator it = + mServiceMap.find(service_name); + if(it != mServiceMap.end()) { // construct the service builder url LLApp* app = LLApp::instance(); @@ -119,7 +121,7 @@ std::string LLServiceBuilder::buildServiceURI(const std::string& service_name) } service_url << base_url.asString(); } - service_url << mServiceMap[service_name]; + service_url << it->second; } else { diff --git a/indra/llmessage/lltemplatemessagebuilder.cpp b/indra/llmessage/lltemplatemessagebuilder.cpp index 1e1701848..7dbcedce8 100644 --- a/indra/llmessage/lltemplatemessagebuilder.cpp +++ b/indra/llmessage/lltemplatemessagebuilder.cpp @@ -326,7 +326,7 @@ void LLTemplateMessageBuilder::addData(const char *varname, const void *data, EM << "(" << size << "). Clamping size and truncating data." << llendl; size = 255; char *truncate = (char *)data; - truncate[255] = 0; + truncate[254] = 0; // array size is 255 but the last element index is 254 } // no correct size for MVT_VARIABLE, instead we need to tell how many bytes the size will be encoded as @@ -737,10 +737,14 @@ static S32 buildBlock(U8* buffer, S32 buffer_size, const LLMessageBlock* templat } --block_count; - ++block_iter; + if (block_iter != message_data->mMemberBlocks.end()) { - mbci = block_iter->second; + ++block_iter; + if (block_iter != message_data->mMemberBlocks.end()) + { + mbci = block_iter->second; + } } } diff --git a/indra/llmessage/partsyspacket.cpp b/indra/llmessage/partsyspacket.cpp index cfb3572d8..2f9e59acc 100644 --- a/indra/llmessage/partsyspacket.cpp +++ b/indra/llmessage/partsyspacket.cpp @@ -144,6 +144,8 @@ LLPartSysCompressedPacket::LLPartSysCompressedPacket() mData[i] = '\0'; } + mNumBytes = 0; + gSetInitDataDefaults(&mDefaults); } diff --git a/indra/llrender/llimagegl.cpp b/indra/llrender/llimagegl.cpp index 2919b0e04..6c2e20577 100644 --- a/indra/llrender/llimagegl.cpp +++ b/indra/llrender/llimagegl.cpp @@ -1564,10 +1564,9 @@ void LLImageGL::setNoDelete() void LLImageGL::updatePickMask(S32 width, S32 height, const U8* data_in) { delete [] mPickMask; //Always happens regardless. - mPickMask = NULL; - mPickMaskSize = 0; + if (!(mFormatType != GL_UNSIGNED_BYTE || mFormatPrimary != GL_RGBA)) //can only generate a pick mask for this sort of texture { @@ -1583,7 +1582,7 @@ void LLImageGL::updatePickMask(S32 width, S32 height, const U8* data_in) memset(mPickMask, 0, sizeof(U8) * mPickMaskSize); U32 pick_bit = 0; - + for (S32 y = 0; y < height; y += 2) { for (S32 x = 0; x < width; x += 2) @@ -1601,7 +1600,7 @@ void LLImageGL::updatePickMask(S32 width, S32 height, const U8* data_in) mPickMask[pick_idx] |= 1 << pick_offset; } - + ++pick_bit; } } diff --git a/indra/llrender/llrender.cpp b/indra/llrender/llrender.cpp index 6a670f2e5..c32b962c5 100644 --- a/indra/llrender/llrender.cpp +++ b/indra/llrender/llrender.cpp @@ -298,7 +298,7 @@ bool LLTexUnit::bindManual(eTextureType type, U32 texture, bool hasMips) if(mCurrTexture != texture) { gGL.flush(); - + activate(); enable(type); mCurrTexture = texture; diff --git a/indra/llui/llalertdialog.cpp b/indra/llui/llalertdialog.cpp index f321db872..f708e220e 100644 --- a/indra/llui/llalertdialog.cpp +++ b/indra/llui/llalertdialog.cpp @@ -462,8 +462,8 @@ void LLAlertDialog::draw() setDefaultBtn(mButtonData[mDefaultOption].mButton); } - LLColor4 shadow_color = LLUI::sColorsGroup->getColor("ColorDropShadow"); - S32 shadow_lines = LLUI::sConfigGroup->getS32("DropShadowFloater"); + static LLColor4 shadow_color = LLUI::sColorsGroup->getColor("ColorDropShadow"); + static S32 shadow_lines = LLUI::sConfigGroup->getS32("DropShadowFloater"); gl_drop_shadow( 0, getRect().getHeight(), getRect().getWidth(), 0, shadow_color, shadow_lines); diff --git a/indra/llui/llfloater.cpp b/indra/llui/llfloater.cpp index 22f577cee..11d81122a 100644 --- a/indra/llui/llfloater.cpp +++ b/indra/llui/llfloater.cpp @@ -1408,8 +1408,8 @@ void LLFloater::draw() S32 right = getRect().getWidth() - LLPANEL_BORDER_WIDTH; S32 bottom = LLPANEL_BORDER_WIDTH; - LLColor4 shadow_color = LLUI::sColorsGroup->getColor("ColorDropShadow"); - F32 shadow_offset = (F32)LLUI::sConfigGroup->getS32("DropShadowFloater"); + static LLColor4 shadow_color = LLUI::sColorsGroup->getColor("ColorDropShadow"); + static F32 shadow_offset = (F32)LLUI::sConfigGroup->getS32("DropShadowFloater"); if (!isBackgroundOpaque()) { shadow_offset *= 0.2f; diff --git a/indra/llui/llmenugl.cpp b/indra/llui/llmenugl.cpp index db2f2d3da..0531b1575 100644 --- a/indra/llui/llmenugl.cpp +++ b/indra/llui/llmenugl.cpp @@ -2933,9 +2933,11 @@ void LLMenuGL::draw( void ) { if (mDropShadowed && !mTornOff) { + static LLColor4 color_drop_shadow = LLUI::sColorsGroup->getColor("ColorDropShadow"); + static S32 drop_shadow_floater = LLUI::sConfigGroup->getS32("DropShadowFloater"); gl_drop_shadow(0, getRect().getHeight(), getRect().getWidth(), 0, - LLUI::sColorsGroup->getColor("ColorDropShadow"), - LLUI::sConfigGroup->getS32("DropShadowFloater") ); + color_drop_shadow, + drop_shadow_floater ); } LLColor4 bg_color = mBackgroundColor; diff --git a/indra/llui/llmodaldialog.cpp b/indra/llui/llmodaldialog.cpp index 783f39000..9996ca460 100644 --- a/indra/llui/llmodaldialog.cpp +++ b/indra/llui/llmodaldialog.cpp @@ -245,8 +245,8 @@ void LLModalDialog::onClose(bool app_quitting) // virtual void LLModalDialog::draw() { - LLColor4 shadow_color = LLUI::sColorsGroup->getColor("ColorDropShadow"); - S32 shadow_lines = LLUI::sConfigGroup->getS32("DropShadowFloater"); + static LLColor4 shadow_color = LLUI::sColorsGroup->getColor("ColorDropShadow"); + static S32 shadow_lines = LLUI::sConfigGroup->getS32("DropShadowFloater"); gl_drop_shadow( 0, getRect().getHeight(), getRect().getWidth(), 0, shadow_color, shadow_lines); diff --git a/indra/llui/llnotifications.cpp b/indra/llui/llnotifications.cpp index 6b7dd0a3d..ef0de48cd 100644 --- a/indra/llui/llnotifications.cpp +++ b/indra/llui/llnotifications.cpp @@ -38,6 +38,9 @@ #include "llnotifications.h" #include +#if LL_MSVC +#pragma warning( disable : 4265 ) // "class has virtual functions, but destructor is not virtual" +#endif #include diff --git a/indra/llxml/llcontrol.cpp b/indra/llxml/llcontrol.cpp index 8bd04d727..7fbef77ad 100644 --- a/indra/llxml/llcontrol.cpp +++ b/indra/llxml/llcontrol.cpp @@ -253,9 +253,29 @@ LLSD LLControlVariable::getSaveValue() const return mValues[0]; } +#if PROF_CTRL_CALLS +std::vector> gSettingsCallMap; +#endif //PROF_CTRL_CALLS LLPointer LLControlGroup::getControl(const std::string& name) { ctrl_name_table_t::iterator iter = mNameTable.find(name); +#if PROF_CTRL_CALLS + if(iter != mNameTable.end()) + { + std::vector>::iterator iter2 = gSettingsCallMap.begin(); + std::vector>::iterator end = gSettingsCallMap.end(); + for(;iter2!=end;iter2++) + { + if(iter2->first==name) + { + iter2->second = iter2->second + 1; + break; + } + } + if(iter2 == gSettingsCallMap.end()) + gSettingsCallMap.push_back(std::pair(name.c_str(),1)); + } +#endif //PROF_CTRL_CALLS return iter == mNameTable.end() ? LLPointer() : iter->second; } diff --git a/indra/newview/ascentprefssys.cpp b/indra/newview/ascentprefssys.cpp index 3c3dd465a..cd7c84875 100644 --- a/indra/newview/ascentprefssys.cpp +++ b/indra/newview/ascentprefssys.cpp @@ -116,6 +116,7 @@ LLPrefsAscentSysImpl::LLPrefsAscentSysImpl() childSetCommitCallback("system_folder_check", onCommitCheckBox, this); childSetCommitCallback("show_look_at_check", onCommitCheckBox, this); childSetCommitCallback("enable_clouds", onCommitCheckBox, this); + refreshValues(); refresh(); } @@ -186,8 +187,10 @@ void LLPrefsAscentSysImpl::refreshValues() //Performance ------------------------------------------------------------------------- mFetchInventoryOnLogin = gSavedSettings.getBOOL("FetchInventoryOnLogin"); mEnableLLWind = gSavedSettings.getBOOL("WindEnabled"); - mEnableClouds = gSavedSettings.getBOOL("CloudsEnabled"); - mEnableClassicClouds = gSavedSettings.getBOOL("SkyUseClassicClouds"); + + mEnableClouds = gSavedSettings.getBOOL("CloudsEnabled"); + mEnableClassicClouds = gSavedSettings.getBOOL("SkyUseClassicClouds"); + mSpeedRez = gSavedSettings.getBOOL("SpeedRez"); mSpeedRezInterval = gSavedSettings.getU32("SpeedRezInterval"); @@ -292,7 +295,7 @@ void LLPrefsAscentSysImpl::refresh() childSetValue("fetch_inventory_on_login_check", mFetchInventoryOnLogin); childSetValue("enable_wind", mEnableLLWind); childSetValue("enable_clouds", mEnableClouds); - childSetValue("enable_classic_clouds", mEnableClassicClouds); + childSetValue("enable_classic_clouds", mEnableClassicClouds); gLLWindEnabled = mEnableLLWind; childSetValue("speed_rez_check", mSpeedRez); childSetEnabled("speed_rez_interval", mSpeedRez); @@ -332,7 +335,7 @@ void LLPrefsAscentSysImpl::cancel() childSetValue("fetch_inventory_on_login_check", mFetchInventoryOnLogin); childSetValue("enable_wind", mEnableLLWind); childSetValue("enable_clouds", mEnableClouds); - childSetValue("enable_classic_clouds", mEnableClassicClouds); + childSetValue("enable_classic_clouds", mEnableClassicClouds); childSetValue("speed_rez_check", mSpeedRez); if (mSpeedRez) { @@ -354,6 +357,7 @@ void LLPrefsAscentSysImpl::cancel() childSetValue("enable_clouds", mEnableClouds); childSetValue("enable_classic_clouds", mEnableClassicClouds); + gLLWindEnabled = mEnableLLWind; } diff --git a/indra/newview/ascentprefsvan.cpp b/indra/newview/ascentprefsvan.cpp index 75c4794ca..5f13f675a 100644 --- a/indra/newview/ascentprefsvan.cpp +++ b/indra/newview/ascentprefsvan.cpp @@ -202,15 +202,15 @@ void LLPrefsAscentVanImpl::refreshValues() //Colors mShowSelfClientTag = gSavedSettings.getBOOL("AscentShowSelfTag"); mShowSelfClientTagColor = gSavedSettings.getBOOL("AscentShowSelfTagColor"); - mCustomTagOn = gSavedSettings.getBOOL("AscentUseCustomTag"); - - mSelectedClient = gCOASavedSettings->getU32("AscentReportClientIndex"); - mEffectColor = gCOASavedSettings->getColor4("EffectColor"); + mCustomTagOn = gCOASavedSettings->getBOOL("AscentUseCustomTag"); - childSetEnabled("custom_tag_label_text", mCustomTagOn); - childSetEnabled("custom_tag_label_box", mCustomTagOn); - childSetEnabled("custom_tag_color_text", mCustomTagOn); - childSetEnabled("custom_tag_color_swatch", mCustomTagOn); + mSelectedClient = gCOASavedSettings->getU32("AscentReportClientIndex"); + mEffectColor = gCOASavedSettings->getColor4("EffectColor"); + + childSetEnabled("custom_tag_label_text", mCustomTagOn); + childSetEnabled("custom_tag_label_box", mCustomTagOn); + childSetEnabled("custom_tag_color_text", mCustomTagOn); + childSetEnabled("custom_tag_color_swatch", mCustomTagOn); mCustomTagLabel = gCOASavedSettings->getString("AscentCustomTagLabel"); mCustomTagColor = gCOASavedSettings->getColor4("AscentCustomTagColor"); diff --git a/indra/newview/chatbar_as_cmdline.cpp b/indra/newview/chatbar_as_cmdline.cpp index d290938f9..818df6279 100644 --- a/indra/newview/chatbar_as_cmdline.cpp +++ b/indra/newview/chatbar_as_cmdline.cpp @@ -198,8 +198,13 @@ void invrepair() } - - +#if PROF_CTRL_CALLS +extern std::vector> gSettingsCallMap; +bool stort_calls(const std::pair& left, const std::pair& right) +{ + return left.second < right.second; +} +#endif //PROF_CTRL_CALLS bool cmd_line_chat(std::string revised_text, EChatType type) { if(gSavedSettings.getBOOL("AscentCmdLine")) @@ -414,6 +419,16 @@ bool cmd_line_chat(std::string revised_text, EChatType type) { invrepair(); } +#if PROF_CTRL_CALLS + else if(command == "dumpcalls") + { + llinfos << "gSavedSettings lookup count (" << gFrameCount << "frames)" << llendl; + std::sort(gSettingsCallMap.begin(),gSettingsCallMap.end(),stort_calls); + for(U32 i = 0;igetFullName(*i, av_name)) { - LLViewerObject *obj = gObjectList.findObject(*i); - if(obj) + LLVOAvatar *avatarp = gObjectList.findAvatar(*i); + if(avatarp) { - LLVOAvatar* avatarp = dynamic_cast(obj); av_name = avatarp->getFullname(); } } @@ -471,10 +485,10 @@ void cmdline_tp2name(std::string target) return; } LLFloaterAvatarList* avlist = LLFloaterAvatarList::getInstance(); - LLViewerObject* obj = gObjectList.findObject(avkey); - if(obj) + LLVOAvatar* avatarp = gObjectList.findAvatar(avkey); + if(avatarp) { - LLVector3d pos = obj->getPositionGlobal(); + LLVector3d pos = avatarp->getPositionGlobal(); pos.mdV[VZ] += 2.0; gAgent.teleportViaLocation(pos); } diff --git a/indra/newview/gpu_table.txt b/indra/newview/gpu_table.txt index 4e0b8205d..a49144ec0 100644 --- a/indra/newview/gpu_table.txt +++ b/indra/newview/gpu_table.txt @@ -164,15 +164,15 @@ Matrox .*Matrox.* 0 0 Mesa .*Mesa.* 0 0 NVIDIA GT 120 .*NVIDIA.*GeForce.*GT.*12.* 2 1 NVIDIA GT 130 .*NVIDIA.*GeForce.*GT.*13.* 3 1 -NVIDIA GT 220 .*NVIDIA.*GeForce.*GT.*22.* 3 1 +NVIDIA GT 220 .*NVIDIA.*GeForce.*GT.*22.* 3 1 NVIDIA GTS 250 .*NVIDIA.*GeForce.*GTS.*25.* 3 1 NVIDIA GTX 260 .*NVIDIA.*GeForce.*GTX.*26.* 3 1 NVIDIA GTX 270 .*NVIDIA.*GeForce.*GTX.*27.* 3 1 NVIDIA GTX 280 .*NVIDIA.*GeForce.*GTX.*28.* 3 1 NVIDIA GTX 290 .*NVIDIA.*GeForce.*GTX.*29.* 3 1 -NVIDIA GTX 460 .*NVIDIA.*GeForce.*GTX.*46.* 3 1 -NVIDIA GTX 470 .*NVIDIA.*GeForce.*GTX.*47.* 3 1 -NVIDIA GTX 480 .*NVIDIA.*GeForce.*GTX.*48.* 3 1 +NVIDIA GTX 460 .*NVIDIA.*GeForce.*GTX.*46.* 3 1 +NVIDIA GTX 470 .*NVIDIA.*GeForce.*GTX.*47.* 3 1 +NVIDIA GTX 480 .*NVIDIA.*GeForce.*GTX.*48.* 3 1 NVIDIA C51 .*NVIDIA.*C51.* 0 1 NVIDIA G72 .*NVIDIA.*G72.* 1 1 NVIDIA G73 .*NVIDIA.*G73.* 1 1 diff --git a/indra/newview/llagent.cpp b/indra/newview/llagent.cpp index 8fc5b94b8..54b68ed52 100644 --- a/indra/newview/llagent.cpp +++ b/indra/newview/llagent.cpp @@ -543,7 +543,8 @@ void LLAgent::resetView(BOOL reset_camera, BOOL change_camera) gMenuHolder->hideMenus(); } - if (change_camera && !gSavedSettings.getBOOL("FreezeTime")) + static LLCachedControl freeze_time("FreezeTime",false); + if (change_camera && !freeze_time) { changeCameraToDefault(); @@ -566,8 +567,7 @@ void LLAgent::resetView(BOOL reset_camera, BOOL change_camera) LLToolMgr::getInstance()->setCurrentToolset(gBasicToolset); } - - if (reset_camera && !gSavedSettings.getBOOL("FreezeTime")) + if (reset_camera && !freeze_time) { if (!gViewerWindow->getLeftMouseDown() && cameraThirdPerson()) { @@ -786,7 +786,8 @@ BOOL LLAgent::canFly() if (isGodlike()) return TRUE; // - if(gSavedSettings.getBOOL("AscentFlyAlwaysEnabled")) + static LLCachedControl ascent_fly_always_enabled("AscentFlyAlwaysEnabled",false); + if(ascent_fly_always_enabled) return TRUE; // @@ -1972,7 +1973,8 @@ void LLAgent::cameraOrbitIn(const F32 meters) mCameraZoomFraction = (mTargetCameraDistance - meters) / camera_offset_dist; - if (!gSavedSettings.getBOOL("FreezeTime") && mCameraZoomFraction < MIN_ZOOM_FRACTION && meters > 0.f) + static LLCachedControl freeze_time("FreezeTime",false); + if (!freeze_time && mCameraZoomFraction < MIN_ZOOM_FRACTION && meters > 0.f) { // No need to animate, camera is already there. changeCameraToMouselook(FALSE); @@ -2818,8 +2820,8 @@ void LLAgent::startTyping() if (mChatTimer.getElapsedTimeF32() < 2.f) { - LLViewerObject* chatter = gObjectList.findObject(mLastChatterID); - if (chatter && chatter->isAvatar()) + LLVOAvatar* chatter = gObjectList.findAvatar(mLastChatterID); + if (chatter) { gAgent.setLookAt(LOOKAT_TARGET_RESPOND, chatter, LLVector3::zero); } @@ -6367,7 +6369,8 @@ void LLAgent::teleportViaLocationLookAt(const LLVector3d& pos_global) void LLAgent::setTeleportState(ETeleportState state) { mTeleportState = state; - if (mTeleportState > TELEPORT_NONE && gSavedSettings.getBOOL("FreezeTime")) + static LLCachedControl freeze_time("FreezeTime",false); + if (mTeleportState > TELEPORT_NONE && freeze_time) { LLFloaterSnapshot::hide(0); } @@ -7536,7 +7539,7 @@ void LLAgent::sendAgentSetAppearance() LLColor4 color; if (!gSavedSettings.getBOOL("AscentStoreSettingsPerAccount")) { - color = LLSavedSettingsGlue::setCOAColor4("AscentCustomTagColor"); + color = gCOASavedSettings->setColor4("AscentCustomTagColor"); } else { diff --git a/indra/newview/llappviewer.cpp b/indra/newview/llappviewer.cpp index 5d57b35be..fe4f246e7 100644 --- a/indra/newview/llappviewer.cpp +++ b/indra/newview/llappviewer.cpp @@ -467,39 +467,32 @@ static void settings_modify() gDebugGL = gSavedSettings.getBOOL("RenderDebugGL"); gDebugPipeline = gSavedSettings.getBOOL("RenderDebugPipeline"); gAuditTexture = gSavedSettings.getBOOL("AuditTexture"); -#if LL_VECTORIZE - if (gSysCPU.hasAltivec()) + + if (gSysCPU.hasAltivec()) //for mac. No intrinsics used. No real risk of breaking compat. { gSavedSettings.setBOOL("VectorizeEnable", TRUE ); gSavedSettings.setU32("VectorizeProcessor", 0 ); } - else - if (gSysCPU.hasSSE2()) + + //Slightly confusing, but with linux llviewerjointmesh_sse(2) are compiled with relevent sse flags set. + //However, on windows or mac said files are only compiled with sse(2) if the entire project is. + else if (gSysCPU.hasSSE2() && LLViewerJointMesh::supportsSSE2()) { gSavedSettings.setBOOL("VectorizeEnable", TRUE ); gSavedSettings.setU32("VectorizeProcessor", 2 ); } - else - if (gSysCPU.hasSSE()) + else if (gSysCPU.hasSSE() && LLViewerJointMesh::supportsSSE()) { gSavedSettings.setBOOL("VectorizeEnable", TRUE ); gSavedSettings.setU32("VectorizeProcessor", 1 ); } - else + else // This build target doesn't support SSE, don't test/run. { - // Don't bother testing or running if CPU doesn't support it. JC gSavedSettings.setBOOL("VectorizePerfTest", FALSE ); gSavedSettings.setBOOL("VectorizeEnable", FALSE ); gSavedSettings.setU32("VectorizeProcessor", 0 ); gSavedSettings.setBOOL("VectorizeSkin", FALSE); } -#else - // This build target doesn't support SSE, don't test/run. - gSavedSettings.setBOOL("VectorizePerfTest", FALSE ); - gSavedSettings.setBOOL("VectorizeEnable", FALSE ); - gSavedSettings.setU32("VectorizeProcessor", 0 ); - gSavedSettings.setBOOL("VectorizeSkin", FALSE); -#endif } void LLAppViewer::initGridChoice() @@ -1027,7 +1020,7 @@ bool LLAppViewer::mainLoop() // Sleep and run background threads { LLFastTimer t2(LLFastTimer::FTM_SLEEP); - bool run_multiple_threads = gSavedSettings.getBOOL("RunMultipleThreads"); + static LLCachedControl run_multiple_threads("RunMultipleThreads",false); // yield some time to the os based on command line option if(mYieldTime >= 0) @@ -4084,7 +4077,8 @@ void LLAppViewer::resumeMainloopTimeout(const std::string& state, F32 secs) { if(secs < 0.0f) { - secs = gSavedSettings.getF32("MainloopTimeoutDefault"); + static LLCachedControl mainloop_timeout_default("ThrottleBandwidthKBPS",20); + secs = mainloop_timeout_default; } mMainloopTimeout->setTimeout(secs); @@ -4111,7 +4105,8 @@ void LLAppViewer::pingMainloopTimeout(const std::string& state, F32 secs) { if(secs < 0.0f) { - secs = gSavedSettings.getF32("MainloopTimeoutDefault"); + static LLCachedControl mainloop_timeout_default("ThrottleBandwidthKBPS",20); + secs = mainloop_timeout_default; } mMainloopTimeout->setTimeout(secs); diff --git a/indra/newview/llcallingcard.cpp b/indra/newview/llcallingcard.cpp index db28c7ad3..84c14b9f3 100644 --- a/indra/newview/llcallingcard.cpp +++ b/indra/newview/llcallingcard.cpp @@ -199,13 +199,13 @@ LLVector3d LLAvatarTracker::getGlobalPos() if(!mTrackedAgentValid || !mTrackingData) return LLVector3d(); LLVector3d global_pos; - LLViewerObject* object = gObjectList.findObject(mTrackingData->mAvatarID); - if(object && !object->isDead()) + LLVOAvatar* avatarp = gObjectList.findAvatar(mTrackingData->mAvatarID); + if(avatarp && !avatarp->isDead()) { - global_pos = object->getPositionGlobal(); + global_pos = avatarp->getPositionGlobal(); // HACK - for making the tracker point above the avatar's head // rather than its groin - global_pos.mdV[VZ] += 0.7f * ((LLVOAvatar *)object)->mBodySize.mV[VZ]; + global_pos.mdV[VZ] += 0.7f * avatarp->mBodySize.mV[VZ]; mTrackingData->mGlobalPositionEstimate = global_pos; } @@ -225,10 +225,10 @@ void LLAvatarTracker::getDegreesAndDist(F32& rot, LLVector3d global_pos; - LLViewerObject* object = gObjectList.findObject(mTrackingData->mAvatarID); - if(object && !object->isDead()) + LLVOAvatar* avatarp = gObjectList.findAvatar(mTrackingData->mAvatarID); + if(avatarp && !avatarp->isDead()) { - global_pos = object->getPositionGlobal(); + global_pos = avatarp->getPositionGlobal(); mTrackingData->mGlobalPositionEstimate = global_pos; } else @@ -761,8 +761,8 @@ void LLTrackingData::agentFound(const LLUUID& prey, bool LLTrackingData::haveTrackingInfo() { - LLViewerObject* object = gObjectList.findObject(mAvatarID); - if(object && !object->isDead()) + LLVOAvatar* avatarp = gObjectList.findAvatar(mAvatarID); + if(avatarp && !avatarp->isDead()) { mCoarseLocationTimer.checkExpirationAndReset(COARSE_FREQUENCY); mUpdateTimer.setTimerExpirySec(FIND_FREQUENCY); diff --git a/indra/newview/llcommandlineparser.cpp b/indra/newview/llcommandlineparser.cpp index c74406bf3..ba6dd56cf 100644 --- a/indra/newview/llcommandlineparser.cpp +++ b/indra/newview/llcommandlineparser.cpp @@ -100,6 +100,7 @@ class LLCLPValue : public po::value_semantic_codecvt_helper unsigned mMinTokens; unsigned mMaxTokens; bool mIsComposing; + bool mIsRequired; typedef boost::function1 notify_callback_t; notify_callback_t mNotifyCallback; bool mLastOption; @@ -108,6 +109,7 @@ public: LLCLPValue() : mMinTokens(0), mMaxTokens(0), + mIsRequired(false), mIsComposing(false), mLastOption(false) {} @@ -139,6 +141,10 @@ public: mNotifyCallback = f; } + void setRequired(bool c) + { + mIsRequired = c; + } // Overrides to support the value_semantic interface. virtual std::string name() const { @@ -177,7 +183,10 @@ public: } } - + virtual bool is_required(void) const + { + return mIsRequired; + } protected: void xparse(boost::any& value_store, const std::vector& new_tokens) const @@ -244,17 +253,13 @@ void LLCommandLineParser::addOptionDesc(const std::string& option_name, value_desc->setComposing(composing); value_desc->setLastOption(last_option); - boost::shared_ptr d( - new po::option_description(boost_option_name.c_str(), - value_desc, - description.c_str())); - if(!notify_callback.empty()) { value_desc->setNotifyCallback(notify_callback); } - - gOptionsDesc.add(d); + + po::options_description_easy_init gEasyInitDesc(&gOptionsDesc); + gEasyInitDesc(boost_option_name.c_str(),value_desc, description.c_str()); if(positional) { diff --git a/indra/newview/lldrawpoolbump.cpp b/indra/newview/lldrawpoolbump.cpp index 819756c3a..d03d6aa41 100644 --- a/indra/newview/lldrawpoolbump.cpp +++ b/indra/newview/lldrawpoolbump.cpp @@ -185,7 +185,8 @@ void LLDrawPoolBump::prerender() // static S32 LLDrawPoolBump::numBumpPasses() { - if (gSavedSettings.getBOOL("RenderObjectBump")) + static LLCachedControl render_object_bump("RenderObjectBump",false); + if (render_object_bump) { if (mVertexShaderLevel > 1) { diff --git a/indra/newview/lldrawpoolterrain.cpp b/indra/newview/lldrawpoolterrain.cpp index cac5162bc..fcad133f3 100644 --- a/indra/newview/lldrawpoolterrain.cpp +++ b/indra/newview/lldrawpoolterrain.cpp @@ -209,7 +209,8 @@ void LLDrawPoolTerrain::render(S32 pass) } // Special-case for land ownership feedback - if (gSavedSettings.getBOOL("ShowParcelOwners")) + static LLCachedControl show_parcel_owners("ShowParcelOwners",false); + if (show_parcel_owners) { if (mVertexShaderLevel > 1) { //use fullbright shader for highlighting diff --git a/indra/newview/llfeaturemanager.cpp b/indra/newview/llfeaturemanager.cpp index 35613b7c3..5de7c6faf 100644 --- a/indra/newview/llfeaturemanager.cpp +++ b/indra/newview/llfeaturemanager.cpp @@ -35,6 +35,9 @@ #include #include +#if LL_MSVC +#pragma warning( disable : 4265 ) // "class has virtual functions, but destructor is not virtual" +#endif #include #include "llfeaturemanager.h" diff --git a/indra/newview/llfloaterabout.cpp b/indra/newview/llfloaterabout.cpp index f5a9d677b..7148f0491 100644 --- a/indra/newview/llfloaterabout.cpp +++ b/indra/newview/llfloaterabout.cpp @@ -219,6 +219,18 @@ LLFloaterAbout::LLFloaterAbout() support.append( (const char*) glGetString(GL_VERSION) ); support.append("\n"); + std::string sse_ver = "None"; +#if _M_IX86_FP > 0 //Windows + sse_ver = llformat("SSE%i", _M_IX86_FP ); +#elif defined(__SSE2__) //GCC + sse_ver = "SSE2"; +#elif defined(__SSE__) //GCC + sse_ver = "SSE"; +#endif + support.append("SSE Version: "); + support.append(sse_ver); + support.append("\n"); + support.append("\n"); support.append("libcurl Version: "); diff --git a/indra/newview/llfloateractivespeakers.cpp b/indra/newview/llfloateractivespeakers.cpp index 4eb4a2623..8c39bdb82 100644 --- a/indra/newview/llfloateractivespeakers.cpp +++ b/indra/newview/llfloateractivespeakers.cpp @@ -1422,7 +1422,7 @@ void LLLocalSpeakerMgr::updateSpeakerList() LLSpeaker* speakerp = speaker_it->second; if (speakerp->mStatus == LLSpeaker::STATUS_TEXT_ONLY) { - LLVOAvatar* avatarp = (LLVOAvatar*)gObjectList.findObject(speaker_id); + LLVOAvatar* avatarp = gObjectList.findAvatar(speaker_id); if (!avatarp || dist_vec(avatarp->getPositionAgent(), gAgent.getPositionAgent()) > CHAT_NORMAL_RADIUS) { speakerp->mStatus = LLSpeaker::STATUS_NOT_IN_CHANNEL; diff --git a/indra/newview/llfloaterauction.cpp b/indra/newview/llfloaterauction.cpp index 85a0ef98b..8608d6d0b 100644 --- a/indra/newview/llfloaterauction.cpp +++ b/indra/newview/llfloaterauction.cpp @@ -44,7 +44,7 @@ #include "llagent.h" #include "llcombobox.h" -#include "llnotify.h" +#include "llnotify.h" #include "llviewerimagelist.h" #include "llviewerparcelmgr.h" #include "llviewerregion.h" diff --git a/indra/newview/llfloateravatarlist.cpp b/indra/newview/llfloateravatarlist.cpp index b2a1ff299..ff0ed248c 100644 --- a/indra/newview/llfloateravatarlist.cpp +++ b/indra/newview/llfloateravatarlist.cpp @@ -407,17 +407,10 @@ void LLFloaterAvatarList::updateAvatarList() const LLUUID &avid = avatar_ids[i]; LLVector3d position; - LLViewerObject *obj = gObjectList.findObject(avid); + LLVOAvatar* avatarp = gObjectList.findAvatar(avid); - if (obj) + if (avatarp) { - LLVOAvatar* avatarp = dynamic_cast(obj); - - if (avatarp == NULL) - { - continue; - } - // Skip if avatar is dead(what's that?) // or if the avatar is ourselves. // or if the avatar is a dummy @@ -816,7 +809,7 @@ void LLFloaterAvatarList::refreshAvatarList() LLColor4 avatar_name_color = gColors.getColor( "AvatarNameColor" ); std::string client; - LLVOAvatar *avatarp = (LLVOAvatar*)gObjectList.findObject(av_id); + LLVOAvatar *avatarp = gObjectList.findAvatar(av_id); if(avatarp) { avatarp->getClientInfo(client, avatar_name_color, TRUE); @@ -1276,9 +1269,9 @@ static void send_freeze(const LLUUID& avatar_id, bool freeze) } LLMessageSystem* msg = gMessageSystem; - LLViewerObject* avatar = gObjectList.findObject(avatar_id); + LLVOAvatar* avatarp = gObjectList.findAvatar(avatar_id); - if (avatar) + if (avatarp && avatarp->getRegion()) { msg->newMessage("FreezeUser"); msg->nextBlock("AgentData"); @@ -1287,16 +1280,16 @@ static void send_freeze(const LLUUID& avatar_id, bool freeze) msg->nextBlock("Data"); msg->addUUID("TargetID", avatar_id); msg->addU32("Flags", flags); - msg->sendReliable( avatar->getRegion()->getHost()); + msg->sendReliable( avatarp->getRegion()->getHost()); } } static void send_eject(const LLUUID& avatar_id, bool ban) { LLMessageSystem* msg = gMessageSystem; - LLViewerObject* avatar = gObjectList.findObject(avatar_id); + LLVOAvatar* avatarp = gObjectList.findAvatar(avatar_id); - if (avatar) + if (avatarp && avatarp->getRegion()) { U32 flags = 0x0; if (ban) @@ -1312,7 +1305,7 @@ static void send_eject(const LLUUID& avatar_id, bool ban) msg->nextBlock("Data"); msg->addUUID("TargetID", avatar_id); msg->addU32("Flags", flags); - msg->sendReliable( avatar->getRegion()->getHost()); + msg->sendReliable( avatarp->getRegion()->getHost()); } } diff --git a/indra/newview/llfloaterpostcard.cpp b/indra/newview/llfloaterpostcard.cpp index b0ab0f962..4400a1071 100644 --- a/indra/newview/llfloaterpostcard.cpp +++ b/indra/newview/llfloaterpostcard.cpp @@ -64,6 +64,9 @@ #include "llassetuploadresponders.h" +#if LL_MSVC +#pragma warning( disable : 4265 ) // "class has virtual functions, but destructor is not virtual" +#endif #include //boost.regex lib ///---------------------------------------------------------------------------- diff --git a/indra/newview/llfloatersnapshot.cpp b/indra/newview/llfloatersnapshot.cpp index e798c5aa4..d4e162ee4 100644 --- a/indra/newview/llfloatersnapshot.cpp +++ b/indra/newview/llfloatersnapshot.cpp @@ -733,7 +733,8 @@ BOOL LLSnapshotLivePreview::onIdle( void* snapshot_preview ) LLVector3 new_camera_pos = LLViewerCamera::getInstance()->getOrigin(); LLQuaternion new_camera_rot = LLViewerCamera::getInstance()->getQuaternion(); - if (gSavedSettings.getBOOL("FreezeTime") && + static LLCachedControl freeze_time("FreezeTime",false); + if (freeze_time && (new_camera_pos != previewp->mCameraPos || dot(new_camera_rot, previewp->mCameraRot) < 0.995f)) { previewp->mCameraPos = new_camera_pos; @@ -2159,7 +2160,8 @@ LLSnapshotFloaterView::~LLSnapshotFloaterView() BOOL LLSnapshotFloaterView::handleKey(KEY key, MASK mask, BOOL called_from_parent) { // use default handler when not in freeze-frame mode - if(!gSavedSettings.getBOOL("FreezeTime")) + static LLCachedControl freeze_time("FreezeTime",false); + if(!freeze_time) { return LLFloaterView::handleKey(key, mask, called_from_parent); } @@ -2180,7 +2182,8 @@ BOOL LLSnapshotFloaterView::handleKey(KEY key, MASK mask, BOOL called_from_paren BOOL LLSnapshotFloaterView::handleMouseDown(S32 x, S32 y, MASK mask) { // use default handler when not in freeze-frame mode - if(!gSavedSettings.getBOOL("FreezeTime")) + static LLCachedControl freeze_time("FreezeTime",false); + if(!freeze_time) { return LLFloaterView::handleMouseDown(x, y, mask); } @@ -2195,7 +2198,8 @@ BOOL LLSnapshotFloaterView::handleMouseDown(S32 x, S32 y, MASK mask) BOOL LLSnapshotFloaterView::handleMouseUp(S32 x, S32 y, MASK mask) { // use default handler when not in freeze-frame mode - if(!gSavedSettings.getBOOL("FreezeTime")) + static LLCachedControl freeze_time("FreezeTime",false); + if(!freeze_time) { return LLFloaterView::handleMouseUp(x, y, mask); } @@ -2210,7 +2214,8 @@ BOOL LLSnapshotFloaterView::handleMouseUp(S32 x, S32 y, MASK mask) BOOL LLSnapshotFloaterView::handleHover(S32 x, S32 y, MASK mask) { // use default handler when not in freeze-frame mode - if(!gSavedSettings.getBOOL("FreezeTime")) + static LLCachedControl freeze_time("FreezeTime",false); + if(!freeze_time) { return LLFloaterView::handleHover(x, y, mask); } diff --git a/indra/newview/llfolderview.cpp b/indra/newview/llfolderview.cpp index 15b7400e5..c121351b4 100644 --- a/indra/newview/llfolderview.cpp +++ b/indra/newview/llfolderview.cpp @@ -2939,7 +2939,8 @@ const std::string LLFolderView::getFilterSubString(BOOL trim) void LLFolderView::filter( LLInventoryFilter& filter ) { LLFastTimer t2(LLFastTimer::FTM_FILTER); - filter.setFilterCount(llclamp(gSavedSettings.getS32("FilterItemsPerFrame"), 1, 5000)); + static LLCachedControl filter_items_per_frame("FilterItemsPerFrame",500); + filter.setFilterCount(llclamp((S32)filter_items_per_frame, 1, 5000)); if (getCompletedFilterGeneration() < filter.getCurrentGeneration()) { @@ -4394,8 +4395,8 @@ void LLFolderView::doIdle() { LLFastTimer t2(LLFastTimer::FTM_INVENTORY); - BOOL debug_filters = gSavedSettings.getBOOL("DebugInventoryFilters"); - if (debug_filters != getDebugFilters()) + static LLCachedControl debug_filters("DebugInventoryFilters",false); + if (debug_filters != (bool)getDebugFilters()) { mDebugFilters = debug_filters; arrangeAll(); diff --git a/indra/newview/llglsandbox.cpp b/indra/newview/llglsandbox.cpp index 426258907..a7022f4df 100644 --- a/indra/newview/llglsandbox.cpp +++ b/indra/newview/llglsandbox.cpp @@ -677,6 +677,8 @@ void LLViewerParcelMgr::renderParcel(LLParcel* parcel ) // coordinates correctly. void LLViewerParcelMgr::renderOneSegment(F32 x1, F32 y1, F32 x2, F32 y2, F32 height, U8 direction, LLViewerRegion* regionp) { + if(!regionp) //This has been null before. Oh no! + return; // HACK: At edge of last region of world, we need to make sure the region // resolves correctly so we can get a height value. const F32 BORDER = REGION_WIDTH_METERS - 0.1f; @@ -692,11 +694,8 @@ void LLViewerParcelMgr::renderOneSegment(F32 x1, F32 y1, F32 x2, F32 y2, F32 hei if (clamped_y2 > BORDER) clamped_y2 = BORDER; F32 z; - F32 z1; - F32 z2; - - z1 = regionp->getLand().resolveHeightRegion( LLVector3( clamped_x1, clamped_y1, 0.f ) ); - z2 = regionp->getLand().resolveHeightRegion( LLVector3( clamped_x2, clamped_y2, 0.f ) ); + F32 z1 = regionp->getLand().resolveHeightRegion( LLVector3( clamped_x1, clamped_y1, 0.f ) );; + F32 z2 = regionp->getLand().resolveHeightRegion( LLVector3( clamped_x2, clamped_y2, 0.f ) );; // Convert x1 and x2 from region-local to agent coords. LLVector3 origin = regionp->getOriginAgent(); diff --git a/indra/newview/llgroupmgr.cpp b/indra/newview/llgroupmgr.cpp index c13ec6303..01d21f250 100644 --- a/indra/newview/llgroupmgr.cpp +++ b/indra/newview/llgroupmgr.cpp @@ -54,6 +54,9 @@ #include "llfloaterdirectory.h" #include "llfloatergroupinfo.h" #include "lluictrlfactory.h" +#if LL_MSVC +#pragma warning( disable : 4265 ) // "class has virtual functions, but destructor is not virtual" +#endif #include diff --git a/indra/newview/llhudeffectlookat.cpp b/indra/newview/llhudeffectlookat.cpp index 1dbbe8922..d22b8f1b9 100644 --- a/indra/newview/llhudeffectlookat.cpp +++ b/indra/newview/llhudeffectlookat.cpp @@ -340,20 +340,20 @@ void LLHUDEffectLookAt::unpackData(LLMessageSystem *mesgsys, S32 blocknum) htonmemcpy(source_id.mData, &(packed_data[SOURCE_AVATAR]), MVT_LLUUID, 16); - LLViewerObject *objp = gObjectList.findObject(source_id); - if (objp && objp->isAvatar()) { - setSourceObject(objp); - } - else - { - //llwarns << "Could not find source avatar for lookat effect" << llendl; - return; + LLVOAvatar *avatarp = gObjectList.findAvatar(source_id); + if (avatarp) + setSourceObject(avatarp); + else + { + //llwarns << "Could not find source avatar for lookat effect" << llendl; + return; + } } htonmemcpy(target_id.mData, &(packed_data[TARGET_OBJECT]), MVT_LLUUID, 16); - objp = gObjectList.findObject(target_id); + LLViewerObject *objp = gObjectList.findObject(target_id); htonmemcpy(new_target.mdV, &(packed_data[TARGET_POS]), MVT_LLVector3d, 24); @@ -504,7 +504,8 @@ void LLHUDEffectLookAt::setSourceObject(LLViewerObject* objectp) //----------------------------------------------------------------------------- void LLHUDEffectLookAt::render() { - if (gSavedSettings.getBOOL("PrivateLookAt") && + static LLCachedControl private_look_at("PrivateLookAt",false); + if (private_look_at && (gAgent.getAvatarObject() == ((LLVOAvatar*)(LLViewerObject*)mSourceObject))) return; if (sDebugLookAt && mSourceObject.notNull()) { diff --git a/indra/newview/llhudeffectpointat.cpp b/indra/newview/llhudeffectpointat.cpp index 0bf863728..10409a95b 100644 --- a/indra/newview/llhudeffectpointat.cpp +++ b/indra/newview/llhudeffectpointat.cpp @@ -170,20 +170,20 @@ void LLHUDEffectPointAt::unpackData(LLMessageSystem *mesgsys, S32 blocknum) htonmemcpy(source_id.mData, &(packed_data[SOURCE_AVATAR]), MVT_LLUUID, 16); - LLViewerObject *objp = gObjectList.findObject(source_id); - if (objp && objp->isAvatar()) { - setSourceObject(objp); - } - else - { - //llwarns << "Could not find source avatar for pointat effect" << llendl; - return; + LLVOAvatar *avatarp = gObjectList.findAvatar(source_id); + if (avatarp) + setSourceObject(avatarp); + else + { + //llwarns << "Could not find source avatar for pointat effect" << llendl; + return; + } } htonmemcpy(target_id.mData, &(packed_data[TARGET_OBJECT]), MVT_LLUUID, 16); - objp = gObjectList.findObject(target_id); + LLViewerObject* objp = gObjectList.findObject(target_id); htonmemcpy(new_target.mdV, &(packed_data[TARGET_POS]), MVT_LLVector3d, 24); diff --git a/indra/newview/llhudtext.cpp b/indra/newview/llhudtext.cpp index d12853e98..30c0c179f 100644 --- a/indra/newview/llhudtext.cpp +++ b/indra/newview/llhudtext.cpp @@ -293,8 +293,11 @@ void LLHUDText::renderText(BOOL for_select) LLUIImagePtr imagep = LLUI::getUIImage("rounded_square.tga"); // *TODO: make this a per-text setting - LLColor4 bg_color = gSavedSettings.getColor4("BackgroundChatColor"); - bg_color.setAlpha(gSavedSettings.getF32("ChatBubbleOpacity") * alpha_factor); + static LLCachedControl background_chat_color("BackgroundChatColor", LLColor4(0,0,0,1.f)); + //static LLColor4 background_chat_color(0,0,0,1.f); + static LLCachedControl chat_bubble_opacity("ChatBubbleOpacity", .5); + LLColor4 bg_color = background_chat_color; + bg_color.setAlpha(chat_bubble_opacity * alpha_factor); const S32 border_height = 16; const S32 border_width = 16; diff --git a/indra/newview/llmenucommands.cpp b/indra/newview/llmenucommands.cpp index ac77a920a..88077f8cd 100644 --- a/indra/newview/llmenucommands.cpp +++ b/indra/newview/llmenucommands.cpp @@ -124,7 +124,8 @@ void handle_inventory(void*) void handle_chat(void*) { // give focus to chatbar if it's open but not focused - if (gSavedSettings.getBOOL("ChatVisible") && gFocusMgr.childHasKeyboardFocus(gChatBar)) + static LLCachedControl chat_visible("ChatVisible",true); + if (chat_visible && gFocusMgr.childHasKeyboardFocus(gChatBar)) { LLChatBar::stopChat(); } diff --git a/indra/newview/lloverlaybar.cpp b/indra/newview/lloverlaybar.cpp index c786c9710..a68924c22 100644 --- a/indra/newview/lloverlaybar.cpp +++ b/indra/newview/lloverlaybar.cpp @@ -371,7 +371,8 @@ void LLOverlayBar::refresh() childSetVisible("voice_remote_container", LLVoiceClient::voiceEnabled()); // always let user toggle into and out of chatbar - childSetVisible("chat_bar", gSavedSettings.getBOOL("ChatVisible")); + static LLCachedControl chat_visible("ChatVisible",true); + childSetVisible("chat_bar", chat_visible); if (buttons_changed) { diff --git a/indra/newview/llpaneldisplay.cpp b/indra/newview/llpaneldisplay.cpp index 035b43ff0..154412188 100644 --- a/indra/newview/llpaneldisplay.cpp +++ b/indra/newview/llpaneldisplay.cpp @@ -83,6 +83,9 @@ // parent #include "llfloaterpreference.h" +#if LL_MSVC +#pragma warning( disable : 4265 ) // "class has virtual functions, but destructor is not virtual" +#endif #include const F32 MAX_USER_FAR_CLIP = 512.f; @@ -819,7 +822,6 @@ bool LLPanelDisplay::extractWindowSizeFromString(const std::string& instr, U32 & height = atoi(what[2].first); return true; } - width = height = 0; return false; } diff --git a/indra/newview/llpanelgroupinvite.cpp b/indra/newview/llpanelgroupinvite.cpp index eedec9c8e..04c3849c3 100644 --- a/indra/newview/llpanelgroupinvite.cpp +++ b/indra/newview/llpanelgroupinvite.cpp @@ -392,13 +392,13 @@ void LLPanelGroupInvite::addUsers(std::vector& agent_ids) for (S32 i = 0; i < (S32)agent_ids.size(); i++) { LLUUID agent_id = agent_ids[i]; - LLViewerObject* dest = gObjectList.findObject(agent_id); - if(dest && dest->isAvatar()) + LLVOAvatar* avatarp = gObjectList.findAvatar(agent_id); + if(avatarp) { std::string fullname; LLSD args; - LLNameValue* nvfirst = dest->getNVPair("FirstName"); - LLNameValue* nvlast = dest->getNVPair("LastName"); + LLNameValue* nvfirst = avatarp->getNVPair("FirstName"); + LLNameValue* nvlast = avatarp->getNVPair("LastName"); if(nvfirst && nvlast) { args["FIRST"] = std::string(nvfirst->getString()); @@ -411,7 +411,7 @@ void LLPanelGroupInvite::addUsers(std::vector& agent_ids) } else { - llwarns << "llPanelGroupInvite: Selected avatar has no name: " << dest->getID() << llendl; + llwarns << "llPanelGroupInvite: Selected avatar has no name: " << avatarp->getID() << llendl; names.push_back("(Unknown)"); } } diff --git a/indra/newview/llsavedsettingsglue.cpp b/indra/newview/llsavedsettingsglue.cpp index f3798f4b0..e6feae31d 100644 --- a/indra/newview/llsavedsettingsglue.cpp +++ b/indra/newview/llsavedsettingsglue.cpp @@ -38,7 +38,6 @@ #include "lluictrl.h" #include "llviewercontrol.h" - /* void LLSavedSettingsGlue::setBOOL(LLUICtrl* ctrl, void* data) { diff --git a/indra/newview/llsavedsettingsglue.h b/indra/newview/llsavedsettingsglue.h index 06799ec63..2d4b10d51 100644 --- a/indra/newview/llsavedsettingsglue.h +++ b/indra/newview/llsavedsettingsglue.h @@ -41,7 +41,8 @@ class LLUICtrl; // and assign the control name as a const char* to the userdata. class LLSavedSettingsGlue { -public:/* +public: +/* static void setBOOL(LLUICtrl* ctrl, void* name); static void setS32(LLUICtrl* ctrl, void* name); static void setF32(LLUICtrl* ctrl, void* name); diff --git a/indra/newview/llstartup.cpp b/indra/newview/llstartup.cpp index 56e2713c4..2edd5ffb8 100644 --- a/indra/newview/llstartup.cpp +++ b/indra/newview/llstartup.cpp @@ -2644,7 +2644,6 @@ bool idle_startup() LLFloaterBeacons::showInstance(); DIE -HgB }*/ - if (!gNoRender) { //Set up cloud rendertypes. Passed argument is unused. diff --git a/indra/newview/llstatgraph.cpp b/indra/newview/llstatgraph.cpp index 26b7494c0..75e4c525d 100644 --- a/indra/newview/llstatgraph.cpp +++ b/indra/newview/llstatgraph.cpp @@ -109,7 +109,8 @@ void LLStatGraph::draw() // gColors.getColor("ColorDropShadow"), // (S32) gSavedSettings.getF32("DropShadowFloater") ); - color = gColors.getColor( "MenuDefaultBgColor" ); + static LLCachedControl menu_default_color("MenuDefaultBgColor",LLColor4(0,0,255),gColors); + color = menu_default_color; gGL.color4fv(color.mV); gl_rect_2d(0, getRect().getHeight(), getRect().getWidth(), 0, TRUE); diff --git a/indra/newview/llstatusbar.cpp b/indra/newview/llstatusbar.cpp index 2a1fb9e9a..639352d5a 100644 --- a/indra/newview/llstatusbar.cpp +++ b/indra/newview/llstatusbar.cpp @@ -236,9 +236,11 @@ void LLStatusBar::draw() if (isBackgroundVisible()) { + static LLCachedControl color_drop_shadow("ColorDropShadow",LLColor4(0,0,200),LLUI::sColorsGroup); + static LLCachedControl drop_shadow_floater("DropShadowFloater",5,LLUI::sConfigGroup); gl_drop_shadow(0, getRect().getHeight(), getRect().getWidth(), 0, - LLUI::sColorsGroup->getColor("ColorDropShadow"), - LLUI::sConfigGroup->getS32("DropShadowFloater") ); + color_drop_shadow, + drop_shadow_floater ); } LLPanel::draw(); } diff --git a/indra/newview/lltexturefetch.cpp b/indra/newview/lltexturefetch.cpp index e4516fa85..abfec79bb 100644 --- a/indra/newview/lltexturefetch.cpp +++ b/indra/newview/lltexturefetch.cpp @@ -722,7 +722,8 @@ bool LLTextureFetchWorker::doWork(S32 param) if (mState == LOAD_FROM_NETWORK) { - bool get_url = gSavedSettings.getBOOL("ImagePipelineUseHTTP"); + static LLCachedControl image_pipeline_use_http("ImagePipelineUseHTTP",false); + bool get_url = image_pipeline_use_http; if (!mUrl.empty()) get_url = false; // if (mHost != LLHost::invalid) get_url = false; if ( get_url ) @@ -1605,7 +1606,8 @@ S32 LLTextureFetch::update(U32 max_time_ms) { S32 res; - mMaxBandwidth = gSavedSettings.getF32("ThrottleBandwidthKBPS"); + static LLCachedControl throttle_bandwidth_kbps("ThrottleBandwidthKBPS",500); + mMaxBandwidth = throttle_bandwidth_kbps; res = LLWorkerThread::update(max_time_ms); diff --git a/indra/newview/lltoolbar.cpp b/indra/newview/lltoolbar.cpp index be6f5f798..973aa336f 100644 --- a/indra/newview/lltoolbar.cpp +++ b/indra/newview/lltoolbar.cpp @@ -305,7 +305,9 @@ void LLToolBar::refresh() { build_mode = FALSE; } - gSavedSettings.setBOOL("BuildBtnState", build_mode); + static LLCachedControl build_btn_state("BuildBtnState",false); + if(build_btn_state!=(bool)build_mode) + build_btn_state = build_mode; if (isInVisibleChain()) { diff --git a/indra/newview/lltoolfocus.cpp b/indra/newview/lltoolfocus.cpp index 351c02b4c..c246cd5e4 100644 --- a/indra/newview/lltoolfocus.cpp +++ b/indra/newview/lltoolfocus.cpp @@ -216,10 +216,11 @@ void LLToolCamera::pickCallback(const LLPickInfo& pick_info) gAgent.setFocusGlobal(pick_info); } + static LLCachedControl freeze_time("FreezeTime",0); if (!(pick_info.mKeyMask & MASK_ALT) && gAgent.cameraThirdPerson() && gViewerWindow->getLeftMouseDown() && - !gSavedSettings.getBOOL("FreezeTime") && + !freeze_time && (hit_obj == gAgent.getAvatarObject() || (hit_obj && hit_obj->isAttachment() && LLVOAvatar::findAvatarFromAttachment(hit_obj)->isSelf()))) { diff --git a/indra/newview/lltoolmgr.cpp b/indra/newview/lltoolmgr.cpp index 65dce2c0c..993219723 100644 --- a/indra/newview/lltoolmgr.cpp +++ b/indra/newview/lltoolmgr.cpp @@ -239,8 +239,9 @@ bool LLToolMgr::inBuildMode() // when entering mouselook inEdit() immediately returns true before // cameraMouselook() actually starts returning true. Also, appearance edit // sets build mode to true, so let's exclude that. + static LLCachedControl build_btn_state("BuildBtnState",false); bool b=(inEdit() - && gSavedSettings.getBOOL("BuildBtnState") + && build_btn_state && !gAgent.cameraMouselook() && mCurrentToolset != gFaceEditToolset); diff --git a/indra/newview/llvieweraudio.cpp b/indra/newview/llvieweraudio.cpp index dc7943bd7..713da4e32 100644 --- a/indra/newview/llvieweraudio.cpp +++ b/indra/newview/llvieweraudio.cpp @@ -114,9 +114,26 @@ void init_audio() void audio_update_volume(bool force_update) { - F32 master_volume = gSavedSettings.getF32("AudioLevelMaster"); - BOOL mute_audio = gSavedSettings.getBOOL("MuteAudio"); - if (!gViewerWindow->getActive() && (gSavedSettings.getBOOL("MuteWhenMinimized"))) + static LLCachedControl master_volume("AudioLevelMaster",1.0); + static LLCachedControl audio_level_sfx("AudioLevelSFX",1.0); + static LLCachedControl audio_level_ui("AudioLevelUI",1.0); + static LLCachedControl audio_level_ambient("AudioLevelAmbient",1.0); + static LLCachedControl audio_level_music("AudioLevelMusic",1.0); + static LLCachedControl audio_level_media("AudioLevelMedia",1.0); + static LLCachedControl audio_level_voice("AudioLevelVoice",1.0); + static LLCachedControl audio_level_mic("AudioLevelMic",1.0); + static LLCachedControl _mute_audio("MuteAudio",false); + static LLCachedControl mute_sounds("MuteSounds",false); + static LLCachedControl mute_ui("MuteUI",false); + static LLCachedControl mute_ambient("MuteAmbient",false); + static LLCachedControl mute_music("MuteMusic",false); + static LLCachedControl mute_media("MuteMedia",false); + static LLCachedControl mute_voice("MuteVoice",false); + static LLCachedControl mute_when_minimized("MuteWhenMinimized",true); + static LLCachedControl audio_level_doppler("AudioLevelDoppler",1.0); + static LLCachedControl audio_level_rolloff("AudioLevelRolloff",1.0); + BOOL mute_audio = _mute_audio; + if (!gViewerWindow->getActive() && mute_when_minimized) { mute_audio = TRUE; } @@ -127,8 +144,8 @@ void audio_update_volume(bool force_update) { gAudiop->setMasterGain ( master_volume ); - gAudiop->setDopplerFactor(gSavedSettings.getF32("AudioLevelDoppler")); - gAudiop->setRolloffFactor(gSavedSettings.getF32("AudioLevelRolloff")); + gAudiop->setDopplerFactor(audio_level_doppler); + gAudiop->setRolloffFactor(audio_level_rolloff); gAudiop->setMuted(mute_audio); if (force_update) @@ -138,39 +155,33 @@ void audio_update_volume(bool force_update) // handle secondary gains gAudiop->setSecondaryGain(LLAudioEngine::AUDIO_TYPE_SFX, - gSavedSettings.getBOOL("MuteSounds") ? 0.f : gSavedSettings.getF32("AudioLevelSFX")); + mute_sounds ? 0.f : audio_level_sfx); gAudiop->setSecondaryGain(LLAudioEngine::AUDIO_TYPE_UI, - gSavedSettings.getBOOL("MuteUI") ? 0.f : gSavedSettings.getF32("AudioLevelUI")); + mute_ui ? 0.f : audio_level_ui); gAudiop->setSecondaryGain(LLAudioEngine::AUDIO_TYPE_AMBIENT, - gSavedSettings.getBOOL("MuteAmbient") ? 0.f : gSavedSettings.getF32("AudioLevelAmbient")); + mute_ambient ? 0.f : audio_level_ambient); } // Streaming Music if (gAudiop) { - F32 music_volume = gSavedSettings.getF32("AudioLevelMusic"); - BOOL music_muted = gSavedSettings.getBOOL("MuteMusic"); - music_volume = mute_volume * master_volume * (music_volume*music_volume); - gAudiop->setInternetStreamGain ( music_muted ? 0.f : music_volume ); + F32 music_volume = mute_volume * master_volume * (audio_level_music*audio_level_music); + gAudiop->setInternetStreamGain ( mute_music ? 0.f : music_volume ); } // Streaming Media - F32 media_volume = gSavedSettings.getF32("AudioLevelMedia"); - BOOL media_muted = gSavedSettings.getBOOL("MuteMedia"); - media_volume = mute_volume * master_volume * (media_volume*media_volume); - LLViewerMedia::setVolume( media_muted ? 0.0f : media_volume ); + F32 media_volume = mute_volume * master_volume * (audio_level_media*audio_level_media); + LLViewerMedia::setVolume( mute_media ? 0.0f : media_volume ); // Voice if (gVoiceClient) { - F32 voice_volume = gSavedSettings.getF32("AudioLevelVoice"); - voice_volume = mute_volume * master_volume * voice_volume; - BOOL voice_mute = gSavedSettings.getBOOL("MuteVoice"); - gVoiceClient->setVoiceVolume(voice_mute ? 0.f : voice_volume); - gVoiceClient->setMicGain(voice_mute ? 0.f : gSavedSettings.getF32("AudioLevelMic")); + F32 voice_volume = mute_volume * master_volume * audio_level_voice; + gVoiceClient->setVoiceVolume(mute_voice ? 0.f : voice_volume); + gVoiceClient->setMicGain(mute_voice ? 0.f : audio_level_mic); - if (!gViewerWindow->getActive() && (gSavedSettings.getBOOL("MuteWhenMinimized"))) + if (!gViewerWindow->getActive() && mute_when_minimized) { gVoiceClient->setMuteMic(true); } @@ -217,13 +228,14 @@ void audio_update_wind(bool force_update) // if (force_update || (last_camera_water_height * camera_water_height) < 0.f) { + static LLCachedControl audio_level_rolloff("AudioLevelRolloff",1); if (camera_water_height < 0.f) { - gAudiop->setRolloffFactor(gSavedSettings.getF32("AudioLevelRolloff") * LL_ROLLOFF_MULTIPLIER_UNDER_WATER); + gAudiop->setRolloffFactor(audio_level_rolloff * LL_ROLLOFF_MULTIPLIER_UNDER_WATER); } else { - gAudiop->setRolloffFactor(gSavedSettings.getF32("AudioLevelRolloff")); + gAudiop->setRolloffFactor(audio_level_rolloff); } } // this line rotates the wind vector to be listener (agent) relative @@ -234,8 +246,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 master_volume = gSavedSettings.getBOOL("MuteAudio") ? 0.f : gSavedSettings.getF32("AudioLevelMaster"); - F32 ambient_volume = gSavedSettings.getBOOL("MuteAmbient") ? 0.f : gSavedSettings.getF32("AudioLevelAmbient"); + static LLCachedControl mute_audio("MuteAudio",false); + static LLCachedControl mute_ambient("MuteAmbient",false); + static LLCachedControl audio_level_master("AudioLevelMaster",1); + static LLCachedControl audio_level_ambient("AudioLevelAmbient",1); + F32 master_volume = mute_audio ? 0.f : mute_ambient; + F32 ambient_volume = mute_ambient ? 0.f : audio_level_ambient; F32 wind_volume = master_volume * ambient_volume; gAudiop->mMaxWindGain = wind_volume; diff --git a/indra/newview/llviewercontrol.cpp b/indra/newview/llviewercontrol.cpp index 036b4e692..924f7e056 100644 --- a/indra/newview/llviewercontrol.cpp +++ b/indra/newview/llviewercontrol.cpp @@ -659,7 +659,7 @@ void settings_setup_listeners() gSavedSettings.getControl("VoiceOutputAudioDevice")->getSignal()->connect(boost::bind(&handleVoiceClientPrefsChanged, _1)); gSavedSettings.getControl("AudioLevelMic")->getSignal()->connect(boost::bind(&handleVoiceClientPrefsChanged, _1)); gSavedSettings.getControl("LipSyncEnabled")->getSignal()->connect(boost::bind(&handleVoiceClientPrefsChanged, _1)); - gSavedSettings.getControl("TranslateChat")->getSignal()->connect(boost::bind(&handleTranslateChatPrefsChanged, _1)); + gSavedSettings.getControl("TranslateChat")->getSignal()->connect(boost::bind(&handleTranslateChatPrefsChanged, _1)); gSavedSettings.getControl("CloudsEnabled")->getSignal()->connect(boost::bind(&handleCloudSettingsChanged, _1)); gSavedSettings.getControl("SkyUseClassicClouds")->getSignal()->connect(boost::bind(&handleCloudSettingsChanged, _1)); @@ -757,7 +757,6 @@ template <> eControlType get_control_type(const LLSD& in, LLSD& out) return TYPE_LLSD; } - #if TEST_CACHED_CONTROL #define DECL_LLCC(T, V) static LLCachedControl mySetting_##T("TestCachedControl"#T, V) diff --git a/indra/newview/llviewercontrol.h b/indra/newview/llviewercontrol.h index 6485d72b5..76318ed2c 100644 --- a/indra/newview/llviewercontrol.h +++ b/indra/newview/llviewercontrol.h @@ -89,17 +89,31 @@ class LLCachedControl T mCachedValue; LLPointer mControl; boost::signals::connection mConnection; + LLControlGroup *mControlGroup; public: - LLCachedControl(const std::string& name, + LLCachedControl(const std::string& name, const T& default_value, LLControlGroup *group, const std::string& comment = "Declared In Code") + {Init(name,default_value,comment,*group);} //for gSavedPerAccountSettings, etc + LLCachedControl(const std::string& name, const T& default_value, LLControlGroup &group, const std::string& comment = "Declared In Code") + {Init(name,default_value,comment,group);} //for LLUI::sConfigGroup, etc + LLCachedControl(const std::string& name, const T& default_value, - const std::string& comment = "Declared In Code") + const std::string& comment = "Declared In Code", + LLControlGroup &group = gSavedSettings) + {Init(name,default_value,comment,group);} //for default (gSavedSettings) +private: + //Pulled out of ctor due to problems with initializer lists in template classes + void Init( const std::string& name, + const T& default_value, + const std::string& comment, + LLControlGroup &group ) { - mControl = gSavedSettings.getControl(name); + mControlGroup = &group; + mControl = mControlGroup->getControl(name); if(mControl.isNull()) { - declareTypedControl(gSavedSettings, name, default_value, comment); - mControl = gSavedSettings.getControl(name); + declareTypedControl(*mControlGroup, name, default_value, comment); + mControl = mControlGroup->getControl(name); if(mControl.isNull()) { llerrs << "The control could not be created!!!" << llendl; @@ -113,11 +127,12 @@ public: } // Add a listener to the controls signal... - mControl->getSignal()->connect( + // and store the connection... + mConnection = mControl->getSignal()->connect( boost::bind(&LLCachedControl::handleValueChange, this, _1) ); } - +public: ~LLCachedControl() { if(mConnection.connected()) @@ -129,6 +144,7 @@ public: LLCachedControl& operator =(const T& newvalue) { setTypeValue(*mControl, newvalue); + return *this; } operator const T&() { return mCachedValue; } @@ -160,6 +176,42 @@ private: } }; +//Easiest way without messing with LLCachedControl even more.. +template +class LLCachedCOAControl +{ + LLCachedControl *mCachedControl; + boost::signals::connection mCOAConnection; + const std::string mName; + const std::string mComment; + const T mDefault; +public: + LLCachedCOAControl(const std::string& name, const T& default_value,const std::string& comment = "Declared In Code") + : mName(name),mDefault(default_value),mComment(comment) + { + mCachedControl = new LLCachedControl(mName,mDefault,gCOASavedSettings,mComment); + + static LLCachedControl settings_per_account("AscentStoreSettingsPerAccount",false); + mCOAConnection = settings_per_account.getControl()->getSignal()->connect( + boost::bind(&LLCachedCOAControl::handleCOAValueChange, this, _1)); + } + ~LLCachedCOAControl() + { + if(mCachedControl) + delete mCOAConnection; + if(mCOAConnection.connected()) + mCOAConnection.disconnect(); + } + bool handleCOAValueChange(const LLSD& newvalue) + { + if(mCachedControl) + delete mCachedControl; + mCachedControl = new LLCachedControl(mName,mDefault,gCOASavedSettings,mComment); + return true; + } + operator const T&() { return *mCachedControl; } +}; + template <> eControlType get_control_type(const U32& in, LLSD& out); template <> eControlType get_control_type(const S32& in, LLSD& out); template <> eControlType get_control_type(const F32& in, LLSD& out); diff --git a/indra/newview/llviewerjointmesh.cpp b/indra/newview/llviewerjointmesh.cpp index b6f0dafae..747016376 100644 --- a/indra/newview/llviewerjointmesh.cpp +++ b/indra/newview/llviewerjointmesh.cpp @@ -865,12 +865,18 @@ void LLViewerJointMesh::updateVectorize() { case 2: sUpdateGeometryFunc = &updateGeometrySSE2; + if(!supportsSSE2()) + LL_INFOS("AppInit") << "VectorizeProcessor set to unsupported implementation! (SSE2)" << LL_ENDL ; break; case 1: sUpdateGeometryFunc = &updateGeometrySSE; + if(!supportsSSE()) + LL_INFOS("AppInit") << "VectorizeProcessor set to unsupported implementation! (SSE)" << LL_ENDL ; break; default: sUpdateGeometryFunc = &updateGeometryVectorized; + if(!gSysCPU.hasAltivec()) + LL_INFOS("AppInit") << "VectorizeProcessor set to unsupported implementation! (Altivec)" << LL_ENDL ; break; } } diff --git a/indra/newview/llviewerjointmesh.h b/indra/newview/llviewerjointmesh.h index 0cae48df9..b6156c8f5 100644 --- a/indra/newview/llviewerjointmesh.h +++ b/indra/newview/llviewerjointmesh.h @@ -152,6 +152,8 @@ public: static void updateVectorize(); // Update globals when settings variables change + static bool supportsSSE(); + static bool supportsSSE2(); private: // Avatar vertex skinning is a significant performance issue on computers // with avatar vertex programs turned off (for example, most Macs). We diff --git a/indra/newview/llviewerjointmesh_sse.cpp b/indra/newview/llviewerjointmesh_sse.cpp index e586b910c..f4056e1af 100644 --- a/indra/newview/llviewerjointmesh_sse.cpp +++ b/indra/newview/llviewerjointmesh_sse.cpp @@ -109,6 +109,10 @@ void LLViewerJointMesh::updateGeometrySSE(LLFace *face, LLPolyMesh *mesh) buffer->setBuffer(0); } +bool LLViewerJointMesh::supportsSSE() +{ + return true; +} #else @@ -116,5 +120,10 @@ void LLViewerJointMesh::updateGeometrySSE(LLFace *face, LLPolyMesh *mesh) { LLViewerJointMesh::updateGeometryVectorized(face, mesh); } +bool LLViewerJointMesh::supportsSSE() +{ + return false; +} #endif + diff --git a/indra/newview/llviewerjointmesh_sse2.cpp b/indra/newview/llviewerjointmesh_sse2.cpp index 550044c32..2648f6af3 100644 --- a/indra/newview/llviewerjointmesh_sse2.cpp +++ b/indra/newview/llviewerjointmesh_sse2.cpp @@ -59,7 +59,7 @@ #include "v3math.h" -#if LL_VECTORIZE +#if LL_VECTORIZE && (_M_IX86_FP > 1 || defined(__SSE2__) ) //These intrinsics are only valid with sse2 or higher. inline void matrix_translate(LLV4Matrix4& m, const LLMatrix4* w, const LLVector3& j) @@ -116,6 +116,10 @@ void LLViewerJointMesh::updateGeometrySSE2(LLFace *face, LLPolyMesh *mesh) //setBuffer(0) called in LLVOAvatar::renderSkinned } +bool LLViewerJointMesh::supportsSSE2() +{ + return true; +} #else @@ -123,5 +127,9 @@ void LLViewerJointMesh::updateGeometrySSE2(LLFace *face, LLPolyMesh *mesh) { LLViewerJointMesh::updateGeometryVectorized(face, mesh); } +bool LLViewerJointMesh::supportsSSE2() +{ + return false; +} #endif diff --git a/indra/newview/llviewermenu.cpp b/indra/newview/llviewermenu.cpp index ff7de906a..c5bd790d5 100644 --- a/indra/newview/llviewermenu.cpp +++ b/indra/newview/llviewermenu.cpp @@ -2674,9 +2674,9 @@ bool callback_freeze(const LLSD& notification, const LLSD& response) } LLMessageSystem* msg = gMessageSystem; - LLViewerObject* avatar = gObjectList.findObject(avatar_id); + LLVOAvatar* avatarp = gObjectList.findAvatar(avatar_id); - if (avatar) + if (avatarp && avatarp->getRegion()) { msg->newMessage("FreezeUser"); msg->nextBlock("AgentData"); @@ -2685,7 +2685,7 @@ bool callback_freeze(const LLSD& notification, const LLSD& response) msg->nextBlock("Data"); msg->addUUID("TargetID", avatar_id ); msg->addU32("Flags", flags ); - msg->sendReliable( avatar->getRegion()->getHost() ); + msg->sendReliable( avatarp->getRegion()->getHost() ); } } return false; @@ -2836,9 +2836,9 @@ bool callback_eject(const LLSD& notification, const LLSD& response) { // Eject button LLMessageSystem* msg = gMessageSystem; - LLViewerObject* avatar = gObjectList.findObject(avatar_id); + LLVOAvatar* avatarp = gObjectList.findAvatar(avatar_id); - if (avatar) + if (avatarp && avatarp->getRegion()) { U32 flags = 0x0; msg->newMessage("EjectUser"); @@ -2848,7 +2848,7 @@ bool callback_eject(const LLSD& notification, const LLSD& response) msg->nextBlock("Data"); msg->addUUID("TargetID", avatar_id ); msg->addU32("Flags", flags ); - msg->sendReliable( avatar->getRegion()->getHost() ); + msg->sendReliable( avatarp->getRegion()->getHost() ); } } else if (ban_enabled) @@ -2857,9 +2857,9 @@ bool callback_eject(const LLSD& notification, const LLSD& response) // and it is also not an 'Cancle' button, and ban_enabled==ture, // it should be the 'Eject and Ban' button. LLMessageSystem* msg = gMessageSystem; - LLViewerObject* avatar = gObjectList.findObject(avatar_id); + LLVOAvatar* avatarp = gObjectList.findAvatar(avatar_id); - if (avatar) + if (avatarp && avatarp->getRegion()) { U32 flags = 0x1; msg->newMessage("EjectUser"); @@ -2869,7 +2869,7 @@ bool callback_eject(const LLSD& notification, const LLSD& response) msg->nextBlock("Data"); msg->addUUID("TargetID", avatar_id ); msg->addU32("Flags", flags ); - msg->sendReliable( avatar->getRegion()->getHost() ); + msg->sendReliable( avatarp->getRegion()->getHost() ); } } return false; @@ -5494,7 +5494,7 @@ void print_agent_nvpairs(void*) llinfos << "Agent Name Value Pairs" << llendl; - objectp = gObjectList.findObject(gAgentID); + objectp = gAgent.getAvatarObject(); if (objectp) { objectp->printNameValuePairs(); diff --git a/indra/newview/llviewermessage.cpp b/indra/newview/llviewermessage.cpp index e079c0879..f58dd23e9 100644 --- a/indra/newview/llviewermessage.cpp +++ b/indra/newview/llviewermessage.cpp @@ -2784,7 +2784,8 @@ void process_chat_from_simulator(LLMessageSystem *msg, void **user_data) if (!is_muted && !is_busy) { - visible_in_chat_bubble = gSavedSettings.getBOOL("UseChatBubbles"); + static LLCachedControl use_chat_bubbles("UseChatBubbles",false); + visible_in_chat_bubble = use_chat_bubbles; ((LLVOAvatar*)chatter)->addChat(chat); } } @@ -4157,12 +4158,11 @@ void process_avatar_animation(LLMessageSystem *mesgsys, void **user_data) LLUUID animation_id; LLUUID uuid; S32 anim_sequence_id; - LLVOAvatar *avatarp; mesgsys->getUUIDFast(_PREHASH_Sender, _PREHASH_ID, uuid); //clear animation flags - avatarp = (LLVOAvatar *)gObjectList.findObject(uuid); + LLVOAvatar* avatarp = gObjectList.findAvatar(uuid); if (!avatarp) { @@ -4238,7 +4238,7 @@ void process_avatar_appearance(LLMessageSystem *mesgsys, void **user_data) LLUUID uuid; mesgsys->getUUIDFast(_PREHASH_Sender, _PREHASH_ID, uuid); - LLVOAvatar* avatarp = (LLVOAvatar *)gObjectList.findObject(uuid); + LLVOAvatar* avatarp = gObjectList.findAvatar(uuid); if( avatarp ) { avatarp->processAvatarAppearance( mesgsys ); diff --git a/indra/newview/llviewerobjectlist.cpp b/indra/newview/llviewerobjectlist.cpp index 3a1b70a03..d5ad0d3bb 100644 --- a/indra/newview/llviewerobjectlist.cpp +++ b/indra/newview/llviewerobjectlist.cpp @@ -127,6 +127,7 @@ void LLViewerObjectList::destroy() mDeadObjects.clear(); mMapObjects.clear(); mUUIDObjectMap.clear(); + mUUIDAvatarMap.clear(); } @@ -727,7 +728,8 @@ void LLViewerObjectList::update(LLAgent &agent, LLWorld &world) } } - if (gSavedSettings.getBOOL("FreezeTime")) + static LLCachedControl freeze_time("FreezeTime",0); + if (freeze_time) { for (std::vector::iterator iter = idle_list.begin(); iter != idle_list.end(); iter++) @@ -853,6 +855,7 @@ void LLViewerObjectList::cleanupReferences(LLViewerObject *objectp) // Remove from object map so noone can look it up. mUUIDObjectMap.erase(objectp->mID); + mUUIDAvatarMap.erase(objectp->mID);//No need to be careful here. //if (objectp->getRegion()) //{ @@ -1364,6 +1367,12 @@ LLViewerObject *LLViewerObjectList::createObjectViewer(const LLPCode pcode, LLVi } mUUIDObjectMap[fullid] = objectp; + if(objectp->isAvatar()) + { + LLVOAvatar *pAvatar = dynamic_cast(objectp); + if(pAvatar) + mUUIDAvatarMap[fullid] = pAvatar; + } mObjects.put(objectp); @@ -1398,6 +1407,12 @@ LLViewerObject *LLViewerObjectList::createObject(const LLPCode pcode, LLViewerRe } mUUIDObjectMap[fullid] = objectp; + if(objectp->isAvatar()) + { + LLVOAvatar *pAvatar = dynamic_cast(objectp); + if(pAvatar) + mUUIDAvatarMap[fullid] = pAvatar; + } setUUIDAndLocal(fullid, local_id, gMessageSystem->getSenderIP(), diff --git a/indra/newview/llviewerobjectlist.h b/indra/newview/llviewerobjectlist.h index c37c43859..89303b1a1 100644 --- a/indra/newview/llviewerobjectlist.h +++ b/indra/newview/llviewerobjectlist.h @@ -43,6 +43,7 @@ // project includes #include "llviewerobject.h" +#include "llvoavatar.h" class LLNetMap; class LLDebugBeacon; @@ -69,7 +70,8 @@ public: // an internal dynamic array. inline LLViewerObject *getObject(const S32 index); - inline LLViewerObject *findObject(const LLUUID &id); + inline LLViewerObject *findObject(const LLUUID &id) const; + inline LLVOAvatar *findAvatar(const LLUUID &id) const; LLViewerObject *createObjectViewer(const LLPCode pcode, LLViewerRegion *regionp); // Create a viewer-side object LLViewerObject *createObject(const LLPCode pcode, LLViewerRegion *regionp, const LLUUID &uuid, const U32 local_id, const LLHost &sender); @@ -203,6 +205,7 @@ protected: vo_map mDeadObjects; // Need to keep multiple entries per UUID std::map > mUUIDObjectMap; + std::map > mUUIDAvatarMap; LLDynamicArray mDebugBeacons; @@ -244,9 +247,9 @@ public: extern LLViewerObjectList gObjectList; // Inlines -inline LLViewerObject *LLViewerObjectList::findObject(const LLUUID &id) +inline LLViewerObject *LLViewerObjectList::findObject(const LLUUID &id) const { - std::map >::iterator iter = mUUIDObjectMap.find(id); + std::map >::const_iterator iter = mUUIDObjectMap.find(id); if(iter != mUUIDObjectMap.end()) { return iter->second; @@ -257,6 +260,12 @@ inline LLViewerObject *LLViewerObjectList::findObject(const LLUUID &id) } } +inline LLVOAvatar *LLViewerObjectList::findAvatar(const LLUUID &id) const +{ + std::map >::const_iterator iter = mUUIDAvatarMap.find(id); + return (iter != mUUIDAvatarMap.end()) ? iter->second : NULL; +} + inline LLViewerObject *LLViewerObjectList::getObject(const S32 index) { LLViewerObject *objectp; diff --git a/indra/newview/llviewerwindow.cpp b/indra/newview/llviewerwindow.cpp index 1d1d89d76..ef4bb8bc9 100644 --- a/indra/newview/llviewerwindow.cpp +++ b/indra/newview/llviewerwindow.cpp @@ -518,7 +518,8 @@ public: ypos += y_inc; } // only display these messages if we are actually rendering beacons at this moment - if (LLPipeline::getRenderBeacons(NULL) && gSavedSettings.getBOOL("BeaconAlwaysOn")) + static LLCachedControl beacon_always_on("BeaconAlwaysOn",false); + if (LLPipeline::getRenderBeacons(NULL) && beacon_always_on) { if (LLPipeline::getRenderParticleBeacons(NULL)) { @@ -2284,7 +2285,8 @@ void LLViewerWindow::draw() //S32 screen_x, screen_y; // HACK for timecode debugging - if (gSavedSettings.getBOOL("DisplayTimecode")) + static LLCachedControl display_timecode("DisplayTimecode",false); + if (display_timecode) { // draw timecode block std::string text; @@ -2761,7 +2763,8 @@ BOOL LLViewerWindow::handlePerFrameHover() LLVector2 mouse_vel; - if (gSavedSettings.getBOOL("MouseSmooth")) + static LLCachedControl mouse_smooth("MouseSmooth",false); + if (mouse_smooth) { static F32 fdx = 0.f; static F32 fdy = 0.f; @@ -2916,12 +2919,14 @@ BOOL LLViewerWindow::handlePerFrameHover() // Show a new tool tip (or update one that is alrady shown) BOOL tool_tip_handled = FALSE; std::string tool_tip_msg; - F32 tooltip_delay = gSavedSettings.getF32( "ToolTipDelay" ); + static LLCachedControl tool_tip_delay("ToolTipDelay",.7f); + F32 tooltip_delay = tool_tip_delay; //HACK: hack for tool-based tooltips which need to pop up more quickly //Also for show xui names as tooltips debug mode if ((mouse_captor && !mouse_captor->isView()) || LLUI::sShowXUINames) { - tooltip_delay = gSavedSettings.getF32( "DragAndDropToolTipDelay" ); + static LLCachedControl drag_and_drop_tool_tip_delay("DragAndDropToolTipDelay",.1f); + tooltip_delay = drag_and_drop_tool_tip_delay; } if( handled && gMouseIdleTimer.getElapsedTimeF32() > tooltip_delay && @@ -2969,7 +2974,8 @@ BOOL LLViewerWindow::handlePerFrameHover() } } - if (tool && tool != gToolNull && tool != LLToolCompInspect::getInstance() && tool != LLToolDragAndDrop::getInstance() && !gSavedSettings.getBOOL("FreezeTime")) + static LLCachedControl freeze_time("FreezeTime",0); + if (tool && tool != gToolNull && tool != LLToolCompInspect::getInstance() && tool != LLToolDragAndDrop::getInstance() && !freeze_time) { LLMouseHandler *captor = gFocusMgr.getMouseCapture(); // With the null, inspect, or drag and drop tool, don't muck @@ -3110,7 +3116,8 @@ BOOL LLViewerWindow::handlePerFrameHover() gFloaterView->syncFloaterTabOrder(); } - if (gSavedSettings.getBOOL("ChatBarStealsFocus") + static LLCachedControl chat_bar_steals_focus("ChatBarStealsFocus",true); + if (chat_bar_steals_focus && gChatBar && gFocusMgr.getKeyboardFocus() == NULL && gChatBar->isInVisibleChain()) @@ -3149,32 +3156,13 @@ BOOL LLViewerWindow::handlePerFrameHover() if ((previous_x != x) || (previous_y != y)) mouse_moved_since_pick = TRUE; - BOOL do_pick = FALSE; - - F32 picks_moving = gSavedSettings.getF32("PicksPerSecondMouseMoving"); - if ((mouse_moved_since_pick) && (picks_moving > 0.0) && (mPickTimer.getElapsedTimeF32() > 1.0f / picks_moving)) - { - do_pick = TRUE; - } - - F32 picks_stationary = gSavedSettings.getF32("PicksPerSecondMouseStationary"); - if ((!mouse_moved_since_pick) && (picks_stationary > 0.0) && (mPickTimer.getElapsedTimeF32() > 1.0f / picks_stationary)) - { - do_pick = TRUE; - } - - if (getCursorHidden()) - { - do_pick = FALSE; - } - - if(LLViewerMediaFocus::getInstance()->getFocus()) - { + static LLCachedControl picks_moving("PicksPerSecondMouseMoving",5.f); + static LLCachedControl picks_stationary("PicksPerSecondMouseStationary",0.f); + if( !getCursorHidden() // When in-world media is in focus, pick every frame so that browser mouse-overs, dragging scrollbars, etc. work properly. - do_pick = TRUE; - } - - if (do_pick) + && (LLViewerMediaFocus::getInstance()->getFocus() + || ((mouse_moved_since_pick) && (picks_moving > 0.0) && (mPickTimer.getElapsedTimeF32() > 1.0f / picks_moving)) + || ((!mouse_moved_since_pick) && (picks_stationary > 0.0) && (mPickTimer.getElapsedTimeF32() > 1.0f / picks_stationary)))) { mouse_moved_since_pick = FALSE; mPickTimer.reset(); @@ -5102,7 +5090,8 @@ LLRect LLViewerWindow::getChatConsoleRect() console_rect.mLeft += CONSOLE_PADDING_LEFT; - if (gSavedSettings.getBOOL("ChatFullWidth")) + static LLCachedControl chat_full_width("ChatFullWidth",true); + if (chat_full_width) { console_rect.mRight -= CONSOLE_PADDING_RIGHT; } diff --git a/indra/newview/llvoavatar.cpp b/indra/newview/llvoavatar.cpp index 1cdfa6a1a..4931aad35 100644 --- a/indra/newview/llvoavatar.cpp +++ b/indra/newview/llvoavatar.cpp @@ -90,7 +90,7 @@ #include "llvoicevisualizer.h" // Ventrella #include "llsdserialize.h" //For the client definitions -#include "llsavedsettingsglue.h" //For optionally per-account settings + // #include "llfloaterexploreanimations.h" #include "llao.h" @@ -3614,13 +3614,13 @@ void LLVOAvatar::idleUpdateNameTag(const LLVector3& root_pos_last) } const F32 time_visible = mTimeVisible.getElapsedTimeF32(); - const F32 NAME_SHOW_TIME = gSavedSettings.getF32("RenderNameShowTime"); // seconds - const F32 FADE_DURATION = gSavedSettings.getF32("RenderNameFadeDuration"); // seconds - - - + static LLCachedControl NAME_SHOW_TIME("RenderNameShowTime",10); // seconds + static LLCachedControl FADE_DURATION("RenderNameFadeDuration",1); // seconds + static LLCachedControl use_chat_bubbles("UseChatBubbles",false); + static LLCachedControl render_name_hide_self("RenderNameHideSelf",false); + BOOL visible_avatar = isVisible() || mNeedsAnimUpdate; - BOOL visible_chat = gSavedSettings.getBOOL("UseChatBubbles") && (mChats.size() || mTyping); + BOOL visible_chat = use_chat_bubbles && (mChats.size() || mTyping); BOOL render_name = visible_chat || (visible_avatar && ((sRenderName == RENDER_NAME_ALWAYS) || @@ -3631,7 +3631,7 @@ void LLVOAvatar::idleUpdateNameTag(const LLVector3& root_pos_last) { render_name = render_name && !gAgent.cameraMouselook() - && (visible_chat || !gSavedSettings.getBOOL("RenderNameHideSelf")); + && (visible_chat || !render_name_hide_self); } if ( render_name ) @@ -3736,35 +3736,41 @@ void LLVOAvatar::idleUpdateNameTag(const LLVector3& root_pos_last) mClientTag = "Friend"; } } - if (!mIsSelf && gSavedSettings.getBOOL("AscentUseStatusColors")) + } + + static LLCachedControl ascent_use_status_colors("AscentUseStatusColors",true); + if (!mIsSelf && ascent_use_status_colors) + { + LLViewerRegion* parent_estate = LLWorld::getInstance()->getRegionFromPosGlobal(this->getPositionGlobal()); + LLUUID estate_owner = LLUUID::null; + if(parent_estate && parent_estate->isAlive()) { - LLViewerRegion* parent_estate = LLWorld::getInstance()->getRegionFromPosGlobal(this->getPositionGlobal()); - LLUUID estate_owner = LLUUID::null; - if(parent_estate && parent_estate->isAlive()) - { - estate_owner = parent_estate->getOwner(); - } - - //Lindens are always more Linden than your friend, make that take precedence - if(LLMuteList::getInstance()->isLinden(getFullname())) - { - mClientColor = gCOASavedSettings->getColor4("AscentLindenColor").getValue(); - } - //check if they are an estate owner at their current position - else if(estate_owner.notNull() && this->getID() == estate_owner) - { - mClientColor = gCOASavedSettings->getColor4("AscentEstateOwnerColor").getValue(); - } - //without these dots, SL would suck. - else if (LLAvatarTracker::instance().getBuddyInfo(this->getID()) != NULL) - { - mClientColor = gCOASavedSettings->getColor4("AscentFriendColor"); - } - //big fat jerkface who is probably a jerk, display them as such. - else if(LLMuteList::getInstance()->isMuted(this->getID())) - { - mClientColor = gCOASavedSettings->getColor4("AscentMutedColor").getValue(); - } + estate_owner = parent_estate->getOwner(); + } + + std::string name; + name += firstname->getString(); + name += " "; + name += lastname->getString(); + //Lindens are always more Linden than your friend, make that take precedence + if(LLMuteList::getInstance()->isLinden(name)) + { + mClientColor = gCOASavedSettings->getColor4("AscentLindenColor").getValue(); + } + //check if they are an estate owner at their current position + else if(estate_owner.notNull() && this->getID() == estate_owner) + { + mClientColor = gCOASavedSettings->getColor4("AscentEstateOwnerColor").getValue(); + } + //without these dots, SL would suck. + else if (LLAvatarTracker::instance().getBuddyInfo(this->getID()) != NULL) + { + mClientColor = gCOASavedSettings->getColor4("AscentFriendColor"); + } + //big fat jerkface who is probably a jerk, display them as such. + else if(LLMuteList::getInstance()->isMuted(this->getID())) + { + mClientColor = gCOASavedSettings->getColor4("AscentMutedColor").getValue(); } } @@ -7650,7 +7656,7 @@ void LLVOAvatar::onLocalTextureLoaded( BOOL success, LLViewerImage *src_vi, LLIm LLAvatarTexData *data = (LLAvatarTexData *)userdata; if (success) { - LLVOAvatar *self = (LLVOAvatar *)gObjectList.findObject(data->mAvatarID); + LLVOAvatar *self = gObjectList.findAvatar(data->mAvatarID); if (self) { ETextureIndex index = data->mIndex; @@ -7676,7 +7682,7 @@ void LLVOAvatar::onLocalTextureLoaded( BOOL success, LLViewerImage *src_vi, LLIm } else if (final) { - LLVOAvatar *self = (LLVOAvatar *)gObjectList.findObject(data->mAvatarID); + LLVOAvatar *self = gObjectList.findAvatar(data->mAvatarID); if (self) { ETextureIndex index = data->mIndex; @@ -9467,7 +9473,7 @@ void LLVOAvatar::onBakedTextureMasksLoaded( BOOL success, LLViewerImage *src_vi, const LLUUID id = src_vi->getID(); LLTextureMaskData* maskData = (LLTextureMaskData*) userdata; - LLVOAvatar* self = (LLVOAvatar*) gObjectList.findObject( maskData->mAvatarID ); + LLVOAvatar* self = gObjectList.findAvatar( maskData->mAvatarID ); // if discard level is 2 less than last discard level we processed, or we hit 0, // then generate morph masks @@ -9559,7 +9565,7 @@ void LLVOAvatar::onBakedTextureMasksLoaded( BOOL success, LLViewerImage *src_vi, void LLVOAvatar::onInitialBakedTextureLoaded( BOOL success, LLViewerImage *src_vi, LLImageRaw* src, LLImageRaw* aux_src, S32 discard_level, BOOL final, void* userdata ) { LLUUID *avatar_idp = (LLUUID *)userdata; - LLVOAvatar *selfp = (LLVOAvatar *)gObjectList.findObject(*avatar_idp); + LLVOAvatar *selfp = gObjectList.findAvatar(*avatar_idp); if (!success && selfp) { @@ -9577,7 +9583,7 @@ void LLVOAvatar::onBakedTextureLoaded(BOOL success, LLViewerImage *src_vi, LLIma LLUUID id = src_vi->getID(); LLUUID *avatar_idp = (LLUUID *)userdata; - LLVOAvatar *selfp = (LLVOAvatar *)gObjectList.findObject(*avatar_idp); + LLVOAvatar *selfp = gObjectList.findAvatar(*avatar_idp); if (selfp && !success) { diff --git a/indra/newview/llvoiceclient.cpp b/indra/newview/llvoiceclient.cpp index 49aef02e6..77f3fc4a0 100644 --- a/indra/newview/llvoiceclient.cpp +++ b/indra/newview/llvoiceclient.cpp @@ -5867,7 +5867,9 @@ void LLVoiceClient::setVoiceEnabled(bool enabled) bool LLVoiceClient::voiceEnabled() { - return gSavedSettings.getBOOL("EnableVoiceChat") && !gSavedSettings.getBOOL("CmdLineDisableVoice"); + static LLCachedControl enable_voice_chat("EnableVoiceChat",false); + static LLCachedControl cmd_line_disable_voice("CmdLineDisableVoice",false); + return enable_voice_chat && !cmd_line_disable_voice; } void LLVoiceClient::setLipSyncEnabled(BOOL enabled) diff --git a/indra/newview/llvosky.cpp b/indra/newview/llvosky.cpp index 1ba969f29..14edd3b09 100644 --- a/indra/newview/llvosky.cpp +++ b/indra/newview/llvosky.cpp @@ -1023,7 +1023,8 @@ void LLVOSky::calcAtmospherics(void) // Since WL scales everything by 2, there should always be at least a 2:1 brightness ratio // between sunlight and point lights in windlight to normalize point lights. - F32 sun_dynamic_range = llmax(gSavedSettings.getF32("RenderSunDynamicRange"), 0.0001f); + static LLCachedControl render_sun_dynamic_range("RenderSunDynamicRange", 1); + F32 sun_dynamic_range = llmax((float)render_sun_dynamic_range, 0.0001f); LLWLParamManager::instance()->mSceneLightStrength = 2.0f * (1.0f + sun_dynamic_range * dp); mSunDiffuse = vary_SunlightColor; diff --git a/indra/newview/llvovolume.cpp b/indra/newview/llvovolume.cpp index 7eedf9583..8a2e6cf1b 100644 --- a/indra/newview/llvovolume.cpp +++ b/indra/newview/llvovolume.cpp @@ -2220,8 +2220,10 @@ void LLVolumeGeometryManager::rebuildGeom(LLSpatialGroup* group) std::vector alpha_faces; U32 useage = group->mSpatialPartition->mBufferUsage; - U32 max_vertices = (gSavedSettings.getS32("RenderMaxVBOSize")*1024)/LLVertexBuffer::calcStride(group->mSpatialPartition->mVertexDataMask); - U32 max_total = (gSavedSettings.getS32("RenderMaxNodeSize")*1024)/LLVertexBuffer::calcStride(group->mSpatialPartition->mVertexDataMask); + static LLCachedControl render_max_vbo_size("RenderMaxVBOSize", 512); + static LLCachedControl render_max_node_size("RenderMaxNodeSize",8192); + U32 max_vertices = (render_max_vbo_size*1024)/LLVertexBuffer::calcStride(group->mSpatialPartition->mVertexDataMask); + U32 max_total = (render_max_node_size*1024)/LLVertexBuffer::calcStride(group->mSpatialPartition->mVertexDataMask); max_vertices = llmin(max_vertices, (U32) 65535); U32 cur_total = 0; @@ -2501,7 +2503,8 @@ void LLVolumeGeometryManager::rebuildMesh(LLSpatialGroup* group) void LLVolumeGeometryManager::genDrawInfo(LLSpatialGroup* group, U32 mask, std::vector& faces, BOOL distance_sort) { //calculate maximum number of vertices to store in a single buffer - U32 max_vertices = (gSavedSettings.getS32("RenderMaxVBOSize")*1024)/LLVertexBuffer::calcStride(group->mSpatialPartition->mVertexDataMask); + static LLCachedControl render_max_vbo_size("RenderMaxVBOSize", 512); + U32 max_vertices = (render_max_vbo_size*1024)/LLVertexBuffer::calcStride(group->mSpatialPartition->mVertexDataMask); max_vertices = llmin(max_vertices, (U32) 65535); if (!distance_sort) diff --git a/indra/newview/llworld.cpp b/indra/newview/llworld.cpp index 98499602e..cb83cb43b 100644 --- a/indra/newview/llworld.cpp +++ b/indra/newview/llworld.cpp @@ -655,8 +655,10 @@ void LLWorld::updateParticles() void LLWorld::updateClouds(const F32 dt) { - if (gSavedSettings.getBOOL("FreezeTime") || - !gSavedSettings.getBOOL("SkyUseClassicClouds")) + static LLCachedControl freeze_time("FreezeTime",false); + static LLCachedControl sky_use_classic_clouds("SkyUseClassicClouds",false); + if (freeze_time || + !sky_use_classic_clouds) { // don't move clouds in snapshot mode return; diff --git a/indra/newview/pipeline.cpp b/indra/newview/pipeline.cpp index 9672a8463..cd920e12b 100644 --- a/indra/newview/pipeline.cpp +++ b/indra/newview/pipeline.cpp @@ -1020,7 +1020,8 @@ U32 LLPipeline::addObject(LLViewerObject *vobj) return 0; } - if (gSavedSettings.getBOOL("RenderDelayCreation")) + static LLCachedControl render_delay_creation("RenderDelayCreation",false); + if (render_delay_creation) { mCreateQ.push_back(vobj); } @@ -1083,7 +1084,8 @@ void LLPipeline::createObject(LLViewerObject* vobj) markRebuild(drawablep, LLDrawable::REBUILD_ALL, TRUE); - if (drawablep->getVOVolume() && gSavedSettings.getBOOL("RenderAnimateRes")) + static LLCachedControl render_animate_res("RenderAnimateRes",false); + if (drawablep->getVOVolume() && render_animate_res) { // fun animated res drawablep->updateXform(TRUE); @@ -1122,7 +1124,8 @@ void LLPipeline::resetFrameStats() //external functions for asynchronous updating void LLPipeline::updateMoveDampedAsync(LLDrawable* drawablep) { - if (gSavedSettings.getBOOL("FreezeTime")) + static LLCachedControl freeze_time("FreezeTime",false); + if (freeze_time) { return; } @@ -1152,7 +1155,8 @@ void LLPipeline::updateMoveDampedAsync(LLDrawable* drawablep) void LLPipeline::updateMoveNormalAsync(LLDrawable* drawablep) { - if (gSavedSettings.getBOOL("FreezeTime")) + static LLCachedControl freeze_time("FreezeTime",false); + if (freeze_time) { return; } @@ -1205,7 +1209,8 @@ void LLPipeline::updateMove() LLFastTimer t(LLFastTimer::FTM_UPDATE_MOVE); LLMemType mt(LLMemType::MTYPE_PIPELINE); - if (gSavedSettings.getBOOL("FreezeTime")) + static LLCachedControl freeze_time("FreezeTime",false); + if (freeze_time) { return; } @@ -2296,7 +2301,8 @@ void LLPipeline::postSort(LLCamera& camera) } // only render if the flag is set. The flag is only set if we are in edit mode or the toggle is set in the menus - if (gSavedSettings.getBOOL("BeaconAlwaysOn") && !sShadowRender) + static LLCachedControl beacon_always_on("BeaconAlwaysOn",false); + if (beacon_always_on && !sShadowRender) { if (sRenderScriptedTouchBeacons) { @@ -5942,8 +5948,8 @@ void LLPipeline::generateWaterReflection(LLCamera& camera_in) (1< - -