Merge LL V3.7.11

Ansariel 2015-01-12 12:54:15 +01:00
commit a45088cb6b
165 changed files with 24450 additions and 3168 deletions

View File

@ -521,3 +521,4 @@ d029faf69f20a23007f32420a1ac6a3b89a6d441 3.7.6-release
bba9b3722eea08949e4ff69591f736bf0f808434 3.7.8-release
a9f2d0cb11f73b06858e6083bb50083becc3f9cd 3.7.9-release
91dae9494b4d147541c7a01902334ba19a7ec05e 3.7.10-release
64799eb298834073a3e9992cd8d27c3cb9d30b10 3.7.11-release

View File

@ -55,21 +55,9 @@ Amazon_viewer_channel_suffix = "Amazon"
Desura_sourceid = "1208_desura"
Desura_viewer_channel_suffix = "Desura"
# Report changes since...
viewer-development.show_changes_since = last_sprint
# Build Settings
viewer-development.build_debug_release_separately = true
# Notifications - to configure email notices, add a setting like this:
# <username>_<reponame>.email = <email-address>
viewer-release.viewer_channel = "Second Life Release"
viewer-release.build_debug_release_separately = true
viewer-release.build_viewer_update_version_manager = true
viewer-release.codeticket_add_context = false
# ========================================
# mesh-development
# ========================================
@ -121,25 +109,6 @@ viewer-mesh.viewer_channel = "Project Viewer - Mesh"
viewer-mesh.viewer_grid = aditi
viewer-mesh.email = shining@lists.lindenlab.com
# ========================================
# viewer-pathfinding
# ========================================
viewer-pathfinding.viewer_channel = "Project Viewer - Pathfinding"
viewer-pathfinding.viewer_grid = agni
viewer-pathfinding.build_debug_release_separately = true
viewer-pathfinding.build_CYGWIN_Debug = false
viewer-pathfinding.build_viewer_update_version_manager = false
# ========================================
# viewer-materials
# ========================================
viewer-materials.viewer_channel = "Second Life Beta Materials"
viewer-materials.build_debug_release_separately = true
viewer-materials.build_CYGWIN_Debug = false
viewer-materials.build_viewer_update_version_manager = false
# =================================================================
# asset delivery 2010 projects
# =================================================================

View File

@ -1691,14 +1691,14 @@
</map>
</map>
</map>
<key>libxml</key>
<key>libxml2</key>
<map>
<key>license</key>
<string>mit</string>
<key>license_file</key>
<string>LICENSES/libxml.txt</string>
<string>LICENSES/libxml2.txt</string>
<key>name</key>
<string>libxml</string>
<string>libxml2</string>
<key>platforms</key>
<map>
<key>linux</key>
@ -1706,9 +1706,9 @@
<key>archive</key>
<map>
<key>hash</key>
<string>6414642528f42dac1cd9a012c99cd748</string>
<string>fd34e3e818ad7dd26add1f05e6069c11</string>
<key>url</key>
<string>http://s3.amazonaws.com/viewer-source-downloads/install_pkgs/libxml-2.6.24-linux-20101013.tar.bz2</string>
<string>http://automated-builds-secondlife-com.s3.amazonaws.com/hg/repo/3p-libxml/rev/282218/arch/Linux/installer/libxml2-2.7.8-linux-20131009.tar.bz2</string>
</map>
<key>name</key>
<string>linux</string>
@ -3316,7 +3316,7 @@
<string>make</string>
<key>options</key>
<array>
<string>-j 2</string>
<string>-j 7</string>
</array>
</map>
<key>configure</key>
@ -3420,7 +3420,7 @@
<string>make</string>
<key>options</key>
<array>
<string>-j 2</string>
<string>-j 7</string>
</array>
</map>
<key>configure</key>
@ -3542,7 +3542,7 @@
<string>make</string>
<key>options</key>
<array>
<string>-j 2</string>
<string>-j 7</string>
</array>
</map>
<key>configure</key>

View File

@ -180,6 +180,8 @@ Ansariel Hiller
MAINT-2368
STORM-1931
MAINT-2773
STORM-2011
MAINT-3187
BUG-3764
STORM-1984
STORM-1979
@ -313,11 +315,14 @@ Cinder Roxley
BUG-3863
OPEN-185
STORM-1703
STORM-1948
STORM-1948
STORM-1831
STORM-1888
STORM-1958
STORM-1952
STORM-1951
STORM-2035
STORM-2036
Clara Young
Coaldust Numbers
VWR-1095
@ -330,7 +335,9 @@ Cron Stardust
VWR-25120
STORM-1075
STORM-1919
BUG-885
STORM-1920
OPEN-209
STORM-2017
Cypren Christenson
STORM-417
Dante Tucker
@ -520,8 +527,16 @@ Ima Mechanique
STORM-959
STORM-1175
STORM-1708
STORM-1831
STORM-1832
STORM-1855
VWR-10791
VWR-20553
VWR-19213
VWR-22401
VWR-23739
VWR-24766
VWR-28065
Imnotgoing Sideways
Inma Rau
Innula Zenovka
@ -664,6 +679,7 @@ Jonathan Yap
STORM-1809
STORM-1793
STORM-1810
STORM-68
STORM-1838
STORM-1892
STORM-1894
@ -674,12 +690,15 @@ Jonathan Yap
STORM-1858
STORM-1862
STORM-1918
STORM-1915
STORM-1929
STORM-1953
OPEN-161
STORM-1953
STORM-1957
STORM-1993
STORM-2017
STORM-2007
STORM-1980
OPEN-113
STORM-1975
@ -692,6 +711,8 @@ Jonathan Yap
STORM-1987
STORM-1986
STORM-1981
STORM-2015
STORM-2018
Kadah Coba
STORM-1060
STORM-1843
@ -745,6 +766,7 @@ Kunnis Basiat
Lance Corrimal
STORM-1910
VWR-25269
STORM-2008
Latif Khalifa
VWR-5370
leliel Mirihi
@ -961,6 +983,7 @@ Nicky Dasmijn
OPEN-187
STORM-1937
OPEN-187
STORM-2010
Nicky Perian
OPEN-1
STORM-1087
@ -1158,6 +1181,7 @@ snowy Sidran
Sovereign Engineer
MAINT-2334
OPEN-189
STORM-1972
OPEN-195
SpacedOut Frye
VWR-34
@ -1199,6 +1223,7 @@ Takeda Terrawyng
TankMaster Finesmith
OPEN-140
OPEN-142
OPEN-154
STORM-1100
STORM-1258
STORM-1602
@ -1421,7 +1446,3 @@ Zipherius Turas
VWR-77
Zoex Flanagan

View File

@ -82,10 +82,10 @@ add_subdirectory(${LIBS_OPEN_PREFIX}llplugin)
add_subdirectory(${LIBS_OPEN_PREFIX}llui)
add_subdirectory(${LIBS_OPEN_PREFIX}viewer_components)
if (LL_TESTS OR NOT STANDALONE)
if (LL_TESTS OR NOT USESYSTEMLIBS)
# Legacy C++ tests. Build always, run if LL_TESTS is true.
add_subdirectory(${VIEWER_PREFIX}test)
endif (LL_TESTS OR NOT STANDALONE)
endif (LL_TESTS OR NOT USESYSTEMLIBS)
# viewer media plugins
if( NOT (WINDOWS OR DARWIN) OR NOT ND_BUILD64BIT_ARCH )

View File

@ -246,12 +246,12 @@ if (LINUX)
endif (WORD_SIZE EQUAL 32)
add_definitions(-mfpmath=sse)
#add_definitions(-ftree-vectorize) # THIS CRASHES GCC 3.1-3.2
if (NOT STANDALONE)
if (NOT USESYSTEMLIBS)
# this stops us requiring a really recent glibc at runtime
add_definitions(-fno-stack-protector)
# linking can be very memory-hungry, especially the final viewer link
set(CMAKE_CXX_LINK_FLAGS "-Wl,--no-keep-memory -Wl,--build-id -Wl,-rpath,'$ORIGIN:$ORIGIN/../lib'")
endif (NOT STANDALONE)
endif (NOT USESYSTEMLIBS)
# <FS:TS> Enable AVX optimizations if requested and at least GCC 4.6.
if (USE_AVX_OPTIMIZATION)
@ -344,14 +344,14 @@ if (LINUX OR DARWIN)
endif (LINUX OR DARWIN)
if (STANDALONE)
add_definitions(-DLL_STANDALONE=1)
if (USESYSTEMLIBS)
add_definitions(-DLL_USESYSTEMLIBS=1)
if (LINUX AND ${ARCH} STREQUAL "i686")
add_definitions(-march=pentiumpro)
endif (LINUX AND ${ARCH} STREQUAL "i686")
else (STANDALONE)
else (USESYSTEMLIBS)
set(${ARCH}_linux_INCLUDES
atk-1.0
cairo
@ -361,6 +361,6 @@ else (STANDALONE)
gtk-2.0
pango-1.0
)
endif (STANDALONE)
endif (USESYSTEMLIBS)
endif(NOT DEFINED ${CMAKE_CURRENT_LIST_FILE}_INCLUDED)

View File

@ -8,9 +8,9 @@ set(APR_FIND_REQUIRED ON)
set(APRUTIL_FIND_QUIETLY ON)
set(APRUTIL_FIND_REQUIRED ON)
if (STANDALONE)
if (USESYSTEMLIBS)
include(FindAPR)
else (STANDALONE)
else (USESYSTEMLIBS)
use_prebuilt_binary(apr_suite)
if (WINDOWS)
if (LLCOMMON_LINK_SHARED)
@ -52,4 +52,4 @@ else (STANDALONE)
list(APPEND APRUTIL_LIBRARIES ${DB_LIBRARIES} uuid)
list(APPEND APRUTIL_LIBRARIES ${DB_LIBRARIES} rt)
endif (LINUX)
endif (STANDALONE)
endif (USESYSTEMLIBS)

View File

@ -1,13 +1,13 @@
# -*- cmake -*-
include(Prebuilt)
if (STANDALONE)
if (USESYSTEMLIBS)
include(FindPkgConfig)
pkg_check_modules(OGG REQUIRED ogg)
pkg_check_modules(VORBIS REQUIRED vorbis)
pkg_check_modules(VORBISENC REQUIRED vorbisenc)
pkg_check_modules(VORBISFILE REQUIRED vorbisfile)
else (STANDALONE)
else (USESYSTEMLIBS)
use_prebuilt_binary(ogg-vorbis)
set(VORBIS_INCLUDE_DIRS ${LIBS_PREBUILT_DIR}/include)
set(VORBISENC_INCLUDE_DIRS ${VORBIS_INCLUDE_DIRS})
@ -32,7 +32,7 @@ else (STANDALONE)
set(VORBISENC_LIBRARIES vorbisenc)
set(VORBISFILE_LIBRARIES vorbisfile)
endif (WINDOWS)
endif (STANDALONE)
endif (USESYSTEMLIBS)
link_directories(
${VORBIS_LIBRARY_DIRS}

View File

@ -3,9 +3,9 @@
set(DB_FIND_QUIETLY ON)
set(DB_FIND_REQUIRED ON)
if (STANDALONE)
if (USESYSTEMLIBS)
include(FindBerkeleyDB)
else (STANDALONE)
else (USESYSTEMLIBS)
if (LINUX)
# Need to add dependency pthread explicitely to support ld.gold.
use_prebuilt_binary(db)
@ -14,4 +14,4 @@ else (STANDALONE)
set(DB_LIBRARIES db-4.2)
endif (LINUX)
set(DB_INCLUDE_DIRS ${LIBS_PREBUILT_DIR}/include)
endif (STANDALONE)
endif (USESYSTEMLIBS)

View File

@ -4,7 +4,7 @@ include(Prebuilt)
set(Boost_FIND_QUIETLY ON)
set(Boost_FIND_REQUIRED ON)
if (STANDALONE)
if (USESYSTEMLIBS)
include(FindBoost)
# <FS:TS> boost::context isn't used, so don't try to include it
@ -16,7 +16,7 @@ if (STANDALONE)
set(BOOST_SYSTEM_LIBRARY boost_system-mt)
set(BOOST_THREAD_LIBRARY boost_thread-mt)
set(BOOST_WAVE_LIBRARY boost_wave-mt)
else (STANDALONE)
else (USESYSTEMLIBS)
use_prebuilt_binary(boost)
set(Boost_INCLUDE_DIRS ${LIBS_PREBUILT_DIR}/include)
set(BOOST_VERSION "1.52")
@ -128,4 +128,4 @@ else (STANDALONE)
optimized boost_wave-mt
debug boost_wave-mt-d)
endif (WINDOWS)
endif (STANDALONE)
endif (USESYSTEMLIBS)

View File

@ -5,9 +5,9 @@ include(Prebuilt)
set(CARES_FIND_QUIETLY ON)
set(CARES_FIND_REQUIRED ON)
if (STANDALONE)
if (USESYSTEMLIBS)
include(FindCARes)
else (STANDALONE)
else (USESYSTEMLIBS)
use_prebuilt_binary(ares)
add_definitions("-DCARES_STATICLIB")
if (WINDOWS)
@ -18,4 +18,4 @@ else (STANDALONE)
set(CARES_LIBRARIES cares)
endif (WINDOWS)
set(CARES_INCLUDE_DIRS ${LIBS_PREBUILT_DIR}/include/ares)
endif (STANDALONE)
endif (USESYSTEMLIBS)

View File

@ -4,9 +4,9 @@ include(Prebuilt)
set(CURL_FIND_QUIETLY ON)
set(CURL_FIND_REQUIRED ON)
if (STANDALONE)
if (USESYSTEMLIBS)
include(FindCURL)
else (STANDALONE)
else (USESYSTEMLIBS)
use_prebuilt_binary(curl)
if (WINDOWS)
set(CURL_LIBRARIES
@ -22,4 +22,4 @@ else (STANDALONE)
endif (DARWIN)
endif (WINDOWS)
set(CURL_INCLUDE_DIRS ${LIBS_PREBUILT_DIR}/include)
endif (STANDALONE)
endif (USESYSTEMLIBS)

View File

@ -1,15 +1,15 @@
# -*- cmake -*-
include (Prebuilt)
if (STANDALONE)
if (USESYSTEMLIBS)
find_path(COLLADA_INCLUDE_DIRS 1.4/dom/domConstants.h
PATH_SUFFIXES collada)
set(COLLADA_INCLUDE_DIRS
${COLLADA_INCLUDE_DIRS} ${COLLADA_INCLUDE_DIRS}/1.4
)
else (STANDALONE)
else (USESYSTEMLIBS)
set(COLLADA_INCLUDE_DIRS
${LIBS_PREBUILT_DIR}/include/collada
${LIBS_PREBUILT_DIR}/include/collada/1.4
)
endif (STANDALONE)
endif (USESYSTEMLIBS)

View File

@ -434,9 +434,9 @@ copy_if_different(
)
set(third_party_targets ${third_party_targets} ${out_targets})
if(NOT STANDALONE)
if(NOT USESYSTEMLIBS)
add_custom_target(
stage_third_party_libs ALL
DEPENDS ${third_party_targets}
)
endif(NOT STANDALONE)
endif(NOT USESYSTEMLIBS)

View File

@ -1,7 +1,7 @@
# -*- cmake -*-
include(Prebuilt)
if (STANDALONE)
if (USESYSTEMLIBS)
include(FindPkgConfig)
pkg_check_modules(DBUSGLIB REQUIRED dbus-glib-1)
@ -18,7 +18,7 @@ elseif (LINUX)
gobject-2.0
glib-2.0
)
endif (STANDALONE)
endif (USESYSTEMLIBS)
if (DBUSGLIB_FOUND)
set(DBUSGLIB ON CACHE BOOL "Build with dbus-glib message bus support.")

View File

@ -4,9 +4,9 @@ include(Prebuilt)
set(EXPAT_FIND_QUIETLY ON)
set(EXPAT_FIND_REQUIRED ON)
if (STANDALONE)
if (USESYSTEMLIBS)
include(FindEXPAT)
else (STANDALONE)
else (USESYSTEMLIBS)
use_prebuilt_binary(expat)
if (WINDOWS)
set(EXPAT_LIBRARIES libexpatMT)
@ -14,4 +14,4 @@ else (STANDALONE)
set(EXPAT_LIBRARIES expat)
endif (WINDOWS)
set(EXPAT_INCLUDE_DIRS ${LIBS_PREBUILT_DIR}/include)
endif (STANDALONE)
endif (USESYSTEMLIBS)

View File

@ -2,13 +2,13 @@
include(Linking)
include(Prebuilt)
if (STANDALONE)
if (USESYSTEMLIBS)
set(EXAMPLEPLUGIN OFF CACHE BOOL
"EXAMPLEPLUGIN support for the llplugin/llmedia test apps.")
else (STANDALONE)
else (USESYSTEMLIBS)
set(EXAMPLEPLUGIN ON CACHE BOOL
"EXAMPLEPLUGIN support for the llplugin/llmedia test apps.")
endif (STANDALONE)
endif (USESYSTEMLIBS)
if (WINDOWS)
elseif (DARWIN)

View File

@ -4,17 +4,17 @@
# When building using proprietary binaries though (i.e. having access to LL private servers),
# we always build with FMODEX.
# Open source devs should use the -DFMODEX:BOOL=ON then if they want to build with FMOD, whether
# they are using STANDALONE or not.
# they are using USESYSTEMLIBS or not.
if (INSTALL_PROPRIETARY)
set(FMODEX ON CACHE BOOL "Using FMOD Ex sound library.")
endif (INSTALL_PROPRIETARY)
if (FMODEX)
if (STANDALONE)
if (USESYSTEMLIBS)
# In that case, we use the version of the library installed on the system
set(FMODEX_FIND_REQUIRED ON)
include(FindFMODEX)
else (STANDALONE)
else (USESYSTEMLIBS)
if (FMODEX_LIBRARY AND FMODEX_INCLUDE_DIR)
# If the path have been specified in the arguments, use that
set(FMODEX_LIBRARIES ${FMODEX_LIBRARY})
@ -53,6 +53,6 @@ if (FMODEX)
set(FMODEX_LIBRARIES ${FMODEX_LIBRARY})
set(FMODEX_INCLUDE_DIR ${LIBS_PREBUILT_DIR}/include/fmodex)
endif (FMODEX_LIBRARY AND FMODEX_INCLUDE_DIR)
endif (STANDALONE)
endif (USESYSTEMLIBS)
endif (FMODEX)

View File

@ -1,14 +1,14 @@
# -*- cmake -*-
include(Prebuilt)
if (STANDALONE)
if (USESYSTEMLIBS)
include(FindPkgConfig)
pkg_check_modules(FREETYPE REQUIRED freetype2)
else (STANDALONE)
else (USESYSTEMLIBS)
use_prebuilt_binary(freetype)
set(FREETYPE_INCLUDE_DIRS ${LIBS_PREBUILT_DIR}/include)
set(FREETYPE_LIBRARIES freetype)
endif (STANDALONE)
endif (USESYSTEMLIBS)
link_directories(${FREETYPE_LIBRARY_DIRS})

View File

@ -1,8 +1,8 @@
# -*- cmake -*-
include(Prebuilt)
if (NOT STANDALONE)
if (NOT USESYSTEMLIBS)
use_prebuilt_binary(glext)
use_prebuilt_binary(glh_linear)
set(GLEXT_INCLUDE_DIR ${LIBS_PREBUILT_DIR}/include)
endif (NOT STANDALONE)
endif (NOT USESYSTEMLIBS)

View File

@ -4,8 +4,8 @@ include(Prebuilt)
set(GLH_FIND_REQUIRED TRUE)
set(GLH_FIND_QUIETLY TRUE)
if (STANDALONE)
if (USESYSTEMLIBS)
include(FindGLH)
else (STANDALONE)
else (USESYSTEMLIBS)
use_prebuilt_binary(glh_linear)
endif (STANDALONE)
endif (USESYSTEMLIBS)

View File

@ -1,11 +1,11 @@
# -*- cmake -*-
if (STANDALONE)
if (USESYSTEMLIBS)
set(GLOD_FIND_REQUIRED true)
include(FindGLOD)
else (STANDALONE)
else (USESYSTEMLIBS)
include(Prebuilt)
use_prebuilt_binary(GLOD)
set(GLOD_INCLUDE_DIR ${LIBS_PREBUILT_DIR}/include)
set(GLOD_LIBRARIES GLOD)
endif (STANDALONE)
endif (USESYSTEMLIBS)

View File

@ -1,15 +1,15 @@
# -*- cmake -*-
include(Prebuilt)
if (STANDALONE)
if (USESYSTEMLIBS)
include(FindPkgConfig)
pkg_check_modules(GSTREAMER010 REQUIRED gstreamer-0.10)
pkg_check_modules(GSTREAMER010_PLUGINS_BASE REQUIRED gstreamer-plugins-base-0.10)
elseif (LINUX)
use_prebuilt_binary(gstreamer)
# possible libxml should have its own .cmake file instead
use_prebuilt_binary(libxml)
# possible libxml2 should have its own .cmake file instead
use_prebuilt_binary(libxml2)
set(GSTREAMER010_FOUND ON FORCE BOOL)
set(GSTREAMER010_PLUGINS_BASE_FOUND ON FORCE BOOL)
set(GSTREAMER010_INCLUDE_DIRS
@ -26,7 +26,7 @@ elseif (LINUX)
gthread-2.0
glib-2.0
)
endif (STANDALONE)
endif (USESYSTEMLIBS)
if (GSTREAMER010_FOUND AND GSTREAMER010_PLUGINS_BASE_FOUND)
set(GSTREAMER010 ON CACHE BOOL "Build with GStreamer-0.10 streaming media support.")

View File

@ -2,14 +2,14 @@
include(Linking)
include(Prebuilt)
if (STANDALONE)
if (USESYSTEMLIBS)
set(GLUI OFF CACHE BOOL
"GLUI support for the llplugin/llmedia test apps.")
else (STANDALONE)
else (USESYSTEMLIBS)
use_prebuilt_binary(glui)
set(GLUI ON CACHE BOOL
"GLUI support for the llplugin/llmedia test apps.")
endif (STANDALONE)
endif (USESYSTEMLIBS)
if (LINUX)
set(GLUI ON CACHE BOOL

View File

@ -4,10 +4,10 @@ include(Prebuilt)
# <FS:ND> We only ever need google breakpad when crash reporting is used
if(RELEASE_CRASH_REPORTING OR NON_RELEASE_CRASH_REPORTING)
if (STANDALONE)
if (USESYSTEMLIBS)
set(BREAKPAD_EXCEPTION_HANDLER_FIND_REQUIRED ON)
include(FindGoogleBreakpad)
else (STANDALONE)
else (USESYSTEMLIBS)
use_prebuilt_binary(google_breakpad)
if (DARWIN)
set(BREAKPAD_EXCEPTION_HANDLER_LIBRARIES exception_handler)
@ -21,7 +21,7 @@ else (STANDALONE)
# yes, this does look dumb, no, it's not incorrect
#
set(BREAKPAD_INCLUDE_DIRECTORIES "${LIBS_PREBUILT_DIR}/include/google_breakpad" "${LIBS_PREBUILT_DIR}/include/google_breakpad/google_breakpad")
endif (STANDALONE)
endif (USESYSTEMLIBS)
# <FS:ND> Otherwise just disable it
else(RELEASE_CRASH_REPORTING OR NON_RELEASE_CRASH_REPORTING)

View File

@ -6,9 +6,9 @@ include(Prebuilt)
#set (USE_TCMALLOC ON)
set (USE_TCMALLOC OFF) # <FS:ND> tcmalloc removal
if (STANDALONE)
if (USESYSTEMLIBS)
include(FindGooglePerfTools)
else (STANDALONE)
else (USESYSTEMLIBS)
if (WINDOWS)
if (USE_TCMALLOC)
use_prebuilt_binary(gperftools)
@ -35,7 +35,7 @@ else (STANDALONE)
${LIBS_PREBUILT_DIR}/include)
set(GOOGLE_PERFTOOLS_FOUND "YES")
endif (LINUX)
endif (STANDALONE)
endif (USESYSTEMLIBS)
if (GOOGLE_PERFTOOLS_FOUND)
# XXX Disable temporarily, until we have compilation issues on 64-bit

View File

@ -2,7 +2,7 @@
# Growl is actually libnotify on linux systems.
if (STANDALONE)
if (USESYSTEMLIBS)
if( LINUX )
add_definitions( -DHAS_GROWL)
endif( LINUX )
@ -10,7 +10,7 @@ if (STANDALONE)
#include(FindLibnotify)
#set(GROWL_INCLUDE_DIRS ${LIBNOTIFY_INCLUDE_DIR})
#set(GROWL_LIBRARY ${LIBNOTIFY_LIBRARIES})
else (STANDALONE)
else (USESYSTEMLIBS)
if (DARWIN OR WINDOWS)
include(Prebuilt)
use_prebuilt_binary(Growl)
@ -20,4 +20,4 @@ else (STANDALONE)
elseif (LINUX)
add_definitions( -DHAS_GROWL)
endif ()
endif (STANDALONE)
endif (USESYSTEMLIBS)

View File

@ -4,9 +4,9 @@ include(Prebuilt)
set(HUNSPELL_FIND_QUIETLY ON)
set(HUNSPELL_FIND_REQUIRED ON)
if (STANDALONE)
if (USESYSTEMLIBS)
include(FindHUNSPELL)
else (STANDALONE)
else (USESYSTEMLIBS)
use_prebuilt_binary(libhunspell)
if (WINDOWS)
set(HUNSPELL_LIBRARY libhunspell)
@ -19,4 +19,4 @@ else (STANDALONE)
endif()
set(HUNSPELL_INCLUDE_DIRS ${LIBS_PREBUILT_DIR}/include/hunspell)
use_prebuilt_binary(dictionaries)
endif (STANDALONE)
endif (USESYSTEMLIBS)

View File

@ -5,9 +5,9 @@ include(Linking)
set(JPEG_FIND_QUIETLY ON)
set(JPEG_FIND_REQUIRED ON)
if (STANDALONE)
if (USESYSTEMLIBS)
include(FindJPEG)
else (STANDALONE)
else (USESYSTEMLIBS)
use_prebuilt_binary(jpeglib)
if (LINUX)
set(JPEG_LIBRARIES jpeg)
@ -17,4 +17,4 @@ else (STANDALONE)
set(JPEG_LIBRARIES jpeglib)
endif (LINUX)
set(JPEG_INCLUDE_DIRS ${LIBS_PREBUILT_DIR}/include)
endif (STANDALONE)
endif (USESYSTEMLIBS)

View File

@ -5,9 +5,9 @@ include(Prebuilt)
set(JSONCPP_FIND_QUIETLY ON)
set(JSONCPP_FIND_REQUIRED ON)
if (STANDALONE)
if (USESYSTEMLIBS)
include(FindJsonCpp)
else (STANDALONE)
else (USESYSTEMLIBS)
use_prebuilt_binary(jsoncpp)
if (WINDOWS)
set(JSONCPP_LIBRARIES
@ -23,4 +23,4 @@ else (STANDALONE)
endif (ND_BUILD64BIT_ARCH)
endif (WINDOWS)
set(JSONCPP_INCLUDE_DIR "${LIBS_PREBUILT_DIR}/include/jsoncpp" "${LIBS_PREBUILT_DIR}/include/json")
endif (STANDALONE)
endif (USESYSTEMLIBS)

10
indra/cmake/LLAddBuildTest.cmake Executable file → Normal file
View File

@ -207,9 +207,9 @@ FUNCTION(LL_ADD_INTEGRATION_TEST
ADD_EXECUTABLE(INTEGRATION_TEST_${testname} ${source_files})
SET_TARGET_PROPERTIES(INTEGRATION_TEST_${testname} PROPERTIES RUNTIME_OUTPUT_DIRECTORY "${EXE_STAGING_DIR}")
if(STANDALONE)
if(USESYSTEMLIBS)
SET_TARGET_PROPERTIES(INTEGRATION_TEST_${testname} PROPERTIES COMPILE_FLAGS -I"${TUT_INCLUDE_DIR}")
endif(STANDALONE)
endif(USESYSTEMLIBS)
# The following was copied to llcorehttp/CMakeLists.txt's texture_load target.
# Any changes made here should be replicated there.
@ -280,10 +280,10 @@ MACRO(SET_TEST_PATH LISTVAR)
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)
IF (USESYSTEMLIBS)
set(${LISTVAR} ${CMAKE_BINARY_DIR}/llcommon /usr/lib /usr/local/lib)
ELSE (STANDALONE)
ELSE (USESYSTEMLIBS)
set(${LISTVAR} ${SHARED_LIB_STAGING_DIR} /usr/lib)
ENDIF (STANDALONE)
ENDIF (USESYSTEMLIBS)
ENDIF(WINDOWS)
ENDMACRO(SET_TEST_PATH)

View File

@ -16,9 +16,9 @@ endif( ND_BUILD64BIT_ARCH )
if (USE_KDU)
if (STANDALONE)
if (USESYSTEMLIBS)
include(FindKDU)
else (STANDALONE)
else (USESYSTEMLIBS)
include(Prebuilt)
use_prebuilt_binary(kdu)
if (WINDOWS)
@ -27,7 +27,7 @@ if (USE_KDU)
set(KDU_LIBRARY libkdu${ND_KDU_SUFFIX}.a)
endif (WINDOWS)
set(KDU_INCLUDE_DIR ${AUTOBUILD_INSTALL_DIR}/include/kdu)
endif (STANDALONE)
endif (USESYSTEMLIBS)
set(LLKDU_INCLUDE_DIRS ${LIBS_OPEN_DIR}/llkdu)
set(LLKDU_LIBRARIES llkdu)
endif (USE_KDU)

View File

@ -6,21 +6,30 @@ include(Boost)
use_prebuilt_binary(colladadom)
use_prebuilt_binary(pcre)
use_prebuilt_binary(libxml)
set(LLPRIMITIVE_INCLUDE_DIRS
${LIBS_OPEN_DIR}/llprimitive
)
if (WINDOWS)
set(LLPRIMITIVE_LIBRARIES
set(LLPRIMITIVE_LIBRARIES
debug llprimitive
optimized llprimitive
debug libcollada14dom22-d
optimized libcollada14dom22
${BOOST_SYSTEM_LIBRARIES}
)
elseif (LINUX)
use_prebuilt_binary(libxml2)
set(LLPRIMITIVE_LIBRARIES
llprimitive
collada14dom
minizip
xml2
pcrecpp
pcre
)
else (WINDOWS)
set(LLPRIMITIVE_LIBRARIES
set(LLPRIMITIVE_LIBRARIES
llprimitive
collada14dom
minizip

View File

@ -4,7 +4,7 @@ include(Variables)
include(GLEXT)
include(Prebuilt)
if (STANDALONE)
if (USESYSTEMLIBS)
include(FindSDL)
# This should be done by FindSDL. Sigh.
@ -13,14 +13,14 @@ if (STANDALONE)
SDL_INCLUDE_DIR
SDL_LIBRARY
)
else (STANDALONE)
else (USESYSTEMLIBS)
if (LINUX)
use_prebuilt_binary(SDL)
set (SDL_FOUND TRUE)
set (SDL_INCLUDE_DIR ${LIBS_PREBUILT_DIR}/i686-linux)
set (SDL_LIBRARY SDL directfb fusion direct)
endif (LINUX)
endif (STANDALONE)
endif (USESYSTEMLIBS)
if (SDL_FOUND)
include_directories(${SDL_INCLUDE_DIR})

View File

@ -7,9 +7,9 @@ if (INSTALL_PROPRIETARY)
endif (INSTALL_PROPRIETARY)
if( LEAPMOTION )
if (STANDALONE)
if (USESYSTEMLIBS)
# *TODO: Standalone support
else (STANDALONE)
else (USESYSTEMLIBS)
include(Prebuilt)
use_prebuilt_binary(leap-motion)
if (DARWIN)
@ -32,5 +32,5 @@ if( LEAPMOTION )
endif (ND_BUILD64BIT_ARCH)
endif()
set(LEAP_MOTION_INCLUDE_DIR ${LIBS_OPEN_DIR}/leap-motion)
endif (STANDALONE)
endif (USESYSTEMLIBS)
endif( LEAPMOTION )

View File

@ -36,7 +36,7 @@ else(WINDOWS OR DARWIN)
set(AUTOBUILD_LIBS_INSTALL_DIRS ${AUTOBUILD_INSTALL_DIR}/lib/${CMAKE_BUILD_TYPE_LOWER})
endif(WINDOWS OR DARWIN)
if( NOT STANDALONE ) # <FS:ND/> Don't add any autobuild dirs when building standalone
if( NOT USESYSTEMLIBS ) # <FS:ND/> Don't add any autobuild dirs when building standalone
# <FS:Ansariel> Changed for Firestorm
#if (NOT "${CMAKE_BUILD_TYPE}" STREQUAL "Release")
@ -54,7 +54,7 @@ endif (NOT "${CMAKE_BUILD_TYPE}" STREQUAL "ReleaseFS_AVX" AND NOT "${CMAKE_BUILD
link_directories(${AUTOBUILD_LIBS_INSTALL_DIRS})
endif( NOT STANDALONE ) # <FS:ND/> Don't add any autobuild dirs when building standalone
endif( NOT USESYSTEMLIBS ) # <FS:ND/> Don't add any autobuild dirs when building standalone
if (LINUX)
set(DL_LIBRARY dl)

View File

@ -4,10 +4,10 @@ include(Prebuilt)
set(NDOF ON CACHE BOOL "Use NDOF space navigator joystick library.")
if (NDOF)
if (STANDALONE)
if (USESYSTEMLIBS)
set(NDOF_FIND_REQUIRED ON)
include(FindNDOF)
else (STANDALONE)
else (USESYSTEMLIBS)
use_prebuilt_binary(ndofdev)
if (WINDOWS)
@ -18,7 +18,7 @@ if (NDOF)
set(NDOF_INCLUDE_DIR ${ARCH_PREBUILT_DIRS}/include/ndofdev)
set(NDOF_FOUND 1)
endif (STANDALONE)
endif (USESYSTEMLIBS)
endif (NDOF)
if (NDOF_FOUND)

View File

@ -10,14 +10,14 @@ endif (LINUX)
if (OPENAL)
set(OPENAL_LIB_INCLUDE_DIRS "${LIBS_PREBUILT_DIR}/include/AL")
if (STANDALONE)
if (USESYSTEMLIBS)
include(FindPkgConfig)
include(FindOpenAL)
pkg_check_modules(OPENAL_LIB REQUIRED openal)
pkg_check_modules(FREEALUT_LIB REQUIRED freealut)
else (STANDALONE)
else (USESYSTEMLIBS)
use_prebuilt_binary(openal_soft)
endif (STANDALONE)
endif (USESYSTEMLIBS)
if(WINDOWS)
set(OPENAL_LIBRARIES
OpenAL32

View File

@ -4,9 +4,9 @@ include(Prebuilt)
set(OPENJPEG_FIND_QUIETLY ON)
set(OPENJPEG_FIND_REQUIRED ON)
if (STANDALONE)
if (USESYSTEMLIBS)
include(FindOpenJPEG)
else (STANDALONE)
else (USESYSTEMLIBS)
use_prebuilt_binary(openjpeg)
if(WINDOWS)
@ -19,4 +19,4 @@ else (STANDALONE)
endif(WINDOWS)
set(OPENJPEG_INCLUDE_DIR ${LIBS_PREBUILT_DIR}/include/openjpeg)
endif (STANDALONE)
endif (USESYSTEMLIBS)

View File

@ -4,9 +4,9 @@ include(Prebuilt)
set(OpenSSL_FIND_QUIETLY ON)
set(OpenSSL_FIND_REQUIRED ON)
if (STANDALONE)
if (USESYSTEMLIBS)
include(FindOpenSSL)
else (STANDALONE)
else (USESYSTEMLIBS)
use_prebuilt_binary(openSSL)
if (WINDOWS)
set(OPENSSL_LIBRARIES ssleay32 libeay32)
@ -14,7 +14,7 @@ else (STANDALONE)
set(OPENSSL_LIBRARIES ssl crypto)
endif (WINDOWS)
set(OPENSSL_INCLUDE_DIRS ${LIBS_PREBUILT_DIR}/include)
endif (STANDALONE)
endif (USESYSTEMLIBS)
if (LINUX)
set(CRYPTO_LIBRARIES crypto)

View File

@ -12,9 +12,9 @@ include(Prebuilt)
set(PNG_FIND_QUIETLY ON)
set(PNG_FIND_REQUIRED ON)
if (STANDALONE)
if (USESYSTEMLIBS)
include(FindPNG)
else (STANDALONE)
else (USESYSTEMLIBS)
use_prebuilt_binary(libpng)
if (WINDOWS)
set(PNG_LIBRARIES libpng15)
@ -26,4 +26,4 @@ else (STANDALONE)
set(PNG_LIBRARIES png15)
set(PNG_INCLUDE_DIRS ${LIBS_PREBUILT_DIR}/include/libpng15)
endif()
endif (STANDALONE)
endif (USESYSTEMLIBS)

View File

@ -17,11 +17,11 @@ endif(INSTALL_PROPRIETARY)
# of previous attempts is serialized in the file
# ${CMAKE_BINARY_DIR}/temp/${_binary}_installed)
macro (use_prebuilt_binary _binary)
if (NOT DEFINED STANDALONE_${_binary})
set(STANDALONE_${_binary} ${STANDALONE})
endif (NOT DEFINED STANDALONE_${_binary})
if (NOT DEFINED USESYSTEMLIBS_${_binary})
set(USESYSTEMLIBS_${_binary} ${USESYSTEMLIBS})
endif (NOT DEFINED USESYSTEMLIBS_${_binary})
if (NOT STANDALONE_${_binary})
if (NOT USESYSTEMLIBS_${_binary})
if("${${_binary}_installed}" STREQUAL "" AND EXISTS "${CMAKE_BINARY_DIR}/temp/${_binary}_installed")
file(READ ${CMAKE_BINARY_DIR}/temp/${_binary}_installed "${_binary}_installed")
if(DEBUG_PREBUILT)
@ -64,7 +64,7 @@ macro (use_prebuilt_binary _binary)
"Failed to download or unpack prebuilt '${_binary}'."
" Process returned ${${_binary}_installed}.")
endif (NOT ${_binary}_installed EQUAL 0)
endif (NOT STANDALONE_${_binary})
endif (NOT USESYSTEMLIBS_${_binary})
endmacro (use_prebuilt_binary _binary)
endif(NOT DEFINED ${CMAKE_CURRENT_LIST_FILE}_INCLUDED)

View File

@ -4,7 +4,7 @@ include(Prebuilt)
set(PULSEAUDIO OFF CACHE BOOL "Build with PulseAudio support, if available.")
if (PULSEAUDIO)
if (STANDALONE)
if (USESYSTEMLIBS)
include(FindPkgConfig)
pkg_check_modules(PULSEAUDIO libpulse)
@ -20,7 +20,7 @@ if (PULSEAUDIO)
set(PULSEAUDIO_LIBRARIES
# none needed!
)
endif (STANDALONE)
endif (USESYSTEMLIBS)
endif (PULSEAUDIO)
if (PULSEAUDIO_FOUND)

View File

@ -1,6 +1,6 @@
# -*- cmake -*-
include(Prebuilt)
if (NOT STANDALONE)
if (NOT USESYSTEMLIBS)
use_prebuilt_binary(tut)
endif(NOT STANDALONE)
endif(NOT USESYSTEMLIBS)

View File

@ -2,7 +2,7 @@
include(Prebuilt)
include(FreeType)
if (STANDALONE)
if (USESYSTEMLIBS)
include(FindPkgConfig)
if (LINUX)
@ -31,7 +31,7 @@ if (STANDALONE)
list(APPEND UI_LIBRARIES ${${pkg}_LIBRARIES})
add_definitions(${${pkg}_CFLAGS_OTHERS})
endforeach(pkg)
else (STANDALONE)
else (USESYSTEMLIBS)
use_prebuilt_binary(gtk-atk-pango-glib)
if (LINUX)
set(UI_LIB_NAMES
@ -78,7 +78,7 @@ else (STANDALONE)
foreach(include ${${LL_ARCH}_INCLUDES})
include_directories(${LIBS_PREBUILT_DIR}/include/${include})
endforeach(include)
endif (STANDALONE)
endif (USESYSTEMLIBS)
if (LINUX)
add_definitions(-DLL_GTK=1 -DLL_X11=1)

View File

@ -222,7 +222,7 @@ if (XCODE_VERSION GREATER 4.2)
endif (XCODE_VERSION GREATER 4.2)
set(VERSION_BUILD "0" CACHE STRING "Revision number passed in from the outside")
set(STANDALONE OFF CACHE BOOL "Do not use Linden-supplied prebuilt libraries.")
set(USESYSTEMLIBS OFF CACHE BOOL "Use libraries from your system rather than Linden-supplied prebuilt libraries.")
set(UNATTENDED OFF CACHE BOOL "Should be set to ON for building with VC Express editions.")
set(USE_PRECOMPILED_HEADERS ON CACHE BOOL "Enable use of precompiled header directives where supported.")

View File

@ -1,7 +1,7 @@
# -*- cmake -*-
include(Prebuilt)
if (NOT STANDALONE)
if (NOT USESYSTEMLIBS)
use_prebuilt_binary(libhunspell)
use_prebuilt_binary(libuuid)
use_prebuilt_binary(slvoice)
@ -16,5 +16,5 @@ if (NOT STANDALONE)
use_prebuilt_binary( slplugin_x86 )
endif()
endif( ND_BUILD64BIT_ARCH )
endif(NOT STANDALONE)
endif(NOT USESYSTEMLIBS)

View File

@ -2,7 +2,7 @@
include(Linking)
include(Prebuilt)
if (STANDALONE)
if (USESYSTEMLIBS)
# The minimal version, 4.4.3, is rather arbitrary: it's the version in Debian/Lenny.
find_package(Qt4 4.4.3 COMPONENTS QtCore QtGui QtNetwork QtOpenGL QtWebKit REQUIRED)
include(${QT_USE_FILE})
@ -28,11 +28,11 @@ if (STANDALONE)
list(APPEND QT_PLUGIN_LIBRARIES jpeg)
set(WEBKITLIBPLUGIN OFF CACHE BOOL
"WEBKITLIBPLUGIN support for the llplugin/llmedia test apps.")
else (STANDALONE)
else (USESYSTEMLIBS)
use_prebuilt_binary(llqtwebkit)
set(WEBKITLIBPLUGIN ON CACHE BOOL
"WEBKITLIBPLUGIN support for the llplugin/llmedia test apps.")
endif (STANDALONE)
endif (USESYSTEMLIBS)
if (WINDOWS)
set(WEBKIT_PLUGIN_LIBRARIES
@ -62,9 +62,9 @@ elseif (DARWIN)
)
elseif (LINUX)
# FIRE-6108, add missing if clause for standalone builds - TL
if (STANDALONE)
if (USESYSTEMLIBS)
set(WEBKIT_PLUGIN_LIBRARIES ${LLQTWEBKIT_LIBRARY} ${QT_LIBRARIES} ${QT_PLUGIN_LIBRARIES})
else (STANDALONE)
else (USESYSTEMLIBS)
set(WEBKIT_PLUGIN_LIBRARIES
llqtwebkit
# qico
@ -88,5 +88,5 @@ elseif (LINUX)
# Xi
# SM
)
endif (STANDALONE)
endif (USESYSTEMLIBS)
endif (WINDOWS)

View File

@ -4,9 +4,9 @@ include(Prebuilt)
set(XMLRPCEPI_FIND_QUIETLY ON)
set(XMLRPCEPI_FIND_REQUIRED ON)
if (STANDALONE)
if (USESYSTEMLIBS)
include(FindXmlRpcEpi)
else (STANDALONE)
else (USESYSTEMLIBS)
use_prebuilt_binary(xmlrpc-epi)
if (WINDOWS)
set(XMLRPCEPI_LIBRARIES
@ -17,4 +17,4 @@ else (STANDALONE)
set(XMLRPCEPI_LIBRARIES xmlrpc-epi)
endif (WINDOWS)
set(XMLRPCEPI_INCLUDE_DIRS ${LIBS_PREBUILT_DIR}/include)
endif (STANDALONE)
endif (USESYSTEMLIBS)

View File

@ -5,9 +5,9 @@ set(ZLIB_FIND_REQUIRED ON)
include(Prebuilt)
if (STANDALONE)
if (USESYSTEMLIBS)
include(FindZLIB)
else (STANDALONE)
else (USESYSTEMLIBS)
use_prebuilt_binary(zlib)
if (WINDOWS)
set(ZLIB_LIBRARIES
@ -19,4 +19,4 @@ else (STANDALONE)
if (WINDOWS OR LINUX)
set(ZLIB_INCLUDE_DIRS ${LIBS_PREBUILT_DIR}/include/zlib)
endif (WINDOWS OR LINUX)
endif (STANDALONE)
endif (USESYSTEMLIBS)

View File

@ -31,7 +31,7 @@
// <FS:TS> This silliness is needed because LL renamed the Boost coroutines
// functions to dcoroutines.
#if LL_STANDALONE
#if LL_USESYSTEMLIBS
#include <boost/coroutine/coroutine.hpp>
#define dcoroutines coroutines
#else

View File

@ -31,7 +31,7 @@
// <FS:TS> This silliness is needed because LL renamed the Boost coroutines
// functions to dcoroutines.
#if LL_STANDALONE
#if LL_USESYSTEMLIBS
#include <boost/coroutine/coroutine.hpp>
#include <boost/coroutine/future.hpp>
#define dcoroutines coroutines

View File

@ -34,7 +34,7 @@
#include <iostream>
#include "apr_base64.h"
#ifdef LL_STANDALONE
#ifdef LL_USESYSTEMLIBS
# include <zlib.h>
#else
# include "zlib/zlib.h" // for davep's dirty little zip functions

View File

@ -36,7 +36,7 @@
extern "C"
{
#ifdef LL_STANDALONE
#ifdef LL_USESYSTEMLIBS
# include <expat.h>
#else
# include "expat/expat.h"

View File

@ -33,7 +33,7 @@
#include "llsys.h"
#include <iostream>
#ifdef LL_STANDALONE
#ifdef LL_USESYSTEMLIBS
# include <zlib.h>
#else
# include "zlib/zlib.h"

View File

@ -33,7 +33,7 @@
#include "llwin32headerslean.h"
extern "C" {
#ifdef LL_STANDALONE
#ifdef LL_USESYSTEMLIBS
# include <jpeglib.h>
# include <jerror.h>
#else

View File

@ -1,4 +1,4 @@
/**
/**
* @file llmath.h
* @brief Useful math constants and macros.
*
@ -73,6 +73,7 @@ const F32 F_E = 2.71828182845904523536f;
const F32 F_SQRT2 = 1.4142135623730950488016887242097f;
const F32 F_SQRT3 = 1.73205080756888288657986402541f;
const F32 OO_SQRT2 = 0.7071067811865475244008443621049f;
const F32 OO_SQRT3 = 0.577350269189625764509f;
const F32 DEG_TO_RAD = 0.017453292519943295769236907684886f;
const F32 RAD_TO_DEG = 57.295779513082320876798154814105f;
const F32 F_APPROXIMATELY_ZERO = 0.00001f;
@ -84,6 +85,9 @@ const F32 OO_LN2 = 1.4426950408889634073599246810019f;
const F32 F_ALMOST_ZERO = 0.0001f;
const F32 F_ALMOST_ONE = 1.0f - F_ALMOST_ZERO;
const F32 GIMBAL_THRESHOLD = 0.000436f; // sets the gimballock threshold 0.025 away from +/-90 degrees
// formula: GIMBAL_THRESHOLD = sin(DEG_TO_RAD * gimbal_threshold_angle);
// BUG: Eliminate in favor of F_APPROXIMATELY_ZERO above?
const F32 FP_MAG_THRESHOLD = 0.0000001f;

View File

@ -1,4 +1,4 @@
/**
/**
* @file llquaternion.cpp
* @brief LLQuaternion class implementation.
*
@ -58,34 +58,40 @@ LLQuaternion::LLQuaternion(const LLMatrix3 &mat)
LLQuaternion::LLQuaternion(F32 angle, const LLVector4 &vec)
{
LLVector3 v(vec.mV[VX], vec.mV[VY], vec.mV[VZ]);
v.normalize();
F32 c, s;
c = cosf(angle*0.5f);
s = sinf(angle*0.5f);
mQ[VX] = v.mV[VX] * s;
mQ[VY] = v.mV[VY] * s;
mQ[VZ] = v.mV[VZ] * s;
mQ[VW] = c;
normalize();
F32 mag = sqrtf(vec.mV[VX] * vec.mV[VX] + vec.mV[VY] * vec.mV[VY] + vec.mV[VZ] * vec.mV[VZ]);
if (mag > FP_MAG_THRESHOLD)
{
angle *= 0.5;
F32 c = cosf(angle);
F32 s = sinf(angle) / mag;
mQ[VX] = vec.mV[VX] * s;
mQ[VY] = vec.mV[VY] * s;
mQ[VZ] = vec.mV[VZ] * s;
mQ[VW] = c;
}
else
{
loadIdentity();
}
}
LLQuaternion::LLQuaternion(F32 angle, const LLVector3 &vec)
{
LLVector3 v(vec);
v.normalize();
F32 c, s;
c = cosf(angle*0.5f);
s = sinf(angle*0.5f);
mQ[VX] = v.mV[VX] * s;
mQ[VY] = v.mV[VY] * s;
mQ[VZ] = v.mV[VZ] * s;
mQ[VW] = c;
normalize();
F32 mag = sqrtf(vec.mV[VX] * vec.mV[VX] + vec.mV[VY] * vec.mV[VY] + vec.mV[VZ] * vec.mV[VZ]);
if (mag > FP_MAG_THRESHOLD)
{
angle *= 0.5;
F32 c = cosf(angle);
F32 s = sinf(angle) / mag;
mQ[VX] = vec.mV[VX] * s;
mQ[VY] = vec.mV[VY] * s;
mQ[VZ] = vec.mV[VZ] * s;
mQ[VW] = c;
}
else
{
loadIdentity();
}
}
LLQuaternion::LLQuaternion(const LLVector3 &x_axis,
@ -136,57 +142,61 @@ void LLQuaternion::quantize8(F32 lower, F32 upper)
const LLQuaternion& LLQuaternion::setAngleAxis(F32 angle, F32 x, F32 y, F32 z)
{
LLVector3 vec(x, y, z);
vec.normalize();
angle *= 0.5f;
F32 c, s;
c = cosf(angle);
s = sinf(angle);
mQ[VX] = vec.mV[VX]*s;
mQ[VY] = vec.mV[VY]*s;
mQ[VZ] = vec.mV[VZ]*s;
mQ[VW] = c;
normalize();
F32 mag = sqrtf(x * x + y * y + z * z);
if (mag > FP_MAG_THRESHOLD)
{
angle *= 0.5;
F32 c = cosf(angle);
F32 s = sinf(angle) / mag;
mQ[VX] = x * s;
mQ[VY] = y * s;
mQ[VZ] = z * s;
mQ[VW] = c;
}
else
{
loadIdentity();
}
return (*this);
}
const LLQuaternion& LLQuaternion::setAngleAxis(F32 angle, const LLVector3 &vec)
{
LLVector3 v(vec);
v.normalize();
angle *= 0.5f;
F32 c, s;
c = cosf(angle);
s = sinf(angle);
mQ[VX] = v.mV[VX]*s;
mQ[VY] = v.mV[VY]*s;
mQ[VZ] = v.mV[VZ]*s;
mQ[VW] = c;
normalize();
F32 mag = sqrtf(vec.mV[VX] * vec.mV[VX] + vec.mV[VY] * vec.mV[VY] + vec.mV[VZ] * vec.mV[VZ]);
if (mag > FP_MAG_THRESHOLD)
{
angle *= 0.5;
F32 c = cosf(angle);
F32 s = sinf(angle) / mag;
mQ[VX] = vec.mV[VX] * s;
mQ[VY] = vec.mV[VY] * s;
mQ[VZ] = vec.mV[VZ] * s;
mQ[VW] = c;
}
else
{
loadIdentity();
}
return (*this);
}
const LLQuaternion& LLQuaternion::setAngleAxis(F32 angle, const LLVector4 &vec)
{
LLVector3 v(vec.mV[VX], vec.mV[VY], vec.mV[VZ]);
v.normalize();
F32 c, s;
c = cosf(angle*0.5f);
s = sinf(angle*0.5f);
mQ[VX] = v.mV[VX]*s;
mQ[VY] = v.mV[VY]*s;
mQ[VZ] = v.mV[VZ]*s;
mQ[VW] = c;
normalize();
F32 mag = sqrtf(vec.mV[VX] * vec.mV[VX] + vec.mV[VY] * vec.mV[VY] + vec.mV[VZ] * vec.mV[VZ]);
if (mag > FP_MAG_THRESHOLD)
{
angle *= 0.5;
F32 c = cosf(angle);
F32 s = sinf(angle) / mag;
mQ[VX] = vec.mV[VX] * s;
mQ[VY] = vec.mV[VY] * s;
mQ[VZ] = vec.mV[VZ] * s;
mQ[VW] = c;
}
else
{
loadIdentity();
}
return (*this);
}
@ -219,68 +229,80 @@ const LLQuaternion& LLQuaternion::set(const LLMatrix4 &mat)
// deprecated
const LLQuaternion& LLQuaternion::setQuat(F32 angle, F32 x, F32 y, F32 z)
{
LLVector3 vec(x, y, z);
vec.normalize();
angle *= 0.5f;
F32 c, s;
c = cosf(angle);
s = sinf(angle);
mQ[VX] = vec.mV[VX]*s;
mQ[VY] = vec.mV[VY]*s;
mQ[VZ] = vec.mV[VZ]*s;
mQ[VW] = c;
normalize();
F32 mag = sqrtf(x * x + y * y + z * z);
if (mag > FP_MAG_THRESHOLD)
{
angle *= 0.5;
F32 c = cosf(angle);
F32 s = sinf(angle) / mag;
mQ[VX] = x * s;
mQ[VY] = y * s;
mQ[VZ] = z * s;
mQ[VW] = c;
}
else
{
loadIdentity();
}
return (*this);
}
// deprecated
const LLQuaternion& LLQuaternion::setQuat(F32 angle, const LLVector3 &vec)
{
LLVector3 v(vec);
v.normalize();
angle *= 0.5f;
F32 c, s;
c = cosf(angle);
s = sinf(angle);
mQ[VX] = v.mV[VX]*s;
mQ[VY] = v.mV[VY]*s;
mQ[VZ] = v.mV[VZ]*s;
mQ[VW] = c;
normalize();
F32 mag = sqrtf(vec.mV[VX] * vec.mV[VX] + vec.mV[VY] * vec.mV[VY] + vec.mV[VZ] * vec.mV[VZ]);
if (mag > FP_MAG_THRESHOLD)
{
angle *= 0.5;
F32 c = cosf(angle);
F32 s = sinf(angle) / mag;
mQ[VX] = vec.mV[VX] * s;
mQ[VY] = vec.mV[VY] * s;
mQ[VZ] = vec.mV[VZ] * s;
mQ[VW] = c;
}
else
{
loadIdentity();
}
return (*this);
}
const LLQuaternion& LLQuaternion::setQuat(F32 angle, const LLVector4 &vec)
{
LLVector3 v(vec.mV[VX], vec.mV[VY], vec.mV[VZ]);
v.normalize();
F32 c, s;
c = cosf(angle*0.5f);
s = sinf(angle*0.5f);
mQ[VX] = v.mV[VX]*s;
mQ[VY] = v.mV[VY]*s;
mQ[VZ] = v.mV[VZ]*s;
mQ[VW] = c;
normalize();
F32 mag = sqrtf(vec.mV[VX] * vec.mV[VX] + vec.mV[VY] * vec.mV[VY] + vec.mV[VZ] * vec.mV[VZ]);
if (mag > FP_MAG_THRESHOLD)
{
angle *= 0.5;
F32 c = cosf(angle);
F32 s = sinf(angle) / mag;
mQ[VX] = vec.mV[VX] * s;
mQ[VY] = vec.mV[VY] * s;
mQ[VZ] = vec.mV[VZ] * s;
mQ[VW] = c;
}
else
{
loadIdentity();
}
return (*this);
}
const LLQuaternion& LLQuaternion::setQuat(F32 roll, F32 pitch, F32 yaw)
{
LLMatrix3 rot_mat(roll, pitch, yaw);
rot_mat.orthogonalize();
*this = rot_mat.quaternion();
normalize();
roll *= 0.5f;
pitch *= 0.5f;
yaw *= 0.5f;
F32 sinX = sinf(roll);
F32 cosX = cosf(roll);
F32 sinY = sinf(pitch);
F32 cosY = cosf(pitch);
F32 sinZ = sinf(yaw);
F32 cosZ = cosf(yaw);
mQ[VW] = cosX * cosY * cosZ - sinX * sinY * sinZ;
mQ[VX] = sinX * cosY * cosZ + cosX * sinY * sinZ;
mQ[VY] = cosX * sinY * cosZ - sinX * cosY * sinZ;
mQ[VZ] = cosX * cosY * sinZ + sinX * sinY * cosZ;
return (*this);
}
@ -425,68 +447,44 @@ LLMatrix4 LLQuaternion::getMatrix4(void) const
// calculate the shortest rotation from a to b
void LLQuaternion::shortestArc(const LLVector3 &a, const LLVector3 &b)
{
// Make a local copy of both vectors.
LLVector3 vec_a = a;
LLVector3 vec_b = b;
// Make sure neither vector is zero length. Also normalize
// the vectors while we are at it.
F32 vec_a_mag = vec_a.normalize();
F32 vec_b_mag = vec_b.normalize();
if (vec_a_mag < F_APPROXIMATELY_ZERO ||
vec_b_mag < F_APPROXIMATELY_ZERO)
F32 ab = a * b; // dotproduct
LLVector3 c = a % b; // crossproduct
F32 cc = c * c; // squared length of the crossproduct
if (ab * ab + cc) // test if the arguments have sufficient magnitude
{
// Can't calculate a rotation from this.
// Just return ZERO_ROTATION instead.
loadIdentity();
return;
}
// Create an axis to rotate around, and the cos of the angle to rotate.
LLVector3 axis = vec_a % vec_b;
F32 cos_theta = vec_a * vec_b;
// Check the angle between the vectors to see if they are parallel or anti-parallel.
if (cos_theta > 1.0 - F_APPROXIMATELY_ZERO)
{
// a and b are parallel. No rotation is necessary.
loadIdentity();
}
else if (cos_theta < -1.0 + F_APPROXIMATELY_ZERO)
{
// a and b are anti-parallel.
// Rotate 180 degrees around some orthogonal axis.
// Find the projection of the x-axis onto a, and try
// using the vector between the projection and the x-axis
// as the orthogonal axis.
LLVector3 proj = vec_a.mV[VX] / (vec_a * vec_a) * vec_a;
LLVector3 ortho_axis(1.f, 0.f, 0.f);
ortho_axis -= proj;
// Turn this into an orthonormal axis.
F32 ortho_length = ortho_axis.normalize();
// If the axis' length is 0, then our guess at an orthogonal axis
// was wrong (a is parallel to the x-axis).
if (ortho_length < F_APPROXIMATELY_ZERO)
if (cc > 0.0f) // test if the arguments are (anti)parallel
{
// Use the z-axis instead.
ortho_axis.setVec(0.f, 0.f, 1.f);
F32 s = sqrtf(ab * ab + cc) + ab; // note: don't try to optimize this line
F32 m = 1.0f / sqrtf(cc + s * s); // the inverted magnitude of the quaternion
mQ[VX] = c.mV[VX] * m;
mQ[VY] = c.mV[VY] * m;
mQ[VZ] = c.mV[VZ] * m;
mQ[VW] = s * m;
return;
}
if (ab < 0.0f) // test if the angle is bigger than PI/2 (anti parallel)
{
c = a - b; // the arguments are anti-parallel, we have to choose an axis
F32 m = sqrtf(c.mV[VX] * c.mV[VX] + c.mV[VY] * c.mV[VY]); // the length projected on the XY-plane
if (m > FP_MAG_THRESHOLD)
{
mQ[VX] = -c.mV[VY] / m; // return the quaternion with the axis in the XY-plane
mQ[VY] = c.mV[VX] / m;
mQ[VZ] = 0.0f;
mQ[VW] = 0.0f;
return;
}
else // the vectors are parallel to the Z-axis
{
mQ[VX] = 1.0f; // rotate around the X-axis
mQ[VY] = 0.0f;
mQ[VZ] = 0.0f;
mQ[VW] = 0.0f;
return;
}
}
// Construct a quaternion from this orthonormal axis.
mQ[VX] = ortho_axis.mV[VX];
mQ[VY] = ortho_axis.mV[VY];
mQ[VZ] = ortho_axis.mV[VZ];
mQ[VW] = 0.f;
}
else
{
// a and b are NOT parallel or anti-parallel.
// Return the rotation between these vectors.
F32 theta = (F32)acos(cos_theta);
setAngleAxis(theta, axis);
}
loadIdentity();
}
// constrains rotation to a cone angle specified in radians
@ -838,79 +836,82 @@ LLQuaternion::Order StringToOrder( const char *str )
void LLQuaternion::getAngleAxis(F32* angle, LLVector3 &vec) const
{
F32 cos_a = mQ[VW];
if (cos_a > 1.0f) cos_a = 1.0f;
if (cos_a < -1.0f) cos_a = -1.0f;
F32 sin_a = (F32) sqrt( 1.0f - cos_a * cos_a );
if ( fabs( sin_a ) < 0.0005f )
sin_a = 1.0f;
else
sin_a = 1.f/sin_a;
F32 temp_angle = 2.0f * (F32) acos( cos_a );
if (temp_angle > F_PI)
F32 v = sqrtf(mQ[VX] * mQ[VX] + mQ[VY] * mQ[VY] + mQ[VZ] * mQ[VZ]); // length of the vector-component
if (v > FP_MAG_THRESHOLD)
{
// The (angle,axis) pair should never have angles outside [PI, -PI]
// since we want the _shortest_ (angle,axis) solution.
// Since acos is defined for [0, PI], and we multiply by 2.0, we
// can push the angle outside the acceptible range.
// When this happens we set the angle to the other portion of a
// full 2PI rotation, and negate the axis, which reverses the
// direction of the rotation (by the right-hand rule).
*angle = 2.f * F_PI - temp_angle;
vec.mV[VX] = - mQ[VX] * sin_a;
vec.mV[VY] = - mQ[VY] * sin_a;
vec.mV[VZ] = - mQ[VZ] * sin_a;
F32 oomag = 1.0f / v;
F32 w = mQ[VW];
if (mQ[VW] < 0.0f)
{
w = -w; // make VW positive
oomag = -oomag; // invert the axis
}
vec.mV[VX] = mQ[VX] * oomag; // normalize the axis
vec.mV[VY] = mQ[VY] * oomag;
vec.mV[VZ] = mQ[VZ] * oomag;
*angle = 2.0f * atan2f(v, w); // get the angle
}
else
{
*angle = temp_angle;
vec.mV[VX] = mQ[VX] * sin_a;
vec.mV[VY] = mQ[VY] * sin_a;
vec.mV[VZ] = mQ[VZ] * sin_a;
*angle = 0.0f; // no rotation
vec.mV[VX] = 0.0f; // around some dummy axis
vec.mV[VY] = 0.0f;
vec.mV[VZ] = 1.0f;
}
}
// quaternion does not need to be normalized
void LLQuaternion::getEulerAngles(F32 *roll, F32 *pitch, F32 *yaw) const
{
LLMatrix3 rot_mat(*this);
rot_mat.orthogonalize();
rot_mat.getEulerAngles(roll, pitch, yaw);
// // NOTE: LLQuaternion's are actually inverted with respect to
// // the matrices, so this code also assumes inverted quaternions
// // (-x, -y, -z, w). The result is that roll,pitch,yaw are applied
// // in reverse order (yaw,pitch,roll).
// F32 x = -mQ[VX], y = -mQ[VY], z = -mQ[VZ], w = mQ[VW];
// F64 m20 = 2.0*(x*z-y*w);
// if (1.0f - fabsf(m20) < F_APPROXIMATELY_ZERO)
// {
// *roll = 0.0f;
// *pitch = (F32)asin(m20);
// *yaw = (F32)atan2(2.0*(x*y-z*w), 1.0 - 2.0*(x*x+z*z));
// }
// else
// {
// *roll = (F32)atan2(-2.0*(y*z+x*w), 1.0-2.0*(x*x+y*y));
// *pitch = (F32)asin(m20);
// *yaw = (F32)atan2(-2.0*(x*y+z*w), 1.0-2.0*(y*y+z*z));
// }
F32 sx = 2 * (mQ[VX] * mQ[VW] - mQ[VY] * mQ[VZ]); // sine of the roll
F32 sy = 2 * (mQ[VY] * mQ[VW] + mQ[VX] * mQ[VZ]); // sine of the pitch
F32 ys = mQ[VW] * mQ[VW] - mQ[VY] * mQ[VY]; // intermediate cosine 1
F32 xz = mQ[VX] * mQ[VX] - mQ[VZ] * mQ[VZ]; // intermediate cosine 2
F32 cx = ys - xz; // cosine of the roll
F32 cy = sqrtf(sx * sx + cx * cx); // cosine of the pitch
if (cy > GIMBAL_THRESHOLD) // no gimbal lock
{
*roll = atan2f(sx, cx);
*pitch = atan2f(sy, cy);
*yaw = atan2f(2 * (mQ[VZ] * mQ[VW] - mQ[VX] * mQ[VY]), ys + xz);
}
else // gimbal lock
{
if (sy > 0)
{
*pitch = F_PI_BY_TWO;
*yaw = 2 * atan2f(mQ[VZ] + mQ[VX], mQ[VW] + mQ[VY]);
}
else
{
*pitch = -F_PI_BY_TWO;
*yaw = 2 * atan2f(mQ[VZ] - mQ[VX], mQ[VW] - mQ[VY]);
}
*roll = 0;
}
}
// Saves space by using the fact that our quaternions are normalized
LLVector3 LLQuaternion::packToVector3() const
{
F32 x = mQ[VX];
F32 y = mQ[VY];
F32 z = mQ[VZ];
F32 w = mQ[VW];
F32 mag = sqrtf(x * x + y * y + z * z + w * w);
if (mag > FP_MAG_THRESHOLD)
{
x /= mag;
y /= mag;
z /= mag; // no need to normalize w, it's not used
}
if( mQ[VW] >= 0 )
{
return LLVector3( mQ[VX], mQ[VY], mQ[VZ] );
return LLVector3( x, y , z );
}
else
{
return LLVector3( -mQ[VX], -mQ[VY], -mQ[VZ] );
return LLVector3( -x, -y, -z );
}
}

View File

@ -1,4 +1,4 @@
/**
/**
* @file llquaternion.h
* @brief LLQuaternion class header file.
*
@ -304,43 +304,29 @@ inline const LLQuaternion& LLQuaternion::setQuat(const F32 *q)
return (*this);
}
// There may be a cheaper way that avoids the sqrt.
// Does sin_a = VX*VX + VY*VY + VZ*VZ?
// Copied from Matrix and Quaternion FAQ 1.12
inline void LLQuaternion::getAngleAxis(F32* angle, F32* x, F32* y, F32* z) const
{
F32 cos_a = mQ[VW];
if (cos_a > 1.0f) cos_a = 1.0f;
if (cos_a < -1.0f) cos_a = -1.0f;
F32 sin_a = (F32) sqrt( 1.0f - cos_a * cos_a );
if ( fabs( sin_a ) < 0.0005f )
sin_a = 1.0f;
else
sin_a = 1.f/sin_a;
F32 temp_angle = 2.0f * (F32) acos( cos_a );
if (temp_angle > F_PI)
F32 v = sqrtf(mQ[VX] * mQ[VX] + mQ[VY] * mQ[VY] + mQ[VZ] * mQ[VZ]); // length of the vector-component
if (v > FP_MAG_THRESHOLD)
{
// The (angle,axis) pair should never have angles outside [PI, -PI]
// since we want the _shortest_ (angle,axis) solution.
// Since acos is defined for [0, PI], and we multiply by 2.0, we
// can push the angle outside the acceptible range.
// When this happens we set the angle to the other portion of a
// full 2PI rotation, and negate the axis, which reverses the
// direction of the rotation (by the right-hand rule).
*angle = 2.f * F_PI - temp_angle;
*x = - mQ[VX] * sin_a;
*y = - mQ[VY] * sin_a;
*z = - mQ[VZ] * sin_a;
F32 oomag = 1.0f / v;
F32 w = mQ[VW];
if (w < 0.0f)
{
w = -w; // make VW positive
oomag = -oomag; // invert the axis
}
*x = mQ[VX] * oomag; // normalize the axis
*y = mQ[VY] * oomag;
*z = mQ[VZ] * oomag;
*angle = 2.0f * atan2f(v, w); // get the angle
}
else
{
*angle = temp_angle;
*x = mQ[VX] * sin_a;
*y = mQ[VY] * sin_a;
*z = mQ[VZ] * sin_a;
*angle = 0.0f; // no rotation
*x = 0.0f; // around some dummy axis
*y = 0.0f;
*z = 1.0f;
}
}

View File

@ -72,17 +72,22 @@ class LLVector3d
BOOL clamp(const F64 min, const F64 max); // Clamps all values to (min,max), returns TRUE if data changed
BOOL abs(); // sets all values to absolute value of original value (first octant), returns TRUE if changed
inline const LLVector3d& clearVec(); // Clears LLVector3d to (0, 0, 0, 1)
inline const LLVector3d& clear(); // Clears LLVector3d to (0, 0, 0, 1)
inline const LLVector3d& clearVec(); // deprecated
inline const LLVector3d& setZero(); // Zero LLVector3d to (0, 0, 0, 0)
inline const LLVector3d& zeroVec(); // deprecated
inline const LLVector3d& setVec(const F64 x, const F64 y, const F64 z); // Sets LLVector3d to (x, y, z, 1)
inline const LLVector3d& setVec(const LLVector3d &vec); // Sets LLVector3d to vec
inline const LLVector3d& setVec(const F64 *vec); // Sets LLVector3d to vec
inline const LLVector3d& setVec(const LLVector3 &vec);
inline const LLVector3d& set(const F64 x, const F64 y, const F64 z); // Sets LLVector3d to (x, y, z, 1)
inline const LLVector3d& set(const LLVector3d &vec); // Sets LLVector3d to vec
inline const LLVector3d& set(const F64 *vec); // Sets LLVector3d to vec
inline const LLVector3d& set(const LLVector3 &vec);
inline const LLVector3d& setVec(const F64 x, const F64 y, const F64 z); // deprecated
inline const LLVector3d& setVec(const LLVector3d &vec); // deprecated
inline const LLVector3d& setVec(const F64 *vec); // deprecated
inline const LLVector3d& setVec(const LLVector3 &vec); // deprecated
F64 magVec() const; // Returns magnitude of LLVector3d
F64 magVecSquared() const; // Returns magnitude squared of LLVector3d
inline F64 normVec(); // Normalizes and returns the magnitude of LLVector3d
F64 magVec() const; // deprecated
F64 magVecSquared() const; // deprecated
inline F64 normVec(); // deprecated
F64 length() const; // Returns magnitude of LLVector3d
F64 lengthSquared() const; // Returns magnitude squared of LLVector3d
@ -127,7 +132,15 @@ class LLVector3d
typedef LLVector3d LLGlobalVec;
const LLVector3d &LLVector3d::setVec(const LLVector3 &vec)
inline const LLVector3d &LLVector3d::set(const LLVector3 &vec)
{
mdV[0] = vec.mV[0];
mdV[1] = vec.mV[1];
mdV[2] = vec.mV[2];
return *this;
}
inline const LLVector3d &LLVector3d::setVec(const LLVector3 &vec)
{
mdV[0] = vec.mV[0];
mdV[1] = vec.mV[1];
@ -184,6 +197,14 @@ inline BOOL LLVector3d::isFinite() const
// Clear and Assignment Functions
inline const LLVector3d& LLVector3d::clear(void)
{
mdV[0] = 0.f;
mdV[1] = 0.f;
mdV[2]= 0.f;
return (*this);
}
inline const LLVector3d& LLVector3d::clearVec(void)
{
mdV[0] = 0.f;
@ -208,6 +229,30 @@ inline const LLVector3d& LLVector3d::zeroVec(void)
return (*this);
}
inline const LLVector3d& LLVector3d::set(const F64 x, const F64 y, const F64 z)
{
mdV[VX] = x;
mdV[VY] = y;
mdV[VZ] = z;
return (*this);
}
inline const LLVector3d& LLVector3d::set(const LLVector3d &vec)
{
mdV[0] = vec.mdV[0];
mdV[1] = vec.mdV[1];
mdV[2] = vec.mdV[2];
return (*this);
}
inline const LLVector3d& LLVector3d::set(const F64 *vec)
{
mdV[0] = vec[0];
mdV[1] = vec[1];
mdV[2] = vec[2];
return (*this);
}
inline const LLVector3d& LLVector3d::setVec(const F64 x, const F64 y, const F64 z)
{
mdV[VX] = x;

View File

@ -1,4 +1,4 @@
/**
/**
* @file v3math.h
* @brief LLVector3 class header file.
*
@ -159,9 +159,7 @@ F32 dist_vec(const LLVector3 &a, const LLVector3 &b); // Returns distance betwe
F32 dist_vec_squared(const LLVector3 &a, const LLVector3 &b);// Returns distance squared between a and b
F32 dist_vec_squared2D(const LLVector3 &a, const LLVector3 &b);// Returns distance squared between a and b ignoring Z component
LLVector3 projected_vec(const LLVector3 &a, const LLVector3 &b); // Returns vector a projected on vector b
// Returns a vector in direction of a, such that when projected onto b, gives you the same value as b
// in other words: projected_vec(inverse_projected_vec(a, b), b) == b;
LLVector3 inverse_projected_vec(const LLVector3 &a, const LLVector3 &b);
LLVector3 inverse_projected_vec(const LLVector3 &a, const LLVector3 &b); // Returns vector a scaled such that projected_vec(inverse_projected_vec(a, b), b) == b;
LLVector3 parallel_component(const LLVector3 &a, const LLVector3 &b); // Returns vector a projected on vector b (same as projected_vec)
LLVector3 orthogonal_component(const LLVector3 &a, const LLVector3 &b); // Returns component of vector a not parallel to vector b (same as projected_vec)
LLVector3 lerp(const LLVector3 &a, const LLVector3 &b, F32 u); // Returns a vector that is a linear interpolation between a and b
@ -493,9 +491,15 @@ inline F32 dist_vec_squared2D(const LLVector3 &a, const LLVector3 &b)
inline LLVector3 projected_vec(const LLVector3 &a, const LLVector3 &b)
{
LLVector3 project_axis = b;
project_axis.normalize();
return project_axis * (a * project_axis);
F32 bb = b * b;
if (bb > FP_MAG_THRESHOLD * FP_MAG_THRESHOLD)
{
return ((a * b) / bb) * b;
}
else
{
return b.zero;
}
}
inline LLVector3 inverse_projected_vec(const LLVector3& a, const LLVector3& b)
@ -571,15 +575,13 @@ inline void update_min_max(LLVector3& min, LLVector3& max, const F32* pos)
inline F32 angle_between(const LLVector3& a, const LLVector3& b)
{
LLVector3 an = a;
LLVector3 bn = b;
an.normalize();
bn.normalize();
F32 cosine = an * bn;
F32 angle = (cosine >= 1.0f) ? 0.0f :
(cosine <= -1.0f) ? F_PI :
(F32)acos(cosine);
return angle;
F32 ab = a * b; // dotproduct
if (ab == -0.0f)
{
ab = 0.0f; // get rid of negative zero
}
LLVector3 c = a % b; // crossproduct
return atan2f(sqrtf(c * c), ab); // return the angle
}
inline BOOL are_parallel(const LLVector3 &a, const LLVector3 &b, F32 epsilon)

View File

@ -39,7 +39,7 @@
# pragma warning(pop)
#endif
#ifdef LL_STANDALONE
#ifdef LL_USESYSTEMLIBS
# include <ares.h>
#else
# include <ares/ares.h>

View File

@ -38,7 +38,7 @@
#include "llvfs.h"
#include "llxfer.h"
#ifdef LL_STANDALONE
#ifdef LL_USESYSTEMLIBS
# include <zlib.h>
#else
# include "zlib/zlib.h"

View File

@ -44,7 +44,7 @@
#pragma warning (default : 4264)
#endif
#ifdef LL_STANDALONE
#ifdef LL_USESYSTEMLIBS
# include <zlib.h>
#else
# include "zlib/zlib.h"

File diff suppressed because it is too large Load Diff

View File

@ -1,25 +1,25 @@
/**
/**
* @file llkeywords.h
* @brief Keyword list for LSL
*
* $LicenseInfo:firstyear=2001&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$
*/
@ -28,11 +28,10 @@
#define LL_LLKEYWORDS_H
#include "lldir.h"
#include "llstring.h"
// <FS:CR> User defined syntax highlighting
//#include "v3color.h"
#include "v3color.h"
#include "v4color.h"
// </FS:CR>
#include <map>
#include <list>
#include <deque>
@ -44,29 +43,35 @@ typedef LLPointer<LLTextSegment> LLTextSegmentPtr;
class LLKeywordToken
{
public:
/**
/**
* @brief Types of tokens/delimters being parsed.
*
* @desc Tokens/delimiters that need to be identified/highlighted. All are terminated if an EOF is encountered.
* - WORD are keywords in the normal sense, i.e. constants, events, etc.
* - LINE are for entire lines (currently only flow control labels use this).
* - ONE_SIDED_DELIMITER are for open-ended delimiters which are terminated by EOL.
* - TWO_SIDED_DELIMITER are for delimiters that end with a different delimiter than they open with.
* - DOUBLE_QUOTATION_MARKS are for delimiting areas using the same delimiter to open and close.
* - TT_WORD are keywords in the normal sense, i.e. constants, events, etc.
* - TT_LINE are for entire lines (currently only flow control labels use this).
* - TT_ONE_SIDED_DELIMITER are for open-ended delimiters which are terminated by EOL.
* - TT_TWO_SIDED_DELIMITER are for delimiters that end with a different delimiter than they open with.
* - TT_DOUBLE_QUOTATION_MARKS are for delimiting areas using the same delimiter to open and close.
*/
enum TOKEN_TYPE
typedef enum e_token_type
{
WORD,
LINE,
TWO_SIDED_DELIMITER,
ONE_SIDED_DELIMITER,
DOUBLE_QUOTATION_MARKS
};
TT_UNKNOWN,
TT_WORD,
TT_LINE,
TT_TWO_SIDED_DELIMITER,
TT_ONE_SIDED_DELIMITER,
TT_DOUBLE_QUOTATION_MARKS,
// Following constants are more specific versions of the preceding ones
TT_CONSTANT, // WORD
TT_CONTROL, // WORD
TT_EVENT, // WORD
TT_FUNCTION, // WORD
TT_LABEL, // LINE
TT_SECTION, // WORD
TT_TYPE // WORD
} ETokenType;
// <FS:CR> User defined syntax highlighting
//LLKeywordToken( TOKEN_TYPE type, const LLColor3& color, const LLWString& token, const LLWString& tool_tip, const LLWString& delimiter )
LLKeywordToken( TOKEN_TYPE type, const LLColor4& color, const LLWString& token, const LLWString& tool_tip, const LLWString& delimiter )
// </FS:CR>
LLKeywordToken( ETokenType type, const LLColor4& color, const LLWString& token, const LLWString& tool_tip, const LLWString& delimiter )
:
mType( type ),
mToken( token ),
@ -78,14 +83,11 @@ public:
S32 getLengthHead() const { return mToken.size(); }
S32 getLengthTail() const { return mDelimiter.size(); }
BOOL isHead(const llwchar* s) const;
BOOL isTail(const llwchar* s) const;
bool isHead(const llwchar* s) const;
bool isTail(const llwchar* s) const;
const LLWString& getToken() const { return mToken; }
// <FS:CR> User defined syntax highlighting
//const LLColor3& getColor() const { return mColor; }
const LLColor4& getColor() const { return mColor; }
// </FS:CR>
TOKEN_TYPE getType() const { return mType; }
ETokenType getType() const { return mType; }
const LLWString& getToolTip() const { return mToolTip; }
const LLWString& getDelimiter() const { return mDelimiter; }
@ -94,11 +96,8 @@ public:
#endif
private:
TOKEN_TYPE mType;
ETokenType mType;
LLWString mToken;
// <FS:CR> User defined syntax highlighting
//LLColor3 mColor;
// </FS:CR>
LLColor4 mColor;
LLWString mToolTip;
LLWString mDelimiter;
@ -110,21 +109,26 @@ public:
LLKeywords();
~LLKeywords();
BOOL loadFromFile(const std::string& filename);
BOOL isLoaded() const { return mLoaded; }
void clearLoaded() { mLoaded = false; }
LLColor4 getColorGroup(const std::string& key_in);
bool isLoaded() const { return mLoaded; }
// <FS:Ansariel> Re-add support for Cinder's legacy file format
bool loadFromLegacyFile(const std::string& filename);
void findSegments(std::vector<LLTextSegmentPtr> *seg_list, const LLWString& text, const LLColor4 &defaultColor, class LLTextEditor& editor );
void findSegments(std::vector<LLTextSegmentPtr> *seg_list,
const LLWString& text,
const LLColor4 &defaultColor,
class LLTextEditor& editor);
void initialize(LLSD SyntaxXML);
void processTokens();
// Add the token as described
void addToken(LLKeywordToken::TOKEN_TYPE type,
void addToken(LLKeywordToken::ETokenType type,
const std::string& key,
// <FS:CR> User defined syntax highlighting
//const LLColor3& color,
const LLColor4& color,
// </FS:CR>
const std::string& tool_tip = LLStringUtil::null,
const std::string& delimiter = LLStringUtil::null);
// This class is here as a performance optimization.
// The word token map used to be defined as std::map<LLWString, LLKeywordToken*>.
// This worked, but caused a performance bottleneck due to memory allocation and string copies
@ -148,6 +152,9 @@ public:
const llwchar *mData;
size_t mLength;
bool mOwner;
LLColor4 mColor;
};
typedef std::map<WStringMapIndex, LLKeywordToken*> word_token_map_t;
@ -155,21 +162,43 @@ public:
keyword_iterator_t begin() const { return mWordTokenMap.begin(); }
keyword_iterator_t end() const { return mWordTokenMap.end(); }
typedef std::map<WStringMapIndex, LLColor4> group_color_map_t;
typedef group_color_map_t::const_iterator color_iterator_t;
group_color_map_t mColorGroupMap;
#ifdef _DEBUG
void dump();
#endif
private:
// <FS:CR> User defined syntax highlighting - Deprecated, unused function
//LLColor3 readColor(const std::string& s);
void insertSegment(std::vector<LLTextSegmentPtr>& seg_list, LLTextSegmentPtr new_segment, S32 text_len, const LLColor4 &defaultColor, class LLTextEditor& editor);
void insertSegments(const LLWString& wtext, std::vector<LLTextSegmentPtr>& seg_list, LLKeywordToken* token, S32 text_len, S32 seg_start, S32 seg_end, const LLColor4 &defaultColor, LLTextEditor& editor);
protected:
void processTokensGroup(const LLSD& Tokens, const std::string& Group);
void insertSegment(std::vector<LLTextSegmentPtr>& seg_list,
LLTextSegmentPtr new_segment,
S32 text_len,
const LLColor4 &defaultColor,
class LLTextEditor& editor);
void insertSegments(const LLWString& wtext,
std::vector<LLTextSegmentPtr>& seg_list,
LLKeywordToken* token,
S32 text_len,
S32 seg_start,
S32 seg_end,
const LLColor4 &defaultColor,
LLTextEditor& editor);
BOOL mLoaded;
bool mLoaded;
LLSD mSyntax;
word_token_map_t mWordTokenMap;
typedef std::deque<LLKeywordToken*> token_list_t;
token_list_t mLineTokenList;
token_list_t mDelimiterTokenList;
typedef std::map<std::string, std::string> element_attributes_t;
typedef element_attributes_t::const_iterator attribute_iterator_t;
element_attributes_t mAttributes;
std::string getAttribute(const std::string& key);
std::string getArguments(LLSD& arguments);
};
#endif // LL_LLKEYWORDS_H

View File

@ -1197,6 +1197,7 @@ void LLNotificationChannel::connectToChannel( const std::string& channel_name )
}
else
{
mParents.push_back(channel_name);
LLNotificationChannelPtr p = LLNotifications::instance().getChannel(channel_name);
p->connectChanged(boost::bind(&LLNotificationChannelBase::updateItem, this, _1));
}

View File

@ -88,6 +88,7 @@
#include <boost/enable_shared_from_this.hpp>
#include <boost/type_traits.hpp>
#include <boost/signals2.hpp>
#include <boost/range.hpp>
#include "llevents.h"
#include "llfunctorregistry.h"
@ -846,6 +847,11 @@ public:
typedef LLNotificationSet::iterator Iterator;
std::string getName() const { return mName; }
typedef std::vector<std::string>::const_iterator parents_iter;
boost::iterator_range<parents_iter> getParents() const
{
return boost::iterator_range<parents_iter>(mParents);
}
void connectToChannel(const std::string& channel_name);
@ -860,7 +866,7 @@ public:
private:
std::string mName;
std::string mParent;
std::vector<std::string> mParents;
};
// An interface class to provide a clean linker seam to the LLNotifications class.

View File

@ -32,6 +32,7 @@
#include "llnotificationtemplate.h"
#include "llsd.h"
#include "llui.h"
#include <boost/foreach.hpp>
LLNotificationsListener::LLNotificationsListener(LLNotifications & notifications) :
LLEventAPI("LLNotifications",
@ -42,11 +43,10 @@ LLNotificationsListener::LLNotificationsListener(LLNotifications & notifications
"Add a notification with specified [\"name\"], [\"substitutions\"] and [\"payload\"].\n"
"If optional [\"reply\"] specified, arrange to send user response on that LLEventPump.",
&LLNotificationsListener::requestAdd);
/* add("listChannels",
add("listChannels",
"Post to [\"reply\"] a map of info on existing channels",
&LLNotificationsListener::listChannels,
LLSD().with("reply", LLSD()));
*/
add("listChannelNotifications",
"Post to [\"reply\"] an array of info on notifications in channel [\"channel\"]",
&LLNotificationsListener::listChannelNotifications,
@ -117,26 +117,27 @@ void LLNotificationsListener::NotificationResponder(const std::string& reply_pum
reponse_event["response"] = response;
LLEventPumps::getInstance()->obtain(reply_pump).post(reponse_event);
}
/*
void LLNotificationsListener::listChannels(const LLSD& params) const
{
LLReqID reqID(params);
LLSD response(reqID.makeResponse());
for (LLNotifications::
for (LLNotifications::ChannelMap::const_iterator cmi(mNotifications.mChannels.begin()),
cmend(mNotifications.mChannels.end());
for (LLNotificationChannel::instance_iter cmi(LLNotificationChannel::beginInstances()),
cmend(LLNotificationChannel::endInstances());
cmi != cmend; ++cmi)
{
LLSD channelInfo;
channelInfo["parent"] = cmi->second->getParentChannelName();
response[cmi->first] = channelInfo;
LLSD channelInfo, parents;
BOOST_FOREACH(const std::string& parent, cmi->getParents())
{
parents.append(parent);
}
channelInfo["parents"] = parents;
channelInfo["parent"] = parents.size()? parents[0] : "";
response[cmi->getName()] = channelInfo;
}
LLEventPumps::instance().obtain(params["reply"]).post(response);
}
*/
void LLNotificationsListener::listChannelNotifications(const LLSD& params) const
{
LLReqID reqID(params);

View File

@ -75,43 +75,36 @@ bool LLTextBase::compare_segment_end::operator()(const LLTextSegmentPtr& a, cons
// helper functors
struct LLTextBase::compare_bottom
bool LLTextBase::compare_bottom::operator()(const S32& a, const LLTextBase::line_info& b) const
{
bool operator()(const S32& a, const LLTextBase::line_info& b) const
{
return a > b.mRect.mBottom; // bottom of a is higher than bottom of b
}
return a > b.mRect.mBottom; // bottom of a is higher than bottom of b
}
bool operator()(const LLTextBase::line_info& a, const S32& b) const
{
return a.mRect.mBottom > b; // bottom of a is higher than bottom of b
}
bool LLTextBase::compare_bottom::operator()(const LLTextBase::line_info& a, const S32& b) const
{
return a.mRect.mBottom > b; // bottom of a is higher than bottom of b
}
bool operator()(const LLTextBase::line_info& a, const LLTextBase::line_info& b) const
{
return a.mRect.mBottom > b.mRect.mBottom; // bottom of a is higher than bottom of b
}
};
bool LLTextBase::compare_bottom::operator()(const LLTextBase::line_info& a, const LLTextBase::line_info& b) const
{
return a.mRect.mBottom > b.mRect.mBottom; // bottom of a is higher than bottom of b
}
// helper functors
struct LLTextBase::compare_top
bool LLTextBase::compare_top::operator()(const S32& a, const LLTextBase::line_info& b) const
{
bool operator()(const S32& a, const LLTextBase::line_info& b) const
{
return a > b.mRect.mTop; // top of a is higher than top of b
}
return a > b.mRect.mTop; // top of a is higher than top of b
}
bool operator()(const LLTextBase::line_info& a, const S32& b) const
{
return a.mRect.mTop > b; // top of a is higher than top of b
}
bool LLTextBase::compare_top::operator()(const LLTextBase::line_info& a, const S32& b) const
{
return a.mRect.mTop > b; // top of a is higher than top of b
}
bool operator()(const LLTextBase::line_info& a, const LLTextBase::line_info& b) const
{
return a.mRect.mTop > b.mRect.mTop; // top of a is higher than top of b
}
};
bool LLTextBase::compare_top::operator()(const LLTextBase::line_info& a, const LLTextBase::line_info& b) const
{
return a.mRect.mTop > b.mRect.mTop; // top of a is higher than top of b
}
struct LLTextBase::line_end_compare
{
@ -651,7 +644,8 @@ void LLTextBase::drawText()
if ( (getSpellCheck()) && (getWText().length() > 2) )
{
// Calculate start and end indices for the spell checking range
S32 start = line_start, end = getLineEnd(last_line);
S32 start = line_start;
S32 end = getLineEnd(last_line);
if ( (mSpellCheckStart != start) || (mSpellCheckEnd != end) )
{

View File

@ -495,9 +495,31 @@ public:
LLScrollContainer* getScrollContainer() const { return mScroller; }
protected:
// protected member variables
// List of offsets and segment index of the start of each line. Always has at least one node (0).
struct line_info
{
line_info(S32 index_start, S32 index_end, LLRect rect, S32 line_num);
S32 mDocIndexStart;
S32 mDocIndexEnd;
LLRect mRect;
S32 mLineNum; // actual line count (ignoring soft newlines due to word wrap)
};
typedef std::vector<line_info> line_list_t;
// helper structs
struct compare_bottom;
struct compare_top;
struct compare_bottom
{
bool operator()(const S32& a, const line_info& b) const;
bool operator()(const line_info& a, const S32& b) const;
bool operator()(const line_info& a, const line_info& b) const;
};
struct compare_top
{
bool operator()(const S32& a, const line_info& b) const;
bool operator()(const line_info& a, const S32& b) const;
bool operator()(const line_info& a, const line_info& b) const;
};
struct line_end_compare;
typedef std::vector<LLTextSegmentPtr> segment_vec_t;
// [SL:KB] - Patch: Control-TextHighlight | Checked: 2013-12-30 (Catznip-3.6)
@ -549,18 +571,6 @@ protected:
};
typedef std::multiset<LLTextSegmentPtr, compare_segment_end> segment_set_t;
// protected member variables
// List of offsets and segment index of the start of each line. Always has at least one node (0).
struct line_info
{
line_info(S32 index_start, S32 index_end, LLRect rect, S32 line_num);
S32 mDocIndexStart;
S32 mDocIndexEnd;
LLRect mRect;
S32 mLineNum; // actual line count (ignoring soft newlines due to word wrap)
};
typedef std::vector<line_info> line_list_t;
// member functions
LLTextBase(const Params &p);
virtual ~LLTextBase();
@ -570,7 +580,7 @@ protected:
virtual bool useLabel() const;
// draw methods
void drawSelectionBackground(); // draws the black box behind the selected text
virtual void drawSelectionBackground(); // draws the black box behind the selected text
// [SL:KB] - Patch: Control-TextHighlight | Checked: 2013-12-30 (Catznip-3.6)
void drawHighlightsBackground(const highlight_list_t& highlights, const LLColor4& color);
// [/SL:KB]

View File

@ -75,8 +75,6 @@ template class LLTextEditor* LLView::getChild<class LLTextEditor>(
//
// Constants
//
const S32 UI_TEXTEDITOR_LINE_NUMBER_MARGIN = 32;
const S32 UI_TEXTEDITOR_LINE_NUMBER_DIGITS = 4;
const S32 SPACES_PER_TAB = 4;
const F32 SPELLCHECK_DELAY = 0.5f; // delay between the last keypress and spell checking the word the cursor is on
@ -236,7 +234,6 @@ LLTextEditor::Params::Params()
prevalidate_callback("prevalidate_callback"),
embedded_items("embedded_items", false),
ignore_tab("ignore_tab", true),
show_line_numbers("show_line_numbers", false),
auto_indent("auto_indent", true),
default_color("default_color"),
commit_on_focus_lost("commit_on_focus_lost", false),
@ -252,8 +249,7 @@ LLTextEditor::LLTextEditor(const LLTextEditor::Params& p) :
mBaseDocIsPristine(TRUE),
mPristineCmd( NULL ),
mLastCmd( NULL ),
mDefaultColor( p.default_color() ),
mShowLineNumbers ( p.show_line_numbers ),
mDefaultColor( p.default_color() ),
mAutoIndent(p.auto_indent),
mCommitOnFocusLost( p.commit_on_focus_lost),
mAllowEmbeddedItems( p.embedded_items ),
@ -278,14 +274,7 @@ LLTextEditor::LLTextEditor(const LLTextEditor::Params& p) :
params.visible = p.border_visible;
mBorder = LLUICtrlFactory::create<LLViewBorder> (params);
addChild( mBorder );
setText(p.default_text());
if (mShowLineNumbers)
{
mHPad += UI_TEXTEDITOR_LINE_NUMBER_MARGIN;
updateRects();
}
mParseOnTheFly = TRUE;
}
@ -2310,69 +2299,6 @@ void LLTextEditor::drawPreeditMarker()
}
}
void LLTextEditor::drawLineNumbers()
{
LLGLSUIDefault gls_ui;
LLRect scrolled_view_rect = getVisibleDocumentRect();
LLRect content_rect = getVisibleTextRect();
LLLocalClipRect clip(content_rect);
S32 first_line = getFirstVisibleLine();
S32 num_lines = getLineCount();
if (first_line >= num_lines)
{
return;
}
S32 cursor_line = mLineInfoList[getLineNumFromDocIndex(mCursorPos)].mLineNum;
if (mShowLineNumbers)
{
S32 left = 0;
S32 top = getRect().getHeight();
S32 bottom = 0;
gl_rect_2d(left, top, UI_TEXTEDITOR_LINE_NUMBER_MARGIN, bottom, mReadOnlyBgColor.get() ); // line number area always read-only
gl_rect_2d(UI_TEXTEDITOR_LINE_NUMBER_MARGIN, top, UI_TEXTEDITOR_LINE_NUMBER_MARGIN-1, bottom, LLColor4::grey3); // separator
S32 last_line_num = -1;
for (S32 cur_line = first_line; cur_line < num_lines; cur_line++)
{
line_info& line = mLineInfoList[cur_line];
if ((line.mRect.mTop - scrolled_view_rect.mBottom) < mVisibleTextRect.mBottom)
{
break;
}
S32 line_bottom = line.mRect.mBottom - scrolled_view_rect.mBottom + mVisibleTextRect.mBottom;
// draw the line numbers
if(line.mLineNum != last_line_num && line.mRect.mTop <= scrolled_view_rect.mTop)
{
const LLFontGL *num_font = LLFontGL::getFontMonospace();
const LLWString ltext = utf8str_to_wstring(llformat("%d", line.mLineNum ));
BOOL is_cur_line = cursor_line == line.mLineNum;
const U8 style = is_cur_line ? LLFontGL::BOLD : LLFontGL::NORMAL;
const LLColor4 fg_color = is_cur_line ? mCursorColor : mReadOnlyFgColor;
num_font->render(
ltext, // string to draw
0, // begin offset
UI_TEXTEDITOR_LINE_NUMBER_MARGIN - 2, // x
line_bottom, // y
fg_color,
LLFontGL::RIGHT, // horizontal alignment
LLFontGL::BOTTOM, // vertical alignment
style,
LLFontGL::NO_SHADOW,
S32_MAX, // max chars
UI_TEXTEDITOR_LINE_NUMBER_MARGIN - 2); // max pixels
last_line_num = line.mLineNum;
}
}
}
}
void LLTextEditor::draw()
{
{
@ -2384,7 +2310,6 @@ void LLTextEditor::draw()
}
LLTextBase::draw();
drawLineNumbers();
drawPreeditMarker();
@ -2638,53 +2563,6 @@ BOOL LLTextEditor::tryToRevertToPristineState()
return isPristine(); // TRUE => success
}
static LLTrace::BlockTimerStatHandle FTM_SYNTAX_HIGHLIGHTING("Syntax Highlighting");
void LLTextEditor::loadKeywords(const std::string& filename,
const std::vector<std::string>& funcs,
const std::vector<std::string>& tooltips,
const LLColor3& color)
{
LL_RECORD_BLOCK_TIME(FTM_SYNTAX_HIGHLIGHTING);
if(mKeywords.loadFromFile(filename))
{
S32 count = llmin(funcs.size(), tooltips.size());
for(S32 i = 0; i < count; i++)
{
std::string name = utf8str_trim(funcs[i]);
mKeywords.addToken(LLKeywordToken::WORD, name, color, tooltips[i] );
}
segment_vec_t segment_list;
mKeywords.findSegments(&segment_list, getWText(), mDefaultColor.get(), *this);
mSegments.clear();
segment_set_t::iterator insert_it = mSegments.begin();
for (segment_vec_t::iterator list_it = segment_list.begin(); list_it != segment_list.end(); ++list_it)
{
insert_it = mSegments.insert(insert_it, *list_it);
}
}
}
void LLTextEditor::updateSegments()
{
if (mReflowIndex < S32_MAX && mKeywords.isLoaded() && mParseOnTheFly)
{
LL_RECORD_BLOCK_TIME(FTM_SYNTAX_HIGHLIGHTING);
// HACK: No non-ascii keywords for now
segment_vec_t segment_list;
mKeywords.findSegments(&segment_list, getWText(), mDefaultColor.get(), *this);
clearSegments();
for (segment_vec_t::iterator list_it = segment_list.begin(); list_it != segment_list.end(); ++list_it)
{
insertSegment(*list_it);
}
}
LLTextBase::updateSegments();
}
void LLTextEditor::updateLinkSegments()
{
LLWString wtext = getWText();

View File

@ -1,25 +1,25 @@
/**
/**
* @file lltexteditor.h
* @brief LLTextEditor base class
*
* $LicenseInfo:firstyear=2001&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$
*/
@ -30,7 +30,6 @@
#define LL_LLTEXTEDITOR_H
#include "llrect.h"
#include "llkeywords.h"
#include "llframetimer.h"
#include "llstyle.h"
#include "lleditmenuhandler.h"
@ -43,7 +42,6 @@
class LLFontGL;
class LLScrollbar;
class LLKeywordToken;
class TextCmd;
class LLUICtrlFactory;
class LLScrollContainer;
@ -60,7 +58,6 @@ public:
Optional<bool> embedded_items,
ignore_tab,
show_line_numbers,
commit_on_focus_lost,
show_context_menu,
enable_tooltip_paste,
@ -131,7 +128,7 @@ public:
virtual BOOL canCopy() const;
virtual void paste();
virtual BOOL canPaste() const;
virtual void updatePrimary();
virtual void copyPrimary();
virtual void pastePrimary();
@ -155,7 +152,7 @@ public:
// BOOL replaceText(const std::string& search_text, const std::string& replace_text, BOOL case_insensitive, BOOL wrap = TRUE);
void replaceTextAll(const std::string& search_text, const std::string& replace_text, BOOL case_insensitive);
// Undo/redo stack
void blockUndo();
@ -195,13 +192,6 @@ public:
void getCurrentLineAndColumn( S32* line, S32* col, BOOL include_wordwrap );
void loadKeywords(const std::string& filename,
const std::vector<std::string>& funcs,
const std::vector<std::string>& tooltips,
const LLColor3& func_color);
LLKeywords::keyword_iterator_t keywordsBegin() { return mKeywords.begin(); }
LLKeywords::keyword_iterator_t keywordsEnd() { return mKeywords.end(); }
// Hacky methods to make it into a word-wrapping, potentially scrolling,
// read-only text box.
@ -214,7 +204,7 @@ public:
const LLUUID& getSourceID() const { return mSourceID; }
const LLTextSegmentPtr getPreviousSegment() const;
void getSelectedSegments(segment_vec_t& segments) const;
void getSelectedSegments(segment_vec_t& segments) const;
void setShowContextMenu(bool show) { mShowContextMenu = show; }
bool getShowContextMenu() const { return mShowContextMenu; }
@ -226,7 +216,7 @@ protected:
void drawPreeditMarker();
void assignEmbedded(const std::string &s);
void removeCharOrTab();
void indentSelectedLines( S32 spaces );
@ -245,12 +235,12 @@ protected:
S32 nextWordPos(S32 cursorPos) const;
void autoIndent();
void findEmbeddedItemSegments(S32 start, S32 end);
void getSegmentsInRange(segment_vec_t& segments, S32 start, S32 end, bool include_partial) const;
virtual llwchar pasteEmbeddedItem(llwchar ext_char) { return ext_char; }
// Here's the method that takes and applies text commands.
S32 execute(TextCmd* cmd);
@ -266,7 +256,7 @@ protected:
void removeWord(bool prev);
S32 insert(S32 pos, const LLWString &wstr, bool group_with_next_op, LLTextSegmentPtr segment);
S32 remove(S32 pos, S32 length, bool group_with_next_op);
void focusLostHelper();
void updateAllowingLanguageInput();
BOOL hasPreeditString() const;
@ -284,14 +274,14 @@ protected:
//
// Protected data
//
// Probably deserves serious thought to hiding as many of these
// Probably deserves serious thought to hiding as many of these
// as possible behind protected accessor methods.
//
// Use these to determine if a click on an embedded item is a drag or not.
S32 mMouseDownX;
S32 mMouseDownY;
LLWString mPreeditWString;
LLWString mPreeditOverwrittenWString;
std::vector<S32> mPreeditPositions;
@ -300,12 +290,12 @@ protected:
protected:
LLUIColor mDefaultColor;
BOOL mShowLineNumbers;
bool mAutoIndent;
bool mParseOnTheFly;
/*virtual*/ void updateSegments();
void updateLinkSegments();
void keepSelectionOnReturn(bool keep) { mKeepSelectionOnReturn = keep; }
class LLViewBorder* mBorder;
private:
//
@ -315,23 +305,14 @@ private:
void cleanStringForPaste(LLWString & clean_string);
void pasteTextWithLinebreaks(LLWString & clean_string);
void drawLineNumbers();
void onKeyStroke();
//
// Data
//
LLKeywords mKeywords;
// Concrete TextCmd sub-classes used by the LLTextEditor base class
class TextCmdInsert;
class TextCmdAddChar;
class TextCmdOverwriteChar;
class TextCmdRemove;
class LLViewBorder* mBorder;
BOOL mBaseDocIsPristine;
TextCmd* mPristineCmd;
@ -346,7 +327,6 @@ private:
BOOL mAllowEmbeddedItems;
bool mShowContextMenu;
bool mParseOnTheFly;
bool mEnableTooltipPaste;
bool mPassDelete;
bool mKeepSelectionOnReturn; // disabling of removing selected text after pressing of Enter
@ -367,4 +347,4 @@ extern template class LLTextEditor* LLView::getChild<class LLTextEditor>(
const std::string& name, BOOL recurse) const;
#endif
#endif // LL_TEXTEDITOR_
#endif // LL_TEXTEDITOR_H

View File

@ -30,7 +30,7 @@
#include "llxmlnode.h"
#include "llfasttimer.h"
#ifdef LL_STANDALONE
#ifdef LL_USESYSTEMLIBS
#include <expat.h>
#else
#include "expat/expat.h"

View File

@ -105,7 +105,7 @@ BOOL LLVFile::read(U8 *buffer, S32 bytes, BOOL async, F32 priority)
// We can't do a read while there are pending async writes
waitForLock(VFSLOCK_APPEND);
// *FIX: (???)
// *FIX: (?)
if (async)
{
mHandle = sVFSThread->read(mVFS, mFileID, mFileType, buffer, mPosition, bytes, threadPri());

View File

@ -51,9 +51,9 @@ namespace tut
void test_chop_662(void)
{
// Check a selection of bad group names from the crash reports
LLDirIterator iter(".","+bad-group-name]+??-??.*");
LLDirIterator iter1(".","))--@---bad-group-name2((??-??.*\\.txt");
LLDirIterator iter2(".","__^v--x)Cuide d sua vida(x--v^__??-??.*");
LLDirIterator iter(".","+bad-group-name]+?\?-??.*");
LLDirIterator iter1(".","))--@---bad-group-name2((?\?-??.*\\.txt");
LLDirIterator iter2(".","__^v--x)Cuide d sua vida(x--v^__?\?-??.*");
}
template<> template<>

View File

@ -80,7 +80,7 @@ S32 OSMessageBox(const std::string& text, const std::string& caption, U32 type)
}
S32 result = 0;
#if LL_MESA_HEADLESS // !!! *FIX: (???)
#if LL_MESA_HEADLESS // !!! *FIX: (?)
LL_WARNS() << "OSMessageBox: " << text << LL_ENDL;
return OSBTN_OK;
#elif LL_WINDOWS
@ -332,7 +332,7 @@ bool LLSplashScreen::isVisible()
// static
LLSplashScreen *LLSplashScreen::create()
{
#if LL_MESA_HEADLESS || LL_SDL // !!! *FIX: (???)
#if LL_MESA_HEADLESS || LL_SDL // !!! *FIX: (?)
return 0;
#elif LL_WINDOWS
return new LLSplashScreenWin32;

View File

@ -39,6 +39,7 @@
#include "indra_constants.h"
#include <OpenGL/OpenGL.h>
#include <Carbon/Carbon.h>
#include <CoreServices/CoreServices.h>
extern BOOL gDebugWindowProc;
@ -1799,16 +1800,34 @@ LLSD LLWindowMacOSX::getNativeKeyData()
return result;
}
BOOL LLWindowMacOSX::dialogColorPicker( F32 *r, F32 *g, F32 *b)
{
// Is this even used anywhere? Do we really need an OS color picker?
BOOL retval = FALSE;
//S32 error = 0;
OSErr error = noErr;
NColorPickerInfo info;
memset(&info, 0, sizeof(info));
info.theColor.color.rgb.red = (UInt16)(*r * 65535.f);
info.theColor.color.rgb.green = (UInt16)(*g * 65535.f);
info.theColor.color.rgb.blue = (UInt16)(*b * 65535.f);
info.placeWhere = kCenterOnMainScreen;
error = NPickColor(&info);
if (error == noErr)
{
retval = info.newColorChosen;
if (info.newColorChosen)
{
*r = ((float) info.theColor.color.rgb.red) / 65535.0;
*g = ((float) info.theColor.color.rgb.green) / 65535.0;
*b = ((float) info.theColor.color.rgb.blue) / 65535.0;
}
}
return (retval);
}
void *LLWindowMacOSX::getPlatformWindow()
{
// NOTE: this will be NULL in fullscreen mode. Plan accordingly.

View File

@ -232,7 +232,7 @@ LLWindowSDL::LLWindowSDL(LLWindowCallbacks* callbacks,
mOriginalAspectRatio = 1024.0 / 768.0;
if (title.empty())
mWindowTitle = "SDL Window"; // *FIX: (???)
mWindowTitle = "SDL Window"; // *FIX: (?)
else
mWindowTitle = title;
@ -979,7 +979,7 @@ BOOL LLWindowSDL::setPosition(const LLCoordScreen position)
{
if(mWindow)
{
// *FIX: (???)
// *FIX: (?)
//MacMoveWindow(mWindow, position.mX, position.mY, false);
}

View File

@ -30,7 +30,7 @@
#ifndef XML_STATIC
#define XML_STATIC
#endif
#ifdef LL_STANDALONE
#ifdef LL_USESYSTEMLIBS
#include <expat.h>
#else
#include "expat/expat.h"

View File

@ -30,7 +30,7 @@
#ifndef XML_STATIC
#define XML_STATIC
#endif
#ifdef LL_STANDALONE
#ifdef LL_USESYSTEMLIBS
#include <expat.h>
#else
#include "expat/expat.h"

View File

@ -384,6 +384,7 @@ set(viewer_SOURCE_FILES
llfloaterregionrestarting.cpp
llfloatersceneloadstats.cpp
llfloaterscriptdebug.cpp
llfloaterscriptedprefs.cpp
llfloaterscriptlimits.cpp
llfloaterscriptrecover.cpp
llfloatersearch.cpp
@ -611,6 +612,7 @@ set(viewer_SOURCE_FILES
llscenemonitor.cpp
llsceneview.cpp
llscreenchannel.cpp
llscripteditor.cpp
llscriptfloater.cpp
llscrollingpanelparam.cpp
llscrollingpanelparambase.cpp
@ -640,6 +642,7 @@ set(viewer_SOURCE_FILES
llstylemap.cpp
llsurface.cpp
llsurfacepatch.cpp
llsyntaxid.cpp
llsyswellitem.cpp
llsyswellwindow.cpp
llteleporthistory.cpp
@ -1109,6 +1112,7 @@ set(viewer_HEADER_FILES
llfloaterregionrestarting.h
llfloatersceneloadstats.h
llfloaterscriptdebug.h
llfloaterscriptedprefs.h
llfloaterscriptlimits.h
llfloaterscriptrecover.h
llfloatersearch.h
@ -1323,6 +1327,7 @@ set(viewer_HEADER_FILES
llscenemonitor.h
llsceneview.h
llscreenchannel.h
llscripteditor.h
llscriptfloater.h
llscrollingpanelparam.h
llscrollingpanelparambase.h
@ -1351,6 +1356,7 @@ set(viewer_HEADER_FILES
llstylemap.h
llsurface.h
llsurfacepatch.h
llsyntaxid.h
llsyswellitem.h
llsyswellwindow.h
lltable.h
@ -1787,9 +1793,9 @@ if (WINDOWS)
SOURCE_GROUP("Resource Files" FILES ${viewer_RESOURCE_FILES})
if (NOT STANDALONE)
if (NOT USESYSTEMLIBS)
list(APPEND viewer_SOURCE_FILES ${viewer_RESOURCE_FILES})
endif (NOT STANDALONE)
endif (NOT USESYSTEMLIBS)
find_library(DINPUT_LIBRARY dinput8 ${DIRECTX_LIBRARY_DIR})
find_library(DXGUID_LIBRARY dxguid ${DIRECTX_LIBRARY_DIR})
@ -1865,7 +1871,7 @@ set(viewer_APPSETTINGS_FILES
app_settings/ignorable_dialogs.xml
app_settings/keys.xml
app_settings/keys_azerty.xml
app_settings/keywords.ini
app_settings/keywords_lsl_default.xml
app_settings/logcontrol.xml
app_settings/low_graphics.xml
app_settings/mid_graphics.xml
@ -1912,9 +1918,9 @@ source_group("Character File" FILES ${viewer_CHARACTER_FILES})
set_source_files_properties(${viewer_CHARACTER_FILES}
PROPERTIES HEADER_FILE_ONLY TRUE)
if (NOT STANDALONE)
if (NOT USESYSTEMLIBS)
list(APPEND viewer_SOURCE_FILES ${viewer_CHARACTER_FILES})
endif (NOT STANDALONE)
endif (NOT USESYSTEMLIBS)
if (WINDOWS)
file(GLOB viewer_INSTALLER_FILES installers/windows/*.nsi)
@ -2224,7 +2230,7 @@ elseif (DARWIN)
LINK_FLAGS_RELEASE "${LINK_FLAGS_RELEASE} -Xlinker -dead_strip -Xlinker -map -Xlinker ${CMAKE_CURRENT_BINARY_DIR}/${VIEWER_BINARY_NAME}.MAP"
)
else (WINDOWS)
# Linux
# Linux
set_target_properties(${VIEWER_BINARY_NAME}
PROPERTIES
LINK_FLAGS_RELEASE "${LINK_FLAGS_RELEASE} -Wl,--Map=${VIEWER_BINARY_NAME}.MAP"
@ -2431,7 +2437,7 @@ if (DARWIN)
)
add_dependencies(${VIEWER_BINARY_NAME} SLPlugin mac-crash-logger)
if (ENABLE_SIGNING)
set(SIGNING_SETTING "--signature=${SIGNING_IDENTITY}")
else (ENABLE_SIGNING)

File diff suppressed because it is too large Load Diff

View File

@ -0,0 +1,390 @@
<?xml version="1.0" encoding="UTF-8"?>
<grammar
xmlns="http://relaxng.org/ns/structure/1.0"
xmlns:a="http://relaxng.org/ns/compatibility/annotations/1.0"
datatypeLibrary="http://www.w3.org/2001/XMLSchema-datatypes">
<start>
<element name="llsd">
<element name="map">
<group>
<element name="key">
<value>constants</value>
</element>
<element name="map">
<oneOrMore>
<group>
<ref name="keyString"/>
<element name="map">
<ref name="Deprecated" />
<ref name="constantTypeValue" />
<ref name="Tooltip" />
</element>
</group>
</oneOrMore>
</element>
</group>
<group>
<element name="key">
<value>controls</value>
</element>
<element name="map">
<oneOrMore>
<group>
<ref name="keyString"/>
<ref name="mapTooltip"/>
</group>
</oneOrMore>
</element>
</group>
<group>
<element name="key">
<value>events</value>
</element>
<element name="map">
<oneOrMore>
<group>
<ref name="keyString"/>
<element name="map">
<ref name="Deprecated" />
<ref name="Arguments"/>
<ref name="Tooltip"/>
</element>
</group>
</oneOrMore>
</element>
</group>
<group>
<element name="key">
<value>functions</value>
</element>
<element name="map">
<oneOrMore>
<group>
<ref name="keyString"/>
<element name="map">
<ref name="Arguments"/>
<ref name="Deprecated" />
<element name="key">
<value>energy</value>
</element>
<ref name="float"/>
<optional>
<group>
<element name="key">
<value>god-mode</value>
</element>
<element name="boolean">
<data type="boolean"/>
</element>
</group>
</optional>
<ref name="Return"/>
<element name="key">
<value>sleep</value>
</element>
<ref name="float"/>
<ref name="Tooltip"/>
</element>
</group>
</oneOrMore>
</element>
</group>
<group>
<element name="key">
<value>llsd-lsl-syntax-version</value>
</element>
<element name="integer">
<data type="integer" />
</element>
</group>
<group>
<element name="key">
<value>types</value>
</element>
<element name="map">
<oneOrMore>
<group>
<ref name="keyString"/>
<ref name="mapTooltip"/>
</group>
</oneOrMore>
</element>
</group>
</element>
</element>
</start>
<define name="Deprecated">
<optional>
<group>
<element name="key">
<value>deprecated</value>
</element>
<element name="boolean">
<data type="boolean"/>
</element>
</group>
</optional>
</define>
<define name="keyName">
<element name="key"><value>name</value></element>
<element name="string"><data type="string" /></element>
</define>
<define name="keyString">
<element name="key"><data type="string"/></element>
</define>
<define name="keyType">
<element name="key"><value>type</value></element>
</define>
<define name="typeList">
<ref name="keyType" />
<element name="string">
<choice>
<value>float</value>
<value>integer</value>
<value>key</value>
<value>list</value>
<value>rotation</value>
<value>string</value>
<value>vector</value>
</choice>
</element>
</define>
<define name="keyValue">
<element name="key"><value>value</value></element>
</define>
<define name="constantTypeValue">
<choice>
<group>
<ref name="keyType"/>
<element name="string"><value>float</value></element>
<ref name="keyValue"/>
<element name="real"><data type="float"/></element>
</group>
<group>
<ref name="keyType"/>
<element name="string"><value>integer</value></element>
<ref name="keyValue"/>
<choice>
<element name="integer"><data type="integer"/></element>
<element name="integer"><data type="string"><param name="pattern">0x[0-9A-Fa-f]+</param></data></element>
</choice>
</group>
<group>
<ref name="keyType"/>
<element name="string"><value>key</value></element>
<ref name="keyValue"/>
<element name="uuid"><data type="string"><param name="pattern">[0-9A-Fa-f]{8}-[0-9A-Fa-f]{4}-[0-9A-Fa-f]{4}-[0-9A-Fa-f]{4}-[0-9A-Fa-f]{12}</param></data></element>
</group>
<group>
<ref name="keyType"/>
<element name="string"><value>rotation</value></element>
<ref name="keyValue"/>
<element name="array">
<element name="map">
<element name="key">
<value>x</value>
</element>
<ref name="realFromMinusOneToOne"/>
</element>
<element name="map">
<element name="key">
<value>y</value>
</element>
<ref name="realFromMinusOneToOne"/>
</element>
<element name="map">
<element name="key">
<value>z</value>
</element>
<ref name="realFromMinusOneToOne"/>
</element>
<element name="map">
<element name="key"><value>w</value></element>
<ref name="realFromMinusOneToOne"/>
</element>
</element>
</group>
<group>
<ref name="keyType"/>
<element name="string"><value>string</value></element>
<ref name="keyValue"/>
<element name="string">
<data type="string"/>
</element>
</group>
<group>
<ref name="keyType"/>
<element name="string">
<value>vector</value>
</element>
<ref name="keyValue"/>
<element name="array">
<ref name="vector"/>
</element>
</group>
</choice>
</define>
<define name="nameType">
<ref name="keyName" />
<ref name="keyType" />
</define>
<define name="realFromMinusOneToOne">
<element name="real">
<data type="float">
<param name="pattern">([\-+]|)(1|0)\.\d+</param>
</data>
</element>
</define>
<define name="float">
<choice>
<element name="real">
<data type="float"/>
</element>
<element name="real">
<empty/>
</element>
</choice>
</define>
<define name="vector">
<element name="map">
<element name="key">
<value>x</value>
</element>
<ref name="realFromMinusOneToOne"/>
</element>
<element name="map">
<element name="key">
<value>y</value>
</element>
<ref name="realFromMinusOneToOne"/>
</element>
<element name="map">
<element name="key">
<value>z</value>
</element>
<ref name="realFromMinusOneToOne"/>
</element>
</define>
<define name="mapTooltip">
<element name="map">
<ref name="Tooltip" />
</element>
</define>
<define name="Tooltip">
<element name="key">
<value>tooltip</value>
</element>
<element name="string">
<data type="string" />
</element>
</define>
<define name="Arguments">
<element name="key"><value>arguments</value></element>
<choice>
<element name="array">
<oneOrMore>
<element name="map">
<element name="key"><data type="string"><param name="pattern">[A-Z][A-Za-z0-9_]*|[a-z]</param></data></element>
<element name="map">
<!--ref name="keyName" /-->
<ref name="Tooltip" />
<ref name="typeList" />
</element>
</element>
</oneOrMore>
<!--choice>
<oneOrMore>
<element name="map">
<ref name="Argument"/>
</element>
</oneOrMore>
<element name="undef">
<empty/>
</element>
</choice-->
</element>
<element name="undef"><empty/></element>
</choice>
</define>
<define name="Argument">
<ref name="keyType"/>
<choice>
<element name="string">
<value>float</value>
</element>
<element name="string">
<value>integer</value>
</element>
<element name="string">
<value>key</value>
</element>
<element name="string">
<value>list</value>
</element>
<element name="string">
<value>rotation</value>
</element>
<element name="string">
<value>string</value>
</element>
<element name="string">
<value>vector</value>
</element>
</choice>
<ref name="Tooltip"/>
</define>
<define name="Return">
<element name="key">
<value>return</value>
</element>
<choice>
<element name="string">
<value>float</value>
</element>
<element name="string">
<value>integer</value>
</element>
<element name="string">
<value>key</value>
</element>
<element name="string">
<value>list</value>
</element>
<element name="string">
<value>rotation</value>
</element>
<element name="string">
<value>string</value>
</element>
<element name="string">
<value>vector</value>
</element>
<element name="string">
<value>void</value>
</element>
</choice>
</define>
</grammar>

View File

@ -5728,17 +5728,6 @@
<key>Value</key>
<string>http://events.secondlife.com/viewer/embed/event/</string>
</map>
<key>EveryoneCopy</key>
<map>
<key>Comment</key>
<string>Everyone can copy the newly created objects</string>
<key>Persist</key>
<integer>1</integer>
<key>Type</key>
<string>Boolean</string>
<key>Value</key>
<integer>0</integer>
</map>
<key>FastCacheFetchEnabled</key>
<map>
<key>Comment</key>
@ -9042,39 +9031,6 @@
<key>Value</key>
<real>2.0</real>
</map>
<key>NextOwnerCopy</key>
<map>
<key>Comment</key>
<string>Newly created objects can be copied by next owner</string>
<key>Persist</key>
<integer>1</integer>
<key>Type</key>
<string>Boolean</string>
<key>Value</key>
<integer>0</integer>
</map>
<key>NextOwnerModify</key>
<map>
<key>Comment</key>
<string>Newly created objects can be modified by next owner</string>
<key>Persist</key>
<integer>1</integer>
<key>Type</key>
<string>Boolean</string>
<key>Value</key>
<integer>0</integer>
</map>
<key>NextOwnerTransfer</key>
<map>
<key>Comment</key>
<string>Newly created objects can be resold or given away by next owner</string>
<key>Persist</key>
<integer>1</integer>
<key>Type</key>
<string>Boolean</string>
<key>Value</key>
<integer>1</integer>
</map>
<key>NewCacheLocation</key>
<map>
<key>Comment</key>
@ -11733,7 +11689,7 @@ Change of this parameter will affect the layout of buttons in notification toast
<key>Type</key>
<string>F32</string>
<key>Value</key>
<real>384</real>
<real>368.0</real>
<key>Backup</key>
<integer>0</integer>
</map>
@ -13395,17 +13351,6 @@ Change of this parameter will affect the layout of buttons in notification toast
<key>Backup</key>
<integer>0</integer>
</map>
<key>ShareWithGroup</key>
<map>
<key>Comment</key>
<string>Newly created objects are shared with the currently active group</string>
<key>Persist</key>
<integer>1</integer>
<key>Type</key>
<string>Boolean</string>
<key>Value</key>
<integer>0</integer>
</map>
<key>ShowAdvancedGraphicsSettings</key>
<map>
<key>Comment</key>
@ -18882,6 +18827,347 @@ Change of this parameter will affect the layout of buttons in notification toast
<integer>0</integer>
<key>Backup</key>
<integer>0</integer>
</map>
<key>ObjectsNextOwnerCopy</key>
<map>
<key>Comment</key>
<string>Newly created objects can be copied by next owner</string>
<key>Persist</key>
<integer>1</integer>
<key>Type</key>
<string>Boolean</string>
<key>Value</key>
<integer>0</integer>
</map>
<key>ObjectsNextOwnerModify</key>
<map>
<key>Comment</key>
<string>Newly created objects can be modified by next owner</string>
<key>Persist</key>
<integer>1</integer>
<key>Type</key>
<string>Boolean</string>
<key>Value</key>
<integer>0</integer>
</map>
<key>ObjectsNextOwnerTransfer</key>
<map>
<key>Comment</key>
<string>Newly created objects can be resold or given away by next owner</string>
<key>Persist</key>
<integer>1</integer>
<key>Type</key>
<string>Boolean</string>
<key>Value</key>
<integer>1</integer>
</map>
<key>ObjectsEveryoneCopy</key>
<map>
<key>Comment</key>
<string>Everyone can copy the newly created object</string>
<key>Persist</key>
<integer>1</integer>
<key>Type</key>
<string>Boolean</string>
<key>Value</key>
<integer>0</integer>
</map>
<key>ObjectsShareWithGroup</key>
<map>
<key>Comment</key>
<string>Newly created objects are shared with the currently active group</string>
<key>Persist</key>
<integer>1</integer>
<key>Type</key>
<string>Boolean</string>
<key>Value</key>
<integer>0</integer>
</map>
<key>UploadsNextOwnerCopy</key>
<map>
<key>Comment</key>
<string>Newly uploaded items can be copied by next owner</string>
<key>Persist</key>
<integer>1</integer>
<key>Type</key>
<string>Boolean</string>
<key>Value</key>
<integer>0</integer>
</map>
<key>UploadsNextOwnerModify</key>
<map>
<key>Comment</key>
<string>Newly uploaded items can be modified by next owner</string>
<key>Persist</key>
<integer>1</integer>
<key>Type</key>
<string>Boolean</string>
<key>Value</key>
<integer>0</integer>
</map>
<key>UploadsNextOwnerTransfer</key>
<map>
<key>Comment</key>
<string>Newly uploaded items can be resold or given away by next owner</string>
<key>Persist</key>
<integer>1</integer>
<key>Type</key>
<string>Boolean</string>
<key>Value</key>
<integer>1</integer>
</map>
<key>UploadsEveryoneCopy</key>
<map>
<key>Comment</key>
<string>Everyone can copy the newly uploaded item</string>
<key>Persist</key>
<integer>1</integer>
<key>Type</key>
<string>Boolean</string>
<key>Value</key>
<integer>0</integer>
</map>
<key>UploadsShareWithGroup</key>
<map>
<key>Comment</key>
<string>Newly uploaded items are shared with the currently active group</string>
<key>Persist</key>
<integer>1</integer>
<key>Type</key>
<string>Boolean</string>
<key>Value</key>
<integer>0</integer>
</map>
<key>ScriptsNextOwnerCopy</key>
<map>
<key>Comment</key>
<string>Newly created scripts can be copied by next owner</string>
<key>Persist</key>
<integer>1</integer>
<key>Type</key>
<string>Boolean</string>
<key>Value</key>
<integer>0</integer>
</map>
<key>ScriptsNextOwnerModify</key>
<map>
<key>Comment</key>
<string>Newly created scripts can be modified by next owner</string>
<key>Persist</key>
<integer>1</integer>
<key>Type</key>
<string>Boolean</string>
<key>Value</key>
<integer>0</integer>
</map>
<key>ScriptsNextOwnerTransfer</key>
<map>
<key>Comment</key>
<string>Newly created scripts can be resold or given away by next owner</string>
<key>Persist</key>
<integer>1</integer>
<key>Type</key>
<string>Boolean</string>
<key>Value</key>
<integer>1</integer>
</map>
<key>ScriptsEveryoneCopy</key>
<map>
<key>Comment</key>
<string>Everyone can copy the newly created script</string>
<key>Persist</key>
<integer>1</integer>
<key>Type</key>
<string>Boolean</string>
<key>Value</key>
<integer>0</integer>
</map>
<key>ScriptsShareWithGroup</key>
<map>
<key>Comment</key>
<string>Newly created scripts are shared with the currently active group</string>
<key>Persist</key>
<integer>1</integer>
<key>Type</key>
<string>Boolean</string>
<key>Value</key>
<integer>0</integer>
</map>
<key>NotecardsNextOwnerCopy</key>
<map>
<key>Comment</key>
<string>Newly created notecards can be copied by next owner</string>
<key>Persist</key>
<integer>1</integer>
<key>Type</key>
<string>Boolean</string>
<key>Value</key>
<integer>1</integer>
</map>
<key>NotecardsNextOwnerModify</key>
<map>
<key>Comment</key>
<string>Newly created notecards can be modified by next owner</string>
<key>Persist</key>
<integer>1</integer>
<key>Type</key>
<string>Boolean</string>
<key>Value</key>
<integer>1</integer>
</map>
<key>NotecardsNextOwnerTransfer</key>
<map>
<key>Comment</key>
<string>Newly created notecards can be resold or given away by next owner</string>
<key>Persist</key>
<integer>1</integer>
<key>Type</key>
<string>Boolean</string>
<key>Value</key>
<integer>1</integer>
</map>
<key>NotecardsEveryoneCopy</key>
<map>
<key>Comment</key>
<string>Everyone can copy the newly created notecard</string>
<key>Persist</key>
<integer>1</integer>
<key>Type</key>
<string>Boolean</string>
<key>Value</key>
<integer>0</integer>
</map>
<key>NotecardsShareWithGroup</key>
<map>
<key>Comment</key>
<string>Newly created notecards are shared with the currently active group</string>
<key>Persist</key>
<integer>1</integer>
<key>Type</key>
<string>Boolean</string>
<key>Value</key>
<integer>0</integer>
</map>
<key>GesturesNextOwnerCopy</key>
<map>
<key>Comment</key>
<string>Newly created gestures can be copied by next owner</string>
<key>Persist</key>
<integer>1</integer>
<key>Type</key>
<string>Boolean</string>
<key>Value</key>
<integer>1</integer>
</map>
<key>GesturesNextOwnerModify</key>
<map>
<key>Comment</key>
<string>Newly created gestures can be modified by next owner</string>
<key>Persist</key>
<integer>1</integer>
<key>Type</key>
<string>Boolean</string>
<key>Value</key>
<integer>1</integer>
</map>
<key>GesturesNextOwnerTransfer</key>
<map>
<key>Comment</key>
<string>Newly created gestures can be resold or given away by next owner</string>
<key>Persist</key>
<integer>1</integer>
<key>Type</key>
<string>Boolean</string>
<key>Value</key>
<integer>1</integer>
</map>
<key>GesturesEveryoneCopy</key>
<map>
<key>Comment</key>
<string>Everyone can copy the newly created gesture</string>
<key>Persist</key>
<integer>1</integer>
<key>Type</key>
<string>Boolean</string>
<key>Value</key>
<integer>0</integer>
</map>
<key>GesturesShareWithGroup</key>
<map>
<key>Comment</key>
<string>Newly created gestures are shared with the currently active group</string>
<key>Persist</key>
<integer>1</integer>
<key>Type</key>
<string>Boolean</string>
<key>Value</key>
<integer>0</integer>
</map>
<key>WearablesNextOwnerCopy</key>
<map>
<key>Comment</key>
<string>Newly created clothing or body part can be copied by next owner</string>
<key>Persist</key>
<integer>1</integer>
<key>Type</key>
<string>Boolean</string>
<key>Value</key>
<integer>0</integer>
</map>
<key>WearablesNextOwnerModify</key>
<map>
<key>Comment</key>
<string>Newly created clothing or body part can be modified by next owner</string>
<key>Persist</key>
<integer>1</integer>
<key>Type</key>
<string>Boolean</string>
<key>Value</key>
<integer>0</integer>
</map>
<key>WearablesNextOwnerTransfer</key>
<map>
<key>Comment</key>
<string>Newly created clothing or body part can be resold or given away by next owner</string>
<key>Persist</key>
<integer>1</integer>
<key>Type</key>
<string>Boolean</string>
<key>Value</key>
<integer>1</integer>
</map>
<key>WearablesEveryoneCopy</key>
<map>
<key>Comment</key>
<string>Everyone can copy the newly created clothing or body part</string>
<key>Persist</key>
<integer>1</integer>
<key>Type</key>
<string>Boolean</string>
<key>Value</key>
<integer>0</integer>
</map>
<key>WearablesShareWithGroup</key>
<map>
<key>Comment</key>
<string>Newly created clothing or body part is shared with the currently active group</string>
<key>Persist</key>
<integer>1</integer>
<key>Type</key>
<string>Boolean</string>
<key>Value</key>
<integer>0</integer>
</map>
<key>DefaultUploadPermissionsConverted</key>
<map>
<key>Comment</key>
<string>Default upload permissions have been converted to default creation permissions</string>
<key>Persist</key>
<integer>1</integer>
<key>Type</key>
<string>Boolean</string>
<key>Value</key>
<integer>0</integer>
</map>
<key>PathfindingRetrieveNeighboringRegion</key>
<map>
@ -20146,6 +20432,61 @@ Change of this parameter will affect the layout of buttons in notification toast
<key>Value</key>
<string />
</map>
<key>EveryoneCopy</key>
<map>
<key>Comment</key>
<string>(obsolete) Everyone can copy the newly created objects</string>
<key>Persist</key>
<integer>1</integer>
<key>Type</key>
<string>Boolean</string>
<key>Value</key>
<integer>0</integer>
</map>
<key>NextOwnerCopy</key>
<map>
<key>Comment</key>
<string>(obsolete) Newly created objects can be copied by next owner</string>
<key>Persist</key>
<integer>1</integer>
<key>Type</key>
<string>Boolean</string>
<key>Value</key>
<integer>0</integer>
</map>
<key>NextOwnerModify</key>
<map>
<key>Comment</key>
<string>(obsolete) Newly created objects can be modified by next owner</string>
<key>Persist</key>
<integer>1</integer>
<key>Type</key>
<string>Boolean</string>
<key>Value</key>
<integer>0</integer>
</map>
<key>NextOwnerTransfer</key>
<map>
<key>Comment</key>
<string>(obsolete) Newly created objects can be resold or given away by next owner</string>
<key>Persist</key>
<integer>1</integer>
<key>Type</key>
<string>Boolean</string>
<key>Value</key>
<integer>1</integer>
</map>
<key>ShareWithGroup</key>
<map>
<key>Comment</key>
<string>(obsolete) Newly created objects are shared with the currently active group</string>
<key>Persist</key>
<integer>1</integer>
<key>Type</key>
<string>Boolean</string>
<key>Value</key>
<integer>0</integer>
</map>
<key>FSShowServerVersionChangeNotice</key>
<map>
<key>Comment</key>

View File

@ -51,6 +51,7 @@
#include "llviewerinventory.h"
#include "llvfile.h"
#include "llvoavatarself.h"
#include "llscripteditor.h"
// NaCl End
#include "fscommon.h"

File diff suppressed because it is too large Load Diff

View File

@ -47,6 +47,7 @@
#include "llfirstuse.h"
#include "llfloatercamera.h"
#include "llfloaterimcontainer.h"
#include "llfloaterperms.h"
#include "llfloaterreg.h"
#include "llfloatertools.h"
#include "llgroupactions.h"

View File

@ -49,6 +49,7 @@
#include "llvoavatarself.h"
#include "llviewerwearable.h"
#include "llwearablelist.h"
#include "llfloaterperms.h"
// [RLVa:KB] - Checked: 2011-05-22 (RLVa-1.3.1)
#include "rlvhandler.h"
#include "rlvlocks.h"
@ -72,6 +73,19 @@ void wear_and_edit_cb(const LLUUID& inv_item)
{
if (inv_item.isNull()) return;
LLViewerInventoryItem* item = gInventory.getItem(inv_item);
if (!item) return;
LLPermissions perm = item->getPermissions();
perm.setMaskNext(LLFloaterPerms::getNextOwnerPerms("Wearables"));
perm.setMaskEveryone(LLFloaterPerms::getEveryonePerms("Wearables"));
perm.setMaskGroup(LLFloaterPerms::getGroupPerms("Wearables"));
item->setPermissions(perm);
item->updateServer(FALSE);
gInventory.updateItem(item);
gInventory.notifyObservers();
// Request editing the item after it gets worn.
gAgentWearables.requestEditingWearable(inv_item);
@ -79,6 +93,26 @@ void wear_and_edit_cb(const LLUUID& inv_item)
LLAppearanceMgr::instance().wearItemOnAvatar(inv_item,true);
}
void wear_cb(const LLUUID& inv_item)
{
if (!inv_item.isNull())
{
LLViewerInventoryItem* item = gInventory.getItem(inv_item);
if (item)
{
LLPermissions perm = item->getPermissions();
perm.setMaskNext(LLFloaterPerms::getNextOwnerPerms("Wearables"));
perm.setMaskEveryone(LLFloaterPerms::getEveryonePerms("Wearables"));
perm.setMaskGroup(LLFloaterPerms::getGroupPerms("Wearables"));
item->setPermissions(perm);
item->updateServer(FALSE);
gInventory.updateItem(item);
gInventory.notifyObservers();
}
}
}
///////////////////////////////////////////////////////////////////////////////
// HACK: For EXT-3923: Pants item shows in inventory with skin icon and messes with "current look"
@ -190,7 +224,7 @@ void LLAgentWearables::setAvatarObject(LLVOAvatarSelf *avatar)
*
* Would like to pass the agent in here, but we can't safely
* count on it being around later. Just use gAgent directly.
* @param cb callback to execute on completion (??? unused ???)
* @param cb callback to execute on completion (? unused ?)
* @param type Type for the wearable in the agent
* @param wearable The wearable data.
* @param todo Bitmask of actions to take on completion.
@ -362,6 +396,7 @@ void LLAgentWearables::saveWearableAs(const LLWearableType::EType type,
LLViewerWearable* new_wearable = LLWearableList::instance().createCopy(
old_wearable,
trunc_name);
LLPointer<LLInventoryCallback> cb =
new AddWearableToAgentInventoryCallback(
LLPointer<LLRefCount>(NULL),
@ -1568,7 +1603,16 @@ void LLAgentWearables::createWearable(LLWearableType::EType type, bool wear, con
LLViewerWearable* wearable = LLWearableList::instance().createNewWearable(type, gAgentAvatarp);
LLAssetType::EType asset_type = wearable->getAssetType();
LLInventoryType::EType inv_type = LLInventoryType::IT_WEARABLE;
LLPointer<LLInventoryCallback> cb = wear ? new LLBoostFuncInventoryCallback(wear_and_edit_cb) : NULL;
LLPointer<LLInventoryCallback> cb;
if(wear)
{
cb = new LLBoostFuncInventoryCallback(wear_and_edit_cb);
}
else
{
cb = new LLBoostFuncInventoryCallback(wear_cb);
}
LLUUID folder_id;
if (parent_id.notNull())
@ -1581,10 +1625,15 @@ void LLAgentWearables::createWearable(LLWearableType::EType type, bool wear, con
folder_id = gInventory.findCategoryUUIDForType(folder_type);
}
create_inventory_item(gAgent.getID(), gAgent.getSessionID(),
folder_id, wearable->getTransactionID(), wearable->getName(),
wearable->getDescription(), asset_type, inv_type, wearable->getType(),
wearable->getPermissions().getMaskNextOwner(),
create_inventory_item(gAgent.getID(),
gAgent.getSessionID(),
folder_id,
wearable->getTransactionID(),
wearable->getName(),
wearable->getDescription(),
asset_type, inv_type,
wearable->getType(),
LLFloaterPerms::getNextOwnerPerms("Wearables"),
cb);
}

View File

@ -1534,19 +1534,17 @@ void LLAppearanceMgr::takeOffOutfit(const LLUUID& cat_id)
}
removeItemsFromAvatar(uuids_to_remove);
// <FS> Fix for FIRE-1256 by Lance Corrimal
// now deactivating all gestures in that folder
// deactivate all gestures in the outfit folder
LLInventoryModel::item_array_t gest_items;
getDescendentsOfAssetType(cat_id, gest_items, LLAssetType::AT_GESTURE);
for (S32 i = 0; i < gest_items.size(); ++i)
for(S32 i = 0; i < gest_items.size(); ++i)
{
LLViewerInventoryItem *gest_item = gest_items.at(i);
LLViewerInventoryItem *gest_item = gest_items[i];
if ( LLGestureMgr::instance().isGestureActive( gest_item->getLinkedUUID()) )
{
LLGestureMgr::instance().deactivateGesture( gest_item->getLinkedUUID() );
}
}
// </FS>
}
// Create a copy of src_id + contents as a subfolder of dst_id.

View File

@ -3997,6 +3997,10 @@ LLSD LLAppViewer::getViewerInfo() const
{
info["SERVER_RELEASE_NOTES_URL"] = LLTrans::getString("RetrievingData");
}
else
{
info["SERVER_RELEASE_NOTES_URL"] = LLTrans::getString("NotConnected");
}
}
else if (LLStringUtil::startsWith(mServerReleaseNotesURL, "http")) // it's an URL
{
@ -5647,7 +5651,7 @@ void LLAppViewer::idle()
static LLFrameStatsTimer viewer_stats_timer(SEND_STATS_PERIOD);
// Update session stats every large chunk of time
// *FIX: (???) SAMANTHA
// *FIX: (?) SAMANTHA
if (viewer_stats_timer.getElapsedTimeF32() >= SEND_STATS_PERIOD && !gDisconnected)
{
LL_INFOS() << "Transmitting sessions stats" << LL_ENDL;

View File

@ -144,7 +144,8 @@ BOOL LLFloaterAbout::postBuild()
}
else // not logged in
{
setSupportText(LLStringUtil::null);
LL_DEBUGS("ViewerInfo") << "cannot display region info when not connected" << LL_ENDL;
setSupportText(LLTrans::getString("NotConnected"));
}
support_widget->blockUndo();
@ -263,11 +264,10 @@ void LLFloaterAbout::setSupportText(const std::string& server_release_notes_url)
LLViewerTextEditor *support_widget =
getChild<LLViewerTextEditor>("support_editor", true);
LLUIColor about_color = LLUIColorTable::instance().getColor("TextFgReadOnlyColor");
support_widget->clear();
support_widget->appendText(LLAppViewer::instance()->getViewerInfoString(),
FALSE,
LLStyle::Params()
.color(LLUIColorTable::instance().getColor("TextFgReadOnlyColor")));
FALSE, LLStyle::Params() .color(about_color));
}
///----------------------------------------------------------------------------

View File

@ -1175,7 +1175,7 @@ void LLFloaterBvhPreview::onBtnOK(void* userdata)
0,
LLFolderType::FT_NONE,
LLInventoryType::IT_ANIMATION,
LLFloaterPerms::getNextOwnerPerms(), LLFloaterPerms::getGroupPerms(), LLFloaterPerms::getEveryonePerms(),
LLFloaterPerms::getNextOwnerPerms("Uploads"), LLFloaterPerms::getGroupPerms("Uploads"), LLFloaterPerms::getEveryonePerms("Uploads"),
name,
callback, expected_upload_cost, userdata);

Some files were not shown because too many files have changed in this diff Show More