diff options
author | Nat Goodspeed <nat@lindenlab.com> | 2017-03-13 16:38:00 -0400 |
---|---|---|
committer | Nat Goodspeed <nat@lindenlab.com> | 2017-03-13 16:38:00 -0400 |
commit | 66de0c9965ff68bcb8cb60975fcffa45e2c6d74c (patch) | |
tree | e3fa6c87fe70e487b6fc6e94f6793b7638b568ea /indra | |
parent | 49e114748fdb52599aaa141c2006198c48aa083b (diff) | |
parent | 17c8eadb3d89bc78019f0b50eb8b109f25616781 (diff) |
Automated merge with ssh://bitbucket.org/lindenlab/viewer-release
Diffstat (limited to 'indra')
147 files changed, 1494 insertions, 5726 deletions
diff --git a/indra/cmake/00-COMPILE-LINK-RUN.txt b/indra/cmake/00-COMPILE-LINK-RUN.txt index 162b22865c..1933072a6d 100644 --- a/indra/cmake/00-COMPILE-LINK-RUN.txt +++ b/indra/cmake/00-COMPILE-LINK-RUN.txt @@ -48,8 +48,8 @@ Compilation LL_WINDOWS=1 " " UNICODE " " _UNICODE " " - WINVER=0x0501 " " - _WIN32_WINNT=0x0501 " " + WINVER=0x0600 " " + _WIN32_WINNT=0x0600 " " LL_OS_DRAGDROP_ENABLED=1 " " LIB_NDOF=1 " " diff --git a/indra/cmake/00-Common.cmake b/indra/cmake/00-Common.cmake index adc134c48c..f925fdda5d 100644 --- a/indra/cmake/00-Common.cmake +++ b/indra/cmake/00-Common.cmake @@ -2,18 +2,32 @@ # # Compilation options shared by all Second Life components. +#***************************************************************************** +# It's important to realize that CMake implicitly concatenates +# CMAKE_CXX_FLAGS with (e.g.) CMAKE_CXX_FLAGS_RELEASE for Release builds. So +# set switches in CMAKE_CXX_FLAGS that should affect all builds, but in +# CMAKE_CXX_FLAGS_RELEASE or CMAKE_CXX_FLAGS_RELWITHDEBINFO for switches +# that should affect only that build variant. +# +# Also realize that CMAKE_CXX_FLAGS may already be partially populated on +# entry to this file. +#***************************************************************************** + if(NOT DEFINED ${CMAKE_CURRENT_LIST_FILE}_INCLUDED) set(${CMAKE_CURRENT_LIST_FILE}_INCLUDED "YES") include(Variables) -# Portable compilation flags. -set(CMAKE_CXX_FLAGS_DEBUG "-D_DEBUG -DLL_DEBUG=1") -set(CMAKE_CXX_FLAGS_RELEASE - "-DLL_RELEASE=1 -DLL_RELEASE_FOR_DOWNLOAD=1 -DNDEBUG") +# We go to some trouble to set LL_BUILD to the set of relevant compiler flags. +set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} $ENV{LL_BUILD}") +# Given that, all the flags you see added below are flags NOT present in +# https://bitbucket.org/lindenlab/viewer-build-variables/src/tip/variables. +# Before adding new ones here, it's important to ask: can this flag really be +# applied to the viewer only, or should/must it be applied to all 3p libraries +# as well? -set(CMAKE_CXX_FLAGS_RELWITHDEBINFO - "-DLL_RELEASE=1 -DNDEBUG -DLL_RELEASE_WITH_DEBUG_INFO=1") +# Portable compilation flags. +set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -DADDRESS_SIZE=${ADDRESS_SIZE}") # Configure crash reporting set(RELEASE_CRASH_REPORTING OFF CACHE BOOL "Enable use of crash reporting in release builds") @@ -46,26 +60,25 @@ if (WINDOWS) # http://www.cmake.org/pipermail/cmake/2009-September/032143.html string(REPLACE "/Zm1000" " " CMAKE_CXX_FLAGS ${CMAKE_CXX_FLAGS}) - set(CMAKE_CXX_FLAGS_DEBUG "${CMAKE_CXX_FLAGS_DEBUG} /Od /Zi /MDd /MP -D_SCL_SECURE_NO_WARNINGS=1" - CACHE STRING "C++ compiler debug options" FORCE) + set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} /MP") + set(CMAKE_CXX_FLAGS_RELWITHDEBINFO - "${CMAKE_CXX_FLAGS_RELWITHDEBINFO} /Od /Zi /Zo /MD /MP /Ob0 -D_SECURE_STL=0" + "${CMAKE_CXX_FLAGS_RELWITHDEBINFO} /Zo" CACHE STRING "C++ compiler release-with-debug options" FORCE) set(CMAKE_CXX_FLAGS_RELEASE - "${CMAKE_CXX_FLAGS_RELEASE} ${LL_CXX_FLAGS} /O2 /Zi /Zo /MD /MP /Ob2 -D_SECURE_STL=0 -D_HAS_ITERATOR_DEBUGGING=0" + "${CMAKE_CXX_FLAGS_RELEASE} ${LL_CXX_FLAGS} /Zo" CACHE STRING "C++ compiler release options" FORCE) # zlib has assembly-language object files incompatible with SAFESEH - set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} /LARGEADDRESSAWARE /SAFESEH:NO /NODEFAULTLIB:LIBCMT") + set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} /LARGEADDRESSAWARE /SAFESEH:NO /NODEFAULTLIB:LIBCMT /IGNORE:4099") set(CMAKE_CXX_STANDARD_LIBRARIES "") set(CMAKE_C_STANDARD_LIBRARIES "") add_definitions( - /DLL_WINDOWS=1 /DNOMINMAX # /DDOM_DYNAMIC # For shared library colladadom - /DUNICODE - /D_UNICODE + ) + add_compile_options( /GS /TP /W3 @@ -73,94 +86,41 @@ if (WINDOWS) /Zc:forScope /nologo /Oy- - /Zc:wchar_t- - /arch:SSE2 +# /arch:SSE2 /fp:fast ) + + # Nicky: x64 implies SSE2 + if( ADDRESS_SIZE EQUAL 32 ) + add_definitions( /arch:SSE2 ) + endif() # Are we using the crummy Visual Studio KDU build workaround? if (NOT VS_DISABLE_FATAL_WARNINGS) add_definitions(/WX) endif (NOT VS_DISABLE_FATAL_WARNINGS) - - # configure Win32 API for Windows Vista+ compatibility - set(WINVER "0x0600" CACHE STRING "Win32 API Target version (see http://msdn.microsoft.com/en-us/library/aa383745%28v=VS.85%29.aspx)") - add_definitions("/DWINVER=${WINVER}" "/D_WIN32_WINNT=${WINVER}") endif (WINDOWS) if (LINUX) set(CMAKE_SKIP_RPATH TRUE) - # Here's a giant hack for Fedora 8, where we can't use - # _FORTIFY_SOURCE if we're using a compiler older than gcc 4.1. - - find_program(GXX g++) - mark_as_advanced(GXX) - - if (GXX) - execute_process( - COMMAND ${GXX} --version - COMMAND sed "s/^[gc+ ]*//" - COMMAND head -1 - OUTPUT_VARIABLE GXX_VERSION - OUTPUT_STRIP_TRAILING_WHITESPACE - ) - else (GXX) - set(GXX_VERSION x) - endif (GXX) - - # The quoting hack here is necessary in case we're using distcc or - # ccache as our compiler. CMake doesn't pass the command line - # through the shell by default, so we end up trying to run "distcc" - # " g++" - notice the leading space. Ugh. - - execute_process( - COMMAND sh -c "${CMAKE_CXX_COMPILER} ${CMAKE_CXX_COMPILER_ARG1} --version" - COMMAND sed "s/^[gc+ ]*//" - COMMAND head -1 - OUTPUT_VARIABLE CXX_VERSION - OUTPUT_STRIP_TRAILING_WHITESPACE) - - if (${GXX_VERSION} STREQUAL ${CXX_VERSION}) - add_definitions(-D_FORTIFY_SOURCE=2) - else (${GXX_VERSION} STREQUAL ${CXX_VERSION}) - if (NOT ${GXX_VERSION} MATCHES " 4.1.*Red Hat") - add_definitions(-D_FORTIFY_SOURCE=2) - endif (NOT ${GXX_VERSION} MATCHES " 4.1.*Red Hat") - endif (${GXX_VERSION} STREQUAL ${CXX_VERSION}) - - # Let's actually get a numerical version of gxx's version - STRING(REGEX REPLACE ".* ([0-9])\\.([0-9])\\.([0-9]).*" "\\1\\2\\3" CXX_VERSION_NUMBER ${CXX_VERSION}) - - # Hacks to work around gcc 4.1 TC build pool machines which can't process pragma warning disables - # This is pure rubbish; I wish there was another way. - # - if(${CXX_VERSION_NUMBER} LESS 420) - set(CMAKE_CXX_FLAGS "-Wno-deprecated -Wno-uninitialized -Wno-unused-variable -Wno-unused-function ${CMAKE_CXX_FLAGS}") - endif (${CXX_VERSION_NUMBER} LESS 420) - - if(${CXX_VERSION_NUMBER} GREATER 459) - set(CMAKE_CXX_FLAGS "-Wno-deprecated -Wno-unused-but-set-variable -Wno-unused-variable ${CMAKE_CXX_FLAGS}") - endif (${CXX_VERSION_NUMBER} GREATER 459) + add_definitions(-D_FORTIFY_SOURCE=2) + + set(CMAKE_CXX_FLAGS "-Wno-deprecated -Wno-unused-but-set-variable -Wno-unused-variable ${CMAKE_CXX_FLAGS}") # gcc 4.3 and above don't like the LL boost and also # cause warnings due to our use of deprecated headers - if(${CXX_VERSION_NUMBER} GREATER 429) - add_definitions(-Wno-parentheses) - set(CMAKE_CXX_FLAGS "-Wno-deprecated ${CMAKE_CXX_FLAGS}") - endif (${CXX_VERSION_NUMBER} GREATER 429) - - # End of hacks. + add_definitions(-Wno-parentheses) add_definitions( - -DLL_LINUX=1 -D_REENTRANT + ) + add_compile_options( -fexceptions -fno-math-errno -fno-strict-aliasing -fsigned-char - -g -msse2 -mfpmath=sse -pthread @@ -170,39 +130,37 @@ if (LINUX) add_definitions(-DEXTERNAL_TOS) add_definitions(-DAPPID=secondlife) - add_definitions(-fvisibility=hidden) - # don't catch SIGCHLD in our base application class for the viewer - some of our 3rd party libs may need their *own* SIGCHLD handler to work. Sigh! The viewer doesn't need to catch SIGCHLD anyway. + add_compile_options(-fvisibility=hidden) + # don't catch SIGCHLD in our base application class for the viewer - some of + # our 3rd party libs may need their *own* SIGCHLD handler to work. Sigh! The + # viewer doesn't need to catch SIGCHLD anyway. add_definitions(-DLL_IGNORE_SIGCHLD) - if (WORD_SIZE EQUAL 32) - add_definitions(-march=pentium4) - endif (WORD_SIZE EQUAL 32) - add_definitions(-mfpmath=sse) - #add_definitions(-ftree-vectorize) # THIS CRASHES GCC 3.1-3.2 + if (ADDRESS_SIZE EQUAL 32) + add_compile_options(-march=pentium4) + endif (ADDRESS_SIZE EQUAL 32) + #add_compile_options(-ftree-vectorize) # THIS CRASHES GCC 3.1-3.2 if (NOT USESYSTEMLIBS) # this stops us requiring a really recent glibc at runtime - add_definitions(-fno-stack-protector) + add_compile_options(-fno-stack-protector) # linking can be very memory-hungry, especially the final viewer link set(CMAKE_CXX_LINK_FLAGS "-Wl,--no-keep-memory") endif (NOT USESYSTEMLIBS) set(CMAKE_CXX_FLAGS_DEBUG "-fno-inline ${CMAKE_CXX_FLAGS_DEBUG}") - set(CMAKE_CXX_FLAGS_RELEASE "-O2 ${CMAKE_CXX_FLAGS_RELEASE}") endif (LINUX) if (DARWIN) - add_definitions(-DLL_DARWIN=1) - set(CMAKE_CXX_LINK_FLAGS "-Wl,-no_compact_unwind -Wl,-headerpad_max_install_names,-search_paths_first") + set(CMAKE_CXX_LINK_FLAGS "-Wl,-headerpad_max_install_names,-search_paths_first") set(CMAKE_SHARED_LINKER_FLAGS "${CMAKE_CXX_LINK_FLAGS}") - set(DARWIN_extra_cstar_flags "-g -Wno-unused-local-typedef -Wno-deprecated-declarations") + set(DARWIN_extra_cstar_flags "-Wno-unused-local-typedef -Wno-deprecated-declarations") set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${DARWIN_extra_cstar_flags}") set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} ${DARWIN_extra_cstar_flags}") # NOTE: it's critical that the optimization flag is put in front. # NOTE: it's critical to have both CXX_FLAGS and C_FLAGS covered. - set(CMAKE_CXX_FLAGS_RELWITHDEBINFO "-O0 ${CMAKE_CXX_FLAGS_RELWITHDEBINFO}") - set(CMAKE_C_FLAGS_RELWITHDEBINFO "-O0 ${CMAKE_C_FLAGS_RELWITHDEBINFO}") - set(ENABLE_SIGNING TRUE) - set(SIGNING_IDENTITY "Developer ID Application: Linden Research, Inc.") +## Really?? On developer machines too? +##set(ENABLE_SIGNING TRUE) +##set(SIGNING_IDENTITY "Developer ID Application: Linden Research, Inc.") endif (DARWIN) @@ -226,22 +184,17 @@ if (LINUX OR DARWIN) set(CMAKE_C_FLAGS "${GCC_WARNINGS} ${CMAKE_C_FLAGS}") set(CMAKE_CXX_FLAGS "${GCC_CXX_WARNINGS} ${CMAKE_CXX_FLAGS}") - if (WORD_SIZE EQUAL 32) - set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -m32") - set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -m32") - elseif (WORD_SIZE EQUAL 64) - set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -m64") - set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -m64") - endif (WORD_SIZE EQUAL 32) + set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -m${ADDRESS_SIZE}") + set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -m${ADDRESS_SIZE}") endif (LINUX OR DARWIN) if (USESYSTEMLIBS) add_definitions(-DLL_USESYSTEMLIBS=1) - if (LINUX AND ${ARCH} STREQUAL "i686") + if (LINUX AND ADDRESS_SIZE EQUAL 32) add_definitions(-march=pentiumpro) - endif (LINUX AND ${ARCH} STREQUAL "i686") + endif (LINUX AND ADDRESS_SIZE EQUAL 32) else (USESYSTEMLIBS) set(${ARCH}_linux_INCLUDES diff --git a/indra/cmake/BuildPackagesInfo.cmake b/indra/cmake/BuildPackagesInfo.cmake index 0f574ee39a..93461cea95 100644 --- a/indra/cmake/BuildPackagesInfo.cmake +++ b/indra/cmake/BuildPackagesInfo.cmake @@ -2,9 +2,18 @@ # Construct the version and copyright information based on package data. include(Python) +# packages-formatter.py runs autobuild install --versions, which needs to know +# the build_directory, which (on Windows) depends on AUTOBUILD_ADDRSIZE. +# Within an autobuild build, AUTOBUILD_ADDRSIZE is already set. But when +# building in an IDE, it probably isn't. Set it explicitly using +# run_build_test.py. add_custom_command(OUTPUT packages-info.txt COMMENT Generating packages-info.txt for the about box MAIN_DEPENDENCY ${CMAKE_SOURCE_DIR}/../autobuild.xml DEPENDS ${CMAKE_SOURCE_DIR}/../scripts/packages-formatter.py - COMMAND ${PYTHON_EXECUTABLE} ${CMAKE_SOURCE_DIR}/../scripts/packages-formatter.py > packages-info.txt + ${CMAKE_SOURCE_DIR}/../autobuild.xml + COMMAND ${PYTHON_EXECUTABLE} + ${CMAKE_SOURCE_DIR}/cmake/run_build_test.py -DAUTOBUILD_ADDRSIZE=${ADDRESS_SIZE} + ${PYTHON_EXECUTABLE} + ${CMAKE_SOURCE_DIR}/../scripts/packages-formatter.py "${VIEWER_CHANNEL}" "${VIEWER_SHORT_VERSION}.${VIEWER_VERSION_REVISION}" > packages-info.txt ) diff --git a/indra/cmake/BuildVersion.cmake b/indra/cmake/BuildVersion.cmake index 6ffa698a1c..157fdd07e4 100644 --- a/indra/cmake/BuildVersion.cmake +++ b/indra/cmake/BuildVersion.cmake @@ -14,6 +14,10 @@ if (NOT DEFINED VIEWER_SHORT_VERSION) # will be true in indra/, false in indra/n set(VIEWER_VERSION_REVISION $ENV{revision}) message(STATUS "Revision (from environment): ${VIEWER_VERSION_REVISION}") + elseif (DEFINED ENV{AUTOBUILD_BUILD_ID}) + set(VIEWER_VERSION_REVISION $ENV{AUTOBUILD_BUILD_ID}) + message(STATUS "Revision (from autobuild environment): ${VIEWER_VERSION_REVISION}") + else (DEFINED ENV{revision}) find_program(MERCURIAL NAMES hg @@ -54,7 +58,7 @@ if (NOT DEFINED VIEWER_SHORT_VERSION) # will be true in indra/, false in indra/n endif ("${VIEWER_VERSION_REVISION}" STREQUAL "") set(VIEWER_CHANNEL_VERSION_DEFINES - "LL_VIEWER_CHANNEL=\"${VIEWER_CHANNEL}\"" + "LL_VIEWER_CHANNEL=${VIEWER_CHANNEL}" "LL_VIEWER_VERSION_MAJOR=${VIEWER_VERSION_MAJOR}" "LL_VIEWER_VERSION_MINOR=${VIEWER_VERSION_MINOR}" "LL_VIEWER_VERSION_PATCH=${VIEWER_VERSION_PATCH}" diff --git a/indra/cmake/CEFPlugin.cmake b/indra/cmake/CEFPlugin.cmake index 9cfb7d14c7..b8e569d3a8 100644 --- a/indra/cmake/CEFPlugin.cmake +++ b/indra/cmake/CEFPlugin.cmake @@ -6,7 +6,7 @@ if (USESYSTEMLIBS) set(CEFPLUGIN OFF CACHE BOOL "CEFPLUGIN support for the llplugin/llmedia test apps.") else (USESYSTEMLIBS) - use_prebuilt_binary(llceflib) + use_prebuilt_binary(dullahan) set(CEFPLUGIN ON CACHE BOOL "CEFPLUGIN support for the llplugin/llmedia test apps.") set(CEF_INCLUDE_DIR ${LIBS_PREBUILT_DIR}/include/cef) @@ -16,7 +16,7 @@ if (WINDOWS) set(CEF_PLUGIN_LIBRARIES libcef.lib libcef_dll_wrapper.lib - llceflib.lib + dullahan.lib ) elseif (DARWIN) FIND_LIBRARY(APPKIT_LIBRARY AppKit) @@ -31,7 +31,7 @@ elseif (DARWIN) set(CEF_PLUGIN_LIBRARIES ${ARCH_PREBUILT_DIRS_RELEASE}/libcef_dll_wrapper.a - ${ARCH_PREBUILT_DIRS_RELEASE}/libLLCefLib.a + ${ARCH_PREBUILT_DIRS_RELEASE}/libdullahan.a ${APPKIT_LIBRARY} ${CEF_LIBRARY} ) diff --git a/indra/cmake/CMakeLists.txt b/indra/cmake/CMakeLists.txt index 13a31cbce7..100645611e 100644 --- a/indra/cmake/CMakeLists.txt +++ b/indra/cmake/CMakeLists.txt @@ -30,7 +30,6 @@ set(cmake_SOURCE_FILES FindFMODEX.cmake FindGLH.cmake FindGoogleBreakpad.cmake - FindGooglePerfTools.cmake FindHUNSPELL.cmake FindJsonCpp.cmake FindNDOF.cmake @@ -46,11 +45,8 @@ set(cmake_SOURCE_FILES GLOD.cmake ## GStreamer010Plugin.cmake GetPrerequisites_2_8.cmake -## Glui.cmake - Glut.cmake GoogleBreakpad.cmake GoogleMock.cmake - GooglePerfTools.cmake Havok.cmake Hunspell.cmake JPEG.cmake @@ -90,7 +86,6 @@ set(cmake_SOURCE_FILES Prebuilt.cmake PulseAudio.cmake Python.cmake - QuickTimePlugin.cmake TemplateCheck.cmake Tut.cmake UI.cmake diff --git a/indra/cmake/ConfigurePkgConfig.cmake b/indra/cmake/ConfigurePkgConfig.cmake index 82ee3e7a5b..55d865392e 100644 --- a/indra/cmake/ConfigurePkgConfig.cmake +++ b/indra/cmake/ConfigurePkgConfig.cmake @@ -6,17 +6,17 @@ SET(DEBUG_PKG_CONFIG "YES") IF("$ENV{PKG_CONFIG_LIBDIR}" STREQUAL "") # Guess at architecture-specific system library paths. - if (WORD_SIZE EQUAL 32) + if (ADDRESS_SIZE EQUAL 32) SET(PKG_CONFIG_NO_MULTI_GUESS /usr/lib32 /usr/lib) SET(PKG_CONFIG_NO_MULTI_LOCAL_GUESS /usr/local/lib32 /usr/local/lib) SET(PKG_CONFIG_MULTI_GUESS /usr/lib/i386-linux-gnu) SET(PKG_CONFIG_MULTI_LOCAL_GUESS /usr/local/lib/i386-linux-gnu) - else (WORD_SIZE EQUAL 32) + else (ADDRESS_SIZE EQUAL 32) SET(PKG_CONFIG_NO_MULTI_GUESS /usr/lib64 /usr/lib) SET(PKG_CONFIG_NO_MULTI_LOCAL_GUESS /usr/local/lib64 /usr/local/lib) SET(PKG_CONFIG_MULTI_GUESS /usr/local/lib/x86_64-linux-gnu) SET(PKG_CONFIG_MULTI_LOCAL_GUESS /usr/local/lib/x86_64-linux-gnu) - endif (WORD_SIZE EQUAL 32) + endif (ADDRESS_SIZE EQUAL 32) # Use DPKG architecture, if available. IF (${DPKG_ARCH}) diff --git a/indra/cmake/Copy3rdPartyLibs.cmake b/indra/cmake/Copy3rdPartyLibs.cmake index 70d85b864c..14510d654f 100644 --- a/indra/cmake/Copy3rdPartyLibs.cmake +++ b/indra/cmake/Copy3rdPartyLibs.cmake @@ -30,18 +30,6 @@ if(WINDOWS) #******************************* # Misc shared libs - set(debug_src_dir "${ARCH_PREBUILT_DIRS_DEBUG}") - set(debug_files - openjpegd.dll - libapr-1.dll - libaprutil-1.dll - libapriconv-1.dll - ssleay32.dll - libeay32.dll - glod.dll - libhunspell.dll - ) - set(release_src_dir "${ARCH_PREBUILT_DIRS_RELEASE}") set(release_files openjpeg.dll @@ -54,14 +42,13 @@ if(WINDOWS) libhunspell.dll ) - if(USE_TCMALLOC) - set(debug_files ${debug_files} libtcmalloc_minimal-debug.dll) - set(release_files ${release_files} libtcmalloc_minimal.dll) - endif(USE_TCMALLOC) - if (FMODEX) - set(debug_files ${debug_files} fmodexL.dll) - set(release_files ${release_files} fmodex.dll) + + if(ADDRESS_SIZE EQUAL 32) + set(release_files ${release_files} fmodex.dll) + else(ADDRESS_SIZE EQUAL 32) + set(release_files ${release_files} fmodex64.dll) + endif(ADDRESS_SIZE EQUAL 32) endif (FMODEX) #******************************* @@ -175,10 +162,8 @@ elseif(DARWIN) libaprutil-1.0.dylib libaprutil-1.dylib libexception_handler.dylib - libexpat.1.5.2.dylib - libexpat.dylib + ${EXPAT_COPY} libGLOD.dylib - libhunspell-1.3.0.dylib libndofdev.dylib ) @@ -218,8 +203,7 @@ elseif(LINUX) libaprutil-1.so.0 libatk-1.0.so libdb-5.1.so - libexpat.so - libexpat.so.1 + ${EXPAT_COPY} libfreetype.so.6.6.2 libfreetype.so.6 libGLOD.so @@ -234,10 +218,6 @@ elseif(LINUX) libfontconfig.so.1 ) - if (USE_TCMALLOC) - set(release_files ${release_files} "libtcmalloc_minimal.so") - endif (USE_TCMALLOC) - if (FMODEX) set(debug_files ${debug_files} "libfmodexL.so") set(release_files ${release_files} "libfmodex.so") @@ -294,13 +274,13 @@ set(third_party_targets ${third_party_targets} ${out_targets}) -copy_if_different( - ${debug_src_dir} - "${SHARED_LIB_STAGING_DIR_DEBUG}" - out_targets - ${debug_files} - ) -set(third_party_targets ${third_party_targets} ${out_targets}) +#copy_if_different( +# ${debug_src_dir} +# "${SHARED_LIB_STAGING_DIR_DEBUG}" +# out_targets +# ${debug_files} +# ) +#set(third_party_targets ${third_party_targets} ${out_targets}) copy_if_different( ${release_src_dir} diff --git a/indra/cmake/DeploySharedLibs.cmake b/indra/cmake/DeploySharedLibs.cmake index 663c272e50..e57fd5eee3 100644 --- a/indra/cmake/DeploySharedLibs.cmake +++ b/indra/cmake/DeploySharedLibs.cmake @@ -12,7 +12,7 @@ get_filename_component(current_dir ${CMAKE_CURRENT_LIST_FILE} PATH) include(${current_dir}/GetPrerequisites_2_8.cmake) -message("Getting recursive dependencies for file: ${BIN_NAME}") +message(STATUS "Getting recursive dependencies for file: ${BIN_NAME}") set(EXCLUDE_SYSTEM 1) set(RECURSE 1) @@ -21,7 +21,7 @@ get_filename_component(EXE_PATH ${BIN_NAME} PATH) get_prerequisites( ${BIN_NAME} RESULTS ${EXCLUDE_SYSTEM} ${RECURSE} "${EXE_PATH}" "${SEARCH_DIRS}" ) foreach(DEP ${RESULTS}) - Message("Processing dependency: ${DEP}") + Message(STATUS "Processing dependency: ${DEP}") get_filename_component(DEP_FILE ${DEP} NAME) set(DEP_FILES ${DEP_FILES} ${DEP_FILE}) endforeach(DEP) @@ -64,10 +64,10 @@ if(FOUND_FILES) foreach(FILE ${FOUND_FILES}) get_filename_component(DST_FILE ${FILE} NAME) set(DST_FILE "${DST_PATH}/${DST_FILE}") - message("Copying ${FILE} to ${DST_FILE}") + message(STATUS "Copying ${FILE} to ${DST_FILE}") execute_process( COMMAND ${CMAKE_COMMAND} -E copy_if_different ${FILE} ${DST_FILE} ) endforeach(FILE ${FOUND_FILES}) endif(FOUND_FILES) -message("Success!") + diff --git a/indra/cmake/EXPAT.cmake b/indra/cmake/EXPAT.cmake index c1155531ff..cddc71b227 100644 --- a/indra/cmake/EXPAT.cmake +++ b/indra/cmake/EXPAT.cmake @@ -10,8 +10,14 @@ else (USESYSTEMLIBS) use_prebuilt_binary(expat) if (WINDOWS) set(EXPAT_LIBRARIES libexpatMT) + set(EXPAT_COPY libexpatMT.dll) else (WINDOWS) set(EXPAT_LIBRARIES expat) + if (DARWIN) + set(EXPAT_COPY libexpat.1.dylib libexpat.dylib) + else () + set(EXPAT_COPY libexpat.so.1 libexpat.so) + endif () endif (WINDOWS) set(EXPAT_INCLUDE_DIRS ${LIBS_PREBUILT_DIR}/include) endif (USESYSTEMLIBS) diff --git a/indra/cmake/FindHUNSPELL.cmake b/indra/cmake/FindHUNSPELL.cmake index 6faf22959c..d411bdb9e5 100644 --- a/indra/cmake/FindHUNSPELL.cmake +++ b/indra/cmake/FindHUNSPELL.cmake @@ -10,7 +10,7 @@ find_path(HUNSPELL_INCLUDE_DIR hunspell.h PATH_SUFFIXES hunspell ) -set(HUNSPELL_NAMES ${HUNSPELL_NAMES} libhunspell-1.3.0 libhunspell) +set(HUNSPELL_NAMES ${HUNSPELL_NAMES} libhunspell-1.3 libhunspell) find_library(HUNSPELL_LIBRARY NAMES ${HUNSPELL_NAMES} ) diff --git a/indra/cmake/GLEXT.cmake b/indra/cmake/GLEXT.cmake index 2a08c8fbae..9fd3923bfd 100644 --- a/indra/cmake/GLEXT.cmake +++ b/indra/cmake/GLEXT.cmake @@ -5,6 +5,6 @@ if (NOT USESYSTEMLIBS) if (WINDOWS OR LINUX) use_prebuilt_binary(glext) endif (WINDOWS OR LINUX) - use_prebuilt_binary(glh-linear) + use_prebuilt_binary(glh_linear) set(GLEXT_INCLUDE_DIR ${LIBS_PREBUILT_DIR}/include) endif (NOT USESYSTEMLIBS) diff --git a/indra/cmake/GLH.cmake b/indra/cmake/GLH.cmake index d0992f57b8..d5262f2efa 100644 --- a/indra/cmake/GLH.cmake +++ b/indra/cmake/GLH.cmake @@ -7,5 +7,5 @@ set(GLH_FIND_QUIETLY TRUE) if (USESYSTEMLIBS) include(FindGLH) else (USESYSTEMLIBS) - use_prebuilt_binary(glh-linear) + use_prebuilt_binary(glh_linear) endif (USESYSTEMLIBS) diff --git a/indra/cmake/Glui.cmake b/indra/cmake/Glui.cmake deleted file mode 100644 index db353a91ec..0000000000 --- a/indra/cmake/Glui.cmake +++ /dev/null @@ -1,28 +0,0 @@ -# -*- cmake -*- -include(Linking) -include(Prebuilt) - -if (USESYSTEMLIBS) - set(GLUI OFF CACHE BOOL - "GLUI support for the llplugin/llmedia test apps.") -else (USESYSTEMLIBS) - use_prebuilt_binary(glui) - set(GLUI ON CACHE BOOL - "GLUI support for the llplugin/llmedia test apps.") -endif (USESYSTEMLIBS) - -if (LINUX) - set(GLUI ON CACHE BOOL - "llplugin media apps HACK for Linux.") -endif (LINUX) - -if (DARWIN OR LINUX) - set(GLUI_LIBRARY - glui) -endif (DARWIN OR LINUX) - -if (WINDOWS) - set(GLUI_LIBRARY - debug glui32.lib - optimized glui32.lib) -endif (WINDOWS) diff --git a/indra/cmake/Glut.cmake b/indra/cmake/Glut.cmake deleted file mode 100644 index 314da30652..0000000000 --- a/indra/cmake/Glut.cmake +++ /dev/null @@ -1,19 +0,0 @@ -# -*- cmake -*- -include(Linking) -include(Prebuilt) - -if (WINDOWS) - use_prebuilt_binary(freeglut) - set(GLUT_LIBRARY - debug freeglut_static.lib - optimized freeglut_static.lib) -endif (WINDOWS) - -if (LINUX) - FIND_LIBRARY(GLUT_LIBRARY glut) -endif (LINUX) - -if (DARWIN) - include(CMakeFindFrameworks) - find_library(GLUT_LIBRARY GLUT) -endif (DARWIN) diff --git a/indra/cmake/GooglePerfTools.cmake b/indra/cmake/GooglePerfTools.cmake deleted file mode 100644 index c1faeb9325..0000000000 --- a/indra/cmake/GooglePerfTools.cmake +++ /dev/null @@ -1,61 +0,0 @@ -# -*- cmake -*- -include(Prebuilt) - -# If you want to enable or disable TCMALLOC in viewer builds, this is the place. -# set ON or OFF as desired. -set (USE_TCMALLOC OFF) - -if (USESYSTEMLIBS) - include(FindGooglePerfTools) -else (USESYSTEMLIBS) - if (WINDOWS) - if (USE_TCMALLOC) - use_prebuilt_binary(gperftools) - set(TCMALLOC_LIBRARIES - debug libtcmalloc_minimal-debug - optimized libtcmalloc_minimal) - set(TCMALLOC_LINK_FLAGS "/INCLUDE:__tcmalloc") - else (USE_TCMALLOC) - set(TCMALLOC_LIBRARIES) - set(TCMALLOC_LINK_FLAGS) - endif (USE_TCMALLOC) - set(GOOGLE_PERFTOOLS_FOUND "YES") - endif (WINDOWS) - if (LINUX) - if (USE_TCMALLOC) - use_prebuilt_binary(gperftools) - set(TCMALLOC_LIBRARIES - tcmalloc) - else (USE_TCMALLOC) - set(TCMALLOC_LIBRARIES) - endif (USE_TCMALLOC) - set(PROFILER_LIBRARIES profiler) - set(GOOGLE_PERFTOOLS_INCLUDE_DIR - ${LIBS_PREBUILT_DIR}/include) - set(GOOGLE_PERFTOOLS_FOUND "YES") - endif (LINUX) -endif (USESYSTEMLIBS) - -if (GOOGLE_PERFTOOLS_FOUND) - # XXX Disable temporarily, until we have compilation issues on 64-bit - # Etch sorted. - set(USE_GOOGLE_PERFTOOLS OFF CACHE BOOL "Build with Google PerfTools support.") -endif (GOOGLE_PERFTOOLS_FOUND) - -if (WINDOWS) - set(USE_GOOGLE_PERFTOOLS ON) -endif (WINDOWS) - -if (USE_GOOGLE_PERFTOOLS) - if (USE_TCMALLOC) - set(TCMALLOC_FLAG -DLL_USE_TCMALLOC=1) - else (USE_TCMALLOC) - set(TCMALLOC_FLAG -ULL_USE_TCMALLOC) - endif (USE_TCMALLOC) -endif (USE_GOOGLE_PERFTOOLS) - -if (USE_GOOGLE_PERFTOOLS) - include_directories(${GOOGLE_PERFTOOLS_INCLUDE_DIR}) - set(GOOGLE_PERFTOOLS_LIBRARIES ${TCMALLOC_LIBRARIES} ${STACKTRACE_LIBRARIES} ${PROFILER_LIBRARIES}) -else (USE_GOOGLE_PERFTOOLS) -endif (USE_GOOGLE_PERFTOOLS) diff --git a/indra/cmake/Hunspell.cmake b/indra/cmake/Hunspell.cmake index ef74d95b2a..06227b3fe2 100644 --- a/indra/cmake/Hunspell.cmake +++ b/indra/cmake/Hunspell.cmake @@ -11,7 +11,7 @@ else (USESYSTEMLIBS) if (WINDOWS) set(HUNSPELL_LIBRARY libhunspell) elseif(DARWIN) - set(HUNSPELL_LIBRARY hunspell-1.3.0) + set(HUNSPELL_LIBRARY hunspell-1.3) elseif(LINUX) set(HUNSPELL_LIBRARY hunspell-1.3) else() diff --git a/indra/cmake/LLAddBuildTest.cmake b/indra/cmake/LLAddBuildTest.cmake index db8b95dbe2..96d3e39a06 100644 --- a/indra/cmake/LLAddBuildTest.cmake +++ b/indra/cmake/LLAddBuildTest.cmake @@ -35,7 +35,6 @@ INCLUDE(GoogleMock) ${APRUTIL_LIBRARIES} ${APR_LIBRARIES} llcommon - llcorehttp ) IF(NOT "${project}" STREQUAL "llmath") # add llmath as a dep unless the tested module *is* llmath! diff --git a/indra/cmake/LLCommon.cmake b/indra/cmake/LLCommon.cmake index b50b4bcdb2..3e29297c58 100644 --- a/indra/cmake/LLCommon.cmake +++ b/indra/cmake/LLCommon.cmake @@ -4,7 +4,6 @@ include(APR) include(Boost) include(EXPAT) include(ZLIB) -include(GooglePerfTools) set(LLCOMMON_INCLUDE_DIRS ${LIBS_OPEN_DIR}/llcommon @@ -34,8 +33,6 @@ else (LINUX) ${BOOST_SYSTEM_LIBRARY} ) endif (LINUX) -# add_definitions(${TCMALLOC_FLAG}) - set(LLCOMMON_LINK_SHARED OFF CACHE BOOL "Build the llcommon target as a static library.") if(LLCOMMON_LINK_SHARED) add_definitions(-DLL_COMMON_LINK_SHARED=1) diff --git a/indra/cmake/LibVLCPlugin.cmake b/indra/cmake/LibVLCPlugin.cmake index 4472676fb4..df829b615a 100644 --- a/indra/cmake/LibVLCPlugin.cmake +++ b/indra/cmake/LibVLCPlugin.cmake @@ -18,6 +18,10 @@ if (WINDOWS) libvlccore.lib ) elseif (DARWIN) + set(VLC_PLUGIN_LIBRARIES + libvlc.dylib + libvlccore.dylib + ) elseif (LINUX) # Specify a full path to make sure we get a static link set(VLC_PLUGIN_LIBRARIES diff --git a/indra/cmake/Prebuilt.cmake b/indra/cmake/Prebuilt.cmake index 98013da2f2..33a6d76916 100644 --- a/indra/cmake/Prebuilt.cmake +++ b/indra/cmake/Prebuilt.cmake @@ -39,7 +39,7 @@ macro (use_prebuilt_binary _binary) if(${PREBUILD_TRACKING_DIR}/sentinel_installed IS_NEWER_THAN ${PREBUILD_TRACKING_DIR}/${_binary}_installed OR NOT ${${_binary}_installed} EQUAL 0) if(DEBUG_PREBUILT) - message("cd ${CMAKE_SOURCE_DIR} && ${AUTOBUILD_EXECUTABLE} install + message(STATUS "cd ${CMAKE_SOURCE_DIR} && ${AUTOBUILD_EXECUTABLE} install --install-dir=${AUTOBUILD_INSTALL_DIR} ${_binary} ") endif(DEBUG_PREBUILT) diff --git a/indra/cmake/QuickTimePlugin.cmake b/indra/cmake/QuickTimePlugin.cmake deleted file mode 100644 index c08e153ee3..0000000000 --- a/indra/cmake/QuickTimePlugin.cmake +++ /dev/null @@ -1,48 +0,0 @@ -# -*- cmake -*- - -if(INSTALL_PROPRIETARY) - include(Prebuilt) - if (WINDOWS) - use_prebuilt_binary(quicktime) - endif (WINDOWS) -endif(INSTALL_PROPRIETARY) - -if (DARWIN) - include(CMakeFindFrameworks) - find_library(QUICKTIME_LIBRARY QuickTime) -elseif (WINDOWS) - set(QUICKTIME_SDK_DIR "$ENV{PROGRAMFILES}/QuickTime SDK" - CACHE PATH "Location of the QuickTime SDK.") - - find_library(DEBUG_QUICKTIME_LIBRARY qtmlclient.lib - PATHS - ${ARCH_PREBUILT_DIRS_DEBUG} - "${QUICKTIME_SDK_DIR}\\libraries" - ) - - find_library(RELEASE_QUICKTIME_LIBRARY qtmlclient.lib - PATHS - ${ARCH_PREBUILT_DIRS_RELEASE} - "${QUICKTIME_SDK_DIR}\\libraries" - ) - - if (DEBUG_QUICKTIME_LIBRARY AND RELEASE_QUICKTIME_LIBRARY) - set(QUICKTIME_LIBRARY - optimized ${RELEASE_QUICKTIME_LIBRARY} - debug ${DEBUG_QUICKTIME_LIBRARY} - ) - - endif (DEBUG_QUICKTIME_LIBRARY AND RELEASE_QUICKTIME_LIBRARY) - - include_directories( - ${LIBS_PREBUILT_DIR}/include/quicktime - "${QUICKTIME_SDK_DIR}\\CIncludes" - ) -endif (DARWIN) - -mark_as_advanced(QUICKTIME_LIBRARY) - -if (QUICKTIME_LIBRARY) - set(QUICKTIME ON CACHE BOOL "Build with QuickTime streaming media support.") -endif (QUICKTIME_LIBRARY) - diff --git a/indra/cmake/UI.cmake b/indra/cmake/UI.cmake index 31174209a3..77fd505df3 100644 --- a/indra/cmake/UI.cmake +++ b/indra/cmake/UI.cmake @@ -32,9 +32,9 @@ if (USESYSTEMLIBS) add_definitions(${${pkg}_CFLAGS_OTHERS}) endforeach(pkg) else (USESYSTEMLIBS) - if (LINUX OR WINDOWS) + if (LINUX) use_prebuilt_binary(gtk-atk-pango-glib) - endif (LINUX OR WINDOWS) + endif (LINUX) if (LINUX) set(UI_LIBRARIES diff --git a/indra/cmake/Variables.cmake b/indra/cmake/Variables.cmake index 63e296b556..e8698ace68 100644 --- a/indra/cmake/Variables.cmake +++ b/indra/cmake/Variables.cmake @@ -9,6 +9,12 @@ # LINUX - Linux # WINDOWS - Windows +# Switches set here and in 00-Common.cmake must agree with +# https://bitbucket.org/lindenlab/viewer-build-variables/src/tip/variables +# Reading $LL_BUILD is an attempt to directly use those switches. +if ("$ENV{LL_BUILD}" STREQUAL "") + message(FATAL_ERROR "Environment variable LL_BUILD must be set") +endif () # Relative and absolute paths to subtrees. @@ -60,46 +66,55 @@ if (NOT CMAKE_BUILD_TYPE) "Build type. One of: Debug Release RelWithDebInfo" FORCE) endif (NOT CMAKE_BUILD_TYPE) +# If someone has specified an address size, use that to determine the +# architecture. Otherwise, let the architecture specify the address size. +if (ADDRESS_SIZE EQUAL 32) + #message(STATUS "ADDRESS_SIZE is 32") + set(ARCH i686) +elseif (ADDRESS_SIZE EQUAL 64) + #message(STATUS "ADDRESS_SIZE is 64") + set(ARCH x86_64) +else (ADDRESS_SIZE EQUAL 32) + #message(STATUS "ADDRESS_SIZE is UNRECOGNIZED: '${ADDRESS_SIZE}'") + # Use Python's platform.machine() since uname -m isn't available everywhere. + # Even if you can assume cygwin uname -m, the answer depends on whether + # you're running 32-bit cygwin or 64-bit cygwin! But even 32-bit Python will + # report a 64-bit processor. + execute_process(COMMAND + "${PYTHON_EXECUTABLE}" "-c" + "import platform; print platform.machine()" + OUTPUT_VARIABLE ARCH OUTPUT_STRIP_TRAILING_WHITESPACE) + # We expect values of the form i386, i686, x86_64, AMD64. + # In CMake, expressing ARCH.endswith('64') is awkward: + string(LENGTH "${ARCH}" ARCH_LENGTH) + math(EXPR ARCH_LEN_2 "${ARCH_LENGTH} - 2") + string(SUBSTRING "${ARCH}" ${ARCH_LEN_2} 2 ARCH_LAST_2) + if (ARCH_LAST_2 STREQUAL 64) + #message(STATUS "ARCH is detected as 64; ARCH is ${ARCH}") + set(ADDRESS_SIZE 64) + else () + #message(STATUS "ARCH is detected as 32; ARCH is ${ARCH}") + set(ADDRESS_SIZE 32) + endif () +endif (ADDRESS_SIZE EQUAL 32) + if (${CMAKE_SYSTEM_NAME} MATCHES "Windows") set(WINDOWS ON BOOL FORCE) - set(ARCH i686) set(LL_ARCH ${ARCH}_win32) set(LL_ARCH_DIR ${ARCH}-win32) - set(WORD_SIZE 32) endif (${CMAKE_SYSTEM_NAME} MATCHES "Windows") if (${CMAKE_SYSTEM_NAME} MATCHES "Linux") set(LINUX ON BOOl FORCE) - # If someone has specified a word size, use that to determine the - # architecture. Otherwise, let the architecture specify the word size. - if (WORD_SIZE EQUAL 32) - #message(STATUS "WORD_SIZE is 32") - set(ARCH i686) - elseif (WORD_SIZE EQUAL 64) - #message(STATUS "WORD_SIZE is 64") - set(ARCH x86_64) - else (WORD_SIZE EQUAL 32) - #message(STATUS "WORD_SIZE is UNDEFINED") - execute_process(COMMAND uname -m COMMAND sed s/i.86/i686/ - OUTPUT_VARIABLE ARCH OUTPUT_STRIP_TRAILING_WHITESPACE) - if (ARCH STREQUAL x86_64) - #message(STATUS "ARCH is detected as 64; ARCH is ${ARCH}") - set(WORD_SIZE 64) - else (ARCH STREQUAL x86_64) - #message(STATUS "ARCH is detected as 32; ARCH is ${ARCH}") - set(WORD_SIZE 32) - endif (ARCH STREQUAL x86_64) - endif (WORD_SIZE EQUAL 32) - - if (WORD_SIZE EQUAL 32) + if (ADDRESS_SIZE EQUAL 32) set(DEB_ARCHITECTURE i386) set(FIND_LIBRARY_USE_LIB64_PATHS OFF) set(CMAKE_SYSTEM_LIBRARY_PATH /usr/lib32 ${CMAKE_SYSTEM_LIBRARY_PATH}) - else (WORD_SIZE EQUAL 32) + else (ADDRESS_SIZE EQUAL 32) set(DEB_ARCHITECTURE amd64) set(FIND_LIBRARY_USE_LIB64_PATHS ON) - endif (WORD_SIZE EQUAL 32) + endif (ADDRESS_SIZE EQUAL 32) execute_process(COMMAND dpkg-architecture -a${DEB_ARCHITECTURE} -qDEB_HOST_MULTIARCH RESULT_VARIABLE DPKG_RESULT @@ -129,29 +144,45 @@ endif (${CMAKE_SYSTEM_NAME} MATCHES "Linux") if (${CMAKE_SYSTEM_NAME} MATCHES "Darwin") set(DARWIN 1) - - # now we only support Xcode 7.0 using 10.11 (El Capitan), minimum OS 10.7 (Lion) + + string(REGEX MATCH "-mmacosx-version-min=([^ ]+)" scratch "$ENV{LL_BUILD}") + set(CMAKE_OSX_DEPLOYMENT_TARGET "${CMAKE_MATCH_1}") + message(STATUS "CMAKE_OSX_DEPLOYMENT_TARGET = '${CMAKE_OSX_DEPLOYMENT_TARGET}'") + + string(REGEX MATCH "-stdlib=([^ ]+)" scratch "$ENV{LL_BUILD}") + set(CMAKE_XCODE_ATTRIBUTE_CLANG_CXX_LIBRARY "${CMAKE_MATCH_1}") + message(STATUS "CMAKE_XCODE_ATTRIBUTE_CLANG_CXX_LIBRARY = '${CMAKE_XCODE_ATTRIBUTE_CLANG_CXX_LIBRARY}'") + + string(REGEX MATCH " -g([^ ]*)" scratch "$ENV{LL_BUILD}") + set(CMAKE_XCODE_ATTRIBUTE_DEBUG_INFORMATION_FORMAT "${CMAKE_MATCH_1}") + message(STATUS "CMAKE_XCODE_ATTRIBUTE_DEBUG_INFORMATION_FORMAT = '${CMAKE_XCODE_ATTRIBUTE_DEBUG_INFORMATION_FORMAT}'") + + string(REGEX MATCH "-O([^ ]*)" scratch "$ENV{LL_BUILD}") + set(CMAKE_XCODE_ATTRIBUTE_GCC_OPTIMIZATION_LEVEL "${CMAKE_MATCH_1}") + message(STATUS "CMAKE_XCODE_ATTRIBUTE_GCC_OPTIMIZATION_LEVEL = '${CMAKE_XCODE_ATTRIBUTE_GCC_OPTIMIZATION_LEVEL}'") + + string(REGEX MATCHALL "[^ ]+" LL_BUILD_LIST "$ENV{LL_BUILD}") + list(FIND LL_BUILD_LIST "-iwithsysroot" sysroot_idx) + if ("${sysroot_idx}" LESS 0) + message(FATAL_ERROR "Environment variable LL_BUILD must contain '-iwithsysroot'") + endif () + math(EXPR sysroot_idx "${sysroot_idx} + 1") + list(GET LL_BUILD_LIST "${sysroot_idx}" CMAKE_OSX_SYSROOT) + message(STATUS "CMAKE_OSX_SYSROOT = '${CMAKE_OSX_SYSROOT}'") + set(XCODE_VERSION 7.0) - set(CMAKE_OSX_DEPLOYMENT_TARGET 10.7) - set(CMAKE_OSX_SYSROOT macosx10.11) set(CMAKE_XCODE_ATTRIBUTE_GCC_VERSION "com.apple.compilers.llvm.clang.1_0") - set(CMAKE_XCODE_ATTRIBUTE_GCC_OPTIMIZATION_LEVEL 3) set(CMAKE_XCODE_ATTRIBUTE_GCC_STRICT_ALIASING NO) set(CMAKE_XCODE_ATTRIBUTE_GCC_FAST_MATH NO) set(CMAKE_XCODE_ATTRIBUTE_CLANG_X86_VECTOR_INSTRUCTIONS ssse3) - set(CMAKE_XCODE_ATTRIBUTE_CLANG_CXX_LIBRARY "libstdc++") - set(CMAKE_XCODE_ATTRIBUTE_DEBUG_INFORMATION_FORMAT dwarf-with-dsym) - # Build only for i386 by default, system default on MacOSX 10.6+ is x86_64 - if (NOT CMAKE_OSX_ARCHITECTURES) - set(CMAKE_OSX_ARCHITECTURES "i386") - endif (NOT CMAKE_OSX_ARCHITECTURES) + set(CMAKE_OSX_ARCHITECTURES "${ARCH}") + string(REPLACE "i686" "i386" CMAKE_OSX_ARCHITECTURES "${CMAKE_OSX_ARCHITECTURES}") + string(REPLACE "AMD64" "x86_64" CMAKE_OSX_ARCHITECTURES "${CMAKE_OSX_ARCHITECTURES}") - set(ARCH ${CMAKE_OSX_ARCHITECTURES}) set(LL_ARCH ${ARCH}_darwin) set(LL_ARCH_DIR universal-darwin) - set(WORD_SIZE 32) endif (${CMAKE_SYSTEM_NAME} MATCHES "Darwin") # Default deploy grid diff --git a/indra/cmake/run_build_test.py b/indra/cmake/run_build_test.py index fdbb0a75f7..f02c5e98b4 100755 --- a/indra/cmake/run_build_test.py +++ b/indra/cmake/run_build_test.py @@ -51,11 +51,13 @@ import HTMLParser import re import signal import subprocess +import logging -def main(command, libpath=[], vars={}): +def main(command, arguments=[], libpath=[], vars={}): """Pass: - command is a sequence (e.g. a list) of strings. The first item in the list - must be the command name, the rest are its arguments. + command is the command to be executed + + argument is a sequence (e.g. a list) of strings to be passed to command libpath is a sequence of directory pathnames. These will be appended to the platform-specific dynamic library search path environment variable. @@ -85,7 +87,7 @@ def main(command, libpath=[], vars={}): # might not exist; instead of KeyError, just use an empty string. dirs = os.environ.get(var, "").split(os.pathsep) # Append the sequence in libpath - print "%s += %r" % (var, libpath) + log.info("%s += %r" % (var, libpath)) for dir in libpath: # append system paths at the end if dir in ('/lib', '/usr/lib'): @@ -103,20 +105,20 @@ def main(command, libpath=[], vars={}): # Now rebuild the path string. This way we use a minimum of separators # -- and we avoid adding a pointless separator when libpath is empty. os.environ[var] = os.pathsep.join(clean_dirs) - print "%s = %r" % (var, os.environ[var]) + log.info("%s = %r" % (var, os.environ[var])) # Now handle arbitrary environment variables. The tricky part is ensuring # that all the keys and values we try to pass are actually strings. if vars: - print "Setting:" - for key, value in vars.iteritems(): - print "%s=%s" % (key, value) + log.info("Setting: %s" % ("\n".join(["%s=%s" % (key, value) for key, value in vars.iteritems()]))) os.environ.update(dict([(str(key), str(value)) for key, value in vars.iteritems()])) # Run the child process. - print "Running: %s" % " ".join(command) + command_list = [command] + command_list.extend(arguments) + log.info("Running: %s" % " ".join(command_list)) # Make sure we see all relevant output *before* child-process output. sys.stdout.flush() try: - return subprocess.call(command) + return subprocess.call(command_list) except OSError as err: # If the caller is trying to execute a test program that doesn't # exist, we want to produce a reasonable error message rather than a @@ -126,9 +128,9 @@ def main(command, libpath=[], vars={}): if err.errno != errno.ENOENT: raise # In practice, the pathnames into CMake's build tree are so long as to - # obscure the name of the test program. Just print its basename. - print "No such program %s; check for preceding build errors" % \ - os.path.basename(command[0]) + # obscure the name of the test program. Just log its basename. + log.warn("No such program %s; check for preceding build errors" % \ + os.path.basename(command[0])) # What rc should we simulate for missing executable? Windows produces # 9009. return 9009 @@ -172,10 +174,10 @@ def translate_rc(rc): table = get_windows_table() symbol, desc = table[hexrc] except Exception, err: - print >>sys.stderr, "(%s -- carrying on)" % err - return "terminated with rc %s (%s)" % (rc, hexrc) + log.error("(%s -- carrying on)" % err) + log.error("terminated with rc %s (%s)" % (rc, hexrc)) else: - return "terminated with rc %s: %s: %s" % (hexrc, symbol, desc) + log.info("terminated with rc %s: %s: %s" % (hexrc, symbol, desc)) else: # On Posix, negative rc means the child was terminated by signal -rc. @@ -303,22 +305,26 @@ def get_windows_table(): return _windows_table +log=logging.getLogger(__name__) +logging.basicConfig() + if __name__ == "__main__": - from optparse import OptionParser - parser = OptionParser(usage="usage: %prog [options] command args...") - # We want optparse support for the options we ourselves handle -- but we - # DO NOT want it looking at options for the executable we intend to run, - # rejecting them as invalid because we don't define them. So configure the - # parser to stop looking for options as soon as it sees the first - # positional argument (traditional Unix syntax). - parser.disable_interspersed_args() - parser.add_option("-D", "--define", dest="vars", default=[], action="append", - metavar="VAR=value", - help="Add VAR=value to the env variables defined") - parser.add_option("-l", "--libpath", dest="libpath", default=[], action="append", - metavar="DIR", - help="Add DIR to the platform-dependent DLL search path") - opts, args = parser.parse_args() + import argparse + parser = argparse.ArgumentParser() + parser.add_argument("-d", "--debug", dest="loglevel", action="store_const", + const=logging.DEBUG, default=logging.WARNING) + parser.add_argument("-D", "--define", dest="vars", default=[], action="append", + metavar="VAR=value", + help="Add VAR=value to the env variables defined") + parser.add_argument("-l", "--libpath", dest="libpath", default=[], action="append", + metavar="DIR", + help="Add DIR to the platform-dependent DLL search path") + parser.add_argument("command") + parser.add_argument('args', nargs=argparse.REMAINDER) + args = parser.parse_args() + + log.setLevel(args.loglevel) + # What we have in opts.vars is a list of strings of the form "VAR=value" # or possibly just "VAR". What we want is a dict. We can build that dict by # constructing a list of ["VAR", "value"] pairs -- so split each @@ -326,9 +332,9 @@ if __name__ == "__main__": # "VAR=some=user=string"). To handle the case of just "VAR", append "" to # the list returned by split(), then slice off anything after the pair we # want. - rc = main(command=args, libpath=opts.libpath, - vars=dict([(pair.split('=', 1) + [""])[:2] for pair in opts.vars])) + rc = main(command=args.command, arguments=args.args, libpath=args.libpath, + vars=dict([(pair.split('=', 1) + [""])[:2] for pair in args.vars])) if rc not in (None, 0): - print >>sys.stderr, "Failure running: %s" % " ".join(args) - print >>sys.stderr, "Error %s: %s" % (rc, translate_rc(rc)) + log.error("Failure running: %s" % " ".join([args.command] + args.args)) + log.error("Error %s: %s" % (rc, translate_rc(rc))) sys.exit((rc < 0) and 255 or rc) diff --git a/indra/integration_tests/llimage_libtest/CMakeLists.txt b/indra/integration_tests/llimage_libtest/CMakeLists.txt index 8a83ac498f..13cf1f7bde 100644 --- a/indra/integration_tests/llimage_libtest/CMakeLists.txt +++ b/indra/integration_tests/llimage_libtest/CMakeLists.txt @@ -104,21 +104,23 @@ add_custom_command(TARGET llimage_libtest POST_BUILD if (DARWIN) # Copy the required libraries to the package app add_custom_command(TARGET llimage_libtest POST_BUILD - COMMAND ${CMAKE_COMMAND} -E copy ${CMAKE_SOURCE_DIR}/../build-darwin-i386/packages/lib/release/libapr-1.0.dylib ${LLIMAGE_LIBTEST_DESTINATION_DIR} - DEPENDS ${CMAKE_SOURCE_DIR}/../build-darwin-i386/packages/lib/release/libapr-1.0.dylib + COMMAND ${CMAKE_COMMAND} -E copy ${AUTOBUILD_INSTALL_DIR}/lib/release/libapr-1.0.dylib ${LLIMAGE_LIBTEST_DESTINATION_DIR} + DEPENDS ${AUTOBUILD_INSTALL_DIR}/lib/release/libapr-1.0.dylib ) add_custom_command(TARGET llimage_libtest POST_BUILD - COMMAND ${CMAKE_COMMAND} -E copy ${CMAKE_SOURCE_DIR}/../build-darwin-i386/packages/lib/release/libaprutil-1.0.dylib ${LLIMAGE_LIBTEST_DESTINATION_DIR} - DEPENDS ${CMAKE_SOURCE_DIR}/../build-darwin-i386/packages/lib/release/libaprutil-1.0.dylib + COMMAND ${CMAKE_COMMAND} -E copy ${AUTOBUILD_INSTALL_DIR}/lib/release/libaprutil-1.0.dylib ${LLIMAGE_LIBTEST_DESTINATION_DIR} + DEPENDS ${AUTOBUILD_INSTALL_DIR}/lib/release/libaprutil-1.0.dylib ) add_custom_command(TARGET llimage_libtest POST_BUILD - COMMAND ${CMAKE_COMMAND} -E copy ${CMAKE_SOURCE_DIR}/../build-darwin-i386/packages/lib/release/libexception_handler.dylib ${LLIMAGE_LIBTEST_DESTINATION_DIR} - DEPENDS ${CMAKE_SOURCE_DIR}/../build-darwin-i386/packages/lib/release/libexception_handler.dylib - ) - add_custom_command(TARGET llimage_libtest POST_BUILD - COMMAND ${CMAKE_COMMAND} -E copy ${CMAKE_SOURCE_DIR}/../build-darwin-i386/packages/lib/release/libexpat.1.5.2.dylib ${LLIMAGE_LIBTEST_DESTINATION_DIR} - DEPENDS ${CMAKE_SOURCE_DIR}/../build-darwin-i386/packages/lib/release/libexpat.1.5.2.dylib + COMMAND ${CMAKE_COMMAND} -E copy ${AUTOBUILD_INSTALL_DIR}/lib/release/libexception_handler.dylib ${LLIMAGE_LIBTEST_DESTINATION_DIR} + DEPENDS ${AUTOBUILD_INSTALL_DIR}/lib/release/libexception_handler.dylib ) + foreach(expat ${EXPAT_COPY}) + add_custom_command(TARGET llimage_libtest POST_BUILD + COMMAND ${CMAKE_COMMAND} -E copy ${AUTOBUILD_INSTALL_DIR}/lib/release/${expat} ${LLIMAGE_LIBTEST_DESTINATION_DIR} + DEPENDS ${AUTOBUILD_INSTALL_DIR}/lib/release/${expat} + ) + endforeach(expat) endif (DARWIN) if (WINDOWS) diff --git a/indra/llappearance/llavatarappearance.cpp b/indra/llappearance/llavatarappearance.cpp index 94c431feb4..ab6d77dd9b 100644 --- a/indra/llappearance/llavatarappearance.cpp +++ b/indra/llappearance/llavatarappearance.cpp @@ -2126,5 +2126,3 @@ LLAvatarAppearance::LLMaskedMorph::LLMaskedMorph(LLVisualParam *morph_target, BO } } - - diff --git a/indra/llcommon/CMakeLists.txt b/indra/llcommon/CMakeLists.txt index 3493f80556..16b42dad38 100644 --- a/indra/llcommon/CMakeLists.txt +++ b/indra/llcommon/CMakeLists.txt @@ -10,7 +10,6 @@ include(Boost) include(LLSharedLibs) include(JsonCpp) include(GoogleBreakpad) -include(GooglePerfTools) include(Copy3rdPartyLibs) include(ZLIB) include(URIPARSER) @@ -259,13 +258,13 @@ list(APPEND llcommon_SOURCE_FILES ${llcommon_HEADER_FILES}) if(LLCOMMON_LINK_SHARED) add_library (llcommon SHARED ${llcommon_SOURCE_FILES}) - if(NOT WORD_SIZE EQUAL 32) + if(NOT ADDRESS_SIZE EQUAL 32) if(WINDOWS) - add_definitions(/FIXED:NO) + ##add_definitions(/FIXED:NO) else(WINDOWS) # not windows therefore gcc LINUX and DARWIN add_definitions(-fPIC) endif(WINDOWS) - endif(NOT WORD_SIZE EQUAL 32) + endif(NOT ADDRESS_SIZE EQUAL 32) if(WINDOWS) # always generate llcommon.pdb, even for "Release" builds set_target_properties(llcommon PROPERTIES LINK_FLAGS "/DEBUG") @@ -350,8 +349,4 @@ if (LL_TESTS) ## throwing and catching exceptions. ##LL_ADD_INTEGRATION_TEST(llexception "" "${test_libs}") - # *TODO - reenable these once tcmalloc libs no longer break the build. - #ADD_BUILD_TEST(llallocator llcommon) - #ADD_BUILD_TEST(llallocator_heap_profile llcommon) - #ADD_BUILD_TEST(llmemtype llcommon) endif (LL_TESTS) diff --git a/indra/llcommon/llallocator.cpp b/indra/llcommon/llallocator.cpp index 34fc28d8cc..ac97fb71dd 100644 --- a/indra/llcommon/llallocator.cpp +++ b/indra/llcommon/llallocator.cpp @@ -27,47 +27,6 @@ #include "linden_common.h" #include "llallocator.h" -#if (LL_USE_TCMALLOC && LL_USE_HEAP_PROFILER) - -#include "google/heap-profiler.h" -#include "google/commandlineflags_public.h" - -DECLARE_bool(heap_profile_use_stack_trace); -//DECLARE_double(tcmalloc_release_rate); - -void LLAllocator::setProfilingEnabled(bool should_enable) -{ - // NULL disables dumping to disk - static char const * const PREFIX = NULL; - if(should_enable) - { - HeapProfilerSetUseStackTrace(false); - HeapProfilerStart(PREFIX); - } - else - { - HeapProfilerStop(); - } -} - -// static -bool LLAllocator::isProfiling() -{ - return IsHeapProfilerRunning(); -} - -std::string LLAllocator::getRawProfile() -{ - // *TODO - fix google-perftools to accept an buffer to avoid this - // malloc-copy-free cycle. - char * buffer = GetHeapProfile(); - std::string ret = buffer; - free(buffer); - return ret; -} - -#else // LL_USE_TCMALLOC - // // stub implementations for when tcmalloc is disabled // @@ -87,8 +46,6 @@ std::string LLAllocator::getRawProfile() return std::string(); } -#endif // LL_USE_TCMALLOC - LLAllocatorHeapProfile const & LLAllocator::getProfile() { mProf.mLines.clear(); diff --git a/indra/llcommon/llcoros.cpp b/indra/llcommon/llcoros.cpp index 3ffce4810a..1e1dfd2602 100644 --- a/indra/llcommon/llcoros.cpp +++ b/indra/llcommon/llcoros.cpp @@ -151,7 +151,11 @@ LLCoros::LLCoros(): // Previously we used // boost::context::guarded_stack_allocator::default_stacksize(); // empirically this is 64KB on Windows and Linux. Try quadrupling. +#if ADDRESS_SIZE == 64 + mStackSize(512*1024) +#else mStackSize(256*1024) +#endif { // Register our cleanup() method for "mainloop" ticks LLEventPumps::instance().obtain("mainloop").listen( diff --git a/indra/llcommon/lldependencies.h b/indra/llcommon/lldependencies.h index 125bd6a835..db2bbab8b0 100644 --- a/indra/llcommon/lldependencies.h +++ b/indra/llcommon/lldependencies.h @@ -124,8 +124,8 @@ public: virtual std::string describe(bool full=true) const; protected: - typedef std::vector< std::pair<int, int> > EdgeList; - typedef std::vector<int> VertexList; + typedef std::vector< std::pair<std::size_t, std::size_t> > EdgeList; + typedef std::vector<std::size_t> VertexList; VertexList topo_sort(int vertices, const EdgeList& edges) const; /** @@ -508,7 +508,7 @@ public: // been explicitly added. Rely on std::map rejecting a second attempt // to insert the same key. Use the map's size() as the vertex number // to get a distinct value for each successful insertion. - typedef std::map<KEY, int> VertexMap; + typedef std::map<KEY, std::size_t> VertexMap; VertexMap vmap; // Nest each of these loops because !@#$%? MSVC warns us that its // former broken behavior has finally been fixed -- and our builds diff --git a/indra/llcommon/llfasttimer.h b/indra/llcommon/llfasttimer.h index f56e5596f5..2024d707da 100644 --- a/indra/llcommon/llfasttimer.h +++ b/indra/llcommon/llfasttimer.h @@ -90,33 +90,15 @@ public: #if LL_FASTTIMER_USE_RDTSC static U32 getCPUClockCount32() { - U32 ret_val; - __asm - { - _emit 0x0f - _emit 0x31 - shr eax,8 - shl edx,24 - or eax, edx - mov dword ptr [ret_val], eax - } - return ret_val; + unsigned __int64 val = __rdtsc(); + val = val >> 8; + return static_cast<U32>(val); } // return full timer value, *not* shifted by 8 bits static U64 getCPUClockCount64() { - U64 ret_val; - __asm - { - _emit 0x0f - _emit 0x31 - mov eax,eax - mov edx,edx - mov dword ptr [ret_val+4], edx - mov dword ptr [ret_val], eax - } - return ret_val; + return static_cast<U64>( __rdtsc() ); } #else @@ -173,16 +155,16 @@ public: // Mac+Linux+Solaris FAST x86 implementation of CPU clock static U32 getCPUClockCount32() { - U64 x; - __asm__ volatile (".byte 0x0f, 0x31": "=A"(x)); - return (U32)(x >> 8); + U32 low(0),high(0); + __asm__ volatile (".byte 0x0f, 0x31": "=a"(low), "=d"(high) ); + return (low>>8) | (high<<24); } static U64 getCPUClockCount64() { - U64 x; - __asm__ volatile (".byte 0x0f, 0x31": "=A"(x)); - return x; + U32 low(0),high(0); + __asm__ volatile (".byte 0x0f, 0x31": "=a"(low), "=d"(high) ); + return (U64)low | ( ((U64)high) << 32); } #endif diff --git a/indra/llcommon/llfile.h b/indra/llcommon/llfile.h index d8f84daf2b..37eb75881c 100644 --- a/indra/llcommon/llfile.h +++ b/indra/llcommon/llfile.h @@ -45,7 +45,7 @@ typedef FILE LLFILE; typedef struct _stat llstat; #else typedef struct stat llstat; -#include <bits/postypes.h> +#include <sys/types.h> #endif #ifndef S_ISREG diff --git a/indra/llcommon/llheteromap.h b/indra/llcommon/llheteromap.h index 9d6f303d08..7e96172333 100644 --- a/indra/llcommon/llheteromap.h +++ b/indra/llcommon/llheteromap.h @@ -77,7 +77,7 @@ private: // not always equal &typeid(A) in some other part. Use special comparator. struct type_info_ptr_comp { - bool operator()(const std::type_info* lhs, const std::type_info* rhs) + bool operator()(const std::type_info* lhs, const std::type_info* rhs) const { return lhs->before(*rhs); } diff --git a/indra/llcommon/llmake.h b/indra/llcommon/llmake.h index 9a662a0640..08744f90fb 100644 --- a/indra/llcommon/llmake.h +++ b/indra/llcommon/llmake.h @@ -12,12 +12,10 @@ * * also relevant: * - * Template parameter deduction for constructors - * http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2015/p0091r0.html - * - * https://github.com/viboes/std-make - * - * but obviously we're not there yet. + * Template argument deduction for class templates + * http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2016/p0091r3.html + * was apparently adopted in June 2016? Unclear when compilers will + * portably support this, but there is hope. * * $LicenseInfo:firstyear=2015&license=viewerlgpl$ * Copyright (c) 2015, Linden Research, Inc. diff --git a/indra/llcommon/llmemory.cpp b/indra/llcommon/llmemory.cpp index 3a8eabac09..1e04044269 100644 --- a/indra/llcommon/llmemory.cpp +++ b/indra/llcommon/llmemory.cpp @@ -591,7 +591,7 @@ char* LLPrivateMemoryPool::LLMemoryBlock::allocate() void LLPrivateMemoryPool::LLMemoryBlock::freeMem(void* addr) { //bit index - U32 idx = ((U32)addr - (U32)mBuffer - mDummySize) / mSlotSize ; + uintptr_t idx = ((uintptr_t)addr - (uintptr_t)mBuffer - mDummySize) / mSlotSize ; U32* bits = &mUsageBits ; if(idx >= 32) @@ -773,7 +773,7 @@ char* LLPrivateMemoryPool::LLMemoryChunk::allocate(U32 size) void LLPrivateMemoryPool::LLMemoryChunk::freeMem(void* addr) { - U32 blk_idx = getPageIndex((U32)addr) ; + U32 blk_idx = getPageIndex((uintptr_t)addr) ; LLMemoryBlock* blk = (LLMemoryBlock*)(mMetaBuffer + blk_idx * sizeof(LLMemoryBlock)) ; blk = blk->mSelf ; @@ -798,7 +798,7 @@ bool LLPrivateMemoryPool::LLMemoryChunk::empty() bool LLPrivateMemoryPool::LLMemoryChunk::containsAddress(const char* addr) const { - return (U32)mBuffer <= (U32)addr && (U32)mBuffer + mBufferSize > (U32)addr ; + return (uintptr_t)mBuffer <= (uintptr_t)addr && (uintptr_t)mBuffer + mBufferSize > (uintptr_t)addr ; } //debug use @@ -831,13 +831,13 @@ void LLPrivateMemoryPool::LLMemoryChunk::dump() for(U32 i = 1 ; i < blk_list.size(); i++) { total_size += blk_list[i]->getBufferSize() ; - if((U32)blk_list[i]->getBuffer() < (U32)blk_list[i-1]->getBuffer() + blk_list[i-1]->getBufferSize()) + if((uintptr_t)blk_list[i]->getBuffer() < (uintptr_t)blk_list[i-1]->getBuffer() + blk_list[i-1]->getBufferSize()) { LL_ERRS() << "buffer corrupted." << LL_ENDL ; } } - llassert_always(total_size + mMinBlockSize >= mBufferSize - ((U32)mDataBuffer - (U32)mBuffer)) ; + llassert_always(total_size + mMinBlockSize >= mBufferSize - ((uintptr_t)mDataBuffer - (uintptr_t)mBuffer)) ; U32 blk_num = (mBufferSize - (mDataBuffer - mBuffer)) / mMinBlockSize ; for(U32 i = 0 ; i < blk_num ; ) @@ -860,7 +860,7 @@ void LLPrivateMemoryPool::LLMemoryChunk::dump() #endif #if 0 LL_INFOS() << "---------------------------" << LL_ENDL ; - LL_INFOS() << "Chunk buffer: " << (U32)getBuffer() << " size: " << getBufferSize() << LL_ENDL ; + LL_INFOS() << "Chunk buffer: " << (uintptr_t)getBuffer() << " size: " << getBufferSize() << LL_ENDL ; LL_INFOS() << "available blocks ... " << LL_ENDL ; for(S32 i = 0 ; i < mBlockLevels ; i++) @@ -868,7 +868,7 @@ void LLPrivateMemoryPool::LLMemoryChunk::dump() LLMemoryBlock* blk = mAvailBlockList[i] ; while(blk) { - LL_INFOS() << "blk buffer " << (U32)blk->getBuffer() << " size: " << blk->getBufferSize() << LL_ENDL ; + LL_INFOS() << "blk buffer " << (uintptr_t)blk->getBuffer() << " size: " << blk->getBufferSize() << LL_ENDL ; blk = blk->mNext ; } } @@ -879,7 +879,7 @@ void LLPrivateMemoryPool::LLMemoryChunk::dump() LLMemoryBlock* blk = mFreeSpaceList[i] ; while(blk) { - LL_INFOS() << "blk buffer " << (U32)blk->getBuffer() << " size: " << blk->getBufferSize() << LL_ENDL ; + LL_INFOS() << "blk buffer " << (uintptr_t)blk->getBuffer() << " size: " << blk->getBufferSize() << LL_ENDL ; blk = blk->mNext ; } } @@ -1155,9 +1155,9 @@ void LLPrivateMemoryPool::LLMemoryChunk::addToAvailBlockList(LLMemoryBlock* blk) return ; } -U32 LLPrivateMemoryPool::LLMemoryChunk::getPageIndex(U32 addr) +U32 LLPrivateMemoryPool::LLMemoryChunk::getPageIndex(uintptr_t addr) { - return (addr - (U32)mDataBuffer) / mMinBlockSize ; + return (addr - (uintptr_t)mDataBuffer) / mMinBlockSize ; } //for mAvailBlockList @@ -1495,7 +1495,7 @@ void LLPrivateMemoryPool::removeChunk(LLMemoryChunk* chunk) U16 LLPrivateMemoryPool::findHashKey(const char* addr) { - return (((U32)addr) / CHUNK_SIZE) % mHashFactor ; + return (((uintptr_t)addr) / CHUNK_SIZE) % mHashFactor ; } LLPrivateMemoryPool::LLMemoryChunk* LLPrivateMemoryPool::findChunk(const char* addr) @@ -1720,7 +1720,7 @@ LLPrivateMemoryPoolManager::~LLPrivateMemoryPoolManager() S32 k = 0 ; for(mem_allocation_info_t::iterator iter = sMemAllocationTracker.begin() ; iter != sMemAllocationTracker.end() ; ++iter) { - LL_INFOS() << k++ << ", " << (U32)iter->first << " : " << iter->second << LL_ENDL ; + LL_INFOS() << k++ << ", " << (uintptr_t)iter->first << " : " << iter->second << LL_ENDL ; } sMemAllocationTracker.clear() ; } diff --git a/indra/llcommon/llmemory.h b/indra/llcommon/llmemory.h index 575edddc43..5a3c9bd762 100644 --- a/indra/llcommon/llmemory.h +++ b/indra/llcommon/llmemory.h @@ -138,7 +138,6 @@ template <typename T> T* LL_NEXT_ALIGNED_ADDRESS_64(T* address) //------------------------------------------------------------------------------------------------ //------------------------------------------------------------------------------------------------ -#if !LL_USE_TCMALLOC inline void* ll_aligned_malloc_16(size_t size) // returned hunk MUST be freed with ll_aligned_free_16(). { #if defined(LL_WINDOWS) @@ -187,13 +186,6 @@ inline void* ll_aligned_realloc_16(void* ptr, size_t size, size_t old_size) // r #endif } -#else // USE_TCMALLOC -// ll_aligned_foo_16 are not needed with tcmalloc -#define ll_aligned_malloc_16 malloc -#define ll_aligned_realloc_16(a,b,c) realloc(a,b) -#define ll_aligned_free_16 free -#endif // USE_TCMALLOC - inline void* ll_aligned_malloc_32(size_t size) // returned hunk MUST be freed with ll_aligned_free_32(). { #if defined(LL_WINDOWS) @@ -423,7 +415,7 @@ public: { bool operator()(const LLMemoryBlock* const& lhs, const LLMemoryBlock* const& rhs) { - return (U32)lhs->getBuffer() < (U32)rhs->getBuffer(); + return (uintptr_t)lhs->getBuffer() < (uintptr_t)rhs->getBuffer(); } }; }; @@ -454,7 +446,7 @@ public: void dump() ; private: - U32 getPageIndex(U32 addr) ; + U32 getPageIndex(uintptr_t addr) ; U32 getBlockLevel(U32 size) ; U16 getPageLevel(U32 size) ; LLMemoryBlock* addBlock(U32 blk_idx) ; diff --git a/indra/llcommon/llpreprocessor.h b/indra/llcommon/llpreprocessor.h index 2c4bcc91f6..3698d9db44 100644 --- a/indra/llcommon/llpreprocessor.h +++ b/indra/llcommon/llpreprocessor.h @@ -138,6 +138,12 @@ #pragma warning( 3 : 4266 ) // 'function' : no override available for virtual member function from base 'type'; function is hidden #pragma warning (disable : 4180) // qualifier applied to function type has no meaning; ignored //#pragma warning( disable : 4284 ) // silly MS warning deep inside their <map> include file + +#if ADDRESS_SIZE == 64 +// That one is all over the place for x64 builds. +#pragma warning( disable : 4267 ) // 'var' : conversion from 'size_t' to 'type', possible loss of data) +#endif + #pragma warning( disable : 4503 ) // 'decorated name length exceeded, name was truncated'. Does not seem to affect compilation. #pragma warning( disable : 4800 ) // 'BOOL' : forcing value to bool 'true' or 'false' (performance warning) #pragma warning( disable : 4996 ) // warning: deprecated diff --git a/indra/llcommon/llprocessor.cpp b/indra/llcommon/llprocessor.cpp index e3e1d0c391..65b4507e2d 100644 --- a/indra/llcommon/llprocessor.cpp +++ b/indra/llcommon/llprocessor.cpp @@ -398,7 +398,7 @@ static F64 calculate_cpu_frequency(U32 measure_msecs) HANDLE hThread = GetCurrentThread(); unsigned long dwCurPriorityClass = GetPriorityClass(hProcess); int iCurThreadPriority = GetThreadPriority(hThread); - unsigned long dwProcessMask, dwSystemMask, dwNewMask = 1; + DWORD_PTR dwProcessMask, dwSystemMask, dwNewMask = 1; GetProcessAffinityMask(hProcess, &dwProcessMask, &dwSystemMask); SetPriorityClass(hProcess, REALTIME_PRIORITY_CLASS); diff --git a/indra/llcommon/llstring.h b/indra/llcommon/llstring.h index a40db0f8cc..2fdb8be84f 100644 --- a/indra/llcommon/llstring.h +++ b/indra/llcommon/llstring.h @@ -443,7 +443,7 @@ public: struct LLDictionaryLess { public: - bool operator()(const std::string& a, const std::string& b) + bool operator()(const std::string& a, const std::string& b) const { return (LLStringUtil::precedesDict(a, b) ? true : false); } diff --git a/indra/llcommon/llthread.cpp b/indra/llcommon/llthread.cpp index c3f235c6ee..52255bfaeb 100644 --- a/indra/llcommon/llthread.cpp +++ b/indra/llcommon/llthread.cpp @@ -63,7 +63,7 @@ void set_thread_name( DWORD dwThreadID, const char* threadName) __try { - ::RaiseException( MS_VC_EXCEPTION, 0, sizeof(info)/sizeof(DWORD), (DWORD*)&info ); + ::RaiseException( MS_VC_EXCEPTION, 0, sizeof(info)/sizeof(DWORD), (ULONG_PTR*)&info ); } __except(EXCEPTION_CONTINUE_EXECUTION) { diff --git a/indra/llcorehttp/CMakeLists.txt b/indra/llcorehttp/CMakeLists.txt index b03ee6eeda..7482fc577f 100644 --- a/indra/llcorehttp/CMakeLists.txt +++ b/indra/llcorehttp/CMakeLists.txt @@ -148,7 +148,7 @@ if (LL_TESTS) if (DARWIN) # Path inside the app bundle where we'll need to copy libraries set(LL_TEST_DESTINATION_DIR - ${CMAKE_SOURCE_DIR}/../build-darwin-i386/sharedlibs/Resources + ${CMAKE_BINARY_DIR}/sharedlibs/Resources ) # Create the Contents/Resources directory @@ -164,21 +164,23 @@ if (DARWIN) # Copy the required libraries to the package app add_custom_command(TARGET INTEGRATION_TEST_llcorehttp PRE_BUILD - COMMAND ${CMAKE_COMMAND} -E copy ${CMAKE_SOURCE_DIR}/../build-darwin-i386/packages/lib/release/libapr-1.0.dylib ${LL_TEST_DESTINATION_DIR} - DEPENDS ${CMAKE_SOURCE_DIR}/../build-darwin-i386/packages/lib/release/libapr-1.0.dylib + COMMAND ${CMAKE_COMMAND} -E copy ${AUTOBUILD_INSTALL_DIR}/lib/release/libapr-1.0.dylib ${LL_TEST_DESTINATION_DIR} + DEPENDS ${AUTOBUILD_INSTALL_DIR}/lib/release/libapr-1.0.dylib ) add_custom_command(TARGET INTEGRATION_TEST_llcorehttp PRE_BUILD - COMMAND ${CMAKE_COMMAND} -E copy ${CMAKE_SOURCE_DIR}/../build-darwin-i386/packages/lib/release/libaprutil-1.0.dylib ${LL_TEST_DESTINATION_DIR} - DEPENDS ${CMAKE_SOURCE_DIR}/../build-darwin-i386/packages/lib/release/libaprutil-1.0.dylib + COMMAND ${CMAKE_COMMAND} -E copy ${AUTOBUILD_INSTALL_DIR}/lib/release/libaprutil-1.0.dylib ${LL_TEST_DESTINATION_DIR} + DEPENDS ${AUTOBUILD_INSTALL_DIR}/lib/release/libaprutil-1.0.dylib ) add_custom_command(TARGET INTEGRATION_TEST_llcorehttp PRE_BUILD - COMMAND ${CMAKE_COMMAND} -E copy ${CMAKE_SOURCE_DIR}/../build-darwin-i386/packages/lib/release/libexception_handler.dylib ${LL_TEST_DESTINATION_DIR} - DEPENDS ${CMAKE_SOURCE_DIR}/../build-darwin-i386/packages/lib/release/libexception_handler.dylib - ) - add_custom_command(TARGET INTEGRATION_TEST_llcorehttp PRE_BUILD - COMMAND ${CMAKE_COMMAND} -E copy ${CMAKE_SOURCE_DIR}/../build-darwin-i386/packages/lib/release/libexpat.1.5.2.dylib ${LL_TEST_DESTINATION_DIR} - DEPENDS ${CMAKE_SOURCE_DIR}/../build-darwin-i386/packages/lib/release/libexpat.1.5.2.dylib + COMMAND ${CMAKE_COMMAND} -E copy ${AUTOBUILD_INSTALL_DIR}/lib/release/libexception_handler.dylib ${LL_TEST_DESTINATION_DIR} + DEPENDS ${AUTOBUILD_INSTALL_DIR}/lib/release/libexception_handler.dylib ) + foreach(expat ${EXPAT_COPY}) + add_custom_command(TARGET INTEGRATION_TEST_llcorehttp PRE_BUILD + COMMAND ${CMAKE_COMMAND} -E copy ${AUTOBUILD_INSTALL_DIR}/lib/release/${expat} ${LL_TEST_DESTINATION_DIR} + DEPENDS ${AUTOBUILD_INSTALL_DIR}/lib/release/${expat} + ) + endforeach(expat) endif (DARWIN) @@ -214,7 +216,7 @@ endif (DARWIN) # The following come from LLAddBuildTest.cmake's INTEGRATION_TEST_xxxx target. set_target_properties(http_texture_load PROPERTIES - LINK_FLAGS "/debug /NODEFAULTLIB:LIBCMT /SUBSYSTEM:CONSOLE ${TCMALLOC_LINK_FLAGS}" + LINK_FLAGS "/debug /NODEFAULTLIB:LIBCMT /SUBSYSTEM:CONSOLE" LINK_FLAGS_DEBUG "/NODEFAULTLIB:\"LIBCMT;LIBCMTD;MSVCRT\" /INCREMENTAL:NO" LINK_FLAGS_RELEASE "" ) diff --git a/indra/llcorehttp/httpcommon.cpp b/indra/llcorehttp/httpcommon.cpp index c423047bb0..1829062af6 100644 --- a/indra/llcorehttp/httpcommon.cpp +++ b/indra/llcorehttp/httpcommon.cpp @@ -50,11 +50,12 @@ HttpStatus::type_enum_t EXT_CURL_EASY; HttpStatus::type_enum_t EXT_CURL_MULTI; HttpStatus::type_enum_t LLCORE; -HttpStatus::operator unsigned long() const +HttpStatus::operator U32() const { - static const int shift(sizeof(unsigned long) * 4); + // Effectively, concatenate mType (high) with mStatus (low). + static const int shift(sizeof(mDetails->mStatus) * 8); - unsigned long result(((unsigned long)mDetails->mType) << shift | (unsigned long)(int)mDetails->mStatus); + U32 result(U32(mDetails->mType) << shift | U32((int)mDetails->mStatus)); return result; } @@ -64,7 +65,7 @@ std::string HttpStatus::toHex() const std::ostringstream result; result.width(8); result.fill('0'); - result << std::hex << operator unsigned long(); + result << std::hex << operator U32(); return result.str(); } diff --git a/indra/llcorehttp/httpcommon.h b/indra/llcorehttp/httpcommon.h index b2db01d038..ea0c38abd7 100644 --- a/indra/llcorehttp/httpcommon.h +++ b/indra/llcorehttp/httpcommon.h @@ -382,10 +382,10 @@ struct HttpStatus /// creates an ambiguous second path to integer conversion /// which tends to find programming errors such as formatting /// the status to a stream (operator<<). - operator unsigned long() const; - unsigned long toULong() const + operator U32() const; + U32 toULong() const { - return operator unsigned long(); + return operator U32(); } /// And to convert to a hex string. diff --git a/indra/llcorehttp/tests/test_httprequest.hpp b/indra/llcorehttp/tests/test_httprequest.hpp index 6cd7960ecd..a9c192e141 100644 --- a/indra/llcorehttp/tests/test_httprequest.hpp +++ b/indra/llcorehttp/tests/test_httprequest.hpp @@ -3089,6 +3089,10 @@ void HttpRequestTestObjectType::test<23>() set_test_name("HttpRequest GET 503s with 'Retry-After'"); +#if LL_WINDOWS && ADDRESS_SIZE == 64 + skip("llcorehttp 503-with-retry test hangs on Windows 64"); +#endif + // This tests mainly that the code doesn't fall over if // various well- and mis-formed Retry-After headers are // sent along with the response. Direct inspection of diff --git a/indra/llcorehttp/tests/test_httpstatus.hpp b/indra/llcorehttp/tests/test_httpstatus.hpp index 4502d32fe1..cbe3f574d4 100644 --- a/indra/llcorehttp/tests/test_httpstatus.hpp +++ b/indra/llcorehttp/tests/test_httpstatus.hpp @@ -244,7 +244,7 @@ void HttpStatusTestObjectType::test<7>() HttpStatus status(404); std::string msg = status.toHex(); // std::cout << "Result: " << msg << std::endl; - ensure(msg == "01940001"); + ensure_equals(msg, "01940001"); } diff --git a/indra/llimage/llimage.cpp b/indra/llimage/llimage.cpp index a07ea14621..fe49e8e011 100644 --- a/indra/llimage/llimage.cpp +++ b/indra/llimage/llimage.cpp @@ -1227,9 +1227,10 @@ void LLImageRaw::fill( const LLColor4U& color ) if( 4 == getComponents() ) { U32* data = (U32*) getData(); + U32 rgbaColor = color.asRGBA(); for( S32 i = 0; i < pixels; i++ ) { - data[i] = color.mAll; + data[ i ] = rgbaColor; } } else diff --git a/indra/llimagej2coj/llimagej2coj.cpp b/indra/llimagej2coj/llimagej2coj.cpp index 3bb1778d9d..925da5674b 100644 --- a/indra/llimagej2coj/llimagej2coj.cpp +++ b/indra/llimagej2coj/llimagej2coj.cpp @@ -41,8 +41,12 @@ LLImageJ2CImpl* fallbackCreateLLImageJ2CImpl() std::string LLImageJ2COJ::getEngineInfo() const { +#ifdef OPENJPEG_VERSION return std::string("OpenJPEG: " OPENJPEG_VERSION ", Runtime: ") + opj_version(); +#else + return std::string("OpenJPEG runtime: ") + opj_version(); +#endif } // Return string from message, eliminating final \n if present diff --git a/indra/llkdu/CMakeLists.txt b/indra/llkdu/CMakeLists.txt index b8f8b420c3..cb0e204e91 100644 --- a/indra/llkdu/CMakeLists.txt +++ b/indra/llkdu/CMakeLists.txt @@ -40,6 +40,14 @@ set_source_files_properties(${llkdu_HEADER_FILES} list(APPEND llkdu_SOURCE_FILES ${llkdu_HEADER_FILES}) +# Our KDU package is built with KDU_X86_INTRINSICS in its .vcxproj file. +# Unless that macro is also set for every consumer build, KDU freaks out, +# spamming the viewer log with alignment FUD. +set_source_files_properties(${llkdu_SOURCE_FILES} + PROPERTIES + COMPILE_DEFINITIONS + "KDU_X86_INTRINSICS") + if (USE_KDU) add_library (llkdu ${llkdu_SOURCE_FILES}) diff --git a/indra/llkdu/include_kdu_xxxx.h b/indra/llkdu/include_kdu_xxxx.h new file mode 100644 index 0000000000..a1dbced60b --- /dev/null +++ b/indra/llkdu/include_kdu_xxxx.h @@ -0,0 +1,40 @@ +/** + * @file include_kdu_xxxx.h + * @author Nat Goodspeed + * @date 2016-04-25 + * @brief + * + * $LicenseInfo:firstyear=2016&license=viewerlgpl$ + * Copyright (c) 2016, Linden Research, Inc. + * $/LicenseInfo$ + */ + +// This file specifically omits #include guards of its own: it's sort of an +// #include macro used to wrap KDU #includes with proper incantations. Usage: + +// #define kdu_xxxx "kdu_compressed.h" // or whichever KDU header +// #include "include_kdu_xxxx.h" +// // kdu_xxxx #undef'ed by include_kdu_xxxx.h + +#if LL_DARWIN +// don't *really* want to rebuild KDU so turn off specific warnings for this header +#pragma clang diagnostic push +#pragma clang diagnostic ignored "-Wself-assign-field" +#pragma clang diagnostic ignored "-Wunused-private-field" +#include kdu_xxxx +#pragma clang diagnostic pop +#elif LL_WINDOWS +// With warnings-as-errors in effect, strange relationship between +// jp2_output_box and its subclass jp2_target in kdu_compressed.h +// causes build failures. Specifically: +// warning C4263: 'void kdu_supp::jp2_target::open(kdu_supp::jp2_family_tgt *)' : member function does not override any base class virtual member function +// warning C4264: 'void kdu_supp::jp2_output_box::open(kdu_core::kdu_uint32)' : no override available for virtual member function from base 'kdu_supp::jp2_output_box'; function is hidden +#pragma warning(push) +#pragma warning(disable : 4263 4264) +#include kdu_xxxx +#pragma warning(pop) +#else // some other platform +#include kdu_xxxx +#endif + +#undef kdu_xxxx diff --git a/indra/llkdu/llimagej2ckdu.cpp b/indra/llkdu/llimagej2ckdu.cpp index dce4216320..4048b9a43d 100644 --- a/indra/llkdu/llimagej2ckdu.cpp +++ b/indra/llkdu/llimagej2ckdu.cpp @@ -25,21 +25,37 @@ */ #include "linden_common.h" + #include "llimagej2ckdu.h" #include "lltimer.h" #include "llpointer.h" #include "llmath.h" #include "llkdumem.h" -#include "stringize.h" -#include "kdu_block_coding.h" +#define kdu_xxxx "kdu_block_coding.h" +#include "include_kdu_xxxx.h" + +// Avoid ubiquitous necessity of kdu_core:: qualification +using namespace kdu_core; #include "llexception.h" #include <boost/exception/diagnostic_information.hpp> #include <sstream> #include <iomanip> +// stream kdu_dims to std::ostream +// Turns out this must NOT be in the anonymous namespace! +// It must also precede #include "stringize.h". +inline +std::ostream& operator<<(std::ostream& out, const kdu_dims& dims) +{ + return out << "(" << dims.pos.x << "," << dims.pos.y << ")," + "[" << dims.size.x << "x" << dims.size.y << "]"; +} + +#include "stringize.h" + namespace { // Failure to load an image shouldn't crash the whole viewer. struct KDUError: public LLContinueError @@ -82,20 +98,11 @@ std::string report_kdu_exception(kdu_exception mb) } } // anonymous namespace -// stream kdu_dims to std::ostream -// Turns out this must NOT be in the anonymous namespace! -inline -std::ostream& operator<<(std::ostream& out, const kdu_dims& dims) -{ - return out << "(" << dims.pos.x << "," << dims.pos.y << ")," - "[" << dims.size.x << "x" << dims.size.y << "]"; -} - class kdc_flow_control { public: - kdc_flow_control(kdu_image_in_base *img_in, kdu_codestream codestream); + kdc_flow_control(kdu_supp::kdu_image_in_base *img_in, kdu_codestream codestream); ~kdc_flow_control(); bool advance_components(); void process_components(); @@ -104,7 +111,7 @@ private: struct kdc_component_flow_control { public: - kdu_image_in_base *reader; + kdu_supp::kdu_image_in_base *reader; int vert_subsampling; int ratio_counter; /* Initialized to 0, decremented by `count_delta'; when < 0, a new line must be processed, after @@ -144,7 +151,8 @@ std::string LLImageJ2CKDU::getEngineInfo() const class LLKDUDecodeState { public: - LLKDUDecodeState(kdu_tile tile, kdu_byte *buf, S32 row_gap); + LLKDUDecodeState(kdu_tile tile, kdu_byte *buf, S32 row_gap, + kdu_codestream* codestreamp); ~LLKDUDecodeState(); bool processTileDecode(F32 decode_time, bool limit_time = true); @@ -346,9 +354,9 @@ void LLImageJ2CKDU::setupCodeStream(LLImageJ2C &base, bool keep_codestream, ECod // This method is only called from methods that catch KDUError. // We want to fail the image load, not crash the viewer. LLTHROW(KDUError(STRINGIZE("Component " << idx << " dimensions " - << other_dims - << " do not match component 0 dimensions " - << dims << "!"))); + << stringize(other_dims) + << " do not match component 0 dimensions " + << stringize(dims) << "!"))); } } @@ -560,7 +568,8 @@ bool LLImageJ2CKDU::decodeImpl(LLImageJ2C &base, LLImageRaw &raw_image, F32 deco kdu_coords offset = tile_dims.pos - dims.pos; int row_gap = channels*dims.size.x; // inter-row separation kdu_byte *buf = buffer + offset.y*row_gap + offset.x*channels; - mDecodeState.reset(new LLKDUDecodeState(tile, buf, row_gap)); + mDecodeState.reset(new LLKDUDecodeState(tile, buf, row_gap, + mCodeStreamp.get())); } // Do the actual processing F32 remaining_time = decode_time - decode_timer.getElapsedTimeF32(); @@ -1248,7 +1257,8 @@ all necessary level shifting, type conversion, rounding and truncation. */ } } -LLKDUDecodeState::LLKDUDecodeState(kdu_tile tile, kdu_byte *buf, S32 row_gap) +LLKDUDecodeState::LLKDUDecodeState(kdu_tile tile, kdu_byte *buf, S32 row_gap, + kdu_codestream* codestreamp) { S32 c; @@ -1294,7 +1304,7 @@ LLKDUDecodeState::LLKDUDecodeState(kdu_tile tile, kdu_byte *buf, S32 row_gap) mEngines[c] = kdu_synthesis(res,&mAllocator,use_shorts); } } - mAllocator.finalize(); // Actually creates buffering resources + mAllocator.finalize(*codestreamp); // Actually creates buffering resources for (c = 0; c < mNumComponents; c++) { mLines[c].create(); // Grabs resources from the allocator. @@ -1352,7 +1362,7 @@ separation between consecutive rows in the real buffer. */ // kdc_flow_control -kdc_flow_control::kdc_flow_control (kdu_image_in_base *img_in, kdu_codestream codestream) +kdc_flow_control::kdc_flow_control (kdu_supp::kdu_image_in_base *img_in, kdu_codestream codestream) { int n; diff --git a/indra/llkdu/llimagej2ckdu.h b/indra/llkdu/llimagej2ckdu.h index 7d234435a4..b57e4cc40e 100644 --- a/indra/llkdu/llimagej2ckdu.h +++ b/indra/llkdu/llimagej2ckdu.h @@ -37,15 +37,8 @@ #include "kdu_messaging.h" #include "kdu_params.h" -// don't *really* want to rebuild KDU so turn off specific warnings for this header -#if LL_DARWIN -#pragma clang diagnostic push -#pragma clang diagnostic ignored "-Wunused-private-field" -#include "kdu_compressed.h" -#pragma clang diagnostic pop -#else -#include "kdu_compressed.h" -#endif +#define kdu_xxxx "kdu_compressed.h" +#include "include_kdu_xxxx.h" #include "kdu_sample_processing.h" #include <boost/scoped_ptr.hpp> @@ -111,17 +104,19 @@ private: } } - kdu_codestream* operator->() { return &mCodeStream; } + // for those few times when you need a raw kdu_codestream* + kdu_core::kdu_codestream* get() { return &mCodeStream; } + kdu_core::kdu_codestream* operator->() { return &mCodeStream; } private: - kdu_codestream mCodeStream; + kdu_core::kdu_codestream mCodeStream; }; // Encode variable boost::scoped_ptr<LLKDUMemSource> mInputp; CodeStreamHolder mCodeStreamp; - boost::scoped_ptr<kdu_coords> mTPosp; // tile position - boost::scoped_ptr<kdu_dims> mTileIndicesp; + boost::scoped_ptr<kdu_core::kdu_coords> mTPosp; // tile position + boost::scoped_ptr<kdu_core::kdu_dims> mTileIndicesp; int mBlocksSize; int mPrecinctsSize; int mLevels; diff --git a/indra/llkdu/llkdumem.cpp b/indra/llkdu/llkdumem.cpp index 0347475559..96e9da25d8 100644 --- a/indra/llkdu/llkdumem.cpp +++ b/indra/llkdu/llkdumem.cpp @@ -28,6 +28,9 @@ #include "llkdumem.h" #include "llerror.h" +using namespace kdu_core; +using kd_supp_image_local::image_line_buf; + #if defined(LL_WINDOWS) # pragma warning(disable: 4702) // unreachable code #endif diff --git a/indra/llkdu/llkdumem.h b/indra/llkdu/llkdumem.h index fab913d93b..09d81f38de 100644 --- a/indra/llkdu/llkdumem.h +++ b/indra/llkdu/llkdumem.h @@ -29,26 +29,22 @@ // Support classes for reading and writing from memory buffers in KDU #define KDU_NO_THREADS -// don't *really* want to rebuild KDU so turn off specific warnings for this header -#if LL_DARWIN -#pragma clang diagnostic push -#pragma clang diagnostic ignored "-Wself-assign-field" -#pragma clang diagnostic ignored "-Wunused-private-field" -#include "kdu_image.h" -#pragma clang diagnostic pop -#else -#include "kdu_image.h" -#endif + +#define kdu_xxxx "kdu_image.h" +#include "include_kdu_xxxx.h" #include "kdu_elementary.h" #include "kdu_messaging.h" #include "kdu_params.h" -#include "kdu_compressed.h" + +#define kdu_xxxx "kdu_compressed.h" +#include "include_kdu_xxxx.h" + #include "kdu_sample_processing.h" #include "image_local.h" #include "stdtypes.h" -class LLKDUMemSource: public kdu_compressed_source +class LLKDUMemSource: public kdu_core::kdu_compressed_source { public: LLKDUMemSource(U8 *input_buffer, U32 size) @@ -62,7 +58,7 @@ public: { } - int read(kdu_byte *buf, int num_bytes) + int read(kdu_core::kdu_byte *buf, int num_bytes) { U32 num_out; num_out = num_bytes; @@ -87,7 +83,7 @@ private: U32 mCurPos; }; -class LLKDUMemTarget: public kdu_compressed_target +class LLKDUMemTarget: public kdu_core::kdu_compressed_target { public: LLKDUMemTarget(U8 *output_buffer, U32 &output_size, const U32 buffer_size) @@ -102,7 +98,7 @@ public: { } - bool write(const kdu_byte *buf, int num_bytes) + bool write(const kdu_core::kdu_byte *buf, int num_bytes) { U32 num_out; num_out = num_bytes; @@ -126,7 +122,7 @@ private: U32 *mOutputSize; }; -class LLKDUMemIn : public kdu_image_in_base +class LLKDUMemIn : public kdu_supp::kdu_image_in_base { public: LLKDUMemIn(const U8 *data, @@ -134,10 +130,10 @@ public: const U16 rows, const U16 cols, U8 in_num_components, - siz_params *siz); + kdu_core::siz_params *siz); ~LLKDUMemIn(); - bool get(int comp_idx, kdu_line_buf &line, int x_tnum); + bool get(int comp_idx, kdu_core::kdu_line_buf &line, int x_tnum); private: const U8 *mData; @@ -146,8 +142,8 @@ private: int rows, cols; int alignment_bytes; // Number of 0's at end of each line. int precision[3]; - image_line_buf *incomplete_lines; // Each "sample" represents a full pixel - image_line_buf *free_lines; + kd_supp_image_local::image_line_buf *incomplete_lines; // Each "sample" represents a full pixel + kd_supp_image_local::image_line_buf *free_lines; int num_unread_rows; U32 mCurPos; diff --git a/indra/llkdu/tests/llimagej2ckdu_test.cpp b/indra/llkdu/tests/llimagej2ckdu_test.cpp index e8b550baa6..e386a9f71b 100644 --- a/indra/llkdu/tests/llimagej2ckdu_test.cpp +++ b/indra/llkdu/tests/llimagej2ckdu_test.cpp @@ -30,6 +30,7 @@ #include "llimagej2ckdu.h" #if LL_DARWIN +// For this source, it's true that private fields in llkdumem.h are unused. #pragma clang diagnostic push #pragma clang diagnostic ignored "-Wunused-private-field" #include "llkdumem.h" @@ -37,7 +38,6 @@ #else #include "llkdumem.h" #endif - #include "kdu_block_coding.h" // Tut header #include "lltut.h" @@ -113,17 +113,19 @@ void LLImageJ2C::setLastError(const std::string&, const std::string&) { } bool LLImageJ2C::updateData() { return false; } void LLImageJ2C::updateRawDiscardLevel() { } -LLKDUMemIn::LLKDUMemIn(const U8*, const U32, const U16, const U16, const U8, siz_params*) { } +LLKDUMemIn::LLKDUMemIn(const U8*, const U32, const U16, const U16, const U8, kdu_core::siz_params*) { } LLKDUMemIn::~LLKDUMemIn() { } -bool LLKDUMemIn::get(int, kdu_line_buf&, int) { return false; } +bool LLKDUMemIn::get(int, kdu_core::kdu_line_buf&, int) { return false; } // Stub Kakadu Library calls +// they're all namespaced now +namespace kdu_core { kdu_tile_comp kdu_tile::access_component(int ) { kdu_tile_comp a; return a; } kdu_block_encoder::kdu_block_encoder() { } kdu_block_decoder::kdu_block_decoder() { } void kdu_block::set_max_passes(int , bool ) { } void kdu_block::set_max_bytes(int , bool ) { } -void kdu_tile::close(kdu_thread_env* ) { } +void kdu_tile::close(kdu_thread_env *, bool) {} int kdu_tile::get_num_components() { return 0; } bool kdu_tile::get_ycc() { return false; } void kdu_tile::set_components_of_interest(int , const int* ) { } @@ -156,14 +158,14 @@ void kdu_codestream::set_fussy() { } void kdu_codestream::get_dims(int, kdu_dims&, bool ) { } int kdu_codestream::get_min_dwt_levels() { return 5; } int kdu_codestream::get_max_tile_layers() { return 1; } -void kdu_codestream::change_appearance(bool, bool, bool) { } +void kdu_codestream::change_appearance(bool, bool, bool, kdu_thread_env *) {} void kdu_codestream::get_tile_dims(kdu_coords, int, kdu_dims&, bool ) { } void kdu_codestream::destroy() { } void kdu_codestream::collect_timing_stats(int ) { } void kdu_codestream::set_max_bytes(kdu_long, bool, bool ) { } void kdu_codestream::get_valid_tiles(kdu_dims& ) { } void kdu_codestream::create(kdu_compressed_source*, kdu_thread_env*) { } -void kdu_codestream::apply_input_restrictions( int, int, int, int, kdu_dims*, kdu_component_access_mode ) { } +void kdu_codestream::apply_input_restrictions(int, int, int, int, kdu_dims const *, kdu_component_access_mode, kdu_thread_env *, kdu_quality_limiter const *) {} void kdu_codestream::get_subsampling(int , kdu_coords&, bool ) { } void kdu_codestream::flush(kdu_long *, int, kdu_uint16 *, bool, bool, double, kdu_thread_env*, int) { } void kdu_codestream::set_resilient(bool ) { } @@ -178,13 +180,15 @@ siz_params* kdu_codestream::access_siz() { return NULL; } kdu_tile kdu_codestream::open_tile(kdu_coords , kdu_thread_env* ) { kdu_tile a; return a; } kdu_codestream_comment kdu_codestream::add_comment() { kdu_codestream_comment a; return a; } void kdu_subband::close_block(kdu_block*, kdu_thread_env*) { } -void kdu_subband::get_valid_blocks(kdu_dims &indices) { } -kdu_block* kdu_subband::open_block(kdu_coords, int*, kdu_thread_env*) { return NULL; } +void kdu_subband::get_valid_blocks(kdu_dims &indices) const { } +kdu_block * kdu_subband::open_block(kdu_coords, int *, kdu_thread_env *, int, bool) { return NULL; } bool kdu_codestream_comment::put_text(const char*) { return false; } void kdu_customize_warnings(kdu_message*) { } void kdu_customize_errors(kdu_message*) { } -kdu_long kdu_multi_analysis::create(kdu_codestream, kdu_tile, kdu_thread_env*, kdu_thread_queue*, int, kdu_roi_image*, int) { kdu_long a = 0; return a; } +kdu_long kdu_multi_analysis::create(kdu_codestream, kdu_tile, kdu_thread_env *,kdu_thread_queue *, int, kdu_roi_image *, int, kdu_sample_allocator *, kdu_push_pull_params const *) { return kdu_long(0); } +void kdu_multi_analysis::destroy(kdu_thread_env *) {} siz_params::siz_params() : kdu_params(NULL, false, false, false, false, false) { } +siz_params::~siz_params() {} void siz_params::finalize(bool ) { } void siz_params::copy_with_xforms(kdu_params*, int, int, bool, bool, bool) { } int siz_params::write_marker_segment(kdu_output*, kdu_params*, int) { return 0; } @@ -193,10 +197,15 @@ bool siz_params::read_marker_segment(kdu_uint16, int, kdu_byte a[], int) { retur kdu_decoder::kdu_decoder(kdu_subband , kdu_sample_allocator*, bool , float, int, kdu_thread_env*, kdu_thread_queue*, int) { } void kdu_codestream::create(siz_params*, kdu_compressed_target*, kdu_dims*, int, kdu_long, kdu_thread_env* ) { } +kdu_sample_allocator::~kdu_sample_allocator() {} +void kdu_sample_allocator::do_finalize(kdu_codestream) {} void (*kdu_convert_ycc_to_rgb_rev16)(kdu_int16*,kdu_int16*,kdu_int16*,int); void (*kdu_convert_ycc_to_rgb_irrev16)(kdu_int16*,kdu_int16*,kdu_int16*,int); void (*kdu_convert_ycc_to_rgb_rev32)(kdu_int32*,kdu_int32*,kdu_int32*,int); void (*kdu_convert_ycc_to_rgb_irrev32)(float*,float*,float*,int); +bool kdu_core_sample_alignment_checker(int, int, int, int, bool, bool) { return false; } +void kdu_pull_ifc::destroy() {} +} // namespace kdu_core // ------------------------------------------------------------------------------------------- // TUT diff --git a/indra/llmath/CMakeLists.txt b/indra/llmath/CMakeLists.txt index 0614fd92ef..4c8bcdac91 100644 --- a/indra/llmath/CMakeLists.txt +++ b/indra/llmath/CMakeLists.txt @@ -4,6 +4,7 @@ project(llmath) include(00-Common) include(LLCommon) +include(Boost) include_directories( ${LLCOMMON_INCLUDE_DIRS} @@ -20,6 +21,7 @@ set(llmath_SOURCE_FILES llline.cpp llmatrix3a.cpp llmodularmath.cpp + lloctree.cpp llperlin.cpp llquaternion.cpp llrect.cpp @@ -117,6 +119,11 @@ if (LL_TESTS) v4color.cpp v4coloru.cpp ) + set_source_files_properties( + ${llmath_TEST_SOURCE_FILES} + PROPERTIES + LL_TEST_ADDITIONAL_LIBRARIES "${BOOST_THREAD_LIBRARY}" + ) LL_ADD_PROJECT_UNIT_TESTS(llmath "${llmath_TEST_SOURCE_FILES}") # INTEGRATION TESTS diff --git a/indra/llmath/llmath.h b/indra/llmath/llmath.h index 692284e04b..e508c9a199 100644 --- a/indra/llmath/llmath.h +++ b/indra/llmath/llmath.h @@ -153,7 +153,7 @@ inline F64 llabs(const F64 a) inline S32 lltrunc( F32 f ) { -#if LL_WINDOWS && !defined( __INTEL_COMPILER ) +#if LL_WINDOWS && !defined( __INTEL_COMPILER ) && (ADDRESS_SIZE == 32) // Avoids changing the floating point control word. // Add or subtract 0.5 - epsilon and then round const static U32 zpfp[] = { 0xBEFFFFFF, 0x3EFFFFFF }; @@ -179,7 +179,7 @@ inline S32 lltrunc( F64 f ) inline S32 llfloor( F32 f ) { -#if LL_WINDOWS && !defined( __INTEL_COMPILER ) +#if LL_WINDOWS && !defined( __INTEL_COMPILER ) && (ADDRESS_SIZE == 32) // Avoids changing the floating point control word. // Accurate (unlike Stereopsis version) for all values between S32_MIN and S32_MAX and slightly faster than Stereopsis version. // Add -(0.5 - epsilon) and then round diff --git a/indra/llmath/lloctree.cpp b/indra/llmath/lloctree.cpp new file mode 100644 index 0000000000..3fcb3a27d7 --- /dev/null +++ b/indra/llmath/lloctree.cpp @@ -0,0 +1,29 @@ +/** + * @file lloctree.cpp + * + * $LicenseInfo:firstyear=2005&license=viewerlgpl$ + * Second Life Viewer Source Code + * Copyright (C) 2010, Linden Research, Inc. + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; + * version 2.1 of the License only. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA + * + * Linden Research, Inc., 945 Battery Street, San Francisco, CA 94111 USA + * $/LicenseInfo$ + */ +#include "stdtypes.h" + +U32 gOctreeMaxCapacity; +F32 gOctreeMinSize; + diff --git a/indra/llmath/llsimdmath.h b/indra/llmath/llsimdmath.h index cebd2ace7d..54a275633f 100644 --- a/indra/llmath/llsimdmath.h +++ b/indra/llmath/llsimdmath.h @@ -31,7 +31,7 @@ #error "Please include llmath.h before this file." #endif -#if ( ( LL_DARWIN || LL_LINUX ) && !(__SSE2__) ) || ( LL_WINDOWS && ( _M_IX86_FP < 2 ) ) +#if ( ( LL_DARWIN || LL_LINUX ) && !(__SSE2__) ) || ( LL_WINDOWS && ( _M_IX86_FP < 2 && ADDRESS_SIZE == 32 ) ) #error SSE2 not enabled. LLVector4a and related class will not compile. #endif diff --git a/indra/llmath/llvolume.cpp b/indra/llmath/llvolume.cpp index 7a54d83b3f..274ec50f20 100644 --- a/indra/llmath/llvolume.cpp +++ b/indra/llmath/llvolume.cpp @@ -89,7 +89,7 @@ const F32 SKEW_MAX = 0.95f; const F32 SCULPT_MIN_AREA = 0.002f; const S32 SCULPT_MIN_AREA_DETAIL = 1; -extern BOOL gDebugGL; +BOOL gDebugGL = FALSE; BOOL check_same_clock_dir( const LLVector3& pt1, const LLVector3& pt2, const LLVector3& pt3, const LLVector3& norm) { diff --git a/indra/llmath/llvolume.h b/indra/llmath/llvolume.h index d66004cdad..bf81c978a0 100644 --- a/indra/llmath/llvolume.h +++ b/indra/llmath/llvolume.h @@ -199,6 +199,8 @@ const U8 LL_SCULPT_FLAG_MASK = LL_SCULPT_FLAG_INVERT | LL_SCULPT_FLAG_MIRROR; const S32 LL_SCULPT_MESH_MAX_FACES = 8; +extern BOOL gDebugGL; + class LLProfileParams { public: diff --git a/indra/llmath/tests/v4math_test.cpp b/indra/llmath/tests/v4math_test.cpp index 191ac864df..9779dfded3 100644 --- a/indra/llmath/tests/v4math_test.cpp +++ b/indra/llmath/tests/v4math_test.cpp @@ -355,7 +355,8 @@ namespace tut val3 = z1 + (z2 - z1)* val; val4 = w1 + (w2 - w1)* val; LLVector4 vec4b = lerp(vec4,vec4a,val); - ensure("lerp failed", ((val1 ==vec4b.mV[VX])&& (val2 ==vec4b.mV[VY]) && (val3 ==vec4b.mV[VZ])&& (val4 ==vec4b.mV[VW]))); + LLVector4 check(val1, val2, val3, val4); + ensure_equals("lerp failed", check, vec4b); } template<> template<> diff --git a/indra/llmath/v4coloru.h b/indra/llmath/v4coloru.h index fddad34978..704ce852d9 100644 --- a/indra/llmath/v4coloru.h +++ b/indra/llmath/v4coloru.h @@ -47,14 +47,7 @@ class LLColor4U { public: - union - { - U8 mV[LENGTHOFCOLOR4U]; - U32 mAll; - LLColor4* mSources; - LLColor4U* mSourcesU; - }; - + U8 mV[LENGTHOFCOLOR4U]; LLColor4U(); // Initializes LLColor4U to (0, 0, 0, 1) LLColor4U(U8 r, U8 g, U8 b); // Initializes LLColor4U to (r, g, b, 1) @@ -132,6 +125,9 @@ public: return LLColor4(*this); } + U32 asRGBA() const; + void fromRGBA( U32 aVal ); + static LLColor4U white; static LLColor4U black; static LLColor4U red; @@ -565,6 +561,26 @@ void LLColor4U::setVecScaleClamp(const LLColor3& color) mV[3] = 255; } +inline U32 LLColor4U::asRGBA() const +{ + // Little endian: values are swapped in memory. The original code access the array like a U32, so we need to swap here + + return (mV[3] << 24) | (mV[2] << 16) | (mV[1] << 8) | mV[0]; +} + +inline void LLColor4U::fromRGBA( U32 aVal ) +{ + // Little endian: values are swapped in memory. The original code access the array like a U32, so we need to swap here + + mV[ 0 ] = aVal & 0xFF; + aVal >>= 8; + mV[ 1 ] = aVal & 0xFF; + aVal >>= 8; + mV[ 2 ] = aVal & 0xFF; + aVal >>= 8; + mV[ 3 ] = aVal & 0xFF; +} + #endif diff --git a/indra/llplugin/CMakeLists.txt b/indra/llplugin/CMakeLists.txt index 84667f1b82..2cdea67723 100644 --- a/indra/llplugin/CMakeLists.txt +++ b/indra/llplugin/CMakeLists.txt @@ -56,13 +56,13 @@ set(llplugin_HEADER_FILES set_source_files_properties(${llplugin_HEADER_FILES} PROPERTIES HEADER_FILE_ONLY TRUE) -if(NOT WORD_SIZE EQUAL 32) +if(NOT ADDRESS_SIZE EQUAL 32) if(WINDOWS) - add_definitions(/FIXED:NO) + ##add_definitions(/FIXED:NO) else(WINDOWS) # not windows therefore gcc LINUX and DARWIN add_definitions(-fPIC) endif(WINDOWS) -endif(NOT WORD_SIZE EQUAL 32) +endif(NOT ADDRESS_SIZE EQUAL 32) list(APPEND llplugin_SOURCE_FILES ${llplugin_HEADER_FILES}) diff --git a/indra/llrender/llgl.cpp b/indra/llrender/llgl.cpp index 7757198af5..18063e9700 100644 --- a/indra/llrender/llgl.cpp +++ b/indra/llrender/llgl.cpp @@ -55,7 +55,6 @@ BOOL gDebugSession = FALSE; -BOOL gDebugGL = FALSE; BOOL gClothRipple = FALSE; BOOL gHeadlessClient = FALSE; BOOL gGLActive = FALSE; diff --git a/indra/llrender/llrender.cpp b/indra/llrender/llrender.cpp index 3e7c69611d..77c5921c9c 100644 --- a/indra/llrender/llrender.cpp +++ b/indra/llrender/llrender.cpp @@ -2046,7 +2046,8 @@ void LLRender::vertexBatchPreTransformed(LLVector3* verts, S32 vert_count) } } - mVerticesp[mCount] = mVerticesp[mCount-1]; + if( mCount > 0 ) // ND: Guard against crashes if mCount is zero, yes it can happen + mVerticesp[mCount] = mVerticesp[mCount-1]; } void LLRender::vertexBatchPreTransformed(LLVector3* verts, LLVector2* uvs, S32 vert_count) @@ -2162,9 +2163,12 @@ void LLRender::vertexBatchPreTransformed(LLVector3* verts, LLVector2* uvs, LLCol } } - mVerticesp[mCount] = mVerticesp[mCount-1]; - mTexcoordsp[mCount] = mTexcoordsp[mCount-1]; - mColorsp[mCount] = mColorsp[mCount-1]; + if (mCount > 0) + { + mVerticesp[mCount] = mVerticesp[mCount - 1]; + mTexcoordsp[mCount] = mTexcoordsp[mCount - 1]; + mColorsp[mCount] = mColorsp[mCount - 1]; + } } void LLRender::vertex2i(const GLint& x, const GLint& y) diff --git a/indra/llrender/llvertexbuffer.cpp b/indra/llrender/llvertexbuffer.cpp index 31dffdd545..3851669360 100644 --- a/indra/llrender/llvertexbuffer.cpp +++ b/indra/llrender/llvertexbuffer.cpp @@ -1436,13 +1436,22 @@ void LLVertexBuffer::setupVertexArray() //glVertexattribIPointer requires GLSL 1.30 or later if (gGLManager.mGLSLVersionMajor > 1 || gGLManager.mGLSLVersionMinor >= 30) { - glVertexAttribIPointer(i, attrib_size[i], attrib_type[i], sTypeSize[i], (void*) mOffsets[i]); + glVertexAttribIPointer(i, attrib_size[i], attrib_type[i], sTypeSize[i], (const GLvoid*) mOffsets[i]); } #endif } else { - glVertexAttribPointerARB(i, attrib_size[i], attrib_type[i], attrib_normalized[i], sTypeSize[i], (void*) mOffsets[i]); + // nat 2016-12-16: With 64-bit clang compile, the compiler + // produces an error if we simply cast mOffsets[i] -- an S32 + // -- to (GLvoid *), the type of the parameter. It correctly + // points out that there's no way an S32 could fit a real + // pointer value. Ruslan asserts that in this case the last + // param is interpreted as an array data offset within the VBO + // rather than as an actual pointer, so it's okay. + glVertexAttribPointerARB(i, attrib_size[i], attrib_type[i], + attrib_normalized[i], sTypeSize[i], + reinterpret_cast<GLvoid*>(mOffsets[i])); } } else diff --git a/indra/llui/CMakeLists.txt b/indra/llui/CMakeLists.txt index 7fb1db15fb..8054eb3619 100644 --- a/indra/llui/CMakeLists.txt +++ b/indra/llui/CMakeLists.txt @@ -3,6 +3,7 @@ project(llui) include(00-Common) +include(Hunspell) include(LLCommon) include(LLImage) include(LLInventory) @@ -294,7 +295,11 @@ if(LL_TESTS) ) LL_ADD_PROJECT_UNIT_TESTS(llui "${llui_TEST_SOURCE_FILES}") # INTEGRATION TESTS - set(test_libs llui llmessage llcorehttp llcommon ${LLCOMMON_LIBRARIES} ${BOOST_COROUTINE_LIBRARY} ${BOOST_CONTEXT_LIBRARY} ${BOOST_SYSTEM_LIBRARY} ${WINDOWS_LIBRARIES}) + set(test_libs llui llmessage llcorehttp llcommon + ${HUNSPELL_LIBRARY} + ${LLCOMMON_LIBRARIES} + ${BOOST_COROUTINE_LIBRARY} ${BOOST_CONTEXT_LIBRARY} ${BOOST_SYSTEM_LIBRARY} + ${WINDOWS_LIBRARIES}) if(NOT LINUX) LL_ADD_INTEGRATION_TEST(llurlentry llurlentry.cpp "${test_libs}") endif(NOT LINUX) diff --git a/indra/llui/llstatgraph.h b/indra/llui/llstatgraph.h index f381e92a4d..ba7cfc5d10 100644 --- a/indra/llui/llstatgraph.h +++ b/indra/llui/llstatgraph.h @@ -126,7 +126,7 @@ private: F32 mValue; LLUIColor mColor; - bool operator <(const Threshold& other) + bool operator <(const Threshold& other) const { return mValue < other.mValue; } diff --git a/indra/llui/tests/llurlentry_test.cpp b/indra/llui/tests/llurlentry_test.cpp index 233fb6da23..119cbebc81 100644 --- a/indra/llui/tests/llurlentry_test.cpp +++ b/indra/llui/tests/llurlentry_test.cpp @@ -28,7 +28,7 @@ #include "linden_common.h" #include "../llurlentry.h" #include "../lluictrl.h" -#include "llurlentry_stub.cpp" +//#include "llurlentry_stub.cpp" #include "lltut.h" #include "../lluicolortable.h" #include "../llrender/lluiimage.h" @@ -49,6 +49,7 @@ // // } +/*==========================================================================*| typedef std::map<std::string, LLControlGroup*> settings_map_t; settings_map_t LLUI::sSettingGroups; @@ -83,6 +84,7 @@ S32 LLUIImage::getHeight() const { return 0; } +|*==========================================================================*/ namespace tut { diff --git a/indra/llvfs/lldir_mac.cpp b/indra/llvfs/lldir_mac.cpp index 4038c92465..e776b84a12 100644 --- a/indra/llvfs/lldir_mac.cpp +++ b/indra/llvfs/lldir_mac.cpp @@ -94,7 +94,7 @@ LLDir_Mac::LLDir_Mac() // MBW -- This keeps the mac application from finding other things. // If this is really for skins, it should JUST apply to skins. - U32 build_dir_pos = mExecutableDir.rfind("/build-darwin-"); + std::string::size_type build_dir_pos = mExecutableDir.rfind("/build-darwin-"); if (build_dir_pos != std::string::npos) { // ...we're in a dev checkout diff --git a/indra/llwindow/lldragdropwin32.cpp b/indra/llwindow/lldragdropwin32.cpp index d00d9ab47e..0d1a47408b 100644 --- a/indra/llwindow/lldragdropwin32.cpp +++ b/indra/llwindow/lldragdropwin32.cpp @@ -113,7 +113,7 @@ class LLDragDropWin32Target: PVOID data = GlobalLock( stgmed.hGlobal ); mDropUrl = std::string( (char*)data ); // XXX MAJOR MAJOR HACK! - LLWindowWin32 *window_imp = (LLWindowWin32 *)GetWindowLong(mAppWindowHandle, GWL_USERDATA); + LLWindowWin32 *window_imp = (LLWindowWin32 *)GetWindowLongPtr( mAppWindowHandle, GWLP_USERDATA ); if (NULL != window_imp) { LLCoordGL gl_coord( 0, 0 ); @@ -168,7 +168,7 @@ class LLDragDropWin32Target: if ( mAllowDrop ) { // XXX MAJOR MAJOR HACK! - LLWindowWin32 *window_imp = (LLWindowWin32 *)GetWindowLong(mAppWindowHandle, GWL_USERDATA); + LLWindowWin32 *window_imp = (LLWindowWin32 *)GetWindowLongPtr( mAppWindowHandle, GWLP_USERDATA ); if (NULL != window_imp) { LLCoordGL gl_coord( 0, 0 ); @@ -215,7 +215,7 @@ class LLDragDropWin32Target: HRESULT __stdcall DragLeave( void ) { // XXX MAJOR MAJOR HACK! - LLWindowWin32 *window_imp = (LLWindowWin32 *)GetWindowLong(mAppWindowHandle, GWL_USERDATA); + LLWindowWin32 *window_imp = (LLWindowWin32 *)GetWindowLongPtr( mAppWindowHandle, GWLP_USERDATA ); if (NULL != window_imp) { LLCoordGL gl_coord( 0, 0 ); @@ -232,7 +232,7 @@ class LLDragDropWin32Target: if ( mAllowDrop ) { // window impl stored in Window data (neat!) - LLWindowWin32 *window_imp = (LLWindowWin32 *)GetWindowLong( mAppWindowHandle, GWL_USERDATA ); + LLWindowWin32 *window_imp = (LLWindowWin32 *)GetWindowLongPtr( mAppWindowHandle, GWLP_USERDATA ); if ( NULL != window_imp ) { POINT pt_client; diff --git a/indra/llwindow/llwindowmacosx.cpp b/indra/llwindow/llwindowmacosx.cpp index 754306b5d2..d28a7f177f 100644 --- a/indra/llwindow/llwindowmacosx.cpp +++ b/indra/llwindow/llwindowmacosx.cpp @@ -1758,7 +1758,7 @@ void LLWindowMacOSX::spawnWebBrowser(const std::string& escaped_url, bool async) LLSD LLWindowMacOSX::getNativeKeyData() { LLSD result = LLSD::emptyMap(); -#if 1 + if(mRawKeyEvent) { result["event_type"] = LLSD::Integer(mRawKeyEvent->mEventType); @@ -1768,7 +1768,6 @@ LLSD LLWindowMacOSX::getNativeKeyData() result["event_umodchars"] = (mRawKeyEvent->mEventUnmodChars) ? LLSD(LLSD::Integer(mRawKeyEvent->mEventUnmodChars)) : LLSD(); result["event_isrepeat"] = LLSD::Boolean(mRawKeyEvent->mEventRepeat); } -#endif LL_DEBUGS() << "native key data is: " << result << LL_ENDL; diff --git a/indra/llwindow/llwindowwin32.cpp b/indra/llwindow/llwindowwin32.cpp index 321792eb14..301ae7f9c4 100644 --- a/indra/llwindow/llwindowwin32.cpp +++ b/indra/llwindow/llwindowwin32.cpp @@ -785,7 +785,7 @@ void LLWindowWin32::close() LL_DEBUGS("Window") << "Destroying Window" << LL_ENDL; // Don't process events in our mainWindowProc any longer. - SetWindowLong(mWindowHandle, GWL_USERDATA, NULL); + SetWindowLongPtr(mWindowHandle, GWLP_USERDATA, NULL); // Make sure we don't leave a blank toolbar button. ShowWindow(mWindowHandle, SW_HIDE); @@ -1564,7 +1564,7 @@ BOOL LLWindowWin32::switchContext(BOOL fullscreen, const LLCoordScreen &size, BO LL_DEBUGS("Window") << "Keeping vertical sync" << LL_ENDL; } - SetWindowLong(mWindowHandle, GWL_USERDATA, (U32)this); + SetWindowLongPtr(mWindowHandle, GWLP_USERDATA, (LONG_PTR)this); // register this window as handling drag/drop events from the OS DragAcceptFiles( mWindowHandle, TRUE ); @@ -1876,7 +1876,7 @@ LRESULT CALLBACK LLWindowWin32::mainWindowProc(HWND h_wnd, UINT u_msg, WPARAM w_ // This is to avoid triggering double click teleport after returning focus (see MAINT-3786). static bool sHandleDoubleClick = true; - LLWindowWin32 *window_imp = (LLWindowWin32 *)GetWindowLong(h_wnd, GWL_USERDATA); + LLWindowWin32 *window_imp = (LLWindowWin32 *)GetWindowLongPtr( h_wnd, GWLP_USERDATA ); if (NULL != window_imp) diff --git a/indra/media_plugins/CMakeLists.txt b/indra/media_plugins/CMakeLists.txt index 9055e0111a..1eadce825e 100644 --- a/indra/media_plugins/CMakeLists.txt +++ b/indra/media_plugins/CMakeLists.txt @@ -8,14 +8,11 @@ if (LINUX) endif (LINUX) if (DARWIN) - add_subdirectory(quicktime) add_subdirectory(cef) + add_subdirectory(libvlc) endif (DARWIN) if (WINDOWS) add_subdirectory(cef) - add_subdirectory(winmmshim) add_subdirectory(libvlc) endif (WINDOWS) - -### add_subdirectory(example) diff --git a/indra/media_plugins/base/CMakeLists.txt b/indra/media_plugins/base/CMakeLists.txt index 7367b9e5e6..70c81d4023 100644 --- a/indra/media_plugins/base/CMakeLists.txt +++ b/indra/media_plugins/base/CMakeLists.txt @@ -28,13 +28,13 @@ include_directories(SYSTEM ### media_plugin_base -if(NOT WORD_SIZE EQUAL 32) +if(NOT ADDRESS_SIZE EQUAL 32) if(WINDOWS) - add_definitions(/FIXED:NO) + ##add_definitions(/FIXED:NO) else(WINDOWS) # not windows therefore gcc LINUX and DARWIN add_definitions(-fPIC) endif(WINDOWS) -endif(NOT WORD_SIZE EQUAL 32) +endif(NOT ADDRESS_SIZE EQUAL 32) set(media_plugin_base_SOURCE_FILES media_plugin_base.cpp diff --git a/indra/media_plugins/cef/CMakeLists.txt b/indra/media_plugins/cef/CMakeLists.txt index db471c7906..201fb44847 100644 --- a/indra/media_plugins/cef/CMakeLists.txt +++ b/indra/media_plugins/cef/CMakeLists.txt @@ -34,22 +34,18 @@ include_directories(SYSTEM ### media_plugin_cef -if(NOT WORD_SIZE EQUAL 32) +if(NOT ADDRESS_SIZE EQUAL 32) if(WINDOWS) - add_definitions(/FIXED:NO) + ##add_definitions(/FIXED:NO) else(WINDOWS) # not windows therefore gcc LINUX and DARWIN add_definitions(-fPIC) endif(WINDOWS) -endif(NOT WORD_SIZE EQUAL 32) +endif(NOT ADDRESS_SIZE EQUAL 32) set(media_plugin_cef_SOURCE_FILES media_plugin_cef.cpp ) -set(media_plugin_cef_HEADER_FILES - volume_catcher.h - ) - set (media_plugin_cef_LINK_LIBRARIES ${LLPLUGIN_LIBRARIES} ${MEDIA_PLUGIN_BASE_LIBRARIES} @@ -58,22 +54,6 @@ set (media_plugin_cef_LINK_LIBRARIES ${PLUGIN_API_WINDOWS_LIBRARIES}) -# Select which VolumeCatcher implementation to use -if (LINUX) - message(FATAL_ERROR "CEF plugin has been enabled for a Linux compile.\n" - " Please create a volume_catcher implementation for this platform.") - -elseif (DARWIN) - list(APPEND media_plugin_cef_SOURCE_FILES mac_volume_catcher.cpp) - find_library(CORESERVICES_LIBRARY CoreServices) - find_library(AUDIOUNIT_LIBRARY AudioUnit) - list(APPEND media_plugin_cef_LINK_LIBRARIES - ${CORESERVICES_LIBRARY} # for Component Manager calls - ${AUDIOUNIT_LIBRARY} # for AudioUnit calls - ) -elseif (WINDOWS) - list(APPEND media_plugin_cef_SOURCE_FILES windows_volume_catcher.cpp) -endif (LINUX) set_source_files_properties(${media_plugin_cef_HEADER_FILES} PROPERTIES HEADER_FILE_ONLY TRUE) @@ -97,8 +77,8 @@ if (WINDOWS) set_target_properties( media_plugin_cef PROPERTIES - LINK_FLAGS "/MANIFEST:NO /SAFESEH:NO /LTCG /NODEFAULTLIB:LIBCMT" - LINK_FLAGS_DEBUG "/MANIFEST:NO /SAFESEH:NO /NODEFAULTLIB:LIBCMTD" + LINK_FLAGS "/MANIFEST:NO /SAFESEH:NO /NODEFAULTLIB:LIBCMT /IGNORE:4099" + LINK_FLAGS_DEBUG "/MANIFEST:NO /SAFESEH:NO /NODEFAULTLIB:LIBCMTD /IGNORE:4099" ) endif (WINDOWS) @@ -113,6 +93,9 @@ if (DARWIN) LINK_FLAGS "-exported_symbols_list ${CMAKE_CURRENT_SOURCE_DIR}/../base/media_plugin_base.exp" ) + ## turns on C++11 using Cmake + target_compile_features(media_plugin_cef PRIVATE cxx_range_for) + add_custom_command(TARGET media_plugin_cef POST_BUILD COMMAND ${CMAKE_INSTALL_NAME_TOOL} -change "@executable_path/Chromium Embedded Framework" "@executable_path/../../../../Frameworks/Chromium Embedded Framework.framework/Chromium Embedded Framework" diff --git a/indra/media_plugins/cef/media_plugin_cef.cpp b/indra/media_plugins/cef/media_plugin_cef.cpp index 4eb29c98f9..90bdeb082c 100644 --- a/indra/media_plugins/cef/media_plugin_cef.cpp +++ b/indra/media_plugins/cef/media_plugin_cef.cpp @@ -36,10 +36,9 @@ #include "llpluginmessageclasses.h" #include "media_plugin_base.h" -#include "boost/function.hpp" -#include "boost/bind.hpp" -#include "llCEFLib.h" -#include "volume_catcher.h" +#include <functional> + +#include "dullahan.h" //////////////////////////////////////////////////////////////////////////////// // @@ -56,7 +55,7 @@ public: private: bool init(); - void onPageChangedCallback(unsigned char* pixels, int x, int y, int width, int height, bool is_popup); + void onPageChangedCallback(const unsigned char* pixels, int x, int y, const int width, const int height, bool is_popup); void onCustomSchemeURLCallback(std::string url); void onConsoleMessageCallback(std::string message, std::string source, int line); void onStatusMessageCallback(std::string value); @@ -67,17 +66,15 @@ private: void onAddressChangeCallback(std::string url); void onNavigateURLCallback(std::string url, std::string target); bool onHTTPAuthCallback(const std::string host, const std::string realm, std::string& username, std::string& password); - void onCursorChangedCallback(LLCEFLib::ECursorType type, unsigned int handle); + void onCursorChangedCallback(dullahan::ECursorType type); void onFileDownloadCallback(std::string filename); const std::string onFileDialogCallback(); void postDebugMessage(const std::string& msg); void authResponse(LLPluginMessage &message); - LLCEFLib::EKeyboardModifier decodeModifiers(std::string &modifiers); - void deserializeKeyboardData(LLSD native_key_data, uint32_t& native_scan_code, uint32_t& native_virtual_key, uint32_t& native_modifiers); - void keyEvent(LLCEFLib::EKeyEvent key_event, int key, LLCEFLib::EKeyboardModifier modifiers, LLSD native_key_data); - void unicodeInput(const std::string &utf8str, LLCEFLib::EKeyboardModifier modifiers, LLSD native_key_data); + void keyEvent(dullahan::EKeyEvent key_event, LLSD native_key_data); + void unicodeInput(LLSD native_key_data); void checkEditState(); void setVolume(F32 vol); @@ -97,9 +94,7 @@ private: std::string mCachePath; std::string mCookiePath; std::string mPickedFile; - LLCEFLib* mLLCEFLib; - - VolumeCatcher mVolumeCatcher; + dullahan* mCEFLib; U8 *mPopupBuffer; U32 mPopupW; @@ -132,7 +127,7 @@ MediaPluginBase(host_send_func, host_user_data) mCachePath = ""; mCookiePath = ""; mPickedFile = ""; - mLLCEFLib = new LLCEFLib(); + mCEFLib = new dullahan(); mPopupBuffer = NULL; mPopupW = 0; @@ -166,7 +161,7 @@ void MediaPluginCEF::postDebugMessage(const std::string& msg) //////////////////////////////////////////////////////////////////////////////// // -void MediaPluginCEF::onPageChangedCallback(unsigned char* pixels, int x, int y, int width, int height, bool is_popup) +void MediaPluginCEF::onPageChangedCallback(const unsigned char* pixels, int x, int y, const int width, const int height, bool is_popup) { if( is_popup ) { @@ -254,8 +249,8 @@ void MediaPluginCEF::onLoadStartCallback() { LLPluginMessage message(LLPLUGIN_MESSAGE_CLASS_MEDIA_BROWSER, "navigate_begin"); //message.setValue("uri", event.getEventUri()); // not easily available here in CEF - needed? - message.setValueBoolean("history_back_available", mLLCEFLib->canGoBack()); - message.setValueBoolean("history_forward_available", mLLCEFLib->canGoForward()); + message.setValueBoolean("history_back_available", mCEFLib->canGoBack()); + message.setValueBoolean("history_forward_available", mCEFLib->canGoForward()); sendMessage(message); } @@ -263,7 +258,7 @@ void MediaPluginCEF::onLoadStartCallback() // void MediaPluginCEF::onRequestExitCallback() { - mLLCEFLib->shutdown(); + mCEFLib->shutdown(); LLPluginMessage message("base", "goodbye"); sendMessage(message); @@ -276,8 +271,8 @@ void MediaPluginCEF::onLoadEndCallback(int httpStatusCode) LLPluginMessage message(LLPLUGIN_MESSAGE_CLASS_MEDIA_BROWSER, "navigate_complete"); //message.setValue("uri", event.getEventUri()); // not easily available here in CEF - needed? message.setValueS32("result_code", httpStatusCode); - message.setValueBoolean("history_back_available", mLLCEFLib->canGoBack()); - message.setValueBoolean("history_forward_available", mLLCEFLib->canGoForward()); + message.setValueBoolean("history_back_available", mCEFLib->canGoBack()); + message.setValueBoolean("history_forward_available", mCEFLib->canGoForward()); sendMessage(message); } @@ -360,25 +355,25 @@ const std::string MediaPluginCEF::onFileDialogCallback() return mPickedFile; } -void MediaPluginCEF::onCursorChangedCallback(LLCEFLib::ECursorType type, unsigned int handle) +void MediaPluginCEF::onCursorChangedCallback(dullahan::ECursorType type) { std::string name = ""; switch (type) { - case LLCEFLib::CT_POINTER: + case dullahan::CT_POINTER: name = "arrow"; break; - case LLCEFLib::CT_IBEAM: + case dullahan::CT_IBEAM: name = "ibeam"; break; - case LLCEFLib::CT_NORTHSOUTHRESIZE: + case dullahan::CT_NORTHSOUTHRESIZE: name = "splitv"; break; - case LLCEFLib::CT_EASTWESTRESIZE: + case dullahan::CT_EASTWESTRESIZE: name = "splith"; break; - case LLCEFLib::CT_HAND: + case dullahan::CT_HAND: name = "hand"; break; @@ -430,9 +425,8 @@ void MediaPluginCEF::receiveMessage(const char* message_string) } else if (message_name == "idle") { - mLLCEFLib->update(); + mCEFLib->update(); - mVolumeCatcher.pump(); // this seems bad but unless the state changes (it won't until we figure out // how to get CEF to tell us if copy/cut/paste is available) then this function // will return immediately @@ -440,7 +434,7 @@ void MediaPluginCEF::receiveMessage(const char* message_string) } else if (message_name == "cleanup") { - mLLCEFLib->requestExit(); + mCEFLib->requestExit(); } else if (message_name == "shm_added") { @@ -482,42 +476,51 @@ void MediaPluginCEF::receiveMessage(const char* message_string) { if (message_name == "init") { - // event callbacks from LLCefLib - mLLCEFLib->setOnPageChangedCallback(boost::bind(&MediaPluginCEF::onPageChangedCallback, this, _1, _2, _3, _4, _5, _6)); - mLLCEFLib->setOnCustomSchemeURLCallback(boost::bind(&MediaPluginCEF::onCustomSchemeURLCallback, this, _1)); - mLLCEFLib->setOnConsoleMessageCallback(boost::bind(&MediaPluginCEF::onConsoleMessageCallback, this, _1, _2, _3)); - mLLCEFLib->setOnStatusMessageCallback(boost::bind(&MediaPluginCEF::onStatusMessageCallback, this, _1)); - mLLCEFLib->setOnTitleChangeCallback(boost::bind(&MediaPluginCEF::onTitleChangeCallback, this, _1)); - mLLCEFLib->setOnLoadStartCallback(boost::bind(&MediaPluginCEF::onLoadStartCallback, this)); - mLLCEFLib->setOnLoadEndCallback(boost::bind(&MediaPluginCEF::onLoadEndCallback, this, _1)); - mLLCEFLib->setOnAddressChangeCallback(boost::bind(&MediaPluginCEF::onAddressChangeCallback, this, _1)); - mLLCEFLib->setOnNavigateURLCallback(boost::bind(&MediaPluginCEF::onNavigateURLCallback, this, _1, _2)); - mLLCEFLib->setOnHTTPAuthCallback(boost::bind(&MediaPluginCEF::onHTTPAuthCallback, this, _1, _2, _3, _4)); - mLLCEFLib->setOnFileDownloadCallback(boost::bind(&MediaPluginCEF::onFileDownloadCallback, this, _1)); - mLLCEFLib->setOnFileDialogCallback(boost::bind(&MediaPluginCEF::onFileDialogCallback, this)); - mLLCEFLib->setOnCursorChangedCallback(boost::bind(&MediaPluginCEF::onCursorChangedCallback, this, _1, _2)); - mLLCEFLib->setOnRequestExitCallback(boost::bind(&MediaPluginCEF::onRequestExitCallback, this)); - - LLCEFLib::LLCEFLibSettings settings; - settings.initial_width = 1024; - settings.initial_height = 1024; - settings.page_zoom_factor = message_in.getValueReal("factor"); - settings.plugins_enabled = mPluginsEnabled; - settings.media_stream_enabled = false; // MAINT-6060 - WebRTC media removed until we can add granualrity/query UI - settings.javascript_enabled = mJavascriptEnabled; - settings.cookies_enabled = mCookiesEnabled; - settings.cookie_store_path = mCookiePath; + // event callbacks from Dullahan + mCEFLib->setOnPageChangedCallback(std::bind(&MediaPluginCEF::onPageChangedCallback, this, std::placeholders::_1, std::placeholders::_2, std::placeholders::_3, std::placeholders::_4, std::placeholders::_5, std::placeholders::_6)); + mCEFLib->setOnCustomSchemeURLCallback(std::bind(&MediaPluginCEF::onCustomSchemeURLCallback, this, std::placeholders::_1)); + mCEFLib->setOnConsoleMessageCallback(std::bind(&MediaPluginCEF::onConsoleMessageCallback, this, std::placeholders::_1, std::placeholders::_2, std::placeholders::_3)); + mCEFLib->setOnStatusMessageCallback(std::bind(&MediaPluginCEF::onStatusMessageCallback, this, std::placeholders::_1)); + mCEFLib->setOnTitleChangeCallback(std::bind(&MediaPluginCEF::onTitleChangeCallback, this, std::placeholders::_1)); + mCEFLib->setOnLoadStartCallback(std::bind(&MediaPluginCEF::onLoadStartCallback, this)); + mCEFLib->setOnLoadEndCallback(std::bind(&MediaPluginCEF::onLoadEndCallback, this, std::placeholders::_1)); + mCEFLib->setOnAddressChangeCallback(std::bind(&MediaPluginCEF::onAddressChangeCallback, this, std::placeholders::_1)); + mCEFLib->setOnNavigateURLCallback(std::bind(&MediaPluginCEF::onNavigateURLCallback, this, std::placeholders::_1, std::placeholders::_2)); + mCEFLib->setOnHTTPAuthCallback(std::bind(&MediaPluginCEF::onHTTPAuthCallback, this, std::placeholders::_1, std::placeholders::_2, std::placeholders::_3, std::placeholders::_4)); + mCEFLib->setOnFileDownloadCallback(std::bind(&MediaPluginCEF::onFileDownloadCallback, this, std::placeholders::_1)); + mCEFLib->setOnFileDialogCallback(std::bind(&MediaPluginCEF::onFileDialogCallback, this)); + mCEFLib->setOnCursorChangedCallback(std::bind(&MediaPluginCEF::onCursorChangedCallback, this, std::placeholders::_1)); + mCEFLib->setOnRequestExitCallback(std::bind(&MediaPluginCEF::onRequestExitCallback, this)); + + dullahan::dullahan_settings settings; + settings.accept_language_list = mHostLanguage; + settings.background_color = 0xffffff; settings.cache_enabled = true; settings.cache_path = mCachePath; - settings.accept_language_list = mHostLanguage; - settings.user_agent_substring = mLLCEFLib->makeCompatibleUserAgentString(mUserAgentSubtring); + settings.cookie_store_path = mCookiePath; + settings.cookies_enabled = mCookiesEnabled; + settings.flash_enabled = mPluginsEnabled; + settings.flip_mouse_y = false; + settings.flip_pixels_y = true; + settings.frame_rate = 60; + settings.initial_height = 1024; + settings.initial_width = 1024; + settings.java_enabled = false; + settings.javascript_enabled = mJavascriptEnabled; + settings.media_stream_enabled = false; // MAINT-6060 - WebRTC media removed until we can add granualrity/query UI + settings.plugins_enabled = mPluginsEnabled; + settings.user_agent_substring = mCEFLib->makeCompatibleUserAgentString(mUserAgentSubtring); + settings.webgl_enabled = true; - bool result = mLLCEFLib->init(settings); + bool result = mCEFLib->init(settings); if (!result) { // if this fails, the media system in viewer will put up a message } + // now we can set page zoom factor + mCEFLib->setPageZoom(message_in.getValueReal("factor")); + // Plugin gets to decide the texture parameters to use. mDepth = 4; LLPluginMessage message(LLPLUGIN_MESSAGE_CLASS_MEDIA, "texture_params"); @@ -560,7 +563,7 @@ void MediaPluginCEF::receiveMessage(const char* message_string) }; }; - mLLCEFLib->setSize(mWidth, mHeight); + mCEFLib->setSize(mWidth, mHeight); LLPluginMessage message(LLPLUGIN_MESSAGE_CLASS_MEDIA, "size_change_response"); message.setValue("name", name); @@ -578,7 +581,7 @@ void MediaPluginCEF::receiveMessage(const char* message_string) else if (message_name == "load_uri") { std::string uri = message_in.getValue("uri"); - mLLCEFLib->navigate(uri); + mCEFLib->navigate(uri); } else if (message_name == "set_cookie") { @@ -589,7 +592,7 @@ void MediaPluginCEF::receiveMessage(const char* message_string) std::string path = message_in.getValue("path"); bool httponly = message_in.getValueBoolean("httponly"); bool secure = message_in.getValueBoolean("secure"); - mLLCEFLib->setCookie(uri, name, value, domain, path, httponly, secure); + mCEFLib->setCookie(uri, name, value, domain, path, httponly, secure); } else if (message_name == "mouse_event") { @@ -598,18 +601,16 @@ void MediaPluginCEF::receiveMessage(const char* message_string) S32 x = message_in.getValueS32("x"); S32 y = message_in.getValueS32("y"); - y = mHeight - y; - - // only even send left mouse button events to LLCEFLib + // only even send left mouse button events to the CEF library // (partially prompted by crash in OS X CEF when sending right button events) // we catch the right click in viewer and display our own context menu anyway S32 button = message_in.getValueS32("button"); - LLCEFLib::EMouseButton btn = LLCEFLib::MB_MOUSE_BUTTON_LEFT; + dullahan::EMouseButton btn = dullahan::MB_MOUSE_BUTTON_LEFT; if (event == "down" && button == 0) { - mLLCEFLib->mouseButton(btn, LLCEFLib::ME_MOUSE_DOWN, x, y); - mLLCEFLib->setFocus(true); + mCEFLib->mouseButton(btn, dullahan::ME_MOUSE_DOWN, x, y); + mCEFLib->setFocus(); std::stringstream str; str << "Mouse down at = " << x << ", " << y; @@ -617,7 +618,7 @@ void MediaPluginCEF::receiveMessage(const char* message_string) } else if (event == "up" && button == 0) { - mLLCEFLib->mouseButton(btn, LLCEFLib::ME_MOUSE_UP, x, y); + mCEFLib->mouseButton(btn, dullahan::ME_MOUSE_UP, x, y); std::stringstream str; str << "Mouse up at = " << x << ", " << y; @@ -625,11 +626,11 @@ void MediaPluginCEF::receiveMessage(const char* message_string) } else if (event == "double_click") { - mLLCEFLib->mouseButton(btn, LLCEFLib::ME_MOUSE_DOUBLE_CLICK, x, y); + mCEFLib->mouseButton(btn, dullahan::ME_MOUSE_DOUBLE_CLICK, x, y); } else { - mLLCEFLib->mouseMove(x, y); + mCEFLib->mouseMove(x, y); } } else if (message_name == "scroll_event") @@ -639,68 +640,47 @@ void MediaPluginCEF::receiveMessage(const char* message_string) const int scaling_factor = 40; y *= -scaling_factor; - mLLCEFLib->mouseWheel(x, y); + mCEFLib->mouseWheel(x, y); } else if (message_name == "text_event") { - std::string text = message_in.getValue("text"); - std::string modifiers = message_in.getValue("modifiers"); LLSD native_key_data = message_in.getValueLLSD("native_key_data"); - - unicodeInput(text, decodeModifiers(modifiers), native_key_data); + unicodeInput(native_key_data); } else if (message_name == "key_event") { #if LL_DARWIN std::string event = message_in.getValue("event"); - S32 key = message_in.getValueS32("key"); LLSD native_key_data = message_in.getValueLLSD("native_key_data"); -#if 0 - if (event == "down") - { - //mLLCEFLib->keyPress(key, true); - mLLCEFLib->keyboardEvent(LLCEFLib::KE_KEY_DOWN, (uint32_t)key, 0, LLCEFLib::KM_MODIFIER_NONE, 0, 0, 0); - - } - else if (event == "up") - { - //mLLCEFLib->keyPress(key, false); - mLLCEFLib->keyboardEvent(LLCEFLib::KE_KEY_UP, (uint32_t)key, 0, LLCEFLib::KM_MODIFIER_NONE, 0, 0, 0); - } -#else - // Treat unknown events as key-up for safety. - LLCEFLib::EKeyEvent key_event = LLCEFLib::KE_KEY_UP; + dullahan::EKeyEvent key_event = dullahan::KE_KEY_UP; if (event == "down") { - key_event = LLCEFLib::KE_KEY_DOWN; + key_event = dullahan::KE_KEY_DOWN; } else if (event == "repeat") { - key_event = LLCEFLib::KE_KEY_REPEAT; + key_event = dullahan::KE_KEY_REPEAT; } - keyEvent(key_event, key, LLCEFLib::KM_MODIFIER_NONE, native_key_data); + keyEvent(key_event, native_key_data); -#endif #elif LL_WINDOWS std::string event = message_in.getValue("event"); - S32 key = message_in.getValueS32("key"); - std::string modifiers = message_in.getValue("modifiers"); LLSD native_key_data = message_in.getValueLLSD("native_key_data"); // Treat unknown events as key-up for safety. - LLCEFLib::EKeyEvent key_event = LLCEFLib::KE_KEY_UP; + dullahan::EKeyEvent key_event = dullahan::KE_KEY_UP; if (event == "down") { - key_event = LLCEFLib::KE_KEY_DOWN; + key_event = dullahan::KE_KEY_DOWN; } else if (event == "repeat") { - key_event = LLCEFLib::KE_KEY_REPEAT; + key_event = dullahan::KE_KEY_REPEAT; } - keyEvent(key_event, key, decodeModifiers(modifiers), native_key_data); + keyEvent(key_event, native_key_data); #endif } else if (message_name == "enable_media_plugin_debugging") @@ -717,15 +697,15 @@ void MediaPluginCEF::receiveMessage(const char* message_string) } if (message_name == "edit_cut") { - mLLCEFLib->editCut(); + mCEFLib->editCut(); } if (message_name == "edit_copy") { - mLLCEFLib->editCopy(); + mCEFLib->editCopy(); } if (message_name == "edit_paste") { - mLLCEFLib->editPaste(); + mCEFLib->editPaste(); } } else if (message_class == LLPLUGIN_MESSAGE_CLASS_MEDIA_BROWSER) @@ -733,24 +713,24 @@ void MediaPluginCEF::receiveMessage(const char* message_string) if (message_name == "set_page_zoom_factor") { F32 factor = (F32)message_in.getValueReal("factor"); - mLLCEFLib->setPageZoom(factor); + mCEFLib->setPageZoom(factor); } if (message_name == "browse_stop") { - mLLCEFLib->stop(); + mCEFLib->stop(); } else if (message_name == "browse_reload") { bool ignore_cache = true; - mLLCEFLib->reload(ignore_cache); + mCEFLib->reload(ignore_cache); } else if (message_name == "browse_forward") { - mLLCEFLib->goForward(); + mCEFLib->goForward(); } else if (message_name == "browse_back") { - mLLCEFLib->goBack(); + mCEFLib->goBack(); } else if (message_name == "cookies_enabled") { @@ -762,7 +742,7 @@ void MediaPluginCEF::receiveMessage(const char* message_string) } else if (message_name == "show_web_inspector") { - mLLCEFLib->showDevTools(true); + mCEFLib->showDevTools(); } else if (message_name == "plugins_enabled") { @@ -787,100 +767,39 @@ void MediaPluginCEF::receiveMessage(const char* message_string) } } -LLCEFLib::EKeyboardModifier MediaPluginCEF::decodeModifiers(std::string &modifiers) -{ - int result = 0; - - if (modifiers.find("shift") != std::string::npos) - result |= LLCEFLib::KM_MODIFIER_SHIFT; - - if (modifiers.find("alt") != std::string::npos) - result |= LLCEFLib::KM_MODIFIER_ALT; - - if (modifiers.find("control") != std::string::npos) - result |= LLCEFLib::KM_MODIFIER_CONTROL; - - if (modifiers.find("meta") != std::string::npos) - result |= LLCEFLib::KM_MODIFIER_META; - - return (LLCEFLib::EKeyboardModifier)result; -} - //////////////////////////////////////////////////////////////////////////////// // -void MediaPluginCEF::deserializeKeyboardData(LLSD native_key_data, uint32_t& native_scan_code, uint32_t& native_virtual_key, uint32_t& native_modifiers) +void MediaPluginCEF::keyEvent(dullahan::EKeyEvent key_event, LLSD native_key_data = LLSD::emptyMap()) { - native_scan_code = 0; - native_virtual_key = 0; - native_modifiers = 0; - - if (native_key_data.isMap()) - { #if LL_DARWIN - native_scan_code = (uint32_t)(native_key_data["char_code"].asInteger()); - native_virtual_key = (uint32_t)(native_key_data["key_code"].asInteger()); - native_modifiers = (uint32_t)(native_key_data["modifiers"].asInteger()); -#elif LL_WINDOWS - native_scan_code = (uint32_t)(native_key_data["scan_code"].asInteger()); - native_virtual_key = (uint32_t)(native_key_data["virtual_key"].asInteger()); - // TODO: I don't think we need to do anything with native modifiers here -- please verify -#endif - }; -}; - -//////////////////////////////////////////////////////////////////////////////// -// -void MediaPluginCEF::keyEvent(LLCEFLib::EKeyEvent key_event, int key, LLCEFLib::EKeyboardModifier modifiers_x, LLSD native_key_data = LLSD::emptyMap()) -{ -#if LL_DARWIN - - if (!native_key_data.has("event_type") || - !native_key_data.has("event_modifiers") || - !native_key_data.has("event_keycode") || - !native_key_data.has("event_isrepeat")) - return; - - uint32_t eventType = native_key_data["event_type"].asInteger(); - if (!eventType) - return; - uint32_t eventModifiers = native_key_data["event_modifiers"].asInteger(); - uint32_t eventKeycode = native_key_data["event_keycode"].asInteger(); - char eventChars = static_cast<char>(native_key_data["event_chars"].isUndefined() ? 0 : native_key_data["event_chars"].asInteger()); - char eventUChars = static_cast<char>(native_key_data["event_umodchars"].isUndefined() ? 0 : native_key_data["event_umodchars"].asInteger()); - bool eventIsRepeat = native_key_data["event_isrepeat"].asBoolean(); - - mLLCEFLib->keyboardEventOSX(eventType, eventModifiers, (eventChars) ? &eventChars : NULL, - (eventUChars) ? &eventUChars : NULL, eventIsRepeat, eventKeycode); - + U32 event_modifiers = native_key_data["event_modifiers"].asInteger(); + U32 event_keycode = native_key_data["event_keycode"].asInteger(); + U32 event_chars = native_key_data["event_chars"].asInteger(); + U32 event_umodchars = native_key_data["event_umodchars"].asInteger(); + bool event_isrepeat = native_key_data["event_isrepeat"].asBoolean(); + + mCEFLib->nativeKeyboardEventOSX(key_event, event_modifiers, + event_keycode, event_chars, + event_umodchars, event_isrepeat); #elif LL_WINDOWS U32 msg = ll_U32_from_sd(native_key_data["msg"]); U32 wparam = ll_U32_from_sd(native_key_data["w_param"]); U64 lparam = ll_U32_from_sd(native_key_data["l_param"]); - mLLCEFLib->nativeKeyboardEvent(msg, wparam, lparam); + mCEFLib->nativeKeyboardEventWin(msg, wparam, lparam); #endif }; -void MediaPluginCEF::unicodeInput(const std::string &utf8str, LLCEFLib::EKeyboardModifier modifiers, LLSD native_key_data = LLSD::emptyMap()) +void MediaPluginCEF::unicodeInput(LLSD native_key_data = LLSD::emptyMap()) { #if LL_DARWIN - //mLLCEFLib->keyPress(utf8str[0], true); - //mLLCEFLib->keyboardEvent(LLCEFLib::KE_KEY_DOWN, (uint32_t)(utf8str[0]), 0, LLCEFLib::KM_MODIFIER_NONE, 0, 0, 0); - if (!native_key_data.has("event_chars") || !native_key_data.has("event_umodchars") || - !native_key_data.has("event_keycode") || !native_key_data.has("event_modifiers")) - return; - uint32_t unicodeChar = native_key_data["event_chars"].asInteger(); - uint32_t unmodifiedChar = native_key_data["event_umodchars"].asInteger(); - uint32_t keyCode = native_key_data["event_keycode"].asInteger(); - uint32_t rawmodifiers = native_key_data["event_modifiers"].asInteger(); - - mLLCEFLib->injectUnicodeText(unicodeChar, unmodifiedChar, keyCode, rawmodifiers); - + // code to send keys here doesn't seem to be required for Darwin - in fact, + // not having reliable key event type info here means we don't know what to send anyway #elif LL_WINDOWS U32 msg = ll_U32_from_sd(native_key_data["msg"]); U32 wparam = ll_U32_from_sd(native_key_data["w_param"]); U64 lparam = ll_U32_from_sd(native_key_data["l_param"]); - mLLCEFLib->nativeKeyboardEvent(msg, wparam, lparam); + mCEFLib->nativeKeyboardEventWin(msg, wparam, lparam); #endif }; @@ -888,9 +807,9 @@ void MediaPluginCEF::unicodeInput(const std::string &utf8str, LLCEFLib::EKeyboar // void MediaPluginCEF::checkEditState() { - bool can_cut = mLLCEFLib->editCanCut(); - bool can_copy = mLLCEFLib->editCanCopy(); - bool can_paste = mLLCEFLib->editCanPaste(); + bool can_cut = mCEFLib->editCanCut(); + bool can_copy = mCEFLib->editCanCopy(); + bool can_paste = mCEFLib->editCanPaste(); if ((can_cut != mCanCut) || (can_copy != mCanCopy) || (can_paste != mCanPaste)) { @@ -920,7 +839,6 @@ void MediaPluginCEF::checkEditState() void MediaPluginCEF::setVolume(F32 vol) { - mVolumeCatcher.setVolume(vol); } //////////////////////////////////////////////////////////////////////////////// diff --git a/indra/media_plugins/cef/windows_volume_catcher.cpp b/indra/media_plugins/cef/windows_volume_catcher.cpp index c9ea3ed597..6953ad3ab8 100644 --- a/indra/media_plugins/cef/windows_volume_catcher.cpp +++ b/indra/media_plugins/cef/windows_volume_catcher.cpp @@ -41,44 +41,15 @@ public: void setPan(F32 pan); private: - typedef void (WINAPI *set_volume_func_t)(F32); - typedef void (WINAPI *set_mute_func_t)(bool); - - set_volume_func_t mSetVolumeFunc; - set_mute_func_t mSetMuteFunc; - - // tests if running on Vista, 7, 8 + once in CTOR - bool isWindowsVistaOrHigher(); - F32 mVolume; F32 mPan; bool mSystemIsVistaOrHigher; }; -bool VolumeCatcherImpl::isWindowsVistaOrHigher() -{ - OSVERSIONINFO osvi; - ZeroMemory(&osvi, sizeof(OSVERSIONINFO)); - osvi.dwOSVersionInfoSize = sizeof(OSVERSIONINFO); - GetVersionEx(&osvi); - return osvi.dwMajorVersion >= 6; -} - VolumeCatcherImpl::VolumeCatcherImpl() : mVolume(1.0f), // default volume is max mPan(0.f) // default pan is centered { - mSystemIsVistaOrHigher = isWindowsVistaOrHigher(); - - if ( ! mSystemIsVistaOrHigher ) - { - HMODULE handle = ::LoadLibrary(L"winmm.dll"); - if(handle) - { - mSetVolumeFunc = (set_volume_func_t)::GetProcAddress(handle, "setPluginVolume"); - mSetMuteFunc = (set_mute_func_t)::GetProcAddress(handle, "setPluginMute"); - } - } } VolumeCatcherImpl::~VolumeCatcherImpl() @@ -89,26 +60,12 @@ void VolumeCatcherImpl::setVolume(F32 volume) { mVolume = volume; - if ( mSystemIsVistaOrHigher ) - { - // set both left/right to same volume - // TODO: use pan value to set independently - DWORD left_channel = (DWORD)(mVolume * 65535.0f); - DWORD right_channel = (DWORD)(mVolume * 65535.0f); - DWORD hw_volume = left_channel << 16 | right_channel; - ::waveOutSetVolume(NULL, hw_volume); - } - else - { - if (mSetMuteFunc) - { - mSetMuteFunc(volume == 0.f); - } - if (mSetVolumeFunc) - { - mSetVolumeFunc(mVolume); - } - } + // set both left/right to same volume + // TODO: use pan value to set independently + DWORD left_channel = (DWORD)(mVolume * 65535.0f); + DWORD right_channel = (DWORD)(mVolume * 65535.0f); + DWORD hw_volume = left_channel << 16 | right_channel; + ::waveOutSetVolume(NULL, hw_volume); } void VolumeCatcherImpl::setPan(F32 pan) diff --git a/indra/media_plugins/example/CMakeLists.txt b/indra/media_plugins/example/CMakeLists.txt index 171645ef04..d2a17b1d76 100644 --- a/indra/media_plugins/example/CMakeLists.txt +++ b/indra/media_plugins/example/CMakeLists.txt @@ -32,13 +32,13 @@ include_directories(SYSTEM ### media_plugin_example -if(NOT WORD_SIZE EQUAL 32) +if(NOT ADDRESS_SIZE EQUAL 32) if(WINDOWS) - add_definitions(/FIXED:NO) + ##add_definitions(/FIXED:NO) else(WINDOWS) # not windows therefore gcc LINUX and DARWIN add_definitions(-fPIC) endif(WINDOWS) -endif(NOT WORD_SIZE EQUAL 32) +endif(NOT ADDRESS_SIZE EQUAL 32) set(media_plugin_example_SOURCE_FILES media_plugin_example.cpp diff --git a/indra/media_plugins/gstreamer010/CMakeLists.txt b/indra/media_plugins/gstreamer010/CMakeLists.txt index 447f6e0689..6d18814b1e 100644 --- a/indra/media_plugins/gstreamer010/CMakeLists.txt +++ b/indra/media_plugins/gstreamer010/CMakeLists.txt @@ -33,13 +33,13 @@ include_directories(SYSTEM ### media_plugin_gstreamer010 -if(NOT WORD_SIZE EQUAL 32) +if(NOT ADDRESS_SIZE EQUAL 32) if(WINDOWS) - add_definitions(/FIXED:NO) + ##add_definitions(/FIXED:NO) else(WINDOWS) # not windows therefore gcc LINUX and DARWIN add_definitions(-fPIC) endif(WINDOWS) -endif(NOT WORD_SIZE EQUAL 32) +endif(NOT ADDRESS_SIZE EQUAL 32) set(media_plugin_gstreamer010_SOURCE_FILES media_plugin_gstreamer010.cpp diff --git a/indra/media_plugins/libvlc/CMakeLists.txt b/indra/media_plugins/libvlc/CMakeLists.txt index 535d29125b..d3e9243069 100644 --- a/indra/media_plugins/libvlc/CMakeLists.txt +++ b/indra/media_plugins/libvlc/CMakeLists.txt @@ -33,13 +33,13 @@ include_directories(SYSTEM ### media_plugin_libvlc -if(NOT WORD_SIZE EQUAL 32) +if(NOT ADDRESS_SIZE EQUAL 32) if(WINDOWS) - add_definitions(/FIXED:NO) + ##add_definitions(/FIXED:NO) else(WINDOWS) # not windows therefore gcc LINUX and DARWIN add_definitions(-fPIC) endif(WINDOWS) -endif(NOT WORD_SIZE EQUAL 32) +endif(NOT ADDRESS_SIZE EQUAL 32) set(media_plugin_libvlc_SOURCE_FILES media_plugin_libvlc.cpp @@ -61,14 +61,24 @@ target_link_libraries(media_plugin_libvlc add_dependencies(media_plugin_libvlc ${LLPLUGIN_LIBRARIES} ${MEDIA_PLUGIN_BASE_LIBRARIES} - ${LLCOMMON_LIBRARIES} +##${LLCOMMON_LIBRARIES} + # Just say 'llcommon' here. LLCOMMON_LIBRARIES is specified for use in + # target_link_libraries: it includes several Boost libraries, which are + # absolutely NOT dependencies in the sense intended here. Those Boost + # library macros, in turn, specify 'debug' and 'optimized' and a different + # library name for each, producing several wordy errors: + # Policy CMP0046 is not set: Error on non-existent dependency in + # add_dependencies. + # Really, the only dependency we should mention from LLCOMMON_LIBRARIES is + # llcommon itself. + llcommon ) if (WINDOWS) set_target_properties( media_plugin_libvlc PROPERTIES - LINK_FLAGS "/MANIFEST:NO /SAFESEH:NO /LTCG /NODEFAULTLIB:LIBCMT" + LINK_FLAGS "/MANIFEST:NO /SAFESEH:NO /NODEFAULTLIB:LIBCMT" ) endif (WINDOWS) diff --git a/indra/media_plugins/libvlc/media_plugin_libvlc.cpp b/indra/media_plugins/libvlc/media_plugin_libvlc.cpp index ebcdde2960..048e7675f8 100644 --- a/indra/media_plugins/libvlc/media_plugin_libvlc.cpp +++ b/indra/media_plugins/libvlc/media_plugin_libvlc.cpp @@ -161,6 +161,10 @@ void MediaPluginLibVLC::initVLC() "--video-filter=transform{type=vflip}", // MAINT-6578 Y flip textures in plugin vs client }; +#if LL_DARWIN + setenv("VLC_PLUGIN_PATH", ".", 1); +#endif + int vlc_argc = sizeof(vlc_argv) / sizeof(*vlc_argv); mLibVLC = libvlc_new(vlc_argc, vlc_argv); diff --git a/indra/media_plugins/quicktime/CMakeLists.txt b/indra/media_plugins/quicktime/CMakeLists.txt deleted file mode 100755 index 58391007ff..0000000000 --- a/indra/media_plugins/quicktime/CMakeLists.txt +++ /dev/null @@ -1,94 +0,0 @@ -# -*- cmake -*- - -project(media_plugin_quicktime) - -include(00-Common) -include(LLCommon) -include(LLImage) -include(LLPlugin) -include(LLMath) -include(LLRender) -include(LLWindow) -include(Linking) -include(PluginAPI) -include(MediaPluginBase) -include(OpenGL) -include(QuickTimePlugin) - -include_directories( - ${LLPLUGIN_INCLUDE_DIRS} - ${MEDIA_PLUGIN_BASE_INCLUDE_DIRS} - ${LLCOMMON_INCLUDE_DIRS} - ${LLMATH_INCLUDE_DIRS} - ${LLIMAGE_INCLUDE_DIRS} - ${LLRENDER_INCLUDE_DIRS} - ${LLWINDOW_INCLUDE_DIRS} -) -include_directories(SYSTEM - ${LLCOMMON_SYSTEM_INCLUDE_DIRS} - ) - -if (DARWIN) - include(CMakeFindFrameworks) - find_library(CARBON_LIBRARY Carbon) -endif (DARWIN) - - -### media_plugin_quicktime - -set(media_plugin_quicktime_SOURCE_FILES - media_plugin_quicktime.cpp - ) - -add_library(media_plugin_quicktime - SHARED - ${media_plugin_quicktime_SOURCE_FILES} -) - -target_link_libraries(media_plugin_quicktime - ${LLPLUGIN_LIBRARIES} - ${MEDIA_PLUGIN_BASE_LIBRARIES} - ${LLCOMMON_LIBRARIES} - ${QUICKTIME_LIBRARY} - ${PLUGIN_API_WINDOWS_LIBRARIES} -) - -add_dependencies(media_plugin_quicktime - ${LLPLUGIN_LIBRARIES} - ${MEDIA_PLUGIN_BASE_LIBRARIES} - ${LLCOMMON_LIBRARIES} -) - -if (WINDOWS) - set_target_properties( - media_plugin_quicktime - PROPERTIES - LINK_FLAGS "/MANIFEST:NO" - ) -endif (WINDOWS) - -if (QUICKTIME) - - add_definitions(-DLL_QUICKTIME_ENABLED=1) - - if (DARWIN) - # Don't prepend 'lib' to the executable name, and don't embed a full path in the library's install name - set_target_properties( - media_plugin_quicktime - PROPERTIES - PREFIX "" - BUILD_WITH_INSTALL_RPATH 1 - INSTALL_NAME_DIR "@executable_path" - LINK_FLAGS "-exported_symbols_list ${CMAKE_CURRENT_SOURCE_DIR}/../base/media_plugin_base.exp" - ) - -# We use a bunch of deprecated system APIs. - set_source_files_properties( - media_plugin_quicktime.cpp PROPERTIES - COMPILE_FLAGS -Wno-deprecated-declarations - ) - find_library(CARBON_LIBRARY Carbon) - target_link_libraries(media_plugin_quicktime ${CARBON_LIBRARY}) - endif (DARWIN) -endif (QUICKTIME) - diff --git a/indra/media_plugins/quicktime/media_plugin_quicktime.cpp b/indra/media_plugins/quicktime/media_plugin_quicktime.cpp deleted file mode 100755 index b43598e4a5..0000000000 --- a/indra/media_plugins/quicktime/media_plugin_quicktime.cpp +++ /dev/null @@ -1,1085 +0,0 @@ -/** - * @file media_plugin_quicktime.cpp - * @brief QuickTime plugin for LLMedia API plugin system - * - * @cond - * $LicenseInfo:firstyear=2008&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$ - * @endcond - */ - -#include "linden_common.h" - -#include "llgl.h" - -#include "llplugininstance.h" -#include "llpluginmessage.h" -#include "llpluginmessageclasses.h" -#include "media_plugin_base.h" - -#if LL_QUICKTIME_ENABLED - -#if defined(LL_DARWIN) -#include <QuickTime/QuickTime.h> -#elif defined(LL_WINDOWS) -#include "llwin32headers.h" -#include "MacTypes.h" -#include "QTML.h" -#include "Movies.h" -#include "QDoffscreen.h" -#include "FixMath.h" -#include "QTLoadLibraryUtils.h" -#endif - - - -// TODO: Make sure that the only symbol exported from this library is LLPluginInitEntryPoint -//////////////////////////////////////////////////////////////////////////////// -// -class MediaPluginQuickTime : public MediaPluginBase -{ -public: - MediaPluginQuickTime(LLPluginInstance::sendMessageFunction host_send_func, void *host_user_data); - ~MediaPluginQuickTime(); - - /* virtual */ void receiveMessage(const char *message_string); - -private: - - int mNaturalWidth; - int mNaturalHeight; - Movie mMovieHandle; - GWorldPtr mGWorldHandle; - ComponentInstance mMovieController; - int mCurVolume; - bool mMediaSizeChanging; - bool mIsLooping; - std::string mMovieTitle; - bool mReceivedTitle; - const int mMinWidth; - const int mMaxWidth; - const int mMinHeight; - const int mMaxHeight; - F64 mPlayRate; - std::string mNavigateURL; - - enum ECommand { - COMMAND_NONE, - COMMAND_STOP, - COMMAND_PLAY, - COMMAND_FAST_FORWARD, - COMMAND_FAST_REWIND, - COMMAND_PAUSE, - COMMAND_SEEK, - }; - ECommand mCommand; - - // Override this to add current time and duration to the message - /*virtual*/ void setDirty(int left, int top, int right, int bottom) - { - LLPluginMessage message(LLPLUGIN_MESSAGE_CLASS_MEDIA, "updated"); - - message.setValueS32("left", left); - message.setValueS32("top", top); - message.setValueS32("right", right); - message.setValueS32("bottom", bottom); - - if(mMovieHandle) - { - message.setValueReal("current_time", getCurrentTime()); - message.setValueReal("duration", getDuration()); - message.setValueReal("current_rate", Fix2X(GetMovieRate(mMovieHandle))); - } - - sendMessage(message); - } - - - static Rect rectFromSize(int width, int height) - { - Rect result; - - - result.left = 0; - result.top = 0; - result.right = width; - result.bottom = height; - - return result; - } - - Fixed getPlayRate(void) - { - Fixed result; - if(mPlayRate == 0.0f) - { - // Default to the movie's preferred rate - result = GetMoviePreferredRate(mMovieHandle); - if(result == 0) - { - // Don't return a 0 play rate, ever. - std::cerr << "Movie's preferred rate is 0, forcing to 1.0." << std::endl; - result = X2Fix(1.0f); - } - } - else - { - result = X2Fix(mPlayRate); - } - - return result; - } - - void load( const std::string url ) - { - - if ( url.empty() ) - return; - - // Stop and unload any existing movie before starting another one. - unload(); - - setStatus(STATUS_LOADING); - - //In case std::string::c_str() makes a copy of the url data, - //make sure there is memory to hold it before allocating memory for handle. - //if fails, NewHandleClear(...) should return NULL. - const char* url_string = url.c_str() ; - Handle handle = NewHandleClear( ( Size )( url.length() + 1 ) ); - - if ( NULL == handle || noErr != MemError() || NULL == *handle ) - { - setStatus(STATUS_ERROR); - return; - } - - BlockMove( url_string, *handle, ( Size )( url.length() + 1 ) ); - - OSErr err = NewMovieFromDataRef( &mMovieHandle, newMovieActive | newMovieDontInteractWithUser | newMovieAsyncOK | newMovieIdleImportOK, nil, handle, URLDataHandlerSubType ); - DisposeHandle( handle ); - if ( noErr != err ) - { - setStatus(STATUS_ERROR); - return; - }; - - mNavigateURL = url; - LLPluginMessage message(LLPLUGIN_MESSAGE_CLASS_MEDIA_BROWSER, "navigate_begin"); - message.setValue("uri", mNavigateURL); - sendMessage(message); - - // do pre-roll actions (typically fired for streaming movies but not always) - PrePrerollMovie( mMovieHandle, 0, getPlayRate(), moviePrePrerollCompleteCallback, ( void * )this ); - - Rect movie_rect = rectFromSize(mWidth, mHeight); - - // make a new movie controller - mMovieController = NewMovieController( mMovieHandle, &movie_rect, mcNotVisible | mcTopLeftMovie ); - - // movie controller - MCSetActionFilterWithRefCon( mMovieController, mcActionFilterCallBack, ( long )this ); - - SetMoviePlayHints( mMovieHandle, hintsAllowDynamicResize, hintsAllowDynamicResize ); - - // function that gets called when a frame is drawn - SetMovieDrawingCompleteProc( mMovieHandle, movieDrawingCallWhenChanged, movieDrawingCompleteCallback, ( long )this ); - - setStatus(STATUS_LOADED); - - sizeChanged(); - }; - - bool unload() - { - // new movie and have to get title again - mReceivedTitle = false; - - if ( mMovieHandle ) - { - StopMovie( mMovieHandle ); - if ( mMovieController ) - { - MCMovieChanged( mMovieController, mMovieHandle ); - }; - }; - - if ( mMovieController ) - { - MCSetActionFilterWithRefCon( mMovieController, NULL, (long)this ); - DisposeMovieController( mMovieController ); - mMovieController = NULL; - }; - - if ( mMovieHandle ) - { - SetMovieDrawingCompleteProc( mMovieHandle, movieDrawingCallWhenChanged, nil, ( long )this ); - DisposeMovie( mMovieHandle ); - mMovieHandle = NULL; - }; - - mGWorldHandle = NULL; - - setStatus(STATUS_NONE); - - return true; - } - - bool navigateTo( const std::string url ) - { - unload(); - load( url ); - - return true; - }; - - bool sizeChanged() - { - if ( ! mMovieHandle ) - return false; - - // Check to see whether the movie's natural size has updated - { - int width, height; - getMovieNaturalSize(&width, &height); - if((width != 0) && (height != 0) && ((width != mNaturalWidth) || (height != mNaturalHeight))) - { - mNaturalWidth = width; - mNaturalHeight = height; - - LLPluginMessage message(LLPLUGIN_MESSAGE_CLASS_MEDIA, "size_change_request"); - message.setValue("name", mTextureSegmentName); - message.setValueS32("width", width); - message.setValueS32("height", height); - sendMessage(message); - //std::cerr << "<--- Sending size change request to application with name: " << mTextureSegmentName << " - size is " << width << " x " << height << std::endl; - } - } - - - // sanitize destination size - Rect dest_rect = rectFromSize(mWidth, mHeight); - - // media depth won't change - int depth_bits = mDepth * 8; - long rowbytes = mDepth * mTextureWidth; - - if(mPixels != NULL) - { - // We have pixels. Set up a GWorld pointing at the texture. - OSErr result = QTNewGWorldFromPtr( &mGWorldHandle, depth_bits, &dest_rect, NULL, NULL, 0, (Ptr)mPixels, rowbytes); - if ( noErr != result ) - { - // TODO: unrecoverable?? throw exception? return something? - return false; - } - } - else - { - // We don't have pixels. Create a fake GWorld we can point the movie at when it's not safe to render normally. - Rect tempRect = rectFromSize(1, 1); - OSErr result = QTNewGWorld( &mGWorldHandle, depth_bits, &tempRect, NULL, NULL, 0); - if ( noErr != result ) - { - // TODO: unrecoverable?? throw exception? return something? - return false; - } - } - - SetMovieGWorld( mMovieHandle, mGWorldHandle, NULL ); - - // Set up the movie display matrix - { - // scale movie to fit rect and invert vertically to match opengl image format - MatrixRecord transform; - SetIdentityMatrix( &transform ); // transforms are additive so start from identify matrix - double scaleX = (double) mWidth / mNaturalWidth; - double scaleY = -1.0 * (double) mHeight / mNaturalHeight; - double centerX = mWidth / 2.0; - double centerY = mHeight / 2.0; - ScaleMatrix( &transform, X2Fix( scaleX ), X2Fix( scaleY ), X2Fix( centerX ), X2Fix( centerY ) ); - SetMovieMatrix( mMovieHandle, &transform ); - } - - // update movie controller - if ( mMovieController ) - { - MCSetControllerPort( mMovieController, mGWorldHandle ); - MCPositionController( mMovieController, &dest_rect, &dest_rect, - mcTopLeftMovie | mcPositionDontInvalidate ); - MCMovieChanged( mMovieController, mMovieHandle ); - } - - - // Emit event with size change so the calling app knows about it too - // TODO: - //LLMediaEvent event( this ); - //mEventEmitter.update( &LLMediaObserver::onMediaSizeChange, event ); - - return true; - } - static Boolean mcActionFilterCallBack( MovieController mc, short action, void *params, long ref ) - { - Boolean result = false; - - MediaPluginQuickTime* self = ( MediaPluginQuickTime* )ref; - - switch( action ) - { - // handle window resizing - case mcActionControllerSizeChanged: - // Ensure that the movie draws correctly at the new size - self->sizeChanged(); - break; - - // Block any movie controller actions that open URLs. - case mcActionLinkToURL: - case mcActionGetNextURL: - case mcActionLinkToURLExtended: - // Prevent the movie controller from handling the message - result = true; - break; - - default: - break; - }; - - return result; - }; - - static OSErr movieDrawingCompleteCallback( Movie call_back_movie, long ref ) - { - MediaPluginQuickTime* self = ( MediaPluginQuickTime* )ref; - - // IMPORTANT: typically, a consumer who is observing this event will set a flag - // when this event is fired then render later. Be aware that the media stream - // can change during this period - dimensions, depth, format etc. - //LLMediaEvent event( self ); -// self->updateQuickTime(); - // TODO ^^^ - - - if ( self->mWidth > 0 && self->mHeight > 0 ) - self->setDirty( 0, 0, self->mWidth, self->mHeight ); - - return noErr; - }; - - static void moviePrePrerollCompleteCallback( Movie movie, OSErr preroll_err, void *ref ) - { - MediaPluginQuickTime* self = ( MediaPluginQuickTime* )ref; - - // TODO: - //LLMediaEvent event( self ); - //self->mEventEmitter.update( &LLMediaObserver::onMediaPreroll, event ); - - // Send a "navigate complete" event. - LLPluginMessage message(LLPLUGIN_MESSAGE_CLASS_MEDIA_BROWSER, "navigate_complete"); - message.setValue("uri", self->mNavigateURL); - message.setValueS32("result_code", 200); - message.setValue("result_string", "OK"); - self->sendMessage(message); - }; - - - void rewind() - { - GoToBeginningOfMovie( mMovieHandle ); - MCMovieChanged( mMovieController, mMovieHandle ); - }; - - bool processState() - { - if ( mCommand == COMMAND_PLAY ) - { - if ( mStatus == STATUS_LOADED || mStatus == STATUS_PAUSED || mStatus == STATUS_PLAYING || mStatus == STATUS_DONE ) - { - long state = GetMovieLoadState( mMovieHandle ); - - if ( state >= kMovieLoadStatePlaythroughOK ) - { - // if the movie is at the end (generally because it reached it naturally) - // and we play is requested, jump back to the start of the movie. - // note: this is different from having loop flag set. - if ( IsMovieDone( mMovieHandle ) ) - { - Fixed rate = X2Fix( 0.0 ); - MCDoAction( mMovieController, mcActionPlay, (void*)rate ); - rewind(); - }; - - MCDoAction( mMovieController, mcActionPrerollAndPlay, (void*)getPlayRate() ); - MCDoAction( mMovieController, mcActionSetVolume, (void*)mCurVolume ); - setStatus(STATUS_PLAYING); - mCommand = COMMAND_NONE; - }; - }; - } - else - if ( mCommand == COMMAND_STOP ) - { - if ( mStatus == STATUS_PLAYING || mStatus == STATUS_PAUSED || mStatus == STATUS_DONE ) - { - if ( GetMovieLoadState( mMovieHandle ) >= kMovieLoadStatePlaythroughOK ) - { - Fixed rate = X2Fix( 0.0 ); - MCDoAction( mMovieController, mcActionPlay, (void*)rate ); - rewind(); - - setStatus(STATUS_LOADED); - mCommand = COMMAND_NONE; - }; - }; - } - else - if ( mCommand == COMMAND_PAUSE ) - { - if ( mStatus == STATUS_PLAYING ) - { - if ( GetMovieLoadState( mMovieHandle ) >= kMovieLoadStatePlaythroughOK ) - { - Fixed rate = X2Fix( 0.0 ); - MCDoAction( mMovieController, mcActionPlay, (void*)rate ); - setStatus(STATUS_PAUSED); - mCommand = COMMAND_NONE; - }; - }; - }; - - return true; - }; - - void play(F64 rate) - { - mPlayRate = rate; - mCommand = COMMAND_PLAY; - }; - - void stop() - { - mCommand = COMMAND_STOP; - }; - - void pause() - { - mCommand = COMMAND_PAUSE; - }; - - void getMovieNaturalSize(int *movie_width, int *movie_height) - { - Rect rect; - - GetMovieNaturalBoundsRect( mMovieHandle, &rect ); - - int width = ( rect.right - rect.left ); - int height = ( rect.bottom - rect.top ); - - // make sure width and height fall in valid range - if ( width < mMinWidth ) - width = mMinWidth; - - if ( width > mMaxWidth ) - width = mMaxWidth; - - if ( height < mMinHeight ) - height = mMinHeight; - - if ( height > mMaxHeight ) - height = mMaxHeight; - - // return the new rect - *movie_width = width; - *movie_height = height; - } - - void updateQuickTime(int milliseconds) - { - if ( ! mMovieHandle ) - return; - - if ( ! mMovieController ) - return; - - // this wasn't required in 1.xx viewer but we have to manually - // work the Windows message pump now - #if defined( LL_WINDOWS ) - MSG msg; - while ( PeekMessage( &msg, NULL, 0, 0, PM_NOREMOVE ) ) - { - GetMessage( &msg, NULL, 0, 0 ); - TranslateMessage( &msg ); - DispatchMessage( &msg ); - }; - #endif - - MCIdle( mMovieController ); - - if ( ! mGWorldHandle ) - return; - - if ( mMediaSizeChanging ) - return; - - // update state machine - processState(); - - // see if title arrived and if so, update member variable with contents - checkTitle(); - - // QT call to see if we are at the end - can't do with controller - if ( IsMovieDone( mMovieHandle ) ) - { - // special code for looping - need to rewind at the end of the movie - if ( mIsLooping ) - { - // go back to start - rewind(); - - if ( mMovieController ) - { - // kick off new play - MCDoAction( mMovieController, mcActionPrerollAndPlay, (void*)getPlayRate() ); - - // set the volume - MCDoAction( mMovieController, mcActionSetVolume, (void*)mCurVolume ); - }; - } - else - { - if(mStatus == STATUS_PLAYING) - { - setStatus(STATUS_DONE); - } - } - } - - }; - - void seek( F64 time ) - { - if ( mMovieController ) - { - TimeRecord when; - when.scale = GetMovieTimeScale( mMovieHandle ); - when.base = 0; - - // 'time' is in (floating point) seconds. The timebase time will be in 'units', where - // there are 'scale' units per second. - SInt64 raw_time = ( SInt64 )( time * (double)( when.scale ) ); - - when.value.hi = ( SInt32 )( raw_time >> 32 ); - when.value.lo = ( SInt32 )( ( raw_time & 0x00000000FFFFFFFF ) ); - - MCDoAction( mMovieController, mcActionGoToTime, &when ); - }; - }; - - F64 getLoadedDuration() - { - TimeValue duration; - if(GetMaxLoadedTimeInMovie( mMovieHandle, &duration ) != noErr) - { - // If GetMaxLoadedTimeInMovie returns an error, return the full duration of the movie. - duration = GetMovieDuration( mMovieHandle ); - } - TimeValue scale = GetMovieTimeScale( mMovieHandle ); - - return (F64)duration / (F64)scale; - }; - - F64 getDuration() - { - TimeValue duration = GetMovieDuration( mMovieHandle ); - TimeValue scale = GetMovieTimeScale( mMovieHandle ); - - return (F64)duration / (F64)scale; - }; - - F64 getCurrentTime() - { - TimeValue curr_time = GetMovieTime( mMovieHandle, 0 ); - TimeValue scale = GetMovieTimeScale( mMovieHandle ); - - return (F64)curr_time / (F64)scale; - }; - - void setVolume( F64 volume ) - { - mCurVolume = (short)(volume * ( double ) 0x100 ); - - if ( mMovieController ) - { - MCDoAction( mMovieController, mcActionSetVolume, (void*)mCurVolume ); - }; - }; - - //////////////////////////////////////////////////////////////////////////////// - // - void update(int milliseconds = 0) - { - updateQuickTime(milliseconds); - }; - - //////////////////////////////////////////////////////////////////////////////// - // - void mouseDown( int x, int y ) - { - }; - - //////////////////////////////////////////////////////////////////////////////// - // - void mouseUp( int x, int y ) - { - }; - - //////////////////////////////////////////////////////////////////////////////// - // - void mouseMove( int x, int y ) - { - }; - - //////////////////////////////////////////////////////////////////////////////// - // - void keyPress( unsigned char key ) - { - }; - - //////////////////////////////////////////////////////////////////////////////// - // Grab movie title into mMovieTitle - should be called repeatedly - // until it returns true since movie title takes a while to become - // available. - const bool getMovieTitle() - { - // grab meta data from movie - QTMetaDataRef media_data_ref; - OSErr result = QTCopyMovieMetaData( mMovieHandle, &media_data_ref ); - if ( noErr != result ) - return false; - - // look up "Display Name" in meta data - OSType meta_data_key = kQTMetaDataCommonKeyDisplayName; - QTMetaDataItem item = kQTMetaDataItemUninitialized; - result = (OSErr)QTMetaDataGetNextItem( media_data_ref, kQTMetaDataStorageFormatWildcard, - 0, kQTMetaDataKeyFormatCommon, - (const UInt8 *)&meta_data_key, - sizeof( meta_data_key ), &item ); - if ( noErr != result ) - return false; - - // find the size of the title - ByteCount size; - result = (OSErr)QTMetaDataGetItemValue( media_data_ref, item, NULL, 0, &size ); - if ( noErr != result || size <= 0 /*|| size > 1024 FIXME: arbitrary limit */ ) - return false; - - // allocate some space and grab it - UInt8* item_data = new UInt8[ size + 1 ]; - memset( item_data, 0, ( size + 1 ) * sizeof( UInt8 ) ); - result = (OSErr)QTMetaDataGetItemValue( media_data_ref, item, item_data, size, NULL ); - if ( noErr != result ) - { - delete [] item_data; - return false; - }; - - // save it - if ( strlen( (char*)item_data ) ) - mMovieTitle = std::string( (char* )item_data ); - else - mMovieTitle = ""; - - // clean up - delete [] item_data; - - return true; - }; - - // called regularly to see if title changed - void checkTitle() - { - // we did already receive title so keep checking - if ( ! mReceivedTitle ) - { - // grab title from movie meta data - if ( getMovieTitle() ) - { - // pass back to host application - LLPluginMessage message(LLPLUGIN_MESSAGE_CLASS_MEDIA, "name_text"); - message.setValue("name", mMovieTitle ); - sendMessage( message ); - - // stop looking once we find a title for this movie. - // TODO: this may to be reset if movie title changes - // during playback but this is okay for now - mReceivedTitle = true; - }; - }; - }; -}; - -MediaPluginQuickTime::MediaPluginQuickTime( - LLPluginInstance::sendMessageFunction host_send_func, - void *host_user_data ) : - MediaPluginBase(host_send_func, host_user_data), - mMinWidth( 0 ), - mMaxWidth( 2048 ), - mMinHeight( 0 ), - mMaxHeight( 2048 ) -{ -// std::cerr << "MediaPluginQuickTime constructor" << std::endl; - - mNaturalWidth = -1; - mNaturalHeight = -1; - mMovieHandle = 0; - mGWorldHandle = 0; - mMovieController = 0; - mCurVolume = 0x99; - mMediaSizeChanging = false; - mIsLooping = false; - mMovieTitle = std::string(); - mReceivedTitle = false; - mCommand = COMMAND_NONE; - mPlayRate = 0.0f; - mStatus = STATUS_NONE; -} - -MediaPluginQuickTime::~MediaPluginQuickTime() -{ -// std::cerr << "MediaPluginQuickTime destructor" << std::endl; - - ExitMovies(); - -#ifdef LL_WINDOWS - TerminateQTML(); -// std::cerr << "QuickTime closing down" << std::endl; -#endif -} - - -void MediaPluginQuickTime::receiveMessage(const char *message_string) -{ -// std::cerr << "MediaPluginQuickTime::receiveMessage: received message: \"" << message_string << "\"" << std::endl; - LLPluginMessage message_in; - - if(message_in.parse(message_string) >= 0) - { - std::string message_class = message_in.getClass(); - std::string message_name = message_in.getName(); - if(message_class == LLPLUGIN_MESSAGE_CLASS_BASE) - { - if(message_name == "init") - { - LLPluginMessage message("base", "init_response"); - LLSD versions = LLSD::emptyMap(); - versions[LLPLUGIN_MESSAGE_CLASS_BASE] = LLPLUGIN_MESSAGE_CLASS_BASE_VERSION; - versions[LLPLUGIN_MESSAGE_CLASS_MEDIA] = LLPLUGIN_MESSAGE_CLASS_MEDIA_VERSION; - // Normally a plugin would only specify one of these two subclasses, but this is a demo... - versions[LLPLUGIN_MESSAGE_CLASS_MEDIA_TIME] = LLPLUGIN_MESSAGE_CLASS_MEDIA_TIME_VERSION; - message.setValueLLSD("versions", versions); - - #ifdef LL_WINDOWS - - // QuickTime 7.6.4 has an issue (that was not present in 7.6.2) with initializing QuickTime - // according to this article: http://lists.apple.com/archives/QuickTime-API/2009/Sep/msg00097.html - // The solution presented there appears to work. - QTLoadLibrary("qtcf.dll"); - - // main initialization for QuickTime - only required on Windows - OSErr result = InitializeQTML( 0L ); - if ( result != noErr ) - { - //TODO: If no QT on Windows, this fails - respond accordingly. - } - else - { - //std::cerr << "QuickTime initialized" << std::endl; - }; - #endif - - // required for both Windows and Mac - EnterMovies(); - - std::string plugin_version = "QuickTime media plugin, QuickTime version "; - - long version = 0; - Gestalt( gestaltQuickTimeVersion, &version ); - std::ostringstream codec( "" ); - codec << std::hex << version << std::dec; - plugin_version += codec.str(); - message.setValue("plugin_version", plugin_version); - sendMessage(message); - } - else if(message_name == "idle") - { - // no response is necessary here. - F64 time = message_in.getValueReal("time"); - - // Convert time to milliseconds for update() - update((int)(time * 1000.0f)); - } - else if(message_name == "cleanup") - { - // TODO: clean up here - } - else if(message_name == "shm_added") - { - SharedSegmentInfo info; - info.mAddress = message_in.getValuePointer("address"); - info.mSize = (size_t)message_in.getValueS32("size"); - std::string name = message_in.getValue("name"); -// std::cerr << "MediaPluginQuickTime::receiveMessage: shared memory added, name: " << name -// << ", size: " << info.mSize -// << ", address: " << info.mAddress -// << std::endl; - - mSharedSegments.insert(SharedSegmentMap::value_type(name, info)); - - } - else if(message_name == "shm_remove") - { - std::string name = message_in.getValue("name"); - -// std::cerr << "MediaPluginQuickTime::receiveMessage: shared memory remove, name = " << name << std::endl; - - SharedSegmentMap::iterator iter = mSharedSegments.find(name); - if(iter != mSharedSegments.end()) - { - if(mPixels == iter->second.mAddress) - { - // This is the currently active pixel buffer. Make sure we stop drawing to it. - mPixels = NULL; - mTextureSegmentName.clear(); - - // Make sure the movie GWorld is no longer pointed at the shared segment. - sizeChanged(); - } - mSharedSegments.erase(iter); - } - else - { -// std::cerr << "MediaPluginQuickTime::receiveMessage: unknown shared memory region!" << std::endl; - } - - // Send the response so it can be cleaned up. - LLPluginMessage message("base", "shm_remove_response"); - message.setValue("name", name); - sendMessage(message); - } - else - { -// std::cerr << "MediaPluginQuickTime::receiveMessage: unknown base message: " << message_name << std::endl; - } - } - else if(message_class == LLPLUGIN_MESSAGE_CLASS_MEDIA) - { - if(message_name == "init") - { - // This is the media init message -- all necessary data for initialization should have been received. - - // Plugin gets to decide the texture parameters to use. - LLPluginMessage message(LLPLUGIN_MESSAGE_CLASS_MEDIA, "texture_params"); - #if defined(LL_WINDOWS) - // Values for Windows - mDepth = 3; - message.setValueU32("format", GL_RGB); - message.setValueU32("type", GL_UNSIGNED_BYTE); - - // We really want to pad the texture width to a multiple of 32 bytes, but since we're using 3-byte pixels, it doesn't come out even. - // Padding to a multiple of 3*32 guarantees it'll divide out properly. - message.setValueU32("padding", 32 * 3); - #else - // Values for Mac - mDepth = 4; - message.setValueU32("format", GL_BGRA_EXT); - #ifdef __BIG_ENDIAN__ - message.setValueU32("type", GL_UNSIGNED_INT_8_8_8_8_REV ); - #else - message.setValueU32("type", GL_UNSIGNED_INT_8_8_8_8); - #endif - - // Pad texture width to a multiple of 32 bytes, to line up with cache lines. - message.setValueU32("padding", 32); - #endif - message.setValueS32("depth", mDepth); - message.setValueU32("internalformat", GL_RGB); - - // note this apparently only has an effect when media is opened in 2D browser. - // see https://jira.secondlife.com/browse/BUG-18252 - media flipped in 2D so flipping it back. - message.setValueBoolean("coords_opengl", true); // true == use OpenGL-style coordinates, false == (0,0) is upper left. - message.setValueBoolean("allow_downsample", true); - sendMessage(message); - } - else if(message_name == "size_change") - { - std::string name = message_in.getValue("name"); - S32 width = message_in.getValueS32("width"); - S32 height = message_in.getValueS32("height"); - S32 texture_width = message_in.getValueS32("texture_width"); - S32 texture_height = message_in.getValueS32("texture_height"); - - //std::cerr << "---->Got size change instruction from application with name: " << name << " - size is " << width << " x " << height << std::endl; - - LLPluginMessage message(LLPLUGIN_MESSAGE_CLASS_MEDIA, "size_change_response"); - message.setValue("name", name); - message.setValueS32("width", width); - message.setValueS32("height", height); - message.setValueS32("texture_width", texture_width); - message.setValueS32("texture_height", texture_height); - sendMessage(message); - - if(!name.empty()) - { - // Find the shared memory region with this name - SharedSegmentMap::iterator iter = mSharedSegments.find(name); - if(iter != mSharedSegments.end()) - { -// std::cerr << "%%% Got size change, new size is " << width << " by " << height << std::endl; -// std::cerr << "%%%% texture size is " << texture_width << " by " << texture_height << std::endl; - - mPixels = (unsigned char*)iter->second.mAddress; - mTextureSegmentName = name; - mWidth = width; - mHeight = height; - - mTextureWidth = texture_width; - mTextureHeight = texture_height; - - mMediaSizeChanging = false; - - sizeChanged(); - - update(); - }; - }; - } - else if(message_name == "load_uri") - { - std::string uri = message_in.getValue("uri"); - load( uri ); - sendStatus(); - } - else if(message_name == "mouse_event") - { - std::string event = message_in.getValue("event"); - S32 x = message_in.getValueS32("x"); - S32 y = message_in.getValueS32("y"); - - if(event == "down") - { - mouseDown(x, y); - } - else if(event == "up") - { - mouseUp(x, y); - } - else if(event == "move") - { - mouseMove(x, y); - }; - }; - } - else if(message_class == LLPLUGIN_MESSAGE_CLASS_MEDIA_TIME) - { - if(message_name == "stop") - { - stop(); - } - else if(message_name == "start") - { - F64 rate = 0.0; - if(message_in.hasValue("rate")) - { - rate = message_in.getValueReal("rate"); - } - play(rate); - } - else if(message_name == "pause") - { - pause(); - } - else if(message_name == "seek") - { - F64 time = message_in.getValueReal("time"); - seek(time); - } - else if(message_name == "set_loop") - { - bool loop = message_in.getValueBoolean("loop"); - mIsLooping = loop; - } - else if(message_name == "set_volume") - { - F64 volume = message_in.getValueReal("volume"); - setVolume(volume); - } - } - else - { -// std::cerr << "MediaPluginQuickTime::receiveMessage: unknown message class: " << message_class << std::endl; - }; - }; -} - -int init_media_plugin(LLPluginInstance::sendMessageFunction host_send_func, void *host_user_data, LLPluginInstance::sendMessageFunction *plugin_send_func, void **plugin_user_data) -{ - MediaPluginQuickTime *self = new MediaPluginQuickTime(host_send_func, host_user_data); - *plugin_send_func = MediaPluginQuickTime::staticReceiveMessage; - *plugin_user_data = (void*)self; - - return 0; -} - -#else // LL_QUICKTIME_ENABLED - -// Stubbed-out class with constructor/destructor (necessary or windows linker -// will just think its dead code and optimize it all out) -class MediaPluginQuickTime : public MediaPluginBase -{ -public: - MediaPluginQuickTime(LLPluginInstance::sendMessageFunction host_send_func, void *host_user_data); - ~MediaPluginQuickTime(); - /* virtual */ void receiveMessage(const char *message_string); -}; - -MediaPluginQuickTime::MediaPluginQuickTime( - LLPluginInstance::sendMessageFunction host_send_func, - void *host_user_data ) : - MediaPluginBase(host_send_func, host_user_data) -{ - // no-op -} - -MediaPluginQuickTime::~MediaPluginQuickTime() -{ - // no-op -} - -void MediaPluginQuickTime::receiveMessage(const char *message_string) -{ - // no-op -} - -// We're building without quicktime enabled. Just refuse to initialize. -int init_media_plugin(LLPluginInstance::sendMessageFunction host_send_func, void *host_user_data, LLPluginInstance::sendMessageFunction *plugin_send_func, void **plugin_user_data) -{ - return -1; -} - -#endif // LL_QUICKTIME_ENABLED diff --git a/indra/media_plugins/winmmshim/CMakeLists.txt b/indra/media_plugins/winmmshim/CMakeLists.txt deleted file mode 100644 index 6890589892..0000000000 --- a/indra/media_plugins/winmmshim/CMakeLists.txt +++ /dev/null @@ -1,37 +0,0 @@ -# -*- cmake -*- - -project(winmm_shim) - -### winmm_shim -# *HACK - override msvcrt implementation (intialized on 00-Common) to be -# statically linked for winmm.dll this relies on vc taking the last flag on -# the command line -set(CMAKE_CXX_FLAGS_DEBUG "${CMAKE_CXX_FLAGS_DEBUG} /MTd") -set(CMAKE_CXX_FLAGS_RELWITHDEBINFO "${CMAKE_CXX_FLAGS_RELWITHDEBINFO} /MT") -set(CMAKE_CXX_FLAGS_RELEASE "${CMAKE_CXX_FLAGS_RELEASE} /MT") - -set(winmm_shim_SOURCE_FILES - forwarding_api.cpp - winmm_shim.cpp - ) - -set(winmm_shim_HEADER_FILES - forwarding_api.h - winmm.def - ) - -list(APPEND winmm_shim_SOURCE_FILES ${winmm_shim_HEADER_FILES}) - -add_library(winmm_shim - SHARED - ${winmm_shim_SOURCE_FILES} -) - -if (WINDOWS) - set_target_properties( - winmm_shim - PROPERTIES - LINK_FLAGS "/MANIFEST:NO" - OUTPUT_NAME "winmm" - ) -endif (WINDOWS) diff --git a/indra/media_plugins/winmmshim/forwarding_api.cpp b/indra/media_plugins/winmmshim/forwarding_api.cpp deleted file mode 100644 index 33f0675028..0000000000 --- a/indra/media_plugins/winmmshim/forwarding_api.cpp +++ /dev/null @@ -1,1627 +0,0 @@ -/** - * @file forwarding_api.cpp - * @brief forwards winmm API calls to real winmm.dll - * - * $LicenseInfo:firstyear=2010&license=viewerlgpl$ - * Second Life Viewer Source Code - * Copyright (C) 2010, Linden Research, Inc. - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; - * version 2.1 of the License only. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA - * - * Linden Research, Inc., 945 Battery Street, San Francisco, CA 94111 USA - * $/LicenseInfo$ - */ - -#include "forwarding_api.h" - -CloseDriver_type CloseDriver_orig; -OpenDriver_type OpenDriver_orig; -SendDriverMessage_type SendDriverMessage_orig; -DrvGetModuleHandle_type DrvGetModuleHandle_orig; -GetDriverModuleHandle_type GetDriverModuleHandle_orig; -DefDriverProc_type DefDriverProc_orig; -DriverCallback_type DriverCallback_orig; -mmsystemGetVersion_type mmsystemGetVersion_orig; -sndPlaySoundA_type sndPlaySoundA_orig; -sndPlaySoundW_type sndPlaySoundW_orig; -PlaySoundA_type PlaySoundA_orig; -PlaySoundW_type PlaySoundW_orig; -waveOutGetNumDevs_type waveOutGetNumDevs_orig; -waveOutGetDevCapsA_type waveOutGetDevCapsA_orig; -waveOutGetDevCapsW_type waveOutGetDevCapsW_orig; -waveOutGetVolume_type waveOutGetVolume_orig; -waveOutSetVolume_type waveOutSetVolume_orig; -waveOutGetErrorTextA_type waveOutGetErrorTextA_orig; -waveOutGetErrorTextW_type waveOutGetErrorTextW_orig; -waveOutOpen_type waveOutOpen_orig; -waveOutClose_type waveOutClose_orig; -waveOutPrepareHeader_type waveOutPrepareHeader_orig; -waveOutUnprepareHeader_type waveOutUnprepareHeader_orig; -waveOutWrite_type waveOutWrite_orig; -waveOutPause_type waveOutPause_orig; -waveOutRestart_type waveOutRestart_orig; -waveOutReset_type waveOutReset_orig; -waveOutBreakLoop_type waveOutBreakLoop_orig; -waveOutGetPosition_type waveOutGetPosition_orig; -waveOutGetPitch_type waveOutGetPitch_orig; -waveOutSetPitch_type waveOutSetPitch_orig; -waveOutGetPlaybackRate_type waveOutGetPlaybackRate_orig; -waveOutSetPlaybackRate_type waveOutSetPlaybackRate_orig; -waveOutGetID_type waveOutGetID_orig; -waveOutMessage_type waveOutMessage_orig; -waveInGetNumDevs_type waveInGetNumDevs_orig; -waveInGetDevCapsA_type waveInGetDevCapsA_orig; -waveInGetDevCapsW_type waveInGetDevCapsW_orig; -waveInGetErrorTextA_type waveInGetErrorTextA_orig; -waveInGetErrorTextW_type waveInGetErrorTextW_orig; -waveInOpen_type waveInOpen_orig; -waveInClose_type waveInClose_orig; -waveInPrepareHeader_type waveInPrepareHeader_orig; -waveInUnprepareHeader_type waveInUnprepareHeader_orig; -waveInAddBuffer_type waveInAddBuffer_orig; -waveInStart_type waveInStart_orig; -waveInStop_type waveInStop_orig; -waveInReset_type waveInReset_orig; -waveInGetPosition_type waveInGetPosition_orig; -waveInGetID_type waveInGetID_orig; -waveInMessage_type waveInMessage_orig; -midiOutGetNumDevs_type midiOutGetNumDevs_orig; -midiStreamOpen_type midiStreamOpen_orig; -midiStreamClose_type midiStreamClose_orig; -midiStreamProperty_type midiStreamProperty_orig; -midiStreamPosition_type midiStreamPosition_orig; -midiStreamOut_type midiStreamOut_orig; -midiStreamPause_type midiStreamPause_orig; -midiStreamRestart_type midiStreamRestart_orig; -midiStreamStop_type midiStreamStop_orig; -midiConnect_type midiConnect_orig; -midiDisconnect_type midiDisconnect_orig; -midiOutGetDevCapsA_type midiOutGetDevCapsA_orig; -midiOutGetDevCapsW_type midiOutGetDevCapsW_orig; -midiOutGetVolume_type midiOutGetVolume_orig; -midiOutSetVolume_type midiOutSetVolume_orig; -midiOutGetErrorTextA_type midiOutGetErrorTextA_orig; -midiOutGetErrorTextW_type midiOutGetErrorTextW_orig; -midiOutOpen_type midiOutOpen_orig; -midiOutClose_type midiOutClose_orig; -midiOutPrepareHeader_type midiOutPrepareHeader_orig; -midiOutUnprepareHeader_type midiOutUnprepareHeader_orig; -midiOutShortMsg_type midiOutShortMsg_orig; -midiOutLongMsg_type midiOutLongMsg_orig; -midiOutReset_type midiOutReset_orig; -midiOutCachePatches_type midiOutCachePatches_orig; -midiOutCacheDrumPatches_type midiOutCacheDrumPatches_orig; -midiOutGetID_type midiOutGetID_orig; -midiOutMessage_type midiOutMessage_orig; -midiInGetNumDevs_type midiInGetNumDevs_orig; -midiInGetDevCapsA_type midiInGetDevCapsA_orig; -midiInGetDevCapsW_type midiInGetDevCapsW_orig; -midiInGetErrorTextA_type midiInGetErrorTextA_orig; -midiInGetErrorTextW_type midiInGetErrorTextW_orig; -midiInOpen_type midiInOpen_orig; -midiInClose_type midiInClose_orig; -midiInPrepareHeader_type midiInPrepareHeader_orig; -midiInUnprepareHeader_type midiInUnprepareHeader_orig; -midiInAddBuffer_type midiInAddBuffer_orig; -midiInStart_type midiInStart_orig; -midiInStop_type midiInStop_orig; -midiInReset_type midiInReset_orig; -midiInGetID_type midiInGetID_orig; -midiInMessage_type midiInMessage_orig; -auxGetNumDevs_type auxGetNumDevs_orig; -auxGetDevCapsA_type auxGetDevCapsA_orig; -auxGetDevCapsW_type auxGetDevCapsW_orig; -auxSetVolume_type auxSetVolume_orig; -auxGetVolume_type auxGetVolume_orig; -auxOutMessage_type auxOutMessage_orig; -mixerGetNumDevs_type mixerGetNumDevs_orig; -mixerGetDevCapsA_type mixerGetDevCapsA_orig; -mixerGetDevCapsW_type mixerGetDevCapsW_orig; -mixerOpen_type mixerOpen_orig; -mixerClose_type mixerClose_orig; -mixerMessage_type mixerMessage_orig; -mixerGetLineInfoA_type mixerGetLineInfoA_orig; -mixerGetLineInfoW_type mixerGetLineInfoW_orig; -mixerGetID_type mixerGetID_orig; -mixerGetLineControlsA_type mixerGetLineControlsA_orig; -mixerGetLineControlsW_type mixerGetLineControlsW_orig; -mixerGetControlDetailsA_type mixerGetControlDetailsA_orig; -mixerGetControlDetailsW_type mixerGetControlDetailsW_orig; -mixerSetControlDetails_type mixerSetControlDetails_orig; -mmGetCurrentTask_type mmGetCurrentTask_orig; -mmTaskBlock_type mmTaskBlock_orig; -mmTaskCreate_type mmTaskCreate_orig; -mmTaskSignal_type mmTaskSignal_orig; -mmTaskYield_type mmTaskYield_orig; -timeGetSystemTime_type timeGetSystemTime_orig; -timeGetTime_type timeGetTime_orig; -timeSetEvent_type timeSetEvent_orig; -timeKillEvent_type timeKillEvent_orig; -timeGetDevCaps_type timeGetDevCaps_orig; -timeBeginPeriod_type timeBeginPeriod_orig; -timeEndPeriod_type timeEndPeriod_orig; -joyGetNumDevs_type joyGetNumDevs_orig; -joyConfigChanged_type joyConfigChanged_orig; -joyGetDevCapsA_type joyGetDevCapsA_orig; -joyGetDevCapsW_type joyGetDevCapsW_orig; -joyGetPos_type joyGetPos_orig; -joyGetPosEx_type joyGetPosEx_orig; -joyGetThreshold_type joyGetThreshold_orig; -joyReleaseCapture_type joyReleaseCapture_orig; -joySetCapture_type joySetCapture_orig; -joySetThreshold_type joySetThreshold_orig; -mmioStringToFOURCCA_type mmioStringToFOURCCA_orig; -mmioStringToFOURCCW_type mmioStringToFOURCCW_orig; -mmioInstallIOProcA_type mmioInstallIOProcA_orig; -mmioInstallIOProcW_type mmioInstallIOProcW_orig; -mmioOpenA_type mmioOpenA_orig; -mmioOpenW_type mmioOpenW_orig; -mmioRenameA_type mmioRenameA_orig; -mmioRenameW_type mmioRenameW_orig; -mmioClose_type mmioClose_orig; -mmioRead_type mmioRead_orig; -mmioWrite_type mmioWrite_orig; -mmioSeek_type mmioSeek_orig; -mmioGetInfo_type mmioGetInfo_orig; -mmioSetInfo_type mmioSetInfo_orig; -mmioSetBuffer_type mmioSetBuffer_orig; -mmioFlush_type mmioFlush_orig; -mmioAdvance_type mmioAdvance_orig; -mmioSendMessage_type mmioSendMessage_orig; -mmioDescend_type mmioDescend_orig; -mmioAscend_type mmioAscend_orig; -mmioCreateChunk_type mmioCreateChunk_orig; -mciSendCommandA_type mciSendCommandA_orig; -mciSendCommandW_type mciSendCommandW_orig; -mciSendStringA_type mciSendStringA_orig; -mciSendStringW_type mciSendStringW_orig; -mciGetDeviceIDA_type mciGetDeviceIDA_orig; -mciGetDeviceIDW_type mciGetDeviceIDW_orig; -mciGetDeviceIDFromElementIDA_type mciGetDeviceIDFromElementIDA_orig; -mciGetDeviceIDFromElementIDW_type mciGetDeviceIDFromElementIDW_orig; -mciGetDriverData_type mciGetDriverData_orig; -mciGetErrorStringA_type mciGetErrorStringA_orig; -mciGetErrorStringW_type mciGetErrorStringW_orig; -mciSetDriverData_type mciSetDriverData_orig; -mciDriverNotify_type mciDriverNotify_orig; -mciDriverYield_type mciDriverYield_orig; -mciSetYieldProc_type mciSetYieldProc_orig; -mciFreeCommandResource_type mciFreeCommandResource_orig; -mciGetCreatorTask_type mciGetCreatorTask_orig; -mciGetYieldProc_type mciGetYieldProc_orig; -mciLoadCommandResource_type mciLoadCommandResource_orig; -mciExecute_type mciExecute_orig; - -// grab pointers to function calls in the real DLL -void init_function_pointers(HMODULE winmm_handle) -{ - CloseDriver_orig = (CloseDriver_type)::GetProcAddress(winmm_handle, "CloseDriver"); - OpenDriver_orig = (OpenDriver_type)::GetProcAddress(winmm_handle, "OpenDriver"); - SendDriverMessage_orig = (SendDriverMessage_type)::GetProcAddress(winmm_handle, "SendDriverMessage"); - DrvGetModuleHandle_orig = (DrvGetModuleHandle_type)::GetProcAddress(winmm_handle, "DrvGetModuleHandle"); - GetDriverModuleHandle_orig = (GetDriverModuleHandle_type)::GetProcAddress(winmm_handle, "GetDriverModuleHandle"); - DefDriverProc_orig = (DefDriverProc_type)::GetProcAddress(winmm_handle, "DefDriverProc"); - DriverCallback_orig = (DriverCallback_type)::GetProcAddress(winmm_handle, "DriverCallback"); - mmsystemGetVersion_orig = (mmsystemGetVersion_type)::GetProcAddress(winmm_handle, "mmsystemGetVersion"); - sndPlaySoundA_orig = (sndPlaySoundA_type)::GetProcAddress(winmm_handle, "sndPlaySoundA"); - sndPlaySoundW_orig = (sndPlaySoundW_type)::GetProcAddress(winmm_handle, "sndPlaySoundW"); - PlaySoundA_orig = (PlaySoundA_type)::GetProcAddress(winmm_handle, "PlaySoundA"); - PlaySoundW_orig = (PlaySoundW_type)::GetProcAddress(winmm_handle, "PlaySoundW"); - waveOutGetNumDevs_orig = (waveOutGetNumDevs_type)::GetProcAddress(winmm_handle, "waveOutGetNumDevs"); - waveOutGetDevCapsA_orig = (waveOutGetDevCapsA_type)::GetProcAddress(winmm_handle, "waveOutGetDevCapsA"); - waveOutGetDevCapsW_orig = (waveOutGetDevCapsW_type)::GetProcAddress(winmm_handle, "waveOutGetDevCapsW"); - waveOutGetVolume_orig = (waveOutGetVolume_type)::GetProcAddress(winmm_handle, "waveOutGetVolume"); - waveOutSetVolume_orig = (waveOutSetVolume_type)::GetProcAddress(winmm_handle, "waveOutSetVolume"); - waveOutGetErrorTextA_orig = (waveOutGetErrorTextA_type)::GetProcAddress(winmm_handle, "waveOutGetErrorTextA"); - waveOutGetErrorTextW_orig = (waveOutGetErrorTextW_type)::GetProcAddress(winmm_handle, "waveOutGetErrorTextW"); - waveOutOpen_orig = (waveOutOpen_type)::GetProcAddress(winmm_handle, "waveOutOpen"); - waveOutClose_orig = (waveOutClose_type)::GetProcAddress(winmm_handle, "waveOutClose"); - waveOutPrepareHeader_orig = (waveOutPrepareHeader_type)::GetProcAddress(winmm_handle, "waveOutPrepareHeader"); - waveOutUnprepareHeader_orig = (waveOutUnprepareHeader_type)::GetProcAddress(winmm_handle, "waveOutUnprepareHeader"); - waveOutWrite_orig = (waveOutWrite_type)::GetProcAddress(winmm_handle, "waveOutWrite"); - waveOutPause_orig = (waveOutPause_type)::GetProcAddress(winmm_handle, "waveOutPause"); - waveOutRestart_orig = (waveOutRestart_type)::GetProcAddress(winmm_handle, "waveOutRestart"); - waveOutReset_orig = (waveOutReset_type)::GetProcAddress(winmm_handle, "waveOutReset"); - waveOutBreakLoop_orig = (waveOutBreakLoop_type)::GetProcAddress(winmm_handle, "waveOutBreakLoop"); - waveOutGetPosition_orig = (waveOutGetPosition_type)::GetProcAddress(winmm_handle, "waveOutGetPosition"); - waveOutGetPitch_orig = (waveOutGetPitch_type)::GetProcAddress(winmm_handle, "waveOutGetPitch"); - waveOutSetPitch_orig = (waveOutSetPitch_type)::GetProcAddress(winmm_handle, "waveOutSetPitch"); - waveOutGetPlaybackRate_orig = (waveOutGetPlaybackRate_type)::GetProcAddress(winmm_handle, "waveOutGetPlaybackRate"); - waveOutSetPlaybackRate_orig = (waveOutSetPlaybackRate_type)::GetProcAddress(winmm_handle, "waveOutSetPlaybackRate"); - waveOutGetID_orig = (waveOutGetID_type)::GetProcAddress(winmm_handle, "waveOutGetID"); - waveOutMessage_orig = (waveOutMessage_type)::GetProcAddress(winmm_handle, "waveOutMessage"); - waveInGetNumDevs_orig = (waveInGetNumDevs_type)::GetProcAddress(winmm_handle, "waveInGetNumDevs"); - waveInGetDevCapsA_orig = (waveInGetDevCapsA_type)::GetProcAddress(winmm_handle, "waveInGetDevCapsA"); - waveInGetDevCapsW_orig = (waveInGetDevCapsW_type)::GetProcAddress(winmm_handle, "waveInGetDevCapsW"); - waveInGetErrorTextA_orig = (waveInGetErrorTextA_type)::GetProcAddress(winmm_handle, "waveInGetErrorTextA"); - waveInGetErrorTextW_orig = (waveInGetErrorTextW_type)::GetProcAddress(winmm_handle, "waveInGetErrorTextW"); - waveInOpen_orig = (waveInOpen_type)::GetProcAddress(winmm_handle, "waveInOpen"); - waveInClose_orig = (waveInClose_type)::GetProcAddress(winmm_handle, "waveInClose"); - waveInPrepareHeader_orig = (waveInPrepareHeader_type)::GetProcAddress(winmm_handle, "waveInPrepareHeader"); - waveInUnprepareHeader_orig = (waveInUnprepareHeader_type)::GetProcAddress(winmm_handle, "waveInUnprepareHeader"); - waveInAddBuffer_orig = (waveInAddBuffer_type)::GetProcAddress(winmm_handle, "waveInAddBuffer"); - waveInStart_orig = (waveInStart_type)::GetProcAddress(winmm_handle, "waveInStart"); - waveInStop_orig = (waveInStop_type)::GetProcAddress(winmm_handle, "waveInStop"); - waveInReset_orig = (waveInReset_type)::GetProcAddress(winmm_handle, "waveInReset"); - waveInGetPosition_orig = (waveInGetPosition_type)::GetProcAddress(winmm_handle, "waveInGetPosition"); - waveInGetID_orig = (waveInGetID_type)::GetProcAddress(winmm_handle, "waveInGetID"); - waveInMessage_orig = (waveInMessage_type)::GetProcAddress(winmm_handle, "waveInMessage"); - midiOutGetNumDevs_orig = (midiOutGetNumDevs_type)::GetProcAddress(winmm_handle, "midiOutGetNumDevs"); - midiStreamOpen_orig = (midiStreamOpen_type)::GetProcAddress(winmm_handle, "midiStreamOpen"); - midiStreamClose_orig = (midiStreamClose_type)::GetProcAddress(winmm_handle, "midiStreamClose"); - midiStreamProperty_orig = (midiStreamProperty_type)::GetProcAddress(winmm_handle, "midiStreamProperty"); - midiStreamPosition_orig = (midiStreamPosition_type)::GetProcAddress(winmm_handle, "midiStreamPosition"); - midiStreamOut_orig = (midiStreamOut_type)::GetProcAddress(winmm_handle, "midiStreamOut"); - midiStreamPause_orig = (midiStreamPause_type)::GetProcAddress(winmm_handle, "midiStreamPause"); - midiStreamRestart_orig = (midiStreamRestart_type)::GetProcAddress(winmm_handle, "midiStreamRestart"); - midiStreamStop_orig = (midiStreamStop_type)::GetProcAddress(winmm_handle, "midiStreamStop"); - midiConnect_orig = (midiConnect_type)::GetProcAddress(winmm_handle, "midiConnect"); - midiDisconnect_orig = (midiDisconnect_type)::GetProcAddress(winmm_handle, "midiDisconnect"); - midiOutGetDevCapsA_orig = (midiOutGetDevCapsA_type)::GetProcAddress(winmm_handle, "midiOutGetDevCapsA"); - midiOutGetDevCapsW_orig = (midiOutGetDevCapsW_type)::GetProcAddress(winmm_handle, "midiOutGetDevCapsW"); - midiOutGetVolume_orig = (midiOutGetVolume_type)::GetProcAddress(winmm_handle, "midiOutGetVolume"); - midiOutSetVolume_orig = (midiOutSetVolume_type)::GetProcAddress(winmm_handle, "midiOutSetVolume"); - midiOutGetErrorTextA_orig = (midiOutGetErrorTextA_type)::GetProcAddress(winmm_handle, "midiOutGetErrorTextA"); - midiOutGetErrorTextW_orig = (midiOutGetErrorTextW_type)::GetProcAddress(winmm_handle, "midiOutGetErrorTextW"); - midiOutOpen_orig = (midiOutOpen_type)::GetProcAddress(winmm_handle, "midiOutOpen"); - midiOutClose_orig = (midiOutClose_type)::GetProcAddress(winmm_handle, "midiOutClose"); - midiOutPrepareHeader_orig = (midiOutPrepareHeader_type)::GetProcAddress(winmm_handle, "midiOutPrepareHeader"); - midiOutUnprepareHeader_orig = (midiOutUnprepareHeader_type)::GetProcAddress(winmm_handle, "midiOutUnprepareHeader"); - midiOutShortMsg_orig = (midiOutShortMsg_type)::GetProcAddress(winmm_handle, "midiOutShortMsg"); - midiOutLongMsg_orig = (midiOutLongMsg_type)::GetProcAddress(winmm_handle, "midiOutLongMsg"); - midiOutReset_orig = (midiOutReset_type)::GetProcAddress(winmm_handle, "midiOutReset"); - midiOutCachePatches_orig = (midiOutCachePatches_type)::GetProcAddress(winmm_handle, "midiOutCachePatches"); - midiOutCacheDrumPatches_orig = (midiOutCacheDrumPatches_type)::GetProcAddress(winmm_handle, "midiOutCacheDrumPatches"); - midiOutGetID_orig = (midiOutGetID_type)::GetProcAddress(winmm_handle, "midiOutGetID"); - midiOutMessage_orig = (midiOutMessage_type)::GetProcAddress(winmm_handle, "midiOutMessage"); - midiInGetNumDevs_orig = (midiInGetNumDevs_type)::GetProcAddress(winmm_handle, "midiInGetNumDevs"); - midiInGetDevCapsA_orig = (midiInGetDevCapsA_type)::GetProcAddress(winmm_handle, "midiInGetDevCapsA"); - midiInGetDevCapsW_orig = (midiInGetDevCapsW_type)::GetProcAddress(winmm_handle, "midiInGetDevCapsW"); - midiInGetErrorTextA_orig = (midiInGetErrorTextA_type)::GetProcAddress(winmm_handle, "midiInGetErrorTextA"); - midiInGetErrorTextW_orig = (midiInGetErrorTextW_type)::GetProcAddress(winmm_handle, "midiInGetErrorTextW"); - midiInOpen_orig = (midiInOpen_type)::GetProcAddress(winmm_handle, "midiInOpen"); - midiInClose_orig = (midiInClose_type)::GetProcAddress(winmm_handle, "midiInClose"); - midiInPrepareHeader_orig = (midiInPrepareHeader_type)::GetProcAddress(winmm_handle, "midiInPrepareHeader"); - midiInUnprepareHeader_orig = (midiInUnprepareHeader_type)::GetProcAddress(winmm_handle, "midiInUnprepareHeader"); - midiInAddBuffer_orig = (midiInAddBuffer_type)::GetProcAddress(winmm_handle, "midiInAddBuffer"); - midiInStart_orig = (midiInStart_type)::GetProcAddress(winmm_handle, "midiInStart"); - midiInStop_orig = (midiInStop_type)::GetProcAddress(winmm_handle, "midiInStop"); - midiInReset_orig = (midiInReset_type)::GetProcAddress(winmm_handle, "midiInReset"); - midiInGetID_orig = (midiInGetID_type)::GetProcAddress(winmm_handle, "midiInGetID"); - midiInMessage_orig = (midiInMessage_type)::GetProcAddress(winmm_handle, "midiInMessage"); - auxGetNumDevs_orig = (auxGetNumDevs_type)::GetProcAddress(winmm_handle, "auxGetNumDevs"); - auxGetDevCapsA_orig = (auxGetDevCapsA_type)::GetProcAddress(winmm_handle, "auxGetDevCapsA"); - auxGetDevCapsW_orig = (auxGetDevCapsW_type)::GetProcAddress(winmm_handle, "auxGetDevCapsW"); - auxSetVolume_orig = (auxSetVolume_type)::GetProcAddress(winmm_handle, "auxSetVolume"); - auxGetVolume_orig = (auxGetVolume_type)::GetProcAddress(winmm_handle, "auxGetVolume"); - auxOutMessage_orig = (auxOutMessage_type)::GetProcAddress(winmm_handle, "auxOutMessage"); - mixerGetNumDevs_orig = (mixerGetNumDevs_type)::GetProcAddress(winmm_handle, "mixerGetNumDevs"); - mixerGetDevCapsA_orig = (mixerGetDevCapsA_type)::GetProcAddress(winmm_handle, "mixerGetDevCapsA"); - mixerGetDevCapsW_orig = (mixerGetDevCapsW_type)::GetProcAddress(winmm_handle, "mixerGetDevCapsW"); - mixerOpen_orig = (mixerOpen_type)::GetProcAddress(winmm_handle, "mixerOpen"); - mixerClose_orig = (mixerClose_type)::GetProcAddress(winmm_handle, "mixerClose"); - mixerMessage_orig = (mixerMessage_type)::GetProcAddress(winmm_handle, "mixerMessage"); - mixerGetLineInfoA_orig = (mixerGetLineInfoA_type)::GetProcAddress(winmm_handle, "mixerGetLineInfoA"); - mixerGetLineInfoW_orig = (mixerGetLineInfoW_type)::GetProcAddress(winmm_handle, "mixerGetLineInfoW"); - mixerGetID_orig = (mixerGetID_type)::GetProcAddress(winmm_handle, "mixerGetID"); - mixerGetLineControlsA_orig = (mixerGetLineControlsA_type)::GetProcAddress(winmm_handle, "mixerGetLineControlsA"); - mixerGetLineControlsW_orig = (mixerGetLineControlsW_type)::GetProcAddress(winmm_handle, "mixerGetLineControlsW"); - mixerGetControlDetailsA_orig = (mixerGetControlDetailsA_type)::GetProcAddress(winmm_handle, "mixerGetControlDetailsA"); - mixerGetControlDetailsW_orig = (mixerGetControlDetailsW_type)::GetProcAddress(winmm_handle, "mixerGetControlDetailsW"); - mixerSetControlDetails_orig = (mixerSetControlDetails_type)::GetProcAddress(winmm_handle, "mixerSetControlDetails"); - mmGetCurrentTask_orig = (mmGetCurrentTask_type)::GetProcAddress(winmm_handle, "mmGetCurrentTask"); - mmTaskBlock_orig = (mmTaskBlock_type)::GetProcAddress(winmm_handle, "mmTaskBlock"); - mmTaskCreate_orig = (mmTaskCreate_type)::GetProcAddress(winmm_handle, "mmTaskCreate"); - mmTaskSignal_orig = (mmTaskSignal_type)::GetProcAddress(winmm_handle, "mmTaskSignal"); - mmTaskYield_orig = (mmTaskYield_type)::GetProcAddress(winmm_handle, "mmTaskYield"); - timeGetSystemTime_orig = (timeGetSystemTime_type)::GetProcAddress(winmm_handle, "timeGetSystemTime"); - timeGetTime_orig = (timeGetTime_type)::GetProcAddress(winmm_handle, "timeGetTime"); - timeSetEvent_orig = (timeSetEvent_type)::GetProcAddress(winmm_handle, "timeSetEvent"); - timeKillEvent_orig = (timeKillEvent_type)::GetProcAddress(winmm_handle, "timeKillEvent"); - timeGetDevCaps_orig = (timeGetDevCaps_type)::GetProcAddress(winmm_handle, "timeGetDevCaps"); - timeBeginPeriod_orig = (timeBeginPeriod_type)::GetProcAddress(winmm_handle, "timeBeginPeriod"); - timeEndPeriod_orig = (timeEndPeriod_type)::GetProcAddress(winmm_handle, "timeEndPeriod"); - joyGetNumDevs_orig = (joyGetNumDevs_type)::GetProcAddress(winmm_handle, "joyGetNumDevs"); - joyConfigChanged_orig = (joyConfigChanged_type)::GetProcAddress(winmm_handle, "joyConfigChanged"); - joyGetDevCapsA_orig = (joyGetDevCapsA_type)::GetProcAddress(winmm_handle, "joyGetDevCapsA"); - joyGetDevCapsW_orig = (joyGetDevCapsW_type)::GetProcAddress(winmm_handle, "joyGetDevCapsW"); - joyGetPos_orig = (joyGetPos_type)::GetProcAddress(winmm_handle, "joyGetPos"); - joyGetPosEx_orig = (joyGetPosEx_type)::GetProcAddress(winmm_handle, "joyGetPosEx"); - joyGetThreshold_orig = (joyGetThreshold_type)::GetProcAddress(winmm_handle, "joyGetThreshold"); - joyReleaseCapture_orig = (joyReleaseCapture_type)::GetProcAddress(winmm_handle, "joyReleaseCapture"); - joySetCapture_orig = (joySetCapture_type)::GetProcAddress(winmm_handle, "joySetCapture"); - joySetThreshold_orig = (joySetThreshold_type)::GetProcAddress(winmm_handle, "joySetThreshold"); - mciDriverNotify_orig = (mciDriverNotify_type)::GetProcAddress(winmm_handle, "mciDriverNotify"); - mciDriverYield_orig = (mciDriverYield_type)::GetProcAddress(winmm_handle, "mciDriverYield"); - mmioStringToFOURCCA_orig = (mmioStringToFOURCCA_type)::GetProcAddress(winmm_handle, "mmioStringToFOURCCA"); - mmioStringToFOURCCW_orig = (mmioStringToFOURCCW_type)::GetProcAddress(winmm_handle, "mmioStringToFOURCCW"); - mmioInstallIOProcA_orig = (mmioInstallIOProcA_type)::GetProcAddress(winmm_handle, "mmioInstallIOProcA"); - mmioInstallIOProcW_orig = (mmioInstallIOProcW_type)::GetProcAddress(winmm_handle, "mmioInstallIOProcW"); - mmioOpenA_orig = (mmioOpenA_type)::GetProcAddress(winmm_handle, "mmioOpenA"); - mmioOpenW_orig = (mmioOpenW_type)::GetProcAddress(winmm_handle, "mmioOpenW"); - mmioRenameA_orig = (mmioRenameA_type)::GetProcAddress(winmm_handle, "mmioRenameA"); - mmioRenameW_orig = (mmioRenameW_type)::GetProcAddress(winmm_handle, "mmioRenameW"); - mmioClose_orig = (mmioClose_type)::GetProcAddress(winmm_handle, "mmioClose"); - mmioRead_orig = (mmioRead_type)::GetProcAddress(winmm_handle, "mmioRead"); - mmioWrite_orig = (mmioWrite_type)::GetProcAddress(winmm_handle, "mmioWrite"); - mmioSeek_orig = (mmioSeek_type)::GetProcAddress(winmm_handle, "mmioSeek"); - mmioGetInfo_orig = (mmioGetInfo_type)::GetProcAddress(winmm_handle, "mmioGetInfo"); - mmioSetInfo_orig = (mmioSetInfo_type)::GetProcAddress(winmm_handle, "mmioSetInfo"); - mmioSetBuffer_orig = (mmioSetBuffer_type)::GetProcAddress(winmm_handle, "mmioSetBuffer"); - mmioFlush_orig = (mmioFlush_type)::GetProcAddress(winmm_handle, "mmioFlush"); - mmioAdvance_orig = (mmioAdvance_type)::GetProcAddress(winmm_handle, "mmioAdvance"); - mmioSendMessage_orig = (mmioSendMessage_type)::GetProcAddress(winmm_handle, "mmioSendMessage"); - mmioDescend_orig = (mmioDescend_type)::GetProcAddress(winmm_handle, "mmioDescend"); - mmioAscend_orig = (mmioAscend_type)::GetProcAddress(winmm_handle, "mmioAscend"); - mmioCreateChunk_orig = (mmioCreateChunk_type)::GetProcAddress(winmm_handle, "mmioCreateChunk"); - mciSendCommandA_orig = (mciSendCommandA_type)::GetProcAddress(winmm_handle, "mciSendCommandA"); - mciSendCommandW_orig = (mciSendCommandW_type)::GetProcAddress(winmm_handle, "mciSendCommandW"); - mciSendStringA_orig = (mciSendStringA_type)::GetProcAddress(winmm_handle, "mciSendStringA"); - mciSendStringW_orig = (mciSendStringW_type)::GetProcAddress(winmm_handle, "mciSendStringW"); - mciGetDeviceIDA_orig = (mciGetDeviceIDA_type)::GetProcAddress(winmm_handle, "mciGetDeviceIDA"); - mciGetDeviceIDW_orig = (mciGetDeviceIDW_type)::GetProcAddress(winmm_handle, "mciGetDeviceIDW"); - mciGetDeviceIDFromElementIDA_orig = (mciGetDeviceIDFromElementIDA_type)::GetProcAddress(winmm_handle, "mciGetDeviceIDFromElementIDA"); - mciGetDeviceIDFromElementIDW_orig = (mciGetDeviceIDFromElementIDW_type)::GetProcAddress(winmm_handle, "mciGetDeviceIDFromElementIDW"); - mciGetDriverData_orig = (mciGetDriverData_type)::GetProcAddress(winmm_handle, "mciGetDriverData"); - mciGetErrorStringA_orig = (mciGetErrorStringA_type)::GetProcAddress(winmm_handle, "mciGetErrorStringA"); - mciGetErrorStringW_orig = (mciGetErrorStringW_type)::GetProcAddress(winmm_handle, "mciGetErrorStringW"); - mciSetDriverData_orig = (mciSetDriverData_type)::GetProcAddress(winmm_handle, "mciSetDriverData"); - mciSetYieldProc_orig = (mciSetYieldProc_type)::GetProcAddress(winmm_handle, "mciSetYieldProc"); - mciFreeCommandResource_orig = (mciFreeCommandResource_type)::GetProcAddress(winmm_handle, "mciFreeCommandResource"); - mciGetCreatorTask_orig = (mciGetCreatorTask_type)::GetProcAddress(winmm_handle, "mciGetCreatorTask"); - mciGetYieldProc_orig = (mciGetYieldProc_type)::GetProcAddress(winmm_handle, "mciGetYieldProc"); - mciLoadCommandResource_orig = (mciLoadCommandResource_type)::GetProcAddress(winmm_handle, "mciLoadCommandResource"); - mciExecute_orig = (mciExecute_type)::GetProcAddress(winmm_handle, "mciExecute"); -} - -extern "C" { - LRESULT WINAPI CloseDriver( HDRVR hDriver, LPARAM lParam1, LPARAM lParam2) - { - ll_winmm_shim_initialize(); - //OutputDebugString(L"CloseDriver\n"); - return CloseDriver_orig( hDriver, lParam1, lParam2); - } - - HDRVR WINAPI OpenDriver( LPCWSTR szDriverName, LPCWSTR szSectionName, LPARAM lParam2) - { - ll_winmm_shim_initialize(); - //OutputDebugString(L"OpenDriver\n"); - return OpenDriver_orig( szDriverName, szSectionName, lParam2); - } - - LRESULT WINAPI SendDriverMessage( HDRVR hDriver, UINT message, LPARAM lParam1, LPARAM lParam2) - { - ll_winmm_shim_initialize(); - //OutputDebugString(L"SendDriverMessage\n"); - return SendDriverMessage_orig( hDriver, message, lParam1, lParam2); - } - - HMODULE WINAPI DrvGetModuleHandle( HDRVR hDriver) - { - ll_winmm_shim_initialize(); - //OutputDebugString(L"DrvGetModuleHandle\n"); - return DrvGetModuleHandle_orig( hDriver); - } - - HMODULE WINAPI GetDriverModuleHandle( HDRVR hDriver) - { - ll_winmm_shim_initialize(); - //OutputDebugString(L"GetDriverModuleHandle\n"); - return GetDriverModuleHandle_orig( hDriver); - } - - LRESULT WINAPI DefDriverProc( DWORD_PTR dwDriverIdentifier, HDRVR hdrvr, UINT uMsg, LPARAM lParam1, LPARAM lParam2) - { - ll_winmm_shim_initialize(); - //OutputDebugString(L"DefDriverProc\n"); - return DefDriverProc_orig( dwDriverIdentifier, hdrvr, uMsg, lParam1, lParam2); - } - - BOOL WINAPI DriverCallback( DWORD dwCallBack, DWORD dwFlags, HDRVR hdrvr, DWORD msg, DWORD dwUser, DWORD dwParam1, DWORD dwParam2) - { - ll_winmm_shim_initialize(); - //OutputDebugString(L"DriverCallback\n"); - return DriverCallback_orig(dwCallBack, dwFlags, hdrvr, msg, dwUser, dwParam1, dwParam2); - } - - UINT WINAPI mmsystemGetVersion(void) - { - ll_winmm_shim_initialize(); - //OutputDebugString(L"mmsystemGetVersion\n"); - return mmsystemGetVersion_orig(); - } - - BOOL WINAPI sndPlaySoundA( LPCSTR pszSound, UINT fuSound) - { - ll_winmm_shim_initialize(); - //OutputDebugString(L"sndPlaySoundA\n"); - return sndPlaySoundA_orig( pszSound, fuSound); - } - - BOOL WINAPI sndPlaySoundW( LPCWSTR pszSound, UINT fuSound) - { - ll_winmm_shim_initialize(); - //OutputDebugString(L"sndPlaySoundW\n"); - return sndPlaySoundW_orig( pszSound, fuSound); - } - - BOOL WINAPI PlaySoundA( LPCSTR pszSound, HMODULE hmod, DWORD fdwSound) - { - ll_winmm_shim_initialize(); - //OutputDebugString(L"PlaySoundA\n"); - return PlaySoundA_orig( pszSound, hmod, fdwSound); - } - - BOOL WINAPI PlaySoundW( LPCWSTR pszSound, HMODULE hmod, DWORD fdwSound) - { - ll_winmm_shim_initialize(); - //OutputDebugString(L"PlaySoundW\n"); - return PlaySoundW_orig( pszSound, hmod, fdwSound); - } - - UINT WINAPI waveOutGetNumDevs(void) - { - ll_winmm_shim_initialize(); - //OutputDebugString(L"waveOutGetNumDevs\n"); - return waveOutGetNumDevs_orig(); - } - - MMRESULT WINAPI waveOutGetDevCapsA( UINT_PTR uDeviceID, LPWAVEOUTCAPSA pwoc, UINT cbwoc) - { - ll_winmm_shim_initialize(); - //OutputDebugString(L"waveOutGetDevCapsA\n"); - return waveOutGetDevCapsA_orig( uDeviceID, pwoc, cbwoc); - } - - MMRESULT WINAPI waveOutGetDevCapsW( UINT_PTR uDeviceID, LPWAVEOUTCAPSW pwoc, UINT cbwoc) - { - ll_winmm_shim_initialize(); - //OutputDebugString(L"waveOutGetDevCapsW\n"); - return waveOutGetDevCapsW_orig( uDeviceID, pwoc, cbwoc); - } - - - MMRESULT WINAPI waveOutGetVolume( HWAVEOUT hwo, LPDWORD pdwVolume) - { - ll_winmm_shim_initialize(); - //OutputDebugString(L"waveOutGetVolume\n"); - return waveOutGetVolume_orig( hwo, pdwVolume); - } - - MMRESULT WINAPI waveOutSetVolume( HWAVEOUT hwo, DWORD dwVolume) - { - ll_winmm_shim_initialize(); - //OutputDebugString(L"waveOutSetVolume\n"); - return waveOutSetVolume_orig( hwo, dwVolume); - } - - MMRESULT WINAPI waveOutGetErrorTextA( MMRESULT mmrError, LPSTR pszText, UINT cchText) - { - ll_winmm_shim_initialize(); - //OutputDebugString(L"waveOutGetErrorTextA\n"); - return waveOutGetErrorTextA_orig( mmrError, pszText, cchText); - } - - MMRESULT WINAPI waveOutGetErrorTextW( MMRESULT mmrError, LPWSTR pszText, UINT cchText) - { - ll_winmm_shim_initialize(); - //OutputDebugString(L"waveOutGetErrorTextW\n"); - return waveOutGetErrorTextW_orig( mmrError, pszText, cchText); - } - - //MMRESULT WINAPI waveOutOpen( LPHWAVEOUT phwo, UINT uDeviceID, LPCWAVEFORMATEX pwfx, DWORD_PTR dwCallback, DWORD_PTR dwInstance, DWORD fdwOpen) - //{ - // //OutputDebugString(L"waveOutGetErrorTextW\n"); - // return waveOutOpen_orig( phwo, uDeviceID, pwfx, dwCallback, dwInstance, fdwOpen); - //} - - //MMRESULT WINAPI waveOutClose( HWAVEOUT hwo) - //{ - // //OutputDebugString(L"waveOutGetErrorTextW\n"); - // return waveOutClose_orig( hwo ); - //} - - MMRESULT WINAPI waveOutPrepareHeader( HWAVEOUT hwo, LPWAVEHDR pwh, UINT cbwh) - { - ll_winmm_shim_initialize(); - //OutputDebugString(L"waveOutPrepareHeader\n"); - return waveOutPrepareHeader_orig( hwo, pwh, cbwh); - } - - MMRESULT WINAPI waveOutUnprepareHeader( HWAVEOUT hwo, LPWAVEHDR pwh, UINT cbwh) - { - ll_winmm_shim_initialize(); - //OutputDebugString(L"waveOutUnprepareHeader\n"); - return waveOutUnprepareHeader_orig( hwo, pwh, cbwh); - } - - - //MMRESULT WINAPI waveOutWrite( HWAVEOUT hwo, LPWAVEHDR pwh, UINT cbwh) - //{ - // //OutputDebugString(L"waveOutUnprepareHeader\n"); - // return waveOutWrite_orig( hwo, pwh, cbwh); - //} - - MMRESULT WINAPI waveOutPause( HWAVEOUT hwo) - { - ll_winmm_shim_initialize(); - //OutputDebugString(L"waveOutPause\n"); - return waveOutPause_orig( hwo); - } - - MMRESULT WINAPI waveOutRestart( HWAVEOUT hwo) - { - ll_winmm_shim_initialize(); - //OutputDebugString(L"waveOutRestart\n"); - return waveOutRestart_orig( hwo); - } - - MMRESULT WINAPI waveOutReset( HWAVEOUT hwo) - { - ll_winmm_shim_initialize(); - //OutputDebugString(L"waveOutReset\n"); - return waveOutReset_orig( hwo); - } - - MMRESULT WINAPI waveOutBreakLoop( HWAVEOUT hwo) - { - ll_winmm_shim_initialize(); - //OutputDebugString(L"waveOutBreakLoop\n"); - return waveOutBreakLoop_orig( hwo); - } - - MMRESULT WINAPI waveOutGetPosition( HWAVEOUT hwo, LPMMTIME pmmt, UINT cbmmt) - { - ll_winmm_shim_initialize(); - //OutputDebugString(L"waveOutGetPosition\n"); - return waveOutGetPosition_orig( hwo, pmmt, cbmmt); - } - - MMRESULT WINAPI waveOutGetPitch( HWAVEOUT hwo, LPDWORD pdwPitch) - { - ll_winmm_shim_initialize(); - //OutputDebugString(L"waveOutGetPitch\n"); - return waveOutGetPitch_orig( hwo, pdwPitch); - } - - MMRESULT WINAPI waveOutSetPitch( HWAVEOUT hwo, DWORD dwPitch) - { - ll_winmm_shim_initialize(); - //OutputDebugString(L"waveOutSetPitch\n"); - return waveOutSetPitch_orig( hwo, dwPitch); - } - - MMRESULT WINAPI waveOutGetPlaybackRate( HWAVEOUT hwo, LPDWORD pdwRate) - { - ll_winmm_shim_initialize(); - //OutputDebugString(L"waveOutGetPlaybackRate\n"); - return waveOutGetPlaybackRate_orig( hwo, pdwRate); - } - - MMRESULT WINAPI waveOutSetPlaybackRate( HWAVEOUT hwo, DWORD dwRate) - { - ll_winmm_shim_initialize(); - //OutputDebugString(L"waveOutSetPlaybackRate\n"); - return waveOutSetPlaybackRate_orig( hwo, dwRate); - } - - MMRESULT WINAPI waveOutGetID( HWAVEOUT hwo, LPUINT puDeviceID) - { - ll_winmm_shim_initialize(); - //OutputDebugString(L"waveOutGetID\n"); - return waveOutGetID_orig( hwo, puDeviceID); - } - - MMRESULT WINAPI waveOutMessage( HWAVEOUT hwo, UINT uMsg, DWORD_PTR dw1, DWORD_PTR dw2) - { - ll_winmm_shim_initialize(); - //OutputDebugString(L"waveOutMessage\n"); - return waveOutMessage_orig( hwo, uMsg, dw1, dw2); - } - - UINT WINAPI waveInGetNumDevs(void) - { - ll_winmm_shim_initialize(); - //OutputDebugString(L"waveInGetNumDevs\n"); - return waveInGetNumDevs_orig(); - } - - MMRESULT WINAPI waveInGetDevCapsA( UINT_PTR uDeviceID, LPWAVEINCAPSA pwic, UINT cbwic) - { - ll_winmm_shim_initialize(); - //OutputDebugString(L"waveInGetDevCapsA\n"); - return waveInGetDevCapsA_orig( uDeviceID, pwic, cbwic); - } - - MMRESULT WINAPI waveInGetDevCapsW( UINT_PTR uDeviceID, LPWAVEINCAPSW pwic, UINT cbwic) - { - ll_winmm_shim_initialize(); - //OutputDebugString(L"waveInGetDevCapsW\n"); - return waveInGetDevCapsW_orig( uDeviceID, pwic, cbwic); - } - - MMRESULT WINAPI waveInGetErrorTextA(MMRESULT mmrError, LPSTR pszText, UINT cchText) - { - ll_winmm_shim_initialize(); - //OutputDebugString(L"waveInGetErrorTextA\n"); - return waveInGetErrorTextA_orig(mmrError, pszText, cchText); - } - - MMRESULT WINAPI waveInGetErrorTextW(MMRESULT mmrError, LPWSTR pszText, UINT cchText) - { - ll_winmm_shim_initialize(); - //OutputDebugString(L"waveInGetErrorTextW\n"); - return waveInGetErrorTextW_orig(mmrError, pszText, cchText); - } - - MMRESULT WINAPI waveInOpen( LPHWAVEIN phwi, UINT uDeviceID, LPCWAVEFORMATEX pwfx, DWORD_PTR dwCallback, DWORD_PTR dwInstance, DWORD fdwOpen) - { - ll_winmm_shim_initialize(); - //OutputDebugString(L"waveInOpen\n"); - return waveInOpen_orig(phwi, uDeviceID, pwfx, dwCallback, dwInstance, fdwOpen); - } - - MMRESULT WINAPI waveInClose( HWAVEIN hwi) - { - ll_winmm_shim_initialize(); - //OutputDebugString(L"waveInClose\n"); - return waveInClose_orig( hwi); - } - - MMRESULT WINAPI waveInPrepareHeader( HWAVEIN hwi, LPWAVEHDR pwh, UINT cbwh) - { - ll_winmm_shim_initialize(); - //OutputDebugString(L"waveInPrepareHeader\n"); - return waveInPrepareHeader_orig( hwi, pwh, cbwh); - } - - MMRESULT WINAPI waveInUnprepareHeader( HWAVEIN hwi, LPWAVEHDR pwh, UINT cbwh) - { - ll_winmm_shim_initialize(); - //OutputDebugString(L"waveInUnprepareHeader\n"); - return waveInUnprepareHeader_orig( hwi, pwh, cbwh); - } - - MMRESULT WINAPI waveInAddBuffer( HWAVEIN hwi, LPWAVEHDR pwh, UINT cbwh) - { - ll_winmm_shim_initialize(); - //OutputDebugString(L"waveInAddBuffer\n"); - return waveInAddBuffer_orig( hwi, pwh, cbwh); - } - - MMRESULT WINAPI waveInStart( HWAVEIN hwi) - { - ll_winmm_shim_initialize(); - //OutputDebugString(L"waveInStart\n"); - return waveInStart_orig( hwi); - } - - MMRESULT WINAPI waveInStop( HWAVEIN hwi) - { - ll_winmm_shim_initialize(); - //OutputDebugString(L"waveInStop\n"); - return waveInStop_orig(hwi); - } - - MMRESULT WINAPI waveInReset( HWAVEIN hwi) - { - ll_winmm_shim_initialize(); - //OutputDebugString(L"waveInReset\n"); - return waveInReset_orig(hwi); - } - - MMRESULT WINAPI waveInGetPosition( HWAVEIN hwi, LPMMTIME pmmt, UINT cbmmt) - { - ll_winmm_shim_initialize(); - //OutputDebugString(L"waveInGetPosition\n"); - return waveInGetPosition_orig( hwi, pmmt, cbmmt); - } - - MMRESULT WINAPI waveInGetID( HWAVEIN hwi, LPUINT puDeviceID) - { - ll_winmm_shim_initialize(); - //OutputDebugString(L"waveInGetID\n"); - return waveInGetID_orig( hwi, puDeviceID); - } - - MMRESULT WINAPI waveInMessage( HWAVEIN hwi, UINT uMsg, DWORD_PTR dw1, DWORD_PTR dw2) - { - ll_winmm_shim_initialize(); - //OutputDebugString(L"waveInMessage\n"); - return waveInMessage_orig( hwi, uMsg, dw1, dw2); - } - - UINT WINAPI midiOutGetNumDevs(void) - { - ll_winmm_shim_initialize(); - //OutputDebugString(L"midiOutGetNumDevs\n"); - return midiOutGetNumDevs_orig(); - } - - MMRESULT WINAPI midiStreamOpen( LPHMIDISTRM phms, LPUINT puDeviceID, DWORD cMidi, DWORD_PTR dwCallback, DWORD_PTR dwInstance, DWORD fdwOpen) - { - ll_winmm_shim_initialize(); - //OutputDebugString(L"midiStreamOpen\n"); - return midiStreamOpen_orig( phms, puDeviceID, cMidi, dwCallback, dwInstance, fdwOpen); - } - - MMRESULT WINAPI midiStreamClose( HMIDISTRM hms) - { - ll_winmm_shim_initialize(); - //OutputDebugString(L"midiStreamClose\n"); - return midiStreamClose_orig( hms); - } - - MMRESULT WINAPI midiStreamProperty( HMIDISTRM hms, LPBYTE lppropdata, DWORD dwProperty) - { - ll_winmm_shim_initialize(); - //OutputDebugString(L"midiStreamProperty\n"); - return midiStreamProperty_orig( hms, lppropdata, dwProperty); - } - - MMRESULT WINAPI midiStreamPosition( HMIDISTRM hms, LPMMTIME lpmmt, UINT cbmmt) - { - ll_winmm_shim_initialize(); - //OutputDebugString(L"midiStreamPosition\n"); - return midiStreamPosition_orig( hms, lpmmt, cbmmt); - } - - MMRESULT WINAPI midiStreamOut( HMIDISTRM hms, LPMIDIHDR pmh, UINT cbmh) - { - ll_winmm_shim_initialize(); - //OutputDebugString(L"midiStreamOut\n"); - return midiStreamOut_orig( hms, pmh, cbmh); - } - - MMRESULT WINAPI midiStreamPause( HMIDISTRM hms) - { - ll_winmm_shim_initialize(); - //OutputDebugString(L"midiStreamPause\n"); - return midiStreamPause_orig( hms); - } - - MMRESULT WINAPI midiStreamRestart( HMIDISTRM hms) - { - ll_winmm_shim_initialize(); - //OutputDebugString(L"midiStreamRestart\n"); - return midiStreamRestart_orig( hms); - } - - MMRESULT WINAPI midiStreamStop( HMIDISTRM hms) - { - ll_winmm_shim_initialize(); - //OutputDebugString(L"midiStreamStop\n"); - return midiStreamStop_orig( hms); - } - - MMRESULT WINAPI midiConnect( HMIDI hmi, HMIDIOUT hmo, LPVOID pReserved) - { - ll_winmm_shim_initialize(); - //OutputDebugString(L"midiConnect\n"); - return midiConnect_orig( hmi, hmo, pReserved); - } - - MMRESULT WINAPI midiDisconnect( HMIDI hmi, HMIDIOUT hmo, LPVOID pReserved) - { - ll_winmm_shim_initialize(); - //OutputDebugString(L"midiDisconnect\n"); - return midiDisconnect_orig( hmi, hmo, pReserved); - } - - MMRESULT WINAPI midiOutGetDevCapsA( UINT_PTR uDeviceID, LPMIDIOUTCAPSA pmoc, UINT cbmoc) - { - ll_winmm_shim_initialize(); - //OutputDebugString(L"midiOutGetDevCapsA\n"); - return midiOutGetDevCapsA_orig( uDeviceID, pmoc, cbmoc); - } - - MMRESULT WINAPI midiOutGetDevCapsW( UINT_PTR uDeviceID, LPMIDIOUTCAPSW pmoc, UINT cbmoc) - { - ll_winmm_shim_initialize(); - //OutputDebugString(L"midiOutGetDevCapsW\n"); - return midiOutGetDevCapsW_orig( uDeviceID, pmoc, cbmoc); - } - - MMRESULT WINAPI midiOutGetVolume( HMIDIOUT hmo, LPDWORD pdwVolume) - { - ll_winmm_shim_initialize(); - //OutputDebugString(L"midiOutGetVolume\n"); - return midiOutGetVolume_orig( hmo, pdwVolume); - } - - MMRESULT WINAPI midiOutSetVolume( HMIDIOUT hmo, DWORD dwVolume) - { - ll_winmm_shim_initialize(); - //OutputDebugString(L"midiOutSetVolume\n"); - return midiOutSetVolume_orig( hmo, dwVolume); - } - - MMRESULT WINAPI midiOutGetErrorTextA( MMRESULT mmrError, LPSTR pszText, UINT cchText) - { - ll_winmm_shim_initialize(); - //OutputDebugString(L"midiOutGetErrorTextA\n"); - return midiOutGetErrorTextA_orig( mmrError, pszText, cchText); - } - - MMRESULT WINAPI midiOutGetErrorTextW( MMRESULT mmrError, LPWSTR pszText, UINT cchText) - { - ll_winmm_shim_initialize(); - //OutputDebugString(L"midiOutGetErrorTextW\n"); - return midiOutGetErrorTextW_orig( mmrError, pszText, cchText); - } - - MMRESULT WINAPI midiOutOpen( LPHMIDIOUT phmo, UINT uDeviceID, DWORD_PTR dwCallback, DWORD_PTR dwInstance, DWORD fdwOpen) - { - ll_winmm_shim_initialize(); - //OutputDebugString(L"midiOutOpen\n"); - return midiOutOpen_orig(phmo, uDeviceID, dwCallback, dwInstance, fdwOpen); - } - - MMRESULT WINAPI midiOutClose( HMIDIOUT hmo) - { - ll_winmm_shim_initialize(); - //OutputDebugString(L"midiOutClose\n"); - return midiOutClose_orig( hmo); - } - - MMRESULT WINAPI midiOutPrepareHeader( HMIDIOUT hmo, LPMIDIHDR pmh, UINT cbmh) - { - ll_winmm_shim_initialize(); - //OutputDebugString(L"midiOutPrepareHeader\n"); - return midiOutPrepareHeader_orig( hmo, pmh, cbmh); - } - - MMRESULT WINAPI midiOutUnprepareHeader(HMIDIOUT hmo, LPMIDIHDR pmh, UINT cbmh) - { - ll_winmm_shim_initialize(); - //OutputDebugString(L"midiOutUnprepareHeader\n"); - return midiOutUnprepareHeader_orig(hmo, pmh, cbmh); - } - - MMRESULT WINAPI midiOutShortMsg( HMIDIOUT hmo, DWORD dwMsg) - { - ll_winmm_shim_initialize(); - //OutputDebugString(L"midiOutShortMsg\n"); - return midiOutShortMsg_orig( hmo, dwMsg); - } - - MMRESULT WINAPI midiOutLongMsg(HMIDIOUT hmo, LPMIDIHDR pmh, UINT cbmh) - { - ll_winmm_shim_initialize(); - //OutputDebugString(L"midiOutLongMsg\n"); - return midiOutLongMsg_orig(hmo, pmh, cbmh); - } - - MMRESULT WINAPI midiOutReset( HMIDIOUT hmo) - { - ll_winmm_shim_initialize(); - //OutputDebugString(L"midiOutReset\n"); - return midiOutReset_orig( hmo); - } - - MMRESULT WINAPI midiOutCachePatches( HMIDIOUT hmo, UINT uBank, LPWORD pwpa, UINT fuCache) - { - ll_winmm_shim_initialize(); - //OutputDebugString(L"midiOutCachePatches\n"); - return midiOutCachePatches_orig( hmo, uBank, pwpa, fuCache); - } - - MMRESULT WINAPI midiOutCacheDrumPatches( HMIDIOUT hmo, UINT uPatch, LPWORD pwkya, UINT fuCache) - { - ll_winmm_shim_initialize(); - //OutputDebugString(L"midiOutCacheDrumPatches\n"); - return midiOutCacheDrumPatches_orig( hmo, uPatch, pwkya, fuCache); - } - - MMRESULT WINAPI midiOutGetID( HMIDIOUT hmo, LPUINT puDeviceID) - { - ll_winmm_shim_initialize(); - //OutputDebugString(L"midiOutGetID\n"); - return midiOutGetID_orig( hmo, puDeviceID); - } - - MMRESULT WINAPI midiOutMessage( HMIDIOUT hmo, UINT uMsg, DWORD_PTR dw1, DWORD_PTR dw2) - { - ll_winmm_shim_initialize(); - //OutputDebugString(L"midiOutMessage\n"); - return midiOutMessage_orig( hmo, uMsg, dw1, dw2); - } - - UINT WINAPI midiInGetNumDevs(void) - { - ll_winmm_shim_initialize(); - //OutputDebugString(L"midiInGetNumDevs\n"); - return midiInGetNumDevs_orig(); - } - - MMRESULT WINAPI midiInGetDevCapsA( UINT_PTR uDeviceID, LPMIDIINCAPSA pmic, UINT cbmic) - { - ll_winmm_shim_initialize(); - //OutputDebugString(L"midiInGetDevCapsA\n"); - return midiInGetDevCapsA_orig( uDeviceID, pmic, cbmic); - } - - MMRESULT WINAPI midiInGetDevCapsW( UINT_PTR uDeviceID, LPMIDIINCAPSW pmic, UINT cbmic) - { - ll_winmm_shim_initialize(); - //OutputDebugString(L"midiInGetDevCapsW\n"); - return midiInGetDevCapsW_orig( uDeviceID, pmic, cbmic); - } - - MMRESULT WINAPI midiInGetErrorTextA( MMRESULT mmrError, LPSTR pszText, UINT cchText) - { - ll_winmm_shim_initialize(); - //OutputDebugString(L"midiInGetErrorTextA\n"); - return midiInGetErrorTextA_orig( mmrError, pszText, cchText); - } - - MMRESULT WINAPI midiInGetErrorTextW( MMRESULT mmrError, LPWSTR pszText, UINT cchText) - { - ll_winmm_shim_initialize(); - //OutputDebugString(L"midiInGetErrorTextW\n"); - return midiInGetErrorTextW_orig( mmrError, pszText, cchText); - } - - MMRESULT WINAPI midiInOpen( LPHMIDIIN phmi, UINT uDeviceID, DWORD_PTR dwCallback, DWORD_PTR dwInstance, DWORD fdwOpen) - { - ll_winmm_shim_initialize(); - //OutputDebugString(L"midiInOpen\n"); - return midiInOpen_orig(phmi, uDeviceID, dwCallback, dwInstance, fdwOpen); - } - - MMRESULT WINAPI midiInClose( HMIDIIN hmi) - { - ll_winmm_shim_initialize(); - //OutputDebugString(L"midiInClose\n"); - return midiInClose_orig( hmi); - } - - MMRESULT WINAPI midiInPrepareHeader( HMIDIIN hmi, LPMIDIHDR pmh, UINT cbmh) - { - ll_winmm_shim_initialize(); - //OutputDebugString(L"midiInPrepareHeader\n"); - return midiInPrepareHeader_orig( hmi, pmh, cbmh); - } - - MMRESULT WINAPI midiInUnprepareHeader( HMIDIIN hmi, LPMIDIHDR pmh, UINT cbmh) - { - ll_winmm_shim_initialize(); - //OutputDebugString(L"midiInUnprepareHeader\n"); - return midiInUnprepareHeader_orig( hmi, pmh, cbmh); - } - - MMRESULT WINAPI midiInAddBuffer( HMIDIIN hmi, LPMIDIHDR pmh, UINT cbmh) - { - ll_winmm_shim_initialize(); - //OutputDebugString(L"midiInAddBuffer\n"); - return midiInAddBuffer_orig( hmi, pmh, cbmh); - } - - MMRESULT WINAPI midiInStart( HMIDIIN hmi) - { - ll_winmm_shim_initialize(); - //OutputDebugString(L"midiInStart\n"); - return midiInStart_orig( hmi); - } - - MMRESULT WINAPI midiInStop( HMIDIIN hmi) - { - ll_winmm_shim_initialize(); - //OutputDebugString(L"midiInStop\n"); - return midiInStop_orig(hmi); - } - - MMRESULT WINAPI midiInReset( HMIDIIN hmi) - { - ll_winmm_shim_initialize(); - //OutputDebugString(L"midiInReset\n"); - return midiInReset_orig( hmi); - } - - MMRESULT WINAPI midiInGetID( HMIDIIN hmi, LPUINT puDeviceID) - { - ll_winmm_shim_initialize(); - //OutputDebugString(L"midiInGetID\n"); - return midiInGetID_orig( hmi, puDeviceID); - } - - MMRESULT WINAPI midiInMessage( HMIDIIN hmi, UINT uMsg, DWORD_PTR dw1, DWORD_PTR dw2) - { - ll_winmm_shim_initialize(); - //OutputDebugString(L"midiInMessage\n"); - return midiInMessage_orig( hmi, uMsg, dw1, dw2); - } - - UINT WINAPI auxGetNumDevs(void) - { - ll_winmm_shim_initialize(); - //OutputDebugString(L"auxGetNumDevs\n"); - return auxGetNumDevs_orig(); - } - - MMRESULT WINAPI auxGetDevCapsA( UINT_PTR uDeviceID, LPAUXCAPSA pac, UINT cbac) - { - ll_winmm_shim_initialize(); - //OutputDebugString(L"auxGetDevCapsA\n"); - return auxGetDevCapsA_orig( uDeviceID, pac, cbac); - } - - MMRESULT WINAPI auxGetDevCapsW( UINT_PTR uDeviceID, LPAUXCAPSW pac, UINT cbac) - { - ll_winmm_shim_initialize(); - //OutputDebugString(L"auxGetDevCapsW\n"); - return auxGetDevCapsW_orig( uDeviceID, pac, cbac); - } - - MMRESULT WINAPI auxSetVolume( UINT uDeviceID, DWORD dwVolume) - { - ll_winmm_shim_initialize(); - //OutputDebugString(L"auxSetVolume\n"); - return auxSetVolume_orig( uDeviceID, dwVolume); - } - - MMRESULT WINAPI auxGetVolume( UINT uDeviceID, LPDWORD pdwVolume) - { - ll_winmm_shim_initialize(); - //OutputDebugString(L"auxGetVolume\n"); - return auxGetVolume_orig( uDeviceID, pdwVolume); - } - - MMRESULT WINAPI auxOutMessage( UINT uDeviceID, UINT uMsg, DWORD_PTR dw1, DWORD_PTR dw2) - { - ll_winmm_shim_initialize(); - //OutputDebugString(L"auxOutMessage\n"); - return auxOutMessage_orig( uDeviceID, uMsg, dw1, dw2); - } - - UINT WINAPI mixerGetNumDevs(void) - { - ll_winmm_shim_initialize(); - //OutputDebugString(L"mixerGetNumDevs\n"); - return mixerGetNumDevs_orig(); - } - - MMRESULT WINAPI mixerGetDevCapsA( UINT_PTR uMxId, LPMIXERCAPSA pmxcaps, UINT cbmxcaps) - { - ll_winmm_shim_initialize(); - //OutputDebugString(L"mixerGetDevCapsA\n"); - return mixerGetDevCapsA_orig( uMxId, pmxcaps, cbmxcaps); - } - - MMRESULT WINAPI mixerGetDevCapsW( UINT_PTR uMxId, LPMIXERCAPSW pmxcaps, UINT cbmxcaps) - { - ll_winmm_shim_initialize(); - //OutputDebugString(L"mixerGetDevCapsW\n"); - return mixerGetDevCapsW_orig( uMxId, pmxcaps, cbmxcaps); - } - - MMRESULT WINAPI mixerOpen( LPHMIXER phmx, UINT uMxId, DWORD_PTR dwCallback, DWORD_PTR dwInstance, DWORD fdwOpen) - { - ll_winmm_shim_initialize(); - //OutputDebugString(L"mixerOpen\n"); - return mixerOpen_orig( phmx, uMxId, dwCallback, dwInstance, fdwOpen); - } - - MMRESULT WINAPI mixerClose( HMIXER hmx) - { - ll_winmm_shim_initialize(); - //OutputDebugString(L"mixerClose\n"); - return mixerClose_orig( hmx); - } - - DWORD WINAPI mixerMessage( HMIXER hmx, UINT uMsg, DWORD_PTR dwParam1, DWORD_PTR dwParam2) - { - ll_winmm_shim_initialize(); - //OutputDebugString(L"mixerMessage\n"); - return mixerMessage_orig( hmx, uMsg, dwParam1, dwParam2); - } - - MMRESULT WINAPI mixerGetLineInfoA( HMIXEROBJ hmxobj, LPMIXERLINEA pmxl, DWORD fdwInfo) - { - ll_winmm_shim_initialize(); - //OutputDebugString(L"mixerGetLineInfoA\n"); - return mixerGetLineInfoA_orig( hmxobj, pmxl, fdwInfo); - } - - MMRESULT WINAPI mixerGetLineInfoW( HMIXEROBJ hmxobj, LPMIXERLINEW pmxl, DWORD fdwInfo) - { - ll_winmm_shim_initialize(); - //OutputDebugString(L"mixerGetLineInfoW\n"); - return mixerGetLineInfoW_orig( hmxobj, pmxl, fdwInfo); - } - - MMRESULT WINAPI mixerGetID( HMIXEROBJ hmxobj, UINT FAR *puMxId, DWORD fdwId) - { - ll_winmm_shim_initialize(); - //OutputDebugString(L"mixerGetID\n"); - return mixerGetID_orig( hmxobj, puMxId, fdwId); - } - - MMRESULT WINAPI mixerGetLineControlsA( HMIXEROBJ hmxobj, LPMIXERLINECONTROLSA pmxlc, DWORD fdwControls) - { - ll_winmm_shim_initialize(); - //OutputDebugString(L"mixerGetLineControlsA\n"); - return mixerGetLineControlsA_orig( hmxobj, pmxlc, fdwControls); - } - - MMRESULT WINAPI mixerGetLineControlsW( HMIXEROBJ hmxobj, LPMIXERLINECONTROLSW pmxlc, DWORD fdwControls) - { - ll_winmm_shim_initialize(); - //OutputDebugString(L"mixerGetLineControlsW\n"); - return mixerGetLineControlsW_orig( hmxobj, pmxlc, fdwControls); - } - - MMRESULT WINAPI mixerGetControlDetailsA( HMIXEROBJ hmxobj, LPMIXERCONTROLDETAILS pmxcd, DWORD fdwDetails) - { - ll_winmm_shim_initialize(); - //OutputDebugString(L"mixerGetControlDetailsA\n"); - return mixerGetControlDetailsA_orig( hmxobj, pmxcd, fdwDetails); - } - - MMRESULT WINAPI mixerGetControlDetailsW( HMIXEROBJ hmxobj, LPMIXERCONTROLDETAILS pmxcd, DWORD fdwDetails) - { - ll_winmm_shim_initialize(); - //OutputDebugString(L"mixerGetControlDetailsW\n"); - return mixerGetControlDetailsW_orig( hmxobj, pmxcd, fdwDetails); - } - - MMRESULT WINAPI mixerSetControlDetails( HMIXEROBJ hmxobj, LPMIXERCONTROLDETAILS pmxcd, DWORD fdwDetails) - { - ll_winmm_shim_initialize(); - //OutputDebugString(L"mixerSetControlDetails\n"); - return mixerSetControlDetails_orig( hmxobj, pmxcd, fdwDetails); - } - - DWORD WINAPI mmGetCurrentTask(void) - { - ll_winmm_shim_initialize(); - //OutputDebugString(L"mmGetCurrentTask\n"); - return mmGetCurrentTask_orig(); - } - - void WINAPI mmTaskBlock(DWORD val) - { - ll_winmm_shim_initialize(); - //OutputDebugString(L"mmTaskBlock\n"); - return mmTaskBlock_orig(val); - } - - UINT WINAPI mmTaskCreate(LPTASKCALLBACK a, HANDLE* b, DWORD_PTR c) - { - ll_winmm_shim_initialize(); - //OutputDebugString(L"mmTaskCreate\n"); - return mmTaskCreate_orig(a, b, c); - } - - BOOL WINAPI mmTaskSignal(DWORD a) - { - ll_winmm_shim_initialize(); - //OutputDebugString(L"mmTaskSignal\n"); - return mmTaskSignal_orig(a); - } - - VOID WINAPI mmTaskYield() - { - ll_winmm_shim_initialize(); - //OutputDebugString(L"mmTaskYield\n"); - mmTaskYield_orig(); - } - - MMRESULT WINAPI timeGetSystemTime( LPMMTIME pmmt, UINT cbmmt) - { - ll_winmm_shim_initialize(); - //OutputDebugString(L"timeGetSystemTime\n"); - return timeGetSystemTime_orig( pmmt, cbmmt); - } - - DWORD WINAPI timeGetTime(void) - { - ll_winmm_shim_initialize(); - //OutputDebugString(L"timeGetTime\n"); - return timeGetTime_orig(); - } - - MMRESULT WINAPI timeSetEvent( UINT uDelay, UINT uResolution, LPTIMECALLBACK fptc, DWORD_PTR dwUser, UINT fuEvent) - { - ll_winmm_shim_initialize(); - //OutputDebugString(L"timeSetEvent\n"); - return timeSetEvent_orig(uDelay, uResolution, fptc, dwUser, fuEvent); - } - - MMRESULT WINAPI timeKillEvent( UINT uTimerID) - { - ll_winmm_shim_initialize(); - //OutputDebugString(L"timeKillEvent\n"); - return timeKillEvent_orig( uTimerID); - } - - MMRESULT WINAPI timeGetDevCaps( LPTIMECAPS ptc, UINT cbtc) - { - ll_winmm_shim_initialize(); - //OutputDebugString(L"timeGetDevCaps\n"); - return timeGetDevCaps_orig( ptc, cbtc); - } - - MMRESULT WINAPI timeBeginPeriod( UINT uPeriod) - { - ll_winmm_shim_initialize(); - //OutputDebugString(L"timeBeginPeriod\n"); - return timeBeginPeriod_orig( uPeriod); - } - - MMRESULT WINAPI timeEndPeriod( UINT uPeriod) - { - ll_winmm_shim_initialize(); - //OutputDebugString(L"timeEndPeriod\n"); - return timeEndPeriod_orig( uPeriod); - } - - UINT WINAPI joyGetNumDevs(void) - { - ll_winmm_shim_initialize(); - //OutputDebugString(L"joyGetNumDevs\n"); - return joyGetNumDevs_orig(); - } - - MMRESULT WINAPI joyConfigChanged(DWORD dwFlags) - { - ll_winmm_shim_initialize(); - //OutputDebugString(L"joyConfigChanged\n"); - return joyConfigChanged_orig(dwFlags); - } - - MMRESULT WINAPI joyGetDevCapsA( UINT_PTR uJoyID, LPJOYCAPSA pjc, UINT cbjc) - { - ll_winmm_shim_initialize(); - //OutputDebugString(L"joyGetDevCapsA\n"); - return joyGetDevCapsA_orig( uJoyID, pjc, cbjc); - } - - MMRESULT WINAPI joyGetDevCapsW( UINT_PTR uJoyID, LPJOYCAPSW pjc, UINT cbjc) - { - ll_winmm_shim_initialize(); - //OutputDebugString(L"joyGetDevCapsW\n"); - return joyGetDevCapsW_orig( uJoyID, pjc, cbjc); - } - - MMRESULT WINAPI joyGetPos( UINT uJoyID, LPJOYINFO pji) - { - ll_winmm_shim_initialize(); - //OutputDebugString(L"joyGetPos\n"); - return joyGetPos_orig( uJoyID, pji); - } - - MMRESULT WINAPI joyGetPosEx( UINT uJoyID, LPJOYINFOEX pji) - { - ll_winmm_shim_initialize(); - //OutputDebugString(L"joyGetPosEx\n"); - return joyGetPosEx_orig( uJoyID, pji); - } - - MMRESULT WINAPI joyGetThreshold( UINT uJoyID, LPUINT puThreshold) - { - ll_winmm_shim_initialize(); - //OutputDebugString(L"joyGetThreshold\n"); - return joyGetThreshold_orig( uJoyID, puThreshold); - } - - MMRESULT WINAPI joyReleaseCapture( UINT uJoyID) - { - ll_winmm_shim_initialize(); - //OutputDebugString(L"joyReleaseCapture\n"); - return joyReleaseCapture_orig( uJoyID); - } - - MMRESULT WINAPI joySetCapture( HWND hwnd, UINT uJoyID, UINT uPeriod, BOOL fChanged) - { - ll_winmm_shim_initialize(); - //OutputDebugString(L"joySetCapture\n"); - return joySetCapture_orig(hwnd, uJoyID, uPeriod, fChanged); - } - - MMRESULT WINAPI joySetThreshold( UINT uJoyID, UINT uThreshold) - { - ll_winmm_shim_initialize(); - //OutputDebugString(L"joySetThreshold\n"); - return joySetThreshold_orig( uJoyID, uThreshold); - } - - BOOL WINAPI mciDriverNotify(HANDLE hwndCallback, MCIDEVICEID uDeviceID, UINT uStatus) - { - ll_winmm_shim_initialize(); - //OutputDebugString(L"mciDriverNotify\n"); - return mciDriverNotify_orig(hwndCallback, uDeviceID, uStatus); - } - - UINT WINAPI mciDriverYield(UINT uDeviceID) - { - ll_winmm_shim_initialize(); - //OutputDebugString(L"mciDriverYield\n"); - return mciDriverYield_orig(uDeviceID); - } - - FOURCC WINAPI mmioStringToFOURCCA( LPCSTR sz, UINT uFlags) - { - ll_winmm_shim_initialize(); - //OutputDebugString(L"mmioStringToFOURCCA\n"); - return mmioStringToFOURCCA_orig( sz, uFlags); - } - - FOURCC WINAPI mmioStringToFOURCCW( LPCWSTR sz, UINT uFlags) - { - ll_winmm_shim_initialize(); - //OutputDebugString(L"mmioStringToFOURCCW\n"); - return mmioStringToFOURCCW_orig( sz, uFlags); - } - - LPMMIOPROC WINAPI mmioInstallIOProcA( FOURCC fccIOProc, LPMMIOPROC pIOProc, DWORD dwFlags) - { - ll_winmm_shim_initialize(); - //OutputDebugString(L"mmioInstallIOProcA\n"); - return mmioInstallIOProcA_orig( fccIOProc, pIOProc, dwFlags); - } - - LPMMIOPROC WINAPI mmioInstallIOProcW( FOURCC fccIOProc, LPMMIOPROC pIOProc, DWORD dwFlags) - { - ll_winmm_shim_initialize(); - //OutputDebugString(L"mmioInstallIOProcW\n"); - return mmioInstallIOProcW_orig( fccIOProc, pIOProc, dwFlags); - } - - HMMIO WINAPI mmioOpenA( LPSTR pszFileName, LPMMIOINFO pmmioinfo, DWORD fdwOpen) - { - ll_winmm_shim_initialize(); - //OutputDebugString(L"mmioOpenA\n"); - return mmioOpenA_orig( pszFileName, pmmioinfo, fdwOpen); - } - - HMMIO WINAPI mmioOpenW( LPWSTR pszFileName, LPMMIOINFO pmmioinfo, DWORD fdwOpen) - { - ll_winmm_shim_initialize(); - //OutputDebugString(L"mmioOpenW\n"); - return mmioOpenW_orig( pszFileName, pmmioinfo, fdwOpen); - } - - MMRESULT WINAPI mmioRenameA( LPCSTR pszFileName, LPCSTR pszNewFileName, LPCMMIOINFO pmmioinfo, DWORD fdwRename) - { - ll_winmm_shim_initialize(); - //OutputDebugString(L"mmioRenameA\n"); - return mmioRenameA_orig( pszFileName, pszNewFileName, pmmioinfo, fdwRename); - } - - MMRESULT WINAPI mmioRenameW( LPCWSTR pszFileName, LPCWSTR pszNewFileName, LPCMMIOINFO pmmioinfo, DWORD fdwRename) - { - ll_winmm_shim_initialize(); - //OutputDebugString(L"mmioRenameW\n"); - return mmioRenameW_orig( pszFileName, pszNewFileName, pmmioinfo, fdwRename); - } - - MMRESULT WINAPI mmioClose( HMMIO hmmio, UINT fuClose) - { - ll_winmm_shim_initialize(); - //OutputDebugString(L"mmioClose\n"); - return mmioClose_orig( hmmio, fuClose); - } - - LONG WINAPI mmioRead( HMMIO hmmio, HPSTR pch, LONG cch) - { - ll_winmm_shim_initialize(); - //OutputDebugString(L"mmioRead\n"); - return mmioRead_orig( hmmio, pch, cch); - } - - LONG WINAPI mmioWrite( HMMIO hmmio, const char _huge* pch, LONG cch) - { - ll_winmm_shim_initialize(); - //OutputDebugString(L"mmioWrite\n"); - return mmioWrite_orig( hmmio, pch, cch); - } - - LONG WINAPI mmioSeek( HMMIO hmmio, LONG lOffset, int iOrigin) - { - ll_winmm_shim_initialize(); - //OutputDebugString(L"mmioSeek\n"); - return mmioSeek_orig(hmmio, lOffset, iOrigin); - } - - MMRESULT WINAPI mmioGetInfo( HMMIO hmmio, LPMMIOINFO pmmioinfo, UINT fuInfo) - { - ll_winmm_shim_initialize(); - //OutputDebugString(L"mmioGetInfo\n"); - return mmioGetInfo_orig( hmmio, pmmioinfo, fuInfo); - } - - MMRESULT WINAPI mmioSetInfo( HMMIO hmmio, LPCMMIOINFO pmmioinfo, UINT fuInfo) - { - ll_winmm_shim_initialize(); - //OutputDebugString(L"mmioSetInfo\n"); - return mmioSetInfo_orig( hmmio, pmmioinfo, fuInfo); - } - - MMRESULT WINAPI mmioSetBuffer( HMMIO hmmio, LPSTR pchBuffer, LONG cchBuffer, UINT fuBuffer) - { - ll_winmm_shim_initialize(); - //OutputDebugString(L"mmioSetBuffer\n"); - return mmioSetBuffer_orig(hmmio, pchBuffer, cchBuffer, fuBuffer); - } - - MMRESULT WINAPI mmioFlush( HMMIO hmmio, UINT fuFlush) - { - ll_winmm_shim_initialize(); - //OutputDebugString(L"mmioFlush\n"); - return mmioFlush_orig( hmmio, fuFlush); - } - - MMRESULT WINAPI mmioAdvance( HMMIO hmmio, LPMMIOINFO pmmioinfo, UINT fuAdvance) - { - ll_winmm_shim_initialize(); - //OutputDebugString(L"mmioAdvance\n"); - return mmioAdvance_orig( hmmio, pmmioinfo, fuAdvance); - } - - LRESULT WINAPI mmioSendMessage( HMMIO hmmio, UINT uMsg, LPARAM lParam1, LPARAM lParam2) - { - ll_winmm_shim_initialize(); - //OutputDebugString(L"mmioSendMessage\n"); - return mmioSendMessage_orig(hmmio, uMsg, lParam1, lParam2); - } - - MMRESULT WINAPI mmioDescend( HMMIO hmmio, LPMMCKINFO pmmcki, const MMCKINFO FAR* pmmckiParent, UINT fuDescend) - { - ll_winmm_shim_initialize(); - //OutputDebugString(L"mmioDescend\n"); - return mmioDescend_orig(hmmio, pmmcki, pmmckiParent, fuDescend); - } - - MMRESULT WINAPI mmioAscend( HMMIO hmmio, LPMMCKINFO pmmcki, UINT fuAscend) - { - ll_winmm_shim_initialize(); - //OutputDebugString(L"mmioAscend\n"); - return mmioAscend_orig( hmmio, pmmcki, fuAscend); - } - - MMRESULT WINAPI mmioCreateChunk(HMMIO hmmio, LPMMCKINFO pmmcki, UINT fuCreate) - { - ll_winmm_shim_initialize(); - //OutputDebugString(L"mmioCreateChunk\n"); - return mmioCreateChunk_orig(hmmio, pmmcki, fuCreate); - } - - MCIERROR WINAPI mciSendCommandA( MCIDEVICEID mciId, UINT uMsg, DWORD_PTR dwParam1, DWORD_PTR dwParam2) - { - ll_winmm_shim_initialize(); - //OutputDebugString(L"mciSendCommandA\n"); - return mciSendCommandA_orig( mciId, uMsg, dwParam1, dwParam2); - } - - MCIERROR WINAPI mciSendCommandW( MCIDEVICEID mciId, UINT uMsg, DWORD_PTR dwParam1, DWORD_PTR dwParam2) - { - ll_winmm_shim_initialize(); - //OutputDebugString(L"mciSendCommandW\n"); - return mciSendCommandW_orig( mciId, uMsg, dwParam1, dwParam2); - } - - MCIERROR WINAPI mciSendStringA( LPCSTR lpstrCommand, LPSTR lpstrReturnString, UINT uReturnLength, HWND hwndCallback) - { - ll_winmm_shim_initialize(); - //OutputDebugString(L"mciSendStringA\n"); - return mciSendStringA_orig( lpstrCommand, lpstrReturnString, uReturnLength, hwndCallback); - } - - MCIERROR WINAPI mciSendStringW( LPCWSTR lpstrCommand, LPWSTR lpstrReturnString, UINT uReturnLength, HWND hwndCallback) - { - ll_winmm_shim_initialize(); - //OutputDebugString(L"mciSendStringW\n"); - return mciSendStringW_orig( lpstrCommand, lpstrReturnString, uReturnLength, hwndCallback); - } - - MCIDEVICEID WINAPI mciGetDeviceIDA( LPCSTR pszDevice) - { - //OutputDebugString(L"mciGetDeviceIDA\n"); - return mciGetDeviceIDA_orig( pszDevice); - } - - MCIDEVICEID WINAPI mciGetDeviceIDW( LPCWSTR pszDevice) - { - ll_winmm_shim_initialize(); - //OutputDebugString(L"mciGetDeviceIDW\n"); - return mciGetDeviceIDW_orig( pszDevice); - } - - MCIDEVICEID WINAPI mciGetDeviceIDFromElementIDA( DWORD dwElementID, LPCSTR lpstrType ) - { - ll_winmm_shim_initialize(); - //OutputDebugString(L"mciGetDeviceIDFromElementIDA\n"); - return mciGetDeviceIDFromElementIDA_orig( dwElementID, lpstrType ); - } - - MCIDEVICEID WINAPI mciGetDeviceIDFromElementIDW( DWORD dwElementID, LPCWSTR lpstrType ) - { - ll_winmm_shim_initialize(); - //OutputDebugString(L"mciGetDeviceIDFromElementIDW\n"); - return mciGetDeviceIDFromElementIDW_orig( dwElementID, lpstrType ); - } - - DWORD_PTR WINAPI mciGetDriverData(UINT uDeviceID) - { - ll_winmm_shim_initialize(); - //OutputDebugString(L"mciGetDriverData\n"); - return mciGetDriverData_orig(uDeviceID); - } - - BOOL WINAPI mciGetErrorStringA( MCIERROR mcierr, LPSTR pszText, UINT cchText) - { - ll_winmm_shim_initialize(); - //OutputDebugString(L"mciGetErrorStringA\n"); - return mciGetErrorStringA_orig( mcierr, pszText, cchText); - } - - BOOL WINAPI mciGetErrorStringW( MCIERROR mcierr, LPWSTR pszText, UINT cchText) - { - ll_winmm_shim_initialize(); - //OutputDebugString(L"mciGetErrorStringW\n"); - return mciGetErrorStringW_orig( mcierr, pszText, cchText); - } - - BOOL WINAPI mciSetDriverData(UINT uDeviceID, DWORD_PTR dwData) - { - ll_winmm_shim_initialize(); - //OutputDebugString(L"mciSetDriverData_type\n"); - return mciSetDriverData_orig( uDeviceID, dwData ); - } - - BOOL WINAPI mciSetYieldProc( MCIDEVICEID mciId, YIELDPROC fpYieldProc, DWORD dwYieldData) - { - ll_winmm_shim_initialize(); - //OutputDebugString(L"mciSetYieldProc\n"); - return mciSetYieldProc_orig(mciId, fpYieldProc, dwYieldData); - } - - BOOL WINAPI mciFreeCommandResource(UINT uTable) - { - ll_winmm_shim_initialize(); - //OutputDebugString(L"mciFreeCommandResource\n"); - return mciFreeCommandResource_orig(uTable); - } - - HTASK WINAPI mciGetCreatorTask( MCIDEVICEID mciId) - { - ll_winmm_shim_initialize(); - //OutputDebugString(L"mciGetCreatorTask\n"); - return mciGetCreatorTask_orig( mciId); - } - - YIELDPROC WINAPI mciGetYieldProc( MCIDEVICEID mciId, LPDWORD pdwYieldData) - { - ll_winmm_shim_initialize(); - //OutputDebugString(L"mciGetYieldProc\n"); - return mciGetYieldProc_orig( mciId, pdwYieldData); - } - - UINT WINAPI mciLoadCommandResource(HANDLE hInstance, LPCWSTR lpResName, UINT uType) - { - ll_winmm_shim_initialize(); - //OutputDebugString(L"mciLoadCommandResource"); - return mciLoadCommandResource_orig(hInstance, lpResName, uType); - } - - - BOOL WINAPI mciExecute(LPCSTR pszCommand) - { - ll_winmm_shim_initialize(); - //OutputDebugString(L"mciExecute\n"); - return mciExecute_orig(pszCommand); - } -} diff --git a/indra/media_plugins/winmmshim/forwarding_api.h b/indra/media_plugins/winmmshim/forwarding_api.h deleted file mode 100644 index 1418fc9e1d..0000000000 --- a/indra/media_plugins/winmmshim/forwarding_api.h +++ /dev/null @@ -1,390 +0,0 @@ -/** - * @file forwarding_api.h - * @brief forwards winmm API calls to real winmm.dll - * - * $LicenseInfo:firstyear=2010&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$ - */ - -// this turns off __declspec(dllimport) for the functions declared in mmsystem.h -#define _WINMM_ -#include <windows.h> -#include <mmsystem.h> - -void init_function_pointers(HMODULE winmm_handle); -void ll_winmm_shim_initialize(); - -typedef VOID (*LPTASKCALLBACK)(DWORD_PTR dwInst); - -typedef LRESULT (WINAPI *CloseDriver_type)( HDRVR hDriver, LPARAM lParam1, LPARAM lParam2); -extern CloseDriver_type CloseDriver_orig; -typedef HDRVR (WINAPI *OpenDriver_type)( LPCWSTR szDriverName, LPCWSTR szSectionName, LPARAM lParam2); -extern OpenDriver_type OpenDriver_orig; -typedef LRESULT (WINAPI *SendDriverMessage_type)( HDRVR hDriver, UINT message, LPARAM lParam1, LPARAM lParam2); -extern SendDriverMessage_type SendDriverMessage_orig; -typedef HMODULE (WINAPI *DrvGetModuleHandle_type)( HDRVR hDriver); -extern DrvGetModuleHandle_type DrvGetModuleHandle_orig; -typedef HMODULE (WINAPI *GetDriverModuleHandle_type)( HDRVR hDriver); -extern GetDriverModuleHandle_type GetDriverModuleHandle_orig; -typedef LRESULT (WINAPI *DefDriverProc_type)( DWORD_PTR dwDriverIdentifier, HDRVR hdrvr, UINT uMsg, LPARAM lParam1, LPARAM lParam2); -extern DefDriverProc_type DefDriverProc_orig; -typedef BOOL (WINAPI *DriverCallback_type)(DWORD dwCallBack, DWORD dwFlags, HDRVR hdrvr, DWORD msg, DWORD dwUser, DWORD dwParam1, DWORD dwParam2); -extern DriverCallback_type DriverCallback_orig; -typedef UINT (WINAPI *mmsystemGetVersion_type)(void); -extern mmsystemGetVersion_type mmsystemGetVersion_orig; -typedef BOOL (WINAPI *sndPlaySoundA_type)( LPCSTR pszSound, UINT fuSound); -extern sndPlaySoundA_type sndPlaySoundA_orig; -typedef BOOL (WINAPI *sndPlaySoundW_type)( LPCWSTR pszSound, UINT fuSound); -extern sndPlaySoundW_type sndPlaySoundW_orig; -typedef BOOL (WINAPI *PlaySoundA_type)( LPCSTR pszSound, HMODULE hmod, DWORD fdwSound); -extern PlaySoundA_type PlaySoundA_orig; -typedef BOOL (WINAPI *PlaySoundW_type)( LPCWSTR pszSound, HMODULE hmod, DWORD fdwSound); -extern PlaySoundW_type PlaySoundW_orig; -typedef UINT (WINAPI *waveOutGetNumDevs_type)(void); -extern waveOutGetNumDevs_type waveOutGetNumDevs_orig; -typedef MMRESULT (WINAPI *waveOutGetDevCapsA_type)( UINT_PTR uDeviceID, LPWAVEOUTCAPSA pwoc, UINT cbwoc); -extern waveOutGetDevCapsA_type waveOutGetDevCapsA_orig; -typedef MMRESULT (WINAPI *waveOutGetDevCapsW_type)( UINT_PTR uDeviceID, LPWAVEOUTCAPSW pwoc, UINT cbwoc); -extern waveOutGetDevCapsW_type waveOutGetDevCapsW_orig; -typedef MMRESULT (WINAPI *waveOutGetVolume_type)( HWAVEOUT hwo, LPDWORD pdwVolume); -extern waveOutGetVolume_type waveOutGetVolume_orig; -typedef MMRESULT (WINAPI *waveOutSetVolume_type)( HWAVEOUT hwo, DWORD dwVolume); -extern waveOutSetVolume_type waveOutSetVolume_orig; -typedef MMRESULT (WINAPI *waveOutGetErrorTextA_type)( MMRESULT mmrError, LPSTR pszText, UINT cchText); -extern waveOutGetErrorTextA_type waveOutGetErrorTextA_orig; -typedef MMRESULT (WINAPI *waveOutGetErrorTextW_type)( MMRESULT mmrError, LPWSTR pszText, UINT cchText); -extern waveOutGetErrorTextW_type waveOutGetErrorTextW_orig; -typedef MMRESULT (WINAPI *waveOutOpen_type)( LPHWAVEOUT phwo, UINT uDeviceID, LPCWAVEFORMATEX pwfx, DWORD_PTR dwCallback, DWORD_PTR dwInstance, DWORD fdwOpen); -extern waveOutOpen_type waveOutOpen_orig; -typedef MMRESULT (WINAPI *waveOutClose_type)( HWAVEOUT hwo); -extern waveOutClose_type waveOutClose_orig; -typedef MMRESULT (WINAPI *waveOutPrepareHeader_type)( HWAVEOUT hwo, LPWAVEHDR pwh, UINT cbwh); -extern waveOutPrepareHeader_type waveOutPrepareHeader_orig; -typedef MMRESULT (WINAPI *waveOutUnprepareHeader_type)( HWAVEOUT hwo, LPWAVEHDR pwh, UINT cbwh); -extern waveOutUnprepareHeader_type waveOutUnprepareHeader_orig; -typedef MMRESULT (WINAPI *waveOutWrite_type)( HWAVEOUT hwo, LPWAVEHDR pwh, UINT cbwh); -extern waveOutWrite_type waveOutWrite_orig; -typedef MMRESULT (WINAPI *waveOutPause_type)( HWAVEOUT hwo); -extern waveOutPause_type waveOutPause_orig; -typedef MMRESULT (WINAPI *waveOutRestart_type)( HWAVEOUT hwo); -extern waveOutRestart_type waveOutRestart_orig; -typedef MMRESULT (WINAPI *waveOutReset_type)( HWAVEOUT hwo); -extern waveOutReset_type waveOutReset_orig; -typedef MMRESULT (WINAPI *waveOutBreakLoop_type)( HWAVEOUT hwo); -extern waveOutBreakLoop_type waveOutBreakLoop_orig; -typedef MMRESULT (WINAPI *waveOutGetPosition_type)( HWAVEOUT hwo, LPMMTIME pmmt, UINT cbmmt); -extern waveOutGetPosition_type waveOutGetPosition_orig; -typedef MMRESULT (WINAPI *waveOutGetPitch_type)( HWAVEOUT hwo, LPDWORD pdwPitch); -extern waveOutGetPitch_type waveOutGetPitch_orig; -typedef MMRESULT (WINAPI *waveOutSetPitch_type)( HWAVEOUT hwo, DWORD dwPitch); -extern waveOutSetPitch_type waveOutSetPitch_orig; -typedef MMRESULT (WINAPI *waveOutGetPlaybackRate_type)( HWAVEOUT hwo, LPDWORD pdwRate); -extern waveOutGetPlaybackRate_type waveOutGetPlaybackRate_orig; -typedef MMRESULT (WINAPI *waveOutSetPlaybackRate_type)( HWAVEOUT hwo, DWORD dwRate); -extern waveOutSetPlaybackRate_type waveOutSetPlaybackRate_orig; -typedef MMRESULT (WINAPI *waveOutGetID_type)( HWAVEOUT hwo, LPUINT puDeviceID); -extern waveOutGetID_type waveOutGetID_orig; -typedef MMRESULT (WINAPI *waveOutMessage_type)( HWAVEOUT hwo, UINT uMsg, DWORD_PTR dw1, DWORD_PTR dw2); -extern waveOutMessage_type waveOutMessage_orig; -typedef UINT (WINAPI *waveInGetNumDevs_type)(void); -extern waveInGetNumDevs_type waveInGetNumDevs_orig; -typedef MMRESULT (WINAPI *waveInGetDevCapsA_type)( UINT_PTR uDeviceID, LPWAVEINCAPSA pwic, UINT cbwic); -extern waveInGetDevCapsA_type waveInGetDevCapsA_orig; -typedef MMRESULT (WINAPI *waveInGetDevCapsW_type)( UINT_PTR uDeviceID, LPWAVEINCAPSW pwic, UINT cbwic); -extern waveInGetDevCapsW_type waveInGetDevCapsW_orig; -typedef MMRESULT (WINAPI *waveInGetErrorTextA_type)(MMRESULT mmrError, LPSTR pszText, UINT cchText); -extern waveInGetErrorTextA_type waveInGetErrorTextA_orig; -typedef MMRESULT (WINAPI *waveInGetErrorTextW_type)(MMRESULT mmrError, LPWSTR pszText, UINT cchText); -extern waveInGetErrorTextW_type waveInGetErrorTextW_orig; -typedef MMRESULT (WINAPI *waveInOpen_type)( LPHWAVEIN phwi, UINT uDeviceID, LPCWAVEFORMATEX pwfx, DWORD_PTR dwCallback, DWORD_PTR dwInstance, DWORD fdwOpen); -extern waveInOpen_type waveInOpen_orig; -typedef MMRESULT (WINAPI *waveInClose_type)( HWAVEIN hwi); -extern waveInClose_type waveInClose_orig; -typedef MMRESULT (WINAPI *waveInPrepareHeader_type)( HWAVEIN hwi, LPWAVEHDR pwh, UINT cbwh); -extern waveInPrepareHeader_type waveInPrepareHeader_orig; -typedef MMRESULT (WINAPI *waveInUnprepareHeader_type)( HWAVEIN hwi, LPWAVEHDR pwh, UINT cbwh); -extern waveInUnprepareHeader_type waveInUnprepareHeader_orig; -typedef MMRESULT (WINAPI *waveInAddBuffer_type)( HWAVEIN hwi, LPWAVEHDR pwh, UINT cbwh); -extern waveInAddBuffer_type waveInAddBuffer_orig; -typedef MMRESULT (WINAPI *waveInStart_type)( HWAVEIN hwi); -extern waveInStart_type waveInStart_orig; -typedef MMRESULT (WINAPI *waveInStop_type)( HWAVEIN hwi); -extern waveInStop_type waveInStop_orig; -typedef MMRESULT (WINAPI *waveInReset_type)( HWAVEIN hwi); -extern waveInReset_type waveInReset_orig; -typedef MMRESULT (WINAPI *waveInGetPosition_type)( HWAVEIN hwi, LPMMTIME pmmt, UINT cbmmt); -extern waveInGetPosition_type waveInGetPosition_orig; -typedef MMRESULT (WINAPI *waveInGetID_type)( HWAVEIN hwi, LPUINT puDeviceID); -extern waveInGetID_type waveInGetID_orig; -typedef MMRESULT (WINAPI *waveInMessage_type)( HWAVEIN hwi, UINT uMsg, DWORD_PTR dw1, DWORD_PTR dw2); -extern waveInMessage_type waveInMessage_orig; -typedef UINT (WINAPI *midiOutGetNumDevs_type)(void); -extern midiOutGetNumDevs_type midiOutGetNumDevs_orig; -typedef MMRESULT (WINAPI *midiStreamOpen_type)( LPHMIDISTRM phms, LPUINT puDeviceID, DWORD cMidi, DWORD_PTR dwCallback, DWORD_PTR dwInstance, DWORD fdwOpen); -extern midiStreamOpen_type midiStreamOpen_orig; -typedef MMRESULT (WINAPI *midiStreamClose_type)( HMIDISTRM hms); -extern midiStreamClose_type midiStreamClose_orig; -typedef MMRESULT (WINAPI *midiStreamProperty_type)( HMIDISTRM hms, LPBYTE lppropdata, DWORD dwProperty); -extern midiStreamProperty_type midiStreamProperty_orig; -typedef MMRESULT (WINAPI *midiStreamPosition_type)( HMIDISTRM hms, LPMMTIME lpmmt, UINT cbmmt); -extern midiStreamPosition_type midiStreamPosition_orig; -typedef MMRESULT (WINAPI *midiStreamOut_type)( HMIDISTRM hms, LPMIDIHDR pmh, UINT cbmh); -extern midiStreamOut_type midiStreamOut_orig; -typedef MMRESULT (WINAPI *midiStreamPause_type)( HMIDISTRM hms); -extern midiStreamPause_type midiStreamPause_orig; -typedef MMRESULT (WINAPI *midiStreamRestart_type)( HMIDISTRM hms); -extern midiStreamRestart_type midiStreamRestart_orig; -typedef MMRESULT (WINAPI *midiStreamStop_type)( HMIDISTRM hms); -extern midiStreamStop_type midiStreamStop_orig; -typedef MMRESULT (WINAPI *midiConnect_type)( HMIDI hmi, HMIDIOUT hmo, LPVOID pReserved); -extern midiConnect_type midiConnect_orig; -typedef MMRESULT (WINAPI *midiDisconnect_type)( HMIDI hmi, HMIDIOUT hmo, LPVOID pReserved); -extern midiDisconnect_type midiDisconnect_orig; -typedef MMRESULT (WINAPI *midiOutGetDevCapsA_type)( UINT_PTR uDeviceID, LPMIDIOUTCAPSA pmoc, UINT cbmoc); -extern midiOutGetDevCapsA_type midiOutGetDevCapsA_orig; -typedef MMRESULT (WINAPI *midiOutGetDevCapsW_type)( UINT_PTR uDeviceID, LPMIDIOUTCAPSW pmoc, UINT cbmoc); -extern midiOutGetDevCapsW_type midiOutGetDevCapsW_orig; -typedef MMRESULT (WINAPI *midiOutGetVolume_type)( HMIDIOUT hmo, LPDWORD pdwVolume); -extern midiOutGetVolume_type midiOutGetVolume_orig; -typedef MMRESULT (WINAPI *midiOutSetVolume_type)( HMIDIOUT hmo, DWORD dwVolume); -extern midiOutSetVolume_type midiOutSetVolume_orig; -typedef MMRESULT (WINAPI *midiOutGetErrorTextA_type)( MMRESULT mmrError, LPSTR pszText, UINT cchText); -extern midiOutGetErrorTextA_type midiOutGetErrorTextA_orig; -typedef MMRESULT (WINAPI *midiOutGetErrorTextW_type)( MMRESULT mmrError, LPWSTR pszText, UINT cchText); -extern midiOutGetErrorTextW_type midiOutGetErrorTextW_orig; -typedef MMRESULT (WINAPI *midiOutOpen_type)( LPHMIDIOUT phmo, UINT uDeviceID, DWORD_PTR dwCallback, DWORD_PTR dwInstance, DWORD fdwOpen); -extern midiOutOpen_type midiOutOpen_orig; -typedef MMRESULT (WINAPI *midiOutClose_type)( HMIDIOUT hmo); -extern midiOutClose_type midiOutClose_orig; -typedef MMRESULT (WINAPI *midiOutPrepareHeader_type)( HMIDIOUT hmo, LPMIDIHDR pmh, UINT cbmh); -extern midiOutPrepareHeader_type midiOutPrepareHeader_orig; -typedef MMRESULT (WINAPI *midiOutUnprepareHeader_type)(HMIDIOUT hmo, LPMIDIHDR pmh, UINT cbmh); -extern midiOutUnprepareHeader_type midiOutUnprepareHeader_orig; -typedef MMRESULT (WINAPI *midiOutShortMsg_type)( HMIDIOUT hmo, DWORD dwMsg); -extern midiOutShortMsg_type midiOutShortMsg_orig; -typedef MMRESULT (WINAPI *midiOutLongMsg_type)(HMIDIOUT hmo, LPMIDIHDR pmh, UINT cbmh); -extern midiOutLongMsg_type midiOutLongMsg_orig; -typedef MMRESULT (WINAPI *midiOutReset_type)( HMIDIOUT hmo); -extern midiOutReset_type midiOutReset_orig; -typedef MMRESULT (WINAPI *midiOutCachePatches_type)( HMIDIOUT hmo, UINT uBank, LPWORD pwpa, UINT fuCache); -extern midiOutCachePatches_type midiOutCachePatches_orig; -typedef MMRESULT (WINAPI *midiOutCacheDrumPatches_type)( HMIDIOUT hmo, UINT uPatch, LPWORD pwkya, UINT fuCache); -extern midiOutCacheDrumPatches_type midiOutCacheDrumPatches_orig; -typedef MMRESULT (WINAPI *midiOutGetID_type)( HMIDIOUT hmo, LPUINT puDeviceID); -extern midiOutGetID_type midiOutGetID_orig; -typedef MMRESULT (WINAPI *midiOutMessage_type)( HMIDIOUT hmo, UINT uMsg, DWORD_PTR dw1, DWORD_PTR dw2); -extern midiOutMessage_type midiOutMessage_orig; -typedef UINT (WINAPI *midiInGetNumDevs_type)(void); -extern midiInGetNumDevs_type midiInGetNumDevs_orig; -typedef MMRESULT (WINAPI *midiInGetDevCapsA_type)( UINT_PTR uDeviceID, LPMIDIINCAPSA pmic, UINT cbmic); -extern midiInGetDevCapsA_type midiInGetDevCapsA_orig; -typedef MMRESULT (WINAPI *midiInGetDevCapsW_type)( UINT_PTR uDeviceID, LPMIDIINCAPSW pmic, UINT cbmic); -extern midiInGetDevCapsW_type midiInGetDevCapsW_orig; -typedef MMRESULT (WINAPI *midiInGetErrorTextA_type)( MMRESULT mmrError, LPSTR pszText, UINT cchText); -extern midiInGetErrorTextA_type midiInGetErrorTextA_orig; -typedef MMRESULT (WINAPI *midiInGetErrorTextW_type)( MMRESULT mmrError, LPWSTR pszText, UINT cchText); -extern midiInGetErrorTextW_type midiInGetErrorTextW_orig; -typedef MMRESULT (WINAPI *midiInOpen_type)( LPHMIDIIN phmi, UINT uDeviceID, DWORD_PTR dwCallback, DWORD_PTR dwInstance, DWORD fdwOpen); -extern midiInOpen_type midiInOpen_orig; -typedef MMRESULT (WINAPI *midiInClose_type)( HMIDIIN hmi); -extern midiInClose_type midiInClose_orig; -typedef MMRESULT (WINAPI *midiInPrepareHeader_type)( HMIDIIN hmi, LPMIDIHDR pmh, UINT cbmh); -extern midiInPrepareHeader_type midiInPrepareHeader_orig; -typedef MMRESULT (WINAPI *midiInUnprepareHeader_type)( HMIDIIN hmi, LPMIDIHDR pmh, UINT cbmh); -extern midiInUnprepareHeader_type midiInUnprepareHeader_orig; -typedef MMRESULT (WINAPI *midiInAddBuffer_type)( HMIDIIN hmi, LPMIDIHDR pmh, UINT cbmh); -extern midiInAddBuffer_type midiInAddBuffer_orig; -typedef MMRESULT (WINAPI *midiInStart_type)( HMIDIIN hmi); -extern midiInStart_type midiInStart_orig; -typedef MMRESULT (WINAPI *midiInStop_type)( HMIDIIN hmi); -extern midiInStop_type midiInStop_orig; -typedef MMRESULT (WINAPI *midiInReset_type)( HMIDIIN hmi); -extern midiInReset_type midiInReset_orig; -typedef MMRESULT (WINAPI *midiInGetID_type)( HMIDIIN hmi, LPUINT puDeviceID); -extern midiInGetID_type midiInGetID_orig; -typedef MMRESULT (WINAPI *midiInMessage_type)( HMIDIIN hmi, UINT uMsg, DWORD_PTR dw1, DWORD_PTR dw2); -extern midiInMessage_type midiInMessage_orig; -typedef UINT (WINAPI *auxGetNumDevs_type)(void); -extern auxGetNumDevs_type auxGetNumDevs_orig; -typedef MMRESULT (WINAPI *auxGetDevCapsA_type)( UINT_PTR uDeviceID, LPAUXCAPSA pac, UINT cbac); -extern auxGetDevCapsA_type auxGetDevCapsA_orig; -typedef MMRESULT (WINAPI *auxGetDevCapsW_type)( UINT_PTR uDeviceID, LPAUXCAPSW pac, UINT cbac); -extern auxGetDevCapsW_type auxGetDevCapsW_orig; -typedef MMRESULT (WINAPI *auxSetVolume_type)( UINT uDeviceID, DWORD dwVolume); -extern auxSetVolume_type auxSetVolume_orig; -typedef MMRESULT (WINAPI *auxGetVolume_type)( UINT uDeviceID, LPDWORD pdwVolume); -extern auxGetVolume_type auxGetVolume_orig; -typedef MMRESULT (WINAPI *auxOutMessage_type)( UINT uDeviceID, UINT uMsg, DWORD_PTR dw1, DWORD_PTR dw2); -extern auxOutMessage_type auxOutMessage_orig; -typedef UINT (WINAPI *mixerGetNumDevs_type)(void); -extern mixerGetNumDevs_type mixerGetNumDevs_orig; -typedef MMRESULT (WINAPI *mixerGetDevCapsA_type)( UINT_PTR uMxId, LPMIXERCAPSA pmxcaps, UINT cbmxcaps); -extern mixerGetDevCapsA_type mixerGetDevCapsA_orig; -typedef MMRESULT (WINAPI *mixerGetDevCapsW_type)( UINT_PTR uMxId, LPMIXERCAPSW pmxcaps, UINT cbmxcaps); -extern mixerGetDevCapsW_type mixerGetDevCapsW_orig; -typedef MMRESULT (WINAPI *mixerOpen_type)( LPHMIXER phmx, UINT uMxId, DWORD_PTR dwCallback, DWORD_PTR dwInstance, DWORD fdwOpen); -extern mixerOpen_type mixerOpen_orig; -typedef MMRESULT (WINAPI *mixerClose_type)( HMIXER hmx); -extern mixerClose_type mixerClose_orig; -typedef DWORD (WINAPI *mixerMessage_type)( HMIXER hmx, UINT uMsg, DWORD_PTR dwParam1, DWORD_PTR dwParam2); -extern mixerMessage_type mixerMessage_orig; -typedef MMRESULT (WINAPI *mixerGetLineInfoA_type)( HMIXEROBJ hmxobj, LPMIXERLINEA pmxl, DWORD fdwInfo); -extern mixerGetLineInfoA_type mixerGetLineInfoA_orig; -typedef MMRESULT (WINAPI *mixerGetLineInfoW_type)( HMIXEROBJ hmxobj, LPMIXERLINEW pmxl, DWORD fdwInfo); -extern mixerGetLineInfoW_type mixerGetLineInfoW_orig; -typedef MMRESULT (WINAPI *mixerGetID_type)( HMIXEROBJ hmxobj, UINT FAR *puMxId, DWORD fdwId); -extern mixerGetID_type mixerGetID_orig; -typedef MMRESULT (WINAPI *mixerGetLineControlsA_type)( HMIXEROBJ hmxobj, LPMIXERLINECONTROLSA pmxlc, DWORD fdwControls); -extern mixerGetLineControlsA_type mixerGetLineControlsA_orig; -typedef MMRESULT (WINAPI *mixerGetLineControlsW_type)( HMIXEROBJ hmxobj, LPMIXERLINECONTROLSW pmxlc, DWORD fdwControls); -extern mixerGetLineControlsW_type mixerGetLineControlsW_orig; -typedef MMRESULT (WINAPI *mixerGetControlDetailsA_type)( HMIXEROBJ hmxobj, LPMIXERCONTROLDETAILS pmxcd, DWORD fdwDetails); -extern mixerGetControlDetailsA_type mixerGetControlDetailsA_orig; -typedef MMRESULT (WINAPI *mixerGetControlDetailsW_type)( HMIXEROBJ hmxobj, LPMIXERCONTROLDETAILS pmxcd, DWORD fdwDetails); -extern mixerGetControlDetailsW_type mixerGetControlDetailsW_orig; -typedef MMRESULT (WINAPI *mixerSetControlDetails_type)( HMIXEROBJ hmxobj, LPMIXERCONTROLDETAILS pmxcd, DWORD fdwDetails); -extern mixerSetControlDetails_type mixerSetControlDetails_orig; -typedef DWORD (WINAPI *mmGetCurrentTask_type)(void); -extern mmGetCurrentTask_type mmGetCurrentTask_orig; -typedef void (WINAPI *mmTaskBlock_type)(DWORD); -extern mmTaskBlock_type mmTaskBlock_orig; -typedef UINT (WINAPI *mmTaskCreate_type)(LPTASKCALLBACK, HANDLE*, DWORD_PTR); -extern mmTaskCreate_type mmTaskCreate_orig; -typedef BOOL (WINAPI *mmTaskSignal_type)(DWORD); -extern mmTaskSignal_type mmTaskSignal_orig; -typedef VOID (WINAPI *mmTaskYield_type)(VOID); -extern mmTaskYield_type mmTaskYield_orig; -typedef MMRESULT (WINAPI *timeGetSystemTime_type)( LPMMTIME pmmt, UINT cbmmt); -extern timeGetSystemTime_type timeGetSystemTime_orig; -typedef DWORD (WINAPI *timeGetTime_type)(void); -extern timeGetTime_type timeGetTime_orig; -typedef MMRESULT (WINAPI *timeSetEvent_type)( UINT uDelay, UINT uResolution, LPTIMECALLBACK fptc, DWORD_PTR dwUser, UINT fuEvent); -extern timeSetEvent_type timeSetEvent_orig; -typedef MMRESULT (WINAPI *timeKillEvent_type)( UINT uTimerID); -extern timeKillEvent_type timeKillEvent_orig; -typedef MMRESULT (WINAPI *timeGetDevCaps_type)( LPTIMECAPS ptc, UINT cbtc); -extern timeGetDevCaps_type timeGetDevCaps_orig; -typedef MMRESULT (WINAPI *timeBeginPeriod_type)( UINT uPeriod); -extern timeBeginPeriod_type timeBeginPeriod_orig; -typedef MMRESULT (WINAPI *timeEndPeriod_type)( UINT uPeriod); -extern timeEndPeriod_type timeEndPeriod_orig; -typedef UINT (WINAPI *joyGetNumDevs_type)(void); -extern joyGetNumDevs_type joyGetNumDevs_orig; -typedef MMRESULT (WINAPI *joyConfigChanged_type)(DWORD dwFlags); -extern joyConfigChanged_type joyConfigChanged_orig; -typedef MMRESULT (WINAPI *joyGetDevCapsA_type)( UINT_PTR uJoyID, LPJOYCAPSA pjc, UINT cbjc); -extern joyGetDevCapsA_type joyGetDevCapsA_orig; -typedef MMRESULT (WINAPI *joyGetDevCapsW_type)( UINT_PTR uJoyID, LPJOYCAPSW pjc, UINT cbjc); -extern joyGetDevCapsW_type joyGetDevCapsW_orig; -typedef MMRESULT (WINAPI *joyGetPos_type)( UINT uJoyID, LPJOYINFO pji); -extern joyGetPos_type joyGetPos_orig; -typedef MMRESULT (WINAPI *joyGetPosEx_type)( UINT uJoyID, LPJOYINFOEX pji); -extern joyGetPosEx_type joyGetPosEx_orig; -typedef MMRESULT (WINAPI *joyGetThreshold_type)( UINT uJoyID, LPUINT puThreshold); -extern joyGetThreshold_type joyGetThreshold_orig; -typedef MMRESULT (WINAPI *joyReleaseCapture_type)( UINT uJoyID); -extern joyReleaseCapture_type joyReleaseCapture_orig; -typedef MMRESULT (WINAPI *joySetCapture_type)( HWND hwnd, UINT uJoyID, UINT uPeriod, BOOL fChanged); -extern joySetCapture_type joySetCapture_orig; -typedef MMRESULT (WINAPI *joySetThreshold_type)( UINT uJoyID, UINT uThreshold); -extern joySetThreshold_type joySetThreshold_orig; -typedef BOOL(WINAPI *mciDriverNotify_type)(HANDLE hwndCallback, MCIDEVICEID uDeviceID, UINT uStatus); -extern mciDriverNotify_type mciDriverNotify_orig; -typedef UINT (WINAPI *mciDriverYield_type)(UINT uDeviceID); -extern mciDriverYield_type mciDriverYield_orig; -typedef FOURCC (WINAPI *mmioStringToFOURCCA_type)( LPCSTR sz, UINT uFlags); -extern mmioStringToFOURCCA_type mmioStringToFOURCCA_orig; -typedef FOURCC (WINAPI *mmioStringToFOURCCW_type)( LPCWSTR sz, UINT uFlags); -extern mmioStringToFOURCCW_type mmioStringToFOURCCW_orig; -typedef LPMMIOPROC (WINAPI *mmioInstallIOProcA_type)( FOURCC fccIOProc, LPMMIOPROC pIOProc, DWORD dwFlags); -extern mmioInstallIOProcA_type mmioInstallIOProcA_orig; -typedef LPMMIOPROC (WINAPI *mmioInstallIOProcW_type)( FOURCC fccIOProc, LPMMIOPROC pIOProc, DWORD dwFlags); -extern mmioInstallIOProcW_type mmioInstallIOProcW_orig; -typedef HMMIO (WINAPI *mmioOpenA_type)( LPSTR pszFileName, LPMMIOINFO pmmioinfo, DWORD fdwOpen); -extern mmioOpenA_type mmioOpenA_orig; -typedef HMMIO (WINAPI *mmioOpenW_type)( LPWSTR pszFileName, LPMMIOINFO pmmioinfo, DWORD fdwOpen); -extern mmioOpenW_type mmioOpenW_orig; -typedef MMRESULT (WINAPI *mmioRenameA_type)( LPCSTR pszFileName, LPCSTR pszNewFileName, LPCMMIOINFO pmmioinfo, DWORD fdwRename); -extern mmioRenameA_type mmioRenameA_orig; -typedef MMRESULT (WINAPI *mmioRenameW_type)( LPCWSTR pszFileName, LPCWSTR pszNewFileName, LPCMMIOINFO pmmioinfo, DWORD fdwRename); -extern mmioRenameW_type mmioRenameW_orig; -typedef MMRESULT (WINAPI *mmioClose_type)( HMMIO hmmio, UINT fuClose); -extern mmioClose_type mmioClose_orig; -typedef LONG (WINAPI *mmioRead_type)( HMMIO hmmio, HPSTR pch, LONG cch); -extern mmioRead_type mmioRead_orig; -typedef LONG (WINAPI *mmioWrite_type)( HMMIO hmmio, const char _huge* pch, LONG cch); -extern mmioWrite_type mmioWrite_orig; -typedef LONG (WINAPI *mmioSeek_type)( HMMIO hmmio, LONG lOffset, int iOrigin); -extern mmioSeek_type mmioSeek_orig; -typedef MMRESULT (WINAPI *mmioGetInfo_type)( HMMIO hmmio, LPMMIOINFO pmmioinfo, UINT fuInfo); -extern mmioGetInfo_type mmioGetInfo_orig; -typedef MMRESULT (WINAPI *mmioSetInfo_type)( HMMIO hmmio, LPCMMIOINFO pmmioinfo, UINT fuInfo); -extern mmioSetInfo_type mmioSetInfo_orig; -typedef MMRESULT (WINAPI *mmioSetBuffer_type)( HMMIO hmmio, LPSTR pchBuffer, LONG cchBuffer, UINT fuBuffer); -extern mmioSetBuffer_type mmioSetBuffer_orig; -typedef MMRESULT (WINAPI *mmioFlush_type)( HMMIO hmmio, UINT fuFlush); -extern mmioFlush_type mmioFlush_orig; -typedef MMRESULT (WINAPI *mmioAdvance_type)( HMMIO hmmio, LPMMIOINFO pmmioinfo, UINT fuAdvance); -extern mmioAdvance_type mmioAdvance_orig; -typedef LRESULT (WINAPI *mmioSendMessage_type)( HMMIO hmmio, UINT uMsg, LPARAM lParam1, LPARAM lParam2); -extern mmioSendMessage_type mmioSendMessage_orig; -typedef MMRESULT (WINAPI *mmioDescend_type)( HMMIO hmmio, LPMMCKINFO pmmcki, const MMCKINFO FAR* pmmckiParent, UINT fuDescend); -extern mmioDescend_type mmioDescend_orig; -typedef MMRESULT (WINAPI *mmioAscend_type)( HMMIO hmmio, LPMMCKINFO pmmcki, UINT fuAscend); -extern mmioAscend_type mmioAscend_orig; -typedef MMRESULT (WINAPI *mmioCreateChunk_type)(HMMIO hmmio, LPMMCKINFO pmmcki, UINT fuCreate); -extern mmioCreateChunk_type mmioCreateChunk_orig; -typedef MCIERROR (WINAPI *mciSendCommandA_type)( MCIDEVICEID mciId, UINT uMsg, DWORD_PTR dwParam1, DWORD_PTR dwParam2); -extern mciSendCommandA_type mciSendCommandA_orig; -typedef MCIERROR (WINAPI *mciSendCommandW_type)( MCIDEVICEID mciId, UINT uMsg, DWORD_PTR dwParam1, DWORD_PTR dwParam2); -extern mciSendCommandW_type mciSendCommandW_orig; -typedef MCIERROR (WINAPI *mciSendStringA_type)( LPCSTR lpstrCommand, LPSTR lpstrReturnString, UINT uReturnLength, HWND hwndCallback); -extern mciSendStringA_type mciSendStringA_orig; -typedef MCIERROR (WINAPI *mciSendStringW_type)( LPCWSTR lpstrCommand, LPWSTR lpstrReturnString, UINT uReturnLength, HWND hwndCallback); -extern mciSendStringW_type mciSendStringW_orig; -typedef MCIDEVICEID (WINAPI *mciGetDeviceIDA_type)( LPCSTR pszDevice); -extern mciGetDeviceIDA_type mciGetDeviceIDA_orig; -typedef MCIDEVICEID (WINAPI *mciGetDeviceIDW_type)( LPCWSTR pszDevice); -extern mciGetDeviceIDW_type mciGetDeviceIDW_orig; -typedef MCIDEVICEID (WINAPI *mciGetDeviceIDFromElementIDA_type)( DWORD dwElementID, LPCSTR lpstrType ); -extern mciGetDeviceIDFromElementIDA_type mciGetDeviceIDFromElementIDA_orig; -typedef MCIDEVICEID (WINAPI *mciGetDeviceIDFromElementIDW_type)( DWORD dwElementID, LPCWSTR lpstrType ); -extern mciGetDeviceIDFromElementIDW_type mciGetDeviceIDFromElementIDW_orig; -typedef DWORD_PTR (WINAPI *mciGetDriverData_type)(UINT uDeviceID); -extern mciGetDriverData_type mciGetDriverData_orig; -typedef BOOL (WINAPI *mciGetErrorStringA_type)( MCIERROR mcierr, LPSTR pszText, UINT cchText); -extern mciGetErrorStringA_type mciGetErrorStringA_orig; -typedef BOOL (WINAPI *mciGetErrorStringW_type)( MCIERROR mcierr, LPWSTR pszText, UINT cchText); -extern mciGetErrorStringW_type mciGetErrorStringW_orig; -typedef BOOL (WINAPI *mciSetDriverData_type)(UINT uDeviceID, DWORD_PTR dwData); -extern mciSetDriverData_type mciSetDriverData_orig; -typedef BOOL (WINAPI *mciSetYieldProc_type)( MCIDEVICEID mciId, YIELDPROC fpYieldProc, DWORD dwYieldData); -extern mciSetYieldProc_type mciSetYieldProc_orig; -typedef BOOL (WINAPI *mciFreeCommandResource_type)(UINT uTable); -extern mciFreeCommandResource_type mciFreeCommandResource_orig; -typedef HTASK (WINAPI *mciGetCreatorTask_type)( MCIDEVICEID mciId); -extern mciGetCreatorTask_type mciGetCreatorTask_orig; -typedef YIELDPROC (WINAPI *mciGetYieldProc_type)( MCIDEVICEID mciId, LPDWORD pdwYieldData); -extern mciGetYieldProc_type mciGetYieldProc_orig; -typedef UINT (WINAPI *mciLoadCommandResource_type)(HANDLE hInstance, LPCWSTR lpResName, UINT uType); -extern mciLoadCommandResource_type mciLoadCommandResource_orig; -typedef BOOL (WINAPI *mciExecute_type)(LPCSTR pszCommand); -extern mciExecute_type mciExecute_orig; diff --git a/indra/media_plugins/winmmshim/winmm.def b/indra/media_plugins/winmmshim/winmm.def deleted file mode 100755 index c55a2845f8..0000000000 --- a/indra/media_plugins/winmmshim/winmm.def +++ /dev/null @@ -1,218 +0,0 @@ -; -; winmm.def -; -; Exports for WINMM DLL -; - -LIBRARY WINMM -EXPORTS -CloseDriver -DefDriverProc -DriverCallback -DrvGetModuleHandle -GetDriverModuleHandle -;MigrateAllDrivers -;MigrateSoundEvents -;NotifyCallbackData -OpenDriver -;PlaySound -PlaySoundA -PlaySoundW -SendDriverMessage -;WOW32DriverCallback -;WOW32ResolveMultiMediaHandle -;WOWAppExit -;WinmmLogoff -;WinmmLogon -;aux32Message -auxGetDevCapsA -auxGetDevCapsW -auxGetNumDevs -auxGetVolume -auxOutMessage -auxSetVolume -;gfxAddGfx -;gfxBatchChange -;gfxCreateGfxFactoriesList -;gfxCreateZoneFactoriesList -;gfxDestroyDeviceInterfaceList -;gfxEnumerateGfxs -;gfxLogoff -;gfxLogon -;gfxModifyGfx -;gfxOpenGfx -;gfxRemoveGfx -;joy32Message -joyConfigChanged -joyGetDevCapsA -joyGetDevCapsW -joyGetNumDevs -joyGetPos -joyGetPosEx -joyGetThreshold -joyReleaseCapture -joySetCapture -joySetThreshold -;mci32Message -mciDriverNotify -mciDriverYield -mciExecute -mciFreeCommandResource -mciGetCreatorTask -mciGetDeviceIDA -mciGetDeviceIDFromElementIDA -mciGetDeviceIDFromElementIDW -mciGetDeviceIDW -mciGetDriverData -mciGetErrorStringA -mciGetErrorStringW -mciGetYieldProc -mciLoadCommandResource -mciSendCommandA -mciSendCommandW -mciSendStringA -mciSendStringW -mciSetDriverData -mciSetYieldProc -;mid32Message -midiConnect -midiDisconnect -midiInAddBuffer -midiInClose -midiInGetDevCapsA -midiInGetDevCapsW -midiInGetErrorTextA -midiInGetErrorTextW -midiInGetID -midiInGetNumDevs -midiInMessage -midiInOpen -midiInPrepareHeader -midiInReset -midiInStart -midiInStop -midiInUnprepareHeader -midiOutCacheDrumPatches -midiOutCachePatches -midiOutClose -midiOutGetDevCapsA -midiOutGetDevCapsW -midiOutGetErrorTextA -midiOutGetErrorTextW -midiOutGetID -midiOutGetNumDevs -midiOutGetVolume -midiOutLongMsg -midiOutMessage -midiOutOpen -midiOutPrepareHeader -midiOutReset -midiOutSetVolume -midiOutShortMsg -midiOutUnprepareHeader -midiStreamClose -midiStreamOpen -midiStreamOut -midiStreamPause -midiStreamPosition -midiStreamProperty -midiStreamRestart -midiStreamStop -mixerClose -mixerGetControlDetailsA -mixerGetControlDetailsW -mixerGetDevCapsA -mixerGetDevCapsW -mixerGetID -mixerGetLineControlsA -mixerGetLineControlsW -mixerGetLineInfoA -mixerGetLineInfoW -mixerGetNumDevs -mixerMessage -mixerOpen -mixerSetControlDetails -;mmDrvInstall -mmGetCurrentTask -mmTaskBlock -mmTaskCreate -mmTaskSignal -mmTaskYield -mmioAdvance -mmioAscend -mmioClose -mmioCreateChunk -mmioDescend -mmioFlush -mmioGetInfo -mmioInstallIOProcA -mmioInstallIOProcW -mmioOpenA -mmioOpenW -mmioRead -mmioRenameA -mmioRenameW -mmioSeek -mmioSendMessage -mmioSetBuffer -mmioSetInfo -mmioStringToFOURCCA -mmioStringToFOURCCW -mmioWrite -mmsystemGetVersion -;mod32Message -;mxd32Message -sndPlaySoundA -sndPlaySoundW -;tid32Message -timeBeginPeriod -timeEndPeriod -timeGetDevCaps -timeGetSystemTime -timeGetTime -timeKillEvent -timeSetEvent -waveInAddBuffer -waveInClose -waveInGetDevCapsA -waveInGetDevCapsW -waveInGetErrorTextA -waveInGetErrorTextW -waveInGetID -waveInGetNumDevs -waveInGetPosition -waveInMessage -waveInOpen -waveInPrepareHeader -waveInReset -waveInStart -waveInStop -waveInUnprepareHeader -waveOutBreakLoop -waveOutClose -waveOutGetDevCapsA -waveOutGetDevCapsW -waveOutGetErrorTextA -waveOutGetErrorTextW -waveOutGetID -waveOutGetNumDevs -waveOutGetPitch -waveOutGetPlaybackRate -waveOutGetPosition -waveOutGetVolume -waveOutMessage -waveOutOpen -waveOutPause -waveOutPrepareHeader -waveOutReset -waveOutRestart -waveOutSetPitch -waveOutSetPlaybackRate -waveOutSetVolume -waveOutUnprepareHeader -waveOutWrite -;wid32Message -;winmmSetDebugLevel -;wod32Message -setPluginVolume -setPluginMute
\ No newline at end of file diff --git a/indra/media_plugins/winmmshim/winmm_shim.cpp b/indra/media_plugins/winmmshim/winmm_shim.cpp deleted file mode 100644 index 78f7a9b0da..0000000000 --- a/indra/media_plugins/winmmshim/winmm_shim.cpp +++ /dev/null @@ -1,219 +0,0 @@ -/** - * @file winmmshim.cpp - * @brief controls volume level of process by intercepting calls to winmm.dll - * - * $LicenseInfo:firstyear=2010&license=viewerlgpl$ - * Second Life Viewer Source Code - * Copyright (C) 2010-2014, Linden Research, Inc. - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; - * version 2.1 of the License only. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA - * - * Linden Research, Inc., 945 Battery Street, San Francisco, CA 94111 USA - * $/LicenseInfo$ - */ -#include "forwarding_api.h" -#include <xmmintrin.h> -#include <map> -#include <math.h> - -using std::wstring; - -static float sVolumeLevel = 1.f; // Could be covered by critical section, -static bool sMute = false; // not needed with atomicity and alignment. -static CRITICAL_SECTION sCriticalSection; - -BOOL APIENTRY DllMain( HMODULE hModule, - DWORD ul_reason_for_call, - LPVOID lpReserved - ) -{ - if (ul_reason_for_call == DLL_PROCESS_ATTACH) - { - InitializeCriticalSection(&sCriticalSection); - } - return TRUE; -} - -void ll_winmm_shim_initialize(){ - static volatile bool initialized = false; - - // do this only once using double-check locking - if (!initialized) - { - EnterCriticalSection(&sCriticalSection); - if (!initialized) - { // bind to original winmm.dll - TCHAR system_path[MAX_PATH]; - TCHAR dll_path[MAX_PATH]; - ::GetSystemDirectory(system_path, MAX_PATH); - - // grab winmm.dll from system path, where it should live - wsprintf(dll_path, "%s\\winmm.dll", system_path); - HMODULE winmm_handle = ::LoadLibrary(dll_path); - - if (winmm_handle != NULL) - { // we have a dll, let's get out pointers! - init_function_pointers(winmm_handle); - ::OutputDebugStringA("WINMM_SHIM.DLL: real winmm.dll initialized successfully\n"); - initialized = true; // Last thing after completing setup - } - else - { - // failed to initialize real winmm.dll - ::OutputDebugStringA("WINMM_SHIM.DLL: Failed to initialize real winmm.dll\n"); - } - } - LeaveCriticalSection(&sCriticalSection); - } -} - - -extern "C" -{ - // tracks the requested format for a given waveout buffer - struct WaveOutFormat - { - WaveOutFormat(int bits_per_sample) - : mBitsPerSample(bits_per_sample) - {} - int mBitsPerSample; - }; - typedef std::map<HWAVEOUT, WaveOutFormat*> wave_out_map_t; - static wave_out_map_t sWaveOuts; // Covered by sCriticalSection - - MMRESULT WINAPI waveOutOpen( LPHWAVEOUT phwo, UINT uDeviceID, LPCWAVEFORMATEX pwfx, DWORD_PTR dwCallback, DWORD_PTR dwInstance, DWORD fdwOpen) - { - ll_winmm_shim_initialize(); - if (pwfx->wFormatTag != WAVE_FORMAT_PCM - || (pwfx->wBitsPerSample != 8 && pwfx->wBitsPerSample != 16)) - { // uncompressed 8 and 16 bit sound are the only types we support - return WAVERR_BADFORMAT; - } - - MMRESULT result = waveOutOpen_orig(phwo, uDeviceID, pwfx, dwCallback, dwInstance, fdwOpen); - if (result == MMSYSERR_NOERROR - && ((fdwOpen & WAVE_FORMAT_QUERY) == 0)) // not just querying for format support - { // remember the requested bits per sample, and associate with the given handle - WaveOutFormat* wave_outp = new WaveOutFormat(pwfx->wBitsPerSample); - EnterCriticalSection(&sCriticalSection); - sWaveOuts.insert(std::make_pair(*phwo, wave_outp)); - LeaveCriticalSection(&sCriticalSection); - } - return result; - } - - MMRESULT WINAPI waveOutClose( HWAVEOUT hwo) - { - ll_winmm_shim_initialize(); - EnterCriticalSection(&sCriticalSection); - wave_out_map_t::iterator found_it = sWaveOuts.find(hwo); - if (found_it != sWaveOuts.end()) - { // forget what we know about this handle - delete found_it->second; - sWaveOuts.erase(found_it); - } - LeaveCriticalSection(&sCriticalSection); - return waveOutClose_orig(hwo); - } - - MMRESULT WINAPI waveOutWrite( HWAVEOUT hwo, LPWAVEHDR pwh, UINT cbwh) - { - ll_winmm_shim_initialize(); - MMRESULT result = MMSYSERR_NOERROR; - - if (sMute) - { // zero out the audio buffer when muted - memset(pwh->lpData, 0, pwh->dwBufferLength); - } - else if (sVolumeLevel != 1.f) - { // need to apply volume level - int bits_per_sample(0); - - EnterCriticalSection(&sCriticalSection); - wave_out_map_t::iterator found_it = sWaveOuts.find(hwo); - if (found_it != sWaveOuts.end()) - { - bits_per_sample = found_it->second->mBitsPerSample; - } - LeaveCriticalSection(&sCriticalSection); - if (bits_per_sample) - { - switch (bits_per_sample) - { - case 8: - { - char volume = (char)(sVolumeLevel * 127.f); - for (unsigned int i = 0; i < pwh->dwBufferLength; i++) - { - // unsigned multiply doesn't use most significant bit, so shift by 7 bits - // to get resulting value back into 8 bits - pwh->lpData[i] = (pwh->lpData[i] * volume) >> 7; - } - break; - } - case 16: - { - short volume_16 = (short)(sVolumeLevel * 32767.f); - - // copy volume level 4 times into 64 bit MMX register - __m64 volume_64 = _mm_set_pi16(volume_16, volume_16, volume_16, volume_16); - __m64* sample_64; - __m64* last_sample_64 = (__m64*)(pwh->lpData + pwh->dwBufferLength - sizeof(__m64)); - // for everything that can be addressed in 64 bit multiples... - for (sample_64 = (__m64*)pwh->lpData; - sample_64 <= last_sample_64; - ++sample_64) - { - //...multiply the samples by the volume... - __m64 scaled_sample = _mm_mulhi_pi16(*sample_64, volume_64); - // ...and shift left 1 bit since an unsigned multiple loses the most significant bit - // 0x7FFF * 0x7FFF = 0x3fff0001 - // 0x3fff0001 << 1 = 0x7ffe0002 - // notice that the LSB is always 0...should consider dithering - *sample_64 = _mm_slli_pi16(scaled_sample, 1); - } - - // the captain has turned off the MMX sign, you are now free to use floating point registers - _mm_empty(); - - // finish remaining samples that didn't fit into 64 bit register - for (short* sample_16 = (short*)sample_64; - sample_16 < (short*)(pwh->lpData + pwh->dwBufferLength); - ++sample_16) - { - *sample_16 = (*sample_16 * volume_16) >> 15; - } - - break; - } - default: - // don't do anything - break; - } - } - } - return waveOutWrite_orig( hwo, pwh, cbwh); - } - - void WINAPI setPluginVolume(float volume) - { - sVolumeLevel = volume; - } - - void WINAPI setPluginMute(bool mute) - { - sMute = mute; - } -} diff --git a/indra/newview/CMakeLists.txt b/indra/newview/CMakeLists.txt index 9ac1c3520d..c4ded8c5ae 100644 --- a/indra/newview/CMakeLists.txt +++ b/indra/newview/CMakeLists.txt @@ -13,7 +13,6 @@ include(DragDrop) include(EXPAT) include(FMODEX) include(GLOD) -include(GooglePerfTools) include(Hunspell) include(JsonCpp) include(LLAppearance) @@ -1431,7 +1430,7 @@ if (WINDOWS) set(ICON_PATH "project") set(VIEWER_MACOSX_PHASE "a") endif() - message("Copying icons for ${ICON_PATH}") + message(STATUS "Copying icons for ${ICON_PATH}") execute_process( COMMAND ${CMAKE_COMMAND} -E copy_if_different "${CMAKE_CURRENT_SOURCE_DIR}/icons/${ICON_PATH}/secondlife.ico" @@ -1682,7 +1681,7 @@ if (WINDOWS) set_target_properties(${VIEWER_BINARY_NAME} PROPERTIES # *TODO -reenable this once we get server usage sorted out - LINK_FLAGS "/debug /NODEFAULTLIB:LIBCMT /SUBSYSTEM:WINDOWS ${TCMALLOC_LINK_FLAGS} /LARGEADDRESSAWARE" + LINK_FLAGS "/debug /NODEFAULTLIB:LIBCMT /SUBSYSTEM:WINDOWS /LARGEADDRESSAWARE" LINK_FLAGS_DEBUG "/NODEFAULTLIB:\"LIBCMT;LIBCMTD;MSVCRT\" /INCREMENTAL:NO /LARGEADDRESSAWARE" LINK_FLAGS_RELEASE "/FORCE:MULTIPLE /MAP\"secondlife-bin.MAP\" /OPT:REF /LARGEADDRESSAWARE" ) @@ -1702,20 +1701,8 @@ if (WINDOWS) # In the meantime, if you have any ideas on how to easily maintain one list, either here or in viewer_manifest.py # and have the build deps get tracked *please* tell me about it. - if(USE_TCMALLOC) - # Configure a var for tcmalloc location, if used. - # Note the need to specify multiple names explicitly. - set(GOOGLE_PERF_TOOLS_SOURCE - ${SHARED_LIB_STAGING_DIR}/Release/libtcmalloc_minimal.dll - ${SHARED_LIB_STAGING_DIR}/RelWithDebInfo/libtcmalloc_minimal.dll - ${SHARED_LIB_STAGING_DIR}/Debug/libtcmalloc_minimal-debug.dll - ) - endif(USE_TCMALLOC) - - set(COPY_INPUT_DEPENDENCIES # The following commented dependencies are determined at variably at build time. Can't do this here. - #${SHARED_LIB_STAGING_DIR}/${CMAKE_CFG_INTDIR}/libtcmalloc_minimal.dll => None ... Skipping libtcmalloc_minimal.dll ${CMAKE_SOURCE_DIR}/../etc/message.xml ${CMAKE_SOURCE_DIR}/../scripts/messages/message_template.msg ${SHARED_LIB_STAGING_DIR}/${CMAKE_CFG_INTDIR}/llcommon.dll @@ -1754,8 +1741,8 @@ if (WINDOWS) ${ARCH_PREBUILT_DIRS_RELEASE}/ssleay32.dll ${ARCH_PREBUILT_DIRS_DEBUG}/libeay32.dll ${ARCH_PREBUILT_DIRS_DEBUG}/ssleay32.dll + ${viewer_APPSETTINGS_FILES} SLPlugin - media_plugin_quicktime media_plugin_cef media_plugin_libvlc winmm_shim @@ -1783,7 +1770,7 @@ if (WINDOWS) --configuration=${CMAKE_CFG_INTDIR} --dest=${CMAKE_CURRENT_BINARY_DIR}/${CMAKE_CFG_INTDIR} --grid=${GRID} - --channel=${VIEWER_CHANNEL} + "--channel=${VIEWER_CHANNEL}" --versionfile=${CMAKE_CURRENT_BINARY_DIR}/viewer_version.txt --source=${CMAKE_CURRENT_SOURCE_DIR} --touch=${CMAKE_CURRENT_BINARY_DIR}/${CMAKE_CFG_INTDIR}/copy_touched.bat @@ -1846,7 +1833,7 @@ if (WINDOWS) --artwork=${ARTWORK_DIR} --build=${CMAKE_CURRENT_BINARY_DIR} --buildtype=${CMAKE_BUILD_TYPE} - --channel=${VIEWER_CHANNEL} + "--channel=${VIEWER_CHANNEL}" --versionfile=${CMAKE_CURRENT_BINARY_DIR}/viewer_version.txt --configuration=${CMAKE_CFG_INTDIR} --dest=${CMAKE_CURRENT_BINARY_DIR}/${CMAKE_CFG_INTDIR} @@ -1957,7 +1944,6 @@ target_link_libraries(${VIEWER_BINARY_NAME} ${LLLOGIN_LIBRARIES} ${LLPHYSICS_LIBRARIES} ${LLPHYSICSEXTENSIONS_LIBRARIES} - ${TCMALLOC_LIBRARIES} ${LLAPPEARANCE_LIBRARIES} ) @@ -1986,7 +1972,7 @@ if (LINUX) --artwork=${ARTWORK_DIR} --build=${CMAKE_CURRENT_BINARY_DIR} --buildtype=${CMAKE_BUILD_TYPE} - --channel=${VIEWER_CHANNEL} + "--channel=${VIEWER_CHANNEL}" --versionfile=${CMAKE_CURRENT_BINARY_DIR}/viewer_version.txt --configuration=${CMAKE_CFG_INTDIR} --dest=${CMAKE_CURRENT_BINARY_DIR}/packaged @@ -2014,7 +2000,7 @@ if (LINUX) --configuration=${CMAKE_CFG_INTDIR} --dest=${CMAKE_CURRENT_BINARY_DIR}/packaged --grid=${GRID} - --channel=${VIEWER_CHANNEL} + "--channel=${VIEWER_CHANNEL}" --versionfile=${CMAKE_CURRENT_BINARY_DIR}/viewer_version.txt --source=${CMAKE_CURRENT_SOURCE_DIR} DEPENDS @@ -2073,7 +2059,7 @@ if (DARWIN) --configuration=${CMAKE_CFG_INTDIR} --dest=${CMAKE_CURRENT_BINARY_DIR}/${CMAKE_CFG_INTDIR}/${product}.app --grid=${GRID} - --channel=${VIEWER_CHANNEL} + "--channel=${VIEWER_CHANNEL}" --versionfile=${CMAKE_CURRENT_BINARY_DIR}/viewer_version.txt --source=${CMAKE_CURRENT_SOURCE_DIR} DEPENDS @@ -2081,7 +2067,7 @@ if (DARWIN) ${CMAKE_CURRENT_SOURCE_DIR}/viewer_manifest.py ) - add_dependencies(${VIEWER_BINARY_NAME} SLPlugin media_plugin_quicktime media_plugin_libvlc media_plugin_cef mac-crash-logger) + add_dependencies(${VIEWER_BINARY_NAME} SLPlugin media_plugin_libvlc media_plugin_cef mac-crash-logger) add_dependencies(${VIEWER_BINARY_NAME} mac-crash-logger) if (ENABLE_SIGNING) @@ -2102,11 +2088,10 @@ if (DARWIN) --artwork=${ARTWORK_DIR} --build=${CMAKE_CURRENT_BINARY_DIR} --buildtype=${CMAKE_BUILD_TYPE} - --channel=${VIEWER_CHANNEL} --configuration=${CMAKE_CFG_INTDIR} --dest=${CMAKE_CURRENT_BINARY_DIR}/${CMAKE_CFG_INTDIR}/${product}.app --grid=${GRID} - --channel=${VIEWER_CHANNEL} + "--channel=${VIEWER_CHANNEL}" --versionfile=${CMAKE_CURRENT_BINARY_DIR}/viewer_version.txt --source=${CMAKE_CURRENT_SOURCE_DIR} --touch=${CMAKE_CURRENT_BINARY_DIR}/${CMAKE_CFG_INTDIR}/.${product}.touched @@ -2123,9 +2108,10 @@ endif (INSTALL) if (PACKAGE) set(SYMBOL_SEARCH_DIRS "") + # Note that the path to VIEWER_SYMBOL_FILE must match that in ../../build.sh if (WINDOWS) list(APPEND SYMBOL_SEARCH_DIRS "${CMAKE_CURRENT_BINARY_DIR}/${CMAKE_CFG_INTDIR}") - set(VIEWER_SYMBOL_FILE "${CMAKE_CURRENT_BINARY_DIR}/${CMAKE_CFG_INTDIR}/secondlife-symbols-windows.tar.bz2") + set(VIEWER_SYMBOL_FILE "${CMAKE_CURRENT_BINARY_DIR}/${CMAKE_CFG_INTDIR}/secondlife-symbols-windows-$ENV{AUTOBUILD_ADDRSIZE}.tar.bz2") # slplugin.exe failing symbols dump - need to debug, might have to do with updated version of google breakpad # set(VIEWER_EXE_GLOBS "${VIEWER_BINARY_NAME}${CMAKE_EXECUTABLE_SUFFIX} slplugin.exe") set(VIEWER_EXE_GLOBS "${VIEWER_BINARY_NAME}${CMAKE_EXECUTABLE_SUFFIX}") @@ -2138,15 +2124,14 @@ if (PACKAGE) list(APPEND SYMBOL_SEARCH_DIRS "${CMAKE_BINARY_DIR}/llplugin/slplugin/${CMAKE_CFG_INTDIR}") list(APPEND SYMBOL_SEARCH_DIRS "${CMAKE_BINARY_DIR}/mac_crash_logger/${CMAKE_CFG_INTDIR}") list(APPEND SYMBOL_SEARCH_DIRS "${CMAKE_BINARY_DIR}/media_plugins/gstreamer010/${CMAKE_CFG_INTDIR}") - list(APPEND SYMBOL_SEARCH_DIRS "${CMAKE_BINARY_DIR}/media_plugins/quicktime/${CMAKE_CFG_INTDIR}") - set(VIEWER_SYMBOL_FILE "${CMAKE_CURRENT_BINARY_DIR}/${CMAKE_CFG_INTDIR}/secondlife-symbols-darwin.tar.bz2") + set(VIEWER_SYMBOL_FILE "${CMAKE_CURRENT_BINARY_DIR}/${CMAKE_CFG_INTDIR}/secondlife-symbols-darwin-$ENV{AUTOBUILD_ADDRSIZE}.tar.bz2") set(VIEWER_EXE_GLOBS "'Second Life' SLPlugin mac-crash-logger") set(VIEWER_EXE_GLOBS "'Second Life' mac-crash-logger") set(VIEWER_LIB_GLOB "*.dylib") endif (DARWIN) if (LINUX) list(APPEND SYMBOL_SEARCH_DIRS "${CMAKE_CURRENT_BINARY_DIR}/packaged") - set(VIEWER_SYMBOL_FILE "${CMAKE_CURRENT_BINARY_DIR}/${CMAKE_CFG_INTDIR}/secondlife-symbols-linux.tar.bz2") + set(VIEWER_SYMBOL_FILE "${CMAKE_CURRENT_BINARY_DIR}/${CMAKE_CFG_INTDIR}/secondlife-symbols-linux-$ENV{AUTOBUILD_ADDRSIZE}.tar.bz2") set(VIEWER_EXE_GLOBS "do-not-directly-run-secondlife-bin SLPlugin") set(VIEWER_EXE_GLOBS "do-not-directly-run-secondlife-bin") set(VIEWER_LIB_GLOB "*${CMAKE_SHARED_MODULE_SUFFIX}*") diff --git a/indra/newview/VIEWER_VERSION.txt b/indra/newview/VIEWER_VERSION.txt index 2d6c0bcf19..831446cbd2 100644 --- a/indra/newview/VIEWER_VERSION.txt +++ b/indra/newview/VIEWER_VERSION.txt @@ -1 +1 @@ -5.0.4 +5.1.0 diff --git a/indra/newview/app_settings/settings.xml b/indra/newview/app_settings/settings.xml index 717deba8c7..51f3d3332b 100644 --- a/indra/newview/app_settings/settings.xml +++ b/indra/newview/app_settings/settings.xml @@ -2033,11 +2033,11 @@ <key>Comment</key> <string>Size (in bytes) for each coroutine stack</string> <key>Persist</key> - <integer>0</integer> + <integer>1</integer> <key>Type</key> <string>S32</string> <key>Value</key> - <integer>262144</integer> + <integer>524288</integer> </map> <key>CrashOnStartup</key> <map> @@ -6353,17 +6353,6 @@ <key>Value</key> <integer>512</integer> </map> - <key>MemProfiling</key> - <map> - <key>Comment</key> - <string>You want to use tcmalloc's memory profiling options.</string> - <key>Persist</key> - <integer>1</integer> - <key>Type</key> - <string>Boolean</string> - <key>Value</key> - <integer>0</integer> - </map> <key>MenuAccessKeyTime</key> <map> <key>Comment</key> @@ -10056,28 +10045,28 @@ <key>Value</key> <integer>0</integer> </map> - <key>RenderUseFarClip</key> - <map> - <key>Comment</key> - <string>If false, frustum culling will ignore far clip plane.</string> - <key>Persist</key> - <integer>1</integer> - <key>Type</key> - <string>Boolean</string> - <key>Value</key> - <integer>1</integer> - </map> - <key>RenderUseImpostors</key> - <map> - <key>Comment</key> + <key>RenderUseFarClip</key> + <map> + <key>Comment</key> + <string>If false, frustum culling will ignore far clip plane.</string> + <key>Persist</key> + <integer>1</integer> + <key>Type</key> + <string>Boolean</string> + <key>Value</key> + <integer>1</integer> + </map> + <key>RenderUseImpostors</key> + <map> + <key>Comment</key> <string>OBSOLETE and UNUSED. See RenderAvatarMaxNonImpostors and RenderAvatarMaxComplexity.</string> - <key>Persist</key> + <key>Persist</key> <integer>0</integer> - <key>Type</key> - <string>Boolean</string> - <key>Value</key> + <key>Type</key> + <string>Boolean</string> + <key>Value</key> <integer>0</integer> - </map> + </map> <key>RenderAutoMuteByteLimit</key> <map> <key>Comment</key> diff --git a/indra/newview/installers/darwin/fix_application_icon_position.sh b/indra/newview/installers/darwin/fix_application_icon_position.sh index 618e34820c..62abcdd07e 100755 --- a/indra/newview/installers/darwin/fix_application_icon_position.sh +++ b/indra/newview/installers/darwin/fix_application_icon_position.sh @@ -1,17 +1,23 @@ -# just run this script each time after you change the installer's name to fix the icon misalignment #!/bin/bash -cp -r ../../../../build-darwin-i386/newview/*.dmg ~/Desktop/TempBuild.dmg -hdid ~/Desktop/TempBuild.dmg -open -a finder /Volumes/Second\ Life\ Installer -osascript dmg-cleanup.applescript -umount /Volumes/Second\ Life\ Installer/ -hdid ~/Desktop/TempBuild.dmg -open -a finder /Volumes/Second\ Life\ Installer -#cp /Volumes/Second\ Life\ Installer/.DS_Store ~/Desktop/_DS_Store +# just run this script each time after you change the installer's name to fix the icon misalignment +mydir="$(dirname "$0")" +# If there's more than one DMG in more than one build directory, pick the most +# recent one. +dmgfile="$(ls -t "$mydir/../../../../build-darwin-*/newview/*.dmg" | head -n 1)" +dmgwork="$HOME/Desktop/TempBuild.dmg" +mounted="/Volumes/Second Life Installer" +cp -r "$dmgfile" "$dmgwork" +hdid "$dmgwork" +open -a finder "$mounted" +osascript "$mydir/dmg-cleanup.applescript" +umount "$mounted"/ +hdid "$dmgwork" +open -a finder "$mounted" +#cp "$mounted"/.DS_Store ~/Desktop/_DS_Store #chflags nohidden ~/Desktop/_DS_Store -#cp ~/Desktop/_DS_Store ./firstlook-dmg/_DS_Store -#cp ~/Desktop/_DS_Store ./publicnightly-dmg/_DS_Store -#cp ~/Desktop/_DS_Store ./release-dmg/_DS_Store -#cp ~/Desktop/_DS_Store ./releasecandidate-dmg/_DS_Store -#umount /Volumes/Second\ Life\ Installer/ -#rm ~/Desktop/_DS_Store ~/Desktop/TempBuild.dmg +#cp ~/Desktop/_DS_Store "$mydir/firstlook-dmg/_DS_Store" +#cp ~/Desktop/_DS_Store "$mydir/publicnightly-dmg/_DS_Store" +#cp ~/Desktop/_DS_Store "$mydir/release-dmg/_DS_Store" +#cp ~/Desktop/_DS_Store "$mydir/releasecandidate-dmg/_DS_Store" +#umount "$mounted"/ +#rm ~/Desktop/_DS_Store "$dmgwork" diff --git a/indra/newview/installers/windows/installer_template.nsi b/indra/newview/installers/windows/installer_template.nsi index 89317f2793..eb07b54d8d 100644 --- a/indra/newview/installers/windows/installer_template.nsi +++ b/indra/newview/installers/windows/installer_template.nsi @@ -90,7 +90,7 @@ InstProgressFlags smooth colored # New colored smooth look SetOverwrite on # Overwrite files by default
AutoCloseWindow true # After all files install, close window
-InstallDir "$PROGRAMFILES\${INSTNAME}"
+InstallDir "%%$PROGRAMFILES%%\${INSTNAME}"
InstallDirRegKey HKEY_LOCAL_MACHINE "SOFTWARE\Linden Research, Inc.\${INSTNAME}" ""
UninstallText $(UninstallTextMsg)
DirText $(DirectoryChooseTitle) $(DirectoryChooseSetup)
@@ -136,6 +136,7 @@ FunctionEnd ;; entry to the language ID selector below
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
Function .onInit
+%%ENGAGEREGISTRY%%
Call CheckCPUFlags # Make sure we have SSE2 support
Call CheckWindowsVersion # Don't install On unsupported systems
Push $0
@@ -194,6 +195,7 @@ FunctionEnd ;; Prep Uninstaller Section
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
Function un.onInit
+%%ENGAGEREGISTRY%%
# Read language from registry and set for uninstaller. Key will be removed on successful uninstall
ReadRegStr $0 HKEY_LOCAL_MACHINE "SOFTWARE\Linden Research, Inc.\${INSTNAME}" "InstallerLanguage"
IfErrors lbl_end
diff --git a/indra/newview/llappviewer.cpp b/indra/newview/llappviewer.cpp index 5eb82a2d0b..b58af54985 100644 --- a/indra/newview/llappviewer.cpp +++ b/indra/newview/llappviewer.cpp @@ -125,10 +125,8 @@ #include "llcoros.h" #include "llexception.h" #if !LL_LINUX -#include "cef/llceflib.h" -#if LL_WINDOWS +#include "cef/dullahan.h" #include "vlc/libvlc_version.h" -#endif // LL_WINDOWS #endif // LL_LINUX // Third party library includes @@ -334,10 +332,10 @@ BOOL gDisconnected = FALSE; // used to restore texture state after a mode switch LLFrameTimer gRestoreGLTimer; BOOL gRestoreGL = FALSE; -BOOL gUseWireframe = FALSE; +bool gUseWireframe = FALSE; //use for remember deferred mode in wireframe switch -BOOL gInitialDeferredModeForWireframe = FALSE; +bool gInitialDeferredModeForWireframe = FALSE; // VFS globals - see llappviewer.h LLVFS* gStaticVFS = NULL; @@ -3301,6 +3299,7 @@ LLSD LLAppViewer::getViewerInfo() const info["VIEWER_VERSION"] = version; info["VIEWER_VERSION_STR"] = LLVersionInfo::getVersion(); info["CHANNEL"] = LLVersionInfo::getChannel(); + info["ADDRESS_SIZE"] = ADDRESS_SIZE; std::string build_config = LLVersionInfo::getBuildConfig(); if (build_config != "Release") { @@ -3387,20 +3386,28 @@ LLSD LLAppViewer::getViewerInfo() const } #if !LL_LINUX - info["LLCEFLIB_VERSION"] = LLCEFLIB_VERSION; + std::ostringstream cef_ver_codec; + cef_ver_codec << "Dullahan: "; + cef_ver_codec << DULLAHAN_VERSION_MAJOR; + cef_ver_codec << "."; + cef_ver_codec << DULLAHAN_VERSION_MINOR; + cef_ver_codec << "."; + cef_ver_codec << DULLAHAN_VERSION_BUILD; + cef_ver_codec << " - CEF: "; + cef_ver_codec << CEF_VERSION; + info["LIBCEF_VERSION"] = cef_ver_codec.str(); #else - info["LLCEFLIB_VERSION"] = "Undefined"; - + info["LIBCEF_VERSION"] = "Undefined"; #endif -#if LL_WINDOWS - std::ostringstream ver_codec; - ver_codec << LIBVLC_VERSION_MAJOR; - ver_codec << "."; - ver_codec << LIBVLC_VERSION_MINOR; - ver_codec << "."; - ver_codec << LIBVLC_VERSION_REVISION; - info["LIBVLC_VERSION"] = ver_codec.str(); +#if !LL_LINUX + std::ostringstream vlc_ver_codec; + vlc_ver_codec << LIBVLC_VERSION_MAJOR; + vlc_ver_codec << "."; + vlc_ver_codec << LIBVLC_VERSION_MINOR; + vlc_ver_codec << "."; + vlc_ver_codec << LIBVLC_VERSION_REVISION; + info["LIBVLC_VERSION"] = vlc_ver_codec.str(); #else info["LIBVLC_VERSION"] = "Undefined"; #endif diff --git a/indra/newview/llappviewer.h b/indra/newview/llappviewer.h index 7bb3c32c51..16a00c8cee 100644 --- a/indra/newview/llappviewer.h +++ b/indra/newview/llappviewer.h @@ -389,8 +389,8 @@ extern BOOL gDisconnected; extern LLFrameTimer gRestoreGLTimer; extern BOOL gRestoreGL; -extern BOOL gUseWireframe; -extern BOOL gInitialDeferredModeForWireframe; +extern bool gUseWireframe; +extern bool gInitialDeferredModeForWireframe; // VFS globals - gVFS is for general use // gStaticVFS is read-only and is shipped w/ the viewer diff --git a/indra/newview/llappviewermacosx.cpp b/indra/newview/llappviewermacosx.cpp index 4fe1e31668..bb3bcf2886 100644 --- a/indra/newview/llappviewermacosx.cpp +++ b/indra/newview/llappviewermacosx.cpp @@ -260,7 +260,7 @@ bool LLAppViewerMacOSX::restoreErrorTrap() unsigned int reset_count = 0; #define SET_SIG(S) sigaction(SIGABRT, &act, &old_act); \ - if((unsigned int)act.sa_sigaction != (unsigned int) old_act.sa_sigaction) \ + if(act.sa_sigaction != old_act.sa_sigaction) \ ++reset_count; // Synchronous signals SET_SIG(SIGABRT) diff --git a/indra/newview/llenvmanager.cpp b/indra/newview/llenvmanager.cpp index b97e483fd9..c58a21d0c8 100644 --- a/indra/newview/llenvmanager.cpp +++ b/indra/newview/llenvmanager.cpp @@ -35,6 +35,22 @@ #include "llwaterparammanager.h" #include "llwlhandlers.h" #include "llwlparammanager.h" +#include "lltrans.h" + +std::string LLWLParamKey::toString() const +{ + switch (scope) + { + case SCOPE_LOCAL: + return name + std::string(" (") + LLTrans::getString("Local") + std::string(")"); + break; + case SCOPE_REGION: + return name + std::string(" (") + LLTrans::getString("Region") + std::string(")"); + break; + default: + return name + " (?)"; + } +} std::string LLEnvPrefs::getWaterPresetName() const { diff --git a/indra/newview/llenvmanager.h b/indra/newview/llenvmanager.h index 6a0a267f4e..54bbf85e86 100644 --- a/indra/newview/llenvmanager.h +++ b/indra/newview/llenvmanager.h @@ -48,6 +48,87 @@ public: } EScope; }; +struct LLWLParamKey : LLEnvKey +{ +public: + // scope and source of a param set (WL sky preset) + std::string name; + EScope scope; + + // for conversion from LLSD + static const int NAME_IDX = 0; + static const int SCOPE_IDX = 1; + + inline LLWLParamKey(const std::string& n, EScope s) + : name(n), scope(s) + { + } + + inline LLWLParamKey(LLSD llsd) + : name(llsd[NAME_IDX].asString()), scope(EScope(llsd[SCOPE_IDX].asInteger())) + { + } + + inline LLWLParamKey() // NOT really valid, just so std::maps can return a default of some sort + : name(""), scope(SCOPE_LOCAL) + { + } + + inline LLWLParamKey(std::string& stringVal) + { + size_t len = stringVal.length(); + if (len > 0) + { + name = stringVal.substr(0, len - 1); + scope = (EScope) atoi(stringVal.substr(len - 1, len).c_str()); + } + } + + inline std::string toStringVal() const + { + std::stringstream str; + str << name << scope; + return str.str(); + } + + inline LLSD toLLSD() const + { + LLSD llsd = LLSD::emptyArray(); + llsd.append(LLSD(name)); + llsd.append(LLSD(scope)); + return llsd; + } + + inline void fromLLSD(const LLSD& llsd) + { + name = llsd[NAME_IDX].asString(); + scope = EScope(llsd[SCOPE_IDX].asInteger()); + } + + inline bool operator <(const LLWLParamKey other) const + { + if (name < other.name) + { + return true; + } + else if (name > other.name) + { + return false; + } + else + { + return scope < other.scope; + } + } + + inline bool operator ==(const LLWLParamKey other) const + { + return (name == other.name) && (scope == other.scope); + } + + std::string toString() const; +}; + class LLEnvironmentSettings { public: diff --git a/indra/newview/llface.cpp b/indra/newview/llface.cpp index 3d5e2d356e..50a4925c37 100644 --- a/indra/newview/llface.cpp +++ b/indra/newview/llface.cpp @@ -2133,7 +2133,7 @@ BOOL LLFace::getGeometryVolume(const LLVolume& volume, LLVector4a src; U32 vec[4]; - vec[0] = vec[1] = vec[2] = vec[3] = color.mAll; + vec[0] = vec[1] = vec[2] = vec[3] = color.asRGBA(); src.loadua((F32*) vec); @@ -2169,7 +2169,7 @@ BOOL LLFace::getGeometryVolume(const LLVolume& volume, LLColor4U glow4u = LLColor4U(0,0,0,glow); - U32 glow32 = glow4u.mAll; + U32 glow32 = glow4u.asRGBA(); U32 vec[4]; vec[0] = vec[1] = vec[2] = vec[3] = glow32; diff --git a/indra/newview/llfloaterbeacons.cpp b/indra/newview/llfloaterbeacons.cpp index 316294a477..cf38a00499 100644 --- a/indra/newview/llfloaterbeacons.cpp +++ b/indra/newview/llfloaterbeacons.cpp @@ -66,13 +66,13 @@ void LLFloaterBeacons::onClickUICheck(LLUICtrl *ctrl) std::string name = check->getName(); if(name == "touch_only") { - LLPipeline::toggleRenderScriptedTouchBeacons(NULL); + LLPipeline::toggleRenderScriptedTouchBeacons(); // Don't allow both to be ON at the same time. Toggle the other one off if both now on. if ( - LLPipeline::getRenderScriptedTouchBeacons(NULL) && - LLPipeline::getRenderScriptedBeacons(NULL) ) + LLPipeline::getRenderScriptedTouchBeacons() && + LLPipeline::getRenderScriptedBeacons() ) { - LLPipeline::setRenderScriptedBeacons(FALSE); + LLPipeline::setRenderScriptedBeacons(false); getChild<LLCheckBoxCtrl>("scripted")->setControlValue(LLSD(FALSE)); getChild<LLCheckBoxCtrl>("scripted")->setValue(FALSE); getChild<LLCheckBoxCtrl>("touch_only")->setControlValue(LLSD(TRUE)); // just to be sure it's in sync with llpipeline @@ -81,13 +81,13 @@ void LLFloaterBeacons::onClickUICheck(LLUICtrl *ctrl) } else if(name == "scripted") { - LLPipeline::toggleRenderScriptedBeacons(NULL); + LLPipeline::toggleRenderScriptedBeacons(); // Don't allow both to be ON at the same time. Toggle the other one off if both now on. if ( - LLPipeline::getRenderScriptedTouchBeacons(NULL) && - LLPipeline::getRenderScriptedBeacons(NULL) ) + LLPipeline::getRenderScriptedTouchBeacons() && + LLPipeline::getRenderScriptedBeacons() ) { - LLPipeline::setRenderScriptedTouchBeacons(FALSE); + LLPipeline::setRenderScriptedTouchBeacons(false); getChild<LLCheckBoxCtrl>("touch_only")->setControlValue(LLSD(FALSE)); getChild<LLCheckBoxCtrl>("touch_only")->setValue(FALSE); getChild<LLCheckBoxCtrl>("scripted")->setControlValue(LLSD(TRUE)); // just to be sure it's in sync with llpipeline @@ -100,13 +100,13 @@ void LLFloaterBeacons::onClickUICheck(LLUICtrl *ctrl) else if(name == "moapbeacon") LLPipeline::setRenderMOAPBeacons(check->get()); else if(name == "highlights") { - LLPipeline::toggleRenderHighlights(NULL); + LLPipeline::toggleRenderHighlights(); // Don't allow both to be OFF at the same time. Toggle the other one on if both now off. if ( - !LLPipeline::getRenderBeacons(NULL) && - !LLPipeline::getRenderHighlights(NULL) ) + !LLPipeline::getRenderBeacons() && + !LLPipeline::getRenderHighlights() ) { - LLPipeline::setRenderBeacons(TRUE); + LLPipeline::setRenderBeacons(true); getChild<LLCheckBoxCtrl>("beacons")->setControlValue(LLSD(TRUE)); getChild<LLCheckBoxCtrl>("beacons")->setValue(TRUE); getChild<LLCheckBoxCtrl>("highlights")->setControlValue(LLSD(FALSE)); // just to be sure it's in sync with llpipeline @@ -115,13 +115,13 @@ void LLFloaterBeacons::onClickUICheck(LLUICtrl *ctrl) } else if(name == "beacons") { - LLPipeline::toggleRenderBeacons(NULL); + LLPipeline::toggleRenderBeacons(); // Don't allow both to be OFF at the same time. Toggle the other one on if both now off. if ( - !LLPipeline::getRenderBeacons(NULL) && - !LLPipeline::getRenderHighlights(NULL) ) + !LLPipeline::getRenderBeacons() && + !LLPipeline::getRenderHighlights() ) { - LLPipeline::setRenderHighlights(TRUE); + LLPipeline::setRenderHighlights(true); getChild<LLCheckBoxCtrl>("highlights")->setControlValue(LLSD(TRUE)); getChild<LLCheckBoxCtrl>("highlights")->setValue(TRUE); getChild<LLCheckBoxCtrl>("beacons")->setControlValue(LLSD(FALSE)); // just to be sure it's in sync with llpipeline diff --git a/indra/newview/llfloaterbump.cpp b/indra/newview/llfloaterbump.cpp index 957c91b226..33e4c7cd5f 100644 --- a/indra/newview/llfloaterbump.cpp +++ b/indra/newview/llfloaterbump.cpp @@ -184,7 +184,7 @@ void LLFloaterBump::onScrollListRightClicked(LLUICtrl* ctrl, S32 x, S32 y) std::string mute_msg = (LLMuteList::getInstance()->isMuted(mItemUUID, mNames[mItemUUID])) ? "UnmuteAvatar" : "MuteAvatar"; mPopupMenu->getChild<LLUICtrl>("Avatar Mute")->setValue(LLTrans::getString(mute_msg)); - mPopupMenu->setItemEnabled(std::string("Zoom In"), (BOOL)gObjectList.findObject(mItemUUID)); + mPopupMenu->setItemEnabled(std::string("Zoom In"), bool(gObjectList.findObject(mItemUUID))); ((LLContextMenu*)mPopupMenu)->show(x, y); LLMenuGL::showPopup(ctrl, mPopupMenu, x, y); diff --git a/indra/newview/llfloaterimnearbychat.cpp b/indra/newview/llfloaterimnearbychat.cpp index 7d0ff22ed3..981d837b8a 100644 --- a/indra/newview/llfloaterimnearbychat.cpp +++ b/indra/newview/llfloaterimnearbychat.cpp @@ -282,7 +282,7 @@ void LLFloaterIMNearbyChat::onTearOffClicked() LLFloaterIMSessionTab::onTearOffClicked(); // see CHUI-170: Save torn-off state of the nearby chat between sessions - BOOL in_the_multifloater = (BOOL)getHost(); + bool in_the_multifloater(getHost()); gSavedPerAccountSettings.setBOOL("NearbyChatIsNotTornOff", in_the_multifloater); } diff --git a/indra/newview/llfloatermap.cpp b/indra/newview/llfloatermap.cpp index 333ff863e5..fc2da772f3 100644 --- a/indra/newview/llfloatermap.cpp +++ b/indra/newview/llfloatermap.cpp @@ -119,7 +119,7 @@ BOOL LLFloaterMap::handleDoubleClick(S32 x, S32 y, MASK mask) LLVector3d pos_global = mMap->viewPosToGlobal(x, y); - LLTracker::stopTracking(NULL); + LLTracker::stopTracking(false); LLFloaterWorldMap* world_map = LLFloaterWorldMap::getInstance(); if (world_map) { diff --git a/indra/newview/llfloaterworldmap.cpp b/indra/newview/llfloaterworldmap.cpp index c0bd9b1c23..83f268818e 100644 --- a/indra/newview/llfloaterworldmap.cpp +++ b/indra/newview/llfloaterworldmap.cpp @@ -558,7 +558,7 @@ void LLFloaterWorldMap::trackAvatar( const LLUUID& avatar_id, const std::string& } else { - LLTracker::stopTracking(NULL); + LLTracker::stopTracking(false); } setDefaultBtn("Teleport"); } @@ -602,7 +602,7 @@ void LLFloaterWorldMap::trackLandmark( const LLUUID& landmark_item_id ) } else { - LLTracker::stopTracking(NULL); + LLTracker::stopTracking(false); } setDefaultBtn("Teleport"); } @@ -628,7 +628,7 @@ void LLFloaterWorldMap::trackLocation(const LLVector3d& pos_global) if (!sim_info) { // We haven't found a region for that point yet, leave the tracking to the world map - LLTracker::stopTracking(NULL); + LLTracker::stopTracking(false); LLWorldMap::getInstance()->setTracking(pos_global); S32 world_x = S32(pos_global.mdV[0] / 256); S32 world_y = S32(pos_global.mdV[1] / 256); @@ -644,7 +644,7 @@ void LLFloaterWorldMap::trackLocation(const LLVector3d& pos_global) { // Down region. Show the blue circle of death! // i.e. let the world map that this and tell it it's invalid - LLTracker::stopTracking(NULL); + LLTracker::stopTracking(false); LLWorldMap::getInstance()->setTracking(pos_global); LLWorldMap::getInstance()->setTrackingInvalid(); setDefaultBtn(""); @@ -863,7 +863,7 @@ void LLFloaterWorldMap::friendsChanged() (buddy_info && !buddy_info->isRightGrantedFrom(LLRelationship::GRANT_MAP_LOCATION)) || gAgent.isGodlike()) { - LLTracker::stopTracking(NULL); + LLTracker::stopTracking(false); } } } @@ -1070,7 +1070,7 @@ void LLFloaterWorldMap::onLandmarkComboPrearrange( ) if( current_choice.isNull() || !list->setCurrentByID( current_choice ) ) { - LLTracker::stopTracking(NULL); + LLTracker::stopTracking(false); } } @@ -1080,7 +1080,7 @@ void LLFloaterWorldMap::onComboTextEntry() // Reset the tracking whenever we start typing into any of the search fields, // so that hitting <enter> does an auto-complete versus teleporting us to the // previously selected landmark/friend. - LLTracker::stopTracking(NULL); + LLTracker::stopTracking(false); } void LLFloaterWorldMap::onSearchTextEntry( ) @@ -1103,7 +1103,7 @@ void LLFloaterWorldMap::onLandmarkComboCommit() LLUUID asset_id; LLUUID item_id = list->getCurrentID(); - LLTracker::stopTracking(NULL); + LLTracker::stopTracking(false); //RN: stopTracking() clears current combobox selection, need to reassert it here list->setCurrentByID(item_id); @@ -1158,7 +1158,7 @@ void LLFloaterWorldMap::onAvatarComboPrearrange( ) if( !list->setCurrentByID( current_choice ) || current_choice.isNull() ) { - LLTracker::stopTracking(NULL); + LLTracker::stopTracking(false); } } @@ -1271,7 +1271,7 @@ void LLFloaterWorldMap::onCoordinatesCommit() void LLFloaterWorldMap::onClearBtn() { mTrackedStatus = LLTracker::TRACKING_NOTHING; - LLTracker::stopTracking((void *)(intptr_t)TRUE); + LLTracker::stopTracking(true); LLWorldMap::getInstance()->cancelTracking(); mSLURL = LLSLURL(); // Clear the SLURL since it's invalid mSetToUserPosition = TRUE; // Revert back to the current user position diff --git a/indra/newview/lllogchat.cpp b/indra/newview/lllogchat.cpp index b9194c6c67..2635054bba 100644 --- a/indra/newview/lllogchat.cpp +++ b/indra/newview/lllogchat.cpp @@ -930,7 +930,7 @@ bool LLChatLogParser::parse(std::string& raw, LLSD& im, const LLSD& parse_params //possibly a case of complex object names consisting of 3+ words if (!has_name) { - U32 divider_pos = stuff.find(NAME_TEXT_DIVIDER); + std::string::size_type divider_pos = stuff.find(NAME_TEXT_DIVIDER); if (divider_pos != std::string::npos && divider_pos < (stuff.length() - NAME_TEXT_DIVIDER.length())) { im[LL_IM_FROM] = stuff.substr(0, divider_pos); diff --git a/indra/newview/llmaterialmgr.cpp b/indra/newview/llmaterialmgr.cpp index f996557c17..ccbe13fb50 100644 --- a/indra/newview/llmaterialmgr.cpp +++ b/indra/newview/llmaterialmgr.cpp @@ -531,7 +531,7 @@ void LLMaterialMgr::onPutResponse(bool success, const LLSD& content) LL_DEBUGS("Materials") << "response has "<< response_data.size() << " materials" << LL_ENDL; for (LLSD::array_const_iterator faceIter = response_data.beginArray(); faceIter != response_data.endArray(); ++faceIter) { -# ifndef LL_RELEASE_FOR_DOWNLOAD +# ifdef SHOW_ASSERT // same condition that controls llassert() const LLSD& face_data = *faceIter; // conditional to avoid unused variable warning # endif llassert(face_data.isMap()); diff --git a/indra/newview/llnetmap.cpp b/indra/newview/llnetmap.cpp index 5fc73c67d1..248c361ca4 100644 --- a/indra/newview/llnetmap.cpp +++ b/indra/newview/llnetmap.cpp @@ -735,7 +735,7 @@ void LLNetMap::renderPoint(const LLVector3 &pos_local, const LLColor4U &color, continue; } S32 offset = px + py * image_width; - ((U32*)datap)[offset] = color.mAll; + ((U32*)datap)[offset] = color.asRGBA(); } // top line @@ -748,7 +748,7 @@ void LLNetMap::renderPoint(const LLVector3 &pos_local, const LLColor4U &color, continue; } S32 offset = px + py * image_width; - ((U32*)datap)[offset] = color.mAll; + ((U32*)datap)[offset] = color.asRGBA(); } } else @@ -770,7 +770,7 @@ void LLNetMap::renderPoint(const LLVector3 &pos_local, const LLColor4U &color, continue; } S32 offset = p_x + p_y * image_width; - ((U32*)datap)[offset] = color.mAll; + ((U32*)datap)[offset] = color.asRGBA(); } } } @@ -988,6 +988,6 @@ void LLNetMap::handleStopTracking (const LLSD& userdata) if (mPopupMenu) { mPopupMenu->setItemEnabled ("Stop Tracking", false); - LLTracker::stopTracking ((void*)LLTracker::isTracking(NULL)); + LLTracker::stopTracking (LLTracker::isTracking(NULL)); } } diff --git a/indra/newview/llpipelinelistener.cpp b/indra/newview/llpipelinelistener.cpp index 20759239bf..dfbe689f56 100644 --- a/indra/newview/llpipelinelistener.cpp +++ b/indra/newview/llpipelinelistener.cpp @@ -48,7 +48,7 @@ namespace { U32 render_type = render_type_from_string( iter->asString() ); if ( render_type != 0 ) { - LLPipeline::toggleRenderTypeControl( (void*) render_type ); + LLPipeline::toggleRenderTypeControl( render_type ); } } } @@ -59,7 +59,7 @@ namespace { U32 render_type = render_type_from_string( request["type"].asString() ); if ( render_type != 0 ) { - response["value"] = LLPipeline::hasRenderTypeControl( (void*) render_type ); + response["value"] = LLPipeline::hasRenderTypeControl( render_type ); } else { @@ -87,7 +87,7 @@ namespace { U32 render_feature = feature_from_string( iter->asString() ); if ( render_feature != 0 ) { - LLPipeline::toggleRenderDebugControl( (void*) render_feature ); + LLPipeline::toggleRenderDebugControl( render_feature ); } } } @@ -126,7 +126,7 @@ namespace { U32 info_display = info_display_from_string( iter->asString() ); if ( info_display != 0 ) { - LLPipeline::toggleRenderDebug( (void*) info_display ); + LLPipeline::toggleRenderDebug( info_display ); } } } diff --git a/indra/newview/llsearchhistory.cpp b/indra/newview/llsearchhistory.cpp index 0ea05a03d6..449e0080f0 100644 --- a/indra/newview/llsearchhistory.cpp +++ b/indra/newview/llsearchhistory.cpp @@ -116,26 +116,26 @@ void LLSearchHistory::addEntry(const std::string& search_query) mSearchHistory.push_front(item); } -bool LLSearchHistory::LLSearchHistoryItem::operator < (const LLSearchHistory::LLSearchHistoryItem& right) +bool LLSearchHistory::LLSearchHistoryItem::operator < (const LLSearchHistory::LLSearchHistoryItem& right) const { S32 result = LLStringUtil::compareInsensitive(search_query, right.search_query); return result < 0; } -bool LLSearchHistory::LLSearchHistoryItem::operator > (const LLSearchHistory::LLSearchHistoryItem& right) +bool LLSearchHistory::LLSearchHistoryItem::operator > (const LLSearchHistory::LLSearchHistoryItem& right) const { S32 result = LLStringUtil::compareInsensitive(search_query, right.search_query); return result > 0; } -bool LLSearchHistory::LLSearchHistoryItem::operator==(const LLSearchHistory::LLSearchHistoryItem& right) +bool LLSearchHistory::LLSearchHistoryItem::operator==(const LLSearchHistory::LLSearchHistoryItem& right) const { return 0 == LLStringUtil::compareInsensitive(search_query, right.search_query); } -bool LLSearchHistory::LLSearchHistoryItem::operator==(const std::string& right) +bool LLSearchHistory::LLSearchHistoryItem::operator==(const std::string& right) const { return 0 == LLStringUtil::compareInsensitive(search_query, right); } diff --git a/indra/newview/llsearchhistory.h b/indra/newview/llsearchhistory.h index 5aab5e6765..4ae6122396 100644 --- a/indra/newview/llsearchhistory.h +++ b/indra/newview/llsearchhistory.h @@ -99,16 +99,16 @@ public: /** * Allows std::list sorting */ - bool operator < (const LLSearchHistory::LLSearchHistoryItem& right); + bool operator < (const LLSearchHistory::LLSearchHistoryItem& right) const; /** * Allows std::list sorting */ - bool operator > (const LLSearchHistory::LLSearchHistoryItem& right); + bool operator > (const LLSearchHistory::LLSearchHistoryItem& right) const; - bool operator==(const LLSearchHistoryItem& right); + bool operator==(const LLSearchHistoryItem& right) const; - bool operator==(const std::string& right); + bool operator==(const std::string& right) const; /** * Serializes search history item to LLSD diff --git a/indra/newview/llskinningutil.cpp b/indra/newview/llskinningutil.cpp index cf09f6f978..dba690242a 100644 --- a/indra/newview/llskinningutil.cpp +++ b/indra/newview/llskinningutil.cpp @@ -122,7 +122,7 @@ void LLSkinningUtil::initSkinningMatrixPalette( // static void LLSkinningUtil::checkSkinWeights(LLVector4a* weights, U32 num_vertices, const LLMeshSkinInfo* skin) { -#ifndef LL_RELEASE_FOR_DOWNLOAD +#ifdef SHOW_ASSERT // same condition that controls llassert() const S32 max_joints = skin->mJointNames.size(); for (U32 j=0; j<num_vertices; j++) { diff --git a/indra/newview/llspatialpartition.cpp b/indra/newview/llspatialpartition.cpp index 0fd36766b3..94b838e829 100644 --- a/indra/newview/llspatialpartition.cpp +++ b/indra/newview/llspatialpartition.cpp @@ -61,9 +61,6 @@ extern bool gShiftFrame; static U32 sZombieGroups = 0; U32 LLSpatialGroup::sNodeCount = 0; -U32 gOctreeMaxCapacity; -F32 gOctreeMinSize; - BOOL LLSpatialGroup::sNoDelete = FALSE; static F32 sLastMaxTexPriority = 1.f; diff --git a/indra/newview/lltracker.cpp b/indra/newview/lltracker.cpp index b015cde45d..2ec5c41b88 100644 --- a/indra/newview/lltracker.cpp +++ b/indra/newview/lltracker.cpp @@ -100,9 +100,8 @@ LLTracker::~LLTracker() // static -void LLTracker::stopTracking(void* userdata) +void LLTracker::stopTracking(bool clear_ui) { - BOOL clear_ui = ((BOOL)(intptr_t)userdata); instance()->stopTrackingAll(clear_ui); } @@ -183,7 +182,7 @@ void LLTracker::render3D() F32 dist = gFloaterWorldMap->getDistanceToDestination(pos_global, 0.5f); if (dist < DESTINATION_REACHED_RADIUS) { - instance()->stopTrackingLocation(FALSE,TRUE); + instance()->stopTrackingLocation(false,true); } else { @@ -606,7 +605,7 @@ void LLTracker::renderBeacon(LLVector3d pos_global, } -void LLTracker::stopTrackingAll(BOOL clear_ui) +void LLTracker::stopTrackingAll(bool clear_ui) { switch (mTrackingStatus) { @@ -626,7 +625,7 @@ void LLTracker::stopTrackingAll(BOOL clear_ui) } -void LLTracker::stopTrackingAvatar(BOOL clear_ui) +void LLTracker::stopTrackingAvatar(bool clear_ui) { LLAvatarTracker& av_tracker = LLAvatarTracker::instance(); if( !av_tracker.getAvatarID().isNull() ) @@ -640,7 +639,7 @@ void LLTracker::stopTrackingAvatar(BOOL clear_ui) } -void LLTracker::stopTrackingLandmark(BOOL clear_ui) +void LLTracker::stopTrackingLandmark(bool clear_ui) { purgeBeaconText(); mTrackedLandmarkAssetID.setNull(); @@ -655,7 +654,7 @@ void LLTracker::stopTrackingLandmark(BOOL clear_ui) } -void LLTracker::stopTrackingLocation(BOOL clear_ui, BOOL dest_reached) +void LLTracker::stopTrackingLocation(bool clear_ui, bool dest_reached) { purgeBeaconText(); mTrackedLocationName.assign(""); diff --git a/indra/newview/lltracker.h b/indra/newview/lltracker.h index a1c5052c1b..4a6f10b767 100644 --- a/indra/newview/lltracker.h +++ b/indra/newview/lltracker.h @@ -74,8 +74,8 @@ public: // these are static so that they can be used a callbacks static ETrackingStatus getTrackingStatus() { return instance()->mTrackingStatus; } static ETrackingLocationType getTrackedLocationType() { return instance()->mTrackingLocationType; } - static BOOL isTracking(void*) { return instance()->mTrackingStatus != TRACKING_NOTHING; } - static void stopTracking(void*); + static bool isTracking(void*) { return instance()->mTrackingStatus != TRACKING_NOTHING; } + static void stopTracking(bool); static void clearFocus(); static const LLUUID& getTrackedLandmarkAssetID() { return instance()->mTrackedLandmarkAssetID; } @@ -114,10 +114,10 @@ protected: LLHUDText* hud_textp, const std::string& label ); - void stopTrackingAll(BOOL clear_ui = FALSE); - void stopTrackingAvatar(BOOL clear_ui = FALSE); - void stopTrackingLocation(BOOL clear_ui = FALSE, BOOL dest_reached = FALSE); - void stopTrackingLandmark(BOOL clear_ui = FALSE); + void stopTrackingAll(bool clear_ui = false); + void stopTrackingAvatar(bool clear_ui = false); + void stopTrackingLocation(bool clear_ui = false, bool dest_reached = false); + void stopTrackingLandmark(bool clear_ui = false); void drawMarker(const LLVector3d& pos_global, const LLColor4& color); void setLandmarkVisited(); diff --git a/indra/newview/llversioninfo.cpp b/indra/newview/llversioninfo.cpp index a0ca91672a..375dce485d 100644 --- a/indra/newview/llversioninfo.cpp +++ b/indra/newview/llversioninfo.cpp @@ -99,10 +99,16 @@ const std::string &LLVersionInfo::getShortVersion() namespace { + // LL_VIEWER_CHANNEL is a macro defined on the compiler command line. The + // macro expands to the string name of the channel, but without quotes. We + // need to turn it into a quoted string. This macro trick does that. +#define stringize_inner(x) #x +#define stringize_outer(x) stringize_inner(x) + /// Storage of the channel name the viewer is using. // The channel name is set by hardcoded constant, // or by calling LLVersionInfo::resetChannel() - std::string sWorkingChannelName(LL_VIEWER_CHANNEL); + std::string sWorkingChannelName(stringize_outer(LL_VIEWER_CHANNEL)); // Storage for the "version and channel" string. // This will get reset too. diff --git a/indra/newview/llviewerdisplay.cpp b/indra/newview/llviewerdisplay.cpp index afa00e3e6e..13eccaefc1 100644 --- a/indra/newview/llviewerdisplay.cpp +++ b/indra/newview/llviewerdisplay.cpp @@ -1107,7 +1107,7 @@ void render_hud_attachments() bool has_ui = gPipeline.hasRenderDebugFeatureMask(LLPipeline::RENDER_DEBUG_FEATURE_UI); if (has_ui) { - gPipeline.toggleRenderDebugFeature((void*) LLPipeline::RENDER_DEBUG_FEATURE_UI); + gPipeline.toggleRenderDebugFeature(LLPipeline::RENDER_DEBUG_FEATURE_UI); } S32 use_occlusion = LLPipeline::sUseOcclusion; @@ -1152,7 +1152,7 @@ void render_hud_attachments() if (has_ui) { - gPipeline.toggleRenderDebugFeature((void*) LLPipeline::RENDER_DEBUG_FEATURE_UI); + gPipeline.toggleRenderDebugFeature(LLPipeline::RENDER_DEBUG_FEATURE_UI); } LLPipeline::sUseOcclusion = use_occlusion; LLPipeline::sRenderingHUDs = FALSE; @@ -1230,13 +1230,13 @@ bool get_hud_matrices(glh::matrix4f &proj, glh::matrix4f &model) return get_hud_matrices(whole_screen, proj, model); } -BOOL setup_hud_matrices() +bool setup_hud_matrices() { LLRect whole_screen = get_whole_screen_region(); return setup_hud_matrices(whole_screen); } -BOOL setup_hud_matrices(const LLRect& screen_region) +bool setup_hud_matrices(const LLRect& screen_region) { glh::matrix4f proj, model; bool result = get_hud_matrices(screen_region, proj, model); diff --git a/indra/newview/llviewermenu.cpp b/indra/newview/llviewermenu.cpp index 99b7a98abc..9bd4e12761 100644 --- a/indra/newview/llviewermenu.cpp +++ b/indra/newview/llviewermenu.cpp @@ -794,7 +794,7 @@ class LLAdvancedToggleRenderType : public view_listener_t U32 render_type = render_type_from_string( userdata.asString() ); if ( render_type != 0 ) { - LLPipeline::toggleRenderTypeControl( (void*)render_type ); + LLPipeline::toggleRenderTypeControl( render_type ); } return true; } @@ -810,7 +810,7 @@ class LLAdvancedCheckRenderType : public view_listener_t if ( render_type != 0 ) { - new_value = LLPipeline::hasRenderTypeControl( (void*)render_type ); + new_value = LLPipeline::hasRenderTypeControl( render_type ); } return new_value; @@ -869,7 +869,7 @@ class LLAdvancedToggleFeature : public view_listener_t U32 feature = feature_from_string( userdata.asString() ); if ( feature != 0 ) { - LLPipeline::toggleRenderDebugFeature( (void*)feature ); + LLPipeline::toggleRenderDebugFeature( feature ); } return true; } @@ -884,7 +884,7 @@ class LLAdvancedCheckFeature : public view_listener_t if ( feature != 0 ) { - new_value = LLPipeline::toggleRenderDebugFeatureControl( (void*)feature ); + new_value = LLPipeline::toggleRenderDebugFeatureControl( feature ); } return new_value; @@ -925,7 +925,7 @@ class LLAdvancedSetDisplayTextureDensity : public view_listener_t { if (gPipeline.hasRenderDebugMask(LLPipeline::RENDER_DEBUG_TEXEL_DENSITY) == TRUE) { - gPipeline.toggleRenderDebug((void*)LLPipeline::RENDER_DEBUG_TEXEL_DENSITY); + gPipeline.toggleRenderDebug(LLPipeline::RENDER_DEBUG_TEXEL_DENSITY); } LLViewerTexture::sDebugTexelsMode = LLViewerTexture::DEBUG_TEXELS_OFF; } @@ -933,7 +933,7 @@ class LLAdvancedSetDisplayTextureDensity : public view_listener_t { if (gPipeline.hasRenderDebugMask(LLPipeline::RENDER_DEBUG_TEXEL_DENSITY) == FALSE) { - gPipeline.toggleRenderDebug((void*)LLPipeline::RENDER_DEBUG_TEXEL_DENSITY); + gPipeline.toggleRenderDebug(LLPipeline::RENDER_DEBUG_TEXEL_DENSITY); } LLViewerTexture::sDebugTexelsMode = LLViewerTexture::DEBUG_TEXELS_CURRENT; } @@ -941,7 +941,7 @@ class LLAdvancedSetDisplayTextureDensity : public view_listener_t { if (gPipeline.hasRenderDebugMask(LLPipeline::RENDER_DEBUG_TEXEL_DENSITY) == FALSE) { - gPipeline.toggleRenderDebug((void*)LLPipeline::RENDER_DEBUG_TEXEL_DENSITY); + gPipeline.toggleRenderDebug(LLPipeline::RENDER_DEBUG_TEXEL_DENSITY); } gPipeline.setRenderDebugFeatureControl(LLPipeline::RENDER_DEBUG_TEXEL_DENSITY, true); LLViewerTexture::sDebugTexelsMode = LLViewerTexture::DEBUG_TEXELS_DESIRED; @@ -950,7 +950,7 @@ class LLAdvancedSetDisplayTextureDensity : public view_listener_t { if (gPipeline.hasRenderDebugMask(LLPipeline::RENDER_DEBUG_TEXEL_DENSITY) == FALSE) { - gPipeline.toggleRenderDebug((void*)LLPipeline::RENDER_DEBUG_TEXEL_DENSITY); + gPipeline.toggleRenderDebug(LLPipeline::RENDER_DEBUG_TEXEL_DENSITY); } LLViewerTexture::sDebugTexelsMode = LLViewerTexture::DEBUG_TEXELS_FULL; } @@ -1093,7 +1093,7 @@ class LLAdvancedToggleInfoDisplay : public view_listener_t if ( info_display != 0 ) { - LLPipeline::toggleRenderDebug( (void*)info_display ); + LLPipeline::toggleRenderDebug( info_display ); } return true; @@ -1110,7 +1110,7 @@ class LLAdvancedCheckInfoDisplay : public view_listener_t if ( info_display != 0 ) { - new_value = LLPipeline::toggleRenderDebugControl( (void*)info_display ); + new_value = LLPipeline::toggleRenderDebugControl( info_display ); } return new_value; @@ -1224,7 +1224,7 @@ class LLAdvancedToggleWireframe : public view_listener_t gPipeline.resetVertexBuffers(); - if (!gUseWireframe && !gInitialDeferredModeForWireframe && LLPipeline::sRenderDeferred != gInitialDeferredModeForWireframe && gPipeline.isInit()) + if (!gUseWireframe && !gInitialDeferredModeForWireframe && LLPipeline::sRenderDeferred != bool(gInitialDeferredModeForWireframe) && gPipeline.isInit()) { LLPipeline::refreshCachedSettings(); gPipeline.releaseGLBuffers(); @@ -8162,66 +8162,66 @@ class LLViewToggleBeacon : public view_listener_t std::string beacon = userdata.asString(); if (beacon == "scriptsbeacon") { - LLPipeline::toggleRenderScriptedBeacons(NULL); - gSavedSettings.setBOOL( "scriptsbeacon", LLPipeline::getRenderScriptedBeacons(NULL) ); + LLPipeline::toggleRenderScriptedBeacons(); + gSavedSettings.setBOOL( "scriptsbeacon", LLPipeline::getRenderScriptedBeacons() ); // toggle the other one off if it's on - if (LLPipeline::getRenderScriptedBeacons(NULL) && LLPipeline::getRenderScriptedTouchBeacons(NULL)) + if (LLPipeline::getRenderScriptedBeacons() && LLPipeline::getRenderScriptedTouchBeacons()) { - LLPipeline::toggleRenderScriptedTouchBeacons(NULL); - gSavedSettings.setBOOL( "scripttouchbeacon", LLPipeline::getRenderScriptedTouchBeacons(NULL) ); + LLPipeline::toggleRenderScriptedTouchBeacons(); + gSavedSettings.setBOOL( "scripttouchbeacon", LLPipeline::getRenderScriptedTouchBeacons() ); } } else if (beacon == "physicalbeacon") { - LLPipeline::toggleRenderPhysicalBeacons(NULL); - gSavedSettings.setBOOL( "physicalbeacon", LLPipeline::getRenderPhysicalBeacons(NULL) ); + LLPipeline::toggleRenderPhysicalBeacons(); + gSavedSettings.setBOOL( "physicalbeacon", LLPipeline::getRenderPhysicalBeacons() ); } else if (beacon == "moapbeacon") { - LLPipeline::toggleRenderMOAPBeacons(NULL); - gSavedSettings.setBOOL( "moapbeacon", LLPipeline::getRenderMOAPBeacons(NULL) ); + LLPipeline::toggleRenderMOAPBeacons(); + gSavedSettings.setBOOL( "moapbeacon", LLPipeline::getRenderMOAPBeacons() ); } else if (beacon == "soundsbeacon") { - LLPipeline::toggleRenderSoundBeacons(NULL); - gSavedSettings.setBOOL( "soundsbeacon", LLPipeline::getRenderSoundBeacons(NULL) ); + LLPipeline::toggleRenderSoundBeacons(); + gSavedSettings.setBOOL( "soundsbeacon", LLPipeline::getRenderSoundBeacons() ); } else if (beacon == "particlesbeacon") { - LLPipeline::toggleRenderParticleBeacons(NULL); - gSavedSettings.setBOOL( "particlesbeacon", LLPipeline::getRenderParticleBeacons(NULL) ); + LLPipeline::toggleRenderParticleBeacons(); + gSavedSettings.setBOOL( "particlesbeacon", LLPipeline::getRenderParticleBeacons() ); } else if (beacon == "scripttouchbeacon") { - LLPipeline::toggleRenderScriptedTouchBeacons(NULL); - gSavedSettings.setBOOL( "scripttouchbeacon", LLPipeline::getRenderScriptedTouchBeacons(NULL) ); + LLPipeline::toggleRenderScriptedTouchBeacons(); + gSavedSettings.setBOOL( "scripttouchbeacon", LLPipeline::getRenderScriptedTouchBeacons() ); // toggle the other one off if it's on - if (LLPipeline::getRenderScriptedBeacons(NULL) && LLPipeline::getRenderScriptedTouchBeacons(NULL)) + if (LLPipeline::getRenderScriptedBeacons() && LLPipeline::getRenderScriptedTouchBeacons()) { - LLPipeline::toggleRenderScriptedBeacons(NULL); - gSavedSettings.setBOOL( "scriptsbeacon", LLPipeline::getRenderScriptedBeacons(NULL) ); + LLPipeline::toggleRenderScriptedBeacons(); + gSavedSettings.setBOOL( "scriptsbeacon", LLPipeline::getRenderScriptedBeacons() ); } } else if (beacon == "renderbeacons") { - LLPipeline::toggleRenderBeacons(NULL); - gSavedSettings.setBOOL( "renderbeacons", LLPipeline::getRenderBeacons(NULL) ); + LLPipeline::toggleRenderBeacons(); + gSavedSettings.setBOOL( "renderbeacons", LLPipeline::getRenderBeacons() ); // toggle the other one on if it's not - if (!LLPipeline::getRenderBeacons(NULL) && !LLPipeline::getRenderHighlights(NULL)) + if (!LLPipeline::getRenderBeacons() && !LLPipeline::getRenderHighlights()) { - LLPipeline::toggleRenderHighlights(NULL); - gSavedSettings.setBOOL( "renderhighlights", LLPipeline::getRenderHighlights(NULL) ); + LLPipeline::toggleRenderHighlights(); + gSavedSettings.setBOOL( "renderhighlights", LLPipeline::getRenderHighlights() ); } } else if (beacon == "renderhighlights") { - LLPipeline::toggleRenderHighlights(NULL); - gSavedSettings.setBOOL( "renderhighlights", LLPipeline::getRenderHighlights(NULL) ); + LLPipeline::toggleRenderHighlights(); + gSavedSettings.setBOOL( "renderhighlights", LLPipeline::getRenderHighlights() ); // toggle the other one on if it's not - if (!LLPipeline::getRenderBeacons(NULL) && !LLPipeline::getRenderHighlights(NULL)) + if (!LLPipeline::getRenderBeacons() && !LLPipeline::getRenderHighlights()) { - LLPipeline::toggleRenderBeacons(NULL); - gSavedSettings.setBOOL( "renderbeacons", LLPipeline::getRenderBeacons(NULL) ); + LLPipeline::toggleRenderBeacons(); + gSavedSettings.setBOOL( "renderbeacons", LLPipeline::getRenderBeacons() ); } } @@ -8300,7 +8300,7 @@ class LLViewCheckRenderType : public view_listener_t bool new_value = false; if (type == "hideparticles") { - new_value = LLPipeline::toggleRenderTypeControlNegated((void *)LLPipeline::RENDER_TYPE_PARTICLES); + new_value = LLPipeline::toggleRenderTypeControlNegated(LLPipeline::RENDER_TYPE_PARTICLES); } return new_value; } diff --git a/indra/newview/llviewermessage.cpp b/indra/newview/llviewermessage.cpp index d81cb804e4..2ab59037e1 100644 --- a/indra/newview/llviewermessage.cpp +++ b/indra/newview/llviewermessage.cpp @@ -2596,7 +2596,7 @@ void process_improved_im(LLMessageSystem *msg, void **user_data) // The group notice packet does not have an AgentID. Obtain one from the name cache. // If last name is "Resident" strip it out so the cache name lookup works. - U32 index = original_name.find(" Resident"); + std::string::size_type index = original_name.find(" Resident"); if (index != std::string::npos) { original_name = original_name.substr(0, index); @@ -4196,7 +4196,7 @@ void process_agent_movement_complete(LLMessageSystem* msg, void**) LLVector3 beacon_dir(agent_pos.mV[VX] - (F32)fmod(beacon_pos.mdV[VX], 256.0), agent_pos.mV[VY] - (F32)fmod(beacon_pos.mdV[VY], 256.0), 0); if (beacon_dir.magVecSquared() < 25.f) { - LLTracker::stopTracking(NULL); + LLTracker::stopTracking(false); } else if ( is_teleport && !gAgent.getTeleportKeepsLookAt() && look_at.isExactlyZero()) { diff --git a/indra/newview/llviewerwindow.cpp b/indra/newview/llviewerwindow.cpp index 61505b7c07..7a60a8e9ac 100644 --- a/indra/newview/llviewerwindow.cpp +++ b/indra/newview/llviewerwindow.cpp @@ -748,45 +748,45 @@ public: } // only display these messages if we are actually rendering beacons at this moment - if (LLPipeline::getRenderBeacons(NULL) && LLFloaterReg::instanceVisible("beacons")) + if (LLPipeline::getRenderBeacons() && LLFloaterReg::instanceVisible("beacons")) { - if (LLPipeline::getRenderMOAPBeacons(NULL)) + if (LLPipeline::getRenderMOAPBeacons()) { addText(xpos, ypos, "Viewing media beacons (white)"); ypos += y_inc; } - if (LLPipeline::toggleRenderTypeControlNegated((void*)LLPipeline::RENDER_TYPE_PARTICLES)) + if (LLPipeline::toggleRenderTypeControlNegated(LLPipeline::RENDER_TYPE_PARTICLES)) { addText(xpos, ypos, particle_hiding); ypos += y_inc; } - if (LLPipeline::getRenderParticleBeacons(NULL)) + if (LLPipeline::getRenderParticleBeacons()) { addText(xpos, ypos, "Viewing particle beacons (blue)"); ypos += y_inc; } - if (LLPipeline::getRenderSoundBeacons(NULL)) + if (LLPipeline::getRenderSoundBeacons()) { addText(xpos, ypos, "Viewing sound beacons (yellow)"); ypos += y_inc; } - if (LLPipeline::getRenderScriptedBeacons(NULL)) + if (LLPipeline::getRenderScriptedBeacons()) { addText(xpos, ypos, beacon_scripted); ypos += y_inc; } else - if (LLPipeline::getRenderScriptedTouchBeacons(NULL)) + if (LLPipeline::getRenderScriptedTouchBeacons()) { addText(xpos, ypos, beacon_scripted_touch); ypos += y_inc; } - if (LLPipeline::getRenderPhysicalBeacons(NULL)) + if (LLPipeline::getRenderPhysicalBeacons()) { addText(xpos, ypos, "Viewing physical object beacons (green)"); ypos += y_inc; @@ -4501,7 +4501,7 @@ BOOL LLViewerWindow::rawSnapshot(LLImageRaw *raw, S32 image_width, S32 image_hei if ( prev_draw_ui != show_ui) { - LLPipeline::toggleRenderDebugFeature((void*)LLPipeline::RENDER_DEBUG_FEATURE_UI); + LLPipeline::toggleRenderDebugFeature(LLPipeline::RENDER_DEBUG_FEATURE_UI); } BOOL hide_hud = !gSavedSettings.getBOOL("RenderHUDInSnapshot") && LLPipeline::sShowHUDAttachments; @@ -4724,7 +4724,7 @@ BOOL LLViewerWindow::rawSnapshot(LLImageRaw *raw, S32 image_width, S32 image_hei // POST SNAPSHOT if (!gPipeline.hasRenderDebugFeatureMask(LLPipeline::RENDER_DEBUG_FEATURE_UI)) { - LLPipeline::toggleRenderDebugFeature((void*)LLPipeline::RENDER_DEBUG_FEATURE_UI); + LLPipeline::toggleRenderDebugFeature(LLPipeline::RENDER_DEBUG_FEATURE_UI); } if (hide_hud) diff --git a/indra/newview/llvosky.cpp b/indra/newview/llvosky.cpp index 4dab213fa0..6b4a450e6f 100644 --- a/indra/newview/llvosky.cpp +++ b/indra/newview/llvosky.cpp @@ -283,7 +283,7 @@ void LLSkyTex::create(const F32 brightness) S32 offset = basic_offset * sComponents; U32* pix = (U32*)(data + offset); LLColor4U temp = LLColor4U(mSkyData[basic_offset]); - *pix = temp.mAll; + *pix = temp.asRGBA(); } } createGLImage(sCurrent); diff --git a/indra/newview/llvosky.h b/indra/newview/llvosky.h index ee8e91fb71..9cfb9773bd 100644 --- a/indra/newview/llvosky.h +++ b/indra/newview/llvosky.h @@ -171,7 +171,7 @@ protected: { S32 offset = (i * sResolution + j) * sComponents; U32* pix = (U32*) &(mImageRaw[sCurrent]->getData()[offset]); - *pix = col.mAll; + *pix = col.asRGBA(); } LLColor4U getPixel(const S32 i, const S32 j) @@ -179,7 +179,7 @@ protected: LLColor4U col; S32 offset = (i * sResolution + j) * sComponents; U32* pix = (U32*) &(mImageRaw[sCurrent]->getData()[offset]); - col.mAll = *pix; + col.fromRGBA( *pix ); return col; } diff --git a/indra/newview/llwlanimator.h b/indra/newview/llwlanimator.h index 810f4cf7e5..e2e49c7305 100644 --- a/indra/newview/llwlanimator.h +++ b/indra/newview/llwlanimator.h @@ -28,12 +28,11 @@ #define LL_WL_ANIMATOR_H #include "llwlparamset.h" +#include "llenvmanager.h" #include "llwaterparamset.h" #include <string> #include <map> -struct LLWLParamKey; - class LLWLAnimator { public: typedef enum e_time diff --git a/indra/newview/llwlparammanager.h b/indra/newview/llwlparammanager.h index a10102edf7..a55f5bd8fa 100644 --- a/indra/newview/llwlparammanager.h +++ b/indra/newview/llwlparammanager.h @@ -116,100 +116,6 @@ struct WLFloatControl { } }; -struct LLWLParamKey : LLEnvKey -{ -public: - // scope and source of a param set (WL sky preset) - std::string name; - EScope scope; - - // for conversion from LLSD - static const int NAME_IDX = 0; - static const int SCOPE_IDX = 1; - - inline LLWLParamKey(const std::string& n, EScope s) - : name(n), scope(s) - { - } - - inline LLWLParamKey(LLSD llsd) - : name(llsd[NAME_IDX].asString()), scope(EScope(llsd[SCOPE_IDX].asInteger())) - { - } - - inline LLWLParamKey() // NOT really valid, just so std::maps can return a default of some sort - : name(""), scope(SCOPE_LOCAL) - { - } - - inline LLWLParamKey(std::string& stringVal) - { - size_t len = stringVal.length(); - if (len > 0) - { - name = stringVal.substr(0, len - 1); - scope = (EScope) atoi(stringVal.substr(len - 1, len).c_str()); - } - } - - inline std::string toStringVal() const - { - std::stringstream str; - str << name << scope; - return str.str(); - } - - inline LLSD toLLSD() const - { - LLSD llsd = LLSD::emptyArray(); - llsd.append(LLSD(name)); - llsd.append(LLSD(scope)); - return llsd; - } - - inline void fromLLSD(const LLSD& llsd) - { - name = llsd[NAME_IDX].asString(); - scope = EScope(llsd[SCOPE_IDX].asInteger()); - } - - inline bool operator <(const LLWLParamKey other) const - { - if (name < other.name) - { - return true; - } - else if (name > other.name) - { - return false; - } - else - { - return scope < other.scope; - } - } - - inline bool operator ==(const LLWLParamKey other) const - { - return (name == other.name) && (scope == other.scope); - } - - inline std::string toString() const - { - switch (scope) - { - case SCOPE_LOCAL: - return name + std::string(" (") + LLTrans::getString("Local") + std::string(")"); - break; - case SCOPE_REGION: - return name + std::string(" (") + LLTrans::getString("Region") + std::string(")"); - break; - default: - return name + " (?)"; - } - } -}; - /// WindLight parameter manager class - what controls all the wind light shaders class LLWLParamManager : public LLSingleton<LLWLParamManager> { diff --git a/indra/newview/pipeline.cpp b/indra/newview/pipeline.cpp index 19487c3230..c38dafee53 100644 --- a/indra/newview/pipeline.cpp +++ b/indra/newview/pipeline.cpp @@ -130,26 +130,26 @@ bool gShiftFrame = false; //cached settings -BOOL LLPipeline::RenderAvatarVP; -BOOL LLPipeline::VertexShaderEnable; -BOOL LLPipeline::WindLightUseAtmosShaders; -BOOL LLPipeline::RenderDeferred; +bool LLPipeline::RenderAvatarVP; +bool LLPipeline::VertexShaderEnable; +bool LLPipeline::WindLightUseAtmosShaders; +bool LLPipeline::RenderDeferred; F32 LLPipeline::RenderDeferredSunWash; U32 LLPipeline::RenderFSAASamples; U32 LLPipeline::RenderResolutionDivisor; -BOOL LLPipeline::RenderUIBuffer; +bool LLPipeline::RenderUIBuffer; S32 LLPipeline::RenderShadowDetail; -BOOL LLPipeline::RenderDeferredSSAO; +bool LLPipeline::RenderDeferredSSAO; F32 LLPipeline::RenderShadowResolutionScale; -BOOL LLPipeline::RenderLocalLights; -BOOL LLPipeline::RenderDelayCreation; -BOOL LLPipeline::RenderAnimateRes; -BOOL LLPipeline::FreezeTime; +bool LLPipeline::RenderLocalLights; +bool LLPipeline::RenderDelayCreation; +bool LLPipeline::RenderAnimateRes; +bool LLPipeline::FreezeTime; S32 LLPipeline::DebugBeaconLineWidth; F32 LLPipeline::RenderHighlightBrightness; LLColor4 LLPipeline::RenderHighlightColor; F32 LLPipeline::RenderHighlightThickness; -BOOL LLPipeline::RenderSpotLightsInNondeferred; +bool LLPipeline::RenderSpotLightsInNondeferred; LLColor4 LLPipeline::PreviewAmbientColor; LLColor4 LLPipeline::PreviewDiffuse0; LLColor4 LLPipeline::PreviewSpecular0; @@ -169,8 +169,8 @@ S32 LLPipeline::RenderGlowResolutionPow; S32 LLPipeline::RenderGlowIterations; F32 LLPipeline::RenderGlowWidth; F32 LLPipeline::RenderGlowStrength; -BOOL LLPipeline::RenderDepthOfField; -BOOL LLPipeline::RenderDepthOfFieldInEditMode; +bool LLPipeline::RenderDepthOfField; +bool LLPipeline::RenderDepthOfFieldInEditMode; F32 LLPipeline::CameraFocusTransitionTime; F32 LLPipeline::CameraFNumber; F32 LLPipeline::CameraFocalLength; @@ -191,7 +191,7 @@ F32 LLPipeline::RenderEdgeDepthCutoff; F32 LLPipeline::RenderEdgeNormCutoff; LLVector3 LLPipeline::RenderShadowGaussian; F32 LLPipeline::RenderShadowBlurDistFactor; -BOOL LLPipeline::RenderDeferredAtmospheric; +bool LLPipeline::RenderDeferredAtmospheric; S32 LLPipeline::RenderReflectionDetail; F32 LLPipeline::RenderHighlightFadeTime; LLVector3 LLPipeline::RenderShadowClipPlanes; @@ -201,7 +201,7 @@ F32 LLPipeline::RenderFarClip; LLVector3 LLPipeline::RenderShadowSplitExponent; F32 LLPipeline::RenderShadowErrorCutoff; F32 LLPipeline::RenderShadowFOVCutoff; -BOOL LLPipeline::CameraOffset; +bool LLPipeline::CameraOffset; F32 LLPipeline::CameraMaxCoF; F32 LLPipeline::CameraDoFResScale; F32 LLPipeline::RenderAutoHideSurfaceAreaLimit; @@ -216,9 +216,9 @@ extern S32 gBoxFrame; extern BOOL gDisplaySwapBuffers; extern BOOL gDebugGL; -BOOL gAvatarBacklight = FALSE; +bool gAvatarBacklight = false; -BOOL gDebugPipeline = FALSE; +bool gDebugPipeline = false; LLPipeline gPipeline; const LLMatrix4* gGLLastMatrix = NULL; @@ -359,45 +359,45 @@ void display_update_camera(); S32 LLPipeline::sCompiles = 0; -BOOL LLPipeline::sPickAvatar = TRUE; -BOOL LLPipeline::sDynamicLOD = TRUE; -BOOL LLPipeline::sShowHUDAttachments = TRUE; -BOOL LLPipeline::sRenderMOAPBeacons = FALSE; -BOOL LLPipeline::sRenderPhysicalBeacons = TRUE; -BOOL LLPipeline::sRenderScriptedBeacons = FALSE; -BOOL LLPipeline::sRenderScriptedTouchBeacons = TRUE; -BOOL LLPipeline::sRenderParticleBeacons = FALSE; -BOOL LLPipeline::sRenderSoundBeacons = FALSE; -BOOL LLPipeline::sRenderBeacons = FALSE; -BOOL LLPipeline::sRenderHighlight = TRUE; +bool LLPipeline::sPickAvatar = true; +bool LLPipeline::sDynamicLOD = true; +bool LLPipeline::sShowHUDAttachments = true; +bool LLPipeline::sRenderMOAPBeacons = false; +bool LLPipeline::sRenderPhysicalBeacons = true; +bool LLPipeline::sRenderScriptedBeacons = false; +bool LLPipeline::sRenderScriptedTouchBeacons = true; +bool LLPipeline::sRenderParticleBeacons = false; +bool LLPipeline::sRenderSoundBeacons = false; +bool LLPipeline::sRenderBeacons = false; +bool LLPipeline::sRenderHighlight = true; LLRender::eTexIndex LLPipeline::sRenderHighlightTextureChannel = LLRender::DIFFUSE_MAP; -BOOL LLPipeline::sForceOldBakedUpload = FALSE; +bool LLPipeline::sForceOldBakedUpload = false; S32 LLPipeline::sUseOcclusion = 0; -BOOL LLPipeline::sDelayVBUpdate = TRUE; -BOOL LLPipeline::sAutoMaskAlphaDeferred = TRUE; -BOOL LLPipeline::sAutoMaskAlphaNonDeferred = FALSE; -BOOL LLPipeline::sDisableShaders = FALSE; -BOOL LLPipeline::sRenderBump = TRUE; -BOOL LLPipeline::sBakeSunlight = FALSE; -BOOL LLPipeline::sNoAlpha = FALSE; -BOOL LLPipeline::sUseTriStrips = TRUE; -BOOL LLPipeline::sUseFarClip = TRUE; -BOOL LLPipeline::sShadowRender = FALSE; -BOOL LLPipeline::sWaterReflections = FALSE; -BOOL LLPipeline::sRenderGlow = FALSE; -BOOL LLPipeline::sReflectionRender = FALSE; -BOOL LLPipeline::sImpostorRender = FALSE; -BOOL LLPipeline::sImpostorRenderAlphaDepthPass = FALSE; -BOOL LLPipeline::sUnderWaterRender = FALSE; -BOOL LLPipeline::sTextureBindTest = FALSE; -BOOL LLPipeline::sRenderFrameTest = FALSE; -BOOL LLPipeline::sRenderAttachedLights = TRUE; -BOOL LLPipeline::sRenderAttachedParticles = TRUE; -BOOL LLPipeline::sRenderDeferred = FALSE; -BOOL LLPipeline::sMemAllocationThrottled = FALSE; +bool LLPipeline::sDelayVBUpdate = true; +bool LLPipeline::sAutoMaskAlphaDeferred = true; +bool LLPipeline::sAutoMaskAlphaNonDeferred = false; +bool LLPipeline::sDisableShaders = false; +bool LLPipeline::sRenderBump = true; +bool LLPipeline::sBakeSunlight = false; +bool LLPipeline::sNoAlpha = false; +bool LLPipeline::sUseTriStrips = true; +bool LLPipeline::sUseFarClip = true; +bool LLPipeline::sShadowRender = false; +bool LLPipeline::sWaterReflections = false; +bool LLPipeline::sRenderGlow = false; +bool LLPipeline::sReflectionRender = false; +bool LLPipeline::sImpostorRender = false; +bool LLPipeline::sImpostorRenderAlphaDepthPass = false; +bool LLPipeline::sUnderWaterRender = false; +bool LLPipeline::sTextureBindTest = false; +bool LLPipeline::sRenderFrameTest = false; +bool LLPipeline::sRenderAttachedLights = true; +bool LLPipeline::sRenderAttachedParticles = true; +bool LLPipeline::sRenderDeferred = false; +bool LLPipeline::sMemAllocationThrottled = false; S32 LLPipeline::sVisibleLightCount = 0; F32 LLPipeline::sMinRenderSize = 0.f; -BOOL LLPipeline::sRenderingHUDs; +bool LLPipeline::sRenderingHUDs; // EventHost API LLPipeline listener. static LLPipelineListener sPipelineListener; @@ -414,14 +414,14 @@ bool addDeferredAttachments(LLRenderTarget& target) } LLPipeline::LLPipeline() : - mBackfaceCull(FALSE), + mBackfaceCull(false), mMatrixOpCount(0), mTextureMatrixOps(0), mNumVisibleNodes(0), mNumVisibleFaces(0), - mInitialized(FALSE), - mVertexShadersEnabled(FALSE), + mInitialized(false), + mVertexShadersEnabled(false), mVertexShadersLoaded(0), mTransformFeedbackPrimitives(0), mRenderDebugFeatureMask(0), @@ -486,7 +486,7 @@ void LLPipeline::init() sRenderAttachedLights = gSavedSettings.getBOOL("RenderAttachedLights"); sRenderAttachedParticles = gSavedSettings.getBOOL("RenderAttachedParticles"); - mInitialized = TRUE; + mInitialized = true; stop_glerror(); @@ -539,7 +539,7 @@ void LLPipeline::init() mOldRenderDebugMask = mRenderDebugMask; - mBackfaceCull = TRUE; + mBackfaceCull = true; stop_glerror(); @@ -724,7 +724,7 @@ void LLPipeline::cleanup() mMovedBridge.clear(); - mInitialized = FALSE; + mInitialized = false; mDeferredVB = NULL; @@ -760,7 +760,7 @@ void LLPipeline::destroyGL() static LLTrace::BlockTimerStatHandle FTM_RESIZE_SCREEN_TEXTURE("Resize Screen Texture"); //static -void LLPipeline::throttleNewMemoryAllocation(BOOL disable) +void LLPipeline::throttleNewMemoryAllocation(bool disable) { if(sMemAllocationThrottled != disable) { @@ -933,7 +933,7 @@ bool LLPipeline::allocateScreenBuffer(U32 resX, U32 resY, U32 samples) if (LLPipeline::sRenderDeferred) { S32 shadow_detail = RenderShadowDetail; - BOOL ssao = RenderDeferredSSAO; + bool ssao = RenderDeferredSSAO; const U32 occlusion_divisor = 3; @@ -1059,19 +1059,19 @@ void LLPipeline::updateRenderBump() //static void LLPipeline::updateRenderDeferred() { - BOOL deferred = ((RenderDeferred && + bool deferred = (bool(RenderDeferred && LLRenderTarget::sUseFBO && LLFeatureManager::getInstance()->isFeatureAvailable("RenderDeferred") && LLPipeline::sRenderBump && VertexShaderEnable && RenderAvatarVP && - WindLightUseAtmosShaders) ? TRUE : FALSE) && + WindLightUseAtmosShaders)) && !gUseWireframe; sRenderDeferred = deferred; if (deferred) { //must render glow when rendering deferred since post effect pass is needed to present any lighting at all - sRenderGlow = TRUE; + sRenderGlow = true; } } @@ -1414,7 +1414,7 @@ void LLPipeline::restoreGL() } -BOOL LLPipeline::canUseVertexShaders() +bool LLPipeline::canUseVertexShaders() { static const std::string vertex_shader_enable_feature_string = "VertexShaderEnable"; @@ -1424,30 +1424,30 @@ BOOL LLPipeline::canUseVertexShaders() !LLFeatureManager::getInstance()->isFeatureAvailable(vertex_shader_enable_feature_string) || (assertInitialized() && mVertexShadersLoaded != 1) ) { - return FALSE; + return false; } else { - return TRUE; + return true; } } -BOOL LLPipeline::canUseWindLightShaders() const +bool LLPipeline::canUseWindLightShaders() const { return (!LLPipeline::sDisableShaders && gWLSkyProgram.mProgramObject != 0 && LLViewerShaderMgr::instance()->getVertexShaderLevel(LLViewerShaderMgr::SHADER_WINDLIGHT) > 1); } -BOOL LLPipeline::canUseWindLightShadersOnObjects() const +bool LLPipeline::canUseWindLightShadersOnObjects() const { return (canUseWindLightShaders() && LLViewerShaderMgr::instance()->getVertexShaderLevel(LLViewerShaderMgr::SHADER_OBJECT) > 0); } -BOOL LLPipeline::canUseAntiAliasing() const +bool LLPipeline::canUseAntiAliasing() const { - return TRUE; + return true; } void LLPipeline::unloadShaders() @@ -1464,7 +1464,7 @@ void LLPipeline::assertInitializedDoError() //============================================================================ -void LLPipeline::enableShadows(const BOOL enable_shadows) +void LLPipeline::enableShadows(const bool enable_shadows) { //should probably do something here to wrangle shadows.... } @@ -2002,7 +2002,7 @@ void LLPipeline::updateMovedList(LLDrawable::drawable_vector_t& moved_list) { LLDrawable::drawable_vector_t::iterator curiter = iter++; LLDrawable *drawablep = *curiter; - BOOL done = TRUE; + bool done = true; if (!drawablep->isDead() && (!drawablep->isState(LLDrawable::EARLY_MOVE))) { done = drawablep->updateMove(); @@ -2330,7 +2330,7 @@ void LLPipeline::checkReferences(LLSpatialGroup* group) } -BOOL LLPipeline::visibleObjectsInFrustum(LLCamera& camera) +bool LLPipeline::visibleObjectsInFrustum(LLCamera& camera) { for (LLWorld::region_list_t::const_iterator iter = LLWorld::getInstance()->getRegionList().begin(); iter != LLWorld::getInstance()->getRegionList().end(); ++iter) @@ -2346,17 +2346,17 @@ BOOL LLPipeline::visibleObjectsInFrustum(LLCamera& camera) { if (part->visibleObjectsInFrustum(camera)) { - return TRUE; + return true; } } } } } - return FALSE; + return false; } -BOOL LLPipeline::getVisibleExtents(LLCamera& camera, LLVector3& min, LLVector3& max) +bool LLPipeline::getVisibleExtents(LLCamera& camera, LLVector3& min, LLVector3& max) { const F32 X = 65536.f; @@ -2366,7 +2366,7 @@ BOOL LLPipeline::getVisibleExtents(LLCamera& camera, LLVector3& min, LLVector3& LLViewerCamera::eCameraID saved_camera_id = LLViewerCamera::sCurCameraID; LLViewerCamera::sCurCameraID = LLViewerCamera::CAMERA_WORLD; - BOOL res = TRUE; + bool res = true; for (LLWorld::region_list_t::const_iterator iter = LLWorld::getInstance()->getRegionList().begin(); iter != LLWorld::getInstance()->getRegionList().end(); ++iter) @@ -2382,7 +2382,7 @@ BOOL LLPipeline::getVisibleExtents(LLCamera& camera, LLVector3& min, LLVector3& { if (!part->getVisibleExtents(camera, min, max)) { - res = FALSE; + res = false; } } } @@ -2409,7 +2409,7 @@ void LLPipeline::updateCull(LLCamera& camera, LLCullResult& result, S32 water_cl sCull->clear(); - BOOL to_texture = LLPipeline::sUseOcclusion > 1 && + bool to_texture = LLPipeline::sUseOcclusion > 1 && !hasRenderType(LLPipeline::RENDER_TYPE_HUD) && LLViewerCamera::sCurCameraID == LLViewerCamera::CAMERA_WORLD && gPipeline.canUseVertexShaders() && @@ -2789,9 +2789,9 @@ void LLPipeline::doOcclusion(LLCamera& camera) } } -BOOL LLPipeline::updateDrawableGeom(LLDrawable* drawablep, BOOL priority) +bool LLPipeline::updateDrawableGeom(LLDrawable* drawablep, bool priority) { - BOOL update_complete = drawablep->updateGeometry(priority); + bool update_complete = drawablep->updateGeometry(priority); if (update_complete && assertInitialized()) { drawablep->setState(LLDrawable::BUILT); @@ -3078,7 +3078,7 @@ void LLPipeline::updateGeom(F32 max_dtime) last_group = drawablep->getSpatialGroup(); last_bridge = bridge; - BOOL update_complete = TRUE; + bool update_complete = true; if (!drawablep->isDead()) { update_complete = updateDrawableGeom(drawablep, FALSE); @@ -3135,7 +3135,7 @@ void LLPipeline::markVisible(LLDrawable *drawablep, LLCamera& camera) } } -void LLPipeline::markMoved(LLDrawable *drawablep, BOOL damped_motion) +void LLPipeline::markMoved(LLDrawable *drawablep, bool damped_motion) { if (!drawablep) { @@ -3169,7 +3169,7 @@ void LLPipeline::markMoved(LLDrawable *drawablep, BOOL damped_motion) } drawablep->setState(LLDrawable::ON_MOVE_LIST); } - if (damped_motion == FALSE) + if (! damped_motion) { drawablep->setState(LLDrawable::MOVE_UNDAMPED); // UNDAMPED trumps DAMPED } @@ -3209,7 +3209,7 @@ void LLPipeline::shiftObjects(const LLVector3 &offset) assertInitialized(); glClear(GL_DEPTH_BUFFER_BIT); - gDepthDirty = TRUE; + gDepthDirty = true; LLVector4a offseta; offseta.load3(offset.mV); @@ -3307,13 +3307,13 @@ void LLPipeline::markMeshDirty(LLSpatialGroup* group) mMeshDirtyGroup.push_back(group); } -void LLPipeline::markRebuild(LLSpatialGroup* group, BOOL priority) +void LLPipeline::markRebuild(LLSpatialGroup* group, bool priority) { if (group && !group->isDead() && group->getSpatialPartition()) { if (group->getSpatialPartition()->mPartitionType == LLViewerRegion::PARTITION_HUD) { - priority = TRUE; + priority = true; } if (priority) @@ -3346,13 +3346,13 @@ void LLPipeline::markRebuild(LLSpatialGroup* group, BOOL priority) } } -void LLPipeline::markRebuild(LLDrawable *drawablep, LLDrawable::EDrawableFlags flag, BOOL priority) +void LLPipeline::markRebuild(LLDrawable *drawablep, LLDrawable::EDrawableFlags flag, bool priority) { if (drawablep && !drawablep->isDead() && assertInitialized()) { if (!drawablep->isState(LLDrawable::BUILT)) { - priority = TRUE; + priority = true; } if (priority) { @@ -3721,17 +3721,17 @@ void renderMOAPBeacons(LLDrawable* drawablep) if(!vobj || vobj->isAvatar()) return; - BOOL beacon=FALSE; + bool beacon=false; U8 tecount=vobj->getNumTEs(); for(int x=0;x<tecount;x++) { if(vobj->getTE(x)->hasMedia()) { - beacon=TRUE; + beacon=true; break; } } - if(beacon==TRUE) + if(beacon) { if (gPipeline.sRenderBeacons) { @@ -4310,7 +4310,7 @@ void LLPipeline::renderHighlights() //debug use U32 LLPipeline::sCurRenderPoolType = 0 ; -void LLPipeline::renderGeom(LLCamera& camera, BOOL forceVBOUpdate) +void LLPipeline::renderGeom(LLCamera& camera, bool forceVBOUpdate) { LL_RECORD_BLOCK_TIME(FTM_RENDER_GEOMETRY); @@ -4367,13 +4367,13 @@ void LLPipeline::renderGeom(LLCamera& camera, BOOL forceVBOUpdate) // Toggle backface culling for debugging LLGLEnable cull_face(mBackfaceCull ? GL_CULL_FACE : 0); // Set fog - BOOL use_fog = hasRenderDebugFeatureMask(LLPipeline::RENDER_DEBUG_FEATURE_FOG); + bool use_fog = hasRenderDebugFeatureMask(LLPipeline::RENDER_DEBUG_FEATURE_FOG); LLGLEnable fog_enable(use_fog && !gPipeline.canUseWindLightShadersOnObjects() ? GL_FOG : 0); gSky.updateFog(camera.getFar()); if (!use_fog) { - sUnderWaterRender = FALSE; + sUnderWaterRender = false; } gGL.getTexUnit(0)->bind(LLViewerFetchedTexture::sDefaultImagep); @@ -4410,7 +4410,7 @@ void LLPipeline::renderGeom(LLCamera& camera, BOOL forceVBOUpdate) setupHWLights(NULL); } - BOOL occlude = sUseOcclusion > 1; + bool occlude = sUseOcclusion > 1; U32 cur_type = 0; pool_set_t::iterator iter1 = mPools.begin(); @@ -4425,7 +4425,7 @@ void LLPipeline::renderGeom(LLCamera& camera, BOOL forceVBOUpdate) if (occlude && cur_type >= LLDrawPool::POOL_GRASS) { - occlude = FALSE; + occlude = false; gGLLastMatrix = NULL; gGL.loadMatrix(gGLModelView); LLGLSLShader::bindNoShader(); @@ -4490,7 +4490,7 @@ void LLPipeline::renderGeom(LLCamera& camera, BOOL forceVBOUpdate) if (occlude) { - occlude = FALSE; + occlude = false; gGLLastMatrix = NULL; gGL.loadMatrix(gGLModelView); LLGLSLShader::bindNoShader(); @@ -4673,7 +4673,7 @@ void LLPipeline::renderGeomPostDeferred(LLCamera& camera, bool do_occlusion) gGL.setColorMask(true, false); pool_set_t::iterator iter1 = mPools.begin(); - BOOL occlude = LLPipeline::sUseOcclusion > 1 && do_occlusion; + bool occlude = LLPipeline::sUseOcclusion > 1 && do_occlusion; while ( iter1 != mPools.end() ) { @@ -4683,7 +4683,7 @@ void LLPipeline::renderGeomPostDeferred(LLCamera& camera, bool do_occlusion) if (occlude && cur_type >= LLDrawPool::POOL_GRASS) { - occlude = FALSE; + occlude = false; gGLLastMatrix = NULL; gGL.loadMatrix(gGLModelView); LLGLSLShader::bindNoShader(); @@ -4743,7 +4743,7 @@ void LLPipeline::renderGeomPostDeferred(LLCamera& camera, bool do_occlusion) if (occlude) { - occlude = FALSE; + occlude = false; gGLLastMatrix = NULL; gGL.loadMatrix(gGLModelView); LLGLSLShader::bindNoShader(); @@ -5885,7 +5885,7 @@ void LLPipeline::removeFromQuickLookup( LLDrawPool* poolp ) case LLDrawPool::POOL_TREE: #ifdef _DEBUG { - BOOL found = mTreePools.erase( (uintptr_t)poolp->getTexture() ); + bool found = mTreePools.erase( (uintptr_t)poolp->getTexture() ); llassert( found ); } #else @@ -5896,7 +5896,7 @@ void LLPipeline::removeFromQuickLookup( LLDrawPool* poolp ) case LLDrawPool::POOL_TERRAIN: #ifdef _DEBUG { - BOOL found = mTerrainPools.erase( (uintptr_t)poolp->getTexture() ); + bool found = mTerrainPools.erase( (uintptr_t)poolp->getTexture() ); llassert( found ); } #else @@ -5959,7 +5959,7 @@ void LLPipeline::resetDrawOrders() // Once-per-frame setup of hardware lights, // including sun/moon, avatar backlight, and up to 6 local lights -void LLPipeline::setupAvatarLights(BOOL for_edit) +void LLPipeline::setupAvatarLights(bool for_edit) { assertInitialized(); @@ -6064,7 +6064,7 @@ static F32 calc_light_dist(LLVOVolume* light, const LLVector3& cam_pos, F32 max_ return max_dist; } F32 radius = light->getLightRadius(); - BOOL selected = light->isSelected(); + bool selected = light->isSelected(); LLVector3 dpos = light->getRenderPosition() - cam_pos; F32 dist2 = dpos.lengthSquared(); if (!selected && dist2 > (max_dist + radius)*(max_dist + radius)) @@ -6659,9 +6659,9 @@ void LLPipeline::findReferences(LLDrawable *drawablep) } } -BOOL LLPipeline::verify() +bool LLPipeline::verify() { - BOOL ok = assertInitialized(); + bool ok = assertInitialized(); if (ok) { for (pool_set_t::iterator iter = mPools.begin(); iter != mPools.end(); ++iter) @@ -6669,7 +6669,7 @@ BOOL LLPipeline::verify() LLDrawPool *poolp = *iter; if (!poolp->verify()) { - ok = FALSE; + ok = false; } } } @@ -6714,7 +6714,7 @@ BOOL LLPipeline::verify() bool LLRayAABB(const LLVector3 ¢er, const LLVector3 &size, const LLVector3& origin, const LLVector3& dir, LLVector3 &coord, F32 epsilon) { - BOOL Inside = TRUE; + bool Inside = true; LLVector3 MinB = center - size; LLVector3 MaxB = center + size; LLVector3 MaxT; @@ -6726,7 +6726,7 @@ bool LLRayAABB(const LLVector3 ¢er, const LLVector3 &size, const LLVector3& if(origin.mV[i] < MinB.mV[i]) { coord.mV[i] = MinB.mV[i]; - Inside = FALSE; + Inside = false; // Calculate T distances to candidate planes if(IR(dir.mV[i])) MaxT.mV[i] = (MinB.mV[i] - origin.mV[i]) / dir.mV[i]; @@ -6734,7 +6734,7 @@ bool LLRayAABB(const LLVector3 ¢er, const LLVector3 &size, const LLVector3& else if(origin.mV[i] > MaxB.mV[i]) { coord.mV[i] = MaxB.mV[i]; - Inside = FALSE; + Inside = false; // Calculate T distances to candidate planes if(IR(dir.mV[i])) MaxT.mV[i] = (MaxB.mV[i] - origin.mV[i]) / dir.mV[i]; @@ -6780,7 +6780,7 @@ bool LLRayAABB(const LLVector3 ¢er, const LLVector3 &size, const LLVector3& // // -void LLPipeline::setLight(LLDrawable *drawablep, BOOL is_light) +void LLPipeline::setLight(LLDrawable *drawablep, bool is_light) { if (drawablep && assertInitialized()) { @@ -6808,9 +6808,8 @@ void LLPipeline::toggleRenderType(U32 type) } //static -void LLPipeline::toggleRenderTypeControl(void* data) +void LLPipeline::toggleRenderTypeControl(U32 type) { - U32 type = (U32)(intptr_t)data; U32 bit = (1<<type); if (gPipeline.hasRenderType(type)) { @@ -6824,24 +6823,21 @@ void LLPipeline::toggleRenderTypeControl(void* data) } //static -BOOL LLPipeline::hasRenderTypeControl(void* data) +bool LLPipeline::hasRenderTypeControl(U32 type) { - U32 type = (U32)(intptr_t)data; return gPipeline.hasRenderType(type); } // Allows UI items labeled "Hide foo" instead of "Show foo" //static -BOOL LLPipeline::toggleRenderTypeControlNegated(void* data) +bool LLPipeline::toggleRenderTypeControlNegated(S32 type) { - S32 type = (S32)(intptr_t)data; return !gPipeline.hasRenderType(type); } //static -void LLPipeline::toggleRenderDebug(void* data) +void LLPipeline::toggleRenderDebug(U32 bit) { - U32 bit = (U32)(intptr_t)data; if (gPipeline.hasRenderDebugMask(bit)) { LL_INFOS() << "Toggling render debug mask " << std::hex << bit << " off" << std::dec << LL_ENDL; @@ -6855,24 +6851,21 @@ void LLPipeline::toggleRenderDebug(void* data) //static -BOOL LLPipeline::toggleRenderDebugControl(void* data) +bool LLPipeline::toggleRenderDebugControl(U32 bit) { - U32 bit = (U32)(intptr_t)data; return gPipeline.hasRenderDebugMask(bit); } //static -void LLPipeline::toggleRenderDebugFeature(void* data) +void LLPipeline::toggleRenderDebugFeature(U32 bit) { - U32 bit = (U32)(intptr_t)data; gPipeline.mRenderDebugFeatureMask ^= bit; } //static -BOOL LLPipeline::toggleRenderDebugFeatureControl(void* data) +bool LLPipeline::toggleRenderDebugFeatureControl(U32 bit) { - U32 bit = (U32)(intptr_t)data; return gPipeline.hasRenderDebugFeatureMask(bit); } @@ -6905,145 +6898,145 @@ void LLPipeline::popRenderDebugFeatureMask() } // static -void LLPipeline::setRenderScriptedBeacons(BOOL val) +void LLPipeline::setRenderScriptedBeacons(bool val) { sRenderScriptedBeacons = val; } // static -void LLPipeline::toggleRenderScriptedBeacons(void*) +void LLPipeline::toggleRenderScriptedBeacons() { sRenderScriptedBeacons = !sRenderScriptedBeacons; } // static -BOOL LLPipeline::getRenderScriptedBeacons(void*) +bool LLPipeline::getRenderScriptedBeacons() { return sRenderScriptedBeacons; } // static -void LLPipeline::setRenderScriptedTouchBeacons(BOOL val) +void LLPipeline::setRenderScriptedTouchBeacons(bool val) { sRenderScriptedTouchBeacons = val; } // static -void LLPipeline::toggleRenderScriptedTouchBeacons(void*) +void LLPipeline::toggleRenderScriptedTouchBeacons() { sRenderScriptedTouchBeacons = !sRenderScriptedTouchBeacons; } // static -BOOL LLPipeline::getRenderScriptedTouchBeacons(void*) +bool LLPipeline::getRenderScriptedTouchBeacons() { return sRenderScriptedTouchBeacons; } // static -void LLPipeline::setRenderMOAPBeacons(BOOL val) +void LLPipeline::setRenderMOAPBeacons(bool val) { sRenderMOAPBeacons = val; } // static -void LLPipeline::toggleRenderMOAPBeacons(void*) +void LLPipeline::toggleRenderMOAPBeacons() { sRenderMOAPBeacons = !sRenderMOAPBeacons; } // static -BOOL LLPipeline::getRenderMOAPBeacons(void*) +bool LLPipeline::getRenderMOAPBeacons() { return sRenderMOAPBeacons; } // static -void LLPipeline::setRenderPhysicalBeacons(BOOL val) +void LLPipeline::setRenderPhysicalBeacons(bool val) { sRenderPhysicalBeacons = val; } // static -void LLPipeline::toggleRenderPhysicalBeacons(void*) +void LLPipeline::toggleRenderPhysicalBeacons() { sRenderPhysicalBeacons = !sRenderPhysicalBeacons; } // static -BOOL LLPipeline::getRenderPhysicalBeacons(void*) +bool LLPipeline::getRenderPhysicalBeacons() { return sRenderPhysicalBeacons; } // static -void LLPipeline::setRenderParticleBeacons(BOOL val) +void LLPipeline::setRenderParticleBeacons(bool val) { sRenderParticleBeacons = val; } // static -void LLPipeline::toggleRenderParticleBeacons(void*) +void LLPipeline::toggleRenderParticleBeacons() { sRenderParticleBeacons = !sRenderParticleBeacons; } // static -BOOL LLPipeline::getRenderParticleBeacons(void*) +bool LLPipeline::getRenderParticleBeacons() { return sRenderParticleBeacons; } // static -void LLPipeline::setRenderSoundBeacons(BOOL val) +void LLPipeline::setRenderSoundBeacons(bool val) { sRenderSoundBeacons = val; } // static -void LLPipeline::toggleRenderSoundBeacons(void*) +void LLPipeline::toggleRenderSoundBeacons() { sRenderSoundBeacons = !sRenderSoundBeacons; } // static -BOOL LLPipeline::getRenderSoundBeacons(void*) +bool LLPipeline::getRenderSoundBeacons() { return sRenderSoundBeacons; } // static -void LLPipeline::setRenderBeacons(BOOL val) +void LLPipeline::setRenderBeacons(bool val) { sRenderBeacons = val; } // static -void LLPipeline::toggleRenderBeacons(void*) +void LLPipeline::toggleRenderBeacons() { sRenderBeacons = !sRenderBeacons; } // static -BOOL LLPipeline::getRenderBeacons(void*) +bool LLPipeline::getRenderBeacons() { return sRenderBeacons; } // static -void LLPipeline::setRenderHighlights(BOOL val) +void LLPipeline::setRenderHighlights(bool val) { sRenderHighlight = val; } // static -void LLPipeline::toggleRenderHighlights(void*) +void LLPipeline::toggleRenderHighlights() { sRenderHighlight = !sRenderHighlight; } // static -BOOL LLPipeline::getRenderHighlights(void*) +bool LLPipeline::getRenderHighlights() { return sRenderHighlight; } @@ -7097,8 +7090,8 @@ LLVOPartGroup* LLPipeline::lineSegmentIntersectParticle(const LLVector4a& start, } LLViewerObject* LLPipeline::lineSegmentIntersectInWorld(const LLVector4a& start, const LLVector4a& end, - BOOL pick_transparent, - BOOL pick_rigged, + bool pick_transparent, + bool pick_rigged, S32* face_hit, LLVector4a* intersection, // return the intersection point LLVector2* tex_coord, // return the texture coordinates of the intersection point @@ -7112,7 +7105,7 @@ LLViewerObject* LLPipeline::lineSegmentIntersectInWorld(const LLVector4a& start, LLVector4a position; - sPickAvatar = FALSE; //LLToolMgr::getInstance()->inBuildMode() ? FALSE : TRUE; + sPickAvatar = false; //! LLToolMgr::getInstance()->inBuildMode(); for (LLWorld::region_list_t::const_iterator iter = LLWorld::getInstance()->getRegionList().begin(); iter != LLWorld::getInstance()->getRegionList().end(); ++iter) @@ -7178,7 +7171,7 @@ LLViewerObject* LLPipeline::lineSegmentIntersectInWorld(const LLVector4a& start, const F32 ATTACHMENT_OVERRIDE_DIST = 0.1f; //check against avatars - sPickAvatar = TRUE; + sPickAvatar = true; for (LLWorld::region_list_t::const_iterator iter = LLWorld::getInstance()->getRegionList().begin(); iter != LLWorld::getInstance()->getRegionList().end(); ++iter) { @@ -7250,7 +7243,7 @@ LLViewerObject* LLPipeline::lineSegmentIntersectInWorld(const LLVector4a& start, } LLViewerObject* LLPipeline::lineSegmentIntersectInHUD(const LLVector4a& start, const LLVector4a& end, - BOOL pick_transparent, + bool pick_transparent, S32* face_hit, LLVector4a* intersection, // return the intersection point LLVector2* tex_coord, // return the texture coordinates of the intersection point @@ -7265,11 +7258,11 @@ LLViewerObject* LLPipeline::lineSegmentIntersectInHUD(const LLVector4a& start, c { LLViewerRegion* region = *iter; - BOOL toggle = FALSE; + bool toggle = false; if (!hasRenderType(LLPipeline::RENDER_TYPE_HUD)) { toggleRenderType(LLPipeline::RENDER_TYPE_HUD); - toggle = TRUE; + toggle = true; } LLSpatialPartition* part = region->getSpatialPartition(LLViewerRegion::PARTITION_HUD); @@ -7418,7 +7411,7 @@ void LLPipeline::doResetVertexBuffers(bool forced) LLVOPartGroup::restoreGL(); } -void LLPipeline::renderObjects(U32 type, U32 mask, BOOL texture, BOOL batch_texture) +void LLPipeline::renderObjects(U32 type, U32 mask, bool texture, bool batch_texture) { assertInitialized(); gGL.loadMatrix(gGLModelView); @@ -7428,7 +7421,7 @@ void LLPipeline::renderObjects(U32 type, U32 mask, BOOL texture, BOOL batch_text gGLLastMatrix = NULL; } -void LLPipeline::renderMaskedObjects(U32 type, U32 mask, BOOL texture, BOOL batch_texture) +void LLPipeline::renderMaskedObjects(U32 type, U32 mask, bool texture, bool batch_texture) { assertInitialized(); gGL.loadMatrix(gGLModelView); @@ -7501,7 +7494,7 @@ void LLPipeline::bindScreenToTexture() static LLTrace::BlockTimerStatHandle FTM_RENDER_BLOOM("Bloom"); -void LLPipeline::renderBloom(BOOL for_snapshot, F32 zoom_factor, int subfield) +void LLPipeline::renderBloom(bool for_snapshot, F32 zoom_factor, int subfield) { if (!(gPipeline.canUseVertexShaders() && sRenderGlow)) @@ -8617,7 +8610,7 @@ void LLPipeline::renderDeferredLighting() gPipeline.popRenderTypeMask(); } - BOOL render_local = RenderLocalLights; + bool render_local = RenderLocalLights; if (render_local) { @@ -9170,7 +9163,7 @@ void LLPipeline::renderDeferredLightingToRT(LLRenderTarget* target) gPipeline.popRenderTypeMask(); } - BOOL render_local = RenderLocalLights; + bool render_local = RenderLocalLights; if (render_local) { @@ -9729,10 +9722,10 @@ void LLPipeline::generateWaterReflection(LLCamera& camera_in) { if (LLPipeline::sWaterReflections && assertInitialized() && LLDrawPoolWater::sNeedsReflectionUpdate) { - BOOL skip_avatar_update = FALSE; + bool skip_avatar_update = false; if (!isAgentAvatarValid() || gAgentCamera.getCameraAnimating() || gAgentCamera.getCameraMode() != CAMERA_MODE_MOUSELOOK || !LLVOAvatar::sVisibleInFirstPerson) { - skip_avatar_update = TRUE; + skip_avatar_update = true; } if (!skip_avatar_update) @@ -9747,7 +9740,7 @@ void LLPipeline::generateWaterReflection(LLCamera& camera_in) LLCamera camera = camera_in; camera.setFar(camera.getFar()*0.87654321f); - LLPipeline::sReflectionRender = TRUE; + LLPipeline::sReflectionRender = true; gPipeline.pushRenderTypeMask(); @@ -9933,7 +9926,7 @@ void LLPipeline::generateWaterReflection(LLCamera& camera_in) camera.setOrigin(camera_in.getOrigin()); //render distortion map - static BOOL last_update = TRUE; + static bool last_update = true; if (last_update) { camera.setFar(camera_in.getFar()); @@ -9943,7 +9936,7 @@ void LLPipeline::generateWaterReflection(LLCamera& camera_in) END_RENDER_TYPES); stop_glerror(); - LLPipeline::sUnderWaterRender = LLViewerCamera::getInstance()->cameraUnderWater() ? FALSE : TRUE; + LLPipeline::sUnderWaterRender = ! LLViewerCamera::getInstance()->cameraUnderWater(); if (LLPipeline::sUnderWaterRender) { @@ -10005,12 +9998,12 @@ void LLPipeline::generateWaterReflection(LLCamera& camera_in) } mWaterDis.flush(); - LLPipeline::sUnderWaterRender = FALSE; + LLPipeline::sUnderWaterRender = false; } last_update = LLDrawPoolWater::sNeedsReflectionUpdate && LLDrawPoolWater::sNeedsDistortionUpdate; - LLPipeline::sReflectionRender = FALSE; + LLPipeline::sReflectionRender = false; if (!LLRenderTarget::sUseFBO) { @@ -10105,7 +10098,7 @@ static LLTrace::BlockTimerStatHandle FTM_SHADOW_RENDER("Render Shadows"); static LLTrace::BlockTimerStatHandle FTM_SHADOW_ALPHA("Alpha Shadow"); static LLTrace::BlockTimerStatHandle FTM_SHADOW_SIMPLE("Simple Shadow"); -void LLPipeline::renderShadow(glh::matrix4f& view, glh::matrix4f& proj, LLCamera& shadow_cam, LLCullResult &result, BOOL use_shader, BOOL use_occlusion, U32 target_width) +void LLPipeline::renderShadow(glh::matrix4f& view, glh::matrix4f& proj, LLCamera& shadow_cam, LLCullResult &result, bool use_shader, bool use_occlusion, U32 target_width) { LL_RECORD_BLOCK_TIME(FTM_SHADOW_RENDER); @@ -10115,7 +10108,7 @@ void LLPipeline::renderShadow(glh::matrix4f& view, glh::matrix4f& proj, LLCamera { LLPipeline::sUseOcclusion = 0; } - LLPipeline::sShadowRender = TRUE; + LLPipeline::sShadowRender = true; U32 types[] = { LLRenderPass::PASS_SIMPLE, @@ -10258,18 +10251,18 @@ void LLPipeline::renderShadow(glh::matrix4f& view, glh::matrix4f& proj, LLCamera gGLLastMatrix = NULL; LLPipeline::sUseOcclusion = occlude; - LLPipeline::sShadowRender = FALSE; + LLPipeline::sShadowRender = false; } static LLTrace::BlockTimerStatHandle FTM_VISIBLE_CLOUD("Visible Cloud"); -BOOL LLPipeline::getVisiblePointCloud(LLCamera& camera, LLVector3& min, LLVector3& max, std::vector<LLVector3>& fp, LLVector3 light_dir) +bool LLPipeline::getVisiblePointCloud(LLCamera& camera, LLVector3& min, LLVector3& max, std::vector<LLVector3>& fp, LLVector3 light_dir) { LL_RECORD_BLOCK_TIME(FTM_VISIBLE_CLOUD); //get point cloud of intersection of frust and min, max if (getVisibleExtents(camera, min, max)) { - return FALSE; + return false; } //get set of planes on bounding box @@ -10427,10 +10420,10 @@ BOOL LLPipeline::getVisiblePointCloud(LLCamera& camera, LLVector3& min, LLVector if (fp.empty()) { - return FALSE; + return false; } - return TRUE; + return true; } void LLPipeline::renderHighlight(const LLViewerObject* obj, F32 fade) @@ -10522,11 +10515,11 @@ void LLPipeline::generateSunShadow(LLCamera& camera) LL_RECORD_BLOCK_TIME(FTM_GEN_SUN_SHADOW); - BOOL skip_avatar_update = FALSE; + bool skip_avatar_update = false; if (!isAgentAvatarValid() || gAgentCamera.getCameraAnimating() || gAgentCamera.getCameraMode() != CAMERA_MODE_MOUSELOOK || !LLVOAvatar::sVisibleInFirstPerson) { - skip_avatar_update = TRUE; + skip_avatar_update = true; } if (!skip_avatar_update) @@ -11286,7 +11279,7 @@ void LLPipeline::generateSunShadow(LLCamera& camera) } } -void LLPipeline::renderGroups(LLRenderPass* pass, U32 type, U32 mask, BOOL texture) +void LLPipeline::renderGroups(LLRenderPass* pass, U32 type, U32 mask, bool texture) { for (LLCullResult::sg_iterator i = sCull->beginVisibleGroups(); i != sCull->endVisibleGroups(); ++i) { @@ -11372,10 +11365,10 @@ void LLPipeline::generateImpostor(LLVOAvatar* avatar) S32 occlusion = sUseOcclusion; sUseOcclusion = 0; - sReflectionRender = sRenderDeferred ? FALSE : TRUE; + sReflectionRender = ! sRenderDeferred; - sShadowRender = TRUE; - sImpostorRender = TRUE; + sShadowRender = true; + sImpostorRender = true; LLViewerCamera* viewer_camera = LLViewerCamera::getInstance(); @@ -11624,9 +11617,9 @@ void LLPipeline::generateImpostor(LLVOAvatar* avatar) LLVOAvatar::sUseImpostors = true; // @TODO ??? sUseOcclusion = occlusion; - sReflectionRender = FALSE; - sImpostorRender = FALSE; - sShadowRender = FALSE; + sReflectionRender = false; + sImpostorRender = false; + sShadowRender = false; popRenderTypeMask(); gGL.matrixMode(LLRender::MM_PROJECTION); @@ -11643,7 +11636,7 @@ void LLPipeline::generateImpostor(LLVOAvatar* avatar) LLGLState::checkClientArrays(); } -BOOL LLPipeline::hasRenderBatches(const U32 type) const +bool LLPipeline::hasRenderBatches(const U32 type) const { return sCull->getRenderMapSize(type) > 0; } @@ -11668,12 +11661,12 @@ LLCullResult::sg_iterator LLPipeline::endAlphaGroups() return sCull->endAlphaGroups(); } -BOOL LLPipeline::hasRenderType(const U32 type) const +bool LLPipeline::hasRenderType(const U32 type) const { // STORM-365 : LLViewerJointAttachment::setAttachmentVisibility() is setting type to 0 to actually mean "do not render" - // We then need to test that value here and return FALSE to prevent attachment to render (in mouselook for instance) - // TODO: reintroduce RENDER_TYPE_NONE in LLRenderTypeMask and initialize its mRenderTypeEnabled[RENDER_TYPE_NONE] to FALSE explicitely - return (type == 0 ? FALSE : mRenderTypeEnabled[type]); + // We then need to test that value here and return false to prevent attachment to render (in mouselook for instance) + // TODO: reintroduce RENDER_TYPE_NONE in LLRenderTypeMask and initialize its mRenderTypeEnabled[RENDER_TYPE_NONE] to false explicitely + return (type == 0 ? false : mRenderTypeEnabled[type]); } void LLPipeline::setRenderTypeMask(U32 type, ...) @@ -11683,7 +11676,7 @@ void LLPipeline::setRenderTypeMask(U32 type, ...) va_start(args, type); while (type < END_RENDER_TYPES) { - mRenderTypeEnabled[type] = TRUE; + mRenderTypeEnabled[type] = true; type = va_arg(args, U32); } va_end(args); @@ -11694,7 +11687,7 @@ void LLPipeline::setRenderTypeMask(U32 type, ...) } } -BOOL LLPipeline::hasAnyRenderType(U32 type, ...) const +bool LLPipeline::hasAnyRenderType(U32 type, ...) const { va_list args; @@ -11703,7 +11696,7 @@ BOOL LLPipeline::hasAnyRenderType(U32 type, ...) const { if (mRenderTypeEnabled[type]) { - return TRUE; + return true; } type = va_arg(args, U32); } @@ -11714,7 +11707,7 @@ BOOL LLPipeline::hasAnyRenderType(U32 type, ...) const LL_ERRS() << "Invalid render type." << LL_ENDL; } - return FALSE; + return false; } void LLPipeline::pushRenderTypeMask() @@ -11739,10 +11732,10 @@ void LLPipeline::andRenderTypeMask(U32 type, ...) { va_list args; - BOOL tmp[NUM_RENDER_TYPES]; + bool tmp[NUM_RENDER_TYPES]; for (U32 i = 0; i < NUM_RENDER_TYPES; ++i) { - tmp[i] = FALSE; + tmp[i] = false; } va_start(args, type); @@ -11750,7 +11743,7 @@ void LLPipeline::andRenderTypeMask(U32 type, ...) { if (mRenderTypeEnabled[type]) { - tmp[type] = TRUE; + tmp[type] = true; } type = va_arg(args, U32); @@ -11776,7 +11769,7 @@ void LLPipeline::clearRenderTypeMask(U32 type, ...) va_start(args, type); while (type < END_RENDER_TYPES) { - mRenderTypeEnabled[type] = FALSE; + mRenderTypeEnabled[type] = false; type = va_arg(args, U32); } @@ -11792,7 +11785,7 @@ void LLPipeline::setAllRenderTypes() { for (U32 i = 0; i < NUM_RENDER_TYPES; ++i) { - mRenderTypeEnabled[i] = TRUE; + mRenderTypeEnabled[i] = true; } } @@ -11800,7 +11793,7 @@ void LLPipeline::clearAllRenderTypes() { for (U32 i = 0; i < NUM_RENDER_TYPES; ++i) { - mRenderTypeEnabled[i] = FALSE; + mRenderTypeEnabled[i] = false; } } @@ -11867,7 +11860,7 @@ void LLPipeline::restorePermanentObjects( const std::vector<U32>& restoreList ) skipRenderingOfTerrain( false ); } -void LLPipeline::skipRenderingOfTerrain( BOOL flag ) +void LLPipeline::skipRenderingOfTerrain( bool flag ) { pool_set_t::iterator iter = mPools.begin(); while ( iter != mPools.end() ) diff --git a/indra/newview/pipeline.h b/indra/newview/pipeline.h index bba36351d9..c9670a60f2 100644 --- a/indra/newview/pipeline.h +++ b/indra/newview/pipeline.h @@ -57,10 +57,10 @@ typedef enum e_avatar_skinning_method SKIN_METHOD_VERTEX_PROGRAM } EAvatarSkinningMethod; -BOOL compute_min_max(LLMatrix4& box, LLVector2& min, LLVector2& max); // Shouldn't be defined here! +bool compute_min_max(LLMatrix4& box, LLVector2& min, LLVector2& max); // Shouldn't be defined here! bool LLRayAABB(const LLVector3 ¢er, const LLVector3 &size, const LLVector3& origin, const LLVector3& dir, LLVector3 &coord, F32 epsilon = 0); -BOOL setup_hud_matrices(); // use whole screen to render hud -BOOL setup_hud_matrices(const LLRect& screen_region); // specify portion of screen (in pixels) to render hud attachments from (for picking) +bool setup_hud_matrices(); // use whole screen to render hud +bool setup_hud_matrices(const LLRect& screen_region); // specify portion of screen (in pixels) to render hud attachments from (for picking) glh::matrix4f glh_copy_matrix(F32* src); glh::matrix4f glh_get_current_modelview(); void glh_set_current_modelview(const glh::matrix4f& mat); @@ -133,11 +133,11 @@ public: void resetVertexBuffers(LLDrawable* drawable); void generateImpostor(LLVOAvatar* avatar); void bindScreenToTexture(); - void renderBloom(BOOL for_snapshot, F32 zoom_factor = 1.f, int subfield = 0); + void renderBloom(bool for_snapshot, F32 zoom_factor = 1.f, int subfield = 0); void init(); void cleanup(); - BOOL isInit() { return mInitialized; }; + bool isInit() { return mInitialized; }; /// @brief Get a draw pool from pool type (POOL_SIMPLE, POOL_MEDIA) and texture. /// @return Draw pool, or NULL if not found. @@ -171,19 +171,19 @@ public: void doOcclusion(LLCamera& camera, LLRenderTarget& source, LLRenderTarget& dest, LLRenderTarget* scratch_space = NULL); void doOcclusion(LLCamera& camera); void markNotCulled(LLSpatialGroup* group, LLCamera &camera); - void markMoved(LLDrawable *drawablep, BOOL damped_motion = FALSE); + void markMoved(LLDrawable *drawablep, bool damped_motion = false); void markShift(LLDrawable *drawablep); void markTextured(LLDrawable *drawablep); void markGLRebuild(LLGLUpdate* glu); - void markRebuild(LLSpatialGroup* group, BOOL priority = FALSE); - void markRebuild(LLDrawable *drawablep, LLDrawable::EDrawableFlags flag = LLDrawable::REBUILD_ALL, BOOL priority = FALSE); + void markRebuild(LLSpatialGroup* group, bool priority = false); + void markRebuild(LLDrawable *drawablep, LLDrawable::EDrawableFlags flag = LLDrawable::REBUILD_ALL, bool priority = false); void markPartitionMove(LLDrawable* drawablep); void markMeshDirty(LLSpatialGroup* group); //get the object between start and end that's closest to start. LLViewerObject* lineSegmentIntersectInWorld(const LLVector4a& start, const LLVector4a& end, - BOOL pick_transparent, - BOOL pick_rigged, + bool pick_transparent, + bool pick_rigged, S32* face_hit, // return the face hit LLVector4a* intersection = NULL, // return the intersection point LLVector2* tex_coord = NULL, // return the texture coordinates of the intersection point @@ -197,7 +197,7 @@ public: LLViewerObject* lineSegmentIntersectInHUD(const LLVector4a& start, const LLVector4a& end, - BOOL pick_transparent, + bool pick_transparent, S32* face_hit, // return the face hit LLVector4a* intersection = NULL, // return the intersection point LLVector2* tex_coord = NULL, // return the texture coordinates of the intersection point @@ -212,20 +212,20 @@ public: U32 addObject(LLViewerObject *obj); - void enableShadows(const BOOL enable_shadows); + void enableShadows(const bool enable_shadows); -// void setLocalLighting(const BOOL local_lighting); -// BOOL isLocalLightingEnabled() const; +// void setLocalLighting(const bool local_lighting); +// bool isLocalLightingEnabled() const; S32 setLightingDetail(S32 level); S32 getLightingDetail() const { return mLightingDetail; } S32 getMaxLightingDetail() const; - void setUseVertexShaders(BOOL use_shaders); - BOOL getUseVertexShaders() const { return mVertexShadersEnabled; } - BOOL canUseVertexShaders(); - BOOL canUseWindLightShaders() const; - BOOL canUseWindLightShadersOnObjects() const; - BOOL canUseAntiAliasing() const; + void setUseVertexShaders(bool use_shaders); + bool getUseVertexShaders() const { return mVertexShadersEnabled; } + bool canUseVertexShaders(); + bool canUseWindLightShaders() const; + bool canUseWindLightShadersOnObjects() const; + bool canUseAntiAliasing() const; // phases void resetFrameStats(); @@ -234,9 +234,9 @@ public: void updateMoveNormalAsync(LLDrawable* drawablep); void updateMovedList(LLDrawable::drawable_vector_t& move_list); void updateMove(); - BOOL visibleObjectsInFrustum(LLCamera& camera); - BOOL getVisibleExtents(LLCamera& camera, LLVector3 &min, LLVector3& max); - BOOL getVisiblePointCloud(LLCamera& camera, LLVector3 &min, LLVector3& max, std::vector<LLVector3>& fp, LLVector3 light_dir = LLVector3(0,0,0)); + bool visibleObjectsInFrustum(LLCamera& camera); + bool getVisibleExtents(LLCamera& camera, LLVector3 &min, LLVector3& max); + bool getVisiblePointCloud(LLCamera& camera, LLVector3 &min, LLVector3& max, std::vector<LLVector3>& fp, LLVector3 light_dir = LLVector3(0,0,0)); void updateCull(LLCamera& camera, LLCullResult& result, S32 water_clip = 0, LLPlane* plane = NULL); //if water_clip is 0, ignore water plane, 1, cull to above plane, -1, cull to below plane void createObjects(F32 max_dtime); void createObject(LLViewerObject* vobj); @@ -259,10 +259,10 @@ public: void postSort(LLCamera& camera); void forAllVisibleDrawables(void (*func)(LLDrawable*)); - void renderObjects(U32 type, U32 mask, BOOL texture = TRUE, BOOL batch_texture = FALSE); - void renderMaskedObjects(U32 type, U32 mask, BOOL texture = TRUE, BOOL batch_texture = FALSE); + void renderObjects(U32 type, U32 mask, bool texture = true, bool batch_texture = false); + void renderMaskedObjects(U32 type, U32 mask, bool texture = true, bool batch_texture = false); - void renderGroups(LLRenderPass* pass, U32 type, U32 mask, BOOL texture); + void renderGroups(LLRenderPass* pass, U32 type, U32 mask, bool texture); void grabReferences(LLCullResult& result); void clearReferences(); @@ -274,7 +274,7 @@ public: void checkReferences(LLSpatialGroup* group); - void renderGeom(LLCamera& camera, BOOL forceVBOUpdate = FALSE); + void renderGeom(LLCamera& camera, bool forceVBOUpdate = false); void renderGeomDeferred(LLCamera& camera); void renderGeomPostDeferred(LLCamera& camera, bool do_occlusion=true); void renderGeomShadow(LLCamera& camera); @@ -292,7 +292,7 @@ public: void setHighlightObject(LLDrawable* obj) { mHighlightObject = obj; } - void renderShadow(glh::matrix4f& view, glh::matrix4f& proj, LLCamera& camera, LLCullResult& result, BOOL use_shader, BOOL use_occlusion, U32 target_width); + void renderShadow(glh::matrix4f& view, glh::matrix4f& proj, LLCamera& camera, LLCullResult& result, bool use_shader, bool use_occlusion, U32 target_width); void renderHighlights(); void renderDebug(); void renderPhysicsDisplay(); @@ -300,13 +300,13 @@ public: void rebuildPools(); // Rebuild pools void findReferences(LLDrawable *drawablep); // Find the lists which have references to this object - BOOL verify(); // Verify that all data in the pipeline is "correct" + bool verify(); // Verify that all data in the pipeline is "correct" S32 getLightCount() const { return mLights.size(); } void calcNearbyLights(LLCamera& camera); void setupHWLights(LLDrawPool* pool); - void setupAvatarLights(BOOL for_edit = FALSE); + void setupAvatarLights(bool for_edit = false); void enableLights(U32 mask); void enableLightsStatic(); void enableLightsDynamic(); @@ -318,9 +318,9 @@ public: void shiftObjects(const LLVector3 &offset); - void setLight(LLDrawable *drawablep, BOOL is_light); + void setLight(LLDrawable *drawablep, bool is_light); - BOOL hasRenderBatches(const U32 type) const; + bool hasRenderBatches(const U32 type) const; LLCullResult::drawinfo_iterator beginRenderMap(U32 type); LLCullResult::drawinfo_iterator endRenderMap(U32 type); LLCullResult::sg_iterator beginAlphaGroups(); @@ -329,15 +329,15 @@ public: void addTrianglesDrawn(S32 index_count, U32 render_type = LLRender::TRIANGLES); - BOOL hasRenderDebugFeatureMask(const U32 mask) const { return (mRenderDebugFeatureMask & mask) ? TRUE : FALSE; } - BOOL hasRenderDebugMask(const U32 mask) const { return (mRenderDebugMask & mask) ? TRUE : FALSE; } + bool hasRenderDebugFeatureMask(const U32 mask) const { return bool(mRenderDebugFeatureMask & mask); } + bool hasRenderDebugMask(const U32 mask) const { return bool(mRenderDebugMask & mask); } void setAllRenderDebugFeatures() { mRenderDebugFeatureMask = 0xffffffff; } void clearAllRenderDebugFeatures() { mRenderDebugFeatureMask = 0x0; } void setAllRenderDebugDisplays() { mRenderDebugMask = 0xffffffff; } void clearAllRenderDebugDisplays() { mRenderDebugMask = 0x0; } - BOOL hasRenderType(const U32 type) const; - BOOL hasAnyRenderType(const U32 type, ...) const; + bool hasRenderType(const U32 type) const; + bool hasAnyRenderType(const U32 type, ...) const; void setRenderTypeMask(U32 type, ...); // This is equivalent to 'setRenderTypeMask' @@ -356,53 +356,53 @@ public: static void toggleRenderType(U32 type); // For UI control of render features - static BOOL hasRenderTypeControl(void* data); - static void toggleRenderDebug(void* data); - static void toggleRenderDebugFeature(void* data); - static void toggleRenderTypeControl(void* data); - static BOOL toggleRenderTypeControlNegated(void* data); - static BOOL toggleRenderDebugControl(void* data); - static BOOL toggleRenderDebugFeatureControl(void* data); + static bool hasRenderTypeControl(U32 data); + static void toggleRenderDebug(U32 data); + static void toggleRenderDebugFeature(U32 data); + static void toggleRenderTypeControl(U32 data); + static bool toggleRenderTypeControlNegated(S32 data); + static bool toggleRenderDebugControl(U32 data); + static bool toggleRenderDebugFeatureControl(U32 data); static void setRenderDebugFeatureControl(U32 bit, bool value); - static void setRenderParticleBeacons(BOOL val); - static void toggleRenderParticleBeacons(void* data); - static BOOL getRenderParticleBeacons(void* data); + static void setRenderParticleBeacons(bool val); + static void toggleRenderParticleBeacons(); + static bool getRenderParticleBeacons(); - static void setRenderSoundBeacons(BOOL val); - static void toggleRenderSoundBeacons(void* data); - static BOOL getRenderSoundBeacons(void* data); + static void setRenderSoundBeacons(bool val); + static void toggleRenderSoundBeacons(); + static bool getRenderSoundBeacons(); - static void setRenderMOAPBeacons(BOOL val); - static void toggleRenderMOAPBeacons(void * data); - static BOOL getRenderMOAPBeacons(void * data); + static void setRenderMOAPBeacons(bool val); + static void toggleRenderMOAPBeacons(); + static bool getRenderMOAPBeacons(); - static void setRenderPhysicalBeacons(BOOL val); - static void toggleRenderPhysicalBeacons(void* data); - static BOOL getRenderPhysicalBeacons(void* data); + static void setRenderPhysicalBeacons(bool val); + static void toggleRenderPhysicalBeacons(); + static bool getRenderPhysicalBeacons(); - static void setRenderScriptedBeacons(BOOL val); - static void toggleRenderScriptedBeacons(void* data); - static BOOL getRenderScriptedBeacons(void* data); + static void setRenderScriptedBeacons(bool val); + static void toggleRenderScriptedBeacons(); + static bool getRenderScriptedBeacons(); - static void setRenderScriptedTouchBeacons(BOOL val); - static void toggleRenderScriptedTouchBeacons(void* data); - static BOOL getRenderScriptedTouchBeacons(void* data); + static void setRenderScriptedTouchBeacons(bool val); + static void toggleRenderScriptedTouchBeacons(); + static bool getRenderScriptedTouchBeacons(); - static void setRenderBeacons(BOOL val); - static void toggleRenderBeacons(void* data); - static BOOL getRenderBeacons(void* data); + static void setRenderBeacons(bool val); + static void toggleRenderBeacons(); + static bool getRenderBeacons(); - static void setRenderHighlights(BOOL val); - static void toggleRenderHighlights(void* data); - static BOOL getRenderHighlights(void* data); + static void setRenderHighlights(bool val); + static void toggleRenderHighlights(); + static bool getRenderHighlights(); static void setRenderHighlightTextureChannel(LLRender::eTexIndex channel); // sets which UV setup to display in highlight overlay static void updateRenderBump(); static void updateRenderDeferred(); static void refreshCachedSettings(); - static void throttleNewMemoryAllocation(BOOL disable); + static void throttleNewMemoryAllocation(bool disable); @@ -410,7 +410,7 @@ public: void hidePermanentObjects( std::vector<U32>& restoreList ); void restorePermanentObjects( const std::vector<U32>& restoreList ); - void skipRenderingOfTerrain( BOOL flag ); + void skipRenderingOfTerrain( bool flag ); void hideObject( const LLUUID& id ); void restoreHiddenObject( const LLUUID& id ); @@ -418,7 +418,7 @@ private: void unloadShaders(); void addToQuickLookup( LLDrawPool* new_poolp ); void removeFromQuickLookup( LLDrawPool* poolp ); - BOOL updateDrawableGeom(LLDrawable* drawable, BOOL priority); + bool updateDrawableGeom(LLDrawable* drawable, bool priority); void assertInitializedDoError(); bool assertInitialized() { const bool is_init = isInit(); if (!is_init) assertInitializedDoError(); return is_init; }; void connectRefreshCachedSettingsSafe(const std::string name); @@ -539,12 +539,12 @@ public: LLSpatialPartition* getSpatialPartition(LLViewerObject* vobj); - void updateCamera(BOOL reset = FALSE); + void updateCamera(bool reset = false); LLVector3 mFlyCamPosition; LLQuaternion mFlyCamRotation; - BOOL mBackfaceCull; + bool mBackfaceCull; S32 mMatrixOpCount; S32 mTextureMatrixOps; S32 mNumVisibleNodes; @@ -557,36 +557,36 @@ public: static S32 sCompiles; - static BOOL sShowHUDAttachments; - static BOOL sForceOldBakedUpload; // If true will not use capabilities to upload baked textures. + static bool sShowHUDAttachments; + static bool sForceOldBakedUpload; // If true will not use capabilities to upload baked textures. static S32 sUseOcclusion; // 0 = no occlusion, 1 = read only, 2 = read/write - static BOOL sDelayVBUpdate; - static BOOL sAutoMaskAlphaDeferred; - static BOOL sAutoMaskAlphaNonDeferred; - static BOOL sDisableShaders; // if TRUE, rendering will be done without shaders - static BOOL sRenderBump; - static BOOL sBakeSunlight; - static BOOL sNoAlpha; - static BOOL sUseTriStrips; - static BOOL sUseFarClip; - static BOOL sShadowRender; - static BOOL sWaterReflections; - static BOOL sDynamicLOD; - static BOOL sPickAvatar; - static BOOL sReflectionRender; - static BOOL sImpostorRender; - static BOOL sImpostorRenderAlphaDepthPass; - static BOOL sUnderWaterRender; - static BOOL sRenderGlow; - static BOOL sTextureBindTest; - static BOOL sRenderFrameTest; - static BOOL sRenderAttachedLights; - static BOOL sRenderAttachedParticles; - static BOOL sRenderDeferred; - static BOOL sMemAllocationThrottled; + static bool sDelayVBUpdate; + static bool sAutoMaskAlphaDeferred; + static bool sAutoMaskAlphaNonDeferred; + static bool sDisableShaders; // if true, rendering will be done without shaders + static bool sRenderBump; + static bool sBakeSunlight; + static bool sNoAlpha; + static bool sUseTriStrips; + static bool sUseFarClip; + static bool sShadowRender; + static bool sWaterReflections; + static bool sDynamicLOD; + static bool sPickAvatar; + static bool sReflectionRender; + static bool sImpostorRender; + static bool sImpostorRenderAlphaDepthPass; + static bool sUnderWaterRender; + static bool sRenderGlow; + static bool sTextureBindTest; + static bool sRenderFrameTest; + static bool sRenderAttachedLights; + static bool sRenderAttachedParticles; + static bool sRenderDeferred; + static bool sMemAllocationThrottled; static S32 sVisibleLightCount; static F32 sMinRenderSize; - static BOOL sRenderingHUDs; + static bool sRenderingHUDs; static LLTrace::EventStatHandle<S64> sStatBatchSize; @@ -659,13 +659,13 @@ public: LLVector3 mSunDir; LLVector3 mTransformedSunDir; - BOOL mInitialized; - BOOL mVertexShadersEnabled; + bool mInitialized; + bool mVertexShadersEnabled; S32 mVertexShadersLoaded; // 0 = no, 1 = yes, -1 = failed U32 mTransformFeedbackPrimitives; //number of primitives expected to be generated by transform feedback protected: - BOOL mRenderTypeEnabled[NUM_RENDER_TYPES]; + bool mRenderTypeEnabled[NUM_RENDER_TYPES]; std::stack<std::string> mRenderTypeEnableStack; U32 mRenderDebugFeatureMask; @@ -843,15 +843,15 @@ protected: U32 mLightMovingMask; S32 mLightingDetail; - static BOOL sRenderPhysicalBeacons; - static BOOL sRenderMOAPBeacons; - static BOOL sRenderScriptedTouchBeacons; - static BOOL sRenderScriptedBeacons; - static BOOL sRenderParticleBeacons; - static BOOL sRenderSoundBeacons; + static bool sRenderPhysicalBeacons; + static bool sRenderMOAPBeacons; + static bool sRenderScriptedTouchBeacons; + static bool sRenderScriptedBeacons; + static bool sRenderParticleBeacons; + static bool sRenderSoundBeacons; public: - static BOOL sRenderBeacons; - static BOOL sRenderHighlight; + static bool sRenderBeacons; + static bool sRenderHighlight; // Determines which set of UVs to use in highlight display // @@ -861,26 +861,26 @@ public: static U32 sCurRenderPoolType ; //cached settings - static BOOL WindLightUseAtmosShaders; - static BOOL VertexShaderEnable; - static BOOL RenderAvatarVP; - static BOOL RenderDeferred; + static bool WindLightUseAtmosShaders; + static bool VertexShaderEnable; + static bool RenderAvatarVP; + static bool RenderDeferred; static F32 RenderDeferredSunWash; static U32 RenderFSAASamples; static U32 RenderResolutionDivisor; - static BOOL RenderUIBuffer; + static bool RenderUIBuffer; static S32 RenderShadowDetail; - static BOOL RenderDeferredSSAO; + static bool RenderDeferredSSAO; static F32 RenderShadowResolutionScale; - static BOOL RenderLocalLights; - static BOOL RenderDelayCreation; - static BOOL RenderAnimateRes; - static BOOL FreezeTime; + static bool RenderLocalLights; + static bool RenderDelayCreation; + static bool RenderAnimateRes; + static bool FreezeTime; static S32 DebugBeaconLineWidth; static F32 RenderHighlightBrightness; static LLColor4 RenderHighlightColor; static F32 RenderHighlightThickness; - static BOOL RenderSpotLightsInNondeferred; + static bool RenderSpotLightsInNondeferred; static LLColor4 PreviewAmbientColor; static LLColor4 PreviewDiffuse0; static LLColor4 PreviewSpecular0; @@ -900,8 +900,8 @@ public: static S32 RenderGlowIterations; static F32 RenderGlowWidth; static F32 RenderGlowStrength; - static BOOL RenderDepthOfField; - static BOOL RenderDepthOfFieldInEditMode; + static bool RenderDepthOfField; + static bool RenderDepthOfFieldInEditMode; static F32 CameraFocusTransitionTime; static F32 CameraFNumber; static F32 CameraFocalLength; @@ -922,7 +922,7 @@ public: static F32 RenderEdgeNormCutoff; static LLVector3 RenderShadowGaussian; static F32 RenderShadowBlurDistFactor; - static BOOL RenderDeferredAtmospheric; + static bool RenderDeferredAtmospheric; static S32 RenderReflectionDetail; static F32 RenderHighlightFadeTime; static LLVector3 RenderShadowClipPlanes; @@ -932,7 +932,7 @@ public: static LLVector3 RenderShadowSplitExponent; static F32 RenderShadowErrorCutoff; static F32 RenderShadowFOVCutoff; - static BOOL CameraOffset; + static bool CameraOffset; static F32 CameraMaxCoF; static F32 CameraDoFResScale; static F32 RenderAutoHideSurfaceAreaLimit; @@ -942,7 +942,7 @@ void render_bbox(const LLVector3 &min, const LLVector3 &max); void render_hud_elements(); extern LLPipeline gPipeline; -extern BOOL gDebugPipeline; +extern bool gDebugPipeline; extern const LLMatrix4* gGLLastMatrix; #endif diff --git a/indra/newview/skins/default/xui/da/floater_about.xml b/indra/newview/skins/default/xui/da/floater_about.xml index 779b168ae0..7654f0dcd6 100644 --- a/indra/newview/skins/default/xui/da/floater_about.xml +++ b/indra/newview/skins/default/xui/da/floater_about.xml @@ -24,7 +24,7 @@ Grafik kort: [GRAPHICS_CARD] J2C Decoder Version: [J2C_VERSION] Audio Driver Version: [AUDIO_DRIVER_VERSION] -LLCEFLib/CEF Version: [LLCEFLIB_VERSION] +CEF Version: [LIBCEF_VERSION] LibVLC Version: [LIBVLC_VERSION] Voice Server Version: [VOICE_VERSION] </floater.string> diff --git a/indra/newview/skins/default/xui/de/strings.xml b/indra/newview/skins/default/xui/de/strings.xml index 4a2cbcc81f..de20ed88a3 100644 --- a/indra/newview/skins/default/xui/de/strings.xml +++ b/indra/newview/skins/default/xui/de/strings.xml @@ -38,7 +38,7 @@ Grafikinitialisierung fehlgeschlagen. Bitte aktualisieren Sie Ihren Grafiktreiber. </string> <string name="AboutHeader"> - [APP_NAME] [VIEWER_VERSION_0].[VIEWER_VERSION_1].[VIEWER_VERSION_2].[VIEWER_VERSION_3] ([CHANNEL]) + [APP_NAME] [VIEWER_VERSION_0].[VIEWER_VERSION_1].[VIEWER_VERSION_2].[VIEWER_VERSION_3] ([ADDRESS_SIZE]bit) ([CHANNEL]) [[VIEWER_RELEASE_NOTES_URL] [ReleaseNotes]] </string> <string name="BuildConfig"> @@ -79,7 +79,7 @@ Erstellungszeit VFS (Cache): [VFS_TIME] <string name="AboutLibs"> J2C-Decoderversion: [J2C_VERSION] Audiotreiberversion: [AUDIO_DRIVER_VERSION] -LLCEFLib/CEF-Version: [LLCEFLIB_VERSION] +CEF-Version: [LIBCEF_VERSION] LibVLC-Version: [LIBVLC_VERSION] Voice-Server-Version: [VOICE_VERSION] </string> diff --git a/indra/newview/skins/default/xui/en/mime_types_mac.xml b/indra/newview/skins/default/xui/en/mime_types_mac.xml index f71c24b2e4..2d96708b86 100644 --- a/indra/newview/skins/default/xui/en/mime_types_mac.xml +++ b/indra/newview/skins/default/xui/en/mime_types_mac.xml @@ -130,7 +130,7 @@ movie </widgettype> <impl> - media_plugin_quicktime + media_plugin_libvlc </impl> </scheme> <mimetype name="blank"> @@ -141,7 +141,7 @@ none </widgettype> <impl> - media_plugin_quicktime + media_plugin_libvlc </impl> </mimetype> <mimetype name="none/none"> @@ -163,7 +163,7 @@ audio </widgettype> <impl> - media_plugin_quicktime + media_plugin_libvlc </impl> </mimetype> <mimetype name="video/*"> @@ -174,7 +174,7 @@ movie </widgettype> <impl> - media_plugin_quicktime + media_plugin_libvlc </impl> </mimetype> <mimetype name="image/*"> @@ -196,7 +196,7 @@ movie </widgettype> <impl> - media_plugin_quicktime + media_plugin_libvlc </impl> </mimetype> <mimetype name="application/javascript"> @@ -218,7 +218,7 @@ audio </widgettype> <impl> - media_plugin_quicktime + media_plugin_libvlc </impl> </mimetype> <mimetype name="application/pdf"> @@ -295,7 +295,7 @@ audio </widgettype> <impl> - media_plugin_quicktime + media_plugin_libvlc </impl> </mimetype> <mimetype name="audio/mpeg"> @@ -306,7 +306,7 @@ audio </widgettype> <impl> - media_plugin_quicktime + media_plugin_libvlc </impl> </mimetype> <mimetype name="audio/x-aiff"> @@ -317,7 +317,7 @@ audio </widgettype> <impl> - media_plugin_quicktime + media_plugin_libvlc </impl> </mimetype> <mimetype name="audio/x-wav"> @@ -328,7 +328,7 @@ audio </widgettype> <impl> - media_plugin_quicktime + media_plugin_libvlc </impl> </mimetype> <mimetype menu="1" name="image/bmp"> @@ -438,7 +438,7 @@ movie </widgettype> <impl> - media_plugin_quicktime + media_plugin_libvlc </impl> </mimetype> <mimetype name="video/mp4"> @@ -449,7 +449,7 @@ movie </widgettype> <impl> - media_plugin_quicktime + media_plugin_libvlc </impl> </mimetype> <mimetype menu="1" name="video/quicktime"> @@ -460,7 +460,7 @@ movie </widgettype> <impl> - media_plugin_quicktime + media_plugin_libvlc </impl> </mimetype> <mimetype name="video/x-ms-asf"> @@ -471,7 +471,7 @@ movie </widgettype> <impl> - media_plugin_quicktime + media_plugin_libvlc </impl> </mimetype> <mimetype name="video/x-ms-wmv"> @@ -482,7 +482,7 @@ movie </widgettype> <impl> - media_plugin_quicktime + media_plugin_libvlc </impl> </mimetype> <mimetype menu="1" name="video/x-msvideo"> @@ -493,7 +493,7 @@ movie </widgettype> <impl> - media_plugin_quicktime + media_plugin_libvlc </impl> </mimetype> </mimetypes> diff --git a/indra/newview/skins/default/xui/en/strings.xml b/indra/newview/skins/default/xui/en/strings.xml index b75f631799..2ae78901f6 100644 --- a/indra/newview/skins/default/xui/en/strings.xml +++ b/indra/newview/skins/default/xui/en/strings.xml @@ -22,7 +22,7 @@ <!-- about dialog/support string--> <string name="AboutHeader"> -[APP_NAME] [VIEWER_VERSION_0].[VIEWER_VERSION_1].[VIEWER_VERSION_2].[VIEWER_VERSION_3] ([CHANNEL]) +[CHANNEL] [VIEWER_VERSION_0].[VIEWER_VERSION_1].[VIEWER_VERSION_2].[VIEWER_VERSION_3] ([ADDRESS_SIZE]bit) [[VIEWER_RELEASE_NOTES_URL] [ReleaseNotes]] </string> <string name="BuildConfig">Build Configuration [BUILD_CONFIG]</string> @@ -61,7 +61,7 @@ VFS (cache) creation time: [VFS_TIME] <string name="AboutLibs"> J2C Decoder Version: [J2C_VERSION] Audio Driver Version: [AUDIO_DRIVER_VERSION] -LLCEFLib/CEF Version: [LLCEFLIB_VERSION] +CEF Version: [LIBCEF_VERSION] LibVLC Version: [LIBVLC_VERSION] Voice Server Version: [VOICE_VERSION] </string> diff --git a/indra/newview/skins/default/xui/es/strings.xml b/indra/newview/skins/default/xui/es/strings.xml index 192d32c267..765226e6bd 100644 --- a/indra/newview/skins/default/xui/es/strings.xml +++ b/indra/newview/skins/default/xui/es/strings.xml @@ -29,7 +29,7 @@ Error de inicialización de gráficos. Actualiza tu controlador de gráficos. </string> <string name="AboutHeader"> - [APP_NAME] [VIEWER_VERSION_0].[VIEWER_VERSION_1].[VIEWER_VERSION_2].[VIEWER_VERSION_3] ([CHANNEL]) + [APP_NAME] [VIEWER_VERSION_0].[VIEWER_VERSION_1].[VIEWER_VERSION_2].[VIEWER_VERSION_3] ([ADDRESS_SIZE]bit) ([CHANNEL]) [[VIEWER_RELEASE_NOTES_URL] [ReleaseNotes]] </string> <string name="BuildConfig"> @@ -70,8 +70,8 @@ Tiempo de creación de VFS (caché): [VFS_TIME] <string name="AboutLibs"> Versión de J2C Decoder: [J2C_VERSION] Versión de Audio Driver: [AUDIO_DRIVER_VERSION] -Versión de LLCEFLib/CEF: [LLCEFLIB_VERSION] -Versión de LibVLC: [LLCEFLIB_VERSION] +Versión de CEF: [LIBCEF_VERSION] +Versión de LibVLC: [LIBVLC_VERSION] Versión de Voice Server: [VOICE_VERSION] </string> <string name="AboutTraffic"> diff --git a/indra/newview/skins/default/xui/fr/strings.xml b/indra/newview/skins/default/xui/fr/strings.xml index 40a41b93ab..7c1d05bb83 100644 --- a/indra/newview/skins/default/xui/fr/strings.xml +++ b/indra/newview/skins/default/xui/fr/strings.xml @@ -38,7 +38,7 @@ Échec d'initialisation des graphiques. Veuillez mettre votre pilote graphique à jour. </string> <string name="AboutHeader"> - [APP_NAME] [VIEWER_VERSION_0].[VIEWER_VERSION_1].[VIEWER_VERSION_2].[VIEWER_VERSION_3] ([CHANNEL]) + [APP_NAME] [VIEWER_VERSION_0].[VIEWER_VERSION_1].[VIEWER_VERSION_2].[VIEWER_VERSION_3] ([ADDRESS_SIZE]bit) ([CHANNEL]) [[VIEWER_RELEASE_NOTES_URL] [Notes de version]] </string> <string name="BuildConfig"> @@ -79,7 +79,7 @@ Durée de création VFS (cache) : [VFS_TIME] <string name="AboutLibs"> Version J2C Decoder : [J2C_VERSION] Version Audio Driver : [AUDIO_DRIVER_VERSION] -Version LLCEFLib/CEF : [LLCEFLIB_VERSION] +Version CEF : [LIBCEF_VERSION] Version LibVLC : [LIBVLC_VERSION] Version serveur vocal : [VOICE_VERSION] </string> diff --git a/indra/newview/skins/default/xui/it/strings.xml b/indra/newview/skins/default/xui/it/strings.xml index 8246f91d17..e6edfb6de4 100644 --- a/indra/newview/skins/default/xui/it/strings.xml +++ b/indra/newview/skins/default/xui/it/strings.xml @@ -35,7 +35,7 @@ Inizializzazione grafica non riuscita. Aggiorna il driver della scheda grafica! </string> <string name="AboutHeader"> - [APP_NAME] [VIEWER_VERSION_0].[VIEWER_VERSION_1].[VIEWER_VERSION_2].[VIEWER_VERSION_3] ([CHANNEL]) + [APP_NAME] [VIEWER_VERSION_0].[VIEWER_VERSION_1].[VIEWER_VERSION_2].[VIEWER_VERSION_3] ([ADDRESS_SIZE]bit) ([CHANNEL]) [[VIEWER_RELEASE_NOTES_URL] [ReleaseNotes]] </string> <string name="BuildConfig"> @@ -76,7 +76,7 @@ Data/ora creazione VFS (cache): [VFS_TIME] <string name="AboutLibs"> Versione J2C Decoder: [J2C_VERSION] Versione Driver audio: [AUDIO_DRIVER_VERSION] -Versione LLCEFLib/CEF: [LLCEFLIB_VERSION] +Versione CEF: [LIBCEF_VERSION] Versione LibVLC: [LIBVLC_VERSION] Versione Server voice: [VOICE_VERSION] </string> diff --git a/indra/newview/skins/default/xui/ja/strings.xml b/indra/newview/skins/default/xui/ja/strings.xml index 586b8ab2d3..92b62c9c2f 100644 --- a/indra/newview/skins/default/xui/ja/strings.xml +++ b/indra/newview/skins/default/xui/ja/strings.xml @@ -38,7 +38,7 @@ グラフィックを初期化できませんでした。グラフィックドライバを更新してください。 </string> <string name="AboutHeader"> - [APP_NAME] [VIEWER_VERSION_0].[VIEWER_VERSION_1].[VIEWER_VERSION_2].[VIEWER_VERSION_3] ([CHANNEL]) + [APP_NAME] [VIEWER_VERSION_0].[VIEWER_VERSION_1].[VIEWER_VERSION_2].[VIEWER_VERSION_3] ([ADDRESS_SIZE]bit) ([CHANNEL]) [[VIEWER_RELEASE_NOTES_URL] [ReleaseNotes]] </string> <string name="BuildConfig"> @@ -79,7 +79,7 @@ VFS(キャッシュ)作成時間: [VFS_TIME] <string name="AboutLibs"> J2C デコーダバージョン:[J2C_VERSION] オーディオドライババージョン:[AUDIO_DRIVER_VERSION] -LLCEFLib/CEF バージョン: [LLCEFLIB_VERSION] +CEF バージョン: [LIBCEF_VERSION] LibVLC バージョン: [LIBVLC_VERSION] ボイスサーバーバージョン:[VOICE_VERSION] </string> diff --git a/indra/newview/skins/default/xui/pl/strings.xml b/indra/newview/skins/default/xui/pl/strings.xml index e9dd18043d..9aece1221d 100644 --- a/indra/newview/skins/default/xui/pl/strings.xml +++ b/indra/newview/skins/default/xui/pl/strings.xml @@ -43,7 +43,7 @@ Wersja OpenGL: [OPENGL_VERSION] Wersja dekodera J2C: [J2C_VERSION] Wersja sterownika dźwięku (Audio Driver): [AUDIO_DRIVER_VERSION] -Wersja LLCEFLib/CEF: [LLCEFLIB_VERSION] +Wersja CEF: [LIBCEF_VERSION] Wersja LibVLC: [LIBVLC_VERSION] Wersja serwera głosu (Voice Server): [VOICE_VERSION] </string> diff --git a/indra/newview/skins/default/xui/pt/strings.xml b/indra/newview/skins/default/xui/pt/strings.xml index 207b4e7097..94b69634d4 100644 --- a/indra/newview/skins/default/xui/pt/strings.xml +++ b/indra/newview/skins/default/xui/pt/strings.xml @@ -29,7 +29,7 @@ Falha na inicialização dos gráficos. Atualize seu driver gráfico! </string> <string name="AboutHeader"> - [APP_NAME] [VIEWER_VERSION_0].[VIEWER_VERSION_1].[VIEWER_VERSION_2].[VIEWER_VERSION_3] ([CHANNEL]) + [APP_NAME] [VIEWER_VERSION_0].[VIEWER_VERSION_1].[VIEWER_VERSION_2].[VIEWER_VERSION_3] ([ADDRESS_SIZE]bit) ([CHANNEL]) [[VIEWER_RELEASE_NOTES_URL] [ReleaseNotes]] </string> <string name="BuildConfig"> @@ -70,7 +70,7 @@ Tempo de criação de VFS (cache): [VFS_TIME] <string name="AboutLibs"> Versão do J2C Decoder: [J2C_VERSION] Versão do driver de áudio: [AUDIO_DRIVER_VERSION] -Versão de LLCEFLib/CEF: [LLCEFLIB_VERSION] +Versão de CEF: [LIBCEF_VERSION] Versão da LibVLC: [LIBVLC_VERSION] Versão do servidor de voz: [VOICE_VERSION] </string> diff --git a/indra/newview/skins/default/xui/ru/strings.xml b/indra/newview/skins/default/xui/ru/strings.xml index e44d63b3b9..7a003b536a 100644 --- a/indra/newview/skins/default/xui/ru/strings.xml +++ b/indra/newview/skins/default/xui/ru/strings.xml @@ -38,7 +38,7 @@ Ошибка инициализации графики. Обновите графический драйвер! </string> <string name="AboutHeader"> - [APP_NAME] [VIEWER_VERSION_0].[VIEWER_VERSION_1].[VIEWER_VERSION_2].[VIEWER_VERSION_3] ([CHANNEL]) + [APP_NAME] [VIEWER_VERSION_0].[VIEWER_VERSION_1].[VIEWER_VERSION_2].[VIEWER_VERSION_3] ([ADDRESS_SIZE]bit) ([CHANNEL]) [[VIEWER_RELEASE_NOTES_URL] [ReleaseNotes]] </string> <string name="BuildConfig"> @@ -79,7 +79,7 @@ SLURL: <nolink>[SLURL]</nolink> <string name="AboutLibs"> Версия декодера J2C: [J2C_VERSION] Версия драйвера звука: [AUDIO_DRIVER_VERSION] -Версия LLCEFLib/CEF: [LLCEFLIB_VERSION] +Версия CEF: [LIBCEF_VERSION] Версия LibVLC: [LIBVLC_VERSION] Версия голосового сервера: [VOICE_VERSION] </string> diff --git a/indra/newview/skins/default/xui/tr/strings.xml b/indra/newview/skins/default/xui/tr/strings.xml index 7b4bf1fca6..53b95d69dd 100644 --- a/indra/newview/skins/default/xui/tr/strings.xml +++ b/indra/newview/skins/default/xui/tr/strings.xml @@ -38,7 +38,7 @@ Grafik başlatma başarılamadı. Lütfen grafik sürücünüzü güncelleştirin! </string> <string name="AboutHeader"> - [APP_NAME] [VIEWER_VERSION_0].[VIEWER_VERSION_1].[VIEWER_VERSION_2].[VIEWER_VERSION_3] ([CHANNEL]) + [APP_NAME] [VIEWER_VERSION_0].[VIEWER_VERSION_1].[VIEWER_VERSION_2].[VIEWER_VERSION_3] ([ADDRESS_SIZE]bit) ([CHANNEL]) [[VIEWER_RELEASE_NOTES_URL] [ReleaseNotes]] </string> <string name="BuildConfig"> @@ -79,7 +79,7 @@ VFS (önbellek) oluşturma zamanı: [VFS_TIME] <string name="AboutLibs"> J2C Kod Çözücü Sürümü: [J2C_VERSION] Ses Sürücüsü Sürümü: [AUDIO_DRIVER_VERSION] -LLCEFLib/CEF Sürümü: [LLCEFLIB_VERSION] +CEF Sürümü: [LIBCEF_VERSION] LibVLC Sürümü: [LIBVLC_VERSION] Ses Sunucusu Sürümü: [VOICE_VERSION] </string> diff --git a/indra/newview/skins/default/xui/zh/strings.xml b/indra/newview/skins/default/xui/zh/strings.xml index ec08c9f91e..51a108126b 100644 --- a/indra/newview/skins/default/xui/zh/strings.xml +++ b/indra/newview/skins/default/xui/zh/strings.xml @@ -38,7 +38,7 @@ 顯像初始化失敗。 請更新你的顯像卡驅動程式! </string> <string name="AboutHeader"> - [APP_NAME] [VIEWER_VERSION_0].[VIEWER_VERSION_1].[VIEWER_VERSION_2].[VIEWER_VERSION_3] ([CHANNEL]) + [APP_NAME] [VIEWER_VERSION_0].[VIEWER_VERSION_1].[VIEWER_VERSION_2].[VIEWER_VERSION_3] ([ADDRESS_SIZE]bit) ([CHANNEL]) [[VIEWER_RELEASE_NOTES_URL] [ReleaseNotes]] </string> <string name="BuildConfig"> @@ -79,7 +79,7 @@ VFS(快取)建立時間:[VFS_TIME] <string name="AboutLibs"> J2C 解碼器版本: [J2C_VERSION] 音效驅動程式版本: [AUDIO_DRIVER_VERSION] -LLCEFLib/CEF版本:[LLCEFLIB_VERSION] +CEF版本:[LIBCEF_VERSION] LibVLC版本:[LIBVLC_VERSION]N] 語音伺服器版本: [VOICE_VERSION] </string> diff --git a/indra/newview/tests/llversioninfo_test.cpp b/indra/newview/tests/llversioninfo_test.cpp index 6b0be29c2d..f1f69f33f1 100644 --- a/indra/newview/tests/llversioninfo_test.cpp +++ b/indra/newview/tests/llversioninfo_test.cpp @@ -29,6 +29,13 @@ #include "../llversioninfo.h" +// LL_VIEWER_CHANNEL is a macro defined on the compiler command line. The +// macro expands to the string name of the channel, but without quotes. We +// need to turn it into a quoted string. This macro trick does that. +#define stringize_inner(x) #x +#define stringize_outer(x) stringize_inner(x) +#define ll_viewer_channel stringize_outer(LL_VIEWER_CHANNEL) + namespace tut { struct versioninfo @@ -50,7 +57,7 @@ namespace tut mShortVersion = stream.str(); stream.str(""); - stream << LL_VIEWER_CHANNEL + stream << ll_viewer_channel << " " << mVersion; mVersionAndChannel = stream.str(); @@ -89,7 +96,7 @@ namespace tut LL_VIEWER_VERSION_BUILD); ensure_equals("Channel version", LLVersionInfo::getChannel(), - LL_VIEWER_CHANNEL); + ll_viewer_channel); ensure_equals("Version String", LLVersionInfo::getVersion(), mVersion); diff --git a/indra/newview/viewer_manifest.py b/indra/newview/viewer_manifest.py index 66d730d1ac..743df609aa 100755 --- a/indra/newview/viewer_manifest.py +++ b/indra/newview/viewer_manifest.py @@ -41,10 +41,7 @@ viewer_dir = os.path.dirname(__file__) # indra.util.llmanifest under their system Python! sys.path.insert(0, os.path.join(viewer_dir, os.pardir, "lib", "python")) from indra.util.llmanifest import LLManifest, main, path_ancestors, CHANNEL_VENDOR_BASE, RELEASE_CHANNEL, ManifestError -try: - from llbase import llsd -except ImportError: - from indra.base import llsd +from llbase import llsd class ViewerManifest(LLManifest): def is_packaging_viewer(self): @@ -287,7 +284,8 @@ class ViewerManifest(LLManifest): random.shuffle(names) return ', '.join(names) -class Windows_i686_Manifest(ViewerManifest): + +class WindowsManifest(ViewerManifest): def final_exe(self): return self.app_name_oneword()+".exe" @@ -338,7 +336,7 @@ class Windows_i686_Manifest(ViewerManifest): print "Doesn't exist:", src def construct(self): - super(Windows_i686_Manifest, self).construct() + super(WindowsManifest, self).construct() pkgdir = os.path.join(self.args['build'], os.pardir, 'packages') relpkgdir = os.path.join(pkgdir, "lib", "release") @@ -378,18 +376,15 @@ class Windows_i686_Manifest(ViewerManifest): # Get fmodex dll, continue if missing try: - if self.args['configuration'].lower() == 'debug': - self.path("fmodexL.dll") + if(self.args['arch'].lower() == 'x86_64'): + self.path("fmodex64.dll") else: self.path("fmodex.dll") except: print "Skipping fmodex audio library(assuming other audio engine)" # For textures - if self.args['configuration'].lower() == 'debug': - self.path("openjpegd.dll") - else: - self.path("openjpeg.dll") + self.path("openjpeg.dll") # These need to be installed as a SxS assembly, currently a 'private' assembly. # See http://msdn.microsoft.com/en-us/library/ms235291(VS.80).aspx @@ -434,11 +429,6 @@ class Windows_i686_Manifest(ViewerManifest): self.path("featuretable.txt") self.path("featuretable_xp.txt") - # Media plugins - QuickTime - if self.prefix(src='../media_plugins/quicktime/%s' % self.args['configuration'], dst="llplugin"): - self.path("media_plugin_quicktime.dll") - self.end_prefix() - # Media plugins - CEF if self.prefix(src='../media_plugins/cef/%s' % self.args['configuration'], dst="llplugin"): self.path("media_plugin_cef.dll") @@ -449,11 +439,6 @@ class Windows_i686_Manifest(ViewerManifest): self.path("media_plugin_libvlc.dll") self.end_prefix() - # winmm.dll shim - if self.prefix(src='../media_plugins/winmmshim/%s' % self.args['configuration'], dst=""): - self.path("winmm.dll") - self.end_prefix() - # CEF runtime files - debug if self.args['configuration'].lower() == 'debug': if self.prefix(src=os.path.join(os.pardir, 'packages', 'bin', 'debug'), dst="llplugin"): @@ -462,11 +447,10 @@ class Windows_i686_Manifest(ViewerManifest): self.path("libcef.dll") self.path("libEGL.dll") self.path("libGLESv2.dll") - self.path("llceflib_host.exe") + self.path("dullahan_host.exe") self.path("natives_blob.bin") self.path("snapshot_blob.bin") self.path("widevinecdmadapter.dll") - self.path("wow_helper.exe") self.end_prefix() else: # CEF runtime files - not debug (release, relwithdebinfo etc.) @@ -476,11 +460,10 @@ class Windows_i686_Manifest(ViewerManifest): self.path("libcef.dll") self.path("libEGL.dll") self.path("libGLESv2.dll") - self.path("llceflib_host.exe") + self.path("dullahan_host.exe") self.path("natives_blob.bin") self.path("snapshot_blob.bin") self.path("widevinecdmadapter.dll") - self.path("wow_helper.exe") self.end_prefix() # MSVC DLLs needed for CEF and have to be in same directory as plugin @@ -648,6 +631,13 @@ class Windows_i686_Manifest(ViewerManifest): Caption "%(caption)s" """ + if(self.args['arch'].lower() == 'x86_64'): + engage_registry="SetRegView 64" + program_files="$PROGRAMFILES64" + else: + engage_registry="SetRegView 32" + program_files="$PROGRAMFILES32" + tempfile = "secondlife_setup_tmp.nsi" # the following replaces strings in the nsi template # it also does python-style % substitution @@ -656,6 +646,8 @@ class Windows_i686_Manifest(ViewerManifest): "%%SOURCE%%":self.get_src_prefix(), "%%INST_VARS%%":inst_vars_template % substitution_strings, "%%INSTALL_FILES%%":self.nsi_file_commands(True), + "%%$PROGRAMFILES%%":program_files, + "%%ENGAGEREGISTRY%%":engage_registry, "%%DELETE_FILES%%":self.nsi_file_commands(False)}) # We use the Unicode version of NSIS, available from @@ -671,7 +663,7 @@ class Windows_i686_Manifest(ViewerManifest): while (not installer_created) and (nsis_attempts > 0): try: nsis_attempts-=1; - self.run_command('"' + NSIS_path + '" ' + self.dst_path_of(tempfile)) + self.run_command('"' + NSIS_path + '" /V2 ' + self.dst_path_of(tempfile)) installer_created=True # if no exception was raised, the codesign worked except ManifestError, err: if nsis_attempts: @@ -699,7 +691,17 @@ class Windows_i686_Manifest(ViewerManifest): self.package_file = installer_file -class Darwin_i386_Manifest(ViewerManifest): +class Windows_i686_Manifest(WindowsManifest): + # specialize when we must + pass + + +class Windows_x86_64_Manifest(WindowsManifest): + # specialize when we must + pass + + +class DarwinManifest(ViewerManifest): def is_packaging_viewer(self): # darwin requires full app bundle packaging even for debugging. return True @@ -725,7 +727,7 @@ class Darwin_i386_Manifest(ViewerManifest): # most everything goes in the Resources directory if self.prefix(src="", dst="Resources"): - super(Darwin_i386_Manifest, self).construct() + super(DarwinManifest, self).construct() if self.prefix("cursors_mac"): self.path("*.tif") @@ -793,7 +795,7 @@ class Darwin_i386_Manifest(ViewerManifest): "libapr-1.0.dylib", "libaprutil-1.0.dylib", "libcollada14dom.dylib", - "libexpat.1.5.2.dylib", + "libexpat.1.dylib", "libexception_handler.dylib", "libGLOD.dylib", ): @@ -844,22 +846,52 @@ class Darwin_i386_Manifest(ViewerManifest): except OSError as err: print "Can't symlink %s -> %s: %s" % (src, dst, err) - # LLCefLib helper apps go inside SLPlugin.app + # Dullahan helper apps go inside SLPlugin.app if self.prefix(src="", dst="SLPlugin.app/Contents/Frameworks"): - for helperappfile in ('LLCefLib Helper.app', - 'LLCefLib Helper EH.app'): + for helperappfile in ('DullahanHelper.app'): self.path2basename(relpkgdir, helperappfile) pluginframeworkpath = self.dst_path_of('Chromium Embedded Framework.framework'); + # Putting a Frameworks directory under Contents/MacOS + # isn't canonical, but the path baked into Dullahan + # Helper.app/Contents/MacOS/DullahanHelper is: + # @executable_path/Frameworks/Chromium Embedded Framework.framework/Chromium Embedded Framework + # (notice, not @executable_path/../Frameworks/etc.) + # So we'll create a symlink (below) from there back to the + # Frameworks directory nested under SLPlugin.app. + helperframeworkpath = \ + self.dst_path_of('DullahanHelper.app/Contents/MacOS/' + 'Frameworks/Chromium Embedded Framework.framework') self.end_prefix() + # the helper app needs to have it's @executable_path modified to point to the + # same location we drop the CEF framework shortcut + helperexecutablepath = self.dst_path_of('SLPlugin.app/Contents/Frameworks/DullahanHelper.app/Contents/MacOS/DullahanHelper') + self.run_command('install_name_tool -change ' + '"@executable_path/Chromium Embedded Framework" ' + '"@executable_path/Frameworks/Chromium Embedded Framework.framework/Chromium Embedded Framework" "%s"' % helperexecutablepath) + # SLPlugin plugins if self.prefix(src="", dst="llplugin"): - self.path2basename("../media_plugins/quicktime/" + self.args['configuration'], - "media_plugin_quicktime.dylib") self.path2basename("../media_plugins/cef/" + self.args['configuration'], "media_plugin_cef.dylib") + + # copy LibVLC plugin itself + self.path2basename("../media_plugins/libvlc/" + self.args['configuration'], + "media_plugin_libvlc.dylib") + + # copy LibVLC dynamic libraries + if self.prefix(src=os.path.join(os.pardir, 'packages', 'lib', 'release' ), dst="lib"): + self.path( "libvlc*.dylib*" ) + self.end_prefix() + + # copy LibVLC plugins folder + if self.prefix(src=os.path.join(os.pardir, 'packages', 'lib', 'release', 'plugins' ), dst="lib"): + self.path( "*.dylib" ) + self.path( "plugins.dat" ) + self.end_prefix() + self.end_prefix("llplugin") self.end_prefix("Resources") @@ -879,16 +911,36 @@ class Darwin_i386_Manifest(ViewerManifest): # this symlink, Second Life web media can't possibly work. # Real Framework folder: # Second Life.app/Contents/Frameworks/Chromium Embedded Framework.framework/ - # Location of symlink and why it'ds relative + # Location of symlink and why it's relative # Second Life.app/Contents/Resources/SLPlugin.app/Contents/Frameworks/Chromium Embedded Framework.framework/ # Real Frameworks folder, with the symlink inside the bundled SLPlugin.app (and why it's relative) # <top level>.app/Contents/Frameworks/Chromium Embedded Framework.framework/ # <top level>.app/Contents/Resources/SLPlugin.app/Contents/Frameworks/Chromium Embedded Framework.framework -> - frameworkpath = os.path.join(os.pardir, os.pardir, os.pardir, os.pardir, "Frameworks", "Chromium Embedded Framework.framework") + # It might seem simpler just to create a symlink Frameworks to + # the parent of Chromimum Embedded Framework.framework. But + # that would create a symlink cycle, which breaks our + # packaging step. So make a symlink from Chromium Embedded + # Framework.framework to the directory of the same name, which + # is NOT an ancestor of the symlink. + frameworkpath = os.path.join(os.pardir, os.pardir, os.pardir, + os.pardir, "Frameworks", + "Chromium Embedded Framework.framework") try: - symlinkf(frameworkpath, pluginframeworkpath) + # from SLPlugin.app/Contents/Frameworks/Chromium Embedded + # Framework.framework back to Second + # Life.app/Contents/Frameworks/Chromium Embedded Framework.framework + origin, target = pluginframeworkpath, frameworkpath + symlinkf(target, origin) + # from SLPlugin.app/Contents/Frameworks/Dullahan + # Helper.app/Contents/MacOS/Frameworks/Chromium Embedded + # Framework.framework back to + # SLPlugin.app/Contents/Frameworks/Chromium Embedded Framework.framework + self.cmakedirs(os.path.dirname(helperframeworkpath)) + origin = helperframeworkpath + target = os.path.join(os.pardir, frameworkpath) + symlinkf(target, origin) except OSError as err: - print "Can't symlink %s -> %s: %s" % (frameworkpath, pluginframeworkpath, err) + print "Can't symlink %s -> %s: %s" % (origin, target, err) raise self.end_prefix("Contents") @@ -1052,6 +1104,20 @@ class Darwin_i386_Manifest(ViewerManifest): self.package_file = finalname self.remove(sparsename) + +class Darwin_i386_Manifest(DarwinManifest): + pass + + +class Darwin_i686_Manifest(DarwinManifest): + """alias in case arch is passed as i686 instead of i386""" + pass + + +class Darwin_x86_64_Manifest(DarwinManifest): + pass + + class LinuxManifest(ViewerManifest): def construct(self): super(LinuxManifest, self).construct() diff --git a/indra/test/CMakeLists.txt b/indra/test/CMakeLists.txt index 55442b2521..8344cead57 100644 --- a/indra/test/CMakeLists.txt +++ b/indra/test/CMakeLists.txt @@ -102,7 +102,6 @@ target_link_libraries(lltest ${BOOST_CONTEXT_LIBRARY} ${BOOST_SYSTEM_LIBRARY} ${DL_LIBRARY} - ${GOOGLE_PERFTOOLS_LIBRARIES} ) if (WINDOWS) diff --git a/indra/test/llstreamtools_tut.cpp b/indra/test/llstreamtools_tut.cpp index 0f6436f0f4..2f027b688f 100644 --- a/indra/test/llstreamtools_tut.cpp +++ b/indra/test/llstreamtools_tut.cpp @@ -149,10 +149,9 @@ namespace tut is.clear(); is.str(str = "# \r\n # SecondLife is a 3D World. ##"); - skip_comments_and_emptyspace(is); - is.get(arr, 255, '\0'); - expected_result = ""; - ensure_equals("skip_comments_and_emptyspace: skip comment - 2", arr, expected_result); + ensure("should not be good()", ! skip_comments_and_emptyspace(is)); + ensure("should be at eof()", is.eof()); + // don't get(): given bad state, we can't rely on results is.clear(); is.str(str = " \r\n SecondLife is a 3D World. ##"); @@ -164,14 +163,12 @@ namespace tut is.clear(); is.str(str = ""); ret = skip_comments_and_emptyspace(is); - is.get(arr, 255, '\0'); - ensure("skip_comments_and_emptyspace: empty string", ret == false); + ensure("skip_comments_and_emptyspace: empty string", ! ret); is.clear(); is.str(str = " \r\n \t # SecondLife is a 3D World"); ret = skip_comments_and_emptyspace(is); - is.get(arr, 255, '\0'); - ensure("skip_comments_and_emptyspace: space newline comment empty", ret == false); + ensure("skip_comments_and_emptyspace: space newline comment empty", ! ret); } //testcases for skip_line() diff --git a/indra/test_apps/llplugintest/CMakeLists.txt b/indra/test_apps/llplugintest/CMakeLists.txt deleted file mode 100644 index e682eaccca..0000000000 --- a/indra/test_apps/llplugintest/CMakeLists.txt +++ /dev/null @@ -1,336 +0,0 @@ -# -*- cmake -*- -project(llplugintest) - -include(00-Common) -include(OpenGL) -include(LLCommon) -include(LLPlugin) -include(Linking) -include(LLSharedLibs) -include(PluginAPI) -include(LLImage) -include(LLMath) -include(LLMessage) -include(LLRender) -include(LLWindow) -include(Glut) -include(Glui) - -include_directories( - ${LLPLUGIN_INCLUDE_DIRS} - ${LLCOMMON_INCLUDE_DIRS} - ${LLIMAGE_INCLUDE_DIRS} - ${LLMATH_INCLUDE_DIRS} - ${LLMESSAGE_INCLUDE_DIRS} - ${LLRENDER_INCLUDE_DIRS} - ${LLWINDOW_INCLUDE_DIRS} -) -include_directories(SYSTEM - ${LLCOMMON_SYSTEM_INCLUDE_DIRS} - ) - -if (DARWIN) - include(CMakeFindFrameworks) - find_library(COREFOUNDATION_LIBRARY CoreFoundation) -endif (DARWIN) - -### demo_plugin - -#set(demo_plugin_SOURCE_FILES -# demo_plugin.cpp -# ) -# -#add_library(demo_plugin -# SHARED -# ${demo_plugin_SOURCE_FILES} -#) -# -#target_link_libraries(demo_plugin -# ${LLPLUGIN_LIBRARIES} -# ${LLCOMMON_LIBRARIES} -# ${PLUGIN_API_WINDOWS_LIBRARIES} -#) -# -#add_dependencies(demo_plugin -# ${LLPLUGIN_LIBRARIES} -# ${LLCOMMON_LIBRARIES} -#) -# -#if (DARWIN) -# # Don't prepend 'lib' to the executable name, and don't embed a full path in the library's install name -# set_target_properties( -# demo_plugin -# PROPERTIES -# PREFIX "" -# BUILD_WITH_INSTALL_RPATH 1 -# INSTALL_NAME_DIR "@executable_path" -# ) -#endif (DARWIN) - -### plugin_host - -#set(plugin_host_SOURCE_FILES -# plugin_host.cpp -# ) -# -#add_executable(plugin_host -# WIN32 -# ${plugin_host_SOURCE_FILES} -#) -# -#set_target_properties(plugin_host -# PROPERTIES -# WIN32_EXECUTABLE -# FALSE -#) -# -#target_link_libraries(plugin_host -# ${LLPLUGIN_LIBRARIES} -# ${LLCOMMON_LIBRARIES} -# ${PLUGIN_API_WINDOWS_LIBRARIES} -#) -# -#add_dependencies(plugin_host -# demo_plugin -# ${LLPLUGIN_LIBRARIES} -# ${LLCOMMON_LIBRARIES} -#) - -### plugin_process_launcher - -#set(plugin_process_launcher_SOURCE_FILES -# plugin_process_launcher.cpp -# ) -# -#add_executable(plugin_process_launcher -# WIN32 -# ${plugin_process_launcher_SOURCE_FILES} -#) -# -#set_target_properties(plugin_process_launcher -# PROPERTIES -# WIN32_EXECUTABLE -# FALSE -#) -# -#target_link_libraries(plugin_process_launcher -# ${LLPLUGIN_LIBRARIES} -# ${LLMESSAGE_LIBRARIES} -# ${LLCOMMON_LIBRARIES} -# ${PLUGIN_API_WINDOWS_LIBRARIES} -#) -# -#add_dependencies(plugin_process_launcher -# SLPlugin -# demo_plugin -# ${LLPLUGIN_LIBRARIES} -# ${LLMESSAGE_LIBRARIES} -# ${LLCOMMON_LIBRARIES} -#) - -### media_simple_test - -#set(media_simple_test_SOURCE_FILES -# media_simple_test.cpp -# ) -# -#add_executable(media_simple_test -# WIN32 -# ${media_simple_test_SOURCE_FILES} -#) -# -#add_dependencies(media_simple_test stage_third_party_libs) -# -#set_target_properties(media_simple_test -# PROPERTIES -# WIN32_EXECUTABLE -# FALSE -#) -# -#target_link_libraries(media_simple_test -# ${GLUT_LIBRARY} -# ${OPENGL_LIBRARIES} -# ${LLCOMMON_LIBRARIES} -#) - -### media_plugin_test - -#set(media_plugin_test_SOURCE_FILES -# media_plugin_test.cpp -# ) -# -#add_executable(media_plugin_test -# WIN32 -# ${media_plugin_test_SOURCE_FILES} -#) -# -#set_target_properties(media_plugin_test -# PROPERTIES -# WIN32_EXECUTABLE -# FALSE -#) -# -#target_link_libraries(media_plugin_test -# ${GLUT_LIBRARY} -# ${OPENGL_LIBRARIES} -# ${LLPLUGIN_LIBRARIES} -# ${LLMESSAGE_LIBRARIES} -# ${LLCOMMON_LIBRARIES} -# ${PLUGIN_API_WINDOWS_LIBRARIES} -#) -# -#add_dependencies(media_plugin_test -# stage_third_party_libs -# SLPlugin -# demo_media_plugin -# ${LLPLUGIN_LIBRARIES} -# ${LLMESSAGE_LIBRARIES} -# ${LLCOMMON_LIBRARIES} -#) - -### demo_media_plugin - -#set(demo_media_plugin_SOURCE_FILES -# demo_media_plugin.cpp -# ) -# -#add_library(demo_media_plugin -# SHARED -# ${demo_media_plugin_SOURCE_FILES} -#) -# -#target_link_libraries(demo_media_plugin -# ${LLPLUGIN_LIBRARIES} -# ${LLCOMMON_LIBRARIES} -# ${PLUGIN_API_WINDOWS_LIBRARIES} -#) -# -#add_dependencies(demo_media_plugin -# ${LLPLUGIN_LIBRARIES} -# ${LLCOMMON_LIBRARIES} -#) -# -#if (DARWIN) -# # Don't prepend 'lib' to the executable name, and don't embed a full path in the library's install name -# set_target_properties( -# demo_media_plugin -# PROPERTIES -# PREFIX "" -# BUILD_WITH_INSTALL_RPATH 1 -# INSTALL_NAME_DIR "@executable_path" -# ) -#endif (DARWIN) - -### demo_media_plugin_2 - -#set(demo_media_plugin_2_SOURCE_FILES -# demo_media_plugin_2.cpp -# ) -# -#add_library(demo_media_plugin_2 -# SHARED -# ${demo_media_plugin_2_SOURCE_FILES} -#) -# -#target_link_libraries(demo_media_plugin_2 -# ${LLPLUGIN_LIBRARIES} -# ${LLCOMMON_LIBRARIES} -# ${PLUGIN_API_WINDOWS_LIBRARIES} -#) -# -#add_dependencies(demo_media_plugin_2 -# ${LLPLUGIN_LIBRARIES} -# ${LLCOMMON_LIBRARIES} -#) -# -#if (DARWIN) -# # Don't prepend 'lib' to the executable name, and don't embed a full path in the library's install name -# set_target_properties( -# demo_media_plugin_2 -# PROPERTIES -# PREFIX "" -# BUILD_WITH_INSTALL_RPATH 1 -# INSTALL_NAME_DIR "@executable_path" -# ) -#endif (DARWIN) - -# Gather build products of the various dependencies into the build directory for the testbed. - -if(WINDOWS) - #******************** - # Plugin test library deploy - # - # Debug config runtime files required for the plugin test mule - set(plugintest_debug_src_dir "${ARCH_PREBUILT_DIRS_DEBUG}") - set(plugintest_debug_files - libeay32.dll - libglib-2.0-0.dll - libgmodule-2.0-0.dll - libgobject-2.0-0.dll - libgthread-2.0-0.dll - ssleay32.dll - ) - copy_if_different( - ${plugintest_debug_src_dir} - "${CMAKE_CURRENT_BINARY_DIR}/Debug" - out_targets - ${plugintest_debug_files} - ) - set(plugin_test_targets ${plugin_test_targets} ${out_targets}) - - # Release & ReleaseDebInfo config runtime files required for the plugin test mule - set(plugintest_release_src_dir "${ARCH_PREBUILT_DIRS_RELEASE}") - set(plugintest_release_files - libeay32.dll - libglib-2.0-0.dll - libgmodule-2.0-0.dll - libgobject-2.0-0.dll - libgthread-2.0-0.dll - ssleay32.dll - ) - copy_if_different( - ${plugintest_release_src_dir} - "${CMAKE_CURRENT_BINARY_DIR}/Release" - out_targets - ${plugintest_release_files} - ) - set(plugin_test_targets ${plugin_test_targets} ${out_targets}) - - copy_if_different( - ${plugintest_release_src_dir} - "${CMAKE_CURRENT_BINARY_DIR}/RelWithDebInfo" - out_targets - ${plugintest_release_files} - ) - set(plugin_test_targets ${plugin_test_targets} ${out_targets}) - - add_custom_target(copy_plugintest_libs ALL - DEPENDS - ${plugin_test_targets} - ) - -endif(WINDOWS) - -if (DARWIN) - set(plugintest_release_src_dir "${ARCH_PREBUILT_DIRS_RELEASE}") - set(plugintest_release_files - libexception_handler.dylib - libaprutil-1.0.dylib - libapr-1.0.dylib - libexpat.1.5.2.dylib - ) - copy_if_different( - ${plugintest_release_src_dir} - "${PLUGINS_DESTINATION_DIR}" - out_targets - ${plugintest_release_files} - ) - set(plugin_test_targets ${plugin_test_targets} ${out_targets}) - - add_custom_target(copy_plugintest_libs ALL - DEPENDS - ${plugin_test_targets} - ) - -endif (DARWIN) - diff --git a/indra/test_apps/llplugintest/README.Linden b/indra/test_apps/llplugintest/README.Linden deleted file mode 100644 index 4a9f223c21..0000000000 --- a/indra/test_apps/llplugintest/README.Linden +++ /dev/null @@ -1,21 +0,0 @@ - -1. Description - - Exercises SLPlugin. Demonstrates mediakit plugin reuse and - switchover as MIME type changes (web, quicktime, flash). - - -2. Running - - 2.1 Mac - - Make certain '.' is included in PATH. E.g.: - - PATH=.:"$PATH" open build-darwin-i386/test_apps/llmediaplugintest/RelWithDebInfo/llmediaplugintest.app - - Otherwise the program won't find SLPlugin and will timeout and - fail after 30 seconds and give you little information as to why. - - Running 'dtruss' on plugin test applications will give you a great - deal of insight into why they aren't activating. - diff --git a/indra/test_apps/llplugintest/bookmarks.txt b/indra/test_apps/llplugintest/bookmarks.txt deleted file mode 100644 index 2ff64f217f..0000000000 --- a/indra/test_apps/llplugintest/bookmarks.txt +++ /dev/null @@ -1,37 +0,0 @@ -# format is description, url (don't put ',' chars in description :) -# if no ',' found, whole line is used for both description and url -(WK) Google Home Page,http://www.google.com -(WK) BBC News Home Page,http://news.bbc.co.uk -(WK) Second Life,http://secondlife.com -(WK) WebKit Home ,http://www.webkit.org -(WK) Yahoo News,http://news.yahoo.com -(WK) Canvas Paint (DHTML version of MS Paint),http://www.canvaspaint.org -(WK) DHTML Lemmings!,http://www.elizium.nu/scripts/lemmings/ -(WK) DHTML graphics demos,http://www.dhteumeuleu.com/ -(WK) Shared paint app,http://colorillo.com/ac79?1l0q6cp -(Flash) YouTube,http://youtube.com -(Flash) Vimeo,http://www.vimeo.com/1778399 -(Flash) Simple whiteboard,http://www.imaginationcubed.com/ -(Flash) Dabble Board,http://www.dabbleboard.com/draw -(Flash) Bubble Shooter game,http://www.wiicade.com/playGame.aspx?gameID=72&gameName=Bubble%20Shooter -(Flash) Pixlr photo editor,http://pixlr.com/editor/ -(Flash) Scribd,http://www.scribd.com/doc/14427744/Second-Life-Quickstart-Guide -(Flash) MAME,http://yvern.com/fMAME/fMAME.html -(QT) Local sample,file:///C|/Program Files/QuickTime/Sample.mov -(QT) Movie - Watchmen Trailer,http://trailers.apple.com/movies/wb/watchmen/watchmen-tlr2_480p.mov -(QT) Movie - Transformers - Revenge of the Fallen,http://trailers.apple.com/movies/paramount/transformers2/transformersrevengeofthefallen-tlr1_h.320.mov -(QT) Movie - Terminator Salvation,http://trailers.apple.com/movies/wb/terminatorsalvation/terminatorsalvation-tlr3_h.320.mov -(QT) Movie - Angels and Demons,http://trailers.apple.com/movies/sony_pictures/angelsanddemons/angelsanddemons-video_h.320.mov -(QT) Movie - Sin City Trailer,http://trailers.apple.com/movies/miramax/sin_city/sin_city_480.mov -(QT) Movie - The Incredibles Trailer,http://trailers.apple.com/movies/disney/the_incredibles/the_incredibles-tlr_a480.mov -(QT) Movie - Streaming Apple Event,http://stream.qtv.apple.com/events/mar/0903lajkszg/m_090374535329zdwg_650_ref.mov -(QT) Movie - MPEG-4 from Amazon S3,http://s3.amazonaws.com/callum-linden/flashdemo/interactive_flash_demo.mp4 -(QT) Movie - Star Trek,http://trailers.apple.com/movies/paramount/star_trek/startrek-tlr3_h.320.mov -(QT) Movie - Ice Age 3,http://trailers.apple.com/movies/fox/ice_age_iii/iceage3-tlrd_h.320.mov -(QT) Movie - AstroBoy,http://trailers.apple.com/movies/summit/astroboy/astroboy-tsr_h.320.mov -(QT) Movie - Ante Up,http://trailers.apple.com/movies/independent/anteup/anteup_h.320.mov -(QT) Movie - Every Little Step,http://trailers.apple.com/movies/sony/everylittlestep/everylittlestep-clip_h.320.mov -(QT) Movie - The Informers,http://trailers.apple.com/movies/independent/theinformers/theinformers_h.320.mov -(QT) Animated GIF,http://upload.wikimedia.org/wikipedia/commons/4/44/Optical.greysquares.arp-animated.gif -(QT) Apple Text Descriptors,http://ubrowser.com/tmp/apple_text.txt -(EX) Example Plugin,example://blah |