merge changes back from beta branch
commit
f0074f1002
|
|
@ -26,6 +26,7 @@ viewer-development.show_changes_since = last_sprint
|
|||
|
||||
# Build Settings
|
||||
viewer-development_coverity.coverity_product = viewer
|
||||
viewer-development_coverity.run_tests = false
|
||||
viewer-development.build_debug_release_separately = true
|
||||
|
||||
# Notifications - to configure email notices, add a setting like this:
|
||||
|
|
|
|||
3
build.sh
3
build.sh
|
|
@ -66,7 +66,8 @@ pre_build()
|
|||
-DRELEASE_CRASH_REPORTING:BOOL=ON \
|
||||
-DLOCALIZESETUP:BOOL=ON \
|
||||
-DPACKAGE:BOOL=ON \
|
||||
-DCMAKE_VERBOSE_MAKEFILE:BOOL=TRUE
|
||||
-DCMAKE_VERBOSE_MAKEFILE:BOOL=TRUE \
|
||||
-DLL_TESTS:BOOL="$run_tests"
|
||||
end_section "Pre$variant"
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -72,6 +72,7 @@ Aleric Inglewood
|
|||
VWR-10837
|
||||
VWR-12691
|
||||
VWR-12984
|
||||
VWR-13040
|
||||
VWR-13996
|
||||
VWR-14426
|
||||
VWR-24247
|
||||
|
|
@ -79,6 +80,12 @@ Aleric Inglewood
|
|||
VWR-24252
|
||||
VWR-24254
|
||||
VWR-24261
|
||||
VWR-24315
|
||||
VWR-24317
|
||||
VWR-24320
|
||||
VWR-24321
|
||||
VWR-24354
|
||||
VWR-24519
|
||||
SNOW-84
|
||||
SNOW-477
|
||||
SNOW-744
|
||||
|
|
@ -219,6 +226,8 @@ Catherine Pfeffer
|
|||
Celierra Darling
|
||||
VWR-1274
|
||||
VWR-6975
|
||||
Coaldust Numbers
|
||||
VWR-1095
|
||||
Cron Stardust
|
||||
VWR-10579
|
||||
Cypren Christenson
|
||||
|
|
@ -364,15 +373,22 @@ JB Kraft
|
|||
Joghert LeSabre
|
||||
VWR-64
|
||||
Jonathan Yap
|
||||
STORM-596
|
||||
STORM-523
|
||||
STORM-596
|
||||
STORM-615
|
||||
STORM-616
|
||||
STORM-679
|
||||
STORM-737
|
||||
STORM-723
|
||||
STORM-726
|
||||
STORM-812
|
||||
VWR-17801
|
||||
STORM-737
|
||||
STORM-869
|
||||
STORM-785
|
||||
STORM-812
|
||||
STORM-829
|
||||
VWR-17801
|
||||
VWR-24347
|
||||
STORM-844
|
||||
STORM-643
|
||||
Kage Pixel
|
||||
VWR-11
|
||||
Ken March
|
||||
|
|
@ -389,6 +405,7 @@ Kitty Barnett
|
|||
STORM-288
|
||||
STORM-799
|
||||
STORM-800
|
||||
VWR-24217
|
||||
Kunnis Basiat
|
||||
VWR-82
|
||||
VWR-102
|
||||
|
|
@ -732,6 +749,7 @@ Thickbrick Sleaford
|
|||
VWR-9287
|
||||
VWR-13483
|
||||
VWR-13947
|
||||
VWR-24420
|
||||
Thraxis Epsilon
|
||||
SVC-371
|
||||
VWR-383
|
||||
|
|
@ -752,6 +770,8 @@ Twisted Laws
|
|||
SNOW-352
|
||||
STORM-466
|
||||
STORM-467
|
||||
STORM-844
|
||||
STORM-643
|
||||
Vadim Bigbear
|
||||
VWR-2681
|
||||
Vector Hastings
|
||||
|
|
|
|||
|
|
@ -678,20 +678,17 @@
|
|||
<key>EstateChangeInfo</key>
|
||||
<boolean>true</boolean>
|
||||
|
||||
<key>FetchInventoryDescendents</key>
|
||||
<key>FetchInventoryDescendents2</key>
|
||||
<boolean>false</boolean>
|
||||
|
||||
<key>WebFetchInventoryDescendents</key>
|
||||
<boolean>true</boolean>
|
||||
<key>FetchInventory2</key>
|
||||
<boolean>false</boolean>
|
||||
|
||||
<key>FetchInventory</key>
|
||||
<boolean>true</boolean>
|
||||
<key>FetchLibDescendents2</key>
|
||||
<boolean>false</boolean>
|
||||
|
||||
<key>FetchLibDescendents</key>
|
||||
<boolean>true</boolean>
|
||||
|
||||
<key>FetchLib</key>
|
||||
<boolean>true</boolean>
|
||||
<key>FetchLib2</key>
|
||||
<boolean>false</boolean>
|
||||
|
||||
<key>UploadBakedTexture</key>
|
||||
<boolean>true</boolean>
|
||||
|
|
|
|||
|
|
@ -66,6 +66,7 @@ if(WINDOWS)
|
|||
if (MSVC80)
|
||||
FIND_PATH(debug_msvc8_redist_path msvcr80d.dll
|
||||
PATHS
|
||||
${MSVC_DEBUG_REDIST_PATH}
|
||||
[HKEY_LOCAL_MACHINE\\SOFTWARE\\Microsoft\\VisualStudio\\8.0\\Setup\\VC;ProductDir]/redist/Debug_NonRedist/x86/Microsoft.VC80.DebugCRT
|
||||
NO_DEFAULT_PATH
|
||||
NO_DEFAULT_PATH
|
||||
|
|
@ -90,6 +91,7 @@ if (MSVC80)
|
|||
|
||||
FIND_PATH(release_msvc8_redist_path msvcr80.dll
|
||||
PATHS
|
||||
${MSVC_REDIST_PATH}
|
||||
[HKEY_LOCAL_MACHINE\\SOFTWARE\\Microsoft\\VisualStudio\\8.0\\Setup\\VC;ProductDir]/redist/x86/Microsoft.VC80.CRT
|
||||
NO_DEFAULT_PATH
|
||||
NO_DEFAULT_PATH
|
||||
|
|
|
|||
File diff suppressed because it is too large
Load Diff
|
|
@ -1,276 +1,276 @@
|
|||
# -*- cmake -*-
|
||||
include(LLTestCommand)
|
||||
include(GoogleMock)
|
||||
|
||||
MACRO(LL_ADD_PROJECT_UNIT_TESTS project sources)
|
||||
# Given a project name and a list of sourcefiles (with optional properties on each),
|
||||
# add targets to build and run the tests specified.
|
||||
# ASSUMPTIONS:
|
||||
# * this macro is being executed in the project file that is passed in
|
||||
# * current working SOURCE dir is that project dir
|
||||
# * there is a subfolder tests/ with test code corresponding to the filenames passed in
|
||||
# * properties for each sourcefile passed in indicate what libs to link that file with (MAKE NO ASSUMPTIONS ASIDE FROM TUT)
|
||||
#
|
||||
# More info and examples at: https://wiki.secondlife.com/wiki/How_to_add_unit_tests_to_indra_code
|
||||
#
|
||||
# WARNING: do NOT modify this code without working with poppy -
|
||||
# there is another branch that will conflict heavily with any changes here.
|
||||
INCLUDE(GoogleMock)
|
||||
|
||||
|
||||
IF(LL_TEST_VERBOSE)
|
||||
MESSAGE("LL_ADD_PROJECT_UNIT_TESTS UNITTEST_PROJECT_${project} sources: ${sources}")
|
||||
ENDIF(LL_TEST_VERBOSE)
|
||||
|
||||
# Start with the header and project-wide setup before making targets
|
||||
#project(UNITTEST_PROJECT_${project})
|
||||
# Setup includes, paths, etc
|
||||
SET(alltest_SOURCE_FILES
|
||||
${CMAKE_SOURCE_DIR}/test/test.cpp
|
||||
${CMAKE_SOURCE_DIR}/test/lltut.cpp
|
||||
)
|
||||
SET(alltest_DEP_TARGETS
|
||||
# needed by the test harness itself
|
||||
${APRUTIL_LIBRARIES}
|
||||
${APR_LIBRARIES}
|
||||
llcommon
|
||||
)
|
||||
IF(NOT "${project}" STREQUAL "llmath")
|
||||
# add llmath as a dep unless the tested module *is* llmath!
|
||||
LIST(APPEND alltest_DEP_TARGETS
|
||||
llmath
|
||||
)
|
||||
ENDIF(NOT "${project}" STREQUAL "llmath")
|
||||
SET(alltest_INCLUDE_DIRS
|
||||
${LLMATH_INCLUDE_DIRS}
|
||||
${LLCOMMON_INCLUDE_DIRS}
|
||||
${LIBS_OPEN_DIR}/test
|
||||
${GOOGLEMOCK_INCLUDE_DIRS}
|
||||
)
|
||||
SET(alltest_LIBRARIES
|
||||
${GOOGLEMOCK_LIBRARIES}
|
||||
${PTHREAD_LIBRARY}
|
||||
${WINDOWS_LIBRARIES}
|
||||
)
|
||||
# Headers, for convenience in targets.
|
||||
SET(alltest_HEADER_FILES
|
||||
${CMAKE_SOURCE_DIR}/test/test.h
|
||||
)
|
||||
|
||||
# Use the default flags
|
||||
if (LINUX)
|
||||
SET(CMAKE_EXE_LINKER_FLAGS "")
|
||||
endif (LINUX)
|
||||
|
||||
# start the source test executable definitions
|
||||
SET(${project}_TEST_OUTPUT "")
|
||||
FOREACH (source ${sources})
|
||||
STRING( REGEX REPLACE "(.*)\\.[^.]+$" "\\1" name ${source} )
|
||||
STRING( REGEX REPLACE ".*\\.([^.]+)$" "\\1" extension ${source} )
|
||||
IF(LL_TEST_VERBOSE)
|
||||
MESSAGE("LL_ADD_PROJECT_UNIT_TESTS UNITTEST_PROJECT_${project} individual source: ${source} (${name}.${extension})")
|
||||
ENDIF(LL_TEST_VERBOSE)
|
||||
|
||||
#
|
||||
# Per-codefile additional / external source, header, and include dir property extraction
|
||||
#
|
||||
# Source
|
||||
GET_SOURCE_FILE_PROPERTY(${name}_test_additional_SOURCE_FILES ${source} LL_TEST_ADDITIONAL_SOURCE_FILES)
|
||||
IF(${name}_test_additional_SOURCE_FILES MATCHES NOTFOUND)
|
||||
SET(${name}_test_additional_SOURCE_FILES "")
|
||||
ENDIF(${name}_test_additional_SOURCE_FILES MATCHES NOTFOUND)
|
||||
SET(${name}_test_SOURCE_FILES ${source} tests/${name}_test.${extension} ${alltest_SOURCE_FILES} ${${name}_test_additional_SOURCE_FILES} )
|
||||
IF(LL_TEST_VERBOSE)
|
||||
MESSAGE("LL_ADD_PROJECT_UNIT_TESTS ${name}_test_SOURCE_FILES ${${name}_test_SOURCE_FILES}")
|
||||
ENDIF(LL_TEST_VERBOSE)
|
||||
# Headers
|
||||
GET_SOURCE_FILE_PROPERTY(${name}_test_additional_HEADER_FILES ${source} LL_TEST_ADDITIONAL_HEADER_FILES)
|
||||
IF(${name}_test_additional_HEADER_FILES MATCHES NOTFOUND)
|
||||
SET(${name}_test_additional_HEADER_FILES "")
|
||||
ENDIF(${name}_test_additional_HEADER_FILES MATCHES NOTFOUND)
|
||||
SET(${name}_test_HEADER_FILES ${name}.h ${${name}_test_additional_HEADER_FILES})
|
||||
set_source_files_properties(${${name}_test_HEADER_FILES} PROPERTIES HEADER_FILE_ONLY TRUE)
|
||||
LIST(APPEND ${name}_test_SOURCE_FILES ${${name}_test_HEADER_FILES})
|
||||
IF(LL_TEST_VERBOSE)
|
||||
MESSAGE("LL_ADD_PROJECT_UNIT_TESTS ${name}_test_HEADER_FILES ${${name}_test_HEADER_FILES}")
|
||||
ENDIF(LL_TEST_VERBOSE)
|
||||
# Include dirs
|
||||
GET_SOURCE_FILE_PROPERTY(${name}_test_additional_INCLUDE_DIRS ${source} LL_TEST_ADDITIONAL_INCLUDE_DIRS)
|
||||
IF(${name}_test_additional_INCLUDE_DIRS MATCHES NOTFOUND)
|
||||
SET(${name}_test_additional_INCLUDE_DIRS "")
|
||||
ENDIF(${name}_test_additional_INCLUDE_DIRS MATCHES NOTFOUND)
|
||||
INCLUDE_DIRECTORIES(${alltest_INCLUDE_DIRS} ${name}_test_additional_INCLUDE_DIRS )
|
||||
IF(LL_TEST_VERBOSE)
|
||||
MESSAGE("LL_ADD_PROJECT_UNIT_TESTS ${name}_test_additional_INCLUDE_DIRS ${${name}_test_additional_INCLUDE_DIRS}")
|
||||
ENDIF(LL_TEST_VERBOSE)
|
||||
|
||||
|
||||
# Setup target
|
||||
ADD_EXECUTABLE(PROJECT_${project}_TEST_${name} ${${name}_test_SOURCE_FILES})
|
||||
SET_TARGET_PROPERTIES(PROJECT_${project}_TEST_${name} PROPERTIES RUNTIME_OUTPUT_DIRECTORY "${EXE_STAGING_DIR}")
|
||||
|
||||
#
|
||||
# Per-codefile additional / external project dep and lib dep property extraction
|
||||
#
|
||||
# WARNING: it's REALLY IMPORTANT to not mix these. I guarantee it will not work in the future. + poppy 2009-04-19
|
||||
# Projects
|
||||
GET_SOURCE_FILE_PROPERTY(${name}_test_additional_PROJECTS ${source} LL_TEST_ADDITIONAL_PROJECTS)
|
||||
IF(${name}_test_additional_PROJECTS MATCHES NOTFOUND)
|
||||
SET(${name}_test_additional_PROJECTS "")
|
||||
ENDIF(${name}_test_additional_PROJECTS MATCHES NOTFOUND)
|
||||
# Libraries
|
||||
GET_SOURCE_FILE_PROPERTY(${name}_test_additional_LIBRARIES ${source} LL_TEST_ADDITIONAL_LIBRARIES)
|
||||
IF(${name}_test_additional_LIBRARIES MATCHES NOTFOUND)
|
||||
SET(${name}_test_additional_LIBRARIES "")
|
||||
ENDIF(${name}_test_additional_LIBRARIES MATCHES NOTFOUND)
|
||||
IF(LL_TEST_VERBOSE)
|
||||
MESSAGE("LL_ADD_PROJECT_UNIT_TESTS ${name}_test_additional_PROJECTS ${${name}_test_additional_PROJECTS}")
|
||||
MESSAGE("LL_ADD_PROJECT_UNIT_TESTS ${name}_test_additional_LIBRARIES ${${name}_test_additional_LIBRARIES}")
|
||||
ENDIF(LL_TEST_VERBOSE)
|
||||
# Add to project
|
||||
TARGET_LINK_LIBRARIES(PROJECT_${project}_TEST_${name} ${alltest_LIBRARIES} ${alltest_DEP_TARGETS} ${${name}_test_additional_PROJECTS} ${${name}_test_additional_LIBRARIES} )
|
||||
# Compile-time Definitions
|
||||
GET_SOURCE_FILE_PROPERTY(${name}_test_additional_CFLAGS ${source} LL_TEST_ADDITIONAL_CFLAGS)
|
||||
IF(NOT ${name}_test_additional_CFLAGS MATCHES NOTFOUND)
|
||||
SET_TARGET_PROPERTIES(PROJECT_${project}_TEST_${name} PROPERTIES COMPILE_FLAGS ${${name}_test_additional_CFLAGS} )
|
||||
IF(LL_TEST_VERBOSE)
|
||||
MESSAGE("LL_ADD_PROJECT_UNIT_TESTS ${name}_test_additional_CFLAGS ${${name}_test_additional_CFLAGS}")
|
||||
ENDIF(LL_TEST_VERBOSE)
|
||||
ENDIF(NOT ${name}_test_additional_CFLAGS MATCHES NOTFOUND)
|
||||
|
||||
#
|
||||
# Setup test targets
|
||||
#
|
||||
GET_TARGET_PROPERTY(TEST_EXE PROJECT_${project}_TEST_${name} LOCATION)
|
||||
SET(TEST_OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/PROJECT_${project}_TEST_${name}_ok.txt)
|
||||
SET(TEST_CMD ${TEST_EXE} --touch=${TEST_OUTPUT} --sourcedir=${CMAKE_CURRENT_SOURCE_DIR})
|
||||
|
||||
# daveh - what configuration does this use? Debug? it's cmake-time, not build time. + poppy 2009-04-19
|
||||
IF(LL_TEST_VERBOSE)
|
||||
MESSAGE(STATUS "LL_ADD_PROJECT_UNIT_TESTS ${name} test_cmd = ${TEST_CMD}")
|
||||
ENDIF(LL_TEST_VERBOSE)
|
||||
|
||||
SET_TEST_PATH(LD_LIBRARY_PATH)
|
||||
LL_TEST_COMMAND(TEST_SCRIPT_CMD "${LD_LIBRARY_PATH}" ${TEST_CMD})
|
||||
IF(LL_TEST_VERBOSE)
|
||||
MESSAGE(STATUS "LL_ADD_PROJECT_UNIT_TESTS ${name} test_script = ${TEST_SCRIPT_CMD}")
|
||||
ENDIF(LL_TEST_VERBOSE)
|
||||
# Add test
|
||||
ADD_CUSTOM_COMMAND(
|
||||
OUTPUT ${TEST_OUTPUT}
|
||||
COMMAND ${TEST_SCRIPT_CMD}
|
||||
DEPENDS PROJECT_${project}_TEST_${name}
|
||||
WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}
|
||||
)
|
||||
# Why not add custom target and add POST_BUILD command?
|
||||
# Slightly less uncertain behavior
|
||||
# (OUTPUT commands run non-deterministically AFAIK) + poppy 2009-04-19
|
||||
# > I did not use a post build step as I could not make it notify of a
|
||||
# > failure after the first time you build and fail a test. - daveh 2009-04-20
|
||||
LIST(APPEND ${project}_TEST_OUTPUT ${TEST_OUTPUT})
|
||||
ENDFOREACH (source)
|
||||
|
||||
# Add the test runner target per-project
|
||||
# (replaces old _test_ok targets all over the place)
|
||||
ADD_CUSTOM_TARGET(${project}_tests ALL DEPENDS ${${project}_TEST_OUTPUT})
|
||||
ADD_DEPENDENCIES(${project} ${project}_tests)
|
||||
ENDMACRO(LL_ADD_PROJECT_UNIT_TESTS)
|
||||
|
||||
FUNCTION(LL_ADD_INTEGRATION_TEST
|
||||
testname
|
||||
additional_source_files
|
||||
library_dependencies
|
||||
# variable args
|
||||
)
|
||||
if(TEST_DEBUG)
|
||||
message(STATUS "Adding INTEGRATION_TEST_${testname} - debug output is on")
|
||||
endif(TEST_DEBUG)
|
||||
|
||||
SET(source_files
|
||||
tests/${testname}_test.cpp
|
||||
${CMAKE_SOURCE_DIR}/test/test.cpp
|
||||
${CMAKE_SOURCE_DIR}/test/lltut.cpp
|
||||
${additional_source_files}
|
||||
)
|
||||
|
||||
SET(libraries
|
||||
${library_dependencies}
|
||||
${GOOGLEMOCK_LIBRARIES}
|
||||
${PTHREAD_LIBRARY}
|
||||
)
|
||||
|
||||
# Add test executable build target
|
||||
if(TEST_DEBUG)
|
||||
message(STATUS "ADD_EXECUTABLE(INTEGRATION_TEST_${testname} ${source_files})")
|
||||
endif(TEST_DEBUG)
|
||||
ADD_EXECUTABLE(INTEGRATION_TEST_${testname} ${source_files})
|
||||
SET_TARGET_PROPERTIES(INTEGRATION_TEST_${testname} PROPERTIES RUNTIME_OUTPUT_DIRECTORY "${EXE_STAGING_DIR}")
|
||||
if(STANDALONE)
|
||||
SET_TARGET_PROPERTIES(INTEGRATION_TEST_${testname} PROPERTIES COMPILE_FLAGS -I"${TUT_INCLUDE_DIR}")
|
||||
endif(STANDALONE)
|
||||
|
||||
# Add link deps to the executable
|
||||
if(TEST_DEBUG)
|
||||
message(STATUS "TARGET_LINK_LIBRARIES(INTEGRATION_TEST_${testname} ${libraries})")
|
||||
endif(TEST_DEBUG)
|
||||
TARGET_LINK_LIBRARIES(INTEGRATION_TEST_${testname} ${libraries})
|
||||
|
||||
# Create the test running command
|
||||
SET(test_command ${ARGN})
|
||||
GET_TARGET_PROPERTY(TEST_EXE INTEGRATION_TEST_${testname} LOCATION)
|
||||
LIST(FIND test_command "{}" test_exe_pos)
|
||||
IF(test_exe_pos LESS 0)
|
||||
# The {} marker means "the full pathname of the test executable."
|
||||
# test_exe_pos -1 means we didn't find it -- so append the test executable
|
||||
# name to $ARGN, the variable part of the arg list. This is convenient
|
||||
# shorthand for both straightforward execution of the test program (empty
|
||||
# $ARGN) and for running a "wrapper" program of some kind accepting the
|
||||
# pathname of the test program as the last of its args. You need specify
|
||||
# {} only if the test program's pathname isn't the last argument in the
|
||||
# desired command line.
|
||||
LIST(APPEND test_command "${TEST_EXE}")
|
||||
ELSE (test_exe_pos LESS 0)
|
||||
# Found {} marker at test_exe_pos. Remove the {}...
|
||||
LIST(REMOVE_AT test_command test_exe_pos)
|
||||
# ...and replace it with the actual name of the test executable.
|
||||
LIST(INSERT test_command test_exe_pos "${TEST_EXE}")
|
||||
ENDIF (test_exe_pos LESS 0)
|
||||
|
||||
SET_TEST_PATH(LD_LIBRARY_PATH)
|
||||
LL_TEST_COMMAND(TEST_SCRIPT_CMD "${LD_LIBRARY_PATH}" ${test_command})
|
||||
|
||||
if(TEST_DEBUG)
|
||||
message(STATUS "TEST_SCRIPT_CMD: ${TEST_SCRIPT_CMD}")
|
||||
endif(TEST_DEBUG)
|
||||
|
||||
ADD_CUSTOM_COMMAND(
|
||||
TARGET INTEGRATION_TEST_${testname}
|
||||
POST_BUILD
|
||||
COMMAND ${TEST_SCRIPT_CMD}
|
||||
)
|
||||
|
||||
# Use CTEST? Not sure how to yet...
|
||||
# ADD_TEST(INTEGRATION_TEST_RUNNER_${testname} ${TEST_SCRIPT_CMD})
|
||||
|
||||
ENDFUNCTION(LL_ADD_INTEGRATION_TEST)
|
||||
|
||||
MACRO(SET_TEST_PATH LISTVAR)
|
||||
IF(WINDOWS)
|
||||
# We typically build/package only Release variants of third-party
|
||||
# libraries, so append the Release staging dir in case the library being
|
||||
# sought doesn't have a debug variant.
|
||||
set(${LISTVAR} ${SHARED_LIB_STAGING_DIR}/${CMAKE_CFG_INTDIR} ${SHARED_LIB_STAGING_DIR}/Release)
|
||||
ELSEIF(DARWIN)
|
||||
# We typically build/package only Release variants of third-party
|
||||
# libraries, so append the Release staging dir in case the library being
|
||||
# sought doesn't have a debug variant.
|
||||
set(${LISTVAR} ${SHARED_LIB_STAGING_DIR}/${CMAKE_CFG_INTDIR}/Resources ${SHARED_LIB_STAGING_DIR}/Release/Resources /usr/lib)
|
||||
ELSE(WINDOWS)
|
||||
# Linux uses a single staging directory anyway.
|
||||
IF (STANDALONE)
|
||||
set(${LISTVAR} ${CMAKE_BINARY_DIR}/llcommon /usr/lib /usr/local/lib)
|
||||
ELSE (STANDALONE)
|
||||
set(${LISTVAR} ${SHARED_LIB_STAGING_DIR} /usr/lib)
|
||||
ENDIF (STANDALONE)
|
||||
ENDIF(WINDOWS)
|
||||
ENDMACRO(SET_TEST_PATH)
|
||||
# -*- cmake -*-
|
||||
include(LLTestCommand)
|
||||
include(GoogleMock)
|
||||
|
||||
MACRO(LL_ADD_PROJECT_UNIT_TESTS project sources)
|
||||
# Given a project name and a list of sourcefiles (with optional properties on each),
|
||||
# add targets to build and run the tests specified.
|
||||
# ASSUMPTIONS:
|
||||
# * this macro is being executed in the project file that is passed in
|
||||
# * current working SOURCE dir is that project dir
|
||||
# * there is a subfolder tests/ with test code corresponding to the filenames passed in
|
||||
# * properties for each sourcefile passed in indicate what libs to link that file with (MAKE NO ASSUMPTIONS ASIDE FROM TUT)
|
||||
#
|
||||
# More info and examples at: https://wiki.secondlife.com/wiki/How_to_add_unit_tests_to_indra_code
|
||||
#
|
||||
# WARNING: do NOT modify this code without working with poppy -
|
||||
# there is another branch that will conflict heavily with any changes here.
|
||||
INCLUDE(GoogleMock)
|
||||
|
||||
|
||||
IF(LL_TEST_VERBOSE)
|
||||
MESSAGE("LL_ADD_PROJECT_UNIT_TESTS UNITTEST_PROJECT_${project} sources: ${sources}")
|
||||
ENDIF(LL_TEST_VERBOSE)
|
||||
|
||||
# Start with the header and project-wide setup before making targets
|
||||
#project(UNITTEST_PROJECT_${project})
|
||||
# Setup includes, paths, etc
|
||||
SET(alltest_SOURCE_FILES
|
||||
${CMAKE_SOURCE_DIR}/test/test.cpp
|
||||
${CMAKE_SOURCE_DIR}/test/lltut.cpp
|
||||
)
|
||||
SET(alltest_DEP_TARGETS
|
||||
# needed by the test harness itself
|
||||
${APRUTIL_LIBRARIES}
|
||||
${APR_LIBRARIES}
|
||||
llcommon
|
||||
)
|
||||
IF(NOT "${project}" STREQUAL "llmath")
|
||||
# add llmath as a dep unless the tested module *is* llmath!
|
||||
LIST(APPEND alltest_DEP_TARGETS
|
||||
llmath
|
||||
)
|
||||
ENDIF(NOT "${project}" STREQUAL "llmath")
|
||||
SET(alltest_INCLUDE_DIRS
|
||||
${LLMATH_INCLUDE_DIRS}
|
||||
${LLCOMMON_INCLUDE_DIRS}
|
||||
${LIBS_OPEN_DIR}/test
|
||||
${GOOGLEMOCK_INCLUDE_DIRS}
|
||||
)
|
||||
SET(alltest_LIBRARIES
|
||||
${GOOGLEMOCK_LIBRARIES}
|
||||
${PTHREAD_LIBRARY}
|
||||
${WINDOWS_LIBRARIES}
|
||||
)
|
||||
# Headers, for convenience in targets.
|
||||
SET(alltest_HEADER_FILES
|
||||
${CMAKE_SOURCE_DIR}/test/test.h
|
||||
)
|
||||
|
||||
# Use the default flags
|
||||
if (LINUX)
|
||||
SET(CMAKE_EXE_LINKER_FLAGS "")
|
||||
endif (LINUX)
|
||||
|
||||
# start the source test executable definitions
|
||||
SET(${project}_TEST_OUTPUT "")
|
||||
FOREACH (source ${sources})
|
||||
STRING( REGEX REPLACE "(.*)\\.[^.]+$" "\\1" name ${source} )
|
||||
STRING( REGEX REPLACE ".*\\.([^.]+)$" "\\1" extension ${source} )
|
||||
IF(LL_TEST_VERBOSE)
|
||||
MESSAGE("LL_ADD_PROJECT_UNIT_TESTS UNITTEST_PROJECT_${project} individual source: ${source} (${name}.${extension})")
|
||||
ENDIF(LL_TEST_VERBOSE)
|
||||
|
||||
#
|
||||
# Per-codefile additional / external source, header, and include dir property extraction
|
||||
#
|
||||
# Source
|
||||
GET_SOURCE_FILE_PROPERTY(${name}_test_additional_SOURCE_FILES ${source} LL_TEST_ADDITIONAL_SOURCE_FILES)
|
||||
IF(${name}_test_additional_SOURCE_FILES MATCHES NOTFOUND)
|
||||
SET(${name}_test_additional_SOURCE_FILES "")
|
||||
ENDIF(${name}_test_additional_SOURCE_FILES MATCHES NOTFOUND)
|
||||
SET(${name}_test_SOURCE_FILES ${source} tests/${name}_test.${extension} ${alltest_SOURCE_FILES} ${${name}_test_additional_SOURCE_FILES} )
|
||||
IF(LL_TEST_VERBOSE)
|
||||
MESSAGE("LL_ADD_PROJECT_UNIT_TESTS ${name}_test_SOURCE_FILES ${${name}_test_SOURCE_FILES}")
|
||||
ENDIF(LL_TEST_VERBOSE)
|
||||
# Headers
|
||||
GET_SOURCE_FILE_PROPERTY(${name}_test_additional_HEADER_FILES ${source} LL_TEST_ADDITIONAL_HEADER_FILES)
|
||||
IF(${name}_test_additional_HEADER_FILES MATCHES NOTFOUND)
|
||||
SET(${name}_test_additional_HEADER_FILES "")
|
||||
ENDIF(${name}_test_additional_HEADER_FILES MATCHES NOTFOUND)
|
||||
SET(${name}_test_HEADER_FILES ${name}.h ${${name}_test_additional_HEADER_FILES})
|
||||
set_source_files_properties(${${name}_test_HEADER_FILES} PROPERTIES HEADER_FILE_ONLY TRUE)
|
||||
LIST(APPEND ${name}_test_SOURCE_FILES ${${name}_test_HEADER_FILES})
|
||||
IF(LL_TEST_VERBOSE)
|
||||
MESSAGE("LL_ADD_PROJECT_UNIT_TESTS ${name}_test_HEADER_FILES ${${name}_test_HEADER_FILES}")
|
||||
ENDIF(LL_TEST_VERBOSE)
|
||||
# Include dirs
|
||||
GET_SOURCE_FILE_PROPERTY(${name}_test_additional_INCLUDE_DIRS ${source} LL_TEST_ADDITIONAL_INCLUDE_DIRS)
|
||||
IF(${name}_test_additional_INCLUDE_DIRS MATCHES NOTFOUND)
|
||||
SET(${name}_test_additional_INCLUDE_DIRS "")
|
||||
ENDIF(${name}_test_additional_INCLUDE_DIRS MATCHES NOTFOUND)
|
||||
INCLUDE_DIRECTORIES(${alltest_INCLUDE_DIRS} ${name}_test_additional_INCLUDE_DIRS )
|
||||
IF(LL_TEST_VERBOSE)
|
||||
MESSAGE("LL_ADD_PROJECT_UNIT_TESTS ${name}_test_additional_INCLUDE_DIRS ${${name}_test_additional_INCLUDE_DIRS}")
|
||||
ENDIF(LL_TEST_VERBOSE)
|
||||
|
||||
|
||||
# Setup target
|
||||
ADD_EXECUTABLE(PROJECT_${project}_TEST_${name} ${${name}_test_SOURCE_FILES})
|
||||
SET_TARGET_PROPERTIES(PROJECT_${project}_TEST_${name} PROPERTIES RUNTIME_OUTPUT_DIRECTORY "${EXE_STAGING_DIR}")
|
||||
|
||||
#
|
||||
# Per-codefile additional / external project dep and lib dep property extraction
|
||||
#
|
||||
# WARNING: it's REALLY IMPORTANT to not mix these. I guarantee it will not work in the future. + poppy 2009-04-19
|
||||
# Projects
|
||||
GET_SOURCE_FILE_PROPERTY(${name}_test_additional_PROJECTS ${source} LL_TEST_ADDITIONAL_PROJECTS)
|
||||
IF(${name}_test_additional_PROJECTS MATCHES NOTFOUND)
|
||||
SET(${name}_test_additional_PROJECTS "")
|
||||
ENDIF(${name}_test_additional_PROJECTS MATCHES NOTFOUND)
|
||||
# Libraries
|
||||
GET_SOURCE_FILE_PROPERTY(${name}_test_additional_LIBRARIES ${source} LL_TEST_ADDITIONAL_LIBRARIES)
|
||||
IF(${name}_test_additional_LIBRARIES MATCHES NOTFOUND)
|
||||
SET(${name}_test_additional_LIBRARIES "")
|
||||
ENDIF(${name}_test_additional_LIBRARIES MATCHES NOTFOUND)
|
||||
IF(LL_TEST_VERBOSE)
|
||||
MESSAGE("LL_ADD_PROJECT_UNIT_TESTS ${name}_test_additional_PROJECTS ${${name}_test_additional_PROJECTS}")
|
||||
MESSAGE("LL_ADD_PROJECT_UNIT_TESTS ${name}_test_additional_LIBRARIES ${${name}_test_additional_LIBRARIES}")
|
||||
ENDIF(LL_TEST_VERBOSE)
|
||||
# Add to project
|
||||
TARGET_LINK_LIBRARIES(PROJECT_${project}_TEST_${name} ${alltest_LIBRARIES} ${alltest_DEP_TARGETS} ${${name}_test_additional_PROJECTS} ${${name}_test_additional_LIBRARIES} )
|
||||
# Compile-time Definitions
|
||||
GET_SOURCE_FILE_PROPERTY(${name}_test_additional_CFLAGS ${source} LL_TEST_ADDITIONAL_CFLAGS)
|
||||
IF(NOT ${name}_test_additional_CFLAGS MATCHES NOTFOUND)
|
||||
SET_TARGET_PROPERTIES(PROJECT_${project}_TEST_${name} PROPERTIES COMPILE_FLAGS ${${name}_test_additional_CFLAGS} )
|
||||
IF(LL_TEST_VERBOSE)
|
||||
MESSAGE("LL_ADD_PROJECT_UNIT_TESTS ${name}_test_additional_CFLAGS ${${name}_test_additional_CFLAGS}")
|
||||
ENDIF(LL_TEST_VERBOSE)
|
||||
ENDIF(NOT ${name}_test_additional_CFLAGS MATCHES NOTFOUND)
|
||||
|
||||
#
|
||||
# Setup test targets
|
||||
#
|
||||
GET_TARGET_PROPERTY(TEST_EXE PROJECT_${project}_TEST_${name} LOCATION)
|
||||
SET(TEST_OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/PROJECT_${project}_TEST_${name}_ok.txt)
|
||||
SET(TEST_CMD ${TEST_EXE} --touch=${TEST_OUTPUT} --sourcedir=${CMAKE_CURRENT_SOURCE_DIR})
|
||||
|
||||
# daveh - what configuration does this use? Debug? it's cmake-time, not build time. + poppy 2009-04-19
|
||||
IF(LL_TEST_VERBOSE)
|
||||
MESSAGE(STATUS "LL_ADD_PROJECT_UNIT_TESTS ${name} test_cmd = ${TEST_CMD}")
|
||||
ENDIF(LL_TEST_VERBOSE)
|
||||
|
||||
SET_TEST_PATH(LD_LIBRARY_PATH)
|
||||
LL_TEST_COMMAND(TEST_SCRIPT_CMD "${LD_LIBRARY_PATH}" ${TEST_CMD})
|
||||
IF(LL_TEST_VERBOSE)
|
||||
MESSAGE(STATUS "LL_ADD_PROJECT_UNIT_TESTS ${name} test_script = ${TEST_SCRIPT_CMD}")
|
||||
ENDIF(LL_TEST_VERBOSE)
|
||||
# Add test
|
||||
ADD_CUSTOM_COMMAND(
|
||||
OUTPUT ${TEST_OUTPUT}
|
||||
COMMAND ${TEST_SCRIPT_CMD}
|
||||
DEPENDS PROJECT_${project}_TEST_${name}
|
||||
WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}
|
||||
)
|
||||
# Why not add custom target and add POST_BUILD command?
|
||||
# Slightly less uncertain behavior
|
||||
# (OUTPUT commands run non-deterministically AFAIK) + poppy 2009-04-19
|
||||
# > I did not use a post build step as I could not make it notify of a
|
||||
# > failure after the first time you build and fail a test. - daveh 2009-04-20
|
||||
LIST(APPEND ${project}_TEST_OUTPUT ${TEST_OUTPUT})
|
||||
ENDFOREACH (source)
|
||||
|
||||
# Add the test runner target per-project
|
||||
# (replaces old _test_ok targets all over the place)
|
||||
ADD_CUSTOM_TARGET(${project}_tests ALL DEPENDS ${${project}_TEST_OUTPUT})
|
||||
ADD_DEPENDENCIES(${project} ${project}_tests)
|
||||
ENDMACRO(LL_ADD_PROJECT_UNIT_TESTS)
|
||||
|
||||
FUNCTION(LL_ADD_INTEGRATION_TEST
|
||||
testname
|
||||
additional_source_files
|
||||
library_dependencies
|
||||
# variable args
|
||||
)
|
||||
if(TEST_DEBUG)
|
||||
message(STATUS "Adding INTEGRATION_TEST_${testname} - debug output is on")
|
||||
endif(TEST_DEBUG)
|
||||
|
||||
SET(source_files
|
||||
tests/${testname}_test.cpp
|
||||
${CMAKE_SOURCE_DIR}/test/test.cpp
|
||||
${CMAKE_SOURCE_DIR}/test/lltut.cpp
|
||||
${additional_source_files}
|
||||
)
|
||||
|
||||
SET(libraries
|
||||
${library_dependencies}
|
||||
${GOOGLEMOCK_LIBRARIES}
|
||||
${PTHREAD_LIBRARY}
|
||||
)
|
||||
|
||||
# Add test executable build target
|
||||
if(TEST_DEBUG)
|
||||
message(STATUS "ADD_EXECUTABLE(INTEGRATION_TEST_${testname} ${source_files})")
|
||||
endif(TEST_DEBUG)
|
||||
ADD_EXECUTABLE(INTEGRATION_TEST_${testname} ${source_files})
|
||||
SET_TARGET_PROPERTIES(INTEGRATION_TEST_${testname} PROPERTIES RUNTIME_OUTPUT_DIRECTORY "${EXE_STAGING_DIR}")
|
||||
if(STANDALONE)
|
||||
SET_TARGET_PROPERTIES(INTEGRATION_TEST_${testname} PROPERTIES COMPILE_FLAGS -I"${TUT_INCLUDE_DIR}")
|
||||
endif(STANDALONE)
|
||||
|
||||
# Add link deps to the executable
|
||||
if(TEST_DEBUG)
|
||||
message(STATUS "TARGET_LINK_LIBRARIES(INTEGRATION_TEST_${testname} ${libraries})")
|
||||
endif(TEST_DEBUG)
|
||||
TARGET_LINK_LIBRARIES(INTEGRATION_TEST_${testname} ${libraries})
|
||||
|
||||
# Create the test running command
|
||||
SET(test_command ${ARGN})
|
||||
GET_TARGET_PROPERTY(TEST_EXE INTEGRATION_TEST_${testname} LOCATION)
|
||||
LIST(FIND test_command "{}" test_exe_pos)
|
||||
IF(test_exe_pos LESS 0)
|
||||
# The {} marker means "the full pathname of the test executable."
|
||||
# test_exe_pos -1 means we didn't find it -- so append the test executable
|
||||
# name to $ARGN, the variable part of the arg list. This is convenient
|
||||
# shorthand for both straightforward execution of the test program (empty
|
||||
# $ARGN) and for running a "wrapper" program of some kind accepting the
|
||||
# pathname of the test program as the last of its args. You need specify
|
||||
# {} only if the test program's pathname isn't the last argument in the
|
||||
# desired command line.
|
||||
LIST(APPEND test_command "${TEST_EXE}")
|
||||
ELSE (test_exe_pos LESS 0)
|
||||
# Found {} marker at test_exe_pos. Remove the {}...
|
||||
LIST(REMOVE_AT test_command test_exe_pos)
|
||||
# ...and replace it with the actual name of the test executable.
|
||||
LIST(INSERT test_command test_exe_pos "${TEST_EXE}")
|
||||
ENDIF (test_exe_pos LESS 0)
|
||||
|
||||
SET_TEST_PATH(LD_LIBRARY_PATH)
|
||||
LL_TEST_COMMAND(TEST_SCRIPT_CMD "${LD_LIBRARY_PATH}" ${test_command})
|
||||
|
||||
if(TEST_DEBUG)
|
||||
message(STATUS "TEST_SCRIPT_CMD: ${TEST_SCRIPT_CMD}")
|
||||
endif(TEST_DEBUG)
|
||||
|
||||
ADD_CUSTOM_COMMAND(
|
||||
TARGET INTEGRATION_TEST_${testname}
|
||||
POST_BUILD
|
||||
COMMAND ${TEST_SCRIPT_CMD}
|
||||
)
|
||||
|
||||
# Use CTEST? Not sure how to yet...
|
||||
# ADD_TEST(INTEGRATION_TEST_RUNNER_${testname} ${TEST_SCRIPT_CMD})
|
||||
|
||||
ENDFUNCTION(LL_ADD_INTEGRATION_TEST)
|
||||
|
||||
MACRO(SET_TEST_PATH LISTVAR)
|
||||
IF(WINDOWS)
|
||||
# We typically build/package only Release variants of third-party
|
||||
# libraries, so append the Release staging dir in case the library being
|
||||
# sought doesn't have a debug variant.
|
||||
set(${LISTVAR} ${SHARED_LIB_STAGING_DIR}/${CMAKE_CFG_INTDIR} ${SHARED_LIB_STAGING_DIR}/Release)
|
||||
ELSEIF(DARWIN)
|
||||
# We typically build/package only Release variants of third-party
|
||||
# libraries, so append the Release staging dir in case the library being
|
||||
# sought doesn't have a debug variant.
|
||||
set(${LISTVAR} ${SHARED_LIB_STAGING_DIR}/${CMAKE_CFG_INTDIR}/Resources ${SHARED_LIB_STAGING_DIR}/Release/Resources /usr/lib)
|
||||
ELSE(WINDOWS)
|
||||
# Linux uses a single staging directory anyway.
|
||||
IF (STANDALONE)
|
||||
set(${LISTVAR} ${CMAKE_BINARY_DIR}/llcommon /usr/lib /usr/local/lib)
|
||||
ELSE (STANDALONE)
|
||||
set(${LISTVAR} ${SHARED_LIB_STAGING_DIR} /usr/lib)
|
||||
ENDIF (STANDALONE)
|
||||
ENDIF(WINDOWS)
|
||||
ENDMACRO(SET_TEST_PATH)
|
||||
|
|
|
|||
|
|
@ -97,7 +97,11 @@ void LLAudioEngine::setDefaults()
|
|||
}
|
||||
|
||||
mMasterGain = 1.f;
|
||||
mInternalGain = 0.f;
|
||||
// Setting mInternalGain to an out of range value fixes the issue reported in STORM-830.
|
||||
// There is an edge case in setMasterGain during startup which prevents setInternalGain from
|
||||
// being called if the master volume setting and mInternalGain both equal 0, so using -1 forces
|
||||
// the if statement in setMasterGain to execute when the viewer starts up.
|
||||
mInternalGain = -1.f;
|
||||
mNextWindUpdate = 0.f;
|
||||
|
||||
mStreamingAudioImpl = NULL;
|
||||
|
|
|
|||
|
|
@ -92,6 +92,17 @@ LLFILE* LLFile::_fsopen(const std::string& filename, const char* mode, int shari
|
|||
#endif
|
||||
}
|
||||
|
||||
int LLFile::close(LLFILE * file)
|
||||
{
|
||||
int ret_value = 0;
|
||||
if (file)
|
||||
{
|
||||
ret_value = fclose(file);
|
||||
}
|
||||
return ret_value;
|
||||
}
|
||||
|
||||
|
||||
int LLFile::remove(const std::string& filename)
|
||||
{
|
||||
#if LL_WINDOWS
|
||||
|
|
|
|||
|
|
@ -71,6 +71,8 @@ public:
|
|||
static LLFILE* fopen(const std::string& filename,const char* accessmode); /* Flawfinder: ignore */
|
||||
static LLFILE* _fsopen(const std::string& filename,const char* accessmode,int sharingFlag);
|
||||
|
||||
static int close(LLFILE * file);
|
||||
|
||||
// perms is a permissions mask like 0777 or 0700. In most cases it will
|
||||
// be overridden by the user's umask. It is ignored on Windows.
|
||||
static int mkdir(const std::string& filename, int perms = 0700);
|
||||
|
|
|
|||
|
|
@ -26,6 +26,12 @@
|
|||
|
||||
#include "linden_common.h"
|
||||
|
||||
#include "llmemory.h"
|
||||
|
||||
#if MEM_TRACK_MEM
|
||||
#include "llthread.h"
|
||||
#endif
|
||||
|
||||
#if defined(LL_WINDOWS)
|
||||
# include <windows.h>
|
||||
# include <psapi.h>
|
||||
|
|
@ -37,8 +43,6 @@
|
|||
# include <unistd.h>
|
||||
#endif
|
||||
|
||||
#include "llmemory.h"
|
||||
|
||||
//----------------------------------------------------------------------------
|
||||
|
||||
//static
|
||||
|
|
@ -105,6 +109,20 @@ U64 LLMemory::getCurrentRSS()
|
|||
return counters.WorkingSetSize;
|
||||
}
|
||||
|
||||
//static
|
||||
U32 LLMemory::getWorkingSetSize()
|
||||
{
|
||||
PROCESS_MEMORY_COUNTERS pmc ;
|
||||
U32 ret = 0 ;
|
||||
|
||||
if (GetProcessMemoryInfo( GetCurrentProcess(), &pmc, sizeof(pmc)) )
|
||||
{
|
||||
ret = pmc.WorkingSetSize ;
|
||||
}
|
||||
|
||||
return ret ;
|
||||
}
|
||||
|
||||
#elif defined(LL_DARWIN)
|
||||
|
||||
/*
|
||||
|
|
@ -151,6 +169,11 @@ U64 LLMemory::getCurrentRSS()
|
|||
return residentSize;
|
||||
}
|
||||
|
||||
U32 LLMemory::getWorkingSetSize()
|
||||
{
|
||||
return 0 ;
|
||||
}
|
||||
|
||||
#elif defined(LL_LINUX)
|
||||
|
||||
U64 LLMemory::getCurrentRSS()
|
||||
|
|
@ -185,6 +208,11 @@ bail:
|
|||
return rss;
|
||||
}
|
||||
|
||||
U32 LLMemory::getWorkingSetSize()
|
||||
{
|
||||
return 0 ;
|
||||
}
|
||||
|
||||
#elif LL_SOLARIS
|
||||
#include <sys/types.h>
|
||||
#include <sys/stat.h>
|
||||
|
|
@ -213,6 +241,12 @@ U64 LLMemory::getCurrentRSS()
|
|||
|
||||
return((U64)proc_psinfo.pr_rssize * 1024);
|
||||
}
|
||||
|
||||
U32 LLMemory::getWorkingSetSize()
|
||||
{
|
||||
return 0 ;
|
||||
}
|
||||
|
||||
#else
|
||||
|
||||
U64 LLMemory::getCurrentRSS()
|
||||
|
|
@ -220,4 +254,144 @@ U64 LLMemory::getCurrentRSS()
|
|||
return 0;
|
||||
}
|
||||
|
||||
U32 LLMemory::getWorkingSetSize()
|
||||
{
|
||||
return 0 ;
|
||||
}
|
||||
|
||||
#endif
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
#if MEM_TRACK_MEM
|
||||
#include "llframetimer.h"
|
||||
|
||||
//static
|
||||
LLMemTracker* LLMemTracker::sInstance = NULL ;
|
||||
|
||||
LLMemTracker::LLMemTracker()
|
||||
{
|
||||
mLastAllocatedMem = LLMemory::getWorkingSetSize() ;
|
||||
mCapacity = 128 ;
|
||||
mCurIndex = 0 ;
|
||||
mCounter = 0 ;
|
||||
mDrawnIndex = 0 ;
|
||||
mPaused = FALSE ;
|
||||
|
||||
mMutexp = new LLMutex(NULL) ;
|
||||
mStringBuffer = new char*[128] ;
|
||||
mStringBuffer[0] = new char[mCapacity * 128] ;
|
||||
for(S32 i = 1 ; i < mCapacity ; i++)
|
||||
{
|
||||
mStringBuffer[i] = mStringBuffer[i-1] + 128 ;
|
||||
}
|
||||
}
|
||||
|
||||
LLMemTracker::~LLMemTracker()
|
||||
{
|
||||
delete[] mStringBuffer[0] ;
|
||||
delete[] mStringBuffer;
|
||||
delete mMutexp ;
|
||||
}
|
||||
|
||||
//static
|
||||
LLMemTracker* LLMemTracker::getInstance()
|
||||
{
|
||||
if(!sInstance)
|
||||
{
|
||||
sInstance = new LLMemTracker() ;
|
||||
}
|
||||
return sInstance ;
|
||||
}
|
||||
|
||||
//static
|
||||
void LLMemTracker::release()
|
||||
{
|
||||
if(sInstance)
|
||||
{
|
||||
delete sInstance ;
|
||||
sInstance = NULL ;
|
||||
}
|
||||
}
|
||||
|
||||
//static
|
||||
void LLMemTracker::track(const char* function, const int line)
|
||||
{
|
||||
static const S32 MIN_ALLOCATION = 0 ; //1KB
|
||||
|
||||
if(mPaused)
|
||||
{
|
||||
return ;
|
||||
}
|
||||
|
||||
U32 allocated_mem = LLMemory::getWorkingSetSize() ;
|
||||
|
||||
LLMutexLock lock(mMutexp) ;
|
||||
|
||||
S32 delta_mem = allocated_mem - mLastAllocatedMem ;
|
||||
mLastAllocatedMem = allocated_mem ;
|
||||
|
||||
if(delta_mem <= 0)
|
||||
{
|
||||
return ; //occupied memory does not grow
|
||||
}
|
||||
|
||||
if(delta_mem < MIN_ALLOCATION)
|
||||
{
|
||||
return ;
|
||||
}
|
||||
|
||||
char* buffer = mStringBuffer[mCurIndex++] ;
|
||||
F32 time = (F32)LLFrameTimer::getElapsedSeconds() ;
|
||||
S32 hours = (S32)(time / (60*60));
|
||||
S32 mins = (S32)((time - hours*(60*60)) / 60);
|
||||
S32 secs = (S32)((time - hours*(60*60) - mins*60));
|
||||
strcpy(buffer, function) ;
|
||||
sprintf(buffer + strlen(function), " line: %d DeltaMem: %d (bytes) Time: %d:%02d:%02d", line, delta_mem, hours,mins,secs) ;
|
||||
|
||||
if(mCounter < mCapacity)
|
||||
{
|
||||
mCounter++ ;
|
||||
}
|
||||
if(mCurIndex >= mCapacity)
|
||||
{
|
||||
mCurIndex = 0 ;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
//static
|
||||
void LLMemTracker::preDraw(BOOL pause)
|
||||
{
|
||||
mMutexp->lock() ;
|
||||
|
||||
mPaused = pause ;
|
||||
mDrawnIndex = mCurIndex - 1;
|
||||
mNumOfDrawn = 0 ;
|
||||
}
|
||||
|
||||
//static
|
||||
void LLMemTracker::postDraw()
|
||||
{
|
||||
mMutexp->unlock() ;
|
||||
}
|
||||
|
||||
//static
|
||||
const char* LLMemTracker::getNextLine()
|
||||
{
|
||||
if(mNumOfDrawn >= mCounter)
|
||||
{
|
||||
return NULL ;
|
||||
}
|
||||
mNumOfDrawn++;
|
||||
|
||||
if(mDrawnIndex < 0)
|
||||
{
|
||||
mDrawnIndex = mCapacity - 1 ;
|
||||
}
|
||||
|
||||
return mStringBuffer[mDrawnIndex--] ;
|
||||
}
|
||||
|
||||
#endif //MEM_TRACK_MEM
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
|
||||
|
|
|
|||
|
|
@ -26,7 +26,7 @@
|
|||
#ifndef LLMEMORY_H
|
||||
#define LLMEMORY_H
|
||||
|
||||
|
||||
#include "llmemtype.h"
|
||||
|
||||
extern S32 gTotalDAlloc;
|
||||
extern S32 gTotalDAUse;
|
||||
|
|
@ -44,10 +44,55 @@ public:
|
|||
// Return the resident set size of the current process, in bytes.
|
||||
// Return value is zero if not known.
|
||||
static U64 getCurrentRSS();
|
||||
static U32 getWorkingSetSize();
|
||||
private:
|
||||
static char* reserveMem;
|
||||
};
|
||||
|
||||
//----------------------------------------------------------------------------
|
||||
#if MEM_TRACK_MEM
|
||||
class LLMutex ;
|
||||
class LL_COMMON_API LLMemTracker
|
||||
{
|
||||
private:
|
||||
LLMemTracker() ;
|
||||
~LLMemTracker() ;
|
||||
|
||||
public:
|
||||
static void release() ;
|
||||
static LLMemTracker* getInstance() ;
|
||||
|
||||
void track(const char* function, const int line) ;
|
||||
void preDraw(BOOL pause) ;
|
||||
void postDraw() ;
|
||||
const char* getNextLine() ;
|
||||
|
||||
private:
|
||||
static LLMemTracker* sInstance ;
|
||||
|
||||
char** mStringBuffer ;
|
||||
S32 mCapacity ;
|
||||
U32 mLastAllocatedMem ;
|
||||
S32 mCurIndex ;
|
||||
S32 mCounter;
|
||||
S32 mDrawnIndex;
|
||||
S32 mNumOfDrawn;
|
||||
BOOL mPaused;
|
||||
LLMutex* mMutexp ;
|
||||
};
|
||||
|
||||
#define MEM_TRACK_RELEASE LLMemTracker::release() ;
|
||||
#define MEM_TRACK LLMemTracker::getInstance()->track(__FUNCTION__, __LINE__) ;
|
||||
|
||||
#else // MEM_TRACK_MEM
|
||||
|
||||
#define MEM_TRACK_RELEASE
|
||||
#define MEM_TRACK
|
||||
|
||||
#endif // MEM_TRACK_MEM
|
||||
|
||||
//----------------------------------------------------------------------------
|
||||
|
||||
// LLRefCount moved to llrefcount.h
|
||||
|
||||
// LLPointer moved to llpointer.h
|
||||
|
|
|
|||
|
|
@ -229,3 +229,4 @@ char const * LLMemType::getNameFromID(S32 id)
|
|||
return DeclareMemType::mNameList[id];
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
|
|
|
|||
|
|
@ -28,7 +28,7 @@
|
|||
#define LL_LLVERSIONVIEWER_H
|
||||
|
||||
const S32 LL_VERSION_MAJOR = 2;
|
||||
const S32 LL_VERSION_MINOR = 5;
|
||||
const S32 LL_VERSION_MINOR = 6;
|
||||
const S32 LL_VERSION_PATCH = 0;
|
||||
const S32 LL_VERSION_BUILD = 0;
|
||||
|
||||
|
|
|
|||
|
|
@ -274,11 +274,11 @@ LLImageRaw::LLImageRaw(U8 *data, U16 width, U16 height, S8 components)
|
|||
++sRawImageCount;
|
||||
}
|
||||
|
||||
LLImageRaw::LLImageRaw(const std::string& filename, bool j2c_lowest_mip_only)
|
||||
: LLImageBase()
|
||||
{
|
||||
createFromFile(filename, j2c_lowest_mip_only);
|
||||
}
|
||||
//LLImageRaw::LLImageRaw(const std::string& filename, bool j2c_lowest_mip_only)
|
||||
// : LLImageBase()
|
||||
//{
|
||||
// createFromFile(filename, j2c_lowest_mip_only);
|
||||
//}
|
||||
|
||||
LLImageRaw::~LLImageRaw()
|
||||
{
|
||||
|
|
@ -1178,7 +1178,7 @@ file_extensions[] =
|
|||
{ "png", IMG_CODEC_PNG }
|
||||
};
|
||||
#define NUM_FILE_EXTENSIONS LL_ARRAY_SIZE(file_extensions)
|
||||
|
||||
#if 0
|
||||
static std::string find_file(std::string &name, S8 *codec)
|
||||
{
|
||||
std::string tname;
|
||||
|
|
@ -1196,7 +1196,7 @@ static std::string find_file(std::string &name, S8 *codec)
|
|||
}
|
||||
return std::string("");
|
||||
}
|
||||
|
||||
#endif
|
||||
EImageCodec LLImageBase::getCodecFromExtension(const std::string& exten)
|
||||
{
|
||||
for (int i=0; i<(int)(NUM_FILE_EXTENSIONS); i++)
|
||||
|
|
@ -1206,7 +1206,7 @@ EImageCodec LLImageBase::getCodecFromExtension(const std::string& exten)
|
|||
}
|
||||
return IMG_CODEC_INVALID;
|
||||
}
|
||||
|
||||
#if 0
|
||||
bool LLImageRaw::createFromFile(const std::string &filename, bool j2c_lowest_mip_only)
|
||||
{
|
||||
std::string name = filename;
|
||||
|
|
@ -1313,7 +1313,7 @@ bool LLImageRaw::createFromFile(const std::string &filename, bool j2c_lowest_mip
|
|||
|
||||
return true;
|
||||
}
|
||||
|
||||
#endif
|
||||
//---------------------------------------------------------------------------
|
||||
// LLImageFormatted
|
||||
//---------------------------------------------------------------------------
|
||||
|
|
|
|||
|
|
@ -164,7 +164,7 @@ public:
|
|||
LLImageRaw(U16 width, U16 height, S8 components);
|
||||
LLImageRaw(U8 *data, U16 width, U16 height, S8 components);
|
||||
// Construct using createFromFile (used by tools)
|
||||
LLImageRaw(const std::string& filename, bool j2c_lowest_mip_only = false);
|
||||
//LLImageRaw(const std::string& filename, bool j2c_lowest_mip_only = false);
|
||||
|
||||
/*virtual*/ void deleteData();
|
||||
/*virtual*/ U8* allocateData(S32 size = -1);
|
||||
|
|
@ -226,7 +226,7 @@ public:
|
|||
|
||||
protected:
|
||||
// Create an image from a local file (generally used in tools)
|
||||
bool createFromFile(const std::string& filename, bool j2c_lowest_mip_only = false);
|
||||
//bool createFromFile(const std::string& filename, bool j2c_lowest_mip_only = false);
|
||||
|
||||
void copyLineScaled( U8* in, U8* out, S32 in_pixel_len, S32 out_pixel_len, S32 in_pixel_step, S32 out_pixel_step );
|
||||
void compositeRowScaled4onto3( U8* in, U8* out, S32 in_pixel_len, S32 out_pixel_len );
|
||||
|
|
|
|||
|
|
@ -50,8 +50,6 @@ LLPngWrapper::LLPngWrapper()
|
|||
mCompressionType( 0 ),
|
||||
mFilterMethod( 0 ),
|
||||
mFinalSize( 0 ),
|
||||
mHasBKGD(false),
|
||||
mBackgroundColor(),
|
||||
mGamma(0.f)
|
||||
{
|
||||
}
|
||||
|
|
@ -111,9 +109,9 @@ void LLPngWrapper::writeFlush(png_structp png_ptr)
|
|||
}
|
||||
|
||||
// Read the PNG file using the libpng. The low-level interface is used here
|
||||
// because we want to do various transformations (including setting the
|
||||
// matte background if any, and applying gama) which can't be done with
|
||||
// the high-level interface. The scanline also begins at the bottom of
|
||||
// because we want to do various transformations (including applying gama)
|
||||
// which can't be done with the high-level interface.
|
||||
// The scanline also begins at the bottom of
|
||||
// the image (per SecondLife conventions) instead of at the top, so we
|
||||
// must assign row-pointers in "reverse" order.
|
||||
BOOL LLPngWrapper::readPng(U8* src, LLImageRaw* rawImage, ImageInfo *infop)
|
||||
|
|
@ -201,8 +199,7 @@ void LLPngWrapper::normalizeImage()
|
|||
// 2. Convert grayscales to RGB
|
||||
// 3. Create alpha layer from transparency
|
||||
// 4. Ensure 8-bpp for all images
|
||||
// 5. Apply background matte if any
|
||||
// 6. Set (or guess) gamma
|
||||
// 5. Set (or guess) gamma
|
||||
|
||||
if (mColorType == PNG_COLOR_TYPE_PALETTE)
|
||||
{
|
||||
|
|
@ -229,12 +226,6 @@ void LLPngWrapper::normalizeImage()
|
|||
{
|
||||
png_set_strip_16(mReadPngPtr);
|
||||
}
|
||||
mHasBKGD = png_get_bKGD(mReadPngPtr, mReadInfoPtr, &mBackgroundColor);
|
||||
if (mHasBKGD)
|
||||
{
|
||||
png_set_background(mReadPngPtr, mBackgroundColor,
|
||||
PNG_BACKGROUND_GAMMA_FILE, 1, 1.0);
|
||||
}
|
||||
|
||||
#if LL_DARWIN
|
||||
const F64 SCREEN_GAMMA = 1.8;
|
||||
|
|
@ -261,7 +252,6 @@ void LLPngWrapper::updateMetaData()
|
|||
mBitDepth = png_get_bit_depth(mReadPngPtr, mReadInfoPtr);
|
||||
mColorType = png_get_color_type(mReadPngPtr, mReadInfoPtr);
|
||||
mChannels = png_get_channels(mReadPngPtr, mReadInfoPtr);
|
||||
mHasBKGD = png_get_bKGD(mReadPngPtr, mReadInfoPtr, &mBackgroundColor);
|
||||
}
|
||||
|
||||
// Method to write raw image into PNG at dest. The raw scanline begins
|
||||
|
|
|
|||
|
|
@ -88,9 +88,6 @@ private:
|
|||
|
||||
U32 mFinalSize;
|
||||
|
||||
bool mHasBKGD;
|
||||
png_color_16p mBackgroundColor;
|
||||
|
||||
F64 mGamma;
|
||||
|
||||
std::string mErrorMessage;
|
||||
|
|
|
|||
|
|
@ -89,6 +89,19 @@ void LLBBox::addBBoxAgent(const LLBBox& b)
|
|||
}
|
||||
}
|
||||
|
||||
LLBBox LLBBox::getAxisAligned() const
|
||||
{
|
||||
// no rotation = axis aligned rotation
|
||||
LLBBox aligned(mPosAgent, LLQuaternion(), LLVector3(), LLVector3());
|
||||
|
||||
// add the center point so that it's not empty
|
||||
aligned.addPointAgent(mPosAgent);
|
||||
|
||||
// add our BBox
|
||||
aligned.addBBoxAgent(*this);
|
||||
|
||||
return aligned;
|
||||
}
|
||||
|
||||
void LLBBox::expand( F32 delta )
|
||||
{
|
||||
|
|
@ -147,6 +160,15 @@ BOOL LLBBox::containsPointAgent(const LLVector3& p) const
|
|||
return containsPointLocal(point_local);
|
||||
}
|
||||
|
||||
LLVector3 LLBBox::getMinAgent() const
|
||||
{
|
||||
return localToAgent(mMinLocal);
|
||||
}
|
||||
|
||||
LLVector3 LLBBox::getMaxAgent() const
|
||||
{
|
||||
return localToAgent(mMaxLocal);
|
||||
}
|
||||
|
||||
/*
|
||||
LLBBox operator*(const LLBBox &a, const LLMatrix4 &b)
|
||||
|
|
|
|||
|
|
@ -51,9 +51,11 @@ public:
|
|||
const LLVector3& getPositionAgent() const { return mPosAgent; }
|
||||
const LLQuaternion& getRotation() const { return mRotation; }
|
||||
|
||||
LLVector3 getMinAgent() const;
|
||||
const LLVector3& getMinLocal() const { return mMinLocal; }
|
||||
void setMinLocal( const LLVector3& min ) { mMinLocal = min; }
|
||||
|
||||
LLVector3 getMaxAgent() const;
|
||||
const LLVector3& getMaxLocal() const { return mMaxLocal; }
|
||||
void setMaxLocal( const LLVector3& max ) { mMaxLocal = max; }
|
||||
|
||||
|
|
@ -80,6 +82,8 @@ public:
|
|||
LLVector3 localToAgentBasis(const LLVector3& v) const;
|
||||
LLVector3 agentToLocalBasis(const LLVector3& v) const;
|
||||
|
||||
// Get the smallest possible axis aligned bbox that contains this bbox
|
||||
LLBBox getAxisAligned() const;
|
||||
|
||||
// friend LLBBox operator*(const LLBBox& a, const LLMatrix4& b);
|
||||
|
||||
|
|
|
|||
|
|
@ -4406,19 +4406,54 @@ std::ostream& operator<<(std::ostream &s, const LLVolume *volumep)
|
|||
|
||||
BOOL LLVolumeFace::create(LLVolume* volume, BOOL partial_build)
|
||||
{
|
||||
BOOL ret = FALSE ;
|
||||
if (mTypeMask & CAP_MASK)
|
||||
{
|
||||
return createCap(volume, partial_build);
|
||||
ret = createCap(volume, partial_build);
|
||||
}
|
||||
else if ((mTypeMask & END_MASK) || (mTypeMask & SIDE_MASK))
|
||||
{
|
||||
return createSide(volume, partial_build);
|
||||
ret = createSide(volume, partial_build);
|
||||
}
|
||||
else
|
||||
{
|
||||
llerrs << "Unknown/uninitialized face type!" << llendl;
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
//update the range of the texture coordinates
|
||||
if(ret)
|
||||
{
|
||||
mTexCoordExtents[0].setVec(1.f, 1.f) ;
|
||||
mTexCoordExtents[1].setVec(0.f, 0.f) ;
|
||||
|
||||
U32 end = mVertices.size() ;
|
||||
for(U32 i = 0 ; i < end ; i++)
|
||||
{
|
||||
if(mTexCoordExtents[0].mV[0] > mVertices[i].mTexCoord.mV[0])
|
||||
{
|
||||
mTexCoordExtents[0].mV[0] = mVertices[i].mTexCoord.mV[0] ;
|
||||
}
|
||||
if(mTexCoordExtents[1].mV[0] < mVertices[i].mTexCoord.mV[0])
|
||||
{
|
||||
mTexCoordExtents[1].mV[0] = mVertices[i].mTexCoord.mV[0] ;
|
||||
}
|
||||
|
||||
if(mTexCoordExtents[0].mV[1] > mVertices[i].mTexCoord.mV[1])
|
||||
{
|
||||
mTexCoordExtents[0].mV[1] = mVertices[i].mTexCoord.mV[1] ;
|
||||
}
|
||||
if(mTexCoordExtents[1].mV[1] < mVertices[i].mTexCoord.mV[1])
|
||||
{
|
||||
mTexCoordExtents[1].mV[1] = mVertices[i].mTexCoord.mV[1] ;
|
||||
}
|
||||
}
|
||||
mTexCoordExtents[0].mV[0] = llmax(0.f, mTexCoordExtents[0].mV[0]) ;
|
||||
mTexCoordExtents[0].mV[1] = llmax(0.f, mTexCoordExtents[0].mV[1]) ;
|
||||
mTexCoordExtents[1].mV[0] = llmin(1.f, mTexCoordExtents[1].mV[0]) ;
|
||||
mTexCoordExtents[1].mV[1] = llmin(1.f, mTexCoordExtents[1].mV[1]) ;
|
||||
}
|
||||
|
||||
return ret ;
|
||||
}
|
||||
|
||||
void LerpPlanarVertex(LLVolumeFace::VertexData& v0,
|
||||
|
|
|
|||
|
|
@ -831,6 +831,7 @@ public:
|
|||
S32 mNumT;
|
||||
|
||||
LLVector3 mExtents[2]; //minimum and maximum point of face
|
||||
LLVector2 mTexCoordExtents[2]; //minimum and maximum of texture coordinates of the face.
|
||||
|
||||
std::vector<VertexData> mVertices;
|
||||
std::vector<U16> mIndices;
|
||||
|
|
|
|||
|
|
@ -87,6 +87,7 @@ LLCircuitData::LLCircuitData(const LLHost &host, TPACKETID in_id,
|
|||
mPingDelayAveraged((F32)INITIAL_PING_VALUE_MSEC),
|
||||
mUnackedPacketCount(0),
|
||||
mUnackedPacketBytes(0),
|
||||
mLastPacketInTime(0.0),
|
||||
mLocalEndPointID(),
|
||||
mPacketsOut(0),
|
||||
mPacketsIn(0),
|
||||
|
|
@ -667,6 +668,8 @@ void LLCircuitData::checkPacketInID(TPACKETID id, BOOL receive_resent)
|
|||
mHighestPacketID = llmax(mHighestPacketID, id);
|
||||
}
|
||||
|
||||
// Save packet arrival time
|
||||
mLastPacketInTime = LLMessageSystem::getMessageTimeSeconds();
|
||||
|
||||
// Have we received anything on this circuit yet?
|
||||
if (0 == mPacketsIn)
|
||||
|
|
|
|||
|
|
@ -122,7 +122,7 @@ public:
|
|||
U32 getPacketsLost() const;
|
||||
TPACKETID getPacketOutID() const;
|
||||
BOOL getTrusted() const;
|
||||
F32 getAgeInSeconds() const;
|
||||
F32 getAgeInSeconds() const;
|
||||
S32 getUnackedPacketCount() const { return mUnackedPacketCount; }
|
||||
S32 getUnackedPacketBytes() const { return mUnackedPacketBytes; }
|
||||
F64 getNextPingSendTime() const { return mNextPingSendTime; }
|
||||
|
|
@ -130,6 +130,7 @@ public:
|
|||
{ return mOutOfOrderRate.meanValue(scale); }
|
||||
U32 getLastPacketGap() const { return mLastPacketGap; }
|
||||
LLHost getHost() const { return mHost; }
|
||||
F64 getLastPacketInTime() const { return mLastPacketInTime; }
|
||||
|
||||
LLThrottleGroup &getThrottleGroup() { return mThrottles; }
|
||||
|
||||
|
|
@ -248,6 +249,7 @@ protected:
|
|||
S32 mUnackedPacketCount;
|
||||
S32 mUnackedPacketBytes;
|
||||
|
||||
F64 mLastPacketInTime; // Time of last packet arrival
|
||||
|
||||
LLUUID mLocalEndPointID;
|
||||
|
||||
|
|
|
|||
|
|
@ -42,9 +42,6 @@ const U32 REGION_FLAGS_RESET_HOME_ON_TELEPORT = (1 << 3);
|
|||
// Does the sun move?
|
||||
const U32 REGION_FLAGS_SUN_FIXED = (1 << 4);
|
||||
|
||||
// Tax free zone (no taxes on objects, land, etc.)
|
||||
const U32 REGION_FLAGS_TAX_FREE = (1 << 5);
|
||||
|
||||
// Can't change the terrain heightfield, even on owned parcels,
|
||||
// but can plant trees and grass.
|
||||
const U32 REGION_FLAGS_BLOCK_TERRAFORM = (1 << 6);
|
||||
|
|
@ -54,17 +51,12 @@ const U32 REGION_FLAGS_BLOCK_LAND_RESELL = (1 << 7);
|
|||
|
||||
// All content wiped once per night
|
||||
const U32 REGION_FLAGS_SANDBOX = (1 << 8);
|
||||
const U32 REGION_FLAGS_NULL_LAYER = (1 << 9);
|
||||
// const U32 REGION_FLAGS_SKIP_AGENT_ACTION = (1 << 10);
|
||||
const U32 REGION_FLAGS_HARD_ALLOW_LAND_TRANSFER = (1 << 10); // Region allows land reselling
|
||||
// const U32 REGION_FLAGS_SKIP_UPDATE_INTEREST_LIST= (1 << 11);
|
||||
const U32 REGION_FLAGS_HARD_ALLOW_POST_CLASSIFIED = (1 << 11); // Region allows posting of classified ads
|
||||
const U32 REGION_FLAGS_SKIP_COLLISIONS = (1 << 12); // Pin all non agent rigid bodies
|
||||
const U32 REGION_FLAGS_SKIP_SCRIPTS = (1 << 13);
|
||||
const U32 REGION_FLAGS_SKIP_PHYSICS = (1 << 14); // Skip all physics
|
||||
const U32 REGION_FLAGS_EXTERNALLY_VISIBLE = (1 << 15);
|
||||
//const U32 REGION_FLAGS_MAINLAND_VISIBLE = (1 << 16);
|
||||
const U32 REGION_FLAGS_PUBLIC_ALLOWED = (1 << 17);
|
||||
const U32 REGION_FLAGS_ALLOW_RETURN_ENCROACHING_OBJECT = (1 << 16);
|
||||
const U32 REGION_FLAGS_ALLOW_RETURN_ENCROACHING_ESTATE_OBJECT = (1 << 17);
|
||||
const U32 REGION_FLAGS_BLOCK_DWELL = (1 << 18);
|
||||
|
||||
// Is flight allowed?
|
||||
|
|
@ -81,18 +73,13 @@ const U32 REGION_FLAGS_ESTATE_SKIP_SCRIPTS = (1 << 21);
|
|||
const U32 REGION_FLAGS_RESTRICT_PUSHOBJECT = (1 << 22);
|
||||
|
||||
const U32 REGION_FLAGS_DENY_ANONYMOUS = (1 << 23);
|
||||
// const U32 REGION_FLAGS_DENY_IDENTIFIED = (1 << 24);
|
||||
// const U32 REGION_FLAGS_DENY_TRANSACTED = (1 << 25);
|
||||
|
||||
const U32 REGION_FLAGS_ALLOW_PARCEL_CHANGES = (1 << 26);
|
||||
|
||||
// const U32 REGION_FLAGS_ABUSE_EMAIL_TO_ESTATE_OWNER = (1 << 27); // We no longer support ELAR
|
||||
|
||||
const U32 REGION_FLAGS_ALLOW_VOICE = (1 << 28);
|
||||
|
||||
const U32 REGION_FLAGS_BLOCK_PARCEL_SEARCH = (1 << 29);
|
||||
const U32 REGION_FLAGS_DENY_AGEUNVERIFIED = (1 << 30);
|
||||
const U32 REGION_FLAGS_SKIP_MONO_SCRIPTS = (1 << 31);
|
||||
|
||||
const U32 REGION_FLAGS_DEFAULT = REGION_FLAGS_ALLOW_LANDMARK |
|
||||
REGION_FLAGS_ALLOW_SET_HOME |
|
||||
|
|
@ -105,7 +92,6 @@ const U32 REGION_FLAGS_PRELUDE_UNSET = REGION_FLAGS_ALLOW_LANDMARK
|
|||
| REGION_FLAGS_ALLOW_SET_HOME;
|
||||
|
||||
const U32 REGION_FLAGS_ESTATE_MASK = REGION_FLAGS_EXTERNALLY_VISIBLE
|
||||
| REGION_FLAGS_PUBLIC_ALLOWED
|
||||
| REGION_FLAGS_SUN_FIXED
|
||||
| REGION_FLAGS_DENY_ANONYMOUS
|
||||
| REGION_FLAGS_DENY_AGEUNVERIFIED;
|
||||
|
|
|
|||
|
|
@ -403,7 +403,7 @@ S32 LLTextureEntry::setOffsetT(F32 t)
|
|||
|
||||
S32 LLTextureEntry::setRotation(F32 theta)
|
||||
{
|
||||
if (mRotation != theta)
|
||||
if (mRotation != theta && llfinite(theta))
|
||||
{
|
||||
mRotation = theta;
|
||||
return TEM_CHANGE_TEXTURE;
|
||||
|
|
|
|||
|
|
@ -1063,16 +1063,6 @@ BOOL LLImageGL::setSubImageFromFrameBuffer(S32 fb_x, S32 fb_y, S32 x_pos, S32 y_
|
|||
{
|
||||
if (gGL.getTexUnit(0)->bind(this, false, true))
|
||||
{
|
||||
if(gGLManager.mDebugGPU)
|
||||
{
|
||||
llinfos << "Calling glCopyTexSubImage2D(...)" << llendl ;
|
||||
checkTexSize(true) ;
|
||||
llcallstacks << fb_x << " : " << fb_y << " : " << x_pos << " : " << y_pos << " : " << width << " : " << height <<
|
||||
" : " << (S32)mComponents << llcallstacksendl ;
|
||||
|
||||
log_glerror() ;
|
||||
}
|
||||
|
||||
glCopyTexSubImage2D(GL_TEXTURE_2D, 0, fb_x, fb_y, x_pos, y_pos, width, height);
|
||||
mGLTextureCreated = true;
|
||||
stop_glerror();
|
||||
|
|
|
|||
|
|
@ -272,9 +272,6 @@ LLFloater::LLFloater(const LLSD& key, const LLFloater::Params& p)
|
|||
|
||||
initFromParams(p);
|
||||
|
||||
// chrome floaters don't take focus at all
|
||||
setFocusRoot(!getIsChrome());
|
||||
|
||||
initFloater(p);
|
||||
}
|
||||
|
||||
|
|
@ -2910,8 +2907,6 @@ bool LLFloater::initFloaterXML(LLXMLNodePtr node, LLView *parent, const std::str
|
|||
params.from_xui = true;
|
||||
applyXUILayout(params, parent);
|
||||
initFromParams(params);
|
||||
// chrome floaters don't take focus at all
|
||||
setFocusRoot(!getIsChrome());
|
||||
|
||||
initFloater(params);
|
||||
|
||||
|
|
|
|||
|
|
@ -1637,6 +1637,10 @@ LLMenuScrollItem::LLMenuScrollItem(const Params& p)
|
|||
}
|
||||
|
||||
LLButton::Params bparams;
|
||||
|
||||
// Disabled the Return key handling by LLMenuScrollItem instead of
|
||||
// passing the key press to the currently selected menu item. See STORM-385.
|
||||
bparams.commit_on_return(false);
|
||||
bparams.mouse_opaque(true);
|
||||
bparams.scale_image(false);
|
||||
bparams.click_callback(p.scroll_callback);
|
||||
|
|
|
|||
|
|
@ -1367,7 +1367,6 @@ LLNotifications::TemplateNames LLNotifications::getTemplateNames() const
|
|||
typedef std::map<std::string, std::string> StringMap;
|
||||
void replaceSubstitutionStrings(LLXMLNodePtr node, StringMap& replacements)
|
||||
{
|
||||
//llwarns << "replaceSubstitutionStrings" << llendl;
|
||||
// walk the list of attributes looking for replacements
|
||||
for (LLXMLAttribList::iterator it=node->mAttributes.begin();
|
||||
it != node->mAttributes.end(); ++it)
|
||||
|
|
@ -1381,13 +1380,12 @@ void replaceSubstitutionStrings(LLXMLNodePtr node, StringMap& replacements)
|
|||
if (found != replacements.end())
|
||||
{
|
||||
replacement = found->second;
|
||||
//llwarns << "replaceSubstituionStrings: value: " << value << " repl: " << replacement << llendl;
|
||||
|
||||
lldebugs << "replaceSubstitutionStrings: value: \"" << value << "\" repl: \"" << replacement << "\"." << llendl;
|
||||
it->second->setValue(replacement);
|
||||
}
|
||||
else
|
||||
{
|
||||
llwarns << "replaceSubstituionStrings FAILURE: value: " << value << " repl: " << replacement << llendl;
|
||||
llwarns << "replaceSubstitutionStrings FAILURE: could not find replacement \"" << value << "\"." << llendl;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -36,6 +36,7 @@
|
|||
#include "llcachename.h"
|
||||
#include "lltrans.h"
|
||||
#include "lluicolortable.h"
|
||||
#include "message.h"
|
||||
|
||||
#define APP_HEADER_REGEX "((x-grid-location-info://[-\\w\\.]+/app)|(secondlife:///app))"
|
||||
|
||||
|
|
@ -684,8 +685,8 @@ std::string LLUrlEntryGroup::getLabel(const std::string &url, const LLUrlLabelCa
|
|||
LLStyle::Params LLUrlEntryGroup::getStyle() const
|
||||
{
|
||||
LLStyle::Params style_params = LLUrlEntryBase::getStyle();
|
||||
style_params.color = LLUIColorTable::instance().getColor("GroupLinkColor");
|
||||
style_params.readonly_color = LLUIColorTable::instance().getColor("GroupLinkColor");
|
||||
style_params.color = LLUIColorTable::instance().getColor("HTMLLinkColor");
|
||||
style_params.readonly_color = LLUIColorTable::instance().getColor("HTMLLinkColor");
|
||||
return style_params;
|
||||
}
|
||||
|
||||
|
|
@ -740,6 +741,13 @@ std::string LLUrlEntryObjectIM::getLocation(const std::string &url) const
|
|||
return LLUrlEntryBase::getLocation(url);
|
||||
}
|
||||
|
||||
// LLUrlEntryParcel statics.
|
||||
LLUUID LLUrlEntryParcel::sAgentID(LLUUID::null);
|
||||
LLUUID LLUrlEntryParcel::sSessionID(LLUUID::null);
|
||||
LLHost LLUrlEntryParcel::sRegionHost(LLHost::invalid);
|
||||
bool LLUrlEntryParcel::sDisconnected(false);
|
||||
std::set<LLUrlEntryParcel*> LLUrlEntryParcel::sParcelInfoObservers;
|
||||
|
||||
///
|
||||
/// LLUrlEntryParcel Describes a Second Life parcel Url, e.g.,
|
||||
/// secondlife:///app/parcel/0000060e-4b39-e00b-d0c3-d98b1934e3a8/about
|
||||
|
|
@ -751,13 +759,88 @@ LLUrlEntryParcel::LLUrlEntryParcel()
|
|||
boost::regex::perl|boost::regex::icase);
|
||||
mMenuName = "menu_url_parcel.xml";
|
||||
mTooltip = LLTrans::getString("TooltipParcelUrl");
|
||||
|
||||
sParcelInfoObservers.insert(this);
|
||||
}
|
||||
|
||||
LLUrlEntryParcel::~LLUrlEntryParcel()
|
||||
{
|
||||
sParcelInfoObservers.erase(this);
|
||||
}
|
||||
|
||||
std::string LLUrlEntryParcel::getLabel(const std::string &url, const LLUrlLabelCallback &cb)
|
||||
{
|
||||
LLSD path_array = LLURI(url).pathArray();
|
||||
S32 path_parts = path_array.size();
|
||||
|
||||
if (path_parts < 3) // no parcel id
|
||||
{
|
||||
llwarns << "Failed to parse url [" << url << "]" << llendl;
|
||||
return url;
|
||||
}
|
||||
|
||||
std::string parcel_id_string = unescapeUrl(path_array[2]); // parcel id
|
||||
|
||||
// Add an observer to call LLUrlLabelCallback when we have parcel name.
|
||||
addObserver(parcel_id_string, url, cb);
|
||||
|
||||
LLUUID parcel_id(parcel_id_string);
|
||||
|
||||
sendParcelInfoRequest(parcel_id);
|
||||
|
||||
return unescapeUrl(url);
|
||||
}
|
||||
|
||||
void LLUrlEntryParcel::sendParcelInfoRequest(const LLUUID& parcel_id)
|
||||
{
|
||||
if (sRegionHost == LLHost::invalid || sDisconnected) return;
|
||||
|
||||
LLMessageSystem *msg = gMessageSystem;
|
||||
msg->newMessage("ParcelInfoRequest");
|
||||
msg->nextBlockFast(_PREHASH_AgentData);
|
||||
msg->addUUIDFast(_PREHASH_AgentID, sAgentID );
|
||||
msg->addUUID("SessionID", sSessionID);
|
||||
msg->nextBlock("Data");
|
||||
msg->addUUID("ParcelID", parcel_id);
|
||||
msg->sendReliable(sRegionHost);
|
||||
}
|
||||
|
||||
void LLUrlEntryParcel::onParcelInfoReceived(const std::string &id, const std::string &label)
|
||||
{
|
||||
callObservers(id, label.empty() ? LLTrans::getString("RegionInfoError") : label, mIcon);
|
||||
}
|
||||
|
||||
// static
|
||||
void LLUrlEntryParcel::processParcelInfo(const LLParcelData& parcel_data)
|
||||
{
|
||||
std::string label(LLStringUtil::null);
|
||||
if (!parcel_data.name.empty())
|
||||
{
|
||||
label = parcel_data.name;
|
||||
}
|
||||
// If parcel name is empty use Sim_name (x, y, z) for parcel label.
|
||||
else if (!parcel_data.sim_name.empty())
|
||||
{
|
||||
S32 region_x = llround(parcel_data.global_x) % REGION_WIDTH_UNITS;
|
||||
S32 region_y = llround(parcel_data.global_y) % REGION_WIDTH_UNITS;
|
||||
S32 region_z = llround(parcel_data.global_z);
|
||||
|
||||
label = llformat("%s (%d, %d, %d)",
|
||||
parcel_data.sim_name.c_str(), region_x, region_y, region_z);
|
||||
}
|
||||
|
||||
for (std::set<LLUrlEntryParcel*>::iterator iter = sParcelInfoObservers.begin();
|
||||
iter != sParcelInfoObservers.end();
|
||||
++iter)
|
||||
{
|
||||
LLUrlEntryParcel* url_entry = *iter;
|
||||
if (url_entry)
|
||||
{
|
||||
url_entry->onParcelInfoReceived(parcel_data.parcel_id.asString(), label);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
//
|
||||
// LLUrlEntryPlace Describes secondlife://<location> URLs
|
||||
//
|
||||
|
|
|
|||
|
|
@ -31,6 +31,9 @@
|
|||
#include "lluuid.h"
|
||||
#include "lluicolor.h"
|
||||
#include "llstyle.h"
|
||||
|
||||
#include "llhost.h" // for resolving parcel name by parcel id
|
||||
|
||||
#include <boost/signals2.hpp>
|
||||
#include <boost/regex.hpp>
|
||||
#include <string>
|
||||
|
|
@ -285,8 +288,44 @@ private:
|
|||
class LLUrlEntryParcel : public LLUrlEntryBase
|
||||
{
|
||||
public:
|
||||
struct LLParcelData
|
||||
{
|
||||
LLUUID parcel_id;
|
||||
std::string name;
|
||||
std::string sim_name;
|
||||
F32 global_x;
|
||||
F32 global_y;
|
||||
F32 global_z;
|
||||
};
|
||||
|
||||
LLUrlEntryParcel();
|
||||
~LLUrlEntryParcel();
|
||||
/*virtual*/ std::string getLabel(const std::string &url, const LLUrlLabelCallback &cb);
|
||||
|
||||
// Sends a parcel info request to sim.
|
||||
void sendParcelInfoRequest(const LLUUID& parcel_id);
|
||||
|
||||
// Calls observers of certain parcel id providing them with parcel label.
|
||||
void onParcelInfoReceived(const std::string &id, const std::string &label);
|
||||
|
||||
// Processes parcel label and triggers notifying observers.
|
||||
static void processParcelInfo(const LLParcelData& parcel_data);
|
||||
|
||||
// Next 4 setters are used to update agent and viewer connection information
|
||||
// upon events like user login, viewer disconnect and user changing region host.
|
||||
// These setters are made public to be accessible from newview and should not be
|
||||
// used in other cases.
|
||||
static void setAgentID(const LLUUID& id) { sAgentID = id; }
|
||||
static void setSessionID(const LLUUID& id) { sSessionID = id; }
|
||||
static void setRegionHost(const LLHost& host) { sRegionHost = host; }
|
||||
static void setDisconnected(bool disconnected) { sDisconnected = disconnected; }
|
||||
|
||||
private:
|
||||
static LLUUID sAgentID;
|
||||
static LLUUID sSessionID;
|
||||
static LLHost sRegionHost;
|
||||
static bool sDisconnected;
|
||||
static std::set<LLUrlEntryParcel*> sParcelInfoObservers;
|
||||
};
|
||||
|
||||
///
|
||||
|
|
|
|||
|
|
@ -30,6 +30,7 @@
|
|||
#include "llavatarnamecache.h"
|
||||
#include "llcachename.h"
|
||||
#include "lluuid.h"
|
||||
#include "message.h"
|
||||
|
||||
#include <string>
|
||||
|
||||
|
|
@ -191,3 +192,20 @@ LLFontGL* LLFontGL::getFontDefault()
|
|||
{
|
||||
return NULL;
|
||||
}
|
||||
|
||||
char* _PREHASH_AgentData = "AgentData";
|
||||
char* _PREHASH_AgentID = "AgentID";
|
||||
|
||||
LLHost LLHost::invalid(INVALID_PORT,INVALID_HOST_IP_ADDRESS);
|
||||
|
||||
LLMessageSystem* gMessageSystem = NULL;
|
||||
|
||||
//
|
||||
// Stub implementation for LLMessageSystem
|
||||
//
|
||||
void LLMessageSystem::newMessage(const char *name) { }
|
||||
void LLMessageSystem::nextBlockFast(const char *blockname) { }
|
||||
void LLMessageSystem::nextBlock(const char *blockname) { }
|
||||
void LLMessageSystem::addUUIDFast( const char *varname, const LLUUID& uuid) { }
|
||||
void LLMessageSystem::addUUID( const char *varname, const LLUUID& uuid) { }
|
||||
S32 LLMessageSystem::sendReliable(const LLHost &host) { return 0; }
|
||||
|
|
|
|||
|
|
@ -101,10 +101,18 @@ S32 LLDir::deleteFilesInDir(const std::string &dirname, const std::string &mask)
|
|||
{
|
||||
if (0 != LLFile::remove(fullpath))
|
||||
{
|
||||
retry_count++;
|
||||
result = errno;
|
||||
llwarns << "Problem removing " << fullpath << " - errorcode: "
|
||||
<< result << " attempt " << retry_count << llendl;
|
||||
ms_sleep(1000);
|
||||
|
||||
if(retry_count >= 5)
|
||||
{
|
||||
llwarns << "Failed to remove " << fullpath << llendl ;
|
||||
return count ;
|
||||
}
|
||||
|
||||
ms_sleep(100);
|
||||
}
|
||||
else
|
||||
{
|
||||
|
|
@ -113,8 +121,7 @@ S32 LLDir::deleteFilesInDir(const std::string &dirname, const std::string &mask)
|
|||
llwarns << "Successfully removed " << fullpath << llendl;
|
||||
}
|
||||
break;
|
||||
}
|
||||
retry_count++;
|
||||
}
|
||||
}
|
||||
count++;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -530,6 +530,7 @@ set(viewer_SOURCE_FILES
|
|||
llviewerregion.cpp
|
||||
llviewershadermgr.cpp
|
||||
llviewerstats.cpp
|
||||
llviewerstatsrecorder.cpp
|
||||
llviewertexteditor.cpp
|
||||
llviewertexture.cpp
|
||||
llviewertextureanim.cpp
|
||||
|
|
@ -1063,6 +1064,7 @@ set(viewer_HEADER_FILES
|
|||
llviewerregion.h
|
||||
llviewershadermgr.h
|
||||
llviewerstats.h
|
||||
llviewerstatsrecorder.h
|
||||
llviewertexteditor.h
|
||||
llviewertexture.h
|
||||
llviewertextureanim.h
|
||||
|
|
@ -1716,6 +1718,17 @@ set(ARTWORK_DIR ${CMAKE_CURRENT_SOURCE_DIR} CACHE PATH
|
|||
if (LINUX)
|
||||
set(product SecondLife-${ARCH}-${viewer_VERSION})
|
||||
|
||||
# These are the generated targets that are copied to package/
|
||||
set(COPY_INPUT_DEPENDENCIES
|
||||
${VIEWER_BINARY_NAME}
|
||||
linux-crash-logger
|
||||
linux-updater
|
||||
SLPlugin
|
||||
media_plugin_webkit
|
||||
media_plugin_gstreamer010
|
||||
llcommon
|
||||
)
|
||||
|
||||
add_custom_command(
|
||||
OUTPUT ${product}.tar.bz2
|
||||
COMMAND ${PYTHON_EXECUTABLE}
|
||||
|
|
@ -1733,18 +1746,11 @@ if (LINUX)
|
|||
--login_channel=${VIEWER_LOGIN_CHANNEL}
|
||||
--source=${CMAKE_CURRENT_SOURCE_DIR}
|
||||
--touch=${CMAKE_CURRENT_BINARY_DIR}/${CMAKE_CFG_INTDIR}/.${product}.touched
|
||||
DEPENDS ${VIEWER_BINARY_NAME} ${CMAKE_CURRENT_SOURCE_DIR}/viewer_manifest.py
|
||||
DEPENDS
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/viewer_manifest.py
|
||||
${COPY_INPUT_DEPENDENCIES}
|
||||
)
|
||||
|
||||
add_dependencies(${VIEWER_BINARY_NAME} SLPlugin media_plugin_gstreamer010 media_plugin_webkit)
|
||||
|
||||
if (PACKAGE)
|
||||
add_custom_target(package ALL DEPENDS ${product}.tar.bz2)
|
||||
add_dependencies(package linux-crash-logger-target)
|
||||
add_dependencies(package linux-updater-target)
|
||||
check_message_template(package)
|
||||
endif (PACKAGE)
|
||||
|
||||
add_custom_command(
|
||||
OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/${CMAKE_CFG_INTDIR}/.${product}.copy_touched
|
||||
COMMAND ${PYTHON_EXECUTABLE}
|
||||
|
|
@ -1764,9 +1770,15 @@ if (LINUX)
|
|||
${COPY_INPUT_DEPENDENCIES}
|
||||
COMMENT "Performing viewer_manifest copy"
|
||||
)
|
||||
|
||||
|
||||
add_custom_target(copy_l_viewer_manifest ALL DEPENDS ${CMAKE_CURRENT_BINARY_DIR}/${CMAKE_CFG_INTDIR}/.${product}.copy_touched)
|
||||
add_dependencies(copy_l_viewer_manifest "${VIEWER_BINARY_NAME}" linux-crash-logger-target linux-updater-target)
|
||||
|
||||
if (PACKAGE)
|
||||
add_custom_target(package 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)
|
||||
endif (PACKAGE)
|
||||
endif (LINUX)
|
||||
|
||||
if (DARWIN)
|
||||
|
|
|
|||
|
|
@ -928,39 +928,6 @@
|
|||
<key>Value</key>
|
||||
<integer>1</integer>
|
||||
</map>
|
||||
<key>BulkChangeIncludeAnimations</key>
|
||||
<map>
|
||||
<key>Comment</key>
|
||||
<string>Bulk permission changes affect animations</string>
|
||||
<key>Persist</key>
|
||||
<integer>1</integer>
|
||||
<key>Type</key>
|
||||
<string>Boolean</string>
|
||||
<key>Value</key>
|
||||
<integer>1</integer>
|
||||
</map>
|
||||
<key>BulkChangeIncludeAnimations</key>
|
||||
<map>
|
||||
<key>Comment</key>
|
||||
<string>Bulk permission changes affect animations</string>
|
||||
<key>Persist</key>
|
||||
<integer>1</integer>
|
||||
<key>Type</key>
|
||||
<string>Boolean</string>
|
||||
<key>Value</key>
|
||||
<integer>1</integer>
|
||||
</map>
|
||||
<key>BulkChangeIncludeAnimations</key>
|
||||
<map>
|
||||
<key>Comment</key>
|
||||
<string>Bulk permission changes affect animations</string>
|
||||
<key>Persist</key>
|
||||
<integer>1</integer>
|
||||
<key>Type</key>
|
||||
<string>Boolean</string>
|
||||
<key>Value</key>
|
||||
<integer>1</integer>
|
||||
</map>
|
||||
<key>BulkChangeIncludeBodyParts</key>
|
||||
<map>
|
||||
<key>Comment</key>
|
||||
|
|
@ -1173,18 +1140,7 @@
|
|||
<key>CacheLocationTopFolder</key>
|
||||
<map>
|
||||
<key>Comment</key>
|
||||
<string>Controls the top folder location of the local disk cache</string>
|
||||
<key>Persist</key>
|
||||
<integer>1</integer>
|
||||
<key>Type</key>
|
||||
<string>String</string>
|
||||
<key>Value</key>
|
||||
<string />
|
||||
</map>
|
||||
<key>CacheLocationTopFolder</key>
|
||||
<map>
|
||||
<key>Comment</key>
|
||||
<string>Controls the location of the local disk cache</string>
|
||||
<string>Controls the top folder location of the the local disk cache</string>
|
||||
<key>Persist</key>
|
||||
<integer>1</integer>
|
||||
<key>Type</key>
|
||||
|
|
@ -1201,7 +1157,7 @@
|
|||
<key>Type</key>
|
||||
<string>U32</string>
|
||||
<key>Value</key>
|
||||
<integer>20000</integer>
|
||||
<integer>128</integer>
|
||||
</map>
|
||||
<key>CacheSize</key>
|
||||
<map>
|
||||
|
|
@ -1874,6 +1830,17 @@
|
|||
<key>Value</key>
|
||||
<integer>0</integer>
|
||||
</map>
|
||||
<key>DebugShowMemory</key>
|
||||
<map>
|
||||
<key>Comment</key>
|
||||
<string>Show Total Allocated Memory</string>
|
||||
<key>Persist</key>
|
||||
<integer>1</integer>
|
||||
<key>Type</key>
|
||||
<string>Boolean</string>
|
||||
<key>Value</key>
|
||||
<integer>0</integer>
|
||||
</map>
|
||||
<key>DebugShowRenderInfo</key>
|
||||
<map>
|
||||
<key>Comment</key>
|
||||
|
|
@ -1896,10 +1863,21 @@
|
|||
<key>Value</key>
|
||||
<integer>0</integer>
|
||||
</map>
|
||||
<key>DebugShowTextureInfo</key>
|
||||
<map>
|
||||
<key>Comment</key>
|
||||
<string>Show inertested texture info</string>
|
||||
<key>Persist</key>
|
||||
<integer>1</integer>
|
||||
<key>Type</key>
|
||||
<string>Boolean</string>
|
||||
<key>Value</key>
|
||||
<integer>0</integer>
|
||||
</map>
|
||||
<key>DebugShowTime</key>
|
||||
<map>
|
||||
<key>Comment</key>
|
||||
<string>Show depth buffer contents</string>
|
||||
<string>Show time info</string>
|
||||
<key>Persist</key>
|
||||
<integer>1</integer>
|
||||
<key>Type</key>
|
||||
|
|
@ -3096,17 +3074,6 @@
|
|||
<key>Value</key>
|
||||
<string>http://viewer-settings.secondlife.com</string>
|
||||
</map>
|
||||
<key>FPSLogFrequency</key>
|
||||
<map>
|
||||
<key>Comment</key>
|
||||
<string>Seconds between display of FPS in log (0 for never)</string>
|
||||
<key>Persist</key>
|
||||
<integer>1</integer>
|
||||
<key>Type</key>
|
||||
<string>F32</string>
|
||||
<key>Value</key>
|
||||
<real>60.0</real>
|
||||
</map>
|
||||
<key>FPSLogFrequency</key>
|
||||
<map>
|
||||
<key>Comment</key>
|
||||
|
|
@ -6060,17 +6027,6 @@
|
|||
<integer>0</integer>
|
||||
</map>
|
||||
<key>OutBandwidth</key>
|
||||
<map>
|
||||
<key>Comment</key>
|
||||
<string>Expand render stats display</string>
|
||||
<key>Persist</key>
|
||||
<integer>1</integer>
|
||||
<key>Type</key>
|
||||
<string>Boolean</string>
|
||||
<key>Value</key>
|
||||
<integer>1</integer>
|
||||
</map>
|
||||
<key>OutBandwidth</key>
|
||||
<map>
|
||||
<key>Comment</key>
|
||||
<string>Outgoing bandwidth throttle (bps)</string>
|
||||
|
|
@ -11430,8 +11386,6 @@
|
|||
<key>Type</key>
|
||||
<string>LLSD</string>
|
||||
<key>Value</key>
|
||||
<map>
|
||||
</map>
|
||||
</map>
|
||||
<key>VFSOldSize</key>
|
||||
<map>
|
||||
|
|
@ -11587,17 +11541,6 @@
|
|||
<key>Value</key>
|
||||
<string></string>
|
||||
</map>
|
||||
<key>VivoxDebugSIPURIHostName</key>
|
||||
<map>
|
||||
<key>Comment</key>
|
||||
<string>Hostname portion of vivox SIP URIs (empty string for the default).</string>
|
||||
<key>Persist</key>
|
||||
<integer>1</integer>
|
||||
<key>Type</key>
|
||||
<string>String</string>
|
||||
<key>Value</key>
|
||||
<string></string>
|
||||
</map>
|
||||
<key>VivoxDebugVoiceAccountServerURI</key>
|
||||
<map>
|
||||
<key>Comment</key>
|
||||
|
|
@ -12423,16 +12366,5 @@
|
|||
<key>Value</key>
|
||||
<string>name</string>
|
||||
</map>
|
||||
<key>ReleaseNotesURL</key>
|
||||
<map>
|
||||
<key>Comment</key>
|
||||
<string>Release notes URL template</string>
|
||||
<key>Persist</key>
|
||||
<integer>1</integer>
|
||||
<key>Type</key>
|
||||
<string>String</string>
|
||||
<key>Value</key>
|
||||
<string>http://secondlife.com/app/releasenotes/?channel=[CHANNEL]&version=[VERSION]</string>
|
||||
</map>
|
||||
</map>
|
||||
</llsd>
|
||||
|
|
|
|||
|
|
@ -64,6 +64,7 @@
|
|||
#include "lltool.h"
|
||||
#include "lltoolmgr.h"
|
||||
#include "lltrans.h"
|
||||
#include "llurlentry.h"
|
||||
#include "llviewercontrol.h"
|
||||
#include "llviewerdisplay.h"
|
||||
#include "llviewerjoystick.h"
|
||||
|
|
@ -649,6 +650,10 @@ void LLAgent::setRegion(LLViewerRegion *regionp)
|
|||
}
|
||||
mRegionp = regionp;
|
||||
|
||||
// Pass the region host to LLUrlEntryParcel to resolve parcel name
|
||||
// with a server request.
|
||||
LLUrlEntryParcel::setRegionHost(getRegionHost());
|
||||
|
||||
// Must shift hole-covering water object locations because local
|
||||
// coordinate frame changed.
|
||||
LLWorld::getInstance()->updateWaterObjects();
|
||||
|
|
|
|||
|
|
@ -1300,8 +1300,16 @@ bool LLAppearanceMgr::getCanReplaceCOF(const LLUUID& outfit_cat_id)
|
|||
return false;
|
||||
}
|
||||
|
||||
// Check whether the outfit contains the full set of body parts (shape+skin+hair+eyes).
|
||||
return getCanMakeFolderIntoOutfit(outfit_cat_id);
|
||||
// Check whether the outfit contains any wearables we aren't wearing already (STORM-702).
|
||||
LLInventoryModel::cat_array_t cats;
|
||||
LLInventoryModel::item_array_t items;
|
||||
LLFindWearablesEx is_worn(/*is_worn=*/ false, /*include_body_parts=*/ true);
|
||||
gInventory.collectDescendentsIf(outfit_cat_id,
|
||||
cats,
|
||||
items,
|
||||
LLInventoryModel::EXCLUDE_TRASH,
|
||||
is_worn);
|
||||
return items.size() > 0;
|
||||
}
|
||||
|
||||
void LLAppearanceMgr::purgeBaseOutfitLink(const LLUUID& category)
|
||||
|
|
|
|||
|
|
@ -44,6 +44,7 @@
|
|||
#include "llagentwearables.h"
|
||||
#include "llwindow.h"
|
||||
#include "llviewerstats.h"
|
||||
#include "llviewerstatsrecorder.h"
|
||||
#include "llmd5.h"
|
||||
#include "llpumpio.h"
|
||||
#include "llmimetypes.h"
|
||||
|
|
@ -93,6 +94,7 @@
|
|||
#include "llmemory.h"
|
||||
#include "llprimitive.h"
|
||||
#include "llurlaction.h"
|
||||
#include "llurlentry.h"
|
||||
#include "llvfile.h"
|
||||
#include "llvfsthread.h"
|
||||
#include "llvolumemgr.h"
|
||||
|
|
@ -471,8 +473,6 @@ static void settings_to_globals()
|
|||
gDebugWindowProc = gSavedSettings.getBOOL("DebugWindowProc");
|
||||
gShowObjectUpdates = gSavedSettings.getBOOL("ShowObjectUpdates");
|
||||
LLWorldMapView::sMapScale = gSavedSettings.getF32("MapScale");
|
||||
|
||||
LLCubeMap::sUseCubeMaps = LLFeatureManager::getInstance()->isFeatureAvailable("RenderCubeMap");
|
||||
}
|
||||
|
||||
static void settings_modify()
|
||||
|
|
@ -666,6 +666,10 @@ bool LLAppViewer::init()
|
|||
|
||||
mAlloc.setProfilingEnabled(gSavedSettings.getBOOL("MemProfiling"));
|
||||
|
||||
#if LL_RECORD_VIEWER_STATS
|
||||
LLViewerStatsRecorder::initClass();
|
||||
#endif
|
||||
|
||||
// *NOTE:Mani - LLCurl::initClass is not thread safe.
|
||||
// Called before threads are created.
|
||||
LLCurl::initClass();
|
||||
|
|
@ -848,6 +852,9 @@ bool LLAppViewer::init()
|
|||
gGLActive = TRUE;
|
||||
initWindow();
|
||||
|
||||
// initWindow also initializes the Feature List, so now we can initialize this global.
|
||||
LLCubeMap::sUseCubeMaps = LLFeatureManager::getInstance()->isFeatureAvailable("RenderCubeMap");
|
||||
|
||||
// call all self-registered classes
|
||||
LLInitClassList::instance().fireCallbacks();
|
||||
|
||||
|
|
@ -989,6 +996,8 @@ bool LLAppViewer::init()
|
|||
|
||||
LLAgentLanguage::init();
|
||||
|
||||
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
|
|
@ -1287,7 +1296,7 @@ bool LLAppViewer::mainLoop()
|
|||
resumeMainloopTimeout();
|
||||
|
||||
pingMainloopTimeout("Main:End");
|
||||
}
|
||||
}
|
||||
}
|
||||
catch(std::bad_alloc)
|
||||
{
|
||||
|
|
@ -1389,16 +1398,6 @@ bool LLAppViewer::cleanup()
|
|||
}
|
||||
mPlugins.clear();
|
||||
|
||||
//----------------------------------------------
|
||||
//this test code will be removed after the test
|
||||
//test manual call stack tracer
|
||||
if(gSavedSettings.getBOOL("QAMode"))
|
||||
{
|
||||
LLError::LLCallStacks::print() ;
|
||||
}
|
||||
//end of the test code
|
||||
//----------------------------------------------
|
||||
|
||||
//flag all elements as needing to be destroyed immediately
|
||||
// to ensure shutdown order
|
||||
LLMortician::setZealous(TRUE);
|
||||
|
|
@ -1709,6 +1708,10 @@ bool LLAppViewer::cleanup()
|
|||
}
|
||||
LLMetricPerformanceTesterBasic::cleanClass() ;
|
||||
|
||||
#if LL_RECORD_VIEWER_STATS
|
||||
LLViewerStatsRecorder::cleanupClass();
|
||||
#endif
|
||||
|
||||
llinfos << "Cleaning up Media and Textures" << llendflush;
|
||||
|
||||
//Note:
|
||||
|
|
@ -1776,6 +1779,8 @@ bool LLAppViewer::cleanup()
|
|||
|
||||
ll_close_fail_log();
|
||||
|
||||
MEM_TRACK_RELEASE
|
||||
|
||||
llinfos << "Goodbye!" << llendflush;
|
||||
|
||||
// return 0;
|
||||
|
|
@ -3072,35 +3077,32 @@ void LLAppViewer::initMarkerFile()
|
|||
std::string llerror_marker_file = gDirUtilp->getExpandedFilename(LL_PATH_LOGS, LLERROR_MARKER_FILE_NAME);
|
||||
std::string error_marker_file = gDirUtilp->getExpandedFilename(LL_PATH_LOGS, ERROR_MARKER_FILE_NAME);
|
||||
|
||||
|
||||
if (LLAPRFile::isExist(mMarkerFileName, NULL, LL_APR_RB) && !anotherInstanceRunning())
|
||||
{
|
||||
gLastExecEvent = LAST_EXEC_FROZE;
|
||||
LL_INFOS("MarkerFile") << "Exec marker found: program froze on previous execution" << LL_ENDL;
|
||||
}
|
||||
|
||||
if(LLAPRFile::isExist(logout_marker_file, NULL, LL_APR_RB))
|
||||
{
|
||||
LL_INFOS("MarkerFile") << "Last exec LLError crashed, setting LastExecEvent to " << LAST_EXEC_LLERROR_CRASH << LL_ENDL;
|
||||
gLastExecEvent = LAST_EXEC_LOGOUT_FROZE;
|
||||
LL_INFOS("MarkerFile") << "Last exec LLError crashed, setting LastExecEvent to " << gLastExecEvent << LL_ENDL;
|
||||
LLAPRFile::remove(logout_marker_file);
|
||||
}
|
||||
if(LLAPRFile::isExist(llerror_marker_file, NULL, LL_APR_RB))
|
||||
{
|
||||
llinfos << "Last exec LLError crashed, setting LastExecEvent to " << LAST_EXEC_LLERROR_CRASH << llendl;
|
||||
if(gLastExecEvent == LAST_EXEC_LOGOUT_FROZE) gLastExecEvent = LAST_EXEC_LOGOUT_CRASH;
|
||||
else gLastExecEvent = LAST_EXEC_LLERROR_CRASH;
|
||||
LL_INFOS("MarkerFile") << "Last exec LLError crashed, setting LastExecEvent to " << gLastExecEvent << LL_ENDL;
|
||||
LLAPRFile::remove(llerror_marker_file);
|
||||
}
|
||||
if(LLAPRFile::isExist(error_marker_file, NULL, LL_APR_RB))
|
||||
{
|
||||
LL_INFOS("MarkerFile") << "Last exec crashed, setting LastExecEvent to " << LAST_EXEC_OTHER_CRASH << LL_ENDL;
|
||||
if(gLastExecEvent == LAST_EXEC_LOGOUT_FROZE) gLastExecEvent = LAST_EXEC_LOGOUT_CRASH;
|
||||
else gLastExecEvent = LAST_EXEC_OTHER_CRASH;
|
||||
LL_INFOS("MarkerFile") << "Last exec crashed, setting LastExecEvent to " << gLastExecEvent << LL_ENDL;
|
||||
LLAPRFile::remove(error_marker_file);
|
||||
}
|
||||
|
||||
LLAPRFile::remove(logout_marker_file);
|
||||
LLAPRFile::remove(llerror_marker_file);
|
||||
LLAPRFile::remove(error_marker_file);
|
||||
|
||||
|
||||
// No new markers if another instance is running.
|
||||
if(anotherInstanceRunning())
|
||||
{
|
||||
|
|
@ -4576,6 +4578,10 @@ void LLAppViewer::disconnectViewer()
|
|||
|
||||
cleanup_xfer_manager();
|
||||
gDisconnected = TRUE;
|
||||
|
||||
// Pass the connection state to LLUrlEntryParcel not to attempt
|
||||
// parcel info requests while disconnected.
|
||||
LLUrlEntryParcel::setDisconnected(gDisconnected);
|
||||
}
|
||||
|
||||
void LLAppViewer::forceErrorLLError()
|
||||
|
|
|
|||
|
|
@ -126,6 +126,7 @@ void LLAssetUploadResponder::error(U32 statusNum, const std::string& reason)
|
|||
break;
|
||||
}
|
||||
LLUploadDialog::modalUploadFinished();
|
||||
LLFilePicker::instance().reset(); // unlock file picker when bulk upload fails
|
||||
}
|
||||
|
||||
//virtual
|
||||
|
|
|
|||
|
|
@ -46,7 +46,7 @@ public:
|
|||
/**
|
||||
* Get host to which to send that capability request.
|
||||
*/
|
||||
virtual LLHost getHost() const = 0;
|
||||
virtual const LLHost& getHost() const = 0;
|
||||
/**
|
||||
* Describe this LLCapabilityProvider for logging etc.
|
||||
*/
|
||||
|
|
|
|||
|
|
@ -319,7 +319,7 @@ void LLColorSwatchCtrl::onColorChanged ( void* data, EColorPickOp pick_op )
|
|||
// This is called when the main floatercustomize panel is closed.
|
||||
// Since this class has pointers up to its parents, we need to cleanup
|
||||
// this class first in order to avoid a crash.
|
||||
void LLColorSwatchCtrl::onParentFloaterClosed()
|
||||
void LLColorSwatchCtrl::closeFloaterColorPicker()
|
||||
{
|
||||
LLFloaterColorPicker* pickerp = (LLFloaterColorPicker*)mPickerHandle.get();
|
||||
if (pickerp)
|
||||
|
|
|
|||
|
|
@ -100,7 +100,7 @@ public:
|
|||
/*virtual*/ void setEnabled( BOOL enabled );
|
||||
|
||||
static void onColorChanged ( void* data, EColorPickOp pick_op = COLOR_CHANGE );
|
||||
void onParentFloaterClosed();
|
||||
void closeFloaterColorPicker();
|
||||
|
||||
protected:
|
||||
BOOL mValid;
|
||||
|
|
|
|||
|
|
@ -177,10 +177,6 @@ void LLViewerDynamicTexture::postRender(BOOL success)
|
|||
generateGLTexture() ;
|
||||
}
|
||||
|
||||
if(gGLManager.mDebugGPU)
|
||||
{
|
||||
LLGLState::dumpStates() ;
|
||||
}
|
||||
success = mGLTexturep->setSubImageFromFrameBuffer(0, 0, mOrigin.mX, mOrigin.mY, mFullWidth, mFullHeight);
|
||||
}
|
||||
}
|
||||
|
|
@ -220,12 +216,6 @@ BOOL LLViewerDynamicTexture::updateAllInstances()
|
|||
LLViewerDynamicTexture *dynamicTexture = *iter;
|
||||
if (dynamicTexture->needsRender())
|
||||
{
|
||||
if(gGLManager.mDebugGPU)
|
||||
{
|
||||
llinfos << "class type: " << (S32)dynamicTexture->getType() << llendl;
|
||||
LLGLState::dumpStates() ;
|
||||
}
|
||||
|
||||
glClear(GL_DEPTH_BUFFER_BIT);
|
||||
gDepthDirty = TRUE;
|
||||
|
||||
|
|
|
|||
|
|
@ -1155,7 +1155,7 @@ BOOL LLFace::getGeometryVolume(const LLVolume& volume,
|
|||
if (rebuild_tcoord)
|
||||
{
|
||||
LLVector2 tc = vf.mVertices[i].mTexCoord;
|
||||
|
||||
|
||||
if (texgen != LLTextureEntry::TEX_GEN_DEFAULT)
|
||||
{
|
||||
LLVector3 vec = vf.mVertices[i].mPosition;
|
||||
|
|
@ -1331,7 +1331,14 @@ BOOL LLFace::getGeometryVolume(const LLVolume& volume,
|
|||
mTexExtents[0].setVec(0,0);
|
||||
mTexExtents[1].setVec(1,1);
|
||||
xform(mTexExtents[0], cos_ang, sin_ang, os, ot, ms, mt);
|
||||
xform(mTexExtents[1], cos_ang, sin_ang, os, ot, ms, mt);
|
||||
xform(mTexExtents[1], cos_ang, sin_ang, os, ot, ms, mt);
|
||||
|
||||
F32 es = vf.mTexCoordExtents[1].mV[0] - vf.mTexCoordExtents[0].mV[0] ;
|
||||
F32 et = vf.mTexCoordExtents[1].mV[1] - vf.mTexCoordExtents[0].mV[1] ;
|
||||
mTexExtents[0][0] *= es ;
|
||||
mTexExtents[1][0] *= es ;
|
||||
mTexExtents[0][1] *= et ;
|
||||
mTexExtents[1][1] *= et ;
|
||||
}
|
||||
|
||||
mLastVertexBuffer = mVertexBuffer;
|
||||
|
|
|
|||
|
|
@ -290,11 +290,9 @@ BOOL LLFeatureManager::parseFeatureTable(std::string filename)
|
|||
mTableVersion = version;
|
||||
|
||||
LLFeatureList *flp = NULL;
|
||||
while (!file.eof() && file.good())
|
||||
while (file >> name)
|
||||
{
|
||||
char buffer[MAX_STRING]; /*Flawfinder: ignore*/
|
||||
|
||||
file >> name;
|
||||
|
||||
if (name.substr(0,2) == "//")
|
||||
{
|
||||
|
|
@ -303,13 +301,6 @@ BOOL LLFeatureManager::parseFeatureTable(std::string filename)
|
|||
continue;
|
||||
}
|
||||
|
||||
if (name.empty())
|
||||
{
|
||||
// This is a blank line
|
||||
file.getline(buffer, MAX_STRING);
|
||||
continue;
|
||||
}
|
||||
|
||||
if (name == "list")
|
||||
{
|
||||
if (flp)
|
||||
|
|
|
|||
|
|
@ -83,7 +83,8 @@ LLFloaterMap::~LLFloaterMap()
|
|||
BOOL LLFloaterMap::postBuild()
|
||||
{
|
||||
mMap = getChild<LLNetMap>("Net Map");
|
||||
mMap->setToolTipMsg(getString("ToolTipMsg"));
|
||||
mMap->setToolTipMsg(gSavedSettings.getBOOL("DoubleClickTeleport") ?
|
||||
getString("AltToolTipMsg") : getString("ToolTipMsg"));
|
||||
sendChildToBack(mMap);
|
||||
|
||||
mTextBoxNorth = getChild<LLTextBox> ("floater_map_north");
|
||||
|
|
|
|||
|
|
@ -178,7 +178,7 @@ void LLFloaterSettingsDebug::onClickDefault()
|
|||
|
||||
if (controlp)
|
||||
{
|
||||
controlp->resetToDefault();
|
||||
controlp->resetToDefault(true);
|
||||
updateControl(controlp);
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,402 +1,402 @@
|
|||
/**
|
||||
* @file llfloaterwebcontent.cpp
|
||||
* @brief floater for displaying web content - e.g. profiles and search (eventually)
|
||||
*
|
||||
* $LicenseInfo:firstyear=2006&license=viewerlgpl$
|
||||
* Second Life Viewer Source Code
|
||||
* Copyright (C) 2010, Linden Research, Inc.
|
||||
*
|
||||
* This library is free software; you can redistribute it and/or
|
||||
* modify it under the terms of the GNU Lesser General Public
|
||||
* License as published by the Free Software Foundation;
|
||||
* version 2.1 of the License only.
|
||||
*
|
||||
* This library is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
* Lesser General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU Lesser General Public
|
||||
* License along with this library; if not, write to the Free Software
|
||||
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
|
||||
*
|
||||
* Linden Research, Inc., 945 Battery Street, San Francisco, CA 94111 USA
|
||||
* $/LicenseInfo$
|
||||
*/
|
||||
|
||||
#include "llviewerprecompiledheaders.h"
|
||||
|
||||
#include "llcombobox.h"
|
||||
#include "lliconctrl.h"
|
||||
#include "llfloaterreg.h"
|
||||
#include "lllayoutstack.h"
|
||||
#include "llpluginclassmedia.h"
|
||||
#include "llprogressbar.h"
|
||||
#include "lltextbox.h"
|
||||
#include "llurlhistory.h"
|
||||
#include "llviewercontrol.h"
|
||||
#include "llweb.h"
|
||||
#include "llwindow.h"
|
||||
|
||||
#include "llfloaterwebcontent.h"
|
||||
|
||||
LLFloaterWebContent::LLFloaterWebContent( const LLSD& key )
|
||||
: LLFloater( key )
|
||||
{
|
||||
mCommitCallbackRegistrar.add( "WebContent.Back", boost::bind( &LLFloaterWebContent::onClickBack, this ));
|
||||
mCommitCallbackRegistrar.add( "WebContent.Forward", boost::bind( &LLFloaterWebContent::onClickForward, this ));
|
||||
mCommitCallbackRegistrar.add( "WebContent.Reload", boost::bind( &LLFloaterWebContent::onClickReload, this ));
|
||||
mCommitCallbackRegistrar.add( "WebContent.Stop", boost::bind( &LLFloaterWebContent::onClickStop, this ));
|
||||
mCommitCallbackRegistrar.add( "WebContent.EnterAddress", boost::bind( &LLFloaterWebContent::onEnterAddress, this ));
|
||||
mCommitCallbackRegistrar.add( "WebContent.PopExternal", boost::bind( &LLFloaterWebContent::onPopExternal, this ));
|
||||
}
|
||||
|
||||
BOOL LLFloaterWebContent::postBuild()
|
||||
{
|
||||
// these are used in a bunch of places so cache them
|
||||
mWebBrowser = getChild< LLMediaCtrl >( "webbrowser" );
|
||||
mAddressCombo = getChild< LLComboBox >( "address" );
|
||||
mStatusBarText = getChild< LLTextBox >( "statusbartext" );
|
||||
mStatusBarProgress = getChild<LLProgressBar>("statusbarprogress" );
|
||||
|
||||
// observe browser events
|
||||
mWebBrowser->addObserver( this );
|
||||
|
||||
// these buttons are always enabled
|
||||
getChildView("reload")->setEnabled( true );
|
||||
getChildView("popexternal")->setEnabled( true );
|
||||
|
||||
// cache image for secure browsing
|
||||
mSecureLockIcon = getChild< LLIconCtrl >("media_secure_lock_flag");
|
||||
|
||||
// initialize the URL history using the system URL History manager
|
||||
initializeURLHistory();
|
||||
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
void LLFloaterWebContent::initializeURLHistory()
|
||||
{
|
||||
// start with an empty list
|
||||
LLCtrlListInterface* url_list = childGetListInterface("address");
|
||||
if (url_list)
|
||||
{
|
||||
url_list->operateOnAll(LLCtrlListInterface::OP_DELETE);
|
||||
}
|
||||
|
||||
// Get all of the entries in the "browser" collection
|
||||
LLSD browser_history = LLURLHistory::getURLHistory("browser");
|
||||
LLSD::array_iterator iter_history =
|
||||
browser_history.beginArray();
|
||||
LLSD::array_iterator end_history =
|
||||
browser_history.endArray();
|
||||
for(; iter_history != end_history; ++iter_history)
|
||||
{
|
||||
std::string url = (*iter_history).asString();
|
||||
if(! url.empty())
|
||||
url_list->addSimpleElement(url);
|
||||
}
|
||||
}
|
||||
|
||||
//static
|
||||
void LLFloaterWebContent::create( const std::string &url, const std::string& target, const std::string& uuid )
|
||||
{
|
||||
lldebugs << "url = " << url << ", target = " << target << ", uuid = " << uuid << llendl;
|
||||
|
||||
std::string tag = target;
|
||||
|
||||
if(target.empty() || target == "_blank")
|
||||
{
|
||||
if(!uuid.empty())
|
||||
{
|
||||
tag = uuid;
|
||||
}
|
||||
else
|
||||
{
|
||||
// create a unique tag for this instance
|
||||
LLUUID id;
|
||||
id.generate();
|
||||
tag = id.asString();
|
||||
}
|
||||
}
|
||||
|
||||
S32 browser_window_limit = gSavedSettings.getS32("WebContentWindowLimit");
|
||||
|
||||
if(LLFloaterReg::findInstance("web_content", tag) != NULL)
|
||||
{
|
||||
// There's already a web browser for this tag, so we won't be opening a new window.
|
||||
}
|
||||
else if(browser_window_limit != 0)
|
||||
{
|
||||
// showInstance will open a new window. Figure out how many web browsers are already open,
|
||||
// and close the least recently opened one if this will put us over the limit.
|
||||
|
||||
LLFloaterReg::const_instance_list_t &instances = LLFloaterReg::getFloaterList("web_content");
|
||||
lldebugs << "total instance count is " << instances.size() << llendl;
|
||||
|
||||
for(LLFloaterReg::const_instance_list_t::const_iterator iter = instances.begin(); iter != instances.end(); iter++)
|
||||
{
|
||||
lldebugs << " " << (*iter)->getKey() << llendl;
|
||||
}
|
||||
|
||||
if(instances.size() >= (size_t)browser_window_limit)
|
||||
{
|
||||
// Destroy the least recently opened instance
|
||||
(*instances.begin())->closeFloater();
|
||||
}
|
||||
}
|
||||
|
||||
LLFloaterWebContent *browser = dynamic_cast<LLFloaterWebContent*> (LLFloaterReg::showInstance("web_content", tag));
|
||||
llassert(browser);
|
||||
if(browser)
|
||||
{
|
||||
browser->mUUID = uuid;
|
||||
|
||||
// tell the browser instance to load the specified URL
|
||||
browser->open_media(url, target);
|
||||
LLViewerMedia::proxyWindowOpened(target, uuid);
|
||||
}
|
||||
}
|
||||
|
||||
//static
|
||||
void LLFloaterWebContent::closeRequest(const std::string &uuid)
|
||||
{
|
||||
LLFloaterReg::const_instance_list_t& inst_list = LLFloaterReg::getFloaterList("web_content");
|
||||
lldebugs << "instance list size is " << inst_list.size() << ", incoming uuid is " << uuid << llendl;
|
||||
for (LLFloaterReg::const_instance_list_t::const_iterator iter = inst_list.begin(); iter != inst_list.end(); ++iter)
|
||||
{
|
||||
LLFloaterWebContent* i = dynamic_cast<LLFloaterWebContent*>(*iter);
|
||||
lldebugs << " " << i->mUUID << llendl;
|
||||
if (i && i->mUUID == uuid)
|
||||
{
|
||||
i->closeFloater(false);
|
||||
return;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
//static
|
||||
void LLFloaterWebContent::geometryChanged(const std::string &uuid, S32 x, S32 y, S32 width, S32 height)
|
||||
{
|
||||
LLFloaterReg::const_instance_list_t& inst_list = LLFloaterReg::getFloaterList("web_content");
|
||||
lldebugs << "instance list size is " << inst_list.size() << ", incoming uuid is " << uuid << llendl;
|
||||
for (LLFloaterReg::const_instance_list_t::const_iterator iter = inst_list.begin(); iter != inst_list.end(); ++iter)
|
||||
{
|
||||
LLFloaterWebContent* i = dynamic_cast<LLFloaterWebContent*>(*iter);
|
||||
lldebugs << " " << i->mUUID << llendl;
|
||||
if (i && i->mUUID == uuid)
|
||||
{
|
||||
i->geometryChanged(x, y, width, height);
|
||||
return;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void LLFloaterWebContent::geometryChanged(S32 x, S32 y, S32 width, S32 height)
|
||||
{
|
||||
// Make sure the layout of the browser control is updated, so this calculation is correct.
|
||||
LLLayoutStack::updateClass();
|
||||
|
||||
// TODO: need to adjust size and constrain position to make sure floaters aren't moved outside the window view, etc.
|
||||
LLCoordWindow window_size;
|
||||
getWindow()->getSize(&window_size);
|
||||
|
||||
// Adjust width and height for the size of the chrome on the web Browser window.
|
||||
width += getRect().getWidth() - mWebBrowser->getRect().getWidth();
|
||||
height += getRect().getHeight() - mWebBrowser->getRect().getHeight();
|
||||
|
||||
LLRect geom;
|
||||
geom.setOriginAndSize(x, window_size.mY - (y + height), width, height);
|
||||
|
||||
lldebugs << "geometry change: " << geom << llendl;
|
||||
|
||||
handleReshape(geom,false);
|
||||
}
|
||||
|
||||
void LLFloaterWebContent::open_media(const std::string& web_url, const std::string& target)
|
||||
{
|
||||
// Specifying a mime type of text/html here causes the plugin system to skip the MIME type probe and just open a browser plugin.
|
||||
mWebBrowser->setHomePageUrl(web_url, "text/html");
|
||||
mWebBrowser->setTarget(target);
|
||||
mWebBrowser->navigateTo(web_url, "text/html");
|
||||
set_current_url(web_url);
|
||||
}
|
||||
|
||||
//virtual
|
||||
void LLFloaterWebContent::onClose(bool app_quitting)
|
||||
{
|
||||
LLViewerMedia::proxyWindowClosed(mUUID);
|
||||
destroy();
|
||||
}
|
||||
|
||||
// virtual
|
||||
void LLFloaterWebContent::draw()
|
||||
{
|
||||
// this is asychronous so we need to keep checking
|
||||
getChildView( "back" )->setEnabled( mWebBrowser->canNavigateBack() );
|
||||
getChildView( "forward" )->setEnabled( mWebBrowser->canNavigateForward() );
|
||||
|
||||
LLFloater::draw();
|
||||
}
|
||||
|
||||
// virtual
|
||||
void LLFloaterWebContent::handleMediaEvent(LLPluginClassMedia* self, EMediaEvent event)
|
||||
{
|
||||
if(event == MEDIA_EVENT_LOCATION_CHANGED)
|
||||
{
|
||||
const std::string url = self->getLocation();
|
||||
|
||||
if ( url.length() )
|
||||
mStatusBarText->setText( url );
|
||||
|
||||
set_current_url( url );
|
||||
}
|
||||
else if(event == MEDIA_EVENT_NAVIGATE_BEGIN)
|
||||
{
|
||||
// flags are sent with this event
|
||||
getChildView("back")->setEnabled( self->getHistoryBackAvailable() );
|
||||
getChildView("forward")->setEnabled( self->getHistoryForwardAvailable() );
|
||||
|
||||
// toggle visibility of these buttons based on browser state
|
||||
getChildView("reload")->setVisible( false );
|
||||
getChildView("stop")->setVisible( true );
|
||||
|
||||
// turn "on" progress bar now we're about to start loading
|
||||
mStatusBarProgress->setVisible( true );
|
||||
}
|
||||
else if(event == MEDIA_EVENT_NAVIGATE_COMPLETE)
|
||||
{
|
||||
// flags are sent with this event
|
||||
getChildView("back")->setEnabled( self->getHistoryBackAvailable() );
|
||||
getChildView("forward")->setEnabled( self->getHistoryForwardAvailable() );
|
||||
|
||||
// toggle visibility of these buttons based on browser state
|
||||
getChildView("reload")->setVisible( true );
|
||||
getChildView("stop")->setVisible( false );
|
||||
|
||||
// turn "off" progress bar now we're loaded
|
||||
mStatusBarProgress->setVisible( false );
|
||||
|
||||
// we populate the status bar with URLs as they change so clear it now we're done
|
||||
const std::string end_str = "";
|
||||
mStatusBarText->setText( end_str );
|
||||
|
||||
// decide if secure browsing icon should be displayed
|
||||
std::string prefix = std::string("https://");
|
||||
std::string test_prefix = mCurrentURL.substr(0, prefix.length());
|
||||
LLStringUtil::toLower(test_prefix);
|
||||
if(test_prefix == prefix)
|
||||
{
|
||||
mSecureLockIcon->setVisible(true);
|
||||
}
|
||||
else
|
||||
{
|
||||
mSecureLockIcon->setVisible(false);
|
||||
}
|
||||
}
|
||||
else if(event == MEDIA_EVENT_CLOSE_REQUEST)
|
||||
{
|
||||
// The browser instance wants its window closed.
|
||||
closeFloater();
|
||||
}
|
||||
else if(event == MEDIA_EVENT_GEOMETRY_CHANGE)
|
||||
{
|
||||
geometryChanged(self->getGeometryX(), self->getGeometryY(), self->getGeometryWidth(), self->getGeometryHeight());
|
||||
}
|
||||
else if(event == MEDIA_EVENT_STATUS_TEXT_CHANGED )
|
||||
{
|
||||
const std::string text = self->getStatusText();
|
||||
if ( text.length() )
|
||||
mStatusBarText->setText( text );
|
||||
}
|
||||
else if(event == MEDIA_EVENT_PROGRESS_UPDATED )
|
||||
{
|
||||
int percent = (int)self->getProgressPercent();
|
||||
mStatusBarProgress->setValue( percent );
|
||||
}
|
||||
else if(event == MEDIA_EVENT_NAME_CHANGED )
|
||||
{
|
||||
std::string page_title = self->getMediaName();
|
||||
// simulate browser behavior - title is empty, use the current URL
|
||||
if ( page_title.length() > 0 )
|
||||
setTitle( page_title );
|
||||
else
|
||||
setTitle( mCurrentURL );
|
||||
}
|
||||
else if(event == MEDIA_EVENT_LINK_HOVERED )
|
||||
{
|
||||
const std::string link = self->getHoverLink();
|
||||
mStatusBarText->setText( link );
|
||||
}
|
||||
}
|
||||
|
||||
void LLFloaterWebContent::set_current_url(const std::string& url)
|
||||
{
|
||||
mCurrentURL = url;
|
||||
|
||||
// serialize url history into the system URL History manager
|
||||
LLURLHistory::removeURL("browser", mCurrentURL);
|
||||
LLURLHistory::addURL("browser", mCurrentURL);
|
||||
|
||||
mAddressCombo->remove( mCurrentURL );
|
||||
mAddressCombo->add( mCurrentURL );
|
||||
mAddressCombo->selectByValue( mCurrentURL );
|
||||
}
|
||||
|
||||
void LLFloaterWebContent::onClickForward()
|
||||
{
|
||||
mWebBrowser->navigateForward();
|
||||
}
|
||||
|
||||
void LLFloaterWebContent::onClickBack()
|
||||
{
|
||||
mWebBrowser->navigateBack();
|
||||
}
|
||||
|
||||
void LLFloaterWebContent::onClickReload()
|
||||
{
|
||||
|
||||
if( mWebBrowser->getMediaPlugin() )
|
||||
{
|
||||
bool ignore_cache = true;
|
||||
mWebBrowser->getMediaPlugin()->browse_reload( ignore_cache );
|
||||
}
|
||||
else
|
||||
{
|
||||
mWebBrowser->navigateTo(mCurrentURL);
|
||||
}
|
||||
}
|
||||
|
||||
void LLFloaterWebContent::onClickStop()
|
||||
{
|
||||
if( mWebBrowser->getMediaPlugin() )
|
||||
mWebBrowser->getMediaPlugin()->browse_stop();
|
||||
|
||||
// still should happen when we catch the navigate complete event
|
||||
// but sometimes (don't know why) that event isn't sent from Qt
|
||||
// and we getto a point where the stop button stays active.
|
||||
getChildView("reload")->setVisible( true );
|
||||
getChildView("stop")->setVisible( false );
|
||||
}
|
||||
|
||||
void LLFloaterWebContent::onEnterAddress()
|
||||
{
|
||||
// make sure there is at least something there.
|
||||
// (perhaps this test should be for minimum length of a URL)
|
||||
std::string url = mAddressCombo->getValue().asString();
|
||||
if ( url.length() > 0 )
|
||||
{
|
||||
mWebBrowser->navigateTo( url, "text/html");
|
||||
};
|
||||
}
|
||||
|
||||
void LLFloaterWebContent::onPopExternal()
|
||||
{
|
||||
// make sure there is at least something there.
|
||||
// (perhaps this test should be for minimum length of a URL)
|
||||
std::string url = mAddressCombo->getValue().asString();
|
||||
if ( url.length() > 0 )
|
||||
{
|
||||
LLWeb::loadURLExternal( url );
|
||||
};
|
||||
}
|
||||
/**
|
||||
* @file llfloaterwebcontent.cpp
|
||||
* @brief floater for displaying web content - e.g. profiles and search (eventually)
|
||||
*
|
||||
* $LicenseInfo:firstyear=2006&license=viewerlgpl$
|
||||
* Second Life Viewer Source Code
|
||||
* Copyright (C) 2010, Linden Research, Inc.
|
||||
*
|
||||
* This library is free software; you can redistribute it and/or
|
||||
* modify it under the terms of the GNU Lesser General Public
|
||||
* License as published by the Free Software Foundation;
|
||||
* version 2.1 of the License only.
|
||||
*
|
||||
* This library is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
* Lesser General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU Lesser General Public
|
||||
* License along with this library; if not, write to the Free Software
|
||||
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
|
||||
*
|
||||
* Linden Research, Inc., 945 Battery Street, San Francisco, CA 94111 USA
|
||||
* $/LicenseInfo$
|
||||
*/
|
||||
|
||||
#include "llviewerprecompiledheaders.h"
|
||||
|
||||
#include "llcombobox.h"
|
||||
#include "lliconctrl.h"
|
||||
#include "llfloaterreg.h"
|
||||
#include "lllayoutstack.h"
|
||||
#include "llpluginclassmedia.h"
|
||||
#include "llprogressbar.h"
|
||||
#include "lltextbox.h"
|
||||
#include "llurlhistory.h"
|
||||
#include "llviewercontrol.h"
|
||||
#include "llweb.h"
|
||||
#include "llwindow.h"
|
||||
|
||||
#include "llfloaterwebcontent.h"
|
||||
|
||||
LLFloaterWebContent::LLFloaterWebContent( const LLSD& key )
|
||||
: LLFloater( key )
|
||||
{
|
||||
mCommitCallbackRegistrar.add( "WebContent.Back", boost::bind( &LLFloaterWebContent::onClickBack, this ));
|
||||
mCommitCallbackRegistrar.add( "WebContent.Forward", boost::bind( &LLFloaterWebContent::onClickForward, this ));
|
||||
mCommitCallbackRegistrar.add( "WebContent.Reload", boost::bind( &LLFloaterWebContent::onClickReload, this ));
|
||||
mCommitCallbackRegistrar.add( "WebContent.Stop", boost::bind( &LLFloaterWebContent::onClickStop, this ));
|
||||
mCommitCallbackRegistrar.add( "WebContent.EnterAddress", boost::bind( &LLFloaterWebContent::onEnterAddress, this ));
|
||||
mCommitCallbackRegistrar.add( "WebContent.PopExternal", boost::bind( &LLFloaterWebContent::onPopExternal, this ));
|
||||
}
|
||||
|
||||
BOOL LLFloaterWebContent::postBuild()
|
||||
{
|
||||
// these are used in a bunch of places so cache them
|
||||
mWebBrowser = getChild< LLMediaCtrl >( "webbrowser" );
|
||||
mAddressCombo = getChild< LLComboBox >( "address" );
|
||||
mStatusBarText = getChild< LLTextBox >( "statusbartext" );
|
||||
mStatusBarProgress = getChild<LLProgressBar>("statusbarprogress" );
|
||||
|
||||
// observe browser events
|
||||
mWebBrowser->addObserver( this );
|
||||
|
||||
// these buttons are always enabled
|
||||
getChildView("reload")->setEnabled( true );
|
||||
getChildView("popexternal")->setEnabled( true );
|
||||
|
||||
// cache image for secure browsing
|
||||
mSecureLockIcon = getChild< LLIconCtrl >("media_secure_lock_flag");
|
||||
|
||||
// initialize the URL history using the system URL History manager
|
||||
initializeURLHistory();
|
||||
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
void LLFloaterWebContent::initializeURLHistory()
|
||||
{
|
||||
// start with an empty list
|
||||
LLCtrlListInterface* url_list = childGetListInterface("address");
|
||||
if (url_list)
|
||||
{
|
||||
url_list->operateOnAll(LLCtrlListInterface::OP_DELETE);
|
||||
}
|
||||
|
||||
// Get all of the entries in the "browser" collection
|
||||
LLSD browser_history = LLURLHistory::getURLHistory("browser");
|
||||
LLSD::array_iterator iter_history =
|
||||
browser_history.beginArray();
|
||||
LLSD::array_iterator end_history =
|
||||
browser_history.endArray();
|
||||
for(; iter_history != end_history; ++iter_history)
|
||||
{
|
||||
std::string url = (*iter_history).asString();
|
||||
if(! url.empty())
|
||||
url_list->addSimpleElement(url);
|
||||
}
|
||||
}
|
||||
|
||||
//static
|
||||
void LLFloaterWebContent::create( const std::string &url, const std::string& target, const std::string& uuid )
|
||||
{
|
||||
lldebugs << "url = " << url << ", target = " << target << ", uuid = " << uuid << llendl;
|
||||
|
||||
std::string tag = target;
|
||||
|
||||
if(target.empty() || target == "_blank")
|
||||
{
|
||||
if(!uuid.empty())
|
||||
{
|
||||
tag = uuid;
|
||||
}
|
||||
else
|
||||
{
|
||||
// create a unique tag for this instance
|
||||
LLUUID id;
|
||||
id.generate();
|
||||
tag = id.asString();
|
||||
}
|
||||
}
|
||||
|
||||
S32 browser_window_limit = gSavedSettings.getS32("WebContentWindowLimit");
|
||||
|
||||
if(LLFloaterReg::findInstance("web_content", tag) != NULL)
|
||||
{
|
||||
// There's already a web browser for this tag, so we won't be opening a new window.
|
||||
}
|
||||
else if(browser_window_limit != 0)
|
||||
{
|
||||
// showInstance will open a new window. Figure out how many web browsers are already open,
|
||||
// and close the least recently opened one if this will put us over the limit.
|
||||
|
||||
LLFloaterReg::const_instance_list_t &instances = LLFloaterReg::getFloaterList("web_content");
|
||||
lldebugs << "total instance count is " << instances.size() << llendl;
|
||||
|
||||
for(LLFloaterReg::const_instance_list_t::const_iterator iter = instances.begin(); iter != instances.end(); iter++)
|
||||
{
|
||||
lldebugs << " " << (*iter)->getKey() << llendl;
|
||||
}
|
||||
|
||||
if(instances.size() >= (size_t)browser_window_limit)
|
||||
{
|
||||
// Destroy the least recently opened instance
|
||||
(*instances.begin())->closeFloater();
|
||||
}
|
||||
}
|
||||
|
||||
LLFloaterWebContent *browser = dynamic_cast<LLFloaterWebContent*> (LLFloaterReg::showInstance("web_content", tag));
|
||||
llassert(browser);
|
||||
if(browser)
|
||||
{
|
||||
browser->mUUID = uuid;
|
||||
|
||||
// tell the browser instance to load the specified URL
|
||||
browser->open_media(url, target);
|
||||
LLViewerMedia::proxyWindowOpened(target, uuid);
|
||||
}
|
||||
}
|
||||
|
||||
//static
|
||||
void LLFloaterWebContent::closeRequest(const std::string &uuid)
|
||||
{
|
||||
LLFloaterReg::const_instance_list_t& inst_list = LLFloaterReg::getFloaterList("web_content");
|
||||
lldebugs << "instance list size is " << inst_list.size() << ", incoming uuid is " << uuid << llendl;
|
||||
for (LLFloaterReg::const_instance_list_t::const_iterator iter = inst_list.begin(); iter != inst_list.end(); ++iter)
|
||||
{
|
||||
LLFloaterWebContent* i = dynamic_cast<LLFloaterWebContent*>(*iter);
|
||||
lldebugs << " " << i->mUUID << llendl;
|
||||
if (i && i->mUUID == uuid)
|
||||
{
|
||||
i->closeFloater(false);
|
||||
return;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
//static
|
||||
void LLFloaterWebContent::geometryChanged(const std::string &uuid, S32 x, S32 y, S32 width, S32 height)
|
||||
{
|
||||
LLFloaterReg::const_instance_list_t& inst_list = LLFloaterReg::getFloaterList("web_content");
|
||||
lldebugs << "instance list size is " << inst_list.size() << ", incoming uuid is " << uuid << llendl;
|
||||
for (LLFloaterReg::const_instance_list_t::const_iterator iter = inst_list.begin(); iter != inst_list.end(); ++iter)
|
||||
{
|
||||
LLFloaterWebContent* i = dynamic_cast<LLFloaterWebContent*>(*iter);
|
||||
lldebugs << " " << i->mUUID << llendl;
|
||||
if (i && i->mUUID == uuid)
|
||||
{
|
||||
i->geometryChanged(x, y, width, height);
|
||||
return;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void LLFloaterWebContent::geometryChanged(S32 x, S32 y, S32 width, S32 height)
|
||||
{
|
||||
// Make sure the layout of the browser control is updated, so this calculation is correct.
|
||||
LLLayoutStack::updateClass();
|
||||
|
||||
// TODO: need to adjust size and constrain position to make sure floaters aren't moved outside the window view, etc.
|
||||
LLCoordWindow window_size;
|
||||
getWindow()->getSize(&window_size);
|
||||
|
||||
// Adjust width and height for the size of the chrome on the web Browser window.
|
||||
width += getRect().getWidth() - mWebBrowser->getRect().getWidth();
|
||||
height += getRect().getHeight() - mWebBrowser->getRect().getHeight();
|
||||
|
||||
LLRect geom;
|
||||
geom.setOriginAndSize(x, window_size.mY - (y + height), width, height);
|
||||
|
||||
lldebugs << "geometry change: " << geom << llendl;
|
||||
|
||||
handleReshape(geom,false);
|
||||
}
|
||||
|
||||
void LLFloaterWebContent::open_media(const std::string& web_url, const std::string& target)
|
||||
{
|
||||
// Specifying a mime type of text/html here causes the plugin system to skip the MIME type probe and just open a browser plugin.
|
||||
mWebBrowser->setHomePageUrl(web_url, "text/html");
|
||||
mWebBrowser->setTarget(target);
|
||||
mWebBrowser->navigateTo(web_url, "text/html");
|
||||
set_current_url(web_url);
|
||||
}
|
||||
|
||||
//virtual
|
||||
void LLFloaterWebContent::onClose(bool app_quitting)
|
||||
{
|
||||
LLViewerMedia::proxyWindowClosed(mUUID);
|
||||
destroy();
|
||||
}
|
||||
|
||||
// virtual
|
||||
void LLFloaterWebContent::draw()
|
||||
{
|
||||
// this is asychronous so we need to keep checking
|
||||
getChildView( "back" )->setEnabled( mWebBrowser->canNavigateBack() );
|
||||
getChildView( "forward" )->setEnabled( mWebBrowser->canNavigateForward() );
|
||||
|
||||
LLFloater::draw();
|
||||
}
|
||||
|
||||
// virtual
|
||||
void LLFloaterWebContent::handleMediaEvent(LLPluginClassMedia* self, EMediaEvent event)
|
||||
{
|
||||
if(event == MEDIA_EVENT_LOCATION_CHANGED)
|
||||
{
|
||||
const std::string url = self->getLocation();
|
||||
|
||||
if ( url.length() )
|
||||
mStatusBarText->setText( url );
|
||||
|
||||
set_current_url( url );
|
||||
}
|
||||
else if(event == MEDIA_EVENT_NAVIGATE_BEGIN)
|
||||
{
|
||||
// flags are sent with this event
|
||||
getChildView("back")->setEnabled( self->getHistoryBackAvailable() );
|
||||
getChildView("forward")->setEnabled( self->getHistoryForwardAvailable() );
|
||||
|
||||
// toggle visibility of these buttons based on browser state
|
||||
getChildView("reload")->setVisible( false );
|
||||
getChildView("stop")->setVisible( true );
|
||||
|
||||
// turn "on" progress bar now we're about to start loading
|
||||
mStatusBarProgress->setVisible( true );
|
||||
}
|
||||
else if(event == MEDIA_EVENT_NAVIGATE_COMPLETE)
|
||||
{
|
||||
// flags are sent with this event
|
||||
getChildView("back")->setEnabled( self->getHistoryBackAvailable() );
|
||||
getChildView("forward")->setEnabled( self->getHistoryForwardAvailable() );
|
||||
|
||||
// toggle visibility of these buttons based on browser state
|
||||
getChildView("reload")->setVisible( true );
|
||||
getChildView("stop")->setVisible( false );
|
||||
|
||||
// turn "off" progress bar now we're loaded
|
||||
mStatusBarProgress->setVisible( false );
|
||||
|
||||
// we populate the status bar with URLs as they change so clear it now we're done
|
||||
const std::string end_str = "";
|
||||
mStatusBarText->setText( end_str );
|
||||
|
||||
// decide if secure browsing icon should be displayed
|
||||
std::string prefix = std::string("https://");
|
||||
std::string test_prefix = mCurrentURL.substr(0, prefix.length());
|
||||
LLStringUtil::toLower(test_prefix);
|
||||
if(test_prefix == prefix)
|
||||
{
|
||||
mSecureLockIcon->setVisible(true);
|
||||
}
|
||||
else
|
||||
{
|
||||
mSecureLockIcon->setVisible(false);
|
||||
}
|
||||
}
|
||||
else if(event == MEDIA_EVENT_CLOSE_REQUEST)
|
||||
{
|
||||
// The browser instance wants its window closed.
|
||||
closeFloater();
|
||||
}
|
||||
else if(event == MEDIA_EVENT_GEOMETRY_CHANGE)
|
||||
{
|
||||
geometryChanged(self->getGeometryX(), self->getGeometryY(), self->getGeometryWidth(), self->getGeometryHeight());
|
||||
}
|
||||
else if(event == MEDIA_EVENT_STATUS_TEXT_CHANGED )
|
||||
{
|
||||
const std::string text = self->getStatusText();
|
||||
if ( text.length() )
|
||||
mStatusBarText->setText( text );
|
||||
}
|
||||
else if(event == MEDIA_EVENT_PROGRESS_UPDATED )
|
||||
{
|
||||
int percent = (int)self->getProgressPercent();
|
||||
mStatusBarProgress->setValue( percent );
|
||||
}
|
||||
else if(event == MEDIA_EVENT_NAME_CHANGED )
|
||||
{
|
||||
std::string page_title = self->getMediaName();
|
||||
// simulate browser behavior - title is empty, use the current URL
|
||||
if ( page_title.length() > 0 )
|
||||
setTitle( page_title );
|
||||
else
|
||||
setTitle( mCurrentURL );
|
||||
}
|
||||
else if(event == MEDIA_EVENT_LINK_HOVERED )
|
||||
{
|
||||
const std::string link = self->getHoverLink();
|
||||
mStatusBarText->setText( link );
|
||||
}
|
||||
}
|
||||
|
||||
void LLFloaterWebContent::set_current_url(const std::string& url)
|
||||
{
|
||||
mCurrentURL = url;
|
||||
|
||||
// serialize url history into the system URL History manager
|
||||
LLURLHistory::removeURL("browser", mCurrentURL);
|
||||
LLURLHistory::addURL("browser", mCurrentURL);
|
||||
|
||||
mAddressCombo->remove( mCurrentURL );
|
||||
mAddressCombo->add( mCurrentURL );
|
||||
mAddressCombo->selectByValue( mCurrentURL );
|
||||
}
|
||||
|
||||
void LLFloaterWebContent::onClickForward()
|
||||
{
|
||||
mWebBrowser->navigateForward();
|
||||
}
|
||||
|
||||
void LLFloaterWebContent::onClickBack()
|
||||
{
|
||||
mWebBrowser->navigateBack();
|
||||
}
|
||||
|
||||
void LLFloaterWebContent::onClickReload()
|
||||
{
|
||||
|
||||
if( mWebBrowser->getMediaPlugin() )
|
||||
{
|
||||
bool ignore_cache = true;
|
||||
mWebBrowser->getMediaPlugin()->browse_reload( ignore_cache );
|
||||
}
|
||||
else
|
||||
{
|
||||
mWebBrowser->navigateTo(mCurrentURL);
|
||||
}
|
||||
}
|
||||
|
||||
void LLFloaterWebContent::onClickStop()
|
||||
{
|
||||
if( mWebBrowser->getMediaPlugin() )
|
||||
mWebBrowser->getMediaPlugin()->browse_stop();
|
||||
|
||||
// still should happen when we catch the navigate complete event
|
||||
// but sometimes (don't know why) that event isn't sent from Qt
|
||||
// and we getto a point where the stop button stays active.
|
||||
getChildView("reload")->setVisible( true );
|
||||
getChildView("stop")->setVisible( false );
|
||||
}
|
||||
|
||||
void LLFloaterWebContent::onEnterAddress()
|
||||
{
|
||||
// make sure there is at least something there.
|
||||
// (perhaps this test should be for minimum length of a URL)
|
||||
std::string url = mAddressCombo->getValue().asString();
|
||||
if ( url.length() > 0 )
|
||||
{
|
||||
mWebBrowser->navigateTo( url, "text/html");
|
||||
};
|
||||
}
|
||||
|
||||
void LLFloaterWebContent::onPopExternal()
|
||||
{
|
||||
// make sure there is at least something there.
|
||||
// (perhaps this test should be for minimum length of a URL)
|
||||
std::string url = mAddressCombo->getValue().asString();
|
||||
if ( url.length() > 0 )
|
||||
{
|
||||
LLWeb::loadURLExternal( url );
|
||||
};
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,82 +1,82 @@
|
|||
/**
|
||||
* @file llfloaterwebcontent.h
|
||||
* @brief floater for displaying web content - e.g. profiles and search (eventually)
|
||||
*
|
||||
* $LicenseInfo:firstyear=2006&license=viewerlgpl$
|
||||
* Second Life Viewer Source Code
|
||||
* Copyright (C) 2010, Linden Research, Inc.
|
||||
*
|
||||
* This library is free software; you can redistribute it and/or
|
||||
* modify it under the terms of the GNU Lesser General Public
|
||||
* License as published by the Free Software Foundation;
|
||||
* version 2.1 of the License only.
|
||||
*
|
||||
* This library is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
* Lesser General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU Lesser General Public
|
||||
* License along with this library; if not, write to the Free Software
|
||||
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
|
||||
*
|
||||
* Linden Research, Inc., 945 Battery Street, San Francisco, CA 94111 USA
|
||||
* $/LicenseInfo$
|
||||
*/
|
||||
|
||||
#ifndef LL_LLFLOATERWEBCONTENT_H
|
||||
#define LL_LLFLOATERWEBCONTENT_H
|
||||
|
||||
#include "llfloater.h"
|
||||
#include "llmediactrl.h"
|
||||
|
||||
class LLMediaCtrl;
|
||||
class LLComboBox;
|
||||
class LLTextBox;
|
||||
class LLProgressBar;
|
||||
class LLIconCtrl;
|
||||
|
||||
class LLFloaterWebContent :
|
||||
public LLFloater,
|
||||
public LLViewerMediaObserver
|
||||
{
|
||||
public:
|
||||
LOG_CLASS(LLFloaterWebContent);
|
||||
LLFloaterWebContent(const LLSD& key);
|
||||
|
||||
/**
|
||||
* @file llfloaterwebcontent.h
|
||||
* @brief floater for displaying web content - e.g. profiles and search (eventually)
|
||||
*
|
||||
* $LicenseInfo:firstyear=2006&license=viewerlgpl$
|
||||
* Second Life Viewer Source Code
|
||||
* Copyright (C) 2010, Linden Research, Inc.
|
||||
*
|
||||
* This library is free software; you can redistribute it and/or
|
||||
* modify it under the terms of the GNU Lesser General Public
|
||||
* License as published by the Free Software Foundation;
|
||||
* version 2.1 of the License only.
|
||||
*
|
||||
* This library is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
* Lesser General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU Lesser General Public
|
||||
* License along with this library; if not, write to the Free Software
|
||||
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
|
||||
*
|
||||
* Linden Research, Inc., 945 Battery Street, San Francisco, CA 94111 USA
|
||||
* $/LicenseInfo$
|
||||
*/
|
||||
|
||||
#ifndef LL_LLFLOATERWEBCONTENT_H
|
||||
#define LL_LLFLOATERWEBCONTENT_H
|
||||
|
||||
#include "llfloater.h"
|
||||
#include "llmediactrl.h"
|
||||
|
||||
class LLMediaCtrl;
|
||||
class LLComboBox;
|
||||
class LLTextBox;
|
||||
class LLProgressBar;
|
||||
class LLIconCtrl;
|
||||
|
||||
class LLFloaterWebContent :
|
||||
public LLFloater,
|
||||
public LLViewerMediaObserver
|
||||
{
|
||||
public:
|
||||
LOG_CLASS(LLFloaterWebContent);
|
||||
LLFloaterWebContent(const LLSD& key);
|
||||
|
||||
void initializeURLHistory();
|
||||
|
||||
static void create(const std::string &url, const std::string& target, const std::string& uuid = LLStringUtil::null);
|
||||
|
||||
static void closeRequest(const std::string &uuid);
|
||||
static void geometryChanged(const std::string &uuid, S32 x, S32 y, S32 width, S32 height);
|
||||
void geometryChanged(S32 x, S32 y, S32 width, S32 height);
|
||||
|
||||
/* virtual */ BOOL postBuild();
|
||||
/* virtual */ void onClose(bool app_quitting);
|
||||
/* virtual */ void draw();
|
||||
|
||||
// inherited from LLViewerMediaObserver
|
||||
/*virtual*/ void handleMediaEvent(LLPluginClassMedia* self, EMediaEvent event);
|
||||
|
||||
void onClickBack();
|
||||
void onClickForward();
|
||||
void onClickReload();
|
||||
void onClickStop();
|
||||
void onEnterAddress();
|
||||
void onPopExternal();
|
||||
|
||||
private:
|
||||
void open_media(const std::string& media_url, const std::string& target);
|
||||
void set_current_url(const std::string& url);
|
||||
|
||||
LLMediaCtrl* mWebBrowser;
|
||||
LLComboBox* mAddressCombo;
|
||||
LLIconCtrl *mSecureLockIcon;
|
||||
LLTextBox* mStatusBarText;
|
||||
LLProgressBar* mStatusBarProgress;
|
||||
std::string mCurrentURL;
|
||||
std::string mUUID;
|
||||
};
|
||||
|
||||
#endif // LL_LLFLOATERWEBCONTENT_H
|
||||
|
||||
static void create(const std::string &url, const std::string& target, const std::string& uuid = LLStringUtil::null);
|
||||
|
||||
static void closeRequest(const std::string &uuid);
|
||||
static void geometryChanged(const std::string &uuid, S32 x, S32 y, S32 width, S32 height);
|
||||
void geometryChanged(S32 x, S32 y, S32 width, S32 height);
|
||||
|
||||
/* virtual */ BOOL postBuild();
|
||||
/* virtual */ void onClose(bool app_quitting);
|
||||
/* virtual */ void draw();
|
||||
|
||||
// inherited from LLViewerMediaObserver
|
||||
/*virtual*/ void handleMediaEvent(LLPluginClassMedia* self, EMediaEvent event);
|
||||
|
||||
void onClickBack();
|
||||
void onClickForward();
|
||||
void onClickReload();
|
||||
void onClickStop();
|
||||
void onEnterAddress();
|
||||
void onPopExternal();
|
||||
|
||||
private:
|
||||
void open_media(const std::string& media_url, const std::string& target);
|
||||
void set_current_url(const std::string& url);
|
||||
|
||||
LLMediaCtrl* mWebBrowser;
|
||||
LLComboBox* mAddressCombo;
|
||||
LLIconCtrl *mSecureLockIcon;
|
||||
LLTextBox* mStatusBarText;
|
||||
LLProgressBar* mStatusBarProgress;
|
||||
std::string mCurrentURL;
|
||||
std::string mUUID;
|
||||
};
|
||||
|
||||
#endif // LL_LLFLOATERWEBCONTENT_H
|
||||
|
|
|
|||
|
|
@ -1854,31 +1854,9 @@ BOOL LLFolderView::handleRightMouseDown( S32 x, S32 y, MASK mask )
|
|||
{
|
||||
if (mCallbackRegistrar)
|
||||
mCallbackRegistrar->pushScope();
|
||||
//menu->empty();
|
||||
const LLView::child_list_t *list = menu->getChildList();
|
||||
|
||||
LLView::child_list_t::const_iterator menu_itor;
|
||||
for (menu_itor = list->begin(); menu_itor != list->end(); ++menu_itor)
|
||||
{
|
||||
(*menu_itor)->setVisible(FALSE);
|
||||
(*menu_itor)->pushVisible(TRUE);
|
||||
(*menu_itor)->setEnabled(TRUE);
|
||||
}
|
||||
|
||||
// Successively filter out invalid options
|
||||
|
||||
U32 flags = FIRST_SELECTED_ITEM;
|
||||
for (selected_items_t::iterator item_itor = mSelectedItems.begin();
|
||||
item_itor != mSelectedItems.end();
|
||||
++item_itor)
|
||||
{
|
||||
LLFolderViewItem* selected_item = (*item_itor);
|
||||
selected_item->buildContextMenu(*menu, flags);
|
||||
flags = 0x0;
|
||||
}
|
||||
updateMenuOptions(menu);
|
||||
|
||||
addNoOptions(menu);
|
||||
|
||||
menu->updateParent(LLMenuGL::sMenuContainer);
|
||||
LLMenuGL::showPopup(this, menu, x, y);
|
||||
if (mCallbackRegistrar)
|
||||
|
|
@ -2365,6 +2343,45 @@ void LLFolderView::updateRenamerPosition()
|
|||
}
|
||||
}
|
||||
|
||||
// Update visibility and availability (i.e. enabled/disabled) of context menu items.
|
||||
void LLFolderView::updateMenuOptions(LLMenuGL* menu)
|
||||
{
|
||||
const LLView::child_list_t *list = menu->getChildList();
|
||||
|
||||
LLView::child_list_t::const_iterator menu_itor;
|
||||
for (menu_itor = list->begin(); menu_itor != list->end(); ++menu_itor)
|
||||
{
|
||||
(*menu_itor)->setVisible(FALSE);
|
||||
(*menu_itor)->pushVisible(TRUE);
|
||||
(*menu_itor)->setEnabled(TRUE);
|
||||
}
|
||||
|
||||
// Successively filter out invalid options
|
||||
|
||||
U32 flags = FIRST_SELECTED_ITEM;
|
||||
for (selected_items_t::iterator item_itor = mSelectedItems.begin();
|
||||
item_itor != mSelectedItems.end();
|
||||
++item_itor)
|
||||
{
|
||||
LLFolderViewItem* selected_item = (*item_itor);
|
||||
selected_item->buildContextMenu(*menu, flags);
|
||||
flags = 0x0;
|
||||
}
|
||||
|
||||
addNoOptions(menu);
|
||||
}
|
||||
|
||||
// Refresh the context menu (that is already shown).
|
||||
void LLFolderView::updateMenu()
|
||||
{
|
||||
LLMenuGL* menu = (LLMenuGL*)mPopupMenuHandle.get();
|
||||
if (menu && menu->getVisible())
|
||||
{
|
||||
updateMenuOptions(menu);
|
||||
menu->needsArrange(); // update menu height if needed
|
||||
}
|
||||
}
|
||||
|
||||
bool LLFolderView::selectFirstItem()
|
||||
{
|
||||
for (folders_t::iterator iter = mFolders.begin();
|
||||
|
|
|
|||
|
|
@ -269,7 +269,10 @@ public:
|
|||
virtual S32 notify(const LLSD& info) ;
|
||||
|
||||
bool useLabelSuffix() { return mUseLabelSuffix; }
|
||||
void updateMenu();
|
||||
|
||||
private:
|
||||
void updateMenuOptions(LLMenuGL* menu);
|
||||
void updateRenamerPosition();
|
||||
|
||||
protected:
|
||||
|
|
|
|||
|
|
@ -100,7 +100,7 @@ public:
|
|||
|
||||
void onAvatarNameCache(const LLUUID& avatar_id, const LLAvatarName& av_name);
|
||||
|
||||
void onAdHocNameCache(const LLAvatarName& av_name);
|
||||
void onAdHocNameCache(const LLAvatarName& av_name);
|
||||
|
||||
//*TODO make private
|
||||
static std::string generateHash(const std::set<LLUUID>& sorted_uuids);
|
||||
|
|
|
|||
|
|
@ -717,7 +717,7 @@ void LLInspectAvatar::onClickShare()
|
|||
|
||||
void LLInspectAvatar::onToggleMute()
|
||||
{
|
||||
LLMute mute(mAvatarID, mAvatarName.getLegacyName(), LLMute::AGENT);
|
||||
LLMute mute(mAvatarID, mAvatarName.mDisplayName, LLMute::AGENT);
|
||||
|
||||
if (LLMuteList::getInstance()->isMuted(mute.mID, mute.mName))
|
||||
{
|
||||
|
|
|
|||
|
|
@ -393,18 +393,22 @@ void LLInventoryFilter::setFilterUUID(const LLUUID& object_id)
|
|||
|
||||
void LLInventoryFilter::setFilterSubString(const std::string& string)
|
||||
{
|
||||
if (mFilterSubString != string)
|
||||
std::string filter_sub_string_new = string;
|
||||
mFilterSubStringOrig = string;
|
||||
LLStringUtil::trimHead(filter_sub_string_new);
|
||||
LLStringUtil::toUpper(filter_sub_string_new);
|
||||
|
||||
if (mFilterSubString != filter_sub_string_new)
|
||||
{
|
||||
// hitting BACKSPACE, for example
|
||||
const BOOL less_restrictive = mFilterSubString.size() >= string.size() && !mFilterSubString.substr(0, string.size()).compare(string);
|
||||
const BOOL less_restrictive = mFilterSubString.size() >= filter_sub_string_new.size()
|
||||
&& !mFilterSubString.substr(0, filter_sub_string_new.size()).compare(filter_sub_string_new);
|
||||
|
||||
// appending new characters
|
||||
const BOOL more_restrictive = mFilterSubString.size() < string.size() && !string.substr(0, mFilterSubString.size()).compare(mFilterSubString);
|
||||
const BOOL more_restrictive = mFilterSubString.size() < filter_sub_string_new.size()
|
||||
&& !filter_sub_string_new.substr(0, mFilterSubString.size()).compare(mFilterSubString);
|
||||
|
||||
mFilterSubStringOrig = string;
|
||||
LLStringUtil::trimHead(mFilterSubStringOrig);
|
||||
mFilterSubString = mFilterSubStringOrig;
|
||||
LLStringUtil::toUpper(mFilterSubString);
|
||||
mFilterSubString = filter_sub_string_new;
|
||||
if (less_restrictive)
|
||||
{
|
||||
setModified(FILTER_LESS_RESTRICTIVE);
|
||||
|
|
|
|||
|
|
@ -686,6 +686,12 @@ bool LLFindWearablesEx::operator()(LLInventoryCategory* cat, LLInventoryItem* it
|
|||
return false;
|
||||
}
|
||||
|
||||
// Skip broken links.
|
||||
if (vitem->getIsBrokenLink())
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
return (bool) get_is_item_worn(item->getUUID()) == mIsWorn;
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -181,7 +181,7 @@ void LLInventoryModelBackgroundFetch::backgroundFetch()
|
|||
if (mBackgroundFetchActive && gAgent.getRegion())
|
||||
{
|
||||
// If we'll be using the capability, we'll be sending batches and the background thing isn't as important.
|
||||
std::string url = gAgent.getRegion()->getCapability("WebFetchInventoryDescendents");
|
||||
std::string url = gAgent.getRegion()->getCapability("FetchInventoryDescendents2");
|
||||
if (!url.empty())
|
||||
{
|
||||
bulkFetch(url);
|
||||
|
|
@ -604,7 +604,7 @@ void LLInventoryModelBackgroundFetch::bulkFetch(std::string url)
|
|||
}
|
||||
if (body_lib["folders"].size())
|
||||
{
|
||||
std::string url_lib = gAgent.getRegion()->getCapability("FetchLibDescendents");
|
||||
std::string url_lib = gAgent.getRegion()->getCapability("FetchLibDescendents2");
|
||||
|
||||
LLInventoryModelFetchDescendentsResponder *fetcher = new LLInventoryModelFetchDescendentsResponder(body_lib, recursive_cats);
|
||||
LLHTTPClient::post(url_lib, body_lib, fetcher, 300.0);
|
||||
|
|
|
|||
|
|
@ -203,8 +203,8 @@ void fetch_items_from_llsd(const LLSD& items_llsd)
|
|||
{
|
||||
if (!items_llsd.size() || gDisconnected) return;
|
||||
LLSD body;
|
||||
body[0]["cap_name"] = "FetchInventory";
|
||||
body[1]["cap_name"] = "FetchLib";
|
||||
body[0]["cap_name"] = "FetchInventory2";
|
||||
body[1]["cap_name"] = "FetchLib2";
|
||||
for (S32 i=0; i<items_llsd.size();i++)
|
||||
{
|
||||
if (items_llsd[i]["owner_id"].asString() == gAgent.getID().asString())
|
||||
|
|
|
|||
|
|
@ -60,6 +60,7 @@ static const LLInventoryFVBridgeBuilder INVENTORY_BRIDGE_BUILDER;
|
|||
//
|
||||
// Bridge to support knowing when the inventory has changed.
|
||||
//~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
|
||||
class LLInventoryPanelObserver : public LLInventoryObserver
|
||||
{
|
||||
public:
|
||||
|
|
@ -73,9 +74,57 @@ protected:
|
|||
LLInventoryPanel* mIP;
|
||||
};
|
||||
|
||||
//~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
// Class LLInvPanelComplObserver
|
||||
//
|
||||
// Calls specified callback when all specified items become complete.
|
||||
//
|
||||
// Usage:
|
||||
// observer = new LLInvPanelComplObserver(boost::bind(onComplete));
|
||||
// inventory->addObserver(observer);
|
||||
// observer->reset(); // (optional)
|
||||
// observer->watchItem(incomplete_item1_id);
|
||||
// observer->watchItem(incomplete_item2_id);
|
||||
//~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
|
||||
class LLInvPanelComplObserver : public LLInventoryCompletionObserver
|
||||
{
|
||||
public:
|
||||
typedef boost::function<void()> callback_t;
|
||||
|
||||
LLInvPanelComplObserver(callback_t cb)
|
||||
: mCallback(cb)
|
||||
{
|
||||
}
|
||||
|
||||
void reset();
|
||||
|
||||
private:
|
||||
/*virtual*/ void done();
|
||||
|
||||
/// Called when all the items are complete.
|
||||
callback_t mCallback;
|
||||
};
|
||||
|
||||
void LLInvPanelComplObserver::reset()
|
||||
{
|
||||
mIncomplete.clear();
|
||||
mComplete.clear();
|
||||
}
|
||||
|
||||
void LLInvPanelComplObserver::done()
|
||||
{
|
||||
mCallback();
|
||||
}
|
||||
|
||||
//~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
// Class LLInventoryPanel
|
||||
//~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
|
||||
LLInventoryPanel::LLInventoryPanel(const LLInventoryPanel::Params& p) :
|
||||
LLPanel(p),
|
||||
mInventoryObserver(NULL),
|
||||
mCompletionObserver(NULL),
|
||||
mFolderRoot(NULL),
|
||||
mScroller(NULL),
|
||||
mSortOrderSetting(p.sort_order_setting),
|
||||
|
|
@ -152,6 +201,9 @@ void LLInventoryPanel::initFromParams(const LLInventoryPanel::Params& params)
|
|||
mInventoryObserver = new LLInventoryPanelObserver(this);
|
||||
mInventory->addObserver(mInventoryObserver);
|
||||
|
||||
mCompletionObserver = new LLInvPanelComplObserver(boost::bind(&LLInventoryPanel::onItemsCompletion, this));
|
||||
mInventory->addObserver(mCompletionObserver);
|
||||
|
||||
// Build view of inventory if we need default full hierarchy and inventory ready,
|
||||
// otherwise wait for idle callback.
|
||||
if (mBuildDefaultHierarchy && mInventory->isInventoryUsable() && !mViewsInitialized)
|
||||
|
|
@ -189,7 +241,10 @@ LLInventoryPanel::~LLInventoryPanel()
|
|||
|
||||
// LLView destructor will take care of the sub-views.
|
||||
mInventory->removeObserver(mInventoryObserver);
|
||||
mInventory->removeObserver(mCompletionObserver);
|
||||
delete mInventoryObserver;
|
||||
delete mCompletionObserver;
|
||||
|
||||
mScroller = NULL;
|
||||
}
|
||||
|
||||
|
|
@ -654,6 +709,11 @@ void LLInventoryPanel::openStartFolderOrMyInventory()
|
|||
}
|
||||
}
|
||||
|
||||
void LLInventoryPanel::onItemsCompletion()
|
||||
{
|
||||
if (mFolderRoot) mFolderRoot->updateMenu();
|
||||
}
|
||||
|
||||
void LLInventoryPanel::openSelected()
|
||||
{
|
||||
LLFolderViewItem* folder_item = mFolderRoot->getCurSelectedItem();
|
||||
|
|
@ -757,6 +817,19 @@ void LLInventoryPanel::clearSelection()
|
|||
|
||||
void LLInventoryPanel::onSelectionChange(const std::deque<LLFolderViewItem*>& items, BOOL user_action)
|
||||
{
|
||||
// Schedule updating the folder view context menu when all selected items become complete (STORM-373).
|
||||
mCompletionObserver->reset();
|
||||
for (std::deque<LLFolderViewItem*>::const_iterator it = items.begin(); it != items.end(); ++it)
|
||||
{
|
||||
LLUUID id = (*it)->getListener()->getUUID();
|
||||
LLViewerInventoryItem* inv_item = mInventory->getItem(id);
|
||||
|
||||
if (inv_item && !inv_item->isFinished())
|
||||
{
|
||||
mCompletionObserver->watchItem(id);
|
||||
}
|
||||
}
|
||||
|
||||
LLFolderView* fv = getRootFolder();
|
||||
if (fv->needsAutoRename()) // auto-selecting a new user-created asset and preparing to rename
|
||||
{
|
||||
|
|
|
|||
|
|
@ -52,6 +52,7 @@ class LLIconCtrl;
|
|||
class LLSaveFolderState;
|
||||
class LLFilterEditor;
|
||||
class LLTabContainer;
|
||||
class LLInvPanelComplObserver;
|
||||
|
||||
class LLInventoryPanel : public LLPanel
|
||||
{
|
||||
|
|
@ -167,9 +168,11 @@ public:
|
|||
|
||||
protected:
|
||||
void openStartFolderOrMyInventory(); // open the first level of inventory
|
||||
void onItemsCompletion(); // called when selected items are complete
|
||||
|
||||
LLInventoryModel* mInventory;
|
||||
LLInventoryObserver* mInventoryObserver;
|
||||
LLInvPanelComplObserver* mCompletionObserver;
|
||||
BOOL mAllowMultiSelect;
|
||||
BOOL mShowItemLinkOverlays; // Shows link graphic over inventory item icons
|
||||
|
||||
|
|
|
|||
|
|
@ -547,6 +547,10 @@ void LLLocationInputCtrl::onFocusLost()
|
|||
{
|
||||
LLUICtrl::onFocusLost();
|
||||
refreshLocation();
|
||||
|
||||
// Setting cursor to 0 to show the left edge of the text. See STORM-370.
|
||||
mTextEntry->setCursor(0);
|
||||
|
||||
if(mTextEntry->hasSelection()){
|
||||
mTextEntry->deselect();
|
||||
}
|
||||
|
|
|
|||
|
|
@ -89,15 +89,15 @@ const static boost::regex TIMESTAMP_AND_STUFF("^(\\[\\d{4}/\\d{1,2}/\\d{1,2}\\s+
|
|||
*/
|
||||
const static boost::regex NAME_AND_TEXT("([^:]+[:]{1})?(\\s*)(.*)");
|
||||
|
||||
/**
|
||||
* These are recognizers for matching the names of ad-hoc conferences when generating the log file name
|
||||
* On invited side, an ad-hoc is named like "<first name> <last name> Conference 2010/11/19 03:43 f0f4"
|
||||
* On initiating side, an ad-hoc is named like Ad-hoc Conference hash<hash>"
|
||||
* If the naming system for ad-hoc conferences are change in LLIMModel::LLIMSession::buildHistoryFileName()
|
||||
* then these definition need to be adjusted as well.
|
||||
*/
|
||||
const static boost::regex INBOUND_CONFERENCE("^[a-zA-Z]{1,31} [a-zA-Z]{1,31} Conference [0-9]{4}/[0-9]{2}/[0-9]{2} [0-9]{2}:[0-9]{2} [0-9a-f]{4}");
|
||||
const static boost::regex OUTBOUND_CONFERENCE("^Ad-hoc Conference hash[a-f0-9]{8}-[a-f0-9]{4}-[a-f0-9]{4}-[a-f0-9]{4}-[a-f0-9]{12}");
|
||||
/**
|
||||
* These are recognizers for matching the names of ad-hoc conferences when generating the log file name
|
||||
* On invited side, an ad-hoc is named like "<first name> <last name> Conference 2010/11/19 03:43 f0f4"
|
||||
* On initiating side, an ad-hoc is named like Ad-hoc Conference hash<hash>"
|
||||
* If the naming system for ad-hoc conferences are change in LLIMModel::LLIMSession::buildHistoryFileName()
|
||||
* then these definition need to be adjusted as well.
|
||||
*/
|
||||
const static boost::regex INBOUND_CONFERENCE("^[a-zA-Z]{1,31} [a-zA-Z]{1,31} Conference [0-9]{4}/[0-9]{2}/[0-9]{2} [0-9]{2}:[0-9]{2} [0-9a-f]{4}");
|
||||
const static boost::regex OUTBOUND_CONFERENCE("^Ad-hoc Conference hash[a-f0-9]{8}-[a-f0-9]{4}-[a-f0-9]{4}-[a-f0-9]{4}-[a-f0-9]{12}");
|
||||
|
||||
//is used to parse complex object names like "Xstreet SL Terminal v2.2.5 st"
|
||||
const static std::string NAME_TEXT_DIVIDER(": ");
|
||||
|
|
|
|||
|
|
@ -472,7 +472,6 @@ LLLoginInstance::LLLoginInstance() :
|
|||
mLoginModule(new LLLogin()),
|
||||
mNotifications(NULL),
|
||||
mLoginState("offline"),
|
||||
mUserInteraction(true),
|
||||
mSkipOptionalUpdate(false),
|
||||
mAttemptComplete(false),
|
||||
mTransferRate(0.0f),
|
||||
|
|
@ -641,64 +640,57 @@ void LLLoginInstance::handleLoginFailure(const LLSD& event)
|
|||
LLSD response = event["data"];
|
||||
std::string reason_response = response["reason"].asString();
|
||||
std::string message_response = response["message"].asString();
|
||||
if(mUserInteraction)
|
||||
// For the cases of critical message or TOS agreement,
|
||||
// start the TOS dialog. The dialog response will be handled
|
||||
// by the LLLoginInstance::handleTOSResponse() callback.
|
||||
// The callback intiates the login attempt next step, either
|
||||
// to reconnect or to end the attempt in failure.
|
||||
if(reason_response == "tos")
|
||||
{
|
||||
// For the cases of critical message or TOS agreement,
|
||||
// start the TOS dialog. The dialog response will be handled
|
||||
// by the LLLoginInstance::handleTOSResponse() callback.
|
||||
// The callback intiates the login attempt next step, either
|
||||
// to reconnect or to end the attempt in failure.
|
||||
if(reason_response == "tos")
|
||||
{
|
||||
LLSD data(LLSD::emptyMap());
|
||||
data["message"] = message_response;
|
||||
data["reply_pump"] = TOS_REPLY_PUMP;
|
||||
gViewerWindow->setShowProgress(FALSE);
|
||||
LLFloaterReg::showInstance("message_tos", data);
|
||||
LLEventPumps::instance().obtain(TOS_REPLY_PUMP)
|
||||
.listen(TOS_LISTENER_NAME,
|
||||
boost::bind(&LLLoginInstance::handleTOSResponse,
|
||||
this, _1, "agree_to_tos"));
|
||||
}
|
||||
else if(reason_response == "critical")
|
||||
{
|
||||
LLSD data(LLSD::emptyMap());
|
||||
data["message"] = message_response;
|
||||
data["reply_pump"] = TOS_REPLY_PUMP;
|
||||
if(response.has("error_code"))
|
||||
{
|
||||
data["error_code"] = response["error_code"];
|
||||
}
|
||||
if(response.has("certificate"))
|
||||
{
|
||||
data["certificate"] = response["certificate"];
|
||||
}
|
||||
|
||||
gViewerWindow->setShowProgress(FALSE);
|
||||
LLFloaterReg::showInstance("message_critical", data);
|
||||
LLEventPumps::instance().obtain(TOS_REPLY_PUMP)
|
||||
.listen(TOS_LISTENER_NAME,
|
||||
boost::bind(&LLLoginInstance::handleTOSResponse,
|
||||
this, _1, "read_critical"));
|
||||
}
|
||||
else if(reason_response == "update" || gSavedSettings.getBOOL("ForceMandatoryUpdate"))
|
||||
{
|
||||
gSavedSettings.setBOOL("ForceMandatoryUpdate", FALSE);
|
||||
updateApp(true, message_response);
|
||||
}
|
||||
else if(reason_response == "optional")
|
||||
{
|
||||
updateApp(false, message_response);
|
||||
}
|
||||
else
|
||||
{
|
||||
attemptComplete();
|
||||
}
|
||||
LLSD data(LLSD::emptyMap());
|
||||
data["message"] = message_response;
|
||||
data["reply_pump"] = TOS_REPLY_PUMP;
|
||||
gViewerWindow->setShowProgress(FALSE);
|
||||
LLFloaterReg::showInstance("message_tos", data);
|
||||
LLEventPumps::instance().obtain(TOS_REPLY_PUMP)
|
||||
.listen(TOS_LISTENER_NAME,
|
||||
boost::bind(&LLLoginInstance::handleTOSResponse,
|
||||
this, _1, "agree_to_tos"));
|
||||
}
|
||||
else // no user interaction
|
||||
else if(reason_response == "critical")
|
||||
{
|
||||
LLSD data(LLSD::emptyMap());
|
||||
data["message"] = message_response;
|
||||
data["reply_pump"] = TOS_REPLY_PUMP;
|
||||
if(response.has("error_code"))
|
||||
{
|
||||
data["error_code"] = response["error_code"];
|
||||
}
|
||||
if(response.has("certificate"))
|
||||
{
|
||||
data["certificate"] = response["certificate"];
|
||||
}
|
||||
|
||||
gViewerWindow->setShowProgress(FALSE);
|
||||
LLFloaterReg::showInstance("message_critical", data);
|
||||
LLEventPumps::instance().obtain(TOS_REPLY_PUMP)
|
||||
.listen(TOS_LISTENER_NAME,
|
||||
boost::bind(&LLLoginInstance::handleTOSResponse,
|
||||
this, _1, "read_critical"));
|
||||
}
|
||||
else if(reason_response == "update" || gSavedSettings.getBOOL("ForceMandatoryUpdate"))
|
||||
{
|
||||
gSavedSettings.setBOOL("ForceMandatoryUpdate", FALSE);
|
||||
updateApp(true, message_response);
|
||||
}
|
||||
else if(reason_response == "optional")
|
||||
{
|
||||
updateApp(false, message_response);
|
||||
}
|
||||
else
|
||||
{
|
||||
attemptComplete();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void LLLoginInstance::handleLoginSuccess(const LLSD& event)
|
||||
|
|
|
|||
|
|
@ -61,12 +61,6 @@ public:
|
|||
// Only valid when authSuccess == true.
|
||||
const F64 getLastTransferRateBPS() { return mTransferRate; }
|
||||
|
||||
// Set whether this class will drive user interaction.
|
||||
// If not, login failures like 'need tos agreement' will
|
||||
// end the login attempt.
|
||||
void setUserInteraction(bool state) { mUserInteraction = state; }
|
||||
bool getUserInteraction() { return mUserInteraction; }
|
||||
|
||||
// Whether to tell login to skip optional update request.
|
||||
// False by default.
|
||||
void setSkipOptionalUpdate(bool state) { mSkipOptionalUpdate = state; }
|
||||
|
|
@ -100,7 +94,6 @@ private:
|
|||
std::string mLoginState;
|
||||
LLSD mRequestData;
|
||||
LLSD mResponseData;
|
||||
bool mUserInteraction;
|
||||
bool mSkipOptionalUpdate;
|
||||
bool mAttemptComplete;
|
||||
F64 mTransferRate;
|
||||
|
|
|
|||
|
|
@ -37,9 +37,11 @@
|
|||
#include <sstream>
|
||||
#include <boost/algorithm/string/split.hpp>
|
||||
|
||||
#include "llmemory.h"
|
||||
|
||||
LLMemoryView::LLMemoryView(const LLMemoryView::Params& p)
|
||||
: LLView(p),
|
||||
mPaused(FALSE),
|
||||
//mDelay(120),
|
||||
mAlloc(NULL)
|
||||
{
|
||||
|
|
@ -59,6 +61,7 @@ BOOL LLMemoryView::handleMouseDown(S32 x, S32 y, MASK mask)
|
|||
}
|
||||
else
|
||||
{
|
||||
mPaused = !mPaused;
|
||||
}
|
||||
return TRUE;
|
||||
}
|
||||
|
|
@ -148,13 +151,14 @@ void LLMemoryView::draw()
|
|||
|
||||
// cut off lines on bottom
|
||||
U32 max_lines = U32((height - 2 * line_height) / line_height);
|
||||
std::vector<LLWString>::const_iterator end = mLines.end();
|
||||
y_pos = height - MARGIN_AMT - line_height;
|
||||
y_off = 0.f;
|
||||
|
||||
#if !MEM_TRACK_MEM
|
||||
std::vector<LLWString>::const_iterator end = mLines.end();
|
||||
if(mLines.size() > max_lines) {
|
||||
end = mLines.begin() + max_lines;
|
||||
}
|
||||
|
||||
y_pos = height - MARGIN_AMT - line_height;
|
||||
y_off = 0.f;
|
||||
for (std::vector<LLWString>::const_iterator i = mLines.begin(); i != end; ++i)
|
||||
{
|
||||
font->render(*i, 0, MARGIN_AMT, y_pos - y_off,
|
||||
|
|
@ -169,6 +173,47 @@ void LLMemoryView::draw()
|
|||
y_off += line_height;
|
||||
}
|
||||
|
||||
#else
|
||||
LLMemTracker::getInstance()->preDraw(mPaused) ;
|
||||
|
||||
{
|
||||
F32 x_pos = MARGIN_AMT ;
|
||||
U32 lines = 0 ;
|
||||
const char* str = LLMemTracker::getInstance()->getNextLine() ;
|
||||
while(str != NULL)
|
||||
{
|
||||
lines++ ;
|
||||
font->renderUTF8(str, 0, x_pos, y_pos - y_off,
|
||||
LLColor4::white,
|
||||
LLFontGL::LEFT,
|
||||
LLFontGL::BASELINE,
|
||||
LLFontGL::NORMAL,
|
||||
LLFontGL::DROP_SHADOW,
|
||||
S32_MAX,
|
||||
target_width,
|
||||
NULL, FALSE);
|
||||
|
||||
str = LLMemTracker::getInstance()->getNextLine() ;
|
||||
y_off += line_height;
|
||||
|
||||
if(lines >= max_lines)
|
||||
{
|
||||
lines = 0 ;
|
||||
x_pos += 512.f ;
|
||||
if(x_pos + 512.f > target_width)
|
||||
{
|
||||
break ;
|
||||
}
|
||||
|
||||
y_pos = height - MARGIN_AMT - line_height;
|
||||
y_off = 0.f;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
LLMemTracker::getInstance()->postDraw() ;
|
||||
#endif
|
||||
|
||||
#if MEM_TRACK_TYPE
|
||||
|
||||
S32 left, top, right, bottom;
|
||||
|
|
|
|||
|
|
@ -55,6 +55,7 @@ public:
|
|||
private:
|
||||
std::vector<LLWString> mLines;
|
||||
LLAllocator* mAlloc;
|
||||
BOOL mPaused ;
|
||||
|
||||
};
|
||||
|
||||
|
|
|
|||
|
|
@ -47,6 +47,7 @@
|
|||
#include "llagentcamera.h"
|
||||
#include "llappviewer.h" // for gDisconnected
|
||||
#include "llcallingcard.h" // LLAvatarTracker
|
||||
#include "llfloaterworldmap.h"
|
||||
#include "lltracker.h"
|
||||
#include "llsurface.h"
|
||||
#include "llviewercamera.h"
|
||||
|
|
@ -91,7 +92,8 @@ LLNetMap::LLNetMap (const Params & p)
|
|||
mObjectImagep(),
|
||||
mClosestAgentToCursor(),
|
||||
mClosestAgentAtLastRightClick(),
|
||||
mToolTipMsg()
|
||||
mToolTipMsg(),
|
||||
mPopupMenu(NULL)
|
||||
{
|
||||
mDotRadius = llmax(DOT_SCALE * mPixelsPerMeter, MIN_DOT_RADIUS);
|
||||
setScale(gSavedSettings.getF32("MiniMapScale"));
|
||||
|
|
@ -102,6 +104,21 @@ LLNetMap::~LLNetMap()
|
|||
gSavedSettings.setF32("MiniMapScale", mScale);
|
||||
}
|
||||
|
||||
BOOL LLNetMap::postBuild()
|
||||
{
|
||||
LLUICtrl::CommitCallbackRegistry::ScopedRegistrar registrar;
|
||||
|
||||
registrar.add("Minimap.Zoom", boost::bind(&LLNetMap::handleZoom, this, _2));
|
||||
registrar.add("Minimap.Tracker", boost::bind(&LLNetMap::handleStopTracking, this, _2));
|
||||
|
||||
mPopupMenu = LLUICtrlFactory::getInstance()->createFromFile<LLMenuGL>("menu_mini_map.xml", gMenuHolder, LLViewerMenuHolderGL::child_registry_t::instance());
|
||||
if (mPopupMenu && !LLTracker::isTracking(0))
|
||||
{
|
||||
mPopupMenu->setItemEnabled ("Stop Tracking", false);
|
||||
}
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
void LLNetMap::setScale( F32 scale )
|
||||
{
|
||||
scale = llclamp(scale, MAP_SCALE_MIN, MAP_SCALE_MAX);
|
||||
|
|
@ -354,16 +371,49 @@ void LLNetMap::draw()
|
|||
|
||||
pos_map = globalPosToView(pos_global);
|
||||
|
||||
LLUUID uuid(NULL);
|
||||
BOOL show_as_friend = FALSE;
|
||||
if( i < regionp->mMapAvatarIDs.count())
|
||||
{
|
||||
show_as_friend = (LLAvatarTracker::instance().getBuddyInfo(regionp->mMapAvatarIDs.get(i)) != NULL);
|
||||
uuid = regionp->mMapAvatarIDs.get(i);
|
||||
show_as_friend = (LLAvatarTracker::instance().getBuddyInfo(uuid) != NULL);
|
||||
}
|
||||
|
||||
LLColor4 color = show_as_friend ? map_avatar_friend_color : map_avatar_color;
|
||||
LLWorldMapView::drawAvatar(
|
||||
pos_map.mV[VX], pos_map.mV[VY],
|
||||
show_as_friend ? map_avatar_friend_color : map_avatar_color,
|
||||
color,
|
||||
pos_map.mV[VZ], mDotRadius);
|
||||
|
||||
if(uuid.notNull())
|
||||
{
|
||||
bool selected = false;
|
||||
uuid_vec_t::iterator sel_iter = gmSelected.begin();
|
||||
for (; sel_iter != gmSelected.end(); sel_iter++)
|
||||
{
|
||||
if(*sel_iter == uuid)
|
||||
{
|
||||
selected = true;
|
||||
break;
|
||||
}
|
||||
}
|
||||
if(selected)
|
||||
{
|
||||
if( (pos_map.mV[VX] < 0) ||
|
||||
(pos_map.mV[VY] < 0) ||
|
||||
(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] );
|
||||
LLWorldMapView::drawTrackingCircle( getRect(), x, y, color, 1, 10);
|
||||
} else
|
||||
{
|
||||
LLWorldMapView::drawTrackingDot(pos_map.mV[VX],pos_map.mV[VY],color,0.f);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
F32 dist_to_cursor = dist_vec(LLVector2(pos_map.mV[VX], pos_map.mV[VY]),
|
||||
LLVector2(local_mouse_x,local_mouse_y));
|
||||
if(dist_to_cursor < min_pick_dist && dist_to_cursor < closest_dist)
|
||||
|
|
@ -460,6 +510,13 @@ void LLNetMap::draw()
|
|||
gGL.popUIMatrix();
|
||||
|
||||
LLUICtrl::draw();
|
||||
|
||||
if (LLTracker::isTracking(0))
|
||||
{
|
||||
mPopupMenu->setItemEnabled ("Stop Tracking", true);
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
void LLNetMap::reshape(S32 width, S32 height, BOOL called_from_parent)
|
||||
|
|
@ -600,7 +657,6 @@ BOOL LLNetMap::handleToolTip( S32 x, S32 y, MASK mask )
|
|||
args["[REGION]"] = region_name;
|
||||
std::string msg = mToolTipMsg;
|
||||
LLStringUtil::format(msg, args);
|
||||
|
||||
LLToolTipMgr::instance().show(LLToolTip::Params()
|
||||
.message(msg)
|
||||
.sticky_rect(sticky_rect));
|
||||
|
|
@ -793,6 +849,9 @@ BOOL LLNetMap::handleMouseDown( S32 x, S32 y, MASK mask )
|
|||
|
||||
BOOL LLNetMap::handleMouseUp( S32 x, S32 y, MASK mask )
|
||||
{
|
||||
if(abs(mMouseDown.mX-x)<3 && abs(mMouseDown.mY-y)<3)
|
||||
handleClick(x,y,mask);
|
||||
|
||||
if (hasMouseCapture())
|
||||
{
|
||||
if (mPanning)
|
||||
|
|
@ -821,6 +880,53 @@ BOOL LLNetMap::handleMouseUp( S32 x, S32 y, MASK mask )
|
|||
return FALSE;
|
||||
}
|
||||
|
||||
BOOL LLNetMap::handleRightMouseDown(S32 x, S32 y, MASK mask)
|
||||
{
|
||||
if (mPopupMenu)
|
||||
{
|
||||
mPopupMenu->buildDrawLabels();
|
||||
mPopupMenu->updateParent(LLMenuGL::sMenuContainer);
|
||||
LLMenuGL::showPopup(this, mPopupMenu, x, y);
|
||||
}
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
BOOL LLNetMap::handleClick(S32 x, S32 y, MASK mask)
|
||||
{
|
||||
// TODO: allow clicking an avatar on minimap to select avatar in the nearby avatar list
|
||||
// if(mClosestAgentToCursor.notNull())
|
||||
// mNearbyList->selectUser(mClosestAgentToCursor);
|
||||
// Needs a registered observer i guess to accomplish this without using
|
||||
// globals to tell the mNearbyList in llpeoplepanel to select the user
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
BOOL LLNetMap::handleDoubleClick(S32 x, S32 y, MASK mask)
|
||||
{
|
||||
LLVector3d pos_global = viewPosToGlobal(x, y);
|
||||
|
||||
// If we're not tracking a beacon already, double-click will set one
|
||||
if (!LLTracker::isTracking(NULL))
|
||||
{
|
||||
LLFloaterWorldMap* world_map = LLFloaterWorldMap::getInstance();
|
||||
if (world_map)
|
||||
{
|
||||
world_map->trackLocation(pos_global);
|
||||
}
|
||||
}
|
||||
|
||||
if (gSavedSettings.getBOOL("DoubleClickTeleport"))
|
||||
{
|
||||
// If DoubleClickTeleport is on, double clicking the minimap will teleport there
|
||||
gAgent.teleportViaLocationLookAt(pos_global);
|
||||
}
|
||||
else
|
||||
{
|
||||
LLFloaterReg::showInstance("world_map");
|
||||
}
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
// static
|
||||
bool LLNetMap::outsideSlop( S32 x, S32 y, S32 start_x, S32 start_y, S32 slop )
|
||||
{
|
||||
|
|
@ -871,3 +977,38 @@ BOOL LLNetMap::handleHover( S32 x, S32 y, MASK mask )
|
|||
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
void LLNetMap::handleZoom(const LLSD& userdata)
|
||||
{
|
||||
std::string level = userdata.asString();
|
||||
|
||||
F32 scale = 0.0f;
|
||||
if (level == std::string("default"))
|
||||
{
|
||||
LLControlVariable *pvar = gSavedSettings.getControl("MiniMapScale");
|
||||
if(pvar)
|
||||
{
|
||||
pvar->resetToDefault();
|
||||
scale = gSavedSettings.getF32("MiniMapScale");
|
||||
}
|
||||
}
|
||||
else if (level == std::string("close"))
|
||||
scale = LLNetMap::MAP_SCALE_MAX;
|
||||
else if (level == std::string("medium"))
|
||||
scale = LLNetMap::MAP_SCALE_MID;
|
||||
else if (level == std::string("far"))
|
||||
scale = LLNetMap::MAP_SCALE_MIN;
|
||||
if (scale != 0.0f)
|
||||
{
|
||||
setScale(scale);
|
||||
}
|
||||
}
|
||||
|
||||
void LLNetMap::handleStopTracking (const LLSD& userdata)
|
||||
{
|
||||
if (mPopupMenu)
|
||||
{
|
||||
mPopupMenu->setItemEnabled ("Stop Tracking", false);
|
||||
LLTracker::stopTracking ((void*)LLTracker::isTracking(NULL));
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -39,6 +39,7 @@ class LLCoordGL;
|
|||
class LLImageRaw;
|
||||
class LLViewerTexture;
|
||||
class LLFloaterMap;
|
||||
class LLMenuGL;
|
||||
|
||||
class LLNetMap : public LLUICtrl
|
||||
{
|
||||
|
|
@ -72,7 +73,12 @@ public:
|
|||
/*virtual*/ BOOL handleHover( S32 x, S32 y, MASK mask );
|
||||
/*virtual*/ BOOL handleToolTip( S32 x, S32 y, MASK mask);
|
||||
/*virtual*/ void reshape(S32 width, S32 height, BOOL called_from_parent = TRUE);
|
||||
|
||||
|
||||
/*virtual*/ BOOL postBuild();
|
||||
/*virtual*/ BOOL handleRightMouseDown( S32 x, S32 y, MASK mask );
|
||||
/*virtual*/ BOOL handleClick(S32 x, S32 y, MASK mask);
|
||||
/*virtual*/ BOOL handleDoubleClick( S32 x, S32 y, MASK mask );
|
||||
|
||||
void setScale( F32 scale );
|
||||
void setToolTipMsg(const std::string& msg) { mToolTipMsg = msg; }
|
||||
void renderScaledPointGlobal( const LLVector3d& pos, const LLColor4U &color, F32 radius );
|
||||
|
|
@ -120,6 +126,16 @@ private:
|
|||
LLUUID mClosestAgentAtLastRightClick;
|
||||
|
||||
std::string mToolTipMsg;
|
||||
|
||||
public:
|
||||
void setSelected(uuid_vec_t uuids) { gmSelected=uuids; };
|
||||
|
||||
private:
|
||||
void handleZoom(const LLSD& userdata);
|
||||
void handleStopTracking (const LLSD& userdata);
|
||||
|
||||
LLMenuGL* mPopupMenu;
|
||||
uuid_vec_t gmSelected;
|
||||
};
|
||||
|
||||
|
||||
|
|
|
|||
|
|
@ -629,11 +629,11 @@ static void got_full_name_callback( LLHandle<LLPanel> profile_panel_handle, cons
|
|||
{
|
||||
if (profile_panel_handle.isDead() ) return;
|
||||
|
||||
LLPanelAvatarProfile* profile_panel = dynamic_cast<LLPanelAvatarProfile*>(profile_panel_handle.get());
|
||||
if ( ! profile_panel ) return;
|
||||
LLPanelAvatarProfile* profile_panel = dynamic_cast<LLPanelAvatarProfile*>(profile_panel_handle.get());
|
||||
if ( ! profile_panel ) return;
|
||||
|
||||
LLStringUtil::format_map_t args;
|
||||
|
||||
LLStringUtil::format_map_t args;
|
||||
|
||||
std::string name;
|
||||
if (LLAvatarNameCache::useDisplayNames())
|
||||
{
|
||||
|
|
@ -642,21 +642,21 @@ static void got_full_name_callback( LLHandle<LLPanel> profile_panel_handle, cons
|
|||
else
|
||||
{
|
||||
name = full_name;
|
||||
}
|
||||
|
||||
args["[NAME]"] = name;
|
||||
|
||||
std::string linden_name = profile_panel->getString("name_text_args", args);
|
||||
}
|
||||
|
||||
args["[NAME]"] = name;
|
||||
|
||||
std::string linden_name = profile_panel->getString("name_text_args", args);
|
||||
profile_panel->getChild<LLUICtrl>("name_descr_text")->setValue(linden_name);
|
||||
}
|
||||
|
||||
void LLPanelAvatarProfile::onNameCache(const LLUUID& agent_id, const LLAvatarName& av_name)
|
||||
{
|
||||
LLStringUtil::format_map_t args;
|
||||
args["[DISPLAY_NAME]"] = av_name.mDisplayName;
|
||||
|
||||
std::string display_name = getString("display_name_text_args", args);
|
||||
getChild<LLUICtrl>("display_name_descr_text")->setValue(display_name);
|
||||
LLStringUtil::format_map_t args;
|
||||
args["[DISPLAY_NAME]"] = av_name.mDisplayName;
|
||||
|
||||
std::string display_name = getString("display_name_text_args", args);
|
||||
getChild<LLUICtrl>("display_name_descr_text")->setValue(display_name);
|
||||
}
|
||||
|
||||
void LLPanelAvatarProfile::fillCommonData(const LLAvatarData* avatar_data)
|
||||
|
|
@ -672,23 +672,23 @@ void LLPanelAvatarProfile::fillCommonData(const LLAvatarData* avatar_data)
|
|||
}
|
||||
|
||||
// ask (asynchronously) for the avatar name
|
||||
LLHandle<LLPanel> profile_panel_handle = getHandle();
|
||||
std::string full_name;
|
||||
if (gCacheName->getFullName(avatar_data->agent_id, full_name))
|
||||
{
|
||||
// name in cache, call callback directly
|
||||
got_full_name_callback( profile_panel_handle, full_name );
|
||||
}
|
||||
else
|
||||
{
|
||||
// not in cache, lookup name
|
||||
gCacheName->get(avatar_data->agent_id, false, boost::bind( got_full_name_callback, profile_panel_handle, _2 ));
|
||||
}
|
||||
|
||||
// get display name
|
||||
LLHandle<LLPanel> profile_panel_handle = getHandle();
|
||||
std::string full_name;
|
||||
if (gCacheName->getFullName(avatar_data->agent_id, full_name))
|
||||
{
|
||||
// name in cache, call callback directly
|
||||
got_full_name_callback( profile_panel_handle, full_name );
|
||||
}
|
||||
else
|
||||
{
|
||||
// not in cache, lookup name
|
||||
gCacheName->get(avatar_data->agent_id, false, boost::bind( got_full_name_callback, profile_panel_handle, _2 ));
|
||||
}
|
||||
|
||||
// get display name
|
||||
LLAvatarNameCache::get(avatar_data->avatar_id,
|
||||
boost::bind(&LLPanelAvatarProfile::onNameCache, this, _1, _2));
|
||||
|
||||
boost::bind(&LLPanelAvatarProfile::onNameCache, this, _1, _2));
|
||||
|
||||
args["[AGE]"] = LLDateUtil::ageFromDate( avatar_data->born_on, LLDate::now());
|
||||
std::string register_date = getString("RegisterDateFormat", args);
|
||||
getChild<LLUICtrl>("register_date")->setValue(register_date );
|
||||
|
|
|
|||
|
|
@ -1,297 +1,297 @@
|
|||
/**
|
||||
* @file llpanelavatar.h
|
||||
* @brief LLPanelAvatar and related class definitions
|
||||
*
|
||||
* $LicenseInfo:firstyear=2004&license=viewerlgpl$
|
||||
* Second Life Viewer Source Code
|
||||
* Copyright (C) 2010, Linden Research, Inc.
|
||||
*
|
||||
* This library is free software; you can redistribute it and/or
|
||||
* modify it under the terms of the GNU Lesser General Public
|
||||
* License as published by the Free Software Foundation;
|
||||
* version 2.1 of the License only.
|
||||
*
|
||||
* This library is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
* Lesser General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU Lesser General Public
|
||||
* License along with this library; if not, write to the Free Software
|
||||
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
|
||||
*
|
||||
* Linden Research, Inc., 945 Battery Street, San Francisco, CA 94111 USA
|
||||
* $/LicenseInfo$
|
||||
*/
|
||||
|
||||
#ifndef LL_LLPANELAVATAR_H
|
||||
#define LL_LLPANELAVATAR_H
|
||||
|
||||
#include "llpanel.h"
|
||||
#include "llavatarpropertiesprocessor.h"
|
||||
#include "llcallingcard.h"
|
||||
#include "llvoiceclient.h"
|
||||
#include "llavatarnamecache.h"
|
||||
|
||||
class LLComboBox;
|
||||
class LLLineEditor;
|
||||
|
||||
enum EOnlineStatus
|
||||
{
|
||||
ONLINE_STATUS_NO = 0,
|
||||
ONLINE_STATUS_YES = 1
|
||||
};
|
||||
|
||||
/**
|
||||
* Base class for any Profile View or My Profile Panel.
|
||||
*/
|
||||
class LLPanelProfileTab
|
||||
: public LLPanel
|
||||
, public LLAvatarPropertiesObserver
|
||||
{
|
||||
public:
|
||||
|
||||
/**
|
||||
* Sets avatar ID, sets panel as observer of avatar related info replies from server.
|
||||
*/
|
||||
virtual void setAvatarId(const LLUUID& id);
|
||||
|
||||
/**
|
||||
* Returns avatar ID.
|
||||
*/
|
||||
virtual const LLUUID& getAvatarId() { return mAvatarId; }
|
||||
|
||||
/**
|
||||
* Sends update data request to server.
|
||||
*/
|
||||
virtual void updateData() = 0;
|
||||
|
||||
/**
|
||||
* Clears panel data if viewing avatar info for first time and sends update data request.
|
||||
*/
|
||||
virtual void onOpen(const LLSD& key);
|
||||
|
||||
/**
|
||||
* Profile tabs should close any opened panels here.
|
||||
*
|
||||
* Called from LLPanelProfile::onOpen() before opening new profile.
|
||||
* See LLPanelPicks::onClosePanel for example. LLPanelPicks closes picture info panel
|
||||
* before new profile is displayed, otherwise new profile will
|
||||
* be hidden behind picture info panel.
|
||||
*/
|
||||
virtual void onClosePanel() {}
|
||||
|
||||
/**
|
||||
* Resets controls visibility, state, etc.
|
||||
*/
|
||||
virtual void resetControls(){};
|
||||
|
||||
/**
|
||||
* Clears all data received from server.
|
||||
*/
|
||||
virtual void resetData(){};
|
||||
|
||||
/*virtual*/ ~LLPanelProfileTab();
|
||||
|
||||
protected:
|
||||
|
||||
LLPanelProfileTab();
|
||||
|
||||
/**
|
||||
* Scrolls panel to top when viewing avatar info for first time.
|
||||
*/
|
||||
void scrollToTop();
|
||||
|
||||
virtual void onMapButtonClick();
|
||||
|
||||
virtual void updateButtons();
|
||||
|
||||
private:
|
||||
|
||||
LLUUID mAvatarId;
|
||||
};
|
||||
|
||||
/**
|
||||
* Panel for displaying Avatar's first and second life related info.
|
||||
*/
|
||||
class LLPanelAvatarProfile
|
||||
: public LLPanelProfileTab
|
||||
, public LLFriendObserver
|
||||
, public LLVoiceClientStatusObserver
|
||||
{
|
||||
public:
|
||||
LLPanelAvatarProfile();
|
||||
/*virtual*/ ~LLPanelAvatarProfile();
|
||||
|
||||
/*virtual*/ void onOpen(const LLSD& key);
|
||||
|
||||
/**
|
||||
* LLFriendObserver trigger
|
||||
*/
|
||||
virtual void changed(U32 mask);
|
||||
|
||||
// Implements LLVoiceClientStatusObserver::onChange() to enable the call
|
||||
// button when voice is available
|
||||
/*virtual*/ void onChange(EStatusType status, const std::string &channelURI, bool proximal);
|
||||
|
||||
/*virtual*/ void setAvatarId(const LLUUID& id);
|
||||
|
||||
/**
|
||||
* Processes data received from server.
|
||||
*/
|
||||
/*virtual*/ void processProperties(void* data, EAvatarProcessorType type);
|
||||
|
||||
/*virtual*/ BOOL postBuild();
|
||||
|
||||
/*virtual*/ void updateData();
|
||||
|
||||
/*virtual*/ void resetControls();
|
||||
|
||||
/*virtual*/ void resetData();
|
||||
|
||||
protected:
|
||||
|
||||
/**
|
||||
* Process profile related data received from server.
|
||||
*/
|
||||
virtual void processProfileProperties(const LLAvatarData* avatar_data);
|
||||
|
||||
/**
|
||||
* Processes group related data received from server.
|
||||
*/
|
||||
virtual void processGroupProperties(const LLAvatarGroups* avatar_groups);
|
||||
|
||||
/**
|
||||
* Fills common for Avatar profile and My Profile fields.
|
||||
*/
|
||||
virtual void fillCommonData(const LLAvatarData* avatar_data);
|
||||
|
||||
/**
|
||||
* Fills partner data.
|
||||
*/
|
||||
virtual void fillPartnerData(const LLAvatarData* avatar_data);
|
||||
|
||||
/**
|
||||
* Fills account status.
|
||||
*/
|
||||
virtual void fillAccountStatus(const LLAvatarData* avatar_data);
|
||||
|
||||
/**
|
||||
* Opens "Pay Resident" dialog.
|
||||
*/
|
||||
void pay();
|
||||
|
||||
/**
|
||||
* opens inventory and IM for sharing items
|
||||
*/
|
||||
void share();
|
||||
|
||||
/**
|
||||
* Add/remove resident to/from your block list.
|
||||
*/
|
||||
void toggleBlock();
|
||||
|
||||
void kick();
|
||||
void freeze();
|
||||
void unfreeze();
|
||||
void csr();
|
||||
|
||||
bool enableShowOnMap();
|
||||
bool enableBlock();
|
||||
bool enableUnblock();
|
||||
bool enableGod();
|
||||
|
||||
void onSeeProfileBtnClick();
|
||||
void onAddFriendButtonClick();
|
||||
void onIMButtonClick();
|
||||
void onCallButtonClick();
|
||||
void onTeleportButtonClick();
|
||||
void onShareButtonClick();
|
||||
|
||||
private:
|
||||
void onNameCache(const LLUUID& agent_id, const LLAvatarName& av_name);
|
||||
|
||||
typedef std::map< std::string,LLUUID> group_map_t;
|
||||
group_map_t mGroups;
|
||||
};
|
||||
|
||||
/**
|
||||
* Panel for displaying own first and second life related info.
|
||||
*/
|
||||
class LLPanelMyProfile
|
||||
: public LLPanelAvatarProfile
|
||||
{
|
||||
public:
|
||||
LLPanelMyProfile();
|
||||
|
||||
/*virtual*/ BOOL postBuild();
|
||||
|
||||
protected:
|
||||
|
||||
/*virtual*/ void onOpen(const LLSD& key);
|
||||
|
||||
/*virtual*/ void processProfileProperties(const LLAvatarData* avatar_data);
|
||||
|
||||
/*virtual*/ void resetControls();
|
||||
|
||||
protected:
|
||||
void onStatusMessageChanged();
|
||||
};
|
||||
|
||||
/**
|
||||
* Panel for displaying Avatar's notes and modifying friend's rights.
|
||||
*/
|
||||
class LLPanelAvatarNotes
|
||||
: public LLPanelProfileTab
|
||||
, public LLFriendObserver
|
||||
, public LLVoiceClientStatusObserver
|
||||
{
|
||||
public:
|
||||
LLPanelAvatarNotes();
|
||||
/*virtual*/ ~LLPanelAvatarNotes();
|
||||
|
||||
virtual void setAvatarId(const LLUUID& id);
|
||||
|
||||
/**
|
||||
* LLFriendObserver trigger
|
||||
*/
|
||||
virtual void changed(U32 mask);
|
||||
|
||||
// Implements LLVoiceClientStatusObserver::onChange() to enable the call
|
||||
// button when voice is available
|
||||
/*virtual*/ void onChange(EStatusType status, const std::string &channelURI, bool proximal);
|
||||
|
||||
/*virtual*/ void onOpen(const LLSD& key);
|
||||
|
||||
/*virtual*/ BOOL postBuild();
|
||||
|
||||
/*virtual*/ void processProperties(void* data, EAvatarProcessorType type);
|
||||
|
||||
/*virtual*/ void updateData();
|
||||
|
||||
protected:
|
||||
|
||||
/*virtual*/ void resetControls();
|
||||
|
||||
/*virtual*/ void resetData();
|
||||
|
||||
/**
|
||||
* Fills rights data for friends.
|
||||
*/
|
||||
void fillRightsData();
|
||||
|
||||
void rightsConfirmationCallback(const LLSD& notification,
|
||||
const LLSD& response, S32 rights);
|
||||
void confirmModifyRights(bool grant, S32 rights);
|
||||
void onCommitRights();
|
||||
void onCommitNotes();
|
||||
|
||||
void onAddFriendButtonClick();
|
||||
void onIMButtonClick();
|
||||
void onCallButtonClick();
|
||||
void onTeleportButtonClick();
|
||||
void onShareButtonClick();
|
||||
void enableCheckboxes(bool enable);
|
||||
};
|
||||
|
||||
#endif // LL_LLPANELAVATAR_H
|
||||
/**
|
||||
* @file llpanelavatar.h
|
||||
* @brief LLPanelAvatar and related class definitions
|
||||
*
|
||||
* $LicenseInfo:firstyear=2004&license=viewerlgpl$
|
||||
* Second Life Viewer Source Code
|
||||
* Copyright (C) 2010, Linden Research, Inc.
|
||||
*
|
||||
* This library is free software; you can redistribute it and/or
|
||||
* modify it under the terms of the GNU Lesser General Public
|
||||
* License as published by the Free Software Foundation;
|
||||
* version 2.1 of the License only.
|
||||
*
|
||||
* This library is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
* Lesser General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU Lesser General Public
|
||||
* License along with this library; if not, write to the Free Software
|
||||
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
|
||||
*
|
||||
* Linden Research, Inc., 945 Battery Street, San Francisco, CA 94111 USA
|
||||
* $/LicenseInfo$
|
||||
*/
|
||||
|
||||
#ifndef LL_LLPANELAVATAR_H
|
||||
#define LL_LLPANELAVATAR_H
|
||||
|
||||
#include "llpanel.h"
|
||||
#include "llavatarpropertiesprocessor.h"
|
||||
#include "llcallingcard.h"
|
||||
#include "llvoiceclient.h"
|
||||
#include "llavatarnamecache.h"
|
||||
|
||||
class LLComboBox;
|
||||
class LLLineEditor;
|
||||
|
||||
enum EOnlineStatus
|
||||
{
|
||||
ONLINE_STATUS_NO = 0,
|
||||
ONLINE_STATUS_YES = 1
|
||||
};
|
||||
|
||||
/**
|
||||
* Base class for any Profile View or My Profile Panel.
|
||||
*/
|
||||
class LLPanelProfileTab
|
||||
: public LLPanel
|
||||
, public LLAvatarPropertiesObserver
|
||||
{
|
||||
public:
|
||||
|
||||
/**
|
||||
* Sets avatar ID, sets panel as observer of avatar related info replies from server.
|
||||
*/
|
||||
virtual void setAvatarId(const LLUUID& id);
|
||||
|
||||
/**
|
||||
* Returns avatar ID.
|
||||
*/
|
||||
virtual const LLUUID& getAvatarId() { return mAvatarId; }
|
||||
|
||||
/**
|
||||
* Sends update data request to server.
|
||||
*/
|
||||
virtual void updateData() = 0;
|
||||
|
||||
/**
|
||||
* Clears panel data if viewing avatar info for first time and sends update data request.
|
||||
*/
|
||||
virtual void onOpen(const LLSD& key);
|
||||
|
||||
/**
|
||||
* Profile tabs should close any opened panels here.
|
||||
*
|
||||
* Called from LLPanelProfile::onOpen() before opening new profile.
|
||||
* See LLPanelPicks::onClosePanel for example. LLPanelPicks closes picture info panel
|
||||
* before new profile is displayed, otherwise new profile will
|
||||
* be hidden behind picture info panel.
|
||||
*/
|
||||
virtual void onClosePanel() {}
|
||||
|
||||
/**
|
||||
* Resets controls visibility, state, etc.
|
||||
*/
|
||||
virtual void resetControls(){};
|
||||
|
||||
/**
|
||||
* Clears all data received from server.
|
||||
*/
|
||||
virtual void resetData(){};
|
||||
|
||||
/*virtual*/ ~LLPanelProfileTab();
|
||||
|
||||
protected:
|
||||
|
||||
LLPanelProfileTab();
|
||||
|
||||
/**
|
||||
* Scrolls panel to top when viewing avatar info for first time.
|
||||
*/
|
||||
void scrollToTop();
|
||||
|
||||
virtual void onMapButtonClick();
|
||||
|
||||
virtual void updateButtons();
|
||||
|
||||
private:
|
||||
|
||||
LLUUID mAvatarId;
|
||||
};
|
||||
|
||||
/**
|
||||
* Panel for displaying Avatar's first and second life related info.
|
||||
*/
|
||||
class LLPanelAvatarProfile
|
||||
: public LLPanelProfileTab
|
||||
, public LLFriendObserver
|
||||
, public LLVoiceClientStatusObserver
|
||||
{
|
||||
public:
|
||||
LLPanelAvatarProfile();
|
||||
/*virtual*/ ~LLPanelAvatarProfile();
|
||||
|
||||
/*virtual*/ void onOpen(const LLSD& key);
|
||||
|
||||
/**
|
||||
* LLFriendObserver trigger
|
||||
*/
|
||||
virtual void changed(U32 mask);
|
||||
|
||||
// Implements LLVoiceClientStatusObserver::onChange() to enable the call
|
||||
// button when voice is available
|
||||
/*virtual*/ void onChange(EStatusType status, const std::string &channelURI, bool proximal);
|
||||
|
||||
/*virtual*/ void setAvatarId(const LLUUID& id);
|
||||
|
||||
/**
|
||||
* Processes data received from server.
|
||||
*/
|
||||
/*virtual*/ void processProperties(void* data, EAvatarProcessorType type);
|
||||
|
||||
/*virtual*/ BOOL postBuild();
|
||||
|
||||
/*virtual*/ void updateData();
|
||||
|
||||
/*virtual*/ void resetControls();
|
||||
|
||||
/*virtual*/ void resetData();
|
||||
|
||||
protected:
|
||||
|
||||
/**
|
||||
* Process profile related data received from server.
|
||||
*/
|
||||
virtual void processProfileProperties(const LLAvatarData* avatar_data);
|
||||
|
||||
/**
|
||||
* Processes group related data received from server.
|
||||
*/
|
||||
virtual void processGroupProperties(const LLAvatarGroups* avatar_groups);
|
||||
|
||||
/**
|
||||
* Fills common for Avatar profile and My Profile fields.
|
||||
*/
|
||||
virtual void fillCommonData(const LLAvatarData* avatar_data);
|
||||
|
||||
/**
|
||||
* Fills partner data.
|
||||
*/
|
||||
virtual void fillPartnerData(const LLAvatarData* avatar_data);
|
||||
|
||||
/**
|
||||
* Fills account status.
|
||||
*/
|
||||
virtual void fillAccountStatus(const LLAvatarData* avatar_data);
|
||||
|
||||
/**
|
||||
* Opens "Pay Resident" dialog.
|
||||
*/
|
||||
void pay();
|
||||
|
||||
/**
|
||||
* opens inventory and IM for sharing items
|
||||
*/
|
||||
void share();
|
||||
|
||||
/**
|
||||
* Add/remove resident to/from your block list.
|
||||
*/
|
||||
void toggleBlock();
|
||||
|
||||
void kick();
|
||||
void freeze();
|
||||
void unfreeze();
|
||||
void csr();
|
||||
|
||||
bool enableShowOnMap();
|
||||
bool enableBlock();
|
||||
bool enableUnblock();
|
||||
bool enableGod();
|
||||
|
||||
void onSeeProfileBtnClick();
|
||||
void onAddFriendButtonClick();
|
||||
void onIMButtonClick();
|
||||
void onCallButtonClick();
|
||||
void onTeleportButtonClick();
|
||||
void onShareButtonClick();
|
||||
|
||||
private:
|
||||
void onNameCache(const LLUUID& agent_id, const LLAvatarName& av_name);
|
||||
|
||||
typedef std::map< std::string,LLUUID> group_map_t;
|
||||
group_map_t mGroups;
|
||||
};
|
||||
|
||||
/**
|
||||
* Panel for displaying own first and second life related info.
|
||||
*/
|
||||
class LLPanelMyProfile
|
||||
: public LLPanelAvatarProfile
|
||||
{
|
||||
public:
|
||||
LLPanelMyProfile();
|
||||
|
||||
/*virtual*/ BOOL postBuild();
|
||||
|
||||
protected:
|
||||
|
||||
/*virtual*/ void onOpen(const LLSD& key);
|
||||
|
||||
/*virtual*/ void processProfileProperties(const LLAvatarData* avatar_data);
|
||||
|
||||
/*virtual*/ void resetControls();
|
||||
|
||||
protected:
|
||||
void onStatusMessageChanged();
|
||||
};
|
||||
|
||||
/**
|
||||
* Panel for displaying Avatar's notes and modifying friend's rights.
|
||||
*/
|
||||
class LLPanelAvatarNotes
|
||||
: public LLPanelProfileTab
|
||||
, public LLFriendObserver
|
||||
, public LLVoiceClientStatusObserver
|
||||
{
|
||||
public:
|
||||
LLPanelAvatarNotes();
|
||||
/*virtual*/ ~LLPanelAvatarNotes();
|
||||
|
||||
virtual void setAvatarId(const LLUUID& id);
|
||||
|
||||
/**
|
||||
* LLFriendObserver trigger
|
||||
*/
|
||||
virtual void changed(U32 mask);
|
||||
|
||||
// Implements LLVoiceClientStatusObserver::onChange() to enable the call
|
||||
// button when voice is available
|
||||
/*virtual*/ void onChange(EStatusType status, const std::string &channelURI, bool proximal);
|
||||
|
||||
/*virtual*/ void onOpen(const LLSD& key);
|
||||
|
||||
/*virtual*/ BOOL postBuild();
|
||||
|
||||
/*virtual*/ void processProperties(void* data, EAvatarProcessorType type);
|
||||
|
||||
/*virtual*/ void updateData();
|
||||
|
||||
protected:
|
||||
|
||||
/*virtual*/ void resetControls();
|
||||
|
||||
/*virtual*/ void resetData();
|
||||
|
||||
/**
|
||||
* Fills rights data for friends.
|
||||
*/
|
||||
void fillRightsData();
|
||||
|
||||
void rightsConfirmationCallback(const LLSD& notification,
|
||||
const LLSD& response, S32 rights);
|
||||
void confirmModifyRights(bool grant, S32 rights);
|
||||
void onCommitRights();
|
||||
void onCommitNotes();
|
||||
|
||||
void onAddFriendButtonClick();
|
||||
void onIMButtonClick();
|
||||
void onCallButtonClick();
|
||||
void onTeleportButtonClick();
|
||||
void onShareButtonClick();
|
||||
void enableCheckboxes(bool enable);
|
||||
};
|
||||
|
||||
#endif // LL_LLPANELAVATAR_H
|
||||
|
|
|
|||
|
|
@ -569,6 +569,7 @@ static void update_color_swatch_ctrl(LLPanelEditWearable* self, LLPanel* panel,
|
|||
if (color_swatch_ctrl)
|
||||
{
|
||||
color_swatch_ctrl->set(self->getWearable()->getClothesColor(entry->mTextureIndex));
|
||||
color_swatch_ctrl->closeFloaterColorPicker();
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -1843,7 +1843,8 @@ bool LLPanelGroupRolesSubTab::apply(std::string& mesg)
|
|||
{
|
||||
lldebugs << "LLPanelGroupRolesSubTab::apply()" << llendl;
|
||||
|
||||
saveRoleChanges();
|
||||
saveRoleChanges(true);
|
||||
|
||||
LLGroupMgr::getInstance()->sendGroupRoleChanges(mGroupID);
|
||||
|
||||
notifyObservers();
|
||||
|
|
@ -2022,7 +2023,7 @@ void LLPanelGroupRolesSubTab::handleRoleSelect()
|
|||
return;
|
||||
}
|
||||
|
||||
saveRoleChanges();
|
||||
saveRoleChanges(false);
|
||||
|
||||
// Check if there is anything selected.
|
||||
LLScrollListItem* item = mRolesList->getFirstSelected();
|
||||
|
|
@ -2385,7 +2386,7 @@ void LLPanelGroupRolesSubTab::handleDeleteRole()
|
|||
notifyObservers();
|
||||
}
|
||||
|
||||
void LLPanelGroupRolesSubTab::saveRoleChanges()
|
||||
void LLPanelGroupRolesSubTab::saveRoleChanges(bool select_saved_role)
|
||||
{
|
||||
LLGroupMgrGroupData* gdatap = LLGroupMgr::getInstance()->getGroupData(mGroupID);
|
||||
|
||||
|
|
@ -2400,13 +2401,23 @@ void LLPanelGroupRolesSubTab::saveRoleChanges()
|
|||
rd.mRoleDescription = mRoleDescription->getText();
|
||||
rd.mRoleTitle = mRoleTitle->getText();
|
||||
|
||||
S32 role_members_count = 0;
|
||||
if (mSelectedRole.isNull())
|
||||
{
|
||||
role_members_count = gdatap->mMemberCount;
|
||||
}
|
||||
else if(LLGroupRoleData* grd = get_ptr_in_map(gdatap->mRoles, mSelectedRole))
|
||||
{
|
||||
role_members_count = grd->getTotalMembersInRole();
|
||||
}
|
||||
|
||||
gdatap->setRoleData(mSelectedRole,rd);
|
||||
|
||||
mRolesList->deleteSingleItem(mRolesList->getItemIndex(mSelectedRole));
|
||||
|
||||
LLSD row = createRoleItem(mSelectedRole,rd.mRoleName,rd.mRoleTitle,0);
|
||||
LLSD row = createRoleItem(mSelectedRole,rd.mRoleName,rd.mRoleTitle,role_members_count);
|
||||
LLScrollListItem* item = mRolesList->addElement(row, ADD_BOTTOM, this);
|
||||
item->setSelected(TRUE);
|
||||
item->setSelected(select_saved_role);
|
||||
|
||||
mHasRoleChange = FALSE;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -257,7 +257,7 @@ public:
|
|||
static void onDeleteRole(void*);
|
||||
void handleDeleteRole();
|
||||
|
||||
void saveRoleChanges();
|
||||
void saveRoleChanges(bool select_saved_role);
|
||||
|
||||
virtual void setGroupID(const LLUUID& id);
|
||||
protected:
|
||||
|
|
|
|||
|
|
@ -71,6 +71,7 @@ static void collapse_all_folders(LLFolderView* root_folder);
|
|||
static void expand_all_folders(LLFolderView* root_folder);
|
||||
static bool has_expanded_folders(LLFolderView* root_folder);
|
||||
static bool has_collapsed_folders(LLFolderView* root_folder);
|
||||
static void toggle_restore_menu(LLMenuGL* menu, BOOL visible, BOOL enabled);
|
||||
|
||||
/**
|
||||
* Functor counting expanded and collapsed folders in folder view tree to know
|
||||
|
|
@ -708,6 +709,9 @@ void LLLandmarksPanel::initListCommandsHandlers()
|
|||
mGearFolderMenu = LLUICtrlFactory::getInstance()->createFromFile<LLToggleableMenu>("menu_places_gear_folder.xml", gMenuHolder, LLViewerMenuHolderGL::child_registry_t::instance());
|
||||
mMenuAdd = LLUICtrlFactory::getInstance()->createFromFile<LLMenuGL>("menu_place_add_button.xml", gMenuHolder, LLViewerMenuHolderGL::child_registry_t::instance());
|
||||
|
||||
mGearLandmarkMenu->setVisibilityChangeCallback(boost::bind(&LLLandmarksPanel::onMenuVisibilityChange, this, _1, _2));
|
||||
mGearFolderMenu->setVisibilityChangeCallback(boost::bind(&LLLandmarksPanel::onMenuVisibilityChange, this, _1, _2));
|
||||
|
||||
mListCommands->childSetAction(ADD_BUTTON_NAME, boost::bind(&LLLandmarksPanel::showActionMenu, this, mMenuAdd, ADD_BUTTON_NAME));
|
||||
}
|
||||
|
||||
|
|
@ -1079,6 +1083,60 @@ void LLLandmarksPanel::onCustomAction(const LLSD& userdata)
|
|||
{
|
||||
doActionOnCurSelectedLandmark(boost::bind(&LLLandmarksPanel::doCreatePick, this, _1));
|
||||
}
|
||||
else if ("restore" == command_name && mCurrentSelectedList)
|
||||
{
|
||||
mCurrentSelectedList->doToSelected(userdata);
|
||||
}
|
||||
}
|
||||
|
||||
void LLLandmarksPanel::onMenuVisibilityChange(LLUICtrl* ctrl, const LLSD& param)
|
||||
{
|
||||
bool new_visibility = param["visibility"].asBoolean();
|
||||
|
||||
// We don't have to update items visibility if the menu is hiding.
|
||||
if (!new_visibility) return;
|
||||
|
||||
BOOL are_any_items_in_trash = FALSE;
|
||||
BOOL are_all_items_in_trash = TRUE;
|
||||
|
||||
LLFolderView* root_folder_view = mCurrentSelectedList ? mCurrentSelectedList->getRootFolder() : NULL;
|
||||
if(root_folder_view)
|
||||
{
|
||||
const LLUUID trash_id = gInventory.findCategoryUUIDForType(LLFolderType::FT_TRASH);
|
||||
|
||||
std::set<LLUUID> selected_uuids = root_folder_view->getSelectionList();
|
||||
|
||||
// Iterate through selected items to find out if any of these items are in Trash
|
||||
// or all the items are in Trash category.
|
||||
for (std::set<LLUUID>::const_iterator iter = selected_uuids.begin(); iter != selected_uuids.end(); ++iter)
|
||||
{
|
||||
LLFolderViewItem* item = root_folder_view->getItemByID(*iter);
|
||||
|
||||
// If no item is found it might be a folder id.
|
||||
if (!item)
|
||||
{
|
||||
item = root_folder_view->getFolderByID(*iter);
|
||||
}
|
||||
if (!item) continue;
|
||||
|
||||
LLFolderViewEventListener* listenerp = item->getListener();
|
||||
if(!listenerp) continue;
|
||||
|
||||
// Trash category itself should not be included because it can't be
|
||||
// actually restored from trash.
|
||||
are_all_items_in_trash &= listenerp->isItemInTrash() && *iter != trash_id;
|
||||
|
||||
// If there are any selected items in Trash including the Trash category itself
|
||||
// we show "Restore Item" in context menu and hide other irrelevant items.
|
||||
are_any_items_in_trash |= listenerp->isItemInTrash();
|
||||
}
|
||||
}
|
||||
|
||||
// Display "Restore Item" menu entry if at least one of the selected items
|
||||
// is in Trash or the Trash category itself is among selected items.
|
||||
// Hide other menu entries in this case.
|
||||
// Enable this menu entry only if all selected items are in the Trash category.
|
||||
toggle_restore_menu((LLMenuGL*)ctrl, are_any_items_in_trash, are_all_items_in_trash);
|
||||
}
|
||||
|
||||
/*
|
||||
|
|
@ -1414,4 +1472,31 @@ static bool has_collapsed_folders(LLFolderView* root_folder)
|
|||
|
||||
return true;
|
||||
}
|
||||
|
||||
// Displays "Restore Item" context menu entry while hiding
|
||||
// all other entries or vice versa.
|
||||
// Sets "Restore Item" enabled state.
|
||||
void toggle_restore_menu(LLMenuGL *menu, BOOL visible, BOOL enabled)
|
||||
{
|
||||
if (!menu) return;
|
||||
|
||||
const LLView::child_list_t *list = menu->getChildList();
|
||||
for (LLView::child_list_t::const_iterator itor = list->begin();
|
||||
itor != list->end();
|
||||
++itor)
|
||||
{
|
||||
LLView *menu_item = (*itor);
|
||||
std::string name = menu_item->getName();
|
||||
|
||||
if ("restore_item" == name)
|
||||
{
|
||||
menu_item->setVisible(visible);
|
||||
menu_item->setEnabled(enabled);
|
||||
}
|
||||
else
|
||||
{
|
||||
menu_item->setVisible(!visible);
|
||||
}
|
||||
}
|
||||
}
|
||||
// EOF
|
||||
|
|
|
|||
|
|
@ -128,6 +128,14 @@ private:
|
|||
bool isActionEnabled(const LLSD& command_name) const;
|
||||
void onCustomAction(const LLSD& command_name);
|
||||
|
||||
/**
|
||||
* Updates context menu depending on the selected items location.
|
||||
*
|
||||
* For items in Trash category the menu includes the "Restore Item"
|
||||
* context menu entry.
|
||||
*/
|
||||
void onMenuVisibilityChange(LLUICtrl* ctrl, const LLSD& param);
|
||||
|
||||
/**
|
||||
* Determines if an item can be modified via context/gear menu.
|
||||
*
|
||||
|
|
|
|||
|
|
@ -958,7 +958,7 @@ void LLPanelNearByMedia::onAdvancedButtonClick()
|
|||
|
||||
void LLPanelNearByMedia::onMoreLess()
|
||||
{
|
||||
bool is_more = getChild<LLUICtrl>("more_btn")->getVisible();
|
||||
bool is_more = getChild<LLButton>("more_btn")->getToggleState();
|
||||
mNearbyMediaPanel->setVisible(is_more);
|
||||
|
||||
// enable resizing when expanded
|
||||
|
|
@ -969,8 +969,7 @@ void LLPanelNearByMedia::onMoreLess()
|
|||
|
||||
setShape(new_rect);
|
||||
|
||||
getChild<LLUICtrl>("more_btn")->setVisible(!is_more);
|
||||
getChild<LLUICtrl>("less_btn")->setVisible(is_more);
|
||||
getChild<LLUICtrl>("more_btn")->setVisible(true);
|
||||
}
|
||||
|
||||
void LLPanelNearByMedia::updateControls()
|
||||
|
|
|
|||
|
|
@ -766,22 +766,12 @@ BOOL LLTaskCategoryBridge::startDrag(EDragAndDropType* type, LLUUID* id) const
|
|||
LLViewerObject* object = gObjectList.findObject(mPanel->getTaskUUID());
|
||||
if(object)
|
||||
{
|
||||
const LLInventoryItem *inv = dynamic_cast<LLInventoryItem*>(object->getInventoryObject(mUUID));
|
||||
if (inv)
|
||||
const LLInventoryObject* cat = object->getInventoryObject(mUUID);
|
||||
if ( (cat) && (move_inv_category_world_to_agent(mUUID, LLUUID::null, FALSE)) )
|
||||
{
|
||||
const LLPermissions& perm = inv->getPermissions();
|
||||
bool can_copy = gAgent.allowOperation(PERM_COPY, perm,
|
||||
GP_OBJECT_MANIPULATE);
|
||||
if((can_copy && perm.allowTransferTo(gAgent.getID()))
|
||||
|| object->permYouOwner())
|
||||
// || gAgent.isGodlike())
|
||||
|
||||
{
|
||||
*type = LLViewerAssetType::lookupDragAndDropType(inv->getType());
|
||||
|
||||
*id = inv->getUUID();
|
||||
return TRUE;
|
||||
}
|
||||
*type = LLViewerAssetType::lookupDragAndDropType(cat->getType());
|
||||
*id = mUUID;
|
||||
return TRUE;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -54,6 +54,7 @@
|
|||
#include "llgroupactions.h"
|
||||
#include "llgrouplist.h"
|
||||
#include "llinventoryobserver.h"
|
||||
#include "llnetmap.h"
|
||||
#include "llpanelpeoplemenus.h"
|
||||
#include "llsidetray.h"
|
||||
#include "llsidetraypanelcontainer.h"
|
||||
|
|
@ -494,7 +495,8 @@ LLPanelPeople::LLPanelPeople()
|
|||
mNearbyGearButton(NULL),
|
||||
mFriendsGearButton(NULL),
|
||||
mGroupsGearButton(NULL),
|
||||
mRecentGearButton(NULL)
|
||||
mRecentGearButton(NULL),
|
||||
mMiniMap(NULL)
|
||||
{
|
||||
mFriendListUpdater = new LLFriendListUpdater(boost::bind(&LLPanelPeople::updateFriendList, this));
|
||||
mNearbyListUpdater = new LLNearbyListUpdater(boost::bind(&LLPanelPeople::updateNearbyList, this));
|
||||
|
|
@ -567,6 +569,9 @@ BOOL LLPanelPeople::postBuild()
|
|||
mNearbyList->setNoItemsMsg(getString("no_one_near"));
|
||||
mNearbyList->setNoFilteredItemsMsg(getString("no_one_filtered_near"));
|
||||
mNearbyList->setShowIcons("NearbyListShowIcons");
|
||||
mMiniMap = (LLNetMap*)getChildView("Net Map",true);
|
||||
mMiniMap->setToolTipMsg(gSavedSettings.getBOOL("DoubleClickTeleport") ?
|
||||
getString("AltMiniMapToolTipMsg") : getString("MiniMapToolTipMsg"));
|
||||
|
||||
mRecentList = getChild<LLPanel>(RECENT_TAB_NAME)->getChild<LLAvatarList>("avatar_list");
|
||||
mRecentList->setNoItemsCommentText(getString("no_recent_people"));
|
||||
|
|
@ -1088,6 +1093,12 @@ void LLPanelPeople::onAvatarListDoubleClicked(LLUICtrl* ctrl)
|
|||
|
||||
void LLPanelPeople::onAvatarListCommitted(LLAvatarList* list)
|
||||
{
|
||||
if (getActiveTabName() == NEARBY_TAB_NAME)
|
||||
{
|
||||
uuid_vec_t selected_uuids;
|
||||
getCurrentItemIDs(selected_uuids);
|
||||
mMiniMap->setSelected(selected_uuids);
|
||||
} else
|
||||
// Make sure only one of the friends lists (online/all) has selection.
|
||||
if (getActiveTabName() == FRIENDS_TAB_NAME)
|
||||
{
|
||||
|
|
|
|||
|
|
@ -142,6 +142,7 @@ private:
|
|||
LLAvatarList* mNearbyList;
|
||||
LLAvatarList* mRecentList;
|
||||
LLGroupList* mGroupList;
|
||||
LLNetMap* mMiniMap;
|
||||
|
||||
LLHandle<LLView> mGroupPlusMenuHandle;
|
||||
LLHandle<LLView> mNearbyViewSortMenuHandle;
|
||||
|
|
|
|||
|
|
@ -273,6 +273,8 @@ void LLPreviewTexture::saveAs()
|
|||
mSaveFileName = file_picker.getFirstFile();
|
||||
mLoadingFullImage = TRUE;
|
||||
getWindow()->incBusyCount();
|
||||
|
||||
mImage->forceToSaveRawImage(0) ;//re-fetch the raw image if the old one is removed.
|
||||
mImage->setLoadedCallback( LLPreviewTexture::onFileLoadedForSave,
|
||||
0, TRUE, FALSE, new LLUUID( mItemUUID ), &mCallbackTextureList );
|
||||
}
|
||||
|
|
|
|||
|
|
@ -33,6 +33,7 @@
|
|||
#include "llpanel.h"
|
||||
#include "llhttpclient.h"
|
||||
#include "llsdserialize.h"
|
||||
#include "llurlentry.h"
|
||||
#include "llviewerregion.h"
|
||||
#include "llview.h"
|
||||
|
||||
|
|
@ -168,6 +169,18 @@ void LLRemoteParcelInfoProcessor::processParcelInfoReply(LLMessageSystem* msg, v
|
|||
{
|
||||
observers.erase(*i);
|
||||
}
|
||||
|
||||
LLUrlEntryParcel::LLParcelData url_data;
|
||||
url_data.parcel_id = parcel_data.parcel_id;
|
||||
url_data.name = parcel_data.name;
|
||||
url_data.sim_name = parcel_data.sim_name;
|
||||
url_data.global_x = parcel_data.global_x;
|
||||
url_data.global_y = parcel_data.global_y;
|
||||
url_data.global_z = parcel_data.global_z;
|
||||
|
||||
// Pass the parcel data to LLUrlEntryParcel to render
|
||||
// human readable parcel name.
|
||||
LLUrlEntryParcel::processParcelInfo(url_data);
|
||||
}
|
||||
|
||||
void LLRemoteParcelInfoProcessor::sendParcelInfoRequest(const LLUUID& parcel_id)
|
||||
|
|
|
|||
|
|
@ -235,7 +235,7 @@ public:
|
|||
{
|
||||
bool operator()(LLSelectNode* node);
|
||||
};
|
||||
typedef boost::filter_iterator<is_root, list_t::iterator > valid_root_iterator;
|
||||
typedef boost::filter_iterator<is_valid_root, list_t::iterator > valid_root_iterator;
|
||||
valid_root_iterator valid_root_begin() { return valid_root_iterator(mList.begin(), mList.end()); }
|
||||
valid_root_iterator valid_root_end() { return valid_root_iterator(mList.end(), mList.end()); }
|
||||
|
||||
|
|
|
|||
|
|
@ -185,7 +185,7 @@ void LLSidepanelAppearance::onVisibilityChange(const LLSD &new_visibility)
|
|||
{
|
||||
LLSD visibility;
|
||||
visibility["visible"] = new_visibility.asBoolean();
|
||||
visibility["reset_accordion"] = true;
|
||||
visibility["reset_accordion"] = false;
|
||||
updateToVisibility(visibility);
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -141,6 +141,8 @@ public:
|
|||
|
||||
void toggleTabDocked();
|
||||
|
||||
BOOL handleScrollWheel(S32 x, S32 y, S32 clicks);
|
||||
|
||||
LLPanel *getPanel();
|
||||
private:
|
||||
std::string mTabTitle;
|
||||
|
|
@ -269,6 +271,15 @@ void LLSideTrayTab::toggleTabDocked()
|
|||
LLFloaterReg::toggleInstance("side_bar_tab", tab_name);
|
||||
}
|
||||
|
||||
BOOL LLSideTrayTab::handleScrollWheel(S32 x, S32 y, S32 clicks)
|
||||
{
|
||||
// Let children handle the event
|
||||
LLUICtrl::handleScrollWheel(x, y, clicks);
|
||||
|
||||
// and then eat it to prevent in-world scrolling (STORM-351).
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
void LLSideTrayTab::dock(LLFloater* floater_tab)
|
||||
{
|
||||
LLSideTray* side_tray = getSideTray();
|
||||
|
|
@ -498,8 +509,8 @@ private:
|
|||
|
||||
LLSideTray::Params::Params()
|
||||
: collapsed("collapsed",false),
|
||||
tab_btn_image_normal("tab_btn_image",LLUI::getUIImage("sidebar_tab_left.tga")),
|
||||
tab_btn_image_selected("tab_btn_image_selected",LLUI::getUIImage("button_enabled_selected_32x128.tga")),
|
||||
tab_btn_image_normal("tab_btn_image",LLUI::getUIImage("taskpanel/TaskPanel_Tab_Off.png")),
|
||||
tab_btn_image_selected("tab_btn_image_selected",LLUI::getUIImage("taskpanel/TaskPanel_Tab_Selected.png")),
|
||||
default_button_width("tab_btn_width",32),
|
||||
default_button_height("tab_btn_height",32),
|
||||
default_button_margin("tab_btn_margin",0)
|
||||
|
|
|
|||
|
|
@ -2578,6 +2578,49 @@ void renderCrossHairs(LLVector3 position, F32 size, LLColor4 color)
|
|||
gGL.end();
|
||||
}
|
||||
|
||||
void renderUpdateType(LLDrawable* drawablep)
|
||||
{
|
||||
LLViewerObject* vobj = drawablep->getVObj();
|
||||
if (!vobj || OUT_UNKNOWN == vobj->getLastUpdateType())
|
||||
{
|
||||
return;
|
||||
}
|
||||
LLGLEnable blend(GL_BLEND);
|
||||
switch (vobj->getLastUpdateType())
|
||||
{
|
||||
case OUT_FULL:
|
||||
glColor4f(0,1,0,0.5f);
|
||||
break;
|
||||
case OUT_TERSE_IMPROVED:
|
||||
glColor4f(0,1,1,0.5f);
|
||||
break;
|
||||
case OUT_FULL_COMPRESSED:
|
||||
if (vobj->getLastUpdateCached())
|
||||
{
|
||||
glColor4f(1,0,0,0.5f);
|
||||
}
|
||||
else
|
||||
{
|
||||
glColor4f(1,1,0,0.5f);
|
||||
}
|
||||
break;
|
||||
case OUT_FULL_CACHED:
|
||||
glColor4f(0,0,1,0.5f);
|
||||
break;
|
||||
default:
|
||||
llwarns << "Unknown update_type " << vobj->getLastUpdateType() << llendl;
|
||||
break;
|
||||
};
|
||||
S32 num_faces = drawablep->getNumFaces();
|
||||
if (num_faces)
|
||||
{
|
||||
for (S32 i = 0; i < num_faces; ++i)
|
||||
{
|
||||
pushVerts(drawablep->getFace(i), LLVertexBuffer::MAP_VERTEX);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
void renderBoundingBox(LLDrawable* drawable, BOOL set_color = TRUE)
|
||||
{
|
||||
|
|
@ -3018,6 +3061,10 @@ public:
|
|||
{
|
||||
renderRaycast(drawable);
|
||||
}
|
||||
if (gPipeline.hasRenderDebugMask(LLPipeline::RENDER_DEBUG_UPDATE_TYPE))
|
||||
{
|
||||
renderUpdateType(drawable);
|
||||
}
|
||||
|
||||
LLVOAvatar* avatar = dynamic_cast<LLVOAvatar*>(drawable->getVObj().get());
|
||||
|
||||
|
|
@ -3180,6 +3227,7 @@ void LLSpatialPartition::renderDebug()
|
|||
LLPipeline::RENDER_DEBUG_OCCLUSION |
|
||||
LLPipeline::RENDER_DEBUG_LIGHTS |
|
||||
LLPipeline::RENDER_DEBUG_BATCH_SIZE |
|
||||
LLPipeline::RENDER_DEBUG_UPDATE_TYPE |
|
||||
LLPipeline::RENDER_DEBUG_BBOXES |
|
||||
LLPipeline::RENDER_DEBUG_POINTS |
|
||||
LLPipeline::RENDER_DEBUG_TEXTURE_PRIORITY |
|
||||
|
|
|
|||
|
|
@ -139,6 +139,7 @@
|
|||
#include "lltrans.h"
|
||||
#include "llui.h"
|
||||
#include "llurldispatcher.h"
|
||||
#include "llurlentry.h"
|
||||
#include "llslurl.h"
|
||||
#include "llurlhistory.h"
|
||||
#include "llurlwhitelist.h"
|
||||
|
|
@ -980,7 +981,6 @@ bool idle_startup()
|
|||
login->setSkipOptionalUpdate(true);
|
||||
}
|
||||
|
||||
login->setUserInteraction(show_connect_box);
|
||||
login->setSerialNumber(LLAppViewer::instance()->getSerialNumber());
|
||||
login->setLastExecEvent(gLastExecEvent);
|
||||
login->setUpdaterLauncher(boost::bind(&LLAppViewer::launchUpdater, LLAppViewer::instance()));
|
||||
|
|
@ -2882,9 +2882,17 @@ bool process_login_success_response()
|
|||
if(!text.empty()) gAgentID.set(text);
|
||||
gDebugInfo["AgentID"] = text;
|
||||
|
||||
// Agent id needed for parcel info request in LLUrlEntryParcel
|
||||
// to resolve parcel name.
|
||||
LLUrlEntryParcel::setAgentID(gAgentID);
|
||||
|
||||
text = response["session_id"].asString();
|
||||
if(!text.empty()) gAgentSessionID.set(text);
|
||||
gDebugInfo["SessionID"] = text;
|
||||
|
||||
// Session id needed for parcel info request in LLUrlEntryParcel
|
||||
// to resolve parcel name.
|
||||
LLUrlEntryParcel::setSessionID(gAgentSessionID);
|
||||
|
||||
text = response["secure_session_id"].asString();
|
||||
if(!text.empty()) gAgent.mSecureSessionID.set(text);
|
||||
|
|
|
|||
|
|
@ -326,6 +326,7 @@ bool LLTextureCacheRemoteWorker::doRead()
|
|||
// First state / stage : find out if the file is local
|
||||
if (mState == INIT)
|
||||
{
|
||||
#if 0
|
||||
std::string filename = mCache->getLocalFileName(mID);
|
||||
// Is it a JPEG2000 file?
|
||||
{
|
||||
|
|
@ -360,6 +361,11 @@ bool LLTextureCacheRemoteWorker::doRead()
|
|||
}
|
||||
// Determine the next stage: if we found a file, then LOCAL else CACHE
|
||||
mState = (local_size > 0 ? LOCAL : CACHE);
|
||||
|
||||
llassert_always(mState == CACHE) ;
|
||||
#else
|
||||
mState = CACHE;
|
||||
#endif
|
||||
}
|
||||
|
||||
// Second state / stage : if the file is local, load it and leave
|
||||
|
|
@ -1592,7 +1598,7 @@ void LLTextureCache::purgeTextures(bool validate)
|
|||
if (validate)
|
||||
{
|
||||
validate_idx = gSavedSettings.getU32("CacheValidateCounter");
|
||||
U32 next_idx = (++validate_idx) % 256;
|
||||
U32 next_idx = (validate_idx + 1) % 256;
|
||||
gSavedSettings.setU32("CacheValidateCounter", next_idx);
|
||||
LL_DEBUGS("TextureCache") << "TEXTURE CACHE: Validating: " << validate_idx << LL_ENDL;
|
||||
}
|
||||
|
|
@ -1858,8 +1864,22 @@ void LLTextureCache::removeCachedTexture(const LLUUID& id)
|
|||
//called after mHeaderMutex is locked.
|
||||
void LLTextureCache::removeEntry(S32 idx, Entry& entry, std::string& filename)
|
||||
{
|
||||
bool file_maybe_exists = true; // Always attempt to remove when idx is invalid.
|
||||
|
||||
if(idx >= 0) //valid entry
|
||||
{
|
||||
if (entry.mBodySize == 0) // Always attempt to remove when mBodySize > 0.
|
||||
{
|
||||
if (LLAPRFile::isExist(filename, getLocalAPRFilePool())) // Sanity check. Shouldn't exist when body size is 0.
|
||||
{
|
||||
LL_WARNS("TextureCache") << "Entry has body size of zero but file " << filename << " exists. Deleting this file, too." << LL_ENDL;
|
||||
}
|
||||
else
|
||||
{
|
||||
file_maybe_exists = false;
|
||||
}
|
||||
}
|
||||
|
||||
entry.mImageSize = -1;
|
||||
entry.mBodySize = 0;
|
||||
mHeaderIDMap.erase(entry.mID);
|
||||
|
|
@ -1869,7 +1889,10 @@ void LLTextureCache::removeEntry(S32 idx, Entry& entry, std::string& filename)
|
|||
mFreeList.insert(idx);
|
||||
}
|
||||
|
||||
LLAPRFile::remove(filename, getLocalAPRFilePool());
|
||||
if (file_maybe_exists)
|
||||
{
|
||||
LLAPRFile::remove(filename, getLocalAPRFilePool());
|
||||
}
|
||||
}
|
||||
|
||||
bool LLTextureCache::removeFromCache(const LLUUID& id)
|
||||
|
|
|
|||
|
|
@ -1141,7 +1141,7 @@ bool LLTextureFetchWorker::doWork(S32 param)
|
|||
//1, not openning too many file descriptors at the same time;
|
||||
//2, control the traffic of http so udp gets bandwidth.
|
||||
//
|
||||
static const S32 MAX_NUM_OF_HTTP_REQUESTS_IN_QUEUE = 32 ;
|
||||
static const S32 MAX_NUM_OF_HTTP_REQUESTS_IN_QUEUE = 8 ;
|
||||
if(mFetcher->getNumHTTPRequests() > MAX_NUM_OF_HTTP_REQUESTS_IN_QUEUE)
|
||||
{
|
||||
return false ; //wait.
|
||||
|
|
@ -1822,6 +1822,7 @@ LLTextureFetch::LLTextureFetch(LLTextureCache* cache, LLImageDecodeThread* image
|
|||
mImageDecodeThread(imagedecodethread),
|
||||
mTextureBandwidth(0),
|
||||
mHTTPTextureBits(0),
|
||||
mTotalHTTPRequests(0),
|
||||
mCurlGetRequest(NULL),
|
||||
mQAMode(qa_mode)
|
||||
{
|
||||
|
|
@ -1973,6 +1974,7 @@ void LLTextureFetch::addToHTTPQueue(const LLUUID& id)
|
|||
{
|
||||
LLMutexLock lock(&mNetworkQueueMutex);
|
||||
mHTTPTextureQueue.insert(id);
|
||||
mTotalHTTPRequests++;
|
||||
}
|
||||
|
||||
void LLTextureFetch::removeFromHTTPQueue(const LLUUID& id, S32 received_size)
|
||||
|
|
@ -2035,6 +2037,15 @@ S32 LLTextureFetch::getNumHTTPRequests()
|
|||
return size ;
|
||||
}
|
||||
|
||||
U32 LLTextureFetch::getTotalNumHTTPRequests()
|
||||
{
|
||||
mNetworkQueueMutex.lock() ;
|
||||
U32 size = mTotalHTTPRequests ;
|
||||
mNetworkQueueMutex.unlock() ;
|
||||
|
||||
return size ;
|
||||
}
|
||||
|
||||
// call lockQueue() first!
|
||||
LLTextureFetchWorker* LLTextureFetch::getWorkerAfterLock(const LLUUID& id)
|
||||
{
|
||||
|
|
|
|||
|
|
@ -79,6 +79,7 @@ public:
|
|||
void dump();
|
||||
S32 getNumRequests() ;
|
||||
S32 getNumHTTPRequests() ;
|
||||
U32 getTotalNumHTTPRequests() ;
|
||||
|
||||
// Public for access by callbacks
|
||||
S32 getPending();
|
||||
|
|
@ -183,6 +184,9 @@ private:
|
|||
|
||||
U32 mHTTPTextureBits;
|
||||
|
||||
//debug use
|
||||
U32 mTotalHTTPRequests ;
|
||||
|
||||
// Out-of-band cross-thread command queue. This command queue
|
||||
// is logically tied to LLQueuedThread's list of
|
||||
// QueuedRequest instances and so must be covered by the
|
||||
|
|
|
|||
|
|
@ -516,6 +516,7 @@ void LLGLTexMemBar::draw()
|
|||
S32 v_offset = (S32)((texture_bar_height + 2.2f) * mTextureView->mNumTextureBars + 2.0f);
|
||||
F32 total_texture_downloaded = (F32)gTotalTextureBytes / (1024 * 1024);
|
||||
F32 total_object_downloaded = (F32)gTotalObjectBytes / (1024 * 1024);
|
||||
U32 total_http_requests = LLAppViewer::getTextureFetch()->getTotalNumHTTPRequests() ;
|
||||
//----------------------------------------------------------------------------
|
||||
LLGLSUIDefault gls_ui;
|
||||
LLColor4 text_color(1.f, 1.f, 1.f, 0.75f);
|
||||
|
|
@ -526,13 +527,13 @@ void LLGLTexMemBar::draw()
|
|||
LLFontGL::getFontMonospace()->renderUTF8(text, 0, 0, v_offset + line_height*6,
|
||||
text_color, LLFontGL::LEFT, LLFontGL::TOP);
|
||||
|
||||
text = llformat("GL Tot: %d/%d MB Bound: %d/%d MB Raw Tot: %d MB Bias: %.2f Cache: %.1f/%.1f MB Net Tot Tex: %.1f MB Tot Obj: %.1f MB",
|
||||
text = llformat("GL Tot: %d/%d MB Bound: %d/%d MB Raw Tot: %d MB Bias: %.2f Cache: %.1f/%.1f MB Net Tot Tex: %.1f MB Tot Obj: %.1f MB Tot Htp: %d",
|
||||
total_mem,
|
||||
max_total_mem,
|
||||
bound_mem,
|
||||
max_bound_mem,
|
||||
LLImageRaw::sGlobalRawMemory >> 20, discard_bias,
|
||||
cache_usage, cache_max_usage, total_texture_downloaded, total_object_downloaded);
|
||||
cache_usage, cache_max_usage, total_texture_downloaded, total_object_downloaded, total_http_requests);
|
||||
//, cache_entries, cache_max_entries
|
||||
|
||||
LLFontGL::getFontMonospace()->renderUTF8(text, 0, 0, v_offset + line_height*3,
|
||||
|
|
|
|||
|
|
@ -366,11 +366,11 @@ void LLViewerInventoryItem::fetchFromServer(void) const
|
|||
{
|
||||
if(gAgent.getID() != mPermissions.getOwner())
|
||||
{
|
||||
url = region->getCapability("FetchLib");
|
||||
url = region->getCapability("FetchLib2");
|
||||
}
|
||||
else
|
||||
{
|
||||
url = region->getCapability("FetchInventory");
|
||||
url = region->getCapability("FetchInventory2");
|
||||
}
|
||||
}
|
||||
else
|
||||
|
|
@ -648,7 +648,7 @@ bool LLViewerInventoryCategory::fetch()
|
|||
std::string url;
|
||||
if (gAgent.getRegion())
|
||||
{
|
||||
url = gAgent.getRegion()->getCapability("WebFetchInventoryDescendents");
|
||||
url = gAgent.getRegion()->getCapability("FetchInventoryDescendents2");
|
||||
}
|
||||
else
|
||||
{
|
||||
|
|
@ -660,7 +660,7 @@ bool LLViewerInventoryCategory::fetch()
|
|||
}
|
||||
else
|
||||
{ //Deprecated, but if we don't have a capability, use the old system.
|
||||
llinfos << "WebFetchInventoryDescendents capability not found. Using deprecated UDP message." << llendl;
|
||||
llinfos << "FetchInventoryDescendents2 capability not found. Using deprecated UDP message." << llendl;
|
||||
LLMessageSystem* msg = gMessageSystem;
|
||||
msg->newMessage("FetchInventoryDescendents");
|
||||
msg->nextBlock("AgentData");
|
||||
|
|
|
|||
|
|
@ -1436,9 +1436,12 @@ void LLViewerMedia::proxyWindowClosed(const std::string &uuid)
|
|||
// static
|
||||
void LLViewerMedia::createSpareBrowserMediaSource()
|
||||
{
|
||||
if(!sSpareBrowserMediaSource)
|
||||
// If we don't have a spare browser media source, create one.
|
||||
// However, if PluginAttachDebuggerToPlugins is set then don't spawn a spare
|
||||
// SLPlugin process in order to not be confused by an unrelated gdb terminal
|
||||
// popping up at the moment we start a media plugin.
|
||||
if (!sSpareBrowserMediaSource && !gSavedSettings.getBOOL("PluginAttachDebuggerToPlugins"))
|
||||
{
|
||||
// If we don't have a spare browser media source, create one.
|
||||
// The null owner will keep the browser plugin from fully initializing
|
||||
// (specifically, it keeps LLPluginClassMedia from negotiating a size change,
|
||||
// which keeps MediaPluginWebkit::initBrowserWindow from doing anything until we have some necessary data, like the background color)
|
||||
|
|
@ -1694,7 +1697,8 @@ LLPluginClassMedia* LLViewerMediaImpl::newSourceFromMediaType(std::string media_
|
|||
LLPluginClassMedia* media_source = NULL;
|
||||
|
||||
// HACK: we always try to keep a spare running webkit plugin around to improve launch times.
|
||||
if(plugin_basename == "media_plugin_webkit")
|
||||
// If a spare was already created before PluginAttachDebuggerToPlugins was set, don't use it.
|
||||
if(plugin_basename == "media_plugin_webkit" && !gSavedSettings.getBOOL("PluginAttachDebuggerToPlugins"))
|
||||
{
|
||||
media_source = LLViewerMedia::getSpareBrowserMediaSource();
|
||||
if(media_source)
|
||||
|
|
|
|||
|
|
@ -557,7 +557,7 @@ class LLAdvancedCheckConsole : public view_listener_t
|
|||
new_value = get_visibility( (void*)gDebugView->mMemoryView );
|
||||
}
|
||||
#endif
|
||||
|
||||
|
||||
return new_value;
|
||||
}
|
||||
};
|
||||
|
|
@ -906,6 +906,10 @@ U32 info_display_from_string(std::string info_display)
|
|||
{
|
||||
return LLPipeline::RENDER_DEBUG_BATCH_SIZE;
|
||||
}
|
||||
else if ("update type" == info_display)
|
||||
{
|
||||
return LLPipeline::RENDER_DEBUG_UPDATE_TYPE;
|
||||
}
|
||||
else if ("texture anim" == info_display)
|
||||
{
|
||||
return LLPipeline::RENDER_DEBUG_TEXTURE_ANIM;
|
||||
|
|
@ -4197,9 +4201,9 @@ class LLObjectEnableReturn : public view_listener_t
|
|||
{
|
||||
virtual bool apply(LLViewerObject* obj)
|
||||
{
|
||||
return (obj->isOverAgentOwnedLand() ||
|
||||
obj->isOverGroupOwnedLand() ||
|
||||
obj->permModify());
|
||||
return
|
||||
obj->permModify() ||
|
||||
obj->isReturnable();
|
||||
}
|
||||
} func;
|
||||
const bool firstonly = true;
|
||||
|
|
|
|||
|
|
@ -171,31 +171,6 @@ const BOOL SCRIPT_QUESTION_IS_CAUTION[SCRIPT_PERMISSION_EOF] =
|
|||
FALSE // ControlYourCamera
|
||||
};
|
||||
|
||||
// Extract channel and version from a string like "SL Web Viewer Beta 10.11.29.215604".
|
||||
// (channel: "SL Web Viewer Beta", version: "10.11.29.215604")
|
||||
static bool parse_version_info(const std::string& version_info, std::string& channel, std::string& ver)
|
||||
{
|
||||
size_t last_space = version_info.rfind(" ");
|
||||
channel = version_info;
|
||||
|
||||
if (last_space != std::string::npos)
|
||||
{
|
||||
try
|
||||
{
|
||||
ver = version_info.substr(last_space + 1);
|
||||
channel.replace(last_space, ver.length() + 1, ""); // strip version
|
||||
}
|
||||
catch (std::out_of_range)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
bool friendship_offer_callback(const LLSD& notification, const LLSD& response)
|
||||
{
|
||||
S32 option = LLNotificationsUtil::getSelectedOption(notification, response);
|
||||
|
|
@ -2746,6 +2721,14 @@ void process_improved_im(LLMessageSystem *msg, void **user_data)
|
|||
LLSD args;
|
||||
args["slurl"] = location;
|
||||
args["type"] = LLNotificationsUI::NT_NEARBYCHAT;
|
||||
|
||||
// Look for IRC-style emotes here so object name formatting is correct
|
||||
std::string prefix = message.substr(0, 4);
|
||||
if (prefix == "/me " || prefix == "/me'")
|
||||
{
|
||||
chat.mChatStyle = CHAT_STYLE_IRC;
|
||||
}
|
||||
|
||||
LLNotificationsUI::LLNotificationManager::instance().onChat(chat, args);
|
||||
}
|
||||
|
||||
|
|
@ -3848,31 +3831,6 @@ void process_agent_movement_complete(LLMessageSystem* msg, void**)
|
|||
return;
|
||||
}
|
||||
|
||||
if (!gLastVersionChannel.empty())
|
||||
{
|
||||
std::string url = regionp->getCapability("ServerReleaseNotes");
|
||||
if (url.empty())
|
||||
{
|
||||
// The capability hasn't arrived yet or is not supported,
|
||||
// fall back to parsing server version channel.
|
||||
std::string channel, ver;
|
||||
if (!parse_version_info(version_channel, channel, ver))
|
||||
{
|
||||
llwarns << "Failed to parse server version channel (" << version_channel << ")" << llendl;
|
||||
}
|
||||
|
||||
url = gSavedSettings.getString("ReleaseNotesURL");
|
||||
LLSD args;
|
||||
args["CHANNEL"] = LLWeb::escapeURL(channel);
|
||||
args["VERSION"] = LLWeb::escapeURL(ver);
|
||||
LLStringUtil::format(url, args);
|
||||
}
|
||||
|
||||
LLSD args;
|
||||
args["URL"] = url;
|
||||
LLNotificationsUtil::add("ServerVersionChanged", args);
|
||||
}
|
||||
|
||||
gLastVersionChannel = version_channel;
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -210,7 +210,6 @@ LLViewerObject::LLViewerObject(const LLUUID &id, const LLPCode pcode, LLViewerRe
|
|||
mLastInterpUpdateSecs(0.f),
|
||||
mLastMessageUpdateSecs(0.f),
|
||||
mLatestRecvPacketID(0),
|
||||
mCircuitPacketCount(0),
|
||||
mData(NULL),
|
||||
mAudioSourcep(NULL),
|
||||
mAudioGain(1.f),
|
||||
|
|
@ -234,7 +233,9 @@ LLViewerObject::LLViewerObject(const LLUUID &id, const LLPCode pcode, LLViewerRe
|
|||
mState(0),
|
||||
mMedia(NULL),
|
||||
mClickAction(0),
|
||||
mAttachmentItemID(LLUUID::null)
|
||||
mAttachmentItemID(LLUUID::null),
|
||||
mLastUpdateType(OUT_UNKNOWN),
|
||||
mLastUpdateCached(FALSE)
|
||||
{
|
||||
if (!is_global)
|
||||
{
|
||||
|
|
@ -516,20 +517,23 @@ void LLViewerObject::setNameValueList(const std::string& name_value_list)
|
|||
|
||||
// This method returns true if the object is over land owned by the
|
||||
// agent.
|
||||
BOOL LLViewerObject::isOverAgentOwnedLand() const
|
||||
bool LLViewerObject::isReturnable()
|
||||
{
|
||||
return mRegionp
|
||||
&& mRegionp->getParcelOverlay()
|
||||
&& mRegionp->getParcelOverlay()->isOwnedSelf(getPositionRegion());
|
||||
}
|
||||
if (isAttachment())
|
||||
{
|
||||
return false;
|
||||
}
|
||||
std::vector<LLBBox> boxes;
|
||||
boxes.push_back(LLBBox(getPositionRegion(), getRotationRegion(), getScale() * -0.5f, getScale() * 0.5f).getAxisAligned());
|
||||
for (child_list_t::iterator iter = mChildList.begin();
|
||||
iter != mChildList.end(); iter++)
|
||||
{
|
||||
LLViewerObject* child = *iter;
|
||||
boxes.push_back(LLBBox(child->getPositionRegion(), child->getRotationRegion(), child->getScale() * -0.5f, child->getScale() * 0.5f).getAxisAligned());
|
||||
}
|
||||
|
||||
// This method returns true if the object is over land owned by the
|
||||
// agent.
|
||||
BOOL LLViewerObject::isOverGroupOwnedLand() const
|
||||
{
|
||||
return mRegionp
|
||||
&& mRegionp->getParcelOverlay()
|
||||
&& mRegionp->getParcelOverlay()->isOwnedGroup(getPositionRegion());
|
||||
return mRegionp
|
||||
&& mRegionp->objectIsReturnable(getPositionRegion(), boxes);
|
||||
}
|
||||
|
||||
BOOL LLViewerObject::setParent(LLViewerObject* parent)
|
||||
|
|
@ -1879,7 +1883,6 @@ U32 LLViewerObject::processUpdateMessage(LLMessageSystem *mesgsys,
|
|||
}
|
||||
|
||||
mLatestRecvPacketID = packet_id;
|
||||
mCircuitPacketCount = 0;
|
||||
|
||||
// Set the change flags for scale
|
||||
if (new_scale != getScale())
|
||||
|
|
@ -2202,7 +2205,8 @@ void LLViewerObject::interpolateLinearMotion(const F64 & time, const F32 & dt)
|
|||
LLVector3 new_pos = (vel + (0.5f * (dt-PHYSICS_TIMESTEP)) * accel) * dt;
|
||||
LLVector3 new_v = accel * dt;
|
||||
|
||||
if (time_since_last_update > sPhaseOutUpdateInterpolationTime)
|
||||
if (time_since_last_update > sPhaseOutUpdateInterpolationTime &&
|
||||
sPhaseOutUpdateInterpolationTime > 0.0)
|
||||
{ // Haven't seen a viewer update in a while, check to see if the ciruit is still active
|
||||
if (mRegionp)
|
||||
{ // The simulator will NOT send updates if the object continues normally on the path
|
||||
|
|
@ -2211,9 +2215,12 @@ void LLViewerObject::interpolateLinearMotion(const F64 & time, const F32 & dt)
|
|||
LLCircuitData *cdp = gMessageSystem->mCircuitInfo.findCircuit( mRegionp->getHost() );
|
||||
if (cdp)
|
||||
{
|
||||
// Find out how many seconds since last packet arrived on the circuit
|
||||
F64 time_since_last_packet = LLMessageSystem::getMessageTimeSeconds() - cdp->getLastPacketInTime();
|
||||
|
||||
if (!cdp->isAlive() || // Circuit is dead or blocked
|
||||
cdp->isBlocked() || // or doesn't seem to be getting any packets
|
||||
(mCircuitPacketCount > 0 && mCircuitPacketCount == cdp->getPacketsIn()))
|
||||
(time_since_last_packet > sPhaseOutUpdateInterpolationTime))
|
||||
{
|
||||
// Start to reduce motion interpolation since we haven't seen a server update in a while
|
||||
F64 time_since_last_interpolation = time - mLastInterpUpdateSecs;
|
||||
|
|
@ -2244,9 +2251,6 @@ void LLViewerObject::interpolateLinearMotion(const F64 & time, const F32 & dt)
|
|||
new_pos = new_pos * ((F32) phase_out);
|
||||
new_v = new_v * ((F32) phase_out);
|
||||
}
|
||||
|
||||
// Save current circuit packet count to see if it changes
|
||||
mCircuitPacketCount = cdp->getPacketsIn();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -5100,7 +5104,6 @@ void LLViewerObject::setRegion(LLViewerRegion *regionp)
|
|||
}
|
||||
|
||||
mLatestRecvPacketID = 0;
|
||||
mCircuitPacketCount = 0;
|
||||
mRegionp = regionp;
|
||||
|
||||
for (child_list_t::iterator i = mChildList.begin(); i != mChildList.end(); ++i)
|
||||
|
|
@ -5400,6 +5403,26 @@ void LLViewerObject::setAttachmentItemID(const LLUUID &id)
|
|||
mAttachmentItemID = id;
|
||||
}
|
||||
|
||||
EObjectUpdateType LLViewerObject::getLastUpdateType() const
|
||||
{
|
||||
return mLastUpdateType;
|
||||
}
|
||||
|
||||
void LLViewerObject::setLastUpdateType(EObjectUpdateType last_update_type)
|
||||
{
|
||||
mLastUpdateType = last_update_type;
|
||||
}
|
||||
|
||||
BOOL LLViewerObject::getLastUpdateCached() const
|
||||
{
|
||||
return mLastUpdateCached;
|
||||
}
|
||||
|
||||
void LLViewerObject::setLastUpdateCached(BOOL last_update_cached)
|
||||
{
|
||||
mLastUpdateCached = last_update_cached;
|
||||
}
|
||||
|
||||
const LLUUID &LLViewerObject::extractAttachmentItemID()
|
||||
{
|
||||
LLUUID item_id = LLUUID::null;
|
||||
|
|
|
|||
|
|
@ -77,6 +77,7 @@ typedef enum e_object_update_type
|
|||
OUT_TERSE_IMPROVED,
|
||||
OUT_FULL_COMPRESSED,
|
||||
OUT_FULL_CACHED,
|
||||
OUT_UNKNOWN,
|
||||
} EObjectUpdateType;
|
||||
|
||||
|
||||
|
|
@ -226,12 +227,9 @@ public:
|
|||
virtual BOOL hasLightTexture() const { return FALSE; }
|
||||
|
||||
// This method returns true if the object is over land owned by
|
||||
// the agent.
|
||||
BOOL isOverAgentOwnedLand() const;
|
||||
|
||||
// True if over land owned by group of which the agent is
|
||||
// either officer or member.
|
||||
BOOL isOverGroupOwnedLand() const;
|
||||
// the agent, one of its groups, or it encroaches and
|
||||
// anti-encroachment is enabled
|
||||
bool isReturnable();
|
||||
|
||||
/*
|
||||
// This method will scan through this object, and then query the
|
||||
|
|
@ -615,7 +613,6 @@ protected:
|
|||
F64 mLastInterpUpdateSecs; // Last update for purposes of interpolation
|
||||
F64 mLastMessageUpdateSecs; // Last update from a message from the simulator
|
||||
TPACKETID mLatestRecvPacketID; // Latest time stamp on message from simulator
|
||||
U32 mCircuitPacketCount; // Packet tracking for early detection of a stopped simulator circuit
|
||||
|
||||
// extra data sent from the sim...currently only used for tree species info
|
||||
U8* mData;
|
||||
|
|
@ -696,8 +693,15 @@ public:
|
|||
const LLUUID &getAttachmentItemID() const;
|
||||
void setAttachmentItemID(const LLUUID &id);
|
||||
const LLUUID &extractAttachmentItemID(); // find&set the inventory item ID of the attached object
|
||||
EObjectUpdateType getLastUpdateType() const;
|
||||
void setLastUpdateType(EObjectUpdateType last_update_type);
|
||||
BOOL getLastUpdateCached() const;
|
||||
void setLastUpdateCached(BOOL last_update_cached);
|
||||
|
||||
private:
|
||||
LLUUID mAttachmentItemID; // ItemID of the associated object is in user inventory.
|
||||
EObjectUpdateType mLastUpdateType;
|
||||
BOOL mLastUpdateCached;
|
||||
};
|
||||
|
||||
///////////////////
|
||||
|
|
|
|||
|
|
@ -56,6 +56,7 @@
|
|||
#include "llresmgr.h"
|
||||
#include "llviewerregion.h"
|
||||
#include "llviewerstats.h"
|
||||
#include "llviewerstatsrecorder.h"
|
||||
#include "llvoavatarself.h"
|
||||
#include "lltoolmgr.h"
|
||||
#include "lltoolpie.h"
|
||||
|
|
@ -159,19 +160,13 @@ U64 LLViewerObjectList::getIndex(const U32 local_id,
|
|||
return (((U64)index) << 32) | (U64)local_id;
|
||||
}
|
||||
|
||||
BOOL LLViewerObjectList::removeFromLocalIDTable(const LLViewerObject &object)
|
||||
BOOL LLViewerObjectList::removeFromLocalIDTable(const LLViewerObject* objectp)
|
||||
{
|
||||
if(object.getRegion())
|
||||
if(objectp && objectp->getRegion())
|
||||
{
|
||||
U32 local_id = object.mLocalID;
|
||||
LLHost region_host = object.getRegion()->getHost();
|
||||
if(!region_host.isOk())
|
||||
{
|
||||
return FALSE ;
|
||||
}
|
||||
|
||||
U32 ip = region_host.getAddress();
|
||||
U32 port = region_host.getPort();
|
||||
U32 local_id = objectp->mLocalID;
|
||||
U32 ip = objectp->getRegion()->getHost().getAddress();
|
||||
U32 port = objectp->getRegion()->getHost().getPort();
|
||||
U64 ipport = (((U64)ip) << 32) | (U64)port;
|
||||
U32 index = sIPAndPortToIndex[ipport];
|
||||
|
||||
|
|
@ -186,7 +181,7 @@ BOOL LLViewerObjectList::removeFromLocalIDTable(const LLViewerObject &object)
|
|||
}
|
||||
|
||||
// Found existing entry
|
||||
if (iter->second == object.getID())
|
||||
if (iter->second == objectp->getID())
|
||||
{ // Full UUIDs match, so remove the entry
|
||||
sIndexAndLocalIDToUUID.erase(iter);
|
||||
return TRUE;
|
||||
|
|
@ -302,8 +297,10 @@ void LLViewerObjectList::processObjectUpdate(LLMessageSystem *mesgsys,
|
|||
// have to transform to absolute coordinates.
|
||||
num_objects = mesgsys->getNumberOfBlocksFast(_PREHASH_ObjectData);
|
||||
|
||||
// I don't think this case is ever hit. TODO* Test this.
|
||||
if (!cached && !compressed && update_type != OUT_FULL)
|
||||
{
|
||||
//llinfos << "TEST: !cached && !compressed && update_type != OUT_FULL" << llendl;
|
||||
gTerseObjectUpdates += num_objects;
|
||||
S32 size;
|
||||
if (mesgsys->getReceiveCompressedSize())
|
||||
|
|
@ -314,7 +311,7 @@ void LLViewerObjectList::processObjectUpdate(LLMessageSystem *mesgsys,
|
|||
{
|
||||
size = mesgsys->getReceiveSize();
|
||||
}
|
||||
// llinfos << "Received terse " << num_objects << " in " << size << " byte (" << size/num_objects << ")" << llendl;
|
||||
//llinfos << "Received terse " << num_objects << " in " << size << " byte (" << size/num_objects << ")" << llendl;
|
||||
}
|
||||
else
|
||||
{
|
||||
|
|
@ -345,9 +342,14 @@ void LLViewerObjectList::processObjectUpdate(LLMessageSystem *mesgsys,
|
|||
U8 compressed_dpbuffer[2048];
|
||||
LLDataPackerBinaryBuffer compressed_dp(compressed_dpbuffer, 2048);
|
||||
LLDataPacker *cached_dpp = NULL;
|
||||
|
||||
|
||||
#if LL_RECORD_VIEWER_STATS
|
||||
LLViewerStatsRecorder::instance()->beginObjectUpdateEvents(regionp);
|
||||
#endif
|
||||
|
||||
for (i = 0; i < num_objects; i++)
|
||||
{
|
||||
// timer is unused?
|
||||
LLTimer update_timer;
|
||||
BOOL justCreated = FALSE;
|
||||
|
||||
|
|
@ -359,9 +361,11 @@ void LLViewerObjectList::processObjectUpdate(LLMessageSystem *mesgsys,
|
|||
mesgsys->getU32Fast(_PREHASH_ObjectData, _PREHASH_CRC, crc, i);
|
||||
|
||||
// Lookup data packer and add this id to cache miss lists if necessary.
|
||||
cached_dpp = regionp->getDP(id, crc);
|
||||
U8 cache_miss_type = LLViewerRegion::CACHE_MISS_TYPE_NONE;
|
||||
cached_dpp = regionp->getDP(id, crc, cache_miss_type);
|
||||
if (cached_dpp)
|
||||
{
|
||||
// Cache Hit.
|
||||
cached_dpp->reset();
|
||||
cached_dpp->unpackUUID(fullid, "ID");
|
||||
cached_dpp->unpackU32(local_id, "LocalID");
|
||||
|
|
@ -369,6 +373,11 @@ void LLViewerObjectList::processObjectUpdate(LLMessageSystem *mesgsys,
|
|||
}
|
||||
else
|
||||
{
|
||||
// Cache Miss.
|
||||
#if LL_RECORD_VIEWER_STATS
|
||||
LLViewerStatsRecorder::instance()->recordCacheMissEvent(id, update_type, cache_miss_type);
|
||||
#endif
|
||||
|
||||
continue; // no data packer, skip this object
|
||||
}
|
||||
}
|
||||
|
|
@ -380,13 +389,15 @@ void LLViewerObjectList::processObjectUpdate(LLMessageSystem *mesgsys,
|
|||
compressed_dp.reset();
|
||||
|
||||
U32 flags = 0;
|
||||
if (update_type != OUT_TERSE_IMPROVED)
|
||||
if (update_type != OUT_TERSE_IMPROVED) // OUT_FULL_COMPRESSED only?
|
||||
{
|
||||
mesgsys->getU32Fast(_PREHASH_ObjectData, _PREHASH_UpdateFlags, flags, i);
|
||||
}
|
||||
|
||||
// I don't think we ever use this flag from the server. DK 2010/12/09
|
||||
if (flags & FLAGS_ZLIB_COMPRESSED)
|
||||
{
|
||||
//llinfos << "TEST: flags & FLAGS_ZLIB_COMPRESSED" << llendl;
|
||||
compressed_length = mesgsys->getSizeFast(_PREHASH_ObjectData, i, _PREHASH_Data);
|
||||
mesgsys->getBinaryDataFast(_PREHASH_ObjectData, _PREHASH_Data, compbuffer, 0, i);
|
||||
uncompressed_length = 2048;
|
||||
|
|
@ -402,7 +413,7 @@ void LLViewerObjectList::processObjectUpdate(LLMessageSystem *mesgsys,
|
|||
}
|
||||
|
||||
|
||||
if (update_type != OUT_TERSE_IMPROVED)
|
||||
if (update_type != OUT_TERSE_IMPROVED) // OUT_FULL_COMPRESSED only?
|
||||
{
|
||||
compressed_dp.unpackUUID(fullid, "ID");
|
||||
compressed_dp.unpackU32(local_id, "LocalID");
|
||||
|
|
@ -422,7 +433,7 @@ void LLViewerObjectList::processObjectUpdate(LLMessageSystem *mesgsys,
|
|||
}
|
||||
}
|
||||
}
|
||||
else if (update_type != OUT_FULL)
|
||||
else if (update_type != OUT_FULL) // !compressed, !OUT_FULL ==> OUT_FULL_CACHED only?
|
||||
{
|
||||
mesgsys->getU32Fast(_PREHASH_ObjectData, _PREHASH_ID, local_id, i);
|
||||
getUUIDFromLocal(fullid,
|
||||
|
|
@ -435,7 +446,7 @@ void LLViewerObjectList::processObjectUpdate(LLMessageSystem *mesgsys,
|
|||
mNumUnknownUpdates++;
|
||||
}
|
||||
}
|
||||
else
|
||||
else // OUT_FULL only?
|
||||
{
|
||||
mesgsys->getUUIDFast(_PREHASH_ObjectData, _PREHASH_FullID, fullid, i);
|
||||
mesgsys->getU32Fast(_PREHASH_ObjectData, _PREHASH_ID, local_id, i);
|
||||
|
|
@ -460,19 +471,19 @@ void LLViewerObjectList::processObjectUpdate(LLMessageSystem *mesgsys,
|
|||
// << ", regionp " << (U32) regionp << ", object region " << (U32) objectp->getRegion()
|
||||
// << llendl;
|
||||
//}
|
||||
removeFromLocalIDTable(*objectp);
|
||||
removeFromLocalIDTable(objectp);
|
||||
setUUIDAndLocal(fullid,
|
||||
local_id,
|
||||
gMessageSystem->getSenderIP(),
|
||||
gMessageSystem->getSenderPort());
|
||||
|
||||
if (objectp->mLocalID != local_id)
|
||||
{ // Update local ID in object with the one sent from the region
|
||||
{ // Update local ID in object with the one sent from the region
|
||||
objectp->mLocalID = local_id;
|
||||
}
|
||||
|
||||
if (objectp->getRegion() != regionp)
|
||||
{ // Object changed region, so update it
|
||||
{ // Object changed region, so update it
|
||||
objectp->updateRegion(regionp); // for LLVOAvatar
|
||||
}
|
||||
}
|
||||
|
|
@ -483,18 +494,24 @@ void LLViewerObjectList::processObjectUpdate(LLMessageSystem *mesgsys,
|
|||
{
|
||||
if (update_type == OUT_TERSE_IMPROVED)
|
||||
{
|
||||
// llinfos << "terse update for an unknown object:" << fullid << llendl;
|
||||
// llinfos << "terse update for an unknown object (compressed):" << fullid << llendl;
|
||||
#if LL_RECORD_VIEWER_STATS
|
||||
LLViewerStatsRecorder::instance()->recordObjectUpdateFailure(local_id, update_type);
|
||||
#endif
|
||||
continue;
|
||||
}
|
||||
}
|
||||
else if (cached)
|
||||
else if (cached) // Cache hit only?
|
||||
{
|
||||
}
|
||||
else
|
||||
{
|
||||
if (update_type != OUT_FULL)
|
||||
{
|
||||
// llinfos << "terse update for an unknown object:" << fullid << llendl;
|
||||
//llinfos << "terse update for an unknown object:" << fullid << llendl;
|
||||
#if LL_RECORD_VIEWER_STATS
|
||||
LLViewerStatsRecorder::instance()->recordObjectUpdateFailure(local_id, update_type);
|
||||
#endif
|
||||
continue;
|
||||
}
|
||||
|
||||
|
|
@ -504,7 +521,10 @@ void LLViewerObjectList::processObjectUpdate(LLMessageSystem *mesgsys,
|
|||
if (mDeadObjects.find(fullid) != mDeadObjects.end())
|
||||
{
|
||||
mNumDeadObjectUpdates++;
|
||||
// llinfos << "update for a dead object:" << fullid << llendl;
|
||||
//llinfos << "update for a dead object:" << fullid << llendl;
|
||||
#if LL_RECORD_VIEWER_STATS
|
||||
LLViewerStatsRecorder::instance()->recordObjectUpdateFailure(local_id, update_type);
|
||||
#endif
|
||||
continue;
|
||||
}
|
||||
#endif
|
||||
|
|
@ -512,6 +532,10 @@ void LLViewerObjectList::processObjectUpdate(LLMessageSystem *mesgsys,
|
|||
objectp = createObject(pcode, regionp, fullid, local_id, gMessageSystem->getSender());
|
||||
if (!objectp)
|
||||
{
|
||||
llinfos << "createObject failure for object: " << fullid << llendl;
|
||||
#if LL_RECORD_VIEWER_STATS
|
||||
LLViewerStatsRecorder::instance()->recordObjectUpdateFailure(local_id, update_type);
|
||||
#endif
|
||||
continue;
|
||||
}
|
||||
justCreated = TRUE;
|
||||
|
|
@ -524,19 +548,26 @@ void LLViewerObjectList::processObjectUpdate(LLMessageSystem *mesgsys,
|
|||
llwarns << "Dead object " << objectp->mID << " in UUID map 1!" << llendl;
|
||||
}
|
||||
|
||||
bool bCached = false;
|
||||
if (compressed)
|
||||
{
|
||||
if (update_type != OUT_TERSE_IMPROVED)
|
||||
if (update_type != OUT_TERSE_IMPROVED) // OUT_FULL_COMPRESSED only?
|
||||
{
|
||||
objectp->mLocalID = local_id;
|
||||
}
|
||||
processUpdateCore(objectp, user_data, i, update_type, &compressed_dp, justCreated);
|
||||
if (update_type != OUT_TERSE_IMPROVED)
|
||||
if (update_type != OUT_TERSE_IMPROVED) // OUT_FULL_COMPRESSED only?
|
||||
{
|
||||
bCached = true;
|
||||
#if LL_RECORD_VIEWER_STATS
|
||||
LLViewerRegion::eCacheUpdateResult result = objectp->mRegionp->cacheFullUpdate(objectp, compressed_dp);
|
||||
LLViewerStatsRecorder::instance()->recordCacheFullUpdate(local_id, update_type, result, objectp);
|
||||
#else
|
||||
objectp->mRegionp->cacheFullUpdate(objectp, compressed_dp);
|
||||
#endif
|
||||
}
|
||||
}
|
||||
else if (cached)
|
||||
else if (cached) // Cache hit only?
|
||||
{
|
||||
objectp->mLocalID = local_id;
|
||||
processUpdateCore(objectp, user_data, i, update_type, cached_dpp, justCreated);
|
||||
|
|
@ -549,8 +580,17 @@ void LLViewerObjectList::processObjectUpdate(LLMessageSystem *mesgsys,
|
|||
}
|
||||
processUpdateCore(objectp, user_data, i, update_type, NULL, justCreated);
|
||||
}
|
||||
#if LL_RECORD_VIEWER_STATS
|
||||
LLViewerStatsRecorder::instance()->recordObjectUpdateEvent(local_id, update_type, objectp);
|
||||
#endif
|
||||
objectp->setLastUpdateType(update_type);
|
||||
objectp->setLastUpdateCached(bCached);
|
||||
}
|
||||
|
||||
#if LL_RECORD_VIEWER_STATS
|
||||
LLViewerStatsRecorder::instance()->endObjectUpdateEvents();
|
||||
#endif
|
||||
|
||||
LLVOAvatar::cullAvatarsByPixelArea();
|
||||
}
|
||||
|
||||
|
|
@ -681,12 +721,12 @@ void LLViewerObjectList::update(LLAgent &agent, LLWorld &world)
|
|||
|
||||
// update global timer
|
||||
F32 last_time = gFrameTimeSeconds;
|
||||
U64 time = totalTime(); // this will become the new gFrameTime when the update is done
|
||||
U64 time = totalTime(); // this will become the new gFrameTime when the update is done
|
||||
// Time _can_ go backwards, for example if the user changes the system clock.
|
||||
// It doesn't cause any fatal problems (just some oddness with stats), so we shouldn't assert here.
|
||||
// llassert(time > gFrameTime);
|
||||
F64 time_diff = U64_to_F64(time - gFrameTime)/(F64)SEC_TO_MICROSEC;
|
||||
gFrameTime = time;
|
||||
gFrameTime = time;
|
||||
F64 time_since_start = U64_to_F64(gFrameTime - gStartTime)/(F64)SEC_TO_MICROSEC;
|
||||
gFrameTimeSeconds = (F32)time_since_start;
|
||||
|
||||
|
|
@ -788,7 +828,7 @@ void LLViewerObjectList::update(LLAgent &agent, LLWorld &world)
|
|||
{
|
||||
std::string id_str;
|
||||
objectp->mID.toString(id_str);
|
||||
std::string tmpstr = std::string("Par: ") + id_str;
|
||||
std::string tmpstr = std::string("Par: ") + id_str;
|
||||
addDebugBeacon(objectp->getPositionAgent(),
|
||||
tmpstr,
|
||||
LLColor4(1.f,0.f,0.f,1.f),
|
||||
|
|
@ -808,12 +848,12 @@ void LLViewerObjectList::update(LLAgent &agent, LLWorld &world)
|
|||
std::string tmpstr;
|
||||
if (objectp->getParent())
|
||||
{
|
||||
tmpstr = std::string("ChP: ") + id_str;
|
||||
tmpstr = std::string("ChP: ") + id_str;
|
||||
text_color = LLColor4(0.f, 1.f, 0.f, 1.f);
|
||||
}
|
||||
else
|
||||
{
|
||||
tmpstr = std::string("ChNoP: ") + id_str;
|
||||
tmpstr = std::string("ChNoP: ") + id_str;
|
||||
text_color = LLColor4(1.f, 0.f, 0.f, 1.f);
|
||||
}
|
||||
id = sIndexAndLocalIDToUUID[oi.mParentInfo];
|
||||
|
|
@ -864,7 +904,7 @@ void LLViewerObjectList::cleanupReferences(LLViewerObject *objectp)
|
|||
// << objectp->getRegion()->getHost().getPort() << llendl;
|
||||
//}
|
||||
|
||||
removeFromLocalIDTable(*objectp);
|
||||
removeFromLocalIDTable(objectp);
|
||||
|
||||
if (objectp->onActiveList())
|
||||
{
|
||||
|
|
@ -1519,8 +1559,8 @@ void LLViewerObjectList::findOrphans(LLViewerObject* objectp, U32 ip, U32 port)
|
|||
llinfos << "Agent: " << objectp->getPositionAgent() << llendl;
|
||||
addDebugBeacon(objectp->getPositionAgent(),"");
|
||||
#endif
|
||||
gPipeline.markMoved(objectp->mDrawable);
|
||||
objectp->setChanged(LLXform::MOVED | LLXform::SILHOUETTE);
|
||||
gPipeline.markMoved(objectp->mDrawable);
|
||||
objectp->setChanged(LLXform::MOVED | LLXform::SILHOUETTE);
|
||||
|
||||
// Flag the object as no longer orphaned
|
||||
childp->mOrphaned = FALSE;
|
||||
|
|
|
|||
|
|
@ -160,7 +160,7 @@ public:
|
|||
const U32 ip,
|
||||
const U32 port); // Requires knowledge of message system info!
|
||||
|
||||
static BOOL removeFromLocalIDTable(const LLViewerObject &object);
|
||||
static BOOL removeFromLocalIDTable(const LLViewerObject* objectp);
|
||||
// Used ONLY by the orphaned object code.
|
||||
static U64 getIndex(const U32 local_id, const U32 ip, const U32 port);
|
||||
|
||||
|
|
|
|||
|
|
@ -145,6 +145,35 @@ BOOL LLViewerParcelOverlay::isOwnedOther(const LLVector3& pos) const
|
|||
return (PARCEL_OWNED == overlay || PARCEL_FOR_SALE == overlay);
|
||||
}
|
||||
|
||||
bool LLViewerParcelOverlay::encroachesOwned(const std::vector<LLBBox>& boxes) const
|
||||
{
|
||||
// boxes are expected to already be axis aligned
|
||||
for (U32 i = 0; i < boxes.size(); ++i)
|
||||
{
|
||||
LLVector3 min = boxes[i].getMinAgent();
|
||||
LLVector3 max = boxes[i].getMaxAgent();
|
||||
|
||||
S32 left = S32(llclamp((min.mV[VX] / PARCEL_GRID_STEP_METERS), 0.f, REGION_WIDTH_METERS - 1));
|
||||
S32 right = S32(llclamp((max.mV[VX] / PARCEL_GRID_STEP_METERS), 0.f, REGION_WIDTH_METERS - 1));
|
||||
S32 top = S32(llclamp((min.mV[VY] / PARCEL_GRID_STEP_METERS), 0.f, REGION_WIDTH_METERS - 1));
|
||||
S32 bottom = S32(llclamp((max.mV[VY] / PARCEL_GRID_STEP_METERS), 0.f, REGION_WIDTH_METERS - 1));
|
||||
|
||||
for (S32 row = top; row <= bottom; row++)
|
||||
{
|
||||
for (S32 column = left; column <= right; column++)
|
||||
{
|
||||
U8 type = ownership(row, column);
|
||||
if ((PARCEL_SELF == type)
|
||||
|| (PARCEL_GROUP == type))
|
||||
{
|
||||
return true;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
BOOL LLViewerParcelOverlay::isSoundLocal(const LLVector3& pos) const
|
||||
{
|
||||
S32 row = S32(pos.mV[VY] / PARCEL_GRID_STEP_METERS);
|
||||
|
|
|
|||
|
|
@ -30,6 +30,7 @@
|
|||
// The ownership data for land parcels.
|
||||
// One of these structures per region.
|
||||
|
||||
#include "llbbox.h"
|
||||
#include "lldarray.h"
|
||||
#include "llframetimer.h"
|
||||
#include "lluuid.h"
|
||||
|
|
@ -54,6 +55,12 @@ public:
|
|||
BOOL isOwnedSelf(const LLVector3& pos) const;
|
||||
BOOL isOwnedGroup(const LLVector3& pos) const;
|
||||
BOOL isOwnedOther(const LLVector3& pos) const;
|
||||
|
||||
// "encroaches" means the prim hangs over the parcel, but its center
|
||||
// might be in another parcel. for now, we simply test axis aligned
|
||||
// bounding boxes which isn't perfect, but is close
|
||||
bool encroachesOwned(const std::vector<LLBBox>& boxes) const;
|
||||
|
||||
BOOL isSoundLocal(const LLVector3& pos) const;
|
||||
|
||||
BOOL isBuildCameraAllowed(const LLVector3& pos) const;
|
||||
|
|
|
|||
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in New Issue