diff options
Diffstat (limited to 'indra/newview')
195 files changed, 2032 insertions, 1905 deletions
diff --git a/indra/newview/CMakeLists.txt b/indra/newview/CMakeLists.txt index d1b0aae542..2b66a5fb94 100755 --- a/indra/newview/CMakeLists.txt +++ b/indra/newview/CMakeLists.txt @@ -4,17 +4,19 @@ project(viewer) include(00-Common) include(Boost) +include(BuildPackagesInfo) include(BuildVersion) +include(CMakeCopyIfDifferent) include(DBusGlib) include(DirectX) -include(OpenSSL) include(DragDrop) include(EXPAT) include(FMODEX) -include(OPENAL) -include(OpenGL) +include(GLOD) +include(GooglePerfTools) include(Hunspell) include(JsonCpp) +include(LLAppearance) include(LLAudio) include(LLCharacter) include(LLCommon) @@ -22,6 +24,8 @@ include(LLCoreHttp) include(LLImage) include(LLImageJ2COJ) include(LLInventory) +include(LLKDU) +include(LLLogin) include(LLMath) include(LLMessage) include(LLPhysicsExtensions) @@ -36,18 +40,16 @@ include(LScript) include(Linking) include(NDOF) include(NVAPI) -include(GooglePerfTools) +include(OPENAL) +include(OpenGL) +include(OpenSSL) +include(PNG) +include(Prebuilt) include(TemplateCheck) include(UI) include(UnixInstall) -include(LLKDU) include(ViewerMiscLibs) -include(LLLogin) include(VisualLeakDetector) -include(GLOD) -include(CMakeCopyIfDifferent) -include(LLAppearance) -include(PNG) include(ZLIB) if (NOT HAVOK_TPV) @@ -59,6 +61,9 @@ if(FMODEX) include_directories(${FMODEX_INCLUDE_DIR}) endif(FMODEX) +# install SLPlugin host executable and its dynamic-library plugins +use_prebuilt_binary(slplugins) + include_directories( ${DBUSGLIB_INCLUDE_DIRS} ${JSONCPP_INCLUDE_DIR} @@ -1306,7 +1311,7 @@ set(viewer_HEADER_FILES source_group("CMake Rules" FILES ViewerInstall.cmake) -# the viewer_version.txt file created here is for passing to viewer_manifest +# the viewer_version.txt file created here is for passing to viewer_manifest and autobuild # the summary.json file is created for the benefit of the TeamCity builds, where # it is used to provide descriptive information to the build results page add_custom_target(generate_viewer_version ALL @@ -1377,6 +1382,9 @@ if (LINUX) set(viewer_LIBRARIES Xinerama ) + if (OPENAL) + LIST(APPEND viewer_LIBRARIES ${OPENAL_LIBRARIES}) + endif (OPENAL) endif (LINUX) if (WINDOWS) @@ -1591,6 +1599,7 @@ set(viewer_APPSETTINGS_FILES app_settings/viewerart.xml ${CMAKE_SOURCE_DIR}/../etc/message.xml ${CMAKE_SOURCE_DIR}/../scripts/messages/message_template.msg + packages-info.txt ) source_group("App Settings" FILES ${viewer_APPSETTINGS_FILES}) @@ -1671,6 +1680,9 @@ if (WINDOWS) LINK_FLAGS_DEBUG "/NODEFAULTLIB:\"LIBCMT;LIBCMTD;MSVCRT\" /INCREMENTAL:NO /LARGEADDRESSAWARE" LINK_FLAGS_RELEASE "/FORCE:MULTIPLE /MAP\"secondlife-bin.MAP\" /OPT:REF /LARGEADDRESSAWARE" ) + + add_dependencies(${VIEWER_BINARY_NAME} generate_viewer_version) + if(USE_PRECOMPILED_HEADERS) set_target_properties( ${VIEWER_BINARY_NAME} @@ -1806,7 +1818,6 @@ if (WINDOWS) --touch=${CMAKE_CURRENT_BINARY_DIR}/${CMAKE_CFG_INTDIR}/copy_touched.bat DEPENDS ${CMAKE_CURRENT_SOURCE_DIR}/viewer_manifest.py - generate_viewer_version stage_third_party_libs ${COPY_INPUT_DEPENDENCIES} COMMENT "Performing viewer_manifest copy" @@ -1820,10 +1831,10 @@ if (WINDOWS) add_dependencies(${VIEWER_BINARY_NAME} copy_win_scripts) endif (EXISTS ${CMAKE_SOURCE_DIR}/copy_win_scripts) - add_dependencies(${VIEWER_BINARY_NAME} - SLPlugin - windows-crash-logger - ) +## add_dependencies(${VIEWER_BINARY_NAME} +## SLPlugin +## windows-crash-logger +## ) # sets the 'working directory' for debugging from visual studio. if (NOT UNATTENDED) @@ -1878,10 +1889,9 @@ if (WINDOWS) ${COPY_INPUT_DEPENDENCIES} ) - add_custom_target(package ALL DEPENDS + add_custom_target(llpackage ALL DEPENDS ${CMAKE_CFG_INTDIR}/touched.bat windows-setup-build-all - generate_viewer_version ) # temporarily disable packaging of event_host until hg subrepos get # sorted out on the parabuild cluster... @@ -1990,12 +2000,14 @@ if (LINUX) set(COPY_INPUT_DEPENDENCIES ${VIEWER_BINARY_NAME} linux-crash-logger - SLPlugin - media_plugin_webkit - media_plugin_gstreamer010 +## SLPlugin +## media_plugin_webkit +## media_plugin_gstreamer010 llcommon ) + add_dependencies(${VIEWER_BINARY_NAME} generate_viewer_version) + add_custom_command( OUTPUT ${product}.tar.bz2 COMMAND ${PYTHON_EXECUTABLE} @@ -2014,7 +2026,6 @@ if (LINUX) --touch=${CMAKE_CURRENT_BINARY_DIR}/${CMAKE_CFG_INTDIR}/.${product}.touched DEPENDS ${CMAKE_CURRENT_SOURCE_DIR}/viewer_manifest.py - generate_viewer_version ${COPY_INPUT_DEPENDENCIES} ) @@ -2039,7 +2050,6 @@ if (LINUX) --source=${CMAKE_CURRENT_SOURCE_DIR} DEPENDS ${CMAKE_CURRENT_SOURCE_DIR}/viewer_manifest.py - generate_viewer_version ${COPY_INPUT_DEPENDENCIES} COMMENT "Performing viewer_manifest copy" ) @@ -2047,10 +2057,10 @@ if (LINUX) add_custom_target(copy_l_viewer_manifest ALL DEPENDS ${CMAKE_CURRENT_BINARY_DIR}/${CMAKE_CFG_INTDIR}/.${product}.copy_touched) if (PACKAGE) - add_custom_target(package ALL DEPENDS ${product}.tar.bz2) + add_custom_target(llpackage ALL DEPENDS ${product}.tar.bz2) # Make sure we don't run two instances of viewer_manifest.py at the same time. - add_dependencies(package copy_l_viewer_manifest) - check_message_template(package) + add_dependencies(llpackage copy_l_viewer_manifest) + check_message_template(llpackage) endif (PACKAGE) endif (LINUX) @@ -2081,6 +2091,8 @@ if (DARWIN) "${CMAKE_CURRENT_BINARY_DIR}/${CMAKE_CFG_INTDIR}/${product}.app/Contents/Info.plist" ) + add_dependencies(${VIEWER_BINARY_NAME} generate_viewer_version) + add_custom_command( TARGET ${VIEWER_BINARY_NAME} POST_BUILD COMMAND ${PYTHON_EXECUTABLE} @@ -2100,10 +2112,10 @@ if (DARWIN) DEPENDS ${VIEWER_BINARY_NAME} ${CMAKE_CURRENT_SOURCE_DIR}/viewer_manifest.py - generate_viewer_version ) - add_dependencies(${VIEWER_BINARY_NAME} SLPlugin media_plugin_quicktime media_plugin_webkit mac-crash-logger) +##add_dependencies(${VIEWER_BINARY_NAME} SLPlugin media_plugin_quicktime media_plugin_webkit mac-crash-logger) + add_dependencies(${VIEWER_BINARY_NAME} mac-crash-logger) if (ENABLE_SIGNING) set(SIGNING_SETTING "--signature=${SIGNING_IDENTITY}") @@ -2112,11 +2124,11 @@ if (DARWIN) endif (ENABLE_SIGNING) if (PACKAGE) - add_custom_target(package ALL DEPENDS ${VIEWER_BINARY_NAME}) - add_dependencies(package generate_viewer_version) + add_custom_target(llpackage ALL DEPENDS ${VIEWER_BINARY_NAME}) + add_dependencies(llpackage generate_viewer_version) add_custom_command( - TARGET package POST_BUILD + TARGET llpackage POST_BUILD COMMAND ${PYTHON_EXECUTABLE} ARGS ${CMAKE_CURRENT_SOURCE_DIR}/viewer_manifest.py @@ -2135,7 +2147,6 @@ if (DARWIN) ${SIGNING_SETTING} DEPENDS ${CMAKE_CURRENT_SOURCE_DIR}/viewer_manifest.py - generate_viewer_version ) endif (PACKAGE) endif (DARWIN) @@ -2158,19 +2169,21 @@ if (PACKAGE) if (DARWIN) list(APPEND SYMBOL_SEARCH_DIRS "${CMAKE_CURRENT_BINARY_DIR}/${CMAKE_CFG_INTDIR}") # *TODO: Generate these search dirs in the cmake files related to each binary. - list(APPEND SYMBOL_SEARCH_DIRS "${CMAKE_BINARY_DIR}/llplugin/slplugin/${CMAKE_CFG_INTDIR}") +## list(APPEND SYMBOL_SEARCH_DIRS "${CMAKE_BINARY_DIR}/llplugin/slplugin/${CMAKE_CFG_INTDIR}") list(APPEND SYMBOL_SEARCH_DIRS "${CMAKE_BINARY_DIR}/mac_crash_logger/${CMAKE_CFG_INTDIR}") - list(APPEND SYMBOL_SEARCH_DIRS "${CMAKE_BINARY_DIR}/media_plugins/gstreamer010/${CMAKE_CFG_INTDIR}") - list(APPEND SYMBOL_SEARCH_DIRS "${CMAKE_BINARY_DIR}/media_plugins/quicktime/${CMAKE_CFG_INTDIR}") - list(APPEND SYMBOL_SEARCH_DIRS "${CMAKE_BINARY_DIR}/media_plugins/webkit/${CMAKE_CFG_INTDIR}") +## list(APPEND SYMBOL_SEARCH_DIRS "${CMAKE_BINARY_DIR}/media_plugins/gstreamer010/${CMAKE_CFG_INTDIR}") +## list(APPEND SYMBOL_SEARCH_DIRS "${CMAKE_BINARY_DIR}/media_plugins/quicktime/${CMAKE_CFG_INTDIR}") +## list(APPEND SYMBOL_SEARCH_DIRS "${CMAKE_BINARY_DIR}/media_plugins/webkit/${CMAKE_CFG_INTDIR}") set(VIEWER_SYMBOL_FILE "${CMAKE_CURRENT_BINARY_DIR}/${CMAKE_CFG_INTDIR}/secondlife-symbols-darwin.tar.bz2") - set(VIEWER_EXE_GLOBS "'Second Life' SLPlugin mac-crash-logger") +## set(VIEWER_EXE_GLOBS "'Second Life' SLPlugin mac-crash-logger") + set(VIEWER_EXE_GLOBS "'Second Life' mac-crash-logger") set(VIEWER_LIB_GLOB "*.dylib") endif (DARWIN) if (LINUX) list(APPEND SYMBOL_SEARCH_DIRS "${CMAKE_CURRENT_BINARY_DIR}/packaged") set(VIEWER_SYMBOL_FILE "${CMAKE_CURRENT_BINARY_DIR}/${CMAKE_CFG_INTDIR}/secondlife-symbols-linux.tar.bz2") - set(VIEWER_EXE_GLOBS "do-not-directly-run-secondlife-bin SLPlugin") +## set(VIEWER_EXE_GLOBS "do-not-directly-run-secondlife-bin SLPlugin") + set(VIEWER_EXE_GLOBS "do-not-directly-run-secondlife-bin") set(VIEWER_LIB_GLOB "*${CMAKE_SHARED_MODULE_SUFFIX}*") set(VIEWER_COPY_MANIFEST copy_l_viewer_manifest) endif (LINUX) @@ -2198,7 +2211,7 @@ if (PACKAGE) add_custom_target(generate_breakpad_symbols DEPENDS "${VIEWER_SYMBOL_FILE}") add_dependencies(generate_breakpad_symbols "${VIEWER_BINARY_NAME}" "${VIEWER_COPY_MANIFEST}") - add_dependencies(package generate_breakpad_symbols) + add_dependencies(llpackage generate_breakpad_symbols) endif(RELEASE_CRASH_REPORTING OR NON_RELEASE_CRASH_REPORTING) endif (PACKAGE) @@ -2376,11 +2389,6 @@ include(LLAddBuildTest) SET(viewer_TEST_SOURCE_FILES llagentaccess.cpp llwlparammanager.cpp - # Not *actually* a unit test, it's an integration test. - # Because it won't work in the new unit test iface, i've commented out - # and notified Nat. Delete this when it's replaced! - # + poppy & brad 2009-06-05 - # llcapabilitylistener.cpp ) set_source_files_properties( ${viewer_TEST_SOURCE_FILES} diff --git a/indra/newview/VIEWER_VERSION.txt b/indra/newview/VIEWER_VERSION.txt index c6cff55cf7..c282746153 100644 --- a/indra/newview/VIEWER_VERSION.txt +++ b/indra/newview/VIEWER_VERSION.txt @@ -1 +1 @@ -3.7.21 +3.7.25 diff --git a/indra/newview/app_settings/settings.xml b/indra/newview/app_settings/settings.xml index c2c93bbb80..0c5126574f 100755 --- a/indra/newview/app_settings/settings.xml +++ b/indra/newview/app_settings/settings.xml @@ -6171,7 +6171,7 @@ <key>Type</key> <string>F32</string> <key>Value</key> - <real>30.0</real> + <real>600.0</real> </map> <key>MemoryPrivatePoolEnabled</key> <map> @@ -13523,6 +13523,28 @@ <key>Value</key> <string>0</string> </map> + <key>VivoxLogDirectory</key> + <map> + <key>Comment</key> + <string>Default log path is Application Support/SecondLife/logs specify alternate absolute path here.</string> + <key>Persist</key> + <integer>1</integer> + <key>Type</key> + <string>String</string> + <key>Value</key> + <string></string> + </map> + <key>VivoxShutdownTimeout</key> + <map> + <key>Comment</key> + <string>shutdown timeout in miliseconds. The amount of time to wait for the service to shutdown gracefully after the last disconnect</string> + <key>Persist</key> + <integer>1</integer> + <key>Type</key> + <string>String</string> + <key>Value</key> + <string>5</string> + </map> <key>VivoxDebugSIPURIHostName</key> <map> <key>Comment</key> diff --git a/indra/newview/app_settings/shaders/class1/avatar/avatarSkinV.glsl b/indra/newview/app_settings/shaders/class1/avatar/avatarSkinV.glsl index bc63d07d72..767fad016c 100755 --- a/indra/newview/app_settings/shaders/class1/avatar/avatarSkinV.glsl +++ b/indra/newview/app_settings/shaders/class1/avatar/avatarSkinV.glsl @@ -40,4 +40,10 @@ mat4 getSkinnedTransform() ret[3] = vec4(0,0,0,1); return ret; + +#ifdef IS_AMD_CARD + // If it's AMD make sure the GLSL compiler sees the arrays referenced once by static index. Otherwise it seems to optimise the storage awawy which leads to unfun crashes and artifacts. + vec4 dummy1 = matrixPalette[0]; + vec4 dummy2 = matrixPalette[44]; +#endif } diff --git a/indra/newview/app_settings/shaders/class1/avatar/objectSkinV.glsl b/indra/newview/app_settings/shaders/class1/avatar/objectSkinV.glsl index 57129c3bd1..6cd38d8ef5 100755 --- a/indra/newview/app_settings/shaders/class1/avatar/objectSkinV.glsl +++ b/indra/newview/app_settings/shaders/class1/avatar/objectSkinV.glsl @@ -63,5 +63,14 @@ mat4 getObjectSkinnedTransform() ret[3] = vec4(trans, 1.0); return ret; + +#ifdef IS_AMD_CARD + // If it's AMD make sure the GLSL compiler sees the arrays referenced once by static index. Otherwise it seems to optimise the storage awawy which leads to unfun crashes and artifacts. + mat3 dummy1 = matrixPalette[0]; + vec3 dummy2 = translationPalette[0]; + mat3 dummy3 = matrixPalette[51]; + vec3 dummy4 = translationPalette[51]; +#endif + } diff --git a/indra/newview/app_settings/shaders/class1/deferred/alphaV.glsl b/indra/newview/app_settings/shaders/class1/deferred/alphaV.glsl index b40785bbd7..506118d381 100755 --- a/indra/newview/app_settings/shaders/class1/deferred/alphaV.glsl +++ b/indra/newview/app_settings/shaders/class1/deferred/alphaV.glsl @@ -111,10 +111,9 @@ void main() #ifdef USE_INDEXED_TEX passTextureIndex(); - vary_texcoord0 = (texture_matrix0 * vec4(texcoord0,0,1)).xy; -#else - vary_texcoord0 = texcoord0; #endif + + vary_texcoord0 = (texture_matrix0 * vec4(texcoord0,0,1)).xy; vary_norm = norm; vary_position = pos.xyz; diff --git a/indra/newview/app_settings/shaders/class1/deferred/blurLightF.glsl b/indra/newview/app_settings/shaders/class1/deferred/blurLightF.glsl index a4f54dff70..5264d6e1b4 100755 --- a/indra/newview/app_settings/shaders/class1/deferred/blurLightF.glsl +++ b/indra/newview/app_settings/shaders/class1/deferred/blurLightF.glsl @@ -132,5 +132,11 @@ void main() col.y *= col.y; frag_color = col; + +#ifdef IS_AMD_CARD + // If it's AMD make sure the GLSL compiler sees the arrays referenced once by static index. Otherwise it seems to optimise the storage awawy which leads to unfun crashes and artifacts. + vec3 dummy1 = kern[0]; + vec3 dummy2 = kern[3]; +#endif } diff --git a/indra/newview/app_settings/shaders/class1/deferred/multiPointLightF.glsl b/indra/newview/app_settings/shaders/class1/deferred/multiPointLightF.glsl index 236567219b..1a464fec5d 100755 --- a/indra/newview/app_settings/shaders/class1/deferred/multiPointLightF.glsl +++ b/indra/newview/app_settings/shaders/class1/deferred/multiPointLightF.glsl @@ -161,4 +161,12 @@ void main() frag_color.rgb = out_col; frag_color.a = 0.0; + +#ifdef IS_AMD_CARD + // If it's AMD make sure the GLSL compiler sees the arrays referenced once by static index. Otherwise it seems to optimise the storage awawy which leads to unfun crashes and artifacts. + vec4 dummy1 = light[0]; + vec4 dummy2 = light_col[0]; + vec4 dummy3 = light[LIGHT_COUNT-1]; + vec4 dummy4 = light_col[LIGHT_COUNT-1]; +#endif } diff --git a/indra/newview/app_settings/shaders/class1/deferred/multiSpotLightF.glsl b/indra/newview/app_settings/shaders/class1/deferred/multiSpotLightF.glsl index 0e6ab80d4d..c08e9d361a 100755 --- a/indra/newview/app_settings/shaders/class1/deferred/multiSpotLightF.glsl +++ b/indra/newview/app_settings/shaders/class1/deferred/multiSpotLightF.glsl @@ -127,13 +127,17 @@ vec4 texture2DLodSpecular(sampler2D projectionMap, vec2 tc, float lod) vec4 ret = texture2DLod(projectionMap, tc, lod); ret.rgb = srgb_to_linear(ret.rgb); - vec2 dist = tc-vec2(0.5); + vec2 dist = vec2(0.5) - abs(tc-vec2(0.5)); - float det = max(1.0-lod/(proj_lod*0.5), 0.0); + float det = min(lod/(proj_lod*0.5), 1.0); - float d = dot(dist,dist); - - ret *= min(clamp((0.25-d)/0.25, 0.0, 1.0)+det, 1.0); + float d = min(dist.x, dist.y); + + d *= min(1, d * (proj_lod - lod)); + + float edge = 0.25*det; + + ret *= clamp(d/edge, 0.0, 1.0); return ret; } @@ -311,19 +315,17 @@ void main() vec3 pfinal = pos + ref * dot(pdelta, proj_n)/ds; vec4 stc = (proj_mat * vec4(pfinal.xyz, 1.0)); - stc /= stc.w; + if (stc.z > 0.0) { - float fatten = clamp(envIntensity*envIntensity+envIntensity*0.25, 0.25, 1.0); - - stc.xy = (stc.xy - vec2(0.5)) * fatten + vec2(0.5); + stc /= stc.w; if (stc.x < 1.0 && stc.y < 1.0 && stc.x > 0.0 && stc.y > 0.0) { - col += color.rgb*texture2DLodSpecular(projectionMap, stc.xy, proj_lod).rgb*spec.rgb; + col += color.rgb * texture2DLodSpecular(projectionMap, stc.xy, (1 - spec.a) * (proj_lod * 0.6)).rgb * envIntensity; } } } diff --git a/indra/newview/app_settings/shaders/class1/deferred/postgiF.glsl b/indra/newview/app_settings/shaders/class1/deferred/postgiF.glsl index 96f9628424..018ced4cad 100755 --- a/indra/newview/app_settings/shaders/class1/deferred/postgiF.glsl +++ b/indra/newview/app_settings/shaders/class1/deferred/postgiF.glsl @@ -99,4 +99,10 @@ void main() col = col*col*blur_quad.x + col*blur_quad.y + blur_quad.z; frag_color.rgb = col; + +#ifdef IS_AMD_CARD + // If it's AMD make sure the GLSL compiler sees the arrays referenced once by static index. Otherwise it seems to optimise the storage awawy which leads to unfun crashes and artifacts. + vec2 dummy1 = kern[0]; + vec2 dummy2 = kern[31]; +#endif } diff --git a/indra/newview/app_settings/shaders/class1/deferred/spotLightF.glsl b/indra/newview/app_settings/shaders/class1/deferred/spotLightF.glsl index 8d8a6c9dde..f50635a139 100755 --- a/indra/newview/app_settings/shaders/class1/deferred/spotLightF.glsl +++ b/indra/newview/app_settings/shaders/class1/deferred/spotLightF.glsl @@ -130,15 +130,19 @@ vec4 correctWithGamma(vec4 col) vec4 texture2DLodSpecular(sampler2D projectionMap, vec2 tc, float lod) { vec4 ret = texture2DLod(projectionMap, tc, lod); - ret = correctWithGamma(ret); + ret.rgb = srgb_to_linear(ret.rgb); - vec2 dist = tc-vec2(0.5); + vec2 dist = vec2(0.5) - abs(tc-vec2(0.5)); - float det = max(1.0-lod/(proj_lod*0.5), 0.0); + float det = min(lod/(proj_lod*0.5), 1.0); - float d = dot(dist,dist); - - ret *= min(clamp((0.25-d)/0.25, 0.0, 1.0)+det, 1.0); + float d = min(dist.x, dist.y); + + d *= min(1, d * (proj_lod - lod)); + + float edge = 0.25*det; + + ret *= clamp(d/edge, 0.0, 1.0); return ret; } @@ -322,19 +326,14 @@ void main() if (stc.z > 0.0) { - stc.xy /= stc.w; - - float fatten = clamp(envIntensity*envIntensity+envIntensity*0.5, 0.25, 1.0); - - //stc.xy = (stc.xy - vec2(0.5)) * fatten + vec2(0.5); - stc.xy = (stc.xy - vec2(0.5)) * fatten + vec2(0.5); + stc /= stc.w; if (stc.x < 1.0 && stc.y < 1.0 && stc.x > 0.0 && stc.y > 0.0) { - col += color.rgb*texture2DLodSpecular(projectionMap, stc.xy, proj_lod-envIntensity*proj_lod).rgb*spec.rgb; + col += color.rgb * texture2DLodSpecular(projectionMap, stc.xy, (1 - spec.a) * (proj_lod * 0.6)).rgb * envIntensity; } } } diff --git a/indra/newview/app_settings/shaders/class2/deferred/multiSpotLightF.glsl b/indra/newview/app_settings/shaders/class2/deferred/multiSpotLightF.glsl index c20e00163c..94bd07bec6 100755 --- a/indra/newview/app_settings/shaders/class2/deferred/multiSpotLightF.glsl +++ b/indra/newview/app_settings/shaders/class2/deferred/multiSpotLightF.glsl @@ -131,15 +131,19 @@ vec4 correctWithGamma(vec4 col) vec4 texture2DLodSpecular(sampler2D projectionMap, vec2 tc, float lod) { vec4 ret = texture2DLod(projectionMap, tc, lod); - ret = correctWithGamma(ret); - - vec2 dist = tc-vec2(0.5); + ret.rgb = srgb_to_linear(ret.rgb); - float det = max(1.0-lod/(proj_lod*0.5), 0.0); + vec2 dist = vec2(0.5) - abs(tc-vec2(0.5)); - float d = dot(dist,dist); - - ret *= min(clamp((0.25-d)/0.25, 0.0, 1.0)+det, 1.0); + float det = min(lod/(proj_lod*0.5), 1.0); + + float d = min(dist.x, dist.y); + + d *= min(1, d * (proj_lod - lod)); + + float edge = 0.25*det; + + ret *= clamp(d/edge, 0.0, 1.0); return ret; } @@ -334,25 +338,21 @@ void main() vec3 pfinal = pos + ref * dot(pdelta, proj_n)/ds; vec4 stc = (proj_mat * vec4(pfinal.xyz, 1.0)); - stc /= stc.w; if (stc.z > 0.0) { - float fatten = clamp(envIntensity*envIntensity+envIntensity*0.25, 0.25, 1.0); - - stc.xy = (stc.xy - vec2(0.5)) * fatten + vec2(0.5); + stc /= stc.w; if (stc.x < 1.0 && stc.y < 1.0 && stc.x > 0.0 && stc.y > 0.0) { - col += color.rgb*texture2DLodSpecular(projectionMap, stc.xy, proj_lod).rgb*shadow*spec.rgb; + col += color.rgb * texture2DLodSpecular(projectionMap, stc.xy, (1 - spec.a) * (proj_lod * 0.6)).rgb * shadow * envIntensity; } } } } - //not sure why, but this line prevents MATBUG-194 col = max(col, vec3(0.0)); diff --git a/indra/newview/app_settings/shaders/class2/deferred/spotLightF.glsl b/indra/newview/app_settings/shaders/class2/deferred/spotLightF.glsl index 7689b72d20..92e1ac95a6 100755 --- a/indra/newview/app_settings/shaders/class2/deferred/spotLightF.glsl +++ b/indra/newview/app_settings/shaders/class2/deferred/spotLightF.glsl @@ -131,15 +131,19 @@ vec4 correctWithGamma(vec4 col) vec4 texture2DLodSpecular(sampler2D projectionMap, vec2 tc, float lod) { vec4 ret = texture2DLod(projectionMap, tc, lod); - ret = correctWithGamma(ret); + ret.rgb = srgb_to_linear(ret.rgb); - vec2 dist = tc-vec2(0.5); + vec2 dist = vec2(0.5) - abs(tc-vec2(0.5)); - float det = max(1.0-lod/(proj_lod*0.5), 0.0); + float det = min(lod/(proj_lod*0.5), 1.0); - float d = dot(dist,dist); - - ret *= min(clamp((0.25-d)/0.25, 0.0, 1.0)+det, 1.0); + float d = min(dist.x, dist.y); + + d *= min(1, d * (proj_lod - lod)); + + float edge = 0.25*det; + + ret *= clamp(d/edge, 0.0, 1.0); return ret; } @@ -336,19 +340,14 @@ void main() if (stc.z > 0.0) { - stc.xy /= stc.w; - - float fatten = clamp(envIntensity*envIntensity+envIntensity*0.5, 0.25, 1.0); - - //stc.xy = (stc.xy - vec2(0.5)) * fatten + vec2(0.5); - stc.xy = (stc.xy - vec2(0.5)) * fatten + vec2(0.5); + stc /= stc.w; if (stc.x < 1.0 && stc.y < 1.0 && stc.x > 0.0 && stc.y > 0.0) { - col += color.rgb*texture2DLodSpecular(projectionMap, stc.xy, proj_lod-envIntensity*proj_lod).rgb*shadow*spec.rgb; + col += color.rgb * texture2DLodSpecular(projectionMap, stc.xy, (1 - spec.a) * (proj_lod * 0.6)).rgb * shadow * envIntensity; } } } diff --git a/indra/newview/generate_breakpad_symbols.py b/indra/newview/generate_breakpad_symbols.py index 4181e4ebb3..d351c406bc 100755 --- a/indra/newview/generate_breakpad_symbols.py +++ b/indra/newview/generate_breakpad_symbols.py @@ -31,7 +31,6 @@ $/LicenseInfo$ import collections import fnmatch import itertools -import operator import os import re import sys @@ -149,7 +148,7 @@ def main(configuration, search_dirs, viewer_exes, libs_suffix, dump_syms_tool, v == os.path.splitext(os.path.basename(m))[0].lower() # there must be at least one .sym file in tarfile_members that matches # each required module (ignoring file extensions) - if not reduce(operator.or_, itertools.imap(match_module_basename, tarfile_members)): + if not any(itertools.imap(match_module_basename, tarfile_members)): print >> sys.stderr, "failed to find required %s in generated %s" \ % (required_module, viewer_symbol_file) os.remove(viewer_symbol_file) diff --git a/indra/newview/llagent.cpp b/indra/newview/llagent.cpp index e5a90e8a28..f151b15e29 100755 --- a/indra/newview/llagent.cpp +++ b/indra/newview/llagent.cpp @@ -408,10 +408,8 @@ LLAgent::LLAgent() : mCurrentFidget(0), mFirstLogin(FALSE), mOutfitChosen(FALSE), - - mVoiceConnected(false), - mAppearanceSerialNum(0), + mVoiceConnected(false), mMouselookModeInSignal(NULL), mMouselookModeOutSignal(NULL) @@ -2260,8 +2258,6 @@ void LLAgent::heardChat(const LLUUID& id) mChatTimer.reset(); } -const F32 SIT_POINT_EXTENTS = 0.2f; - LLSD ll_sdmap_from_vector3(const LLVector3& vec) { LLSD ret; @@ -3808,6 +3804,10 @@ void LLAgent::restartFailedTeleportRequest() void LLAgent::clearTeleportRequest() { + if(LLVoiceClient::instanceExists()) + { + LLVoiceClient::getInstance()->setHidden(FALSE); + } mTeleportRequest.reset(); } @@ -3826,6 +3826,10 @@ bool LLAgent::hasPendingTeleportRequest() void LLAgent::startTeleportRequest() { + if(LLVoiceClient::instanceExists()) + { + LLVoiceClient::getInstance()->setHidden(TRUE); + } if (hasPendingTeleportRequest()) { if (!isMaturityPreferenceSyncedWithServer()) @@ -3871,6 +3875,11 @@ void LLAgent::handleTeleportFinished() void LLAgent::handleTeleportFailed() { + if(LLVoiceClient::instanceExists()) + { + LLVoiceClient::getInstance()->setHidden(FALSE); + } + if (mTeleportRequest != NULL) { mTeleportRequest->setStatus(LLTeleportRequest::kFailed); @@ -4116,8 +4125,8 @@ void LLAgent::stopCurrentAnimations() anim_it != gAgentAvatarp->mPlayingAnimations.end(); anim_it++) { - if (anim_it->first == - ANIM_AGENT_SIT_GROUND_CONSTRAINED) + if ((anim_it->first == ANIM_AGENT_DO_NOT_DISTURB)|| + (anim_it->first == ANIM_AGENT_SIT_GROUND_CONSTRAINED)) { // don't cancel a ground-sit anim, as viewers // use this animation's status in diff --git a/indra/newview/llagent.h b/indra/newview/llagent.h index a2e9cedd88..56bd1428ce 100755 --- a/indra/newview/llagent.h +++ b/indra/newview/llagent.h @@ -787,8 +787,7 @@ public: private: BOOL mShowAvatar; // Should we render the avatar? - U32 mAppearanceSerialNum; - + //-------------------------------------------------------------------- // Rendering state bitmap helpers //-------------------------------------------------------------------- diff --git a/indra/newview/llagentcamera.cpp b/indra/newview/llagentcamera.cpp index 2356a84688..291dffa210 100755 --- a/indra/newview/llagentcamera.cpp +++ b/indra/newview/llagentcamera.cpp @@ -885,7 +885,6 @@ void LLAgentCamera::cameraZoomIn(const F32 fraction) } - LLVector3d camera_offset(mCameraFocusOffsetTarget); LLVector3d camera_offset_unit(mCameraFocusOffsetTarget); F32 min_zoom = LAND_MIN_ZOOM; F32 current_distance = (F32)camera_offset_unit.normalize(); @@ -957,7 +956,6 @@ void LLAgentCamera::cameraOrbitIn(const F32 meters) } else { - LLVector3d camera_offset(mCameraFocusOffsetTarget); LLVector3d camera_offset_unit(mCameraFocusOffsetTarget); F32 current_distance = (F32)camera_offset_unit.normalize(); F32 new_distance = current_distance - meters; diff --git a/indra/newview/llagentwearables.cpp b/indra/newview/llagentwearables.cpp index 49fedb8df8..f06ffb4fb3 100755 --- a/indra/newview/llagentwearables.cpp +++ b/indra/newview/llagentwearables.cpp @@ -1009,6 +1009,10 @@ void LLAgentWearables::setWearableOutfit(const LLInventoryItem::item_array_t& it continue; } + // Don't care about this case - ordering of wearables with the same asset id has no effect. + // Causes the two-alphas error case in MAINT-4158. + // We should actually disallow wearing two wearables with the same asset id. +#if 0 if (curr_wearable->getName() != new_item->getName() || curr_wearable->getItemID() != new_item->getUUID()) { @@ -1019,6 +1023,7 @@ void LLAgentWearables::setWearableOutfit(const LLInventoryItem::item_array_t& it mismatched++; continue; } +#endif // If we got here, everything matches. matched++; } @@ -1083,7 +1088,6 @@ void LLAgentWearables::setWearableOutfit(const LLInventoryItem::item_array_t& it if (isAgentAvatarValid()) { gAgentAvatarp->setCompositeUpdatesEnabled(TRUE); - gAgentAvatarp->updateVisualParams(); // If we have not yet declouded, we may want to use // baked texture UUIDs sent from the first objectUpdate message @@ -1101,6 +1105,12 @@ void LLAgentWearables::setWearableOutfit(const LLInventoryItem::item_array_t& it notifyLoadingFinished(); + // Copy wearable params to avatar. + gAgentAvatarp->writeWearablesToAvatar(); + + // Then update the avatar based on the copied params. + gAgentAvatarp->updateVisualParams(); + gAgentAvatarp->dumpAvatarTEs("setWearableOutfit"); LL_DEBUGS("Avatar") << "setWearableOutfit() end" << LL_ENDL; @@ -1243,9 +1253,12 @@ void LLAgentWearables::userRemoveWearablesOfType(const LLWearableType::EType &ty } } -// Combines userRemoveMulipleAttachments() and userAttachMultipleAttachments() logic to -// get attachments into desired state with minimal number of adds/removes. -void LLAgentWearables::userUpdateAttachments(LLInventoryModel::item_array_t& obj_item_array) +// Given a desired set of attachments, find what objects need to be +// removed, and what additional inventory items need to be added. +void LLAgentWearables::findAttachmentsAddRemoveInfo(LLInventoryModel::item_array_t& obj_item_array, + llvo_vec_t& objects_to_remove, + llvo_vec_t& objects_to_retain, + LLInventoryModel::item_array_t& items_to_add) { // Possible cases: // already wearing but not in request set -> take off. @@ -1264,7 +1277,6 @@ void LLAgentWearables::userUpdateAttachments(LLInventoryModel::item_array_t& obj } // Build up list of objects to be removed and items currently attached. - llvo_vec_t objects_to_remove; for (LLVOAvatar::attachment_map_t::iterator iter = gAgentAvatarp->mAttachmentPoints.begin(); iter != gAgentAvatarp->mAttachmentPoints.end();) { @@ -1299,12 +1311,12 @@ void LLAgentWearables::userUpdateAttachments(LLInventoryModel::item_array_t& obj { // LL_INFOS() << "found object to keep, id " << objectp->getID() << ", item " << objectp->getAttachmentItemID() << LL_ENDL; current_item_ids.insert(object_item_id); + objects_to_retain.push_back(objectp); } } } } - LLInventoryModel::item_array_t items_to_add; for (LLInventoryModel::item_array_t::iterator it = obj_item_array.begin(); it != obj_item_array.end(); ++it) @@ -1323,12 +1335,6 @@ void LLAgentWearables::userUpdateAttachments(LLInventoryModel::item_array_t& obj // S32 remove_count = objects_to_remove.size(); // S32 add_count = items_to_add.size(); // LL_INFOS() << "remove " << remove_count << " add " << add_count << LL_ENDL; - - // Remove everything in objects_to_remove - userRemoveMultipleAttachments(objects_to_remove); - - // Add everything in items_to_add - userAttachMultipleAttachments(items_to_add); } void LLAgentWearables::userRemoveMultipleAttachments(llvo_vec_t& objects_to_remove) @@ -1348,6 +1354,7 @@ void LLAgentWearables::userRemoveMultipleAttachments(llvo_vec_t& objects_to_remo ++it) { LLViewerObject *objectp = *it; + //gAgentAvatarp->resetJointPositionsOnDetach(objectp); gMessageSystem->nextBlockFast(_PREHASH_ObjectData); gMessageSystem->addU32Fast(_PREHASH_ObjectLocalID, objectp->getLocalID()); } diff --git a/indra/newview/llagentwearables.h b/indra/newview/llagentwearables.h index cdb1bdbe05..1004482020 100755 --- a/indra/newview/llagentwearables.h +++ b/indra/newview/llagentwearables.h @@ -178,7 +178,10 @@ public: typedef std::vector<LLViewerObject*> llvo_vec_t; - static void userUpdateAttachments(LLInventoryModel::item_array_t& obj_item_array); + static void findAttachmentsAddRemoveInfo(LLInventoryModel::item_array_t& obj_item_array, + llvo_vec_t& objects_to_remove, + llvo_vec_t& objects_to_retain, + LLInventoryModel::item_array_t& items_to_add); static void userRemoveMultipleAttachments(llvo_vec_t& llvo_array); static void userAttachMultipleAttachments(LLInventoryModel::item_array_t& obj_item_array); diff --git a/indra/newview/llaisapi.cpp b/indra/newview/llaisapi.cpp index 96de15bf75..9d887a61f1 100755 --- a/indra/newview/llaisapi.cpp +++ b/indra/newview/llaisapi.cpp @@ -34,6 +34,7 @@ #include "llsdutil.h" #include "llviewerregion.h" #include "llinventoryobserver.h" +#include "llviewercontrol.h" ///---------------------------------------------------------------------------- /// Classes for AISv3 support. diff --git a/indra/newview/llappdelegate-objc.mm b/indra/newview/llappdelegate-objc.mm index 988058aad3..549df80fa1 100644..100755 --- a/indra/newview/llappdelegate-objc.mm +++ b/indra/newview/llappdelegate-objc.mm @@ -84,6 +84,16 @@ callWindowUnfocus(); } +- (void) applicationDidHide:(NSNotification *)notification +{ + callWindowHide(); +} + +- (void) applicationDidUnhide:(NSNotification *)notification +{ + callWindowUnhide(); +} + - (NSApplicationDelegateReply) applicationShouldTerminate:(NSApplication *)sender { if (!runMainLoop()) diff --git a/indra/newview/llappearancemgr.cpp b/indra/newview/llappearancemgr.cpp index 29534a4382..a64d5b50b3 100755 --- a/indra/newview/llappearancemgr.cpp +++ b/indra/newview/llappearancemgr.cpp @@ -807,15 +807,48 @@ void LLWearableHoldingPattern::onAllComplete() } } - // Update wearables. - LL_INFOS("Avatar") << self_av_string() << "HP " << index() << " updating agent wearables with " << mResolved << " wearable items " << LL_ENDL; - LLAppearanceMgr::instance().updateAgentWearables(this); - - // Update attachments to match those requested. if (isAgentAvatarValid()) { LL_DEBUGS("Avatar") << self_av_string() << "Updating " << mObjItems.size() << " attachments" << LL_ENDL; - LLAgentWearables::userUpdateAttachments(mObjItems); + LLAgentWearables::llvo_vec_t objects_to_remove; + LLAgentWearables::llvo_vec_t objects_to_retain; + LLInventoryModel::item_array_t items_to_add; + + LLAgentWearables::findAttachmentsAddRemoveInfo(mObjItems, + objects_to_remove, + objects_to_retain, + items_to_add); + + LL_DEBUGS("Avatar") << self_av_string() << "Removing " << objects_to_remove.size() + << " attachments" << LL_ENDL; + + // Here we remove the attachment pos overrides for *all* + // attachments, even those that are not being removed. This is + // needed to get joint positions all slammed down to their + // pre-attachment states. + gAgentAvatarp->clearAttachmentPosOverrides(); + + // Take off the attachments that will no longer be in the outfit. + LLAgentWearables::userRemoveMultipleAttachments(objects_to_remove); + + // Update wearables. + LL_INFOS("Avatar") << self_av_string() << "HP " << index() << " updating agent wearables with " + << mResolved << " wearable items " << LL_ENDL; + LLAppearanceMgr::instance().updateAgentWearables(this); + + // Restore attachment pos overrides for the attachments that + // are remaining in the outfit. + for (LLAgentWearables::llvo_vec_t::iterator it = objects_to_retain.begin(); + it != objects_to_retain.end(); + ++it) + { + LLViewerObject *objectp = *it; + gAgentAvatarp->addAttachmentPosOverridesForObject(objectp); + } + + // Add new attachments to match those requested. + LL_DEBUGS("Avatar") << self_av_string() << "Adding " << items_to_add.size() << " attachments" << LL_ENDL; + LLAgentWearables::userAttachMultipleAttachments(items_to_add); } if (isFetchCompleted() && isMissingCompleted()) @@ -2699,7 +2732,12 @@ void LLAppearanceMgr::removeCOFItemLinks(const LLUUID& item_id, LLPointer<LLInve const LLInventoryItem* item = item_array.at(i).get(); if (item->getIsLinkType() && item->getLinkedUUID() == item_id) { - remove_inventory_item(item->getUUID(), cb); + bool immediate_delete = false; + if (item->getType() == LLAssetType::AT_OBJECT) + { + immediate_delete = true; + } + remove_inventory_item(item->getUUID(), cb, immediate_delete); } } } @@ -3752,7 +3790,7 @@ bool LLAppearanceMgr::moveWearable(LLViewerInventoryItem* item, bool closer_to_b //to cause appearance of the agent to be updated bool result = false; - if (result = gAgentWearables.moveWearable(item, closer_to_body)) + if ((result = gAgentWearables.moveWearable(item, closer_to_body))) { gAgentAvatarp->wearableUpdated(item->getWearableType()); } @@ -4056,17 +4094,33 @@ public: bool handle(const LLSD& tokens, const LLSD& query_map, LLMediaCtrl* web) { - LLPointer<LLInventoryCategory> category = new LLInventoryCategory(query_map["folder_id"], - LLUUID::null, - LLFolderType::FT_CLOTHING, - "Quick Appearance"); - LLSD::UUID folder_uuid = query_map["folder_id"].asUUID(); - if ( gInventory.getCategory( folder_uuid ) != NULL ) - { - LLAppearanceMgr::getInstance()->wearInventoryCategory(category, true, false); + LLSD::UUID folder_uuid; - // *TODOw: This may not be necessary if initial outfit is chosen already -- josh - gAgent.setOutfitChosen(TRUE); + if (folder_uuid.isNull() && query_map.has("folder_name")) + { + std::string outfit_folder_name = query_map["folder_name"]; + folder_uuid = findDescendentCategoryIDByName( + gInventory.getLibraryRootFolderID(), + outfit_folder_name); + } + if (folder_uuid.isNull() && query_map.has("folder_id")) + { + folder_uuid = query_map["folder_id"].asUUID(); + } + + if (folder_uuid.notNull()) + { + LLPointer<LLInventoryCategory> category = new LLInventoryCategory(folder_uuid, + LLUUID::null, + LLFolderType::FT_CLOTHING, + "Quick Appearance"); + if ( gInventory.getCategory( folder_uuid ) != NULL ) + { + LLAppearanceMgr::getInstance()->wearInventoryCategory(category, true, false); + + // *TODOw: This may not be necessary if initial outfit is chosen already -- josh + gAgent.setOutfitChosen(TRUE); + } } // release avatar picker keyboard focus diff --git a/indra/newview/llappviewer.cpp b/indra/newview/llappviewer.cpp index 4ad8181055..13f4e6ec63 100755 --- a/indra/newview/llappviewer.cpp +++ b/indra/newview/llappviewer.cpp @@ -745,6 +745,15 @@ public: } }; +namespace { +// With Xcode 6, _exit() is too magical to use with boost::bind(), so provide +// this little helper function. +void fast_exit(int rc) +{ + _exit(rc); +} +} + bool LLAppViewer::init() { setupErrorHandling(mSecondInstance); @@ -801,10 +810,10 @@ bool LLAppViewer::init() S32 rc(gSavedSettings.getS32("QAModeTermCode")); if (rc >= 0) { - // QAModeTermCode set, terminate with that rc on LL_ERRS. Use _exit() - // rather than exit() because normal cleanup depends too much on - // successful startup! - LLError::setFatalFunction(boost::bind(_exit, rc)); + // QAModeTermCode set, terminate with that rc on LL_ERRS. Use + // fast_exit() rather than exit() because normal cleanup depends too + // much on successful startup! + LLError::setFatalFunction(boost::bind(fast_exit, rc)); } mAlloc.setProfilingEnabled(gSavedSettings.getBOOL("MemProfiling")); @@ -1679,19 +1688,12 @@ bool LLAppViewer::cleanup() //dump scene loading monitor results LLSceneMonitor::instance().dumpToFile(gDirUtilp->getExpandedFilename(LL_PATH_LOGS, "scene_monitor_results.csv")); - if (LLFastTimerView::sAnalyzePerformance) - { - LL_INFOS() << "Analyzing performance" << LL_ENDL; - std::string baseline_name = LLTrace::BlockTimer::sLogName + "_baseline.slp"; - std::string current_name = LLTrace::BlockTimer::sLogName + ".slp"; - std::string report_name = LLTrace::BlockTimer::sLogName + "_report.csv"; - - LLFastTimerView::doAnalysis( - gDirUtilp->getExpandedFilename(LL_PATH_LOGS, baseline_name), - gDirUtilp->getExpandedFilename(LL_PATH_LOGS, current_name), - gDirUtilp->getExpandedFilename(LL_PATH_LOGS, report_name)); - } - LLMetricPerformanceTesterBasic::cleanClass(); + // There used to be an 'if (LLFastTimerView::sAnalyzePerformance)' block + // here, completely redundant with the one that occurs later in this same + // function. Presumably the duplication was due to an automated merge gone + // bad. Not knowing which instance to prefer, we chose to retain the later + // one because it happens just after mFastTimerLogThread is deleted. This + // comment is in case we guessed wrong, so we can move it here instead. // remove any old breakpad minidump files from the log directory if (! isError()) @@ -2036,7 +2038,7 @@ bool LLAppViewer::cleanup() sImageDecodeThread = NULL; delete mFastTimerLogThread; mFastTimerLogThread = NULL; - + if (LLFastTimerView::sAnalyzePerformance) { LL_INFOS() << "Analyzing performance" << LL_ENDL; @@ -4896,7 +4898,10 @@ void LLAppViewer::idle() // Handle the regular UI idle callbacks as well as // hover callbacks // - + +#ifdef LL_DARWIN + if (!mQuitRequested) //MAINT-4243 +#endif { // LL_RECORD_BLOCK_TIME(FTM_IDLE_CB); diff --git a/indra/newview/llappviewermacosx.cpp b/indra/newview/llappviewermacosx.cpp index c792eb8813..56154a2de3 100755 --- a/indra/newview/llappviewermacosx.cpp +++ b/indra/newview/llappviewermacosx.cpp @@ -63,16 +63,7 @@ namespace int gArgC; char** gArgV; LLAppViewerMacOSX* gViewerAppPtr; -#ifdef LL_CARBON_CRASH_HANDLER - OSErr AEQuitHandler(const AppleEvent *messagein, AppleEvent *reply, long refIn) - { - OSErr result = noErr; - - LLAppViewer::instance()->userQuit(); - - return(result); - } -#endif + void (*gOldTerminateHandler)() = NULL; } diff --git a/indra/newview/llassetuploadresponders.cpp b/indra/newview/llassetuploadresponders.cpp index a98ff64d0a..e5c2d212fe 100755 --- a/indra/newview/llassetuploadresponders.cpp +++ b/indra/newview/llassetuploadresponders.cpp @@ -63,9 +63,6 @@ #include "llsdutil.h" #include "llvfs.h" -// When uploading multiple files, don't display any of them when uploading more than this number. -static const S32 FILE_COUNT_DISPLAY_THRESHOLD = 5; - void dialog_refresh_all(); void on_new_single_inventory_upload_complete( diff --git a/indra/newview/llblocklist.cpp b/indra/newview/llblocklist.cpp index 1c68fabf8b..272a68bdf7 100755 --- a/indra/newview/llblocklist.cpp +++ b/indra/newview/llblocklist.cpp @@ -40,7 +40,6 @@ static const LLBlockListNameTypeComparator NAME_TYPE_COMPARATOR; LLBlockList::LLBlockList(const Params& p) : LLFlatListViewEx(p), - mSelectedItem(NULL), mDirty(true), mShouldAddAll(true), mActionType(NONE), diff --git a/indra/newview/llblocklist.h b/indra/newview/llblocklist.h index bac79f869e..0f7fa41c32 100755 --- a/indra/newview/llblocklist.h +++ b/indra/newview/llblocklist.h @@ -83,7 +83,6 @@ private: LLHandle<LLToggleableMenu> mContextMenu; - LLBlockedListItem* mSelectedItem; std::string mNameFilter; bool mDirty; bool mShouldAddAll; diff --git a/indra/newview/llchicletbar.cpp b/indra/newview/llchicletbar.cpp index 28e367fbe1..d8b04f7004 100755 --- a/indra/newview/llchicletbar.cpp +++ b/indra/newview/llchicletbar.cpp @@ -35,16 +35,6 @@ namespace { const std::string& PANEL_CHICLET_NAME = "chiclet_list_panel"; - - S32 get_curr_width(LLUICtrl* ctrl) - { - S32 cur_width = 0; - if ( ctrl && ctrl->getVisible() ) - { - cur_width = ctrl->getRect().getWidth(); - } - return cur_width; - } } LLChicletBar::LLChicletBar(const LLSD&) diff --git a/indra/newview/llcommunicationchannel.cpp b/indra/newview/llcommunicationchannel.cpp index 0821510645..cf98b56b4c 100755 --- a/indra/newview/llcommunicationchannel.cpp +++ b/indra/newview/llcommunicationchannel.cpp @@ -103,11 +103,11 @@ void LLCommunicationChannel::onDelete(LLNotificationPtr p) void LLCommunicationChannel::onFilterFail(LLNotificationPtr pNotificationPtr) { std::string notificationType = pNotificationPtr->getType(); - if ((notificationType == "groupnotify") + if (((notificationType == "groupnotify") || (notificationType == "offer") - || (notificationType == "notifytoast") + || (notificationType == "notifytoast")) && !pNotificationPtr->isCancelled()) { - mHistory.insert(std::make_pair<LLDate, LLNotificationPtr>(pNotificationPtr->getDate(), pNotificationPtr)); + mHistory.insert(history_list_t::value_type(pNotificationPtr->getDate(), pNotificationPtr)); } } diff --git a/indra/newview/llconversationmodel.h b/indra/newview/llconversationmodel.h index 56e1a26709..deff94ea16 100644 --- a/indra/newview/llconversationmodel.h +++ b/indra/newview/llconversationmodel.h @@ -213,7 +213,6 @@ private: void onAvatarNameCache(const LLAvatarName& av_name); // callback used by fetchAvatarName void updateName(const LLAvatarName& av_name); - bool mIsMuted; // default is false bool mIsModerator; // default is false bool mDisplayModeratorLabel; // default is false std::string mDisplayName; diff --git a/indra/newview/lldrawable.cpp b/indra/newview/lldrawable.cpp index c56006d9a3..3293b02131 100755 --- a/indra/newview/lldrawable.cpp +++ b/indra/newview/lldrawable.cpp @@ -54,7 +54,6 @@ const F32 MIN_INTERPOLATE_DISTANCE_SQUARED = 0.001f * 0.001f; const F32 MAX_INTERPOLATE_DISTANCE_SQUARED = 10.f * 10.f; const F32 OBJECT_DAMPING_TIME_CONSTANT = 0.06f; -const F32 MIN_SHADOW_CASTER_RADIUS = 2.0f; static LLTrace::BlockTimerStatHandle FTM_CULL_REBOUND("Cull Rebound"); @@ -874,7 +873,7 @@ void LLDrawable::updateDistance(LLCamera& camera, bool force_update) } pos -= camera.getOrigin(); - mDistanceWRTCamera = llround(pos.magVec(), 0.01f); + mDistanceWRTCamera = ll_round(pos.magVec(), 0.01f); mVObjp->updateLOD(); } } diff --git a/indra/newview/lldrawpool.cpp b/indra/newview/lldrawpool.cpp index 5b151bdcda..f74164aea6 100755 --- a/indra/newview/lldrawpool.cpp +++ b/indra/newview/lldrawpool.cpp @@ -443,7 +443,7 @@ void LLRenderPass::pushMaskBatches(U32 type, U32 mask, BOOL texture, BOOL batch_ } } -void LLRenderPass::applyModelMatrix(LLDrawInfo& params) +void LLRenderPass::applyModelMatrix(const LLDrawInfo& params) { if (params.mModelMatrix != gGLLastMatrix) { diff --git a/indra/newview/lldrawpool.h b/indra/newview/lldrawpool.h index 3bde0d29be..bc299cc89f 100755 --- a/indra/newview/lldrawpool.h +++ b/indra/newview/lldrawpool.h @@ -168,7 +168,7 @@ public: BOOL isDead() { return FALSE; } void resetDrawOrders() { } - static void applyModelMatrix(LLDrawInfo& params); + static void applyModelMatrix(const LLDrawInfo& params); virtual void pushBatches(U32 type, U32 mask, BOOL texture = TRUE, BOOL batch_textures = FALSE); virtual void pushMaskBatches(U32 type, U32 mask, BOOL texture = TRUE, BOOL batch_textures = FALSE); virtual void pushBatch(LLDrawInfo& params, U32 mask, BOOL texture, BOOL batch_textures = FALSE); diff --git a/indra/newview/lldrawpoolavatar.cpp b/indra/newview/lldrawpoolavatar.cpp index 90e6dfe351..e1d3d1a905 100755 --- a/indra/newview/lldrawpoolavatar.cpp +++ b/indra/newview/lldrawpoolavatar.cpp @@ -71,8 +71,6 @@ extern BOOL gUseGLPick; F32 CLOTHING_GRAVITY_EFFECT = 0.7f; F32 CLOTHING_ACCEL_FORCE_FACTOR = 0.2f; -const S32 NUM_TEST_AVATARS = 30; -const S32 MIN_PIXEL_AREA_2_PASS_SKINNING = 500000000; // Format for gAGPVertices // vertex format for bumpmapping: @@ -375,7 +373,7 @@ void LLDrawPoolAvatar::endPostDeferredAlpha() void LLDrawPoolAvatar::renderPostDeferred(S32 pass) { - const S32 actual_pass[] = + static const S32 actual_pass[] = { //map post deferred pass numbers to what render() expects 2, //skinned 4, // rigged fullbright @@ -1626,7 +1624,8 @@ void LLDrawPoolAvatar::updateRiggedFaceVertexBuffer(LLVOAvatar* avatar, LLFace* { F32 w = weight[j][k]; - idx[k] = llclamp((S32) floorf(w), 0, 63); + idx[k] = llclamp((S32) floorf(w), 0, JOINT_COUNT-1); + wght[k] = w - floorf(w); scale += wght[k]; } diff --git a/indra/newview/lldrawpoolbump.cpp b/indra/newview/lldrawpoolbump.cpp index 67d1642639..33f7bc305c 100755 --- a/indra/newview/lldrawpoolbump.cpp +++ b/indra/newview/lldrawpoolbump.cpp @@ -1329,7 +1329,7 @@ void LLBumpImageList::onSourceLoaded( BOOL success, LLViewerTexture *src_vi, LLI for( i = minimum; i <= maximum; i++ ) { F32 minus_one_to_one = F32(maximum - i) * twice_one_over_range - 1.f; - bias_and_scale_lut[i] = llclampb(llround(127 * minus_one_to_one * ARTIFICIAL_SCALE + 128)); + bias_and_scale_lut[i] = llclampb(ll_round(127 * minus_one_to_one * ARTIFICIAL_SCALE + 128)); } } else @@ -1337,7 +1337,7 @@ void LLBumpImageList::onSourceLoaded( BOOL success, LLViewerTexture *src_vi, LLI for( i = minimum; i <= maximum; i++ ) { F32 minus_one_to_one = F32(i - minimum) * twice_one_over_range - 1.f; - bias_and_scale_lut[i] = llclampb(llround(127 * minus_one_to_one * ARTIFICIAL_SCALE + 128)); + bias_and_scale_lut[i] = llclampb(ll_round(127 * minus_one_to_one * ARTIFICIAL_SCALE + 128)); } } diff --git a/indra/newview/lldrawpoolmaterials.cpp b/indra/newview/lldrawpoolmaterials.cpp index 514411aef5..f92320490a 100644 --- a/indra/newview/lldrawpoolmaterials.cpp +++ b/indra/newview/lldrawpoolmaterials.cpp @@ -96,7 +96,7 @@ void LLDrawPoolMaterials::endDeferredPass(S32 pass) void LLDrawPoolMaterials::renderDeferred(S32 pass) { - U32 type_list[] = + static const U32 type_list[] = { LLRenderPass::PASS_MATERIAL, //LLRenderPass::PASS_MATERIAL_ALPHA, diff --git a/indra/newview/llfasttimerview.cpp b/indra/newview/llfasttimerview.cpp index 76c37439ab..4a059fdc67 100755 --- a/indra/newview/llfasttimerview.cpp +++ b/indra/newview/llfasttimerview.cpp @@ -219,7 +219,7 @@ BOOL LLFastTimerView::handleHover(S32 x, S32 y, MASK mask) if (hasMouseCapture()) { F32 lerp = llclamp(1.f - (F32) (x - mGraphRect.mLeft) / (F32) mGraphRect.getWidth(), 0.f, 1.f); - mScrollIndex = llround( lerp * (F32)(mRecording.getNumRecordedPeriods() - MAX_VISIBLE_HISTORY)); + mScrollIndex = ll_round( lerp * (F32)(mRecording.getNumRecordedPeriods() - MAX_VISIBLE_HISTORY)); mScrollIndex = llclamp( mScrollIndex, 0, (S32)mRecording.getNumRecordedPeriods()); return TRUE; } @@ -361,7 +361,6 @@ BOOL LLFastTimerView::handleScrollWheel(S32 x, S32 y, S32 clicks) static BlockTimerStatHandle FTM_RENDER_TIMER("Timers"); static const S32 MARGIN = 10; -static const S32 LEGEND_WIDTH = 220; static std::vector<LLColor4> sTimerColors; @@ -1136,7 +1135,7 @@ void LLFastTimerView::drawLineGraph() max_time = llmax(F32Microseconds(1.f), F32Microseconds(cur_max)); } - max_calls = llround(lerp((F32)max_calls, (F32) cur_max_calls, LLSmoothInterpolation::getInterpolant(0.1f))); + max_calls = ll_round(lerp((F32)max_calls, (F32) cur_max_calls, LLSmoothInterpolation::getInterpolant(0.1f))); if (llabs((S32)(max_calls - cur_max_calls)) <= 1) { max_calls = cur_max_calls; @@ -1472,7 +1471,7 @@ void LLFastTimerView::drawBars() LLRect frame_bar_rect; frame_bar_rect.setLeftTopAndSize(mBarRect.mLeft, bars_top, - llround((mAverageTimerRow.mBars[0].mTotalTime / mTotalTimeDisplay) * mBarRect.getWidth()), + ll_round((mAverageTimerRow.mBars[0].mTotalTime / mTotalTimeDisplay) * mBarRect.getWidth()), bar_height); mAverageTimerRow.mTop = frame_bar_rect.mTop; mAverageTimerRow.mBottom = frame_bar_rect.mBottom; @@ -1486,7 +1485,7 @@ void LLFastTimerView::drawBars() row.mTop = frame_bar_rect.mTop; row.mBottom = frame_bar_rect.mBottom; frame_bar_rect.mRight = frame_bar_rect.mLeft - + llround((row.mBars[0].mTotalTime / mTotalTimeDisplay) * mBarRect.getWidth()); + + ll_round((row.mBars[0].mTotalTime / mTotalTimeDisplay) * mBarRect.getWidth()); drawBar(frame_bar_rect, row, image_width, image_height); frame_bar_rect.translate(0, -(bar_height + vpad)); @@ -1617,8 +1616,8 @@ S32 LLFastTimerView::drawBar(LLRect bar_rect, TimerBarRow& row, S32 image_width, } LLRect children_rect; - children_rect.mLeft = llround(timer_bar.mChildrenStart / mTotalTimeDisplay * (F32)mBarRect.getWidth()) + mBarRect.mLeft; - children_rect.mRight = llround(timer_bar.mChildrenEnd / mTotalTimeDisplay * (F32)mBarRect.getWidth()) + mBarRect.mLeft; + children_rect.mLeft = ll_round(timer_bar.mChildrenStart / mTotalTimeDisplay * (F32)mBarRect.getWidth()) + mBarRect.mLeft; + children_rect.mRight = ll_round(timer_bar.mChildrenEnd / mTotalTimeDisplay * (F32)mBarRect.getWidth()) + mBarRect.mLeft; if (bar_rect.getHeight() > MIN_BAR_HEIGHT) { diff --git a/indra/newview/llfeaturemanager.cpp b/indra/newview/llfeaturemanager.cpp index 4db0422634..af84aea6a6 100755 --- a/indra/newview/llfeaturemanager.cpp +++ b/indra/newview/llfeaturemanager.cpp @@ -76,9 +76,8 @@ const char FEATURE_TABLE_FILENAME[] = "featuretable%s.txt"; const char FEATURE_TABLE_VER_FILENAME[] = "featuretable%s.%s.txt"; #endif -const char GPU_TABLE_FILENAME[] = "gpu_table.txt"; -const char GPU_TABLE_VER_FILENAME[] = "gpu_table.%s.txt"; - +#if 0 // consuming code in #if 0 below +#endif LLFeatureInfo::LLFeatureInfo(const std::string& name, const BOOL available, const F32 level) : mValid(TRUE), mName(name), mAvailable(available), mRecommendedLevel(level) { @@ -428,6 +427,7 @@ bool LLFeatureManager::loadGPUClass() { //couldn't bench, use GLVersion #if LL_DARWIN //GLVersion is misleading on OSX, just default to class 3 if we can't bench + LL_WARNS() << "Unable to get an accurate benchmark; defaulting to class 3" << LL_ENDL; mGPUClass = GPU_CLASS_3; #else if (gGLManager.mGLVersion < 2.f) @@ -452,23 +452,31 @@ bool LLFeatureManager::loadGPUClass() } #endif } - else if (gbps < 5.f) + else if (gGLManager.mGLVersion <= 2.f) + { + mGPUClass = GPU_CLASS_0; + } + else if (gGLManager.mGLVersion <= 3.f) + { + mGPUClass = GPU_CLASS_1; + } + else if (gbps <= 5.f) { mGPUClass = GPU_CLASS_0; } - else if (gbps < 10.f) + else if (gbps <= 8.f) { mGPUClass = GPU_CLASS_1; } - else if (gbps < 20.f) + else if (gbps <= 16.f) { mGPUClass = GPU_CLASS_2; } - else if (gbps < 40.f) + else if (gbps <= 40.f) { mGPUClass = GPU_CLASS_3; } - else if (gbps < 80.f) + else if (gbps <= 80.f) { mGPUClass = GPU_CLASS_4; } @@ -476,195 +484,15 @@ bool LLFeatureManager::loadGPUClass() { mGPUClass = GPU_CLASS_5; } - + // defaults mGPUString = gGLManager.getRawGLString(); mGPUSupported = TRUE; -#if 0 - // first table is in the app dir - std::string app_path = gDirUtilp->getAppRODataDir(); - app_path += gDirUtilp->getDirDelimiter(); - app_path += GPU_TABLE_FILENAME; - - // second table is downloaded with HTTP - std::string http_filename = llformat(GPU_TABLE_VER_FILENAME, LLVersionInfo::getVersion().c_str()); - std::string http_path = gDirUtilp->getExpandedFilename(LL_PATH_USER_SETTINGS, http_filename); - - // use HTTP table if it exists - std::string path; - bool parse_ok = false; - if (gDirUtilp->fileExists(http_path)) - { - parse_ok = parseGPUTable(http_path); - if (!parse_ok) - { - // the HTTP table failed to parse, so delete it - LLFile::remove(http_path); - LL_WARNS("RenderInit") << "Removed invalid gpu table '" << http_path << "'" << LL_ENDL; - } - } - - if (!parse_ok) - { - parse_ok = parseGPUTable(app_path); - } -#endif - return true; // indicates that the file parsed correctly, not that the gpu was recognized + return true; // indicates that a gpu value was established } -bool LLFeatureManager::parseGPUTable(std::string filename) -{ - llifstream file; - - LL_INFOS("RenderInit") << "Attempting to parse GPU table from " << filename << LL_ENDL; - file.open(filename); - - if (file) - { - const char recognizer[] = "//GPU_TABLE"; - char first_line[MAX_STRING]; - file.getline(first_line, MAX_STRING); - if (0 != strncmp(first_line, recognizer, strlen(recognizer))) - { - LL_WARNS("RenderInit") << "Invalid GPU table: " << filename << "!" << LL_ENDL; - return false; - } - } - else - { - LL_WARNS("RenderInit") << "Unable to open GPU table: " << filename << "!" << LL_ENDL; - return false; - } - - std::string rawRenderer = gGLManager.getRawGLString(); - std::string renderer = rawRenderer; - for (std::string::iterator i = renderer.begin(); i != renderer.end(); ++i) - { - *i = tolower(*i); - } - -#if LL_EXPORT_GPU_TABLE - llofstream json; - json.open("gpu_table.json"); - - json << "var gpu_table = [" << std::endl; -#endif - - bool gpuFound; - U32 lineNumber; - for (gpuFound = false, lineNumber = 0; !gpuFound && !file.eof(); lineNumber++) - { - char buffer[MAX_STRING]; /*Flawfinder: ignore*/ - buffer[0] = 0; - - file.getline(buffer, MAX_STRING); - - if (strlen(buffer) >= 2 && /*Flawfinder: ignore*/ - buffer[0] == '/' && - buffer[1] == '/') - { - // This is a comment. - continue; - } - - if (strlen(buffer) == 0) /*Flawfinder: ignore*/ - { - // This is a blank line - continue; - } - - // setup the tokenizer - std::string buf(buffer); - std::string cls, label, expr, supported, stats_based, expected_gl_version; - boost_tokenizer tokens(buf, boost::char_separator<char>("\t\n")); - boost_tokenizer::iterator token_iter = tokens.begin(); - - // grab the label, pseudo regular expression, and class - if(token_iter != tokens.end()) - { - label = *token_iter++; - } - if(token_iter != tokens.end()) - { - expr = *token_iter++; - } - if(token_iter != tokens.end()) - { - cls = *token_iter++; - } - if(token_iter != tokens.end()) - { - supported = *token_iter++; - } - if (token_iter != tokens.end()) - { - stats_based = *token_iter++; - } - if (token_iter != tokens.end()) - { - expected_gl_version = *token_iter++; - } - - if (label.empty() || expr.empty() || cls.empty() || supported.empty()) - { - LL_WARNS("RenderInit") << "invald gpu_table.txt:" << lineNumber << ": '" << buffer << "'" << LL_ENDL; - continue; - } -#if LL_EXPORT_GPU_TABLE - json << "{'label' : '" << label << "',\n" << - "'regexp' : '" << expr << "',\n" << - "'class' : '" << cls << "',\n" << - "'supported' : '" << supported << "',\n" << - "'stats_based' : " << stats_based << ",\n" << - "'gl_version' : " << expected_gl_version << "\n},\n"; -#endif - - for (U32 i = 0; i < expr.length(); i++) /*Flawfinder: ignore*/ - { - expr[i] = tolower(expr[i]); - } - - // run the regular expression against the renderer - boost::regex re(expr.c_str()); - if(boost::regex_search(renderer, re)) - { - // if we found it, stop! -#if !LL_EXPORT_GPU_TABLE - gpuFound = true; -#endif - mGPUString = label; - mGPUClass = (EGPUClass) strtol(cls.c_str(), NULL, 10); - mGPUSupported = (BOOL) strtol(supported.c_str(), NULL, 10); - sscanf(expected_gl_version.c_str(), "%f", &mExpectedGLVersion); - } - } -#if LL_EXPORT_GPU_TABLE - json << "];\n\n"; - json.close(); -#endif - file.close(); - - if ( gpuFound ) - { - LL_INFOS("RenderInit") << "GPU '" << rawRenderer << "' recognized as '" << mGPUString << "'" << LL_ENDL; - if (!mGPUSupported) - { - LL_INFOS("RenderInit") << "GPU '" << mGPUString << "' is not supported." << LL_ENDL; - } - } - else - { - LL_WARNS("RenderInit") << "GPU '" << rawRenderer << "' not recognized" << LL_ENDL; - } - -#if LL_DARWIN // never go over "Mid" settings by default on OS X - mGPUClass = llmin(mGPUClass, GPU_CLASS_2); -#endif - return true; -} - // responder saves table into file class LLHTTPFeatureTableResponder : public LLHTTPClient::Responder { @@ -745,26 +573,11 @@ void fetch_feature_table(std::string table) LLHTTPClient::get(url, new LLHTTPFeatureTableResponder(path)); } -void fetch_gpu_table(std::string table) -{ - const std::string base = gSavedSettings.getString("FeatureManagerHTTPTable"); - - const std::string filename = llformat(table.c_str(), LLVersionInfo::getVersion().c_str()); - - const std::string url = base + "/" + filename; - - const std::string path = gDirUtilp->getExpandedFilename(LL_PATH_USER_SETTINGS, filename); - - LL_INFOS() << "LLFeatureManager fetching " << url << " into " << path << LL_ENDL; - - LLHTTPClient::get(url, new LLHTTPFeatureTableResponder(path)); -} // fetch table(s) from a website (S3) void LLFeatureManager::fetchHTTPTables() { fetch_feature_table(FEATURE_TABLE_VER_FILENAME); - fetch_gpu_table(GPU_TABLE_VER_FILENAME); } diff --git a/indra/newview/llfeaturemanager.h b/indra/newview/llfeaturemanager.h index 95141b241d..69078ccc21 100755 --- a/indra/newview/llfeaturemanager.h +++ b/indra/newview/llfeaturemanager.h @@ -162,9 +162,6 @@ protected: bool parseFeatureTable(std::string filename); ///< @returns TRUE is file parsed correctly, FALSE if not - bool parseGPUTable(std::string filename); - ///< @returns true if file parsed correctly, false if not - does not reflect whether or not the gpu was recognized - void initBaseMask(); diff --git a/indra/newview/llfilepicker.cpp b/indra/newview/llfilepicker.cpp index 5debf71744..ef50594feb 100755 --- a/indra/newview/llfilepicker.cpp +++ b/indra/newview/llfilepicker.cpp @@ -600,6 +600,9 @@ std::vector<std::string>* LLFilePicker::navOpenFilterProc(ELoadFilter filter) // allowedv->push_back("slg"); break; #endif + case FFLOAD_XML: + allowedv->push_back("xml"); + break; case FFLOAD_RAW: allowedv->push_back("raw"); break; @@ -702,7 +705,14 @@ bool LLFilePicker::doNavSaveDialog(ESaveFilter filter, const std::string& filena creator = "\?\?\?\?"; extension = "slg"; break; -#endif +#endif + + case FFSAVE_XML: + type = "\?\?\?\?"; + creator = "\?\?\?\?"; + extension = "xml"; + break; + case FFSAVE_RAW: type = "\?\?\?\?"; creator = "\?\?\?\?"; @@ -1100,6 +1110,12 @@ static std::string add_anim_filter_to_gtkchooser(GtkWindow *picker) return filtername; } +static std::string add_xml_filter_to_gtkchooser(GtkWindow *picker) +{ + return add_simple_pattern_filter_to_gtkchooser(picker, "*.xml", + LLTrans::getString("xml_files") + " (*.xml)"); +} + static std::string add_collada_filter_to_gtkchooser(GtkWindow *picker) { return add_simple_pattern_filter_to_gtkchooser(picker, "*.dae", @@ -1293,6 +1309,9 @@ BOOL LLFilePicker::getOpenFile( ELoadFilter filter, bool blocking ) case FFLOAD_ANIM: filtername = add_anim_filter_to_gtkchooser(picker); break; + case FFLOAD_XML: + filtername = add_xml_filter_to_gtkchooser(picker); + break; case FFLOAD_COLLADA: filtername = add_collada_filter_to_gtkchooser(picker); break; diff --git a/indra/newview/llfilepicker.h b/indra/newview/llfilepicker.h index 0e0cec3943..b6e67375cd 100755 --- a/indra/newview/llfilepicker.h +++ b/indra/newview/llfilepicker.h @@ -164,11 +164,9 @@ private: #if LL_DARWIN S32 mPickOptions; std::vector<std::string> mFileVector; - UInt32 mFileIndex; bool doNavChooseDialog(ELoadFilter filter); bool doNavSaveDialog(ESaveFilter filter, const std::string& filename); - //static Boolean navOpenFilterProc(AEDesc *theItem, void *info, void *callBackUD, NavFilterModes filterMode); std::vector<std::string>* navOpenFilterProc(ELoadFilter filter); #endif diff --git a/indra/newview/llflexibleobject.cpp b/indra/newview/llflexibleobject.cpp index b64034b945..b6e61f83b1 100755 --- a/indra/newview/llflexibleobject.cpp +++ b/indra/newview/llflexibleobject.cpp @@ -308,7 +308,7 @@ void LLVolumeImplFlexible::updateRenderRes() mRenderRes = (S32) (12.f*app_angle); #else //legacy behavior //number of segments only cares about z axis - F32 app_angle = llround((F32) atan2( mVO->getScale().mV[2]*2.f, drawablep->mDistanceWRTCamera) * RAD_TO_DEG, 0.01f); + F32 app_angle = ll_round((F32) atan2( mVO->getScale().mV[2]*2.f, drawablep->mDistanceWRTCamera) * RAD_TO_DEG, 0.01f); // Rendering sections increases with visible angle on the screen mRenderRes = (S32)(FLEXIBLE_OBJECT_MAX_SECTIONS*4*app_angle*DEG_TO_RAD/LLViewerCamera::getInstance()->getView()); diff --git a/indra/newview/llflickrconnect.cpp b/indra/newview/llflickrconnect.cpp index b715896264..b75660ea00 100644 --- a/indra/newview/llflickrconnect.cpp +++ b/indra/newview/llflickrconnect.cpp @@ -400,7 +400,7 @@ void LLFlickrConnect::uploadPhoto(LLPointer<LLImageFormatted> image, const std:: } else { - llwarns << "Image to upload is not a PNG or JPEG" << llendl; + LL_WARNS() << "Image to upload is not a PNG or JPEG" << LL_ENDL; return; } diff --git a/indra/newview/llfloaterabout.cpp b/indra/newview/llfloaterabout.cpp index 66149a4367..7ac3ac2f61 100755 --- a/indra/newview/llfloaterabout.cpp +++ b/indra/newview/llfloaterabout.cpp @@ -123,18 +123,17 @@ BOOL LLFloaterAbout::postBuild() LLViewerTextEditor *support_widget = getChild<LLViewerTextEditor>("support_editor", true); - LLViewerTextEditor *linden_names_widget = - getChild<LLViewerTextEditor>("linden_names", true); - LLViewerTextEditor *contrib_names_widget = getChild<LLViewerTextEditor>("contrib_names", true); - LLViewerTextEditor *trans_names_widget = - getChild<LLViewerTextEditor>("trans_names", true); + LLViewerTextEditor *licenses_widget = + getChild<LLViewerTextEditor>("licenses_editor", true); getChild<LLUICtrl>("copy_btn")->setCommitCallback( boost::bind(&LLFloaterAbout::onClickCopyToClipboard, this)); + static const LLUIColor about_color = LLUIColorTable::instance().getColor("TextFgReadOnlyColor"); + if (gAgent.getRegion()) { // start fetching server release notes URL @@ -153,24 +152,6 @@ BOOL LLFloaterAbout::postBuild() support_widget->setEnabled(FALSE); support_widget->startOfDoc(); - // Get the names of Lindens, added by viewer_manifest.py at build time - std::string lindens_path = gDirUtilp->getExpandedFilename(LL_PATH_APP_SETTINGS,"lindens.txt"); - llifstream linden_file; - std::string lindens; - linden_file.open(lindens_path); /* Flawfinder: ignore */ - if (linden_file.is_open()) - { - std::getline(linden_file, lindens); // all names are on a single line - linden_file.close(); - linden_names_widget->setText(lindens); - } - else - { - LL_INFOS("AboutInit") << "Could not read lindens file at " << lindens_path << LL_ENDL; - } - linden_names_widget->setEnabled(FALSE); - linden_names_widget->startOfDoc(); - // Get the names of contributors, extracted from .../doc/contributions.txt by viewer_manifest.py at build time std::string contributors_path = gDirUtilp->getExpandedFilename(LL_PATH_APP_SETTINGS,"contributors.txt"); llifstream contrib_file; @@ -189,23 +170,28 @@ BOOL LLFloaterAbout::postBuild() contrib_names_widget->setEnabled(FALSE); contrib_names_widget->startOfDoc(); - // Get the names of translators, extracted from .../doc/tranlations.txt by viewer_manifest.py at build time - std::string translators_path = gDirUtilp->getExpandedFilename(LL_PATH_APP_SETTINGS,"translators.txt"); - llifstream trans_file; - std::string translators; - trans_file.open(translators_path); /* Flawfinder: ignore */ - if (trans_file.is_open()) + // Get the Versions and Copyrights, created at build time + std::string licenses_path = gDirUtilp->getExpandedFilename(LL_PATH_APP_SETTINGS,"packages-info.txt"); + llifstream licenses_file; + licenses_file.open(licenses_path); /* Flawfinder: ignore */ + if (licenses_file.is_open()) { - std::getline(trans_file, translators); // all names are on a single line - trans_file.close(); + std::string license_line; + licenses_widget->clear(); + while ( std::getline(licenses_file, license_line) ) + { + licenses_widget->appendText(license_line+"\n", FALSE, + LLStyle::Params() .color(about_color)); + } + licenses_file.close(); } else { - LL_WARNS("AboutInit") << "Could not read translators file at " << translators_path << LL_ENDL; + // this case will use the (out of date) hard coded value from the XUI + LL_INFOS("AboutInit") << "Could not read licenses file at " << licenses_path << LL_ENDL; } - trans_names_widget->setText(translators); - trans_names_widget->setEnabled(FALSE); - trans_names_widget->startOfDoc(); + licenses_widget->setEnabled(FALSE); + licenses_widget->startOfDoc(); return TRUE; } diff --git a/indra/newview/llfloaterbuyland.cpp b/indra/newview/llfloaterbuyland.cpp index 060c091737..0a0e5ffc06 100755 --- a/indra/newview/llfloaterbuyland.cpp +++ b/indra/newview/llfloaterbuyland.cpp @@ -65,9 +65,6 @@ // NOTE: This is duplicated in lldatamoney.cpp ... const F32 GROUP_LAND_BONUS_FACTOR = 1.1f; -const F64 CURRENCY_ESTIMATE_FREQUENCY = 0.5; - // how long of a pause in typing a currency buy amount before an - // estimate is fetched from the server class LLFloaterBuyLandUI : public LLFloater @@ -392,9 +389,9 @@ void LLFloaterBuyLandUI::updateParcelInfo() } mParcelBillableArea = - llround(mRegion->getBillableFactor() * mParcelActualArea); + ll_round(mRegion->getBillableFactor() * mParcelActualArea); - mParcelSupportedObjects = llround( + mParcelSupportedObjects = ll_round( parcel->getMaxPrimCapacity() * parcel->getParcelPrimBonus()); // Can't have more than region max tasks, regardless of parcel // object bonus factor. diff --git a/indra/newview/llfloatercamera.cpp b/indra/newview/llfloatercamera.cpp index d0939b3eee..6a82b8c74c 100755 --- a/indra/newview/llfloatercamera.cpp +++ b/indra/newview/llfloatercamera.cpp @@ -47,9 +47,7 @@ static LLDefaultChildRegistry::Register<LLPanelCameraItem> r("panel_camera_item" const F32 NUDGE_TIME = 0.25f; // in seconds const F32 ORBIT_NUDGE_RATE = 0.05f; // fraction of normal speed -// Constants -const F32 CAMERA_BUTTON_DELAY = 0.0f; - +// constants #define ORBIT "cam_rotate_stick" #define PAN "cam_track_stick" #define ZOOM "zoom" diff --git a/indra/newview/llfloaterfacebook.cpp b/indra/newview/llfloaterfacebook.cpp index 6888e076aa..3a2047cfef 100644 --- a/indra/newview/llfloaterfacebook.cpp +++ b/indra/newview/llfloaterfacebook.cpp @@ -59,7 +59,6 @@ static LLPanelInjector<LLFacebookPhotoPanel> t_panel_photo("llfacebookphotopanel static LLPanelInjector<LLFacebookCheckinPanel> t_panel_checkin("llfacebookcheckinpanel"); static LLPanelInjector<LLFacebookFriendsPanel> t_panel_friends("llfacebookfriendspanel"); -const S32 MAX_POSTCARD_DATASIZE = 1024 * 1024; // one megabyte const std::string DEFAULT_CHECKIN_LOCATION_URL = "http://maps.secondlife.com/"; const std::string DEFAULT_CHECKIN_ICON_URL = "http://map.secondlife.com.s3.amazonaws.com/map_placeholder.png"; const std::string DEFAULT_CHECKIN_QUERY_PARAMETERS = "?sourceid=slshare_checkin&utm_source=facebook&utm_medium=checkin&utm_campaign=slshare"; diff --git a/indra/newview/llfloaterflickr.cpp b/indra/newview/llfloaterflickr.cpp index 36afab86b7..51352e083a 100644 --- a/indra/newview/llfloaterflickr.cpp +++ b/indra/newview/llfloaterflickr.cpp @@ -55,7 +55,6 @@ static LLPanelInjector<LLFlickrPhotoPanel> t_panel_photo("llflickrphotopanel"); static LLPanelInjector<LLFlickrAccountPanel> t_panel_account("llflickraccountpanel"); -const S32 MAX_POSTCARD_DATASIZE = 1024 * 1024; // one megabyte const std::string DEFAULT_PHOTO_QUERY_PARAMETERS = "?sourceid=slshare_photo&utm_source=flickr&utm_medium=photo&utm_campaign=slshare"; const std::string DEFAULT_TAG_TEXT = "secondlife "; const std::string FLICKR_MACHINE_TAGS_NAMESPACE = "secondlife"; diff --git a/indra/newview/llfloatergodtools.cpp b/indra/newview/llfloatergodtools.cpp index 6966ca5639..37774fbc5c 100755 --- a/indra/newview/llfloatergodtools.cpp +++ b/indra/newview/llfloatergodtools.cpp @@ -401,14 +401,9 @@ void LLFloaterGodTools::sendGodUpdateRegionInfo() // Floats because spinners only support floats. JC const F32 BILLABLE_FACTOR_DEFAULT = 1; -const F32 BILLABLE_FACTOR_MIN = 0.0f; -const F32 BILLABLE_FACTOR_MAX = 4.f; // floats because spinners only understand floats. JC const F32 PRICE_PER_METER_DEFAULT = 1.f; -const F32 PRICE_PER_METER_MIN = 0.f; -const F32 PRICE_PER_METER_MAX = 100.f; - LLPanelRegionTools::LLPanelRegionTools() : LLPanel() @@ -833,9 +828,6 @@ void LLPanelRegionTools::onSelectRegion() // ^ ^ ^ // LEFT R2 RIGHT -const F32 HOURS_TO_RADIANS = (2.f*F_PI)/24.f; - - LLPanelGridTools::LLPanelGridTools() : LLPanel() { diff --git a/indra/newview/llfloatergroupbulkban.cpp b/indra/newview/llfloatergroupbulkban.cpp index 54a2283b13..44074047a7 100644 --- a/indra/newview/llfloatergroupbulkban.cpp +++ b/indra/newview/llfloatergroupbulkban.cpp @@ -101,7 +101,7 @@ void LLFloaterGroupBulkBan::showForGroup(const LLUUID& group_id, uuid_vec_t* age // Make sure group_id isn't null if (group_id.isNull()) { - llwarns << "LLFloaterGroupInvite::showForGroup with null group_id!" << llendl; + LL_WARNS() << "LLFloaterGroupInvite::showForGroup with null group_id!" << LL_ENDL; return; } diff --git a/indra/newview/llfloaterimsession.cpp b/indra/newview/llfloaterimsession.cpp index 9def253ba5..fc7fcf3ab9 100755 --- a/indra/newview/llfloaterimsession.cpp +++ b/indra/newview/llfloaterimsession.cpp @@ -396,7 +396,7 @@ bool LLFloaterIMSession::canAddSelectedToChat(const uuid_vec_t& uuids) { if (!mSession || mDialog == IM_SESSION_GROUP_START - || mDialog == IM_SESSION_INVITE && gAgent.isInGroup(mSessionID)) + || (mDialog == IM_SESSION_INVITE && gAgent.isInGroup(mSessionID))) { return false; } @@ -779,7 +779,7 @@ bool LLFloaterIMSession::toggle(const LLUUID& session_id) floater->setVisible(false); return false; } - else if(floater && (!floater->isDocked() || floater->getVisible() && !floater->hasFocus())) + else if(floater && ((!floater->isDocked() || floater->getVisible()) && !floater->hasFocus())) { floater->setVisible(TRUE); floater->setFocus(TRUE); diff --git a/indra/newview/llfloaterimsessiontab.cpp b/indra/newview/llfloaterimsessiontab.cpp index fbdaca0e6f..2864f018b2 100755 --- a/indra/newview/llfloaterimsessiontab.cpp +++ b/indra/newview/llfloaterimsessiontab.cpp @@ -47,7 +47,7 @@ const F32 REFRESH_INTERVAL = 1.0f; LLFloaterIMSessionTab::LLFloaterIMSessionTab(const LLSD& session_id) -: LLTransientDockableFloater(NULL, true, session_id), +: LLTransientDockableFloater(NULL, false, session_id), mIsP2PChat(false), mExpandCollapseBtn(NULL), mTearOffBtn(NULL), diff --git a/indra/newview/llfloaterland.cpp b/indra/newview/llfloaterland.cpp index 7621c35ed2..8c4feff1d9 100755 --- a/indra/newview/llfloaterland.cpp +++ b/indra/newview/llfloaterland.cpp @@ -1224,7 +1224,7 @@ void LLPanelLandObjects::refresh() { S32 sw_max = parcel->getSimWideMaxPrimCapacity(); S32 sw_total = parcel->getSimWidePrimCount(); - S32 max = llround(parcel->getMaxPrimCapacity() * parcel->getParcelPrimBonus()); + S32 max = ll_round(parcel->getMaxPrimCapacity() * parcel->getParcelPrimBonus()); S32 total = parcel->getPrimCount(); S32 owned = parcel->getOwnerPrimCount(); S32 group = parcel->getGroupPrimCount(); @@ -2049,9 +2049,9 @@ void LLPanelLandOptions::refresh() else { mLocationText->setTextArg("[LANDING]",llformat("%d, %d, %d (%d\xC2\xB0)", - llround(pos.mV[VX]), - llround(pos.mV[VY]), - llround(pos.mV[VZ]), + ll_round(pos.mV[VX]), + ll_round(pos.mV[VY]), + ll_round(pos.mV[VZ]), user_look_at_angle)); } diff --git a/indra/newview/llfloaterlandholdings.cpp b/indra/newview/llfloaterlandholdings.cpp index cf03087afb..f34760a6bf 100755 --- a/indra/newview/llfloaterlandholdings.cpp +++ b/indra/newview/llfloaterlandholdings.cpp @@ -208,8 +208,8 @@ void LLFloaterLandHoldings::processPlacesReply(LLMessageSystem* msg, void**) self->mActualArea += actual_area; self->mBillableArea += billable_area; - S32 region_x = llround(global_x) % REGION_WIDTH_UNITS; - S32 region_y = llround(global_y) % REGION_WIDTH_UNITS; + S32 region_x = ll_round(global_x) % REGION_WIDTH_UNITS; + S32 region_y = ll_round(global_y) % REGION_WIDTH_UNITS; std::string location; location = llformat("%s (%d, %d)", sim_name.c_str(), region_x, region_y); diff --git a/indra/newview/llfloatermap.cpp b/indra/newview/llfloatermap.cpp index 473e2938be..333ff863e5 100755 --- a/indra/newview/llfloatermap.cpp +++ b/indra/newview/llfloatermap.cpp @@ -52,10 +52,7 @@ // The minor cardinal direction labels are hidden if their height is more // than this proportion of the map. const F32 MAP_MINOR_DIR_THRESHOLD = 0.07f; -const S32 MAP_PADDING_LEFT = 0; -const S32 MAP_PADDING_TOP = 2; -const S32 MAP_PADDING_RIGHT = 2; -const S32 MAP_PADDING_BOTTOM = 0; + // // Member functions // @@ -156,8 +153,8 @@ void LLFloaterMap::setDirectionPos( LLTextBox* text_box, F32 rotation ) radius -= 8.f; text_box->setOrigin( - llround(map_half_width - text_half_width + radius * cos( rotation )), - llround(map_half_height - text_half_height + radius * sin( rotation )) ); + ll_round(map_half_width - text_half_width + radius * cos( rotation )), + ll_round(map_half_height - text_half_height + radius * sin( rotation )) ); } void LLFloaterMap::updateMinorDirections() diff --git a/indra/newview/llfloatermediasettings.cpp b/indra/newview/llfloatermediasettings.cpp index 4f2a6ec1b7..4fd5c0587a 100755 --- a/indra/newview/llfloatermediasettings.cpp +++ b/indra/newview/llfloatermediasettings.cpp @@ -47,7 +47,6 @@ LLFloaterMediaSettings::LLFloaterMediaSettings(const LLSD& key) mPanelMediaSettingsGeneral(NULL), mPanelMediaSettingsSecurity(NULL), mPanelMediaSettingsPermissions(NULL), - mWaitingToClose( false ), mIdenticalHasMediaInfo( true ), mMultipleMedia(false), mMultipleValidMedia(false) diff --git a/indra/newview/llfloatermediasettings.h b/indra/newview/llfloatermediasettings.h index 1d25530986..f93512eb3a 100755 --- a/indra/newview/llfloatermediasettings.h +++ b/indra/newview/llfloatermediasettings.h @@ -83,7 +83,6 @@ private: bool haveValuesChanged() const; LLSD mInitialValues; - bool mWaitingToClose; }; #endif // LL_LLFLOATERMEDIASETTINGS_H diff --git a/indra/newview/llfloatermodelpreview.cpp b/indra/newview/llfloatermodelpreview.cpp index b17ce97a2e..ec905558aa 100755 --- a/indra/newview/llfloatermodelpreview.cpp +++ b/indra/newview/llfloatermodelpreview.cpp @@ -121,12 +121,6 @@ S32 LLFloaterModelPreview::sUploadAmount = 10; LLFloaterModelPreview* LLFloaterModelPreview::sInstance = NULL; std::list<LLModelLoader*> LLModelLoader::sActiveLoaderList; -const S32 PREVIEW_BORDER_WIDTH = 2; -const S32 PREVIEW_RESIZE_HANDLE_SIZE = S32(RESIZE_HANDLE_WIDTH * OO_SQRT2) + PREVIEW_BORDER_WIDTH; -const S32 PREVIEW_HPAD = PREVIEW_RESIZE_HANDLE_SIZE; -const S32 PREF_BUTTON_HEIGHT = 16 + 7 + 16; -const S32 PREVIEW_TEXTURE_HEIGHT = 300; - // "Retain%" decomp parameter has values from 0.0 to 1.0 by 0.01 // But according to the UI spec for upload model floater, this parameter // should be represented by Retain spinner with values from 1 to 100 by 1. @@ -1935,7 +1929,9 @@ bool LLModelLoader::doLoadModel() LLJoint* pJoint = mPreview->getPreviewAvatar()->getJoint( lookingForJoint ); if ( pJoint ) { - pJoint->storeCurrentXform( jointTransform.getTranslation() ); + LLUUID fake_mesh_id; + fake_mesh_id.generate(); + pJoint->addAttachmentPosOverride( jointTransform.getTranslation(), fake_mesh_id, gAgentAvatarp->avString()); } else { @@ -3242,7 +3238,11 @@ U32 LLModelPreview::calcResourceCost() if ( mFMP && mFMP->childGetValue("upload_joints").asBoolean() ) { - getPreviewAvatar()->setPelvisOffset( mPelvisZOffset ); + // FIXME if preview avatar ever gets reused, this fake mesh ID stuff will fail. + // see also call to addAttachmentPosOverride. + LLUUID fake_mesh_id; + fake_mesh_id.generate(); + getPreviewAvatar()->addPelvisFixup( mPelvisZOffset, fake_mesh_id ); } F32 streaming_cost = 0.f; diff --git a/indra/newview/llfloaternamedesc.cpp b/indra/newview/llfloaternamedesc.cpp index ee7f413a59..0cca715fe2 100755 --- a/indra/newview/llfloaternamedesc.cpp +++ b/indra/newview/llfloaternamedesc.cpp @@ -52,14 +52,9 @@ #include "llinventorytype.h" const S32 PREVIEW_LINE_HEIGHT = 19; -const S32 PREVIEW_CLOSE_BOX_SIZE = 16; const S32 PREVIEW_BORDER_WIDTH = 2; const S32 PREVIEW_RESIZE_HANDLE_SIZE = S32(RESIZE_HANDLE_WIDTH * OO_SQRT2) + PREVIEW_BORDER_WIDTH; -const S32 PREVIEW_VPAD = 2; const S32 PREVIEW_HPAD = PREVIEW_RESIZE_HANDLE_SIZE; -const S32 PREVIEW_HEADER_SIZE = 3 * PREVIEW_LINE_HEIGHT + PREVIEW_VPAD; -const S32 PREF_BUTTON_WIDTH = 64; -const S32 PREF_BUTTON_HEIGHT = 16; //----------------------------------------------------------------------------- // LLFloaterNameDesc() diff --git a/indra/newview/llfloateropenobject.cpp b/indra/newview/llfloateropenobject.cpp index 9986bdbd7f..ef746d308d 100755 --- a/indra/newview/llfloateropenobject.cpp +++ b/indra/newview/llfloateropenobject.cpp @@ -58,6 +58,8 @@ LLFloaterOpenObject::LLFloaterOpenObject(const LLSD& key) { mCommitCallbackRegistrar.add("OpenObject.MoveToInventory", boost::bind(&LLFloaterOpenObject::onClickMoveToInventory, this)); mCommitCallbackRegistrar.add("OpenObject.MoveAndWear", boost::bind(&LLFloaterOpenObject::onClickMoveAndWear, this)); + mCommitCallbackRegistrar.add("OpenObject.ReplaceOutfit", boost::bind(&LLFloaterOpenObject::onClickReplace, this)); + mCommitCallbackRegistrar.add("OpenObject.Cancel", boost::bind(&LLFloaterOpenObject::onClickCancel, this)); } LLFloaterOpenObject::~LLFloaterOpenObject() @@ -115,6 +117,7 @@ void LLFloaterOpenObject::refresh() getChild<LLUICtrl>("object_name")->setTextArg("[DESC]", name); getChildView("copy_to_inventory_button")->setEnabled(enabled); getChildView("copy_and_wear_button")->setEnabled(enabled); + getChildView("copy_and_replace_button")->setEnabled(enabled); } @@ -135,7 +138,7 @@ void LLFloaterOpenObject::dirty() -void LLFloaterOpenObject::moveToInventory(bool wear) +void LLFloaterOpenObject::moveToInventory(bool wear, bool replace) { if (mObjectSelection->getRootObjectCount() != 1) { @@ -163,7 +166,7 @@ void LLFloaterOpenObject::moveToInventory(bool wear) parent_category_id = gInventory.getRootFolderID(); } - inventory_func_type func = boost::bind(LLFloaterOpenObject::callbackCreateInventoryCategory,_1,object_id,wear); + inventory_func_type func = boost::bind(LLFloaterOpenObject::callbackCreateInventoryCategory,_1,object_id,wear,replace); LLUUID category_id = gInventory.createNewCategory(parent_category_id, LLFolderType::FT_NONE, name, @@ -177,6 +180,7 @@ void LLFloaterOpenObject::moveToInventory(bool wear) data->mCatID = category_id; data->mWear = wear; data->mFolderResponded = false; + data->mReplace = replace; // Copy and/or move the items into the newly created folder. // Ignore any "you're going to break this item" messages. @@ -194,13 +198,14 @@ void LLFloaterOpenObject::moveToInventory(bool wear) } // static -void LLFloaterOpenObject::callbackCreateInventoryCategory(const LLUUID& category_id, LLUUID object_id, bool wear) +void LLFloaterOpenObject::callbackCreateInventoryCategory(const LLUUID& category_id, LLUUID object_id, bool wear, bool replace) { LLCatAndWear* wear_data = new LLCatAndWear; wear_data->mCatID = category_id; wear_data->mWear = wear; wear_data->mFolderResponded = true; + wear_data->mReplace = replace; // Copy and/or move the items into the newly created folder. // Ignore any "you're going to break this item" messages. @@ -241,7 +246,17 @@ void LLFloaterOpenObject::onClickMoveToInventory() void LLFloaterOpenObject::onClickMoveAndWear() { - moveToInventory(true); + moveToInventory(true, false); closeFloater(); } +void LLFloaterOpenObject::onClickReplace() +{ + moveToInventory(true, true); + closeFloater(); +} + +void LLFloaterOpenObject::onClickCancel() +{ + closeFloater(); +} diff --git a/indra/newview/llfloateropenobject.h b/indra/newview/llfloateropenobject.h index 8e472804a4..2e761f99bf 100755 --- a/indra/newview/llfloateropenobject.h +++ b/indra/newview/llfloateropenobject.h @@ -50,6 +50,7 @@ public: LLUUID mCatID; bool mWear; bool mFolderResponded; + bool mReplace; }; protected: @@ -59,11 +60,13 @@ protected: void draw(); virtual void onOpen(const LLSD& key); - void moveToInventory(bool wear); + void moveToInventory(bool wear, bool replace = false); void onClickMoveToInventory(); void onClickMoveAndWear(); - static void callbackCreateInventoryCategory(const LLUUID& category_id, LLUUID object_id, bool wear); + void onClickReplace(); + void onClickCancel(); + static void callbackCreateInventoryCategory(const LLUUID& category_id, LLUUID object_id, bool wear, bool replace = false); static void callbackMoveInventory(S32 result, void* data); private: diff --git a/indra/newview/llfloaterpathfindingcharacters.cpp b/indra/newview/llfloaterpathfindingcharacters.cpp index 69c9d94dfa..87f927ff65 100755 --- a/indra/newview/llfloaterpathfindingcharacters.cpp +++ b/indra/newview/llfloaterpathfindingcharacters.cpp @@ -224,7 +224,7 @@ LLSD LLFloaterPathfindingCharacters::buildCharacterScrollListItemData(const LLPa columns[2]["column"] = "owner"; columns[2]["value"] = getOwnerName(pCharacterPtr); - S32 cpuTime = llround(pCharacterPtr->getCPUTime()); + S32 cpuTime = ll_round(pCharacterPtr->getCPUTime()); std::string cpuTimeString = llformat("%d", cpuTime); LLStringUtil::format_map_t string_args; string_args["[CPU_TIME]"] = cpuTimeString; diff --git a/indra/newview/llfloaterpathfindingobjects.cpp b/indra/newview/llfloaterpathfindingobjects.cpp index d72ee073e1..f6ff83eaf4 100755 --- a/indra/newview/llfloaterpathfindingobjects.cpp +++ b/indra/newview/llfloaterpathfindingobjects.cpp @@ -406,7 +406,7 @@ void LLFloaterPathfindingObjects::addObjectToScrollList(const LLPathfindingObjec if (pObjectPtr->hasOwner() && !pObjectPtr->hasOwnerName()) { - mMissingNameObjectsScrollListItems.insert(std::make_pair<std::string, LLScrollListItem *>(pObjectPtr->getUUID().asString(), scrollListItem)); + mMissingNameObjectsScrollListItems.insert(scroll_list_item_map::value_type(pObjectPtr->getUUID().asString(), scrollListItem)); pObjectPtr->registerOwnerNameListener(boost::bind(&LLFloaterPathfindingObjects::handleObjectNameResponse, this, _1)); } } diff --git a/indra/newview/llfloaterpay.cpp b/indra/newview/llfloaterpay.cpp index f0c010b545..172f81d078 100755 --- a/indra/newview/llfloaterpay.cpp +++ b/indra/newview/llfloaterpay.cpp @@ -40,8 +40,10 @@ #include "lltextbox.h" #include "lllineeditor.h" #include "llmutelist.h" +#include "llnotificationsutil.h" #include "llfloaterreporter.h" #include "llslurl.h" +#include "llstatusbar.h" #include "llviewerobject.h" #include "llviewerobjectlist.h" #include "llviewerregion.h" @@ -90,6 +92,9 @@ public: static void payDirectly(money_callback callback, const LLUUID& target_id, bool is_group); + static bool payConfirmationCallback(const LLSD& notification, + const LLSD& response, + LLGiveMoneyInfo* info); private: static void onCancel(void* data); @@ -111,14 +116,11 @@ protected: LLGiveMoneyInfo* mQuickPayInfo[MAX_PAY_BUTTONS]; LLSafeHandle<LLObjectSelection> mObjectSelection; - - static S32 sLastAmount; }; -S32 LLFloaterPay::sLastAmount = 0; -const S32 MAX_AMOUNT_LENGTH = 10; const S32 FASTPAY_BUTTON_WIDTH = 80; +const S32 PAY_AMOUNT_NOTIFICATION = 200; LLFloaterPay::LLFloaterPay(const LLSD& key) : LLFloater(key), @@ -188,17 +190,9 @@ BOOL LLFloaterPay::postBuild() getChildView("amount text")->setVisible(FALSE); - - std::string last_amount; - if(sLastAmount > 0) - { - last_amount = llformat("%d", sLastAmount); - } - getChildView("amount")->setVisible(FALSE); getChild<LLLineEditor>("amount")->setKeystrokeCallback(&LLFloaterPay::onKeystroke, this); - getChild<LLUICtrl>("amount")->setValue(last_amount); getChild<LLLineEditor>("amount")->setPrevalidate(LLTextValidate::validateNonNegativeS32); info = new LLGiveMoneyInfo(this, 0); @@ -207,7 +201,7 @@ BOOL LLFloaterPay::postBuild() childSetAction("pay btn",&LLFloaterPay::onGive,info); setDefaultBtn("pay btn"); getChildView("pay btn")->setVisible(FALSE); - getChildView("pay btn")->setEnabled((sLastAmount > 0)); + getChildView("pay btn")->setEnabled(FALSE); childSetAction("cancel btn",&LLFloaterPay::onCancel,this); @@ -419,7 +413,24 @@ void LLFloaterPay::payDirectly(money_callback callback, floater->finishPayUI(target_id, is_group); } - + +bool LLFloaterPay::payConfirmationCallback(const LLSD& notification, const LLSD& response, LLGiveMoneyInfo* info) +{ + if (!info || !info->mFloater) + { + return false; + } + + S32 option = LLNotificationsUtil::getSelectedOption(notification, response); + if (option == 0) + { + info->mFloater->give(info->mAmount); + info->mFloater->closeFloater(); + } + + return false; +} + void LLFloaterPay::finishPayUI(const LLUUID& target_id, BOOL is_group) { std::string slurl; @@ -470,10 +481,40 @@ void LLFloaterPay::onKeystroke(LLLineEditor*, void* data) void LLFloaterPay::onGive(void* data) { LLGiveMoneyInfo* info = reinterpret_cast<LLGiveMoneyInfo*>(data); - if(info && info->mFloater) + LLFloaterPay* floater = info->mFloater; + if(info && floater) { - info->mFloater->give(info->mAmount); - info->mFloater->closeFloater(); + S32 amount = info->mAmount; + if(amount == 0) + { + amount = atoi(floater->getChild<LLUICtrl>("amount")->getValue().asString().c_str()); + } + if (amount > PAY_AMOUNT_NOTIFICATION && gStatusBar && gStatusBar->getBalance() > amount) + { + LLUUID payee_id; + BOOL is_group; + if (floater->mObjectSelection.notNull()) + { + LLSelectNode* node = floater->mObjectSelection->getFirstRootNode(); + node->mPermissions->getOwnership(payee_id, is_group); + } + else + { + is_group = floater->mTargetIsGroup; + payee_id = floater->mTargetUUID; + } + + LLSD args; + args["TARGET"] = LLSLURL( is_group ? "group" : "agent", payee_id, "completename").getSLURLString(); + args["AMOUNT"] = amount; + + LLNotificationsUtil::add("PayConfirmation", args, LLSD(), boost::bind(&LLFloaterPay::payConfirmationCallback, _1, _2, info)); + } + else + { + floater->give(amount); + floater->closeFloater(); + } } } @@ -487,7 +528,6 @@ void LLFloaterPay::give(S32 amount) { amount = atoi(getChild<LLUICtrl>("amount")->getValue().asString().c_str()); } - sLastAmount = amount; // Try to pay an object. if (mObjectSelection.notNull()) diff --git a/indra/newview/llfloaterpreference.cpp b/indra/newview/llfloaterpreference.cpp index cbd9867107..0ac18408db 100755 --- a/indra/newview/llfloaterpreference.cpp +++ b/indra/newview/llfloaterpreference.cpp @@ -113,13 +113,9 @@ #include "llfeaturemanager.h" #include "llviewertexturelist.h" -const F32 MAX_USER_FAR_CLIP = 512.f; -const F32 MIN_USER_FAR_CLIP = 64.f; const F32 BANDWIDTH_UPDATER_TIMEOUT = 0.5f; char const* const VISIBILITY_DEFAULT = "default"; char const* const VISIBILITY_HIDDEN = "hidden"; -char const* const VISIBILITY_VISIBLE = "visible"; -char const* const VISIBILITY_INVISIBLE = "invisible"; //control value for middle mouse as talk2push button const static std::string MIDDLE_MOUSE_CV = "MiddleMouse"; @@ -295,8 +291,8 @@ void fractionFromDecimal(F32 decimal_val, S32& numerator, S32& denominator) { if (fmodf((decimal_val * test_denominator) + 0.01f, 1.f) < 0.02f) { - numerator = llround(decimal_val * test_denominator); - denominator = llround(test_denominator); + numerator = ll_round(decimal_val * test_denominator); + denominator = ll_round(test_denominator); break; } } diff --git a/indra/newview/llfloaterreporter.cpp b/indra/newview/llfloaterreporter.cpp index a3b9713e3e..ae330211db 100755 --- a/indra/newview/llfloaterreporter.cpp +++ b/indra/newview/llfloaterreporter.cpp @@ -82,8 +82,6 @@ #include "lltrans.h" -const U32 INCLUDE_SCREENSHOT = 0x01 << 0; - //----------------------------------------------------------------------------- // Globals //----------------------------------------------------------------------------- diff --git a/indra/newview/llfloaterscriptlimits.h b/indra/newview/llfloaterscriptlimits.h index a5cb1b6184..5ba0185d32 100755 --- a/indra/newview/llfloaterscriptlimits.h +++ b/indra/newview/llfloaterscriptlimits.h @@ -170,21 +170,17 @@ private: LLSD mContent; LLUUID mParcelId; bool mGotParcelMemoryUsed; - bool mGotParcelMemoryUsedDetails; bool mGotParcelMemoryMax; S32 mParcelMemoryMax; S32 mParcelMemoryUsed; - S32 mParcelMemoryUsedDetails; - + bool mGotParcelURLsUsed; - bool mGotParcelURLsUsedDetails; bool mGotParcelURLsMax; S32 mParcelURLsMax; S32 mParcelURLsUsed; - S32 mParcelURLsUsedDetails; - + std::vector<LLSD> mObjectListItems; - + protected: // LLRemoteParcelInfoObserver interface: @@ -208,17 +204,11 @@ public: LLPanelScriptLimitsAttachment() : LLPanelScriptLimitsInfo(), mGotAttachmentMemoryUsed(false), - mGotAttachmentMemoryUsedDetails(false), - mGotAttachmentMemoryMax(false), mAttachmentMemoryMax(0), mAttachmentMemoryUsed(0), - mAttachmentMemoryUsedDetails(0), mGotAttachmentURLsUsed(false), - mGotAttachmentURLsUsedDetails(false), - mGotAttachmentURLsMax(false), mAttachmentURLsMax(0), - mAttachmentURLsUsed(0), - mAttachmentURLsUsedDetails(0) + mAttachmentURLsUsed(0) {}; ~LLPanelScriptLimitsAttachment() @@ -237,18 +227,12 @@ public: private: bool mGotAttachmentMemoryUsed; - bool mGotAttachmentMemoryUsedDetails; - bool mGotAttachmentMemoryMax; S32 mAttachmentMemoryMax; S32 mAttachmentMemoryUsed; - S32 mAttachmentMemoryUsedDetails; - + bool mGotAttachmentURLsUsed; - bool mGotAttachmentURLsUsedDetails; - bool mGotAttachmentURLsMax; S32 mAttachmentURLsMax; S32 mAttachmentURLsUsed; - S32 mAttachmentURLsUsedDetails; protected: diff --git a/indra/newview/llfloatersnapshot.cpp b/indra/newview/llfloatersnapshot.cpp index 8677028942..971da74158 100755 --- a/indra/newview/llfloatersnapshot.cpp +++ b/indra/newview/llfloatersnapshot.cpp @@ -911,11 +911,11 @@ BOOL LLFloaterSnapshot::Impl::checkImageSize(LLSnapshotLivePreview* previewp, S3 //change another value proportionally if(isWidthChanged) { - height = llround(width / aspect_ratio) ; + height = ll_round(width / aspect_ratio) ; } else { - width = llround(height * aspect_ratio) ; + width = ll_round(height * aspect_ratio) ; } //bound w/h by the max_value diff --git a/indra/newview/llfloatertos.cpp b/indra/newview/llfloatertos.cpp index 0613ffc94d..c1c21c593e 100755 --- a/indra/newview/llfloatertos.cpp +++ b/indra/newview/llfloatertos.cpp @@ -50,7 +50,6 @@ LLFloaterTOS::LLFloaterTOS(const LLSD& data) : LLModalDialog( data["message"].asString() ), mMessage(data["message"].asString()), - mWebBrowserWindowId( 0 ), mLoadingScreenLoaded(false), mSiteAlive(false), mRealNavigateBegun(false), diff --git a/indra/newview/llfloatertos.h b/indra/newview/llfloatertos.h index 8921d11489..47126d06a6 100755 --- a/indra/newview/llfloatertos.h +++ b/indra/newview/llfloatertos.h @@ -62,7 +62,6 @@ public: private: std::string mMessage; - int mWebBrowserWindowId; bool mLoadingScreenLoaded; bool mSiteAlive; bool mRealNavigateBegun; diff --git a/indra/newview/llfloatertwitter.cpp b/indra/newview/llfloatertwitter.cpp index 868d623d57..c48b1a3325 100644 --- a/indra/newview/llfloatertwitter.cpp +++ b/indra/newview/llfloatertwitter.cpp @@ -54,7 +54,6 @@ static LLPanelInjector<LLTwitterPhotoPanel> t_panel_photo("lltwitterphotopanel"); static LLPanelInjector<LLTwitterAccountPanel> t_panel_account("lltwitteraccountpanel"); -const S32 MAX_POSTCARD_DATASIZE = 1024 * 1024; // one megabyte const std::string DEFAULT_PHOTO_LOCATION_URL = "http://maps.secondlife.com/"; const std::string DEFAULT_PHOTO_QUERY_PARAMETERS = "?sourceid=slshare_photo&utm_source=twitter&utm_medium=photo&utm_campaign=slshare"; const std::string DEFAULT_STATUS_TEXT = " #SecondLife"; diff --git a/indra/newview/llfloateruipreview.cpp b/indra/newview/llfloateruipreview.cpp index bfc36a6bfb..76ad2146f1 100755 --- a/indra/newview/llfloateruipreview.cpp +++ b/indra/newview/llfloateruipreview.cpp @@ -180,7 +180,6 @@ private: LLButton* mToggleOverlapButton; // button to togle overlap panel/highlighting LLComboBox* mLanguageSelection; // combo box for primary language selection LLComboBox* mLanguageSelection_2; // combo box for secondary language selection - LLScrollContainer* mOverlapScrollView; // overlapping elements scroll container S32 mLastDisplayedX, mLastDisplayedY; // stored position of last floater so the new one opens up in the same place std::string mDelim; // the OS-specific delimiter character (/ or \) (*TODO: this shouldn't be needed, right?) diff --git a/indra/newview/llfloaterwebcontent.cpp b/indra/newview/llfloaterwebcontent.cpp index 3f3d87b564..024e315632 100755 --- a/indra/newview/llfloaterwebcontent.cpp +++ b/indra/newview/llfloaterwebcontent.cpp @@ -293,6 +293,7 @@ void LLFloaterWebContent::onOpen(const LLSD& key) void LLFloaterWebContent::onClose(bool app_quitting) { // If we close the web browsing window showing the facebook login, we need to signal to this object that the connection will not happen + // MAINT-3440 note change here to use findInstance and not getInstance - latter creates an instance if it's not there which is bad. LLFloater* fbc_web = LLFloaterReg::findInstance("fbc_web"); if (fbc_web == this) { @@ -302,7 +303,8 @@ void LLFloaterWebContent::onClose(bool app_quitting) } } // Same with Flickr - LLFloater* flickr_web = LLFloaterReg::getInstance("flickr_web"); + // MAINT-3440 note change here to use findInstance and not getInstance - latter creates an instance if it's not there which is bad. + LLFloater* flickr_web = LLFloaterReg::findInstance("flickr_web"); if (flickr_web == this) { if (!LLFlickrConnect::instance().isConnected()) @@ -311,7 +313,8 @@ void LLFloaterWebContent::onClose(bool app_quitting) } } // And Twitter - LLFloater* twitter_web = LLFloaterReg::getInstance("twitter_web"); + // MAINT-3440 note change here to use findInstance and not getInstance - latter creates an instance if it's not there which is bad. + LLFloater* twitter_web = LLFloaterReg::findInstance("twitter_web"); if (twitter_web == this) { if (!LLTwitterConnect::instance().isConnected()) diff --git a/indra/newview/llfloaterworldmap.cpp b/indra/newview/llfloaterworldmap.cpp index ff66bdedb0..cc4753577d 100755 --- a/indra/newview/llfloaterworldmap.cpp +++ b/indra/newview/llfloaterworldmap.cpp @@ -659,9 +659,9 @@ void LLFloaterWorldMap::trackLocation(const LLVector3d& pos_global) F32 region_y = (F32)fmod( pos_global.mdV[VY], (F64)REGION_WIDTH_METERS ); std::string full_name = llformat("%s (%d, %d, %d)", sim_name.c_str(), - llround(region_x), - llround(region_y), - llround((F32)pos_global.mdV[VZ])); + ll_round(region_x), + ll_round(region_y), + ll_round((F32)pos_global.mdV[VZ])); std::string tooltip(""); mTrackedStatus = LLTracker::TRACKING_LOCATION; diff --git a/indra/newview/llfolderviewmodelinventory.cpp b/indra/newview/llfolderviewmodelinventory.cpp index 7615c12043..3271a40ea0 100755 --- a/indra/newview/llfolderviewmodelinventory.cpp +++ b/indra/newview/llfolderviewmodelinventory.cpp @@ -129,13 +129,18 @@ void LLFolderViewModelItemInventory::requestSort() void LLFolderViewModelItemInventory::setPassedFilter(bool passed, S32 filter_generation, std::string::size_type string_offset, std::string::size_type string_size) { + bool generation_skip = mMarkedDirtyGeneration >= 0 + && mPrevPassedAllFilters + && mMarkedDirtyGeneration < mRootViewModel.getFilter().getFirstSuccessGeneration(); LLFolderViewModelItemCommon::setPassedFilter(passed, filter_generation, string_offset, string_size); bool before = mPrevPassedAllFilters; mPrevPassedAllFilters = passedFilter(filter_generation); - if (before != mPrevPassedAllFilters) + if (before != mPrevPassedAllFilters || generation_skip) { - // Need to rearrange the folder if the filtered state of the item changed + // Need to rearrange the folder if the filtered state of the item changed, + // previously passed item skipped filter generation changes while being dirty + // or previously passed not yet filtered item was marked dirty LLFolderViewFolder* parent_folder = mFolderViewItem->getParentFolder(); if (parent_folder) { @@ -144,6 +149,9 @@ void LLFolderViewModelItemInventory::setPassedFilter(bool passed, S32 filter_gen } } + + + bool LLFolderViewModelItemInventory::filterChildItem( LLFolderViewModelItem* item, LLFolderViewFilter& filter ) { S32 filter_generation = filter.getCurrentGeneration(); diff --git a/indra/newview/llglsandbox.cpp b/indra/newview/llglsandbox.cpp index 4b8ac2b3cf..c80dec0e75 100755 --- a/indra/newview/llglsandbox.cpp +++ b/indra/newview/llglsandbox.cpp @@ -80,10 +80,10 @@ void LLToolSelectRect::handleRectangleSelection(S32 x, S32 y, MASK mask) S32 top = llmax(y, mDragStartY); S32 bottom =llmin(y, mDragStartY); - left = llround((F32) left * LLUI::getScaleFactor().mV[VX]); - right = llround((F32) right * LLUI::getScaleFactor().mV[VX]); - top = llround((F32) top * LLUI::getScaleFactor().mV[VY]); - bottom = llround((F32) bottom * LLUI::getScaleFactor().mV[VY]); + left = ll_round((F32) left * LLUI::getScaleFactor().mV[VX]); + right = ll_round((F32) right * LLUI::getScaleFactor().mV[VX]); + top = ll_round((F32) top * LLUI::getScaleFactor().mV[VY]); + bottom = ll_round((F32) bottom * LLUI::getScaleFactor().mV[VY]); F32 old_far_plane = LLViewerCamera::getInstance()->getFar(); F32 old_near_plane = LLViewerCamera::getInstance()->getNear(); @@ -881,13 +881,14 @@ void LLViewerObjectList::renderObjectBeacons() F32 gpu_benchmark() { - if (!gGLManager.mHasShaderObjects) - { //don't bother benchmarking the fixed function + if (!gGLManager.mHasShaderObjects || !gGLManager.mHasTimerQuery) + { // don't bother benchmarking the fixed function + // or venerable drivers which don't support accurate timing anyway + // and are likely to be correctly identified by the GPU table already. return -1.f; } - - if (gBenchmarkProgram.mProgramObject == 0) + if (gBenchmarkProgram.mProgramObject == 0) { LLViewerShaderMgr::instance()->initAttribsAndUniforms(); @@ -920,7 +921,10 @@ F32 gpu_benchmark() //number of samples to take const S32 samples = 64; - LLGLSLShader::initProfile(); + if (gGLManager.mHasTimerQuery) + { + LLGLSLShader::initProfile(); + } LLRenderTarget dest[count]; U32 source[count]; @@ -964,16 +968,16 @@ F32 gpu_benchmark() v[0].set(-1,1,0); v[1].set(-1,-3,0); v[2].set(3,1,0); + buff->flush(); gBenchmarkProgram.bind(); - buff->setBuffer(LLVertexBuffer::MAP_VERTEX); - - //wait for any previoius GL commands to finish - glFinish(); bool busted_finish = false; + buff->setBuffer(LLVertexBuffer::MAP_VERTEX); + glFinish(); + for (S32 c = -1; c < samples; ++c) { LLTimer timer; @@ -1013,6 +1017,7 @@ F32 gpu_benchmark() if (!gGLManager.mHasTimerQuery && !busted_finish && gbps > 128.f) { //unrealistically high bandwidth for a card without timer queries, glFinish is probably ignored busted_finish = true; + LL_WARNS() << "GPU Benchmark detected GL driver with broken glFinish implementation." << LL_ENDL; } else { @@ -1023,10 +1028,12 @@ F32 gpu_benchmark() gBenchmarkProgram.unbind(); - LLGLSLShader::finishProfile(false); - - LLImageGL::deleteTextures(count, source); + if (gGLManager.mHasTimerQuery) + { + LLGLSLShader::finishProfile(false); + } + LLImageGL::deleteTextures(count, source); std::sort(results.begin(), results.end()); @@ -1037,27 +1044,20 @@ F32 gpu_benchmark() #if LL_DARWIN if (gbps > 512.f) { - LL_INFOS() << "Memory bandwidth is improbably high and likely incorrect." << LL_ENDL; + LL_WARNS() << "Memory bandwidth is improbably high and likely incorrect; discarding result." << LL_ENDL; //OSX is probably lying, discard result gbps = -1.f; } #endif - if (gGLManager.mHasTimerQuery) - { - F32 ms = gBenchmarkProgram.mTimeElapsed/1000000.f; - F32 seconds = ms/1000.f; + F32 ms = gBenchmarkProgram.mTimeElapsed/1000000.f; + F32 seconds = ms/1000.f; - F64 samples_drawn = res*res*count*samples; - F32 samples_sec = (samples_drawn/1000000000.0)/seconds; - gbps = samples_sec*8; + F64 samples_drawn = res*res*count*samples; + F32 samples_sec = (samples_drawn/1000000000.0)/seconds; + gbps = samples_sec*8; - LL_INFOS() << "Memory bandwidth is " << llformat("%.3f", gbps) << "GB/sec according to ARB_timer_query" << LL_ENDL; - } - else - { - LL_INFOS() << "ARB_timer_query unavailable." << LL_ENDL; - } + LL_INFOS() << "Memory bandwidth is " << llformat("%.3f", gbps) << "GB/sec according to ARB_timer_query" << LL_ENDL; return gbps; } diff --git a/indra/newview/llgrouplist.cpp b/indra/newview/llgrouplist.cpp index b1b7a87ae8..ef238cefe3 100755 --- a/indra/newview/llgrouplist.cpp +++ b/indra/newview/llgrouplist.cpp @@ -50,6 +50,8 @@ S32 LLGroupListItem::sIconWidth = 0; class LLGroupComparator : public LLFlatListView::ItemComparator { public: + LLGroupComparator() {}; + /** Returns true if item1 < item2, false otherwise */ /*virtual*/ bool compare(const LLPanel* item1, const LLPanel* item2) const { diff --git a/indra/newview/llhudeffecttrail.cpp b/indra/newview/llhudeffecttrail.cpp index 8771219034..fc6efdb840 100755 --- a/indra/newview/llhudeffecttrail.cpp +++ b/indra/newview/llhudeffecttrail.cpp @@ -42,13 +42,6 @@ #include "llvoavatar.h" #include "llworld.h" - -const F32 PARTICLE_SPACING = 0.01f; -const F32 MAX_SIZE = 0.025f; -const F32 START_POS_MAG = 1.f; -const F32 END_POS_MAG = 1.2f; - - LLHUDEffectSpiral::LLHUDEffectSpiral(const U8 type) : LLHUDEffect(type), mbInit(FALSE) { mKillTime = 10.f; diff --git a/indra/newview/llhudnametag.cpp b/indra/newview/llhudnametag.cpp index 31d832e524..c7d108b6de 100755 --- a/indra/newview/llhudnametag.cpp +++ b/indra/newview/llhudnametag.cpp @@ -52,17 +52,12 @@ const F32 SPRING_STRENGTH = 0.7f; -const F32 RESTORATION_SPRING_TIME_CONSTANT = 0.1f; const F32 HORIZONTAL_PADDING = 16.f; const F32 VERTICAL_PADDING = 12.f; const F32 LINE_PADDING = 3.f; // aka "leading" const F32 BUFFER_SIZE = 2.f; -const F32 MIN_EDGE_OVERLAP = 3.f; const F32 HUD_TEXT_MAX_WIDTH = 190.f; -const F32 HUD_TEXT_MAX_WIDTH_NO_BUBBLE = 1000.f; -const F32 RESIZE_TIME = 0.f; const S32 NUM_OVERLAP_ITERATIONS = 10; -const F32 NEIGHBOR_FORCE_FRACTION = 1.f; const F32 POSITION_DAMPING_TC = 0.2f; const F32 MAX_STABLE_CAMERA_VELOCITY = 0.1f; const F32 LOD_0_SCREEN_COVERAGE = 0.15f; @@ -315,7 +310,7 @@ void LLHUDNameTag::renderText(BOOL for_select) { LLUIImagePtr rect_top_image = LLUI::getUIImage("Rounded_Rect_Top"); LLRect label_top_rect = screen_rect; - const S32 label_height = llround((mFontp->getLineHeight() * (F32)mLabelSegments.size() + (VERTICAL_PADDING / 3.f))); + const S32 label_height = ll_round((mFontp->getLineHeight() * (F32)mLabelSegments.size() + (VERTICAL_PADDING / 3.f))); label_top_rect.mBottom = label_top_rect.mTop - label_height; LLColor4 label_top_color = text_color; label_top_color.mV[VALPHA] = gSavedSettings.getF32("ChatBubbleOpacity") * alpha_factor; diff --git a/indra/newview/llhudtext.cpp b/indra/newview/llhudtext.cpp index f648d7baae..2c204170f2 100755 --- a/indra/newview/llhudtext.cpp +++ b/indra/newview/llhudtext.cpp @@ -48,23 +48,11 @@ #include "pipeline.h" #include <boost/tokenizer.hpp> - -const F32 SPRING_STRENGTH = 0.7f; -const F32 RESTORATION_SPRING_TIME_CONSTANT = 0.1f; const F32 HORIZONTAL_PADDING = 15.f; const F32 VERTICAL_PADDING = 12.f; const F32 BUFFER_SIZE = 2.f; -const F32 MIN_EDGE_OVERLAP = 3.f; const F32 HUD_TEXT_MAX_WIDTH = 190.f; const F32 HUD_TEXT_MAX_WIDTH_NO_BUBBLE = 1000.f; -const F32 RESIZE_TIME = 0.f; -const S32 NUM_OVERLAP_ITERATIONS = 10; -const F32 NEIGHBOR_FORCE_FRACTION = 1.f; -const F32 POSITION_DAMPING_TC = 0.2f; -const F32 MAX_STABLE_CAMERA_VELOCITY = 0.1f; -//const F32 LOD_0_SCREEN_COVERAGE = 0.15f; -//const F32 LOD_1_SCREEN_COVERAGE = 0.30f; -//const F32 LOD_2_SCREEN_COVERAGE = 0.40f; std::set<LLPointer<LLHUDText> > LLHUDText::sTextObjects; std::vector<LLPointer<LLHUDText> > LLHUDText::sVisibleTextObjects; diff --git a/indra/newview/llhudview.cpp b/indra/newview/llhudview.cpp index 9a63e99357..cead4dbce6 100755 --- a/indra/newview/llhudview.cpp +++ b/indra/newview/llhudview.cpp @@ -44,10 +44,6 @@ LLHUDView *gHUDView = NULL; -const S32 HUD_ARROW_SIZE = 32; - - - LLHUDView::LLHUDView(const LLRect& r) { buildFromFile( "panel_hud.xml"); diff --git a/indra/newview/llinventorybridge.cpp b/indra/newview/llinventorybridge.cpp index 33e557cddd..1910656066 100755 --- a/indra/newview/llinventorybridge.cpp +++ b/indra/newview/llinventorybridge.cpp @@ -87,6 +87,8 @@ void copy_slurl_to_clipboard_callback_inv(const std::string& slurl); typedef std::pair<LLUUID, LLUUID> two_uuids_t; typedef std::list<two_uuids_t> two_uuids_list_t; +const F32 SOUND_GAIN = 1.0f; + struct LLMoveInv { LLUUID mObjectID; @@ -2785,8 +2787,8 @@ void LLRightClickInventoryFetchDescendentsObserver::execute(bool clear_observer) class LLInventoryCopyAndWearObserver : public LLInventoryObserver { public: - LLInventoryCopyAndWearObserver(const LLUUID& cat_id, int count, bool folder_added=false) : - mCatID(cat_id), mContentsCount(count), mFolderAdded(folder_added) {} + LLInventoryCopyAndWearObserver(const LLUUID& cat_id, int count, bool folder_added=false, bool replace=false) : + mCatID(cat_id), mContentsCount(count), mFolderAdded(folder_added), mReplace(replace){} virtual ~LLInventoryCopyAndWearObserver() {} virtual void changed(U32 mask); @@ -2794,6 +2796,7 @@ protected: LLUUID mCatID; int mContentsCount; bool mFolderAdded; + bool mReplace; }; @@ -2832,7 +2835,7 @@ void LLInventoryCopyAndWearObserver::changed(U32 mask) mContentsCount) { gInventory.removeObserver(this); - LLAppearanceMgr::instance().wearInventoryCategory(category, FALSE, TRUE); + LLAppearanceMgr::instance().wearInventoryCategory(category, FALSE, !mReplace); delete this; } } @@ -3779,24 +3782,21 @@ void LLFolderBridge::modifyOutfit(BOOL append) // checking amount of items to wear U32 max_items = gSavedSettings.getU32("WearFolderLimit"); - if (cat->getDescendentCount() > max_items) - { - LLInventoryModel::cat_array_t cats; - LLInventoryModel::item_array_t items; - LLFindWearablesEx not_worn(/*is_worn=*/ false, /*include_body_parts=*/ false); - gInventory.collectDescendentsIf(cat->getUUID(), - cats, - items, - LLInventoryModel::EXCLUDE_TRASH, - not_worn); - - if (items.size() > max_items) - { - LLSD args; - args["AMOUNT"] = llformat("%d", max_items); - LLNotificationsUtil::add("TooManyWearables", args); - return; - } + LLInventoryModel::cat_array_t cats; + LLInventoryModel::item_array_t items; + LLFindWearablesEx not_worn(/*is_worn=*/ false, /*include_body_parts=*/ false); + gInventory.collectDescendentsIf(cat->getUUID(), + cats, + items, + LLInventoryModel::EXCLUDE_TRASH, + not_worn); + + if (items.size() > max_items) + { + LLSD args; + args["AMOUNT"] = llformat("%d", max_items); + LLNotificationsUtil::add("TooManyWearables", args); + return; } LLAppearanceMgr::instance().wearInventoryCategory( cat, FALSE, append ); @@ -3816,7 +3816,8 @@ bool move_task_inventory_callback(const LLSD& notification, const LLSD& response LLInventoryObject::object_list_t inventory_objects; object->getInventoryContents(inventory_objects); int contents_count = inventory_objects.size()-1; //subtract one for containing folder - LLInventoryCopyAndWearObserver* inventoryObserver = new LLInventoryCopyAndWearObserver(cat_and_wear->mCatID, contents_count, cat_and_wear->mFolderResponded); + LLInventoryCopyAndWearObserver* inventoryObserver = new LLInventoryCopyAndWearObserver(cat_and_wear->mCatID, contents_count, cat_and_wear->mFolderResponded, + cat_and_wear->mReplace); gInventory.addObserver(inventoryObserver); } @@ -4526,6 +4527,23 @@ void LLSoundBridge::buildContextMenu(LLMenuGL& menu, U32 flags) hide_context_entries(menu, items, disabled_items); } +void LLSoundBridge::performAction(LLInventoryModel* model, std::string action) +{ + if ("sound_play" == action) + { + LLViewerInventoryItem* item = getItem(); + if(item) + { + send_sound_trigger(item->getAssetUUID(), SOUND_GAIN); + } + } + else if ("open" == action) + { + openSoundPreview((void*)this); + } + else LLItemBridge::performAction(model, action); +} + // +=================================================+ // | LLLandmarkBridge | // +=================================================+ @@ -5326,16 +5344,20 @@ std::string LLObjectBridge::getLabelSuffix() const { return LLItemBridge::getLabelSuffix() + LLTrans::getString("worn"); } - std::string attachment_point_name = gAgentAvatarp->getAttachedPointName(mUUID); - if (attachment_point_name == LLStringUtil::null) // Error condition, invalid attach point + std::string attachment_point_name; + if (gAgentAvatarp->getAttachedPointName(mUUID, attachment_point_name)) { - attachment_point_name = "Invalid Attachment"; - } - // e.g. "(worn on ...)" / "(attached to ...)" - LLStringUtil::format_map_t args; - args["[ATTACHMENT_POINT]"] = LLTrans::getString(attachment_point_name); + LLStringUtil::format_map_t args; + args["[ATTACHMENT_POINT]"] = LLTrans::getString(attachment_point_name); - return LLItemBridge::getLabelSuffix() + LLTrans::getString("WornOnAttachmentPoint", args); + return LLItemBridge::getLabelSuffix() + LLTrans::getString("WornOnAttachmentPoint", args); + } + else + { + LLStringUtil::format_map_t args; + args["[ATTACHMENT_ERROR]"] = LLTrans::getString(attachment_point_name); + return LLItemBridge::getLabelSuffix() + LLTrans::getString("AttachmentErrorMessage", args); + } } return LLItemBridge::getLabelSuffix(); } @@ -6138,7 +6160,7 @@ public: LLViewerInventoryItem* item = getItem(); if (item) { - LLFloaterReg::showInstance("preview_sound", LLSD(mUUID), TAKE_FOCUS_YES); + send_sound_trigger(item->getAssetUUID(), SOUND_GAIN); } LLInvFVBridgeAction::doIt(); } diff --git a/indra/newview/llinventorybridge.h b/indra/newview/llinventorybridge.h index 833fbbadbb..f8ef15991d 100755 --- a/indra/newview/llinventorybridge.h +++ b/indra/newview/llinventorybridge.h @@ -199,6 +199,7 @@ protected: class LLInventoryFolderViewModelBuilder { public: + LLInventoryFolderViewModelBuilder() {} virtual ~LLInventoryFolderViewModelBuilder() {} virtual LLInvFVBridge* createBridge(LLAssetType::EType asset_type, LLAssetType::EType actual_asset_type, @@ -389,6 +390,7 @@ public: LLItemBridge(inventory, root, uuid) {} virtual void openItem(); virtual void buildContextMenu(LLMenuGL& menu, U32 flags); + virtual void performAction(LLInventoryModel* model, std::string action); static void openSoundPreview(void*); }; @@ -653,6 +655,7 @@ public: class LLRecentInventoryBridgeBuilder : public LLInventoryFolderViewModelBuilder { public: + LLRecentInventoryBridgeBuilder() {} // Overrides FolderBridge for Recent Inventory Panel. // It use base functionality for bridges other than FolderBridge. virtual LLInvFVBridge* createBridge(LLAssetType::EType asset_type, diff --git a/indra/newview/llinventoryfilter.cpp b/indra/newview/llinventoryfilter.cpp index f211acedf0..c66e9da4a9 100755 --- a/indra/newview/llinventoryfilter.cpp +++ b/indra/newview/llinventoryfilter.cpp @@ -126,13 +126,6 @@ bool LLInventoryFilter::checkFolder(const LLFolderViewModelItem* item) const bool LLInventoryFilter::checkFolder(const LLUUID& folder_id) const { - // when applying a filter, matching folders get their contents downloaded first - if (isNotDefault() - && !gInventory.isCategoryComplete(folder_id)) - { - LLInventoryModelBackgroundFetch::instance().start(folder_id); - } - // Always check against the clipboard const BOOL passed_clipboard = checkAgainstClipboard(folder_id); @@ -142,6 +135,13 @@ bool LLInventoryFilter::checkFolder(const LLUUID& folder_id) const return passed_clipboard; } + // when applying a filter, matching folders get their contents downloaded first + if (mFilterSubString.size() + && !gInventory.isCategoryComplete(folder_id)) + { + LLInventoryModelBackgroundFetch::instance().start(folder_id); + } + // show folder links LLViewerInventoryItem* item = gInventory.getItem(folder_id); if (item && item->getActualType() == LLAssetType::AT_LINK_FOLDER) @@ -550,7 +550,7 @@ void LLInventoryFilter::setFilterSubString(const std::string& string) if (mFilterOps.mFilterTypes == FILTERTYPE_UUID) { mFilterOps.mFilterTypes &= ~FILTERTYPE_UUID; - mFilterOps.mFilterUUID == LLUUID::null; + mFilterOps.mFilterUUID = LLUUID::null; setModified(FILTER_RESTART); } @@ -663,13 +663,13 @@ void LLInventoryFilter::setHoursAgo(U32 hours) BOOL more_restrictive; if (FILTERDATEDIRECTION_NEWER == mFilterOps.mDateSearchDirection) { - less_restrictive = (are_date_limits_valid && ((is_increasing && mFilterOps.mHoursAgo)) || !hours); - more_restrictive = (are_date_limits_valid && (!is_increasing && hours) || is_increasing_from_zero); + less_restrictive = ((are_date_limits_valid && ((is_increasing && mFilterOps.mHoursAgo))) || !hours); + more_restrictive = ((are_date_limits_valid && (!is_increasing && hours)) || is_increasing_from_zero); } else { - less_restrictive = (are_date_limits_valid && ((is_decreasing && mFilterOps.mHoursAgo)) || !hours); - more_restrictive = (are_date_limits_valid && (!is_decreasing && hours) || is_increasing_from_zero); + less_restrictive = ((are_date_limits_valid && ((is_decreasing && mFilterOps.mHoursAgo))) || !hours); + more_restrictive = ((are_date_limits_valid && (!is_decreasing && hours)) || is_increasing_from_zero); } mFilterOps.mHoursAgo = hours; diff --git a/indra/newview/llinventorypanel.cpp b/indra/newview/llinventorypanel.cpp index e18ecd2e2a..3546317471 100755 --- a/indra/newview/llinventorypanel.cpp +++ b/indra/newview/llinventorypanel.cpp @@ -542,12 +542,13 @@ void LLInventoryPanel::modelChanged(U32 mask) // This item already exists in both memory and UI. It was probably reparented. else if (model_item && view_item) { + LLFolderViewFolder* old_parent = view_item->getParentFolder(); // Don't process the item if it is the root - if (view_item->getParentFolder()) + if (old_parent) { LLFolderViewFolder* new_parent = (LLFolderViewFolder*)getItemByID(model_item->getParentUUID()); // Item has been moved. - if (view_item->getParentFolder() != new_parent) + if (old_parent != new_parent) { if (new_parent != NULL) { @@ -573,6 +574,7 @@ void LLInventoryPanel::modelChanged(U32 mask) // doesn't include trash). Just remove the item's UI. view_item->destroyView(); } + old_parent->getViewModelItem()->dirtyDescendantsFilter(); } } } @@ -583,27 +585,16 @@ void LLInventoryPanel::modelChanged(U32 mask) else if (!model_item && view_item && viewmodel_item) { // Remove the item's UI. - removeItemID(viewmodel_item->getUUID()); + LLFolderViewFolder* parent = view_item->getParentFolder(); + removeItemID(viewmodel_item->getUUID()); view_item->destroyView(); + if(parent) + { + parent->getViewModelItem()->dirtyDescendantsFilter(); + } } } } - - if (mask & (LLInventoryObserver::STRUCTURE | LLInventoryObserver::REMOVE)) - { - // STRUCTURE and REMOVE model changes usually fail to update (clean) - // mMostFilteredDescendantGeneration of parent folder and dirtyFilter() - // is not sufficient for successful filter update, so we need to check - // all already passed element over again to remove obsolete elements. - // New items or moved items should be sufficiently covered by - // dirtyFilter(). - LLInventoryFilter& filter = getFilter(); - if (filter.getFilterTypes() & LLInventoryFilter::FILTERTYPE_DATE - || filter.isNotDefault()) - { - filter.setModified(LLFolderViewFilter::FILTER_MORE_RESTRICTIVE); - } - } } LLUUID LLInventoryPanel::getRootFolderID() diff --git a/indra/newview/lllandmarkactions.cpp b/indra/newview/lllandmarkactions.cpp index f893daaeb2..9c00243f44 100755 --- a/indra/newview/lllandmarkactions.cpp +++ b/indra/newview/lllandmarkactions.cpp @@ -74,9 +74,9 @@ public: if (!landmark->getGlobalPos(landmark_global_pos)) return false; //we have to round off each coordinates to compare positions properly - return llround(mPos.mdV[VX]) == llround(landmark_global_pos.mdV[VX]) - && llround(mPos.mdV[VY]) == llround(landmark_global_pos.mdV[VY]) - && llround(mPos.mdV[VZ]) == llround(landmark_global_pos.mdV[VZ]); + return ll_round(mPos.mdV[VX]) == ll_round(landmark_global_pos.mdV[VX]) + && ll_round(mPos.mdV[VY]) == ll_round(landmark_global_pos.mdV[VY]) + && ll_round(mPos.mdV[VZ]) == ll_round(landmark_global_pos.mdV[VZ]); } }; @@ -320,7 +320,7 @@ void LLLandmarkActions::getRegionNameAndCoordsFromPosGlobal(const LLVector3d& gl { LLVector3 pos = sim_infop->getLocalPos(global_pos); std::string name = sim_infop->getName() ; - cb(name, llround(pos.mV[VX]), llround(pos.mV[VY]),llround(pos.mV[VZ])); + cb(name, ll_round(pos.mV[VX]), ll_round(pos.mV[VY]),ll_round(pos.mV[VZ])); } else { @@ -364,7 +364,7 @@ void LLLandmarkActions::onRegionResponseNameAndCoords(region_name_and_coords_cal { LLVector3 local_pos = sim_infop->getLocalPos(global_pos); std::string name = sim_infop->getName() ; - cb(name, llround(local_pos.mV[VX]), llround(local_pos.mV[VY]), llround(local_pos.mV[VZ])); + cb(name, ll_round(local_pos.mV[VX]), ll_round(local_pos.mV[VY]), ll_round(local_pos.mV[VZ])); } } diff --git a/indra/newview/lllocalbitmaps.cpp b/indra/newview/lllocalbitmaps.cpp index 897ee8429a..2c2e66e08f 100755 --- a/indra/newview/lllocalbitmaps.cpp +++ b/indra/newview/lllocalbitmaps.cpp @@ -74,7 +74,6 @@ bool LLLocalBitmapMgr::sNeedsRebake; static const F32 LL_LOCAL_TIMER_HEARTBEAT = 3.0; static const BOOL LL_LOCAL_USE_MIPMAPS = true; static const S32 LL_LOCAL_DISCARD_LEVEL = 0; -static const U32 LL_LOCAL_TEXLAYER_FOR_IDX = 0; static const bool LL_LOCAL_SLAM_FOR_DEBUG = true; static const bool LL_LOCAL_REPLACE_ON_DEL = true; static const S32 LL_LOCAL_UPDATE_RETRIES = 5; diff --git a/indra/newview/lllogchat.cpp b/indra/newview/lllogchat.cpp index 06e517a861..cadbc16f1e 100755 --- a/indra/newview/lllogchat.cpp +++ b/indra/newview/lllogchat.cpp @@ -1022,7 +1022,7 @@ void LLLoadHistoryThread::run() { loadHistory(mFileName, mMessages, mLoadParams); int count = mMessages->size(); - llinfos << "mMessages->size(): " << count << llendl; + LL_INFOS() << "mMessages->size(): " << count << LL_ENDL; setFinished(); } } diff --git a/indra/newview/lllogininstance.cpp b/indra/newview/lllogininstance.cpp index df59283bc4..b4d0bb6823 100755 --- a/indra/newview/lllogininstance.cpp +++ b/indra/newview/lllogininstance.cpp @@ -58,7 +58,6 @@ #include "llmachineid.h" #include "llupdaterservice.h" #include "llevents.h" -#include "llnotificationsutil.h" #include "llappviewer.h" #include <boost/scoped_ptr.hpp> @@ -75,9 +74,14 @@ namespace { { public: MandatoryUpdateMachine(LLLoginInstance & loginInstance, LLUpdaterService & updaterService); - + void start(void); - + + LLNotificationsInterface& getNotificationsInterface() const + { + return mLoginInstance.getNotificationsInterface(); + } + private: class State; class CheckingForUpdate; @@ -85,9 +89,9 @@ namespace { class ReadyToInstall; class StartingUpdaterService; class WaitingForDownload; - - LLLoginInstance & mLoginInstance; + boost::scoped_ptr<State> mState; + LLLoginInstance & mLoginInstance; LLUpdaterService & mUpdaterService; void setCurrentState(State * newState); @@ -145,7 +149,7 @@ namespace { virtual void exit(void); private: - MandatoryUpdateMachine & mMachine; + //MandatoryUpdateMachine & mMachine; }; @@ -328,7 +332,7 @@ MandatoryUpdateMachine::Error::Error(MandatoryUpdateMachine & machine): void MandatoryUpdateMachine::Error::enter(void) { LL_INFOS() << "entering error" << LL_ENDL; - LLNotificationsUtil::add("FailedRequiredUpdateInstall", LLSD(), LLSD(), boost::bind(&MandatoryUpdateMachine::Error::onButtonClicked, this, _1, _2)); + mMachine.getNotificationsInterface().add("FailedRequiredUpdateInstall", LLSD(), LLSD(), boost::bind(&MandatoryUpdateMachine::Error::onButtonClicked, this, _1, _2)); } @@ -349,8 +353,8 @@ void MandatoryUpdateMachine::Error::onButtonClicked(const LLSD &, const LLSD &) //----------------------------------------------------------------------------- -MandatoryUpdateMachine::ReadyToInstall::ReadyToInstall(MandatoryUpdateMachine & machine): - mMachine(machine) +MandatoryUpdateMachine::ReadyToInstall::ReadyToInstall(MandatoryUpdateMachine & machine) //: + //mMachine(machine) { ; // No op. } @@ -384,7 +388,7 @@ MandatoryUpdateMachine::StartingUpdaterService::StartingUpdaterService(Mandatory void MandatoryUpdateMachine::StartingUpdaterService::enter(void) { LL_INFOS() << "entering start update service" << LL_ENDL; - LLNotificationsUtil::add("UpdaterServiceNotRunning", LLSD(), LLSD(), boost::bind(&MandatoryUpdateMachine::StartingUpdaterService::onButtonClicked, this, _1, _2)); + mMachine.getNotificationsInterface().add("UpdaterServiceNotRunning", LLSD(), LLSD(), boost::bind(&MandatoryUpdateMachine::StartingUpdaterService::onButtonClicked, this, _1, _2)); } diff --git a/indra/newview/lllogininstance.h b/indra/newview/lllogininstance.h index b0247da7c8..c6773bbf68 100755 --- a/indra/newview/lllogininstance.h +++ b/indra/newview/lllogininstance.h @@ -70,6 +70,7 @@ public: void setPlatformInfo(const std::string platform, const std::string platform_version); void setNotificationsInterface(LLNotificationsInterface* ni) { mNotifications = ni; } + LLNotificationsInterface& getNotificationsInterface() const { return *mNotifications; } typedef boost::function<void()> UpdaterLauncherCallback; void setUpdaterLauncher(const UpdaterLauncherCallback& ulc) { mUpdaterLauncher = ulc; } diff --git a/indra/newview/llmanip.cpp b/indra/newview/llmanip.cpp index 0935691ebc..8567180dd6 100755 --- a/indra/newview/llmanip.cpp +++ b/indra/newview/llmanip.cpp @@ -521,8 +521,8 @@ void LLManip::renderTickValue(const LLVector3& pos, F32 value, const std::string std::string val_string; std::string fraction_string; - F32 val_to_print = llround(value, 0.001f); - S32 fractional_portion = llround(fmodf(llabs(val_to_print), 1.f) * 100.f); + F32 val_to_print = ll_round(value, 0.001f); + S32 fractional_portion = ll_round(fmodf(llabs(val_to_print), 1.f) * 100.f); if (val_to_print < 0.f) { if (fractional_portion == 0) diff --git a/indra/newview/llmaniprotate.cpp b/indra/newview/llmaniprotate.cpp index 7861573908..f172aa0955 100755 --- a/indra/newview/llmaniprotate.cpp +++ b/indra/newview/llmaniprotate.cpp @@ -368,9 +368,9 @@ void LLManipRotate::render() LLQuaternion object_rot = first_object->getRotationEdit(); object_rot.getEulerAngles(&(euler_angles.mV[VX]), &(euler_angles.mV[VY]), &(euler_angles.mV[VZ])); euler_angles *= RAD_TO_DEG; - euler_angles.mV[VX] = llround(fmodf(euler_angles.mV[VX] + 360.f, 360.f), 0.05f); - euler_angles.mV[VY] = llround(fmodf(euler_angles.mV[VY] + 360.f, 360.f), 0.05f); - euler_angles.mV[VZ] = llround(fmodf(euler_angles.mV[VZ] + 360.f, 360.f), 0.05f); + euler_angles.mV[VX] = ll_round(fmodf(euler_angles.mV[VX] + 360.f, 360.f), 0.05f); + euler_angles.mV[VY] = ll_round(fmodf(euler_angles.mV[VY] + 360.f, 360.f), 0.05f); + euler_angles.mV[VZ] = ll_round(fmodf(euler_angles.mV[VZ] + 360.f, 360.f), 0.05f); renderXYZ(euler_angles); } @@ -1240,10 +1240,10 @@ LLQuaternion LLManipRotate::dragUnconstrained( S32 x, S32 y ) F32 dist_from_sphere_center = sqrt(delta_x * delta_x + delta_y * delta_y); LLVector3 axis = mMouseDown % mMouseCur; + F32 angle = atan2(sqrtf(axis * axis), mMouseDown * mMouseCur); axis.normVec(); - F32 angle = acos(mMouseDown * mMouseCur); LLQuaternion sphere_rot( angle, axis ); - + if (is_approx_zero(1.f - mMouseDown * mMouseCur)) { return LLQuaternion::DEFAULT; @@ -1524,7 +1524,6 @@ LLQuaternion LLManipRotate::dragConstrained( S32 x, S32 y ) F32 mouse_angle = fmodf(atan2(projected_mouse * axis1, projected_mouse * axis2) * RAD_TO_DEG + 360.f, 360.f); F32 relative_mouse_angle = fmodf(mouse_angle + (SNAP_ANGLE_DETENTE / 2), SNAP_ANGLE_INCREMENT); - //fmodf(llround(mouse_angle * RAD_TO_DEG, 7.5f) + 360.f, 360.f); LLVector3 object_axis; getObjectAxisClosestToMouse(object_axis); @@ -1608,7 +1607,6 @@ LLQuaternion LLManipRotate::dragConstrained( S32 x, S32 y ) F32 mouse_angle = fmodf(atan2(projected_mouse * axis1, projected_mouse * axis2) * RAD_TO_DEG + 360.f, 360.f); F32 relative_mouse_angle = fmodf(mouse_angle + (SNAP_ANGLE_DETENTE / 2), SNAP_ANGLE_INCREMENT); - //fmodf(llround(mouse_angle * RAD_TO_DEG, 7.5f) + 360.f, 360.f); LLVector3 object_axis; getObjectAxisClosestToMouse(object_axis); @@ -1638,9 +1636,9 @@ LLQuaternion LLManipRotate::dragConstrained( S32 x, S32 y ) mInSnapRegime = FALSE; } - angle = acos(mMouseCur * mMouseDown); - - F32 dir = (mMouseDown % mMouseCur) * constraint_axis; // cross product + LLVector3 cross_product = mMouseDown % mMouseCur; + angle = atan2(sqrtf(cross_product * cross_product), mMouseCur * mMouseDown); + F32 dir = cross_product * constraint_axis; // cross product if( dir < 0.f ) { angle *= -1.f; diff --git a/indra/newview/llmanipscale.cpp b/indra/newview/llmanipscale.cpp index 2810941d83..ed833cba53 100755 --- a/indra/newview/llmanipscale.cpp +++ b/indra/newview/llmanipscale.cpp @@ -229,8 +229,6 @@ void LLManipScale::render() const F32 BOX_HANDLE_BASE_SIZE = 50.0f; // box size in pixels = BOX_HANDLE_BASE_SIZE * BOX_HANDLE_BASE_FACTOR const F32 BOX_HANDLE_BASE_FACTOR = 0.2f; - LLVector3 center_agent = gAgent.getPosAgentFromGlobal(LLSelectMgr::getInstance()->getSelectionCenterGlobal()); - if (mObjectSelection->getSelectType() == SELECT_TYPE_HUD) { for (S32 i = 0; i < NUM_MANIPULATORS; i++) @@ -1554,8 +1552,8 @@ void LLManipScale::updateSnapGuides(const LLBBox& bbox) mScaleSnapUnit1 = mScaleSnapUnit1 / (mSnapDir1 * mScaleDir); mScaleSnapUnit2 = mScaleSnapUnit2 / (mSnapDir2 * mScaleDir); - mTickPixelSpacing1 = llround((F32)MIN_DIVISION_PIXEL_WIDTH / (mScaleDir % mSnapGuideDir1).length()); - mTickPixelSpacing2 = llround((F32)MIN_DIVISION_PIXEL_WIDTH / (mScaleDir % mSnapGuideDir2).length()); + mTickPixelSpacing1 = ll_round((F32)MIN_DIVISION_PIXEL_WIDTH / (mScaleDir % mSnapGuideDir1).length()); + mTickPixelSpacing2 = ll_round((F32)MIN_DIVISION_PIXEL_WIDTH / (mScaleDir % mSnapGuideDir2).length()); if (uniform) { @@ -1626,8 +1624,8 @@ void LLManipScale::renderSnapGuides(const LLBBox& bbox) F32 grid_offset2 = fmodf(dist_grid_axis, smallest_subdivision2); // how many smallest grid units are we away from largest grid scale? - S32 sub_div_offset_1 = llround(fmod(dist_grid_axis - grid_offset1, mScaleSnapUnit1 / sGridMinSubdivisionLevel) / smallest_subdivision1); - S32 sub_div_offset_2 = llround(fmod(dist_grid_axis - grid_offset2, mScaleSnapUnit2 / sGridMinSubdivisionLevel) / smallest_subdivision2); + S32 sub_div_offset_1 = ll_round(fmod(dist_grid_axis - grid_offset1, mScaleSnapUnit1 / sGridMinSubdivisionLevel) / smallest_subdivision1); + S32 sub_div_offset_2 = ll_round(fmod(dist_grid_axis - grid_offset2, mScaleSnapUnit2 / sGridMinSubdivisionLevel) / smallest_subdivision2); S32 num_ticks_per_side1 = llmax(1, lltrunc(0.5f * mSnapGuideLength / smallest_subdivision1)); S32 num_ticks_per_side2 = llmax(1, lltrunc(0.5f * mSnapGuideLength / smallest_subdivision2)); @@ -1681,7 +1679,7 @@ void LLManipScale::renderSnapGuides(const LLBBox& bbox) LLVector2 screen_translate_axis(llabs(mScaleDir * LLViewerCamera::getInstance()->getLeftAxis()), llabs(mScaleDir * LLViewerCamera::getInstance()->getUpAxis())); screen_translate_axis.normalize(); - S32 tick_label_spacing = llround(screen_translate_axis * sTickLabelSpacing); + S32 tick_label_spacing = ll_round(screen_translate_axis * sTickLabelSpacing); for (pass = 0; pass < 3; pass++) { @@ -1761,8 +1759,8 @@ void LLManipScale::renderSnapGuides(const LLBBox& bbox) stop_tick = llmin(max_ticks1, num_ticks_per_side1); F32 grid_resolution = mObjectSelection->getSelectType() == SELECT_TYPE_HUD ? 0.25f : llmax(gSavedSettings.getF32("GridResolution"), 0.001f); - S32 label_sub_div_offset_1 = llround(fmod(dist_grid_axis - grid_offset1, mScaleSnapUnit1 * 32.f) / smallest_subdivision1); - S32 label_sub_div_offset_2 = llround(fmod(dist_grid_axis - grid_offset2, mScaleSnapUnit2 * 32.f) / smallest_subdivision2); + S32 label_sub_div_offset_1 = ll_round(fmod(dist_grid_axis - grid_offset1, mScaleSnapUnit1 * 32.f) / smallest_subdivision1); + S32 label_sub_div_offset_2 = ll_round(fmod(dist_grid_axis - grid_offset2, mScaleSnapUnit2 * 32.f) / smallest_subdivision2); for (S32 i = start_tick; i <= stop_tick; i++) { diff --git a/indra/newview/llmaniptranslate.cpp b/indra/newview/llmaniptranslate.cpp index d22672bc16..394db71fb9 100755 --- a/indra/newview/llmaniptranslate.cpp +++ b/indra/newview/llmaniptranslate.cpp @@ -65,7 +65,6 @@ const S32 NUM_AXES = 3; const S32 MOUSE_DRAG_SLOP = 2; // pixels -const F32 HANDLE_HIDE_ANGLE = 0.15f; // radians const F32 SELECTED_ARROW_SCALE = 1.3f; const F32 MANIPULATOR_HOTSPOT_START = 0.2f; const F32 MANIPULATOR_HOTSPOT_END = 1.2f; @@ -1246,7 +1245,7 @@ void LLManipTranslate::renderSnapGuides() // find distance to nearest smallest grid unit F32 offset_nearest_grid_unit = fmodf(dist_grid_axis, smallest_grid_unit_scale); // how many smallest grid units are we away from largest grid scale? - S32 sub_div_offset = llround(fmodf(dist_grid_axis - offset_nearest_grid_unit, getMinGridScale() / sGridMinSubdivisionLevel) / smallest_grid_unit_scale); + S32 sub_div_offset = ll_round(fmodf(dist_grid_axis - offset_nearest_grid_unit, getMinGridScale() / sGridMinSubdivisionLevel) / smallest_grid_unit_scale); S32 num_ticks_per_side = llmax(1, llfloor(0.5f * guide_size_meters / smallest_grid_unit_scale)); LLGLDepthTest gls_depth(GL_FALSE); @@ -1361,12 +1360,12 @@ void LLManipTranslate::renderSnapGuides() } } - sub_div_offset = llround(fmod(dist_grid_axis - offset_nearest_grid_unit, getMinGridScale() * 32.f) / smallest_grid_unit_scale); + sub_div_offset = ll_round(fmod(dist_grid_axis - offset_nearest_grid_unit, getMinGridScale() * 32.f) / smallest_grid_unit_scale); LLVector2 screen_translate_axis(llabs(translate_axis * LLViewerCamera::getInstance()->getLeftAxis()), llabs(translate_axis * LLViewerCamera::getInstance()->getUpAxis())); screen_translate_axis.normVec(); - S32 tick_label_spacing = llround(screen_translate_axis * sTickLabelSpacing); + S32 tick_label_spacing = ll_round(screen_translate_axis * sTickLabelSpacing); // render tickmark values for (S32 i = -num_ticks_per_side; i <= num_ticks_per_side; i++) @@ -1404,7 +1403,7 @@ void LLManipTranslate::renderSnapGuides() F32 offset_val = 0.5f * tick_offset.mV[ARROW_TO_AXIS[mManipPart]] / getMinGridScale(); EGridMode grid_mode = LLSelectMgr::getInstance()->getGridMode(); F32 text_highlight = 0.8f; - if(i - llround(offset_nearest_grid_unit / smallest_grid_unit_scale) == 0 && mInSnapRegime) + if(i - ll_round(offset_nearest_grid_unit / smallest_grid_unit_scale) == 0 && mInSnapRegime) { text_highlight = 1.f; } diff --git a/indra/newview/llmediactrl.cpp b/indra/newview/llmediactrl.cpp index f4e08dc790..b96bdd73ff 100755 --- a/indra/newview/llmediactrl.cpp +++ b/indra/newview/llmediactrl.cpp @@ -120,8 +120,8 @@ LLMediaCtrl::LLMediaCtrl( const Params& p) : if(!getDecoupleTextureSize()) { - S32 screen_width = llround((F32)getRect().getWidth() * LLUI::getScaleFactor().mV[VX]); - S32 screen_height = llround((F32)getRect().getHeight() * LLUI::getScaleFactor().mV[VY]); + S32 screen_width = ll_round((F32)getRect().getWidth() * LLUI::getScaleFactor().mV[VX]); + S32 screen_height = ll_round((F32)getRect().getHeight() * LLUI::getScaleFactor().mV[VY]); setTextureSize(screen_width, screen_height); } @@ -474,8 +474,8 @@ void LLMediaCtrl::reshape( S32 width, S32 height, BOOL called_from_parent ) { if(!getDecoupleTextureSize()) { - S32 screen_width = llround((F32)width * LLUI::getScaleFactor().mV[VX]); - S32 screen_height = llround((F32)height * LLUI::getScaleFactor().mV[VY]); + S32 screen_width = ll_round((F32)width * LLUI::getScaleFactor().mV[VX]); + S32 screen_height = ll_round((F32)height * LLUI::getScaleFactor().mV[VY]); // when floater is minimized, these sizes are negative if ( screen_height > 0 && screen_width > 0 ) @@ -789,13 +789,13 @@ void LLMediaCtrl::draw() { // max width, adjusted height width = r.getWidth(); - height = llmin(llmax(llround(width / media_aspect), 0), r.getHeight()); + height = llmin(llmax(ll_round(width / media_aspect), 0), r.getHeight()); } else { // max height, adjusted width height = r.getHeight(); - width = llmin(llmax(llround(height * media_aspect), 0), r.getWidth()); + width = llmin(llmax(ll_round(height * media_aspect), 0), r.getWidth()); } } else @@ -879,14 +879,14 @@ void LLMediaCtrl::convertInputCoords(S32& x, S32& y) coords_opengl = mMediaSource->getMediaPlugin()->getTextureCoordsOpenGL(); } - x = llround((F32)x * LLUI::getScaleFactor().mV[VX]); + x = ll_round((F32)x * LLUI::getScaleFactor().mV[VX]); if ( ! coords_opengl ) { - y = llround((F32)(y) * LLUI::getScaleFactor().mV[VY]); + y = ll_round((F32)(y) * LLUI::getScaleFactor().mV[VY]); } else { - y = llround((F32)(getRect().getHeight() - y) * LLUI::getScaleFactor().mV[VY]); + y = ll_round((F32)(getRect().getHeight() - y) * LLUI::getScaleFactor().mV[VY]); }; } diff --git a/indra/newview/llmediadataclient.cpp b/indra/newview/llmediadataclient.cpp index 691be13610..2fb9e60b29 100755 --- a/indra/newview/llmediadataclient.cpp +++ b/indra/newview/llmediadataclient.cpp @@ -92,7 +92,7 @@ std::ostream& operator<<(std::ostream &s, const LLMediaDataClient::request_queue std::ostream& operator<<(std::ostream &s, const LLMediaDataClient::Request &q); template <typename T> -static typename T::iterator find_matching_request(T &c, const LLMediaDataClient::Request *request, LLMediaDataClient::Request::Type match_type) +typename T::iterator find_matching_request(T &c, const LLMediaDataClient::Request *request, LLMediaDataClient::Request::Type match_type) { for(typename T::iterator iter = c.begin(); iter != c.end(); ++iter) { @@ -106,7 +106,7 @@ static typename T::iterator find_matching_request(T &c, const LLMediaDataClient: } template <typename T> -static typename T::iterator find_matching_request(T &c, const LLUUID &id, LLMediaDataClient::Request::Type match_type) +typename T::iterator find_matching_request(T &c, const LLUUID &id, LLMediaDataClient::Request::Type match_type) { for(typename T::iterator iter = c.begin(); iter != c.end(); ++iter) { @@ -123,7 +123,7 @@ static typename T::iterator find_matching_request(T &c, const LLUUID &id, LLMedi // to other elements in the container (such as std::vector). // If the implementation is changed to use a container with this property, this will need to be revisited. template <typename T> -static void remove_matching_requests(T &c, const LLUUID &id, LLMediaDataClient::Request::Type match_type) +void remove_matching_requests(T &c, const LLUUID &id, LLMediaDataClient::Request::Type match_type) { for(typename T::iterator iter = c.begin(); iter != c.end();) { @@ -171,10 +171,10 @@ bool LLMediaDataClient::isEmpty() const bool LLMediaDataClient::isInQueue(const LLMediaDataClientObject::ptr_t &object) { - if(find_matching_request(mQueue, object->getID()) != mQueue.end()) + if(find_matching_request(mQueue, object->getID(), LLMediaDataClient::Request::ANY) != mQueue.end()) return true; - if(find_matching_request(mUnQueuedRequests, object->getID()) != mUnQueuedRequests.end()) + if(find_matching_request(mUnQueuedRequests, object->getID(), LLMediaDataClient::Request::ANY) != mUnQueuedRequests.end()) return true; return false; @@ -183,8 +183,8 @@ bool LLMediaDataClient::isInQueue(const LLMediaDataClientObject::ptr_t &object) void LLMediaDataClient::removeFromQueue(const LLMediaDataClientObject::ptr_t &object) { LL_DEBUGS("LLMediaDataClient") << "removing requests matching ID " << object->getID() << LL_ENDL; - remove_matching_requests(mQueue, object->getID()); - remove_matching_requests(mUnQueuedRequests, object->getID()); + remove_matching_requests(mQueue, object->getID(), LLMediaDataClient::Request::ANY); + remove_matching_requests(mUnQueuedRequests, object->getID(), LLMediaDataClient::Request::ANY); } void LLMediaDataClient::startQueueTimer() @@ -785,7 +785,7 @@ bool LLObjectMediaDataClient::isInQueue(const LLMediaDataClientObject::ptr_t &ob if(LLMediaDataClient::isInQueue(object)) return true; - if(find_matching_request(mRoundRobinQueue, object->getID()) != mRoundRobinQueue.end()) + if(find_matching_request(mRoundRobinQueue, object->getID(), LLMediaDataClient::Request::ANY) != mRoundRobinQueue.end()) return true; return false; @@ -796,7 +796,7 @@ void LLObjectMediaDataClient::removeFromQueue(const LLMediaDataClientObject::ptr // First, call parent impl. LLMediaDataClient::removeFromQueue(object); - remove_matching_requests(mRoundRobinQueue, object->getID()); + remove_matching_requests(mRoundRobinQueue, object->getID(), LLMediaDataClient::Request::ANY); } bool LLObjectMediaDataClient::processQueueTimer() @@ -952,7 +952,7 @@ void LLObjectMediaNavigateClient::enqueue(Request *request) } // If there's already a matching request in the queue, remove it. - request_queue_t::iterator iter = find_matching_request(mQueue, request); + request_queue_t::iterator iter = find_matching_request(mQueue, request, LLMediaDataClient::Request::ANY); if(iter != mQueue.end()) { LL_DEBUGS("LLMediaDataClient") << "removing matching queued request " << (**iter) << LL_ENDL; @@ -960,7 +960,7 @@ void LLObjectMediaNavigateClient::enqueue(Request *request) } else { - request_set_t::iterator set_iter = find_matching_request(mUnQueuedRequests, request); + request_set_t::iterator set_iter = find_matching_request(mUnQueuedRequests, request, LLMediaDataClient::Request::ANY); if(set_iter != mUnQueuedRequests.end()) { LL_DEBUGS("LLMediaDataClient") << "removing matching unqueued request " << (**set_iter) << LL_ENDL; diff --git a/indra/newview/llmediadataclient.h b/indra/newview/llmediadataclient.h index 231b883c32..80dd519812 100755 --- a/indra/newview/llmediadataclient.h +++ b/indra/newview/llmediadataclient.h @@ -281,10 +281,9 @@ private: bool mQueueTimerIsRunning; - template <typename T> friend typename T::iterator find_matching_request(T &c, const LLMediaDataClient::Request *request, LLMediaDataClient::Request::Type match_type = LLMediaDataClient::Request::ANY); - template <typename T> friend typename T::iterator find_matching_request(T &c, const LLUUID &id, LLMediaDataClient::Request::Type match_type = LLMediaDataClient::Request::ANY); - template <typename T> friend void remove_matching_requests(T &c, const LLUUID &id, LLMediaDataClient::Request::Type match_type = LLMediaDataClient::Request::ANY); - + template <typename T> friend typename T::iterator find_matching_request(T &c, const LLMediaDataClient::Request *request, LLMediaDataClient::Request::Type match_type); + template <typename T> friend typename T::iterator find_matching_request(T &c, const LLUUID &id, LLMediaDataClient::Request::Type match_type); + template <typename T> friend void remove_matching_requests(T &c, const LLUUID &id, LLMediaDataClient::Request::Type match_type); }; // MediaDataClient specific for the ObjectMedia cap diff --git a/indra/newview/llmorphview.cpp b/indra/newview/llmorphview.cpp index 252d1b78ea..ff86400a56 100755 --- a/indra/newview/llmorphview.cpp +++ b/indra/newview/llmorphview.cpp @@ -47,17 +47,8 @@ LLMorphView *gMorphView = NULL; - -const F32 EDIT_AVATAR_ORBIT_SPEED = 0.1f; -const F32 EDIT_AVATAR_MAX_CAMERA_PITCH = 0.5f; - -const F32 CAMERA_MOVE_TIME = 0.5f; const F32 MORPH_NEAR_CLIP = 0.1f; -const F32 CAMERA_DIST_MIN = 0.4f; -const F32 CAMERA_DIST_MAX = 4.0f; -const F32 CAMERA_DIST_STEP = 1.5f; - //----------------------------------------------------------------------------- // LLMorphView() //----------------------------------------------------------------------------- diff --git a/indra/newview/llnetmap.cpp b/indra/newview/llnetmap.cpp index 1685a18e26..d7e7f13e87 100755 --- a/indra/newview/llnetmap.cpp +++ b/indra/newview/llnetmap.cpp @@ -67,7 +67,6 @@ const F32 LLNetMap::MAP_SCALE_MIN = 32; const F32 LLNetMap::MAP_SCALE_MID = 1024; const F32 LLNetMap::MAP_SCALE_MAX = 4096; -const F32 MAP_SCALE_INCREMENT = 16; const F32 MAP_SCALE_ZOOM_FACTOR = 1.04f; // Zoom in factor per click of scroll wheel (4%) const F32 MIN_DOT_RADIUS = 3.5f; const F32 DOT_SCALE = 0.75f; @@ -210,7 +209,7 @@ void LLNetMap::draw() } // figure out where agent is - S32 region_width = llround(LLWorld::getInstance()->getRegionWidthInMeters()); + S32 region_width = ll_round(LLWorld::getInstance()->getRegionWidthInMeters()); for (LLWorld::region_list_t::const_iterator iter = LLWorld::getInstance()->getRegionList().begin(); iter != LLWorld::getInstance()->getRegionList().end(); ++iter) @@ -381,8 +380,8 @@ void LLNetMap::draw() (pos_map.mV[VX] >= getRect().getWidth()) || (pos_map.mV[VY] >= getRect().getHeight()) ) { - S32 x = llround( pos_map.mV[VX] ); - S32 y = llround( pos_map.mV[VY] ); + S32 x = ll_round( pos_map.mV[VX] ); + S32 y = ll_round( pos_map.mV[VY] ); LLWorldMapView::drawTrackingCircle( getRect(), x, y, color, 1, 10); } else { @@ -422,12 +421,12 @@ void LLNetMap::draw() // Draw dot for self avatar position LLVector3d pos_global = gAgent.getPositionGlobal(); pos_map = globalPosToView(pos_global); - S32 dot_width = llround(mDotRadius * 2.f); + S32 dot_width = ll_round(mDotRadius * 2.f); LLUIImagePtr you = LLWorldMapView::sAvatarYouLargeImage; if (you) { - you->draw(llround(pos_map.mV[VX] - mDotRadius), - llround(pos_map.mV[VY] - mDotRadius), + you->draw(ll_round(pos_map.mV[VX] - mDotRadius), + ll_round(pos_map.mV[VY] - mDotRadius), dot_width, dot_width); @@ -531,8 +530,8 @@ void LLNetMap::drawTracking(const LLVector3d& pos_global, const LLColor4& color, { if (draw_arrow) { - S32 x = llround( pos_local.mV[VX] ); - S32 y = llround( pos_local.mV[VY] ); + S32 x = ll_round( pos_local.mV[VX] ); + S32 y = ll_round( pos_local.mV[VY] ); LLWorldMapView::drawTrackingCircle( getRect(), x, y, color, 1, 10 ); LLWorldMapView::drawTrackingArrow( getRect(), x, y, color ); } @@ -548,8 +547,8 @@ void LLNetMap::drawTracking(const LLVector3d& pos_global, const LLColor4& color, LLVector3d LLNetMap::viewPosToGlobal( S32 x, S32 y ) { - x -= llround(getRect().getWidth() / 2 + mCurPan.mV[VX]); - y -= llround(getRect().getHeight() / 2 + mCurPan.mV[VY]); + x -= ll_round(getRect().getWidth() / 2 + mCurPan.mV[VX]); + y -= ll_round(getRect().getHeight() / 2 + mCurPan.mV[VY]); LLVector3 pos_local( (F32)x, (F32)y, 0 ); @@ -685,7 +684,7 @@ void LLNetMap::renderScaledPointGlobal( const LLVector3d& pos, const LLColor4U & LLVector3 local_pos; local_pos.setVec( pos - mObjectImageCenterGlobal ); - S32 diameter_pixels = llround(2 * radius_meters * mObjectMapTPM); + S32 diameter_pixels = ll_round(2 * radius_meters * mObjectMapTPM); renderPoint( local_pos, color, diameter_pixels ); } @@ -701,8 +700,8 @@ void LLNetMap::renderPoint(const LLVector3 &pos_local, const LLColor4U &color, const S32 image_width = (S32)mObjectImagep->getWidth(); const S32 image_height = (S32)mObjectImagep->getHeight(); - S32 x_offset = llround(pos_local.mV[VX] * mObjectMapTPM + image_width / 2); - S32 y_offset = llround(pos_local.mV[VY] * mObjectMapTPM + image_height / 2); + S32 x_offset = ll_round(pos_local.mV[VX] * mObjectMapTPM + image_width / 2); + S32 y_offset = ll_round(pos_local.mV[VY] * mObjectMapTPM + image_height / 2); if ((x_offset < 0) || (x_offset >= image_width)) { @@ -781,7 +780,7 @@ void LLNetMap::createObjectImage() // ... which is, the diagonal of the rect. F32 width = (F32)getRect().getWidth(); F32 height = (F32)getRect().getHeight(); - S32 square_size = llround( sqrt(width*width + height*height) ); + S32 square_size = ll_round( sqrt(width*width + height*height) ); // Find the least power of two >= the minimum size. const S32 MIN_SIZE = 64; diff --git a/indra/newview/llpanelclassified.cpp b/indra/newview/llpanelclassified.cpp index 3cd39d7c7e..878f1af9ef 100755 --- a/indra/newview/llpanelclassified.cpp +++ b/indra/newview/llpanelclassified.cpp @@ -462,9 +462,9 @@ std::string LLPanelClassifiedInfo::createLocationText( if (!pos_global.isNull()) { - S32 region_x = llround((F32)pos_global.mdV[VX]) % REGION_WIDTH_UNITS; - S32 region_y = llround((F32)pos_global.mdV[VY]) % REGION_WIDTH_UNITS; - S32 region_z = llround((F32)pos_global.mdV[VZ]); + S32 region_x = ll_round((F32)pos_global.mdV[VX]) % REGION_WIDTH_UNITS; + S32 region_y = ll_round((F32)pos_global.mdV[VY]) % REGION_WIDTH_UNITS; + S32 region_z = ll_round((F32)pos_global.mdV[VZ]); location_text.append(llformat(" (%d, %d, %d)", region_x, region_y, region_z)); } diff --git a/indra/newview/llpanelface.cpp b/indra/newview/llpanelface.cpp index e3be1312e4..cc8b7d2a52 100755 --- a/indra/newview/llpanelface.cpp +++ b/indra/newview/llpanelface.cpp @@ -77,8 +77,6 @@ const S32 MATMEDIA_MEDIA = 1; // Media const S32 MATTYPE_DIFFUSE = 0; // Diffuse material texture const S32 MATTYPE_NORMAL = 1; // Normal map const S32 MATTYPE_SPECULAR = 2; // Specular map -const S32 ALPHAMODE_NONE = 0; // No alpha mask applied -const S32 ALPHAMODE_BLEND = 1; // Alpha blending mode const S32 ALPHAMODE_MASK = 2; // Alpha masking mode const S32 BUMPY_TEXTURE = 18; // use supplied normal map const S32 SHINY_TEXTURE = 4; // use supplied specular map @@ -1848,6 +1846,8 @@ void LLPanelFace::onCancelNormalTexture(const LLSD& data) U8 bumpy = 0; bool identical_bumpy = false; LLSelectedTE::getBumpmap(bumpy, identical_bumpy); + LLUUID spec_map_id = getChild<LLTextureCtrl>("bumpytexture control")->getImageAssetID(); + bumpy = spec_map_id.isNull() ? bumpy : BUMPY_TEXTURE; sendBump(bumpy); } diff --git a/indra/newview/llpanelgroupbulk.cpp b/indra/newview/llpanelgroupbulk.cpp index 1eafc5bd64..76792cc6fd 100644 --- a/indra/newview/llpanelgroupbulk.cpp +++ b/indra/newview/llpanelgroupbulk.cpp @@ -387,7 +387,7 @@ void LLPanelGroupBulk::addUsers(uuid_vec_t& agent_ids) } else { - llwarns << "llPanelGroupBulk: Selected avatar has no name: " << dest->getID() << llendl; + LL_WARNS() << "llPanelGroupBulk: Selected avatar has no name: " << dest->getID() << LL_ENDL; names.push_back("(Unknown)"); } } diff --git a/indra/newview/llpanelgroupinvite.cpp b/indra/newview/llpanelgroupinvite.cpp index 236ad861a5..e662a05dfc 100755 --- a/indra/newview/llpanelgroupinvite.cpp +++ b/indra/newview/llpanelgroupinvite.cpp @@ -492,7 +492,7 @@ void LLPanelGroupInvite::addUsers(uuid_vec_t& agent_ids) } else { - llwarns << "llPanelGroupInvite: Selected avatar has no name: " << dest->getID() << llendl; + LL_WARNS() << "llPanelGroupInvite: Selected avatar has no name: " << dest->getID() << LL_ENDL; names.push_back("(Unknown)"); } } diff --git a/indra/newview/llpanelgrouplandmoney.cpp b/indra/newview/llpanelgrouplandmoney.cpp index 375c54479d..7f82eecdb0 100755 --- a/indra/newview/llpanelgrouplandmoney.cpp +++ b/indra/newview/llpanelgrouplandmoney.cpp @@ -473,8 +473,8 @@ void LLPanelGroupLandMoney::impl::processGroupLand(LLMessageSystem* msg) land_type = LLTrans::getString("land_type_unknown"); } - S32 region_x = llround(global_x) % REGION_WIDTH_UNITS; - S32 region_y = llround(global_y) % REGION_WIDTH_UNITS; + S32 region_x = ll_round(global_x) % REGION_WIDTH_UNITS; + S32 region_y = ll_round(global_y) % REGION_WIDTH_UNITS; std::string location = sim_name + llformat(" (%d, %d)", region_x, region_y); std::string area; committed+=billable_area; diff --git a/indra/newview/llpanellandaudio.h b/indra/newview/llpanellandaudio.h index 32a45100f4..7e4fce80e4 100755 --- a/indra/newview/llpanellandaudio.h +++ b/indra/newview/llpanellandaudio.h @@ -51,7 +51,6 @@ private: LLCheckBoxCtrl* mCheckEstateDisabledVoice; LLCheckBoxCtrl* mCheckParcelVoiceLocal; LLLineEditor* mMusicURLEdit; - LLCheckBoxCtrl* mMusicUrlCheck; LLCheckBoxCtrl* mCheckAVSoundAny; LLCheckBoxCtrl* mCheckAVSoundGroup; diff --git a/indra/newview/llpanellandmarkinfo.cpp b/indra/newview/llpanellandmarkinfo.cpp index 63ddc05037..a660cb3b21 100755 --- a/indra/newview/llpanellandmarkinfo.cpp +++ b/indra/newview/llpanellandmarkinfo.cpp @@ -131,9 +131,9 @@ void LLPanelLandmarkInfo::setInfoType(EInfoType type) if (name.empty()) { - S32 region_x = llround(agent_pos.mV[VX]); - S32 region_y = llround(agent_pos.mV[VY]); - S32 region_z = llround(agent_pos.mV[VZ]); + S32 region_x = ll_round(agent_pos.mV[VX]); + S32 region_y = ll_round(agent_pos.mV[VY]); + S32 region_z = ll_round(agent_pos.mV[VZ]); std::string region_name; LLViewerRegion* region = parcel_mgr->getSelectionRegion(); diff --git a/indra/newview/llpanellandmedia.h b/indra/newview/llpanellandmedia.h index 0e6292a25e..63cfa01470 100755 --- a/indra/newview/llpanellandmedia.h +++ b/indra/newview/llpanellandmedia.h @@ -59,12 +59,10 @@ private: LLButton* mSetURLButton; LLSpinCtrl* mMediaHeightCtrl; LLSpinCtrl* mMediaWidthCtrl; - LLTextBox* mMediaResetCtrlLabel; LLTextBox* mMediaSizeCtrlLabel; LLTextureCtrl* mMediaTextureCtrl; LLCheckBoxCtrl* mMediaAutoScaleCheck; LLCheckBoxCtrl* mMediaLoopCheck; - LLCheckBoxCtrl* mMediaUrlCheck; LLHandle<LLFloater> mURLEntryFloater; diff --git a/indra/newview/llpanellogin.cpp b/indra/newview/llpanellogin.cpp index bbc3b85bf0..dd61929f35 100755 --- a/indra/newview/llpanellogin.cpp +++ b/indra/newview/llpanellogin.cpp @@ -75,9 +75,6 @@ #include "llsdserialize.h" -const S32 BLACK_BORDER_HEIGHT = 160; -const S32 MAX_PASSWORD = 16; - LLPanelLogin *LLPanelLogin::sInstance = NULL; BOOL LLPanelLogin::sCapslockDidNotification = FALSE; diff --git a/indra/newview/llpanelmaininventory.cpp b/indra/newview/llpanelmaininventory.cpp index a7c9dbdf7b..37273a7793 100755 --- a/indra/newview/llpanelmaininventory.cpp +++ b/indra/newview/llpanelmaininventory.cpp @@ -153,7 +153,9 @@ BOOL LLPanelMainInventory::postBuild() recent_items_panel->setSinceLogoff(TRUE); recent_items_panel->setSortOrder(LLInventoryFilter::SO_DATE); recent_items_panel->setShowFolderState(LLInventoryFilter::SHOW_NON_EMPTY_FOLDERS); - recent_items_panel->getFilter().markDefault(); + LLInventoryFilter& recent_filter = recent_items_panel->getFilter(); + recent_filter.setFilterObjectTypes(recent_filter.getFilterObjectTypes() & ~(0x1 << LLInventoryType::IT_CATEGORY)); + recent_filter.markDefault(); recent_items_panel->setSelectCallback(boost::bind(&LLPanelMainInventory::onSelectionChange, this, recent_items_panel, _1, _2)); } @@ -246,7 +248,7 @@ LLPanelMainInventory::~LLPanelMainInventory( void ) llofstream filtersFile(filterSaveName.str()); if(!LLSDSerialize::toPrettyXML(filterRoot, filtersFile)) { - LL_WARNS() << "Could not write to filters save file " << filterSaveName << LL_ENDL; + LL_WARNS() << "Could not write to filters save file " << filterSaveName.str() << LL_ENDL; } else filtersFile.close(); @@ -853,9 +855,9 @@ void LLFloaterInventoryFinder::draw() filtered_by_all_types = FALSE; } - if (!filtered_by_all_types) + if (!filtered_by_all_types || (mPanelMainInventory->getPanel()->getFilter().getFilterTypes() & LLInventoryFilter::FILTERTYPE_DATE)) { - // don't include folders in filter, unless I've selected everything + // don't include folders in filter, unless I've selected everything or filtering by date filter &= ~(0x1 << LLInventoryType::IT_CATEGORY); } diff --git a/indra/newview/llpanelobject.cpp b/indra/newview/llpanelobject.cpp index 9123252f4c..ba23e7013d 100755 --- a/indra/newview/llpanelobject.cpp +++ b/indra/newview/llpanelobject.cpp @@ -411,9 +411,9 @@ void LLPanelObject::getState( ) LLQuaternion object_rot = objectp->getRotationEdit(); object_rot.getEulerAngles(&(mCurEulerDegrees.mV[VX]), &(mCurEulerDegrees.mV[VY]), &(mCurEulerDegrees.mV[VZ])); mCurEulerDegrees *= RAD_TO_DEG; - mCurEulerDegrees.mV[VX] = fmod(llround(mCurEulerDegrees.mV[VX], OBJECT_ROTATION_PRECISION) + 360.f, 360.f); - mCurEulerDegrees.mV[VY] = fmod(llround(mCurEulerDegrees.mV[VY], OBJECT_ROTATION_PRECISION) + 360.f, 360.f); - mCurEulerDegrees.mV[VZ] = fmod(llround(mCurEulerDegrees.mV[VZ], OBJECT_ROTATION_PRECISION) + 360.f, 360.f); + mCurEulerDegrees.mV[VX] = fmod(ll_round(mCurEulerDegrees.mV[VX], OBJECT_ROTATION_PRECISION) + 360.f, 360.f); + mCurEulerDegrees.mV[VY] = fmod(ll_round(mCurEulerDegrees.mV[VY], OBJECT_ROTATION_PRECISION) + 360.f, 360.f); + mCurEulerDegrees.mV[VZ] = fmod(ll_round(mCurEulerDegrees.mV[VZ], OBJECT_ROTATION_PRECISION) + 360.f, 360.f); if (enable_rotate) { @@ -1567,9 +1567,9 @@ void LLPanelObject::sendRotation(BOOL btn_down) if (mObject.isNull()) return; LLVector3 new_rot(mCtrlRotX->get(), mCtrlRotY->get(), mCtrlRotZ->get()); - new_rot.mV[VX] = llround(new_rot.mV[VX], OBJECT_ROTATION_PRECISION); - new_rot.mV[VY] = llround(new_rot.mV[VY], OBJECT_ROTATION_PRECISION); - new_rot.mV[VZ] = llround(new_rot.mV[VZ], OBJECT_ROTATION_PRECISION); + new_rot.mV[VX] = ll_round(new_rot.mV[VX], OBJECT_ROTATION_PRECISION); + new_rot.mV[VY] = ll_round(new_rot.mV[VY], OBJECT_ROTATION_PRECISION); + new_rot.mV[VZ] = ll_round(new_rot.mV[VZ], OBJECT_ROTATION_PRECISION); // Note: must compare before conversion to radians LLVector3 delta = new_rot - mCurEulerDegrees; diff --git a/indra/newview/llpanelobjectinventory.cpp b/indra/newview/llpanelobjectinventory.cpp index 6b74d90708..6354b5a02b 100755 --- a/indra/newview/llpanelobjectinventory.cpp +++ b/indra/newview/llpanelobjectinventory.cpp @@ -698,6 +698,10 @@ void LLTaskInvFVBridge::buildContextMenu(LLMenuGL& menu, U32 flags) if(isItemRenameable()) { items.push_back(std::string("Task Rename")); + if ((flags & FIRST_SELECTED_ITEM) == 0) + { + disabled_items.push_back(std::string("Task Rename")); + } } if(isItemRemovable()) { diff --git a/indra/newview/llpanelpeople.h b/indra/newview/llpanelpeople.h index 55eaf74f74..c1d7a134fa 100755 --- a/indra/newview/llpanelpeople.h +++ b/indra/newview/llpanelpeople.h @@ -149,7 +149,6 @@ private: Updater* mFriendListUpdater; Updater* mNearbyListUpdater; Updater* mRecentListUpdater; - Updater* mFacebookListUpdater; Updater* mButtonsUpdater; LLHandle< LLFloater > mPicker; }; diff --git a/indra/newview/llpanelpick.cpp b/indra/newview/llpanelpick.cpp index 44cca21a76..8fa9aac024 100755 --- a/indra/newview/llpanelpick.cpp +++ b/indra/newview/llpanelpick.cpp @@ -284,9 +284,9 @@ std::string LLPanelPickInfo::createLocationText(const std::string& owner_name, c if (!pos_global.isNull()) { - S32 region_x = llround((F32)pos_global.mdV[VX]) % REGION_WIDTH_UNITS; - S32 region_y = llround((F32)pos_global.mdV[VY]) % REGION_WIDTH_UNITS; - S32 region_z = llround((F32)pos_global.mdV[VZ]); + S32 region_x = ll_round((F32)pos_global.mdV[VX]) % REGION_WIDTH_UNITS; + S32 region_y = ll_round((F32)pos_global.mdV[VY]) % REGION_WIDTH_UNITS; + S32 region_z = ll_round((F32)pos_global.mdV[VZ]); location_text.append(llformat(" (%d, %d, %d)", region_x, region_y, region_z)); } return location_text; diff --git a/indra/newview/llpanelplaceinfo.cpp b/indra/newview/llpanelplaceinfo.cpp index 4e7c5f6ed2..e62b5a4f1d 100755 --- a/indra/newview/llpanelplaceinfo.cpp +++ b/indra/newview/llpanelplaceinfo.cpp @@ -231,15 +231,15 @@ void LLPanelPlaceInfo::processParcelInfo(const LLParcelData& parcel_data) // If the region position is zero, grab position from the global if(mPosRegion.isExactlyZero()) { - region_x = llround(parcel_data.global_x) % REGION_WIDTH_UNITS; - region_y = llround(parcel_data.global_y) % REGION_WIDTH_UNITS; - region_z = llround(parcel_data.global_z); + region_x = ll_round(parcel_data.global_x) % REGION_WIDTH_UNITS; + region_y = ll_round(parcel_data.global_y) % REGION_WIDTH_UNITS; + region_z = ll_round(parcel_data.global_z); } else { - region_x = llround(mPosRegion.mV[VX]); - region_y = llround(mPosRegion.mV[VY]); - region_z = llround(mPosRegion.mV[VZ]); + region_x = ll_round(mPosRegion.mV[VX]); + region_y = ll_round(mPosRegion.mV[VY]); + region_z = ll_round(mPosRegion.mV[VZ]); } if (!parcel_data.name.empty()) diff --git a/indra/newview/llpanelplaceprofile.cpp b/indra/newview/llpanelplaceprofile.cpp index ed91d277dd..e853b2d050 100755 --- a/indra/newview/llpanelplaceprofile.cpp +++ b/indra/newview/llpanelplaceprofile.cpp @@ -551,7 +551,7 @@ void LLPanelPlaceProfile::displaySelectedParcelInfo(LLParcel* parcel, // Can't have more than region max tasks, regardless of parcel // object bonus factor. - S32 primitives = llmin(llround(parcel->getMaxPrimCapacity() * parcel->getParcelPrimBonus()), + S32 primitives = llmin(ll_round(parcel->getMaxPrimCapacity() * parcel->getParcelPrimBonus()), (S32)region->getMaxTasks()); const U8* available = (U8*)getString("available").c_str(); diff --git a/indra/newview/llpanelplaces.cpp b/indra/newview/llpanelplaces.cpp index 2be96b9b78..4bcd932d4b 100755 --- a/indra/newview/llpanelplaces.cpp +++ b/indra/newview/llpanelplaces.cpp @@ -75,7 +75,6 @@ #include "llviewerwindow.h" // Constants -static const S32 LANDMARK_FOLDERS_MENU_WIDTH = 250; static const F32 PLACE_INFO_UPDATE_INTERVAL = 3.0; static const std::string AGENT_INFO_TYPE = "agent"; static const std::string CREATE_LANDMARK_INFO_TYPE = "create_landmark"; diff --git a/indra/newview/llpanelprimmediacontrols.cpp b/indra/newview/llpanelprimmediacontrols.cpp index 7c0e448a99..f42df221e4 100755 --- a/indra/newview/llpanelprimmediacontrols.cpp +++ b/indra/newview/llpanelprimmediacontrols.cpp @@ -630,12 +630,12 @@ void LLPanelPrimMediaControls::updateShape() // convert screenspace bbox to pixels (in screen coords) LLRect window_rect = gViewerWindow->getWorldViewRectScaled(); LLCoordGL screen_min; - screen_min.mX = llround((F32)window_rect.mLeft + (F32)window_rect.getWidth() * (min.mV[VX] + 1.f) * 0.5f); - screen_min.mY = llround((F32)window_rect.mBottom + (F32)window_rect.getHeight() * (min.mV[VY] + 1.f) * 0.5f); + screen_min.mX = ll_round((F32)window_rect.mLeft + (F32)window_rect.getWidth() * (min.mV[VX] + 1.f) * 0.5f); + screen_min.mY = ll_round((F32)window_rect.mBottom + (F32)window_rect.getHeight() * (min.mV[VY] + 1.f) * 0.5f); LLCoordGL screen_max; - screen_max.mX = llround((F32)window_rect.mLeft + (F32)window_rect.getWidth() * (max.mV[VX] + 1.f) * 0.5f); - screen_max.mY = llround((F32)window_rect.mBottom + (F32)window_rect.getHeight() * (max.mV[VY] + 1.f) * 0.5f); + screen_max.mX = ll_round((F32)window_rect.mLeft + (F32)window_rect.getWidth() * (max.mV[VX] + 1.f) * 0.5f); + screen_max.mY = ll_round((F32)window_rect.mBottom + (F32)window_rect.getHeight() * (max.mV[VY] + 1.f) * 0.5f); // grow panel so that screenspace bounding box fits inside "media_region" element of panel LLRect media_panel_rect; diff --git a/indra/newview/llplacesinventorybridge.h b/indra/newview/llplacesinventorybridge.h index 07d18d03c5..108991210f 100755 --- a/indra/newview/llplacesinventorybridge.h +++ b/indra/newview/llplacesinventorybridge.h @@ -85,6 +85,8 @@ protected: class LLPlacesInventoryBridgeBuilder : public LLInventoryFolderViewModelBuilder { public: + LLPlacesInventoryBridgeBuilder() {} + /*virtual*/ LLInvFVBridge* createBridge(LLAssetType::EType asset_type, LLAssetType::EType actual_asset_type, LLInventoryType::EType inv_type, diff --git a/indra/newview/llpreviewscript.cpp b/indra/newview/llpreviewscript.cpp index 8eea5ea73e..5415c273e2 100755 --- a/indra/newview/llpreviewscript.cpp +++ b/indra/newview/llpreviewscript.cpp @@ -106,9 +106,6 @@ const std::string DEFAULT_SCRIPT_NAME = "New Script"; // *TODO:Translate? const std::string DEFAULT_SCRIPT_DESC = "(No Description)"; // *TODO:Translate? // Description and header information - -const S32 MAX_EXPORT_SIZE = 1000; - const S32 MAX_HISTORY_COUNT = 10; const F32 LIVE_HELP_REFRESH_TIME = 1.f; @@ -663,12 +660,13 @@ void LLScriptEdCore::updateDynamicHelp(BOOL immediate) LLTextSegmentPtr segment = NULL; std::vector<LLTextSegmentPtr> selected_segments; mEditor->getSelectedSegments(selected_segments); - + LLKeywordToken* token; // try segments in selection range first std::vector<LLTextSegmentPtr>::iterator segment_iter; for (segment_iter = selected_segments.begin(); segment_iter != selected_segments.end(); ++segment_iter) { - if((*segment_iter)->getToken() && (*segment_iter)->getToken()->getType() == LLKeywordToken::TT_WORD) + token = (*segment_iter)->getToken(); + if(token && isKeyword(token)) { segment = *segment_iter; break; @@ -679,7 +677,8 @@ void LLScriptEdCore::updateDynamicHelp(BOOL immediate) if (!segment) { const LLTextSegmentPtr test_segment = mEditor->getPreviousSegment(); - if(test_segment->getToken() && test_segment->getToken()->getType() == LLKeywordToken::TT_WORD) + token = test_segment->getToken(); + if(token && isKeyword(token)) { segment = test_segment; } @@ -708,6 +707,24 @@ void LLScriptEdCore::updateDynamicHelp(BOOL immediate) } } +bool LLScriptEdCore::isKeyword(LLKeywordToken* token) +{ + switch(token->getType()) + { + case LLKeywordToken::TT_CONSTANT: + case LLKeywordToken::TT_CONTROL: + case LLKeywordToken::TT_EVENT: + case LLKeywordToken::TT_FUNCTION: + case LLKeywordToken::TT_SECTION: + case LLKeywordToken::TT_TYPE: + case LLKeywordToken::TT_WORD: + return true; + + default: + return false; + } +} + void LLScriptEdCore::setHelpPage(const std::string& help_string) { LLFloater* help_floater = mLiveHelpHandle.get(); diff --git a/indra/newview/llpreviewscript.h b/indra/newview/llpreviewscript.h index 515f277c4a..66727bceee 100755 --- a/indra/newview/llpreviewscript.h +++ b/indra/newview/llpreviewscript.h @@ -133,6 +133,7 @@ protected: void deleteBridges(); void setHelpPage(const std::string& help_string); void updateDynamicHelp(BOOL immediate = FALSE); + bool isKeyword(LLKeywordToken* token); void addHelpItemToHistory(const std::string& help_string); static void onErrorList(LLUICtrl*, void* user_data); diff --git a/indra/newview/llscripteditor.cpp b/indra/newview/llscripteditor.cpp index 81920562a7..cd3a4dfd11 100644 --- a/indra/newview/llscripteditor.cpp +++ b/indra/newview/llscripteditor.cpp @@ -32,7 +32,6 @@ #include "lllocalcliprect.h" const S32 UI_TEXTEDITOR_LINE_NUMBER_MARGIN = 32; -const S32 UI_TEXTEDITOR_LINE_NUMBER_DIGITS = 4; static LLDefaultChildRegistry::Register<LLScriptEditor> r("script_editor"); diff --git a/indra/newview/llselectmgr.cpp b/indra/newview/llselectmgr.cpp index eb3a4c37d9..9e0bd9b6ed 100755 --- a/indra/newview/llselectmgr.cpp +++ b/indra/newview/llselectmgr.cpp @@ -99,14 +99,11 @@ LLViewerObject* getSelectedParentObject(LLViewerObject *object) ; // Consts // -const S32 NUM_SELECTION_UNDO_ENTRIES = 200; const F32 SILHOUETTE_UPDATE_THRESHOLD_SQUARED = 0.02f; -const S32 MAX_ACTION_QUEUE_SIZE = 20; const S32 MAX_SILS_PER_FRAME = 50; const S32 MAX_OBJECTS_PER_PACKET = 254; // For linked sets const S32 MAX_CHILDREN_PER_TASK = 255; -const S32 MAX_CHILDREN_PER_PHYSICAL_TASK = 32; // // Globals @@ -1941,7 +1938,7 @@ void LLSelectMgr::selectionSetMedia(U8 media_type, const LLSD &media_data) llassert(mMediaData.isMap()); const LLTextureEntry *texture_entry = object->getTE(te); if (!mMediaData.isMap() || - (NULL != texture_entry) && !texture_entry->hasMedia() && !mMediaData.has(LLMediaEntry::HOME_URL_KEY)) + ((NULL != texture_entry) && !texture_entry->hasMedia() && !mMediaData.has(LLMediaEntry::HOME_URL_KEY))) { // skip adding/updating media } diff --git a/indra/newview/llsidepanelappearance.h b/indra/newview/llsidepanelappearance.h index cde05a8d9b..440fce07bb 100755 --- a/indra/newview/llsidepanelappearance.h +++ b/indra/newview/llsidepanelappearance.h @@ -90,9 +90,6 @@ private: LLTextBox* mCurrentLookName; LLTextBox* mOutfitStatus; - // Used to make sure the user's inventory is in memory. - LLCurrentlyWornFetchObserver* mFetchWorn; - // Search string for filtering landmarks and teleport // history locations std::string mFilterSubString; diff --git a/indra/newview/llsidepanelinventory.cpp b/indra/newview/llsidepanelinventory.cpp index 4970eec636..0e23e2ad10 100755 --- a/indra/newview/llsidepanelinventory.cpp +++ b/indra/newview/llsidepanelinventory.cpp @@ -70,10 +70,7 @@ static LLPanelInjector<LLSidepanelInventory> t_inventory("sidepanel_inventory"); static const char * const INBOX_BUTTON_NAME = "inbox_btn"; static const char * const INBOX_LAYOUT_PANEL_NAME = "inbox_layout_panel"; -static const char * const MAIN_INVENTORY_LAYOUT_PANEL_NAME = "main_inventory_layout_panel"; - static const char * const INVENTORY_LAYOUT_STACK_NAME = "inventory_layout_stack"; - static const char * const MARKETPLACE_INBOX_PANEL = "marketplace_inbox"; // diff --git a/indra/newview/llslurl.cpp b/indra/newview/llslurl.cpp index 3a82233320..728fc69723 100755 --- a/indra/newview/llslurl.cpp +++ b/indra/newview/llslurl.cpp @@ -323,9 +323,9 @@ LLSLURL::LLSLURL(const std::string& grid, { mGrid = grid; mRegion = region; - S32 x = llround( (F32)fmod( position[VX], (F32)REGION_WIDTH_METERS ) ); - S32 y = llround( (F32)fmod( position[VY], (F32)REGION_WIDTH_METERS ) ); - S32 z = llround( (F32)position[VZ] ); + S32 x = ll_round( (F32)fmod( position[VX], (F32)REGION_WIDTH_METERS ) ); + S32 y = ll_round( (F32)fmod( position[VY], (F32)REGION_WIDTH_METERS ) ); + S32 z = ll_round( (F32)position[VZ] ); mType = LOCATION; mPosition = LLVector3(x, y, z); } @@ -379,9 +379,9 @@ std::string LLSLURL::getSLURLString() const case LOCATION: { // lookup the grid - S32 x = llround( (F32)mPosition[VX] ); - S32 y = llround( (F32)mPosition[VY] ); - S32 z = llround( (F32)mPosition[VZ] ); + S32 x = ll_round( (F32)mPosition[VX] ); + S32 y = ll_round( (F32)mPosition[VY] ); + S32 z = ll_round( (F32)mPosition[VZ] ); return LLGridManager::getInstance()->getSLURLBase(mGrid) + LLURI::escape(mRegion) + llformat("/%d/%d/%d",x,y,z); } @@ -416,9 +416,9 @@ std::string LLSLURL::getLoginString() const case LOCATION: unescaped_start << "uri:" << mRegion << "&" - << llround(mPosition[0]) << "&" - << llround(mPosition[1]) << "&" - << llround(mPosition[2]); + << ll_round(mPosition[0]) << "&" + << ll_round(mPosition[1]) << "&" + << ll_round(mPosition[2]); break; case HOME_LOCATION: unescaped_start << "home"; @@ -462,9 +462,9 @@ std::string LLSLURL::getLocationString() const { return llformat("%s/%d/%d/%d", mRegion.c_str(), - (int)llround(mPosition[0]), - (int)llround(mPosition[1]), - (int)llround(mPosition[2])); + (int)ll_round(mPosition[0]), + (int)ll_round(mPosition[1]), + (int)ll_round(mPosition[2])); } // static diff --git a/indra/newview/llsnapshotlivepreview.cpp b/indra/newview/llsnapshotlivepreview.cpp index 600ebf5914..ee5fd7cb71 100644 --- a/indra/newview/llsnapshotlivepreview.cpp +++ b/indra/newview/llsnapshotlivepreview.cpp @@ -177,14 +177,14 @@ void LLSnapshotLivePreview::updateSnapshot(BOOL new_snapshot, BOOL new_thumbnail if (image_aspect_ratio > window_aspect_ratio) { // trim off top and bottom - S32 new_height = llround((F32)getRect().getWidth() / image_aspect_ratio); + S32 new_height = ll_round((F32)getRect().getWidth() / image_aspect_ratio); rect.mBottom += (getRect().getHeight() - new_height) / 2; rect.mTop -= (getRect().getHeight() - new_height) / 2; } else if (image_aspect_ratio < window_aspect_ratio) { // trim off left and right - S32 new_width = llround((F32)getRect().getHeight() * image_aspect_ratio); + S32 new_width = ll_round((F32)getRect().getHeight() * image_aspect_ratio); rect.mLeft += (getRect().getWidth() - new_width) / 2; rect.mRight -= (getRect().getWidth() - new_width) / 2; } @@ -345,9 +345,9 @@ void LLSnapshotLivePreview::draw() LLLocalClipRect clip(getLocalRect()); { // draw diagonal stripe with gradient that passes over screen - S32 x1 = gViewerWindow->getWindowWidthScaled() * llround((clamp_rescale(shine_interp, 0.f, 1.f, -1.f - SHINE_WIDTH, 1.f))); - S32 x2 = x1 + llround(gViewerWindow->getWindowWidthScaled() * SHINE_WIDTH); - S32 x3 = x2 + llround(gViewerWindow->getWindowWidthScaled() * SHINE_WIDTH); + S32 x1 = gViewerWindow->getWindowWidthScaled() * ll_round((clamp_rescale(shine_interp, 0.f, 1.f, -1.f - SHINE_WIDTH, 1.f))); + S32 x2 = x1 + ll_round(gViewerWindow->getWindowWidthScaled() * SHINE_WIDTH); + S32 x3 = x2 + ll_round(gViewerWindow->getWindowWidthScaled() * SHINE_WIDTH); S32 y1 = 0; S32 y2 = gViewerWindow->getWindowHeightScaled(); @@ -429,7 +429,7 @@ void LLSnapshotLivePreview::draw() gGL.pushMatrix(); { LLRect& rect = mImageRect[old_image_index]; - gGL.translatef((F32)rect.mLeft, (F32)rect.mBottom - llround(getRect().getHeight() * 2.f * (fall_interp * fall_interp)), 0.f); + gGL.translatef((F32)rect.mLeft, (F32)rect.mBottom - ll_round(getRect().getHeight() * 2.f * (fall_interp * fall_interp)), 0.f); gGL.rotatef(-45.f * fall_interp, 0.f, 0.f, 1.f); gGL.begin(LLRender::QUADS); { @@ -483,13 +483,13 @@ BOOL LLSnapshotLivePreview::setThumbnailImageSize() { // image too wide, shrink to width mThumbnailWidth = max_width; - mThumbnailHeight = llround((F32)max_width / aspect_ratio); + mThumbnailHeight = ll_round((F32)max_width / aspect_ratio); } else { // image too tall, shrink to height mThumbnailHeight = max_height; - mThumbnailWidth = llround((F32)max_height * aspect_ratio); + mThumbnailWidth = ll_round((F32)max_height * aspect_ratio); } if (mThumbnailWidth > width || mThumbnailHeight > height) diff --git a/indra/newview/llspatialpartition.cpp b/indra/newview/llspatialpartition.cpp index 0a8257f42b..5e342099d7 100755 --- a/indra/newview/llspatialpartition.cpp +++ b/indra/newview/llspatialpartition.cpp @@ -1632,7 +1632,7 @@ void pushVertsColorCoded(LLSpatialGroup* group, U32 mask) { LLDrawInfo* params = NULL; - LLColor4 colors[] = { + static const LLColor4 colors[] = { LLColor4::green, LLColor4::green1, LLColor4::green2, diff --git a/indra/newview/llspeakers.cpp b/indra/newview/llspeakers.cpp index 89302c3c64..e80756e4de 100755 --- a/indra/newview/llspeakers.cpp +++ b/indra/newview/llspeakers.cpp @@ -544,10 +544,18 @@ void LLSpeakerMgr::updateSpeakerList() LLIMModel::LLIMSession* session = LLIMModel::getInstance()->findIMSession(session_id); if (session->isGroupSessionType() && (mSpeakers.size() <= 1)) { - const F32 load_group_timeout = gSavedSettings.getF32("ChatLoadGroupTimeout"); // For groups, we need to hit the group manager. // Note: The session uuid and the group uuid are actually one and the same. If that was to change, this will fail. LLGroupMgrGroupData* gdatap = LLGroupMgr::getInstance()->getGroupData(session_id); + F32 large_group_delay = 0.f; + if (gdatap) + { + //This is a viewer-side bandaid for maint-4414 it does not fix the core issue. + large_group_delay = (F32)(gdatap->mMemberCount / 5000); + } + + const F32 load_group_timeout = gSavedSettings.getF32("ChatLoadGroupTimeout") + large_group_delay; + if (!gdatap && (mGetListTime.getElapsedTimeF32() >= load_group_timeout)) { // Request the data the first time around diff --git a/indra/newview/llstatusbar.cpp b/indra/newview/llstatusbar.cpp index 7ca38fad03..5c1041e556 100755 --- a/indra/newview/llstatusbar.cpp +++ b/indra/newview/llstatusbar.cpp @@ -95,16 +95,11 @@ extern S32 MENU_BAR_HEIGHT; // TODO: these values ought to be in the XML too -const S32 MENU_PARCEL_SPACING = 1; // Distance from right of menu item to parcel information const S32 SIM_STAT_WIDTH = 8; -const F32 SIM_WARN_FRACTION = 0.75f; -const F32 SIM_FULL_FRACTION = 0.98f; const LLColor4 SIM_OK_COLOR(0.f, 1.f, 0.f, 1.f); const LLColor4 SIM_WARN_COLOR(1.f, 1.f, 0.f, 1.f); const LLColor4 SIM_FULL_COLOR(1.f, 0.f, 0.f, 1.f); const F32 ICON_TIMER_EXPIRY = 3.f; // How long the balance and health icons should flash after a change. -const F32 ICON_FLASH_FREQUENCY = 2.f; -const S32 TEXT_HEIGHT = 18; static void onClickVolume(void*); diff --git a/indra/newview/llsurface.cpp b/indra/newview/llsurface.cpp index e75af8db53..503dd6747d 100755 --- a/indra/newview/llsurface.cpp +++ b/indra/newview/llsurface.cpp @@ -1232,10 +1232,10 @@ BOOL LLSurface::generateWaterTexture(const F32 x, const F32 y, S32 x_begin, y_begin, x_end, y_end; - x_begin = llround(x * scale_inv); - y_begin = llround(y * scale_inv); - x_end = llround((x + width) * scale_inv); - y_end = llround((y + width) * scale_inv); + x_begin = ll_round(x * scale_inv); + y_begin = ll_round(y * scale_inv); + x_end = ll_round((x + width) * scale_inv); + y_end = ll_round((y + width) * scale_inv); if (x_end > tex_width) { @@ -1283,9 +1283,9 @@ BOOL LLSurface::generateWaterTexture(const F32 x, const F32 y, // Want non-linear curve for transparency gradient coloru = MAX_WATER_COLOR; const F32 frac = 1.f - 2.f/(2.f - (height - WATER_HEIGHT)); - S32 alpha = 64 + llround((255-64)*frac); + S32 alpha = 64 + ll_round((255-64)*frac); - alpha = llmin(llround((F32)MAX_WATER_COLOR.mV[3]), alpha); + alpha = llmin(ll_round((F32)MAX_WATER_COLOR.mV[3]), alpha); alpha = llmax(64, alpha); coloru.mV[3] = alpha; diff --git a/indra/newview/lltexturectrl.cpp b/indra/newview/lltexturectrl.cpp index c12753acb0..3e5b91c8fc 100755 --- a/indra/newview/lltexturectrl.cpp +++ b/indra/newview/lltexturectrl.cpp @@ -72,12 +72,6 @@ #include "llfloaterreg.h" #include "lllocalbitmaps.h" -static const S32 HPAD = 4; -static const S32 VPAD = 4; -static const S32 LINE = 16; -static const S32 FOOTER_HEIGHT = 100; -static const S32 BORDER_PAD = HPAD; -static const S32 TEXTURE_INVENTORY_PADDING = 30; static const F32 CONTEXT_CONE_IN_ALPHA = 0.0f; static const F32 CONTEXT_CONE_OUT_ALPHA = 1.f; static const F32 CONTEXT_FADE_TIME = 0.08f; @@ -118,7 +112,7 @@ public: /*virtual*/ void onClose(bool app_settings); // New functions - void setImageID( const LLUUID& image_asset_id); + void setImageID( const LLUUID& image_asset_id, bool set_selection = true); void updateImageStats(); const LLUUID& getAssetID() { return mImageAssetID; } const LLUUID& findItemID(const LLUUID& asset_id, BOOL copyable_only); @@ -232,7 +226,7 @@ LLFloaterTexturePicker::~LLFloaterTexturePicker() { } -void LLFloaterTexturePicker::setImageID(const LLUUID& image_id) +void LLFloaterTexturePicker::setImageID(const LLUUID& image_id, bool set_selection /*=true*/) { if( mImageAssetID != image_id && mActive) { @@ -253,6 +247,10 @@ void LLFloaterTexturePicker::setImageID(const LLUUID& image_id) getChild<LLUICtrl>("apply_immediate_check")->setValue(FALSE); mNoCopyTextureSelected = TRUE; } + } + + if (set_selection) + { mInventoryPanel->setSelection(item_id, TAKE_FOCUS_NO); } } @@ -461,7 +459,10 @@ BOOL LLFloaterTexturePicker::postBuild() // don't put keyboard focus on selected item, because the selection callback // will assume that this was user input - mInventoryPanel->setSelection(findItemID(mImageAssetID, FALSE), TAKE_FOCUS_NO); + if(!mImageAssetID.isNull()) + { + mInventoryPanel->setSelection(findItemID(mImageAssetID, FALSE), TAKE_FOCUS_NO); + } } mModeSelector = getChild<LLRadioGroup>("mode_selection"); @@ -820,7 +821,7 @@ void LLFloaterTexturePicker::onSelectionChange(const std::deque<LLFolderViewItem { mNoCopyTextureSelected = TRUE; } - setImageID(itemp->getAssetUUID()); + setImageID(itemp->getAssetUUID(),false); mViewModel->setDirty(); // *TODO: shouldn't we be using setValue() here? if (user_action && mCanPreview) { diff --git a/indra/newview/lltexturefetch.cpp b/indra/newview/lltexturefetch.cpp index acd4cf2d8d..fab4203ec3 100755 --- a/indra/newview/lltexturefetch.cpp +++ b/indra/newview/lltexturefetch.cpp @@ -340,7 +340,7 @@ private: // Threads: Ttf DecodeResponder(LLTextureFetch* fetcher, const LLUUID& id, LLTextureFetchWorker* worker) - : mFetcher(fetcher), mID(id), mWorker(worker) + : mFetcher(fetcher), mID(id) { } @@ -356,7 +356,6 @@ private: private: LLTextureFetch* mFetcher; LLUUID mID; - LLTextureFetchWorker* mWorker; // debug only (may get deleted from under us, use mFetcher/mID) }; struct Compare diff --git a/indra/newview/lltoastalertpanel.cpp b/indra/newview/lltoastalertpanel.cpp index c82894a5cc..0a9453534b 100755 --- a/indra/newview/lltoastalertpanel.cpp +++ b/indra/newview/lltoastalertpanel.cpp @@ -48,7 +48,6 @@ const S32 MAX_ALLOWED_MSG_WIDTH = 400; const F32 DEFAULT_BUTTON_DELAY = 0.5f; -const S32 MSG_PAD = 8; /*static*/ LLControlGroup* LLToastAlertPanel::sSettings = NULL; /*static*/ LLToastAlertPanel::URLLoader* LLToastAlertPanel::sURLLoader; diff --git a/indra/newview/lltoastgroupnotifypanel.h b/indra/newview/lltoastgroupnotifypanel.h index 431fd32da2..269c23798c 100755 --- a/indra/newview/lltoastgroupnotifypanel.h +++ b/indra/newview/lltoastgroupnotifypanel.h @@ -60,8 +60,6 @@ private: static const S32 DEFAULT_MESSAGE_MAX_LINE_COUNT; - LLButton* mSaveInventoryBtn; - LLUUID mGroupID; LLOfferInfo* mInventoryOffer; }; diff --git a/indra/newview/lltoolbrush.cpp b/indra/newview/lltoolbrush.cpp index e3eb8ba7af..0a0bfaf58b 100755 --- a/indra/newview/lltoolbrush.cpp +++ b/indra/newview/lltoolbrush.cpp @@ -65,8 +65,7 @@ const std::string REGION_BLOCKS_TERRAFORM_MSG = "This region does not allow terr const S32 LAND_BRUSH_SIZE_COUNT = 3; const F32 LAND_BRUSH_SIZE[LAND_BRUSH_SIZE_COUNT] = {1.0f, 2.0f, 4.0f}; -const S32 LAND_STEPS = 3; -const F32 LAND_METERS_PER_SECOND = 1.0f; + enum { E_LAND_LEVEL = 0, diff --git a/indra/newview/lltoolcomp.cpp b/indra/newview/lltoolcomp.cpp index 4bda9072d0..5a63f6e286 100755 --- a/indra/newview/lltoolcomp.cpp +++ b/indra/newview/lltoolcomp.cpp @@ -52,14 +52,8 @@ #include "llfloatertools.h" #include "llviewercontrol.h" -const S32 BUTTON_HEIGHT = 16; -const S32 BUTTON_WIDTH_SMALL = 32; -const S32 BUTTON_WIDTH_BIG = 48; -const S32 HPAD = 4; - extern LLControlGroup gSavedSettings; - // we use this in various places instead of NULL static LLPointer<LLTool> sNullTool(new LLTool(std::string("null"), NULL)); diff --git a/indra/newview/lltooldraganddrop.cpp b/indra/newview/lltooldraganddrop.cpp index 575e5c5c52..e8f6c35662 100755 --- a/indra/newview/lltooldraganddrop.cpp +++ b/indra/newview/lltooldraganddrop.cpp @@ -947,8 +947,7 @@ void LLToolDragAndDrop::pick(const LLPickInfo& pick_info) const S32 item_index = mCurItemIndex; const EDragAndDropType dad_type = mCargoTypes[item_index]; // Call the right implementation function - (U32)callMemberFunction(*this, - LLDragAndDropDictionary::instance().get(dad_type, target)) + callMemberFunction(*this, LLDragAndDropDictionary::instance().get(dad_type, target)) (hit_obj, hit_face, pick_info.mKeyMask, TRUE); } } @@ -2173,23 +2172,20 @@ EAcceptance LLToolDragAndDrop::dad3dWearCategory( } U32 max_items = gSavedSettings.getU32("WearFolderLimit"); - if (category->getDescendentCount()>max_items) - { - LLInventoryModel::cat_array_t cats; - LLInventoryModel::item_array_t items; - LLFindWearablesEx not_worn(/*is_worn=*/ false, /*include_body_parts=*/ false); - gInventory.collectDescendentsIf(category->getUUID(), - cats, - items, - LLInventoryModel::EXCLUDE_TRASH, - not_worn); - if (items.size() > max_items) - { - LLStringUtil::format_map_t args; - args["AMOUNT"] = llformat("%d", max_items); - mCustomMsg = LLTrans::getString("TooltipTooManyWearables",args); - return ACCEPT_NO_CUSTOM; - } + LLInventoryModel::cat_array_t cats; + LLInventoryModel::item_array_t items; + LLFindWearablesEx not_worn(/*is_worn=*/ false, /*include_body_parts=*/ false); + gInventory.collectDescendentsIf(category->getUUID(), + cats, + items, + LLInventoryModel::EXCLUDE_TRASH, + not_worn); + if (items.size() > max_items) + { + LLStringUtil::format_map_t args; + args["AMOUNT"] = llformat("%d", max_items); + mCustomMsg = LLTrans::getString("TooltipTooManyWearables",args); + return ACCEPT_NO_CUSTOM; } if(mSource == SOURCE_AGENT) diff --git a/indra/newview/lltoolfocus.cpp b/indra/newview/lltoolfocus.cpp index 58073d1186..7de91c7757 100755 --- a/indra/newview/lltoolfocus.cpp +++ b/indra/newview/lltoolfocus.cpp @@ -61,7 +61,6 @@ BOOL gCameraBtnOrbit = FALSE; BOOL gCameraBtnPan = FALSE; const S32 SLOP_RANGE = 4; -const F32 FOCUS_OFFSET_FACTOR = 1.f; // // Camera - shared functionality diff --git a/indra/newview/lltoolselectland.cpp b/indra/newview/lltoolselectland.cpp index 44c0cb3124..ff991dc9fd 100755 --- a/indra/newview/lltoolselectland.cpp +++ b/indra/newview/lltoolselectland.cpp @@ -219,8 +219,8 @@ void LLToolSelectLand::handleDeselect() void LLToolSelectLand::roundXY(LLVector3d &vec) { - vec.mdV[VX] = llround( vec.mdV[VX], (F64)PARCEL_GRID_STEP_METERS ); - vec.mdV[VY] = llround( vec.mdV[VY], (F64)PARCEL_GRID_STEP_METERS ); + vec.mdV[VX] = ll_round( vec.mdV[VX], (F64)PARCEL_GRID_STEP_METERS ); + vec.mdV[VY] = ll_round( vec.mdV[VY], (F64)PARCEL_GRID_STEP_METERS ); } diff --git a/indra/newview/lltwitterconnect.cpp b/indra/newview/lltwitterconnect.cpp index 7088558b83..e983bc883f 100644 --- a/indra/newview/lltwitterconnect.cpp +++ b/indra/newview/lltwitterconnect.cpp @@ -397,7 +397,7 @@ void LLTwitterConnect::uploadPhoto(LLPointer<LLImageFormatted> image, const std: } else { - llwarns << "Image to upload is not a PNG or JPEG" << llendl; + LL_WARNS() << "Image to upload is not a PNG or JPEG" << LL_ENDL; return; } diff --git a/indra/newview/llversioninfo.cpp b/indra/newview/llversioninfo.cpp index 6a8fad0134..5cc7d7bed3 100755 --- a/indra/newview/llversioninfo.cpp +++ b/indra/newview/llversioninfo.cpp @@ -38,8 +38,6 @@ #error "Channel or Version information is undefined" #endif -const char * const LL_CHANNEL = LL_VIEWER_CHANNEL; - // // Set the version numbers in indra/VIEWER_VERSION // diff --git a/indra/newview/llviewercontrol.cpp b/indra/newview/llviewercontrol.cpp index 5020518454..c6eae68083 100755 --- a/indra/newview/llviewercontrol.cpp +++ b/indra/newview/llviewercontrol.cpp @@ -167,11 +167,6 @@ static bool handleRenderPerfTestChanged(const LLSD& newvalue) return true; } -bool handleRenderAvatarComplexityLimitChanged(const LLSD& newvalue) -{ - return true; -} - bool handleRenderTransparentWaterChanged(const LLSD& newvalue) { LLWorld::getInstance()->updateWaterObjects(); @@ -636,7 +631,6 @@ void settings_setup_listeners() gSavedSettings.getControl("WindLightUseAtmosShaders")->getSignal()->connect(boost::bind(&handleSetShaderChanged, _2)); gSavedSettings.getControl("RenderGammaFull")->getSignal()->connect(boost::bind(&handleSetShaderChanged, _2)); gSavedSettings.getControl("RenderAvatarMaxVisible")->getSignal()->connect(boost::bind(&handleAvatarMaxVisibleChanged, _2)); - gSavedSettings.getControl("RenderAvatarComplexityLimit")->getSignal()->connect(boost::bind(&handleRenderAvatarComplexityLimitChanged, _2)); gSavedSettings.getControl("RenderVolumeLODFactor")->getSignal()->connect(boost::bind(&handleVolumeLODChanged, _2)); gSavedSettings.getControl("RenderAvatarLODFactor")->getSignal()->connect(boost::bind(&handleAvatarLODChanged, _2)); gSavedSettings.getControl("RenderAvatarPhysicsLODFactor")->getSignal()->connect(boost::bind(&handleAvatarPhysicsLODChanged, _2)); diff --git a/indra/newview/llviewerdisplay.cpp b/indra/newview/llviewerdisplay.cpp index 981e4c40aa..cd9b2ed11b 100755 --- a/indra/newview/llviewerdisplay.cpp +++ b/indra/newview/llviewerdisplay.cpp @@ -1176,8 +1176,8 @@ LLRect get_whole_screen_region() if (zoom_factor > 1.f) { S32 num_horizontal_tiles = llceil(zoom_factor); - S32 tile_width = llround((F32)gViewerWindow->getWorldViewWidthScaled() / zoom_factor); - S32 tile_height = llround((F32)gViewerWindow->getWorldViewHeightScaled() / zoom_factor); + S32 tile_width = ll_round((F32)gViewerWindow->getWorldViewWidthScaled() / zoom_factor); + S32 tile_height = ll_round((F32)gViewerWindow->getWorldViewHeightScaled() / zoom_factor); int tile_y = sub_region / num_horizontal_tiles; int tile_x = sub_region - (tile_y * num_horizontal_tiles); @@ -1471,8 +1471,8 @@ void render_ui_2d() int pos_y = sub_region / llceil(zoom_factor); int pos_x = sub_region - (pos_y*llceil(zoom_factor)); // offset for this tile - LLFontGL::sCurOrigin.mX -= llround((F32)gViewerWindow->getWindowWidthScaled() * (F32)pos_x / zoom_factor); - LLFontGL::sCurOrigin.mY -= llround((F32)gViewerWindow->getWindowHeightScaled() * (F32)pos_y / zoom_factor); + LLFontGL::sCurOrigin.mX -= ll_round((F32)gViewerWindow->getWindowWidthScaled() * (F32)pos_x / zoom_factor); + LLFontGL::sCurOrigin.mY -= ll_round((F32)gViewerWindow->getWindowHeightScaled() * (F32)pos_y / zoom_factor); } stop_glerror(); diff --git a/indra/newview/llviewerinventory.cpp b/indra/newview/llviewerinventory.cpp index d364fce45a..d6c8ba10f6 100755 --- a/indra/newview/llviewerinventory.cpp +++ b/indra/newview/llviewerinventory.cpp @@ -1456,7 +1456,8 @@ void update_inventory_category( void remove_inventory_items( LLInventoryObject::object_list_t& items_to_kill, - LLPointer<LLInventoryCallback> cb) + LLPointer<LLInventoryCallback> cb + ) { for (LLInventoryObject::object_list_t::iterator it = items_to_kill.begin(); it != items_to_kill.end(); @@ -1468,12 +1469,13 @@ void remove_inventory_items( void remove_inventory_item( const LLUUID& item_id, - LLPointer<LLInventoryCallback> cb) + LLPointer<LLInventoryCallback> cb, + bool immediate_delete) { LLPointer<LLInventoryObject> obj = gInventory.getItem(item_id); if (obj) { - remove_inventory_item(obj, cb); + remove_inventory_item(obj, cb, immediate_delete); } else { @@ -1483,7 +1485,8 @@ void remove_inventory_item( void remove_inventory_item( LLPointer<LLInventoryObject> obj, - LLPointer<LLInventoryCallback> cb) + LLPointer<LLInventoryCallback> cb, + bool immediate_delete) { if(obj) { @@ -1493,6 +1496,11 @@ void remove_inventory_item( { LLPointer<AISCommand> cmd_ptr = new RemoveItemCommand(item_id, cb); cmd_ptr->run_command(); + + if (immediate_delete) + { + gInventory.onObjectDeletedFromServer(item_id); + } } else // no cap { diff --git a/indra/newview/llviewerinventory.h b/indra/newview/llviewerinventory.h index d345c49cfb..ca92565600 100755 --- a/indra/newview/llviewerinventory.h +++ b/indra/newview/llviewerinventory.h @@ -394,11 +394,13 @@ void remove_inventory_items( void remove_inventory_item( LLPointer<LLInventoryObject> obj, - LLPointer<LLInventoryCallback> cb); + LLPointer<LLInventoryCallback> cb, + bool immediate_delete = false); void remove_inventory_item( const LLUUID& item_id, - LLPointer<LLInventoryCallback> cb); + LLPointer<LLInventoryCallback> cb, + bool immediate_delete = false); void remove_inventory_category( const LLUUID& cat_id, diff --git a/indra/newview/llviewerkeyboard.cpp b/indra/newview/llviewerkeyboard.cpp index b0f4802e20..9b8c913c6b 100755 --- a/indra/newview/llviewerkeyboard.cpp +++ b/indra/newview/llviewerkeyboard.cpp @@ -53,7 +53,6 @@ const F32 FLY_FRAMES = 4; const F32 NUDGE_TIME = 0.25f; // in seconds const S32 NUDGE_FRAMES = 2; const F32 ORBIT_NUDGE_RATE = 0.05f; // fraction of normal speed -const F32 YAW_NUDGE_RATE = 0.05f; // fraction of normal speed struct LLKeyboardActionRegistry : public LLRegistrySingleton<std::string, boost::function<void (EKeystate keystate)>, LLKeyboardActionRegistry> @@ -66,7 +65,7 @@ void agent_jump( EKeystate s ) { if( KEYSTATE_UP == s ) return; F32 time = gKeyboard->getCurKeyElapsedTime(); - S32 frame_count = llround(gKeyboard->getCurKeyElapsedFrameCount()); + S32 frame_count = ll_round(gKeyboard->getCurKeyElapsedFrameCount()); if( time < FLY_TIME || frame_count <= FLY_FRAMES @@ -88,18 +87,25 @@ void agent_push_down( EKeystate s ) gAgent.moveUp(-1); } +static void agent_check_temporary_run(LLAgent::EDoubleTapRunMode mode) +{ + if (gAgent.mDoubleTapRunMode == mode && + gAgent.getRunning() && + !gAgent.getAlwaysRun()) + { + // Turn off temporary running. + gAgent.clearRunning(); + gAgent.sendWalkRun(gAgent.getRunning()); + } +} + static void agent_handle_doubletap_run(EKeystate s, LLAgent::EDoubleTapRunMode mode) { if (KEYSTATE_UP == s) { - if (gAgent.mDoubleTapRunMode == mode && - gAgent.getRunning() && - !gAgent.getAlwaysRun()) - { - // Turn off temporary running. - gAgent.clearRunning(); - gAgent.sendWalkRun(gAgent.getRunning()); - } + // Note: in case shift is already released, slide left/right run + // will be released in agent_turn_left()/agent_turn_right() + agent_check_temporary_run(mode); } else if (gSavedSettings.getBOOL("AllowTapTapHoldRun") && KEYSTATE_DOWN == s && @@ -126,7 +132,7 @@ static void agent_push_forwardbackward( EKeystate s, S32 direction, LLAgent::EDo if (KEYSTATE_UP == s) return; F32 time = gKeyboard->getCurKeyElapsedTime(); - S32 frame_count = llround(gKeyboard->getCurKeyElapsedFrameCount()); + S32 frame_count = ll_round(gKeyboard->getCurKeyElapsedFrameCount()); if( time < NUDGE_TIME || frame_count <= NUDGE_FRAMES) { @@ -177,7 +183,7 @@ static void agent_slide_leftright( EKeystate s, S32 direction, LLAgent::EDoubleT agent_handle_doubletap_run(s, mode); if( KEYSTATE_UP == s ) return; F32 time = gKeyboard->getCurKeyElapsedTime(); - S32 frame_count = llround(gKeyboard->getCurKeyElapsedFrameCount()); + S32 frame_count = ll_round(gKeyboard->getCurKeyElapsedFrameCount()); if( time < NUDGE_TIME || frame_count <= NUDGE_FRAMES) { @@ -218,7 +224,12 @@ void agent_turn_left( EKeystate s ) } else { - if (KEYSTATE_UP == s) return; + if (KEYSTATE_UP == s) + { + // Check temporary running. In case user released 'left' key with shift already released. + agent_check_temporary_run(LLAgent::DOUBLETAP_SLIDELEFT); + return; + } F32 time = gKeyboard->getCurKeyElapsedTime(); gAgent.moveYaw( LLFloaterMove::getYawRate( time ) ); } @@ -241,7 +252,12 @@ void agent_turn_right( EKeystate s ) } else { - if (KEYSTATE_UP == s) return; + if (KEYSTATE_UP == s) + { + // Check temporary running. In case user released 'right' key with shift already released. + agent_check_temporary_run(LLAgent::DOUBLETAP_SLIDERIGHT); + return; + } F32 time = gKeyboard->getCurKeyElapsedTime(); gAgent.moveYaw( -LLFloaterMove::getYawRate( time ) ); } diff --git a/indra/newview/llviewermedia.cpp b/indra/newview/llviewermedia.cpp index 8499012cfc..a1451d770a 100755 --- a/indra/newview/llviewermedia.cpp +++ b/indra/newview/llviewermedia.cpp @@ -924,7 +924,7 @@ void LLViewerMedia::updateMedia(void *dummy_arg) { F32 approximate_interest_dimension = (F32) sqrt(pimpl->getInterest()); - pimpl->setLowPrioritySizeLimit(llround(approximate_interest_dimension)); + pimpl->setLowPrioritySizeLimit(ll_round(approximate_interest_dimension)); } } else @@ -2330,8 +2330,8 @@ void LLViewerMediaImpl::scaleTextureCoords(const LLVector2& texture_coords, S32 texture_y = 1.0 + texture_y; // scale x and y to texel units. - *x = llround(texture_x * mMediaSource->getTextureWidth()); - *y = llround((1.0f - texture_y) * mMediaSource->getTextureHeight()); + *x = ll_round(texture_x * mMediaSource->getTextureWidth()); + *y = ll_round((1.0f - texture_y) * mMediaSource->getTextureHeight()); // Adjust for the difference between the actual texture height and the amount of the texture in use. *y -= (mMediaSource->getTextureHeight() - mMediaSource->getHeight()); diff --git a/indra/newview/llviewermessage.cpp b/indra/newview/llviewermessage.cpp index 44eb4361f1..762f75edd4 100755 --- a/indra/newview/llviewermessage.cpp +++ b/indra/newview/llviewermessage.cpp @@ -128,10 +128,7 @@ extern void on_new_message(const LLSD& msg); // // Constants // -const F32 BIRD_AUDIBLE_RADIUS = 32.0f; -const F32 SIT_DISTANCE_FROM_TARGET = 0.25f; const F32 CAMERA_POSITION_THRESHOLD_SQUARED = 0.001f * 0.001f; -static const F32 LOGOUT_REPLY_TIME = 3.f; // Wait this long after LogoutReply before quitting. // Determine how quickly residents' scripts can issue question dialogs // Allow bursts of up to 5 dialogs in 10 seconds. 10*2=20 seconds recovery if throttle kicks in @@ -2411,7 +2408,7 @@ void process_improved_im(LLMessageSystem *msg, void **user_data) BOOL is_do_not_disturb = gAgent.isDoNotDisturb(); BOOL is_muted = LLMuteList::getInstance()->isMuted(from_id, name, LLMute::flagTextChat) // object IMs contain sender object id in session_id (STORM-1209) - || dialog == IM_FROM_TASK && LLMuteList::getInstance()->isMuted(session_id); + || (dialog == IM_FROM_TASK && LLMuteList::getInstance()->isMuted(session_id)); BOOL is_owned_by_me = FALSE; BOOL is_friend = (LLAvatarTracker::instance().getBuddyInfo(from_id) == NULL) ? false : true; BOOL accept_im_from_only_friend = gSavedSettings.getBOOL("VoiceCallsFriendsOnly"); @@ -5116,7 +5113,7 @@ void process_avatar_sit_response(LLMessageSystem *mesgsys, void **user_data) if (object) { LLVector3 sit_spot = object->getPositionAgent() + (sitPosition * object->getRotation()); - if (!use_autopilot || isAgentAvatarValid() && gAgentAvatarp->isSitting() && gAgentAvatarp->getRoot() == object->getRoot()) + if (!use_autopilot || (isAgentAvatarValid() && gAgentAvatarp->isSitting() && gAgentAvatarp->getRoot() == object->getRoot())) { //we're already sitting on this object, so don't autopilot } @@ -7117,8 +7114,6 @@ void process_user_info_reply(LLMessageSystem* msg, void**) //--------------------------------------------------------------------------- const S32 SCRIPT_DIALOG_MAX_BUTTONS = 12; -const S32 SCRIPT_DIALOG_BUTTON_STR_SIZE = 24; -const S32 SCRIPT_DIALOG_MAX_MESSAGE_SIZE = 512; const char* SCRIPT_DIALOG_HEADER = "Script Dialog:\n"; bool callback_script_dialog(const LLSD& notification, const LLSD& response) diff --git a/indra/newview/llviewerobject.cpp b/indra/newview/llviewerobject.cpp index 2f6283c8d0..7cdf6a79b7 100755 --- a/indra/newview/llviewerobject.cpp +++ b/indra/newview/llviewerobject.cpp @@ -359,10 +359,17 @@ void LLViewerObject::markDead() //LL_INFOS() << "Marking self " << mLocalID << " as dead." << LL_ENDL; // Root object of this hierarchy unlinks itself. + LLVOAvatar *av = getAvatarAncestor(); if (getParent()) { ((LLViewerObject *)getParent())->removeChild(this); } + LLUUID mesh_id; + if (av && LLVOAvatar::getRiggedMeshID(this,mesh_id)) + { + // This case is needed for indirectly attached mesh objects. + av->resetJointPositionsOnDetach(mesh_id); + } // Mark itself as dead mDead = TRUE; @@ -2274,7 +2281,7 @@ U32 LLViewerObject::processUpdateMessage(LLMessageSystem *mesgsys, } } - if ((new_rot != getRotation()) + if ((new_rot.isNotEqualEps(getRotation(), F_ALMOST_ZERO)) || (new_angv != old_angv)) { if (new_rot != mPreviousRotation) @@ -5011,6 +5018,22 @@ LLVOAvatar* LLViewerObject::asAvatar() return NULL; } +// If this object is directly or indirectly parented by an avatar, return it. +LLVOAvatar* LLViewerObject::getAvatarAncestor() +{ + LLViewerObject *pobj = (LLViewerObject*) getParent(); + while (pobj) + { + LLVOAvatar *av = pobj->asAvatar(); + if (av) + { + return av; + } + pobj = (LLViewerObject*) pobj->getParent(); + } + return NULL; +} + BOOL LLViewerObject::isParticleSource() const { return !mPartSourcep.isNull() && !mPartSourcep->isDead(); @@ -6198,6 +6221,17 @@ const LLUUID &LLViewerObject::extractAttachmentItemID() return getAttachmentItemID(); } +const std::string& LLViewerObject::getAttachmentItemName() +{ + static std::string empty; + LLInventoryItem *item = gInventory.getItem(getAttachmentItemID()); + if (isAttachment() && item) + { + return item->getName(); + } + return empty; +} + //virtual LLVOAvatar* LLViewerObject::getAvatar() const { diff --git a/indra/newview/llviewerobject.h b/indra/newview/llviewerobject.h index e7ae0af32a..fe020a3270 100755 --- a/indra/newview/llviewerobject.h +++ b/indra/newview/llviewerobject.h @@ -135,6 +135,8 @@ public: virtual LLVOAvatar* asAvatar(); + LLVOAvatar* getAvatarAncestor(); + static void initVOClasses(); static void cleanupVOClasses(); @@ -170,6 +172,8 @@ public: void setOnActiveList(BOOL on_active) { mOnActiveList = on_active; } virtual BOOL isAttachment() const { return FALSE; } + const std::string& getAttachmentItemName(); + virtual LLVOAvatar* getAvatar() const; //get the avatar this object is attached to, or NULL if object is not an attachment virtual BOOL isHUDAttachment() const { return FALSE; } virtual BOOL isTempAttachment() const; diff --git a/indra/newview/llviewerparcelmgr.cpp b/indra/newview/llviewerparcelmgr.cpp index 7c94442f09..e85d8198aa 100755 --- a/indra/newview/llviewerparcelmgr.cpp +++ b/indra/newview/llviewerparcelmgr.cpp @@ -281,7 +281,7 @@ S32 LLViewerParcelMgr::getSelectedArea() const F64 width = mEastNorth.mdV[VX] - mWestSouth.mdV[VX]; F64 height = mEastNorth.mdV[VY] - mWestSouth.mdV[VY]; F32 area = (F32)(width * height); - rv = llround(area); + rv = ll_round(area); } return rv; } @@ -301,10 +301,10 @@ void LLViewerParcelMgr::writeHighlightSegments(F32 west, F32 south, F32 east, F32 north) { S32 x, y; - S32 min_x = llround( west / PARCEL_GRID_STEP_METERS ); - S32 max_x = llround( east / PARCEL_GRID_STEP_METERS ); - S32 min_y = llround( south / PARCEL_GRID_STEP_METERS ); - S32 max_y = llround( north / PARCEL_GRID_STEP_METERS ); + S32 min_x = ll_round( west / PARCEL_GRID_STEP_METERS ); + S32 max_x = ll_round( east / PARCEL_GRID_STEP_METERS ); + S32 min_y = ll_round( south / PARCEL_GRID_STEP_METERS ); + S32 max_y = ll_round( north / PARCEL_GRID_STEP_METERS ); const S32 STRIDE = mParcelsPerEdge+1; @@ -416,12 +416,12 @@ LLParcelSelectionHandle LLViewerParcelMgr::selectParcelAt(const LLVector3d& pos_ LLVector3d northeast = pos_global; southwest -= LLVector3d( PARCEL_GRID_STEP_METERS/2, PARCEL_GRID_STEP_METERS/2, 0 ); - southwest.mdV[VX] = llround( southwest.mdV[VX], (F64)PARCEL_GRID_STEP_METERS ); - southwest.mdV[VY] = llround( southwest.mdV[VY], (F64)PARCEL_GRID_STEP_METERS ); + southwest.mdV[VX] = ll_round( southwest.mdV[VX], (F64)PARCEL_GRID_STEP_METERS ); + southwest.mdV[VY] = ll_round( southwest.mdV[VY], (F64)PARCEL_GRID_STEP_METERS ); northeast += LLVector3d( PARCEL_GRID_STEP_METERS/2, PARCEL_GRID_STEP_METERS/2, 0 ); - northeast.mdV[VX] = llround( northeast.mdV[VX], (F64)PARCEL_GRID_STEP_METERS ); - northeast.mdV[VY] = llround( northeast.mdV[VY], (F64)PARCEL_GRID_STEP_METERS ); + northeast.mdV[VX] = ll_round( northeast.mdV[VX], (F64)PARCEL_GRID_STEP_METERS ); + northeast.mdV[VY] = ll_round( northeast.mdV[VY], (F64)PARCEL_GRID_STEP_METERS ); // Snap to parcel return selectLand( southwest, northeast, TRUE ); diff --git a/indra/newview/llviewerpartsim.cpp b/indra/newview/llviewerpartsim.cpp index 76418ad6a6..230bdca4ef 100755 --- a/indra/newview/llviewerpartsim.cpp +++ b/indra/newview/llviewerpartsim.cpp @@ -42,8 +42,6 @@ #include "llvovolume.h" const F32 PART_SIM_BOX_SIDE = 16.f; -const F32 PART_SIM_BOX_OFFSET = 0.5f*PART_SIM_BOX_SIDE; -const F32 PART_SIM_BOX_RAD = 0.5f*F_SQRT3*PART_SIM_BOX_SIDE; //static S32 LLViewerPartSim::sMaxParticleCount = 0; @@ -311,7 +309,6 @@ void LLViewerPartGroup::updateParticles(const F32 lastdt) if (part->mFlags & LLPartData::LL_PART_WIND_MASK) { - LLVector3 tempVel(part->mVelocity); part->mVelocity *= 1.f - 0.1f*dt; part->mVelocity += 0.1f*dt*regionp->mWind.getVelocity(regionp->getPosRegionFromAgent(part->mPosAgent)); } @@ -391,7 +388,7 @@ void LLViewerPartGroup::updateParticles(const F32 lastdt) } // Do glow interpolation - part->mGlow.mV[3] = (U8) llround(lerp(part->mStartGlow, part->mEndGlow, frac)*255.f); + part->mGlow.mV[3] = (U8) ll_round(lerp(part->mStartGlow, part->mEndGlow, frac)*255.f); // Set the last update time to now. part->mLastUpdateTime = cur_time; diff --git a/indra/newview/llviewerpartsource.cpp b/indra/newview/llviewerpartsource.cpp index a7fd2e0fe4..7efa821bbf 100755 --- a/indra/newview/llviewerpartsource.cpp +++ b/indra/newview/llviewerpartsource.cpp @@ -313,7 +313,7 @@ void LLViewerPartSourceScript::update(const F32 dt) part->mStartGlow = mPartSysData.mPartData.mStartGlow; part->mEndGlow = mPartSysData.mPartData.mEndGlow; - part->mGlow = LLColor4U(0, 0, 0, (U8) llround(part->mStartGlow*255.f)); + part->mGlow = LLColor4U(0, 0, 0, (U8) ll_round(part->mStartGlow*255.f)); if (mPartSysData.mPattern & LLPartSysData::LL_PART_SRC_PATTERN_DROP) { diff --git a/indra/newview/llviewerregion.cpp b/indra/newview/llviewerregion.cpp index 31493ca6ce..af6ff79c61 100755 --- a/indra/newview/llviewerregion.cpp +++ b/indra/newview/llviewerregion.cpp @@ -87,8 +87,6 @@ // out the two lists of capabilities for analysis. //#define DEBUG_CAPS_GRANTS -const F32 WATER_TEXTURE_SCALE = 8.f; // Number of times to repeat the water texture across a region -const S16 MAX_MAP_DIST = 10; // The server only keeps our pending agent info for 60 seconds. // We want to allow for seed cap retry, but its not useful after that 60 seconds. // Give it 3 chances, each at 18 seconds to give ourselves a few seconds to connect anyways if we give up. @@ -1923,7 +1921,6 @@ public: } else if( i != you_index) { - U32 loc = x << 16 | y << 8 | z; loc = loc; U32 pos = 0x0; pos |= x; pos <<= 8; diff --git a/indra/newview/llviewertexlayer.cpp b/indra/newview/llviewertexlayer.cpp index 65ba3fb6e5..66e5742911 100755 --- a/indra/newview/llviewertexlayer.cpp +++ b/indra/newview/llviewertexlayer.cpp @@ -39,9 +39,6 @@ #include "pipeline.h" #include "llviewercontrol.h" -static const S32 BAKE_UPLOAD_ATTEMPTS = 7; -static const F32 BAKE_UPLOAD_RETRY_DELAY = 2.f; // actual delay grows by power of 2 each attempt - // runway consolidate extern std::string self_av_string(); diff --git a/indra/newview/llviewertexteditor.cpp b/indra/newview/llviewertexteditor.cpp index 0c4f55d704..85ae64aeff 100755 --- a/indra/newview/llviewertexteditor.cpp +++ b/indra/newview/llviewertexteditor.cpp @@ -169,8 +169,7 @@ public: mImage(image), mLabel(utf8str_to_wstring(inv_item->getName())), mItem(inv_item), - mEditor(editor), - mHasMouseHover(false) + mEditor(editor) { mStyle = new LLStyle(LLStyle::Params().font(LLFontGL::getFontSansSerif())); @@ -262,8 +261,6 @@ private: std::string mToolTip; LLPointer<LLInventoryItem> mItem; LLTextEditor& mEditor; - bool mHasMouseHover; - }; diff --git a/indra/newview/llviewertexture.cpp b/indra/newview/llviewertexture.cpp index 4e2eef39d6..023457c0c8 100755 --- a/indra/newview/llviewertexture.cpp +++ b/indra/newview/llviewertexture.cpp @@ -452,7 +452,6 @@ void LLViewerTexture::initClass() // tuning params const F32 discard_bias_delta = .25f; const F32 discard_delta_time = 0.5f; -const S32 min_non_tex_system_mem = (128<<20); // 128 MB // non-const (used externally F32 texmem_lower_bound_scale = 0.85f; F32 texmem_middle_bound_scale = 0.925f; diff --git a/indra/newview/llviewertextureanim.cpp b/indra/newview/llviewertextureanim.cpp index 2b364851a7..9af92d7377 100755 --- a/indra/newview/llviewertextureanim.cpp +++ b/indra/newview/llviewertextureanim.cpp @@ -179,7 +179,7 @@ S32 LLViewerTextureAnim::animateTextures(F32 &off_s, F32 &off_t, if (!(mMode & SMOOTH)) { - frame_counter = (F32)llround(frame_counter); + frame_counter = (F32)ll_round(frame_counter); } // diff --git a/indra/newview/llviewertexturelist.cpp b/indra/newview/llviewertexturelist.cpp index b98726900f..8c27ddc63c 100755 --- a/indra/newview/llviewertexturelist.cpp +++ b/indra/newview/llviewertexturelist.cpp @@ -1258,9 +1258,6 @@ LLPointer<LLImageJ2C> LLViewerTextureList::convertToUploadFile(LLPointer<LLImage return compressedImage; } -const S32 MIN_VIDEO_RAM = 32; -const S32 MAX_VIDEO_RAM = 512; // 512MB max for performance reasons. - // Returns min setting for TextureMemory (in MB) S32Megabytes LLViewerTextureList::getMinVideoRamSetting() { diff --git a/indra/newview/llviewerwindow.cpp b/indra/newview/llviewerwindow.cpp index 9dcd0b81e0..b63222590d 100755 --- a/indra/newview/llviewerwindow.cpp +++ b/indra/newview/llviewerwindow.cpp @@ -898,8 +898,8 @@ BOOL LLViewerWindow::handleAnyMouseClick(LLWindow *window, LLCoordGL pos, MASK const char* buttonstatestr = ""; S32 x = pos.mX; S32 y = pos.mY; - x = llround((F32)x / mDisplayScale.mV[VX]); - y = llround((F32)y / mDisplayScale.mV[VY]); + x = ll_round((F32)x / mDisplayScale.mV[VX]); + y = ll_round((F32)y / mDisplayScale.mV[VY]); // only send mouse clicks to UI if UI is visible if(gPipeline.hasRenderDebugFeatureMask(LLPipeline::RENDER_DEBUG_FEATURE_UI)) @@ -1065,8 +1065,8 @@ BOOL LLViewerWindow::handleRightMouseDown(LLWindow *window, LLCoordGL pos, MASK { S32 x = pos.mX; S32 y = pos.mY; - x = llround((F32)x / mDisplayScale.mV[VX]); - y = llround((F32)y / mDisplayScale.mV[VY]); + x = ll_round((F32)x / mDisplayScale.mV[VX]); + y = ll_round((F32)y / mDisplayScale.mV[VY]); BOOL down = TRUE; BOOL handle = handleAnyMouseClick(window,pos,mask,LLMouseHandler::CLICK_RIGHT,down); @@ -1263,8 +1263,8 @@ void LLViewerWindow::handleMouseMove(LLWindow *window, LLCoordGL pos, MASK mask S32 x = pos.mX; S32 y = pos.mY; - x = llround((F32)x / mDisplayScale.mV[VX]); - y = llround((F32)y / mDisplayScale.mV[VY]); + x = ll_round((F32)x / mDisplayScale.mV[VX]); + y = ll_round((F32)y / mDisplayScale.mV[VY]); mMouseInWindow = TRUE; @@ -1722,7 +1722,7 @@ LLViewerWindow::LLViewerWindow(const Params& p) LLCoordWindow size; mWindow->getSize(&size); mWindowRectRaw.set(0, size.mY, size.mX, 0); - mWindowRectScaled.set(0, llround((F32)size.mY / mDisplayScale.mV[VY]), llround((F32)size.mX / mDisplayScale.mV[VX]), 0); + mWindowRectScaled.set(0, ll_round((F32)size.mY / mDisplayScale.mV[VY]), ll_round((F32)size.mX / mDisplayScale.mV[VX]), 0); } LLFontManager::initClass(); @@ -2250,8 +2250,8 @@ void LLViewerWindow::reshape(S32 width, S32 height) LLUI::setScaleFactor(mDisplayScale); // update our window rectangle - mWindowRectScaled.mRight = mWindowRectScaled.mLeft + llround((F32)width / mDisplayScale.mV[VX]); - mWindowRectScaled.mTop = mWindowRectScaled.mBottom + llround((F32)height / mDisplayScale.mV[VY]); + mWindowRectScaled.mRight = mWindowRectScaled.mLeft + ll_round((F32)width / mDisplayScale.mV[VX]); + mWindowRectScaled.mTop = mWindowRectScaled.mBottom + ll_round((F32)height / mDisplayScale.mV[VY]); setup2DViewport(); @@ -2444,8 +2444,8 @@ void LLViewerWindow::draw() microsecondsToTimecodeString(gFrameTime,text); const LLFontGL* font = LLFontGL::getFontSansSerif(); font->renderUTF8(text, 0, - llround((getWindowWidthScaled()/2)-100.f), - llround((getWindowHeightScaled()-60.f)), + ll_round((getWindowWidthScaled()/2)-100.f), + ll_round((getWindowHeightScaled()-60.f)), LLColor4( 1.f, 1.f, 1.f, 1.f ), LLFontGL::LEFT, LLFontGL::TOP); } @@ -2521,7 +2521,7 @@ void LLViewerWindow::draw() const S32 DIST_FROM_TOP = 20; LLFontGL::getFontSansSerifBig()->renderUTF8( mOverlayTitle, 0, - llround( getWindowWidthScaled() * 0.5f), + ll_round( getWindowWidthScaled() * 0.5f), getWindowHeightScaled() - DIST_FROM_TOP, LLColor4(1, 1, 1, 0.4f), LLFontGL::HCENTER, LLFontGL::TOP); @@ -3373,7 +3373,7 @@ void LLViewerWindow::updateMouseDelta() fdx = fdx + ((F32) dx - fdx) * llmin(gFrameIntervalSeconds.value()*amount,1.f); fdy = fdy + ((F32) dy - fdy) * llmin(gFrameIntervalSeconds.value()*amount,1.f); - mCurrentMouseDelta.set(llround(fdx), llround(fdy)); + mCurrentMouseDelta.set(ll_round(fdx), ll_round(fdy)); mouse_vel.setVec(fdx,fdy); } else @@ -3488,10 +3488,10 @@ void LLViewerWindow::updateWorldViewRect(bool use_full_window) new_world_rect.mTop = llmax(new_world_rect.mTop, new_world_rect.mBottom + 1); new_world_rect.mRight = llmax(new_world_rect.mRight, new_world_rect.mLeft + 1); - new_world_rect.mLeft = llround((F32)new_world_rect.mLeft * mDisplayScale.mV[VX]); - new_world_rect.mRight = llround((F32)new_world_rect.mRight * mDisplayScale.mV[VX]); - new_world_rect.mBottom = llround((F32)new_world_rect.mBottom * mDisplayScale.mV[VY]); - new_world_rect.mTop = llround((F32)new_world_rect.mTop * mDisplayScale.mV[VY]); + new_world_rect.mLeft = ll_round((F32)new_world_rect.mLeft * mDisplayScale.mV[VX]); + new_world_rect.mRight = ll_round((F32)new_world_rect.mRight * mDisplayScale.mV[VX]); + new_world_rect.mBottom = ll_round((F32)new_world_rect.mBottom * mDisplayScale.mV[VY]); + new_world_rect.mTop = ll_round((F32)new_world_rect.mTop * mDisplayScale.mV[VY]); } if (mWorldViewRectRaw != new_world_rect) @@ -5140,10 +5140,10 @@ void LLViewerWindow::calcDisplayScale() LLRect LLViewerWindow::calcScaledRect(const LLRect & rect, const LLVector2& display_scale) { LLRect res = rect; - res.mLeft = llround((F32)res.mLeft / display_scale.mV[VX]); - res.mRight = llround((F32)res.mRight / display_scale.mV[VX]); - res.mBottom = llround((F32)res.mBottom / display_scale.mV[VY]); - res.mTop = llround((F32)res.mTop / display_scale.mV[VY]); + res.mLeft = ll_round((F32)res.mLeft / display_scale.mV[VX]); + res.mRight = ll_round((F32)res.mRight / display_scale.mV[VX]); + res.mBottom = ll_round((F32)res.mBottom / display_scale.mV[VY]); + res.mTop = ll_round((F32)res.mTop / display_scale.mV[VY]); return res; } @@ -5406,8 +5406,8 @@ void LLPickInfo::updateXYCoords() LLPointer<LLViewerTexture> imagep = LLViewerTextureManager::getFetchedTexture(tep->getID()); if(mUVCoords.mV[VX] >= 0.f && mUVCoords.mV[VY] >= 0.f && imagep.notNull()) { - mXYCoords.mX = llround(mUVCoords.mV[VX] * (F32)imagep->getWidth()); - mXYCoords.mY = llround((1.f - mUVCoords.mV[VY]) * (F32)imagep->getHeight()); + mXYCoords.mX = ll_round(mUVCoords.mV[VX] * (F32)imagep->getWidth()); + mXYCoords.mY = ll_round((1.f - mUVCoords.mV[VY]) * (F32)imagep->getHeight()); } } } @@ -5436,7 +5436,7 @@ void LLPickInfo::getSurfaceInfo() if (objectp) { - if (gViewerWindow->cursorIntersect(llround((F32)mMousePt.mX), llround((F32)mMousePt.mY), 1024.f, + if (gViewerWindow->cursorIntersect(ll_round((F32)mMousePt.mX), ll_round((F32)mMousePt.mY), 1024.f, objectp, -1, mPickTransparent, &mObjectFace, &intersection, @@ -5478,52 +5478,6 @@ void LLPickInfo::getSurfaceInfo() } } - -/* code to get UV via a special UV render - removed in lieu of raycast method -LLVector2 LLPickInfo::pickUV() -{ - LLVector2 result(-1.f, -1.f); - - LLViewerObject* objectp = getObject(); - if (!objectp) - { - return result; - } - - if (mObjectFace > -1 && - objectp->mDrawable.notNull() && objectp->getPCode() == LL_PCODE_VOLUME && - mObjectFace < objectp->mDrawable->getNumFaces()) - { - S32 scaled_x = llround((F32)mPickPt.mX * gViewerWindow->getDisplayScale().mV[VX]); - S32 scaled_y = llround((F32)mPickPt.mY * gViewerWindow->getDisplayScale().mV[VY]); - const S32 UV_PICK_WIDTH = 5; - const S32 UV_PICK_HALF_WIDTH = (UV_PICK_WIDTH - 1) / 2; - U8 uv_pick_buffer[UV_PICK_WIDTH * UV_PICK_WIDTH * 4]; - LLFace* facep = objectp->mDrawable->getFace(mObjectFace); - if (facep) - { - LLGLState scissor_state(GL_SCISSOR_TEST); - scissor_state.enable(); - LLViewerCamera::getInstance()->setPerspective(FOR_SELECTION, scaled_x - UV_PICK_HALF_WIDTH, scaled_y - UV_PICK_HALF_WIDTH, UV_PICK_WIDTH, UV_PICK_WIDTH, FALSE); - //glViewport(scaled_x - UV_PICK_HALF_WIDTH, scaled_y - UV_PICK_HALF_WIDTH, UV_PICK_WIDTH, UV_PICK_WIDTH); - glScissor(scaled_x - UV_PICK_HALF_WIDTH, scaled_y - UV_PICK_HALF_WIDTH, UV_PICK_WIDTH, UV_PICK_WIDTH); - - glClear(GL_DEPTH_BUFFER_BIT); - - facep->renderSelectedUV(); - - glReadPixels(scaled_x - UV_PICK_HALF_WIDTH, scaled_y - UV_PICK_HALF_WIDTH, UV_PICK_WIDTH, UV_PICK_WIDTH, GL_RGBA, GL_UNSIGNED_BYTE, uv_pick_buffer); - U8* center_pixel = &uv_pick_buffer[4 * ((UV_PICK_WIDTH * UV_PICK_HALF_WIDTH) + UV_PICK_HALF_WIDTH + 1)]; - - result.mV[VX] = (F32)((center_pixel[VGREEN] & 0xf) + (16.f * center_pixel[VRED])) / 4095.f; - result.mV[VY] = (F32)((center_pixel[VGREEN] >> 4) + (16.f * center_pixel[VBLUE])) / 4095.f; - } - } - - return result; -} */ - - //static bool LLPickInfo::isFlora(LLViewerObject* object) { diff --git a/indra/newview/llvlcomposition.cpp b/indra/newview/llvlcomposition.cpp index 4e9400872a..c4430f4308 100755 --- a/indra/newview/llvlcomposition.cpp +++ b/indra/newview/llvlcomposition.cpp @@ -123,10 +123,10 @@ BOOL LLVLComposition::generateHeights(const F32 x, const F32 y, S32 x_begin, y_begin, x_end, y_end; - x_begin = llround( x * mScaleInv ); - y_begin = llround( y * mScaleInv ); - x_end = llround( (x + width) * mScaleInv ); - y_end = llround( (y + width) * mScaleInv ); + x_begin = ll_round( x * mScaleInv ); + y_begin = ll_round( y * mScaleInv ); + x_end = ll_round( (x + width) * mScaleInv ); + y_end = ll_round( (y + width) * mScaleInv ); if (x_end > mWidth) { @@ -318,8 +318,8 @@ BOOL LLVLComposition::generateTexture(const F32 x, const F32 y, S32 x_begin, y_begin, x_end, y_end; x_begin = (S32)(x * mScaleInv); y_begin = (S32)(y * mScaleInv); - x_end = llround( (x + width) * mScaleInv ); - y_end = llround( (y + width) * mScaleInv ); + x_end = ll_round( (x + width) * mScaleInv ); + y_end = ll_round( (y + width) * mScaleInv ); if (x_end > mWidth) { diff --git a/indra/newview/llvoavatar.cpp b/indra/newview/llvoavatar.cpp index cfe83cb0b6..1069a55744 100755 --- a/indra/newview/llvoavatar.cpp +++ b/indra/newview/llvoavatar.cpp @@ -134,10 +134,6 @@ const LLUUID ANIM_AGENT_PHYSICS_MOTION = LLUUID("7360e029-3cb8-ebc4-863e-212df44 //----------------------------------------------------------------------------- // Constants //----------------------------------------------------------------------------- - -const S32 MIN_PIXEL_AREA_FOR_COMPOSITE = 1024; -const F32 SHADOW_OFFSET_AMT = 0.03f; - const F32 DELTA_TIME_MIN = 0.01f; // we clamp measured deltaTime to this const F32 DELTA_TIME_MAX = 0.2f; // range to insure stability of computations. @@ -145,22 +141,15 @@ const F32 PELVIS_LAG_FLYING = 0.22f;// pelvis follow half life while flying const F32 PELVIS_LAG_WALKING = 0.4f; // ...while walking const F32 PELVIS_LAG_MOUSELOOK = 0.15f; const F32 MOUSELOOK_PELVIS_FOLLOW_FACTOR = 0.5f; -const F32 PELVIS_LAG_WHEN_FOLLOW_CAM_IS_ON = 0.0001f; // not zero! - something gets divided by this! const F32 TORSO_NOISE_AMOUNT = 1.0f; // Amount of deviation from up-axis, in degrees const F32 TORSO_NOISE_SPEED = 0.2f; // Time scale factor on torso noise. const F32 BREATHE_ROT_MOTION_STRENGTH = 0.05f; -const F32 BREATHE_SCALE_MOTION_STRENGTH = 0.005f; - -const F32 MIN_SHADOW_HEIGHT = 0.f; -const F32 MAX_SHADOW_HEIGHT = 0.3f; const S32 MIN_REQUIRED_PIXEL_AREA_BODY_NOISE = 10000; const S32 MIN_REQUIRED_PIXEL_AREA_BREATHE = 10000; const S32 MIN_REQUIRED_PIXEL_AREA_PELVIS_FIX = 40; -const S32 TEX_IMAGE_SIZE_SELF = 512; -const S32 TEX_IMAGE_AREA_SELF = TEX_IMAGE_SIZE_SELF * TEX_IMAGE_SIZE_SELF; const S32 TEX_IMAGE_SIZE_OTHER = 512 / 4; // The size of local textures for other (!isSelf()) avatars const F32 HEAD_MOVEMENT_AVG_TIME = 0.9f; @@ -464,7 +453,10 @@ public: mCharacter = character; BOOL success = true; - if ( !mChestState->setJoint( character->getJoint( "mChest" ) ) ) { success = false; } + if ( !mChestState->setJoint( character->getJoint( "mChest" ) ) ) + { + success = false; + } if ( success ) { @@ -708,7 +700,6 @@ LLVOAvatar::LLVOAvatar(const LLUUID& id, mVisualComplexity(0), mVisualComplexityStale(TRUE), mLoadedCallbacksPaused(FALSE), - mHasPelvisOffset( FALSE ), mRenderUnloadedAvatar(LLCachedControl<bool>(gSavedSettings, "RenderUnloadedAvatar", false)), mLastRezzedStatus(-1), mIsEditingAppearance(FALSE), @@ -770,10 +761,6 @@ LLVOAvatar::LLVOAvatar(const LLUUID& id, mRuthTimer.reset(); mRuthDebugTimer.reset(); mDebugExistenceTimer.reset(); - mPelvisOffset = LLVector3(0.0f,0.0f,0.0f); - mLastPelvisToFoot = 0.0f; - mPelvisFixup = 0.0f; - mLastPelvisFixup = 0.0f; if(LLSceneMonitor::getInstance()->isEnabled()) { @@ -818,14 +805,14 @@ void LLVOAvatar::debugAvatarRezTime(std::string notification_name, std::string c //------------------------------------------------------------------------ LLVOAvatar::~LLVOAvatar() { - if (!mFullyLoaded) - { + if (!mFullyLoaded) + { debugAvatarRezTime("AvatarRezLeftCloudNotification","left after ruth seconds as cloud"); - } - else - { + } + else + { debugAvatarRezTime("AvatarRezLeftNotification","left sometime after declouding"); - } + } logPendingPhases(); @@ -1258,17 +1245,18 @@ const LLVector3 LLVOAvatar::getRenderPosition() const } else if (isRoot()) { - if ( !mHasPelvisOffset ) - { - return mDrawable->getPositionAgent(); - } - else + F32 fixup; + if ( hasPelvisFixup( fixup) ) { //Apply a pelvis fixup (as defined by the avs skin) LLVector3 pos = mDrawable->getPositionAgent(); - pos[VZ] += mPelvisFixup; + pos[VZ] += fixup; return pos; } + else + { + return mDrawable->getPositionAgent(); + } } else { @@ -1353,38 +1341,36 @@ void LLVOAvatar::getSpatialExtents(LLVector4a& newMin, LLVector4a& newMax) { LLViewerJointAttachment* attachment = iter->second; - if (!attachment->getValid()) - { - continue ; - } - - for (LLViewerJointAttachment::attachedobjs_vec_t::iterator attachment_iter = attachment->mAttachedObjects.begin(); - attachment_iter != attachment->mAttachedObjects.end(); - ++attachment_iter) + if (attachment->getValid()) { - const LLViewerObject* attached_object = (*attachment_iter); - if (attached_object && !attached_object->isHUDAttachment()) + for (LLViewerJointAttachment::attachedobjs_vec_t::iterator attachment_iter = attachment->mAttachedObjects.begin(); + attachment_iter != attachment->mAttachedObjects.end(); + ++attachment_iter) { - LLDrawable* drawable = attached_object->mDrawable; - if (drawable && !drawable->isState(LLDrawable::RIGGED)) + const LLViewerObject* attached_object = (*attachment_iter); + if (attached_object && !attached_object->isHUDAttachment()) { - LLSpatialBridge* bridge = drawable->getSpatialBridge(); - if (bridge) + LLDrawable* drawable = attached_object->mDrawable; + if (drawable && !drawable->isState(LLDrawable::RIGGED)) { - const LLVector4a* ext = bridge->getSpatialExtents(); - LLVector4a distance; - distance.setSub(ext[1], ext[0]); - LLVector4a max_span(max_attachment_span); + LLSpatialBridge* bridge = drawable->getSpatialBridge(); + if (bridge) + { + const LLVector4a* ext = bridge->getSpatialExtents(); + LLVector4a distance; + distance.setSub(ext[1], ext[0]); + LLVector4a max_span(max_attachment_span); - S32 lt = distance.lessThan(max_span).getGatheredBits() & 0x7; + S32 lt = distance.lessThan(max_span).getGatheredBits() & 0x7; - // Only add the prim to spatial extents calculations if it isn't a megaprim. - // max_attachment_span calculated at the start of the function - // (currently 5 times our max prim size) - if (lt == 0x7) - { - update_min_max(newMin,newMax,ext[0]); - update_min_max(newMin,newMax,ext[1]); + // Only add the prim to spatial extents calculations if it isn't a megaprim. + // max_attachment_span calculated at the start of the function + // (currently 5 times our max prim size) + if (lt == 0x7) + { + update_min_max(newMin,newMax,ext[0]); + update_min_max(newMin,newMax,ext[1]); + } } } } @@ -1961,7 +1947,7 @@ U32 LLVOAvatar::processUpdateMessage(LLMessageSystem *mesgsys, if (has_name && getNVPair("FirstName")) { mDebugExistenceTimer.reset(); - debugAvatarRezTime("AvatarRezArrivedNotification","avatar arrived"); + debugAvatarRezTime("AvatarRezArrivedNotification","avatar arrived"); } if(retval & LLViewerObject::INVALID_UPDATE) @@ -3179,6 +3165,7 @@ BOOL LLVOAvatar::updateCharacter(LLAgent &agent) { debug_line += llformat(" - cof rcv:%d", last_received_cof_version); } + debug_line += llformat(" bsz-z: %f avofs-z: %f", mBodySize[2], mAvatarOffset[2]); addDebugText(debug_line); } if (gSavedSettings.getBOOL("DebugAvatarCompositeBaked")) @@ -3689,21 +3676,6 @@ void LLVOAvatar::updateHeadOffset() } } //------------------------------------------------------------------------ -// setPelvisOffset -//------------------------------------------------------------------------ -void LLVOAvatar::setPelvisOffset( bool hasOffset, const LLVector3& offsetAmount, F32 pelvisFixup ) -{ - mHasPelvisOffset = hasOffset; - if ( mHasPelvisOffset ) - { - //Store off last pelvis to foot value - mLastPelvisToFoot = mPelvisToFoot; - mPelvisOffset = offsetAmount; - mLastPelvisFixup = mPelvisFixup; - mPelvisFixup = pelvisFixup; - } -} -//------------------------------------------------------------------------ // postPelvisSetRecalc //------------------------------------------------------------------------ void LLVOAvatar::postPelvisSetRecalc( void ) @@ -3713,15 +3685,6 @@ void LLVOAvatar::postPelvisSetRecalc( void ) dirtyMesh(2); } //------------------------------------------------------------------------ -// setPelvisOffset -//------------------------------------------------------------------------ -void LLVOAvatar::setPelvisOffset( F32 pelvisFixupAmount ) -{ - mHasPelvisOffset = true; - mLastPelvisFixup = mPelvisFixup; - mPelvisFixup = pelvisFixupAmount; -} -//------------------------------------------------------------------------ // updateVisibility() //------------------------------------------------------------------------ void LLVOAvatar::updateVisibility() @@ -3941,13 +3904,13 @@ U32 LLVOAvatar::renderSkinned() if (face) { LLVertexBuffer* vb = face->getVertexBuffer(); - if (vb) - { - vb->flush(); + if (vb) + { + vb->flush(); + } } } } - } else { mNeedsSkin = FALSE; @@ -4122,12 +4085,12 @@ U32 LLVOAvatar::renderTransparent(BOOL first_pass) } // Can't test for baked hair being defined, since that won't always be the case (not all viewers send baked hair) // TODO: 1.25 will be able to switch this logic back to calling isTextureVisible(); - if ( getImage(TEX_HAIR_BAKED, 0) && - getImage(TEX_HAIR_BAKED, 0)->getID() != IMG_INVISIBLE || LLDrawPoolAlpha::sShowDebugAlpha) + if ( ( getImage(TEX_HAIR_BAKED, 0) && + getImage(TEX_HAIR_BAKED, 0)->getID() != IMG_INVISIBLE ) || LLDrawPoolAlpha::sShowDebugAlpha) { LLViewerJoint* hair_mesh = getViewerJoint(MESH_ID_HAIR); if (hair_mesh) - { + { num_indices += hair_mesh->render(mAdjustedPixelArea, first_pass, mIsDummy); } first_pass = FALSE; @@ -4850,6 +4813,12 @@ BOOL LLVOAvatar::processSingleAnimationStateChange( const LLUUID& anim_id, BOOL { sitDown(FALSE); } + if ((anim_id == ANIM_AGENT_DO_NOT_DISTURB) && gAgent.isDoNotDisturb()) + { + // re-assert DND tag animation + gAgent.sendAnimationRequest(ANIM_AGENT_DO_NOT_DISTURB, ANIM_REQUEST_START); + return result; + } stopMotion(anim_id); result = TRUE; } @@ -5023,10 +4992,162 @@ LLJoint *LLVOAvatar::getJoint( const std::string &name ) return jointp; } + //----------------------------------------------------------------------------- -// resetJointPositionsToDefault +// getRiggedMeshID +// +// If viewer object is a rigged mesh, set the mesh id and return true. +// Otherwise, null out the id and return false. //----------------------------------------------------------------------------- -void LLVOAvatar::resetJointPositionsToDefault( void ) +// static +bool LLVOAvatar::getRiggedMeshID(LLViewerObject* pVO, LLUUID& mesh_id) +{ + mesh_id.setNull(); + + //If a VO has a skin that we'll reset the joint positions to their default + if ( pVO && pVO->mDrawable ) + { + LLVOVolume* pVObj = pVO->mDrawable->getVOVolume(); + if ( pVObj ) + { + const LLMeshSkinInfo* pSkinData = gMeshRepo.getSkinInfo( pVObj->getVolume()->getParams().getSculptID(), pVObj ); + if (pSkinData + && pSkinData->mJointNames.size() > JOINT_COUNT_REQUIRED_FOR_FULLRIG // full rig + && pSkinData->mAlternateBindMatrix.size() > 0 ) + { + mesh_id = pSkinData->mMeshID; + return true; + } + } + } + return false; +} + +void LLVOAvatar::clearAttachmentPosOverrides() +{ + //Subsequent joints are relative to pelvis + avatar_joint_list_t::iterator iter = mSkeleton.begin(); + avatar_joint_list_t::iterator end = mSkeleton.end(); + + for (; iter != end; ++iter) + { + LLJoint* pJoint = (*iter); + pJoint->clearAttachmentPosOverrides(); + } +} + +//----------------------------------------------------------------------------- +// addAttachmentPosOverridesForObject +//----------------------------------------------------------------------------- +void LLVOAvatar::addAttachmentPosOverridesForObject(LLViewerObject *vo) +{ + LLVOAvatar *av = vo->getAvatarAncestor(); + if (!av || (av != this)) + { + LL_WARNS("Avatar") << "called with invalid avatar" << LL_ENDL; + } + + // Process all children + LLViewerObject::const_child_list_t& children = vo->getChildren(); + for (LLViewerObject::const_child_list_t::const_iterator it = children.begin(); + it != children.end(); ++it) + { + LLViewerObject *childp = *it; + addAttachmentPosOverridesForObject(childp); + } + + LLVOVolume *vobj = dynamic_cast<LLVOVolume*>(vo); + bool pelvisGotSet = false; + + if (!vobj) + { + return; + } + if (vobj->isMesh() && + ((vobj->getVolume() && !vobj->getVolume()->isMeshAssetLoaded()) || !gMeshRepo.meshRezEnabled())) + { + return; + } + LLUUID currentId = vobj->getVolume()->getParams().getSculptID(); + const LLMeshSkinInfo* pSkinData = gMeshRepo.getSkinInfo( currentId, vobj ); + + if ( vobj && vobj->isAttachment() && vobj->isMesh() && pSkinData ) + { + const int bindCnt = pSkinData->mAlternateBindMatrix.size(); + if ( bindCnt > 0 ) + { + const int jointCnt = pSkinData->mJointNames.size(); + const F32 pelvisZOffset = pSkinData->mPelvisOffset; + const LLUUID& mesh_id = pSkinData->mMeshID; + bool fullRig = (jointCnt>=JOINT_COUNT_REQUIRED_FOR_FULLRIG) ? true : false; + if ( fullRig ) + { + for ( int i=0; i<jointCnt; ++i ) + { + std::string lookingForJoint = pSkinData->mJointNames[i].c_str(); + LLJoint* pJoint = getJoint( lookingForJoint ); + if ( pJoint && pJoint->getId() != currentId ) + { + pJoint->setId( currentId ); + const LLVector3& jointPos = pSkinData->mAlternateBindMatrix[i].getTranslation(); + //Set the joint position + pJoint->addAttachmentPosOverride( jointPos, mesh_id, avString() ); + + //If joint is a pelvis then handle old/new pelvis to foot values + if ( lookingForJoint == "mPelvis" ) + { + pelvisGotSet = true; + } + } + } + if (pelvisZOffset != 0.0F) + { + addPelvisFixup( pelvisZOffset, mesh_id ); + pelvisGotSet = true; + } + } + } + } + + //Rebuild body data if we altered joints/pelvis + if ( pelvisGotSet ) + { + postPelvisSetRecalc(); + } +} + +//----------------------------------------------------------------------------- +// resetJointPositionsOnDetach +//----------------------------------------------------------------------------- +void LLVOAvatar::resetJointPositionsOnDetach(LLViewerObject *vo) +{ + LLVOAvatar *av = vo->getAvatarAncestor(); + if (!av || (av != this)) + { + LL_WARNS("Avatar") << "called with invalid avatar" << LL_ENDL; + } + + // Process all children + LLViewerObject::const_child_list_t& children = vo->getChildren(); + for (LLViewerObject::const_child_list_t::const_iterator it = children.begin(); + it != children.end(); ++it) + { + LLViewerObject *childp = *it; + resetJointPositionsOnDetach(childp); + } + + // Process self. + LLUUID mesh_id; + if (getRiggedMeshID(vo,mesh_id)) + { + resetJointPositionsOnDetach(mesh_id); + } +} + +//----------------------------------------------------------------------------- +// resetJointPositionsOnDetach +//----------------------------------------------------------------------------- +void LLVOAvatar::resetJointPositionsOnDetach(const LLUUID& mesh_id) { //Subsequent joints are relative to pelvis avatar_joint_list_t::iterator iter = mSkeleton.begin(); @@ -5038,23 +5159,18 @@ void LLVOAvatar::resetJointPositionsToDefault( void ) { LLJoint* pJoint = (*iter); //Reset joints except for pelvis - if ( pJoint && pJoint != pJointPelvis && pJoint->doesJointNeedToBeReset() ) + if ( pJoint ) { pJoint->setId( LLUUID::null ); - pJoint->restoreOldXform(); + pJoint->removeAttachmentPosOverride(mesh_id, avString()); } - else - if ( pJoint && pJoint == pJointPelvis && pJoint->doesJointNeedToBeReset() ) + if ( pJoint && pJoint == pJointPelvis) { - pJoint->setId( LLUUID::null ); + removePelvisFixup( mesh_id ); pJoint->setPosition( LLVector3( 0.0f, 0.0f, 0.0f) ); - pJoint->setJointResetFlag( false ); } } - //make sure we don't apply the joint offset - mHasPelvisOffset = false; - mPelvisFixup = mLastPelvisFixup; postPelvisSetRecalc(); } //----------------------------------------------------------------------------- @@ -5179,8 +5295,8 @@ BOOL LLVOAvatar::loadSkeletonNode () { if (!LLAvatarAppearance::loadSkeletonNode()) { - return FALSE; - } + return FALSE; + } // ATTACHMENTS { @@ -5591,7 +5707,7 @@ const LLViewerJointAttachment *LLVOAvatar::attachObject(LLViewerObject *viewer_o } //----------------------------------------------------------------------------- -// attachObject() +// getNumAttachments() //----------------------------------------------------------------------------- U32 LLVOAvatar::getNumAttachments() const { @@ -5701,30 +5817,18 @@ void LLVOAvatar::rebuildRiggedAttachments( void ) //----------------------------------------------------------------------------- void LLVOAvatar::cleanupAttachedMesh( LLViewerObject* pVO ) { - //If a VO has a skin that we'll reset the joint positions to their default - if ( pVO && pVO->mDrawable ) + LLUUID mesh_id; + if (getRiggedMeshID(pVO, mesh_id)) { - LLVOVolume* pVObj = pVO->mDrawable->getVOVolume(); - if ( pVObj ) + resetJointPositionsOnDetach(mesh_id); + if ( gAgentCamera.cameraCustomizeAvatar() ) { - const LLMeshSkinInfo* pSkinData = gMeshRepo.getSkinInfo( pVObj->getVolume()->getParams().getSculptID(), pVObj ); - if (pSkinData - && pSkinData->mJointNames.size() > JOINT_COUNT_REQUIRED_FOR_FULLRIG // full rig - && pSkinData->mAlternateBindMatrix.size() > 0 ) - { - LLVOAvatar::resetJointPositionsToDefault(); - //Need to handle the repositioning of the cam, updating rig data etc during outfit editing - //This handles the case where we detach a replacement rig. - if ( gAgentCamera.cameraCustomizeAvatar() ) - { - gAgent.unpauseAnimation(); - //Still want to refocus on head bone - gAgentCamera.changeCameraToCustomizeAvatar(); - } - } - } - } + gAgent.unpauseAnimation(); + //Still want to refocus on head bone + gAgentCamera.changeCameraToCustomizeAvatar(); } + } +} //----------------------------------------------------------------------------- // detachObject() @@ -5931,27 +6035,24 @@ BOOL LLVOAvatar::isWearingWearableType(LLWearableType::EType type) const break; // Do nothing } - /* switch(type) - case LLWearableType::WT_SHIRT: - indicator_te = TEX_UPPER_SHIRT; */ for (LLAvatarAppearanceDictionary::Textures::const_iterator tex_iter = LLAvatarAppearanceDictionary::getInstance()->getTextures().begin(); tex_iter != LLAvatarAppearanceDictionary::getInstance()->getTextures().end(); ++tex_iter) { const LLAvatarAppearanceDictionary::TextureEntry *texture_dict = tex_iter->second; if (texture_dict->mWearableType == type) - { + { // Thus, you must check to see if the corresponding baked texture is defined. // NOTE: this is a poor substitute if you actually want to know about individual pieces of clothing // this works for detecting a skirt (most important), but is ineffective at any piece of clothing that // gets baked into a texture that always exists (upper or lower). if (texture_dict->mIsUsedByBakedTexture) - { + { const EBakedTextureIndex baked_index = texture_dict->mBakedTextureIndex; return isTextureDefined(LLAvatarAppearanceDictionary::getInstance()->getBakedTexture(baked_index)->mTextureIndex); - } + } return FALSE; - } + } } return FALSE; } @@ -6021,7 +6122,7 @@ void LLVOAvatar::onGlobalColorChanged(const LLTexGlobalColor* global_color) } else if (global_color == mTexEyeColor) { -// LL_INFOS() << "invalidateComposite cause: onGlobalColorChanged( eyecolor )" << LL_ENDL; + // LL_INFOS() << "invalidateComposite cause: onGlobalColorChanged( eyecolor )" << LL_ENDL; invalidateComposite( mBakedTextureDatas[BAKED_EYES].mTexLayerSet); } updateMeshTextures(); @@ -6082,9 +6183,9 @@ void LLVOAvatar::updateRezzedStatusTimers() { // load level has decreased. start phase timers for higher load levels. for (S32 i = rez_status+1; i <= mLastRezzedStatus; i++) - { + { startPhase("load_" + LLVOAvatar::rezStatusToString(i)); - } + } } else if (rez_status > mLastRezzedStatus) { @@ -6093,16 +6194,15 @@ void LLVOAvatar::updateRezzedStatusTimers() { stopPhase("load_" + LLVOAvatar::rezStatusToString(i)); stopPhase("first_load_" + LLVOAvatar::rezStatusToString(i), false); - } + } if (rez_status == 3) - { + { // "fully loaded", mark any pending appearance change complete. selfStopPhase("update_appearance_from_cof"); selfStopPhase("wear_inventory_category", false); selfStopPhase("process_initial_wearables_update", false); } } - mLastRezzedStatus = rez_status; } } @@ -6164,7 +6264,7 @@ void LLVOAvatar::stopPhase(const std::string& phase_name, bool err_check) void LLVOAvatar::logPendingPhases() { if (!isAgentAvatarValid()) - { + { return; } @@ -6180,14 +6280,14 @@ void LLVOAvatar::logPendingPhases() if (!completed) { logMetricsTimerRecord(phase_name, elapsed, completed); - } + } } } - } +} //static void LLVOAvatar::logPendingPhasesAllAvatars() - { +{ for (std::vector<LLCharacter*>::iterator iter = LLCharacter::sInstances.begin(); iter != LLCharacter::sInstances.end(); ++iter) { @@ -6198,14 +6298,14 @@ void LLVOAvatar::logPendingPhasesAllAvatars() } inst->logPendingPhases(); } - } +} void LLVOAvatar::logMetricsTimerRecord(const std::string& phase_name, F32 elapsed, bool completed) - { +{ if (!isAgentAvatarValid()) - { + { return; - } + } LLSD record; record["timer_name"] = phase_name; @@ -6214,10 +6314,10 @@ void LLVOAvatar::logMetricsTimerRecord(const std::string& phase_name, F32 elapse record["completed"] = completed; U32 grid_x(0), grid_y(0); if (getRegion()) - { + { record["central_bake_version"] = LLSD::Integer(getRegion()->getCentralBakeVersion()); grid_from_region_handle(getRegion()->getHandle(), &grid_x, &grid_y); - } + } record["grid_x"] = LLSD::Integer(grid_x); record["grid_y"] = LLSD::Integer(grid_y); record["is_using_server_bakes"] = true; @@ -6278,8 +6378,8 @@ BOOL LLVOAvatar::processFullyLoadedChange(bool loading) mFullyLoaded = (mFullyLoadedTimer.getElapsedTimeF32() > PAUSE); - if (!mPreviousFullyLoaded && !loading && mFullyLoaded) - { + if (!mPreviousFullyLoaded && !loading && mFullyLoaded) + { debugAvatarRezTime("AvatarRezNotification","fully loaded"); } @@ -6325,9 +6425,7 @@ void LLVOAvatar::debugColorizeSubMeshes(U32 i, const LLColor4& color) LLAvatarJointMesh* mesh = (*iter); if (mesh) { - { - mesh->setColor(color); - } + mesh->setColor(color); } } } @@ -6427,7 +6525,7 @@ void LLVOAvatar::updateMeshTextures() LLViewerTexLayerSet* layerset = getTexLayerSet(i); if (use_lkg_baked_layer[i] && !isUsingLocalAppearance() ) - { + { LLViewerFetchedTexture* baked_img = LLViewerTextureManager::getFetchedTexture(mBakedTextureDatas[i].mLastTextureID); mBakedTextureDatas[i].mIsUsed = TRUE; @@ -6436,12 +6534,12 @@ void LLVOAvatar::updateMeshTextures() avatar_joint_mesh_list_t::iterator iter = mBakedTextureDatas[i].mJointMeshes.begin(); avatar_joint_mesh_list_t::iterator end = mBakedTextureDatas[i].mJointMeshes.end(); for (; iter != end; ++iter) - { + { LLAvatarJointMesh* mesh = (*iter); if (mesh) - { + { mesh->setTexture( baked_img ); - } + } } } else if (!isUsingLocalAppearance() && is_layer_baked[i]) @@ -6470,9 +6568,9 @@ void LLVOAvatar::updateMeshTextures() baked_img->setLoadedCallback(onBakedTextureLoaded, SWITCH_TO_BAKED_DISCARD, FALSE, FALSE, new LLUUID( mID ), src_callback_list, paused ); - // this could add paused texture callbacks - mLoadedCallbacksPaused |= paused; - checkTextureLoading(); + // this could add paused texture callbacks + mLoadedCallbacksPaused |= paused; + checkTextureLoading(); } } else if (layerset && isUsingLocalAppearance()) @@ -6491,7 +6589,7 @@ void LLVOAvatar::updateMeshTextures() if (mesh) { mesh->setLayerSet( layerset ); - } + } } } else @@ -6513,7 +6611,7 @@ void LLVOAvatar::updateMeshTextures() { LLAvatarJointMesh* mesh = (*iter); if (mesh) - { + { mesh->setColor( color ); mesh->setTexture( hair_img ); } @@ -6609,13 +6707,13 @@ void LLVOAvatar::applyMorphMask(U8* tex_data, S32 width, S32 height, S32 num_com for (morph_list_t::const_iterator iter = mBakedTextureDatas[index].mMaskedMorphs.begin(); iter != mBakedTextureDatas[index].mMaskedMorphs.end(); ++iter) -{ + { const LLMaskedMorph* maskedMorph = (*iter); LLPolyMorphTarget* morph_target = dynamic_cast<LLPolyMorphTarget*>(maskedMorph->mMorphTarget); if (morph_target) - { + { morph_target->applyMask(tex_data, width, height, num_components, maskedMorph->mInvert); -} + } } } @@ -6914,9 +7012,9 @@ void LLVOAvatar::dumpAppearanceMsgParams( const std::string& dump_prefix, outfile.open(fullpath, LL_APR_WB ); apr_file_t* file = outfile.getFileHandle(); if (!file) - { - return; - } + { + return; + } else { LL_DEBUGS("Avatar") << "dumping appearance message to " << fullpath << LL_ENDL; @@ -6951,7 +7049,7 @@ void LLVOAvatar::dumpAppearanceMsgParams( const std::string& dump_prefix, apr_file_printf( file, "\t\t<texture te=\"%i\" uuid=\"%s\"/>\n", i, uuid_str.c_str()); } apr_file_printf(file, "</textures>\n"); - } +} void LLVOAvatar::parseAppearanceMessage(LLMessageSystem* mesgsys, LLAppearanceMessageContents& contents) { @@ -7034,7 +7132,7 @@ void LLVOAvatar::parseAppearanceMessage(LLMessageSystem* mesgsys, LLAppearanceMe if (it != contents.mParams.end()) { S32 index = it - contents.mParams.begin(); - contents.mParamAppearanceVersion = llround(contents.mParamWeights[index]); + contents.mParamAppearanceVersion = ll_round(contents.mParamWeights[index]); LL_DEBUGS("Avatar") << "appversion req by appearance_version param: " << contents.mParamAppearanceVersion << LL_ENDL; } } @@ -7480,12 +7578,12 @@ void LLVOAvatar::useBakedTexture( const LLUUID& id ) avatar_joint_mesh_list_t::iterator iter = mBakedTextureDatas[i].mJointMeshes.begin(); avatar_joint_mesh_list_t::iterator end = mBakedTextureDatas[i].mJointMeshes.end(); for (; iter != end; ++iter) - { + { LLAvatarJointMesh* mesh = (*iter); if (mesh) - { + { mesh->setTexture( image_baked ); - } + } } } @@ -7509,14 +7607,13 @@ void LLVOAvatar::useBakedTexture( const LLUUID& id ) { LLAvatarJointMesh* mesh = (*iter); if (mesh) - { + { mesh->setColor( LLColor4::white ); } } } } } - dirtyMesh(); } @@ -7528,7 +7625,7 @@ std::string get_sequential_numbered_file_name(const std::string& prefix, file_num_type::iterator it = file_nums.find(prefix); S32 num = 0; if (it != file_nums.end()) -{ + { num = it->second; } file_nums[prefix] = num+1; @@ -7561,44 +7658,61 @@ void LLVOAvatar::dumpArchetypeXML(const std::string& prefix, bool group_by_weara LLAPRFile outfile; std::string fullpath = gDirUtilp->getExpandedFilename(LL_PATH_LOGS,outfilename); - outfile.open(fullpath, LL_APR_WB ); - apr_file_t* file = outfile.getFileHandle(); - if (!file) - { - return; - } - else + if (APR_SUCCESS == outfile.open(fullpath, LL_APR_WB )) { + apr_file_t* file = outfile.getFileHandle(); LL_INFOS() << "xmlfile write handle obtained : " << fullpath << LL_ENDL; - } - apr_file_printf( file, "<?xml version=\"1.0\" encoding=\"US-ASCII\" standalone=\"yes\"?>\n" ); - apr_file_printf( file, "<linden_genepool version=\"1.0\">\n" ); - apr_file_printf( file, "\n\t<archetype name=\"???\">\n" ); + apr_file_printf( file, "<?xml version=\"1.0\" encoding=\"US-ASCII\" standalone=\"yes\"?>\n" ); + apr_file_printf( file, "<linden_genepool version=\"1.0\">\n" ); + apr_file_printf( file, "\n\t<archetype name=\"???\">\n" ); - if (group_by_wearables) - { - for (S32 type = LLWearableType::WT_SHAPE; type < LLWearableType::WT_COUNT; type++) - { - const std::string& wearable_name = LLWearableType::getTypeName((LLWearableType::EType)type); - apr_file_printf( file, "\n\t\t<!-- wearable: %s -->\n", wearable_name.c_str() ); - - for (LLVisualParam* param = getFirstVisualParam(); param; param = getNextVisualParam()) + if (group_by_wearables) { - LLViewerVisualParam* viewer_param = (LLViewerVisualParam*)param; - if( (viewer_param->getWearableType() == type) && - (viewer_param->isTweakable() ) ) + for (S32 type = LLWearableType::WT_SHAPE; type < LLWearableType::WT_COUNT; type++) { - dump_visual_param(file, viewer_param, viewer_param->getWeight()); + const std::string& wearable_name = LLWearableType::getTypeName((LLWearableType::EType)type); + apr_file_printf( file, "\n\t\t<!-- wearable: %s -->\n", wearable_name.c_str() ); + + for (LLVisualParam* param = getFirstVisualParam(); param; param = getNextVisualParam()) + { + LLViewerVisualParam* viewer_param = (LLViewerVisualParam*)param; + if( (viewer_param->getWearableType() == type) && + (viewer_param->isTweakable() ) ) + { + dump_visual_param(file, viewer_param, viewer_param->getWeight()); + } + } + + for (U8 te = 0; te < TEX_NUM_INDICES; te++) + { + if (LLAvatarAppearanceDictionary::getTEWearableType((ETextureIndex)te) == type) + { + // MULTIPLE_WEARABLES: extend to multiple wearables? + LLViewerTexture* te_image = getImage((ETextureIndex)te, 0); + if( te_image ) + { + std::string uuid_str; + te_image->getID().toString( uuid_str ); + apr_file_printf( file, "\t\t<texture te=\"%i\" uuid=\"%s\"/>\n", te, uuid_str.c_str()); + } + } + } } } - - for (U8 te = 0; te < TEX_NUM_INDICES; te++) + else { - if (LLAvatarAppearanceDictionary::getTEWearableType((ETextureIndex)te) == type) + // Just dump all params sequentially. + for (LLVisualParam* param = getFirstVisualParam(); param; param = getNextVisualParam()) + { + LLViewerVisualParam* viewer_param = (LLViewerVisualParam*)param; + dump_visual_param(file, viewer_param, viewer_param->getWeight()); + } + + for (U8 te = 0; te < TEX_NUM_INDICES; te++) { // MULTIPLE_WEARABLES: extend to multiple wearables? - LLViewerTexture* te_image = getImage((ETextureIndex)te, 0); + LLViewerTexture* te_image = getImage((ETextureIndex)te, 0); if( te_image ) { std::string uuid_str; @@ -7607,40 +7721,48 @@ void LLVOAvatar::dumpArchetypeXML(const std::string& prefix, bool group_by_weara } } } - } - } - else - { - // Just dump all params sequentially. - for (LLVisualParam* param = getFirstVisualParam(); param; param = getNextVisualParam()) + + avatar_joint_list_t::iterator iter = mSkeleton.begin(); + avatar_joint_list_t::iterator end = mSkeleton.end(); + for (; iter != end; ++iter) { - LLViewerVisualParam* viewer_param = (LLViewerVisualParam*)param; - dump_visual_param(file, viewer_param, viewer_param->getWeight()); + LLJoint* pJoint = (*iter); + const LLVector3& pos = pJoint->getPosition(); + const LLVector3& scale = pJoint->getScale(); + apr_file_printf( file, "\t\t<joint name=\"%s\" position=\"%f %f %f\" scale=\"%f %f %f\"/>\n", + pJoint->getName().c_str(), pos[0], pos[1], pos[2], scale[0], scale[1], scale[2]); } - for (U8 te = 0; te < TEX_NUM_INDICES; te++) + for (iter = mSkeleton.begin(); iter != end; ++iter) { + LLJoint* pJoint = (*iter); + + LLVector3 pos; + LLUUID mesh_id; + + if (pJoint->hasAttachmentPosOverride(pos,mesh_id)) { - // MULTIPLE_WEARABLES: extend to multiple wearables? - LLViewerTexture* te_image = getImage((ETextureIndex)te, 0); - if( te_image ) - { - std::string uuid_str; - te_image->getID().toString( uuid_str ); - apr_file_printf( file, "\t\t<texture te=\"%i\" uuid=\"%s\"/>\n", te, uuid_str.c_str()); - } + apr_file_printf( file, "\t\t<joint_offset name=\"%s\" position=\"%f %f %f\" mesh_id=\"%s\"/>\n", + pJoint->getName().c_str(), pos[0], pos[1], pos[2], mesh_id.asString().c_str()); } } + F32 pelvis_fixup; + LLUUID mesh_id; + if (hasPelvisFixup(pelvis_fixup, mesh_id)) + { + apr_file_printf( file, "\t\t<pelvis_fixup z=\"%f\" mesh_id=\"%s\"/>\n", + pelvis_fixup, mesh_id.asString().c_str()); + } - } - apr_file_printf( file, "\t</archetype>\n" ); - apr_file_printf( file, "\n</linden_genepool>\n" ); + apr_file_printf( file, "\t</archetype>\n" ); + apr_file_printf( file, "\n</linden_genepool>\n" ); - bool ultra_verbose = false; - if (isSelf() && ultra_verbose) - { - // show the cloned params inside the wearables as well. - gAgentAvatarp->dumpWearableInfo(outfile); + bool ultra_verbose = false; + if (isSelf() && ultra_verbose) + { + // show the cloned params inside the wearables as well. + gAgentAvatarp->dumpWearableInfo(outfile); + } } // File will close when handle goes out of scope } @@ -7756,7 +7878,7 @@ void LLVOAvatar::startAppearanceAnimation() // virtual void LLVOAvatar::removeMissingBakedTextures() - { +{ } //virtual @@ -8080,7 +8202,6 @@ void LLVOAvatar::calculateUpdateRenderCost() } } } - } // Diagnostic output to identify all avatar-related textures. @@ -8219,7 +8340,7 @@ BOOL LLVOAvatar::isTextureDefined(LLAvatarAppearanceDefines::ETextureIndex te, U { return FALSE; } - + if( !getImage( te, index ) ) { LL_WARNS() << "getImage( " << te << ", " << index << " ) returned 0" << LL_ENDL; diff --git a/indra/newview/llvoavatar.h b/indra/newview/llvoavatar.h index f0f8bbe21b..363f7b9f2a 100755 --- a/indra/newview/llvoavatar.h +++ b/indra/newview/llvoavatar.h @@ -199,7 +199,10 @@ public: virtual LLJoint* getJoint(const std::string &name); - void resetJointPositionsToDefault( void ); + void addAttachmentPosOverridesForObject(LLViewerObject *vo); + void resetJointPositionsOnDetach(const LLUUID& mesh_id); + void resetJointPositionsOnDetach(LLViewerObject *vo); + void clearAttachmentPosOverrides(); /*virtual*/ const LLUUID& getID() const; /*virtual*/ void addDebugText(const std::string& text); @@ -355,19 +358,11 @@ protected: /*virtual*/ LLAvatarJointMesh* createAvatarJointMesh(); // Returns LLViewerJointMesh public: void updateHeadOffset(); - void setPelvisOffset( bool hasOffset, const LLVector3& translation, F32 offset ) ; - bool hasPelvisOffset( void ) { return mHasPelvisOffset; } void postPelvisSetRecalc( void ); - void setPelvisOffset( F32 pelvixFixupAmount ); /*virtual*/ BOOL loadSkeletonNode(); /*virtual*/ void buildCharacter(); - bool mHasPelvisOffset; - LLVector3 mPelvisOffset; - F32 mLastPelvisToFoot; - F32 mPelvisFixup; - F32 mLastPelvisFixup; LLVector3 mCurRootToHeadOffset; LLVector3 mTargetRootToHeadOffset; @@ -719,6 +714,7 @@ public: void clampAttachmentPositions(); virtual const LLViewerJointAttachment* attachObject(LLViewerObject *viewer_object); virtual BOOL detachObject(LLViewerObject *viewer_object); + static bool getRiggedMeshID( LLViewerObject* pVO, LLUUID& mesh_id ); void cleanupAttachedMesh( LLViewerObject* pVO ); static LLVOAvatar* findAvatarFromAttachment(LLViewerObject* obj); /*virtual*/ BOOL isWearingWearableType(LLWearableType::EType type ) const; diff --git a/indra/newview/llvoavatarself.cpp b/indra/newview/llvoavatarself.cpp index 42a7c2e576..170a8c41f4 100755 --- a/indra/newview/llvoavatarself.cpp +++ b/indra/newview/llvoavatarself.cpp @@ -158,8 +158,7 @@ LLVOAvatarSelf::LLVOAvatarSelf(const LLUUID& id, LLVOAvatar(id, pcode, regionp), mScreenp(NULL), mLastRegionHandle(0), - mRegionCrossingCount(0), - mInitialBakesLoaded(false) + mRegionCrossingCount(0) { mMotionController.mIsSelf = TRUE; @@ -262,7 +261,7 @@ void LLVOAvatarSelf::markDead() { BOOL success = LLVOAvatar::loadAvatar(); - // set all parameters sotred directly in the avatar to have + // set all parameters stored directly in the avatar to have // the isSelfParam to be TRUE - this is used to prevent // them from being animated or trigger accidental rebakes // when we copy params from the wearable to the base avatar. @@ -718,13 +717,8 @@ void LLVOAvatarSelf::updateVisualParams() LLVOAvatar::updateVisualParams(); } -/*virtual*/ -void LLVOAvatarSelf::idleUpdateAppearanceAnimation() +void LLVOAvatarSelf::writeWearablesToAvatar() { - // Animate all top-level wearable visual parameters - gAgentWearables.animateAllWearableParams(calcMorphAmount()); - - // apply wearable visual params to avatar for (U32 type = 0; type < LLWearableType::WT_COUNT; type++) { LLWearable *wearable = gAgentWearables.getTopWearable((LLWearableType::EType)type); @@ -734,6 +728,17 @@ void LLVOAvatarSelf::idleUpdateAppearanceAnimation() } } +} + +/*virtual*/ +void LLVOAvatarSelf::idleUpdateAppearanceAnimation() +{ + // Animate all top-level wearable visual parameters + gAgentWearables.animateAllWearableParams(calcMorphAmount()); + + // Apply wearable visual params to avatar + writeWearablesToAvatar(); + //allow avatar to process updates LLVOAvatar::idleUpdateAppearanceAnimation(); @@ -1093,9 +1098,19 @@ LLViewerObject* LLVOAvatarSelf::getWornAttachment(const LLUUID& inv_item_id) return NULL; } -const std::string LLVOAvatarSelf::getAttachedPointName(const LLUUID& inv_item_id) const +bool LLVOAvatarSelf::getAttachedPointName(const LLUUID& inv_item_id, std::string& name) const { + if (!gInventory.getItem(inv_item_id)) + { + name = "ATTACHMENT_MISSING_ITEM"; + return false; + } const LLUUID& base_inv_item_id = gInventory.getLinkedItemID(inv_item_id); + if (!gInventory.getItem(base_inv_item_id)) + { + name = "ATTACHMENT_MISSING_BASE_ITEM"; + return false; + } for (attachment_map_t::const_iterator iter = mAttachmentPoints.begin(); iter != mAttachmentPoints.end(); ++iter) @@ -1103,11 +1118,13 @@ const std::string LLVOAvatarSelf::getAttachedPointName(const LLUUID& inv_item_id const LLViewerJointAttachment* attachment = iter->second; if (attachment->getAttachedObject(base_inv_item_id)) { - return attachment->getName(); + name = attachment->getName(); + return true; } } - return LLStringUtil::null; + name = "ATTACHMENT_NOT_ATTACHED"; + return false; } //virtual @@ -1142,8 +1159,6 @@ BOOL LLVOAvatarSelf::detachObject(LLViewerObject *viewer_object) const LLUUID attachment_id = viewer_object->getAttachmentItemID(); if ( LLVOAvatar::detachObject(viewer_object) ) { - LLVOAvatar::cleanupAttachedMesh( viewer_object ); - // the simulator should automatically handle permission revocation stopMotionFromSource(attachment_id); diff --git a/indra/newview/llvoavatarself.h b/indra/newview/llvoavatarself.h index e03de9fa0b..7f641b6242 100755 --- a/indra/newview/llvoavatarself.h +++ b/indra/newview/llvoavatarself.h @@ -86,12 +86,11 @@ public: /*virtual*/ void requestStopMotion(LLMotion* motion); /*virtual*/ LLJoint* getJoint(const std::string &name); - void resetJointPositions( void ); - /*virtual*/ BOOL setVisualParamWeight(const LLVisualParam *which_param, F32 weight); /*virtual*/ BOOL setVisualParamWeight(const char* param_name, F32 weight); /*virtual*/ BOOL setVisualParamWeight(S32 index, F32 weight); /*virtual*/ void updateVisualParams(); + void writeWearablesToAvatar(); /*virtual*/ void idleUpdateAppearanceAnimation(); private: @@ -106,7 +105,6 @@ private: private: LLUUID mInitialBakeIDs[6]; - bool mInitialBakesLoaded; /******************************************************************************** @@ -293,7 +291,7 @@ public: void addAttachmentRequest(const LLUUID& inv_item_id); void removeAttachmentRequest(const LLUUID& inv_item_id); LLViewerObject* getWornAttachment(const LLUUID& inv_item_id); - const std::string getAttachedPointName(const LLUUID& inv_item_id) const; + bool getAttachedPointName(const LLUUID& inv_item_id, std::string& name) const; /*virtual*/ const LLViewerJointAttachment *attachObject(LLViewerObject *viewer_object); /*virtual*/ BOOL detachObject(LLViewerObject *viewer_object); static BOOL detachAttachmentIntoInventory(const LLUUID& item_id); diff --git a/indra/newview/llvograss.cpp b/indra/newview/llvograss.cpp index b79a48012a..8d8f33b601 100755 --- a/indra/newview/llvograss.cpp +++ b/indra/newview/llvograss.cpp @@ -51,7 +51,6 @@ const S32 GRASS_MAX_BLADES = 32; const F32 GRASS_BLADE_BASE = 0.25f; // Width of grass at base -const F32 GRASS_BLADE_TOP = 0.25f; // Width of grass at top const F32 GRASS_BLADE_HEIGHT = 0.5f; // meters const F32 GRASS_DISTRIBUTION_SD = 0.15f; // empirically defined diff --git a/indra/newview/llvoicechannel.cpp b/indra/newview/llvoicechannel.cpp index 9a84cae403..426ca332e4 100755 --- a/indra/newview/llvoicechannel.cpp +++ b/indra/newview/llvoicechannel.cpp @@ -725,6 +725,8 @@ void LLVoiceChannelProximal::handleStatusChange(EStatusType status) // do not notify user when leaving proximal channel return; case STATUS_VOICE_DISABLED: + LLVoiceClient::getInstance()->setUserPTTState(false); + gAgent.setVoiceConnected(false); //skip showing "Voice not available at your current location" when agent voice is disabled (EXT-4749) if(LLVoiceClient::getInstance()->voiceEnabled() && LLVoiceClient::getInstance()->isVoiceWorking()) { diff --git a/indra/newview/llvoiceclient.cpp b/indra/newview/llvoiceclient.cpp index 0bf373f478..962cdf0268 100755 --- a/indra/newview/llvoiceclient.cpp +++ b/indra/newview/llvoiceclient.cpp @@ -161,6 +161,13 @@ void LLVoiceClient::userAuthorized(const std::string& user_id, const LLUUID &age mVoiceModule->userAuthorized(user_id, agentID); } +void LLVoiceClient::setHidden(bool hidden) +{ + if (mVoiceModule) + { + mVoiceModule->setHidden(hidden); + } +} void LLVoiceClient::terminate() { diff --git a/indra/newview/llvoiceclient.h b/indra/newview/llvoiceclient.h index 1e20a814a0..fb387301be 100755 --- a/indra/newview/llvoiceclient.h +++ b/indra/newview/llvoiceclient.h @@ -105,6 +105,8 @@ public: virtual void updateSettings()=0; // call after loading settings and whenever they change virtual bool isVoiceWorking() const = 0; // connected to a voice server and voice channel + + virtual void setHidden(bool hidden)=0; // Hides the user from voice. virtual const LLVoiceVersionInfo& getVersion()=0; @@ -342,6 +344,7 @@ public: void setCaptureDevice(const std::string& name); void setRenderDevice(const std::string& name); + void setHidden(bool hidden); const LLVoiceDeviceList& getCaptureDevices(); const LLVoiceDeviceList& getRenderDevices(); diff --git a/indra/newview/llvoicevisualizer.cpp b/indra/newview/llvoicevisualizer.cpp index 23a8a61b85..cb83cf8fdf 100755 --- a/indra/newview/llvoicevisualizer.cpp +++ b/indra/newview/llvoicevisualizer.cpp @@ -70,7 +70,6 @@ const F32 DEFAULT_MAXIMUM_GESTICULATION_AMPLITUDE = 1.0f; //-------------------------------------------------------------------------------------- // other constants //-------------------------------------------------------------------------------------- -const F32 ONE_HALF = 1.0f; // to clarify intent and reduce magic numbers in the code. const LLVector3 WORLD_UPWARD_DIRECTION = LLVector3( 0.0f, 0.0f, 1.0f ); // Z is up in SL //------------------------------------------------------------------ diff --git a/indra/newview/llvoicevivox.cpp b/indra/newview/llvoicevivox.cpp index 54b4119331..a6a7a35b03 100755 --- a/indra/newview/llvoicevivox.cpp +++ b/indra/newview/llvoicevivox.cpp @@ -70,6 +70,7 @@ #include "apr_base64.h" #define USE_SESSION_GROUPS 0 +#define VX_NULL_POSITION -2147483648.0 /*The Silence*/ extern LLMenuBarGL* gMenuBarView; extern void handle_voice_morphing_subscribe(); @@ -322,6 +323,7 @@ LLVivoxVoiceClient::LLVivoxVoiceClient() : mCaptureBufferRecording(false), mCaptureBufferRecorded(false), mCaptureBufferPlaying(false), + mShutdownComplete(true), mPlayRequestCount(0), mAvatarNameCacheConnection() @@ -376,7 +378,16 @@ void LLVivoxVoiceClient::terminate() if(mConnected) { logout(); - connectorShutdown(); + connectorShutdown(); +#ifdef LL_WINDOWS + int count=0; + while (!mShutdownComplete && 10 > count++) + { + stateMachine(); + _sleep(1000); + } + +#endif closeSocket(); // Need to do this now -- bad things happen if the destructor does it later. cleanUp(); } @@ -476,10 +487,9 @@ void LLVivoxVoiceClient::connectorCreate() std::string savedLogLevel = gSavedSettings.getString("VivoxDebugLevel"); - if(savedLogLevel != "-0") + if(savedLogLevel != "0") { LL_DEBUGS("Voice") << "creating connector with logging enabled" << LL_ENDL; - loglevel = "0"; } stream @@ -488,13 +498,14 @@ void LLVivoxVoiceClient::connectorCreate() << "<AccountManagementServer>" << mVoiceAccountServerURI << "</AccountManagementServer>" << "<Mode>Normal</Mode>" << "<Logging>" - << "<Folder>" << logpath << "</Folder>" - << "<FileNamePrefix>Connector</FileNamePrefix>" - << "<FileNameSuffix>.log</FileNameSuffix>" - << "<LogLevel>" << loglevel << "</LogLevel>" + << "<Folder>" << logpath << "</Folder>" + << "<FileNamePrefix>Connector</FileNamePrefix>" + << "<FileNameSuffix>.log</FileNameSuffix>" + << "<LogLevel>" << loglevel << "</LogLevel>" << "</Logging>" - << "<Application>SecondLifeViewer.1</Application>" - << "</Request>\n\n\n"; + << "<Application></Application>" //Name can cause problems per vivox. + << "<MaxCalls>12</MaxCalls>" + << "</Request>\n\n\n"; writeString(stream.str()); } @@ -512,6 +523,7 @@ void LLVivoxVoiceClient::connectorShutdown() << "</Request>" << "\n\n\n"; + mShutdownComplete = false; mConnectorHandle.clear(); writeString(stream.str()); @@ -788,15 +800,32 @@ void LLVivoxVoiceClient::stateMachine() // vivox executable exists. Build the command line and launch the daemon. LLProcess::Params params; params.executable = exe_path; - // SLIM SDK: these arguments are no longer necessary. -// std::string args = " -p tcp -h -c"; + std::string loglevel = gSavedSettings.getString("VivoxDebugLevel"); + std::string shutdown_timeout = gSavedSettings.getString("VivoxShutdownTimeout"); if(loglevel.empty()) { loglevel = "0"; // turn logging off completely } + params.args.add("-ll"); params.args.add(loglevel); + + std::string log_folder = gSavedSettings.getString("VivoxLogDirectory"); + + if (log_folder.empty()) + { + log_folder = gDirUtilp->getExpandedFilename(LL_PATH_LOGS, ""); + } + + params.args.add("-lf"); + params.args.add(log_folder); + + if(!shutdown_timeout.empty()) + { + params.args.add("-st"); + params.args.add(shutdown_timeout); + } params.cwd = gDirUtilp->getAppRODataDir(); sGatewayPtr = LLProcess::create(params); @@ -1334,7 +1363,7 @@ void LLVivoxVoiceClient::stateMachine() { // Connect to a session by URI sessionCreateSendMessage(mAudioSession, true, false); - } + } notifyStatusObservers(LLVoiceClientStatusObserver::STATUS_JOINING); setState(stateJoiningSession); @@ -1510,7 +1539,7 @@ void LLVivoxVoiceClient::stateMachine() // Always reset the terminate request flag when we get here. mSessionTerminateRequested = false; - if((mVoiceEnabled || !mIsInitialized) && !mRelogRequested) + if((mVoiceEnabled || !mIsInitialized) && !mRelogRequested && !LLApp::isExiting()) { // Just leaving a channel, go back to stateNoChannel (the "logged in but have no channel" state). setState(stateNoChannel); @@ -1553,6 +1582,7 @@ void LLVivoxVoiceClient::stateMachine() //MARK: stateConnectorStopping case stateConnectorStopping: // waiting for connector stop // The handler for the Connector.InitiateShutdown response will transition from here to stateConnectorStopped. + mShutdownComplete = true; break; //MARK: stateConnectorStopped @@ -2318,6 +2348,14 @@ static void oldSDKTransform (LLVector3 &left, LLVector3 &up, LLVector3 &at, LLVe #endif } +void LLVivoxVoiceClient::setHidden(bool hidden) +{ + mHidden = hidden; + + sendPositionalUpdate(); + return; +} + void LLVivoxVoiceClient::sendPositionalUpdate(void) { std::ostringstream stream; @@ -2339,14 +2377,23 @@ void LLVivoxVoiceClient::sendPositionalUpdate(void) l = mAvatarRot.getLeftRow(); u = mAvatarRot.getUpRow(); a = mAvatarRot.getFwdRow(); - pos = mAvatarPosition; + + pos = mAvatarPosition; vel = mAvatarVelocity; // SLIM SDK: the old SDK was doing a transform on the passed coordinates that the new one doesn't do anymore. // The old transform is replicated by this function. oldSDKTransform(l, u, a, pos, vel); + + if (mHidden) + { + for (int i=0;i<3;++i) + { + pos.mdV[i] = VX_NULL_POSITION; + } + } - stream + stream << "<Position>" << "<X>" << pos.mdV[VX] << "</X>" << "<Y>" << pos.mdV[VY] << "</Y>" @@ -2406,14 +2453,23 @@ void LLVivoxVoiceClient::sendPositionalUpdate(void) l = earRot.getLeftRow(); u = earRot.getUpRow(); a = earRot.getFwdRow(); - pos = earPosition; + + pos = earPosition; vel = earVelocity; // LL_DEBUGS("Voice") << "Sending listener position " << earPosition << LL_ENDL; oldSDKTransform(l, u, a, pos, vel); - stream + if (mHidden) + { + for (int i=0;i<3;++i) + { + pos.mdV[i] = VX_NULL_POSITION; + } + } + + stream << "<Position>" << "<X>" << pos.mdV[VX] << "</X>" << "<Y>" << pos.mdV[VY] << "</Y>" @@ -2463,7 +2519,7 @@ void LLVivoxVoiceClient::sendPositionalUpdate(void) if(!p->mIsSelf) { // scale from the range 0.0-1.0 to vivox volume in the range 0-100 - S32 volume = llround(p->mVolume / VOLUME_SCALE_VIVOX); + S32 volume = ll_round(p->mVolume / VOLUME_SCALE_VIVOX); bool mute = p->mOnMuteList; if(mute) @@ -3169,7 +3225,7 @@ void LLVivoxVoiceClient::mediaStreamUpdatedEvent( session->mErrorStatusCode = statusCode; break; } - + switch(state) { case streamStateIdle: @@ -5433,7 +5489,8 @@ void LLVivoxVoiceClient::notifyStatusObservers(LLVoiceClientStatusObserver::ESta // skipped to avoid speak button blinking if ( status != LLVoiceClientStatusObserver::STATUS_JOINING - && status != LLVoiceClientStatusObserver::STATUS_LEFT_CHANNEL) + && status != LLVoiceClientStatusObserver::STATUS_LEFT_CHANNEL + && status != LLVoiceClientStatusObserver::STATUS_VOICE_DISABLED) { bool voice_status = LLVoiceClient::getInstance()->voiceEnabled() && LLVoiceClient::getInstance()->isVoiceWorking(); diff --git a/indra/newview/llvoicevivox.h b/indra/newview/llvoicevivox.h index 5e876fa2ef..a4ec9f2a69 100755 --- a/indra/newview/llvoicevivox.h +++ b/indra/newview/llvoicevivox.h @@ -723,6 +723,7 @@ private: bool mRenderDeviceDirty; bool mIsInitialized; + bool mShutdownComplete; bool checkParcelChanged(bool update = false); @@ -747,6 +748,7 @@ private: std::string getAudioSessionURI(); std::string getAudioSessionHandle(); + void setHidden(bool hidden); //virtual void sendPositionalUpdate(void); void buildSetCaptureDevice(std::ostringstream &stream); @@ -775,6 +777,7 @@ private: bool mMuteMic; bool mMuteMicDirty; + bool mHidden; //Set to true during teleport to hide the agent's position. // Set to true when the friends list is known to have changed. bool mFriendsListDirty; diff --git a/indra/newview/llvopartgroup.cpp b/indra/newview/llvopartgroup.cpp index c1593fa5fc..1ba0868544 100755 --- a/indra/newview/llvopartgroup.cpp +++ b/indra/newview/llvopartgroup.cpp @@ -44,8 +44,6 @@ #include "pipeline.h" #include "llspatialpartition.h" -const F32 MAX_PART_LIFETIME = 120.f; - extern U64MicrosecondsImplicit gFrameTime; LLPointer<LLVertexBuffer> LLVOPartGroup::sVB = NULL; @@ -683,7 +681,7 @@ void LLVOPartGroup::getGeometry(S32 idx, } else { - pglow = LLColor4U(0, 0, 0, (U8) llround(255.f*part.mStartGlow)); + pglow = LLColor4U(0, 0, 0, (U8) ll_round(255.f*part.mStartGlow)); pcolor = part.mStartColor; } } diff --git a/indra/newview/llvosky.cpp b/indra/newview/llvosky.cpp index 07c2f0d44d..4dab213fa0 100755 --- a/indra/newview/llvosky.cpp +++ b/indra/newview/llvosky.cpp @@ -62,8 +62,6 @@ static const S32 NUM_TILES = NUM_TILES_X * NUM_TILES_Y; static const F32 SUN_DISK_RADIUS = 0.5f; static const F32 MOON_DISK_RADIUS = SUN_DISK_RADIUS * 0.9f; static const F32 SUN_INTENSITY = 1e5; -static const F32 SUN_DISK_INTENSITY = 24.f; - // Texture coordinates: static const LLVector2 TEX00 = LLVector2(0.f, 0.f); @@ -619,21 +617,6 @@ static inline LLColor3 colorMix(LLColor3 const & left, LLColor3 const & right, F return (left + ((right - left) * amount)); } -static inline F32 texture2D(LLPointer<LLImageRaw> const & tex, LLVector2 const & uv) -{ - U16 w = tex->getWidth(); - U16 h = tex->getHeight(); - - U16 r = U16(uv[0] * w) % w; - U16 c = U16(uv[1] * h) % h; - - U8 const * imageBuffer = tex->getData(); - - U8 sample = imageBuffer[r * w + c]; - - return sample / 255.f; -} - static inline LLColor3 smear(F32 val) { return LLColor3(val, val, val); diff --git a/indra/newview/llvotree.cpp b/indra/newview/llvotree.cpp index 66c0ace79d..367fa21b91 100755 --- a/indra/newview/llvotree.cpp +++ b/indra/newview/llvotree.cpp @@ -396,9 +396,6 @@ void LLVOTree::idleUpdate(LLAgent &agent, const F64 &time) mTrunkLOD = trunk_LOD; } -const F32 TREE_BLEND_MIN = 1.f; -const F32 TREE_BLEND_RANGE = 1.f; - void LLVOTree::render(LLAgent &agent) { } diff --git a/indra/newview/llvovolume.cpp b/indra/newview/llvovolume.cpp index a83e2e020e..18cc6d32a5 100755 --- a/indra/newview/llvovolume.cpp +++ b/indra/newview/llvovolume.cpp @@ -78,10 +78,8 @@ #include "llvocache.h" #include "llmaterialmgr.h" -const S32 MIN_QUIET_FRAMES_COALESCE = 30; const F32 FORCE_SIMPLE_RENDER_AREA = 512.f; const F32 FORCE_CULL_AREA = 8.f; -const F32 MAX_LOD_DISTANCE = 24.f; U32 JOINT_COUNT_REQUIRED_FOR_FULLRIG = 20; BOOL gAnimateTextures = TRUE; @@ -1222,7 +1220,7 @@ S32 LLVOVolume::computeLODDetail(F32 distance, F32 radius) { // We've got LOD in the profile, and in the twist. Use radius. F32 tan_angle = (LLVOVolume::sLODFactor*radius)/distance; - cur_detail = LLVolumeLODGroup::getDetailFromTan(llround(tan_angle, 0.01f)); + cur_detail = LLVolumeLODGroup::getDetailFromTan(ll_round(tan_angle, 0.01f)); } else { @@ -1280,8 +1278,8 @@ BOOL LLVOVolume::calcLOD() // DON'T Compensate for field of view changing on FOV zoom. distance *= F_PI/3.f; - cur_detail = computeLODDetail(llround(distance, 0.01f), - llround(radius, 0.01f)); + cur_detail = computeLODDetail(ll_round(distance, 0.01f), + ll_round(radius, 0.01f)); if (gPipeline.hasRenderDebugMask(LLPipeline::RENDER_DEBUG_LOD_INFO) && @@ -1294,7 +1292,7 @@ BOOL LLVOVolume::calcLOD() if (cur_detail != mLOD) { - mAppAngle = llround((F32) atan2( mDrawable->getRadius(), mDrawable->mDistanceWRTCamera) * RAD_TO_DEG, 0.01f); + mAppAngle = ll_round((F32) atan2( mDrawable->getRadius(), mDrawable->mDistanceWRTCamera) * RAD_TO_DEG, 0.01f); mLOD = cur_detail; return TRUE; } @@ -2040,7 +2038,18 @@ S32 LLVOVolume::setTEMaterialID(const U8 te, const LLMaterialID& pMaterialID) S32 LLVOVolume::setTEMaterialParams(const U8 te, const LLMaterialPtr pMaterialParams) { - S32 res = LLViewerObject::setTEMaterialParams(te, pMaterialParams); + S32 res = 0; + + if (pMaterialParams && getTEImage(te) && 3 == getTEImage(te)->getComponents() && pMaterialParams->getDiffuseAlphaMode()) + { + LLViewerObject::setTEMaterialID(te, LLMaterialID::null); + res = LLViewerObject::setTEMaterialParams(te, NULL); + } + else + { + res = LLViewerObject::setTEMaterialParams(te, pMaterialParams); + } + LL_DEBUGS("MaterialTEs") << "te " << (S32)te << " material " << ((pMaterialParams) ? pMaterialParams->asLLSD() : LLSD("null")) << " res " << res << ( LLSelectMgr::getInstance()->getSelection()->contains(const_cast<LLVOVolume*>(this), te) ? " selected" : " not selected" ) << LL_ENDL; @@ -4328,7 +4337,7 @@ void LLVolumeGeometryManager::registerFace(LLSpatialGroup* group, LLFace* facep, draw_info->mBump = bump; draw_info->mShiny = shiny; - float alpha[4] = + static const float alpha[4] = { 0.00f, 0.25f, @@ -4517,7 +4526,9 @@ void LLVolumeGeometryManager::rebuildGeom(LLSpatialGroup* group) //Determine if we've received skininfo that contains an //alternate bind matrix - if it does then apply the translational component //to the joints of the avatar. +#if 0 bool pelvisGotSet = false; +#endif { LL_RECORD_BLOCK_TIME(FTM_REBUILD_VOLUME_FACE_LIST); @@ -4602,53 +4613,12 @@ void LLVolumeGeometryManager::rebuildGeom(LLSpatialGroup* group) //get drawpool of avatar with rigged face LLDrawPoolAvatar* pool = get_avatar_drawpool(vobj); + // FIXME should this be inside the face loop? + // doesn't seem to depend on any per-face state. if ( pAvatarVO ) { - LLUUID currentId = vobj->getVolume()->getParams().getSculptID(); - const LLMeshSkinInfo* pSkinData = gMeshRepo.getSkinInfo( currentId, vobj ); - if ( pSkinData ) - { - const int bindCnt = pSkinData->mAlternateBindMatrix.size(); - if ( bindCnt > 0 ) - { - const int jointCnt = pSkinData->mJointNames.size(); - const F32 pelvisZOffset = pSkinData->mPelvisOffset; - bool fullRig = (jointCnt>=JOINT_COUNT_REQUIRED_FOR_FULLRIG) ? true : false; - if ( fullRig ) - { - for ( int i=0; i<jointCnt; ++i ) - { - std::string lookingForJoint = pSkinData->mJointNames[i].c_str(); - LLJoint* pJoint = pAvatarVO->getJoint( lookingForJoint ); - if ( pJoint && pJoint->getId() != currentId ) - { - pJoint->setId( currentId ); - const LLVector3& jointPos = pSkinData->mAlternateBindMatrix[i].getTranslation(); - - //Set the joint position - pJoint->storeCurrentXform( jointPos ); - - //If joint is a pelvis then handle old/new pelvis to foot values - if ( lookingForJoint == "mPelvis" ) - { - if ( !pAvatarVO->hasPelvisOffset() ) - { - pAvatarVO->setPelvisOffset( true, jointPos, pelvisZOffset ); - pelvisGotSet = true; - } - } - } - } - } - } - } + pAvatarVO->addAttachmentPosOverridesForObject(vobj); } - - //Rebuild body data if we altered joints/pelvis - if ( pelvisGotSet && pAvatarVO ) - { - pAvatarVO->postPelvisSetRecalc(); - } if (pool) { @@ -5006,14 +4976,6 @@ void LLVolumeGeometryManager::rebuildGeom(LLSpatialGroup* group) } } - - - - - - - - } group->mBufferUsage = useage; @@ -5652,7 +5614,7 @@ void LLVolumeGeometryManager::genDrawInfo(LLSpatialGroup* group, U32 mask, LLFac if (material_pass) { - U32 pass[] = + static const U32 pass[] = { LLRenderPass::PASS_MATERIAL, LLRenderPass::PASS_ALPHA, //LLRenderPass::PASS_MATERIAL_ALPHA, diff --git a/indra/newview/llvowater.cpp b/indra/newview/llvowater.cpp index e3419af10d..9ce16a1674 100755 --- a/indra/newview/llvowater.cpp +++ b/indra/newview/llvowater.cpp @@ -43,9 +43,6 @@ #include "pipeline.h" #include "llspatialpartition.h" -const BOOL gUseRoam = FALSE; - - /////////////////////////////////// template<class T> inline T LERP(T a, T b, F32 factor) @@ -53,12 +50,6 @@ template<class T> inline T LERP(T a, T b, F32 factor) return a + (b - a) * factor; } -const U32 N_RES_HALF = (N_RES >> 1); - -const U32 WIDTH = (N_RES * WAVE_STEP); //128.f //64 // width of wave tile, in meters -const F32 WAVE_STEP_INV = (1. / WAVE_STEP); - - LLVOWater::LLVOWater(const LLUUID &id, const LLPCode pcode, LLViewerRegion *regionp) : diff --git a/indra/newview/llwearableitemslist.cpp b/indra/newview/llwearableitemslist.cpp index ca60b79f9d..fac0fd63ee 100755 --- a/indra/newview/llwearableitemslist.cpp +++ b/indra/newview/llwearableitemslist.cpp @@ -364,8 +364,14 @@ void LLPanelAttachmentListItem::updateItem(const std::string& name, LLViewerInventoryItem* inv_item = getItem(); if (inv_item && isAgentAvatarValid() && gAgentAvatarp->isWearingAttachment(inv_item->getLinkedUUID())) { - std::string joint = LLTrans::getString(gAgentAvatarp->getAttachedPointName(inv_item->getLinkedUUID())); - title_joint = title_joint + " (" + joint + ")"; + std::string found_name; + bool found = gAgentAvatarp->getAttachedPointName(inv_item->getLinkedUUID(),found_name); + std::string trans_name = LLTrans::getString(found_name); + if (!found) + { + LL_WARNS() << "invalid attachment joint, err " << found_name << LL_ENDL; + } + title_joint = title_joint + " (" + trans_name + ")"; } LLPanelInventoryListItemBase::updateItem(title_joint, item_state); diff --git a/indra/newview/llwearableitemslist.h b/indra/newview/llwearableitemslist.h index 58a00c5be0..c731a7d6cf 100755 --- a/indra/newview/llwearableitemslist.h +++ b/indra/newview/llwearableitemslist.h @@ -382,6 +382,10 @@ class LLWearableItemCreationDateComparator : public LLWearableItemNameComparator { LOG_CLASS(LLWearableItemCreationDateComparator); +public: + // clang demands a default ctor here + LLWearableItemCreationDateComparator() {} + protected: /*virtual*/ bool doCompare(const LLPanelInventoryListItemBase* item1, const LLPanelInventoryListItemBase* item2) const; }; diff --git a/indra/newview/llwindowlistener.cpp b/indra/newview/llwindowlistener.cpp index a8e06511d7..734018cfc2 100755 --- a/indra/newview/llwindowlistener.cpp +++ b/indra/newview/llwindowlistener.cpp @@ -44,10 +44,7 @@ #include <typeinfo> #include <map> #include <boost/scoped_ptr.hpp> -#include <boost/lambda/core.hpp> -#include <boost/lambda/bind.hpp> - -namespace bll = boost::lambda; +#include <boost/bind.hpp> LLWindowListener::LLWindowListener(LLViewerWindow *window, const KeyboardGetter& kbgetter) : LLEventAPI("LLWindow", "Inject input events into the LLWindow instance"), @@ -358,6 +355,30 @@ static WhichButton buttons; typedef boost::function<bool(LLCoordGL, MASK)> MouseFunc; +// Wrap a function returning 'void' to return 'true' instead. I'm sure there's +// a more generic way to accomplish this, but generically handling the +// arguments seems to require variadic templates and perfect forwarding. (We +// used to be able to write (boost::lambda::bind(...), true), counting on +// boost::lambda's comma operator overload, until +// https://svn.boost.org/trac/boost/ticket/10864. And boost::phoenix doesn't +// seem to overload comma the same way; or at least not with bind().) +class MouseFuncTrue +{ + typedef boost::function<void(LLCoordGL, MASK)> MouseFuncVoid; + MouseFuncVoid mFunc; + +public: + MouseFuncTrue(const MouseFuncVoid& func): + mFunc(func) + {} + + bool operator()(LLCoordGL coords, MASK mask) const + { + mFunc(coords, mask); + return true; + } +}; + static void mouseEvent(const MouseFunc& func, const LLSD& request) { // Ensure we send response @@ -464,11 +485,11 @@ void LLWindowListener::mouseDown(LLSD const & request) if (actions.valid) { // Normally you can pass NULL to an LLWindow* without compiler - // complaint, but going through boost::lambda::bind() evidently + // complaint, but going through boost::bind() evidently // bypasses that special case: it only knows you're trying to pass an // int to a pointer. Explicitly cast NULL to the desired pointer type. - mouseEvent(bll::bind(actions.down, mWindow, - static_cast<LLWindow*>(NULL), bll::_1, bll::_2), + mouseEvent(boost::bind(actions.down, mWindow, + static_cast<LLWindow*>(NULL), _1, _2), request); } } @@ -478,8 +499,8 @@ void LLWindowListener::mouseUp(LLSD const & request) Actions actions(buttons.lookup(request["button"])); if (actions.valid) { - mouseEvent(bll::bind(actions.up, mWindow, - static_cast<LLWindow*>(NULL), bll::_1, bll::_2), + mouseEvent(boost::bind(actions.up, mWindow, + static_cast<LLWindow*>(NULL), _1, _2), request); } } @@ -489,12 +510,10 @@ void LLWindowListener::mouseMove(LLSD const & request) // We want to call the same central mouseEvent() routine for // handleMouseMove() as for button clicks. But handleMouseMove() returns // void, whereas mouseEvent() accepts a function returning bool -- and - // uses that bool return. Use (void-lambda-expression, true) to construct - // a callable that returns bool anyway. Pass 'true' because we expect that - // our caller will usually treat 'false' as a problem. - mouseEvent((bll::bind(&LLWindowCallbacks::handleMouseMove, mWindow, - static_cast<LLWindow*>(NULL), bll::_1, bll::_2), - true), + // uses that bool return. Use MouseFuncTrue to construct a callable that + // returns bool anyway. + mouseEvent(MouseFuncTrue(boost::bind(&LLWindowCallbacks::handleMouseMove, mWindow, + static_cast<LLWindow*>(NULL), _1, _2)), request); } diff --git a/indra/newview/llwlanimator.cpp b/indra/newview/llwlanimator.cpp index e568638cf6..2142885767 100755 --- a/indra/newview/llwlanimator.cpp +++ b/indra/newview/llwlanimator.cpp @@ -242,7 +242,7 @@ std::string LLWLAnimator::timeToString(F32 curTime) // get hours and minutes hours = (S32) (24.0 * curTime); curTime -= ((F32) hours / 24.0f); - min = llround(24.0f * 60.0f * curTime); + min = ll_round(24.0f * 60.0f * curTime); // handle case where it's 60 if(min == 60) diff --git a/indra/newview/llworld.cpp b/indra/newview/llworld.cpp index b4e8114a5f..74fb1ec78e 100755 --- a/indra/newview/llworld.cpp +++ b/indra/newview/llworld.cpp @@ -70,7 +70,6 @@ U32 gAgentPauseSerialNum = 0; // // Constants // -const S32 MAX_NUMBER_OF_CLOUDS = 750; const S32 WORLD_PATCH_SIZE = 16; extern LLColor4U MAX_WATER_COLOR; @@ -978,8 +977,8 @@ void LLWorld::updateWaterObjects() } // Resize and reshape the water objects - const S32 water_center_x = center_x + llround((wx + dim[0]) * 0.5f * gDirAxes[dir][0]); - const S32 water_center_y = center_y + llround((wy + dim[1]) * 0.5f * gDirAxes[dir][1]); + const S32 water_center_x = center_x + ll_round((wx + dim[0]) * 0.5f * gDirAxes[dir][0]); + const S32 water_center_y = center_y + ll_round((wy + dim[1]) * 0.5f * gDirAxes[dir][1]); LLVOWater* waterp = mEdgeWaterObjects[dir]; if (!waterp || waterp->isDead()) diff --git a/indra/newview/llworldmapview.cpp b/indra/newview/llworldmapview.cpp index 7cb53a0706..62fad32246 100755 --- a/indra/newview/llworldmapview.cpp +++ b/indra/newview/llworldmapview.cpp @@ -67,7 +67,6 @@ const F32 OCEAN_GREEN = (F32)(0x47)/255.f; const F32 OCEAN_BLUE = (F32)(0x5F)/255.f; const F32 GODLY_TELEPORT_HEIGHT = 200.f; -const S32 SCROLL_HINT_WIDTH = 65; const F32 BIG_DOT_RADIUS = 5.f; BOOL LLWorldMapView::sHandledLastClick = FALSE; @@ -420,8 +419,8 @@ void LLWorldMapView::draw() if (overlayimage) { // Inform the fetch mechanism of the size we need - S32 draw_size = llround(sMapScale); - overlayimage->setKnownDrawSize(llround(draw_size * LLUI::getScaleFactor().mV[VX]), llround(draw_size * LLUI::getScaleFactor().mV[VY])); + S32 draw_size = ll_round(sMapScale); + overlayimage->setKnownDrawSize(ll_round(draw_size * LLUI::getScaleFactor().mV[VX]), ll_round(draw_size * LLUI::getScaleFactor().mV[VY])); // Draw something whenever we have enough info if (overlayimage->hasGLTexture()) { @@ -509,7 +508,7 @@ void LLWorldMapView::draw() drawImage(pos_global, sAvatarYouImage); LLVector3 pos_map = globalPosToView(pos_global); - if (!pointInView(llround(pos_map.mV[VX]), llround(pos_map.mV[VY]))) + if (!pointInView(ll_round(pos_map.mV[VX]), ll_round(pos_map.mV[VY]))) { drawTracking(pos_global, lerp(LLColor4::yellow, LLColor4::orange, 0.4f), @@ -774,8 +773,8 @@ void LLWorldMapView::drawGenericItem(const LLItemInfo& item, LLUIImagePtr image) void LLWorldMapView::drawImage(const LLVector3d& global_pos, LLUIImagePtr image, const LLColor4& color) { LLVector3 pos_map = globalPosToView( global_pos ); - image->draw(llround(pos_map.mV[VX] - image->getWidth() /2.f), - llround(pos_map.mV[VY] - image->getHeight()/2.f), + image->draw(ll_round(pos_map.mV[VX] - image->getWidth() /2.f), + ll_round(pos_map.mV[VY] - image->getHeight()/2.f), color); } @@ -784,8 +783,8 @@ void LLWorldMapView::drawImageStack(const LLVector3d& global_pos, LLUIImagePtr i LLVector3 pos_map = globalPosToView( global_pos ); for(U32 i=0; i<count; i++) { - image->draw(llround(pos_map.mV[VX] - image->getWidth() /2.f), - llround(pos_map.mV[VY] - image->getHeight()/2.f + i*offset), + image->draw(ll_round(pos_map.mV[VX] - image->getWidth() /2.f), + ll_round(pos_map.mV[VY] - image->getHeight()/2.f + i*offset), color); } } @@ -959,8 +958,8 @@ void LLWorldMapView::drawTracking(const LLVector3d& pos_global, const LLColor4& const std::string& label, const std::string& tooltip, S32 vert_offset ) { LLVector3 pos_local = globalPosToView( pos_global ); - S32 x = llround( pos_local.mV[VX] ); - S32 y = llround( pos_local.mV[VY] ); + S32 x = ll_round( pos_local.mV[VX] ); + S32 y = ll_round( pos_local.mV[VY] ); LLFontGL* font = LLFontGL::getFontSansSerifSmall(); S32 text_x = x; S32 text_y = (S32)(y - sTrackCircleImage->getHeight()/2 - font->getLineHeight()); @@ -1111,8 +1110,8 @@ static void drawDot(F32 x_pixels, F32 y_pixels, if(-HEIGHT_THRESHOLD <= relative_z && relative_z <= HEIGHT_THRESHOLD) { - dot_image->draw(llround(x_pixels) - dot_image->getWidth()/2, - llround(y_pixels) - dot_image->getHeight()/2, + dot_image->draw(ll_round(x_pixels) - dot_image->getWidth()/2, + ll_round(y_pixels) - dot_image->getHeight()/2, color); } else @@ -1167,9 +1166,9 @@ void LLWorldMapView::drawAvatar(F32 x_pixels, dot_image = sAvatarAboveImage; } } - S32 dot_width = llround(dot_radius * 2.f); - dot_image->draw(llround(x_pixels - dot_radius), - llround(y_pixels - dot_radius), + S32 dot_width = ll_round(dot_radius * 2.f); + dot_image->draw(ll_round(x_pixels - dot_radius), + ll_round(y_pixels - dot_radius), dot_width, dot_width, color); @@ -1196,8 +1195,8 @@ void LLWorldMapView::drawIconName(F32 x_pixels, const std::string& second_line) { const S32 VERT_PAD = 8; - S32 text_x = llround(x_pixels); - S32 text_y = llround(y_pixels + S32 text_x = ll_round(x_pixels); + S32 text_y = ll_round(y_pixels - BIG_DOT_RADIUS - VERT_PAD); @@ -1385,8 +1384,8 @@ void LLWorldMapView::setDirectionPos( LLTextBox* text_box, F32 rotation ) F32 radius = llmin( map_half_height - text_half_height, map_half_width - text_half_width ); text_box->setOrigin( - llround(map_half_width - text_half_width + radius * cos( rotation )), - llround(map_half_height - text_half_height + radius * sin( rotation )) ); + ll_round(map_half_width - text_half_width + radius * cos( rotation )), + ll_round(map_half_height - text_half_height + radius * sin( rotation )) ); } @@ -1434,8 +1433,8 @@ void LLWorldMapView::reshape( S32 width, S32 height, BOOL called_from_parent ) bool LLWorldMapView::checkItemHit(S32 x, S32 y, LLItemInfo& item, LLUUID* id, bool track) { LLVector3 pos_view = globalPosToView(item.getGlobalPosition()); - S32 item_x = llround(pos_view.mV[VX]); - S32 item_y = llround(pos_view.mV[VY]); + S32 item_x = ll_round(pos_view.mV[VX]); + S32 item_y = ll_round(pos_view.mV[VY]); if (x < item_x - BIG_DOT_RADIUS) return false; if (x > item_x + BIG_DOT_RADIUS) return false; @@ -1599,8 +1598,8 @@ BOOL LLWorldMapView::handleMouseDown( S32 x, S32 y, MASK mask ) { gFocusMgr.setMouseCapture( this ); - mMouseDownPanX = llround(sPanX); - mMouseDownPanY = llround(sPanY); + mMouseDownPanX = ll_round(sPanX); + mMouseDownPanY = ll_round(sPanY); mMouseDownX = x; mMouseDownY = y; sHandledLastClick = TRUE; diff --git a/indra/newview/pipeline.cpp b/indra/newview/pipeline.cpp index 3dfe1e5992..03712c1065 100755 --- a/indra/newview/pipeline.cpp +++ b/indra/newview/pipeline.cpp @@ -207,15 +207,9 @@ F32 LLPipeline::CameraDoFResScale; F32 LLPipeline::RenderAutoHideSurfaceAreaLimit; LLTrace::EventStatHandle<S64> LLPipeline::sStatBatchSize("renderbatchsize"); -const F32 BACKLIGHT_DAY_MAGNITUDE_AVATAR = 0.2f; -const F32 BACKLIGHT_NIGHT_MAGNITUDE_AVATAR = 0.1f; const F32 BACKLIGHT_DAY_MAGNITUDE_OBJECT = 0.1f; const F32 BACKLIGHT_NIGHT_MAGNITUDE_OBJECT = 0.08f; -const S32 MAX_OFFSCREEN_GEOMETRY_CHANGES_PER_FRAME = 10; -const U32 REFLECTION_MAP_RES = 128; const U32 DEFERRED_VB_MASK = LLVertexBuffer::MAP_VERTEX | LLVertexBuffer::MAP_TEXCOORD0 | LLVertexBuffer::MAP_TEXCOORD1; -// Max number of occluders to search for. JC -const S32 MAX_OCCLUDER_COUNT = 2; extern S32 gBoxFrame; //extern BOOL gHideSelectedObjects; @@ -410,16 +404,6 @@ static LLPipelineListener sPipelineListener; static LLCullResult* sCull = NULL; -static const U32 gl_cube_face[] = -{ - GL_TEXTURE_CUBE_MAP_POSITIVE_X_ARB, - GL_TEXTURE_CUBE_MAP_NEGATIVE_X_ARB, - GL_TEXTURE_CUBE_MAP_POSITIVE_Y_ARB, - GL_TEXTURE_CUBE_MAP_NEGATIVE_Y_ARB, - GL_TEXTURE_CUBE_MAP_POSITIVE_Z_ARB, - GL_TEXTURE_CUBE_MAP_NEGATIVE_Z_ARB, -}; - void validate_framebuffer_object(); diff --git a/indra/newview/skins/default/xui/en/floater_about.xml b/indra/newview/skins/default/xui/en/floater_about.xml index ef2f158a86..60f36770bb 100755 --- a/indra/newview/skins/default/xui/en/floater_about.xml +++ b/indra/newview/skins/default/xui/en/floater_about.xml @@ -51,44 +51,20 @@ name="credits_panel"> <text follows="top|left|right" - height="10" + height="20" layout="topleft" left="5" name="linden_intro" top="10" width="435" wrap="true"> -Second Life is brought to you by the Lindens: - </text> - <text_editor - enabled="false" - follows="top|left" - height="98" - bg_readonly_color="Transparent" - left="5" - text_color="LtGray" - max_length="65536" - name="linden_names" - top_pad="10" - width="435" - word_wrap="true"> -Philip, Andrew, Doug, Richard, Phoenix, Ian, Mark, Robin, Dan, Char, Ryan, Eric, Jim, Lee, Jeff, Michael, Kelly, Steve, Catherine, Bub, Ramzi, Jill, Jeska, Don, Kona, Callum, Charity, Jack, Shawn, babbage, James, Lauren, Blue, Brent, Reuben, Pathfinder, Jesse, Patsy, Torley, Bo, Cyn, Jonathan, Gia, Annette, Ginsu, Harry, Lex, Runitai, Guy, Cornelius, Beth, Swiss, Thumper, Wendy, Teeple, Seth, Dee, Mia, Sally, Liana, Aura, Beez, Milo, Red, Gulliver, Marius, Joe, Jose, Dore, Justin, Nora, Morpheus, Lexie, Amber, Chris, Xan, Leyla, Walker, Sabin, Joshua, Hiromi, Tofu, Fritz, June, Jean, Ivy, Dez, Ken, Betsy, Which, Spike, Rob, Zee, Dustin, George, Claudia, del, Matthew, jane, jay, Adrian, Yool, Rika, Yoz, siobhan, Qarl, Benjamin, Beast, Everett, madhavi, Christopher, Izzy, stephany, Jeremy, sean, adreanne, Pramod, Tobin, sejong, Iridium, maurice, kj, Meta, kari, JP, bert, kyle, Jon, Socrates, Bridie, Ivan, maria, Aric, Coco, Periapse, sandy, Storrs, Lotte, Colossus, Brad, Pastrami, Zen, BigPapi, Banzai, Sardonyx, Mani, Garry, Jaime, Neuro, Samuel, Niko, CeeLo, Austin, Soft, Poppy, emma, tessa, angelo, kurz, alexa, Sue, CG, Blake, Erica, Brett, Bevis, kristen, Q, simon, Enus, MJ, laurap, Kip, Scouse, Ron, Ram, kend, Marty, Prospero, melissa, kraft, Nat, Seraph, Hamilton, Lordan, Green, miz, Ashlei, Trinity, Ekim, Echo, Charlie, Rowan, Rome, Jt, Doris, benoc, Christy, Bao, Kate, Tj, Patch, Cheah, Johan, Brandy, Angela, Oreh, Cogsworth, Lan, Mitchell, Space, Bambers, Einstein, Bender, Malbers, Matias, Maggie, Rothman, Milton, Niall, Marin, Allison, Mango, Andrea, Katt, Yi, Ambroff, Rico, Raymond, Gail, Christa, William, Dawn, Usi, Dynamike, M, Corr, Dante, Molly, kaylee, Danica, Kelv, Lil, jacob, Nya, Rodney, elsie, Blondin, Grant, Nyx, Devin, Monty, Minerva, Keira, Katie, Jenn, Makai, Clare, Joy, Cody, Gayathri, FJ, spider, Oskar, Landon, Jarv, Noelle, Al, Doc, Gray, Vir, t, Maestro, Simone, Shannon, yang, Courtney, Scott, charlene, Quixote, Susan, Zed, Amanda, Katelin, Esbee, JoRoan, Enkidu, roxie, Scarlet, Merov, Kevin, Judy, Rand, Newell, Les, Dessie, Galen, Michon, Geo, Siz, Calyle, Pete, Praveen, Callen, Sheldon, Pink, Nelson, jenelle, Terrence, Nathan, Juan, Sascha, Huseby, Karina, Kaye, Kotler, Lis, Darv, Charrell, Dakota, Kimmora, Theeba, Taka, Mae, Perry, Ducot, dana, Esther, Dough, gisele, Doten, Viale, Fisher, jessieann, ashley, Torres, delby, rountree, kurt, Slaton, Madison, Rue, Gino, Wen, Casssandra, Brodesky, Squid, Gez, Rakesh, Gecko, Ladan, Tony, Tatem, Squire, Falcon, BK, Crimp, Tiggs, Bacon, Coyot, Carmilla, Webb, Sea, Arch, Jillian, Jason, Bernard, Vogt, Peggy, dragon, Pup, xandix, Wallace, Bewest, Inoshiro, Rhett, AG, Aimee, Ghengis, Itiaes, Eli, Steffan, Epic, Grapes, Stone, Prep, Scobu, Robert, Alain, Carla, Vicky, Tia, Alec, Taras, Lisa, Oz, Ariane, Log, House, Kazu, Kim, Drofnas, Tyler, Campbell, Michele, Madeline, Nelly, Baron, Thor, Lori, Hele, Fredrik, Teddy, Pixie, Berry, Gabrielle, Alfonso, Brooke, Wolf, Ringo, Cru, Charlar, Rodvik, Gibson, Elise, Bagman, Greger, Leonidas, Jerm, Leslie, CB, Brenda, Durian, Carlo, mm, Zeeshan, Caleb, Max, Elikak, Mercille, Steph, Chase, Baker - </text_editor> - <text - follows="top|left" - height="10" - layout="topleft" - left="5" - name="contrib_intro" - top_pad="10" - width="435" - wrap="true"> +Second Life is brought to you by the Lindens, with open source contributions from: </text> <text_editor enabled="false" follows="top|left" - height="98" + height="340" bg_readonly_color="Transparent" left="5" text_color="LtGray" @@ -99,31 +75,6 @@ with open source contributions from: word_wrap="true"> Dummy Name replaced at run time </text_editor> - <text - follows="top|left" - height="10" - layout="topleft" - left="5" - name="trans_intro" - top_pad="10" - width="435" - wrap="true"> -and translations from: - </text> - <text_editor - enabled="false" - follows="top|left" - height="98" - bg_readonly_color="Transparent" - left="5" - text_color="LtGray" - max_length="65536" - name="trans_names" - top_pad="10" - width="435" - word_wrap="true"> -Dummy Name replaced at run time - </text_editor> </panel> <panel border="true" @@ -138,7 +89,7 @@ Dummy Name replaced at run time left="5" text_color="LtGray" max_length="65536" - name="credits_editor" + name="licenses_editor" top="5" width="435" word_wrap="true"> diff --git a/indra/newview/skins/default/xui/en/floater_joystick.xml b/indra/newview/skins/default/xui/en/floater_joystick.xml index 259acccb68..3dfdf8e1a5 100755 --- a/indra/newview/skins/default/xui/en/floater_joystick.xml +++ b/indra/newview/skins/default/xui/en/floater_joystick.xml @@ -4,7 +4,7 @@ height="500" layout="topleft" name="Joystick" - help_topic="joystick" + help_topic="Viewerhelp:Joystick_Configuration" title="JOYSTICK CONFIGURATION" width="569"> <floater.string diff --git a/indra/newview/skins/default/xui/en/floater_openobject.xml b/indra/newview/skins/default/xui/en/floater_openobject.xml index bf6e0c4917..912db80bcc 100755 --- a/indra/newview/skins/default/xui/en/floater_openobject.xml +++ b/indra/newview/skins/default/xui/en/floater_openobject.xml @@ -3,10 +3,10 @@ legacy_header_height="18" can_resize="true" default_tab_group="1" - height="350" + height="370" layout="topleft" - min_height="160" - min_width="280" + min_height="190" + min_width="285" name="objectcontents" help_topic="objectcontents" save_rect="true" @@ -31,36 +31,81 @@ background_visible="false" draw_border="false" follows="all" - height="276" + height="240" layout="topleft" left="10" name="object_contents" top_pad="0" width="284" /> + <view_border + bevel_style="none" + follows="bottom|left" + height="50" + highlight_light_color="0.6 0.6 0.6" + layout="topleft" + left="10" + name="border" + top_pad="5" + width="270"/> + <text + follows="bottom|left" + height="15" + layout="topleft" + left="15" + name="border_note" + text_color="White" + top_delta="5"> + Copy to inventory and wear + </text> + <button + follows="bottom|left" + height="23" + label="Add to outfit" + label_selected="Add to outfit" + layout="topleft" + left="15" + name="copy_and_wear_button" + top_pad="3" + width="135"> + <button.commit_callback + function="OpenObject.MoveAndWear" /> + </button> + <button + follows="bottom|left" + height="23" + label="Replace outfit" + label_selected="Replace outfit" + layout="topleft" + left_pad="5" + name="copy_and_replace_button" + width="120"> + <button.commit_callback + function="OpenObject.ReplaceOutfit" /> + </button> <button follows="bottom|left" height="23" - label="Copy to inventory" - label_selected="Copy to inventory" + label="Only copy to inventory" + label_selected="Only copy to inventory" layout="topleft" left="15" name="copy_to_inventory_button" tab_group="1" - top_pad="5" - width="120"> + top_pad="9" + width="135"> <button.commit_callback function="OpenObject.MoveToInventory" /> </button> <button follows="bottom|left" height="23" - label="Copy and add to outfit" - label_selected="Copy and add to outfit" + label="Cancel" + label_selected="Cancel" layout="topleft" left_pad="5" - name="copy_and_wear_button" - width="135"> + name="cancel_button" + width="120"> <button.commit_callback - function="OpenObject.MoveAndWear" /> + function="OpenObject.Cancel" /> </button> </floater> diff --git a/indra/newview/skins/default/xui/en/floater_pay.xml b/indra/newview/skins/default/xui/en/floater_pay.xml index 41a7134b1d..9d91f801a6 100755 --- a/indra/newview/skins/default/xui/en/floater_pay.xml +++ b/indra/newview/skins/default/xui/en/floater_pay.xml @@ -2,12 +2,12 @@ <floater legacy_header_height="18" can_minimize="false" - height="200" + height="186" layout="topleft" name="Give Money" help_topic="give_money" save_rect="true" - width="250"> + width="261"> <string name="payee_group"> Pay Group @@ -21,88 +21,129 @@ type="string" length="1" follows="left|top" - font="SansSerifSmall" height="16" layout="topleft" left="10" - name="payee_name" - top="25" - use_ellipses="true" - width="230"> - Test Name That Is Extremely Long To Check Clipping + top="24" + name="paying_text" + width="180"> + You are paying: </text> - <button - height="23" - label="L$1" - label_selected="L$1" - layout="topleft" - left="35" - name="fastpay 1" - top_pad="8" - width="80" /> - <button - height="23" - label="L$5" - label_selected="L$5" - layout="topleft" - left_pad="15" - name="fastpay 5" - width="80" /> - <button - height="23" - label="L$10" - label_selected="L$10" - layout="topleft" - left="35" - name="fastpay 10" - top_pad="8" - width="80" /> - <button - height="23" - label="L$20" - label_selected="L$20" - layout="topleft" - left_pad="15" - name="fastpay 20" - width="80" /> <text type="string" length="1" follows="left|top" - height="18" + font="SansSerifSmall" + height="16" layout="topleft" - left="35" - name="amount text" - top_pad="8" + left="10" + top_pad="5" + name="payee_name" + use_ellipses="true" width="180"> - Or, choose amount: + Test Name That Is Extremely Long To Check Clipping </text> - <line_editor - border_style="line" - follows="left|top|right" - height="19" - top_pad="0" - layout="topleft" - left="130" - max_length_bytes="9" - name="amount" - width="80" /> - <button - enabled="false" - height="23" - label="Pay" - label_selected="Pay" - layout="topleft" - left="20" - name="pay btn" - top_pad="15" - width="100" /> - <button - height="23" - label="Cancel" - label_selected="Cancel" + <panel + border_thickness="0" + height="104" + label="Search" layout="topleft" + left="0" + top_pad="10" + help_topic="avatarpicker" + name="PatternsPanel" + width="120"> + <button + height="23" + label="Pay L$ 1" + label_selected="Pay L$ 1" + layout="topleft" + left="10" + top="0" + name="fastpay 1" + width="110" /> + <button + height="23" + label="Pay L$ 5" + label_selected="Pay L$ 5" + layout="topleft" + left="10" + top_pad="4" + name="fastpay 5" + width="110" /> + <button + height="23" + label="Pay L$ 10" + label_selected="Pay L$ 10" + layout="topleft" + left="10" + top_pad="4" + name="fastpay 10" + width="110" /> + <button + height="23" + label="Pay L$ 20" + label_selected="Pay L$ 20" + layout="topleft" + left="10" + top_pad="4" + name="fastpay 20" + width="110" /> + </panel> + <view_border + bevel_style="in" + width="1" + height="104" left_pad="10" - name="cancel btn" - width="100" /> + layout="topleft" /> + <panel + border_thickness="0" + height="104" + label="Search" + layout="topleft" + left_pad="0" + name="InputPanel" + width="120"> + <text + type="string" + length="1" + follows="left|top" + height="18" + layout="topleft" + left="10" + top="0" + name="amount text" + width="110"> + Other amount: + </text> + <line_editor + border_style="line" + follows="left|top|right" + height="19" + layout="topleft" + left="10" + top_pad="0" + max_length_bytes="9" + name="amount" + width="90" /> + <button + enabled="false" + height="23" + label="Pay" + label_selected="Pay" + layout="topleft" + left="10" + top_pad="17" + name="pay btn" + width="110" /> + <button + height="23" + label="Cancel" + label_selected="Cancel" + layout="topleft" + left="10" + top_pad="4" + name="cancel btn" + width="110" /> + </panel> </floater> diff --git a/indra/newview/skins/default/xui/en/floater_pay_object.xml b/indra/newview/skins/default/xui/en/floater_pay_object.xml index d3a35c2051..f1e27b918e 100755 --- a/indra/newview/skins/default/xui/en/floater_pay_object.xml +++ b/indra/newview/skins/default/xui/en/floater_pay_object.xml @@ -2,12 +2,12 @@ <floater legacy_header_height="18" can_minimize="false" - height="225" + height="228" layout="topleft" name="Give Money" help_topic="give_money" save_rect="true" - width="250"> + width="261"> <string name="payee_group"> Pay Group @@ -16,12 +16,25 @@ name="payee_resident"> Pay Resident </string> + <text + type="string" + length="1" follows="left|top" height="16" layout="topleft" left="10" - top_pad="24" + top="24" + name="paying_text" + width="180"> + You are paying: + </text> + <text + follows="left|top" + height="16" + layout="topleft" + left="10" + top_pad="5" name="payee_name" use_ellipses="true" width="225"> @@ -40,7 +53,7 @@ width="180"> Via object: </text> - <icon + <icon height="16" width="16" image_name="Inv_Object" @@ -64,78 +77,107 @@ width="188"> My awesome object with a really damn long name </text> - <button - height="23" - label="L$1" - label_selected="L$1" - layout="topleft" - left="25" - name="fastpay 1" - top_pad="8" - width="80" /> - <button - height="23" - label="L$5" - label_selected="L$5" - layout="topleft" - left_pad="15" - name="fastpay 5" - width="80" /> - <button - height="23" - label="L$10" - label_selected="L$10" - layout="topleft" - left="25" - name="fastpay 10" - top_pad="8" - width="80" /> - <button - height="23" - label="L$20" - label_selected="L$20" + <panel + border_thickness="0" + height="104" + label="Search" layout="topleft" - left_pad="15" - name="fastpay 20" - width="80" /> - <text - type="string" - length="1" - follows="left|top" - height="14" - layout="topleft" - left="25" - name="amount text" - top_pad="8" - width="180"> - Or, choose amount: - </text> - <line_editor - border_style="line" - follows="left|top|right" - height="21" - top_pad="0" - layout="topleft" - left="120" - max_length_bytes="9" - name="amount" - width="80" /> - <button - enabled="false" - height="23" - label="Pay" - label_selected="Pay" - layout="topleft" - left="10" - name="pay btn" - top_pad="5" - width="100" /> - <button - height="23" - label="Cancel" - label_selected="Cancel" + left="0" + top_pad="10" + help_topic="avatarpicker" + name="PatternsPanel" + width="120"> + <button + height="23" + label="Pay L$ 1" + label_selected="Pay L$ 1" + layout="topleft" + left="10" + top="0" + name="fastpay 1" + width="110" /> + <button + height="23" + label="Pay L$ 5" + label_selected="Pay L$ 5" + layout="topleft" + left="10" + top_pad="4" + name="fastpay 5" + width="110" /> + <button + height="23" + label="Pay L$ 10" + label_selected="Pay L$ 10" + layout="topleft" + left="10" + top_pad="4" + name="fastpay 10" + width="110" /> + <button + height="23" + label="Pay L$ 20" + label_selected="Pay L$ 20" + layout="topleft" + left="10" + top_pad="4" + name="fastpay 20" + width="110" /> + </panel> + <view_border + bevel_style="in" + width="1" + height="104" + left_pad="10" + layout="topleft" /> + <panel + border_thickness="0" + height="104" + label="Search" layout="topleft" - left_pad="5" - name="cancel btn" - width="100" /> + left_pad="0" + name="InputPanel" + width="120"> + <text + type="string" + length="1" + follows="left|top" + height="18" + layout="topleft" + left="10" + top="0" + name="amount text" + width="180"> + Other amount: + </text> + <line_editor + border_style="line" + follows="left|top|right" + height="19" + layout="topleft" + left="10" + top_pad="0" + max_length_bytes="9" + name="amount" + width="90" /> + <button + enabled="false" + height="23" + label="Pay" + label_selected="Pay" + layout="topleft" + left="10" + top_pad="17" + name="pay btn" + width="110" /> + <button + height="23" + label="Cancel" + label_selected="Cancel" + layout="topleft" + left="10" + top_pad="4" + name="cancel btn" + width="110" /> + </panel> </floater> diff --git a/indra/newview/skins/default/xui/en/menu_inventory.xml b/indra/newview/skins/default/xui/en/menu_inventory.xml index 6fa45d7d66..7099db63ab 100755 --- a/indra/newview/skins/default/xui/en/menu_inventory.xml +++ b/indra/newview/skins/default/xui/en/menu_inventory.xml @@ -531,7 +531,7 @@ name="Sound Play"> <menu_item_call.on_click function="Inventory.DoToSelected" - parameter="open" /> + parameter="sound_play" /> </menu_item_call> <menu_item_separator layout="topleft" diff --git a/indra/newview/skins/default/xui/en/menu_viewer.xml b/indra/newview/skins/default/xui/en/menu_viewer.xml index c96a0366ca..d737df3941 100755 --- a/indra/newview/skins/default/xui/en/menu_viewer.xml +++ b/indra/newview/skins/default/xui/en/menu_viewer.xml @@ -2105,6 +2105,18 @@ parameter="notifications_console" /> </menu_item_call> <menu_item_check + label="Region Debug Console" + name="Region Debug Console" + shortcut="control|shift|`" + use_mac_ctrl="true"> + <menu_item_check.on_check + function="Floater.Visible" + parameter="region_debug_console" /> + <menu_item_check.on_click + function="Floater.Toggle" + parameter="region_debug_console" /> + </menu_item_check> + <menu_item_check label="Fast Timers" name="Fast Timers" shortcut="control|shift|9" diff --git a/indra/newview/skins/default/xui/en/notifications.xml b/indra/newview/skins/default/xui/en/notifications.xml index 340777faf3..6a9a8727fb 100755 --- a/indra/newview/skins/default/xui/en/notifications.xml +++ b/indra/newview/skins/default/xui/en/notifications.xml @@ -5246,6 +5246,19 @@ Warning: The 'Pay object' click action has been set, but it will only <notification icon="alertmodal.tga" + name="PayConfirmation" + type="alertmodal"> + Confirm that you want to pay L$[AMOUNT] to [TARGET]. + <tag>confirm</tag> + <usetemplate + ignoretext="Confirm before paying (sums over L$200)" + name="okcancelignore" + notext="Cancel" + yestext="Pay"/> + </notification> + + <notification + icon="alertmodal.tga" name="OpenObjectCannotCopy" type="alertmodal"> There are no items in this object that you are allowed to copy. diff --git a/indra/newview/skins/default/xui/en/strings.xml b/indra/newview/skins/default/xui/en/strings.xml index c0a8866549..51747eb0be 100755 --- a/indra/newview/skins/default/xui/en/strings.xml +++ b/indra/newview/skins/default/xui/en/strings.xml @@ -2307,6 +2307,7 @@ The [[MARKETPLACE_CREATE_STORE_URL] Marketplace store] is returning errors. <string name="LoadingContents">Loading contents...</string> <string name="NoContents">No contents</string> <string name="WornOnAttachmentPoint" value=" (worn on [ATTACHMENT_POINT])" /> + <string name="AttachmentErrorMessage" value=" ([ATTACHMENT_ERROR])" /> <string name="ActiveGesture" value="[GESLABEL] (active)"/> <!-- Inventory permissions --> <string name="PermYes">Yes</string> @@ -2433,9 +2434,12 @@ The [[MARKETPLACE_CREATE_STORE_URL] Marketplace store] is returning errors. <string name="Stomach">Stomach</string> <string name="Left Pec">Left Pec</string> <string name="Right Pec">Right Pec</string> - <string name="Neck">Neck</string> - <string name="Avatar Center">Avatar Center</string> + <string name="Neck">Neck</string> + <string name="Avatar Center">Avatar Center</string> <string name="Invalid Attachment">Invalid Attachment Point</string> + <string name="ATTACHMENT_MISSING_ITEM">Error: missing item</string> + <string name="ATTACHMENT_MISSING_BASE_ITEM">Error: missing base item</string> + <string name="ATTACHMENT_NOT_ATTACHED">Error: object is in current outfit but not attached</string> <!-- Avatar age computation, see LLDateUtil::ageFromDate --> <string name="YearsMonthsOld">[AGEYEARS] [AGEMONTHS] old</string> diff --git a/indra/newview/tests/lllogininstance_test.cpp b/indra/newview/tests/lllogininstance_test.cpp index adeb848e03..1b0334498e 100755 --- a/indra/newview/tests/lllogininstance_test.cpp +++ b/indra/newview/tests/lllogininstance_test.cpp @@ -193,14 +193,6 @@ void LLAppViewer::forceQuit(void) {} LLAppViewer * LLAppViewer::sInstance = 0; //----------------------------------------------------------------------------- -#include "llnotificationsutil.h" -LLNotificationPtr LLNotificationsUtil::add(const std::string& name, - const LLSD& substitutions, - const LLSD& payload, - boost::function<void (const LLSD&, const LLSD&)> functor) { return LLNotificationPtr((LLNotification*)0); } - - -//----------------------------------------------------------------------------- #include "llupdaterservice.h" std::string const & LLUpdaterService::pumpName(void) @@ -488,8 +480,6 @@ namespace tut template<> template<> void lllogininstance_object::test<3>() { - skip(); - set_test_name("Test Mandatory Update User Accepts"); // Part 1 - Mandatory Update, with User accepts response. @@ -517,8 +507,6 @@ namespace tut template<> template<> void lllogininstance_object::test<4>() { - skip(); - set_test_name("Test Mandatory Update User Decline"); // Test connect with update needed. diff --git a/indra/newview/viewer_manifest.py b/indra/newview/viewer_manifest.py index 7544fe1c41..176f257005 100755 --- a/indra/newview/viewer_manifest.py +++ b/indra/newview/viewer_manifest.py @@ -38,7 +38,7 @@ viewer_dir = os.path.dirname(__file__) # Put it FIRST because some of our build hosts have an ancient install of # indra.util.llmanifest under their system Python! sys.path.insert(0, os.path.join(viewer_dir, os.pardir, "lib", "python")) -from indra.util.llmanifest import LLManifest, main, proper_windows_path, path_ancestors, CHANNEL_VENDOR_BASE, RELEASE_CHANNEL, ManifestError +from indra.util.llmanifest import LLManifest, main, path_ancestors, CHANNEL_VENDOR_BASE, RELEASE_CHANNEL, ManifestError try: from llbase import llsd except ImportError: @@ -55,7 +55,6 @@ class ViewerManifest(LLManifest): def construct(self): super(ViewerManifest, self).construct() - self.exclude("*.svn*") self.path(src="../../scripts/messages/message_template.msg", dst="app_settings/message_template.msg") self.path(src="../../etc/message.xml", dst="app_settings/message.xml") @@ -74,26 +73,6 @@ class ViewerManifest(LLManifest): contributions_path = "../../doc/contributions.txt" contributor_names = self.extract_names(contributions_path) self.put_in_file(contributor_names, "contributors.txt", src=contributions_path) - # include the extracted list of translators - translations_path = "../../doc/translations.txt" - translator_names = self.extract_names(translations_path) - self.put_in_file(translator_names, "translators.txt", src=translations_path) - # include the list of Lindens (if any) - # see https://wiki.lindenlab.com/wiki/Generated_Linden_Credits - linden_names_path = os.getenv("LINDEN_CREDITS") - if not linden_names_path : - print "No 'LINDEN_CREDITS' specified in environment, using built-in list" - else: - try: - linden_file = open(linden_names_path,'r') - except IOError: - print "No Linden names found at '%s', using built-in list" % linden_names_path - else: - # all names should be one line, but the join below also converts to a string - linden_names = ', '.join(linden_file.readlines()) - self.put_in_file(linden_names, "lindens.txt", src=linden_names_path) - linden_file.close() - print "Linden names extracted from '%s'" % linden_names_path # ... and the entire windlight directory self.path("windlight") @@ -107,6 +86,9 @@ class ViewerManifest(LLManifest): self.path("dictionaries") self.end_prefix(pkgdir) + # include the extracted packages information (see BuildPackagesInfo.cmake) + self.path(src=os.path.join(self.args['build'],"packages-info.txt"), dst="packages-info.txt") + # CHOP-955: If we have "sourceid" or "viewer_channel" in the # build process environment, generate it into # settings_install.xml. @@ -349,14 +331,18 @@ class Windows_i686_Manifest(ViewerManifest): def construct(self): super(Windows_i686_Manifest, self).construct() + pkgdir = os.path.join(self.args['build'], os.pardir, 'packages') + relpkgdir = os.path.join(pkgdir, "lib", "release") + debpkgdir = os.path.join(pkgdir, "lib", "debug") + if self.is_packaging_viewer(): # Find secondlife-bin.exe in the 'configuration' dir, then rename it to the result of final_exe. self.path(src='%s/secondlife-bin.exe' % self.args['configuration'], dst=self.final_exe()) # Plugin host application - self.path2basename(os.path.join(os.pardir, - 'llplugin', 'slplugin', self.args['configuration']), - "slplugin.exe") + # The current slplugin package places slplugin.exe right into the + # packages base directory. + self.path2basename(pkgdir, "slplugin.exe") self.path2basename("../viewer_components/updater/scripts/windows", "update_install.bat") # Get shared libs from the shared libs staging directory @@ -376,15 +362,10 @@ class Windows_i686_Manifest(ViewerManifest): # Mesh 3rd party libs needed for auto LOD and collada reading try: - if self.args['configuration'].lower() == 'debug': - self.path("libcollada14dom22-d.dll") - else: - self.path("libcollada14dom22.dll") - self.path("glod.dll") except RuntimeError, err: print err.message - print "Skipping COLLADA and GLOD libraries (assumming linked statically)" + print "Skipping GLOD library (assumming linked statically)" # Get fmodex dll, continue if missing try: @@ -443,82 +424,52 @@ class Windows_i686_Manifest(ViewerManifest): self.path("featuretable_xp.txt") # Media plugins - QuickTime - if self.prefix(src='../media_plugins/quicktime/%s' % self.args['configuration'], dst="llplugin"): - self.path("media_plugin_quicktime.dll") - self.end_prefix() - # Media plugins - WebKit/Qt - if self.prefix(src='../media_plugins/webkit/%s' % self.args['configuration'], dst="llplugin"): + if self.prefix(src=os.path.join(pkgdir, "llplugin"), dst="llplugin"): + self.path("media_plugin_quicktime.dll") self.path("media_plugin_webkit.dll") - self.end_prefix() + self.path("qtcore4.dll") + self.path("qtgui4.dll") + self.path("qtnetwork4.dll") + self.path("qtopengl4.dll") + self.path("qtwebkit4.dll") + self.path("qtxmlpatterns4.dll") + + # For WebKit/Qt plugin runtimes (image format plugins) + if self.prefix(src="imageformats", dst="imageformats"): + self.path("qgif4.dll") + self.path("qico4.dll") + self.path("qjpeg4.dll") + self.path("qmng4.dll") + self.path("qsvg4.dll") + self.path("qtiff4.dll") + self.end_prefix() + + # For WebKit/Qt plugin runtimes (codec/character encoding plugins) + if self.prefix(src="codecs", dst="codecs"): + self.path("qcncodecs4.dll") + self.path("qjpcodecs4.dll") + self.path("qkrcodecs4.dll") + self.path("qtwcodecs4.dll") + self.end_prefix() + + self.end_prefix() # winmm.dll shim if self.prefix(src='../media_plugins/winmmshim/%s' % self.args['configuration'], dst=""): self.path("winmm.dll") self.end_prefix() - if self.args['configuration'].lower() == 'debug': - if self.prefix(src=os.path.join(os.pardir, 'packages', 'lib', 'debug'), - dst="llplugin"): + if self.prefix(src=debpkgdir, dst="llplugin"): self.path("libeay32.dll") - self.path("qtcored4.dll") - self.path("qtguid4.dll") - self.path("qtnetworkd4.dll") - self.path("qtopengld4.dll") - self.path("qtwebkitd4.dll") - self.path("qtxmlpatternsd4.dll") self.path("ssleay32.dll") - - # For WebKit/Qt plugin runtimes (image format plugins) - if self.prefix(src="imageformats", dst="imageformats"): - self.path("qgifd4.dll") - self.path("qicod4.dll") - self.path("qjpegd4.dll") - self.path("qmngd4.dll") - self.path("qsvgd4.dll") - self.path("qtiffd4.dll") - self.end_prefix() - - # For WebKit/Qt plugin runtimes (codec/character encoding plugins) - if self.prefix(src="codecs", dst="codecs"): - self.path("qcncodecsd4.dll") - self.path("qjpcodecsd4.dll") - self.path("qkrcodecsd4.dll") - self.path("qtwcodecsd4.dll") - self.end_prefix() - self.end_prefix() + else: - if self.prefix(src=os.path.join(os.pardir, 'packages', 'lib', 'release'), - dst="llplugin"): + if self.prefix(src=relpkgdir, dst="llplugin"): self.path("libeay32.dll") - self.path("qtcore4.dll") - self.path("qtgui4.dll") - self.path("qtnetwork4.dll") - self.path("qtopengl4.dll") - self.path("qtwebkit4.dll") - self.path("qtxmlpatterns4.dll") self.path("ssleay32.dll") - - # For WebKit/Qt plugin runtimes (image format plugins) - if self.prefix(src="imageformats", dst="imageformats"): - self.path("qgif4.dll") - self.path("qico4.dll") - self.path("qjpeg4.dll") - self.path("qmng4.dll") - self.path("qsvg4.dll") - self.path("qtiff4.dll") - self.end_prefix() - - # For WebKit/Qt plugin runtimes (codec/character encoding plugins) - if self.prefix(src="codecs", dst="codecs"): - self.path("qcncodecs4.dll") - self.path("qjpcodecs4.dll") - self.path("qkrcodecs4.dll") - self.path("qtwcodecs4.dll") - self.end_prefix() - self.end_prefix() # pull in the crash logger and updater from other projects @@ -631,7 +582,7 @@ class Windows_i686_Manifest(ViewerManifest): while (not installer_created) and (nsis_attempts > 0): try: nsis_attempts-=1; - self.run_command('"' + proper_windows_path(NSIS_path) + '" ' + self.dst_path_of(tempfile)) + self.run_command('"' + NSIS_path + '" ' + self.dst_path_of(tempfile)) installer_created=True # if no exception was raised, the codesign worked except ManifestError, err: if nsis_attempts: @@ -668,12 +619,16 @@ class Darwin_i386_Manifest(ViewerManifest): # copy over the build result (this is a no-op if run within the xcode script) self.path(self.args['configuration'] + "/Second Life.app", dst="") + pkgdir = os.path.join(self.args['build'], os.pardir, 'packages') + relpkgdir = os.path.join(pkgdir, "lib", "release") + debpkgdir = os.path.join(pkgdir, "lib", "debug") + if self.prefix(src="", dst="Contents"): # everything goes in Contents self.path("Info.plist", dst="Info.plist") # copy additional libs in <bundle>/Contents/MacOS/ - self.path("../packages/lib/release/libndofdev.dylib", dst="Resources/libndofdev.dylib") - self.path("../packages/lib/release/libhunspell-1.3.0.dylib", dst="Resources/libhunspell-1.3.0.dylib") + self.path(os.path.join(relpkgdir, "libndofdev.dylib"), dst="Resources/libndofdev.dylib") + self.path(os.path.join(relpkgdir, "libhunspell-1.3.0.dylib"), dst="Resources/libhunspell-1.3.0.dylib") if self.prefix(dst="MacOS"): self.path2basename("../viewer_components/updater/scripts/darwin", "*.py") @@ -733,7 +688,6 @@ class Darwin_i386_Manifest(ViewerManifest): print "Skipping %s" % dst return [] - libdir = "../packages/lib/release" # dylibs is a list of all the .dylib files we expect to need # in our bundled sub-apps. For each of these we'll create a # symlink from sub-app/Contents/Resources to the real .dylib. @@ -743,7 +697,7 @@ class Darwin_i386_Manifest(ViewerManifest): "llcommon", self.args['configuration'], libfile), - os.path.join(libdir, libfile)), + os.path.join(relpkgdir, libfile)), dst=libfile) for libfile in ( @@ -754,7 +708,7 @@ class Darwin_i386_Manifest(ViewerManifest): "libexception_handler.dylib", "libGLOD.dylib", ): - dylibs += path_optional(os.path.join(libdir, libfile), libfile) + dylibs += path_optional(os.path.join(relpkgdir, libfile), libfile) # SLVoice and vivox lols, no symlinks needed for libfile in ( @@ -766,38 +720,41 @@ class Darwin_i386_Manifest(ViewerManifest): 'ca-bundle.crt', 'SLVoice', ): - self.path2basename(libdir, libfile) + self.path2basename(relpkgdir, libfile) # dylibs that vary based on configuration if self.args['configuration'].lower() == 'debug': for libfile in ( "libfmodexL.dylib", ): - dylibs += path_optional(os.path.join("../packages/lib/debug", - libfile), libfile) + dylibs += path_optional(os.path.join(debpkgdir, libfile), libfile) else: for libfile in ( "libfmodex.dylib", ): - dylibs += path_optional(os.path.join("../packages/lib/release", - libfile), libfile) + dylibs += path_optional(os.path.join(relpkgdir, libfile), libfile) # our apps - for app_bld_dir, app in (("mac_crash_logger", "mac-crash-logger.app"), + for app_bld_dir, app in ((os.path.join(os.pardir, + "mac_crash_logger", + self.args['configuration']), + "mac-crash-logger.app"), # plugin launcher - (os.path.join("llplugin", "slplugin"), "SLPlugin.app"), + (pkgdir, "SLPlugin.app"), ): - self.path2basename(os.path.join(os.pardir, - app_bld_dir, self.args['configuration']), - app) + self.path2basename(app_bld_dir, app) # our apps dependencies on shared libs # for each app, for each dylib we collected in dylibs, # create a symlink to the real copy of the dylib. resource_path = self.dst_path_of(os.path.join(app, "Contents", "Resources")) for libfile in dylibs: - symlinkf(os.path.join(os.pardir, os.pardir, os.pardir, libfile), - os.path.join(resource_path, libfile)) + src = os.path.join(os.pardir, os.pardir, os.pardir, libfile) + dst = os.path.join(resource_path, libfile) + try: + symlinkf(src, dst) + except OSError as err: + print "Can't symlink %s -> %s: %s" % (src, dst, err) # SLPlugin.app/Contents/Resources gets those Qt4 libraries it needs. if self.prefix(src="", dst="SLPlugin.app/Contents/Resources"): for libfile in ('libQtCore.4.dylib', @@ -814,26 +771,24 @@ class Darwin_i386_Manifest(ViewerManifest): 'libQtWebKit.4.7.1.dylib', 'libQtXml.4.dylib', 'libQtXml.4.7.1.dylib'): - self.path2basename("../packages/lib/release", libfile) + self.path2basename(relpkgdir, libfile) self.end_prefix("SLPlugin.app/Contents/Resources") # Qt4 codecs go to llplugin. Not certain why but this is the first # location probed according to dtruss so we'll go with that. - if self.prefix(src="../packages/plugins/codecs/", dst="llplugin/codecs"): + if self.prefix(src=os.path.join(pkgdir, "llplugin/codecs/"), dst="llplugin/codecs"): self.path("libq*.dylib") self.end_prefix("llplugin/codecs") # Similarly for imageformats. - if self.prefix(src="../packages/plugins/imageformats/", dst="llplugin/imageformats"): + if self.prefix(src=os.path.join(pkgdir, "llplugin/imageformats/"), dst="llplugin/imageformats"): self.path("libq*.dylib") self.end_prefix("llplugin/imageformats") # SLPlugin plugins proper - if self.prefix(src="", dst="llplugin"): - self.path2basename("../media_plugins/quicktime/" + self.args['configuration'], - "media_plugin_quicktime.dylib") - self.path2basename("../media_plugins/webkit/" + self.args['configuration'], - "media_plugin_webkit.dylib") + if self.prefix(src=os.path.join(pkgdir, "llplugin"), dst="llplugin"): + self.path("media_plugin_quicktime.dylib") + self.path("media_plugin_webkit.dylib") self.end_prefix("llplugin") self.end_prefix("Resources") @@ -858,48 +813,6 @@ class Darwin_i386_Manifest(ViewerManifest): def package_finish(self): global CHANNEL_VENDOR_BASE - # Sign the app if requested. - if 'signature' in self.args: - identity = self.args['signature'] - if identity == '': - identity = 'Developer ID Application' - - # Look for an environment variable set via build.sh when running in Team City. - try: - build_secrets_checkout = os.environ['build_secrets_checkout'] - except KeyError: - pass - else: - # variable found so use it to unlock keyvchain followed by codesign - home_path = os.environ['HOME'] - keychain_pwd_path = os.path.join(build_secrets_checkout,'code-signing-osx','password.txt') - keychain_pwd = open(keychain_pwd_path).read().rstrip() - - self.run_command('security unlock-keychain -p "%s" "%s/Library/Keychains/viewer.keychain"' % ( keychain_pwd, home_path ) ) - signed=False - sign_attempts=3 - sign_retry_wait=15 - while (not signed) and (sign_attempts > 0): - try: - sign_attempts-=1; - self.run_command( - 'codesign --verbose --force --keychain "%(home_path)s/Library/Keychains/viewer.keychain" --sign %(identity)r %(bundle)r' % { - 'home_path' : home_path, - 'identity': identity, - 'bundle': self.get_dst_prefix() - }) - signed=True # if no exception was raised, the codesign worked - except ManifestError, err: - if sign_attempts: - print >> sys.stderr, "codesign failed, waiting %d seconds before retrying" % sign_retry_wait - time.sleep(sign_retry_wait) - sign_retry_wait*=2 - else: - print >> sys.stderr, "Maximum codesign attempts exceeded; giving up" - raise - - imagename="SecondLife_" + '_'.join(self.args['version']) - # MBW -- If the mounted volume name changes, it breaks the .DS_Store's background image and icon positioning. # If we really need differently named volumes, we'll need to create multiple DS_Store file images, or use some other trick. @@ -981,6 +894,56 @@ class Darwin_i386_Manifest(ViewerManifest): # Set the disk image root's custom icon bit self.run_command('SetFile -a C %r' % volpath) + + # Sign the app if requested; + # do this in the copy that's in the .dmg so that the extended attributes used by + # the signature are preserved; moving the files using python will leave them behind + # and invalidate the signatures. + if 'signature' in self.args: + app_in_dmg=os.path.join(volpath,self.app_name()+".app") + print "Attempting to sign '%s'" % app_in_dmg + identity = self.args['signature'] + if identity == '': + identity = 'Developer ID Application' + + # Look for an environment variable set via build.sh when running in Team City. + try: + build_secrets_checkout = os.environ['build_secrets_checkout'] + except KeyError: + pass + else: + # variable found so use it to unlock keychain followed by codesign + home_path = os.environ['HOME'] + keychain_pwd_path = os.path.join(build_secrets_checkout,'code-signing-osx','password.txt') + keychain_pwd = open(keychain_pwd_path).read().rstrip() + + self.run_command('security unlock-keychain -p "%s" "%s/Library/Keychains/viewer.keychain"' % ( keychain_pwd, home_path ) ) + signed=False + sign_attempts=3 + sign_retry_wait=15 + while (not signed) and (sign_attempts > 0): + try: + sign_attempts-=1; + self.run_command( + 'codesign --verbose --deep --force --keychain "%(home_path)s/Library/Keychains/viewer.keychain" --sign %(identity)r %(bundle)r' % { + 'home_path' : home_path, + 'identity': identity, + 'bundle': app_in_dmg + }) + signed=True # if no exception was raised, the codesign worked + except ManifestError, err: + if sign_attempts: + print >> sys.stderr, "codesign failed, waiting %d seconds before retrying" % sign_retry_wait + time.sleep(sign_retry_wait) + sign_retry_wait*=2 + else: + print >> sys.stderr, "Maximum codesign attempts exceeded; giving up" + raise + self.run_command('spctl -a -texec -vv %(bundle)r' % { 'bundle': app_in_dmg }) + + imagename="SecondLife_" + '_'.join(self.args['version']) + + finally: # Unmount the image even if exceptions from any of the above self.run_command('hdiutil detach -force %r' % devfile) @@ -995,6 +958,11 @@ class Darwin_i386_Manifest(ViewerManifest): class LinuxManifest(ViewerManifest): def construct(self): super(LinuxManifest, self).construct() + + pkgdir = os.path.join(self.args['build'], os.pardir, 'packages') + relpkgdir = os.path.join(pkgdir, "lib", "release") + debpkgdir = os.path.join(pkgdir, "lib", "debug") + self.path("licenses-linux.txt","licenses.txt") if self.prefix("linux_tools", dst=""): self.path("client-readme.txt","README-linux.txt") @@ -1013,7 +981,7 @@ class LinuxManifest(ViewerManifest): if self.prefix(src="", dst="bin"): self.path("secondlife-bin","do-not-directly-run-secondlife-bin") self.path("../linux_crash_logger/linux-crash-logger","linux-crash-logger.bin") - self.path2basename("../llplugin/slplugin", "SLPlugin") + self.path2basename(pkgdir, "SLPlugin") self.path2basename("../viewer_components/updater/scripts/linux", "update_install") self.end_prefix("bin") @@ -1033,9 +1001,9 @@ class LinuxManifest(ViewerManifest): self.end_prefix(icon_path) # plugins - if self.prefix(src="", dst="bin/llplugin"): - self.path2basename("../media_plugins/webkit", "libmedia_plugin_webkit.so") - self.path("../media_plugins/gstreamer010/libmedia_plugin_gstreamer010.so", "libmedia_plugin_gstreamer.so") + if self.prefix(src=os.path.join(pkgdir, "llplugin"), dst="bin/llplugin"): + self.path("libmedia_plugin_webkit.so") + self.path("libmedia_plugin_gstreamer.so") self.end_prefix("bin/llplugin") # llcommon @@ -1097,7 +1065,11 @@ class Linux_i686_Manifest(LinuxManifest): def construct(self): super(Linux_i686_Manifest, self).construct() - if self.prefix("../packages/lib/release", dst="lib"): + pkgdir = os.path.join(self.args['build'], os.pardir, 'packages') + relpkgdir = os.path.join(pkgdir, "lib", "release") + debpkgdir = os.path.join(pkgdir, "lib", "debug") + + if self.prefix(relpkgdir, dst="lib"): self.path("libapr-1.so") self.path("libapr-1.so.0") self.path("libapr-1.so.0.4.5") @@ -1117,7 +1089,7 @@ class Linux_i686_Manifest(LinuxManifest): self.path("libfusion-1.4.so.5") self.path("libdirect-1.4.so.5*") self.path("libhunspell-1.3.so*") - self.path("libalut.so") + self.path("libalut.so*") self.path("libopenal.so", "libopenal.so.1") self.path("libopenal.so", "libvivoxoal.so.1") # vivox's sdk expects this soname # KLUDGE: As of 2012-04-11, the 'fontconfig' package installs @@ -1160,10 +1132,10 @@ class Linux_i686_Manifest(LinuxManifest): self.end_prefix("lib") # Vivox runtimes - if self.prefix(src="../packages/lib/release", dst="bin"): + if self.prefix(src=relpkgdir, dst="bin"): self.path("SLVoice") self.end_prefix() - if self.prefix(src="../packages/lib/release", dst="lib"): + if self.prefix(src=relpkgdir, dst="lib"): self.path("libortp.so") self.path("libsndfile.so.1") #self.path("libvivoxoal.so.1") # no - we'll re-use the viewer's own OpenAL lib @@ -1172,7 +1144,7 @@ class Linux_i686_Manifest(LinuxManifest): self.end_prefix("lib") # plugin runtime - if self.prefix(src="../packages/lib/release", dst="lib"): + if self.prefix(src=os.path.join(pkgdir, "lib"), dst="lib"): self.path("libQtCore.so*") self.path("libQtGui.so*") self.path("libQtNetwork.so*") @@ -1183,7 +1155,8 @@ class Linux_i686_Manifest(LinuxManifest): self.end_prefix("lib") # For WebKit/Qt plugin runtimes (image format plugins) - if self.prefix(src="../packages/plugins/imageformats", dst="bin/llplugin/imageformats"): + if self.prefix(src=os.path.join(pkgdir, "llplugin", "imageformats"), + dst="bin/llplugin/imageformats"): self.path("libqgif.so") self.path("libqico.so") self.path("libqjpeg.so") @@ -1193,7 +1166,8 @@ class Linux_i686_Manifest(LinuxManifest): self.end_prefix("bin/llplugin/imageformats") # For WebKit/Qt plugin runtimes (codec/character encoding plugins) - if self.prefix(src="../packages/plugins/codecs", dst="bin/llplugin/codecs"): + if self.prefix(src=os.path.join(pkgdir, "llplugin", "codecs"), + dst="bin/llplugin/codecs"): self.path("libqcncodecs.so") self.path("libqjpcodecs.so") self.path("libqkrcodecs.so") |