diff --git a/.gitattributes b/.gitattributes index 5c7f5b73b07..e7c2f838973 100644 --- a/.gitattributes +++ b/.gitattributes @@ -24,6 +24,10 @@ *.dll binary *.exe binary +# Test Resources +*.binary binary +*.output binary + # Files with Windows line endings VivoxAUP.txt text eol=crlf FILES_ARE_UNICODE_UTF-16LE.txt text eol=crlf diff --git a/.github/labeler.yaml b/.github/labeler.yaml index 5a6590d4aac..6359419ba67 100644 --- a/.github/labeler.yaml +++ b/.github/labeler.yaml @@ -1,81 +1,109 @@ llappearance: - - indra/llappearance/**/* +- changed-files: + - any-glob-to-any-file: indra/llappearance/** llaudio: - - indra/llaudio/**/* +- changed-files: + - any-glob-to-any-file: indra/llaudio/** llcharacter: - - indra/llcharacter/**/* +- changed-files: + - any-glob-to-any-file: indra/llcharacter/** llcommon: - - indra/llcommon/**/* +- changed-files: + - any-glob-to-any-file: indra/llcommon/** llcorehttp: - - indra/llcorehttp/**/* +- changed-files: + - any-glob-to-any-file: indra/llcorehttp/** llcrashlogger: - - indra/llcrashlogger/**/* +- changed-files: + - any-glob-to-any-file: indra/llcrashlogger/** llfilesystem: - - indra/llfilesystem/**/* +- changed-files: + - any-glob-to-any-file: indra/llfilesystem/** llimage: - - indra/llimage/**/* +- changed-files: + - any-glob-to-any-file: indra/llimage/** llimagej2coj: - - indra/llimagej2coj/**/* +- changed-files: + - any-glob-to-any-file: indra/llimagej2coj/** llinventory: - - indra/llinventory/**/* +- changed-files: + - any-glob-to-any-file: indra/llinventory/** llkdu: - - indra/llkdu/**/* +- changed-files: + - any-glob-to-any-file: indra/llkdu/** llmath: - - indra/llmath/**/* +- changed-files: + - any-glob-to-any-file: indra/llmath/** llmeshoptimizer: - - indra/llmeshoptimizer/**/* +- changed-files: + - any-glob-to-any-file: indra/llmeshoptimizer/** llmessage: - - indra/llmessage/**/* +- changed-files: + - any-glob-to-any-file: indra/llmessage/** llplugin: - - indra/llplugin/**/* +- changed-files: + - any-glob-to-any-file: indra/llplugin/** llprimitive: - - indra/llprimitive/**/* +- changed-files: + - any-glob-to-any-file: indra/llprimitive/** llrender: - - indra/llrender/**/* +- changed-files: + - any-glob-to-any-file: indra/llrender/** llui: - - indra/llui/**/* +- changed-files: + - any-glob-to-any-file: indra/llui/** llwindow: - - indra/llwindow/**/* +- changed-files: + - any-glob-to-any-file: indra/llwindow/** llxml: - - indra/llxml/**/* +- changed-files: + - any-glob-to-any-file: indra/llxml/** cmake: - - '**/*.cmake' - - '**/*/cmake/*' - - '**/CMakeLists.txt' +- changed-files: + - any-glob-to-any-file: + - '**/*.cmake' + - '**/*/cmake/*' + - '**/CMakeLists.txt' python: - - '**/*.py' +- changed-files: + - any-glob-to-any-file: '**/*.py' c/cpp: - - '**/*.c' - - '**/*.cpp' - - '**/*.cxx' - - '**/*.h' - - '**/*.hpp' - - '**/*.hxx' - - '**/*.i' - - '**/*.inl' - - '**/*.y' - -'team:viewer': - - '*' +- changed-files: + - any-glob-to-any-file: + - '**/*.c' + - '**/*.cpp' + - '**/*.cxx' + - '**/*.h' + - '**/*.hpp' + - '**/*.hxx' + - '**/*.i' + - '**/*.inl' + - '**/*.y' + +objc: +- changed-files: + - any-glob-to-any-file: + - '**/*.m' + - '**/*.mm' diff --git a/.github/workflows/build.yaml b/.github/workflows/build.yaml index 4c948e55864..df927eb1876 100644 --- a/.github/workflows/build.yaml +++ b/.github/workflows/build.yaml @@ -43,7 +43,7 @@ jobs: needs: setup strategy: matrix: - runner: ${{ fromJson((github.ref_type == 'tag' && startsWith(github.ref, 'refs/tags/Second_Life')) && '["windows-large","macos-15-xlarge"]' || '["windows-2022","macos-15-xlarge"]') }} + runner: ${{ fromJson((github.ref_type == 'tag' && startsWith(github.ref, 'refs/tags/Second_Life')) && '["windows-large","macos-15-xlarge","linux-large"]' || '["windows-2022","macos-15-xlarge","ubuntu-22.04"]') }} configuration: ${{ fromJson(needs.setup.outputs.configurations) }} runs-on: ${{ matrix.runner }} outputs: @@ -90,8 +90,22 @@ jobs: with: ref: ${{ github.event.pull_request.head.sha || github.sha }} + - name: Linux Disk Cleanup + if: runner.os == 'Linux' + run: | + # Prune various unused files from linux builder to fix free runner disk space exhaustion + df -h + sudo docker container prune -f + sudo docker image prune -a -f + sudo rm -rf /usr/local/share/boost + sudo rm -rf /usr/share/dotnet + sudo rm -rf /usr/local/lib/android + sudo rm -rf /opt/ghc + sudo rm -rf /usr/local/.ghcup + df -h + - name: Setup python - uses: actions/setup-python@v5 + uses: actions/setup-python@v6 with: python-version: "3.11" - name: Checkout build variables @@ -120,6 +134,21 @@ jobs: ${{ runner.os }}-64-${{ matrix.configuration }}- ${{ runner.os }}-64- + - name: Install Linux dependencies + if: runner.os == 'Linux' + run: | + sudo apt update + sudo apt install -y \ + libpulse-dev libunwind-dev \ + libgl1-mesa-dev libglu1-mesa-dev libxinerama-dev \ + libxcursor-dev libxfixes-dev libgstreamer1.0-dev \ + libgstreamer-plugins-base1.0-dev ninja-build libxft-dev \ + libpipewire-0.3-dev libdbus-1-dev libvlc-dev \ + libosmesa6-dev + sudo locale-gen en_US.UTF-8 + sudo locale-gen en_GB.UTF-8 + sudo locale-gen fr_FR.UTF-8 + - name: Determine source branch id: which-branch uses: secondlife/viewer-build-util/which-branch@v2 @@ -298,6 +327,16 @@ jobs: path: | ${{ steps.build.outputs.physicstpv }} + - name: Upload appearance utility package + uses: actions/upload-artifact@v4 + if: steps.build.outputs.appearanceutility + with: + name: "${{ steps.build.outputs.artifact }}-appearanceutility" + # emitted by build.sh, zero or one lines + path: | + ${{ steps.build.outputs.appearanceutility }} + + sign-and-package-windows: env: AZURE_KEY_VAULT_URI: ${{ secrets.AZURE_KEY_VAULT_URI }} @@ -362,8 +401,9 @@ jobs: post-windows-symbols: env: - BUGSPLAT_USER: ${{ secrets.BUGSPLAT_USER }} - BUGSPLAT_PASS: ${{ secrets.BUGSPLAT_PASS }} + BUGSPLAT_DATABASE: "${{ secrets.BUGSPLAT_DATABASE }}" + SYMBOL_UPLOAD_CLIENT_ID: "${{ secrets.BUGSPLAT_SYMBOL_UPLOAD_CLIENT_ID }}" + SYMBOL_UPLOAD_CLIENT_SECRET: "${{ secrets.BUGSPLAT_SYMBOL_UPLOAD_CLIENT_SECRET }}" needs: build if: needs.build.outputs.configuration == 'Release' runs-on: ubuntu-latest @@ -374,71 +414,82 @@ jobs: name: Windows-app path: _artifacts - name: Download Windows Symbols - if: env.BUGSPLAT_USER && env.BUGSPLAT_PASS + if: env.BUGSPLAT_DATABASE && env.SYMBOL_UPLOAD_CLIENT_ID uses: actions/download-artifact@v4 with: name: Windows-symbols - name: Extract viewer pdb - if: env.BUGSPLAT_USER && env.BUGSPLAT_PASS + if: env.BUGSPLAT_DATABASE && env.SYMBOL_UPLOAD_CLIENT_ID shell: bash run: | tar -xJf "${{ needs.build.outputs.viewer_channel }}.sym.tar.xz" -C _artifacts - name: Post Windows symbols - if: env.BUGSPLAT_USER && env.BUGSPLAT_PASS - uses: secondlife-3p/symbol-upload@v10 + if: env.BUGSPLAT_DATABASE && env.SYMBOL_UPLOAD_CLIENT_ID + uses: BugSplat-Git/symbol-upload@095d163ae9ceb006d286a731dcd35cf6a1b458c8 with: - username: ${{ env.BUGSPLAT_USER }} - password: ${{ env.BUGSPLAT_PASS }} - database: "SecondLife_Viewer_2018" + clientId: "${{ env.SYMBOL_UPLOAD_CLIENT_ID }}" + clientSecret: "${{ env.SYMBOL_UPLOAD_CLIENT_SECRET }}" + database: "${{ env.BUGSPLAT_DATABASE }}" application: ${{ needs.build.outputs.viewer_channel }} version: ${{ needs.build.outputs.viewer_version }} directory: _artifacts files: "**/{SecondLifeViewer.exe,llwebrtc.dll,*.pdb}" + node-version: "22" + dumpSyms: false post-mac-symbols: env: - BUGSPLAT_USER: ${{ secrets.BUGSPLAT_USER }} - BUGSPLAT_PASS: ${{ secrets.BUGSPLAT_PASS }} + BUGSPLAT_DATABASE: "${{ secrets.BUGSPLAT_DATABASE }}" + SYMBOL_UPLOAD_CLIENT_ID: "${{ secrets.BUGSPLAT_SYMBOL_UPLOAD_CLIENT_ID }}" + SYMBOL_UPLOAD_CLIENT_SECRET: "${{ secrets.BUGSPLAT_SYMBOL_UPLOAD_CLIENT_SECRET }}" needs: build if: needs.build.outputs.configuration == 'Release' runs-on: ubuntu-latest steps: - name: Download Mac Symbols - if: env.BUGSPLAT_USER && env.BUGSPLAT_PASS + if: env.BUGSPLAT_DATABASE && env.SYMBOL_UPLOAD_CLIENT_ID uses: actions/download-artifact@v4 with: name: macOS-symbols - name: Post Mac symbols - if: env.BUGSPLAT_USER && env.BUGSPLAT_PASS - uses: secondlife-3p/symbol-upload@v10 + if: env.BUGSPLAT_DATABASE && env.SYMBOL_UPLOAD_CLIENT_ID + uses: BugSplat-Git/symbol-upload@095d163ae9ceb006d286a731dcd35cf6a1b458c8 with: - username: ${{ env.BUGSPLAT_USER }} - password: ${{ env.BUGSPLAT_PASS }} - database: "SecondLife_Viewer_2018" + clientId: "${{ env.SYMBOL_UPLOAD_CLIENT_ID }}" + clientSecret: "${{ env.SYMBOL_UPLOAD_CLIENT_SECRET }}" + database: "${{ env.BUGSPLAT_DATABASE }}" application: ${{ needs.build.outputs.viewer_channel }} version: ${{ needs.build.outputs.viewer_version }} (${{ needs.build.outputs.viewer_version }}) directory: . files: "**/*.xcarchive.zip" + node-version: "22" + dumpSyms: false release: needs: [setup, build, sign-and-package-windows, sign-and-package-mac] runs-on: ubuntu-latest if: needs.setup.outputs.release_run steps: - - uses: actions/download-artifact@v4 + - uses: actions/download-artifact@v5 with: pattern: "*-installer" - - uses: actions/download-artifact@v4 + - uses: actions/download-artifact@v5 with: pattern: "*-metadata" + - uses: actions/download-artifact@v5 + with: + name: "Linux-app" + - name: Rename metadata run: | cp Windows-metadata/autobuild-package.xml Windows-autobuild-package.xml cp Windows-metadata/newview/viewer_version.txt Windows-viewer_version.txt cp macOS-metadata/autobuild-package.xml macOS-autobuild-package.xml cp macOS-metadata/newview/viewer_version.txt macOS-viewer_version.txt + cp Linux-metadata/autobuild-package.xml Linux-autobuild-package.xml + cp Linux-metadata/newview/viewer_version.txt Linux-viewer_version.txt # forked from softprops/action-gh-release - name: Create GitHub release @@ -462,6 +513,7 @@ jobs: files: | macOS-installer/*.dmg Windows-installer/*.exe + *.tar.xz *-autobuild-package.xml *-viewer_version.txt diff --git a/.github/workflows/check-pr.yaml b/.github/workflows/check-pr.yaml index a5cee9157c7..08e907e83f5 100644 --- a/.github/workflows/check-pr.yaml +++ b/.github/workflows/check-pr.yaml @@ -12,7 +12,7 @@ jobs: runs-on: ubuntu-latest steps: - name: Check PR description - uses: actions/github-script@v7 + uses: actions/github-script@v8 with: script: | const description = context.payload.pull_request.body || ''; diff --git a/.github/workflows/cla.yaml b/.github/workflows/cla.yaml index 627ba512c41..5b31c584d50 100644 --- a/.github/workflows/cla.yaml +++ b/.github/workflows/cla.yaml @@ -23,4 +23,4 @@ jobs: path-to-signatures: signatures.json remote-organization-name: secondlife remote-repository-name: cla-signatures - allowlist: callum@mbp.localdomain,rye@lindenlab.com,rye + allowlist: callum@mbp.localdomain,rye@lindenlab.com,rye,bot* diff --git a/.github/workflows/label.yaml b/.github/workflows/label.yaml index 6e41d8aa2d8..218327ef470 100644 --- a/.github/workflows/label.yaml +++ b/.github/workflows/label.yaml @@ -9,7 +9,7 @@ jobs: pull-requests: write runs-on: ubuntu-latest steps: - - uses: actions/labeler@v4 + - uses: actions/labeler@v6 with: configuration-path: .github/labeler.yaml repo-token: "${{ secrets.GITHUB_TOKEN }}" diff --git a/.github/workflows/pre-commit.yaml b/.github/workflows/pre-commit.yaml index 726e1cd889b..8f942fa11bc 100644 --- a/.github/workflows/pre-commit.yaml +++ b/.github/workflows/pre-commit.yaml @@ -12,7 +12,7 @@ jobs: runs-on: ubuntu-latest steps: - uses: actions/checkout@v5 - - uses: actions/setup-python@v4 + - uses: actions/setup-python@v6 with: python-version: 3.x - uses: pre-commit/action@v3.0.1 diff --git a/.github/workflows/stale.yaml b/.github/workflows/stale.yaml index f77151a815f..edfe71b6930 100644 --- a/.github/workflows/stale.yaml +++ b/.github/workflows/stale.yaml @@ -12,7 +12,7 @@ jobs: stale: runs-on: ubuntu-latest steps: - - uses: actions/stale@v6 + - uses: actions/stale@v10 id: stale with: stale-pr-message: This pull request is stale because it has been open 30 days with no activity. Remove stale label or comment or it will be closed in 7 days diff --git a/.github/workflows/tag-release.yaml b/.github/workflows/tag-release.yaml index 24ee2de7949..2922065f995 100644 --- a/.github/workflows/tag-release.yaml +++ b/.github/workflows/tag-release.yaml @@ -35,7 +35,7 @@ jobs: echo NIGHTLY_DATE=${NIGHTLY_DATE} >> ${GITHUB_ENV} echo TAG_ID="$(echo ${{ github.sha }} | cut -c1-8)-${{ inputs.project || '${NIGHTLY_DATE}' }}" >> ${GITHUB_ENV} - name: Update Tag - uses: actions/github-script@v7.0.1 + uses: actions/github-script@v8 with: # use a real access token instead of GITHUB_TOKEN default. # required so that the results of this tag creation can trigger the build workflow diff --git a/.gitignore b/.gitignore index c4accf37b5b..a784d6e7d4c 100755 --- a/.gitignore +++ b/.gitignore @@ -17,11 +17,11 @@ *~ # Specific paths and/or names +.venv CMakeCache.txt cmake_install.cmake LICENSES -build-darwin-* -build-linux-* +build-* debian/files debian/secondlife-appearance-utility* debian/secondlife-viewer* diff --git a/autobuild.xml b/autobuild.xml index 2983307cbe6..fa18ba9b036 100644 --- a/autobuild.xml +++ b/autobuild.xml @@ -7,33 +7,65 @@ autobuild installables - SDL + SDL3 platforms + windows64 + + archive + + hash + 121b209bbf8ffb2f7f668a74de0e654f4be7339f + hash_algorithm + sha1 + url + https://github.com/secondlife/3p-sdl3/releases/download/v3.2.24-r1/SDL3-3.2.24-r1-windows64-18539840462.tar.zst + + name + windows64 + linux64 archive hash - 7ea2df03bfc35c06acf23dd9e734adac + 06226c54c57afd601707c0f5f7a2e0736ab1f326 + hash_algorithm + sha1 url - http://automated-builds-secondlife-com.s3.amazonaws.com/ct2/1103/2554/SDL-1.2.15-linux64-501092.tar.bz2 + https://github.com/secondlife/3p-sdl3/releases/download/v3.2.24-r1/SDL3-3.2.24-r1-linux64-18539840462.tar.zst name linux64 + darwin64 + + archive + + hash + aff68fb5655629c698e198af1581835267588f77 + hash_algorithm + sha1 + url + https://github.com/secondlife/3p-sdl3/releases/download/v3.2.24-r1/SDL3-3.2.24-r1-darwin64-18539840462.tar.zst + + name + darwin64 + license lgpl license_file - LICENSES/SDL.txt + LICENSES/SDL3.txt copyright - Copyright (C) 1997-2012 Sam Lantinga + Copyright (C) 1997-2022 Sam Lantinga (slouken@libsdl.org) version - 1.2.15 + 3.2.24-r1 + use_scm_version + true name - SDL + SDL3 description Simple DirectMedia Layer is a cross-platform multimedia library designed to provide low level access to audio, keyboard, mouse, joystick, 3D hardware via OpenGL, and 2D video framebuffer. @@ -46,11 +78,11 @@ archive hash - a21487f4e3a68721fd97edef117795a1b7212a77 + 3f8e58fe74e144b771858e89a5514bf354964c76 hash_algorithm sha1 url - https://github.com/secondlife/3p-apr_suite/releases/download/v1.7.5-r1/apr_suite-1.7.5-12259255574-darwin64-12259255574.tar.zst + https://github.com/secondlife/3p-apr_suite/releases/download/v1.7.5-r2/apr_suite-1.7.5-18696779749-darwin64-18696779749.tar.zst name darwin64 @@ -60,11 +92,11 @@ archive hash - 45baf82d3366734e542a2a3749f495b64f5513b4 + df36114eb8fb66fdcbb190011222a7d336791d98 hash_algorithm sha1 url - https://github.com/secondlife/3p-apr_suite/releases/download/v1.7.5-r1/apr_suite-1.7.5-12259255574-linux64-12259255574.tar.zst + https://github.com/secondlife/3p-apr_suite/releases/download/v1.7.5-r2/apr_suite-1.7.5-18696779749-linux64-18696779749.tar.zst name linux64 @@ -74,11 +106,11 @@ archive hash - bdd35d3b9580d3cdcb98afae639936aaa40e24c4 + 164705831819d247753c9fd608c2c1ac8dca1883 hash_algorithm sha1 url - https://github.com/secondlife/3p-apr_suite/releases/download/v1.7.5-r1/apr_suite-1.7.5-12259255574-windows64-12259255574.tar.zst + https://github.com/secondlife/3p-apr_suite/releases/download/v1.7.5-r2/apr_suite-1.7.5-18696779749-windows64-18696779749.tar.zst name windows64 @@ -91,7 +123,7 @@ copyright Copyright © 2012 The Apache Software Foundation, Licensed under the Apache License, Version 2.0. version - 1.7.5-12259255574 + 1.7.5-18696779749 name apr_suite description @@ -166,11 +198,11 @@ archive hash - cd1f1d55a2488657ec2253774b3a414621f81b24 + 9bcafdd7e1df6b92096fa850627d4f3437630d4a hash_algorithm sha1 url - https://github.com/secondlife/3p-bugsplat/releases/download/v1.1.5-71fc41e/bugsplat-1.1.1-9599607655-darwin64-9599607655.tar.zst + https://github.com/secondlife/3p-bugsplat/releases/download/v1.2.6-a475cbb/bugsplat-1.2.6-19430122611-darwin64-19430122611.tar.zst name darwin64 @@ -180,11 +212,11 @@ archive hash - 9fb0615d17988bd89a2e5ae6d4d19e150afb54a9 + 4e9f0c1cdbc1cebf6185ecc45228ced7f9af1532 hash_algorithm sha1 url - https://github.com/secondlife/3p-bugsplat/releases/download/v1.1.5-71fc41e/bugsplat-5.0.1.0-9599607655-windows64-9599607655.tar.zst + https://github.com/secondlife/3p-bugsplat/releases/download/v1.2.6-a475cbb/bugsplat-6.1.1.0-19430122611-windows64-19430122611.tar.zst name windows64 @@ -270,11 +302,11 @@ archive hash - d5fb3832a338bbe4891b823c64fdb4806706568e + e21e7755fe740d5ed30bd29441170449a57caa8b hash_algorithm sha1 url - https://github.com/secondlife/3p-cubemap_to_eqr_js/releases/download/v1.1.0-d7afe27/cubemaptoequirectangular-1.1.0-darwin64-d7afe27.tar.zst + https://github.com/secondlife/3p-cubemap_to_eqr_js/releases/download/v1.1.0-cb8785a/cubemaptoequirectangular-1.1.0-darwin64-cb8785a.tar.zst name darwin64 @@ -284,11 +316,11 @@ archive hash - 77c53daf558f51aec6e9f4bd9e930a103630ee7d + aea0bed0f953a9371b9091f09230b41597f891f7 hash_algorithm sha1 url - https://github.com/secondlife/3p-cubemap_to_eqr_js/releases/download/v1.1.0-d7afe27/cubemaptoequirectangular-1.1.0-linux64-d7afe27.tar.zst + https://github.com/secondlife/3p-cubemap_to_eqr_js/releases/download/v1.1.0-cb8785a/cubemaptoequirectangular-1.1.0-linux64-cb8785a.tar.zst name linux64 @@ -298,11 +330,11 @@ archive hash - 6c51855bcf3a8628289881fdaea08c25cf7b1b90 + eabc3b0c9d9084f49b8a4dc5d3834d77f668c27a hash_algorithm sha1 url - https://github.com/secondlife/3p-cubemap_to_eqr_js/releases/download/v1.1.0-d7afe27/cubemaptoequirectangular-1.1.0-windows64-d7afe27.tar.zst + https://github.com/secondlife/3p-cubemap_to_eqr_js/releases/download/v1.1.0-cb8785a/cubemaptoequirectangular-1.1.0-windows64-cb8785a.tar.zst name windows64 @@ -379,36 +411,6 @@ description Library for transferring data specified with URL syntax - dbus_glib - - platforms - - linux64 - - archive - - hash - 7ee7b9aed3c0c8c09e7bf26bba7af8e1 - url - http://automated-builds-secondlife-com.s3.amazonaws.com/hg/repo/p64_3p-dbus-glib/rev/314266/arch/Linux/installer/dbus_glib-0.76-linux64-314266.tar.bz2 - - name - linux64 - - - license - Academic Free License v. 2.1 - license_file - LICENSES/dbus-glib.txt - copyright - Copyright (C) Red Hat Inc. - version - 0.76 - name - dbus_glib - description - D-Bus bindings for glib - dictionaries platforms @@ -450,11 +452,11 @@ archive hash - 126e0fa4c16dfd433c9fb7d1d242da98f213d933 + 2c81fa7aa03b427088ab54ce3b71088a0003126b hash_algorithm sha1 url - https://github.com/secondlife/dullahan/releases/download/v1.24.0-CEF_139.0.40/dullahan-1.24.0.202510081737_139.0.40_g465474a_chromium-139.0.7258.139-darwin64-18353103947.tar.zst + https://github.com/secondlife/dullahan/releases/download/v1.26.0-CEF_139.0.40/dullahan-1.26.0.202510161627_139.0.40_g465474a_chromium-139.0.7258.139-darwin64-18568015445.tar.zst name darwin64 @@ -464,11 +466,11 @@ archive hash - 209d031ae67bc66d8e8f8509c71d259014c65ceb + 8e06d060729250c5bfcb993c8f818f36ea17de16 hash_algorithm sha1 url - https://github.com/secondlife/dullahan/releases/download/v1.14.0-r3/dullahan-1.14.0.202408091637_118.4.1_g3dd6078_chromium-118.0.5993.54-linux64-10322607516.tar.zst + https://github.com/secondlife/dullahan/releases/download/v1.26.0-CEF_139.0.40/dullahan-1.26.0.202510161627_139.0.40_g465474a_chromium-139.0.7258.139-linux64-18568015445.tar.zst name linux64 @@ -478,11 +480,11 @@ archive hash - 20de62c9e57d9e6539c1e2437ec4b46c3ca237bc + 7ca6db37f019b47e230c0861607c546d45535367 hash_algorithm sha1 url - https://github.com/secondlife/dullahan/releases/download/v1.24.0-CEF_139.0.40/dullahan-1.24.0.202510081738_139.0.40_g465474a_chromium-139.0.7258.139-windows64-18353103947.tar.zst + https://github.com/secondlife/dullahan/releases/download/v1.26.0-CEF_139.0.40/dullahan-1.26.0.202510161628_139.0.40_g465474a_chromium-139.0.7258.139-windows64-18568015445.tar.zst name windows64 @@ -495,7 +497,7 @@ copyright Copyright (c) 2017, Linden Research, Inc. version - 1.24.0.202510081737_139.0.40_g465474a_chromium-139.0.7258.139 + 1.26.0.202510161627_139.0.40_g465474a_chromium-139.0.7258.139 name dullahan description @@ -595,36 +597,6 @@ description Expat is an XML parser library written in C - fontconfig - - platforms - - linux64 - - archive - - hash - e2419d56960c160670051fbb055fb729 - url - http://automated-builds-secondlife-com.s3.amazonaws.com/hg/repo/p64_3p-fontconfig/rev/314281/arch/Linux/installer/fontconfig-2.11.0-linux64-314281.tar.bz2 - - name - linux64 - - - license - bsd - license_file - LICENSES/fontconfig.txt - copyright - Copyright (C) 2000,2001,2002,2003,2004,2006,2007 Keith Packard, 2005 Patrick Lam, 2009 Roozbeh Pournader, 2008,2009 Red Hat, Inc., 2008 Danilo Šegan, 2012 Google, Inc. - version - 2.11.0 - name - fontconfig - description - Fontconfig is a library for configuring and customizing font access. - freetype platforms @@ -694,11 +666,11 @@ archive hash - 7cc58b3acb230a7e65ea5f0ff800be393eb4aa1b + 90eade4785ee8acf18837125208b717f7e857d06 hash_algorithm sha1 url - https://github.com/secondlife/3p-glext/releases/download/v69/glext-68-common-685b36e.tar.zst + https://github.com/secondlife/3p-glext/releases/download/v2025.10.27-r1/glext-2025.10.27-common-18888617188.tar.zst name common @@ -711,44 +683,12 @@ copyright Copyright (c) 2007-2010 The Khronos Group Inc. version - 68 + 2025.10.27 name glext description glext headers define function prototypes and constants for OpenGL extensions - glh_linear - - platforms - - common - - archive - - hash - 066625e7aa7f697a4b6cd461aad960c57181011f - hash_algorithm - sha1 - url - https://github.com/secondlife/3p-glh_linear/releases/download/v1.0.1-dev4-984c397/glh_linear-1.0.1-dev4-common-984c397.tar.zst - - name - common - - - license - BSD - license_file - LICENSES/glh-linear.txt - copyright - Copyright (c) 2000 Cass Everitt - version - 1.0.1-dev4 - name - glh_linear - description - glh - is a platform-indepenedent C++ OpenGL helper library - glm platforms @@ -791,62 +731,6 @@ source_type git - gstreamer - - platforms - - linux64 - - archive - - hash - 7c9d7cc88add7831a6afeedc20cad2fe - url - http://automated-builds-secondlife-com.s3.amazonaws.com/hg/repo/p64_3p-gstreamer/rev/314267/arch/Linux/installer/gstreamer-0.10.6.314267-linux64-314267.tar.bz2 - - name - linux64 - - - license - LGPL - license_file - LICENSES/gstreamer.txt - copyright - Copyright (C) 2007 Free Software Foundation, Inc. <http://fsf.org/> - version - 0.10.6.314267 - name - gstreamer - - gtk-atk-pango-glib - - platforms - - linux64 - - archive - - hash - de7bba8fd2275a11b077b124413065d0 - url - http://automated-builds-secondlife-com.s3.amazonaws.com/hg/repo/p64_3p-gtk-atk-pango-glib/rev/314220/arch/Linux/installer/gtk_atk_pango_glib-0.1-linux64-314220.tar.bz2 - - name - linux64 - - - license - lgpl - license_file - LICENSES/gtk-atk-pango-glib.txt - copyright - Copyright (various, see sources) - version - 0.1 - name - gtk-atk-pango-glib - havok-source platforms @@ -858,11 +742,11 @@ creds github hash - ae2c2a215b1bc2e3f37a67e301926dc405902d1a + 1648aeb68395cba38f9326c671609d6730cbcc28 hash_algorithm sha1 url - https://api.github.com/repos/secondlife/3p-havok-source/releases/assets/136778143 + https://api.github.com/repos/secondlife/3p-havok-source/releases/assets/196725921 name darwin64 @@ -871,10 +755,14 @@ archive + creds + github hash - 00d0333936a67059a43a6ec8ac38d564 + 702ad28b6dbace2a68260d69f6d1768d163b5a6f + hash_algorithm + sha1 url - http://s3-proxy.lindenlab.com/private-builds-secondlife-com/ct2/748/1563/havok_source-2012.1-2-linux64-500739.tar.bz2 + https://api.github.com/repos/secondlife/3p-havok-source/releases/assets/196725902 name linux64 @@ -886,11 +774,11 @@ creds github hash - 0393dd75c58f7046bed47e62a8884a78cb02a5c3 + ea980f372981fe7685f91a111da2785825d473ed hash_algorithm sha1 url - https://api.github.com/repos/secondlife/3p-havok-source/releases/assets/136778145 + https://api.github.com/repos/secondlife/3p-havok-source/releases/assets/196725911 name windows64 @@ -1081,22 +969,6 @@ name windows64 - linux - - archive - - creds - github - hash - 85e294becce8b2ac5d2e5e052b0e21ff865d1108 - hash_algorithm - sha1 - url - https://api.github.com/repos/secondlife/3p-kdu/releases/assets/208381806 - - name - linux - license Kakadu @@ -1277,36 +1149,6 @@ description PNG Reference library - libuuid - - platforms - - linux64 - - archive - - hash - fb89f1281dd54d8b99b339fc5b712b27 - url - http://automated-builds-secondlife-com.s3.amazonaws.com/hg/repo/p64_3p-libuuid/rev/314269/arch/Linux/installer/libuuid-1.6.2-linux64-314269.tar.bz2 - - name - linux64 - - - license - UUID - license_file - LICENSES/uuid.txt - copyright - Copyright (c) 2004-2008 The OSSP Project <http://www.ossp.org/> - version - 1.6.2 - name - libuuid - description - OSSP uuid is a ISO-C:1999 application programming interface (API) and corresponding command line interface (CLI) for the generation of DCE 1.1, ISO/IEC 11578:1996 and RFC 4122 compliant Universally Unique Identifier (UUID). - libxml2 platforms @@ -1367,36 +1209,6 @@ description Libxml2 is the XML C parser and toolkit developed for the Gnome project. - llappearance_utility - - platforms - - linux - - archive - - hash - fddd634dec5ec03924d62cc774f7f8ea - url - http://s3-proxy.lindenlab.com/private-builds-secondlife-com/hg/repo/p64_viewer-llappearance-utility/rev/317266/arch/Linux/installer/llappearance_utility-0.0.1-linux-317266.tar.bz2 - - name - linux - - - license - Proprietary - license_file - LICENSES/llappearanceutility.txt - copyright - Copyright (c) 2000-2012, Linden Research, Inc. - version - 0.0.1 - name - llappearance_utility - description - Linden Lab appearance utility for server-side avatar baking services. - llca platforms @@ -1512,32 +1324,6 @@ name llphysicsextensions_tpv - mesa - - platforms - - linux - - archive - - hash - 22c50a5d362cad311b4f413cfcffbba2 - url - http://automated-builds-secondlife-com.s3.amazonaws.com/hg/repo/mesa_3p-update-mesa/rev/297294/arch/Linux/installer/mesa-7.11.1.297294-linux-297294.tar.bz2 - - name - linux - - - license - mesa - license_file - LICENSES/mesa.txt - version - 7.11.1.297294 - name - mesa - meshoptimizer platforms @@ -1937,6 +1723,23 @@ Copyright (c) 2012, 2014, 2015, 2016 nghttp2 contributors open-libndofdev + platforms + + linux64 + + archive + + hash + 612bfcb7cf0e6afaf7ce7f1db6feccd81137eb99 + hash_algorithm + sha1 + url + https://github.com/secondlife/3p-open-libndofdev/releases/download/v1.14-r7/open_libndofdev-0.14.19022717849-linux64-19022717849.tar.zst + + name + linux64 + + license BSD license_file @@ -1944,7 +1747,7 @@ Copyright (c) 2012, 2014, 2015, 2016 nghttp2 contributors copyright Copyright (c) 2008, Jan Ciger (jan.ciger (at) gmail.com) version - 0.14.11968684513 + 0.14.19022717849 name open-libndofdev description @@ -2019,11 +1822,11 @@ Copyright (c) 2012, 2014, 2015, 2016 nghttp2 contributors archive hash - 94a72c6ddbfb23796ce913c55bc47c128542a582 + 8dc190451c5b7af0d72e7ab54f8fbde6dccf79c6 hash_algorithm sha1 url - https://github.com/secondlife/3p-openjpeg/releases/download/v2.5.3-r1/openjpeg-2.5.3.15590356935-darwin64-15590356935.tar.zst + https://github.com/secondlife/3p-openjpeg/releases/download/v2.5.4-r1/openjpeg-2.5.4.18754730947-darwin64-18754730947.tar.zst name darwin64 @@ -2033,11 +1836,11 @@ Copyright (c) 2012, 2014, 2015, 2016 nghttp2 contributors archive hash - 751172af405f4a47a3aebb37729d62229cab6c07 + 9c89879f81ee0434e1f59c47d74a25958ae08e9e hash_algorithm sha1 url - https://github.com/secondlife/3p-openjpeg/releases/download/v2.5.3-r1/openjpeg-2.5.3.15590356935-linux64-15590356935.tar.zst + https://github.com/secondlife/3p-openjpeg/releases/download/v2.5.4-r1/openjpeg-2.5.4.18754730947-linux64-18754730947.tar.zst name linux64 @@ -2047,11 +1850,11 @@ Copyright (c) 2012, 2014, 2015, 2016 nghttp2 contributors archive hash - 8aab9cf250dfee252386e1c79b5205e6d3b3e19e + b78887212f18ae59dc7961e0e1af781e568bd92c hash_algorithm sha1 url - https://github.com/secondlife/3p-openjpeg/releases/download/v2.5.3-r1/openjpeg-2.5.3.15590356935-windows64-15590356935.tar.zst + https://github.com/secondlife/3p-openjpeg/releases/download/v2.5.4-r1/openjpeg-2.5.4.18754730947-windows64-18754730947.tar.zst name windows64 @@ -2064,7 +1867,7 @@ Copyright (c) 2012, 2014, 2015, 2016 nghttp2 contributors copyright Copyright (c) 2002-2007, Communications and Remote Sensing Laboratory, Universite catholique de Louvain (UCL), Belgium; Copyright (c) 2002-2007, Professor Benoit Macq; Copyright (c) 2001-2003, David Janssens; Copyright (c) 2002-2003, Yannick Verschueren; Copyright (c) 2003-2007, Francois-Olivier Devaux and Antonin Descampe; Copyright (c) 2005, Herve Drolon, FreeImage Team; Copyright (c) 2006-2007, Parvatha Elangovan; Copyright (c) 2008, Jerome Fimes, Communications & Systemes <jerome.fimes@c-s.fr>; Copyright (c) 2010-2011, Kaori Hagihara; Copyright (c) 2011-2012, Centre National d'Etudes Spatiales (CNES), France; Copyright (c) 2012, CS Systemes d'Information, France; version - 2.5.3.15590356935 + 2.5.4.18754730947 name openjpeg description @@ -2542,7 +2345,7 @@ Copyright (c) 2012, 2014, 2015, 2016 nghttp2 contributors description Linden Lab Viewer Management Process suite. source - https://bitbucket.org/lindenlab/vmp-standalone + https://github.com/secondlife/viewer-manager source_type hg @@ -2633,11 +2436,11 @@ Copyright (c) 2012, 2014, 2015, 2016 nghttp2 contributors archive hash - 43c5f93517794aeade550e4266b959d1f0cfcb7f + a5e72a9d13b6c4646d1e02b5820f16560d204de7 hash_algorithm sha1 url - https://github.com/secondlife/3p-webrtc-build/releases/download/m137.7151.04.20-universal/webrtc-m137.7151.04.20-universal.17630578914-darwin64-17630578914.tar.zst + https://github.com/secondlife/3p-webrtc-build/releases/download/m137.7151.04.21/webrtc-m137.7151.04.21.18609120431-darwin64-18609120431.tar.zst name darwin64 @@ -2647,11 +2450,11 @@ Copyright (c) 2012, 2014, 2015, 2016 nghttp2 contributors archive hash - efc5b176d878cfc16b8f82445d82ddb96815b6ab + 1030e5086f401d738463223da3ed99c225340f39 hash_algorithm sha1 url - https://github.com/secondlife/3p-webrtc-build/releases/download/m137.7151.04.20-universal/webrtc-m137.7151.04.20-universal.17630578914-linux64-17630578914.tar.zst + https://github.com/secondlife/3p-webrtc-build/releases/download/m137.7151.04.21/webrtc-m137.7151.04.21.18609120431-linux64-18609120431.tar.zst name linux64 @@ -2661,11 +2464,11 @@ Copyright (c) 2012, 2014, 2015, 2016 nghttp2 contributors archive hash - 1e36f100de32c7c71325497a672fb1659b3f206d + d1cae9bc8866ca01aa9f5e72b36d12ef608b1998 hash_algorithm sha1 url - https://github.com/secondlife/3p-webrtc-build/releases/download/m137.7151.04.20-universal/webrtc-m137.7151.04.20-universal.17630578914-windows64-17630578914.tar.zst + https://github.com/secondlife/3p-webrtc-build/releases/download/m137.7151.04.21/webrtc-m137.7151.04.21.18609120431-windows64-18609120431.tar.zst name windows64 @@ -2678,7 +2481,7 @@ Copyright (c) 2012, 2014, 2015, 2016 nghttp2 contributors copyright Copyright (c) 2011, The WebRTC project authors. All rights reserved. version - m137.7151.04.20-universal.17630578914 + m137.7151.04.21.18609120431 name webrtc vcs_branch @@ -2891,11 +2694,11 @@ Copyright (c) 2012, 2014, 2015, 2016 nghttp2 contributors archive hash - 140d8fc952a10edb5f2d72ab405336019ef32cadfa64f0cfce76c9de4bc6268cbc87cc8cd89d3417fb78b531d441701afc8d016bafe4bd275df2707f7daf1387 + 49046b0b41310d2fb0d72853730b2faad35d3e36 hash_algorithm - blake2b + sha1 url - https://github.com/AlchemyViewer/3p-vhacd/releases/download/v4.1.0-r2/vhacd-4.1.0-r2-common-18166921729.tar.zst + https://github.com/secondlife/3p-vhacd/releases/download/v4.1.0-r1/vhacd-4.1.0-r1-common-18475951995.tar.zst name common @@ -2908,12 +2711,52 @@ Copyright (c) 2012, 2014, 2015, 2016 nghttp2 contributors copyright Copyright (c) 2011, Khaled Mamou version - 4.1.0-r2 + 4.1.0-r1 name vhacd description Voxelized Hierarchical Approximate Convex Decomposition + websocketpp + + platforms + + common + + archive + + hash + a69aa37bfbcb934974f7af906f6dc6b044692f07 + hash_algorithm + sha1 + url + https://github.com/secondlife/3p-websocketpp/releases/download/v0.8.2-r2/websocketpp-0.8.2.19586590594-common-19586590594.tar.zst + + name + common + + + license + websocketpp + license_file + LICENSES/websocketpp.txt + copyright + Copyright (c) 2014, Peter Thorson + version + 0.8.2.19586590594 + name + websocketpp + vcs_branch + refs/tags/v0.8.2 + vcs_revision + bdcf1453101976fc4dc26a62c87bc98c12e9c6dc + vcs_url + git://github.com/secondlife/3p-websocketpp.git + canonical_repo + https://github.com/secondlife/3p-websocketpp + description + WebSocket++ is a C++ header only library for interacting with WebSocket servers and clients. + package_description @@ -3143,15 +2986,14 @@ Copyright (c) 2012, 2014, 2015, 2016 nghttp2 contributors configurations - Release + RelWithDebInfo configure options -G - Ninja - -DLL_TESTS=Off + Unix Makefiles arguments @@ -3161,14 +3003,23 @@ Copyright (c) 2012, 2014, 2015, 2016 nghttp2 contributors build command - ninja + cmake + options + + --build + . + --config + Release + --parallel + $AUTOBUILD_CPU_COUNT + default True name - Release + RelWithDebInfo - ReleaseOS + RelWithDebInfoOS configure @@ -3176,24 +3027,82 @@ Copyright (c) 2012, 2014, 2015, 2016 nghttp2 contributors -G Ninja - -DLL_TESTS=Off build command - ninja + cmake + options + + --build + . + --config + Release + --parallel + $AUTOBUILD_CPU_COUNT + name - ReleaseOS + RelWithDebInfoOS - default + Release + configure + + options + + -G + Unix Makefiles + + arguments + + ../indra + + build + command + cmake + options + + --build + . + --config + Release + --parallel + $AUTOBUILD_CPU_COUNT + + + name + Release + + ReleaseOS + + configure + + options + + -G + Ninja + + + build + + command + cmake + options + + --build + . + --config + Release + --parallel + $AUTOBUILD_CPU_COUNT + name - default + ReleaseOS build_directory @@ -3224,15 +3133,15 @@ Copyright (c) 2012, 2014, 2015, 2016 nghttp2 contributors build command - devenv + cmake options - /build - RelWithDebInfo|${AUTOBUILD_WIN_VSPLATFORM|NOTWIN} - - arguments - - SecondLife.sln + --build + . + --config + RelWithDebInfo + --parallel + $AUTOBUILD_CPU_COUNT default @@ -3262,19 +3171,15 @@ Copyright (c) 2012, 2014, 2015, 2016 nghttp2 contributors build command - msbuild.exe + cmake options - /p:Configuration=RelWithDebInfo - /p:Platform=${AUTOBUILD_WIN_VSPLATFORM|NOTWIN} - /t:Build - /p:useenv=true - /verbosity:minimal - /p:VCBuildAdditionalOptions= /incremental - - arguments - - SecondLife.sln + --build + . + --config + RelWithDebInfo + --parallel + $AUTOBUILD_CPU_COUNT name @@ -3299,15 +3204,15 @@ Copyright (c) 2012, 2014, 2015, 2016 nghttp2 contributors build command - devenv + cmake options - /build - Release|${AUTOBUILD_WIN_VSPLATFORM|NOTWIN} - - arguments - - SecondLife.sln + --build + . + --config + Release + --parallel + $AUTOBUILD_CPU_COUNT name @@ -3336,19 +3241,15 @@ Copyright (c) 2012, 2014, 2015, 2016 nghttp2 contributors build command - msbuild.exe + cmake options - /p:Configuration=Release - /p:Platform=${AUTOBUILD_WIN_VSPLATFORM|NOTWIN} - /t:Build - /p:useenv=true - /verbosity:minimal - /p:VCBuildAdditionalOptions= /incremental - - arguments - - SecondLife.sln + --build + . + --config + Release + --parallel + $AUTOBUILD_CPU_COUNT name diff --git a/build.sh b/build.sh index ba900658276..31604663f1d 100755 --- a/build.sh +++ b/build.sh @@ -45,7 +45,7 @@ build_dir_Darwin() build_dir_Linux() { - echo build-linux-i686 + echo build-linux-x86_64 } build_dir_CYGWIN() @@ -119,11 +119,13 @@ EOF=$(dd if=/dev/urandom bs=15 count=1 status=none | base64) metadata=() symbolfile=() physicstpv=() +appearanceutility=() # and dump them to GITHUB_OUTPUT when done cleanup="$cleanup ; \ arrayoutput metadata ; \ arrayoutput symbolfile ; \ -arrayoutput physicstpv" +arrayoutput physicstpv ; \ +arrayoutput appearanceutility" trap "$cleanup" EXIT arrayoutput() @@ -163,6 +165,12 @@ pre_build() fi fi + if [[ "$arch" == "Linux" ]] + then + # RELEASE_CRASH_REPORTING is tuned on unconditionaly, this is fine but not for Linux as of now (due to missing breakpad/crashpad support) + RELEASE_CRASH_REPORTING=OFF + fi + if [ "${RELEASE_CRASH_REPORTING:-}" != "OFF" ] then case "$arch" in @@ -246,6 +254,10 @@ build() "$autobuild" build --no-configure -c $variant \ $eval_autobuild_build_parameters \ || fatal "failed building $variant" + + ctest -C Release --test-dir "${build_dir}" --output-on-failure -j $(nproc --all) \ + || fatal "failed testing $variant" + echo true >"$build_dir"/build_ok end_section "autobuild $variant" @@ -394,12 +406,7 @@ do python_cmd "$helpers/codeticket.py" addoutput "Autobuild Metadata" "$build_dir/autobuild-package.xml" --mimetype text/xml \ || fatal "Upload of autobuild metadata failed" metadata+=("$build_dir/autobuild-package.xml") - if [ "$arch" != "Linux" ] - then - record_dependencies_graph "$build_dir/autobuild-package.xml" # defined in buildscripts/hg/bin/build.sh - else - record_event "TBD - no dependency graph for linux (probable python version dependency)" - fi + record_dependencies_graph "$build_dir/autobuild-package.xml" # defined in buildscripts/hg/bin/build.sh end_section "Autobuild metadata" else record_event "no autobuild metadata at '$build_dir/autobuild-package.xml'" @@ -537,6 +544,14 @@ then symbolfile+=("$symbol_file") fi + # Upload our apperance utility packages for linux + if [ "$arch" == "Linux" ] + then + appearance_utility_dir="${build_dir}/llappearanceutility" + appearanceutility+=("${appearance_utility_dir}/appearance-utility-bin") + appearanceutility+=("${appearance_utility_dir}/appearance-utility-headless-bin") + fi + # Upload the llphysicsextensions_tpv package, if one was produced # Only upload this package when building the private repo so the # artifact is private. diff --git a/doc/BUILD.LINUX.md b/doc/BUILD.LINUX.md new file mode 100644 index 00000000000..28c0689cd56 --- /dev/null +++ b/doc/BUILD.LINUX.md @@ -0,0 +1,79 @@ +# Building on Linux + +## Install Dependencies + +### AlmaLinux 10 +``` +sudo dnf group install "Development Tools" +sudo dnf install cmake fontconfig-devel git glib2-devel gstreamer1-devel gstreamer1-plugins-base-devel libX11-devel mesa-libOSMesa-devel libglvnd-devel ninja-build python3 vlc-devel wayland-devel +``` +> [!NOTE] +> You may need to enable the EPEL repository for some packages `sudo dnf install epel-release` + +### Arch +``` +sudo pacman -Syu base-devel cmake fontconfig git glib2-devel gstreamer gst-plugins-base-libs ninja libglvnd libvlc libx11 python wayland +``` + +### Debian - Ubuntu 22.04 - Ubuntu 24.04 +``` +sudo apt install build-essential cmake git libfontconfig-dev libglib2.0-dev libglvnd-dev libgstreamer1.0-dev libgstreamer-plugins-base1.0-dev libosmesa6-dev libvlc-dev libwayland-dev libx11-dev ninja-build python3 python3-venv +``` + +### Fedora +``` +sudo dnf install @development-tools @c-development cmake fontconfig-devel git glib-devel gstreamer1-devel gstreamer1-plugins-base-devel libX11-devel mesa-compat-libOSMesa-devel libglvnd-devel ninja-build python3 vlc-devel wayland-devel +``` + +### OpenSUSE Tumbleweed +``` +sudo zypper in -t pattern devel_basis devel_C_C++ +sudo zypper install cmake fontconfig-devel git glib2-devel gstreamer-devel gstreamer-plugins-base-devel libglvnd-devel libX11-devel ninja Mesa-libGL-devel python3 vlc-devel wayland-devel +``` + +## Create development folders +``` +mkdir -p ~/code/secondlife +cd ~/code/secondlife +``` + +## Setup Virtual Environment and install Autobuild +``` +python3 -m venv .venv +source .venv/bin/activate +pip install autobuild llsd +``` +> [!NOTE] +> If the above was successful you should receive output similar to `autobuild 3.10.2` when running `autobuild --version` + +## Setup Build Variables +``` +git clone https://github.com/secondlife/build-variables.git +export AUTOBUILD_VARIABLES_FILE=~/code/secondlife/build-variables/variables +``` + +## Clone Viewer +``` +git clone https://github.com/secondlife/viewer.git +cd ~/code/secondlife/viewer +``` + +## Configure Viewer + +### GCC +``` +autobuild configure -c ReleaseOS -A64 +``` + +### Clang +``` +autobuild configure -c ReleaseOS -- -DCMAKE_C_COMPILER=clang -DCMAKE_CXX_COMPILER=clang++ -DCMAKE_LINKER_TYPE=LLD +``` + +## Build Viewer +``` +autobuild build -c ReleaseOS --no-configure +``` + +> [!NOTE] +> If the above was successful you should find the viewer package in `viewer/build-linux-x86_64/newview` diff --git a/doc/external-editor-json-rpc.md b/doc/external-editor-json-rpc.md new file mode 100644 index 00000000000..b8c7fa69e32 --- /dev/null +++ b/doc/external-editor-json-rpc.md @@ -0,0 +1,464 @@ +# Viewer to External Editor JSON-RPC
Message Interfaces Documentation + +This document describes all the message interfaces defined in for WebSocket communication between the Second Life viewer and an external editor such as a VSCode extension. + +## Table of Contents + +- [Usage Flow](#usage-flow) +- [JSON-RPC Method Summary](#json-rpc-method-summary) +- [Session Management Interfaces](#session-management-interfaces) + - [SessionHandshake](#sessionhandshake) + - [SessionHandshakeResponse](#sessionhandshakeresponse) + - [Session OK](#session-ok) + - [SessionDisconnect](#sessiondisconnect) +- [Language and Syntax Interfaces](#language-and-syntax-interfaces) + - [SyntaxChange](#syntaxchange) + - [Language Syntax ID Request](#language-syntax-id-request) + - [Language Syntax Request](#language-syntax-request) +- [Script Subscription Interfaces](#script-subscription-interfaces) + - [ScriptSubscribe](#scriptsubscribe) + - [ScriptSubscribeResponse](#scriptsubscriberesponse) + - [ScriptUnsubscribe](#scriptunsubscribe) +- [Compilation Interfaces](#compilation-interfaces) + - [CompilationError](#compilationerror) + - [CompilationResult](#compilationresult) +- [Runtime Event Interfaces](#runtime-event-interfaces) + - [RuntimeDebug](#runtimedebug) + - [RuntimeError](#runtimeerror) +- [Handler and Configuration Interfaces](#handler-and-configuration-interfaces) + - [WebSocketHandlers](#websockethandlers) + - [ClientInfo](#clientinfo) + +## Usage Flow + +1. **Connection Establishment:** + + - Viewer sends `session.handshake` notification with `SessionHandshake` data + - Extension responds with `SessionHandshakeResponse` + - Viewer confirms with `session.ok` notification + +2. **Language Information Exchange:** + + - Extension makes `language.syntax.id` call to get current syntax version + - Extension makes `language.syntax` calls with different `kind` parameters to get specific language data + - Viewer responds with `LanguageInfo` data containing the requested information + +3. **Script Subscription Management:** + + - Extension makes `script.subscribe` call with `ScriptSubscribe` data to request live synchronization for a script + - Viewer responds with `ScriptSubscribeResponse` indicating success or failure + - When subscription needs to be terminated, viewer sends `script.unsubscribe` notification with `ScriptUnsubscribe` data + - Extension handles unsubscription by cleaning up local script tracking + +4. **Runtime Events:** + + - Viewer sends `language.syntax.change` notification with `SyntaxChange` when language changes + - Viewer sends `script.compiled` notification with `CompilationResult` after script compilation + - Viewer sends `runtime.debug` notification with `RuntimeDebug` for debug messages during script execution + - Viewer sends `runtime.error` notification with `RuntimeError` when runtime errors occur + +5. **Connection Termination:** + - Either side can send `session.disconnect` notification with `SessionDisconnect` data + - Connection is closed gracefully + +## JSON-RPC Method Summary + +| Method | Direction | Type | Interface/Parameters | +| ------------------------------- | ------------------ | ------------ | -------------------------- | +| `session.handshake` | Viewer → Extension | Notification | `SessionHandshake` | +| `session.handshake` (response) | Extension → Viewer | Response | `SessionHandshakeResponse` | +| `session.ok` | Viewer → Extension | Notification | _(no interface)_ | +| `session.disconnect` | Bidirectional | Notification | `SessionDisconnect` | +| `script.subscribe` | Extension → Viewer | Call | `ScriptSubscribe` | +| `script.subscribe` (response) | Viewer → Extension | Response | `ScriptSubscribeResponse` | +| `script.unsubscribe` | Viewer → Extension | Notification | `ScriptUnsubscribe` | +| `language.syntax.id` | Extension → Viewer | Call | _(no parameters)_ | +| `language.syntax.id` (response) | Viewer → Extension | Response | `{ id: string }` | +| `language.syntax` | Extension → Viewer | Call | `{ kind: string }` | +| `language.syntax` (response) | Viewer → Extension | Response | `LanguageInfo` | +| `language.syntax.change` | Viewer → Extension | Notification | `SyntaxChange` | +| `script.compiled` | Viewer → Extension | Notification | `CompilationResult` | +| `runtime.debug` | Viewer → Extension | Notification | `RuntimeDebug` | +| `runtime.error` | Viewer → Extension | Notification | `RuntimeError` | + +## Session Management Interfaces + +### SessionHandshake + +**JSON-RPC Method:** `session.handshake` (notification from viewer) + +The initial handshake message sent by the viewer to establish a connection. + +```typescript +interface SessionHandshake { + server_version: "1.0.0"; + protocol_version: "1.0"; + viewer_name: string; + viewer_version: string; + agent_id: string; + agent_name: string; + challenge?: string; + languages: string[]; + syntax_id: string; + features: { [feature: string]: boolean }; +} +``` + +**Fields:** + +- `server_version`: Fixed version "1.0.0" indicating the server API version +- `protocol_version`: Fixed version "1.0" for the communication protocol +- `viewer_name`: Name of the Second Life viewer application +- `viewer_version`: Version string of the viewer +- `agent_id`: Unique identifier for the user/agent +- `agent_name`: Human-readable name of the agent +- `challenge` (optional): Security challenge string for authentication +- `languages`: Array of supported scripting languages (e.g., ["lsl", "luau"]) +- `syntax_id`: Current active syntax/language identifier +- `features`: Dictionary of feature flags indicating viewer capabilities + +### SessionHandshakeResponse + +**JSON-RPC Method:** Response to `session.handshake` + +The response sent by the VS Code extension to complete the handshake. + +```typescript +interface SessionHandshakeResponse { + client_name: string; + client_version: "1.0"; + protocol_version: string; + challenge_response?: string; + languages: string[]; + features: { [feature: string]: boolean }; +} +``` + +**Fields:** + +- `client_name`: Name of the client (VS Code extension) +- `client_version`: Fixed version "1.0" of the client +- `protocol_version`: Protocol version the client supports +- `challenge_response` (optional): Response to the security challenge if provided +- `languages`: Array of languages supported by the client +- `features`: Dictionary of features supported by the client + +### Session OK + +**JSON-RPC Method:** `session.ok` (notification from viewer) + +Confirmation notification sent by the viewer after successful handshake completion. This interface has no defined structure as it appears to be a simple confirmation message. + +### SessionDisconnect + +**JSON-RPC Method:** `session.disconnect` (notification, bidirectional) + +Message sent when terminating the connection. + +```typescript +interface SessionDisconnect { + reason: number; + message: string; +} +``` + +**Fields:** + +- `reason`: Numeric code indicating the reason for disconnection +- `message`: Human-readable description of the disconnect reason + +## Language and Syntax Interfaces + +### SyntaxChange + +**JSON-RPC Method:** `language.syntax.change` (notification from viewer) + +Notification sent when the active language syntax changes in the viewer. + +```typescript +interface SyntaxChange { + id: string; +} +``` + +**Fields:** + +- `id`: Identifier for the new syntax/language + +### Language Syntax ID Request + +**JSON-RPC Method:** `language.syntax.id` (call from extension to viewer) + +Requests the current active language syntax identifier from the viewer. This method takes no parameters. + +**Response:** Returns an object with an `id` field containing the current syntax identifier. + +### Language Syntax Request + +**JSON-RPC Method:** `language.syntax` (call from extension to viewer) + +Requests detailed syntax information for a specific language kind. + +**Parameters:** + +```typescript +{ + kind: string; // The type of syntax information requested +} +``` + +**Fields:** + +- `kind`: The type of syntax information to retrieve (e.g., "functions", "constants", "events", "types.luau") + +**Response:** Returns `LanguageInfo` data containing the requested syntax information: + +```typescript +interface LanguageInfo { + id: string; + lslDefs?: { + controls?: any; + types?: any; + constants?: { [name: string]: ConstantDef }; + events?: { [name: string]: FunctionDef }; + functions?: { [name: string]: FunctionDef }; + }; + luaDefs?: { + modules?: { [name: string]: TypeDef }; + classes?: { [name: string]: TypeDef }; + aliases?: { [name: string]: TypeDef }; + functions?: { [name: string]: FunctionDef }; + }; +} +``` + +**Response Fields:** + +- `id`: Version identifier for the language syntax +- `lslDefs` (optional): LSL-specific language definitions containing: + - `controls` (optional): Control flow and language constructs + - `types` (optional): LSL type definitions + - `constants` (optional): Object containing constant definitions keyed by constant name + - `events` (optional): Object containing event definitions keyed by event name + - `functions` (optional): Object containing function definitions keyed by function name +- `luaDefs` (optional): Lua-specific language definitions containing: + - `modules` (optional): Module type definitions keyed by module name + - `classes` (optional): Class type definitions keyed by class name + - `aliases` (optional): Type alias definitions keyed by alias name + - `functions` (optional): Function definitions keyed by function name + +The specific sections returned depend on the `kind` parameter and the active language context. + +## Script Subscription Interfaces + +### ScriptSubscribe + +**JSON-RPC Method:** `script.subscribe` (call from extension to viewer) + +Requests subscription to a script for live synchronization between the editor and viewer. + +```typescript +interface ScriptSubscribe { + script_id: string; + script_name: string; + script_language: string; +} +``` + +**Fields:** + +- `script_id`: Unique identifier for the script to subscribe to +- `script_name`: Display name of the script file +- `script_language`: Programming language of the script (e.g., "lsl", "luau") + +### ScriptSubscribeResponse + +**JSON-RPC Method:** Response to `script.subscribe` + +Response from the viewer indicating whether script subscription was successful. + +```typescript +interface ScriptSubscribeResponse { + script_id: string; + success: boolean; + status: number; + object_id?: string; + object_name?: string; + item_id?: string; + message?: string; +} +``` + +**Fields:** + +- `script_id`: The script identifier that was subscribed to +- `success`: Whether the subscription was successful +- `status`: Numeric status code indicating the result +- `object_id` (optional): The in-world ID of the object containing the script +- `object_name` (optional): The name of the object containing the script. +- `message` (optional): Additional information about the subscription result + +### ScriptUnsubscribe + +**JSON-RPC Method:** `script.unsubscribe` (notification from viewer) + +Notification sent by the viewer when a script subscription should be terminated. + +```typescript +interface ScriptUnsubscribe { + script_id: string; +} +``` + +**Fields:** + +- `script_id`: Unique identifier for the script to unsubscribe from + +## Compilation Interfaces + +### CompilationError + +Individual compilation error record. + +```typescript +interface CompilationError { + row: number; + column: number; + level: "ERROR"; + message: string; +} +``` + +**Fields:** + +- `row`: Line number where the error occurred (0-based or 1-based depending on context) +- `column`: Column position of the error +- `level`: Severity level (currently only "ERROR" is defined) +- `message`: Error description + +### CompilationResult + +**JSON-RPC Method:** `script.compiled` (notification from viewer) + +Result of a compilation operation in the viewer. + +```typescript +interface CompilationResult { + script_id: string; + success: boolean; + running: boolean; + errors?: CompilationError[]; +} +``` + +**Fields:** + +- `script_id`: Unique identifier for the script that was compiled +- `success`: Whether the compilation was successful +- `running`: Whether the compiled script is currently running +- `errors` (optional): Array of compilation errors if any occurred + +## Runtime Event Interfaces + +### RuntimeDebug + +**JSON-RPC Method:** `runtime.debug` (notification from viewer) + +Debug message notification sent by the viewer during script execution. + +```typescript +interface RuntimeDebug { + script_id: string; + object_id: string; + object_name: string; + message: string; +} +``` + +**Fields:** + +- `script_id`: Unique identifier for the script generating the debug message +- `object_id`: Unique identifier for the object containing the script +- `object_name`: Human-readable name of the object +- `message`: The debug message content + +### RuntimeError + +**JSON-RPC Method:** `runtime.error` (notification from viewer) + +Runtime error notification sent by the viewer when a script encounters an error during execution. + +```typescript +interface RuntimeError { + script_id: string; + object_id: string; + object_name: string; + message: string; + error: string; + line: number; + stack?: string[]; +} +``` + +**Fields:** + +- `script_id`: Unique identifier for the script that encountered the error +- `object_id`: Unique identifier for the object containing the script +- `object_name`: Human-readable name of the object +- `message`: Error message description +- `error`: Specific error type or code +- `line`: Line number where the error occurred +- `stack` (optional): Stack trace information if available + +## Handler and Configuration Interfaces + +### WebSocketHandlers + +Event handler interface for WebSocket events. + +```typescript +interface WebSocketHandlers { + onHandshake?: (message: SessionHandshake) => SessionHandshakeResponse; + onHandshakeOk?: () => void; + onDisconnect?: (message: SessionDisconnect) => void; + onSubscribe?: (message: ScriptSubscribe) => ScriptSubscribeResponse; + onUnsubscribe?: (message: ScriptUnsubscribe) => void; + onSyntaxChange?: (message: SyntaxChange) => void; + onConnectionClosed?: () => void; + onCompilationResult?: (message: CompilationResult) => void; + onRuntimeDebug?: (message: RuntimeDebug) => void; + onRuntimeError?: (message: RuntimeError) => void; +} +``` + +**Methods:** + +- `onHandshake`: Handler for initial handshake message, returns handshake response +- `onHandshakeOk`: Handler called when handshake is successfully completed +- `onDisconnect`: Handler for disconnect notifications +- `onSubscribe`: Handler for script subscription requests from viewer, returns subscription response +- `onUnsubscribe`: Handler for script unsubscription notifications from viewer +- `onSyntaxChange`: Handler for syntax change notifications +- `onConnectionClosed`: Handler called when connection is closed +- `onCompilationResult`: Handler for compilation result notifications +- `onRuntimeDebug`: Handler for runtime debug message notifications +- `onRuntimeError`: Handler for runtime error notifications + +### ClientInfo + +Client information used in handshake responses. + +```typescript +interface ClientInfo { + scriptName: string; + scriptId: string; + extension: string; +} +``` + +**Fields:** + +- `scriptName`: Name of the script being edited +- `scriptId`: Unique identifier for the script +- `extension`: File extension or script type + diff --git a/indra/CMakeLists.txt b/indra/CMakeLists.txt index 8fde58fa43c..61a2916bdb5 100644 --- a/indra/CMakeLists.txt +++ b/indra/CMakeLists.txt @@ -56,8 +56,37 @@ if (NOT CMAKE_BUILD_TYPE) "Build type. One of: Debug Release RelWithDebInfo" FORCE) endif (NOT CMAKE_BUILD_TYPE) +if (LL_TESTS) + set(CMAKE_SKIP_TEST_ALL_DEPENDENCY FALSE) + include(ProcessorCount) + ProcessorCount(NUM_CORES) + + # Set parallel level to decrease test runtime + set(CMAKE_CTEST_ARGUMENTS -j${NUM_CORES} --output-on-failure) + + # Set up our test targets + set(CTEST_TEST_TARGET_ALIAS BUILD_AND_RUN_TESTS) + include(CTest) + + set_target_properties(BUILD_AND_RUN_TESTS + PROPERTIES + FOLDER "CMakePredefinedTargets" + ) + + add_custom_target(BUILD_TESTS) + add_dependencies(BUILD_AND_RUN_TESTS BUILD_TESTS) + + set_target_properties(BUILD_TESTS + PROPERTIES + FOLDER "CMakePredefinedTargets" + ) +endif () + add_subdirectory(cmake) +if (USE_PRECOMPILED_HEADERS) + add_subdirectory(${LIBS_OPEN_PREFIX}llprecompiled) +endif () add_subdirectory(${LIBS_OPEN_PREFIX}llaudio) add_subdirectory(${LIBS_OPEN_PREFIX}llappearance) add_subdirectory(${LIBS_OPEN_PREFIX}llcharacter) @@ -84,10 +113,6 @@ endif (WINDOWS AND EXISTS ${LIBS_CLOSED_DIR}copy_win_scripts) add_custom_target(viewer) -if (NOT USE_BUGSPLAT) -add_subdirectory(${LIBS_OPEN_PREFIX}llcrashlogger) -endif (NOT USE_BUGSPLAT) - add_subdirectory(${LIBS_OPEN_PREFIX}llplugin) add_subdirectory(${LIBS_OPEN_PREFIX}llui) add_subdirectory(${LIBS_OPEN_PREFIX}viewer_components) @@ -103,16 +128,8 @@ add_subdirectory(${LIBS_OPEN_PREFIX}media_plugins) endif (ENABLE_MEDIA_PLUGINS) if (LINUX) - if (INSTALL_PROPRIETARY) - include(LLAppearanceUtility) - add_subdirectory(${LLAPPEARANCEUTILITY_SRC_DIR} ${LLAPPEARANCEUTILITY_BIN_DIR}) - endif (INSTALL_PROPRIETARY) -elseif (WINDOWS) - # cmake EXISTS requires an absolute path, see indra/cmake/Variables.cmake - if (EXISTS ${VIEWER_DIR}win_setup) - add_subdirectory(${VIEWER_DIR}win_setup) - endif (EXISTS ${VIEWER_DIR}win_setup) -endif (LINUX) + add_subdirectory(llappearanceutility) +endif() if (WINDOWS) # cmake EXISTS requires an absolute path, see indra/cmake/Variables.cmake diff --git a/indra/cmake/00-COMPILE-LINK-RUN.txt b/indra/cmake/00-COMPILE-LINK-RUN.txt index 1933072a6d3..7b91b5a0d4c 100644 --- a/indra/cmake/00-COMPILE-LINK-RUN.txt +++ b/indra/cmake/00-COMPILE-LINK-RUN.txt @@ -117,7 +117,7 @@ Compilation currently being generated with a link path of '@executable_path/../Resources/'. If we were to follow the recommendations in dyld's man page, we’d instead reference - '@loader_path/', use -rpath on the executable link + '@loader_path/', use -rpath on the executable link (pointing to the 'Resources' subdir of the main executable), and be able to avoid some symlinking in the .app tree. @@ -162,7 +162,7 @@ Linking * Update the autobuild.xml of ALL consumers of the library. In the case of zlib, that meant updating freetype, libpng, openssl, - libxml2, fontconfig, curl, Boost, SDL, llqtwebkit, google-mock and + libxml2, fontconfig, curl, Boost, SDL3, llqtwebkit, google-mock and colladadom. * Confirm by test and observation that the consumers actually use diff --git a/indra/cmake/00-Common.cmake b/indra/cmake/00-Common.cmake index 99ea22ab4b6..1ab94e13df5 100644 --- a/indra/cmake/00-Common.cmake +++ b/indra/cmake/00-Common.cmake @@ -11,13 +11,20 @@ # # Also realize that CMAKE_CXX_FLAGS may already be partially populated on # entry to this file. +# +# Additionally CMAKE_C_FLAGS is prepended to CMAKE_CXX_FLAGS_RELEASE and +# CMAKE_CXX_FLAGS_RELWITHDEBINFO which risks having flags overriden by cmake +# inserting additional options that are part of the build config type. #***************************************************************************** include_guard() include(Variables) +include(Linking) # 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}") +set(CMAKE_CXX_FLAGS_RELEASE "${CMAKE_CXX_FLAGS_RELEASE} $ENV{LL_BUILD_RELEASE}") +set(CMAKE_CXX_FLAGS_RELWITHDEBINFO "${CMAKE_CXX_FLAGS_RELWITHDEBINFO} $ENV{LL_BUILD_RELWITHDEBINFO}") + # 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 @@ -25,7 +32,7 @@ set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} $ENV{LL_BUILD}") # as well? # Portable compilation flags. -add_compile_definitions( ADDRESS_SIZE=${ADDRESS_SIZE}) +add_compile_definitions(ADDRESS_SIZE=${ADDRESS_SIZE}) # Because older versions of Boost.Bind dumped placeholders _1, _2 et al. into # the global namespace, Boost now requires either BOOST_BIND_NO_PLACEHOLDERS # to avoid that or BOOST_BIND_GLOBAL_PLACEHOLDERS to state that we require it @@ -111,7 +118,7 @@ if (WINDOWS) #ND: When using something like buildcache (https://github.com/mbitsnbites/buildcache) # to make those wrappers work /Zi must be changed to /Z7, as /Zi due to it's nature is not compatible with caching - if(${CMAKE_CXX_COMPILER_LAUNCHER} MATCHES ".*cache.*") + if (${CMAKE_CXX_COMPILER_LAUNCHER} MATCHES ".*cache.*") add_compile_options( /Z7 ) string(REPLACE "/Zi" "/Z7" CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS}") string(REPLACE "/Zi" "/Z7" CMAKE_CXX_FLAGS_RELEASE "${CMAKE_CXX_FLAGS_RELEASE}") @@ -125,9 +132,6 @@ endif (WINDOWS) if (LINUX) set(CMAKE_SKIP_RPATH TRUE) - # EXTERNAL_TOS - # force this platform to accept TOS via external browser - # LL_IGNORE_SIGCHLD # 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 @@ -135,42 +139,70 @@ if (LINUX) add_compile_definitions( _REENTRANT - _FORTIFY_SOURCE=2 - EXTERNAL_TOS APPID=secondlife LL_IGNORE_SIGCHLD ) + + option(ENABLE_ASAN "Enable Address Sanitizer" OFF) + option(ENABLE_UBSAN "Enable Undefined Behavior Sanitizer" OFF) + option(ENABLE_THREADSAN "Enable Thread Sanitizer" OFF) + if(ENABLE_ASAN OR ENABLE_UBSAN OR ENABLE_THREADSAN) + set(GCC_DISABLE_FATAL_WARNINGS ON) # Disable warnings as errors during sanitizer builds due to false positives + + add_compile_options( + -U_FORTIFY_SOURCE + -fno-omit-frame-pointer + -fno-common + -fsanitize-recover=all + ) + + # libwebrtc is incompatible with sanitizers + set(DISABLE_WEBRTC ON) + add_compile_definitions(DISABLE_WEBRTC=1) + + if(ENABLE_ASAN) + add_compile_options(-fsanitize=address) + add_link_options(-fsanitize=address) + endif() + + if(ENABLE_UBSAN) + add_compile_options(-fsanitize=undefined) + add_link_options(-fsanitize=undefined) + endif() + + if(ENABLE_THREADSAN) + add_compile_options(-fsanitize=thread) + add_link_options(-fsanitize=thread) + endif() + else() + add_compile_definitions($<$:_FORTIFY_SOURCE=2>) + endif() + add_compile_options( + $<$,$>:-fstack-protector> -fexceptions -fno-math-errno -fno-strict-aliasing -fsigned-char + -g -msse2 - -mfpmath=sse -pthread - -Wno-parentheses - -Wno-deprecated -fvisibility=hidden ) - if (ADDRESS_SIZE EQUAL 32) - add_compile_options(-march=pentium4) - endif (ADDRESS_SIZE EQUAL 32) - - # this stops us requiring a really recent glibc at runtime - 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") - - set(CMAKE_CXX_FLAGS_DEBUG "-fno-inline ${CMAKE_CXX_FLAGS_DEBUG}") + add_link_options( + "LINKER:-z,relro" + "LINKER:-z,now" + "LINKER:--build-id" + "LINKER:--as-needed" + "LINKER:--no-undefined" + ) endif (LINUX) if (DARWIN) # Use rpath loading on macos set(CMAKE_MACOSX_RPATH TRUE) - # Warnings should be fatal -- thanks, Nicky Perian, for spotting reversed default - set(CLANG_DISABLE_FATAL_WARNINGS OFF) set(CMAKE_CXX_LINK_FLAGS "-Wl,-headerpad_max_install_names,-search_paths_first") set(CMAKE_SHARED_LINKER_FLAGS "${CMAKE_CXX_LINK_FLAGS}") @@ -184,21 +216,22 @@ endif(DARWIN) if (LINUX OR DARWIN) add_compile_options(-Wall -Wno-sign-compare -Wno-trigraphs -Wno-reorder -Wno-unused-but-set-variable -Wno-unused-variable) + if(CMAKE_CXX_COMPILER_ID STREQUAL "Clang") + add_compile_options(-Wno-unused-private-field) + endif() + if (CMAKE_CXX_COMPILER_ID STREQUAL "Clang" OR CMAKE_CXX_COMPILER_ID STREQUAL "AppleClang") - # libstdc++ headers contain deprecated declarations that fail on clang - # macOS currently has many deprecated calls add_compile_options(-Wno-unused-local-typedef) endif() if (CMAKE_CXX_COMPILER_ID STREQUAL "GNU") - add_compile_options(-Wno-stringop-truncation -Wno-parentheses -Wno-maybe-uninitialized) - endif() + add_compile_options(-Wno-stringop-truncation -Wno-stringop-overflow -Wno-parentheses -Wno-maybe-uninitialized -Wno-unused-local-typedefs) + endif () if (NOT GCC_DISABLE_FATAL_WARNINGS AND NOT CLANG_DISABLE_FATAL_WARNINGS) add_compile_options(-Werror) endif () - add_compile_options(${GCC_WARNINGS}) add_compile_options(-m${ADDRESS_SIZE}) endif (LINUX OR DARWIN) diff --git a/indra/cmake/APR.cmake b/indra/cmake/APR.cmake index 310659686dc..e0807a7d19d 100644 --- a/indra/cmake/APR.cmake +++ b/indra/cmake/APR.cmake @@ -31,8 +31,3 @@ if(DARWIN) endif() target_include_directories(ll::apr SYSTEM INTERFACE ${LIBS_PREBUILT_DIR}/include/apr-1) - -# Fix erroneous check for __attribute__ definition introduced with APR 1.7.5, causing lots of "this declaration may not have extern 'C' linkage" errors in VS -file(READ ${LIBS_PREBUILT_DIR}/include/apr-1/apr.h APR_HEADER_CONTENTS) -string(REPLACE "#if !(defined(__attribute__) || defined(__has_attribute))" "#if !defined(__attribute__)" APR_HEADER_CONTENTS "${APR_HEADER_CONTENTS}") -file(WRITE ${LIBS_PREBUILT_DIR}/include/apr-1/apr.h "${APR_HEADER_CONTENTS}") diff --git a/indra/cmake/Boost.cmake b/indra/cmake/Boost.cmake index b57c33c3e00..5967a96f8a2 100644 --- a/indra/cmake/Boost.cmake +++ b/indra/cmake/Boost.cmake @@ -1,5 +1,6 @@ # -*- cmake -*- include(Prebuilt) +include(Linking) include_guard() @@ -16,107 +17,61 @@ use_prebuilt_binary(boost) # with the address size. set(addrsfx "-x${ADDRESS_SIZE}") -if (WINDOWS) - - find_library(BOOST_CONTEXT_LIBRARY - NAMES - libboost_context-mt - libboost_context-mt${addrsfx} - PATHS "${ARCH_PREBUILT_DIRS_RELEASE}" REQUIRED NO_DEFAULT_PATH) - - find_library(BOOST_FIBER_LIBRARY - NAMES - libboost_fiber-mt - libboost_fiber-mt${addrsfx} - PATHS "${ARCH_PREBUILT_DIRS_RELEASE}" REQUIRED NO_DEFAULT_PATH) - - find_library(BOOST_FILESYSTEM_LIBRARY - NAMES - libboost_filesystem-mt - libboost_filesystem-mt${addrsfx} - PATHS "${ARCH_PREBUILT_DIRS_RELEASE}" REQUIRED NO_DEFAULT_PATH) - - find_library(BOOST_PROGRAMOPTIONS_LIBRARY - NAMES - libboost_program_options-mt - libboost_program_options-mt${addrsfx} - PATHS "${ARCH_PREBUILT_DIRS_RELEASE}" REQUIRED NO_DEFAULT_PATH) - - find_library(BOOST_REGEX_LIBRARY - NAMES - libboost_regex-mt - libboost_regex-mt${addrsfx} - PATHS "${ARCH_PREBUILT_DIRS_RELEASE}" REQUIRED NO_DEFAULT_PATH) - - find_library(BOOST_SYSTEM_LIBRARY - NAMES - libboost_system-mt - libboost_system-mt${addrsfx} - PATHS "${ARCH_PREBUILT_DIRS_RELEASE}" REQUIRED NO_DEFAULT_PATH) - - find_library(BOOST_THREAD_LIBRARY - NAMES - libboost_thread-mt - libboost_thread-mt${addrsfx} - PATHS "${ARCH_PREBUILT_DIRS_RELEASE}" REQUIRED NO_DEFAULT_PATH) - - find_library(BOOST_URL_LIBRARY - NAMES - libboost_url-mt - libboost_url-mt${addrsfx} - PATHS "${ARCH_PREBUILT_DIRS_RELEASE}" REQUIRED NO_DEFAULT_PATH) - -else (WINDOWS) - - find_library(BOOST_CONTEXT_LIBRARY - NAMES - boost_context-mt - boost_context-mt${addrsfx} - PATHS "${ARCH_PREBUILT_DIRS_RELEASE}" REQUIRED NO_DEFAULT_PATH) - - find_library(BOOST_FIBER_LIBRARY - NAMES - boost_fiber-mt - boost_fiber-mt${addrsfx} - PATHS "${ARCH_PREBUILT_DIRS_RELEASE}" REQUIRED NO_DEFAULT_PATH) - - find_library(BOOST_FILESYSTEM_LIBRARY - NAMES - boost_filesystem-mt - boost_filesystem-mt${addrsfx} - PATHS "${ARCH_PREBUILT_DIRS_RELEASE}" REQUIRED NO_DEFAULT_PATH) - - find_library(BOOST_PROGRAMOPTIONS_LIBRARY - NAMES - boost_program_options-mt - boost_program_options-mt${addrsfx} - PATHS "${ARCH_PREBUILT_DIRS_RELEASE}" REQUIRED NO_DEFAULT_PATH) - - find_library(BOOST_REGEX_LIBRARY - NAMES - boost_regex-mt - boost_regex-mt${addrsfx} - PATHS "${ARCH_PREBUILT_DIRS_RELEASE}" REQUIRED NO_DEFAULT_PATH) - - find_library(BOOST_SYSTEM_LIBRARY - NAMES - boost_system-mt - boost_system-mt${addrsfx} - PATHS "${ARCH_PREBUILT_DIRS_RELEASE}" REQUIRED NO_DEFAULT_PATH) - - find_library(BOOST_THREAD_LIBRARY - NAMES - boost_thread-mt - boost_thread-mt${addrsfx} - PATHS "${ARCH_PREBUILT_DIRS_RELEASE}" REQUIRED NO_DEFAULT_PATH) - - find_library(BOOST_URL_LIBRARY - NAMES - boost_url-mt - boost_url-mt${addrsfx} - PATHS "${ARCH_PREBUILT_DIRS_RELEASE}" REQUIRED NO_DEFAULT_PATH) - -endif (WINDOWS) +find_library(BOOST_CONTEXT_LIBRARY + NAMES + libboost_context-mt + libboost_context-mt${addrsfx} + boost_context-mt + boost_context-mt${addrsfx} + PATHS "${ARCH_PREBUILT_DIRS_RELEASE}" REQUIRED NO_DEFAULT_PATH) + +find_library(BOOST_FIBER_LIBRARY + NAMES + libboost_fiber-mt + libboost_fiber-mt${addrsfx} + boost_fiber-mt + boost_fiber-mt${addrsfx} + PATHS "${ARCH_PREBUILT_DIRS_RELEASE}" REQUIRED NO_DEFAULT_PATH) + +find_library(BOOST_FILESYSTEM_LIBRARY + NAMES + libboost_filesystem-mt + libboost_filesystem-mt${addrsfx} + boost_filesystem-mt + boost_filesystem-mt${addrsfx} + PATHS "${ARCH_PREBUILT_DIRS_RELEASE}" REQUIRED NO_DEFAULT_PATH) + +find_library(BOOST_PROGRAMOPTIONS_LIBRARY + NAMES + libboost_program_options-mt + libboost_program_options-mt${addrsfx} + boost_program_options-mt + boost_program_options-mt${addrsfx} + PATHS "${ARCH_PREBUILT_DIRS_RELEASE}" REQUIRED NO_DEFAULT_PATH) + +find_library(BOOST_REGEX_LIBRARY + NAMES + libboost_regex-mt + libboost_regex-mt${addrsfx} + boost_regex-mt + boost_regex-mt${addrsfx} + PATHS "${ARCH_PREBUILT_DIRS_RELEASE}" REQUIRED NO_DEFAULT_PATH) + +find_library(BOOST_SYSTEM_LIBRARY + NAMES + libboost_system-mt + libboost_system-mt${addrsfx} + boost_system-mt + boost_system-mt${addrsfx} + PATHS "${ARCH_PREBUILT_DIRS_RELEASE}" REQUIRED NO_DEFAULT_PATH) + +find_library(BOOST_URL_LIBRARY + NAMES + libboost_url-mt + libboost_url-mt${addrsfx} + boost_url-mt + boost_url-mt${addrsfx} + PATHS "${ARCH_PREBUILT_DIRS_RELEASE}" REQUIRED NO_DEFAULT_PATH) target_link_libraries(ll::boost INTERFACE ${BOOST_FIBER_LIBRARY} @@ -125,7 +80,6 @@ target_link_libraries(ll::boost INTERFACE ${BOOST_PROGRAMOPTIONS_LIBRARY} ${BOOST_REGEX_LIBRARY} ${BOOST_SYSTEM_LIBRARY} - ${BOOST_THREAD_LIBRARY} ${BOOST_URL_LIBRARY}) if (LINUX) diff --git a/indra/cmake/BuildVersion.cmake b/indra/cmake/BuildVersion.cmake index aa151bafc8a..6939f9a4da7 100644 --- a/indra/cmake/BuildVersion.cmake +++ b/indra/cmake/BuildVersion.cmake @@ -46,13 +46,4 @@ if (NOT DEFINED VIEWER_SHORT_VERSION) # will be true in indra/, false in indra/n message(STATUS "Ultimate fallback, revision was blank or not set: will use 0") set(VIEWER_VERSION_REVISION 0) endif ("${VIEWER_VERSION_REVISION}" STREQUAL "") - - set(VIEWER_CHANNEL_VERSION_DEFINES - "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}" - "LL_VIEWER_VERSION_BUILD=${VIEWER_VERSION_REVISION}" - "LLBUILD_CONFIG=\"${CMAKE_BUILD_TYPE}\"" - ) endif (NOT DEFINED VIEWER_SHORT_VERSION) diff --git a/indra/cmake/CEFPlugin.cmake b/indra/cmake/CEFPlugin.cmake index e27929fa088..5f5c55f0e95 100644 --- a/indra/cmake/CEFPlugin.cmake +++ b/indra/cmake/CEFPlugin.cmake @@ -10,9 +10,9 @@ target_include_directories( ll::cef SYSTEM INTERFACE ${LIBS_PREBUILT_DIR}/inclu if (WINDOWS) target_link_libraries( ll::cef INTERFACE - libcef.lib - libcef_dll_wrapper.lib - dullahan.lib + ${ARCH_PREBUILT_DIRS_RELEASE}/libcef.lib + ${ARCH_PREBUILT_DIRS_RELEASE}/libcef_dll_wrapper.lib + ${ARCH_PREBUILT_DIRS_RELEASE}/dullahan.lib ) elseif (DARWIN) FIND_LIBRARY(APPKIT_LIBRARY AppKit) @@ -32,4 +32,9 @@ elseif (DARWIN) ) elseif (LINUX) + target_link_libraries( ll::cef INTERFACE + ${ARCH_PREBUILT_DIRS_RELEASE}/libdullahan.a + ${ARCH_PREBUILT_DIRS_RELEASE}/libcef.so + ${ARCH_PREBUILT_DIRS_RELEASE}/libcef_dll_wrapper.a + ) endif (WINDOWS) diff --git a/indra/cmake/CMakeLists.txt b/indra/cmake/CMakeLists.txt index 2ba282bdb78..6bbc61feaaa 100644 --- a/indra/cmake/CMakeLists.txt +++ b/indra/cmake/CMakeLists.txt @@ -11,23 +11,24 @@ set(cmake_SOURCE_FILES Audio.cmake Boost.cmake bugsplat.cmake + BuildPackagesInfo.cmake BuildVersion.cmake CEFPlugin.cmake CEFPlugin.cmake CMakeCopyIfDifferent.cmake - ConfigurePkgConfig.cmake - CURL.cmake Copy3rdPartyLibs.cmake - DBusGlib.cmake + CURL.cmake DeploySharedLibs.cmake Discord.cmake DragDrop.cmake EXPAT.cmake FindAutobuild.cmake + FindPipeWire.cmake FreeType.cmake GLEXT.cmake - GLH.cmake + GLIB.cmake GLM.cmake + GStreamer10Plugin.cmake Havok.cmake Hunspell.cmake LLAddBuildTest.cmake @@ -53,6 +54,7 @@ set(cmake_SOURCE_FILES Prebuilt.cmake PulseAudio.cmake Python.cmake + SDL3.cmake SSE2NEON.cmake TemplateCheck.cmake TinyEXR.cmake @@ -67,6 +69,7 @@ set(cmake_SOURCE_FILES VisualLeakDetector.cmake LibVLCPlugin.cmake WebRTC.cmake + websocketpp.cmake xxHash.cmake ZLIBNG.cmake ) diff --git a/indra/cmake/ConfigurePkgConfig.cmake b/indra/cmake/ConfigurePkgConfig.cmake deleted file mode 100644 index 9e798d663b5..00000000000 --- a/indra/cmake/ConfigurePkgConfig.cmake +++ /dev/null @@ -1,74 +0,0 @@ -# -*- cmake -*- - -SET(DEBUG_PKG_CONFIG "YES") - -# Don't change this if manually set by user. -IF("$ENV{PKG_CONFIG_LIBDIR}" STREQUAL "") - - # Guess at architecture-specific system library paths. - 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 (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 (ADDRESS_SIZE EQUAL 32) - - # Use DPKG architecture, if available. - IF (${DPKG_ARCH}) - SET(PKG_CONFIG_MULTI_GUESS /usr/lib/${DPKG_ARCH}) - SET(PKG_CONFIG_MULTI_LOCAL_GUESS /usrlocal/lib/${DPKG_ARCH}) - ENDIF (${DPKG_ARCH}) - - # Explicitly include anything listed in PKG_CONFIG_PATH - string(REPLACE ":" ";" PKG_CONFIG_PATH_LIST "$ENV{PKG_CONFIG_PATH}") - FOREACH(PKG_CONFIG_DIR ${PKG_CONFIG_PATH_LIST}) - SET(VALID_PKG_LIBDIRS "${VALID_PKG_LIBDIRS}:${PKG_CONFIG_DIR}/pkgconfig") - ENDFOREACH(PKG_CONFIG_DIR) - - # Look for valid pkgconfig directories. - FIND_PATH(PKG_CONFIG_ENV pkgconfig ENV LD_LIBRARY_PATH) - FIND_PATH(PKG_CONFIG_MULTI pkgconfig HINT ${PKG_CONFIG_MULTI_GUESS}) - FIND_PATH(PKG_CONFIG_MULTI_LOCAL pkgconfig HINT ${PKG_CONFIG_MULTI_LOCAL_GUESS}) - FIND_PATH(PKG_CONFIG_NO_MULTI pkgconfig HINT ${PKG_CONFIG_NO_MULTI_GUESS}) - FIND_PATH(PKG_CONFIG_NO_MULTI_LOCAL pkgconfig HINT ${PKG_CONFIG_NO_MULTI_LOCAL_GUESS}) - - # Add anything we found to our list. - IF(NOT PKG_CONFIG_ENV STREQUAL PKG_CONFIG_ENV-NOTFOUND) - SET(VALID_PKG_LIBDIRS "${VALID_PKG_LIBDIRS}:${PKG_CONFIG_ENV}/pkgconfig") - ENDIF(NOT PKG_CONFIG_ENV STREQUAL PKG_CONFIG_ENV-NOTFOUND) - - IF(NOT PKG_CONFIG_MULTI STREQUAL PKG_CONFIG_MULTI-NOTFOUND) - SET(VALID_PKG_LIBDIRS "${VALID_PKG_LIBDIRS}:${PKG_CONFIG_MULTI}/pkgconfig") - ENDIF(NOT PKG_CONFIG_MULTI STREQUAL PKG_CONFIG_MULTI-NOTFOUND) - - IF(NOT PKG_CONFIG_MULTI_LOCAL STREQUAL PKG_CONFIG_MULTI_LOCAL-NOTFOUND) - SET(VALID_PKG_LIBDIRS "${VALID_PKG_LIBDIRS}:${PKG_CONFIG_MULTI_LOCAL}/pkgconfig") - ENDIF(NOT PKG_CONFIG_MULTI_LOCAL STREQUAL PKG_CONFIG_MULTI_LOCAL-NOTFOUND) - - IF(NOT PKG_CONFIG_NO_MULTI STREQUAL PKG_CONFIG_NO_MULTI-NOTFOUND) - SET(VALID_PKG_LIBDIRS "${VALID_PKG_LIBDIRS}:${PKG_CONFIG_NO_MULTI}/pkgconfig") - ENDIF(NOT PKG_CONFIG_NO_MULTI STREQUAL PKG_CONFIG_NO_MULTI-NOTFOUND) - - IF(NOT PKG_CONFIG_NO_MULTI_LOCAL STREQUAL PKG_CONFIG_NO_MULTI_LOCAL-NOTFOUND) - SET(VALID_PKG_LIBDIRS "${VALID_PKG_LIBDIRS}:${PKG_CONFIG_NO_MULTI_LOCAL}/pkgconfig") - ENDIF(NOT PKG_CONFIG_NO_MULTI_LOCAL STREQUAL PKG_CONFIG_NO_MULTI_LOCAL-NOTFOUND) - - # Also add some non-architecture specific package locations. - SET(VALID_PKG_LIBDIRS "${VALID_PKG_LIBDIRS}:/usr/share/pkgconfig:/usr/local/share/pkgconfig") - - # Remove first unwanted ':' - string(SUBSTRING ${VALID_PKG_LIBDIRS} 1 -1 VALID_PKG_LIBDIRS) - - # Set PKG_CONFIG_LIBDIR environment. - SET(ENV{PKG_CONFIG_LIBDIR} ${VALID_PKG_LIBDIRS}) -ENDIF("$ENV{PKG_CONFIG_LIBDIR}" STREQUAL "") - -IF(DEBUG_PKG_CONFIG) - MESSAGE(STATUS "Using PKG_CONFIG_LIBDIR=$ENV{PKG_CONFIG_LIBDIR}") -ENDIF(DEBUG_PKG_CONFIG) - diff --git a/indra/cmake/Copy3rdPartyLibs.cmake b/indra/cmake/Copy3rdPartyLibs.cmake index 680f2f3ac20..9925be5fecb 100644 --- a/indra/cmake/Copy3rdPartyLibs.cmake +++ b/indra/cmake/Copy3rdPartyLibs.cmake @@ -98,6 +98,9 @@ if(WINDOWS) elseif (MSVC_VERSION GREATER_EQUAL 1930 AND MSVC_VERSION LESS 1950) # Visual Studio 2022 set(MSVC_VER 140) set(MSVC_TOOLSET_VER 143) + elseif (MSVC_VERSION GREATER_EQUAL 1950 AND MSVC_VERSION LESS 1970) # Visual Studio 2026 + set(MSVC_VER 140) + set(MSVC_TOOLSET_VER 145) else (MSVC80) MESSAGE(WARNING "New MSVC_VERSION ${MSVC_VERSION} of MSVC: adapt Copy3rdPartyLibs.cmake") endif (MSVC80) @@ -135,6 +138,7 @@ if(WINDOWS) msvcp${MSVC_VER}_atomic_wait.dll msvcp${MSVC_VER}_codecvt_ids.dll msvcr${MSVC_VER}.dll + vccorlib${MSVC_VER}.dll vcruntime${MSVC_VER}.dll vcruntime${MSVC_VER}_1.dll vcruntime${MSVC_VER}_threads.dll @@ -211,17 +215,10 @@ elseif(LINUX) if( USE_AUTOBUILD_3P ) list( APPEND release_files - libatk-1.0.so - libfreetype.so.6.6.2 - libfreetype.so.6 - libopenjp2.so - libuuid.so.16 - libuuid.so.16.0.22 - libfontconfig.so.1.8.0 - libfontconfig.so.1 - libgmodule-2.0.so - libgobject-2.0.so - ) + libSDL3.so + libSDL3.so.0 + libSDL3.so.0.2.24 + ) endif() else(WINDOWS) diff --git a/indra/cmake/DBusGlib.cmake b/indra/cmake/DBusGlib.cmake deleted file mode 100644 index c9b727ca9df..00000000000 --- a/indra/cmake/DBusGlib.cmake +++ /dev/null @@ -1,14 +0,0 @@ -# -*- cmake -*- -include(Prebuilt) - -add_library( ll::dbus INTERFACE IMPORTED) - -if( LINUX ) - # Only define this when not using the prebuild 3ps, lls prebuild is broken - if( NOT USE_AUTOBUILD_3P ) - target_compile_definitions( ll::dbus INTERFACE LL_DBUS_ENABLED ) - endif() - use_system_binary(dbus) - - use_prebuilt_binary(dbus_glib) -endif() diff --git a/indra/cmake/Discord.cmake b/indra/cmake/Discord.cmake index 95cfaacf5b4..0e63d053500 100644 --- a/indra/cmake/Discord.cmake +++ b/indra/cmake/Discord.cmake @@ -2,10 +2,23 @@ include(Prebuilt) include_guard() -add_library(ll::discord_sdk INTERFACE IMPORTED) -target_compile_definitions(ll::discord_sdk INTERFACE LL_DISCORD=1) +option(USE_DISCORD "Enable Discord SDK" OFF) -use_prebuilt_binary(discord_sdk) +if(USE_DISCORD) + add_library(ll::discord_sdk INTERFACE IMPORTED) -target_include_directories(ll::discord_sdk SYSTEM INTERFACE ${LIBS_PREBUILT_DIR}/include/discord_sdk) -target_link_libraries(ll::discord_sdk INTERFACE discord_partner_sdk) + target_compile_definitions(ll::discord_sdk INTERFACE LL_DISCORD=1) + + use_prebuilt_binary(discord_sdk) + + find_library(DISCORD_SDK_LIBRARY + NAMES + discord_partner_sdk + discord_partner_sdk.lib + libdiscord_partner_sdk.so + libdiscord_partner_sdk.dylib + PATHS "${ARCH_PREBUILT_DIRS_ARCH_RELEASE}" "${ARCH_PREBUILT_DIRS_RELEASE}" REQUIRED NO_DEFAULT_PATH) + + target_include_directories(ll::discord_sdk SYSTEM INTERFACE ${LIBS_PREBUILT_DIR}/include/discord_sdk) + target_link_libraries(ll::discord_sdk INTERFACE ${DISCORD_SDK_LIBRARY}) +endif() diff --git a/indra/cmake/FindPipeWire.cmake b/indra/cmake/FindPipeWire.cmake new file mode 100644 index 00000000000..868acf5ec15 --- /dev/null +++ b/indra/cmake/FindPipeWire.cmake @@ -0,0 +1,100 @@ +# cmake-format: off +# .rst: FindPipeWire +# ------- +# +# Try to find PipeWire on a Unix system. +# +# This will define the following variables: +# +# ``PIPEWIRE_FOUND`` True if (the requested version of) PipeWire is available +# ``PIPEWIRE_VERSION`` The version of PipeWire ``PIPEWIRE_LIBRARIES`` This can +# be passed to target_link_libraries() instead of the ``PipeWire::PipeWire`` +# target ``PIPEWIRE_INCLUDE_DIRS`` This should be passed to +# target_include_directories() if the target is not used for linking +# ``PIPEWIRE_COMPILE_FLAGS`` This should be passed to target_compile_options() +# if the target is not used for linking +# +# If ``PIPEWIRE_FOUND`` is TRUE, it will also define the following imported +# target: +# +# ``PipeWire::PipeWire`` The PipeWire library +# +# In general we recommend using the imported target, as it is easier to use. +# Bear in mind, however, that if the target is in the link interface of an +# exported library, it must be made available by the package config file. + +# ============================================================================= +# Copyright 2014 Alex Merry Copyright 2014 Martin Gräßlin +# Copyright 2018-2020 Jan Grulich +# +# Redistribution and use in source and binary forms, with or without +# modification, are permitted provided that the following conditions are met: +# +# 1. Redistributions of source code must retain the copyright notice, this list +# of conditions and the following disclaimer. +# 2. Redistributions in binary form must reproduce the copyright notice, this +# list of conditions and the following disclaimer in the documentation and/or +# other materials provided with the distribution. +# 3. The name of the author may not be used to endorse or promote products +# derived from this software without specific prior written permission. +# +# THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR IMPLIED +# WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF +# MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO +# EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +# SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, +# PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR +# BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER +# IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) +# ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE +# POSSIBILITY OF SUCH DAMAGE. +# ============================================================================= +# cmake-format: on + +# Use pkg-config to get the directories and then use these values in the FIND_PATH() and FIND_LIBRARY() calls +find_package(PkgConfig QUIET) + +pkg_search_module(PKG_PIPEWIRE QUIET libpipewire-0.3) +pkg_search_module(PKG_SPA QUIET libspa-0.2) + +set(PIPEWIRE_COMPILE_FLAGS "${PKG_PIPEWIRE_CFLAGS}" "${PKG_SPA_CFLAGS}") +set(PIPEWIRE_VERSION "${PKG_PIPEWIRE_VERSION}") + +find_path( + PIPEWIRE_INCLUDE_DIRS + NAMES pipewire/pipewire.h + HINTS ${PKG_PIPEWIRE_INCLUDE_DIRS} ${PKG_PIPEWIRE_INCLUDE_DIRS}/pipewire-0.3) + +find_path( + SPA_INCLUDE_DIRS + NAMES spa/param/props.h + HINTS ${PKG_SPA_INCLUDE_DIRS} ${PKG_SPA_INCLUDE_DIRS}/spa-0.2) + +find_library( + PIPEWIRE_LIBRARIES + NAMES pipewire-0.3 + HINTS ${PKG_PIPEWIRE_LIBRARY_DIRS}) + +include(FindPackageHandleStandardArgs) +find_package_handle_standard_args( + PipeWire + FOUND_VAR PIPEWIRE_FOUND + REQUIRED_VARS PIPEWIRE_LIBRARIES PIPEWIRE_INCLUDE_DIRS SPA_INCLUDE_DIRS + VERSION_VAR PIPEWIRE_VERSION) + +if(PIPEWIRE_FOUND AND NOT TARGET PipeWire::PipeWire) + add_library(PipeWire::PipeWire UNKNOWN IMPORTED) + set_target_properties( + PipeWire::PipeWire + PROPERTIES IMPORTED_LOCATION "${PIPEWIRE_LIBRARIES}" + INTERFACE_COMPILE_OPTIONS "${PIPEWIRE_COMPILE_FLAGS}" + INTERFACE_INCLUDE_DIRECTORIES "${PIPEWIRE_INCLUDE_DIRS};${SPA_INCLUDE_DIRS}") +endif() + +mark_as_advanced(PIPEWIRE_LIBRARIES PIPEWIRE_INCLUDE_DIRS) + +include(FeatureSummary) +set_package_properties( + PipeWire PROPERTIES + URL "https://www.pipewire.org" + DESCRIPTION "PipeWire - multimedia processing") diff --git a/indra/cmake/FreeType.cmake b/indra/cmake/FreeType.cmake index 3c635e851b1..eb018c09e99 100644 --- a/indra/cmake/FreeType.cmake +++ b/indra/cmake/FreeType.cmake @@ -1,6 +1,8 @@ # -*- cmake -*- include(Prebuilt) include(Linking) +include(PNG) +include(ZLIBNG) include_guard() add_library( ll::freetype INTERFACE IMPORTED ) @@ -15,4 +17,4 @@ find_library(FREETYPE_LIBRARY libfreetype.a PATHS "${ARCH_PREBUILT_DIRS_RELEASE}" REQUIRED NO_DEFAULT_PATH) -target_link_libraries(ll::freetype INTERFACE ${FREETYPE_LIBRARY}) +target_link_libraries(ll::freetype INTERFACE ${FREETYPE_LIBRARY} ll::libpng ll::zlib-ng) diff --git a/indra/cmake/GLEXT.cmake b/indra/cmake/GLEXT.cmake index a780966f0c2..2124cc2fc8c 100644 --- a/indra/cmake/GLEXT.cmake +++ b/indra/cmake/GLEXT.cmake @@ -1,8 +1,7 @@ # -*- cmake -*- include(Prebuilt) -include(GLH) -add_library( ll::glext INTERFACE IMPORTED ) +add_library(ll::glext INTERFACE IMPORTED) use_system_binary(glext) use_prebuilt_binary(glext) diff --git a/indra/cmake/GLH.cmake b/indra/cmake/GLH.cmake deleted file mode 100644 index 0cefc3543ad..00000000000 --- a/indra/cmake/GLH.cmake +++ /dev/null @@ -1,7 +0,0 @@ -# -*- cmake -*- -include(Prebuilt) - -add_library( ll::glh_linear INTERFACE IMPORTED ) - -use_system_binary( glh_linear ) -use_prebuilt_binary(glh_linear) diff --git a/indra/cmake/GLIB.cmake b/indra/cmake/GLIB.cmake new file mode 100644 index 00000000000..f52cbb7f871 --- /dev/null +++ b/indra/cmake/GLIB.cmake @@ -0,0 +1,22 @@ +include_guard() + +include(Prebuilt) + +add_library( ll::glib INTERFACE IMPORTED ) +add_library( ll::glib_headers INTERFACE IMPORTED ) +add_library( ll::gio INTERFACE IMPORTED ) + +if( LINUX ) + find_package(PkgConfig REQUIRED) + pkg_search_module(GLIB REQUIRED glib-2.0) + pkg_search_module(GIO REQUIRED gio-2.0) + + target_include_directories( ll::glib SYSTEM INTERFACE ${GLIB_INCLUDE_DIRS} ) + target_link_libraries( ll::glib INTERFACE ${GLIB_LDFLAGS} ) + target_compile_definitions( ll::glib INTERFACE -DLL_GLIB=1) + + target_include_directories( ll::glib_headers SYSTEM INTERFACE ${GLIB_INCLUDE_DIRS} ) + target_compile_definitions( ll::glib_headers INTERFACE -DLL_GLIB=1) + + target_link_libraries( ll::gio INTERFACE ${GIO_LDFLAGS} ) +endif() diff --git a/indra/cmake/GStreamer010Plugin.cmake b/indra/cmake/GStreamer010Plugin.cmake deleted file mode 100644 index 61f6f740336..00000000000 --- a/indra/cmake/GStreamer010Plugin.cmake +++ /dev/null @@ -1,12 +0,0 @@ -# -*- cmake -*- -include(Prebuilt) -if (NOT LINUX) - return() -endif() - -add_library( ll::gstreamer INTERFACE IMPORTED ) -target_compile_definitions( ll::gstreamer INTERFACE LL_GSTREAMER010_ENABLED=1) -use_system_binary(gstreamer) - -use_prebuilt_binary(gstreamer) - diff --git a/indra/cmake/GStreamer10Plugin.cmake b/indra/cmake/GStreamer10Plugin.cmake new file mode 100644 index 00000000000..01522db3a38 --- /dev/null +++ b/indra/cmake/GStreamer10Plugin.cmake @@ -0,0 +1,27 @@ +# -*- cmake -*- + +include_guard() + +include(Prebuilt) +include(GLIB) + +add_library( ll::gstreamer10 INTERFACE IMPORTED ) + +if (LINUX) + find_package(PkgConfig REQUIRED) + + pkg_check_modules(GSTREAMER10 REQUIRED gstreamer-1.0) + pkg_check_modules(GSTREAMER10_PLUGINS_BASE REQUIRED gstreamer-plugins-base-1.0) + + target_include_directories( ll::gstreamer10 SYSTEM INTERFACE ${GSTREAMER10_INCLUDE_DIRS}) + target_link_libraries( ll::gstreamer10 INTERFACE ll::glib_headers) + +endif () + +if (GSTREAMER10_FOUND AND GSTREAMER10_PLUGINS_BASE_FOUND) + set(GSTREAMER10 ON CACHE BOOL "Build with GStreamer-1.0 streaming media support.") +endif (GSTREAMER10_FOUND AND GSTREAMER10_PLUGINS_BASE_FOUND) + +if (GSTREAMER10) + add_definitions(-DLL_GSTREAMER10_ENABLED=1) +endif (GSTREAMER10) diff --git a/indra/cmake/Havok.cmake b/indra/cmake/Havok.cmake index c544440adce..64e33f6c83b 100644 --- a/indra/cmake/Havok.cmake +++ b/indra/cmake/Havok.cmake @@ -27,26 +27,26 @@ else (LL_DEBUG_HAVOK) endif (LL_DEBUG_HAVOK) set(HAVOK_LIBS - hkBase - hkCompat + hkgpConvexDecomposition hkGeometryUtilities - hkInternal hkSerialize hkSceneData hkpCollide hkpUtilities hkpConstraintSolver hkpDynamics - hkpInternal - hkaiInternal hkaiPathfinding hkaiAiPhysicsBridge - hkcdInternal hkcdCollide hkpVehicle hkVisualize hkaiVisualize - hkgpConvexDecomposition + hkaiInternal + hkcdInternal + hkpInternal + hkInternal + hkCompat + hkBase ) unset(HK_DEBUG_LIBRARIES) @@ -60,16 +60,22 @@ if (DEBUG_PREBUILT) # but making it pretty is a lot more work message(STATUS "${ARGN}") endfunction(DEBUG_MESSAGE) + function(DEBUG_EXEC_FUNC) + execute_process(COMMAND ${ARGN}) + endfunction(DEBUG_EXEC_FUNC) else (DEBUG_PREBUILT) # without DEBUG_PREBUILT, DEBUG_MESSAGE() is a no-op function(DEBUG_MESSAGE) endfunction(DEBUG_MESSAGE) + function(DEBUG_EXEC_FUNC) + execute_process(COMMAND ${ARGN} OUTPUT_QUIET) + endfunction(DEBUG_EXEC_FUNC) endif (DEBUG_PREBUILT) # DEBUG_EXEC() reports each execute_process() before invoking function(DEBUG_EXEC) DEBUG_MESSAGE(${ARGN}) - execute_process(COMMAND ${ARGN}) + DEBUG_EXEC_FUNC(${ARGN}) endfunction(DEBUG_EXEC) # *TODO: Figure out why we need to extract like this... @@ -79,9 +85,7 @@ foreach(HAVOK_LIB ${HAVOK_LIBS}) find_library(HAVOK_RELWITHDEBINFO_LIB_${HAVOK_LIB} ${HAVOK_LIB} PATHS ${HAVOK_RELWITHDEBINFO_LIBRARY_PATH}) if(LINUX) - set(debug_dir "${HAVOK_DEBUG_LIBRARY_PATH}/${HAVOK_LIB}") set(release_dir "${HAVOK_RELEASE_LIBRARY_PATH}/${HAVOK_LIB}") - set(relwithdebinfo_dir "${HAVOK_RELWITHDEBINFO_LIBRARY_PATH}/${HAVOK_LIB}") # Try to avoid extracting havok library each time we run cmake. if("${havok_${HAVOK_LIB}_extracted}" STREQUAL "" AND EXISTS "${PREBUILD_TRACKING_DIR}/havok_${HAVOK_LIB}_extracted") @@ -92,8 +96,8 @@ foreach(HAVOK_LIB ${HAVOK_LIBS}) if(${PREBUILD_TRACKING_DIR}/havok_source_installed IS_NEWER_THAN ${PREBUILD_TRACKING_DIR}/havok_${HAVOK_LIB}_extracted OR NOT ${havok_${HAVOK_LIB}_extracted} EQUAL 0) DEBUG_MESSAGE("Extracting ${HAVOK_LIB}...") - foreach(lib ${debug_dir} ${release_dir} ${relwithdebinfo_dir}) - DEBUG_EXEC("mkdir" ${lib}) + foreach(lib ${release_dir}) + DEBUG_EXEC("mkdir" "-p" ${lib}) DEBUG_EXEC("ar" "-xv" "../lib${HAVOK_LIB}.a" WORKING_DIRECTORY ${lib}) endforeach(lib) @@ -104,17 +108,12 @@ foreach(HAVOK_LIB ${HAVOK_LIBS}) endif() - file(GLOB extracted_debug "${debug_dir}/*.o") file(GLOB extracted_release "${release_dir}/*.o") - file(GLOB extracted_relwithdebinfo "${relwithdebinfo_dir}/*.o") - - DEBUG_MESSAGE("extracted_debug ${debug_dir}/*.o") DEBUG_MESSAGE("extracted_release ${release_dir}/*.o") - DEBUG_MESSAGE("extracted_relwithdebinfo ${relwithdebinfo_dir}/*.o") - list(APPEND HK_DEBUG_LIBRARIES ${extracted_debug}) + list(APPEND HK_DEBUG_LIBRARIES ${extracted_release}) list(APPEND HK_RELEASE_LIBRARIES ${extracted_release}) - list(APPEND HK_RELWITHDEBINFO_LIBRARIES ${extracted_relwithdebinfo}) + list(APPEND HK_RELWITHDEBINFO_LIBRARIES ${extracted_release}) else(LINUX) # Win32 list(APPEND HK_DEBUG_LIBRARIES ${HAVOK_DEBUG_LIB_${HAVOK_LIB}}) diff --git a/indra/cmake/JPEG.cmake b/indra/cmake/JPEG.cmake index f864ca7f8d1..49880e7f727 100644 --- a/indra/cmake/JPEG.cmake +++ b/indra/cmake/JPEG.cmake @@ -11,6 +11,9 @@ use_prebuilt_binary(libjpeg-turbo) find_library(JPEG_LIBRARY NAMES + jpeg + jpeg-static + jpeg-static.lib jpeg.lib libjpeg.a PATHS "${ARCH_PREBUILT_DIRS_RELEASE}" REQUIRED NO_DEFAULT_PATH) diff --git a/indra/cmake/LLAddBuildTest.cmake b/indra/cmake/LLAddBuildTest.cmake index 83725ffd1b8..bd2f894c97a 100644 --- a/indra/cmake/LLAddBuildTest.cmake +++ b/indra/cmake/LLAddBuildTest.cmake @@ -1,4 +1,11 @@ # -*- cmake -*- + +include_guard() + +if( NOT LL_TESTS ) + return() +endif() + include(00-Common) include(LLTestCommand) include(bugsplat) @@ -26,8 +33,6 @@ MACRO(LL_ADD_PROJECT_UNIT_TESTS project sources) #project(UNITTEST_PROJECT_${project}) # Setup includes, paths, etc set(alltest_SOURCE_FILES - ${CMAKE_SOURCE_DIR}/test/test.cpp - ${CMAKE_SOURCE_DIR}/test/lltut.cpp ) set(alltest_DEP_TARGETS # needed by the test harness itself @@ -35,6 +40,7 @@ MACRO(LL_ADD_PROJECT_UNIT_TESTS project sources) ) set(alltest_LIBRARIES + lltut_runner_lib llcommon ) if(NOT "${project}" STREQUAL "llmath") @@ -100,6 +106,10 @@ MACRO(LL_ADD_PROJECT_UNIT_TESTS project sources) ) endif(DARWIN) + if (USE_PRECOMPILED_HEADERS) + target_precompile_headers(PROJECT_${project}_TEST_${name} REUSE_FROM llprecompiled) + endif () + # # Per-codefile additional / external project dep and lib dep property extraction # @@ -122,7 +132,9 @@ MACRO(LL_ADD_PROJECT_UNIT_TESTS project sources) set_target_properties(PROJECT_${project}_TEST_${name} PROPERTIES COMPILE_FLAGS "${${name}_test_additional_CFLAGS}" - COMPILE_DEFINITIONS "LL_TEST=${name};LL_TEST_${name}") + COMPILE_DEFINITIONS "LL_TEST=${name};LL_TEST_${name}" + FOLDER "Tests" + ) if(LL_TEST_VERBOSE) message("LL_ADD_PROJECT_UNIT_TESTS ${name}_test_additional_CFLAGS ${${name}_test_additional_CFLAGS}") endif() @@ -131,6 +143,7 @@ MACRO(LL_ADD_PROJECT_UNIT_TESTS project sources) # test binaries always need to be signed for local development set_target_properties(PROJECT_${project}_TEST_${name} PROPERTIES + OSX_ARCHITECTURES ${LL_MACOS_TEST_ARCHITECTURE} XCODE_ATTRIBUTE_CODE_SIGN_IDENTITY "-") endif () @@ -153,24 +166,15 @@ MACRO(LL_ADD_PROJECT_UNIT_TESTS project sources) endif() # Add test - add_custom_command( - OUTPUT ${TEST_OUTPUT} + add_test( + NAME PROJECT_${project}_TEST_${name} COMMAND ${TEST_SCRIPT_CMD} - DEPENDS PROJECT_${project}_TEST_${name} WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR} ) - # Why not add custom target and add POST_BUILD command? - # Slightly less uncertain behavior - # (OUTPUT commands run non-deterministically AFAIK) + poppy 2009-04-19 - # > I did not use a post build step as I could not make it notify of a - # > failure after the first time you build and fail a test. - daveh 2009-04-20 + + add_dependencies(BUILD_TESTS PROJECT_${project}_TEST_${name}) list(APPEND ${project}_TEST_OUTPUT ${TEST_OUTPUT}) endforeach (source) - - # Add the test runner target per-project - # (replaces old _test_ok targets all over the place) - add_custom_target(${project}_tests ALL DEPENDS ${${project}_TEST_OUTPUT}) - add_dependencies(${project} ${project}_tests) ENDMACRO(LL_ADD_PROJECT_UNIT_TESTS) #***************************************************************************** @@ -198,12 +202,11 @@ FUNCTION(LL_ADD_INTEGRATION_TEST set(source_files tests/${testname}_test.cpp - ${CMAKE_SOURCE_DIR}/test/test.cpp - ${CMAKE_SOURCE_DIR}/test/lltut.cpp ${additional_source_files} ) set(libraries + lltut_runner_lib ${library_dependencies} ) @@ -217,6 +220,7 @@ FUNCTION(LL_ADD_INTEGRATION_TEST PROPERTIES RUNTIME_OUTPUT_DIRECTORY "${EXE_STAGING_DIR}" COMPILE_DEFINITIONS "LL_TEST=${testname};LL_TEST_${testname}" + FOLDER "Tests" ) # The following was copied to llcorehttp/CMakeLists.txt's texture_load target. @@ -232,6 +236,7 @@ FUNCTION(LL_ADD_INTEGRATION_TEST # test binaries always need to be signed for local development set_target_properties(INTEGRATION_TEST_${testname} PROPERTIES + OSX_ARCHITECTURES ${LL_MACOS_TEST_ARCHITECTURE} XCODE_ATTRIBUTE_CODE_SIGN_IDENTITY "-" BUILD_WITH_INSTALL_RPATH 1 INSTALL_RPATH "@executable_path/Resources" @@ -246,6 +251,11 @@ FUNCTION(LL_ADD_INTEGRATION_TEST target_link_libraries(INTEGRATION_TEST_${testname} ${libraries}) target_include_directories (INTEGRATION_TEST_${testname} PRIVATE ${LIBS_OPEN_DIR}/test ) + if (USE_PRECOMPILED_HEADERS) + target_include_directories (INTEGRATION_TEST_${testname} PRIVATE ${LIBS_OPEN_DIR}/llmath ) + target_precompile_headers(INTEGRATION_TEST_${testname} REUSE_FROM llprecompiled) + endif () + # Create the test running command set(test_command ${ARGN}) set(TEST_EXE $) @@ -274,14 +284,9 @@ FUNCTION(LL_ADD_INTEGRATION_TEST message(STATUS "TEST_SCRIPT_CMD: ${TEST_SCRIPT_CMD}") endif() - add_custom_command( - TARGET INTEGRATION_TEST_${testname} - POST_BUILD - COMMAND ${TEST_SCRIPT_CMD} - ) + add_test(NAME INTEGRATION_TEST_RUNNER_${testname} COMMAND ${TEST_SCRIPT_CMD}) - # Use CTEST? Not sure how to yet... - # ADD_TEST(INTEGRATION_TEST_RUNNER_${testname} ${TEST_SCRIPT_CMD}) + add_dependencies(BUILD_TESTS INTEGRATION_TEST_${testname}) ENDFUNCTION(LL_ADD_INTEGRATION_TEST) diff --git a/indra/cmake/LLAppearanceUtility.cmake b/indra/cmake/LLAppearanceUtility.cmake deleted file mode 100644 index 0eb3c723d5d..00000000000 --- a/indra/cmake/LLAppearanceUtility.cmake +++ /dev/null @@ -1,12 +0,0 @@ -# -*- cmake -*- -include(Prebuilt) -include(Boost) - -# Linux proprietary build only -if (INSTALL_PROPRIETARY) - if(LINUX) - use_prebuilt_binary(llappearance_utility) - set(LLAPPEARANCEUTILITY_SRC_DIR ${LIBS_PREBUILT_DIR}/llappearanceutility/src) - set(LLAPPEARANCEUTILITY_BIN_DIR ${CMAKE_BINARY_DIR}/llappearanceutility) - endif (LINUX) -endif (INSTALL_PROPRIETARY) diff --git a/indra/cmake/LLKDU.cmake b/indra/cmake/LLKDU.cmake index 7680ab7b542..03f3fd16192 100644 --- a/indra/cmake/LLKDU.cmake +++ b/indra/cmake/LLKDU.cmake @@ -14,19 +14,17 @@ if (USE_KDU) include(Prebuilt) use_prebuilt_binary(kdu) - if (WINDOWS) - find_library(KDU_LIBRARY - NAMES - kdu - PATHS "${ARCH_PREBUILT_DIRS_RELEASE}" REQUIRED NO_DEFAULT_PATH) - - else (WINDOWS) - find_library(KDU_LIBRARY - NAMES - libkdu.a - PATHS "${ARCH_PREBUILT_DIRS_RELEASE}" REQUIRED NO_DEFAULT_PATH) - - endif (WINDOWS) + find_library(KDU_LIBRARY + NAMES + kdu + kdu.lib + libkdu.a + PATHS + "${ARCH_PREBUILT_DIRS_RELEASE}" + "${AUTOBUILD_INSTALL_DIR}/lib" + PATH_SUFFIXES release + REQUIRED + NO_DEFAULT_PATH) target_link_libraries(ll::kdu INTERFACE ${KDU_LIBRARY}) diff --git a/indra/cmake/LLWindow.cmake b/indra/cmake/LLWindow.cmake index 2e1b601b797..1f12dec1f65 100644 --- a/indra/cmake/LLWindow.cmake +++ b/indra/cmake/LLWindow.cmake @@ -1,22 +1,7 @@ # -*- cmake -*- +include_guard() include(Variables) -include(GLEXT) include(Prebuilt) - -include_guard() -add_library( ll::SDL INTERFACE IMPORTED ) - - -if (LINUX) - #Must come first as use_system_binary can exit this file early - target_compile_definitions( ll::SDL INTERFACE LL_SDL=1) - - use_system_binary(SDL) - use_prebuilt_binary(SDL) - - target_include_directories( ll::SDL SYSTEM INTERFACE ${LIBS_PREBUILT_DIR}/include) - target_link_libraries( ll::SDL INTERFACE SDL directfb fusion direct X11) -endif (LINUX) - - +include(GLEXT) +include(SDL3) diff --git a/indra/cmake/LibVLCPlugin.cmake b/indra/cmake/LibVLCPlugin.cmake index 6361028c0c4..a38c660a339 100644 --- a/indra/cmake/LibVLCPlugin.cmake +++ b/indra/cmake/LibVLCPlugin.cmake @@ -5,20 +5,31 @@ include(Prebuilt) include_guard() add_library( ll::libvlc INTERFACE IMPORTED ) -use_prebuilt_binary(vlc-bin) set(LIBVLCPLUGIN ON CACHE BOOL "LIBVLCPLUGIN support for the llplugin/llmedia test apps.") -find_library(VLC_LIBRARY - NAMES - libvlc.lib - libvlc.dylib - PATHS "${ARCH_PREBUILT_DIRS_RELEASE}" REQUIRED NO_DEFAULT_PATH) +if (LIBVLCPLUGIN) + if(LINUX) + find_package(PkgConfig REQUIRED) -find_library(VLCCORE_LIBRARY - NAMES - libvlccore.lib - libvlccore.dylib - PATHS "${ARCH_PREBUILT_DIRS_RELEASE}" REQUIRED NO_DEFAULT_PATH) + pkg_check_modules(libvlc REQUIRED IMPORTED_TARGET libvlc) + target_link_libraries( ll::libvlc INTERFACE PkgConfig::libvlc) + return() + endif() -target_link_libraries(ll::libvlc INTERFACE ${VLC_LIBRARY} ${VLCCORE_LIBRARY}) + use_prebuilt_binary(vlc-bin) + + find_library(VLC_LIBRARY + NAMES + libvlc.lib + libvlc.dylib + PATHS "${ARCH_PREBUILT_DIRS_RELEASE}" REQUIRED NO_DEFAULT_PATH) + + find_library(VLCCORE_LIBRARY + NAMES + libvlccore.lib + libvlccore.dylib + PATHS "${ARCH_PREBUILT_DIRS_RELEASE}" REQUIRED NO_DEFAULT_PATH) + + target_link_libraries(ll::libvlc INTERFACE ${VLC_LIBRARY} ${VLCCORE_LIBRARY}) +endif() diff --git a/indra/cmake/NDOF.cmake b/indra/cmake/NDOF.cmake index a8f63f945b1..60b29a57fe4 100644 --- a/indra/cmake/NDOF.cmake +++ b/indra/cmake/NDOF.cmake @@ -19,7 +19,12 @@ if (NDOF) ndofdev PATHS "${ARCH_PREBUILT_DIRS_RELEASE}" REQUIRED NO_DEFAULT_PATH) - target_link_libraries(ll::ndof INTERFACE ${NDOF_LIBRARY}) + if (LINUX) + include(SDL3) + target_link_libraries(ll::ndof INTERFACE ${NDOF_LIBRARY} ll::SDL3) + else() + target_link_libraries(ll::ndof INTERFACE ${NDOF_LIBRARY}) + endif() target_compile_definitions(ll::ndof INTERFACE LIB_NDOF=1) endif (NDOF) diff --git a/indra/cmake/OPENAL.cmake b/indra/cmake/OPENAL.cmake index ab1604aa22a..523a2d16f66 100644 --- a/indra/cmake/OPENAL.cmake +++ b/indra/cmake/OPENAL.cmake @@ -26,6 +26,7 @@ if (USE_OPENAL) NAMES OpenAL32 openal + OpenAL32.lib libopenal.dylib libopenal.so PATHS "${ARCH_PREBUILT_DIRS_RELEASE}" REQUIRED NO_DEFAULT_PATH) @@ -33,6 +34,7 @@ if (USE_OPENAL) find_library(ALUT_LIBRARY NAMES alut + alut.lib libalut.dylib libalut.so PATHS "${ARCH_PREBUILT_DIRS_RELEASE}" REQUIRED NO_DEFAULT_PATH) diff --git a/indra/cmake/OpenXR.cmake b/indra/cmake/OpenXR.cmake index 2cc862b9277..7cc1be634b4 100644 --- a/indra/cmake/OpenXR.cmake +++ b/indra/cmake/OpenXR.cmake @@ -5,18 +5,21 @@ include(Prebuilt) include_guard() add_library( ll::openxr INTERFACE IMPORTED ) -if(USE_CONAN ) - target_link_libraries( ll::openxr INTERFACE CONAN_PKG::openxr ) - return() -endif() +option(USE_OPENXR "Enable building with OpenXR support" OFF) +if(USE_OPENXR) + if(USE_CONAN ) + target_link_libraries( ll::openxr INTERFACE CONAN_PKG::openxr ) + return() + endif() -use_prebuilt_binary(openxr) -if (WINDOWS) - target_link_libraries( ll::openxr INTERFACE ${ARCH_PREBUILT_DIRS_RELEASE}/openxr_loader.lib ) -else() - target_link_libraries( ll::openxr INTERFACE ${ARCH_PREBUILT_DIRS_RELEASE}/libopenxr_loader.a ) -endif (WINDOWS) + use_prebuilt_binary(openxr) + if (WINDOWS) + target_link_libraries( ll::openxr INTERFACE ${ARCH_PREBUILT_DIRS_RELEASE}/openxr_loader.lib ) + else() + target_link_libraries( ll::openxr INTERFACE ${ARCH_PREBUILT_DIRS_RELEASE}/libopenxr_loader.a ) + endif (WINDOWS) -if( NOT LINUX ) - target_include_directories( ll::openxr SYSTEM INTERFACE ${LIBS_PREBUILT_DIR}/include) + if( NOT LINUX ) + target_include_directories( ll::openxr SYSTEM INTERFACE ${LIBS_PREBUILT_DIR}/include) + endif() endif() diff --git a/indra/cmake/PNG.cmake b/indra/cmake/PNG.cmake index 0c01e5ee78f..6a66f40385e 100644 --- a/indra/cmake/PNG.cmake +++ b/indra/cmake/PNG.cmake @@ -1,5 +1,7 @@ # -*- cmake -*- include(Prebuilt) +include(Linking) +include(ZLIBNG) include_guard() add_library( ll::libpng INTERFACE IMPORTED ) @@ -13,5 +15,5 @@ find_library(LIBPNG_LIBRARY libpng16.a PATHS "${ARCH_PREBUILT_DIRS_RELEASE}" REQUIRED NO_DEFAULT_PATH) -target_link_libraries(ll::libpng INTERFACE ${LIBPNG_LIBRARY}) +target_link_libraries(ll::libpng INTERFACE ${LIBPNG_LIBRARY} ll::zlib-ng) target_include_directories(ll::libpng SYSTEM INTERFACE ${LIBS_PREBUILT_DIR}/include/libpng16) diff --git a/indra/cmake/Prebuilt.cmake b/indra/cmake/Prebuilt.cmake index 634cc15c21c..d0ab341d949 100644 --- a/indra/cmake/Prebuilt.cmake +++ b/indra/cmake/Prebuilt.cmake @@ -2,9 +2,6 @@ include_guard() include(FindAutobuild) -if(INSTALL_PROPRIETARY) - include(FindSCP) -endif(INSTALL_PROPRIETARY) set(PREBUILD_TRACKING_DIR ${AUTOBUILD_INSTALL_DIR}/cmake_tracking) # For the library installation process; @@ -40,8 +37,10 @@ macro (use_prebuilt_binary _binary) --install-dir=${AUTOBUILD_INSTALL_DIR} ${_binary} ") endif(DEBUG_PREBUILT) + message(STATUS "Installing ${_binary}...") execute_process(COMMAND "${AUTOBUILD_EXECUTABLE}" install + --skip-source-environment --install-dir=${AUTOBUILD_INSTALL_DIR} ${_binary} WORKING_DIRECTORY "${CMAKE_SOURCE_DIR}" diff --git a/indra/cmake/Python.cmake b/indra/cmake/Python.cmake index 7cce190f6a5..39fd21c33f8 100644 --- a/indra/cmake/Python.cmake +++ b/indra/cmake/Python.cmake @@ -13,7 +13,7 @@ elseif (WINDOWS) foreach(hive HKEY_CURRENT_USER HKEY_LOCAL_MACHINE) # prefer more recent Python versions to older ones, if multiple versions # are installed - foreach(pyver 3.13 3.12 3.11 3.10 3.9 3.8 3.7) + foreach(pyver 3.14 3.13 3.12 3.11 3.10 3.9 3.8 3.7) list(APPEND regpaths "[${hive}\\SOFTWARE\\Python\\PythonCore\\${pyver}\\InstallPath]") endforeach() endforeach() diff --git a/indra/cmake/SDL3.cmake b/indra/cmake/SDL3.cmake new file mode 100644 index 00000000000..fe9012de171 --- /dev/null +++ b/indra/cmake/SDL3.cmake @@ -0,0 +1,26 @@ +# -*- cmake -*- +include_guard() +include(Linking) +include(Prebuilt) + +add_library(ll::SDL3 INTERFACE IMPORTED) + +if (LINUX) + set(USE_SDL_WINDOW ON CACHE BOOL "Build with SDL window backend") +else() + set(USE_SDL_WINDOW OFF CACHE BOOL "Build with SDL window backend") +endif (LINUX) + +if(USE_SDL_WINDOW) + use_system_binary(SDL3) + use_prebuilt_binary(SDL3) + + find_library( SDL3_LIBRARY + NAMES SDL3 SDL3.lib libSDL3.so libSDL3.dylib + PATHS "${LIBS_PREBUILT_DIR}/lib/release" REQUIRED) + + target_link_libraries(ll::SDL3 INTERFACE ${SDL3_LIBRARY}) + target_include_directories(ll::SDL3 SYSTEM INTERFACE "${LIBS_PREBUILT_DIR}/include/") + +endif(USE_SDL_WINDOW) + diff --git a/indra/cmake/UI.cmake b/indra/cmake/UI.cmake index 8f135676d6a..f2776b21e15 100644 --- a/indra/cmake/UI.cmake +++ b/indra/cmake/UI.cmake @@ -1,35 +1,42 @@ # -*- cmake -*- include(Prebuilt) include(FreeType) +include(GLIB) +include_guard() add_library( ll::uilibraries INTERFACE IMPORTED ) if (LINUX) - target_compile_definitions(ll::uilibraries INTERFACE LL_GTK=1 LL_X11=1 ) - if( USE_CONAN ) - target_link_libraries( ll::uilibraries INTERFACE CONAN_PKG::gtk ) return() endif() - use_prebuilt_binary(gtk-atk-pango-glib) + + find_package(PkgConfig REQUIRED) + pkg_check_modules(WAYLAND_CLIENT wayland-client) + + if(WAYLAND_CLIENT_FOUND) + target_include_directories(ll::uilibraries INTERFACE ${WAYLAND_CLIENT_INCLUDE_DIRS}) + target_compile_definitions(ll::uilibraries INTERFACE LL_WAYLAND=1) + else() + message("pkgconfig could not find wayland client, compiling without full wayland support") + endif() + + find_package(X11) + if(X11_FOUND) + target_compile_definitions(ll::uilibraries INTERFACE LL_X11=1) + else() + message("Could not find X11, compiling without full X11 support") + endif() + target_link_libraries( ll::uilibraries INTERFACE - atk-1.0 - gdk-x11-2.0 - gdk_pixbuf-2.0 - Xinerama - glib-2.0 - gmodule-2.0 - gobject-2.0 - gthread-2.0 - gtk-x11-2.0 - pango-1.0 - pangoft2-1.0 - pangox-1.0 - pangoxft-1.0 - Xinerama + ll::fontconfig ll::freetype - ) + ll::SDL3 + ll::glib + ll::gio + ) + endif (LINUX) if( WINDOWS ) target_link_libraries( ll::uilibraries INTERFACE diff --git a/indra/cmake/Variables.cmake b/indra/cmake/Variables.cmake index 22c2156bb88..81a8f87cd37 100644 --- a/indra/cmake/Variables.cmake +++ b/indra/cmake/Variables.cmake @@ -9,21 +9,51 @@ # LINUX - Linux # WINDOWS - Windows +include_guard() + # 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 "" AND "${LL_BUILD_ENV}" STREQUAL "" ) - message(FATAL_ERROR "Environment variable LL_BUILD must be set") -elseif("$ENV{LL_BUILD}" STREQUAL "") - set( ENV{LL_BUILD} "${LL_BUILD_ENV}" ) - message( "Setting ENV{LL_BUILD} to cached variable ${LL_BUILD_ENV}" ) +if ("$ENV{AUTOBUILD_ADDRSIZE}" STREQUAL "" AND "${AUTOBUILD_ADDRSIZE_ENV}" STREQUAL "" ) + message(FATAL_ERROR "Environment variable AUTOBUILD_ADDRSIZE must be set") +elseif("$ENV{AUTOBUILD_ADDRSIZE}" STREQUAL "") + set( ENV{AUTOBUILD_ADDRSIZE} "${AUTOBUILD_ADDRSIZE_ENV}" ) + message( "Setting ENV{AUTOBUILD_ADDRSIZE} to cached variable ${AUTOBUILD_ADDRSIZE_ENV}" ) else() - set( LL_BUILD_ENV "$ENV{LL_BUILD}" CACHE STRING "Save environment" FORCE ) + set( AUTOBUILD_ADDRSIZE_ENV "$ENV{AUTOBUILD_ADDRSIZE}" CACHE STRING "Save environment AUTOBUILD_ADDRSIZE" FORCE ) endif () -include_guard() -# Relative and absolute paths to subtrees. +if ("$ENV{AUTOBUILD_PLATFORM}" STREQUAL "" AND "${AUTOBUILD_PLATFORM_ENV}" STREQUAL "" ) + message(FATAL_ERROR "Environment variable AUTOBUILD_PLATFORM must be set") +elseif("$ENV{AUTOBUILD_PLATFORM}" STREQUAL "") + set( ENV{AUTOBUILD_PLATFORM} "${AUTOBUILD_PLATFORM_ENV}" ) + message( "Setting ENV{AUTOBUILD_PLATFORM} to cached variable ${AUTOBUILD_PLATFORM_ENV}" ) +else() + set( AUTOBUILD_PLATFORM_ENV "$ENV{AUTOBUILD_PLATFORM}" CACHE STRING "Save environment AUTOBUILD_PLATFORM" FORCE ) +endif () +# 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_RELEASE}" STREQUAL "" AND "${LL_BUILD_RELEASE_ENV}" STREQUAL "" ) + message(FATAL_ERROR "Environment variable LL_BUILD_RELEASE must be set") +elseif("$ENV{LL_BUILD_RELEASE}" STREQUAL "") + set( ENV{LL_BUILD_RELEASE} "${LL_BUILD_RELEASE_ENV}" ) + message( "Setting ENV{LL_BUILD_RELEASE} to cached variable ${LL_BUILD_RELEASE_ENV}" ) +else() + set( LL_BUILD_RELEASE_ENV "$ENV{LL_BUILD_RELEASE}" CACHE STRING "Save environment RELEASE" FORCE ) +endif () + +if ("$ENV{LL_BUILD_RELWITHDEBINFO}" STREQUAL "" AND "${LL_BUILD_RELWITHDEBINFO_ENV}" STREQUAL "" ) + message(FATAL_ERROR "Environment variable LL_BUILD_RELWITHDEBINFO must be set") +elseif("$ENV{LL_BUILD_RELWITHDEBINFO}" STREQUAL "") + set( ENV{LL_BUILD_RELWITHDEBINFO} "${LL_BUILD_RELWITHDEBINFO_ENV}" ) + message( "Setting ENV{LL_BUILD_RELWITHDEBINFO} to cached variable ${LL_BUILD_RELWITHDEBINFO_ENV}" ) +else() + set( LL_BUILD_RELWITHDEBINFO_ENV "$ENV{LL_BUILD_RELWITHDEBINFO}" CACHE STRING "Save environment RELWITHDEBINFO" FORCE ) +endif () + +# Relative and absolute paths to subtrees. if(NOT DEFINED COMMON_CMAKE_DIR) set(COMMON_CMAKE_DIR "${CMAKE_SOURCE_DIR}/cmake") endif(NOT DEFINED COMMON_CMAKE_DIR) @@ -67,7 +97,7 @@ set(TEMPLATE_VERIFIER_MASTER_URL "https://github.com/secondlife/master-message-t if (NOT CMAKE_BUILD_TYPE) set(CMAKE_BUILD_TYPE RelWithDebInfo CACHE STRING - "Build type. One of: Debug Release RelWithDebInfo" FORCE) + "Build type. One of: Release RelWithDebInfo" FORCE) endif (NOT CMAKE_BUILD_TYPE) # If someone has specified an address size, use that to determine the @@ -127,16 +157,12 @@ if (${CMAKE_SYSTEM_NAME} MATCHES "Linux") set(CMAKE_SYSTEM_LIBRARY_PATH /usr/lib/${DPKG_ARCH} /usr/local/lib/${DPKG_ARCH} ${CMAKE_SYSTEM_LIBRARY_PATH}) endif (DPKG_RESULT EQUAL 0) - include(ConfigurePkgConfig) - - if (INSTALL_PROPRIETARY) - # Only turn on headless if we can find osmesa libraries. - include(FindPkgConfig) - #pkg_check_modules(OSMESA osmesa) - #if (OSMESA_FOUND) - # set(BUILD_HEADLESS ON CACHE BOOL "Build headless libraries.") - #endif (OSMESA_FOUND) - endif (INSTALL_PROPRIETARY) + # Only turn on headless if we can find osmesa libraries. + find_package(PkgConfig) + pkg_check_modules(OSMESA IMPORTED_TARGET GLOBAL osmesa) + if (OSMESA_FOUND) + set(BUILD_HEADLESS ON CACHE BOOL "Build headless libraries.") + endif (OSMESA_FOUND) endif (${CMAKE_SYSTEM_NAME} MATCHES "Linux") @@ -172,6 +198,11 @@ if (${CMAKE_SYSTEM_NAME} MATCHES "Darwin") set(CMAKE_XCODE_ATTRIBUTE_DISABLE_MANUAL_TARGET_ORDER_BUILD_WARNING YES) set(CMAKE_XCODE_ATTRIBUTE_GCC_WARN_64_TO_32_BIT_CONVERSION NO) set(CMAKE_OSX_ARCHITECTURES "arm64;x86_64" CACHE STRING "macOS Build Arch" FORCE) + if(CMAKE_SYSTEM_PROCESSOR STREQUAL "arm64") + set(LL_MACOS_TEST_ARCHITECTURE "arm64") + else() + set(LL_MACOS_TEST_ARCHITECTURE "x86_64") + endif() endif (${CMAKE_SYSTEM_NAME} MATCHES "Darwin") # Default deploy grid diff --git a/indra/cmake/ViewerMiscLibs.cmake b/indra/cmake/ViewerMiscLibs.cmake index cae68fbc119..23fd477ba89 100644 --- a/indra/cmake/ViewerMiscLibs.cmake +++ b/indra/cmake/ViewerMiscLibs.cmake @@ -5,11 +5,8 @@ if (LINUX) #use_prebuilt_binary(libuuid) add_library( ll::fontconfig INTERFACE IMPORTED ) - if( NOT USE_CONAN ) - use_prebuilt_binary(fontconfig) - else() - target_link_libraries( ll::fontconfig INTERFACE CONAN_PKG::fontconfig ) - endif() + find_package(Fontconfig REQUIRED) + target_link_libraries( ll::fontconfig INTERFACE Fontconfig::Fontconfig ) endif (LINUX) if( NOT USE_CONAN ) diff --git a/indra/cmake/ZLIBNG.cmake b/indra/cmake/ZLIBNG.cmake index a6d67489e71..9f8f12d973a 100644 --- a/indra/cmake/ZLIBNG.cmake +++ b/indra/cmake/ZLIBNG.cmake @@ -1,6 +1,7 @@ # -*- cmake -*- include(Prebuilt) +include(Linking) include_guard() add_library( ll::zlib-ng INTERFACE IMPORTED ) diff --git a/indra/cmake/bugsplat.cmake b/indra/cmake/bugsplat.cmake index 509981d72cd..0ba12e68ebc 100644 --- a/indra/cmake/bugsplat.cmake +++ b/indra/cmake/bugsplat.cmake @@ -1,18 +1,19 @@ -if (INSTALL_PROPRIETARY) +if (INSTALL_PROPRIETARY AND NOT LINUX) # Note that viewer_manifest.py makes decision based on BUGSPLAT_DB and not USE_BUGSPLAT if (BUGSPLAT_DB) set(USE_BUGSPLAT ON CACHE BOOL "Use the BugSplat crash reporting system") else (BUGSPLAT_DB) set(USE_BUGSPLAT OFF CACHE BOOL "Use the BugSplat crash reporting system") endif (BUGSPLAT_DB) -else (INSTALL_PROPRIETARY) +else () set(USE_BUGSPLAT OFF CACHE BOOL "Use the BugSplat crash reporting system") -endif (INSTALL_PROPRIETARY) + set(BUGSPLAT_DB "" CACHE STRING "BugSplat crash database name") +endif () include_guard() add_library( ll::bugsplat INTERFACE IMPORTED ) -if (USE_BUGSPLAT) +if (USE_BUGSPLAT AND NOT LINUX) include(Prebuilt) use_prebuilt_binary(bugsplat) if (WINDOWS) @@ -23,8 +24,14 @@ if (USE_BUGSPLAT) elseif (DARWIN) find_library(BUGSPLAT_LIBRARIES BugsplatMac REQUIRED NO_DEFAULT_PATH PATHS "${ARCH_PREBUILT_DIRS_RELEASE}") + find_library(CRASHREPORTED_LIBRARIES CrashReporter REQUIRED + NO_DEFAULT_PATH PATHS "${ARCH_PREBUILT_DIRS_RELEASE}") + find_library(HOCKEYSDK_LIBRARIES HockeySDK REQUIRED + NO_DEFAULT_PATH PATHS "${ARCH_PREBUILT_DIRS_RELEASE}") target_link_libraries( ll::bugsplat INTERFACE ${BUGSPLAT_LIBRARIES} + ${CRASHREPORTED_LIBRARIES} + ${HOCKEYSDK_LIBRARIES} ) else (WINDOWS) message(FATAL_ERROR "BugSplat is not supported; add -DUSE_BUGSPLAT=OFF") @@ -36,6 +43,7 @@ if (USE_BUGSPLAT) set_property( TARGET ll::bugsplat APPEND PROPERTY INTERFACE_COMPILE_DEFINITIONS LL_BUGSPLAT) else() - set(BUGSPLAT_DB "" CACHE STRING "BugSplat crash database name") -endif (USE_BUGSPLAT) + set(USE_BUGSPLAT OFF CACHE BOOL "Use the BugSplat crash reporting system" FORCE) + set(BUGSPLAT_DB "" CACHE STRING "BugSplat crash database name" FORCE) +endif () diff --git a/indra/cmake/run_build_test.py b/indra/cmake/run_build_test.py index 940a130a504..85689b361ae 100755 --- a/indra/cmake/run_build_test.py +++ b/indra/cmake/run_build_test.py @@ -133,7 +133,7 @@ def main(command, arguments=[], libpath=[], vars={}): raise # In practice, the pathnames into CMake's build tree are so long as to # obscure the name of the test program. Just log its basename. - log.warn("No such program %s; check for preceding build errors" % \ + log.warning("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. diff --git a/indra/cmake/websocketpp.cmake b/indra/cmake/websocketpp.cmake new file mode 100644 index 00000000000..726f0a5e0b4 --- /dev/null +++ b/indra/cmake/websocketpp.cmake @@ -0,0 +1,7 @@ +# -*- cmake -*- +include(Prebuilt) + +add_library( ll::websocketpp INTERFACE IMPORTED ) + +use_system_binary( websocketpp ) +use_prebuilt_binary(websocketpp) diff --git a/indra/integration_tests/llimage_libtest/CMakeLists.txt b/indra/integration_tests/llimage_libtest/CMakeLists.txt index e6ff142626c..40837c8abba 100644 --- a/indra/integration_tests/llimage_libtest/CMakeLists.txt +++ b/indra/integration_tests/llimage_libtest/CMakeLists.txt @@ -9,7 +9,6 @@ include(00-Common) include(LLCommon) include(LLImage) include(LLMath) -include(LLKDU) set(llimage_libtest_SOURCE_FILES llimage_libtest.cpp @@ -26,6 +25,18 @@ add_executable(llimage_libtest ${llimage_libtest_SOURCE_FILES} ) +set_target_properties(llimage_libtest + PROPERTIES + FOLDER "Tests" + ) + +if(DARWIN) + set_target_properties(llimage_libtest + PROPERTIES + OSX_ARCHITECTURES ${LL_MACOS_TEST_ARCHITECTURE} + ) +endif() + # Libraries on which this application depends on # Sort by high-level to low-level target_link_libraries(llimage_libtest diff --git a/indra/integration_tests/llimage_libtest/llimage_libtest.cpp b/indra/integration_tests/llimage_libtest/llimage_libtest.cpp index c45bd6fd01a..b82ced2f8df 100644 --- a/indra/integration_tests/llimage_libtest/llimage_libtest.cpp +++ b/indra/integration_tests/llimage_libtest/llimage_libtest.cpp @@ -329,7 +329,7 @@ class LogThread : public LLThread void run() { - std::ofstream os(mFile.c_str()); + llofstream os(mFile.c_str()); while (!sAllDone) { @@ -345,6 +345,11 @@ class LogThread : public LLThread int main(int argc, char** argv) { + // Call Tracy first thing to have it allocate memory + // https://github.com/wolfpld/tracy/issues/196 + LL_PROFILER_FRAME_END; + LL_PROFILER_SET_THREAD_NAME("App"); + // List of input and output files std::list input_filenames; std::list output_filenames; diff --git a/indra/integration_tests/llui_libtest/CMakeLists.txt b/indra/integration_tests/llui_libtest/CMakeLists.txt index a6ce657f4f3..19ae1ae2159 100644 --- a/indra/integration_tests/llui_libtest/CMakeLists.txt +++ b/indra/integration_tests/llui_libtest/CMakeLists.txt @@ -49,9 +49,14 @@ target_link_libraries(llui_libtest llimagej2coj ) +set_target_properties(llui_libtest + PROPERTIES + FOLDER "Tests" + ) + if (WINDOWS) set_target_properties(llui_libtest - PROPERTIES + PROPERTIES LINK_FLAGS "/NODEFAULTLIB:LIBCMT" ) @@ -66,6 +71,13 @@ if (WINDOWS) ) endif (WINDOWS) +if(DARWIN) + set_target_properties(llui_libtest + PROPERTIES + OSX_ARCHITECTURES ${LL_MACOS_TEST_ARCHITECTURE} + ) +endif() + # Ensure people working on the viewer don't break this library # *NOTE: This could be removed, or only built by Parabuild, if the build # and link times become too long. JC diff --git a/indra/linux_crash_logger/CMakeLists.txt b/indra/linux_crash_logger/CMakeLists.txt deleted file mode 100644 index 1793aa82b99..00000000000 --- a/indra/linux_crash_logger/CMakeLists.txt +++ /dev/null @@ -1,72 +0,0 @@ -# -*- cmake -*- - -project(linux_crash_logger) - -include(00-Common) -include(GLH) -include(LLCoreHttp) -include(LLCommon) -include(LLCrashLogger) -include(LLMath) -include(LLMessage) -include(LLFileSystem) -include(LLXML) -include(Linking) -include(UI) -include(FreeType) -include(Boost) - -include_directories( - ${LLCOREHTTP_INCLUDE_DIRS} - ${LLCOMMON_INCLUDE_DIRS} - ${LLCRASHLOGGER_INCLUDE_DIRS} - ${LLMATH_INCLUDE_DIRS} - ${LLFILESYSTEM_INCLUDE_DIRS} - ${LLXML_INCLUDE_DIRS} - ${FREETYPE_INCLUDE_DIRS} - ) -include_directories(SYSTEM - ${LLCOMMON_SYSTEM_INCLUDE_DIRS} - ${LLXML_SYSTEM_INCLUDE_DIRS} - ) -include_directories(SYSTEM - ${LLCOMMON_SYSTEM_INCLUDE_DIRS} - ${LLXML_SYSTEM_INCLUDE_DIRS} - ) - -set(linux_crash_logger_SOURCE_FILES - linux_crash_logger.cpp - llcrashloggerlinux.cpp - ) - -set(linux_crash_logger_HEADER_FILES - CMakeLists.txt - - llcrashloggerlinux.h - ) - -list(APPEND linux_crash_logger_SOURCE_FILES - ${linux_crash_logger_HEADER_FILES} - ) - -set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} -Wl,--as-needed") - -add_executable(linux-crash-logger ${linux_crash_logger_SOURCE_FILES}) - -# llcommon uses `clock_gettime' which is provided by librt on linux. -set(LIBRT_LIBRARY rt) - - -target_link_libraries(linux-crash-logger - llcrashlogger - llfilesystem - llxml - llmessage - llmath - llcorehttp - llcommon - ll::uilibraries - ) - -add_custom_target(linux-crash-logger-target ALL - DEPENDS linux-crash-logger) diff --git a/indra/linux_crash_logger/README.txt b/indra/linux_crash_logger/README.txt deleted file mode 100644 index 6932a8d9c31..00000000000 --- a/indra/linux_crash_logger/README.txt +++ /dev/null @@ -1,3 +0,0 @@ -This component is no longer used in Linden Lab builds. -Change requests to support continued use by open source -builds are welcome. diff --git a/indra/linux_crash_logger/linux_crash_logger.cpp b/indra/linux_crash_logger/linux_crash_logger.cpp deleted file mode 100644 index b36312c607e..00000000000 --- a/indra/linux_crash_logger/linux_crash_logger.cpp +++ /dev/null @@ -1,58 +0,0 @@ -/** - * @file linux_crash_logger.cpp - * @brief Linux crash logger implementation - * - * $LicenseInfo:firstyear=2003&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 "linden_common.h" -#include "llcrashloggerlinux.h" -#include "llsdutil.h" - -int main(int argc, char **argv) -{ - LL_INFOS() << "Starting crash reporter." << LL_ENDL; - - LLCrashLoggerLinux app; - app.parseCommandOptions(argc, argv); - - LLSD options = LLApp::instance()->getOptionData( - LLApp::PRIORITY_COMMAND_LINE); - //LLApp::PRIORITY_RUNTIME_OVERRIDE); - - - if (!(options.has("pid") && options.has("dumpdir"))) - { - LL_WARNS() << "Insufficient parameters to crash report." << LL_ENDL; - } - - if (! app.init()) - { - LL_WARNS() << "Unable to initialize application." << LL_ENDL; - return 1; - } - - app.frame(); - app.cleanup(); - LL_INFOS() << "Crash reporter finished normally." << LL_ENDL; - return 0; -} diff --git a/indra/linux_crash_logger/llcrashloggerlinux.cpp b/indra/linux_crash_logger/llcrashloggerlinux.cpp deleted file mode 100644 index 9b40de741e7..00000000000 --- a/indra/linux_crash_logger/llcrashloggerlinux.cpp +++ /dev/null @@ -1,146 +0,0 @@ -/** - * @file llcrashloggerlinux.cpp - * @brief Linux crash logger implementation - * - * $LicenseInfo:firstyear=2003&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 "llcrashloggerlinux.h" - -#include - -#include "linden_common.h" - -#include "indra_constants.h" // CRASH_BEHAVIOR_ASK, CRASH_SETTING_NAME -#include "llerror.h" -#include "llfile.h" -#include "lltimer.h" -#include "llstring.h" -#include "lldir.h" -#include "llsdserialize.h" - -#if LL_GTK -# include "gtk/gtk.h" -#endif // LL_GTK - -#define MAX_LOADSTRING 100 - -// These need to be localized. -static const char dialog_text[] = -"Second Life appears to have crashed or frozen last time it ran.\n" -"This crash reporter collects information about your computer's hardware, operating system, and some Second Life logs, all of which are used for debugging purposes only.\n" -"\n" -"Send crash report?"; - -static const char dialog_title[] = -"Second Life Crash Logger"; - -#if LL_GTK -static void response_callback (GtkDialog *dialog, - gint arg1, - gpointer user_data) -{ - gint *response = (gint*)user_data; - *response = arg1; - gtk_widget_destroy(GTK_WIDGET(dialog)); - gtk_main_quit(); -} -#endif // LL_GTK - -static BOOL do_ask_dialog(void) -{ -#if LL_GTK - gtk_disable_setlocale(); - if (!gtk_init_check(NULL, NULL)) { - LL_INFOS() << "Could not initialize GTK for 'ask to send crash report' dialog; not sending report." << LL_ENDL; - return FALSE; - } - - GtkWidget *win = NULL; - GtkDialogFlags flags = GTK_DIALOG_MODAL; - GtkMessageType messagetype = GTK_MESSAGE_QUESTION; - GtkButtonsType buttons = GTK_BUTTONS_YES_NO; - gint response = GTK_RESPONSE_NONE; - - win = gtk_message_dialog_new(NULL, - flags, messagetype, buttons, - "%s", dialog_text); - gtk_window_set_type_hint(GTK_WINDOW(win), - GDK_WINDOW_TYPE_HINT_DIALOG); - gtk_window_set_title(GTK_WINDOW(win), dialog_title); - g_signal_connect (win, - "response", - G_CALLBACK (response_callback), - &response); - gtk_widget_show_all (win); - gtk_main(); - - return (GTK_RESPONSE_OK == response || - GTK_RESPONSE_YES == response || - GTK_RESPONSE_APPLY == response); -#else - return FALSE; -#endif // LL_GTK -} - -LLCrashLoggerLinux::LLCrashLoggerLinux(void) -{ -} - -LLCrashLoggerLinux::~LLCrashLoggerLinux(void) -{ -} - -void LLCrashLoggerLinux::gatherPlatformSpecificFiles() -{ -} - -bool LLCrashLoggerLinux::frame() -{ - bool send_logs = true; - if(CRASH_BEHAVIOR_ASK == getCrashBehavior()) - { - send_logs = do_ask_dialog(); - } - else if(CRASH_BEHAVIOR_NEVER_SEND == getCrashBehavior()) - { - send_logs = false; - } - - if(send_logs) - { - sendCrashLogs(); - } - return true; -} - -bool LLCrashLoggerLinux::cleanup() -{ - commonCleanup(); - mKeyMaster.releaseMaster(); - return true; -} - -void LLCrashLoggerLinux::updateApplication(const std::string& message) -{ - LLCrashLogger::updateApplication(message); -} diff --git a/indra/llappearance/CMakeLists.txt b/indra/llappearance/CMakeLists.txt index 6744c8d8a44..5b6d68fa377 100644 --- a/indra/llappearance/CMakeLists.txt +++ b/indra/llappearance/CMakeLists.txt @@ -28,7 +28,7 @@ set(llappearance_SOURCE_FILES llviewervisualparam.cpp llavatarappearancedefines.cpp ) - + set(llappearance_HEADER_FILES CMakeLists.txt @@ -69,6 +69,10 @@ target_link_libraries(llappearance ) target_include_directories( llappearance INTERFACE ${CMAKE_CURRENT_SOURCE_DIR}) +if (USE_PRECOMPILED_HEADERS) + target_precompile_headers(llappearance REUSE_FROM llprecompiled) +endif () + if (BUILD_HEADLESS) add_library (llappearanceheadless ${llappearance_SOURCE_FILES}) target_include_directories( llappearanceheadless INTERFACE ${CMAKE_CURRENT_SOURCE_DIR}) @@ -77,6 +81,7 @@ if (BUILD_HEADLESS) llcharacter llinventory llimage + llrenderheadless llfilesystem llmath llxml @@ -84,4 +89,8 @@ if (BUILD_HEADLESS) llcorehttp llcommon ) + + if (USE_PRECOMPILED_HEADERS) + target_precompile_headers(llappearanceheadless REUSE_FROM llprecompiled) + endif () endif (BUILD_HEADLESS) diff --git a/indra/llappearance/llavatarappearancedefines.cpp b/indra/llappearance/llavatarappearancedefines.cpp index 47798844bce..f26795123f3 100644 --- a/indra/llappearance/llavatarappearancedefines.cpp +++ b/indra/llappearance/llavatarappearancedefines.cpp @@ -260,7 +260,7 @@ ETextureIndex LLAvatarAppearanceDictionary::bakedToLocalTextureIndex(EBakedTextu return getBakedTexture(index)->mTextureIndex; } -EBakedTextureIndex LLAvatarAppearanceDictionary::findBakedByRegionName(std::string name) +EBakedTextureIndex LLAvatarAppearanceDictionary::findBakedByRegionName(const std::string& name) const { U8 index = 0; while (index < BAKED_NUM_INDICES) @@ -277,7 +277,7 @@ EBakedTextureIndex LLAvatarAppearanceDictionary::findBakedByRegionName(std::stri return BAKED_NUM_INDICES; } -EBakedTextureIndex LLAvatarAppearanceDictionary::findBakedByImageName(std::string name) +EBakedTextureIndex LLAvatarAppearanceDictionary::findBakedByImageName(const std::string& name) const { U8 index = 0; while (index < BAKED_NUM_INDICES) diff --git a/indra/llappearance/llavatarappearancedefines.h b/indra/llappearance/llavatarappearancedefines.h index 50a72a45a5a..0f9edc1ca0d 100644 --- a/indra/llappearance/llavatarappearancedefines.h +++ b/indra/llappearance/llavatarappearancedefines.h @@ -238,8 +238,8 @@ class LLAvatarAppearanceDictionary ETextureIndex bakedToLocalTextureIndex(EBakedTextureIndex t) const; // find a baked texture index based on its name - EBakedTextureIndex findBakedByRegionName(std::string name); - EBakedTextureIndex findBakedByImageName(std::string name); + EBakedTextureIndex findBakedByRegionName(const std::string& name) const; + EBakedTextureIndex findBakedByImageName(const std::string& name) const; // Given a texture entry, determine which wearable type owns it. LLWearableType::EType getTEWearableType(ETextureIndex index) const; diff --git a/indra/llappearance/llavatarjoint.h b/indra/llappearance/llavatarjoint.h index 13f025fd5f2..71fe4b61b6c 100644 --- a/indra/llappearance/llavatarjoint.h +++ b/indra/llappearance/llavatarjoint.h @@ -41,9 +41,10 @@ extern const F32 DEFAULT_AVATAR_JOINT_LOD; //----------------------------------------------------------------------------- // class LLViewerJoint //----------------------------------------------------------------------------- -class LLAvatarJoint : +class alignas(16) LLAvatarJoint : public LLJoint { + LL_ALIGN_NEW public: LLAvatarJoint(); LLAvatarJoint(S32 joint_num); @@ -121,8 +122,9 @@ class LLAvatarJoint : S32 mMeshID; }; -class LLAvatarJointCollisionVolume : public LLAvatarJoint +class alignas(16) LLAvatarJointCollisionVolume : public LLAvatarJoint { + LL_ALIGN_NEW public: LLAvatarJointCollisionVolume(); virtual ~LLAvatarJointCollisionVolume() {}; diff --git a/indra/llappearance/llavatarjointmesh.h b/indra/llappearance/llavatarjointmesh.h index 33f50fce00c..153a2b88fef 100644 --- a/indra/llappearance/llavatarjointmesh.h +++ b/indra/llappearance/llavatarjointmesh.h @@ -59,8 +59,9 @@ class LLSkinJoint //----------------------------------------------------------------------------- // class LLViewerJointMesh //----------------------------------------------------------------------------- -class LLAvatarJointMesh : public virtual LLAvatarJoint +class alignas(16) LLAvatarJointMesh : public virtual LLAvatarJoint { + LL_ALIGN_NEW protected: LLColor4 mColor; // color value // LLColor4 mSpecular; // specular color (always white for now) diff --git a/indra/llappearance/lldriverparam.h b/indra/llappearance/lldriverparam.h index 59092988ddc..df8733dde7a 100644 --- a/indra/llappearance/lldriverparam.h +++ b/indra/llappearance/lldriverparam.h @@ -128,7 +128,7 @@ class alignas(16) LLDriverParam : public LLViewerVisualParam void setDrivenWeight(LLDrivenEntry* driven, F32 driven_weight); - LL_ALIGN_16(LLVector4a mDefaultVec); // temp holder + LLVector4a mDefaultVec; // temp holder entry_list_t mDriven; LLViewerVisualParam* mCurrentDistortionParam{ nullptr }; // Backlink only; don't make this an LLPointer. diff --git a/indra/llappearance/llpolymorph.h b/indra/llappearance/llpolymorph.h index 8c76689f2cd..64434bd5d99 100644 --- a/indra/llappearance/llpolymorph.h +++ b/indra/llappearance/llpolymorph.h @@ -71,7 +71,7 @@ class alignas(16) LLPolyMorphData private: void freeData(); -} LL_ALIGN_POSTFIX(16); +}; //----------------------------------------------------------------------------- diff --git a/indra/llappearance/llpolyskeletaldistortion.h b/indra/llappearance/llpolyskeletaldistortion.h index 9ba4cf66e90..37f35d50ba1 100644 --- a/indra/llappearance/llpolyskeletaldistortion.h +++ b/indra/llappearance/llpolyskeletaldistortion.h @@ -111,13 +111,13 @@ class alignas(16) LLPolySkeletalDistortion : public LLViewerVisualParam protected: LLPolySkeletalDistortion(const LLPolySkeletalDistortion& pOther); - LL_ALIGN_16(LLVector4a mDefaultVec); + LLVector4a mDefaultVec; typedef std::map joint_vec_map_t; joint_vec_map_t mJointScales; joint_vec_map_t mJointOffsets; // Backlink only; don't make this an LLPointer. LLAvatarAppearance *mAvatar; -} LL_ALIGN_POSTFIX(16); +}; #endif // LL_LLPOLYSKELETALDISTORTION_H diff --git a/indra/llappearance/lltexlayer.cpp b/indra/llappearance/lltexlayer.cpp index 7f7eaf18554..1bdaa814b7b 100644 --- a/indra/llappearance/lltexlayer.cpp +++ b/indra/llappearance/lltexlayer.cpp @@ -435,6 +435,31 @@ const std::string LLTexLayerSet::getBodyRegionName() const return mInfo->mBodyRegion; } +// virtual +void LLTexLayerSet::asLLSD(LLSD& sd) const +{ + sd["visible"] = LLSD::Boolean(isVisible()); + LLSD layer_list_sd; + layer_list_t::const_iterator layer_iter = mLayerList.begin(); + layer_list_t::const_iterator layer_end = mLayerList.end(); + for(; layer_iter != layer_end; ++layer_iter) + { + LLSD layer_sd; + LLTexLayerInterface* layer = (*layer_iter); + if (layer) + { + layer->asLLSD(layer_sd); + } + layer_list_sd.append(layer_sd); + } + LLSD mask_list_sd; + LLSD info_sd; + sd["layers"] = layer_list_sd; + sd["masks"] = mask_list_sd; + sd["info"] = info_sd; +} + + void LLTexLayerSet::destroyComposite() { if( mComposite ) diff --git a/indra/llappearance/lltexlayer.h b/indra/llappearance/lltexlayer.h index 876ea6f6007..6b501474d68 100644 --- a/indra/llappearance/lltexlayer.h +++ b/indra/llappearance/lltexlayer.h @@ -220,6 +220,8 @@ class LLTexLayerSet static bool sHasCaches; + virtual void asLLSD(LLSD& sd) const; + protected: typedef std::vector layer_list_t; layer_list_t mLayerList; diff --git a/indra/llappearance/lltexlayerparams.h b/indra/llappearance/lltexlayerparams.h index 5e785e4f3ed..2c243d0e9ba 100644 --- a/indra/llappearance/lltexlayerparams.h +++ b/indra/llappearance/lltexlayerparams.h @@ -30,6 +30,7 @@ #include "llpointer.h" #include "v4color.h" #include "llviewervisualparam.h" +#include class LLAvatarAppearance; class LLImageRaw; @@ -62,7 +63,6 @@ class LLTexLayerParam : public LLViewerVisualParam // LLTexLayerParamAlpha // //~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -LL_ALIGN_PREFIX(16) class alignas(16) LLTexLayerParamAlpha : public LLTexLayerParam { LL_ALIGN_NEW @@ -102,7 +102,7 @@ class alignas(16) LLTexLayerParamAlpha : public LLTexLayerParam LLPointer mStaticImageRaw; std::atomic mNeedsCreateTexture; bool mStaticImageInvalid; - LL_ALIGN_16(LLVector4a mAvgDistortionVec); + LLVector4a mAvgDistortionVec; F32 mCachedEffectiveWeight; public: @@ -112,7 +112,7 @@ class alignas(16) LLTexLayerParamAlpha : public LLTexLayerParam typedef std::list< LLTexLayerParamAlpha* > param_alpha_ptr_list_t; static param_alpha_ptr_list_t sInstances; -} LL_ALIGN_POSTFIX(16); +}; class LLTexLayerParamAlphaInfo : public LLViewerVisualParamInfo { friend class LLTexLayerParamAlpha; diff --git a/indra/llappearance/llviewervisualparam.h b/indra/llappearance/llviewervisualparam.h index b79983df8eb..37771cc8d32 100644 --- a/indra/llappearance/llviewervisualparam.h +++ b/indra/llappearance/llviewervisualparam.h @@ -65,8 +65,7 @@ class LLViewerVisualParamInfo : public LLVisualParamInfo // VIRTUAL CLASS // a viewer side interface class for a generalized parametric modification of the avatar mesh //----------------------------------------------------------------------------- -LL_ALIGN_PREFIX(16) -class LLViewerVisualParam : public LLVisualParam +class alignas(16) LLViewerVisualParam : public LLVisualParam { public: LLViewerVisualParam(); @@ -107,6 +106,6 @@ class LLViewerVisualParam : public LLVisualParam protected: LLViewerVisualParam(const LLViewerVisualParam& pOther); -} LL_ALIGN_POSTFIX(16); +}; #endif // LL_LLViewerVisualParam_H diff --git a/indra/llappearanceutility/CMakeLists.txt b/indra/llappearanceutility/CMakeLists.txt new file mode 100644 index 00000000000..53b5ce1cbeb --- /dev/null +++ b/indra/llappearanceutility/CMakeLists.txt @@ -0,0 +1,86 @@ +# -*- cmake -*- + +project(appearance_utility) + +include(00-Common) +include(Boost) +include(LLAppearance) +include(LLCommon) +include(LLImage) +include(LLMath) +include(LLWindow) +include(Linking) + +set(appearance_utility_SOURCE_FILES + appearance_utility.cpp + llappappearanceutility.cpp + llbakingavatar.cpp + llbakingjoint.cpp + llbakingjointmesh.cpp + llbakingprocess.cpp + llbakingshadermgr.cpp + llbakingtexlayer.cpp + llbakingtexture.cpp + llbakingwearable.cpp + llbakingwearablesdata.cpp + llbakingwindow.cpp + llprocessparams.cpp + llprocessskin.cpp + llprocesstexture.cpp + ) + +set(appearance_utility_HEADER_FILES + CMakeLists.txt + llappappearanceutility.h + llbakingavatar.h + llbakingjoint.h + llbakingjointmesh.h + llbakingprocess.h + llbakingshadermgr.h + llbakingtexlayer.h + llbakingtexture.h + llbakingwearable.h + llbakingwearablesdata.h + llbakingwindow.h + llprocessparams.h + llprocessskin.h + llprocesstexture.h + ) + +set_source_files_properties(${appearance_utility_HEADER_FILES} + PROPERTIES HEADER_FILES_ONLY TRUE) + +list(APPEND appearance_utility_SOURCE_FILES ${appearance_utility_HEADER_FILES}) + +add_executable(appearance-utility-bin ${appearance_utility_SOURCE_FILES}) + +target_link_libraries(appearance-utility-bin + llcharacter + llinventory + llappearance + llwindow + llrender + llxml + ) + +if (USE_PRECOMPILED_HEADERS) + target_precompile_headers(appearance-utility-bin REUSE_FROM llprecompiled) +endif () + +if (BUILD_HEADLESS) + add_executable(appearance-utility-headless-bin ${appearance_utility_SOURCE_FILES}) + + target_link_libraries(appearance-utility-headless-bin + llcharacter + llinventory + llappearanceheadless + llwindowheadless + llrenderheadless + llxml + ) + + if (USE_PRECOMPILED_HEADERS) + target_precompile_headers(appearance-utility-headless-bin REUSE_FROM llprecompiled) + endif () +endif (BUILD_HEADLESS) + diff --git a/indra/llappearanceutility/README.md b/indra/llappearanceutility/README.md new file mode 100644 index 00000000000..21019ffd27b --- /dev/null +++ b/indra/llappearanceutility/README.md @@ -0,0 +1,33 @@ +# llappearanceutility + +This directory contains the appearance utility employed by the bake service to process avatar textures and handle various other appearance-related functions. Please note that this utility is currently configured to build only on Linux systems. + +## Prerequisites + +Ensure the following prerequisites are met before building and testing the utility: + +- **X11 Display**: Ensure an X11 display is available, either virtual or physical, with the `DISPLAY` environment variable set appropriately (e.g., `DISPLAY=:1`). +- **Linux Build Environment**: Confirm that the Second Life Viewer can be built on your Linux system. + +## Testing + +Given the constraints with GitHub runners, we instead utilize Behavior-Driven Development (BDD) tests to evaluate the `llappearanceutility` through the bake service. For local development, test inputs and their expected outputs are provided below. + +### Test Commands + +1. **Baking Textures**: + ```sh + appearance-utility-bin --agent-id de494a4f-f01a-47a4-98cf-c94ef9ecca38 --texture /viewer/indra/llappearanceutility/tests/texture.llsd.binary > /viewer/indra/llappearanceutility/tests/texture.llsd.output + ``` + +2. **Generating Bake Parameters**: + ```sh + appearance-utility-bin --agent-id de494a4f-f01a-47a4-98cf-c94ef9ecca38 --params /viewer/indra/llappearanceutility/tests/params.xml > /viewer/indra/llappearanceutility/tests/params.xml.output + ``` + +3. **Calculating Joint Offsets**: + ```sh + appearance-utility-bin --agent-id de494a4f-f01a-47a4-98cf-c94ef9ecca38 --joint-offsets /viewer/indra/llappearanceutility/tests/joint-offsets.xml > /viewer/indra/llappearanceutility/tests/joint-offsets.xml.output + ``` + +These commands will execute the utility with specific test inputs and direct the output to corresponding files for validation. \ No newline at end of file diff --git a/indra/llappearanceutility/appearance_utility.cpp b/indra/llappearanceutility/appearance_utility.cpp new file mode 100644 index 00000000000..a9a310eb895 --- /dev/null +++ b/indra/llappearanceutility/appearance_utility.cpp @@ -0,0 +1,71 @@ +/** + * @file appearance_utility.cpp + * @author Don Kjer , Nyx Linden + * @brief Utility for processing avatar appearance without a full viewer implementation. + * + * $LicenseInfo:firstyear=2012&license=viewerlgpl$ + * Second Life Viewer Source Code + * Copyright (C) 2012, 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$ + */ + +// linden includes +#include "linden_common.h" +#include "llapr.h" + +// project includes +#include "llappappearanceutility.h" + +int main(int argc, char** argv) +{ + // Call Tracy first thing to have it allocate memory + // https://github.com/wolfpld/tracy/issues/196 + LL_PROFILER_FRAME_END; + LL_PROFILER_SET_THREAD_NAME("App"); + + // Create an application instance. + ll_init_apr(); + LLAppAppearanceUtility* app = new LLAppAppearanceUtility(argc, argv); + + // Assume success, unless exception is thrown. + EResult rv = RV_SUCCESS; + try + { + // Process command line and initialize system. + if (app->init()) + { + // Run process. + app->frame(); + } + } + catch (LLAppException& e) + { + // Deal with errors. + rv = e.getStatusCode(); + } + + // Clean up application instance. + app->cleanup(); + delete app; + ll_cleanup_apr(); + + return (int) rv; +} + + diff --git a/indra/llappearanceutility/llappappearanceutility.cpp b/indra/llappearanceutility/llappappearanceutility.cpp new file mode 100644 index 00000000000..d223c859abc --- /dev/null +++ b/indra/llappearanceutility/llappappearanceutility.cpp @@ -0,0 +1,681 @@ +/** + * @file llappappearanceutility.cpp + * @brief Implementation of LLAppAppearanceUtility class. + * + * $LicenseInfo:firstyear=2012&license=viewerlgpl$ + * Second Life Viewer Source Code + * Copyright (C) 2012, 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 +#include +#include +#include "boost/bind.hpp" + +// linden includes +#include "linden_common.h" + +#include "llapr.h" +#include "llerrorcontrol.h" +#include "llfasttimer.h" +#include "llgl.h" +#include "llmd5.h" +#include "llsd.h" +#include "llsdserialize.h" +#include "llsdutil.h" +#include "llquantize.h" +#include "lltreeiterators.h" +#include "v3color.h" +#include "llwindow.h" +#include "lltrace.h" + +// appearance includes +#include "llavatarappearance.h" +#include "llwearabletype.h" + +// project includes +#include "llappappearanceutility.h" +#include "llbakingprocess.h" +#include "llprocessparams.h" +#include "llprocesstexture.h" +#include "llprocessskin.h" + +const std::string NOTHING_EXTRA(""); + +//////////////////////////////////////////// +// LLAppException +//////////////////////////////////////////// + +static const std::string MESSAGE_RV_UNKNOWN("Unknown error."); +static const std::string MESSAGE_RV_ARGUMENTS +("Invalid arguments: "); +static const std::string MESSAGE_RV_UNABLE_OPEN("Unable to open file: "); +static const std::string MESSAGE_RV_UNABLE_TO_PARSE("Unable to parse input LLSD."); +static const std::string MESSAGE_RV_UNABLE_TO_DECODE("Unable to decode input J2C."); +static const std::string MESSAGE_RV_UNABLE_TO_ENCODE("Unable to encode output J2C."); +static const std::string MESSAGE_RV_UNABLE_TO_INIT_GL("Unable to initialize GL."); +static const std::string MESSAGE_RV_UNABLE_TO_BAKE("Unable to bake texture."); +static const std::string MESSAGE_RV_INVALID_SKIN_BLOCK("Invalid skin block."); +static const std::string MESSAGE_DUPLICATE_MODES = "Cannot specify more than one process mode."; + + +LLAppException::LLAppException(EResult status_code, const std::string& extra) : + mStatusCode(status_code) +{ + switch(status_code) + { + case RV_UNKNOWN_ERROR: + printErrorLLSD("unknown", MESSAGE_RV_UNKNOWN); + case RV_BAD_ARGUMENTS: + printErrorLLSD("arguments", MESSAGE_RV_ARGUMENTS + extra); + break; + case RV_UNABLE_OPEN: + printErrorLLSD("file", MESSAGE_RV_UNABLE_OPEN + extra); + break; + case RV_UNABLE_TO_PARSE: + printErrorLLSD("input", MESSAGE_RV_UNABLE_TO_PARSE + extra); + break; + case RV_UNABLE_TO_DECODE: + printErrorLLSD("input", MESSAGE_RV_UNABLE_TO_DECODE + extra); + break; + case RV_UNABLE_TO_ENCODE: + printErrorLLSD("input", MESSAGE_RV_UNABLE_TO_ENCODE + extra); + break; + case RV_UNABLE_TO_INIT_GL: + printErrorLLSD("input", MESSAGE_RV_UNABLE_TO_INIT_GL + extra); + break; + case RV_UNABLE_TO_BAKE: + printErrorLLSD("input", MESSAGE_RV_UNABLE_TO_BAKE + extra); + break; + case RV_INVALID_SKIN_BLOCK: + printErrorLLSD("input", MESSAGE_RV_INVALID_SKIN_BLOCK + extra); + break; + default: + printErrorLLSD("arguments", "Unknown exception."); + break; + } +} + +void LLAppException::printErrorLLSD(const std::string& key, const std::string& message) +{ + LLSD error_llsd; + error_llsd["success"] = false; + error_llsd["error"]["key"] = key; + error_llsd["error"]["message"] = message; + + std::cerr << LLSDOStreamer(error_llsd); +} + + + +//////////////////////////////////////////// +// LLAppAppearanceUtility +//////////////////////////////////////////// + +///////// Option Parsing ///////// + +// Simple usage command. +class LLProcessUsage : public LLBakingProcess +{ +public: + LLProcessUsage(LLAppAppearanceUtility* app) : + LLBakingProcess(app) {} + void process(std::ostream& output) override + { + mApp->usage(output); + } +}; + + +static const apr_getopt_option_t APPEARANCE_UTILITY_OPTIONS[] = +{ + {"params", 'p', 0, "Generate appearance parameters for an agent."}, + {"texture", 't', 0, "Generate baked texture for a slot."}, + {"output", 'o', 1, "The output file to write to. Default is stdout"}, + {"agent-id", 'a', 1, "The agent-id of the user."}, + {"bake-size", 'b', 1, "The bake texture size. eg use 512 for 512*512 textures, 1024 for 1024*1024 textures" }, + //{"grid", 'g', 1, "The grid."}, + {"debug", 'd', 0, "Enable debug spam. Default is warn/info spam only."}, + {"treemap", 'm', 1, "Output LLFrameTimer to specified file in graphviz treemap/pachwork format."}, + {"threshold", 's', 1, "Percent threshold of max LLFrameTimer time in order to appear on treemap. Default is 1%."}, + {"joint-offsets",'j',0,"Extract joint positions from skin."}, + {"help", 'h', 0, "Print the help message."}, + {0, 0, 0, 0} +}; + +void LLAppAppearanceUtility::usage(std::ostream& ostr) +{ + ostr << "Utilities for processing agent appearance data." + << std::endl << std::endl + << "Usage:" << std::endl + << "\t" << mAppName << " [options] filename" << std::endl << std::endl + << "Will read from stdin if filename is set to '-'." << std::endl << std::endl + << "Options:" << std::endl; + const apr_getopt_option_t* option = &APPEARANCE_UTILITY_OPTIONS[0]; + while(option->name) + { + ostr << "\t--" << option->name << "\t\t" + << option->description << std::endl; + ++option; + } + ostr << std::endl << "Return Values:" << std::endl + << "\t0\t\tSuccess." << std::endl + << "\t1\t\tUnknown error." << std::endl + << "\t2\t\tBad arguments." << std::endl + << "\t3\t\tUnable to open file. Possibly wrong filename" + << " or bad permissions." << std::endl + << "\t4\t\tUnable to parse input LLSD." << std::endl + << std::endl + << "Output:" << std::endl + << "If a non-zero status code is returned, additional error information" + << " will be returned on stderr." << std::endl + << "* This will be in the form of an LLSD document." << std::endl + << "* Check ['error']['message'] to get a human readable message." << std::endl + << "If a zero status code is returned, processed output will be written" + << " to the file specified by --out (or stdout, if not specified)." << std::endl + << std::endl + << std::endl; +} + + +/////// LLApp Interface //////// + +LLAppAppearanceUtility::LLAppAppearanceUtility(int argc, char** argv) : + LLApp(), + mArgc(argc), + mArgv(argv), + mProcess(nullptr), + mInput(nullptr), + mOutput(nullptr), + mAppName(argv[0]), + mDebugMode(false), + mTreeMapThreshold(1), + mBakeTextureSize(512) +{ +} + +// virtual +LLAppAppearanceUtility::~LLAppAppearanceUtility() +{ +} + +void LLAppAppearanceUtility::verifyNoProcess() +{ + if (mProcess) + { + std::cerr << "Invalid arguments. " << MESSAGE_DUPLICATE_MODES << std::endl; + usage(std::cerr); + throw LLAppException(RV_BAD_ARGUMENTS, MESSAGE_DUPLICATE_MODES); + } +} + +void LLAppAppearanceUtility::parseArguments() +{ + ////// BEGIN OPTION PARSING ////// + // Check for '-' as last option, since apr doesn't seem to like that. + if (std::string(mArgv[mArgc-1]) == "-") + { + mInputFilename.assign("-"); + mArgc--; + } + + apr_status_t apr_err; + const char* opt_arg = nullptr; + int opt_id = 0; + apr_getopt_t* os = nullptr; + if(APR_SUCCESS != apr_getopt_init(&os, gAPRPoolp, mArgc, mArgv)) + { + std::cerr << "Unable to initialize apr" << std::endl; + throw LLAppException(RV_UNKNOWN_ERROR); + } + + //std::string grid; + while(true) + { + apr_err = apr_getopt_long(os, APPEARANCE_UTILITY_OPTIONS, &opt_id, &opt_arg); + if(APR_STATUS_IS_EOF(apr_err)) break; + if(apr_err) + { + char buf[MAX_STRING]; /* Flawfinder: ignore */ + std::cerr << "Error parsing options: " + << apr_strerror(apr_err, buf, MAX_STRING) << std::endl; + usage(std::cerr); + throw LLAppException(RV_BAD_ARGUMENTS, buf); + } + switch (opt_id) + { + case 'h': + verifyNoProcess(); + mProcess = new LLProcessUsage(this); + break; + case 'p': + verifyNoProcess(); + mProcess = new LLProcessParams(this); + break; + case 't': + verifyNoProcess(); + mProcess = new LLProcessTexture(this); + break; + case 'j': + verifyNoProcess(); + mProcess = new LLProcessSkin( this ); + break; + case 'o': + mOutputFilename.assign(opt_arg); + break; + case 'a': + mAgentID.set(opt_arg); + if (mAgentID.isNull()) + { + const char* INVALID_AGENT_ID="agent-id must be a valid uuid."; + std::cerr << "Invalid arguments. " << INVALID_AGENT_ID << std::endl; + usage(std::cerr); + throw LLAppException(RV_BAD_ARGUMENTS, INVALID_AGENT_ID); + } + break; + case 'b': + mBakeTextureSize = atoi(opt_arg); + break; + //case 'g': + // grid = opt_arg; + // break; + case 'd': + mDebugMode = true; + break; + case 'm': + mTreeMapFilename.assign(opt_arg); + break; + case 's': + mTreeMapThreshold = atoi(opt_arg); + break; + default: + usage(std::cerr); + throw LLAppException(RV_BAD_ARGUMENTS, "Unknown option."); + } + } + + if ("-" != mInputFilename) + { + bool valid_input_filename = false; + // Try to grab the input filename. + if (os->argv && os->argv[os->ind]) + { + mInputFilename.assign(os->argv[os->ind]); + if (! mInputFilename.empty() ) + { + valid_input_filename = true; + } + } + if (!valid_input_filename) + { + const char* INVALID_FILENAME="Must specify input file."; + std::cerr << "Invalid arguments. " << INVALID_FILENAME << std::endl; + usage(std::cerr); + throw LLAppException(RV_BAD_ARGUMENTS, INVALID_FILENAME); + } + } + + ////// END OPTION PARSING ////// +} + +void LLAppAppearanceUtility::validateArguments() +{ + ///// BEGIN ARGUMENT VALIDATION ///// + + // Make sure we have a command specified. + if (!mProcess) + { + const char* INVALID_MODE="No process mode specified."; + std::cerr << "Invalid arguments. " << INVALID_MODE + << std::endl; + usage(std::cerr); + throw LLAppException(RV_BAD_ARGUMENTS, INVALID_MODE); + } + + ///// END ARGUMENT VALIDATION ///// +} + +void LLAppAppearanceUtility::initializeIO() +{ + ///// BEGIN OPEN INPUT FILE //// + + if ( "-" == mInputFilename ) + { + // Read unformated data from stdin in to memory. + std::stringstream* data = new std::stringstream(); + const S32 BUFFER_SIZE = BUFSIZ; + char buffer[BUFFER_SIZE]; + while (true) + { + std::cin.read(buffer, BUFFER_SIZE); + // Check if anything out of the ordinary happened. + if (!std::cin) + { + // See if something 'really bad' happened, or if we just + // used up all of our buffer. + if (std::cin.bad()) + { + std::cerr << "Problem reading standard input." << std::endl; + delete data; + throw (RV_UNKNOWN_ERROR); + } + else + { + // Output normally. + data->write(buffer, std::cin.gcount()); + if (std::cin.eof()) break; + + // Clear this problem. We have handled it. + std::cin.clear(); + } + } + else + { + data->write(buffer, std::cin.gcount()); + if (std::cin.eof()) break; + } + } + mInput = data; + } + else + { + // Make sure we can open the input file. + std::ifstream* input_file = new std::ifstream(); + input_file->open( mInputFilename.c_str(), std::fstream::in | std::fstream::binary ); + if ( input_file->fail()) + { + std::cerr << "Couldn't open input file '" << mInputFilename << "'." << std::endl; + delete input_file; + throw LLAppException(RV_UNABLE_OPEN, mInputFilename); + } + mInput = input_file; + } + ///// END OPEN INPUT FILE //// + + ///// BEGIN OPEN OUTPUT FILE //// + + if ("" == mOutputFilename) + { + mOutput = &std::cout; + } + else + { + // Make sure we can open the output file. + std::fstream* output_file = new std::fstream(); + output_file->open( mOutputFilename.c_str(), std::fstream::out ); + if ( output_file->fail() ) + { + std::cerr << "Couldn't open output file '" << mOutputFilename << "'." << std::endl; + delete output_file; + throw LLAppException(RV_UNABLE_OPEN, mOutputFilename); + } + mOutput = output_file; + } + ///// END OPEN OUTPUT FILE //// + + ///// BEGIN INPUT PARSING //// + if (mProcess) + { + mProcess->parseInput( *mInput ); + } + ///// END INPUT PARSING //// +} + +class LLPassthroughTranslationBridge : public LLTranslationBridge +{ +public: + virtual std::string getString(const std::string &xml_desc) + { + // Just pass back the input string. + return xml_desc; + } +}; + + +bool LLAppAppearanceUtility::init() +{ + parseArguments(); + + bool log_to_stderr = true; + LLError::initForApplication(".", ".", true); + if (mDebugMode) + { + mRecording.start(); + LLError::setDefaultLevel(LLError::LEVEL_DEBUG); + } + else + { + LLError::setDefaultLevel(LLError::LEVEL_WARN); + } + + validateArguments(); + + LL_DEBUGS() << "BakeSize: " << mBakeTextureSize << LL_ENDL; + + // Initialize classes. + // Values taken from settings.xml. + const bool USE_TEXTURE_NEW_BYTE_RANGE=true; + const S32 TEXTURE_REVERSE_BYTE_RANGE=50; + LLImage::initClass(USE_TEXTURE_NEW_BYTE_RANGE, TEXTURE_REVERSE_BYTE_RANGE); + const bool SKIP_ANALYZE_ALPHA=true; + + LLTranslationBridge::ptr_t trans = std::make_shared(); + LLWearableType::initParamSingleton(trans); + + // *TODO: Create a texture bridge? + LLAvatarAppearance::initClass(); + + initializeIO(); + if (mProcess) + { + mProcess->init(); + } + return true; +} + + +void add_cluster(LLTrace::Recording& recording, std::ostream& tree, LLTrace::BlockTimerStatHandle& node, std::vector < S32 > & clusters, F64Milliseconds threshold) +{ + LLMD5 hash; + hash.update((const unsigned char*)node.getName().c_str(), node.getName().size()); + hash.finalize(); + char buf[33]; + hash.hex_digest(buf); + buf[6] = 0; + LLColor3 color(buf); + if (color.brightness() < 0.25f) + { + color.normalize(); + } + std::ostringstream color_str; + color_str << "#" << std::hex << std::setfill('0') << std::setw(2) + << (S32) F32_to_U8(color.mV[0], 0.0f, 1.0f) + << (S32) F32_to_U8(color.mV[1], 0.0f, 1.0f) + << (S32) F32_to_U8(color.mV[2], 0.0f, 1.0f); + + std::vector::iterator iter = clusters.begin(); + std::vector::iterator end = clusters.end(); + std::ostringstream padding; + for(; iter != end; ++iter) + { + padding << " "; + } + + std::ostringstream node_id; + bool first = true; + iter = clusters.begin(); + for(; iter != end; ++iter) + { + if (!first) + { + node_id << "_"; + } + first = false; + node_id << (*iter); + } + + if (node.getChildren().size() == 0) + { + F64Milliseconds leaf_time_ms(recording.getSum(node)); + if (leaf_time_ms > threshold) + { + tree << padding.str() << "n" << node_id.str() << " [" + << "label=\"" << node.getName() << " (" << leaf_time_ms.value() << ")\" " + << "fillcolor=\"" << color_str.str() << "\" " + << "area=" << leaf_time_ms.value() / 10 << "]" << std::endl; + } + } + else + { + if (clusters.size()) + { + tree << padding.str() << "subgraph cluster" << node_id.str(); + tree << " {" << std::endl; + } + + S32Milliseconds node_area(recording.getSum(node)); + std::vector::iterator child_iter = node.getChildren().begin(); + for (S32 num=0; child_iter != node.getChildren().end(); ++child_iter, ++num) + { + clusters.push_back(num); + add_cluster(recording, tree, *(*child_iter), clusters, threshold); + clusters.pop_back(); + node_area -= recording.getSum(*(*child_iter)); + } + + S32Milliseconds node_time_ms(node_area); + if (node_time_ms > threshold) + { + tree << padding.str() << "n" << node_id.str() << " [" + << "label=\"" << node.getName() << " (" << node_time_ms.value() << ")\" " + << "fillcolor=\"" << color_str.str() << "\" " + << "area=" << node_time_ms.value() / 10 << "]" << std::endl; + } + if (clusters.size()) + { + tree << padding.str() << "}" << std::endl;; + } + } +} + +bool LLAppAppearanceUtility::cleanup() +{ + if (mProcess) + { + mProcess->cleanup(); + } + + // Spam fast timer information in debug mode. + if (mDebugMode) + { + mRecording.stop(); + LLTrace::BlockTimer::processTimes(); + + S32Milliseconds max_time_ms(0); + for (LLTrace::block_timer_tree_df_iterator_t it = LLTrace::begin_block_timer_tree_df(LLTrace::BlockTimer::getRootTimeBlock()); + it != LLTrace::end_block_timer_tree_df(); + ++it) + { + LLTrace::BlockTimerStatHandle* idp = (*it); + // Skip near-zero time leafs. + S32Milliseconds leaf_time_ms(mRecording.getSum(*idp)); + if (leaf_time_ms > max_time_ms) max_time_ms = leaf_time_ms; + if ((S32Milliseconds)0 == leaf_time_ms) continue; + + std::vector< LLTrace::BlockTimerStatHandle* > parents; + LLTrace::BlockTimerStatHandle* parentp = idp->getParent(); + while (parentp) + { + parents.push_back(parentp); + if (parentp->getParent() == parentp) break; + parentp = parentp->getParent(); + } + + std::ostringstream fullname; + bool is_first = true; + for ( std::vector< LLTrace::BlockTimerStatHandle* >::reverse_iterator iter = parents.rbegin(); + iter != parents.rend(); ++iter) + { + // Skip root + if (is_first) + { + is_first = false; + continue; + } + LLTrace::BlockTimerStatHandle* parent_idp = (*iter); + U32Milliseconds time_ms(mRecording.getSum(parent_idp->selfTime())); + fullname << parent_idp->getName() << " "; + fullname << "("; + if (time_ms > (U32Milliseconds)0) + { + fullname << time_ms.value() << " ms, "; + } + fullname << mRecording.getSum(parent_idp->callCount()) << " call)-> "; + } + LL_DEBUGS() << fullname.str() << LL_ENDL; + } + if (!mTreeMapFilename.empty()) + { + std::ofstream tree(mTreeMapFilename.c_str()); + tree << "graph G {" << std::endl; + tree << " node[style=filled]" << std::endl; + + LLTrace::BlockTimerStatHandle& root = LLTrace::BlockTimer::getRootTimeBlock(); + std::vector clusters; + add_cluster(mRecording, tree, root, clusters, (((F32) mTreeMapThreshold / 100.f) * max_time_ms) ); + + tree << "}" << std::endl; + + LL_DEBUGS() << "To generate a treemap of LLFrameTimer results, run:" << LL_ENDL; + LL_DEBUGS() << "patchwork " << mTreeMapFilename << " -Tpng > rendered.png" << LL_ENDL; + } + } + + LLAvatarAppearance::cleanupClass(); + LLImageGL::cleanupClass(); + LLImage::cleanupClass(); + + if (mProcess) + { + delete mProcess; + mProcess = nullptr; + } + if ("-" != mInputFilename && mInput) + { + static_cast(mInput)->close(); + } + if ("" != mOutputFilename && mOutput) + { + static_cast(mOutput)->close(); + delete mOutput; + mOutput = nullptr; + } + delete mInput; + mInput = nullptr; + return true; +} + +bool LLAppAppearanceUtility::frame() +{ + // This isn't really a loop, for this application. We just execute the requested command. + mProcess->process(*mOutput); + return true; +} + diff --git a/indra/llappearanceutility/llappappearanceutility.h b/indra/llappearanceutility/llappappearanceutility.h new file mode 100644 index 00000000000..80d1e8b1bf6 --- /dev/null +++ b/indra/llappearanceutility/llappappearanceutility.h @@ -0,0 +1,108 @@ +/** + * @file llappappearanceutility.h + * @brief Declaration of LLAppAppearanceUtility class. + * + * $LicenseInfo:firstyear=2012&license=viewerlgpl$ + * Second Life Viewer Source Code + * Copyright (C) 2012, Linden Research, Inc. + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; + * version 2.1 of the License only. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA + * + * Linden Research, Inc., 945 Battery Street, San Francisco, CA 94111 USA + * $/LicenseInfo$ + */ + +#ifndef LL_LLAPPAPPEARANCEUTILITY_H +#define LL_LLAPPAPPEARANCEUTILITY_H + +#include + +#include "llapp.h" +#include "lltracerecording.h" + +enum EResult +{ + RV_SUCCESS = 0, + RV_UNKNOWN_ERROR, + RV_BAD_ARGUMENTS, + RV_UNABLE_OPEN, + RV_UNABLE_TO_PARSE, + RV_UNABLE_TO_DECODE, + RV_UNABLE_TO_ENCODE, + RV_UNABLE_TO_INIT_GL, + RV_UNABLE_TO_BAKE, + RV_INVALID_SKIN_BLOCK, +}; + +extern const std::string NOTHING_EXTRA; + +class LLAppAppearanceUtility; +class LLBakingProcess; + +// Translate error status into error messages. +class LLAppException : public std::exception +{ +public: + LLAppException(EResult status_code, const std::string& extra = NOTHING_EXTRA); + EResult getStatusCode() { return mStatusCode; } + +private: + void printErrorLLSD(const std::string& key, const std::string& message); + EResult mStatusCode; +}; + + +class LLAppAppearanceUtility : public LLApp +{ +public: + LLAppAppearanceUtility(int argc, char** argv); + virtual ~LLAppAppearanceUtility(); + + // LLApp interface. + bool init() override; + bool cleanup() override; + bool frame() override; + +private: + // Option parsing. + void verifyNoProcess(); + void parseArguments(); + void validateArguments(); + void initializeIO(); +public: + void usage(std::ostream& ostr); + bool isDebugMode() const { return mDebugMode; } + S32 bakeTextureSize() const { return mBakeTextureSize; } + +private: + int mArgc; + char** mArgv; + LLBakingProcess* mProcess; + std::istream* mInput; + std::ostream* mOutput; + std::string mAppName; + std::string mInputFilename; + std::string mOutputFilename; + LLUUID mAgentID; + S32 mBakeTextureSize; + bool mDebugMode; + LLTrace::Recording mRecording; + S32 mTreeMapThreshold; + std::string mTreeMapFilename; +}; + + +#endif /* LL_LLAPPAPPEARANCEUTILITY_H */ + diff --git a/indra/llappearanceutility/llbakingavatar.cpp b/indra/llappearanceutility/llbakingavatar.cpp new file mode 100644 index 00000000000..426fa705e9e --- /dev/null +++ b/indra/llappearanceutility/llbakingavatar.cpp @@ -0,0 +1,177 @@ +/** + * @File llbakingavatar.cpp + * @brief Implementation of LLBakingAvatar class which is a derivation of LLAvatarAppearance + * + * $LicenseInfo:firstyear=2012&license=viewerlgpl$ + * Second Life Viewer Source Code + * Copyright (C) 2012, 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$ + */ + +// linden includes +#include "linden_common.h" +#include "v3dmath.h" + +// appearance includes +#include "llavatarappearancedefines.h" + +// project includes +#include "llbakingavatar.h" +#include "llbakingjoint.h" +#include "llbakingjointmesh.h" +#include "llbakingtexlayer.h" + +using namespace LLAvatarAppearanceDefines; + +LLBakingAvatar::LLBakingAvatar(LLWearableData* wearable_data,S32 bakeTextureSize) : + LLAvatarAppearance(wearable_data), + mBakeTextureSize(bakeTextureSize) +{ +} + +// virtual +LLBakingAvatar::~LLBakingAvatar() +{ +} + +//----------------------------------------------------------------------------- +// Implemented methods +//----------------------------------------------------------------------------- + +LLAvatarJoint* LLBakingAvatar::createAvatarJoint() +{ + return new LLBakingJoint(); +} + +LLAvatarJoint* LLBakingAvatar::createAvatarJoint(S32 joint_num) +{ + return new LLBakingJoint(joint_num); +} + +LLAvatarJointMesh* LLBakingAvatar::createAvatarJointMesh() +{ + return new LLBakingJointMesh(); +} + +LLTexLayerSet* LLBakingAvatar::createTexLayerSet() +{ + return new LLBakingTexLayerSet(this); +} + +void LLBakingAvatar::bakedTextureDatasAsLLSD(LLSD& sd) const +{ + bakedtexturedata_vec_t::const_iterator baked_iter = mBakedTextureDatas.begin(); + bakedtexturedata_vec_t::const_iterator baked_end = mBakedTextureDatas.end(); + for (; baked_iter != baked_end; ++baked_iter) + { + LLBakingTexLayerSet* layer_set = dynamic_cast(baked_iter->mTexLayerSet); + LLSD layer_sd; + layer_set->asLLSD(layer_sd); + sd[LLAvatarAppearance::getDictionary()->getTexture(baked_iter->mTextureIndex)->mName] = layer_sd; + } +} + +//----------------------------------------------------------------------------- +// (Ignored) Non-implemented methods. +//----------------------------------------------------------------------------- + +void LLBakingAvatar::applyMorphMask(const U8* tex_data, S32 width, S32 height, S32 num_components, + LLAvatarAppearanceDefines::EBakedTextureIndex index) {} +void LLBakingAvatar::invalidateComposite(LLTexLayerSet* layerset) {} +void LLBakingAvatar::updateMeshTextures() {} +void LLBakingAvatar::dirtyMesh() {} +void LLBakingAvatar::dirtyMesh(S32 priority) {} +void LLBakingAvatar::onGlobalColorChanged(const LLTexGlobalColor* global_color) {} + +bool LLBakingAvatar::isTextureDefined(LLAvatarAppearanceDefines::ETextureIndex type, U32 index) const +{ + return true; +} + + +//----------------------------------------------------------------------------- +// (LLERR) Non-implemented methods. +//----------------------------------------------------------------------------- + +LLVector3 LLBakingAvatar::getCharacterPosition() +{ + LL_ERRS("AppearanceUtility") << "Not implemented." << LL_ENDL; + return LLVector3::zero; +} + +LLQuaternion LLBakingAvatar::getCharacterRotation() +{ + LL_ERRS("AppearanceUtility") << "Not implemented." << LL_ENDL; + return LLQuaternion::DEFAULT; +} + +LLVector3 LLBakingAvatar::getCharacterVelocity() +{ + LL_ERRS("AppearanceUtility") << "Not implemented." << LL_ENDL; + return LLVector3::zero; +} + +LLVector3 LLBakingAvatar::getCharacterAngularVelocity() +{ + LL_ERRS("AppearanceUtility") << "Not implemented." << LL_ENDL; + return LLVector3::zero; +} + +const LLUUID& LLBakingAvatar::getID() const +{ + LL_ERRS("AppearanceUtility") << "Not implemented." << LL_ENDL; + return LLUUID::null; +} + +void LLBakingAvatar::addDebugText(const std::string& text) +{ + LL_ERRS("AppearanceUtility") << "Not implemented." << LL_ENDL; +} + +F32 LLBakingAvatar::getTimeDilation() +{ + LL_ERRS("AppearanceUtility") << "Not implemented." << LL_ENDL; + return 0.0f; +} + +void LLBakingAvatar::getGround(const LLVector3 &inPos, LLVector3 &outPos, LLVector3 &outNorm) +{ + LL_ERRS("AppearanceUtility") << "Not implemented." << LL_ENDL; +} + +F32 LLBakingAvatar::getPixelArea() const +{ + LL_ERRS("AppearanceUtility") << "Not implemented." << LL_ENDL; + return 0.0f; +} + +LLVector3d LLBakingAvatar::getPosGlobalFromAgent(const LLVector3 &position) +{ + LL_ERRS("AppearanceUtility") << "Not implemented." << LL_ENDL; + return LLVector3d::zero; +} + +LLVector3 LLBakingAvatar::getPosAgentFromGlobal(const LLVector3d &position) +{ + LL_ERRS("AppearanceUtility") << "Not implemented." << LL_ENDL; + return LLVector3::zero; +} + + + diff --git a/indra/llappearanceutility/llbakingavatar.h b/indra/llappearanceutility/llbakingavatar.h new file mode 100644 index 00000000000..b4cf99cbfb0 --- /dev/null +++ b/indra/llappearanceutility/llbakingavatar.h @@ -0,0 +1,131 @@ +/** + * @file llbakingavatar.h + * @brief Declaration of LLBakingAvatar class which is a derivation of LLAvatarAppearance + * + * $LicenseInfo:firstyear=2012&license=viewerlgpl$ + * Second Life Viewer Source Code + * Copyright (C) 2012, Linden Research, Inc. + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; + * version 2.1 of the License only. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA + * + * Linden Research, Inc., 945 Battery Street, San Francisco, CA 94111 USA + * $/LicenseInfo$ + */ + +#ifndef LL_LLBAKINGAVATAR_H +#define LL_LLBAKINGAVATAR_H + +#include "llavatarappearance.h" + +class LLBakingAvatar : public LLAvatarAppearance +{ + LOG_CLASS(LLBakingAvatar); + +/******************************************************************************** + ** ** + ** INITIALIZATION + **/ +public: + LL_ALIGN_NEW + + LLBakingAvatar(LLWearableData* wearable_data, S32 bakeTextureSize = 512); + virtual ~LLBakingAvatar(); + + static void initClass(); // initializes static members + +/** Initialization + ** ** + *******************************************************************************/ + +/******************************************************************************** + ** ** + ** INHERITED + **/ + + //-------------------------------------------------------------------- + // LLCharacter interface + //-------------------------------------------------------------------- +public: + LLVector3 getCharacterPosition() override; + LLQuaternion getCharacterRotation() override; + LLVector3 getCharacterVelocity() override; + LLVector3 getCharacterAngularVelocity() override; + + const LLUUID& getID() const override; + void addDebugText(const std::string& text) override; + F32 getTimeDilation() override; + void getGround(const LLVector3 &inPos, LLVector3 &outPos, LLVector3 &outNorm) override; + F32 getPixelArea() const override; + LLVector3d getPosGlobalFromAgent(const LLVector3 &position) override; + LLVector3 getPosAgentFromGlobal(const LLVector3d &position) override; + + //-------------------------------------------------------------------- + // LLAvatarAppearance interface + //-------------------------------------------------------------------- +public: + void applyMorphMask(const U8* tex_data, S32 width, S32 height, S32 num_components, + LLAvatarAppearanceDefines::EBakedTextureIndex index) override; + void invalidateComposite(LLTexLayerSet* layerset) override; + void updateMeshTextures() override; + void dirtyMesh() override; // Dirty the avatar mesh + void onGlobalColorChanged(const LLTexGlobalColor* global_color) override; + bool isTextureDefined(LLAvatarAppearanceDefines::ETextureIndex type, U32 index = 0) const override; + bool isUsingLocalAppearance() const override { return false; } + bool isEditingAppearance() const override { return false; } +private: + void dirtyMesh(S32 priority) override; // Dirty the avatar mesh, with priority + + // LLAvatarAppearance instance factories: +protected: + LLAvatarJoint* createAvatarJoint() override; + LLAvatarJoint* createAvatarJoint(S32 joint_num) override; + LLAvatarJointMesh* createAvatarJointMesh() override; + LLTexLayerSet* createTexLayerSet() override; + + +/** Inherited + ** ** + *******************************************************************************/ + +/******************************************************************************** + ** ** + ** STATE + **/ +public: + bool isSelf() const override { return true; } + bool isValid() const override { return true; } + +/** State + ** ** + *******************************************************************************/ + +/******************************************************************************** + ** ** + ** BAKING + **/ +public: + void bakedTextureDatasAsLLSD(LLSD& sd) const; + S32 bakeTextureSize() const { return mBakeTextureSize; } + +/** Baking + ** ** + *******************************************************************************/ + +private: + S32 mBakeTextureSize; +}; + +#endif /* LL_LLBAKINGAVATAR_H */ + diff --git a/indra/linux_crash_logger/llcrashloggerlinux.h b/indra/llappearanceutility/llbakingjoint.cpp similarity index 60% rename from indra/linux_crash_logger/llcrashloggerlinux.h rename to indra/llappearanceutility/llbakingjoint.cpp index dcecbe746d6..25edaa645f0 100644 --- a/indra/linux_crash_logger/llcrashloggerlinux.h +++ b/indra/llappearanceutility/llbakingjoint.cpp @@ -1,10 +1,10 @@ /** - * @file llcrashloggerlinux.h - * @brief Linux crash logger definition + * @file llbakingjoint.cpp + * @brief Implementation of LLBakingJoint class * - * $LicenseInfo:firstyear=2003&license=viewerlgpl$ + * $LicenseInfo:firstyear=2012&license=viewerlgpl$ * Second Life Viewer Source Code - * Copyright (C) 2010, Linden Research, Inc. + * Copyright (C) 2012, 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 @@ -24,22 +24,31 @@ * $/LicenseInfo$ */ -#ifndef LLCRASHLOGGERLINUX_H -#define LLCRASHLOGGERLINUX_H #include "linden_common.h" -#include "llcrashlogger.h" -#include "llstring.h" -class LLCrashLoggerLinux : public LLCrashLogger +#include "llbakingjoint.h" + + +LLBakingJoint::LLBakingJoint() : + LLAvatarJoint() { -public: - LLCrashLoggerLinux(void); - ~LLCrashLoggerLinux(void); - virtual bool frame(); - virtual void updateApplication(const std::string& = LLStringUtil::null); - virtual void gatherPlatformSpecificFiles(); - virtual bool cleanup(); -}; - -#endif +} + +LLBakingJoint::LLBakingJoint(S32 joint_num) : + LLAvatarJoint(joint_num) +{ +} + +// virtual +LLBakingJoint::~LLBakingJoint() +{ +} + +// virtual +U32 LLBakingJoint::render( F32 pixelArea, bool first_pass, bool is_dummy) +{ + LL_ERRS() << "LLBakingJoint::render() should never be called!" << LL_ENDL; + return 0; +} + diff --git a/indra/llappearanceutility/llbakingjoint.h b/indra/llappearanceutility/llbakingjoint.h new file mode 100644 index 00000000000..10201cc7b81 --- /dev/null +++ b/indra/llappearanceutility/llbakingjoint.h @@ -0,0 +1,45 @@ +/** + * @file llbakingjoint.h + * @brief Declaration of LLBakingJoint class + * + * $LicenseInfo:firstyear=2012&license=viewerlgpl$ + * Second Life Viewer Source Code + * Copyright (C) 2012, Linden Research, Inc. + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; + * version 2.1 of the License only. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA + * + * Linden Research, Inc., 945 Battery Street, San Francisco, CA 94111 USA + * $/LicenseInfo$ + */ + +#ifndef LL_LLBAKINGJOINT_H +#define LL_LLBAKINGJOINT_H + +#include "llavatarjoint.h" + +class alignas(16) LLBakingJoint : public virtual LLAvatarJoint +{ + LL_ALIGN_NEW +public: + LLBakingJoint(); + LLBakingJoint(S32 joint_num); + virtual ~LLBakingJoint(); + + // LLViewerJoint interface + U32 render( F32 pixelArea, bool first_pass = true, bool is_dummy = false ) override; +}; + +#endif /* LL_LLBAKINGJOINT_H */ + diff --git a/indra/llappearanceutility/llbakingjointmesh.cpp b/indra/llappearanceutility/llbakingjointmesh.cpp new file mode 100644 index 00000000000..b8e3283df2e --- /dev/null +++ b/indra/llappearanceutility/llbakingjointmesh.cpp @@ -0,0 +1,43 @@ +/** + * @file llbakingjointmesh.cpp + * @brief Implementation of LLBakingJointMesh class + * + * $LicenseInfo:firstyear=2012&license=viewerlgpl$ + * Second Life Viewer Source Code + * Copyright (C) 2012, 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 "linden_common.h" + +#include "llbakingjointmesh.h" + + +LLBakingJointMesh::LLBakingJointMesh() : + LLAvatarJointMesh() +{ +} + +// virtual +LLBakingJointMesh::~LLBakingJointMesh() +{ +} + + diff --git a/indra/llappearanceutility/llbakingjointmesh.h b/indra/llappearanceutility/llbakingjointmesh.h new file mode 100644 index 00000000000..9c7b276bd81 --- /dev/null +++ b/indra/llappearanceutility/llbakingjointmesh.h @@ -0,0 +1,46 @@ +/** + * @file llbakingjoint.h + * @brief Implementation of LLBakingJointMesh class + * + * $LicenseInfo:firstyear=2012&license=viewerlgpl$ + * Second Life Viewer Source Code + * Copyright (C) 2012, Linden Research, Inc. + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; + * version 2.1 of the License only. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA + * + * Linden Research, Inc., 945 Battery Street, San Francisco, CA 94111 USA + * $/LicenseInfo$ + */ + +#ifndef LL_LLBAKINGJOINTMESH_H +#define LL_LLBAKINGJOINTMESH_H + +#include "llavatarjointmesh.h" +#include "llbakingjoint.h" + +class alignas(16) LLBakingJointMesh : public LLAvatarJointMesh, public LLBakingJoint +{ + LL_ALIGN_NEW +public: + LLBakingJointMesh(); + LLBakingJointMesh(S32 joint_num); + virtual ~LLBakingJointMesh(); + + U32 render( F32 pixelArea, bool first_pass = true, bool is_dummy = false ) + { return LLBakingJoint::render(pixelArea,first_pass,is_dummy); } +}; + +#endif /* LL_LLBAKINGJOINTMESH_H */ + diff --git a/indra/llappearanceutility/llbakingprocess.cpp b/indra/llappearanceutility/llbakingprocess.cpp new file mode 100644 index 00000000000..85553b0fdb3 --- /dev/null +++ b/indra/llappearanceutility/llbakingprocess.cpp @@ -0,0 +1,47 @@ +/** + * @file llbakingprocess.cpp + * @brief Implementation of LLBakingProcess class. + * + * $LicenseInfo:firstyear=2012&license=viewerlgpl$ + * Second Life Viewer Source Code + * Copyright (C) 2012, 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$ + */ + +// linden includes +#include "linden_common.h" + +#include "llsd.h" +#include "llsdserialize.h" + +// project includes +#include "llappappearanceutility.h" +#include "llbakingprocess.h" + +// virtual +void LLBakingProcess::parseInput(std::istream& input) +{ + LLSDSerialize::fromXML( mInputData, input ); + if (mInputData.isUndefined()) + { + throw LLAppException(RV_UNABLE_TO_PARSE); + } +} + + diff --git a/indra/llappearanceutility/llbakingprocess.h b/indra/llappearanceutility/llbakingprocess.h new file mode 100644 index 00000000000..de38b7a36b4 --- /dev/null +++ b/indra/llappearanceutility/llbakingprocess.h @@ -0,0 +1,60 @@ +/** + * @file llbakingprocess.h + * @brief Declaration of LLBakingProcess interface. + * + * $LicenseInfo:firstyear=2012&license=viewerlgpl$ + * Second Life Viewer Source Code + * Copyright (C) 2012, Linden Research, Inc. + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; + * version 2.1 of the License only. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA + * + * Linden Research, Inc., 945 Battery Street, San Francisco, CA 94111 USA + * $/LicenseInfo$ + */ + +#ifndef LL_LLBAKINGPROCESS_H +#define LL_LLBAKINGPROCESS_H + +#include + +class LLAppAppearanceUtility; +class LLSD; + +// Simple wrapper for various process modes. +class LLBakingProcess +{ +private: + // Hide default constructor. + LLBakingProcess() {} +public: + LLBakingProcess(LLAppAppearanceUtility* app) : + mApp(app) {} + virtual ~LLBakingProcess() {} + + virtual void parseInput(std::istream& input); + //virtual std::string getProcessName() const = 0; + virtual void process(std::ostream& output) = 0; + + virtual void init() {} + virtual void cleanup() {} + +protected: + LLAppAppearanceUtility* mApp; + LLSD mInputData; +}; + + +#endif /* LL_LLBAKINGPROCESS_H */ + diff --git a/indra/llappearanceutility/llbakingshadermgr.cpp b/indra/llappearanceutility/llbakingshadermgr.cpp new file mode 100644 index 00000000000..5246f96ae41 --- /dev/null +++ b/indra/llappearanceutility/llbakingshadermgr.cpp @@ -0,0 +1,250 @@ + +/** + * @file LLBakingShaderMgr.cpp + * @brief Viewer shader manager implementation. + * + * $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 "linden_common.h" + +#include "llbakingshadermgr.h" + +#include "lldir.h" +#include "llfile.h" +#include "llrender.h" +#include "llvertexbuffer.h" + +#if LL_DARWIN +#include "OpenGL/OpenGL.h" +#endif + +#ifdef LL_RELEASE_FOR_DOWNLOAD +#define UNIFORM_ERRS LL_WARNS_ONCE("Shader") +#else +#define UNIFORM_ERRS LL_ERRS("Shader") +#endif + +// Lots of STL stuff in here, using namespace std to keep things more readable +using std::vector; +using std::pair; +using std::make_pair; +using std::string; + +bool LLBakingShaderMgr::sInitialized = false; +bool LLBakingShaderMgr::sSkipReload = false; + +//utility shaders +LLGLSLShader gAlphaMaskProgram; + + +LLBakingShaderMgr::LLBakingShaderMgr() : + mVertexShaderLevel(SHADER_COUNT, 0), + mMaxAvatarShaderLevel(0) +{ +} + +LLBakingShaderMgr::~LLBakingShaderMgr() +{ + mVertexShaderLevel.clear(); + mShaderList.clear(); +} + +// static +LLBakingShaderMgr * LLBakingShaderMgr::instance() +{ + if(nullptr == sInstance) + { + sInstance = new LLBakingShaderMgr(); + } + + return static_cast(sInstance); +} + +void LLBakingShaderMgr::initAttribsAndUniforms(void) +{ + if (mReservedAttribs.empty()) + { + LLShaderMgr::initAttribsAndUniforms(); + } +} + + +//============================================================================ +// Set Levels + +S32 LLBakingShaderMgr::getVertexShaderLevel(S32 type) +{ + return mVertexShaderLevel[type]; +} + +//============================================================================ +// Shader Management + +void LLBakingShaderMgr::setShaders() +{ + //setShaders might be called redundantly by gSavedSettings, so return on reentrance + static bool reentrance = false; + + if (!sInitialized || reentrance || sSkipReload) + { + return; + } + + LLGLSLShader::sIndexedTextureChannels = llmax(gGLManager.mNumTextureImageUnits, 1); + + //NEVER use more than 16 texture channels (work around for prevalent driver bug) + LLGLSLShader::sIndexedTextureChannels = llmin(LLGLSLShader::sIndexedTextureChannels, 16); + + if (gGLManager.mGLSLVersionMajor < 1 || + (gGLManager.mGLSLVersionMajor == 1 && gGLManager.mGLSLVersionMinor <= 20)) + { //NEVER use indexed texture rendering when GLSL version is 1.20 or earlier + LLGLSLShader::sIndexedTextureChannels = 1; + } + + reentrance = true; + + initAttribsAndUniforms(); + + // Shaders + LL_INFOS("ShaderLoading") << "\n~~~~~~~~~~~~~~~~~~\n Loading Shaders:\n~~~~~~~~~~~~~~~~~~" << LL_ENDL; + LL_INFOS("ShaderLoading") << llformat("Using GLSL %d.%d", gGLManager.mGLSLVersionMajor, gGLManager.mGLSLVersionMinor) << LL_ENDL; + + for (S32 i = 0; i < SHADER_COUNT; i++) + { + mVertexShaderLevel[i] = 0; + } + mMaxAvatarShaderLevel = 0; + + LLVertexBuffer::unbind(); + bool loaded = false; + if (gGLManager.mGLSLVersionMajor > 1 || gGLManager.mGLSLVersionMinor >= 10) + { + S32 light_class = 2; + mVertexShaderLevel[SHADER_INTERFACE] = light_class; + + // loadBasicShaders + vector< pair > shaders; + if (gGLManager.mGLSLVersionMajor >= 2 || gGLManager.mGLSLVersionMinor >= 30) + { + shaders.push_back( make_pair( "objects/indexedTextureV.glsl", 1 ) ); + } + shaders.push_back( make_pair( "objects/nonindexedTextureV.glsl", 1 ) ); + shaders.push_back( make_pair( "deferred/textureUtilV.glsl", 1 ) ); + loaded = true; + for (U32 i = 0; i < shaders.size(); i++) + { + // Note usage of GL_VERTEX_SHADER + if (loadShaderFile(shaders[i].first, shaders[i].second, GL_VERTEX_SHADER) == 0) + { + LL_WARNS("Shader") << "Failed to load vertex shader " << shaders[i].first << LL_ENDL; + loaded = false; + break; + } + } + + shaders.clear(); + + // fragment shaders + shaders.push_back( make_pair( "deferred/globalF.glsl", 1 ) ); + + for (U32 i = 0; i < shaders.size(); i++) + { + // Note usage of GL_FRAGMENT_SHADER + if (loadShaderFile(shaders[i].first, shaders[i].second, GL_FRAGMENT_SHADER) == 0) + { + LL_WARNS("Shader") << "Failed to load fragment shader " << shaders[i].first << LL_ENDL; + loaded = false; + break; + } + } + + if (loaded) + { + loaded = loadShadersInterface(); + } + } + + if (!loaded) + { + //gPipeline.mVertexShadersEnabled = false; + //gPipeline.mVertexShadersLoaded = 0; + mVertexShaderLevel[SHADER_LIGHTING] = 0; + mVertexShaderLevel[SHADER_INTERFACE] = 0; + mVertexShaderLevel[SHADER_ENVIRONMENT] = 0; + mVertexShaderLevel[SHADER_WATER] = 0; + mVertexShaderLevel[SHADER_OBJECT] = 0; + mVertexShaderLevel[SHADER_EFFECT] = 0; + mVertexShaderLevel[SHADER_WINDLIGHT] = 0; + mVertexShaderLevel[SHADER_AVATAR] = 0; + } + + //gPipeline.createGLBuffers(); + + reentrance = false; +} + +void LLBakingShaderMgr::unloadShaders() +{ + gAlphaMaskProgram.unload(); + + mVertexShaderLevel[SHADER_INTERFACE] = 0; + + //gPipeline.mVertexShadersLoaded = 0; +} + +bool LLBakingShaderMgr::loadShadersInterface() +{ + gAlphaMaskProgram.mName = "Alpha Mask Shader"; + gAlphaMaskProgram.mShaderFiles.clear(); + gAlphaMaskProgram.mShaderFiles.push_back(make_pair("interface/alphamaskV.glsl", GL_VERTEX_SHADER)); + gAlphaMaskProgram.mShaderFiles.push_back(make_pair("interface/alphamaskF.glsl", GL_FRAGMENT_SHADER)); + gAlphaMaskProgram.mShaderLevel = mVertexShaderLevel[SHADER_INTERFACE]; + + if( !gAlphaMaskProgram.createShader() ) + { + mVertexShaderLevel[SHADER_INTERFACE] = 0; + return false; + } + + return true; +} + +std::string LLBakingShaderMgr::getShaderDirPrefix(void) +{ + return gDirUtilp->getExpandedFilename(LL_PATH_APP_SETTINGS, "shaders/class"); +} + +void LLBakingShaderMgr::updateShaderUniforms(LLGLSLShader * shader) +{ +} + +LLBakingShaderMgr::shader_iter LLBakingShaderMgr::beginShaders() const +{ + return mShaderList.begin(); +} + +LLBakingShaderMgr::shader_iter LLBakingShaderMgr::endShaders() const +{ + return mShaderList.end(); +} diff --git a/indra/llappearanceutility/llbakingshadermgr.h b/indra/llappearanceutility/llbakingshadermgr.h new file mode 100644 index 00000000000..60ab3f94e8d --- /dev/null +++ b/indra/llappearanceutility/llbakingshadermgr.h @@ -0,0 +1,137 @@ +/** + * @file llbakingshadermgr.h + * @brief Texture Baking Shader Manager + * + * $LicenseInfo:firstyear=2012&license=viewerlgpl$ + * Second Life Viewer Source Code + * Copyright (C) 2012, Linden Research, Inc. + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; + * version 2.1 of the License only. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA + * + * Linden Research, Inc., 945 Battery Street, San Francisco, CA 94111 USA + * $/LicenseInfo$ + */ + +#ifndef LL_BAKING_SHADER_MGR_H +#define LL_BAKING_SHADER_MGR_H + +#include "llshadermgr.h" + +class LLBakingShaderMgr: public LLShaderMgr +{ +public: + static bool sInitialized; + static bool sSkipReload; + + LLBakingShaderMgr(); + ~LLBakingShaderMgr(); + + // singleton pattern implementation + static LLBakingShaderMgr * instance(); + + void initAttribsAndUniforms(void) override; + void setShaders(); + void unloadShaders(); + S32 getVertexShaderLevel(S32 type); + bool loadShadersInterface(); + + std::vector mVertexShaderLevel; + S32 mMaxAvatarShaderLevel; + + enum EShaderClass + { + SHADER_LIGHTING, + SHADER_OBJECT, + SHADER_AVATAR, + SHADER_ENVIRONMENT, + SHADER_INTERFACE, + SHADER_EFFECT, + SHADER_WINDLIGHT, + SHADER_WATER, + SHADER_DEFERRED, + SHADER_TRANSFORM, + SHADER_COUNT + }; + + // simple model of forward iterator + // http://www.sgi.com/tech/stl/ForwardIterator.html + class shader_iter + { + private: + friend bool operator == (shader_iter const & a, shader_iter const & b); + friend bool operator != (shader_iter const & a, shader_iter const & b); + + typedef std::vector::const_iterator base_iter_t; + public: + shader_iter() + { + } + + shader_iter(base_iter_t iter) : mIter(iter) + { + } + + LLGLSLShader & operator * () const + { + return **mIter; + } + + LLGLSLShader * operator -> () const + { + return *mIter; + } + + shader_iter & operator++ () + { + ++mIter; + return *this; + } + + shader_iter operator++ (int) + { + return mIter++; + } + + private: + base_iter_t mIter; + }; + + shader_iter beginShaders() const; + shader_iter endShaders() const; + + std::string getShaderDirPrefix(void) override; + + void updateShaderUniforms(LLGLSLShader * shader) override; + +private: + + // the list of shaders we need to propagate parameters to. + std::vector mShaderList; + +}; //LLBakingShaderMgr + +inline bool operator == (LLBakingShaderMgr::shader_iter const & a, LLBakingShaderMgr::shader_iter const & b) +{ + return a.mIter == b.mIter; +} + +inline bool operator != (LLBakingShaderMgr::shader_iter const & a, LLBakingShaderMgr::shader_iter const & b) +{ + return a.mIter != b.mIter; +} + +extern LLVector4 gShinyOrigin; + +#endif // LL_BAKING_SHADER_MGR_H diff --git a/indra/llappearanceutility/llbakingtexlayer.cpp b/indra/llappearanceutility/llbakingtexlayer.cpp new file mode 100644 index 00000000000..3427331a964 --- /dev/null +++ b/indra/llappearanceutility/llbakingtexlayer.cpp @@ -0,0 +1,373 @@ +/** + * @file llbakingtexlayer.cpp + * @brief Implementation of LLBakingTexLayer class + * + * $LicenseInfo:firstyear=2012&license=viewerlgpl$ + * Second Life Viewer Source Code + * Copyright (C) 2012, 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 "linden_common.h" + +#include "indra_constants.h" +#include "llappappearanceutility.h" +#include "llavatarappearance.h" +#include "llbakingtexlayer.h" +#include "llbakingwearable.h" +#include "llfasttimer.h" +#include "lllocaltextureobject.h" +#include "llimagej2c.h" +#include "llwearabledata.h" +#include "llmd5.h" +#include "llbakingavatar.h" + +//#define DEBUG_TEXTURE_IDS 1 + +static const char* BAKE_HASH_VERSION = "3"; + +using namespace LLAvatarAppearanceDefines; + +LLBakingTexLayerSetBuffer::LLBakingTexLayerSetBuffer(LLTexLayerSet* const owner, S32 width, S32 height) + : LLTexLayerSetBuffer(owner), + LLBakingTexture( width, height, 4 ) +{} + +// virtual +LLBakingTexLayerSetBuffer::~LLBakingTexLayerSetBuffer() +{ + destroyGLTexture(); +} + +bool LLBakingTexLayerSetBuffer::render() +{ + bool result = false; + + preRenderTexLayerSet(); + result = renderTexLayerSet(nullptr); + postRenderTexLayerSet(result); + + return result; +} + +static LLFastTimer::DeclareTimer FTM_MID_RENDER("midRenderTexLayerSet"); +static LLFastTimer::DeclareTimer FTM_CREATE_J2C("Encode J2C image."); +void LLBakingTexLayerSetBuffer::midRenderTexLayerSet(bool success) +{ + LL_RECORD_BLOCK_TIME(FTM_MID_RENDER); + if (!mTexLayerSet->isVisible()) + { + // Should have used IMG_INVISIBLE during hash id generation? + LL_ERRS() << "Rendered texture for non-visible tex layer set!" << LL_ENDL; + } + + if (!success) + { + throw LLAppException(RV_UNABLE_TO_BAKE, " Rendering process failed."); + } + + // Get the COLOR information from our texture + LL_DEBUGS() << "glReadPixels..." << LL_ENDL; + LL_DEBUGS() << "getCompositeWidth()" << getCompositeWidth() << "getCompositeHeight()" << getCompositeHeight() << LL_ENDL; + + U8* baked_color_data = new U8[ getCompositeWidth() * getCompositeHeight() * 4 ]; + glReadPixels(getCompositeOriginX(), getCompositeOriginY(), + getCompositeWidth(), getCompositeHeight(), + GL_RGBA, GL_UNSIGNED_BYTE, baked_color_data ); + stop_glerror(); + + // Get the MASK information from our texture + LLGLSUIDefault gls_ui; + LL_DEBUGS() << "Creating baked mask image raw.." << LL_ENDL; + LLPointer baked_mask_image = new LLImageRaw(getCompositeWidth(), getCompositeHeight(), 1 ); + U8* baked_mask_data = baked_mask_image->getData(); + + LL_DEBUGS() << "Gathering Morph Mask Alpha..." << LL_ENDL; + mTexLayerSet->gatherMorphMaskAlpha(baked_mask_data, + getCompositeOriginX(), getCompositeOriginY(), + getCompositeWidth(), getCompositeHeight(), nullptr); + + // Create the baked image from our color and mask information + const S32 baked_image_components = 5; // red green blue [bump] clothing + LL_DEBUGS() << "Creating baked image raw.." << LL_ENDL; + LLPointer baked_image = new LLImageRaw( getCompositeWidth(), getCompositeHeight(), baked_image_components ); + U8* baked_image_data = baked_image->getData(); + S32 i = 0; + LL_DEBUGS() << "Running ugly loop..." << LL_ENDL; + for (S32 u=0; u < getCompositeWidth(); u++) + { + for (S32 v=0; v < getCompositeHeight(); v++) + { + baked_image_data[5*i + 0] = baked_color_data[4*i + 0]; + baked_image_data[5*i + 1] = baked_color_data[4*i + 1]; + baked_image_data[5*i + 2] = baked_color_data[4*i + 2]; + baked_image_data[5*i + 3] = baked_color_data[4*i + 3]; // alpha should be correct for eyelashes. + baked_image_data[5*i + 4] = baked_mask_data[i]; + i++; + } + } + + { + LL_RECORD_BLOCK_TIME(FTM_CREATE_J2C); + LL_DEBUGS() << "Creating J2C..." << LL_ENDL; + mCompressedImage = new LLImageJ2C; + const char* comment_text = LINDEN_J2C_COMMENT_PREFIX "RGBHM"; // writes into baked_color_data. 5 channels (rgb, heightfield/alpha, mask) + if (!mCompressedImage->encode(baked_image, comment_text)) + { + throw LLAppException(RV_UNABLE_TO_ENCODE); + } + } + + delete [] baked_color_data; +} + +LLBakingTexLayerSet::LLBakingTexLayerSet(LLAvatarAppearance* const appearance) : + LLTexLayerSet(appearance) +{ +} + +// virtual +LLBakingTexLayerSet::~LLBakingTexLayerSet() +{ +} + +// Ignored. +void LLBakingTexLayerSet::requestUpdate() +{ +} + +void LLBakingTexLayerSet::createComposite() +{ + if(!mComposite) + { + const LLBakingAvatar* avatar = dynamic_cast (mAvatarAppearance); + S32 width = avatar->bakeTextureSize(); + S32 height = avatar->bakeTextureSize(); + + LL_DEBUGS() << "Creating composite with width and height " << width << " " << height << LL_ENDL; + + mComposite = new LLBakingTexLayerSetBuffer(this, width, height); + } +} + +LLSD LLBakingTexLayerSet::computeTextureIDs() const +{ + const LLAvatarAppearanceDictionary::BakedEntry *baked_dict = + LLAvatarAppearance::getDictionary()->getBakedTexture(getBakedTexIndex()); +#ifdef DEBUG_TEXTURE_IDS + const std::string& slot_name = LLAvatarAppearance::getDictionary()->getTexture( + LLAvatarAppearance::getDictionary()->bakedToLocalTextureIndex(getBakedTexIndex()) )->mDefaultImageName; + const LLAvatarAppearanceDictionary::TextureEntry* entry = LLAvatarAppearance::getDictionary()->getTexture(baked_dict->mTextureIndex); + LL_DEBUGS() << "-----------------------------------------------------------------" << LL_ENDL; + LL_DEBUGS() << "BakedTexIndex = " << (S32) getBakedTexIndex() << " (" << slot_name << ") " + << "BakedEntry::mTextureIndex = " << (S32) baked_dict->mTextureIndex + << " (" << entry->mDefaultImageName + << ")" << LL_ENDL; + //LL_DEBUGS() << "LLAvatarAppearanceDictionary::getTEWearableType(" << baked_dict->mTextureIndex << ") = " << (S32) LLAvatarAppearanceDictionary::getTEWearableType(baked_dict->mTextureIndex) << LL_ENDL; + + texture_vec_t::const_iterator idx_iter = baked_dict->mLocalTextures.begin(); + texture_vec_t::const_iterator idx_end = baked_dict->mLocalTextures.end(); + std::ostringstream idx_str; + for (; idx_iter != idx_end; ++idx_iter) + { + entry = LLAvatarAppearance::getDictionary()->getTexture((*idx_iter)); + idx_str << (*idx_iter) << " (" << entry->mDefaultImageName + << ";" << LLWearableType::getInstance()->getTypeName( entry->mWearableType ) + << "), "; + } + LL_DEBUGS() << "BakedEntry::mLocalTextures: " << idx_str.str() << LL_ENDL; + wearables_vec_t::const_iterator type_iter = baked_dict->mWearables.begin(); + wearables_vec_t::const_iterator type_end = baked_dict->mWearables.end(); + std::ostringstream type_str; + for (; type_iter != type_end; ++type_iter) + { + type_str << (S32) (*type_iter) << " (" + << LLWearableType::getInstance()->getTypeName( (*type_iter) ) + << "), "; + } + LL_DEBUGS() << "BakedEntry::mWearables: " << type_str.str() << LL_ENDL; + //LL_DEBUGS() << "BakedEntry::mWearablesHashID: " << baked_dict->mWearablesHashID << LL_ENDL; +#endif + + LLMD5 hash; + std::set texture_ids; + + bool is_visible = true; + bool hash_computed = computeLayerListTextureIDs(hash, texture_ids, mLayerList, is_visible); + if (is_visible) + { + hash_computed |= computeLayerListTextureIDs(hash, texture_ids, mMaskLayerList, is_visible); + } + + LLUUID hash_id; + if (!is_visible) + { + hash_id = IMG_INVISIBLE; + texture_ids.clear(); + } + else if (hash_computed) + { + if ((getBakedTexIndex() == EBakedTextureIndex::BAKED_LEFT_ARM) || + (getBakedTexIndex() == EBakedTextureIndex::BAKED_LEFT_LEG) || + (getBakedTexIndex() == EBakedTextureIndex::BAKED_AUX1) || + (getBakedTexIndex() == EBakedTextureIndex::BAKED_AUX2) || + (getBakedTexIndex() == EBakedTextureIndex::BAKED_AUX3)) + { + hash.update(BAKE_HASH_VERSION); + } + + hash.update((const unsigned char*)baked_dict->mWearablesHashID.mData, UUID_BYTES); + hash.finalize(); + hash.raw_digest(hash_id.mData); + } + + if (hash_id.isNull()) + { + hash_id = IMG_DEFAULT_AVATAR; + } + + if (getBakedTexIndex() == EBakedTextureIndex::BAKED_SKIRT) + { + if (getAvatarAppearance()->getWearableData()->getWearableCount(LLWearableType::WT_SKIRT) == 0) + { + hash_id = IMG_DEFAULT_AVATAR; + texture_ids.clear(); + } + } + LLSD sd; + sd["hash_id"] = hash_id; + sd["texture_ids"] = LLSD::emptyArray(); + std::set::iterator id_iter = texture_ids.begin(); + std::set::iterator id_end = texture_ids.end(); + for (; id_iter != id_end; ++id_iter) + { + sd["texture_ids"].append( *id_iter ); + } + return sd; +} + +bool LLBakingTexLayerSet::computeLayerListTextureIDs(LLMD5& hash, + std::set& texture_ids, + const layer_list_t& layer_list, + bool& is_visible) const +{ + is_visible = true; + bool hash_computed = false; + layer_list_t::const_iterator iter = layer_list.begin(); + layer_list_t::const_iterator end = layer_list.end(); + for (; iter != end; ++iter) + { + const LLTexLayerInterface* layer_template = *iter; + LLWearableType::EType wearable_type = layer_template->getWearableType(); + ETextureIndex te = layer_template->getLocalTextureIndex(); + U32 num_wearables = getAvatarAppearance()->getWearableData()->getWearableCount(wearable_type); +#ifdef DEBUG_TEXTURE_IDS + const LLAvatarAppearanceDictionary::TextureEntry* entry = LLAvatarAppearance::getDictionary()->getTexture(te); + if (entry) + { + LL_DEBUGS() << "LLTexLayerInterface(" << layer_template->getName() << ") type = " + << (S32) wearable_type << " (" + << LLWearableType::getInstance()->getTypeName( wearable_type ) << ") te = " + << (S32) te << " ("<< entry->mDefaultImageName + << ";" << LLWearableType::getInstance()->getTypeName( entry->mWearableType ) + << ") wearable_count = " << num_wearables << LL_ENDL; + } + else + { + LL_DEBUGS() << "LLTexLayerInterface(" << layer_template->getName() << ") type = " + << (S32) wearable_type << " (" + << LLWearableType::getInstance()->getTypeName( wearable_type ) + << ") wearable_count = " << num_wearables << LL_ENDL; + } +#endif + if (LLWearableType::WT_INVALID == wearable_type) + { + //LL_DEBUGS() << "Skipping invalid wearable type" << LL_ENDL; + continue; + } + + for (U32 i = 0; i < num_wearables; i++) + { + LLBakingWearable* wearable = dynamic_cast ( + getAvatarAppearance()->getWearableData()->getWearable(wearable_type, i)); + if (!wearable) + { + //LL_DEBUGS() << "Skipping wearable" << LL_ENDL; + continue; + } +#ifdef DEBUG_TEXTURE_IDS + S32 num_ltos = wearable->getLocalTextureListSeq().size(); + LL_DEBUGS() << "LLWearable (" << wearable->getName() << ") type = " + << (S32) wearable->getAssetType() << " (" + << LLAssetType::lookup(wearable->getAssetType()) + << ") num_ltos = " << num_ltos << LL_ENDL; +#endif + LLLocalTextureObject *lto = wearable->getLocalTextureObject(te); + if (lto) + { +#ifdef DEBUG_TEXTURE_IDS + LL_DEBUGS() << "LocalTextureObject id = " << lto->getID() << " num texlayers = " << lto->getNumTexLayers() << LL_ENDL; +#endif + // Hash texture id + LLUUID texture_id = lto->getID(); + if (IMG_INVISIBLE == texture_id) + { + is_visible = false; + } + hash.update((const unsigned char*)texture_id.mData, UUID_BYTES); + hash_computed = true; + // Add texture to list. + texture_ids.insert(texture_id); + } +#ifdef DEBUG_TEXTURE_IDS + else + { + LL_DEBUGS() << "LLWearable -- no LocalTextureObject for te " << (S32) te << LL_ENDL; + } + + + for(S32 i = 0; i < (S32)TEX_NUM_INDICES; i++) + { + lto = wearable->getLocalTextureObject(i); + if (lto) + { + LL_DEBUGS() << "LTO (" << i << ") id = " << lto->getID() << " num texlayers = " << lto->getNumTexLayers() << LL_ENDL; + } + } +#endif + + for( LLVisualParam* param = getAvatarAppearance()->getFirstVisualParam(); + param; param = getAvatarAppearance()->getNextVisualParam() ) + { + // cross-wearable parameters are not authoritative, as they are driven by a different wearable. + if( (((LLViewerVisualParam*)param)->getWearableType() == wearable_type) && + (!((LLViewerVisualParam*)param)->getCrossWearable()) ) + { + std::ostringstream ostr; + F32 weight = wearable->getVisualParamWeight(param->getID()); + ostr << param->getID() << " " << weight; + hash.update(ostr.str()); + hash_computed = true; + } + } + } + } + return hash_computed; +} + diff --git a/indra/llappearanceutility/llbakingtexlayer.h b/indra/llappearanceutility/llbakingtexlayer.h new file mode 100644 index 00000000000..dc82b27ce22 --- /dev/null +++ b/indra/llappearanceutility/llbakingtexlayer.h @@ -0,0 +1,77 @@ +/** + * @file llbakingtexlayer.h + * @brief Declaration of LLBakingTexLayerSet. + * + * $LicenseInfo:firstyear=2012&license=viewerlgpl$ + * Second Life Viewer Source Code + * Copyright (C) 2012, Linden Research, Inc. + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; + * version 2.1 of the License only. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA + * + * Linden Research, Inc., 945 Battery Street, San Francisco, CA 94111 USA + * $/LicenseInfo$ + */ + +#ifndef LL_LLBAKINGTEXLAYER_H +#define LL_LLBAKINGTEXLAYER_H + +#include "llbakingtexture.h" +#include "llimagej2c.h" +#include "llpointer.h" +#include "lltexlayer.h" + +class LLMD5; + +class LLBakingTexLayerSetBuffer : public LLTexLayerSetBuffer, public LLBakingTexture +{ + LOG_CLASS(LLBakingTexLayerSetBuffer); +public: + LLBakingTexLayerSetBuffer(LLTexLayerSet* const owner, S32 width, S32 height); + virtual ~LLBakingTexLayerSetBuffer(); + + LLImageJ2C* getCompressedImage() { return mCompressedImage; } + + bool render(); + bool bindDebugImage(const S32 stage = 0) override { return false; } + bool isActiveFetching() override { return false; }; + +private: + S32 getCompositeOriginX() const override { return 0; } + S32 getCompositeOriginY() const override { return 0; } + S32 getCompositeWidth() const override { return getFullWidth(); } + S32 getCompositeHeight() const override { return getFullHeight(); } + void midRenderTexLayerSet(bool success) override; + + LLPointer mCompressedImage; +}; + +class LLBakingTexLayerSet : public LLTexLayerSet +{ +public: + LLBakingTexLayerSet(LLAvatarAppearance* const appearance); + virtual ~LLBakingTexLayerSet(); + + LLSD computeTextureIDs() const; + bool computeLayerListTextureIDs(LLMD5& hash, + std::set& texture_ids, + const layer_list_t& layer_list, + bool& is_visible) const; + + void requestUpdate() override; + void createComposite() override; +}; + +#endif /* LL_LLBAKINGTEXLAYER_H */ + diff --git a/indra/llappearanceutility/llbakingtexture.cpp b/indra/llappearanceutility/llbakingtexture.cpp new file mode 100644 index 00000000000..ae83081aefe --- /dev/null +++ b/indra/llappearanceutility/llbakingtexture.cpp @@ -0,0 +1,81 @@ +/** + * @file llbakingtexture.cpp + * @brief Implementation of LLBakingTexture class. + * + * $LicenseInfo:firstyear=2012&license=viewerlgpl$ + * Second Life Viewer Source Code + * Copyright (C) 2012, 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$ + */ + +// linden includes +#include "linden_common.h" + +// project includes +#include "llbakingtexture.h" +#include "llgltexture.h" +#include "llimage.h" + +static const bool USE_MIP_MAPS = true; + +LLBakingTexture::LLBakingTexture(const LLUUID& id, const LLImageRaw* raw) + : LLGLTexture(raw, USE_MIP_MAPS), + mID(id) +{ +} + +LLBakingTexture::LLBakingTexture(bool usemipmaps) + : LLGLTexture(usemipmaps), + mID(LLUUID::null) +{ +} + +LLBakingTexture::LLBakingTexture(const U32 width, const U32 height, const U8 components, bool usemipmaps) + : LLGLTexture(width, height, components, USE_MIP_MAPS), + mID(LLUUID::null) +{ +} + +// virtual +LLBakingTexture::~LLBakingTexture() +{ +} + +void LLBakingTexture::setKnownDrawSize(S32 width, S32 height) +{ + //nothing here. + LL_ERRS() << "Not implemented." << LL_ENDL; +} + +bool LLBakingTexture::bindDefaultImage(S32 stage) +{ + LL_ERRS() << "Not implemented." << LL_ENDL; + return false; +} + +void LLBakingTexture::forceImmediateUpdate() +{ + LL_ERRS() << "Not implemented." << LL_ENDL; +} + +void LLBakingTexture::updateBindStatsForTester() +{ + LL_ERRS() << "Not implemented." << LL_ENDL; +} + diff --git a/indra/llappearanceutility/llbakingtexture.h b/indra/llappearanceutility/llbakingtexture.h new file mode 100644 index 00000000000..50b4193b2ee --- /dev/null +++ b/indra/llappearanceutility/llbakingtexture.h @@ -0,0 +1,69 @@ +/** + * @file llbakingtexture.h + * @brief Declaration of LLBakingTexture class. + * + * $LicenseInfo:firstyear=2012&license=viewerlgpl$ + * Second Life Viewer Source Code + * Copyright (C) 2012, Linden Research, Inc. + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; + * version 2.1 of the License only. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA + * + * Linden Research, Inc., 945 Battery Street, San Francisco, CA 94111 USA + * $/LicenseInfo$ + */ + +#ifndef LL_LLBAKINGTEXTURE_H +#define LL_LLBAKINGTEXTURE_H + +#include "llgltexture.h" +#include "lluuid.h" + +class LLImageRaw; + +class LLBakingTexture : public LLGLTexture +{ +public: + enum + { + LOCAL_TEXTURE, + BAKING_TEXTURE, + INVALID_TEXTURE_TYPE + }; + LLBakingTexture(const LLUUID& id, const LLImageRaw* raw); + LLBakingTexture(bool usemipmaps); + LLBakingTexture(const U32 width, const U32 height, const U8 components, bool usemipmaps = true); + const LLUUID& getID() const override { return mID; } + S8 getType() const override { return BAKING_TEXTURE; } + + // Not implemented. + void setKnownDrawSize(S32 width, S32 height) override; + bool bindDefaultImage(const S32 stage = 0) override ; + void forceImmediateUpdate() override; + void updateBindStatsForTester() override ; + bool bindDebugImage(const S32 stage = 0) override { return false; } + bool isActiveFetching() override { return false; } + +protected: + virtual ~LLBakingTexture(); + LOG_CLASS(LLBakingTexture); +private: + // Hide default constructor. + LLBakingTexture() {} + + LLUUID mID; +}; + +#endif /* LL_LLBAKINGTEXTURE_H */ + diff --git a/indra/llappearanceutility/llbakingwearable.cpp b/indra/llappearanceutility/llbakingwearable.cpp new file mode 100644 index 00000000000..0e5251aba1a --- /dev/null +++ b/indra/llappearanceutility/llbakingwearable.cpp @@ -0,0 +1,77 @@ +/** + * @file llbakingwearable.cpp + * @brief Implementation of LLBakingWearable class + * + * $LicenseInfo:firstyear=2012&license=viewerlgpl$ + * Second Life Viewer Source Code + * Copyright (C) 2012, 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 "linden_common.h" + +#include "llavatarappearance.h" +#include "llavatarappearancedefines.h" +#include "llbakingwearable.h" +#include "llmd5.h" +#include "indra_constants.h" + +using namespace LLAvatarAppearanceDefines; + +LLBakingWearable::LLBakingWearable() +{ +} + +// virtual +LLBakingWearable::~LLBakingWearable() +{ +} + +// virtual +void LLBakingWearable::setUpdated() const +{ +} + +// virtual +void LLBakingWearable::addToBakedTextureHash(LLMD5& hash) const +{ +} + +// virtual +LLUUID LLBakingWearable::getDefaultTextureImageID(ETextureIndex index) const +{ + const LLAvatarAppearanceDictionary::TextureEntry *texture_dict = LLAvatarAppearance::getDictionary()->getTexture(index); + const std::string &default_image_name = texture_dict->mDefaultImageName; + if (default_image_name == "") + { + return IMG_DEFAULT_AVATAR; + } + else + { + //return LLUUID(gSavedSettings.getString(default_image_name)); + // *TODO: Fix this. + return LLUUID::null; + } +} + +void LLBakingWearable::asLLSD(LLSD& sd) const +{ + // stub implementation. TODO: fill in. +} diff --git a/indra/llappearanceutility/llbakingwearable.h b/indra/llappearanceutility/llbakingwearable.h new file mode 100644 index 00000000000..bb96dc37099 --- /dev/null +++ b/indra/llappearanceutility/llbakingwearable.h @@ -0,0 +1,48 @@ +/** + * @file llbakingwearable.h + * @brief Declaration of LLBakingWearable class + * + * $LicenseInfo:firstyear=2012&license=viewerlgpl$ + * Second Life Viewer Source Code + * Copyright (C) 2012, Linden Research, Inc. + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; + * version 2.1 of the License only. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA + * + * Linden Research, Inc., 945 Battery Street, San Francisco, CA 94111 USA + * $/LicenseInfo$ + */ + +#ifndef LL_LLBAKINGWEARABLE_H +#define LL_LLBAKINGWEARABLE_H + +#include "llwearable.h" +#include "llmd5.h" + +class LLBakingWearable : public LLWearable +{ +public: + LLBakingWearable(); + virtual ~LLBakingWearable(); + + virtual void setUpdated() const; + virtual void addToBakedTextureHash(LLMD5& hash) const; + virtual LLUUID getDefaultTextureImageID(LLAvatarAppearanceDefines::ETextureIndex index) const; + + void asLLSD(LLSD& sd) const; + +}; + +#endif /* LL_LLBAKINGWEARABLE_H */ + diff --git a/indra/llappearanceutility/llbakingwearablesdata.cpp b/indra/llappearanceutility/llbakingwearablesdata.cpp new file mode 100644 index 00000000000..18edb863480 --- /dev/null +++ b/indra/llappearanceutility/llbakingwearablesdata.cpp @@ -0,0 +1,131 @@ +/** + * @file llbakingwearablesdata.cpp + * @brief Implementation of LLBakingWearablesData class + * + * $LicenseInfo:firstyear=2012&license=viewerlgpl$ + * Second Life Viewer Source Code + * Copyright (C) 2012, 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 "linden_common.h" + +#include "llbakingwearablesdata.h" +#include "llbakingwearable.h" + +using namespace LLAvatarAppearanceDefines; + +LLBakingWearablesData::LLBakingWearablesData() +{ +} + +// virtual +LLBakingWearablesData::~LLBakingWearablesData() +{ + std::for_each(mWearables.begin(), mWearables.end(), DeletePointer()); + mWearables.clear(); +} + +void LLBakingWearablesData::setWearableOutfit(LLSD& sd) +{ + LLSD::array_const_iterator type_iter = sd.beginArray(); + LLSD::array_const_iterator type_end = sd.endArray(); + S32 wearable_index = 0; + for (; type_iter != type_end && wearable_index < (S32) LLWearableType::WT_COUNT; ++type_iter, ++wearable_index) + { + LLSD::array_const_iterator wearable_iter = type_iter->beginArray(); + LLSD::array_const_iterator wearable_end = type_iter->endArray(); + for (; wearable_iter != wearable_end; ++wearable_iter) + { + if ( wearable_iter->isDefined() ) + { + LLBakingWearable* wearable = new LLBakingWearable(); + std::istringstream istr( (*wearable_iter)["contents"].asString() ); + wearable->importStream(istr, mAvatarAppearance); + + // Sanity check the wearable type. + if (wearable->getType() != wearable_index) + { + LL_WARNS() << "Unexpected wearable type! Expected " << wearable_index + << ", processed " << (S32) wearable->getType() << LL_ENDL; + // *TODO: Throw exception? + delete wearable; + continue; + } + mWearables.push_back(wearable); + + const LLWearableType::EType type = wearable->getType(); + if (wearable->getAssetType() == LLAssetType::AT_BODYPART) + { + // exactly one wearable per body part + setWearable(type,0,wearable); + } + else + { + pushWearable(type,wearable); + } + } + } + } + + wearable_list_t::const_iterator wearable_iter = mWearables.begin(); + wearable_list_t::const_iterator wearable_end = mWearables.end(); + for (; wearable_iter != wearable_end; ++wearable_iter) + { + LLBakingWearable* wearable = (*wearable_iter); + const bool removed = false; + wearableUpdated(wearable, removed); + } + + for(wearable_index = 0; wearable_index < (S32) LLWearableType::WT_COUNT; wearable_index++) + { + LLWearable* top_wearable = getTopWearable((LLWearableType::EType)wearable_index); + if (top_wearable) + { + top_wearable->writeToAvatar(mAvatarAppearance); + } + } +} + + +void LLBakingWearablesData::asLLSD(LLSD& sd) const +{ + sd = LLSD::emptyMap(); + wearableentry_map_t::const_iterator type_iter = mWearableDatas.begin(); + wearableentry_map_t::const_iterator type_end = mWearableDatas.end(); + for (; type_iter != type_end; ++type_iter) + { + LLSD wearable_type_sd = LLSD::emptyArray(); + LLWearableType::EType wearable_type = type_iter->first; + wearableentry_vec_t::const_iterator wearable_iter = type_iter->second.begin(); + wearableentry_vec_t::const_iterator wearable_end = type_iter->second.end(); + for (; wearable_iter != wearable_end; ++wearable_iter) + { + const LLBakingWearable* wearable = dynamic_cast(*wearable_iter); + LLSD wearable_sd; + wearable->asLLSD(wearable_sd); + wearable_type_sd.append(wearable_sd); + } + sd[LLWearableType::getInstance()->getTypeName(wearable_type)] = wearable_type_sd; + } +} + + + diff --git a/indra/llappearanceutility/llbakingwearablesdata.h b/indra/llappearanceutility/llbakingwearablesdata.h new file mode 100644 index 00000000000..1db2ca4bc12 --- /dev/null +++ b/indra/llappearanceutility/llbakingwearablesdata.h @@ -0,0 +1,55 @@ +/** + * @file llbakingwearablesdata.h + * @brief Declaration of LLBakingWearablesData class + * + * $LicenseInfo:firstyear=2012&license=viewerlgpl$ + * Second Life Viewer Source Code + * Copyright (C) 2012, Linden Research, Inc. + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; + * version 2.1 of the License only. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA + * + * Linden Research, Inc., 945 Battery Street, San Francisco, CA 94111 USA + * $/LicenseInfo$ + */ + +#ifndef LL_LLBAKINGWEARABLESDATA_H +#define LL_LLBAKINGWEARABLESDATA_H + +#include "llwearabledata.h" + +class LLBakingWearable; + +class LLBakingWearablesData : public LLWearableData +{ +public: + LLBakingWearablesData(); + virtual ~LLBakingWearablesData(); + + void setWearableOutfit(LLSD& sd); + + //-------------------------------------------------------------------- + // I/O methods + //-------------------------------------------------------------------- +public: + void asLLSD(LLSD& sd) const; + +private: + typedef std::vector wearable_list_t; + wearable_list_t mWearables; + +}; + +#endif /* LL_LLBAKINGWEARABLESDATA_H */ + diff --git a/indra/llappearanceutility/llbakingwindow.cpp b/indra/llappearanceutility/llbakingwindow.cpp new file mode 100644 index 00000000000..87991059323 --- /dev/null +++ b/indra/llappearanceutility/llbakingwindow.cpp @@ -0,0 +1,94 @@ +/** + * @file llbakingwindow.cpp + * @brief Implementation of LLBakingWindow class. + * + * $LicenseInfo:firstyear=2012&license=viewerlgpl$ + * Second Life Viewer Source Code + * Copyright (C) 2012, 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$ + */ + +// linden includes +#include "linden_common.h" + +// project includes +#include "llappappearanceutility.h" +#include "llbakingshadermgr.h" +#include "llbakingwindow.h" +#include "llgl.h" +#include "llgltexture.h" +#include "llvertexbuffer.h" + +LLBakingWindow::LLBakingWindow(S32 width, S32 height) +{ + const S32 WINDOW_ORIGIN_X = 0; + const S32 WINDOW_ORIGIN_Y = 0; + const U32 FLAGS = 32; // *TODO: Why did mapserver use this? mFlags looks unused. + const bool NO_FULLSCREEN = false; + const bool NO_CLEAR_BG = false; + const bool NO_DISABLE_VSYNC = false; + const bool NO_IGNORE_PIXEL_DEPTH = false; + const bool USE_GL = true; + mWindow = LLWindowManager::createWindow(this, + "appearanceutility", "Appearance Utility", + WINDOW_ORIGIN_X, WINDOW_ORIGIN_Y, + width, height, + FLAGS, + NO_FULLSCREEN, + NO_CLEAR_BG, + NO_DISABLE_VSYNC, //gSavedSettings.getBOOL("DisableVerticalSync"), + USE_GL, // not headless + NO_IGNORE_PIXEL_DEPTH); //gIgnorePixelDepth = false + + if (nullptr == mWindow) + { + throw LLAppException(RV_UNABLE_TO_INIT_GL); + } + + LLVertexBuffer::initClass(mWindow); + + gGL.init(true); + + if (!LLBakingShaderMgr::sInitialized) + { //immediately initialize shaders + LLBakingShaderMgr::sInitialized = true; + LLBakingShaderMgr::instance()->setShaders(); + } + + LLImageGL::initClass(mWindow, LLGLTexture::MAX_GL_IMAGE_CATEGORY, true, false); + + // mWindow->show(); + // mWindow->bringToFront(); + // mWindow->focusClient(); + // mWindow->gatherInput(); +} + +LLBakingWindow::~LLBakingWindow() +{ + if (mWindow) + { + LLWindowManager::destroyWindow(mWindow); + } + mWindow = nullptr; +} + +void LLBakingWindow::swapBuffers() +{ + mWindow->swapBuffers(); +} diff --git a/indra/llappearanceutility/llbakingwindow.h b/indra/llappearanceutility/llbakingwindow.h new file mode 100644 index 00000000000..a6bf1d87149 --- /dev/null +++ b/indra/llappearanceutility/llbakingwindow.h @@ -0,0 +1,45 @@ +/** + * @file llbakingwindow.h + * @brief Declaration of LLBakingWindow class. + * + * $LicenseInfo:firstyear=2012&license=viewerlgpl$ + * Second Life Viewer Source Code + * Copyright (C) 2012, Linden Research, Inc. + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; + * version 2.1 of the License only. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA + * + * Linden Research, Inc., 945 Battery Street, San Francisco, CA 94111 USA + * $/LicenseInfo$ + */ + +#ifndef LL_LLBAKINGWINDOW_H +#define LL_LLBAKINGWINDOW_H + +#include "llwindow.h" +#include "llwindowcallbacks.h" + +class LLBakingWindow : public LLWindowCallbacks +{ +public: + LLBakingWindow(S32 width, S32 height); + ~LLBakingWindow(); + + void swapBuffers(); +private: + LLWindow* mWindow; +}; + +#endif /* LL_LLBAKINGWINDOW_H */ + diff --git a/indra/llappearanceutility/llprocessparams.cpp b/indra/llappearanceutility/llprocessparams.cpp new file mode 100755 index 00000000000..ad1b44e794a --- /dev/null +++ b/indra/llappearanceutility/llprocessparams.cpp @@ -0,0 +1,281 @@ +/** + * @file llprocessparams.cpp + * @brief Implementation of LLProcessParams class. + * + * $LicenseInfo:firstyear=2012&license=viewerlgpl$ + * Second Life Viewer Source Code + * Copyright (C) 2012, 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$ + */ + +// linden includes +#include "linden_common.h" + +#include "llsd.h" +#include "llsdserialize.h" +#include "llsdutil.h" +#include "llsdutil_math.h" +#include "llstl.h" +#include "llmath.h" +#include "llquantize.h" + +// appearance includes +#include "lltexturemanagerbridge.h" +#include "llwearabletype.h" +#include "llavatarappearancedefines.h" + +// project includes +#include "llappappearanceutility.h" +#include "llbakingavatar.h" +#include "llbakingtexlayer.h" +#include "llbakingwearable.h" +#include "llbakingwearablesdata.h" +#include "llprocessparams.h" + +#define APPEARANCE_PARAM_VERSION 11000 + +const U32 FULL_RIG_JOINT_COUNT = 20; + +using namespace LLAvatarAppearanceDefines; + +// Create a bridge to the viewer texture manager. +class LLNullTextureManagerBridge : public LLTextureManagerBridge +{ +public: + LLPointer getLocalTexture(bool usemipmaps = true, bool generate_gl_tex = true) override + { + return nullptr; + } + + LLPointer getLocalTexture(const U32 width, const U32 height, const U8 components, bool usemipmaps, bool generate_gl_tex = true) override + { + return nullptr; + } + + LLGLTexture* getFetchedTexture(const LLUUID &image_id) override + { + return nullptr; + } +}; + +LLSD dump_joint_offsets_for_avatar(LLBakingAvatar& avatar) +{ + LLSD joints = LLSD::emptyArray(); + + for (U32 joint_index = 0;; joint_index++) + { + LLJoint* pJoint = avatar.getCharacterJoint(joint_index); + if (!pJoint) + { + break; + } + LLVector3 pos; + LLUUID mesh_id; + if (pJoint->hasAttachmentPosOverride(pos, mesh_id)) + { + LLSD info; + info["name"] = pJoint->getName(); + info["pos"] = ll_sd_from_vector3(pos); + info["mesh_id"] = mesh_id; + joints.append(info); + } + } + + return joints; +} + +void LLProcessParams::process(std::ostream& output) +{ + if (!mInputData.has("wearables")) throw LLAppException(RV_UNABLE_TO_PARSE, " Missing wearables"); + + // Create a null-texture manager bridge. + gTextureManagerBridgep = new LLNullTextureManagerBridge(); + + // Construct the avatar. + LLBakingWearablesData wearable_data; + LLBakingAvatar avatar(&wearable_data, mApp->bakeTextureSize()); + avatar.initInstance(); + wearable_data.setAvatarAppearance(&avatar); + + //Process the params data for joint information + //bool bodySizeSet = processInputDataForJointInfo( avatar ); + + // Extract and parse wearables. + wearable_data.setWearableOutfit(mInputData["wearables"]); + + // Set appearance parameter to flag server-side baking. + avatar.setVisualParamWeight(APPEARANCE_PARAM_VERSION, 1.0f); + + avatar.setSex( (avatar.getVisualParamWeight( "male" ) > 0.5f) ? SEX_MALE : SEX_FEMALE ); + + avatar.updateVisualParams(); + + // Extract texture ids, texture hashes, and avatar scale. + LLSD texture_ids = LLSD::emptyMap(); + + //Process the params data for joint information + bool bodySizeSet = processInputDataForJointInfo( avatar ); + + //if we didn't compute a body size from a mesh attachment that included + //joint offsets we need to do it now + if (!bodySizeSet ) + { + avatar.computeBodySize(); + } + + for (U32 baked_index = 0; baked_index < BAKED_NUM_INDICES; baked_index++) + { + EBakedTextureIndex bake_type = (EBakedTextureIndex) baked_index; + LLBakingTexLayerSet* layer_set = dynamic_cast(avatar.getAvatarLayerSet(bake_type)); + const std::string& slot_name = LLAvatarAppearance::getDictionary()->getTexture( + LLAvatarAppearance::getDictionary()->bakedToLocalTextureIndex(bake_type) )->mDefaultImageName; + texture_ids[slot_name] = layer_set->computeTextureIDs(); + } + + // Extract visual params + U32 count = 0; + LLSD params = LLSD::emptyMap(); + LLSD debug_params = LLSD::emptyMap(); + for (LLViewerVisualParam* param = (LLViewerVisualParam*)avatar.getFirstVisualParam(); + param; + param = (LLViewerVisualParam*)avatar.getNextVisualParam()) + { + if (param->getGroup() == VISUAL_PARAM_GROUP_TWEAKABLE || + param->getGroup() == VISUAL_PARAM_GROUP_TRANSMIT_NOT_TWEAKABLE) // do not transmit params of group VISUAL_PARAM_GROUP_TWEAKABLE_NO_TRANSMIT + { + const F32 param_value = param->getWeight(); + const U8 new_weight = F32_to_U8(param_value, param->getMinWeight(), param->getMaxWeight()); + LLSD body; + body["name"] = param->getName(); + body["value"] = param_value; + body["weight"] = new_weight; + debug_params[LLSD(param->getID()).asString()] = body; + params.append(new_weight); + count++; + } + } + + // Output + LLSD result; + result["success"] = true; + result["params"] = params; + result["debug_params"] = debug_params; + result["slot_textures"] = texture_ids; + result["avatar_scale"] = ll_sd_from_vector3(avatar.mBodySize + avatar.mAvatarOffset); + result["dump_joint_offsets"] = dump_joint_offsets_for_avatar(avatar); + output << LLSDOStreamer(result); +} + +bool LLProcessParams::processInputDataForJointInfo( LLBakingAvatar& avatar ) +{ + bool returnResult = false; + + if ( !mInputData.has("skindata") || mInputData["skindata"].isUndefined() ) + { + LL_DEBUGS() << "Skipping missing skindata" << LL_ENDL; + return returnResult; + } + + const LLSD& skindata = mInputData["skindata"]; + + //float pelvisOffset = 0.0f; + std::vector jointNames; + std::vector jointOffsets; + + LLSD::map_const_iterator skinIter = skindata.beginMap(); + LLSD::map_const_iterator skinIterEnd = skindata.endMap(); + + for ( ; skinIter!=skinIterEnd; ++skinIter ) + { + const LLSD& skin = skinIter->second; + const char *uuid_str = skinIter->first.c_str(); + const LLUUID mesh_id(uuid_str); + + if ( !skin.has("joint_names") || !skin.has("joint_offset") ) + { + throw LLAppException(RV_INVALID_SKIN_BLOCK); + } + + // Build list of joints + { + LLSD::array_const_iterator iter(skin["joint_names"].beginArray()); + LLSD::array_const_iterator iter_end(skin["joint_names"].endArray()); + for ( ; iter != iter_end; ++iter ) + { + jointNames.push_back( iter->asString() ); + } + } + // Extract joint offsets + { + LLSD::array_const_iterator iter(skin["joint_offset"].beginArray()); + LLSD::array_const_iterator iter_end(skin["joint_offset"].endArray()); + for ( ; iter != iter_end; ++iter ) + { + jointOffsets.push_back( ll_vector3_from_sd(*iter) ); + } + } + + // get at the *optional* pelvis offset + //if ( skin.has("pelvis_offset") ) + //{ + // pelvisOffset = skin["pelvis_offset"].asReal(); + //} + // Now apply the extracted joint data to the avatar + U32 jointCount = narrow(jointNames.size()); + + if ( jointOffsets.size() < jointCount ) + { + throw LLAppException(RV_INVALID_SKIN_BLOCK); + } + + bool fullRig = ( jointCount>= FULL_RIG_JOINT_COUNT ) ? true : false; + //bool pelvisGotSet = false; + + returnResult = fullRig; + + if ( fullRig ) + { + for ( U32 i=0; istoreCurrentXform( jointOffsets[i] ); + + bool active_override_changed = false; + pJoint->addAttachmentPosOverride(jointOffsets[i], mesh_id, "", active_override_changed); + } + } + + avatar.computeBodySize(); + avatar.mRoot->touch(); + avatar.mRoot->updateWorldMatrixChildren(); + + } + + jointNames.clear(); + jointOffsets.clear(); + } + return returnResult; +} diff --git a/indra/llappearanceutility/llprocessparams.h b/indra/llappearanceutility/llprocessparams.h new file mode 100644 index 00000000000..6df893fe219 --- /dev/null +++ b/indra/llappearanceutility/llprocessparams.h @@ -0,0 +1,49 @@ +/** + * @file llprocessparams.h + * @brief Declaration of LLProcessParams class. + * + * $LicenseInfo:firstyear=2012&license=viewerlgpl$ + * Second Life Viewer Source Code + * Copyright (C) 2012, Linden Research, Inc. + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; + * version 2.1 of the License only. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA + * + * Linden Research, Inc., 945 Battery Street, San Francisco, CA 94111 USA + * $/LicenseInfo$ + */ + +#ifndef LL_LLPROCESSPARAMS_H +#define LL_LLPROCESSPARAMS_H + +#include "llbakingprocess.h" + +class LLBakingAvatar; +class LLProcessParams : public LLBakingProcess +{ +public: + LLProcessParams(LLAppAppearanceUtility* app) : + LLBakingProcess(app) {} + + void process(std::ostream& output) override; +private: + + bool processInputDataForJointInfo( LLBakingAvatar& avatar ); +}; + + + + +#endif /* LL_LLPROCESSPARAMS_H */ + diff --git a/indra/llappearanceutility/llprocessskin.cpp b/indra/llappearanceutility/llprocessskin.cpp new file mode 100644 index 00000000000..a3d4d3c6f30 --- /dev/null +++ b/indra/llappearanceutility/llprocessskin.cpp @@ -0,0 +1,118 @@ +/** + * @file llprocessskin.cpp + * @brief Implementation of LLProcesSkin class. + * + * $LicenseInfo:firstyear=2012&license=viewerlgpl$ + * Second Life Viewer Source Code + * Copyright (C) 2012, 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$ + */ + +// linden includes +#include "linden_common.h" + +#include "llsd.h" +#include "llsdserialize.h" +#include "llsdutil.h" +#include "llsdutil_math.h" +#include "llstl.h" +#include "llmath.h" +#include "m4math.h" +#include "v4math.h" + +// project includes +#include "llappappearanceutility.h" +#include "llprocessskin.h" + +void LLProcessSkin::process(std::ostream& output) +{ + const LLSD& dataBlock = mInputData; + LLSD skinData = LLSD::emptyMap(); + + LLSD::map_const_iterator skinIter = dataBlock.beginMap(); + LLSD::map_const_iterator skinIterEnd = dataBlock.endMap(); + + for ( ; skinIter!=skinIterEnd; ++skinIter ) + { + const LLSD& skin = skinIter->second; + if ( !skin.has("joint_names") || !skin.has("alt_inverse_bind_matrix") ) + { + throw LLAppException(RV_INVALID_SKIN_BLOCK); + } + + LLSD entry = LLSD::emptyMap(); + + //get all joint names from the skin + { + entry["joint_names"] = LLSD::emptyArray(); + LLSD& joint_names = entry["joint_names"]; + LLSD::array_const_iterator iter(skin["joint_names"].beginArray()); + LLSD::array_const_iterator iter_end(skin["joint_names"].endArray()); + for ( ; iter != iter_end; ++iter ) + { + LL_DEBUGS() << "joint: " << iter->asString() << LL_ENDL; + joint_names.append(*iter); + } + } + //get at the translational component for the joint offsets + { + entry["joint_offset"] = LLSD::emptyArray(); + LLSD& joint_offsets = entry["joint_offset"]; + LLSD::array_const_iterator iter(skin["alt_inverse_bind_matrix"].beginArray()); + LLSD::array_const_iterator iter_end(skin["alt_inverse_bind_matrix"].endArray()); + //just get at the translational component + for ( ; iter != iter_end; ++iter ) + { + LLMatrix4 mat; + for (U32 j = 0; j < 4; j++) + { + for (U32 k = 0; k < 4; k++) + { + mat.mMatrix[j][k] = static_cast((*iter)[j*4+k].asReal()); + } + } + joint_offsets.append( ll_sd_from_vector3( mat.getTranslation() )); + LL_DEBUGS() << "offset: [" << mat.getTranslation()[0] << " " + << mat.getTranslation()[1] << " " + << mat.getTranslation()[2] << " ]" << LL_ENDL; + } + } + + //get at the *optional* pelvis offset + if (skin.has("pelvis_offset")) + { + entry["pelvis_offset"] = skin["pelvis_offset"]; + } + else + { + entry["pelvis_offset"] = LLSD::Real(0.f); + } + + //add block to outgoing result llsd + skinData[skinIter->first] = entry; + } + + //dump the result llsd into the outgoing output + LLSD result; + result["success"] = true; + result["skindata"] = skinData; + LL_DEBUGS() << "---------------------------\n" << result << LL_ENDL; + output << LLSDOStreamer(result); +} + diff --git a/indra/llappearanceutility/llprocessskin.h b/indra/llappearanceutility/llprocessskin.h new file mode 100644 index 00000000000..a3cc8c70876 --- /dev/null +++ b/indra/llappearanceutility/llprocessskin.h @@ -0,0 +1,43 @@ +/** + * @file llprocessskin.h + * @brief Declaration of LLProcessSkin class. + * + * $LicenseInfo:firstyear=2012&license=viewerlgpl$ + * Second Life Viewer Source Code + * Copyright (C) 2012, Linden Research, Inc. + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; + * version 2.1 of the License only. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA + * + * Linden Research, Inc., 945 Battery Street, San Francisco, CA 94111 USA + * $/LicenseInfo$ + */ + +#ifndef LL_LLPROCESSSKIN_H +#define LL_LLPROCESSSKIN_H + +#include "llbakingprocess.h" +class LLProcessSkin : public LLBakingProcess +{ +public: + LLProcessSkin(LLAppAppearanceUtility* app) : + LLBakingProcess(app) {} + void process(std::ostream& output) override; + +private: + +}; + +#endif /* LL_LLPROCESSSKIN_H */ + diff --git a/indra/llappearanceutility/llprocesstexture.cpp b/indra/llappearanceutility/llprocesstexture.cpp new file mode 100644 index 00000000000..527a6822f2f --- /dev/null +++ b/indra/llappearanceutility/llprocesstexture.cpp @@ -0,0 +1,284 @@ +/** + * @file llprocesstexture.cpp + * @brief Implementation of LLProcessTexture class. + * + * $LicenseInfo:firstyear=2012&license=viewerlgpl$ + * Second Life Viewer Source Code + * Copyright (C) 2012, 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$ + */ + +// linden includes +#include "linden_common.h" + +#include "llfasttimer.h" +#include "llgl.h" +#include "llimagej2c.h" +#include "llsd.h" +#include "llsdserialize.h" +#include "llsdutil.h" + +// appearance includes +#include "llwearabletype.h" +#include "llavatarappearancedefines.h" + +// project includes +#include "llappappearanceutility.h" +#include "llbakingavatar.h" +#include "llbakingtexlayer.h" +#include "llbakingtexture.h" +#include "llbakingwearable.h" +#include "llbakingwearablesdata.h" +#include "llbakingwindow.h" +#include "llprocesstexture.h" + +static const S32 MAX_SIZE_LLSD_HEADER = 1024 * 1024; +static const bool USE_MIP_MAPS = true; + +static const S32 EYES_SLOT_DIMENSIONS=512; + +using namespace LLAvatarAppearanceDefines; + +LLProcessTexture::LLProcessTexture(LLAppAppearanceUtility* app) + : LLBakingProcess(app), + mWindow(nullptr), + mInputRaw(nullptr), + mBakeSize(512) +{ +} + +void LLProcessTexture::cleanup() +{ + delete mWindow; +} + +static LLFastTimer::DeclareTimer FTM_CREATE_TEXTURE_FROM_STREAM("Create texture from stream."); +static LLPointer create_texture_from_stream(std::istream& input, + S32 texture_size, + const LLUUID& id) +{ + LL_RECORD_BLOCK_TIME(FTM_CREATE_TEXTURE_FROM_STREAM); + // Read compressed j2c texture data from the input stream. + U8* buffer = (U8*) ll_aligned_malloc_16(texture_size); + input.read((char*) buffer, texture_size); + + if (input.gcount() < texture_size) + { + ll_aligned_free_16(buffer); + throw LLAppException(RV_UNABLE_TO_DECODE, " Early EOF in input stream."); + } + if (input.gcount() > texture_size) + { + ll_aligned_free_16(buffer); + throw LLAppException(RV_UNABLE_TO_DECODE, " Read too much data from input stream: Programming Error."); + } + + const S32 DISCARD_FULL_TEXTURE_RESOLUTION = 0; + LLPointer j2c = new LLImageJ2C(); + j2c->setDiscardLevel(DISCARD_FULL_TEXTURE_RESOLUTION); + // Transfer the j2c buffer to an LLImageJ2C object. + // This gives memory ownership of buffer to LLImageJ2C + if (!j2c->validate(buffer, texture_size)) + { + throw LLAppException(RV_UNABLE_TO_DECODE, " Unable to validate J2C: " + LLImage::getLastThreadError()); + } + if (!(j2c->getWidth() * j2c->getHeight() * j2c->getComponents() > 0)) + { + throw LLAppException(RV_UNABLE_TO_DECODE, " Invalid dimensions."); + } + + // Decompress the J2C image into a raw image. + LLPointer image_raw = new LLImageRaw(j2c->getWidth(), + j2c->getHeight(), + j2c->getComponents()); + const F32 MAX_DECODE_TIME = 60.f; + j2c->setDiscardLevel(0); + if (!j2c->decode(image_raw, MAX_DECODE_TIME)) + { + throw LLAppException(RV_UNABLE_TO_DECODE, " Decoding timeout."); + } + // *TODO: Check for decode failure? + LL_DEBUGS() << "ID: " << id << ", Raw Width: " << image_raw->getWidth() << ", Raw Height: " << image_raw->getHeight() + << ", Raw Components: " << (S32) image_raw->getComponents() + << ", J2C Width: " << j2c->getWidth() << ", J2C Height: " << j2c->getHeight() + << ", J2C Components: " << (S32) j2c->getComponents() << LL_ENDL; + + return image_raw; +} + +void LLProcessTexture::parseInput(std::istream& input) +{ + mInputRaw = &input; + LL_DEBUGS() << "Reading..." << LL_ENDL; + // Parse LLSD header. + mInputData = LLSDSerialize::fromBinary( *mInputRaw, MAX_SIZE_LLSD_HEADER ); + if (mInputData.isUndefined()) throw LLAppException(RV_UNABLE_TO_PARSE); + if (!mInputData.has("slot_id")) throw LLAppException(RV_UNABLE_TO_PARSE, " Missing slot id"); + if (!mInputData.has("textures")) throw LLAppException(RV_UNABLE_TO_PARSE, " Missing texture header"); + if (!mInputData.has("wearables")) throw LLAppException(RV_UNABLE_TO_PARSE, " Missing wearables"); + + // Verify the slot_id is valid. + if (BAKED_NUM_INDICES == LLAvatarAppearance::getDictionary()->findBakedByImageName(mInputData["slot_id"].asString())) + { + throw LLAppException(RV_UNABLE_TO_PARSE, " Invalid slot id"); + } +} + +void LLProcessTexture::init() +{ + if (mApp->isDebugMode()) gDebugGL = true; + + S32 maxTextureDecodedWidth = 0; + S32 maxTextureDecodedHeight = 0; + + // Extract texture data. + LLSD::array_const_iterator iter = mInputData["textures"].beginArray(); + LLSD::array_const_iterator end = mInputData["textures"].endArray(); + std::map< LLUUID, LLPointer > imageRawMap; + + for (; iter != end; ++iter) + { + LLUUID texture_id = (*iter)[0].asUUID(); + S32 texture_size = (*iter)[1]; + imageRawMap[texture_id] = create_texture_from_stream(*mInputRaw, texture_size, texture_id); + maxTextureDecodedWidth = imageRawMap[texture_id]->getWidth() > maxTextureDecodedWidth ? imageRawMap[texture_id]->getWidth() : maxTextureDecodedWidth; + maxTextureDecodedHeight = imageRawMap[texture_id]->getHeight() > maxTextureDecodedHeight ? imageRawMap[texture_id]->getHeight() : maxTextureDecodedHeight; + } + + if ("eyes" == mInputData["slot_id"].asString()) + { + mBakeSize = 512; + } + else + { + // optimization: maybe we could use maxTextureDecodedWidth and + // maxTextureDecodedHeight for new LLBakingWindow below? + if ((maxTextureDecodedWidth > 1024) || (maxTextureDecodedHeight > 1024)) + { + mBakeSize = 2048; + } + else if ((maxTextureDecodedWidth > 512) || (maxTextureDecodedHeight > 512)) + { + mBakeSize = 1024; + } + else + { + mBakeSize = 512; + } + } + + mWindow = new LLBakingWindow(mBakeSize, mBakeSize); + + for (iter = mInputData["textures"].beginArray(); iter != mInputData["textures"].endArray(); ++iter) + { + LLUUID texture_id = (*iter)[0].asUUID(); + + LLPointer texture = new LLBakingTexture(texture_id, imageRawMap[texture_id]); + texture->forceActive(); + texture->setGLTextureCreated(true); + + mTextureData[texture_id] = texture; + } + +} + +LLPointer LLProcessTexture::getLocalTexture(bool usemipmaps, bool generate_gl_tex) +{ + LLPointer tex = new LLBakingTexture(usemipmaps); + if(generate_gl_tex) + { + tex->generateGLTexture() ; + tex->setCategory(LLGLTexture::LOCAL) ; + } + return tex ; +} + +LLPointer LLProcessTexture::getLocalTexture(const U32 width, const U32 height, const U8 components, bool usemipmaps, bool generate_gl_tex) +{ + LLPointer tex = new LLBakingTexture(width, height, components, usemipmaps) ; + if(generate_gl_tex) + { + tex->generateGLTexture() ; + tex->setCategory(LLGLTexture::LOCAL) ; + } + return tex ; +} + +LLGLTexture* LLProcessTexture::getFetchedTexture(const LLUUID &image_id) +{ + texture_map_t::iterator texture_iter = mTextureData.find(image_id); + if (mTextureData.end() == texture_iter) + { + LL_DEBUGS() << "Ignoring unused texture id: " << image_id << LL_ENDL; + return nullptr; + } + + return texture_iter->second; +} + +void LLProcessTexture::process(std::ostream& output) +{ + LL_DEBUGS() << "Building avatar..." << LL_ENDL; + // Set ourself as the texture bridge. + gTextureManagerBridgep = this; + + // Construct the avatar. + LLBakingWearablesData wearable_data; + LLBakingAvatar avatar(&wearable_data, mBakeSize); + avatar.initInstance(); + wearable_data.setAvatarAppearance(&avatar); + + // Extract and parse wearables. + wearable_data.setWearableOutfit(mInputData["wearables"]); + + avatar.setSex( (avatar.getVisualParamWeight( "male" ) > 0.5f) ? SEX_MALE : SEX_FEMALE ); + + avatar.updateVisualParams(); + + // Prepare gl for avatar baking + glClearColor(0.0f, 0.0f, 0.0f, 0.0f); + gGL.setSceneBlendType(LLRender::BT_ALPHA); + + EBakedTextureIndex bake_type = LLAvatarAppearance::getDictionary()->findBakedByImageName(mInputData["slot_id"].asString()); + LLTexLayerSet* layer_set = avatar.getAvatarLayerSet(bake_type); + LLBakingTexLayerSetBuffer* composite = dynamic_cast (layer_set->getComposite()); + if (!composite) + { + throw LLAppException(RV_UNABLE_TO_BAKE, " Could not build composite."); + } + + LL_DEBUGS() << "Rendering..." << LL_ENDL; + if (!composite->render()) + { + throw LLAppException(RV_UNABLE_TO_BAKE, " Failed to render composite."); + } + + mWindow->swapBuffers(); + + LL_DEBUGS() << "Compressing..." << LL_ENDL; + LLImageJ2C* j2c = composite->getCompressedImage(); + if (!j2c) + { + throw LLAppException(RV_UNABLE_TO_BAKE, " Could not build image."); + } + + LL_DEBUGS() << "Writing..." << LL_ENDL; + output.write((char*)j2c->getData(), j2c->getDataSize()); + LL_DEBUGS() << "Done." << LL_ENDL; +} diff --git a/indra/llappearanceutility/llprocesstexture.h b/indra/llappearanceutility/llprocesstexture.h new file mode 100644 index 00000000000..8bf2c7396f2 --- /dev/null +++ b/indra/llappearanceutility/llprocesstexture.h @@ -0,0 +1,63 @@ +/** + * @file llprocesstexture.h + * @brief Declaration of LLProcessTexture class. + * + * $LicenseInfo:firstyear=2012&license=viewerlgpl$ + * Second Life Viewer Source Code + * Copyright (C) 2012, Linden Research, Inc. + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; + * version 2.1 of the License only. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA + * + * Linden Research, Inc., 945 Battery Street, San Francisco, CA 94111 USA + * $/LicenseInfo$ + */ + +#ifndef LL_LLPROCESSTEXTURE_H +#define LL_LLPROCESSTEXTURE_H + +#include "llbakingprocess.h" +#include "llbakingtexture.h" +#include "llpointer.h" +#include "lltexturemanagerbridge.h" +#include "llbakingwindow.h" + +class LLBakingWindow; + +class LLProcessTexture : public LLBakingProcess, public LLTextureManagerBridge +{ +public: + LLProcessTexture(LLAppAppearanceUtility* app); + + /////// LLBakingProcess interface. ///////// + void parseInput(std::istream& input) override; + void process(std::ostream& output) override; + void init() override; + void cleanup() override; + + /////// LLTextureManagerBridge interface. //////// + LLPointer getLocalTexture(bool usemipmaps = true, bool generate_gl_tex = true) override; + LLPointer getLocalTexture(const U32 width, const U32 height, const U8 components, bool usemipmaps, bool generate_gl_tex = true) override; + LLGLTexture* getFetchedTexture(const LLUUID &image_id) override; + +private: + typedef std::map< LLUUID, LLPointer > texture_map_t; + texture_map_t mTextureData; + LLBakingWindow* mWindow; + std::istream* mInputRaw; + S32 mBakeSize; +}; + +#endif /* LL_LLPROCESSTEXTURE_H */ + diff --git a/indra/llappearanceutility/tests/joint-offsets.xml b/indra/llappearanceutility/tests/joint-offsets.xml new file mode 100644 index 00000000000..4dca3c34298 --- /dev/null +++ b/indra/llappearanceutility/tests/joint-offsets.xml @@ -0,0 +1 @@ +92a7dd5c-bc30-9952-3b3b-e6cc10336cbebind_shape_matrix0.048803295940160750.00.00.00.00.0488033369183540340.00.00.00.00.049029946327209470.00.05886554718017578-0.03438653051853181.75724506378173831.0joint_namesmEyeLeftmHeadmNeckmChestmTorsomPelvismEyeRightalt_inverse_bind_matrix1.08107995986938480.00.00.00.01.08107995986938480.00.00.00.01.08107995986938480.00.090427502989768980.037174601107835770.080562800168991091.01.08107995986938480.00.00.00.01.08107995986938480.00.00.00.01.08107995986938480.00.00.00.075629897415637971.01.18342995643615720.00.00.00.01.197600007057190.00.00.00.01.00.0-0.009507000446319580.00.251107990741729741.01.010100007057190.00.00.00.01.04166996479034420.00.00.00.01.00.0-0.015367999672889710.00.204877004027366641.01.00.00.00.00.01.00.00.00.00.01.00.00.00.00.084072902798652651.01.00.00.00.00.01.00.00.00.00.01.00.00.00.01.0670200586318971.01.08107995986938480.00.00.00.01.08107995986938480.00.00.00.01.08107995986938480.00.09042750298976898-0.037174601107835770.080562800168991091.0pelvis_offset0.0inverse_bind_matrix1.08107995986938480.00.00.00.01.08107995986938480.00.00.00.01.08107995986938480.0-0.06363839656114578-0.03717460110783577-1.89970004558563231.01.08107995986938480.00.00.00.01.08107995986938480.00.00.00.01.08107995986938480.00.0267891008406877520.0-1.81913995742797851.01.18342995643615720.00.00.00.01.197600007057190.00.00.00.01.00.00.0293253995478153230.0-1.6070699691772461.01.010100007057190.00.00.00.01.04166996479034420.00.00.00.01.00.00.0155231999233365060.0-1.35596001148223881.01.00.00.00.00.01.00.00.00.00.01.00.00.00.0-1.15109002590179441.01.00.00.00.00.01.00.00.00.00.01.00.00.00.0-1.06701004505157471.01.08107995986938480.00.00.00.01.08107995986938480.00.00.00.01.08107995986938480.0-0.063638396561145780.03717460110783577-1.89970004558563231.0971cf873-afce-8b69-44d6-3f5879cb94c2bind_shape_matrix0.029928008094429970.00.00.00.00.046580597758293150.00.00.00.00.0094699859619140620.00.137737005949020395.450006574392319e-051.68836498260498051.0joint_namesmHeadmNeckmChestmTorsomPelvismFaceJawmFaceRootmFaceLipUpperLeftmFaceTeethUppermFaceLipUpperRightmFaceLipCornerLeftmFaceLipCornerRightmFaceLipLowerCentermFaceTeethLowermFaceChinmFaceLipLowerLeftmFaceLipLowerRightmFaceEyeLidUpperLeftmFaceEyeLidUpperRightmFaceEyebrowInnerLeftmFaceEyebrowInnerRightmFaceEyebrowCenterLeftmFaceEyebrowCenterRightmFaceForeheadCentermFaceNoseBridgemFaceNoseBasemFaceEyeLidLowerLeftmFaceEyeLidLowerRightmFaceCheekUpperLeftmFaceCheekUpperRightmFaceLipUpperCenteralt_inverse_bind_matrix1.08107995986938480.00.00.00.01.08107995986938480.00.00.00.01.08107995986938480.00.00.00.075629897415637971.01.18342995643615720.00.00.00.01.197600007057190.00.00.00.01.00.0-0.009507000446319580.00.251107990741729741.01.010100007057190.00.00.00.01.04166996479034420.00.00.00.01.00.0-0.015367999672889710.00.204877004027366641.01.00.00.00.00.01.00.00.00.00.01.00.00.00.00.084072902798652651.01.00.00.00.00.01.00.00.00.00.01.00.00.00.01.0670200586318971.01.08107995986938480.00.00.00.01.08107995986938480.00.00.00.01.08107995986938480.00.0359875001013278960.0-0.0253947004675865171.01.08107995986938480.00.00.00.01.05708003044128420.00.00.00.01.10618996620178220.00.025000000372529030.00.045000001788139341.01.08107995986938480.00.00.00.01.08107995986938480.00.00.00.01.2208299636840820.0-0.0591681003570556640.00.0048508602194488051.01.08107995986938480.00.00.00.01.08107995986938480.00.00.00.01.08107995986938480.00.107000999152660370.0-0.026074899360537531.01.08107995986938480.00.00.00.01.08107995986938480.00.00.00.01.2208299636840820.0-0.0591681003570556640.00.0048508602194488051.01.08107995986938480.00.00.00.01.08107995986938480.00.00.00.01.08107995986938480.00.03629549965262413-0.01899999938905239-0.0134859997779130941.01.08107995986938480.00.00.00.01.08107995986938480.00.00.00.01.08107995986938480.00.036295499652624130.01899999938905239-0.0134859997779130941.01.08107995986938480.00.00.00.01.08107995986938480.00.00.00.01.08107995986938480.0-0.020269699394702910.00.0053312801755964761.01.08107995986938480.00.00.00.01.08107995986938480.00.00.00.01.08107995986938480.00.083006501197814940.0-0.0203639995306730271.01.08107995986938480.00.00.00.01.08107995986938480.00.00.00.01.08107995986938480.00.083787396550178530.0-0.0266884993761777881.01.08107995986938480.00.00.00.01.08107995986938480.00.00.00.01.08107995986938480.00.03427229821681976-0.012062000110745430.00051081198034808041.01.08107995986938480.00.00.00.01.08107995986938480.00.00.00.01.08107995986938480.00.034272298216819760.012062000110745430.00051081198034808041.01.08107995986938480.00.00.00.01.08107995986938480.00.00.00.01.08107995986938480.00.044901698827743530.0369763001799583440.0383545011281967161.01.08107995986938480.00.00.00.01.08107995986938480.00.00.00.01.08107995986938480.00.04490169882774353-0.0369763001799583440.0383545011281967161.01.08107995986938480.00.00.00.01.08107995986938480.00.00.00.00.85106402635574340.00.0181128997355699540.0167341008782386780.0570053011178970341.01.08107995986938480.00.00.00.01.08107995986938480.00.00.00.00.85106402635574340.00.018112899735569954-0.0167341008782386780.0570053011178970341.01.08107995986938480.00.00.00.01.08107995986938480.00.00.00.00.85106402635574340.0-0.0082314396277070050.037603501230478290.0562760010361671451.01.08107995986938480.00.00.00.01.08107995986938480.00.00.00.00.85106402635574340.0-0.008231439627707005-0.037603501230478290.0562760010361671451.01.08107995986938480.00.00.00.01.08107995986938480.00.00.00.01.08107995986938480.00.073194302618503570.00.087503999471664431.01.08107995986938480.00.00.00.01.08107995986938480.00.00.00.01.08107995986938480.00.104399003088474270.00.0171787999570369721.01.08107995986938480.00.00.00.01.08107995986938480.00.00.00.01.08107995986938480.00.150499001145362850.00.0038539199158549311.01.08107995986938480.00.00.00.01.08107995986938480.00.00.00.01.08107995986938480.00.044901698827743530.0369763001799583440.0383545011281967161.01.08107995986938480.00.00.00.01.08107995986938480.00.00.00.01.08107995986938480.00.04490169882774353-0.0369763001799583440.0383545011281967161.01.08107995986938480.00.00.00.01.08107995986938480.00.00.00.01.08107995986938480.00.0291581992059946060.05687420070171356-0.00453078979626297951.01.08107995986938480.00.00.00.01.08107995986938480.00.00.00.01.08107995986938480.00.029158199205994606-0.05687420070171356-0.00453078979626297951.01.08107995986938480.00.00.00.01.08107995986938480.00.00.00.01.041350007057190.00.0167011991143226620.00.0097117396071553231.0pelvis_offset0.0inverse_bind_matrix1.08107995986938480.00.00.00.01.08107995986938480.00.00.00.01.08107995986938480.00.0267891008406877520.0-1.81913995742797851.01.18342995643615720.00.00.00.01.197600007057190.00.00.00.01.00.00.0293253995478153230.0-1.6070699691772461.01.010100007057190.00.00.00.01.04166996479034420.00.00.00.01.00.00.0155231999233365060.0-1.35596001148223881.01.00.00.00.00.01.00.00.00.00.01.00.00.00.0-1.15109002590179441.01.00.00.00.00.01.00.00.00.00.01.00.00.00.0-1.06701004505157471.01.08107995986938480.00.00.00.01.08107995986938480.00.00.00.01.08107995986938480.0-0.0341983996331691740.0-1.84081995487213131.01.08107995986938480.00.00.00.01.05708003044128420.00.00.00.01.10618996620178220.00.00178911001421511170.0-1.90898001194000241.01.08107995986938480.00.00.00.01.08107995986938480.00.00.00.01.2208299636840820.0-0.046043299138545990.0-2.08349990844726561.01.08107995986938480.00.00.00.01.08107995986938480.00.00.00.01.08107995986938480.0-0.105210997164249420.0-1.84016001224517821.01.08107995986938480.00.00.00.01.08107995986938480.00.00.00.01.2208299636840820.0-0.046043299138545990.0-2.08349990844726561.01.08107995986938480.00.00.00.01.08107995986938480.00.00.00.01.08107995986938480.0-0.141506999731063840.01899999938905239-1.82667005062103271.01.08107995986938480.00.00.00.01.08107995986938480.00.00.00.01.08107995986938480.0-0.14150699973106384-0.01899999938905239-1.82667005062103271.01.08107995986938480.00.00.00.01.08107995986938480.00.00.00.01.08107995986938480.0-0.096935302019119260.0-1.82579004764556881.01.08107995986938480.00.00.00.01.08107995986938480.00.00.00.01.08107995986938480.0-0.117205001413822170.0-1.82045996189117431.01.08107995986938480.00.00.00.01.08107995986938480.00.00.00.01.08107995986938480.0-0.117986001074314120.0-1.81412994861602781.01.08107995986938480.00.00.00.01.08107995986938480.00.00.00.01.08107995986938480.0-0.151476994156837460.01206200011074543-1.8209700584411621.01.08107995986938480.00.00.00.01.08107995986938480.00.00.00.01.08107995986938480.0-0.15147699415683746-0.01206200011074543-1.8209700584411621.01.08107995986938480.00.00.00.01.08107995986938480.00.00.00.01.08107995986938480.0-0.04311259835958481-0.037815701216459274-1.90312004089355471.01.08107995986938480.00.00.00.01.08107995986938480.00.00.00.01.08107995986938480.0-0.043112598359584810.037815701216459274-1.90312004089355471.01.08107995986938480.00.00.00.01.08107995986938480.00.00.00.00.85106402635574340.0-0.016323799267411232-0.017114000394940376-1.51254999637603761.01.08107995986938480.00.00.00.01.08107995986938480.00.00.00.00.85106402635574340.0-0.0163237992674112320.017114000394940376-1.51254999637603761.01.08107995986938480.00.00.00.01.08107995986938480.00.00.00.00.85106402635574340.00.010020599700510502-0.038457199931144714-1.5119899511337281.01.08107995986938480.00.00.00.01.08107995986938480.00.00.00.00.85106402635574340.00.0100205997005105020.038457199931144714-1.5119899511337281.01.08107995986938480.00.00.00.01.08107995986938480.00.00.00.01.08107995986938480.0-0.071405202150344850.0-1.9511599540710451.01.08107995986938480.00.00.00.01.08107995986938480.00.00.00.01.08107995986938480.0-0.102609001100063320.0-1.88242995738983151.01.08107995986938480.00.00.00.01.08107995986938480.00.00.00.01.08107995986938480.0-0.14870999753475190.0-1.86940002441406251.01.08107995986938480.00.00.00.01.08107995986938480.00.00.00.01.08107995986938480.0-0.04311259835958481-0.037815701216459274-1.90312004089355471.01.08107995986938480.00.00.00.01.08107995986938480.00.00.00.01.08107995986938480.0-0.043112598359584810.037815701216459274-1.90312004089355471.01.08107995986938480.00.00.00.01.08107995986938480.00.00.00.01.08107995986938480.0-0.027369100600481033-0.058165401220321655-1.86120998859405521.01.08107995986938480.00.00.00.01.08107995986938480.00.00.00.01.08107995986938480.0-0.0273691006004810330.058165401220321655-1.86120998859405521.01.08107995986938480.00.00.00.01.08107995986938480.00.00.00.01.041350007057190.0-0.121913000941276550.0-1.78188002109527591.07e7a6834-8b41-4029-8f87-ce57b7d05beebind_shape_matrix0.27415099740028380.00.00.00.00.152832403779029850.00.00.00.00.23362004756927490.00.033084496855735780.01.74006009101867681.0joint_namesmHeadmNeckmChestmTorsomPelvismFaceJawmFaceRootmFaceLipUpperLeftmFaceTeethUppermFaceLipUpperRightmFaceLipCornerLeftmFaceLipCornerRightmFaceLipLowerCentermFaceTeethLowermFaceChinmFaceLipLowerLeftmFaceLipLowerRightmFaceEyeLidUpperLeftmFaceEyeLidUpperRightmFaceEyebrowInnerLeftmFaceEyebrowInnerRightmFaceEyebrowCenterLeftmFaceEyebrowCenterRightmFaceForeheadCentermFaceNoseBridgemFaceNoseBasemFaceEyeLidLowerLeftmFaceEyeLidLowerRightmFaceCheekUpperLeftmFaceCheekUpperRightmFaceLipUpperCenteralt_inverse_bind_matrix1.08107995986938480.00.00.00.01.08107995986938480.00.00.00.01.08107995986938480.00.00.00.075629897415637971.01.18342995643615720.00.00.00.01.197600007057190.00.00.00.01.00.0-0.009507000446319580.00.251107990741729741.01.010100007057190.00.00.00.01.04166996479034420.00.00.00.01.00.0-0.015367999672889710.00.204877004027366641.01.00.00.00.00.01.00.00.00.00.01.00.00.00.00.084072902798652651.01.00.00.00.00.01.00.00.00.00.01.00.00.00.01.0670200586318971.01.08107995986938480.00.00.00.01.08107995986938480.00.00.00.01.08107995986938480.00.0359875001013278960.0-0.0253947004675865171.01.08107995986938480.00.00.00.01.05708003044128420.00.00.00.01.10618996620178220.00.025000000372529030.00.045000001788139341.01.08107995986938480.00.00.00.01.08107995986938480.00.00.00.01.2208299636840820.0-0.0591681003570556640.00.0048508602194488051.01.08107995986938480.00.00.00.01.08107995986938480.00.00.00.01.08107995986938480.00.107000999152660370.0-0.026074899360537531.01.08107995986938480.00.00.00.01.08107995986938480.00.00.00.01.2208299636840820.0-0.0591681003570556640.00.0048508602194488051.01.08107995986938480.00.00.00.01.08107995986938480.00.00.00.01.08107995986938480.00.03629549965262413-0.01899999938905239-0.0134859997779130941.01.08107995986938480.00.00.00.01.08107995986938480.00.00.00.01.08107995986938480.00.036295499652624130.01899999938905239-0.0134859997779130941.01.08107995986938480.00.00.00.01.08107995986938480.00.00.00.01.08107995986938480.0-0.020269699394702910.00.0053312801755964761.01.08107995986938480.00.00.00.01.08107995986938480.00.00.00.01.08107995986938480.00.083006501197814940.0-0.0203639995306730271.01.08107995986938480.00.00.00.01.08107995986938480.00.00.00.01.08107995986938480.00.083787396550178530.0-0.0266884993761777881.01.08107995986938480.00.00.00.01.08107995986938480.00.00.00.01.08107995986938480.00.03427229821681976-0.012062000110745430.00051081198034808041.01.08107995986938480.00.00.00.01.08107995986938480.00.00.00.01.08107995986938480.00.034272298216819760.012062000110745430.00051081198034808041.01.08107995986938480.00.00.00.01.08107995986938480.00.00.00.01.08107995986938480.00.044901698827743530.0369763001799583440.0383545011281967161.01.08107995986938480.00.00.00.01.08107995986938480.00.00.00.01.08107995986938480.00.04490169882774353-0.0369763001799583440.0383545011281967161.01.08107995986938480.00.00.00.01.08107995986938480.00.00.00.00.85106402635574340.00.0181128997355699540.0167341008782386780.0570053011178970341.01.08107995986938480.00.00.00.01.08107995986938480.00.00.00.00.85106402635574340.00.018112899735569954-0.0167341008782386780.0570053011178970341.01.08107995986938480.00.00.00.01.08107995986938480.00.00.00.00.85106402635574340.0-0.0082314396277070050.037603501230478290.0562760010361671451.01.08107995986938480.00.00.00.01.08107995986938480.00.00.00.00.85106402635574340.0-0.008231439627707005-0.037603501230478290.0562760010361671451.01.08107995986938480.00.00.00.01.08107995986938480.00.00.00.01.08107995986938480.00.073194302618503570.00.087503999471664431.01.08107995986938480.00.00.00.01.08107995986938480.00.00.00.01.08107995986938480.00.104399003088474270.00.0171787999570369721.01.08107995986938480.00.00.00.01.08107995986938480.00.00.00.01.08107995986938480.00.150499001145362850.00.0038539199158549311.01.08107995986938480.00.00.00.01.08107995986938480.00.00.00.01.08107995986938480.00.044901698827743530.0369763001799583440.0383545011281967161.01.08107995986938480.00.00.00.01.08107995986938480.00.00.00.01.08107995986938480.00.04490169882774353-0.0369763001799583440.0383545011281967161.01.08107995986938480.00.00.00.01.08107995986938480.00.00.00.01.08107995986938480.00.0291581992059946060.05687420070171356-0.00453078979626297951.01.08107995986938480.00.00.00.01.08107995986938480.00.00.00.01.08107995986938480.00.029158199205994606-0.05687420070171356-0.00453078979626297951.01.08107995986938480.00.00.00.01.08107995986938480.00.00.00.01.041350007057190.00.0167011991143226620.00.0097117396071553231.0pelvis_offset0.0inverse_bind_matrix1.08107995986938480.00.00.00.01.08107995986938480.00.00.00.01.08107995986938480.00.0267891008406877520.0-1.81913995742797851.01.18342995643615720.00.00.00.01.197600007057190.00.00.00.01.00.00.0293253995478153230.0-1.6070699691772461.01.010100007057190.00.00.00.01.04166996479034420.00.00.00.01.00.00.0155231999233365060.0-1.35596001148223881.01.00.00.00.00.01.00.00.00.00.01.00.00.00.0-1.15109002590179441.01.00.00.00.00.01.00.00.00.00.01.00.00.00.0-1.06701004505157471.01.08107995986938480.00.00.00.01.08107995986938480.00.00.00.01.08107995986938480.0-0.0341983996331691740.0-1.84081995487213131.01.08107995986938480.00.00.00.01.05708003044128420.00.00.00.01.10618996620178220.00.00178911001421511170.0-1.90898001194000241.01.08107995986938480.00.00.00.01.08107995986938480.00.00.00.01.2208299636840820.0-0.046043299138545990.0-2.08349990844726561.01.08107995986938480.00.00.00.01.08107995986938480.00.00.00.01.08107995986938480.0-0.105210997164249420.0-1.84016001224517821.01.08107995986938480.00.00.00.01.08107995986938480.00.00.00.01.2208299636840820.0-0.046043299138545990.0-2.08349990844726561.01.08107995986938480.00.00.00.01.08107995986938480.00.00.00.01.08107995986938480.0-0.141506999731063840.01899999938905239-1.82667005062103271.01.08107995986938480.00.00.00.01.08107995986938480.00.00.00.01.08107995986938480.0-0.14150699973106384-0.01899999938905239-1.82667005062103271.01.08107995986938480.00.00.00.01.08107995986938480.00.00.00.01.08107995986938480.0-0.096935302019119260.0-1.82579004764556881.01.08107995986938480.00.00.00.01.08107995986938480.00.00.00.01.08107995986938480.0-0.117205001413822170.0-1.82045996189117431.01.08107995986938480.00.00.00.01.08107995986938480.00.00.00.01.08107995986938480.0-0.117986001074314120.0-1.81412994861602781.01.08107995986938480.00.00.00.01.08107995986938480.00.00.00.01.08107995986938480.0-0.151476994156837460.01206200011074543-1.8209700584411621.01.08107995986938480.00.00.00.01.08107995986938480.00.00.00.01.08107995986938480.0-0.15147699415683746-0.01206200011074543-1.8209700584411621.01.08107995986938480.00.00.00.01.08107995986938480.00.00.00.01.08107995986938480.0-0.04311259835958481-0.037815701216459274-1.90312004089355471.01.08107995986938480.00.00.00.01.08107995986938480.00.00.00.01.08107995986938480.0-0.043112598359584810.037815701216459274-1.90312004089355471.01.08107995986938480.00.00.00.01.08107995986938480.00.00.00.00.85106402635574340.0-0.016323799267411232-0.017114000394940376-1.51254999637603761.01.08107995986938480.00.00.00.01.08107995986938480.00.00.00.00.85106402635574340.0-0.0163237992674112320.017114000394940376-1.51254999637603761.01.08107995986938480.00.00.00.01.08107995986938480.00.00.00.00.85106402635574340.00.010020599700510502-0.038457199931144714-1.5119899511337281.01.08107995986938480.00.00.00.01.08107995986938480.00.00.00.00.85106402635574340.00.0100205997005105020.038457199931144714-1.5119899511337281.01.08107995986938480.00.00.00.01.08107995986938480.00.00.00.01.08107995986938480.0-0.071405202150344850.0-1.9511599540710451.01.08107995986938480.00.00.00.01.08107995986938480.00.00.00.01.08107995986938480.0-0.102609001100063320.0-1.88242995738983151.01.08107995986938480.00.00.00.01.08107995986938480.00.00.00.01.08107995986938480.0-0.14870999753475190.0-1.86940002441406251.01.08107995986938480.00.00.00.01.08107995986938480.00.00.00.01.08107995986938480.0-0.04311259835958481-0.037815701216459274-1.90312004089355471.01.08107995986938480.00.00.00.01.08107995986938480.00.00.00.01.08107995986938480.0-0.043112598359584810.037815701216459274-1.90312004089355471.01.08107995986938480.00.00.00.01.08107995986938480.00.00.00.01.08107995986938480.0-0.027369100600481033-0.058165401220321655-1.86120998859405521.01.08107995986938480.00.00.00.01.08107995986938480.00.00.00.01.08107995986938480.0-0.0273691006004810330.058165401220321655-1.86120998859405521.01.08107995986938480.00.00.00.01.08107995986938480.00.00.00.01.041350007057190.0-0.121913000941276550.0-1.78188002109527591.0547d8392-9f19-35fb-3508-121eea388f0abind_shape_matrix0.12420170754194260.00.00.00.00.040834598243236540.00.00.00.00.0144999027252197270.00.077383153140544890.01.68994998931884771.0joint_namesmFaceJawmFaceRootmHeadmNeckmChestmTorsomPelvismFaceTongueBasemFaceTeethLowermFaceTongueTipalt_inverse_bind_matrix1.08107995986938480.00.00.00.01.08107995986938480.00.00.00.01.08107995986938480.00.0359875001013278960.0-0.0253947004675865171.01.08107995986938480.00.00.00.01.05708003044128420.00.00.00.01.10618996620178220.00.025000000372529030.00.045000001788139341.01.08107995986938480.00.00.00.01.08107995986938480.00.00.00.01.08107995986938480.00.00.00.075629897415637971.01.18342995643615720.00.00.00.01.197600007057190.00.00.00.01.00.0-0.009507000446319580.00.251107990741729741.01.010100007057190.00.00.00.01.04166996479034420.00.00.00.01.00.0-0.015367999672889710.00.204877004027366641.01.00.00.00.00.01.00.00.00.00.01.00.00.00.00.084072902798652651.01.00.00.00.00.01.00.00.00.00.01.00.00.00.01.0670200586318971.01.08107995986938480.00.00.00.01.08107995986938480.00.00.00.01.08107995986938480.0-0.0298503991216421130.00.0078316899016499521.01.08107995986938480.00.00.00.01.08107995986938480.00.00.00.01.08107995986938480.00.083006501197814940.0-0.0203639995306730271.01.08107995986938480.00.00.00.01.08107995986938480.00.00.00.01.08107995986938480.00.0389162003993988040.0-0.0027754299808293581.0pelvis_offset0.0inverse_bind_matrix1.08107995986938480.00.00.00.01.08107995986938480.00.00.00.01.08107995986938480.0-0.0341983996331691740.0-1.84081995487213131.01.08107995986938480.00.00.00.01.05708003044128420.00.00.00.01.10618996620178220.00.00178911001421511170.0-1.90898001194000241.01.08107995986938480.00.00.00.01.08107995986938480.00.00.00.01.08107995986938480.00.0267891008406877520.0-1.81913995742797851.01.18342995643615720.00.00.00.01.197600007057190.00.00.00.01.00.00.0293253995478153230.0-1.6070699691772461.01.010100007057190.00.00.00.01.04166996479034420.00.00.00.01.00.00.0155231999233365060.0-1.35596001148223881.01.00.00.00.00.01.00.00.00.00.01.00.00.00.0-1.15109002590179441.01.00.00.00.00.01.00.00.00.00.01.00.00.00.0-1.06701004505157471.01.08107995986938480.00.00.00.01.08107995986938480.00.00.00.01.08107995986938480.0-0.087354503571987150.0-1.82828998565673831.01.08107995986938480.00.00.00.01.08107995986938480.00.00.00.01.08107995986938480.0-0.117205001413822170.0-1.82045996189117431.01.08107995986938480.00.00.00.01.08107995986938480.00.00.00.01.08107995986938480.0-0.126270994544029240.0-1.8255100250244141.0ed796a27-cff0-454a-ecec-fd10794ca2c9bind_shape_matrix0.0071529899723827840.00.00.00.00.0193126909434795380.00.00.00.00.0236200094223022460.00.163101494312286380.00020919507369399071.71106004714965821.0joint_namesmFaceNoseBasemFaceRootmHeadmNeckmChestmTorsomPelvismFaceLipUpperCentermFaceTeethUpperalt_inverse_bind_matrix1.08107995986938480.00.00.00.01.08107995986938480.00.00.00.01.08107995986938480.00.150499001145362850.00.0038539199158549311.01.08107995986938480.00.00.00.01.05708003044128420.00.00.00.01.10618996620178220.00.025000000372529030.00.045000001788139341.01.08107995986938480.00.00.00.01.08107995986938480.00.00.00.01.08107995986938480.00.00.00.075629897415637971.01.18342995643615720.00.00.00.01.197600007057190.00.00.00.01.00.0-0.009507000446319580.00.251107990741729741.01.010100007057190.00.00.00.01.04166996479034420.00.00.00.01.00.0-0.015367999672889710.00.204877004027366641.01.00.00.00.00.01.00.00.00.00.01.00.00.00.00.084072902798652651.01.00.00.00.00.01.00.00.00.00.01.00.00.00.01.0670200586318971.01.08107995986938480.00.00.00.01.08107995986938480.00.00.00.01.041350007057190.00.0167011991143226620.00.0097117396071553231.01.08107995986938480.00.00.00.01.08107995986938480.00.00.00.01.08107995986938480.00.107000999152660370.0-0.026074899360537531.0pelvis_offset0.0inverse_bind_matrix1.08107995986938480.00.00.00.01.08107995986938480.00.00.00.01.08107995986938480.0-0.14870999753475190.0-1.86940002441406251.01.08107995986938480.00.00.00.01.05708003044128420.00.00.00.01.10618996620178220.00.00178911001421511170.0-1.90898001194000241.01.08107995986938480.00.00.00.01.08107995986938480.00.00.00.01.08107995986938480.00.0267891008406877520.0-1.81913995742797851.01.18342995643615720.00.00.00.01.197600007057190.00.00.00.01.00.00.0293253995478153230.0-1.6070699691772461.01.010100007057190.00.00.00.01.04166996479034420.00.00.00.01.00.00.0155231999233365060.0-1.35596001148223881.01.00.00.00.00.01.00.00.00.00.01.00.00.00.0-1.15109002590179441.01.00.00.00.00.01.00.00.00.00.01.00.00.00.0-1.06701004505157471.01.08107995986938480.00.00.00.01.08107995986938480.00.00.00.01.041350007057190.0-0.121913000941276550.0-1.78188002109527591.01.08107995986938480.00.00.00.01.08107995986938480.00.00.00.01.08107995986938480.0-0.105210997164249420.0-1.84016001224517821.0fa0aabfe-4b1c-fa9b-4942-74e7e7f50fe2bind_shape_matrix0.022715998813509940.00.00.00.00.022715998813509940.00.00.00.00.0227099657058715820.00.00.01.06701493263244631.0joint_namesmPelvismHandMiddle1LeftmHandMiddle2LeftmHandMiddle3LeftmHandIndex1LeftmHandIndex2LeftmHandIndex3LeftmHandRing1LeftmHandRing2LeftmHandRing3LeftmHandPinky1LeftmHandPinky2LeftmHandPinky3LeftmHandThumb1LeftmHandThumb2LeftmHandThumb3LeftmHandMiddle1RightmHandMiddle2RightmHandMiddle3RightmHandIndex1RightmHandIndex2RightmHandIndex3RightmHandRing1RightmHandRing2RightmHandRing3RightmHandPinky1RightmHandPinky2RightmHandPinky3RightmHandThumb1RightmHandThumb2RightmHandThumb3Rightalt_inverse_bind_matrix1.00.00.00.00.01.00.00.00.00.01.00.00.00.01.0670200586318971.00.99873197078704830.04983130097389221-0.0070897499099373820.0-0.0301342997699975970.7048000097274780.7087659835815430.00.040315598249435425-0.70765399932861330.7054079771041870.00.0151886995881795880.098942197859287260.0104294996708631521.00.99894601106643680.045610301196575165-0.005135800223797560.0-0.0289570000022649770.71308398246765140.70047998428344730.00.03561139851808548-0.69959300756454470.71365398168563840.0-0.00105056003667414190.04202070087194443-0.0063029900193214421.00.99634701013565060.08039940148591995-0.028780499473214150.0-0.0383009985089302060.72195601463317870.69087797403335570.00.07632440328598022-0.68725198507308960.72239899635314940.0-0.00050425098743289710.024710899218916893-0.0040346500463783741.00.9319689869880676-0.248298004269599910.264160990715026860.00.023382499814033510.7682970166206360.63966602087020870.0-0.3617820143699646-0.5899729728698730.72183501720428470.00.03427390009164810.094680696725845340.0096299396827816961.00.9427329897880554-0.223545998334884640.24755300581455230.00.017677599564194680.7746199965476990.63217902183532710.0-0.333079993724823-0.59160000085830690.73421198129653930.00.0171910002827644350.03640490025281906-0.0060679200105369091.00.9429500102996826-0.21653699874877930.25289699435234070.00.002694060094654560.76453900337219240.64457201957702640.0-0.3329229950904846-0.60711801052093510.72150599956512450.00.0102137001231312750.023345300927758217-0.0043774899095296861.00.9654129743576050.157709002494812-0.207616999745368960.00.0155645003542304040.76002901792526250.64970201253890990.00.2602590024471283-0.63046300411224370.73128801584243770.0-0.00364764011465013030.096580803394317630.0044052097946405411.00.97247397899627690.11432900279760361-0.203038007020950320.00.044799100607633590.76336401700973510.64441400766372680.00.2286670058965683-0.63577097654342650.73722898960113530.0-0.0123153002932667730.035998500883579254-0.0075785201042890551.00.96376097202301030.15707699954509735-0.21561999619007110.00.0189111009240150450.76600497961044310.64255702495574950.00.2660970091819763-0.62334901094436650.73527497053146360.0-0.0065627098083496090.02019299939274788-0.0045438897795975211.00.82219499349594120.3776470124721527-0.42588400840759280.0-0.118125997483730320.84512501955032350.5213530063629150.00.5568130016326904-0.37834599614143370.7394679784774780.0-0.0232133995741605760.08812329918146133-0.0041738501749932771.00.86176002025604250.33954399824142456-0.37693598866462710.0-0.106248997151851650.84731501340866090.52035301923751830.00.49606600403785706-0.40837100148200990.76625800132751460.0-0.0222677998244762420.02319590002298355-0.0055669201537966731.00.87477701902389530.3211840093135834-0.36277499794960020.0-0.108980998396873470.85996502637863160.49858099222183230.00.47211000323295593-0.39661198854446410.78728097677230830.0-0.012436700053513050.014924099668860435-0.0033164799679070711.00.9163669943809509-0.072017200291156770.39380899071693420.0-0.11881099641323090.89044702053070070.4393039941787720.0-0.38230299949645996-0.44935199618339540.8074200153350830.00.032215598970651630.02088090032339096-0.008553059771656991.00.9283679723739624-0.0201622005552053450.37111499905586240.0-0.166196003556251530.87061101198196410.46305000782012940.0-0.33243298530578613-0.49155899882316590.80489701032638550.00.0294509995728731160.03365840017795563-0.00105202000122517351.00.9289919734001160.079554900527000430.36144900321960450.0-0.26165801286697390.83187001943588260.48941498994827270.0-0.2617430090904236-0.54923802614212040.79361701011657710.00.0209248997271060940.028203699737787247-0.0009096220019273461.00.9987319707870483-0.04983120039105415-0.0070897699333727360.00.0301342997699975970.704800009727478-0.7087659835815430.00.0403155013918876650.70765399932861330.7054079771041870.00.015188699588179588-0.098942197859287260.0104294996708631521.00.9989460110664368-0.045610301196575165-0.005135800223797560.00.0289570000022649770.7130839824676514-0.70047998428344730.00.035611398518085480.69959300756454470.71365398168563840.0-0.0010505500249564648-0.042020801454782486-0.0063028801232576371.00.9963470101356506-0.08039940148591995-0.028780499473214150.00.0383009985089302060.7219560146331787-0.69087797403335570.00.076324403285980220.68725198507308960.72239899635314940.0-0.0005042660050094128-0.024710899218916893-0.00403465982526540761.00.93196898698806760.248298004269599910.264160990715026860.0-0.0233826003968715670.768297016620636-0.63966697454452510.0-0.36178201436996460.5899729728698730.72183501720428470.00.0342739000916481-0.094680696725845340.0096299396827816961.00.94273298978805540.223545998334884640.24755300581455230.0-0.0176777001470327380.774619996547699-0.63217902183532710.0-0.3330799937248230.59160000085830690.73421198129653930.00.017191000282764435-0.03640500083565712-0.0060678198933601381.00.94295001029968260.21653699874877930.25289699435234070.0-0.0026940701063722370.7645390033721924-0.64457201957702640.0-0.33292299509048460.60711801052093510.72150599956512450.00.010213700123131275-0.023345300927758217-0.0043774899095296861.00.965412974357605-0.157709002494812-0.207616999745368960.0-0.0155645003542304040.7600290179252625-0.64970201253890990.00.26025900244712830.63046300411224370.73128801584243770.0-0.0036476401146501303-0.096580803394317630.0044052097946405411.00.9724739789962769-0.11432900279760361-0.203038007020950320.0-0.044799100607633590.7633640170097351-0.64441400766372680.00.22866700589656830.63577097654342650.73722898960113530.0-0.012315300293266773-0.035998400300741196-0.0075783901847898961.00.9637609720230103-0.15707699954509735-0.21561999619007110.0-0.0189111009240150450.7660049796104431-0.64255702495574950.00.26609700918197630.62334901094436650.73527497053146360.0-0.006562769878655672-0.02019290067255497-0.0045436499640345571.00.8221949934959412-0.3776470124721527-0.42588400840759280.00.118125997483730320.8451250195503235-0.5213530063629150.00.55681300163269040.37834599614143370.7394679784774780.0-0.023213399574160576-0.08812329918146133-0.0041738501749932771.00.8617600202560425-0.33954399824142456-0.37693598866462710.00.106248997151851650.8473150134086609-0.52035301923751830.00.496066004037857060.40837100148200990.76625800132751460.0-0.022267799824476242-0.023195700719952583-0.0055669001303613191.00.8747770190238953-0.3211840093135834-0.36277499794960020.00.108980998396873470.8599650263786316-0.49858099222183230.00.472110003232955930.39661198854446410.78728097677230830.0-0.012436600401997566-0.014924000017344952-0.00331673002801835541.00.91636699438095090.072017401456832890.39380899071693420.00.11881099641323090.8904470205307007-0.4393039941787720.0-0.382302999496459960.44935199618339540.8074200153350830.00.03221559897065163-0.02088090032339096-0.008553059771656991.00.92836797237396240.0201622005552053450.37111499905586240.00.166196003556251530.8706110119819641-0.46305000782012940.0-0.332432985305786130.49155899882316590.80489701032638550.00.029450900852680206-0.03365840017795563-0.00105209997855126861.00.928991973400116-0.079554900527000430.36144900321960450.00.26165801286697390.8318700194358826-0.48941498994827270.0-0.26174300909042360.54923802614212040.79361701011657710.00.020925000309944153-0.028203800320625305-0.00090978998923674231.0pelvis_offset0.0inverse_bind_matrix1.00.00.00.00.01.00.00.00.00.01.00.00.00.0-1.0670200586318971.00.99873197078704830.04983130097389221-0.0070897499099373820.0-0.0301342997699975970.7048000097274780.7087659835815430.00.040315598249435425-0.70765399932861330.7054079771041870.0-0.0084887603297829630.41053301095962524-1.20159995555877691.00.99894601106643680.045610301196575165-0.005135800223797560.0-0.0289570000022649770.71308398246765140.70047998428344730.00.03561139851808548-0.69959300756454470.71365398168563840.0-0.00293081998825073240.35466399788856506-1.19949996471405031.00.99634701013565060.08039940148591995-0.028780499473214150.0-0.0383009985089302060.72195601463317870.69087797403335570.00.07632440328598022-0.68725198507308960.72239899635314940.0-0.040985401719808580.3118860125541687-1.19960999488830571.00.9319689869880676-0.248298004269599910.264160990715026860.00.023382499814033510.7682970166206360.63966602087020870.0-0.3617820143699646-0.5899729728698730.72183501720428470.00.401042997837066650.2437240034341812-1.18042004108428961.00.9427329897880554-0.223545998334884640.24755300581455230.00.017677599564194680.7746199965476990.63217902183532710.0-0.333079993724823-0.59160000085830690.73421198129653930.00.355307996273040770.2053389996290207-1.1836500167846681.00.9429500102996826-0.21653699874877930.25289699435234070.00.002694060094654560.76453900337219240.64457201957702640.0-0.3329229950904846-0.60711801052093510.72150599956512450.00.353888005018234250.2048649936914444-1.17289996147155761.00.9654129743576050.157709002494812-0.207616999745368960.00.0155645003542304040.76002901792526250.64970201253890990.00.2602590024471283-0.63046300411224370.73128801584243770.0-0.26629498600959780.2996309995651245-1.20013999938964841.00.97247397899627690.11432900279760361-0.203038007020950320.00.044799100607633590.76336401700973510.64441400766372680.00.2286670058965683-0.63577097654342650.73722898960113530.0-0.23568700253963470.26565900444984436-1.19586002826690671.00.96376097202301030.15707699954509735-0.21561999619007110.00.0189111009240150450.76600497961044310.64255702495574950.00.2660970091819763-0.62334901094436650.73527497053146360.0-0.25492200255393980.23242099583148956-1.1886899471282961.00.82219499349594120.3776470124721527-0.42588400840759280.0-0.118125997483730320.84512501955032350.5213530063629150.00.5568130016326904-0.37834599614143370.7394679784774780.0-0.5196760296821594-0.007902019657194614-1.14863002300262451.00.86176002025604250.33954399824142456-0.37693598866462710.0-0.106248997151851650.84731501340866090.52035301923751830.00.49606600403785706-0.40837100148200990.76625800132751460.0-0.4340290129184723-0.0015098199946805835-1.1690100431442261.00.87477701902389530.3211840093135834-0.36277499794960020.0-0.108980998396873470.85996502637863160.49858099222183230.00.47211000323295593-0.39661198854446410.78728097677230830.0-0.3928540050983429-0.03789449855685234-1.17518997192382811.00.9163669943809509-0.072017200291156770.39380899071693420.0-0.11881099641323090.89044702053070070.4393039941787720.0-0.38230299949645996-0.44935199618339540.8074200153350830.00.513168990612030.09074380248785019-1.16830003261566161.00.9283679723739624-0.0201622005552053450.37111499905586240.0-0.166196003556251530.87061101198196410.46305000782012940.0-0.33243298530578613-0.49155899882316590.80489701032638550.00.450581997632980350.11499100178480148-1.17621004581451421.00.9289919734001160.079554900527000430.36144900321960450.0-0.26165801286697390.83187001943588260.48941498994827270.0-0.2617430090904236-0.54923802614212040.79361701011657710.00.4012039899826050.1690800040960312-1.17639994621276861.00.9987319707870483-0.04983120039105415-0.0070897699333727360.00.0301342997699975970.704800009727478-0.7087659835815430.00.0403155013918876650.70765399932861330.7054079771041870.0-0.008488760329782963-0.41053301095962524-1.20159995555877691.00.9989460110664368-0.045610301196575165-0.005135800223797560.00.0289570000022649770.7130839824676514-0.70047998428344730.00.035611398518085480.69959300756454470.71365398168563840.0-0.0029308199882507324-0.35466399788856506-1.19949996471405031.00.9963470101356506-0.08039940148591995-0.028780499473214150.00.0383009985089302060.7219560146331787-0.69087797403335570.00.076324403285980220.68725198507308960.72239899635314940.0-0.04098540171980858-0.3118860125541687-1.19960999488830571.00.93196898698806760.248298004269599910.264160990715026860.0-0.0233826003968715670.768297016620636-0.63966697454452510.0-0.36178201436996460.5899729728698730.72183501720428470.00.40104299783706665-0.2437240034341812-1.18042004108428961.00.94273298978805540.223545998334884640.24755300581455230.0-0.0176777001470327380.774619996547699-0.63217902183532710.0-0.3330799937248230.59160000085830690.73421198129653930.00.35530799627304077-0.2053389996290207-1.1836500167846681.00.94295001029968260.21653699874877930.25289699435234070.0-0.0026940701063722370.7645390033721924-0.64457201957702640.0-0.33292299509048460.60711801052093510.72150599956512450.00.35388800501823425-0.2048649936914444-1.17289996147155761.00.965412974357605-0.157709002494812-0.207616999745368960.0-0.0155645003542304040.7600290179252625-0.64970201253890990.00.26025900244712830.63046300411224370.73128801584243770.0-0.2662949860095978-0.2996309995651245-1.20013999938964841.00.9724739789962769-0.11432900279760361-0.203038007020950320.0-0.044799100607633590.7633640170097351-0.64441400766372680.00.22866700589656830.63577097654342650.73722898960113530.0-0.2356870025396347-0.26565900444984436-1.19586002826690671.00.9637609720230103-0.15707699954509735-0.21561999619007110.0-0.0189111009240150450.7660049796104431-0.64255702495574950.00.26609700918197630.62334901094436650.73527497053146360.0-0.2549220025539398-0.23242099583148956-1.1886899471282961.00.8221949934959412-0.3776470124721527-0.42588400840759280.00.118125997483730320.8451250195503235-0.5213530063629150.00.55681300163269040.37834599614143370.7394679784774780.0-0.51967602968215940.007902019657194614-1.14863002300262451.00.8617600202560425-0.33954399824142456-0.37693598866462710.00.106248997151851650.8473150134086609-0.52035301923751830.00.496066004037857060.40837100148200990.76625800132751460.0-0.43402901291847230.0015098199946805835-1.1690100431442261.00.8747770190238953-0.3211840093135834-0.36277499794960020.00.108980998396873470.8599650263786316-0.49858099222183230.00.472110003232955930.39661198854446410.78728097677230830.0-0.39285400509834290.03789449855685234-1.17518997192382811.00.91636699438095090.072017401456832890.39380899071693420.00.11881099641323090.8904470205307007-0.4393039941787720.0-0.382302999496459960.44935199618339540.8074200153350830.00.51316899061203-0.0907440036535263-1.16830003261566161.00.92836797237396240.0201622005552053450.37111499905586240.00.166196003556251530.8706110119819641-0.46305000782012940.0-0.332432985305786130.49155899882316590.80489701032638550.00.45058199763298035-0.11499100178480148-1.17621004581451421.00.928991973400116-0.079554900527000430.36144900321960450.00.26165801286697390.8318700194358826-0.48941498994827270.0-0.26174300909042360.54923802614212040.79361701011657710.00.401203989982605-0.1690800040960312-1.17639994621276861.015659a9a-f1c1-3e38-8343-2e23e9f65d20bind_shape_matrix0.129504993557930.00.00.00.00.097699806094169620.00.00.00.00.138080000877380370.00.021911798045039177-0.0570470988750457761.83544993400573731.0joint_namesmHeadmNeckmChestmTorsomPelvismFaceEar2RightmFaceEar1RightmFaceRootmFaceEar1LeftmFaceEar2Leftalt_inverse_bind_matrix1.08107995986938480.00.00.00.01.08107995986938480.00.00.00.01.08107995986938480.00.00.00.075629897415637971.01.18342995643615720.00.00.00.01.197600007057190.00.00.00.01.00.0-0.009507000446319580.00.251107990741729741.01.010100007057190.00.00.00.01.04166996479034420.00.00.00.01.00.0-0.015367999672889710.00.204877004027366641.01.00.00.00.00.01.00.00.00.00.01.00.00.00.00.084072902798652651.01.00.00.00.00.01.00.00.00.00.01.00.00.00.01.0670200586318971.01.00.00.00.00.01.00.00.00.00.01.00.00.0142705999314785-0.0175573993474245070.056489199399948121.01.00.00.00.00.01.00.00.00.00.01.00.00.0041375597938895226-0.047394301742315290.089543297886848451.01.08107995986938480.00.00.00.01.05708003044128420.00.00.00.01.10618996620178220.00.025000000372529030.00.045000001788139341.01.00.00.00.00.01.00.00.00.00.01.00.00.00413755979388952260.047394301742315290.089543297886848451.01.00.00.00.00.01.00.00.00.00.01.00.00.01427059993147850.0175573993474245070.056489199399948121.0pelvis_offset0.0inverse_bind_matrix1.08107995986938480.00.00.00.01.08107995986938480.00.00.00.01.08107995986938480.00.0267891008406877520.0-1.81913995742797851.01.18342995643615720.00.00.00.01.197600007057190.00.00.00.01.00.00.0293253995478153230.0-1.6070699691772461.01.010100007057190.00.00.00.01.04166996479034420.00.00.00.01.00.00.0155231999233365060.0-1.35596001148223881.01.00.00.00.00.01.00.00.00.00.01.00.00.00.0-1.15109002590179441.01.00.00.00.00.01.00.00.00.00.01.00.00.00.0-1.06701004505157471.01.00.00.00.00.01.00.00.00.00.01.00.0-0.0164429005235433580.062392398715019226-1.86315000057220461.01.00.00.00.00.01.00.00.00.00.01.00.0-0.00217230990529060360.04483500123023987-1.80666005611419681.01.08107995986938480.00.00.00.01.05708003044128420.00.00.00.01.10618996620178220.00.00178911001421511170.0-1.90898001194000241.01.00.00.00.00.01.00.00.00.00.01.00.0-0.0021723099052906036-0.04483500123023987-1.80666005611419681.01.00.00.00.00.01.00.00.00.00.01.00.0-0.016442900523543358-0.062392398715019226-1.86315000057220461.01d5936bc-0501-7376-f70c-06dcfac920edbind_shape_matrix0.048803295940160750.00.00.00.00.0488033369183540340.00.00.00.00.049029946327209470.00.058865547180175780.03438653051853181.75724506378173831.0joint_namesmEyeLeftmHeadmNeckmChestmTorsomPelvismEyeRightalt_inverse_bind_matrix1.08107995986938480.00.00.00.01.08107995986938480.00.00.00.01.08107995986938480.00.090427502989768980.037174601107835770.080562800168991091.01.08107995986938480.00.00.00.01.08107995986938480.00.00.00.01.08107995986938480.00.00.00.075629897415637971.01.18342995643615720.00.00.00.01.197600007057190.00.00.00.01.00.0-0.009507000446319580.00.251107990741729741.01.010100007057190.00.00.00.01.04166996479034420.00.00.00.01.00.0-0.015367999672889710.00.204877004027366641.01.00.00.00.00.01.00.00.00.00.01.00.00.00.00.084072902798652651.01.00.00.00.00.01.00.00.00.00.01.00.00.00.01.0670200586318971.01.08107995986938480.00.00.00.01.08107995986938480.00.00.00.01.08107995986938480.00.09042750298976898-0.037174601107835770.080562800168991091.0pelvis_offset0.0inverse_bind_matrix1.08107995986938480.00.00.00.01.08107995986938480.00.00.00.01.08107995986938480.0-0.06363839656114578-0.03717460110783577-1.89970004558563231.01.08107995986938480.00.00.00.01.08107995986938480.00.00.00.01.08107995986938480.00.0267891008406877520.0-1.81913995742797851.01.18342995643615720.00.00.00.01.197600007057190.00.00.00.01.00.00.0293253995478153230.0-1.6070699691772461.01.010100007057190.00.00.00.01.04166996479034420.00.00.00.01.00.00.0155231999233365060.0-1.35596001148223881.01.00.00.00.00.01.00.00.00.00.01.00.00.00.0-1.15109002590179441.01.00.00.00.00.01.00.00.00.00.01.00.00.00.0-1.06701004505157471.01.08107995986938480.00.00.00.01.08107995986938480.00.00.00.01.08107995986938480.0-0.063638396561145780.03717460110783577-1.89970004558563231.09174c7f1-bd5f-68d2-2f4f-cc9b36312067bind_shape_matrix0.083263903856277470.00.00.00.00.125166594982147220.00.00.00.00.105179905891418460.00.113597050309181210.01.73993992805480961.0joint_namesmHeadmNeckmChestmTorsomPelvismFaceJawmFaceRootmFaceLipUpperLeftmFaceTeethUppermFaceLipUpperRightmFaceLipCornerLeftmFaceLipCornerRightmFaceLipLowerCentermFaceTeethLowermFaceChinmFaceLipLowerLeftmFaceLipLowerRightmFaceEyeLidUpperLeftmFaceEyeLidUpperRightmFaceEyebrowInnerLeftmFaceEyebrowInnerRightmFaceEyebrowCenterLeftmFaceEyebrowCenterRightmFaceForeheadCentermFaceNoseBridgemFaceNoseBasemFaceEyeLidLowerLeftmFaceEyeLidLowerRightmFaceCheekUpperLeftmFaceCheekUpperRightmFaceLipUpperCenteralt_inverse_bind_matrix1.08107995986938480.00.00.00.01.08107995986938480.00.00.00.01.08107995986938480.00.00.00.075629897415637971.01.18342995643615720.00.00.00.01.197600007057190.00.00.00.01.00.0-0.009507000446319580.00.251107990741729741.01.010100007057190.00.00.00.01.04166996479034420.00.00.00.01.00.0-0.015367999672889710.00.204877004027366641.01.00.00.00.00.01.00.00.00.00.01.00.00.00.00.084072902798652651.01.00.00.00.00.01.00.00.00.00.01.00.00.00.01.0670200586318971.01.08107995986938480.00.00.00.01.08107995986938480.00.00.00.01.08107995986938480.00.0359875001013278960.0-0.0253964997828006741.01.08107995986938480.00.00.00.01.05708003044128420.00.00.00.01.10618996620178220.00.025000000372529030.00.045000001788139341.01.08107995986938480.00.00.00.01.08107995986938480.00.00.00.01.2208299636840820.0-0.0591681003570556640.00.0048508602194488051.01.08107995986938480.00.00.00.01.08107995986938480.00.00.00.01.08107995986938480.00.107000999152660370.0-0.0260765999555587771.01.08107995986938480.00.00.00.01.08107995986938480.00.00.00.01.2208299636840820.0-0.0591681003570556640.00.0048508602194488051.01.08107995986938480.00.00.00.01.08107995986938480.00.00.00.01.08107995986938480.00.03629549965262413-0.01899999938905239-0.0134859997779130941.01.08107995986938480.00.00.00.01.08107995986938480.00.00.00.01.08107995986938480.00.036295499652624130.01899999938905239-0.0134859997779130941.01.08107995986938480.00.00.00.01.08107995986938480.00.00.00.01.08107995986938480.0-0.020269699394702910.00.0053312801755964761.01.08107995986938480.00.00.00.01.08107995986938480.00.00.00.01.08107995986938480.00.083006501197814940.0-0.0203639995306730271.01.08107995986938480.00.00.00.01.08107995986938480.00.00.00.01.08107995986938480.00.083787396550178530.0-0.0266884993761777881.01.08107995986938480.00.00.00.01.08107995986938480.00.00.00.01.08107995986938480.00.03427229821681976-0.012062000110745430.00051081198034808041.01.08107995986938480.00.00.00.01.08107995986938480.00.00.00.01.08107995986938480.00.034272298216819760.012062000110745430.00051081198034808041.01.08107995986938480.00.00.00.01.08107995986938480.00.00.00.01.08107995986938480.00.044901698827743530.0369763001799583440.038352798670530321.01.08107995986938480.00.00.00.01.08107995986938480.00.00.00.01.08107995986938480.00.04490169882774353-0.0369763001799583440.038352798670530321.01.08107995986938480.00.00.00.01.08107995986938480.00.00.00.00.85106402635574340.00.0181128997355699540.0167341008782386780.057003501802682881.01.08107995986938480.00.00.00.01.08107995986938480.00.00.00.00.85106402635574340.00.018112899735569954-0.0167341008782386780.057003501802682881.01.08107995986938480.00.00.00.01.08107995986938480.00.00.00.00.85106402635574340.0-0.0082314396277070050.037603501230478290.056274298578500751.01.08107995986938480.00.00.00.01.08107995986938480.00.00.00.00.85106402635574340.0-0.008231439627707005-0.037603501230478290.056274298578500751.01.08107995986938480.00.00.00.01.08107995986938480.00.00.00.01.08107995986938480.00.073194302618503570.00.087502397596836091.01.08107995986938480.00.00.00.01.08107995986938480.00.00.00.01.08107995986938480.00.104399003088474270.00.0171770993620157241.01.08107995986938480.00.00.00.01.08107995986938480.00.00.00.01.08107995986938480.00.150499001145362850.00.00385225005447864531.01.08107995986938480.00.00.00.01.08107995986938480.00.00.00.01.08107995986938480.00.044901698827743530.0369763001799583440.038352798670530321.01.08107995986938480.00.00.00.01.08107995986938480.00.00.00.01.08107995986938480.00.04490169882774353-0.0369763001799583440.038352798670530321.01.08107995986938480.00.00.00.01.08107995986938480.00.00.00.01.08107995986938480.00.0291581992059946060.05687420070171356-0.0045324601233005521.01.08107995986938480.00.00.00.01.08107995986938480.00.00.00.01.08107995986938480.00.029158199205994606-0.05687420070171356-0.0045324601233005521.01.08107995986938480.00.00.00.01.08107995986938480.00.00.00.01.041350007057190.00.0167011991143226620.00.0097117396071553231.0pelvis_offset0.0inverse_bind_matrix1.08107995986938480.00.00.00.01.08107995986938480.00.00.00.01.08107995986938480.00.0267891008406877520.0-1.81913995742797851.01.18342995643615720.00.00.00.01.197600007057190.00.00.00.01.00.00.0293253995478153230.0-1.6070699691772461.01.010100007057190.00.00.00.01.04166996479034420.00.00.00.01.00.00.0155231999233365060.0-1.35596001148223881.01.00.00.00.00.01.00.00.00.00.01.00.00.00.0-1.15109002590179441.01.00.00.00.00.01.00.00.00.00.01.00.00.00.0-1.06701004505157471.01.08107995986938480.00.00.00.01.08107995986938480.00.00.00.01.08107995986938480.0-0.0341983996331691740.0-1.84081995487213131.01.08107995986938480.00.00.00.01.05708003044128420.00.00.00.01.10618996620178220.00.00178911001421511170.0-1.90898001194000241.01.08107995986938480.00.00.00.01.08107995986938480.00.00.00.01.2208299636840820.0-0.046043299138545990.0-2.08349990844726561.01.08107995986938480.00.00.00.01.08107995986938480.00.00.00.01.08107995986938480.0-0.105210997164249420.0-1.8401499986648561.01.08107995986938480.00.00.00.01.08107995986938480.00.00.00.01.2208299636840820.0-0.046043299138545990.0-2.08349990844726561.01.08107995986938480.00.00.00.01.08107995986938480.00.00.00.01.08107995986938480.0-0.141506999731063840.01899999938905239-1.82667005062103271.01.08107995986938480.00.00.00.01.08107995986938480.00.00.00.01.08107995986938480.0-0.14150699973106384-0.01899999938905239-1.82667005062103271.01.08107995986938480.00.00.00.01.08107995986938480.00.00.00.01.08107995986938480.0-0.096935302019119260.0-1.82579004764556881.01.08107995986938480.00.00.00.01.08107995986938480.00.00.00.01.08107995986938480.0-0.117205001413822170.0-1.8204499483108521.01.08107995986938480.00.00.00.01.08107995986938480.00.00.00.01.08107995986938480.0-0.117986001074314120.0-1.81412994861602781.01.08107995986938480.00.00.00.01.08107995986938480.00.00.00.01.08107995986938480.0-0.151476994156837460.01206200011074543-1.8209700584411621.01.08107995986938480.00.00.00.01.08107995986938480.00.00.00.01.08107995986938480.0-0.15147699415683746-0.01206200011074543-1.8209700584411621.01.08107995986938480.00.00.00.01.08107995986938480.00.00.00.01.08107995986938480.0-0.04311259835958481-0.037815701216459274-1.90312004089355471.01.08107995986938480.00.00.00.01.08107995986938480.00.00.00.01.08107995986938480.0-0.043112598359584810.037815701216459274-1.90312004089355471.01.08107995986938480.00.00.00.01.08107995986938480.00.00.00.00.85106402635574340.0-0.016323799267411232-0.017114000394940376-1.51254999637603761.01.08107995986938480.00.00.00.01.08107995986938480.00.00.00.00.85106402635574340.0-0.0163237992674112320.017114000394940376-1.51254999637603761.01.08107995986938480.00.00.00.01.08107995986938480.00.00.00.00.85106402635574340.00.010020599700510502-0.038457199931144714-1.5119899511337281.01.08107995986938480.00.00.00.01.08107995986938480.00.00.00.00.85106402635574340.00.0100205997005105020.038457199931144714-1.5119899511337281.01.08107995986938480.00.00.00.01.08107995986938480.00.00.00.01.08107995986938480.0-0.071405202150344850.0-1.95114994049072271.01.08107995986938480.00.00.00.01.08107995986938480.00.00.00.01.08107995986938480.0-0.102609001100063320.0-1.88242995738983151.01.08107995986938480.00.00.00.01.08107995986938480.00.00.00.01.08107995986938480.0-0.14870999753475190.0-1.86940002441406251.01.08107995986938480.00.00.00.01.08107995986938480.00.00.00.01.08107995986938480.0-0.04311259835958481-0.037815701216459274-1.90312004089355471.01.08107995986938480.00.00.00.01.08107995986938480.00.00.00.01.08107995986938480.0-0.043112598359584810.037815701216459274-1.90312004089355471.01.08107995986938480.00.00.00.01.08107995986938480.00.00.00.01.08107995986938480.0-0.027369100600481033-0.058165401220321655-1.86120998859405521.01.08107995986938480.00.00.00.01.08107995986938480.00.00.00.01.08107995986938480.0-0.0273691006004810330.058165401220321655-1.86120998859405521.01.08107995986938480.00.00.00.01.08107995986938480.00.00.00.01.041350007057190.0-0.121913000941276550.0-1.78188002109527591.0d73dea3b-b8cb-59ff-c76b-cfdcc8119bb5bind_shape_matrix0.088992610573768620.00.00.00.00.063932202756404880.00.00.00.00.0207600593566894530.00.103547699749469760.01.6937500238418581.0joint_namesmFaceJawmFaceRootmHeadmNeckmChestmTorsomPelvisalt_inverse_bind_matrix1.08107995986938480.00.00.00.01.08107995986938480.00.00.00.01.08107995986938480.00.0359875001013278960.0-0.0253947004675865171.01.08107995986938480.00.00.00.01.05708003044128420.00.00.00.01.10618996620178220.00.025000000372529030.00.045000001788139341.01.08107995986938480.00.00.00.01.08107995986938480.00.00.00.01.08107995986938480.00.00.00.075629897415637971.01.18342995643615720.00.00.00.01.197600007057190.00.00.00.01.00.0-0.009507000446319580.00.251107990741729741.01.010100007057190.00.00.00.01.04166996479034420.00.00.00.01.00.0-0.015367999672889710.00.204877004027366641.01.00.00.00.00.01.00.00.00.00.01.00.00.00.00.084072902798652651.01.00.00.00.00.01.00.00.00.00.01.00.00.00.01.0670200586318971.0pelvis_offset0.0inverse_bind_matrix1.08107995986938480.00.00.00.01.08107995986938480.00.00.00.01.08107995986938480.0-0.0341983996331691740.0-1.84081995487213131.01.08107995986938480.00.00.00.01.05708003044128420.00.00.00.01.10618996620178220.00.00178911001421511170.0-1.90898001194000241.01.08107995986938480.00.00.00.01.08107995986938480.00.00.00.01.08107995986938480.00.0267891008406877520.0-1.81913995742797851.01.18342995643615720.00.00.00.01.197600007057190.00.00.00.01.00.00.0293253995478153230.0-1.6070699691772461.01.010100007057190.00.00.00.01.04166996479034420.00.00.00.01.00.00.0155231999233365060.0-1.35596001148223881.01.00.00.00.00.01.00.00.00.00.01.00.00.00.0-1.15109002590179441.01.00.00.00.00.01.00.00.00.00.01.00.00.00.0-1.06701004505157471.0d0328b82-d9ca-6071-b248-17edfc7612cbbind_shape_matrix0.135498702526092530.00.00.00.00.14647419750690460.00.00.00.00.120779991149902340.00.103381648659706120.01.74884998798370361.0joint_namesmHeadmNeckmChestmTorsomPelvismFaceJawmFaceRootmFaceLipUpperLeftmFaceTeethUppermFaceLipUpperRightmFaceLipCornerLeftmFaceLipCornerRightmFaceLipLowerCentermFaceTeethLowermFaceChinmFaceLipLowerLeftmFaceLipLowerRightmFaceEyeLidUpperLeftmFaceEyeLidUpperRightmFaceEyebrowInnerLeftmFaceEyebrowInnerRightmFaceEyebrowCenterLeftmFaceEyebrowCenterRightmFaceForeheadCentermFaceNoseBridgemFaceNoseBasemFaceEyeLidLowerLeftmFaceEyeLidLowerRightmFaceCheekUpperLeftmFaceCheekUpperRightmFaceLipUpperCenteralt_inverse_bind_matrix1.08107995986938480.00.00.00.01.08107995986938480.00.00.00.01.08107995986938480.00.00.00.075629897415637971.01.18342995643615720.00.00.00.01.197600007057190.00.00.00.01.00.0-0.009507000446319580.00.251107990741729741.01.010100007057190.00.00.00.01.04166996479034420.00.00.00.01.00.0-0.015367999672889710.00.204877004027366641.01.00.00.00.00.01.00.00.00.00.01.00.00.00.00.084072902798652651.01.00.00.00.00.01.00.00.00.00.01.00.00.00.01.0670200586318971.01.08107995986938480.00.00.00.01.08107995986938480.00.00.00.01.08107995986938480.00.0359875001013278960.0-0.0253947004675865171.01.08107995986938480.00.00.00.01.05708003044128420.00.00.00.01.10618996620178220.00.025000000372529030.00.045000001788139341.01.08107995986938480.00.00.00.01.08107995986938480.00.00.00.01.2208299636840820.0-0.0591681003570556640.00.0048508602194488051.01.08107995986938480.00.00.00.01.08107995986938480.00.00.00.01.08107995986938480.00.107000999152660370.0-0.026074899360537531.01.08107995986938480.00.00.00.01.08107995986938480.00.00.00.01.2208299636840820.0-0.0591681003570556640.00.0048508602194488051.01.08107995986938480.00.00.00.01.08107995986938480.00.00.00.01.08107995986938480.00.03629549965262413-0.01899999938905239-0.0134859997779130941.01.08107995986938480.00.00.00.01.08107995986938480.00.00.00.01.08107995986938480.00.036295499652624130.01899999938905239-0.0134859997779130941.01.08107995986938480.00.00.00.01.08107995986938480.00.00.00.01.08107995986938480.0-0.020269699394702910.00.0053312801755964761.01.08107995986938480.00.00.00.01.08107995986938480.00.00.00.01.08107995986938480.00.083006501197814940.0-0.0203639995306730271.01.08107995986938480.00.00.00.01.08107995986938480.00.00.00.01.08107995986938480.00.083787396550178530.0-0.0266884993761777881.01.08107995986938480.00.00.00.01.08107995986938480.00.00.00.01.08107995986938480.00.03427229821681976-0.012062000110745430.00051081198034808041.01.08107995986938480.00.00.00.01.08107995986938480.00.00.00.01.08107995986938480.00.034272298216819760.012062000110745430.00051081198034808041.01.08107995986938480.00.00.00.01.08107995986938480.00.00.00.01.08107995986938480.00.044901698827743530.0369763001799583440.0383545011281967161.01.08107995986938480.00.00.00.01.08107995986938480.00.00.00.01.08107995986938480.00.04490169882774353-0.0369763001799583440.0383545011281967161.01.08107995986938480.00.00.00.01.08107995986938480.00.00.00.00.85106402635574340.00.0181128997355699540.0167341008782386780.0570053011178970341.01.08107995986938480.00.00.00.01.08107995986938480.00.00.00.00.85106402635574340.00.018112899735569954-0.0167341008782386780.0570053011178970341.01.08107995986938480.00.00.00.01.08107995986938480.00.00.00.00.85106402635574340.0-0.0082314396277070050.037603501230478290.0562760010361671451.01.08107995986938480.00.00.00.01.08107995986938480.00.00.00.00.85106402635574340.0-0.008231439627707005-0.037603501230478290.0562760010361671451.01.08107995986938480.00.00.00.01.08107995986938480.00.00.00.01.08107995986938480.00.073194302618503570.00.087503999471664431.01.08107995986938480.00.00.00.01.08107995986938480.00.00.00.01.08107995986938480.00.104399003088474270.00.0171787999570369721.01.08107995986938480.00.00.00.01.08107995986938480.00.00.00.01.08107995986938480.00.150499001145362850.00.0038539199158549311.01.08107995986938480.00.00.00.01.08107995986938480.00.00.00.01.08107995986938480.00.044901698827743530.0369763001799583440.0383545011281967161.01.08107995986938480.00.00.00.01.08107995986938480.00.00.00.01.08107995986938480.00.04490169882774353-0.0369763001799583440.0383545011281967161.01.08107995986938480.00.00.00.01.08107995986938480.00.00.00.01.08107995986938480.00.0291581992059946060.05687420070171356-0.00453078979626297951.01.08107995986938480.00.00.00.01.08107995986938480.00.00.00.01.08107995986938480.00.029158199205994606-0.05687420070171356-0.00453078979626297951.01.08107995986938480.00.00.00.01.08107995986938480.00.00.00.01.041350007057190.00.0167011991143226620.00.0097117396071553231.0pelvis_offset0.0inverse_bind_matrix1.08107995986938480.00.00.00.01.08107995986938480.00.00.00.01.08107995986938480.00.0267891008406877520.0-1.81913995742797851.01.18342995643615720.00.00.00.01.197600007057190.00.00.00.01.00.00.0293253995478153230.0-1.6070699691772461.01.010100007057190.00.00.00.01.04166996479034420.00.00.00.01.00.00.0155231999233365060.0-1.35596001148223881.01.00.00.00.00.01.00.00.00.00.01.00.00.00.0-1.15109002590179441.01.00.00.00.00.01.00.00.00.00.01.00.00.00.0-1.06701004505157471.01.08107995986938480.00.00.00.01.08107995986938480.00.00.00.01.08107995986938480.0-0.0341983996331691740.0-1.84081995487213131.01.08107995986938480.00.00.00.01.05708003044128420.00.00.00.01.10618996620178220.00.00178911001421511170.0-1.90898001194000241.01.08107995986938480.00.00.00.01.08107995986938480.00.00.00.01.2208299636840820.0-0.046043299138545990.0-2.08349990844726561.01.08107995986938480.00.00.00.01.08107995986938480.00.00.00.01.08107995986938480.0-0.105210997164249420.0-1.84016001224517821.01.08107995986938480.00.00.00.01.08107995986938480.00.00.00.01.2208299636840820.0-0.046043299138545990.0-2.08349990844726561.01.08107995986938480.00.00.00.01.08107995986938480.00.00.00.01.08107995986938480.0-0.141506999731063840.01899999938905239-1.82667005062103271.01.08107995986938480.00.00.00.01.08107995986938480.00.00.00.01.08107995986938480.0-0.14150699973106384-0.01899999938905239-1.82667005062103271.01.08107995986938480.00.00.00.01.08107995986938480.00.00.00.01.08107995986938480.0-0.096935302019119260.0-1.82579004764556881.01.08107995986938480.00.00.00.01.08107995986938480.00.00.00.01.08107995986938480.0-0.117205001413822170.0-1.82045996189117431.01.08107995986938480.00.00.00.01.08107995986938480.00.00.00.01.08107995986938480.0-0.117986001074314120.0-1.81412994861602781.01.08107995986938480.00.00.00.01.08107995986938480.00.00.00.01.08107995986938480.0-0.151476994156837460.01206200011074543-1.8209700584411621.01.08107995986938480.00.00.00.01.08107995986938480.00.00.00.01.08107995986938480.0-0.15147699415683746-0.01206200011074543-1.8209700584411621.01.08107995986938480.00.00.00.01.08107995986938480.00.00.00.01.08107995986938480.0-0.04311259835958481-0.037815701216459274-1.90312004089355471.01.08107995986938480.00.00.00.01.08107995986938480.00.00.00.01.08107995986938480.0-0.043112598359584810.037815701216459274-1.90312004089355471.01.08107995986938480.00.00.00.01.08107995986938480.00.00.00.00.85106402635574340.0-0.016323799267411232-0.017114000394940376-1.51254999637603761.01.08107995986938480.00.00.00.01.08107995986938480.00.00.00.00.85106402635574340.0-0.0163237992674112320.017114000394940376-1.51254999637603761.01.08107995986938480.00.00.00.01.08107995986938480.00.00.00.00.85106402635574340.00.010020599700510502-0.038457199931144714-1.5119899511337281.01.08107995986938480.00.00.00.01.08107995986938480.00.00.00.00.85106402635574340.00.0100205997005105020.038457199931144714-1.5119899511337281.01.08107995986938480.00.00.00.01.08107995986938480.00.00.00.01.08107995986938480.0-0.071405202150344850.0-1.9511599540710451.01.08107995986938480.00.00.00.01.08107995986938480.00.00.00.01.08107995986938480.0-0.102609001100063320.0-1.88242995738983151.01.08107995986938480.00.00.00.01.08107995986938480.00.00.00.01.08107995986938480.0-0.14870999753475190.0-1.86940002441406251.01.08107995986938480.00.00.00.01.08107995986938480.00.00.00.01.08107995986938480.0-0.04311259835958481-0.037815701216459274-1.90312004089355471.01.08107995986938480.00.00.00.01.08107995986938480.00.00.00.01.08107995986938480.0-0.043112598359584810.037815701216459274-1.90312004089355471.01.08107995986938480.00.00.00.01.08107995986938480.00.00.00.01.08107995986938480.0-0.027369100600481033-0.058165401220321655-1.86120998859405521.01.08107995986938480.00.00.00.01.08107995986938480.00.00.00.01.08107995986938480.0-0.0273691006004810330.058165401220321655-1.86120998859405521.01.08107995986938480.00.00.00.01.08107995986938480.00.00.00.01.041350007057190.0-0.121913000941276550.0-1.78188002109527591.005bf604d-d1c0-352b-cb2f-c37caca6f542bind_shape_matrix0.0145499994978308680.00.00.00.00.0359961986541748050.00.00.00.00.0196599960327148440.00.13412399590015410.01.69300997257232671.0joint_namesmFaceJawmFaceRootmHeadmNeckmChestmTorsomPelvisalt_inverse_bind_matrix1.08107995986938480.00.00.00.01.08107995986938480.00.00.00.01.08107995986938480.00.0359875001013278960.0-0.0253947004675865171.01.08107995986938480.00.00.00.01.05708003044128420.00.00.00.01.10618996620178220.00.025000000372529030.00.045000001788139341.01.08107995986938480.00.00.00.01.08107995986938480.00.00.00.01.08107995986938480.00.00.00.075629897415637971.01.18342995643615720.00.00.00.01.197600007057190.00.00.00.01.00.0-0.009507000446319580.00.251107990741729741.01.010100007057190.00.00.00.01.04166996479034420.00.00.00.01.00.0-0.015367999672889710.00.204877004027366641.01.00.00.00.00.01.00.00.00.00.01.00.00.00.00.084072902798652651.01.00.00.00.00.01.00.00.00.00.01.00.00.00.01.0670200586318971.0pelvis_offset0.0inverse_bind_matrix1.08107995986938480.00.00.00.01.08107995986938480.00.00.00.01.08107995986938480.0-0.0341983996331691740.0-1.84081995487213131.01.08107995986938480.00.00.00.01.05708003044128420.00.00.00.01.10618996620178220.00.00178911001421511170.0-1.90898001194000241.01.08107995986938480.00.00.00.01.08107995986938480.00.00.00.01.08107995986938480.00.0267891008406877520.0-1.81913995742797851.01.18342995643615720.00.00.00.01.197600007057190.00.00.00.01.00.00.0293253995478153230.0-1.6070699691772461.01.010100007057190.00.00.00.01.04166996479034420.00.00.00.01.00.00.0155231999233365060.0-1.35596001148223881.01.00.00.00.00.01.00.00.00.00.01.00.00.00.0-1.15109002590179441.01.00.00.00.00.01.00.00.00.00.01.00.00.00.0-1.06701004505157471.046ee8fb2-15f0-fa2e-d260-e7e6e8295445bind_shape_matrix0.144471108913421630.00.00.00.00.079346001148223880.00.00.00.00.03420996665954590.00.078120440244674680.01.697255015373231.0joint_namesmFaceJawmFaceRootmHeadmNeckmChestmTorsomPelvisalt_inverse_bind_matrix1.08107995986938480.00.00.00.01.08107995986938480.00.00.00.01.08107995986938480.00.0359875001013278960.0-0.0253947004675865171.01.08107995986938480.00.00.00.01.05708003044128420.00.00.00.01.10618996620178220.00.025000000372529030.00.045000001788139341.01.08107995986938480.00.00.00.01.08107995986938480.00.00.00.01.08107995986938480.00.00.00.075629897415637971.01.18342995643615720.00.00.00.01.197600007057190.00.00.00.01.00.0-0.009507000446319580.00.251107990741729741.01.010100007057190.00.00.00.01.04166996479034420.00.00.00.01.00.0-0.015367999672889710.00.204877004027366641.01.00.00.00.00.01.00.00.00.00.01.00.00.00.00.084072902798652651.01.00.00.00.00.01.00.00.00.00.01.00.00.00.01.0670200586318971.0pelvis_offset0.0inverse_bind_matrix1.08107995986938480.00.00.00.01.08107995986938480.00.00.00.01.08107995986938480.0-0.0341983996331691740.0-1.84081995487213131.01.08107995986938480.00.00.00.01.05708003044128420.00.00.00.01.10618996620178220.00.00178911001421511170.0-1.90898001194000241.01.08107995986938480.00.00.00.01.08107995986938480.00.00.00.01.08107995986938480.00.0267891008406877520.0-1.81913995742797851.01.18342995643615720.00.00.00.01.197600007057190.00.00.00.01.00.00.0293253995478153230.0-1.6070699691772461.01.010100007057190.00.00.00.01.04166996479034420.00.00.00.01.00.00.0155231999233365060.0-1.35596001148223881.01.00.00.00.00.01.00.00.00.00.01.00.00.00.0-1.15109002590179441.01.00.00.00.00.01.00.00.00.00.01.00.00.00.0-1.06701004505157471.0d2205615-2ce0-4ff1-2bfd-bdc77a3825ccbind_shape_matrix0.065835200250148770.00.00.00.00.19282799959182740.00.00.00.00.105929970741271970.00.020774498581886290.01.71460509300231931.0joint_namesmHeadmNeckmChestmTorsomPelvismFaceJawmFaceRootmFaceLipUpperLeftmFaceTeethUppermFaceLipUpperRightmFaceLipCornerLeftmFaceLipCornerRightmFaceLipLowerCentermFaceTeethLowermFaceChinmFaceLipLowerLeftmFaceLipLowerRightmFaceEyeLidUpperLeftmFaceEyeLidUpperRightmFaceEyebrowInnerLeftmFaceEyebrowInnerRightmFaceEyebrowCenterLeftmFaceEyebrowCenterRightmFaceForeheadCentermFaceNoseBridgemFaceNoseBasemFaceEyeLidLowerLeftmFaceEyeLidLowerRightmFaceCheekUpperLeftmFaceCheekUpperRightmFaceLipUpperCenteralt_inverse_bind_matrix1.08107995986938480.00.00.00.01.08107995986938480.00.00.00.01.08107995986938480.00.00.00.075629897415637971.01.18342995643615720.00.00.00.01.197600007057190.00.00.00.01.00.0-0.009507000446319580.00.251107990741729741.01.010100007057190.00.00.00.01.04166996479034420.00.00.00.01.00.0-0.015367999672889710.00.204877004027366641.01.00.00.00.00.01.00.00.00.00.01.00.00.00.00.084072902798652651.01.00.00.00.00.01.00.00.00.00.01.00.00.00.01.0670200586318971.01.08107995986938480.00.00.00.01.08107995986938480.00.00.00.01.08107995986938480.00.0359875001013278960.0-0.0253947004675865171.01.08107995986938480.00.00.00.01.05708003044128420.00.00.00.01.10618996620178220.00.025000000372529030.00.045000001788139341.01.08107995986938480.00.00.00.01.08107995986938480.00.00.00.01.2208299636840820.0-0.0591681003570556640.00.0048508602194488051.01.08107995986938480.00.00.00.01.08107995986938480.00.00.00.01.08107995986938480.00.107000999152660370.0-0.026074899360537531.01.08107995986938480.00.00.00.01.08107995986938480.00.00.00.01.2208299636840820.0-0.0591681003570556640.00.0048508602194488051.01.08107995986938480.00.00.00.01.08107995986938480.00.00.00.01.08107995986938480.00.03629549965262413-0.01899999938905239-0.0134859997779130941.01.08107995986938480.00.00.00.01.08107995986938480.00.00.00.01.08107995986938480.00.036295499652624130.01899999938905239-0.0134859997779130941.01.08107995986938480.00.00.00.01.08107995986938480.00.00.00.01.08107995986938480.0-0.020269699394702910.00.0053312801755964761.01.08107995986938480.00.00.00.01.08107995986938480.00.00.00.01.08107995986938480.00.083006501197814940.0-0.0203639995306730271.01.08107995986938480.00.00.00.01.08107995986938480.00.00.00.01.08107995986938480.00.083787396550178530.0-0.0266884993761777881.01.08107995986938480.00.00.00.01.08107995986938480.00.00.00.01.08107995986938480.00.03427229821681976-0.012062000110745430.00051081198034808041.01.08107995986938480.00.00.00.01.08107995986938480.00.00.00.01.08107995986938480.00.034272298216819760.012062000110745430.00051081198034808041.01.08107995986938480.00.00.00.01.08107995986938480.00.00.00.01.08107995986938480.00.044901698827743530.0369763001799583440.0383545011281967161.01.08107995986938480.00.00.00.01.08107995986938480.00.00.00.01.08107995986938480.00.04490169882774353-0.0369763001799583440.0383545011281967161.01.08107995986938480.00.00.00.01.08107995986938480.00.00.00.00.85106402635574340.00.0181128997355699540.0167341008782386780.0570053011178970341.01.08107995986938480.00.00.00.01.08107995986938480.00.00.00.00.85106402635574340.00.018112899735569954-0.0167341008782386780.0570053011178970341.01.08107995986938480.00.00.00.01.08107995986938480.00.00.00.00.85106402635574340.0-0.0082314396277070050.037603501230478290.0562760010361671451.01.08107995986938480.00.00.00.01.08107995986938480.00.00.00.00.85106402635574340.0-0.008231439627707005-0.037603501230478290.0562760010361671451.01.08107995986938480.00.00.00.01.08107995986938480.00.00.00.01.08107995986938480.00.073194302618503570.00.087503999471664431.01.08107995986938480.00.00.00.01.08107995986938480.00.00.00.01.08107995986938480.00.104399003088474270.00.0171787999570369721.01.08107995986938480.00.00.00.01.08107995986938480.00.00.00.01.08107995986938480.00.150499001145362850.00.0038539199158549311.01.08107995986938480.00.00.00.01.08107995986938480.00.00.00.01.08107995986938480.00.044901698827743530.0369763001799583440.0383545011281967161.01.08107995986938480.00.00.00.01.08107995986938480.00.00.00.01.08107995986938480.00.04490169882774353-0.0369763001799583440.0383545011281967161.01.08107995986938480.00.00.00.01.08107995986938480.00.00.00.01.08107995986938480.00.0291581992059946060.05687420070171356-0.00453078979626297951.01.08107995986938480.00.00.00.01.08107995986938480.00.00.00.01.08107995986938480.00.029158199205994606-0.05687420070171356-0.00453078979626297951.01.08107995986938480.00.00.00.01.08107995986938480.00.00.00.01.041350007057190.00.0167011991143226620.00.0097117396071553231.0pelvis_offset0.0inverse_bind_matrix1.08107995986938480.00.00.00.01.08107995986938480.00.00.00.01.08107995986938480.00.0267891008406877520.0-1.81913995742797851.01.18342995643615720.00.00.00.01.197600007057190.00.00.00.01.00.00.0293253995478153230.0-1.6070699691772461.01.010100007057190.00.00.00.01.04166996479034420.00.00.00.01.00.00.0155231999233365060.0-1.35596001148223881.01.00.00.00.00.01.00.00.00.00.01.00.00.00.0-1.15109002590179441.01.00.00.00.00.01.00.00.00.00.01.00.00.00.0-1.06701004505157471.01.08107995986938480.00.00.00.01.08107995986938480.00.00.00.01.08107995986938480.0-0.0341983996331691740.0-1.84081995487213131.01.08107995986938480.00.00.00.01.05708003044128420.00.00.00.01.10618996620178220.00.00178911001421511170.0-1.90898001194000241.01.08107995986938480.00.00.00.01.08107995986938480.00.00.00.01.2208299636840820.0-0.046043299138545990.0-2.08349990844726561.01.08107995986938480.00.00.00.01.08107995986938480.00.00.00.01.08107995986938480.0-0.105210997164249420.0-1.84016001224517821.01.08107995986938480.00.00.00.01.08107995986938480.00.00.00.01.2208299636840820.0-0.046043299138545990.0-2.08349990844726561.01.08107995986938480.00.00.00.01.08107995986938480.00.00.00.01.08107995986938480.0-0.141506999731063840.01899999938905239-1.82667005062103271.01.08107995986938480.00.00.00.01.08107995986938480.00.00.00.01.08107995986938480.0-0.14150699973106384-0.01899999938905239-1.82667005062103271.01.08107995986938480.00.00.00.01.08107995986938480.00.00.00.01.08107995986938480.0-0.096935302019119260.0-1.82579004764556881.01.08107995986938480.00.00.00.01.08107995986938480.00.00.00.01.08107995986938480.0-0.117205001413822170.0-1.82045996189117431.01.08107995986938480.00.00.00.01.08107995986938480.00.00.00.01.08107995986938480.0-0.117986001074314120.0-1.81412994861602781.01.08107995986938480.00.00.00.01.08107995986938480.00.00.00.01.08107995986938480.0-0.151476994156837460.01206200011074543-1.8209700584411621.01.08107995986938480.00.00.00.01.08107995986938480.00.00.00.01.08107995986938480.0-0.15147699415683746-0.01206200011074543-1.8209700584411621.01.08107995986938480.00.00.00.01.08107995986938480.00.00.00.01.08107995986938480.0-0.04311259835958481-0.037815701216459274-1.90312004089355471.01.08107995986938480.00.00.00.01.08107995986938480.00.00.00.01.08107995986938480.0-0.043112598359584810.037815701216459274-1.90312004089355471.01.08107995986938480.00.00.00.01.08107995986938480.00.00.00.00.85106402635574340.0-0.016323799267411232-0.017114000394940376-1.51254999637603761.01.08107995986938480.00.00.00.01.08107995986938480.00.00.00.00.85106402635574340.0-0.0163237992674112320.017114000394940376-1.51254999637603761.01.08107995986938480.00.00.00.01.08107995986938480.00.00.00.00.85106402635574340.00.010020599700510502-0.038457199931144714-1.5119899511337281.01.08107995986938480.00.00.00.01.08107995986938480.00.00.00.00.85106402635574340.00.0100205997005105020.038457199931144714-1.5119899511337281.01.08107995986938480.00.00.00.01.08107995986938480.00.00.00.01.08107995986938480.0-0.071405202150344850.0-1.9511599540710451.01.08107995986938480.00.00.00.01.08107995986938480.00.00.00.01.08107995986938480.0-0.102609001100063320.0-1.88242995738983151.01.08107995986938480.00.00.00.01.08107995986938480.00.00.00.01.08107995986938480.0-0.14870999753475190.0-1.86940002441406251.01.08107995986938480.00.00.00.01.08107995986938480.00.00.00.01.08107995986938480.0-0.04311259835958481-0.037815701216459274-1.90312004089355471.01.08107995986938480.00.00.00.01.08107995986938480.00.00.00.01.08107995986938480.0-0.043112598359584810.037815701216459274-1.90312004089355471.01.08107995986938480.00.00.00.01.08107995986938480.00.00.00.01.08107995986938480.0-0.027369100600481033-0.058165401220321655-1.86120998859405521.01.08107995986938480.00.00.00.01.08107995986938480.00.00.00.01.08107995986938480.0-0.0273691006004810330.058165401220321655-1.86120998859405521.01.08107995986938480.00.00.00.01.08107995986938480.00.00.00.01.041350007057190.0-0.121913000941276550.0-1.78188002109527591.08665c374-cb61-d418-d412-7f4ea828e119bind_shape_matrix0.66893059015274050.00.00.00.00.171288996934890750.00.00.00.00.19170999526977540.0-0.406830698251724240.01.12604498863220211.0joint_namesmTail1mPelvismTail2mTail3mTail4mTail6mTail5alt_inverse_bind_matrix1.00.00.00.00.01.00.00.00.00.01.00.0-0.165999993681907650.00.067000001668930051.01.00.00.00.00.01.00.00.00.00.01.00.00.00.01.0670200586318971.01.00.00.00.00.01.00.00.00.00.01.00.0-0.147750005125999450.00.01.01.00.00.00.00.01.00.00.00.00.01.00.0-0.126000002026557920.00.01.01.00.00.00.00.01.00.00.00.00.01.00.0-0.106499999761581420.00.01.01.00.00.00.00.01.00.00.00.00.01.00.0-0.070500001311302190.00.01.01.00.00.00.00.01.00.00.00.00.01.00.0-0.083999998867511750.00.01.0pelvis_offset0.0inverse_bind_matrix1.00.00.00.00.01.00.00.00.00.01.00.00.165999993681907650.0-1.13401997089385991.01.00.00.00.00.01.00.00.00.00.01.00.00.00.0-1.0670200586318971.01.00.00.00.00.01.00.00.00.00.01.00.00.31374999880790710.0-1.13401997089385991.01.00.00.00.00.01.00.00.00.00.01.00.00.439749985933303830.0-1.13401997089385991.01.00.00.00.00.01.00.00.00.00.01.00.00.54624998569488530.0-1.13401997089385991.01.00.00.00.00.01.00.00.00.00.01.00.00.70074999332427980.0-1.13401997089385991.01.00.00.00.00.01.00.00.00.00.01.00.00.63024997711181640.0-1.13401997089385991.0e678576a-dc9f-5187-6ed5-5b4aafb65d7bbind_shape_matrix0.0103429928421974180.00.00.00.00.060677599161863330.00.00.00.00.0129300355911254880.00.111756503582000730.01.68668508529663091.0joint_namesmHeadmNeckmChestmTorsomPelvismFaceJawmFaceRootmFaceLipUpperLeftmFaceTeethUppermFaceLipUpperRightmFaceLipCornerLeftmFaceLipCornerRightmFaceLipLowerCentermFaceTeethLowermFaceChinmFaceLipLowerLeftmFaceLipLowerRightmFaceEyeLidUpperLeftmFaceEyeLidUpperRightmFaceEyebrowInnerLeftmFaceEyebrowInnerRightmFaceEyebrowCenterLeftmFaceEyebrowCenterRightmFaceForeheadCentermFaceNoseBridgemFaceNoseBasemFaceEyeLidLowerLeftmFaceEyeLidLowerRightmFaceCheekUpperLeftmFaceCheekUpperRightmFaceLipUpperCenteralt_inverse_bind_matrix1.08107995986938480.00.00.00.01.08107995986938480.00.00.00.01.08107995986938480.00.00.00.075629897415637971.01.18342995643615720.00.00.00.01.197600007057190.00.00.00.01.00.0-0.009507000446319580.00.251107990741729741.01.010100007057190.00.00.00.01.04166996479034420.00.00.00.01.00.0-0.015367999672889710.00.204877004027366641.01.00.00.00.00.01.00.00.00.00.01.00.00.00.00.084072902798652651.01.00.00.00.00.01.00.00.00.00.01.00.00.00.01.0670200586318971.01.08107995986938480.00.00.00.01.08107995986938480.00.00.00.01.08107995986938480.00.0359875001013278960.0-0.0253947004675865171.01.08107995986938480.00.00.00.01.05708003044128420.00.00.00.01.10618996620178220.00.025000000372529030.00.045000001788139341.01.08107995986938480.00.00.00.01.08107995986938480.00.00.00.01.2208299636840820.0-0.0591681003570556640.00.0048508602194488051.01.08107995986938480.00.00.00.01.08107995986938480.00.00.00.01.08107995986938480.00.107000999152660370.0-0.026074899360537531.01.08107995986938480.00.00.00.01.08107995986938480.00.00.00.01.2208299636840820.0-0.0591681003570556640.00.0048508602194488051.01.08107995986938480.00.00.00.01.08107995986938480.00.00.00.01.08107995986938480.00.03629549965262413-0.01899999938905239-0.0134859997779130941.01.08107995986938480.00.00.00.01.08107995986938480.00.00.00.01.08107995986938480.00.036295499652624130.01899999938905239-0.0134859997779130941.01.08107995986938480.00.00.00.01.08107995986938480.00.00.00.01.08107995986938480.0-0.020269699394702910.00.0053312801755964761.01.08107995986938480.00.00.00.01.08107995986938480.00.00.00.01.08107995986938480.00.083006501197814940.0-0.0203639995306730271.01.08107995986938480.00.00.00.01.08107995986938480.00.00.00.01.08107995986938480.00.083787396550178530.0-0.0266884993761777881.01.08107995986938480.00.00.00.01.08107995986938480.00.00.00.01.08107995986938480.00.03427229821681976-0.012062000110745430.00051081198034808041.01.08107995986938480.00.00.00.01.08107995986938480.00.00.00.01.08107995986938480.00.034272298216819760.012062000110745430.00051081198034808041.01.08107995986938480.00.00.00.01.08107995986938480.00.00.00.01.08107995986938480.00.044901698827743530.0369763001799583440.0383545011281967161.01.08107995986938480.00.00.00.01.08107995986938480.00.00.00.01.08107995986938480.00.04490169882774353-0.0369763001799583440.0383545011281967161.01.08107995986938480.00.00.00.01.08107995986938480.00.00.00.00.85106402635574340.00.0181128997355699540.0167341008782386780.0570053011178970341.01.08107995986938480.00.00.00.01.08107995986938480.00.00.00.00.85106402635574340.00.018112899735569954-0.0167341008782386780.0570053011178970341.01.08107995986938480.00.00.00.01.08107995986938480.00.00.00.00.85106402635574340.0-0.0082314396277070050.037603501230478290.0562760010361671451.01.08107995986938480.00.00.00.01.08107995986938480.00.00.00.00.85106402635574340.0-0.008231439627707005-0.037603501230478290.0562760010361671451.01.08107995986938480.00.00.00.01.08107995986938480.00.00.00.01.08107995986938480.00.073194302618503570.00.087503999471664431.01.08107995986938480.00.00.00.01.08107995986938480.00.00.00.01.08107995986938480.00.104399003088474270.00.0171787999570369721.01.08107995986938480.00.00.00.01.08107995986938480.00.00.00.01.08107995986938480.00.150499001145362850.00.0038539199158549311.01.08107995986938480.00.00.00.01.08107995986938480.00.00.00.01.08107995986938480.00.044901698827743530.0369763001799583440.0383545011281967161.01.08107995986938480.00.00.00.01.08107995986938480.00.00.00.01.08107995986938480.00.04490169882774353-0.0369763001799583440.0383545011281967161.01.08107995986938480.00.00.00.01.08107995986938480.00.00.00.01.08107995986938480.00.0291581992059946060.05687420070171356-0.00453078979626297951.01.08107995986938480.00.00.00.01.08107995986938480.00.00.00.01.08107995986938480.00.029158199205994606-0.05687420070171356-0.00453078979626297951.01.08107995986938480.00.00.00.01.08107995986938480.00.00.00.01.041350007057190.00.0167011991143226620.00.0097117396071553231.0pelvis_offset0.0inverse_bind_matrix1.08107995986938480.00.00.00.01.08107995986938480.00.00.00.01.08107995986938480.00.0267891008406877520.0-1.81913995742797851.01.18342995643615720.00.00.00.01.197600007057190.00.00.00.01.00.00.0293253995478153230.0-1.6070699691772461.01.010100007057190.00.00.00.01.04166996479034420.00.00.00.01.00.00.0155231999233365060.0-1.35596001148223881.01.00.00.00.00.01.00.00.00.00.01.00.00.00.0-1.15109002590179441.01.00.00.00.00.01.00.00.00.00.01.00.00.00.0-1.06701004505157471.01.08107995986938480.00.00.00.01.08107995986938480.00.00.00.01.08107995986938480.0-0.0341983996331691740.0-1.84081995487213131.01.08107995986938480.00.00.00.01.05708003044128420.00.00.00.01.10618996620178220.00.00178911001421511170.0-1.90898001194000241.01.08107995986938480.00.00.00.01.08107995986938480.00.00.00.01.2208299636840820.0-0.046043299138545990.0-2.08349990844726561.01.08107995986938480.00.00.00.01.08107995986938480.00.00.00.01.08107995986938480.0-0.105210997164249420.0-1.84016001224517821.01.08107995986938480.00.00.00.01.08107995986938480.00.00.00.01.2208299636840820.0-0.046043299138545990.0-2.08349990844726561.01.08107995986938480.00.00.00.01.08107995986938480.00.00.00.01.08107995986938480.0-0.141506999731063840.01899999938905239-1.82667005062103271.01.08107995986938480.00.00.00.01.08107995986938480.00.00.00.01.08107995986938480.0-0.14150699973106384-0.01899999938905239-1.82667005062103271.01.08107995986938480.00.00.00.01.08107995986938480.00.00.00.01.08107995986938480.0-0.096935302019119260.0-1.82579004764556881.01.08107995986938480.00.00.00.01.08107995986938480.00.00.00.01.08107995986938480.0-0.117205001413822170.0-1.82045996189117431.01.08107995986938480.00.00.00.01.08107995986938480.00.00.00.01.08107995986938480.0-0.117986001074314120.0-1.81412994861602781.01.08107995986938480.00.00.00.01.08107995986938480.00.00.00.01.08107995986938480.0-0.151476994156837460.01206200011074543-1.8209700584411621.01.08107995986938480.00.00.00.01.08107995986938480.00.00.00.01.08107995986938480.0-0.15147699415683746-0.01206200011074543-1.8209700584411621.01.08107995986938480.00.00.00.01.08107995986938480.00.00.00.01.08107995986938480.0-0.04311259835958481-0.037815701216459274-1.90312004089355471.01.08107995986938480.00.00.00.01.08107995986938480.00.00.00.01.08107995986938480.0-0.043112598359584810.037815701216459274-1.90312004089355471.01.08107995986938480.00.00.00.01.08107995986938480.00.00.00.00.85106402635574340.0-0.016323799267411232-0.017114000394940376-1.51254999637603761.01.08107995986938480.00.00.00.01.08107995986938480.00.00.00.00.85106402635574340.0-0.0163237992674112320.017114000394940376-1.51254999637603761.01.08107995986938480.00.00.00.01.08107995986938480.00.00.00.00.85106402635574340.00.010020599700510502-0.038457199931144714-1.5119899511337281.01.08107995986938480.00.00.00.01.08107995986938480.00.00.00.00.85106402635574340.00.0100205997005105020.038457199931144714-1.5119899511337281.01.08107995986938480.00.00.00.01.08107995986938480.00.00.00.01.08107995986938480.0-0.071405202150344850.0-1.9511599540710451.01.08107995986938480.00.00.00.01.08107995986938480.00.00.00.01.08107995986938480.0-0.102609001100063320.0-1.88242995738983151.01.08107995986938480.00.00.00.01.08107995986938480.00.00.00.01.08107995986938480.0-0.14870999753475190.0-1.86940002441406251.01.08107995986938480.00.00.00.01.08107995986938480.00.00.00.01.08107995986938480.0-0.04311259835958481-0.037815701216459274-1.90312004089355471.01.08107995986938480.00.00.00.01.08107995986938480.00.00.00.01.08107995986938480.0-0.043112598359584810.037815701216459274-1.90312004089355471.01.08107995986938480.00.00.00.01.08107995986938480.00.00.00.01.08107995986938480.0-0.027369100600481033-0.058165401220321655-1.86120998859405521.01.08107995986938480.00.00.00.01.08107995986938480.00.00.00.01.08107995986938480.0-0.0273691006004810330.058165401220321655-1.86120998859405521.01.08107995986938480.00.00.00.01.08107995986938480.00.00.00.01.041350007057190.0-0.121913000941276550.0-1.78188002109527591.08d23b8c8-fadf-c1b3-0b04-a3ecea292576bind_shape_matrix0.129504993557930.00.00.00.00.097699806094169620.00.00.00.00.138080000877380370.00.0219117980450391770.0570470988750457761.83544993400573731.0joint_namesmHeadmNeckmChestmTorsomPelvismFaceEar2RightmFaceEar1RightmFaceRootmFaceEar1LeftmFaceEar2Leftalt_inverse_bind_matrix1.08107995986938480.00.00.00.01.08107995986938480.00.00.00.01.08107995986938480.00.00.00.075629897415637971.01.18342995643615720.00.00.00.01.197600007057190.00.00.00.01.00.0-0.009507000446319580.00.251107990741729741.01.010100007057190.00.00.00.01.04166996479034420.00.00.00.01.00.0-0.015367999672889710.00.204877004027366641.01.00.00.00.00.01.00.00.00.00.01.00.00.00.00.084072902798652651.01.00.00.00.00.01.00.00.00.00.01.00.00.00.01.0670200586318971.01.00.00.00.00.01.00.00.00.00.01.00.00.0142705999314785-0.0175573993474245070.056489199399948121.01.00.00.00.00.01.00.00.00.00.01.00.00.0041375597938895226-0.047394301742315290.089543297886848451.01.08107995986938480.00.00.00.01.05708003044128420.00.00.00.01.10618996620178220.00.025000000372529030.00.045000001788139341.01.00.00.00.00.01.00.00.00.00.01.00.00.00413755979388952260.047394301742315290.089543297886848451.01.00.00.00.00.01.00.00.00.00.01.00.00.01427059993147850.0175573993474245070.056489199399948121.0pelvis_offset0.0inverse_bind_matrix1.08107995986938480.00.00.00.01.08107995986938480.00.00.00.01.08107995986938480.00.0267891008406877520.0-1.81913995742797851.01.18342995643615720.00.00.00.01.197600007057190.00.00.00.01.00.00.0293253995478153230.0-1.6070699691772461.01.010100007057190.00.00.00.01.04166996479034420.00.00.00.01.00.00.0155231999233365060.0-1.35596001148223881.01.00.00.00.00.01.00.00.00.00.01.00.00.00.0-1.15109002590179441.01.00.00.00.00.01.00.00.00.00.01.00.00.00.0-1.06701004505157471.01.00.00.00.00.01.00.00.00.00.01.00.0-0.0164429005235433580.062392398715019226-1.86315000057220461.01.00.00.00.00.01.00.00.00.00.01.00.0-0.00217230990529060360.04483500123023987-1.80666005611419681.01.08107995986938480.00.00.00.01.05708003044128420.00.00.00.01.10618996620178220.00.00178911001421511170.0-1.90898001194000241.01.00.00.00.00.01.00.00.00.00.01.00.0-0.0021723099052906036-0.04483500123023987-1.80666005611419681.01.00.00.00.00.01.00.00.00.00.01.00.0-0.016442900523543358-0.062392398715019226-1.86315000057220461.02a30e7ec-9840-f495-daa1-2b8d0d025a78bind_shape_matrix0.064477898180484770.00.00.00.00.069889500737190250.00.00.00.00.105170004069805150.00.0064538493752479550.078819252550601961.84524500370025631.0joint_namesmHeadmNeckmChestmTorsomPelvismFaceEar2RightmFaceEar1RightmFaceRootmFaceEar1LeftmFaceEar2Leftalt_inverse_bind_matrix1.08107995986938480.00.00.00.01.08107995986938480.00.00.00.01.08107995986938480.00.00.00.075629897415637971.01.18342995643615720.00.00.00.01.197600007057190.00.00.00.01.00.0-0.009507000446319580.00.251107990741729741.01.010100007057190.00.00.00.01.04166996479034420.00.00.00.01.00.0-0.015367999672889710.00.204877004027366641.01.00.00.00.00.01.00.00.00.00.01.00.00.00.00.084072902798652651.01.00.00.00.00.01.00.00.00.00.01.00.00.00.01.0670200586318971.01.00.00.00.00.01.00.00.00.00.01.00.00.0142705999314785-0.0175573993474245070.056489199399948121.01.00.00.00.00.01.00.00.00.00.01.00.00.0041375597938895226-0.047394301742315290.089543297886848451.01.08107995986938480.00.00.00.01.05708003044128420.00.00.00.01.10618996620178220.00.025000000372529030.00.045000001788139341.01.00.00.00.00.01.00.00.00.00.01.00.00.00413755979388952260.047394301742315290.089543297886848451.01.00.00.00.00.01.00.00.00.00.01.00.00.01427059993147850.0175573993474245070.056489199399948121.0pelvis_offset0.0inverse_bind_matrix1.08107995986938480.00.00.00.01.08107995986938480.00.00.00.01.08107995986938480.00.0267891008406877520.0-1.81913995742797851.01.18342995643615720.00.00.00.01.197600007057190.00.00.00.01.00.00.0293253995478153230.0-1.6070699691772461.01.010100007057190.00.00.00.01.04166996479034420.00.00.00.01.00.00.0155231999233365060.0-1.35596001148223881.01.00.00.00.00.01.00.00.00.00.01.00.00.00.0-1.15109002590179441.01.00.00.00.00.01.00.00.00.00.01.00.00.00.0-1.06701004505157471.01.00.00.00.00.01.00.00.00.00.01.00.0-0.0164429005235433580.062392398715019226-1.86315000057220461.01.00.00.00.00.01.00.00.00.00.01.00.0-0.00217230990529060360.04483500123023987-1.80666005611419681.01.08107995986938480.00.00.00.01.05708003044128420.00.00.00.01.10618996620178220.00.00178911001421511170.0-1.90898001194000241.01.00.00.00.00.01.00.00.00.00.01.00.0-0.0021723099052906036-0.04483500123023987-1.80666005611419681.01.00.00.00.00.01.00.00.00.00.01.00.0-0.016442900523543358-0.062392398715019226-1.86315000057220461.03bd8d73d-be6f-8de2-39ae-1f680189bc27bind_shape_matrix0.064477898180484770.00.00.00.00.069889500737190250.00.00.00.00.105170004069805150.00.006453849375247955-0.078819252550601961.84524500370025631.0joint_namesmHeadmNeckmChestmTorsomPelvismFaceEar2RightmFaceEar1RightmFaceRootmFaceEar1LeftmFaceEar2Leftalt_inverse_bind_matrix1.08107995986938480.00.00.00.01.08107995986938480.00.00.00.01.08107995986938480.00.00.00.075629897415637971.01.18342995643615720.00.00.00.01.197600007057190.00.00.00.01.00.0-0.009507000446319580.00.251107990741729741.01.010100007057190.00.00.00.01.04166996479034420.00.00.00.01.00.0-0.015367999672889710.00.204877004027366641.01.00.00.00.00.01.00.00.00.00.01.00.00.00.00.084072902798652651.01.00.00.00.00.01.00.00.00.00.01.00.00.00.01.0670200586318971.01.00.00.00.00.01.00.00.00.00.01.00.00.0142705999314785-0.0175573993474245070.056489199399948121.01.00.00.00.00.01.00.00.00.00.01.00.00.0041375597938895226-0.047394301742315290.089543297886848451.01.08107995986938480.00.00.00.01.05708003044128420.00.00.00.01.10618996620178220.00.025000000372529030.00.045000001788139341.01.00.00.00.00.01.00.00.00.00.01.00.00.00413755979388952260.047394301742315290.089543297886848451.01.00.00.00.00.01.00.00.00.00.01.00.00.01427059993147850.0175573993474245070.056489199399948121.0pelvis_offset0.0inverse_bind_matrix1.08107995986938480.00.00.00.01.08107995986938480.00.00.00.01.08107995986938480.00.0267891008406877520.0-1.81913995742797851.01.18342995643615720.00.00.00.01.197600007057190.00.00.00.01.00.00.0293253995478153230.0-1.6070699691772461.01.010100007057190.00.00.00.01.04166996479034420.00.00.00.01.00.00.0155231999233365060.0-1.35596001148223881.01.00.00.00.00.01.00.00.00.00.01.00.00.00.0-1.15109002590179441.01.00.00.00.00.01.00.00.00.00.01.00.00.00.0-1.06701004505157471.01.00.00.00.00.01.00.00.00.00.01.00.0-0.0164429005235433580.062392398715019226-1.86315000057220461.01.00.00.00.00.01.00.00.00.00.01.00.0-0.00217230990529060360.04483500123023987-1.80666005611419681.01.08107995986938480.00.00.00.01.05708003044128420.00.00.00.01.10618996620178220.00.00178911001421511170.0-1.90898001194000241.01.00.00.00.00.01.00.00.00.00.01.00.0-0.0021723099052906036-0.04483500123023987-1.80666005611419681.01.00.00.00.00.01.00.00.00.00.01.00.0-0.016442900523543358-0.062392398715019226-1.86315000057220461.034db2e33-e79f-ea57-14af-c1ce9cbc63ffbind_shape_matrix0.037142097949981690.00.00.00.00.146102800965309140.00.00.00.00.032979965209960940.00.079298749566078190.01.75784003734588621.0joint_namesmHeadmNeckmChestmTorsomPelvismFaceJawmFaceRootmFaceLipUpperLeftmFaceTeethUppermFaceLipUpperRightmFaceLipCornerLeftmFaceLipCornerRightmFaceLipLowerCentermFaceTeethLowermFaceChinmFaceLipLowerLeftmFaceLipLowerRightmFaceEyeLidUpperLeftmFaceEyeLidUpperRightmFaceEyebrowInnerLeftmFaceEyebrowInnerRightmFaceEyebrowCenterLeftmFaceEyebrowCenterRightmFaceForeheadCentermFaceNoseBridgemFaceNoseBasemFaceEyeLidLowerLeftmFaceEyeLidLowerRightmFaceCheekUpperLeftmFaceCheekUpperRightmFaceLipUpperCenteralt_inverse_bind_matrix1.08107995986938480.00.00.00.01.08107995986938480.00.00.00.01.08107995986938480.00.00.00.075629897415637971.01.18342995643615720.00.00.00.01.197600007057190.00.00.00.01.00.0-0.009507000446319580.00.251107990741729741.01.010100007057190.00.00.00.01.04166996479034420.00.00.00.01.00.0-0.015367999672889710.00.204877004027366641.01.00.00.00.00.01.00.00.00.00.01.00.00.00.00.084072902798652651.01.00.00.00.00.01.00.00.00.00.01.00.00.00.01.0670200586318971.01.08107995986938480.00.00.00.01.08107995986938480.00.00.00.01.08107995986938480.00.0359875001013278960.0-0.0253947004675865171.01.08107995986938480.00.00.00.01.05708003044128420.00.00.00.01.10618996620178220.00.025000000372529030.00.045000001788139341.01.08107995986938480.00.00.00.01.08107995986938480.00.00.00.01.2208299636840820.0-0.0591681003570556640.00.0048508602194488051.01.08107995986938480.00.00.00.01.08107995986938480.00.00.00.01.08107995986938480.00.107000999152660370.0-0.026074899360537531.01.08107995986938480.00.00.00.01.08107995986938480.00.00.00.01.2208299636840820.0-0.0591681003570556640.00.0048508602194488051.01.08107995986938480.00.00.00.01.08107995986938480.00.00.00.01.08107995986938480.00.03629549965262413-0.01899999938905239-0.0134859997779130941.01.08107995986938480.00.00.00.01.08107995986938480.00.00.00.01.08107995986938480.00.036295499652624130.01899999938905239-0.0134859997779130941.01.08107995986938480.00.00.00.01.08107995986938480.00.00.00.01.08107995986938480.0-0.020269699394702910.00.0053312801755964761.01.08107995986938480.00.00.00.01.08107995986938480.00.00.00.01.08107995986938480.00.083006501197814940.0-0.0203639995306730271.01.08107995986938480.00.00.00.01.08107995986938480.00.00.00.01.08107995986938480.00.083787396550178530.0-0.0266884993761777881.01.08107995986938480.00.00.00.01.08107995986938480.00.00.00.01.08107995986938480.00.03427229821681976-0.012062000110745430.00051081198034808041.01.08107995986938480.00.00.00.01.08107995986938480.00.00.00.01.08107995986938480.00.034272298216819760.012062000110745430.00051081198034808041.01.08107995986938480.00.00.00.01.08107995986938480.00.00.00.01.08107995986938480.00.044901698827743530.0369763001799583440.0383545011281967161.01.08107995986938480.00.00.00.01.08107995986938480.00.00.00.01.08107995986938480.00.04490169882774353-0.0369763001799583440.0383545011281967161.01.08107995986938480.00.00.00.01.08107995986938480.00.00.00.00.85106402635574340.00.0181128997355699540.0167341008782386780.0570053011178970341.01.08107995986938480.00.00.00.01.08107995986938480.00.00.00.00.85106402635574340.00.018112899735569954-0.0167341008782386780.0570053011178970341.01.08107995986938480.00.00.00.01.08107995986938480.00.00.00.00.85106402635574340.0-0.0082314396277070050.037603501230478290.0562760010361671451.01.08107995986938480.00.00.00.01.08107995986938480.00.00.00.00.85106402635574340.0-0.008231439627707005-0.037603501230478290.0562760010361671451.01.08107995986938480.00.00.00.01.08107995986938480.00.00.00.01.08107995986938480.00.073194302618503570.00.087503999471664431.01.08107995986938480.00.00.00.01.08107995986938480.00.00.00.01.08107995986938480.00.104399003088474270.00.0171787999570369721.01.08107995986938480.00.00.00.01.08107995986938480.00.00.00.01.08107995986938480.00.150499001145362850.00.0038539199158549311.01.08107995986938480.00.00.00.01.08107995986938480.00.00.00.01.08107995986938480.00.044901698827743530.0369763001799583440.0383545011281967161.01.08107995986938480.00.00.00.01.08107995986938480.00.00.00.01.08107995986938480.00.04490169882774353-0.0369763001799583440.0383545011281967161.01.08107995986938480.00.00.00.01.08107995986938480.00.00.00.01.08107995986938480.00.0291581992059946060.05687420070171356-0.00453078979626297951.01.08107995986938480.00.00.00.01.08107995986938480.00.00.00.01.08107995986938480.00.029158199205994606-0.05687420070171356-0.00453078979626297951.01.08107995986938480.00.00.00.01.08107995986938480.00.00.00.01.041350007057190.00.0167011991143226620.00.0097117396071553231.0pelvis_offset0.0inverse_bind_matrix1.08107995986938480.00.00.00.01.08107995986938480.00.00.00.01.08107995986938480.00.0267891008406877520.0-1.81913995742797851.01.18342995643615720.00.00.00.01.197600007057190.00.00.00.01.00.00.0293253995478153230.0-1.6070699691772461.01.010100007057190.00.00.00.01.04166996479034420.00.00.00.01.00.00.0155231999233365060.0-1.35596001148223881.01.00.00.00.00.01.00.00.00.00.01.00.00.00.0-1.15109002590179441.01.00.00.00.00.01.00.00.00.00.01.00.00.00.0-1.06701004505157471.01.08107995986938480.00.00.00.01.08107995986938480.00.00.00.01.08107995986938480.0-0.0341983996331691740.0-1.84081995487213131.01.08107995986938480.00.00.00.01.05708003044128420.00.00.00.01.10618996620178220.00.00178911001421511170.0-1.90898001194000241.01.08107995986938480.00.00.00.01.08107995986938480.00.00.00.01.2208299636840820.0-0.046043299138545990.0-2.08349990844726561.01.08107995986938480.00.00.00.01.08107995986938480.00.00.00.01.08107995986938480.0-0.105210997164249420.0-1.84016001224517821.01.08107995986938480.00.00.00.01.08107995986938480.00.00.00.01.2208299636840820.0-0.046043299138545990.0-2.08349990844726561.01.08107995986938480.00.00.00.01.08107995986938480.00.00.00.01.08107995986938480.0-0.141506999731063840.01899999938905239-1.82667005062103271.01.08107995986938480.00.00.00.01.08107995986938480.00.00.00.01.08107995986938480.0-0.14150699973106384-0.01899999938905239-1.82667005062103271.01.08107995986938480.00.00.00.01.08107995986938480.00.00.00.01.08107995986938480.0-0.096935302019119260.0-1.82579004764556881.01.08107995986938480.00.00.00.01.08107995986938480.00.00.00.01.08107995986938480.0-0.117205001413822170.0-1.82045996189117431.01.08107995986938480.00.00.00.01.08107995986938480.00.00.00.01.08107995986938480.0-0.117986001074314120.0-1.81412994861602781.01.08107995986938480.00.00.00.01.08107995986938480.00.00.00.01.08107995986938480.0-0.151476994156837460.01206200011074543-1.8209700584411621.01.08107995986938480.00.00.00.01.08107995986938480.00.00.00.01.08107995986938480.0-0.15147699415683746-0.01206200011074543-1.8209700584411621.01.08107995986938480.00.00.00.01.08107995986938480.00.00.00.01.08107995986938480.0-0.04311259835958481-0.037815701216459274-1.90312004089355471.01.08107995986938480.00.00.00.01.08107995986938480.00.00.00.01.08107995986938480.0-0.043112598359584810.037815701216459274-1.90312004089355471.01.08107995986938480.00.00.00.01.08107995986938480.00.00.00.00.85106402635574340.0-0.016323799267411232-0.017114000394940376-1.51254999637603761.01.08107995986938480.00.00.00.01.08107995986938480.00.00.00.00.85106402635574340.0-0.0163237992674112320.017114000394940376-1.51254999637603761.01.08107995986938480.00.00.00.01.08107995986938480.00.00.00.00.85106402635574340.00.010020599700510502-0.038457199931144714-1.5119899511337281.01.08107995986938480.00.00.00.01.08107995986938480.00.00.00.00.85106402635574340.00.0100205997005105020.038457199931144714-1.5119899511337281.01.08107995986938480.00.00.00.01.08107995986938480.00.00.00.01.08107995986938480.0-0.071405202150344850.0-1.9511599540710451.01.08107995986938480.00.00.00.01.08107995986938480.00.00.00.01.08107995986938480.0-0.102609001100063320.0-1.88242995738983151.01.08107995986938480.00.00.00.01.08107995986938480.00.00.00.01.08107995986938480.0-0.14870999753475190.0-1.86940002441406251.01.08107995986938480.00.00.00.01.08107995986938480.00.00.00.01.08107995986938480.0-0.04311259835958481-0.037815701216459274-1.90312004089355471.01.08107995986938480.00.00.00.01.08107995986938480.00.00.00.01.08107995986938480.0-0.043112598359584810.037815701216459274-1.90312004089355471.01.08107995986938480.00.00.00.01.08107995986938480.00.00.00.01.08107995986938480.0-0.027369100600481033-0.058165401220321655-1.86120998859405521.01.08107995986938480.00.00.00.01.08107995986938480.00.00.00.01.08107995986938480.0-0.0273691006004810330.058165401220321655-1.86120998859405521.01.08107995986938480.00.00.00.01.08107995986938480.00.00.00.01.041350007057190.0-0.121913000941276550.0-1.78188002109527591.0 \ No newline at end of file diff --git a/indra/llappearanceutility/tests/joint-offsets.xml.output b/indra/llappearanceutility/tests/joint-offsets.xml.output new file mode 100644 index 00000000000..d0f94b8f111 --- /dev/null +++ b/indra/llappearanceutility/tests/joint-offsets.xml.output @@ -0,0 +1 @@ +skindata05bf604d-d1c0-352b-cb2f-c37caca6f542joint_namesmFaceJawmFaceRootmHeadmNeckmChestmTorsomPelvisjoint_offset0.035987500101327896118164060-0.025394700467586517333984380.0250000003725290298461914100.04500000178813934326171875000.07562989741563796997070312-0.00950700044631958007812500.251107990741729736328125-0.0153679996728897094726562500.2048770040273666381835938000.08407290279865264892578125001.06702005863189697265625pelvis_offset015659a9a-f1c1-3e38-8343-2e23e9f65d20joint_namesmHeadmNeckmChestmTorsomPelvismFaceEar2RightmFaceEar1RightmFaceRootmFaceEar1LeftmFaceEar2Leftjoint_offset000.07562989741563796997070312-0.00950700044631958007812500.251107990741729736328125-0.0153679996728897094726562500.2048770040273666381835938000.08407290279865264892578125001.067020058631896972656250.01427059993147850036621094-0.017557399347424507141113280.05648919939994812011718750.004137559793889522552490234-0.047394301742315292358398440.089543297886848449707031250.0250000003725290298461914100.045000001788139343261718750.0041375597938895225524902340.047394301742315292358398440.089543297886848449707031250.014270599931478500366210940.017557399347424507141113280.0564891993999481201171875pelvis_offset01d5936bc-0501-7376-f70c-06dcfac920edjoint_namesmEyeLeftmHeadmNeckmChestmTorsomPelvismEyeRightjoint_offset0.090427502989768981933593750.037174601107835769653320310.0805628001689910888671875000.07562989741563796997070312-0.00950700044631958007812500.251107990741729736328125-0.0153679996728897094726562500.2048770040273666381835938000.08407290279865264892578125001.067020058631896972656250.09042750298976898193359375-0.037174601107835769653320310.0805628001689910888671875pelvis_offset02a30e7ec-9840-f495-daa1-2b8d0d025a78joint_namesmHeadmNeckmChestmTorsomPelvismFaceEar2RightmFaceEar1RightmFaceRootmFaceEar1LeftmFaceEar2Leftjoint_offset000.07562989741563796997070312-0.00950700044631958007812500.251107990741729736328125-0.0153679996728897094726562500.2048770040273666381835938000.08407290279865264892578125001.067020058631896972656250.01427059993147850036621094-0.017557399347424507141113280.05648919939994812011718750.004137559793889522552490234-0.047394301742315292358398440.089543297886848449707031250.0250000003725290298461914100.045000001788139343261718750.0041375597938895225524902340.047394301742315292358398440.089543297886848449707031250.014270599931478500366210940.017557399347424507141113280.0564891993999481201171875pelvis_offset034db2e33-e79f-ea57-14af-c1ce9cbc63ffjoint_namesmHeadmNeckmChestmTorsomPelvismFaceJawmFaceRootmFaceLipUpperLeftmFaceTeethUppermFaceLipUpperRightmFaceLipCornerLeftmFaceLipCornerRightmFaceLipLowerCentermFaceTeethLowermFaceChinmFaceLipLowerLeftmFaceLipLowerRightmFaceEyeLidUpperLeftmFaceEyeLidUpperRightmFaceEyebrowInnerLeftmFaceEyebrowInnerRightmFaceEyebrowCenterLeftmFaceEyebrowCenterRightmFaceForeheadCentermFaceNoseBridgemFaceNoseBasemFaceEyeLidLowerLeftmFaceEyeLidLowerRightmFaceCheekUpperLeftmFaceCheekUpperRightmFaceLipUpperCenterjoint_offset000.07562989741563796997070312-0.00950700044631958007812500.251107990741729736328125-0.0153679996728897094726562500.2048770040273666381835938000.08407290279865264892578125001.067020058631896972656250.035987500101327896118164060-0.025394700467586517333984380.0250000003725290298461914100.04500000178813934326171875-0.059168100357055664062500.004850860219448804855346680.10700099915266036987304690-0.02607489936053752899169922-0.059168100357055664062500.004850860219448804855346680.03629549965262413024902344-0.01899999938905239105224609-0.013485999777913093566894530.036295499652624130249023440.01899999938905239105224609-0.01348599977791309356689453-0.0202696993947029113769531200.0053312801755964756011962890.083006501197814941406250-0.020363999530673027038574220.083787396550178527832031250-0.026688499376177787780761720.03427229821681976318359375-0.012062000110745429992675780.00051081198034808039665222170.034272298216819763183593750.012062000110745429992675780.00051081198034808039665222170.04490169882774353027343750.036976300179958343505859380.038354501128196716308593750.0449016988277435302734375-0.036976300179958343505859380.038354501128196716308593750.018112899735569953918457030.016734100878238677978515620.057005301117897033691406250.01811289973556995391845703-0.016734100878238677978515620.05700530111789703369140625-0.0082314396277070045471191410.037603501230478286743164060.05627600103616714477539062-0.008231439627707004547119141-0.037603501230478286743164060.056276001036167144775390620.0731943026185035705566406200.08750399947166442871093750.104399003088474273681640600.017178799957036972045898440.150499001145362854003906200.0038539199158549308776855470.04490169882774353027343750.036976300179958343505859380.038354501128196716308593750.0449016988277435302734375-0.036976300179958343505859380.038354501128196716308593750.029158199205994606018066410.05687420070171356201171875-0.0045307897962629795074462890.02915819920599460601806641-0.05687420070171356201171875-0.0045307897962629795074462890.0167011991143226623535156200.009711739607155323028564453pelvis_offset03bd8d73d-be6f-8de2-39ae-1f680189bc27joint_namesmHeadmNeckmChestmTorsomPelvismFaceEar2RightmFaceEar1RightmFaceRootmFaceEar1LeftmFaceEar2Leftjoint_offset000.07562989741563796997070312-0.00950700044631958007812500.251107990741729736328125-0.0153679996728897094726562500.2048770040273666381835938000.08407290279865264892578125001.067020058631896972656250.01427059993147850036621094-0.017557399347424507141113280.05648919939994812011718750.004137559793889522552490234-0.047394301742315292358398440.089543297886848449707031250.0250000003725290298461914100.045000001788139343261718750.0041375597938895225524902340.047394301742315292358398440.089543297886848449707031250.014270599931478500366210940.017557399347424507141113280.0564891993999481201171875pelvis_offset046ee8fb2-15f0-fa2e-d260-e7e6e8295445joint_namesmFaceJawmFaceRootmHeadmNeckmChestmTorsomPelvisjoint_offset0.035987500101327896118164060-0.025394700467586517333984380.0250000003725290298461914100.04500000178813934326171875000.07562989741563796997070312-0.00950700044631958007812500.251107990741729736328125-0.0153679996728897094726562500.2048770040273666381835938000.08407290279865264892578125001.06702005863189697265625pelvis_offset0547d8392-9f19-35fb-3508-121eea388f0ajoint_namesmFaceJawmFaceRootmHeadmNeckmChestmTorsomPelvismFaceTongueBasemFaceTeethLowermFaceTongueTipjoint_offset0.035987500101327896118164060-0.025394700467586517333984380.0250000003725290298461914100.04500000178813934326171875000.07562989741563796997070312-0.00950700044631958007812500.251107990741729736328125-0.0153679996728897094726562500.2048770040273666381835938000.08407290279865264892578125001.06702005863189697265625-0.0298503991216421127319335900.0078316899016499519348144530.083006501197814941406250-0.020363999530673027038574220.03891620039939880371093750-0.002775429980829358100891113pelvis_offset07e7a6834-8b41-4029-8f87-ce57b7d05beejoint_namesmHeadmNeckmChestmTorsomPelvismFaceJawmFaceRootmFaceLipUpperLeftmFaceTeethUppermFaceLipUpperRightmFaceLipCornerLeftmFaceLipCornerRightmFaceLipLowerCentermFaceTeethLowermFaceChinmFaceLipLowerLeftmFaceLipLowerRightmFaceEyeLidUpperLeftmFaceEyeLidUpperRightmFaceEyebrowInnerLeftmFaceEyebrowInnerRightmFaceEyebrowCenterLeftmFaceEyebrowCenterRightmFaceForeheadCentermFaceNoseBridgemFaceNoseBasemFaceEyeLidLowerLeftmFaceEyeLidLowerRightmFaceCheekUpperLeftmFaceCheekUpperRightmFaceLipUpperCenterjoint_offset000.07562989741563796997070312-0.00950700044631958007812500.251107990741729736328125-0.0153679996728897094726562500.2048770040273666381835938000.08407290279865264892578125001.067020058631896972656250.035987500101327896118164060-0.025394700467586517333984380.0250000003725290298461914100.04500000178813934326171875-0.059168100357055664062500.004850860219448804855346680.10700099915266036987304690-0.02607489936053752899169922-0.059168100357055664062500.004850860219448804855346680.03629549965262413024902344-0.01899999938905239105224609-0.013485999777913093566894530.036295499652624130249023440.01899999938905239105224609-0.01348599977791309356689453-0.0202696993947029113769531200.0053312801755964756011962890.083006501197814941406250-0.020363999530673027038574220.083787396550178527832031250-0.026688499376177787780761720.03427229821681976318359375-0.012062000110745429992675780.00051081198034808039665222170.034272298216819763183593750.012062000110745429992675780.00051081198034808039665222170.04490169882774353027343750.036976300179958343505859380.038354501128196716308593750.0449016988277435302734375-0.036976300179958343505859380.038354501128196716308593750.018112899735569953918457030.016734100878238677978515620.057005301117897033691406250.01811289973556995391845703-0.016734100878238677978515620.05700530111789703369140625-0.0082314396277070045471191410.037603501230478286743164060.05627600103616714477539062-0.008231439627707004547119141-0.037603501230478286743164060.056276001036167144775390620.0731943026185035705566406200.08750399947166442871093750.104399003088474273681640600.017178799957036972045898440.150499001145362854003906200.0038539199158549308776855470.04490169882774353027343750.036976300179958343505859380.038354501128196716308593750.0449016988277435302734375-0.036976300179958343505859380.038354501128196716308593750.029158199205994606018066410.05687420070171356201171875-0.0045307897962629795074462890.02915819920599460601806641-0.05687420070171356201171875-0.0045307897962629795074462890.0167011991143226623535156200.009711739607155323028564453pelvis_offset08665c374-cb61-d418-d412-7f4ea828e119joint_namesmTail1mPelvismTail2mTail3mTail4mTail6mTail5joint_offset-0.165999993681907653808593800.0670000016689300537109375001.06702005863189697265625-0.147750005125999450683593800-0.126000002026557922363281200-0.106499999761581420898437500-0.0705000013113021850585937500-0.0839999988675117492675781200pelvis_offset08d23b8c8-fadf-c1b3-0b04-a3ecea292576joint_namesmHeadmNeckmChestmTorsomPelvismFaceEar2RightmFaceEar1RightmFaceRootmFaceEar1LeftmFaceEar2Leftjoint_offset000.07562989741563796997070312-0.00950700044631958007812500.251107990741729736328125-0.0153679996728897094726562500.2048770040273666381835938000.08407290279865264892578125001.067020058631896972656250.01427059993147850036621094-0.017557399347424507141113280.05648919939994812011718750.004137559793889522552490234-0.047394301742315292358398440.089543297886848449707031250.0250000003725290298461914100.045000001788139343261718750.0041375597938895225524902340.047394301742315292358398440.089543297886848449707031250.014270599931478500366210940.017557399347424507141113280.0564891993999481201171875pelvis_offset09174c7f1-bd5f-68d2-2f4f-cc9b36312067joint_namesmHeadmNeckmChestmTorsomPelvismFaceJawmFaceRootmFaceLipUpperLeftmFaceTeethUppermFaceLipUpperRightmFaceLipCornerLeftmFaceLipCornerRightmFaceLipLowerCentermFaceTeethLowermFaceChinmFaceLipLowerLeftmFaceLipLowerRightmFaceEyeLidUpperLeftmFaceEyeLidUpperRightmFaceEyebrowInnerLeftmFaceEyebrowInnerRightmFaceEyebrowCenterLeftmFaceEyebrowCenterRightmFaceForeheadCentermFaceNoseBridgemFaceNoseBasemFaceEyeLidLowerLeftmFaceEyeLidLowerRightmFaceCheekUpperLeftmFaceCheekUpperRightmFaceLipUpperCenterjoint_offset000.07562989741563796997070312-0.00950700044631958007812500.251107990741729736328125-0.0153679996728897094726562500.2048770040273666381835938000.08407290279865264892578125001.067020058631896972656250.035987500101327896118164060-0.025396499782800674438476560.0250000003725290298461914100.04500000178813934326171875-0.059168100357055664062500.004850860219448804855346680.10700099915266036987304690-0.02607659995555877685546875-0.059168100357055664062500.004850860219448804855346680.03629549965262413024902344-0.01899999938905239105224609-0.013485999777913093566894530.036295499652624130249023440.01899999938905239105224609-0.01348599977791309356689453-0.0202696993947029113769531200.0053312801755964756011962890.083006501197814941406250-0.020363999530673027038574220.083787396550178527832031250-0.026688499376177787780761720.03427229821681976318359375-0.012062000110745429992675780.00051081198034808039665222170.034272298216819763183593750.012062000110745429992675780.00051081198034808039665222170.04490169882774353027343750.036976300179958343505859380.038352798670530319213867190.0449016988277435302734375-0.036976300179958343505859380.038352798670530319213867190.018112899735569953918457030.016734100878238677978515620.057003501802682876586914060.01811289973556995391845703-0.016734100878238677978515620.05700350180268287658691406-0.0082314396277070045471191410.037603501230478286743164060.05627429857850074768066406-0.008231439627707004547119141-0.037603501230478286743164060.056274298578500747680664060.0731943026185035705566406200.087502397596836090087890620.104399003088474273681640600.017177099362015724182128910.150499001145362854003906200.0038522500544786453247070310.04490169882774353027343750.036976300179958343505859380.038352798670530319213867190.0449016988277435302734375-0.036976300179958343505859380.038352798670530319213867190.029158199205994606018066410.05687420070171356201171875-0.0045324601233005523681640620.02915819920599460601806641-0.05687420070171356201171875-0.0045324601233005523681640620.0167011991143226623535156200.009711739607155323028564453pelvis_offset092a7dd5c-bc30-9952-3b3b-e6cc10336cbejoint_namesmEyeLeftmHeadmNeckmChestmTorsomPelvismEyeRightjoint_offset0.090427502989768981933593750.037174601107835769653320310.0805628001689910888671875000.07562989741563796997070312-0.00950700044631958007812500.251107990741729736328125-0.0153679996728897094726562500.2048770040273666381835938000.08407290279865264892578125001.067020058631896972656250.09042750298976898193359375-0.037174601107835769653320310.0805628001689910888671875pelvis_offset0971cf873-afce-8b69-44d6-3f5879cb94c2joint_namesmHeadmNeckmChestmTorsomPelvismFaceJawmFaceRootmFaceLipUpperLeftmFaceTeethUppermFaceLipUpperRightmFaceLipCornerLeftmFaceLipCornerRightmFaceLipLowerCentermFaceTeethLowermFaceChinmFaceLipLowerLeftmFaceLipLowerRightmFaceEyeLidUpperLeftmFaceEyeLidUpperRightmFaceEyebrowInnerLeftmFaceEyebrowInnerRightmFaceEyebrowCenterLeftmFaceEyebrowCenterRightmFaceForeheadCentermFaceNoseBridgemFaceNoseBasemFaceEyeLidLowerLeftmFaceEyeLidLowerRightmFaceCheekUpperLeftmFaceCheekUpperRightmFaceLipUpperCenterjoint_offset000.07562989741563796997070312-0.00950700044631958007812500.251107990741729736328125-0.0153679996728897094726562500.2048770040273666381835938000.08407290279865264892578125001.067020058631896972656250.035987500101327896118164060-0.025394700467586517333984380.0250000003725290298461914100.04500000178813934326171875-0.059168100357055664062500.004850860219448804855346680.10700099915266036987304690-0.02607489936053752899169922-0.059168100357055664062500.004850860219448804855346680.03629549965262413024902344-0.01899999938905239105224609-0.013485999777913093566894530.036295499652624130249023440.01899999938905239105224609-0.01348599977791309356689453-0.0202696993947029113769531200.0053312801755964756011962890.083006501197814941406250-0.020363999530673027038574220.083787396550178527832031250-0.026688499376177787780761720.03427229821681976318359375-0.012062000110745429992675780.00051081198034808039665222170.034272298216819763183593750.012062000110745429992675780.00051081198034808039665222170.04490169882774353027343750.036976300179958343505859380.038354501128196716308593750.0449016988277435302734375-0.036976300179958343505859380.038354501128196716308593750.018112899735569953918457030.016734100878238677978515620.057005301117897033691406250.01811289973556995391845703-0.016734100878238677978515620.05700530111789703369140625-0.0082314396277070045471191410.037603501230478286743164060.05627600103616714477539062-0.008231439627707004547119141-0.037603501230478286743164060.056276001036167144775390620.0731943026185035705566406200.08750399947166442871093750.104399003088474273681640600.017178799957036972045898440.150499001145362854003906200.0038539199158549308776855470.04490169882774353027343750.036976300179958343505859380.038354501128196716308593750.0449016988277435302734375-0.036976300179958343505859380.038354501128196716308593750.029158199205994606018066410.05687420070171356201171875-0.0045307897962629795074462890.02915819920599460601806641-0.05687420070171356201171875-0.0045307897962629795074462890.0167011991143226623535156200.009711739607155323028564453pelvis_offset0d0328b82-d9ca-6071-b248-17edfc7612cbjoint_namesmHeadmNeckmChestmTorsomPelvismFaceJawmFaceRootmFaceLipUpperLeftmFaceTeethUppermFaceLipUpperRightmFaceLipCornerLeftmFaceLipCornerRightmFaceLipLowerCentermFaceTeethLowermFaceChinmFaceLipLowerLeftmFaceLipLowerRightmFaceEyeLidUpperLeftmFaceEyeLidUpperRightmFaceEyebrowInnerLeftmFaceEyebrowInnerRightmFaceEyebrowCenterLeftmFaceEyebrowCenterRightmFaceForeheadCentermFaceNoseBridgemFaceNoseBasemFaceEyeLidLowerLeftmFaceEyeLidLowerRightmFaceCheekUpperLeftmFaceCheekUpperRightmFaceLipUpperCenterjoint_offset000.07562989741563796997070312-0.00950700044631958007812500.251107990741729736328125-0.0153679996728897094726562500.2048770040273666381835938000.08407290279865264892578125001.067020058631896972656250.035987500101327896118164060-0.025394700467586517333984380.0250000003725290298461914100.04500000178813934326171875-0.059168100357055664062500.004850860219448804855346680.10700099915266036987304690-0.02607489936053752899169922-0.059168100357055664062500.004850860219448804855346680.03629549965262413024902344-0.01899999938905239105224609-0.013485999777913093566894530.036295499652624130249023440.01899999938905239105224609-0.01348599977791309356689453-0.0202696993947029113769531200.0053312801755964756011962890.083006501197814941406250-0.020363999530673027038574220.083787396550178527832031250-0.026688499376177787780761720.03427229821681976318359375-0.012062000110745429992675780.00051081198034808039665222170.034272298216819763183593750.012062000110745429992675780.00051081198034808039665222170.04490169882774353027343750.036976300179958343505859380.038354501128196716308593750.0449016988277435302734375-0.036976300179958343505859380.038354501128196716308593750.018112899735569953918457030.016734100878238677978515620.057005301117897033691406250.01811289973556995391845703-0.016734100878238677978515620.05700530111789703369140625-0.0082314396277070045471191410.037603501230478286743164060.05627600103616714477539062-0.008231439627707004547119141-0.037603501230478286743164060.056276001036167144775390620.0731943026185035705566406200.08750399947166442871093750.104399003088474273681640600.017178799957036972045898440.150499001145362854003906200.0038539199158549308776855470.04490169882774353027343750.036976300179958343505859380.038354501128196716308593750.0449016988277435302734375-0.036976300179958343505859380.038354501128196716308593750.029158199205994606018066410.05687420070171356201171875-0.0045307897962629795074462890.02915819920599460601806641-0.05687420070171356201171875-0.0045307897962629795074462890.0167011991143226623535156200.009711739607155323028564453pelvis_offset0d2205615-2ce0-4ff1-2bfd-bdc77a3825ccjoint_namesmHeadmNeckmChestmTorsomPelvismFaceJawmFaceRootmFaceLipUpperLeftmFaceTeethUppermFaceLipUpperRightmFaceLipCornerLeftmFaceLipCornerRightmFaceLipLowerCentermFaceTeethLowermFaceChinmFaceLipLowerLeftmFaceLipLowerRightmFaceEyeLidUpperLeftmFaceEyeLidUpperRightmFaceEyebrowInnerLeftmFaceEyebrowInnerRightmFaceEyebrowCenterLeftmFaceEyebrowCenterRightmFaceForeheadCentermFaceNoseBridgemFaceNoseBasemFaceEyeLidLowerLeftmFaceEyeLidLowerRightmFaceCheekUpperLeftmFaceCheekUpperRightmFaceLipUpperCenterjoint_offset000.07562989741563796997070312-0.00950700044631958007812500.251107990741729736328125-0.0153679996728897094726562500.2048770040273666381835938000.08407290279865264892578125001.067020058631896972656250.035987500101327896118164060-0.025394700467586517333984380.0250000003725290298461914100.04500000178813934326171875-0.059168100357055664062500.004850860219448804855346680.10700099915266036987304690-0.02607489936053752899169922-0.059168100357055664062500.004850860219448804855346680.03629549965262413024902344-0.01899999938905239105224609-0.013485999777913093566894530.036295499652624130249023440.01899999938905239105224609-0.01348599977791309356689453-0.0202696993947029113769531200.0053312801755964756011962890.083006501197814941406250-0.020363999530673027038574220.083787396550178527832031250-0.026688499376177787780761720.03427229821681976318359375-0.012062000110745429992675780.00051081198034808039665222170.034272298216819763183593750.012062000110745429992675780.00051081198034808039665222170.04490169882774353027343750.036976300179958343505859380.038354501128196716308593750.0449016988277435302734375-0.036976300179958343505859380.038354501128196716308593750.018112899735569953918457030.016734100878238677978515620.057005301117897033691406250.01811289973556995391845703-0.016734100878238677978515620.05700530111789703369140625-0.0082314396277070045471191410.037603501230478286743164060.05627600103616714477539062-0.008231439627707004547119141-0.037603501230478286743164060.056276001036167144775390620.0731943026185035705566406200.08750399947166442871093750.104399003088474273681640600.017178799957036972045898440.150499001145362854003906200.0038539199158549308776855470.04490169882774353027343750.036976300179958343505859380.038354501128196716308593750.0449016988277435302734375-0.036976300179958343505859380.038354501128196716308593750.029158199205994606018066410.05687420070171356201171875-0.0045307897962629795074462890.02915819920599460601806641-0.05687420070171356201171875-0.0045307897962629795074462890.0167011991143226623535156200.009711739607155323028564453pelvis_offset0d73dea3b-b8cb-59ff-c76b-cfdcc8119bb5joint_namesmFaceJawmFaceRootmHeadmNeckmChestmTorsomPelvisjoint_offset0.035987500101327896118164060-0.025394700467586517333984380.0250000003725290298461914100.04500000178813934326171875000.07562989741563796997070312-0.00950700044631958007812500.251107990741729736328125-0.0153679996728897094726562500.2048770040273666381835938000.08407290279865264892578125001.06702005863189697265625pelvis_offset0e678576a-dc9f-5187-6ed5-5b4aafb65d7bjoint_namesmHeadmNeckmChestmTorsomPelvismFaceJawmFaceRootmFaceLipUpperLeftmFaceTeethUppermFaceLipUpperRightmFaceLipCornerLeftmFaceLipCornerRightmFaceLipLowerCentermFaceTeethLowermFaceChinmFaceLipLowerLeftmFaceLipLowerRightmFaceEyeLidUpperLeftmFaceEyeLidUpperRightmFaceEyebrowInnerLeftmFaceEyebrowInnerRightmFaceEyebrowCenterLeftmFaceEyebrowCenterRightmFaceForeheadCentermFaceNoseBridgemFaceNoseBasemFaceEyeLidLowerLeftmFaceEyeLidLowerRightmFaceCheekUpperLeftmFaceCheekUpperRightmFaceLipUpperCenterjoint_offset000.07562989741563796997070312-0.00950700044631958007812500.251107990741729736328125-0.0153679996728897094726562500.2048770040273666381835938000.08407290279865264892578125001.067020058631896972656250.035987500101327896118164060-0.025394700467586517333984380.0250000003725290298461914100.04500000178813934326171875-0.059168100357055664062500.004850860219448804855346680.10700099915266036987304690-0.02607489936053752899169922-0.059168100357055664062500.004850860219448804855346680.03629549965262413024902344-0.01899999938905239105224609-0.013485999777913093566894530.036295499652624130249023440.01899999938905239105224609-0.01348599977791309356689453-0.0202696993947029113769531200.0053312801755964756011962890.083006501197814941406250-0.020363999530673027038574220.083787396550178527832031250-0.026688499376177787780761720.03427229821681976318359375-0.012062000110745429992675780.00051081198034808039665222170.034272298216819763183593750.012062000110745429992675780.00051081198034808039665222170.04490169882774353027343750.036976300179958343505859380.038354501128196716308593750.0449016988277435302734375-0.036976300179958343505859380.038354501128196716308593750.018112899735569953918457030.016734100878238677978515620.057005301117897033691406250.01811289973556995391845703-0.016734100878238677978515620.05700530111789703369140625-0.0082314396277070045471191410.037603501230478286743164060.05627600103616714477539062-0.008231439627707004547119141-0.037603501230478286743164060.056276001036167144775390620.0731943026185035705566406200.08750399947166442871093750.104399003088474273681640600.017178799957036972045898440.150499001145362854003906200.0038539199158549308776855470.04490169882774353027343750.036976300179958343505859380.038354501128196716308593750.0449016988277435302734375-0.036976300179958343505859380.038354501128196716308593750.029158199205994606018066410.05687420070171356201171875-0.0045307897962629795074462890.02915819920599460601806641-0.05687420070171356201171875-0.0045307897962629795074462890.0167011991143226623535156200.009711739607155323028564453pelvis_offset0ed796a27-cff0-454a-ecec-fd10794ca2c9joint_namesmFaceNoseBasemFaceRootmHeadmNeckmChestmTorsomPelvismFaceLipUpperCentermFaceTeethUpperjoint_offset0.150499001145362854003906200.0038539199158549308776855470.0250000003725290298461914100.04500000178813934326171875000.07562989741563796997070312-0.00950700044631958007812500.251107990741729736328125-0.0153679996728897094726562500.2048770040273666381835938000.08407290279865264892578125001.067020058631896972656250.0167011991143226623535156200.0097117396071553230285644530.10700099915266036987304690-0.02607489936053752899169922pelvis_offset0fa0aabfe-4b1c-fa9b-4942-74e7e7f50fe2joint_namesmPelvismHandMiddle1LeftmHandMiddle2LeftmHandMiddle3LeftmHandIndex1LeftmHandIndex2LeftmHandIndex3LeftmHandRing1LeftmHandRing2LeftmHandRing3LeftmHandPinky1LeftmHandPinky2LeftmHandPinky3LeftmHandThumb1LeftmHandThumb2LeftmHandThumb3LeftmHandMiddle1RightmHandMiddle2RightmHandMiddle3RightmHandIndex1RightmHandIndex2RightmHandIndex3RightmHandRing1RightmHandRing2RightmHandRing3RightmHandPinky1RightmHandPinky2RightmHandPinky3RightmHandThumb1RightmHandThumb2RightmHandThumb3Rightjoint_offset001.067020058631896972656250.015188699588179588317871090.098942197859287261962890620.01042949967086315155029297-0.0010505600366741418838500980.04202070087194442749023438-0.006302990019321441650390625-0.00050425098743289709091186520.02471089921891689300537109-0.0040346500463783740997314450.034273900091648101806640620.09468069672584533691406250.0096299396827816963195800780.017191000282764434814453120.03640490025281906127929688-0.0060679200105369091033935550.010213700123131275177001950.02334530092775821685791016-0.004377489909529685974121094-0.0036476401146501302719116210.0965808033943176269531250.004405209794640541076660156-0.012315300293266773223876950.03599850088357925415039062-0.007578520104289054870605469-0.0065627098083496093750.02019299939274787902832031-0.00454388977959752082824707-0.023213399574160575866699220.08812329918146133422851562-0.004173850174993276596069336-0.022267799824476242065429690.02319590002298355102539062-0.005566920153796672821044922-0.01243670005351305007934570.01492409966886043548583984-0.0033164799679070711135864260.032215598970651626586914060.02088090032339096069335938-0.0085530597716569900512695310.029450999572873115539550780.03365840017795562744140625-0.0010520200012251734733581540.020924899727106094360351560.02820369973778724670410156-0.00090962200192734599113464360.01518869958817958831787109-0.098942197859287261962890620.01042949967086315155029297-0.001050550024956464767456055-0.04202080145478248596191406-0.006302880123257637023925781-0.0005042660050094127655029297-0.02471089921891689300537109-0.0040346598252654075622558590.03427390009164810180664062-0.09468069672584533691406250.0096299396827816963195800780.01719100028276443481445312-0.03640500083565711975097656-0.0060678198933601379394531250.01021370012313127517700195-0.02334530092775821685791016-0.004377489909529685974121094-0.003647640114650130271911621-0.0965808033943176269531250.004405209794640541076660156-0.01231530029326677322387695-0.03599840030074119567871094-0.007578390184789896011352539-0.006562769878655672073364258-0.02019290067255496978759766-0.004543649964034557342529297-0.02321339957416057586669922-0.08812329918146133422851562-0.004173850174993276596069336-0.02226779982447624206542969-0.02319570071995258331298828-0.005566900130361318588256836-0.01243660040199756622314453-0.01492400001734495162963867-0.0033167300280183553695678710.03221559897065162658691406-0.02088090032339096069335938-0.0085530597716569900512695310.02945090085268020629882812-0.03365840017795562744140625-0.0010520999785512685775756840.02092500030994415283203125-0.02820380032062530517578125-0.0009097899892367422580718994pelvis_offset0success1 diff --git a/indra/llappearanceutility/tests/params.xml b/indra/llappearanceutility/tests/params.xml new file mode 100644 index 00000000000..7d7ff646b7d --- /dev/null +++ b/indra/llappearanceutility/tests/params.xml @@ -0,0 +1,1140 @@ + + + + skindata + + 270bb701-8643-c4b3-6a93-7a2b6503b30a + + joint_names + + mTail1 + mPelvis + mTail2 + mTorso + mSpine2 + mSpine1 + mHipLeft + mKneeLeft + mHipRight + mKneeRight + mChest + mSpine4 + mSpine3 + mShoulderRight + mCollarRight + mShoulderLeft + mCollarLeft + mElbowRight + mElbowLeft + mNeck + mAnkleRight + mAnkleLeft + + joint_offset + + + -0.12795400619506836 + 0.0 + 0.001858999952673912 + + + 0.0 + 0.0 + 1.081987977027893 + + + -0.018850000575184822 + 0.0 + -0.09493499994277954 + + + 0.0 + 0.0 + 0.08407299965620041 + + + 0.0 + 0.0 + -0.08407299965620041 + + + 0.0 + 0.0 + 0.08407299965620041 + + + 0.03375700116157532 + 0.12676499783992767 + -0.04099800065159798 + + + -0.0008870000019669533 + -0.04556800052523613 + -0.4910529851913452 + + + 0.03361999988555908 + -0.1288059949874878 + -0.041085999459028244 + + + -0.0007800000021234155 + 0.04863499850034714 + -0.4909220039844513 + + + -0.01536799967288971 + 0.0 + 0.20487700402736664 + + + 0.01536799967288971 + 0.0 + -0.20487700402736664 + + + -0.01536799967288971 + 0.0 + 0.20487700402736664 + + + 0.0 + -0.07941800355911255 + 0.0 + + + -0.020927000790834427 + -0.08500000089406967 + 0.16539600491523743 + + + 0.0 + 0.07900000363588333 + 0.0 + + + -0.020927000790834427 + 0.08466500043869019 + 0.16539600491523743 + + + 0.0 + -0.24799999594688416 + 0.0 + + + 0.0 + 0.24799999594688416 + 0.0 + + + -0.00950700044631958 + 0.0 + 0.25110799074172974 + + + -0.02886899933218956 + 0.0 + -0.4684939980506897 + + + -0.028886999934911728 + 0.0013780000153928995 + -0.4684489965438843 + + + pelvis_offset + 0.0 + + + wearables + + + + agent_id + de494a4f-f01a-47a4-98cf-c94ef9ecca38 + asset_id + 7e3e76fc-7fa4-ec8f-a785-8956dbce6e72 + contents + LLWearable version 22 +Fashionista Male - Shape (new) + + permissions 0 + { + base_mask 7fffffff + owner_mask 7fffffff + group_mask 00000000 + everyone_mask 00000000 + next_owner_mask 00082000 + creator_id 1f8f7642-ce98-4d1b-9314-e2bc98b6538d + owner_id 1f8f7642-ce98-4d1b-9314-e2bc98b6538d + last_owner_id 1f8f7642-ce98-4d1b-9314-e2bc98b6538d + group_id 00000000-0000-0000-0000-000000000000 + } + sale_info 0 + { + sale_type not + sale_price 10 + } +type 0 +parameters 142 +1 0 +2 .16 +4 -.23 +5 -.1 +6 -.3 +7 0 +8 0 +10 0 +11 .04 +12 0 +13 0 +14 0 +15 0 +17 0 +18 0 +19 -.1 +20 .56 +21 .07 +22 0 +23 .42 +24 -.66 +25 .51 +26 0 +27 .02 +28 .6 +29 0 +30 0 +32 1 +33 -.41 +34 .4 +35 0 +36 -.49 +37 0 +38 .42 +40 1 +80 1 +100 1 +104 0 +105 .5 +106 0 +107 0 +151 .16 +152 0 +153 1 +155 -.13 +156 0 +157 0 +185 -.44 +186 0 +187 0 +188 0 +189 0 +193 .5 +194 -.12 +195 -.06 +196 -.59 +505 .65 +506 -.04 +507 0 +515 -.2 +517 .12 +518 -.3 +626 0 +627 0 +629 .5 +630 0 +631 0 +633 .01 +634 .01 +635 .01 +637 .01 +646 0 +647 0 +648 0 +649 .5 +650 -.67 +651 .03 +652 .49 +653 .26 +655 -.08 +656 0 +657 .03 +658 0 +659 .51 +660 0 +661 0 +662 .5 +663 -.2 +664 .13 +665 .04 +675 .03 +676 -.43 +677 .34 +678 .37 +679 -.08 +680 -.08 +681 -.08 +682 .5 +683 -.14 +684 0 +685 .14 +686 -.68 +687 -.09 +688 -.09 +689 -.34 +690 .33 +691 -.09 +692 .24 +693 .1 +694 -.08 +695 -.09 +753 .06 +756 -.08 +758 -1.05 +759 .67 +760 0 +764 -.5 +765 1.02 +767 .08 +768 .08 +769 .52 +770 0 +772 0 +773 .5 +794 0 +795 .41 +796 0 +797 .15 +798 0 +799 .45 +841 0 +842 -.8 +843 0 +853 0 +854 .06 +855 -.43 +879 -.1 +880 -.82 +1103 0 +1104 0 +1105 0 +11001 0 +textures 0 + + created_at + 1724256027 + desc + + flags + 256 + inv_type + 18 + item_id + 8bbf11b0-b86b-3b4c-8c5c-c84902425f42 + metadata + + + name + Leonard - Shape + parent_id + 056f26cf-a9d9-39b9-a90c-f7b0fcd92347 + permissions + + base_mask + 573440 + creator_id + ba2a564a-f0f1-4b82-9c61-b7520bfcd09f + everyone_mask + 524288 + group_id + 00000000-0000-0000-0000-000000000000 + group_mask + 540672 + last_owner_id + ba2a564a-f0f1-4b82-9c61-b7520bfcd09f + next_owner_mask + 573440 + owner_id + de494a4f-f01a-47a4-98cf-c94ef9ecca38 + owner_mask + 573440 + + sale_info + + sale_price + 10 + sale_type + 0 + + type + 13 + wearable_type + 0 + + + + + agent_id + de494a4f-f01a-47a4-98cf-c94ef9ecca38 + asset_id + 9e675544-77c0-0db6-3694-462be7460b76 + contents + LLWearable version 22 +Formal Male - Skin (less old) + + permissions 0 + { + base_mask 7fffffff + owner_mask 7fffffff + group_mask 00000000 + everyone_mask 00000000 + next_owner_mask 00082000 + creator_id 1f8f7642-ce98-4d1b-9314-e2bc98b6538d + owner_id 1f8f7642-ce98-4d1b-9314-e2bc98b6538d + last_owner_id 1f8f7642-ce98-4d1b-9314-e2bc98b6538d + group_id 00000000-0000-0000-0000-000000000000 + } + sale_info 0 + { + sale_type not + sale_price 10 + } +type 1 +parameters 37 +108 0 +110 0 +111 0 +116 0 +117 0 +118 0 +125 0 +126 0 +150 0 +158 0 +159 0 +161 0 +162 0 +163 0 +165 0 +700 .25 +701 0 +702 0 +703 0 +704 0 +705 .5 +706 .6 +707 0 +708 0 +709 0 +710 0 +711 .5 +712 0 +713 .7 +714 0 +715 0 +775 0 +776 0 +777 0 +873 0 +874 0 +878 0 +textures 3 +0 a21d4081-601e-f9f0-0acc-9192c72863dc +5 a85bf749-952d-3835-d9ac-a307c780930c +6 ab169525-d46c-918b-3195-7f2b92fd76c5 + + created_at + 1724256027 + desc + + flags + 257 + inv_type + 18 + item_id + 9e6c5696-cae0-337e-a5c6-aa6fede08ec6 + metadata + + + name + Leonard - Skin + parent_id + 056f26cf-a9d9-39b9-a90c-f7b0fcd92347 + permissions + + base_mask + 557056 + creator_id + ba2a564a-f0f1-4b82-9c61-b7520bfcd09f + everyone_mask + 524288 + group_id + 00000000-0000-0000-0000-000000000000 + group_mask + 524288 + last_owner_id + ba2a564a-f0f1-4b82-9c61-b7520bfcd09f + next_owner_mask + 557056 + owner_id + de494a4f-f01a-47a4-98cf-c94ef9ecca38 + owner_mask + 557056 + + sale_info + + sale_price + 10 + sale_type + 0 + + type + 13 + wearable_type + 1 + + + + + agent_id + de494a4f-f01a-47a4-98cf-c94ef9ecca38 + asset_id + 0b935621-92da-099e-a248-cfbfa3624c68 + contents + LLWearable version 22 +Fashionista Male - Brows (new) + + permissions 0 + { + base_mask 00082000 + owner_mask 00082000 + group_mask 00000000 + everyone_mask 00000000 + next_owner_mask 00082000 + creator_id 1f8f7642-ce98-4d1b-9314-e2bc98b6538d + owner_id 1f8f7642-ce98-4d1b-9314-e2bc98b6538d + last_owner_id 1f8f7642-ce98-4d1b-9314-e2bc98b6538d + group_id 00000000-0000-0000-0000-000000000000 + } + sale_info 0 + { + sale_type not + sale_price 10 + } +type 2 +parameters 90 +16 .41 +31 1.04 +112 0 +113 0 +114 0 +115 0 +119 .5 +130 0 +131 0 +132 0 +133 0 +134 0 +135 0 +136 0 +137 .5 +140 0 +141 0 +142 0 +143 -4 +144 1 +145 0 +146 1 +147 0 +148 1 +149 0 +166 0 +167 0 +168 0 +169 0 +171 0 +172 1 +173 0 +174 1 +175 0 +176 1 +177 0 +178 0 +179 1 +180 0 +181 -1 +182 -1 +183 -1 +184 0 +190 0 +191 0 +192 0 +400 .75 +640 -.01 +641 .2 +642 0 +643 0 +644 .24 +645 0 +674 -.3 +750 .65 +751 0 +752 .5 +754 0 +755 .05 +757 -1.6 +761 1.3 +762 0 +763 0 +771 -.08 +774 0 +782 0 +783 0 +784 0 +785 0 +786 0 +787 0 +788 0 +789 0 +790 0 +870 -.11 +871 -.4 +872 .52 +1000 .5 +1001 .5 +1002 .65 +1003 .65 +1004 0 +1005 0 +1006 0 +1007 0 +1008 0 +1009 0 +1010 0 +1011 0 +1012 .25 +textures 1 +4 3cc3add8-6ff0-0640-79ba-b15137f64008 + + created_at + 1724256027 + desc + + flags + 258 + inv_type + 18 + item_id + 3ddd2d41-fbe4-3076-9732-c5f3b12973b1 + metadata + + + name + Leonard - Brows + parent_id + 056f26cf-a9d9-39b9-a90c-f7b0fcd92347 + permissions + + base_mask + 557056 + creator_id + ba2a564a-f0f1-4b82-9c61-b7520bfcd09f + everyone_mask + 524288 + group_id + 00000000-0000-0000-0000-000000000000 + group_mask + 524288 + last_owner_id + ba2a564a-f0f1-4b82-9c61-b7520bfcd09f + next_owner_mask + 557056 + owner_id + de494a4f-f01a-47a4-98cf-c94ef9ecca38 + owner_mask + 557056 + + sale_info + + sale_price + 10 + sale_type + 0 + + type + 13 + wearable_type + 2 + + + + + agent_id + de494a4f-f01a-47a4-98cf-c94ef9ecca38 + asset_id + 052ca46d-9612-7a43-25a9-d7c8a5387cf6 + contents + LLWearable version 22 +Fashionista Male - Eyes + + permissions 0 + { + base_mask 7fffffff + owner_mask 7fffffff + group_mask 00000000 + everyone_mask 00000000 + next_owner_mask 00082000 + creator_id 1f8f7642-ce98-4d1b-9314-e2bc98b6538d + owner_id 1f8f7642-ce98-4d1b-9314-e2bc98b6538d + last_owner_id 1f8f7642-ce98-4d1b-9314-e2bc98b6538d + group_id 00000000-0000-0000-0000-000000000000 + } + sale_info 0 + { + sale_type not + sale_price 10 + } +type 3 +parameters 2 +98 1 +99 0 +textures 1 +3 579e320c-0f16-2a1d-2018-2a00cc657068 + + created_at + 1724256027 + desc + + flags + 259 + inv_type + 18 + item_id + 9d4e7072-0e92-39a1-95a4-b5330450b1ee + metadata + + + name + Leonard - Eyes + parent_id + 056f26cf-a9d9-39b9-a90c-f7b0fcd92347 + permissions + + base_mask + 557056 + creator_id + ba2a564a-f0f1-4b82-9c61-b7520bfcd09f + everyone_mask + 524288 + group_id + 00000000-0000-0000-0000-000000000000 + group_mask + 524288 + last_owner_id + ba2a564a-f0f1-4b82-9c61-b7520bfcd09f + next_owner_mask + 557056 + owner_id + de494a4f-f01a-47a4-98cf-c94ef9ecca38 + owner_mask + 557056 + + sale_info + + sale_price + 10 + sale_type + 0 + + type + 13 + wearable_type + 3 + + + + + + + + + agent_id + de494a4f-f01a-47a4-98cf-c94ef9ecca38 + asset_id + 5f049939-bb34-ad27-66cb-38c9151a105d + contents + LLWearable version 22 +Fashionista Male - Shoe Base + + permissions 0 + { + base_mask 7fffffff + owner_mask 7fffffff + group_mask 00000000 + everyone_mask 00000000 + next_owner_mask 00082000 + creator_id 73ecef5a-3110-4e95-92bc-da0ae7598652 + owner_id 73ecef5a-3110-4e95-92bc-da0ae7598652 + last_owner_id 73ecef5a-3110-4e95-92bc-da0ae7598652 + group_id 00000000-0000-0000-0000-000000000000 + } + sale_info 0 + { + sale_type not + sale_price 10 + } +type 6 +parameters 20 +197 0 +198 0 +500 0 +501 .1 +502 .1 +503 .1 +508 -.52 +509 1 +510 0 +511 .82 +512 0 +513 0 +514 .09 +616 .3 +654 .06 +812 1 +813 1 +817 1 +1052 .3 +1053 .3 +textures 1 +7 8dcd4a48-2d37-4909-9f78-f7a9eb4ef903 + + created_at + 1724256027 + desc + @600 + flags + 262 + inv_type + 18 + item_id + dc5e279a-4a34-36ee-9075-028df446392c + metadata + + + name + Leonard - Shoes BASE + parent_id + 056f26cf-a9d9-39b9-a90c-f7b0fcd92347 + permissions + + base_mask + 557056 + creator_id + ba2a564a-f0f1-4b82-9c61-b7520bfcd09f + everyone_mask + 524288 + group_id + 00000000-0000-0000-0000-000000000000 + group_mask + 524288 + last_owner_id + ba2a564a-f0f1-4b82-9c61-b7520bfcd09f + next_owner_mask + 557056 + owner_id + de494a4f-f01a-47a4-98cf-c94ef9ecca38 + owner_mask + 557056 + + sale_info + + sale_price + 10 + sale_type + 0 + + type + 5 + wearable_type + 6 + + + + + + + + + + + + + + + + + agent_id + de494a4f-f01a-47a4-98cf-c94ef9ecca38 + asset_id + ab0bd2c6-3776-7ea6-264f-102842c6328b + contents + LLWearable version 22 +Fashionista Female - Heels Alpha + + permissions 0 + { + base_mask 7fffffff + owner_mask 7fffffff + group_mask 00000000 + everyone_mask 00000000 + next_owner_mask 00082000 + creator_id 73ecef5a-3110-4e95-92bc-da0ae7598652 + owner_id 73ecef5a-3110-4e95-92bc-da0ae7598652 + last_owner_id 73ecef5a-3110-4e95-92bc-da0ae7598652 + group_id 00000000-0000-0000-0000-000000000000 + } + sale_info 0 + { + sale_type not + sale_price 10 + } +type 13 +parameters 0 +textures 5 +21 b5b09502-8305-af43-cc4e-7238cb715b11 +22 5748decc-f629-461c-9a36-a35a221fe21f +23 5748decc-f629-461c-9a36-a35a221fe21f +24 5748decc-f629-461c-9a36-a35a221fe21f +25 5748decc-f629-461c-9a36-a35a221fe21f + + created_at + 1724256027 + desc + @1300 + flags + 269 + inv_type + 18 + item_id + b76dde5f-0da2-3e21-b505-d587b16ddb3c + metadata + + + name + Leonard - Shoes ALPHA + parent_id + 056f26cf-a9d9-39b9-a90c-f7b0fcd92347 + permissions + + base_mask + 557056 + creator_id + ba2a564a-f0f1-4b82-9c61-b7520bfcd09f + everyone_mask + 524288 + group_id + 00000000-0000-0000-0000-000000000000 + group_mask + 524288 + last_owner_id + ba2a564a-f0f1-4b82-9c61-b7520bfcd09f + next_owner_mask + 557056 + owner_id + de494a4f-f01a-47a4-98cf-c94ef9ecca38 + owner_mask + 557056 + + sale_info + + sale_price + 10 + sale_type + 0 + + type + 5 + wearable_type + 13 + + + agent_id + de494a4f-f01a-47a4-98cf-c94ef9ecca38 + asset_id + cb80f44f-8265-f56b-c812-ddf729cee73b + contents + LLWearable version 22 +New Alpha + + permissions 0 + { + base_mask 7fffffff + owner_mask 7fffffff + group_mask 00000000 + everyone_mask 00000000 + next_owner_mask 00082000 + creator_id 8b1453d6-ec45-4434-bee3-1c4d6fe1bc55 + owner_id 8b1453d6-ec45-4434-bee3-1c4d6fe1bc55 + last_owner_id 8b1453d6-ec45-4434-bee3-1c4d6fe1bc55 + group_id 00000000-0000-0000-0000-000000000000 + } + sale_info 0 + { + sale_type not + sale_price 10 + } +type 13 +parameters 0 +textures 5 +21 d9413239-769d-abc9-e929-4fa98f52c07b +22 b5d465f9-ca8e-8ba4-efd8-ee8929c592b8 +23 5748decc-f629-461c-9a36-a35a221fe21f +24 5748decc-f629-461c-9a36-a35a221fe21f +25 5748decc-f629-461c-9a36-a35a221fe21f + + created_at + 1724256027 + desc + @1301 + flags + 269 + inv_type + 18 + item_id + efc7da55-02ba-3286-8458-780aede51b49 + metadata + + + name + Leonard - Suit Alpha + parent_id + 056f26cf-a9d9-39b9-a90c-f7b0fcd92347 + permissions + + base_mask + 557056 + creator_id + ba2a564a-f0f1-4b82-9c61-b7520bfcd09f + everyone_mask + 524288 + group_id + 00000000-0000-0000-0000-000000000000 + group_mask + 524288 + last_owner_id + ba2a564a-f0f1-4b82-9c61-b7520bfcd09f + next_owner_mask + 557056 + owner_id + de494a4f-f01a-47a4-98cf-c94ef9ecca38 + owner_mask + 557056 + + sale_info + + sale_price + 10 + sale_type + 0 + + type + 5 + wearable_type + 13 + + + agent_id + de494a4f-f01a-47a4-98cf-c94ef9ecca38 + asset_id + f235a6a9-062a-bb40-46c2-c8a7bec95fbf + contents + LLWearable version 22 +System Eyelash Remover + + permissions 0 + { + base_mask 7fffffff + owner_mask 7fffffff + group_mask 00000000 + everyone_mask 00000000 + next_owner_mask 00082000 + creator_id 1f8f7642-ce98-4d1b-9314-e2bc98b6538d + owner_id 1f8f7642-ce98-4d1b-9314-e2bc98b6538d + last_owner_id 1f8f7642-ce98-4d1b-9314-e2bc98b6538d + group_id 00000000-0000-0000-0000-000000000000 + } + sale_info 0 + { + sale_type not + sale_price 10 + } +type 13 +parameters 0 +textures 5 +21 5748decc-f629-461c-9a36-a35a221fe21f +22 5748decc-f629-461c-9a36-a35a221fe21f +23 9e460914-daed-b03f-0f2a-afbe67833b11 +24 5748decc-f629-461c-9a36-a35a221fe21f +25 5748decc-f629-461c-9a36-a35a221fe21f + + created_at + 1724256027 + desc + @1302 + flags + 269 + inv_type + 18 + item_id + 624f9c12-72e8-3409-a3f3-b3fe8f496b13 + metadata + + + name + System Eyelash Remover + parent_id + 056f26cf-a9d9-39b9-a90c-f7b0fcd92347 + permissions + + base_mask + 557056 + creator_id + ba2a564a-f0f1-4b82-9c61-b7520bfcd09f + everyone_mask + 524288 + group_id + 00000000-0000-0000-0000-000000000000 + group_mask + 524288 + last_owner_id + ba2a564a-f0f1-4b82-9c61-b7520bfcd09f + next_owner_mask + 557056 + owner_id + de494a4f-f01a-47a4-98cf-c94ef9ecca38 + owner_mask + 557056 + + sale_info + + sale_price + 10 + sale_type + 0 + + type + 5 + wearable_type + 13 + + + + + + + + + + + diff --git a/indra/llappearanceutility/tests/params.xml.output b/indra/llappearanceutility/tests/params.xml.output new file mode 100644 index 00000000000..58449dd37ac --- /dev/null +++ b/indra/llappearanceutility/tests/params.xml.output @@ -0,0 +1 @@ +avatar_scale0.4499999880790710449218750.600000023841857910156251.76146829128265380859375debug_params1namebig_browvalue0weight3310namesunken_cheeksvalue0weight8510000namebreast_physics_massvalue0.1000000014901161193847656weight010001namebreast_physics_gravityvalue0weight010002namebreast_physics_dragvalue1weight2510003namebreast_physics_updown_max_effectvalue0weight010004namebreast_physics_updown_springvalue10weight2510005namebreast_physics_updown_gainvalue10weight2310006namebreast_physics_updown_dampingvalue0.2000000029802322387695312weight5110007namebreast_physics_inout_max_effectvalue0weight010008namebreast_physics_inout_springvalue10weight2510009namebreast_physics_inout_gainvalue10weight2310010namebreast_physics_inout_dampingvalue0.2000000029802322387695312weight5110011namebelly_physics_massvalue0.1000000014901161193847656weight010012namebelly_physics_gravityvalue0weight010013namebelly_physics_dragvalue1weight2510014namebelly_physics_updown_max_effectvalue0weight010015namebelly_physics_updown_springvalue10weight2510016namebelly_physics_updown_gainvalue10weight2310017namebelly_physics_updown_dampingvalue0.2000000029802322387695312weight5110018namebutt_physics_massvalue0.1000000014901161193847656weight010019namebutt_physics_gravityvalue0weight010020namebutt_physics_dragvalue1weight2510021namebutt_physics_updown_max_effectvalue0weight010022namebutt_physics_updown_springvalue10weight2510023namebutt_physics_updown_gainvalue10weight2310024namebutt_physics_updown_dampingvalue0.2000000029802322387695312weight5110025namebutt_physics_leftright_max_effectvalue0weight010026namebutt_physics_leftright_springvalue10weight2510027namebutt_physics_leftright_gainvalue10weight2310028namebutt_physics_leftright_dampingvalue0.2000000029802322387695312weight5110029namebreast_physics_leftright_max_effectvalue0weight010030namebreast_physics_leftright_springvalue10weight2510031namebreast_physics_leftright_gainvalue10weight2310032namebreast_physics_leftright_dampingvalue0.2000000029802322387695312weight51105namebreast sizevalue0.5weight127108namerainbow colorvalue0weight011namenoble_nose_bridgevalue0.03999999910593032836914062weight68110namered skinvalue0weight011000nameappearancemessage_versionvalue1weight111001namehovervalue0weight127111namepigmentvalue0weight0112namerainbow colorvalue0weight0113namered hairvalue0weight0114nameblonde hairvalue0weight0115namewhite hairvalue0weight0116namerosy complexionvalue0weight0117namelip pinknessvalue0weight0119nameeyebrow sizevalue0.5weight12712namejowlsvalue0weight4213namecleft_chin_uppervalue0weight0130namefront fringevalue0weight0131nameside fringevalue0weight0132nameback fringevalue0weight0133namehair frontvalue0weight0134namehair sidesvalue0weight0135namehair backvalue0weight0136namehair sweepvalue0weight0137namehair tiltvalue0.5weight12714namehigh_cheek_bonesvalue0weight85140namehair_part_middlevalue0weight0141namehair_part_rightvalue0weight0142namehair_part_leftvalue0weight0143namehair_sides_fullvalue-4weight015nameears_outvalue0weight63150namebody definitionvalue0weight0155namelip widthvalue-0.12999999523162841796875weight89157namebelly sizevalue0weight016namepointy_eyebrowsvalue0.4099999964237213134765625weight66162namefacial definitionvalue0weight0163namewrinklesvalue0weight0165namefrecklesvalue0weight0166namesideburnsvalue0weight0167namemoustachevalue0weight0168namesoulpatchvalue0weight0169namechin curtainsvalue0weight017namesquare_jawvalue0weight85177namehair_rumpledvalue0weight018namepuffy_upper_cheeksvalue0weight95181namehair_big_frontvalue-1weight0182namehair_big_topvalue-1weight0183namehair_big_backvalue-1weight0184namehair_spikedvalue0weight0185namedeep_chinvalue-0.439999997615814208984375weight7119nameupturned_nose_tipvalue-0.1000000014901161193847656weight142192namebangs_part_middlevalue0weight0193namehead shapevalue0.5weight127196nameeye spacingvalue-0.589999973773956298828125weight119198nameheel heightvalue0weight02namenose_big_outvalue0.1599999964237213134765625weight7420namebulbous_nosevalue0.560000002384185791015625weight13521nameupper_eyelid_foldvalue0.07000000029802322387695312weight4522nameattached_earlobesvalue0weight023namebaggy_eyesvalue0.4199999868869781494140625weight11724namewide_eyesvalue-0.660000026226043701171875weight6125namewide_lip_cleftvalue0.5099999904632568359375weight14527namewide_nose_bridgevalue0.01999999955296516418457031weight13431namearced_eyebrowsvalue1.03999996185302734375weight13233nameheightvalue-0.4099999964237213134765625weight11234namethicknessvalue0.4000000059604644775390625weight12735namebig_earsvalue0weight8536nameshouldersvalue-0.4900000095367431640625weight10437namehip widthvalue0weight13638nametorso lengthvalue0.4199999868869781494140625weight1814namebroad_nostrilsvalue-0.2300000041723251342773438weight455namecleft_chinvalue-0.1000000014901161193847656weight0503nameplatform heightvalue0.1000000014901161193847656weight25505namelip thicknessvalue0.64999997615814208984375weight165506namemouth_heightvalue-0.03999999910593032836914062weight124507namebreast_gravityvalue0weight109508nameshoe_platform_widthvalue-0.519999980926513671875weight40513nameheel shapevalue0weight0514nametoe shapevalue0.0900000035762786865234375weight22515namefoot_sizevalue-0.2000000029802322387695312weight51517namewide_nosevalue0.1199999973177909851074219weight105518nameeyelashes_longvalue-0.300000011920928955078125weight06namebulbous_nose_tipvalue-0.300000011920928955078125weight0603namesleeve lengthvalue0.4000000059604644775390625weight100604namebottomvalue0.85000002384185791015625weight216605namecollar frontvalue0.839999973773956298828125weight214606namesleeve lengthvalue0.800000011920928955078125weight204607namecollar frontvalue0.800000011920928955078125weight204608namebottom length lowervalue0.800000011920928955078125weight204609nameopen jacketvalue0.2000000029802322387695312weight51616nameshoe heightvalue0.300000011920928955078125weight76617namesocks lengthvalue0.3499999940395355224609375weight89619namepants lengthvalue0.300000011920928955078125weight76624namepants waistvalue0.800000011920928955078125weight204625nameleg_pantflairvalue0weight0629nameforehead anglevalue0.5weight127637namebody fatvalue0.009999999776482582092285156weight2638namelow_crotchvalue0weight0646nameegg_headvalue0weight144647namesquash_stretch_headvalue0weight85649nametorso musclesvalue0.5weight127650nameeyelid_corner_upvalue-0.670000016689300537109375weight64652nameleg musclesvalue0.4900000095367431640625weight124653nametall_lipsvalue0.2599999904632568359375weight107654nameshoe_toe_thickvalue0.05999999865889549255371094weight7656namecrooked_nosevalue0weight127659namemouth cornervalue0.5099999904632568359375weight130662nameface shearvalue0.5weight127663nameshift_mouthvalue-0.2000000029802322387695312weight114664namepop_eyevalue0.12999999523162841796875weight140665namejaw_jutvalue0.03999999910593032836914062weight130674namehair_shear_backvalue-0.300000011920928955078125weight59675namehand sizevalue0.02999999932944774627685547weight140676namelove_handlesvalue-0.430000007152557373046875weight48678nametorso musclesvalue0.37000000476837158203125weight94682namehead sizevalue0.5weight127683nameneck thicknessvalue-0.1400000005960464477539062weight110684namebreast_female_cleavagevalue0weight47685namechest_male_no_pecsvalue0.1400000005960464477539062weight101690nameeye sizevalue0.3300000131130218505859375weight84692nameleg lengthvalue0.2399999946355819702148438weight158693namearm lengthvalue0.1000000014901161193847656weight1407nameweak_chinvalue0weight127700namelipstick colorvalue0.25weight63701namelipstickvalue0weight0702namelipglossvalue0weight0703nameeyelinervalue0weight0704nameblushvalue0weight0705nameblush colorvalue0.5weight127706nameout shdw opacityvalue0.60000002384185791015625weight127707nameouter shadowvalue0weight0708nameout shdw colorvalue0weight0709nameinner shadowvalue0weight0710namenail polishvalue0weight0711nameblush opacityvalue0.5weight127712namein shdw colorvalue0weight0713namein shdw opacityvalue0.699999988079071044921875weight159714nameeyeliner colorvalue0weight0715namenail polish colorvalue0weight0750nameeyebrow densityvalue0.64999997615814208984375weight165752namehair thicknessvalue0.5weight127753namesaddlebagsvalue0.05999999865889549255371094weight40754namehair_taper_backvalue0weight85755namehair_taper_frontvalue0.05000000074505805969238281weight131756nameneck lengthvalue-0.07999999821186065673828125weight117757namelower_eyebrowsvalue-1.60000002384185791015625weight102758namelower_bridge_nosevalue-1.0499999523162841796875weight38759namelow_septum_nosevalue0.670000016689300537109375weight170760namejaw_anglevalue0weight95762namehair_shear_frontvalue0weight0763namehair volumevalue0weight0764namelip_cleft_deepvalue-0.5weight0765namepuffy_lower_lidsvalue1.019999980926513671875weight120769nameeye depthvalue0.519999980926513671875weight132773namehead lengthvalue0.5weight127775namebody frecklesvalue0weight0779namecollar backvalue0.839999973773956298828125weight214780namecollar backvalue0.800000011920928955078125weight204781namecollar backvalue0.7799999713897705078125weight198785namepigtailsvalue0weight0789nameponytailvalue0weight0795namebutt sizevalue0.4099999964237213134765625weight104796namepointy_earsvalue0weight30799namelip ratiovalue0.449999988079071044921875weight1148namedouble_chinvalue0weight6380namemalevalue1weight255800namesleeve lengthvalue0.88999998569488525390625weight226801nameshirt bottomvalue1weight255802namecollar frontvalue0.7799999713897705078125weight198803nameshirt_redvalue1weight255804nameshirt_greenvalue1weight255805nameshirt_bluevalue1weight255806namepants_redvalue1weight255807namepants_greenvalue1weight255808namepants_bluevalue1weight255812nameshoes_redvalue1weight255813nameshoes_greenvalue1weight255814namewaist heightvalue1weight255815namepants lengthvalue0.800000011920928955078125weight204816nameloose lower clothingvalue0weight0817nameshoes_bluevalue1weight255818namesocks_redvalue1weight255819namesocks_greenvalue1weight255820namesocks_bluevalue1weight255821nameundershirt_redvalue1weight255822nameundershirt_greenvalue1weight255823nameundershirt_bluevalue1weight255824nameunderpants_redvalue1weight255825nameunderpants_greenvalue1weight255826nameunderpants_bluevalue1weight255827namegloves_redvalue1weight255828nameloose upper clothingvalue0weight0829namegloves_greenvalue1weight255830namegloves_bluevalue1weight255834namejacket_redvalue1weight255835namejacket_greenvalue1weight255836namejacket_bluevalue1weight255840nameshirtsleeve_flairvalue0weight0841namebowed_legsvalue0weight127842namehip lengthvalue-0.800000011920928955078125weight25844nameglove fingersvalue1weight255848nameskirt_bustlevalue0.2000000029802322387695312weight25858nameskirt lengthvalue0.4000000059604644775390625weight100859nameslit frontvalue1weight255860nameslit backvalue1weight255861nameslit leftvalue1weight255862nameslit rightvalue1weight255863nameskirt_loosenessvalue0.333000004291534423828125weight84868nameshirt wrinklesvalue0weight0869namepants wrinklesvalue0weight0877namejacket wrinklesvalue0weight0879namemale_packagevalue-0.1000000014901161193847656weight40880nameeyelid_inner_corner_upvalue-0.819999992847442626953125weight48921nameskirt_redvalue1weight255922nameskirt_greenvalue1weight255923nameskirt_bluevalue1weight25593nameglove lengthvalue0.800000011920928955078125weight20398nameeye lightnessvalue1weight25599nameeye colorvalue0weight0dump_joint_offsetsmesh_id270bb701-8643-c4b3-6a93-7a2b6503b30anamemPelvispos001.08198797702789306640625mesh_id270bb701-8643-c4b3-6a93-7a2b6503b30anamemSpine1pos000.08407299965620040893554688mesh_id270bb701-8643-c4b3-6a93-7a2b6503b30anamemSpine2pos00-0.08407299965620040893554688mesh_id270bb701-8643-c4b3-6a93-7a2b6503b30anamemTorsopos000.08407299965620040893554688mesh_id270bb701-8643-c4b3-6a93-7a2b6503b30anamemSpine3pos-0.0153679996728897094726562500.2048770040273666381835938mesh_id270bb701-8643-c4b3-6a93-7a2b6503b30anamemSpine4pos0.015367999672889709472656250-0.2048770040273666381835938mesh_id270bb701-8643-c4b3-6a93-7a2b6503b30anamemChestpos-0.0153679996728897094726562500.2048770040273666381835938mesh_id270bb701-8643-c4b3-6a93-7a2b6503b30anamemNeckpos-0.00950700044631958007812500.251107990741729736328125mesh_id270bb701-8643-c4b3-6a93-7a2b6503b30anamemCollarLeftpos-0.020927000790834426879882810.0846650004386901855468750.1653960049152374267578125mesh_id270bb701-8643-c4b3-6a93-7a2b6503b30anamemShoulderLeftpos00.079000003635883331298828120mesh_id270bb701-8643-c4b3-6a93-7a2b6503b30anamemElbowLeftpos00.24799999594688415527343750mesh_id270bb701-8643-c4b3-6a93-7a2b6503b30anamemCollarRightpos-0.02092700079083442687988281-0.085000000894069671630859380.1653960049152374267578125mesh_id270bb701-8643-c4b3-6a93-7a2b6503b30anamemShoulderRightpos0-0.0794180035591125488281250mesh_id270bb701-8643-c4b3-6a93-7a2b6503b30anamemElbowRightpos0-0.24799999594688415527343750mesh_id270bb701-8643-c4b3-6a93-7a2b6503b30anamemHipRightpos0.03361999988555908203125-0.12880599498748779296875-0.04108599945902824401855469mesh_id270bb701-8643-c4b3-6a93-7a2b6503b30anamemKneeRightpos-0.0007800000021234154701232910.04863499850034713745117188-0.4909220039844512939453125mesh_id270bb701-8643-c4b3-6a93-7a2b6503b30anamemAnkleRightpos-0.028868999332189559936523440-0.468493998050689697265625mesh_id270bb701-8643-c4b3-6a93-7a2b6503b30anamemHipLeftpos0.03375700116157531738281250.1267649978399276733398438-0.04099800065159797668457031mesh_id270bb701-8643-c4b3-6a93-7a2b6503b30anamemKneeLeftpos-0.0008870000019669532775878906-0.04556800052523612976074219-0.49105298519134521484375mesh_id270bb701-8643-c4b3-6a93-7a2b6503b30anamemAnkleLeftpos-0.028886999934911727905273440.001378000015392899513244629-0.46844899654388427734375mesh_id270bb701-8643-c4b3-6a93-7a2b6503b30anamemTail1pos-0.12795400619506835937500.001858999952673912048339844mesh_id270bb701-8643-c4b3-6a93-7a2b6503b30anamemTail2pos-0.018850000575184822082519530-0.094934999942779541015625params3374450012763856842085636685951421354501176114513413211212785104136181255203255012700000000012700000001270000089000000000000071012711902516512410940022511050100216214204204204517689762040127201448512764124107712713012711414013059140489412711047101841581406300001271270000127015900165127408513111710238170950001201321270214204198001043011422625519825525525525525525525525525520402552552552552552552552552552552550255255255255255012725255251002552552552558400040482552552550025025235102523510025025235100250252351025235102523511127slot_texturesaux1hash_idc228d1cf-4b5d-4ba8-84f4-899a0796aa97texture_idsaux2hash_idc228d1cf-4b5d-4ba8-84f4-899a0796aa97texture_idsaux3hash_idc228d1cf-4b5d-4ba8-84f4-899a0796aa97texture_idseyeshash_id812bffac-704c-d4bb-487d-0674ccbd5d9dtexture_ids5748decc-f629-461c-9a36-a35a221fe21f579e320c-0f16-2a1d-2018-2a00cc657068hairhash_idfc7ad735-99b6-aaf1-a1bf-676ea304b624texture_ids3cc3add8-6ff0-0640-79ba-b15137f640085748decc-f629-461c-9a36-a35a221fe21fheadhash_id799f44a9-82ec-78bd-7800-3e17367229fatexture_ids5748decc-f629-461c-9a36-a35a221fe21f9e460914-daed-b03f-0f2a-afbe67833b11a21d4081-601e-f9f0-0acc-9192c72863dcleftarmhash_idc228d1cf-4b5d-4ba8-84f4-899a0796aa97texture_idsleftleghash_idc228d1cf-4b5d-4ba8-84f4-899a0796aa97texture_idslowerhash_id6d752c11-c33a-43c4-8631-3f8a6722ba59texture_ids5748decc-f629-461c-9a36-a35a221fe21f8dcd4a48-2d37-4909-9f78-f7a9eb4ef903ab169525-d46c-918b-3195-7f2b92fd76c5b5b09502-8305-af43-cc4e-7238cb715b11d9413239-769d-abc9-e929-4fa98f52c07bskirthash_idc228d1cf-4b5d-4ba8-84f4-899a0796aa97texture_idsupperhash_id5b4d5c23-3073-26d1-8d68-78d5bfa308e4texture_ids5748decc-f629-461c-9a36-a35a221fe21fa85bf749-952d-3835-d9ac-a307c780930cb5d465f9-ca8e-8ba4-efd8-ee8929c592b8success1 diff --git a/indra/llappearanceutility/tests/texture.llsd.binary b/indra/llappearanceutility/tests/texture.llsd.binary new file mode 100644 index 00000000000..6b4f34831c6 Binary files /dev/null and b/indra/llappearanceutility/tests/texture.llsd.binary differ diff --git a/indra/llappearanceutility/tests/texture.llsd.output b/indra/llappearanceutility/tests/texture.llsd.output new file mode 100644 index 00000000000..6c7690decc7 Binary files /dev/null and b/indra/llappearanceutility/tests/texture.llsd.output differ diff --git a/indra/llaudio/CMakeLists.txt b/indra/llaudio/CMakeLists.txt index 9278d3c4883..18e29fb194c 100644 --- a/indra/llaudio/CMakeLists.txt +++ b/indra/llaudio/CMakeLists.txt @@ -54,3 +54,7 @@ endif() if( TARGET ll::fmodstudio ) target_link_libraries( llaudio ll::fmodstudio ) endif() + +if (USE_PRECOMPILED_HEADERS) + target_precompile_headers(llaudio REUSE_FROM llprecompiled) +endif () diff --git a/indra/llcharacter/CMakeLists.txt b/indra/llcharacter/CMakeLists.txt index bc45eb474a4..1f019e6aef8 100644 --- a/indra/llcharacter/CMakeLists.txt +++ b/indra/llcharacter/CMakeLists.txt @@ -70,3 +70,7 @@ target_link_libraries( llfilesystem llxml ) + +if (USE_PRECOMPILED_HEADERS) + target_precompile_headers(llcharacter REUSE_FROM llprecompiled) +endif () diff --git a/indra/llcharacter/lleditingmotion.h b/indra/llcharacter/lleditingmotion.h index f94756d43d7..a3c0ee94b74 100644 --- a/indra/llcharacter/lleditingmotion.h +++ b/indra/llcharacter/lleditingmotion.h @@ -42,8 +42,7 @@ //----------------------------------------------------------------------------- // class LLEditingMotion //----------------------------------------------------------------------------- -LL_ALIGN_PREFIX(16) -class LLEditingMotion : +class alignas(16) LLEditingMotion : public LLMotion { LL_ALIGN_NEW @@ -110,11 +109,11 @@ class LLEditingMotion : //------------------------------------------------------------------------- // joint states to be animated //------------------------------------------------------------------------- - LL_ALIGN_16(LLJoint mParentJoint); - LL_ALIGN_16(LLJoint mShoulderJoint); - LL_ALIGN_16(LLJoint mElbowJoint); - LL_ALIGN_16(LLJoint mWristJoint); - LL_ALIGN_16(LLJoint mTarget); + LLJoint mParentJoint; + LLJoint mShoulderJoint; + LLJoint mElbowJoint; + LLJoint mWristJoint; + LLJoint mTarget; LLJointSolverRP3 mIKSolver; LLCharacter *mCharacter; @@ -129,7 +128,7 @@ class LLEditingMotion : static S32 sHandPose; static S32 sHandPosePriority; LLVector3 mLastSelectPt; -} LL_ALIGN_POSTFIX(16); +}; #endif // LL_LLKEYFRAMEMOTION_H diff --git a/indra/llcharacter/lljoint.h b/indra/llcharacter/lljoint.h index b58dc797f8e..481fb0a1bb9 100644 --- a/indra/llcharacter/lljoint.h +++ b/indra/llcharacter/lljoint.h @@ -86,8 +86,7 @@ inline bool operator!=(const LLVector3OverrideMap& a, const LLVector3OverrideMap //----------------------------------------------------------------------------- // class LLJoint //----------------------------------------------------------------------------- -LL_ALIGN_PREFIX(16) -class LLJoint +class alignas(16) LLJoint { LL_ALIGN_NEW public: @@ -118,7 +117,7 @@ class LLJoint }; protected: // explicit transformation members - LL_ALIGN_16(LLMatrix4a mWorldMatrix); + LLMatrix4a mWorldMatrix; LLXformMatrix mXform; std::string mName; @@ -302,6 +301,6 @@ class LLJoint // These are used in checks of whether a pos/scale override is considered significant. bool aboveJointPosThreshold(const LLVector3& pos) const; bool aboveJointScaleThreshold(const LLVector3& scale) const; -} LL_ALIGN_POSTFIX(16); +}; #endif // LL_LLJOINT_H diff --git a/indra/llcharacter/llkeyframemotion.cpp b/indra/llcharacter/llkeyframemotion.cpp index b82734615f5..be1c74a9082 100644 --- a/indra/llcharacter/llkeyframemotion.cpp +++ b/indra/llcharacter/llkeyframemotion.cpp @@ -1229,7 +1229,7 @@ void LLKeyframeMotion::applyConstraint(JointConstraint* constraint, F32 time, U8 bool LLKeyframeMotion::deserialize(LLDataPacker& dp, const LLUUID& asset_id, bool allow_invalid_joints) { bool old_version = false; - std::unique_ptr joint_motion_list(new LLKeyframeMotion::JointMotionList); + std::unique_ptr joint_motion_list = std::make_unique(); //------------------------------------------------------------------------- // get base priority @@ -1826,7 +1826,7 @@ bool LLKeyframeMotion::deserialize(LLDataPacker& dp, const LLUUID& asset_id, boo for(S32 i = 0; i < num_constraints; ++i) { // read in constraint data - std::unique_ptr constraintp(new JointConstraintSharedData); + std::unique_ptr constraintp = std::make_unique(); U8 byte = 0; if (!dp.unpackU8(byte, "chain_length")) diff --git a/indra/llcharacter/llkeyframestandmotion.h b/indra/llcharacter/llkeyframestandmotion.h index df458c7a0c3..7d1acb7c5a7 100644 --- a/indra/llcharacter/llkeyframestandmotion.h +++ b/indra/llcharacter/llkeyframestandmotion.h @@ -37,8 +37,7 @@ //----------------------------------------------------------------------------- // class LLKeyframeStandMotion //----------------------------------------------------------------------------- -LL_ALIGN_PREFIX(16) -class LLKeyframeStandMotion : +class alignas(16) LLKeyframeStandMotion : public LLKeyframeMotion { LL_ALIGN_NEW @@ -112,7 +111,7 @@ class LLKeyframeStandMotion : bool mTrackAnkles; S32 mFrameNum; -} LL_ALIGN_POSTFIX(16); +}; #endif // LL_LLKEYFRAMESTANDMOTION_H diff --git a/indra/llcharacter/llmotion.cpp b/indra/llcharacter/llmotion.cpp index bc9f5786601..a51857c9a1b 100644 --- a/indra/llcharacter/llmotion.cpp +++ b/indra/llcharacter/llmotion.cpp @@ -51,8 +51,8 @@ LLMotion::LLMotion( const LLUUID &id ) : mSendStopTimestamp(F32_MAX), mResidualWeight(0.f), mFadeWeight(1.f), - mDeactivateCallback(NULL), - mDeactivateCallbackUserData(NULL) + mDeactivateCallback(nullptr), + mDeactivateCallbackUserData(nullptr) { for (S32 i=0; i<3; ++i) memset(&mJointSignature[i][0], 0, sizeof(U8) * LL_CHARACTER_MAX_ANIMATED_JOINTS); diff --git a/indra/llcharacter/llmultigesture.h b/indra/llcharacter/llmultigesture.h index af0cb086503..199ed5c543c 100644 --- a/indra/llcharacter/llmultigesture.h +++ b/indra/llcharacter/llmultigesture.h @@ -54,11 +54,10 @@ class LLMultiGesture void reset(); const std::string& getTrigger() const { return mTrigger; } -protected: - LLMultiGesture(const LLMultiGesture& gest); - const LLMultiGesture& operator=(const LLMultiGesture& rhs); -public: + LLMultiGesture(const LLMultiGesture& gest) = delete; + const LLMultiGesture& operator=(const LLMultiGesture& rhs) = delete; + KEY mKey { 0 }; MASK mMask { 0 }; diff --git a/indra/llcharacter/llpose.h b/indra/llcharacter/llpose.h index f2032220e07..fbcd482211e 100644 --- a/indra/llcharacter/llpose.h +++ b/indra/llcharacter/llpose.h @@ -80,8 +80,7 @@ class LLPose const S32 JSB_NUM_JOINT_STATES = 6; -LL_ALIGN_PREFIX(16) -class LLJointStateBlender +class alignas(16) LLJointStateBlender { LL_ALIGN_NEW protected: @@ -98,8 +97,8 @@ class LLJointStateBlender void resetCachedJoint(); public: - LL_ALIGN_16(LLJoint mJointCache); -} LL_ALIGN_POSTFIX(16); + LLJoint mJointCache; +}; class LLMotion; diff --git a/indra/llcharacter/llvisualparam.h b/indra/llcharacter/llvisualparam.h index 3caddb9c625..4ceb1720053 100644 --- a/indra/llcharacter/llvisualparam.h +++ b/indra/llcharacter/llvisualparam.h @@ -30,7 +30,8 @@ #include "v3math.h" #include "llstring.h" #include "llxmltree.h" -#include + +#include class LLPolyMesh; class LLXmlTreeNode; @@ -100,11 +101,10 @@ class LLVisualParamInfo // An interface class for a generalized parametric modification of the avatar mesh // Contains data that is specific to each Avatar //----------------------------------------------------------------------------- -LL_ALIGN_PREFIX(16) -class LLVisualParam +class alignas(16) LLVisualParam { public: - typedef boost::function visual_param_mapper; + typedef std::function visual_param_mapper; LLVisualParam(); virtual ~LLVisualParam(); @@ -180,6 +180,6 @@ class LLVisualParam S32 mID; // id for storing weight/morphtarget compares compactly LLVisualParamInfo *mInfo; EParamLocation mParamLocation; // where does this visual param live? -} LL_ALIGN_POSTFIX(16); +}; #endif // LL_LLVisualParam_H diff --git a/indra/llcommon/CMakeLists.txt b/indra/llcommon/CMakeLists.txt index 2de9deea701..f8c24368b2b 100644 --- a/indra/llcommon/CMakeLists.txt +++ b/indra/llcommon/CMakeLists.txt @@ -68,7 +68,7 @@ set(llcommon_SOURCE_FILES llmetricperformancetester.cpp llmortician.cpp llmutex.cpp - llptrto.cpp + llptrto.cpp llpredicate.cpp llprocess.cpp llprocessor.cpp @@ -108,7 +108,7 @@ set(llcommon_SOURCE_FILES workqueue.cpp StackWalker.cpp ) - + set(llcommon_HEADER_FILES CMakeLists.txt @@ -255,14 +255,28 @@ set(llcommon_HEADER_FILES workqueue.h StackWalker.h ) - + if (DARWIN) list(APPEND llcommon_HEADER_FILES llsys_objc.h) list(APPEND llcommon_SOURCE_FILES llsys_objc.mm) + + set_source_files_properties( + llsys_objc.mm + PROPERTIES + SKIP_PRECOMPILE_HEADERS TRUE + ) endif (DARWIN) if (USE_TRACY) list(APPEND llcommon_SOURCE_FILES llprofiler.cpp) + + # Skip precompiled headers on these files due to special compilation needs + set_source_files_properties( + llfasttimer.cpp + llprofiler.cpp + PROPERTIES + SKIP_PRECOMPILE_HEADERS TRUE + ) endif () list(APPEND llcommon_SOURCE_FILES ${llcommon_HEADER_FILES}) @@ -280,8 +294,12 @@ target_link_libraries( ll::sse2neon ) -target_include_directories(llcommon INTERFACE ${CMAKE_CURRENT_SOURCE_DIR}) -target_include_directories(llcommon PRIVATE ${CMAKE_CURRENT_SOURCE_DIR}) +target_include_directories(llcommon PUBLIC ${CMAKE_CURRENT_SOURCE_DIR}) +target_include_directories(llcommon PRIVATE ${CMAKE_SOURCE_DIR}/llmath) + +if (USE_PRECOMPILED_HEADERS) + target_precompile_headers(llcommon REUSE_FROM llprecompiled) +endif () add_dependencies(llcommon stage_third_party_libs) @@ -314,7 +332,7 @@ if (LL_TESTS) LL_ADD_INTEGRATION_TEST(llleap "" "${test_libs}") LL_ADD_INTEGRATION_TEST(llmainthreadtask "" "${test_libs}") LL_ADD_INTEGRATION_TEST(llpounceable "" "${test_libs}") - LL_ADD_INTEGRATION_TEST(llprocess "" "${test_libs}") + #LL_ADD_INTEGRATION_TEST(llprocess "" "${test_libs}") RIDER: Test is a known failure. Disabling for the moment. LL_ADD_INTEGRATION_TEST(llprocessor "" "${test_libs}") LL_ADD_INTEGRATION_TEST(llprocinfo "" "${test_libs}") LL_ADD_INTEGRATION_TEST(llrand "" "${test_libs}") diff --git a/indra/llcommon/StackWalker.cpp b/indra/llcommon/StackWalker.cpp index e9ae1723fbb..77ae4db4bd6 100644 --- a/indra/llcommon/StackWalker.cpp +++ b/indra/llcommon/StackWalker.cpp @@ -785,6 +785,8 @@ struct IMAGEHLP_MODULE64_V2 { case 8: //SymVirtual: szSymType = "Virtual"; break; + case NumSymTypes: + break; } } LPCSTR pdbName = Module.LoadedImageName; diff --git a/indra/llcommon/classic_callback.h b/indra/llcommon/classic_callback.h index 009c25d67c4..8a6ac7f7ffc 100644 --- a/indra/llcommon/classic_callback.h +++ b/indra/llcommon/classic_callback.h @@ -184,8 +184,8 @@ class ClassicCallback template auto makeClassicCallback(CALLABLE&& callable) { - return std::move(ClassicCallback - (std::forward(callable))); + return ClassicCallback + (std::forward(callable)); } /***************************************************************************** diff --git a/indra/llcommon/llapp.cpp b/indra/llcommon/llapp.cpp index c532620daa1..73b50d0a504 100644 --- a/indra/llcommon/llapp.cpp +++ b/indra/llcommon/llapp.cpp @@ -58,14 +58,6 @@ void setup_signals(); void default_unix_signal_handler(int signum, siginfo_t *info, void *); -#if LL_LINUX -#else -// Called by breakpad exception handler after the minidump has been generated. -bool unix_post_minidump_callback(const char *dump_dir, - const char *minidump_id, - void *context, bool succeeded); -#endif - # if LL_DARWIN /* OSX doesn't support SIGRT* */ S32 LL_SMACKDOWN_SIGNAL = SIGUSR1; @@ -720,47 +712,4 @@ void default_unix_signal_handler(int signum, siginfo_t *info, void *) } } -bool unix_post_minidump_callback(const char *dump_dir, - const char *minidump_id, - void *context, bool succeeded) -{ - // Copy minidump file path into fixed buffer in the app instance to avoid - // heap allocations in a crash handler. - - // path format: /.dmp - auto dirPathLength = strlen(dump_dir); - auto idLength = strlen(minidump_id); - - // The path must not be truncated. - llassert((dirPathLength + idLength + 5) <= LLApp::MAX_MINDUMP_PATH_LENGTH); - - char * path = LLApp::instance()->getMiniDumpFilename(); - auto remaining = LLApp::MAX_MINDUMP_PATH_LENGTH; - strncpy(path, dump_dir, remaining); - remaining -= dirPathLength; - path += dirPathLength; - if (remaining > 0 && dirPathLength > 0 && path[-1] != '/') - { - *path++ = '/'; - --remaining; - } - if (remaining > 0) - { - strncpy(path, minidump_id, remaining); - remaining -= idLength; - path += idLength; - strncpy(path, ".dmp", remaining); - } - - LL_INFOS("CRASHREPORT") << "generated minidump: " << LLApp::instance()->getMiniDumpFilename() << LL_ENDL; - LLApp::runErrorHandler(); - -#ifndef LL_RELEASE_FOR_DOWNLOAD - clear_signals(); - return false; -#else - return true; -#endif -} #endif // !WINDOWS - diff --git a/indra/llcommon/llapr.cpp b/indra/llcommon/llapr.cpp index 01763c49aab..65ee383c6bb 100644 --- a/indra/llcommon/llapr.cpp +++ b/indra/llcommon/llapr.cpp @@ -154,7 +154,7 @@ LLVolatileAPRPool::LLVolatileAPRPool(bool is_local, apr_pool_t *parent, apr_size //create mutex if(!is_local) //not a local apr_pool, that is: shared by multiple threads. { - mMutexp.reset(new std::mutex()); + mMutexp = std::make_unique(); } } @@ -230,11 +230,11 @@ bool LLVolatileAPRPool::isFull() bool _ll_apr_warn_status(apr_status_t status, const char* file, int line) { if(APR_SUCCESS == status) return false; -#if !LL_LINUX + char buf[MAX_STRING]; /* Flawfinder: ignore */ apr_strerror(status, buf, sizeof(buf)); LL_WARNS("APR") << "APR: " << file << ":" << line << " " << buf << LL_ENDL; -#endif + return true; } diff --git a/indra/llcommon/llapr.h b/indra/llcommon/llapr.h index 693cd7c01fa..11e474b5dda 100644 --- a/indra/llcommon/llapr.h +++ b/indra/llcommon/llapr.h @@ -33,7 +33,6 @@ #include // Need PATH_MAX in APR headers... #endif -#include #include "llwin32headers.h" #include "apr_thread_proc.h" #include "apr_getopt.h" @@ -145,7 +144,7 @@ class LL_COMMON_API LLVolatileAPRPool : public LLAPRPool // 2, a global pool. // -class LL_COMMON_API LLAPRFile : boost::noncopyable +class LL_COMMON_API LLAPRFile { // make this non copyable since a copy closes the file private: @@ -153,9 +152,12 @@ class LL_COMMON_API LLAPRFile : boost::noncopyable LLVolatileAPRPool *mCurrentFilePoolp ; //currently in use apr_pool, could be one of them: sAPRFilePoolp, or a temp pool. public: - LLAPRFile() ; + LLAPRFile(); LLAPRFile(const std::string& filename, apr_int32_t flags, LLVolatileAPRPool* pool = NULL); - ~LLAPRFile() ; + ~LLAPRFile(); + + LLAPRFile(const LLAPRFile&) = delete; + LLAPRFile& operator=(const LLAPRFile&) = delete; apr_status_t open(const std::string& filename, apr_int32_t flags, LLVolatileAPRPool* pool = NULL, S32* sizep = NULL); apr_status_t open(const std::string& filename, apr_int32_t flags, bool use_global_pool); //use gAPRPoolp. diff --git a/indra/llcommon/llatomic.cpp b/indra/llcommon/llatomic.cpp index d200bb04067..cff5e01225c 100644 --- a/indra/llcommon/llatomic.cpp +++ b/indra/llcommon/llatomic.cpp @@ -23,6 +23,8 @@ * $/LicenseInfo$ */ +#include "linden_common.h" + #include "llatomic.h" //============================================================================ diff --git a/indra/llcommon/llcallbacklist.cpp b/indra/llcommon/llcallbacklist.cpp index 3d5d30bd90a..8fb7823f041 100644 --- a/indra/llcommon/llcallbacklist.cpp +++ b/indra/llcommon/llcallbacklist.cpp @@ -24,6 +24,8 @@ * $/LicenseInfo$ */ +#include "linden_common.h" + #include "llcallbacklist.h" #include "lleventtimer.h" #include "llerrorlegacy.h" diff --git a/indra/llcommon/llcallbacklist.h b/indra/llcommon/llcallbacklist.h index d6c415f7c57..036e575117d 100644 --- a/indra/llcommon/llcallbacklist.h +++ b/indra/llcommon/llcallbacklist.h @@ -27,8 +27,9 @@ #ifndef LL_LLCALLBACKLIST_H #define LL_LLCALLBACKLIST_H -#include "llstl.h" -#include +#include "stdtypes.h" + +#include #include class LLCallbackList @@ -59,8 +60,8 @@ class LLCallbackList callback_list_t mCallbackList; }; -typedef boost::function nullary_func_t; -typedef boost::function bool_func_t; +typedef std::function nullary_func_t; +typedef std::function bool_func_t; // Call a given callable once in idle loop. void doOnIdleOneTime(nullary_func_t callable); diff --git a/indra/llcommon/llcommon.cpp b/indra/llcommon/llcommon.cpp index 7a22eaf2032..bf8801c46b4 100644 --- a/indra/llcommon/llcommon.cpp +++ b/indra/llcommon/llcommon.cpp @@ -47,30 +47,13 @@ void* ll_tracy_new(size_t size) return ptr; } -void* ll_tracy_aligned_new(size_t size, size_t alignment) -{ - void* ptr = ll_aligned_malloc_fallback(size, alignment); - if (!ptr) - { - throw std::bad_alloc(); - } - LL_PROFILE_ALLOC(ptr, size); - return ptr; -} - void ll_tracy_delete(void* ptr) { LL_PROFILE_FREE(ptr); (free)(ptr); } -void ll_tracy_aligned_delete(void* ptr) -{ - LL_PROFILE_FREE(ptr); - ll_aligned_free_fallback(ptr); -} - -void* operator new(size_t size) +void* operator new(std::size_t size) { return ll_tracy_new(size); } @@ -80,24 +63,41 @@ void* operator new[](std::size_t count) return ll_tracy_new(count); } -void* operator new(size_t size, std::align_val_t align) +void operator delete(void *ptr) noexcept { - return ll_tracy_aligned_new(size, (size_t)align); + ll_tracy_delete(ptr); } -void* operator new[](std::size_t count, std::align_val_t align) +void operator delete[](void* ptr) noexcept { - return ll_tracy_aligned_new(count, (size_t)align); + ll_tracy_delete(ptr); } -void operator delete(void *ptr) noexcept +#if !defined(LL_LINUX) + +void* ll_tracy_aligned_new(size_t size, size_t alignment) { - ll_tracy_delete(ptr); + void* ptr = ll_aligned_malloc_fallback(size, alignment); + if (!ptr) + { + throw std::bad_alloc(); + } + return ptr; } -void operator delete[](void* ptr) noexcept +void ll_tracy_aligned_delete(void* ptr) { - ll_tracy_delete(ptr); + ll_aligned_free_fallback(ptr); +} + +void* operator new(size_t size, std::align_val_t align) +{ + return ll_tracy_aligned_new(size, (size_t)align); +} + +void* operator new[](std::size_t count, std::align_val_t align) +{ + return ll_tracy_aligned_new(count, (size_t)align); } void operator delete(void *ptr, std::align_val_t align) noexcept @@ -110,6 +110,8 @@ void operator delete[](void* ptr, std::align_val_t align) noexcept ll_tracy_aligned_delete(ptr); } +#endif + #endif // TRACY_ENABLE && !LL_PROFILER_ENABLE_TRACY_OPENGL //static diff --git a/indra/llcommon/llcoros.h b/indra/llcommon/llcoros.h index c3820ae9876..9df52b6ed5a 100644 --- a/indra/llcommon/llcoros.h +++ b/indra/llcommon/llcoros.h @@ -37,7 +37,7 @@ #include "mutex.h" #include "llsingleton.h" #include "llinstancetracker.h" -#include +#include #include #include #include @@ -112,7 +112,7 @@ class LL_COMMON_API LLCoros: public LLSingleton /// stuck with the term "coroutine." typedef boost::fibers::fiber coro; /// Canonical callable type - typedef boost::function callable_t; + typedef std::function callable_t; /** * Create and start running a new coroutine with specified name. The name diff --git a/indra/llcommon/lldate.cpp b/indra/llcommon/lldate.cpp index 5205699b92c..b4cdf3cbda2 100644 --- a/indra/llcommon/lldate.cpp +++ b/indra/llcommon/lldate.cpp @@ -131,11 +131,7 @@ void LLDate::toStream(std::ostream& s) const } s << std::dec << std::setfill('0'); -#if( LL_WINDOWS || __GNUC__ > 2) s << std::right; -#else - s.setf(ios::right); -#endif s << std::setw(4) << (exp_time.tm_year + 1900) << '-' << std::setw(2) << (exp_time.tm_mon + 1) << '-' << std::setw(2) << (exp_time.tm_mday) diff --git a/indra/llcommon/lldeadmantimer.cpp b/indra/llcommon/lldeadmantimer.cpp index f9c14d7c24f..45c01eb84a7 100644 --- a/indra/llcommon/lldeadmantimer.cpp +++ b/indra/llcommon/lldeadmantimer.cpp @@ -25,6 +25,7 @@ * $/LicenseInfo$ */ +#include "linden_common.h" #include "lldeadmantimer.h" diff --git a/indra/llcommon/lldeadmantimer.h b/indra/llcommon/lldeadmantimer.h index 3f10420d41d..19d65b78b63 100644 --- a/indra/llcommon/lldeadmantimer.h +++ b/indra/llcommon/lldeadmantimer.h @@ -99,13 +99,10 @@ class LL_COMMON_API LLDeadmanTimer /// during updates. If false, cpu usage data isn't /// collected and will be zero if queried. LLDeadmanTimer(F64 horizon, bool inc_cpu); + ~LLDeadmanTimer() = default; - ~LLDeadmanTimer() - {} - -private: - LLDeadmanTimer(const LLDeadmanTimer &); // Not defined - void operator=(const LLDeadmanTimer &); // Not defined + LLDeadmanTimer(const LLDeadmanTimer &) = delete; + LLDeadmanTimer& operator=(const LLDeadmanTimer&) = delete; public: /// Get the current time. Zero-basis for this time diff --git a/indra/llcommon/lldefs.h b/indra/llcommon/lldefs.h index 232987da14f..0481e45351e 100644 --- a/indra/llcommon/lldefs.h +++ b/indra/llcommon/lldefs.h @@ -28,6 +28,7 @@ #define LL_LLDEFS_H #include "stdtypes.h" +#include #include // Often used array indices @@ -169,6 +170,38 @@ constexpr U32 MAXADDRSTR = 17; // 123.567.901.345 = 15 chars + \0 + // llclampb(a) // clamps a to [0 .. 255] // +// llless(d0, d1) safely compares d0 < d1 even if one is signed and the other +// is unsigned. A simple (d0 < d1) expression converts the signed operand to +// unsigned before comparing. If the signed operand is negative, that flips +// the negative value to a huge positive value, producing the wrong answer! +// llless() specifically addresses that case. +template +constexpr bool llless(T0 d0, T1 d1) +{ + if constexpr (std::is_signed_v && ! std::is_signed_v) + { + // T0 signed, T1 unsigned: negative d0 is less than any unsigned d1 + if (d0 < 0) + return true; + // both are non-negative: explicitly cast to avoid C4018 + return std::make_unsigned_t(d0) < d1; + } + else if constexpr (! std::is_signed_v && std::is_signed_v) + { + // T0 unsigned, T1 signed: any unsigned d0 is greater than negative d1 + if (d1 < 0) + return false; + // both are non-negative: explicitly cast to avoid C4018 + return d0 < std::make_unsigned_t(d1); + } + else + { + // both T0 and T1 are signed, or both are unsigned: + // straightforward comparison works + return d0 < d1; + } +} + // recursion tail template constexpr auto llmax(T data) @@ -180,7 +213,7 @@ template constexpr auto llmax(T0 d0, T1 d1, Ts... rest) { auto maxrest = llmax(d1, rest...); - return (d0 > maxrest)? d0 : maxrest; + return llless(maxrest, d0)? d0 : maxrest; } // recursion tail @@ -194,12 +227,28 @@ template constexpr auto llmin(T0 d0, T1 d1, Ts... rest) { auto minrest = llmin(d1, rest...); - return (d0 < minrest) ? d0 : minrest; + return llless(d0, minrest) ? d0 : minrest; } template constexpr A llclamp(A a, MIN minval, MAX maxval) { + // The only troublesome case is if A is unsigned and either minval or + // maxval is both signed and negative. Casting a negative number to + // unsigned flips it to a huge positive number, making this llclamp() call + // ineffective. + if constexpr (! std::is_signed_v) + { + if constexpr (std::is_signed_v) + { + assert(minval >= 0); + } + if constexpr (std::is_signed_v) + { + assert(maxval >= 0); + } + } + A aminval{ static_cast(minval) }, amaxval{ static_cast(maxval) }; if ( a < aminval ) { @@ -225,7 +274,7 @@ constexpr LLDATATYPE llclampb(LLDATATYPE a) } template -inline void llswap(LLDATATYPE& lhs, LLDATATYPE& rhs) +constexpr void llswap(LLDATATYPE& lhs, LLDATATYPE& rhs) { std::swap(lhs, rhs); } diff --git a/indra/llcommon/lldependencies.h b/indra/llcommon/lldependencies.h index 47b6fedc7d7..a1b5c83caf4 100644 --- a/indra/llcommon/lldependencies.h +++ b/indra/llcommon/lldependencies.h @@ -30,6 +30,7 @@ #if ! defined(LL_LLDEPENDENCIES_H) #define LL_LLDEPENDENCIES_H +#include #include #include #include @@ -38,7 +39,6 @@ #include #include #include -#include #include #include "llexception.h" @@ -217,7 +217,7 @@ class LLDependencies: public LLDependenciesBase /// We have various ways to get the dependencies for a given DepNode. /// Rather than having to restate each one for 'after' and 'before' /// separately, pass a dep_selector so we can apply each to either. - typedef boost::function dep_selector; + typedef std::function dep_selector; public: LLDependencies() {} @@ -340,7 +340,7 @@ class LLDependencies: public LLDependenciesBase public: /// iterator over value_type entries - typedef boost::transform_iterator, + typedef boost::transform_iterator, typename DepNodeMap::iterator> iterator; /// range over value_type entries typedef boost::iterator_range range; @@ -352,7 +352,7 @@ class LLDependencies: public LLDependenciesBase } /// iterator over const_value_type entries - typedef boost::transform_iterator, + typedef boost::transform_iterator, typename DepNodeMap::const_iterator> const_iterator; /// range over const_value_type entries typedef boost::iterator_range const_range; @@ -364,7 +364,7 @@ class LLDependencies: public LLDependenciesBase } /// iterator over stored NODEs - typedef boost::transform_iterator, + typedef boost::transform_iterator, typename DepNodeMap::iterator> node_iterator; /// range over stored NODEs typedef boost::iterator_range node_range; @@ -380,7 +380,7 @@ class LLDependencies: public LLDependenciesBase } /// const iterator over stored NODEs - typedef boost::transform_iterator, + typedef boost::transform_iterator, typename DepNodeMap::const_iterator> const_node_iterator; /// const range over stored NODEs typedef boost::iterator_range const_node_range; @@ -396,7 +396,7 @@ class LLDependencies: public LLDependenciesBase } /// const iterator over stored KEYs - typedef boost::transform_iterator, + typedef boost::transform_iterator, typename DepNodeMap::const_iterator> const_key_iterator; /// const range over stored KEYs typedef boost::iterator_range const_key_range; diff --git a/indra/llcommon/lldoubledispatch.h b/indra/llcommon/lldoubledispatch.h index 25039c3e9c1..ad4dc57d589 100644 --- a/indra/llcommon/lldoubledispatch.h +++ b/indra/llcommon/lldoubledispatch.h @@ -30,9 +30,7 @@ #define LL_LLDOUBLEDISPATCH_H #include -#include -#include -#include +#include /** * This class supports function calls which are virtual on the dynamic type of @@ -156,9 +154,9 @@ class LLDoubleDispatch insert(t1, t2, func); if (symmetrical) { - // Use boost::bind() to construct a param-swapping thunk. Don't + // Use std::bind() to construct a param-swapping thunk. Don't // forget to reverse the parameters too. - insert(t2, t1, boost::bind(func, _2, _1)); + insert(t2, t1, std::bind(func, std::placeholders::_2, std::placeholders::_1)); } } @@ -193,7 +191,7 @@ class LLDoubleDispatch insert(Type(), Type(), func, insertion); if (symmetrical) { - insert(Type(), Type(), boost::bind(func, _2, _1), insertion); + insert(Type(), Type(), std::bind(func, std::placeholders::_2, std::placeholders::_1), insertion); } } @@ -271,8 +269,8 @@ class LLDoubleDispatch typename DispatchTable::iterator find(const ParamBaseType& param1, const ParamBaseType& param2) { return std::find_if(mDispatch.begin(), mDispatch.end(), - boost::bind(&EntryBase::matches, _1, - boost::ref(param1), boost::ref(param2))); + std::bind(&EntryBase::matches, std::placeholders::_1, + std::ref(param1), std::ref(param2))); } /// Look up the first matching entry. diff --git a/indra/llcommon/llerror.cpp b/indra/llcommon/llerror.cpp index 3411e9c6bb5..8ae0fabcc62 100644 --- a/indra/llcommon/llerror.cpp +++ b/indra/llcommon/llerror.cpp @@ -133,6 +133,7 @@ namespace { RecordToFile(const std::string& filename): mName(filename) { + showMultiline(true); mFile.open(filename.c_str(), std::ios_base::out | std::ios_base::app); if (!mFile) { @@ -344,6 +345,51 @@ namespace { } }; #endif + +#if LL_PROFILER_CONFIGURATION >= LL_PROFILER_CONFIG_TRACY + class RecordToTracy : public LLError::Recorder + { + public: + RecordToTracy() + { + this->showMultiline(true); + this->showTags(false); + this->showLocation(false); + } + + virtual bool enabled() override { return LLError::getEnabledLogTypesMask() & 0x12; } + + virtual void recordMessage(LLError::ELevel level, const std::string& message) override + { + LL_PROFILE_ZONE_SCOPED_CATEGORY_LOGGING; + switch (level) + { + case LLError::LEVEL_DEBUG: + { + TracyMessageC(message.c_str(), message.size(), tracy::Color::Turquoise); + break; + } + default: + case LLError::LEVEL_NONE: + case LLError::LEVEL_INFO: + { + TracyMessageC(message.c_str(), message.size(), tracy::Color::White); + break; + } + case LLError::LEVEL_WARN: + { + TracyMessageC(message.c_str(), message.size(), tracy::Color::Yellow); + break; + } + case LLError::LEVEL_ERROR: + { + TracyMessageC(message.c_str(), message.size(), tracy::Color::Red); + break; + } + } + } + }; +#endif } @@ -527,8 +573,8 @@ namespace mFileLevelMap(), mTagLevelMap(), mUniqueLogMessages(), - mCrashFunction(NULL), - mTimeFunction(NULL), + mCrashFunction(nullptr), + mTimeFunction(nullptr), mRecorders(), mShouldLogCallCounter(0) { @@ -759,6 +805,11 @@ namespace LLError::addRecorder(recordToWinDebug); #endif +#if LL_PROFILER_CONFIGURATION >= LL_PROFILER_CONFIG_TRACY + LLError::RecorderPtr recordToTracy(new RecordToTracy()); + LLError::addRecorder(recordToTracy); +#endif + LogControlFile& e = LogControlFile::fromDirectory(user_dir, app_dir); // NOTE: We want to explicitly load the file before we add it to the event timer @@ -1231,7 +1282,7 @@ namespace std::ostringstream message_stream; - if (r->wantsTime() && s->mTimeFunction != NULL) + if (r->wantsTime() && s->mTimeFunction != nullptr) { message_stream << s->mTimeFunction(); } diff --git a/indra/llcommon/llerror.h b/indra/llcommon/llerror.h index 41893a35e56..343cc47e4c3 100644 --- a/indra/llcommon/llerror.h +++ b/indra/llcommon/llerror.h @@ -91,13 +91,8 @@ const int LL_ERR_NOERR = 0; #define llverify(func) do {if (func) {}} while(0) #endif -#ifdef LL_WINDOWS #define LL_STATIC_ASSERT(func, msg) static_assert(func, msg) -#define LL_BAD_TEMPLATE_INSTANTIATION(type, msg) static_assert(false, msg) -#else -#define LL_STATIC_ASSERT(func, msg) BOOST_STATIC_ASSERT(func) -#define LL_BAD_TEMPLATE_INSTANTIATION(type, msg) BOOST_STATIC_ASSERT(sizeof(type) != 0 && false); -#endif +#define LL_BAD_TEMPLATE_INSTANTIATION(type, msg) static_assert(sizeof(type) != 0 && false, msg) /** Error Logging Facility diff --git a/indra/llcommon/llerrorcontrol.h b/indra/llcommon/llerrorcontrol.h index 0a7b3d20461..d254fa54074 100644 --- a/indra/llcommon/llerrorcontrol.h +++ b/indra/llcommon/llerrorcontrol.h @@ -31,7 +31,7 @@ #include "llerror.h" #include "llpointer.h" #include "llrefcount.h" -#include "boost/function.hpp" +#include #include class LLSD; @@ -92,7 +92,7 @@ namespace LLError Control functions. */ - typedef boost::function FatalFunction; + typedef std::function FatalFunction; LL_COMMON_API void setFatalFunction(const FatalFunction&); // The fatal function will be called after an message of LEVEL_ERROR diff --git a/indra/llcommon/lleventdispatcher.h b/indra/llcommon/lleventdispatcher.h index 4c3c0f34148..97a60e2829f 100644 --- a/indra/llcommon/lleventdispatcher.h +++ b/indra/llcommon/lleventdispatcher.h @@ -33,9 +33,7 @@ #define LL_LLEVENTDISPATCHER_H #include -#include #include -#include // until C++17, when we get std::is_invocable #include #include // std::function #include // std::unique_ptr @@ -99,7 +97,7 @@ class LL_COMMON_API LLEventDispatcher template ::value + std::is_invocable::value >::type> void add(const std::string& name, const std::string& desc, @@ -295,9 +293,8 @@ class LL_COMMON_API LLEventDispatcher * converted to the corresponding parameter type using LLSDParam. */ template () - >::type> + typename=typename std::enable_if_t< + ! std::is_invocable()>> void add(const std::string& name, const std::string& desc, CALLABLE&& f) @@ -318,7 +315,7 @@ class LL_COMMON_API LLEventDispatcher */ template::value && + std::is_member_function_pointer::value && ! std::is_convertible::value >::type> void add(const std::string& name, const std::string& desc, Method f, @@ -338,7 +335,7 @@ class LL_COMMON_API LLEventDispatcher template::value && - ! boost::hof::is_invocable::value + ! std::is_invocable::value >::type> void add(const std::string& name, const std::string& desc, Function f, const LLSD& params, const LLSD& defaults=LLSD()); @@ -364,7 +361,7 @@ class LL_COMMON_API LLEventDispatcher */ template::value && + std::is_member_function_pointer::value && ! std::is_convertible::value >::type> void add(const std::string& name, const std::string& desc, Method f, diff --git a/indra/llcommon/lleventfilter.h b/indra/llcommon/lleventfilter.h index d8c7e15a275..8b917c23be1 100644 --- a/indra/llcommon/lleventfilter.h +++ b/indra/llcommon/lleventfilter.h @@ -33,7 +33,8 @@ #include "stdtypes.h" #include "lltimer.h" #include "llsdutil.h" -#include + +#include class LLEventTimer; class LLDate; @@ -92,8 +93,8 @@ class LL_COMMON_API LLEventTimeoutBase: public LLEventFilter /// construct and connect LLEventTimeoutBase(LLEventPump& source); - /// Callable, can be constructed with boost::bind() - typedef boost::function Action; + /// Callable, can be constructed with std::bind() + typedef std::function Action; /** * Start countdown timer for the specified number of @a seconds. Forward diff --git a/indra/llcommon/llevents.cpp b/indra/llcommon/llevents.cpp index 3c6743eac93..9a5324b5987 100644 --- a/indra/llcommon/llevents.cpp +++ b/indra/llcommon/llevents.cpp @@ -44,7 +44,6 @@ #include #include // external library headers -#include #if LL_WINDOWS #pragma warning (push) #pragma warning (disable : 4701) // compiler thinks might use uninitialized var, but no diff --git a/indra/llcommon/llevents.h b/indra/llcommon/llevents.h index 4bf1fa07a2f..18c05a00814 100644 --- a/indra/llcommon/llevents.h +++ b/indra/llcommon/llevents.h @@ -41,11 +41,7 @@ #include #include -#include // noncopyable #include -#include -#include // reference_wrapper -#include #include #include "llsd.h" #include "llsingleton.h" diff --git a/indra/llcommon/llfasttimer.cpp b/indra/llcommon/llfasttimer.cpp index 1c5fe9d2f53..c5a7a0e56b5 100644 --- a/indra/llcommon/llfasttimer.cpp +++ b/indra/llcommon/llfasttimer.cpp @@ -387,6 +387,11 @@ void BlockTimer::logStats() } +#if defined(LL_GNUC) && GCC_VERSION >= 130000 +# pragma GCC diagnostic push +# pragma GCC diagnostic ignored "-Wnonnull" +#endif + //static void BlockTimer::dumpCurTimes() { @@ -418,8 +423,12 @@ void BlockTimer::dumpCurTimes() << num_calls << " calls"; LL_INFOS() << out_str.str() << LL_ENDL; + } } -} + +#if defined(LL_GNUC) && GCC_VERSION >= 130000 +# pragma GCC diagnostic push +#endif //static void BlockTimer::writeLog(std::ostream& os) diff --git a/indra/llcommon/llfindlocale.cpp b/indra/llcommon/llfindlocale.cpp index b4bcc80ac4c..d606a6fdb90 100644 --- a/indra/llcommon/llfindlocale.cpp +++ b/indra/llcommon/llfindlocale.cpp @@ -134,7 +134,7 @@ accumulate_locstring(const char *str, FL_Locale *l) { return 0; } - +#ifndef LL_WINDOWS static int accumulate_env(const char *name, FL_Locale *l) { char *env; @@ -148,7 +148,7 @@ accumulate_env(const char *name, FL_Locale *l) { free(lang); free(country); free(variant); return 0; } - +#endif static void canonise_fl(FL_Locale *l) { diff --git a/indra/llcommon/llhandle.h b/indra/llcommon/llhandle.h index ceea1d9c482..fd7d32e79af 100644 --- a/indra/llcommon/llhandle.h +++ b/indra/llcommon/llhandle.h @@ -31,8 +31,6 @@ #include "llrefcount.h" #include "llexception.h" #include -#include -#include #include /** @@ -90,7 +88,7 @@ class LLHandle LLHandle() : mTombStone(getDefaultTombStone()) {} template - LLHandle(const LLHandle& other, typename boost::enable_if< typename boost::is_convertible >::type* dummy = 0) + LLHandle(const LLHandle& other, typename std::enable_if_t>* dummy = 0) : mTombStone(other.mTombStone) {} @@ -199,7 +197,7 @@ class LLHandleProvider } template - LLHandle getDerivedHandle(typename boost::enable_if< typename boost::is_convertible >::type* dummy = 0) const + LLHandle getDerivedHandle(typename std::enable_if_t >* dummy = 0) const { LLHandle downcast_handle; downcast_handle.mTombStone = getHandle().mTombStone; diff --git a/indra/llcommon/llinitdestroyclass.h b/indra/llcommon/llinitdestroyclass.h index 2354c9f2ed3..7cc9c6b930a 100644 --- a/indra/llcommon/llinitdestroyclass.h +++ b/indra/llcommon/llinitdestroyclass.h @@ -37,7 +37,7 @@ #define LL_LLINITDESTROYCLASS_H #include "llsingleton.h" -#include +#include #include #include #include // std::pair @@ -50,7 +50,7 @@ class LLCallbackRegistry { public: - typedef boost::function func_t; + typedef std::function func_t; void registerCallback(const std::string& name, const func_t& func) { diff --git a/indra/llcommon/llinitparam.h b/indra/llcommon/llinitparam.h index 32d7b17034a..b01ea0bfb1b 100644 --- a/indra/llcommon/llinitparam.h +++ b/indra/llcommon/llinitparam.h @@ -28,11 +28,12 @@ #ifndef LL_LLPARAM_H #define LL_LLPARAM_H +#include +#include #include #include +#include #include -#include -#include #include #include "llerror.h" @@ -105,6 +106,26 @@ namespace LLTypeTags }; } +namespace ll +{ + // Primary template: general case is false + template + struct is_std_function : std::false_type + { + }; + + // Specialization for std::function + // R is the return type, Args is a parameter pack for argument types + template + struct is_std_function> : std::true_type + { + }; + + // Helper variable template for convenience (C++14 onwards) + template + constexpr bool is_std_function_v = is_std_function::value; +} + namespace LLInitParam { // used to indicate no matching value to a given name when parsing @@ -114,7 +135,7 @@ namespace LLInitParam // wraps comparison operator between any 2 values of the same type // specialize to handle cases where equality isn't defined well, or at all - template ::value > + template || ll::is_std_function_v> struct ParamCompare { static bool equals(const T &a, const T &b) @@ -123,7 +144,7 @@ namespace LLInitParam } }; - // boost function types are not comparable + // boost and std function types are not comparable template struct ParamCompare { @@ -474,7 +495,7 @@ namespace LLInitParam typedef bool (*parser_read_func_t)(Parser& parser, void* output); typedef bool (*parser_write_func_t)(Parser& parser, const void*, name_stack_t&); - typedef boost::function parser_inspect_func_t; + typedef std::function parser_inspect_func_t; typedef std::map parser_read_func_map_t; typedef std::map parser_write_func_map_t; @@ -491,7 +512,7 @@ namespace LLInitParam virtual ~Parser(); - template bool readValue(T& param, typename boost::disable_if >::type* dummy = 0) + template bool readValue(T& param, typename std::enable_if_t>* dummy = 0) { parser_read_func_map_t::iterator found_it = mParserReadFuncs->find(&typeid(T)); if (found_it != mParserReadFuncs->end()) @@ -502,7 +523,7 @@ namespace LLInitParam return false; } - template bool readValue(T& param, typename boost::enable_if >::type* dummy = 0) + template bool readValue(T& param, typename std::enable_if_t >* dummy = 0) { parser_read_func_map_t::iterator found_it = mParserReadFuncs->find(&typeid(T)); if (found_it != mParserReadFuncs->end()) diff --git a/indra/llcommon/llinstancetracker.h b/indra/llcommon/llinstancetracker.h index 92b26354a1c..5a7f27e6888 100644 --- a/indra/llcommon/llinstancetracker.h +++ b/indra/llcommon/llinstancetracker.h @@ -28,6 +28,8 @@ #ifndef LL_LLINSTANCETRACKER_H #define LL_LLINSTANCETRACKER_H +#include "llpreprocessor.h" + #include #include #include @@ -244,6 +246,7 @@ class LLInstanceTracker } protected: + LL_UBSAN_SUPRESS_VPTR LLInstanceTracker(const KEY& key) { // We do not intend to manage the lifespan of this object with @@ -482,6 +485,7 @@ class LLInstanceTracker using key_snapshot_of = instance_snapshot_of; protected: + LL_UBSAN_SUPRESS_VPTR LLInstanceTracker() { // Since we do not intend for this shared_ptr to manage lifespan, give diff --git a/indra/llcommon/llkeybind.cpp b/indra/llcommon/llkeybind.cpp index e36c1d0a4cf..abb0df0b87b 100644 --- a/indra/llcommon/llkeybind.cpp +++ b/indra/llcommon/llkeybind.cpp @@ -114,15 +114,6 @@ void LLKeyData::reset() mIgnoreMasks = false; } -LLKeyData& LLKeyData::operator=(const LLKeyData& rhs) -{ - mMouse = rhs.mMouse; - mKey = rhs.mKey; - mMask = rhs.mMask; - mIgnoreMasks = rhs.mIgnoreMasks; - return *this; -} - bool LLKeyData::operator==(const LLKeyData& rhs) { if (mMouse != rhs.mMouse) return false; diff --git a/indra/llcommon/llkeybind.h b/indra/llcommon/llkeybind.h index 1bbb2fadb50..0a9d4600cca 100644 --- a/indra/llcommon/llkeybind.h +++ b/indra/llcommon/llkeybind.h @@ -43,7 +43,6 @@ class LL_COMMON_API LLKeyData bool isEmpty() const; bool empty() const { return isEmpty(); }; void reset(); - LLKeyData& operator=(const LLKeyData& rhs); bool operator==(const LLKeyData& rhs); bool operator!=(const LLKeyData& rhs); diff --git a/indra/llcommon/llleap.cpp b/indra/llcommon/llleap.cpp index ada6b9519e5..1614cc6e57f 100644 --- a/indra/llcommon/llleap.cpp +++ b/indra/llcommon/llleap.cpp @@ -61,7 +61,7 @@ class LLLeapImpl: public LLLeap // Pass it a callback to our connect() method, so it can send events // from a particular LLEventPump to the plugin without having to know // this class or method name. - mListener(new LLLeapListener( + mListener(std::make_unique( [this](LLEventPump& pump, const std::string& listener) { return connect(pump, listener); })) { diff --git a/indra/llcommon/llleaplistener.h b/indra/llcommon/llleaplistener.h index cad4543d02f..f5587d1d68d 100644 --- a/indra/llcommon/llleaplistener.h +++ b/indra/llcommon/llleaplistener.h @@ -13,10 +13,9 @@ #define LL_LLLEAPLISTENER_H #include "lleventapi.h" +#include #include #include -#include -#include /// Listener class implementing LLLeap query/control operations. /// See https://jira.lindenlab.com/jira/browse/DEV-31978. @@ -31,7 +30,7 @@ class LLLeapListener: public LLEventAPI * define the signature for a function that will perform that, and make * our constructor accept such a function. */ - typedef boost::function + typedef std::function ConnectFunc; LLLeapListener(const ConnectFunc& connect); ~LLLeapListener(); diff --git a/indra/llcommon/llmd5.cpp b/indra/llcommon/llmd5.cpp index c8ca586e7fc..b05fd2e21bd 100644 --- a/indra/llcommon/llmd5.cpp +++ b/indra/llcommon/llmd5.cpp @@ -255,13 +255,15 @@ void LLMD5::raw_digest(unsigned char* s) const memcpy(s, digest, 16); /* Flawfinder: ignore */ } -#if LL_DARWIN +#if LL_CLANG #pragma clang diagnostic push #pragma clang diagnostic ignored "-Wdeprecated-declarations" #endif void LLMD5::hex_digest(char* s) const { + if(!s) return; + if (!finalized) { std::cerr << "LLMD5::hex_digest: Can't get digest if you haven't " @@ -278,7 +280,7 @@ void LLMD5::hex_digest(char* s) const s[32] = '\0'; } -#if LL_DARWIN +#if LL_CLANG #pragma clang diagnostic pop #endif diff --git a/indra/llcommon/llmemory.cpp b/indra/llcommon/llmemory.cpp index ba48319a162..9617e30f0b6 100644 --- a/indra/llcommon/llmemory.cpp +++ b/indra/llcommon/llmemory.cpp @@ -146,9 +146,6 @@ void LLMemory::updateMemoryInfo() LL_WARNS() << "task_info failed" << LL_ENDL; } #elif defined(LL_LINUX) - // Use sysinfo() to get the total physical memory. - struct sysinfo info; - sysinfo(&info); sAllocatedMemInKB = U32Kilobytes::convert(U64Bytes(LLMemory::getCurrentRSS())); // represents the RAM allocated by this process only (in line with the windows implementation) #else //not valid for other systems for now. diff --git a/indra/llcommon/llmemory.h b/indra/llcommon/llmemory.h index adc556d180f..a25387d321e 100644 --- a/indra/llcommon/llmemory.h +++ b/indra/llcommon/llmemory.h @@ -48,6 +48,9 @@ class LLMutex ; #define LL_ALIGN_OF __align_of__ #endif +#if defined(LL_X86_64) || defined(LL_ARM64) +#define LL_DEFAULT_HEAP_ALIGN 16 +#else #if LL_WINDOWS #define LL_DEFAULT_HEAP_ALIGN 8 #elif LL_DARWIN @@ -55,7 +58,7 @@ class LLMutex ; #elif LL_LINUX #define LL_DEFAULT_HEAP_ALIGN 8 #endif - +#endif LL_COMMON_API void ll_assert_aligned_func(uintptr_t ptr,U32 alignment); @@ -89,22 +92,6 @@ template T* LL_NEXT_ALIGNED_ADDRESS_64(T* address) (uintptr_t(address) + 0x3F) & ~0x3F); } -#if LL_LINUX || LL_DARWIN - -#define LL_ALIGN_PREFIX(x) -#define LL_ALIGN_POSTFIX(x) __attribute__((aligned(x))) - -#elif LL_WINDOWS - -#define LL_ALIGN_PREFIX(x) __declspec(align(x)) -#define LL_ALIGN_POSTFIX(x) - -#else -#error "LL_ALIGN_PREFIX and LL_ALIGN_POSTFIX undefined" -#endif - -#define LL_ALIGN_16(var) LL_ALIGN_PREFIX(16) var LL_ALIGN_POSTFIX(16) - #define LL_ALIGN_NEW \ public: \ void* operator new(size_t size) \ @@ -127,7 +114,6 @@ public: \ ll_aligned_free_16(ptr); \ } - //------------------------------------------------------------------------------------------------ //------------------------------------------------------------------------------------------------ // for enable buffer overrun detection predefine LL_DEBUG_BUFFER_OVERRUN in current library @@ -143,6 +129,10 @@ public: \ LL_PROFILE_ZONE_SCOPED_CATEGORY_MEMORY; #if defined(LL_WINDOWS) void* ret = _aligned_malloc(size, align); + #elif defined(LL_LINUX) + void *ret; + if (0 != posix_memalign(&ret, align, size)) + return nullptr; #else char* aligned = NULL; void* mem = malloc( size + (align - 1) + sizeof(void*) ); @@ -165,6 +155,8 @@ public: \ LL_PROFILE_FREE(ptr); #if defined(LL_WINDOWS) _aligned_free(ptr); + #elif defined(LL_LINUX) + free(ptr); #else if (ptr) { @@ -179,10 +171,10 @@ public: \ inline void* ll_aligned_malloc_16(size_t size) // returned hunk MUST be freed with ll_aligned_free_16(). { LL_PROFILE_ZONE_SCOPED_CATEGORY_MEMORY; -#if defined(LL_WINDOWS) +#if LL_DEFAULT_HEAP_ALIGN == 16 + void* ret = malloc(size); // default osx and 64-bit malloc is 16 byte aligned. +#elif defined(LL_WINDOWS) void* ret = _aligned_malloc(size, 16); -#elif defined(LL_DARWIN) - void* ret = malloc(size); // default osx malloc is 16 byte aligned. #else void *ret; if (0 != posix_memalign(&ret, 16, size)) @@ -196,10 +188,10 @@ inline void ll_aligned_free_16(void *p) { LL_PROFILE_ZONE_SCOPED_CATEGORY_MEMORY; LL_PROFILE_FREE(p); -#if defined(LL_WINDOWS) +#if LL_DEFAULT_HEAP_ALIGN == 16 + free(p); +#elif defined(LL_WINDOWS) _aligned_free(p); -#elif defined(LL_DARWIN) - return free(p); #else free(p); // posix_memalign() is compatible with heap deallocator #endif @@ -209,10 +201,10 @@ inline void* ll_aligned_realloc_16(void* ptr, size_t size, size_t old_size) // r { LL_PROFILE_ZONE_SCOPED_CATEGORY_MEMORY; LL_PROFILE_FREE(ptr); -#if defined(LL_WINDOWS) +#if LL_DEFAULT_HEAP_ALIGN == 16 + void* ret = realloc(ptr,size); // default osx and 64bit malloc is 16 byte aligned. +#elif defined(LL_WINDOWS) void* ret = _aligned_realloc(ptr, size, 16); -#elif defined(LL_DARWIN) - void* ret = realloc(ptr,size); // default osx malloc is 16 byte aligned. #else //FIXME: memcpy is SLOW void* ret = ll_aligned_malloc_16(size); diff --git a/indra/llcommon/llmutex.h b/indra/llcommon/llmutex.h index 62943845a58..f3615a12705 100644 --- a/indra/llcommon/llmutex.h +++ b/indra/llcommon/llmutex.h @@ -29,7 +29,6 @@ #include "stdtypes.h" #include "llthread.h" -#include #include "mutex.h" #include @@ -249,7 +248,7 @@ class LLMutexTrylock * The constructor handles the lock, and the destructor handles * the unlock. Instances of this class are not thread safe. */ -class LL_COMMON_API LLScopedLock : private boost::noncopyable +class LL_COMMON_API LLScopedLock { public: /** @@ -265,6 +264,12 @@ class LL_COMMON_API LLScopedLock : private boost::noncopyable */ ~LLScopedLock(); + /* + * @brief Non-copyable constructor and operator + */ + LLScopedLock(const LLScopedLock&) = delete; + LLScopedLock& operator=(const LLScopedLock&) = delete; + /** * @brief Check lock. */ diff --git a/indra/llcommon/llpounceable.h b/indra/llcommon/llpounceable.h index 0421ce966a7..e86098f20bc 100644 --- a/indra/llcommon/llpounceable.h +++ b/indra/llcommon/llpounceable.h @@ -36,13 +36,13 @@ #define LL_LLPOUNCEABLE_H #include "llsingleton.h" -#include #include -#include #include #include #include +#include + // Forward declare the user template, since we want to be able to point to it // in some of its implementation classes. template @@ -139,7 +139,7 @@ class LLPounceableQueueImpl // LLPounceable is for an LLPounceable instance on the heap or the stack. // LLPounceable is for a static LLPounceable instance. template -class LLPounceable: public boost::noncopyable +class LLPounceable { private: typedef LLPounceableTraits traits; @@ -158,9 +158,13 @@ class LLPounceable: public boost::noncopyable mEmpty(empty) {} + // Non-copyable + LLPounceable(const LLPounceable&) = delete; + LLPounceable& operator=(const LLPounceable&) = delete; + // make read access to mHeld as cheap and transparent as possible operator T () const { return mHeld; } - typename boost::remove_pointer::type operator*() const { return *mHeld; } + typename std::remove_pointer::type operator*() const { return *mHeld; } typename boost::call_traits::value_type operator->() const { return mHeld; } // uncomment 'explicit' as soon as we allow C++11 compilation /*explicit*/ operator bool() const { return bool(mHeld); } diff --git a/indra/llcommon/llpreprocessor.h b/indra/llcommon/llpreprocessor.h index b2a97345487..104d3cc1868 100644 --- a/indra/llcommon/llpreprocessor.h +++ b/indra/llcommon/llpreprocessor.h @@ -61,35 +61,48 @@ # define LL_UNLIKELY(EXPR) (EXPR) #endif - // Figure out differences between compilers -#if defined(__GNUC__) +#if defined(__MSVC_VER__) || defined(_MSC_VER) + #ifndef LL_MSVC + #define LL_MSVC 1 + #endif + + // Clang CL is MSVC-like but also supports its own macros + #if defined(__clang__) + #ifndef LL_CLANG + #define LL_CLANG 1 + #endif + #endif +#elif defined(__clang__) + #define CLANG_VERSION (__clang_major__ * 10000 \ + + __clang_minor__ * 100 \ + + __clang_patchlevel__) + #ifndef LL_CLANG + #define LL_CLANG 1 + #endif +#elif defined(__GNUC__) #define GCC_VERSION (__GNUC__ * 10000 \ + __GNUC_MINOR__ * 100 \ + __GNUC_PATCHLEVEL__) #ifndef LL_GNUC #define LL_GNUC 1 #endif -#elif defined(__MSVC_VER__) || defined(_MSC_VER) - #ifndef LL_MSVC - #define LL_MSVC 1 - #endif #endif // Set up CPU architecture defines #if LL_MSVC && defined(_M_ARM64) # define LL_ARM64 1 -#elif LL_GNUC && (defined(__arm64__) || defined(__aarch64__)) +#elif (LL_GNUC || LL_CLANG) && (defined(__arm64__) || defined(__aarch64__)) # define LL_ARM64 1 #elif LL_MSVC && _M_X64 # define LL_X86_64 1 # define LL_X86 1 #elif LL_MSVC && _M_IX86 # define LL_X86 1 -#elif LL_GNUC && ( defined(__amd64__) || defined(__x86_64__) ) +#elif (LL_GNUC || LL_CLANG) && ( defined(__amd64__) || defined(__x86_64__) ) # define LL_X86_64 1 # define LL_X86 1 -#elif LL_GNUC && ( defined(__i386__) ) +#elif (LL_GNUC || LL_CLANG) && ( defined(__i386__) ) # define LL_X86 1 #endif @@ -106,16 +119,6 @@ #endif -// Although thread_local is now a standard storage class, we can't just -// #define LL_THREAD_LOCAL as thread_local because the *usage* is different. -// We'll have to take the time to change LL_THREAD_LOCAL declarations by hand. -#if LL_WINDOWS -# define LL_THREAD_LOCAL __declspec(thread) -#else -# define LL_THREAD_LOCAL __thread -#endif - - #if defined(LL_WINDOWS) #define BOOST_REGEX_NO_LIB 1 #define CURL_STATICLIB 1 @@ -140,7 +143,7 @@ #define LL_DLLIMPORT #endif // LL_WINDOWS -#if __clang__ || ! defined(LL_WINDOWS) +#if LL_CLANG || ! defined(LL_WINDOWS) // Only on Windows, and only with the Microsoft compiler (vs. clang) is // wchar_t potentially not a distinct type. #define LL_WCHAR_T_NATIVE 1 @@ -201,6 +204,13 @@ #define LL_PRETTY_FUNCTION __PRETTY_FUNCTION__ #endif +// vptr warning supression funtionality for undefined behavior sanitizer +#if LL_CLANG || LL_GNUC +# define LL_UBSAN_SUPRESS_VPTR __attribute__((no_sanitize("vptr"))) +#else +# define LL_UBSAN_SUPRESS_VPTR +#endif + #if LL_ARM64 #define GLM_FORCE_NEON 1 #else diff --git a/indra/llcommon/llprocess.cpp b/indra/llcommon/llprocess.cpp index 912e596c3f3..706d539df2a 100644 --- a/indra/llcommon/llprocess.cpp +++ b/indra/llcommon/llprocess.cpp @@ -176,14 +176,14 @@ class WritePipeImpl: public LLProcess::WritePipe // In general, our streambuf might contain a number of different // physical buffers; iterate over those. bool keepwriting = true; - for (const_buffer_sequence::const_iterator bufi(bufs.begin()), bufend(bufs.end()); + for (auto bufi(boost::asio::buffer_sequence_begin(bufs)), bufend(boost::asio::buffer_sequence_end(bufs)); bufi != bufend && keepwriting; ++bufi) { // http://www.boost.org/doc/libs/1_49_0_beta1/doc/html/boost_asio/reference/buffer.html#boost_asio.reference.buffer.accessing_buffer_contents // Although apr_file_write() accepts const void*, we // manipulate const char* so we can increment the pointer. - const char* remainptr = boost::asio::buffer_cast(*bufi); - std::size_t remainlen = boost::asio::buffer_size(*bufi); + const char* remainptr = static_cast(bufi->data()); + std::size_t remainlen = bufi->size(); while (remainlen) { // Tackle the current buffer in discrete chunks. On @@ -377,14 +377,14 @@ class ReadPipeImpl: public LLProcess::ReadPipe // In general, the mutable_buffer_sequence returned by prepare() might // contain a number of different physical buffers; iterate over those. std::size_t tocommit(0); - for (mutable_buffer_sequence::const_iterator bufi(bufs.begin()), bufend(bufs.end()); + for (auto bufi(boost::asio::buffer_sequence_begin(bufs)), bufend(boost::asio::buffer_sequence_end(bufs)); bufi != bufend; ++bufi) { // http://www.boost.org/doc/libs/1_49_0_beta1/doc/html/boost_asio/reference/buffer.html#boost_asio.reference.buffer.accessing_buffer_contents - std::size_t toread(boost::asio::buffer_size(*bufi)); + std::size_t toread(bufi->size()); apr_size_t gotten(toread); apr_status_t err = apr_file_read(mPipe, - boost::asio::buffer_cast(*bufi), + bufi->data(), &gotten); // EAGAIN is exactly what we want from a nonblocking pipe. // Rather than waiting for data, it should return immediately. @@ -457,7 +457,8 @@ class ReadPipeImpl: public LLProcess::ReadPipe ("slot", LLSD::Integer(mIndex)) ("name", whichfile(mIndex)) ("desc", mDesc) - ("eof", state == CLOSED)); + ("eof", state == CLOSED) + ("exhst", state == EXHAUSTED)); } return false; @@ -528,18 +529,9 @@ LLProcess::LLProcess(const LLSDOrParams& params): // preserve existing semantics, we promise that mAttached defaults to the // same setting as mAutokill. mAttached(params.attached.isProvided()? params.attached : params.autokill), - mPool(NULL), - mPipes(NSLOTS) + mPool(NULL) { - // Hmm, when you construct a ptr_vector with a size, it merely reserves - // space, it doesn't actually make it that big. Explicitly make it bigger. - // Because of ptr_vector's odd semantics, have to push_back(0) the right - // number of times! resize() wants to default-construct new BasePipe - // instances, which fails because it's pure virtual. But because of the - // constructor call, these push_back() calls should require no new - // allocation. - for (size_t i = 0; i < mPipes.capacity(); ++i) - mPipes.push_back(0); + mPipes.resize(NSLOTS); if (! params.validateBlock(true)) { @@ -751,11 +743,11 @@ LLProcess::LLProcess(const LLSDOrParams& params): apr_file_t* pipe(mProcess.*(members[i])); if (i == STDIN) { - mPipes.replace(i, new WritePipeImpl(desc, pipe)); + mPipes[i] = std::make_unique(desc, pipe); } else { - mPipes.replace(i, new ReadPipeImpl(desc, pipe, FILESLOT(i))); + mPipes[i] = std::make_unique(desc, pipe, FILESLOT(i)); } // Removed temporaily for Xcode 7 build tests: error was: // "error: expression with side effects will be evaluated despite @@ -1063,14 +1055,14 @@ PIPETYPE* LLProcess::getPipePtr(std::string& error, FILESLOT slot) error = STRINGIZE(mDesc << " has no slot " << slot); return NULL; } - if (mPipes.is_null(slot)) + if (!mPipes[slot]) { error = STRINGIZE(mDesc << ' ' << whichfile(slot) << " not a monitored pipe"); return NULL; } // Make sure we dynamic_cast in pointer domain so we can test, rather than // accepting runtime's exception. - PIPETYPE* ppipe = dynamic_cast(&mPipes[slot]); + PIPETYPE* ppipe = dynamic_cast(mPipes[slot].get()); if (! ppipe) { error = STRINGIZE(mDesc << ' ' << whichfile(slot) << " not a " << typeid(PIPETYPE).name()); diff --git a/indra/llcommon/llprocess.h b/indra/llcommon/llprocess.h index cc2d6566fc6..0c71cfc4159 100644 --- a/indra/llcommon/llprocess.h +++ b/indra/llcommon/llprocess.h @@ -31,9 +31,7 @@ #include "llsdparam.h" #include "llexception.h" #include "apr_thread_proc.h" -#include #include -#include #include // std::ostream #if LL_WINDOWS @@ -67,7 +65,7 @@ typedef std::shared_ptr LLProcessPtr; * indra/llcommon/tests/llprocess_test.cpp for an example of waiting for * child-process termination in a standalone test context. */ -class LL_COMMON_API LLProcess: public boost::noncopyable +class LL_COMMON_API LLProcess { LOG_CLASS(LLProcess); public: @@ -542,6 +540,10 @@ class LL_COMMON_API LLProcess: public boost::noncopyable static std::string basename(const std::string& path); static std::string getline(std::istream&); + // Non-copyable + LLProcess(const LLProcess&) = delete; + LLProcess& operator=(const LLProcess&) = delete; + private: /// constructor is private: use create() instead LLProcess(const LLSDOrParams& params); @@ -564,7 +566,7 @@ class LL_COMMON_API LLProcess: public boost::noncopyable bool mAutokill, mAttached; Status mStatus; // explicitly want this ptr_vector to be able to store NULLs - typedef boost::ptr_vector< boost::nullable > PipeVector; + typedef std::vector> PipeVector; PipeVector mPipes; apr_pool_t* mPool; }; diff --git a/indra/llcommon/llprocessor.cpp b/indra/llcommon/llprocessor.cpp index 718f4713213..37d1c60f91e 100644 --- a/indra/llcommon/llprocessor.cpp +++ b/indra/llcommon/llprocessor.cpp @@ -739,32 +739,7 @@ class LLProcessorInfoDarwinImpl : public LLProcessorInfoImpl } } - // *NOTE:Mani - I didn't find any docs that assure me that machdep.cpu.feature_bits will always be - // The feature bits I think it is. Here's a test: -#ifndef LL_RELEASE_FOR_DOWNLOAD - #if defined(__i386__) && defined(__PIC__) - /* %ebx may be the PIC register. */ - #define __cpuid(level, a, b, c, d) \ - __asm__ ("xchgl\t%%ebx, %1\n\t" \ - "cpuid\n\t" \ - "xchgl\t%%ebx, %1\n\t" \ - : "=a" (a), "=r" (b), "=c" (c), "=d" (d) \ - : "0" (level)) - #else - #define __cpuid(level, a, b, c, d) \ - __asm__ ("cpuid\n\t" \ - : "=a" (a), "=b" (b), "=c" (c), "=d" (d) \ - : "0" (level)) - #endif - - unsigned int eax, ebx, ecx, edx; - __cpuid(0x1, eax, ebx, ecx, edx); - if(feature_infos[0] != (S32)edx) - { - LL_WARNS() << "machdep.cpu.feature_bits doesn't match expected cpuid result!" << LL_ENDL; - } -#endif // LL_RELEASE_FOR_DOWNLOAD - + // @TODO: Audit our usage of machdep.cpu.feature_bits. uint64_t ext_feature_info = getSysctlInt64("machdep.cpu.extfeature_bits"); S32 *ext_feature_infos = (S32*)(&ext_feature_info); @@ -808,6 +783,20 @@ class LLProcessorInfoDarwinImpl : public LLProcessorInfoImpl }; #elif LL_LINUX + +// *NOTE:Mani - eww, macros! srry. +#define LLPI_SET_INFO_STRING(llpi_id, cpuinfo_id) \ + if (!cpuinfo[cpuinfo_id].empty()) \ + { setInfo(llpi_id, cpuinfo[cpuinfo_id]);} + +#define LLPI_SET_INFO_INT(llpi_id, cpuinfo_id) \ + {\ + S32 result; \ + if (!cpuinfo[cpuinfo_id].empty() \ + && LLStringUtil::convertToS32(cpuinfo[cpuinfo_id], result)) \ + { setInfo(llpi_id, result);} \ + } + const char CPUINFO_FILE[] = "/proc/cpuinfo"; class LLProcessorInfoLinuxImpl : public LLProcessorInfoImpl @@ -819,8 +808,32 @@ class LLProcessorInfoLinuxImpl : public LLProcessorInfoImpl } virtual ~LLProcessorInfoLinuxImpl() {} + private: + F64 getCPUMaxMHZ() + { + // Nicky: We just look into cpu0. In theory we could iterate over all cores + // "/sys/devices/system/cpu/cpu*/cpufreq/cpuinfo_max_freq" + // But those should not fluctuate that much? + llifstream fIn{ "/sys/devices/system/cpu/cpu0/cpufreq/cpuinfo_max_freq" }; + + if( !fIn.is_open() ) + return 0.0; + + std::string strLine; + fIn >> strLine; + if( strLine.empty() ) + return 0.0l; + + F64 mhz {}; + if( !LLStringUtil::convertToF64(strLine, mhz ) ) + return 0.0; + + mhz = mhz / 1000.0; + return mhz; + } + void get_proc_cpuinfo() { std::map< std::string, std::string > cpuinfo; @@ -855,24 +868,17 @@ class LLProcessorInfoLinuxImpl : public LLProcessorInfoImpl } # if LL_X86 -// *NOTE:Mani - eww, macros! srry. -#define LLPI_SET_INFO_STRING(llpi_id, cpuinfo_id) \ - if (!cpuinfo[cpuinfo_id].empty()) \ - { setInfo(llpi_id, cpuinfo[cpuinfo_id]);} - -#define LLPI_SET_INFO_INT(llpi_id, cpuinfo_id) \ - {\ - S32 result; \ - if (!cpuinfo[cpuinfo_id].empty() \ - && LLStringUtil::convertToS32(cpuinfo[cpuinfo_id], result)) \ - { setInfo(llpi_id, result);} \ + F64 mhzFromSys = getCPUMaxMHZ(); + F64 mhzFromProc {}; + if( !LLStringUtil::convertToF64(cpuinfo["cpu mhz"], mhzFromProc ) ) + mhzFromProc = 0.0; + if (mhzFromSys > 1.0 && mhzFromSys > mhzFromProc ) + { + setInfo( eFrequency, mhzFromSys ); } - - F64 mhz; - if (LLStringUtil::convertToF64(cpuinfo["cpu mhz"], mhz) - && 200.0 < mhz && mhz < 10000.0) + else if ( 200.0 < mhzFromProc && mhzFromProc < 10000.0) { - setInfo(eFrequency,(F64)(mhz)); + setInfo(eFrequency,(F64)(mhzFromProc)); } LLPI_SET_INFO_STRING(eBrandName, "model name"); @@ -882,7 +888,7 @@ class LLProcessorInfoLinuxImpl : public LLProcessorInfoImpl LLPI_SET_INFO_INT(eModel, "model"); - S32 family; + S32 family{}; if (!cpuinfo["cpu family"].empty() && LLStringUtil::convertToS32(cpuinfo["cpu family"], family)) { diff --git a/indra/llcommon/llprocinfo.cpp b/indra/llcommon/llprocinfo.cpp index 69be00e14a0..9fe4af21031 100644 --- a/indra/llcommon/llprocinfo.cpp +++ b/indra/llcommon/llprocinfo.cpp @@ -25,6 +25,7 @@ * $/LicenseInfo$ */ +#include "linden_common.h" #include "llprocinfo.h" diff --git a/indra/llcommon/llprocinfo.h b/indra/llcommon/llprocinfo.h index 59557998127..0fc8b9dbe4a 100644 --- a/indra/llcommon/llprocinfo.h +++ b/indra/llcommon/llprocinfo.h @@ -51,10 +51,10 @@ class LL_COMMON_API LLProcInfo typedef U64 time_type; /// Relative microseconds private: - LLProcInfo(); // Not defined - ~LLProcInfo(); // Not defined - LLProcInfo(const LLProcInfo &); // Not defined - void operator=(const LLProcInfo &); // Not defined + LLProcInfo() = delete; + ~LLProcInfo() = delete; + LLProcInfo(const LLProcInfo&) = delete; + LLProcInfo& operator=(const LLProcInfo&) = delete; public: /// Get accumulated system and user CPU time in diff --git a/indra/llcommon/llprofiler.cpp b/indra/llcommon/llprofiler.cpp index bdddabf9776..b2ac7723d4f 100644 --- a/indra/llcommon/llprofiler.cpp +++ b/indra/llcommon/llprofiler.cpp @@ -25,6 +25,6 @@ * $/LicenseInfo$ */ -#include "linden_common.h" +#include "llpreprocessor.h" #include "TracyClient.cpp" diff --git a/indra/llcommon/llprofiler.h b/indra/llcommon/llprofiler.h index 5fb32d62804..7c77d94475b 100644 --- a/indra/llcommon/llprofiler.h +++ b/indra/llcommon/llprofiler.h @@ -76,7 +76,16 @@ #if defined(LL_PROFILER_CONFIGURATION) && (LL_PROFILER_CONFIGURATION > LL_PROFILER_CONFIG_NONE) #if LL_PROFILER_CONFIGURATION == LL_PROFILER_CONFIG_TRACY || LL_PROFILER_CONFIGURATION == LL_PROFILER_CONFIG_TRACY_FAST_TIMER + #include "llpreprocessor.h" + +#if defined(LL_GNUC) && GCC_VERSION >= 130000 +# pragma GCC diagnostic push +# pragma GCC diagnostic ignored "-Wnonnull" +#endif #include "tracy/Tracy.hpp" +#if defined(LL_GNUC) && GCC_VERSION >= 130000 +# pragma GCC diagnostic push +#endif // Enable RenderDoc labeling //#define LL_PROFILER_ENABLE_RENDER_DOC 0 diff --git a/indra/llcommon/llptrto.cpp b/indra/llcommon/llptrto.cpp index c4528a47a7d..adf636c4d25 100644 --- a/indra/llcommon/llptrto.cpp +++ b/indra/llcommon/llptrto.cpp @@ -31,10 +31,9 @@ // associated header #include "llptrto.h" // STL headers +#include // std headers // external library headers -#include -#include // other Linden headers #include "llmemory.h" @@ -76,27 +75,27 @@ class SubBar: public Bar int main(int argc, char *argv[]) { // test LLPtrTo<> - BOOST_STATIC_ASSERT((boost::is_same::type, LLPointer >::value)); - BOOST_STATIC_ASSERT((boost::is_same::type, LLPointer >::value)); - BOOST_STATIC_ASSERT((boost::is_same::type, LLPointer >::value)); - BOOST_STATIC_ASSERT((boost::is_same::type, Bar*>::value)); - BOOST_STATIC_ASSERT((boost::is_same::type, SubBar*>::value)); - BOOST_STATIC_ASSERT((boost::is_same::type, int*>::value)); + static_assert((std::is_same_v::type, LLPointer >)); + static_assert((std::is_same_v::type, LLPointer >)); + static_assert((std::is_same_v::type, LLPointer >)); + static_assert((std::is_same_v::type, Bar*>)); + static_assert((std::is_same_v::type, SubBar*>)); + static_assert((std::is_same_v::type, int*>)); // Test LLRemovePointer<>. Note that we remove both pointer variants from // each kind of type, regardless of whether the variant makes sense. - BOOST_STATIC_ASSERT((boost::is_same::type, RCFoo>::value)); - BOOST_STATIC_ASSERT((boost::is_same >::type, RCFoo>::value)); - BOOST_STATIC_ASSERT((boost::is_same::type, RCSubFoo>::value)); - BOOST_STATIC_ASSERT((boost::is_same >::type, RCSubFoo>::value)); - BOOST_STATIC_ASSERT((boost::is_same::type, TSRCFoo>::value)); - BOOST_STATIC_ASSERT((boost::is_same >::type, TSRCFoo>::value)); - BOOST_STATIC_ASSERT((boost::is_same::type, Bar>::value)); - BOOST_STATIC_ASSERT((boost::is_same >::type, Bar>::value)); - BOOST_STATIC_ASSERT((boost::is_same::type, SubBar>::value)); - BOOST_STATIC_ASSERT((boost::is_same >::type, SubBar>::value)); - BOOST_STATIC_ASSERT((boost::is_same::type, int>::value)); - BOOST_STATIC_ASSERT((boost::is_same >::type, int>::value)); + static_assert((std::is_same_v::type, RCFoo>)); + static_assert((std::is_same_v >::type, RCFoo>)); + static_assert((std::is_same_v::type, RCSubFoo>)); + static_assert((std::is_same_v >::type, RCSubFoo>)); + static_assert((std::is_same_v::type, TSRCFoo>)); + static_assert((std::is_same_v >::type, TSRCFoo>)); + static_assert((std::is_same_v::type, Bar>)); + static_assert((std::is_same_v >::type, Bar>)); + static_assert((std::is_same_v::type, SubBar>)); + static_assert((std::is_same_v >::type, SubBar>)); + static_assert((std::is_same_v::type, int>)); + static_assert((std::is_same_v >::type, int>)); return 0; } diff --git a/indra/llcommon/llptrto.h b/indra/llcommon/llptrto.h index b57a1ee7f46..24e312559ef 100644 --- a/indra/llcommon/llptrto.h +++ b/indra/llcommon/llptrto.h @@ -35,8 +35,6 @@ #include "llrefcount.h" // LLRefCount #include #include -#include -#include #include // std::shared_ptr, std::unique_ptr #include @@ -58,14 +56,14 @@ struct LLPtrTo /// specialize for subclasses of LLRefCount template -struct LLPtrTo::value >::type> +struct LLPtrTo::value >::type> { typedef LLPointer type; }; /// specialize for subclasses of LLThreadSafeRefCount template -struct LLPtrTo::value >::type> +struct LLPtrTo::value >::type> { typedef LLPointer type; }; @@ -76,7 +74,7 @@ struct LLPtrTo struct LLRemovePointer { - typedef typename boost::remove_pointer::type type; + typedef typename std::remove_pointer::type type; }; /// specialize for LLPointer diff --git a/indra/llcommon/llqueuedthread.h b/indra/llcommon/llqueuedthread.h index 02d3a96fcc2..de50b8ae95e 100644 --- a/indra/llcommon/llqueuedthread.h +++ b/indra/llcommon/llqueuedthread.h @@ -117,11 +117,11 @@ class LL_COMMON_API LLQueuedThread : public LLThread virtual ~LLQueuedThread(); virtual void shutdown(); -private: // No copy constructor or copy assignment - LLQueuedThread(const LLQueuedThread&); - LLQueuedThread& operator=(const LLQueuedThread&); + LLQueuedThread(const LLQueuedThread&) = delete; + LLQueuedThread& operator=(const LLQueuedThread&) = delete; +private: virtual bool runCondition(void); virtual void run(void); virtual void startThread(void); diff --git a/indra/llcommon/llrand.cpp b/indra/llcommon/llrand.cpp index 2c51e6f07f9..513613f543c 100644 --- a/indra/llcommon/llrand.cpp +++ b/indra/llcommon/llrand.cpp @@ -58,9 +58,26 @@ * to restore uniform distribution. */ -// gRandomGenerator is a stateful static object, which is therefore not +// pRandomGenerator is a stateful static object, which is therefore not // inherently thread-safe. -static thread_local LLRandLagFib2281 gRandomGenerator(LLUUID::getRandomSeed()); +//We use a pointer to not construct a huge object in the TLS space, sadly this is necessary +// due to libcef.so on Linux being compiled with TLS model initial-exec (resulting in +// FLAG STATIC_TLS, see readelf libcef.so). CEFs own TLS objects + LLRandLagFib2281 then will exhaust the +// available TLS space, causing media failure. + +static thread_local std::unique_ptr< LLRandLagFib2281 > pRandomGenerator = nullptr; + +namespace { + F64 ll_internal_get_rand() + { + if( !pRandomGenerator ) + { + pRandomGenerator.reset(new LLRandLagFib2281(LLUUID::getRandomSeed( ) )); + } + + return(*pRandomGenerator)(); + } +} // no default implementation, only specific F64 and F32 specializations template @@ -73,7 +90,7 @@ inline F64 ll_internal_random() // CPUs (or at least multi-threaded processes) seem to // occasionally give an obviously incorrect random number -- like // 5^15 or something. Sooooo, clamp it as described above. - F64 rv{ gRandomGenerator() }; + F64 rv{ ll_internal_get_rand() }; if(!((rv >= 0.0) && (rv < 1.0))) return fmod(rv, 1.0); return rv; } @@ -85,7 +102,7 @@ inline F32 ll_internal_random() // Per Monty, it's important to clamp using the correct fmodf() rather // than expanding to F64 for fmod() and then truncating back to F32. Prior // to this change, we were getting sporadic ll_frand() == 1.0 results. - F32 rv{ narrow(gRandomGenerator()) }; + F32 rv{ narrow(ll_internal_get_rand()) }; if(!((rv >= 0.0f) && (rv < 1.0f))) return fmodf(rv, 1.0f); return rv; } diff --git a/indra/llcommon/llrefcount.h b/indra/llcommon/llrefcount.h index 3a253d8fa62..93ca7d1d00b 100644 --- a/indra/llcommon/llrefcount.h +++ b/indra/llcommon/llrefcount.h @@ -26,7 +26,6 @@ #ifndef LLREFCOUNT_H #define LLREFCOUNT_H -#include #include #include "llatomic.h" diff --git a/indra/llcommon/llsd.cpp b/indra/llcommon/llsd.cpp index 77fe545c3f0..ea6d6a308a5 100644 --- a/indra/llcommon/llsd.cpp +++ b/indra/llcommon/llsd.cpp @@ -32,7 +32,6 @@ #include "llbase64.h" #include "llerror.h" -#include "../llmath/llmath.h" #include "llformat.h" #include "llsdserialize.h" #include "stringize.h" @@ -291,10 +290,10 @@ namespace }; LLSD::Boolean ImplReal::asBoolean() const - { return !llisnan(mValue) && mValue != 0.0; } + { return !std::isnan(mValue) && mValue != 0.0; } LLSD::Integer ImplReal::asInteger() const - { return !llisnan(mValue) ? (LLSD::Integer)mValue : 0; } + { return !std::isnan(mValue) ? (LLSD::Integer)mValue : 0; } LLSD::String ImplReal::asString() const { return llformat("%lg", mValue); } diff --git a/indra/llcommon/llsdjson.cpp b/indra/llcommon/llsdjson.cpp index 655869a704f..542a3c26e34 100644 --- a/indra/llcommon/llsdjson.cpp +++ b/indra/llcommon/llsdjson.cpp @@ -33,7 +33,6 @@ #include "llsdutil.h" #include "llerror.h" -#include "../llmath/llmath.h" #include diff --git a/indra/llcommon/llsdparam.cpp b/indra/llcommon/llsdparam.cpp index 3ae153a67c8..caaac3d7629 100644 --- a/indra/llcommon/llsdparam.cpp +++ b/indra/llcommon/llsdparam.cpp @@ -30,7 +30,6 @@ // Project includes #include "llsdparam.h" #include "llsdutil.h" -#include "boost/bind.hpp" static LLInitParam::Parser::parser_read_func_map_t sReadFuncs; static LLInitParam::Parser::parser_write_func_map_t sWriteFuncs; @@ -43,8 +42,6 @@ static const LLSD NO_VALUE_MARKER; LLParamSDParser::LLParamSDParser() : Parser(sReadFuncs, sWriteFuncs, sInspectFuncs) { - using boost::bind; - if (sReadFuncs.empty()) { registerParserFuncs(readFlag, &LLParamSDParser::writeFlag); @@ -97,7 +94,7 @@ void LLParamSDParser::readSD(const LLSD& sd, LLInitParam::BaseBlock& block, bool mNameStack.clear(); setParseSilently(silent); - LLParamSDParserUtilities::readSDValues(boost::bind(&LLParamSDParser::submit, this, boost::ref(block), _1, _2), sd, mNameStack); + LLParamSDParserUtilities::readSDValues(std::bind(&LLParamSDParser::submit, this, std::ref(block), std::placeholders::_1, std::placeholders::_2), sd, mNameStack); //readSDValues(sd, block); } @@ -276,14 +273,14 @@ void LLParamSDParserUtilities::readSDValues(read_sd_cb_t cb, const LLSD& sd, LLI } else if (sd.isUndefined()) { - if (!cb.empty()) + if (cb != nullptr) { cb(NO_VALUE_MARKER, stack); } } else { - if (!cb.empty()) + if (cb != nullptr) { cb(sd, stack); } @@ -333,7 +330,7 @@ namespace LLInitParam if (!p.writeValue(mValue, name_stack_range)) { // otherwise read from LLSD value and serialize out to parser (which could be LLSD, XUI, etc) - LLParamSDParserUtilities::readSDValues(boost::bind(&serializeElement, boost::ref(p), _1, _2), mValue, name_stack_range); + LLParamSDParserUtilities::readSDValues(std::bind(&serializeElement, std::ref(p), std::placeholders::_1, std::placeholders::_2), mValue, name_stack_range); } return true; } diff --git a/indra/llcommon/llsdparam.h b/indra/llcommon/llsdparam.h index 21ebb9a2587..447ba023276 100644 --- a/indra/llcommon/llsdparam.h +++ b/indra/llcommon/llsdparam.h @@ -29,14 +29,14 @@ #define LL_LLSDPARAM_H #include "llinitparam.h" -#include "boost/function.hpp" +#include #include "llfasttimer.h" struct LL_COMMON_API LLParamSDParserUtilities { static LLSD& getSDWriteNode(LLSD& input, LLInitParam::Parser::name_stack_range_t& name_stack_range); - typedef boost::function read_sd_cb_t; + typedef std::function read_sd_cb_t; static void readSDValues(read_sd_cb_t cb, const LLSD& sd, LLInitParam::Parser::name_stack_t& stack); static void readSDValues(read_sd_cb_t cb, const LLSD& sd); }; diff --git a/indra/llcommon/llsdserialize.cpp b/indra/llcommon/llsdserialize.cpp index 37af366a20b..3cc960698eb 100644 --- a/indra/llcommon/llsdserialize.cpp +++ b/indra/llcommon/llsdserialize.cpp @@ -1424,11 +1424,7 @@ S32 LLSDNotationFormatter::format_impl(const LLSD& data, std::ostream& ostr, case LLSD::TypeBoolean: if(mBoolAlpha || -#if( LL_WINDOWS || __GNUC__ > 2) (ostr.flags() & std::ios::boolalpha) -#else - (ostr.flags() & 0x0100) -#endif ) { ostr << (data.asBoolean() @@ -2397,6 +2393,7 @@ U8* unzip_llsdNavMesh( bool& valid, size_t& outsize, std::istream& is, S32 size { case Z_NEED_DICT: ret = Z_DATA_ERROR; + [[fallthrough]]; case Z_DATA_ERROR: case Z_MEM_ERROR: inflateEnd(&strm); diff --git a/indra/llcommon/llsdutil.cpp b/indra/llcommon/llsdutil.cpp index dbd89118c9c..fd014841289 100644 --- a/indra/llcommon/llsdutil.cpp +++ b/indra/llcommon/llsdutil.cpp @@ -503,7 +503,7 @@ bool filter_llsd_with_template( * Helpers for llsd_matches() *****************************************************************************/ // raw data used for LLSD::Type lookup -struct Data +struct LLSDData { LLSD::Type type; const char* name; @@ -534,7 +534,7 @@ class TypeLookup { LL_PROFILE_ZONE_SCOPED; - for (const Data *di(boost::begin(typedata)), *dend(boost::end(typedata)); di != dend; ++di) + for (const LLSDData*di(boost::begin(typedata)), *dend(boost::end(typedata)); di != dend; ++di) { mMap[di->type] = di->name; } diff --git a/indra/llcommon/llsingleton.h b/indra/llcommon/llsingleton.h index b5659e053cb..3fba8602eed 100644 --- a/indra/llcommon/llsingleton.h +++ b/indra/llcommon/llsingleton.h @@ -25,7 +25,6 @@ #ifndef LLSINGLETON_H #define LLSINGLETON_H -#include #include #include #include @@ -43,11 +42,14 @@ #pragma warning(disable : 4506) // no definition for inline function #endif -class LLSingletonBase: private boost::noncopyable +class LLSingletonBase { public: class MasterList; + LLSingletonBase(const LLSingletonBase&) = delete; + LLSingletonBase& operator=(const LLSingletonBase&) = delete; + private: // All existing LLSingleton instances are tracked in this master list. typedef std::list list_t; diff --git a/indra/llcommon/llstl.h b/indra/llcommon/llstl.h index 7d41c42ba7f..779d822970d 100644 --- a/indra/llcommon/llstl.h +++ b/indra/llcommon/llstl.h @@ -35,6 +35,7 @@ #include #include #include +#include #ifdef LL_LINUX // For strcmp @@ -522,18 +523,8 @@ llbind2nd(const _Operation& __oper, const _Tp& __x) inline bool before(const std::type_info* lhs, const std::type_info* rhs) { -#if LL_LINUX && defined(__GNUC__) && ((__GNUC__ < 4) || (__GNUC__ == 4 && __GNUC_MINOR__ < 4)) - // If we're building on Linux with gcc, and it's either gcc 3.x or - // 4.{0,1,2,3}, then we have to use a workaround. Note that we use gcc on - // Mac too, and some people build with gcc on Windows (cygwin or mingw). - // On Linux, different load modules may produce different type_info* - // pointers for the same type. Have to compare name strings to get good - // results. - return strcmp(lhs->name(), rhs->name()) < 0; -#else // not Linux, or gcc 4.4+ // Just use before(), as we normally would return lhs->before(*rhs); -#endif } /** @@ -709,5 +700,208 @@ struct ll_template_cast_impl \ } \ } +//----------------------------------------------- +namespace LL +{ + /** + * @brief A range adapter that provides filtered iteration over a container. + * + * filter_range creates a filtered view of an iterator range using a predicate function. + * Only elements that satisfy the predicate will be accessible when iterating through + * the range. This is useful for processing subsets of containers without copying data. + * + * The class uses boost::filter_iterator internally to provide the filtering functionality. + * + * @tparam Predicate A callable object (function, functor, lambda) that takes an element + * from the iterator range and returns true if the element should be + * included in the filtered range. + * @tparam Iterator The iterator type for the underlying container/range. + * + * Example usage: + * @code + * std::vector numbers = {1, 2, 3, 4, 5, 6, 7, 8, 9, 10}; + * + * // Create a predicate to filter even numbers + * auto is_even = [](int n) { return n % 2 == 0; }; + * + * // Create filtered range using make_filter helper + * auto even_range = LL::make_filter(is_even, numbers.begin(), numbers.end()); + * + * // Iterate through only even numbers + * for (auto value : even_range) { + * std::cout << value << " "; // Prints: 2 4 6 8 10 + * } + * + * // Or manually construct the filter_range + * LL::filter_range::iterator> + * manual_range(is_even, numbers.begin(), numbers.end()); + * @endcode + * + * @note This class provides a lightweight view over the original data. + * No copying of elements occurs, making it efficient for large containers. + * @note The predicate is applied during iteration, so complex predicates may + * impact performance for frequently-accessed ranges. + * @note The underlying container must remain valid for the lifetime of the filter_range. + * + * @see make_filter() for a convenient factory function + * @see boost::filter_iterator for the underlying implementation details + */ + template + class filter_range + { + public: + /// The filtered iterator type - combines predicate with base iterator + using filter_iter = boost::filter_iterator; + + /// Value type of the filtered elements + using value_type = typename std::iterator_traits::value_type; + + /// Iterator type for range-based for loops and STL algorithms + using iterator = filter_iter; + using const_iterator = filter_iter; + + /** + * @brief Constructs a filter_range with the given predicate and iterator range. + * + * @param pred The predicate function/functor to filter elements. + * Must be callable with signature: bool(const value_type&) + * @param begin Iterator to the beginning of the range to filter + * @param end Iterator to the end of the range to filter + * + * @pre begin and end must form a valid iterator range + * @pre pred must be a valid callable that can be invoked with elements from [begin, end) + */ + filter_range(Predicate pred, Iterator begin, Iterator end) + : begin_(pred, begin, end), end_(pred, end, end) {} + + /** + * @brief Returns an iterator to the first element that satisfies the predicate. + * + * @return filter_iter Iterator pointing to the first filtered element, + * or equal to end() if no elements satisfy the predicate. + */ + filter_iter begin() const { return begin_; } + + /** + * @brief Returns an iterator representing the end of the filtered range. + * + * @return filter_iter Past-the-end iterator for the filtered range. + */ + filter_iter end() const { return end_; } + + /** + * @brief Checks if the filtered range is empty. + * + * @return true if no elements in the range satisfy the predicate, false otherwise. + * + * @note This operation has O(1) complexity as it only compares iterators. + */ + bool empty() const { return begin_ == end_; } + + private: + filter_iter begin_; ///< Iterator to first element satisfying predicate + filter_iter end_; ///< Past-the-end iterator for the filtered range + }; + + /** + * @brief Factory function to create a filter_range with automatic template deduction. + * + * This convenience function eliminates the need to explicitly specify template parameters + * when creating a filter_range. The template parameters are automatically deduced from + * the function arguments. + * + * @tparam Predicate Automatically deduced predicate type + * @tparam Iterator Automatically deduced iterator type + * + * @param pred Predicate function/functor for filtering elements + * @param begin Iterator to the beginning of the range + * @param end Iterator to the end of the range + * + * @return filter_range A filter_range object configured with + * the provided predicate and range + * + * Example usage: + * @code + * std::vector words = {"hello", "world", "test", "example"}; + * + * // Filter strings longer than 4 characters + * auto long_words = LL::make_filter( + * [](const std::string& s) { return s.length() > 4; }, + * words.begin(), + * words.end() + * ); + * + * // Use with range-based for loop + * for (const auto& word : long_words) { + * std::cout << word << std::endl; // Prints: hello, world, example + * } + * + * // Use with STL algorithms + * auto count = std::distance(long_words.begin(), long_words.end()); + * std::cout << "Found " << count << " long words." << std::endl; + * @endcode + * + * @note This function is preferred over direct construction of filter_range + * for most use cases due to automatic template parameter deduction. + */ + template + filter_range make_filter(Predicate pred, Iterator begin, Iterator end) + { + return filter_range(pred, begin, end); + } + + /** + * @brief Create a filter_range over an entire container with automatic template deduction. + * + * This convenience function creates a filtered view over an entire container without + * requiring explicit begin() and end() calls. It automatically handles both const and + * non-const containers, preserving constness in the resulting iterator types. + * + * @tparam Predicate Automatically deduced predicate type + * @tparam Container Automatically deduced container type (const or non-const) + * + * @param pred Predicate function/functor for filtering elements + * @param container The container to filter (can be const or non-const) + * + * @return filter_range with appropriate iterator type for the container + * + * Example usage: + * @code + * // Non-const container + * std::vector numbers = {1, 2, 3, 4, 5, 6, 7, 8, 9, 10}; + * auto evens = LL::make_filter([](int n) { return n % 2 == 0; }, numbers); + * + * // Const container + * const std::list words = {"cat", "elephant", "dog", "hippopotamus"}; + * auto long_words = LL::make_filter([](const std::string& s) { return s.size() > 3; }, words); + * + * // Works with any container that supports begin()/end() + * std::set values = {1.1, 2.2, 3.3, 4.4, 5.5}; + * auto large_values = LL::make_filter([](double d) { return d > 3.0; }, values); + * + * // Use with range-based for loops + * for (const auto& word : long_words) { + * std::cout << word << " "; // Prints: elephant hippopotamus + * } + * + * // Chain with STL algorithms + * auto even_count = std::distance(evens.begin(), evens.end()); + * std::cout << "Found " << even_count << " even numbers." << std::endl; + * @endcode + * + * @note This overload automatically calls begin() and end() on the container, + * making it more convenient than the iterator-based version. + * @note The container must remain valid for the lifetime of the returned filter_range. + * @note Constness of the container is preserved in the iterator type. + */ + template + filter_range()))> + make_filter(Predicate pred, Container&& container) + { + return filter_range()))>( + pred, std::begin(container), std::end(container)); + } + +} // namespace LL #endif // LL_LLSTL_H diff --git a/indra/llcommon/llstring.h b/indra/llcommon/llstring.h index db716b1431f..7dd8256e72c 100644 --- a/indra/llcommon/llstring.h +++ b/indra/llcommon/llstring.h @@ -1234,9 +1234,9 @@ void LLStringUtilBase::getTokens(const string_type& string, std::vector > instrp; if (escapes.empty()) - instrp.reset(new LLStringUtilBaseImpl::InString(string.begin(), string.end())); + instrp = std::make_unique>(string.begin(), string.end()); else - instrp.reset(new LLStringUtilBaseImpl::InEscString(string.begin(), string.end(), escapes)); + instrp = std::make_unique>(string.begin(), string.end(), escapes); LLStringUtilBaseImpl::getTokens(*instrp, tokens, drop_delims, keep_delims, quotes); } diff --git a/indra/llcommon/llsys.cpp b/indra/llcommon/llsys.cpp index 270ca400863..9b5dd2df394 100644 --- a/indra/llcommon/llsys.cpp +++ b/indra/llcommon/llsys.cpp @@ -51,9 +51,6 @@ #include #include #include -#include -#include -#include #include "llfasttimer.h" using namespace llsd; @@ -509,57 +506,46 @@ const S32 LLOSInfo::getOSBitness() const return mOSBitness; } -//static -U32 LLOSInfo::getProcessVirtualSizeKB() -{ - U32 virtual_size = 0; -#if LL_LINUX -# define STATUS_SIZE 2048 - LLFILE* status_filep = LLFile::fopen("/proc/self/status", "rb"); - if (status_filep) - { - S32 numRead = 0; - char buff[STATUS_SIZE]; /* Flawfinder: ignore */ +namespace { - size_t nbytes = fread(buff, 1, STATUS_SIZE-1, status_filep); - buff[nbytes] = '\0'; + U32 readFromProcStat( std::string entryName ) + { + U32 val{}; +#if LL_LINUX + constexpr U32 STATUS_SIZE = 2048; - // All these guys return numbers in KB - char *memp = strstr(buff, "VmSize:"); - if (memp) + LLFILE* status_filep = LLFile::fopen("/proc/self/status", "rb"); + if (status_filep) { - numRead += sscanf(memp, "%*s %u", &virtual_size); + char buff[STATUS_SIZE]; /* Flawfinder: ignore */ + + size_t nbytes = fread(buff, 1, STATUS_SIZE-1, status_filep); + buff[nbytes] = '\0'; + + // All these guys return numbers in KB + char *memp = strstr(buff, entryName.c_str()); + if (memp) + { + (void) sscanf(memp, "%*s %u", &val); + } + fclose(status_filep); } - fclose(status_filep); - } #endif - return virtual_size; + return val; + } + } //static -U32 LLOSInfo::getProcessResidentSizeKB() +U32 LLOSInfo::getProcessVirtualSizeKB() { - U32 resident_size = 0; -#if LL_LINUX - LLFILE* status_filep = LLFile::fopen("/proc/self/status", "rb"); - if (status_filep != NULL) - { - S32 numRead = 0; - char buff[STATUS_SIZE]; /* Flawfinder: ignore */ - - size_t nbytes = fread(buff, 1, STATUS_SIZE-1, status_filep); - buff[nbytes] = '\0'; + return readFromProcStat( "VmSize:" ); +} - // All these guys return numbers in KB - char *memp = strstr(buff, "VmRSS:"); - if (memp) - { - numRead += sscanf(memp, "%*s %u", &resident_size); - } - fclose(status_filep); - } -#endif - return resident_size; +//static +U32 LLOSInfo::getProcessResidentSizeKB() +{ + return readFromProcStat( "VmRSS:" ); } //static @@ -722,15 +708,15 @@ class Stats // Store every integer type as LLSD::Integer. template void add(const LLSD::String& name, const T& value, - typename boost::enable_if >::type* = 0) + typename std::enable_if_t >* = 0) { - mStats[name] = LLSD::Integer(value); + mStats[name] = LLSD::Integer(llmin(value, S32_MAX)); } // Store every floating-point type as LLSD::Real. template void add(const LLSD::String& name, const T& value, - typename boost::enable_if >::type* = 0) + typename std::enable_if_t >* = 0) { mStats[name] = LLSD::Real(value); } @@ -833,57 +819,8 @@ void LLMemoryInfo::getAvailableMemoryKB(U32Kilobytes& avail_mem_kb) } #elif LL_LINUX - // mStatsMap is derived from MEMINFO_FILE: - // $ cat /proc/meminfo - // MemTotal: 4108424 kB - // MemFree: 1244064 kB - // Buffers: 85164 kB - // Cached: 1990264 kB - // SwapCached: 0 kB - // Active: 1176648 kB - // Inactive: 1427532 kB - // Active(anon): 529152 kB - // Inactive(anon): 15924 kB - // Active(file): 647496 kB - // Inactive(file): 1411608 kB - // Unevictable: 16 kB - // Mlocked: 16 kB - // HighTotal: 3266316 kB - // HighFree: 721308 kB - // LowTotal: 842108 kB - // LowFree: 522756 kB - // SwapTotal: 6384632 kB - // SwapFree: 6384632 kB - // Dirty: 28 kB - // Writeback: 0 kB - // AnonPages: 528820 kB - // Mapped: 89472 kB - // Shmem: 16324 kB - // Slab: 159624 kB - // SReclaimable: 145168 kB - // SUnreclaim: 14456 kB - // KernelStack: 2560 kB - // PageTables: 5560 kB - // NFS_Unstable: 0 kB - // Bounce: 0 kB - // WritebackTmp: 0 kB - // CommitLimit: 8438844 kB - // Committed_AS: 1271596 kB - // VmallocTotal: 122880 kB - // VmallocUsed: 65252 kB - // VmallocChunk: 52356 kB - // HardwareCorrupted: 0 kB - // HugePages_Total: 0 - // HugePages_Free: 0 - // HugePages_Rsvd: 0 - // HugePages_Surp: 0 - // Hugepagesize: 2048 kB - // DirectMap4k: 434168 kB - // DirectMap2M: 477184 kB - // (could also run 'free', but easier to read a file than run a program) - LLSD statsMap(loadStatsMap()); - - avail_mem_kb = (U32Kilobytes)statsMap["MemFree"].asInteger(); + U64 phys = U64(getpagesize()) * U64(get_avphys_pages()); + avail_mem_kb = U64Bytes(phys); #else //do not know how to collect available memory info for other systems. //leave it blank here for now. @@ -1083,7 +1020,7 @@ LLSD LLMemoryInfo::loadStatsMap() } #elif LL_LINUX - std::ifstream meminfo(MEMINFO_FILE); + llifstream meminfo(MEMINFO_FILE); if (meminfo.is_open()) { // MemTotal: 4108424 kB @@ -1123,9 +1060,10 @@ LLSD LLMemoryInfo::loadStatsMap() LLSD::String key(matched[1].first, matched[1].second); LLSD::String value_str(matched[2].first, matched[2].second); LLSD::Integer value(0); + S64 intval = 0; try { - value = boost::lexical_cast(value_str); + intval = llclamp(boost::lexical_cast(value_str), S32_MIN, S32_MAX); } catch (const boost::bad_lexical_cast&) { @@ -1134,6 +1072,7 @@ LLSD LLMemoryInfo::loadStatsMap() << line << LL_ENDL; continue; } + value = LLSD::Integer(intval); // Store this statistic. stats.add(key, value); } diff --git a/indra/llcommon/llthread.cpp b/indra/llcommon/llthread.cpp index 692941a8920..e1f0d531cf6 100644 --- a/indra/llcommon/llthread.cpp +++ b/indra/llcommon/llthread.cpp @@ -42,6 +42,10 @@ #include #endif +#if LL_DARWIN || LL_LINUX +#include +#endif + #ifdef LL_WINDOWS @@ -56,25 +60,32 @@ typedef struct tagTHREADNAME_INFO DWORD dwFlags; // Reserved for future use, must be zero. } THREADNAME_INFO; #pragma pack(pop) +#endif -void set_thread_name( DWORD dwThreadID, const char* threadName) +void set_thread_name(const char* threadName) { +#if LL_WINDOWS THREADNAME_INFO info; - info.dwType = 0x1000; - info.szName = threadName; - info.dwThreadID = dwThreadID; - info.dwFlags = 0; + info.dwType = 0x1000; + info.szName = threadName; + info.dwThreadID = GetCurrentThreadId(); + info.dwFlags = 0; __try { - ::RaiseException( MS_VC_EXCEPTION, 0, sizeof(info)/sizeof(DWORD), (ULONG_PTR*)&info ); + ::RaiseException(MS_VC_EXCEPTION, 0, sizeof(info) / sizeof(DWORD), (ULONG_PTR*)&info); } - __except(EXCEPTION_CONTINUE_EXECUTION) + __except (EXCEPTION_CONTINUE_EXECUTION) { } -} +#elif LL_DARWIN + std::string truncated_name(std::string_view(threadName).substr(0, 15)); + pthread_setname_np(truncated_name.c_str()); +#elif LL_LINUX + std::string truncated_name(std::string_view(threadName).substr(0, 15)); + pthread_setname_np(pthread_self(), truncated_name.c_str()); #endif - +} //---------------------------------------------------------------------------- // Usage: @@ -148,27 +159,12 @@ LL_COMMON_API bool assert_main_thread() return false; } -// this function has become moot -void LLThread::registerThreadID() {} - // // Handed to the APR thread creation function // void LLThread::threadRun() { -#ifdef LL_WINDOWS - set_thread_name(-1, mName.c_str()); - -#if 0 // probably a bad idea, see usage of SetThreadIdealProcessor in LLWindowWin32) - HANDLE hThread = GetCurrentThread(); - if (hThread) - { - SetThreadAffinityMask(hThread, (DWORD_PTR) 0xFFFFFFFFFFFFFFFE); - } -#endif - -#endif - + set_thread_name(mName.c_str()); LL_PROFILER_SET_THREAD_NAME( mName.c_str() ); // this is the first point at which we're actually running in the new thread diff --git a/indra/llcommon/llthread.h b/indra/llcommon/llthread.h index 8794ac93aac..b97d479abcc 100644 --- a/indra/llcommon/llthread.h +++ b/indra/llcommon/llthread.h @@ -28,10 +28,11 @@ #define LL_LLTHREAD_H #include "llapr.h" -#include "boost/intrusive_ptr.hpp" #include "llrefcount.h" #include +extern void set_thread_name(const char* threadName); + namespace LLTrace { class ThreadRecorder; @@ -86,11 +87,6 @@ class LL_COMMON_API LLThread id_t getID() const { return mID; } - // Called by threads *not* created via LLThread to register some - // internal state used by LLMutex. You must call this once early - // in the running thread to prevent collisions with the main thread. - static void registerThreadID(); - private: bool mPaused; std::thread::native_handle_type mNativeHandle; // for termination in case of issues diff --git a/indra/llcommon/lltracerecording.cpp b/indra/llcommon/lltracerecording.cpp index c23adca7e86..f010f0e9615 100644 --- a/indra/llcommon/lltracerecording.cpp +++ b/indra/llcommon/lltracerecording.cpp @@ -32,11 +32,6 @@ #include "lltracethreadrecorder.h" #include "llthread.h" -inline F64 lerp(F64 a, F64 b, F64 u) -{ - return a + ((b - a) * u); -} - namespace LLTrace { @@ -302,7 +297,7 @@ F64 Recording::getMean( const StatType& stat ) { t = (F64)active_accumulator->getSampleCount() / (F64)div; } - return lerp(accumulator.getMean(), active_accumulator->getMean(), t); + return std::lerp(accumulator.getMean(), active_accumulator->getMean(), t); } else { @@ -388,7 +383,7 @@ F64 Recording::getMean( const StatType& stat ) { t = (F64)active_accumulator->getSampleCount() / (F64)div; } - return lerp(accumulator.getMean(), active_accumulator->getMean(), t); + return std::lerp(accumulator.getMean(), active_accumulator->getMean(), t); } else { diff --git a/indra/llcommon/lltreeiterators.h b/indra/llcommon/lltreeiterators.h index cef501b9874..cc13955d2f4 100644 --- a/indra/llcommon/lltreeiterators.h +++ b/indra/llcommon/lltreeiterators.h @@ -60,10 +60,10 @@ #define LL_LLTREEITERATORS_H #include "llptrto.h" +#include #include #include #include -#include #include namespace LLTreeIter @@ -93,7 +93,7 @@ class LLBaseIter: public boost::iterator_facade::type ptr_type; /// function that advances from this node to next accepts a node pointer /// and returns another - typedef boost::function func_type; + typedef std::function func_type; typedef SELFTYPE self_type; }; @@ -330,7 +330,7 @@ class LLTreeDFSIter: public LLBaseIter, NODE> typedef typename super::ptr_type ptr_type; // The func_type is different for this: from a NODE pointer, we must // obtain a CHILDITER. - typedef boost::function func_type; + typedef std::function func_type; private: typedef std::vector list_type; public: @@ -435,7 +435,7 @@ class LLTreeDFSPostIter: public LLBaseIter, N typedef typename super::ptr_type ptr_type; // The func_type is different for this: from a NODE pointer, we must // obtain a CHILDITER. - typedef boost::function func_type; + typedef std::function func_type; private: // Upon reaching a given node in our pending list, we need to know whether // we've already pushed that node's children, so we must associate a bool @@ -574,7 +574,7 @@ class LLTreeBFSIter: public LLBaseIter, NODE> typedef typename super::ptr_type ptr_type; // The func_type is different for this: from a NODE pointer, we must // obtain a CHILDITER. - typedef boost::function func_type; + typedef std::function func_type; private: // We need a FIFO queue rather than a LIFO stack. Use a deque rather than // a vector, since vector can't implement pop_front() efficiently. diff --git a/indra/llcommon/lluriparser.cpp b/indra/llcommon/lluriparser.cpp index 33a48d970db..1d246bb70e1 100644 --- a/indra/llcommon/lluriparser.cpp +++ b/indra/llcommon/lluriparser.cpp @@ -33,7 +33,7 @@ LLUriParser::LLUriParser(const std::string& u) : mTmpScheme(false), mNormalizedT { if (u.find("://") == std::string::npos) { - mNormalizedUri = "http://"; + mNormalizedUri = "https://"; mTmpScheme = true; } diff --git a/indra/llcommon/stdtypes.h b/indra/llcommon/stdtypes.h index f1e4c2bc784..6b98a6bc49b 100644 --- a/indra/llcommon/stdtypes.h +++ b/indra/llcommon/stdtypes.h @@ -38,6 +38,11 @@ typedef signed short S16; typedef unsigned short U16; typedef signed int S32; typedef unsigned int U32; +typedef long long int S64; +typedef long long unsigned int U64; + +#define S64L(a) (a##LL) +#define U64L(a) (a##ULL) // to express an index that might go negative // (ssize_t is provided by SOME compilers, don't collide) @@ -62,21 +67,6 @@ typedef wchar_t llwchar; #define LLWCHAR_IS_WCHAR_T 1 #endif -#if LL_WINDOWS -typedef signed __int64 S64; -// probably should be 'hyper' or similiar -#define S64L(a) (a) -typedef unsigned __int64 U64; -#define U64L(a) (a) -#else -typedef long long int S64; -typedef long long unsigned int U64; -#if LL_DARWIN || LL_LINUX -#define S64L(a) (a##LL) -#define U64L(a) (a##ULL) -#endif -#endif - typedef float F32; typedef double F64; @@ -121,10 +111,6 @@ typedef U8 LLPCode; #define LL_ARRAY_SIZE( _kArray ) ( sizeof( (_kArray) ) / sizeof( _kArray[0] ) ) -#if LL_LINUX && __GNUC__ <= 2 -typedef int intptr_t; -#endif - /***************************************************************************** * Narrowing *****************************************************************************/ diff --git a/indra/llcommon/tests/commonmisc_test.cpp b/indra/llcommon/tests/commonmisc_test.cpp index b1a284225e4..80be26dfeb6 100644 --- a/indra/llcommon/tests/commonmisc_test.cpp +++ b/indra/llcommon/tests/commonmisc_test.cpp @@ -503,7 +503,7 @@ namespace tut result_str = (const char*) result; ensure_equals("U64_to_str converted 1.4", val_str, result_str); - val = U64L(-1); // 0xFFFFFFFFFFFFFFFF == 18446744073709551615 + val = U64(-1); // 0xFFFFFFFFFFFFFFFF == 18446744073709551615 val_str = "18446744073709551615"; U64_to_str(val, result, sizeof(result)); result_str = (const char*) result; @@ -619,7 +619,7 @@ namespace tut val = U64_to_F64(U64L(2)); ensure_equals("U64_to_F64 converted 3.6", val, result); - result = U64L(0x7FFFFFFFFFFFFFFF) * 1.0L; // 0x7FFFFFFFFFFFFFFF + result = F64(0x7FFFFFFFFFFFFFFF) * 1.0; // 0x7FFFFFFFFFFFFFFF val = U64_to_F64(U64L(0x7FFFFFFFFFFFFFFF)); ensure_equals("U64_to_F64 converted 3.7", val, result); } diff --git a/indra/llcommon/tests/lldependencies_test.cpp b/indra/llcommon/tests/lldependencies_test.cpp index 84eb41b5fea..fd554005a35 100644 --- a/indra/llcommon/tests/lldependencies_test.cpp +++ b/indra/llcommon/tests/lldependencies_test.cpp @@ -31,7 +31,6 @@ #include // std headers // external library headers -#include // Precompiled header #include "linden_common.h" // associated header @@ -106,8 +105,6 @@ std::ostream& operator<<(std::ostream& out, const std::set& set) /***************************************************************************** * Other helpers *****************************************************************************/ -using boost::assign::list_of; - typedef LLDependencies<> StringDeps; typedef StringDeps::KeyList StringList; @@ -165,7 +162,7 @@ namespace tut // The quick brown fox jumps over the lazy yellow dog. // (note, "The" and "the" are distinct, else this test wouldn't work) deps.add("lazy"); - ensure_equals(sorted_keys(deps), make(list_of("lazy"))); + ensure_equals(sorted_keys(deps), StringList{"lazy"}); deps.add("jumps"); ensure("found lazy", deps.get("lazy")); ensure("not found dog.", ! deps.get("dog.")); @@ -175,24 +172,23 @@ namespace tut // A change to the implementation of boost::topological_sort() would // be an acceptable reason, and you can simply update the expected // test output. - ensure_equals(sorted_keys(deps), make(list_of("lazy")("jumps"))); - deps.add("The", 0, empty, list_of("fox")("dog.")); + ensure_equals(sorted_keys(deps), StringList{ "lazy", "jumps" }); + deps.add("The", 0, empty, { "fox", "dog." }); // Test key accessors ensure("empty before deps for missing key", is_empty(deps.get_before_range("bogus"))); ensure("empty before deps for jumps", is_empty(deps.get_before_range("jumps"))); - ensure_equals(instance_from_range< std::set >(deps.get_before_range("The")), - make< std::set >(list_of("dog.")("fox"))); + ensure_equals(instance_from_range< std::set >(deps.get_before_range("The")), std::set{ "dog.", "fox" }); // resume building dependencies - ensure_equals(sorted_keys(deps), make(list_of("lazy")("jumps")("The"))); - deps.add("the", 0, list_of("The")); - ensure_equals(sorted_keys(deps), make(list_of("lazy")("jumps")("The")("the"))); - deps.add("fox", 0, list_of("The"), list_of("jumps")); - ensure_equals(sorted_keys(deps), make(list_of("lazy")("The")("the")("fox")("jumps"))); - deps.add("the", 0, list_of("The")); // same, see if cache works - ensure_equals(sorted_keys(deps), make(list_of("lazy")("The")("the")("fox")("jumps"))); - deps.add("jumps", 0, empty, list_of("over")); // update jumps deps - ensure_equals(sorted_keys(deps), make(list_of("lazy")("The")("the")("fox")("jumps"))); -/*==========================================================================*| + ensure_equals(sorted_keys(deps), StringList{ "lazy", "jumps", "The" }); + deps.add("the", 0, { "The" }); + ensure_equals(sorted_keys(deps), StringList{ "lazy", "jumps", "The", "the" }); + deps.add("fox", 0, { "The" }, { "jumps" }); + ensure_equals(sorted_keys(deps), StringList{ "lazy", "The", "the", "fox", "jumps" }); + deps.add("the", 0, { "The" }); // same, see if cache works + ensure_equals(sorted_keys(deps), StringList{ "lazy", "The", "the", "fox", "jumps" }); + deps.add("jumps", 0, empty, { "over" }); // update jumps deps + ensure_equals(sorted_keys(deps), StringList{ "lazy", "The", "the", "fox", "jumps" }); + /*==========================================================================*| // It drives me nuts that this test doesn't work in the test // framework, because -- for reasons unknown -- running the test // framework on Mac OS X 10.5 Leopard and Windows XP Pro, the catch @@ -216,36 +212,23 @@ namespace tut deps.remove("over"); } |*==========================================================================*/ - deps.add("dog.", 0, list_of("yellow")("lazy")); - ensure_equals(instance_from_range< std::set >(deps.get_after_range("dog.")), - make< std::set >(list_of("lazy")("yellow"))); - ensure_equals(sorted_keys(deps), make(list_of("lazy")("The")("the")("fox")("jumps")("dog."))); - deps.add("quick", 0, list_of("The"), list_of("fox")("brown")); - ensure_equals(sorted_keys(deps), make(list_of("lazy")("The")("the")("quick")("fox")("jumps")("dog."))); - deps.add("over", 0, list_of("jumps"), list_of("yellow")("the")); - ensure_equals(sorted_keys(deps), make(list_of("lazy")("The")("quick")("fox")("jumps")("over")("the")("dog."))); - deps.add("yellow", 0, list_of("the"), list_of("lazy")); - ensure_equals(sorted_keys(deps), make(list_of("The")("quick")("fox")("jumps")("over")("the")("yellow")("lazy")("dog."))); + deps.add("dog.", 0, { "yellow", "lazy" }); + ensure_equals(instance_from_range< std::set >(deps.get_after_range("dog.")), std::set{ "lazy", "yellow" }); + ensure_equals(sorted_keys(deps), StringList{ "lazy", "The", "the", "fox", "jumps", "dog." }); + deps.add("quick", 0, { "The" }, { "fox", "brown" }); + ensure_equals(sorted_keys(deps), StringList{ "lazy", "The", "the", "quick", "fox", "jumps", "dog." }); + deps.add("over", 0, { "jumps" }, { "yellow", "the" }); + ensure_equals(sorted_keys(deps), StringList{ "lazy", "The", "quick", "fox", "jumps", "over", "the", "dog." }); + deps.add("yellow", 0, { "the" }, { "lazy" }); + ensure_equals(sorted_keys(deps), StringList{ "The", "quick", "fox", "jumps", "over", "the", "yellow", "lazy", "dog." }); deps.add("brown"); // By now the dependencies are pretty well in place. A change to THIS // order should be viewed with suspicion. - ensure_equals(sorted_keys(deps), make(list_of("The")("quick")("brown")("fox")("jumps")("over")("the")("yellow")("lazy")("dog."))); + ensure_equals(sorted_keys(deps), StringList{ "The", "quick", "brown", "fox", "jumps", "over", "the", "yellow", "lazy", "dog." }); - StringList keys(make(list_of("The")("brown")("dog.")("fox")("jumps")("lazy")("over")("quick")("the")("yellow"))); + StringList keys(StringList{ "The", "brown", "dog.", "fox", "jumps", "lazy", "over", "quick", "the", "yellow" }); ensure_equals(instance_from_range(deps.get_key_range()), keys); -#if (! defined(__GNUC__)) || (__GNUC__ > 3) || (__GNUC__ == 3 && __GNUC_MINOR__ > 3) - // This is the succinct way, works on modern compilers ensure_equals(instance_from_range(make_transform_range(deps.get_range(), extract_key)), keys); -#else // gcc 3.3 - StringDeps::range got_range(deps.get_range()); - StringDeps::iterator kni = got_range.begin(), knend = got_range.end(); - StringList::iterator ki = keys.begin(), kend = keys.end(); - for ( ; kni != knend && ki != kend; ++kni, ++ki) - { - ensure_equals(kni->first, *ki); - } - ensure("get_range() returns proper length", kni == knend && ki == kend); -#endif // gcc 3.3 // blow off get_node_range() because they're all LLDependenciesEmpty instances } @@ -255,9 +238,9 @@ namespace tut typedef LLDependencies NameIndexDeps; NameIndexDeps nideps; const NameIndexDeps& const_nideps(nideps); - nideps.add("def", 2, list_of("ghi")); + nideps.add("def", 2, { "ghi" }); nideps.add("ghi", 3); - nideps.add("abc", 1, list_of("def")); + nideps.add("abc", 1, { "def" }); NameIndexDeps::range range(nideps.get_range()); ensure_equals(range.begin()->first, "abc"); ensure_equals(range.begin()->second, 1); @@ -269,20 +252,20 @@ namespace tut ensure_equals(const_iterator->first, "def"); ensure_equals(const_iterator->second, 2); // NameIndexDeps::node_range node_range(nideps.get_node_range()); -// ensure_equals(instance_from_range >(node_range), make< std::vector >(list_of(1)(2)(3))); +// ensure_equals(instance_from_range >(node_range), make< std::vector >(list_of(1,2,3))); // *node_range.begin() = 0; // *node_range.begin() = 1; NameIndexDeps::const_node_range const_node_range(const_nideps.get_node_range()); - ensure_equals(instance_from_range >(const_node_range), make< std::vector >(list_of(1)(2)(3))); + ensure_equals(instance_from_range>(const_node_range), std::vector{ 1, 2, 3 }); NameIndexDeps::const_key_range const_key_range(const_nideps.get_key_range()); - ensure_equals(instance_from_range(const_key_range), make(list_of("abc")("def")("ghi"))); + ensure_equals(instance_from_range(const_key_range), StringList{ "abc", "def", "ghi" }); NameIndexDeps::sorted_range sorted(const_nideps.sort()); NameIndexDeps::sorted_iterator sortiter(sorted.begin()); ensure_equals(sortiter->first, "ghi"); ensure_equals(sortiter->second, 3); // test all iterator-flavored versions of get_after_range() - StringList def(make(list_of("def"))); + StringList def{"def"}; ensure("empty abc before list", is_empty(nideps.get_before_range(nideps.get_range().begin()))); ensure_equals(instance_from_range(nideps.get_after_range(nideps.get_range().begin())), def); @@ -296,7 +279,6 @@ namespace tut def); // advance from "ghi" to "def", which must come after "ghi" ++sortiter; - ensure_equals(instance_from_range(const_nideps.get_after_range(sortiter)), - make(list_of("ghi"))); + ensure_equals(instance_from_range(const_nideps.get_after_range(sortiter)), StringList{ "ghi" }); } } // namespace tut diff --git a/indra/llcommon/tests/llerror_test.cpp b/indra/llcommon/tests/llerror_test.cpp index 3ec429530cd..653f64f1b66 100644 --- a/indra/llcommon/tests/llerror_test.cpp +++ b/indra/llcommon/tests/llerror_test.cpp @@ -59,8 +59,10 @@ static const char* FieldName[] = namespace { -#ifdef __clang__ +#if defined(LL_CLANG) # pragma clang diagnostic ignored "-Wunused-function" +#elif defined(LL_GNUC) +# pragma GCC diagnostic ignored "-Wunused-function" #endif void test_that_error_h_includes_enough_things_to_compile_a_message() { diff --git a/indra/llcommon/tests/lleventdispatcher_test.cpp b/indra/llcommon/tests/lleventdispatcher_test.cpp index 44f772e3220..8b206f7b14c 100644 --- a/indra/llcommon/tests/lleventdispatcher_test.cpp +++ b/indra/llcommon/tests/lleventdispatcher_test.cpp @@ -33,7 +33,6 @@ #include #include -#include #include #include diff --git a/indra/llcommon/tests/llprocess_test.cpp b/indra/llcommon/tests/llprocess_test.cpp index 13422612d67..cdf9f70b6e1 100644 --- a/indra/llcommon/tests/llprocess_test.cpp +++ b/indra/llcommon/tests/llprocess_test.cpp @@ -21,7 +21,6 @@ // external library headers #include "llapr.h" #include "apr_thread_proc.h" -#include #include #include // other Linden headers @@ -95,7 +94,7 @@ static std::string readfile(const std::string& pathname, const std::string& desc { use_desc = "in " + pathname; } - std::ifstream inf(pathname.c_str()); + llifstream inf(pathname.c_str()); std::string output; if (!std::getline(inf, output)) { @@ -126,6 +125,8 @@ void waitfor(LLProcess& proc, int timeout=60) { yield(); } + // Pump once more after the process exits to flush any final events such as EOF. + yield(0); std::string msg = "process took longer than " + std::to_string(timeout) + " seconds to terminate"; tut::ensure(msg, i < timeout); } @@ -137,6 +138,8 @@ void waitfor(LLProcess::handle h, const std::string& desc, int timeout=60) { yield(); } + // Pump once more after the process exits to flush any final events such as EOF. + yield(0); std::string msg = "process took longer than " + std::to_string(timeout) + " seconds to terminate"; tut::ensure(msg, i < timeout); } @@ -182,7 +185,7 @@ struct PythonProcessLauncher const char* APR_LOG = getenv("APR_LOG"); if (APR_LOG && *APR_LOG) { - std::ifstream inf(APR_LOG); + llifstream inf(APR_LOG); if (! inf.is_open()) { LL_WARNS() << "Couldn't open '" << APR_LOG << "'" << LL_ENDL; @@ -260,9 +263,12 @@ static std::string python_out(const std::string& desc, const CONTENT& script) } /// Create a temporary directory and clean it up later. -class NamedTempDir: public boost::noncopyable +class NamedTempDir { public: + NamedTempDir(const NamedTempDir&) = delete; + NamedTempDir& operator=(const NamedTempDir&) = delete; + NamedTempDir(): mPath(NamedTempFile::temp_path()), mCreated(boost::filesystem::create_directories(mPath)) @@ -834,7 +840,7 @@ namespace tut // How do we know it's not terminated? By making it respond to // a specific stimulus in a specific way. { - std::ofstream outf(to.getName().c_str()); + llofstream outf(to.getName().c_str()); outf << "go"; } // flush and close. // now wait for the script to terminate... one way or another. @@ -897,7 +903,7 @@ namespace tut // How do we know it's not terminated? By making it respond to // a specific stimulus in a specific way. { - std::ofstream outf(to.getName().c_str()); + llofstream outf(to.getName().c_str()); outf << "go"; } // flush and close. // now wait for the script to terminate... one way or another. @@ -1091,8 +1097,11 @@ namespace tut ensure_equals("bad child exit code", py.mPy->getStatus().mData, 0); } - struct EventListener: public boost::noncopyable + struct EventListener { + EventListener(const EventListener&) = delete; + EventListener& operator=(const EventListener&) = delete; + EventListener(LLEventPump& pump) { mConnection = @@ -1203,8 +1212,8 @@ namespace tut { set_test_name("ReadPipe \"eof\" event"); PythonProcessLauncher py(get_test_name(), - "from __future__ import print_function\n" - "print('Hello from Python!')\n"); + "import time\n" + "time.sleep(1.5)\n"); py.mParams.files.add(LLProcess::FileParam()); // stdin py.mParams.files.add(LLProcess::FileParam("pipe")); // stdout py.launch(); diff --git a/indra/llcommon/tests/llsdserialize_test.cpp b/indra/llcommon/tests/llsdserialize_test.cpp index fae9f7023f4..ee315051d8d 100644 --- a/indra/llcommon/tests/llsdserialize_test.cpp +++ b/indra/llcommon/tests/llsdserialize_test.cpp @@ -2117,7 +2117,7 @@ namespace tut " f.write(lenformat.pack(len(serialized)))\n" " f.write(serialized)\n";}); - std::ifstream inf(file.getName().c_str()); + llifstream inf(file.getName().c_str()); LLSD item; try { diff --git a/indra/llcommon/tests/llstring_test.cpp b/indra/llcommon/tests/llstring_test.cpp index b18712b8e9e..3c9d8071ac6 100644 --- a/indra/llcommon/tests/llstring_test.cpp +++ b/indra/llcommon/tests/llstring_test.cpp @@ -28,13 +28,10 @@ #include "linden_common.h" -#include #include "../llstring.h" #include "StringVec.h" // must come BEFORE lltut.h #include "../test/lltut.h" -using boost::assign::list_of; - namespace tut { struct string_index @@ -377,7 +374,7 @@ namespace tut { F32 value; std::string str_val("2147483647"); //0x7FFFFFFF - ensure("1: convertToF32 failed", LLStringUtil::convertToF32(str_val, value) && value == 2147483647); + ensure("1: convertToF32 failed", LLStringUtil::convertToF32(str_val, value) && value == 2147483647.f); str_val = "0"; ensure("2: convertToF32 failed", LLStringUtil::convertToF32(str_val, value) && value == 0); @@ -399,7 +396,7 @@ namespace tut { F64 value; std::string str_val("9223372036854775807"); //0x7FFFFFFFFFFFFFFF - ensure("1: convertToF64 failed", LLStringUtil::convertToF64(str_val, value) && value == 9223372036854775807LL); + ensure("1: convertToF64 failed", LLStringUtil::convertToF64(str_val, value) && value == 9223372036854775807.0); str_val = "0"; ensure("2: convertToF64 failed", LLStringUtil::convertToF64(str_val, value) && value == 0.0F); @@ -763,14 +760,14 @@ namespace tut ensure_equals("only delims", LLStringUtil::getTokens(" \r\n ", " \r\n"), StringVec()); ensure_equals("sequence of delims", - LLStringUtil::getTokens(",,, one ,,,", ","), list_of("one")); + LLStringUtil::getTokens(",,, one ,,,", ","), StringVec{"one"}); // nat considers this a dubious implementation side effect, but I'd // hate to change it now... ensure_equals("noncontiguous tokens", - LLStringUtil::getTokens(", ,, , one ,,,", ","), list_of("")("")("one")); + LLStringUtil::getTokens(", ,, , one ,,,", ","), StringVec{ "", "", "one" }); ensure_equals("space-padded tokens", - LLStringUtil::getTokens(", one , two ,", ","), list_of("one")("two")); - ensure_equals("no delims", LLStringUtil::getTokens("one", ","), list_of("one")); + LLStringUtil::getTokens(", one , two ,", ","), StringVec{"one", "two"}); + ensure_equals("no delims", LLStringUtil::getTokens("one", ","), StringVec{ "one" }); } // Shorthand for verifying that getTokens() behaves the same when you @@ -817,39 +814,33 @@ namespace tut ensure_getTokens("only delims", " \r\n ", " \r\n", "", StringVec()); ensure_getTokens("sequence of delims", - ",,, one ,,,", ", ", "", list_of("one")); + ",,, one ,,,", ", ", "", StringVec{"one"}); // Note contrast with the case in the previous method ensure_getTokens("noncontiguous tokens", - ", ,, , one ,,,", ", ", "", list_of("one")); + ", ,, , one ,,,", ", ", "", StringVec{"one"}); ensure_getTokens("space-padded tokens", ", one , two ,", ", ", "", - list_of("one")("two")); - ensure_getTokens("no delims", "one", ",", "", list_of("one")); + StringVec{"one", "two"}); + ensure_getTokens("no delims", "one", ",", "", StringVec{ "one" }); // drop_delims vs. keep_delims ensure_getTokens("arithmetic", - " ab+def / xx* yy ", " ", "+-*/", - list_of("ab")("+")("def")("/")("xx")("*")("yy")); + " ab+def / xx* yy ", " ", "+-*/", { "ab", "+", "def", "/", "xx", "*", "yy" }); // quotes ensure_getTokens("no quotes", - "She said, \"Don't go.\"", " ", ",", "", - list_of("She")("said")(",")("\"Don't")("go.\"")); + "She said, \"Don't go.\"", " ", ",", "", { "She", "said", ",", "\"Don't", "go.\"" }); ensure_getTokens("quotes", - "She said, \"Don't go.\"", " ", ",", "\"", - list_of("She")("said")(",")("Don't go.")); + "She said, \"Don't go.\"", " ", ",", "\"", { "She", "said", ",", "Don't go." }); ensure_getTokens("quotes and delims", "run c:/'Documents and Settings'/someone", " ", "", "'", - list_of("run")("c:/Documents and Settings/someone")); + { "run", "c:/Documents and Settings/someone" }); ensure_getTokens("unmatched quote", - "baby don't leave", " ", "", "'", - list_of("baby")("don't")("leave")); + "baby don't leave", " ", "", "'", { "baby", "don't", "leave" }); ensure_getTokens("adjacent quoted", - "abc'def \"ghi'\"jkl' mno\"pqr", " ", "", "\"'", - list_of("abcdef \"ghijkl' mnopqr")); + "abc'def \"ghi'\"jkl' mno\"pqr", " ", "", "\"'", { "abcdef \"ghijkl' mnopqr" }); ensure_getTokens("quoted empty string", - "--set SomeVar ''", " ", "", "'", - list_of("--set")("SomeVar")("")); + "--set SomeVar ''", " ", "", "'", { "--set", "SomeVar", "" }); // escapes // Don't use backslash as an escape for these tests -- you'll go nuts @@ -857,15 +848,12 @@ namespace tut // something else! ensure_equals("escaped delims", LLStringUtil::getTokens("^ a - dog^-gone^ phrase", " ", "-", "", "^"), - list_of(" a")("-")("dog-gone phrase")); + StringVec{ " a", "-", "dog-gone phrase" }); ensure_equals("escaped quotes", LLStringUtil::getTokens("say: 'this isn^'t w^orking'.", " ", "", "'", "^"), - list_of("say:")("this isn't working.")); + StringVec{ "say:", "this isn't working." }); ensure_equals("escaped escape", - LLStringUtil::getTokens("want x^^2", " ", "", "", "^"), - list_of("want")("x^2")); - ensure_equals("escape at end", - LLStringUtil::getTokens("it's^ up there^", " ", "", "'", "^"), - list_of("it's up")("there^")); + LLStringUtil::getTokens("want x^^2", " ", "", "", "^"), StringVec{ "want", "x^2" }); + ensure_equals("escape at end", LLStringUtil::getTokens("it's^ up there^", " ", "", "'", "^"), StringVec{ "it's up", "there^" }); } } diff --git a/indra/llcommon/tests/lltreeiterators_test.cpp b/indra/llcommon/tests/lltreeiterators_test.cpp index 7a2adfd8bad..6734596d257 100644 --- a/indra/llcommon/tests/lltreeiterators_test.cpp +++ b/indra/llcommon/tests/lltreeiterators_test.cpp @@ -32,6 +32,7 @@ // STL headers // std headers +#include #include #include #include @@ -915,7 +916,7 @@ struct WalkExpected: public Expected template typename LLPtrTo::type get_B2b(const typename LLPtrTo::type& root, - const boost::function::type&)>& child_begin) + const std::function::type&)>& child_begin) { typedef typename LLPtrTo::type NodePtr; CHILDITER Bi(child_begin(root)); diff --git a/indra/llcommon/threadpool.cpp b/indra/llcommon/threadpool.cpp index 451e60c0832..6adbdffba87 100644 --- a/indra/llcommon/threadpool.cpp +++ b/indra/llcommon/threadpool.cpp @@ -78,6 +78,7 @@ void LL::ThreadPoolBase::start() std::string tname{ stringize(mName, ':', (i+1), '/', mThreadCount) }; mThreads.emplace_back(tname, [this, tname]() { + set_thread_name(tname.c_str()); LL_PROFILER_SET_THREAD_NAME(tname.c_str()); run(tname); }); diff --git a/indra/llcorehttp/CMakeLists.txt b/indra/llcorehttp/CMakeLists.txt index 05b788a4338..fbc25a7cd54 100644 --- a/indra/llcorehttp/CMakeLists.txt +++ b/indra/llcorehttp/CMakeLists.txt @@ -12,6 +12,7 @@ include(LLAddBuildTest) include(LLCommon) include(Tut) include(bugsplat) +include(websocketpp) set(llcorehttp_SOURCE_FILES bufferarray.cpp @@ -23,6 +24,8 @@ set(llcorehttp_SOURCE_FILES httprequest.cpp httpresponse.cpp httpstats.cpp + llwebsocketmgr.cpp + lljsonrpcws.cpp _httplibcurl.cpp _httpopcancel.cpp _httpoperation.cpp @@ -51,6 +54,8 @@ set(llcorehttp_HEADER_FILES httprequest.h httpresponse.h httpstats.h + llwebsocketmgr.h + lljsonrpcws.h _httpinternal.h _httplibcurl.h _httpopcancel.h @@ -81,10 +86,12 @@ list(APPEND llcorehttp_SOURCE_FILES ${llcorehttp_HEADER_FILES}) add_library (llcorehttp ${llcorehttp_SOURCE_FILES}) target_link_libraries( llcorehttp + llmath llcommon ll::libcurl ll::openssl ll::nghttp2 + ll::websocketpp ) target_include_directories( llcorehttp INTERFACE ${CMAKE_CURRENT_SOURCE_DIR}) # llmessage depends on llcorehttp, yet llcorehttp also depends on llmessage (at least for includes). @@ -92,6 +99,10 @@ target_include_directories( llcorehttp INTERFACE ${CMAKE_CURRENT_SOURCE_DIR}) # lead to circular dependencies (or in case of cmake, the first project declaring it's dependencies wins) target_include_directories( llcorehttp PRIVATE ${CMAKE_CURRENT_SOURCE_DIR}/../llmessage) +if (USE_PRECOMPILED_HEADERS) + target_precompile_headers(llcorehttp REUSE_FROM llprecompiled) +endif () + # tests set(LLCOREHTTP_TESTS ON CACHE BOOL "Build and run llcorehttp integration tests specifically") @@ -131,7 +142,7 @@ if (LL_TESTS AND LLCOREHTTP_TESTS) ${PYTHON_EXECUTABLE} "${CMAKE_CURRENT_SOURCE_DIR}/tests/test_llcorehttp_peer.py" ) - + # # Example Programs # @@ -151,6 +162,7 @@ if (LL_TESTS AND LLCOREHTTP_TESTS) set_target_properties(http_texture_load PROPERTIES RUNTIME_OUTPUT_DIRECTORY "${EXE_STAGING_DIR}" + FOLDER "Tests" ) if (WINDOWS) @@ -163,6 +175,13 @@ if (LL_TESTS AND LLCOREHTTP_TESTS) ) endif (WINDOWS) + if(DARWIN) + set_target_properties(http_texture_load + PROPERTIES + OSX_ARCHITECTURES ${LL_MACOS_TEST_ARCHITECTURE} + ) + endif() + target_link_libraries(http_texture_load ${example_libs}) endif (LL_TESTS AND LLCOREHTTP_TESTS) diff --git a/indra/llcorehttp/_httplibcurl.h b/indra/llcorehttp/_httplibcurl.h index 36319658379..58affcb7962 100644 --- a/indra/llcorehttp/_httplibcurl.h +++ b/indra/llcorehttp/_httplibcurl.h @@ -61,8 +61,8 @@ class HttpLibcurl virtual ~HttpLibcurl(); private: - HttpLibcurl(const HttpLibcurl &); // Not defined - void operator=(const HttpLibcurl &); // Not defined + HttpLibcurl(const HttpLibcurl&) = delete; + void operator=(const HttpLibcurl&) = delete; public: typedef std::shared_ptr opReqPtr_t; @@ -179,8 +179,8 @@ class HttpLibcurl ~HandleCache(); private: - HandleCache(const HandleCache &); // Not defined - void operator=(const HandleCache &); // Not defined + HandleCache(const HandleCache&) = delete; + void operator=(const HandleCache&) = delete; public: /// Allocate a curl handle for caller. May be freed using diff --git a/indra/llcorehttp/_httpoperation.h b/indra/llcorehttp/_httpoperation.h index ff7efe60e99..8412043aa5f 100644 --- a/indra/llcorehttp/_httpoperation.h +++ b/indra/llcorehttp/_httpoperation.h @@ -68,8 +68,7 @@ class HttpService; /// via queue-like interfaces that are thread compatible /// and those interfaces establish the access rules. -class HttpOperation : private boost::noncopyable, - public std::enable_shared_from_this +class HttpOperation : public std::enable_shared_from_this { public: typedef std::shared_ptr ptr_t; @@ -82,6 +81,9 @@ class HttpOperation : private boost::noncopyable, /// Threading: called by any thread. virtual ~HttpOperation(); // Use release() + // Non-copyable + HttpOperation(const HttpOperation&) = delete; + HttpOperation& operator=(const HttpOperation&) = delete; public: /// Register a reply queue and a handler for completion notifications. @@ -220,12 +222,10 @@ class HttpOpStop : public HttpOperation { public: HttpOpStop(); - virtual ~HttpOpStop(); -private: - HttpOpStop(const HttpOpStop &); // Not defined - void operator=(const HttpOpStop &); // Not defined + HttpOpStop(const HttpOpStop &) = delete; + HttpOpStop& operator=(const HttpOpStop&) = delete; public: virtual void stageFromRequest(HttpService *); @@ -242,12 +242,10 @@ class HttpOpNull : public HttpOperation { public: HttpOpNull(); - virtual ~HttpOpNull(); -private: - HttpOpNull(const HttpOpNull &); // Not defined - void operator=(const HttpOpNull &); // Not defined + HttpOpNull(const HttpOpNull&) = delete; + HttpOpNull& operator=(const HttpOpNull&) = delete; public: virtual void stageFromRequest(HttpService *); @@ -264,12 +262,10 @@ class HttpOpSpin : public HttpOperation // 0 does a hard spin in the operation // 1 does a soft spin continuously requeuing itself HttpOpSpin(int mode); - virtual ~HttpOpSpin(); -private: - HttpOpSpin(const HttpOpSpin &); // Not defined - void operator=(const HttpOpSpin &); // Not defined + HttpOpSpin(const HttpOpSpin&) = delete; + HttpOpSpin& operator=(const HttpOpSpin&) = delete; public: virtual void stageFromRequest(HttpService *); diff --git a/indra/llcorehttp/_httpoprequest.cpp b/indra/llcorehttp/_httpoprequest.cpp index 081a4d9bac9..9704486791c 100644 --- a/indra/llcorehttp/_httpoprequest.cpp +++ b/indra/llcorehttp/_httpoprequest.cpp @@ -153,7 +153,7 @@ HttpOpRequest::HttpOpRequest() mPolicyRetryLimit(HTTP_RETRY_COUNT_DEFAULT), mPolicyMinRetryBackoff(HttpTime(HTTP_RETRY_BACKOFF_MIN_DEFAULT)), mPolicyMaxRetryBackoff(HttpTime(HTTP_RETRY_BACKOFF_MAX_DEFAULT)), - mCallbackSSLVerify(NULL) + mCallbackSSLVerify(nullptr) { // *NOTE: As members are added, retry initialization/cleanup // may need to be extended in @see prepareRequest(). @@ -272,7 +272,7 @@ void HttpOpRequest::visitNotifier(HttpRequest * request) response->setContentType(mReplyConType); response->setRetries(mPolicyRetries, mPolicy503Retries); - HttpResponse::TransferStats::ptr_t stats = HttpResponse::TransferStats::ptr_t(new HttpResponse::TransferStats); + HttpResponse::TransferStats::ptr_t stats = std::make_shared(); curl_easy_getinfo(mCurlHandle, CURLINFO_SIZE_DOWNLOAD, &stats->mSizeDownload); curl_easy_getinfo(mCurlHandle, CURLINFO_TOTAL_TIME, &stats->mTotalTime); @@ -964,7 +964,7 @@ size_t HttpOpRequest::headerCallback(void * data, size_t size, size_t nmemb, voi // Save headers in response if (! op->mReplyHeaders) { - op->mReplyHeaders = HttpHeaders::ptr_t(new HttpHeaders); + op->mReplyHeaders = std::make_shared(); } op->mReplyHeaders->append(name, value ? value : ""); } diff --git a/indra/llcorehttp/_httpoprequest.h b/indra/llcorehttp/_httpoprequest.h index b029bc740c7..717535555cf 100644 --- a/indra/llcorehttp/_httpoprequest.h +++ b/indra/llcorehttp/_httpoprequest.h @@ -73,8 +73,8 @@ class HttpOpRequest : public HttpOperation virtual ~HttpOpRequest(); // Use release() private: - HttpOpRequest(const HttpOpRequest &); // Not defined - void operator=(const HttpOpRequest &); // Not defined + HttpOpRequest(const HttpOpRequest&) = delete; + void operator=(const HttpOpRequest&) = delete; public: enum EMethod diff --git a/indra/llcorehttp/_httpopsetget.h b/indra/llcorehttp/_httpopsetget.h index 0b927a6b717..ff8204547b7 100644 --- a/indra/llcorehttp/_httpopsetget.h +++ b/indra/llcorehttp/_httpopsetget.h @@ -60,8 +60,8 @@ class HttpOpSetGet : public HttpOperation virtual ~HttpOpSetGet(); // Use release() private: - HttpOpSetGet(const HttpOpSetGet &); // Not defined - void operator=(const HttpOpSetGet &); // Not defined + HttpOpSetGet(const HttpOpSetGet&) = delete; + void operator=(const HttpOpSetGet&) = delete; public: /// Threading: called by application thread diff --git a/indra/llcorehttp/_httppolicy.h b/indra/llcorehttp/_httppolicy.h index a074949f203..82f552176ee 100644 --- a/indra/llcorehttp/_httppolicy.h +++ b/indra/llcorehttp/_httppolicy.h @@ -56,8 +56,8 @@ class HttpPolicy virtual ~HttpPolicy(); private: - HttpPolicy(const HttpPolicy &); // Not defined - void operator=(const HttpPolicy &); // Not defined + HttpPolicy(const HttpPolicy&) = delete; + void operator=(const HttpPolicy&) = delete; public: typedef std::shared_ptr opReqPtr_t; diff --git a/indra/llcorehttp/_httppolicyclass.h b/indra/llcorehttp/_httppolicyclass.h index 32bcad4f9c4..5bf0fa1fa7e 100644 --- a/indra/llcorehttp/_httppolicyclass.h +++ b/indra/llcorehttp/_httppolicyclass.h @@ -53,7 +53,7 @@ class HttpPolicyClass ~HttpPolicyClass(); HttpPolicyClass & operator=(const HttpPolicyClass &); - HttpPolicyClass(const HttpPolicyClass &); // Not defined + HttpPolicyClass(const HttpPolicyClass &); public: HttpStatus set(HttpRequest::EPolicyOption opt, long value); diff --git a/indra/llcorehttp/_httppolicyglobal.h b/indra/llcorehttp/_httppolicyglobal.h index d9114d167f6..3840d66b221 100644 --- a/indra/llcorehttp/_httppolicyglobal.h +++ b/indra/llcorehttp/_httppolicyglobal.h @@ -55,7 +55,7 @@ class HttpPolicyGlobal HttpPolicyGlobal & operator=(const HttpPolicyGlobal &); private: - HttpPolicyGlobal(const HttpPolicyGlobal &); // Not defined + HttpPolicyGlobal(const HttpPolicyGlobal &) = delete; public: HttpStatus set(HttpRequest::EPolicyOption opt, long value); diff --git a/indra/llcorehttp/_httpreadyqueue.h b/indra/llcorehttp/_httpreadyqueue.h index 0bc07235114..04fcf25356f 100644 --- a/indra/llcorehttp/_httpreadyqueue.h +++ b/indra/llcorehttp/_httpreadyqueue.h @@ -77,8 +77,8 @@ class HttpReadyQueue : public HttpReadyQueueBase {} protected: - HttpReadyQueue(const HttpReadyQueue &); // Not defined - void operator=(const HttpReadyQueue &); // Not defined + HttpReadyQueue(const HttpReadyQueue&) = delete; + void operator=(const HttpReadyQueue&) = delete; public: diff --git a/indra/llcorehttp/_httpreplyqueue.h b/indra/llcorehttp/_httpreplyqueue.h index d8847fafb52..e1b56486918 100644 --- a/indra/llcorehttp/_httpreplyqueue.h +++ b/indra/llcorehttp/_httpreplyqueue.h @@ -30,8 +30,6 @@ #include "_refcounted.h" #include "_mutex.h" -#include "boost/noncopyable.hpp" - namespace LLCore { @@ -59,7 +57,7 @@ class HttpOperation; /// will be coded anyway so it shouldn't be too much of a /// burden. -class HttpReplyQueue : private boost::noncopyable +class HttpReplyQueue { public: @@ -69,6 +67,9 @@ class HttpReplyQueue : private boost::noncopyable HttpReplyQueue(); virtual ~HttpReplyQueue(); + HttpReplyQueue(const HttpReplyQueue&) = delete; + HttpReplyQueue& operator=(const HttpReplyQueue&) = delete; + public: typedef std::vector< opPtr_t > OpContainer; diff --git a/indra/llcorehttp/_httprequestqueue.h b/indra/llcorehttp/_httprequestqueue.h index 0823126f78b..82537c90535 100644 --- a/indra/llcorehttp/_httprequestqueue.h +++ b/indra/llcorehttp/_httprequestqueue.h @@ -57,8 +57,8 @@ class HttpRequestQueue : public LLCoreInt::RefCounted virtual ~HttpRequestQueue(); // Use release() private: - HttpRequestQueue(const HttpRequestQueue &); // Not defined - void operator=(const HttpRequestQueue &); // Not defined + HttpRequestQueue(const HttpRequestQueue&) = delete; + void operator=(const HttpRequestQueue&) = delete; public: typedef std::shared_ptr opPtr_t; diff --git a/indra/llcorehttp/_httpservice.cpp b/indra/llcorehttp/_httpservice.cpp index 5880fb7e873..e14a5334794 100644 --- a/indra/llcorehttp/_httpservice.cpp +++ b/indra/llcorehttp/_httpservice.cpp @@ -27,7 +27,6 @@ #include "_httpservice.h" #include -#include #include "_httpoperation.h" #include "_httprequestqueue.h" @@ -71,7 +70,6 @@ volatile HttpService::EState HttpService::sState(NOT_INITIALIZED); HttpService::HttpService() : mRequestQueue(NULL), mExitRequested(0U), - mThread(NULL), mPolicy(NULL), mTransport(NULL), mLastPolicy(0) @@ -90,23 +88,30 @@ HttpService::~HttpService() { if (mRequestQueue->stopQueue()) { - // Give mRequestQueue a chance to finish - ms_sleep(10); + // Now wait a bit for the thread to exit + S32 counter = 0; + const S32 MAX_WAIT = 600; + while (counter < MAX_WAIT) + { + if (STOPPED == sState) + { + break; + } + // Sleep for a tenth of a second + ms_sleep(100); + std::this_thread::yield(); + counter++; + } } } - if (mThread) + if (mThread && RUNNING == sState) { - if (! mThread->timedJoin(250)) - { - // Failed to join, expect problems ahead so do a hard termination. - LL_WARNS(LOG_CORE) << "Destroying HttpService with running thread. Expect problems." << LL_NEWLINE - << "State: " << S32(sState) - << " Last policy: " << U32(mLastPolicy) - << LL_ENDL; + // Failed to shutdown, expect problems ahead so do a hard termination. + LL_WARNS(LOG_CORE) << "Destroying HttpService with running thread. Expect problems." << LL_NEWLINE << "State: " << S32(sState) + << " Last policy: " << U32(mLastPolicy) << LL_ENDL; - mThread->cancel(); - } + mThread->cancel(); } } @@ -122,11 +127,7 @@ HttpService::~HttpService() delete mPolicy; mPolicy = NULL; - if (mThread) - { - mThread->release(); - mThread = NULL; - } + mThread.reset(); } @@ -205,14 +206,15 @@ void HttpService::startThread() if (mThread) { - mThread->release(); + mThread.reset(); } // Push current policy definitions, enable policy & transport components mPolicy->start(); mTransport->start(mLastPolicy + 1); - mThread = new LLCoreInt::HttpThread(boost::bind(&HttpService::threadRun, this, _1)); + mThread = std::make_unique(boost::bind(&HttpService::threadRun, this, _1)); + mThread->detach(); // Detach thread to let it clean its self up sState = RUNNING; } @@ -283,12 +285,9 @@ void HttpService::shutdown() // requested to stop. void HttpService::threadRun(LLCoreInt::HttpThread * thread) { + set_thread_name("HttpService"); LL_PROFILER_SET_THREAD_NAME("HttpService"); - boost::this_thread::disable_interruption di; - - LLThread::registerThreadID(); - ELoopSpeed loop(REQUEST_SLEEP); while (! mExitRequested) { @@ -315,7 +314,7 @@ void HttpService::threadRun(LLCoreInt::HttpThread * thread) { LOG_UNHANDLED_EXCEPTION(""); } - catch (std::bad_alloc&) + catch (const std::bad_alloc&) { LLMemory::logMemoryInfo(true); diff --git a/indra/llcorehttp/_httpservice.h b/indra/llcorehttp/_httpservice.h index 13eb034f0ee..4540fb9383b 100644 --- a/indra/llcorehttp/_httpservice.h +++ b/indra/llcorehttp/_httpservice.h @@ -86,8 +86,8 @@ class HttpService virtual ~HttpService(); private: - HttpService(const HttpService &); // Not defined - void operator=(const HttpService &); // Not defined + HttpService(const HttpService&) = delete; + void operator=(const HttpService&) = delete; public: enum EState @@ -218,7 +218,7 @@ class HttpService static volatile EState sState; HttpRequestQueue * mRequestQueue; // Refcounted LLAtomicU32 mExitRequested; - LLCoreInt::HttpThread * mThread; + std::unique_ptr mThread; // === working-thread-only data === HttpPolicy * mPolicy; // Simple pointer, has ownership diff --git a/indra/llcorehttp/_mutex.h b/indra/llcorehttp/_mutex.h index 5e0164eb519..43782d3a37c 100644 --- a/indra/llcorehttp/_mutex.h +++ b/indra/llcorehttp/_mutex.h @@ -27,9 +27,8 @@ #ifndef LLCOREINT_MUTEX_H_ #define LLCOREINT_MUTEX_H_ - -#include - +#include +#include namespace LLCoreInt { @@ -37,17 +36,17 @@ namespace LLCoreInt // MUTEX TYPES // unique mutex type -typedef boost::mutex HttpMutex; +typedef std::mutex HttpMutex; // CONDITION VARIABLES // standard condition variable -typedef boost::condition_variable HttpConditionVariable; +typedef std::condition_variable HttpConditionVariable; // LOCKS AND FENCES // scoped unique lock -typedef boost::unique_lock HttpScopedLock; +typedef std::unique_lock HttpScopedLock; } diff --git a/indra/llcorehttp/_refcounted.h b/indra/llcorehttp/_refcounted.h index 7470965a7f7..1a01d66d14e 100644 --- a/indra/llcorehttp/_refcounted.h +++ b/indra/llcorehttp/_refcounted.h @@ -31,23 +31,20 @@ #include "linden_common.h" #include "fix_macros.h" -#include #include - #include "llatomic.h" - namespace LLCoreInt { class RefCounted { -private: - RefCounted(); // Not defined - may not be default constructed - void operator=(const RefCounted &); // Not defined - public: + RefCounted() = delete; // Not defined - may not be default constructed + RefCounted(const RefCounted&) = delete; // Not defined - may not be copy constructed + void operator=(const RefCounted&) = delete; // Not defined + explicit RefCounted(bool const implicit) : mRefCount(implicit) {} diff --git a/indra/llcorehttp/_thread.h b/indra/llcorehttp/_thread.h index 6c0e39cf929..66b9689c5a8 100644 --- a/indra/llcorehttp/_thread.h +++ b/indra/llcorehttp/_thread.h @@ -29,92 +29,75 @@ #include "linden_common.h" -#include -#include -#include +#include +#include -#include "apr.h" // thread-related functions #include "_refcounted.h" namespace LLCoreInt { -class HttpThread : public RefCounted +class HttpThread { -private: - HttpThread(); // Not defined - void operator=(const HttpThread &); // Not defined - - void at_exit() - { - // the thread function has exited so we need to release our reference - // to ourself so that we will be automagically cleaned up. - release(); - } +public: + HttpThread() = delete; // Not defined + HttpThread(const HttpThread&) = delete; // Not defined + void operator=(const HttpThread &) = delete; // Not defined +private: void run() - { // THREAD CONTEXT - - // Take out additional reference for the at_exit handler - addRef(); - boost::this_thread::at_thread_exit(boost::bind(&HttpThread::at_exit, this)); - - // run the thread function - mThreadFunc(this); - - } // THREAD CONTEXT - -protected: - virtual ~HttpThread() - { - delete mThread; - } + { // THREAD CONTEXT + // run the thread function + mThreadFunc(this); + } // THREAD CONTEXT public: /// Constructs a thread object for concurrent execution but does /// not start running. Caller receives on refcount on the thread /// instance. If the thread is started, another will be taken /// out for the exit handler. - explicit HttpThread(boost::function threadFunc) - : RefCounted(true), // implicit reference - mThreadFunc(threadFunc) - { - // this creates a boost thread that will call HttpThread::run on this instance - // and pass it the threadfunc callable... - boost::function f = boost::bind(&HttpThread::run, this); + explicit HttpThread(std::function threadFunc) + : mThreadFunc(threadFunc) + { + // this creates a std thread that will call HttpThread::run on this instance + // and pass it the threadfunc callable... + std::function f = std::bind(&HttpThread::run, this); - mThread = new boost::thread(f); - } + mThread = std::make_unique(f); + mNativeHandle = mThread->native_handle(); + } - inline void join() - { - mThread->join(); - } + ~HttpThread() = default; - inline bool timedJoin(S32 millis) - { - return mThread->timed_join(boost::posix_time::milliseconds(millis)); - } + inline void join() + { + mThread->join(); + } inline bool joinable() const - { - return mThread->joinable(); - } + { + return mThread->joinable(); + } + + inline void detach() + { + mThread->detach(); + } // A very hostile method to force a thread to quit inline void cancel() - { - boost::thread::native_handle_type thread(mThread->native_handle()); -#if LL_WINDOWS - TerminateThread(thread, 0); + { +#if LL_WINDOWS + TerminateThread(mNativeHandle, 0); #else - pthread_cancel(thread); + pthread_cancel(mNativeHandle); #endif - } + } private: - boost::function mThreadFunc; - boost::thread * mThread; + std::function mThreadFunc; + std::unique_ptr mThread; + std::thread::native_handle_type mNativeHandle; }; // end class HttpThread } // end namespace LLCoreInt diff --git a/indra/llcorehttp/bufferarray.cpp b/indra/llcorehttp/bufferarray.cpp index 6b33661d8f3..46c03f991d5 100644 --- a/indra/llcorehttp/bufferarray.cpp +++ b/indra/llcorehttp/bufferarray.cpp @@ -57,12 +57,12 @@ class BufferArray::Block void operator delete(void *); void operator delete(void *, size_t len); + Block(const Block&) = delete; + Block& operator=(const Block&) = delete; + protected: Block(size_t len); - Block(const Block &); // Not defined - void operator=(const Block &); // Not defined - // Allocate the block with the additional space for the // buffered data at the end of the object. void * operator new(size_t len, size_t addl_len); diff --git a/indra/llcorehttp/bufferarray.h b/indra/llcorehttp/bufferarray.h index 5105dbc4f72..9abe1778ed3 100644 --- a/indra/llcorehttp/bufferarray.h +++ b/indra/llcorehttp/bufferarray.h @@ -79,8 +79,8 @@ class BufferArray : public LLCoreInt::RefCounted virtual ~BufferArray(); // Use release() private: - BufferArray(const BufferArray &); // Not defined - void operator=(const BufferArray &); // Not defined + BufferArray(const BufferArray&) = delete; + void operator=(const BufferArray&) = delete; public: // Internal magic number, may be used by unit tests. diff --git a/indra/llcorehttp/bufferstream.h b/indra/llcorehttp/bufferstream.h index 93891810aa2..ba84821df30 100644 --- a/indra/llcorehttp/bufferstream.h +++ b/indra/llcorehttp/bufferstream.h @@ -91,8 +91,8 @@ class BufferArrayStreamBuf : public std::streambuf virtual ~BufferArrayStreamBuf(); private: - BufferArrayStreamBuf(const BufferArrayStreamBuf &); // Not defined - void operator=(const BufferArrayStreamBuf &); // Not defined + BufferArrayStreamBuf(const BufferArrayStreamBuf&) = delete; + void operator=(const BufferArrayStreamBuf&) = delete; public: // Input interfaces from std::streambuf diff --git a/indra/llcorehttp/httpcommon.h b/indra/llcorehttp/httpcommon.h index 511a17e000d..1c003a0966c 100644 --- a/indra/llcorehttp/httpcommon.h +++ b/indra/llcorehttp/httpcommon.h @@ -191,7 +191,6 @@ #include "llsd.h" #include #include -#include "boost/noncopyable.hpp" namespace LLCore { @@ -297,25 +296,25 @@ struct HttpStatus HttpStatus() { - mDetails = std::shared_ptr
(new Details(LLCORE, HE_SUCCESS)); + mDetails = std::make_shared
(LLCORE, HE_SUCCESS); } HttpStatus(type_enum_t type, short status) { - mDetails = std::shared_ptr
(new Details(type, status)); + mDetails = std::make_shared
(type, status); } HttpStatus(int http_status) { - mDetails = std::shared_ptr
(new Details(http_status, - (http_status >= 200 && http_status <= 299) ? HE_SUCCESS : HE_REPLY_ERROR)); + mDetails = std::make_shared
(http_status, + (http_status >= 200 && http_status <= 299) ? HE_SUCCESS : HE_REPLY_ERROR); llassert(http_status >= 100 && http_status <= 999); } HttpStatus(int http_status, const std::string &message) { - mDetails = std::shared_ptr
(new Details(http_status, - (http_status >= 200 && http_status <= 299) ? HE_SUCCESS : HE_REPLY_ERROR)); + mDetails = std::make_shared
(http_status, + (http_status >= 200 && http_status <= 299) ? HE_SUCCESS : HE_REPLY_ERROR); llassert(http_status >= 100 && http_status <= 999); mDetails->mMessage = message; } @@ -337,7 +336,7 @@ struct HttpStatus HttpStatus & clone(const HttpStatus &rhs) { - mDetails = std::shared_ptr
(new Details(*rhs.mDetails)); + mDetails = std::make_shared
(*rhs.mDetails); return *this; } diff --git a/indra/llcorehttp/httpheaders.h b/indra/llcorehttp/httpheaders.h index a5ca7749b0a..6a03cf40839 100644 --- a/indra/llcorehttp/httpheaders.h +++ b/indra/llcorehttp/httpheaders.h @@ -74,7 +74,7 @@ namespace LLCore /// constructor is given a refcount. /// -class HttpHeaders: private boost::noncopyable +class HttpHeaders { public: typedef std::pair header_t; @@ -94,11 +94,11 @@ class HttpHeaders: private boost::noncopyable HttpHeaders(); virtual ~HttpHeaders(); // Use release() - //typedef LLCoreInt::IntrusivePtr ptr_t; -protected: + // Non-copyable + HttpHeaders(const HttpHeaders&) = delete; + HttpHeaders& operator=(const HttpHeaders&) = delete; - HttpHeaders(const HttpHeaders &); // Not defined - void operator=(const HttpHeaders &); // Not defined + //typedef LLCoreInt::IntrusivePtr ptr_t; public: // Empty the list of headers. diff --git a/indra/llcorehttp/httpoptions.h b/indra/llcorehttp/httpoptions.h index fdb277c66ef..d50c5470ae9 100644 --- a/indra/llcorehttp/httpoptions.h +++ b/indra/llcorehttp/httpoptions.h @@ -55,7 +55,7 @@ namespace LLCore /// Allocation: Refcounted, heap only. Caller of the constructor /// is given a refcount. /// -class HttpOptions : private boost::noncopyable +class HttpOptions { public: HttpOptions(); @@ -64,10 +64,9 @@ class HttpOptions : private boost::noncopyable virtual ~HttpOptions(); // Use release() -protected: - - HttpOptions(const HttpOptions &); // Not defined - void operator=(const HttpOptions &); // Not defined + // Non-copyable + HttpOptions(const HttpOptions&) = delete; + HttpOptions& operator=(const HttpOptions&) = delete; public: diff --git a/indra/llcorehttp/httprequest.cpp b/indra/llcorehttp/httprequest.cpp index 2aaf71f8a4f..d8fcd6a03fe 100644 --- a/indra/llcorehttp/httprequest.cpp +++ b/indra/llcorehttp/httprequest.cpp @@ -60,7 +60,7 @@ HttpRequest::HttpRequest() mRequestQueue = HttpRequestQueue::instanceOf(); mRequestQueue->addRef(); - mReplyQueue.reset( new HttpReplyQueue() ); + mReplyQueue = std::make_shared(); HTTPStats::instance().recordHTTPRequest(); } @@ -129,7 +129,7 @@ HttpHandle HttpRequest::setPolicyOption(EPolicyOption opt, policy_t pclass, { HttpStatus status; - HttpOpSetGet::ptr_t op(new HttpOpSetGet()); + HttpOpSetGet::ptr_t op = std::make_shared(); if (! (status = op->setupSet(opt, pclass, value))) { mLastReqStatus = status; @@ -152,7 +152,7 @@ HttpHandle HttpRequest::setPolicyOption(EPolicyOption opt, policy_t pclass, { HttpStatus status; - HttpOpSetGet::ptr_t op (new HttpOpSetGet()); + HttpOpSetGet::ptr_t op = std::make_shared(); if (! (status = op->setupSet(opt, pclass, value))) { mLastReqStatus = status; @@ -190,7 +190,7 @@ HttpHandle HttpRequest::requestGet(policy_t policy_id, LL_PROFILE_ZONE_SCOPED_CATEGORY_NETWORK; HttpStatus status; - HttpOpRequest::ptr_t op(new HttpOpRequest()); + HttpOpRequest::ptr_t op = std::make_shared(); if (! (status = op->setupGet(policy_id, url, options, headers))) { mLastReqStatus = status; @@ -219,7 +219,7 @@ HttpHandle HttpRequest::requestGetByteRange(policy_t policy_id, LL_PROFILE_ZONE_SCOPED_CATEGORY_NETWORK; HttpStatus status; - HttpOpRequest::ptr_t op(new HttpOpRequest()); + HttpOpRequest::ptr_t op = std::make_shared(); if (! (status = op->setupGetByteRange(policy_id, url, offset, len, options, headers))) { mLastReqStatus = status; @@ -246,7 +246,7 @@ HttpHandle HttpRequest::requestPost(policy_t policy_id, { HttpStatus status; - HttpOpRequest::ptr_t op(new HttpOpRequest()); + HttpOpRequest::ptr_t op = std::make_shared(); if (! (status = op->setupPost(policy_id, url, body, options, headers))) { mLastReqStatus = status; @@ -273,7 +273,7 @@ HttpHandle HttpRequest::requestPut(policy_t policy_id, { HttpStatus status; - HttpOpRequest::ptr_t op (new HttpOpRequest()); + HttpOpRequest::ptr_t op = std::make_shared(); if (! (status = op->setupPut(policy_id, url, body, options, headers))) { mLastReqStatus = status; @@ -298,7 +298,7 @@ HttpHandle HttpRequest::requestDelete(policy_t policy_id, { HttpStatus status; - HttpOpRequest::ptr_t op(new HttpOpRequest()); + HttpOpRequest::ptr_t op = std::make_shared(); if (!(status = op->setupDelete(policy_id, url, options, headers))) { mLastReqStatus = status; @@ -324,7 +324,7 @@ HttpHandle HttpRequest::requestPatch(policy_t policy_id, { HttpStatus status; - HttpOpRequest::ptr_t op (new HttpOpRequest()); + HttpOpRequest::ptr_t op = std::make_shared(); if (!(status = op->setupPatch(policy_id, url, body, options, headers))) { mLastReqStatus = status; @@ -349,7 +349,7 @@ HttpHandle HttpRequest::requestCopy(policy_t policy_id, { HttpStatus status; - HttpOpRequest::ptr_t op(new HttpOpRequest()); + HttpOpRequest::ptr_t op = std::make_shared(); if (!(status = op->setupCopy(policy_id, url, options, headers))) { mLastReqStatus = status; @@ -375,7 +375,7 @@ HttpHandle HttpRequest::requestMove(policy_t policy_id, { HttpStatus status; - HttpOpRequest::ptr_t op (new HttpOpRequest()); + HttpOpRequest::ptr_t op = std::make_shared(); if (!(status = op->setupMove(policy_id, url, options, headers))) { mLastReqStatus = status; @@ -397,7 +397,7 @@ HttpHandle HttpRequest::requestNoOp(HttpHandler::ptr_t user_handler) { HttpStatus status; - HttpOperation::ptr_t op (new HttpOpNull()); + HttpOperation::ptr_t op = std::make_shared(); op->setReplyPath(mReplyQueue, user_handler); if (! (status = mRequestQueue->addOp(op))) // transfers refcount { @@ -463,7 +463,7 @@ HttpHandle HttpRequest::requestCancel(HttpHandle request, HttpHandler::ptr_t use { HttpStatus status; - HttpOperation::ptr_t op(new HttpOpCancel(request)); + HttpOperation::ptr_t op = std::make_shared(request); op->setReplyPath(mReplyQueue, user_handler); if (! (status = mRequestQueue->addOp(op))) // transfers refcount { @@ -528,7 +528,7 @@ HttpHandle HttpRequest::requestStopThread(HttpHandler::ptr_t user_handler) HttpStatus status; HttpHandle handle(LLCORE_HTTP_HANDLE_INVALID); - HttpOperation::ptr_t op(new HttpOpStop()); + HttpOperation::ptr_t op = std::make_shared(); op->setReplyPath(mReplyQueue, user_handler); if (! (status = mRequestQueue->addOp(op))) // transfers refcount { @@ -548,7 +548,7 @@ HttpHandle HttpRequest::requestSpin(int mode) HttpStatus status; HttpHandle handle(LLCORE_HTTP_HANDLE_INVALID); - HttpOperation::ptr_t op(new HttpOpSpin(mode)); + HttpOperation::ptr_t op = std::make_shared(mode); op->setReplyPath(mReplyQueue, HttpHandler::ptr_t()); if (! (status = mRequestQueue->addOp(op))) // transfers refcount { diff --git a/indra/llcorehttp/httprequest.h b/indra/llcorehttp/httprequest.h index e6e051410e4..f7516f127ae 100644 --- a/indra/llcorehttp/httprequest.h +++ b/indra/llcorehttp/httprequest.h @@ -104,9 +104,9 @@ class HttpRequest /// Represents a default, catch-all policy class that guarantees /// eventual service for any HTTP request. - static const policy_t DEFAULT_POLICY_ID = 0; - static const policy_t INVALID_POLICY_ID = 0xFFFFFFFFU; - static const policy_t GLOBAL_POLICY_ID = 0xFFFFFFFEU; + static constexpr policy_t DEFAULT_POLICY_ID = 0; + static constexpr policy_t INVALID_POLICY_ID = 0xFFFFFFFFU; + static constexpr policy_t GLOBAL_POLICY_ID = 0xFFFFFFFEU; /// Create a new policy class into which requests can be made. /// @@ -237,7 +237,7 @@ class HttpRequest /// Prototype for policy based callbacks. The callback methods will be executed /// on the worker thread so no modifications should be made to the HttpHandler object. - typedef boost::function policyCallback_t; + typedef std::function policyCallback_t; /// Set a policy option for a global or class parameter at /// startup time (prior to thread start). diff --git a/indra/llcorehttp/httpresponse.h b/indra/llcorehttp/httpresponse.h index 99c8f1d2f91..ed2d76c10f7 100644 --- a/indra/llcorehttp/httpresponse.h +++ b/indra/llcorehttp/httpresponse.h @@ -65,8 +65,8 @@ class HttpResponse : public LLCoreInt::RefCounted protected: virtual ~HttpResponse(); // Use release() - HttpResponse(const HttpResponse &); // Not defined - void operator=(const HttpResponse &); // Not defined + HttpResponse(const HttpResponse&) = delete; + void operator=(const HttpResponse&) = delete; public: /// Statistics for the HTTP diff --git a/indra/llcorehttp/llhttpconstants.h b/indra/llcorehttp/llhttpconstants.h index 71c1dfa1730..d05d0f1af17 100755 --- a/indra/llcorehttp/llhttpconstants.h +++ b/indra/llcorehttp/llhttpconstants.h @@ -100,6 +100,8 @@ extern const std::string HTTP_VERB_POST; extern const std::string HTTP_VERB_DELETE; extern const std::string HTTP_VERB_MOVE; extern const std::string HTTP_VERB_OPTIONS; +extern const std::string HTTP_VERB_PATCH; +extern const std::string HTTP_VERB_COPY; enum EHTTPMethod { diff --git a/indra/llcorehttp/lljsonrpcws.cpp b/indra/llcorehttp/lljsonrpcws.cpp new file mode 100644 index 00000000000..93e38a8397c --- /dev/null +++ b/indra/llcorehttp/lljsonrpcws.cpp @@ -0,0 +1,628 @@ +/** + * @file lljsonrpcws.cpp + * @brief JSON-RPC 2.0 WebSocket server and connection implementation + * + * $LicenseInfo:firstyear=2025&license=viewerlgpl$ + * Second Life Viewer Source Code + * Copyright (C) 2025, 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 "linden_common.h" + +#include "lljsonrpcws.h" +#include "llerror.h" +#include "llsdjson.h" +#include "lldate.h" + +#include + +//======================================================================== +// LLJSONRPCConnection Implementation +//======================================================================== + +void LLJSONRPCConnection::onOpen() +{ + LL_INFOS("JSONRPC") << "JSON-RPC connection opened" << LL_ENDL; +} + +void LLJSONRPCConnection::onClose() +{ + LL_INFOS("JSONRPC") << "JSON-RPC connection closed, clearing " + << mPendingRequests.size() << " pending requests" << LL_ENDL; + + // Cancel all pending requests + for (auto& [id, callback] : mPendingRequests) + { + if (callback) + { + LLSD error; + error["code"] = RPCError::CONNECTION_CLOSED; // Use named constant instead of magic number + error["message"] = "Connection closed"; + callback(LLSD(), error); + } + } + mPendingRequests.clear(); +} + +void LLJSONRPCConnection::onMessage(const std::string& message) +{ + LL_DEBUGS("JSONRPC") << "Received JSON-RPC message: " << message << LL_ENDL; + + try + { + // Parse JSON message + boost::system::error_code ec; + boost::json::value json_value = boost::json::parse(message, ec); + + if (ec.failed()) + { + LL_WARNS("JSONRPC") << "Failed to parse JSON: " << ec.message() << LL_ENDL; + sendError(LLSD(), ParseError(ec.message())); + return; + } + + // Convert to LLSD + LLSD message_obj = LlsdFromJson(json_value); + + // Handle batch vs single message + if (message_obj.isArray()) + { + // Batch request + if (message_obj.size() == 0) + { + sendError(LLSD(), InvalidRequest("Empty batch")); + return; + } + + // Process each message in the batch + for (S32 i = 0; i < message_obj.size(); ++i) + { + processMessage(message_obj[i]); + } + } + else + { + // Single message + processMessage(message_obj); + } + } + catch (const std::exception& e) + { + LL_WARNS("JSONRPC") << "Exception processing JSON-RPC message: " << e.what() << LL_ENDL; + sendError(LLSD(), InternalError(e.what())); + } +} + +void LLJSONRPCConnection::processMessage(const LLSD& message_obj) +{ + try + { + // Determine if this is a request, notification, or response + if (message_obj.has("method")) + { + // This is a request or notification + if (validateMessage(message_obj, true)) + { + processRequest(message_obj); + } + } + else if (message_obj.has("result") || message_obj.has("error")) + { + // This is a response + if (validateMessage(message_obj, false)) + { + processResponse(message_obj); + } + } + else + { + LL_WARNS("JSONRPC") << "Message must contain 'method' or 'result'/'error'" << LL_ENDL; + } + } + catch (const RPCError& e) + { + LLSD id = message_obj.has("id") ? message_obj["id"] : LLSD(); + sendError(id, e); + } +} + +void LLJSONRPCConnection::processRequest(const LLSD& request) +{ + std::string method = request["method"].asString(); + LLSD params = request.has("params") ? request["params"] : LLSD(); + LLSD id = request.has("id") ? request["id"] : LLSD(); + bool is_notification = !request.has("id"); + + LL_DEBUGS("JSONRPC") << "Processing " << (is_notification ? "notification" : "request") + << " for method: " << method << LL_ENDL; + + // Find method handler + auto it = mMethodHandlers.find(method); + if (it == mMethodHandlers.end()) + { + if (!is_notification) + { + sendError(id, MethodNotFound(method)); + } + return; + } + + try + { + // Call the method handler with method name, ID, and parameters + LLSD result = it->second(method, id, params); + + if (!is_notification) + { + sendResponse(id, result); + } + } + catch (const RPCError& e) + { + if (!is_notification) + { + sendError(id, e); + } + else + { + LL_WARNS("JSONRPC") << "Error in notification handler for " << method + << ": " << e.what() << LL_ENDL; + } + } + catch (const std::exception& e) + { + if (!is_notification) + { + sendError(id, InternalError(e.what())); + } + else + { + LL_WARNS("JSONRPC") << "Exception in notification handler for " << method + << ": " << e.what() << LL_ENDL; + } + } +} + +void LLJSONRPCConnection::processResponse(const LLSD& response) +{ + if (!response.has("id")) + { + LL_WARNS("JSONRPC") << "Response missing id field" << LL_ENDL; + return; + } + + std::string id = response["id"].asString(); + auto it = mPendingRequests.find(id); + if (it == mPendingRequests.end()) + { + LL_WARNS("JSONRPC") << "Received response for unknown request id: " << id << LL_ENDL; + return; + } + + ResponseCallback callback = it->second; + mPendingRequests.erase(it); + + if (callback) + { + LLSD result = response.has("result") ? response["result"] : LLSD(); + LLSD error = response.has("error") ? response["error"] : LLSD(); + + callback(result, error); + } +} + +bool LLJSONRPCConnection::validateMessage(const LLSD& message, bool is_request) +{ + // Check JSON-RPC version + if (!message.has("jsonrpc") || message["jsonrpc"].asString() != "2.0") + { + LL_WARNS("JSONRPC") << "Missing or invalid jsonrpc version" << LL_ENDL; + return false; + } + + if (is_request) + { + // Request/notification validation + if (!message.has("method")) + { + LL_WARNS("JSONRPC") << "Missing method field" << LL_ENDL; + return false; + } + + if (!message["method"].isString()) + { + LL_WARNS("JSONRPC") << "Method must be a string" << LL_ENDL; + return false; + } + + // Params are optional but must be array or object if present + if (message.has("params")) + { + if (!message["params"].isArray() && !message["params"].isMap()) + { + LL_WARNS("JSONRPC") << "Params must be array or object" << LL_ENDL; + return false; + } + } + } + else + { + // Response validation + if (!message.has("id")) + { + LL_WARNS("JSONRPC") << "Response missing id field" << LL_ENDL; + return false; + } + + // Must have either result or error, but not both + bool has_result = message.has("result"); + bool has_error = message.has("error"); + + if (!has_result && !has_error) + { + LL_WARNS("JSONRPC") << "Response must have result or error" << LL_ENDL; + return false; + } + + if (has_result && has_error) + { + LL_WARNS("JSONRPC") << "Response cannot have both result and error" << LL_ENDL; + return false; + } + + // Error must be an object with code and message + if (has_error) + { + LLSD error = message["error"]; + if (!error.isMap()) + { + LL_WARNS("JSONRPC") << "Error must be an object" << LL_ENDL; + } + if (!error.has("code") || !error.has("message")) + { + LL_WARNS("JSONRPC") << "Error must have code and message" << LL_ENDL; + } + } + } + return true; +} + +LLSD LLJSONRPCConnection::generateId() +{ + // Server-wide atomic counter for efficient unique ID generation + // Start from 1000 to avoid conflicts with any manual test IDs + static std::atomic sRequestIdCounter{1000}; + + // Generate server-unique sequential ID + U64 id = sRequestIdCounter.fetch_add(1); + return LLSD(llformat("rpc_%llu", id)); +} + +void LLJSONRPCConnection::registerMethod(const std::string& method, MethodHandler handler) +{ + mMethodHandlers[method] = handler; + LL_DEBUGS("JSONRPC") << "Registered method: " << method << LL_ENDL; +} + +void LLJSONRPCConnection::unregisterMethod(const std::string& method) +{ + mMethodHandlers.erase(method); + LL_DEBUGS("JSONRPC") << "Unregistered method: " << method << LL_ENDL; +} + +LLSD LLJSONRPCConnection::call(const std::string& method, const LLSD& params, ResponseCallback callback) +{ + LLSD request; + request["jsonrpc"] = "2.0"; + request["method"] = method; + + if (!params.isUndefined()) + { + request["params"] = params; + } + + LLSD id = generateId(); + request["id"] = id; + + // Store callback if provided + if (callback) + { + mPendingRequests[id.asString()] = callback; + } + + // Send the request + if (!sendMessage(LlsdToJson(request))) + { + // Remove from pending if send failed + if (callback) + { + mPendingRequests.erase(id.asString()); + } + LL_WARNS("JSONRPC") << "Failed to send request" << LL_ENDL; + return LLSD(); + } + + LL_DEBUGS("JSONRPC") << "Sent request: " << method << " with id: " << id.asString() << LL_ENDL; + return id; +} + +bool LLJSONRPCConnection::notify(const std::string& method, const LLSD& params) +{ + LLSD notification; + notification["jsonrpc"] = "2.0"; + notification["method"] = method; + + if (!params.isUndefined()) + { + notification["params"] = params; + } + + // Notifications don't have an id + + if (!sendMessage(LlsdToJson(notification))) + { + LL_WARNS("JSONRPC") << "Failed to send notification" << LL_ENDL; + return false; + } + + LL_DEBUGS("JSONRPC") << "Sent notification: " << method << LL_ENDL; + return true; +} + +bool LLJSONRPCConnection::sendResponse(const LLSD& id, const LLSD& result) +{ + LLSD response; + response["jsonrpc"] = "2.0"; + response["result"] = result; + response["id"] = id; + + if (!sendMessage(LlsdToJson(response))) + { + LL_WARNS("JSONRPC") << "Failed to send response for id: " << id.asString() << LL_ENDL; + return false; + } + LL_DEBUGS("JSONRPC") << "Sent response for id: " << id.asString() << LL_ENDL; + return true; +} + +bool LLJSONRPCConnection::sendError(const LLSD& id, const RPCError& error) +{ + LLSD response; + response["jsonrpc"] = "2.0"; + + LLSD error_obj; + error_obj["code"] = error.getCode(); + error_obj["message"] = error.what(); + + if (!error.getData().isUndefined()) + { + error_obj["data"] = error.getData(); + } + + response["error"] = error_obj; + response["id"] = id.isUndefined() ? LLSD() : id; // null for parse errors + + if (!sendMessage(LlsdToJson(response))) + { + LL_WARNS("JSONRPC") << "Failed to send error response" << LL_ENDL; + return false; + } + LL_DEBUGS("JSONRPC") << "Sent error response: " << error.what() << LL_ENDL; + return true; +} + +bool LLJSONRPCConnection::sendBatch(const LLSD& batch, ResponseCallback callback) +{ + if (!batch.isArray() || batch.size() == 0) + { + LL_WARNS("JSONRPC") << "Batch must be non-empty array" << LL_ENDL; + return false; + } + + // For batch requests with callbacks, we need to track multiple responses + // This is complex as we need to correlate all responses before calling callback + // For now, we'll send the batch but won't support batch response callbacks + if (callback) + { + LL_WARNS("JSONRPC") << "Batch response callbacks not yet implemented" << LL_ENDL; + } + + if (!sendMessage(LlsdToJson(batch))) + { + LL_WARNS("JSONRPC") << "Failed to send batch" << LL_ENDL; + return false; + } + + LL_DEBUGS("JSONRPC") << "Sent batch with " << batch.size() << " messages" << LL_ENDL; + return true; +} + +//======================================================================== +// LLJSONRPCServer Implementation +//======================================================================== + +LLJSONRPCServer::LLJSONRPCServer(const std::string& name, U16 port, bool local_only) + : LLWebsocketMgr::WSServer(name, port, local_only), mServerName(name) +{ + LL_INFOS("JSONRPC") << "Created JSON-RPC server: " << name + << " on port " << port << LL_ENDL; + + // Register standard JSON-RPC methods + registerGlobalMethod("system.listMethods", [this](const std::string& method, const LLSD& id, const LLSD& params) -> LLSD { + LL_DEBUGS("JSONRPC") << "System method " << method << " called" << LL_ENDL; + return getMethodList(); + }); + + registerGlobalMethod("system.getStats", [this](const std::string& method, const LLSD& id, const LLSD& params) -> LLSD { + LL_DEBUGS("JSONRPC") << "System method " << method << " called" << LL_ENDL; + return getServerStats(); + }); + + registerGlobalMethod("system.ping", [](const std::string& method, const LLSD& id, const LLSD& params) -> LLSD { + LL_DEBUGS("JSONRPC") << "System method " << method << " called" << LL_ENDL; + LLSD result; + result["pong"] = LLDate::now().asString(); + result["params"] = params; + return result; + }); +} + +LLWebsocketMgr::WSConnection::ptr_t LLJSONRPCServer::connectionFactory(LLWebsocketMgr::WSServer::ptr_t server, + LLWebsocketMgr::connection_h handle) +{ + auto connection = std::make_shared(server, handle); + setupConnectionMethods(connection); + return connection; +} + +void LLJSONRPCServer::onConnectionOpened(const LLWebsocketMgr::WSConnection::ptr_t& connection) +{ + LL_INFOS("JSONRPC") << "JSON-RPC client connected, total connections: " + << getConnectionCount() << LL_ENDL; +} + +void LLJSONRPCServer::onConnectionClosed(const LLWebsocketMgr::WSConnection::ptr_t& connection) +{ + LL_INFOS("JSONRPC") << "JSON-RPC client disconnected, total connections: " + << getConnectionCount() << LL_ENDL; +} + +void LLJSONRPCServer::setupConnectionMethods(LLJSONRPCConnection::ptr_t connection) +{ + LLMutexLock lock(&mGlobalMethodsMutex); + + // Register all global methods on the new connection + for (const auto& [method, handler] : mGlobalMethods) + { + connection->registerMethod(method, handler); + } +} + +void LLJSONRPCServer::registerGlobalMethod(const std::string& method, MethodHandler handler) +{ + { + LLMutexLock lock(&mGlobalMethodsMutex); + mGlobalMethods[method] = handler; + } + + // Apply to all existing connections - we need to iterate through connections + // Since mConnections is private, we need to use broadcastMessage or find another approach + // For now, we'll only apply to new connections + + LL_INFOS("JSONRPC") << "Registered global method: " << method << LL_ENDL; +} + +void LLJSONRPCServer::unregisterGlobalMethod(const std::string& method) +{ + { + LLMutexLock lock(&mGlobalMethodsMutex); + mGlobalMethods.erase(method); + } + + // For existing connections, we would need access to them + // This is a limitation of the current design - methods added after connection + // establishment won't be retroactively applied + + LL_INFOS("JSONRPC") << "Unregistered global method: " << method << LL_ENDL; +} + +LLSD LLJSONRPCServer::getMethodList() const +{ + LLMutexLock lock(&mGlobalMethodsMutex); + + LLSD methods = LLSD::emptyArray(); + for (const auto& [method, handler] : mGlobalMethods) + { + methods.append(method); + } + + return methods; +} + +void LLJSONRPCServer::broadcastNotification(const std::string& method, const LLSD& params) +{ + // Use custom broadcast logic since we need to call notify() on each JSON-RPC connection + // We can't use the base broadcastMessage() because we need structured JSON-RPC messages + + // Create the notification message + LLSD notification; + notification["jsonrpc"] = "2.0"; + notification["method"] = method; + if (!params.isUndefined()) + { + notification["params"] = params; + } + + // Use the base class broadcast functionality + broadcastMessage(boost::json::serialize(LlsdToJson(notification))); + + mTotalNotificationsSent += getConnectionCount(); + LL_DEBUGS("JSONRPC") << "Broadcast notification: " << method + << " to " << getConnectionCount() << " clients" << LL_ENDL; +} + +void LLJSONRPCServer::broadcastCall(const std::string& method, const LLSD& params, + BatchResponseCallback callback) +{ + if (callback) + { + LL_WARNS("JSONRPC") << "Broadcast call response callbacks not yet implemented" << LL_ENDL; + } + + // Create the request message with a server-unique ID + LLSD request; + request["jsonrpc"] = "2.0"; + request["method"] = method; + + // Use the same ID generation as connections for consistency + static std::atomic sBroadcastIdCounter{10000000}; // Start at 10M to clearly distinguish from regular requests + U64 id = sBroadcastIdCounter.fetch_add(1); + request["id"] = LLSD(llformat("broadcast_%llu", id)); + + if (!params.isUndefined()) + { + request["params"] = params; + } + + // Use the base class broadcast functionality + broadcastMessage(boost::json::serialize(LlsdToJson(request))); + + LL_DEBUGS("JSONRPC") << "Broadcast call: " << method + << " to " << getConnectionCount() << " clients" << LL_ENDL; +} + +LLSD LLJSONRPCServer::getServerStats() const +{ + LLSD stats; + stats["server_name"] = mServerName; + stats["connection_count"] = static_cast(getConnectionCount()); + stats["is_running"] = isRunning(); + + { + LLMutexLock lock(&mGlobalMethodsMutex); + stats["global_method_count"] = static_cast(mGlobalMethods.size()); + } + + stats["total_requests_handled"] = static_cast(mTotalRequestsHandled.load()); + stats["total_notifications_sent"] = static_cast(mTotalNotificationsSent.load()); + stats["uptime"] = LLDate::now().asString(); + + return stats; +} diff --git a/indra/llcorehttp/lljsonrpcws.h b/indra/llcorehttp/lljsonrpcws.h new file mode 100644 index 00000000000..bd9939aa339 --- /dev/null +++ b/indra/llcorehttp/lljsonrpcws.h @@ -0,0 +1,461 @@ +/** + * @file lljsonrpcws.h + * @brief JSON-RPC 2.0 WebSocket server and connection implementation + * + * $LicenseInfo:firstyear=2025&license=viewerlgpl$ + * Second Life Viewer Source Code + * Copyright (C) 2025, 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$ + */ + +#pragma once + +#include "llwebsocketmgr.h" +#include "llsd.h" +#include "lluuid.h" + +#include +#include +#include + +/** + * @class LLJSONRPCConnection + * @brief JSON-RPC 2.0 WebSocket connection implementation + * + * This class implements the JSON-RPC 2.0 protocol over WebSocket connections. + * It handles request/response patterns, notifications, method registration, + * and error handling according to the JSON-RPC 2.0 specification. + * + * ## JSON-RPC 2.0 Protocol Features + * + * - **Requests**: Method calls that expect a response + * - **Notifications**: Method calls that do not expect a response + * - **Batch Operations**: Multiple requests/notifications in a single message + * - **Error Handling**: Standardized error codes and messages + * - **ID Correlation**: Request/response correlation using unique identifiers + * + * ## Method Handler Registration + * + * Methods use an enhanced handler signature that provides method name and request ID context: + * + * @code + * connection->registerMethod("echo", [](const std::string& method, const LLSD& id, const LLSD& params) -> LLSD { + * LL_INFOS("JSONRPC") << "Method " << method << " called with ID " << id.asString() << LL_ENDL; + * return params; // Echo back the parameters + * }); + * + * connection->registerMethod("add", [](const std::string& method, const LLSD& id, const LLSD& params) -> LLSD { + * if (params.isArray() && params.size() >= 2) { + * LL_INFOS("JSONRPC") << "Adding numbers via " << method << LL_ENDL; + * return params[0].asReal() + params[1].asReal(); + * } + * throw LLJSONRPCConnection::InvalidParams("Expected array with 2 numbers"); + * }); + * @endcode + * + * The enhanced signature enables: + * - Method context awareness for shared handlers + * - Request correlation and distributed tracing + * - Distinction between notifications (id undefined) and requests + * - Enhanced logging and error reporting with context + * + * ## Making RPC Calls + * + * @code + * // Asynchronous request with callback + * LLSD params; + * params.append(5); + * params.append(3); + * connection->call("add", params, [](const LLSD& result, const LLSD& error) { + * if (error.isUndefined()) { + * LL_INFOS() << "Result: " << result.asReal() << LL_ENDL; + * } else { + * LL_WARNS() << "Error: " << error["message"].asString() << LL_ENDL; + * } + * }); + * + * // Fire-and-forget notification + * connection->notify("log", LLSD("Server started")); + * @endcode + */ +class LLJSONRPCConnection : public LLWebsocketMgr::WSConnection +{ +public: + using ptr_t = std::shared_ptr; + + /// Method handler function signature + /// @param method The method name that was called + /// @param id The request ID (undefined for notifications) + /// @param params The parameters passed to the method + /// @return The result to return to the caller + /// @throw RPCError-derived exceptions for error responses + using MethodHandler = std::function; + + /// Response callback function signature + /// @param result The result from a successful call (undefined if error occurred) + /// @param error The error object if call failed (undefined if successful) + using ResponseCallback = std::function; + + /** + * @brief JSON-RPC error base class + */ + class RPCError : public std::runtime_error + { + public: + // JSON-RPC 2.0 Standard Error Codes + static constexpr S32 PARSE_ERROR = -32700; ///< Invalid JSON was received by the server + static constexpr S32 INVALID_REQUEST = -32600; ///< The JSON sent is not a valid Request object + static constexpr S32 METHOD_NOT_FOUND = -32601; ///< The method does not exist / is not available + static constexpr S32 INVALID_PARAMS = -32602; ///< Invalid method parameter(s) + static constexpr S32 INTERNAL_ERROR = -32603; ///< Internal JSON-RPC error + + // Server Error Range (-32000 to -32099) + static constexpr S32 SERVER_ERROR_MIN = -32099; ///< Server error range minimum + static constexpr S32 SERVER_ERROR_MAX = -32000; ///< Server error range maximum + + // Common server-specific errors + static constexpr S32 CONNECTION_CLOSED = -32000; ///< Connection closed unexpectedly + static constexpr S32 REQUEST_TIMEOUT = -32001; ///< Request timed out + static constexpr S32 UNAUTHORIZED = -32002; ///< Authentication required + static constexpr S32 FORBIDDEN = -32003; ///< Access denied + static constexpr S32 RATE_LIMITED = -32004; ///< Too many requests + static constexpr S32 SERVICE_UNAVAILABLE = -32005; ///< Service temporarily unavailable + static constexpr S32 MESSAGE_TOO_LARGE = -32006; ///< Message exceeds maximum size + static constexpr S32 INVALID_SESSION = -32007; ///< Session expired or invalid + + RPCError(S32 code, const std::string& message, const LLSD& data = LLSD()) + : std::runtime_error(message), mCode(code), mData(data) {} + + S32 getCode() const { return mCode; } + const LLSD& getData() const { return mData; } + + protected: + S32 mCode; + LLSD mData; + }; + + /// Standard JSON-RPC error classes using named constants + class ParseError : public RPCError { + public: + ParseError(const std::string& details = "") + : RPCError(PARSE_ERROR, "Parse error" + (details.empty() ? "" : ": " + details)) {} + }; + + class InvalidRequest : public RPCError { + public: + InvalidRequest(const std::string& details = "") + : RPCError(INVALID_REQUEST, "Invalid Request" + (details.empty() ? "" : ": " + details)) {} + }; + + class MethodNotFound : public RPCError { + public: + MethodNotFound(const std::string& method = "") + : RPCError(METHOD_NOT_FOUND, "Method not found" + (method.empty() ? "" : ": " + method)) {} + }; + + class InvalidParams : public RPCError { + public: + InvalidParams(const std::string& details = "") + : RPCError(INVALID_PARAMS, "Invalid params" + (details.empty() ? "" : ": " + details)) {} + }; + + class InternalError : public RPCError { + public: + InternalError(const std::string& details = "") + : RPCError(INTERNAL_ERROR, "Internal error" + (details.empty() ? "" : ": " + details)) {} + }; + + /// Server-specific errors (in the -32000 to -32099 range) + class ConnectionClosedError : public RPCError { + public: + ConnectionClosedError(const std::string& details = "Connection closed") + : RPCError(CONNECTION_CLOSED, details) {} + }; + + class RequestTimeoutError : public RPCError { + public: + RequestTimeoutError(const std::string& details = "Request timed out") + : RPCError(REQUEST_TIMEOUT, details) {} + }; + + class UnauthorizedError : public RPCError { + public: + UnauthorizedError(const std::string& details = "Authentication required") + : RPCError(UNAUTHORIZED, details) {} + }; + + class ForbiddenError : public RPCError { + public: + ForbiddenError(const std::string& details = "Access denied") + : RPCError(FORBIDDEN, details) {} + }; + + class RateLimitedError : public RPCError { + public: + RateLimitedError(const std::string& details = "Too many requests") + : RPCError(RATE_LIMITED, details) {} + }; + + class ServiceUnavailableError : public RPCError { + public: + ServiceUnavailableError(const std::string& details = "Service temporarily unavailable") + : RPCError(SERVICE_UNAVAILABLE, details) {} + }; + + class MessageTooLargeError : public RPCError { + public: + MessageTooLargeError(const std::string& details = "Message exceeds maximum size") + : RPCError(MESSAGE_TOO_LARGE, details) {} + }; + + class InvalidSessionError : public RPCError { + public: + InvalidSessionError(const std::string& details = "Session expired or invalid") + : RPCError(INVALID_SESSION, details) {} + }; + + + LLJSONRPCConnection(const LLWebsocketMgr::WSServer::ptr_t server, + const LLWebsocketMgr::connection_h& handle) + : LLWebsocketMgr::WSConnection(server, handle) {} + + virtual ~LLJSONRPCConnection() = default; + + // WebSocket connection lifecycle + void onOpen() override; + void onClose() override; + void onMessage(const std::string& message) override; + + /** + * @brief Register a method handler + * @param method The method name to register + * @param handler The function to call when this method is invoked + */ + void registerMethod(const std::string& method, MethodHandler handler); + + /** + * @brief Unregister a method handler + * @param method The method name to unregister + */ + void unregisterMethod(const std::string& method); + + /** + * @brief Make an asynchronous JSON-RPC call + * @param method The method name to call + * @param params The parameters to pass + * @param callback Callback for the response (optional) + * @return The request ID for correlation + */ + LLSD call(const std::string& method, const LLSD& params = LLSD(), + ResponseCallback callback = nullptr); + + /** + * @brief Send a JSON-RPC notification (no response expected) + * @param method The method name + * @param params The parameters to pass + */ + bool notify(const std::string& method, const LLSD& params = LLSD()); + + /** + * @brief Send a successful response to a request + * @param id The request ID from the original request + * @param result The result to return + */ + bool sendResponse(const LLSD& id, const LLSD& result); + + /** + * @brief Send an error response to a request + * @param id The request ID from the original request (can be null) + * @param error The RPCError to send + */ + bool sendError(const LLSD& id, const RPCError& error); + + /** + * @brief Send a batch of requests/notifications + * @param batch Array of request/notification objects + * @param callback Callback for batch response (optional) + */ + bool sendBatch(const LLSD& batch, ResponseCallback callback = nullptr); + +protected: + /** + * @brief Process a single JSON-RPC message + * @param message_obj The parsed JSON message + */ + void processMessage(const LLSD& message_obj); + + /** + * @brief Process a JSON-RPC request + * @param request The request object + */ + void processRequest(const LLSD& request); + + /** + * @brief Process a JSON-RPC response + * @param response The response object + */ + void processResponse(const LLSD& response); + + /** + * @brief Validate a JSON-RPC message structure + * @param message The message to validate + * @param is_request True if validating a request, false for response + */ + bool validateMessage(const LLSD& message, bool is_request = true); + + /** + * @brief Generate the next unique request ID + * @return A server-unique request ID + * + * Generates a server-wide unique identifier using an atomic counter. + * This ensures request IDs are unique across all connections within the + * server instance, providing efficient ID generation with guaranteed uniqueness. + * + * IDs follow the format "rpc_{counter}" where counter is a monotonically + * increasing 64-bit value starting from 1. This approach provides: + * - Guaranteed uniqueness within server scope + * - High performance (atomic increment operation) + * - Predictable, sequential ordering for debugging + * - Thread-safe generation across multiple connections + */ + LLSD generateId(); + +private: + std::unordered_map mMethodHandlers; + std::unordered_map mPendingRequests; +}; + +/** + * @class LLJSONRPCServer + * @brief JSON-RPC 2.0 WebSocket server implementation + * + * This server extends the basic WebSocket server to provide JSON-RPC 2.0 + * protocol support. It manages JSON-RPC connections and provides server-wide + * method registration and broadcasting capabilities. + * + * ## Server-Wide Method Registration + * + * Methods can be registered at the server level and will be available + * on all connections: + * + * @code + * auto server = std::make_shared("rpc_server", 8080); + * + * server->registerGlobalMethod("getServerInfo", [](const std::string& method, const LLSD& id, const LLSD& params) -> LLSD { + * LL_INFOS("JSONRPC") << "Server info requested via " << method << LL_ENDL; + * LLSD info; + * info["name"] = "My RPC Server"; + * info["version"] = "1.0.0"; + * info["uptime"] = LLDate::now().secondsSinceEpoch(); + * return info; + * }); + * + * server->registerGlobalMethod("listMethods", [server](const std::string& method, const LLSD& id, const LLSD& params) -> LLSD { + * return server->getMethodList(); + * }); + * @endcode + * + * ## Broadcasting and Multi-client Operations + * + * @code + * // Broadcast notification to all connected clients + * server->broadcastNotification("serverAlert", LLSD("Server will restart in 5 minutes")); + * + * // Call a method on all clients and collect responses + * server->broadcastCall("getClientStatus", LLSD(), [](const LLSD& responses) { + * for (const auto& response : llsd::inArray(responses)) { + * LL_INFOS() << "Client status: " << response << LL_ENDL; + * } + * }); + * @endcode + */ +class LLJSONRPCServer : public LLWebsocketMgr::WSServer +{ +public: + using ptr_t = std::shared_ptr; + using MethodHandler = LLJSONRPCConnection::MethodHandler; + using ResponseCallback = LLJSONRPCConnection::ResponseCallback; + using BatchResponseCallback = std::function; + + LLJSONRPCServer(const std::string& name, U16 port, bool local_only = true); + virtual ~LLJSONRPCServer() = default; + + // Server lifecycle callbacks + void onConnectionOpened(const LLWebsocketMgr::WSConnection::ptr_t& connection) override; + void onConnectionClosed(const LLWebsocketMgr::WSConnection::ptr_t& connection) override; + + /** + * @brief Register a global method available on all connections + * @param method The method name to register + * @param handler The function to call when this method is invoked + */ + void registerGlobalMethod(const std::string& method, MethodHandler handler); + + /** + * @brief Unregister a global method + * @param method The method name to unregister + */ + void unregisterGlobalMethod(const std::string& method); + + /** + * @brief Get list of registered global methods + * @return Array of method names + */ + LLSD getMethodList() const; + + /** + * @brief Broadcast a notification to all connected clients + * @param method The method name + * @param params The parameters to pass + */ + void broadcastNotification(const std::string& method, const LLSD& params = LLSD()); + + /** + * @brief Call a method on all connected clients + * @param method The method name + * @param params The parameters to pass + * @param callback Callback to receive aggregated responses + */ + void broadcastCall(const std::string& method, const LLSD& params = LLSD(), + BatchResponseCallback callback = nullptr); + + /** + * @brief Get server statistics + * @return Statistics object with connection count, method count, etc. + */ + LLSD getServerStats() const; + +protected: + LLWebsocketMgr::WSConnection::ptr_t connectionFactory(LLWebsocketMgr::WSServer::ptr_t server, + LLWebsocketMgr::connection_h handle) override; + + /** + * @brief Apply global method handlers to a new connection + * @param connection The connection to configure + */ + virtual void setupConnectionMethods(LLJSONRPCConnection::ptr_t connection); + +private: + std::unordered_map mGlobalMethods; + mutable LLMutex mGlobalMethodsMutex; + + std::string mServerName; // Store server name for stats + std::atomic mTotalRequestsHandled{0}; + std::atomic mTotalNotificationsSent{0}; +}; diff --git a/indra/llcorehttp/llwebsocketmgr.cpp b/indra/llcorehttp/llwebsocketmgr.cpp new file mode 100644 index 00000000000..ea87d1e07e5 --- /dev/null +++ b/indra/llcorehttp/llwebsocketmgr.cpp @@ -0,0 +1,674 @@ +/** + * @file llwebsocketmgr.cpp + * @brief WebSocket manager singleton implementation + * + * $LicenseInfo:firstyear=2025&license=viewerlgpl$ + * Second Life Viewer Source Code + * Copyright (C) 2025, 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 "linden_common.h" + +#include "llwebsocketmgr.h" +#include "llerror.h" +#include "llsdserialize.h" +#include "llhost.h" +#include "llsdjson.h" + +#include +#include +#include +#include + +#include +#include +#include + +//------------------------------------------------------------------------ +namespace +{ + using Server_t = websocketpp::server; + using Client_t = websocketpp::client; + using Connection_t = websocketpp::connection; +} + +//------------------------------------------------------------------------ + +//------------------------------------------------------------------------ +// LLWebsocketMgr Implementation +// + +void LLWebsocketMgr::initSingleton() +{ } + +void LLWebsocketMgr::cleanupSingleton() +{ + stopAllServers(); +} + +void LLWebsocketMgr::update() +{ + std::vector stops; + + for (auto &[name, server] : mServers) + { + if (server && server->isRunning()) + { + if (!server->update()) + { + stops.push_back(server); + } + } + } + + for (const auto& server : stops) + { + if (server) + { + LL_DEBUGS("WebSocket") << "Stopping server: " << server->mServerName << LL_ENDL; + removeServer(server->mServerName); + } + } +} + + +LLWebsocketMgr::WSServer::ptr_t LLWebsocketMgr::findServerByName(const std::string &name) const +{ + auto it = mServers.find(std::string(name)); + if (it != mServers.end()) + { + return it->second; + } + return nullptr; +} + +bool LLWebsocketMgr::addServer(const LLWebsocketMgr::WSServer::ptr_t& server) +{ + if (!server) + { + LL_WARNS("WebSocket") << "Attempted to add a null server" << LL_ENDL; + return false; + } + + auto it = mServers.find(server->mServerName); + if (it != mServers.end()) + { + LL_WARNS("WebSocket") << "Server with name " << server->mServerName << " already exists" << LL_ENDL; + return false; + } + mServers[server->mServerName] = server; + LL_INFOS("WebSocket") << "Added WebSocket server: " << server->mServerName << LL_ENDL; + return true; +} + +bool LLWebsocketMgr::removeServer(const std::string& name) +{ + auto it = mServers.find(name); + if (it == mServers.end()) + { + LL_WARNS("WebSocket") << "No server found with name " << name << " to remove" << LL_ENDL; + return false; + } + if (it->second && it->second->isRunning()) + it->second->stop(); + mServers.erase(it); + LL_INFOS("WebSocket") << "Removed WebSocket server: " << name << LL_ENDL; + return true; +} + + +bool LLWebsocketMgr::startServer(const std::string &name) const +{ + LLWebsocketMgr::WSServer::ptr_t server = findServerByName(name); + if (!server) + { + LL_WARNS("WebSocket") << "No server found with name " << name << " to start" << LL_ENDL; + return false; + } + if (server->isRunning()) + { + LL_WARNS("WebSocket") << "Server " << name << " is already running" << LL_ENDL; + return false; + } + return server->start(); +} + +void LLWebsocketMgr::stopServer(const std::string& name) const +{ + LLWebsocketMgr::WSServer::ptr_t server = findServerByName(name); + if (!server) + { + LL_WARNS("WebSocket") << "No server found with name " << name << " to stop" << LL_ENDL; + return; + } + if (!server->isRunning()) + { + LL_WARNS("WebSocket") << "Server " << name << " is not running" << LL_ENDL; + return; + } + server->stop(); +} + +void LLWebsocketMgr::stopAllServers() +{ + for (auto &[name, server] : mServers) + { + if (server && server->isRunning()) + { + LL_INFOS("WebSocket") << "Stopping server: " << name << LL_ENDL; + server->stop(); + } + } + + mServers.clear(); +} + +//------------------------------------------------------------------------ +struct Server_impl +{ + Server_impl(LLWebsocketMgr::WSServer *owner, U16 port, bool local_only) : + mOwner(owner), + mPort(port), + mLocalOnly(local_only) + { + + mServer.set_open_handler([this](websocketpp::connection_hdl hdl) { this->onOpen(hdl); }); + mServer.set_close_handler([this](websocketpp::connection_hdl hdl) { this->onClose(hdl); }); + mServer.set_message_handler([this](websocketpp::connection_hdl hdl, Server_t::message_ptr msg) { this->onMessage(hdl, msg); }); + } + + ~Server_impl() = default; + + /** + * @brief Initialize the websocketpp server and configure listening + * + * Performs the initial setup of the websocketpp server by calling init_asio() + * to initialize the ASIO networking layer, then configures the server to listen + * on the specified port. The binding behavior depends on the mLocalOnly flag: + * - If mLocalOnly is true: binds to "127.0.0.1" (localhost only) + * - If mLocalOnly is false: binds to all available network interfaces + */ + void init() + { + mServer.init_asio(); + try { + if (mLocalOnly) + { + std::stringstream port_str; + port_str << mPort; + mServer.listen("127.0.0.1", port_str.str()); + } + else + { + mServer.listen(mPort); + } + } + catch (const websocketpp::exception& e) + { + LL_WARNS("WebSocket") << "WebSocket server listen exception: " << e.what() << LL_ENDL; + } + catch (const std::exception& e) + { + LL_WARNS("WebSocket") << "WebSocket server listen std::exception: " << e.what() << LL_ENDL; + } + catch (...) + { + LL_WARNS("WebSocket") << "WebSocket server listen unknown exception" << LL_ENDL; + } + } + + /** + * @brief Start the websocket server and begin accepting connections + * @return true if server started successfully, false on error + */ + bool start() + { + //if (!mServer.stopped()) + //{ + // LL_WARNS("WebSocket") << "WebSocket server is already running" << LL_ENDL; + // return false; + //} + + try + { + LL_INFOS("WebSocket") << "Starting WebSocket server on port " << mPort + << (mLocalOnly ? " (localhost only)" : " (all interfaces)") << LL_ENDL; + mServer.start_accept(); + + // Run controlled event loop with periodic stop flag checking + while (!mOwner->mShouldStop && !mServer.stopped()) + { + // Process events for up to 100ms, then check the stop flag + std::chrono::milliseconds timeout(100); + std::size_t handlers_run = mServer.get_io_service().run_for(timeout); + + // If no handlers were run and the server isn't stopped, + // reset the io_service for the next iteration + if (handlers_run == 0 && !mServer.stopped() && !mOwner->mShouldStop) + { + mServer.get_io_service().restart(); + } + } + + LL_INFOS("WebSocket") << "WebSocket server event loop exited cleanly" << LL_ENDL; + return true; + } + catch (const websocketpp::exception& e) + { + LL_WARNS("WebSocket") << "WebSocket server exception: " << e.what() << LL_ENDL; + return false; + } + catch (const std::exception& e) + { + LL_WARNS("WebSocket") << "WebSocket server std::exception: " << e.what() << LL_ENDL; + return false; + } + catch (...) + { + LL_WARNS("WebSocket") << "WebSocket server unknown exception" << LL_ENDL; + return false; + } + } + + void stop() + { + if (mServer.stopped()) + { + return; + } + try + { + mServer.stop_listening(); + mServer.stop(); + } + catch (const std::exception&) + { + LL_WARNS("WebSocket") << "Error stopping WebSocket server" << LL_ENDL; + } + } + + /** + * @brief Handle new connection establishment event + * @param hdl WebSocket connection handle from websocketpp + * + * Called automatically by the websocketpp library when a new client connection + * is successfully established. This method serves as a bridge between the + * low-level websocketpp callback and the high-level WSServer interface. + */ + void onOpen(websocketpp::connection_hdl hdl) const + { + LL_ERRS_IF(!mOwner, "WebSocket") << "mOwner should never be null. If it is, something is very wrong!" << LL_ENDL; + + mOwner->handleOpenConnection(hdl); + } + + /** + * @brief Handle connection closure event + * @param hdl WebSocket connection handle from websocketpp + */ + void onClose(websocketpp::connection_hdl hdl) const + { + LL_ERRS_IF(!mOwner, "WebSocket") << "mOwner should never be null" << LL_ENDL; + mOwner->handleCloseConnection(hdl); + } + + /** + * @brief Handle incoming message from client + * @param hdl WebSocket connection handle identifying the sender + * @param msg Shared pointer to the message object containing payload and metadata + * + * Called automatically by the websocketpp library when a complete message is + * received from a client. This method validates the connection exists, extracts + * the message payload, and forwards it to the appropriate connection handler. + * + * Currently handles text messages only. + */ + void onMessage(websocketpp::connection_hdl hdl, Server_t::message_ptr msg) const + { + LL_ERRS_IF(!mOwner, "WebSocket") << "mOwner should never be null" << LL_ENDL; + LLWebsocketMgr::WSConnection::ptr_t connection = mOwner->getConnection(hdl); + if (!connection) + { + LL_WARNS("WebSocket") << "Received message for unknown connection" << LL_ENDL; + return; + } + + // TODO: check the FIN bit and handle fragmented messages if needed + // TODO: check terminal and close codes and handle connection closure if needed + mOwner->handleMessage(hdl, msg->get_payload()); + } + + //------------------------------------------- + Server_t mServer; ///< The underlying websocketpp server instance + LLWebsocketMgr::WSServer* mOwner{ nullptr }; ///< Back-reference to the owning WSServer instance (guaranteed non-null) + U16 mPort{ 0 }; ///< TCP port number the server listens on + bool mLocalOnly{ true }; ///< Whether to bind to localhost only (true) or all interfaces (false) +}; + +//------------------------------------------------------------------------ +LLWebsocketMgr::WSServer::WSServer(std::string_view name, U16 port, bool local_only): + mServerName(name), + mImpl(std::make_unique(this, port, local_only)) +{ + mImpl->init(); + + // Initialize the server with the given name and host + LL_INFOS("WebSocket") << "Creating WebSocket server: " << name << + " listening " << (mImpl->mLocalOnly ? "locally" : "ON ALL INTERFACES") << + " on port " << mImpl->mPort << LL_ENDL; +} + +LLWebsocketMgr::WSServer::~WSServer() +{ + // Ensure the server is stopped before destruction + stop(); +} + +LLWebsocketMgr::WSConnection::ptr_t LLWebsocketMgr::WSServer::connectionFactory(LLWebsocketMgr::WSServer::ptr_t server, + LLWebsocketMgr::connection_h handle) +{ + return std::make_shared(server, handle); +} + +bool LLWebsocketMgr::WSServer::start() +{ + LL_ERRS_IF(!mImpl, "WebSocket") << "WebSocket server " << mServerName << " implementation is null !" << LL_ENDL; + + LLMutexLock lock(&mThreadMutex); + + // Check if already running + if (isRunning()) + { + LL_WARNS("WebSocket") << "Server " << mServerName << " is already running" << LL_ENDL; + return false; + } + + // Reset the stop flag + mShouldStop = false; + + // Start the server thread + mServerThread = std::thread([this]() { + LL_INFOS("WebSocket") << "WebSocket server thread starting for: " << mServerName << LL_ENDL; + + // Run the controlled server loop that checks the stop flag + // Server_impl accesses mShouldStop through the mOwner pointer + bool success = mImpl->start(); + + if (!success) + { + LL_WARNS("WebSocket") << "WebSocket server thread failed to start for: " << mServerName << LL_ENDL; + } + + LL_INFOS("WebSocket") << "WebSocket server thread exiting for: " << mServerName << LL_ENDL; + }); + + onStarted(); + LL_INFOS("WebSocket") << "Started WebSocket server thread: " << mServerName << LL_ENDL; + return true; +} + +void LLWebsocketMgr::WSServer::stop() +{ + LL_ERRS_IF(!mImpl, "WebSocket") << "WebSocket server " << mServerName << " implementation is null !" << LL_ENDL; + + { + LLMutexLock lock(&mThreadMutex); + + // Check if already stopped + if (!isRunning()) + { + return; + } + + LL_INFOS("WebSocket") << "Stopping WebSocket server: " << mServerName << LL_ENDL; + + mShouldStop = true; + + // Stop the websocket server (this will cause the controlled run loop to exit) + mImpl->stop(); + } // Release the lock here + + if (mServerThread.joinable()) + { + mServerThread.join(); + LL_INFOS("WebSocket") << "WebSocket server thread joined for: " << mServerName << LL_ENDL; + } + onStopped(); +} + +bool LLWebsocketMgr::WSServer::isRunning() const +{ + LL_ERRS_IF(!mImpl, "WebSocket") << "WebSocket server " << mServerName << " implementation is null !" << LL_ENDL; + + // Check both the thread state, websocket server state, and the stop flag + return mServerThread.joinable() && !mImpl->mServer.stopped() && !mShouldStop; +} + +void LLWebsocketMgr::WSServer::broadcastMessage(const std::string& message) +{ + LL_ERRS_IF(!mImpl, "WebSocket") << "WebSocket server " << mServerName << " implementation is null !" << LL_ENDL; + LLMutexLock lock(&mConnectionMutex); + for (const auto& [handle, conn] : mConnections) + { + sendMessageTo(handle, message); + } +} + +bool LLWebsocketMgr::WSServer::sendMessageTo(const connection_h& handle, const std::string& message) +{ + LL_ERRS_IF(!mImpl, "WebSocket") << "WebSocket server " << mServerName << " implementation is null !" << LL_ENDL; + websocketpp::lib::error_code ec; + mImpl->mServer.send(handle, message, websocketpp::frame::opcode::text, ec); + if (ec) + { + LL_WARNS("WebSocket") << mServerName << " failed to send message: " << ec.message() << LL_ENDL; + return false; + } + return true; +} + +bool LLWebsocketMgr::WSServer::closeConnection(const connection_h& handle, U16 code, const std::string& reason) +{ + LL_ERRS_IF(!mImpl, "WebSocket") << "WebSocket server " << mServerName << " implementation is null !" << LL_ENDL; + + try + { + websocketpp::lib::error_code ec; + mImpl->mServer.close(handle, code, reason, ec); + if (ec) + { + LL_WARNS("WebSocket") << mServerName << " failed to close connection: " << ec.message() << LL_ENDL; + return false; + } + + LL_INFOS("WebSocket") << mServerName << " initiated close for connection with code " + << code << " and reason: " << reason << LL_ENDL; + return true; + } + catch (const websocketpp::exception& e) + { + LL_WARNS("WebSocket") << mServerName << " exception closing connection: " << e.what() << LL_ENDL; + return false; + } + catch (const std::exception& e) + { + LL_WARNS("WebSocket") << mServerName << " std::exception closing connection: " << e.what() << LL_ENDL; + return false; + } + catch (...) + { + LL_WARNS("WebSocket") << mServerName << " unknown exception closing connection" << LL_ENDL; + return false; + } +} + +LLWebsocketMgr::WSConnection::ptr_t LLWebsocketMgr::WSServer::getConnection(const connection_h& handle) +{ + LLMutexLock lock(&mConnectionMutex); + auto it = mConnections.find(handle); + if (it != mConnections.end()) + { + return it->second; + } + return nullptr; +} + +LLWebsocketMgr::connection_state_t LLWebsocketMgr::WSServer::getConnectionState(const connection_h& handle) const +{ + websocketpp::lib::error_code ec; + auto con = mImpl->mServer.get_con_from_hdl(handle, ec); + if (ec) + { + LL_WARNS("WebSocket") << mServerName << " failed to get connection state: " << ec.message() << LL_ENDL; + websocketpp::session::state::value state = websocketpp::session::state::closed; + return connection_closed; + } + return static_cast(con->get_state()); +} + + +void LLWebsocketMgr::WSServer::handleOpenConnection(const connection_h& handle) +{ + WSConnection::ptr_t connection; + size_t size(0); + { + LLMutexLock lock(&mConnectionMutex); + auto it = mConnections.find(handle); + if (it == mConnections.end()) + { + connection = connectionFactory(shared_from_this(), handle); + if (!connection) + { + LL_WARNS("WebSocket") << "Failed to create connection for websocket server " << mServerName << LL_ENDL; + return; + } + mConnections[handle] = connection; + } + else + { + connection = it->second; + } + + if (!connection) + { + LL_WARNS("WebSocket") << mServerName << " failed to create connection object" << LL_ENDL; + return; + } + // Removed redundant assignment to mConnections[handle] + size = mConnections.size(); + } + + onConnectionOpened(connection); // TODO: consider letting the server reject the connection here + connection->onOpen(); + LL_INFOS("WebSocket") << mServerName << " opened new connection, total connections: " << size << LL_ENDL; +} + +void LLWebsocketMgr::WSServer::handleCloseConnection(const connection_h& handle) +{ + size_t size(0); + WSConnection::ptr_t connection; + { + LLMutexLock lock(&mConnectionMutex); + auto it = mConnections.find(handle); + if (it != mConnections.end()) + { + connection = it->second; + mConnections.erase(it); + } + size = mConnections.size(); + } + if (connection) + { + connection->onClose(); + onConnectionClosed(connection); + LL_INFOS("WebSocket") << mServerName << " closed connection, total connections: " << size << LL_ENDL; + } + else + { + LL_WARNS("WebSocket") << mServerName << " attempted to close unknown connection" << LL_ENDL; + } +} + +void LLWebsocketMgr::WSServer::handleMessage(const connection_h& handle, const std::string& message) +{ + WSConnection::ptr_t connection = getConnection(handle); + if (connection) + { + connection->onMessage(message); + } + else + { + LL_WARNS("WebSocket") << mServerName << " received message for unknown connection" << LL_ENDL; + } +} + +//------------------------------------------------------------------------ +bool LLWebsocketMgr::WSConnection::sendMessage(const std::string& message) const +{ + if (mOwningServer.expired()) + { + LL_WARNS("WebSocket") << "Attempted to send message on connection with null server reference" << LL_ENDL; + return false; + } + return mOwningServer.lock()->sendMessageTo(mConnectionHandle, message); +} + +bool LLWebsocketMgr::WSConnection::sendMessage(const boost::json::value& json) const +{ + std::string message = boost::json::serialize(json); + return sendMessage(message); +} + +bool LLWebsocketMgr::WSConnection::sendMessage(const LLSD& data) const +{ + return sendMessage(LlsdToJson(data)); +} + +void LLWebsocketMgr::WSConnection::closeConnection(U16 code, const std::string& reason) +{ + if (mOwningServer.expired()) + { + LL_WARNS("WebSocket") << "Attempted to close connection with null server reference" << LL_ENDL; + return; + } + + LL_INFOS("WebSocket") << "WSConnection closing connection with code " << code + << " and reason: " << (reason.empty() ? "(no reason)" : reason) << LL_ENDL; + + if (!mOwningServer.lock()->closeConnection(mConnectionHandle, code, reason)) + { + LL_WARNS("WebSocket") << "Failed to close connection through server" << LL_ENDL; + } +} + +bool LLWebsocketMgr::WSConnection::isConnected() const +{ + if (mOwningServer.expired()) + { + return false; + } + + LLWebsocketMgr::WSServer::ptr_t server = mOwningServer.lock(); + if (!server) + { + return false; + } + return server->getConnectionState(mConnectionHandle) == connection_open; +} diff --git a/indra/llcorehttp/llwebsocketmgr.h b/indra/llcorehttp/llwebsocketmgr.h new file mode 100644 index 00000000000..4165b3cecc4 --- /dev/null +++ b/indra/llcorehttp/llwebsocketmgr.h @@ -0,0 +1,305 @@ +/** + * @file llwebsocketmgr.h + * @brief WebSocket manager singleton for managing WebSocket servers and connections + * + * $LicenseInfo:firstyear=2025&license=viewerlgpl$ + * Second Life Viewer Source Code + * Copyright (C) 2025, 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$ + */ + +#pragma once + +#include "llsingleton.h" +#include "llsd.h" +#include "lluuid.h" +#include "llhost.h" +#include "llmutex.h" + +#include +#include +#include +#include +#include +#include + +#include + +#include + +struct Server_impl; + +/** + * @class LLWebsocketMgr + * @brief Singleton manager for WebSocket connections and servers + * + * This class provides a high-level interface for managing WebSocket connections + * and servers using websocketpp library. It handles both client and server + * connections, provides thread-safe operations, and integrates with the + * existing Linden Lab infrastructure. + */ +class LLWebsocketMgr: public LLSingleton +{ + LLSINGLETON(LLWebsocketMgr) = default; + virtual ~LLWebsocketMgr() = default; + LOG_CLASS(LLWebsocketMgr); + +public: + using connection_h = websocketpp::connection_hdl; + class WSServer; + + enum connection_state_t + { // must map to websocketpp::session::state + connection_connecting = 0, + connection_open = 1, + connection_closing = 2, + connection_closed = 3 + }; + + class WSConnection + { + friend class LLWebsocketMgr; + + public: + using ptr_t = std::shared_ptr; + + /** + * @brief Constructor for WSConnection + * @param server Shared pointer to the parent WSServer + * @param handle WebSocket connection handle from websocketpp + */ + WSConnection(const std::shared_ptr &server, const connection_h& handle): + mConnectionHandle(handle), + mOwningServer(server) + {} + + virtual ~WSConnection() = default; + + /** + * Override this method in derived classes to handle connection establishment. + * This is called after the WebSocket handshake is complete and the connection + * is ready to send/receive messages. + */ + virtual void onOpen() {} + + /** + * Override this method in derived classes to handle connection closure. + * This is called when the connection has been terminated, either normally + * or due to an error condition. + */ + virtual void onClose() {} + + /** + * @brief Called when a message is received + * @param message The received message as a string + * + * Override this method in derived classes to handle incoming messages. + * Currently only text messages are supported. + */ + virtual void onMessage(const std::string& message) {} + + /** + * @brief Send a message to the connected client + * @param message The message string to send + * @return true if the message was queued successfully, false on error + * + * Sends a text message to the remote endpoint. The message is queued + * asynchronously and may not be sent immediately. + */ + bool sendMessage(const std::string& message) const; + bool sendMessage(const boost::json::value& json) const; + bool sendMessage(const LLSD& data) const; + + /** + * @brief Close the WebSocket connection gracefully + * @param code Optional close code (default: normal closure) + * @param reason Optional reason string (default: empty) + * + * Initiates a graceful WebSocket close handshake. The connection will + * send a close frame with the specified code and reason, then wait for + * the remote endpoint to respond with its own close frame before + * actually closing the underlying TCP connection. + * + * Common close codes: + * - 1000: Normal closure (default) + * - 1001: Going away (server shutting down, page navigating away) + * - 1002: Protocol error + * - 1003: Unsupported data type + * - 1008: Policy violation + * - 1009: Message too big + * + * @note After calling this method, no further messages should be sent + * @note The onClose() callback will be invoked when the close handshake completes + */ + void closeConnection(U16 code = 1000, const std::string& reason = std::string()); + + bool isConnected() const; + + protected: + connection_h mConnectionHandle; + std::weak_ptr mOwningServer; // Back-reference to the server this connection belongs to + }; + + /** + * @class WSServer + * @brief Base class for WebSocket servers with customizable connection handling + * + * WSServer provides a high-level abstraction over websocketpp servers, handling + * threading, connection management, and event dispatching. Derive from this class + * to create custom WebSocket servers with application-specific logic. + * + * ## Basic Usage + * + * @code + * class MyServer : public LLWebsocketMgr::WSServer + * { + * public: + * MyServer(const std::string& name, U16 port) + * : WSServer(name, port, false) // Listen on all interfaces + * {} + * + * void onConnectionOpened(const WSConnection::ptr_t& connection) override + * { + * LL_INFOS("MyServer") << "New client connected" << LL_ENDL; + * // Send welcome message + * connection->sendMessage("Welcome to the server!"); + * } + * + * void onConnectionClosed(const WSConnection::ptr_t& connection) override + * { + * LL_INFOS("MyServer") << "Client disconnected" << LL_ENDL; + * } + * + * protected: + * // Use custom connection class + * WSConnection::ptr_t connectionFactory(WSServer::ptr_t server, connection_h handle) override + * { + * return std::make_shared(server, handle); + * } + * }; + * @endcode + * + * ## Connection Management + * + * The server automatically manages connection lifetimes and provides several ways + * to interact with connections: + * + * - `broadcastMessage()` - Send message to all connected clients + * - `sendMessageTo()` - Send message to specific connection + * - `closeConnection()` - Close specific connection with code/reason + * - `getConnection()` - Get connection object by handle + * + * ## Thread Safety + * + * All public methods are thread-safe and can be called from any thread. The server + * runs its own background thread for handling WebSocket events, while connection + * callbacks are also executed on this background thread. + */ + class WSServer: public std::enable_shared_from_this + { + friend struct Server_impl; + friend class WSConnection; + friend class LLWebsocketMgr; + + public: + using ptr_t = std::shared_ptr; + + WSServer(std::string_view name, U16 port, bool local_only = true); + virtual ~WSServer(); + + virtual void onStarted() {} + virtual void onStopped() {} + + virtual void onConnectionOpened(const WSConnection::ptr_t& connection) { } + virtual void onConnectionClosed(const WSConnection::ptr_t& connection) { } + + bool isRunning() const; + size_t getConnectionCount() const + { + LLMutexLock lock(&mConnectionMutex); + return mConnections.size(); + } + + void broadcastMessage(const std::string& message); + virtual bool update() { return true; } + + connection_state_t getConnectionState(const connection_h& handle) const; + + protected: + virtual WSConnection::ptr_t connectionFactory(WSServer::ptr_t server, connection_h handle); + + bool start(); + void stop(); + + bool sendMessageTo(const connection_h& handle, const std::string& message); + + /** + * @brief Close a specific connection gracefully + * @param handle The connection handle to close + * @param code Close code (default: normal closure) + * @param reason Close reason string (default: empty) + * @return true if close was initiated successfully, false on error + * + * Internal method used by WSConnection to close individual connections. + * This method is thread-safe and can be called from any thread. + */ + bool closeConnection(const connection_h& handle, U16 code = 1000, const std::string& reason = std::string()); + + private: + using connection_map_t = std::map >; + + WSConnection::ptr_t getConnection(const connection_h& handle); + + void handleOpenConnection(const connection_h& handle); + void handleCloseConnection(const connection_h& handle); + void handleMessage(const connection_h& handle, const std::string& message); + + std::string mServerName; + std::unique_ptr mImpl; + connection_map_t mConnections; + mutable LLMutex mConnectionMutex; + + // Threading support + std::thread mServerThread; ///< Thread running the ASIO event loop + std::atomic mShouldStop{ false }; ///< Thread-safe stop flag + mutable LLMutex mThreadMutex; ///< Mutex for thread synchronization + }; + + // Server and Connection Management + WSServer::ptr_t findServerByName(const std::string &name) const; + + bool addServer(const WSServer::ptr_t& server); + bool removeServer(const std::string &name); + + bool startServer(const std::string &name) const; + void stopServer(const std::string &name) const; + + void update(); + +protected: + void initSingleton() override; + void cleanupSingleton() override; + +private: + using server_map_t = std::map; + + void stopAllServers(); + + server_map_t mServers; +}; diff --git a/indra/llcrashlogger/CMakeLists.txt b/indra/llcrashlogger/CMakeLists.txt deleted file mode 100644 index 6ac73c0d322..00000000000 --- a/indra/llcrashlogger/CMakeLists.txt +++ /dev/null @@ -1,23 +0,0 @@ -# -*- cmake -*- - -project(llcrashlogger) - -include(00-Common) -include(LLCoreHttp) -include(LLCommon) - -set(llcrashlogger_SOURCE_FILES - llcrashlogger.cpp - llcrashlock.cpp - ) - -set(llcrashlogger_HEADER_FILES - CMakeLists.txt - llcrashlogger.h - llcrashlock.h - ) - -list(APPEND llcrashlogger_SOURCE_FILES ${llcrashlogger_HEADER_FILES}) - -add_library(llcrashlogger ${llcrashlogger_SOURCE_FILES}) -target_link_libraries( llcrashlogger llcommon llmessage llcorehttp llxml llfilesystem ) diff --git a/indra/llcrashlogger/README.txt b/indra/llcrashlogger/README.txt deleted file mode 100644 index 6932a8d9c31..00000000000 --- a/indra/llcrashlogger/README.txt +++ /dev/null @@ -1,3 +0,0 @@ -This component is no longer used in Linden Lab builds. -Change requests to support continued use by open source -builds are welcome. diff --git a/indra/llcrashlogger/llcrashlock.cpp b/indra/llcrashlogger/llcrashlock.cpp deleted file mode 100644 index bc34f6798fd..00000000000 --- a/indra/llcrashlogger/llcrashlock.cpp +++ /dev/null @@ -1,212 +0,0 @@ -/** - * @file llformat.cpp - * @date January 2007 - * @brief string formatting utility - * - * $LicenseInfo:firstyear=2007&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 "linden_common.h" - -#include "llapr.h" // thread-related functions -#include "llcrashlock.h" -#include "lldir.h" -#include "llsd.h" -#include "llsdserialize.h" -#include "llframetimer.h" -#include -#include -#include -#include - - -#if LL_WINDOWS //For windows platform. -#include -#include - -bool LLCrashLock::isProcessAlive(U32 pid, const std::string& pname) -{ - std::wstring wpname = ll_convert_string_to_wide(pname); - - HANDLE snapshot; - PROCESSENTRY32 pe32{}; - - bool matched = false; - - snapshot = CreateToolhelp32Snapshot(TH32CS_SNAPPROCESS, 0); - if (snapshot == INVALID_HANDLE_VALUE) - { - return false; - } - else - { - pe32.dwSize = sizeof(PROCESSENTRY32); - if (Process32First(snapshot, &pe32)) - { - do { - std::wstring wexecname = pe32.szExeFile; - std::string execname = ll_convert_wide_to_string(wexecname); - if (!wpname.compare(pe32.szExeFile)) - { - if (pid == (U32)pe32.th32ProcessID) - { - matched = true; - break; - } - } - } while (Process32Next(snapshot, &pe32)); - } - } - - CloseHandle(snapshot); - return matched; -} - -#else //Everyone Else -bool LLCrashLock::isProcessAlive(U32 pid, const std::string& pname) -{ - //Will boost.process ever become a reality? - std::stringstream cmd; - - cmd << "pgrep '" << pname << "' | grep '^" << pid << "$'"; - return (!system(cmd.str().c_str())); -} -#endif //Everyone else. - - -LLCrashLock::LLCrashLock() : mCleanUp(true), mWaitingPID(0) -{ -} - -void LLCrashLock::setCleanUp(bool cleanup) -{ - mCleanUp = cleanup; //Allow cleanup to be disabled for debugging. -} - -LLSD LLCrashLock::getLockFile(std::string filename) -{ - LLSD lock_sd = LLSD::emptyMap(); - - llifstream ifile(filename.c_str()); - - if (ifile.is_open()) - { - LLSDSerialize::fromXML(lock_sd, ifile); - ifile.close(); - } - - return lock_sd; -} - -bool LLCrashLock::putLockFile(std::string filename, const LLSD& data) -{ - bool result = true; - llofstream ofile(filename.c_str()); - - if (!LLSDSerialize::toXML(data,ofile)) - { - result=false; - } - ofile.close(); - return result; -} - -bool LLCrashLock::requestMaster( F32 timeout ) -{ - if (mMaster.empty()) - { - mMaster = gDirUtilp->getExpandedFilename(LL_PATH_LOGS, - "crash_master.lock"); - } - - LLSD lock_sd=getLockFile(mMaster); - - if (lock_sd.has("pid")) - { - mWaitingPID = lock_sd["pid"].asInteger(); - if ( isProcessAlive(mWaitingPID, gDirUtilp->getExecutableFilename()) ) - { - mTimer.resetWithExpiry(timeout); - return false; - } - } - - U32 pid = getpid(); - lock_sd["pid"] = (LLSD::Integer)pid; - return putLockFile(mMaster,lock_sd); -} - -bool LLCrashLock::checkMaster() -{ - if (mWaitingPID) - { - return (!isProcessAlive(mWaitingPID, gDirUtilp->getExecutableFilename())); - } - return false; -} - -bool LLCrashLock::isWaiting() -{ - return !mTimer.hasExpired(); -} - -void LLCrashLock::releaseMaster() -{ - //Yeeeeeeehaw - unlink(mMaster.c_str()); -} - -LLSD LLCrashLock::getProcessList() -{ - if (mDumpTable.empty()) - { - mDumpTable= gDirUtilp->getExpandedFilename(LL_PATH_LOGS, - "crash_table.lock"); - } - return getLockFile(mDumpTable); -} - -//static -bool LLCrashLock::fileExists(std::string filename) -{ -#ifdef LL_WINDOWS // or BOOST_WINDOWS_API - boost::filesystem::path file_path(ll_convert(filename)); -#else - boost::filesystem::path file_path(filename); -#endif - return boost::filesystem::exists(file_path); -} - -void LLCrashLock::cleanupProcess(std::string proc_dir) -{ -#ifdef LL_WINDOWS // or BOOST_WINDOWS_API - boost::filesystem::path dir_path(ll_convert(proc_dir)); -#else - boost::filesystem::path dir_path(proc_dir); -#endif - boost::filesystem::remove_all(dir_path); -} - -bool LLCrashLock::putProcessList(const LLSD& proc_sd) -{ - return putLockFile(mDumpTable,proc_sd); -} diff --git a/indra/llcrashlogger/llcrashlock.h b/indra/llcrashlogger/llcrashlock.h deleted file mode 100644 index b20555b7468..00000000000 --- a/indra/llcrashlogger/llcrashlock.h +++ /dev/null @@ -1,73 +0,0 @@ -/** - * @file llcrashlock.h - * @brief Maintainence of disk locking files for crash reporting - * - * $LicenseInfo:firstyear=2001&license=viewerlgpl$ - * Second Life Viewer Source Code - * Copyright (C) 2010, Linden Research, Inc. - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; - * version 2.1 of the License only. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA - * - * Linden Research, Inc., 945 Battery Street, San Francisco, CA 94111 USA - * $/LicenseInfo$ - */ - -#ifndef LL_CRASHLOCK_H -#define LL_CRASHLOCK_H - -#include "llframetimer.h" - -class LLSD; - -#if !LL_WINDOWS //For non-windows platforms. -#include -#endif - -//Crash reporter will now be kicked off by the viewer but otherwise -//run independent of the viewer. - -class LLCrashLock -{ -public: - LLCrashLock(); - bool requestMaster( F32 timeout=300.0); //Wait until timeout for master lock. - bool checkMaster(); //True if available. False if not. - void releaseMaster( ); //Release master lockfile. - bool isLockPresent(std::string filename); //Check if lockfile exists. - bool isProcessAlive(U32 pid, const std::string& pname); //Check if pid is alive. - bool isWaiting(); //Waiting for master lock to be released. - LLSD getProcessList(); //Get next process pid/dir pairs - void cleanupProcess(std::string proc_dir); //Remove from list, clean up working dir. - bool putProcessList(const LLSD& processlist); //Write pid/dir pairs back to disk. - static bool fileExists(std::string filename); - - - //getters - S32 getPID(); - - //setters - void setCleanUp(bool cleanup=true); - void setSaveName(std::string savename); -private: - LLSD getLockFile(std::string filename); - bool putLockFile(std::string filename, const LLSD& data); - bool mCleanUp; - std::string mMaster; - std::string mDumpTable; - U32 mWaitingPID; //The process we're waiting on if any. - LLFrameTimer mTimer; -}; - -#endif // LL_CRASHLOCK_H diff --git a/indra/llcrashlogger/llcrashlogger.cpp b/indra/llcrashlogger/llcrashlogger.cpp deleted file mode 100644 index d5c585b45e0..00000000000 --- a/indra/llcrashlogger/llcrashlogger.cpp +++ /dev/null @@ -1,682 +0,0 @@ - /** -* @file llcrashlogger.cpp -* @brief Crash logger implementation -* -* $LicenseInfo:firstyear=2003&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 -#include -#include -#include - -#include "llcrashlogger.h" -#include "llcrashlock.h" -#include "linden_common.h" -#include "llstring.h" -#include "indra_constants.h" // CRASH_BEHAVIOR_... -#include "llerror.h" -#include "llerrorcontrol.h" -#include "lltimer.h" -#include "lldir.h" -#include "llfile.h" -#include "llsdserialize.h" -#include "llproxy.h" -#include "llcorehttputil.h" -#include "llhttpsdhandler.h" -#include "httpcommon.h" -#include "httpresponse.h" -#include "llcleanup.h" - -#include -#include - -bool gBreak = false; -bool gSent = false; - -int LLCrashLogger::ssl_mutex_count = 0; -LLCoreInt::HttpMutex ** LLCrashLogger::ssl_mutex_list = NULL; - -#define CRASH_UPLOAD_RETRIES 3 /* seconds */ -#define CRASH_UPLOAD_TIMEOUT 180 /* seconds */ - -class LLCrashLoggerHandler : public LLHttpSDHandler -{ - LOG_CLASS(LLCrashLoggerHandler); -public: - LLCrashLoggerHandler() {} - -protected: - virtual void onSuccess(LLCore::HttpResponse * response, const LLSD &content); - virtual void onFailure(LLCore::HttpResponse * response, LLCore::HttpStatus status); - -}; - -void LLCrashLoggerHandler::onSuccess(LLCore::HttpResponse * response, const LLSD &content) -{ - LL_DEBUGS("CRASHREPORT") << "Request to " << response->getRequestURL() << "succeeded" << LL_ENDL; - gBreak = true; - gSent = true; -} - -void LLCrashLoggerHandler::onFailure(LLCore::HttpResponse * response, LLCore::HttpStatus status) -{ - LL_WARNS("CRASHREPORT") << "Request to " << response->getRequestURL() - << " failed: " << status.toString() << LL_ENDL; - gBreak = true; -} - -LLCrashLogger::LLCrashLogger() : - mCrashBehavior(CRASH_BEHAVIOR_ALWAYS_SEND), - mCrashInPreviousExec(false), - mCrashSettings("CrashSettings"), - mSentCrashLogs(false), - mCrashHost("") -{ -} - -LLCrashLogger::~LLCrashLogger() -{ - -} - -// TRIM_SIZE must remain larger than LINE_SEARCH_SIZE. -const int TRIM_SIZE = 128000; -const int LINE_SEARCH_DIST = 500; -const std::string SKIP_TEXT = "\n ...Skipping... \n"; -void trimSLLog(std::string& sllog) -{ - if(sllog.length() > TRIM_SIZE * 2) - { - std::string::iterator head = sllog.begin() + TRIM_SIZE; - std::string::iterator tail = sllog.begin() + sllog.length() - TRIM_SIZE; - std::string::iterator new_head = std::find(head, head - LINE_SEARCH_DIST, '\n'); - if(new_head != head - LINE_SEARCH_DIST) - { - head = new_head; - } - - std::string::iterator new_tail = std::find(tail, tail + LINE_SEARCH_DIST, '\n'); - if(new_tail != tail + LINE_SEARCH_DIST) - { - tail = new_tail; - } - - sllog.erase(head, tail); - sllog.insert(head, SKIP_TEXT.begin(), SKIP_TEXT.end()); - } -} - -std::string getStartupStateFromLog(std::string& sllog) -{ - std::string startup_state = "STATE_FIRST"; - std::string startup_token = "Startup state changing from "; - - auto index = sllog.rfind(startup_token); - if (index < 0 || index + startup_token.length() > sllog.length()) { - return startup_state; - } - - // find new line - char cur_char = sllog[index + startup_token.length()]; - std::string::size_type newline_loc = index + startup_token.length(); - while(cur_char != '\n' && newline_loc < sllog.length()) - { - newline_loc++; - cur_char = sllog[newline_loc]; - } - - // get substring and find location of " to " - std::string state_line = sllog.substr(index, newline_loc - index); - std::string::size_type state_index = state_line.find(" to "); - startup_state = state_line.substr(state_index + 4, state_line.length() - state_index - 4); - - return startup_state; -} - -bool LLCrashLogger::readFromXML(LLSD& dest, const std::string& filename ) -{ - std::string db_file_name = gDirUtilp->getExpandedFilename(LL_PATH_DUMP,filename); - llifstream log_file(db_file_name.c_str()); - - // Look for it in the given file - if (log_file.is_open()) - { - LLSDSerialize::fromXML(dest, log_file); - log_file.close(); - return true; - } - else - { - LL_WARNS("CRASHREPORT") << "Failed to open " << db_file_name << LL_ENDL; - } - return false; -} - -void LLCrashLogger::mergeLogs( LLSD src_sd ) -{ - LLSD::map_iterator iter = src_sd.beginMap(); - LLSD::map_iterator end = src_sd.endMap(); - for( ; iter != end; ++iter) - { - mDebugLog[iter->first] = iter->second; - } -} - -bool LLCrashLogger::readMinidump(std::string minidump_path) -{ - size_t length=0; - - llifstream minidump_stream(minidump_path.c_str(), std::ios_base::in | std::ios_base::binary); - if (minidump_stream.is_open()) - { - minidump_stream.seekg(0, std::ios::end); - length = (size_t)minidump_stream.tellg(); - LL_WARNS("CRASHREPORT") << "minidump length "<< length <(&(data[0])),length); - minidump_stream.close(); - - mCrashInfo["Minidump"] = data; - } - else - { - LL_WARNS("CRASHREPORT") << "failed to open minidump "< 0; -} - -void LLCrashLogger::gatherFiles() -{ - updateApplication("Gathering logs..."); - - LLSD static_sd; - LLSD dynamic_sd; - //if we ever want to change the endpoint we send crashes to - //we can construct a file download ( a la feature table filename for example) - //containing the new endpoint - LLSD endpoint; - std::string grid; - std::string fqdn; - - bool has_logs = readFromXML( static_sd, "static_debug_info.log" ); - has_logs |= readFromXML( dynamic_sd, "dynamic_debug_info.log" ); - - - if ( has_logs ) - { - mDebugLog = static_sd; - mergeLogs(dynamic_sd); - mCrashInPreviousExec = mDebugLog["CrashNotHandled"].asBoolean(); - - mFileMap["SecondLifeLog"] = mDebugLog["SLLog"].asString(); - mFileMap["SettingsXml"] = mDebugLog["SettingsFilename"].asString(); - mFileMap["CrashHostUrl"] = loadCrashURLSetting(); - if(mDebugLog.has("CAFilename")) - { - LLCore::HttpRequest::setStaticPolicyOption(LLCore::HttpRequest::PO_CA_FILE, - LLCore::HttpRequest::GLOBAL_POLICY_ID, mDebugLog["CAFilename"].asString(), NULL); - } - else - { - LLCore::HttpRequest::setStaticPolicyOption(LLCore::HttpRequest::PO_CA_FILE, - LLCore::HttpRequest::GLOBAL_POLICY_ID, gDirUtilp->getCAFile(), NULL); - } - - LL_INFOS("CRASHREPORT") << "Using log file from debug log " << mFileMap["SecondLifeLog"] << LL_ENDL; - LL_INFOS("CRASHREPORT") << "Using settings file from debug log " << mFileMap["SettingsXml"] << LL_ENDL; - } - else - { - // Figure out the filename of the second life log - LLCore::HttpRequest::setStaticPolicyOption(LLCore::HttpRequest::PO_CA_FILE, - LLCore::HttpRequest::GLOBAL_POLICY_ID, gDirUtilp->getCAFile(), NULL); - - mFileMap["SecondLifeLog"] = gDirUtilp->getExpandedFilename(LL_PATH_DUMP,"SecondLife.log"); - mFileMap["SettingsXml"] = gDirUtilp->getExpandedFilename(LL_PATH_USER_SETTINGS,"settings.xml"); - } - - if (!gDirUtilp->fileExists(mFileMap["SecondLifeLog"]) ) //We would prefer to get this from the per-run but here's our fallback. - { - mFileMap["SecondLifeLog"] = gDirUtilp->getExpandedFilename(LL_PATH_LOGS,"SecondLife.old"); - } - - gatherPlatformSpecificFiles(); - - - if ( has_logs && (mFileMap["CrashHostUrl"] != "") ) - { - mCrashHost = mFileMap["CrashHostUrl"]; - } - - //default to agni, per product - mAltCrashHost = "http://viewercrashreport.agni.lindenlab.com/cgi-bin/viewercrashreceiver.py"; - - mCrashInfo["DebugLog"] = mDebugLog; - mFileMap["StatsLog"] = gDirUtilp->getExpandedFilename(LL_PATH_DUMP,"stats.log"); - - updateApplication("Encoding files..."); - - for(std::map::iterator itr = mFileMap.begin(); itr != mFileMap.end(); ++itr) - { - std::string file = (*itr).second; - if (!file.empty()) - { - LL_DEBUGS("CRASHREPORT") << "trying to read " << itr->first << ": " << file << LL_ENDL; - llifstream f(file.c_str()); - if(f.is_open()) - { - std::stringstream s; - s << f.rdbuf(); - - std::string crash_info = s.str(); - if(itr->first == "SecondLifeLog") - { - if(!mCrashInfo["DebugLog"].has("StartupState")) - { - mCrashInfo["DebugLog"]["StartupState"] = getStartupStateFromLog(crash_info); - } - trimSLLog(crash_info); - } - - mCrashInfo[(*itr).first] = LLStringFn::strip_invalid_xml(rawstr_to_utf8(crash_info)); - } - else - { - LL_WARNS("CRASHREPORT") << "Failed to open file " << file << LL_ENDL; - } - } - else - { - LL_DEBUGS("CRASHREPORT") << "empty file in list for " << itr->first << LL_ENDL; - } - } - - std::string minidump_path; - // Add minidump as binary. - bool has_minidump = mDebugLog.has("MinidumpPath"); - - if (has_minidump) - { - minidump_path = mDebugLog["MinidumpPath"].asString(); - has_minidump = readMinidump(minidump_path); - } - else - { - LL_WARNS("CRASHREPORT") << "DebugLog does not have MinidumpPath" << LL_ENDL; - } - - if (!has_minidump) //Viewer was probably so hosed it couldn't write remaining data. Try brute force. - { - //Look for a filename at least 30 characters long in the dump dir which contains the characters MDMP as the first 4 characters in the file. - typedef std::vector vec; - std::string pathname = gDirUtilp->getExpandedFilename(LL_PATH_DUMP,""); - LL_WARNS("CRASHREPORT") << "Searching for minidump in " << pathname << LL_ENDL; - vec file_vec = gDirUtilp->getFilesInDir(pathname); - for(vec::const_iterator iter=file_vec.begin(); !has_minidump && iter!=file_vec.end(); ++iter) - { - if ( ( iter->length() > 30 ) && (iter->rfind(".dmp") == (iter->length()-4) ) ) - { - std::string fullname = pathname + *iter; - llifstream fdat(fullname.c_str(), std::ifstream::binary); - if (fdat) - { - char buf[5]; - fdat.read(buf,4); - fdat.close(); - if (!strncmp(buf,"MDMP",4)) - { - minidump_path = *iter; - has_minidump = readMinidump(fullname); - mDebugLog["MinidumpPath"] = fullname; - } - else - { - LL_DEBUGS("CRASHREPORT") << "MDMP not found in " << fullname << LL_ENDL; - } - } - else - { - LL_DEBUGS("CRASHREPORT") << "failed to open " << fullname << LL_ENDL; - } - } - else - { - LL_DEBUGS("CRASHREPORT") << "Name does not match minidump name pattern " << *iter << LL_ENDL; - } - } - } - else - { - LL_WARNS("CRASHREPORT") << "readMinidump returned no minidump" << LL_ENDL; - } -} - -LLSD LLCrashLogger::constructPostData() -{ - return mCrashInfo; -} - -const char* const CRASH_SETTINGS_FILE = "settings_crash_behavior.xml"; - -std::string LLCrashLogger::loadCrashURLSetting() -{ - - // First check user_settings (in the user's home dir) - std::string filename = gDirUtilp->getExpandedFilename(LL_PATH_USER_SETTINGS, CRASH_SETTINGS_FILE); - if (! mCrashSettings.loadFromFile(filename)) - { - // Next check app_settings (in the SL program dir) - std::string filename = gDirUtilp->getExpandedFilename(LL_PATH_APP_SETTINGS, CRASH_SETTINGS_FILE); - mCrashSettings.loadFromFile(filename); - } - - if (! mCrashSettings.controlExists("CrashHostUrl")) - { - return ""; - } - else - { - return mCrashSettings.getString("CrashHostUrl"); - } -} - -bool LLCrashLogger::runCrashLogPost(std::string host, LLSD data, std::string msg, int retries, int timeout) -{ - LLCore::HttpRequest::ptr_t httpRequest(new LLCore::HttpRequest); - LLCore::HttpOptions::ptr_t httpOpts(new LLCore::HttpOptions); - - httpOpts->setTimeout(timeout); - httpOpts->setSSLVerifyPeer(false); - - for(int i = 0; i < retries; ++i) - { - updateApplication(llformat("%s, try %d...", msg.c_str(), i+1)); - - LL_INFOS("CRASHREPORT") << "POST crash data to " << host << LL_ENDL; - LLCore::HttpHandle handle = LLCoreHttpUtil::requestPostWithLLSD(httpRequest.get(), LLCore::HttpRequest::DEFAULT_POLICY_ID, - host, data, httpOpts, LLCore::HttpHeaders::ptr_t(), LLCore::HttpHandler::ptr_t(new LLCrashLoggerHandler)); - - if (handle == LLCORE_HTTP_HANDLE_INVALID) - { - LLCore::HttpStatus status = httpRequest->getStatus(); - LL_WARNS("CRASHREPORT") << "Request POST failed to " << host << " with status of [" << - status.getType() << "]\"" << status.toString() << "\"" << LL_ENDL; - return false; - } - - while(!gBreak) - { - ms_sleep(250); - updateApplication(); // No new message, just pump the IO - httpRequest->update(0L); - } - if(gSent) - { - return gSent; - } - - LL_WARNS("CRASHREPORT") << "Failed to send crash report to \"" << host << "\"" << LL_ENDL; - } - return gSent; -} - -bool LLCrashLogger::sendCrashLog(std::string dump_dir) -{ - - gDirUtilp->setDumpDir( dump_dir ); - - std::string dump_path = gDirUtilp->getExpandedFilename(LL_PATH_LOGS, - "SecondLifeCrashReport"); - std::string report_file = dump_path + ".log"; - - LL_DEBUGS("CRASHREPORT") << "sending " << report_file << LL_ENDL; - - gatherFiles(); - - LLSD post_data; - post_data = constructPostData(); - - updateApplication("Sending reports..."); - - llofstream out_file(report_file.c_str()); - LLSDSerialize::toPrettyXML(post_data, out_file); - out_file.flush(); - out_file.close(); - - bool sent = false; - - if(mCrashHost != "") - { - LL_WARNS("CRASHREPORT") << "Sending crash data to server from CrashHostUrl '" << mCrashHost << "'" << LL_ENDL; - - std::string msg = "Using override crash server... "; - msg = msg+mCrashHost.c_str(); - updateApplication(msg.c_str()); - - sent = runCrashLogPost(mCrashHost, post_data, std::string("Sending to server"), CRASH_UPLOAD_RETRIES, CRASH_UPLOAD_TIMEOUT); - } - - if(!sent) - { - updateApplication("Using default server..."); - sent = runCrashLogPost(mAltCrashHost, post_data, std::string("Sending to default server"), CRASH_UPLOAD_RETRIES, CRASH_UPLOAD_TIMEOUT); - } - - mSentCrashLogs = sent; - - return sent; -} - -bool LLCrashLogger::sendCrashLogs() -{ - LLSD locks = mKeyMaster.getProcessList(); - LLSD newlocks = LLSD::emptyArray(); - - LLSD opts = getOptionData(PRIORITY_COMMAND_LINE); - LLSD rec; - - if ( opts.has("pid") && opts.has("dumpdir") && opts.has("procname") ) - { - rec["pid"]=opts["pid"]; - rec["dumpdir"]=opts["dumpdir"]; - rec["procname"]=opts["procname"]; - } - - if (locks.isArray()) - { - for (LLSD::array_iterator lock=locks.beginArray(); - lock !=locks.endArray(); - ++lock) - { - if ( (*lock).has("pid") && (*lock).has("dumpdir") && (*lock).has("procname") ) - { - if ( mKeyMaster.isProcessAlive( (*lock)["pid"].asInteger(), (*lock)["procname"].asString() ) ) - { - newlocks.append(*lock); - } - else - { - //TODO: This is a hack but I didn't want to include boost in another file or retest everything related to lldir - if (LLCrashLock::fileExists((*lock)["dumpdir"].asString())) - { - //the viewer cleans up the log directory on clean shutdown - //but is ignorant of the locking table. - if (!sendCrashLog((*lock)["dumpdir"].asString())) - { - newlocks.append(*lock); //Failed to send log so don't delete it. - } - else - { - mKeyMaster.cleanupProcess((*lock)["dumpdir"].asString()); - } - } - } - } - else - { - LL_INFOS() << "Discarding corrupted entry from lock table." << LL_ENDL; - } - } - } - - if (rec) - { - newlocks.append(rec); - } - - mKeyMaster.putProcessList(newlocks); - return true; -} - -void LLCrashLogger::updateApplication(const std::string& message) -{ - if (!message.empty()) LL_INFOS("CRASHREPORT") << message << LL_ENDL; -} - -bool LLCrashLogger::init() -{ - LL_DEBUGS("CRASHREPORT") << LL_ENDL; - - LLCore::LLHttp::initialize(); - - // We assume that all the logs we're looking for reside on the current drive - gDirUtilp->initAppDirs("SecondLife"); - - LLError::initForApplication(gDirUtilp->getExpandedFilename(LL_PATH_USER_SETTINGS, ""), gDirUtilp->getExpandedFilename(LL_PATH_APP_SETTINGS, "")); - - // Default to the product name "Second Life" (this is overridden by the -name argument) - mProductName = "Second Life"; - - // Rename current log file to ".old" - std::string old_log_file = gDirUtilp->getExpandedFilename(LL_PATH_LOGS, "crashreport.log.old"); - std::string log_file = gDirUtilp->getExpandedFilename(LL_PATH_LOGS, "crashreport.log"); - - LLFile::rename(log_file.c_str(), old_log_file.c_str()); - - // Set the log file to crashreport.log - LLError::logToFile(log_file); //NOTE: Until this line, LL_INFOS LL_WARNS, etc are blown to the ether. - - LL_INFOS("CRASHREPORT") << "Crash reporter file rotation complete." << LL_ENDL; - - // Handle locking - bool locked = mKeyMaster.requestMaster(); //Request master locking file. wait time is defaulted to 300S - - while (!locked && mKeyMaster.isWaiting()) - { - LL_INFOS("CRASHREPORT") << "Waiting for lock." << LL_ENDL; -#if LL_WINDOWS - Sleep(1000); -#else - ::sleep(1); -#endif - locked = mKeyMaster.checkMaster(); - } - - if (!locked) - { - LL_WARNS("CRASHREPORT") << "Unable to get master lock. Another crash reporter may be hung." << LL_ENDL; - return false; - } - - mCrashSettings.declareS32("CrashSubmitBehavior", CRASH_BEHAVIOR_ALWAYS_SEND, - "Controls behavior when viewer crashes " - "(0 = ask before sending crash report, " - "1 = always send crash report, " - "2 = never send crash report)"); - - init_curl(); - LLCore::HttpRequest::createService(); - LLCore::HttpRequest::startThread(); - - return true; -} - -// For cleanup code common to all platforms. -void LLCrashLogger::commonCleanup() -{ - term_curl(); - LLError::logToFile(""); //close crashreport.log - SUBSYSTEM_CLEANUP(LLProxy); -} - -void LLCrashLogger::init_curl() -{ - curl_global_init(CURL_GLOBAL_ALL); - - ssl_mutex_count = CRYPTO_num_locks(); - if (ssl_mutex_count > 0) - { - ssl_mutex_list = new LLCoreInt::HttpMutex *[ssl_mutex_count]; - - for (int i(0); i < ssl_mutex_count; ++i) - { - ssl_mutex_list[i] = new LLCoreInt::HttpMutex; - } - - CRYPTO_set_locking_callback(ssl_locking_callback); - CRYPTO_THREADID_set_callback(ssl_thread_id_callback); - } -} - - -void LLCrashLogger::term_curl() -{ - CRYPTO_set_locking_callback(NULL); - for (int i(0); i < ssl_mutex_count; ++i) - { - delete ssl_mutex_list[i]; - } - delete[] ssl_mutex_list; -} - - -void LLCrashLogger::ssl_thread_id_callback(CRYPTO_THREADID* pthreadid) -{ -#if LL_WINDOWS - CRYPTO_THREADID_set_pointer(pthreadid, GetCurrentThread()); -#else - CRYPTO_THREADID_set_pointer(pthreadid, reinterpret_cast(pthread_self())); -#endif -} - - -void LLCrashLogger::ssl_locking_callback(int mode, int type, const char * /* file */, int /* line */) -{ - if (type >= 0 && type < ssl_mutex_count) - { - if (mode & CRYPTO_LOCK) - { - ssl_mutex_list[type]->lock(); - } - else - { - ssl_mutex_list[type]->unlock(); - } - } -} - diff --git a/indra/llcrashlogger/llcrashlogger.h b/indra/llcrashlogger/llcrashlogger.h deleted file mode 100644 index e5bf19434af..00000000000 --- a/indra/llcrashlogger/llcrashlogger.h +++ /dev/null @@ -1,97 +0,0 @@ -/** -* @file llcrashlogger.h -* @brief Crash Logger Definition -* -* $LicenseInfo:firstyear=2003&license=viewerlgpl$ -* Second Life Viewer Source Code -* Copyright (C) 2010, Linden Research, Inc. -* -* This library is free software; you can redistribute it and/or -* modify it under the terms of the GNU Lesser General Public -* License as published by the Free Software Foundation; -* version 2.1 of the License only. -* -* This library is distributed in the hope that it will be useful, -* but WITHOUT ANY WARRANTY; without even the implied warranty of -* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -* Lesser General Public License for more details. -* -* You should have received a copy of the GNU Lesser General Public -* License along with this library; if not, write to the Free Software -* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA -* -* Linden Research, Inc., 945 Battery Street, San Francisco, CA 94111 USA -* $/LicenseInfo$ -*/ -#ifndef LLCRASHLOGGER_H -#define LLCRASHLOGGER_H - -#include - -#include "linden_common.h" - -#include "llapp.h" -#include "llsd.h" -#include "llcontrol.h" -#include "llcrashlock.h" -#include "_mutex.h" - -// We shouldn't have to know the exact declaration of CRYPTO_THREADID, but VS -// 2017 complains if we forward-declare it as simply 'struct CRYPTO_THREADID'. -struct crypto_threadid_st; -typedef crypto_threadid_st CRYPTO_THREADID; - -// Crash reporter behavior -const S32 CRASH_BEHAVIOR_ASK = 0; -const S32 CRASH_BEHAVIOR_ALWAYS_SEND = 1; -const S32 CRASH_BEHAVIOR_NEVER_SEND = 2; - -class LLCrashLogger : public LLApp -{ -public: - LLCrashLogger(); - virtual ~LLCrashLogger(); - std::string loadCrashURLSetting(); - bool readFromXML(LLSD& dest, const std::string& filename ); - void gatherFiles(); - void mergeLogs( LLSD src_sd ); - - virtual void gatherPlatformSpecificFiles() {} - bool sendCrashLog(std::string dump_dir); - bool sendCrashLogs(); - LLSD constructPostData(); - virtual void updateApplication(const std::string& message = LLStringUtil::null); - virtual bool init(); - virtual bool frame() = 0; - virtual bool cleanup() = 0; - void commonCleanup(); - void setUserText(const std::string& text) { mCrashInfo["UserNotes"] = text; } - S32 getCrashBehavior() { return mCrashBehavior; } - bool runCrashLogPost(std::string host, LLSD data, std::string msg, int retries, int timeout); - bool readMinidump(std::string minidump_path); - -protected: - static void init_curl(); - static void term_curl(); - static void ssl_thread_id_callback(CRYPTO_THREADID*); - static void ssl_locking_callback(int mode, int type, const char * file, int line); - - S32 mCrashBehavior; - bool mCrashInPreviousExec; - std::map mFileMap; - std::string mGridName; - LLControlGroup mCrashSettings; - std::string mProductName; - LLSD mCrashInfo; - std::string mCrashHost; - std::string mAltCrashHost; - LLSD mDebugLog; - bool mSentCrashLogs; - LLCrashLock mKeyMaster; - - static int ssl_mutex_count; - static LLCoreInt::HttpMutex ** ssl_mutex_list; - -}; - -#endif //LLCRASHLOGGER_H diff --git a/indra/llfilesystem/CMakeLists.txt b/indra/llfilesystem/CMakeLists.txt index 9f24f75eabc..a552e4bdbc6 100644 --- a/indra/llfilesystem/CMakeLists.txt +++ b/indra/llfilesystem/CMakeLists.txt @@ -28,6 +28,12 @@ if (DARWIN) LIST(APPEND llfilesystem_SOURCE_FILES lldir_utils_objc.h) LIST(APPEND llfilesystem_SOURCE_FILES lldir_mac.cpp) LIST(APPEND llfilesystem_HEADER_FILES lldir_mac.h) + + set_source_files_properties( + lldir_utils_objc.mm + PROPERTIES + SKIP_PRECOMPILE_HEADERS TRUE + ) endif (DARWIN) if (LINUX) @@ -52,10 +58,15 @@ list(APPEND llfilesystem_SOURCE_FILES ${llfilesystem_HEADER_FILES}) add_library (llfilesystem ${llfilesystem_SOURCE_FILES}) target_link_libraries(llfilesystem + llmath llcommon ) target_include_directories( llfilesystem INTERFACE ${CMAKE_CURRENT_SOURCE_DIR}) +if (USE_PRECOMPILED_HEADERS) + target_precompile_headers(llfilesystem REUSE_FROM llprecompiled) +endif () + # Add tests if (LL_TESTS) include(LLAddBuildTest) diff --git a/indra/llfilesystem/lldir.cpp b/indra/llfilesystem/lldir.cpp index ea33a3bb906..190539cea59 100644 --- a/indra/llfilesystem/lldir.cpp +++ b/indra/llfilesystem/lldir.cpp @@ -44,16 +44,9 @@ #include "stringize.h" #include "llstring.h" #include -#include -#include -#include #include -#include #include -using boost::assign::list_of; -using boost::assign::map_list_of; - #if LL_WINDOWS #include "lldir_win32.h" LLDir_Win32 gDirUtil; @@ -448,28 +441,28 @@ const std::string &LLDir::getUserName() const static std::string ELLPathToString(ELLPath location) { typedef std::map ELLPathMap; -#define ENT(symbol) (symbol, #symbol) - static const ELLPathMap sMap = map_list_of - ENT(LL_PATH_NONE) - ENT(LL_PATH_USER_SETTINGS) - ENT(LL_PATH_APP_SETTINGS) - ENT(LL_PATH_PER_SL_ACCOUNT) // returns/expands to blank string if we don't know the account name yet - ENT(LL_PATH_CACHE) - ENT(LL_PATH_CHARACTER) - ENT(LL_PATH_HELP) - ENT(LL_PATH_LOGS) - ENT(LL_PATH_TEMP) - ENT(LL_PATH_SKINS) - ENT(LL_PATH_TOP_SKIN) - ENT(LL_PATH_CHAT_LOGS) - ENT(LL_PATH_PER_ACCOUNT_CHAT_LOGS) - ENT(LL_PATH_USER_SKIN) - ENT(LL_PATH_LOCAL_ASSETS) - ENT(LL_PATH_EXECUTABLE) - ENT(LL_PATH_DEFAULT_SKIN) - ENT(LL_PATH_FONTS) - ENT(LL_PATH_LAST) - ; +#define ENT(symbol) { symbol, #symbol } + static const ELLPathMap sMap = { + ENT(LL_PATH_NONE), + ENT(LL_PATH_USER_SETTINGS), + ENT(LL_PATH_APP_SETTINGS), + ENT(LL_PATH_PER_SL_ACCOUNT), // returns/expands to blank string if we don't know the account name yet + ENT(LL_PATH_CACHE), + ENT(LL_PATH_CHARACTER), + ENT(LL_PATH_HELP), + ENT(LL_PATH_LOGS), + ENT(LL_PATH_TEMP), + ENT(LL_PATH_SKINS), + ENT(LL_PATH_TOP_SKIN), + ENT(LL_PATH_CHAT_LOGS), + ENT(LL_PATH_PER_ACCOUNT_CHAT_LOGS), + ENT(LL_PATH_USER_SKIN), + ENT(LL_PATH_LOCAL_ASSETS), + ENT(LL_PATH_EXECUTABLE), + ENT(LL_PATH_DEFAULT_SKIN), + ENT(LL_PATH_FONTS), + ENT(LL_PATH_LAST), + }; #undef ENT ELLPathMap::const_iterator found = sMap.find(location); @@ -725,10 +718,10 @@ std::vector LLDir::findSkinnedFilenames(const std::string& subdir, LL_PROFILE_ZONE_SCOPED_CATEGORY_UI; // Recognize subdirs that have no localization. - static const std::set sUnlocalized = list_of - ("") // top-level directory not localized - ("textures") // textures not localized - ; + static const std::set sUnlocalized = { + "", // top-level directory not localized + "textures" // textures not localized + }; LL_DEBUGS("LLDir") << "subdir '" << subdir << "', filename '" << filename << "', constraint " diff --git a/indra/llfilesystem/lldir_win32.cpp b/indra/llfilesystem/lldir_win32.cpp index 58c080c9823..9624b1197f6 100644 --- a/indra/llfilesystem/lldir_win32.cpp +++ b/indra/llfilesystem/lldir_win32.cpp @@ -52,7 +52,7 @@ namespace // This is called so early that we can't count on static objects being // properly constructed yet, so declare a pointer instead of an instance. - std::ofstream* prelogf = nullptr; + llofstream* prelogf = nullptr; void prelog(const std::string& message) { @@ -208,7 +208,7 @@ LLDir_Win32::LLDir_Win32() { // successfully created logdir, plunk a log file there std::string logfilename(add(mOSUserDir, "lldir.log")); - std::ofstream logfile(logfilename.c_str()); + llofstream logfile(logfilename.c_str()); if (! logfile.is_open()) { report(std::cerr); diff --git a/indra/llfilesystem/lldiriterator.cpp b/indra/llfilesystem/lldiriterator.cpp index e8c37389d2a..b736a577bdf 100644 --- a/indra/llfilesystem/lldiriterator.cpp +++ b/indra/llfilesystem/lldiriterator.cpp @@ -24,6 +24,8 @@ * $/LicenseInfo$ */ +#include "linden_common.h" + #include "lldiriterator.h" #include "fix_macros.h" diff --git a/indra/llfilesystem/lldiskcache.cpp b/indra/llfilesystem/lldiskcache.cpp index e971e1885a2..c75df16b7d1 100644 --- a/indra/llfilesystem/lldiskcache.cpp +++ b/indra/llfilesystem/lldiskcache.cpp @@ -112,6 +112,10 @@ void LLDiskCache::purge() boost::filesystem::directory_iterator iter(cache_path, ec); while (iter != boost::filesystem::directory_iterator() && !ec.failed()) { + if(!LLApp::isRunning()) + { + return; + } if (boost::filesystem::is_regular_file(*iter, ec) && !ec.failed()) { if ((*iter).path().string().find(CACHE_FILENAME_PREFIX) != std::string::npos) @@ -150,6 +154,10 @@ void LLDiskCache::purge() uintmax_t file_size_total = 0; for (file_info_t& entry : file_info) { + if (!LLApp::isRunning()) + { + return; + } file_size_total += entry.second.first; bool should_remove = file_size_total > mMaxSizeBytes; @@ -176,6 +184,10 @@ void LLDiskCache::purge() // Logging thousands of file results can take hundreds of milliseconds for (size_t i = 0; i < file_info.size(); ++i) { + if (!LLApp::isRunning()) + { + return; + } const file_info_t& entry = file_info[i]; const bool removed = file_removed[i]; const std::string action = removed ? "DELETE:" : "KEEP:"; diff --git a/indra/llfilesystem/tests/lldir_test.cpp b/indra/llfilesystem/tests/lldir_test.cpp index d7d57fa86fb..a2104d1ef9a 100644 --- a/indra/llfilesystem/tests/lldir_test.cpp +++ b/indra/llfilesystem/tests/lldir_test.cpp @@ -27,26 +27,15 @@ #include "linden_common.h" +#include #include "llstring.h" #include "tests/StringVec.h" #include "../lldir.h" #include "../lldiriterator.h" #include "../test/lltut.h" +#include "../test/namedtempfile.h" #include "stringize.h" -#include - -using boost::assign::list_of; - -// We use ensure_equals(..., vec(list_of(...))) not because it's functionally -// required, but because ensure_equals() knows how to format a StringVec. -// Turns out that when ensure_equals() displays a test failure with just -// list_of("string")("another"), you see 'stringanother' vs. '("string", -// "another")'. -StringVec vec(const StringVec& v) -{ - return v; -} // For some tests, use a dummy LLDir that uses memory data instead of touching // the filesystem @@ -425,23 +414,19 @@ namespace tut return path; } - std::string makeTestDir( const std::string& dirbase ) + std::string makeTestDir( ) { - int counter; - std::string uniqueDir; - bool foundUnused; - std::string delim = gDirUtilp->getDirDelimiter(); + auto p = NamedTempFile::temp_path(); + std::filesystem::create_directories(p.native()); - for (counter=0, foundUnused=false; !foundUnused; counter++ ) - { - char counterStr[3]; - snprintf(counterStr, sizeof(counterStr), "%02d", counter); - uniqueDir = dirbase + counterStr; - foundUnused = ! ( LLFile::isdir(uniqueDir) || LLFile::isfile(uniqueDir) ); - } - ensure("test directory '" + uniqueDir + "' creation failed", !LLFile::mkdir(uniqueDir)); + std::string ret = p.string(); + + // There's an implicit assumtion all over this code that the returned path ends with "/" (or "\") - return uniqueDir + delim; // HACK - apparently, the trailing delimiter is needed... + if(ret.size() >= 1 && ret[ ret.size()-1 ] != std::filesystem::path::preferred_separator ) + ret += std::filesystem::path::preferred_separator; + + return ret; } static const char* DirScanFilename[5] = { "file1.abc", "file2.abc", "file1.xyz", "file2.xyz", "file1.mno" }; @@ -497,8 +482,9 @@ namespace tut // Create the same 5 file names of the two directories - std::string dir1 = makeTestDir(dirTemp + "LLDirIterator"); - std::string dir2 = makeTestDir(dirTemp + "LLDirIterator"); + std::string dir1 = makeTestDir(); + std::string dir2 = makeTestDir(); + std::string dir1files[5]; std::string dir2files[5]; for (int i=0; i<5; i++) @@ -590,20 +576,18 @@ namespace tut // top-level directory of a skin isn't localized ensure_equals(lldir.findSkinnedFilenames(LLDir::SKINBASE, "colors.xml", LLDir::ALL_SKINS), - vec(list_of("install/skins/default/colors.xml") - ("user/skins/default/colors.xml"))); + StringVec{ "install/skins/default/colors.xml", "user/skins/default/colors.xml" }); // We should not have needed to check for skins/default/en. We should // just "know" that SKINBASE is not localized. lldir.ensure_not_checked("install/skins/default/en"); ensure_equals(lldir.findSkinnedFilenames(LLDir::TEXTURES, "only_default.jpeg"), - vec(list_of("install/skins/default/textures/only_default.jpeg"))); + StringVec{ "install/skins/default/textures/only_default.jpeg" }); // Nor should we have needed to check skins/default/textures/en // because textures is known not to be localized. lldir.ensure_not_checked("install/skins/default/textures/en"); - StringVec expected(vec(list_of("install/skins/default/xui/en/strings.xml") - ("user/skins/default/xui/en/strings.xml"))); + StringVec expected(StringVec{ "install/skins/default/xui/en/strings.xml", "user/skins/default/xui/en/strings.xml" }); ensure_equals(lldir.findSkinnedFilenames(LLDir::XUI, "strings.xml", LLDir::ALL_SKINS), expected); // The first time, we had to probe to find out whether xui was localized. @@ -616,23 +600,19 @@ namespace tut lldir.ensure_not_checked("install/skins/default/xui/en"); // localized subdir with "en-us" instead of "en" - ensure_equals(lldir.findSkinnedFilenames("html", "welcome.html"), - vec(list_of("install/skins/default/html/en-us/welcome.html"))); + ensure_equals(lldir.findSkinnedFilenames("html", "welcome.html"), StringVec{ "install/skins/default/html/en-us/welcome.html" }); lldir.ensure_checked("install/skins/default/html/en"); lldir.ensure_checked("install/skins/default/html/en-us"); lldir.clear_checked(); - ensure_equals(lldir.findSkinnedFilenames("html", "welcome.html"), - vec(list_of("install/skins/default/html/en-us/welcome.html"))); + ensure_equals(lldir.findSkinnedFilenames("html", "welcome.html"), StringVec{ "install/skins/default/html/en-us/welcome.html" }); lldir.ensure_not_checked("install/skins/default/html/en"); lldir.ensure_not_checked("install/skins/default/html/en-us"); - ensure_equals(lldir.findSkinnedFilenames("future", "somefile.txt"), - vec(list_of("install/skins/default/future/somefile.txt"))); + ensure_equals(lldir.findSkinnedFilenames("future", "somefile.txt"), StringVec{ "install/skins/default/future/somefile.txt" }); // Test probing for an unrecognized unlocalized future subdir. lldir.ensure_checked("install/skins/default/future/en"); lldir.clear_checked(); - ensure_equals(lldir.findSkinnedFilenames("future", "somefile.txt"), - vec(list_of("install/skins/default/future/somefile.txt"))); + ensure_equals(lldir.findSkinnedFilenames("future", "somefile.txt"), StringVec{ "install/skins/default/future/somefile.txt" }); // Second time it should remember that future is unlocalized. lldir.ensure_not_checked("install/skins/default/future/en"); @@ -643,8 +623,7 @@ namespace tut // make the default localization be "en" and allow "en-gb" (or // whatever) localizations, which would work much more the way you'd // expect. - ensure_equals(lldir.findSkinnedFilenames("html", "welcome.html"), - vec(list_of("install/skins/default/html/en-us/welcome.html"))); + ensure_equals(lldir.findSkinnedFilenames("html", "welcome.html"), StringVec{ "install/skins/default/html/en-us/welcome.html" }); /*------------------------ "default", "fr" -------------------------*/ // We start being able to distinguish localized subdirs from @@ -654,100 +633,74 @@ namespace tut // pass merge=true to request this filename in all relevant skins ensure_equals(lldir.findSkinnedFilenames(LLDir::XUI, "strings.xml", LLDir::ALL_SKINS), - vec(list_of - ("install/skins/default/xui/en/strings.xml") - ("install/skins/default/xui/fr/strings.xml") - ("user/skins/default/xui/en/strings.xml") - ("user/skins/default/xui/fr/strings.xml"))); + StringVec{ "install/skins/default/xui/en/strings.xml", "install/skins/default/xui/fr/strings.xml", + "user/skins/default/xui/en/strings.xml", "user/skins/default/xui/fr/strings.xml" }); // pass (or default) merge=false to request only most specific skin ensure_equals(lldir.findSkinnedFilenames(LLDir::XUI, "strings.xml"), - vec(list_of - ("user/skins/default/xui/en/strings.xml") - ("user/skins/default/xui/fr/strings.xml"))); + StringVec{ "user/skins/default/xui/en/strings.xml", "user/skins/default/xui/fr/strings.xml" }); // Our dummy floater.xml has a user localization (for "fr") but no // English override. This is a case in which CURRENT_SKIN nonetheless // returns paths from two different skins. ensure_equals(lldir.findSkinnedFilenames(LLDir::XUI, "floater.xml"), - vec(list_of - ("install/skins/default/xui/en/floater.xml") - ("user/skins/default/xui/fr/floater.xml"))); + StringVec{ "install/skins/default/xui/en/floater.xml", "user/skins/default/xui/fr/floater.xml" }); // Our dummy newfile.xml has an English override but no user // localization. This is another case in which CURRENT_SKIN // nonetheless returns paths from two different skins. ensure_equals(lldir.findSkinnedFilenames(LLDir::XUI, "newfile.xml"), - vec(list_of - ("user/skins/default/xui/en/newfile.xml") - ("install/skins/default/xui/fr/newfile.xml"))); + StringVec{ "user/skins/default/xui/en/newfile.xml", "install/skins/default/xui/fr/newfile.xml" }); ensure_equals(lldir.findSkinnedFilenames("html", "welcome.html"), - vec(list_of - ("install/skins/default/html/en-us/welcome.html") - ("install/skins/default/html/fr/welcome.html"))); + StringVec{ "install/skins/default/html/en-us/welcome.html", "install/skins/default/html/fr/welcome.html" }); /*------------------------ "default", "zh" -------------------------*/ lldir.setSkinFolder("default", "zh"); // Because strings.xml has only a "fr" override but no "zh" override // in any skin, the most localized version we can find is "en". - ensure_equals(lldir.findSkinnedFilenames(LLDir::XUI, "strings.xml"), - vec(list_of("user/skins/default/xui/en/strings.xml"))); + ensure_equals(lldir.findSkinnedFilenames(LLDir::XUI, "strings.xml"), StringVec{ "user/skins/default/xui/en/strings.xml" }); /*------------------------- "steam", "en" --------------------------*/ lldir.setSkinFolder("steam", "en"); ensure_equals(lldir.findSkinnedFilenames(LLDir::SKINBASE, "colors.xml", LLDir::ALL_SKINS), - vec(list_of - ("install/skins/default/colors.xml") - ("install/skins/steam/colors.xml") - ("user/skins/default/colors.xml") - ("user/skins/steam/colors.xml"))); + StringVec{ "install/skins/default/colors.xml", "install/skins/steam/colors.xml", "user/skins/default/colors.xml", + "user/skins/steam/colors.xml" }); ensure_equals(lldir.findSkinnedFilenames(LLDir::TEXTURES, "only_default.jpeg"), - vec(list_of("install/skins/default/textures/only_default.jpeg"))); + StringVec{ "install/skins/default/textures/only_default.jpeg" }); ensure_equals(lldir.findSkinnedFilenames(LLDir::TEXTURES, "only_steam.jpeg"), - vec(list_of("install/skins/steam/textures/only_steam.jpeg"))); + StringVec{ "install/skins/steam/textures/only_steam.jpeg" }); ensure_equals(lldir.findSkinnedFilenames(LLDir::TEXTURES, "only_user_default.jpeg"), - vec(list_of("user/skins/default/textures/only_user_default.jpeg"))); + StringVec{ "user/skins/default/textures/only_user_default.jpeg" }); ensure_equals(lldir.findSkinnedFilenames(LLDir::TEXTURES, "only_user_steam.jpeg"), - vec(list_of("user/skins/steam/textures/only_user_steam.jpeg"))); + StringVec{ "user/skins/steam/textures/only_user_steam.jpeg" }); // CURRENT_SKIN - ensure_equals(lldir.findSkinnedFilenames(LLDir::XUI, "strings.xml"), - vec(list_of("user/skins/steam/xui/en/strings.xml"))); + ensure_equals(lldir.findSkinnedFilenames(LLDir::XUI, "strings.xml"), StringVec{ "user/skins/steam/xui/en/strings.xml" }); // pass constraint=ALL_SKINS to request this filename in all relevant skins ensure_equals(lldir.findSkinnedFilenames(LLDir::XUI, "strings.xml", LLDir::ALL_SKINS), - vec(list_of - ("install/skins/default/xui/en/strings.xml") - ("install/skins/steam/xui/en/strings.xml") - ("user/skins/default/xui/en/strings.xml") - ("user/skins/steam/xui/en/strings.xml"))); + StringVec{ "install/skins/default/xui/en/strings.xml", "install/skins/steam/xui/en/strings.xml", + "user/skins/default/xui/en/strings.xml", "user/skins/steam/xui/en/strings.xml" }); /*------------------------- "steam", "fr" --------------------------*/ lldir.setSkinFolder("steam", "fr"); // pass CURRENT_SKIN to request only the most specialized files ensure_equals(lldir.findSkinnedFilenames(LLDir::XUI, "strings.xml"), - vec(list_of - ("user/skins/steam/xui/en/strings.xml") - ("user/skins/steam/xui/fr/strings.xml"))); + StringVec{ "user/skins/steam/xui/en/strings.xml", "user/skins/steam/xui/fr/strings.xml" }); // pass ALL_SKINS to request this filename in all relevant skins ensure_equals(lldir.findSkinnedFilenames(LLDir::XUI, "strings.xml", LLDir::ALL_SKINS), - vec(list_of - ("install/skins/default/xui/en/strings.xml") - ("install/skins/default/xui/fr/strings.xml") - ("install/skins/steam/xui/en/strings.xml") - ("install/skins/steam/xui/fr/strings.xml") - ("user/skins/default/xui/en/strings.xml") - ("user/skins/default/xui/fr/strings.xml") - ("user/skins/steam/xui/en/strings.xml") - ("user/skins/steam/xui/fr/strings.xml"))); + StringVec{ "install/skins/default/xui/en/strings.xml", "install/skins/default/xui/fr/strings.xml", + "install/skins/steam/xui/en/strings.xml", "install/skins/steam/xui/fr/strings.xml", + "user/skins/default/xui/en/strings.xml", "user/skins/default/xui/fr/strings.xml", + "user/skins/steam/xui/en/strings.xml", "user/skins/steam/xui/fr/strings.xml" }); } template<> template<> diff --git a/indra/llimage/CMakeLists.txt b/indra/llimage/CMakeLists.txt index cc75c463bc6..a81808343fb 100644 --- a/indra/llimage/CMakeLists.txt +++ b/indra/llimage/CMakeLists.txt @@ -63,6 +63,10 @@ target_link_libraries(llimage ll::libjpeg ) +if (USE_PRECOMPILED_HEADERS) + target_precompile_headers(llimage REUSE_FROM llprecompiled) +endif () + # Add tests if (LL_TESTS) SET(llimage_TEST_SOURCE_FILES diff --git a/indra/llimage/llimageworker.cpp b/indra/llimage/llimageworker.cpp index bdaef0c6534..46ab6a441eb 100644 --- a/indra/llimage/llimageworker.cpp +++ b/indra/llimage/llimageworker.cpp @@ -67,7 +67,7 @@ class ImageRequest LLImageDecodeThread::LLImageDecodeThread(bool /*threaded*/) : mDecodeCount(0) { - mThreadPool.reset(new LL::ThreadPool("ImageDecode", 8)); + mThreadPool = std::make_unique("ImageDecode", 8); mThreadPool->start(); } diff --git a/indra/llimagej2coj/CMakeLists.txt b/indra/llimagej2coj/CMakeLists.txt index 93e85668dd6..b7ef696b201 100644 --- a/indra/llimagej2coj/CMakeLists.txt +++ b/indra/llimagej2coj/CMakeLists.txt @@ -27,3 +27,6 @@ target_link_libraries( llimagej2coj ll::openjpeg ) +if (USE_PRECOMPILED_HEADERS) + target_precompile_headers(llimagej2coj REUSE_FROM llprecompiled) +endif () diff --git a/indra/llinventory/CMakeLists.txt b/indra/llinventory/CMakeLists.txt index 93a586759f7..22966bc55bf 100644 --- a/indra/llinventory/CMakeLists.txt +++ b/indra/llinventory/CMakeLists.txt @@ -59,6 +59,10 @@ add_library (llinventory ${llinventory_SOURCE_FILES}) target_link_libraries( llinventory llcommon llmath llmessage llxml ) target_include_directories( llinventory INTERFACE ${CMAKE_CURRENT_SOURCE_DIR}) +if (USE_PRECOMPILED_HEADERS) + target_precompile_headers(llinventory REUSE_FROM llprecompiled) +endif () + #add unit tests if (LL_TESTS) INCLUDE(LLAddBuildTest) diff --git a/indra/llinventory/lllandmark.h b/indra/llinventory/lllandmark.h index 75596dc2871..75520195ec9 100644 --- a/indra/llinventory/lllandmark.h +++ b/indra/llinventory/lllandmark.h @@ -28,8 +28,8 @@ #ifndef LL_LLLANDMARK_H #define LL_LLLANDMARK_H +#include #include -#include #include "llframetimer.h" #include "lluuid.h" #include "v3dmath.h" @@ -41,7 +41,7 @@ class LLLandmark { public: // for calling back interested parties when a region handle comes back. - typedef boost::function region_handle_callback_t; + typedef std::function region_handle_callback_t; ~LLLandmark() {} diff --git a/indra/llinventory/llsettingsbase.cpp b/indra/llinventory/llsettingsbase.cpp index d7a94d61a51..944f38bd3ee 100644 --- a/indra/llinventory/llsettingsbase.cpp +++ b/indra/llinventory/llsettingsbase.cpp @@ -25,6 +25,8 @@ * $/LicenseInfo$ */ +#include "linden_common.h" + #include "llsettingsbase.h" #include "llmath.h" @@ -598,7 +600,7 @@ bool LLSettingsBase::Validator::verify(LLSD &data, U32 flags) return false; } - if (!mVerify.empty() && !mVerify(data[mName], flags)) + if (mVerify != nullptr && !mVerify(data[mName], flags)) { LL_WARNS("SETTINGS") << "Setting '" << mName << "' fails validation." << LL_ENDL; return false; @@ -757,7 +759,7 @@ void LLSettingsBlender::update(const LLSettingsBase::BlendFactor& blendf) F64 LLSettingsBlender::setBlendFactor(const LLSettingsBase::BlendFactor& blendf_in) { LLSettingsBase::TrackPosition blendf = (F32)blendf_in; - llassert(!isnan(blendf)); + llassert(!std::isnan(blendf)); if (blendf >= 1.0) { triggerComplete(); diff --git a/indra/llinventory/llsettingsbase.h b/indra/llinventory/llsettingsbase.h index bea6fdec976..20979bd98e4 100644 --- a/indra/llinventory/llsettingsbase.h +++ b/indra/llinventory/llsettingsbase.h @@ -49,8 +49,7 @@ #define SETTINGS_OVERRIDE override class LLSettingsBase : - public PTR_NAMESPACE::enable_shared_from_this, - private boost::noncopyable + public PTR_NAMESPACE::enable_shared_from_this { friend class LLEnvironment; friend class LLSettingsDay; @@ -96,7 +95,11 @@ class LLSettingsBase : typedef PTR_NAMESPACE::shared_ptr ptr_t; - virtual ~LLSettingsBase() { }; + virtual ~LLSettingsBase() = default; + + // Non-copyable + LLSettingsBase(const LLSettingsBase&) = delete; + LLSettingsBase& operator=(const LLSettingsBase&) = delete; //--------------------------------------------------------------------- virtual std::string getSettingsType() const = 0; @@ -285,7 +288,7 @@ class LLSettingsBase : public: static const U32 VALIDATION_PARTIAL; - typedef boost::function verify_pr; + typedef std::function verify_pr; Validator(std::string name, bool required, LLSD::Type type, verify_pr verify = verify_pr(), LLSD defval = LLSD()) : mName(name), @@ -430,7 +433,7 @@ class LLSettingsBlender : public PTR_NAMESPACE::enable_shared_from_this diff --git a/indra/llinventory/llsettingssky.cpp b/indra/llinventory/llsettingssky.cpp index 4957cf3c02d..fd3e49041cf 100644 --- a/indra/llinventory/llsettingssky.cpp +++ b/indra/llinventory/llsettingssky.cpp @@ -25,6 +25,8 @@ * $/LicenseInfo$ */ +#include "linden_common.h" + #include "llsettingssky.h" #include "indra_constants.h" #include diff --git a/indra/llinventory/llsettingswater.cpp b/indra/llinventory/llsettingswater.cpp index b5d59dc497c..427f06457f4 100644 --- a/indra/llinventory/llsettingswater.cpp +++ b/indra/llinventory/llsettingswater.cpp @@ -24,6 +24,7 @@ * Linden Research, Inc., 945 Battery Street, San Francisco, CA 94111 USA * $/LicenseInfo$ */ +#include "linden_common.h" #include "llsettingswater.h" #include diff --git a/indra/llkdu/include_kdu_xxxx.h b/indra/llkdu/include_kdu_xxxx.h index 3db417a6cb5..acd23fa6c06 100644 --- a/indra/llkdu/include_kdu_xxxx.h +++ b/indra/llkdu/include_kdu_xxxx.h @@ -16,7 +16,7 @@ // #include "include_kdu_xxxx.h" // // kdu_xxxx #undef'ed by include_kdu_xxxx.h -#if __clang__ +#if LL_CLANG // 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" diff --git a/indra/llkdu/tests/llimagej2ckdu_test.cpp b/indra/llkdu/tests/llimagej2ckdu_test.cpp index bc52a15c4af..09425fc001f 100644 --- a/indra/llkdu/tests/llimagej2ckdu_test.cpp +++ b/indra/llkdu/tests/llimagej2ckdu_test.cpp @@ -29,7 +29,7 @@ // Class to test #include "llimagej2ckdu.h" -#if __clang__ +#if LL_CLANG // 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" diff --git a/indra/llmath/CMakeLists.txt b/indra/llmath/CMakeLists.txt index bd860adc319..fb57e5db11b 100644 --- a/indra/llmath/CMakeLists.txt +++ b/indra/llmath/CMakeLists.txt @@ -99,10 +99,14 @@ set(llmath_HEADER_FILES list(APPEND llmath_SOURCE_FILES ${llmath_HEADER_FILES}) -add_library (llmath ${llmath_SOURCE_FILES}) +add_library(llmath ${llmath_SOURCE_FILES}) target_link_libraries(llmath llcommon llmeshoptimizer ll::sse2neon) -target_include_directories( llmath INTERFACE ${CMAKE_CURRENT_SOURCE_DIR}) +target_include_directories(llmath INTERFACE ${CMAKE_CURRENT_SOURCE_DIR}) + +if (USE_PRECOMPILED_HEADERS) + target_precompile_headers(llmath REUSE_FROM llprecompiled) +endif () # Add tests if (LL_TESTS) diff --git a/indra/llmath/llcalc.cpp b/indra/llmath/llcalc.cpp index e060b5df583..311e1e70599 100644 --- a/indra/llmath/llcalc.cpp +++ b/indra/llmath/llcalc.cpp @@ -116,17 +116,6 @@ void LLCalc::clearAllVariables() mVariables.clear(); } -/* -void LLCalc::updateVariables(LLSD& vars) -{ - LLSD::map_iterator cIt = vars.beginMap(); - for(; cIt != vars.endMap(); cIt++) - { - setVar(cIt->first, (F32)(LLSD::Real)cIt->second); - } -} -*/ - bool LLCalc::evalString(const std::string& expression, F32& result) { std::string expr_upper = expression; diff --git a/indra/llmath/llcalc.h b/indra/llmath/llcalc.h index 09672eb13b4..14797de996e 100644 --- a/indra/llmath/llcalc.h +++ b/indra/llmath/llcalc.h @@ -73,10 +73,9 @@ class LLCalc void setVar(const std::string& name, const F32& value); void clearVar(const std::string& name); void clearAllVariables(); -// void updateVariables(LLSD& vars); bool evalString(const std::string& expression, F32& result); - std::string::size_type getLastErrorPos() { return mLastErrorPos; } + std::string::size_type getLastErrorPos() const { return mLastErrorPos; } static LLCalc* getInstance(); static void cleanUp(); @@ -89,10 +88,6 @@ class LLCalc calc_map_t mConstants; calc_map_t mVariables; - // *TODO: Add support for storing user defined variables, and stored functions. - // Will need UI work, and a means to save them between sessions. -// calc_map_t mUserVariables; - // "There shall be only one" static LLCalc* sInstance; }; diff --git a/indra/llmath/llcalcparser.h b/indra/llmath/llcalcparser.h index ea71752ebca..fe4e6bb1a49 100644 --- a/indra/llmath/llcalcparser.h +++ b/indra/llmath/llcalcparser.h @@ -27,6 +27,13 @@ #ifndef LL_CALCPARSER_H #define LL_CALCPARSER_H +#include "llpreprocessor.h" + +#if defined(LL_GNUC) && GCC_VERSION >= 130000 +# pragma GCC diagnostic push +# pragma GCC diagnostic ignored "-Wdangling-pointer" +#endif + #include #include #include @@ -35,6 +42,10 @@ #include using namespace boost::spirit::classic; +#if defined(LL_GNUC) && GCC_VERSION >= 130000 +# pragma GCC diagnostic pop +#endif + #include "llcalc.h" #include "llmath.h" @@ -131,14 +142,14 @@ struct LLCalcParser : grammar power = unary_expr[power.value = arg1] >> - *('^' >> assert_syntax(unary_expr[power.value = phoenix::bind(&powf)(power.value, arg1)])) + *('^' >> assert_syntax(unary_expr[power.value = phoenix::bind(&LLCalcParser::_pow)(self, power.value, arg1)])) ; term = power[term.value = arg1] >> *(('*' >> assert_syntax(power[term.value *= arg1])) | ('/' >> assert_syntax(power[term.value /= arg1])) | - ('%' >> assert_syntax(power[term.value = phoenix::bind(&fmodf)(term.value, arg1)])) + ('%' >> assert_syntax(power[term.value = phoenix::bind(&LLCalcParser::_fmod)(self, term.value, arg1)])) ) ; @@ -177,10 +188,11 @@ struct LLCalcParser : grammar F32 _floor(const F32& a) const { return (F32)llfloor(a); } F32 _ceil(const F32& a) const { return (F32)llceil(a); } F32 _atan2(const F32& a,const F32& b) const { return atan2(a,b); } + F32 _pow(const F32& a, const F32& b) const { return powf(a, b); } + F32 _fmod(const F32&a, const F32& b) const { return fmodf(a, b); } LLCalc::calc_map_t* mConstants; LLCalc::calc_map_t* mVariables; -// LLCalc::calc_map_t* mUserVariables; F32& mResult; }; diff --git a/indra/llmath/llcamera.h b/indra/llmath/llcamera.h index 6201761c465..3863588407f 100644 --- a/indra/llmath/llcamera.h +++ b/indra/llmath/llcamera.h @@ -60,10 +60,10 @@ constexpr F32 MAX_FIELD_OF_VIEW = 175.f * DEG_TO_RAD; // roll(), pitch(), yaw() // etc... -LL_ALIGN_PREFIX(16) -class LLCamera +class alignas(16) LLCamera : public LLCoordFrame { + LL_ALIGN_NEW public: LLCamera(const LLCamera& rhs) { @@ -120,9 +120,9 @@ class LLCamera }; private: - LL_ALIGN_16(LLPlane mAgentPlanes[AGENT_PLANE_USER_CLIP_NUM]); //frustum planes in agent space a la gluUnproject (I'm a bastard, I know) - DaveP - LL_ALIGN_16(LLPlane mRegionPlanes[AGENT_PLANE_USER_CLIP_NUM]); //frustum planes in a local region space, derived from mAgentPlanes - LL_ALIGN_16(LLPlane mLastAgentPlanes[AGENT_PLANE_USER_CLIP_NUM]); + LLPlane mAgentPlanes[AGENT_PLANE_USER_CLIP_NUM]; //frustum planes in agent space a la gluUnproject (I'm a bastard, I know) - DaveP + LLPlane mRegionPlanes[AGENT_PLANE_USER_CLIP_NUM]; //frustum planes in a local region space, derived from mAgentPlanes + LLPlane mLastAgentPlanes[AGENT_PLANE_USER_CLIP_NUM]; U8 mPlaneMask[PLANE_MASK_NUM]; // 8 for alignment F32 mView; // angle between top and bottom frustum planes in radians. @@ -218,7 +218,7 @@ class LLCamera void calculateFrustumPlanes(); void calculateFrustumPlanes(F32 left, F32 right, F32 top, F32 bottom); void calculateFrustumPlanesFromWindow(F32 x1, F32 y1, F32 x2, F32 y2); -} LL_ALIGN_POSTFIX(16); +}; #endif diff --git a/indra/llmath/llmatrix3a.cpp b/indra/llmath/llmatrix3a.cpp index c0b00201cf0..904c9de2a11 100644 --- a/indra/llmath/llmatrix3a.cpp +++ b/indra/llmath/llmatrix3a.cpp @@ -28,7 +28,7 @@ #include "llmath.h" -static LL_ALIGN_16(const F32 M_IDENT_3A[12]) = +alignas(16) static const F32 M_IDENT_3A[12] = { 1.f, 0.f, 0.f, 0.f, // Column 1 0.f, 1.f, 0.f, 0.f, // Column 2 0.f, 0.f, 1.f, 0.f }; // Column 3 diff --git a/indra/llmath/llmatrix3a.h b/indra/llmath/llmatrix3a.h index 9b173c22edd..742a2488fda 100644 --- a/indra/llmath/llmatrix3a.h +++ b/indra/llmath/llmatrix3a.h @@ -40,8 +40,9 @@ // LLMatrix3a is the base class for LLRotation, which should be used instead any time you're dealing with a // rotation matrix. -class LLMatrix3a +class alignas(16) LLMatrix3a { + LL_ALIGN_NEW public: // Utility function for quickly transforming an array of LLVector4a's @@ -111,7 +112,7 @@ class LLMatrix3a protected: - LL_ALIGN_16(LLVector4a mColumns[3]); + LLVector4a mColumns[3]; }; diff --git a/indra/llmath/llmatrix4a.h b/indra/llmath/llmatrix4a.h index 377203098e2..2967949993b 100644 --- a/indra/llmath/llmatrix4a.h +++ b/indra/llmath/llmatrix4a.h @@ -31,10 +31,11 @@ #include "m4math.h" #include "m3math.h" -class LLMatrix4a +class alignas(16) LLMatrix4a { + LL_ALIGN_NEW public: - LL_ALIGN_16(LLVector4a mMatrix[4]); + LLVector4a mMatrix[4]; LLMatrix4a() = default; diff --git a/indra/llmath/llplane.h b/indra/llmath/llplane.h index 832004bb644..822e6a7b6ff 100644 --- a/indra/llmath/llplane.h +++ b/indra/llmath/llplane.h @@ -36,10 +36,9 @@ // The plane normal = [A, B, C] // The closest approach = D / sqrt(A*A + B*B + C*C) - -LL_ALIGN_PREFIX(16) -class LLPlane +class alignas(16) LLPlane { + LL_ALIGN_NEW public: // Constructors @@ -102,7 +101,7 @@ class LLPlane private: LLVector4a mV; -} LL_ALIGN_POSTFIX(16); +}; static_assert(std::is_trivial::value, "LLPlane must be a trivial type"); diff --git a/indra/llmath/llquantize.h b/indra/llmath/llquantize.h index e8d880122e7..2a53fdbf846 100644 --- a/indra/llmath/llquantize.h +++ b/indra/llmath/llquantize.h @@ -29,16 +29,16 @@ #define LL_LLQUANTIZE_H const U16 U16MAX = 65535; -LL_ALIGN_16( const F32 F_U16MAX_4A[4] ) = { 65535.f, 65535.f, 65535.f, 65535.f }; +alignas(16) const F32 F_U16MAX_4A[4] = { 65535.f, 65535.f, 65535.f, 65535.f }; const F32 OOU16MAX = 1.f/(F32)(U16MAX); -LL_ALIGN_16( const F32 F_OOU16MAX_4A[4] ) = { OOU16MAX, OOU16MAX, OOU16MAX, OOU16MAX }; +alignas(16) const F32 F_OOU16MAX_4A[4] = { OOU16MAX, OOU16MAX, OOU16MAX, OOU16MAX }; const U8 U8MAX = 255; -LL_ALIGN_16( const F32 F_U8MAX_4A[4] ) = { 255.f, 255.f, 255.f, 255.f }; +alignas(16) const F32 F_U8MAX_4A[4] = { 255.f, 255.f, 255.f, 255.f }; const F32 OOU8MAX = 1.f/(F32)(U8MAX); -LL_ALIGN_16( const F32 F_OOU8MAX_4A[4] ) = { OOU8MAX, OOU8MAX, OOU8MAX, OOU8MAX }; +alignas(16) const F32 F_OOU8MAX_4A[4] = { OOU8MAX, OOU8MAX, OOU8MAX, OOU8MAX }; const U8 FIRSTVALIDCHAR = 54; const U8 MAXSTRINGVAL = U8MAX - FIRSTVALIDCHAR; //we don't allow newline or null diff --git a/indra/llmath/llquaternion2.h b/indra/llmath/llquaternion2.h index c9dcc4573fa..d73e1a0ca2f 100644 --- a/indra/llmath/llquaternion2.h +++ b/indra/llmath/llquaternion2.h @@ -40,8 +40,9 @@ ///////////////////////////// #include "llquaternion.h" -class LLQuaternion2 +class alignas(16) LLQuaternion2 { + LL_ALIGN_NEW public: ////////////////////////// diff --git a/indra/llmath/llquaternion2.inl b/indra/llmath/llquaternion2.inl index ce5ed739262..2ebc8e0bfbf 100644 --- a/indra/llmath/llquaternion2.inl +++ b/indra/llmath/llquaternion2.inl @@ -57,7 +57,7 @@ inline LLVector4a& LLQuaternion2::getVector4aRw() // Set this quaternion to the conjugate of src inline void LLQuaternion2::setConjugate(const LLQuaternion2& src) { - static LL_ALIGN_16( const U32 F_QUAT_INV_MASK_4A[4] ) = { 0x80000000, 0x80000000, 0x80000000, 0x00000000 }; + alignas(16) static const U32 F_QUAT_INV_MASK_4A[4] = { 0x80000000, 0x80000000, 0x80000000, 0x00000000 }; mQ = _mm_xor_ps(src.mQ, *reinterpret_cast(&F_QUAT_INV_MASK_4A)); } diff --git a/indra/llmath/llrigginginfo.h b/indra/llmath/llrigginginfo.h index d761af68b1e..e5a41d2ecf1 100644 --- a/indra/llmath/llrigginginfo.h +++ b/indra/llmath/llrigginginfo.h @@ -70,11 +70,10 @@ class LLJointRiggingInfoTab LLJointRiggingInfo* begin() { return mRigInfoPtr; } LLJointRiggingInfo* end() { return mRigInfoPtr + mSize; } -private: - // Not implemented - LLJointRiggingInfoTab& operator=(const LLJointRiggingInfoTab& src); - LLJointRiggingInfoTab(const LLJointRiggingInfoTab& src); + LLJointRiggingInfoTab& operator=(const LLJointRiggingInfoTab& src) = delete; + LLJointRiggingInfoTab(const LLJointRiggingInfoTab& src) = delete; +private: LLJointRiggingInfo *mRigInfoPtr; S32 mSize; bool mNeedsUpdate; diff --git a/indra/llmath/llsimdtypes.inl b/indra/llmath/llsimdtypes.inl index 125f4b9df56..20ea7640b62 100644 --- a/indra/llmath/llsimdtypes.inl +++ b/indra/llmath/llsimdtypes.inl @@ -61,7 +61,7 @@ inline LLSimdScalar operator/(const LLSimdScalar& a, const LLSimdScalar& b) inline LLSimdScalar operator-(const LLSimdScalar& a) { - static LL_ALIGN_16(const U32 signMask[4]) = {0x80000000, 0x80000000, 0x80000000, 0x80000000 }; + alignas(16) static const U32 signMask[4] = {0x80000000, 0x80000000, 0x80000000, 0x80000000 }; ll_assert_aligned(signMask,16); return _mm_xor_ps(*reinterpret_cast(signMask), a); } @@ -146,7 +146,7 @@ inline LLSimdScalar& LLSimdScalar::operator/=(const LLSimdScalar& rhs) inline LLSimdScalar LLSimdScalar::getAbs() const { - static const LL_ALIGN_16(U32 F_ABS_MASK_4A[4]) = { 0x7FFFFFFF, 0x7FFFFFFF, 0x7FFFFFFF, 0x7FFFFFFF }; + alignas(16) static const U32 F_ABS_MASK_4A[4] = { 0x7FFFFFFF, 0x7FFFFFFF, 0x7FFFFFFF, 0x7FFFFFFF }; ll_assert_aligned(F_ABS_MASK_4A,16); return _mm_and_ps( mQ, *reinterpret_cast(F_ABS_MASK_4A)); } diff --git a/indra/llmath/llvector4a.cpp b/indra/llmath/llvector4a.cpp index b81d50f0f94..6bdc97e420e 100644 --- a/indra/llmath/llvector4a.cpp +++ b/indra/llmath/llvector4a.cpp @@ -101,7 +101,7 @@ void LLVector4a::quantize8( const LLVector4a& low, const LLVector4a& high ) // 8-bit quantization means we can do with just 12 bits of reciprocal accuracy const LLVector4a oneOverDelta = _mm_rcp_ps(delta.mQ); // { -// static LL_ALIGN_16( const F32 F_TWO_4A[4] ) = { 2.f, 2.f, 2.f, 2.f }; +// alignas(16) static const F32 F_TWO_4A[4] = { 2.f, 2.f, 2.f, 2.f }; // LLVector4a two; two.load4a( F_TWO_4A ); // // // Here we use _mm_rcp_ps plus one round of newton-raphson @@ -146,7 +146,7 @@ void LLVector4a::quantize16( const LLVector4a& low, const LLVector4a& high ) // 16-bit quantization means we need a round of Newton-Raphson LLVector4a oneOverDelta; { - static LL_ALIGN_16( const F32 F_TWO_4A[4] ) = { 2.f, 2.f, 2.f, 2.f }; + alignas(16) static const F32 F_TWO_4A[4] = { 2.f, 2.f, 2.f, 2.f }; ll_assert_aligned(F_TWO_4A,16); LLVector4a two; two.load4a( F_TWO_4A ); diff --git a/indra/llmath/llvector4a.inl b/indra/llmath/llvector4a.inl index 443a46c317f..b6e2a4fce57 100644 --- a/indra/llmath/llvector4a.inl +++ b/indra/llmath/llvector4a.inl @@ -196,7 +196,7 @@ inline void LLVector4a::setDiv(const LLVector4a& a, const LLVector4a& b) // Set this to the element-wise absolute value of src inline void LLVector4a::setAbs(const LLVector4a& src) { - static const LL_ALIGN_16(U32 F_ABS_MASK_4A[4]) = { 0x7FFFFFFF, 0x7FFFFFFF, 0x7FFFFFFF, 0x7FFFFFFF }; + alignas(16) static const U32 F_ABS_MASK_4A[4] = { 0x7FFFFFFF, 0x7FFFFFFF, 0x7FFFFFFF, 0x7FFFFFFF }; mQ = _mm_and_ps(src.mQ, *reinterpret_cast(F_ABS_MASK_4A)); } @@ -448,7 +448,7 @@ inline void LLVector4a::normalize3fast_checked(LLVector4a* d) // Return true if this vector is normalized with respect to x,y,z up to tolerance inline LLBool32 LLVector4a::isNormalized3( F32 tolerance ) const { - static LL_ALIGN_16(const U32 ones[4]) = { 0x3f800000, 0x3f800000, 0x3f800000, 0x3f800000 }; + alignas(16) static const U32 ones[4] = { 0x3f800000, 0x3f800000, 0x3f800000, 0x3f800000 }; LLSimdScalar tol = _mm_load_ss( &tolerance ); tol = _mm_mul_ss( tol, tol ); LLVector4a lenSquared; lenSquared.setAllDot3( *this, *this ); @@ -460,7 +460,7 @@ inline LLBool32 LLVector4a::isNormalized3( F32 tolerance ) const // Return true if this vector is normalized with respect to all components up to tolerance inline LLBool32 LLVector4a::isNormalized4( F32 tolerance ) const { - static LL_ALIGN_16(const U32 ones[4]) = { 0x3f800000, 0x3f800000, 0x3f800000, 0x3f800000 }; + alignas(16) static const U32 ones[4] = { 0x3f800000, 0x3f800000, 0x3f800000, 0x3f800000 }; LLSimdScalar tol = _mm_load_ss( &tolerance ); tol = _mm_mul_ss( tol, tol ); LLVector4a lenSquared; lenSquared.setAllDot4( *this, *this ); @@ -507,7 +507,7 @@ inline void LLVector4a::setLerp(const LLVector4a& lhs, const LLVector4a& rhs, F3 inline LLBool32 LLVector4a::isFinite3() const { - static LL_ALIGN_16(const U32 nanOrInfMask[4]) = { 0x7f800000, 0x7f800000, 0x7f800000, 0x7f800000 }; + alignas(16) static const U32 nanOrInfMask[4] = { 0x7f800000, 0x7f800000, 0x7f800000, 0x7f800000 }; ll_assert_aligned(nanOrInfMask,16); const __m128i nanOrInfMaskV = *reinterpret_cast (nanOrInfMask); const __m128i maskResult = _mm_and_si128( _mm_castps_si128(mQ), nanOrInfMaskV ); @@ -517,7 +517,7 @@ inline LLBool32 LLVector4a::isFinite3() const inline LLBool32 LLVector4a::isFinite4() const { - static LL_ALIGN_16(const U32 nanOrInfMask[4]) = { 0x7f800000, 0x7f800000, 0x7f800000, 0x7f800000 }; + alignas(16) static const U32 nanOrInfMask[4] = { 0x7f800000, 0x7f800000, 0x7f800000, 0x7f800000 }; const __m128i nanOrInfMaskV = *reinterpret_cast (nanOrInfMask); const __m128i maskResult = _mm_and_si128( _mm_castps_si128(mQ), nanOrInfMaskV ); const LLVector4Logical equalityCheck = _mm_castsi128_ps(_mm_cmpeq_epi32( maskResult, nanOrInfMaskV )); diff --git a/indra/llmath/llvector4logical.h b/indra/llmath/llvector4logical.h index 77cb5862e56..411971c42db 100644 --- a/indra/llmath/llvector4logical.h +++ b/indra/llmath/llvector4logical.h @@ -39,7 +39,7 @@ // contact someone with SSE experience (Falcon, Richard, Davep, e.g.) //////////////////////////// -static LL_ALIGN_16(const U32 S_V4LOGICAL_MASK_TABLE[4*4]) = +alignas(16) static const U32 S_V4LOGICAL_MASK_TABLE[4*4] = { 0xFFFFFFFF, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0xFFFFFFFF, 0x00000000, 0x00000000, @@ -77,7 +77,7 @@ class LLVector4Logical // Invert this mask inline LLVector4Logical& invert() { - static const LL_ALIGN_16(U32 allOnes[4]) = { 0xFFFFFFFF, 0xFFFFFFFF, 0xFFFFFFFF, 0xFFFFFFFF }; + alignas(16) static const U32 allOnes[4] = { 0xFFFFFFFF, 0xFFFFFFFF, 0xFFFFFFFF, 0xFFFFFFFF }; ll_assert_aligned(allOnes,16); mQ = _mm_andnot_ps( mQ, *(LLQuad*)(allOnes) ); return *this; diff --git a/indra/llmath/llvolume.cpp b/indra/llmath/llvolume.cpp index b3cb278d599..dfad66040ed 100644 --- a/indra/llmath/llvolume.cpp +++ b/indra/llmath/llvolume.cpp @@ -2348,7 +2348,9 @@ bool LLVolume::unpackVolumeFacesInternal(const LLSD& mdl) const LLSD::Binary& pos = mdl[i]["Position"].asBinary(); const LLSD::Binary& norm = mdl[i]["Normal"].asBinary(); +#if 0 // keep this code for now in case we decide to add support for on-the-wire tangents const LLSD::Binary& tangent = mdl[i]["Tangent"].asBinary(); +#endif const LLSD::Binary& tc = mdl[i]["TexCoord0"].asBinary(); const LLSD::Binary& idx = mdl[i]["TriangleList"].asBinary(); diff --git a/indra/llmath/llvolumeoctree.h b/indra/llmath/llvolumeoctree.h index 1d74644715f..0250bf8bfb7 100644 --- a/indra/llmath/llvolumeoctree.h +++ b/indra/llmath/llvolumeoctree.h @@ -53,7 +53,7 @@ class alignas(16) LLVolumeTriangle : public LLRefCount } - LL_ALIGN_16(LLVector4a mPositionGroup); + LLVector4a mPositionGroup; const LLVector4a* mV[3]; U32 mIndex[3]; @@ -78,16 +78,8 @@ class alignas(16) LLVolumeOctreeListener : public LLOctreeListener* node); ~LLVolumeOctreeListener(); - LLVolumeOctreeListener(const LLVolumeOctreeListener& rhs) - { - *this = rhs; - } - - const LLVolumeOctreeListener& operator=(const LLVolumeOctreeListener& rhs) - { - LL_ERRS() << "Illegal operation!" << LL_ENDL; - return *this; - } + LLVolumeOctreeListener(const LLVolumeOctreeListener& rhs) = delete; + const LLVolumeOctreeListener& operator=(const LLVolumeOctreeListener& rhs) = delete; //LISTENER FUNCTIONS virtual void handleChildAddition(const LLOctreeNode* parent, LLOctreeNode* child); @@ -99,8 +91,8 @@ class alignas(16) LLVolumeOctreeListener : public LLOctreeListener diff --git a/indra/llmath/tests/alignment_test.cpp b/indra/llmath/tests/alignment_test.cpp index eb6fa4a3b87..f41ebe82aac 100644 --- a/indra/llmath/tests/alignment_test.cpp +++ b/indra/llmath/tests/alignment_test.cpp @@ -46,8 +46,7 @@ typedef test_group alignment_test_t; typedef alignment_test_t::object alignment_test_object_t; tut::alignment_test_t tut_alignment_test("LLAlignment"); -LL_ALIGN_PREFIX(16) -class MyVector4a +class alignas(16) MyVector4a { public: void* operator new(size_t size) @@ -71,7 +70,7 @@ class MyVector4a } LLQuad mQ; -} LL_ALIGN_POSTFIX(16); +}; // Verify that aligned allocators perform as advertised. diff --git a/indra/llmeshoptimizer/CMakeLists.txt b/indra/llmeshoptimizer/CMakeLists.txt index dfac44c296b..5b1ab9d8e45 100644 --- a/indra/llmeshoptimizer/CMakeLists.txt +++ b/indra/llmeshoptimizer/CMakeLists.txt @@ -30,5 +30,9 @@ target_link_libraries(llmeshoptimizer llmath ll::meshoptimizer) +if (USE_PRECOMPILED_HEADERS) + target_precompile_headers(llmeshoptimizer REUSE_FROM llprecompiled) +endif () + # Add tests diff --git a/indra/llmessage/CMakeLists.txt b/indra/llmessage/CMakeLists.txt index b2757a7306d..86e262f56a6 100644 --- a/indra/llmessage/CMakeLists.txt +++ b/indra/llmessage/CMakeLists.txt @@ -15,7 +15,6 @@ set(llmessage_SOURCE_FILES llassetstorage.cpp llavatarname.cpp llavatarnamecache.cpp - llblowfishcipher.cpp llbuffer.cpp llbufferstream.cpp llcachename.cpp @@ -37,7 +36,6 @@ set(llmessage_SOURCE_FILES lliopipe.cpp lliosocket.cpp llioutil.cpp - llmail.cpp llmessagebuilder.cpp llmessageconfig.cpp llmessagereader.cpp @@ -94,7 +92,6 @@ set(llmessage_HEADER_FILES llassetstorage.h llavatarname.h llavatarnamecache.h - llblowfishcipher.h llbuffer.h llbufferstream.h llcachename.h @@ -124,7 +121,6 @@ set(llmessage_HEADER_FILES lliosocket.h llioutil.h llloginflags.h - llmail.h llmessagebuilder.h llmessageconfig.h llmessagereader.h @@ -194,6 +190,10 @@ target_link_libraries( ) target_include_directories( llmessage INTERFACE ${CMAKE_CURRENT_SOURCE_DIR}) +if (USE_PRECOMPILED_HEADERS) + target_precompile_headers(llmessage REUSE_FROM llprecompiled) +endif () + # tests if (LL_TESTS) SET(llmessage_TEST_SOURCE_FILES diff --git a/indra/llmessage/llavatarname.h b/indra/llmessage/llavatarname.h index eec966d51bf..86b2931ed9b 100644 --- a/indra/llmessage/llavatarname.h +++ b/indra/llmessage/llavatarname.h @@ -32,7 +32,7 @@ class LLSD; -class LL_COMMON_API LLAvatarName +class LLAvatarName { public: LLAvatarName(); diff --git a/indra/llmessage/llavatarnamecache.cpp b/indra/llmessage/llavatarnamecache.cpp index 9b4454a8476..ebafc53a4de 100644 --- a/indra/llmessage/llavatarnamecache.cpp +++ b/indra/llmessage/llavatarnamecache.cpp @@ -117,9 +117,9 @@ LLAvatarNameCache::LLAvatarNameCache() mUsePeopleAPI = true; - sHttpRequest = LLCore::HttpRequest::ptr_t(new LLCore::HttpRequest()); - sHttpHeaders = LLCore::HttpHeaders::ptr_t(new LLCore::HttpHeaders()); - sHttpOptions = LLCore::HttpOptions::ptr_t(new LLCore::HttpOptions()); + sHttpRequest = std::make_shared(); + sHttpHeaders = std::make_shared(); + sHttpOptions = std::make_shared(); sHttpPolicy = LLCore::HttpRequest::DEFAULT_POLICY_ID; } diff --git a/indra/llmessage/llavatarnamecache.h b/indra/llmessage/llavatarnamecache.h index fe51355207c..0ddaee2aa14 100644 --- a/indra/llmessage/llavatarnamecache.h +++ b/indra/llmessage/llavatarnamecache.h @@ -42,7 +42,7 @@ class LLAvatarNameCache : public LLSingleton ~LLAvatarNameCache(); public: typedef boost::signals2::signal use_display_name_signal_t; - typedef boost::function account_name_changed_callback_t; + typedef std::function account_name_changed_callback_t; // Import/export the name cache to file. bool importFile(std::istream& istr); diff --git a/indra/llmessage/llblowfishcipher.cpp b/indra/llmessage/llblowfishcipher.cpp deleted file mode 100644 index 3973565e220..00000000000 --- a/indra/llmessage/llblowfishcipher.cpp +++ /dev/null @@ -1,129 +0,0 @@ -/** - * @file llblowfishcipher.cpp - * @brief Wrapper around OpenSSL Blowfish encryption algorithm. - * - * $LicenseInfo:firstyear=2007&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 "linden_common.h" -#include "llblowfishcipher.h" -#include - - -LLBlowfishCipher::LLBlowfishCipher(const U8* secret, size_t secret_size) -: LLCipher() -{ - llassert(secret); - - mSecretSize = secret_size; - mSecret = new U8[mSecretSize]; - memcpy(mSecret, secret, mSecretSize); -} - -LLBlowfishCipher::~LLBlowfishCipher() -{ - delete [] mSecret; - mSecret = NULL; -} - -// virtual -U32 LLBlowfishCipher::encrypt(const U8* src, U32 src_len, U8* dst, U32 dst_len) -{ - if (!src || !src_len || !dst || !dst_len) return 0; - if (src_len > dst_len) return 0; - - // OpenSSL uses "cipher contexts" to hold encryption parameters. - EVP_CIPHER_CTX *context = EVP_CIPHER_CTX_new(); - if (!context) - { - LL_WARNS() << "LLBlowfishCipher::encrypt EVP_CIPHER_CTX initiation failure" << LL_ENDL; - return 0; - } - - // We want a blowfish cyclic block chain cipher, but need to set - // the key length before we pass in a key, so call EncryptInit - // first with NULLs. - EVP_EncryptInit_ex(context, EVP_bf_cbc(), NULL, NULL, NULL); - EVP_CIPHER_CTX_set_key_length(context, (int)mSecretSize); - - // Complete initialization. Per EVP_EncryptInit man page, the - // cipher pointer must be NULL. Apparently initial_vector must - // be 8 bytes for blowfish, as this is the block size. - unsigned char initial_vector[] = { 0, 0, 0, 0, 0, 0, 0, 0 }; - EVP_EncryptInit_ex(context, NULL, NULL, mSecret, initial_vector); - - int blocksize = EVP_CIPHER_CTX_block_size(context); - int keylen = EVP_CIPHER_CTX_key_length(context); - int iv_length = EVP_CIPHER_CTX_iv_length(context); - LL_DEBUGS() << "LLBlowfishCipher blocksize " << blocksize - << " keylen " << keylen - << " iv_len " << iv_length - << LL_ENDL; - - int output_len = 0; - int temp_len = 0; - if (!EVP_EncryptUpdate(context, - dst, - &output_len, - src, - src_len)) - { - LL_WARNS() << "LLBlowfishCipher::encrypt EVP_EncryptUpdate failure" << LL_ENDL; - goto BF_ENCRYPT_ERROR; - } - - // There may be some final data left to encrypt if the input is - // not an exact multiple of the block size. - if (!EVP_EncryptFinal_ex(context, (unsigned char*)(dst + output_len), &temp_len)) - { - LL_WARNS() << "LLBlowfishCipher::encrypt EVP_EncryptFinal failure" << LL_ENDL; - goto BF_ENCRYPT_ERROR; - } - output_len += temp_len; - - EVP_CIPHER_CTX_free(context); - return output_len; - -BF_ENCRYPT_ERROR: - EVP_CIPHER_CTX_free(context); - return 0; -} - -// virtual -U32 LLBlowfishCipher::decrypt(const U8* src, U32 src_len, U8* dst, U32 dst_len) -{ - LL_ERRS() << "LLBlowfishCipher decrypt unsupported" << LL_ENDL; - return 0; -} - -// virtual -U32 LLBlowfishCipher::requiredEncryptionSpace(U32 len) const -{ - // *HACK: We know blowfish uses an 8 byte block size. - // Oddly, sometimes EVP_Encrypt produces an extra block - // if the input is an exact multiple of the block size. - // So round up. - const U32 BLOCK_SIZE = 8; - len += BLOCK_SIZE; - len -= (len % BLOCK_SIZE); - return len; -} diff --git a/indra/llmessage/llblowfishcipher.h b/indra/llmessage/llblowfishcipher.h deleted file mode 100644 index 53dc94cce98..00000000000 --- a/indra/llmessage/llblowfishcipher.h +++ /dev/null @@ -1,57 +0,0 @@ -/** - * @file llblowfishcipher.h - * @brief A symmetric block cipher, designed in 1993 by Bruce Schneier. - * We use it because it has an 8 byte block size, allowing encryption of - * two UUIDs and a timestamp (16x2 + 4 = 36 bytes) with only 40 bytes of - * output. AES has a block size of 32 bytes, so this would require 64 bytes. - * - * $LicenseInfo:firstyear=2007&license=viewerlgpl$ - * Second Life Viewer Source Code - * Copyright (C) 2010, Linden Research, Inc. - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; - * version 2.1 of the License only. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA - * - * Linden Research, Inc., 945 Battery Street, San Francisco, CA 94111 USA - * $/LicenseInfo$ - */ - -#ifndef LLBLOWFISHCIPHER_H -#define LLBLOWFISHCIPHER_H - -#include "llcipher.h" - - -class LLBlowfishCipher : public LLCipher -{ -public: - // Secret may be up to 56 bytes in length per Blowfish spec. - LLBlowfishCipher(const U8* secret, size_t secret_size); - virtual ~LLBlowfishCipher(); - - // See llcipher.h for documentation. - /*virtual*/ U32 encrypt(const U8* src, U32 src_len, U8* dst, U32 dst_len); - /*virtual*/ U32 decrypt(const U8* src, U32 src_len, U8* dst, U32 dst_len); - /*virtual*/ U32 requiredEncryptionSpace(U32 src_len) const; - -#ifdef _DEBUG - static bool testHarness(); -#endif - -private: - U8* mSecret; - size_t mSecretSize; -}; - -#endif // LL_LLCRYPTO_H diff --git a/indra/llmessage/llbufferstream.cpp b/indra/llmessage/llbufferstream.cpp index 2c745f6fe47..cb5a4c1824c 100644 --- a/indra/llmessage/llbufferstream.cpp +++ b/indra/llmessage/llbufferstream.cpp @@ -234,17 +234,10 @@ int LLBufferStreamBuf::sync() } // virtual -#if( LL_WINDOWS || __GNUC__ > 2) LLBufferStreamBuf::pos_type LLBufferStreamBuf::seekoff( LLBufferStreamBuf::off_type off, std::ios::seekdir way, std::ios::openmode which) -#else -streampos LLBufferStreamBuf::seekoff( - streamoff off, - std::ios::seekdir way, - std::ios::openmode which) -#endif { if(!mBuffer || ((way == std::ios::beg) && (off < 0)) @@ -319,12 +312,8 @@ streampos LLBufferStreamBuf::seekoff( } } -#if( LL_WINDOWS || __GNUC__ > 2 ) S32 rv = (S32)(intptr_t)address; return (pos_type)rv; -#else - return (streampos)address; -#endif } diff --git a/indra/llmessage/llbufferstream.h b/indra/llmessage/llbufferstream.h index ac1aa49e817..e0a7d8c642a 100644 --- a/indra/llmessage/llbufferstream.h +++ b/indra/llmessage/llbufferstream.h @@ -48,10 +48,8 @@ class LLBufferStreamBuf : public std::streambuf virtual ~LLBufferStreamBuf(); protected: -#if( LL_WINDOWS || __GNUC__ > 2 ) typedef std::streambuf::pos_type pos_type; typedef std::streambuf::off_type off_type; -#endif /* @name streambuf vrtual implementations */ @@ -87,17 +85,10 @@ class LLBufferStreamBuf : public std::streambuf * or both masked together. * @return Returns the new position or an invalid position on failure. */ -#if( LL_WINDOWS || __GNUC__ > 2) virtual pos_type seekoff( off_type off, std::ios::seekdir way, std::ios::openmode which); -#else - virtual streampos seekoff( - streamoff off, - std::ios::seekdir way, - std::ios::openmode which); -#endif /* * @brief Get s sequence of characters from the input diff --git a/indra/llmessage/llcachename.cpp b/indra/llmessage/llcachename.cpp index 64f660d0ce2..56dfaef873a 100644 --- a/indra/llmessage/llcachename.cpp +++ b/indra/llmessage/llcachename.cpp @@ -600,7 +600,7 @@ std::string LLCacheName::buildLegacyName(const std::string& complete_name) // This is a little bit kludgy. LLCacheNameCallback is a slot instead of a function pointer. // The reason it is a slot is so that the legacy get() function below can bind an old callback -// and pass it as a slot. The reason it isn't a boost::function is so that trackable behavior +// and pass it as a slot. The reason it isn't a std::function is so that trackable behavior // doesn't get lost. As a result, we have to bind the slot to a signal to call it, even when // we call it immediately. -Steve // NOTE: Even though passing first and last name is a bit of extra overhead, it eliminates the @@ -780,6 +780,7 @@ void LLCacheName::Impl::processPendingAsks() void LLCacheName::Impl::processPendingReplies() { // First call all the callbacks, because they might send messages. + // Todo: needs cleanup logic, otherwise invalid ids might stay here indefinitely for(ReplyQueue::iterator it = mReplyQueue.begin(); it != mReplyQueue.end(); ++it) { PendingReply* reply = *it; diff --git a/indra/llmessage/llcircuit.cpp b/indra/llmessage/llcircuit.cpp index 8f9c02bdcac..c2b1a2f069a 100644 --- a/indra/llmessage/llcircuit.cpp +++ b/indra/llmessage/llcircuit.cpp @@ -71,8 +71,8 @@ LLCircuitData::LLCircuitData(const LLHost &host, TPACKETID in_id, mPacketsOutID(0), mPacketsInID(in_id), mHighestPacketID(in_id), - mTimeoutCallback(NULL), - mTimeoutUserData(NULL), + mTimeoutCallback(nullptr), + mTimeoutUserData(nullptr), mTrusted(false), mbAllowTimeout(true), mbAlive(true), diff --git a/indra/llmessage/llcoproceduremanager.cpp b/indra/llmessage/llcoproceduremanager.cpp index 5c7b1c42350..0e5725baf3f 100644 --- a/indra/llmessage/llcoproceduremanager.cpp +++ b/indra/llmessage/llcoproceduremanager.cpp @@ -53,7 +53,7 @@ static const U32 DEFAULT_POOL_SIZE = 5; const U32 LLCoprocedureManager::DEFAULT_QUEUE_SIZE = 1024*512; //========================================================================= -class LLCoprocedurePool: private boost::noncopyable +class LLCoprocedurePool { public: typedef LLCoprocedureManager::CoProcedure_t CoProcedure_t; @@ -61,6 +61,10 @@ class LLCoprocedurePool: private boost::noncopyable LLCoprocedurePool(const std::string &name, size_t size, size_t queue_size); ~LLCoprocedurePool(); + // Non-copyable + LLCoprocedurePool(const LLCoprocedurePool&) = delete; + LLCoprocedurePool& operator=(const LLCoprocedurePool&) = delete; + /// Places the coprocedure on the queue for processing. /// /// @param name Is used for debugging and should identify this coroutine. @@ -151,8 +155,8 @@ LLCoprocedureManager::~LLCoprocedureManager() // Shutting down, just log it LL_WARNS() << "Exception during ~LLCoprocedureManager(): " << e.what() << LL_ENDL; } - mPropertyQueryFn.clear(); - mPropertyDefineFn.clear(); + mPropertyQueryFn = nullptr; + mPropertyDefineFn = nullptr; mPoolMap.clear(); } @@ -195,7 +199,7 @@ void LLCoprocedureManager::initializePool(const std::string &poolName, size_t qu LL_WARNS("CoProcMgr") << "LLCoprocedureManager: No setting for \"" << keyName << "\" setting pool size to default of " << size << LL_ENDL; } - poolPtr_t pool(new LLCoprocedurePool(poolName, size, queue_size)); + poolPtr_t pool = std::make_shared(poolName, size, queue_size); LL_ERRS_IF(!pool, "CoprocedureManager") << "Unable to create pool named \"" << poolName << "\" FATAL!" << LL_ENDL; bool inserted = mPoolMap.emplace(poolName, pool).second; @@ -365,7 +369,7 @@ LLCoprocedurePool::LLCoprocedurePool(const std::string &poolName, size_t size, s for (size_t count = 0; count < mPoolSize; ++count) { - LLCoreHttpUtil::HttpCoroutineAdapter::ptr_t httpAdapter(new LLCoreHttpUtil::HttpCoroutineAdapter( mPoolName + "Adapter", mHTTPPolicy)); + LLCoreHttpUtil::HttpCoroutineAdapter::ptr_t httpAdapter = std::make_shared(mPoolName + "Adapter", mHTTPPolicy); std::string pooledCoro = LLCoros::instance().launch( "LLCoprocedurePool("+mPoolName+")::coprocedureInvokerCoro", diff --git a/indra/llmessage/llcoproceduremanager.h b/indra/llmessage/llcoproceduremanager.h index 485333657ca..f6f9a5783b2 100644 --- a/indra/llmessage/llcoproceduremanager.h +++ b/indra/llmessage/llcoproceduremanager.h @@ -41,10 +41,10 @@ class LLCoprocedureManager : public LLSingleton < LLCoprocedureManager > virtual ~LLCoprocedureManager(); public: - typedef boost::function SettingQuery_t; - typedef boost::function SettingUpdate_t; + typedef std::function SettingQuery_t; + typedef std::function SettingUpdate_t; - typedef boost::function CoProcedure_t; + typedef std::function CoProcedure_t; /// Places the coprocedure on the queue for processing. /// diff --git a/indra/llmessage/llcorehttputil.cpp b/indra/llmessage/llcorehttputil.cpp index 992e1457582..b24e5e4fccd 100644 --- a/indra/llmessage/llcorehttputil.cpp +++ b/indra/llmessage/llcorehttputil.cpp @@ -57,7 +57,7 @@ namespace inline bool getBoolSetting(const std::string &keyname) { - if (!mBoolSettingGet || mBoolSettingGet.empty()) + if (mBoolSettingGet == nullptr) return(false); return mBoolSettingGet(HTTP_LOGBODY_KEY); } @@ -69,7 +69,7 @@ void setPropertyMethods(BoolSettingQuery_t queryfn, BoolSettingUpdate_t updatefn mBoolSettingGet = queryfn; mBoolSettingPut = updatefn; - if (mBoolSettingPut && !mBoolSettingPut.empty()) + if (mBoolSettingPut != nullptr) { mBoolSettingPut(HTTP_LOGBODY_KEY, false, "Log the entire HTTP body in the case of an HTTP error."); } @@ -666,9 +666,9 @@ const std::string HttpCoroutineAdapter::HTTP_RESULTS_HEADERS("headers"); const std::string HttpCoroutineAdapter::HTTP_RESULTS_CONTENT("content"); const std::string HttpCoroutineAdapter::HTTP_RESULTS_RAW("raw"); -HttpCoroutineAdapter::HttpCoroutineAdapter(const std::string &name, +HttpCoroutineAdapter::HttpCoroutineAdapter(std::string name, LLCore::HttpRequest::policy_t policyId) : - mAdapterName(name), + mAdapterName(std::move(name)), mPolicyId(policyId), mYieldingHandle(LLCORE_HTTP_HANDLE_INVALID), mWeakRequest(), @@ -686,7 +686,7 @@ LLSD HttpCoroutineAdapter::postAndSuspend(LLCore::HttpRequest::ptr_t request, LLCore::HttpOptions::ptr_t options, LLCore::HttpHeaders::ptr_t headers) { LLEventStream replyPump(mAdapterName, true); - HttpCoroHandler::ptr_t httpHandler(new HttpCoroLLSDHandler(replyPump)); + HttpCoroHandler::ptr_t httpHandler = std::make_shared(replyPump); return postAndSuspend_(request, url, body, options, headers, httpHandler); } @@ -723,7 +723,7 @@ LLSD HttpCoroutineAdapter::postAndSuspend(LLCore::HttpRequest::ptr_t request, LLCore::HttpOptions::ptr_t options, LLCore::HttpHeaders::ptr_t headers) { LLEventStream replyPump(mAdapterName, true); - HttpCoroHandler::ptr_t httpHandler(new HttpCoroLLSDHandler(replyPump)); + HttpCoroHandler::ptr_t httpHandler = std::make_shared(replyPump); return postAndSuspend_(request, url, rawbody, options, headers, httpHandler); } @@ -733,7 +733,7 @@ LLSD HttpCoroutineAdapter::postRawAndSuspend(LLCore::HttpRequest::ptr_t request, LLCore::HttpOptions::ptr_t options, LLCore::HttpHeaders::ptr_t headers) { LLEventStream replyPump(mAdapterName, true); - HttpCoroHandler::ptr_t httpHandler(new HttpCoroRawHandler(replyPump)); + HttpCoroHandler::ptr_t httpHandler = std::make_shared(replyPump); return postAndSuspend_(request, url, rawbody, options, headers, httpHandler); } @@ -797,7 +797,7 @@ LLSD HttpCoroutineAdapter::postJsonAndSuspend(LLCore::HttpRequest::ptr_t request LLCore::HttpOptions::ptr_t options, LLCore::HttpHeaders::ptr_t headers) { LLEventStream replyPump(mAdapterName, true); - HttpCoroHandler::ptr_t httpHandler(new HttpCoroJSONHandler(replyPump)); + HttpCoroHandler::ptr_t httpHandler = std::make_shared(replyPump); LLCore::BufferArray::ptr_t rawbody(new LLCore::BufferArray); @@ -846,7 +846,7 @@ LLSD HttpCoroutineAdapter::putAndSuspend(LLCore::HttpRequest::ptr_t request, LLCore::HttpOptions::ptr_t options, LLCore::HttpHeaders::ptr_t headers) { LLEventStream replyPump(mAdapterName + "Reply", true); - HttpCoroHandler::ptr_t httpHandler(new HttpCoroLLSDHandler(replyPump)); + HttpCoroHandler::ptr_t httpHandler = std::make_shared(replyPump); return putAndSuspend_(request, url, body, options, headers, httpHandler); } @@ -856,7 +856,7 @@ LLSD HttpCoroutineAdapter::putJsonAndSuspend(LLCore::HttpRequest::ptr_t request, LLCore::HttpOptions::ptr_t options, LLCore::HttpHeaders::ptr_t headers) { LLEventStream replyPump(mAdapterName, true); - HttpCoroHandler::ptr_t httpHandler(new HttpCoroJSONHandler(replyPump)); + HttpCoroHandler::ptr_t httpHandler = std::make_shared(replyPump); LLCore::BufferArray::ptr_t rawbody(new LLCore::BufferArray); @@ -931,7 +931,7 @@ LLSD HttpCoroutineAdapter::getAndSuspend(LLCore::HttpRequest::ptr_t request, LLCore::HttpOptions::ptr_t options, LLCore::HttpHeaders::ptr_t headers) { LLEventStream replyPump(mAdapterName + "Reply", true); - HttpCoroHandler::ptr_t httpHandler(new HttpCoroLLSDHandler(replyPump)); + HttpCoroHandler::ptr_t httpHandler = std::make_shared(replyPump); return getAndSuspend_(request, url, options, headers, httpHandler); } @@ -941,7 +941,7 @@ LLSD HttpCoroutineAdapter::getRawAndSuspend(LLCore::HttpRequest::ptr_t request, LLCore::HttpOptions::ptr_t options, LLCore::HttpHeaders::ptr_t headers) { LLEventStream replyPump(mAdapterName + "Reply", true); - HttpCoroHandler::ptr_t httpHandler(new HttpCoroRawHandler(replyPump)); + HttpCoroHandler::ptr_t httpHandler = std::make_shared(replyPump); return getAndSuspend_(request, url, options, headers, httpHandler); } @@ -950,7 +950,7 @@ LLSD HttpCoroutineAdapter::getJsonAndSuspend(LLCore::HttpRequest::ptr_t request, const std::string & url, LLCore::HttpOptions::ptr_t options, LLCore::HttpHeaders::ptr_t headers) { LLEventStream replyPump(mAdapterName + "Reply", true); - HttpCoroHandler::ptr_t httpHandler(new HttpCoroJSONHandler(replyPump)); + HttpCoroHandler::ptr_t httpHandler = std::make_shared(replyPump); return getAndSuspend_(request, url, options, headers, httpHandler); } @@ -987,7 +987,7 @@ LLSD HttpCoroutineAdapter::deleteAndSuspend(LLCore::HttpRequest::ptr_t request, LLCore::HttpOptions::ptr_t options, LLCore::HttpHeaders::ptr_t headers) { LLEventStream replyPump(mAdapterName + "Reply", true); - HttpCoroHandler::ptr_t httpHandler(new HttpCoroLLSDHandler(replyPump)); + HttpCoroHandler::ptr_t httpHandler = std::make_shared(replyPump); return deleteAndSuspend_(request, url, options, headers, httpHandler); } @@ -997,7 +997,7 @@ LLSD HttpCoroutineAdapter::deleteJsonAndSuspend(LLCore::HttpRequest::ptr_t reque LLCore::HttpOptions::ptr_t options, LLCore::HttpHeaders::ptr_t headers) { LLEventStream replyPump(mAdapterName + "Reply", true); - HttpCoroHandler::ptr_t httpHandler(new HttpCoroJSONHandler(replyPump)); + HttpCoroHandler::ptr_t httpHandler = std::make_shared(replyPump); return deleteAndSuspend_(request, url, options, headers, httpHandler); } @@ -1032,7 +1032,7 @@ LLSD HttpCoroutineAdapter::patchAndSuspend(LLCore::HttpRequest::ptr_t request, LLCore::HttpOptions::ptr_t options, LLCore::HttpHeaders::ptr_t headers) { LLEventStream replyPump(mAdapterName + "Reply", true); - HttpCoroHandler::ptr_t httpHandler(new HttpCoroLLSDHandler(replyPump)); + HttpCoroHandler::ptr_t httpHandler = std::make_shared(replyPump); return patchAndSuspend_(request, url, body, options, headers, httpHandler); } @@ -1070,10 +1070,10 @@ LLSD HttpCoroutineAdapter::copyAndSuspend(LLCore::HttpRequest::ptr_t request, LLCore::HttpOptions::ptr_t options, LLCore::HttpHeaders::ptr_t headers) { LLEventStream replyPump(mAdapterName + "Reply", true); - HttpCoroHandler::ptr_t httpHandler(new HttpCoroLLSDHandler(replyPump)); + HttpCoroHandler::ptr_t httpHandler = std::make_shared(replyPump); if (!headers) - headers.reset(new LLCore::HttpHeaders); + headers = std::make_shared(); headers->append(HTTP_OUT_HEADER_DESTINATION, dest); return copyAndSuspend_(request, url, options, headers, httpHandler); @@ -1112,10 +1112,10 @@ LLSD HttpCoroutineAdapter::moveAndSuspend(LLCore::HttpRequest::ptr_t request, LLCore::HttpOptions::ptr_t options, LLCore::HttpHeaders::ptr_t headers) { LLEventStream replyPump(mAdapterName + "Reply", true); - HttpCoroHandler::ptr_t httpHandler(new HttpCoroLLSDHandler(replyPump)); + HttpCoroHandler::ptr_t httpHandler = std::make_shared(replyPump); if (!headers) - headers.reset(new LLCore::HttpHeaders); + headers = std::make_shared(); headers->append(HTTP_OUT_HEADER_DESTINATION, dest); return moveAndSuspend_(request, url, options, headers, httpHandler); @@ -1153,7 +1153,7 @@ LLSD HttpCoroutineAdapter::moveAndSuspend_(LLCore::HttpRequest::ptr_t &request, void HttpCoroutineAdapter::checkDefaultHeaders(LLCore::HttpHeaders::ptr_t &headers) { if (!headers) - headers.reset(new LLCore::HttpHeaders); + headers = std::make_shared(); if (!headers->find(HTTP_OUT_HEADER_ACCEPT)) { headers->append(HTTP_OUT_HEADER_ACCEPT, HTTP_CONTENT_LLSD_XML); @@ -1236,9 +1236,9 @@ void HttpCoroutineAdapter::callbackHttpGet(const std::string &url, LLCore::HttpR /*static*/ void HttpCoroutineAdapter::messageHttpGet(const std::string &url, const std::string &success, const std::string &failure) { - completionCallback_t cbSuccess = (success.empty()) ? NULL : + completionCallback_t cbSuccess = (success.empty()) ? nullptr : static_cast(boost::bind(&logMessageSuccess, "HttpCoroutineAdapter", url, success)); - completionCallback_t cbFailure = (failure.empty()) ? NULL : + completionCallback_t cbFailure = (failure.empty()) ? nullptr : static_cast(boost::bind(&logMessageFail, "HttpCoroutineAdapter", url, failure)); callbackHttpGet(url, cbSuccess, cbFailure); } @@ -1247,9 +1247,9 @@ void HttpCoroutineAdapter::messageHttpGet(const std::string &url, const std::str void HttpCoroutineAdapter::trivialGetCoro(std::string url, LLCore::HttpRequest::policy_t policyId, completionCallback_t success, completionCallback_t failure) { LLCoreHttpUtil::HttpCoroutineAdapter::ptr_t - httpAdapter(new LLCoreHttpUtil::HttpCoroutineAdapter("genericGetCoro", policyId)); - LLCore::HttpRequest::ptr_t httpRequest(new LLCore::HttpRequest); - LLCore::HttpOptions::ptr_t httpOpts(new LLCore::HttpOptions); + httpAdapter = std::make_shared("genericGetCoro", policyId); + LLCore::HttpRequest::ptr_t httpRequest = std::make_shared(); + LLCore::HttpOptions::ptr_t httpOpts = std::make_shared(); httpOpts->setWantHeaders(true); @@ -1286,9 +1286,9 @@ void HttpCoroutineAdapter::callbackHttpPost(const std::string &url, LLCore::Http /*static*/ void HttpCoroutineAdapter::messageHttpPost(const std::string &url, const LLSD &postData, const std::string &success, const std::string &failure) { - completionCallback_t cbSuccess = (success.empty()) ? NULL : + completionCallback_t cbSuccess = (success.empty()) ? nullptr : static_cast(boost::bind(&logMessageSuccess, "HttpCoroutineAdapter", url, success)); - completionCallback_t cbFailure = (failure.empty()) ? NULL : + completionCallback_t cbFailure = (failure.empty()) ? nullptr : static_cast(boost::bind(&logMessageFail, "HttpCoroutineAdapter", url, failure)); callbackHttpPost(url, postData, cbSuccess, cbFailure); @@ -1298,9 +1298,9 @@ void HttpCoroutineAdapter::messageHttpPost(const std::string &url, const LLSD &p void HttpCoroutineAdapter::trivialPostCoro(std::string url, LLCore::HttpRequest::policy_t policyId, LLSD postData, completionCallback_t success, completionCallback_t failure) { LLCoreHttpUtil::HttpCoroutineAdapter::ptr_t - httpAdapter(new LLCoreHttpUtil::HttpCoroutineAdapter("genericPostCoro", policyId)); - LLCore::HttpRequest::ptr_t httpRequest(new LLCore::HttpRequest); - LLCore::HttpOptions::ptr_t httpOpts(new LLCore::HttpOptions); + httpAdapter = std::make_shared("genericPostCoro", policyId); + LLCore::HttpRequest::ptr_t httpRequest = std::make_shared(); + LLCore::HttpOptions::ptr_t httpOpts = std::make_shared(); httpOpts->setWantHeaders(true); @@ -1342,9 +1342,9 @@ void HttpCoroutineAdapter::callbackHttpDel(const std::string &url, LLCore::HttpR void HttpCoroutineAdapter::trivialDelCoro(std::string url, LLCore::HttpRequest::policy_t policyId, completionCallback_t success, completionCallback_t failure) { - LLCoreHttpUtil::HttpCoroutineAdapter::ptr_t httpAdapter(new LLCoreHttpUtil::HttpCoroutineAdapter("genericDelCoro", policyId)); - LLCore::HttpRequest::ptr_t httpRequest(new LLCore::HttpRequest); - LLCore::HttpOptions::ptr_t httpOpts(new LLCore::HttpOptions); + LLCoreHttpUtil::HttpCoroutineAdapter::ptr_t httpAdapter = std::make_shared("genericDelCoro", policyId); + LLCore::HttpRequest::ptr_t httpRequest = std::make_shared(); + LLCore::HttpOptions::ptr_t httpOpts = std::make_shared(); httpOpts->setWantHeaders(true); diff --git a/indra/llmessage/llcorehttputil.h b/indra/llmessage/llcorehttputil.h index 45b673b9d58..3dbfd6f00db 100644 --- a/indra/llmessage/llcorehttputil.h +++ b/indra/llmessage/llcorehttputil.h @@ -58,8 +58,8 @@ namespace LLCoreHttpUtil { /// Allow access to to the property settings methods. -typedef boost::function BoolSettingQuery_t; -typedef boost::function BoolSettingUpdate_t; +typedef std::function BoolSettingQuery_t; +typedef std::function BoolSettingUpdate_t; void setPropertyMethods(BoolSettingQuery_t queryfn, BoolSettingUpdate_t updatefn); @@ -320,7 +320,7 @@ class HttpCoroutineAdapter typedef std::shared_ptr ptr_t; typedef std::weak_ptr wptr_t; - HttpCoroutineAdapter(const std::string &name, LLCore::HttpRequest::policy_t policyId); + HttpCoroutineAdapter(std::string name, LLCore::HttpRequest::policy_t policyId); ~HttpCoroutineAdapter(); /// Execute a Post transaction on the supplied URL and yield execution of @@ -330,19 +330,19 @@ class HttpCoroutineAdapter /// not be deallocated during the yield. LLSD postAndSuspend(LLCore::HttpRequest::ptr_t request, const std::string & url, const LLSD & body, - LLCore::HttpOptions::ptr_t options = LLCore::HttpOptions::ptr_t(new LLCore::HttpOptions()), - LLCore::HttpHeaders::ptr_t headers = LLCore::HttpHeaders::ptr_t(new LLCore::HttpHeaders())); + LLCore::HttpOptions::ptr_t options = std::make_shared(), + LLCore::HttpHeaders::ptr_t headers = std::make_shared()); LLSD postAndSuspend(LLCore::HttpRequest::ptr_t request, const std::string & url, LLCore::BufferArray::ptr_t rawbody, - LLCore::HttpOptions::ptr_t options = LLCore::HttpOptions::ptr_t(new LLCore::HttpOptions()), - LLCore::HttpHeaders::ptr_t headers = LLCore::HttpHeaders::ptr_t(new LLCore::HttpHeaders())); + LLCore::HttpOptions::ptr_t options = std::make_shared(), + LLCore::HttpHeaders::ptr_t headers = std::make_shared()); LLSD postAndSuspend(LLCore::HttpRequest::ptr_t &request, const std::string & url, const LLSD & body, LLCore::HttpHeaders::ptr_t &headers) { return postAndSuspend(request, url, body, - LLCore::HttpOptions::ptr_t(new LLCore::HttpOptions()), headers); + std::make_shared(), headers); } LLSD postAndSuspend(LLCore::HttpRequest::ptr_t &request, @@ -350,59 +350,59 @@ class HttpCoroutineAdapter LLCore::HttpHeaders::ptr_t &headers) { return postAndSuspend(request, url, rawbody, - LLCore::HttpOptions::ptr_t(new LLCore::HttpOptions()), headers); + std::make_shared(), headers); } LLSD postRawAndSuspend(LLCore::HttpRequest::ptr_t request, const std::string & url, LLCore::BufferArray::ptr_t rawbody, - LLCore::HttpOptions::ptr_t options = LLCore::HttpOptions::ptr_t(new LLCore::HttpOptions()), - LLCore::HttpHeaders::ptr_t headers = LLCore::HttpHeaders::ptr_t(new LLCore::HttpHeaders())); + LLCore::HttpOptions::ptr_t options = std::make_shared(), + LLCore::HttpHeaders::ptr_t headers = std::make_shared()); LLSD postRawAndSuspend(LLCore::HttpRequest::ptr_t &request, const std::string & url, LLCore::BufferArray::ptr_t &rawbody, LLCore::HttpHeaders::ptr_t &headers) { return postRawAndSuspend(request, url, rawbody, - LLCore::HttpOptions::ptr_t(new LLCore::HttpOptions()), headers); + std::make_shared(), headers); } LLSD postFileAndSuspend(LLCore::HttpRequest::ptr_t request, const std::string & url, std::string fileName, - LLCore::HttpOptions::ptr_t options = LLCore::HttpOptions::ptr_t(new LLCore::HttpOptions()), - LLCore::HttpHeaders::ptr_t headers = LLCore::HttpHeaders::ptr_t(new LLCore::HttpHeaders())); + LLCore::HttpOptions::ptr_t options = std::make_shared(), + LLCore::HttpHeaders::ptr_t headers = std::make_shared()); LLSD postFileAndSuspend(LLCore::HttpRequest::ptr_t &request, const std::string & url, std::string fileName, LLCore::HttpHeaders::ptr_t &headers) { return postFileAndSuspend(request, url, fileName, - LLCore::HttpOptions::ptr_t(new LLCore::HttpOptions()), headers); + std::make_shared(), headers); } LLSD postFileAndSuspend(LLCore::HttpRequest::ptr_t request, const std::string & url, LLUUID assetId, LLAssetType::EType assetType, - LLCore::HttpOptions::ptr_t options = LLCore::HttpOptions::ptr_t(new LLCore::HttpOptions()), - LLCore::HttpHeaders::ptr_t headers = LLCore::HttpHeaders::ptr_t(new LLCore::HttpHeaders())); + LLCore::HttpOptions::ptr_t options = std::make_shared(), + LLCore::HttpHeaders::ptr_t headers = std::make_shared()); LLSD postFileAndSuspend(LLCore::HttpRequest::ptr_t request, const std::string & url, LLUUID assetId, LLAssetType::EType assetType, LLCore::HttpHeaders::ptr_t &headers) { return postFileAndSuspend(request, url, assetId, assetType, - LLCore::HttpOptions::ptr_t(new LLCore::HttpOptions()), headers); + std::make_shared(), headers); } LLSD postJsonAndSuspend(LLCore::HttpRequest::ptr_t request, const std::string & url, const LLSD & body, - LLCore::HttpOptions::ptr_t options = LLCore::HttpOptions::ptr_t(new LLCore::HttpOptions()), - LLCore::HttpHeaders::ptr_t headers = LLCore::HttpHeaders::ptr_t(new LLCore::HttpHeaders())); + LLCore::HttpOptions::ptr_t options = std::make_shared(), + LLCore::HttpHeaders::ptr_t headers = std::make_shared()); LLSD postJsonAndSuspend(LLCore::HttpRequest::ptr_t &request, const std::string & url, const LLSD & body, LLCore::HttpHeaders::ptr_t &headers) { return postJsonAndSuspend(request, url, body, - LLCore::HttpOptions::ptr_t(new LLCore::HttpOptions()), headers); + std::make_shared(), headers); } @@ -414,27 +414,27 @@ class HttpCoroutineAdapter /// not be deallocated during the yield. LLSD putAndSuspend(LLCore::HttpRequest::ptr_t request, const std::string & url, const LLSD & body, - LLCore::HttpOptions::ptr_t options = LLCore::HttpOptions::ptr_t(new LLCore::HttpOptions()), - LLCore::HttpHeaders::ptr_t headers = LLCore::HttpHeaders::ptr_t(new LLCore::HttpHeaders())); + LLCore::HttpOptions::ptr_t options = std::make_shared(), + LLCore::HttpHeaders::ptr_t headers = std::make_shared()); LLSD putAndSuspend(LLCore::HttpRequest::ptr_t request, const std::string & url, const LLSD & body, LLCore::HttpHeaders::ptr_t headers) { return putAndSuspend(request, url, body, - LLCore::HttpOptions::ptr_t(new LLCore::HttpOptions()), headers); + std::make_shared(), headers); } LLSD putJsonAndSuspend(LLCore::HttpRequest::ptr_t request, const std::string & url, const LLSD & body, - LLCore::HttpOptions::ptr_t options = LLCore::HttpOptions::ptr_t(new LLCore::HttpOptions()), - LLCore::HttpHeaders::ptr_t headers = LLCore::HttpHeaders::ptr_t(new LLCore::HttpHeaders())); + LLCore::HttpOptions::ptr_t options = std::make_shared(), + LLCore::HttpHeaders::ptr_t headers = std::make_shared()); LLSD putJsonAndSuspend(LLCore::HttpRequest::ptr_t &request, const std::string & url, const LLSD & body, LLCore::HttpHeaders::ptr_t &headers) { return putJsonAndSuspend(request, url, body, - LLCore::HttpOptions::ptr_t(new LLCore::HttpOptions()), headers); + std::make_shared(), headers); } /// Execute a Get transaction on the supplied URL and yield execution of @@ -445,25 +445,25 @@ class HttpCoroutineAdapter /// LLSD getAndSuspend(LLCore::HttpRequest::ptr_t request, const std::string & url, - LLCore::HttpOptions::ptr_t options = LLCore::HttpOptions::ptr_t(new LLCore::HttpOptions()), - LLCore::HttpHeaders::ptr_t headers = LLCore::HttpHeaders::ptr_t(new LLCore::HttpHeaders())); + LLCore::HttpOptions::ptr_t options = std::make_shared(), + LLCore::HttpHeaders::ptr_t headers = std::make_shared()); LLSD getAndSuspend(LLCore::HttpRequest::ptr_t &request, const std::string & url, LLCore::HttpHeaders::ptr_t &headers) { return getAndSuspend(request, url, - LLCore::HttpOptions::ptr_t(new LLCore::HttpOptions()), + std::make_shared(), headers); } LLSD getRawAndSuspend(LLCore::HttpRequest::ptr_t request, const std::string & url, - LLCore::HttpOptions::ptr_t options = LLCore::HttpOptions::ptr_t(new LLCore::HttpOptions()), - LLCore::HttpHeaders::ptr_t headers = LLCore::HttpHeaders::ptr_t(new LLCore::HttpHeaders())); + LLCore::HttpOptions::ptr_t options = std::make_shared(), + LLCore::HttpHeaders::ptr_t headers = std::make_shared()); LLSD getRawAndSuspend(LLCore::HttpRequest::ptr_t &request, const std::string & url, LLCore::HttpHeaders::ptr_t &headers) { return getRawAndSuspend(request, url, - LLCore::HttpOptions::ptr_t(new LLCore::HttpOptions()), + std::make_shared(), headers); } @@ -473,13 +473,13 @@ class HttpCoroutineAdapter /// before being returned to the caller. LLSD getJsonAndSuspend(LLCore::HttpRequest::ptr_t request, const std::string & url, - LLCore::HttpOptions::ptr_t options = LLCore::HttpOptions::ptr_t(new LLCore::HttpOptions()), - LLCore::HttpHeaders::ptr_t headers = LLCore::HttpHeaders::ptr_t(new LLCore::HttpHeaders())); + LLCore::HttpOptions::ptr_t options = std::make_shared(), + LLCore::HttpHeaders::ptr_t headers = std::make_shared()); LLSD getJsonAndSuspend(LLCore::HttpRequest::ptr_t &request, const std::string & url, LLCore::HttpHeaders::ptr_t &headers) { return getJsonAndSuspend(request, url, - LLCore::HttpOptions::ptr_t(new LLCore::HttpOptions()), + std::make_shared(), headers); } @@ -491,13 +491,13 @@ class HttpCoroutineAdapter /// not be deallocated during the yield. LLSD deleteAndSuspend(LLCore::HttpRequest::ptr_t request, const std::string & url, - LLCore::HttpOptions::ptr_t options = LLCore::HttpOptions::ptr_t(new LLCore::HttpOptions()), - LLCore::HttpHeaders::ptr_t headers = LLCore::HttpHeaders::ptr_t(new LLCore::HttpHeaders())); + LLCore::HttpOptions::ptr_t options = std::make_shared(), + LLCore::HttpHeaders::ptr_t headers = std::make_shared()); LLSD deleteAndSuspend(LLCore::HttpRequest::ptr_t request, const std::string & url, LLCore::HttpHeaders::ptr_t headers) { return deleteAndSuspend(request, url, - LLCore::HttpOptions::ptr_t(new LLCore::HttpOptions()), + std::make_shared(), headers); } @@ -507,13 +507,13 @@ class HttpCoroutineAdapter /// before being returned to the caller. LLSD deleteJsonAndSuspend(LLCore::HttpRequest::ptr_t request, const std::string & url, - LLCore::HttpOptions::ptr_t options = LLCore::HttpOptions::ptr_t(new LLCore::HttpOptions()), - LLCore::HttpHeaders::ptr_t headers = LLCore::HttpHeaders::ptr_t(new LLCore::HttpHeaders())); + LLCore::HttpOptions::ptr_t options = std::make_shared(), + LLCore::HttpHeaders::ptr_t headers = std::make_shared()); LLSD deleteJsonAndSuspend(LLCore::HttpRequest::ptr_t request, const std::string & url, LLCore::HttpHeaders::ptr_t headers) { return deleteJsonAndSuspend(request, url, - LLCore::HttpOptions::ptr_t(new LLCore::HttpOptions()), + std::make_shared(), headers); } @@ -525,14 +525,14 @@ class HttpCoroutineAdapter /// not be deallocated during the yield. LLSD patchAndSuspend(LLCore::HttpRequest::ptr_t request, const std::string & url, const LLSD & body, - LLCore::HttpOptions::ptr_t options = LLCore::HttpOptions::ptr_t(new LLCore::HttpOptions()), - LLCore::HttpHeaders::ptr_t headers = LLCore::HttpHeaders::ptr_t(new LLCore::HttpHeaders())); + LLCore::HttpOptions::ptr_t options = std::make_shared(), + LLCore::HttpHeaders::ptr_t headers = std::make_shared()); LLSD patchAndSuspend(LLCore::HttpRequest::ptr_t &request, const std::string & url, const LLSD & body, LLCore::HttpHeaders::ptr_t &headers) { return patchAndSuspend(request, url, body, - LLCore::HttpOptions::ptr_t(new LLCore::HttpOptions()), headers); + std::make_shared(), headers); } /// Execute a COPY transaction on the supplied URL and yield execution of @@ -545,14 +545,14 @@ class HttpCoroutineAdapter /// not be deallocated during the yield. LLSD copyAndSuspend(LLCore::HttpRequest::ptr_t request, const std::string & url, const std::string dest, - LLCore::HttpOptions::ptr_t options = LLCore::HttpOptions::ptr_t(new LLCore::HttpOptions()), - LLCore::HttpHeaders::ptr_t headers = LLCore::HttpHeaders::ptr_t(new LLCore::HttpHeaders())); + LLCore::HttpOptions::ptr_t options = std::make_shared(), + LLCore::HttpHeaders::ptr_t headers = std::make_shared()); LLSD copyAndSuspend(LLCore::HttpRequest::ptr_t &request, const std::string & url, const std::string & dest, LLCore::HttpHeaders::ptr_t &headers) { return copyAndSuspend(request, url, dest, - LLCore::HttpOptions::ptr_t(new LLCore::HttpOptions()), headers); + std::make_shared(), headers); } /// Execute a MOVE transaction on the supplied URL and yield execution of @@ -565,14 +565,14 @@ class HttpCoroutineAdapter /// not be deallocated during the yield. LLSD moveAndSuspend(LLCore::HttpRequest::ptr_t request, const std::string & url, const std::string dest, - LLCore::HttpOptions::ptr_t options = LLCore::HttpOptions::ptr_t(new LLCore::HttpOptions()), - LLCore::HttpHeaders::ptr_t headers = LLCore::HttpHeaders::ptr_t(new LLCore::HttpHeaders())); + LLCore::HttpOptions::ptr_t options = std::make_shared(), + LLCore::HttpHeaders::ptr_t headers = std::make_shared()); LLSD moveAndSuspend(LLCore::HttpRequest::ptr_t &request, const std::string & url, const std::string & dest, LLCore::HttpHeaders::ptr_t &headers) { return moveAndSuspend(request, url, dest, - LLCore::HttpOptions::ptr_t(new LLCore::HttpOptions()), headers); + std::make_shared(), headers); } /// @@ -585,21 +585,21 @@ class HttpCoroutineAdapter /// should match this form. /// @sa callbackHttpGet /// @sa callbackHttpPost - typedef boost::function completionCallback_t; + typedef std::function completionCallback_t; - static void callbackHttpGet(const std::string &url, LLCore::HttpRequest::policy_t policyId, completionCallback_t success = NULL, completionCallback_t failure = NULL); - static void callbackHttpGet(const std::string &url, completionCallback_t success = NULL, completionCallback_t failure = NULL) + static void callbackHttpGet(const std::string &url, LLCore::HttpRequest::policy_t policyId, completionCallback_t success = nullptr, completionCallback_t failure = nullptr); + static void callbackHttpGet(const std::string &url, completionCallback_t success = nullptr, completionCallback_t failure = nullptr) { callbackHttpGet(url, LLCore::HttpRequest::DEFAULT_POLICY_ID, success, failure); } - static void callbackHttpPost(const std::string &url, LLCore::HttpRequest::policy_t policyId, const LLSD &postData, completionCallback_t success = NULL, completionCallback_t failure = NULL); - static void callbackHttpPost(const std::string &url, const LLSD &postData, completionCallback_t success = NULL, completionCallback_t failure = NULL) + static void callbackHttpPost(const std::string &url, LLCore::HttpRequest::policy_t policyId, const LLSD &postData, completionCallback_t success = nullptr, completionCallback_t failure = nullptr); + static void callbackHttpPost(const std::string &url, const LLSD &postData, completionCallback_t success = nullptr, completionCallback_t failure = nullptr) { callbackHttpPost(url, LLCore::HttpRequest::DEFAULT_POLICY_ID, postData, success, failure); } - static void callbackHttpDel(const std::string &url, LLCore::HttpRequest::policy_t policyId, completionCallback_t success = NULL, - completionCallback_t failure = NULL); + static void callbackHttpDel(const std::string& url, LLCore::HttpRequest::policy_t policyId, completionCallback_t success = nullptr, + completionCallback_t failure = nullptr); /// Generic Get and post routines for HTTP via coroutines. /// These static methods do all required setup for the GET or POST operation. diff --git a/indra/llmessage/llexperiencecache.cpp b/indra/llmessage/llexperiencecache.cpp index 78cca47456e..06cb1152a33 100644 --- a/indra/llmessage/llexperiencecache.cpp +++ b/indra/llmessage/llexperiencecache.cpp @@ -23,6 +23,8 @@ * Linden Research, Inc., 945 Battery Street, San Francisco, CA 94111 USA * $/LicenseInfo$ */ +#include "linden_common.h" + #include "llexperiencecache.h" #include "llavatarname.h" @@ -35,7 +37,6 @@ #include #include #include -#include //========================================================================= namespace LLExperienceCacheImpl @@ -249,7 +250,7 @@ const LLExperienceCache::cache_t& LLExperienceCache::getCached() void LLExperienceCache::requestExperiencesCoro(LLCoreHttpUtil::HttpCoroutineAdapter::ptr_t &httpAdapter, std::string url, RequestQueue_t requests) { - LLCore::HttpRequest::ptr_t httpRequest(new LLCore::HttpRequest()); + LLCore::HttpRequest::ptr_t httpRequest = std::make_shared(); //LL_INFOS("requestExperiencesCoro") << "url: " << url << LL_ENDL; @@ -320,7 +321,7 @@ void LLExperienceCache::requestExperiencesCoro(LLCoreHttpUtil::HttpCoroutineAdap void LLExperienceCache::requestExperiences() { - if (mCapability.empty()) + if (mCapability == nullptr) { LL_WARNS("ExperienceCache") << "Capability query method not set." << LL_ENDL; return; @@ -527,7 +528,7 @@ void LLExperienceCache::get(const LLUUID& key, LLExperienceCache::ExperienceGetF fetch(key); - signal_ptr signal = signal_ptr(new callback_signal_t()); + signal_ptr signal = std::make_shared(); std::pair result = mSignalMap.insert(signal_map_t::value_type(key, signal)); if (!result.second) @@ -538,7 +539,7 @@ void LLExperienceCache::get(const LLUUID& key, LLExperienceCache::ExperienceGetF //========================================================================= void LLExperienceCache::fetchAssociatedExperience(const LLUUID& objectId, const LLUUID& itemId, ExperienceGetFn_t fn) { - if (mCapability.empty()) + if (mCapability == nullptr) { LL_WARNS("ExperienceCache") << "Capability query method not set." << LL_ENDL; return; @@ -550,7 +551,7 @@ void LLExperienceCache::fetchAssociatedExperience(const LLUUID& objectId, const void LLExperienceCache::fetchAssociatedExperience(const LLUUID& objectId, const LLUUID& itemId, std::string url, ExperienceGetFn_t fn) { - if (mCapability.empty()) + if (mCapability == nullptr) { LL_WARNS("ExperienceCache") << "Capability query method not set." << LL_ENDL; return; @@ -562,7 +563,7 @@ void LLExperienceCache::fetchAssociatedExperience(const LLUUID& objectId, const void LLExperienceCache::fetchAssociatedExperienceCoro(LLCoreHttpUtil::HttpCoroutineAdapter::ptr_t &httpAdapter, LLUUID objectId, LLUUID itemId, std::string url, ExperienceGetFn_t fn) { - LLCore::HttpRequest::ptr_t httpRequest(new LLCore::HttpRequest()); + LLCore::HttpRequest::ptr_t httpRequest = std::make_shared(); if (url.empty()) { @@ -600,8 +601,10 @@ void LLExperienceCache::fetchAssociatedExperienceCoro(LLCoreHttpUtil::HttpCorout failure["error"] = -1; failure["message"] = "no experience"; } - if (fn && !fn.empty()) + if (fn != nullptr) + { fn(failure); + } return; } @@ -612,7 +615,7 @@ void LLExperienceCache::fetchAssociatedExperienceCoro(LLCoreHttpUtil::HttpCorout //------------------------------------------------------------------------- void LLExperienceCache::findExperienceByName(const std::string text, int page, ExperienceGetFn_t fn) { - if (mCapability.empty()) + if (mCapability == nullptr) { LL_WARNS("ExperienceCache") << "Capability query method not set." << LL_ENDL; return; @@ -624,7 +627,7 @@ void LLExperienceCache::findExperienceByName(const std::string text, int page, E void LLExperienceCache::findExperienceByNameCoro(LLCoreHttpUtil::HttpCoroutineAdapter::ptr_t &httpAdapter, std::string text, int page, ExperienceGetFn_t fn) { - LLCore::HttpRequest::ptr_t httpRequest(new LLCore::HttpRequest()); + LLCore::HttpRequest::ptr_t httpRequest = std::make_shared(); std::ostringstream url; @@ -655,7 +658,7 @@ void LLExperienceCache::findExperienceByNameCoro(LLCoreHttpUtil::HttpCoroutineAd //------------------------------------------------------------------------- void LLExperienceCache::getGroupExperiences(const LLUUID &groupId, ExperienceGetFn_t fn) { - if (mCapability.empty()) + if (mCapability == nullptr) { LL_WARNS("ExperienceCache") << "Capability query method not set." << LL_ENDL; return; @@ -667,7 +670,7 @@ void LLExperienceCache::getGroupExperiences(const LLUUID &groupId, ExperienceGet void LLExperienceCache::getGroupExperiencesCoro(LLCoreHttpUtil::HttpCoroutineAdapter::ptr_t &httpAdapter, LLUUID groupId, ExperienceGetFn_t fn) { - LLCore::HttpRequest::ptr_t httpRequest(new LLCore::HttpRequest()); + LLCore::HttpRequest::ptr_t httpRequest = std::make_shared(); // search for experiences owned by the current group std::string url = mCapability("GroupExperiences"); @@ -710,7 +713,7 @@ void LLExperienceCache::setRegionExperiences(CapabilityQuery_t regioncaps, const void LLExperienceCache::regionExperiencesCoro(LLCoreHttpUtil::HttpCoroutineAdapter::ptr_t &httpAdapter, CapabilityQuery_t regioncaps, bool update, LLSD experiences, ExperienceGetFn_t fn) { - LLCore::HttpRequest::ptr_t httpRequest(new LLCore::HttpRequest()); + LLCore::HttpRequest::ptr_t httpRequest = std::make_shared(); // search for experiences owned by the current group std::string url = regioncaps("RegionExperiences"); @@ -743,7 +746,7 @@ void LLExperienceCache::regionExperiencesCoro(LLCoreHttpUtil::HttpCoroutineAdapt //------------------------------------------------------------------------- void LLExperienceCache::getExperiencePermission(const LLUUID &experienceId, ExperienceGetFn_t fn) { - if (mCapability.empty()) + if (mCapability == nullptr) { LL_WARNS("ExperienceCache") << "Capability query method not set." << LL_ENDL; return; @@ -767,7 +770,7 @@ void LLExperienceCache::getExperiencePermission(const LLUUID &experienceId, Expe void LLExperienceCache::setExperiencePermission(const LLUUID &experienceId, const std::string &permission, ExperienceGetFn_t fn) { - if (mCapability.empty()) + if (mCapability == nullptr) { LL_WARNS("ExperienceCache") << "Capability query method not set." << LL_ENDL; return; @@ -797,7 +800,7 @@ void LLExperienceCache::setExperiencePermission(const LLUUID &experienceId, cons void LLExperienceCache::forgetExperiencePermission(const LLUUID &experienceId, ExperienceGetFn_t fn) { - if (mCapability.empty()) + if (mCapability == nullptr) { LL_WARNS("ExperienceCache") << "Capability query method not set." << LL_ENDL; return; @@ -822,7 +825,7 @@ void LLExperienceCache::forgetExperiencePermission(const LLUUID &experienceId, E void LLExperienceCache::experiencePermissionCoro(LLCoreHttpUtil::HttpCoroutineAdapter::ptr_t &httpAdapter, permissionInvoker_fn invokerfn, std::string url, ExperienceGetFn_t fn) { - LLCore::HttpRequest::ptr_t httpRequest(new LLCore::HttpRequest()); + LLCore::HttpRequest::ptr_t httpRequest = std::make_shared(); // search for experiences owned by the current group @@ -841,7 +844,7 @@ void LLExperienceCache::experiencePermissionCoro(LLCoreHttpUtil::HttpCoroutineAd //------------------------------------------------------------------------- void LLExperienceCache::getExperienceAdmin(const LLUUID &experienceId, ExperienceGetFn_t fn) { - if (mCapability.empty()) + if (mCapability == nullptr) { LL_WARNS("ExperienceCache") << "Capability query method not set." << LL_ENDL; return; @@ -853,7 +856,7 @@ void LLExperienceCache::getExperienceAdmin(const LLUUID &experienceId, Experienc void LLExperienceCache::getExperienceAdminCoro(LLCoreHttpUtil::HttpCoroutineAdapter::ptr_t &httpAdapter, LLUUID experienceId, ExperienceGetFn_t fn) { - LLCore::HttpRequest::ptr_t httpRequest(new LLCore::HttpRequest()); + LLCore::HttpRequest::ptr_t httpRequest = std::make_shared(); std::string url = mCapability("IsExperienceAdmin"); if (url.empty()) @@ -873,7 +876,7 @@ void LLExperienceCache::getExperienceAdminCoro(LLCoreHttpUtil::HttpCoroutineAdap //------------------------------------------------------------------------- void LLExperienceCache::updateExperience(LLSD updateData, ExperienceGetFn_t fn) { - if (mCapability.empty()) + if (mCapability == nullptr) { LL_WARNS("ExperienceCache") << "Capability query method not set." << LL_ENDL; return; @@ -885,7 +888,7 @@ void LLExperienceCache::updateExperience(LLSD updateData, ExperienceGetFn_t fn) void LLExperienceCache::updateExperienceCoro(LLCoreHttpUtil::HttpCoroutineAdapter::ptr_t &httpAdapter, LLSD updateData, ExperienceGetFn_t fn) { - LLCore::HttpRequest::ptr_t httpRequest(new LLCore::HttpRequest()); + LLCore::HttpRequest::ptr_t httpRequest = std::make_shared(); std::string url = mCapability("UpdateExperience"); if (url.empty()) diff --git a/indra/llmessage/llexperiencecache.h b/indra/llmessage/llexperiencecache.h index 81e904107f2..4b344347d5c 100644 --- a/indra/llmessage/llexperiencecache.h +++ b/indra/llmessage/llexperiencecache.h @@ -35,7 +35,7 @@ #include "llsd.h" #include "llcorehttputil.h" #include -#include +#include class LLSD; class LLUUID; @@ -46,8 +46,8 @@ class LLExperienceCache: public LLSingleton < LLExperienceCache > LLSINGLETON(LLExperienceCache); public: - typedef boost::function CapabilityQuery_t; - typedef boost::function ExperienceGetFn_t; + typedef std::function CapabilityQuery_t; + typedef std::function ExperienceGetFn_t; void setCapabilityQuery(CapabilityQuery_t queryfn); void cleanup(); @@ -108,7 +108,7 @@ class LLExperienceCache: public LLSingleton < LLExperienceCache > virtual void initSingleton() override; - typedef boost::function permissionInvoker_fn; + typedef std::function permissionInvoker_fn; // Callback types for get() typedef boost::signals2::signal < void(const LLSD &) > callback_signal_t; diff --git a/indra/llmessage/llmail.cpp b/indra/llmessage/llmail.cpp deleted file mode 100644 index b842aeda620..00000000000 --- a/indra/llmessage/llmail.cpp +++ /dev/null @@ -1,395 +0,0 @@ -/** - * @file llmail.cpp - * @brief smtp helper functions. - * - * $LicenseInfo:firstyear=2001&license=viewerlgpl$ - * Second Life Viewer Source Code - * Copyright (C) 2010, Linden Research, Inc. - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; - * version 2.1 of the License only. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA - * - * Linden Research, Inc., 945 Battery Street, San Francisco, CA 94111 USA - * $/LicenseInfo$ - */ - -#include "linden_common.h" - -#include "llmail.h" - -#include "llwin32headers.h" -#include -#include - -#include "apr_pools.h" -#include "apr_network_io.h" - -#include "llapr.h" -#include "llbase32.h" // IM-to-email address -#include "llblowfishcipher.h" -#include "llerror.h" -#include "llhost.h" -#include "llsd.h" -#include "llstring.h" -#include "lluuid.h" -#include "net.h" - -// -// constants -// -const size_t LL_MAX_KNOWN_GOOD_MAIL_SIZE = 4096; - -static bool gMailEnabled = true; -static apr_pool_t* gMailPool; -static apr_sockaddr_t* gSockAddr; -static apr_socket_t* gMailSocket; - -bool connect_smtp(); -void disconnect_smtp(); - -//#if LL_WINDOWS -//SOCKADDR_IN gMailDstAddr, gMailSrcAddr, gMailLclAddr; -//#else -//struct sockaddr_in gMailDstAddr, gMailSrcAddr, gMailLclAddr; -//#endif - -// Define this for a super-spammy mail mode. -//#define LL_LOG_ENTIRE_MAIL_MESSAGE_ON_SEND 1 - -bool connect_smtp() -{ - // Prepare an soket to talk smtp - apr_status_t status; - status = apr_socket_create( - &gMailSocket, - gSockAddr->sa.sin.sin_family, - SOCK_STREAM, - APR_PROTO_TCP, - gMailPool); - if(ll_apr_warn_status(status)) return false; - status = apr_socket_connect(gMailSocket, gSockAddr); - if(ll_apr_warn_status(status)) - { - status = apr_socket_close(gMailSocket); - ll_apr_warn_status(status); - return false; - } - return true; -} - -void disconnect_smtp() -{ - if(gMailSocket) - { - apr_status_t status = apr_socket_close(gMailSocket); - ll_apr_warn_status(status); - gMailSocket = NULL; - } -} - -// Returns true on success. -// message should NOT be SMTP escaped. -// static -bool LLMail::send( - const char* from_name, - const char* from_address, - const char* to_name, - const char* to_address, - const char* subject, - const char* message, - const LLSD& headers) -{ - std::string header = buildSMTPTransaction( - from_name, - from_address, - to_name, - to_address, - subject, - headers); - if(header.empty()) - { - return false; - } - - std::string message_str; - if(message) - { - message_str = message; - } - bool rv = send(header, message_str, to_address, from_address); - if(rv) return true; - return false; -} - -// static -void LLMail::init(const std::string& hostname, apr_pool_t* pool) -{ - gMailSocket = NULL; - if(hostname.empty() || !pool) - { - gMailPool = NULL; - gSockAddr = NULL; - } - else - { - gMailPool = pool; - - // collect all the information into a socaddr sturcture. the - // documentation is a bit unclear, but I either have to - // specify APR_UNSPEC or not specify any flags. I am not sure - // which option is better. - apr_status_t status = apr_sockaddr_info_get( - &gSockAddr, - hostname.c_str(), - APR_UNSPEC, - 25, - APR_IPV4_ADDR_OK, - gMailPool); - ll_apr_warn_status(status); - } -} - -// static -void LLMail::enable(bool mail_enabled) -{ - gMailEnabled = mail_enabled; -} - -// Test a subject line for RFC2822 compliance. -static bool valid_subject_chars(const char *subject) -{ - for (; *subject != '\0'; subject++) - { - unsigned char c = *subject; - - if (c == '\xa' || c == '\xd' || c > '\x7f') - { - return false; - } - } - - return true; -} - -// static -std::string LLMail::buildSMTPTransaction( - const char* from_name, - const char* from_address, - const char* to_name, - const char* to_address, - const char* subject, - const LLSD& headers) -{ - if(!from_address || !to_address) - { - LL_INFOS() << "send_mail build_smtp_transaction reject: missing to and/or" - << " from address." << LL_ENDL; - return std::string(); - } - if(!valid_subject_chars(subject)) - { - LL_INFOS() << "send_mail build_smtp_transaction reject: bad subject header: " - << "to=<" << to_address - << ">, from=<" << from_address << ">" - << LL_ENDL; - return std::string(); - } - std::ostringstream from_fmt; - if(from_name && from_name[0]) - { - // "My Name" - from_fmt << "\"" << from_name << "\" <" << from_address << ">"; - } - else - { - // - from_fmt << "<" << from_address << ">"; - } - std::ostringstream to_fmt; - if(to_name && to_name[0]) - { - to_fmt << "\"" << to_name << "\" <" << to_address << ">"; - } - else - { - to_fmt << "<" << to_address << ">"; - } - std::ostringstream header; - header - << "HELO lindenlab.com\r\n" - << "MAIL FROM:<" << from_address << ">\r\n" - << "RCPT TO:<" << to_address << ">\r\n" - << "DATA\r\n" - << "From: " << from_fmt.str() << "\r\n" - << "To: " << to_fmt.str() << "\r\n" - << "Subject: " << subject << "\r\n"; - - if(headers.isMap()) - { - LLSD::map_const_iterator iter = headers.beginMap(); - LLSD::map_const_iterator end = headers.endMap(); - for(; iter != end; ++iter) - { - header << (*iter).first << ": " << ((*iter).second).asString() - << "\r\n"; - } - } - - header << "\r\n"; - return header.str(); -} - -// static -bool LLMail::send( - const std::string& header, - const std::string& raw_message, - const char* from_address, - const char* to_address) -{ - if(!from_address || !to_address) - { - LL_INFOS() << "send_mail reject: missing to and/or from address." - << LL_ENDL; - return false; - } - - // remove any "." SMTP commands to prevent injection (DEV-35777) - // we don't need to worry about "\r\n.\r\n" because of the - // "\n" --> "\n\n" conversion going into rfc2822_msg below - std::string message = raw_message; - std::string bad_string = "\n.\n"; - std::string good_string = "\n..\n"; - while (1) - { - auto index = message.find(bad_string); - if (index == std::string::npos) break; - message.replace(index, bad_string.size(), good_string); - } - - // convert all "\n" into "\r\n" - std::ostringstream rfc2822_msg; - for(U32 i = 0; i < message.size(); ++i) - { - switch(message[i]) - { - case '\0': - break; - case '\n': - // *NOTE: this is kinda busted if we're fed \r\n - rfc2822_msg << "\r\n"; - break; - default: - rfc2822_msg << message[i]; - break; - } - } - - if(!gMailEnabled) - { - LL_INFOS() << "send_mail reject: mail system is disabled: to=<" - << to_address << ">, from=<" << from_address - << ">" << LL_ENDL; - // Any future interface to SMTP should return this as an - // error. --mark - return true; - } - if(!gSockAddr) - { - LL_WARNS() << "send_mail reject: mail system not initialized: to=<" - << to_address << ">, from=<" << from_address - << ">" << LL_ENDL; - return false; - } - - if(!connect_smtp()) - { - LL_WARNS() << "send_mail reject: SMTP connect failure: to=<" - << to_address << ">, from=<" << from_address - << ">" << LL_ENDL; - return false; - } - - std::ostringstream smtp_fmt; - smtp_fmt << header << rfc2822_msg.str() << "\r\n" << ".\r\n" << "QUIT\r\n"; - std::string smtp_transaction = smtp_fmt.str(); - size_t original_size = smtp_transaction.size(); - apr_size_t send_size = original_size; - apr_status_t status = apr_socket_send( - gMailSocket, - smtp_transaction.c_str(), - (apr_size_t*)&send_size); - disconnect_smtp(); - if(ll_apr_warn_status(status)) - { - LL_WARNS() << "send_mail socket failure: unable to write " - << "to=<" << to_address - << ">, from=<" << from_address << ">" - << ", bytes=" << original_size - << ", sent=" << send_size << LL_ENDL; - return false; - } - if(send_size >= LL_MAX_KNOWN_GOOD_MAIL_SIZE) - { - LL_WARNS() << "send_mail message has been shown to fail in testing " - << "when sending messages larger than " << LL_MAX_KNOWN_GOOD_MAIL_SIZE - << " bytes. The next log about success is potentially a lie." << LL_ENDL; - } - LL_DEBUGS() << "send_mail success: " - << "to=<" << to_address - << ">, from=<" << from_address << ">" - << ", bytes=" << original_size - << ", sent=" << send_size << LL_ENDL; - -#if LL_LOG_ENTIRE_MAIL_MESSAGE_ON_SEND - LL_INFOS() << rfc2822_msg.str() << LL_ENDL; -#endif - return true; -} - - -// static -std::string LLMail::encryptIMEmailAddress(const LLUUID& from_agent_id, - const LLUUID& to_agent_id, - U32 time, - const U8* secret, - size_t secret_size) -{ -#if LL_WINDOWS - return "blowfish-not-supported-on-windows"; -#else - size_t data_size = 4 + UUID_BYTES + UUID_BYTES; - // Convert input data into a binary blob - std::vector data; - data.resize(data_size); - // *NOTE: This may suffer from endian issues. Could be htolememcpy. - memcpy(&data[0], &time, 4); - memcpy(&data[4], &from_agent_id.mData[0], UUID_BYTES); - memcpy(&data[4 + UUID_BYTES], &to_agent_id.mData[0], UUID_BYTES); - - // Encrypt the blob - LLBlowfishCipher cipher(secret, secret_size); - size_t encrypted_size = cipher.requiredEncryptionSpace(data.size()); - U8* encrypted = new U8[encrypted_size]; - cipher.encrypt(&data[0], data_size, encrypted, encrypted_size); - - std::string address = LLBase32::encode(encrypted, encrypted_size); - - // Make it more pretty for humans. - LLStringUtil::toLower(address); - - delete [] encrypted; - - return address; -#endif -} diff --git a/indra/llmessage/llmail.h b/indra/llmessage/llmail.h deleted file mode 100644 index d67b89d1ea8..00000000000 --- a/indra/llmessage/llmail.h +++ /dev/null @@ -1,130 +0,0 @@ -/** - * @file llmail.h - * @brief smtp helper functions. - * - * $LicenseInfo:firstyear=2001&license=viewerlgpl$ - * Second Life Viewer Source Code - * Copyright (C) 2010, Linden Research, Inc. - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; - * version 2.1 of the License only. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA - * - * Linden Research, Inc., 945 Battery Street, San Francisco, CA 94111 USA - * $/LicenseInfo$ - */ - -#ifndef LL_LLMAIL_H -#define LL_LLMAIL_H - -typedef struct apr_pool_t apr_pool_t; - -#include "llsd.h" - -class LLMail -{ -public: - // if hostname is NULL, then the host is resolved as 'mail' - static void init(const std::string& hostname, apr_pool_t* pool); - - // Allow all email transmission to be disabled/enabled. - static void enable(bool mail_enabled); - - /** - * @brief send an email - * @param from_name The name of the email sender - * @param from_address The email address for the sender - * @param to_name The name of the email recipient - * @param to_address The email recipient address - * @param subject The subject of the email - * @param headers optional X-Foo headers in an llsd map. - * @return Returns true if the call succeeds, false otherwise. - * - * Results in: - * From: "from_name" - * To: "to_name" - * Subject: subject - * - * message - */ - static bool send( - const char* from_name, - const char* from_address, - const char* to_name, - const char* to_address, - const char* subject, - const char* message, - const LLSD& headers = LLSD()); - - /** - * @brief build the complete smtp transaction & header for use in an - * mail. - * - * @param from_name The name of the email sender - * @param from_address The email address for the sender - * @param to_name The name of the email recipient - * @param to_address The email recipient address - * @param subject The subject of the email - * @param headers optional X-Foo headers in an llsd map. - * @return Returns the complete SMTP transaction mail header. - */ - static std::string buildSMTPTransaction( - const char* from_name, - const char* from_address, - const char* to_name, - const char* to_address, - const char* subject, - const LLSD& headers = LLSD()); - - /** - * @brief send an email with header and body. - * - * @param header The email header. Use build_mail_header(). - * @param message The unescaped email message. - * @param from_address Used for debugging - * @param to_address Used for debugging - * @return Returns true if the message could be sent. - */ - static bool send( - const std::string& header, - const std::string& message, - const char* from_address, - const char* to_address); - - // IM-to-email sessions use a "session id" based on an encrypted - // combination of from agent_id, to agent_id, and timestamp. When - // a user replies to an email we use the from_id to determine the - // sender's name and the to_id to route the message. The address - // is encrypted to prevent users from building addresses to spoof - // IMs from other users. The timestamps allow the "sessions" to - // expire, in case one of the sessions is stolen/hijacked. - // - // indra/tools/mailglue is responsible for parsing the inbound mail. - // - // secret: binary blob passed to blowfish, max length 56 bytes - // secret_size: length of blob, in bytes - // - // Returns: "base64" encoded email local-part, with _ and - as the - // non-alphanumeric characters. This allows better compatibility - // with email systems than the default / and + extra chars. JC - static std::string encryptIMEmailAddress( - const LLUUID& from_agent_id, - const LLUUID& to_agent_id, - U32 time, - const U8* secret, - size_t secret_size); -}; - -extern const size_t LL_MAX_KNOWN_GOOD_MAIL_SIZE; - -#endif diff --git a/indra/llmessage/llpartdata.cpp b/indra/llmessage/llpartdata.cpp index d4cf95c1e38..b6266378625 100644 --- a/indra/llmessage/llpartdata.cpp +++ b/indra/llmessage/llpartdata.cpp @@ -331,7 +331,7 @@ bool LLPartSysData::isNullPS(const S32 block_num) S32 size; // Check size of block - size = gMessageSystem->getSize("ObjectData", block_num, "PSBlock"); + size = gMessageSystem->getSizeFast(_PREHASH_ObjectData, block_num, _PREHASH_PSBlock); if (!size) { @@ -344,7 +344,7 @@ bool LLPartSysData::isNullPS(const S32 block_num) return true; } - gMessageSystem->getBinaryData("ObjectData", "PSBlock", ps_data_block, size, block_num, PS_MAX_DATA_BLOCK_SIZE); + gMessageSystem->getBinaryDataFast(_PREHASH_ObjectData, _PREHASH_PSBlock, ps_data_block, size, block_num, PS_MAX_DATA_BLOCK_SIZE); LLDataPackerBinaryBuffer dp(ps_data_block, size); if (size > PS_LEGACY_DATA_BLOCK_SIZE) @@ -373,7 +373,7 @@ bool LLPartSysData::unpackBlock(const S32 block_num) U8 ps_data_block[PS_MAX_DATA_BLOCK_SIZE]; // Check size of block - S32 size = gMessageSystem->getSize("ObjectData", block_num, "PSBlock"); + S32 size = gMessageSystem->getSizeFast(_PREHASH_ObjectData, block_num, _PREHASH_PSBlock); if (size > PS_MAX_DATA_BLOCK_SIZE) { @@ -382,7 +382,7 @@ bool LLPartSysData::unpackBlock(const S32 block_num) } // Get from message - gMessageSystem->getBinaryData("ObjectData", "PSBlock", ps_data_block, size, block_num, PS_MAX_DATA_BLOCK_SIZE); + gMessageSystem->getBinaryDataFast(_PREHASH_ObjectData, _PREHASH_PSBlock, ps_data_block, size, block_num, PS_MAX_DATA_BLOCK_SIZE); LLDataPackerBinaryBuffer dp(ps_data_block, size); diff --git a/indra/llmessage/llstoredmessage.cpp b/indra/llmessage/llstoredmessage.cpp index 39696ea235e..ff8afde6576 100644 --- a/indra/llmessage/llstoredmessage.cpp +++ b/indra/llmessage/llstoredmessage.cpp @@ -24,6 +24,8 @@ * $/LicenseInfo$ */ +#include "linden_common.h" + #include "llstoredmessage.h" LLStoredMessage::LLStoredMessage(const std::string& name, const LLSD& message) : mMessage(message), mName(name) diff --git a/indra/llmessage/lltemplatemessagedispatcher.cpp b/indra/llmessage/lltemplatemessagedispatcher.cpp index edbeb4acc15..02e5b56c8d5 100644 --- a/indra/llmessage/lltemplatemessagedispatcher.cpp +++ b/indra/llmessage/lltemplatemessagedispatcher.cpp @@ -24,6 +24,7 @@ * $/LicenseInfo$ */ +#include "linden_common.h" #include "lltemplatemessagedispatcher.h" diff --git a/indra/llmessage/lltemplatemessagereader.cpp b/indra/llmessage/lltemplatemessagereader.cpp index b62288590e6..850d73e9109 100644 --- a/indra/llmessage/lltemplatemessagereader.cpp +++ b/indra/llmessage/lltemplatemessagereader.cpp @@ -118,6 +118,9 @@ void LLTemplateMessageReader::getData(const char *blockname, const char *varname { switch( vardata_size ) { + case 0: + // This is here to prevent a memcpy from a null value which is undefined behavior. + break; case 1: *((U8*)datap) = *((U8*)vardata.getData()); break; diff --git a/indra/llmessage/lltransfertargetfile.h b/indra/llmessage/lltransfertargetfile.h index 43189eb3881..cca0ea8d04b 100644 --- a/indra/llmessage/lltransfertargetfile.h +++ b/indra/llmessage/lltransfertargetfile.h @@ -37,8 +37,8 @@ class LLTransferTargetParamsFile : public LLTransferTargetParams LLTransferTargetParamsFile() : LLTransferTargetParams(LLTTT_FILE), - mCompleteCallback(NULL), - mUserData(NULL) + mCompleteCallback(nullptr), + mUserData(nullptr) {} void setFilename(const std::string& filename) { mFilename = filename; } void setCallback(LLTTFCompleteCallback cb, void *user_data) { mCompleteCallback = cb; mUserData = user_data; } diff --git a/indra/llmessage/lltransfertargetvfile.cpp b/indra/llmessage/lltransfertargetvfile.cpp index fcf853845bb..bbc2ddf4cc9 100644 --- a/indra/llmessage/lltransfertargetvfile.cpp +++ b/indra/llmessage/lltransfertargetvfile.cpp @@ -41,8 +41,8 @@ void LLTransferTargetVFile::updateQueue(bool shutdown) LLTransferTargetParamsVFile::LLTransferTargetParamsVFile() : LLTransferTargetParams(LLTTT_VFILE), mAssetType(LLAssetType::AT_NONE), - mCompleteCallback(NULL), - mRequestDatap(NULL), + mCompleteCallback(nullptr), + mRequestDatap(nullptr), mErrCode(0) { } diff --git a/indra/llmessage/message.cpp b/indra/llmessage/message.cpp index ad1ff86807a..e2937490bab 100644 --- a/indra/llmessage/message.cpp +++ b/indra/llmessage/message.cpp @@ -913,7 +913,7 @@ LLStoredMessagePtr LLMessageSystem::getReceivedMessage() const const std::string& name = mMessageReader->getMessageName(); LLSD message = wrapReceivedTemplateData(); - return LLStoredMessagePtr(new LLStoredMessage(name, message)); + return std::make_shared(name, message); } LLStoredMessagePtr LLMessageSystem::getBuiltMessage() const @@ -921,7 +921,7 @@ LLStoredMessagePtr LLMessageSystem::getBuiltMessage() const const std::string& name = mMessageBuilder->getMessageName(); LLSD message = wrapBuiltTemplateData(); - return LLStoredMessagePtr(new LLStoredMessage(name, message)); + return std::make_shared(name, message); } S32 LLMessageSystem::sendMessage(const LLHost &host, LLStoredMessagePtr message) @@ -1162,7 +1162,7 @@ S32 LLMessageSystem::sendMessage(const LLHost &host) { LLSD message = mLLSDMessageBuilder->getMessage(); - UntrustedCallback_t cb = NULL; + UntrustedCallback_t cb = nullptr; if ((mSendReliable) && (mReliablePacketParams.mCallback)) { cb = boost::bind(mReliablePacketParams.mCallback, mReliablePacketParams.mCallbackData, _1); @@ -1359,7 +1359,7 @@ S32 LLMessageSystem::sendMessage( return 0; } - UntrustedCallback_t cb = NULL; + UntrustedCallback_t cb = nullptr; if ((mSendReliable) && (mReliablePacketParams.mCallback)) { cb = boost::bind(mReliablePacketParams.mCallback, mReliablePacketParams.mCallbackData, _1); @@ -4028,9 +4028,9 @@ void LLMessageSystem::sendUntrustedSimulatorMessageCoro(std::string url, std::st { LLCore::HttpRequest::policy_t httpPolicy(LLCore::HttpRequest::DEFAULT_POLICY_ID); LLCoreHttpUtil::HttpCoroutineAdapter::ptr_t - httpAdapter(new LLCoreHttpUtil::HttpCoroutineAdapter("untrustedSimulatorMessage", httpPolicy)); - LLCore::HttpRequest::ptr_t httpRequest(new LLCore::HttpRequest); - LLCore::HttpOptions::ptr_t httpOpts = LLCore::HttpOptions::ptr_t(new LLCore::HttpOptions); + httpAdapter = std::make_shared("untrustedSimulatorMessage", httpPolicy); + LLCore::HttpRequest::ptr_t httpRequest = std::make_shared(); + LLCore::HttpOptions::ptr_t httpOpts = std::make_shared(); if (url.empty()) @@ -4049,8 +4049,10 @@ void LLMessageSystem::sendUntrustedSimulatorMessageCoro(std::string url, std::st LLSD httpResults = result[LLCoreHttpUtil::HttpCoroutineAdapter::HTTP_RESULTS]; LLCore::HttpStatus status = LLCoreHttpUtil::HttpCoroutineAdapter::getStatusFromLLSD(httpResults); - if ((callback) && (!callback.empty())) + if (callback != nullptr) + { callback((status) ? LL_ERR_NOERR : LL_ERR_TCP_TIMEOUT); + } } diff --git a/indra/llmessage/message.h b/indra/llmessage/message.h index 30945cac513..14cdc48a07d 100644 --- a/indra/llmessage/message.h +++ b/indra/llmessage/message.h @@ -28,6 +28,7 @@ #define LL_MESSAGE_H #include +#include #include #if LL_LINUX @@ -55,7 +56,6 @@ #include "llmessagesenderinterface.h" #include "llstoredmessage.h" -#include "boost/function.hpp" #include "llpounceable.h" #include "llcoros.h" #include LLCOROS_MUTEX_HEADER @@ -826,7 +826,7 @@ class LLMessageSystem : public LLMessageSenderInterface void receivedMessageFromTrustedSender(); private: - typedef boost::function UntrustedCallback_t; + typedef std::function UntrustedCallback_t; void sendUntrustedSimulatorMessageCoro(std::string url, std::string message, LLSD body, UntrustedCallback_t callback); diff --git a/indra/llmessage/message_prehash.cpp b/indra/llmessage/message_prehash.cpp index 21dbf35783a..f42cbfdac7a 100644 --- a/indra/llmessage/message_prehash.cpp +++ b/indra/llmessage/message_prehash.cpp @@ -714,6 +714,9 @@ char const* const _PREHASH_FirstName = LLMessageStringTable::getInstance()->getS char const* const _PREHASH_AttachedSoundGainChange = LLMessageStringTable::getInstance()->getString("AttachedSoundGainChange"); char const* const _PREHASH_LocationID = LLMessageStringTable::getInstance()->getString("LocationID"); char const* const _PREHASH_Running = LLMessageStringTable::getInstance()->getString("Running"); +char const* const _PREHASH_Mono = LLMessageStringTable::getInstance()->getString("Mono"); +char const* const _PREHASH_Luau = LLMessageStringTable::getInstance()->getString("Luau"); +char const* const _PREHASH_LuauLanguage = LLMessageStringTable::getInstance()->getString("LuauLanguage"); char const* const _PREHASH_AgentThrottle = LLMessageStringTable::getInstance()->getString("AgentThrottle"); char const* const _PREHASH_NeighborList = LLMessageStringTable::getInstance()->getString("NeighborList"); char const* const _PREHASH_PathTaperX = LLMessageStringTable::getInstance()->getString("PathTaperX"); diff --git a/indra/llmessage/message_prehash.h b/indra/llmessage/message_prehash.h index 8a2ad1587c8..53f8123b353 100644 --- a/indra/llmessage/message_prehash.h +++ b/indra/llmessage/message_prehash.h @@ -714,6 +714,9 @@ extern char const* const _PREHASH_FirstName; extern char const* const _PREHASH_AttachedSoundGainChange; extern char const* const _PREHASH_LocationID; extern char const* const _PREHASH_Running; +extern char const* const _PREHASH_Mono; +extern char const* const _PREHASH_Luau; +extern char const* const _PREHASH_LuauLanguage; extern char const* const _PREHASH_AgentThrottle; extern char const* const _PREHASH_NeighborList; extern char const* const _PREHASH_PathTaperX; diff --git a/indra/llmessage/tests/llareslistener_test.cpp b/indra/llmessage/tests/llareslistener_test.cpp deleted file mode 100644 index f4a9e501ec5..00000000000 --- a/indra/llmessage/tests/llareslistener_test.cpp +++ /dev/null @@ -1,193 +0,0 @@ -/** - * @file llareslistener_test.cpp - * @author Mark Palange - * @date 2009-02-26 - * @brief Tests of llareslistener.h. - * - * $LicenseInfo:firstyear=2009&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$ - */ - -#if LL_WINDOWS -#pragma warning (disable : 4355) // 'this' used in initializer list: yes, intentionally -#endif - -// Precompiled header -#include "linden_common.h" -// associated header -#include "../llareslistener.h" -// STL headers -#include -// std headers -// external library headers -#include - -// other Linden headers -#include "llsd.h" -#include "llares.h" -#include "../test/lltut.h" -#include "llevents.h" -#include "tests/wrapllerrs.h" - -/***************************************************************************** -* Dummy stuff -*****************************************************************************/ -LLAres::LLAres(): - // Simulate this much of the real LLAres constructor: we need an - // LLAresListener instance. - mListener(new LLAresListener("LLAres", this)) -{} -LLAres::~LLAres() {} -void LLAres::rewriteURI(const std::string &uri, - LLAres::UriRewriteResponder *resp) -{ - // This is the only LLAres method I chose to implement. - // The effect is that LLAres returns immediately with - // a result that is equal to the input uri. - std::vector result; - result.push_back(uri); - resp->rewriteResult(result); -} - -LLAres::QueryResponder::~QueryResponder() {} -void LLAres::QueryResponder::queryError(int) {} -void LLAres::QueryResponder::queryResult(char const*, size_t) {} -LLQueryResponder::LLQueryResponder() {} -void LLQueryResponder::queryResult(char const*, size_t) {} -void LLQueryResponder::querySuccess() {} -void LLAres::UriRewriteResponder::queryError(int) {} -void LLAres::UriRewriteResponder::querySuccess() {} -void LLAres::UriRewriteResponder::rewriteResult(const std::vector& uris) {} - -/***************************************************************************** -* TUT -*****************************************************************************/ -namespace tut -{ - struct data - { - LLAres dummyAres; - }; - typedef test_group llareslistener_group; - typedef llareslistener_group::object object; - llareslistener_group llareslistenergrp("llareslistener"); - - struct ResponseCallback - { - std::vector mURIs; - bool operator()(const LLSD& response) - { - mURIs.clear(); - for (LLSD::array_const_iterator ri(response.beginArray()), rend(response.endArray()); - ri != rend; ++ri) - { - mURIs.push_back(*ri); - } - return false; - } - }; - - template<> template<> - void object::test<1>() - { - set_test_name("test event"); - // Tests the success and failure cases, since they both use - // the same code paths in the LLAres responder. - ResponseCallback response; - std::string pumpname("trigger"); - // Since we're asking LLEventPumps to obtain() the pump by the desired - // name, it will persist beyond the current scope, so ensure we - // disconnect from it when 'response' goes away. - LLTempBoundListener temp( - LLEventPumps::instance().obtain(pumpname).listen("rewriteURIresponse", - boost::bind(&ResponseCallback::operator(), &response, _1))); - // Now build an LLSD request that will direct its response events to - // that pump. - const std::string testURI("login.bar.com"); - LLSD request; - request["op"] = "rewriteURI"; - request["uri"] = testURI; - request["reply"] = pumpname; - LLEventPumps::instance().obtain("LLAres").post(request); - ensure_equals(response.mURIs.size(), 1); - ensure_equals(response.mURIs.front(), testURI); - } - - template<> template<> - void object::test<2>() - { - set_test_name("bad op"); - WrapLLErrs capture; - LLSD request; - request["op"] = "foo"; - std::string threw = capture.catch_llerrs([&request](){ - LLEventPumps::instance().obtain("LLAres").post(request); - }); - ensure_contains("LLAresListener bad op", threw, "bad"); - } - - template<> template<> - void object::test<3>() - { - set_test_name("bad rewriteURI request"); - WrapLLErrs capture; - LLSD request; - request["op"] = "rewriteURI"; - std::string threw = capture.catch_llerrs([&request](){ - LLEventPumps::instance().obtain("LLAres").post(request); - }); - ensure_contains("LLAresListener bad req", threw, "missing"); - ensure_contains("LLAresListener bad req", threw, "reply"); - ensure_contains("LLAresListener bad req", threw, "uri"); - } - - template<> template<> - void object::test<4>() - { - set_test_name("bad rewriteURI request"); - WrapLLErrs capture; - LLSD request; - request["op"] = "rewriteURI"; - request["reply"] = "nonexistent"; - std::string threw = capture.catch_llerrs([&request](){ - LLEventPumps::instance().obtain("LLAres").post(request); - }); - ensure_contains("LLAresListener bad req", threw, "missing"); - ensure_contains("LLAresListener bad req", threw, "uri"); - ensure_does_not_contain("LLAresListener bad req", threw, "reply"); - } - - template<> template<> - void object::test<5>() - { - set_test_name("bad rewriteURI request"); - WrapLLErrs capture; - LLSD request; - request["op"] = "rewriteURI"; - request["uri"] = "foo.bar.com"; - std::string threw = capture.catch_llerrs([&request](){ - LLEventPumps::instance().obtain("LLAres").post(request); - }); - ensure_contains("LLAresListener bad req", threw, "missing"); - ensure_contains("LLAresListener bad req", threw, "reply"); - ensure_does_not_contain("LLAresListener bad req", threw, "uri"); - } -} diff --git a/indra/llmessage/tests/llcoproceduremanager_test.cpp b/indra/llmessage/tests/llcoproceduremanager_test.cpp index 4caae5f0829..0a77fd218b0 100644 --- a/indra/llmessage/tests/llcoproceduremanager_test.cpp +++ b/indra/llmessage/tests/llcoproceduremanager_test.cpp @@ -48,7 +48,7 @@ #pragma warning(disable: 4702) #endif -LLCoreHttpUtil::HttpCoroutineAdapter::HttpCoroutineAdapter(std::string const&, unsigned int) +LLCoreHttpUtil::HttpCoroutineAdapter::HttpCoroutineAdapter(std::string name, LLCore::HttpRequest::policy_t policyId) { } diff --git a/indra/llphysicsextensionsos/CMakeLists.txt b/indra/llphysicsextensionsos/CMakeLists.txt index c04115ef26b..ff1b703dc77 100644 --- a/indra/llphysicsextensionsos/CMakeLists.txt +++ b/indra/llphysicsextensionsos/CMakeLists.txt @@ -43,5 +43,9 @@ if(WINDOWS) target_compile_options(llphysicsextensionsos PRIVATE /bigobj) endif() +if (USE_PRECOMPILED_HEADERS) + target_precompile_headers(llphysicsextensionsos REUSE_FROM llprecompiled) +endif () + # Add tests diff --git a/indra/llplugin/CMakeLists.txt b/indra/llplugin/CMakeLists.txt index e008a4093ee..f67975365a4 100644 --- a/indra/llplugin/CMakeLists.txt +++ b/indra/llplugin/CMakeLists.txt @@ -36,5 +36,10 @@ list(APPEND llplugin_SOURCE_FILES ${llplugin_HEADER_FILES}) add_library (llplugin ${llplugin_SOURCE_FILES}) target_include_directories( llplugin INTERFACE ${CMAKE_CURRENT_SOURCE_DIR}) target_link_libraries( llplugin llcommon llmath llmessage llxml ) + +if (USE_PRECOMPILED_HEADERS) + target_precompile_headers(llplugin REUSE_FROM llprecompiled) +endif () + add_subdirectory(slplugin) diff --git a/indra/llplugin/llpluginclassmedia.cpp b/indra/llplugin/llpluginclassmedia.cpp index 77a4b08af55..803574f9fa1 100644 --- a/indra/llplugin/llpluginclassmedia.cpp +++ b/indra/llplugin/llpluginclassmedia.cpp @@ -34,7 +34,7 @@ #include "llcontrol.h" extern LLControlGroup gSavedSettings; -#if LL_DARWIN +#if LL_DARWIN || LL_LINUX extern bool gHiDPISupport; #endif @@ -372,7 +372,7 @@ void LLPluginClassMedia::setSizeInternal(void) mRequestedMediaHeight = nextPowerOf2(mRequestedMediaHeight); } -#if LL_DARWIN +#if LL_DARWIN || LL_LINUX if (!gHiDPISupport) #endif { @@ -1015,6 +1015,15 @@ void LLPluginClassMedia::enableMediaPluginDebugging( bool enable ) sendMessage( message ); } +#if LL_LINUX +void LLPluginClassMedia::enablePipeWireVolumeCatcher( bool enable ) +{ + LLPluginMessage message(LLPLUGIN_MESSAGE_CLASS_MEDIA, "enable_pipewire_volume_catcher"); + message.setValueBoolean( "enable", enable ); + sendMessage( message ); +} +#endif + void LLPluginClassMedia::setTarget(const std::string &target) { mTarget = target; diff --git a/indra/llplugin/llpluginclassmedia.h b/indra/llplugin/llpluginclassmedia.h index 71522bcd7d5..bfede4e9c1d 100644 --- a/indra/llplugin/llpluginclassmedia.h +++ b/indra/llplugin/llpluginclassmedia.h @@ -134,6 +134,10 @@ class LLPluginClassMedia : public LLPluginProcessParentOwner // Text may be unicode (utf8 encoded) bool textInput(const std::string &text, MASK modifiers, LLSD native_key_data); +#if LL_LINUX + void enablePipeWireVolumeCatcher( bool enable ); +#endif + static std::string sOIDcookieUrl; static std::string sOIDcookieName; static std::string sOIDcookieValue; diff --git a/indra/llplugin/llpluginprocessparent.h b/indra/llplugin/llpluginprocessparent.h index 334f1411afb..ea604ca8d7d 100644 --- a/indra/llplugin/llpluginprocessparent.h +++ b/indra/llplugin/llpluginprocessparent.h @@ -30,7 +30,6 @@ #define LL_LLPLUGINPROCESSPARENT_H #include -#include #include "llapr.h" #include "llprocess.h" diff --git a/indra/llplugin/slplugin/CMakeLists.txt b/indra/llplugin/slplugin/CMakeLists.txt index 4df3e306cbf..f746160ada1 100644 --- a/indra/llplugin/slplugin/CMakeLists.txt +++ b/indra/llplugin/slplugin/CMakeLists.txt @@ -18,6 +18,12 @@ if (DARWIN) list(APPEND SLPlugin_HEADER_FILES slplugin-objc.h ) + + set_source_files_properties( + slplugin-objc.mm + PROPERTIES + SKIP_PRECOMPILE_HEADERS TRUE + ) endif (DARWIN) if (SLPlugin_HEADER_FILES) @@ -37,6 +43,10 @@ target_link_libraries(SLPlugin ll::pluginlibraries ) +if (USE_PRECOMPILED_HEADERS) + target_precompile_headers(SLPlugin REUSE_FROM llprecompiled) +endif () + if (WINDOWS) set_target_properties(SLPlugin PROPERTIES diff --git a/indra/llprecompiled/CMakeLists.txt b/indra/llprecompiled/CMakeLists.txt new file mode 100644 index 00000000000..ea230f4a982 --- /dev/null +++ b/indra/llprecompiled/CMakeLists.txt @@ -0,0 +1,53 @@ +# -*- cmake -*- + +project(llprecompiled) + +include(00-Common) +include(APR) +include(bugsplat) +include(Linking) +include(Boost) +include(LLSharedLibs) +include(ZLIBNG) +include(Tracy) +include(EXPAT) +include(SSE2NEON) + +set(llprecompiled_SOURCE_FILES + cmake_dummy.cpp + ) + +add_library (llprecompiled ${llprecompiled_SOURCE_FILES}) + +target_include_directories(llprecompiled PRIVATE + ${CMAKE_SOURCE_DIR}/${LIBS_OPEN_PREFIX}llmath + ) + +target_link_libraries(llprecompiled + llcommon + ll::apr + ll::expat + ll::zlib-ng + ll::boost + ll::oslibraries + ll::tracy + ll::sse2neon + ) + +target_precompile_headers(llprecompiled PRIVATE + [["linden_common.h"]] + [["llwin32headers.h"]] + [["llprofiler.h"]] + [["llmath.h"]] + + + + + + + + + + + + ) diff --git a/indra/newview/llappviewerlinux_api_dbus.h b/indra/llprecompiled/cmake_dummy.cpp similarity index 66% rename from indra/newview/llappviewerlinux_api_dbus.h rename to indra/llprecompiled/cmake_dummy.cpp index 2f4492bd7ae..21a47a9b145 100644 --- a/indra/newview/llappviewerlinux_api_dbus.h +++ b/indra/llprecompiled/cmake_dummy.cpp @@ -1,6 +1,5 @@ /** - * @file llappviewerlinux_api_dbus.h - * @brief DBus-glib symbol handling + * @file cmake_dummy.cpp * * $LicenseInfo:firstyear=2008&license=viewerlgpl$ * Second Life Viewer Source Code @@ -23,22 +22,3 @@ * Linden Research, Inc., 945 Battery Street, San Francisco, CA 94111 USA * $/LicenseInfo$ */ - -#include "linden_common.h" - -#if LL_DBUS_ENABLED - -extern "C" { -#include -} - -#define DBUSGLIB_DYLIB_DEFAULT_NAME "libdbus-glib-1.so.2" - -bool grab_dbus_syms(std::string dbus_dso_name); -void ungrab_dbus_syms(); - -#define LL_DBUS_SYM(REQUIRED, DBUSSYM, RTN, ...) extern RTN (*ll##DBUSSYM)(__VA_ARGS__) -#include "llappviewerlinux_api_dbus_syms_raw.inc" -#undef LL_DBUS_SYM - -#endif // LL_DBUS_ENABLED diff --git a/indra/llprimitive/CMakeLists.txt b/indra/llprimitive/CMakeLists.txt index ff0cad58d63..f05be03034f 100644 --- a/indra/llprimitive/CMakeLists.txt +++ b/indra/llprimitive/CMakeLists.txt @@ -79,6 +79,10 @@ else() ) endif () +if (USE_PRECOMPILED_HEADERS) + target_precompile_headers(llprimitive REUSE_FROM llprecompiled) +endif () + #add unit tests if (LL_TESTS) INCLUDE(LLAddBuildTest) diff --git a/indra/llprimitive/lldaeloader.cpp b/indra/llprimitive/lldaeloader.cpp index 81ebe631c5a..71fc2b4fc08 100644 --- a/indra/llprimitive/lldaeloader.cpp +++ b/indra/llprimitive/lldaeloader.cpp @@ -1078,7 +1078,7 @@ bool LLDAELoader::OpenFile(const std::string& filename) LLModel* mdl = *i; if(mdl->getStatus() != LLModel::NO_ERRORS) { - setLoadState(ERROR_MODEL + mdl->getStatus()) ; + setLoadState(static_cast(ERROR_MODEL) + static_cast(mdl->getStatus())); return false; //abort } diff --git a/indra/llprimitive/llmaterialid.cpp b/indra/llprimitive/llmaterialid.cpp index 4992b282f36..b417f095ca5 100644 --- a/indra/llprimitive/llmaterialid.cpp +++ b/indra/llprimitive/llmaterialid.cpp @@ -56,20 +56,11 @@ LLMaterialID::LLMaterialID(const void* pMemory) set(pMemory); } -LLMaterialID::LLMaterialID(const LLMaterialID& pOtherMaterialID) -{ - copyFromOtherMaterialID(pOtherMaterialID); -} - LLMaterialID::LLMaterialID(const LLUUID& lluid) { set(lluid.mData); } -LLMaterialID::~LLMaterialID() -{ -} - bool LLMaterialID::operator == (const LLMaterialID& pOtherMaterialID) const { return (compareToOtherMaterialID(pOtherMaterialID) == 0); @@ -100,12 +91,6 @@ bool LLMaterialID::operator >= (const LLMaterialID& pOtherMaterialID) const return (compareToOtherMaterialID(pOtherMaterialID) >= 0); } -LLMaterialID& LLMaterialID::operator = (const LLMaterialID& pOtherMaterialID) -{ - copyFromOtherMaterialID(pOtherMaterialID); - return (*this); -} - bool LLMaterialID::isNull() const { return (compareToOtherMaterialID(LLMaterialID::null) == 0); @@ -168,18 +153,12 @@ std::ostream& operator<<(std::ostream& s, const LLMaterialID &material_id) return s; } - void LLMaterialID::parseFromBinary (const LLSD::Binary& pMaterialID) { llassert(pMaterialID.size() == (MATERIAL_ID_SIZE * sizeof(U8))); memcpy(mID, &pMaterialID[0], MATERIAL_ID_SIZE * sizeof(U8)); } -void LLMaterialID::copyFromOtherMaterialID(const LLMaterialID& pOtherMaterialID) -{ - memcpy(mID, pOtherMaterialID.get(), MATERIAL_ID_SIZE * sizeof(U8)); -} - int LLMaterialID::compareToOtherMaterialID(const LLMaterialID& pOtherMaterialID) const { int retVal = 0; diff --git a/indra/llprimitive/llmaterialid.h b/indra/llprimitive/llmaterialid.h index bd6256d9619..cec09654412 100644 --- a/indra/llprimitive/llmaterialid.h +++ b/indra/llprimitive/llmaterialid.h @@ -39,9 +39,7 @@ class LLMaterialID LLMaterialID(const LLSD& pMaterialID); LLMaterialID(const LLSD::Binary& pMaterialID); LLMaterialID(const void* pMemory); - LLMaterialID(const LLMaterialID& pOtherMaterialID); LLMaterialID(const LLUUID& lluid); - ~LLMaterialID(); bool operator == (const LLMaterialID& pOtherMaterialID) const; bool operator != (const LLMaterialID& pOtherMaterialID) const; @@ -51,8 +49,6 @@ class LLMaterialID bool operator > (const LLMaterialID& pOtherMaterialID) const; bool operator >= (const LLMaterialID& pOtherMaterialID) const; - LLMaterialID& operator = (const LLMaterialID& pOtherMaterialID); - bool isNull() const; const U8* get() const; @@ -77,7 +73,6 @@ class LLMaterialID private: void parseFromBinary(const LLSD::Binary& pMaterialID); - void copyFromOtherMaterialID(const LLMaterialID& pOtherMaterialID); int compareToOtherMaterialID(const LLMaterialID& pOtherMaterialID) const; U8 mID[MATERIAL_ID_SIZE]; diff --git a/indra/llprimitive/llmediaentry.cpp b/indra/llprimitive/llmediaentry.cpp index b5b17c53aac..48c6ba1fa5d 100644 --- a/indra/llprimitive/llmediaentry.cpp +++ b/indra/llprimitive/llmediaentry.cpp @@ -74,7 +74,7 @@ const char* LLMediaEntry::WHITELIST_KEY = MEDIA_WHITELIST_KEY_STR; const char* LLMediaEntry::PERMS_INTERACT_KEY = MEDIA_PERMS_INTERACT_KEY_STR; const char* LLMediaEntry::PERMS_CONTROL_KEY = MEDIA_PERMS_CONTROL_KEY_STR; -#define DEFAULT_URL_PREFIX "http://" +#define DEFAULT_URL_PREFIX "https://" // Constructor(s) LLMediaEntry::LLMediaEntry() : diff --git a/indra/llprimitive/llmodel.h b/indra/llprimitive/llmodel.h index ac88af18f02..d624b6dc7ad 100644 --- a/indra/llprimitive/llmodel.h +++ b/indra/llprimitive/llmodel.h @@ -33,15 +33,12 @@ #include "m4math.h" #include -#include - class daeElement; class domMesh; #define MAX_MODEL_FACES 8 -LL_ALIGN_PREFIX(16) -class LLMeshSkinInfo : public LLRefCount +class alignas(16) LLMeshSkinInfo : public LLRefCount { LL_ALIGN_NEW public: @@ -65,17 +62,16 @@ class LLMeshSkinInfo : public LLRefCount // cached multiply of mBindShapeMatrix and mInvBindMatrix matrix_list_t mBindPoseMatrix; - LL_ALIGN_16(LLMatrix4a mBindShapeMatrix); + LLMatrix4a mBindShapeMatrix; float mPelvisOffset; bool mLockScaleIfJointPosition; bool mInvalidJointsScrubbed; bool mJointNumsInitialized; U64 mHash = 0; -} LL_ALIGN_POSTFIX(16); +}; -LL_ALIGN_PREFIX(16) -class LLModel : public LLVolume +class alignas(16) LLModel : public LLVolume { LL_ALIGN_NEW public: @@ -323,7 +319,7 @@ class LLModel : public LLVolume // A model/object can only have 8 faces, spillover faces will // be moved to new model/object and assigned a submodel id. int mSubmodelID; -} LL_ALIGN_POSTFIX(16); +}; typedef std::vector > model_list; typedef std::queue > model_queue; diff --git a/indra/llprimitive/llmodelloader.cpp b/indra/llprimitive/llmodelloader.cpp index 0383659f624..bce5f6adce7 100644 --- a/indra/llprimitive/llmodelloader.cpp +++ b/indra/llprimitive/llmodelloader.cpp @@ -24,6 +24,8 @@ * $/LicenseInfo$ */ +#include "linden_common.h" + #include "llmodelloader.h" #include "llapp.h" diff --git a/indra/llprimitive/llmodelloader.h b/indra/llprimitive/llmodelloader.h index 335d809386b..8acc75b1bef 100644 --- a/indra/llprimitive/llmodelloader.h +++ b/indra/llprimitive/llmodelloader.h @@ -29,7 +29,7 @@ #include "llmodel.h" #include "llthread.h" -#include +#include #include class LLJoint; @@ -57,25 +57,25 @@ class LLModelLoader : public LLThread // Callback with loaded model data and loaded LoD // - typedef boost::function load_callback_t; + typedef std::function load_callback_t; // Function to provide joint lookup by name // (within preview avi skeleton, for example) // - typedef boost::function joint_lookup_func_t; + typedef std::function joint_lookup_func_t; // Func to load and associate material with all it's textures, // returned value is the number of textures loaded // intentionally non-const so func can modify material to // store platform-specific data // - typedef boost::function texture_load_func_t; + typedef std::function texture_load_func_t; // Callback to inform client of state changes // during loading process (errors will be reported // as state changes here as well) // - typedef boost::function state_callback_t; + typedef std::function state_callback_t; typedef enum { diff --git a/indra/llprimitive/llprimtexturelist.cpp b/indra/llprimitive/llprimtexturelist.cpp index 68f3f5ffacb..c70a8f6483f 100644 --- a/indra/llprimitive/llprimtexturelist.cpp +++ b/indra/llprimitive/llprimtexturelist.cpp @@ -137,7 +137,7 @@ S32 LLPrimTextureList::copyTexture(const U8 index, const LLTextureEntry& te) // we're changing an existing entry llassert(mEntryList[index]); delete (mEntryList[index]); - if (&te) + if (te != LLTextureEntry::null) { mEntryList[index] = te.newCopy(); } diff --git a/indra/llprimitive/tests/llprimitive_test.cpp b/indra/llprimitive/tests/llprimitive_test.cpp index 0213a3e8b67..75c3613eceb 100644 --- a/indra/llprimitive/tests/llprimitive_test.cpp +++ b/indra/llprimitive/tests/llprimitive_test.cpp @@ -71,9 +71,7 @@ class DummyVolumeMgr : public LLVolumeMgr S32 mCurrDetailTest; }; -LLMaterialID::LLMaterialID() {} -LLMaterialID::LLMaterialID(LLMaterialID const &m) = default; -LLMaterialID::~LLMaterialID() {} +LLMaterialID::LLMaterialID() = default; void LLMaterialID::set(void const*) { } U8 const * LLMaterialID::get() const { return mID; } diff --git a/indra/llrender/CMakeLists.txt b/indra/llrender/CMakeLists.txt index ccff7c7a8c0..82ffa5dde46 100644 --- a/indra/llrender/CMakeLists.txt +++ b/indra/llrender/CMakeLists.txt @@ -10,7 +10,6 @@ include(LLImage) include(LLWindow) set(llrender_SOURCE_FILES - llatmosphere.cpp llcubemap.cpp llcubemaparray.cpp llfontbitmapcache.cpp @@ -23,7 +22,6 @@ set(llrender_SOURCE_FILES llglslshader.cpp llgltexture.cpp llimagegl.cpp - llpostprocess.cpp llrender.cpp llrender2dutils.cpp llrendernavprim.cpp @@ -40,7 +38,6 @@ set(llrender_SOURCE_FILES set(llrender_HEADER_FILES CMakeLists.txt - llatmosphere.h llcubemap.h llcubemaparray.h llfontgl.h @@ -56,7 +53,6 @@ set(llrender_HEADER_FILES llgltexture.h llgltypes.h llimagegl.h - llpostprocess.h llrender.h llrender2dutils.h llrendernavprim.h @@ -76,23 +72,26 @@ if (BUILD_HEADLESS) add_library (llrenderheadless ${llrender_SOURCE_FILES} ) - - set_property(TARGET llrenderheadless - PROPERTY COMPILE_DEFINITIONS LL_MESA=1 LL_MESA_HEADLESS=1 - ) + target_include_directories(llrenderheadless INTERFACE ${CMAKE_CURRENT_SOURCE_DIR}) target_link_libraries(llrenderheadless llcommon llimage llmath - llrender llxml llfilesystem + llwindowheadless + ll::freetype + OpenGL::GL ) + + if (USE_PRECOMPILED_HEADERS) + target_precompile_headers(llrenderheadless REUSE_FROM llprecompiled) + endif() endif (BUILD_HEADLESS) add_library (llrender ${llrender_SOURCE_FILES}) -target_include_directories( llrender INTERFACE ${CMAKE_CURRENT_SOURCE_DIR}) +target_include_directories(llrender INTERFACE ${CMAKE_CURRENT_SOURCE_DIR}) # Libraries on which this library depends, needed for Linux builds # Sort by high-level to low-level @@ -104,7 +103,15 @@ target_link_libraries(llrender llxml llwindow ll::freetype + ) + +if (NOT USE_SDL_WINDOW) +target_link_libraries(llrender OpenGL::GL - OpenGL::GLU ) +endif() + +if (USE_PRECOMPILED_HEADERS) + target_precompile_headers(llrender REUSE_FROM llprecompiled) +endif () diff --git a/indra/llrender/llatmosphere.cpp b/indra/llrender/llatmosphere.cpp deleted file mode 100644 index eae5623a3cf..00000000000 --- a/indra/llrender/llatmosphere.cpp +++ /dev/null @@ -1,290 +0,0 @@ -/** - * @file llatmosphere.cpp - * @brief LLAtmosphere integration impl - * - * $LicenseInfo:firstyear=2018&license=viewerlgpl$ - * Second Life Viewer Source Code - * Copyright (C) 2018, 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 "linden_common.h" - -#include "llatmosphere.h" -#include "llfasttimer.h" -#include "llsys.h" -#include "llglheaders.h" -#include "llrender.h" -#include "llshadermgr.h" -#include "llglslshader.h" - -LLAtmosphere* gAtmosphere = nullptr; - -// Values from "Reference Solar Spectral Irradiance: ASTM G-173", ETR column -// (see http://rredc.nrel.gov/solar/spectra/am1.5/ASTMG173/ASTMG173.html), -// summed and averaged in each bin (e.g. the value for 360nm is the average -// of the ASTM G-173 values for all wavelengths between 360 and 370nm). -// Values in W.m^-2. -const int kLambdaMin = 360; -const int kLambdaMax = 830; -const double kSolarIrradiance[48] = { - 1.11776, 1.14259, 1.01249, 1.14716, 1.72765, 1.73054, 1.6887, 1.61253, - 1.91198, 2.03474, 2.02042, 2.02212, 1.93377, 1.95809, 1.91686, 1.8298, - 1.8685, 1.8931, 1.85149, 1.8504, 1.8341, 1.8345, 1.8147, 1.78158, 1.7533, - 1.6965, 1.68194, 1.64654, 1.6048, 1.52143, 1.55622, 1.5113, 1.474, 1.4482, - 1.41018, 1.36775, 1.34188, 1.31429, 1.28303, 1.26758, 1.2367, 1.2082, - 1.18737, 1.14683, 1.12362, 1.1058, 1.07124, 1.04992 -}; - -// Values from http://www.iup.uni-bremen.de/gruppen/molspec/databases/ -// referencespectra/o3spectra2011/index.html for 233K, summed and averaged in -// each bin (e.g. the value for 360nm is the average of the original values -// for all wavelengths between 360 and 370nm). Values in m^2. -const double kOzoneCrossSection[48] = { - 1.18e-27, 2.182e-28, 2.818e-28, 6.636e-28, 1.527e-27, 2.763e-27, 5.52e-27, - 8.451e-27, 1.582e-26, 2.316e-26, 3.669e-26, 4.924e-26, 7.752e-26, 9.016e-26, - 1.48e-25, 1.602e-25, 2.139e-25, 2.755e-25, 3.091e-25, 3.5e-25, 4.266e-25, - 4.672e-25, 4.398e-25, 4.701e-25, 5.019e-25, 4.305e-25, 3.74e-25, 3.215e-25, - 2.662e-25, 2.238e-25, 1.852e-25, 1.473e-25, 1.209e-25, 9.423e-26, 7.455e-26, - 6.566e-26, 5.105e-26, 4.15e-26, 4.228e-26, 3.237e-26, 2.451e-26, 2.801e-26, - 2.534e-26, 1.624e-26, 1.465e-26, 2.078e-26, 1.383e-26, 7.105e-27 -}; - -// From https://en.wikipedia.org/wiki/Dobson_unit, in molecules.m^-2. -const double kDobsonUnit = 2.687e20; -// Maximum number density of ozone molecules, in m^-3 (computed so at to get -// 300 Dobson units of ozone - for this we divide 300 DU by the integral of -// the ozone density profile defined below, which is equal to 15km). -const double kMaxOzoneNumberDensity = 300.0 * kDobsonUnit / 15000.0; -const double kRayleigh = 1.24062e-6; -const double kRayleighScaleHeight = 8000.0; -const double kMieScaleHeight = 1200.0; -const double kMieAngstromAlpha = 0.0; -const double kMieAngstromBeta = 5.328e-3; -const double kMieSingleScatteringAlbedo = 0.9; -const double kGroundAlbedo = 0.1; - -AtmosphericModelSettings::AtmosphericModelSettings() - : m_skyBottomRadius(6360.0f) - , m_skyTopRadius(6420.0f) - , m_sunArcRadians(0.00045f) - , m_mieAnisotropy(0.8f) -{ - DensityLayer rayleigh_density(0.0, 1.0, -1.0 / kRayleighScaleHeight, 0.0, 0.0); - DensityLayer mie_density(0.0, 1.0, -1.0 / kMieScaleHeight, 0.0, 0.0); - - m_rayleighProfile.push_back(rayleigh_density); - m_mieProfile.push_back(mie_density); - - // Density profile increasing linearly from 0 to 1 between 10 and 25km, and - // decreasing linearly from 1 to 0 between 25 and 40km. This is an approximate - // profile from http://www.kln.ac.lk/science/Chemistry/Teaching_Resources/ - // Documents/Introduction%20to%20atmospheric%20chemistry.pdf (page 10). - m_absorptionProfile.push_back(DensityLayer(25000.0, 0.0, 0.0, 1.0 / 15000.0, -2.0 / 3.0)); - m_absorptionProfile.push_back(DensityLayer(0.0, 0.0, 0.0, -1.0 / 15000.0, 8.0 / 3.0)); -} - -AtmosphericModelSettings::AtmosphericModelSettings( - DensityProfile& rayleighProfile, - DensityProfile& mieProfile, - DensityProfile& absorptionProfile) -: m_skyBottomRadius(6360.0f) -, m_skyTopRadius(6420.0f) -, m_rayleighProfile(rayleighProfile) -, m_mieProfile(mieProfile) -, m_absorptionProfile(absorptionProfile) -, m_sunArcRadians(0.00045f) -, m_mieAnisotropy(0.8f) -{ -} - -AtmosphericModelSettings::AtmosphericModelSettings( - F32 skyBottomRadius, - F32 skyTopRadius, - DensityProfile& rayleighProfile, - DensityProfile& mieProfile, - DensityProfile& absorptionProfile, - F32 sunArcRadians, - F32 mieAniso) -: m_skyBottomRadius(skyBottomRadius) -, m_skyTopRadius(skyTopRadius) -, m_rayleighProfile(rayleighProfile) -, m_mieProfile(mieProfile) -, m_absorptionProfile(absorptionProfile) -, m_sunArcRadians(sunArcRadians) -, m_mieAnisotropy(mieAniso) -{ -} - -bool AtmosphericModelSettings::operator==(const AtmosphericModelSettings& rhs) const -{ - if (m_skyBottomRadius != rhs.m_skyBottomRadius) - { - return false; - } - - if (m_skyTopRadius != rhs.m_skyTopRadius) - { - return false; - } - - if (m_sunArcRadians != rhs.m_sunArcRadians) - { - return false; - } - - if (m_mieAnisotropy != rhs.m_mieAnisotropy) - { - return false; - } - - if (m_rayleighProfile != rhs.m_rayleighProfile) - { - return false; - } - - if (m_mieProfile != rhs.m_mieProfile) - { - return false; - } - - if (m_absorptionProfile != rhs.m_absorptionProfile) - { - return false; - } - - return true; -} - -void LLAtmosphere::initClass() -{ - if (!gAtmosphere) - { - gAtmosphere = new LLAtmosphere; - } -} - -void LLAtmosphere::cleanupClass() -{ - if(gAtmosphere) - { - delete gAtmosphere; - } - gAtmosphere = NULL; -} - -LLAtmosphere::LLAtmosphere() -{ - for (int l = kLambdaMin; l <= kLambdaMax; l += 10) - { - double lambda = static_cast(l) * 1e-3; // micro-meters - double mie = kMieAngstromBeta / kMieScaleHeight * pow(lambda, -kMieAngstromAlpha); - m_wavelengths.push_back(l); - m_solar_irradiance.push_back(kSolarIrradiance[(l - kLambdaMin) / 10]); - m_rayleigh_scattering.push_back(kRayleigh * pow(lambda, -4)); - m_mie_scattering.push_back(mie * kMieSingleScatteringAlbedo); - m_mie_extinction.push_back(mie); - m_absorption_extinction.push_back(kMaxOzoneNumberDensity * kOzoneCrossSection[(l - kLambdaMin) / 10]); - m_ground_albedo.push_back(kGroundAlbedo); - } - - AtmosphericModelSettings defaults; - configureAtmosphericModel(defaults); -} - -LLAtmosphere::~LLAtmosphere() -{ - // Cease referencing textures from atmosphere::model from our LLGLTextures wrappers for same. - if (m_transmittance) - { - m_transmittance->setTexName(0); - } - - if (m_scattering) - { - m_scattering->setTexName(0); - } - - if (m_mie_scatter_texture) - { - m_mie_scatter_texture->setTexName(0); - } -} - -bool LLAtmosphere::configureAtmosphericModel(AtmosphericModelSettings& settings) -{ - // TBD - return true; -} - -LLGLTexture* LLAtmosphere::getTransmittance() -{ - if (!m_transmittance) - { - m_transmittance = new LLGLTexture; - m_transmittance->generateGLTexture(); - m_transmittance->setAddressMode(LLTexUnit::eTextureAddressMode::TAM_CLAMP); - m_transmittance->setFilteringOption(LLTexUnit::eTextureFilterOptions::TFO_BILINEAR); - m_transmittance->setExplicitFormat(GL_RGB32F, GL_RGB, GL_FLOAT); - m_transmittance->setTarget(GL_TEXTURE_2D, LLTexUnit::TT_TEXTURE); - } - return m_transmittance; -} - -LLGLTexture* LLAtmosphere::getScattering() -{ - if (!m_scattering) - { - m_scattering = new LLGLTexture; - m_scattering->generateGLTexture(); - m_scattering->setAddressMode(LLTexUnit::eTextureAddressMode::TAM_CLAMP); - m_scattering->setFilteringOption(LLTexUnit::eTextureFilterOptions::TFO_BILINEAR); - m_scattering->setExplicitFormat(GL_RGB16F, GL_RGB, GL_FLOAT); - m_scattering->setTarget(GL_TEXTURE_3D, LLTexUnit::TT_TEXTURE_3D); - } - return m_scattering; -} - -LLGLTexture* LLAtmosphere::getMieScattering() -{ - if (!m_mie_scatter_texture) - { - m_mie_scatter_texture = new LLGLTexture; - m_mie_scatter_texture->generateGLTexture(); - m_mie_scatter_texture->setAddressMode(LLTexUnit::eTextureAddressMode::TAM_CLAMP); - m_mie_scatter_texture->setFilteringOption(LLTexUnit::eTextureFilterOptions::TFO_BILINEAR); - m_mie_scatter_texture->setExplicitFormat(GL_RGB16F, GL_RGB, GL_FLOAT); - m_mie_scatter_texture->setTarget(GL_TEXTURE_3D, LLTexUnit::TT_TEXTURE_3D); - } - return m_mie_scatter_texture; -} - -LLGLTexture* LLAtmosphere::getIlluminance() -{ - if (!m_illuminance) - { - m_illuminance = new LLGLTexture; - m_illuminance->generateGLTexture(); - m_illuminance->setAddressMode(LLTexUnit::eTextureAddressMode::TAM_CLAMP); - m_illuminance->setFilteringOption(LLTexUnit::eTextureFilterOptions::TFO_BILINEAR); - m_illuminance->setExplicitFormat(GL_RGB32F, GL_RGB, GL_FLOAT); - m_illuminance->setTarget(GL_TEXTURE_2D, LLTexUnit::TT_TEXTURE); - } - return m_illuminance; -} diff --git a/indra/llrender/llatmosphere.h b/indra/llrender/llatmosphere.h deleted file mode 100644 index 4b8c7d08198..00000000000 --- a/indra/llrender/llatmosphere.h +++ /dev/null @@ -1,173 +0,0 @@ -/** - * @file llatmosphere.h - * @brief LLAtmosphere class - * - * $LicenseInfo:firstyear=2018&license=viewerlgpl$ - * Second Life Viewer Source Code - * Copyright (C) 2018, Linden Research, Inc. - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; - * version 2.1 of the License only. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA - * - * Linden Research, Inc., 945 Battery Street, San Francisco, CA 94111 USA - * $/LicenseInfo$ - */ - -#ifndef LL_ATMOSPHERE_H -#define LL_ATMOSPHERE_H - -#include "llglheaders.h" -#include "llgltexture.h" - -// An atmosphere layer of width 'width' (in m), and whose density is defined as -// 'exp_term' * exp('exp_scale' * h) + 'linear_term' * h + 'constant_term', -// clamped to [0,1], and where h is the altitude (in m). 'exp_term' and -// 'constant_term' are unitless, while 'exp_scale' and 'linear_term' are in -// m^-1. -class DensityLayer { - public: - DensityLayer() - : width(0.0f) - , exp_term(0.0f) - , exp_scale(0.0f) - , linear_term(0.0f) - , constant_term(0.0f) - { - } - - DensityLayer(float width, float exp_term, float exp_scale, float linear_term, float constant_term) - : width(width) - , exp_term(exp_term) - , exp_scale(exp_scale) - , linear_term(linear_term) - , constant_term(constant_term) - { - } - - bool operator==(const DensityLayer& rhs) const - { - if (width != rhs.width) - { - return false; - } - - if (exp_term != rhs.exp_term) - { - return false; - } - - if (exp_scale != rhs.exp_scale) - { - return false; - } - - if (linear_term != rhs.linear_term) - { - return false; - } - - if (constant_term != rhs.constant_term) - { - return false; - } - - return true; - } - - float width = 1024.0f; - float exp_term = 1.0f; - float exp_scale = 1.0f; - float linear_term = 1.0f; - float constant_term = 0.0f; -}; - -typedef std::vector DensityProfile; - -class AtmosphericModelSettings -{ -public: - AtmosphericModelSettings(); - - AtmosphericModelSettings( - DensityProfile& rayleighProfile, - DensityProfile& mieProfile, - DensityProfile& absorptionProfile); - - AtmosphericModelSettings( - F32 skyBottomRadius, - F32 skyTopRadius, - DensityProfile& rayleighProfile, - DensityProfile& mieProfile, - DensityProfile& absorptionProfile, - F32 sunArcRadians, - F32 mieAniso); - - bool operator==(const AtmosphericModelSettings& rhs) const; - - F32 m_skyBottomRadius; - F32 m_skyTopRadius; - DensityProfile m_rayleighProfile; - DensityProfile m_mieProfile; - DensityProfile m_absorptionProfile; - F32 m_sunArcRadians; - F32 m_mieAnisotropy; -}; - -class LLAtmosphere -{ -public: - LLAtmosphere(); - ~LLAtmosphere(); - - static void initClass(); - static void cleanupClass(); - - const LLAtmosphere& operator=(const LLAtmosphere& rhs) - { - LL_ERRS() << "Illegal operation!" << LL_ENDL; - return *this; - } - - LLGLTexture* getTransmittance(); - LLGLTexture* getScattering(); - LLGLTexture* getMieScattering(); - LLGLTexture* getIlluminance(); - - bool configureAtmosphericModel(AtmosphericModelSettings& settings); - -protected: - LLAtmosphere(const LLAtmosphere& rhs) - { - *this = rhs; - } - - LLPointer m_transmittance; - LLPointer m_scattering; - LLPointer m_mie_scatter_texture; - LLPointer m_illuminance; - - std::vector m_wavelengths; - std::vector m_solar_irradiance; - std::vector m_rayleigh_scattering; - std::vector m_mie_scattering; - std::vector m_mie_extinction; - std::vector m_absorption_extinction; - std::vector m_ground_albedo; - - AtmosphericModelSettings m_settings; -}; - -extern LLAtmosphere* gAtmosphere; - -#endif // LL_ATMOSPHERE_H diff --git a/indra/llrender/llgl.cpp b/indra/llrender/llgl.cpp index d13b98e2747..25277f13419 100644 --- a/indra/llrender/llgl.cpp +++ b/indra/llrender/llgl.cpp @@ -27,8 +27,6 @@ // This file sets some global GL parameters, and implements some // useful functions for GL operations. -#define GLH_EXT_SINGLE_FILE - #include "linden_common.h" #include "boost/tokenizer.hpp" @@ -54,6 +52,15 @@ #include #include "glm/gtc/type_ptr.hpp" +#if LL_SDL_WINDOW +# include "llwindowsdl.h" +# include "SDL3/SDL.h" +# define LL_GET_PROC_ADDRESS(func) SDL_GL_GetProcAddress(func) +#elif LL_WINDOWS +# include "llwindowwin32.h" +# define LL_GET_PROC_ADDRESS(func) LLWindowWin32::getProcAddress(func) +#endif + #if LL_WINDOWS #include "lldxhardware.h" #endif @@ -62,10 +69,8 @@ //#define GL_STATE_VERIFY #endif - bool gDebugSession = false; bool gDebugGLSession = false; -bool gClothRipple = false; bool gHeadlessClient = false; bool gNonInteractive = false; bool gGLActive = false; @@ -211,13 +216,16 @@ void ll_close_fail_log() LLMatrix4 gGLObliqueProjectionInverse; -#define LL_GL_NAME_POOLING 0 - std::list LLGLUpdate::sGLQ; -#if (LL_WINDOWS || LL_LINUX) && !LL_MESA_HEADLESS +#if LL_GL_FUNC_POINTER #if LL_WINDOWS +// WGL_ARB_pixel_format +PFNWGLGETPIXELFORMATATTRIBIVARBPROC wglGetPixelFormatAttribivARB = nullptr; +PFNWGLGETPIXELFORMATATTRIBFVARBPROC wglGetPixelFormatAttribfvARB = nullptr; +PFNWGLCHOOSEPIXELFORMATARBPROC wglChoosePixelFormatARB = nullptr; + // WGL_ARB_create_context PFNWGLCREATECONTEXTATTRIBSARBPROC wglCreateContextAttribsARB = nullptr; @@ -235,14 +243,93 @@ PFNWGLBLITCONTEXTFRAMEBUFFERAMDPROC wglBlitContextFramebufferAMD = n // WGL_EXT_swap_control PFNWGLSWAPINTERVALEXTPROC wglSwapIntervalEXT = nullptr; PFNWGLGETSWAPINTERVALEXTPROC wglGetSwapIntervalEXT = nullptr; +#endif +#if LL_LINUX && LL_X11 && !LL_MESA_HEADLESS +// GLX_MESA_query_renderer +PFNGLXQUERYCURRENTRENDERERINTEGERMESAPROC glXQueryCurrentRendererIntegerMESA = nullptr; +PFNGLXQUERYCURRENTRENDERERSTRINGMESAPROC glXQueryCurrentRendererStringMESA = nullptr; +PFNGLXQUERYRENDERERINTEGERMESAPROC glXQueryRendererIntegerMESA = nullptr; +PFNGLXQUERYRENDERERSTRINGMESAPROC glXQueryRendererStringMESA = nullptr; #endif +#if LL_LINUX && LL_WAYLAND &&!LL_MESA_HEADLESS +// EGL_VERSION_1_0 +PFNEGLQUERYSTRINGPROC eglQueryString = nullptr; +#endif + +// GL_VERSION_1_0 +PFNGLCLEARCOLORPROC glClearColor = nullptr; +PFNGLCLEARPROC glClear = nullptr; +PFNGLCOLORMASKPROC glColorMask = nullptr; +PFNGLBLENDFUNCPROC glBlendFunc = nullptr; +PFNGLLOGICOPPROC glLogicOp = nullptr; +PFNGLFRONTFACEPROC glFrontFace = nullptr; +PFNGLCULLFACEPROC glCullFace = nullptr; +PFNGLPOINTSIZEPROC glPointSize = nullptr; +PFNGLLINEWIDTHPROC glLineWidth = nullptr; +PFNGLPOLYGONMODEPROC glPolygonMode = nullptr; +PFNGLSCISSORPROC glScissor = nullptr; +PFNGLDRAWBUFFERPROC glDrawBuffer = nullptr; +PFNGLREADBUFFERPROC glReadBuffer = nullptr; +PFNGLENABLEPROC glEnable = nullptr; +PFNGLDISABLEPROC glDisable = nullptr; +PFNGLISENABLEDPROC glIsEnabled = nullptr; +PFNGLGETBOOLEANVPROC glGetBooleanv = nullptr; +PFNGLGETDOUBLEVPROC glGetDoublev = nullptr; +PFNGLGETFLOATVPROC glGetFloatv = nullptr; +PFNGLGETINTEGERVPROC glGetIntegerv = nullptr; +PFNGLGETERRORPROC glGetError = nullptr; +PFNGLGETSTRINGPROC glGetString = nullptr; +PFNGLFINISHPROC glFinish = nullptr; +PFNGLFLUSHPROC glFlush = nullptr; +PFNGLHINTPROC glHint = nullptr; +PFNGLCLEARDEPTHPROC glClearDepth = nullptr; +PFNGLDEPTHFUNCPROC glDepthFunc = nullptr; +PFNGLDEPTHMASKPROC glDepthMask = nullptr; +PFNGLDEPTHRANGEPROC glDepthRange = nullptr; +PFNGLVIEWPORTPROC glViewport = nullptr; +PFNGLPIXELSTOREFPROC glPixelStoref = nullptr; +PFNGLPIXELSTOREIPROC glPixelStorei = nullptr; +PFNGLREADPIXELSPROC glReadPixels = nullptr; +PFNGLSTENCILFUNCPROC glStencilFunc = nullptr; +PFNGLSTENCILMASKPROC glStencilMask = nullptr; +PFNGLSTENCILOPPROC glStencilOp = nullptr; +PFNGLCLEARSTENCILPROC glClearStencil = nullptr; +PFNGLTEXPARAMETERFPROC glTexParameterf = nullptr; +PFNGLTEXPARAMETERIPROC glTexParameteri = nullptr; +PFNGLTEXPARAMETERFVPROC glTexParameterfv = nullptr; +PFNGLTEXPARAMETERIVPROC glTexParameteriv = nullptr; +PFNGLGETTEXPARAMETERFVPROC glGetTexParameterfv = nullptr; +PFNGLGETTEXPARAMETERIVPROC glGetTexParameteriv = nullptr; +PFNGLGETTEXLEVELPARAMETERFVPROC glGetTexLevelParameterfv = nullptr; +PFNGLGETTEXLEVELPARAMETERIVPROC glGetTexLevelParameteriv = nullptr; +PFNGLTEXIMAGE1DPROC glTexImage1D = nullptr; +PFNGLTEXIMAGE2DPROC glTexImage2D = nullptr; +PFNGLGETTEXIMAGEPROC glGetTexImage = nullptr; + +// GL_VERSION_1_1 +PFNGLDRAWARRAYSPROC glDrawArrays = nullptr; +PFNGLDRAWELEMENTSPROC glDrawElements = nullptr; +PFNGLGETPOINTERVPROC glGetPointerv = nullptr; +PFNGLPOLYGONOFFSETPROC glPolygonOffset = nullptr; +PFNGLCOPYTEXIMAGE1DPROC glCopyTexImage1D = nullptr; +PFNGLCOPYTEXIMAGE2DPROC glCopyTexImage2D = nullptr; +PFNGLCOPYTEXSUBIMAGE1DPROC glCopyTexSubImage1D = nullptr; +PFNGLCOPYTEXSUBIMAGE2DPROC glCopyTexSubImage2D = nullptr; +PFNGLTEXSUBIMAGE1DPROC glTexSubImage1D = nullptr; +PFNGLTEXSUBIMAGE2DPROC glTexSubImage2D = nullptr; +PFNGLBINDTEXTUREPROC glBindTexture = nullptr; +PFNGLDELETETEXTURESPROC glDeleteTextures = nullptr; +PFNGLGENTEXTURESPROC glGenTextures = nullptr; +PFNGLISTEXTUREPROC glIsTexture = nullptr; + + // GL_VERSION_1_2 -//PFNGLDRAWRANGEELEMENTSPROC glDrawRangeElements = nullptr; -//PFNGLTEXIMAGE3DPROC glTexImage3D = nullptr; -//PFNGLTEXSUBIMAGE3DPROC glTexSubImage3D = nullptr; -//PFNGLCOPYTEXSUBIMAGE3DPROC glCopyTexSubImage3D = nullptr; +PFNGLDRAWRANGEELEMENTSPROC glDrawRangeElements = nullptr; +PFNGLTEXIMAGE3DPROC glTexImage3D = nullptr; +PFNGLTEXSUBIMAGE3DPROC glTexSubImage3D = nullptr; +PFNGLCOPYTEXSUBIMAGE3DPROC glCopyTexSubImage3D = nullptr; // GL_VERSION_1_3 PFNGLACTIVETEXTUREPROC glActiveTexture = nullptr; @@ -254,43 +341,6 @@ PFNGLCOMPRESSEDTEXSUBIMAGE3DPROC glCompressedTexSubImage3D = nullptr; PFNGLCOMPRESSEDTEXSUBIMAGE2DPROC glCompressedTexSubImage2D = nullptr; PFNGLCOMPRESSEDTEXSUBIMAGE1DPROC glCompressedTexSubImage1D = nullptr; PFNGLGETCOMPRESSEDTEXIMAGEPROC glGetCompressedTexImage = nullptr; -PFNGLCLIENTACTIVETEXTUREPROC glClientActiveTexture = nullptr; -PFNGLMULTITEXCOORD1DPROC glMultiTexCoord1d = nullptr; -PFNGLMULTITEXCOORD1DVPROC glMultiTexCoord1dv = nullptr; -PFNGLMULTITEXCOORD1FPROC glMultiTexCoord1f = nullptr; -PFNGLMULTITEXCOORD1FVPROC glMultiTexCoord1fv = nullptr; -PFNGLMULTITEXCOORD1IPROC glMultiTexCoord1i = nullptr; -PFNGLMULTITEXCOORD1IVPROC glMultiTexCoord1iv = nullptr; -PFNGLMULTITEXCOORD1SPROC glMultiTexCoord1s = nullptr; -PFNGLMULTITEXCOORD1SVPROC glMultiTexCoord1sv = nullptr; -PFNGLMULTITEXCOORD2DPROC glMultiTexCoord2d = nullptr; -PFNGLMULTITEXCOORD2DVPROC glMultiTexCoord2dv = nullptr; -PFNGLMULTITEXCOORD2FPROC glMultiTexCoord2f = nullptr; -PFNGLMULTITEXCOORD2FVPROC glMultiTexCoord2fv = nullptr; -PFNGLMULTITEXCOORD2IPROC glMultiTexCoord2i = nullptr; -PFNGLMULTITEXCOORD2IVPROC glMultiTexCoord2iv = nullptr; -PFNGLMULTITEXCOORD2SPROC glMultiTexCoord2s = nullptr; -PFNGLMULTITEXCOORD2SVPROC glMultiTexCoord2sv = nullptr; -PFNGLMULTITEXCOORD3DPROC glMultiTexCoord3d = nullptr; -PFNGLMULTITEXCOORD3DVPROC glMultiTexCoord3dv = nullptr; -PFNGLMULTITEXCOORD3FPROC glMultiTexCoord3f = nullptr; -PFNGLMULTITEXCOORD3FVPROC glMultiTexCoord3fv = nullptr; -PFNGLMULTITEXCOORD3IPROC glMultiTexCoord3i = nullptr; -PFNGLMULTITEXCOORD3IVPROC glMultiTexCoord3iv = nullptr; -PFNGLMULTITEXCOORD3SPROC glMultiTexCoord3s = nullptr; -PFNGLMULTITEXCOORD3SVPROC glMultiTexCoord3sv = nullptr; -PFNGLMULTITEXCOORD4DPROC glMultiTexCoord4d = nullptr; -PFNGLMULTITEXCOORD4DVPROC glMultiTexCoord4dv = nullptr; -PFNGLMULTITEXCOORD4FPROC glMultiTexCoord4f = nullptr; -PFNGLMULTITEXCOORD4FVPROC glMultiTexCoord4fv = nullptr; -PFNGLMULTITEXCOORD4IPROC glMultiTexCoord4i = nullptr; -PFNGLMULTITEXCOORD4IVPROC glMultiTexCoord4iv = nullptr; -PFNGLMULTITEXCOORD4SPROC glMultiTexCoord4s = nullptr; -PFNGLMULTITEXCOORD4SVPROC glMultiTexCoord4sv = nullptr; -PFNGLLOADTRANSPOSEMATRIXFPROC glLoadTransposeMatrixf = nullptr; -PFNGLLOADTRANSPOSEMATRIXDPROC glLoadTransposeMatrixd = nullptr; -PFNGLMULTTRANSPOSEMATRIXFPROC glMultTransposeMatrixf = nullptr; -PFNGLMULTTRANSPOSEMATRIXDPROC glMultTransposeMatrixd = nullptr; // GL_VERSION_1_4 PFNGLBLENDFUNCSEPARATEPROC glBlendFuncSeparate = nullptr; @@ -300,44 +350,6 @@ PFNGLPOINTPARAMETERFPROC glPointParameterf = nullptr; PFNGLPOINTPARAMETERFVPROC glPointParameterfv = nullptr; PFNGLPOINTPARAMETERIPROC glPointParameteri = nullptr; PFNGLPOINTPARAMETERIVPROC glPointParameteriv = nullptr; -PFNGLFOGCOORDFPROC glFogCoordf = nullptr; -PFNGLFOGCOORDFVPROC glFogCoordfv = nullptr; -PFNGLFOGCOORDDPROC glFogCoordd = nullptr; -PFNGLFOGCOORDDVPROC glFogCoorddv = nullptr; -PFNGLFOGCOORDPOINTERPROC glFogCoordPointer = nullptr; -PFNGLSECONDARYCOLOR3BPROC glSecondaryColor3b = nullptr; -PFNGLSECONDARYCOLOR3BVPROC glSecondaryColor3bv = nullptr; -PFNGLSECONDARYCOLOR3DPROC glSecondaryColor3d = nullptr; -PFNGLSECONDARYCOLOR3DVPROC glSecondaryColor3dv = nullptr; -PFNGLSECONDARYCOLOR3FPROC glSecondaryColor3f = nullptr; -PFNGLSECONDARYCOLOR3FVPROC glSecondaryColor3fv = nullptr; -PFNGLSECONDARYCOLOR3IPROC glSecondaryColor3i = nullptr; -PFNGLSECONDARYCOLOR3IVPROC glSecondaryColor3iv = nullptr; -PFNGLSECONDARYCOLOR3SPROC glSecondaryColor3s = nullptr; -PFNGLSECONDARYCOLOR3SVPROC glSecondaryColor3sv = nullptr; -PFNGLSECONDARYCOLOR3UBPROC glSecondaryColor3ub = nullptr; -PFNGLSECONDARYCOLOR3UBVPROC glSecondaryColor3ubv = nullptr; -PFNGLSECONDARYCOLOR3UIPROC glSecondaryColor3ui = nullptr; -PFNGLSECONDARYCOLOR3UIVPROC glSecondaryColor3uiv = nullptr; -PFNGLSECONDARYCOLOR3USPROC glSecondaryColor3us = nullptr; -PFNGLSECONDARYCOLOR3USVPROC glSecondaryColor3usv = nullptr; -PFNGLSECONDARYCOLORPOINTERPROC glSecondaryColorPointer = nullptr; -PFNGLWINDOWPOS2DPROC glWindowPos2d = nullptr; -PFNGLWINDOWPOS2DVPROC glWindowPos2dv = nullptr; -PFNGLWINDOWPOS2FPROC glWindowPos2f = nullptr; -PFNGLWINDOWPOS2FVPROC glWindowPos2fv = nullptr; -PFNGLWINDOWPOS2IPROC glWindowPos2i = nullptr; -PFNGLWINDOWPOS2IVPROC glWindowPos2iv = nullptr; -PFNGLWINDOWPOS2SPROC glWindowPos2s = nullptr; -PFNGLWINDOWPOS2SVPROC glWindowPos2sv = nullptr; -PFNGLWINDOWPOS3DPROC glWindowPos3d = nullptr; -PFNGLWINDOWPOS3DVPROC glWindowPos3dv = nullptr; -PFNGLWINDOWPOS3FPROC glWindowPos3f = nullptr; -PFNGLWINDOWPOS3FVPROC glWindowPos3fv = nullptr; -PFNGLWINDOWPOS3IPROC glWindowPos3i = nullptr; -PFNGLWINDOWPOS3IVPROC glWindowPos3iv = nullptr; -PFNGLWINDOWPOS3SPROC glWindowPos3s = nullptr; -PFNGLWINDOWPOS3SVPROC glWindowPos3sv = nullptr; // GL_VERSION_1_5 PFNGLGENQUERIESPROC glGenQueries = nullptr; @@ -613,36 +625,6 @@ PFNGLVERTEXATTRIBP3UIPROC glVertexAttribP3ui = nullptr; PFNGLVERTEXATTRIBP3UIVPROC glVertexAttribP3uiv = nullptr; PFNGLVERTEXATTRIBP4UIPROC glVertexAttribP4ui = nullptr; PFNGLVERTEXATTRIBP4UIVPROC glVertexAttribP4uiv = nullptr; -PFNGLVERTEXP2UIPROC glVertexP2ui = nullptr; -PFNGLVERTEXP2UIVPROC glVertexP2uiv = nullptr; -PFNGLVERTEXP3UIPROC glVertexP3ui = nullptr; -PFNGLVERTEXP3UIVPROC glVertexP3uiv = nullptr; -PFNGLVERTEXP4UIPROC glVertexP4ui = nullptr; -PFNGLVERTEXP4UIVPROC glVertexP4uiv = nullptr; -PFNGLTEXCOORDP1UIPROC glTexCoordP1ui = nullptr; -PFNGLTEXCOORDP1UIVPROC glTexCoordP1uiv = nullptr; -PFNGLTEXCOORDP2UIPROC glTexCoordP2ui = nullptr; -PFNGLTEXCOORDP2UIVPROC glTexCoordP2uiv = nullptr; -PFNGLTEXCOORDP3UIPROC glTexCoordP3ui = nullptr; -PFNGLTEXCOORDP3UIVPROC glTexCoordP3uiv = nullptr; -PFNGLTEXCOORDP4UIPROC glTexCoordP4ui = nullptr; -PFNGLTEXCOORDP4UIVPROC glTexCoordP4uiv = nullptr; -PFNGLMULTITEXCOORDP1UIPROC glMultiTexCoordP1ui = nullptr; -PFNGLMULTITEXCOORDP1UIVPROC glMultiTexCoordP1uiv = nullptr; -PFNGLMULTITEXCOORDP2UIPROC glMultiTexCoordP2ui = nullptr; -PFNGLMULTITEXCOORDP2UIVPROC glMultiTexCoordP2uiv = nullptr; -PFNGLMULTITEXCOORDP3UIPROC glMultiTexCoordP3ui = nullptr; -PFNGLMULTITEXCOORDP3UIVPROC glMultiTexCoordP3uiv = nullptr; -PFNGLMULTITEXCOORDP4UIPROC glMultiTexCoordP4ui = nullptr; -PFNGLMULTITEXCOORDP4UIVPROC glMultiTexCoordP4uiv = nullptr; -PFNGLNORMALP3UIPROC glNormalP3ui = nullptr; -PFNGLNORMALP3UIVPROC glNormalP3uiv = nullptr; -PFNGLCOLORP3UIPROC glColorP3ui = nullptr; -PFNGLCOLORP3UIVPROC glColorP3uiv = nullptr; -PFNGLCOLORP4UIPROC glColorP4ui = nullptr; -PFNGLCOLORP4UIVPROC glColorP4uiv = nullptr; -PFNGLSECONDARYCOLORP3UIPROC glSecondaryColorP3ui = nullptr; -PFNGLSECONDARYCOLORP3UIVPROC glSecondaryColorP3uiv = nullptr; // GL_VERSION_4_0 PFNGLMINSAMPLESHADINGPROC glMinSampleShading = nullptr; @@ -962,18 +944,6 @@ PFNGLGETNUNIFORMFVPROC glGetnUniformfv = nullp PFNGLGETNUNIFORMIVPROC glGetnUniformiv = nullptr; PFNGLGETNUNIFORMUIVPROC glGetnUniformuiv = nullptr; PFNGLREADNPIXELSPROC glReadnPixels = nullptr; -PFNGLGETNMAPDVPROC glGetnMapdv = nullptr; -PFNGLGETNMAPFVPROC glGetnMapfv = nullptr; -PFNGLGETNMAPIVPROC glGetnMapiv = nullptr; -PFNGLGETNPIXELMAPFVPROC glGetnPixelMapfv = nullptr; -PFNGLGETNPIXELMAPUIVPROC glGetnPixelMapuiv = nullptr; -PFNGLGETNPIXELMAPUSVPROC glGetnPixelMapusv = nullptr; -PFNGLGETNPOLYGONSTIPPLEPROC glGetnPolygonStipple = nullptr; -PFNGLGETNCOLORTABLEPROC glGetnColorTable = nullptr; -PFNGLGETNCONVOLUTIONFILTERPROC glGetnConvolutionFilter = nullptr; -PFNGLGETNSEPARABLEFILTERPROC glGetnSeparableFilter = nullptr; -PFNGLGETNHISTOGRAMPROC glGetnHistogram = nullptr; -PFNGLGETNMINMAXPROC glGetnMinmax = nullptr; PFNGLTEXTUREBARRIERPROC glTextureBarrier = nullptr; // GL_VERSION_4_6 @@ -1010,7 +980,8 @@ LLGLManager::LLGLManager() : mGLSLVersionMinor(0), mVRAM(0), mGLMaxVertexRange(0), - mGLMaxIndexRange(0) + mGLMaxIndexRange(0), + mGLMaxTextureSize(0) { } @@ -1020,14 +991,23 @@ LLGLManager::LLGLManager() : void LLGLManager::initWGL() { #if LL_WINDOWS && !LL_MESA_HEADLESS - if (!glh_init_extensions("WGL_ARB_pixel_format")) + reloadExtensionsString(); + + if (mGLExtensions.contains("WGL_ARB_pixel_format")) + { + wglGetPixelFormatAttribivARB = (PFNWGLGETPIXELFORMATATTRIBIVARBPROC)LL_GET_PROC_ADDRESS("wglGetPixelFormatAttribivARB"); + wglGetPixelFormatAttribfvARB = (PFNWGLGETPIXELFORMATATTRIBFVARBPROC)LL_GET_PROC_ADDRESS("wglGetPixelFormatAttribfvARB"); + wglChoosePixelFormatARB = (PFNWGLCHOOSEPIXELFORMATARBPROC)LL_GET_PROC_ADDRESS("wglChoosePixelFormatARB"); + } + else { LL_WARNS("RenderInit") << "No ARB pixel format extensions" << LL_ENDL; } - if (ExtensionExists("WGL_ARB_create_context",gGLHExts.mSysExts)) + // WGL_ARB_create_context + if (mGLExtensions.contains("WGL_ARB_create_context")) { - GLH_EXT_NAME(wglCreateContextAttribsARB) = (PFNWGLCREATECONTEXTATTRIBSARBPROC)GLH_EXT_GET_PROC_ADDRESS("wglCreateContextAttribsARB"); + wglCreateContextAttribsARB = (PFNWGLCREATECONTEXTATTRIBSARBPROC)LL_GET_PROC_ADDRESS("wglCreateContextAttribsARB"); } else { @@ -1036,72 +1016,151 @@ void LLGLManager::initWGL() // For retreiving information per AMD adapter, // because we can't trust curently selected/default one when there are multiple - mHasAMDAssociations = ExtensionExists("WGL_AMD_gpu_association", gGLHExts.mSysExts); + mHasAMDAssociations = mGLExtensions.contains("WGL_AMD_gpu_association"); if (mHasAMDAssociations) { - GLH_EXT_NAME(wglGetGPUIDsAMD) = (PFNWGLGETGPUIDSAMDPROC)GLH_EXT_GET_PROC_ADDRESS("wglGetGPUIDsAMD"); - GLH_EXT_NAME(wglGetGPUInfoAMD) = (PFNWGLGETGPUINFOAMDPROC)GLH_EXT_GET_PROC_ADDRESS("wglGetGPUInfoAMD"); + wglGetGPUIDsAMD = (PFNWGLGETGPUIDSAMDPROC)LL_GET_PROC_ADDRESS("wglGetGPUIDsAMD"); + wglGetGPUInfoAMD = (PFNWGLGETGPUINFOAMDPROC)LL_GET_PROC_ADDRESS("wglGetGPUInfoAMD"); + wglGetContextGPUIDAMD = (PFNWGLGETCONTEXTGPUIDAMDPROC)LL_GET_PROC_ADDRESS("wglGetContextGPUIDAMD"); + wglCreateAssociatedContextAMD = (PFNWGLCREATEASSOCIATEDCONTEXTAMDPROC)LL_GET_PROC_ADDRESS("wglCreateAssociatedContextAMD"); + wglCreateAssociatedContextAttribsAMD = (PFNWGLCREATEASSOCIATEDCONTEXTATTRIBSAMDPROC)LL_GET_PROC_ADDRESS("wglCreateAssociatedContextAttribsAMD"); + wglDeleteAssociatedContextAMD = (PFNWGLDELETEASSOCIATEDCONTEXTAMDPROC)LL_GET_PROC_ADDRESS("wglDeleteAssociatedContextAMD"); + wglMakeAssociatedContextCurrentAMD = (PFNWGLMAKEASSOCIATEDCONTEXTCURRENTAMDPROC)LL_GET_PROC_ADDRESS("wglMakeAssociatedContextCurrentAMD"); + wglGetCurrentAssociatedContextAMD = (PFNWGLGETCURRENTASSOCIATEDCONTEXTAMDPROC)LL_GET_PROC_ADDRESS("wglGetCurrentAssociatedContextAMD"); + wglBlitContextFramebufferAMD = (PFNWGLBLITCONTEXTFRAMEBUFFERAMDPROC)LL_GET_PROC_ADDRESS("wglBlitContextFramebufferAMD"); + } - mHasNVXGpuMemoryInfo = ExtensionExists("GL_NVX_gpu_memory_info", gGLHExts.mSysExts); - if (ExtensionExists("WGL_EXT_swap_control", gGLHExts.mSysExts)) + // WGL_EXT_swap_control + if (mGLExtensions.contains("WGL_EXT_swap_control")) { - GLH_EXT_NAME(wglSwapIntervalEXT) = (PFNWGLSWAPINTERVALEXTPROC)GLH_EXT_GET_PROC_ADDRESS("wglSwapIntervalEXT"); + wglSwapIntervalEXT = (PFNWGLSWAPINTERVALEXTPROC)LL_GET_PROC_ADDRESS("wglSwapIntervalEXT"); + wglGetSwapIntervalEXT = (PFNWGLGETSWAPINTERVALEXTPROC)LL_GET_PROC_ADDRESS("wglGetSwapIntervalEXT"); } - if( !glh_init_extensions("WGL_ARB_pbuffer") ) + if(!mGLExtensions.contains("WGL_ARB_pbuffer")) { LL_WARNS("RenderInit") << "No ARB WGL PBuffer extensions" << LL_ENDL; } - if( !glh_init_extensions("WGL_ARB_render_texture") ) + if(!mGLExtensions.contains("WGL_ARB_render_texture")) { LL_WARNS("RenderInit") << "No ARB WGL render texture extensions" << LL_ENDL; } #endif } -// return false if unable (or unwilling due to old drivers) to init GL -bool LLGLManager::initGL() +void LLGLManager::initGLX() { - if (mInited) - { - LL_ERRS("RenderInit") << "Calling init on LLGLManager after already initialized!" << LL_ENDL; - } +#if LL_LINUX && LL_X11 && !LL_MESA_HEADLESS + if (!mIsX11) + return; + + reloadExtensionsString(); -#if 0 && LL_WINDOWS - if (!glGetStringi) + mHasGLXMESAQueryRenderer = mGLExtensions.contains("GLX_MESA_query_renderer"); + if (mHasGLXMESAQueryRenderer) { - glGetStringi = (PFNGLGETSTRINGIPROC) GLH_EXT_GET_PROC_ADDRESS("glGetStringi"); + glXQueryCurrentRendererIntegerMESA = (PFNGLXQUERYCURRENTRENDERERINTEGERMESAPROC)LL_GET_PROC_ADDRESS("glXQueryCurrentRendererIntegerMESA"); + glXQueryCurrentRendererStringMESA = (PFNGLXQUERYCURRENTRENDERERSTRINGMESAPROC)LL_GET_PROC_ADDRESS("glXQueryCurrentRendererStringMESA"); + glXQueryRendererIntegerMESA = (PFNGLXQUERYRENDERERINTEGERMESAPROC)LL_GET_PROC_ADDRESS("glXQueryRendererIntegerMESA"); + glXQueryRendererStringMESA = (PFNGLXQUERYRENDERERSTRINGMESAPROC)LL_GET_PROC_ADDRESS("glXQueryRendererStringMESA"); } +#endif +} - //reload extensions string (may have changed after using wglCreateContextAttrib) - if (glGetStringi) - { - std::stringstream str; +void LLGLManager::initEGL() +{ +#if LL_LINUX && LL_WAYLAND && !LL_MESA_HEADLESS + if (!mIsWayland) + return; - GLint count = 0; - glGetIntegerv(GL_NUM_EXTENSIONS, &count); - for (GLint i = 0; i < count; ++i) - { - std::string ext = ll_safe_string((const char*) glGetStringi(GL_EXTENSIONS, i)); - str << ext << " "; - LL_DEBUGS("GLExtensions") << ext << LL_ENDL; - } + reloadExtensionsString(); + + // EGL_VERSION_1_0 + eglQueryString = (PFNEGLQUERYSTRINGPROC)LL_GET_PROC_ADDRESS("eglQueryString"); + + LL_INFOS("RenderInit") << "EGL_VENDOR " << ll_safe_string((const char *)eglQueryString(SDL_EGL_GetCurrentDisplay(), EGL_VENDOR)) << LL_ENDL; + LL_INFOS("RenderInit") << "EGL_VERSION " << ll_safe_string((const char *)eglQueryString(SDL_EGL_GetCurrentDisplay(), EGL_VERSION)) << LL_ENDL; +#endif +} - { - PFNWGLGETEXTENSIONSSTRINGARBPROC wglGetExtensionsStringARB = 0; - wglGetExtensionsStringARB = (PFNWGLGETEXTENSIONSSTRINGARBPROC)wglGetProcAddress("wglGetExtensionsStringARB"); - if(wglGetExtensionsStringARB) - { - str << (const char*) wglGetExtensionsStringARB(wglGetCurrentDC()); - } - } - free(gGLHExts.mSysExts); - std::string extensions = str.str(); - gGLHExts.mSysExts = strdup(extensions.c_str()); +// return false if unable (or unwilling due to old drivers) to init GL +bool LLGLManager::initGL() +{ + if (mInited) + { + LL_ERRS("RenderInit") << "Calling init on LLGLManager after already initialized!" << LL_ENDL; } + +#if LL_GL_FUNC_POINTER + // OpenGL 1.0 and 1.1 always exist + // GL_VERSION_1_0 + glClearColor = (PFNGLCLEARCOLORPROC)LL_GET_PROC_ADDRESS("glClearColor"); + glClear = (PFNGLCLEARPROC)LL_GET_PROC_ADDRESS("glClear"); + glColorMask = (PFNGLCOLORMASKPROC)LL_GET_PROC_ADDRESS("glColorMask"); + glBlendFunc = (PFNGLBLENDFUNCPROC)LL_GET_PROC_ADDRESS("glBlendFunc"); + glLogicOp = (PFNGLLOGICOPPROC)LL_GET_PROC_ADDRESS("glLogicOp"); + glFrontFace = (PFNGLFRONTFACEPROC)LL_GET_PROC_ADDRESS("glFrontFace"); + glCullFace = (PFNGLCULLFACEPROC)LL_GET_PROC_ADDRESS("glCullFace");; + glPointSize = (PFNGLPOINTSIZEPROC)LL_GET_PROC_ADDRESS("glPointSize"); + glLineWidth = (PFNGLLINEWIDTHPROC)LL_GET_PROC_ADDRESS("glLineWidth"); + glPolygonMode = (PFNGLPOLYGONMODEPROC)LL_GET_PROC_ADDRESS("glPolygonMode"); + glScissor = (PFNGLSCISSORPROC)LL_GET_PROC_ADDRESS("glScissor"); + glDrawBuffer = (PFNGLDRAWBUFFERPROC)LL_GET_PROC_ADDRESS("glDrawBuffer"); + glReadBuffer = (PFNGLREADBUFFERPROC)LL_GET_PROC_ADDRESS("glReadBuffer"); + glEnable = (PFNGLENABLEPROC)LL_GET_PROC_ADDRESS("glEnable"); + glDisable = (PFNGLDISABLEPROC)LL_GET_PROC_ADDRESS("glDisable"); + glIsEnabled = (PFNGLISENABLEDPROC)LL_GET_PROC_ADDRESS("glIsEnabled"); + glGetBooleanv = (PFNGLGETBOOLEANVPROC)LL_GET_PROC_ADDRESS("glGetBooleanv"); + glGetDoublev = (PFNGLGETDOUBLEVPROC)LL_GET_PROC_ADDRESS("glGetDoublev"); + glGetFloatv = (PFNGLGETFLOATVPROC)LL_GET_PROC_ADDRESS("glGetFloatv"); + glGetIntegerv = (PFNGLGETINTEGERVPROC)LL_GET_PROC_ADDRESS("glGetIntegerv"); + glGetError = (PFNGLGETERRORPROC)LL_GET_PROC_ADDRESS("glGetError"); + glGetString = (PFNGLGETSTRINGPROC)LL_GET_PROC_ADDRESS("glGetString"); + glFinish = (PFNGLFINISHPROC)LL_GET_PROC_ADDRESS("glFinish"); + glFlush = (PFNGLFLUSHPROC)LL_GET_PROC_ADDRESS("glFlush"); + glHint = (PFNGLHINTPROC)LL_GET_PROC_ADDRESS("glHint"); + glClearDepth = (PFNGLCLEARDEPTHPROC)LL_GET_PROC_ADDRESS("glClearDepth"); + glDepthFunc = (PFNGLDEPTHFUNCPROC)LL_GET_PROC_ADDRESS("glDepthFunc"); + glDepthMask = (PFNGLDEPTHMASKPROC)LL_GET_PROC_ADDRESS("glDepthMask"); + glDepthRange = (PFNGLDEPTHRANGEPROC)LL_GET_PROC_ADDRESS("glDepthRange"); + glViewport = (PFNGLVIEWPORTPROC)LL_GET_PROC_ADDRESS("glViewport"); + glPixelStoref = (PFNGLPIXELSTOREFPROC)LL_GET_PROC_ADDRESS("glPixelStoref"); + glPixelStorei = (PFNGLPIXELSTOREIPROC)LL_GET_PROC_ADDRESS("glPixelStorei"); + glReadPixels = (PFNGLREADPIXELSPROC)LL_GET_PROC_ADDRESS("glReadPixels"); + glStencilFunc = (PFNGLSTENCILFUNCPROC)LL_GET_PROC_ADDRESS("glStencilFunc"); + glStencilMask = (PFNGLSTENCILMASKPROC)LL_GET_PROC_ADDRESS("glStencilMask"); + glStencilOp = (PFNGLSTENCILOPPROC)LL_GET_PROC_ADDRESS("glStencilOp"); + glClearStencil = (PFNGLCLEARSTENCILPROC)LL_GET_PROC_ADDRESS("glClearStencil"); + glTexParameterf = (PFNGLTEXPARAMETERFPROC)LL_GET_PROC_ADDRESS("glTexParameterf"); + glTexParameteri = (PFNGLTEXPARAMETERIPROC)LL_GET_PROC_ADDRESS("glTexParameteri"); + glTexParameterfv = (PFNGLTEXPARAMETERFVPROC)LL_GET_PROC_ADDRESS("glTexParameterfv"); + glTexParameteriv = (PFNGLTEXPARAMETERIVPROC)LL_GET_PROC_ADDRESS("glTexParameteriv"); + glGetTexParameterfv = (PFNGLGETTEXPARAMETERFVPROC)LL_GET_PROC_ADDRESS("glGetTexParameterfv"); + glGetTexParameteriv = (PFNGLGETTEXPARAMETERIVPROC)LL_GET_PROC_ADDRESS("glGetTexParameteriv"); + glGetTexLevelParameterfv = (PFNGLGETTEXLEVELPARAMETERFVPROC)LL_GET_PROC_ADDRESS("glGetTexLevelParameterfv"); + glGetTexLevelParameteriv = (PFNGLGETTEXLEVELPARAMETERIVPROC)LL_GET_PROC_ADDRESS("glGetTexLevelParameteriv"); + glTexImage1D = (PFNGLTEXIMAGE1DPROC)LL_GET_PROC_ADDRESS("glTexImage1D"); + glTexImage2D = (PFNGLTEXIMAGE2DPROC)LL_GET_PROC_ADDRESS("glTexImage2D"); + glGetTexImage = (PFNGLGETTEXIMAGEPROC)LL_GET_PROC_ADDRESS("glGetTexImage"); + + // GL_VERSION_1_1 + glDrawArrays = (PFNGLDRAWARRAYSPROC)LL_GET_PROC_ADDRESS("glDrawArrays"); + glDrawElements = (PFNGLDRAWELEMENTSPROC)LL_GET_PROC_ADDRESS("glDrawElements"); + glGetPointerv = (PFNGLGETPOINTERVPROC)LL_GET_PROC_ADDRESS("glGetPointerv"); + glPolygonOffset = (PFNGLPOLYGONOFFSETPROC)LL_GET_PROC_ADDRESS("glPolygonOffset"); + glCopyTexImage1D = (PFNGLCOPYTEXIMAGE1DPROC)LL_GET_PROC_ADDRESS("glCopyTexImage1D"); + glCopyTexImage2D = (PFNGLCOPYTEXIMAGE2DPROC)LL_GET_PROC_ADDRESS("glCopyTexImage2D"); + glCopyTexSubImage1D = (PFNGLCOPYTEXSUBIMAGE1DPROC)LL_GET_PROC_ADDRESS("glCopyTexSubImage1D"); + glCopyTexSubImage2D = (PFNGLCOPYTEXSUBIMAGE2DPROC)LL_GET_PROC_ADDRESS("glCopyTexSubImage2D"); + glTexSubImage1D = (PFNGLTEXSUBIMAGE1DPROC)LL_GET_PROC_ADDRESS("glTexSubImage1D"); + glTexSubImage2D = (PFNGLTEXSUBIMAGE2DPROC)LL_GET_PROC_ADDRESS("glTexSubImage2D"); + glBindTexture = (PFNGLBINDTEXTUREPROC)LL_GET_PROC_ADDRESS("glBindTexture"); + glDeleteTextures = (PFNGLDELETETEXTURESPROC)LL_GET_PROC_ADDRESS("glDeleteTextures"); + glGenTextures = (PFNGLGENTEXTURESPROC)LL_GET_PROC_ADDRESS("glGenTextures"); + glIsTexture = (PFNGLISTEXTUREPROC)LL_GET_PROC_ADDRESS("glIsTexture"); #endif // Extract video card strings and convert to upper case to @@ -1137,7 +1196,11 @@ bool LLGLManager::initGL() // Trailing space necessary to keep "nVidia Corpor_ati_on" cards // from being recognized as ATI. // NOTE: AMD has been pretty good about not breaking this check, do not rename without good reason - if (mGLVendor.substr(0,4) == "ATI ") + if (mGLVendor.substr(0,4) == "ATI " +#if LL_LINUX + || mGLVendor.find("AMD") != std::string::npos +#endif //LL_LINUX + ) { mGLVendorShort = "AMD"; // *TODO: Fix this? @@ -1203,16 +1266,46 @@ bool LLGLManager::initGL() { LL_WARNS("RenderInit") << "VRAM Detected (AMDAssociations):" << mVRAM << LL_ENDL; } - } - else if (mHasNVXGpuMemoryInfo) + } else +#endif + +#if LL_LINUX && LL_X11 && !LL_MESA_HEADLESS + if(mHasGLXMESAQueryRenderer && mVRAM == 0) { - GLint mem_kb = 0; - glGetIntegerv(GL_GPU_MEMORY_INFO_DEDICATED_VIDMEM_NVX, &mem_kb); - mVRAM = mem_kb / 1024; + unsigned int vram_val = 0; + if(glXQueryCurrentRendererIntegerMESA(GLX_RENDERER_VIDEO_MEMORY_MESA, &vram_val)) + { + gGLManager.mVRAM = vram_val; - if (mVRAM != 0) + if (mVRAM != 0) + { + LL_WARNS("RenderInit") << "VRAM Detected (GLXMesaQueryRenderer):" << mVRAM << LL_ENDL; + } + } + } +#endif + +#if LL_WINDOWS || LL_LINUX + { + if (mHasNVXGpuMemoryInfo && mVRAM == 0) { - LL_WARNS("RenderInit") << "VRAM Detected (NVXGpuMemoryInfo):" << mVRAM << LL_ENDL; + GLint mem_kb = 0; + glGetIntegerv(GL_GPU_MEMORY_INFO_DEDICATED_VIDMEM_NVX, &mem_kb); + mVRAM = mem_kb / 1024; + + if (mVRAM != 0) + { + LL_WARNS("RenderInit") << "VRAM Detected (NVXGpuMemoryInfo):" << mVRAM << LL_ENDL; + } + } + + if (mHasATIMemInfo && mVRAM == 0) + { //ask the gl how much vram is free at startup and attempt to use no more than half of that + S32 meminfo[4]; + glGetIntegerv(GL_TEXTURE_FREE_MEMORY_ATI, meminfo); + + mVRAM = meminfo[0] / 1024; + LL_INFOS("RenderInit") << "VRAM Detected (ATIMemInfo):" << mVRAM << LL_ENDL; } } #endif @@ -1232,6 +1325,9 @@ bool LLGLManager::initGL() glGetIntegerv(GL_MAX_VARYING_VECTORS, &mMaxVaryingVectors); glGetIntegerv(GL_MAX_UNIFORM_BLOCK_SIZE, &mMaxUniformBlockSize); + // If outside the allowed range, glLineWidth fails with "invalid value". + glGetFloatv(GL_ALIASED_LINE_WIDTH_RANGE, mAliasedLineRange.mV); + // sanity clamp max uniform block size to 64k just in case // there's some implementation that reports a crazy value mMaxUniformBlockSize = llmin(mMaxUniformBlockSize, 65536); @@ -1263,12 +1359,9 @@ void LLGLManager::getGLInfo(LLSD& info) } #if !LL_MESA_HEADLESS - std::string all_exts = ll_safe_string((const char *)gGLHExts.mSysExts); - boost::char_separator sep(" "); - boost::tokenizer > tok(all_exts, sep); - for(boost::tokenizer >::iterator i = tok.begin(); i != tok.end(); ++i) + for (const auto& ext : mGLExtensions) { - info["GLInfo"]["GLExtensions"].append(*i); + info["GLInfo"]["GLExtensions"].append(ext); } #endif } @@ -1291,8 +1384,12 @@ std::string LLGLManager::getGLInfoString() } #if !LL_MESA_HEADLESS - std::string all_exts= ll_safe_string(((const char *)gGLHExts.mSysExts)); - LLStringUtil::replaceChar(all_exts, ' ', '\n'); + std::string all_exts; + for (const auto& ext : mGLExtensions) + { + all_exts += ext; + all_exts += '\n'; + } info_str += std::string("GL_EXTENSIONS:\n") + all_exts + std::string("\n"); #endif @@ -1315,9 +1412,13 @@ void LLGLManager::printGLInfoString() } #if !LL_MESA_HEADLESS - std::string all_exts= ll_safe_string(((const char *)gGLHExts.mSysExts)); - LLStringUtil::replaceChar(all_exts, ' ', '\n'); - LL_DEBUGS("RenderInit") << "GL_EXTENSIONS:\n" << all_exts << LL_ENDL; + std::string all_exts; + for (const auto& ext : mGLExtensions) + { + all_exts += ext; + all_exts += '\n'; + } + LL_INFOS("RenderInit") << "GL_EXTENSIONS:\n" << all_exts << LL_ENDL; #endif } @@ -1376,23 +1477,103 @@ void LLGLManager::shutdownGL() // these are used to turn software blending on. They appear in the Debug/Avatar menu // presence of vertex skinning/blending or vertex programs will set these to false by default. -void LLGLManager::initExtensions() +void LLGLManager::reloadExtensionsString() { + mGLExtensions.clear(); + + //reload extensions string + // I am deeply sorry for how ugly this is. - Rye +#if LL_GL_FUNC_POINTER + PFNGLGETSTRINGIPROC llglGetStringi = (PFNGLGETSTRINGIPROC)LL_GET_PROC_ADDRESS("glGetStringi"); + PFNGLGETINTEGERVPROC llglGetIntegerv = (PFNGLGETINTEGERVPROC)LL_GET_PROC_ADDRESS("glGetIntegerv"); + if (llglGetStringi && llglGetIntegerv) + { + GLint num_extensions = 0; + llglGetIntegerv(GL_NUM_EXTENSIONS, &num_extensions); + for (GLint i = 0; i < num_extensions; ++i) { + mGLExtensions.insert(ll_safe_string((char const*)llglGetStringi(GL_EXTENSIONS, i))); + } + } +#else + { + GLint num_extensions = 0; + glGetIntegerv(GL_NUM_EXTENSIONS, &num_extensions); + for (GLint i = 0; i < num_extensions; ++i) { + mGLExtensions.insert(ll_safe_string((char const*)glGetStringi(GL_EXTENSIONS, i))); + } #if LL_DARWIN - GLint num_extensions = 0; - std::string all_extensions{""}; - glGetIntegerv(GL_NUM_EXTENSIONS, &num_extensions); - for(GLint i = 0; i < num_extensions; ++i) { - char const * extension = (char const *)glGetStringi(GL_EXTENSIONS, i); - all_extensions += extension; - all_extensions += ' '; + if (num_extensions > 0) + { + mGLExtensions.insert("GL_ARB_multitexture"); + mGLExtensions.insert("GL_ARB_texture_cube_map"); + mGLExtensions.insert("GL_ARB_texture_compression"); + } +#endif + } +#endif + +#if LL_WINDOWS + { + PFNWGLGETEXTENSIONSSTRINGARBPROC wglGetExtensionsStringARB = (PFNWGLGETEXTENSIONSSTRINGARBPROC)LL_GET_PROC_ADDRESS("wglGetExtensionsStringARB"); + if (wglGetExtensionsStringARB) + { + std::string wgl_exts = ll_safe_string((const char*)wglGetExtensionsStringARB(wglGetCurrentDC())); + boost::char_separator sep(" "); + boost::tokenizer > tok(wgl_exts, sep); + for (boost::tokenizer >::iterator i = tok.begin(); i != tok.end(); ++i) + { + mGLExtensions.insert(*i); + } + } + } +#endif + +#if LL_SDL_WINDOW && LL_LINUX && LL_X11 && !LL_MESA_HEADLESS + if (mIsX11) + { + if (LLWindowSDL::sX11Data.xdisplay && LLWindowSDL::sX11Data.xwindow) + { + typedef const char *(*PFNEGLXQUERYEXTENSIONSSTRINGPROC) (Display *dpy, int screen ); + PFNEGLXQUERYEXTENSIONSSTRINGPROC llglXQueryExtensionsString = (PFNEGLXQUERYEXTENSIONSSTRINGPROC)LL_GET_PROC_ADDRESS("glXQueryExtensionsString"); + if (llglXQueryExtensionsString) + { + std::string glx_exts = ll_safe_string((const char*)llglXQueryExtensionsString(LLWindowSDL::sX11Data.xdisplay, LLWindowSDL::sX11Data.xscreen)); + boost::char_separator sep(" "); + boost::tokenizer > tok(glx_exts, sep); + for (boost::tokenizer >::iterator i = tok.begin(); i != tok.end(); ++i) + { + mGLExtensions.insert(*i); + } + } + } } - if (num_extensions) +#endif + +#if LL_SDL_WINDOW && LL_LINUX && LL_WAYLAND && !LL_MESA_HEADLESS + if (mIsWayland) { - all_extensions += "GL_ARB_multitexture GL_ARB_texture_cube_map GL_ARB_texture_compression "; // These are in 3.2 core, but not listed by OSX - gGLHExts.mSysExts = strdup(all_extensions.data()); + SDL_EGLDisplay egl_display = SDL_EGL_GetCurrentDisplay(); + if (egl_display) + { + PFNEGLQUERYSTRINGPROC lleglQueryString = (PFNEGLQUERYSTRINGPROC)LL_GET_PROC_ADDRESS("eglQueryString"); + if (lleglQueryString) + { + std::string egl_exts = ll_safe_string((const char*)lleglQueryString((EGLDisplay)egl_display, EGL_EXTENSIONS)); + boost::char_separator sep(" "); + boost::tokenizer > tok(egl_exts, sep); + for (boost::tokenizer >::iterator i = tok.begin(); i != tok.end(); ++i) + { + mGLExtensions.insert(*i); + } + } + } } #endif +} + +void LLGLManager::initExtensions() +{ + reloadExtensionsString(); // NOTE: version checks against mGLVersion should bias down by 0.01 because of F32 errors @@ -1401,11 +1582,14 @@ void LLGLManager::initExtensions() mHasTransformFeedback = mGLVersion >= 3.99f; mHasDebugOutput = mGLVersion >= 4.29f; mHasAnisotropic = mGLVersion >= 4.59f; - if(!mHasAnisotropic && gGLHExts.mSysExts) + if(!mHasAnisotropic) { - mHasAnisotropic = ExtensionExists("GL_EXT_texture_filter_anisotropic", gGLHExts.mSysExts); + mHasAnisotropic = mGLExtensions.contains("GL_EXT_texture_filter_anisotropic"); } + mHasNVXGpuMemoryInfo = mGLExtensions.contains("GL_NVX_gpu_memory_info"); + mHasATIMemInfo = mGLExtensions.contains("GL_ATI_meminfo"); //Basic AMD method, also see mHasAMDAssociations + // Misc glGetIntegerv(GL_MAX_ELEMENTS_VERTICES, (GLint*) &mGLMaxVertexRange); glGetIntegerv(GL_MAX_ELEMENTS_INDICES, (GLint*) &mGLMaxIndexRange); @@ -1413,846 +1597,706 @@ void LLGLManager::initExtensions() mInited = true; -#if (LL_WINDOWS || LL_LINUX) && !LL_MESA_HEADLESS - LL_DEBUGS("RenderInit") << "GL Probe: Getting symbols" << LL_ENDL; - -#if LL_WINDOWS - // WGL_AMD_gpu_association - wglGetGPUIDsAMD = (PFNWGLGETGPUIDSAMDPROC)GLH_EXT_GET_PROC_ADDRESS("wglGetGPUIDsAMD"); - wglGetGPUInfoAMD = (PFNWGLGETGPUINFOAMDPROC)GLH_EXT_GET_PROC_ADDRESS("wglGetGPUInfoAMD"); - wglGetContextGPUIDAMD = (PFNWGLGETCONTEXTGPUIDAMDPROC)GLH_EXT_GET_PROC_ADDRESS("wglGetContextGPUIDAMD"); - wglCreateAssociatedContextAMD = (PFNWGLCREATEASSOCIATEDCONTEXTAMDPROC)GLH_EXT_GET_PROC_ADDRESS("wglCreateAssociatedContextAMD"); - wglCreateAssociatedContextAttribsAMD = (PFNWGLCREATEASSOCIATEDCONTEXTATTRIBSAMDPROC)GLH_EXT_GET_PROC_ADDRESS("wglCreateAssociatedContextAttribsAMD"); - wglDeleteAssociatedContextAMD = (PFNWGLDELETEASSOCIATEDCONTEXTAMDPROC)GLH_EXT_GET_PROC_ADDRESS("wglDeleteAssociatedContextAMD"); - wglMakeAssociatedContextCurrentAMD = (PFNWGLMAKEASSOCIATEDCONTEXTCURRENTAMDPROC)GLH_EXT_GET_PROC_ADDRESS("wglMakeAssociatedContextCurrentAMD"); - wglGetCurrentAssociatedContextAMD = (PFNWGLGETCURRENTASSOCIATEDCONTEXTAMDPROC)GLH_EXT_GET_PROC_ADDRESS("wglGetCurrentAssociatedContextAMD"); - wglBlitContextFramebufferAMD = (PFNWGLBLITCONTEXTFRAMEBUFFERAMDPROC)GLH_EXT_GET_PROC_ADDRESS("wglBlitContextFramebufferAMD"); - - // WGL_EXT_swap_control - wglSwapIntervalEXT = (PFNWGLSWAPINTERVALEXTPROC)GLH_EXT_GET_PROC_ADDRESS("wglSwapIntervalEXT"); - wglGetSwapIntervalEXT = (PFNWGLGETSWAPINTERVALEXTPROC)GLH_EXT_GET_PROC_ADDRESS("wglGetSwapIntervalEXT"); - - // WGL_ARB_create_context - wglCreateContextAttribsARB = (PFNWGLCREATECONTEXTATTRIBSARBPROC)GLH_EXT_GET_PROC_ADDRESS("wglCreateContextAttribsARB"); -#endif - - +#if LL_GL_FUNC_POINTER // Load entire OpenGL API through GetProcAddress, leaving sections beyond mGLVersion unloaded + LL_DEBUGS("RenderInit") << "GL Probe: Getting symbols" << LL_ENDL; // GL_VERSION_1_2 if (mGLVersion < 1.19f) { return; } - glDrawRangeElements = (PFNGLDRAWRANGEELEMENTSPROC)GLH_EXT_GET_PROC_ADDRESS("glDrawRangeElements"); - glTexImage3D = (PFNGLTEXIMAGE3DPROC)GLH_EXT_GET_PROC_ADDRESS("glTexImage3D"); - glTexSubImage3D = (PFNGLTEXSUBIMAGE3DPROC)GLH_EXT_GET_PROC_ADDRESS("glTexSubImage3D"); - glCopyTexSubImage3D = (PFNGLCOPYTEXSUBIMAGE3DPROC)GLH_EXT_GET_PROC_ADDRESS("glCopyTexSubImage3D"); - + glDrawRangeElements = (PFNGLDRAWRANGEELEMENTSPROC)LL_GET_PROC_ADDRESS("glDrawRangeElements"); + glTexImage3D = (PFNGLTEXIMAGE3DPROC)LL_GET_PROC_ADDRESS("glTexImage3D"); + glTexSubImage3D = (PFNGLTEXSUBIMAGE3DPROC)LL_GET_PROC_ADDRESS("glTexSubImage3D"); + glCopyTexSubImage3D = (PFNGLCOPYTEXSUBIMAGE3DPROC)LL_GET_PROC_ADDRESS("glCopyTexSubImage3D"); // GL_VERSION_1_3 if (mGLVersion < 1.29f) { return; } - glActiveTexture = (PFNGLACTIVETEXTUREPROC)GLH_EXT_GET_PROC_ADDRESS("glActiveTexture"); - glSampleCoverage = (PFNGLSAMPLECOVERAGEPROC)GLH_EXT_GET_PROC_ADDRESS("glSampleCoverage"); - glCompressedTexImage3D = (PFNGLCOMPRESSEDTEXIMAGE3DPROC)GLH_EXT_GET_PROC_ADDRESS("glCompressedTexImage3D"); - glCompressedTexImage2D = (PFNGLCOMPRESSEDTEXIMAGE2DPROC)GLH_EXT_GET_PROC_ADDRESS("glCompressedTexImage2D"); - glCompressedTexImage1D = (PFNGLCOMPRESSEDTEXIMAGE1DPROC)GLH_EXT_GET_PROC_ADDRESS("glCompressedTexImage1D"); - glCompressedTexSubImage3D = (PFNGLCOMPRESSEDTEXSUBIMAGE3DPROC)GLH_EXT_GET_PROC_ADDRESS("glCompressedTexSubImage3D"); - glCompressedTexSubImage2D = (PFNGLCOMPRESSEDTEXSUBIMAGE2DPROC)GLH_EXT_GET_PROC_ADDRESS("glCompressedTexSubImage2D"); - glCompressedTexSubImage1D = (PFNGLCOMPRESSEDTEXSUBIMAGE1DPROC)GLH_EXT_GET_PROC_ADDRESS("glCompressedTexSubImage1D"); - glGetCompressedTexImage = (PFNGLGETCOMPRESSEDTEXIMAGEPROC)GLH_EXT_GET_PROC_ADDRESS("glGetCompressedTexImage"); - glClientActiveTexture = (PFNGLCLIENTACTIVETEXTUREPROC)GLH_EXT_GET_PROC_ADDRESS("glClientActiveTexture"); - glMultiTexCoord1d = (PFNGLMULTITEXCOORD1DPROC)GLH_EXT_GET_PROC_ADDRESS("glMultiTexCoord1d"); - glMultiTexCoord1dv = (PFNGLMULTITEXCOORD1DVPROC)GLH_EXT_GET_PROC_ADDRESS("glMultiTexCoord1dv"); - glMultiTexCoord1f = (PFNGLMULTITEXCOORD1FPROC)GLH_EXT_GET_PROC_ADDRESS("glMultiTexCoord1f"); - glMultiTexCoord1fv = (PFNGLMULTITEXCOORD1FVPROC)GLH_EXT_GET_PROC_ADDRESS("glMultiTexCoord1fv"); - glMultiTexCoord1i = (PFNGLMULTITEXCOORD1IPROC)GLH_EXT_GET_PROC_ADDRESS("glMultiTexCoord1i"); - glMultiTexCoord1iv = (PFNGLMULTITEXCOORD1IVPROC)GLH_EXT_GET_PROC_ADDRESS("glMultiTexCoord1iv"); - glMultiTexCoord1s = (PFNGLMULTITEXCOORD1SPROC)GLH_EXT_GET_PROC_ADDRESS("glMultiTexCoord1s"); - glMultiTexCoord1sv = (PFNGLMULTITEXCOORD1SVPROC)GLH_EXT_GET_PROC_ADDRESS("glMultiTexCoord1sv"); - glMultiTexCoord2d = (PFNGLMULTITEXCOORD2DPROC)GLH_EXT_GET_PROC_ADDRESS("glMultiTexCoord2d"); - glMultiTexCoord2dv = (PFNGLMULTITEXCOORD2DVPROC)GLH_EXT_GET_PROC_ADDRESS("glMultiTexCoord2dv"); - glMultiTexCoord2f = (PFNGLMULTITEXCOORD2FPROC)GLH_EXT_GET_PROC_ADDRESS("glMultiTexCoord2f"); - glMultiTexCoord2fv = (PFNGLMULTITEXCOORD2FVPROC)GLH_EXT_GET_PROC_ADDRESS("glMultiTexCoord2fv"); - glMultiTexCoord2i = (PFNGLMULTITEXCOORD2IPROC)GLH_EXT_GET_PROC_ADDRESS("glMultiTexCoord2i"); - glMultiTexCoord2iv = (PFNGLMULTITEXCOORD2IVPROC)GLH_EXT_GET_PROC_ADDRESS("glMultiTexCoord2iv"); - glMultiTexCoord2s = (PFNGLMULTITEXCOORD2SPROC)GLH_EXT_GET_PROC_ADDRESS("glMultiTexCoord2s"); - glMultiTexCoord2sv = (PFNGLMULTITEXCOORD2SVPROC)GLH_EXT_GET_PROC_ADDRESS("glMultiTexCoord2sv"); - glMultiTexCoord3d = (PFNGLMULTITEXCOORD3DPROC)GLH_EXT_GET_PROC_ADDRESS("glMultiTexCoord3d"); - glMultiTexCoord3dv = (PFNGLMULTITEXCOORD3DVPROC)GLH_EXT_GET_PROC_ADDRESS("glMultiTexCoord3dv"); - glMultiTexCoord3f = (PFNGLMULTITEXCOORD3FPROC)GLH_EXT_GET_PROC_ADDRESS("glMultiTexCoord3f"); - glMultiTexCoord3fv = (PFNGLMULTITEXCOORD3FVPROC)GLH_EXT_GET_PROC_ADDRESS("glMultiTexCoord3fv"); - glMultiTexCoord3i = (PFNGLMULTITEXCOORD3IPROC)GLH_EXT_GET_PROC_ADDRESS("glMultiTexCoord3i"); - glMultiTexCoord3iv = (PFNGLMULTITEXCOORD3IVPROC)GLH_EXT_GET_PROC_ADDRESS("glMultiTexCoord3iv"); - glMultiTexCoord3s = (PFNGLMULTITEXCOORD3SPROC)GLH_EXT_GET_PROC_ADDRESS("glMultiTexCoord3s"); - glMultiTexCoord3sv = (PFNGLMULTITEXCOORD3SVPROC)GLH_EXT_GET_PROC_ADDRESS("glMultiTexCoord3sv"); - glMultiTexCoord4d = (PFNGLMULTITEXCOORD4DPROC)GLH_EXT_GET_PROC_ADDRESS("glMultiTexCoord4d"); - glMultiTexCoord4dv = (PFNGLMULTITEXCOORD4DVPROC)GLH_EXT_GET_PROC_ADDRESS("glMultiTexCoord4dv"); - glMultiTexCoord4f = (PFNGLMULTITEXCOORD4FPROC)GLH_EXT_GET_PROC_ADDRESS("glMultiTexCoord4f"); - glMultiTexCoord4fv = (PFNGLMULTITEXCOORD4FVPROC)GLH_EXT_GET_PROC_ADDRESS("glMultiTexCoord4fv"); - glMultiTexCoord4i = (PFNGLMULTITEXCOORD4IPROC)GLH_EXT_GET_PROC_ADDRESS("glMultiTexCoord4i"); - glMultiTexCoord4iv = (PFNGLMULTITEXCOORD4IVPROC)GLH_EXT_GET_PROC_ADDRESS("glMultiTexCoord4iv"); - glMultiTexCoord4s = (PFNGLMULTITEXCOORD4SPROC)GLH_EXT_GET_PROC_ADDRESS("glMultiTexCoord4s"); - glMultiTexCoord4sv = (PFNGLMULTITEXCOORD4SVPROC)GLH_EXT_GET_PROC_ADDRESS("glMultiTexCoord4sv"); - glLoadTransposeMatrixf = (PFNGLLOADTRANSPOSEMATRIXFPROC)GLH_EXT_GET_PROC_ADDRESS("glLoadTransposeMatrixf"); - glLoadTransposeMatrixd = (PFNGLLOADTRANSPOSEMATRIXDPROC)GLH_EXT_GET_PROC_ADDRESS("glLoadTransposeMatrixd"); - glMultTransposeMatrixf = (PFNGLMULTTRANSPOSEMATRIXFPROC)GLH_EXT_GET_PROC_ADDRESS("glMultTransposeMatrixf"); - glMultTransposeMatrixd = (PFNGLMULTTRANSPOSEMATRIXDPROC)GLH_EXT_GET_PROC_ADDRESS("glMultTransposeMatrixd"); + glActiveTexture = (PFNGLACTIVETEXTUREPROC)LL_GET_PROC_ADDRESS("glActiveTexture"); + glSampleCoverage = (PFNGLSAMPLECOVERAGEPROC)LL_GET_PROC_ADDRESS("glSampleCoverage"); + glCompressedTexImage3D = (PFNGLCOMPRESSEDTEXIMAGE3DPROC)LL_GET_PROC_ADDRESS("glCompressedTexImage3D"); + glCompressedTexImage2D = (PFNGLCOMPRESSEDTEXIMAGE2DPROC)LL_GET_PROC_ADDRESS("glCompressedTexImage2D"); + glCompressedTexImage1D = (PFNGLCOMPRESSEDTEXIMAGE1DPROC)LL_GET_PROC_ADDRESS("glCompressedTexImage1D"); + glCompressedTexSubImage3D = (PFNGLCOMPRESSEDTEXSUBIMAGE3DPROC)LL_GET_PROC_ADDRESS("glCompressedTexSubImage3D"); + glCompressedTexSubImage2D = (PFNGLCOMPRESSEDTEXSUBIMAGE2DPROC)LL_GET_PROC_ADDRESS("glCompressedTexSubImage2D"); + glCompressedTexSubImage1D = (PFNGLCOMPRESSEDTEXSUBIMAGE1DPROC)LL_GET_PROC_ADDRESS("glCompressedTexSubImage1D"); + glGetCompressedTexImage = (PFNGLGETCOMPRESSEDTEXIMAGEPROC)LL_GET_PROC_ADDRESS("glGetCompressedTexImage"); // GL_VERSION_1_4 if (mGLVersion < 1.39f) { return; } - glBlendFuncSeparate = (PFNGLBLENDFUNCSEPARATEPROC)GLH_EXT_GET_PROC_ADDRESS("glBlendFuncSeparate"); - glMultiDrawArrays = (PFNGLMULTIDRAWARRAYSPROC)GLH_EXT_GET_PROC_ADDRESS("glMultiDrawArrays"); - glMultiDrawElements = (PFNGLMULTIDRAWELEMENTSPROC)GLH_EXT_GET_PROC_ADDRESS("glMultiDrawElements"); - glPointParameterf = (PFNGLPOINTPARAMETERFPROC)GLH_EXT_GET_PROC_ADDRESS("glPointParameterf"); - glPointParameterfv = (PFNGLPOINTPARAMETERFVPROC)GLH_EXT_GET_PROC_ADDRESS("glPointParameterfv"); - glPointParameteri = (PFNGLPOINTPARAMETERIPROC)GLH_EXT_GET_PROC_ADDRESS("glPointParameteri"); - glPointParameteriv = (PFNGLPOINTPARAMETERIVPROC)GLH_EXT_GET_PROC_ADDRESS("glPointParameteriv"); - glFogCoordf = (PFNGLFOGCOORDFPROC)GLH_EXT_GET_PROC_ADDRESS("glFogCoordf"); - glFogCoordfv = (PFNGLFOGCOORDFVPROC)GLH_EXT_GET_PROC_ADDRESS("glFogCoordfv"); - glFogCoordd = (PFNGLFOGCOORDDPROC)GLH_EXT_GET_PROC_ADDRESS("glFogCoordd"); - glFogCoorddv = (PFNGLFOGCOORDDVPROC)GLH_EXT_GET_PROC_ADDRESS("glFogCoorddv"); - glFogCoordPointer = (PFNGLFOGCOORDPOINTERPROC)GLH_EXT_GET_PROC_ADDRESS("glFogCoordPointer"); - glSecondaryColor3b = (PFNGLSECONDARYCOLOR3BPROC)GLH_EXT_GET_PROC_ADDRESS("glSecondaryColor3b"); - glSecondaryColor3bv = (PFNGLSECONDARYCOLOR3BVPROC)GLH_EXT_GET_PROC_ADDRESS("glSecondaryColor3bv"); - glSecondaryColor3d = (PFNGLSECONDARYCOLOR3DPROC)GLH_EXT_GET_PROC_ADDRESS("glSecondaryColor3d"); - glSecondaryColor3dv = (PFNGLSECONDARYCOLOR3DVPROC)GLH_EXT_GET_PROC_ADDRESS("glSecondaryColor3dv"); - glSecondaryColor3f = (PFNGLSECONDARYCOLOR3FPROC)GLH_EXT_GET_PROC_ADDRESS("glSecondaryColor3f"); - glSecondaryColor3fv = (PFNGLSECONDARYCOLOR3FVPROC)GLH_EXT_GET_PROC_ADDRESS("glSecondaryColor3fv"); - glSecondaryColor3i = (PFNGLSECONDARYCOLOR3IPROC)GLH_EXT_GET_PROC_ADDRESS("glSecondaryColor3i"); - glSecondaryColor3iv = (PFNGLSECONDARYCOLOR3IVPROC)GLH_EXT_GET_PROC_ADDRESS("glSecondaryColor3iv"); - glSecondaryColor3s = (PFNGLSECONDARYCOLOR3SPROC)GLH_EXT_GET_PROC_ADDRESS("glSecondaryColor3s"); - glSecondaryColor3sv = (PFNGLSECONDARYCOLOR3SVPROC)GLH_EXT_GET_PROC_ADDRESS("glSecondaryColor3sv"); - glSecondaryColor3ub = (PFNGLSECONDARYCOLOR3UBPROC)GLH_EXT_GET_PROC_ADDRESS("glSecondaryColor3ub"); - glSecondaryColor3ubv = (PFNGLSECONDARYCOLOR3UBVPROC)GLH_EXT_GET_PROC_ADDRESS("glSecondaryColor3ubv"); - glSecondaryColor3ui = (PFNGLSECONDARYCOLOR3UIPROC)GLH_EXT_GET_PROC_ADDRESS("glSecondaryColor3ui"); - glSecondaryColor3uiv = (PFNGLSECONDARYCOLOR3UIVPROC)GLH_EXT_GET_PROC_ADDRESS("glSecondaryColor3uiv"); - glSecondaryColor3us = (PFNGLSECONDARYCOLOR3USPROC)GLH_EXT_GET_PROC_ADDRESS("glSecondaryColor3us"); - glSecondaryColor3usv = (PFNGLSECONDARYCOLOR3USVPROC)GLH_EXT_GET_PROC_ADDRESS("glSecondaryColor3usv"); - glSecondaryColorPointer = (PFNGLSECONDARYCOLORPOINTERPROC)GLH_EXT_GET_PROC_ADDRESS("glSecondaryColorPointer"); - glWindowPos2d = (PFNGLWINDOWPOS2DPROC)GLH_EXT_GET_PROC_ADDRESS("glWindowPos2d"); - glWindowPos2dv = (PFNGLWINDOWPOS2DVPROC)GLH_EXT_GET_PROC_ADDRESS("glWindowPos2dv"); - glWindowPos2f = (PFNGLWINDOWPOS2FPROC)GLH_EXT_GET_PROC_ADDRESS("glWindowPos2f"); - glWindowPos2fv = (PFNGLWINDOWPOS2FVPROC)GLH_EXT_GET_PROC_ADDRESS("glWindowPos2fv"); - glWindowPos2i = (PFNGLWINDOWPOS2IPROC)GLH_EXT_GET_PROC_ADDRESS("glWindowPos2i"); - glWindowPos2iv = (PFNGLWINDOWPOS2IVPROC)GLH_EXT_GET_PROC_ADDRESS("glWindowPos2iv"); - glWindowPos2s = (PFNGLWINDOWPOS2SPROC)GLH_EXT_GET_PROC_ADDRESS("glWindowPos2s"); - glWindowPos2sv = (PFNGLWINDOWPOS2SVPROC)GLH_EXT_GET_PROC_ADDRESS("glWindowPos2sv"); - glWindowPos3d = (PFNGLWINDOWPOS3DPROC)GLH_EXT_GET_PROC_ADDRESS("glWindowPos3d"); - glWindowPos3dv = (PFNGLWINDOWPOS3DVPROC)GLH_EXT_GET_PROC_ADDRESS("glWindowPos3dv"); - glWindowPos3f = (PFNGLWINDOWPOS3FPROC)GLH_EXT_GET_PROC_ADDRESS("glWindowPos3f"); - glWindowPos3fv = (PFNGLWINDOWPOS3FVPROC)GLH_EXT_GET_PROC_ADDRESS("glWindowPos3fv"); - glWindowPos3i = (PFNGLWINDOWPOS3IPROC)GLH_EXT_GET_PROC_ADDRESS("glWindowPos3i"); - glWindowPos3iv = (PFNGLWINDOWPOS3IVPROC)GLH_EXT_GET_PROC_ADDRESS("glWindowPos3iv"); - glWindowPos3s = (PFNGLWINDOWPOS3SPROC)GLH_EXT_GET_PROC_ADDRESS("glWindowPos3s"); - glWindowPos3sv = (PFNGLWINDOWPOS3SVPROC)GLH_EXT_GET_PROC_ADDRESS("glWindowPos3sv"); + glBlendFuncSeparate = (PFNGLBLENDFUNCSEPARATEPROC)LL_GET_PROC_ADDRESS("glBlendFuncSeparate"); + glMultiDrawArrays = (PFNGLMULTIDRAWARRAYSPROC)LL_GET_PROC_ADDRESS("glMultiDrawArrays"); + glMultiDrawElements = (PFNGLMULTIDRAWELEMENTSPROC)LL_GET_PROC_ADDRESS("glMultiDrawElements"); + glPointParameterf = (PFNGLPOINTPARAMETERFPROC)LL_GET_PROC_ADDRESS("glPointParameterf"); + glPointParameterfv = (PFNGLPOINTPARAMETERFVPROC)LL_GET_PROC_ADDRESS("glPointParameterfv"); + glPointParameteri = (PFNGLPOINTPARAMETERIPROC)LL_GET_PROC_ADDRESS("glPointParameteri"); + glPointParameteriv = (PFNGLPOINTPARAMETERIVPROC)LL_GET_PROC_ADDRESS("glPointParameteriv"); // GL_VERSION_1_5 if (mGLVersion < 1.49f) { return; } - glGenQueries = (PFNGLGENQUERIESPROC)GLH_EXT_GET_PROC_ADDRESS("glGenQueries"); - glDeleteQueries = (PFNGLDELETEQUERIESPROC)GLH_EXT_GET_PROC_ADDRESS("glDeleteQueries"); - glIsQuery = (PFNGLISQUERYPROC)GLH_EXT_GET_PROC_ADDRESS("glIsQuery"); - glBeginQuery = (PFNGLBEGINQUERYPROC)GLH_EXT_GET_PROC_ADDRESS("glBeginQuery"); - glEndQuery = (PFNGLENDQUERYPROC)GLH_EXT_GET_PROC_ADDRESS("glEndQuery"); - glGetQueryiv = (PFNGLGETQUERYIVPROC)GLH_EXT_GET_PROC_ADDRESS("glGetQueryiv"); - glGetQueryObjectiv = (PFNGLGETQUERYOBJECTIVPROC)GLH_EXT_GET_PROC_ADDRESS("glGetQueryObjectiv"); - glGetQueryObjectuiv = (PFNGLGETQUERYOBJECTUIVPROC)GLH_EXT_GET_PROC_ADDRESS("glGetQueryObjectuiv"); - glBindBuffer = (PFNGLBINDBUFFERPROC)GLH_EXT_GET_PROC_ADDRESS("glBindBuffer"); - glDeleteBuffers = (PFNGLDELETEBUFFERSPROC)GLH_EXT_GET_PROC_ADDRESS("glDeleteBuffers"); - glGenBuffers = (PFNGLGENBUFFERSPROC)GLH_EXT_GET_PROC_ADDRESS("glGenBuffers"); - glIsBuffer = (PFNGLISBUFFERPROC)GLH_EXT_GET_PROC_ADDRESS("glIsBuffer"); - glBufferData = (PFNGLBUFFERDATAPROC)GLH_EXT_GET_PROC_ADDRESS("glBufferData"); - glBufferSubData = (PFNGLBUFFERSUBDATAPROC)GLH_EXT_GET_PROC_ADDRESS("glBufferSubData"); - glGetBufferSubData = (PFNGLGETBUFFERSUBDATAPROC)GLH_EXT_GET_PROC_ADDRESS("glGetBufferSubData"); - glMapBuffer = (PFNGLMAPBUFFERPROC)GLH_EXT_GET_PROC_ADDRESS("glMapBuffer"); - glUnmapBuffer = (PFNGLUNMAPBUFFERPROC)GLH_EXT_GET_PROC_ADDRESS("glUnmapBuffer"); - glGetBufferParameteriv = (PFNGLGETBUFFERPARAMETERIVPROC)GLH_EXT_GET_PROC_ADDRESS("glGetBufferParameteriv"); - glGetBufferPointerv = (PFNGLGETBUFFERPOINTERVPROC)GLH_EXT_GET_PROC_ADDRESS("glGetBufferPointerv"); + glGenQueries = (PFNGLGENQUERIESPROC)LL_GET_PROC_ADDRESS("glGenQueries"); + glDeleteQueries = (PFNGLDELETEQUERIESPROC)LL_GET_PROC_ADDRESS("glDeleteQueries"); + glIsQuery = (PFNGLISQUERYPROC)LL_GET_PROC_ADDRESS("glIsQuery"); + glBeginQuery = (PFNGLBEGINQUERYPROC)LL_GET_PROC_ADDRESS("glBeginQuery"); + glEndQuery = (PFNGLENDQUERYPROC)LL_GET_PROC_ADDRESS("glEndQuery"); + glGetQueryiv = (PFNGLGETQUERYIVPROC)LL_GET_PROC_ADDRESS("glGetQueryiv"); + glGetQueryObjectiv = (PFNGLGETQUERYOBJECTIVPROC)LL_GET_PROC_ADDRESS("glGetQueryObjectiv"); + glGetQueryObjectuiv = (PFNGLGETQUERYOBJECTUIVPROC)LL_GET_PROC_ADDRESS("glGetQueryObjectuiv"); + glBindBuffer = (PFNGLBINDBUFFERPROC)LL_GET_PROC_ADDRESS("glBindBuffer"); + glDeleteBuffers = (PFNGLDELETEBUFFERSPROC)LL_GET_PROC_ADDRESS("glDeleteBuffers"); + glGenBuffers = (PFNGLGENBUFFERSPROC)LL_GET_PROC_ADDRESS("glGenBuffers"); + glIsBuffer = (PFNGLISBUFFERPROC)LL_GET_PROC_ADDRESS("glIsBuffer"); + glBufferData = (PFNGLBUFFERDATAPROC)LL_GET_PROC_ADDRESS("glBufferData"); + glBufferSubData = (PFNGLBUFFERSUBDATAPROC)LL_GET_PROC_ADDRESS("glBufferSubData"); + glGetBufferSubData = (PFNGLGETBUFFERSUBDATAPROC)LL_GET_PROC_ADDRESS("glGetBufferSubData"); + glMapBuffer = (PFNGLMAPBUFFERPROC)LL_GET_PROC_ADDRESS("glMapBuffer"); + glUnmapBuffer = (PFNGLUNMAPBUFFERPROC)LL_GET_PROC_ADDRESS("glUnmapBuffer"); + glGetBufferParameteriv = (PFNGLGETBUFFERPARAMETERIVPROC)LL_GET_PROC_ADDRESS("glGetBufferParameteriv"); + glGetBufferPointerv = (PFNGLGETBUFFERPOINTERVPROC)LL_GET_PROC_ADDRESS("glGetBufferPointerv"); // GL_VERSION_2_0 if (mGLVersion < 1.9f) { return; } - glBlendEquationSeparate = (PFNGLBLENDEQUATIONSEPARATEPROC)GLH_EXT_GET_PROC_ADDRESS("glBlendEquationSeparate"); - glDrawBuffers = (PFNGLDRAWBUFFERSPROC)GLH_EXT_GET_PROC_ADDRESS("glDrawBuffers"); - glStencilOpSeparate = (PFNGLSTENCILOPSEPARATEPROC)GLH_EXT_GET_PROC_ADDRESS("glStencilOpSeparate"); - glStencilFuncSeparate = (PFNGLSTENCILFUNCSEPARATEPROC)GLH_EXT_GET_PROC_ADDRESS("glStencilFuncSeparate"); - glStencilMaskSeparate = (PFNGLSTENCILMASKSEPARATEPROC)GLH_EXT_GET_PROC_ADDRESS("glStencilMaskSeparate"); - glAttachShader = (PFNGLATTACHSHADERPROC)GLH_EXT_GET_PROC_ADDRESS("glAttachShader"); - glBindAttribLocation = (PFNGLBINDATTRIBLOCATIONPROC)GLH_EXT_GET_PROC_ADDRESS("glBindAttribLocation"); - glCompileShader = (PFNGLCOMPILESHADERPROC)GLH_EXT_GET_PROC_ADDRESS("glCompileShader"); - glCreateProgram = (PFNGLCREATEPROGRAMPROC)GLH_EXT_GET_PROC_ADDRESS("glCreateProgram"); - glCreateShader = (PFNGLCREATESHADERPROC)GLH_EXT_GET_PROC_ADDRESS("glCreateShader"); - glDeleteProgram = (PFNGLDELETEPROGRAMPROC)GLH_EXT_GET_PROC_ADDRESS("glDeleteProgram"); - glDeleteShader = (PFNGLDELETESHADERPROC)GLH_EXT_GET_PROC_ADDRESS("glDeleteShader"); - glDetachShader = (PFNGLDETACHSHADERPROC)GLH_EXT_GET_PROC_ADDRESS("glDetachShader"); - glDisableVertexAttribArray = (PFNGLDISABLEVERTEXATTRIBARRAYPROC)GLH_EXT_GET_PROC_ADDRESS("glDisableVertexAttribArray"); - glEnableVertexAttribArray = (PFNGLENABLEVERTEXATTRIBARRAYPROC)GLH_EXT_GET_PROC_ADDRESS("glEnableVertexAttribArray"); - glGetActiveAttrib = (PFNGLGETACTIVEATTRIBPROC)GLH_EXT_GET_PROC_ADDRESS("glGetActiveAttrib"); - glGetActiveUniform = (PFNGLGETACTIVEUNIFORMPROC)GLH_EXT_GET_PROC_ADDRESS("glGetActiveUniform"); - glGetAttachedShaders = (PFNGLGETATTACHEDSHADERSPROC)GLH_EXT_GET_PROC_ADDRESS("glGetAttachedShaders"); - glGetAttribLocation = (PFNGLGETATTRIBLOCATIONPROC)GLH_EXT_GET_PROC_ADDRESS("glGetAttribLocation"); - glGetProgramiv = (PFNGLGETPROGRAMIVPROC)GLH_EXT_GET_PROC_ADDRESS("glGetProgramiv"); - glGetProgramInfoLog = (PFNGLGETPROGRAMINFOLOGPROC)GLH_EXT_GET_PROC_ADDRESS("glGetProgramInfoLog"); - glGetShaderiv = (PFNGLGETSHADERIVPROC)GLH_EXT_GET_PROC_ADDRESS("glGetShaderiv"); - glGetShaderInfoLog = (PFNGLGETSHADERINFOLOGPROC)GLH_EXT_GET_PROC_ADDRESS("glGetShaderInfoLog"); - glGetShaderSource = (PFNGLGETSHADERSOURCEPROC)GLH_EXT_GET_PROC_ADDRESS("glGetShaderSource"); - glGetUniformLocation = (PFNGLGETUNIFORMLOCATIONPROC)GLH_EXT_GET_PROC_ADDRESS("glGetUniformLocation"); - glGetUniformfv = (PFNGLGETUNIFORMFVPROC)GLH_EXT_GET_PROC_ADDRESS("glGetUniformfv"); - glGetUniformiv = (PFNGLGETUNIFORMIVPROC)GLH_EXT_GET_PROC_ADDRESS("glGetUniformiv"); - glGetVertexAttribdv = (PFNGLGETVERTEXATTRIBDVPROC)GLH_EXT_GET_PROC_ADDRESS("glGetVertexAttribdv"); - glGetVertexAttribfv = (PFNGLGETVERTEXATTRIBFVPROC)GLH_EXT_GET_PROC_ADDRESS("glGetVertexAttribfv"); - glGetVertexAttribiv = (PFNGLGETVERTEXATTRIBIVPROC)GLH_EXT_GET_PROC_ADDRESS("glGetVertexAttribiv"); - glGetVertexAttribPointerv = (PFNGLGETVERTEXATTRIBPOINTERVPROC)GLH_EXT_GET_PROC_ADDRESS("glGetVertexAttribPointerv"); - glIsProgram = (PFNGLISPROGRAMPROC)GLH_EXT_GET_PROC_ADDRESS("glIsProgram"); - glIsShader = (PFNGLISSHADERPROC)GLH_EXT_GET_PROC_ADDRESS("glIsShader"); - glLinkProgram = (PFNGLLINKPROGRAMPROC)GLH_EXT_GET_PROC_ADDRESS("glLinkProgram"); - glShaderSource = (PFNGLSHADERSOURCEPROC)GLH_EXT_GET_PROC_ADDRESS("glShaderSource"); - glUseProgram = (PFNGLUSEPROGRAMPROC)GLH_EXT_GET_PROC_ADDRESS("glUseProgram"); - glUniform1f = (PFNGLUNIFORM1FPROC)GLH_EXT_GET_PROC_ADDRESS("glUniform1f"); - glUniform2f = (PFNGLUNIFORM2FPROC)GLH_EXT_GET_PROC_ADDRESS("glUniform2f"); - glUniform3f = (PFNGLUNIFORM3FPROC)GLH_EXT_GET_PROC_ADDRESS("glUniform3f"); - glUniform4f = (PFNGLUNIFORM4FPROC)GLH_EXT_GET_PROC_ADDRESS("glUniform4f"); - glUniform1i = (PFNGLUNIFORM1IPROC)GLH_EXT_GET_PROC_ADDRESS("glUniform1i"); - glUniform2i = (PFNGLUNIFORM2IPROC)GLH_EXT_GET_PROC_ADDRESS("glUniform2i"); - glUniform3i = (PFNGLUNIFORM3IPROC)GLH_EXT_GET_PROC_ADDRESS("glUniform3i"); - glUniform4i = (PFNGLUNIFORM4IPROC)GLH_EXT_GET_PROC_ADDRESS("glUniform4i"); - glUniform1fv = (PFNGLUNIFORM1FVPROC)GLH_EXT_GET_PROC_ADDRESS("glUniform1fv"); - glUniform2fv = (PFNGLUNIFORM2FVPROC)GLH_EXT_GET_PROC_ADDRESS("glUniform2fv"); - glUniform3fv = (PFNGLUNIFORM3FVPROC)GLH_EXT_GET_PROC_ADDRESS("glUniform3fv"); - glUniform4fv = (PFNGLUNIFORM4FVPROC)GLH_EXT_GET_PROC_ADDRESS("glUniform4fv"); - glUniform1iv = (PFNGLUNIFORM1IVPROC)GLH_EXT_GET_PROC_ADDRESS("glUniform1iv"); - glUniform2iv = (PFNGLUNIFORM2IVPROC)GLH_EXT_GET_PROC_ADDRESS("glUniform2iv"); - glUniform3iv = (PFNGLUNIFORM3IVPROC)GLH_EXT_GET_PROC_ADDRESS("glUniform3iv"); - glUniform4iv = (PFNGLUNIFORM4IVPROC)GLH_EXT_GET_PROC_ADDRESS("glUniform4iv"); - glUniformMatrix2fv = (PFNGLUNIFORMMATRIX2FVPROC)GLH_EXT_GET_PROC_ADDRESS("glUniformMatrix2fv"); - glUniformMatrix3fv = (PFNGLUNIFORMMATRIX3FVPROC)GLH_EXT_GET_PROC_ADDRESS("glUniformMatrix3fv"); - glUniformMatrix4fv = (PFNGLUNIFORMMATRIX4FVPROC)GLH_EXT_GET_PROC_ADDRESS("glUniformMatrix4fv"); - glValidateProgram = (PFNGLVALIDATEPROGRAMPROC)GLH_EXT_GET_PROC_ADDRESS("glValidateProgram"); - glVertexAttrib1d = (PFNGLVERTEXATTRIB1DPROC)GLH_EXT_GET_PROC_ADDRESS("glVertexAttrib1d"); - glVertexAttrib1dv = (PFNGLVERTEXATTRIB1DVPROC)GLH_EXT_GET_PROC_ADDRESS("glVertexAttrib1dv"); - glVertexAttrib1f = (PFNGLVERTEXATTRIB1FPROC)GLH_EXT_GET_PROC_ADDRESS("glVertexAttrib1f"); - glVertexAttrib1fv = (PFNGLVERTEXATTRIB1FVPROC)GLH_EXT_GET_PROC_ADDRESS("glVertexAttrib1fv"); - glVertexAttrib1s = (PFNGLVERTEXATTRIB1SPROC)GLH_EXT_GET_PROC_ADDRESS("glVertexAttrib1s"); - glVertexAttrib1sv = (PFNGLVERTEXATTRIB1SVPROC)GLH_EXT_GET_PROC_ADDRESS("glVertexAttrib1sv"); - glVertexAttrib2d = (PFNGLVERTEXATTRIB2DPROC)GLH_EXT_GET_PROC_ADDRESS("glVertexAttrib2d"); - glVertexAttrib2dv = (PFNGLVERTEXATTRIB2DVPROC)GLH_EXT_GET_PROC_ADDRESS("glVertexAttrib2dv"); - glVertexAttrib2f = (PFNGLVERTEXATTRIB2FPROC)GLH_EXT_GET_PROC_ADDRESS("glVertexAttrib2f"); - glVertexAttrib2fv = (PFNGLVERTEXATTRIB2FVPROC)GLH_EXT_GET_PROC_ADDRESS("glVertexAttrib2fv"); - glVertexAttrib2s = (PFNGLVERTEXATTRIB2SPROC)GLH_EXT_GET_PROC_ADDRESS("glVertexAttrib2s"); - glVertexAttrib2sv = (PFNGLVERTEXATTRIB2SVPROC)GLH_EXT_GET_PROC_ADDRESS("glVertexAttrib2sv"); - glVertexAttrib3d = (PFNGLVERTEXATTRIB3DPROC)GLH_EXT_GET_PROC_ADDRESS("glVertexAttrib3d"); - glVertexAttrib3dv = (PFNGLVERTEXATTRIB3DVPROC)GLH_EXT_GET_PROC_ADDRESS("glVertexAttrib3dv"); - glVertexAttrib3f = (PFNGLVERTEXATTRIB3FPROC)GLH_EXT_GET_PROC_ADDRESS("glVertexAttrib3f"); - glVertexAttrib3fv = (PFNGLVERTEXATTRIB3FVPROC)GLH_EXT_GET_PROC_ADDRESS("glVertexAttrib3fv"); - glVertexAttrib3s = (PFNGLVERTEXATTRIB3SPROC)GLH_EXT_GET_PROC_ADDRESS("glVertexAttrib3s"); - glVertexAttrib3sv = (PFNGLVERTEXATTRIB3SVPROC)GLH_EXT_GET_PROC_ADDRESS("glVertexAttrib3sv"); - glVertexAttrib4Nbv = (PFNGLVERTEXATTRIB4NBVPROC)GLH_EXT_GET_PROC_ADDRESS("glVertexAttrib4Nbv"); - glVertexAttrib4Niv = (PFNGLVERTEXATTRIB4NIVPROC)GLH_EXT_GET_PROC_ADDRESS("glVertexAttrib4Niv"); - glVertexAttrib4Nsv = (PFNGLVERTEXATTRIB4NSVPROC)GLH_EXT_GET_PROC_ADDRESS("glVertexAttrib4Nsv"); - glVertexAttrib4Nub = (PFNGLVERTEXATTRIB4NUBPROC)GLH_EXT_GET_PROC_ADDRESS("glVertexAttrib4Nub"); - glVertexAttrib4Nubv = (PFNGLVERTEXATTRIB4NUBVPROC)GLH_EXT_GET_PROC_ADDRESS("glVertexAttrib4Nubv"); - glVertexAttrib4Nuiv = (PFNGLVERTEXATTRIB4NUIVPROC)GLH_EXT_GET_PROC_ADDRESS("glVertexAttrib4Nuiv"); - glVertexAttrib4Nusv = (PFNGLVERTEXATTRIB4NUSVPROC)GLH_EXT_GET_PROC_ADDRESS("glVertexAttrib4Nusv"); - glVertexAttrib4bv = (PFNGLVERTEXATTRIB4BVPROC)GLH_EXT_GET_PROC_ADDRESS("glVertexAttrib4bv"); - glVertexAttrib4d = (PFNGLVERTEXATTRIB4DPROC)GLH_EXT_GET_PROC_ADDRESS("glVertexAttrib4d"); - glVertexAttrib4dv = (PFNGLVERTEXATTRIB4DVPROC)GLH_EXT_GET_PROC_ADDRESS("glVertexAttrib4dv"); - glVertexAttrib4f = (PFNGLVERTEXATTRIB4FPROC)GLH_EXT_GET_PROC_ADDRESS("glVertexAttrib4f"); - glVertexAttrib4fv = (PFNGLVERTEXATTRIB4FVPROC)GLH_EXT_GET_PROC_ADDRESS("glVertexAttrib4fv"); - glVertexAttrib4iv = (PFNGLVERTEXATTRIB4IVPROC)GLH_EXT_GET_PROC_ADDRESS("glVertexAttrib4iv"); - glVertexAttrib4s = (PFNGLVERTEXATTRIB4SPROC)GLH_EXT_GET_PROC_ADDRESS("glVertexAttrib4s"); - glVertexAttrib4sv = (PFNGLVERTEXATTRIB4SVPROC)GLH_EXT_GET_PROC_ADDRESS("glVertexAttrib4sv"); - glVertexAttrib4ubv = (PFNGLVERTEXATTRIB4UBVPROC)GLH_EXT_GET_PROC_ADDRESS("glVertexAttrib4ubv"); - glVertexAttrib4uiv = (PFNGLVERTEXATTRIB4UIVPROC)GLH_EXT_GET_PROC_ADDRESS("glVertexAttrib4uiv"); - glVertexAttrib4usv = (PFNGLVERTEXATTRIB4USVPROC)GLH_EXT_GET_PROC_ADDRESS("glVertexAttrib4usv"); - glVertexAttribPointer = (PFNGLVERTEXATTRIBPOINTERPROC)GLH_EXT_GET_PROC_ADDRESS("glVertexAttribPointer"); + glBlendEquationSeparate = (PFNGLBLENDEQUATIONSEPARATEPROC)LL_GET_PROC_ADDRESS("glBlendEquationSeparate"); + glDrawBuffers = (PFNGLDRAWBUFFERSPROC)LL_GET_PROC_ADDRESS("glDrawBuffers"); + glStencilOpSeparate = (PFNGLSTENCILOPSEPARATEPROC)LL_GET_PROC_ADDRESS("glStencilOpSeparate"); + glStencilFuncSeparate = (PFNGLSTENCILFUNCSEPARATEPROC)LL_GET_PROC_ADDRESS("glStencilFuncSeparate"); + glStencilMaskSeparate = (PFNGLSTENCILMASKSEPARATEPROC)LL_GET_PROC_ADDRESS("glStencilMaskSeparate"); + glAttachShader = (PFNGLATTACHSHADERPROC)LL_GET_PROC_ADDRESS("glAttachShader"); + glBindAttribLocation = (PFNGLBINDATTRIBLOCATIONPROC)LL_GET_PROC_ADDRESS("glBindAttribLocation"); + glCompileShader = (PFNGLCOMPILESHADERPROC)LL_GET_PROC_ADDRESS("glCompileShader"); + glCreateProgram = (PFNGLCREATEPROGRAMPROC)LL_GET_PROC_ADDRESS("glCreateProgram"); + glCreateShader = (PFNGLCREATESHADERPROC)LL_GET_PROC_ADDRESS("glCreateShader"); + glDeleteProgram = (PFNGLDELETEPROGRAMPROC)LL_GET_PROC_ADDRESS("glDeleteProgram"); + glDeleteShader = (PFNGLDELETESHADERPROC)LL_GET_PROC_ADDRESS("glDeleteShader"); + glDetachShader = (PFNGLDETACHSHADERPROC)LL_GET_PROC_ADDRESS("glDetachShader"); + glDisableVertexAttribArray = (PFNGLDISABLEVERTEXATTRIBARRAYPROC)LL_GET_PROC_ADDRESS("glDisableVertexAttribArray"); + glEnableVertexAttribArray = (PFNGLENABLEVERTEXATTRIBARRAYPROC)LL_GET_PROC_ADDRESS("glEnableVertexAttribArray"); + glGetActiveAttrib = (PFNGLGETACTIVEATTRIBPROC)LL_GET_PROC_ADDRESS("glGetActiveAttrib"); + glGetActiveUniform = (PFNGLGETACTIVEUNIFORMPROC)LL_GET_PROC_ADDRESS("glGetActiveUniform"); + glGetAttachedShaders = (PFNGLGETATTACHEDSHADERSPROC)LL_GET_PROC_ADDRESS("glGetAttachedShaders"); + glGetAttribLocation = (PFNGLGETATTRIBLOCATIONPROC)LL_GET_PROC_ADDRESS("glGetAttribLocation"); + glGetProgramiv = (PFNGLGETPROGRAMIVPROC)LL_GET_PROC_ADDRESS("glGetProgramiv"); + glGetProgramInfoLog = (PFNGLGETPROGRAMINFOLOGPROC)LL_GET_PROC_ADDRESS("glGetProgramInfoLog"); + glGetShaderiv = (PFNGLGETSHADERIVPROC)LL_GET_PROC_ADDRESS("glGetShaderiv"); + glGetShaderInfoLog = (PFNGLGETSHADERINFOLOGPROC)LL_GET_PROC_ADDRESS("glGetShaderInfoLog"); + glGetShaderSource = (PFNGLGETSHADERSOURCEPROC)LL_GET_PROC_ADDRESS("glGetShaderSource"); + glGetUniformLocation = (PFNGLGETUNIFORMLOCATIONPROC)LL_GET_PROC_ADDRESS("glGetUniformLocation"); + glGetUniformfv = (PFNGLGETUNIFORMFVPROC)LL_GET_PROC_ADDRESS("glGetUniformfv"); + glGetUniformiv = (PFNGLGETUNIFORMIVPROC)LL_GET_PROC_ADDRESS("glGetUniformiv"); + glGetVertexAttribdv = (PFNGLGETVERTEXATTRIBDVPROC)LL_GET_PROC_ADDRESS("glGetVertexAttribdv"); + glGetVertexAttribfv = (PFNGLGETVERTEXATTRIBFVPROC)LL_GET_PROC_ADDRESS("glGetVertexAttribfv"); + glGetVertexAttribiv = (PFNGLGETVERTEXATTRIBIVPROC)LL_GET_PROC_ADDRESS("glGetVertexAttribiv"); + glGetVertexAttribPointerv = (PFNGLGETVERTEXATTRIBPOINTERVPROC)LL_GET_PROC_ADDRESS("glGetVertexAttribPointerv"); + glIsProgram = (PFNGLISPROGRAMPROC)LL_GET_PROC_ADDRESS("glIsProgram"); + glIsShader = (PFNGLISSHADERPROC)LL_GET_PROC_ADDRESS("glIsShader"); + glLinkProgram = (PFNGLLINKPROGRAMPROC)LL_GET_PROC_ADDRESS("glLinkProgram"); + glShaderSource = (PFNGLSHADERSOURCEPROC)LL_GET_PROC_ADDRESS("glShaderSource"); + glUseProgram = (PFNGLUSEPROGRAMPROC)LL_GET_PROC_ADDRESS("glUseProgram"); + glUniform1f = (PFNGLUNIFORM1FPROC)LL_GET_PROC_ADDRESS("glUniform1f"); + glUniform2f = (PFNGLUNIFORM2FPROC)LL_GET_PROC_ADDRESS("glUniform2f"); + glUniform3f = (PFNGLUNIFORM3FPROC)LL_GET_PROC_ADDRESS("glUniform3f"); + glUniform4f = (PFNGLUNIFORM4FPROC)LL_GET_PROC_ADDRESS("glUniform4f"); + glUniform1i = (PFNGLUNIFORM1IPROC)LL_GET_PROC_ADDRESS("glUniform1i"); + glUniform2i = (PFNGLUNIFORM2IPROC)LL_GET_PROC_ADDRESS("glUniform2i"); + glUniform3i = (PFNGLUNIFORM3IPROC)LL_GET_PROC_ADDRESS("glUniform3i"); + glUniform4i = (PFNGLUNIFORM4IPROC)LL_GET_PROC_ADDRESS("glUniform4i"); + glUniform1fv = (PFNGLUNIFORM1FVPROC)LL_GET_PROC_ADDRESS("glUniform1fv"); + glUniform2fv = (PFNGLUNIFORM2FVPROC)LL_GET_PROC_ADDRESS("glUniform2fv"); + glUniform3fv = (PFNGLUNIFORM3FVPROC)LL_GET_PROC_ADDRESS("glUniform3fv"); + glUniform4fv = (PFNGLUNIFORM4FVPROC)LL_GET_PROC_ADDRESS("glUniform4fv"); + glUniform1iv = (PFNGLUNIFORM1IVPROC)LL_GET_PROC_ADDRESS("glUniform1iv"); + glUniform2iv = (PFNGLUNIFORM2IVPROC)LL_GET_PROC_ADDRESS("glUniform2iv"); + glUniform3iv = (PFNGLUNIFORM3IVPROC)LL_GET_PROC_ADDRESS("glUniform3iv"); + glUniform4iv = (PFNGLUNIFORM4IVPROC)LL_GET_PROC_ADDRESS("glUniform4iv"); + glUniformMatrix2fv = (PFNGLUNIFORMMATRIX2FVPROC)LL_GET_PROC_ADDRESS("glUniformMatrix2fv"); + glUniformMatrix3fv = (PFNGLUNIFORMMATRIX3FVPROC)LL_GET_PROC_ADDRESS("glUniformMatrix3fv"); + glUniformMatrix4fv = (PFNGLUNIFORMMATRIX4FVPROC)LL_GET_PROC_ADDRESS("glUniformMatrix4fv"); + glValidateProgram = (PFNGLVALIDATEPROGRAMPROC)LL_GET_PROC_ADDRESS("glValidateProgram"); + glVertexAttrib1d = (PFNGLVERTEXATTRIB1DPROC)LL_GET_PROC_ADDRESS("glVertexAttrib1d"); + glVertexAttrib1dv = (PFNGLVERTEXATTRIB1DVPROC)LL_GET_PROC_ADDRESS("glVertexAttrib1dv"); + glVertexAttrib1f = (PFNGLVERTEXATTRIB1FPROC)LL_GET_PROC_ADDRESS("glVertexAttrib1f"); + glVertexAttrib1fv = (PFNGLVERTEXATTRIB1FVPROC)LL_GET_PROC_ADDRESS("glVertexAttrib1fv"); + glVertexAttrib1s = (PFNGLVERTEXATTRIB1SPROC)LL_GET_PROC_ADDRESS("glVertexAttrib1s"); + glVertexAttrib1sv = (PFNGLVERTEXATTRIB1SVPROC)LL_GET_PROC_ADDRESS("glVertexAttrib1sv"); + glVertexAttrib2d = (PFNGLVERTEXATTRIB2DPROC)LL_GET_PROC_ADDRESS("glVertexAttrib2d"); + glVertexAttrib2dv = (PFNGLVERTEXATTRIB2DVPROC)LL_GET_PROC_ADDRESS("glVertexAttrib2dv"); + glVertexAttrib2f = (PFNGLVERTEXATTRIB2FPROC)LL_GET_PROC_ADDRESS("glVertexAttrib2f"); + glVertexAttrib2fv = (PFNGLVERTEXATTRIB2FVPROC)LL_GET_PROC_ADDRESS("glVertexAttrib2fv"); + glVertexAttrib2s = (PFNGLVERTEXATTRIB2SPROC)LL_GET_PROC_ADDRESS("glVertexAttrib2s"); + glVertexAttrib2sv = (PFNGLVERTEXATTRIB2SVPROC)LL_GET_PROC_ADDRESS("glVertexAttrib2sv"); + glVertexAttrib3d = (PFNGLVERTEXATTRIB3DPROC)LL_GET_PROC_ADDRESS("glVertexAttrib3d"); + glVertexAttrib3dv = (PFNGLVERTEXATTRIB3DVPROC)LL_GET_PROC_ADDRESS("glVertexAttrib3dv"); + glVertexAttrib3f = (PFNGLVERTEXATTRIB3FPROC)LL_GET_PROC_ADDRESS("glVertexAttrib3f"); + glVertexAttrib3fv = (PFNGLVERTEXATTRIB3FVPROC)LL_GET_PROC_ADDRESS("glVertexAttrib3fv"); + glVertexAttrib3s = (PFNGLVERTEXATTRIB3SPROC)LL_GET_PROC_ADDRESS("glVertexAttrib3s"); + glVertexAttrib3sv = (PFNGLVERTEXATTRIB3SVPROC)LL_GET_PROC_ADDRESS("glVertexAttrib3sv"); + glVertexAttrib4Nbv = (PFNGLVERTEXATTRIB4NBVPROC)LL_GET_PROC_ADDRESS("glVertexAttrib4Nbv"); + glVertexAttrib4Niv = (PFNGLVERTEXATTRIB4NIVPROC)LL_GET_PROC_ADDRESS("glVertexAttrib4Niv"); + glVertexAttrib4Nsv = (PFNGLVERTEXATTRIB4NSVPROC)LL_GET_PROC_ADDRESS("glVertexAttrib4Nsv"); + glVertexAttrib4Nub = (PFNGLVERTEXATTRIB4NUBPROC)LL_GET_PROC_ADDRESS("glVertexAttrib4Nub"); + glVertexAttrib4Nubv = (PFNGLVERTEXATTRIB4NUBVPROC)LL_GET_PROC_ADDRESS("glVertexAttrib4Nubv"); + glVertexAttrib4Nuiv = (PFNGLVERTEXATTRIB4NUIVPROC)LL_GET_PROC_ADDRESS("glVertexAttrib4Nuiv"); + glVertexAttrib4Nusv = (PFNGLVERTEXATTRIB4NUSVPROC)LL_GET_PROC_ADDRESS("glVertexAttrib4Nusv"); + glVertexAttrib4bv = (PFNGLVERTEXATTRIB4BVPROC)LL_GET_PROC_ADDRESS("glVertexAttrib4bv"); + glVertexAttrib4d = (PFNGLVERTEXATTRIB4DPROC)LL_GET_PROC_ADDRESS("glVertexAttrib4d"); + glVertexAttrib4dv = (PFNGLVERTEXATTRIB4DVPROC)LL_GET_PROC_ADDRESS("glVertexAttrib4dv"); + glVertexAttrib4f = (PFNGLVERTEXATTRIB4FPROC)LL_GET_PROC_ADDRESS("glVertexAttrib4f"); + glVertexAttrib4fv = (PFNGLVERTEXATTRIB4FVPROC)LL_GET_PROC_ADDRESS("glVertexAttrib4fv"); + glVertexAttrib4iv = (PFNGLVERTEXATTRIB4IVPROC)LL_GET_PROC_ADDRESS("glVertexAttrib4iv"); + glVertexAttrib4s = (PFNGLVERTEXATTRIB4SPROC)LL_GET_PROC_ADDRESS("glVertexAttrib4s"); + glVertexAttrib4sv = (PFNGLVERTEXATTRIB4SVPROC)LL_GET_PROC_ADDRESS("glVertexAttrib4sv"); + glVertexAttrib4ubv = (PFNGLVERTEXATTRIB4UBVPROC)LL_GET_PROC_ADDRESS("glVertexAttrib4ubv"); + glVertexAttrib4uiv = (PFNGLVERTEXATTRIB4UIVPROC)LL_GET_PROC_ADDRESS("glVertexAttrib4uiv"); + glVertexAttrib4usv = (PFNGLVERTEXATTRIB4USVPROC)LL_GET_PROC_ADDRESS("glVertexAttrib4usv"); + glVertexAttribPointer = (PFNGLVERTEXATTRIBPOINTERPROC)LL_GET_PROC_ADDRESS("glVertexAttribPointer"); // GL_VERSION_2_1 if (mGLVersion < 2.09f) { return; } - glUniformMatrix2x3fv = (PFNGLUNIFORMMATRIX2X3FVPROC)GLH_EXT_GET_PROC_ADDRESS("glUniformMatrix2x3fv"); - glUniformMatrix3x2fv = (PFNGLUNIFORMMATRIX3X2FVPROC)GLH_EXT_GET_PROC_ADDRESS("glUniformMatrix3x2fv"); - glUniformMatrix2x4fv = (PFNGLUNIFORMMATRIX2X4FVPROC)GLH_EXT_GET_PROC_ADDRESS("glUniformMatrix2x4fv"); - glUniformMatrix4x2fv = (PFNGLUNIFORMMATRIX4X2FVPROC)GLH_EXT_GET_PROC_ADDRESS("glUniformMatrix4x2fv"); - glUniformMatrix3x4fv = (PFNGLUNIFORMMATRIX3X4FVPROC)GLH_EXT_GET_PROC_ADDRESS("glUniformMatrix3x4fv"); - glUniformMatrix4x3fv = (PFNGLUNIFORMMATRIX4X3FVPROC)GLH_EXT_GET_PROC_ADDRESS("glUniformMatrix4x3fv"); + glUniformMatrix2x3fv = (PFNGLUNIFORMMATRIX2X3FVPROC)LL_GET_PROC_ADDRESS("glUniformMatrix2x3fv"); + glUniformMatrix3x2fv = (PFNGLUNIFORMMATRIX3X2FVPROC)LL_GET_PROC_ADDRESS("glUniformMatrix3x2fv"); + glUniformMatrix2x4fv = (PFNGLUNIFORMMATRIX2X4FVPROC)LL_GET_PROC_ADDRESS("glUniformMatrix2x4fv"); + glUniformMatrix4x2fv = (PFNGLUNIFORMMATRIX4X2FVPROC)LL_GET_PROC_ADDRESS("glUniformMatrix4x2fv"); + glUniformMatrix3x4fv = (PFNGLUNIFORMMATRIX3X4FVPROC)LL_GET_PROC_ADDRESS("glUniformMatrix3x4fv"); + glUniformMatrix4x3fv = (PFNGLUNIFORMMATRIX4X3FVPROC)LL_GET_PROC_ADDRESS("glUniformMatrix4x3fv"); // GL_VERSION_3_0 if (mGLVersion < 2.99f) { return; } - glColorMaski = (PFNGLCOLORMASKIPROC)GLH_EXT_GET_PROC_ADDRESS("glColorMaski"); - glGetBooleani_v = (PFNGLGETBOOLEANI_VPROC)GLH_EXT_GET_PROC_ADDRESS("glGetBooleani_v"); - glGetIntegeri_v = (PFNGLGETINTEGERI_VPROC)GLH_EXT_GET_PROC_ADDRESS("glGetIntegeri_v"); - glEnablei = (PFNGLENABLEIPROC)GLH_EXT_GET_PROC_ADDRESS("glEnablei"); - glDisablei = (PFNGLDISABLEIPROC)GLH_EXT_GET_PROC_ADDRESS("glDisablei"); - glIsEnabledi = (PFNGLISENABLEDIPROC)GLH_EXT_GET_PROC_ADDRESS("glIsEnabledi"); - glBeginTransformFeedback = (PFNGLBEGINTRANSFORMFEEDBACKPROC)GLH_EXT_GET_PROC_ADDRESS("glBeginTransformFeedback"); - glEndTransformFeedback = (PFNGLENDTRANSFORMFEEDBACKPROC)GLH_EXT_GET_PROC_ADDRESS("glEndTransformFeedback"); - glBindBufferRange = (PFNGLBINDBUFFERRANGEPROC)GLH_EXT_GET_PROC_ADDRESS("glBindBufferRange"); - glBindBufferBase = (PFNGLBINDBUFFERBASEPROC)GLH_EXT_GET_PROC_ADDRESS("glBindBufferBase"); - glTransformFeedbackVaryings = (PFNGLTRANSFORMFEEDBACKVARYINGSPROC)GLH_EXT_GET_PROC_ADDRESS("glTransformFeedbackVaryings"); - glGetTransformFeedbackVarying = (PFNGLGETTRANSFORMFEEDBACKVARYINGPROC)GLH_EXT_GET_PROC_ADDRESS("glGetTransformFeedbackVarying"); - glClampColor = (PFNGLCLAMPCOLORPROC)GLH_EXT_GET_PROC_ADDRESS("glClampColor"); - glBeginConditionalRender = (PFNGLBEGINCONDITIONALRENDERPROC)GLH_EXT_GET_PROC_ADDRESS("glBeginConditionalRender"); - glEndConditionalRender = (PFNGLENDCONDITIONALRENDERPROC)GLH_EXT_GET_PROC_ADDRESS("glEndConditionalRender"); - glVertexAttribIPointer = (PFNGLVERTEXATTRIBIPOINTERPROC)GLH_EXT_GET_PROC_ADDRESS("glVertexAttribIPointer"); - glGetVertexAttribIiv = (PFNGLGETVERTEXATTRIBIIVPROC)GLH_EXT_GET_PROC_ADDRESS("glGetVertexAttribIiv"); - glGetVertexAttribIuiv = (PFNGLGETVERTEXATTRIBIUIVPROC)GLH_EXT_GET_PROC_ADDRESS("glGetVertexAttribIuiv"); - glVertexAttribI1i = (PFNGLVERTEXATTRIBI1IPROC)GLH_EXT_GET_PROC_ADDRESS("glVertexAttribI1i"); - glVertexAttribI2i = (PFNGLVERTEXATTRIBI2IPROC)GLH_EXT_GET_PROC_ADDRESS("glVertexAttribI2i"); - glVertexAttribI3i = (PFNGLVERTEXATTRIBI3IPROC)GLH_EXT_GET_PROC_ADDRESS("glVertexAttribI3i"); - glVertexAttribI4i = (PFNGLVERTEXATTRIBI4IPROC)GLH_EXT_GET_PROC_ADDRESS("glVertexAttribI4i"); - glVertexAttribI1ui = (PFNGLVERTEXATTRIBI1UIPROC)GLH_EXT_GET_PROC_ADDRESS("glVertexAttribI1ui"); - glVertexAttribI2ui = (PFNGLVERTEXATTRIBI2UIPROC)GLH_EXT_GET_PROC_ADDRESS("glVertexAttribI2ui"); - glVertexAttribI3ui = (PFNGLVERTEXATTRIBI3UIPROC)GLH_EXT_GET_PROC_ADDRESS("glVertexAttribI3ui"); - glVertexAttribI4ui = (PFNGLVERTEXATTRIBI4UIPROC)GLH_EXT_GET_PROC_ADDRESS("glVertexAttribI4ui"); - glVertexAttribI1iv = (PFNGLVERTEXATTRIBI1IVPROC)GLH_EXT_GET_PROC_ADDRESS("glVertexAttribI1iv"); - glVertexAttribI2iv = (PFNGLVERTEXATTRIBI2IVPROC)GLH_EXT_GET_PROC_ADDRESS("glVertexAttribI2iv"); - glVertexAttribI3iv = (PFNGLVERTEXATTRIBI3IVPROC)GLH_EXT_GET_PROC_ADDRESS("glVertexAttribI3iv"); - glVertexAttribI4iv = (PFNGLVERTEXATTRIBI4IVPROC)GLH_EXT_GET_PROC_ADDRESS("glVertexAttribI4iv"); - glVertexAttribI1uiv = (PFNGLVERTEXATTRIBI1UIVPROC)GLH_EXT_GET_PROC_ADDRESS("glVertexAttribI1uiv"); - glVertexAttribI2uiv = (PFNGLVERTEXATTRIBI2UIVPROC)GLH_EXT_GET_PROC_ADDRESS("glVertexAttribI2uiv"); - glVertexAttribI3uiv = (PFNGLVERTEXATTRIBI3UIVPROC)GLH_EXT_GET_PROC_ADDRESS("glVertexAttribI3uiv"); - glVertexAttribI4uiv = (PFNGLVERTEXATTRIBI4UIVPROC)GLH_EXT_GET_PROC_ADDRESS("glVertexAttribI4uiv"); - glVertexAttribI4bv = (PFNGLVERTEXATTRIBI4BVPROC)GLH_EXT_GET_PROC_ADDRESS("glVertexAttribI4bv"); - glVertexAttribI4sv = (PFNGLVERTEXATTRIBI4SVPROC)GLH_EXT_GET_PROC_ADDRESS("glVertexAttribI4sv"); - glVertexAttribI4ubv = (PFNGLVERTEXATTRIBI4UBVPROC)GLH_EXT_GET_PROC_ADDRESS("glVertexAttribI4ubv"); - glVertexAttribI4usv = (PFNGLVERTEXATTRIBI4USVPROC)GLH_EXT_GET_PROC_ADDRESS("glVertexAttribI4usv"); - glGetUniformuiv = (PFNGLGETUNIFORMUIVPROC)GLH_EXT_GET_PROC_ADDRESS("glGetUniformuiv"); - glBindFragDataLocation = (PFNGLBINDFRAGDATALOCATIONPROC)GLH_EXT_GET_PROC_ADDRESS("glBindFragDataLocation"); - glGetFragDataLocation = (PFNGLGETFRAGDATALOCATIONPROC)GLH_EXT_GET_PROC_ADDRESS("glGetFragDataLocation"); - glUniform1ui = (PFNGLUNIFORM1UIPROC)GLH_EXT_GET_PROC_ADDRESS("glUniform1ui"); - glUniform2ui = (PFNGLUNIFORM2UIPROC)GLH_EXT_GET_PROC_ADDRESS("glUniform2ui"); - glUniform3ui = (PFNGLUNIFORM3UIPROC)GLH_EXT_GET_PROC_ADDRESS("glUniform3ui"); - glUniform4ui = (PFNGLUNIFORM4UIPROC)GLH_EXT_GET_PROC_ADDRESS("glUniform4ui"); - glUniform1uiv = (PFNGLUNIFORM1UIVPROC)GLH_EXT_GET_PROC_ADDRESS("glUniform1uiv"); - glUniform2uiv = (PFNGLUNIFORM2UIVPROC)GLH_EXT_GET_PROC_ADDRESS("glUniform2uiv"); - glUniform3uiv = (PFNGLUNIFORM3UIVPROC)GLH_EXT_GET_PROC_ADDRESS("glUniform3uiv"); - glUniform4uiv = (PFNGLUNIFORM4UIVPROC)GLH_EXT_GET_PROC_ADDRESS("glUniform4uiv"); - glTexParameterIiv = (PFNGLTEXPARAMETERIIVPROC)GLH_EXT_GET_PROC_ADDRESS("glTexParameterIiv"); - glTexParameterIuiv = (PFNGLTEXPARAMETERIUIVPROC)GLH_EXT_GET_PROC_ADDRESS("glTexParameterIuiv"); - glGetTexParameterIiv = (PFNGLGETTEXPARAMETERIIVPROC)GLH_EXT_GET_PROC_ADDRESS("glGetTexParameterIiv"); - glGetTexParameterIuiv = (PFNGLGETTEXPARAMETERIUIVPROC)GLH_EXT_GET_PROC_ADDRESS("glGetTexParameterIuiv"); - glClearBufferiv = (PFNGLCLEARBUFFERIVPROC)GLH_EXT_GET_PROC_ADDRESS("glClearBufferiv"); - glClearBufferuiv = (PFNGLCLEARBUFFERUIVPROC)GLH_EXT_GET_PROC_ADDRESS("glClearBufferuiv"); - glClearBufferfv = (PFNGLCLEARBUFFERFVPROC)GLH_EXT_GET_PROC_ADDRESS("glClearBufferfv"); - glClearBufferfi = (PFNGLCLEARBUFFERFIPROC)GLH_EXT_GET_PROC_ADDRESS("glClearBufferfi"); - glGetStringi = (PFNGLGETSTRINGIPROC)GLH_EXT_GET_PROC_ADDRESS("glGetStringi"); - glIsRenderbuffer = (PFNGLISRENDERBUFFERPROC)GLH_EXT_GET_PROC_ADDRESS("glIsRenderbuffer"); - glBindRenderbuffer = (PFNGLBINDRENDERBUFFERPROC)GLH_EXT_GET_PROC_ADDRESS("glBindRenderbuffer"); - glDeleteRenderbuffers = (PFNGLDELETERENDERBUFFERSPROC)GLH_EXT_GET_PROC_ADDRESS("glDeleteRenderbuffers"); - glGenRenderbuffers = (PFNGLGENRENDERBUFFERSPROC)GLH_EXT_GET_PROC_ADDRESS("glGenRenderbuffers"); - glRenderbufferStorage = (PFNGLRENDERBUFFERSTORAGEPROC)GLH_EXT_GET_PROC_ADDRESS("glRenderbufferStorage"); - glGetRenderbufferParameteriv = (PFNGLGETRENDERBUFFERPARAMETERIVPROC)GLH_EXT_GET_PROC_ADDRESS("glGetRenderbufferParameteriv"); - glIsFramebuffer = (PFNGLISFRAMEBUFFERPROC)GLH_EXT_GET_PROC_ADDRESS("glIsFramebuffer"); - glBindFramebuffer = (PFNGLBINDFRAMEBUFFERPROC)GLH_EXT_GET_PROC_ADDRESS("glBindFramebuffer"); - glDeleteFramebuffers = (PFNGLDELETEFRAMEBUFFERSPROC)GLH_EXT_GET_PROC_ADDRESS("glDeleteFramebuffers"); - glGenFramebuffers = (PFNGLGENFRAMEBUFFERSPROC)GLH_EXT_GET_PROC_ADDRESS("glGenFramebuffers"); - glCheckFramebufferStatus = (PFNGLCHECKFRAMEBUFFERSTATUSPROC)GLH_EXT_GET_PROC_ADDRESS("glCheckFramebufferStatus"); - glFramebufferTexture1D = (PFNGLFRAMEBUFFERTEXTURE1DPROC)GLH_EXT_GET_PROC_ADDRESS("glFramebufferTexture1D"); - glFramebufferTexture2D = (PFNGLFRAMEBUFFERTEXTURE2DPROC)GLH_EXT_GET_PROC_ADDRESS("glFramebufferTexture2D"); - glFramebufferTexture3D = (PFNGLFRAMEBUFFERTEXTURE3DPROC)GLH_EXT_GET_PROC_ADDRESS("glFramebufferTexture3D"); - glFramebufferRenderbuffer = (PFNGLFRAMEBUFFERRENDERBUFFERPROC)GLH_EXT_GET_PROC_ADDRESS("glFramebufferRenderbuffer"); - glGetFramebufferAttachmentParameteriv = (PFNGLGETFRAMEBUFFERATTACHMENTPARAMETERIVPROC)GLH_EXT_GET_PROC_ADDRESS("glGetFramebufferAttachmentParameteriv"); - glGenerateMipmap = (PFNGLGENERATEMIPMAPPROC)GLH_EXT_GET_PROC_ADDRESS("glGenerateMipmap"); - glBlitFramebuffer = (PFNGLBLITFRAMEBUFFERPROC)GLH_EXT_GET_PROC_ADDRESS("glBlitFramebuffer"); - glRenderbufferStorageMultisample = (PFNGLRENDERBUFFERSTORAGEMULTISAMPLEPROC)GLH_EXT_GET_PROC_ADDRESS("glRenderbufferStorageMultisample"); - glFramebufferTextureLayer = (PFNGLFRAMEBUFFERTEXTURELAYERPROC)GLH_EXT_GET_PROC_ADDRESS("glFramebufferTextureLayer"); - glMapBufferRange = (PFNGLMAPBUFFERRANGEPROC)GLH_EXT_GET_PROC_ADDRESS("glMapBufferRange"); - glFlushMappedBufferRange = (PFNGLFLUSHMAPPEDBUFFERRANGEPROC)GLH_EXT_GET_PROC_ADDRESS("glFlushMappedBufferRange"); - glBindVertexArray = (PFNGLBINDVERTEXARRAYPROC)GLH_EXT_GET_PROC_ADDRESS("glBindVertexArray"); - glDeleteVertexArrays = (PFNGLDELETEVERTEXARRAYSPROC)GLH_EXT_GET_PROC_ADDRESS("glDeleteVertexArrays"); - glGenVertexArrays = (PFNGLGENVERTEXARRAYSPROC)GLH_EXT_GET_PROC_ADDRESS("glGenVertexArrays"); - glIsVertexArray = (PFNGLISVERTEXARRAYPROC)GLH_EXT_GET_PROC_ADDRESS("glIsVertexArray"); + glColorMaski = (PFNGLCOLORMASKIPROC)LL_GET_PROC_ADDRESS("glColorMaski"); + glGetBooleani_v = (PFNGLGETBOOLEANI_VPROC)LL_GET_PROC_ADDRESS("glGetBooleani_v"); + glGetIntegeri_v = (PFNGLGETINTEGERI_VPROC)LL_GET_PROC_ADDRESS("glGetIntegeri_v"); + glEnablei = (PFNGLENABLEIPROC)LL_GET_PROC_ADDRESS("glEnablei"); + glDisablei = (PFNGLDISABLEIPROC)LL_GET_PROC_ADDRESS("glDisablei"); + glIsEnabledi = (PFNGLISENABLEDIPROC)LL_GET_PROC_ADDRESS("glIsEnabledi"); + glBeginTransformFeedback = (PFNGLBEGINTRANSFORMFEEDBACKPROC)LL_GET_PROC_ADDRESS("glBeginTransformFeedback"); + glEndTransformFeedback = (PFNGLENDTRANSFORMFEEDBACKPROC)LL_GET_PROC_ADDRESS("glEndTransformFeedback"); + glBindBufferRange = (PFNGLBINDBUFFERRANGEPROC)LL_GET_PROC_ADDRESS("glBindBufferRange"); + glBindBufferBase = (PFNGLBINDBUFFERBASEPROC)LL_GET_PROC_ADDRESS("glBindBufferBase"); + glTransformFeedbackVaryings = (PFNGLTRANSFORMFEEDBACKVARYINGSPROC)LL_GET_PROC_ADDRESS("glTransformFeedbackVaryings"); + glGetTransformFeedbackVarying = (PFNGLGETTRANSFORMFEEDBACKVARYINGPROC)LL_GET_PROC_ADDRESS("glGetTransformFeedbackVarying"); + glClampColor = (PFNGLCLAMPCOLORPROC)LL_GET_PROC_ADDRESS("glClampColor"); + glBeginConditionalRender = (PFNGLBEGINCONDITIONALRENDERPROC)LL_GET_PROC_ADDRESS("glBeginConditionalRender"); + glEndConditionalRender = (PFNGLENDCONDITIONALRENDERPROC)LL_GET_PROC_ADDRESS("glEndConditionalRender"); + glVertexAttribIPointer = (PFNGLVERTEXATTRIBIPOINTERPROC)LL_GET_PROC_ADDRESS("glVertexAttribIPointer"); + glGetVertexAttribIiv = (PFNGLGETVERTEXATTRIBIIVPROC)LL_GET_PROC_ADDRESS("glGetVertexAttribIiv"); + glGetVertexAttribIuiv = (PFNGLGETVERTEXATTRIBIUIVPROC)LL_GET_PROC_ADDRESS("glGetVertexAttribIuiv"); + glVertexAttribI1i = (PFNGLVERTEXATTRIBI1IPROC)LL_GET_PROC_ADDRESS("glVertexAttribI1i"); + glVertexAttribI2i = (PFNGLVERTEXATTRIBI2IPROC)LL_GET_PROC_ADDRESS("glVertexAttribI2i"); + glVertexAttribI3i = (PFNGLVERTEXATTRIBI3IPROC)LL_GET_PROC_ADDRESS("glVertexAttribI3i"); + glVertexAttribI4i = (PFNGLVERTEXATTRIBI4IPROC)LL_GET_PROC_ADDRESS("glVertexAttribI4i"); + glVertexAttribI1ui = (PFNGLVERTEXATTRIBI1UIPROC)LL_GET_PROC_ADDRESS("glVertexAttribI1ui"); + glVertexAttribI2ui = (PFNGLVERTEXATTRIBI2UIPROC)LL_GET_PROC_ADDRESS("glVertexAttribI2ui"); + glVertexAttribI3ui = (PFNGLVERTEXATTRIBI3UIPROC)LL_GET_PROC_ADDRESS("glVertexAttribI3ui"); + glVertexAttribI4ui = (PFNGLVERTEXATTRIBI4UIPROC)LL_GET_PROC_ADDRESS("glVertexAttribI4ui"); + glVertexAttribI1iv = (PFNGLVERTEXATTRIBI1IVPROC)LL_GET_PROC_ADDRESS("glVertexAttribI1iv"); + glVertexAttribI2iv = (PFNGLVERTEXATTRIBI2IVPROC)LL_GET_PROC_ADDRESS("glVertexAttribI2iv"); + glVertexAttribI3iv = (PFNGLVERTEXATTRIBI3IVPROC)LL_GET_PROC_ADDRESS("glVertexAttribI3iv"); + glVertexAttribI4iv = (PFNGLVERTEXATTRIBI4IVPROC)LL_GET_PROC_ADDRESS("glVertexAttribI4iv"); + glVertexAttribI1uiv = (PFNGLVERTEXATTRIBI1UIVPROC)LL_GET_PROC_ADDRESS("glVertexAttribI1uiv"); + glVertexAttribI2uiv = (PFNGLVERTEXATTRIBI2UIVPROC)LL_GET_PROC_ADDRESS("glVertexAttribI2uiv"); + glVertexAttribI3uiv = (PFNGLVERTEXATTRIBI3UIVPROC)LL_GET_PROC_ADDRESS("glVertexAttribI3uiv"); + glVertexAttribI4uiv = (PFNGLVERTEXATTRIBI4UIVPROC)LL_GET_PROC_ADDRESS("glVertexAttribI4uiv"); + glVertexAttribI4bv = (PFNGLVERTEXATTRIBI4BVPROC)LL_GET_PROC_ADDRESS("glVertexAttribI4bv"); + glVertexAttribI4sv = (PFNGLVERTEXATTRIBI4SVPROC)LL_GET_PROC_ADDRESS("glVertexAttribI4sv"); + glVertexAttribI4ubv = (PFNGLVERTEXATTRIBI4UBVPROC)LL_GET_PROC_ADDRESS("glVertexAttribI4ubv"); + glVertexAttribI4usv = (PFNGLVERTEXATTRIBI4USVPROC)LL_GET_PROC_ADDRESS("glVertexAttribI4usv"); + glGetUniformuiv = (PFNGLGETUNIFORMUIVPROC)LL_GET_PROC_ADDRESS("glGetUniformuiv"); + glBindFragDataLocation = (PFNGLBINDFRAGDATALOCATIONPROC)LL_GET_PROC_ADDRESS("glBindFragDataLocation"); + glGetFragDataLocation = (PFNGLGETFRAGDATALOCATIONPROC)LL_GET_PROC_ADDRESS("glGetFragDataLocation"); + glUniform1ui = (PFNGLUNIFORM1UIPROC)LL_GET_PROC_ADDRESS("glUniform1ui"); + glUniform2ui = (PFNGLUNIFORM2UIPROC)LL_GET_PROC_ADDRESS("glUniform2ui"); + glUniform3ui = (PFNGLUNIFORM3UIPROC)LL_GET_PROC_ADDRESS("glUniform3ui"); + glUniform4ui = (PFNGLUNIFORM4UIPROC)LL_GET_PROC_ADDRESS("glUniform4ui"); + glUniform1uiv = (PFNGLUNIFORM1UIVPROC)LL_GET_PROC_ADDRESS("glUniform1uiv"); + glUniform2uiv = (PFNGLUNIFORM2UIVPROC)LL_GET_PROC_ADDRESS("glUniform2uiv"); + glUniform3uiv = (PFNGLUNIFORM3UIVPROC)LL_GET_PROC_ADDRESS("glUniform3uiv"); + glUniform4uiv = (PFNGLUNIFORM4UIVPROC)LL_GET_PROC_ADDRESS("glUniform4uiv"); + glTexParameterIiv = (PFNGLTEXPARAMETERIIVPROC)LL_GET_PROC_ADDRESS("glTexParameterIiv"); + glTexParameterIuiv = (PFNGLTEXPARAMETERIUIVPROC)LL_GET_PROC_ADDRESS("glTexParameterIuiv"); + glGetTexParameterIiv = (PFNGLGETTEXPARAMETERIIVPROC)LL_GET_PROC_ADDRESS("glGetTexParameterIiv"); + glGetTexParameterIuiv = (PFNGLGETTEXPARAMETERIUIVPROC)LL_GET_PROC_ADDRESS("glGetTexParameterIuiv"); + glClearBufferiv = (PFNGLCLEARBUFFERIVPROC)LL_GET_PROC_ADDRESS("glClearBufferiv"); + glClearBufferuiv = (PFNGLCLEARBUFFERUIVPROC)LL_GET_PROC_ADDRESS("glClearBufferuiv"); + glClearBufferfv = (PFNGLCLEARBUFFERFVPROC)LL_GET_PROC_ADDRESS("glClearBufferfv"); + glClearBufferfi = (PFNGLCLEARBUFFERFIPROC)LL_GET_PROC_ADDRESS("glClearBufferfi"); + glGetStringi = (PFNGLGETSTRINGIPROC)LL_GET_PROC_ADDRESS("glGetStringi"); + glIsRenderbuffer = (PFNGLISRENDERBUFFERPROC)LL_GET_PROC_ADDRESS("glIsRenderbuffer"); + glBindRenderbuffer = (PFNGLBINDRENDERBUFFERPROC)LL_GET_PROC_ADDRESS("glBindRenderbuffer"); + glDeleteRenderbuffers = (PFNGLDELETERENDERBUFFERSPROC)LL_GET_PROC_ADDRESS("glDeleteRenderbuffers"); + glGenRenderbuffers = (PFNGLGENRENDERBUFFERSPROC)LL_GET_PROC_ADDRESS("glGenRenderbuffers"); + glRenderbufferStorage = (PFNGLRENDERBUFFERSTORAGEPROC)LL_GET_PROC_ADDRESS("glRenderbufferStorage"); + glGetRenderbufferParameteriv = (PFNGLGETRENDERBUFFERPARAMETERIVPROC)LL_GET_PROC_ADDRESS("glGetRenderbufferParameteriv"); + glIsFramebuffer = (PFNGLISFRAMEBUFFERPROC)LL_GET_PROC_ADDRESS("glIsFramebuffer"); + glBindFramebuffer = (PFNGLBINDFRAMEBUFFERPROC)LL_GET_PROC_ADDRESS("glBindFramebuffer"); + glDeleteFramebuffers = (PFNGLDELETEFRAMEBUFFERSPROC)LL_GET_PROC_ADDRESS("glDeleteFramebuffers"); + glGenFramebuffers = (PFNGLGENFRAMEBUFFERSPROC)LL_GET_PROC_ADDRESS("glGenFramebuffers"); + glCheckFramebufferStatus = (PFNGLCHECKFRAMEBUFFERSTATUSPROC)LL_GET_PROC_ADDRESS("glCheckFramebufferStatus"); + glFramebufferTexture1D = (PFNGLFRAMEBUFFERTEXTURE1DPROC)LL_GET_PROC_ADDRESS("glFramebufferTexture1D"); + glFramebufferTexture2D = (PFNGLFRAMEBUFFERTEXTURE2DPROC)LL_GET_PROC_ADDRESS("glFramebufferTexture2D"); + glFramebufferTexture3D = (PFNGLFRAMEBUFFERTEXTURE3DPROC)LL_GET_PROC_ADDRESS("glFramebufferTexture3D"); + glFramebufferRenderbuffer = (PFNGLFRAMEBUFFERRENDERBUFFERPROC)LL_GET_PROC_ADDRESS("glFramebufferRenderbuffer"); + glGetFramebufferAttachmentParameteriv = (PFNGLGETFRAMEBUFFERATTACHMENTPARAMETERIVPROC)LL_GET_PROC_ADDRESS("glGetFramebufferAttachmentParameteriv"); + glGenerateMipmap = (PFNGLGENERATEMIPMAPPROC)LL_GET_PROC_ADDRESS("glGenerateMipmap"); + glBlitFramebuffer = (PFNGLBLITFRAMEBUFFERPROC)LL_GET_PROC_ADDRESS("glBlitFramebuffer"); + glRenderbufferStorageMultisample = (PFNGLRENDERBUFFERSTORAGEMULTISAMPLEPROC)LL_GET_PROC_ADDRESS("glRenderbufferStorageMultisample"); + glFramebufferTextureLayer = (PFNGLFRAMEBUFFERTEXTURELAYERPROC)LL_GET_PROC_ADDRESS("glFramebufferTextureLayer"); + glMapBufferRange = (PFNGLMAPBUFFERRANGEPROC)LL_GET_PROC_ADDRESS("glMapBufferRange"); + glFlushMappedBufferRange = (PFNGLFLUSHMAPPEDBUFFERRANGEPROC)LL_GET_PROC_ADDRESS("glFlushMappedBufferRange"); + glBindVertexArray = (PFNGLBINDVERTEXARRAYPROC)LL_GET_PROC_ADDRESS("glBindVertexArray"); + glDeleteVertexArrays = (PFNGLDELETEVERTEXARRAYSPROC)LL_GET_PROC_ADDRESS("glDeleteVertexArrays"); + glGenVertexArrays = (PFNGLGENVERTEXARRAYSPROC)LL_GET_PROC_ADDRESS("glGenVertexArrays"); + glIsVertexArray = (PFNGLISVERTEXARRAYPROC)LL_GET_PROC_ADDRESS("glIsVertexArray"); // GL_VERSION_3_1 if (mGLVersion < 3.09f) { return; } - glDrawArraysInstanced = (PFNGLDRAWARRAYSINSTANCEDPROC)GLH_EXT_GET_PROC_ADDRESS("glDrawArraysInstanced"); - glDrawElementsInstanced = (PFNGLDRAWELEMENTSINSTANCEDPROC)GLH_EXT_GET_PROC_ADDRESS("glDrawElementsInstanced"); - glTexBuffer = (PFNGLTEXBUFFERPROC)GLH_EXT_GET_PROC_ADDRESS("glTexBuffer"); - glPrimitiveRestartIndex = (PFNGLPRIMITIVERESTARTINDEXPROC)GLH_EXT_GET_PROC_ADDRESS("glPrimitiveRestartIndex"); - glCopyBufferSubData = (PFNGLCOPYBUFFERSUBDATAPROC)GLH_EXT_GET_PROC_ADDRESS("glCopyBufferSubData"); - glGetUniformIndices = (PFNGLGETUNIFORMINDICESPROC)GLH_EXT_GET_PROC_ADDRESS("glGetUniformIndices"); - glGetActiveUniformsiv = (PFNGLGETACTIVEUNIFORMSIVPROC)GLH_EXT_GET_PROC_ADDRESS("glGetActiveUniformsiv"); - glGetActiveUniformName = (PFNGLGETACTIVEUNIFORMNAMEPROC)GLH_EXT_GET_PROC_ADDRESS("glGetActiveUniformName"); - glGetUniformBlockIndex = (PFNGLGETUNIFORMBLOCKINDEXPROC)GLH_EXT_GET_PROC_ADDRESS("glGetUniformBlockIndex"); - glGetActiveUniformBlockiv = (PFNGLGETACTIVEUNIFORMBLOCKIVPROC)GLH_EXT_GET_PROC_ADDRESS("glGetActiveUniformBlockiv"); - glGetActiveUniformBlockName = (PFNGLGETACTIVEUNIFORMBLOCKNAMEPROC)GLH_EXT_GET_PROC_ADDRESS("glGetActiveUniformBlockName"); - glUniformBlockBinding = (PFNGLUNIFORMBLOCKBINDINGPROC)GLH_EXT_GET_PROC_ADDRESS("glUniformBlockBinding"); + glDrawArraysInstanced = (PFNGLDRAWARRAYSINSTANCEDPROC)LL_GET_PROC_ADDRESS("glDrawArraysInstanced"); + glDrawElementsInstanced = (PFNGLDRAWELEMENTSINSTANCEDPROC)LL_GET_PROC_ADDRESS("glDrawElementsInstanced"); + glTexBuffer = (PFNGLTEXBUFFERPROC)LL_GET_PROC_ADDRESS("glTexBuffer"); + glPrimitiveRestartIndex = (PFNGLPRIMITIVERESTARTINDEXPROC)LL_GET_PROC_ADDRESS("glPrimitiveRestartIndex"); + glCopyBufferSubData = (PFNGLCOPYBUFFERSUBDATAPROC)LL_GET_PROC_ADDRESS("glCopyBufferSubData"); + glGetUniformIndices = (PFNGLGETUNIFORMINDICESPROC)LL_GET_PROC_ADDRESS("glGetUniformIndices"); + glGetActiveUniformsiv = (PFNGLGETACTIVEUNIFORMSIVPROC)LL_GET_PROC_ADDRESS("glGetActiveUniformsiv"); + glGetActiveUniformName = (PFNGLGETACTIVEUNIFORMNAMEPROC)LL_GET_PROC_ADDRESS("glGetActiveUniformName"); + glGetUniformBlockIndex = (PFNGLGETUNIFORMBLOCKINDEXPROC)LL_GET_PROC_ADDRESS("glGetUniformBlockIndex"); + glGetActiveUniformBlockiv = (PFNGLGETACTIVEUNIFORMBLOCKIVPROC)LL_GET_PROC_ADDRESS("glGetActiveUniformBlockiv"); + glGetActiveUniformBlockName = (PFNGLGETACTIVEUNIFORMBLOCKNAMEPROC)LL_GET_PROC_ADDRESS("glGetActiveUniformBlockName"); + glUniformBlockBinding = (PFNGLUNIFORMBLOCKBINDINGPROC)LL_GET_PROC_ADDRESS("glUniformBlockBinding"); // GL_VERSION_3_2 if (mGLVersion < 3.19f) { return; } - glDrawElementsBaseVertex = (PFNGLDRAWELEMENTSBASEVERTEXPROC)GLH_EXT_GET_PROC_ADDRESS("glDrawElementsBaseVertex"); - glDrawRangeElementsBaseVertex = (PFNGLDRAWRANGEELEMENTSBASEVERTEXPROC)GLH_EXT_GET_PROC_ADDRESS("glDrawRangeElementsBaseVertex"); - glDrawElementsInstancedBaseVertex = (PFNGLDRAWELEMENTSINSTANCEDBASEVERTEXPROC)GLH_EXT_GET_PROC_ADDRESS("glDrawElementsInstancedBaseVertex"); - glMultiDrawElementsBaseVertex = (PFNGLMULTIDRAWELEMENTSBASEVERTEXPROC)GLH_EXT_GET_PROC_ADDRESS("glMultiDrawElementsBaseVertex"); - glProvokingVertex = (PFNGLPROVOKINGVERTEXPROC)GLH_EXT_GET_PROC_ADDRESS("glProvokingVertex"); - glFenceSync = (PFNGLFENCESYNCPROC)GLH_EXT_GET_PROC_ADDRESS("glFenceSync"); - glIsSync = (PFNGLISSYNCPROC)GLH_EXT_GET_PROC_ADDRESS("glIsSync"); - glDeleteSync = (PFNGLDELETESYNCPROC)GLH_EXT_GET_PROC_ADDRESS("glDeleteSync"); - glClientWaitSync = (PFNGLCLIENTWAITSYNCPROC)GLH_EXT_GET_PROC_ADDRESS("glClientWaitSync"); - glWaitSync = (PFNGLWAITSYNCPROC)GLH_EXT_GET_PROC_ADDRESS("glWaitSync"); - glGetInteger64v = (PFNGLGETINTEGER64VPROC)GLH_EXT_GET_PROC_ADDRESS("glGetInteger64v"); - glGetSynciv = (PFNGLGETSYNCIVPROC)GLH_EXT_GET_PROC_ADDRESS("glGetSynciv"); - glGetInteger64i_v = (PFNGLGETINTEGER64I_VPROC)GLH_EXT_GET_PROC_ADDRESS("glGetInteger64i_v"); - glGetBufferParameteri64v = (PFNGLGETBUFFERPARAMETERI64VPROC)GLH_EXT_GET_PROC_ADDRESS("glGetBufferParameteri64v"); - glFramebufferTexture = (PFNGLFRAMEBUFFERTEXTUREPROC)GLH_EXT_GET_PROC_ADDRESS("glFramebufferTexture"); - glTexImage2DMultisample = (PFNGLTEXIMAGE2DMULTISAMPLEPROC)GLH_EXT_GET_PROC_ADDRESS("glTexImage2DMultisample"); - glTexImage3DMultisample = (PFNGLTEXIMAGE3DMULTISAMPLEPROC)GLH_EXT_GET_PROC_ADDRESS("glTexImage3DMultisample"); - glGetMultisamplefv = (PFNGLGETMULTISAMPLEFVPROC)GLH_EXT_GET_PROC_ADDRESS("glGetMultisamplefv"); - glSampleMaski = (PFNGLSAMPLEMASKIPROC)GLH_EXT_GET_PROC_ADDRESS("glSampleMaski"); + glDrawElementsBaseVertex = (PFNGLDRAWELEMENTSBASEVERTEXPROC)LL_GET_PROC_ADDRESS("glDrawElementsBaseVertex"); + glDrawRangeElementsBaseVertex = (PFNGLDRAWRANGEELEMENTSBASEVERTEXPROC)LL_GET_PROC_ADDRESS("glDrawRangeElementsBaseVertex"); + glDrawElementsInstancedBaseVertex = (PFNGLDRAWELEMENTSINSTANCEDBASEVERTEXPROC)LL_GET_PROC_ADDRESS("glDrawElementsInstancedBaseVertex"); + glMultiDrawElementsBaseVertex = (PFNGLMULTIDRAWELEMENTSBASEVERTEXPROC)LL_GET_PROC_ADDRESS("glMultiDrawElementsBaseVertex"); + glProvokingVertex = (PFNGLPROVOKINGVERTEXPROC)LL_GET_PROC_ADDRESS("glProvokingVertex"); + glFenceSync = (PFNGLFENCESYNCPROC)LL_GET_PROC_ADDRESS("glFenceSync"); + glIsSync = (PFNGLISSYNCPROC)LL_GET_PROC_ADDRESS("glIsSync"); + glDeleteSync = (PFNGLDELETESYNCPROC)LL_GET_PROC_ADDRESS("glDeleteSync"); + glClientWaitSync = (PFNGLCLIENTWAITSYNCPROC)LL_GET_PROC_ADDRESS("glClientWaitSync"); + glWaitSync = (PFNGLWAITSYNCPROC)LL_GET_PROC_ADDRESS("glWaitSync"); + glGetInteger64v = (PFNGLGETINTEGER64VPROC)LL_GET_PROC_ADDRESS("glGetInteger64v"); + glGetSynciv = (PFNGLGETSYNCIVPROC)LL_GET_PROC_ADDRESS("glGetSynciv"); + glGetInteger64i_v = (PFNGLGETINTEGER64I_VPROC)LL_GET_PROC_ADDRESS("glGetInteger64i_v"); + glGetBufferParameteri64v = (PFNGLGETBUFFERPARAMETERI64VPROC)LL_GET_PROC_ADDRESS("glGetBufferParameteri64v"); + glFramebufferTexture = (PFNGLFRAMEBUFFERTEXTUREPROC)LL_GET_PROC_ADDRESS("glFramebufferTexture"); + glTexImage2DMultisample = (PFNGLTEXIMAGE2DMULTISAMPLEPROC)LL_GET_PROC_ADDRESS("glTexImage2DMultisample"); + glTexImage3DMultisample = (PFNGLTEXIMAGE3DMULTISAMPLEPROC)LL_GET_PROC_ADDRESS("glTexImage3DMultisample"); + glGetMultisamplefv = (PFNGLGETMULTISAMPLEFVPROC)LL_GET_PROC_ADDRESS("glGetMultisamplefv"); + glSampleMaski = (PFNGLSAMPLEMASKIPROC)LL_GET_PROC_ADDRESS("glSampleMaski"); // GL_VERSION_3_3 if (mGLVersion < 3.29f) { return; } - glBindFragDataLocationIndexed = (PFNGLBINDFRAGDATALOCATIONINDEXEDPROC)GLH_EXT_GET_PROC_ADDRESS("glBindFragDataLocationIndexed"); - glGetFragDataIndex = (PFNGLGETFRAGDATAINDEXPROC)GLH_EXT_GET_PROC_ADDRESS("glGetFragDataIndex"); - glGenSamplers = (PFNGLGENSAMPLERSPROC)GLH_EXT_GET_PROC_ADDRESS("glGenSamplers"); - glDeleteSamplers = (PFNGLDELETESAMPLERSPROC)GLH_EXT_GET_PROC_ADDRESS("glDeleteSamplers"); - glIsSampler = (PFNGLISSAMPLERPROC)GLH_EXT_GET_PROC_ADDRESS("glIsSampler"); - glBindSampler = (PFNGLBINDSAMPLERPROC)GLH_EXT_GET_PROC_ADDRESS("glBindSampler"); - glSamplerParameteri = (PFNGLSAMPLERPARAMETERIPROC)GLH_EXT_GET_PROC_ADDRESS("glSamplerParameteri"); - glSamplerParameteriv = (PFNGLSAMPLERPARAMETERIVPROC)GLH_EXT_GET_PROC_ADDRESS("glSamplerParameteriv"); - glSamplerParameterf = (PFNGLSAMPLERPARAMETERFPROC)GLH_EXT_GET_PROC_ADDRESS("glSamplerParameterf"); - glSamplerParameterfv = (PFNGLSAMPLERPARAMETERFVPROC)GLH_EXT_GET_PROC_ADDRESS("glSamplerParameterfv"); - glSamplerParameterIiv = (PFNGLSAMPLERPARAMETERIIVPROC)GLH_EXT_GET_PROC_ADDRESS("glSamplerParameterIiv"); - glSamplerParameterIuiv = (PFNGLSAMPLERPARAMETERIUIVPROC)GLH_EXT_GET_PROC_ADDRESS("glSamplerParameterIuiv"); - glGetSamplerParameteriv = (PFNGLGETSAMPLERPARAMETERIVPROC)GLH_EXT_GET_PROC_ADDRESS("glGetSamplerParameteriv"); - glGetSamplerParameterIiv = (PFNGLGETSAMPLERPARAMETERIIVPROC)GLH_EXT_GET_PROC_ADDRESS("glGetSamplerParameterIiv"); - glGetSamplerParameterfv = (PFNGLGETSAMPLERPARAMETERFVPROC)GLH_EXT_GET_PROC_ADDRESS("glGetSamplerParameterfv"); - glGetSamplerParameterIuiv = (PFNGLGETSAMPLERPARAMETERIUIVPROC)GLH_EXT_GET_PROC_ADDRESS("glGetSamplerParameterIuiv"); - glQueryCounter = (PFNGLQUERYCOUNTERPROC)GLH_EXT_GET_PROC_ADDRESS("glQueryCounter"); - glGetQueryObjecti64v = (PFNGLGETQUERYOBJECTI64VPROC)GLH_EXT_GET_PROC_ADDRESS("glGetQueryObjecti64v"); - glGetQueryObjectui64v = (PFNGLGETQUERYOBJECTUI64VPROC)GLH_EXT_GET_PROC_ADDRESS("glGetQueryObjectui64v"); - glVertexAttribDivisor = (PFNGLVERTEXATTRIBDIVISORPROC)GLH_EXT_GET_PROC_ADDRESS("glVertexAttribDivisor"); - glVertexAttribP1ui = (PFNGLVERTEXATTRIBP1UIPROC)GLH_EXT_GET_PROC_ADDRESS("glVertexAttribP1ui"); - glVertexAttribP1uiv = (PFNGLVERTEXATTRIBP1UIVPROC)GLH_EXT_GET_PROC_ADDRESS("glVertexAttribP1uiv"); - glVertexAttribP2ui = (PFNGLVERTEXATTRIBP2UIPROC)GLH_EXT_GET_PROC_ADDRESS("glVertexAttribP2ui"); - glVertexAttribP2uiv = (PFNGLVERTEXATTRIBP2UIVPROC)GLH_EXT_GET_PROC_ADDRESS("glVertexAttribP2uiv"); - glVertexAttribP3ui = (PFNGLVERTEXATTRIBP3UIPROC)GLH_EXT_GET_PROC_ADDRESS("glVertexAttribP3ui"); - glVertexAttribP3uiv = (PFNGLVERTEXATTRIBP3UIVPROC)GLH_EXT_GET_PROC_ADDRESS("glVertexAttribP3uiv"); - glVertexAttribP4ui = (PFNGLVERTEXATTRIBP4UIPROC)GLH_EXT_GET_PROC_ADDRESS("glVertexAttribP4ui"); - glVertexAttribP4uiv = (PFNGLVERTEXATTRIBP4UIVPROC)GLH_EXT_GET_PROC_ADDRESS("glVertexAttribP4uiv"); - glVertexP2ui = (PFNGLVERTEXP2UIPROC)GLH_EXT_GET_PROC_ADDRESS("glVertexP2ui"); - glVertexP2uiv = (PFNGLVERTEXP2UIVPROC)GLH_EXT_GET_PROC_ADDRESS("glVertexP2uiv"); - glVertexP3ui = (PFNGLVERTEXP3UIPROC)GLH_EXT_GET_PROC_ADDRESS("glVertexP3ui"); - glVertexP3uiv = (PFNGLVERTEXP3UIVPROC)GLH_EXT_GET_PROC_ADDRESS("glVertexP3uiv"); - glVertexP4ui = (PFNGLVERTEXP4UIPROC)GLH_EXT_GET_PROC_ADDRESS("glVertexP4ui"); - glVertexP4uiv = (PFNGLVERTEXP4UIVPROC)GLH_EXT_GET_PROC_ADDRESS("glVertexP4uiv"); - glTexCoordP1ui = (PFNGLTEXCOORDP1UIPROC)GLH_EXT_GET_PROC_ADDRESS("glTexCoordP1ui"); - glTexCoordP1uiv = (PFNGLTEXCOORDP1UIVPROC)GLH_EXT_GET_PROC_ADDRESS("glTexCoordP1uiv"); - glTexCoordP2ui = (PFNGLTEXCOORDP2UIPROC)GLH_EXT_GET_PROC_ADDRESS("glTexCoordP2ui"); - glTexCoordP2uiv = (PFNGLTEXCOORDP2UIVPROC)GLH_EXT_GET_PROC_ADDRESS("glTexCoordP2uiv"); - glTexCoordP3ui = (PFNGLTEXCOORDP3UIPROC)GLH_EXT_GET_PROC_ADDRESS("glTexCoordP3ui"); - glTexCoordP3uiv = (PFNGLTEXCOORDP3UIVPROC)GLH_EXT_GET_PROC_ADDRESS("glTexCoordP3uiv"); - glTexCoordP4ui = (PFNGLTEXCOORDP4UIPROC)GLH_EXT_GET_PROC_ADDRESS("glTexCoordP4ui"); - glTexCoordP4uiv = (PFNGLTEXCOORDP4UIVPROC)GLH_EXT_GET_PROC_ADDRESS("glTexCoordP4uiv"); - glMultiTexCoordP1ui = (PFNGLMULTITEXCOORDP1UIPROC)GLH_EXT_GET_PROC_ADDRESS("glMultiTexCoordP1ui"); - glMultiTexCoordP1uiv = (PFNGLMULTITEXCOORDP1UIVPROC)GLH_EXT_GET_PROC_ADDRESS("glMultiTexCoordP1uiv"); - glMultiTexCoordP2ui = (PFNGLMULTITEXCOORDP2UIPROC)GLH_EXT_GET_PROC_ADDRESS("glMultiTexCoordP2ui"); - glMultiTexCoordP2uiv = (PFNGLMULTITEXCOORDP2UIVPROC)GLH_EXT_GET_PROC_ADDRESS("glMultiTexCoordP2uiv"); - glMultiTexCoordP3ui = (PFNGLMULTITEXCOORDP3UIPROC)GLH_EXT_GET_PROC_ADDRESS("glMultiTexCoordP3ui"); - glMultiTexCoordP3uiv = (PFNGLMULTITEXCOORDP3UIVPROC)GLH_EXT_GET_PROC_ADDRESS("glMultiTexCoordP3uiv"); - glMultiTexCoordP4ui = (PFNGLMULTITEXCOORDP4UIPROC)GLH_EXT_GET_PROC_ADDRESS("glMultiTexCoordP4ui"); - glMultiTexCoordP4uiv = (PFNGLMULTITEXCOORDP4UIVPROC)GLH_EXT_GET_PROC_ADDRESS("glMultiTexCoordP4uiv"); - glNormalP3ui = (PFNGLNORMALP3UIPROC)GLH_EXT_GET_PROC_ADDRESS("glNormalP3ui"); - glNormalP3uiv = (PFNGLNORMALP3UIVPROC)GLH_EXT_GET_PROC_ADDRESS("glNormalP3uiv"); - glColorP3ui = (PFNGLCOLORP3UIPROC)GLH_EXT_GET_PROC_ADDRESS("glColorP3ui"); - glColorP3uiv = (PFNGLCOLORP3UIVPROC)GLH_EXT_GET_PROC_ADDRESS("glColorP3uiv"); - glColorP4ui = (PFNGLCOLORP4UIPROC)GLH_EXT_GET_PROC_ADDRESS("glColorP4ui"); - glColorP4uiv = (PFNGLCOLORP4UIVPROC)GLH_EXT_GET_PROC_ADDRESS("glColorP4uiv"); - glSecondaryColorP3ui = (PFNGLSECONDARYCOLORP3UIPROC)GLH_EXT_GET_PROC_ADDRESS("glSecondaryColorP3ui"); - glSecondaryColorP3uiv = (PFNGLSECONDARYCOLORP3UIVPROC)GLH_EXT_GET_PROC_ADDRESS("glSecondaryColorP3uiv"); + glBindFragDataLocationIndexed = (PFNGLBINDFRAGDATALOCATIONINDEXEDPROC)LL_GET_PROC_ADDRESS("glBindFragDataLocationIndexed"); + glGetFragDataIndex = (PFNGLGETFRAGDATAINDEXPROC)LL_GET_PROC_ADDRESS("glGetFragDataIndex"); + glGenSamplers = (PFNGLGENSAMPLERSPROC)LL_GET_PROC_ADDRESS("glGenSamplers"); + glDeleteSamplers = (PFNGLDELETESAMPLERSPROC)LL_GET_PROC_ADDRESS("glDeleteSamplers"); + glIsSampler = (PFNGLISSAMPLERPROC)LL_GET_PROC_ADDRESS("glIsSampler"); + glBindSampler = (PFNGLBINDSAMPLERPROC)LL_GET_PROC_ADDRESS("glBindSampler"); + glSamplerParameteri = (PFNGLSAMPLERPARAMETERIPROC)LL_GET_PROC_ADDRESS("glSamplerParameteri"); + glSamplerParameteriv = (PFNGLSAMPLERPARAMETERIVPROC)LL_GET_PROC_ADDRESS("glSamplerParameteriv"); + glSamplerParameterf = (PFNGLSAMPLERPARAMETERFPROC)LL_GET_PROC_ADDRESS("glSamplerParameterf"); + glSamplerParameterfv = (PFNGLSAMPLERPARAMETERFVPROC)LL_GET_PROC_ADDRESS("glSamplerParameterfv"); + glSamplerParameterIiv = (PFNGLSAMPLERPARAMETERIIVPROC)LL_GET_PROC_ADDRESS("glSamplerParameterIiv"); + glSamplerParameterIuiv = (PFNGLSAMPLERPARAMETERIUIVPROC)LL_GET_PROC_ADDRESS("glSamplerParameterIuiv"); + glGetSamplerParameteriv = (PFNGLGETSAMPLERPARAMETERIVPROC)LL_GET_PROC_ADDRESS("glGetSamplerParameteriv"); + glGetSamplerParameterIiv = (PFNGLGETSAMPLERPARAMETERIIVPROC)LL_GET_PROC_ADDRESS("glGetSamplerParameterIiv"); + glGetSamplerParameterfv = (PFNGLGETSAMPLERPARAMETERFVPROC)LL_GET_PROC_ADDRESS("glGetSamplerParameterfv"); + glGetSamplerParameterIuiv = (PFNGLGETSAMPLERPARAMETERIUIVPROC)LL_GET_PROC_ADDRESS("glGetSamplerParameterIuiv"); + glQueryCounter = (PFNGLQUERYCOUNTERPROC)LL_GET_PROC_ADDRESS("glQueryCounter"); + glGetQueryObjecti64v = (PFNGLGETQUERYOBJECTI64VPROC)LL_GET_PROC_ADDRESS("glGetQueryObjecti64v"); + glGetQueryObjectui64v = (PFNGLGETQUERYOBJECTUI64VPROC)LL_GET_PROC_ADDRESS("glGetQueryObjectui64v"); + glVertexAttribDivisor = (PFNGLVERTEXATTRIBDIVISORPROC)LL_GET_PROC_ADDRESS("glVertexAttribDivisor"); + glVertexAttribP1ui = (PFNGLVERTEXATTRIBP1UIPROC)LL_GET_PROC_ADDRESS("glVertexAttribP1ui"); + glVertexAttribP1uiv = (PFNGLVERTEXATTRIBP1UIVPROC)LL_GET_PROC_ADDRESS("glVertexAttribP1uiv"); + glVertexAttribP2ui = (PFNGLVERTEXATTRIBP2UIPROC)LL_GET_PROC_ADDRESS("glVertexAttribP2ui"); + glVertexAttribP2uiv = (PFNGLVERTEXATTRIBP2UIVPROC)LL_GET_PROC_ADDRESS("glVertexAttribP2uiv"); + glVertexAttribP3ui = (PFNGLVERTEXATTRIBP3UIPROC)LL_GET_PROC_ADDRESS("glVertexAttribP3ui"); + glVertexAttribP3uiv = (PFNGLVERTEXATTRIBP3UIVPROC)LL_GET_PROC_ADDRESS("glVertexAttribP3uiv"); + glVertexAttribP4ui = (PFNGLVERTEXATTRIBP4UIPROC)LL_GET_PROC_ADDRESS("glVertexAttribP4ui"); + glVertexAttribP4uiv = (PFNGLVERTEXATTRIBP4UIVPROC)LL_GET_PROC_ADDRESS("glVertexAttribP4uiv"); // GL_VERSION_4_0 if (mGLVersion < 3.99f) { return; } - glMinSampleShading = (PFNGLMINSAMPLESHADINGPROC)GLH_EXT_GET_PROC_ADDRESS("glMinSampleShading"); - glBlendEquationi = (PFNGLBLENDEQUATIONIPROC)GLH_EXT_GET_PROC_ADDRESS("glBlendEquationi"); - glBlendEquationSeparatei = (PFNGLBLENDEQUATIONSEPARATEIPROC)GLH_EXT_GET_PROC_ADDRESS("glBlendEquationSeparatei"); - glBlendFunci = (PFNGLBLENDFUNCIPROC)GLH_EXT_GET_PROC_ADDRESS("glBlendFunci"); - glBlendFuncSeparatei = (PFNGLBLENDFUNCSEPARATEIPROC)GLH_EXT_GET_PROC_ADDRESS("glBlendFuncSeparatei"); - glDrawArraysIndirect = (PFNGLDRAWARRAYSINDIRECTPROC)GLH_EXT_GET_PROC_ADDRESS("glDrawArraysIndirect"); - glDrawElementsIndirect = (PFNGLDRAWELEMENTSINDIRECTPROC)GLH_EXT_GET_PROC_ADDRESS("glDrawElementsIndirect"); - glUniform1d = (PFNGLUNIFORM1DPROC)GLH_EXT_GET_PROC_ADDRESS("glUniform1d"); - glUniform2d = (PFNGLUNIFORM2DPROC)GLH_EXT_GET_PROC_ADDRESS("glUniform2d"); - glUniform3d = (PFNGLUNIFORM3DPROC)GLH_EXT_GET_PROC_ADDRESS("glUniform3d"); - glUniform4d = (PFNGLUNIFORM4DPROC)GLH_EXT_GET_PROC_ADDRESS("glUniform4d"); - glUniform1dv = (PFNGLUNIFORM1DVPROC)GLH_EXT_GET_PROC_ADDRESS("glUniform1dv"); - glUniform2dv = (PFNGLUNIFORM2DVPROC)GLH_EXT_GET_PROC_ADDRESS("glUniform2dv"); - glUniform3dv = (PFNGLUNIFORM3DVPROC)GLH_EXT_GET_PROC_ADDRESS("glUniform3dv"); - glUniform4dv = (PFNGLUNIFORM4DVPROC)GLH_EXT_GET_PROC_ADDRESS("glUniform4dv"); - glUniformMatrix2dv = (PFNGLUNIFORMMATRIX2DVPROC)GLH_EXT_GET_PROC_ADDRESS("glUniformMatrix2dv"); - glUniformMatrix3dv = (PFNGLUNIFORMMATRIX3DVPROC)GLH_EXT_GET_PROC_ADDRESS("glUniformMatrix3dv"); - glUniformMatrix4dv = (PFNGLUNIFORMMATRIX4DVPROC)GLH_EXT_GET_PROC_ADDRESS("glUniformMatrix4dv"); - glUniformMatrix2x3dv = (PFNGLUNIFORMMATRIX2X3DVPROC)GLH_EXT_GET_PROC_ADDRESS("glUniformMatrix2x3dv"); - glUniformMatrix2x4dv = (PFNGLUNIFORMMATRIX2X4DVPROC)GLH_EXT_GET_PROC_ADDRESS("glUniformMatrix2x4dv"); - glUniformMatrix3x2dv = (PFNGLUNIFORMMATRIX3X2DVPROC)GLH_EXT_GET_PROC_ADDRESS("glUniformMatrix3x2dv"); - glUniformMatrix3x4dv = (PFNGLUNIFORMMATRIX3X4DVPROC)GLH_EXT_GET_PROC_ADDRESS("glUniformMatrix3x4dv"); - glUniformMatrix4x2dv = (PFNGLUNIFORMMATRIX4X2DVPROC)GLH_EXT_GET_PROC_ADDRESS("glUniformMatrix4x2dv"); - glUniformMatrix4x3dv = (PFNGLUNIFORMMATRIX4X3DVPROC)GLH_EXT_GET_PROC_ADDRESS("glUniformMatrix4x3dv"); - glGetUniformdv = (PFNGLGETUNIFORMDVPROC)GLH_EXT_GET_PROC_ADDRESS("glGetUniformdv"); - glGetSubroutineUniformLocation = (PFNGLGETSUBROUTINEUNIFORMLOCATIONPROC)GLH_EXT_GET_PROC_ADDRESS("glGetSubroutineUniformLocation"); - glGetSubroutineIndex = (PFNGLGETSUBROUTINEINDEXPROC)GLH_EXT_GET_PROC_ADDRESS("glGetSubroutineIndex"); - glGetActiveSubroutineUniformiv = (PFNGLGETACTIVESUBROUTINEUNIFORMIVPROC)GLH_EXT_GET_PROC_ADDRESS("glGetActiveSubroutineUniformiv"); - glGetActiveSubroutineUniformName = (PFNGLGETACTIVESUBROUTINEUNIFORMNAMEPROC)GLH_EXT_GET_PROC_ADDRESS("glGetActiveSubroutineUniformName"); - glGetActiveSubroutineName = (PFNGLGETACTIVESUBROUTINENAMEPROC)GLH_EXT_GET_PROC_ADDRESS("glGetActiveSubroutineName"); - glUniformSubroutinesuiv = (PFNGLUNIFORMSUBROUTINESUIVPROC)GLH_EXT_GET_PROC_ADDRESS("glUniformSubroutinesuiv"); - glGetUniformSubroutineuiv = (PFNGLGETUNIFORMSUBROUTINEUIVPROC)GLH_EXT_GET_PROC_ADDRESS("glGetUniformSubroutineuiv"); - glGetProgramStageiv = (PFNGLGETPROGRAMSTAGEIVPROC)GLH_EXT_GET_PROC_ADDRESS("glGetProgramStageiv"); - glPatchParameteri = (PFNGLPATCHPARAMETERIPROC)GLH_EXT_GET_PROC_ADDRESS("glPatchParameteri"); - glPatchParameterfv = (PFNGLPATCHPARAMETERFVPROC)GLH_EXT_GET_PROC_ADDRESS("glPatchParameterfv"); - glBindTransformFeedback = (PFNGLBINDTRANSFORMFEEDBACKPROC)GLH_EXT_GET_PROC_ADDRESS("glBindTransformFeedback"); - glDeleteTransformFeedbacks = (PFNGLDELETETRANSFORMFEEDBACKSPROC)GLH_EXT_GET_PROC_ADDRESS("glDeleteTransformFeedbacks"); - glGenTransformFeedbacks = (PFNGLGENTRANSFORMFEEDBACKSPROC)GLH_EXT_GET_PROC_ADDRESS("glGenTransformFeedbacks"); - glIsTransformFeedback = (PFNGLISTRANSFORMFEEDBACKPROC)GLH_EXT_GET_PROC_ADDRESS("glIsTransformFeedback"); - glPauseTransformFeedback = (PFNGLPAUSETRANSFORMFEEDBACKPROC)GLH_EXT_GET_PROC_ADDRESS("glPauseTransformFeedback"); - glResumeTransformFeedback = (PFNGLRESUMETRANSFORMFEEDBACKPROC)GLH_EXT_GET_PROC_ADDRESS("glResumeTransformFeedback"); - glDrawTransformFeedback = (PFNGLDRAWTRANSFORMFEEDBACKPROC)GLH_EXT_GET_PROC_ADDRESS("glDrawTransformFeedback"); - glDrawTransformFeedbackStream = (PFNGLDRAWTRANSFORMFEEDBACKSTREAMPROC)GLH_EXT_GET_PROC_ADDRESS("glDrawTransformFeedbackStream"); - glBeginQueryIndexed = (PFNGLBEGINQUERYINDEXEDPROC)GLH_EXT_GET_PROC_ADDRESS("glBeginQueryIndexed"); - glEndQueryIndexed = (PFNGLENDQUERYINDEXEDPROC)GLH_EXT_GET_PROC_ADDRESS("glEndQueryIndexed"); - glGetQueryIndexediv = (PFNGLGETQUERYINDEXEDIVPROC)GLH_EXT_GET_PROC_ADDRESS("glGetQueryIndexediv"); + glMinSampleShading = (PFNGLMINSAMPLESHADINGPROC)LL_GET_PROC_ADDRESS("glMinSampleShading"); + glBlendEquationi = (PFNGLBLENDEQUATIONIPROC)LL_GET_PROC_ADDRESS("glBlendEquationi"); + glBlendEquationSeparatei = (PFNGLBLENDEQUATIONSEPARATEIPROC)LL_GET_PROC_ADDRESS("glBlendEquationSeparatei"); + glBlendFunci = (PFNGLBLENDFUNCIPROC)LL_GET_PROC_ADDRESS("glBlendFunci"); + glBlendFuncSeparatei = (PFNGLBLENDFUNCSEPARATEIPROC)LL_GET_PROC_ADDRESS("glBlendFuncSeparatei"); + glDrawArraysIndirect = (PFNGLDRAWARRAYSINDIRECTPROC)LL_GET_PROC_ADDRESS("glDrawArraysIndirect"); + glDrawElementsIndirect = (PFNGLDRAWELEMENTSINDIRECTPROC)LL_GET_PROC_ADDRESS("glDrawElementsIndirect"); + glUniform1d = (PFNGLUNIFORM1DPROC)LL_GET_PROC_ADDRESS("glUniform1d"); + glUniform2d = (PFNGLUNIFORM2DPROC)LL_GET_PROC_ADDRESS("glUniform2d"); + glUniform3d = (PFNGLUNIFORM3DPROC)LL_GET_PROC_ADDRESS("glUniform3d"); + glUniform4d = (PFNGLUNIFORM4DPROC)LL_GET_PROC_ADDRESS("glUniform4d"); + glUniform1dv = (PFNGLUNIFORM1DVPROC)LL_GET_PROC_ADDRESS("glUniform1dv"); + glUniform2dv = (PFNGLUNIFORM2DVPROC)LL_GET_PROC_ADDRESS("glUniform2dv"); + glUniform3dv = (PFNGLUNIFORM3DVPROC)LL_GET_PROC_ADDRESS("glUniform3dv"); + glUniform4dv = (PFNGLUNIFORM4DVPROC)LL_GET_PROC_ADDRESS("glUniform4dv"); + glUniformMatrix2dv = (PFNGLUNIFORMMATRIX2DVPROC)LL_GET_PROC_ADDRESS("glUniformMatrix2dv"); + glUniformMatrix3dv = (PFNGLUNIFORMMATRIX3DVPROC)LL_GET_PROC_ADDRESS("glUniformMatrix3dv"); + glUniformMatrix4dv = (PFNGLUNIFORMMATRIX4DVPROC)LL_GET_PROC_ADDRESS("glUniformMatrix4dv"); + glUniformMatrix2x3dv = (PFNGLUNIFORMMATRIX2X3DVPROC)LL_GET_PROC_ADDRESS("glUniformMatrix2x3dv"); + glUniformMatrix2x4dv = (PFNGLUNIFORMMATRIX2X4DVPROC)LL_GET_PROC_ADDRESS("glUniformMatrix2x4dv"); + glUniformMatrix3x2dv = (PFNGLUNIFORMMATRIX3X2DVPROC)LL_GET_PROC_ADDRESS("glUniformMatrix3x2dv"); + glUniformMatrix3x4dv = (PFNGLUNIFORMMATRIX3X4DVPROC)LL_GET_PROC_ADDRESS("glUniformMatrix3x4dv"); + glUniformMatrix4x2dv = (PFNGLUNIFORMMATRIX4X2DVPROC)LL_GET_PROC_ADDRESS("glUniformMatrix4x2dv"); + glUniformMatrix4x3dv = (PFNGLUNIFORMMATRIX4X3DVPROC)LL_GET_PROC_ADDRESS("glUniformMatrix4x3dv"); + glGetUniformdv = (PFNGLGETUNIFORMDVPROC)LL_GET_PROC_ADDRESS("glGetUniformdv"); + glGetSubroutineUniformLocation = (PFNGLGETSUBROUTINEUNIFORMLOCATIONPROC)LL_GET_PROC_ADDRESS("glGetSubroutineUniformLocation"); + glGetSubroutineIndex = (PFNGLGETSUBROUTINEINDEXPROC)LL_GET_PROC_ADDRESS("glGetSubroutineIndex"); + glGetActiveSubroutineUniformiv = (PFNGLGETACTIVESUBROUTINEUNIFORMIVPROC)LL_GET_PROC_ADDRESS("glGetActiveSubroutineUniformiv"); + glGetActiveSubroutineUniformName = (PFNGLGETACTIVESUBROUTINEUNIFORMNAMEPROC)LL_GET_PROC_ADDRESS("glGetActiveSubroutineUniformName"); + glGetActiveSubroutineName = (PFNGLGETACTIVESUBROUTINENAMEPROC)LL_GET_PROC_ADDRESS("glGetActiveSubroutineName"); + glUniformSubroutinesuiv = (PFNGLUNIFORMSUBROUTINESUIVPROC)LL_GET_PROC_ADDRESS("glUniformSubroutinesuiv"); + glGetUniformSubroutineuiv = (PFNGLGETUNIFORMSUBROUTINEUIVPROC)LL_GET_PROC_ADDRESS("glGetUniformSubroutineuiv"); + glGetProgramStageiv = (PFNGLGETPROGRAMSTAGEIVPROC)LL_GET_PROC_ADDRESS("glGetProgramStageiv"); + glPatchParameteri = (PFNGLPATCHPARAMETERIPROC)LL_GET_PROC_ADDRESS("glPatchParameteri"); + glPatchParameterfv = (PFNGLPATCHPARAMETERFVPROC)LL_GET_PROC_ADDRESS("glPatchParameterfv"); + glBindTransformFeedback = (PFNGLBINDTRANSFORMFEEDBACKPROC)LL_GET_PROC_ADDRESS("glBindTransformFeedback"); + glDeleteTransformFeedbacks = (PFNGLDELETETRANSFORMFEEDBACKSPROC)LL_GET_PROC_ADDRESS("glDeleteTransformFeedbacks"); + glGenTransformFeedbacks = (PFNGLGENTRANSFORMFEEDBACKSPROC)LL_GET_PROC_ADDRESS("glGenTransformFeedbacks"); + glIsTransformFeedback = (PFNGLISTRANSFORMFEEDBACKPROC)LL_GET_PROC_ADDRESS("glIsTransformFeedback"); + glPauseTransformFeedback = (PFNGLPAUSETRANSFORMFEEDBACKPROC)LL_GET_PROC_ADDRESS("glPauseTransformFeedback"); + glResumeTransformFeedback = (PFNGLRESUMETRANSFORMFEEDBACKPROC)LL_GET_PROC_ADDRESS("glResumeTransformFeedback"); + glDrawTransformFeedback = (PFNGLDRAWTRANSFORMFEEDBACKPROC)LL_GET_PROC_ADDRESS("glDrawTransformFeedback"); + glDrawTransformFeedbackStream = (PFNGLDRAWTRANSFORMFEEDBACKSTREAMPROC)LL_GET_PROC_ADDRESS("glDrawTransformFeedbackStream"); + glBeginQueryIndexed = (PFNGLBEGINQUERYINDEXEDPROC)LL_GET_PROC_ADDRESS("glBeginQueryIndexed"); + glEndQueryIndexed = (PFNGLENDQUERYINDEXEDPROC)LL_GET_PROC_ADDRESS("glEndQueryIndexed"); + glGetQueryIndexediv = (PFNGLGETQUERYINDEXEDIVPROC)LL_GET_PROC_ADDRESS("glGetQueryIndexediv"); // GL_VERSION_4_1 if (mGLVersion < 4.09f) { return; } - glReleaseShaderCompiler = (PFNGLRELEASESHADERCOMPILERPROC)GLH_EXT_GET_PROC_ADDRESS("glReleaseShaderCompiler"); - glShaderBinary = (PFNGLSHADERBINARYPROC)GLH_EXT_GET_PROC_ADDRESS("glShaderBinary"); - glGetShaderPrecisionFormat = (PFNGLGETSHADERPRECISIONFORMATPROC)GLH_EXT_GET_PROC_ADDRESS("glGetShaderPrecisionFormat"); - glDepthRangef = (PFNGLDEPTHRANGEFPROC)GLH_EXT_GET_PROC_ADDRESS("glDepthRangef"); - glClearDepthf = (PFNGLCLEARDEPTHFPROC)GLH_EXT_GET_PROC_ADDRESS("glClearDepthf"); - glGetProgramBinary = (PFNGLGETPROGRAMBINARYPROC)GLH_EXT_GET_PROC_ADDRESS("glGetProgramBinary"); - glProgramBinary = (PFNGLPROGRAMBINARYPROC)GLH_EXT_GET_PROC_ADDRESS("glProgramBinary"); - glProgramParameteri = (PFNGLPROGRAMPARAMETERIPROC)GLH_EXT_GET_PROC_ADDRESS("glProgramParameteri"); - glUseProgramStages = (PFNGLUSEPROGRAMSTAGESPROC)GLH_EXT_GET_PROC_ADDRESS("glUseProgramStages"); - glActiveShaderProgram = (PFNGLACTIVESHADERPROGRAMPROC)GLH_EXT_GET_PROC_ADDRESS("glActiveShaderProgram"); - glCreateShaderProgramv = (PFNGLCREATESHADERPROGRAMVPROC)GLH_EXT_GET_PROC_ADDRESS("glCreateShaderProgramv"); - glBindProgramPipeline = (PFNGLBINDPROGRAMPIPELINEPROC)GLH_EXT_GET_PROC_ADDRESS("glBindProgramPipeline"); - glDeleteProgramPipelines = (PFNGLDELETEPROGRAMPIPELINESPROC)GLH_EXT_GET_PROC_ADDRESS("glDeleteProgramPipelines"); - glGenProgramPipelines = (PFNGLGENPROGRAMPIPELINESPROC)GLH_EXT_GET_PROC_ADDRESS("glGenProgramPipelines"); - glIsProgramPipeline = (PFNGLISPROGRAMPIPELINEPROC)GLH_EXT_GET_PROC_ADDRESS("glIsProgramPipeline"); - glGetProgramPipelineiv = (PFNGLGETPROGRAMPIPELINEIVPROC)GLH_EXT_GET_PROC_ADDRESS("glGetProgramPipelineiv"); - glProgramUniform1i = (PFNGLPROGRAMUNIFORM1IPROC)GLH_EXT_GET_PROC_ADDRESS("glProgramUniform1i"); - glProgramUniform1iv = (PFNGLPROGRAMUNIFORM1IVPROC)GLH_EXT_GET_PROC_ADDRESS("glProgramUniform1iv"); - glProgramUniform1f = (PFNGLPROGRAMUNIFORM1FPROC)GLH_EXT_GET_PROC_ADDRESS("glProgramUniform1f"); - glProgramUniform1fv = (PFNGLPROGRAMUNIFORM1FVPROC)GLH_EXT_GET_PROC_ADDRESS("glProgramUniform1fv"); - glProgramUniform1d = (PFNGLPROGRAMUNIFORM1DPROC)GLH_EXT_GET_PROC_ADDRESS("glProgramUniform1d"); - glProgramUniform1dv = (PFNGLPROGRAMUNIFORM1DVPROC)GLH_EXT_GET_PROC_ADDRESS("glProgramUniform1dv"); - glProgramUniform1ui = (PFNGLPROGRAMUNIFORM1UIPROC)GLH_EXT_GET_PROC_ADDRESS("glProgramUniform1ui"); - glProgramUniform1uiv = (PFNGLPROGRAMUNIFORM1UIVPROC)GLH_EXT_GET_PROC_ADDRESS("glProgramUniform1uiv"); - glProgramUniform2i = (PFNGLPROGRAMUNIFORM2IPROC)GLH_EXT_GET_PROC_ADDRESS("glProgramUniform2i"); - glProgramUniform2iv = (PFNGLPROGRAMUNIFORM2IVPROC)GLH_EXT_GET_PROC_ADDRESS("glProgramUniform2iv"); - glProgramUniform2f = (PFNGLPROGRAMUNIFORM2FPROC)GLH_EXT_GET_PROC_ADDRESS("glProgramUniform2f"); - glProgramUniform2fv = (PFNGLPROGRAMUNIFORM2FVPROC)GLH_EXT_GET_PROC_ADDRESS("glProgramUniform2fv"); - glProgramUniform2d = (PFNGLPROGRAMUNIFORM2DPROC)GLH_EXT_GET_PROC_ADDRESS("glProgramUniform2d"); - glProgramUniform2dv = (PFNGLPROGRAMUNIFORM2DVPROC)GLH_EXT_GET_PROC_ADDRESS("glProgramUniform2dv"); - glProgramUniform2ui = (PFNGLPROGRAMUNIFORM2UIPROC)GLH_EXT_GET_PROC_ADDRESS("glProgramUniform2ui"); - glProgramUniform2uiv = (PFNGLPROGRAMUNIFORM2UIVPROC)GLH_EXT_GET_PROC_ADDRESS("glProgramUniform2uiv"); - glProgramUniform3i = (PFNGLPROGRAMUNIFORM3IPROC)GLH_EXT_GET_PROC_ADDRESS("glProgramUniform3i"); - glProgramUniform3iv = (PFNGLPROGRAMUNIFORM3IVPROC)GLH_EXT_GET_PROC_ADDRESS("glProgramUniform3iv"); - glProgramUniform3f = (PFNGLPROGRAMUNIFORM3FPROC)GLH_EXT_GET_PROC_ADDRESS("glProgramUniform3f"); - glProgramUniform3fv = (PFNGLPROGRAMUNIFORM3FVPROC)GLH_EXT_GET_PROC_ADDRESS("glProgramUniform3fv"); - glProgramUniform3d = (PFNGLPROGRAMUNIFORM3DPROC)GLH_EXT_GET_PROC_ADDRESS("glProgramUniform3d"); - glProgramUniform3dv = (PFNGLPROGRAMUNIFORM3DVPROC)GLH_EXT_GET_PROC_ADDRESS("glProgramUniform3dv"); - glProgramUniform3ui = (PFNGLPROGRAMUNIFORM3UIPROC)GLH_EXT_GET_PROC_ADDRESS("glProgramUniform3ui"); - glProgramUniform3uiv = (PFNGLPROGRAMUNIFORM3UIVPROC)GLH_EXT_GET_PROC_ADDRESS("glProgramUniform3uiv"); - glProgramUniform4i = (PFNGLPROGRAMUNIFORM4IPROC)GLH_EXT_GET_PROC_ADDRESS("glProgramUniform4i"); - glProgramUniform4iv = (PFNGLPROGRAMUNIFORM4IVPROC)GLH_EXT_GET_PROC_ADDRESS("glProgramUniform4iv"); - glProgramUniform4f = (PFNGLPROGRAMUNIFORM4FPROC)GLH_EXT_GET_PROC_ADDRESS("glProgramUniform4f"); - glProgramUniform4fv = (PFNGLPROGRAMUNIFORM4FVPROC)GLH_EXT_GET_PROC_ADDRESS("glProgramUniform4fv"); - glProgramUniform4d = (PFNGLPROGRAMUNIFORM4DPROC)GLH_EXT_GET_PROC_ADDRESS("glProgramUniform4d"); - glProgramUniform4dv = (PFNGLPROGRAMUNIFORM4DVPROC)GLH_EXT_GET_PROC_ADDRESS("glProgramUniform4dv"); - glProgramUniform4ui = (PFNGLPROGRAMUNIFORM4UIPROC)GLH_EXT_GET_PROC_ADDRESS("glProgramUniform4ui"); - glProgramUniform4uiv = (PFNGLPROGRAMUNIFORM4UIVPROC)GLH_EXT_GET_PROC_ADDRESS("glProgramUniform4uiv"); - glProgramUniformMatrix2fv = (PFNGLPROGRAMUNIFORMMATRIX2FVPROC)GLH_EXT_GET_PROC_ADDRESS("glProgramUniformMatrix2fv"); - glProgramUniformMatrix3fv = (PFNGLPROGRAMUNIFORMMATRIX3FVPROC)GLH_EXT_GET_PROC_ADDRESS("glProgramUniformMatrix3fv"); - glProgramUniformMatrix4fv = (PFNGLPROGRAMUNIFORMMATRIX4FVPROC)GLH_EXT_GET_PROC_ADDRESS("glProgramUniformMatrix4fv"); - glProgramUniformMatrix2dv = (PFNGLPROGRAMUNIFORMMATRIX2DVPROC)GLH_EXT_GET_PROC_ADDRESS("glProgramUniformMatrix2dv"); - glProgramUniformMatrix3dv = (PFNGLPROGRAMUNIFORMMATRIX3DVPROC)GLH_EXT_GET_PROC_ADDRESS("glProgramUniformMatrix3dv"); - glProgramUniformMatrix4dv = (PFNGLPROGRAMUNIFORMMATRIX4DVPROC)GLH_EXT_GET_PROC_ADDRESS("glProgramUniformMatrix4dv"); - glProgramUniformMatrix2x3fv = (PFNGLPROGRAMUNIFORMMATRIX2X3FVPROC)GLH_EXT_GET_PROC_ADDRESS("glProgramUniformMatrix2x3fv"); - glProgramUniformMatrix3x2fv = (PFNGLPROGRAMUNIFORMMATRIX3X2FVPROC)GLH_EXT_GET_PROC_ADDRESS("glProgramUniformMatrix3x2fv"); - glProgramUniformMatrix2x4fv = (PFNGLPROGRAMUNIFORMMATRIX2X4FVPROC)GLH_EXT_GET_PROC_ADDRESS("glProgramUniformMatrix2x4fv"); - glProgramUniformMatrix4x2fv = (PFNGLPROGRAMUNIFORMMATRIX4X2FVPROC)GLH_EXT_GET_PROC_ADDRESS("glProgramUniformMatrix4x2fv"); - glProgramUniformMatrix3x4fv = (PFNGLPROGRAMUNIFORMMATRIX3X4FVPROC)GLH_EXT_GET_PROC_ADDRESS("glProgramUniformMatrix3x4fv"); - glProgramUniformMatrix4x3fv = (PFNGLPROGRAMUNIFORMMATRIX4X3FVPROC)GLH_EXT_GET_PROC_ADDRESS("glProgramUniformMatrix4x3fv"); - glProgramUniformMatrix2x3dv = (PFNGLPROGRAMUNIFORMMATRIX2X3DVPROC)GLH_EXT_GET_PROC_ADDRESS("glProgramUniformMatrix2x3dv"); - glProgramUniformMatrix3x2dv = (PFNGLPROGRAMUNIFORMMATRIX3X2DVPROC)GLH_EXT_GET_PROC_ADDRESS("glProgramUniformMatrix3x2dv"); - glProgramUniformMatrix2x4dv = (PFNGLPROGRAMUNIFORMMATRIX2X4DVPROC)GLH_EXT_GET_PROC_ADDRESS("glProgramUniformMatrix2x4dv"); - glProgramUniformMatrix4x2dv = (PFNGLPROGRAMUNIFORMMATRIX4X2DVPROC)GLH_EXT_GET_PROC_ADDRESS("glProgramUniformMatrix4x2dv"); - glProgramUniformMatrix3x4dv = (PFNGLPROGRAMUNIFORMMATRIX3X4DVPROC)GLH_EXT_GET_PROC_ADDRESS("glProgramUniformMatrix3x4dv"); - glProgramUniformMatrix4x3dv = (PFNGLPROGRAMUNIFORMMATRIX4X3DVPROC)GLH_EXT_GET_PROC_ADDRESS("glProgramUniformMatrix4x3dv"); - glValidateProgramPipeline = (PFNGLVALIDATEPROGRAMPIPELINEPROC)GLH_EXT_GET_PROC_ADDRESS("glValidateProgramPipeline"); - glGetProgramPipelineInfoLog = (PFNGLGETPROGRAMPIPELINEINFOLOGPROC)GLH_EXT_GET_PROC_ADDRESS("glGetProgramPipelineInfoLog"); - glVertexAttribL1d = (PFNGLVERTEXATTRIBL1DPROC)GLH_EXT_GET_PROC_ADDRESS("glVertexAttribL1d"); - glVertexAttribL2d = (PFNGLVERTEXATTRIBL2DPROC)GLH_EXT_GET_PROC_ADDRESS("glVertexAttribL2d"); - glVertexAttribL3d = (PFNGLVERTEXATTRIBL3DPROC)GLH_EXT_GET_PROC_ADDRESS("glVertexAttribL3d"); - glVertexAttribL4d = (PFNGLVERTEXATTRIBL4DPROC)GLH_EXT_GET_PROC_ADDRESS("glVertexAttribL4d"); - glVertexAttribL1dv = (PFNGLVERTEXATTRIBL1DVPROC)GLH_EXT_GET_PROC_ADDRESS("glVertexAttribL1dv"); - glVertexAttribL2dv = (PFNGLVERTEXATTRIBL2DVPROC)GLH_EXT_GET_PROC_ADDRESS("glVertexAttribL2dv"); - glVertexAttribL3dv = (PFNGLVERTEXATTRIBL3DVPROC)GLH_EXT_GET_PROC_ADDRESS("glVertexAttribL3dv"); - glVertexAttribL4dv = (PFNGLVERTEXATTRIBL4DVPROC)GLH_EXT_GET_PROC_ADDRESS("glVertexAttribL4dv"); - glVertexAttribLPointer = (PFNGLVERTEXATTRIBLPOINTERPROC)GLH_EXT_GET_PROC_ADDRESS("glVertexAttribLPointer"); - glGetVertexAttribLdv = (PFNGLGETVERTEXATTRIBLDVPROC)GLH_EXT_GET_PROC_ADDRESS("glGetVertexAttribLdv"); - glViewportArrayv = (PFNGLVIEWPORTARRAYVPROC)GLH_EXT_GET_PROC_ADDRESS("glViewportArrayv"); - glViewportIndexedf = (PFNGLVIEWPORTINDEXEDFPROC)GLH_EXT_GET_PROC_ADDRESS("glViewportIndexedf"); - glViewportIndexedfv = (PFNGLVIEWPORTINDEXEDFVPROC)GLH_EXT_GET_PROC_ADDRESS("glViewportIndexedfv"); - glScissorArrayv = (PFNGLSCISSORARRAYVPROC)GLH_EXT_GET_PROC_ADDRESS("glScissorArrayv"); - glScissorIndexed = (PFNGLSCISSORINDEXEDPROC)GLH_EXT_GET_PROC_ADDRESS("glScissorIndexed"); - glScissorIndexedv = (PFNGLSCISSORINDEXEDVPROC)GLH_EXT_GET_PROC_ADDRESS("glScissorIndexedv"); - glDepthRangeArrayv = (PFNGLDEPTHRANGEARRAYVPROC)GLH_EXT_GET_PROC_ADDRESS("glDepthRangeArrayv"); - glDepthRangeIndexed = (PFNGLDEPTHRANGEINDEXEDPROC)GLH_EXT_GET_PROC_ADDRESS("glDepthRangeIndexed"); - glGetFloati_v = (PFNGLGETFLOATI_VPROC)GLH_EXT_GET_PROC_ADDRESS("glGetFloati_v"); - glGetDoublei_v = (PFNGLGETDOUBLEI_VPROC)GLH_EXT_GET_PROC_ADDRESS("glGetDoublei_v"); + glReleaseShaderCompiler = (PFNGLRELEASESHADERCOMPILERPROC)LL_GET_PROC_ADDRESS("glReleaseShaderCompiler"); + glShaderBinary = (PFNGLSHADERBINARYPROC)LL_GET_PROC_ADDRESS("glShaderBinary"); + glGetShaderPrecisionFormat = (PFNGLGETSHADERPRECISIONFORMATPROC)LL_GET_PROC_ADDRESS("glGetShaderPrecisionFormat"); + glDepthRangef = (PFNGLDEPTHRANGEFPROC)LL_GET_PROC_ADDRESS("glDepthRangef"); + glClearDepthf = (PFNGLCLEARDEPTHFPROC)LL_GET_PROC_ADDRESS("glClearDepthf"); + glGetProgramBinary = (PFNGLGETPROGRAMBINARYPROC)LL_GET_PROC_ADDRESS("glGetProgramBinary"); + glProgramBinary = (PFNGLPROGRAMBINARYPROC)LL_GET_PROC_ADDRESS("glProgramBinary"); + glProgramParameteri = (PFNGLPROGRAMPARAMETERIPROC)LL_GET_PROC_ADDRESS("glProgramParameteri"); + glUseProgramStages = (PFNGLUSEPROGRAMSTAGESPROC)LL_GET_PROC_ADDRESS("glUseProgramStages"); + glActiveShaderProgram = (PFNGLACTIVESHADERPROGRAMPROC)LL_GET_PROC_ADDRESS("glActiveShaderProgram"); + glCreateShaderProgramv = (PFNGLCREATESHADERPROGRAMVPROC)LL_GET_PROC_ADDRESS("glCreateShaderProgramv"); + glBindProgramPipeline = (PFNGLBINDPROGRAMPIPELINEPROC)LL_GET_PROC_ADDRESS("glBindProgramPipeline"); + glDeleteProgramPipelines = (PFNGLDELETEPROGRAMPIPELINESPROC)LL_GET_PROC_ADDRESS("glDeleteProgramPipelines"); + glGenProgramPipelines = (PFNGLGENPROGRAMPIPELINESPROC)LL_GET_PROC_ADDRESS("glGenProgramPipelines"); + glIsProgramPipeline = (PFNGLISPROGRAMPIPELINEPROC)LL_GET_PROC_ADDRESS("glIsProgramPipeline"); + glGetProgramPipelineiv = (PFNGLGETPROGRAMPIPELINEIVPROC)LL_GET_PROC_ADDRESS("glGetProgramPipelineiv"); + glProgramUniform1i = (PFNGLPROGRAMUNIFORM1IPROC)LL_GET_PROC_ADDRESS("glProgramUniform1i"); + glProgramUniform1iv = (PFNGLPROGRAMUNIFORM1IVPROC)LL_GET_PROC_ADDRESS("glProgramUniform1iv"); + glProgramUniform1f = (PFNGLPROGRAMUNIFORM1FPROC)LL_GET_PROC_ADDRESS("glProgramUniform1f"); + glProgramUniform1fv = (PFNGLPROGRAMUNIFORM1FVPROC)LL_GET_PROC_ADDRESS("glProgramUniform1fv"); + glProgramUniform1d = (PFNGLPROGRAMUNIFORM1DPROC)LL_GET_PROC_ADDRESS("glProgramUniform1d"); + glProgramUniform1dv = (PFNGLPROGRAMUNIFORM1DVPROC)LL_GET_PROC_ADDRESS("glProgramUniform1dv"); + glProgramUniform1ui = (PFNGLPROGRAMUNIFORM1UIPROC)LL_GET_PROC_ADDRESS("glProgramUniform1ui"); + glProgramUniform1uiv = (PFNGLPROGRAMUNIFORM1UIVPROC)LL_GET_PROC_ADDRESS("glProgramUniform1uiv"); + glProgramUniform2i = (PFNGLPROGRAMUNIFORM2IPROC)LL_GET_PROC_ADDRESS("glProgramUniform2i"); + glProgramUniform2iv = (PFNGLPROGRAMUNIFORM2IVPROC)LL_GET_PROC_ADDRESS("glProgramUniform2iv"); + glProgramUniform2f = (PFNGLPROGRAMUNIFORM2FPROC)LL_GET_PROC_ADDRESS("glProgramUniform2f"); + glProgramUniform2fv = (PFNGLPROGRAMUNIFORM2FVPROC)LL_GET_PROC_ADDRESS("glProgramUniform2fv"); + glProgramUniform2d = (PFNGLPROGRAMUNIFORM2DPROC)LL_GET_PROC_ADDRESS("glProgramUniform2d"); + glProgramUniform2dv = (PFNGLPROGRAMUNIFORM2DVPROC)LL_GET_PROC_ADDRESS("glProgramUniform2dv"); + glProgramUniform2ui = (PFNGLPROGRAMUNIFORM2UIPROC)LL_GET_PROC_ADDRESS("glProgramUniform2ui"); + glProgramUniform2uiv = (PFNGLPROGRAMUNIFORM2UIVPROC)LL_GET_PROC_ADDRESS("glProgramUniform2uiv"); + glProgramUniform3i = (PFNGLPROGRAMUNIFORM3IPROC)LL_GET_PROC_ADDRESS("glProgramUniform3i"); + glProgramUniform3iv = (PFNGLPROGRAMUNIFORM3IVPROC)LL_GET_PROC_ADDRESS("glProgramUniform3iv"); + glProgramUniform3f = (PFNGLPROGRAMUNIFORM3FPROC)LL_GET_PROC_ADDRESS("glProgramUniform3f"); + glProgramUniform3fv = (PFNGLPROGRAMUNIFORM3FVPROC)LL_GET_PROC_ADDRESS("glProgramUniform3fv"); + glProgramUniform3d = (PFNGLPROGRAMUNIFORM3DPROC)LL_GET_PROC_ADDRESS("glProgramUniform3d"); + glProgramUniform3dv = (PFNGLPROGRAMUNIFORM3DVPROC)LL_GET_PROC_ADDRESS("glProgramUniform3dv"); + glProgramUniform3ui = (PFNGLPROGRAMUNIFORM3UIPROC)LL_GET_PROC_ADDRESS("glProgramUniform3ui"); + glProgramUniform3uiv = (PFNGLPROGRAMUNIFORM3UIVPROC)LL_GET_PROC_ADDRESS("glProgramUniform3uiv"); + glProgramUniform4i = (PFNGLPROGRAMUNIFORM4IPROC)LL_GET_PROC_ADDRESS("glProgramUniform4i"); + glProgramUniform4iv = (PFNGLPROGRAMUNIFORM4IVPROC)LL_GET_PROC_ADDRESS("glProgramUniform4iv"); + glProgramUniform4f = (PFNGLPROGRAMUNIFORM4FPROC)LL_GET_PROC_ADDRESS("glProgramUniform4f"); + glProgramUniform4fv = (PFNGLPROGRAMUNIFORM4FVPROC)LL_GET_PROC_ADDRESS("glProgramUniform4fv"); + glProgramUniform4d = (PFNGLPROGRAMUNIFORM4DPROC)LL_GET_PROC_ADDRESS("glProgramUniform4d"); + glProgramUniform4dv = (PFNGLPROGRAMUNIFORM4DVPROC)LL_GET_PROC_ADDRESS("glProgramUniform4dv"); + glProgramUniform4ui = (PFNGLPROGRAMUNIFORM4UIPROC)LL_GET_PROC_ADDRESS("glProgramUniform4ui"); + glProgramUniform4uiv = (PFNGLPROGRAMUNIFORM4UIVPROC)LL_GET_PROC_ADDRESS("glProgramUniform4uiv"); + glProgramUniformMatrix2fv = (PFNGLPROGRAMUNIFORMMATRIX2FVPROC)LL_GET_PROC_ADDRESS("glProgramUniformMatrix2fv"); + glProgramUniformMatrix3fv = (PFNGLPROGRAMUNIFORMMATRIX3FVPROC)LL_GET_PROC_ADDRESS("glProgramUniformMatrix3fv"); + glProgramUniformMatrix4fv = (PFNGLPROGRAMUNIFORMMATRIX4FVPROC)LL_GET_PROC_ADDRESS("glProgramUniformMatrix4fv"); + glProgramUniformMatrix2dv = (PFNGLPROGRAMUNIFORMMATRIX2DVPROC)LL_GET_PROC_ADDRESS("glProgramUniformMatrix2dv"); + glProgramUniformMatrix3dv = (PFNGLPROGRAMUNIFORMMATRIX3DVPROC)LL_GET_PROC_ADDRESS("glProgramUniformMatrix3dv"); + glProgramUniformMatrix4dv = (PFNGLPROGRAMUNIFORMMATRIX4DVPROC)LL_GET_PROC_ADDRESS("glProgramUniformMatrix4dv"); + glProgramUniformMatrix2x3fv = (PFNGLPROGRAMUNIFORMMATRIX2X3FVPROC)LL_GET_PROC_ADDRESS("glProgramUniformMatrix2x3fv"); + glProgramUniformMatrix3x2fv = (PFNGLPROGRAMUNIFORMMATRIX3X2FVPROC)LL_GET_PROC_ADDRESS("glProgramUniformMatrix3x2fv"); + glProgramUniformMatrix2x4fv = (PFNGLPROGRAMUNIFORMMATRIX2X4FVPROC)LL_GET_PROC_ADDRESS("glProgramUniformMatrix2x4fv"); + glProgramUniformMatrix4x2fv = (PFNGLPROGRAMUNIFORMMATRIX4X2FVPROC)LL_GET_PROC_ADDRESS("glProgramUniformMatrix4x2fv"); + glProgramUniformMatrix3x4fv = (PFNGLPROGRAMUNIFORMMATRIX3X4FVPROC)LL_GET_PROC_ADDRESS("glProgramUniformMatrix3x4fv"); + glProgramUniformMatrix4x3fv = (PFNGLPROGRAMUNIFORMMATRIX4X3FVPROC)LL_GET_PROC_ADDRESS("glProgramUniformMatrix4x3fv"); + glProgramUniformMatrix2x3dv = (PFNGLPROGRAMUNIFORMMATRIX2X3DVPROC)LL_GET_PROC_ADDRESS("glProgramUniformMatrix2x3dv"); + glProgramUniformMatrix3x2dv = (PFNGLPROGRAMUNIFORMMATRIX3X2DVPROC)LL_GET_PROC_ADDRESS("glProgramUniformMatrix3x2dv"); + glProgramUniformMatrix2x4dv = (PFNGLPROGRAMUNIFORMMATRIX2X4DVPROC)LL_GET_PROC_ADDRESS("glProgramUniformMatrix2x4dv"); + glProgramUniformMatrix4x2dv = (PFNGLPROGRAMUNIFORMMATRIX4X2DVPROC)LL_GET_PROC_ADDRESS("glProgramUniformMatrix4x2dv"); + glProgramUniformMatrix3x4dv = (PFNGLPROGRAMUNIFORMMATRIX3X4DVPROC)LL_GET_PROC_ADDRESS("glProgramUniformMatrix3x4dv"); + glProgramUniformMatrix4x3dv = (PFNGLPROGRAMUNIFORMMATRIX4X3DVPROC)LL_GET_PROC_ADDRESS("glProgramUniformMatrix4x3dv"); + glValidateProgramPipeline = (PFNGLVALIDATEPROGRAMPIPELINEPROC)LL_GET_PROC_ADDRESS("glValidateProgramPipeline"); + glGetProgramPipelineInfoLog = (PFNGLGETPROGRAMPIPELINEINFOLOGPROC)LL_GET_PROC_ADDRESS("glGetProgramPipelineInfoLog"); + glVertexAttribL1d = (PFNGLVERTEXATTRIBL1DPROC)LL_GET_PROC_ADDRESS("glVertexAttribL1d"); + glVertexAttribL2d = (PFNGLVERTEXATTRIBL2DPROC)LL_GET_PROC_ADDRESS("glVertexAttribL2d"); + glVertexAttribL3d = (PFNGLVERTEXATTRIBL3DPROC)LL_GET_PROC_ADDRESS("glVertexAttribL3d"); + glVertexAttribL4d = (PFNGLVERTEXATTRIBL4DPROC)LL_GET_PROC_ADDRESS("glVertexAttribL4d"); + glVertexAttribL1dv = (PFNGLVERTEXATTRIBL1DVPROC)LL_GET_PROC_ADDRESS("glVertexAttribL1dv"); + glVertexAttribL2dv = (PFNGLVERTEXATTRIBL2DVPROC)LL_GET_PROC_ADDRESS("glVertexAttribL2dv"); + glVertexAttribL3dv = (PFNGLVERTEXATTRIBL3DVPROC)LL_GET_PROC_ADDRESS("glVertexAttribL3dv"); + glVertexAttribL4dv = (PFNGLVERTEXATTRIBL4DVPROC)LL_GET_PROC_ADDRESS("glVertexAttribL4dv"); + glVertexAttribLPointer = (PFNGLVERTEXATTRIBLPOINTERPROC)LL_GET_PROC_ADDRESS("glVertexAttribLPointer"); + glGetVertexAttribLdv = (PFNGLGETVERTEXATTRIBLDVPROC)LL_GET_PROC_ADDRESS("glGetVertexAttribLdv"); + glViewportArrayv = (PFNGLVIEWPORTARRAYVPROC)LL_GET_PROC_ADDRESS("glViewportArrayv"); + glViewportIndexedf = (PFNGLVIEWPORTINDEXEDFPROC)LL_GET_PROC_ADDRESS("glViewportIndexedf"); + glViewportIndexedfv = (PFNGLVIEWPORTINDEXEDFVPROC)LL_GET_PROC_ADDRESS("glViewportIndexedfv"); + glScissorArrayv = (PFNGLSCISSORARRAYVPROC)LL_GET_PROC_ADDRESS("glScissorArrayv"); + glScissorIndexed = (PFNGLSCISSORINDEXEDPROC)LL_GET_PROC_ADDRESS("glScissorIndexed"); + glScissorIndexedv = (PFNGLSCISSORINDEXEDVPROC)LL_GET_PROC_ADDRESS("glScissorIndexedv"); + glDepthRangeArrayv = (PFNGLDEPTHRANGEARRAYVPROC)LL_GET_PROC_ADDRESS("glDepthRangeArrayv"); + glDepthRangeIndexed = (PFNGLDEPTHRANGEINDEXEDPROC)LL_GET_PROC_ADDRESS("glDepthRangeIndexed"); + glGetFloati_v = (PFNGLGETFLOATI_VPROC)LL_GET_PROC_ADDRESS("glGetFloati_v"); + glGetDoublei_v = (PFNGLGETDOUBLEI_VPROC)LL_GET_PROC_ADDRESS("glGetDoublei_v"); // GL_VERSION_4_2 if (mGLVersion < 4.19f) { return; } - glDrawArraysInstancedBaseInstance = (PFNGLDRAWARRAYSINSTANCEDBASEINSTANCEPROC)GLH_EXT_GET_PROC_ADDRESS("glDrawArraysInstancedBaseInstance"); - glDrawElementsInstancedBaseInstance = (PFNGLDRAWELEMENTSINSTANCEDBASEINSTANCEPROC)GLH_EXT_GET_PROC_ADDRESS("glDrawElementsInstancedBaseInstance"); - glDrawElementsInstancedBaseVertexBaseInstance = (PFNGLDRAWELEMENTSINSTANCEDBASEVERTEXBASEINSTANCEPROC)GLH_EXT_GET_PROC_ADDRESS("glDrawElementsInstancedBaseVertexBaseInstance"); - glGetInternalformativ = (PFNGLGETINTERNALFORMATIVPROC)GLH_EXT_GET_PROC_ADDRESS("glGetInternalformativ"); - glGetActiveAtomicCounterBufferiv = (PFNGLGETACTIVEATOMICCOUNTERBUFFERIVPROC)GLH_EXT_GET_PROC_ADDRESS("glGetActiveAtomicCounterBufferiv"); - glBindImageTexture = (PFNGLBINDIMAGETEXTUREPROC)GLH_EXT_GET_PROC_ADDRESS("glBindImageTexture"); - glMemoryBarrier = (PFNGLMEMORYBARRIERPROC)GLH_EXT_GET_PROC_ADDRESS("glMemoryBarrier"); - glTexStorage1D = (PFNGLTEXSTORAGE1DPROC)GLH_EXT_GET_PROC_ADDRESS("glTexStorage1D"); - glTexStorage2D = (PFNGLTEXSTORAGE2DPROC)GLH_EXT_GET_PROC_ADDRESS("glTexStorage2D"); - glTexStorage3D = (PFNGLTEXSTORAGE3DPROC)GLH_EXT_GET_PROC_ADDRESS("glTexStorage3D"); - glDrawTransformFeedbackInstanced = (PFNGLDRAWTRANSFORMFEEDBACKINSTANCEDPROC)GLH_EXT_GET_PROC_ADDRESS("glDrawTransformFeedbackInstanced"); - glDrawTransformFeedbackStreamInstanced = (PFNGLDRAWTRANSFORMFEEDBACKSTREAMINSTANCEDPROC)GLH_EXT_GET_PROC_ADDRESS("glDrawTransformFeedbackStreamInstanced"); + glDrawArraysInstancedBaseInstance = (PFNGLDRAWARRAYSINSTANCEDBASEINSTANCEPROC)LL_GET_PROC_ADDRESS("glDrawArraysInstancedBaseInstance"); + glDrawElementsInstancedBaseInstance = (PFNGLDRAWELEMENTSINSTANCEDBASEINSTANCEPROC)LL_GET_PROC_ADDRESS("glDrawElementsInstancedBaseInstance"); + glDrawElementsInstancedBaseVertexBaseInstance = (PFNGLDRAWELEMENTSINSTANCEDBASEVERTEXBASEINSTANCEPROC)LL_GET_PROC_ADDRESS("glDrawElementsInstancedBaseVertexBaseInstance"); + glGetInternalformativ = (PFNGLGETINTERNALFORMATIVPROC)LL_GET_PROC_ADDRESS("glGetInternalformativ"); + glGetActiveAtomicCounterBufferiv = (PFNGLGETACTIVEATOMICCOUNTERBUFFERIVPROC)LL_GET_PROC_ADDRESS("glGetActiveAtomicCounterBufferiv"); + glBindImageTexture = (PFNGLBINDIMAGETEXTUREPROC)LL_GET_PROC_ADDRESS("glBindImageTexture"); + glMemoryBarrier = (PFNGLMEMORYBARRIERPROC)LL_GET_PROC_ADDRESS("glMemoryBarrier"); + glTexStorage1D = (PFNGLTEXSTORAGE1DPROC)LL_GET_PROC_ADDRESS("glTexStorage1D"); + glTexStorage2D = (PFNGLTEXSTORAGE2DPROC)LL_GET_PROC_ADDRESS("glTexStorage2D"); + glTexStorage3D = (PFNGLTEXSTORAGE3DPROC)LL_GET_PROC_ADDRESS("glTexStorage3D"); + glDrawTransformFeedbackInstanced = (PFNGLDRAWTRANSFORMFEEDBACKINSTANCEDPROC)LL_GET_PROC_ADDRESS("glDrawTransformFeedbackInstanced"); + glDrawTransformFeedbackStreamInstanced = (PFNGLDRAWTRANSFORMFEEDBACKSTREAMINSTANCEDPROC)LL_GET_PROC_ADDRESS("glDrawTransformFeedbackStreamInstanced"); // GL_VERSION_4_3 if (mGLVersion < 4.29f) { return; } - glClearBufferData = (PFNGLCLEARBUFFERDATAPROC)GLH_EXT_GET_PROC_ADDRESS("glClearBufferData"); - glClearBufferSubData = (PFNGLCLEARBUFFERSUBDATAPROC)GLH_EXT_GET_PROC_ADDRESS("glClearBufferSubData"); - glDispatchCompute = (PFNGLDISPATCHCOMPUTEPROC)GLH_EXT_GET_PROC_ADDRESS("glDispatchCompute"); - glDispatchComputeIndirect = (PFNGLDISPATCHCOMPUTEINDIRECTPROC)GLH_EXT_GET_PROC_ADDRESS("glDispatchComputeIndirect"); - glCopyImageSubData = (PFNGLCOPYIMAGESUBDATAPROC)GLH_EXT_GET_PROC_ADDRESS("glCopyImageSubData"); - glFramebufferParameteri = (PFNGLFRAMEBUFFERPARAMETERIPROC)GLH_EXT_GET_PROC_ADDRESS("glFramebufferParameteri"); - glGetFramebufferParameteriv = (PFNGLGETFRAMEBUFFERPARAMETERIVPROC)GLH_EXT_GET_PROC_ADDRESS("glGetFramebufferParameteriv"); - glGetInternalformati64v = (PFNGLGETINTERNALFORMATI64VPROC)GLH_EXT_GET_PROC_ADDRESS("glGetInternalformati64v"); - glInvalidateTexSubImage = (PFNGLINVALIDATETEXSUBIMAGEPROC)GLH_EXT_GET_PROC_ADDRESS("glInvalidateTexSubImage"); - glInvalidateTexImage = (PFNGLINVALIDATETEXIMAGEPROC)GLH_EXT_GET_PROC_ADDRESS("glInvalidateTexImage"); - glInvalidateBufferSubData = (PFNGLINVALIDATEBUFFERSUBDATAPROC)GLH_EXT_GET_PROC_ADDRESS("glInvalidateBufferSubData"); - glInvalidateBufferData = (PFNGLINVALIDATEBUFFERDATAPROC)GLH_EXT_GET_PROC_ADDRESS("glInvalidateBufferData"); - glInvalidateFramebuffer = (PFNGLINVALIDATEFRAMEBUFFERPROC)GLH_EXT_GET_PROC_ADDRESS("glInvalidateFramebuffer"); - glInvalidateSubFramebuffer = (PFNGLINVALIDATESUBFRAMEBUFFERPROC)GLH_EXT_GET_PROC_ADDRESS("glInvalidateSubFramebuffer"); - glMultiDrawArraysIndirect = (PFNGLMULTIDRAWARRAYSINDIRECTPROC)GLH_EXT_GET_PROC_ADDRESS("glMultiDrawArraysIndirect"); - glMultiDrawElementsIndirect = (PFNGLMULTIDRAWELEMENTSINDIRECTPROC)GLH_EXT_GET_PROC_ADDRESS("glMultiDrawElementsIndirect"); - glGetProgramInterfaceiv = (PFNGLGETPROGRAMINTERFACEIVPROC)GLH_EXT_GET_PROC_ADDRESS("glGetProgramInterfaceiv"); - glGetProgramResourceIndex = (PFNGLGETPROGRAMRESOURCEINDEXPROC)GLH_EXT_GET_PROC_ADDRESS("glGetProgramResourceIndex"); - glGetProgramResourceName = (PFNGLGETPROGRAMRESOURCENAMEPROC)GLH_EXT_GET_PROC_ADDRESS("glGetProgramResourceName"); - glGetProgramResourceiv = (PFNGLGETPROGRAMRESOURCEIVPROC)GLH_EXT_GET_PROC_ADDRESS("glGetProgramResourceiv"); - glGetProgramResourceLocation = (PFNGLGETPROGRAMRESOURCELOCATIONPROC)GLH_EXT_GET_PROC_ADDRESS("glGetProgramResourceLocation"); - glGetProgramResourceLocationIndex = (PFNGLGETPROGRAMRESOURCELOCATIONINDEXPROC)GLH_EXT_GET_PROC_ADDRESS("glGetProgramResourceLocationIndex"); - glShaderStorageBlockBinding = (PFNGLSHADERSTORAGEBLOCKBINDINGPROC)GLH_EXT_GET_PROC_ADDRESS("glShaderStorageBlockBinding"); - glTexBufferRange = (PFNGLTEXBUFFERRANGEPROC)GLH_EXT_GET_PROC_ADDRESS("glTexBufferRange"); - glTexStorage2DMultisample = (PFNGLTEXSTORAGE2DMULTISAMPLEPROC)GLH_EXT_GET_PROC_ADDRESS("glTexStorage2DMultisample"); - glTexStorage3DMultisample = (PFNGLTEXSTORAGE3DMULTISAMPLEPROC)GLH_EXT_GET_PROC_ADDRESS("glTexStorage3DMultisample"); - glTextureView = (PFNGLTEXTUREVIEWPROC)GLH_EXT_GET_PROC_ADDRESS("glTextureView"); - glBindVertexBuffer = (PFNGLBINDVERTEXBUFFERPROC)GLH_EXT_GET_PROC_ADDRESS("glBindVertexBuffer"); - glVertexAttribFormat = (PFNGLVERTEXATTRIBFORMATPROC)GLH_EXT_GET_PROC_ADDRESS("glVertexAttribFormat"); - glVertexAttribIFormat = (PFNGLVERTEXATTRIBIFORMATPROC)GLH_EXT_GET_PROC_ADDRESS("glVertexAttribIFormat"); - glVertexAttribLFormat = (PFNGLVERTEXATTRIBLFORMATPROC)GLH_EXT_GET_PROC_ADDRESS("glVertexAttribLFormat"); - glVertexAttribBinding = (PFNGLVERTEXATTRIBBINDINGPROC)GLH_EXT_GET_PROC_ADDRESS("glVertexAttribBinding"); - glVertexBindingDivisor = (PFNGLVERTEXBINDINGDIVISORPROC)GLH_EXT_GET_PROC_ADDRESS("glVertexBindingDivisor"); - glDebugMessageControl = (PFNGLDEBUGMESSAGECONTROLPROC)GLH_EXT_GET_PROC_ADDRESS("glDebugMessageControl"); - glDebugMessageInsert = (PFNGLDEBUGMESSAGEINSERTPROC)GLH_EXT_GET_PROC_ADDRESS("glDebugMessageInsert"); - glDebugMessageCallback = (PFNGLDEBUGMESSAGECALLBACKPROC)GLH_EXT_GET_PROC_ADDRESS("glDebugMessageCallback"); - glGetDebugMessageLog = (PFNGLGETDEBUGMESSAGELOGPROC)GLH_EXT_GET_PROC_ADDRESS("glGetDebugMessageLog"); - glPushDebugGroup = (PFNGLPUSHDEBUGGROUPPROC)GLH_EXT_GET_PROC_ADDRESS("glPushDebugGroup"); - glPopDebugGroup = (PFNGLPOPDEBUGGROUPPROC)GLH_EXT_GET_PROC_ADDRESS("glPopDebugGroup"); - glObjectLabel = (PFNGLOBJECTLABELPROC)GLH_EXT_GET_PROC_ADDRESS("glObjectLabel"); - glGetObjectLabel = (PFNGLGETOBJECTLABELPROC)GLH_EXT_GET_PROC_ADDRESS("glGetObjectLabel"); - glObjectPtrLabel = (PFNGLOBJECTPTRLABELPROC)GLH_EXT_GET_PROC_ADDRESS("glObjectPtrLabel"); - glGetObjectPtrLabel = (PFNGLGETOBJECTPTRLABELPROC)GLH_EXT_GET_PROC_ADDRESS("glGetObjectPtrLabel"); + glClearBufferData = (PFNGLCLEARBUFFERDATAPROC)LL_GET_PROC_ADDRESS("glClearBufferData"); + glClearBufferSubData = (PFNGLCLEARBUFFERSUBDATAPROC)LL_GET_PROC_ADDRESS("glClearBufferSubData"); + glDispatchCompute = (PFNGLDISPATCHCOMPUTEPROC)LL_GET_PROC_ADDRESS("glDispatchCompute"); + glDispatchComputeIndirect = (PFNGLDISPATCHCOMPUTEINDIRECTPROC)LL_GET_PROC_ADDRESS("glDispatchComputeIndirect"); + glCopyImageSubData = (PFNGLCOPYIMAGESUBDATAPROC)LL_GET_PROC_ADDRESS("glCopyImageSubData"); + glFramebufferParameteri = (PFNGLFRAMEBUFFERPARAMETERIPROC)LL_GET_PROC_ADDRESS("glFramebufferParameteri"); + glGetFramebufferParameteriv = (PFNGLGETFRAMEBUFFERPARAMETERIVPROC)LL_GET_PROC_ADDRESS("glGetFramebufferParameteriv"); + glGetInternalformati64v = (PFNGLGETINTERNALFORMATI64VPROC)LL_GET_PROC_ADDRESS("glGetInternalformati64v"); + glInvalidateTexSubImage = (PFNGLINVALIDATETEXSUBIMAGEPROC)LL_GET_PROC_ADDRESS("glInvalidateTexSubImage"); + glInvalidateTexImage = (PFNGLINVALIDATETEXIMAGEPROC)LL_GET_PROC_ADDRESS("glInvalidateTexImage"); + glInvalidateBufferSubData = (PFNGLINVALIDATEBUFFERSUBDATAPROC)LL_GET_PROC_ADDRESS("glInvalidateBufferSubData"); + glInvalidateBufferData = (PFNGLINVALIDATEBUFFERDATAPROC)LL_GET_PROC_ADDRESS("glInvalidateBufferData"); + glInvalidateFramebuffer = (PFNGLINVALIDATEFRAMEBUFFERPROC)LL_GET_PROC_ADDRESS("glInvalidateFramebuffer"); + glInvalidateSubFramebuffer = (PFNGLINVALIDATESUBFRAMEBUFFERPROC)LL_GET_PROC_ADDRESS("glInvalidateSubFramebuffer"); + glMultiDrawArraysIndirect = (PFNGLMULTIDRAWARRAYSINDIRECTPROC)LL_GET_PROC_ADDRESS("glMultiDrawArraysIndirect"); + glMultiDrawElementsIndirect = (PFNGLMULTIDRAWELEMENTSINDIRECTPROC)LL_GET_PROC_ADDRESS("glMultiDrawElementsIndirect"); + glGetProgramInterfaceiv = (PFNGLGETPROGRAMINTERFACEIVPROC)LL_GET_PROC_ADDRESS("glGetProgramInterfaceiv"); + glGetProgramResourceIndex = (PFNGLGETPROGRAMRESOURCEINDEXPROC)LL_GET_PROC_ADDRESS("glGetProgramResourceIndex"); + glGetProgramResourceName = (PFNGLGETPROGRAMRESOURCENAMEPROC)LL_GET_PROC_ADDRESS("glGetProgramResourceName"); + glGetProgramResourceiv = (PFNGLGETPROGRAMRESOURCEIVPROC)LL_GET_PROC_ADDRESS("glGetProgramResourceiv"); + glGetProgramResourceLocation = (PFNGLGETPROGRAMRESOURCELOCATIONPROC)LL_GET_PROC_ADDRESS("glGetProgramResourceLocation"); + glGetProgramResourceLocationIndex = (PFNGLGETPROGRAMRESOURCELOCATIONINDEXPROC)LL_GET_PROC_ADDRESS("glGetProgramResourceLocationIndex"); + glShaderStorageBlockBinding = (PFNGLSHADERSTORAGEBLOCKBINDINGPROC)LL_GET_PROC_ADDRESS("glShaderStorageBlockBinding"); + glTexBufferRange = (PFNGLTEXBUFFERRANGEPROC)LL_GET_PROC_ADDRESS("glTexBufferRange"); + glTexStorage2DMultisample = (PFNGLTEXSTORAGE2DMULTISAMPLEPROC)LL_GET_PROC_ADDRESS("glTexStorage2DMultisample"); + glTexStorage3DMultisample = (PFNGLTEXSTORAGE3DMULTISAMPLEPROC)LL_GET_PROC_ADDRESS("glTexStorage3DMultisample"); + glTextureView = (PFNGLTEXTUREVIEWPROC)LL_GET_PROC_ADDRESS("glTextureView"); + glBindVertexBuffer = (PFNGLBINDVERTEXBUFFERPROC)LL_GET_PROC_ADDRESS("glBindVertexBuffer"); + glVertexAttribFormat = (PFNGLVERTEXATTRIBFORMATPROC)LL_GET_PROC_ADDRESS("glVertexAttribFormat"); + glVertexAttribIFormat = (PFNGLVERTEXATTRIBIFORMATPROC)LL_GET_PROC_ADDRESS("glVertexAttribIFormat"); + glVertexAttribLFormat = (PFNGLVERTEXATTRIBLFORMATPROC)LL_GET_PROC_ADDRESS("glVertexAttribLFormat"); + glVertexAttribBinding = (PFNGLVERTEXATTRIBBINDINGPROC)LL_GET_PROC_ADDRESS("glVertexAttribBinding"); + glVertexBindingDivisor = (PFNGLVERTEXBINDINGDIVISORPROC)LL_GET_PROC_ADDRESS("glVertexBindingDivisor"); + glDebugMessageControl = (PFNGLDEBUGMESSAGECONTROLPROC)LL_GET_PROC_ADDRESS("glDebugMessageControl"); + glDebugMessageInsert = (PFNGLDEBUGMESSAGEINSERTPROC)LL_GET_PROC_ADDRESS("glDebugMessageInsert"); + glDebugMessageCallback = (PFNGLDEBUGMESSAGECALLBACKPROC)LL_GET_PROC_ADDRESS("glDebugMessageCallback"); + glGetDebugMessageLog = (PFNGLGETDEBUGMESSAGELOGPROC)LL_GET_PROC_ADDRESS("glGetDebugMessageLog"); + glPushDebugGroup = (PFNGLPUSHDEBUGGROUPPROC)LL_GET_PROC_ADDRESS("glPushDebugGroup"); + glPopDebugGroup = (PFNGLPOPDEBUGGROUPPROC)LL_GET_PROC_ADDRESS("glPopDebugGroup"); + glObjectLabel = (PFNGLOBJECTLABELPROC)LL_GET_PROC_ADDRESS("glObjectLabel"); + glGetObjectLabel = (PFNGLGETOBJECTLABELPROC)LL_GET_PROC_ADDRESS("glGetObjectLabel"); + glObjectPtrLabel = (PFNGLOBJECTPTRLABELPROC)LL_GET_PROC_ADDRESS("glObjectPtrLabel"); + glGetObjectPtrLabel = (PFNGLGETOBJECTPTRLABELPROC)LL_GET_PROC_ADDRESS("glGetObjectPtrLabel"); // GL_VERSION_4_4 if (mGLVersion < 4.39f) { return; } - glBufferStorage = (PFNGLBUFFERSTORAGEPROC)GLH_EXT_GET_PROC_ADDRESS("glBufferStorage"); - glClearTexImage = (PFNGLCLEARTEXIMAGEPROC)GLH_EXT_GET_PROC_ADDRESS("glClearTexImage"); - glClearTexSubImage = (PFNGLCLEARTEXSUBIMAGEPROC)GLH_EXT_GET_PROC_ADDRESS("glClearTexSubImage"); - glBindBuffersBase = (PFNGLBINDBUFFERSBASEPROC)GLH_EXT_GET_PROC_ADDRESS("glBindBuffersBase"); - glBindBuffersRange = (PFNGLBINDBUFFERSRANGEPROC)GLH_EXT_GET_PROC_ADDRESS("glBindBuffersRange"); - glBindTextures = (PFNGLBINDTEXTURESPROC)GLH_EXT_GET_PROC_ADDRESS("glBindTextures"); - glBindSamplers = (PFNGLBINDSAMPLERSPROC)GLH_EXT_GET_PROC_ADDRESS("glBindSamplers"); - glBindImageTextures = (PFNGLBINDIMAGETEXTURESPROC)GLH_EXT_GET_PROC_ADDRESS("glBindImageTextures"); - glBindVertexBuffers = (PFNGLBINDVERTEXBUFFERSPROC)GLH_EXT_GET_PROC_ADDRESS("glBindVertexBuffers"); + glBufferStorage = (PFNGLBUFFERSTORAGEPROC)LL_GET_PROC_ADDRESS("glBufferStorage"); + glClearTexImage = (PFNGLCLEARTEXIMAGEPROC)LL_GET_PROC_ADDRESS("glClearTexImage"); + glClearTexSubImage = (PFNGLCLEARTEXSUBIMAGEPROC)LL_GET_PROC_ADDRESS("glClearTexSubImage"); + glBindBuffersBase = (PFNGLBINDBUFFERSBASEPROC)LL_GET_PROC_ADDRESS("glBindBuffersBase"); + glBindBuffersRange = (PFNGLBINDBUFFERSRANGEPROC)LL_GET_PROC_ADDRESS("glBindBuffersRange"); + glBindTextures = (PFNGLBINDTEXTURESPROC)LL_GET_PROC_ADDRESS("glBindTextures"); + glBindSamplers = (PFNGLBINDSAMPLERSPROC)LL_GET_PROC_ADDRESS("glBindSamplers"); + glBindImageTextures = (PFNGLBINDIMAGETEXTURESPROC)LL_GET_PROC_ADDRESS("glBindImageTextures"); + glBindVertexBuffers = (PFNGLBINDVERTEXBUFFERSPROC)LL_GET_PROC_ADDRESS("glBindVertexBuffers"); // GL_VERSION_4_5 if (mGLVersion < 4.49f) { return; } - glClipControl = (PFNGLCLIPCONTROLPROC)GLH_EXT_GET_PROC_ADDRESS("glClipControl"); - glCreateTransformFeedbacks = (PFNGLCREATETRANSFORMFEEDBACKSPROC)GLH_EXT_GET_PROC_ADDRESS("glCreateTransformFeedbacks"); - glTransformFeedbackBufferBase = (PFNGLTRANSFORMFEEDBACKBUFFERBASEPROC)GLH_EXT_GET_PROC_ADDRESS("glTransformFeedbackBufferBase"); - glTransformFeedbackBufferRange = (PFNGLTRANSFORMFEEDBACKBUFFERRANGEPROC)GLH_EXT_GET_PROC_ADDRESS("glTransformFeedbackBufferRange"); - glGetTransformFeedbackiv = (PFNGLGETTRANSFORMFEEDBACKIVPROC)GLH_EXT_GET_PROC_ADDRESS("glGetTransformFeedbackiv"); - glGetTransformFeedbacki_v = (PFNGLGETTRANSFORMFEEDBACKI_VPROC)GLH_EXT_GET_PROC_ADDRESS("glGetTransformFeedbacki_v"); - glGetTransformFeedbacki64_v = (PFNGLGETTRANSFORMFEEDBACKI64_VPROC)GLH_EXT_GET_PROC_ADDRESS("glGetTransformFeedbacki64_v"); - glCreateBuffers = (PFNGLCREATEBUFFERSPROC)GLH_EXT_GET_PROC_ADDRESS("glCreateBuffers"); - glNamedBufferStorage = (PFNGLNAMEDBUFFERSTORAGEPROC)GLH_EXT_GET_PROC_ADDRESS("glNamedBufferStorage"); - glNamedBufferData = (PFNGLNAMEDBUFFERDATAPROC)GLH_EXT_GET_PROC_ADDRESS("glNamedBufferData"); - glNamedBufferSubData = (PFNGLNAMEDBUFFERSUBDATAPROC)GLH_EXT_GET_PROC_ADDRESS("glNamedBufferSubData"); - glCopyNamedBufferSubData = (PFNGLCOPYNAMEDBUFFERSUBDATAPROC)GLH_EXT_GET_PROC_ADDRESS("glCopyNamedBufferSubData"); - glClearNamedBufferData = (PFNGLCLEARNAMEDBUFFERDATAPROC)GLH_EXT_GET_PROC_ADDRESS("glClearNamedBufferData"); - glClearNamedBufferSubData = (PFNGLCLEARNAMEDBUFFERSUBDATAPROC)GLH_EXT_GET_PROC_ADDRESS("glClearNamedBufferSubData"); - glMapNamedBuffer = (PFNGLMAPNAMEDBUFFERPROC)GLH_EXT_GET_PROC_ADDRESS("glMapNamedBuffer"); - glMapNamedBufferRange = (PFNGLMAPNAMEDBUFFERRANGEPROC)GLH_EXT_GET_PROC_ADDRESS("glMapNamedBufferRange"); - glUnmapNamedBuffer = (PFNGLUNMAPNAMEDBUFFERPROC)GLH_EXT_GET_PROC_ADDRESS("glUnmapNamedBuffer"); - glFlushMappedNamedBufferRange = (PFNGLFLUSHMAPPEDNAMEDBUFFERRANGEPROC)GLH_EXT_GET_PROC_ADDRESS("glFlushMappedNamedBufferRange"); - glGetNamedBufferParameteriv = (PFNGLGETNAMEDBUFFERPARAMETERIVPROC)GLH_EXT_GET_PROC_ADDRESS("glGetNamedBufferParameteriv"); - glGetNamedBufferParameteri64v = (PFNGLGETNAMEDBUFFERPARAMETERI64VPROC)GLH_EXT_GET_PROC_ADDRESS("glGetNamedBufferParameteri64v"); - glGetNamedBufferPointerv = (PFNGLGETNAMEDBUFFERPOINTERVPROC)GLH_EXT_GET_PROC_ADDRESS("glGetNamedBufferPointerv"); - glGetNamedBufferSubData = (PFNGLGETNAMEDBUFFERSUBDATAPROC)GLH_EXT_GET_PROC_ADDRESS("glGetNamedBufferSubData"); - glCreateFramebuffers = (PFNGLCREATEFRAMEBUFFERSPROC)GLH_EXT_GET_PROC_ADDRESS("glCreateFramebuffers"); - glNamedFramebufferRenderbuffer = (PFNGLNAMEDFRAMEBUFFERRENDERBUFFERPROC)GLH_EXT_GET_PROC_ADDRESS("glNamedFramebufferRenderbuffer"); - glNamedFramebufferParameteri = (PFNGLNAMEDFRAMEBUFFERPARAMETERIPROC)GLH_EXT_GET_PROC_ADDRESS("glNamedFramebufferParameteri"); - glNamedFramebufferTexture = (PFNGLNAMEDFRAMEBUFFERTEXTUREPROC)GLH_EXT_GET_PROC_ADDRESS("glNamedFramebufferTexture"); - glNamedFramebufferTextureLayer = (PFNGLNAMEDFRAMEBUFFERTEXTURELAYERPROC)GLH_EXT_GET_PROC_ADDRESS("glNamedFramebufferTextureLayer"); - glNamedFramebufferDrawBuffer = (PFNGLNAMEDFRAMEBUFFERDRAWBUFFERPROC)GLH_EXT_GET_PROC_ADDRESS("glNamedFramebufferDrawBuffer"); - glNamedFramebufferDrawBuffers = (PFNGLNAMEDFRAMEBUFFERDRAWBUFFERSPROC)GLH_EXT_GET_PROC_ADDRESS("glNamedFramebufferDrawBuffers"); - glNamedFramebufferReadBuffer = (PFNGLNAMEDFRAMEBUFFERREADBUFFERPROC)GLH_EXT_GET_PROC_ADDRESS("glNamedFramebufferReadBuffer"); - glInvalidateNamedFramebufferData = (PFNGLINVALIDATENAMEDFRAMEBUFFERDATAPROC)GLH_EXT_GET_PROC_ADDRESS("glInvalidateNamedFramebufferData"); - glInvalidateNamedFramebufferSubData = (PFNGLINVALIDATENAMEDFRAMEBUFFERSUBDATAPROC)GLH_EXT_GET_PROC_ADDRESS("glInvalidateNamedFramebufferSubData"); - glClearNamedFramebufferiv = (PFNGLCLEARNAMEDFRAMEBUFFERIVPROC)GLH_EXT_GET_PROC_ADDRESS("glClearNamedFramebufferiv"); - glClearNamedFramebufferuiv = (PFNGLCLEARNAMEDFRAMEBUFFERUIVPROC)GLH_EXT_GET_PROC_ADDRESS("glClearNamedFramebufferuiv"); - glClearNamedFramebufferfv = (PFNGLCLEARNAMEDFRAMEBUFFERFVPROC)GLH_EXT_GET_PROC_ADDRESS("glClearNamedFramebufferfv"); - glClearNamedFramebufferfi = (PFNGLCLEARNAMEDFRAMEBUFFERFIPROC)GLH_EXT_GET_PROC_ADDRESS("glClearNamedFramebufferfi"); - glBlitNamedFramebuffer = (PFNGLBLITNAMEDFRAMEBUFFERPROC)GLH_EXT_GET_PROC_ADDRESS("glBlitNamedFramebuffer"); - glCheckNamedFramebufferStatus = (PFNGLCHECKNAMEDFRAMEBUFFERSTATUSPROC)GLH_EXT_GET_PROC_ADDRESS("glCheckNamedFramebufferStatus"); - glGetNamedFramebufferParameteriv = (PFNGLGETNAMEDFRAMEBUFFERPARAMETERIVPROC)GLH_EXT_GET_PROC_ADDRESS("glGetNamedFramebufferParameteriv"); - glGetNamedFramebufferAttachmentParameteriv = (PFNGLGETNAMEDFRAMEBUFFERATTACHMENTPARAMETERIVPROC)GLH_EXT_GET_PROC_ADDRESS("glGetNamedFramebufferAttachmentParameteriv"); - glCreateRenderbuffers = (PFNGLCREATERENDERBUFFERSPROC)GLH_EXT_GET_PROC_ADDRESS("glCreateRenderbuffers"); - glNamedRenderbufferStorage = (PFNGLNAMEDRENDERBUFFERSTORAGEPROC)GLH_EXT_GET_PROC_ADDRESS("glNamedRenderbufferStorage"); - glNamedRenderbufferStorageMultisample = (PFNGLNAMEDRENDERBUFFERSTORAGEMULTISAMPLEPROC)GLH_EXT_GET_PROC_ADDRESS("glNamedRenderbufferStorageMultisample"); - glGetNamedRenderbufferParameteriv = (PFNGLGETNAMEDRENDERBUFFERPARAMETERIVPROC)GLH_EXT_GET_PROC_ADDRESS("glGetNamedRenderbufferParameteriv"); - glCreateTextures = (PFNGLCREATETEXTURESPROC)GLH_EXT_GET_PROC_ADDRESS("glCreateTextures"); - glTextureBuffer = (PFNGLTEXTUREBUFFERPROC)GLH_EXT_GET_PROC_ADDRESS("glTextureBuffer"); - glTextureBufferRange = (PFNGLTEXTUREBUFFERRANGEPROC)GLH_EXT_GET_PROC_ADDRESS("glTextureBufferRange"); - glTextureStorage1D = (PFNGLTEXTURESTORAGE1DPROC)GLH_EXT_GET_PROC_ADDRESS("glTextureStorage1D"); - glTextureStorage2D = (PFNGLTEXTURESTORAGE2DPROC)GLH_EXT_GET_PROC_ADDRESS("glTextureStorage2D"); - glTextureStorage3D = (PFNGLTEXTURESTORAGE3DPROC)GLH_EXT_GET_PROC_ADDRESS("glTextureStorage3D"); - glTextureStorage2DMultisample = (PFNGLTEXTURESTORAGE2DMULTISAMPLEPROC)GLH_EXT_GET_PROC_ADDRESS("glTextureStorage2DMultisample"); - glTextureStorage3DMultisample = (PFNGLTEXTURESTORAGE3DMULTISAMPLEPROC)GLH_EXT_GET_PROC_ADDRESS("glTextureStorage3DMultisample"); - glTextureSubImage1D = (PFNGLTEXTURESUBIMAGE1DPROC)GLH_EXT_GET_PROC_ADDRESS("glTextureSubImage1D"); - glTextureSubImage2D = (PFNGLTEXTURESUBIMAGE2DPROC)GLH_EXT_GET_PROC_ADDRESS("glTextureSubImage2D"); - glTextureSubImage3D = (PFNGLTEXTURESUBIMAGE3DPROC)GLH_EXT_GET_PROC_ADDRESS("glTextureSubImage3D"); - glCompressedTextureSubImage1D = (PFNGLCOMPRESSEDTEXTURESUBIMAGE1DPROC)GLH_EXT_GET_PROC_ADDRESS("glCompressedTextureSubImage1D"); - glCompressedTextureSubImage2D = (PFNGLCOMPRESSEDTEXTURESUBIMAGE2DPROC)GLH_EXT_GET_PROC_ADDRESS("glCompressedTextureSubImage2D"); - glCompressedTextureSubImage3D = (PFNGLCOMPRESSEDTEXTURESUBIMAGE3DPROC)GLH_EXT_GET_PROC_ADDRESS("glCompressedTextureSubImage3D"); - glCopyTextureSubImage1D = (PFNGLCOPYTEXTURESUBIMAGE1DPROC)GLH_EXT_GET_PROC_ADDRESS("glCopyTextureSubImage1D"); - glCopyTextureSubImage2D = (PFNGLCOPYTEXTURESUBIMAGE2DPROC)GLH_EXT_GET_PROC_ADDRESS("glCopyTextureSubImage2D"); - glCopyTextureSubImage3D = (PFNGLCOPYTEXTURESUBIMAGE3DPROC)GLH_EXT_GET_PROC_ADDRESS("glCopyTextureSubImage3D"); - glTextureParameterf = (PFNGLTEXTUREPARAMETERFPROC)GLH_EXT_GET_PROC_ADDRESS("glTextureParameterf"); - glTextureParameterfv = (PFNGLTEXTUREPARAMETERFVPROC)GLH_EXT_GET_PROC_ADDRESS("glTextureParameterfv"); - glTextureParameteri = (PFNGLTEXTUREPARAMETERIPROC)GLH_EXT_GET_PROC_ADDRESS("glTextureParameteri"); - glTextureParameterIiv = (PFNGLTEXTUREPARAMETERIIVPROC)GLH_EXT_GET_PROC_ADDRESS("glTextureParameterIiv"); - glTextureParameterIuiv = (PFNGLTEXTUREPARAMETERIUIVPROC)GLH_EXT_GET_PROC_ADDRESS("glTextureParameterIuiv"); - glTextureParameteriv = (PFNGLTEXTUREPARAMETERIVPROC)GLH_EXT_GET_PROC_ADDRESS("glTextureParameteriv"); - glGenerateTextureMipmap = (PFNGLGENERATETEXTUREMIPMAPPROC)GLH_EXT_GET_PROC_ADDRESS("glGenerateTextureMipmap"); - glBindTextureUnit = (PFNGLBINDTEXTUREUNITPROC)GLH_EXT_GET_PROC_ADDRESS("glBindTextureUnit"); - glGetTextureImage = (PFNGLGETTEXTUREIMAGEPROC)GLH_EXT_GET_PROC_ADDRESS("glGetTextureImage"); - glGetCompressedTextureImage = (PFNGLGETCOMPRESSEDTEXTUREIMAGEPROC)GLH_EXT_GET_PROC_ADDRESS("glGetCompressedTextureImage"); - glGetTextureLevelParameterfv = (PFNGLGETTEXTURELEVELPARAMETERFVPROC)GLH_EXT_GET_PROC_ADDRESS("glGetTextureLevelParameterfv"); - glGetTextureLevelParameteriv = (PFNGLGETTEXTURELEVELPARAMETERIVPROC)GLH_EXT_GET_PROC_ADDRESS("glGetTextureLevelParameteriv"); - glGetTextureParameterfv = (PFNGLGETTEXTUREPARAMETERFVPROC)GLH_EXT_GET_PROC_ADDRESS("glGetTextureParameterfv"); - glGetTextureParameterIiv = (PFNGLGETTEXTUREPARAMETERIIVPROC)GLH_EXT_GET_PROC_ADDRESS("glGetTextureParameterIiv"); - glGetTextureParameterIuiv = (PFNGLGETTEXTUREPARAMETERIUIVPROC)GLH_EXT_GET_PROC_ADDRESS("glGetTextureParameterIuiv"); - glGetTextureParameteriv = (PFNGLGETTEXTUREPARAMETERIVPROC)GLH_EXT_GET_PROC_ADDRESS("glGetTextureParameteriv"); - glCreateVertexArrays = (PFNGLCREATEVERTEXARRAYSPROC)GLH_EXT_GET_PROC_ADDRESS("glCreateVertexArrays"); - glDisableVertexArrayAttrib = (PFNGLDISABLEVERTEXARRAYATTRIBPROC)GLH_EXT_GET_PROC_ADDRESS("glDisableVertexArrayAttrib"); - glEnableVertexArrayAttrib = (PFNGLENABLEVERTEXARRAYATTRIBPROC)GLH_EXT_GET_PROC_ADDRESS("glEnableVertexArrayAttrib"); - glVertexArrayElementBuffer = (PFNGLVERTEXARRAYELEMENTBUFFERPROC)GLH_EXT_GET_PROC_ADDRESS("glVertexArrayElementBuffer"); - glVertexArrayVertexBuffer = (PFNGLVERTEXARRAYVERTEXBUFFERPROC)GLH_EXT_GET_PROC_ADDRESS("glVertexArrayVertexBuffer"); - glVertexArrayVertexBuffers = (PFNGLVERTEXARRAYVERTEXBUFFERSPROC)GLH_EXT_GET_PROC_ADDRESS("glVertexArrayVertexBuffers"); - glVertexArrayAttribBinding = (PFNGLVERTEXARRAYATTRIBBINDINGPROC)GLH_EXT_GET_PROC_ADDRESS("glVertexArrayAttribBinding"); - glVertexArrayAttribFormat = (PFNGLVERTEXARRAYATTRIBFORMATPROC)GLH_EXT_GET_PROC_ADDRESS("glVertexArrayAttribFormat"); - glVertexArrayAttribIFormat = (PFNGLVERTEXARRAYATTRIBIFORMATPROC)GLH_EXT_GET_PROC_ADDRESS("glVertexArrayAttribIFormat"); - glVertexArrayAttribLFormat = (PFNGLVERTEXARRAYATTRIBLFORMATPROC)GLH_EXT_GET_PROC_ADDRESS("glVertexArrayAttribLFormat"); - glVertexArrayBindingDivisor = (PFNGLVERTEXARRAYBINDINGDIVISORPROC)GLH_EXT_GET_PROC_ADDRESS("glVertexArrayBindingDivisor"); - glGetVertexArrayiv = (PFNGLGETVERTEXARRAYIVPROC)GLH_EXT_GET_PROC_ADDRESS("glGetVertexArrayiv"); - glGetVertexArrayIndexediv = (PFNGLGETVERTEXARRAYINDEXEDIVPROC)GLH_EXT_GET_PROC_ADDRESS("glGetVertexArrayIndexediv"); - glGetVertexArrayIndexed64iv = (PFNGLGETVERTEXARRAYINDEXED64IVPROC)GLH_EXT_GET_PROC_ADDRESS("glGetVertexArrayIndexed64iv"); - glCreateSamplers = (PFNGLCREATESAMPLERSPROC)GLH_EXT_GET_PROC_ADDRESS("glCreateSamplers"); - glCreateProgramPipelines = (PFNGLCREATEPROGRAMPIPELINESPROC)GLH_EXT_GET_PROC_ADDRESS("glCreateProgramPipelines"); - glCreateQueries = (PFNGLCREATEQUERIESPROC)GLH_EXT_GET_PROC_ADDRESS("glCreateQueries"); - glGetQueryBufferObjecti64v = (PFNGLGETQUERYBUFFEROBJECTI64VPROC)GLH_EXT_GET_PROC_ADDRESS("glGetQueryBufferObjecti64v"); - glGetQueryBufferObjectiv = (PFNGLGETQUERYBUFFEROBJECTIVPROC)GLH_EXT_GET_PROC_ADDRESS("glGetQueryBufferObjectiv"); - glGetQueryBufferObjectui64v = (PFNGLGETQUERYBUFFEROBJECTUI64VPROC)GLH_EXT_GET_PROC_ADDRESS("glGetQueryBufferObjectui64v"); - glGetQueryBufferObjectuiv = (PFNGLGETQUERYBUFFEROBJECTUIVPROC)GLH_EXT_GET_PROC_ADDRESS("glGetQueryBufferObjectuiv"); - glMemoryBarrierByRegion = (PFNGLMEMORYBARRIERBYREGIONPROC)GLH_EXT_GET_PROC_ADDRESS("glMemoryBarrierByRegion"); - glGetTextureSubImage = (PFNGLGETTEXTURESUBIMAGEPROC)GLH_EXT_GET_PROC_ADDRESS("glGetTextureSubImage"); - glGetCompressedTextureSubImage = (PFNGLGETCOMPRESSEDTEXTURESUBIMAGEPROC)GLH_EXT_GET_PROC_ADDRESS("glGetCompressedTextureSubImage"); - glGetGraphicsResetStatus = (PFNGLGETGRAPHICSRESETSTATUSPROC)GLH_EXT_GET_PROC_ADDRESS("glGetGraphicsResetStatus"); - glGetnCompressedTexImage = (PFNGLGETNCOMPRESSEDTEXIMAGEPROC)GLH_EXT_GET_PROC_ADDRESS("glGetnCompressedTexImage"); - glGetnTexImage = (PFNGLGETNTEXIMAGEPROC)GLH_EXT_GET_PROC_ADDRESS("glGetnTexImage"); - glGetnUniformdv = (PFNGLGETNUNIFORMDVPROC)GLH_EXT_GET_PROC_ADDRESS("glGetnUniformdv"); - glGetnUniformfv = (PFNGLGETNUNIFORMFVPROC)GLH_EXT_GET_PROC_ADDRESS("glGetnUniformfv"); - glGetnUniformiv = (PFNGLGETNUNIFORMIVPROC)GLH_EXT_GET_PROC_ADDRESS("glGetnUniformiv"); - glGetnUniformuiv = (PFNGLGETNUNIFORMUIVPROC)GLH_EXT_GET_PROC_ADDRESS("glGetnUniformuiv"); - glReadnPixels = (PFNGLREADNPIXELSPROC)GLH_EXT_GET_PROC_ADDRESS("glReadnPixels"); - glGetnMapdv = (PFNGLGETNMAPDVPROC)GLH_EXT_GET_PROC_ADDRESS("glGetnMapdv"); - glGetnMapfv = (PFNGLGETNMAPFVPROC)GLH_EXT_GET_PROC_ADDRESS("glGetnMapfv"); - glGetnMapiv = (PFNGLGETNMAPIVPROC)GLH_EXT_GET_PROC_ADDRESS("glGetnMapiv"); - glGetnPixelMapfv = (PFNGLGETNPIXELMAPFVPROC)GLH_EXT_GET_PROC_ADDRESS("glGetnPixelMapfv"); - glGetnPixelMapuiv = (PFNGLGETNPIXELMAPUIVPROC)GLH_EXT_GET_PROC_ADDRESS("glGetnPixelMapuiv"); - glGetnPixelMapusv = (PFNGLGETNPIXELMAPUSVPROC)GLH_EXT_GET_PROC_ADDRESS("glGetnPixelMapusv"); - glGetnPolygonStipple = (PFNGLGETNPOLYGONSTIPPLEPROC)GLH_EXT_GET_PROC_ADDRESS("glGetnPolygonStipple"); - glGetnColorTable = (PFNGLGETNCOLORTABLEPROC)GLH_EXT_GET_PROC_ADDRESS("glGetnColorTable"); - glGetnConvolutionFilter = (PFNGLGETNCONVOLUTIONFILTERPROC)GLH_EXT_GET_PROC_ADDRESS("glGetnConvolutionFilter"); - glGetnSeparableFilter = (PFNGLGETNSEPARABLEFILTERPROC)GLH_EXT_GET_PROC_ADDRESS("glGetnSeparableFilter"); - glGetnHistogram = (PFNGLGETNHISTOGRAMPROC)GLH_EXT_GET_PROC_ADDRESS("glGetnHistogram"); - glGetnMinmax = (PFNGLGETNMINMAXPROC)GLH_EXT_GET_PROC_ADDRESS("glGetnMinmax"); - glTextureBarrier = (PFNGLTEXTUREBARRIERPROC)GLH_EXT_GET_PROC_ADDRESS("glTextureBarrier"); + glClipControl = (PFNGLCLIPCONTROLPROC)LL_GET_PROC_ADDRESS("glClipControl"); + glCreateTransformFeedbacks = (PFNGLCREATETRANSFORMFEEDBACKSPROC)LL_GET_PROC_ADDRESS("glCreateTransformFeedbacks"); + glTransformFeedbackBufferBase = (PFNGLTRANSFORMFEEDBACKBUFFERBASEPROC)LL_GET_PROC_ADDRESS("glTransformFeedbackBufferBase"); + glTransformFeedbackBufferRange = (PFNGLTRANSFORMFEEDBACKBUFFERRANGEPROC)LL_GET_PROC_ADDRESS("glTransformFeedbackBufferRange"); + glGetTransformFeedbackiv = (PFNGLGETTRANSFORMFEEDBACKIVPROC)LL_GET_PROC_ADDRESS("glGetTransformFeedbackiv"); + glGetTransformFeedbacki_v = (PFNGLGETTRANSFORMFEEDBACKI_VPROC)LL_GET_PROC_ADDRESS("glGetTransformFeedbacki_v"); + glGetTransformFeedbacki64_v = (PFNGLGETTRANSFORMFEEDBACKI64_VPROC)LL_GET_PROC_ADDRESS("glGetTransformFeedbacki64_v"); + glCreateBuffers = (PFNGLCREATEBUFFERSPROC)LL_GET_PROC_ADDRESS("glCreateBuffers"); + glNamedBufferStorage = (PFNGLNAMEDBUFFERSTORAGEPROC)LL_GET_PROC_ADDRESS("glNamedBufferStorage"); + glNamedBufferData = (PFNGLNAMEDBUFFERDATAPROC)LL_GET_PROC_ADDRESS("glNamedBufferData"); + glNamedBufferSubData = (PFNGLNAMEDBUFFERSUBDATAPROC)LL_GET_PROC_ADDRESS("glNamedBufferSubData"); + glCopyNamedBufferSubData = (PFNGLCOPYNAMEDBUFFERSUBDATAPROC)LL_GET_PROC_ADDRESS("glCopyNamedBufferSubData"); + glClearNamedBufferData = (PFNGLCLEARNAMEDBUFFERDATAPROC)LL_GET_PROC_ADDRESS("glClearNamedBufferData"); + glClearNamedBufferSubData = (PFNGLCLEARNAMEDBUFFERSUBDATAPROC)LL_GET_PROC_ADDRESS("glClearNamedBufferSubData"); + glMapNamedBuffer = (PFNGLMAPNAMEDBUFFERPROC)LL_GET_PROC_ADDRESS("glMapNamedBuffer"); + glMapNamedBufferRange = (PFNGLMAPNAMEDBUFFERRANGEPROC)LL_GET_PROC_ADDRESS("glMapNamedBufferRange"); + glUnmapNamedBuffer = (PFNGLUNMAPNAMEDBUFFERPROC)LL_GET_PROC_ADDRESS("glUnmapNamedBuffer"); + glFlushMappedNamedBufferRange = (PFNGLFLUSHMAPPEDNAMEDBUFFERRANGEPROC)LL_GET_PROC_ADDRESS("glFlushMappedNamedBufferRange"); + glGetNamedBufferParameteriv = (PFNGLGETNAMEDBUFFERPARAMETERIVPROC)LL_GET_PROC_ADDRESS("glGetNamedBufferParameteriv"); + glGetNamedBufferParameteri64v = (PFNGLGETNAMEDBUFFERPARAMETERI64VPROC)LL_GET_PROC_ADDRESS("glGetNamedBufferParameteri64v"); + glGetNamedBufferPointerv = (PFNGLGETNAMEDBUFFERPOINTERVPROC)LL_GET_PROC_ADDRESS("glGetNamedBufferPointerv"); + glGetNamedBufferSubData = (PFNGLGETNAMEDBUFFERSUBDATAPROC)LL_GET_PROC_ADDRESS("glGetNamedBufferSubData"); + glCreateFramebuffers = (PFNGLCREATEFRAMEBUFFERSPROC)LL_GET_PROC_ADDRESS("glCreateFramebuffers"); + glNamedFramebufferRenderbuffer = (PFNGLNAMEDFRAMEBUFFERRENDERBUFFERPROC)LL_GET_PROC_ADDRESS("glNamedFramebufferRenderbuffer"); + glNamedFramebufferParameteri = (PFNGLNAMEDFRAMEBUFFERPARAMETERIPROC)LL_GET_PROC_ADDRESS("glNamedFramebufferParameteri"); + glNamedFramebufferTexture = (PFNGLNAMEDFRAMEBUFFERTEXTUREPROC)LL_GET_PROC_ADDRESS("glNamedFramebufferTexture"); + glNamedFramebufferTextureLayer = (PFNGLNAMEDFRAMEBUFFERTEXTURELAYERPROC)LL_GET_PROC_ADDRESS("glNamedFramebufferTextureLayer"); + glNamedFramebufferDrawBuffer = (PFNGLNAMEDFRAMEBUFFERDRAWBUFFERPROC)LL_GET_PROC_ADDRESS("glNamedFramebufferDrawBuffer"); + glNamedFramebufferDrawBuffers = (PFNGLNAMEDFRAMEBUFFERDRAWBUFFERSPROC)LL_GET_PROC_ADDRESS("glNamedFramebufferDrawBuffers"); + glNamedFramebufferReadBuffer = (PFNGLNAMEDFRAMEBUFFERREADBUFFERPROC)LL_GET_PROC_ADDRESS("glNamedFramebufferReadBuffer"); + glInvalidateNamedFramebufferData = (PFNGLINVALIDATENAMEDFRAMEBUFFERDATAPROC)LL_GET_PROC_ADDRESS("glInvalidateNamedFramebufferData"); + glInvalidateNamedFramebufferSubData = (PFNGLINVALIDATENAMEDFRAMEBUFFERSUBDATAPROC)LL_GET_PROC_ADDRESS("glInvalidateNamedFramebufferSubData"); + glClearNamedFramebufferiv = (PFNGLCLEARNAMEDFRAMEBUFFERIVPROC)LL_GET_PROC_ADDRESS("glClearNamedFramebufferiv"); + glClearNamedFramebufferuiv = (PFNGLCLEARNAMEDFRAMEBUFFERUIVPROC)LL_GET_PROC_ADDRESS("glClearNamedFramebufferuiv"); + glClearNamedFramebufferfv = (PFNGLCLEARNAMEDFRAMEBUFFERFVPROC)LL_GET_PROC_ADDRESS("glClearNamedFramebufferfv"); + glClearNamedFramebufferfi = (PFNGLCLEARNAMEDFRAMEBUFFERFIPROC)LL_GET_PROC_ADDRESS("glClearNamedFramebufferfi"); + glBlitNamedFramebuffer = (PFNGLBLITNAMEDFRAMEBUFFERPROC)LL_GET_PROC_ADDRESS("glBlitNamedFramebuffer"); + glCheckNamedFramebufferStatus = (PFNGLCHECKNAMEDFRAMEBUFFERSTATUSPROC)LL_GET_PROC_ADDRESS("glCheckNamedFramebufferStatus"); + glGetNamedFramebufferParameteriv = (PFNGLGETNAMEDFRAMEBUFFERPARAMETERIVPROC)LL_GET_PROC_ADDRESS("glGetNamedFramebufferParameteriv"); + glGetNamedFramebufferAttachmentParameteriv = (PFNGLGETNAMEDFRAMEBUFFERATTACHMENTPARAMETERIVPROC)LL_GET_PROC_ADDRESS("glGetNamedFramebufferAttachmentParameteriv"); + glCreateRenderbuffers = (PFNGLCREATERENDERBUFFERSPROC)LL_GET_PROC_ADDRESS("glCreateRenderbuffers"); + glNamedRenderbufferStorage = (PFNGLNAMEDRENDERBUFFERSTORAGEPROC)LL_GET_PROC_ADDRESS("glNamedRenderbufferStorage"); + glNamedRenderbufferStorageMultisample = (PFNGLNAMEDRENDERBUFFERSTORAGEMULTISAMPLEPROC)LL_GET_PROC_ADDRESS("glNamedRenderbufferStorageMultisample"); + glGetNamedRenderbufferParameteriv = (PFNGLGETNAMEDRENDERBUFFERPARAMETERIVPROC)LL_GET_PROC_ADDRESS("glGetNamedRenderbufferParameteriv"); + glCreateTextures = (PFNGLCREATETEXTURESPROC)LL_GET_PROC_ADDRESS("glCreateTextures"); + glTextureBuffer = (PFNGLTEXTUREBUFFERPROC)LL_GET_PROC_ADDRESS("glTextureBuffer"); + glTextureBufferRange = (PFNGLTEXTUREBUFFERRANGEPROC)LL_GET_PROC_ADDRESS("glTextureBufferRange"); + glTextureStorage1D = (PFNGLTEXTURESTORAGE1DPROC)LL_GET_PROC_ADDRESS("glTextureStorage1D"); + glTextureStorage2D = (PFNGLTEXTURESTORAGE2DPROC)LL_GET_PROC_ADDRESS("glTextureStorage2D"); + glTextureStorage3D = (PFNGLTEXTURESTORAGE3DPROC)LL_GET_PROC_ADDRESS("glTextureStorage3D"); + glTextureStorage2DMultisample = (PFNGLTEXTURESTORAGE2DMULTISAMPLEPROC)LL_GET_PROC_ADDRESS("glTextureStorage2DMultisample"); + glTextureStorage3DMultisample = (PFNGLTEXTURESTORAGE3DMULTISAMPLEPROC)LL_GET_PROC_ADDRESS("glTextureStorage3DMultisample"); + glTextureSubImage1D = (PFNGLTEXTURESUBIMAGE1DPROC)LL_GET_PROC_ADDRESS("glTextureSubImage1D"); + glTextureSubImage2D = (PFNGLTEXTURESUBIMAGE2DPROC)LL_GET_PROC_ADDRESS("glTextureSubImage2D"); + glTextureSubImage3D = (PFNGLTEXTURESUBIMAGE3DPROC)LL_GET_PROC_ADDRESS("glTextureSubImage3D"); + glCompressedTextureSubImage1D = (PFNGLCOMPRESSEDTEXTURESUBIMAGE1DPROC)LL_GET_PROC_ADDRESS("glCompressedTextureSubImage1D"); + glCompressedTextureSubImage2D = (PFNGLCOMPRESSEDTEXTURESUBIMAGE2DPROC)LL_GET_PROC_ADDRESS("glCompressedTextureSubImage2D"); + glCompressedTextureSubImage3D = (PFNGLCOMPRESSEDTEXTURESUBIMAGE3DPROC)LL_GET_PROC_ADDRESS("glCompressedTextureSubImage3D"); + glCopyTextureSubImage1D = (PFNGLCOPYTEXTURESUBIMAGE1DPROC)LL_GET_PROC_ADDRESS("glCopyTextureSubImage1D"); + glCopyTextureSubImage2D = (PFNGLCOPYTEXTURESUBIMAGE2DPROC)LL_GET_PROC_ADDRESS("glCopyTextureSubImage2D"); + glCopyTextureSubImage3D = (PFNGLCOPYTEXTURESUBIMAGE3DPROC)LL_GET_PROC_ADDRESS("glCopyTextureSubImage3D"); + glTextureParameterf = (PFNGLTEXTUREPARAMETERFPROC)LL_GET_PROC_ADDRESS("glTextureParameterf"); + glTextureParameterfv = (PFNGLTEXTUREPARAMETERFVPROC)LL_GET_PROC_ADDRESS("glTextureParameterfv"); + glTextureParameteri = (PFNGLTEXTUREPARAMETERIPROC)LL_GET_PROC_ADDRESS("glTextureParameteri"); + glTextureParameterIiv = (PFNGLTEXTUREPARAMETERIIVPROC)LL_GET_PROC_ADDRESS("glTextureParameterIiv"); + glTextureParameterIuiv = (PFNGLTEXTUREPARAMETERIUIVPROC)LL_GET_PROC_ADDRESS("glTextureParameterIuiv"); + glTextureParameteriv = (PFNGLTEXTUREPARAMETERIVPROC)LL_GET_PROC_ADDRESS("glTextureParameteriv"); + glGenerateTextureMipmap = (PFNGLGENERATETEXTUREMIPMAPPROC)LL_GET_PROC_ADDRESS("glGenerateTextureMipmap"); + glBindTextureUnit = (PFNGLBINDTEXTUREUNITPROC)LL_GET_PROC_ADDRESS("glBindTextureUnit"); + glGetTextureImage = (PFNGLGETTEXTUREIMAGEPROC)LL_GET_PROC_ADDRESS("glGetTextureImage"); + glGetCompressedTextureImage = (PFNGLGETCOMPRESSEDTEXTUREIMAGEPROC)LL_GET_PROC_ADDRESS("glGetCompressedTextureImage"); + glGetTextureLevelParameterfv = (PFNGLGETTEXTURELEVELPARAMETERFVPROC)LL_GET_PROC_ADDRESS("glGetTextureLevelParameterfv"); + glGetTextureLevelParameteriv = (PFNGLGETTEXTURELEVELPARAMETERIVPROC)LL_GET_PROC_ADDRESS("glGetTextureLevelParameteriv"); + glGetTextureParameterfv = (PFNGLGETTEXTUREPARAMETERFVPROC)LL_GET_PROC_ADDRESS("glGetTextureParameterfv"); + glGetTextureParameterIiv = (PFNGLGETTEXTUREPARAMETERIIVPROC)LL_GET_PROC_ADDRESS("glGetTextureParameterIiv"); + glGetTextureParameterIuiv = (PFNGLGETTEXTUREPARAMETERIUIVPROC)LL_GET_PROC_ADDRESS("glGetTextureParameterIuiv"); + glGetTextureParameteriv = (PFNGLGETTEXTUREPARAMETERIVPROC)LL_GET_PROC_ADDRESS("glGetTextureParameteriv"); + glCreateVertexArrays = (PFNGLCREATEVERTEXARRAYSPROC)LL_GET_PROC_ADDRESS("glCreateVertexArrays"); + glDisableVertexArrayAttrib = (PFNGLDISABLEVERTEXARRAYATTRIBPROC)LL_GET_PROC_ADDRESS("glDisableVertexArrayAttrib"); + glEnableVertexArrayAttrib = (PFNGLENABLEVERTEXARRAYATTRIBPROC)LL_GET_PROC_ADDRESS("glEnableVertexArrayAttrib"); + glVertexArrayElementBuffer = (PFNGLVERTEXARRAYELEMENTBUFFERPROC)LL_GET_PROC_ADDRESS("glVertexArrayElementBuffer"); + glVertexArrayVertexBuffer = (PFNGLVERTEXARRAYVERTEXBUFFERPROC)LL_GET_PROC_ADDRESS("glVertexArrayVertexBuffer"); + glVertexArrayVertexBuffers = (PFNGLVERTEXARRAYVERTEXBUFFERSPROC)LL_GET_PROC_ADDRESS("glVertexArrayVertexBuffers"); + glVertexArrayAttribBinding = (PFNGLVERTEXARRAYATTRIBBINDINGPROC)LL_GET_PROC_ADDRESS("glVertexArrayAttribBinding"); + glVertexArrayAttribFormat = (PFNGLVERTEXARRAYATTRIBFORMATPROC)LL_GET_PROC_ADDRESS("glVertexArrayAttribFormat"); + glVertexArrayAttribIFormat = (PFNGLVERTEXARRAYATTRIBIFORMATPROC)LL_GET_PROC_ADDRESS("glVertexArrayAttribIFormat"); + glVertexArrayAttribLFormat = (PFNGLVERTEXARRAYATTRIBLFORMATPROC)LL_GET_PROC_ADDRESS("glVertexArrayAttribLFormat"); + glVertexArrayBindingDivisor = (PFNGLVERTEXARRAYBINDINGDIVISORPROC)LL_GET_PROC_ADDRESS("glVertexArrayBindingDivisor"); + glGetVertexArrayiv = (PFNGLGETVERTEXARRAYIVPROC)LL_GET_PROC_ADDRESS("glGetVertexArrayiv"); + glGetVertexArrayIndexediv = (PFNGLGETVERTEXARRAYINDEXEDIVPROC)LL_GET_PROC_ADDRESS("glGetVertexArrayIndexediv"); + glGetVertexArrayIndexed64iv = (PFNGLGETVERTEXARRAYINDEXED64IVPROC)LL_GET_PROC_ADDRESS("glGetVertexArrayIndexed64iv"); + glCreateSamplers = (PFNGLCREATESAMPLERSPROC)LL_GET_PROC_ADDRESS("glCreateSamplers"); + glCreateProgramPipelines = (PFNGLCREATEPROGRAMPIPELINESPROC)LL_GET_PROC_ADDRESS("glCreateProgramPipelines"); + glCreateQueries = (PFNGLCREATEQUERIESPROC)LL_GET_PROC_ADDRESS("glCreateQueries"); + glGetQueryBufferObjecti64v = (PFNGLGETQUERYBUFFEROBJECTI64VPROC)LL_GET_PROC_ADDRESS("glGetQueryBufferObjecti64v"); + glGetQueryBufferObjectiv = (PFNGLGETQUERYBUFFEROBJECTIVPROC)LL_GET_PROC_ADDRESS("glGetQueryBufferObjectiv"); + glGetQueryBufferObjectui64v = (PFNGLGETQUERYBUFFEROBJECTUI64VPROC)LL_GET_PROC_ADDRESS("glGetQueryBufferObjectui64v"); + glGetQueryBufferObjectuiv = (PFNGLGETQUERYBUFFEROBJECTUIVPROC)LL_GET_PROC_ADDRESS("glGetQueryBufferObjectuiv"); + glMemoryBarrierByRegion = (PFNGLMEMORYBARRIERBYREGIONPROC)LL_GET_PROC_ADDRESS("glMemoryBarrierByRegion"); + glGetTextureSubImage = (PFNGLGETTEXTURESUBIMAGEPROC)LL_GET_PROC_ADDRESS("glGetTextureSubImage"); + glGetCompressedTextureSubImage = (PFNGLGETCOMPRESSEDTEXTURESUBIMAGEPROC)LL_GET_PROC_ADDRESS("glGetCompressedTextureSubImage"); + glGetGraphicsResetStatus = (PFNGLGETGRAPHICSRESETSTATUSPROC)LL_GET_PROC_ADDRESS("glGetGraphicsResetStatus"); + glGetnCompressedTexImage = (PFNGLGETNCOMPRESSEDTEXIMAGEPROC)LL_GET_PROC_ADDRESS("glGetnCompressedTexImage"); + glGetnTexImage = (PFNGLGETNTEXIMAGEPROC)LL_GET_PROC_ADDRESS("glGetnTexImage"); + glGetnUniformdv = (PFNGLGETNUNIFORMDVPROC)LL_GET_PROC_ADDRESS("glGetnUniformdv"); + glGetnUniformfv = (PFNGLGETNUNIFORMFVPROC)LL_GET_PROC_ADDRESS("glGetnUniformfv"); + glGetnUniformiv = (PFNGLGETNUNIFORMIVPROC)LL_GET_PROC_ADDRESS("glGetnUniformiv"); + glGetnUniformuiv = (PFNGLGETNUNIFORMUIVPROC)LL_GET_PROC_ADDRESS("glGetnUniformuiv"); + glReadnPixels = (PFNGLREADNPIXELSPROC)LL_GET_PROC_ADDRESS("glReadnPixels"); + glTextureBarrier = (PFNGLTEXTUREBARRIERPROC)LL_GET_PROC_ADDRESS("glTextureBarrier"); // GL_VERSION_4_6 if (mGLVersion < 4.59f) { return; } - glSpecializeShader = (PFNGLSPECIALIZESHADERPROC)GLH_EXT_GET_PROC_ADDRESS("glSpecializeShader"); - glMultiDrawArraysIndirectCount = (PFNGLMULTIDRAWARRAYSINDIRECTCOUNTPROC)GLH_EXT_GET_PROC_ADDRESS("glMultiDrawArraysIndirectCount"); - glMultiDrawElementsIndirectCount = (PFNGLMULTIDRAWELEMENTSINDIRECTCOUNTPROC)GLH_EXT_GET_PROC_ADDRESS("glMultiDrawElementsIndirectCount"); - glPolygonOffsetClamp = (PFNGLPOLYGONOFFSETCLAMPPROC)GLH_EXT_GET_PROC_ADDRESS("glPolygonOffsetClamp"); + glSpecializeShader = (PFNGLSPECIALIZESHADERPROC)LL_GET_PROC_ADDRESS("glSpecializeShader"); + glMultiDrawArraysIndirectCount = (PFNGLMULTIDRAWARRAYSINDIRECTCOUNTPROC)LL_GET_PROC_ADDRESS("glMultiDrawArraysIndirectCount"); + glMultiDrawElementsIndirectCount = (PFNGLMULTIDRAWELEMENTSINDIRECTCOUNTPROC)LL_GET_PROC_ADDRESS("glMultiDrawElementsIndirectCount"); + glPolygonOffsetClamp = (PFNGLPOLYGONOFFSETCLAMPPROC)LL_GET_PROC_ADDRESS("glPolygonOffsetClamp"); -#endif +#endif // LL_GL_FUNC_POINTER } void rotate_quat(LLQuaternion& rotation) @@ -2267,6 +2311,39 @@ void flush_glerror() glGetError(); } +const std::string getGLErrorString(GLenum error) +{ + switch(error) + { + case GL_NO_ERROR: + return "No Error"; + case GL_INVALID_ENUM: + return "Invalid Enum"; + case GL_INVALID_VALUE: + return "Invalid Value"; + case GL_INVALID_OPERATION: + return "Invalid Operation"; + case GL_INVALID_FRAMEBUFFER_OPERATION: + return "Invalid Framebuffer Operation"; + case GL_OUT_OF_MEMORY: + return "Out of Memory"; +#ifdef GL_STACK_UNDERFLOW + case GL_STACK_UNDERFLOW: + return "Stack Underflow"; +#endif +#ifdef GL_STACK_OVERFLOW + case GL_STACK_OVERFLOW: + return "Stack Overflow"; +#endif +#ifdef GL_TABLE_TOO_LARGE + case GL_TABLE_TOO_LARGE: + return "Table too large"; +#endif + default: + return "UNKNOWN ERROR"; + } +} + //this function outputs gl error to the log file, does not crash the code. void log_glerror() { @@ -2279,17 +2356,8 @@ void log_glerror() error = glGetError(); while (LL_UNLIKELY(error)) { - GLubyte const * gl_error_msg = gluErrorString(error); - if (NULL != gl_error_msg) - { - LL_WARNS() << "GL Error: " << error << " GL Error String: " << gl_error_msg << LL_ENDL ; - } - else - { - // gluErrorString returns NULL for some extensions' error codes. - // you'll probably have to grep for the number in glext.h. - LL_WARNS() << "GL Error: UNKNOWN 0x" << std::hex << error << std::dec << LL_ENDL; - } + std::string gl_error_msg = getGLErrorString(error); + LL_WARNS() << "GL Error: 0x" << std::hex << error << std::dec << " GL Error String: " << gl_error_msg << LL_ENDL; error = glGetError(); } } @@ -2303,27 +2371,12 @@ void do_assert_glerror() if (LL_UNLIKELY(error)) { quit = true; - GLubyte const * gl_error_msg = gluErrorString(error); - if (NULL != gl_error_msg) - { - LL_WARNS("RenderState") << "GL Error:" << error<< LL_ENDL; - LL_WARNS("RenderState") << "GL Error String:" << gl_error_msg << LL_ENDL; - - if (gDebugSession) - { - gFailLog << "GL Error:" << gl_error_msg << std::endl; - } - } - else + std::string gl_error_msg = getGLErrorString(error); + LL_WARNS("RenderState") << "GL Error: 0x" << std::hex << error << std::dec << LL_ENDL; + LL_WARNS("RenderState") << "GL Error String: " << gl_error_msg << LL_ENDL; + if (gDebugSession) { - // gluErrorString returns NULL for some extensions' error codes. - // you'll probably have to grep for the number in glext.h. - LL_WARNS("RenderState") << "GL Error: UNKNOWN 0x" << std::hex << error << std::dec << LL_ENDL; - - if (gDebugSession) - { - gFailLog << "GL Error: UNKNOWN 0x" << std::hex << error << std::dec << std::endl; - } + gFailLog << "GL Error: 0x" << std::hex << error << std::dec << " GL Error String: " << gl_error_msg << std::endl; } } @@ -2407,11 +2460,10 @@ void LLGLState::resetTextureStates() gGL.flush(); GLint maxTextureUnits; - glGetIntegerv(GL_MAX_TEXTURE_UNITS_ARB, &maxTextureUnits); + glGetIntegerv(GL_MAX_TEXTURE_IMAGE_UNITS, &maxTextureUnits); for (S32 j = maxTextureUnits-1; j >=0; j--) { gGL.getTexUnit(j)->activate(); - glClientActiveTexture(GL_TEXTURE0+j); j == 0 ? gGL.getTexUnit(j)->enable(LLTexUnit::TT_TEXTURE) : gGL.getTexUnit(j)->disable(); } } @@ -2566,6 +2618,7 @@ void parse_gl_version( S32* major, S32* minor, S32* release, std::string* vendor { return; } + LL_INFOS() << "GL: " << version << LL_ENDL; version_string->assign(version); diff --git a/indra/llrender/llgl.h b/indra/llrender/llgl.h index 24ba4d6deb4..dd30c829815 100644 --- a/indra/llrender/llgl.h +++ b/indra/llrender/llgl.h @@ -29,10 +29,13 @@ // This file contains various stuff for handling gl extensions and other gl related stuff. +#include #include #include #include +#include "llglheaders.h" + #include "llerror.h" #include "v4color.h" #include "llstring.h" @@ -42,7 +45,6 @@ #include "llgltypes.h" #include "llinstancetracker.h" -#include "llglheaders.h" #include "glm/mat4x4.hpp" extern bool gDebugGL; @@ -69,7 +71,9 @@ class LLGLManager bool initGL(); void shutdownGL(); - void initWGL(); // Initializes stupid WGL extensions + void initWGL(); // Initializes WGL extensions + void initGLX(); // Initializes GLX extensions + void initEGL(); // Initializes EGL extensions std::string getRawGLString(); // For sending to simulator @@ -89,6 +93,7 @@ class LLGLManager F32 mMaxAnisotropy = 0.f; S32 mMaxUniformBlockSize = 0; S32 mMaxVaryingVectors = 0; + LLVector2 mAliasedLineRange = LLVector2(1.f, 1.f); // GL 4.x capabilities bool mHasCubeMapArray = false; @@ -99,6 +104,8 @@ class LLGLManager // Vendor-specific extensions bool mHasAMDAssociations = false; bool mHasNVXGpuMemoryInfo = false; + bool mHasATIMemInfo = false; + bool mHasGLXMESAQueryRenderer = false; bool mIsAMD; bool mIsNVIDIA; @@ -140,7 +147,16 @@ class LLGLManager // In ALL CAPS std::string mGLRenderer; + // GL Extension String + std::set mGLExtensions; + +#if LL_LINUX + bool mIsX11 = false; + bool mIsWayland = false; +#endif + private: + void reloadExtensionsString(); void initExtensions(); void initGLStates(); }; @@ -230,8 +246,6 @@ void clear_glerror(); */ -#include "boost/function.hpp" - class LLGLState { public: @@ -262,24 +276,11 @@ class LLGLState bool mIsEnabled; }; -// New LLGLState class wrappers that don't depend on actual GL flags. -class LLGLEnableBlending : public LLGLState -{ -public: - LLGLEnableBlending(bool enable); -}; - -class LLGLEnableAlphaReject : public LLGLState -{ -public: - LLGLEnableAlphaReject(bool enable); -}; - // Enable with functor class LLGLEnableFunc : LLGLState { public: - LLGLEnableFunc(LLGLenum state, bool enable, boost::function func) + LLGLEnableFunc(LLGLenum state, bool enable, std::function func) : LLGLState(state, enable) { if (enable) @@ -419,67 +420,4 @@ extern bool gHeadlessClient; extern bool gNonInteractive; extern bool gGLActive; -// Deal with changing glext.h definitions for newer SDK versions, specifically -// with MAC OSX 10.5 -> 10.6 - - -#ifndef GL_DEPTH_ATTACHMENT -#define GL_DEPTH_ATTACHMENT GL_DEPTH_ATTACHMENT_EXT -#endif - -#ifndef GL_STENCIL_ATTACHMENT -#define GL_STENCIL_ATTACHMENT GL_STENCIL_ATTACHMENT_EXT -#endif - -#ifndef GL_FRAMEBUFFER -#define GL_FRAMEBUFFER GL_FRAMEBUFFER_EXT -#define GL_DRAW_FRAMEBUFFER GL_DRAW_FRAMEBUFFER_EXT -#define GL_READ_FRAMEBUFFER GL_READ_FRAMEBUFFER_EXT -#define GL_FRAMEBUFFER_COMPLETE GL_FRAMEBUFFER_COMPLETE_EXT -#define GL_FRAMEBUFFER_UNSUPPORTED GL_FRAMEBUFFER_UNSUPPORTED_EXT -#define GL_FRAMEBUFFER_INCOMPLETE_MISSING_ATTACHMENT GL_FRAMEBUFFER_INCOMPLETE_MISSING_ATTACHMENT_EXT -#define GL_FRAMEBUFFER_INCOMPLETE_ATTACHMENT GL_FRAMEBUFFER_INCOMPLETE_ATTACHMENT_EXT -#define glGenFramebuffers glGenFramebuffersEXT -#define glBindFramebuffer glBindFramebufferEXT -#define glCheckFramebufferStatus glCheckFramebufferStatusEXT -#define glBlitFramebuffer glBlitFramebufferEXT -#define glDeleteFramebuffers glDeleteFramebuffersEXT -#define glFramebufferRenderbuffer glFramebufferRenderbufferEXT -#define glFramebufferTexture2D glFramebufferTexture2DEXT -#endif - -#ifndef GL_RENDERBUFFER -#define GL_RENDERBUFFER GL_RENDERBUFFER_EXT -#define glGenRenderbuffers glGenRenderbuffersEXT -#define glBindRenderbuffer glBindRenderbufferEXT -#define glRenderbufferStorage glRenderbufferStorageEXT -#define glRenderbufferStorageMultisample glRenderbufferStorageMultisampleEXT -#define glDeleteRenderbuffers glDeleteRenderbuffersEXT -#endif - -#ifndef GL_COLOR_ATTACHMENT -#define GL_COLOR_ATTACHMENT GL_COLOR_ATTACHMENT_EXT -#endif - -#ifndef GL_COLOR_ATTACHMENT0 -#define GL_COLOR_ATTACHMENT0 GL_COLOR_ATTACHMENT0_EXT -#endif - -#ifndef GL_COLOR_ATTACHMENT1 -#define GL_COLOR_ATTACHMENT1 GL_COLOR_ATTACHMENT1_EXT -#endif - -#ifndef GL_COLOR_ATTACHMENT2 -#define GL_COLOR_ATTACHMENT2 GL_COLOR_ATTACHMENT2_EXT -#endif - -#ifndef GL_COLOR_ATTACHMENT3 -#define GL_COLOR_ATTACHMENT3 GL_COLOR_ATTACHMENT3_EXT -#endif - - -#ifndef GL_DEPTH24_STENCIL8 -#define GL_DEPTH24_STENCIL8 GL_DEPTH24_STENCIL8_EXT -#endif - #endif // LL_LLGL_H diff --git a/indra/llrender/llglcommonfunc.cpp b/indra/llrender/llglcommonfunc.cpp index 13b08de7cc1..bf4d337b503 100644 --- a/indra/llrender/llglcommonfunc.cpp +++ b/indra/llrender/llglcommonfunc.cpp @@ -24,6 +24,8 @@ * $/LicenseInfo$ */ +#include "linden_common.h" + #include "llglheaders.h" #include "llglcommonfunc.h" diff --git a/indra/llrender/llglheaders.h b/indra/llrender/llglheaders.h index 3d4dc5e6982..a3d63810f5e 100644 --- a/indra/llrender/llglheaders.h +++ b/indra/llrender/llglheaders.h @@ -27,35 +27,119 @@ #ifndef LL_LLGLHEADERS_H #define LL_LLGLHEADERS_H -#if LL_MESA -//---------------------------------------------------------------------------- -// MESA headers -// quotes so we get libraries/.../GL/ version +#if LL_WINDOWS || LL_MESA_HEADLESS || LL_SDL_WINDOW || LL_LINUX + //---------------------------------------------------------------------------- + // LL_WINDOWS || LL_MESA_HEADLESS || LL_SDL_WINDOW || LL_LINUX + +#if LL_MESA_HEADLESS #define GL_GLEXT_PROTOTYPES 1 -#include "GL/gl.h" -#include "GL/glext.h" -#include "GL/glu.h" +#else +#define LL_GL_FUNC_POINTER 1 +#endif + + // windows gl headers depend on things like APIENTRY, so include windows. +#include "llwin32headers.h" -// The __APPLE__ kludge is to make glh_extensions.h not symbol-clash horribly -# define __APPLE__ -# include "GL/glh_extensions.h" -# undef __APPLE__ +// quotes so we get libraries/.../GL/ version +#include "GL/glcorearb.h" -#elif LL_WINDOWS -//---------------------------------------------------------------------------- -// LL_WINDOWS +#if LL_WINDOWS && !LL_MESA_HEADLESS +#include "GL/wglext.h" +#endif -// windows gl headers depend on things like APIENTRY, so include windows. -#include "llwin32headers.h" +#if LL_LINUX && LL_X11 && !LL_MESA_HEADLESS +#define GLX_GLXEXT_LEGACY +#define __gl_h_ 1 +#include "GL/glx.h" +#include "GL/glxext.h" +#endif +#if LL_LINUX && LL_WAYLAND && !LL_MESA_HEADLESS +#define EGL_EGL_PROTOTYPES 0 +#include "EGL/egl.h" +#endif + +#elif LL_DARWIN //---------------------------------------------------------------------------- -#include -#include +// LL_DARWIN -// quotes so we get libraries/.../GL/ version +#define GL_GLEXT_LEGACY 1 +#include + +#define GL_EXT_separate_specular_color 1 +#define GL_GLEXT_PROTOTYPES 1 #include "GL/glext.h" -#include "GL/glh_extensions.h" +#endif // LL_MESA_HEADLESS / LL_SDL_WINDOW // LL_LINUX / LL_WINDOWS / LL_DARWIN + +// GL_NVX_gpu_memory_info constants +#ifndef GL_NVX_gpu_memory_info +#define GL_NVX_gpu_memory_info +#define GL_GPU_MEMORY_INFO_DEDICATED_VIDMEM_NVX 0x9047 +#define GL_GPU_MEMORY_INFO_TOTAL_AVAILABLE_MEMORY_NVX 0x9048 +#define GL_GPU_MEMORY_INFO_CURRENT_AVAILABLE_VIDMEM_NVX 0x9049 +#define GL_GPU_MEMORY_INFO_EVICTION_COUNT_NVX 0x904A +#define GL_GPU_MEMORY_INFO_EVICTED_MEMORY_NVX 0x904B +#endif + +// GL_ATI_meminfo constants +#ifndef GL_ATI_meminfo +#define GL_ATI_meminfo +#define GL_VBO_FREE_MEMORY_ATI 0x87FB +#define GL_TEXTURE_FREE_MEMORY_ATI 0x87FC +#define GL_RENDERBUFFER_FREE_MEMORY_ATI 0x87FD +#endif + +// GL_EXT_texture_sRGB constants +#ifndef GL_EXT_texture_sRGB +#define GL_EXT_texture_sRGB 1 +#define GL_SRGB_EXT 0x8C40 +#define GL_SRGB8_EXT 0x8C41 +#define GL_SRGB_ALPHA_EXT 0x8C42 +#define GL_SRGB8_ALPHA8_EXT 0x8C43 +#define GL_SLUMINANCE_ALPHA_EXT 0x8C44 +#define GL_SLUMINANCE8_ALPHA8_EXT 0x8C45 +#define GL_SLUMINANCE_EXT 0x8C46 +#define GL_SLUMINANCE8_EXT 0x8C47 +#define GL_COMPRESSED_SRGB_EXT 0x8C48 +#define GL_COMPRESSED_SRGB_ALPHA_EXT 0x8C49 +#define GL_COMPRESSED_SLUMINANCE_EXT 0x8C4A +#define GL_COMPRESSED_SLUMINANCE_ALPHA_EXT 0x8C4B +#define GL_COMPRESSED_SRGB_S3TC_DXT1_EXT 0x8C4C +#define GL_COMPRESSED_SRGB_ALPHA_S3TC_DXT1_EXT 0x8C4D +#define GL_COMPRESSED_SRGB_ALPHA_S3TC_DXT3_EXT 0x8C4E +#define GL_COMPRESSED_SRGB_ALPHA_S3TC_DXT5_EXT 0x8C4F +#endif /* GL_EXT_texture_sRGB */ + +// GL_ARB_vertex_buffer_object constants +#ifndef GL_ARB_vertex_buffer_object +#define GL_ARB_vertex_buffer_object 1 +#define GL_STREAM_DRAW_ARB 0x88E0 +#define GL_STREAM_READ_ARB 0x88E1 +#define GL_STREAM_COPY_ARB 0x88E2 +#define GL_STATIC_DRAW_ARB 0x88E4 +#define GL_STATIC_READ_ARB 0x88E5 +#define GL_STATIC_COPY_ARB 0x88E6 +#define GL_DYNAMIC_DRAW_ARB 0x88E8 +#define GL_DYNAMIC_READ_ARB 0x88E9 +#define GL_DYNAMIC_COPY_ARB 0x88EA +#endif + +// Deprecated OpenGL defines we still use +#define GL_COLOR_INDEX 0x1900 +#define GL_ALPHA 0x1906 +#define GL_ALPHA8 0x803C +#define GL_LUMINANCE 0x1909 +#define GL_LUMINANCE_ALPHA 0x190A +#define GL_LUMINANCE8 0x8040 +#define GL_LUMINANCE8_ALPHA8 0x8045 +#define GL_COMPRESSED_ALPHA 0x84E9 +#define GL_COMPRESSED_LUMINANCE 0x84EA +#define GL_COMPRESSED_LUMINANCE_ALPHA 0x84EB + +#if LL_GL_FUNC_POINTER + +#if LL_WINDOWS // WGL_AMD_gpu_association extern PFNWGLGETGPUIDSAMDPROC wglGetGPUIDsAMD; extern PFNWGLGETGPUINFOAMDPROC wglGetGPUInfoAMD; @@ -74,6 +158,98 @@ extern PFNWGLGETSWAPINTERVALEXTPROC wglGetSwapIntervalEXT; // WGL_ARB_create_context extern PFNWGLCREATECONTEXTATTRIBSARBPROC wglCreateContextAttribsARB; +// WGL_ARB_pixel_format +extern PFNWGLGETPIXELFORMATATTRIBIVARBPROC wglGetPixelFormatAttribivARB; +extern PFNWGLGETPIXELFORMATATTRIBFVARBPROC wglGetPixelFormatAttribfvARB; +extern PFNWGLCHOOSEPIXELFORMATARBPROC wglChoosePixelFormatARB; + +#endif // LL_WINDOWS + +#if LL_LINUX && LL_X11 && !LL_MESA_HEADLESS +// GLX_MESA_query_renderer +extern PFNGLXQUERYCURRENTRENDERERINTEGERMESAPROC glXQueryCurrentRendererIntegerMESA; +extern PFNGLXQUERYCURRENTRENDERERSTRINGMESAPROC glXQueryCurrentRendererStringMESA; +extern PFNGLXQUERYRENDERERINTEGERMESAPROC glXQueryRendererIntegerMESA; +extern PFNGLXQUERYRENDERERSTRINGMESAPROC glXQueryRendererStringMESA; +#endif + +#if LL_LINUX && LL_WAYLAND &&!LL_MESA_HEADLESS +extern PFNEGLQUERYSTRINGPROC eglQueryString; +#endif + +// We get all functions via getProcAddress when using SDL +// GL_VERSION_1_0 +extern PFNGLCULLFACEPROC glCullFace; +extern PFNGLFRONTFACEPROC glFrontFace; +extern PFNGLHINTPROC glHint; +extern PFNGLLINEWIDTHPROC glLineWidth; +extern PFNGLPOINTSIZEPROC glPointSize; +extern PFNGLPOLYGONMODEPROC glPolygonMode; +extern PFNGLSCISSORPROC glScissor; +extern PFNGLTEXPARAMETERFPROC glTexParameterf; +extern PFNGLTEXPARAMETERFVPROC glTexParameterfv; +extern PFNGLTEXPARAMETERIPROC glTexParameteri; +extern PFNGLTEXPARAMETERIVPROC glTexParameteriv; +extern PFNGLTEXIMAGE1DPROC glTexImage1D; +extern PFNGLTEXIMAGE2DPROC glTexImage2D; +extern PFNGLDRAWBUFFERPROC glDrawBuffer; +extern PFNGLCLEARPROC glClear; +extern PFNGLCLEARCOLORPROC glClearColor; +extern PFNGLCLEARSTENCILPROC glClearStencil; +extern PFNGLCLEARDEPTHPROC glClearDepth; +extern PFNGLSTENCILMASKPROC glStencilMask; +extern PFNGLCOLORMASKPROC glColorMask; +extern PFNGLDEPTHMASKPROC glDepthMask; +extern PFNGLDISABLEPROC glDisable; +extern PFNGLENABLEPROC glEnable; +extern PFNGLFINISHPROC glFinish; +extern PFNGLFLUSHPROC glFlush; +extern PFNGLBLENDFUNCPROC glBlendFunc; +extern PFNGLLOGICOPPROC glLogicOp; +extern PFNGLSTENCILFUNCPROC glStencilFunc; +extern PFNGLSTENCILOPPROC glStencilOp; +extern PFNGLDEPTHFUNCPROC glDepthFunc; +extern PFNGLPIXELSTOREFPROC glPixelStoref; +extern PFNGLPIXELSTOREIPROC glPixelStorei; +extern PFNGLREADBUFFERPROC glReadBuffer; +extern PFNGLREADPIXELSPROC glReadPixels; +extern PFNGLGETBOOLEANVPROC glGetBooleanv; +extern PFNGLGETDOUBLEVPROC glGetDoublev; +extern PFNGLGETERRORPROC glGetError; +extern PFNGLGETFLOATVPROC glGetFloatv; +extern PFNGLGETINTEGERVPROC glGetIntegerv; +extern PFNGLGETSTRINGPROC glGetString; +extern PFNGLGETTEXIMAGEPROC glGetTexImage; +extern PFNGLGETTEXPARAMETERFVPROC glGetTexParameterfv; +extern PFNGLGETTEXPARAMETERIVPROC glGetTexParameteriv; +extern PFNGLGETTEXLEVELPARAMETERFVPROC glGetTexLevelParameterfv; +extern PFNGLGETTEXLEVELPARAMETERIVPROC glGetTexLevelParameteriv; +extern PFNGLISENABLEDPROC glIsEnabled; +extern PFNGLDEPTHRANGEPROC glDepthRange; +extern PFNGLVIEWPORTPROC glViewport; + +// GL_VERSION_1_1 +extern PFNGLDRAWARRAYSPROC glDrawArrays; +extern PFNGLDRAWELEMENTSPROC glDrawElements; +extern PFNGLGETPOINTERVPROC glGetPointerv; +extern PFNGLPOLYGONOFFSETPROC glPolygonOffset; +extern PFNGLCOPYTEXIMAGE1DPROC glCopyTexImage1D; +extern PFNGLCOPYTEXIMAGE2DPROC glCopyTexImage2D; +extern PFNGLCOPYTEXSUBIMAGE1DPROC glCopyTexSubImage1D; +extern PFNGLCOPYTEXSUBIMAGE2DPROC glCopyTexSubImage2D; +extern PFNGLTEXSUBIMAGE1DPROC glTexSubImage1D; +extern PFNGLTEXSUBIMAGE2DPROC glTexSubImage2D; +extern PFNGLBINDTEXTUREPROC glBindTexture; +extern PFNGLDELETETEXTURESPROC glDeleteTextures; +extern PFNGLGENTEXTURESPROC glGenTextures; +extern PFNGLISTEXTUREPROC glIsTexture; + +// GL_VERSION_1_2 +extern PFNGLDRAWRANGEELEMENTSPROC glDrawRangeElements; +extern PFNGLTEXIMAGE3DPROC glTexImage3D; +extern PFNGLTEXSUBIMAGE3DPROC glTexSubImage3D; +extern PFNGLCOPYTEXSUBIMAGE3DPROC glCopyTexSubImage3D; + // GL_VERSION_1_3 extern PFNGLACTIVETEXTUREPROC glActiveTexture; extern PFNGLSAMPLECOVERAGEPROC glSampleCoverage; @@ -84,43 +260,6 @@ extern PFNGLCOMPRESSEDTEXSUBIMAGE3DPROC glCompressedTexSubImage3D; extern PFNGLCOMPRESSEDTEXSUBIMAGE2DPROC glCompressedTexSubImage2D; extern PFNGLCOMPRESSEDTEXSUBIMAGE1DPROC glCompressedTexSubImage1D; extern PFNGLGETCOMPRESSEDTEXIMAGEPROC glGetCompressedTexImage; -extern PFNGLCLIENTACTIVETEXTUREPROC glClientActiveTexture; -extern PFNGLMULTITEXCOORD1DPROC glMultiTexCoord1d; -extern PFNGLMULTITEXCOORD1DVPROC glMultiTexCoord1dv; -extern PFNGLMULTITEXCOORD1FPROC glMultiTexCoord1f; -extern PFNGLMULTITEXCOORD1FVPROC glMultiTexCoord1fv; -extern PFNGLMULTITEXCOORD1IPROC glMultiTexCoord1i; -extern PFNGLMULTITEXCOORD1IVPROC glMultiTexCoord1iv; -extern PFNGLMULTITEXCOORD1SPROC glMultiTexCoord1s; -extern PFNGLMULTITEXCOORD1SVPROC glMultiTexCoord1sv; -extern PFNGLMULTITEXCOORD2DPROC glMultiTexCoord2d; -extern PFNGLMULTITEXCOORD2DVPROC glMultiTexCoord2dv; -extern PFNGLMULTITEXCOORD2FPROC glMultiTexCoord2f; -extern PFNGLMULTITEXCOORD2FVPROC glMultiTexCoord2fv; -extern PFNGLMULTITEXCOORD2IPROC glMultiTexCoord2i; -extern PFNGLMULTITEXCOORD2IVPROC glMultiTexCoord2iv; -extern PFNGLMULTITEXCOORD2SPROC glMultiTexCoord2s; -extern PFNGLMULTITEXCOORD2SVPROC glMultiTexCoord2sv; -extern PFNGLMULTITEXCOORD3DPROC glMultiTexCoord3d; -extern PFNGLMULTITEXCOORD3DVPROC glMultiTexCoord3dv; -extern PFNGLMULTITEXCOORD3FPROC glMultiTexCoord3f; -extern PFNGLMULTITEXCOORD3FVPROC glMultiTexCoord3fv; -extern PFNGLMULTITEXCOORD3IPROC glMultiTexCoord3i; -extern PFNGLMULTITEXCOORD3IVPROC glMultiTexCoord3iv; -extern PFNGLMULTITEXCOORD3SPROC glMultiTexCoord3s; -extern PFNGLMULTITEXCOORD3SVPROC glMultiTexCoord3sv; -extern PFNGLMULTITEXCOORD4DPROC glMultiTexCoord4d; -extern PFNGLMULTITEXCOORD4DVPROC glMultiTexCoord4dv; -extern PFNGLMULTITEXCOORD4FPROC glMultiTexCoord4f; -extern PFNGLMULTITEXCOORD4FVPROC glMultiTexCoord4fv; -extern PFNGLMULTITEXCOORD4IPROC glMultiTexCoord4i; -extern PFNGLMULTITEXCOORD4IVPROC glMultiTexCoord4iv; -extern PFNGLMULTITEXCOORD4SPROC glMultiTexCoord4s; -extern PFNGLMULTITEXCOORD4SVPROC glMultiTexCoord4sv; -extern PFNGLLOADTRANSPOSEMATRIXFPROC glLoadTransposeMatrixf; -extern PFNGLLOADTRANSPOSEMATRIXDPROC glLoadTransposeMatrixd; -extern PFNGLMULTTRANSPOSEMATRIXFPROC glMultTransposeMatrixf; -extern PFNGLMULTTRANSPOSEMATRIXDPROC glMultTransposeMatrixd; // GL_VERSION_1_4 extern PFNGLBLENDFUNCSEPARATEPROC glBlendFuncSeparate; @@ -130,44 +269,6 @@ extern PFNGLPOINTPARAMETERFPROC glPointParameterf; extern PFNGLPOINTPARAMETERFVPROC glPointParameterfv; extern PFNGLPOINTPARAMETERIPROC glPointParameteri; extern PFNGLPOINTPARAMETERIVPROC glPointParameteriv; -extern PFNGLFOGCOORDFPROC glFogCoordf; -extern PFNGLFOGCOORDFVPROC glFogCoordfv; -extern PFNGLFOGCOORDDPROC glFogCoordd; -extern PFNGLFOGCOORDDVPROC glFogCoorddv; -extern PFNGLFOGCOORDPOINTERPROC glFogCoordPointer; -extern PFNGLSECONDARYCOLOR3BPROC glSecondaryColor3b; -extern PFNGLSECONDARYCOLOR3BVPROC glSecondaryColor3bv; -extern PFNGLSECONDARYCOLOR3DPROC glSecondaryColor3d; -extern PFNGLSECONDARYCOLOR3DVPROC glSecondaryColor3dv; -extern PFNGLSECONDARYCOLOR3FPROC glSecondaryColor3f; -extern PFNGLSECONDARYCOLOR3FVPROC glSecondaryColor3fv; -extern PFNGLSECONDARYCOLOR3IPROC glSecondaryColor3i; -extern PFNGLSECONDARYCOLOR3IVPROC glSecondaryColor3iv; -extern PFNGLSECONDARYCOLOR3SPROC glSecondaryColor3s; -extern PFNGLSECONDARYCOLOR3SVPROC glSecondaryColor3sv; -extern PFNGLSECONDARYCOLOR3UBPROC glSecondaryColor3ub; -extern PFNGLSECONDARYCOLOR3UBVPROC glSecondaryColor3ubv; -extern PFNGLSECONDARYCOLOR3UIPROC glSecondaryColor3ui; -extern PFNGLSECONDARYCOLOR3UIVPROC glSecondaryColor3uiv; -extern PFNGLSECONDARYCOLOR3USPROC glSecondaryColor3us; -extern PFNGLSECONDARYCOLOR3USVPROC glSecondaryColor3usv; -extern PFNGLSECONDARYCOLORPOINTERPROC glSecondaryColorPointer; -extern PFNGLWINDOWPOS2DPROC glWindowPos2d; -extern PFNGLWINDOWPOS2DVPROC glWindowPos2dv; -extern PFNGLWINDOWPOS2FPROC glWindowPos2f; -extern PFNGLWINDOWPOS2FVPROC glWindowPos2fv; -extern PFNGLWINDOWPOS2IPROC glWindowPos2i; -extern PFNGLWINDOWPOS2IVPROC glWindowPos2iv; -extern PFNGLWINDOWPOS2SPROC glWindowPos2s; -extern PFNGLWINDOWPOS2SVPROC glWindowPos2sv; -extern PFNGLWINDOWPOS3DPROC glWindowPos3d; -extern PFNGLWINDOWPOS3DVPROC glWindowPos3dv; -extern PFNGLWINDOWPOS3FPROC glWindowPos3f; -extern PFNGLWINDOWPOS3FVPROC glWindowPos3fv; -extern PFNGLWINDOWPOS3IPROC glWindowPos3i; -extern PFNGLWINDOWPOS3IVPROC glWindowPos3iv; -extern PFNGLWINDOWPOS3SPROC glWindowPos3s; -extern PFNGLWINDOWPOS3SVPROC glWindowPos3sv; // GL_VERSION_1_5 extern PFNGLGENQUERIESPROC glGenQueries; @@ -443,36 +544,6 @@ extern PFNGLVERTEXATTRIBP3UIPROC glVertexAttribP3ui; extern PFNGLVERTEXATTRIBP3UIVPROC glVertexAttribP3uiv; extern PFNGLVERTEXATTRIBP4UIPROC glVertexAttribP4ui; extern PFNGLVERTEXATTRIBP4UIVPROC glVertexAttribP4uiv; -extern PFNGLVERTEXP2UIPROC glVertexP2ui; -extern PFNGLVERTEXP2UIVPROC glVertexP2uiv; -extern PFNGLVERTEXP3UIPROC glVertexP3ui; -extern PFNGLVERTEXP3UIVPROC glVertexP3uiv; -extern PFNGLVERTEXP4UIPROC glVertexP4ui; -extern PFNGLVERTEXP4UIVPROC glVertexP4uiv; -extern PFNGLTEXCOORDP1UIPROC glTexCoordP1ui; -extern PFNGLTEXCOORDP1UIVPROC glTexCoordP1uiv; -extern PFNGLTEXCOORDP2UIPROC glTexCoordP2ui; -extern PFNGLTEXCOORDP2UIVPROC glTexCoordP2uiv; -extern PFNGLTEXCOORDP3UIPROC glTexCoordP3ui; -extern PFNGLTEXCOORDP3UIVPROC glTexCoordP3uiv; -extern PFNGLTEXCOORDP4UIPROC glTexCoordP4ui; -extern PFNGLTEXCOORDP4UIVPROC glTexCoordP4uiv; -extern PFNGLMULTITEXCOORDP1UIPROC glMultiTexCoordP1ui; -extern PFNGLMULTITEXCOORDP1UIVPROC glMultiTexCoordP1uiv; -extern PFNGLMULTITEXCOORDP2UIPROC glMultiTexCoordP2ui; -extern PFNGLMULTITEXCOORDP2UIVPROC glMultiTexCoordP2uiv; -extern PFNGLMULTITEXCOORDP3UIPROC glMultiTexCoordP3ui; -extern PFNGLMULTITEXCOORDP3UIVPROC glMultiTexCoordP3uiv; -extern PFNGLMULTITEXCOORDP4UIPROC glMultiTexCoordP4ui; -extern PFNGLMULTITEXCOORDP4UIVPROC glMultiTexCoordP4uiv; -extern PFNGLNORMALP3UIPROC glNormalP3ui; -extern PFNGLNORMALP3UIVPROC glNormalP3uiv; -extern PFNGLCOLORP3UIPROC glColorP3ui; -extern PFNGLCOLORP3UIVPROC glColorP3uiv; -extern PFNGLCOLORP4UIPROC glColorP4ui; -extern PFNGLCOLORP4UIVPROC glColorP4uiv; -extern PFNGLSECONDARYCOLORP3UIPROC glSecondaryColorP3ui; -extern PFNGLSECONDARYCOLORP3UIVPROC glSecondaryColorP3uiv; // GL_VERSION_4_0 extern PFNGLMINSAMPLESHADINGPROC glMinSampleShading; @@ -522,7 +593,7 @@ extern PFNGLBEGINQUERYINDEXEDPROC glBeginQueryIndexed; extern PFNGLENDQUERYINDEXEDPROC glEndQueryIndexed; extern PFNGLGETQUERYINDEXEDIVPROC glGetQueryIndexediv; - // GL_VERSION_4_1 +// GL_VERSION_4_1 extern PFNGLRELEASESHADERCOMPILERPROC glReleaseShaderCompiler; extern PFNGLSHADERBINARYPROC glShaderBinary; extern PFNGLGETSHADERPRECISIONFORMATPROC glGetShaderPrecisionFormat; @@ -792,18 +863,6 @@ extern PFNGLGETNUNIFORMFVPROC glGetnUniformfv; extern PFNGLGETNUNIFORMIVPROC glGetnUniformiv; extern PFNGLGETNUNIFORMUIVPROC glGetnUniformuiv; extern PFNGLREADNPIXELSPROC glReadnPixels; -extern PFNGLGETNMAPDVPROC glGetnMapdv; -extern PFNGLGETNMAPFVPROC glGetnMapfv; -extern PFNGLGETNMAPIVPROC glGetnMapiv; -extern PFNGLGETNPIXELMAPFVPROC glGetnPixelMapfv; -extern PFNGLGETNPIXELMAPUIVPROC glGetnPixelMapuiv; -extern PFNGLGETNPIXELMAPUSVPROC glGetnPixelMapusv; -extern PFNGLGETNPOLYGONSTIPPLEPROC glGetnPolygonStipple; -extern PFNGLGETNCOLORTABLEPROC glGetnColorTable; -extern PFNGLGETNCONVOLUTIONFILTERPROC glGetnConvolutionFilter; -extern PFNGLGETNSEPARABLEFILTERPROC glGetnSeparableFilter; -extern PFNGLGETNHISTOGRAMPROC glGetnHistogram; -extern PFNGLGETNMINMAXPROC glGetnMinmax; extern PFNGLTEXTUREBARRIERPROC glTextureBarrier; // GL_VERSION_4_6 @@ -812,252 +871,6 @@ extern PFNGLMULTIDRAWARRAYSINDIRECTCOUNTPROC glMultiDrawArraysIndirectCount; extern PFNGLMULTIDRAWELEMENTSINDIRECTCOUNTPROC glMultiDrawElementsIndirectCount; extern PFNGLPOLYGONOFFSETCLAMPPROC glPolygonOffsetClamp; - -#elif LL_DARWIN -//---------------------------------------------------------------------------- -// LL_DARWIN - -#define GL_GLEXT_LEGACY -#include -#include - -#define GL_EXT_separate_specular_color 1 -#define GL_GLEXT_PROTOTYPES -#include "GL/glext.h" - -#include "GL/glh_extensions.h" - -// These symbols don't exist on 10.3.9, so they have to be declared weak. Redeclaring them here fixes the problem. -// Note that they also must not be called on 10.3.9. This should be taken care of by a runtime check for the existence of the GL extension. -#include - -//GL_EXT_blend_func_separate -extern void glBlendFuncSeparateEXT(GLenum srcRGB, GLenum dstRGB, GLenum srcAlpha, GLenum dstAlpha) ; - -// GL_EXT_framebuffer_object -extern GLboolean glIsRenderbufferEXT(GLuint renderbuffer) AVAILABLE_MAC_OS_X_VERSION_10_4_AND_LATER; -extern void glBindRenderbufferEXT(GLenum target, GLuint renderbuffer) AVAILABLE_MAC_OS_X_VERSION_10_4_AND_LATER; -extern void glDeleteRenderbuffersEXT(GLsizei n, const GLuint *renderbuffers) AVAILABLE_MAC_OS_X_VERSION_10_4_AND_LATER; -extern void glGenRenderbuffersEXT(GLsizei n, GLuint *renderbuffers) AVAILABLE_MAC_OS_X_VERSION_10_4_AND_LATER; -extern void glRenderbufferStorageEXT(GLenum target, GLenum internalformat, GLsizei width, GLsizei height) AVAILABLE_MAC_OS_X_VERSION_10_4_AND_LATER; -extern void glGetRenderbufferParameterivEXT(GLenum target, GLenum pname, GLint *params) AVAILABLE_MAC_OS_X_VERSION_10_4_AND_LATER; -extern GLboolean glIsFramebufferEXT(GLuint framebuffer) AVAILABLE_MAC_OS_X_VERSION_10_4_AND_LATER; -extern void glBindFramebufferEXT(GLenum target, GLuint framebuffer) AVAILABLE_MAC_OS_X_VERSION_10_4_AND_LATER; -extern void glDeleteFramebuffersEXT(GLsizei n, const GLuint *framebuffers) AVAILABLE_MAC_OS_X_VERSION_10_4_AND_LATER; -extern void glGenFramebuffersEXT(GLsizei n, GLuint *framebuffers) AVAILABLE_MAC_OS_X_VERSION_10_4_AND_LATER; -extern GLenum glCheckFramebufferStatusEXT(GLenum target) AVAILABLE_MAC_OS_X_VERSION_10_4_AND_LATER; -extern void glFramebufferTexture1DEXT(GLenum target, GLenum attachment, GLenum textarget, GLuint texture, GLint level) AVAILABLE_MAC_OS_X_VERSION_10_4_AND_LATER; -extern void glFramebufferTexture2DEXT(GLenum target, GLenum attachment, GLenum textarget, GLuint texture, GLint level) AVAILABLE_MAC_OS_X_VERSION_10_4_AND_LATER; -extern void glFramebufferTexture3DEXT(GLenum target, GLenum attachment, GLenum textarget, GLuint texture, GLint level, GLint zoffset) AVAILABLE_MAC_OS_X_VERSION_10_4_AND_LATER; -extern void glFramebufferRenderbufferEXT(GLenum target, GLenum attachment, GLenum renderbuffertarget, GLuint renderbuffer) AVAILABLE_MAC_OS_X_VERSION_10_4_AND_LATER; -extern void glGetFramebufferAttachmentParameterivEXT(GLenum target, GLenum attachment, GLenum pname, GLint *params) AVAILABLE_MAC_OS_X_VERSION_10_4_AND_LATER; -extern void glGenerateMipmapEXT(GLenum target) AVAILABLE_MAC_OS_X_VERSION_10_4_AND_LATER; - -#ifndef GL_ARB_framebuffer_object -#define glGenerateMipmap glGenerateMipmapEXT -#define GL_MAX_SAMPLES 0x8D57 -#endif - -#ifdef __cplusplus -extern "C" { -#endif - -// -// Define map buffer range headers on Mac -// -#ifndef GL_ARB_map_buffer_range -#define GL_MAP_READ_BIT 0x0001 -#define GL_MAP_WRITE_BIT 0x0002 -#define GL_MAP_INVALIDATE_RANGE_BIT 0x0004 -#define GL_MAP_INVALIDATE_BUFFER_BIT 0x0008 -#define GL_MAP_FLUSH_EXPLICIT_BIT 0x0010 -#define GL_MAP_UNSYNCHRONIZED_BIT 0x0020 -#endif - -// -// Define multisample headers on Mac -// -#ifndef GL_ARB_texture_multisample -#define GL_SAMPLE_POSITION 0x8E50 -#define GL_SAMPLE_MASK 0x8E51 -#define GL_SAMPLE_MASK_VALUE 0x8E52 -#define GL_MAX_SAMPLE_MASK_WORDS 0x8E59 -#define GL_TEXTURE_2D_MULTISAMPLE 0x9100 -#define GL_PROXY_TEXTURE_2D_MULTISAMPLE 0x9101 -#define GL_TEXTURE_2D_MULTISAMPLE_ARRAY 0x9102 -#define GL_PROXY_TEXTURE_2D_MULTISAMPLE_ARRAY 0x9103 -#define GL_TEXTURE_BINDING_2D_MULTISAMPLE 0x9104 -#define GL_TEXTURE_BINDING_2D_MULTISAMPLE_ARRAY 0x9105 -#define GL_TEXTURE_SAMPLES 0x9106 -#define GL_TEXTURE_FIXED_SAMPLE_LOCATIONS 0x9107 -#define GL_SAMPLER_2D_MULTISAMPLE 0x9108 -#define GL_INT_SAMPLER_2D_MULTISAMPLE 0x9109 -#define GL_UNSIGNED_INT_SAMPLER_2D_MULTISAMPLE 0x910A -#define GL_SAMPLER_2D_MULTISAMPLE_ARRAY 0x910B -#define GL_INT_SAMPLER_2D_MULTISAMPLE_ARRAY 0x910C -#define GL_UNSIGNED_INT_SAMPLER_2D_MULTISAMPLE_ARRAY 0x910D -#define GL_MAX_COLOR_TEXTURE_SAMPLES 0x910E -#define GL_MAX_DEPTH_TEXTURE_SAMPLES 0x910F -#define GL_MAX_INTEGER_SAMPLES 0x9110 -#endif - -// -// Define vertex buffer object headers on Mac -// -#ifndef GL_ARB_vertex_buffer_object -#define GL_BUFFER_SIZE_ARB 0x8764 -#define GL_BUFFER_USAGE_ARB 0x8765 -#define GL_ARRAY_BUFFER_ARB 0x8892 -#define GL_ELEMENT_ARRAY_BUFFER_ARB 0x8893 -#define GL_ARRAY_BUFFER_BINDING_ARB 0x8894 -#define GL_ELEMENT_ARRAY_BUFFER_BINDING_ARB 0x8895 -#define GL_VERTEX_ARRAY_BUFFER_BINDING_ARB 0x8896 -#define GL_NORMAL_ARRAY_BUFFER_BINDING_ARB 0x8897 -#define GL_COLOR_ARRAY_BUFFER_BINDING_ARB 0x8898 -#define GL_INDEX_ARRAY_BUFFER_BINDING_ARB 0x8899 -#define GL_TEXTURE_COORD_ARRAY_BUFFER_BINDING_ARB 0x889A -#define GL_EDGE_FLAG_ARRAY_BUFFER_BINDING_ARB 0x889B -#define GL_SECONDARY_COLOR_ARRAY_BUFFER_BINDING_ARB 0x889C -#define GL_FOG_COORDINATE_ARRAY_BUFFER_BINDING_ARB 0x889D -#define GL_WEIGHT_ARRAY_BUFFER_BINDING_ARB 0x889E -#define GL_VERTEX_ATTRIB_ARRAY_BUFFER_BINDING_ARB 0x889F -#define GL_READ_ONLY_ARB 0x88B8 -#define GL_WRITE_ONLY_ARB 0x88B9 -#define GL_READ_WRITE_ARB 0x88BA -#define GL_BUFFER_ACCESS_ARB 0x88BB -#define GL_BUFFER_MAPPED_ARB 0x88BC -#define GL_BUFFER_MAP_POINTER_ARB 0x88BD -#define GL_STREAM_DRAW_ARB 0x88E0 -#define GL_STREAM_READ_ARB 0x88E1 -#define GL_STREAM_COPY_ARB 0x88E2 -#define GL_STATIC_DRAW_ARB 0x88E4 -#define GL_STATIC_READ_ARB 0x88E5 -#define GL_STATIC_COPY_ARB 0x88E6 -#define GL_DYNAMIC_DRAW_ARB 0x88E8 -#define GL_DYNAMIC_READ_ARB 0x88E9 -#define GL_DYNAMIC_COPY_ARB 0x88EA -#endif - - - -#ifndef GL_ARB_vertex_buffer_object -/* GL types for handling large vertex buffer objects */ -typedef intptr_t GLintptr; -typedef intptr_t GLsizeiptr; -#endif - - -#ifndef GL_ARB_vertex_buffer_object -#define GL_ARB_vertex_buffer_object 1 -#ifdef GL_GLEXT_FUNCTION_POINTERS -typedef void (* glBindBufferARBProcPtr) (GLenum target, GLuint buffer); -typedef void (* glDeleteBufferARBProcPtr) (GLsizei n, const GLuint *buffers); -typedef void (* glGenBuffersARBProcPtr) (GLsizei n, GLuint *buffers); -typedef GLboolean (* glIsBufferARBProcPtr) (GLuint buffer); -typedef void (* glBufferDataARBProcPtr) (GLenum target, GLsizeiptrARB size, const GLvoid *data, GLenum usage); -typedef void (* glBufferSubDataARBProcPtr) (GLenum target, GLintptrARB offset, GLsizeiptrARB size, const GLvoid *data); -typedef void (* glGetBufferSubDataARBProcPtr) (GLenum target, GLintptrARB offset, GLsizeiptrARB size, GLvoid *data); -typedef GLvoid* (* glMapBufferARBProcPtr) (GLenum target, GLenum access); /* Flawfinder: ignore */ -typedef GLboolean (* glUnmapBufferARBProcPtr) (GLenum target); -typedef void (* glGetBufferParameterivARBProcPtr) (GLenum target, GLenum pname, GLint *params); -typedef void (* glGetBufferPointervARBProcPtr) (GLenum target, GLenum pname, GLvoid* *params); -#else -extern void glBindBufferARB (GLenum, GLuint); -extern void glDeleteBuffersARB (GLsizei, const GLuint *); -extern void glGenBuffersARB (GLsizei, GLuint *); -extern GLboolean glIsBufferARB (GLuint); -extern void glBufferDataARB (GLenum, GLsizeiptrARB, const GLvoid *, GLenum); -extern void glBufferSubDataARB (GLenum, GLintptrARB, GLsizeiptrARB, const GLvoid *); -extern void glGetBufferSubDataARB (GLenum, GLintptrARB, GLsizeiptrARB, GLvoid *); -extern GLvoid* glMapBufferARB (GLenum, GLenum); -extern GLboolean glUnmapBufferARB (GLenum); -extern void glGetBufferParameterivARB (GLenum, GLenum, GLint *); -extern void glGetBufferPointervARB (GLenum, GLenum, GLvoid* *); -#endif /* GL_GLEXT_FUNCTION_POINTERS */ -#endif - -#ifndef GL_ARB_texture_rg -#define GL_RG 0x8227 -#define GL_RG_INTEGER 0x8228 -#define GL_R8 0x8229 -#define GL_R16 0x822A -#define GL_RG8 0x822B -#define GL_RG16 0x822C -#define GL_R16F 0x822D -#define GL_R32F 0x822E -#define GL_RG16F 0x822F -#define GL_RG32F 0x8230 -#define GL_R8I 0x8231 -#define GL_R8UI 0x8232 -#define GL_R16I 0x8233 -#define GL_R16UI 0x8234 -#define GL_R32I 0x8235 -#define GL_R32UI 0x8236 -#define GL_RG8I 0x8237 -#define GL_RG8UI 0x8238 -#define GL_RG16I 0x8239 -#define GL_RG16UI 0x823A -#define GL_RG32I 0x823B -#define GL_RG32UI 0x823C -#endif - -// May be needed for DARWIN... -// #ifndef GL_ARB_compressed_tex_image -// #define GL_ARB_compressed_tex_image 1 -// #ifdef GL_GLEXT_FUNCTION_POINTERS -// typedef void (* glCompressedTexImage1D) (GLenum, GLint, GLenum, GLsizei, GLint, GLsizei, const GLvoid*); -// typedef void (* glCompressedTexImage2D) (GLenum, GLint, GLenum, GLsizei, GLsizei, GLint, GLsizei, const GLvoid*); -// typedef void (* glCompressedTexImage3D) (GLenum, GLint, GLenum, GLsizei, GLsizei, GLsizei, GLint, GLsizei, const GLvoid*); -// typedef void (* glCompressedTexSubImage1D) (GLenum, GLint, GLint, GLsizei, GLenum, GLsizei, const GLvoid*); -// typedef void (* glCompressedTexSubImage2D) (GLenum, GLint, GLint, GLint, GLsizei, GLsizei, GLenum, GLsizei, const GLvoid*); -// typedef void (* glCompressedTexSubImage3D) (GLenum, GLint, GLint, GLint, GLint, GLsizei, GLsizei, GLsizei, GLenum, GLsizei, const GLvoid*); -// typedef void (* glGetCompressedTexImage) (GLenum, GLint, GLvoid*); -// #else -// extern void glCompressedTexImage1D (GLenum, GLint, GLenum, GLsizei, GLint, GLsizei, const GLvoid*); -// extern void glCompressedTexImage2D (GLenum, GLint, GLenum, GLsizei, GLsizei, GLint, GLsizei, const GLvoid*); -// extern void glCompressedTexImage3D (GLenum, GLint, GLenum, GLsizei, GLsizei, GLsizei, GLint, GLsizei, const GLvoid*); -// extern void glCompressedTexSubImage1D (GLenum, GLint, GLint, GLsizei, GLenum, GLsizei, const GLvoid*); -// extern void glCompressedTexSubImage2D (GLenum, GLint, GLint, GLint, GLsizei, GLsizei, GLenum, GLsizei, const GLvoid*); -// extern void glCompressedTexSubImage3D (GLenum, GLint, GLint, GLint, GLint, GLsizei, GLsizei, GLsizei, GLenum, GLsizei, const GLvoid*); -// extern void glGetCompressedTexImage (GLenum, GLint, GLvoid*); -// #endif /* GL_GLEXT_FUNCTION_POINTERS */ -// #endif - -#ifdef __cplusplus -} -#endif - -#include - -#endif // LL_MESA / LL_WINDOWS / LL_DARWIN - -// Even when GL_ARB_depth_clamp is available in the driver, the (correct) -// headers, and therefore GL_DEPTH_CLAMP might not be defined. -// In that case GL_DEPTH_CLAMP_NV should be defined, but why not just -// use the known numeric. -// -// To avoid #ifdef's in the code. Just define this here. -#ifndef GL_DEPTH_CLAMP -// Probably (still) called GL_DEPTH_CLAMP_NV. -#define GL_DEPTH_CLAMP 0x864F -#endif - -//GL_NVX_gpu_memory_info constants -#ifndef GL_NVX_gpu_memory_info -#define GL_NVX_gpu_memory_info -#define GL_GPU_MEMORY_INFO_DEDICATED_VIDMEM_NVX 0x9047 -#define GL_GPU_MEMORY_INFO_TOTAL_AVAILABLE_MEMORY_NVX 0x9048 -#define GL_GPU_MEMORY_INFO_CURRENT_AVAILABLE_VIDMEM_NVX 0x9049 -#define GL_GPU_MEMORY_INFO_EVICTION_COUNT_NVX 0x904A -#define GL_GPU_MEMORY_INFO_EVICTED_MEMORY_NVX 0x904B -#endif - -//GL_ATI_meminfo constants -#ifndef GL_ATI_meminfo -#define GL_ATI_meminfo -#define GL_VBO_FREE_MEMORY_ATI 0x87FB -#define GL_TEXTURE_FREE_MEMORY_ATI 0x87FC -#define GL_RENDERBUFFER_FREE_MEMORY_ATI 0x87FD #endif #if defined(TRACY_ENABLE) && LL_PROFILER_ENABLE_TRACY_OPENGL diff --git a/indra/llrender/llglstates.h b/indra/llrender/llglstates.h index 9bb980d7ad3..8248e83044f 100644 --- a/indra/llrender/llglstates.h +++ b/indra/llrender/llglstates.h @@ -166,31 +166,4 @@ class LLGLSTracker //---------------------------------------------------------------------------- -class LLGLSSpecular -{ -public: - F32 mShininess; - LLGLSSpecular(const LLColor4& color, F32 shininess) - { - mShininess = shininess; - if (mShininess > 0.0f) - { - glMaterialfv(GL_FRONT_AND_BACK, GL_SPECULAR, color.mV); - S32 shiny = (S32)(shininess*128.f); - shiny = llclamp(shiny,0,128); - glMateriali(GL_FRONT_AND_BACK, GL_SHININESS, shiny); - } - } - ~LLGLSSpecular() - { - if (mShininess > 0.f) - { - glMaterialfv(GL_FRONT_AND_BACK, GL_SPECULAR, LLColor4(0.f,0.f,0.f,0.f).mV); - glMateriali(GL_FRONT_AND_BACK, GL_SHININESS, 0); - } - } -}; - -//---------------------------------------------------------------------------- - #endif diff --git a/indra/llrender/llimagegl.cpp b/indra/llrender/llimagegl.cpp index 97ea6f67bd8..3165cb313b2 100644 --- a/indra/llrender/llimagegl.cpp +++ b/indra/llrender/llimagegl.cpp @@ -138,7 +138,6 @@ U32 LLImageGL::sUniqueCount = 0; U32 LLImageGL::sBindCount = 0; S32 LLImageGL::sCount = 0; -bool LLImageGL::sGlobalUseAnisotropic = false; F32 LLImageGL::sLastFrameTime = 0.f; LLImageGL* LLImageGL::sDefaultGLTexture = NULL ; bool LLImageGL::sCompressTextures = false; @@ -837,14 +836,6 @@ bool LLImageGL::setImage(const U8* data_in, bool data_hasmips /* = false */, S32 mMipLevels = wpo2(llmax(w, h)); - //use legacy mipmap generation mode (note: making this condional can cause rendering issues) - // -- but making it not conditional triggers deprecation warnings when core profile is enabled - // (some rendering issues while core profile is enabled are acceptable at this point in time) - if (!LLRender::sGLCoreProfile) - { - glTexParameteri(mTarget, GL_GENERATE_MIPMAP, GL_TRUE); - } - LLImageGL::setManualImage(mTarget, 0, mFormatInternal, w, h, mFormatPrimary, mFormatType, @@ -860,7 +851,6 @@ bool LLImageGL::setImage(const U8* data_in, bool data_hasmips /* = false */, S32 stop_glerror(); } - if (LLRender::sGLCoreProfile) { LL_PROFILE_GPU_ZONE("generate mip map"); glGenerateMipmap(mTarget); @@ -1053,7 +1043,11 @@ U32 type_width_from_pixtype(U32 pixtype) bool should_stagger_image_set(bool compressed) { -#if LL_DARWIN +#if LL_MESA_HEADLESS + return false; +#elif LL_LINUX + return !compressed && on_main_thread() && gGLManager.mIsNVIDIA; +#elif LL_DARWIN return !compressed && on_main_thread() && gGLManager.mIsAMD; #else // glTexSubImage2D doesn't work with compressed textures on select tested Nvidia GPUs on Windows 10 -Cosmic,2023-03-08 @@ -2006,7 +2000,7 @@ bool LLImageGL::getIsResident(bool test_now) { if (mTexName != 0) { - glAreTexturesResident(1, (GLuint*)&mTexName, &mIsResident); + mIsResident = true; } else { @@ -2141,7 +2135,7 @@ void LLImageGL::calcAlphaChannelOffsetAndStride() case GL_SRGB_ALPHA: mAlphaStride = 4; break; - case GL_BGRA_EXT: + case GL_BGRA: mAlphaStride = 4; break; default: @@ -2178,7 +2172,7 @@ void LLImageGL::calcAlphaChannelOffsetAndStride() if( mAlphaStride < 1 || //unsupported format mAlphaOffset < 0 || //unsupported type - (mFormatPrimary == GL_BGRA_EXT && mFormatType != GL_UNSIGNED_BYTE)) //unknown situation + (mFormatPrimary == GL_BGRA && mFormatType != GL_UNSIGNED_BYTE)) //unknown situation { LL_WARNS() << "Cannot analyze alpha for image with format type " << std::hex << mFormatType << std::dec << LL_ENDL; diff --git a/indra/llrender/llimagegl.h b/indra/llrender/llimagegl.h index 6b4492c09e7..773b647d69f 100644 --- a/indra/llrender/llimagegl.h +++ b/indra/llrender/llimagegl.h @@ -285,7 +285,6 @@ class LLImageGL : public LLRefCount // Global memory statistics static U32 sBindCount; // Tracks number of texture binds for current frame static U32 sUniqueCount; // Tracks number of unique texture binds for current frame - static bool sGlobalUseAnisotropic; static LLImageGL* sDefaultGLTexture ; static bool sAutomatedTest; static bool sCompressTextures; //use GL texture compression diff --git a/indra/llrender/llpostprocess.cpp b/indra/llrender/llpostprocess.cpp deleted file mode 100644 index eef7193c92b..00000000000 --- a/indra/llrender/llpostprocess.cpp +++ /dev/null @@ -1,454 +0,0 @@ -/** - * @file llpostprocess.cpp - * @brief LLPostProcess class implementation - * - * $LicenseInfo:firstyear=2007&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 "linden_common.h" - -#include "llpostprocess.h" -#include "llglslshader.h" -#include "llsdserialize.h" -#include "llrender.h" - -static LLStaticHashedString sRenderTexture("RenderTexture"); -static LLStaticHashedString sBrightness("brightness"); -static LLStaticHashedString sContrast("contrast"); -static LLStaticHashedString sContrastBase("contrastBase"); -static LLStaticHashedString sSaturation("saturation"); -static LLStaticHashedString sLumWeights("lumWeights"); -static LLStaticHashedString sNoiseTexture("NoiseTexture"); -static LLStaticHashedString sBrightMult("brightMult"); -static LLStaticHashedString sNoiseStrength("noiseStrength"); -static LLStaticHashedString sExtractLow("extractLow"); -static LLStaticHashedString sExtractHigh("extractHigh"); -static LLStaticHashedString sBloomStrength("bloomStrength"); -static LLStaticHashedString sTexelSize("texelSize"); -static LLStaticHashedString sBlurDirection("blurDirection"); -static LLStaticHashedString sBlurWidth("blurWidth"); - -LLPostProcess * gPostProcess = NULL; - -static const unsigned int NOISE_SIZE = 512; - -LLPostProcess::LLPostProcess(void) : - initialized(false), - mAllEffects(LLSD::emptyMap()), - screenW(1), screenH(1) -{ - mSceneRenderTexture = NULL ; - mNoiseTexture = NULL ; - mTempBloomTexture = NULL ; - - noiseTextureScale = 1.0f; - - /* Do nothing. Needs to be updated to use our current shader system, and to work with the move into llrender. - std::string pathName(gDirUtilp->getExpandedFilename(LL_PATH_APP_SETTINGS, "windlight", XML_FILENAME)); - LL_DEBUGS("AppInit", "Shaders") << "Loading PostProcess Effects settings from " << pathName << LL_ENDL; - - llifstream effectsXML(pathName); - - if (effectsXML) - { - LLPointer parser = new LLSDXMLParser(); - - parser->parse(effectsXML, mAllEffects, LLSDSerialize::SIZE_UNLIMITED); - } - - if (!mAllEffects.has("default")) - { - LLSD & defaultEffect = (mAllEffects["default"] = LLSD::emptyMap()); - - defaultEffect["enable_night_vision"] = LLSD::Boolean(false); - defaultEffect["enable_bloom"] = LLSD::Boolean(false); - defaultEffect["enable_color_filter"] = LLSD::Boolean(false); - - /// NVG Defaults - defaultEffect["brightness_multiplier"] = 3.0; - defaultEffect["noise_size"] = 25.0; - defaultEffect["noise_strength"] = 0.4; - - // TODO BTest potentially add this to tweaks? - noiseTextureScale = 1.0f; - - /// Bloom Defaults - defaultEffect["extract_low"] = 0.95; - defaultEffect["extract_high"] = 1.0; - defaultEffect["bloom_width"] = 2.25; - defaultEffect["bloom_strength"] = 1.5; - - /// Color Filter Defaults - defaultEffect["brightness"] = 1.0; - defaultEffect["contrast"] = 1.0; - defaultEffect["saturation"] = 1.0; - - LLSD& contrastBase = (defaultEffect["contrast_base"] = LLSD::emptyArray()); - contrastBase.append(1.0); - contrastBase.append(1.0); - contrastBase.append(1.0); - contrastBase.append(0.5); - } - - setSelectedEffect("default"); - */ -} - -LLPostProcess::~LLPostProcess(void) -{ - invalidate() ; -} - -// static -void LLPostProcess::initClass(void) -{ - //this will cause system to crash at second time login - //if first time login fails due to network connection --- bao - //***llassert_always(gPostProcess == NULL); - //replaced by the following line: - if(gPostProcess) - return ; - - - gPostProcess = new LLPostProcess(); -} - -// static -void LLPostProcess::cleanupClass() -{ - delete gPostProcess; - gPostProcess = NULL; -} - -void LLPostProcess::setSelectedEffect(std::string const & effectName) -{ - mSelectedEffectName = effectName; - static_cast(tweaks) = mAllEffects[effectName]; -} - -void LLPostProcess::saveEffect(std::string const & effectName) -{ - /* Do nothing. Needs to be updated to use our current shader system, and to work with the move into llrender. - mAllEffects[effectName] = tweaks; - - std::string pathName(gDirUtilp->getExpandedFilename(LL_PATH_APP_SETTINGS, "windlight", XML_FILENAME)); - //LL_INFOS() << "Saving PostProcess Effects settings to " << pathName << LL_ENDL; - - llofstream effectsXML(pathName); - - LLPointer formatter = new LLSDXMLFormatter(); - - formatter->format(mAllEffects, effectsXML); - */ -} -void LLPostProcess::invalidate() -{ - mSceneRenderTexture = NULL ; - mNoiseTexture = NULL ; - mTempBloomTexture = NULL ; - initialized = false ; -} - -void LLPostProcess::apply(unsigned int width, unsigned int height) -{ - if (!initialized || width != screenW || height != screenH){ - initialize(width, height); - } - if (shadersEnabled()){ - doEffects(); - } -} - -void LLPostProcess::initialize(unsigned int width, unsigned int height) -{ - screenW = width; - screenH = height; - createTexture(mSceneRenderTexture, screenW, screenH); - initialized = true; - - checkError(); - createNightVisionShader(); - createBloomShader(); - createColorFilterShader(); - checkError(); -} - -inline bool LLPostProcess::shadersEnabled(void) -{ - return (tweaks.useColorFilter().asBoolean() || - tweaks.useNightVisionShader().asBoolean() || - tweaks.useBloomShader().asBoolean() ); - -} - -void LLPostProcess::applyShaders(void) -{ - if (tweaks.useColorFilter()){ - applyColorFilterShader(); - checkError(); - } - if (tweaks.useNightVisionShader()){ - /// If any of the above shaders have been called update the frame buffer; - if (tweaks.useColorFilter()) - { - U32 tex = mSceneRenderTexture->getTexName() ; - copyFrameBuffer(tex, screenW, screenH); - } - applyNightVisionShader(); - checkError(); - } - if (tweaks.useBloomShader()){ - /// If any of the above shaders have been called update the frame buffer; - if (tweaks.useColorFilter().asBoolean() || tweaks.useNightVisionShader().asBoolean()) - { - U32 tex = mSceneRenderTexture->getTexName() ; - copyFrameBuffer(tex, screenW, screenH); - } - applyBloomShader(); - checkError(); - } -} - -void LLPostProcess::applyColorFilterShader(void) -{ - -} - -void LLPostProcess::createColorFilterShader(void) -{ - /// Define uniform names - colorFilterUniforms[sRenderTexture] = 0; - colorFilterUniforms[sBrightness] = 0; - colorFilterUniforms[sContrast] = 0; - colorFilterUniforms[sContrastBase] = 0; - colorFilterUniforms[sSaturation] = 0; - colorFilterUniforms[sLumWeights] = 0; -} - -void LLPostProcess::applyNightVisionShader(void) -{ - -} - -void LLPostProcess::createNightVisionShader(void) -{ - /// Define uniform names - nightVisionUniforms[sRenderTexture] = 0; - nightVisionUniforms[sNoiseTexture] = 0; - nightVisionUniforms[sBrightMult] = 0; - nightVisionUniforms[sNoiseStrength] = 0; - nightVisionUniforms[sLumWeights] = 0; - - createNoiseTexture(mNoiseTexture); -} - -void LLPostProcess::applyBloomShader(void) -{ - -} - -void LLPostProcess::createBloomShader(void) -{ - createTexture(mTempBloomTexture, unsigned(screenW * 0.5), unsigned(screenH * 0.5)); - - /// Create Bloom Extract Shader - bloomExtractUniforms[sRenderTexture] = 0; - bloomExtractUniforms[sExtractLow] = 0; - bloomExtractUniforms[sExtractHigh] = 0; - bloomExtractUniforms[sLumWeights] = 0; - - /// Create Bloom Blur Shader - bloomBlurUniforms[sRenderTexture] = 0; - bloomBlurUniforms[sBloomStrength] = 0; - bloomBlurUniforms[sTexelSize] = 0; - bloomBlurUniforms[sBlurDirection] = 0; - bloomBlurUniforms[sBlurWidth] = 0; -} - -void LLPostProcess::getShaderUniforms(glslUniforms & uniforms, GLuint & prog) -{ - /// Find uniform locations and insert into map - glslUniforms::iterator i; - for (i = uniforms.begin(); i != uniforms.end(); ++i){ - i->second = glGetUniformLocation(prog, i->first.String().c_str()); - } -} - -void LLPostProcess::doEffects(void) -{ - /// Save GL State - glPushAttrib(GL_ALL_ATTRIB_BITS); - glPushClientAttrib(GL_ALL_ATTRIB_BITS); - - /// Copy the screen buffer to the render texture - { - U32 tex = mSceneRenderTexture->getTexName() ; - copyFrameBuffer(tex, screenW, screenH); - } - - /// Clear the frame buffer. - glClearColor(0.0f, 0.0f, 0.0f, 1.0f); - glClear(GL_COLOR_BUFFER_BIT); - - /// Change to an orthogonal view - viewOrthogonal(screenW, screenH); - - checkError(); - applyShaders(); - - LLGLSLShader::unbind(); - checkError(); - - /// Change to a perspective view - viewPerspective(); - - /// Reset GL State - glPopClientAttrib(); - glPopAttrib(); - checkError(); -} - -void LLPostProcess::copyFrameBuffer(U32 & texture, unsigned int width, unsigned int height) -{ - gGL.getTexUnit(0)->bindManual(LLTexUnit::TT_TEXTURE, texture); - glCopyTexImage2D(GL_TEXTURE_RECTANGLE, 0, GL_RGBA, 0, 0, width, height, 0); -} - -void LLPostProcess::drawOrthoQuad(unsigned int width, unsigned int height, QuadType type) -{ - -} - -void LLPostProcess::viewOrthogonal(unsigned int width, unsigned int height) -{ - gGL.matrixMode(LLRender::MM_PROJECTION); - gGL.pushMatrix(); - gGL.loadIdentity(); - gGL.ortho( 0.f, (GLfloat) width , (GLfloat) height , 0.f, -1.f, 1.f ); - gGL.matrixMode(LLRender::MM_MODELVIEW); - gGL.pushMatrix(); - gGL.loadIdentity(); -} - -void LLPostProcess::viewPerspective(void) -{ - gGL.matrixMode(LLRender::MM_PROJECTION); - gGL.popMatrix(); - gGL.matrixMode(LLRender::MM_MODELVIEW); - gGL.popMatrix(); -} - -void LLPostProcess::changeOrthogonal(unsigned int width, unsigned int height) -{ - viewPerspective(); - viewOrthogonal(width, height); -} - -void LLPostProcess::createTexture(LLPointer& texture, unsigned int width, unsigned int height) -{ - std::vector data(width * height * 4, 0) ; - - texture = new LLImageGL(false) ; - if(texture->createGLTexture()) - { - gGL.getTexUnit(0)->bindManual(LLTexUnit::TT_TEXTURE, texture->getTexName()); - glTexImage2D(GL_TEXTURE_RECTANGLE, 0, 4, width, height, 0, - GL_RGBA, GL_UNSIGNED_BYTE, &data[0]); - gGL.getTexUnit(0)->setTextureFilteringOption(LLTexUnit::TFO_BILINEAR); - gGL.getTexUnit(0)->setTextureAddressMode(LLTexUnit::TAM_CLAMP); - } -} - -void LLPostProcess::createNoiseTexture(LLPointer& texture) -{ - std::vector buffer(NOISE_SIZE * NOISE_SIZE); - for (unsigned int i = 0; i < NOISE_SIZE; i++){ - for (unsigned int k = 0; k < NOISE_SIZE; k++){ - buffer[(i * NOISE_SIZE) + k] = (GLubyte)((double) rand() / ((double) RAND_MAX + 1.f) * 255.f); - } - } - - texture = new LLImageGL(false) ; - if(texture->createGLTexture()) - { - gGL.getTexUnit(0)->bindManual(LLTexUnit::TT_TEXTURE, texture->getTexName()); - LLImageGL::setManualImage(GL_TEXTURE_2D, 0, GL_LUMINANCE, NOISE_SIZE, NOISE_SIZE, GL_LUMINANCE, GL_UNSIGNED_BYTE, &buffer[0]); - gGL.getTexUnit(0)->setTextureFilteringOption(LLTexUnit::TFO_BILINEAR); - gGL.getTexUnit(0)->setTextureAddressMode(LLTexUnit::TAM_WRAP); - } -} - -bool LLPostProcess::checkError(void) -{ - GLenum glErr; - bool retCode = false; - - glErr = glGetError(); - while (glErr != GL_NO_ERROR) - { - // shaderErrorLog << (const char *) gluErrorString(glErr) << std::endl; - char const * err_str_raw = (const char *) gluErrorString(glErr); - - if(err_str_raw == NULL) - { - std::ostringstream err_builder; - err_builder << "unknown error number " << glErr; - mShaderErrorString = err_builder.str(); - } - else - { - mShaderErrorString = err_str_raw; - } - - retCode = true; - glErr = glGetError(); - } - return retCode; -} - -void LLPostProcess::checkShaderError(GLuint shader) -{ - GLint infologLength = 0; - GLint charsWritten = 0; - GLchar *infoLog; - - checkError(); // Check for OpenGL errors - - glGetShaderiv(shader, GL_INFO_LOG_LENGTH, &infologLength); - - checkError(); // Check for OpenGL errors - - if (infologLength > 0) - { - infoLog = (GLchar *)malloc(infologLength); - if (infoLog == NULL) - { - /// Could not allocate infolog buffer - return; - } - glGetProgramInfoLog(shader, infologLength, &charsWritten, infoLog); - // shaderErrorLog << (char *) infoLog << std::endl; - mShaderErrorString = (char *) infoLog; - free(infoLog); - } - checkError(); // Check for OpenGL errors -} diff --git a/indra/llrender/llpostprocess.h b/indra/llrender/llpostprocess.h deleted file mode 100644 index b5b7549efb3..00000000000 --- a/indra/llrender/llpostprocess.h +++ /dev/null @@ -1,267 +0,0 @@ -/** - * @file llpostprocess.h - * @brief LLPostProcess class definition - * - * $LicenseInfo:firstyear=2007&license=viewerlgpl$ - * Second Life Viewer Source Code - * Copyright (C) 2010, Linden Research, Inc. - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; - * version 2.1 of the License only. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA - * - * Linden Research, Inc., 945 Battery Street, San Francisco, CA 94111 USA - * $/LicenseInfo$ - */ - -#ifndef LL_POSTPROCESS_H -#define LL_POSTPROCESS_H - -#include -#include -#include "llgl.h" -#include "llglheaders.h" -#include "llstaticstringtable.h" - -class LLPostProcess -{ -public: - - typedef enum _QuadType { - QUAD_NORMAL, - QUAD_NOISE, - QUAD_BLOOM_EXTRACT, - QUAD_BLOOM_COMBINE - } QuadType; - - /// GLSL Shader Encapsulation Struct - typedef LLStaticStringTable glslUniforms; - - struct PostProcessTweaks : public LLSD { - inline PostProcessTweaks() : LLSD(LLSD::emptyMap()) - { - } - - inline LLSD & brightMult() { - return (*this)["brightness_multiplier"]; - } - - inline LLSD & noiseStrength() { - return (*this)["noise_strength"]; - } - - inline LLSD & noiseSize() { - return (*this)["noise_size"]; - } - - inline LLSD & extractLow() { - return (*this)["extract_low"]; - } - - inline LLSD & extractHigh() { - return (*this)["extract_high"]; - } - - inline LLSD & bloomWidth() { - return (*this)["bloom_width"]; - } - - inline LLSD & bloomStrength() { - return (*this)["bloom_strength"]; - } - - inline LLSD & brightness() { - return (*this)["brightness"]; - } - - inline LLSD & contrast() { - return (*this)["contrast"]; - } - - inline LLSD & contrastBaseR() { - return (*this)["contrast_base"][0]; - } - - inline LLSD & contrastBaseG() { - return (*this)["contrast_base"][1]; - } - - inline LLSD & contrastBaseB() { - return (*this)["contrast_base"][2]; - } - - inline LLSD & contrastBaseIntensity() { - return (*this)["contrast_base"][3]; - } - - inline LLSD & saturation() { - return (*this)["saturation"]; - } - - inline LLSD & useNightVisionShader() { - return (*this)["enable_night_vision"]; - } - - inline LLSD & useBloomShader() { - return (*this)["enable_bloom"]; - } - - inline LLSD & useColorFilter() { - return (*this)["enable_color_filter"]; - } - - - inline F32 getBrightMult() const { - return F32((*this)["brightness_multiplier"].asReal()); - } - - inline F32 getNoiseStrength() const { - return F32((*this)["noise_strength"].asReal()); - } - - inline F32 getNoiseSize() const { - return F32((*this)["noise_size"].asReal()); - } - - inline F32 getExtractLow() const { - return F32((*this)["extract_low"].asReal()); - } - - inline F32 getExtractHigh() const { - return F32((*this)["extract_high"].asReal()); - } - - inline F32 getBloomWidth() const { - return F32((*this)["bloom_width"].asReal()); - } - - inline F32 getBloomStrength() const { - return F32((*this)["bloom_strength"].asReal()); - } - - inline F32 getBrightness() const { - return F32((*this)["brightness"].asReal()); - } - - inline F32 getContrast() const { - return F32((*this)["contrast"].asReal()); - } - - inline F32 getContrastBaseR() const { - return F32((*this)["contrast_base"][0].asReal()); - } - - inline F32 getContrastBaseG() const { - return F32((*this)["contrast_base"][1].asReal()); - } - - inline F32 getContrastBaseB() const { - return F32((*this)["contrast_base"][2].asReal()); - } - - inline F32 getContrastBaseIntensity() const { - return F32((*this)["contrast_base"][3].asReal()); - } - - inline F32 getSaturation() const { - return F32((*this)["saturation"].asReal()); - } - - }; - - bool initialized; - PostProcessTweaks tweaks; - - // the map of all availible effects - LLSD mAllEffects; - -private: - LLPointer mSceneRenderTexture ; - LLPointer mNoiseTexture ; - LLPointer mTempBloomTexture ; - -public: - LLPostProcess(void); - - ~LLPostProcess(void); - - void apply(unsigned int width, unsigned int height); - void invalidate() ; - - /// Perform global initialization for this class. - static void initClass(void); - - // Cleanup of global data that's only inited once per class. - static void cleanupClass(); - - void setSelectedEffect(std::string const & effectName); - - inline std::string const & getSelectedEffect(void) const { - return mSelectedEffectName; - } - - void saveEffect(std::string const & effectName); - -private: - /// read in from file - std::string mShaderErrorString; - unsigned int screenW; - unsigned int screenH; - - float noiseTextureScale; - - /// Shader Uniforms - glslUniforms nightVisionUniforms; - glslUniforms bloomExtractUniforms; - glslUniforms bloomBlurUniforms; - glslUniforms colorFilterUniforms; - - // the name of currently selected effect in mAllEffects - // invariant: tweaks == mAllEffects[mSelectedEffectName] - std::string mSelectedEffectName; - - /// General functions - void initialize(unsigned int width, unsigned int height); - void doEffects(void); - void applyShaders(void); - bool shadersEnabled(void); - - /// Night Vision Functions - void createNightVisionShader(void); - void applyNightVisionShader(void); - - /// Bloom Functions - void createBloomShader(void); - void applyBloomShader(void); - - /// Color Filter Functions - void createColorFilterShader(void); - void applyColorFilterShader(void); - - /// OpenGL Helper Functions - void getShaderUniforms(glslUniforms & uniforms, GLuint & prog); - void createTexture(LLPointer& texture, unsigned int width, unsigned int height); - void copyFrameBuffer(U32 & texture, unsigned int width, unsigned int height); - void createNoiseTexture(LLPointer& texture); - bool checkError(void); - void checkShaderError(GLuint shader); - void drawOrthoQuad(unsigned int width, unsigned int height, QuadType type); - void viewOrthogonal(unsigned int width, unsigned int height); - void changeOrthogonal(unsigned int width, unsigned int height); - void viewPerspective(void); -}; - -extern LLPostProcess * gPostProcess; - - -#endif // LL_POSTPROCESS_H diff --git a/indra/llrender/llrender.cpp b/indra/llrender/llrender.cpp index 57be8570afb..ab88e4868ec 100644 --- a/indra/llrender/llrender.cpp +++ b/indra/llrender/llrender.cpp @@ -38,7 +38,11 @@ #include "hbxxh.h" #include "glm/gtc/type_ptr.hpp" -#if LL_WINDOWS +#if GL_ARB_debug_output +#ifndef APIENTRY +#define APIENTRY +#endif + extern void APIENTRY gl_debug_callback(GLenum source, GLenum type, GLuint id, @@ -67,20 +71,12 @@ S32 gGLViewport[4]; U32 LLRender::sUICalls = 0; U32 LLRender::sUIVerts = 0; U32 LLTexUnit::sWhiteTexture = 0; +F32 LLRender::sAnisotropicFilteringLevel = 0.f; bool LLRender::sGLCoreProfile = false; bool LLRender::sNsightDebugSupport = false; LLVector2 LLRender::sUIGLScaleFactor = LLVector2(1.f, 1.f); bool LLRender::sClassicMode = false; -struct LLVBCache -{ - LLPointer vb; - std::chrono::steady_clock::time_point touched; -}; - -static std::unordered_map sVBCache; -static thread_local std::list *sBufferDataList = nullptr; - static const GLenum sGLTextureType[] = { GL_TEXTURE_2D, @@ -529,9 +525,11 @@ void LLTexUnit::setTextureFilteringOptionFast(LLTexUnit::eTextureFilterOptions o if (gGLManager.mHasAnisotropic) { - if (LLImageGL::sGlobalUseAnisotropic && option == TFO_ANISOTROPIC) + if (option == TFO_ANISOTROPIC && LLRender::sAnisotropicFilteringLevel > 1.f) { - glTexParameterf(sGLTextureType[tex_type], GL_TEXTURE_MAX_ANISOTROPY, gGLManager.mMaxAnisotropy); + F32 aniso_level = llclamp(LLRender::sAnisotropicFilteringLevel, 1.f, gGLManager.mMaxAnisotropy); + glTexParameterf(sGLTextureType[tex_type], GL_TEXTURE_MAX_ANISOTROPY, aniso_level); + } else { @@ -540,82 +538,6 @@ void LLTexUnit::setTextureFilteringOptionFast(LLTexUnit::eTextureFilterOptions o } } -GLint LLTexUnit::getTextureSource(eTextureBlendSrc src) -{ - switch(src) - { - // All four cases should return the same value. - case TBS_PREV_COLOR: - case TBS_PREV_ALPHA: - case TBS_ONE_MINUS_PREV_COLOR: - case TBS_ONE_MINUS_PREV_ALPHA: - return GL_PREVIOUS; - - // All four cases should return the same value. - case TBS_TEX_COLOR: - case TBS_TEX_ALPHA: - case TBS_ONE_MINUS_TEX_COLOR: - case TBS_ONE_MINUS_TEX_ALPHA: - return GL_TEXTURE; - - // All four cases should return the same value. - case TBS_VERT_COLOR: - case TBS_VERT_ALPHA: - case TBS_ONE_MINUS_VERT_COLOR: - case TBS_ONE_MINUS_VERT_ALPHA: - return GL_PRIMARY_COLOR; - - // All four cases should return the same value. - case TBS_CONST_COLOR: - case TBS_CONST_ALPHA: - case TBS_ONE_MINUS_CONST_COLOR: - case TBS_ONE_MINUS_CONST_ALPHA: - return GL_CONSTANT; - - default: - LL_WARNS() << "Unknown eTextureBlendSrc: " << src << ". Using Vertex Color instead." << LL_ENDL; - return GL_PRIMARY_COLOR; - } -} - -GLint LLTexUnit::getTextureSourceType(eTextureBlendSrc src, bool isAlpha) -{ - switch(src) - { - // All four cases should return the same value. - case TBS_PREV_COLOR: - case TBS_TEX_COLOR: - case TBS_VERT_COLOR: - case TBS_CONST_COLOR: - return (isAlpha) ? GL_SRC_ALPHA: GL_SRC_COLOR; - - // All four cases should return the same value. - case TBS_PREV_ALPHA: - case TBS_TEX_ALPHA: - case TBS_VERT_ALPHA: - case TBS_CONST_ALPHA: - return GL_SRC_ALPHA; - - // All four cases should return the same value. - case TBS_ONE_MINUS_PREV_COLOR: - case TBS_ONE_MINUS_TEX_COLOR: - case TBS_ONE_MINUS_VERT_COLOR: - case TBS_ONE_MINUS_CONST_COLOR: - return (isAlpha) ? GL_ONE_MINUS_SRC_ALPHA : GL_ONE_MINUS_SRC_COLOR; - - // All four cases should return the same value. - case TBS_ONE_MINUS_PREV_ALPHA: - case TBS_ONE_MINUS_TEX_ALPHA: - case TBS_ONE_MINUS_VERT_ALPHA: - case TBS_ONE_MINUS_CONST_ALPHA: - return GL_ONE_MINUS_SRC_ALPHA; - - default: - LL_WARNS() << "Unknown eTextureBlendSrc: " << src << ". Using Source Color or Alpha instead." << LL_ENDL; - return (isAlpha) ? GL_SRC_ALPHA: GL_SRC_COLOR; - } -} - // Useful for debugging that you've manually assigned a texture operation to the correct // texture unit based on the currently set active texture in opengl. void LLTexUnit::debugTextureUnit(void) @@ -845,7 +767,7 @@ LLRender::~LLRender() bool LLRender::init(bool needs_vertex_buffer) { -#if LL_WINDOWS +#if GL_ARB_debug_output && !LL_DARWIN if (gGLManager.mHasDebugOutput && gDebugGL) { //setup debug output callback //glDebugMessageControl(GL_DONT_CARE, GL_DONT_CARE, GL_DEBUG_SEVERITY_LOW_ARB, 0, NULL, GL_TRUE); @@ -899,7 +821,9 @@ void LLRender::initVertexBuffer() void LLRender::resetVertexBuffer() { - mBuffer = NULL; + mBuffer = nullptr; + mBufferDataList = nullptr; + mVBCache.clear(); } void LLRender::shutdown() @@ -1096,7 +1020,7 @@ void LLRender::syncMatrices() S32 loc = shader->getUniformLocation(LLShaderMgr::MODELVIEW_PROJECTION_MATRIX); if (loc > -1) { - if (cached_mvp_mdv_hash != mMatHash[MM_PROJECTION] || cached_mvp_proj_hash != mMatHash[MM_PROJECTION]) + if (cached_mvp_mdv_hash != mMatHash[MM_MODELVIEW] || cached_mvp_proj_hash != mMatHash[MM_PROJECTION]) { U32 mdv = MM_MODELVIEW; cached_mvp = mat; @@ -1506,21 +1430,21 @@ void LLRender::clearErrors() void LLRender::beginList(std::list *list) { - if (sBufferDataList) + if (mBufferDataList) { LL_ERRS() << "beginList called while another list is open." << LL_ENDL; } llassert(LLGLSLShader::sCurBoundShaderPtr == &gUIProgram); flush(); - sBufferDataList = list; + mBufferDataList = list; } void LLRender::endList() { - if (sBufferDataList) + if (mBufferDataList) { flush(); - sBufferDataList = nullptr; + mBufferDataList = nullptr; } else { @@ -1608,10 +1532,10 @@ void LLRender::flush() U32 attribute_mask = LLGLSLShader::sCurBoundShaderPtr->mAttributeMask; - if (sBufferDataList) + if (mBufferDataList) { vb = genBuffer(attribute_mask, count); - sBufferDataList->emplace_back( + mBufferDataList->emplace_back( vb, mMode, count, @@ -1671,9 +1595,9 @@ LLVertexBuffer* LLRender::bufferfromCache(U32 attribute_mask, U32 count) // To leverage this, we maintain a running hash of the vertex stream being // built up before a flush, and then check that hash against a VB // cache just before creating a vertex buffer in VRAM - std::unordered_map::iterator cache = sVBCache.find(vhash); + std::unordered_map::iterator cache = mVBCache.find(vhash); - if (cache != sVBCache.end()) + if (cache != mVBCache.end()) { LL_PROFILE_ZONE_NAMED_CATEGORY_VERTEX("vb cache hit"); // cache hit, just use the cached buffer @@ -1685,7 +1609,7 @@ LLVertexBuffer* LLRender::bufferfromCache(U32 attribute_mask, U32 count) LL_PROFILE_ZONE_NAMED_CATEGORY_VERTEX("vb cache miss"); vb = genBuffer(attribute_mask, count); - sVBCache[vhash] = { vb , std::chrono::steady_clock::now() }; + mVBCache[vhash] = { vb , std::chrono::steady_clock::now() }; static U32 miss_count = 0; miss_count++; @@ -1697,11 +1621,11 @@ LLVertexBuffer* LLRender::bufferfromCache(U32 attribute_mask, U32 count) using namespace std::chrono_literals; // every 1024 misses, clean the cache of any VBs that haven't been touched in the last second - for (std::unordered_map::iterator iter = sVBCache.begin(); iter != sVBCache.end(); ) + for (std::unordered_map::iterator iter = mVBCache.begin(); iter != mVBCache.end(); ) { if (now - iter->second.touched > 1s) { - iter = sVBCache.erase(iter); + iter = mVBCache.erase(iter); } else { @@ -2002,6 +1926,17 @@ void LLRender::diffuseColor4ub(U8 r, U8 g, U8 b, U8 a) } } +void LLRender::setLineWidth(F32 width) +{ + gGL.flush(); + + width = llclamp(width, gGLManager.mAliasedLineRange[0], gGLManager.mAliasedLineRange[1]); + if(mLineWidth != width) + { + mLineWidth = width; + glLineWidth(width); + } +} void LLRender::debugTexUnits(void) { diff --git a/indra/llrender/llrender.h b/indra/llrender/llrender.h index 0801c12fb4c..9c17cf34706 100644 --- a/indra/llrender/llrender.h +++ b/indra/llrender/llrender.h @@ -43,10 +43,11 @@ #include "llglheaders.h" #include "llmatrix4a.h" #include "glm/mat4x4.hpp" -#include #include +#include #include +#include class LLVertexBuffer; class LLCubeMap; @@ -235,8 +236,6 @@ class LLTexUnit bool mHasMipMaps; void debugTextureUnit(void); - GLint getTextureSource(eTextureBlendSrc src); - GLint getTextureSourceType(eTextureBlendSrc src, bool isAlpha = false); }; class LLLightState @@ -467,6 +466,8 @@ class LLRender LLLightState* getLight(U32 index); void setAmbientLightColor(const LLColor4& color); + void setLineWidth(F32 width); + LLTexUnit* getTexUnit(U32 index); U32 getCurrentTexUnitIndex(void) const { return mCurrTextureUnitIndex; } @@ -487,6 +488,7 @@ class LLRender public: static U32 sUICalls; static U32 sUIVerts; + static F32 sAnisotropicFilteringLevel; static bool sGLCoreProfile; static bool sNsightDebugSupport; static LLVector2 sUIGLScaleFactor; @@ -512,7 +514,8 @@ class LLRender U32 mCount; U32 mMode; U32 mCurrTextureUnitIndex; - bool mCurrColorMask[4]; + bool mCurrColorMask[4]; + F32 mLineWidth = 1.f; LLPointer mBuffer; LLStrider mVerticesp; @@ -527,8 +530,17 @@ class LLRender eBlendFactor mCurrBlendAlphaSFactor; eBlendFactor mCurrBlendAlphaDFactor; - std::vector > mUIOffset; - std::vector > mUIScale; + std::vector mUIOffset; + std::vector mUIScale; + + struct LLVBCache + { + LLPointer vb; + std::chrono::steady_clock::time_point touched; + }; + + std::unordered_map mVBCache; + std::list* mBufferDataList = nullptr; }; extern F32 gGLModelView[16]; diff --git a/indra/llrender/llrender2dutils.cpp b/indra/llrender/llrender2dutils.cpp index 5b08c29d640..e9d2212a67c 100644 --- a/indra/llrender/llrender2dutils.cpp +++ b/indra/llrender/llrender2dutils.cpp @@ -833,8 +833,7 @@ void gl_line_3d( const LLVector3& start, const LLVector3& end, const LLColor4& c { gGL.color4f(color.mV[VRED], color.mV[VGREEN], color.mV[VBLUE], color.mV[VALPHA]); - gGL.flush(); - glLineWidth(2.5f); + gGL.setLineWidth(2.5f); gGL.begin(LLRender::LINES); { @@ -843,7 +842,7 @@ void gl_line_3d( const LLVector3& start, const LLVector3& end, const LLColor4& c } gGL.end(); - LLRender2D::setLineWidth(1.f); + gGL.setLineWidth(1.f); } void gl_arc_2d(F32 center_x, F32 center_y, F32 radius, S32 steps, bool filled, F32 start_angle, F32 end_angle) @@ -1798,16 +1797,8 @@ void LLRender2D::loadIdentity() // static void LLRender2D::setLineWidth(F32 width) { - gGL.flush(); - // If outside the allowed range, glLineWidth fails with "invalid value". - // On Darwin, the range is [1, 1]. - static GLfloat range[2]{0.0}; - if (range[1] == 0) - { - glGetFloatv(GL_SMOOTH_LINE_WIDTH_RANGE, range); - } width *= lerp(LLRender::sUIGLScaleFactor.mV[VX], LLRender::sUIGLScaleFactor.mV[VY], 0.5f); - glLineWidth(llclamp(width, range[0], range[1])); + gGL.setLineWidth(width); } LLPointer LLRender2D::getUIImageByID(const LLUUID& image_id, S32 priority) diff --git a/indra/llrender/llshadermgr.cpp b/indra/llrender/llshadermgr.cpp index e9bbdeead52..1da71e6bf49 100644 --- a/indra/llrender/llshadermgr.cpp +++ b/indra/llrender/llshadermgr.cpp @@ -511,7 +511,7 @@ GLuint LLShaderMgr::loadShaderFile(const std::string& filename, S32 & shader_lev { //search from the current gpu class down to class 1 to find the most relevant shader std::stringstream fname; fname << getShaderDirPrefix(); - fname << gpu_class << "/" << filename; + fname << gpu_class << gDirUtilp->getDirDelimiter() << filename; open_file_name = fname.str(); @@ -540,7 +540,14 @@ GLuint LLShaderMgr::loadShaderFile(const std::string& filename, S32 & shader_lev if (file == NULL) { - LL_WARNS("ShaderLoading") << "GLSL Shader file not found: " << open_file_name << LL_ENDL; + if (gDirUtilp->fileExists(open_file_name)) + { + LL_WARNS("ShaderLoading") << "GLSL Shader file failed to open: " << open_file_name << LL_ENDL; + } + else + { + LL_WARNS("ShaderLoading") << "GLSL Shader file not found: " << open_file_name << LL_ENDL; + } return 0; } @@ -857,6 +864,7 @@ GLuint LLShaderMgr::loadShaderFile(const std::string& filename, S32 & shader_lev //load source if (ret) { + LL_DEBUGS("ShaderLoading") << "glCreateShader done" << LL_ENDL; glShaderSource(ret, shader_code_count, (const GLchar**)shader_code_text, NULL); error = glGetError(); @@ -871,6 +879,7 @@ GLuint LLShaderMgr::loadShaderFile(const std::string& filename, S32 & shader_lev //compile source if (ret) { + LL_DEBUGS("ShaderLoading") << "glShaderSource done" << U32(ret) << LL_ENDL; glCompileShader(ret); error = glGetError(); @@ -885,6 +894,7 @@ GLuint LLShaderMgr::loadShaderFile(const std::string& filename, S32 & shader_lev if (error == GL_NO_ERROR) { //check for errors + LL_DEBUGS("ShaderLoading") << "glCompileShader done" << U32(ret) << LL_ENDL; GLint success = GL_TRUE; glGetShaderiv(ret, GL_COMPILE_STATUS, &success); @@ -901,6 +911,7 @@ GLuint LLShaderMgr::loadShaderFile(const std::string& filename, S32 & shader_lev } else { + LL_DEBUGS("ShaderLoading") << "loadShaderFile() completed, ret: " << U32(ret) << LL_ENDL; ret = 0; } stop_glerror(); @@ -1048,7 +1059,6 @@ void LLShaderMgr::clearShaderCache() LL_INFOS("ShaderMgr") << "Removing shader cache at " << shader_cache << LL_ENDL; const std::string mask = "*"; gDirUtilp->deleteFilesInDir(shader_cache, mask); - LLFile::rmdir(shader_cache); mShaderBinaryCache.clear(); } diff --git a/indra/llrender/lltexturemanagerbridge.cpp b/indra/llrender/lltexturemanagerbridge.cpp index c243f0697ae..67838418bfc 100644 --- a/indra/llrender/lltexturemanagerbridge.cpp +++ b/indra/llrender/lltexturemanagerbridge.cpp @@ -24,6 +24,8 @@ * $/LicenseInfo$ */ +#include "linden_common.h" + #include "lltexturemanagerbridge.h" // Define a null texture manager bridge. Applications must provide their own bridge implementaton. diff --git a/indra/llrender/lluiimage.h b/indra/llrender/lluiimage.h index 7988243a89d..7dde84f295b 100644 --- a/indra/llrender/lluiimage.h +++ b/indra/llrender/lluiimage.h @@ -30,14 +30,15 @@ #include "v4color.h" #include "llpointer.h" #include "llrefcount.h" -#include "llrefcount.h" #include "llrect.h" -#include -#include #include "llinitparam.h" #include "lltexture.h" #include "llrender2dutils.h" +#include + +#include + extern const LLColor4 UI_VERTEX_COLOR; class LLUIImage : public LLRefCount @@ -119,7 +120,7 @@ namespace LLInitParam class ParamValue : public CustomParamValue { - typedef boost::add_reference::type>::type T_const_ref; + typedef std::add_lvalue_reference::type>::type T_const_ref; typedef CustomParamValue super_t; public: Optional name; diff --git a/indra/llrender/llvertexbuffer.h b/indra/llrender/llvertexbuffer.h index faaa6ba0f0e..f24d75e41d0 100644 --- a/indra/llrender/llvertexbuffer.h +++ b/indra/llrender/llvertexbuffer.h @@ -98,16 +98,8 @@ class LLVertexBuffer final : public LLRefCount U32 mEnd; }; - LLVertexBuffer(const LLVertexBuffer& rhs) - { - *this = rhs; - } - - const LLVertexBuffer& operator=(const LLVertexBuffer& rhs) - { - LL_ERRS() << "Illegal operation!" << LL_ENDL; - return *this; - } + LLVertexBuffer(const LLVertexBuffer& rhs) = delete; + const LLVertexBuffer& operator=(const LLVertexBuffer& rhs) = delete; static void initClass(LLWindow* window); static void cleanupClass(); diff --git a/indra/llui/CMakeLists.txt b/indra/llui/CMakeLists.txt index 908e94b24c4..b543a122814 100644 --- a/indra/llui/CMakeLists.txt +++ b/indra/llui/CMakeLists.txt @@ -272,6 +272,10 @@ target_link_libraries(llui llcommon ) +if (USE_PRECOMPILED_HEADERS) + target_precompile_headers(llui REUSE_FROM llprecompiled) +endif () + # Add tests if(LL_TESTS) include(LLAddBuildTest) diff --git a/indra/llui/llaccordionctrl.cpp b/indra/llui/llaccordionctrl.cpp index 2cd394476ee..ac8f7c2126b 100644 --- a/indra/llui/llaccordionctrl.cpp +++ b/indra/llui/llaccordionctrl.cpp @@ -47,6 +47,8 @@ static constexpr F32 AUTO_SCROLL_RATE_ACCEL = 120.f; static LLDefaultChildRegistry::Register t2("accordion"); +std::set LLAccordionCtrl::sPendingArrange; + LLAccordionCtrl::LLAccordionCtrl(const Params& params):LLPanel(params) , mFitParent(params.fit_parent) , mNoVisibleTabsOrigString(params.no_visible_tabs_text.initial_value().asString()) @@ -163,7 +165,11 @@ bool LLAccordionCtrl::postBuild() //--------------------------------------------------------------------------------- LLAccordionCtrl::~LLAccordionCtrl() { - mAccordionTabs.clear(); + if (mArrangePending) + { + sPendingArrange.erase(this); + } + mAccordionTabs.clear(); } //--------------------------------------------------------------------------------- @@ -184,7 +190,7 @@ void LLAccordionCtrl::reshape(S32 width, S32 height, bool called_from_parent) // necessary text paddings can be set via h_pad and v_pad mNoVisibleTabsHelpText->setRect(getLocalRect()); - arrange(); + scheduleArrange(); } //--------------------------------------------------------------------------------- @@ -325,7 +331,7 @@ void LLAccordionCtrl::addCollapsibleCtrl(LLAccordionCtrlTab* accordion_tab) mAccordionTabs.push_back(accordion_tab); accordion_tab->setDropDownStateChangedCallback( boost::bind(&LLAccordionCtrl::onCollapseCtrlCloseOpen, this, (S16)(mAccordionTabs.size() - 1)) ); - arrange(); + scheduleArrange(); } void LLAccordionCtrl::removeCollapsibleCtrl(LLAccordionCtrlTab* accordion_tab) @@ -682,8 +688,9 @@ S32 LLAccordionCtrl::notifyParent(const LLSD& info) std::string str_action = info["action"]; if (str_action == "size_changes") { - // - arrange(); + // Multiple children can request an arrange, + // but only need to do it once so schedule it for later. + scheduleArrange(); return 1; } if (str_action == "select_next") @@ -925,3 +932,25 @@ void LLAccordionCtrl::collapseAllTabs() arrange(); } } + +void LLAccordionCtrl::scheduleArrange() +{ + if (!mArrangePending) + { + mArrangePending = true; + sPendingArrange.insert(this); + } +} + +void LLAccordionCtrl::updateClass() +{ + for (LLAccordionCtrl* inst : sPendingArrange) + { + if (inst) + { + inst->mArrangePending = false; + inst->arrange(); + } + } + sPendingArrange.clear(); +} diff --git a/indra/llui/llaccordionctrl.h b/indra/llui/llaccordionctrl.h index 43a33a2b3ca..c7bb8bc9ff7 100644 --- a/indra/llui/llaccordionctrl.h +++ b/indra/llui/llaccordionctrl.h @@ -142,6 +142,9 @@ class LLAccordionCtrl: public LLPanel void setSkipScrollToChild(bool skip) { mSkipScrollToChild = skip; } + void scheduleArrange(); + static void updateClass(); + private: void initNoTabsWidget(const LLTextBox::Params& tb_params); void updateNoTabsHelpTextVisibility(); @@ -188,12 +191,15 @@ class LLAccordionCtrl: public LLPanel LLTextBox* mNoVisibleTabsHelpText = nullptr; bool mSkipScrollToChild = false; + bool mArrangePending = false; std::string mNoMatchedTabsOrigString; std::string mNoVisibleTabsOrigString; LLAccordionCtrlTab* mSelectedTab = nullptr; const LLTabComparator* mTabComparator = nullptr; + + static std::set sPendingArrange; }; diff --git a/indra/llui/llbutton.cpp b/indra/llui/llbutton.cpp index d2534b3939e..0048c44189a 100644 --- a/indra/llui/llbutton.cpp +++ b/indra/llui/llbutton.cpp @@ -190,7 +190,7 @@ LLButton::LLButton(const LLButton::Params& p) // Note: flashing should be allowed in settings.xml (boolean key "EnableButtonFlashing"). S32 flash_count = p.button_flash_count.isProvided()? p.button_flash_count : 0; F32 flash_rate = p.button_flash_rate.isProvided()? p.button_flash_rate : 0.0f; - mFlashingTimer = new LLFlashTimer ((LLFlashTimer::callback_t)NULL, flash_count, flash_rate); + mFlashingTimer = new LLFlashTimer((LLFlashTimer::callback_t) nullptr, flash_count, flash_rate); } else { diff --git a/indra/llui/llbutton.h b/indra/llui/llbutton.h index 890e7c2d1e3..f530eceb4b1 100644 --- a/indra/llui/llbutton.h +++ b/indra/llui/llbutton.h @@ -153,7 +153,7 @@ class LLButton ~LLButton(); // For backward compatability only - typedef boost::function button_callback_t; + typedef std::function button_callback_t; void addImageAttributeToXML(LLXMLNodePtr node, const std::string& imageName, const LLUUID& imageID,const std::string& xmlTagName) const; diff --git a/indra/llui/llcallbackmap.h b/indra/llui/llcallbackmap.h index 07775dc30f5..3115606d91e 100644 --- a/indra/llui/llcallbackmap.h +++ b/indra/llui/llcallbackmap.h @@ -29,13 +29,13 @@ #include #include -#include +#include class LLCallbackMap { public: // callback definition. - typedef boost::function callback_t; + typedef std::function callback_t; typedef std::map map_t; typedef map_t::iterator map_iter_t; @@ -48,8 +48,8 @@ class LLCallbackMap return (void*)panel; } - LLCallbackMap() : mCallback(NULL), mData(NULL) { } - LLCallbackMap(callback_t callback, void* data = NULL) : mCallback(callback), mData(data) { } + LLCallbackMap() : mCallback(nullptr), mData(nullptr) {} + LLCallbackMap(callback_t callback, void* data = nullptr) : mCallback(callback), mData(data) {} callback_t mCallback; void* mData; diff --git a/indra/llui/llcheckboxctrl.h b/indra/llui/llcheckboxctrl.h index 4068741978f..3507d3f34a2 100644 --- a/indra/llui/llcheckboxctrl.h +++ b/indra/llui/llcheckboxctrl.h @@ -124,6 +124,11 @@ class LLCheckBoxCtrl virtual bool isDirty() const; // Returns true if the user has modified this control. virtual void resetDirty(); // Clear dirty state + LLTextBox* getTextBox() // Provide direct access to label textbox control + { + return mLabel; + } + protected: virtual std::string _getSearchText() const { diff --git a/indra/llui/llclipboard.h b/indra/llui/llclipboard.h index 12d8233e0a1..9f9cc3e54d2 100644 --- a/indra/llui/llclipboard.h +++ b/indra/llui/llclipboard.h @@ -27,8 +27,6 @@ #ifndef LL_LLCLIPBOARD_H #define LL_LLCLIPBOARD_H -#include - #include "llstring.h" #include "lluuid.h" #include "llsingleton.h" diff --git a/indra/llui/llcombobox.cpp b/indra/llui/llcombobox.cpp index f3876ef6957..ad6ab9dc4cd 100644 --- a/indra/llui/llcombobox.cpp +++ b/indra/llui/llcombobox.cpp @@ -251,11 +251,26 @@ void LLComboBox::resetDirty() } } -bool LLComboBox::itemExists(const std::string& name) +bool LLComboBox::itemExists(const std::string& name) const { return mList->getItemByLabel(name); } +bool LLComboBox::valueExists(const std::string& value) const +{ + return mList->getItemByValue(value); +} + +LLScrollListItem* LLComboBox::findItemByValue(const std::string& value) const +{ + return mList->getItemByValue(value); +} + +std::vector LLComboBox::getAllData() const +{ + return mList->getAllData(); +} + // add item "name" to menu LLScrollListItem* LLComboBox::add(const std::string& name, EAddPosition pos, bool enabled) { @@ -1009,7 +1024,7 @@ void LLComboBox::setKeystrokeOnEsc(bool enable) void LLComboBox::onTextEntry(LLLineEditor* line_editor) { - if (mTextEntryCallback != NULL) + if (mTextEntryCallback != nullptr) { (mTextEntryCallback)(line_editor, LLSD()); } @@ -1029,7 +1044,7 @@ void LLComboBox::onTextEntry(LLLineEditor* line_editor) mList->deselectAllItems(); mLastSelectedIndex = -1; } - if (mTextChangedCallback != NULL) + if (mTextChangedCallback != nullptr) { (mTextChangedCallback)(line_editor, LLSD()); } @@ -1077,7 +1092,7 @@ void LLComboBox::onTextEntry(LLLineEditor* line_editor) // RN: presumably text entry updateSelection(); } - if (mTextChangedCallback != NULL) + if (mTextChangedCallback != nullptr) { (mTextChangedCallback)(line_editor, LLSD()); } diff --git a/indra/llui/llcombobox.h b/indra/llui/llcombobox.h index 8be3eb57e4f..52a2165f1b0 100644 --- a/indra/llui/llcombobox.h +++ b/indra/llui/llcombobox.h @@ -36,7 +36,6 @@ #include "llrect.h" #include "llscrolllistctrl.h" #include "lllineeditor.h" -#include // Classes @@ -143,7 +142,10 @@ class LLComboBox LLScrollListItem* addSeparator(EAddPosition pos = ADD_BOTTOM); bool remove( S32 index ); // remove item by index, return true if found and removed void removeall() { clearRows(); } - bool itemExists(const std::string& name); + bool itemExists(const std::string& name) const; + bool valueExists(const std::string& value) const; + LLScrollListItem* findItemByValue(const std::string& value) const; + std::vector getAllData() const; void sortByName(bool ascending = true); // Sort the entries in the combobox by name diff --git a/indra/llui/lldockablefloater.cpp b/indra/llui/lldockablefloater.cpp index 19ae03cdf9f..c20e5a806cb 100644 --- a/indra/llui/lldockablefloater.cpp +++ b/indra/llui/lldockablefloater.cpp @@ -77,7 +77,7 @@ LLDockableFloater::~LLDockableFloater() bool LLDockableFloater::postBuild() { // Remember we should force docking when the floater is opened for the first time - if (mIsDockedStateForcedCallback != NULL && mIsDockedStateForcedCallback()) + if (mIsDockedStateForcedCallback != nullptr && mIsDockedStateForcedCallback()) { mForceDocking = true; } diff --git a/indra/llui/lldockablefloater.h b/indra/llui/lldockablefloater.h index 9c516e23a43..accd9fddfcb 100644 --- a/indra/llui/lldockablefloater.h +++ b/indra/llui/lldockablefloater.h @@ -129,7 +129,7 @@ class LLDockableFloater : public LLFloater // Checks if docking should be forced. // It may be useful e.g. if floater created in mouselook mode (see EXT-5609) - boost::function mIsDockedStateForcedCallback; + std::function mIsDockedStateForcedCallback; private: std::unique_ptr mDockControl; diff --git a/indra/llui/lldockcontrol.h b/indra/llui/lldockcontrol.h index b6ac9c19ddc..1f6c3b9f570 100644 --- a/indra/llui/lldockcontrol.h +++ b/indra/llui/lldockcontrol.h @@ -49,11 +49,11 @@ class LLDockControl public: // callback for a function getting a rect valid for control's position - typedef boost::function get_allowed_rect_callback_t; + typedef std::function get_allowed_rect_callback_t; LOG_CLASS(LLDockControl); LLDockControl(LLView* dockWidget, LLFloater* dockableFloater, - const LLUIImagePtr& dockTongue, DocAt dockAt, get_allowed_rect_callback_t get_rect_callback = NULL); + const LLUIImagePtr& dockTongue, DocAt dockAt, get_allowed_rect_callback_t get_rect_callback = nullptr); virtual ~LLDockControl(); public: diff --git a/indra/llui/llemojihelper.h b/indra/llui/llemojihelper.h index 26840eef94b..0dc74b1a743 100644 --- a/indra/llui/llemojihelper.h +++ b/indra/llui/llemojihelper.h @@ -69,5 +69,5 @@ class LLEmojiHelper : public LLSingleton boost::signals2::connection mHelperCommitConn; boost::signals2::connection mHelperCloseConn; std::function mEmojiCommitCb; - bool mIsHideDisabled; + bool mIsHideDisabled = false; }; diff --git a/indra/llui/llflashtimer.cpp b/indra/llui/llflashtimer.cpp index 54f54653e2e..addc3375b34 100644 --- a/indra/llui/llflashtimer.cpp +++ b/indra/llui/llflashtimer.cpp @@ -50,7 +50,7 @@ LLFlashTimer::LLFlashTimer(callback_t cb, S32 count, F32 period) void LLFlashTimer::unset() { mUnset = true; - mCallback = NULL; + mCallback = nullptr; } bool LLFlashTimer::tick() diff --git a/indra/llui/llflashtimer.h b/indra/llui/llflashtimer.h index 4ef70faf2dd..1cd1df392ba 100644 --- a/indra/llui/llflashtimer.h +++ b/indra/llui/llflashtimer.h @@ -28,13 +28,13 @@ #define LL_FLASHTIMER_H #include "lleventtimer.h" -#include "boost/function.hpp" +#include class LLFlashTimer : public LLEventTimer { public: - typedef boost::function callback_t; + typedef std::function callback_t; /** * Constructor. @@ -43,7 +43,7 @@ class LLFlashTimer : public LLEventTimer * @param period - how frequently callback should be called * @param cb - callback to be called each tick */ - LLFlashTimer(callback_t cb = NULL, S32 count = 0, F32 period = 0.0); + LLFlashTimer(callback_t cb = nullptr, S32 count = 0, F32 period = 0.0); ~LLFlashTimer() {}; /*virtual*/ bool tick(); diff --git a/indra/llui/llflatlistview.cpp b/indra/llui/llflatlistview.cpp index dfe0a71b745..34eb1ea3fc6 100644 --- a/indra/llui/llflatlistview.cpp +++ b/indra/llui/llflatlistview.cpp @@ -537,6 +537,7 @@ bool LLFlatListView::postBuild() void LLFlatListView::rearrangeItems() { + LL_PROFILE_ZONE_SCOPED; static LLUICachedControl scrollbar_size ("UIScrollbarSize", 0); setNoItemsCommentVisible(0==size()); @@ -1132,6 +1133,7 @@ bool LLFlatListView::removeItemPair(item_pair_t* item_pair, bool rearrange) void LLFlatListView::notifyParentItemsRectChanged() { + LL_PROFILE_ZONE_SCOPED; S32 comment_height = 0; // take into account comment text height if exists @@ -1401,7 +1403,7 @@ bool LLFlatListViewEx::updateItemVisibility(LLPanel* item, const LLSD &action) return false; } -void LLFlatListViewEx::filterItems(bool re_sort, bool notify_parent) +bool LLFlatListViewEx::filterItems(bool re_sort, bool notify_parent) { std::string cur_filter = mFilterSubString; LLStringUtil::toUpper(cur_filter); @@ -1426,7 +1428,9 @@ void LLFlatListViewEx::filterItems(bool re_sort, bool notify_parent) { rearrangeItems(); notifyParentItemsRectChanged(); + return true; } + return false; } bool LLFlatListViewEx::hasMatchedItems() diff --git a/indra/llui/llflatlistview.h b/indra/llui/llflatlistview.h index 1f22360a8a8..39afa33be82 100644 --- a/indra/llui/llflatlistview.h +++ b/indra/llui/llflatlistview.h @@ -499,8 +499,9 @@ class LLFlatListViewEx : public LLFlatListView /** * Filters the list, rearranges and notifies parent about shape changes. * Derived classes may want to overload rearrangeItems() to exclude repeated separators after filtration. + * Returns true in case of changes */ - void filterItems(bool re_sort, bool notify_parent); + bool filterItems(bool re_sort, bool notify_parent); /** * Returns true if last call of filterItems() found at least one matching item diff --git a/indra/llui/llfloater.cpp b/indra/llui/llfloater.cpp index 52a5e3dbd69..f609fe8105b 100644 --- a/indra/llui/llfloater.cpp +++ b/indra/llui/llfloater.cpp @@ -248,6 +248,7 @@ LLFloater::LLFloater(const LLSD& key, const LLFloater::Params& p) mShortTitle(p.short_title), mSingleInstance(p.single_instance), mReuseInstance(p.reuse_instance.isProvided() ? p.reuse_instance : p.single_instance), // reuse single-instance floaters by default + mIsReuseInitialized(p.reuse_instance.isProvided()), mKey(key), mCanTearOff(p.can_tear_off), mCanMinimize(p.can_minimize), @@ -3351,6 +3352,7 @@ void LLFloater::initFromParams(const LLFloater::Params& p) mLegacyHeaderHeight = p.legacy_header_height; mSingleInstance = p.single_instance; mReuseInstance = p.reuse_instance.isProvided() ? p.reuse_instance : p.single_instance; + mIsReuseInitialized = p.reuse_instance.isProvided(); mDefaultRelativeX = p.rel_x; mDefaultRelativeY = p.rel_y; diff --git a/indra/llui/llfloaterreg.h b/indra/llui/llfloaterreg.h index 94a67c8d8b5..24d1476dda5 100644 --- a/indra/llui/llfloaterreg.h +++ b/indra/llui/llfloaterreg.h @@ -30,8 +30,8 @@ #include "llrect.h" #include "llsd.h" +#include #include -#include //******************************************************* // @@ -41,7 +41,7 @@ class LLFloater; class LLUICtrl; -typedef boost::function LLFloaterBuildFunc; +typedef std::function LLFloaterBuildFunc; class LLFloaterReg { diff --git a/indra/llui/llfocusmgr.cpp b/indra/llui/llfocusmgr.cpp index 0d7c98294f8..7544a444785 100644 --- a/indra/llui/llfocusmgr.cpp +++ b/indra/llui/llfocusmgr.cpp @@ -32,11 +32,11 @@ const F32 FOCUS_FADE_TIME = 0.3f; -LLFocusableElement::LLFocusableElement() -: mFocusLostCallback(NULL), - mFocusReceivedCallback(NULL), - mFocusChangedCallback(NULL), - mTopLostCallback(NULL) +LLFocusableElement::LLFocusableElement() : + mFocusLostCallback(nullptr), + mFocusReceivedCallback(nullptr), + mFocusChangedCallback(nullptr), + mTopLostCallback(nullptr) { } diff --git a/indra/llui/llfolderviewmodel.h b/indra/llui/llfolderviewmodel.h index 2865b789b9f..07e8b890b83 100644 --- a/indra/llui/llfolderviewmodel.h +++ b/indra/llui/llfolderviewmodel.h @@ -432,11 +432,11 @@ class LLFolderViewModel : public LLFolderViewModelCommon virtual SortType& getSorter() { return *mSorter; } virtual const SortType& getSorter() const { return *mSorter; } - virtual void setSorter(const SortType& sorter) { mSorter.reset(new SortType(sorter)); requestSortAll(); } + virtual void setSorter(const SortType& sorter) { mSorter = std::make_unique(sorter); requestSortAll(); } virtual FilterType& getFilter() override { return *mFilter; } virtual const FilterType& getFilter() const override { return *mFilter; } - virtual void setFilter(const FilterType& filter) { mFilter.reset(new FilterType(filter)); } + virtual void setFilter(const FilterType& filter) { mFilter = std::make_unique(filter); } // By default, we assume the content is available. If a network fetch mechanism is implemented for the model, // this method needs to be overloaded and return the relevant fetch status. diff --git a/indra/llui/llfunctorregistry.h b/indra/llui/llfunctorregistry.h index da5570d922e..953963b683a 100644 --- a/indra/llui/llfunctorregistry.h +++ b/indra/llui/llfunctorregistry.h @@ -31,8 +31,6 @@ #include #include -#include - #include "llsd.h" #include "llsingleton.h" diff --git a/indra/llui/llkeywords.cpp b/indra/llui/llkeywords.cpp index 2bea8fb4ed2..aa5aceddfac 100644 --- a/indra/llui/llkeywords.cpp +++ b/indra/llui/llkeywords.cpp @@ -28,43 +28,26 @@ #include #include +#include #include "llkeywords.h" #include "llsdserialize.h" #include "lltexteditor.h" #include "llstl.h" +#include "llcontrol.h" + +extern LLControlGroup gSavedSettings; inline bool LLKeywordToken::isHead(const llwchar* s) const { - // strncmp is much faster than string compare - bool res = true; - const llwchar* t = mToken.c_str(); - auto len = mToken.size(); - for (S32 i=0; ifirst == "llsd-lsl-syntax-version") { @@ -258,6 +264,21 @@ void LLKeywords::processTokens() } } } + + // Pre-compile all regex patterns for tokens in mRegexTokenList + for (LLKeywordToken* regex_token : mRegexTokenList) + { + std::string start_pattern(regex_token->getToken().begin(), regex_token->getToken().end()); + try + { + regex_token->setCompiledRegex(new std::regex(start_pattern)); + } + catch (const std::regex_error& e) + { + LL_WARNS() << "Regex error in start pattern: " << e.what() << " in pattern: " << start_pattern << LL_ENDL; + } + } + LL_INFOS("SyntaxLSL") << "Finished processing tokens." << LL_ENDL; } @@ -346,8 +367,11 @@ void LLKeywords::processTokensGroup(const LLSD& tokens, std::string_view group) break; case LLKeywordToken::TT_FUNCTION: tooltip = getAttribute("return") + " " + outer_itr->first + "(" + getArguments(arguments) + ");"; - tooltip.append("\nEnergy: "); - tooltip.append(getAttribute("energy").empty() ? "0.0" : getAttribute("energy")); + if (std::stod(getAttribute("energy")) >= 0) + { + tooltip.append("\nEnergy: "); + tooltip.append(getAttribute("energy").empty() ? "0.0" : getAttribute("energy")); + } if (!getAttribute("sleep").empty()) { tooltip += ", Sleep: " + getAttribute("sleep"); @@ -482,17 +506,28 @@ LLTrace::BlockTimerStatHandle FTM_SYNTAX_COLORING("Syntax Coloring"); void LLKeywords::findSegments(std::vector* seg_list, const LLWString& wtext, LLTextEditor& editor, LLStyleConstSP style) { LL_RECORD_BLOCK_TIME(FTM_SYNTAX_COLORING); - seg_list->clear(); if( wtext.empty() ) { return; } + // Clear the segment list + seg_list->clear(); + // Reserve capacity for segments based on an estimated average of 8 characters per segment. + constexpr size_t AVERAGE_SEGMENT_LENGTH = 8; + seg_list->reserve(wtext.size() / AVERAGE_SEGMENT_LENGTH); + S32 text_len = static_cast(wtext.size()) + 1; seg_list->push_back( new LLNormalTextSegment( style, 0, text_len, editor ) ); + std::string text_to_search; + text_to_search.reserve(wtext.size()); + + bool has_regex = !mRegexTokenList.empty(); + auto& delimiters = mDelimiterTokenList; + const llwchar* base = wtext.c_str(); const llwchar* cur = base; while( *cur ) @@ -560,16 +595,148 @@ void LLKeywords::findSegments(std::vector* seg_list, const LLW cur++; } + // Check if syntax highlighting is disabled + static LLCachedControl sDisableSyntaxHighlighting(gSavedSettings, "ScriptEditorDisableSyntaxHighlight", false); + if (sDisableSyntaxHighlighting) + { + if (*cur && *cur != '\n') + { + cur++; + } + continue; // skip processing any further syntax highlighting + } + while( *cur && *cur != '\n' ) { + // Check for regex matches first + bool regex_matched = false; + if (has_regex) + { + S32 seg_start = (S32)(cur - base); + + text_to_search.assign(wtext.begin() + seg_start, wtext.end()); + + for (LLKeywordToken* regex_token : mRegexTokenList) + { + std::regex* compiled_regex = regex_token->getCompiledRegex(); + + // If we have a pre-compiled regex, use it + if (compiled_regex) + { + std::string end_pattern(regex_token->getDelimiter().begin(), regex_token->getDelimiter().end()); + + try + { + std::smatch start_match; + + if (std::regex_search(text_to_search, start_match, *compiled_regex) && !start_match.empty()) + { + if (start_match.position() == 0) // Match starts at current position + { + // Calculate segment boundaries for start pattern + S32 start_match_length = static_cast(start_match.str().length()); + S32 start_seg_end = seg_start + start_match_length; + + if (end_pattern.empty()) + { + // If no end pattern is provided, treat the entire regex match as a single segment + // Move cursor past the matched segment + cur = base + start_seg_end; + + // Insert the matched segment + insertSegments(wtext, *seg_list, regex_token, text_len, seg_start, start_seg_end, style, editor); + } + else + { // TODO: better optimization for this part + + // Look for the end pattern after the start pattern + std::string remaining_text = text_to_search.substr(start_match_length); + + // Process end pattern - replace any capture group references + std::string actual_end_pattern = end_pattern; + + // Handle capture groups in the end pattern (replace \1, \2, etc. with their matched content) + for (size_t i = 1; i < start_match.size(); ++i) + { + std::string capture = start_match[i].str(); + std::string placeholder = "\\" + std::to_string(i); + + // Replace all occurrences of the placeholder with the captured content + size_t pos = 0; + while ((pos = actual_end_pattern.find(placeholder, pos)) != std::string::npos) + { + actual_end_pattern.replace(pos, placeholder.length(), capture); + pos += capture.length(); + } + } + + try + { + std::regex end_regex_pattern(actual_end_pattern); + std::smatch end_match; + + S32 seg_end = start_seg_end; + + if (std::regex_search(remaining_text, end_match, end_regex_pattern) && !end_match.empty()) + { + // Calculate position of end match relative to the original text + S32 end_match_position = static_cast(end_match.position()); + S32 end_match_length = static_cast(end_match.str().length()); + + // Calculate the total length including both patterns and text between + seg_end += end_match_position + end_match_length; + } + else + { + // End pattern not found, treat everything up to EOF as the segment + seg_end += static_cast(remaining_text.length()); + } + + // Move cursor past the entire matched segment (start + content + end) + cur = base + seg_end; + + // Insert the matched segment + insertSegments(wtext, *seg_list, regex_token, text_len, seg_start, seg_end, style, editor); + } + catch (const std::regex_error& e) + { + LL_WARNS() << "Regex error in end pattern: " << e.what() << " in pattern: " << actual_end_pattern << LL_ENDL; + // Fall back to treating the start match as the entire segment + cur = base + start_seg_end; + insertSegments(wtext, *seg_list, regex_token, text_len, seg_start, start_seg_end, style, editor); + } + } + + regex_matched = true; + break; + } + } + } + catch (const std::regex_error& e) + { + LL_WARNS() << "Error using compiled regex: " << e.what() << LL_ENDL; + } + } + else + { + // Skip tokens that aren't pre-compiled + LL_WARNS() << "Skipping regex token due to missing pre-compiled pattern: " + << wstring_to_utf8str(regex_token->getToken()) << LL_ENDL; + } + } + + if (regex_matched) + { + continue; + } + } + // Check against delimiters { S32 seg_start = 0; LLKeywordToken* cur_delimiter = NULL; - for (token_list_t::iterator iter = mDelimiterTokenList.begin(); - iter != mDelimiterTokenList.end(); ++iter) + for (auto* delimiter : delimiters) { - LLKeywordToken* delimiter = *iter; if( delimiter->isHead( cur ) ) { cur_delimiter = delimiter; @@ -586,7 +753,7 @@ void LLKeywords::findSegments(std::vector* seg_list, const LLW cur += cur_delimiter->getLengthHead(); LLKeywordToken::ETokenType type = cur_delimiter->getType(); - if( type == LLKeywordToken::TT_TWO_SIDED_DELIMITER || type == LLKeywordToken::TT_DOUBLE_QUOTATION_MARKS ) + if(type == LLKeywordToken::TT_TWO_SIDED_DELIMITER || type == LLKeywordToken::TT_DOUBLE_QUOTATION_MARKS) { while( *cur && !cur_delimiter->isTail(cur)) { @@ -627,7 +794,7 @@ void LLKeywords::findSegments(std::vector* seg_list, const LLW if( *cur ) { - cur += cur_delimiter->getLengthHead(); + cur += cur_delimiter->getLengthTail(); seg_end = seg_start + between_delimiters + cur_delimiter->getLengthHead() + cur_delimiter->getLengthTail(); } else @@ -648,12 +815,7 @@ void LLKeywords::findSegments(std::vector* seg_list, const LLW seg_end = seg_start + between_delimiters + cur_delimiter->getLengthHead(); } - insertSegments(wtext, *seg_list,cur_delimiter, text_len, seg_start, seg_end, style, editor); - /* - LLTextSegmentPtr text_segment = new LLNormalTextSegment( cur_delimiter->getColor(), seg_start, seg_end, editor ); - text_segment->setToken( cur_delimiter ); - insertSegment( seg_list, text_segment, text_len, defaultColor, editor); - */ + insertSegments(wtext, *seg_list, cur_delimiter, text_len, seg_start, seg_end, style, editor); // Note: we don't increment cur, since the end of one delimited seg may be immediately // followed by the start of another one. continue; @@ -662,34 +824,83 @@ void LLKeywords::findSegments(std::vector* seg_list, const LLW // check against words llwchar prev = cur > base ? *(cur-1) : 0; - if( !iswalnum( prev ) && (prev != '_') ) + if (!iswalnum(prev) && prev != '_' && prev != '.') { - const llwchar* p = cur; - while( iswalnum( *p ) || (*p == '_') ) + const llwchar* word_start = cur; + S32 namespace_dots = 0; + const llwchar* last_dot = nullptr; + + // Find the full extent of the word, potentially including namespace dots + while (iswalnum(*cur) || *cur == '_' || (mLuauLanguage && *cur == '.' && iswalnum(*(cur+1)))) { - p++; + if (mLuauLanguage && *cur == '.') + { + namespace_dots++; + last_dot = cur; + } + cur++; } - S32 seg_len = (S32)(p - cur); - if( seg_len > 0 ) + + S32 seg_len = (S32)(cur - word_start); + if (seg_len > 0) { - WStringMapIndex word( cur, seg_len ); - word_token_map_t::iterator map_iter = mWordTokenMap.find(word); - if( map_iter != mWordTokenMap.end() ) + S32 seg_start = (S32)(word_start - base); + S32 seg_end = seg_start + seg_len; + + // First try to match the whole token (including dots for Lua namespaces) + word_token_map_t::iterator map_iter = mWordTokenMap.find(WStringMapIndex(word_start, seg_len)); + + if (map_iter != mWordTokenMap.end()) { + // Found a match for the complete token (including any namespace) LLKeywordToken* cur_token = map_iter->second; - S32 seg_start = (S32)(cur - base); - S32 seg_end = seg_start + seg_len; + insertSegments(wtext, *seg_list, cur_token, text_len, seg_start, seg_end, style, editor); + } + else if (namespace_dots > 0 && mLuauLanguage) + { + // If using Lua and we have namespace dots but didn't match the whole token, + // check if we have a match for just the namespace prefix (e.g., "ll") + if (last_dot > word_start) + { + // Get the namespace prefix (part before the first dot) + S32 prefix_len = (S32)(last_dot - word_start); + map_iter = mWordTokenMap.find(WStringMapIndex(word_start, prefix_len)); - // LL_INFOS("SyntaxLSL") << "Seg: [" << word.c_str() << "]" << LL_ENDL; + if (map_iter != mWordTokenMap.end()) + { + // Found a match for the namespace prefix, highlight just that part + LLKeywordToken* cur_token = map_iter->second; + insertSegments(wtext, *seg_list, cur_token, text_len, seg_start, seg_start + prefix_len, style, editor); - insertSegments(wtext, *seg_list,cur_token, text_len, seg_start, seg_end, style, editor); + // Now try to match the function part (after the dot) + const llwchar* func_part = last_dot + 1; + S32 func_len = (S32)(cur - func_part); + + if (func_len > 0) + { + // Look for complete function matches + map_iter = mWordTokenMap.find(WStringMapIndex(func_part, func_len)); + + if (map_iter != mWordTokenMap.end()) + { + // Found a match for the function part + LLKeywordToken* cur_token = map_iter->second; + insertSegments(wtext, *seg_list, cur_token, text_len, seg_start, seg_end, style, editor); + } + else + { + // No token found, continue without incrementing cur + // since we already advanced it while collecting the word + } + } + } + } } - cur += seg_len; - continue; + continue; // Continue to next token regardless of match } } - if( *cur && *cur != '\n' ) + if (*cur && *cur != '\n') { cur++; } @@ -798,6 +1009,14 @@ void LLKeywords::dump() LLKeywordToken* delimiter_token = *iter; delimiter_token->dump(); } + + LL_INFOS() << "LLKeywords::sRegexTokenList" << LL_ENDL; + for (token_list_t::iterator iter = mRegexTokenList.begin(); + iter != mRegexTokenList.end(); ++iter) + { + LLKeywordToken* regex_token = *iter; + regex_token->dump(); + } } void LLKeywordToken::dump() diff --git a/indra/llui/llkeywords.h b/indra/llui/llkeywords.h index 5892238593e..f5da50a0539 100644 --- a/indra/llui/llkeywords.h +++ b/indra/llui/llkeywords.h @@ -36,6 +36,7 @@ #include #include #include +#include #include "llpointer.h" class LLTextSegment; @@ -53,6 +54,11 @@ class LLKeywordToken * - TT_ONE_SIDED_DELIMITER are for open-ended delimiters which are terminated by EOL. * - TT_TWO_SIDED_DELIMITER are for delimiters that end with a different delimiter than they open with. * - TT_DOUBLE_QUOTATION_MARKS are for delimiting areas using the same delimiter to open and close. + * - TT_REGEX_MATCH are for pattern-based matching using regular expressions. + * For TT_REGEX_MATCH: mToken contains the start pattern, mDelimiter contains the end pattern (if any). + * If mDelimiter is empty, the entire match is considered one segment. + * If mDelimiter contains capture group references (e.g. \1, \2), these will be replaced with + * the corresponding capture groups from the start pattern match. */ typedef enum e_token_type { @@ -62,6 +68,7 @@ class LLKeywordToken TT_TWO_SIDED_DELIMITER, TT_ONE_SIDED_DELIMITER, TT_DOUBLE_QUOTATION_MARKS, + TT_REGEX_MATCH, // Following constants are more specific versions of the preceding ones TT_CONSTANT, // WORD TT_CONTROL, // WORD @@ -78,10 +85,20 @@ class LLKeywordToken mToken( token ), mColor( color ), mToolTip( tool_tip ), - mDelimiter( delimiter ) // right delimiter + mDelimiter( delimiter ), // right delimiter + mCompiledRegex( nullptr ) { } + ~LLKeywordToken() + { + if (mCompiledRegex) + { + delete mCompiledRegex; + mCompiledRegex = nullptr; + } + } + S32 getLengthHead() const { return static_cast(mToken.size()); } S32 getLengthTail() const { return static_cast(mDelimiter.size()); } bool isHead(const llwchar* s) const; @@ -91,6 +108,8 @@ class LLKeywordToken ETokenType getType() const { return mType; } const LLWString& getToolTip() const { return mToolTip; } const LLWString& getDelimiter() const { return mDelimiter; } + std::regex* getCompiledRegex() const { return mCompiledRegex; } + void setCompiledRegex(std::regex* regex) { mCompiledRegex = regex; } #ifdef _DEBUG void dump(); @@ -102,6 +121,7 @@ class LLKeywordToken LLUIColor mColor; LLWString mToolTip; LLWString mDelimiter; + std::regex* mCompiledRegex; }; class LLKeywords @@ -118,7 +138,7 @@ class LLKeywords const LLWString& text, class LLTextEditor& editor, LLStyleConstSP style); - void initialize(LLSD SyntaxXML); + void initialize(LLSD SyntaxXML, bool luau_language = false); void processTokens(); // Add the token as described @@ -189,10 +209,12 @@ class LLKeywords bool mLoaded; LLSD mSyntax; + bool mLuauLanguage; word_token_map_t mWordTokenMap; typedef std::deque token_list_t; token_list_t mLineTokenList; token_list_t mDelimiterTokenList; + token_list_t mRegexTokenList; typedef std::map> element_attributes_t; typedef element_attributes_t::const_iterator attribute_iterator_t; diff --git a/indra/llui/lllazyvalue.h b/indra/llui/lllazyvalue.h index 622e69ce954..fc15ead032a 100644 --- a/indra/llui/lllazyvalue.h +++ b/indra/llui/lllazyvalue.h @@ -28,15 +28,16 @@ #ifndef LL_LAZY_VALUE_H #define LL_LAZY_VALUE_H -#include +#include +#include // Holds on to a value of type T *or* calls a functor to generate a value of type T template class LLLazyValue { public: - typedef typename boost::add_reference::type>::type T_const_ref; - typedef typename boost::function function_type; + typedef typename std::add_lvalue_reference::type>::type T_const_ref; + typedef typename std::function function_type; public: LLLazyValue(const function_type& value) diff --git a/indra/llui/lllineeditor.h b/indra/llui/lllineeditor.h index 7533f76f1d4..3f762822eeb 100644 --- a/indra/llui/lllineeditor.h +++ b/indra/llui/lllineeditor.h @@ -60,7 +60,7 @@ class LLLineEditor { public: - typedef boost::function keystroke_callback_t; + typedef std::function keystroke_callback_t; struct MaxLength : public LLInitParam::ChoiceBlock { @@ -259,7 +259,7 @@ class LLLineEditor void setSelectAllonCommit(bool b) { mSelectAllonCommit = b; } void onKeystroke(); - typedef boost::function callback_t; + typedef std::function callback_t; void setKeystrokeCallback(callback_t callback, void* user_data); void setMaxTextLength(S32 max_text_length); diff --git a/indra/llui/llmenugl.h b/indra/llui/llmenugl.h index ff9456acc6b..eacf2c59d40 100644 --- a/indra/llui/llmenugl.h +++ b/indra/llui/llmenugl.h @@ -37,7 +37,8 @@ #include "llfloater.h" #include "lluistring.h" #include "llview.h" -#include + +#include extern S32 MENU_BAR_HEIGHT; extern S32 MENU_BAR_WIDTH; diff --git a/indra/llui/llnotifications.cpp b/indra/llui/llnotifications.cpp index a05feab1d95..0ffe6cff5ec 100644 --- a/indra/llui/llnotifications.cpp +++ b/indra/llui/llnotifications.cpp @@ -457,7 +457,7 @@ LLNotificationTemplate::LLNotificationTemplate(const LLNotificationTemplate::Par mTags.push_back(tag.value); } - mForm = LLNotificationFormPtr(new LLNotificationForm(p.name, p.form_ref.form)); + mForm = std::make_shared(p.name, p.form_ref.form); } LLNotificationVisibilityRule::LLNotificationVisibilityRule(const LLNotificationVisibilityRule::Rule &p) @@ -875,7 +875,7 @@ void LLNotification::init(const std::string& template_name, const LLSD& form_ele // TODO: something like this so that a missing alert is sensible: //mSubstitutions["_ARGS"] = get_all_arguments_as_text(mSubstitutions); - mForm = LLNotificationFormPtr(new LLNotificationForm(*mTemplatep->mForm)); + mForm = std::make_shared(*mTemplatep->mForm); mForm->append(form_elements); // apply substitution to form labels @@ -1249,7 +1249,7 @@ LLNotifications::LLNotifications() : LLNotificationChannelBase(LLNotificationFilters::includeEverything), mIgnoreAllNotifications(false) { - mListener.reset(new LLNotificationsListener(*this)); + mListener = std::make_unique(*this); LLUICtrl::CommitCallbackRegistry::currentRegistrar().add("Notification.Show", boost::bind(&LLNotifications::addFromCallback, this, _2)); // touch the instance tracker for notification channels, so that it will still be around in our destructor @@ -1487,7 +1487,7 @@ bool LLNotifications::templateExists(std::string_view name) void LLNotifications::forceResponse(const LLNotification::Params& params, S32 option) { - LLNotificationPtr temp_notify(new LLNotification(params)); + LLNotificationPtr temp_notify = std::make_shared(params); if (!temp_notify->getForm()) { @@ -1653,7 +1653,7 @@ bool LLNotifications::loadTemplates() replaceFormText(notification.form_ref.form, "$ignoretext", notification.form_ref.form_template.ignore_text); } } - mTemplates[notification.name] = LLNotificationTemplatePtr(new LLNotificationTemplate(notification)); + mTemplates[notification.name] = std::make_shared(notification); } LL_INFOS("Notifications") << "...done" << LL_ENDL; @@ -1683,7 +1683,7 @@ bool LLNotifications::loadVisibilityRules() for (const LLNotificationVisibilityRule::Rule& rule : params.rules) { - mVisibilityRules.push_back(LLNotificationVisibilityRulePtr(new LLNotificationVisibilityRule(rule))); + mVisibilityRules.push_back(std::make_shared(rule)); } return true; @@ -1726,7 +1726,7 @@ LLNotificationPtr LLNotifications::add(const std::string& name, const LLSD& subs // generalized add function that takes a parameter block object for more complex instantiations LLNotificationPtr LLNotifications::add(const LLNotification::Params& p) { - LLNotificationPtr pNotif(new LLNotification(p)); + LLNotificationPtr pNotif = std::make_shared(p); add(pNotif); return pNotif; } @@ -1834,7 +1834,7 @@ void LLNotifications::update(const LLNotificationPtr pNotif) LLNotificationPtr LLNotifications::find(LLUUID uuid) { - LLNotificationPtr target = LLNotificationPtr(new LLNotification(LLNotification::Params().id(uuid))); + LLNotificationPtr target = std::make_shared(LLNotification::Params().id(uuid)); LLNotificationSet::iterator it=mItems.find(target); if (it == mItems.end()) { diff --git a/indra/llui/llnotifications.h b/indra/llui/llnotifications.h index 3c8e1e85fad..d56c459560a 100644 --- a/indra/llui/llnotifications.h +++ b/indra/llui/llnotifications.h @@ -75,6 +75,7 @@ * */ +#include #include #include #include @@ -83,8 +84,6 @@ #include #include -#include -#include #include #include #include @@ -129,7 +128,7 @@ class LLNotificationResponderInterface virtual void fromLLSD(const LLSD& params) = 0; }; -typedef boost::function LLNotificationResponder; +typedef std::function LLNotificationResponder; typedef std::shared_ptr LLNotificationResponderPtr; @@ -303,7 +302,6 @@ typedef std::shared_ptr LLNotificationVisibilityRu * shared pointer. */ class LLNotification : - boost::noncopyable, public std::enable_shared_from_this { LOG_CLASS(LLNotification); @@ -429,6 +427,10 @@ friend class LLNotifications; public: LLNotification(const LLSDParamAdapter& p); + // Non-copyable + LLNotification(const LLNotification&) = delete; + LLNotification& operator=(const LLNotification&) = delete; + void setResponseFunctor(std::string const &responseFunctorName); void setResponseFunctor(const LLNotificationFunctorRegistry::ResponseFunctor& cb); @@ -666,8 +668,8 @@ namespace LLNotificationFilters template struct filterBy { - typedef boost::function field_t; - typedef typename boost::remove_reference::type value_t; + typedef std::function field_t; + typedef typename std::remove_reference::type value_t; filterBy(field_t field, value_t value, EComparison comparison = EQUAL) : mField(field), @@ -712,7 +714,7 @@ namespace LLNotificationComparators }; }; -typedef boost::function LLNotificationFilter; +typedef std::function LLNotificationFilter; typedef std::set LLNotificationSet; typedef std::multimap LLNotificationMap; @@ -817,10 +819,9 @@ typedef boost::intrusive_ptr LLNotificationChannelPtr; // manages a list of notifications // Note that if this is ever copied around, we might find ourselves with multiple copies // of a queue with notifications being added to different nonequivalent copies. So we -// make it inherit from boost::noncopyable, and then create a map of LLPointer to manage it. +// delete the copy operator and constructor, and then create a map of LLPointer to manage it. // class LLNotificationChannel : - boost::noncopyable, public LLNotificationChannelBase, public LLInstanceTracker { @@ -843,6 +844,10 @@ class LLNotificationChannel : virtual ~LLNotificationChannel(); typedef LLNotificationSet::iterator Iterator; + // Non-copyable + LLNotificationChannel(const LLNotificationChannel&) = delete; + LLNotificationChannel& operator=(const LLNotificationChannel&) = delete; + std::string getName() const { return mName; } typedef std::vector::const_iterator parents_iter; boost::iterator_range getParents() const @@ -854,7 +859,7 @@ class LLNotificationChannel : S32 size() const; size_t size(); - typedef boost::function NotificationProcess; + typedef std::function NotificationProcess; void forEachNotification(NotificationProcess process); std::string summarize(); diff --git a/indra/llui/llnotificationslistener.cpp b/indra/llui/llnotificationslistener.cpp index 9c1fc27c515..d07d42bdbae 100644 --- a/indra/llui/llnotificationslistener.cpp +++ b/indra/llui/llnotificationslistener.cpp @@ -266,7 +266,7 @@ void LLNotificationsListener::forward(const LLSD& params) entry(mForwarders.insert(ForwarderMap::value_type(channel, ForwarderMap::mapped_type())).first); if (! entry->second) { - entry->second.reset(new Forwarder(mNotifications, channel)); + entry->second = std::make_shared(mNotifications, channel); } // Now, whether this Forwarder is brand-new or not, update it with the new // request info. diff --git a/indra/llui/llnotificationsutil.cpp b/indra/llui/llnotificationsutil.cpp index c1cad431c5e..6b570d043f1 100644 --- a/indra/llui/llnotificationsutil.cpp +++ b/indra/llui/llnotificationsutil.cpp @@ -71,7 +71,7 @@ LLNotificationPtr LLNotificationsUtil::add(const std::string& name, LLNotificationPtr LLNotificationsUtil::add(const std::string& name, const LLSD& substitutions, const LLSD& payload, - boost::function functor) + std::function functor) { LLNotification::Params::Functor functor_p; functor_p.function = functor; diff --git a/indra/llui/llnotificationsutil.h b/indra/llui/llnotificationsutil.h index f21d93a50ef..73e64e47ba2 100644 --- a/indra/llui/llnotificationsutil.h +++ b/indra/llui/llnotificationsutil.h @@ -32,7 +32,7 @@ #include "llnotificationptr.h" #include "lluuid.h" -#include +#include class LLSD; @@ -55,7 +55,7 @@ namespace LLNotificationsUtil LLNotificationPtr add(const std::string& name, const LLSD& substitutions, const LLSD& payload, - boost::function functor); + std::function functor); S32 getSelectedOption(const LLSD& notification, const LLSD& response); diff --git a/indra/llui/llpanel.cpp b/indra/llui/llpanel.cpp index db314cae0f5..2100b23783b 100644 --- a/indra/llui/llpanel.cpp +++ b/indra/llui/llpanel.cpp @@ -662,12 +662,12 @@ bool LLPanel::childHasFocus(std::string_view id) // Prefer getChild("foo")->setCommitCallback(boost:bind(...)), // which takes a generic slot. Or use mCommitCallbackRegistrar.add() with // a named callback and reference it in XML. -void LLPanel::childSetCommitCallback(std::string_view id, boost::function cb, void* data) +void LLPanel::childSetCommitCallback(std::string_view id, std::function cb, void* data) { LLUICtrl* child = findChild(id); if (child) { - child->setCommitCallback(boost::bind(cb, child, data)); + child->setCommitCallback(std::bind(cb, child, data)); } } @@ -759,12 +759,12 @@ void LLPanel::childSetAction(std::string_view id, const commit_signal_t::slot_ty } } -void LLPanel::childSetAction(std::string_view id, boost::function function, void* value) +void LLPanel::childSetAction(std::string_view id, std::function function, void* value) { LLButton* button = findChild(id); if (button) { - button->setClickedCallback(boost::bind(function, value)); + button->setClickedCallback(std::bind(function, value)); } } diff --git a/indra/llui/llpanel.h b/indra/llui/llpanel.h index f085c123c1d..fe861dc719c 100644 --- a/indra/llui/llpanel.h +++ b/indra/llui/llpanel.h @@ -191,7 +191,7 @@ class LLPanel : public LLUICtrl, public LLBadgeHolder // Prefer getChild("foo")->setCommitCallback(boost:bind(...)), // which takes a generic slot. Or use mCommitCallbackRegistrar.add() with // a named callback and reference it in XML. - void childSetCommitCallback(std::string_view id, boost::function cb, void* data); + void childSetCommitCallback(std::string_view id, std::function cb, void* data); void childSetColor(std::string_view id, const LLUIColor& color); LLCtrlSelectionInterface* childGetSelectionInterface(std::string_view id) const; @@ -208,7 +208,7 @@ class LLPanel : public LLUICtrl, public LLBadgeHolder bool childSetLabelArg(std::string_view id, const std::string& key, const LLStringExplicit& text); // LLButton - void childSetAction(std::string_view id, boost::function function, void* value); + void childSetAction(std::string_view id, std::function function, void* value); void childSetAction(std::string_view id, const commit_signal_t::slot_type& function); static LLView* fromXML(LLXMLNodePtr node, LLView *parent, LLXMLNodePtr output_node = NULL); @@ -262,7 +262,7 @@ extern template class LLPanel* LLView::getChild( std::string_view name, bool recurse) const; #endif -typedef boost::function LLPanelClassCreatorFunc; +typedef std::function LLPanelClassCreatorFunc; // local static instance for registering a particular panel class diff --git a/indra/llui/llresizebar.h b/indra/llui/llresizebar.h index 68bf0fd95e0..d95536c3607 100644 --- a/indra/llui/llresizebar.h +++ b/indra/llui/llresizebar.h @@ -62,7 +62,7 @@ class LLResizeBar : public LLView void setEnableSnapping(bool enable) { mSnappingEnabled = enable; } void setAllowDoubleClickSnapping(bool allow) { mAllowDoubleClickSnapping = allow; } bool canResize() const { return getEnabled() && mMaxSize > mMinSize; } - void setResizeListener(boost::function listener) {mResizeListener = listener;} + void setResizeListener(std::function listener) { mResizeListener = listener; } void setImagePanel(LLPanel * panelp); LLPanel * getImagePanel() const; @@ -78,7 +78,7 @@ class LLResizeBar : public LLView bool mSnappingEnabled, mAllowDoubleClickSnapping; LLView* mResizingView; - boost::function mResizeListener; + std::function mResizeListener; LLPointer mDragHandleImage; LLPanel * mImagePanel; }; diff --git a/indra/llui/llscrollbar.h b/indra/llui/llscrollbar.h index 9607355a9dc..c49d2b534a4 100644 --- a/indra/llui/llscrollbar.h +++ b/indra/llui/llscrollbar.h @@ -40,7 +40,7 @@ class LLScrollbar { public: - typedef boost::function callback_t; + typedef std::function callback_t; struct Params : public LLInitParam::Block { diff --git a/indra/llui/llscrolllistcell.cpp b/indra/llui/llscrolllistcell.cpp index a3108d77e88..bdf88768c3c 100644 --- a/indra/llui/llscrolllistcell.cpp +++ b/indra/llui/llscrolllistcell.cpp @@ -98,6 +98,7 @@ const LLSD LLScrollListCell::getAltValue() const LLScrollListIcon::LLScrollListIcon(const LLScrollListCell::Params& p) : LLScrollListCell(p), mIcon(LLUI::getUIImage(p.value().asString())), + mIconSize(0), mColor(p.color), mAlignment(p.font_halign) {} @@ -140,20 +141,32 @@ void LLScrollListIcon::setValue(const LLSD& value) } } - void LLScrollListIcon::setColor(const LLColor4& color) { mColor = color; } +void LLScrollListIcon::setIconSize(S32 size) +{ + mIconSize = size; +} + S32 LLScrollListIcon::getWidth() const { // if no specified fix width, use width of icon - if (LLScrollListCell::getWidth() == 0 && mIcon.notNull()) + if (LLScrollListCell::getWidth() != 0) + { + return LLScrollListCell::getWidth(); + } + if (mIconSize != 0) + { + return mIconSize; + } + if (mIcon.notNull()) { return mIcon->getWidth(); } - return LLScrollListCell::getWidth(); + return 0; } @@ -161,16 +174,23 @@ void LLScrollListIcon::draw(const LLColor4& color, const LLColor4& highlight_col { if (mIcon) { + S32 draw_width = mIcon->getWidth(); + S32 draw_height = mIcon->getHeight(); + if (mIconSize != 0) + { + draw_width = mIconSize; + draw_height = mIconSize; + } // else will draw full icon even if cell is smaller switch(mAlignment) { case LLFontGL::LEFT: - mIcon->draw(0, 0, mColor); + mIcon->draw(0, 0, draw_width, draw_height, mColor); break; case LLFontGL::RIGHT: - mIcon->draw(getWidth() - mIcon->getWidth(), 0, mColor); + mIcon->draw(getWidth() - draw_width, 0, draw_width, draw_height, mColor); break; case LLFontGL::HCENTER: - mIcon->draw((getWidth() - mIcon->getWidth()) / 2, 0, mColor); + mIcon->draw((getWidth() - draw_width) / 2, 0, draw_width, draw_height, mColor); break; default: break; diff --git a/indra/llui/llscrolllistcell.h b/indra/llui/llscrolllistcell.h index 7dded3c0b76..f0a0f216b48 100644 --- a/indra/llui/llscrolllistcell.h +++ b/indra/llui/llscrolllistcell.h @@ -197,11 +197,13 @@ class LLScrollListIcon : public LLScrollListCell /*virtual*/ const LLSD getValue() const; /*virtual*/ void setColor(const LLColor4&); /*virtual*/ void setValue(const LLSD& value); + void setIconSize(S32 size); private: LLPointer mIcon; LLColor4 mColor; LLFontGL::HAlign mAlignment; + S32 mIconSize; }; diff --git a/indra/llui/llscrolllistctrl.cpp b/indra/llui/llscrolllistctrl.cpp index ff77b4d4820..1829479acee 100644 --- a/indra/llui/llscrolllistctrl.cpp +++ b/indra/llui/llscrolllistctrl.cpp @@ -190,19 +190,19 @@ LLScrollListCtrl::LLScrollListCtrl(const LLScrollListCtrl::Params& p) mColumnsDirty(false), mMaxItemCount(INT_MAX), mBorderThickness( 2 ), - mOnDoubleClickCallback( NULL ), - mOnMaximumSelectCallback( NULL ), - mOnSortChangedCallback( NULL ), + mOnDoubleClickCallback(nullptr), + mOnMaximumSelectCallback(nullptr), + mOnSortChangedCallback(nullptr), mHighlightedItem(-1), - mBorder(NULL), - mSortCallback(NULL), + mBorder(nullptr), + mSortCallback(nullptr), mNumDynamicWidthColumns(0), mTotalStaticColumnWidth(0), mTotalColumnPadding(0), mSorted(false), mDirty(false), mOriginalSelection(-1), - mLastSelected(NULL), + mLastSelected(nullptr), mHeadingHeight(p.heading_height), mAllowMultipleSelection(p.multi_select), mDisplayColumnHeaders(p.draw_heading), @@ -222,7 +222,7 @@ LLScrollListCtrl::LLScrollListCtrl(const LLScrollListCtrl::Params& p) mRowPadding(p.row_padding), mAlternateSort(false), mContextMenuType(MENU_NONE), - mIsFriendSignal(NULL) + mIsFriendSignal(nullptr) { mItemListRect.setOriginAndSize( mBorderThickness, @@ -1281,6 +1281,19 @@ LLScrollListItem* LLScrollListCtrl::getItemByLabel(const std::string& label, boo return NULL; } +LLScrollListItem* LLScrollListCtrl::getItemByValue(const std::string& value) +{ + for (LLScrollListItem* item : mItemList) + { + if (item->getValue().asString() == value) + { + return item; + } + } + + return NULL; +} + LLScrollListItem* LLScrollListCtrl::getItemByIndex(S32 index) { if (index >= 0 && index < (S32)mItemList.size()) diff --git a/indra/llui/llscrolllistctrl.h b/indra/llui/llscrolllistctrl.h index 1f041003069..b8d63972a51 100644 --- a/indra/llui/llscrolllistctrl.h +++ b/indra/llui/llscrolllistctrl.h @@ -77,7 +77,7 @@ class LLScrollListCtrl : public LLUICtrl, public LLEditMenuHandler, }; // *TODO: Add callbacks to Params - typedef boost::function callback_t; + typedef std::function callback_t; template struct maximum { @@ -241,7 +241,7 @@ class LLScrollListCtrl : public LLUICtrl, public LLEditMenuHandler, void setMaximumSelectCallback( callback_t cb) { mOnMaximumSelectCallback = cb; } void setSortChangedCallback( callback_t cb) { mOnSortChangedCallback = cb; } // Convenience function; *TODO: replace with setter above + boost::bind() in calling code - void setDoubleClickCallback( boost::function cb, void* userdata) { mOnDoubleClickCallback = boost::bind(cb, userdata); } + void setDoubleClickCallback( std::function cb, void* userdata) { mOnDoubleClickCallback = std::bind(cb, userdata); } void swapWithNext(S32 index); void swapWithPrevious(S32 index); @@ -262,7 +262,8 @@ class LLScrollListCtrl : public LLUICtrl, public LLEditMenuHandler, bool selectItemByLabel(const std::string& item, bool case_sensitive = true, S32 column = 0); // false if item not found bool selectItemByPrefix(const std::string& target, bool case_sensitive = true, S32 column = -1); bool selectItemByPrefix(const LLWString& target, bool case_sensitive = true, S32 column = -1); - LLScrollListItem* getItemByLabel(const std::string& item, bool case_sensitive = true, S32 column = 0); + LLScrollListItem* getItemByLabel(const std::string& label, bool case_sensitive = true, S32 column = 0); + LLScrollListItem* getItemByValue(const std::string& value); LLScrollListItem* getItemByIndex(S32 index); std::string getSelectedItemLabel(S32 column = 0) const; LLSD getSelectedValue(); diff --git a/indra/llui/llsearcheditor.cpp b/indra/llui/llsearcheditor.cpp index a0c1e9d0c01..244faf8fe9d 100644 --- a/indra/llui/llsearcheditor.cpp +++ b/indra/llui/llsearcheditor.cpp @@ -106,12 +106,12 @@ LLSearchEditor::LLSearchEditor(const LLSearchEditor::Params& p) LLSearchEditor::~LLSearchEditor() { - mKeystrokeCallback = NULL; - mTextChangedCallback = NULL; + mKeystrokeCallback = nullptr; + mTextChangedCallback = nullptr; setCommitOnFocusLost(false); - mSearchButton = NULL; - mClearButton = NULL; + mSearchButton = nullptr; + mClearButton = nullptr; mSearchEditor->deleteAllChildren(); deleteAllChildren(); } diff --git a/indra/llui/lltextbase.cpp b/indra/llui/lltextbase.cpp index 44151a43554..2079ff17fc2 100644 --- a/indra/llui/lltextbase.cpp +++ b/indra/llui/lltextbase.cpp @@ -3477,7 +3477,6 @@ S32 LLTextSegment::getNumChars(S32 num_pixels, S32 segment_offset, S32 line_offs void LLTextSegment::updateLayout(const LLTextBase& editor) {} F32 LLTextSegment::draw(S32 start, S32 end, S32 selection_start, S32 selection_end, const LLRectf& draw_rect) { return draw_rect.mLeft; } bool LLTextSegment::canEdit() const { return false; } -bool LLTextSegment::getPermitsEmoji() const { return true; } void LLTextSegment::unlinkFromDocument(LLTextBase*) {} void LLTextSegment::linkToDocument(LLTextBase*) {} const LLUIColor& LLTextSegment::getColor() const { static const LLUIColor white = LLUIColorTable::instance().getColor("White", LLColor4::white); return white; } @@ -3521,6 +3520,11 @@ LLNormalTextSegment::LLNormalTextSegment( LLStyleConstSP style, S32 start, S32 e { mFontHeight = mStyle->getFont()->getLineHeight(); mCanEdit = !mStyle->getDrawHighlightBg(); + if (!mCanEdit) + { + // Emoji shouldn't split the segment with the mention. + mPermitsEmoji = false; + } LLUIImagePtr image = mStyle->getImage(); if (image.notNull()) @@ -4041,6 +4045,7 @@ LLInlineViewSegment::LLInlineViewSegment(const Params& p, S32 start, S32 end) mTopPad(p.top_pad), mBottomPad(p.bottom_pad) { + mPermitsEmoji = false; } LLInlineViewSegment::~LLInlineViewSegment() diff --git a/indra/llui/lltextbase.h b/indra/llui/lltextbase.h index 50767a35b3a..3ab5e905e3a 100644 --- a/indra/llui/lltextbase.h +++ b/indra/llui/lltextbase.h @@ -61,13 +61,15 @@ class LLTextSegment public: LLTextSegment(S32 start, S32 end) : mStart(start), - mEnd(end) + mEnd(end), + mPermitsEmoji(true) {} virtual ~LLTextSegment(); virtual LLTextSegmentPtr clone(LLTextBase& terget) const { return new LLTextSegment(mStart, mEnd); } static LLStyleSP cloneStyle(LLTextBase& target, const LLStyle* source); bool getDimensions(S32 first_char, S32 num_chars, S32& width, S32& height) const; + bool getPermitsEmoji() const { return mPermitsEmoji; }; virtual bool getDimensionsF32(S32 first_char, S32 num_chars, F32& width, S32& height) const; virtual S32 getOffset(S32 segment_local_x_coord, S32 start_offset, S32 num_chars, bool round) const; @@ -87,7 +89,6 @@ class LLTextSegment virtual void updateLayout(const class LLTextBase& editor); virtual F32 draw(S32 start, S32 end, S32 selection_start, S32 selection_end, const LLRectf& draw_rect); virtual bool canEdit() const; - virtual bool getPermitsEmoji() const; virtual void unlinkFromDocument(class LLTextBase* editor); virtual void linkToDocument(class LLTextBase* editor); @@ -126,6 +127,8 @@ class LLTextSegment protected: S32 mStart; S32 mEnd; + + bool mPermitsEmoji; }; class LLNormalTextSegment : public LLTextSegment diff --git a/indra/llui/lltextbox.cpp b/indra/llui/lltextbox.cpp index 9f945d37357..d2a21998a6c 100644 --- a/indra/llui/lltextbox.cpp +++ b/indra/llui/lltextbox.cpp @@ -43,7 +43,7 @@ template class LLTextBox* LLView::getChild( LLTextBox::LLTextBox(const LLTextBox::Params& p) : LLTextBase(p), - mClickedCallback(NULL), + mClickedCallback(nullptr), mShowCursorHand(true) { mSkipTripleClick = true; @@ -135,9 +135,9 @@ void LLTextBox::setText(const LLStringExplicit& text , const LLStyle::Params& in LLTextBase::setText(mText.getString(), input_params ); } -void LLTextBox::setClickedCallback( boost::function cb, void* userdata /*= NULL */ ) +void LLTextBox::setClickedCallback(std::function cb, void* userdata /*= nullptr */) { - mClickedCallback = boost::bind(cb, userdata); + mClickedCallback = std::bind(cb, userdata); } S32 LLTextBox::getTextPixelWidth() diff --git a/indra/llui/lltextbox.h b/indra/llui/lltextbox.h index 507d8f3ee68..8716917ced8 100644 --- a/indra/llui/lltextbox.h +++ b/indra/llui/lltextbox.h @@ -36,7 +36,7 @@ class LLTextBox : public: // *TODO: Add callback to Params - typedef boost::function callback_t; + typedef std::function callback_t; struct Params : public LLInitParam::Block {}; @@ -58,7 +58,7 @@ class LLTextBox : void setRightAlign() { mHAlign = LLFontGL::RIGHT; } void setHAlign(LLFontGL::HAlign align) { mHAlign = align; } - void setClickedCallback(boost::function cb, void* userdata = NULL); + void setClickedCallback(std::function cb, void* userdata = nullptr); void reshapeToFitText(bool called_from_parent = false); diff --git a/indra/llui/lltexteditor.cpp b/indra/llui/lltexteditor.cpp index 58b785fcddc..fcdf3782ae7 100644 --- a/indra/llui/lltexteditor.cpp +++ b/indra/llui/lltexteditor.cpp @@ -1242,7 +1242,7 @@ void LLTextEditor::addChar(llwchar wc) tryToShowEmojiHelper(); tryToShowMentionHelper(); - if (!mReadOnly && mAutoreplaceCallback != NULL) + if (!mReadOnly && mAutoreplaceCallback != nullptr) { // autoreplace the text, if necessary S32 replacement_start; diff --git a/indra/llui/lltexteditor.h b/indra/llui/lltexteditor.h index cdfcbcdd636..d9742db34d6 100644 --- a/indra/llui/lltexteditor.h +++ b/indra/llui/lltexteditor.h @@ -164,7 +164,7 @@ class LLTextEditor : bool allowsEmbeddedItems() const { return mAllowEmbeddedItems; } // Autoreplace (formerly part of LLLineEditor) - typedef boost::function autoreplace_callback_t; + typedef std::function autoreplace_callback_t; autoreplace_callback_t mAutoreplaceCallback; void setAutoreplaceCallback(autoreplace_callback_t cb) { mAutoreplaceCallback = cb; } diff --git a/indra/llui/lltextutil.cpp b/indra/llui/lltextutil.cpp index 8ffce1b8b44..1454de34c76 100644 --- a/indra/llui/lltextutil.cpp +++ b/indra/llui/lltextutil.cpp @@ -30,7 +30,7 @@ #include "lltextbox.h" #include "llurlmatch.h" -boost::function LLTextUtil::TextHelpers::iconCallbackCreationFunction = 0; +std::function LLTextUtil::TextHelpers::iconCallbackCreationFunction = nullptr; void LLTextUtil::textboxSetHighlightedVal(LLTextBox *txtbox, const LLStyle::Params& normal_style, const std::string& text, const std::string& hl) { diff --git a/indra/llui/lltextutil.h b/indra/llui/lltextutil.h index f3838e59fac..6328ff133f0 100644 --- a/indra/llui/lltextutil.h +++ b/indra/llui/lltextutil.h @@ -74,7 +74,7 @@ namespace LLTextUtil //we need this special callback since we need to create LLAvataIconCtrls while parsing //avatar/group url but can't create LLAvataIconCtrl from LLUI public: - static boost::function iconCallbackCreationFunction; + static std::function iconCallbackCreationFunction; }; diff --git a/indra/llui/lltextvalidate.h b/indra/llui/lltextvalidate.h index a4ff144d825..096c28b4481 100644 --- a/indra/llui/lltextvalidate.h +++ b/indra/llui/lltextvalidate.h @@ -30,7 +30,6 @@ #include "llstring.h" #include "llinitparam.h" -#include namespace LLTextValidate { diff --git a/indra/llui/lltoolbar.cpp b/indra/llui/lltoolbar.cpp index 56ab6e9bae1..785dc85448a 100644 --- a/indra/llui/lltoolbar.cpp +++ b/indra/llui/lltoolbar.cpp @@ -99,8 +99,8 @@ LLToolBar::LLToolBar(const LLToolBar::Params& p) mWrap(p.wrap), mNeedsLayout(false), mModified(false), - mButtonPanel(NULL), - mCenteringStack(NULL), + mButtonPanel(nullptr), + mCenteringStack(nullptr), mPadLeft(p.pad_left), mPadRight(p.pad_right), mPadTop(p.pad_top), @@ -108,17 +108,17 @@ LLToolBar::LLToolBar(const LLToolBar::Params& p) mPadBetween(p.pad_between), mMinGirth(p.min_girth), mPopupMenuHandle(), - mRightMouseTargetButton(NULL), - mStartDragItemCallback(NULL), - mHandleDragItemCallback(NULL), - mHandleDropCallback(NULL), - mButtonAddSignal(NULL), - mButtonEnterSignal(NULL), - mButtonLeaveSignal(NULL), - mButtonRemoveSignal(NULL), + mRightMouseTargetButton(nullptr), + mStartDragItemCallback(nullptr), + mHandleDragItemCallback(nullptr), + mHandleDropCallback(nullptr), + mButtonAddSignal(nullptr), + mButtonEnterSignal(nullptr), + mButtonLeaveSignal(nullptr), + mButtonRemoveSignal(nullptr), mDragAndDropTarget(false), - mCaretIcon(NULL), - mCenterPanel(NULL) + mCaretIcon(nullptr), + mCenterPanel(nullptr) { mButtonParams[LLToolBarEnums::BTNTYPE_ICONS_WITH_TEXT] = p.button_icon_and_text; mButtonParams[LLToolBarEnums::BTNTYPE_ICONS_ONLY] = p.button_icon; @@ -1097,12 +1097,12 @@ LLToolBarButton::LLToolBarButton(const Params& p) mWidthRange(p.button_width), mDesiredHeight(p.desired_height), mId(""), - mIsEnabledSignal(NULL), - mIsRunningSignal(NULL), - mIsStartingSignal(NULL), + mIsEnabledSignal(nullptr), + mIsRunningSignal(nullptr), + mIsStartingSignal(nullptr), mIsDragged(false), - mStartDragItemCallback(NULL), - mHandleDragItemCallback(NULL), + mStartDragItemCallback(nullptr), + mHandleDragItemCallback(nullptr), mOriginalImageSelected(p.image_selected), mOriginalImageUnselected(p.image_unselected), mOriginalImagePressed(p.image_pressed), @@ -1256,7 +1256,7 @@ void LLToolBar::LLCenterLayoutPanel::handleReshape(const LLRect& rect, bool by_u { LLLayoutPanel::handleReshape(rect, by_user); - if (!mReshapeCallback.empty()) + if (mReshapeCallback != nullptr) { LLRect r; localRectToOtherView(mButtonPanel->getRect(), &r, gFloaterView); diff --git a/indra/llui/lltoolbar.h b/indra/llui/lltoolbar.h index a3f044c256e..abf44f259a4 100644 --- a/indra/llui/lltoolbar.h +++ b/indra/llui/lltoolbar.h @@ -39,9 +39,9 @@ class LLToolBar; class LLToolBarButton; class LLIconCtrl; -typedef boost::function tool_startdrag_callback_t; -typedef boost::function tool_handledrag_callback_t; -typedef boost::function tool_handledrop_callback_t; +typedef std::function tool_startdrag_callback_t; +typedef std::function tool_handledrag_callback_t; +typedef std::function tool_handledrop_callback_t; class LLToolBarButton : public LLButton { @@ -167,7 +167,7 @@ class LLToolBar class LLCenterLayoutPanel : public LLLayoutPanel { public: - typedef boost::function reshape_callback_t; + typedef std::function reshape_callback_t; virtual ~LLCenterLayoutPanel() {} /*virtual*/ void handleReshape(const LLRect& rect, bool by_user); diff --git a/indra/llui/lltooltip.h b/indra/llui/lltooltip.h index 760acddd6fc..c9d6937c1a0 100644 --- a/indra/llui/lltooltip.h +++ b/indra/llui/lltooltip.h @@ -67,8 +67,8 @@ class LLToolTip : public LLPanel struct Params : public LLInitParam::Block { - typedef boost::function click_callback_t; - typedef boost::function create_callback_t; + typedef std::function click_callback_t; + typedef std::function create_callback_t; Optional message; Multiple styled_message; diff --git a/indra/llui/llui.h b/indra/llui/llui.h index b2dcb6dc88b..2ef64baaf6f 100644 --- a/indra/llui/llui.h +++ b/indra/llui/llui.h @@ -241,9 +241,9 @@ class LLUI : public LLSimpleton // // Methods // - typedef boost::function add_popup_t; - typedef boost::function remove_popup_t; - typedef boost::function clear_popups_t; + typedef std::function add_popup_t; + typedef std::function remove_popup_t; + typedef std::function clear_popups_t; void setPopupFuncs(const add_popup_t& add_popup, const remove_popup_t&, const clear_popups_t& ); diff --git a/indra/llui/lluictrl.cpp b/indra/llui/lluictrl.cpp index cbabb5a933b..05461edd82d 100644 --- a/indra/llui/lluictrl.cpp +++ b/indra/llui/lluictrl.cpp @@ -999,15 +999,16 @@ bool LLUICtrl::findHelpTopic(std::string& help_topic_out) } // *TODO: Deprecate; for backwards compatability only: -boost::signals2::connection LLUICtrl::setCommitCallback( boost::function cb, void* data) +boost::signals2::connection LLUICtrl::setCommitCallback( std::function cb, void* data) { - return setCommitCallback( boost::bind(cb, _1, data)); + return setCommitCallback( std::bind(cb, std::placeholders::_1, data)); } -boost::signals2::connection LLUICtrl::setValidateBeforeCommit( boost::function cb ) + +boost::signals2::connection LLUICtrl::setValidateBeforeCommit( std::function cb ) { if (!mValidateSignal) mValidateSignal = new enable_signal_t(); - return mValidateSignal->connect(boost::bind(cb, _2)); + return mValidateSignal->connect(std::bind(cb, std::placeholders::_2)); } // virtual diff --git a/indra/llui/lluictrl.h b/indra/llui/lluictrl.h index bcaf479b0ff..749999bbfe0 100644 --- a/indra/llui/lluictrl.h +++ b/indra/llui/lluictrl.h @@ -31,7 +31,8 @@ //#include "llboost.h" #include "llrect.h" #include "llsd.h" -#include +#include +#include #include #include "llinitparam.h" @@ -47,12 +48,12 @@ class LLUICtrl : public LLView, public boost::signals2::trackable { public: - typedef boost::function commit_callback_t; + typedef std::function commit_callback_t; typedef boost::signals2::signal commit_signal_t; // *TODO: add xml support for this type of signal in the future typedef boost::signals2::signal mouse_signal_t; - typedef boost::function enable_callback_t; + typedef std::function enable_callback_t; typedef boost::signals2::signal enable_signal_t; struct CallbackParam : public LLInitParam::Block @@ -258,8 +259,8 @@ class LLUICtrl boost::signals2::connection setDoubleClickCallback( const mouse_signal_t::slot_type& cb ); // *TODO: Deprecate; for backwards compatability only: - boost::signals2::connection setCommitCallback( boost::function cb, void* data); - boost::signals2::connection setValidateBeforeCommit( boost::function cb ); + boost::signals2::connection setCommitCallback( std::function cb, void* data); + boost::signals2::connection setValidateBeforeCommit( std::function cb ); LLUICtrl* findRootMostFocusRoot(); diff --git a/indra/llui/lluictrlfactory.cpp b/indra/llui/lluictrlfactory.cpp index a2a6d661ff8..9abccfd9a0a 100644 --- a/indra/llui/lluictrlfactory.cpp +++ b/indra/llui/lluictrlfactory.cpp @@ -100,16 +100,19 @@ void LLUICtrlFactory::loadWidgetTemplate(const std::string& widget_tag, LLInitPa std::string base_filename = search_paths.front(); if (!base_filename.empty()) { - LLUICtrlFactory::instance().pushFileName(base_filename); + LLUICtrlFactory *factory = LLUICtrlFactory::getInstance(); + factory->mFileNames.push_back(base_filename); - if (!LLXMLNode::getLayeredXMLNode(root_node, search_paths)) + if (LLXMLNode::getLayeredXMLNode(root_node, search_paths)) + { + LLXUIParser parser; + parser.readXUI(root_node, block, base_filename); + } + else { LL_WARNS() << "Couldn't parse widget from: " << base_filename << LL_ENDL; - return; } - LLXUIParser parser; - parser.readXUI(root_node, block, base_filename); - LLUICtrlFactory::instance().popFileName(); + factory->mFileNames.pop_back(); } } diff --git a/indra/llui/lluictrlfactory.h b/indra/llui/lluictrlfactory.h index 91221dc7f3f..fc069c078f9 100644 --- a/indra/llui/lluictrlfactory.h +++ b/indra/llui/lluictrlfactory.h @@ -311,7 +311,7 @@ LLUICtrlFactory::ParamDefaults::ParamDefaults() { template template LLChildRegistry::Register::Register(const char* tag, LLWidgetCreatorFunc func) -: LLChildRegistry::StaticRegistrar(tag, func.empty() ? (LLWidgetCreatorFunc)&LLUICtrlFactory::defaultBuilder : func) +: LLChildRegistry::StaticRegistrar(tag, func == nullptr ? (LLWidgetCreatorFunc)&LLUICtrlFactory::defaultBuilder : func) { // add this widget to various registries LLUICtrlFactory::instance().registerWidget(&typeid(T), &typeid(typename T::Params), tag); diff --git a/indra/llui/llurlaction.h b/indra/llui/llurlaction.h index 56d459bb26f..c4cfd0f3fb1 100644 --- a/indra/llui/llurlaction.h +++ b/indra/llui/llurlaction.h @@ -28,8 +28,8 @@ #ifndef LL_LLURLACTION_H #define LL_LLURLACTION_H +#include #include -#include /// /// The LLUrlAction class provides a number of static functions that @@ -93,8 +93,8 @@ class LLUrlAction static void unblockObject(std::string url); /// specify the callbacks to enable this class's functionality - typedef boost::function url_callback_t; - typedef boost::function execute_url_callback_t; + typedef std::function url_callback_t; + typedef std::function execute_url_callback_t; static void setOpenURLCallback(url_callback_t cb); static void setOpenURLInternalCallback(url_callback_t cb); diff --git a/indra/llui/llurlentry.cpp b/indra/llui/llurlentry.cpp index 95603d7ed53..bba80dd20eb 100644 --- a/indra/llui/llurlentry.cpp +++ b/indra/llui/llurlentry.cpp @@ -234,7 +234,7 @@ bool LLUrlEntryBase::isWikiLinkCorrect(const std::string &labeled_url) const || label.find("www.") != std::string::npos) && label.find("://") == std::string::npos) { - label = "http://" + label; + label = "https://" + label; } return !LLUrlRegistry::instance().hasUrl(label); @@ -315,7 +315,7 @@ std::string LLUrlEntryHTTP::getUrl(const std::string &string) const { if (string.find("://") == std::string::npos) { - return "http://" + escapeUrl(string); + return "https://" + escapeUrl(string); } return escapeUrl(string); } diff --git a/indra/llui/llview.h b/indra/llui/llview.h index 97212a9d2d0..d747ef95551 100644 --- a/indra/llui/llview.h +++ b/indra/llui/llview.h @@ -48,9 +48,8 @@ #include "lltreeiterators.h" #include "llfocusmgr.h" +#include #include -#include -#include class LLSD; @@ -627,7 +626,7 @@ class LLView LLView& getDefaultWidgetContainer() const; // This allows special mouse-event targeting logic for testing. - typedef boost::function DrilldownFunc; + typedef std::function DrilldownFunc; static DrilldownFunc sDrilldown; public: @@ -637,7 +636,7 @@ class LLView // LLView::TemporaryDrilldownFunc scoped_func(myfunctor); // // ... test with myfunctor ... // } // exiting block restores original LLView::sDrilldown - class TemporaryDrilldownFunc: public boost::noncopyable + class TemporaryDrilldownFunc { public: TemporaryDrilldownFunc(const DrilldownFunc& func): @@ -651,6 +650,10 @@ class LLView sDrilldown = mOldDrilldown; } + // Non-copyable + TemporaryDrilldownFunc(const TemporaryDrilldownFunc&) = delete; + TemporaryDrilldownFunc& operator=(const TemporaryDrilldownFunc&) = delete; + private: DrilldownFunc mOldDrilldown; }; diff --git a/indra/llui/llviewereventrecorder.h b/indra/llui/llviewereventrecorder.h index 5636c068d8c..3bd8eb1f75a 100644 --- a/indra/llui/llviewereventrecorder.h +++ b/indra/llui/llviewereventrecorder.h @@ -75,7 +75,7 @@ class LLViewerEventRecorder : public LLSimpleton bool logEvents; std::string mLogFilename; - llofstream mLog; + llofstream mLog; private: diff --git a/indra/llui/llxuiparser.h b/indra/llui/llxuiparser.h index f755c12cbfe..2179ae54d3c 100644 --- a/indra/llui/llxuiparser.h +++ b/indra/llui/llxuiparser.h @@ -31,7 +31,7 @@ #include "llregistry.h" #include "llxmlnode.h" -#include +#include #include #include #include @@ -47,7 +47,7 @@ class LLWidgetTypeRegistry // global static instance for registering all widget types -typedef boost::function LLWidgetCreatorFunc; +typedef std::function LLWidgetCreatorFunc; typedef LLRegistry widget_registry_t; diff --git a/indra/llwebrtc/llwebrtc.cpp b/indra/llwebrtc/llwebrtc.cpp index 161d8d7e915..d1bae497844 100644 --- a/indra/llwebrtc/llwebrtc.cpp +++ b/indra/llwebrtc/llwebrtc.cpp @@ -920,14 +920,17 @@ bool LLWebRTCPeerConnectionImpl::initializeConnection(const LLWebRTCPeerConnecti config.set_max_port(60100); webrtc::PeerConnectionDependencies pc_dependencies(this); - if (mPeerConnectionFactory == nullptr) + // Other thread manages mPeerConnectionFactory's lifetime and it can be reset + // at any momment, create own scoped_refptr (atomic). + webrtc::scoped_refptr peer_connection_factory = mPeerConnectionFactory; + if (peer_connection_factory == nullptr) { RTC_LOG(LS_ERROR) << __FUNCTION__ << "Error creating peer connection, factory doesn't exist"; // Too early? mPendingJobs--; return; } - auto error_or_peer_connection = mPeerConnectionFactory->CreatePeerConnectionOrError(config, std::move(pc_dependencies)); + auto error_or_peer_connection = peer_connection_factory->CreatePeerConnectionOrError(config, std::move(pc_dependencies)); if (error_or_peer_connection.ok()) { mPeerConnection = std::move(error_or_peer_connection.value()); @@ -960,10 +963,10 @@ bool LLWebRTCPeerConnectionImpl::initializeConnection(const LLWebRTCPeerConnecti audioOptions.noise_suppression = true; audioOptions.init_recording_on_send = false; - mLocalStream = mPeerConnectionFactory->CreateLocalMediaStream("SLStream"); + mLocalStream = peer_connection_factory->CreateLocalMediaStream("SLStream"); webrtc::scoped_refptr audio_track( - mPeerConnectionFactory->CreateAudioTrack("SLAudio", mPeerConnectionFactory->CreateAudioSource(audioOptions).get())); + peer_connection_factory->CreateAudioTrack("SLAudio", peer_connection_factory->CreateAudioSource(audioOptions).get())); audio_track->set_enabled(false); mLocalStream->AddTrack(audio_track); diff --git a/indra/llwindow/CMakeLists.txt b/indra/llwindow/CMakeLists.txt index 08b3df87abe..aacaef9257b 100644 --- a/indra/llwindow/CMakeLists.txt +++ b/indra/llwindow/CMakeLists.txt @@ -12,12 +12,14 @@ project(llwindow) include(00-Common) include(DragDrop) +include(Linking) include(LLCommon) include(LLImage) include(LLWindow) include(UI) include(ViewerMiscLibs) include(GLM) +include(SDL3) set(llwindow_SOURCE_FILES llcursortypes.cpp @@ -58,34 +60,24 @@ set(llwindow_LINK_LIBRARIES ll::glm ll::glext ll::uilibraries - ll::SDL ) -# Libraries on which this library depends, needed for Linux builds -# Sort by high-level to low-level -if (LINUX) + +if (USE_SDL_WINDOW) list(APPEND viewer_SOURCE_FILES + llsdl.cpp llkeyboardsdl.cpp llwindowsdl.cpp ) list(APPEND viewer_HEADER_FILES + llsdl.h llkeyboardsdl.h llwindowsdl.h ) - if (BUILD_HEADLESS) - set(llwindowheadless_LINK_LIBRARIES - ${LLCOMMON_LIBRARIES} - ${LLIMAGE_LIBRARIES} - ${LLMATH_LIBRARIES} - ${LLRENDER_HEADLESS_LIBRARIES} - ${LLFILESYSTEM_LIBRARIES} - ${LLWINDOW_HEADLESS_LIBRARIES} - ${LLXML_LIBRARIES} - fontconfig # For FCInit and other FC* functions. - ) - endif (BUILD_HEADLESS) - -endif (LINUX) + list(APPEND llwindow_LINK_LIBRARIES + ll::SDL3 + ) +endif () if (DARWIN) list(APPEND llwindow_SOURCE_FILES @@ -109,6 +101,13 @@ if (DARWIN) PROPERTIES COMPILE_FLAGS "-fpascal-strings" ) + + set_source_files_properties( + llwindowmacosx-objc.mm + llopenglview-objc.mm + PROPERTIES + SKIP_PRECOMPILE_HEADERS TRUE + ) endif (DARWIN) @@ -133,32 +132,55 @@ if (WINDOWS) ) endif (WINDOWS) -if (SOLARIS) - list(APPEND llwindow_SOURCE_FILES - llwindowsolaris.cpp - ) - list(APPEND llwindow_HEADER_FILES - llwindowsolaris.h - ) -endif (SOLARIS) if (BUILD_HEADLESS) set(llwindowheadless_SOURCE_FILES - llwindowmesaheadless.cpp - llmousehandler.cpp - ) + llcursortypes.cpp + llkeyboard.cpp + llkeyboardheadless.cpp + llwindowheadless.cpp + llwindowcallbacks.cpp + llwindow.cpp + llwindowmesaheadless.cpp + llmousehandler.cpp + ) + set(llwindowheadless_HEADER_FILES - llwindowmesaheadless.h - llmousehandler.h - ) + llcursortypes.h + llkeyboard.h + llkeyboardheadless.h + llwindowheadless.h + llwindowcallbacks.h + llwindowmesaheadless.h + llmousehandler.h + ) + add_library (llwindowheadless - ${llwindow_SOURCE_FILES} ${llwindowheadless_SOURCE_FILES} + ${llwindowheadless_HEADER_FILES} ) - set_property(TARGET llwindowheadless - PROPERTY COMPILE_DEFINITIONS LL_MESA=1 LL_MESA_HEADLESS=1 - ) - target_link_libraries (llwindowheadless ${llwindowheadless_LINK_LIBRARIES} dl) + + target_compile_definitions( llwindowheadless PUBLIC LL_MESA_HEADLESS=1 ) + + target_link_libraries (llwindowheadless + llcommon + llimage + llmath + llrenderheadless + llfilesystem + llxml + ll::glm + ll::glext + ll::zlib-ng + PkgConfig::OSMESA + fontconfig + dl + ) + target_include_directories(llwindowheadless INTERFACE ${CMAKE_CURRENT_SOURCE_DIR}) + + if (USE_PRECOMPILED_HEADERS) + target_precompile_headers(llwindowheadless REUSE_FROM llprecompiled) + endif () endif (BUILD_HEADLESS) if (llwindow_HEADER_FILES) @@ -172,14 +194,16 @@ endif (llwindow_HEADER_FILES) ${viewer_SOURCE_FILES} ) -if (SDL_FOUND) - set_property(TARGET llwindow - PROPERTY COMPILE_DEFINITIONS LL_SDL=1 - ) -endif (SDL_FOUND) +target_link_libraries (llwindow ${llwindow_LINK_LIBRARIES}) +target_include_directories(llwindow INTERFACE ${CMAKE_CURRENT_SOURCE_DIR}) + +if (USE_SDL_WINDOW) + target_compile_definitions( llwindow PUBLIC LL_SDL_WINDOW=1 ) +endif() - target_link_libraries (llwindow ${llwindow_LINK_LIBRARIES}) - target_include_directories(llwindow INTERFACE ${CMAKE_CURRENT_SOURCE_DIR}) +if (USE_PRECOMPILED_HEADERS) + target_precompile_headers(llwindow REUSE_FROM llprecompiled) +endif () if (DARWIN) target_link_libraries(llwindow ${CARBON_LIBRARY}) diff --git a/indra/llwindow/llappdelegate-objc.h b/indra/llwindow/llappdelegate-objc.h index ef36f7d4a85..5b6e11e4e4b 100644 --- a/indra/llwindow/llappdelegate-objc.h +++ b/indra/llwindow/llappdelegate-objc.h @@ -36,16 +36,17 @@ std::string secondLogPath; } -@property (assign) IBOutlet LLNSWindow *window; -@property (assign) IBOutlet NSWindow *inputWindow; -@property (assign) IBOutlet LLNonInlineTextView *inputView; +@property (assign) IBOutlet LLNSWindow * _Nullable window; +@property (assign) IBOutlet NSWindow * _Nullable inputWindow; +@property (assign) IBOutlet LLNonInlineTextView * _Nullable inputView; -@property (retain) NSString *currentInputLanguage; +@property (retain) NSString * _Nullable currentInputLanguage; - (void) oneFrame; -- (void) showInputWindow:(bool)show withEvent:(NSEvent*)textEvent; +- (void) showInputWindow:(bool)show withEvent:(nullable NSEvent *)textEvent; - (void) languageUpdated; - (bool) romanScript; +- (void) setBugsplatValue:(nullable NSString *)value forAttribute:(nullable NSString *)attribute; @end @interface LLApplication : NSApplication diff --git a/indra/llwindow/llkeyboard.cpp b/indra/llwindow/llkeyboard.cpp index 33eebdadd15..df69b1390cf 100644 --- a/indra/llwindow/llkeyboard.cpp +++ b/indra/llwindow/llkeyboard.cpp @@ -30,6 +30,8 @@ #include "llwindowcallbacks.h" +#include "llstl.h" + // // Globals // @@ -41,7 +43,6 @@ std::map LLKeyboard::sKeysToNames; std::map LLKeyboard::sNamesToKeys; LLKeyStringTranslatorFunc* LLKeyboard::mStringTranslator = NULL; // Used for l10n + PC/Mac/Linux accelerator labeling - // // Class Implementation // @@ -162,6 +163,7 @@ void LLKeyboard::resetKeyDownAndHandle() mCallbacks->handleTranslatedKeyUp(i, mask); } } + mCurTranslatedKey = KEY_NONE; } // BUG this has to be called when an OS dialog is shown, otherwise modifier key state @@ -195,12 +197,10 @@ void LLKeyboard::resetKeys() } -bool LLKeyboard::translateKey(const U16 os_key, KEY *out_key) +bool LLKeyboard::translateKey(const NATIVE_KEY_TYPE os_key, KEY *out_key) { - std::map::iterator iter; - // Only translate keys in the map, ignore all other keys for now - iter = mTranslateKeyMap.find(os_key); + auto iter = mTranslateKeyMap.find(os_key); if (iter == mTranslateKeyMap.end()) { //LL_WARNS() << "Unknown virtual key " << os_key << LL_ENDL; @@ -214,11 +214,9 @@ bool LLKeyboard::translateKey(const U16 os_key, KEY *out_key) } } - -U16 LLKeyboard::inverseTranslateKey(const KEY translated_key) +LLKeyboard::NATIVE_KEY_TYPE LLKeyboard::inverseTranslateKey(const KEY translated_key) { - std::map::iterator iter; - iter = mInvTranslateKeyMap.find(translated_key); + auto iter = mInvTranslateKeyMap.find(translated_key); if (iter == mInvTranslateKeyMap.end()) { return 0; @@ -230,7 +228,7 @@ U16 LLKeyboard::inverseTranslateKey(const KEY translated_key) } -bool LLKeyboard::handleTranslatedKeyDown(KEY translated_key, U32 translated_mask) +bool LLKeyboard::handleTranslatedKeyDown(KEY translated_key, MASK translated_mask) { bool handled = false; bool repeated = false; @@ -258,7 +256,7 @@ bool LLKeyboard::handleTranslatedKeyDown(KEY translated_key, U32 translated_mask } -bool LLKeyboard::handleTranslatedKeyUp(KEY translated_key, U32 translated_mask) +bool LLKeyboard::handleTranslatedKeyUp(KEY translated_key, MASK translated_mask) { bool handled = false; if( mKeyLevel[translated_key] ) diff --git a/indra/llwindow/llkeyboard.h b/indra/llwindow/llkeyboard.h index 713eb7aec24..d08d4afac17 100644 --- a/indra/llwindow/llkeyboard.h +++ b/indra/llwindow/llkeyboard.h @@ -27,10 +27,9 @@ #ifndef LL_LLKEYBOARD_H #define LL_LLKEYBOARD_H +#include #include -#include -#include "llstringtable.h" #include "lltimer.h" #include "indra_constants.h" @@ -41,7 +40,7 @@ enum EKeystate KEYSTATE_UP }; -typedef boost::function LLKeyFunc; +typedef std::function LLKeyFunc; typedef std::string (LLKeyStringTranslatorFunc)(std::string_view); enum EKeyboardInsertMode @@ -55,6 +54,13 @@ class LLWindowCallbacks; class LLKeyboard { public: +#ifdef LL_SDL_WINDOW + // linux relies on SDL2 which uses U32 for its native key type + typedef U32 NATIVE_KEY_TYPE; +#else + // on non-linux platforms we can get by with a smaller native key type + typedef U16 NATIVE_KEY_TYPE; +#endif LLKeyboard(); virtual ~LLKeyboard(); @@ -67,16 +73,15 @@ class LLKeyboard bool getKeyDown(const KEY key) { return mKeyLevel[key]; } bool getKeyRepeated(const KEY key) { return mKeyRepeated[key]; } - bool translateKey(const U16 os_key, KEY *translated_key); - U16 inverseTranslateKey(const KEY translated_key); - bool handleTranslatedKeyUp(KEY translated_key, U32 translated_mask); // Translated into "Linden" keycodes - bool handleTranslatedKeyDown(KEY translated_key, U32 translated_mask); // Translated into "Linden" keycodes - + bool translateKey(const NATIVE_KEY_TYPE os_key, KEY *translated_key); + NATIVE_KEY_TYPE inverseTranslateKey(const KEY translated_key); + bool handleTranslatedKeyUp(KEY translated_key, MASK translated_mask); // Translated into "Linden" keycodes + bool handleTranslatedKeyDown(KEY translated_key, MASK translated_mask); // Translated into "Linden" keycodes - virtual bool handleKeyUp(const U16 key, MASK mask) = 0; - virtual bool handleKeyDown(const U16 key, MASK mask) = 0; + virtual bool handleKeyUp(const NATIVE_KEY_TYPE key, MASK mask) = 0; + virtual bool handleKeyDown(const NATIVE_KEY_TYPE key, MASK mask) = 0; -#ifdef LL_DARWIN +#if LL_DARWIN && !LL_SDL_WINDOW // We only actually use this for macOS. virtual void handleModifier(MASK mask) = 0; #endif // LL_DARWIN @@ -111,8 +116,8 @@ class LLKeyboard void addKeyName(KEY key, const std::string& name); protected: - std::map mTranslateKeyMap; // Map of translations from OS keys to Linden KEYs - std::map mInvTranslateKeyMap; // Map of translations from Linden KEYs to OS keys + std::map mTranslateKeyMap; // Map of translations from OS keys to Linden KEYs + std::map mInvTranslateKeyMap; // Map of translations from Linden KEYs to OS keys LLWindowCallbacks *mCallbacks; LLTimer mKeyLevelTimer[KEY_COUNT]; // Time since level was set diff --git a/indra/llwindow/llkeyboardheadless.cpp b/indra/llwindow/llkeyboardheadless.cpp index 8669a5b41ad..50d03aaf203 100644 --- a/indra/llwindow/llkeyboardheadless.cpp +++ b/indra/llwindow/llkeyboardheadless.cpp @@ -31,21 +31,23 @@ LLKeyboardHeadless::LLKeyboardHeadless() { } -void LLKeyboardHeadless::resetMaskKeys() -{ } - - -bool LLKeyboardHeadless::handleKeyDown(const U16 key, const U32 mask) -{ return false; } +bool LLKeyboardHeadless::handleKeyUp(const LLKeyboard::NATIVE_KEY_TYPE key, MASK mask) +{ + return false; +} +bool LLKeyboardHeadless::handleKeyDown(const LLKeyboard::NATIVE_KEY_TYPE key, MASK mask) +{ + return false; +} -bool LLKeyboardHeadless::handleKeyUp(const U16 key, const U32 mask) -{ return false; } +void LLKeyboardHeadless::resetMaskKeys() +{ } MASK LLKeyboardHeadless::currentMask(bool for_mouse_event) { return MASK_NONE; } -#ifdef LL_DARWIN +#if LL_DARWIN && !LL_SDL_WINDOW void LLKeyboardHeadless::handleModifier(MASK mask) { @@ -65,6 +67,7 @@ void LLKeyboardHeadless::scanKeyboard() mCallbacks->handleScanKey(key, mKeyDown[key], mKeyUp[key], mKeyLevel[key]); } } + mCurScanKey = KEY_NONE; // Reset edges for next frame for (S32 key = 0; key < KEY_COUNT; key++) diff --git a/indra/llwindow/llkeyboardheadless.h b/indra/llwindow/llkeyboardheadless.h index 2528f0e3f13..364fb03fe72 100644 --- a/indra/llwindow/llkeyboardheadless.h +++ b/indra/llwindow/llkeyboardheadless.h @@ -33,15 +33,15 @@ class LLKeyboardHeadless : public LLKeyboard { public: LLKeyboardHeadless(); - /*virtual*/ ~LLKeyboardHeadless() {}; + ~LLKeyboardHeadless() = default; - /*virtual*/ bool handleKeyUp(const U16 key, MASK mask); - /*virtual*/ bool handleKeyDown(const U16 key, MASK mask); - /*virtual*/ void resetMaskKeys(); - /*virtual*/ MASK currentMask(bool for_mouse_event); - /*virtual*/ void scanKeyboard(); -#ifdef LL_DARWIN - /*virtual*/ void handleModifier(MASK mask); + bool handleKeyUp(const LLKeyboard::NATIVE_KEY_TYPE key, MASK mask) override; + bool handleKeyDown(const LLKeyboard::NATIVE_KEY_TYPE key, MASK mask) override; + void resetMaskKeys() override; + MASK currentMask(bool for_mouse_event) override; + void scanKeyboard() override; +#if LL_DARWIN && !LL_SDL_WINDOW + void handleModifier(MASK mask) override; #endif }; diff --git a/indra/llwindow/llkeyboardmacosx.cpp b/indra/llwindow/llkeyboardmacosx.cpp index 89ff7c6d3fc..1a403e5d942 100644 --- a/indra/llwindow/llkeyboardmacosx.cpp +++ b/indra/llwindow/llkeyboardmacosx.cpp @@ -162,7 +162,7 @@ LLKeyboardMacOSX::LLKeyboardMacOSX() void LLKeyboardMacOSX::resetMaskKeys() { - U32 mask = getModifiers(); + MASK mask = getModifiers(); // MBW -- XXX -- This mirrors the operation of the Windows version of resetMaskKeys(). // It looks a bit suspicious, as it won't correct for keys that have been released. @@ -187,7 +187,7 @@ void LLKeyboardMacOSX::resetMaskKeys() } /* -static bool translateKeyMac(const U16 key, const U32 mask, KEY &outKey, U32 &outMask) +static bool translateKeyMac(const U16 key, const MASK mask, KEY &outKey, U32 &outMask) { // Translate the virtual keycode into the keycodes the keyboard system expects. U16 virtualKey = (mask >> 24) & 0x0000007F; @@ -203,7 +203,7 @@ void LLKeyboardMacOSX::handleModifier(MASK mask) updateModifiers(mask); } -MASK LLKeyboardMacOSX::updateModifiers(const U32 mask) +MASK LLKeyboardMacOSX::updateModifiers(const MASK mask) { // translate the mask MASK out_mask = 0; @@ -226,7 +226,7 @@ MASK LLKeyboardMacOSX::updateModifiers(const U32 mask) return out_mask; } -bool LLKeyboardMacOSX::handleKeyDown(const U16 key, const U32 mask) +bool LLKeyboardMacOSX::handleKeyDown(const U16 key, MASK mask) { KEY translated_key = 0; U32 translated_mask = 0; @@ -243,7 +243,7 @@ bool LLKeyboardMacOSX::handleKeyDown(const U16 key, const U32 mask) } -bool LLKeyboardMacOSX::handleKeyUp(const U16 key, const U32 mask) +bool LLKeyboardMacOSX::handleKeyUp(const U16 key, MASK mask) { KEY translated_key = 0; U32 translated_mask = 0; @@ -262,7 +262,7 @@ bool LLKeyboardMacOSX::handleKeyUp(const U16 key, const U32 mask) MASK LLKeyboardMacOSX::currentMask(bool for_mouse_event) { MASK result = MASK_NONE; - U32 mask = getModifiers(); + MASK mask = getModifiers(); if (mask & MAC_SHIFT_KEY) result |= MASK_SHIFT; if (mask & MAC_CTRL_KEY) result |= MASK_CONTROL; @@ -291,6 +291,7 @@ void LLKeyboardMacOSX::scanKeyboard() mCallbacks->handleScanKey(key, mKeyDown[key], mKeyUp[key], mKeyLevel[key]); } } + mCurScanKey = KEY_NONE; // Reset edges for next frame for (key = 0; key < KEY_COUNT; key++) diff --git a/indra/llwindow/llkeyboardmacosx.h b/indra/llwindow/llkeyboardmacosx.h index 92ab5c9a85d..c824e7b7135 100644 --- a/indra/llwindow/llkeyboardmacosx.h +++ b/indra/llwindow/llkeyboardmacosx.h @@ -42,17 +42,17 @@ class LLKeyboardMacOSX : public LLKeyboard { public: LLKeyboardMacOSX(); - /*virtual*/ ~LLKeyboardMacOSX() {}; + ~LLKeyboardMacOSX() = default; - /*virtual*/ bool handleKeyUp(const U16 key, MASK mask); - /*virtual*/ bool handleKeyDown(const U16 key, MASK mask); - /*virtual*/ void resetMaskKeys(); - /*virtual*/ MASK currentMask(bool for_mouse_event); - /*virtual*/ void scanKeyboard(); - /*virtual*/ void handleModifier(MASK mask); + bool handleKeyUp(const NATIVE_KEY_TYPE key, MASK mask) override; + bool handleKeyDown(const NATIVE_KEY_TYPE key, MASK mask) override; + void resetMaskKeys() override; + MASK currentMask(bool for_mouse_event) override; + void scanKeyboard() override; + void handleModifier(MASK mask) override; protected: - MASK updateModifiers(const U32 mask); + MASK updateModifiers(const MASK mask); void setModifierKeyLevel( KEY key, bool new_state ); bool translateNumpadKey( const U16 os_key, KEY *translated_key ); U16 inverseTranslateNumpadKey(const KEY translated_key); diff --git a/indra/llwindow/llkeyboardsdl.cpp b/indra/llwindow/llkeyboardsdl.cpp index 97198f0cc0e..803a5b8c23c 100644 --- a/indra/llwindow/llkeyboardsdl.cpp +++ b/indra/llwindow/llkeyboardsdl.cpp @@ -24,12 +24,11 @@ * $/LicenseInfo$ */ -#if LL_SDL - #include "linden_common.h" #include "llkeyboardsdl.h" #include "llwindowcallbacks.h" -#include "SDL/SDL.h" + +#include "SDL3/SDL_keycode.h" LLKeyboardSDL::LLKeyboardSDL() { @@ -40,7 +39,7 @@ LLKeyboardSDL::LLKeyboardSDL() // Virtual key mappings from SDL_keysym.h ... // SDL maps the letter keys to the ASCII you'd expect, but it's lowercase... - U16 cur_char; + LLKeyboard::NATIVE_KEY_TYPE cur_char; for (cur_char = 'A'; cur_char <= 'Z'; cur_char++) { mTranslateKeyMap[cur_char] = cur_char; @@ -74,7 +73,6 @@ LLKeyboardSDL::LLKeyboardSDL() mTranslateKeyMap[SDLK_RIGHT] = KEY_RIGHT; mTranslateKeyMap[SDLK_UP] = KEY_UP; mTranslateKeyMap[SDLK_DOWN] = KEY_DOWN; - mTranslateKeyMap[SDLK_ESCAPE] = KEY_ESCAPE; mTranslateKeyMap[SDLK_KP_ENTER] = KEY_RETURN; mTranslateKeyMap[SDLK_ESCAPE] = KEY_ESCAPE; mTranslateKeyMap[SDLK_BACKSPACE] = KEY_BACKSPACE; @@ -115,36 +113,35 @@ LLKeyboardSDL::LLKeyboardSDL() mTranslateKeyMap[SDLK_COMMA] = ','; mTranslateKeyMap[SDLK_MINUS] = '-'; mTranslateKeyMap[SDLK_PERIOD] = '.'; - mTranslateKeyMap[SDLK_BACKQUOTE] = '`'; + mTranslateKeyMap[SDLK_GRAVE] = '`'; mTranslateKeyMap[SDLK_SLASH] = KEY_DIVIDE; mTranslateKeyMap[SDLK_SEMICOLON] = ';'; mTranslateKeyMap[SDLK_LEFTBRACKET] = '['; mTranslateKeyMap[SDLK_BACKSLASH] = '\\'; mTranslateKeyMap[SDLK_RIGHTBRACKET] = ']'; - mTranslateKeyMap[SDLK_QUOTE] = '\''; + mTranslateKeyMap[SDLK_APOSTROPHE] = '\''; // Build inverse map - std::map::iterator iter; - for (iter = mTranslateKeyMap.begin(); iter != mTranslateKeyMap.end(); iter++) + for (auto iter = mTranslateKeyMap.begin(); iter != mTranslateKeyMap.end(); iter++) { mInvTranslateKeyMap[iter->second] = iter->first; } // numpad map - mTranslateNumpadMap[SDLK_KP0] = KEY_PAD_INS; - mTranslateNumpadMap[SDLK_KP1] = KEY_PAD_END; - mTranslateNumpadMap[SDLK_KP2] = KEY_PAD_DOWN; - mTranslateNumpadMap[SDLK_KP3] = KEY_PAD_PGDN; - mTranslateNumpadMap[SDLK_KP4] = KEY_PAD_LEFT; - mTranslateNumpadMap[SDLK_KP5] = KEY_PAD_CENTER; - mTranslateNumpadMap[SDLK_KP6] = KEY_PAD_RIGHT; - mTranslateNumpadMap[SDLK_KP7] = KEY_PAD_HOME; - mTranslateNumpadMap[SDLK_KP8] = KEY_PAD_UP; - mTranslateNumpadMap[SDLK_KP9] = KEY_PAD_PGUP; + mTranslateNumpadMap[SDLK_KP_0] = KEY_PAD_INS; + mTranslateNumpadMap[SDLK_KP_1] = KEY_PAD_END; + mTranslateNumpadMap[SDLK_KP_2] = KEY_PAD_DOWN; + mTranslateNumpadMap[SDLK_KP_3] = KEY_PAD_PGDN; + mTranslateNumpadMap[SDLK_KP_4] = KEY_PAD_LEFT; + mTranslateNumpadMap[SDLK_KP_5] = KEY_PAD_CENTER; + mTranslateNumpadMap[SDLK_KP_6] = KEY_PAD_RIGHT; + mTranslateNumpadMap[SDLK_KP_7] = KEY_PAD_HOME; + mTranslateNumpadMap[SDLK_KP_8] = KEY_PAD_UP; + mTranslateNumpadMap[SDLK_KP_9] = KEY_PAD_PGUP; mTranslateNumpadMap[SDLK_KP_PERIOD] = KEY_PAD_DEL; // build inverse numpad map - for (iter = mTranslateNumpadMap.begin(); + for (auto iter = mTranslateNumpadMap.begin(); iter != mTranslateNumpadMap.end(); iter++) { @@ -154,45 +151,45 @@ LLKeyboardSDL::LLKeyboardSDL() void LLKeyboardSDL::resetMaskKeys() { - SDLMod mask = SDL_GetModState(); + SDL_Keymod mask = SDL_GetModState(); // MBW -- XXX -- This mirrors the operation of the Windows version of resetMaskKeys(). // It looks a bit suspicious, as it won't correct for keys that have been released. // Is this the way it's supposed to work? - if(mask & KMOD_SHIFT) + if(mask & SDL_KMOD_SHIFT) { mKeyLevel[KEY_SHIFT] = true; } - if(mask & KMOD_CTRL) + if(mask & SDL_KMOD_CTRL) { mKeyLevel[KEY_CONTROL] = true; } - if(mask & KMOD_ALT) + if(mask & SDL_KMOD_ALT) { mKeyLevel[KEY_ALT] = true; } } -MASK LLKeyboardSDL::updateModifiers(const U32 mask) +MASK LLKeyboardSDL::updateModifiers(const MASK mask) { // translate the mask MASK out_mask = MASK_NONE; - if(mask & KMOD_SHIFT) + if(mask & SDL_KMOD_SHIFT) { out_mask |= MASK_SHIFT; } - if(mask & KMOD_CTRL) + if(mask & SDL_KMOD_CTRL) { out_mask |= MASK_CONTROL; } - if(mask & KMOD_ALT) + if(mask & SDL_KMOD_ALT) { out_mask |= MASK_ALT; } @@ -201,37 +198,37 @@ MASK LLKeyboardSDL::updateModifiers(const U32 mask) } -static U16 adjustNativekeyFromUnhandledMask(const U16 key, const U32 mask) +LLKeyboard::NATIVE_KEY_TYPE adjustNativekeyFromUnhandledMask(const LLKeyboard::NATIVE_KEY_TYPE key, const MASK mask) { // SDL doesn't automatically adjust the keysym according to // whether NUMLOCK is engaged, so we massage the keysym manually. - U16 rtn = key; - if (!(mask & KMOD_NUM)) + LLKeyboard::NATIVE_KEY_TYPE rtn = key; + if (!(mask & SDL_KMOD_NUM)) { switch (key) { - case SDLK_KP_PERIOD: rtn = SDLK_DELETE; break; - case SDLK_KP0: rtn = SDLK_INSERT; break; - case SDLK_KP1: rtn = SDLK_END; break; - case SDLK_KP2: rtn = SDLK_DOWN; break; - case SDLK_KP3: rtn = SDLK_PAGEDOWN; break; - case SDLK_KP4: rtn = SDLK_LEFT; break; - case SDLK_KP6: rtn = SDLK_RIGHT; break; - case SDLK_KP7: rtn = SDLK_HOME; break; - case SDLK_KP8: rtn = SDLK_UP; break; - case SDLK_KP9: rtn = SDLK_PAGEUP; break; + case SDLK_KP_PERIOD: rtn = SDLK_DELETE; break; + case SDLK_KP_0: rtn = SDLK_INSERT; break; + case SDLK_KP_1: rtn = SDLK_END; break; + case SDLK_KP_2: rtn = SDLK_DOWN; break; + case SDLK_KP_3: rtn = SDLK_PAGEDOWN; break; + case SDLK_KP_4: rtn = SDLK_LEFT; break; + case SDLK_KP_6: rtn = SDLK_RIGHT; break; + case SDLK_KP_7: rtn = SDLK_HOME; break; + case SDLK_KP_8: rtn = SDLK_UP; break; + case SDLK_KP_9: rtn = SDLK_PAGEUP; break; } } return rtn; } -bool LLKeyboardSDL::handleKeyDown(const U16 key, const U32 mask) +bool LLKeyboardSDL::handleKeyDown(const LLKeyboard::NATIVE_KEY_TYPE key, const MASK mask) { - U16 adjusted_nativekey; + LLKeyboard::NATIVE_KEY_TYPE adjusted_nativekey; KEY translated_key = 0; - U32 translated_mask = MASK_NONE; - bool handled = false; + MASK translated_mask = MASK_NONE; + bool handled = false; adjusted_nativekey = adjustNativekeyFromUnhandledMask(key, mask); @@ -246,12 +243,12 @@ bool LLKeyboardSDL::handleKeyDown(const U16 key, const U32 mask) } -bool LLKeyboardSDL::handleKeyUp(const U16 key, const U32 mask) +bool LLKeyboardSDL::handleKeyUp(const LLKeyboard::NATIVE_KEY_TYPE key, const MASK mask) { - U16 adjusted_nativekey; + LLKeyboard::NATIVE_KEY_TYPE adjusted_nativekey; KEY translated_key = 0; U32 translated_mask = MASK_NONE; - bool handled = false; + bool handled = false; adjusted_nativekey = adjustNativekeyFromUnhandledMask(key, mask); @@ -268,16 +265,20 @@ bool LLKeyboardSDL::handleKeyUp(const U16 key, const U32 mask) MASK LLKeyboardSDL::currentMask(bool for_mouse_event) { MASK result = MASK_NONE; - SDLMod mask = SDL_GetModState(); + SDL_Keymod mask = SDL_GetModState(); - if (mask & KMOD_SHIFT) result |= MASK_SHIFT; - if (mask & KMOD_CTRL) result |= MASK_CONTROL; - if (mask & KMOD_ALT) result |= MASK_ALT; + if (mask & SDL_KMOD_SHIFT) + result |= MASK_SHIFT; + if (mask & SDL_KMOD_CTRL) + result |= MASK_CONTROL; + if (mask & SDL_KMOD_ALT) + result |= MASK_ALT; // For keyboard events, consider Meta keys equivalent to Control if (!for_mouse_event) { - if (mask & KMOD_META) result |= MASK_CONTROL; + if (mask & SDL_KMOD_GUI) + result |= MASK_CONTROL; } return result; @@ -296,6 +297,7 @@ void LLKeyboardSDL::scanKeyboard() mCallbacks->handleScanKey(key, mKeyDown[key], mKeyUp[key], mKeyLevel[key]); } } + mCurScanKey = KEY_NONE; // Reset edges for next frame for (S32 key = 0; key < KEY_COUNT; key++) @@ -310,15 +312,347 @@ void LLKeyboardSDL::scanKeyboard() } -bool LLKeyboardSDL::translateNumpadKey( const U16 os_key, KEY *translated_key) +bool LLKeyboardSDL::translateNumpadKey( const LLKeyboard::NATIVE_KEY_TYPE os_key, KEY *translated_key) { return translateKey(os_key, translated_key); } -U16 LLKeyboardSDL::inverseTranslateNumpadKey(const KEY translated_key) +LLKeyboard::NATIVE_KEY_TYPE LLKeyboardSDL::inverseTranslateNumpadKey(const KEY translated_key) { return inverseTranslateKey(translated_key); } -#endif +enum class WindowsVK : U32 +{ + LL_VK_UNKNOWN = 0, + LL_VK_CANCEL = 0x03, + LL_VK_BACK = 0x08, + LL_VK_TAB = 0x09, + LL_VK_CLEAR = 0x0C, + LL_VK_RETURN = 0x0D, + LL_VK_SHIFT = 0x10, + LL_VK_CONTROL = 0x11, + LL_VK_MENU = 0x12, + LL_VK_PAUSE = 0x13, + LL_VK_CAPITAL = 0x14, + LL_VK_KANA = 0x15, + LL_VK_HANGUL = 0x15, + LL_VK_JUNJA = 0x17, + LL_VK_FINAL = 0x18, + LL_VK_HANJA = 0x19, + LL_VK_KANJI = 0x19, + LL_VK_ESCAPE = 0x1B, + LL_VK_CONVERT = 0x1C, + LL_VK_NONCONVERT = 0x1D, + LL_VK_ACCEPT = 0x1E, + LL_VK_MODECHANGE = 0x1F, + LL_VK_SPACE = 0x20, + LL_VK_PRIOR = 0x21, + LL_VK_NEXT = 0x22, + LL_VK_END = 0x23, + LL_VK_HOME = 0x24, + LL_VK_LEFT = 0x25, + LL_VK_UP = 0x26, + LL_VK_RIGHT = 0x27, + LL_VK_DOWN = 0x28, + LL_VK_SELECT = 0x29, + LL_VK_PRINT = 0x2A, + LL_VK_EXECUTE = 0x2B, + LL_VK_SNAPSHOT = 0x2C, + LL_VK_INSERT = 0x2D, + LL_VK_DELETE = 0x2E, + LL_VK_HELP = 0x2F, + LL_VK_0 = 0x30, + LL_VK_1 = 0x31, + LL_VK_2 = 0x32, + LL_VK_3 = 0x33, + LL_VK_4 = 0x34, + LL_VK_5 = 0x35, + LL_VK_6 = 0x36, + LL_VK_7 = 0x37, + LL_VK_8 = 0x38, + LL_VK_9 = 0x39, + LL_VK_A = 0x41, + LL_VK_B = 0x42, + LL_VK_C = 0x43, + LL_VK_D = 0x44, + LL_VK_E = 0x45, + LL_VK_F = 0x46, + LL_VK_G = 0x47, + LL_VK_H = 0x48, + LL_VK_I = 0x49, + LL_VK_J = 0x4A, + LL_VK_K = 0x4B, + LL_VK_L = 0x4C, + LL_VK_M = 0x4D, + LL_VK_N = 0x4E, + LL_VK_O = 0x4F, + LL_VK_P = 0x50, + LL_VK_Q = 0x51, + LL_VK_R = 0x52, + LL_VK_S = 0x53, + LL_VK_T = 0x54, + LL_VK_U = 0x55, + LL_VK_V = 0x56, + LL_VK_W = 0x57, + LL_VK_X = 0x58, + LL_VK_Y = 0x59, + LL_VK_Z = 0x5A, + LL_VK_LWIN = 0x5B, + LL_VK_RWIN = 0x5C, + LL_VK_APPS = 0x5D, + LL_VK_SLEEP = 0x5F, + LL_VK_NUMPAD0 = 0x60, + LL_VK_NUMPAD1 = 0x61, + LL_VK_NUMPAD2 = 0x62, + LL_VK_NUMPAD3 = 0x63, + LL_VK_NUMPAD4 = 0x64, + LL_VK_NUMPAD5 = 0x65, + LL_VK_NUMPAD6 = 0x66, + LL_VK_NUMPAD7 = 0x67, + LL_VK_NUMPAD8 = 0x68, + LL_VK_NUMPAD9 = 0x69, + LL_VK_MULTIPLY = 0x6A, + LL_VK_ADD = 0x6B, + LL_VK_SEPARATOR = 0x6C, + LL_VK_SUBTRACT = 0x6D, + LL_VK_DECIMAL = 0x6E, + LL_VK_DIVIDE = 0x6F, + LL_VK_F1 = 0x70, + LL_VK_F2 = 0x71, + LL_VK_F3 = 0x72, + LL_VK_F4 = 0x73, + LL_VK_F5 = 0x74, + LL_VK_F6 = 0x75, + LL_VK_F7 = 0x76, + LL_VK_F8 = 0x77, + LL_VK_F9 = 0x78, + LL_VK_F10 = 0x79, + LL_VK_F11 = 0x7A, + LL_VK_F12 = 0x7B, + LL_VK_F13 = 0x7C, + LL_VK_F14 = 0x7D, + LL_VK_F15 = 0x7E, + LL_VK_F16 = 0x7F, + LL_VK_F17 = 0x80, + LL_VK_F18 = 0x81, + LL_VK_F19 = 0x82, + LL_VK_F20 = 0x83, + LL_VK_F21 = 0x84, + LL_VK_F22 = 0x85, + LL_VK_F23 = 0x86, + LL_VK_F24 = 0x87, + LL_VK_NUMLOCK = 0x90, + LL_VK_SCROLL = 0x91, + LL_VK_LSHIFT = 0xA0, + LL_VK_RSHIFT = 0xA1, + LL_VK_LCONTROL = 0xA2, + LL_VK_RCONTROL = 0xA3, + LL_VK_LMENU = 0xA4, + LL_VK_RMENU = 0xA5, + LL_VK_BROWSER_BACK = 0xA6, + LL_VK_BROWSER_FORWARD = 0xA7, + LL_VK_BROWSER_REFRESH = 0xA8, + LL_VK_BROWSER_STOP = 0xA9, + LL_VK_BROWSER_SEARCH = 0xAA, + LL_VK_BROWSER_FAVORITES = 0xAB, + LL_VK_BROWSER_HOME = 0xAC, + LL_VK_VOLUME_MUTE = 0xAD, + LL_VK_VOLUME_DOWN = 0xAE, + LL_VK_VOLUME_UP = 0xAF, + LL_VK_MEDIA_NEXT_TRACK = 0xB0, + LL_VK_MEDIA_PREV_TRACK = 0xB1, + LL_VK_MEDIA_STOP = 0xB2, + LL_VK_MEDIA_PLAY_PAUSE = 0xB3, + LL_VK_MEDIA_LAUNCH_MAIL = 0xB4, + LL_VK_MEDIA_LAUNCH_MEDIA_SELECT = 0xB5, + LL_VK_MEDIA_LAUNCH_APP1 = 0xB6, + LL_VK_MEDIA_LAUNCH_APP2 = 0xB7, + LL_VK_OEM_1 = 0xBA, + LL_VK_OEM_PLUS = 0xBB, + LL_VK_OEM_COMMA = 0xBC, + LL_VK_OEM_MINUS = 0xBD, + LL_VK_OEM_PERIOD = 0xBE, + LL_VK_OEM_2 = 0xBF, + LL_VK_OEM_3 = 0xC0, + LL_VK_OEM_4 = 0xDB, + LL_VK_OEM_5 = 0xDC, + LL_VK_OEM_6 = 0xDD, + LL_VK_OEM_7 = 0xDE, + LL_VK_OEM_8 = 0xDF, + LL_VK_OEM_102 = 0xE2, + LL_VK_PROCESSKEY = 0xE5, + LL_VK_PACKET = 0xE7, + LL_VK_ATTN = 0xF6, + LL_VK_CRSEL = 0xF7, + LL_VK_EXSEL = 0xF8, + LL_VK_EREOF = 0xF9, + LL_VK_PLAY = 0xFA, + LL_VK_ZOOM = 0xFB, + LL_VK_NONAME = 0xFC, + LL_VK_PA1 = 0xFD, + LL_VK_OEM_CLEAR = 0xFE, +}; + +std::map< U32, U32 > mSDL2_to_Win; + +U32 LLKeyboardSDL::mapSDL2toWin( U32 aSymbol ) +{ + // Map SDLK_ virtual keys to Windows LL_VK_ virtual keys. + // Text is handled via unicode input (SDL_TEXTINPUT event) and does not need to be translated into LL_VK_ values as those match already. + if( mSDL2_to_Win.empty() ) + { + + mSDL2_to_Win[ SDLK_BACKSPACE ] = (U32)WindowsVK::LL_VK_BACK; + mSDL2_to_Win[ SDLK_TAB ] = (U32)WindowsVK::LL_VK_TAB; + mSDL2_to_Win[ 12 ] = (U32)WindowsVK::LL_VK_CLEAR; + mSDL2_to_Win[ SDLK_RETURN ] = (U32)WindowsVK::LL_VK_RETURN; + mSDL2_to_Win[ 19 ] = (U32)WindowsVK::LL_VK_PAUSE; + mSDL2_to_Win[ SDLK_ESCAPE ] = (U32)WindowsVK::LL_VK_ESCAPE; + mSDL2_to_Win[ SDLK_SPACE ] = (U32)WindowsVK::LL_VK_SPACE; + mSDL2_to_Win[ SDLK_APOSTROPHE ] = (U32)WindowsVK::LL_VK_OEM_7; + mSDL2_to_Win[ SDLK_COMMA ] = (U32)WindowsVK::LL_VK_OEM_COMMA; + mSDL2_to_Win[ SDLK_MINUS ] = (U32)WindowsVK::LL_VK_OEM_MINUS; + mSDL2_to_Win[ SDLK_PERIOD ] = (U32)WindowsVK::LL_VK_OEM_PERIOD; + mSDL2_to_Win[ SDLK_SLASH ] = (U32)WindowsVK::LL_VK_OEM_2; + + mSDL2_to_Win[ SDLK_0 ] = (U32)WindowsVK::LL_VK_0; + mSDL2_to_Win[ SDLK_1 ] = (U32)WindowsVK::LL_VK_1; + mSDL2_to_Win[ SDLK_2 ] = (U32)WindowsVK::LL_VK_2; + mSDL2_to_Win[ SDLK_3 ] = (U32)WindowsVK::LL_VK_3; + mSDL2_to_Win[ SDLK_4 ] = (U32)WindowsVK::LL_VK_4; + mSDL2_to_Win[ SDLK_5 ] = (U32)WindowsVK::LL_VK_5; + mSDL2_to_Win[ SDLK_6 ] = (U32)WindowsVK::LL_VK_6; + mSDL2_to_Win[ SDLK_7 ] = (U32)WindowsVK::LL_VK_7; + mSDL2_to_Win[ SDLK_8 ] = (U32)WindowsVK::LL_VK_8; + mSDL2_to_Win[ SDLK_9 ] = (U32)WindowsVK::LL_VK_9; + + mSDL2_to_Win[ SDLK_SEMICOLON ] = (U32)WindowsVK::LL_VK_OEM_1; + mSDL2_to_Win[ SDLK_LESS ] = (U32)WindowsVK::LL_VK_OEM_102; + mSDL2_to_Win[ SDLK_EQUALS ] = (U32)WindowsVK::LL_VK_OEM_PLUS; + mSDL2_to_Win[ SDLK_KP_EQUALS ] = (U32)WindowsVK::LL_VK_OEM_PLUS; + + mSDL2_to_Win[ SDLK_LEFTBRACKET ] = (U32)WindowsVK::LL_VK_OEM_4; + mSDL2_to_Win[ SDLK_BACKSLASH ] = (U32)WindowsVK::LL_VK_OEM_5; + mSDL2_to_Win[ SDLK_RIGHTBRACKET ] = (U32)WindowsVK::LL_VK_OEM_6; + mSDL2_to_Win[ SDLK_GRAVE ] = (U32)WindowsVK::LL_VK_OEM_8; + + mSDL2_to_Win[ SDLK_A ] = (U32)WindowsVK::LL_VK_A; + mSDL2_to_Win[ SDLK_B ] = (U32)WindowsVK::LL_VK_B; + mSDL2_to_Win[ SDLK_C ] = (U32)WindowsVK::LL_VK_C; + mSDL2_to_Win[ SDLK_D ] = (U32)WindowsVK::LL_VK_D; + mSDL2_to_Win[ SDLK_E ] = (U32)WindowsVK::LL_VK_E; + mSDL2_to_Win[ SDLK_F ] = (U32)WindowsVK::LL_VK_F; + mSDL2_to_Win[ SDLK_G ] = (U32)WindowsVK::LL_VK_G; + mSDL2_to_Win[ SDLK_H ] = (U32)WindowsVK::LL_VK_H; + mSDL2_to_Win[ SDLK_I ] = (U32)WindowsVK::LL_VK_I; + mSDL2_to_Win[ SDLK_J ] = (U32)WindowsVK::LL_VK_J; + mSDL2_to_Win[ SDLK_K ] = (U32)WindowsVK::LL_VK_K; + mSDL2_to_Win[ SDLK_L ] = (U32)WindowsVK::LL_VK_L; + mSDL2_to_Win[ SDLK_M ] = (U32)WindowsVK::LL_VK_M; + mSDL2_to_Win[ SDLK_N ] = (U32)WindowsVK::LL_VK_N; + mSDL2_to_Win[ SDLK_O ] = (U32)WindowsVK::LL_VK_O; + mSDL2_to_Win[ SDLK_P ] = (U32)WindowsVK::LL_VK_P; + mSDL2_to_Win[ SDLK_Q ] = (U32)WindowsVK::LL_VK_Q; + mSDL2_to_Win[ SDLK_R ] = (U32)WindowsVK::LL_VK_R; + mSDL2_to_Win[ SDLK_S ] = (U32)WindowsVK::LL_VK_S; + mSDL2_to_Win[ SDLK_T ] = (U32)WindowsVK::LL_VK_T; + mSDL2_to_Win[ SDLK_Y ] = (U32)WindowsVK::LL_VK_U; + mSDL2_to_Win[ SDLK_V ] = (U32)WindowsVK::LL_VK_V; + mSDL2_to_Win[ SDLK_W ] = (U32)WindowsVK::LL_VK_W; + mSDL2_to_Win[ SDLK_X ] = (U32)WindowsVK::LL_VK_X; + mSDL2_to_Win[ SDLK_Y ] = (U32)WindowsVK::LL_VK_Y; + mSDL2_to_Win[ SDLK_Z ] = (U32)WindowsVK::LL_VK_Z; + + mSDL2_to_Win[ SDLK_DELETE ] = (U32)WindowsVK::LL_VK_DELETE; + + + mSDL2_to_Win[ SDLK_NUMLOCKCLEAR ] = (U32)WindowsVK::LL_VK_NUMLOCK; + mSDL2_to_Win[ SDLK_SCROLLLOCK ] = (U32)WindowsVK::LL_VK_SCROLL; + + mSDL2_to_Win[ SDLK_HELP ] = (U32)WindowsVK::LL_VK_HELP; + mSDL2_to_Win[ SDLK_PRINTSCREEN ] = (U32)WindowsVK::LL_VK_SNAPSHOT; + mSDL2_to_Win[ SDLK_CANCEL ] = (U32)WindowsVK::LL_VK_CANCEL; + mSDL2_to_Win[ SDLK_APPLICATION ] = (U32)WindowsVK::LL_VK_APPS; + + mSDL2_to_Win[ SDLK_UNKNOWN ] = (U32)WindowsVK::LL_VK_UNKNOWN; + mSDL2_to_Win[ SDLK_BACKSPACE ] = (U32)WindowsVK::LL_VK_BACK; + mSDL2_to_Win[ SDLK_TAB ] = (U32)WindowsVK::LL_VK_TAB; + mSDL2_to_Win[ SDLK_CLEAR ] = (U32)WindowsVK::LL_VK_CLEAR; + mSDL2_to_Win[ SDLK_RETURN ] = (U32)WindowsVK::LL_VK_RETURN; + mSDL2_to_Win[ SDLK_PAUSE ] = (U32)WindowsVK::LL_VK_PAUSE; + mSDL2_to_Win[ SDLK_ESCAPE ] = (U32)WindowsVK::LL_VK_ESCAPE; + mSDL2_to_Win[ SDLK_DELETE ] = (U32)WindowsVK::LL_VK_DELETE; + + mSDL2_to_Win[ SDLK_KP_PERIOD ] = (U32)WindowsVK::LL_VK_DELETE; // LL_VK_DECIMAL? + mSDL2_to_Win[ SDLK_KP_DIVIDE ] = (U32)WindowsVK::LL_VK_DIVIDE; + mSDL2_to_Win[ SDLK_KP_MULTIPLY] = (U32)WindowsVK::LL_VK_MULTIPLY; + mSDL2_to_Win[ SDLK_KP_MINUS ] = (U32)WindowsVK::LL_VK_OEM_MINUS; // LL_VK_SUBSTRACT? + mSDL2_to_Win[ SDLK_KP_PLUS ] = (U32)WindowsVK::LL_VK_OEM_PLUS; // LL_VK_ADD? + mSDL2_to_Win[ SDLK_KP_ENTER ] = (U32)WindowsVK::LL_VK_RETURN; + mSDL2_to_Win[ SDLK_KP_0 ] = (U32)WindowsVK::LL_VK_INSERT; + mSDL2_to_Win[ SDLK_KP_1 ] = (U32)WindowsVK::LL_VK_END; + mSDL2_to_Win[ SDLK_KP_2 ] = (U32)WindowsVK::LL_VK_DOWN; + mSDL2_to_Win[ SDLK_KP_3 ] = (U32)WindowsVK::LL_VK_NEXT; + mSDL2_to_Win[ SDLK_KP_4 ] = (U32)WindowsVK::LL_VK_LEFT; + mSDL2_to_Win[ SDLK_KP_5 ] = (U32)WindowsVK::LL_VK_NUMPAD5; + mSDL2_to_Win[ SDLK_KP_6 ] = (U32)WindowsVK::LL_VK_RIGHT; + mSDL2_to_Win[ SDLK_KP_7 ] = (U32)WindowsVK::LL_VK_HOME; + mSDL2_to_Win[ SDLK_KP_8 ] = (U32)WindowsVK::LL_VK_UP; + mSDL2_to_Win[ SDLK_KP_9 ] = (U32)WindowsVK::LL_VK_PRIOR; + + // ? + + mSDL2_to_Win[ SDLK_UP ] = (U32)WindowsVK::LL_VK_UP; + mSDL2_to_Win[ SDLK_DOWN ] = (U32)WindowsVK::LL_VK_DOWN; + mSDL2_to_Win[ SDLK_RIGHT ] = (U32)WindowsVK::LL_VK_RIGHT; + mSDL2_to_Win[ SDLK_LEFT ] = (U32)WindowsVK::LL_VK_LEFT; + mSDL2_to_Win[ SDLK_INSERT ] = (U32)WindowsVK::LL_VK_INSERT; + mSDL2_to_Win[ SDLK_HOME ] = (U32)WindowsVK::LL_VK_HOME; + mSDL2_to_Win[ SDLK_END ] = (U32)WindowsVK::LL_VK_END; + mSDL2_to_Win[ SDLK_PAGEUP ] = (U32)WindowsVK::LL_VK_PRIOR; + mSDL2_to_Win[ SDLK_PAGEDOWN ] = (U32)WindowsVK::LL_VK_NEXT; + mSDL2_to_Win[ SDLK_F1 ] = (U32)WindowsVK::LL_VK_F1; + mSDL2_to_Win[ SDLK_F2 ] = (U32)WindowsVK::LL_VK_F2; + mSDL2_to_Win[ SDLK_F3 ] = (U32)WindowsVK::LL_VK_F3; + mSDL2_to_Win[ SDLK_F4 ] = (U32)WindowsVK::LL_VK_F4; + mSDL2_to_Win[ SDLK_F5 ] = (U32)WindowsVK::LL_VK_F5; + mSDL2_to_Win[ SDLK_F6 ] = (U32)WindowsVK::LL_VK_F6; + mSDL2_to_Win[ SDLK_F7 ] = (U32)WindowsVK::LL_VK_F7; + mSDL2_to_Win[ SDLK_F8 ] = (U32)WindowsVK::LL_VK_F8; + mSDL2_to_Win[ SDLK_F9 ] = (U32)WindowsVK::LL_VK_F9; + mSDL2_to_Win[ SDLK_F10 ] = (U32)WindowsVK::LL_VK_F10; + mSDL2_to_Win[ SDLK_F11 ] = (U32)WindowsVK::LL_VK_F11; + mSDL2_to_Win[ SDLK_F12 ] = (U32)WindowsVK::LL_VK_F12; + mSDL2_to_Win[ SDLK_F13 ] = (U32)WindowsVK::LL_VK_F13; + mSDL2_to_Win[ SDLK_F14 ] = (U32)WindowsVK::LL_VK_F14; + mSDL2_to_Win[ SDLK_F15 ] = (U32)WindowsVK::LL_VK_F15; + mSDL2_to_Win[ SDLK_CAPSLOCK ] = (U32)WindowsVK::LL_VK_CAPITAL; + mSDL2_to_Win[ SDLK_RSHIFT ] = (U32)WindowsVK::LL_VK_SHIFT; + mSDL2_to_Win[ SDLK_LSHIFT ] = (U32)WindowsVK::LL_VK_SHIFT; + mSDL2_to_Win[ SDLK_RCTRL ] = (U32)WindowsVK::LL_VK_CONTROL; + mSDL2_to_Win[ SDLK_LCTRL ] = (U32)WindowsVK::LL_VK_CONTROL; + mSDL2_to_Win[ SDLK_RALT ] = (U32)WindowsVK::LL_VK_MENU; + mSDL2_to_Win[ SDLK_LALT ] = (U32)WindowsVK::LL_VK_MENU; + + mSDL2_to_Win[ SDLK_MENU ] = (U32)WindowsVK::LL_VK_MENU; + + // LL_VK_MODECHANGE ? + // mSDL2_to_Win[ SDLK_MODE ] = (U32)WindowsVK::LL_VK_MODE; + + // ? + // mSDL2_to_Win[ SDLK_SYSREQ ] = (U32)WindowsVK::LL_VK_SYSREQ; + // mSDL2_to_Win[ SDLK_POWER ] = (U32)WindowsVK::LL_VK_POWER; + // mSDL2_to_Win[ SDLK_UNDO ] = (U32)WindowsVK::LL_VK_UNDO; + // mSDL2_to_Win[ SDLK_KP_EQUALS ] = (U32)WindowsVK::LL_VK_EQUALS; + // mSDL2_to_Win[ 311 ] = (U32)WindowsVK::LL_VK_LWIN; + // mSDL2_to_Win[ 312 ] = (U32)WindowsVK::LL_VK_RWIN; + // mSDL2_to_Win[ SDLK_COLON ] = ? + } + auto itr = mSDL2_to_Win.find( aSymbol ); + if( itr != mSDL2_to_Win.end() ) + return itr->second; + + return aSymbol; +} diff --git a/indra/llwindow/llkeyboardsdl.h b/indra/llwindow/llkeyboardsdl.h index fd348b28f2a..f23b4cca6c7 100644 --- a/indra/llwindow/llkeyboardsdl.h +++ b/indra/llwindow/llkeyboardsdl.h @@ -28,28 +28,31 @@ #define LL_LLKEYBOARDSDL_H #include "llkeyboard.h" -#include "SDL/SDL.h" +#include "SDL3/SDL.h" class LLKeyboardSDL : public LLKeyboard { public: LLKeyboardSDL(); - /*virtual*/ ~LLKeyboardSDL() {}; + ~LLKeyboardSDL() = default; - /*virtual*/ bool handleKeyUp(const U16 key, MASK mask); - /*virtual*/ bool handleKeyDown(const U16 key, MASK mask); - /*virtual*/ void resetMaskKeys(); - /*virtual*/ MASK currentMask(bool for_mouse_event); - /*virtual*/ void scanKeyboard(); + bool handleKeyUp(const LLKeyboard::NATIVE_KEY_TYPE key, MASK mask) override; + bool handleKeyDown(const LLKeyboard::NATIVE_KEY_TYPE key, MASK mask) override; + void resetMaskKeys() override; + MASK currentMask(bool for_mouse_event) override; + void scanKeyboard() override; protected: - MASK updateModifiers(const U32 mask); + MASK updateModifiers(const MASK mask); void setModifierKeyLevel( KEY key, bool new_state ); - bool translateNumpadKey( const U16 os_key, KEY *translated_key ); - U16 inverseTranslateNumpadKey(const KEY translated_key); + bool translateNumpadKey( const LLKeyboard::NATIVE_KEY_TYPE os_key, KEY *translated_key ); + LLKeyboard::NATIVE_KEY_TYPE inverseTranslateNumpadKey(const KEY translated_key); private: - std::map mTranslateNumpadMap; // special map for translating OS keys to numpad keys - std::map mInvTranslateNumpadMap; // inverse of the above + std::map mTranslateNumpadMap; // special map for translating OS keys to numpad keys + std::map mInvTranslateNumpadMap; // inverse of the above + +public: + static U32 mapSDL2toWin( U32 ); }; #endif diff --git a/indra/llwindow/llkeyboardwin32.cpp b/indra/llwindow/llkeyboardwin32.cpp index 8d6b8d9b93d..4ef0b493a57 100644 --- a/indra/llwindow/llkeyboardwin32.cpp +++ b/indra/llwindow/llkeyboardwin32.cpp @@ -197,7 +197,7 @@ MASK LLKeyboardWin32::updateModifiers() // mask is ignored, except for extended flag -- we poll the modifier keys for the other flags -bool LLKeyboardWin32::handleKeyDown(const U16 key, MASK mask) +bool LLKeyboardWin32::handleKeyDown(const LLKeyboard::NATIVE_KEY_TYPE key, MASK mask) { KEY translated_key; U32 translated_mask; @@ -214,7 +214,7 @@ bool LLKeyboardWin32::handleKeyDown(const U16 key, MASK mask) } // mask is ignored, except for extended flag -- we poll the modifier keys for the other flags -bool LLKeyboardWin32::handleKeyUp(const U16 key, MASK mask) +bool LLKeyboardWin32::handleKeyUp(const LLKeyboard::NATIVE_KEY_TYPE key, MASK mask) { KEY translated_key; U32 translated_mask; diff --git a/indra/llwindow/llkeyboardwin32.h b/indra/llwindow/llkeyboardwin32.h index d0dfc5cfdd3..fa223a29048 100644 --- a/indra/llwindow/llkeyboardwin32.h +++ b/indra/llwindow/llkeyboardwin32.h @@ -37,15 +37,16 @@ class LLKeyboardWin32 : public LLKeyboard { public: LLKeyboardWin32(); - /*virtual*/ ~LLKeyboardWin32() {}; - - /*virtual*/ bool handleKeyUp(const U16 key, MASK mask); - /*virtual*/ bool handleKeyDown(const U16 key, MASK mask); - /*virtual*/ void resetMaskKeys(); - /*virtual*/ MASK currentMask(bool for_mouse_event); - /*virtual*/ void scanKeyboard(); - bool translateExtendedKey(const U16 os_key, const MASK mask, KEY *translated_key); - U16 inverseTranslateExtendedKey(const KEY translated_key); + ~LLKeyboardWin32() = default; + + bool handleKeyUp(const LLKeyboard::NATIVE_KEY_TYPE key, MASK mask) override; + bool handleKeyDown(const LLKeyboard::NATIVE_KEY_TYPE key, MASK mask) override; + void resetMaskKeys() override; + MASK currentMask(bool for_mouse_event) override; + void scanKeyboard() override; + + bool translateExtendedKey(const U16 os_key, const MASK mask, KEY *translated_key); + U16 inverseTranslateExtendedKey(const KEY translated_key); protected: MASK updateModifiers(); diff --git a/indra/llwindow/llmousehandler.cpp b/indra/llwindow/llmousehandler.cpp index eeceab502ac..959dde70b40 100644 --- a/indra/llwindow/llmousehandler.cpp +++ b/indra/llwindow/llmousehandler.cpp @@ -24,6 +24,8 @@ * $/LicenseInfo$ */ +#include "linden_common.h" + #include "llmousehandler.h" //virtual diff --git a/indra/llwindow/llsdl.cpp b/indra/llwindow/llsdl.cpp new file mode 100644 index 00000000000..1df9f38a6dd --- /dev/null +++ b/indra/llwindow/llsdl.cpp @@ -0,0 +1,149 @@ +/** + * @file llsdl.cpp + * @brief SDL2 initialization + * + * $LicenseInfo:firstyear=2007&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 +#include + +#include "SDL3/SDL.h" + +#ifndef LL_SDL_APP +#define SDL_MAIN_HANDLED 1 +#include "SDL3/SDL_main.h" +#endif + +#include "llerror.h" +#include "llwindow.h" + +bool gSDLMainHandled = false; + +void sdl_logger(void *userdata, int category, SDL_LogPriority priority, const char *message) +{ + switch (priority) + { + case SDL_LOG_PRIORITY_TRACE: + case SDL_LOG_PRIORITY_VERBOSE: + case SDL_LOG_PRIORITY_DEBUG: + LL_DEBUGS("SDL") << "log='" << message << "'" << LL_ENDL; + break; + case SDL_LOG_PRIORITY_INFO: + LL_INFOS("SDL") << "log='" << message << "'" << LL_ENDL; + break; + case SDL_LOG_PRIORITY_WARN: + case SDL_LOG_PRIORITY_ERROR: + case SDL_LOG_PRIORITY_CRITICAL: + LL_WARNS("SDL") << "log='" << message << "'" << LL_ENDL; + break; + case SDL_LOG_PRIORITY_INVALID: + default: + break; + } +} + +void init_sdl(const std::string& app_name) +{ +#ifndef LL_SDL_APP + if (!gSDLMainHandled) + { + SDL_SetMainReady(); + } +#endif + + SDL_SetLogOutputFunction(&sdl_logger, nullptr); + + const int c_sdl_version = SDL_VERSION; + LL_INFOS() << "Compiled against SDL " + << SDL_VERSIONNUM_MAJOR(c_sdl_version) << "." + << SDL_VERSIONNUM_MINOR(c_sdl_version) << "." + << SDL_VERSIONNUM_MICRO(c_sdl_version) << LL_ENDL; + const int r_sdl_version = SDL_GetVersion(); + LL_INFOS() << "Running with SDL " + << SDL_VERSIONNUM_MAJOR(r_sdl_version) << "." + << SDL_VERSIONNUM_MINOR(r_sdl_version) << "." + << SDL_VERSIONNUM_MICRO(r_sdl_version) << LL_ENDL; + +#if LL_WINDOWS && defined(LL_SDL_WINDOW) + Uint32 style = 0; +#if defined(CS_BYTEALIGNCLIENT) && defined(CS_OWNDC) + style = (CS_BYTEALIGNCLIENT | CS_OWNDC); +#endif + SDL_RegisterApp(app_name.c_str(), style, nullptr); +#endif + +#if LL_SDL_WINDOW + // For linux we SDL_INIT_VIDEO and _AUDIO + std::initializer_list > hintList = + { + {SDL_HINT_VIDEO_X11_NET_WM_BYPASS_COMPOSITOR,"0"}, + {SDL_HINT_MOUSE_FOCUS_CLICKTHROUGH,"1"}, + {SDL_HINT_MOUSE_EMULATE_WARP_WITH_RELATIVE,"0"}, + {SDL_HINT_MOUSE_RELATIVE_WARP_MOTION,"1"}, + {SDL_HINT_KEYCODE_OPTIONS,"french_numbers,latin_letters"} + }; + + for (auto hint: hintList) + { + SDL_SetHint(std::get<0>(hint), std::get<1>(hint)); + } + + std::initializer_list> initList= + { + {SDL_INIT_VIDEO,"SDL_INIT_VIDEO", true}, + {SDL_INIT_JOYSTICK,"SDL_INIT_JOYSTICK", true}, + {SDL_INIT_GAMEPAD,"SDL_INIT_GAMEPAD", true}, + }; +#else + // For non-linux platforms we still SDL_INIT_VIDEO because it is a pre-requisite + // for SDL_INIT_GAMECONTROLLER. + std::initializer_list> initList= + { + {SDL_INIT_VIDEO,"SDL_INIT_VIDEO", false}, + }; +#endif // LL_LINUX + // We SDL_INIT_GAMECONTROLLER later in the startup process to make it + // more likely we'll catch initial SDL_CONTROLLERDEVICEADDED events. + + for (auto subSystem : initList) + { + if (!SDL_InitSubSystem(std::get<0>(subSystem))) + { + LL_WARNS() << "SDL_InitSubSystem for " << std::get<1>(subSystem) << " failed " << SDL_GetError() << LL_ENDL; + + if (std::get<2>(subSystem)) + { + OSMessageBox("SDL_Init() failure", "error", OSMB_OK); + return; + } + } + } +} + +void quit_sdl() +{ +#if LL_WINDOWS && defined(LL_SDL_WINDOW) + SDL_UnregisterApp(); +#endif + SDL_Quit(); +} diff --git a/indra/media_plugins/gstreamer010/llmediaimplgstreamer.h b/indra/llwindow/llsdl.h similarity index 61% rename from indra/media_plugins/gstreamer010/llmediaimplgstreamer.h rename to indra/llwindow/llsdl.h index cae11a5cb31..1a8a12c61c7 100644 --- a/indra/media_plugins/gstreamer010/llmediaimplgstreamer.h +++ b/indra/llwindow/llsdl.h @@ -1,9 +1,7 @@ /** - * @file llmediaimplgstreamer.h - * @author Tofu Linden - * @brief implementation that supports media playback via GStreamer. + * @file llsdl.h + * @brief SDL2 initialization * - * @cond * $LicenseInfo:firstyear=2007&license=viewerlgpl$ * Second Life Viewer Source Code * Copyright (C) 2010, Linden Research, Inc. @@ -24,30 +22,13 @@ * * Linden Research, Inc., 945 Battery Street, San Francisco, CA 94111 USA * $/LicenseInfo$ - * @endcond */ -// header guard -#ifndef llmediaimplgstreamer_h -#define llmediaimplgstreamer_h +#pragma once -#if LL_GSTREAMER010_ENABLED +#include "llpreprocessor.h" -extern "C" { -#include -#include +extern bool gSDLMainHandled; -#include "apr_pools.h" -#include "apr_dso.h" -} - - -extern "C" { -gboolean llmediaimplgstreamer_bus_callback (GstBus *bus, - GstMessage *message, - gpointer data); -} - -#endif // LL_GSTREAMER010_ENABLED - -#endif // llmediaimplgstreamer_h +void init_sdl(const std::string& app_name); +void quit_sdl(); diff --git a/indra/llwindow/llwindow.cpp b/indra/llwindow/llwindow.cpp index eb11a283602..2313aeda50c 100644 --- a/indra/llwindow/llwindow.cpp +++ b/indra/llwindow/llwindow.cpp @@ -29,7 +29,7 @@ #if LL_MESA_HEADLESS #include "llwindowmesaheadless.h" -#elif LL_SDL +#elif LL_SDL_WINDOW #include "llwindowsdl.h" #elif LL_WINDOWS #include "llwindowwin32.h" @@ -39,6 +39,9 @@ #include "llerror.h" #include "llkeyboard.h" +#if LL_SDL_WINDOW && !defined(LL_MESA_HEADLESS) +#include "llsdl.h" +#endif #include "llwindowcallbacks.h" @@ -74,14 +77,15 @@ S32 OSMessageBox(const std::string& text, const std::string& caption, U32 type) LL_WARNS() << "OSMessageBox: " << text << LL_ENDL; #if LL_MESA_HEADLESS // !!! *FIX: (?) return OSBTN_OK; +#elif LL_SDL_WINDOW + result = OSMessageBoxSDL(text, caption, type); #elif LL_WINDOWS result = OSMessageBoxWin32(text, caption, type); #elif LL_DARWIN result = OSMessageBoxMacOSX(text, caption, type); -#elif LL_SDL - result = OSMessageBoxSDL(text, caption, type); #else -#error("OSMessageBox not implemented for this platform!") + LL_WARNS() << "OSMessageBox not implemented for this platform!" << LL_ENDL; + return OSBTN_OK; #endif if (was_visible) @@ -182,12 +186,6 @@ bool LLWindow::dialogColorPicker(F32 *r, F32 *g, F32 *b) return false; } -void *LLWindow::getMediaWindow() -{ - // Default to returning the platform window. - return getPlatformWindow(); -} - bool LLWindow::setSize(LLCoordScreen size) { if (!getMaximized()) @@ -258,12 +256,12 @@ bool LLWindow::copyTextToPrimary(const LLWString &src) // static std::vector LLWindow::getDynamicFallbackFontList() { -#if LL_WINDOWS +#if LL_SDL_WINDOW && !LL_MESA_HEADLESS + return LLWindowSDL::getDynamicFallbackFontList(); +#elif LL_WINDOWS return LLWindowWin32::getDynamicFallbackFontList(); #elif LL_DARWIN return LLWindowMacOSX::getDynamicFallbackFontList(); -#elif LL_SDL - return LLWindowSDL::getDynamicFallbackFontList(); #else return std::vector(); #endif @@ -272,7 +270,9 @@ std::vector LLWindow::getDynamicFallbackFontList() // static std::vector LLWindow::getDisplaysResolutionList() { -#if LL_WINDOWS +#if LL_SDL_WINDOW && !LL_MESA_HEADLESS + return LLWindowSDL::getDisplaysResolutionList(); +#elif LL_WINDOWS return LLWindowWin32::getDisplaysResolutionList(); #elif LL_DARWIN return LLWindowMacOSX::getDisplaysResolutionList(); @@ -341,14 +341,17 @@ bool LLSplashScreen::isVisible() // static LLSplashScreen *LLSplashScreen::create() { -#if LL_MESA_HEADLESS || LL_SDL // !!! *FIX: (?) - return 0; +#if LL_MESA_HEADLESS + return nullptr; +#elif LL_SDL_WINDOW + return new LLSplashScreenSDL; #elif LL_WINDOWS return new LLSplashScreenWin32; #elif LL_DARWIN return new LLSplashScreenMacOSX; #else -#error("LLSplashScreen not implemented on this platform!") + LL_WARNS() << ("LLSplashScreen not implemented on this platform!") << LL_ENDL; + return nullptr; #endif } @@ -358,7 +361,9 @@ void LLSplashScreen::show() { if (!gSplashScreenp) { -#if LL_WINDOWS && !LL_MESA_HEADLESS +#if LL_SDL_WINDOW && !LL_MESA_HEADLESS + gSplashScreenp = new LLSplashScreenSDL; +#elif LL_WINDOWS && !LL_MESA_HEADLESS gSplashScreenp = new LLSplashScreenWin32; #elif LL_DARWIN gSplashScreenp = new LLSplashScreenMacOSX; @@ -412,15 +417,19 @@ LLWindow* LLWindowManager::createWindow( { LLWindow* new_window; +#if LL_SDL_WINDOW && !defined(LL_MESA_HEADLESS) + init_sdl(name); +#endif + if (use_gl) { #if LL_MESA_HEADLESS new_window = new LLWindowMesaHeadless(callbacks, title, name, x, y, width, height, flags, fullscreen, clearBg, enable_vsync, use_gl, ignore_pixel_depth); -#elif LL_SDL +#elif LL_SDL_WINDOW new_window = new LLWindowSDL(callbacks, - title, x, y, width, height, flags, + title, name, x, y, width, height, flags, fullscreen, clearBg, enable_vsync, use_gl, ignore_pixel_depth, fsaa_samples); #elif LL_WINDOWS new_window = new LLWindowWin32(callbacks, @@ -461,6 +470,9 @@ bool LLWindowManager::destroyWindow(LLWindow* window) window->close(); sWindowList.erase(window); +#if LL_SDL_WINDOW && !defined(LL_MESA_HEADLESS) + quit_sdl(); +#endif delete window; diff --git a/indra/llwindow/llwindow.h b/indra/llwindow/llwindow.h index 7a5404e6154..2d8fc80b9ea 100644 --- a/indra/llwindow/llwindow.h +++ b/indra/llwindow/llwindow.h @@ -92,7 +92,7 @@ class LLWindow : public LLInstanceTracker virtual bool setCursorPosition(LLCoordWindow position) = 0; virtual bool getCursorPosition(LLCoordWindow *position) = 0; -#if LL_WINDOWS +#if LL_WINDOWS && !LL_SDL_WINDOW virtual bool getCursorDelta(LLCoordCommon* delta) = 0; #endif virtual bool isWrapMouse() const = 0; @@ -174,9 +174,6 @@ class LLWindow : public LLInstanceTracker // return a platform-specific window reference (HWND on Windows, WindowRef on the Mac, Gtk window on Linux) virtual void *getPlatformWindow() = 0; -// return the platform-specific window reference we use to initialize llmozlib (HWND on Windows, WindowRef on the Mac, Gtk window on Linux) - virtual void *getMediaWindow(); - // control platform's Language Text Input mechanisms. virtual void allowLanguageTextInput(LLPreeditor *preeditor, bool b) {} virtual void setLanguageTextInput( const LLCoordGL & pos ) {}; diff --git a/indra/llwindow/llwindowheadless.h b/indra/llwindow/llwindowheadless.h index dc7b833013d..8b7b0ef55c6 100644 --- a/indra/llwindow/llwindowheadless.h +++ b/indra/llwindow/llwindowheadless.h @@ -60,7 +60,7 @@ class LLWindowHeadless : public LLWindow /*virtual*/ void toggleVSync(bool enable_vsync) override { } /*virtual*/ bool setCursorPosition(LLCoordWindow position) override {return false;} /*virtual*/ bool getCursorPosition(LLCoordWindow *position) override {return false;} -#if LL_WINDOWS +#if LL_WINDOWS && !LL_SDL_WINDOW /*virtual*/ bool getCursorDelta(LLCoordCommon* delta) override { return false; } #endif /*virtual*/ bool isWrapMouse() const override { return true; } diff --git a/indra/llwindow/llwindowmacosx.cpp b/indra/llwindow/llwindowmacosx.cpp index e37fe116711..f8920318d31 100644 --- a/indra/llwindow/llwindowmacosx.cpp +++ b/indra/llwindow/llwindowmacosx.cpp @@ -1259,9 +1259,6 @@ bool LLWindowMacOSX::setCursorPosition(const LLCoordWindow position) // trigger mouse move callback LLCoordGL gl_pos; convertCoords(position, &gl_pos); - float scale = getSystemUISize(); - gl_pos.mX *= scale; - gl_pos.mY *= scale; mCallbacks->handleMouseMove(this, gl_pos, (MASK)0); return result; diff --git a/indra/llwindow/llwindowmesaheadless.h b/indra/llwindow/llwindowmesaheadless.h index 0bf8c46a30b..47cd6320b1e 100644 --- a/indra/llwindow/llwindowmesaheadless.h +++ b/indra/llwindow/llwindowmesaheadless.h @@ -30,70 +30,75 @@ #if LL_MESA_HEADLESS #include "llwindow.h" -#include "GL/glu.h" #include "GL/osmesa.h" class LLWindowMesaHeadless : public LLWindow { public: - /*virtual*/ void show() {}; - /*virtual*/ void hide() {}; - /*virtual*/ void close() {}; - /*virtual*/ bool getVisible() {return false;}; - /*virtual*/ bool getMinimized() {return false;}; - /*virtual*/ bool getMaximized() {return false;}; - /*virtual*/ bool maximize() {return false;}; - /*virtual*/ void minimize() {}; - /*virtual*/ void restore() {}; - /*virtual*/ bool getFullscreen() {return false;}; - /*virtual*/ bool getPosition(LLCoordScreen *position) {return false;}; - /*virtual*/ bool getSize(LLCoordScreen *size) {return false;}; - /*virtual*/ bool getSize(LLCoordWindow *size) {return false;}; - /*virtual*/ bool setPosition(LLCoordScreen position) {return false;}; - /*virtual*/ bool setSizeImpl(LLCoordScreen size) {return false;}; - /*virtual*/ bool switchContext(bool fullscreen, const LLCoordScreen &size, bool disable_vsync, const LLCoordScreen * const posp = NULL) {return false;}; - /*virtual*/ bool setCursorPosition(LLCoordWindow position) {return false;}; - /*virtual*/ bool getCursorPosition(LLCoordWindow *position) {return false;}; - /*virtual*/ void showCursor() {}; - /*virtual*/ void hideCursor() {}; - /*virtual*/ void showCursorFromMouseMove() {}; - /*virtual*/ void hideCursorUntilMouseMove() {}; - /*virtual*/ bool isCursorHidden() {return false;}; - /*virtual*/ void updateCursor() {}; - //virtual ECursorType getCursor() { return mCurrentCursor; }; - /*virtual*/ void captureMouse() {}; - /*virtual*/ void releaseMouse() {}; - /*virtual*/ void setMouseClipping( bool b ) {}; - /*virtual*/ bool isClipboardTextAvailable() {return false; }; - /*virtual*/ bool pasteTextFromClipboard(LLWString &dst) {return false; }; - /*virtual*/ bool copyTextToClipboard(const LLWString &src) {return false; }; - /*virtual*/ void flashIcon(F32 seconds) {}; - /*virtual*/ F32 getGamma() {return 1.0f; }; - /*virtual*/ bool setGamma(const F32 gamma) {return false; }; // Set the gamma - /*virtual*/ bool restoreGamma() {return false; }; // Restore original gamma table (before updating gamma) - /*virtual*/ void setFSAASamples(const U32 fsaa_samples) { /* FSAA not supported yet on Mesa headless.*/ } - /*virtual*/ U32 getFSAASamples() { return 0; } - //virtual ESwapMethod getSwapMethod() { return mSwapMethod; } - /*virtual*/ void gatherInput() {}; - /*virtual*/ void delayInputProcessing() {}; - /*virtual*/ void swapBuffers(); - /*virtual*/ void restoreGLContext() {}; + void show() override {}; + void hide() override {}; + void close() override {}; + bool getVisible() override {return false;}; + bool getMinimized() override {return false;}; + bool getMaximized() override {return false;}; + bool maximize() override {return false;}; + void minimize() override {}; + void restore() override {}; + bool getFullscreen() {return false;}; + bool getPosition(LLCoordScreen *position) override {return false;}; + bool getSize(LLCoordScreen *size) override {return false;}; + bool getSize(LLCoordWindow *size) override {return false;}; + bool setPosition(LLCoordScreen position) override {return false;}; + bool setSizeImpl(LLCoordScreen size) override {return false;}; + bool switchContext(bool fullscreen, const LLCoordScreen &size, bool disable_vsync, const LLCoordScreen * const posp = NULL) override {return false;}; + bool setCursorPosition(LLCoordWindow position) override {return false;}; + bool getCursorPosition(LLCoordWindow *position) override {return false;}; + bool isWrapMouse() const override { return true; } + void showCursor() override {}; + void hideCursor() override {}; + void showCursorFromMouseMove() override {}; + void hideCursorUntilMouseMove() override {}; + bool isCursorHidden() override {return false;}; + void updateCursor() override {}; + //virtual ECursorType getCursor() override { return mCurrentCursor; }; + void captureMouse() override {}; + void releaseMouse() override {}; + void setMouseClipping( bool b ) override {}; + bool isClipboardTextAvailable() override {return false; }; + bool pasteTextFromClipboard(LLWString &dst) override {return false; }; + bool copyTextToClipboard(const LLWString &src) override {return false; }; + void flashIcon(F32 seconds) override {}; + F32 getGamma() override {return 1.0f; }; + bool setGamma(const F32 gamma) override {return false; }; // Set the gamma + bool restoreGamma() override {return false; }; // Restore original gamma table (before updating gamma) + void setFSAASamples(const U32 fsaa_samples) override { /* FSAA not supported yet on Mesa headless.*/ } + U32 getFSAASamples() override { return 0; } + //virtual ESwapMethod getSwapMethod() override { return mSwapMethod; } + void gatherInput() override {}; + void delayInputProcessing() override {}; + void swapBuffers() override; + + void* createSharedContext()override{return nullptr;}; + void makeContextCurrent(void* context)override{}; + void destroySharedContext(void* context)override{}; + void toggleVSync(bool enable_vsync) override {}; + bool setSizeImpl(LLCoordWindow size) override { return false; }; // handy coordinate space conversion routines - /*virtual*/ bool convertCoords(LLCoordScreen from, LLCoordWindow *to) { return false; }; - /*virtual*/ bool convertCoords(LLCoordWindow from, LLCoordScreen *to) { return false; }; - /*virtual*/ bool convertCoords(LLCoordWindow from, LLCoordGL *to) { return false; }; - /*virtual*/ bool convertCoords(LLCoordGL from, LLCoordWindow *to) { return false; }; - /*virtual*/ bool convertCoords(LLCoordScreen from, LLCoordGL *to) { return false; }; - /*virtual*/ bool convertCoords(LLCoordGL from, LLCoordScreen *to) { return false; }; + bool convertCoords(LLCoordScreen from, LLCoordWindow *to) override { return false; }; + bool convertCoords(LLCoordWindow from, LLCoordScreen *to) override { return false; }; + bool convertCoords(LLCoordWindow from, LLCoordGL *to) override { return false; }; + bool convertCoords(LLCoordGL from, LLCoordWindow *to) override { return false; }; + bool convertCoords(LLCoordScreen from, LLCoordGL *to) override { return false; }; + bool convertCoords(LLCoordGL from, LLCoordScreen *to) override { return false; }; - /*virtual*/ LLWindowResolution* getSupportedResolutions(S32 &num_resolutions) { return NULL; }; - /*virtual*/ F32 getNativeAspectRatio() { return 1.0f; }; - /*virtual*/ F32 getPixelAspectRatio() { return 1.0f; }; - /*virtual*/ void setNativeAspectRatio(F32 ratio) {} + LLWindowResolution* getSupportedResolutions(S32 &num_resolutions) override { return NULL; }; + F32 getNativeAspectRatio() override { return 1.0f; }; + F32 getPixelAspectRatio() override { return 1.0f; }; + void setNativeAspectRatio(F32 ratio) override {} - /*virtual*/ void *getPlatformWindow() { return 0; }; - /*virtual*/ void bringToFront() {}; + void *getPlatformWindow() override { return 0; }; + void bringToFront() override {}; LLWindowMesaHeadless(LLWindowCallbacks* callbacks, const std::string& title, const std::string& name, S32 x, S32 y, S32 width, S32 height, @@ -112,9 +117,9 @@ class LLSplashScreenMesaHeadless : public LLSplashScreen LLSplashScreenMesaHeadless() {}; virtual ~LLSplashScreenMesaHeadless() {}; - /*virtual*/ void showImpl() {}; - /*virtual*/ void updateImpl(const std::string& mesg) {}; - /*virtual*/ void hideImpl() {}; + void showImpl() override {}; + void updateImpl(const std::string& mesg) override {}; + void hideImpl() override {}; }; diff --git a/indra/llwindow/llwindowsdl.cpp b/indra/llwindow/llwindowsdl.cpp index 05be319c0b3..3fc0257a7fd 100644 --- a/indra/llwindow/llwindowsdl.cpp +++ b/indra/llwindow/llwindowsdl.cpp @@ -25,8 +25,6 @@ * $/LicenseInfo$ */ -#if LL_SDL - #include "linden_common.h" #include "llwindowsdl.h" @@ -39,197 +37,84 @@ #include "llstring.h" #include "lldir.h" #include "llfindlocale.h" +#include "llpreeditor.h" +#include "llsdl.h" -#if LL_GTK -extern "C" { -# include "gtk/gtk.h" -} -#include -#endif // LL_GTK +#if LL_LINUX +#ifdef LL_GLIB +#include +#endif extern "C" { # include "fontconfig/fontconfig.h" } -#if LL_LINUX // not necessarily available on random SDL platforms, so #if LL_LINUX // for execv(), waitpid(), fork() -# include -# include -# include +#include +#include +#include +#include + +#if LL_X11 +LLWindowSDL::X11_DATA LLWindowSDL::sX11Data = {}; +#endif +#if LL_WAYLAND +LLWindowSDL::WAYLAND_DATA LLWindowSDL::sWaylandData = {}; +#endif #endif // LL_LINUX -extern bool gDebugWindowProc; +#if LL_DARWIN +#include +#include +#include +#include -const S32 MAX_NUM_RESOLUTIONS = 200; +bool LLWindowSDL::sUseMultGL = false; +#endif -// static variable for ATI mouse cursor crash work-around: -static bool ATIbug = false; +bool gHiDPISupport = true; + +const S32 MAX_NUM_RESOLUTIONS = 200; +const S32 DEFAULT_REFRESH_RATE = 60; // // LLWindowSDL // -#if LL_X11 -# include -#endif //LL_X11 - // TOFU HACK -- (*exactly* the same hack as LLWindowMacOSX for a similar // set of reasons): Stash a pointer to the LLWindowSDL object here and // maintain in the constructor and destructor. This assumes that there will // be only one object of this class at any time. Currently this is true. -static LLWindowSDL *gWindowImplementation = NULL; - - -void maybe_lock_display(void) -{ - if (gWindowImplementation && gWindowImplementation->Lock_Display) { - gWindowImplementation->Lock_Display(); - } -} - - -void maybe_unlock_display(void) -{ - if (gWindowImplementation && gWindowImplementation->Unlock_Display) { - gWindowImplementation->Unlock_Display(); - } -} - - -#if LL_GTK -// Lazily initialize and check the runtime GTK version for goodness. -// static -bool LLWindowSDL::ll_try_gtk_init(void) -{ - static bool done_gtk_diag = false; - static bool gtk_is_good = false; - static bool done_setlocale = false; - static bool tried_gtk_init = false; - - if (!done_setlocale) - { - LL_INFOS() << "Starting GTK Initialization." << LL_ENDL; - maybe_lock_display(); - gtk_disable_setlocale(); - maybe_unlock_display(); - done_setlocale = true; - } - - if (!tried_gtk_init) - { - tried_gtk_init = true; - if (!g_thread_supported ()) g_thread_init (NULL); - maybe_lock_display(); - gtk_is_good = gtk_init_check(NULL, NULL); - maybe_unlock_display(); - if (!gtk_is_good) - LL_WARNS() << "GTK Initialization failed." << LL_ENDL; - } - - if (gtk_is_good && !done_gtk_diag) - { - LL_INFOS() << "GTK Initialized." << LL_ENDL; - LL_INFOS() << "- Compiled against GTK version " - << GTK_MAJOR_VERSION << "." - << GTK_MINOR_VERSION << "." - << GTK_MICRO_VERSION << LL_ENDL; - LL_INFOS() << "- Running against GTK version " - << gtk_major_version << "." - << gtk_minor_version << "." - << gtk_micro_version << LL_ENDL; - maybe_lock_display(); - const gchar* gtk_warning = gtk_check_version( - GTK_MAJOR_VERSION, - GTK_MINOR_VERSION, - GTK_MICRO_VERSION); - maybe_unlock_display(); - if (gtk_warning) - { - LL_WARNS() << "- GTK COMPATIBILITY WARNING: " << - gtk_warning << LL_ENDL; - gtk_is_good = false; - } else { - LL_INFOS() << "- GTK version is good." << LL_ENDL; - } - - done_gtk_diag = true; - } - - return gtk_is_good; -} -#endif // LL_GTK - - -#if LL_X11 -// static -Window LLWindowSDL::get_SDL_XWindowID(void) -{ - if (gWindowImplementation) { - return gWindowImplementation->mSDL_XWindowID; - } - return None; -} - -//static -Display* LLWindowSDL::get_SDL_Display(void) -{ - if (gWindowImplementation) { - return gWindowImplementation->mSDL_Display; - } - return NULL; -} -#endif // LL_X11 - +static LLWindowSDL *gWindowImplementation = nullptr; LLWindowSDL::LLWindowSDL(LLWindowCallbacks* callbacks, - const std::string& title, S32 x, S32 y, S32 width, - S32 height, U32 flags, - bool fullscreen, bool clearBg, - bool disable_vsync, bool use_gl, - bool ignore_pixel_depth, U32 fsaa_samples) - : LLWindow(callbacks, fullscreen, flags), - Lock_Display(NULL), - Unlock_Display(NULL), mGamma(1.0f) + const std::string& title, const std::string& name, S32 x, S32 y, S32 width, + S32 height, U32 flags, + bool fullscreen, bool clearBg, + bool enable_vsync, bool use_gl, + bool ignore_pixel_depth, U32 fsaa_samples) + : LLWindow(callbacks, fullscreen, flags), + mGamma(1.0f), mFlashing(false) { + SDL_GL_LoadLibrary(nullptr); + // Initialize the keyboard gKeyboard = new LLKeyboardSDL(); gKeyboard->setCallbacks(callbacks); - // Note that we can't set up key-repeat until after SDL has init'd video - - // Ignore use_gl for now, only used for drones on PC - mWindow = NULL; - mNeedsResize = false; - mOverrideAspectRatio = 0.f; - mGrabbyKeyFlags = 0; - mReallyCapturedCount = 0; - mHaveInputFocus = -1; - mIsMinimized = -1; - mFSAASamples = fsaa_samples; - -#if LL_X11 - mSDL_XWindowID = None; - mSDL_Display = NULL; -#endif // LL_X11 - -#if LL_GTK - // We MUST be the first to initialize GTK so that GTK doesn't get badly - // initialized with a non-C locale and cause lots of serious random - // weirdness. - ll_try_gtk_init(); -#endif // LL_GTK // Assume 4:3 aspect ratio until we know better - mOriginalAspectRatio = 1024.0 / 768.0; + mNativeAspectRatio = 1024.f / 768.f; if (title.empty()) - mWindowTitle = "SDL Window"; // *FIX: (?) + mWindowTitle = "Second Life"; else mWindowTitle = title; // Create the GL context and set it up for windowed or fullscreen, as appropriate. - if(createContext(x, y, width, height, 32, fullscreen, disable_vsync)) + if(createContext(x, y, width, height, 32, fullscreen, enable_vsync)) { + gGLManager.initWGL(); gGLManager.initGL(); //start with arrow cursor @@ -241,14 +126,6 @@ LLWindowSDL::LLWindowSDL(LLWindowCallbacks* callbacks, // Stash an object pointer for OSMessageBox() gWindowImplementation = this; - -#if LL_X11 - mFlashing = false; -#endif // LL_X11 - - mKeyScanCode = 0; - mKeyVirtualKey = 0; - mKeyModifiers = KMOD_NONE; } static SDL_Surface *Load_BMP_Resource(const char *basename) @@ -258,480 +135,377 @@ static SDL_Surface *Load_BMP_Resource(const char *basename) // Figure out where our BMP is living on the disk snprintf(path_buffer, PATH_BUFFER_SIZE-1, "%s%sres-sdl%s%s", - gDirUtilp->getAppRODataDir().c_str(), - gDirUtilp->getDirDelimiter().c_str(), - gDirUtilp->getDirDelimiter().c_str(), - basename); + gDirUtilp->getAppRODataDir().c_str(), + gDirUtilp->getDirDelimiter().c_str(), + gDirUtilp->getDirDelimiter().c_str(), + basename); path_buffer[PATH_BUFFER_SIZE-1] = '\0'; return SDL_LoadBMP(path_buffer); } -#if LL_X11 -// This is an XFree86/XOrg-specific hack for detecting the amount of Video RAM -// on this machine. It works by searching /var/log/var/log/Xorg.?.log or -// /var/log/XFree86.?.log for a ': (VideoRAM ?|Memory): (%d+) kB' regex, where -// '?' is the X11 display number derived from $DISPLAY -static int x11_detect_VRAM_kb_fp(FILE *fp, const char *prefix_str) -{ - const int line_buf_size = 1000; - char line_buf[line_buf_size]; - while (fgets(line_buf, line_buf_size, fp)) - { - //LL_DEBUGS() << "XLOG: " << line_buf << LL_ENDL; - - // Why the ad-hoc parser instead of using a regex? Our - // favourite regex implementation - libboost_regex - is - // quite a heavy and troublesome dependency for the client, so - // it seems a shame to introduce it for such a simple task. - // *FIXME: libboost_regex is a dependency now anyway, so we may - // as well use it instead of this hand-rolled nonsense. - const char *part1_template = prefix_str; - const char part2_template[] = " kB"; - char *part1 = strstr(line_buf, part1_template); - if (part1) // found start of matching line - { - part1 = &part1[strlen(part1_template)]; // -> after - char *part2 = strstr(part1, part2_template); - if (part2) // found end of matching line - { - // now everything between part1 and part2 is - // supposed to be numeric, describing the - // number of kB of Video RAM supported - int rtn = 0; - for (; part1 < part2; ++part1) - { - if (*part1 < '0' || *part1 > '9') - { - // unexpected char, abort parse - rtn = 0; - break; - } - rtn *= 10; - rtn += (*part1) - '0'; - } - if (rtn > 0) - { - // got the kB number. return it now. - return rtn; - } - } - } - } - return 0; // 'could not detect' +void LLWindowSDL::setTitle(const std::string title) +{ + SDL_SetWindowTitle( mWindow, title.c_str() ); } -static int x11_detect_VRAM_kb() +void LLWindowSDL::tryFindFullscreenSize( int &width, int &height ) { - std::string x_log_location("/var/log/"); - std::string fname; - int rtn = 0; // 'could not detect' - int display_num = 0; - FILE *fp; - char *display_env = getenv("DISPLAY"); // e.g. :0 or :0.0 or :1.0 etc - // parse DISPLAY number so we can go grab the right log file - if (display_env[0] == ':' && - display_env[1] >= '0' && display_env[1] <= '9') - { - display_num = display_env[1] - '0'; - } - - // *TODO: we could be smarter and see which of Xorg/XFree86 has the - // freshest time-stamp. + LL_INFOS() << "createContext: setting up fullscreen " << width << "x" << height << LL_ENDL; - // Try Xorg log first - fname = x_log_location; - fname += "Xorg."; - fname += ('0' + display_num); - fname += ".log"; - fp = fopen(fname.c_str(), "r"); - if (fp) + // If the requested width or height is 0, find the best default for the monitor. + if(width == 0 || height == 0) { - LL_INFOS() << "Looking in " << fname - << " for VRAM info..." << LL_ENDL; - rtn = x11_detect_VRAM_kb_fp(fp, ": VideoRAM: "); - fclose(fp); - if (0 == rtn) + // Scan through the list of modes, looking for one which has: + // height between 700 and 800 + // aspect ratio closest to the user's original mode + S32 resolutionCount = 0; + LLWindowResolution *resolutionList = getSupportedResolutions(resolutionCount); + + if(resolutionList != nullptr) { - fp = fopen(fname.c_str(), "r"); - if (fp) + F32 closestAspect = 0; + U32 closestHeight = 0; + U32 closestWidth = 0; + + LL_INFOS() << "createContext: searching for a display mode, original aspect is " << mNativeAspectRatio << LL_ENDL; + + for(S32 i=0; i < resolutionCount; i++) { - rtn = x11_detect_VRAM_kb_fp(fp, ": Video RAM: "); - fclose(fp); - if (0 == rtn) + F32 aspect = (F32)resolutionList[i].mWidth / (F32)resolutionList[i].mHeight; + + LL_INFOS() << "createContext: width " << resolutionList[i].mWidth << " height " << resolutionList[i].mHeight << " aspect " << aspect << LL_ENDL; + + if( (resolutionList[i].mHeight >= 700) && (resolutionList[i].mHeight <= 800) && + (fabs(aspect - mNativeAspectRatio) < fabs(closestAspect - mNativeAspectRatio))) { - fp = fopen(fname.c_str(), "r"); - if (fp) - { - rtn = x11_detect_VRAM_kb_fp(fp, ": Memory: "); - fclose(fp); - } + LL_INFOS() << " (new closest mode) " << LL_ENDL; + + // This is the closest mode we've seen yet. + closestWidth = resolutionList[i].mWidth; + closestHeight = resolutionList[i].mHeight; + closestAspect = aspect; } } + + width = closestWidth; + height = closestHeight; } } - else + + if(width == 0 || height == 0) { - LL_INFOS() << "Could not open " << fname - << " - skipped." << LL_ENDL; - // Try old XFree86 log otherwise - fname = x_log_location; - fname += "XFree86."; - fname += ('0' + display_num); - fname += ".log"; - fp = fopen(fname.c_str(), "r"); - if (fp) - { - LL_INFOS() << "Looking in " << fname - << " for VRAM info..." << LL_ENDL; - rtn = x11_detect_VRAM_kb_fp(fp, ": VideoRAM: "); - fclose(fp); - if (0 == rtn) - { - fp = fopen(fname.c_str(), "r"); - if (fp) - { - rtn = x11_detect_VRAM_kb_fp(fp, ": Memory: "); - fclose(fp); - } - } - } - else - { - LL_INFOS() << "Could not open " << fname - << " - skipped." << LL_ENDL; - } + // Mode search failed for some reason. Use the old-school default. + width = 1024; + height = 768; } - return rtn; } -#endif // LL_X11 -bool LLWindowSDL::createContext(int x, int y, int width, int height, int bits, bool fullscreen, bool disable_vsync) +bool LLWindowSDL::createContext(int x, int y, int width, int height, int bits, bool fullscreen, bool enable_vsync) { - //bool glneedsinit = false; - - LL_INFOS() << "createContext, fullscreen=" << fullscreen << - " size=" << width << "x" << height << LL_ENDL; + LL_INFOS() << "createContext, fullscreen=" << fullscreen << " size=" << width << "x" << height << LL_ENDL; // captures don't survive contexts mGrabbyKeyFlags = 0; - mReallyCapturedCount = 0; - if (SDL_Init(SDL_INIT_VIDEO) < 0) - { - LL_INFOS() << "sdl_init() failed! " << SDL_GetError() << LL_ENDL; - setupFailure("sdl_init() failure, window creation error", "error", OSMB_OK); - return false; - } - - SDL_version c_sdl_version; - SDL_VERSION(&c_sdl_version); - LL_INFOS() << "Compiled against SDL " - << int(c_sdl_version.major) << "." - << int(c_sdl_version.minor) << "." - << int(c_sdl_version.patch) << LL_ENDL; - const SDL_version *r_sdl_version; - r_sdl_version = SDL_Linked_Version(); - LL_INFOS() << " Running against SDL " - << int(r_sdl_version->major) << "." - << int(r_sdl_version->minor) << "." - << int(r_sdl_version->patch) << LL_ENDL; - - const SDL_VideoInfo *video_info = SDL_GetVideoInfo( ); - if (!video_info) - { - LL_INFOS() << "SDL_GetVideoInfo() failed! " << SDL_GetError() << LL_ENDL; - setupFailure("SDL_GetVideoInfo() failed, Window creation error", "Error", OSMB_OK); - return false; - } - - if (video_info->current_h > 0) - { - mOriginalAspectRatio = (float)video_info->current_w / (float)video_info->current_h; - LL_INFOS() << "Original aspect ratio was " << video_info->current_w << ":" << video_info->current_h << "=" << mOriginalAspectRatio << LL_ENDL; - } - - SDL_EnableUNICODE(1); - SDL_WM_SetCaption(mWindowTitle.c_str(), mWindowTitle.c_str()); - - // Set the application icon. - SDL_Surface *bmpsurface; - bmpsurface = Load_BMP_Resource("ll_icon.BMP"); - if (bmpsurface) - { - // This attempts to give a black-keyed mask to the icon. - SDL_SetColorKey(bmpsurface, - SDL_SRCCOLORKEY, - SDL_MapRGB(bmpsurface->format, 0,0,0) ); - SDL_WM_SetIcon(bmpsurface, NULL); - // The SDL examples cheerfully avoid freeing the icon - // surface, but I'm betting that's leaky. - SDL_FreeSurface(bmpsurface); - bmpsurface = NULL; - } - - // note: these SetAttributes make Tom's 9600-on-AMD64 fail to - // get a visual, but it's broken anyway when it does, and without - // these SetAttributes we might easily get an avoidable substandard - // visual to work with on most other machines. - SDL_GL_SetAttribute(SDL_GL_RED_SIZE, 8); - SDL_GL_SetAttribute(SDL_GL_GREEN_SIZE,8); - SDL_GL_SetAttribute(SDL_GL_BLUE_SIZE, 8); - SDL_GL_SetAttribute(SDL_GL_DEPTH_SIZE, (bits <= 16) ? 16 : 24); - // We need stencil support for a few (minor) things. - if (!getenv("LL_GL_NO_STENCIL")) - SDL_GL_SetAttribute(SDL_GL_STENCIL_SIZE, 8); - SDL_GL_SetAttribute(SDL_GL_ALPHA_SIZE, (bits <= 16) ? 1 : 8); - - // *FIX: try to toggle vsync here? + if (width == 0) + width = 1024; + if (height == 0) + width = 768; + if (x == 0) + x = SDL_WINDOWPOS_UNDEFINED; + if (y == 0) + y = SDL_WINDOWPOS_UNDEFINED; mFullscreen = fullscreen; - int sdlflags = SDL_OPENGL | SDL_RESIZABLE | SDL_ANYFORMAT; + // Setup default backing colors + GLint redBits{8}, greenBits{8}, blueBits{8}, alphaBits{8}; + GLint depthBits{24}, stencilBits{8}; + SDL_GL_SetAttribute(SDL_GL_RED_SIZE, redBits); + SDL_GL_SetAttribute(SDL_GL_GREEN_SIZE, greenBits); + SDL_GL_SetAttribute(SDL_GL_BLUE_SIZE, blueBits); + SDL_GL_SetAttribute(SDL_GL_ALPHA_SIZE, alphaBits); + SDL_GL_SetAttribute(SDL_GL_DEPTH_SIZE, depthBits); + SDL_GL_SetAttribute(SDL_GL_STENCIL_SIZE, stencilBits); SDL_GL_SetAttribute(SDL_GL_DOUBLEBUFFER, 1); - if (mFSAASamples > 0) + SDL_GLContextFlag context_flags{}; + if(LLRender::sGLCoreProfile) { - SDL_GL_SetAttribute(SDL_GL_MULTISAMPLEBUFFERS, 1); - SDL_GL_SetAttribute(SDL_GL_MULTISAMPLESAMPLES, mFSAASamples); + SDL_GL_SetAttribute(SDL_GL_CONTEXT_PROFILE_MASK, SDL_GL_CONTEXT_PROFILE_CORE); +#if LL_DARWIN + SDL_GL_SetAttribute(SDL_GL_CONTEXT_MAJOR_VERSION, 4); + SDL_GL_SetAttribute(SDL_GL_CONTEXT_MINOR_VERSION, 1); + context_flags |= SDL_GL_CONTEXT_FORWARD_COMPATIBLE_FLAG; +#endif } - mSDLFlags = sdlflags; - - if (mFullscreen) + if (gDebugGL) { - LL_INFOS() << "createContext: setting up fullscreen " << width << "x" << height << LL_ENDL; - - // If the requested width or height is 0, find the best default for the monitor. - if((width == 0) || (height == 0)) - { - // Scan through the list of modes, looking for one which has: - // height between 700 and 800 - // aspect ratio closest to the user's original mode - S32 resolutionCount = 0; - LLWindowResolution *resolutionList = getSupportedResolutions(resolutionCount); - - if(resolutionList != NULL) - { - F32 closestAspect = 0; - U32 closestHeight = 0; - U32 closestWidth = 0; - int i; - - LL_INFOS() << "createContext: searching for a display mode, original aspect is " << mOriginalAspectRatio << LL_ENDL; - - for(i=0; i < resolutionCount; i++) - { - F32 aspect = (F32)resolutionList[i].mWidth / (F32)resolutionList[i].mHeight; + context_flags |= SDL_GL_CONTEXT_DEBUG_FLAG; + } - LL_INFOS() << "createContext: width " << resolutionList[i].mWidth << " height " << resolutionList[i].mHeight << " aspect " << aspect << LL_ENDL; + SDL_GL_SetAttribute(SDL_GL_CONTEXT_FLAGS, context_flags); + SDL_GL_SetAttribute(SDL_GL_SHARE_WITH_CURRENT_CONTEXT, 1); - if( (resolutionList[i].mHeight >= 700) && (resolutionList[i].mHeight <= 800) && - (fabs(aspect - mOriginalAspectRatio) < fabs(closestAspect - mOriginalAspectRatio))) - { - LL_INFOS() << " (new closest mode) " << LL_ENDL; + if(mFullscreen) + { + tryFindFullscreenSize(width, height); + } - // This is the closest mode we've seen yet. - closestWidth = resolutionList[i].mWidth; - closestHeight = resolutionList[i].mHeight; - closestAspect = aspect; - } - } + SDL_PropertiesID props = SDL_CreateProperties(); + SDL_SetStringProperty(props, SDL_PROP_WINDOW_CREATE_TITLE_STRING, mWindowTitle.c_str()); + SDL_SetNumberProperty(props, SDL_PROP_WINDOW_CREATE_X_NUMBER, x); + SDL_SetNumberProperty(props, SDL_PROP_WINDOW_CREATE_Y_NUMBER, y); + SDL_SetNumberProperty(props, SDL_PROP_WINDOW_CREATE_WIDTH_NUMBER, width); + SDL_SetNumberProperty(props, SDL_PROP_WINDOW_CREATE_HEIGHT_NUMBER, height); + SDL_SetBooleanProperty(props, SDL_PROP_WINDOW_CREATE_RESIZABLE_BOOLEAN, true); + SDL_SetBooleanProperty(props, SDL_PROP_WINDOW_CREATE_OPENGL_BOOLEAN, true); + SDL_SetBooleanProperty(props, SDL_PROP_WINDOW_CREATE_FULLSCREEN_BOOLEAN, mFullscreen); + SDL_SetBooleanProperty(props, SDL_PROP_WINDOW_CREATE_HIDDEN_BOOLEAN, true); + SDL_SetBooleanProperty(props, SDL_PROP_WINDOW_CREATE_HIGH_PIXEL_DENSITY_BOOLEAN, gHiDPISupport); - width = closestWidth; - height = closestHeight; - } - } + mWindow = SDL_CreateWindowWithProperties(props); + if (mWindow == nullptr) + { + LL_WARNS() << "Window creation failure. SDL: " << SDL_GetError() << LL_ENDL; + setupFailure("Window creation error", "Error", OSMB_OK); + SDL_DestroyProperties(props); + return false; + } + SDL_DestroyProperties(props); // Free properties once window is created - if((width == 0) || (height == 0)) - { - // Mode search failed for some reason. Use the old-school default. - width = 1024; - height = 768; - } + // Create the context + mContext = SDL_GL_CreateContext(mWindow); + if(!mContext) + { + LL_WARNS() << "Cannot create GL context " << SDL_GetError() << LL_ENDL; + setupFailure("GL Context creation error", "Error", OSMB_OK); + return false; + } - mWindow = SDL_SetVideoMode(width, height, bits, sdlflags | SDL_FULLSCREEN); - if (!mWindow && bits > 16) - { - SDL_GL_SetAttribute(SDL_GL_DEPTH_SIZE, 16); - mWindow = SDL_SetVideoMode(width, height, bits, sdlflags | SDL_FULLSCREEN); - } + if (!SDL_GL_MakeCurrent(mWindow, mContext)) + { + LL_WARNS() << "Failed to make context current. SDL: " << SDL_GetError() << LL_ENDL; + setupFailure("GL Context failed to set current failure", "Error", OSMB_OK); + return false; + } - if (mWindow) + const SDL_DisplayMode* displayMode = SDL_GetCurrentDisplayMode(SDL_GetDisplayForWindow(mWindow)); + if(displayMode) + { + mRefreshRate = ll_round(displayMode->refresh_rate); + mNativeAspectRatio = ((F32)displayMode->w) / ((F32)displayMode->h); + if(mFullscreen) { - mFullscreen = true; - mFullscreenWidth = mWindow->w; - mFullscreenHeight = mWindow->h; - mFullscreenBits = mWindow->format->BitsPerPixel; - mFullscreenRefresh = -1; + mFullscreenWidth = displayMode->w; + mFullscreenHeight = displayMode->h; + mFullscreenRefresh = ll_round(displayMode->refresh_rate); LL_INFOS() << "Running at " << mFullscreenWidth - << "x" << mFullscreenHeight - << "x" << mFullscreenBits - << " @ " << mFullscreenRefresh - << LL_ENDL; + << "x" << mFullscreenHeight + << " @ " << mFullscreenRefresh + << LL_ENDL; } - else + } + else + { + LL_WARNS() << "Failed to get current display mode and refresh rate" << LL_ENDL; + mRefreshRate = 0; + mNativeAspectRatio = 1024.f / 768.f; + if(mFullscreen) // Fallback to window size { - LL_WARNS() << "createContext: fullscreen creation failure. SDL: " << SDL_GetError() << LL_ENDL; - // No fullscreen support - mFullscreen = false; - mFullscreenWidth = -1; - mFullscreenHeight = -1; - mFullscreenBits = -1; + SDL_GetWindowSize(mWindow, &mFullscreenWidth, &mFullscreenHeight); mFullscreenRefresh = -1; - - std::string error = llformat("Unable to run fullscreen at %d x %d.\nRunning in window.", width, height); - OSMessageBox(error, "Error", OSMB_OK); } } - if(!mFullscreen && (mWindow == NULL)) + if(mRefreshRate == 0) // We failed to get a valid refresh rate above { - if (width == 0) - width = 1024; - if (height == 0) - width = 768; + mRefreshRate = DEFAULT_REFRESH_RATE; + } - LL_INFOS() << "createContext: creating window " << width << "x" << height << "x" << bits << LL_ENDL; - mWindow = SDL_SetVideoMode(width, height, bits, sdlflags); - if (!mWindow && bits > 16) - { - SDL_GL_SetAttribute(SDL_GL_DEPTH_SIZE, 16); - mWindow = SDL_SetVideoMode(width, height, bits, sdlflags); - } + /* Grab the window manager specific information */ +#if LL_LINUX + if (SDL_strcmp(SDL_GetCurrentVideoDriver(), "x11") == 0) + { + LL_INFOS() << "Running under X11" << LL_ENDL; + mServerProtocol = X11; - if (!mWindow) + gGLManager.mIsX11 = true; + +#if LL_X11 + sX11Data.xdisplay = (Display *)SDL_GetPointerProperty(SDL_GetWindowProperties(mWindow), SDL_PROP_WINDOW_X11_DISPLAY_POINTER, nullptr); + sX11Data.xwindow = (Window)SDL_GetNumberProperty(SDL_GetWindowProperties(mWindow), SDL_PROP_WINDOW_X11_WINDOW_NUMBER, 0); + sX11Data.xscreen = (int)SDL_GetNumberProperty(SDL_GetWindowProperties(mWindow), SDL_PROP_WINDOW_X11_SCREEN_NUMBER, -1); + if (sX11Data.xdisplay && sX11Data.xwindow) { - LL_WARNS() << "createContext: window creation failure. SDL: " << SDL_GetError() << LL_ENDL; - setupFailure("Window creation error", "Error", OSMB_OK); - return false; + } - } else if (!mFullscreen && (mWindow != NULL)) - { - LL_INFOS() << "createContext: SKIPPING - !fullscreen, but +mWindow " << width << "x" << height << "x" << bits << LL_ENDL; - } +#endif - // Detect video memory size. -# if LL_X11 - gGLManager.mVRAM = x11_detect_VRAM_kb() / 1024; - if (gGLManager.mVRAM != 0) - { - LL_INFOS() << "X11 log-parser detected " << gGLManager.mVRAM << "MB VRAM." << LL_ENDL; - } else -# endif // LL_X11 + gGLManager.initGLX(); + } + else if (SDL_strcmp(SDL_GetCurrentVideoDriver(), "wayland") == 0) { - // fallback to letting SDL detect VRAM. - // note: I've not seen SDL's detection ever actually find - // VRAM != 0, but if SDL *does* detect it then that's a bonus. - gGLManager.mVRAM = video_info->video_mem / 1024; - if (gGLManager.mVRAM != 0) + LL_INFOS() << "Running under Wayland" << LL_ENDL; + mServerProtocol = Wayland; + + gGLManager.mIsWayland = true; + +#if LL_WAYLAND + sWaylandData.display = (struct wl_display *)SDL_GetPointerProperty(SDL_GetWindowProperties(mWindow), SDL_PROP_WINDOW_WAYLAND_DISPLAY_POINTER, nullptr); + sWaylandData.surface = (struct wl_surface *)SDL_GetPointerProperty(SDL_GetWindowProperties(mWindow), SDL_PROP_WINDOW_WAYLAND_SURFACE_POINTER, nullptr); + if (sWaylandData.display && sWaylandData.surface) { - LL_INFOS() << "SDL detected " << gGLManager.mVRAM << "MB VRAM." << LL_ENDL; } - } - // If VRAM is not detected, that is handled later +#endif - // *TODO: Now would be an appropriate time to check for some - // explicitly unsupported cards. - //const char* RENDERER = (const char*) glGetString(GL_RENDERER); + gGLManager.initEGL(); - GLint depthBits, stencilBits, redBits, greenBits, blueBits, alphaBits; + // If set (XWayland) remove DISPLAY, this will prompt dullahan to also use Wayland + if(getenv("DISPLAY")) + { + unsetenv("DISPLAY"); + } + } +#endif - glGetIntegerv(GL_RED_BITS, &redBits); - glGetIntegerv(GL_GREEN_BITS, &greenBits); - glGetIntegerv(GL_BLUE_BITS, &blueBits); - glGetIntegerv(GL_ALPHA_BITS, &alphaBits); - glGetIntegerv(GL_DEPTH_BITS, &depthBits); - glGetIntegerv(GL_STENCIL_BITS, &stencilBits); + SDL_GL_GetAttribute(SDL_GL_RED_SIZE, &redBits); + SDL_GL_GetAttribute(SDL_GL_GREEN_SIZE, &greenBits); + SDL_GL_GetAttribute(SDL_GL_BLUE_SIZE, &blueBits); + SDL_GL_GetAttribute(SDL_GL_ALPHA_SIZE, &alphaBits); + SDL_GL_GetAttribute(SDL_GL_DEPTH_SIZE, &depthBits); + SDL_GL_GetAttribute(SDL_GL_STENCIL_SIZE, &stencilBits); LL_INFOS() << "GL buffer:" << LL_ENDL; - LL_INFOS() << " Red Bits " << S32(redBits) << LL_ENDL; - LL_INFOS() << " Green Bits " << S32(greenBits) << LL_ENDL; - LL_INFOS() << " Blue Bits " << S32(blueBits) << LL_ENDL; - LL_INFOS() << " Alpha Bits " << S32(alphaBits) << LL_ENDL; - LL_INFOS() << " Depth Bits " << S32(depthBits) << LL_ENDL; - LL_INFOS() << " Stencil Bits " << S32(stencilBits) << LL_ENDL; + LL_INFOS() << " Red Bits " << S32(redBits) << LL_ENDL; + LL_INFOS() << " Green Bits " << S32(greenBits) << LL_ENDL; + LL_INFOS() << " Blue Bits " << S32(blueBits) << LL_ENDL; + LL_INFOS() << " Alpha Bits " << S32(alphaBits) << LL_ENDL; + LL_INFOS() << " Depth Bits " << S32(depthBits) << LL_ENDL; + LL_INFOS() << " Stencil Bits " << S32(stencilBits) << LL_ENDL; GLint colorBits = redBits + greenBits + blueBits + alphaBits; - // fixme: actually, it's REALLY important for picking that we get at - // least 8 bits each of red,green,blue. Alpha we can be a bit more - // relaxed about if we have to. if (colorBits < 32) { - close(); setupFailure( - "Second Life requires True Color (32-bit) to run in a window.\n" - "Please go to Control Panels -> Display -> Settings and\n" - "set the screen to 32-bit color.\n" - "Alternately, if you choose to run fullscreen, Second Life\n" - "will automatically adjust the screen each time it runs.", - "Error", - OSMB_OK); + "Second Life requires True Color (32-bit) to run in a window.\n" + "Please go to Control Panels -> Display -> Settings and\n" + "set the screen to 32-bit color.\n" + "Alternately, if you choose to run fullscreen, Second Life\n" + "will automatically adjust the screen each time it runs.", + "Error", + OSMB_OK); return false; } -#if 0 // *FIX: we're going to brave it for now... - if (alphaBits < 8) + LL_PROFILER_GPU_CONTEXT; + + // Enable vertical sync + toggleVSync(enable_vsync); + +#if LL_DARWIN + setUseMultGL(sUseMultGL); + + // Get vram via CGL on macos + gGLManager.mVRAM = getVramSize(); +#endif + + // Set the application icon. + SDL_Surface* bmpsurface = Load_BMP_Resource("ll_icon.BMP"); + if (bmpsurface) { - close(); - setupFailure( - "Second Life is unable to run because it can't get an 8 bit alpha\n" - "channel. Usually this is due to video card driver issues.\n" - "Please make sure you have the latest video card drivers installed.\n" - "Also be sure your monitor is set to True Color (32-bit) in\n" - "Control Panels -> Display -> Settings.\n" - "If you continue to receive this message, contact customer service.", - "Error", - OSMB_OK); - return false; + SDL_SetWindowIcon(mWindow, bmpsurface); + SDL_DestroySurface(bmpsurface); + bmpsurface = nullptr; } -#endif -#if LL_X11 - /* Grab the window manager specific information */ - SDL_SysWMinfo info; - SDL_VERSION(&info.version); - if ( SDL_GetWMInfo(&info) ) + SDL_StartTextInput(mWindow); + return true; +} + +void* LLWindowSDL::createSharedContext() +{ + SDL_PropertiesID props = SDL_CreateProperties(); + SDL_SetStringProperty(props, SDL_PROP_WINDOW_CREATE_TITLE_STRING, "Second Life OSR Utility"); + SDL_SetNumberProperty(props, SDL_PROP_WINDOW_CREATE_WIDTH_NUMBER, 1); + SDL_SetNumberProperty(props, SDL_PROP_WINDOW_CREATE_HEIGHT_NUMBER, 1); + SDL_SetBooleanProperty(props, SDL_PROP_WINDOW_CREATE_RESIZABLE_BOOLEAN, false); + SDL_SetBooleanProperty(props, SDL_PROP_WINDOW_CREATE_OPENGL_BOOLEAN, true); + SDL_SetBooleanProperty(props, SDL_PROP_WINDOW_CREATE_HIDDEN_BOOLEAN, true); + SDL_SetBooleanProperty(props, SDL_PROP_WINDOW_CREATE_FOCUSABLE_BOOLEAN, false); + SDL_SetBooleanProperty(props, SDL_PROP_WINDOW_CREATE_UTILITY_BOOLEAN, true); + SDL_SetBooleanProperty(props, SDL_PROP_WINDOW_CREATE_HIGH_PIXEL_DENSITY_BOOLEAN, gHiDPISupport); + + auto osr_window = SDL_CreateWindowWithProperties(props); + if (osr_window == nullptr) { - /* Save the information for later use */ - if ( info.subsystem == SDL_SYSWM_X11 ) - { - mSDL_Display = info.info.x11.display; - mSDL_XWindowID = info.info.x11.wmwindow; - Lock_Display = info.info.x11.lock_func; - Unlock_Display = info.info.x11.unlock_func; - } - else - { - LL_WARNS() << "We're not running under X11? Wild." - << LL_ENDL; - } + SDL_DestroyProperties(props); + return nullptr; } - else + SDL_DestroyProperties(props); // Free properties once window is created + SDL_GLContext pContext = SDL_GL_CreateContext(osr_window); + + // Hack to ensure main window context is bound + SDL_GL_MakeCurrent(mWindow, mContext); + + if (!pContext) { - LL_WARNS() << "We're not running under any known WM. Wild." - << LL_ENDL; + LL_WARNS() << "Creating shared OpenGL context failed!" << LL_ENDL; + SDL_DestroyWindow(osr_window); + return nullptr; } -#endif // LL_X11 + { + LLMutexLock osr_lock(&mOSRMutex); + mOSRContexts.emplace(pContext, osr_window); + } - //make sure multisampling is disabled by default - glDisable(GL_MULTISAMPLE_ARB); + LL_DEBUGS() << "Creating shared OpenGL context successful!" << LL_ENDL; + return (void*)pContext; +} - // We need to do this here, once video is init'd - if (-1 == SDL_EnableKeyRepeat(SDL_DEFAULT_REPEAT_DELAY, - SDL_DEFAULT_REPEAT_INTERVAL)) - LL_WARNS() << "Couldn't enable key-repeat: " << SDL_GetError() <second, (SDL_GLContext)it->first); + } + LL_PROFILER_GPU_CONTEXT; +} - // Don't need to get the current gamma, since there's a call that restores it to the system defaults. - return true; +void LLWindowSDL::destroySharedContext(void* contextPtr) +{ + LLMutexLock osr_lock(&mOSRMutex); + auto it = mOSRContexts.find((SDL_GLContext)contextPtr); + if(it != mOSRContexts.end()) + { + SDL_GL_DestroyContext((SDL_GLContext)it->first); + mDeadOSRWindows.push_back((SDL_Window*)it->second); + } } +void LLWindowSDL::toggleVSync(bool enable_vsync) +{ + if (!enable_vsync) + { + LL_INFOS("Window") << "Disabling vertical sync" << LL_ENDL; + SDL_GL_SetSwapInterval(0); + } + else + { + LL_INFOS("Window") << "Enabling vertical sync" << LL_ENDL; + SDL_GL_SetSwapInterval(1); + } +} // changing fullscreen resolution, or switching between windowed and fullscreen mode. -bool LLWindowSDL::switchContext(bool fullscreen, const LLCoordScreen &size, bool disable_vsync, const LLCoordScreen * const posp) +bool LLWindowSDL::switchContext(bool fullscreen, const LLCoordScreen &size, bool enable_vsync, const LLCoordScreen * const posp) { const bool needsRebuild = true; // Just nuke the context and start over. bool result = true; @@ -741,9 +515,10 @@ bool LLWindowSDL::switchContext(bool fullscreen, const LLCoordScreen &size, bool if(needsRebuild) { destroyContext(); - result = createContext(0, 0, size.mX, size.mY, 0, fullscreen, disable_vsync); + result = createContext(0, 0, size.mX, size.mY, 32, fullscreen, enable_vsync); if (result) { + gGLManager.initWGL(); gGLManager.initGL(); //start with arrow cursor @@ -761,69 +536,96 @@ void LLWindowSDL::destroyContext() { LL_INFOS() << "destroyContext begins" << LL_ENDL; -#if LL_X11 - mSDL_Display = NULL; - mSDL_XWindowID = None; - Lock_Display = NULL; - Unlock_Display = NULL; -#endif // LL_X11 + { + LLMutexLock osr_lock(&mOSRMutex); + for(SDL_Window* pWindow : mDeadOSRWindows) + { + SDL_DestroyWindow(pWindow); + } + mDeadOSRWindows.clear(); + } + + // Stop unicode input + SDL_StopTextInput(mWindow); // Clean up remaining GL state before blowing away window LL_INFOS() << "shutdownGL begins" << LL_ENDL; gGLManager.shutdownGL(); - LL_INFOS() << "SDL_QuitSS/VID begins" << LL_ENDL; - SDL_QuitSubSystem(SDL_INIT_VIDEO); // *FIX: this might be risky... - mWindow = NULL; + LL_INFOS() << "Destroying SDL cursors" << LL_ENDL; + quitCursors(); + + if (mContext) + { + LL_INFOS() << "Destroying SDL GL Context" << LL_ENDL; + SDL_GL_DestroyContext(mContext); + mContext = nullptr; + } + else + { + LL_INFOS() << "SDL GL Context already destroyed" << LL_ENDL; + } + + if (mWindow) + { + LL_INFOS() << "Destroying SDL Window" << LL_ENDL; + SDL_DestroyWindow(mWindow); + mWindow = nullptr; + } + else + { + LL_INFOS() << "SDL Window already destroyed" << LL_ENDL; + } + LL_INFOS() << "destroyContext end" << LL_ENDL; } LLWindowSDL::~LLWindowSDL() { - quitCursors(); destroyContext(); - if(mSupportedResolutions != NULL) - { - delete []mSupportedResolutions; - } + delete[] mSupportedResolutions; - gWindowImplementation = NULL; + gWindowImplementation = nullptr; } void LLWindowSDL::show() { - // *FIX: What to do with SDL? + if (mWindow) + { + SDL_ShowWindow(mWindow); + SDL_RaiseWindow(mWindow); + } } void LLWindowSDL::hide() { - // *FIX: What to do with SDL? + if (mWindow) + { + SDL_HideWindow(mWindow); + } } -//virtual void LLWindowSDL::minimize() { - // *FIX: What to do with SDL? + if (mWindow) + { + SDL_MinimizeWindow(mWindow); + } } -//virtual void LLWindowSDL::restore() { - // *FIX: What to do with SDL? + if (mWindow) + { + SDL_RestoreWindow(mWindow); + } } - // close() destroys all OS-specific code associated with a window. // Usually called from LLWindowManager::destroyWindow() void LLWindowSDL::close() { - // Is window is already closed? - // if (!mWindow) - // { - // return; - // } - // Make sure cursor is visible and we haven't mangled the clipping state. setMouseClipping(false); showCursor(); @@ -833,134 +635,127 @@ void LLWindowSDL::close() bool LLWindowSDL::isValid() { - return (mWindow != NULL); + return mWindow != nullptr; } bool LLWindowSDL::getVisible() { - bool result = false; - - // *FIX: This isn't really right... - // Then what is? + bool result = true; if (mWindow) { - result = true; + SDL_WindowFlags flags = SDL_GetWindowFlags(mWindow); + if (flags & SDL_WINDOW_HIDDEN) + { + result = false; + } } - - return(result); + return result; } bool LLWindowSDL::getMinimized() { bool result = false; - - if (mWindow && (1 == mIsMinimized)) + if (mWindow) { - result = true; + SDL_WindowFlags flags = SDL_GetWindowFlags(mWindow); + if (flags & SDL_WINDOW_MINIMIZED) + { + result = true; + } } - return(result); + return result; } bool LLWindowSDL::getMaximized() { bool result = false; - if (mWindow) { - // TODO + SDL_WindowFlags flags = SDL_GetWindowFlags(mWindow); + if (flags & SDL_WINDOW_MAXIMIZED) + { + result = true; + } } - return(result); + return result; } bool LLWindowSDL::maximize() { - // TODO + if (mWindow) + { + SDL_MaximizeWindow(mWindow); + return true; + } return false; } -bool LLWindowSDL::getFullscreen() -{ - return mFullscreen; -} - bool LLWindowSDL::getPosition(LLCoordScreen *position) { - // *FIX: can anything be done with this? - position->mX = 0; - position->mY = 0; - return true; + if (mWindow) + { + SDL_GetWindowPosition(mWindow, &position->mX, &position->mY); + return true; + } + return false; } bool LLWindowSDL::getSize(LLCoordScreen *size) { if (mWindow) { - size->mX = mWindow->w; - size->mY = mWindow->h; - return (true); + SDL_GetWindowSize(mWindow, &size->mX, &size->mY); + return true; } - return (false); + return false; } bool LLWindowSDL::getSize(LLCoordWindow *size) { if (mWindow) { - size->mX = mWindow->w; - size->mY = mWindow->h; - return (true); + SDL_GetWindowSizeInPixels(mWindow, &size->mX, &size->mY); + return true; } - return (false); + return false; } bool LLWindowSDL::setPosition(const LLCoordScreen position) { - if(mWindow) + if (mWindow) { - // *FIX: (?) - //MacMoveWindow(mWindow, position.mX, position.mY, false); + SDL_SetWindowPosition(mWindow, position.mX, position.mY); + return true; } - return true; + return false; } -bool LLWindowSDL::setSizeImpl(const LLCoordScreen size) +template< typename T > bool setSizeImpl( const T& newSize, SDL_Window *pWin ) { - if(mWindow) - { - // Push a resize event onto SDL's queue - we'll handle it - // when it comes out again. - SDL_Event event; - event.type = SDL_VIDEORESIZE; - event.resize.w = size.mX; - event.resize.h = size.mY; - SDL_PushEvent(&event); // copied into queue + if( !pWin ) + return false; - return true; - } + SDL_WindowFlags winFlags = SDL_GetWindowFlags(pWin); - return false; + if( winFlags & SDL_WINDOW_MAXIMIZED) + SDL_RestoreWindow(pWin); + + SDL_SetWindowSize(pWin, newSize.mX, newSize.mY); + return true; } -bool LLWindowSDL::setSizeImpl(const LLCoordWindow size) +bool LLWindowSDL::setSizeImpl(const LLCoordScreen size) { - if(mWindow) - { - // Push a resize event onto SDL's queue - we'll handle it - // when it comes out again. - SDL_Event event; - event.type = SDL_VIDEORESIZE; - event.resize.w = size.mX; - event.resize.h = size.mY; - SDL_PushEvent(&event); // copied into queue - - return true; - } + return ::setSizeImpl( size, mWindow ); +} - return false; +bool LLWindowSDL::setSizeImpl(const LLCoordWindow size) +{ + return ::setSizeImpl( size, mWindow ); } @@ -968,8 +763,9 @@ void LLWindowSDL::swapBuffers() { if (mWindow) { - SDL_GL_SwapBuffers(); + SDL_GL_SwapWindow(mWindow); } + LL_PROFILER_GPU_COLLECT; } U32 LLWindowSDL::getFSAASamples() @@ -984,22 +780,23 @@ void LLWindowSDL::setFSAASamples(const U32 samples) F32 LLWindowSDL::getGamma() { - return 1/mGamma; + return 1.f / mGamma; } bool LLWindowSDL::restoreGamma() { - //CGDisplayRestoreColorSyncSettings(); - SDL_SetGamma(1.0f, 1.0f, 1.0f); return true; } bool LLWindowSDL::setGamma(const F32 gamma) { - mGamma = gamma; - if (mGamma == 0) mGamma = 0.1f; - mGamma = 1/mGamma; - SDL_SetGamma(mGamma, mGamma, mGamma); + if (mWindow) + { + mGamma = gamma; + if (mGamma == 0) + mGamma = 0.1f; + mGamma = 1.f / mGamma; + } return true; } @@ -1008,12 +805,13 @@ bool LLWindowSDL::isCursorHidden() return mCursorHidden; } - - // Constrains the mouse to the window. -void LLWindowSDL::setMouseClipping( bool b ) +void LLWindowSDL::setMouseClipping(bool b) { - //SDL_WM_GrabInput(b ? SDL_GRAB_ON : SDL_GRAB_OFF); + if (mWindow) + { + SDL_SetWindowMouseGrab(mWindow, b); + } } // virtual @@ -1021,38 +819,16 @@ void LLWindowSDL::setMinSize(U32 min_width, U32 min_height, bool enforce_immedia { LLWindow::setMinSize(min_width, min_height, enforce_immediately); -#if LL_X11 - // Set the minimum size limits for X11 window - // so the window manager doesn't allow resizing below those limits. - XSizeHints* hints = XAllocSizeHints(); - hints->flags |= PMinSize; - hints->min_width = mMinWindowWidth; - hints->min_height = mMinWindowHeight; - - XSetWMNormalHints(mSDL_Display, mSDL_XWindowID, hints); - - XFree(hints); -#endif + if (mWindow && min_width > 0 && min_height > 0) + { + SDL_SetWindowMinimumSize(mWindow, mMinWindowWidth, mMinWindowHeight); + } } bool LLWindowSDL::setCursorPosition(const LLCoordWindow position) { - bool result = true; - LLCoordScreen screen_pos; - - if (!convertCoords(position, &screen_pos)) - { - return false; - } - - //LL_INFOS() << "setCursorPosition(" << screen_pos.mX << ", " << screen_pos.mY << ")" << LL_ENDL; - - // do the actual forced cursor move. - SDL_WarpMouse(screen_pos.mX, screen_pos.mY); - - //LL_INFOS() << llformat("llcw %d,%d -> scr %d,%d", position.mX, position.mY, screen_pos.mX, screen_pos.mY) << LL_ENDL; - - return result; + SDL_WarpMouseInWindow(mWindow, (F32)position.mX, (F32)position.mY); + return true; } bool LLWindowSDL::getCursorPosition(LLCoordWindow *position) @@ -1060,54 +836,34 @@ bool LLWindowSDL::getCursorPosition(LLCoordWindow *position) //Point cursor_point; LLCoordScreen screen_pos; - //GetMouse(&cursor_point); - int x, y; + float x, y; SDL_GetMouseState(&x, &y); - screen_pos.mX = x; - screen_pos.mY = y; + screen_pos.mX = (S32)x; + screen_pos.mY = (S32)y; return convertCoords(screen_pos, position); } - F32 LLWindowSDL::getNativeAspectRatio() { -#if 0 + if (mOverrideAspectRatio > 0.f) + { + return mOverrideAspectRatio; + } + else if (mNativeAspectRatio > 0.f) + { + // we grabbed this value at startup, based on the user's desktop settings + return mNativeAspectRatio; + } + // RN: this hack presumes that the largest supported resolution is monitor-limited // and that pixels in that mode are square, therefore defining the native aspect ratio // of the monitor...this seems to work to a close approximation for most CRTs/LCDs S32 num_resolutions; LLWindowResolution* resolutions = getSupportedResolutions(num_resolutions); - return ((F32)resolutions[num_resolutions - 1].mWidth / (F32)resolutions[num_resolutions - 1].mHeight); - //rn: AC -#endif - - // MBW -- there are a couple of bad assumptions here. One is that the display list won't include - // ridiculous resolutions nobody would ever use. The other is that the list is in order. - - // New assumptions: - // - pixels are square (the only reasonable choice, really) - // - The user runs their display at a native resolution, so the resolution of the display - // when the app is launched has an aspect ratio that matches the monitor. - - //RN: actually, the assumption that there are no ridiculous resolutions (above the display's native capabilities) has - // been born out in my experience. - // Pixels are often not square (just ask the people who run their LCDs at 1024x768 or 800x600 when running fullscreen, like me) - // The ordering of display list is a blind assumption though, so we should check for max values - // Things might be different on the Mac though, so I'll defer to MBW - - // The constructor for this class grabs the aspect ratio of the monitor before doing any resolution - // switching, and stashes it in mOriginalAspectRatio. Here, we just return it. - - if (mOverrideAspectRatio > 0.f) - { - return mOverrideAspectRatio; - } - - return mOriginalAspectRatio; } F32 LLWindowSDL::getPixelAspectRatio() @@ -1130,104 +886,26 @@ F32 LLWindowSDL::getPixelAspectRatio() // dialogs are still usable in fullscreen. void LLWindowSDL::beforeDialog() { - bool running_x11 = false; -#if LL_X11 - running_x11 = (mSDL_XWindowID != None); -#endif //LL_X11 - LL_INFOS() << "LLWindowSDL::beforeDialog()" << LL_ENDL; if (SDLReallyCaptureInput(false)) // must ungrab input so popup works! { - if (mFullscreen) - { - // need to temporarily go non-fullscreen; bless SDL - // for providing a SDL_WM_ToggleFullScreen() - though - // it only works in X11 - if (running_x11 && mWindow) - { - SDL_WM_ToggleFullScreen(mWindow); - } - } - } - -#if LL_X11 - if (mSDL_Display) - { - // Everything that we/SDL asked for should happen before we - // potentially hand control over to GTK. - maybe_lock_display(); - XSync(mSDL_Display, False); - maybe_unlock_display(); + if (mFullscreen && mWindow ) + SDL_SetWindowFullscreen( mWindow, 0 ); } -#endif // LL_X11 - -#if LL_GTK - // this is a good time to grab some GTK version information for - // diagnostics, if not already done. - ll_try_gtk_init(); -#endif // LL_GTK - - maybe_lock_display(); } void LLWindowSDL::afterDialog() { - bool running_x11 = false; -#if LL_X11 - running_x11 = (mSDL_XWindowID != None); -#endif //LL_X11 - LL_INFOS() << "LLWindowSDL::afterDialog()" << LL_ENDL; - maybe_unlock_display(); - - if (mFullscreen) - { - // need to restore fullscreen mode after dialog - only works - // in X11 - if (running_x11 && mWindow) - { - SDL_WM_ToggleFullScreen(mWindow); - } - } -} - - -#if LL_X11 -// set/reset the XWMHints flag for 'urgency' that usually makes the icon flash -void LLWindowSDL::x11_set_urgent(bool urgent) -{ - if (mSDL_Display && !mFullscreen) - { - XWMHints *wm_hints; - - LL_INFOS() << "X11 hint for urgency, " << urgent << LL_ENDL; - - maybe_lock_display(); - wm_hints = XGetWMHints(mSDL_Display, mSDL_XWindowID); - if (!wm_hints) - wm_hints = XAllocWMHints(); - - if (urgent) - wm_hints->flags |= XUrgencyHint; - else - wm_hints->flags &= ~XUrgencyHint; - - XSetWMHints(mSDL_Display, mSDL_XWindowID, wm_hints); - XFree(wm_hints); - XSync(mSDL_Display, False); - maybe_unlock_display(); - } + if (mFullscreen && mWindow ) + SDL_SetWindowFullscreen( mWindow, 0 ); } -#endif // LL_X11 void LLWindowSDL::flashIcon(F32 seconds) { -#if !LL_X11 - LL_INFOS() << "Stub LLWindowSDL::flashIcon(" << seconds << ")" << LL_ENDL; -#else - LL_INFOS() << "X11 LLWindowSDL::flashIcon(" << seconds << ")" << LL_ENDL; + LL_INFOS() << "LLWindowSDL::flashIcon(" << seconds << ")" << LL_ENDL; F32 remaining_time = mFlashTimer.getRemainingTimeF32(); if (remaining_time < seconds) @@ -1235,132 +913,71 @@ void LLWindowSDL::flashIcon(F32 seconds) mFlashTimer.reset(); mFlashTimer.setTimerExpirySec(remaining_time); - x11_set_urgent(true); + SDL_FlashWindow(mWindow, SDL_FLASH_UNTIL_FOCUSED); mFlashing = true; -#endif // LL_X11 } - -#if LL_GTK -bool LLWindowSDL::isClipboardTextAvailable() +void LLWindowSDL::maybeStopFlashIcon() { - if (ll_try_gtk_init()) + if (mFlashing && mFlashTimer.hasExpired()) { - GtkClipboard * const clipboard = - gtk_clipboard_get(GDK_NONE); - return gtk_clipboard_wait_is_text_available(clipboard) ? - true : false; + mFlashing = false; + SDL_FlashWindow( mWindow, SDL_FLASH_CANCEL ); } - return false; // failure } -bool LLWindowSDL::pasteTextFromClipboard(LLWString &text) +bool LLWindowSDL::isClipboardTextAvailable() +{ + return SDL_HasClipboardText(); +} + +bool LLWindowSDL::pasteTextFromClipboard(LLWString &dst) { - if (ll_try_gtk_init()) + if (isClipboardTextAvailable()) { - GtkClipboard * const clipboard = - gtk_clipboard_get(GDK_NONE); - gchar * const data = gtk_clipboard_wait_for_text(clipboard); + char* data = SDL_GetClipboardText(); if (data) { - text = LLWString(utf8str_to_wstring(data)); - g_free(data); + dst = LLWString(utf8str_to_wstring(data)); + SDL_free(data); return true; } } - return false; // failure + return false; } -bool LLWindowSDL::copyTextToClipboard(const LLWString &text) +bool LLWindowSDL::copyTextToClipboard(const LLWString& text) { - if (ll_try_gtk_init()) - { - const std::string utf8 = wstring_to_utf8str(text); - GtkClipboard * const clipboard = - gtk_clipboard_get(GDK_NONE); - gtk_clipboard_set_text(clipboard, utf8.c_str(), utf8.length()); - return true; - } - return false; // failure + const std::string utf8 = wstring_to_utf8str(text); + return SDL_SetClipboardText(utf8.c_str()); } - bool LLWindowSDL::isPrimaryTextAvailable() { - if (ll_try_gtk_init()) - { - GtkClipboard * const clipboard = - gtk_clipboard_get(GDK_SELECTION_PRIMARY); - return gtk_clipboard_wait_is_text_available(clipboard) ? - true : false; - } - return false; // failure + return SDL_HasPrimarySelectionText(); } -bool LLWindowSDL::pasteTextFromPrimary(LLWString &text) +bool LLWindowSDL::pasteTextFromPrimary(LLWString &dst) { - if (ll_try_gtk_init()) + if (isPrimaryTextAvailable()) { - GtkClipboard * const clipboard = - gtk_clipboard_get(GDK_SELECTION_PRIMARY); - gchar * const data = gtk_clipboard_wait_for_text(clipboard); + char* data = SDL_GetPrimarySelectionText(); if (data) { - text = LLWString(utf8str_to_wstring(data)); - g_free(data); + dst = LLWString(utf8str_to_wstring(data)); + SDL_free(data); return true; } } - return false; // failure -} - -bool LLWindowSDL::copyTextToPrimary(const LLWString &text) -{ - if (ll_try_gtk_init()) - { - const std::string utf8 = wstring_to_utf8str(text); - GtkClipboard * const clipboard = - gtk_clipboard_get(GDK_SELECTION_PRIMARY); - gtk_clipboard_set_text(clipboard, utf8.c_str(), utf8.length()); - return true; - } - return false; // failure -} - -#else - -bool LLWindowSDL::isClipboardTextAvailable() -{ - return false; // unsupported -} - -bool LLWindowSDL::pasteTextFromClipboard(LLWString &dst) -{ - return false; // unsupported -} - -bool LLWindowSDL::copyTextToClipboard(const LLWString &s) -{ - return false; // unsupported -} - -bool LLWindowSDL::isPrimaryTextAvailable() -{ - return false; // unsupported -} - -bool LLWindowSDL::pasteTextFromPrimary(LLWString &dst) -{ - return false; // unsupported + return false; } -bool LLWindowSDL::copyTextToPrimary(const LLWString &s) +bool LLWindowSDL::copyTextToPrimary(const LLWString& text) { - return false; // unsupported + const std::string utf8 = wstring_to_utf8str(text); + return SDL_SetPrimarySelectionText(utf8.c_str()); } -#endif // LL_GTK - LLWindow::LLWindowResolution* LLWindowSDL::getSupportedResolutions(S32 &num_resolutions) { if (!mSupportedResolutions) @@ -1368,28 +985,21 @@ LLWindow::LLWindowResolution* LLWindowSDL::getSupportedResolutions(S32 &num_reso mSupportedResolutions = new LLWindowResolution[MAX_NUM_RESOLUTIONS]; mNumSupportedResolutions = 0; - SDL_Rect **modes = SDL_ListModes(NULL, SDL_OPENGL | SDL_FULLSCREEN); - if ( (modes != NULL) && (modes != ((SDL_Rect **) -1)) ) - { - int count = 0; - while (*modes && countw; - int h = r->h; + SDL_DisplayID display = SDL_GetPrimaryDisplay(); + int num_modes = 0; + SDL_DisplayMode **modes = SDL_GetFullscreenDisplayModes(display, &num_modes); + num_modes = llclamp(num_modes, 0, MAX_NUM_RESOLUTIONS); + if (modes) { + for (int i = 0; i < num_modes; ++i) { + SDL_DisplayMode *mode = modes[i]; + int w = mode->w; + int h = mode->h; if ((w >= 800) && (h >= 600)) { // make sure we don't add the same resolution multiple times! if ( (mNumSupportedResolutions == 0) || - ((mSupportedResolutions[mNumSupportedResolutions-1].mWidth != w) && - (mSupportedResolutions[mNumSupportedResolutions-1].mHeight != h)) ) + ((mSupportedResolutions[mNumSupportedResolutions-1].mWidth != w) && + (mSupportedResolutions[mNumSupportedResolutions-1].mHeight != h)) ) { mSupportedResolutions[mNumSupportedResolutions].mWidth = w; mSupportedResolutions[mNumSupportedResolutions].mHeight = h; @@ -1397,6 +1007,7 @@ LLWindow::LLWindowResolution* LLWindowSDL::getSupportedResolutions(S32 &num_reso } } } + SDL_free(modes); } } @@ -1404,13 +1015,42 @@ LLWindow::LLWindowResolution* LLWindowSDL::getSupportedResolutions(S32 &num_reso return mSupportedResolutions; } +//static +std::vector LLWindowSDL::getDisplaysResolutionList() +{ + std::vector ret; + if (gWindowImplementation) + { + S32 resolutionCount = 0; + LLWindowResolution* resolutionList = gWindowImplementation->getSupportedResolutions(resolutionCount); + if (resolutionList != nullptr) + { + for (S32 i = 0; i < resolutionCount; i++) + { + const LLWindowResolution& resolution = resolutionList[i]; + ret.push_back(std::to_string(resolution.mWidth) + "x" + std::to_string(resolution.mHeight)); + } + } + } + return ret; +} + + bool LLWindowSDL::convertCoords(LLCoordGL from, LLCoordWindow *to) { if (!to) return false; - to->mX = from.mX; - to->mY = mWindow->h - from.mY - 1; + if (!mWindow) + return false; + + S32 height; + SDL_GetWindowSizeInPixels(mWindow, nullptr, &height); + + float pixel_scale = SDL_GetWindowPixelDensity(mWindow); + + to->mX = from.mX / pixel_scale; + to->mY = (height - from.mY - 1) / pixel_scale; return true; } @@ -1420,8 +1060,15 @@ bool LLWindowSDL::convertCoords(LLCoordWindow from, LLCoordGL* to) if (!to) return false; - to->mX = from.mX; - to->mY = mWindow->h - from.mY - 1; + if (!mWindow) + return false; + S32 height; + SDL_GetWindowSize(mWindow, nullptr, &height); + + float pixel_scale = SDL_GetWindowPixelDensity(mWindow); + + to->mX = from.mX * pixel_scale; + to->mY = (height - from.mY - 1) * pixel_scale; return true; } @@ -1434,7 +1081,7 @@ bool LLWindowSDL::convertCoords(LLCoordScreen from, LLCoordWindow* to) // In the fullscreen case, window and screen coordinates are the same. to->mX = from.mX; to->mY = from.mY; - return (true); + return true; } bool LLWindowSDL::convertCoords(LLCoordWindow from, LLCoordScreen *to) @@ -1445,29 +1092,26 @@ bool LLWindowSDL::convertCoords(LLCoordWindow from, LLCoordScreen *to) // In the fullscreen case, window and screen coordinates are the same. to->mX = from.mX; to->mY = from.mY; - return (true); + return true; } bool LLWindowSDL::convertCoords(LLCoordScreen from, LLCoordGL *to) { LLCoordWindow window_coord; - return(convertCoords(from, &window_coord) && convertCoords(window_coord, to)); + return convertCoords(from, &window_coord) && convertCoords(window_coord, to); } bool LLWindowSDL::convertCoords(LLCoordGL from, LLCoordScreen *to) { LLCoordWindow window_coord; - return(convertCoords(from, &window_coord) && convertCoords(window_coord, to)); + return convertCoords(from, &window_coord) && convertCoords(window_coord, to); } - - - void LLWindowSDL::setupFailure(const std::string& text, const std::string& caption, U32 type) { - destroyContext(); + close(); OSMessageBox(text, caption, type); } @@ -1482,13 +1126,13 @@ bool LLWindowSDL::SDLReallyCaptureInput(bool capture) else mReallyCapturedCount = 0; - SDL_GrabMode wantmode, newmode; + bool wantGrab; if (mReallyCapturedCount <= 0) // uncapture { - wantmode = SDL_GRAB_OFF; + wantGrab = false; } else // capture { - wantmode = SDL_GRAB_ON; + wantGrab = true; } if (mReallyCapturedCount < 0) // yuck, imbalance. @@ -1497,64 +1141,32 @@ bool LLWindowSDL::SDLReallyCaptureInput(bool capture) LL_WARNS() << "ReallyCapture count was < 0" << LL_ENDL; } + bool newGrab = wantGrab; if (!mFullscreen) /* only bother if we're windowed anyway */ { -#if LL_X11 - if (mSDL_Display) + int result; + if (wantGrab) { - /* we dirtily mix raw X11 with SDL so that our pointer - isn't (as often) constrained to the limits of the - window while grabbed, which feels nicer and - hopefully eliminates some reported 'sticky pointer' - problems. We use raw X11 instead of - SDL_WM_GrabInput() because the latter constrains - the pointer to the window and also steals all - *keyboard* input from the window manager, which was - frustrating users. */ - int result; - if (wantmode == SDL_GRAB_ON) - { - //LL_INFOS() << "X11 POINTER GRABBY" << LL_ENDL; - //newmode = SDL_WM_GrabInput(wantmode); - maybe_lock_display(); - result = XGrabPointer(mSDL_Display, mSDL_XWindowID, - True, 0, GrabModeAsync, - GrabModeAsync, - None, None, CurrentTime); - maybe_unlock_display(); - if (GrabSuccess == result) - newmode = SDL_GRAB_ON; - else - newmode = SDL_GRAB_OFF; - } else if (wantmode == SDL_GRAB_OFF) - { - //LL_INFOS() << "X11 POINTER UNGRABBY" << LL_ENDL; - newmode = SDL_GRAB_OFF; - //newmode = SDL_WM_GrabInput(SDL_GRAB_OFF); - - maybe_lock_display(); - XUngrabPointer(mSDL_Display, CurrentTime); - // Make sure the ungrab happens RIGHT NOW. - XSync(mSDL_Display, False); - maybe_unlock_display(); - } else - { - newmode = SDL_GRAB_QUERY; // neutral - } - } else // not actually running on X11, for some reason - newmode = wantmode; -#endif // LL_X11 - } else { - // pretend we got what we wanted, when really we don't care. - newmode = wantmode; + // LL_INFOS() << "X11 POINTER GRABBY" << LL_ENDL; + result = SDL_SetWindowMouseGrab(mWindow, true); + if (0 == result) + newGrab = true; + else + newGrab = false; + } + else + { + newGrab = false; + result = SDL_SetWindowMouseGrab(mWindow, false); + } } + // pretend we got what we wanted, when really we don't care. // return boolean success for whether we ended up in the desired state - return (capture && SDL_GRAB_ON==newmode) || - (!capture && SDL_GRAB_OFF==newmode); + return capture == newGrab; } -U32 LLWindowSDL::SDLCheckGrabbyKeys(SDLKey keysym, bool gain) +U32 LLWindowSDL::SDLCheckGrabbyKeys(U32 keysym, bool gain) { /* part of the fix for SL-13243: Some popular window managers like to totally eat alt-drag for the purposes of moving windows. We @@ -1572,16 +1184,16 @@ U32 LLWindowSDL::SDLCheckGrabbyKeys(SDLKey keysym, bool gain) U32 mask = 0; switch (keysym) { - case SDLK_LALT: - mask = 1U << 0; break; - case SDLK_RALT: - mask = 1U << 1; break; - case SDLK_LCTRL: - mask = 1U << 2; break; - case SDLK_RCTRL: - mask = 1U << 3; break; - default: - break; + case SDLK_LALT: + mask = 1U << 0; break; + case SDLK_RALT: + mask = 1U << 1; break; + case SDLK_LCTRL: + mask = 1U << 2; break; + case SDLK_RCTRL: + mask = 1U << 3; break; + default: + break; } if (gain) @@ -1595,371 +1207,265 @@ U32 LLWindowSDL::SDLCheckGrabbyKeys(SDLKey keysym, bool gain) return mGrabbyKeyFlags; } +// virtual +void LLWindowSDL::processMiscNativeEvents() +{ + { + LLMutexLock osr_lock(&mOSRMutex); + for(SDL_Window* pWindow : mDeadOSRWindows) + { + SDL_DestroyWindow(pWindow); + } + mDeadOSRWindows.clear(); + } +} -void check_vm_bloat() +void LLWindowSDL::gatherInput() { -#if LL_LINUX - // watch our own VM and RSS sizes, warn if we bloated rapidly - static const std::string STATS_FILE = "/proc/self/stat"; - FILE *fp = fopen(STATS_FILE.c_str(), "r"); - if (fp) - { - static long long last_vm_size = 0; - static long long last_rss_size = 0; - const long long significant_vm_difference = 250 * 1024*1024; - const long long significant_rss_difference = 50 * 1024*1024; - long long this_vm_size = 0; - long long this_rss_size = 0; - - ssize_t res; - size_t dummy; - char *ptr = NULL; - for (int i=0; i<22; ++i) // parse past the values we don't want + // This is for the case where SDL is not driving the main event loop + if(!gSDLMainHandled) + { + SDL_Event event; + + // Handle all outstanding SDL events + while (SDL_PollEvent(&event)) { - res = getdelim(&ptr, &dummy, ' ', fp); - if (-1 == res) - { - LL_WARNS() << "Unable to parse " << STATS_FILE << LL_ENDL; - goto finally; - } - free(ptr); - ptr = NULL; + handleEvent(event); } - // 23rd space-delimited entry is vsize - res = getdelim(&ptr, &dummy, ' ', fp); - llassert(ptr); - if (-1 == res) + } + + updateCursor(); + + // This is a good time to stop flashing the icon if our mFlashTimer has + // expired. + if (mFlashing && mFlashTimer.hasExpired()) + { + SDL_FlashWindow(mWindow, SDL_FLASH_CANCEL); + mFlashing = false; + } +} + +SDL_AppResult LLWindowSDL::handleEvent(const SDL_Event& event) +{ + switch(event.type) + { + case SDL_EVENT_MOUSE_MOTION: { - LL_WARNS() << "Unable to parse " << STATS_FILE << LL_ENDL; - goto finally; + LLCoordWindow winCoord(llfloor(event.motion.x), llfloor(event.motion.y)); + LLCoordGL openGlCoord; + convertCoords(winCoord, &openGlCoord); + mCallbacks->handleMouseMove(this, openGlCoord, gKeyboard->currentMask(true)); + break; } - this_vm_size = atoll(ptr); - free(ptr); - ptr = NULL; - // 24th space-delimited entry is RSS - res = getdelim(&ptr, &dummy, ' ', fp); - llassert(ptr); - if (-1 == res) + + case SDL_EVENT_MOUSE_WHEEL: { - LL_WARNS() << "Unable to parse " << STATS_FILE << LL_ENDL; - goto finally; + if(event.wheel.integer_y != 0) + { + mCallbacks->handleScrollWheel(this, -event.wheel.integer_y); + } + if (event.wheel.integer_x != 0) + { + mCallbacks->handleScrollHWheel(this, -event.wheel.integer_x); + } + break; } - this_rss_size = getpagesize() * atoll(ptr); - free(ptr); - ptr = NULL; - LL_INFOS() << "VM SIZE IS NOW " << (this_vm_size/(1024*1024)) << " MB, RSS SIZE IS NOW " << (this_rss_size/(1024*1024)) << " MB" << LL_ENDL; + case SDL_EVENT_MOUSE_BUTTON_DOWN: + { + LLCoordWindow winCoord(llfloor(event.button.x), llfloor(event.button.y)); + LLCoordGL openGlCoord; + convertCoords(winCoord, &openGlCoord); + MASK mask = gKeyboard->currentMask(true); + + if (event.button.button == SDL_BUTTON_LEFT) // left + { + if (event.button.clicks == 2) + mCallbacks->handleDoubleClick(this, openGlCoord, mask); + else + mCallbacks->handleMouseDown(this, openGlCoord, mask); + } + else if (event.button.button == SDL_BUTTON_RIGHT) + { + mCallbacks->handleRightMouseDown(this, openGlCoord, mask); + } + else if (event.button.button == SDL_BUTTON_MIDDLE) // middle + { + mCallbacks->handleMiddleMouseDown(this, openGlCoord, mask); + } + else + { + mCallbacks->handleOtherMouseDown(this, openGlCoord, mask, event.button.button); + } + + break; + } - if (llabs(last_vm_size - this_vm_size) > - significant_vm_difference) + case SDL_EVENT_MOUSE_BUTTON_UP: { - if (this_vm_size > last_vm_size) + LLCoordWindow winCoord(llfloor(event.button.x), llfloor(event.button.y)); + LLCoordGL openGlCoord; + convertCoords(winCoord, &openGlCoord); + MASK mask = gKeyboard->currentMask(true); + + if (event.button.button == SDL_BUTTON_LEFT) // left { - LL_WARNS() << "VM size grew by " << (this_vm_size - last_vm_size)/(1024*1024) << " MB in last frame" << LL_ENDL; + mCallbacks->handleMouseUp(this, openGlCoord, mask); } - else + else if (event.button.button == SDL_BUTTON_RIGHT) // right { - LL_INFOS() << "VM size shrank by " << (last_vm_size - this_vm_size)/(1024*1024) << " MB in last frame" << LL_ENDL; + mCallbacks->handleRightMouseUp(this, openGlCoord, mask); } - } - - if (llabs(last_rss_size - this_rss_size) > - significant_rss_difference) - { - if (this_rss_size > last_rss_size) + else if (event.button.button == SDL_BUTTON_MIDDLE) // middle { - LL_WARNS() << "RSS size grew by " << (this_rss_size - last_rss_size)/(1024*1024) << " MB in last frame" << LL_ENDL; + mCallbacks->handleMiddleMouseUp(this, openGlCoord, mask); } else { - LL_INFOS() << "RSS size shrank by " << (last_rss_size - this_rss_size)/(1024*1024) << " MB in last frame" << LL_ENDL; + mCallbacks->handleOtherMouseUp(this, openGlCoord, mask, event.button.button); } - } - last_rss_size = this_rss_size; - last_vm_size = this_vm_size; - -finally: - if (NULL != ptr) - { - free(ptr); - ptr = NULL; + break; } - fclose(fp); - } -#endif // LL_LINUX -} - - -// virtual -void LLWindowSDL::processMiscNativeEvents() -{ -#if LL_GTK - // Pump GTK events to avoid starvation for: - // * DBUS servicing - // * Anything else which quietly hooks into the default glib/GTK loop - if (ll_try_gtk_init()) - { - // Yuck, Mozilla's GTK callbacks play with the locale - push/pop - // the locale to protect it, as exotic/non-C locales - // causes our code lots of general critical weirdness - // and crashness. (SL-35450) - static std::string saved_locale; - saved_locale = ll_safe_string(setlocale(LC_ALL, NULL)); - // Pump until we've nothing left to do or passed 1/15th of a - // second pumping for this frame. - static LLTimer pump_timer; - pump_timer.reset(); - pump_timer.setTimerExpirySec(1.0f / 15.0f); - do { - // Always do at least one non-blocking pump - gtk_main_iteration_do(false); - } while (gtk_events_pending() && - !pump_timer.hasExpired()); - - setlocale(LC_ALL, saved_locale.c_str() ); - } -#endif // LL_GTK + case SDL_EVENT_KEY_DOWN: + { + mKeyVirtualKey = event.key.key; + mKeyModifiers = event.key.mod; - // hack - doesn't belong here - but this is just for debugging - if (getenv("LL_DEBUG_BLOAT")) - { - check_vm_bloat(); - } -} + if (mKeyVirtualKey == SDLK_RETURN2 || mKeyVirtualKey == SDLK_KP_ENTER) + { + mKeyVirtualKey = SDLK_RETURN; + } -void LLWindowSDL::gatherInput() -{ - const Uint32 CLICK_THRESHOLD = 300; // milliseconds - static int leftClick = 0; - static int rightClick = 0; - static Uint32 lastLeftDown = 0; - static Uint32 lastRightDown = 0; - SDL_Event event; + gKeyboard->handleKeyDown(mKeyVirtualKey, mKeyModifiers); - // Handle all outstanding SDL events - while (SDL_PollEvent(&event)) - { - switch (event.type) - { - case SDL_MOUSEMOTION: + if (mKeyVirtualKey == SDLK_RETURN) { - LLCoordWindow winCoord(event.button.x, event.button.y); - LLCoordGL openGlCoord; - convertCoords(winCoord, &openGlCoord); - MASK mask = gKeyboard->currentMask(true); - mCallbacks->handleMouseMove(this, openGlCoord, mask); - break; + // fix return key not working when capslock, scrolllock or numlock are enabled + mKeyModifiers &= (~(SDL_KMOD_NUM | SDL_KMOD_CAPS | SDL_KMOD_MODE | SDL_KMOD_SCROLL)); + mCallbacks->handleUnicodeChar(mKeyVirtualKey, gKeyboard->currentMask(false)); } - case SDL_KEYDOWN: - mKeyScanCode = event.key.keysym.scancode; - mKeyVirtualKey = event.key.keysym.unicode; - mKeyModifiers = event.key.keysym.mod; - - gKeyboard->handleKeyDown(event.key.keysym.sym, event.key.keysym.mod); // part of the fix for SL-13243 - if (SDLCheckGrabbyKeys(event.key.keysym.sym, true) != 0) + if (SDLCheckGrabbyKeys(mKeyVirtualKey, true) != 0) SDLReallyCaptureInput(true); + break; + } + + case SDL_EVENT_KEY_UP: + { + mKeyVirtualKey = event.key.key; + mKeyModifiers = event.key.mod; - if (event.key.keysym.unicode) + if (mKeyVirtualKey == SDLK_RETURN2 || mKeyVirtualKey == SDLK_KP_ENTER) { - handleUnicodeUTF16(event.key.keysym.unicode, - gKeyboard->currentMask(false)); + mKeyVirtualKey = SDLK_RETURN; } - break; - - case SDL_KEYUP: - mKeyScanCode = event.key.keysym.scancode; - mKeyVirtualKey = event.key.keysym.unicode; - mKeyModifiers = event.key.keysym.mod; - if (SDLCheckGrabbyKeys(event.key.keysym.sym, false) == 0) + gKeyboard->handleKeyUp(mKeyVirtualKey, mKeyModifiers); + if (SDLCheckGrabbyKeys(mKeyVirtualKey, false) == 0) SDLReallyCaptureInput(false); // part of the fix for SL-13243 - - gKeyboard->handleKeyUp(event.key.keysym.sym, event.key.keysym.mod); break; + } - case SDL_MOUSEBUTTONDOWN: - { - bool isDoubleClick = false; - LLCoordWindow winCoord(event.button.x, event.button.y); - LLCoordGL openGlCoord; - convertCoords(winCoord, &openGlCoord); - MASK mask = gKeyboard->currentMask(true); - - if (event.button.button == SDL_BUTTON_LEFT) // SDL doesn't manage double clicking... - { - Uint32 now = SDL_GetTicks(); - if ((now - lastLeftDown) > CLICK_THRESHOLD) - leftClick = 1; - else - { - if (++leftClick >= 2) - { - leftClick = 0; - isDoubleClick = true; - } - } - lastLeftDown = now; - } - else if (event.button.button == SDL_BUTTON_RIGHT) - { - Uint32 now = SDL_GetTicks(); - if ((now - lastRightDown) > CLICK_THRESHOLD) - rightClick = 1; - else - { - if (++rightClick >= 2) - { - rightClick = 0; - isDoubleClick = true; - } - } - lastRightDown = now; - } - - if (event.button.button == SDL_BUTTON_LEFT) // left - { - if (isDoubleClick) - mCallbacks->handleDoubleClick(this, openGlCoord, mask); - else - mCallbacks->handleMouseDown(this, openGlCoord, mask); - } - - else if (event.button.button == SDL_BUTTON_RIGHT) // right - { - mCallbacks->handleRightMouseDown(this, openGlCoord, mask); - } - - else if (event.button.button == SDL_BUTTON_MIDDLE) // middle - { - mCallbacks->handleMiddleMouseDown(this, openGlCoord, mask); - } - else if (event.button.button == 4) // mousewheel up...thanks to X11 for making SDL consider these "buttons". - mCallbacks->handleScrollWheel(this, -1); - else if (event.button.button == 5) // mousewheel down...thanks to X11 for making SDL consider these "buttons". - mCallbacks->handleScrollWheel(this, 1); - - break; - } - - case SDL_MOUSEBUTTONUP: + case SDL_EVENT_TEXT_INPUT: + { + auto string = utf8str_to_wstring(event.text.text); + MASK current_mask = gKeyboard->currentMask(false); + for (auto key : string) { - LLCoordWindow winCoord(event.button.x, event.button.y); - LLCoordGL openGlCoord; - convertCoords(winCoord, &openGlCoord); - MASK mask = gKeyboard->currentMask(true); - - if (event.button.button == SDL_BUTTON_LEFT) // left - mCallbacks->handleMouseUp(this, openGlCoord, mask); - else if (event.button.button == SDL_BUTTON_RIGHT) // right - mCallbacks->handleRightMouseUp(this, openGlCoord, mask); - else if (event.button.button == SDL_BUTTON_MIDDLE) // middle - mCallbacks->handleMiddleMouseUp(this, openGlCoord, mask); - // don't handle mousewheel here... - - break; + mKeyVirtualKey = key; + mCallbacks->handleUnicodeChar(key, current_mask); } + break; + } - case SDL_VIDEOEXPOSE: // VIDEOEXPOSE doesn't specify the damage, but hey, it's OpenGL...repaint the whole thing! - mCallbacks->handlePaint(this, 0, 0, mWindow->w, mWindow->h); - break; - - case SDL_VIDEORESIZE: // *FIX: handle this? - { - LL_INFOS() << "Handling a resize event: " << event.resize.w << - "x" << event.resize.h << LL_ENDL; - - S32 width = llmax(event.resize.w, (S32)mMinWindowWidth); - S32 height = llmax(event.resize.h, (S32)mMinWindowHeight); - - // *FIX: I'm not sure this is necessary! - mWindow = SDL_SetVideoMode(width, height, 32, mSDLFlags); - if (!mWindow) + case SDL_EVENT_WINDOW_EXPOSED: { - // *FIX: More informative dialog? - LL_INFOS() << "Could not recreate context after resize! Quitting..." << LL_ENDL; - if(mCallbacks->handleCloseRequest(this, false)) - { - // Get the app to initiate cleanup. - mCallbacks->handleQuit(this); - // The app is responsible for calling destroyWindow when done with GL - } - break; + mCallbacks->handlePaint(this, 0, 0, 0, 0); + break; } - mCallbacks->handleResize(this, width, height); - break; - } - case SDL_ACTIVEEVENT: - if (event.active.state & SDL_APPINPUTFOCUS) - { - // Note that for SDL (particularly on X11), keyboard - // and mouse focus are independent things. Here we are - // tracking keyboard focus state changes. - - // We have to do our own state massaging because SDL - // can send us two unfocus events in a row for example, - // which confuses the focus code [SL-24071]. - if (event.active.gain != mHaveInputFocus) - { - mHaveInputFocus = !!event.active.gain; + case SDL_EVENT_WINDOW_RESIZED: + { + LL_INFOS() << "Handling a resize event: " << event.window.data1 << "x" << event.window.data2 << LL_ENDL; + F32 pixel_density = SDL_GetWindowPixelDensity(mWindow); + S32 width = llmax(event.window.data1, (S32)mMinWindowWidth) * pixel_density; + S32 height = llmax(event.window.data2, (S32)mMinWindowHeight) * pixel_density; - if (mHaveInputFocus) - mCallbacks->handleFocus(this); - else - mCallbacks->handleFocusLost(this); - } - } - if (event.active.state & SDL_APPACTIVE) - { - // Change in iconification/minimization state. - if ((!event.active.gain) != mIsMinimized) + mCallbacks->handleResize(this, width, height); + break; + } + case SDL_EVENT_WINDOW_MOUSE_ENTER: + break; + case SDL_EVENT_WINDOW_MOUSE_LEAVE: + mCallbacks->handleMouseLeave(this); + break; + case SDL_EVENT_WINDOW_FOCUS_GAINED: + //SDL_SetWindowKeyboardGrab(mWindow, true); + mCallbacks->handleFocus(this); + break; + case SDL_EVENT_WINDOW_FOCUS_LOST: + mCallbacks->handleFocusLost(this); + //SDL_SetWindowKeyboardGrab(mWindow, false); + break; + case SDL_EVENT_WINDOW_RESTORED: + mCallbacks->handleActivate(this, true); + break; + case SDL_EVENT_WINDOW_MAXIMIZED: + mCallbacks->handleActivate(this, true); + break; + case SDL_EVENT_WINDOW_MINIMIZED: + mCallbacks->handleActivate(this, false); + break; + case SDL_EVENT_WINDOW_DISPLAY_CHANGED: + { + // Update refresh rate when changing monitors + const SDL_DisplayMode* displayMode = SDL_GetCurrentDisplayMode(event.window.data1); + if(displayMode) { - mIsMinimized = (!event.active.gain); - - mCallbacks->handleActivate(this, !mIsMinimized); - LL_INFOS() << "SDL deiconification state switched to " << bool(event.active.gain) << LL_ENDL; + mRefreshRate = ll_round(displayMode->refresh_rate); + mNativeAspectRatio = ((F32)displayMode->w) / ((F32)displayMode->h); } - else + mCallbacks->handleDisplayChanged(); + break; + } + case SDL_EVENT_WINDOW_DISPLAY_SCALE_CHANGED: + { + S32 w, h = 0; + SDL_GetWindowSizeInPixels(mWindow, &w, &h); + mCallbacks->handleDPIChanged(this, getSystemUISize(), w, h); + break; + } + case SDL_EVENT_WINDOW_CLOSE_REQUESTED: + { + if(mCallbacks->handleCloseRequest(this, true)) { - LL_INFOS() << "Ignored bogus redundant SDL deiconification state switch to " << bool(event.active.gain) << LL_ENDL; + // Get the app to initiate cleanup. + mCallbacks->handleQuit(this); + // The app is responsible for calling destroyWindow when done with GL } - } - break; - - case SDL_QUIT: - if(mCallbacks->handleCloseRequest(this, true)) - { - // Get the app to initiate cleanup. - mCallbacks->handleQuit(this); - // The app is responsible for calling destroyWindow when done with GL - } - break; - default: - //LL_INFOS() << "Unhandled SDL event type " << event.type << LL_ENDL; - break; + break; } + default: + break; } - updateCursor(); + return SDL_APP_CONTINUE; +} -#if LL_X11 - // This is a good time to stop flashing the icon if our mFlashTimer has - // expired. - if (mFlashing && mFlashTimer.hasExpired()) - { - x11_set_urgent(false); - mFlashing = false; - } -#endif // LL_X11 +// static +SDL_AppResult LLWindowSDL::handleEvents(const SDL_Event& event) +{ + if(!gWindowImplementation) return SDL_APP_CONTINUE; + + return gWindowImplementation->handleEvent(event); } static SDL_Cursor *makeSDLCursorFromBMP(const char *filename, int hotx, int hoty) { - SDL_Cursor *sdlcursor = NULL; + SDL_Cursor *sdlcursor = nullptr; SDL_Surface *bmpsurface; // Load cursor pixel data from BMP file @@ -1968,21 +1474,32 @@ static SDL_Cursor *makeSDLCursorFromBMP(const char *filename, int hotx, int hoty { SDL_Surface *cursurface; LL_DEBUGS() << "Loaded cursor file " << filename << " " - << bmpsurface->w << "x" << bmpsurface->h << LL_ENDL; - cursurface = SDL_CreateRGBSurface (SDL_SWSURFACE, - bmpsurface->w, - bmpsurface->h, - 32, - SDL_SwapLE32(0xFFU), - SDL_SwapLE32(0xFF00U), - SDL_SwapLE32(0xFF0000U), - SDL_SwapLE32(0xFF000000U)); - SDL_FillRect(cursurface, NULL, SDL_SwapLE32(0x00000000U)); + << bmpsurface->w << "x" << bmpsurface->h << LL_ENDL; + SDL_PixelFormat pix_format = SDL_GetPixelFormatForMasks(32, + SDL_Swap32LE(0xFFU), + SDL_Swap32LE(0xFF00U), + SDL_Swap32LE(0xFF0000U), + SDL_Swap32LE(0xFF000000U)); + if (pix_format == SDL_PIXELFORMAT_UNKNOWN) + { + return nullptr; + } + + const SDL_PixelFormatDetails* pix_format_details = SDL_GetPixelFormatDetails(pix_format); + if(!pix_format_details) + { + return nullptr; + } + + cursurface = SDL_CreateSurface(bmpsurface->w, + bmpsurface->h, + pix_format); + SDL_FillSurfaceRect(cursurface, nullptr, SDL_Swap32LE(0x00000000U)); // Blit the cursor pixel data onto a 32-bit RGBA surface so we // only have to cope with processing one type of pixel format. - if (0 == SDL_BlitSurface(bmpsurface, NULL, - cursurface, NULL)) + if (SDL_BlitSurface(bmpsurface, nullptr, + cursurface, nullptr)) { // n.b. we already checked that width is a multiple of 8. const int bitmap_bytes = (cursurface->w * cursurface->h) / 8; @@ -1997,33 +1514,33 @@ static SDL_Cursor *makeSDLCursorFromBMP(const char *filename, int hotx, int hoty for (i=0; ih; ++i) { for (j=0; jw; ++j) { U8 *pixelp = - ((U8*)cursurface->pixels) - + cursurface->pitch * i - + j*cursurface->format->BytesPerPixel; + ((U8*)cursurface->pixels) + + cursurface->pitch * i + + j*pix_format_details->bytes_per_pixel; U8 srcred = pixelp[0]; U8 srcgreen = pixelp[1]; U8 srcblue = pixelp[2]; bool mask_bit = (srcred != 200) - || (srcgreen != 200) - || (srcblue != 200); + || (srcgreen != 200) + || (srcblue != 200); bool data_bit = mask_bit && (srcgreen <= 80);//not 0x80 unsigned char bit_offset = (cursurface->w/8) * i - + j/8; + + j/8; cursor_data[bit_offset] |= (data_bit) << (7 - (j&7)); cursor_mask[bit_offset] |= (mask_bit) << (7 - (j&7)); } } sdlcursor = SDL_CreateCursor((Uint8*)cursor_data, - (Uint8*)cursor_mask, - cursurface->w, cursurface->h, - hotx, hoty); + (Uint8*)cursor_mask, + cursurface->w, cursurface->h, + hotx, hoty); delete[] cursor_data; delete[] cursor_mask; } else { LL_WARNS() << "CURSOR BLIT FAILURE, cursurface: " << cursurface << LL_ENDL; } - SDL_FreeSurface(cursurface); - SDL_FreeSurface(bmpsurface); + SDL_DestroySurface(cursurface); + SDL_DestroySurface(bmpsurface); } else { LL_WARNS() << "CURSOR LOAD FAILURE " << filename << LL_ENDL; } @@ -2033,12 +1550,6 @@ static SDL_Cursor *makeSDLCursorFromBMP(const char *filename, int hotx, int hoty void LLWindowSDL::updateCursor() { - if (ATIbug) { - // cursor-updating is very flaky when this bug is - // present; do nothing. - return; - } - if (mCurrentCursor != mNextCursor) { if (mNextCursor < UI_CURSOR_COUNT) @@ -2050,37 +1561,40 @@ void LLWindowSDL::updateCursor() sdlcursor = mSDLCursors[UI_CURSOR_ARROW]; if (sdlcursor) SDL_SetCursor(sdlcursor); - } else { + + mCurrentCursor = mNextCursor; + } + else + { LL_WARNS() << "Tried to set invalid cursor number " << mNextCursor << LL_ENDL; } - mCurrentCursor = mNextCursor; } } void LLWindowSDL::initCursors() { - int i; // Blank the cursor pointer array for those we may miss. - for (i=0; ibeforeDialog(); + SDL_MessageBoxData oData = { SDL_MESSAGEBOX_INFORMATION, nullptr, caption.c_str(), text.c_str(), 0, nullptr, nullptr }; + SDL_MessageBoxButtonData btnOk[] = {{SDL_MESSAGEBOX_BUTTON_RETURNKEY_DEFAULT, OSBTN_OK, "OK" }}; + SDL_MessageBoxButtonData btnOkCancel [] = {{SDL_MESSAGEBOX_BUTTON_RETURNKEY_DEFAULT, OSBTN_OK, "OK" }, {SDL_MESSAGEBOX_BUTTON_ESCAPEKEY_DEFAULT, OSBTN_CANCEL, "Cancel"} }; + SDL_MessageBoxButtonData btnYesNo[] = { {SDL_MESSAGEBOX_BUTTON_RETURNKEY_DEFAULT, OSBTN_YES, "Yes" }, {SDL_MESSAGEBOX_BUTTON_ESCAPEKEY_DEFAULT, OSBTN_NO, "No"} }; - if (LLWindowSDL::ll_try_gtk_init()) + switch (type) { - GtkWidget *win = NULL; - - LL_INFOS() << "Creating a dialog because we're in windowed mode and GTK is happy." << LL_ENDL; - - GtkDialogFlags flags = GTK_DIALOG_MODAL; - GtkMessageType messagetype; - GtkButtonsType buttons; - switch (type) - { default: case OSMB_OK: - messagetype = GTK_MESSAGE_WARNING; - buttons = GTK_BUTTONS_OK; + oData.flags = SDL_MESSAGEBOX_WARNING; + oData.buttons = btnOk; + oData.numbuttons = 1; break; case OSMB_OKCANCEL: - messagetype = GTK_MESSAGE_QUESTION; - buttons = GTK_BUTTONS_OK_CANCEL; + oData.flags = SDL_MESSAGEBOX_INFORMATION; + oData.buttons = btnOkCancel; + oData.numbuttons = 2; break; case OSMB_YESNO: - messagetype = GTK_MESSAGE_QUESTION; - buttons = GTK_BUTTONS_YES_NO; + oData.flags = SDL_MESSAGEBOX_INFORMATION; + oData.buttons = btnYesNo; + oData.numbuttons = 2; break; - } - win = gtk_message_dialog_new(NULL, flags, messagetype, buttons, "%s", - text.c_str()); - -# if LL_X11 - // Make GTK tell the window manager to associate this - // dialog with our non-GTK SDL window, which should try - // to keep it on top etc. - if (gWindowImplementation && - gWindowImplementation->mSDL_XWindowID != None) - { - gtk_widget_realize(GTK_WIDGET(win)); // so we can get its gdkwin - GdkWindow *gdkwin = gdk_window_foreign_new(gWindowImplementation->mSDL_XWindowID); - gdk_window_set_transient_for(GTK_WIDGET(win)->window, - gdkwin); - } -# endif //LL_X11 - - gtk_window_set_position(GTK_WINDOW(win), - GTK_WIN_POS_CENTER_ON_PARENT); - - gtk_window_set_type_hint(GTK_WINDOW(win), - GDK_WINDOW_TYPE_HINT_DIALOG); - - if (!caption.empty()) - gtk_window_set_title(GTK_WINDOW(win), caption.c_str()); - - gint response = GTK_RESPONSE_NONE; - g_signal_connect (win, - "response", - G_CALLBACK (response_callback), - &response); + } - // we should be able to use a gtk_dialog_run(), but it's - // apparently not written to exist in a world without a higher - // gtk_main(), so we manage its signal/destruction outselves. - gtk_widget_show_all (win); - gtk_main(); + if(gWindowImplementation != nullptr) + gWindowImplementation->beforeDialog(); - //LL_INFOS() << "response: " << response << LL_ENDL; - switch (response) - { - case GTK_RESPONSE_OK: rtn = OSBTN_OK; break; - case GTK_RESPONSE_YES: rtn = OSBTN_YES; break; - case GTK_RESPONSE_NO: rtn = OSBTN_NO; break; - case GTK_RESPONSE_APPLY: rtn = OSBTN_OK; break; - case GTK_RESPONSE_NONE: - case GTK_RESPONSE_CANCEL: - case GTK_RESPONSE_CLOSE: - case GTK_RESPONSE_DELETE_EVENT: - default: rtn = OSBTN_CANCEL; - } - } - else + int btn{0}; + if(SDL_ShowMessageBox( &oData, &btn )) { - LL_INFOS() << "MSGBOX: " << caption << ": " << text << LL_ENDL; - LL_INFOS() << "Skipping dialog because we're in fullscreen mode or GTK is not happy." << LL_ENDL; - rtn = OSBTN_OK; + if(gWindowImplementation != nullptr) + gWindowImplementation->afterDialog(); + return btn; } - if(gWindowImplementation != NULL) + if(gWindowImplementation != nullptr) gWindowImplementation->afterDialog(); - return rtn; + return OSBTN_CANCEL; } -static void color_changed_callback(GtkWidget *widget, - gpointer user_data) +bool LLWindowSDL::dialogColorPicker( F32 *r, F32 *g, F32 *b) { - GtkColorSelection *colorsel = GTK_COLOR_SELECTION(widget); - GdkColor *colorp = (GdkColor*)user_data; - - gtk_color_selection_get_current_color(colorsel, colorp); + return false; } - /* Make the raw keyboard data available - used to poke through to LLQtWebKit so that Qt/Webkit has access to the virtual keycodes etc. that it needs */ LLSD LLWindowSDL::getNativeKeyData() { - LLSD result = LLSD::emptyMap(); + LLSD result = LLSD::emptyMap(); U32 modifiers = 0; // pretend-native modifiers... oh what a tangled web we weave! @@ -2367,140 +1804,21 @@ LLSD LLWindowSDL::getNativeKeyData() // what a plugin under GDK under Qt under SL under SDL under X11 considers // a 'native' modifier mask. this has been sort of reverse-engineered... they *appear* // to match GDK consts, but that may be co-incidence. - modifiers |= (mKeyModifiers & KMOD_LSHIFT) ? 0x0001 : 0; - modifiers |= (mKeyModifiers & KMOD_RSHIFT) ? 0x0001 : 0;// munge these into the same shift - modifiers |= (mKeyModifiers & KMOD_CAPS) ? 0x0002 : 0; - modifiers |= (mKeyModifiers & KMOD_LCTRL) ? 0x0004 : 0; - modifiers |= (mKeyModifiers & KMOD_RCTRL) ? 0x0004 : 0;// munge these into the same ctrl - modifiers |= (mKeyModifiers & KMOD_LALT) ? 0x0008 : 0;// untested - modifiers |= (mKeyModifiers & KMOD_RALT) ? 0x0008 : 0;// untested + modifiers |= (mKeyModifiers & SDL_KMOD_LSHIFT) ? 0x0001 : 0; + modifiers |= (mKeyModifiers & SDL_KMOD_RSHIFT) ? 0x0001 : 0;// munge these into the same shift + modifiers |= (mKeyModifiers & SDL_KMOD_CAPS) ? 0x0002 : 0; + modifiers |= (mKeyModifiers & SDL_KMOD_LCTRL) ? 0x0004 : 0; + modifiers |= (mKeyModifiers & SDL_KMOD_RCTRL) ? 0x0004 : 0;// munge these into the same ctrl + modifiers |= (mKeyModifiers & SDL_KMOD_LALT) ? 0x0008 : 0;// untested + modifiers |= (mKeyModifiers & SDL_KMOD_RALT) ? 0x0008 : 0;// untested // *todo: test ALTs - I don't have a case for testing these. Do you? // *todo: NUM? - I don't care enough right now (and it's not a GDK modifier). - result["scan_code"] = (S32)mKeyScanCode; - result["virtual_key"] = (S32)mKeyVirtualKey; + result["virtual_key"] = (S32)mKeyVirtualKey; + result["virtual_key_win"] = (S32)LLKeyboardSDL::mapSDL2toWin( mKeyVirtualKey ); result["modifiers"] = (S32)modifiers; - - return result; -} - - -bool LLWindowSDL::dialogColorPicker( F32 *r, F32 *g, F32 *b) -{ - bool rtn = false; - - beforeDialog(); - - if (ll_try_gtk_init()) - { - GtkWidget *win = NULL; - - win = gtk_color_selection_dialog_new(NULL); - -# if LL_X11 - // Get GTK to tell the window manager to associate this - // dialog with our non-GTK SDL window, which should try - // to keep it on top etc. - if (mSDL_XWindowID != None) - { - gtk_widget_realize(GTK_WIDGET(win)); // so we can get its gdkwin - GdkWindow *gdkwin = gdk_window_foreign_new(mSDL_XWindowID); - gdk_window_set_transient_for(GTK_WIDGET(win)->window, - gdkwin); - } -# endif //LL_X11 - - GtkColorSelection *colorsel = GTK_COLOR_SELECTION (GTK_COLOR_SELECTION_DIALOG(win)->colorsel); - - GdkColor color, orig_color; - orig_color.pixel = 0; - orig_color.red = guint16(65535 * *r); - orig_color.green= guint16(65535 * *g); - orig_color.blue = guint16(65535 * *b); - color = orig_color; - - gtk_color_selection_set_previous_color (colorsel, &color); - gtk_color_selection_set_current_color (colorsel, &color); - gtk_color_selection_set_has_palette (colorsel, true); - gtk_color_selection_set_has_opacity_control(colorsel, false); - - gint response = GTK_RESPONSE_NONE; - g_signal_connect (win, - "response", - G_CALLBACK (response_callback), - &response); - - g_signal_connect (G_OBJECT (colorsel), "color_changed", - G_CALLBACK (color_changed_callback), - &color); - - gtk_window_set_modal(GTK_WINDOW(win), true); - gtk_widget_show_all(win); - // hide the help button - we don't service it. - gtk_widget_hide(GTK_COLOR_SELECTION_DIALOG(win)->help_button); - gtk_main(); - - if (response == GTK_RESPONSE_OK && - (orig_color.red != color.red - || orig_color.green != color.green - || orig_color.blue != color.blue) ) - { - *r = color.red / 65535.0f; - *g = color.green / 65535.0f; - *b = color.blue / 65535.0f; - rtn = true; - } - } - - afterDialog(); - - return rtn; -} -#else -S32 OSMessageBoxSDL(const std::string& text, const std::string& caption, U32 type) -{ - LL_INFOS() << "MSGBOX: " << caption << ": " << text << LL_ENDL; - return 0; -} - -bool LLWindowSDL::dialogColorPicker( F32 *r, F32 *g, F32 *b) -{ - return (false); -} -#endif // LL_GTK - -#if LL_LINUX -// extracted from spawnWebBrowser for clarity and to eliminate -// compiler confusion regarding close(int fd) vs. LLWindow::close() -void exec_cmd(const std::string& cmd, const std::string& arg) -{ - char* const argv[] = {(char*)cmd.c_str(), (char*)arg.c_str(), NULL}; - fflush(NULL); - pid_t pid = fork(); - if (pid == 0) - { // child - // disconnect from stdin/stdout/stderr, or child will - // keep our output pipe undesirably alive if it outlives us. - close(0); - close(1); - close(2); - // end ourself by running the command - execv(cmd.c_str(), argv); /* Flawfinder: ignore */ - // if execv returns at all, there was a problem. - LL_WARNS() << "execv failure when trying to start " << cmd << LL_ENDL; - _exit(1); // _exit because we don't want atexit() clean-up! - } else { - if (pid > 0) - { - // parent - wait for child to die - int childExitStatus; - waitpid(pid, &childExitStatus, 0); - } else { - LL_WARNS() << "fork failure." << LL_ENDL; - } - } + return result; } -#endif // Open a URL with the user's default web browser. // Must begin with protocol identifier. @@ -2525,56 +1843,26 @@ void LLWindowSDL::spawnWebBrowser(const std::string& escaped_url, bool async) LL_INFOS() << "spawn_web_browser: " << escaped_url << LL_ENDL; -#if LL_LINUX -# if LL_X11 - if (mSDL_Display) - { - maybe_lock_display(); - // Just in case - before forking. - XSync(mSDL_Display, False); - maybe_unlock_display(); - } -# endif // LL_X11 - - std::string cmd, arg; - cmd = gDirUtilp->getAppRODataDir(); - cmd += gDirUtilp->getDirDelimiter(); - cmd += "etc"; - cmd += gDirUtilp->getDirDelimiter(); - cmd += "launch_url.sh"; - arg = escaped_url; - exec_cmd(cmd, arg); -#endif // LL_LINUX + if (!SDL_OpenURL(escaped_url.c_str())) + { + LL_WARNS() << "spawn_web_browser failed with error: " << SDL_GetError() << LL_ENDL; + } LL_INFOS() << "spawn_web_browser returning." << LL_ENDL; } - -void *LLWindowSDL::getPlatformWindow() +void* LLWindowSDL::getPlatformWindow() { -#if LL_GTK && LL_LLMOZLIB_ENABLED - if (LLWindowSDL::ll_try_gtk_init()) + void* ret = nullptr; + if (mWindow) { - maybe_lock_display(); - - GtkWidget *owin = gtk_window_new(GTK_WINDOW_POPUP); - // Why a layout widget? A MozContainer would be ideal, but - // it involves exposing Mozilla headers to mozlib-using apps. - // A layout widget with a GtkWindow parent has the desired - // properties of being plain GTK, having a window, and being - // derived from a GtkContainer. - GtkWidget *rtnw = gtk_layout_new(NULL, NULL); - gtk_container_add(GTK_CONTAINER(owin), rtnw); - gtk_widget_realize(rtnw); - GTK_WIDGET_UNSET_FLAGS(GTK_WIDGET(rtnw), GTK_NO_WINDOW); - - maybe_unlock_display(); - - return rtnw; +#if LL_WINDOWS + ret = SDL_GetPointerProperty(SDL_GetWindowProperties(mWindow), SDL_PROP_WINDOW_WIN32_HWND_POINTER, nullptr); +#elif LL_DARWIN + ret = SDL_GetPointerProperty(SDL_GetWindowProperties(mWindow), SDL_PROP_WINDOW_COCOA_WINDOW_POINTER, nullptr); +#endif } -#endif // LL_GTK && LL_LLMOZLIB_ENABLED - // Unixoid mozilla really needs GTK. - return NULL; + return ret; } void LLWindowSDL::bringToFront() @@ -2582,20 +1870,17 @@ void LLWindowSDL::bringToFront() // This is currently used when we are 'launched' to a specific // map position externally. LL_INFOS() << "bringToFront" << LL_ENDL; -#if LL_X11 - if (mSDL_Display && !mFullscreen) + if (mWindow && !mFullscreen) { - maybe_lock_display(); - XRaiseWindow(mSDL_Display, mSDL_XWindowID); - XSync(mSDL_Display, False); - maybe_unlock_display(); + SDL_RaiseWindow(mWindow); } -#endif // LL_X11 } //static std::vector LLWindowSDL::getDynamicFallbackFontList() { + std::vector rtns; +#if LL_LINUX // Use libfontconfig to find us a nice ordered list of fallback fonts // specific to this system. std::string final_fallback("/usr/share/fonts/truetype/kochi/kochi-gothic.ttf"); @@ -2612,9 +1897,9 @@ std::vector LLWindowSDL::getDynamicFallbackFontList() // renderable range if for some reason our FreeType actually fails // to use some of the fonts we want it to. const bool elide_unicode_coverage = true; - std::vector rtns; - FcFontSet *fs = NULL; - FcPattern *sortpat = NULL; + + FcFontSet *fs = nullptr; + FcPattern *sortpat = nullptr; LL_INFOS() << "Getting system font list from FontConfig..." << LL_ENDL; @@ -2623,7 +1908,7 @@ std::vector LLWindowSDL::getDynamicFallbackFontList() // of languages that can be displayed, but ensures that their // preferred language is rendered from a single consistent font where // possible. - FL_Locale *locale = NULL; + FL_Locale *locale = nullptr; FL_Success success = FL_FindLocale(&locale, FL_MESSAGES); if (success != 0) { @@ -2634,10 +1919,10 @@ std::vector LLWindowSDL::getDynamicFallbackFontList() LL_INFOS("AppInit") << "Variant " << locale->variant << LL_ENDL; LL_INFOS() << "Preferring fonts of language: " - << locale->lang - << LL_ENDL; + << locale->lang + << LL_ENDL; sort_order = "lang=" + std::string(locale->lang) + ":" - + sort_order; + + sort_order; } } FL_FreeLocale(&locale); @@ -2654,8 +1939,7 @@ std::vector LLWindowSDL::getDynamicFallbackFontList() { // Sort the list of system fonts from most-to-least-desirable. FcResult result; - fs = FcFontSort(NULL, sortpat, elide_unicode_coverage, - NULL, &result); + fs = FcFontSort(nullptr, sortpat, elide_unicode_coverage, nullptr, &result); FcPatternDestroy(sortpat); } @@ -2668,10 +1952,7 @@ std::vector LLWindowSDL::getDynamicFallbackFontList() for (int i=0; infont; ++i) { FcChar8 *filename; - if (FcResultMatch == FcPatternGetString(fs->fonts[i], - FC_FILE, 0, - &filename) - && filename) + if (FcResultMatch == FcPatternGetString(fs->fonts[i], FC_FILE, 0, &filename) && filename) { rtns.push_back(std::string((const char*)filename)); if (rtns.size() >= max_font_count_cutoff) @@ -2682,16 +1963,101 @@ std::vector LLWindowSDL::getDynamicFallbackFontList() } LL_DEBUGS() << "Using font list: " << LL_ENDL; - for (std::vector::iterator it = rtns.begin(); - it != rtns.end(); - ++it) + for (auto it = rtns.begin(); it != rtns.end(); ++it) { LL_DEBUGS() << " file: " << *it << LL_ENDL; } + LL_INFOS() << "Using " << rtns.size() << "/" << found_font_count << " system fonts." << LL_ENDL; rtns.push_back(final_fallback); +#endif return rtns; } -#endif // LL_SDL +void LLWindowSDL::setLanguageTextInput(const LLCoordGL& position) +{ + LLCoordWindow win_pos; + convertCoords( position, &win_pos ); + + SDL_Rect r; + r.x = win_pos.mX; + r.y = win_pos.mY; + r.w = 500; + r.h = 16; + + SDL_SetTextInputArea(mWindow, &r, 0); +} + +F32 LLWindowSDL::getSystemUISize() +{ + if(mWindow) + { + F32 scale = SDL_GetWindowDisplayScale(mWindow); + if (scale > 0.0f) + { + return scale; + } + } + return 1.f; +} + +#if LL_DARWIN +// static +U64 LLWindowSDL::getVramSize() +{ + CGLRendererInfoObj info = 0; + GLint vram_megabytes = 0; + int num_renderers = 0; + CGLError the_err = CGLQueryRendererInfo (CGDisplayIDToOpenGLDisplayMask(kCGDirectMainDisplay), &info, &num_renderers); + if(0 == the_err) + { + // The name, uses, and other platform definitions of gGLManager.mVRAM suggest that this is supposed to be total vram in MB, + // rather than, say, just the texture memory. The two exceptions are: + // 1. LLAppViewer::getViewerInfo() puts the value in a field labeled "TEXTURE_MEMORY" + // 2. For years, this present function used kCGLRPTextureMemoryMegabytes + // Now we use kCGLRPVideoMemoryMegabytes to bring it in line with everything else (except thatone label). + CGLDescribeRenderer (info, 0, kCGLRPVideoMemoryMegabytes, &vram_megabytes); + CGLDestroyRendererInfo (info); + } + else + { + vram_megabytes = 256; + } + + return (U64)vram_megabytes; // return value is in megabytes. +} + +//static +void LLWindowSDL::setUseMultGL(bool use_mult_gl) +{ + bool was_enabled = sUseMultGL; + + sUseMultGL = use_mult_gl; + + if (gGLManager.mInited) + { + CGLContextObj ctx = CGLGetCurrentContext(); + //enable multi-threaded OpenGL (whether or not sUseMultGL actually changed) + if (sUseMultGL) + { + CGLError cgl_err = CGLEnable( ctx, kCGLCEMPEngine); + if (cgl_err != kCGLNoError ) + { + LL_INFOS("GLInit") << "Multi-threaded OpenGL not available." << LL_ENDL; + sUseMultGL = false; + } + else + { + LL_INFOS("GLInit") << "Multi-threaded OpenGL enabled." << LL_ENDL; + } + } + else if (was_enabled) + { + CGLDisable( ctx, kCGLCEMPEngine); + LL_INFOS("GLInit") << "Multi-threaded OpenGL disabled." << LL_ENDL; + } + } +} +#endif + diff --git a/indra/llwindow/llwindowsdl.h b/indra/llwindow/llwindowsdl.h index 521d52df302..4d4a7a5f657 100644 --- a/indra/llwindow/llwindowsdl.h +++ b/indra/llwindow/llwindowsdl.h @@ -31,142 +31,163 @@ #include "llwindow.h" #include "lltimer.h" +#include "llmutex.h" -#include "SDL/SDL.h" -#include "SDL/SDL_endian.h" +#include "SDL3/SDL.h" +#include "SDL3/SDL_endian.h" -#if LL_X11 -// get X11-specific headers for use in low-level stuff like copy-and-paste support -#include "SDL/SDL_syswm.h" +#ifdef LL_WAYLAND +#include #endif -// AssertMacros.h does bad things. -#include "fix_macros.h" -#undef verify -#undef require +#if LL_X11 +#include +#include +#endif +class LLPreeditor; -class LLWindowSDL : public LLWindow +class LLWindowSDL final : public LLWindow { public: - /*virtual*/ void show(); - /*virtual*/ void hide(); - /*virtual*/ void close(); - /*virtual*/ bool getVisible(); - /*virtual*/ bool getMinimized(); - /*virtual*/ bool getMaximized(); - /*virtual*/ bool maximize(); - /*virtual*/ void minimize(); - /*virtual*/ void restore(); - /*virtual*/ bool getFullscreen(); - /*virtual*/ bool getPosition(LLCoordScreen *position); - /*virtual*/ bool getSize(LLCoordScreen *size); - /*virtual*/ bool getSize(LLCoordWindow *size); - /*virtual*/ bool setPosition(LLCoordScreen position); - /*virtual*/ bool setSizeImpl(LLCoordScreen size); - /*virtual*/ bool setSizeImpl(LLCoordWindow size); - /*virtual*/ bool switchContext(bool fullscreen, const LLCoordScreen &size, bool disable_vsync, const LLCoordScreen * const posp = NULL); - /*virtual*/ bool setCursorPosition(LLCoordWindow position); - /*virtual*/ bool getCursorPosition(LLCoordWindow *position); - /*virtual*/ bool isWrapMouse() const override { return true; } - /*virtual*/ void showCursor(); - /*virtual*/ void hideCursor(); - /*virtual*/ void showCursorFromMouseMove(); - /*virtual*/ void hideCursorUntilMouseMove(); - /*virtual*/ bool isCursorHidden(); - /*virtual*/ void updateCursor(); - /*virtual*/ void captureMouse(); - /*virtual*/ void releaseMouse(); - /*virtual*/ void setMouseClipping( bool b ); - /*virtual*/ void setMinSize(U32 min_width, U32 min_height, bool enforce_immediately = true); - - /*virtual*/ bool isClipboardTextAvailable(); - /*virtual*/ bool pasteTextFromClipboard(LLWString &dst); - /*virtual*/ bool copyTextToClipboard(const LLWString & src); - - /*virtual*/ bool isPrimaryTextAvailable(); - /*virtual*/ bool pasteTextFromPrimary(LLWString &dst); - /*virtual*/ bool copyTextToPrimary(const LLWString & src); - - /*virtual*/ void flashIcon(F32 seconds); - /*virtual*/ F32 getGamma(); - /*virtual*/ bool setGamma(const F32 gamma); // Set the gamma - /*virtual*/ U32 getFSAASamples(); - /*virtual*/ void setFSAASamples(const U32 samples); - /*virtual*/ bool restoreGamma(); // Restore original gamma table (before updating gamma) - /*virtual*/ ESwapMethod getSwapMethod() { return mSwapMethod; } - /*virtual*/ void processMiscNativeEvents(); - /*virtual*/ void gatherInput(); - /*virtual*/ void swapBuffers(); - /*virtual*/ void restoreGLContext() {}; - - /*virtual*/ void delayInputProcessing() { }; + void show() override; + void hide() override; + void restore() override; + + void close() override; + + bool getVisible() override; + + bool getMinimized() override; + + bool getMaximized() override; + + bool maximize() override; + void minimize() override; + + bool getPosition(LLCoordScreen *position) override; + + bool getSize(LLCoordScreen *size) override; + bool getSize(LLCoordWindow *size) override; + + bool setPosition(LLCoordScreen position) override; + + bool setSizeImpl(LLCoordScreen size) override; + bool setSizeImpl(LLCoordWindow size) override; + + bool switchContext(bool fullscreen, const LLCoordScreen &size, bool enable_vsync, + const LLCoordScreen *const posp = NULL) override; + + bool setCursorPosition(LLCoordWindow position) override; + + bool getCursorPosition(LLCoordWindow *position) override; + bool isWrapMouse() const override { return true; } + void showCursor() override; + void hideCursor() override; + bool isCursorHidden() override; + + void showCursorFromMouseMove() override; + void hideCursorUntilMouseMove() override; + + void updateCursor() override; + + void captureMouse() override; + void releaseMouse() override; + + void setMouseClipping(bool b) override; + + void setMinSize(U32 min_width, U32 min_height, bool enforce_immediately = true) override; + + bool isClipboardTextAvailable() override; + bool pasteTextFromClipboard(LLWString &dst) override; + bool copyTextToClipboard(const LLWString &src) override; + + bool isPrimaryTextAvailable() override; + bool pasteTextFromPrimary(LLWString &dst) override; + bool copyTextToPrimary(const LLWString &src) override; + + void flashIcon(F32 seconds) override; + void maybeStopFlashIcon(); + + F32 getGamma() override; + bool setGamma(const F32 gamma) override; // Set the gamma + bool restoreGamma() override; // Restore original gamma table (before updating gamma) + + U32 getFSAASamples() override; + void setFSAASamples(const U32 samples) override; + + void processMiscNativeEvents() override; + + void gatherInput() override; + + SDL_AppResult handleEvent(const SDL_Event& event); + static SDL_AppResult handleEvents(const SDL_Event& event); + + void swapBuffers() override; + + void delayInputProcessing() override {}; // handy coordinate space conversion routines - /*virtual*/ bool convertCoords(LLCoordScreen from, LLCoordWindow *to); - /*virtual*/ bool convertCoords(LLCoordWindow from, LLCoordScreen *to); - /*virtual*/ bool convertCoords(LLCoordWindow from, LLCoordGL *to); - /*virtual*/ bool convertCoords(LLCoordGL from, LLCoordWindow *to); - /*virtual*/ bool convertCoords(LLCoordScreen from, LLCoordGL *to); - /*virtual*/ bool convertCoords(LLCoordGL from, LLCoordScreen *to); + bool convertCoords(LLCoordScreen from, LLCoordWindow *to) override; + bool convertCoords(LLCoordWindow from, LLCoordScreen *to) override; + bool convertCoords(LLCoordWindow from, LLCoordGL *to) override; + bool convertCoords(LLCoordGL from, LLCoordWindow *to) override; + bool convertCoords(LLCoordScreen from, LLCoordGL *to) override; + bool convertCoords(LLCoordGL from, LLCoordScreen *to) override; + + LLWindowResolution *getSupportedResolutions(S32 &num_resolutions) override; + + F32 getNativeAspectRatio() override; + F32 getPixelAspectRatio() override; + void setNativeAspectRatio(F32 ratio) override { mOverrideAspectRatio = ratio; } + + void beforeDialog() override; + void afterDialog() override; - /*virtual*/ LLWindowResolution* getSupportedResolutions(S32 &num_resolutions); - /*virtual*/ F32 getNativeAspectRatio(); - /*virtual*/ F32 getPixelAspectRatio(); - /*virtual*/ void setNativeAspectRatio(F32 ratio) { mOverrideAspectRatio = ratio; } + bool dialogColorPicker(F32 *r, F32 *g, F32 *b) override; - /*virtual*/ void beforeDialog(); - /*virtual*/ void afterDialog(); + void *getPlatformWindow() override; - /*virtual*/ bool dialogColorPicker(F32 *r, F32 *g, F32 *b); + void bringToFront() override; - /*virtual*/ void *getPlatformWindow(); - /*virtual*/ void bringToFront(); + void setLanguageTextInput(const LLCoordGL& pos) override; - /*virtual*/ void spawnWebBrowser(const std::string& escaped_url, bool async); + void spawnWebBrowser(const std::string &escaped_url, bool async) override; + + void setTitle(const std::string title) override; static std::vector getDynamicFallbackFontList(); - // Not great that these are public, but they have to be accessible - // by non-class code and it's better than making them global. -#if LL_X11 - Window mSDL_XWindowID; - Display *mSDL_Display; -#endif - void (*Lock_Display)(void); - void (*Unlock_Display)(void); + void *createSharedContext() override; + void makeContextCurrent(void *context) override; + void destroySharedContext(void *context) override; + void toggleVSync(bool enable_vsync) override; -#if LL_GTK - // Lazily initialize and check the runtime GTK version for goodness. - static bool ll_try_gtk_init(void); -#endif // LL_GTK + F32 getSystemUISize() override; -#if LL_X11 - static Window get_SDL_XWindowID(void); - static Display* get_SDL_Display(void); -#endif // LL_X11 + static std::vector getDisplaysResolutionList(); -protected: - LLWindowSDL(LLWindowCallbacks* callbacks, - const std::string& title, int x, int y, int width, int height, U32 flags, - bool fullscreen, bool clearBg, bool disable_vsync, bool use_gl, - bool ignore_pixel_depth, U32 fsaa_samples); - ~LLWindowSDL(); +#if LL_DARWIN + static U64 getVramSize(); + static void setUseMultGL(bool use_mult_gl); - /*virtual*/ bool isValid(); - /*virtual*/ LLSD getNativeKeyData(); + static bool sUseMultGL; +#endif - void initCursors(); - void quitCursors(); - void moveWindow(const LLCoordScreen& position,const LLCoordScreen& size); +protected: + LLWindowSDL(LLWindowCallbacks *callbacks, + const std::string &title, const std::string& name, int x, int y, int width, int height, U32 flags, + bool fullscreen, bool clearBg, bool enable_vsync, bool use_gl, + bool ignore_pixel_depth, U32 fsaa_samples); + + ~LLWindowSDL(); - // Changes display resolution. Returns true if successful - bool setDisplayResolution(S32 width, S32 height, S32 bits, S32 refresh); + bool isValid() override; - // Go back to last fullscreen display resolution. - bool setFullscreenResolution(); + LLSD getNativeKeyData() override; - bool shouldPostQuit() { return mPostQuit; } + void initCursors(); + void quitCursors(); protected: // @@ -174,47 +195,67 @@ class LLWindowSDL : public LLWindow // // create or re-create the GL context/window. Called from the constructor and switchContext(). - bool createContext(int x, int y, int width, int height, int bits, bool fullscreen, bool disable_vsync); + bool createContext(int x, int y, int width, int height, int bits, bool fullscreen, bool enable_vsync); void destroyContext(); - void setupFailure(const std::string& text, const std::string& caption, U32 type); - void fixWindowSize(void); - U32 SDLCheckGrabbyKeys(SDLKey keysym, bool gain); + + void setupFailure(const std::string &text, const std::string &caption, U32 type); + bool SDLReallyCaptureInput(bool capture); + U32 SDLCheckGrabbyKeys(U32 keysym, bool gain); // // Platform specific variables // - U32 mGrabbyKeyFlags; - int mReallyCapturedCount; - SDL_Surface * mWindow; - std::string mWindowTitle; - double mOriginalAspectRatio; - bool mNeedsResize; // Constructor figured out the window is too big, it needs a resize. - LLCoordScreen mNeedsResizeSize; - F32 mOverrideAspectRatio; - F32 mGamma; - U32 mFSAASamples; - - int mSDLFlags; + U32 mGrabbyKeyFlags = 0; + S32 mReallyCapturedCount = 0; + SDL_Window *mWindow = nullptr; + SDL_GLContext mContext; + SDL_Cursor *mSDLCursors[UI_CURSOR_COUNT]; - SDL_Cursor* mSDLCursors[UI_CURSOR_COUNT]; - int mHaveInputFocus; /* 0=no, 1=yes, else unknown */ - int mIsMinimized; /* 0=no, 1=yes, else unknown */ + std::string mWindowTitle; + F32 mNativeAspectRatio = 0.0f; + F32 mOverrideAspectRatio = 0.0f; + F32 mGamma = 0.0f; + U32 mFSAASamples = 0; friend class LLWindowManager; private: -#if LL_X11 - void x11_set_urgent(bool urgent); - bool mFlashing; + bool mFlashing = false; LLTimer mFlashTimer; -#endif //LL_X11 + U32 mKeyVirtualKey = 0; + U32 mKeyModifiers = SDL_KMOD_NONE; - U32 mKeyScanCode; - U32 mKeyVirtualKey; - SDLMod mKeyModifiers; -}; + LLMutex mOSRMutex; + std::unordered_map mOSRContexts; + std::list mDeadOSRWindows; + void tryFindFullscreenSize(int &aWidth, int &aHeight); + + enum EServerProtocol{ X11, Wayland, Unknown }; + EServerProtocol mServerProtocol = Unknown; +public: +#if LL_X11 + // X11 + struct X11_DATA + { + Display* xdisplay = nullptr; + Window xwindow = 0; + int xscreen = -1; + }; + static X11_DATA sX11Data; +#endif + +#if LL_WAYLAND + // Wayland + struct WAYLAND_DATA + { + struct wl_display* display = nullptr; + struct wl_surface* surface = nullptr; + }; + static WAYLAND_DATA sWaylandData; +#endif +}; class LLSplashScreenSDL : public LLSplashScreen { @@ -222,9 +263,9 @@ class LLSplashScreenSDL : public LLSplashScreen LLSplashScreenSDL(); virtual ~LLSplashScreenSDL(); - /*virtual*/ void showImpl(); - /*virtual*/ void updateImpl(const std::string& mesg); - /*virtual*/ void hideImpl(); + void showImpl() override; + void updateImpl(const std::string& mesg) override; + void hideImpl() override; }; S32 OSMessageBoxSDL(const std::string& text, const std::string& caption, U32 type); diff --git a/indra/llwindow/llwindowwin32.cpp b/indra/llwindow/llwindowwin32.cpp index 824d0f5ec62..45326444d5d 100644 --- a/indra/llwindow/llwindowwin32.cpp +++ b/indra/llwindow/llwindowwin32.cpp @@ -204,6 +204,7 @@ HKL LLWindowWin32::sWinInputLocale = 0; DWORD LLWindowWin32::sWinIMEConversionMode = IME_CMODE_NATIVE; DWORD LLWindowWin32::sWinIMESentenceMode = IME_SMODE_AUTOMATIC; LLCoordWindow LLWindowWin32::sWinIMEWindowPosition(-1,-1); +HMODULE LLWindowWin32::sGLDLLHandle = nullptr; static HWND sWindowHandleForMessageBox = NULL; @@ -458,7 +459,7 @@ LLWindowWin32::LLWindowWin32(LLWindowCallbacks* callbacks, mWindowThread = new LLWindowWin32Thread(); //MAINT-516 -- force a load of opengl32.dll just in case windows went sideways - LoadLibrary(L"opengl32.dll"); + sGLDLLHandle = LoadLibrary(L"opengl32.dll"); if (mMaxCores != 0) @@ -1690,6 +1691,8 @@ const S32 max_format = (S32)num_formats - 1; return false; } + gGLManager.initWGL(); // Reinit WGL functions once we have our full context + if (!gGLManager.initGL()) { LLError::LLUserWarningMsg::show(mCallbacks->translateString("MBVideoDrvErr"), 8/*LAST_EXEC_GRAPHICS_INIT*/); @@ -2502,16 +2505,13 @@ LRESULT CALLBACK LLWindowWin32::mainWindowProc(HWND h_wnd, UINT u_msg, WPARAM w_ // Comes after WM_QUERYENDSESSION LL_PROFILE_ZONE_NAMED_CATEGORY_WIN32("mwp - WM_ENDSESSION"); LL_INFOS("Window") << "Received WM_ENDSESSION with wParam: " << (U32)w_param << " lParam: " << (U32)l_param << LL_ENDL; - unsigned int end_session_flags = (U32)w_param; - if (end_session_flags == 0) - { - // session is not actually ending - return 0; - } + unsigned int end_session_flags = (U32)l_param; - if ((end_session_flags & ENDSESSION_CLOSEAPP) - || (end_session_flags & ENDSESSION_CRITICAL) - || (end_session_flags & ENDSESSION_LOGOFF)) + if (w_param == TRUE // if true, session is ending + || end_session_flags == 0 // not possible to determine type of the event + // || (end_session_flags & ENDSESSION_CLOSEAPP)) system update or low resources, must be acompanied by w_param == TRUE + || (end_session_flags & ENDSESSION_CRITICAL) // will shutdown regardless of app state + || (end_session_flags & ENDSESSION_LOGOFF)) // logoff, can delay shutdown { window_imp->post([=]() { @@ -2520,13 +2520,13 @@ LRESULT CALLBACK LLWindowWin32::mainWindowProc(HWND h_wnd, UINT u_msg, WPARAM w_ { // Get the app to initiate cleanup. window_imp->mCallbacks->handleQuit(window_imp); - // The app is responsible for calling destroyWindow when done with GL } }); // Give app a second to finish up. That's not enough for a clean exit, // but better than nothing. // Todo: sync this better, some kind of waitForResult? Can't wait forever, - // but can potentially use ShutdownBlockReasonCreate for a bigger delay. + // but for ENDSESSION_LOGOFF can potentially use ShutdownBlockReasonCreate + // for a bigger delay. ms_sleep(1000); } // Don't need to post quit or destroy window, @@ -4659,6 +4659,18 @@ F32 LLWindowWin32::getSystemUISize() return scale_value; } +//static +PROC WINAPI LLWindowWin32::getProcAddress(const char* func) +{ + PROC ret_func = wglGetProcAddress(func); + if (!ret_func && sGLDLLHandle) + { + // Try to fallback to OpenGL32.dll + ret_func = GetProcAddress(sGLDLLHandle, func); + } + return ret_func; +} + //static std::vector LLWindowWin32::getDisplaysResolutionList() { diff --git a/indra/llwindow/llwindowwin32.h b/indra/llwindow/llwindowwin32.h index 0fc93ad0b12..77217747cc6 100644 --- a/indra/llwindow/llwindowwin32.h +++ b/indra/llwindow/llwindowwin32.h @@ -125,6 +125,7 @@ class LLWindowWin32 : public LLWindow LLWindowCallbacks::DragNDropResult completeDragNDropRequest( const LLCoordGL gl_coord, const MASK mask, LLWindowCallbacks::DragNDropAction action, const std::string url ); + static PROC WINAPI getProcAddress(const char* func); static std::vector getDisplaysResolutionList(); static std::vector getDynamicFallbackFontList(); static void setDPIAwareness(); @@ -244,6 +245,8 @@ class LLWindowWin32 : public LLWindow bool mMouseVanish; + static HMODULE sGLDLLHandle; + // Cached values of GetWindowRect and GetClientRect to be used by app thread void updateWindowRect(); RECT mRect; diff --git a/indra/llxml/CMakeLists.txt b/indra/llxml/CMakeLists.txt index 508c2b919b7..bc79e2ef195 100644 --- a/indra/llxml/CMakeLists.txt +++ b/indra/llxml/CMakeLists.txt @@ -34,6 +34,9 @@ target_link_libraries( llxml ) target_include_directories( llxml INTERFACE ${CMAKE_CURRENT_SOURCE_DIR}) +if (USE_PRECOMPILED_HEADERS) + target_precompile_headers(llxml REUSE_FROM llprecompiled) +endif () # tests diff --git a/indra/llxml/llcontrol.h b/indra/llxml/llcontrol.h index 4f54a9d705a..da7268bf457 100644 --- a/indra/llxml/llcontrol.h +++ b/indra/llxml/llcontrol.h @@ -28,15 +28,15 @@ #define LL_LLCONTROL_H #include "llboost.h" -#include "llevent.h" #include "llstring.h" +#include "llpointer.h" #include "llrect.h" #include "llrefcount.h" #include "llinstancetracker.h" +#include #include -#include #include class LLVector3; @@ -341,7 +341,7 @@ class LLControlCache : public LLRefCount, public LLInstanceTrackergetSignal()->connect(0, - boost::bind(&LLControlCache::handleValueChange, this, _2) + std::bind(&LLControlCache::handleValueChange, this, std::placeholders::_2) ); mType = controlp->type(); } @@ -400,7 +400,7 @@ class LLCachedControl } operator const T&() const { return mCachedControlPtr->getValue(); } - operator boost::function () const { return boost::function(*this); } + operator std::function () const { return std::function(*this); } const T& operator()() { return mCachedControlPtr->getValue(); } private: diff --git a/indra/media_plugins/CMakeLists.txt b/indra/media_plugins/CMakeLists.txt index 972bb7dd2de..600db532d26 100644 --- a/indra/media_plugins/CMakeLists.txt +++ b/indra/media_plugins/CMakeLists.txt @@ -1,20 +1,10 @@ # -*- cmake -*- add_subdirectory(base) +add_subdirectory(cef) +add_subdirectory(libvlc) +add_subdirectory(example) if (LINUX) - #add_subdirectory(gstreamer010) - add_subdirectory(example) + add_subdirectory(gstreamer10) endif (LINUX) - -if (DARWIN) - add_subdirectory(cef) - add_subdirectory(libvlc) - add_subdirectory(example) -endif (DARWIN) - -if (WINDOWS) - add_subdirectory(cef) - add_subdirectory(libvlc) - add_subdirectory(example) -endif (WINDOWS) diff --git a/indra/media_plugins/base/media_plugin_base.cpp b/indra/media_plugins/base/media_plugin_base.cpp index ccaa43cfb50..2e1e43d9e84 100644 --- a/indra/media_plugins/base/media_plugin_base.cpp +++ b/indra/media_plugins/base/media_plugin_base.cpp @@ -167,6 +167,55 @@ void MediaPluginBase::sendStatus() sendMessage(message); } +#if LL_LINUX + +#include + +size_t SymbolGrabber::registerSymbol( SymbolToGrab aSymbol ) +{ + gSymbolsToGrab.emplace_back(aSymbol); + return gSymbolsToGrab.size(); +} + +bool SymbolGrabber::grabSymbols(std::vector< std::string > const &aDSONames) +{ + if (sSymsGrabbed) + return true; + + for( std::vector< std::string >::const_iterator itr = aDSONames.begin(); itr != aDSONames.end(); ++itr ) + { + auto pDSO = dlopen( itr->c_str(), RTLD_NOW ); + + if( pDSO ) + { + sLoadedLibraries.push_back(pDSO); + + for (auto i = 0; i < gSymbolsToGrab.size(); ++i) + { + if (!*gSymbolsToGrab[i].mPPFunc) + *gSymbolsToGrab[i].mPPFunc = dlsym(pDSO, gSymbolsToGrab[i].mName); + } + } + } + + bool sym_error = false; + + for( auto i = 0; i < gSymbolsToGrab.size(); ++i ) + { + if( gSymbolsToGrab[ i ].mRequired && ! *gSymbolsToGrab[ i ].mPPFunc ) + sym_error = true; + } + + sSymsGrabbed = !sym_error; + return sSymsGrabbed; +} + +void SymbolGrabber::ungrabSymbols() +{ + +} +#endif + #if LL_WINDOWS # define LLSYMEXPORT __declspec(dllexport) @@ -202,3 +251,50 @@ int WINAPI DllEntryPoint( HINSTANCE hInstance, unsigned long reason, void* param return 1; } #endif + +#if LL_LINUX +pid_t getParentPid( pid_t aPid ) +{ + std::stringstream strm; + strm << "/proc/" << aPid << "/status"; + std::ifstream in{ strm.str() }; + + if( !in.is_open() ) + return 0; + + pid_t res {0}; + while( !in.eof() && res == 0 ) + { + std::string line; + line.resize( 1024, 0 ); + in.getline( &line[0], line.length() ); + + auto i = line.find( "PPid:" ); + + if( i == std::string::npos ) + continue; + + char const *pIn = line.c_str() + 5; // Skip over pid; + while( *pIn != 0 && isspace( *pIn ) ) + ++pIn; + + if( *pIn ) + res = atoll( pIn ); + } + return res; +} + +bool isPluginPid( pid_t aPid ) +{ + auto myPid = getpid(); + + do + { + if( aPid == myPid ) + return true; + aPid = getParentPid( aPid ); + } while( aPid > 1 ); + + return false; +} +#endif diff --git a/indra/media_plugins/base/media_plugin_base.h b/indra/media_plugins/base/media_plugin_base.h index f65c712a66b..0f014f83355 100644 --- a/indra/media_plugins/base/media_plugin_base.h +++ b/indra/media_plugins/base/media_plugin_base.h @@ -32,6 +32,40 @@ #include "llpluginmessage.h" #include "llpluginmessageclasses.h" +#if LL_LINUX + +struct SymbolToGrab +{ + bool mRequired; + char const *mName; + void **mPPFunc; +}; + +class SymbolGrabber +{ +public: + size_t registerSymbol( SymbolToGrab aSymbol ); + bool grabSymbols(std::vector< std::string > const &aDSONames); + void ungrabSymbols(); + +private: + std::vector< SymbolToGrab > gSymbolsToGrab; + + bool sSymsGrabbed = false; + std::vector sLoadedLibraries; +}; + +extern SymbolGrabber gSymbolGrabber; + +// extern SymbolGrabber gSymbolGrabber; + +#define LL_GRAB_SYM(SYMBOL_GRABBER, REQUIRED, SYMBOL_NAME, RETURN, ...) \ + RETURN (*ll##SYMBOL_NAME)(__VA_ARGS__) = nullptr; \ + size_t gRegistered##SYMBOL_NAME = SYMBOL_GRABBER.registerSymbol( \ + { REQUIRED, #SYMBOL_NAME , (void**)&ll##SYMBOL_NAME} \ + ); + +#endif class MediaPluginBase { @@ -126,4 +160,7 @@ int init_media_plugin( LLPluginInstance::sendMessageFunction *plugin_send_func, void **plugin_user_data); - +#if LL_LINUX +pid_t getParentPid(pid_t aPid); +bool isPluginPid(pid_t aPid); +#endif diff --git a/indra/media_plugins/cef/CMakeLists.txt b/indra/media_plugins/cef/CMakeLists.txt index dc2d82017d0..3a91e398d5d 100644 --- a/indra/media_plugins/cef/CMakeLists.txt +++ b/indra/media_plugins/cef/CMakeLists.txt @@ -10,7 +10,7 @@ include(Linking) include(PluginAPI) include(CEFPlugin) - +include(GLIB) ### media_plugin_cef @@ -23,20 +23,38 @@ set(media_plugin_cef_HEADER_FILES ) # 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_null.cpp) - find_library(CORESERVICES_LIBRARY CoreServices) - find_library(AUDIOUNIT_LIBRARY AudioUnit) - set( media_plugin_cef_LINK_LIBRARIES - ${CORESERVICES_LIBRARY} # for Component Manager calls - ${AUDIOUNIT_LIBRARY} # for AudioUnit calls - ) +if (FALSE) # Disable linux volume catcher due to issues dlopening with CEF 139 + foreach( PULSE_FILE pulse/introspect.h pulse/context.h pulse/subscribe.h pulse/glib-mainloop.h ) + find_path( PULSE_FILE_${PULSE_FILE}_FOUND ${PULSE_FILE} NO_CACHE) + if( NOT PULSE_FILE_${PULSE_FILE}_FOUND ) + message( "Looking for ${PULSE_FILE} ... not found") + message( FATAL_ERROR "Pulse header not found" ) + else() + message( "Looking for ${PULSE_FILE} ... found") + endif() + endforeach() + + include(FindPipeWire) + include_directories(SYSTEM ${PIPEWIRE_INCLUDE_DIRS} ${SPA_INCLUDE_DIRS}) + + message( "Building with Linux volume catcher for PipeWire and PulseAudio" ) + + list(APPEND media_plugin_cef_HEADER_FILES + linux/volume_catcher_linux.h + ) + + set(LINUX_VOLUME_CATCHER + linux/volume_catcher_linux.cpp + linux/volume_catcher_pulseaudio.cpp + linux/volume_catcher_pipewire.cpp + ) + + list(APPEND media_plugin_cef_SOURCE_FILES ${LINUX_VOLUME_CATCHER}) elseif (WINDOWS) list(APPEND media_plugin_cef_SOURCE_FILES windows_volume_catcher.cpp) -endif (LINUX) +else() + list(APPEND media_plugin_cef_SOURCE_FILES volume_catcher_null.cpp) +endif () list(APPEND media_plugin_cef_SOURCE_FILES ${media_plugin_cef_HEADER_FILES}) @@ -45,13 +63,10 @@ add_library(media_plugin_cef ${media_plugin_cef_SOURCE_FILES} ) -#add_dependencies(media_plugin_cef -# ${MEDIA_PLUGIN_BASE_LIBRARIES} -#) - target_link_libraries(media_plugin_cef media_plugin_base ll::cef + ll::glib_headers ) if (WINDOWS) @@ -60,9 +75,15 @@ if (WINDOWS) PROPERTIES LINK_FLAGS "/MANIFEST:NO /NODEFAULTLIB:LIBCMT /IGNORE:4099" ) -endif (WINDOWS) +elseif (DARWIN) + find_library(CORESERVICES_LIBRARY CoreServices) + find_library(AUDIOUNIT_LIBRARY AudioUnit) + + target_link_libraries(media_plugin_cef + ${CORESERVICES_LIBRARY} # for Component Manager calls + ${AUDIOUNIT_LIBRARY} # for AudioUnit calls + ) -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_cef @@ -73,4 +94,6 @@ if (DARWIN) LINK_FLAGS "-exported_symbols_list ${CMAKE_CURRENT_SOURCE_DIR}/../base/media_plugin_base.exp" ) -endif (DARWIN) +elseif (LINUX) + target_link_options(media_plugin_cef PRIVATE "LINKER:--build-id" "LINKER:-rpath,'$ORIGIN:$ORIGIN/../../lib'") +endif () diff --git a/indra/media_plugins/cef/linux/volume_catcher_linux.cpp b/indra/media_plugins/cef/linux/volume_catcher_linux.cpp new file mode 100644 index 00000000000..7d332420630 --- /dev/null +++ b/indra/media_plugins/cef/linux/volume_catcher_linux.cpp @@ -0,0 +1,78 @@ +/** + * @file volume_catcher.cpp + * @brief Linux volume catcher which will pick an implementation to use + * + * @cond + * $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$ + * @endcond + */ + +#include "volume_catcher_linux.h" + +VolumeCatcher::VolumeCatcher() +{ +} + +void VolumeCatcher::onEnablePipeWireVolumeCatcher(bool enable) +{ + if (pimpl != nullptr) + return; + + if (enable) + { + LL_DEBUGS() << "volume catcher using pipewire" << LL_ENDL; + pimpl = new VolumeCatcherPipeWire(); + } + else + { + LL_DEBUGS() << "volume catcher using pulseaudio" << LL_ENDL; + pimpl = new VolumeCatcherPulseAudio(); + } +} + +VolumeCatcher::~VolumeCatcher() +{ + if (pimpl != nullptr) + { + delete pimpl; + pimpl = nullptr; + } +} + +void VolumeCatcher::setVolume(F32 volume) +{ + if (pimpl != nullptr) { + pimpl->setVolume(volume); + } +} + +void VolumeCatcher::setPan(F32 pan) +{ + if (pimpl != nullptr) + pimpl->setPan(pan); +} + +void VolumeCatcher::pump() +{ + if (pimpl != nullptr) + pimpl->pump(); +} diff --git a/indra/media_plugins/cef/linux/volume_catcher_linux.h b/indra/media_plugins/cef/linux/volume_catcher_linux.h new file mode 100644 index 00000000000..505f9ffb314 --- /dev/null +++ b/indra/media_plugins/cef/linux/volume_catcher_linux.h @@ -0,0 +1,149 @@ +/** + * @file volume_catcher_impl.h + * @brief + * + * @cond + * $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$ + * @endcond + */ + +#ifndef VOLUME_CATCHER_LINUX_H +#define VOLUME_CATCHER_LINUX_H + +#include "linden_common.h" + +#include "../volume_catcher.h" + +#include +#include + +extern "C" { +// There's no special reason why we want the *glib* PA mainloop, but the generic polling implementation seems broken. +#include +#include + +#include + +#include "apr_pools.h" +#include "apr_dso.h" +} + +#include "media_plugin_base.h" + +class VolumeCatcherImpl +{ +public: + virtual ~VolumeCatcherImpl() = default; + + virtual void setVolume(F32 volume) = 0; // 0.0 - 1.0 + + // Set the left-right pan of audio sources + // where -1.0 = left, 0 = center, and 1.0 = right + virtual void setPan(F32 pan) = 0; + + virtual void pump() = 0; // call this at least a few times a second if you can - it affects how quickly we can 'catch' a new audio source and adjust its volume +}; + +class VolumeCatcherPulseAudio : public VolumeCatcherImpl +{ +public: + VolumeCatcherPulseAudio(); + ~VolumeCatcherPulseAudio(); + + void setVolume(F32 volume); + void setPan(F32 pan); + void pump(); + + // for internal use - can't be private because used from our C callbacks + + bool loadsyms(std::string pa_dso_name); + void init(); + void cleanup(); + + void update_all_volumes(F32 volume); + void update_index_volume(U32 index, F32 volume); + void connected_okay(); + + std::set mSinkInputIndices; + std::map mSinkInputNumChannels; + F32 mDesiredVolume; + pa_glib_mainloop *mMainloop; + pa_context *mPAContext; + bool mConnected; + bool mGotSyms; +}; + +class VolumeCatcherPipeWire : public VolumeCatcherImpl +{ +public: + VolumeCatcherPipeWire(); + ~VolumeCatcherPipeWire(); + + bool loadsyms(std::string pw_dso_name); + void init(); + void cleanup(); + + // some of these should be private + + void lock(); + void unlock(); + + void setVolume(F32 volume); + void setPan(F32 pan); + void pump(); + + void handleRegistryEventGlobal( + uint32_t id, uint32_t permissions, const char* type, + uint32_t version, const struct spa_dict* props + ); + + class ChildNode + { + public: + bool mActive = false; + + pw_proxy* mProxy = nullptr; + spa_hook mNodeListener {}; + spa_hook mProxyListener {}; + VolumeCatcherPipeWire* mImpl = nullptr; + + void updateVolume(); + void destroy(); + }; + + bool mGotSyms = false; + + F32 mVolume = 1.0f; // max by default + // F32 mPan = 0.0f; // center + + pw_thread_loop* mThreadLoop = nullptr; + pw_context* mContext = nullptr; + pw_core* mCore = nullptr; + pw_registry* mRegistry = nullptr; + spa_hook mRegistryListener; + + std::unordered_set mChildNodes; + std::mutex mChildNodesMutex; + std::mutex mCleanupMutex; +}; + +#endif // VOLUME_CATCHER_LINUX_H diff --git a/indra/media_plugins/cef/linux/volume_catcher_pipewire.cpp b/indra/media_plugins/cef/linux/volume_catcher_pipewire.cpp new file mode 100755 index 00000000000..73ef7fc18cb --- /dev/null +++ b/indra/media_plugins/cef/linux/volume_catcher_pipewire.cpp @@ -0,0 +1,333 @@ +/** + * @file volume_catcher_pipewire.cpp + * @brief A Linux-specific, PipeWire-specific hack to detect and volume-adjust new audio sources + * + * @cond + * $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$ + * @endcond + */ + +/* + The high-level design is as follows: + 1) Connect to the PipeWire daemon + 2) Find all existing and new audio nodes + 3) Examine PID and parent PID's to see if it belongs to our process + 4) If so, tell PipeWire to adjust the volume of that node + 5) Keep a list of all audio nodes and adjust when we setVolume() + */ + +#include "linden_common.h" + +#include "volume_catcher_linux.h" + +extern "C" { +#include +#include +} + +SymbolGrabber pwSymbolGrabber; + +#include "volume_catcher_pipewire_syms.inc" + +//////////////////////////////////////////////////// + +VolumeCatcherPipeWire::VolumeCatcherPipeWire() +{ + init(); +} + +VolumeCatcherPipeWire::~VolumeCatcherPipeWire() +{ + cleanup(); +} + +static void registryEventGlobal( + void *data, uint32_t id, uint32_t permissions, const char *type, + uint32_t version, const struct spa_dict *props) +{ + static_cast(data)->handleRegistryEventGlobal( + id, permissions, type, version, props + ); +} + +static const struct pw_registry_events REGISTRY_EVENTS = { + .version = PW_VERSION_REGISTRY_EVENTS, + .global = registryEventGlobal, +}; + +bool VolumeCatcherPipeWire::loadsyms(std::string pw_dso_name) +{ + return pwSymbolGrabber.grabSymbols({ pw_dso_name }); +} + +void VolumeCatcherPipeWire::init() +{ + LL_DEBUGS() << "init" << LL_ENDL; + + mGotSyms = loadsyms("libpipewire-0.3.so.0"); + + if (!mGotSyms) + return; + + LL_DEBUGS() << "successfully got symbols" << LL_ENDL; + + llpw_init(nullptr, nullptr); + + mThreadLoop = llpw_thread_loop_new("SL Plugin Volume Adjuster", nullptr); + + if (!mThreadLoop) + return; + + // i dont think we need to lock this early + // std::lock_guard pwLock(*this); + + mContext = llpw_context_new( + llpw_thread_loop_get_loop(mThreadLoop), nullptr, 0 + ); + + if (!mContext) + return; + + mCore = llpw_context_connect(mContext, nullptr, 0); + + if (!mCore) + return; + + mRegistry = pw_core_get_registry(mCore, PW_VERSION_REGISTRY, 0); + + LL_DEBUGS() << "pw_core_get_registry: " << (mRegistry?"success":"nullptr") << LL_ENDL; + + spa_zero(mRegistryListener); + + pw_registry_add_listener( + mRegistry, &mRegistryListener, ®ISTRY_EVENTS, this + ); + + llpw_thread_loop_start(mThreadLoop); + + LL_DEBUGS() << "thread loop started" << LL_ENDL; +} + +void VolumeCatcherPipeWire::cleanup() +{ + { + std::unique_lock childNodesLock(mChildNodesMutex); + for (auto *childNode: mChildNodes) + childNode->destroy(); + + mChildNodes.clear(); + } + + { + std::unique_lock pwLock(mCleanupMutex); + if (mRegistry) + llpw_proxy_destroy((struct pw_proxy *) mRegistry); + + spa_zero(mRegistryListener); + + if (mCore) + llpw_core_disconnect(mCore); + if (mContext) + llpw_context_destroy(mContext); + } + + if (!mThreadLoop) + return; + + llpw_thread_loop_stop(mThreadLoop); + llpw_thread_loop_destroy(mThreadLoop); + + LL_DEBUGS() << "cleanup done" << LL_ENDL; +} + +void VolumeCatcherPipeWire::lock() +{ + if (!mThreadLoop) + return; + + llpw_thread_loop_lock(mThreadLoop); +} + +void VolumeCatcherPipeWire::unlock() +{ + if (!mThreadLoop) + return; + + llpw_thread_loop_unlock(mThreadLoop); +} + +const uint32_t channels = 1; +const float resetVolumes[channels] = { 1.0f }; + +void VolumeCatcherPipeWire::ChildNode::updateVolume() +{ + if (!mActive) + return; + + F32 volume = std::clamp(mImpl->mVolume, 0.0f, 1.0f); + + const float volumes[channels] = { volume }; + + uint8_t buffer[512]; + + spa_pod_builder builder; + spa_pod_builder_init(&builder, buffer, sizeof(buffer)); + + spa_pod_frame frame; + spa_pod_builder_push_object(&builder, &frame, SPA_TYPE_OBJECT_Props, SPA_PARAM_Props); + + // resets system-wide memorized volume for chromium (not google chrome) to 100% + spa_pod_builder_prop(&builder, SPA_PROP_channelVolumes, 0); + spa_pod_builder_array(&builder, sizeof(float), SPA_TYPE_Float, channels, resetVolumes); + + // sets temporary volume + spa_pod_builder_prop(&builder, SPA_PROP_softVolumes, 0); + spa_pod_builder_array(&builder, sizeof(float), SPA_TYPE_Float, channels, volumes); + + spa_pod* pod = static_cast(spa_pod_builder_pop(&builder, &frame)); + + { + std::lock_guard pwLock(*mImpl); + pw_node_set_param((pw_node*)mProxy, SPA_PARAM_Props, 0, pod); + } +} + +void VolumeCatcherPipeWire::ChildNode::destroy() +{ + if (!mActive) + return; + + mActive = false; + + { + std::unique_lock childNodesLock(mImpl->mChildNodesMutex); + mImpl->mChildNodes.erase(this); + } + + spa_hook_remove(&mNodeListener); + spa_hook_remove(&mProxyListener); + + { + std::lock_guard pwLock(*mImpl); + llpw_proxy_destroy(mProxy); + } +} + +static void nodeEventInfo(void* data, const struct pw_node_info* info) +{ + const char* processId = spa_dict_lookup(info->props, PW_KEY_APP_PROCESS_ID); + + if (processId == nullptr) + return; + + pid_t pid = atoll(processId); + + if (!isPluginPid(pid)) + return; + + const char* appName = spa_dict_lookup(info->props, PW_KEY_APP_NAME); + LL_DEBUGS() << "got app: " << appName << LL_ENDL; + + auto* const childNode = static_cast(data); + LL_DEBUGS() << "init volume: " << childNode->mImpl->mVolume << LL_ENDL; + + childNode->updateVolume(); + + { + std::lock_guard childNodesLock(childNode->mImpl->mChildNodesMutex); + childNode->mImpl->mChildNodes.insert(childNode); + } +} + +static const struct pw_node_events NODE_EVENTS = { + .version = PW_VERSION_CLIENT_EVENTS, + .info = nodeEventInfo, +}; + +static void proxyEventDestroy(void* data) +{ + auto* const childNode = static_cast(data); + childNode->destroy(); +} + +static void proxyEventRemoved(void* data) +{ + auto* const childNode = static_cast(data); + childNode->destroy(); +} + +static const struct pw_proxy_events PROXY_EVENTS = { + .version = PW_VERSION_PROXY_EVENTS, + .destroy = proxyEventDestroy, + .removed = proxyEventRemoved, +}; + +void VolumeCatcherPipeWire::handleRegistryEventGlobal( + uint32_t id, uint32_t permissions, const char *type, uint32_t version, + const struct spa_dict *props) +{ + if (props == nullptr || type == nullptr || strcmp(type, PW_TYPE_INTERFACE_Node) != 0) + return; + + const char* mediaClass = spa_dict_lookup(props, PW_KEY_MEDIA_CLASS); + + if (mediaClass == nullptr || strcmp(mediaClass, "Stream/Output/Audio") != 0) + return; + + pw_proxy* proxy = static_cast( + pw_registry_bind(mRegistry, id, type, PW_VERSION_CLIENT, sizeof(ChildNode)) + ); + + auto* const childNode = static_cast(llpw_proxy_get_user_data(proxy)); + + childNode->mActive = true; + childNode->mProxy = proxy; + childNode->mImpl = this; + + pw_node_add_listener((pw_node*)proxy, &childNode->mNodeListener, &NODE_EVENTS, childNode); + llpw_proxy_add_listener(proxy, &childNode->mProxyListener, &PROXY_EVENTS, childNode); +} + +void VolumeCatcherPipeWire::setVolume(F32 volume) +{ + LL_DEBUGS() << "setting volume to: " << volume << LL_ENDL; + + mVolume = volume; + + { + std::unique_lock childNodeslock(mChildNodesMutex); + std::unordered_set copyOfChildNodes(mChildNodes); + + LL_DEBUGS() << "found " << copyOfChildNodes.size() << " child nodes" << LL_ENDL; + + for (auto* childNode : copyOfChildNodes) + childNode->updateVolume(); + } +} + +void VolumeCatcherPipeWire::setPan(F32 pan) +{ +} + +void VolumeCatcherPipeWire::pump() +{ +} diff --git a/indra/media_plugins/cef/linux/volume_catcher_pipewire_syms.inc b/indra/media_plugins/cef/linux/volume_catcher_pipewire_syms.inc new file mode 100644 index 00000000000..dbc0f5f169d --- /dev/null +++ b/indra/media_plugins/cef/linux/volume_catcher_pipewire_syms.inc @@ -0,0 +1,26 @@ +#define G pwSymbolGrabber + +// required symbols to grab +LL_GRAB_SYM(G, true, pw_init, void, int *argc, char **argv[]); +// LL_GRAB_SYM(G, true, pw_main_loop_new, struct pw_main_loop *, const struct spa_dict *props); +// LL_GRAB_SYM(G, true, pw_main_loop_get_loop, struct pw_loop *, struct pw_main_loop *loop); +// LL_GRAB_SYM(G, true, pw_main_loop_destroy, void, struct pw_main_loop *loop); +// LL_GRAB_SYM(G, true, pw_main_loop_run, void, struct pw_main_loop *loop); +LL_GRAB_SYM(G, true, pw_context_new, struct pw_context *, struct pw_loop *main_loop, struct pw_properties *props, size_t user_data_size); +LL_GRAB_SYM(G, true, pw_context_destroy, void, struct pw_context *context); +LL_GRAB_SYM(G, true, pw_context_connect, struct pw_core *, struct pw_context *context, struct pw_properties *properties, size_t user_data_size); +LL_GRAB_SYM(G, true, pw_thread_loop_new, struct pw_thread_loop *, const char *name, const struct spa_dict *props); +LL_GRAB_SYM(G, true, pw_thread_loop_destroy, void, struct pw_thread_loop *loop); +LL_GRAB_SYM(G, true, pw_thread_loop_get_loop, struct pw_loop *, struct pw_thread_loop *loop); +LL_GRAB_SYM(G, true, pw_thread_loop_start, int, struct pw_thread_loop *loop); +LL_GRAB_SYM(G, true, pw_thread_loop_stop, void, struct pw_thread_loop *loop); +LL_GRAB_SYM(G, true, pw_thread_loop_lock, void, struct pw_thread_loop *loop); +LL_GRAB_SYM(G, true, pw_thread_loop_unlock, void, struct pw_thread_loop *loop); +LL_GRAB_SYM(G, true, pw_proxy_add_listener, void, struct pw_proxy *proxy, struct spa_hook *listener, const struct pw_proxy_events *events, void *data); +LL_GRAB_SYM(G, true, pw_proxy_destroy, void, struct pw_proxy *proxy); +LL_GRAB_SYM(G, true, pw_proxy_get_user_data, void *, struct pw_proxy *proxy); +LL_GRAB_SYM(G, true, pw_core_disconnect, int, struct pw_core *core); + +// optional symbols to grab + +#undef G diff --git a/indra/media_plugins/cef/linux/volume_catcher_pulseaudio.cpp b/indra/media_plugins/cef/linux/volume_catcher_pulseaudio.cpp new file mode 100755 index 00000000000..f8a48a91fd7 --- /dev/null +++ b/indra/media_plugins/cef/linux/volume_catcher_pulseaudio.cpp @@ -0,0 +1,322 @@ +/** + * @file volume_catcher_pulseaudio.cpp + * @brief A Linux-specific, PulseAudio-specific hack to detect and volume-adjust new audio sources + * + * @cond + * $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$ + * @endcond + */ + +/* + The high-level design is as follows: + 1) Connect to the PulseAudio daemon + 2) Watch for the creation of new audio players connecting to the daemon (this includes ALSA clients running on the PulseAudio emulation layer, such as Flash plugins) + 3) Examine any new audio player's PID to see if it belongs to our own process + 4) If so, tell PA to adjust the volume of that audio player ('sink input' in PA parlance) + 5) Keep a list of all living audio players that we care about, adjust the volumes of all of them when we get a new setVolume() call + */ + +#include "linden_common.h" + +#include "volume_catcher_linux.h" + +extern "C" { +#include +#include + +#include + +#include +} + +SymbolGrabber paSymbolGrabber; + +#include "volume_catcher_pulseaudio_syms.inc" +#include "volume_catcher_pulseaudio_glib_syms.inc" + +//////////////////////////////////////////////////// + +// PulseAudio requires a chain of callbacks with C linkage +extern "C" { + void callback_discovered_sinkinput(pa_context *context, const pa_sink_input_info *i, int eol, void *userdata); + void callback_subscription_alert(pa_context *context, pa_subscription_event_type_t t, uint32_t index, void *userdata); + void callback_context_state(pa_context *context, void *userdata); +} + +VolumeCatcherPulseAudio::VolumeCatcherPulseAudio() + : mDesiredVolume(0.0f), + mMainloop(nullptr), + mPAContext(nullptr), + mConnected(false), + mGotSyms(false) +{ + init(); +} + +VolumeCatcherPulseAudio::~VolumeCatcherPulseAudio() +{ + cleanup(); +} + +bool VolumeCatcherPulseAudio::loadsyms(std::string pulse_dso_name) +{ + return paSymbolGrabber.grabSymbols({ pulse_dso_name }); +} + +void VolumeCatcherPulseAudio::init() +{ + // try to be as defensive as possible because PA's interface is a + // bit fragile and (for our purposes) we'd rather simply not function + // than crash + + // we cheat and rely upon libpulse-mainloop-glib.so.0 to pull-in + // libpulse.so.0 - this isn't a great assumption, and the two DSOs should + // probably be loaded separately. Our Linux DSO framework needs refactoring, + // we do this sort of thing a lot with practically identical logic... + mGotSyms = loadsyms("libpulse-mainloop-glib.so.0"); + + if (!mGotSyms) + mGotSyms = loadsyms("libpulse.so.0"); + + if (!mGotSyms) + return; + + mMainloop = llpa_glib_mainloop_new(g_main_context_default()); + + if (mMainloop) + { + pa_mainloop_api *api = llpa_glib_mainloop_get_api(mMainloop); + + if (api) + { + pa_proplist *proplist = llpa_proplist_new(); + + if (proplist) + { + llpa_proplist_sets(proplist, PA_PROP_APPLICATION_ICON_NAME, "multimedia-player"); + llpa_proplist_sets(proplist, PA_PROP_APPLICATION_ID, "com.secondlife.viewer.mediaplugvoladjust"); + llpa_proplist_sets(proplist, PA_PROP_APPLICATION_NAME, "SL Plugin Volume Adjuster"); + llpa_proplist_sets(proplist, PA_PROP_APPLICATION_VERSION, "1"); + + // plain old pa_context_new() is broken! + mPAContext = llpa_context_new_with_proplist(api, nullptr, proplist); + + llpa_proplist_free(proplist); + } + } + } + + // Now we've set up a PA context and mainloop, try connecting the + // PA context to a PA daemon. + if (mPAContext) + { + llpa_context_set_state_callback(mPAContext, callback_context_state, this); + pa_context_flags_t cflags = (pa_context_flags)0; // maybe add PA_CONTEXT_NOAUTOSPAWN? + if (llpa_context_connect(mPAContext, nullptr, cflags, nullptr) >= 0) + { + // Okay! We haven't definitely connected, but we + // haven't definitely failed yet. + } + else + { + // Failed to connect to PA manager... we'll leave + // things like that. Perhaps we should try again later. + } + } +} + +void VolumeCatcherPulseAudio::cleanup() +{ + mConnected = false; + + if (mGotSyms && mPAContext) + { + llpa_context_disconnect(mPAContext); + llpa_context_unref(mPAContext); + } + + mPAContext = nullptr; + + if (mGotSyms && mMainloop) + llpa_glib_mainloop_free(mMainloop); + + mMainloop = nullptr; +} + +void VolumeCatcherPulseAudio::setVolume(F32 volume) +{ + mDesiredVolume = volume; + + if (!mGotSyms) + return; + + if (mConnected && mPAContext) + { + update_all_volumes(mDesiredVolume); + } + + pump(); +} + +void VolumeCatcherPulseAudio::setPan(F32 pan) +{ +} + +void VolumeCatcherPulseAudio::pump() +{ + gboolean may_block = FALSE; + g_main_context_iteration(g_main_context_default(), may_block); +} + +void VolumeCatcherPulseAudio::connected_okay() +{ + pa_operation *op; + + // fetch global list of existing sinkinputs + if ((op = llpa_context_get_sink_input_info_list(mPAContext, + callback_discovered_sinkinput, + this))) + { + llpa_operation_unref(op); + } + + // subscribe to future global sinkinput changes + llpa_context_set_subscribe_callback(mPAContext, + callback_subscription_alert, + this); + if ((op = llpa_context_subscribe(mPAContext, (pa_subscription_mask_t) + (PA_SUBSCRIPTION_MASK_SINK_INPUT), + nullptr, nullptr))) + { + llpa_operation_unref(op); + } +} + +void VolumeCatcherPulseAudio::update_all_volumes(F32 volume) +{ + for (std::set::iterator it = mSinkInputIndices.begin(); + it != mSinkInputIndices.end(); ++it) + { + update_index_volume(*it, volume); + } +} + +void VolumeCatcherPulseAudio::update_index_volume(U32 index, F32 volume) +{ + static pa_cvolume cvol; + llpa_cvolume_set(&cvol, mSinkInputNumChannels[index], + llpa_sw_volume_from_linear(volume)); + + pa_context *c = mPAContext; + uint32_t idx = index; + const pa_cvolume *cvolumep = &cvol; + pa_context_success_cb_t cb = nullptr; // okay as null + void *userdata = nullptr; // okay as null + + pa_operation *op; + if ((op = llpa_context_set_sink_input_volume(c, idx, cvolumep, cb, userdata))) + llpa_operation_unref(op); +} + +void callback_discovered_sinkinput(pa_context *context, const pa_sink_input_info *sii, int eol, void *userdata) +{ + VolumeCatcherPulseAudio *impl = dynamic_cast((VolumeCatcherPulseAudio*)userdata); + llassert(impl); + + if (0 == eol) + { + pa_proplist *proplist = sii->proplist; + pid_t sinkpid = atoll(llpa_proplist_gets(proplist, PA_PROP_APPLICATION_PROCESS_ID)); + + if (isPluginPid( sinkpid )) // does the discovered sinkinput belong to this process? + { + bool is_new = (impl->mSinkInputIndices.find(sii->index) == impl->mSinkInputIndices.end()); + + impl->mSinkInputIndices.insert(sii->index); + impl->mSinkInputNumChannels[sii->index] = sii->channel_map.channels; + + if (is_new) + { + // new! + impl->update_index_volume(sii->index, impl->mDesiredVolume); + } + else + { + // seen it already, do nothing. + } + } + } +} + +void callback_subscription_alert(pa_context *context, pa_subscription_event_type_t t, uint32_t index, void *userdata) +{ + VolumeCatcherPulseAudio *impl = dynamic_cast((VolumeCatcherPulseAudio*)userdata); + llassert(impl); + + switch (t & PA_SUBSCRIPTION_EVENT_FACILITY_MASK) + { + case PA_SUBSCRIPTION_EVENT_SINK_INPUT: + if ((t & PA_SUBSCRIPTION_EVENT_TYPE_MASK) == PA_SUBSCRIPTION_EVENT_REMOVE) + { + // forget this sinkinput, if we were caring about it + impl->mSinkInputIndices.erase(index); + impl->mSinkInputNumChannels.erase(index); + } + else if ((t & PA_SUBSCRIPTION_EVENT_TYPE_MASK) == PA_SUBSCRIPTION_EVENT_NEW) + { + // ask for more info about this new sinkinput + pa_operation *op; + if ((op = llpa_context_get_sink_input_info(impl->mPAContext, index, callback_discovered_sinkinput, impl))) + { + llpa_operation_unref(op); + } + } + else + { + // property change on this sinkinput - we don't care. + } + break; + + default:; + } +} + +void callback_context_state(pa_context *context, void *userdata) +{ + VolumeCatcherPulseAudio *impl = dynamic_cast((VolumeCatcherPulseAudio*)userdata); + llassert(impl); + + switch (llpa_context_get_state(context)) + { + case PA_CONTEXT_READY: + impl->mConnected = true; + impl->connected_okay(); + break; + case PA_CONTEXT_TERMINATED: + impl->mConnected = false; + break; + case PA_CONTEXT_FAILED: + impl->mConnected = false; + break; + default:; + } +} diff --git a/indra/media_plugins/cef/linux/volume_catcher_pulseaudio_glib_syms.inc b/indra/media_plugins/cef/linux/volume_catcher_pulseaudio_glib_syms.inc new file mode 100755 index 00000000000..e9b7196e51b --- /dev/null +++ b/indra/media_plugins/cef/linux/volume_catcher_pulseaudio_glib_syms.inc @@ -0,0 +1,10 @@ +#define G paSymbolGrabber + +// required symbols to grab +LL_GRAB_SYM(G, true, pa_glib_mainloop_free, void, pa_glib_mainloop* g) +LL_GRAB_SYM(G, true, pa_glib_mainloop_get_api, pa_mainloop_api*, pa_glib_mainloop* g) +LL_GRAB_SYM(G, true, pa_glib_mainloop_new, pa_glib_mainloop *, GMainContext *c) + +// optional symbols to grab + +#undef G diff --git a/indra/media_plugins/cef/linux/volume_catcher_pulseaudio_syms.inc b/indra/media_plugins/cef/linux/volume_catcher_pulseaudio_syms.inc new file mode 100755 index 00000000000..4859a344054 --- /dev/null +++ b/indra/media_plugins/cef/linux/volume_catcher_pulseaudio_syms.inc @@ -0,0 +1,29 @@ +#define G paSymbolGrabber + +// required symbols to grab +LL_GRAB_SYM(G, true, pa_context_connect, int, pa_context *c, const char *server, pa_context_flags_t flags, const pa_spawn_api *api) +LL_GRAB_SYM(G, true, pa_context_disconnect, void, pa_context *c) +LL_GRAB_SYM(G, true, pa_context_get_sink_input_info, pa_operation*, pa_context *c, uint32_t idx, pa_sink_input_info_cb_t cb, void *userdata) +LL_GRAB_SYM(G, true, pa_context_get_sink_input_info_list, pa_operation*, pa_context *c, pa_sink_input_info_cb_t cb, void *userdata) +LL_GRAB_SYM(G, true, pa_context_get_state, pa_context_state_t, pa_context *c) +LL_GRAB_SYM(G, true, pa_context_new_with_proplist, pa_context*, pa_mainloop_api *mainloop, const char *name, pa_proplist *proplist) +LL_GRAB_SYM(G, true, pa_context_set_sink_input_volume, pa_operation*, pa_context *c, uint32_t idx, const pa_cvolume *volume, pa_context_success_cb_t cb, void *userdata) +LL_GRAB_SYM(G, true, pa_context_set_state_callback, void, pa_context *c, pa_context_notify_cb_t cb, void *userdata) +LL_GRAB_SYM(G, true, pa_context_set_subscribe_callback, void, pa_context *c, pa_context_subscribe_cb_t cb, void *userdata) +LL_GRAB_SYM(G, true, pa_context_subscribe, pa_operation*, pa_context *c, pa_subscription_mask_t m, pa_context_success_cb_t cb, void *userdata) +LL_GRAB_SYM(G, true, pa_context_unref, void, pa_context *c) +LL_GRAB_SYM(G, true, pa_cvolume_set, pa_cvolume*, pa_cvolume *a, unsigned channels, pa_volume_t v) +LL_GRAB_SYM(G, true, pa_operation_unref, void, pa_operation *o) +LL_GRAB_SYM(G, true, pa_proplist_free, void, pa_proplist* p) +LL_GRAB_SYM(G, true, pa_proplist_gets, const char*, pa_proplist *p, const char *key) +LL_GRAB_SYM(G, true, pa_proplist_new, pa_proplist*, void) +LL_GRAB_SYM(G, true, pa_proplist_sets, int, pa_proplist *p, const char *key, const char *value) +LL_GRAB_SYM(G, true, pa_sw_volume_from_linear, pa_volume_t, double v) +// LL_GRAB_SYM(G, true, pa_mainloop_free, void, pa_mainloop *m) +// LL_GRAB_SYM(G, true, pa_mainloop_get_api, pa_mainloop_api *, pa_mainloop *m) +// LL_GRAB_SYM(G, true, pa_mainloop_iterate, int, pa_mainloop *m, int block, int *retval) +// LL_GRAB_SYM(G, true, pa_mainloop_new, pa_mainloop *, void) + +// optional symbols to grab + +#undef G diff --git a/indra/media_plugins/cef/media_plugin_cef.cpp b/indra/media_plugins/cef/media_plugin_cef.cpp index caf804f915d..5693420bb6d 100644 --- a/indra/media_plugins/cef/media_plugin_cef.cpp +++ b/indra/media_plugins/cef/media_plugin_cef.cpp @@ -911,7 +911,7 @@ void MediaPluginCEF::receiveMessage(const char* message_string) keyEvent(key_event, native_key_data); -#elif LL_WINDOWS +#else std::string event = message_in.getValue("event"); LLSD native_key_data = message_in.getValueLLSD("native_key_data"); @@ -933,6 +933,13 @@ void MediaPluginCEF::receiveMessage(const char* message_string) { mEnableMediaPluginDebugging = message_in.getValueBoolean("enable"); } +#if LL_LINUX + else if (message_name == "enable_pipewire_volume_catcher") + { + bool enable = message_in.getValueBoolean("enable"); + mVolumeCatcher.onEnablePipeWireVolumeCatcher(enable); + } +#endif if (message_name == "pick_file_response") { LLSD file_list_llsd = message_in.getValueLLSD("file_list"); @@ -1095,6 +1102,28 @@ void MediaPluginCEF::keyEvent(dullahan::EKeyEvent key_event, LLSD native_key_dat mCEFLib->nativeKeyboardEventWin(msg, wparam, lparam); #endif + +#if LL_LINUX + + uint32_t native_virtual_key = (uint32_t)(native_key_data["virtual_key"].asInteger()); // this is actually the SDL event.key.keysym.sym; + uint32_t native_virtual_key_win = (uint32_t)(native_key_data["virtual_key_win"].asInteger()); + uint32_t native_modifiers = (uint32_t)(native_key_data["modifiers"].asInteger()); + + // only for non-printable keysyms, the actual text input is done in unicodeInput() below + if (native_virtual_key <= 0x1b || native_virtual_key >= 0x7f) + { + // set keypad flag, not sure if this even does anything + bool keypad = false; + if (native_virtual_key_win >= 0x60 && native_virtual_key_win <= 0x6f) + { + keypad = true; + } + + // yes, we send native_virtual_key_win twice because native_virtual_key breaks it + mCEFLib->nativeKeyboardEventSDL2(key_event, native_virtual_key, native_modifiers, keypad); + } + +#endif // LL_LINUX }; void MediaPluginCEF::unicodeInput(std::string event, LLSD native_key_data = LLSD::emptyMap()) @@ -1125,6 +1154,16 @@ void MediaPluginCEF::unicodeInput(std::string event, LLSD native_key_data = LLSD U64 lparam = ll_U32_from_sd(native_key_data["l_param"]); mCEFLib->nativeKeyboardEventWin(msg, wparam, lparam); #endif + +#if LL_LINUX + + uint32_t native_scan_code = (uint32_t)(native_key_data["sdl_sym"].asInteger()); + uint32_t native_virtual_key = (uint32_t)(native_key_data["virtual_key"].asInteger()); + uint32_t native_modifiers = (uint32_t)(native_key_data["modifiers"].asInteger()); + + mCEFLib->nativeKeyboardEvent(dullahan::KE_KEY_DOWN, native_scan_code, native_virtual_key, native_modifiers); + +#endif // LL_LINUX }; //////////////////////////////////////////////////////////////////////////////// diff --git a/indra/media_plugins/cef/volume_catcher.h b/indra/media_plugins/cef/volume_catcher.h index ea97a24947d..806f2a008a4 100644 --- a/indra/media_plugins/cef/volume_catcher.h +++ b/indra/media_plugins/cef/volume_catcher.h @@ -35,7 +35,7 @@ class VolumeCatcherImpl; class VolumeCatcher { - public: +public: VolumeCatcher(); ~VolumeCatcher(); @@ -47,8 +47,14 @@ class VolumeCatcher void pump(); // call this at least a few times a second if you can - it affects how quickly we can 'catch' a new audio source and adjust its volume - private: +#if LL_LINUX + void onEnablePipeWireVolumeCatcher(bool enable); +#endif + +private: +#if LL_LINUX || LL_WINDOWS VolumeCatcherImpl *pimpl; +#endif }; #endif // VOLUME_CATCHER_H diff --git a/indra/media_plugins/cef/mac_volume_catcher_null.cpp b/indra/media_plugins/cef/volume_catcher_null.cpp similarity index 59% rename from indra/media_plugins/cef/mac_volume_catcher_null.cpp rename to indra/media_plugins/cef/volume_catcher_null.cpp index c479e24a954..cd5eccca388 100644 --- a/indra/media_plugins/cef/mac_volume_catcher_null.cpp +++ b/indra/media_plugins/cef/volume_catcher_null.cpp @@ -1,5 +1,5 @@ /** - * @file windows_volume_catcher.cpp + * @file volume_catcher_null.cpp * @brief A null implementation of volume level control of all audio channels opened by a process. * We are using this for the macOS version for now until we can understand how to make the * exitising mac_volume_catcher.cpp work without the (now, non-existant) QuickTime dependency @@ -29,67 +29,31 @@ */ #include "volume_catcher.h" -#include "llsingleton.h" -class VolumeCatcherImpl : public LLSingleton -{ - LLSINGLETON(VolumeCatcherImpl); - // This is a singleton class -- both callers and the component implementation should use getInstance() to find the instance. - ~VolumeCatcherImpl(); - -public: - - void setVolume(F32 volume); - void setPan(F32 pan); - -private: - F32 mVolume; - F32 mPan; - bool mSystemIsVistaOrHigher; -}; - -VolumeCatcherImpl::VolumeCatcherImpl() -: mVolume(1.0f), // default volume is max - mPan(0.f) // default pan is centered -{ -} - -VolumeCatcherImpl::~VolumeCatcherImpl() -{ -} - -void VolumeCatcherImpl::setVolume(F32 volume) -{ - mVolume = volume; -} - -void VolumeCatcherImpl::setPan(F32 pan) -{ // remember pan for calculating individual channel levels later - mPan = pan; -} ///////////////////////////////////////////////////// VolumeCatcher::VolumeCatcher() { - pimpl = VolumeCatcherImpl::getInstance(); } VolumeCatcher::~VolumeCatcher() { - // Let the instance persist until exit. } void VolumeCatcher::setVolume(F32 volume) { - pimpl->setVolume(volume); } void VolumeCatcher::setPan(F32 pan) { - pimpl->setPan(pan); } void VolumeCatcher::pump() { - // No periodic tasks are necessary for this implementation. } + +#if LL_LINUX +void VolumeCatcher::onEnablePipeWireVolumeCatcher(bool enable) +{ +} +#endif diff --git a/indra/media_plugins/cef/windows_volume_catcher.cpp b/indra/media_plugins/cef/windows_volume_catcher.cpp index e7daeb5f748..1e52fee9ded 100644 --- a/indra/media_plugins/cef/windows_volume_catcher.cpp +++ b/indra/media_plugins/cef/windows_volume_catcher.cpp @@ -44,7 +44,6 @@ class VolumeCatcherImpl : public LLSingleton private: F32 mVolume; F32 mPan; - bool mSystemIsVistaOrHigher; }; VolumeCatcherImpl::VolumeCatcherImpl() diff --git a/indra/media_plugins/gstreamer010/CMakeLists.txt b/indra/media_plugins/gstreamer010/CMakeLists.txt deleted file mode 100644 index 38fc8201bf2..00000000000 --- a/indra/media_plugins/gstreamer010/CMakeLists.txt +++ /dev/null @@ -1,46 +0,0 @@ -# -*- cmake -*- - -project(media_plugin_gstreamer010) - -include(00-Common) -include(LLCommon) -include(LLImage) -include(LLMath) -include(LLWindow) -include(Linking) -include(PluginAPI) -include(OpenGL) - -include(GStreamer010Plugin) - -### media_plugin_gstreamer010 - -if(NOT ADDRESS_SIZE EQUAL 32) - if(WINDOWS) - ##add_definitions(/FIXED:NO) - else(WINDOWS) # not windows therefore gcc LINUX and DARWIN - add_definitions(-fPIC) - endif(WINDOWS) -endif(NOT ADDRESS_SIZE EQUAL 32) - -set(media_plugin_gstreamer010_SOURCE_FILES - media_plugin_gstreamer010.cpp - llmediaimplgstreamer_syms.cpp - llmediaimplgstreamervidplug.cpp - ) - -set(media_plugin_gstreamer010_HEADER_FILES - llmediaimplgstreamervidplug.h - llmediaimplgstreamer_syms.h - llmediaimplgstreamertriviallogging.h - ) - -add_library(media_plugin_gstreamer010 - SHARED - ${media_plugin_gstreamer010_SOURCE_FILES} - ) - -target_link_libraries(media_plugin_gstreamer010 - media_plugin_base - ll::gstreamer - ) diff --git a/indra/media_plugins/gstreamer010/llmediaimplgstreamer_syms.cpp b/indra/media_plugins/gstreamer010/llmediaimplgstreamer_syms.cpp deleted file mode 100644 index dcc04b37e43..00000000000 --- a/indra/media_plugins/gstreamer010/llmediaimplgstreamer_syms.cpp +++ /dev/null @@ -1,167 +0,0 @@ -/** - * @file llmediaimplgstreamer_syms.cpp - * @brief dynamic GStreamer symbol-grabbing code - * - * @cond - * $LicenseInfo:firstyear=2007&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 - */ - -#if LL_GSTREAMER010_ENABLED - -#include - -extern "C" { -#include - -#include "apr_pools.h" -#include "apr_dso.h" -} - -#include "llmediaimplgstreamertriviallogging.h" - -#define LL_GST_SYM(REQ, GSTSYM, RTN, ...) RTN (*ll##GSTSYM)(__VA_ARGS__) = NULL -#include "llmediaimplgstreamer_syms_raw.inc" -#include "llmediaimplgstreamer_syms_rawv.inc" -#undef LL_GST_SYM - -// a couple of stubs for disgusting reasons -GstDebugCategory* -ll_gst_debug_category_new(gchar *name, guint color, gchar *description) -{ - static GstDebugCategory dummy; - return &dummy; -} -void ll_gst_debug_register_funcptr(GstDebugFuncPtr func, gchar* ptrname) -{ -} - -static bool sSymsGrabbed = false; -static apr_pool_t *sSymGSTDSOMemoryPool = NULL; -static apr_dso_handle_t *sSymGSTDSOHandleG = NULL; -static apr_dso_handle_t *sSymGSTDSOHandleV = NULL; - - -bool grab_gst_syms(std::string gst_dso_name, - std::string gst_dso_name_vid) -{ - if (sSymsGrabbed) - { - // already have grabbed good syms - return TRUE; - } - - bool sym_error = false; - bool rtn = false; - apr_status_t rv; - apr_dso_handle_t *sSymGSTDSOHandle = NULL; - -#define LL_GST_SYM(REQ, GSTSYM, RTN, ...) do{rv = apr_dso_sym((apr_dso_handle_sym_t*)&ll##GSTSYM, sSymGSTDSOHandle, #GSTSYM); if (rv != APR_SUCCESS) {INFOMSG("Failed to grab symbol: %s", #GSTSYM); if (REQ) sym_error = true;} else DEBUGMSG("grabbed symbol: %s from %p", #GSTSYM, (void*)ll##GSTSYM);}while(0) - - //attempt to load the shared libraries - apr_pool_create(&sSymGSTDSOMemoryPool, NULL); - - if ( APR_SUCCESS == (rv = apr_dso_load(&sSymGSTDSOHandle, - gst_dso_name.c_str(), - sSymGSTDSOMemoryPool) )) - { - INFOMSG("Found DSO: %s", gst_dso_name.c_str()); -#include "llmediaimplgstreamer_syms_raw.inc" - - if ( sSymGSTDSOHandle ) - { - sSymGSTDSOHandleG = sSymGSTDSOHandle; - sSymGSTDSOHandle = NULL; - } - - if ( APR_SUCCESS == - (rv = apr_dso_load(&sSymGSTDSOHandle, - gst_dso_name_vid.c_str(), - sSymGSTDSOMemoryPool) )) - { - INFOMSG("Found DSO: %s", gst_dso_name_vid.c_str()); -#include "llmediaimplgstreamer_syms_rawv.inc" - rtn = !sym_error; - } - else - { - INFOMSG("Couldn't load DSO: %s", gst_dso_name_vid.c_str()); - rtn = false; // failure - } - } - else - { - INFOMSG("Couldn't load DSO: %s", gst_dso_name.c_str()); - rtn = false; // failure - } - - if (sym_error) - { - WARNMSG("Failed to find necessary symbols in GStreamer libraries."); - } - - if ( sSymGSTDSOHandle ) - { - sSymGSTDSOHandleV = sSymGSTDSOHandle; - sSymGSTDSOHandle = NULL; - } -#undef LL_GST_SYM - - sSymsGrabbed = !!rtn; - return rtn; -} - - -void ungrab_gst_syms() -{ - // should be safe to call regardless of whether we've - // actually grabbed syms. - - if ( sSymGSTDSOHandleG ) - { - apr_dso_unload(sSymGSTDSOHandleG); - sSymGSTDSOHandleG = NULL; - } - - if ( sSymGSTDSOHandleV ) - { - apr_dso_unload(sSymGSTDSOHandleV); - sSymGSTDSOHandleV = NULL; - } - - if ( sSymGSTDSOMemoryPool ) - { - apr_pool_destroy(sSymGSTDSOMemoryPool); - sSymGSTDSOMemoryPool = NULL; - } - - // NULL-out all of the symbols we'd grabbed -#define LL_GST_SYM(REQ, GSTSYM, RTN, ...) do{ll##GSTSYM = NULL;}while(0) -#include "llmediaimplgstreamer_syms_raw.inc" -#include "llmediaimplgstreamer_syms_rawv.inc" -#undef LL_GST_SYM - - sSymsGrabbed = false; -} - - -#endif // LL_GSTREAMER010_ENABLED diff --git a/indra/media_plugins/gstreamer010/llmediaimplgstreamer_syms.h b/indra/media_plugins/gstreamer010/llmediaimplgstreamer_syms.h deleted file mode 100644 index 57d446c7dfd..00000000000 --- a/indra/media_plugins/gstreamer010/llmediaimplgstreamer_syms.h +++ /dev/null @@ -1,74 +0,0 @@ -/** - * @file llmediaimplgstreamer_syms.h - * @brief dynamic GStreamer symbol-grabbing code - * - * @cond - * $LicenseInfo:firstyear=2007&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" - -#if LL_GSTREAMER010_ENABLED - -extern "C" { -#include -} - -bool grab_gst_syms(std::string gst_dso_name, - std::string gst_dso_name_vid); -void ungrab_gst_syms(); - -#define LL_GST_SYM(REQ, GSTSYM, RTN, ...) extern RTN (*ll##GSTSYM)(__VA_ARGS__) -#include "llmediaimplgstreamer_syms_raw.inc" -#include "llmediaimplgstreamer_syms_rawv.inc" -#undef LL_GST_SYM - -// regrettable hacks to give us better runtime compatibility with older systems -#define llg_return_if_fail(COND) do{if (!(COND)) return;}while(0) -#define llg_return_val_if_fail(COND,V) do{if (!(COND)) return V;}while(0) - -// regrettable hacks because GStreamer was not designed for runtime loading -#undef GST_TYPE_MESSAGE -#define GST_TYPE_MESSAGE (llgst_message_get_type()) -#undef GST_TYPE_OBJECT -#define GST_TYPE_OBJECT (llgst_object_get_type()) -#undef GST_TYPE_PIPELINE -#define GST_TYPE_PIPELINE (llgst_pipeline_get_type()) -#undef GST_TYPE_ELEMENT -#define GST_TYPE_ELEMENT (llgst_element_get_type()) -#undef GST_TYPE_VIDEO_SINK -#define GST_TYPE_VIDEO_SINK (llgst_video_sink_get_type()) -// more regrettable hacks to stub-out these .h-exposed GStreamer internals -void ll_gst_debug_register_funcptr(GstDebugFuncPtr func, gchar* ptrname); -#undef _gst_debug_register_funcptr -#define _gst_debug_register_funcptr ll_gst_debug_register_funcptr -GstDebugCategory* ll_gst_debug_category_new(gchar *name, guint color, gchar *description); -#undef _gst_debug_category_new -#define _gst_debug_category_new ll_gst_debug_category_new -#undef __gst_debug_enabled -#define __gst_debug_enabled (0) - -// more hacks -#define LLGST_MESSAGE_TYPE_NAME(M) (llgst_message_type_get_name(GST_MESSAGE_TYPE(M))) - -#endif // LL_GSTREAMER010_ENABLED diff --git a/indra/media_plugins/gstreamer010/llmediaimplgstreamer_syms_raw.inc b/indra/media_plugins/gstreamer010/llmediaimplgstreamer_syms_raw.inc deleted file mode 100644 index b33e59363d2..00000000000 --- a/indra/media_plugins/gstreamer010/llmediaimplgstreamer_syms_raw.inc +++ /dev/null @@ -1,51 +0,0 @@ - -// required symbols to grab -LL_GST_SYM(true, gst_pad_peer_accept_caps, gboolean, GstPad *pad, GstCaps *caps); -LL_GST_SYM(true, gst_buffer_new, GstBuffer*, void); -LL_GST_SYM(true, gst_buffer_set_caps, void, GstBuffer*, GstCaps *); -LL_GST_SYM(true, gst_structure_set_value, void, GstStructure *, const gchar *, const GValue*); -LL_GST_SYM(true, gst_init_check, gboolean, int *argc, char **argv[], GError ** err); -LL_GST_SYM(true, gst_message_get_type, GType, void); -LL_GST_SYM(true, gst_message_type_get_name, const gchar*, GstMessageType type); -LL_GST_SYM(true, gst_message_parse_error, void, GstMessage *message, GError **gerror, gchar **debug); -LL_GST_SYM(true, gst_message_parse_warning, void, GstMessage *message, GError **gerror, gchar **debug); -LL_GST_SYM(true, gst_message_parse_state_changed, void, GstMessage *message, GstState *oldstate, GstState *newstate, GstState *pending); -LL_GST_SYM(true, gst_element_set_state, GstStateChangeReturn, GstElement *element, GstState state); -LL_GST_SYM(true, gst_object_unref, void, gpointer object); -LL_GST_SYM(true, gst_object_get_type, GType, void); -LL_GST_SYM(true, gst_pipeline_get_type, GType, void); -LL_GST_SYM(true, gst_pipeline_get_bus, GstBus*, GstPipeline *pipeline); -LL_GST_SYM(true, gst_bus_add_watch, guint, GstBus * bus, GstBusFunc func, gpointer user_data); -LL_GST_SYM(true, gst_element_factory_make, GstElement*, const gchar *factoryname, const gchar *name); -LL_GST_SYM(true, gst_element_get_type, GType, void); -LL_GST_SYM(true, gst_static_pad_template_get, GstPadTemplate*, GstStaticPadTemplate *pad_template); -LL_GST_SYM(true, gst_element_class_add_pad_template, void, GstElementClass *klass, GstPadTemplate *temp); -LL_GST_SYM(true, gst_element_class_set_details, void, GstElementClass *klass, const GstElementDetails *details); -LL_GST_SYM(true, gst_caps_unref, void, GstCaps* caps); -LL_GST_SYM(true, gst_caps_ref, GstCaps *, GstCaps* caps); -//LL_GST_SYM(true, gst_caps_is_empty, gboolean, const GstCaps *caps); -LL_GST_SYM(true, gst_caps_from_string, GstCaps *, const gchar *string); -LL_GST_SYM(true, gst_caps_replace, void, GstCaps **caps, GstCaps *newcaps); -LL_GST_SYM(true, gst_caps_get_structure, GstStructure *, const GstCaps *caps, guint index); -LL_GST_SYM(true, gst_caps_copy, GstCaps *, const GstCaps * caps); -//LL_GST_SYM(true, gst_caps_intersect, GstCaps *, const GstCaps *caps1, const GstCaps *caps2); -LL_GST_SYM(true, gst_element_register, gboolean, GstPlugin *plugin, const gchar *name, guint rank, GType type); -LL_GST_SYM(true, _gst_plugin_register_static, void, GstPluginDesc *desc); -LL_GST_SYM(true, gst_structure_get_int, gboolean, const GstStructure *structure, const gchar *fieldname, gint *value); -LL_GST_SYM(true, gst_structure_get_value, G_CONST_RETURN GValue *, const GstStructure *structure, const gchar *fieldname); -LL_GST_SYM(true, gst_value_get_fraction_numerator, gint, const GValue *value); -LL_GST_SYM(true, gst_value_get_fraction_denominator, gint, const GValue *value); -LL_GST_SYM(true, gst_structure_get_name, G_CONST_RETURN gchar *, const GstStructure *structure); -LL_GST_SYM(true, gst_element_seek, bool, GstElement *, gdouble, GstFormat, GstSeekFlags, GstSeekType, gint64, GstSeekType, gint64); - -// optional symbols to grab -LL_GST_SYM(false, gst_registry_fork_set_enabled, void, gboolean enabled); -LL_GST_SYM(false, gst_segtrap_set_enabled, void, gboolean enabled); -LL_GST_SYM(false, gst_message_parse_buffering, void, GstMessage *message, gint *percent); -LL_GST_SYM(false, gst_message_parse_info, void, GstMessage *message, GError **gerror, gchar **debug); -LL_GST_SYM(false, gst_element_query_position, gboolean, GstElement *element, GstFormat *format, gint64 *cur); -LL_GST_SYM(false, gst_version, void, guint *major, guint *minor, guint *micro, guint *nano); - -// GStreamer 'internal' symbols which may not be visible in some runtimes but are still used in expanded GStreamer header macros - yuck! We'll substitute our own stubs for these. -//LL_GST_SYM(true, _gst_debug_register_funcptr, void, GstDebugFuncPtr func, gchar* ptrname); -//LL_GST_SYM(true, _gst_debug_category_new, GstDebugCategory *, gchar *name, guint color, gchar *description); diff --git a/indra/media_plugins/gstreamer010/llmediaimplgstreamer_syms_rawv.inc b/indra/media_plugins/gstreamer010/llmediaimplgstreamer_syms_rawv.inc deleted file mode 100644 index 14fbcb48b98..00000000000 --- a/indra/media_plugins/gstreamer010/llmediaimplgstreamer_syms_rawv.inc +++ /dev/null @@ -1,5 +0,0 @@ - -// required symbols to grab -LL_GST_SYM(true, gst_video_sink_get_type, GType, void); - -// optional symbols to grab diff --git a/indra/media_plugins/gstreamer010/llmediaimplgstreamertriviallogging.h b/indra/media_plugins/gstreamer010/llmediaimplgstreamertriviallogging.h deleted file mode 100644 index 43ebad67441..00000000000 --- a/indra/media_plugins/gstreamer010/llmediaimplgstreamertriviallogging.h +++ /dev/null @@ -1,55 +0,0 @@ -/** - * @file llmediaimplgstreamertriviallogging.h - * @brief minimal logging utilities. - * - * @cond - * $LicenseInfo:firstyear=2009&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 - */ - -#ifndef __LLMEDIAIMPLGSTREAMERTRIVIALLOGGING_H__ -#define __LLMEDIAIMPLGSTREAMERTRIVIALLOGGING_H__ - -#include - -extern "C" { -#include -#include -} - -///////////////////////////////////////////////////////////////////////// -// Debug/Info/Warning macros. -#define MSGMODULEFOO "(media plugin)" -#define STDERRMSG(...) do{\ - fprintf(stderr, " pid:%d: ", (int)getpid());\ - fprintf(stderr, MSGMODULEFOO " %s:%d: ", __FUNCTION__, __LINE__);\ - fprintf(stderr, __VA_ARGS__);\ - fputc('\n',stderr);\ - }while(0) -#define NULLMSG(...) do{}while(0) - -#define DEBUGMSG NULLMSG -#define INFOMSG STDERRMSG -#define WARNMSG STDERRMSG -///////////////////////////////////////////////////////////////////////// - -#endif /* __LLMEDIAIMPLGSTREAMERTRIVIALLOGGING_H__ */ diff --git a/indra/media_plugins/gstreamer010/llmediaimplgstreamervidplug.cpp b/indra/media_plugins/gstreamer010/llmediaimplgstreamervidplug.cpp deleted file mode 100644 index acec0f23992..00000000000 --- a/indra/media_plugins/gstreamer010/llmediaimplgstreamervidplug.cpp +++ /dev/null @@ -1,526 +0,0 @@ -/** - * @file llmediaimplgstreamervidplug.h - * @brief Video-consuming static GStreamer plugin for gst-to-LLMediaImpl - * - * @cond - * $LicenseInfo:firstyear=2007&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 - */ - -#if LL_GSTREAMER010_ENABLED - -#include "linden_common.h" - -#include -#include -#include - -#include "llmediaimplgstreamer_syms.h" -#include "llmediaimplgstreamertriviallogging.h" - -#include "llmediaimplgstreamervidplug.h" - - -GST_DEBUG_CATEGORY_STATIC (gst_slvideo_debug); -#define GST_CAT_DEFAULT gst_slvideo_debug - - -#define SLV_SIZECAPS ", width=(int)[1,2048], height=(int)[1,2048] " -#define SLV_ALLCAPS GST_VIDEO_CAPS_RGBx SLV_SIZECAPS - -static GstStaticPadTemplate sink_factory = GST_STATIC_PAD_TEMPLATE ( - (gchar*)"sink", - GST_PAD_SINK, - GST_PAD_ALWAYS, - GST_STATIC_CAPS (SLV_ALLCAPS) - ); - -GST_BOILERPLATE (GstSLVideo, gst_slvideo, GstVideoSink, - GST_TYPE_VIDEO_SINK); - -static void gst_slvideo_set_property (GObject * object, guint prop_id, - const GValue * value, - GParamSpec * pspec); -static void gst_slvideo_get_property (GObject * object, guint prop_id, - GValue * value, GParamSpec * pspec); - -static void -gst_slvideo_base_init (gpointer gclass) -{ - static GstElementDetails element_details = { - (gchar*)"PluginTemplate", - (gchar*)"Generic/PluginTemplate", - (gchar*)"Generic Template Element", - (gchar*)"Linden Lab" - }; - GstElementClass *element_class = GST_ELEMENT_CLASS (gclass); - - llgst_element_class_add_pad_template (element_class, - llgst_static_pad_template_get (&sink_factory)); - llgst_element_class_set_details (element_class, &element_details); -} - - -static void -gst_slvideo_finalize (GObject * object) -{ - GstSLVideo *slvideo; - slvideo = GST_SLVIDEO (object); - if (slvideo->caps) - { - llgst_caps_unref(slvideo->caps); - } - - G_OBJECT_CLASS(parent_class)->finalize (object); -} - - -static GstFlowReturn -gst_slvideo_show_frame (GstBaseSink * bsink, GstBuffer * buf) -{ - GstSLVideo *slvideo; - llg_return_val_if_fail (buf != NULL, GST_FLOW_ERROR); - - slvideo = GST_SLVIDEO(bsink); - - DEBUGMSG("transferring a frame of %dx%d <- %p (%d)", - slvideo->width, slvideo->height, GST_BUFFER_DATA(buf), - slvideo->format); - - if (GST_BUFFER_DATA(buf)) - { - // copy frame and frame info into neutral territory - GST_OBJECT_LOCK(slvideo); - slvideo->retained_frame_ready = TRUE; - slvideo->retained_frame_width = slvideo->width; - slvideo->retained_frame_height = slvideo->height; - slvideo->retained_frame_format = slvideo->format; - int rowbytes = - SLVPixelFormatBytes[slvideo->retained_frame_format] * - slvideo->retained_frame_width; - int needbytes = rowbytes * slvideo->retained_frame_width; - // resize retained frame hunk only if necessary - if (needbytes != slvideo->retained_frame_allocbytes) - { - delete[] slvideo->retained_frame_data; - slvideo->retained_frame_data = new unsigned char[needbytes]; - slvideo->retained_frame_allocbytes = needbytes; - - } - // copy the actual frame data to neutral territory - - // flipped, for GL reasons - for (int ypos=0; yposheight; ++ypos) - { - memcpy(&slvideo->retained_frame_data[(slvideo->height-1-ypos)*rowbytes], - &(((unsigned char*)GST_BUFFER_DATA(buf))[ypos*rowbytes]), - rowbytes); - } - // done with the shared data - GST_OBJECT_UNLOCK(slvideo); - } - - return GST_FLOW_OK; -} - - -static GstStateChangeReturn -gst_slvideo_change_state(GstElement * element, GstStateChange transition) -{ - GstSLVideo *slvideo; - GstStateChangeReturn ret = GST_STATE_CHANGE_SUCCESS; - - slvideo = GST_SLVIDEO (element); - - switch (transition) { - case GST_STATE_CHANGE_NULL_TO_READY: - break; - case GST_STATE_CHANGE_READY_TO_PAUSED: - break; - case GST_STATE_CHANGE_PAUSED_TO_PLAYING: - break; - default: - break; - } - - ret = GST_ELEMENT_CLASS (parent_class)->change_state (element, transition); - if (ret == GST_STATE_CHANGE_FAILURE) - return ret; - - switch (transition) { - case GST_STATE_CHANGE_PLAYING_TO_PAUSED: - break; - case GST_STATE_CHANGE_PAUSED_TO_READY: - slvideo->fps_n = 0; - slvideo->fps_d = 1; - GST_VIDEO_SINK_WIDTH(slvideo) = 0; - GST_VIDEO_SINK_HEIGHT(slvideo) = 0; - break; - case GST_STATE_CHANGE_READY_TO_NULL: - break; - default: - break; - } - - return ret; -} - - -static GstCaps * -gst_slvideo_get_caps (GstBaseSink * bsink) -{ - GstSLVideo *slvideo; - slvideo = GST_SLVIDEO(bsink); - - return llgst_caps_ref (slvideo->caps); -} - - -/* this function handles the link with other elements */ -static gboolean -gst_slvideo_set_caps (GstBaseSink * bsink, GstCaps * caps) -{ - GstSLVideo *filter; - GstStructure *structure; - - GST_DEBUG ("set caps with %" GST_PTR_FORMAT, caps); - - filter = GST_SLVIDEO(bsink); - - int width, height; - gboolean ret; - const GValue *fps; - const GValue *par; - structure = llgst_caps_get_structure (caps, 0); - ret = llgst_structure_get_int (structure, "width", &width); - ret = ret && llgst_structure_get_int (structure, "height", &height); - fps = llgst_structure_get_value (structure, "framerate"); - ret = ret && (fps != NULL); - par = llgst_structure_get_value (structure, "pixel-aspect-ratio"); - if (!ret) - return FALSE; - - INFOMSG("** filter caps set with width=%d, height=%d", width, height); - - GST_OBJECT_LOCK(filter); - - filter->width = width; - filter->height = height; - - filter->fps_n = llgst_value_get_fraction_numerator(fps); - filter->fps_d = llgst_value_get_fraction_denominator(fps); - if (par) - { - filter->par_n = llgst_value_get_fraction_numerator(par); - filter->par_d = llgst_value_get_fraction_denominator(par); - } - else - { - filter->par_n = 1; - filter->par_d = 1; - } - GST_VIDEO_SINK_WIDTH(filter) = width; - GST_VIDEO_SINK_HEIGHT(filter) = height; - - // crufty lump - we *always* accept *only* RGBX now. - /* - filter->format = SLV_PF_UNKNOWN; - if (0 == strcmp(llgst_structure_get_name(structure), - "video/x-raw-rgb")) - { - int red_mask; - int green_mask; - int blue_mask; - llgst_structure_get_int(structure, "red_mask", &red_mask); - llgst_structure_get_int(structure, "green_mask", &green_mask); - llgst_structure_get_int(structure, "blue_mask", &blue_mask); - if ((unsigned int)red_mask == 0xFF000000 && - (unsigned int)green_mask == 0x00FF0000 && - (unsigned int)blue_mask == 0x0000FF00) - { - filter->format = SLV_PF_RGBX; - //fprintf(stderr, "\n\nPIXEL FORMAT RGB\n\n"); - } else if ((unsigned int)red_mask == 0x0000FF00 && - (unsigned int)green_mask == 0x00FF0000 && - (unsigned int)blue_mask == 0xFF000000) - { - filter->format = SLV_PF_BGRX; - //fprintf(stderr, "\n\nPIXEL FORMAT BGR\n\n"); - } - }*/ - - filter->format = SLV_PF_RGBX; - - GST_OBJECT_UNLOCK(filter); - - return TRUE; -} - - -static gboolean -gst_slvideo_start (GstBaseSink * bsink) -{ - gboolean ret = TRUE; - - GST_SLVIDEO(bsink); - - return ret; -} - -static gboolean -gst_slvideo_stop (GstBaseSink * bsink) -{ - GstSLVideo *slvideo; - slvideo = GST_SLVIDEO(bsink); - - // free-up retained frame buffer - GST_OBJECT_LOCK(slvideo); - slvideo->retained_frame_ready = FALSE; - delete[] slvideo->retained_frame_data; - slvideo->retained_frame_data = NULL; - slvideo->retained_frame_allocbytes = 0; - GST_OBJECT_UNLOCK(slvideo); - - return TRUE; -} - - -static GstFlowReturn -gst_slvideo_buffer_alloc (GstBaseSink * bsink, guint64 offset, guint size, - GstCaps * caps, GstBuffer ** buf) -{ - gint width, height; - GstStructure *structure = NULL; - GstSLVideo *slvideo; - slvideo = GST_SLVIDEO(bsink); - - // caps == requested caps - // we can ignore these and reverse-negotiate our preferred dimensions with - // the peer if we like - we need to do this to obey dynamic resize requests - // flowing in from the app. - structure = llgst_caps_get_structure (caps, 0); - if (!llgst_structure_get_int(structure, "width", &width) || - !llgst_structure_get_int(structure, "height", &height)) - { - GST_WARNING_OBJECT (slvideo, "no width/height in caps %" GST_PTR_FORMAT, caps); - return GST_FLOW_NOT_NEGOTIATED; - } - - GstBuffer *newbuf = llgst_buffer_new(); - bool made_bufferdata_ptr = false; -#define MAXDEPTHHACK 4 - - GST_OBJECT_LOCK(slvideo); - if (slvideo->resize_forced_always) // app is giving us a fixed size to work with - { - gint slwantwidth, slwantheight; - slwantwidth = slvideo->resize_try_width; - slwantheight = slvideo->resize_try_height; - - if (slwantwidth != width || - slwantheight != height) - { - // don't like requested caps, we will issue our own suggestion - copy - // the requested caps but substitute our own width and height and see - // if our peer is happy with that. - - GstCaps *desired_caps; - GstStructure *desired_struct; - desired_caps = llgst_caps_copy (caps); - desired_struct = llgst_caps_get_structure (desired_caps, 0); - - GValue value = {0}; - g_value_init(&value, G_TYPE_INT); - g_value_set_int(&value, slwantwidth); - llgst_structure_set_value (desired_struct, "width", &value); - g_value_unset(&value); - g_value_init(&value, G_TYPE_INT); - g_value_set_int(&value, slwantheight); - llgst_structure_set_value (desired_struct, "height", &value); - - if (llgst_pad_peer_accept_caps (GST_VIDEO_SINK_PAD (slvideo), - desired_caps)) - { - // todo: re-use buffers from a pool? - // todo: set MALLOCDATA to null, set DATA to point straight to shm? - - // peer likes our cap suggestion - DEBUGMSG("peer loves us :)"); - GST_BUFFER_SIZE(newbuf) = slwantwidth * slwantheight * MAXDEPTHHACK; - GST_BUFFER_MALLOCDATA(newbuf) = (guint8*)g_malloc(GST_BUFFER_SIZE(newbuf)); - GST_BUFFER_DATA(newbuf) = GST_BUFFER_MALLOCDATA(newbuf); - llgst_buffer_set_caps (GST_BUFFER_CAST(newbuf), desired_caps); - - made_bufferdata_ptr = true; - } else { - // peer hates our cap suggestion - INFOMSG("peer hates us :("); - llgst_caps_unref(desired_caps); - } - } - } - - GST_OBJECT_UNLOCK(slvideo); - - if (!made_bufferdata_ptr) // need to fallback to malloc at original size - { - GST_BUFFER_SIZE(newbuf) = width * height * MAXDEPTHHACK; - GST_BUFFER_MALLOCDATA(newbuf) = (guint8*)g_malloc(GST_BUFFER_SIZE(newbuf)); - GST_BUFFER_DATA(newbuf) = GST_BUFFER_MALLOCDATA(newbuf); - llgst_buffer_set_caps (GST_BUFFER_CAST(newbuf), caps); - } - - *buf = GST_BUFFER_CAST(newbuf); - - return GST_FLOW_OK; -} - - -/* initialize the plugin's class */ -static void -gst_slvideo_class_init (GstSLVideoClass * klass) -{ - GObjectClass *gobject_class; - GstElementClass *gstelement_class; - GstBaseSinkClass *gstbasesink_class; - - gobject_class = (GObjectClass *) klass; - gstelement_class = (GstElementClass *) klass; - gstbasesink_class = (GstBaseSinkClass *) klass; - - gobject_class->finalize = gst_slvideo_finalize; - gobject_class->set_property = gst_slvideo_set_property; - gobject_class->get_property = gst_slvideo_get_property; - - gstelement_class->change_state = gst_slvideo_change_state; - -#define LLGST_DEBUG_FUNCPTR(p) (p) - gstbasesink_class->get_caps = LLGST_DEBUG_FUNCPTR (gst_slvideo_get_caps); - gstbasesink_class->set_caps = LLGST_DEBUG_FUNCPTR( gst_slvideo_set_caps); - gstbasesink_class->buffer_alloc=LLGST_DEBUG_FUNCPTR(gst_slvideo_buffer_alloc); - //gstbasesink_class->get_times = LLGST_DEBUG_FUNCPTR (gst_slvideo_get_times); - gstbasesink_class->preroll = LLGST_DEBUG_FUNCPTR (gst_slvideo_show_frame); - gstbasesink_class->render = LLGST_DEBUG_FUNCPTR (gst_slvideo_show_frame); - - gstbasesink_class->start = LLGST_DEBUG_FUNCPTR (gst_slvideo_start); - gstbasesink_class->stop = LLGST_DEBUG_FUNCPTR (gst_slvideo_stop); - - // gstbasesink_class->unlock = LLGST_DEBUG_FUNCPTR (gst_slvideo_unlock); -#undef LLGST_DEBUG_FUNCPTR -} - - -/* initialize the new element - * instantiate pads and add them to element - * set functions - * initialize structure - */ -static void -gst_slvideo_init (GstSLVideo * filter, - GstSLVideoClass * gclass) -{ - filter->caps = NULL; - filter->width = -1; - filter->height = -1; - - // this is the info we share with the client app - GST_OBJECT_LOCK(filter); - filter->retained_frame_ready = FALSE; - filter->retained_frame_data = NULL; - filter->retained_frame_allocbytes = 0; - filter->retained_frame_width = filter->width; - filter->retained_frame_height = filter->height; - filter->retained_frame_format = SLV_PF_UNKNOWN; - GstCaps *caps = llgst_caps_from_string (SLV_ALLCAPS); - llgst_caps_replace (&filter->caps, caps); - filter->resize_forced_always = false; - filter->resize_try_width = -1; - filter->resize_try_height = -1; - GST_OBJECT_UNLOCK(filter); -} - -static void -gst_slvideo_set_property (GObject * object, guint prop_id, - const GValue * value, GParamSpec * pspec) -{ - llg_return_if_fail (GST_IS_SLVIDEO (object)); - - switch (prop_id) { - default: - G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec); - break; - } -} - -static void -gst_slvideo_get_property (GObject * object, guint prop_id, - GValue * value, GParamSpec * pspec) -{ - llg_return_if_fail (GST_IS_SLVIDEO (object)); - - switch (prop_id) { - default: - G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec); - break; - } -} - - -/* entry point to initialize the plug-in - * initialize the plug-in itself - * register the element factories and pad templates - * register the features - */ -static gboolean -plugin_init (GstPlugin * plugin) -{ - DEBUGMSG("PLUGIN INIT"); - - GST_DEBUG_CATEGORY_INIT (gst_slvideo_debug, (gchar*)"private-slvideo-plugin", - 0, (gchar*)"Second Life Video Sink"); - - return llgst_element_register (plugin, "private-slvideo", - GST_RANK_NONE, GST_TYPE_SLVIDEO); -} - -/* this is the structure that gstreamer looks for to register plugins - */ -/* NOTE: Can't rely upon GST_PLUGIN_DEFINE_STATIC to self-register, since - some g++ versions buggily avoid __attribute__((constructor)) functions - - so we provide an explicit plugin init function. - */ -#define PACKAGE (gchar*)"packagehack" -// this macro quietly refers to PACKAGE internally -GST_PLUGIN_DEFINE (GST_VERSION_MAJOR, - GST_VERSION_MINOR, - (gchar*)"private-slvideoplugin", - (gchar*)"SL Video sink plugin", - plugin_init, (gchar*)"1.0", (gchar*)"LGPL", - (gchar*)"Second Life", - (gchar*)"http://www.secondlife.com/"); -#undef PACKAGE -void gst_slvideo_init_class (void) -{ - ll_gst_plugin_register_static (&gst_plugin_desc); - DEBUGMSG("CLASS INIT"); -} - -#endif // LL_GSTREAMER010_ENABLED diff --git a/indra/media_plugins/gstreamer010/llmediaimplgstreamervidplug.h b/indra/media_plugins/gstreamer010/llmediaimplgstreamervidplug.h deleted file mode 100644 index d4e07daf4f1..00000000000 --- a/indra/media_plugins/gstreamer010/llmediaimplgstreamervidplug.h +++ /dev/null @@ -1,105 +0,0 @@ -/** - * @file llmediaimplgstreamervidplug.h - * @brief Video-consuming static GStreamer plugin for gst-to-LLMediaImpl - * - * @cond - * $LicenseInfo:firstyear=2007&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 - */ - -#ifndef __GST_SLVIDEO_H__ -#define __GST_SLVIDEO_H__ - -#if LL_GSTREAMER010_ENABLED - -extern "C" { -#include -#include -#include -} - -G_BEGIN_DECLS - -/* #defines don't like whitespacey bits */ -#define GST_TYPE_SLVIDEO \ - (gst_slvideo_get_type()) -#define GST_SLVIDEO(obj) \ - (G_TYPE_CHECK_INSTANCE_CAST((obj),GST_TYPE_SLVIDEO,GstSLVideo)) -#define GST_SLVIDEO_CLASS(klass) \ - (G_TYPE_CHECK_CLASS_CAST((klass),GST_TYPE_SLVIDEO,GstSLVideoClass)) -#define GST_IS_SLVIDEO(obj) \ - (G_TYPE_CHECK_INSTANCE_TYPE((obj),GST_TYPE_SLVIDEO)) -#define GST_IS_SLVIDEO_CLASS(klass) \ - (G_TYPE_CHECK_CLASS_TYPE((klass),GST_TYPE_SLVIDEO)) - -typedef struct _GstSLVideo GstSLVideo; -typedef struct _GstSLVideoClass GstSLVideoClass; - -typedef enum { - SLV_PF_UNKNOWN = 0, - SLV_PF_RGBX = 1, - SLV_PF_BGRX = 2, - SLV__END = 3 -} SLVPixelFormat; -const int SLVPixelFormatBytes[SLV__END] = {1, 4, 4}; - -struct _GstSLVideo -{ - GstVideoSink video_sink; - - GstCaps *caps; - - int fps_n, fps_d; - int par_n, par_d; - int height, width; - SLVPixelFormat format; - - // SHARED WITH APPLICATION: - // Access to the following should be protected by GST_OBJECT_LOCK() on - // the GstSLVideo object, and should be totally consistent upon UNLOCK - // (i.e. all written at once to reflect the current retained frame info - // when the retained frame is updated.) - bool retained_frame_ready; // new frame ready since flag last reset. (*TODO: could get the writer to wait on a semaphore instead of having the reader poll, potentially making dropped frames somewhat cheaper.) - unsigned char* retained_frame_data; - int retained_frame_allocbytes; - int retained_frame_width, retained_frame_height; - SLVPixelFormat retained_frame_format; - // sticky resize info - bool resize_forced_always; - int resize_try_width; - int resize_try_height; -}; - -struct _GstSLVideoClass -{ - GstVideoSinkClass parent_class; -}; - -GType gst_slvideo_get_type (void); - -void gst_slvideo_init_class (void); - -G_END_DECLS - -#endif // LL_GSTREAMER010_ENABLED - -#endif /* __GST_SLVIDEO_H__ */ diff --git a/indra/media_plugins/gstreamer010/media_plugin_gstreamer010.cpp b/indra/media_plugins/gstreamer010/media_plugin_gstreamer010.cpp deleted file mode 100644 index 97d1d7d7b52..00000000000 --- a/indra/media_plugins/gstreamer010/media_plugin_gstreamer010.cpp +++ /dev/null @@ -1,1266 +0,0 @@ -/** - * @file media_plugin_gstreamer010.cpp - * @brief GStreamer-0.10 plugin for LLMedia API plugin system - * - * @cond - * $LicenseInfo:firstyear=2007&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_GSTREAMER010_ENABLED - -extern "C" { -#include -} - -#include "llmediaimplgstreamer.h" -#include "llmediaimplgstreamertriviallogging.h" - -#include "llmediaimplgstreamervidplug.h" - -#include "llmediaimplgstreamer_syms.h" - -////////////////////////////////////////////////////////////////////////////// -// -class MediaPluginGStreamer010 : public MediaPluginBase -{ -public: - MediaPluginGStreamer010(LLPluginInstance::sendMessageFunction host_send_func, void *host_user_data); - ~MediaPluginGStreamer010(); - - /* virtual */ void receiveMessage(const char *message_string); - - static bool startup(); - static bool closedown(); - - gboolean processGSTEvents(GstBus *bus, - GstMessage *message); - -private: - std::string getVersion(); - bool navigateTo( const std::string urlIn ); - bool seek( double time_sec ); - bool setVolume( float volume ); - - // misc - bool pause(); - bool stop(); - bool play(double rate); - bool getTimePos(double &sec_out); - - static const double MIN_LOOP_SEC = 1.0F; - - bool mIsLooping; - - enum ECommand { - COMMAND_NONE, - COMMAND_STOP, - COMMAND_PLAY, - COMMAND_FAST_FORWARD, - COMMAND_FAST_REWIND, - COMMAND_PAUSE, - COMMAND_SEEK, - }; - ECommand mCommand; - -private: - bool unload(); - bool load(); - - bool update(int milliseconds); - void mouseDown( int x, int y ); - void mouseUp( int x, int y ); - void mouseMove( int x, int y ); - - void sizeChanged(); - - static bool mDoneInit; - - guint mBusWatchID; - - float mVolume; - - int mDepth; - - // media NATURAL size - int mNaturalWidth; - int mNaturalHeight; - // media current size - int mCurrentWidth; - int mCurrentHeight; - int mCurrentRowbytes; - // previous media size so we can detect changes - int mPreviousWidth; - int mPreviousHeight; - // desired render size from host - int mWidth; - int mHeight; - // padded texture size we need to write into - int mTextureWidth; - int mTextureHeight; - - int mTextureFormatPrimary; - int mTextureFormatType; - - bool mSeekWanted; - double mSeekDestination; - - // Very GStreamer-specific - GMainLoop *mPump; // event pump for this media - GstElement *mPlaybin; - GstElement *mVisualizer; - GstSLVideo *mVideoSink; -}; - -//static -bool MediaPluginGStreamer010::mDoneInit = false; - -MediaPluginGStreamer010::MediaPluginGStreamer010( - LLPluginInstance::sendMessageFunction host_send_func, - void *host_user_data ) : - MediaPluginBase(host_send_func, host_user_data), - mBusWatchID ( 0 ), - mCurrentRowbytes ( 4 ), - mTextureFormatPrimary ( GL_RGBA ), - mTextureFormatType ( GL_UNSIGNED_INT_8_8_8_8_REV ), - mSeekWanted(false), - mSeekDestination(0.0), - mPump ( NULL ), - mPlaybin ( NULL ), - mVisualizer ( NULL ), - mVideoSink ( NULL ), - mCommand ( COMMAND_NONE ) -{ - std::ostringstream str; - INFOMSG("MediaPluginGStreamer010 constructor - my PID=%u", U32(getpid())); -} - -/////////////////////////////////////////////////////////////////////////////// -// -//#define LL_GST_REPORT_STATE_CHANGES -#ifdef LL_GST_REPORT_STATE_CHANGES -static char* get_gst_state_name(GstState state) -{ - switch (state) { - case GST_STATE_VOID_PENDING: return "VOID_PENDING"; - case GST_STATE_NULL: return "NULL"; - case GST_STATE_READY: return "READY"; - case GST_STATE_PAUSED: return "PAUSED"; - case GST_STATE_PLAYING: return "PLAYING"; - } - return "(unknown)"; -} -#endif // LL_GST_REPORT_STATE_CHANGES - -gboolean -MediaPluginGStreamer010::processGSTEvents(GstBus *bus, - GstMessage *message) -{ - if (!message) - return TRUE; // shield against GStreamer bug - - if (GST_MESSAGE_TYPE(message) != GST_MESSAGE_STATE_CHANGED && - GST_MESSAGE_TYPE(message) != GST_MESSAGE_BUFFERING) - { - DEBUGMSG("Got GST message type: %s", - LLGST_MESSAGE_TYPE_NAME (message)); - } - else - { - // TODO: grok 'duration' message type - DEBUGMSG("Got GST message type: %s", - LLGST_MESSAGE_TYPE_NAME (message)); - } - - switch (GST_MESSAGE_TYPE (message)) { - case GST_MESSAGE_BUFFERING: { - // NEEDS GST 0.10.11+ - if (llgst_message_parse_buffering) - { - gint percent = 0; - llgst_message_parse_buffering(message, &percent); - DEBUGMSG("GST buffering: %d%%", percent); - } - break; - } - case GST_MESSAGE_STATE_CHANGED: { - GstState old_state; - GstState new_state; - GstState pending_state; - llgst_message_parse_state_changed(message, - &old_state, - &new_state, - &pending_state); -#ifdef LL_GST_REPORT_STATE_CHANGES - // not generally very useful, and rather spammy. - DEBUGMSG("state change (old,,pending): %s,<%s>,%s", - get_gst_state_name(old_state), - get_gst_state_name(new_state), - get_gst_state_name(pending_state)); -#endif // LL_GST_REPORT_STATE_CHANGES - - switch (new_state) { - case GST_STATE_VOID_PENDING: - break; - case GST_STATE_NULL: - break; - case GST_STATE_READY: - setStatus(STATUS_LOADED); - break; - case GST_STATE_PAUSED: - setStatus(STATUS_PAUSED); - break; - case GST_STATE_PLAYING: - setStatus(STATUS_PLAYING); - break; - } - break; - } - case GST_MESSAGE_ERROR: { - GError *err = NULL; - gchar *debug = NULL; - - llgst_message_parse_error (message, &err, &debug); - WARNMSG("GST error: %s", err?err->message:"(unknown)"); - if (err) - g_error_free (err); - g_free (debug); - - mCommand = COMMAND_STOP; - - setStatus(STATUS_ERROR); - - break; - } - case GST_MESSAGE_INFO: { - if (llgst_message_parse_info) - { - GError *err = NULL; - gchar *debug = NULL; - - llgst_message_parse_info (message, &err, &debug); - INFOMSG("GST info: %s", err?err->message:"(unknown)"); - if (err) - g_error_free (err); - g_free (debug); - } - break; - } - case GST_MESSAGE_WARNING: { - GError *err = NULL; - gchar *debug = NULL; - - llgst_message_parse_warning (message, &err, &debug); - WARNMSG("GST warning: %s", err?err->message:"(unknown)"); - if (err) - g_error_free (err); - g_free (debug); - - break; - } - case GST_MESSAGE_EOS: - /* end-of-stream */ - DEBUGMSG("GST end-of-stream."); - if (mIsLooping) - { - DEBUGMSG("looping media..."); - double eos_pos_sec = 0.0F; - bool got_eos_position = getTimePos(eos_pos_sec); - - if (got_eos_position && eos_pos_sec < MIN_LOOP_SEC) - { - // if we know that the movie is really short, don't - // loop it else it can easily become a time-hog - // because of GStreamer spin-up overhead - DEBUGMSG("really short movie (%0.3fsec) - not gonna loop this, pausing instead.", eos_pos_sec); - // inject a COMMAND_PAUSE - mCommand = COMMAND_PAUSE; - } - else - { -#undef LLGST_LOOP_BY_SEEKING -// loop with a stop-start instead of a seek, because it actually seems rather -// faster than seeking on remote streams. -#ifdef LLGST_LOOP_BY_SEEKING - // first, try looping by an explicit rewind - bool seeksuccess = seek(0.0); - if (seeksuccess) - { - play(1.0); - } - else -#endif // LLGST_LOOP_BY_SEEKING - { // use clumsy stop-start to loop - DEBUGMSG("didn't loop by rewinding - stopping and starting instead..."); - stop(); - play(1.0); - } - } - } - else // not a looping media - { - // inject a COMMAND_STOP - mCommand = COMMAND_STOP; - } - break; - default: - /* unhandled message */ - break; - } - - /* we want to be notified again the next time there is a message - * on the bus, so return true (false means we want to stop watching - * for messages on the bus and our callback should not be called again) - */ - return TRUE; -} - -extern "C" { -gboolean -llmediaimplgstreamer_bus_callback (GstBus *bus, - GstMessage *message, - gpointer data) -{ - MediaPluginGStreamer010 *impl = (MediaPluginGStreamer010*)data; - return impl->processGSTEvents(bus, message); -} -} // extern "C" - - - -bool -MediaPluginGStreamer010::navigateTo ( const std::string urlIn ) -{ - if (!mDoneInit) - return false; // error - - setStatus(STATUS_LOADING); - - DEBUGMSG("Setting media URI: %s", urlIn.c_str()); - - mSeekWanted = false; - - if (NULL == mPump || - NULL == mPlaybin) - { - setStatus(STATUS_ERROR); - return false; // error - } - - // set URI - g_object_set (G_OBJECT (mPlaybin), "uri", urlIn.c_str(), NULL); - //g_object_set (G_OBJECT (mPlaybin), "uri", "file:///tmp/movie", NULL); - - // navigateTo implicitly plays, too. - play(1.0); - - return true; -} - - -bool -MediaPluginGStreamer010::update(int milliseconds) -{ - if (!mDoneInit) - return false; // error - - DEBUGMSG("updating media..."); - - // sanity check - if (NULL == mPump || - NULL == mPlaybin) - { - DEBUGMSG("dead media..."); - return false; - } - - // see if there's an outstanding seek wanted - if (mSeekWanted && - // bleh, GST has to be happy that the movie is really truly playing - // or it may quietly ignore the seek (with rtsp:// at least). - (GST_STATE(mPlaybin) == GST_STATE_PLAYING)) - { - seek(mSeekDestination); - mSeekWanted = false; - } - - // *TODO: time-limit - but there isn't a lot we can do here, most - // time is spent in gstreamer's own opaque worker-threads. maybe - // we can do something sneaky like only unlock the video object - // for 'milliseconds' and otherwise hold the lock. - while (g_main_context_pending(g_main_loop_get_context(mPump))) - { - g_main_context_iteration(g_main_loop_get_context(mPump), FALSE); - } - - // check for availability of a new frame - - if (mVideoSink) - { - GST_OBJECT_LOCK(mVideoSink); - if (mVideoSink->retained_frame_ready) - { - DEBUGMSG("NEW FRAME READY"); - - if (mVideoSink->retained_frame_width != mCurrentWidth || - mVideoSink->retained_frame_height != mCurrentHeight) - // *TODO: also check for change in format - { - // just resize container, don't consume frame - int neww = mVideoSink->retained_frame_width; - int newh = mVideoSink->retained_frame_height; - - int newd = 4; - mTextureFormatPrimary = GL_RGBA; - mTextureFormatType = GL_UNSIGNED_INT_8_8_8_8_REV; - - /* - int newd = SLVPixelFormatBytes[mVideoSink->retained_frame_format]; - if (SLV_PF_BGRX == mVideoSink->retained_frame_format) - { - mTextureFormatPrimary = GL_BGRA; - mTextureFormatType = GL_UNSIGNED_INT_8_8_8_8_REV; - } - else - { - mTextureFormatPrimary = GL_RGBA; - mTextureFormatType = GL_UNSIGNED_INT_8_8_8_8_REV; - } - */ - - GST_OBJECT_UNLOCK(mVideoSink); - - mCurrentRowbytes = neww * newd; - DEBUGMSG("video container resized to %dx%d", - neww, newh); - - mDepth = newd; - mCurrentWidth = neww; - mCurrentHeight = newh; - sizeChanged(); - return true; - } - - if (mPixels && - mCurrentHeight <= mHeight && - mCurrentWidth <= mWidth && - !mTextureSegmentName.empty()) - { - // we're gonna totally consume this frame - reset 'ready' flag - mVideoSink->retained_frame_ready = FALSE; - int destination_rowbytes = mWidth * mDepth; - for (int row=0; rowretained_frame_data - [mCurrentRowbytes * row], - mCurrentRowbytes); - } - - GST_OBJECT_UNLOCK(mVideoSink); - DEBUGMSG("NEW FRAME REALLY TRULY CONSUMED, TELLING HOST"); - - setDirty(0,0,mCurrentWidth,mCurrentHeight); - } - else - { - // new frame ready, but we're not ready to - // consume it. - - GST_OBJECT_UNLOCK(mVideoSink); - - DEBUGMSG("NEW FRAME not consumed, still waiting for a shm segment and/or shm resize"); - } - - return true; - } - else - { - // nothing to do yet. - GST_OBJECT_UNLOCK(mVideoSink); - return true; - } - } - - return true; -} - - -void -MediaPluginGStreamer010::mouseDown( int x, int y ) -{ - // do nothing -} - -void -MediaPluginGStreamer010::mouseUp( int x, int y ) -{ - // do nothing -} - -void -MediaPluginGStreamer010::mouseMove( int x, int y ) -{ - // do nothing -} - - -bool -MediaPluginGStreamer010::pause() -{ - DEBUGMSG("pausing media..."); - // todo: error-check this? - if (mDoneInit && mPlaybin) - { - llgst_element_set_state(mPlaybin, GST_STATE_PAUSED); - return true; - } - return false; -} - -bool -MediaPluginGStreamer010::stop() -{ - DEBUGMSG("stopping media..."); - // todo: error-check this? - if (mDoneInit && mPlaybin) - { - llgst_element_set_state(mPlaybin, GST_STATE_READY); - return true; - } - return false; -} - -bool -MediaPluginGStreamer010::play(double rate) -{ - // NOTE: we don't actually support non-natural rate. - - DEBUGMSG("playing media... rate=%f", rate); - // todo: error-check this? - if (mDoneInit && mPlaybin) - { - llgst_element_set_state(mPlaybin, GST_STATE_PLAYING); - return true; - } - return false; -} - -bool -MediaPluginGStreamer010::setVolume( float volume ) -{ - // we try to only update volume as conservatively as - // possible, as many gst-plugins-base versions up to at least - // November 2008 have critical race-conditions in setting volume - sigh - if (mVolume == volume) - return true; // nothing to do, everything's fine - - mVolume = volume; - if (mDoneInit && mPlaybin) - { - g_object_set(mPlaybin, "volume", mVolume, NULL); - return true; - } - - return false; -} - -bool -MediaPluginGStreamer010::seek(double time_sec) -{ - bool success = false; - if (mDoneInit && mPlaybin) - { - success = llgst_element_seek(mPlaybin, 1.0F, GST_FORMAT_TIME, - GstSeekFlags(GST_SEEK_FLAG_FLUSH | - GST_SEEK_FLAG_KEY_UNIT), - GST_SEEK_TYPE_SET, gint64(time_sec*GST_SECOND), - GST_SEEK_TYPE_NONE, GST_CLOCK_TIME_NONE); - } - DEBUGMSG("MEDIA SEEK REQUEST to %fsec result was %d", - float(time_sec), int(success)); - return success; -} - -bool -MediaPluginGStreamer010::getTimePos(double &sec_out) -{ - bool got_position = false; - if (mDoneInit && mPlaybin) - { - gint64 pos; - GstFormat timefmt = GST_FORMAT_TIME; - got_position = - llgst_element_query_position && - llgst_element_query_position(mPlaybin, - &timefmt, - &pos); - got_position = got_position - && (timefmt == GST_FORMAT_TIME); - // GStreamer may have other ideas, but we consider the current position - // undefined if not PLAYING or PAUSED - got_position = got_position && - (GST_STATE(mPlaybin) == GST_STATE_PLAYING || - GST_STATE(mPlaybin) == GST_STATE_PAUSED); - if (got_position && !GST_CLOCK_TIME_IS_VALID(pos)) - { - if (GST_STATE(mPlaybin) == GST_STATE_PLAYING) - { - // if we're playing then we treat an invalid clock time - // as 0, for complicated reasons (insert reason here) - pos = 0; - } - else - { - got_position = false; - } - - } - // If all the preconditions succeeded... we can trust the result. - if (got_position) - { - sec_out = double(pos) / double(GST_SECOND); // gst to sec - } - } - return got_position; -} - -bool -MediaPluginGStreamer010::load() -{ - if (!mDoneInit) - return false; // error - - setStatus(STATUS_LOADING); - - DEBUGMSG("setting up media..."); - - mIsLooping = false; - mVolume = 0.1234567; // minor hack to force an initial volume update - - // Create a pumpable main-loop for this media - mPump = g_main_loop_new (NULL, FALSE); - if (!mPump) - { - setStatus(STATUS_ERROR); - return false; // error - } - - // instantiate a playbin element to do the hard work - mPlaybin = llgst_element_factory_make ("playbin", "play"); - if (!mPlaybin) - { - setStatus(STATUS_ERROR); - return false; // error - } - - // get playbin's bus - GstBus *bus = llgst_pipeline_get_bus (GST_PIPELINE (mPlaybin)); - if (!bus) - { - setStatus(STATUS_ERROR); - return false; // error - } - mBusWatchID = llgst_bus_add_watch (bus, - llmediaimplgstreamer_bus_callback, - this); - llgst_object_unref (bus); - -#if 0 // not quite stable/correct yet - // get a visualizer element (bonus feature!) - char* vis_name = getenv("LL_GST_VIS_NAME"); - if (!vis_name || - (vis_name && std::string(vis_name)!="none")) - { - if (vis_name) - { - mVisualizer = llgst_element_factory_make (vis_name, "vis"); - } - if (!mVisualizer) - { - mVisualizer = llgst_element_factory_make ("libvisual_jess", "vis"); - if (!mVisualizer) - { - mVisualizer = llgst_element_factory_make ("goom", "vis"); - if (!mVisualizer) - { - mVisualizer = llgst_element_factory_make ("libvisual_lv_scope", "vis"); - if (!mVisualizer) - { - // That's okay, we don't NEED this. - } - } - } - } - } -#endif - - if (NULL == getenv("LL_GSTREAMER_EXTERNAL")) { - // instantiate a custom video sink - mVideoSink = - GST_SLVIDEO(llgst_element_factory_make ("private-slvideo", "slvideo")); - if (!mVideoSink) - { - WARNMSG("Could not instantiate private-slvideo element."); - // todo: cleanup. - setStatus(STATUS_ERROR); - return false; // error - } - - // connect the pieces - g_object_set(mPlaybin, "video-sink", mVideoSink, NULL); - } - - if (mVisualizer) - { - g_object_set(mPlaybin, "vis-plugin", mVisualizer, NULL); - } - - return true; -} - -bool -MediaPluginGStreamer010::unload () -{ - if (!mDoneInit) - return false; // error - - DEBUGMSG("unloading media..."); - - // stop getting callbacks for this bus - g_source_remove(mBusWatchID); - mBusWatchID = 0; - - if (mPlaybin) - { - llgst_element_set_state (mPlaybin, GST_STATE_NULL); - llgst_object_unref (GST_OBJECT (mPlaybin)); - mPlaybin = NULL; - } - - if (mVisualizer) - { - llgst_object_unref (GST_OBJECT (mVisualizer)); - mVisualizer = NULL; - } - - if (mPump) - { - g_main_loop_quit(mPump); - mPump = NULL; - } - - mVideoSink = NULL; - - setStatus(STATUS_NONE); - - return true; -} - - -//static -bool -MediaPluginGStreamer010::startup() -{ - // first - check if GStreamer is explicitly disabled - if (NULL != getenv("LL_DISABLE_GSTREAMER")) - return false; - - // only do global GStreamer initialization once. - if (!mDoneInit) - { - g_thread_init(NULL); - - // Init the glib type system - we need it. - g_type_init(); - - // Get symbols! -#if LL_DARWIN - if (! grab_gst_syms("libgstreamer-0.10.dylib", - "libgstvideo-0.10.dylib") ) -#elseif LL_WINDOWS - if (! grab_gst_syms("libgstreamer-0.10.dll", - "libgstvideo-0.10.dll") ) -#else // linux or other ELFy unixoid - if (! grab_gst_syms("libgstreamer-0.10.so.0", - "libgstvideo-0.10.so.0") ) -#endif - { - WARNMSG("Couldn't find suitable GStreamer 0.10 support on this system - video playback disabled."); - return false; - } - - if (llgst_segtrap_set_enabled) - { - llgst_segtrap_set_enabled(FALSE); - } - else - { - WARNMSG("gst_segtrap_set_enabled() is not available; plugin crashes won't be caught."); - } - -#if LL_LINUX - // Gstreamer tries a fork during init, waitpid-ing on it, - // which conflicts with any installed SIGCHLD handler... - struct sigaction tmpact, oldact; - if (llgst_registry_fork_set_enabled) { - // if we can disable SIGCHLD-using forking behaviour, - // do it. - llgst_registry_fork_set_enabled(false); - } - else { - // else temporarily install default SIGCHLD handler - // while GStreamer initialises - tmpact.sa_handler = SIG_DFL; - sigemptyset( &tmpact.sa_mask ); - tmpact.sa_flags = SA_SIGINFO; - sigaction(SIGCHLD, &tmpact, &oldact); - } -#endif // LL_LINUX - - // Protect against GStreamer resetting the locale, yuck. - static std::string saved_locale; - saved_locale = setlocale(LC_ALL, NULL); - - // finally, try to initialize GStreamer! - GError *err = NULL; - gboolean init_gst_success = llgst_init_check(NULL, NULL, &err); - - // restore old locale - setlocale(LC_ALL, saved_locale.c_str() ); - -#if LL_LINUX - // restore old SIGCHLD handler - if (!llgst_registry_fork_set_enabled) - sigaction(SIGCHLD, &oldact, NULL); -#endif // LL_LINUX - - if (!init_gst_success) // fail - { - if (err) - { - WARNMSG("GST init failed: %s", err->message); - g_error_free(err); - } - else - { - WARNMSG("GST init failed for unspecified reason."); - } - return false; - } - - // Init our custom plugins - only really need do this once. - gst_slvideo_init_class(); - - mDoneInit = true; - } - - return true; -} - - -void -MediaPluginGStreamer010::sizeChanged() -{ - // the shared writing space has possibly changed size/location/whatever - - // Check to see whether the movie's NATURAL size has been set yet - if (1 == mNaturalWidth && - 1 == mNaturalHeight) - { - mNaturalWidth = mCurrentWidth; - mNaturalHeight = mCurrentHeight; - DEBUGMSG("Media NATURAL size better detected as %dx%d", - mNaturalWidth, mNaturalHeight); - } - - // if the size has changed then the shm has changed and the app needs telling - if (mCurrentWidth != mPreviousWidth || - mCurrentHeight != mPreviousHeight) - { - mPreviousWidth = mCurrentWidth; - mPreviousHeight = mCurrentHeight; - - LLPluginMessage message(LLPLUGIN_MESSAGE_CLASS_MEDIA, "size_change_request"); - message.setValue("name", mTextureSegmentName); - message.setValueS32("width", mNaturalWidth); - message.setValueS32("height", mNaturalHeight); - DEBUGMSG("<--- Sending size change request to application with name: '%s' - natural size is %d x %d", mTextureSegmentName.c_str(), mNaturalWidth, mNaturalHeight); - sendMessage(message); - } -} - - - -//static -bool -MediaPluginGStreamer010::closedown() -{ - if (!mDoneInit) - return false; // error - - ungrab_gst_syms(); - - mDoneInit = false; - - return true; -} - -MediaPluginGStreamer010::~MediaPluginGStreamer010() -{ - DEBUGMSG("MediaPluginGStreamer010 destructor"); - - closedown(); - - DEBUGMSG("GStreamer010 closing down"); -} - - -std::string -MediaPluginGStreamer010::getVersion() -{ - std::string plugin_version = "GStreamer010 media plugin, GStreamer version "; - if (mDoneInit && - llgst_version) - { - guint major, minor, micro, nano; - llgst_version(&major, &minor, µ, &nano); - plugin_version += llformat("%u.%u.%u.%u (runtime), %u.%u.%u.%u (headers)", (unsigned int)major, (unsigned int)minor, (unsigned int)micro, (unsigned int)nano, (unsigned int)GST_VERSION_MAJOR, (unsigned int)GST_VERSION_MINOR, (unsigned int)GST_VERSION_MICRO, (unsigned int)GST_VERSION_NANO); - } - else - { - plugin_version += "(unknown)"; - } - return plugin_version; -} - -void MediaPluginGStreamer010::receiveMessage(const char *message_string) -{ - //std::cerr << "MediaPluginGStreamer010::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; - versions[LLPLUGIN_MESSAGE_CLASS_MEDIA_TIME] = LLPLUGIN_MESSAGE_CLASS_MEDIA_TIME_VERSION; - message.setValueLLSD("versions", versions); - - if ( load() ) - { - DEBUGMSG("GStreamer010 media instance set up"); - } - else - { - WARNMSG("GStreamer010 media instance failed to set up"); - } - - message.setValue("plugin_version", getVersion()); - sendMessage(message); - } - else if(message_name == "idle") - { - // no response is necessary here. - double time = message_in.getValueReal("time"); - - // Convert time to milliseconds for update() - update((int)(time * 1000.0f)); - } - else if(message_name == "cleanup") - { - unload(); - closedown(); - } - 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::ostringstream str; - INFOMSG("MediaPluginGStreamer010::receiveMessage: shared memory added, name: %s, size: %d, address: %p", name.c_str(), int(info.mSize), info.mAddress); - - mSharedSegments.insert(SharedSegmentMap::value_type(name, info)); - } - else if(message_name == "shm_remove") - { - std::string name = message_in.getValue("name"); - - DEBUGMSG("MediaPluginGStreamer010::receiveMessage: shared memory remove, name = %s", name.c_str()); - - 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 decoder is no longer pointed at the shared segment. - sizeChanged(); - } - mSharedSegments.erase(iter); - } - else - { - WARNMSG("MediaPluginGStreamer010::receiveMessage: unknown shared memory region!"); - } - - // Send the response so it can be cleaned up. - LLPluginMessage message("base", "shm_remove_response"); - message.setValue("name", name); - sendMessage(message); - } - else - { - std::ostringstream str; - INFOMSG("MediaPluginGStreamer010::receiveMessage: unknown base message: %s", message_name.c_str()); - } - } - else if(message_class == LLPLUGIN_MESSAGE_CLASS_MEDIA) - { - if(message_name == "init") - { - // Plugin gets to decide the texture parameters to use. - LLPluginMessage message(LLPLUGIN_MESSAGE_CLASS_MEDIA, "texture_params"); - // lame to have to decide this now, it depends on the movie. Oh well. - mDepth = 4; - - mCurrentWidth = 1; - mCurrentHeight = 1; - mPreviousWidth = 1; - mPreviousHeight = 1; - mNaturalWidth = 1; - mNaturalHeight = 1; - mWidth = 1; - mHeight = 1; - mTextureWidth = 1; - mTextureHeight = 1; - - message.setValueU32("format", GL_RGBA); - message.setValueU32("type", GL_UNSIGNED_INT_8_8_8_8_REV); - - message.setValueS32("depth", mDepth); - message.setValueS32("default_width", mWidth); - message.setValueS32("default_height", mHeight); - message.setValueU32("internalformat", GL_RGBA8); - message.setValueBoolean("coords_opengl", true); // true == use OpenGL-style coordinates, false == (0,0) is upper left. - message.setValueBoolean("allow_downsample", true); // we respond with grace and performance if asked to downscale - 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::ostringstream str; - INFOMSG("---->Got size change instruction from application with shm name: %s - size is %d x %d", name.c_str(), width, height); - - 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()) - { - INFOMSG("*** Got size change with matching shm, new size is %d x %d", width, height); - INFOMSG("*** Got size change with matching shm, texture size size is %d x %d", texture_width, texture_height); - - mPixels = (unsigned char*)iter->second.mAddress; - mTextureSegmentName = name; - mWidth = width; - mHeight = height; - - if (texture_width > 1 || - texture_height > 1) // not a dummy size from the app, a real explicit forced size - { - INFOMSG("**** = REAL RESIZE REQUEST FROM APP"); - - GST_OBJECT_LOCK(mVideoSink); - mVideoSink->resize_forced_always = true; - mVideoSink->resize_try_width = texture_width; - mVideoSink->resize_try_height = texture_height; - GST_OBJECT_UNLOCK(mVideoSink); - } - - mTextureWidth = texture_width; - mTextureHeight = texture_height; - } - } - } - else if(message_name == "load_uri") - { - std::string uri = message_in.getValue("uri"); - navigateTo( 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") - { - double rate = 0.0; - if(message_in.hasValue("rate")) - { - rate = message_in.getValueReal("rate"); - } - // NOTE: we don't actually support rate. - play(rate); - } - else if(message_name == "pause") - { - pause(); - } - else if(message_name == "seek") - { - double time = message_in.getValueReal("time"); - // defer the actual seek in case we haven't - // really truly started yet in which case there - // is nothing to seek upon - mSeekWanted = true; - mSeekDestination = time; - } - else if(message_name == "set_loop") - { - bool loop = message_in.getValueBoolean("loop"); - mIsLooping = loop; - } - else if(message_name == "set_volume") - { - double volume = message_in.getValueReal("volume"); - setVolume(volume); - } - } - else - { - INFOMSG("MediaPluginGStreamer010::receiveMessage: unknown message class: %s", message_class.c_str()); - } - } -} - -int init_media_plugin(LLPluginInstance::sendMessageFunction host_send_func, void *host_user_data, LLPluginInstance::sendMessageFunction *plugin_send_func, void **plugin_user_data) -{ - if (MediaPluginGStreamer010::startup()) - { - MediaPluginGStreamer010 *self = new MediaPluginGStreamer010(host_send_func, host_user_data); - *plugin_send_func = MediaPluginGStreamer010::staticReceiveMessage; - *plugin_user_data = (void*)self; - - return 0; // okay - } - else - { - return -1; // failed to init - } -} - -#else // LL_GSTREAMER010_ENABLED - -// Stubbed-out class with constructor/destructor (necessary or windows linker -// will just think its dead code and optimize it all out) -class MediaPluginGStreamer010 : public MediaPluginBase -{ -public: - MediaPluginGStreamer010(LLPluginInstance::sendMessageFunction host_send_func, void *host_user_data); - ~MediaPluginGStreamer010(); - /* virtual */ void receiveMessage(const char *message_string); -}; - -MediaPluginGStreamer010::MediaPluginGStreamer010( - LLPluginInstance::sendMessageFunction host_send_func, - void *host_user_data ) : - MediaPluginBase(host_send_func, host_user_data) -{ - // no-op -} - -MediaPluginGStreamer010::~MediaPluginGStreamer010() -{ - // no-op -} - -void MediaPluginGStreamer010::receiveMessage(const char *message_string) -{ - // no-op -} - -// We're building without GStreamer 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_GSTREAMER010_ENABLED diff --git a/indra/media_plugins/gstreamer10/CMakeLists.txt b/indra/media_plugins/gstreamer10/CMakeLists.txt new file mode 100644 index 00000000000..279e07b2260 --- /dev/null +++ b/indra/media_plugins/gstreamer10/CMakeLists.txt @@ -0,0 +1,40 @@ +# -*- cmake -*- + +project(media_plugin_gstreamer10) + +include(00-Common) +include(LLCommon) +include(LLImage) +include(LLMath) +include(LLWindow) +include(Linking) +include(PluginAPI) +include(OpenGL) +include(GLIB) + +include(GStreamer10Plugin) + +### media_plugin_gstreamer10 + +set(media_plugin_gstreamer10_SOURCE_FILES + media_plugin_gstreamer10.cpp + ) + +set(media_plugin_gstreamer10_HEADER_FILES + llmediaimplgstreamer_syms.h + ) + +add_library(media_plugin_gstreamer10 + SHARED + ${media_plugin_gstreamer10_SOURCE_FILES} +) + +target_link_libraries(media_plugin_gstreamer10 media_plugin_base ll::gstreamer10 ) + +if (WINDOWS) + set_target_properties( + media_plugin_gstreamer10 + PROPERTIES + LINK_FLAGS "/MANIFEST:NO /SAFESEH:NO /NODEFAULTLIB:LIBCMT" + ) +endif (WINDOWS) diff --git a/indra/media_plugins/gstreamer10/llmediaimplgstreamer_syms_raw.inc b/indra/media_plugins/gstreamer10/llmediaimplgstreamer_syms_raw.inc new file mode 100644 index 00000000000..e3b959f2b69 --- /dev/null +++ b/indra/media_plugins/gstreamer10/llmediaimplgstreamer_syms_raw.inc @@ -0,0 +1,71 @@ +#define G gstSymbolGrabber + +LL_GRAB_SYM(G, true, gst_buffer_new, GstBuffer*, void) +LL_GRAB_SYM(G, true, gst_structure_set_value, void, GstStructure *, const gchar *, const GValue*) +LL_GRAB_SYM(G, true, gst_init_check, gboolean, int *argc, char **argv[], GError ** err) +LL_GRAB_SYM(G, true, gst_message_get_type, GType, void) +LL_GRAB_SYM(G, true, gst_message_type_get_name, const gchar*, GstMessageType type) +LL_GRAB_SYM(G, true, gst_message_parse_error, void, GstMessage *message, GError **gerror, gchar **debug) +LL_GRAB_SYM(G, true, gst_message_parse_warning, void, GstMessage *message, GError **gerror, gchar **debug) +LL_GRAB_SYM(G, true, gst_message_parse_state_changed, void, GstMessage *message, GstState *oldstate, GstState *newstate, GstState *pending) +LL_GRAB_SYM(G, true, gst_element_set_state, GstStateChangeReturn, GstElement *element, GstState state) +LL_GRAB_SYM(G, true, gst_object_unref, void, gpointer object) +LL_GRAB_SYM(G, true, gst_object_get_type, GType, void) +LL_GRAB_SYM(G, true, gst_pipeline_get_type, GType, void) +LL_GRAB_SYM(G, true, gst_pipeline_get_bus, GstBus*, GstPipeline *pipeline) +LL_GRAB_SYM(G, true, gst_bus_add_watch, guint, GstBus * bus, GstBusFunc func, gpointer user_data) +LL_GRAB_SYM(G, true, gst_element_factory_make, GstElement*, const gchar *factoryname, const gchar *name) +LL_GRAB_SYM(G, true, gst_element_get_type, GType, void) +LL_GRAB_SYM(G, true, gst_static_pad_template_get, GstPadTemplate*, GstStaticPadTemplate *pad_template) +LL_GRAB_SYM(G, true, gst_element_class_add_pad_template, void, GstElementClass *klass, GstPadTemplate *temp) +LL_GRAB_SYM(G, true, gst_caps_from_string, GstCaps *, const gchar *string) +LL_GRAB_SYM(G, true, gst_caps_get_structure, GstStructure *, const GstCaps *caps, guint index) +LL_GRAB_SYM(G, true, gst_element_register, gboolean, GstPlugin *plugin, const gchar *name, guint rank, GType type) +LL_GRAB_SYM(G, true, gst_structure_get_int, gboolean, const GstStructure *structure, const gchar *fieldname, gint *value) +LL_GRAB_SYM(G, true, gst_structure_get_value, const GValue *, const GstStructure *structure, const gchar *fieldname) +LL_GRAB_SYM(G, true, gst_value_get_fraction_numerator, gint, const GValue *value) +LL_GRAB_SYM(G, true, gst_value_get_fraction_denominator, gint, const GValue *value) +LL_GRAB_SYM(G, true, gst_structure_get_name, const gchar *, const GstStructure *structure) +LL_GRAB_SYM(G, true, gst_element_seek, bool, GstElement *, gdouble, GstFormat, GstSeekFlags, GstSeekType, gint64, GstSeekType, gint64) + +LL_GRAB_SYM(G, false, gst_registry_fork_set_enabled, void, gboolean enabled) +LL_GRAB_SYM(G, false, gst_segtrap_set_enabled, void, gboolean enabled) +LL_GRAB_SYM(G, false, gst_message_parse_buffering, void, GstMessage *message, gint *percent) +LL_GRAB_SYM(G, false, gst_message_parse_info, void, GstMessage *message, GError **gerror, gchar **debug) +LL_GRAB_SYM(G, false, gst_element_query_position, gboolean, GstElement *element, GstFormat format, gint64 *cur) +LL_GRAB_SYM(G, false, gst_version, void, guint *major, guint *minor, guint *micro, guint *nano) + +LL_GRAB_SYM(G, true, gst_message_parse_tag, void, GstMessage *, GstTagList **) +LL_GRAB_SYM(G, true, gst_tag_list_foreach, void, const GstTagList *, GstTagForeachFunc, gpointer) +LL_GRAB_SYM(G, true, gst_tag_list_get_tag_size, guint, const GstTagList *, const gchar *) +LL_GRAB_SYM(G, true, gst_tag_list_get_value_index, const GValue *, const GstTagList *, const gchar *, guint) + +LL_GRAB_SYM(G, true, gst_caps_new_simple, GstCaps*, const char *, const char*, ... ) + +LL_GRAB_SYM(G, true, gst_sample_get_caps, GstCaps*, GstSample* ) +LL_GRAB_SYM(G, true, gst_sample_get_buffer, GstBuffer*, GstSample* ) +LL_GRAB_SYM(G, true, gst_buffer_map, gboolean, GstBuffer*, GstMapInfo*, GstMapFlags ) +LL_GRAB_SYM(G, true, gst_buffer_unmap, void, GstBuffer*, GstMapInfo* ) + +LL_GRAB_SYM(G, true, gst_app_sink_set_caps, void, GstAppSink*, GstCaps const* ) +LL_GRAB_SYM(G, true, gst_app_sink_pull_sample, GstSample*, GstAppSink* ) + +LL_GRAB_SYM(G, true, g_free, void, gpointer ) +LL_GRAB_SYM(G, true, g_error_free, void, GError* ) + +LL_GRAB_SYM(G, true, g_main_context_pending, gboolean, GMainContext* ) +LL_GRAB_SYM(G, true, g_main_loop_get_context, GMainContext*, GMainLoop* ) +LL_GRAB_SYM(G, true, g_main_context_iteration, gboolean, GMainContext*, gboolean ) +LL_GRAB_SYM(G, true, g_main_loop_new, GMainLoop*, GMainContext*, gboolean ) +LL_GRAB_SYM(G, true, g_main_loop_quit, void, GMainLoop* ) +LL_GRAB_SYM(G, true, gst_mini_object_unref, void, GstMiniObject* ) +LL_GRAB_SYM(G, true, g_object_set, void, gpointer, gchar const*, ... ) +LL_GRAB_SYM(G, true, g_source_remove, gboolean, guint ) +LL_GRAB_SYM(G, true, g_value_get_string, gchar const*, GValue const* ) + +LL_GRAB_SYM(G, true, gst_debug_set_active, void, gboolean ) +LL_GRAB_SYM(G, true, gst_debug_add_log_function, void, GstLogFunction, gpointer, GDestroyNotify ) +LL_GRAB_SYM(G, true, gst_debug_set_default_threshold, void, GstDebugLevel ) +LL_GRAB_SYM(G, true, gst_debug_message_get , gchar const*, GstDebugMessage * ) + +#undef G diff --git a/indra/media_plugins/gstreamer10/media_plugin_gstreamer10.cpp b/indra/media_plugins/gstreamer10/media_plugin_gstreamer10.cpp new file mode 100644 index 00000000000..5fdea569208 --- /dev/null +++ b/indra/media_plugins/gstreamer10/media_plugin_gstreamer10.cpp @@ -0,0 +1,958 @@ +/** + * @file media_plugin_gstreamer10.cpp + * @brief GStreamer-1.0 plugin for LLMedia API plugin system + * + * @cond + * $LicenseInfo:firstyear=2016&license=viewerlgpl$ + * Second Life Viewer Source Code + * Copyright (C) 2016, Linden Research, Inc. / Nicky Dasmijn + * + * 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 + */ + +#define FLIP_Y + +#include "linden_common.h" + +#include "llgl.h" + +#include "llplugininstance.h" +#include "llpluginmessage.h" +#include "llpluginmessageclasses.h" +#include "media_plugin_base.h" + +#define G_DISABLE_CAST_CHECKS +extern "C" { +#include +#include +} + +SymbolGrabber gstSymbolGrabber; + +#include "llmediaimplgstreamer_syms_raw.inc" + +static inline void llgst_caps_unref( GstCaps * caps ) +{ + llgst_mini_object_unref( GST_MINI_OBJECT_CAST( caps ) ); +} + +static inline void llgst_sample_unref( GstSample *aSample ) +{ + llgst_mini_object_unref( GST_MINI_OBJECT_CAST( aSample ) ); +} + +////////////////////////////////////////////////////////////////////////////// +// +class MediaPluginGStreamer10 : public MediaPluginBase +{ +public: + MediaPluginGStreamer10(LLPluginInstance::sendMessageFunction host_send_func, void *host_user_data); + ~MediaPluginGStreamer10(); + + /* virtual */ void receiveMessage(const char *message_string); + + static bool startup(); + static bool closedown(); + + gboolean processGSTEvents(GstBus *bus, GstMessage *message); + +private: + std::string getVersion(); + bool navigateTo( const std::string urlIn ); + bool seek( double time_sec ); + bool setVolume( float volume ); + + // misc + bool pause(); + bool stop(); + bool play(double rate); + bool getTimePos(double &sec_out); + + double MIN_LOOP_SEC = 1.0F; + U32 INTERNAL_TEXTURE_SIZE = 1024; + + bool mIsLooping; + + enum ECommand { + COMMAND_NONE, + COMMAND_STOP, + COMMAND_PLAY, + COMMAND_FAST_FORWARD, + COMMAND_FAST_REWIND, + COMMAND_PAUSE, + COMMAND_SEEK, + }; + ECommand mCommand; + +private: + bool unload(); + bool load(); + + bool update(int milliseconds); + void mouseDown( int x, int y ); + void mouseUp( int x, int y ); + void mouseMove( int x, int y ); + + static bool mDoneInit; + + guint mBusWatchID; + + float mVolume; + + int mDepth; + + // padded texture size we need to write into + int mTextureWidth; + int mTextureHeight; + + bool mSeekWanted; + double mSeekDestination; + + // Very GStreamer-specific + GMainLoop *mPump; // event pump for this media + GstElement *mPlaybin; + GstAppSink *mAppSink; +}; + +//static +bool MediaPluginGStreamer10::mDoneInit = false; + +MediaPluginGStreamer10::MediaPluginGStreamer10( LLPluginInstance::sendMessageFunction host_send_func, + void *host_user_data ) + : MediaPluginBase(host_send_func, host_user_data) + , mBusWatchID ( 0 ) + , mSeekWanted(false) + , mSeekDestination(0.0) + , mPump ( nullptr ) + , mPlaybin ( nullptr ) + , mAppSink ( nullptr ) + , mCommand ( COMMAND_NONE ) +{ +} + +gboolean MediaPluginGStreamer10::processGSTEvents(GstBus *bus, GstMessage *message) +{ + if (!message) + return TRUE; // shield against GStreamer bug + + switch (GST_MESSAGE_TYPE (message)) + { + case GST_MESSAGE_BUFFERING: + { + // NEEDS GST 0.10.11+ + if (llgst_message_parse_buffering) + { + gint percent = 0; + llgst_message_parse_buffering(message, &percent); + } + break; + } + case GST_MESSAGE_STATE_CHANGED: + { + GstState old_state; + GstState new_state; + GstState pending_state; + llgst_message_parse_state_changed(message, + &old_state, + &new_state, + &pending_state); + + switch (new_state) + { + case GST_STATE_VOID_PENDING: + break; + case GST_STATE_NULL: + break; + case GST_STATE_READY: + setStatus(STATUS_LOADED); + break; + case GST_STATE_PAUSED: + setStatus(STATUS_PAUSED); + break; + case GST_STATE_PLAYING: + setStatus(STATUS_PLAYING); + break; + } + break; + } + case GST_MESSAGE_ERROR: + { + GError *err = nullptr; + gchar *debug = nullptr; + + llgst_message_parse_error (message, &err, &debug); + if (err) + llg_error_free (err); + llg_free (debug); + + mCommand = COMMAND_STOP; + + setStatus(STATUS_ERROR); + + break; + } + case GST_MESSAGE_INFO: + { + if (llgst_message_parse_info) + { + GError *err = nullptr; + gchar *debug = nullptr; + + llgst_message_parse_info (message, &err, &debug); + if (err) + llg_error_free (err); + llg_free (debug); + } + break; + } + case GST_MESSAGE_WARNING: + { + GError *err = nullptr; + gchar *debug = nullptr; + + llgst_message_parse_warning (message, &err, &debug); + if (err) + llg_error_free (err); + llg_free (debug); + + break; + } + case GST_MESSAGE_EOS: + /* end-of-stream */ + if (mIsLooping) + { + double eos_pos_sec = 0.0F; + bool got_eos_position = getTimePos(eos_pos_sec); + + if (got_eos_position && eos_pos_sec < MIN_LOOP_SEC) + { + // if we know that the movie is really short, don't + // loop it else it can easily become a time-hog + // because of GStreamer spin-up overhead + // inject a COMMAND_PAUSE + mCommand = COMMAND_PAUSE; + } + else + { + stop(); + play(1.0); + } + } + else // not a looping media + { + // inject a COMMAND_STOP + mCommand = COMMAND_STOP; + } + break; + default: + /* unhandled message */ + break; + } + + /* we want to be notified again the next time there is a message + * on the bus, so return true (false means we want to stop watching + * for messages on the bus and our callback should not be called again) + */ + return TRUE; +} + +extern "C" { + gboolean llmediaimplgstreamer_bus_callback (GstBus *bus, + GstMessage *message, + gpointer data) + { + MediaPluginGStreamer10 *impl = (MediaPluginGStreamer10*)data; + return impl->processGSTEvents(bus, message); + } +} // extern "C" + + + +bool MediaPluginGStreamer10::navigateTo ( const std::string urlIn ) +{ + if (!mDoneInit) + return false; // error + + setStatus(STATUS_LOADING); + + mSeekWanted = false; + + if (nullptr == mPump || nullptr == mPlaybin) + { + setStatus(STATUS_ERROR); + return false; // error + } + + llg_object_set (G_OBJECT (mPlaybin), "uri", urlIn.c_str(), nullptr); + + // navigateTo implicitly plays, too. + play(1.0); + + return true; +} + + +class GstSampleUnref +{ + GstSample *mT; +public: + GstSampleUnref( GstSample *aT ) + : mT( aT ) + { llassert_always( mT ); } + + ~GstSampleUnref( ) + { llgst_sample_unref( mT ); } +}; + +bool MediaPluginGStreamer10::update(int milliseconds) +{ + if (!mDoneInit) + return false; // error + + // DEBUGMSG("updating media..."); + + // sanity check + if (nullptr == mPump || nullptr == mPlaybin) + { + return false; + } + + // see if there's an outstanding seek wanted + if (mSeekWanted && + // bleh, GST has to be happy that the movie is really truly playing + // or it may quietly ignore the seek (with rtsp:// at least). + (GST_STATE(mPlaybin) == GST_STATE_PLAYING)) + { + seek(mSeekDestination); + mSeekWanted = false; + } + + // *TODO: time-limit - but there isn't a lot we can do here, most + // time is spent in gstreamer's own opaque worker-threads. maybe + // we can do something sneaky like only unlock the video object + // for 'milliseconds' and otherwise hold the lock. + while (llg_main_context_pending(llg_main_loop_get_context(mPump))) + { + llg_main_context_iteration(llg_main_loop_get_context(mPump), FALSE); + } + + // check for availability of a new frame + + if( !mAppSink ) + return true; + + if( GST_STATE(mPlaybin) != GST_STATE_PLAYING) // Do not try to pull a sample if not in playing state + return true; + + GstSample *pSample = llgst_app_sink_pull_sample( mAppSink ); + if(!pSample) + return false; // Done playing + + GstSampleUnref oSampleUnref( pSample ); + GstCaps *pCaps = llgst_sample_get_caps ( pSample ); + if (!pCaps) + return false; + + gint width = 0, height = 0; + GstStructure *pStruct = llgst_caps_get_structure ( pCaps, 0); + + if(!llgst_structure_get_int ( pStruct, "width", &width) ) + width = 0; + if(!llgst_structure_get_int ( pStruct, "height", &height) ) + height = 0; + + if( !mPixels || width == 0 || height == 0) + return true; + + GstBuffer *pBuffer = llgst_sample_get_buffer ( pSample ); + GstMapInfo map; + llgst_buffer_map ( pBuffer, &map, GST_MAP_READ); + + // Our render buffer is always 1kx1k + + U32 rowSkip = INTERNAL_TEXTURE_SIZE / mTextureHeight; + U32 colSkip = INTERNAL_TEXTURE_SIZE / mTextureWidth; + + for (int row = 0; row < mTextureHeight; ++row) + { + U8 const *pTexelIn = map.data + (row*rowSkip * width *3); +#ifndef FLIP_Y + U8 *pTexelOut = mPixels + (row * mTextureWidth * mDepth ); +#else + U8 *pTexelOut = mPixels + ((mTextureHeight-row-1) * mTextureWidth * mDepth ); +#endif + for( int col = 0; col < mTextureWidth; ++col ) + { + pTexelOut[ 0 ] = pTexelIn[0]; + pTexelOut[ 1 ] = pTexelIn[1]; + pTexelOut[ 2 ] = pTexelIn[2]; + pTexelOut += mDepth; + pTexelIn += colSkip*3; + } + } + + llgst_buffer_unmap( pBuffer, &map ); + setDirty(0,0,mTextureWidth,mTextureHeight); + + return true; +} + +void MediaPluginGStreamer10::mouseDown( int x, int y ) +{ + // do nothing +} + +void MediaPluginGStreamer10::mouseUp( int x, int y ) +{ + // do nothing +} + +void MediaPluginGStreamer10::mouseMove( int x, int y ) +{ + // do nothing +} + + +bool MediaPluginGStreamer10::pause() +{ + // todo: error-check this? + if (mDoneInit && mPlaybin) + { + llgst_element_set_state(mPlaybin, GST_STATE_PAUSED); + return true; + } + return false; +} + +bool MediaPluginGStreamer10::stop() +{ + // todo: error-check this? + if (mDoneInit && mPlaybin) + { + llgst_element_set_state(mPlaybin, GST_STATE_READY); + return true; + } + return false; +} + +bool MediaPluginGStreamer10::play(double rate) +{ + // NOTE: we don't actually support non-natural rate. + + // todo: error-check this? + if (mDoneInit && mPlaybin) + { + llgst_element_set_state(mPlaybin, GST_STATE_PLAYING); + return true; + } + return false; +} + +bool MediaPluginGStreamer10::setVolume( float volume ) +{ + // we try to only update volume as conservatively as + // possible, as many gst-plugins-base versions up to at least + // November 2008 have critical race-conditions in setting volume - sigh + if (mVolume == volume) + return true; // nothing to do, everything's fine + + mVolume = volume; + if (mDoneInit && mPlaybin) + { + llg_object_set(mPlaybin, "volume", mVolume, nullptr); + return true; + } + + return false; +} + +bool MediaPluginGStreamer10::seek(double time_sec) +{ + bool success = false; + if (mDoneInit && mPlaybin) + { + success = llgst_element_seek(mPlaybin, 1.0F, GST_FORMAT_TIME, + GstSeekFlags(GST_SEEK_FLAG_FLUSH | + GST_SEEK_FLAG_KEY_UNIT), + GST_SEEK_TYPE_SET, gint64(time_sec*GST_SECOND), + GST_SEEK_TYPE_NONE, GST_CLOCK_TIME_NONE); + } + return success; +} + +bool MediaPluginGStreamer10::getTimePos(double &sec_out) +{ + bool got_position = false; + if (mDoneInit && mPlaybin) + { + gint64 pos(0); + GstFormat timefmt = GST_FORMAT_TIME; + got_position = + llgst_element_query_position && + llgst_element_query_position(mPlaybin, + timefmt, + &pos); + got_position = got_position + && (timefmt == GST_FORMAT_TIME); + // GStreamer may have other ideas, but we consider the current position + // undefined if not PLAYING or PAUSED + got_position = got_position && + (GST_STATE(mPlaybin) == GST_STATE_PLAYING || + GST_STATE(mPlaybin) == GST_STATE_PAUSED); + if (got_position && !GST_CLOCK_TIME_IS_VALID(pos)) + { + if (GST_STATE(mPlaybin) == GST_STATE_PLAYING) + { + // if we're playing then we treat an invalid clock time + // as 0, for complicated reasons (insert reason here) + pos = 0; + } + else + { + got_position = false; + } + + } + // If all the preconditions succeeded... we can trust the result. + if (got_position) + { + sec_out = double(pos) / double(GST_SECOND); // gst to sec + } + } + return got_position; +} + +bool MediaPluginGStreamer10::load() +{ + if (!mDoneInit) + return false; // error + + setStatus(STATUS_LOADING); + + mIsLooping = false; + mVolume = 0.1234567f; // minor hack to force an initial volume update + + // Create a pumpable main-loop for this media + mPump = llg_main_loop_new (nullptr, FALSE); + if (!mPump) + { + setStatus(STATUS_ERROR); + return false; // error + } + + // instantiate a playbin element to do the hard work + mPlaybin = llgst_element_factory_make ("playbin", ""); + if (!mPlaybin) + { + setStatus(STATUS_ERROR); + return false; // error + } + + // get playbin's bus + GstBus *bus = llgst_pipeline_get_bus (GST_PIPELINE (mPlaybin)); + if (!bus) + { + setStatus(STATUS_ERROR); + return false; // error + } + mBusWatchID = llgst_bus_add_watch (bus, + llmediaimplgstreamer_bus_callback, + this); + llgst_object_unref (bus); + + mAppSink = (GstAppSink*)(llgst_element_factory_make ("appsink", "")); + + GstCaps* pCaps = llgst_caps_new_simple( "video/x-raw", + "format", G_TYPE_STRING, "RGB", + "width", G_TYPE_INT, INTERNAL_TEXTURE_SIZE, + "height", G_TYPE_INT, INTERNAL_TEXTURE_SIZE, + nullptr ); + + llgst_app_sink_set_caps( mAppSink, pCaps ); + llgst_caps_unref( pCaps ); + + if (!mAppSink) + { + setStatus(STATUS_ERROR); + return false; + } + + llg_object_set(mPlaybin, "video-sink", mAppSink, nullptr); + + return true; +} + +bool MediaPluginGStreamer10::unload () +{ + if (!mDoneInit) + return false; // error + + // stop getting callbacks for this bus + llg_source_remove(mBusWatchID); + mBusWatchID = 0; + + if (mPlaybin) + { + llgst_element_set_state (mPlaybin, GST_STATE_NULL); + llgst_object_unref (GST_OBJECT (mPlaybin)); + mPlaybin = nullptr; + } + + if (mPump) + { + llg_main_loop_quit(mPump); + mPump = nullptr; + } + + mAppSink = nullptr; + + setStatus(STATUS_NONE); + + return true; +} + +void LogFunction(GstDebugCategory *category, GstDebugLevel level, const gchar *file, const gchar *function, gint line, GObject *object, GstDebugMessage *message, gpointer user_data ) +{ + std::cerr << file << ":" << line << "(" << function << "): " << llgst_debug_message_get( message ) << std::endl; +} + +//static +bool MediaPluginGStreamer10::startup() +{ + // first - check if GStreamer is explicitly disabled + if (nullptr != getenv("LL_DISABLE_GSTREAMER")) + return false; + + // only do global GStreamer initialization once. + if (!mDoneInit) + { + ll_init_apr(); + + // Get symbols! + std::vector< std::string > vctDSONames; + vctDSONames.push_back( "libgstreamer-1.0.so.0" ); + vctDSONames.push_back( "libgstapp-1.0.so.0" ); + vctDSONames.push_back( "libglib-2.0.so.0" ); + vctDSONames.push_back( "libgobject-2.0.so" ); + if( !gstSymbolGrabber.grabSymbols( vctDSONames ) ) + return false; + + if (llgst_segtrap_set_enabled) + { + llgst_segtrap_set_enabled(FALSE); + } + + // Gstreamer tries a fork during init, waitpid-ing on it, + // which conflicts with any installed SIGCHLD handler... + struct sigaction tmpact, oldact; + if (llgst_registry_fork_set_enabled ) { + // if we can disable SIGCHLD-using forking behaviour, + // do it. + llgst_registry_fork_set_enabled(false); + } + else { + // else temporarily install default SIGCHLD handler + // while GStreamer initialises + tmpact.sa_handler = SIG_DFL; + sigemptyset( &tmpact.sa_mask ); + tmpact.sa_flags = SA_SIGINFO; + sigaction(SIGCHLD, &tmpact, &oldact); + } + // Protect against GStreamer resetting the locale, yuck. + static std::string saved_locale; + saved_locale = setlocale(LC_ALL, nullptr); + + llgst_debug_set_default_threshold( GST_LEVEL_WARNING ); + llgst_debug_add_log_function( LogFunction, nullptr, nullptr ); + llgst_debug_set_active( false ); + + // finally, try to initialize GStreamer! + GError *err = nullptr; + gboolean init_gst_success = llgst_init_check(nullptr, nullptr, &err); + + // restore old locale + setlocale(LC_ALL, saved_locale.c_str() ); + + // restore old SIGCHLD handler + if (!llgst_registry_fork_set_enabled) + sigaction(SIGCHLD, &oldact, nullptr); + + if (!init_gst_success) // fail + { + if (err) + llg_error_free(err); + return false; + } + + mDoneInit = true; + } + + return true; +} + +//static +bool MediaPluginGStreamer10::closedown() +{ + if (!mDoneInit) + return false; // error + + gstSymbolGrabber.ungrabSymbols(); + mDoneInit = false; + + return true; +} + +MediaPluginGStreamer10::~MediaPluginGStreamer10() +{ + closedown(); +} + +std::string MediaPluginGStreamer10::getVersion() +{ + std::string plugin_version = "GStreamer10 media plugin, GStreamer version "; + if (mDoneInit && + llgst_version) + { + guint major, minor, micro, nano; + llgst_version(&major, &minor, µ, &nano); + plugin_version += llformat("%u.%u.%u.%u (runtime), %u.%u.%u.%u (headers)", (unsigned int)major, (unsigned int)minor, + (unsigned int)micro, (unsigned int)nano, (unsigned int)GST_VERSION_MAJOR, (unsigned int)GST_VERSION_MINOR, + (unsigned int)GST_VERSION_MICRO, (unsigned int)GST_VERSION_NANO); + } + else + { + plugin_version += "(unknown)"; + } + return plugin_version; +} + +void MediaPluginGStreamer10::receiveMessage(const char *message_string) +{ + 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; + versions[LLPLUGIN_MESSAGE_CLASS_MEDIA_TIME] = LLPLUGIN_MESSAGE_CLASS_MEDIA_TIME_VERSION; + message.setValueLLSD("versions", versions); + + load(); + + message.setValue("plugin_version", getVersion()); + sendMessage(message); + } + else if(message_name == "idle") + { + // no response is necessary here. + double time = message_in.getValueReal("time"); + + // Convert time to milliseconds for update() + update((int)(time * 1000.0f)); + } + else if(message_name == "cleanup") + { + unload(); + closedown(); + } + 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"); + + mSharedSegments.insert(SharedSegmentMap::value_type(name, info)); + } + else if(message_name == "shm_remove") + { + std::string name = message_in.getValue("name"); + + 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 = nullptr; + mTextureSegmentName.clear(); + } + mSharedSegments.erase(iter); + } + + // Send the response so it can be cleaned up. + LLPluginMessage message("base", "shm_remove_response"); + message.setValue("name", name); + sendMessage(message); + } + } + else if(message_class == LLPLUGIN_MESSAGE_CLASS_MEDIA) + { + if(message_name == "init") + { + // Plugin gets to decide the texture parameters to use. + LLPluginMessage message(LLPLUGIN_MESSAGE_CLASS_MEDIA, "texture_params"); + // lame to have to decide this now, it depends on the movie. Oh well. + mDepth = 4; + + mTextureWidth = 1; + mTextureHeight = 1; + + message.setValueU32("format", GL_RGBA); + message.setValueU32("type", GL_UNSIGNED_INT_8_8_8_8_REV); + + message.setValueS32("depth", mDepth); + message.setValueS32("default_width", INTERNAL_TEXTURE_SIZE ); + message.setValueS32("default_height", INTERNAL_TEXTURE_SIZE ); + message.setValueU32("internalformat", GL_RGBA8); + message.setValueBoolean("coords_opengl", true); // true == use OpenGL-style coordinates, false == (0,0) is upper left. + message.setValueBoolean("allow_downsample", true); // we respond with grace and performance if asked to downscale + 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"); + + 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()) + { + mPixels = (unsigned char*)iter->second.mAddress; + mTextureSegmentName = name; + + mTextureWidth = texture_width; + mTextureHeight = texture_height; + memset( mPixels, 0, mTextureWidth*mTextureHeight*mDepth ); + } + + LLPluginMessage message(LLPLUGIN_MESSAGE_CLASS_MEDIA, "size_change_request"); + message.setValue("name", mTextureSegmentName); + message.setValueS32("width", INTERNAL_TEXTURE_SIZE ); + message.setValueS32("height", INTERNAL_TEXTURE_SIZE ); + sendMessage(message); + + } + } + else if(message_name == "load_uri") + { + std::string uri = message_in.getValue("uri"); + navigateTo( 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") + { + double rate = 0.0; + if(message_in.hasValue("rate")) + { + rate = message_in.getValueReal("rate"); + } + // NOTE: we don't actually support rate. + play(rate); + } + else if(message_name == "pause") + { + pause(); + } + else if(message_name == "seek") + { + double time = message_in.getValueReal("time"); + // defer the actual seek in case we haven't + // really truly started yet in which case there + // is nothing to seek upon + mSeekWanted = true; + mSeekDestination = time; + } + else if(message_name == "set_loop") + { + bool loop = message_in.getValueBoolean("loop"); + mIsLooping = loop; + } + else if(message_name == "set_volume") + { + double volume = message_in.getValueReal("volume"); + setVolume(volume); + } + } + } +} + +int init_media_plugin(LLPluginInstance::sendMessageFunction host_send_func, void *host_user_data, LLPluginInstance::sendMessageFunction *plugin_send_func, void **plugin_user_data) +{ + if( MediaPluginGStreamer10::startup() ) + { + MediaPluginGStreamer10 *self = new MediaPluginGStreamer10(host_send_func, host_user_data); + *plugin_send_func = MediaPluginGStreamer10::staticReceiveMessage; + *plugin_user_data = (void*)self; + + return 0; // okay + } + else + { + return -1; // failed to init + } +} diff --git a/indra/media_plugins/libvlc/media_plugin_libvlc.cpp b/indra/media_plugins/libvlc/media_plugin_libvlc.cpp index ad0ecaf4abf..2356236d167 100644 --- a/indra/media_plugins/libvlc/media_plugin_libvlc.cpp +++ b/indra/media_plugins/libvlc/media_plugin_libvlc.cpp @@ -560,7 +560,7 @@ void MediaPluginLibVLC::receiveMessage(const char* message_string) message.setValueS32("default_height", 1024); message.setValueS32("depth", mDepth); message.setValueU32("internalformat", GL_RGB); - message.setValueU32("format", GL_BGRA_EXT); + message.setValueU32("format", GL_BGRA); message.setValueU32("type", GL_UNSIGNED_BYTE); message.setValueBoolean("coords_opengl", true); sendMessage(message); diff --git a/indra/newview/CMakeLists.txt b/indra/newview/CMakeLists.txt index 8869f4b1f60..4172b4ade34 100644 --- a/indra/newview/CMakeLists.txt +++ b/indra/newview/CMakeLists.txt @@ -13,7 +13,6 @@ include(BuildPackagesInfo) include(BuildVersion) include(CMakeCopyIfDifferent) include(CubemapToEquirectangularJS) -include(DBusGlib) include(DragDrop) if (USE_DISCORD) include(Discord) @@ -46,7 +45,6 @@ include(UI) include(ViewerMiscLibs) include(ViewerManager) include(VisualLeakDetector) -include(VulkanGltf) include(ZLIBNG) include(LLPrimitive) @@ -78,6 +76,8 @@ if (HAVOK) endif() endif () +configure_file(llversioninfovars.h.in llversioninfovars.h @ONLY) + set(viewer_SOURCE_FILES gltfscenemanager.cpp gltf/asset.cpp @@ -219,6 +219,7 @@ set(viewer_SOURCE_FILES llfloatercreatelandmark.cpp llfloaterdeleteprefpreset.cpp llfloaterdestinations.cpp + llfloaterdirectory.cpp llfloaterdisplayname.cpp llfloatereditenvironmentbase.cpp llfloatereditextdaycycle.cpp @@ -279,7 +280,6 @@ set(viewer_SOURCE_FILES llfloaterpay.cpp llfloaterperformance.cpp llfloaterperms.cpp - llfloaterpostprocess.cpp llfloaterprofile.cpp llfloaterpreference.cpp llfloaterpreferencesgraphicsadvanced.cpp @@ -296,6 +296,7 @@ set(viewer_SOURCE_FILES llfloatersceneloadstats.cpp llfloaterscriptdebug.cpp llfloaterscriptedprefs.cpp + llfloaterscripting.cpp llfloaterscriptlimits.cpp llfloatersearch.cpp llfloatersellland.cpp @@ -441,11 +442,20 @@ set(viewer_SOURCE_FILES llpanelblockedlist.cpp llpanelclassified.cpp llpanelcontents.cpp + llpaneldirbrowser.cpp + llpaneldirclassified.cpp + llpaneldirevents.cpp + llpaneldirgroups.cpp + llpaneldirland.cpp + llpaneldirpeople.cpp + llpaneldirplaces.cpp + llpaneldirweb.cpp llpaneleditsky.cpp llpaneleditwater.cpp llpaneleditwearable.cpp llpanelemojicomplete.cpp llpanelenvironment.cpp + llpaneleventinfo.cpp llpanelexperiencelisteditor.cpp llpanelexperiencelog.cpp llpanelexperiencepicker.cpp @@ -525,6 +535,7 @@ set(viewer_SOURCE_FILES llpathfindingobjectlist.cpp llpathfindingpathtool.cpp llpbrterrainfeatures.cpp + llperfstats.cpp llpersistentnotificationstorage.cpp llphysicsmotion.cpp llphysicsshapebuilderutil.cpp @@ -556,6 +567,7 @@ set(viewer_SOURCE_FILES llsceneview.cpp llscreenchannel.cpp llscripteditor.cpp + llscripteditorws.cpp llscriptfloater.cpp llscrollingpanelparam.cpp llscrollingpanelparambase.cpp @@ -717,7 +729,6 @@ set(viewer_SOURCE_FILES llvoiceclient.cpp llvoicevisualizer.cpp llvoicevivox.cpp - llvoicewebrtc.cpp llvoinventorylistener.cpp llvopartgroup.cpp llvosky.cpp @@ -894,6 +905,7 @@ set(viewer_HEADER_FILES llfloatercreatelandmark.h llfloaterdeleteprefpreset.h llfloaterdestinations.h + llfloaterdirectory.h llfloaterdisplayname.h llfloatereditenvironmentbase.h llfloatereditextdaycycle.h @@ -958,7 +970,6 @@ set(viewer_HEADER_FILES llfloaterpay.h llfloaterperformance.h llfloaterperms.h - llfloaterpostprocess.h llfloaterprofile.h llfloaterpreference.h llfloaterpreferencesgraphicsadvanced.h @@ -975,6 +986,7 @@ set(viewer_HEADER_FILES llfloatersceneloadstats.h llfloaterscriptdebug.h llfloaterscriptedprefs.h + llfloaterscripting.h llfloaterscriptlimits.h llfloatersearch.h llfloatersellland.h @@ -1108,11 +1120,20 @@ set(viewer_HEADER_FILES llpanelblockedlist.h llpanelclassified.h llpanelcontents.h + llpaneldirbrowser.h + llpaneldirclassified.h + llpaneldirevents.h + llpaneldirgroups.h + llpaneldirland.h + llpaneldirpeople.h + llpaneldirplaces.h + llpaneldirweb.h llpaneleditsky.h llpaneleditwater.h llpaneleditwearable.h llpanelemojicomplete.h llpanelenvironment.h + llpaneleventinfo.h llpanelexperiencelisteditor.h llpanelexperiencelog.h llpanelexperiencepicker.h @@ -1187,6 +1208,7 @@ set(viewer_HEADER_FILES llpathfindingobject.h llpathfindingobjectlist.h llpathfindingpathtool.h + llperfstats.h llpbrterrainfeatures.h llpersistentnotificationstorage.h llphysicsmotion.h @@ -1221,6 +1243,7 @@ set(viewer_HEADER_FILES llsceneview.h llscreenchannel.h llscripteditor.h + llscripteditorws.h llscriptfloater.h llscriptruntimeperms.h llscrollingpanelparam.h @@ -1385,7 +1408,6 @@ set(viewer_HEADER_FILES llvoiceclient.h llvoicevisualizer.h llvoicevivox.h - llvoicewebrtc.h llvoinventorylistener.h llvopartgroup.h llvosky.h @@ -1416,9 +1438,6 @@ set(viewer_HEADER_FILES VorbisFramework.h ) - list(APPEND viewer_SOURCE_FILES llperfstats.cpp) - list(APPEND viewer_HEADER_FILES llperfstats.h) - source_group("CMake Rules" FILES ViewerInstall.cmake) #build_data.json creation moved to viewer_manifest.py MAINT-6413 @@ -1426,11 +1445,10 @@ source_group("CMake Rules" FILES ViewerInstall.cmake) file(WRITE "${CMAKE_CURRENT_BINARY_DIR}/viewer_version.txt" "${VIEWER_SHORT_VERSION}.${VIEWER_VERSION_REVISION}\n") -set_source_files_properties( - llversioninfo.cpp tests/llversioninfo_test.cpp - PROPERTIES - COMPILE_DEFINITIONS "${VIEWER_CHANNEL_VERSION_DEFINES}" # see BuildVersion.cmake - ) +if (NOT DISABLE_WEBRTC) + LIST(APPEND viewer_SOURCE_FILES llvoicewebrtc.cpp) + LIST(APPEND viewer_HEADER_FILES llvoicewebrtc.h) +endif() if (DARWIN) LIST(APPEND viewer_SOURCE_FILES llappviewermacosx.cpp) @@ -1457,7 +1475,6 @@ if (DARWIN) llappdelegate-objc.mm PROPERTIES SKIP_PRECOMPILE_HEADERS TRUE - COMPILE_DEFINITIONS "${VIEWER_CHANNEL_VERSION_DEFINES}" # BugsplatMac is a module, imported with @import. That language feature # demands these -f switches. # Xcode 10.2 requires that Objective-C++ headers declare nullability of @@ -1486,14 +1503,6 @@ endif (DARWIN) if (LINUX) LIST(APPEND viewer_SOURCE_FILES llappviewerlinux.cpp) - set_source_files_properties( - llappviewerlinux.cpp - PROPERTIES - COMPILE_DEFINITIONS "${VIEWER_CHANNEL_VERSION_DEFINES}" - ) - LIST(APPEND viewer_SOURCE_FILES llappviewerlinux_api_dbus.cpp) - SET(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} -Wl,--as-needed") - endif (LINUX) if (WINDOWS) @@ -1502,11 +1511,6 @@ if (WINDOWS) llappviewerwin32.cpp llwindebug.cpp ) - set_source_files_properties( - llappviewerwin32.cpp - PROPERTIES - COMPILE_DEFINITIONS "${VIEWER_CHANNEL_VERSION_DEFINES}" - ) list(APPEND viewer_HEADER_FILES llappviewerwin32.h @@ -1654,7 +1658,8 @@ set_source_files_properties(${viewer_SHADER_FILES} PROPERTIES HEADER_FILE_ONLY TRUE) list(APPEND viewer_SOURCE_FILES ${viewer_SHADER_FILES}) - +# note that the scripts which publish these files are sensitive to the file +# extensions. Be cautious about adding new file types here. set(viewer_APPSETTINGS_FILES app_settings/anim.ini app_settings/autoreplace.xml @@ -1666,6 +1671,7 @@ set(viewer_APPSETTINGS_FILES app_settings/ignorable_dialogs.xml app_settings/key_bindings.xml app_settings/keywords_lsl_default.xml + app_settings/keywords_lua_default.xml app_settings/logcontrol.xml app_settings/settings.xml app_settings/settings_crash_behavior.xml @@ -1674,12 +1680,14 @@ set(viewer_APPSETTINGS_FILES app_settings/std_bump.ini app_settings/toolbars.xml app_settings/trees.xml + app_settings/types_lua_default.xml app_settings/viewerart.xml app_settings/message.xml ${CMAKE_SOURCE_DIR}/../scripts/messages/message_template.msg packages-info.txt featuretable.txt featuretable_mac.txt + featuretable_linux.txt ) source_group("App Settings" FILES ${viewer_APPSETTINGS_FILES}) @@ -1703,6 +1711,15 @@ set_source_files_properties(${viewer_CHARACTER_FILES} PROPERTIES HEADER_FILE_ONLY TRUE) list(APPEND viewer_SOURCE_FILES ${viewer_CHARACTER_FILES}) +set(viewer_MISC_FILES + viewer_manifest.py + ) + +set_source_files_properties(${viewer_MISC_FILES} + PROPERTIES HEADER_FILE_ONLY TRUE) + +list(APPEND viewer_SOURCE_FILES ${viewer_MISC_FILES}) + if (WINDOWS) file(GLOB viewer_INSTALLER_FILES installers/windows/*.nsi) @@ -1714,13 +1731,6 @@ if (WINDOWS) list(APPEND viewer_SOURCE_FILES ${viewer_INSTALLER_FILES}) endif (WINDOWS) -if( DEFINED LLSTARTUP_COMPILE_FLAGS ) - # progress view disables/enables icons based on available packages - set_source_files_properties(llprogressview.cpp PROPERTIES COMPILE_FLAGS "${LLSTARTUP_COMPILE_FLAGS}") - - set_source_files_properties(llstartup.cpp PROPERTIES COMPILE_FLAGS "${LLSTARTUP_COMPILE_FLAGS}") -endif() - list(APPEND viewer_SOURCE_FILES ${viewer_HEADER_FILES}) add_executable(${VIEWER_BINARY_NAME} @@ -1729,6 +1739,8 @@ add_executable(${VIEWER_BINARY_NAME} ${viewer_SOURCE_FILES} ) +target_include_directories(${VIEWER_BINARY_NAME} PUBLIC ${CMAKE_CURRENT_BINARY_DIR}) + # add package files file(GLOB EVENT_HOST_SCRIPT_GLOB_LIST ${CMAKE_CURRENT_SOURCE_DIR}/../viewer_components/*.py) @@ -1963,6 +1975,7 @@ elseif (DARWIN) XCODE_ATTRIBUTE_OTHER_LDFLAGS[arch=x86_64] "$(inherited) -L${CMAKE_CURRENT_BINARY_DIR}/llphysicsextensions/$,$,${CMAKE_CFG_INTDIR}>/ -lllphysicsextensions -Xlinker -map -Xlinker ${CMAKE_CURRENT_BINARY_DIR}/${VIEWER_BINARY_NAME}.MAP" XCODE_ATTRIBUTE_OTHER_LDFLAGS[arch=arm64] "$(inherited) -L${CMAKE_BINARY_DIR}/llphysicsextensionsos/$,$,${CMAKE_CFG_INTDIR}>/ -lllphysicsextensionsos" ) + add_dependencies(${VIEWER_BINARY_NAME} llphysicsextensionsos) elseif(HAVOK_TPV) set_target_properties(${VIEWER_BINARY_NAME} PROPERTIES @@ -1973,15 +1986,18 @@ elseif (DARWIN) XCODE_ATTRIBUTE_OTHER_LDFLAGS[arch=x86_64] "$(inherited) -L${ARCH_PREBUILT_DIRS}/ -lllphysicsextensions_tpv" XCODE_ATTRIBUTE_OTHER_LDFLAGS[arch=arm64] "$(inherited) -L${CMAKE_BINARY_DIR}/llphysicsextensionsos/$,$,${CMAKE_CFG_INTDIR}>/ -lllphysicsextensionsos" ) + add_dependencies(${VIEWER_BINARY_NAME} llphysicsextensionsos) else() target_link_libraries(${VIEWER_BINARY_NAME} llphysicsextensionsos) endif() else (WINDOWS) - # Linux - set_target_properties(${VIEWER_BINARY_NAME} - PROPERTIES - LINK_FLAGS_RELEASE "${LINK_FLAGS_RELEASE} -Wl,--Map=${VIEWER_BINARY_NAME}.MAP" - ) + if (HAVOK OR HAVOK_TPV) + # Linux + set_target_properties(${VIEWER_BINARY_NAME} + PROPERTIES + LINK_FLAGS_RELEASE "${LINK_FLAGS_RELEASE} -no-pie -Wl,--Map=${VIEWER_BINARY_NAME}.MAP" + ) + endif () endif (WINDOWS) # *NOTE: - this list is very sensitive to ordering, test carefully on all @@ -2029,7 +2045,6 @@ target_link_libraries(${VIEWER_BINARY_NAME} llcorehttp llcommon llmeshoptimizer - llwebrtc lllogin llprimitive llappearance @@ -2040,16 +2055,20 @@ target_link_libraries(${VIEWER_BINARY_NAME} ll::openxr ) +if (NOT DISABLE_WEBRTC) + target_link_libraries(${VIEWER_BINARY_NAME} llwebrtc ) +endif() + if (USE_DISCORD) - target_link_libraries(${VIEWER_BINARY_NAME} ll::discord_sdk ) + target_link_libraries(${VIEWER_BINARY_NAME} ll::discord_sdk ) endif () if( TARGET ll::intel_memops ) - target_link_libraries(${VIEWER_BINARY_NAME} ll::intel_memops ) + target_link_libraries(${VIEWER_BINARY_NAME} ll::intel_memops ) endif() if( TARGET ll::nvapi ) - target_link_libraries(${VIEWER_BINARY_NAME} ll::nvapi ) + target_link_libraries(${VIEWER_BINARY_NAME} ll::nvapi ) endif() if ( TARGET llconvexdecomposition ) @@ -2088,14 +2107,13 @@ if (LINUX) set(COPY_INPUT_DEPENDENCIES ${VIEWER_BINARY_NAME} SLPlugin - #media_plugin_gstreamer010 - llcommon + media_plugin_cef + media_plugin_gstreamer10 + media_plugin_libvlc + media_plugin_example + llwebrtc ) - #if (NOT USE_BUGSPLAT) - # LIST(APPEND COPY_INPUT_DEPENDENCIES linux-crash-logger) - #endif (NOT USE_BUGSPLAT) - add_custom_command( OUTPUT ${product}.tar.xz COMMAND ${PYTHON_EXECUTABLE} diff --git a/indra/newview/app_settings/keywords_lsl_default.xml b/indra/newview/app_settings/keywords_lsl_default.xml index f99b86bd399..db9bc9924ff 100644 --- a/indra/newview/app_settings/keywords_lsl_default.xml +++ b/indra/newview/app_settings/keywords_lsl_default.xml @@ -1,4 +1,3 @@ - controls @@ -31,7 +30,7 @@ return tooltip - Leave current event or function.\nreturn [<variable>];\nOptionally pass back a variable's value, from a function. + Leave current event or function.\nreturn [<variable>];\nOptionally pass back a variable's value, from a function. state @@ -59,12 +58,12 @@ key tooltip - A 128 bit unique identifier (UUID).\nThe key is represented as hexidecimal characters (A-F and 0-9), grouped into sections (8,4,4,4,12 characters) and separated by hyphens (for a total of 36 characters). e.g. "A822FF2B-FF02-461D-B45D-DCD10A2DE0C2". + A 128 bit unique identifier (UUID).\nThe key is represented as hexidecimal characters (A-F and 0-9), grouped into sections (8,4,4,4,12 characters) and separated by hyphens (for a total of 36 characters). e.g. "A822FF2B-FF02-461D-B45D-DCD10A2DE0C2". list tooltip - A collection of other data types.\nLists are signified by square brackets surrounding their elements; the elements inside are separated by commas. e.g. [0, 1, 2, 3, 4] or ["Yes", "No", "Perhaps"]. + A collection of other data types.\nLists are signified by square brackets surrounding their elements; the elements inside are separated by commas. e.g. [0, 1, 2, 3, 4] or ["Yes", "No", "Perhaps"]. quaternion @@ -74,7 +73,7 @@ rotation tooltip - The rotation type is one of several ways to represent an orientation in 3D.\nIt is a mathematical object called a quaternion. You can think of a quaternion as four numbers (x, y, z, w), three of which represent the direction an object is facing and a fourth that represents the object's banking left or right around that direction. + The rotation type is one of several ways to represent an orientation in 3D.\nIt is a mathematical object called a quaternion. You can think of a quaternion as four numbers (x, y, z, w), three of which represent the direction an object is facing and a fourth that represents the object's banking left or right around that direction. string @@ -91,14750 +90,19403 @@ ACTIVE + tooltip + Objects in world that are running a script or currently physically moving. type integer value 0x2 - tooltip - Objects in world that are running a script or currently physically moving. AGENT + tooltip + Objects in world that are agents. type integer value 0x1 - tooltip - Objects in world that are agents. AGENT_ALWAYS_RUN + tooltip + type integer value 0x1000 - tooltip - AGENT_ATTACHMENTS + tooltip + The agent has attachments. type integer value 0x2 + + AGENT_AUTOMATED + tooltip - The agent has attachments. + The agent has been identified as a scripted agent + type + integer + value + 0x4000 AGENT_AUTOPILOT + tooltip + type integer value 0x2000 - tooltip - AGENT_AWAY + tooltip + type integer value 0x40 - tooltip - AGENT_BUSY + tooltip + type integer value 0x800 - tooltip - AGENT_BY_LEGACY_NAME + tooltip + type integer value 0x1 - tooltip - AGENT_BY_USERNAME + tooltip + type integer value 0x10 - tooltip - AGENT_CROUCHING + tooltip + type integer value 0x400 + + AGENT_FLOATING_VIA_SCRIPTED_ATTACHMENT + tooltip - + The agent is floating via scripted attachment. + type + integer + value + 0x8000 AGENT_FLYING + tooltip + The agent is flying. type integer value 0x1 - tooltip - The agent is flying. AGENT_IN_AIR + tooltip + type integer value 0x100 - tooltip - AGENT_LIST_PARCEL + tooltip + Agents on the same parcel where the script is running. type integer value - 1 - tooltip - Agents on the same parcel where the script is running. + 1 AGENT_LIST_PARCEL_OWNER + tooltip + Agents on any parcel in the region where the parcel owner is the same as the owner of the parcel under the scripted object. type integer value - 2 - tooltip - Agents on any parcel in the region where the parcel owner is the same as the owner of the parcel under the scripted object. + 2 AGENT_LIST_REGION + tooltip + All agents in the region. type integer value - 4 - tooltip - All agents in the region. + 4 AGENT_MOUSELOOK + tooltip + type integer value 0x8 - tooltip - AGENT_ON_OBJECT + tooltip + type integer value 0x20 - tooltip - AGENT_SCRIPTED + tooltip + The agent has scripted attachments. type integer value 0x4 - tooltip - The agent has scripted attachments. AGENT_SITTING + tooltip + type integer value 0x10 - tooltip - AGENT_TYPING + tooltip + type integer value 0x200 - tooltip - AGENT_WALKING + tooltip + type integer value 0x80 - tooltip - ALL_SIDES + tooltip + type integer value - -1 - tooltip - + -1 ANIM_ON + tooltip + Texture animation is on. type integer value 0x1 + + ATTACH_ANY_HUD + tooltip - Texture animation is on. + Filtering for any HUD attachment. + type + integer + value + -1 ATTACH_AVATAR_CENTER + tooltip + Attach to the avatar's geometric centre. type integer value - 40 - tooltip - Attach to the avatar's geometric centre. + 40 ATTACH_BACK + tooltip + Attach to the avatar's back. type integer value - 9 - tooltip - Attach to the avatar's back. + 9 ATTACH_BELLY + tooltip + Attach to the avatar's belly. type integer value - 28 - tooltip - Attach to the avatar's belly. + 28 ATTACH_CHEST + tooltip + Attach to the avatar's chest. type integer value - 1 - tooltip - Attach to the avatar's chest. + 1 ATTACH_CHIN + tooltip + Attach to the avatar's chin. + type + integer + value + 12 + + ATTACH_FACE_JAW + + tooltip + Attach to the avatar's jaw. + type + integer + value + 47 + + ATTACH_FACE_LEAR + + tooltip + Attach to the avatar's left ear (extended). + type + integer + value + 48 + + ATTACH_FACE_LEYE + + tooltip + Attach to the avatar's left eye (extended). + type + integer + value + 50 + + ATTACH_FACE_REAR + + tooltip + Attach to the avatar's right ear (extended). + type + integer + value + 49 + + ATTACH_FACE_REYE + + tooltip + Attach to the avatar's right eye (extended). + type + integer + value + 51 + + ATTACH_FACE_TONGUE + + tooltip + Attach to the avatar's tongue. type integer value - 12 + 52 + + ATTACH_GROIN + tooltip - Attach to the avatar's chin. + Attach to the avatar's groin. + type + integer + value + 53 ATTACH_HEAD + tooltip + Attach to the avatar's head. + type + integer + value + 2 + + ATTACH_HIND_LFOOT + + tooltip + Attach to the avatar's left hind foot. type integer value - 2 + 54 + + ATTACH_HIND_RFOOT + tooltip - Attach to the avatar's head. + Attach to the avatar's right hind foot. + type + integer + value + 55 ATTACH_HUD_BOTTOM + tooltip + type integer value - 37 - tooltip - + 37 ATTACH_HUD_BOTTOM_LEFT + tooltip + type integer value - 36 - tooltip - + 36 ATTACH_HUD_BOTTOM_RIGHT + tooltip + type integer value - 38 - tooltip - + 38 ATTACH_HUD_CENTER_1 + tooltip + type integer value - 35 - tooltip - + 35 ATTACH_HUD_CENTER_2 + tooltip + type integer value - 31 - tooltip - + 31 ATTACH_HUD_TOP_CENTER + tooltip + type integer value - 33 - tooltip - + 33 ATTACH_HUD_TOP_LEFT + tooltip + type integer value - 34 - tooltip - + 34 ATTACH_HUD_TOP_RIGHT + tooltip + type integer value - 32 - tooltip - + 32 ATTACH_LEAR + tooltip + Attach to the avatar's left ear. type integer value - 13 - tooltip - Attach to the avatar's left ear. + 13 ATTACH_LEFT_PEC + tooltip + Attach to the avatar's left pectoral. type integer value - 29 - tooltip - Attach to the avatar's left pectoral. + 29 ATTACH_LEYE + tooltip + Attach to the avatar's left eye. type integer value - 15 - tooltip - Attach to the avatar's left eye. + 15 ATTACH_LFOOT + tooltip + Attach to the avatar's left foot. type integer value - 7 - tooltip - Attach to the avatar's left foot. + 7 ATTACH_LHAND + tooltip + Attach to the avatar's left hand. type integer value - 5 + 5 + + ATTACH_LHAND_RING1 + tooltip - Attach to the avatar's left hand. + Attach to the avatar's left ring finger. + type + integer + value + 41 ATTACH_LHIP + tooltip + Attach to the avatar's left hip. type integer value - 25 - tooltip - Attach to the avatar's left hip. + 25 ATTACH_LLARM + tooltip + Attach to the avatar's left lower arm. type integer value - 21 - tooltip - Attach to the avatar's left lower arm. + 21 ATTACH_LLLEG + tooltip + Attach to the avatar's lower left leg. type integer value - 27 - tooltip - Attach to the avatar's lower left leg. + 27 ATTACH_LPEC deprecated - true + 1 + tooltip + Attach to the avatar's right pectoral. (Deprecated, use ATTACH_RIGHT_PEC) type integer value - 30 - tooltip - Attach to the avatar's right pectoral. (Deprecated, use ATTACH_RIGHT_PEC) + 30 ATTACH_LSHOULDER + tooltip + Attach to the avatar's left shoulder. type integer value - 3 - tooltip - Attach to the avatar's left shoulder. + 3 ATTACH_LUARM + tooltip + Attach to the avatar's left upper arm. type integer value - 20 - tooltip - Attach to the avatar's left upper arm. + 20 ATTACH_LULEG + tooltip + Attach to the avatar's lower upper leg. type integer value - 26 + 26 + + ATTACH_LWING + tooltip - Attach to the avatar's lower upper leg. + Attach to the avatar's left wing. + type + integer + value + 45 ATTACH_MOUTH + tooltip + Attach to the avatar's mouth. type integer value - 11 - tooltip - Attach to the avatar's mouth. + 11 ATTACH_NECK + tooltip + Attach to the avatar's neck. type integer value - 39 - tooltip - Attach to the avatar's neck. + 39 ATTACH_NOSE + tooltip + Attach to the avatar's nose. type integer value - 17 - tooltip - Attach to the avatar's nose. + 17 ATTACH_PELVIS + tooltip + Attach to the avatar's pelvis. type integer value - 10 - tooltip - Attach to the avatar's pelvis. + 10 ATTACH_REAR + tooltip + Attach to the avatar's right ear. type integer value - 14 - tooltip - Attach to the avatar's right ear. + 14 ATTACH_REYE + tooltip + Attach to the avatar's right eye. type integer value - 16 - tooltip - Attach to the avatar's right eye. + 16 ATTACH_RFOOT + tooltip + Attach to the avatar's right foot. type integer value - 8 - tooltip - Attach to the avatar's right foot. + 8 ATTACH_RHAND + tooltip + Attach to the avatar's right hand. type integer value - 6 + 6 + + ATTACH_RHAND_RING1 + tooltip - Attach to the avatar's right hand. + Attach to the avatar's right ring finger. + type + integer + value + 42 ATTACH_RHIP + tooltip + Attach to the avatar's right hip. type integer value - 22 - tooltip - Attach to the avatar's right hip. + 22 ATTACH_RIGHT_PEC + tooltip + Attach to the avatar's right pectoral. type integer value - 30 - tooltip - Attach to the avatar's right pectoral. + 30 ATTACH_RLARM + tooltip + Attach to the avatar's right lower arm. type integer value - 19 - tooltip - Attach to the avatar's right lower arm. + 19 ATTACH_RLLEG + tooltip + Attach to the avatar's right lower leg. type integer value - 24 - tooltip - Attach to the avatar's right lower leg. + 24 ATTACH_RPEC deprecated - true + 1 + tooltip + Attach to the avatar's left pectoral. (deprecated, use ATTACH_LEFT_PEC) type integer value - 29 - tooltip - Attach to the avatar's left pectoral. (deprecated, use ATTACH_LEFT_PEC) + 29 ATTACH_RSHOULDER + tooltip + Attach to the avatar's right shoulder. type integer value - 4 - tooltip - Attach to the avatar's right shoulder. + 4 ATTACH_RUARM + tooltip + Attach to the avatar's right upper arm. type integer value - 18 - tooltip - Attach to the avatar's right upper arm. + 18 ATTACH_RULEG - type - integer - value - 23 tooltip - Attach to the avatar's right upper leg. - - ATTACH_LHAND_RING1 - + Attach to the avatar's right upper leg. type integer value - 41 - tooltip - Attach to the avatar's left ring finger. + 23 - ATTACH_RHAND_RING1 + ATTACH_RWING + tooltip + Attach to the avatar's right wing. type integer value - 42 - tooltip - Attach to the avatar's right ring finger. + 46 ATTACH_TAIL_BASE + tooltip + Attach to the avatar's tail base. type integer value - 43 - tooltip - Attach to the avatar's tail base. + 43 ATTACH_TAIL_TIP + tooltip + Attach to the avatar's tail tip. type integer value - 44 - tooltip - Attach to the avatar's tail tip. + 44 - ATTACH_LWING + AVOID_CHARACTERS + tooltip + type integer value - 45 - tooltip - Attach to the avatar's left wing. - - ATTACH_RWING - - type - integer - value - 46 - tooltip - Attach to the avatar's right wing. - - ATTACH_FACE_JAW - - type - integer - value - 47 - tooltip - Attach to the avatar's jaw. - - ATTACH_FACE_LEAR - - type - integer - value - 48 - tooltip - Attach to the avatar's left ear (extended). - - ATTACH_FACE_REAR - - type - integer - value - 49 - tooltip - Attach to the avatar's right ear (extended). - - ATTACH_FACE_LEYE - - type - integer - value - 50 - tooltip - Attach to the avatar's left eye (extended). - - ATTACH_FACE_REYE - - type - integer - value - 51 - tooltip - Attach to the avatar's right eye (extended). - - ATTACH_FACE_TONGUE - - type - integer - value - 52 - tooltip - Attach to the avatar's tongue. + 1 - ATTACH_GROIN + AVOID_DYNAMIC_OBSTACLES - type - integer - value - 53 tooltip - Attach to the avatar's groin. - - ATTACH_HIND_LFOOT - + type integer value - 54 - tooltip - Attach to the avatar's left hind foot. + 2 - ATTACH_HIND_RFOOT + AVOID_NONE - type - integer - value - 55 tooltip - Attach to the avatar's right hind foot. - - AVOID_CHARACTERS - + type integer value - 1 - tooltip - + 0 - AVOID_DYNAMIC_OBSTACLES + BEACON_MAP - type - integer - value - 2 tooltip - - - AVOID_NONE - + Cause llMapBeacon to optionally display and focus the world map on the avatar's viewer. type integer value - 0 - tooltip - + 1 CAMERA_ACTIVE + tooltip + type integer value - 12 - tooltip - + 12 CAMERA_BEHINDNESS_ANGLE + tooltip + type integer value - 8 - tooltip - + 8 CAMERA_BEHINDNESS_LAG + tooltip + type integer value - 9 - tooltip - + 9 CAMERA_DISTANCE + tooltip + type integer value - 7 - tooltip - + 7 CAMERA_FOCUS + tooltip + type integer value - 17 - tooltip - + 17 CAMERA_FOCUS_LAG + tooltip + type integer value - 6 - tooltip - + 6 CAMERA_FOCUS_LOCKED + tooltip + type integer value - 22 - tooltip - + 22 CAMERA_FOCUS_OFFSET + tooltip + type integer value - 1 - tooltip - + 1 CAMERA_FOCUS_THRESHOLD + tooltip + type integer value - 11 - tooltip - + 11 CAMERA_PITCH + tooltip + type integer value - 0 - tooltip - + 0 CAMERA_POSITION + tooltip + type integer value - 13 - tooltip - + 13 CAMERA_POSITION_LAG + tooltip + type integer value - 5 - tooltip - + 5 CAMERA_POSITION_LOCKED + tooltip + type integer value - 21 - tooltip - + 21 CAMERA_POSITION_THRESHOLD + tooltip + type integer value - 10 - tooltip - + 10 CHANGED_ALLOWED_DROP + tooltip + The object inventory has changed because an item was added through the llAllowInventoryDrop interface. type integer value 0x40 - tooltip - The object inventory has changed because an item was added through the llAllowInventoryDrop interface. CHANGED_COLOR + tooltip + The object color has changed. type integer value 0x2 - tooltip - The object color has changed. CHANGED_INVENTORY + tooltip + The object inventory has changed. type integer value 0x1 - tooltip - The object inventory has changed. CHANGED_LINK + tooltip + The object has linked or its links were broken. type integer value 0x20 - tooltip - The object has linked or its links were broken. CHANGED_MEDIA + tooltip + type integer value 0x800 - tooltip - CHANGED_OWNER + tooltip + type integer value 0x80 - tooltip - CHANGED_REGION + tooltip + type integer value 0x100 - tooltip - CHANGED_REGION_START + tooltip + type integer value 0x400 + + CHANGED_RENDER_MATERIAL + tooltip - + The render material has changed. + type + integer + value + 0x1000 CHANGED_SCALE + tooltip + The object scale (size) has changed. type integer value 0x8 - tooltip - The object scale (size) has changed. CHANGED_SHAPE + tooltip + The object base shape has changed, e.g., a box to a cylinder. type integer value 0x4 - tooltip - The object base shape has changed, e.g., a box to a cylinder. CHANGED_TELEPORT + tooltip + type integer value 0x200 - tooltip - CHANGED_TEXTURE + tooltip + The texture offset, scale rotation, or simply the object texture has changed. type integer value 0x10 - tooltip - The texture offset, scale rotation, or simply the object texture has changed. CHARACTER_ACCOUNT_FOR_SKIPPED_FRAMES + tooltip + If set to false, character will not attempt to catch up on lost time when pathfinding performance is low, potentially providing more reliable movement (albeit while potentially appearing to be more stuttery). Default is true to match pre-existing behavior. type integer value - 14 - tooltip - If set to false, character will not attempt to catch up on lost time when pathfinding performance is low, potentially providing more reliable movement (albeit while potentially appearing to be more stuttery). Default is true to match pre-existing behavior. + 14 CHARACTER_AVOIDANCE_MODE + tooltip + Allows you to specify that a character should not try to avoid other characters, should not try to avoid dynamic obstacles (relatively fast moving objects and avatars), or both. type integer value - 5 - tooltip - Allows you to specify that a character should not try to avoid other characters, should not try to avoid dynamic obstacles (relatively fast moving objects and avatars), or both. + 5 CHARACTER_CMD_JUMP + tooltip + Makes the character jump. Requires an additional parameter, the height to jump, between 0.1m and 2.0m. This must be provided as the first element of the llExecCharacterCmd option list. type integer value 0x01 - tooltip - Makes the character jump. Requires an additional parameter, the height to jump, between 0.1m and 2.0m. This must be provided as the first element of the llExecCharacterCmd option list. CHARACTER_CMD_SMOOTH_STOP + tooltip + type integer value - 2 - tooltip - + 2 CHARACTER_CMD_STOP + tooltip + Stops any current pathfinding operation. type integer value 0x00 - tooltip - Stops any current pathfinding operation. CHARACTER_DESIRED_SPEED + tooltip + Speed of pursuit in meters per second. type integer value - 1 - tooltip - Speed of pursuit in meters per second. + 1 CHARACTER_DESIRED_TURN_SPEED + tooltip + The character's maximum speed while turning about the Z axis. - Note that this is only loosely enforced. type integer value - 12 - tooltip - The character's maximum speed while turning about the Z axis. - Note that this is only loosely enforced. + 12 CHARACTER_LENGTH + tooltip + Set collision capsule length - cannot be less than two times the radius. type integer value - 3 - tooltip - Set collision capsule length - cannot be less than two times the radius. + 3 CHARACTER_MAX_ACCEL + tooltip + The character's maximum acceleration rate. type integer value - 8 - tooltip - The character's maximum acceleration rate. + 8 CHARACTER_MAX_DECEL + tooltip + The character's maximum deceleration rate. type integer value - 9 - tooltip - The character's maximum deceleration rate. + 9 CHARACTER_MAX_SPEED + tooltip + The character's maximum speed. type integer value - 13 - tooltip - The character's maximum speed. + 13 CHARACTER_MAX_TURN_RADIUS + tooltip + The character's turn radius when travelling at CHARACTER_MAX_TURN_SPEED. type integer value - 10 - tooltip - The character's turn radius when travelling at CHARACTER_MAX_TURN_SPEED. + 10 CHARACTER_ORIENTATION + tooltip + Valid options are: VERTICAL, HORIZONTAL. type integer value - 4 - tooltip - Valid options are: VERTICAL, HORIZONTAL. + 4 CHARACTER_RADIUS + tooltip + Set collision capsule radius. type integer value - 2 - tooltip - Set collision capsule radius. + 2 CHARACTER_STAY_WITHIN_PARCEL + tooltip + Determines whether a character can leave its starting parcel.\nTakes a boolean parameter. If TRUE, the character cannot voluntarilly leave the parcel, but can return to it. type integer value - 15 - tooltip - Determines whether a character can leave its starting parcel.\nTakes a boolean parameter. If TRUE, the character cannot voluntarilly leave the parcel, but can return to it. + 15 CHARACTER_TYPE + tooltip + Specifies which walk-ability coefficient will be used by this character. type integer value - 6 - tooltip - Specifies which walk-ability coefficient will be used by this character. + 6 CHARACTER_TYPE_A + tooltip + type integer value - 0 - tooltip - + 0 CHARACTER_TYPE_B + tooltip + type integer value - 1 - tooltip - + 1 CHARACTER_TYPE_C + tooltip + type integer value - 2 - tooltip - + 2 CHARACTER_TYPE_D + tooltip + type integer value - 3 - tooltip - + 3 CHARACTER_TYPE_NONE + tooltip + type integer value - 4 - tooltip - + 4 CLICK_ACTION_BUY + tooltip + When the prim is clicked, the buy dialog is opened. type integer value - 2 + 2 + + CLICK_ACTION_DISABLED + tooltip - When the prim is clicked, the buy dialog is opened. + No click action. No touches detected or passed. + type + integer + value + 8 - CLICK_ACTION_NONE + CLICK_ACTION_IGNORE + tooltip + No click action. Object is invisible to the mouse. type integer value - 0 + 9 + + CLICK_ACTION_NONE + tooltip Performs the default action: when the prim is clicked, touch events are triggered. + type + integer + value + 0 CLICK_ACTION_OPEN + tooltip + When the prim is clicked, the object inventory dialog is opened. type integer value - 4 - tooltip - When the prim is clicked, the object inventory dialog is opened. + 4 CLICK_ACTION_OPEN_MEDIA + tooltip + When the prim is touched, the web media dialog is opened. type integer value - 6 - tooltip - When the prim is touched, the web media dialog is opened. + 6 CLICK_ACTION_PAY + tooltip + When the prim is clicked, the pay dialog is opened. type integer value - 3 - tooltip - When the prim is clicked, the pay dialog is opened. + 3 CLICK_ACTION_PLAY + tooltip + When the prim is clicked, html-on-a-prim is enabled? type integer value - 5 - tooltip - When the prim is clicked, html-on-a-prim is enabled? + 5 CLICK_ACTION_SIT - type - integer - value - 1 tooltip When the prim is clicked, the avatar sits upon it. + type + integer + value + 1 CLICK_ACTION_TOUCH + tooltip + When the prim is clicked, touch events are triggered. type integer value - 0 + 0 + + CLICK_ACTION_ZOOM + tooltip - When the prim is clicked, touch events are triggered. + Zoom in on object when clicked. + type + integer + value + 7 - CONTENT_TYPE_ATOM + COMBAT_CHANNEL + tooltip + COMBAT_CHANNEL is an integer constant that, when passed to llRegionSay will add the message to the combat log. A script with a chat listen active on COMBAT_CHANNEL may also monitor the combat log. type integer value - 4 + 2147483646 + + COMBAT_LOG_ID + tooltip - "application/atom+xml" + + type + string + value + 45e0fcfa-2268-4490-a51c-3e51bdfe80d1 - CONTENT_TYPE_FORM + CONTENT_TYPE_ATOM + tooltip + "application/atom+xml" type integer value - 7 + 4 + + CONTENT_TYPE_FORM + tooltip - "application/x-www-form-urlencoded" + "application/x-www-form-urlencoded" + type + integer + value + 7 CONTENT_TYPE_HTML + tooltip + "text/html", only valid for embedded browsers on content owned by the person viewing. Falls back to "text/plain" otherwise. type integer value - 1 - tooltip - "text/html", only valid for embedded browsers on content owned by the person viewing. Falls back to "text/plain" otherwise. + 1 CONTENT_TYPE_JSON + tooltip + "application/json" type integer value - 5 - tooltip - "application/json" + 5 CONTENT_TYPE_LLSD + tooltip + "application/llsd+xml" type integer value - 6 - tooltip - "application/llsd+xml" + 6 CONTENT_TYPE_RSS + tooltip + "application/rss+xml" type integer value - 8 - tooltip - "application/rss+xml" + 8 CONTENT_TYPE_TEXT + tooltip + "text/plain" type integer value - 0 - tooltip - "text/plain" + 0 CONTENT_TYPE_XHTML + tooltip + "application/xhtml+xml" type integer value - 3 - tooltip - "application/xhtml+xml" + 3 CONTENT_TYPE_XML + tooltip + "application/xml" type integer value - 2 - tooltip - "application/xml" + 2 CONTROL_BACK + tooltip + Test for the avatar move back control. type integer value 0x2 - tooltip - Test for the avatar move back control. CONTROL_DOWN + tooltip + Test for the avatar move down control. type integer value 0x20 - tooltip - Test for the avatar move down control. CONTROL_FWD + tooltip + Test for the avatar move forward control. type integer value 0x1 - tooltip - Test for the avatar move forward control. CONTROL_LBUTTON + tooltip + Test for the avatar left button control. type integer value 0x10000000 - tooltip - Test for the avatar left button control. CONTROL_LEFT + tooltip + Test for the avatar move left control. type integer value 0x4 - tooltip - Test for the avatar move left control. CONTROL_ML_LBUTTON + tooltip + Test for the avatar left button control while in mouse look. type integer value 0x40000000 - tooltip - Test for the avatar left button control while in mouse look. CONTROL_RIGHT + tooltip + Test for the avatar move right control. type integer value 0x8 - tooltip - Test for the avatar move right control. CONTROL_ROT_LEFT + tooltip + Test for the avatar rotate left control. type integer value 0x100 - tooltip - Test for the avatar rotate left control. CONTROL_ROT_RIGHT + tooltip + Test for the avatar rotate right control. type integer value 0x200 - tooltip - Test for the avatar rotate right control. CONTROL_UP + tooltip + Test for the avatar move up control. type integer value 0x10 - tooltip - Test for the avatar move up control. - DATA_BORN + DAMAGEABLE + tooltip + Objects in world that are able to process damage. type integer value - 3 - tooltip - The date the agent was born, returned in ISO 8601 format of YYYY-MM-DD. + 0x20 - DATA_NAME + DAMAGE_TYPE_ACID + tooltip + Damage caused by a caustic substance, such as acid type integer value - 2 - tooltip - The name of the agent. + 1 - DATA_ONLINE + DAMAGE_TYPE_BLUDGEONING + tooltip + Damage caused by a blunt object, such as a club. type integer value - 1 - tooltip - TRUE for online, FALSE for offline. + 2 - DATA_PAYINFO + DAMAGE_TYPE_COLD + tooltip + Damage inflicted by exposure to extreme cold type integer value - 8 - tooltip - + 3 - DATA_RATING + DAMAGE_TYPE_ELECTRIC + tooltip + Damage caused by electricity. type integer value - 4 - tooltip - Returns the agent ratings as a comma separated string of six integers. They are: - 1) Positive rated behaviour - 2) Negative rated behaviour - 3) Positive rated appearance - 4) Negative rated appearance - 5) Positive rated building - 6) Negative rated building + 4 - DATA_SIM_POS + DAMAGE_TYPE_EMOTIONAL + tooltip + type integer value - 5 - tooltip - + 14 - DATA_SIM_RATING + DAMAGE_TYPE_FIRE + tooltip + Damage inflicted by exposure to heat or flames. type integer value - 7 - tooltip - + 5 - DATA_SIM_STATUS + DAMAGE_TYPE_FORCE + tooltip + Damage inflicted by a great force or impact. type integer value - 6 - tooltip - + 6 - DEBUG_CHANNEL + DAMAGE_TYPE_GENERIC + tooltip + Generic or legacy damage. type integer value - 2147483647 - tooltip - DEBUG_CHANNEL is an integer constant that, when passed to llSay, llWhisper, or llShout as a channel parameter, will print text to the Script Warning/Error Window. + 0 - DEG_TO_RAD + DAMAGE_TYPE_IMPACT - type - float - value - 0.017453293 tooltip - 0.017453293 - Number of radians per degree. - You can use this to convert degrees to radians by multiplying the degrees by this number. - - DENSITY - + System damage generated by imapact with land or a prim. type integer value - 1 - tooltip - Used with llSetPhysicsMaterial to enable the density value. Must be between 1.0 and 22587.0 (in Kg/m^3 -- see if you can figure out what 22587 represents) + -1 - EOF + DAMAGE_TYPE_NECROTIC + tooltip + Damage caused by a direct assault on life-force type - string + integer value - \\n\\n\\n - tooltip - Indicates the last line of a notecard was read. + 7 - ERR_GENERIC + DAMAGE_TYPE_PIERCING + tooltip + Damage caused by a piercing object such as a bullet, spear, or arrow. type integer value - -1 - tooltip - + 8 - ERR_MALFORMED_PARAMS + DAMAGE_TYPE_POISON + tooltip + Damage caused by poison. type integer value - -3 - tooltip - + 9 - ERR_PARCEL_PERMISSIONS + DAMAGE_TYPE_PSYCHIC + tooltip + Damage caused by a direct assault on the mind. type integer value - -2 - tooltip - + 10 - ERR_RUNTIME_PERMISSIONS + DAMAGE_TYPE_RADIANT + tooltip + Damage caused by radiation or extreme light. type integer value - -4 - tooltip - + 11 - ERR_THROTTLED + DAMAGE_TYPE_SLASHING + tooltip + Damage caused by a slashing object such as a sword or axe. type integer value - -5 - tooltip - + 12 - ESTATE_ACCESS_ALLOWED_AGENT_ADD + DAMAGE_TYPE_SONIC + tooltip + Damage caused by loud noises, like a Crash Worship concert. type integer value - 4 - tooltip - Add the agent to this estate's Allowed Residents list. + 13 - ESTATE_ACCESS_ALLOWED_AGENT_REMOVE + DATA_BORN + tooltip + The date the agent was born, returned in ISO 8601 format of YYYY-MM-DD. type integer value - 8 - tooltip - Remove the agent from this estate's Allowed Residents list. + 3 - ESTATE_ACCESS_ALLOWED_GROUP_ADD + DATA_NAME + tooltip + The name of the agent. type integer value - 16 - tooltip - Add the group to this estate's Allowed groups list. + 2 - ESTATE_ACCESS_ALLOWED_GROUP_REMOVE + DATA_ONLINE + tooltip + TRUE for online, FALSE for offline. type integer value - 32 - tooltip - Remove the group from this estate's Allowed groups list. + 1 - ESTATE_ACCESS_BANNED_AGENT_ADD + DATA_PAYINFO + tooltip + type integer value - 64 - tooltip - Add the agent to this estate's Banned residents list. + 8 - ESTATE_ACCESS_BANNED_AGENT_REMOVE + DATA_RATING + tooltip + + Returns the agent ratings as a comma separated string of six integers. They are: + 1) Positive rated behaviour + 2) Negative rated behaviour + 3) Positive rated appearance + 4) Negative rated appearance + 5) Positive rated building + 6) Negative rated building + type integer value - 128 - tooltip - Remove the agent from this estate's Banned residents list. + 4 - FALSE + DATA_SIM_POS + tooltip + type integer value - 0 - tooltip - An integer constant for boolean comparisons. Has the value '0'. + 5 - FORCE_DIRECT_PATH + DATA_SIM_RATING + tooltip + type integer value - 1 - tooltip - Makes character navigate in a straight line toward position. May be set to TRUE or FALSE. + 7 - FRICTION + DATA_SIM_STATUS + tooltip + type integer value - 2 - tooltip - Used with llSetPhysicsMaterial to enable the friction value. Must be between 0.0 and 255.0 + 6 - GCNP_RADIUS + DEBUG_CHANNEL + tooltip + DEBUG_CHANNEL is an integer constant that, when passed to llSay, llWhisper, or llShout as a channel parameter, will print text to the Script Warning/Error Window. type integer value - 0 - tooltip - + 2147483647 - GCNP_STATIC + DEG_TO_RAD + tooltip + + 0.017453293 - Number of radians per degree. + You can use this to convert degrees to radians by multiplying the degrees by this number. + type - integer + float value - 1 - tooltip - + 0.017453293 - GRAVITY_MULTIPLIER + DENSITY + tooltip + Used with llSetPhysicsMaterial to enable the density value. Must be between 1.0 and 22587.0 (in Kg/m^3 -- see if you can figure out what 22587 represents) type integer value - 8 - tooltip - Used with llSetPhysicsMaterial to enable the gravity multiplier value. Must be between -1.0 and +28.0 + 1 - HORIZONTAL + DEREZ_DIE + tooltip + Causes the object to immediately die. type integer value - 1 - tooltip - + 0 - HTTP_BODY_MAXLENGTH + DEREZ_MAKE_TEMP + tooltip + The object is made temporary and will be cleaned up at some later timer. type integer value - 2 - tooltip - + 1 - HTTP_BODY_TRUNCATED + ENVIRONMENT_DAYINFO + tooltip + Day length, offset and progression. type integer value - 0 - tooltip - + 200 - HTTP_CUSTOM_HEADER + ENV_INVALID_AGENT + tooltip + Could not find agent with the specified ID type integer value - 5 - tooltip - Add an extra custom HTTP header to the request. The first string is the name of the parameter to change, e.g. "Pragma", and the second string is the value, e.g. "no-cache". Up to 8 custom headers may be configured per request. Note that certain headers, such as the default headers, are blocked for security reasons. + -4 - HTTP_METHOD + ENV_INVALID_RULE + tooltip + Attempted to change an unknown property. type integer value - 0 - tooltip - + -5 - HTTP_MIMETYPE + ENV_NOT_EXPERIENCE + tooltip + Attempt to change environments outside an experience. type integer value - 1 - tooltip - + -1 - HTTP_PRAGMA_NO_CACHE + ENV_NO_ENVIRONMENT + tooltip + Could not find environmental settings in object inventory. type integer value - 6 - tooltip - Allows enabling/disbling of the "Pragma: no-cache" header.\nUsage: [HTTP_PRAGMA_NO_CACHE, integer SendHeader]. When SendHeader is TRUE, the "Pragma: no-cache" header is sent by the script. This matches the default behavior. When SendHeader is FALSE, no "Pragma" header is sent by the script. + -3 - HTTP_VERBOSE_THROTTLE + ENV_NO_EXPERIENCE_LAND + tooltip + The experience has not been enabled on this land. type integer value - 4 - tooltip - + -7 - HTTP_VERIFY_CERT + ENV_NO_EXPERIENCE_PERMISSION + tooltip + Agent has not granted permission to change environments. type integer value - 3 - tooltip - + -2 - INVENTORY_ALL + ENV_NO_PERMISSIONS + tooltip + Script does not have permission to modify environment. type integer value - -1 - tooltip - + -9 - INVENTORY_ANIMATION + ENV_THROTTLE + tooltip + Could not validate values for environment. type integer value - 20 - tooltip - + -8 - INVENTORY_BODYPART + ENV_VALIDATION_FAIL + tooltip + Could not validate values for environment. type integer value - 13 - tooltip - + -6 - INVENTORY_CLOTHING + EOF + tooltip + Indicates the last line of a notecard was read. type - integer + string value - 5 - tooltip - + \\n\\n\\n - INVENTORY_GESTURE + ERR_GENERIC + tooltip + type integer value - 21 - tooltip - + -1 - INVENTORY_LANDMARK + ERR_MALFORMED_PARAMS + tooltip + type integer value - 3 - tooltip - + -3 - INVENTORY_NONE + ERR_PARCEL_PERMISSIONS + tooltip + type integer value - -1 - tooltip - + -2 - INVENTORY_NOTECARD + ERR_RUNTIME_PERMISSIONS + tooltip + type integer value - 7 - tooltip - + -4 - INVENTORY_OBJECT + ERR_THROTTLED + tooltip + type integer value - 6 - tooltip - + -5 - INVENTORY_SCRIPT + ESTATE_ACCESS_ALLOWED_AGENT_ADD + tooltip + Add the agent to this estate's Allowed Residents list. type integer value - 10 - tooltip - + 4 - INVENTORY_SETTING + ESTATE_ACCESS_ALLOWED_AGENT_REMOVE + tooltip + Remove the agent from this estate's Allowed Residents list. type integer value - 56 - tooltip - + 8 - INVENTORY_SOUND + ESTATE_ACCESS_ALLOWED_GROUP_ADD + tooltip + Add the group to this estate's Allowed groups list. type integer value - 1 - tooltip - + 16 - INVENTORY_TEXTURE + ESTATE_ACCESS_ALLOWED_GROUP_REMOVE + tooltip + Remove the group from this estate's Allowed groups list. type integer value - 0 - tooltip - + 32 - INVENTORY_MATERIAL + ESTATE_ACCESS_BANNED_AGENT_ADD + tooltip + Add the agent to this estate's Banned residents list. type integer value - 57 - tooltip - + 64 - JSON_APPEND + ESTATE_ACCESS_BANNED_AGENT_REMOVE + tooltip + Remove the agent from this estate's Banned residents list. type integer value - -1 - tooltip - + 128 - JSON_ARRAY + FALSE - type - string - value - U+FDD2 tooltip - - - JSON_DELETE - + An integer constant for boolean comparisons. Has the value '0'. type - string + integer value - U+FDD8 - tooltip - + 0 - JSON_FALSE + FILTER_FLAGS + tooltip + Flags to control returned attachments. type - string + integer value - U+FDD7 - tooltip - + 2 - JSON_INVALID + FILTER_FLAG_HUDS + tooltip + Include HUDs with matching experience. type - string + integer value - U+FDD0 - tooltip - + 0x0001 - JSON_NULL + FILTER_INCLUDE + tooltip + Include attachment point. type - string + integer value - U+FDD5 - tooltip - + 1 - JSON_NUMBER + FORCE_DIRECT_PATH + tooltip + Makes character navigate in a straight line toward position. May be set to TRUE or FALSE. type - string + integer value - U+FDD3 - tooltip - + 1 - JSON_OBJECT + FRICTION + tooltip + Used with llSetPhysicsMaterial to enable the friction value. Must be between 0.0 and 255.0 type - string + integer value - U+FDD1 - tooltip - + 2 - JSON_STRING + GAME_CONTROL_AXIS_LEFTX + tooltip + type - string + integer value - U+FDD4 - tooltip - + 0 - JSON_TRUE + GAME_CONTROL_AXIS_LEFTY + tooltip + type - string + integer value - U+FDD6 - tooltip - + 1 - KFM_CMD_PAUSE + GAME_CONTROL_AXIS_RIGHTX + tooltip + type integer value - 2 - tooltip - For use with KFM_COMMAND. + 2 - KFM_CMD_PLAY + GAME_CONTROL_AXIS_RIGHTY + tooltip + type integer value - 0 - tooltip - For use with KFM_COMMAND. + 3 - KFM_CMD_STOP + GAME_CONTROL_AXIS_TRIGGERLEFT + tooltip + type integer value - 1 - tooltip - For use with KFM_COMMAND. + 4 - KFM_COMMAND + GAME_CONTROL_AXIS_TRIGGERRIGHT + tooltip + type integer value - 0 - tooltip - + 5 - KFM_DATA + GAME_CONTROL_BUTTON_A + tooltip + type integer value - 2 - tooltip - + 0x1 - KFM_FORWARD + GAME_CONTROL_BUTTON_B + tooltip + type integer value - 0 - tooltip - For use with KFM_MODE. + 0x2 - KFM_LOOP + GAME_CONTROL_BUTTON_BACK + tooltip + type integer value - 1 - tooltip - For use with KFM_MODE. + 0x10 - KFM_MODE + GAME_CONTROL_BUTTON_DPAD_DOWN + tooltip + type integer value - 1 - tooltip - + 0x1000 - KFM_PING_PONG + GAME_CONTROL_BUTTON_DPAD_LEFT + tooltip + type integer value - 2 - tooltip - For use with KFM_MODE. + 0x2000 - KFM_REVERSE + GAME_CONTROL_BUTTON_DPAD_RIGHT + tooltip + type integer value - 3 - tooltip - For use with KFM_MODE. + 0x4000 - KFM_ROTATION + GAME_CONTROL_BUTTON_DPAD_UP + tooltip + type integer value - 1 - tooltip - For use with KFM_DATA. + 0x800 - KFM_TRANSLATION + GAME_CONTROL_BUTTON_GUIDE + tooltip + type integer value - 2 - tooltip - For use with KFM_DATA. + 0x20 - LAND_LARGE_BRUSH + GAME_CONTROL_BUTTON_LEFTSHOULDER + tooltip + type integer value - 3 - tooltip - Use a large brush size.\nNOTE: This value is incorrect, a large brush should be 2. + 0x200 - LAND_LEVEL + GAME_CONTROL_BUTTON_LEFTSTICK + tooltip + type integer value - 0 - tooltip - Action to level the land. + 0x80 - LAND_LOWER + GAME_CONTROL_BUTTON_MISC1 + tooltip + type integer value - 2 - tooltip - Action to lower the land. + 0x8000 - LAND_MEDIUM_BRUSH + GAME_CONTROL_BUTTON_PADDLE1 + tooltip + type integer value - 2 - tooltip - Use a medium brush size.\nNOTE: This value is incorrect, a medium brush should be 1. + 0x10000 - LAND_NOISE + GAME_CONTROL_BUTTON_PADDLE2 + tooltip + type integer value - 4 - tooltip - + 0x20000 - LAND_RAISE + GAME_CONTROL_BUTTON_PADDLE3 + tooltip + type integer value - 1 - tooltip - Action to raise the land. + 0x40000 - LAND_REVERT + GAME_CONTROL_BUTTON_PADDLE4 + tooltip + type integer value - 5 - tooltip - + 0x80000 - LAND_SMALL_BRUSH + GAME_CONTROL_BUTTON_RIGHTSHOULDER + tooltip + type integer value - 1 - tooltip - Use a small brush size.\nNOTE: This value is incorrect, a small brush should be 0. + 0x400 - LAND_SMOOTH + GAME_CONTROL_BUTTON_RIGHTSTICK + tooltip + type integer value - 3 - tooltip - + 0x100 - LINK_ALL_CHILDREN + GAME_CONTROL_BUTTON_START + tooltip + type integer value - -3 - tooltip - This targets every object except the root in the linked set. + 0x40 - LINK_ALL_OTHERS + GAME_CONTROL_BUTTON_TOUCHPAD + tooltip + type integer value - -2 - tooltip - This targets every object in the linked set except the object with the script. + 0x100000 - LINK_ROOT + GAME_CONTROL_BUTTON_X + tooltip + type integer value - 1 - tooltip - This targets the root of the linked set. + 0x4 - LINK_SET + GAME_CONTROL_BUTTON_Y + tooltip + type integer value - -1 - tooltip - This targets every object in the linked set. + 0x8 - LINK_THIS + GCNP_RADIUS + tooltip + type integer value - -4 - tooltip - The link number of the prim containing the script. + 0 - LIST_STAT_GEOMETRIC_MEAN + GCNP_STATIC + tooltip + type integer value - 9 - tooltip - + 1 - LIST_STAT_MAX + GRAVITY_MULTIPLIER + tooltip + Used with llSetPhysicsMaterial to enable the gravity multiplier value. Must be between -1.0 and +28.0 type integer value - 2 - tooltip - + 8 - LIST_STAT_MEAN + HORIZONTAL + tooltip + type integer value - 3 - tooltip - + 1 - LIST_STAT_MEDIAN + HTTP_ACCEPT + tooltip + + Provide a string value to be included in the HTTP + accepts header value. This replaces the default Second Life HTTP accepts header. + type integer value - 4 - tooltip - + 8 - LIST_STAT_MIN + HTTP_BODY_MAXLENGTH + tooltip + type integer value - 1 - tooltip - + 2 - LIST_STAT_NUM_COUNT + HTTP_BODY_TRUNCATED + tooltip + type integer value - 8 - tooltip - + 0 - LIST_STAT_RANGE + HTTP_CUSTOM_HEADER + tooltip + Add an extra custom HTTP header to the request. The first string is the name of the parameter to change, e.g. "Pragma", and the second string is the value, e.g. "no-cache". Up to 8 custom headers may be configured per request. Note that certain headers, such as the default headers, are blocked for security reasons. type integer value - 0 - tooltip - + 5 - LIST_STAT_STD_DEV + HTTP_EXTENDED_ERROR + tooltip + Report extended error information through http_response event. type integer value - 5 - tooltip - + 9 - LIST_STAT_SUM + HTTP_METHOD + tooltip + type integer value - 6 - tooltip - + 0 - LIST_STAT_SUM_SQUARES + HTTP_MIMETYPE + tooltip + type integer value - 7 - tooltip - + 1 - LOOP + HTTP_PRAGMA_NO_CACHE + tooltip + Allows enabling/disbling of the "Pragma: no-cache" header.\nUsage: [HTTP_PRAGMA_NO_CACHE, integer SendHeader]. When SendHeader is TRUE, the "Pragma: no-cache" header is sent by the script. This matches the default behavior. When SendHeader is FALSE, no "Pragma" header is sent by the script. type integer value - 0x2 - tooltip - Loop the texture animation. + 6 - MASK_BASE + HTTP_USER_AGENT + tooltip + + Provide a string value to be included in the HTTP + User-Agent header value. This is appended to the default value. + type integer value - 0 - tooltip - + 7 - MASK_EVERYONE + HTTP_VERBOSE_THROTTLE + tooltip + type integer value - 3 - tooltip - + 4 - MASK_GROUP + HTTP_VERIFY_CERT + tooltip + type integer value - 2 - tooltip - + 3 - MASK_NEXT + IMG_USE_BAKED_AUX1 + tooltip + type - integer + string value - 4 - tooltip - + 9742065b-19b5-297c-858a-29711d539043 - MASK_OWNER + IMG_USE_BAKED_AUX2 + tooltip + type - integer + string value - 1 - tooltip - + 03642e83-2bd1-4eb9-34b4-4c47ed586d2d - NULL_KEY + IMG_USE_BAKED_AUX3 + tooltip + type string value - 00000000-0000-0000-0000-000000000000 - tooltip - + edd51b77-fc10-ce7a-4b3d-011dfc349e4f - OBJECT_ATTACHED_POINT + IMG_USE_BAKED_EYES + tooltip + type - integer + string value - 19 - tooltip - Gets the attachment point to which the object is attached.\nReturns 0 if the object is not an attachment (or is an avatar, etc). + 52cc6bb6-2ee5-e632-d3ad-50197b1dcb8a - OBJECT_BODY_SHAPE_TYPE + IMG_USE_BAKED_HAIR + tooltip + type - integer + string value - 26 - tooltip - This is a flag used with llGetObjectDetails to get the body type of the avatar, based on shape data.\nIf no data is available, -1.0 is returned.\nThis is normally between 0 and 1.0, with 0.5 and larger considered 'male' + 09aac1fb-6bce-0bee-7d44-caac6dbb6c63 - OBJECT_CHARACTER_TIME + IMG_USE_BAKED_HEAD + tooltip + type - integer + string value - 17 - tooltip - Units in seconds + 5a9f4a74-30f2-821c-b88d-70499d3e7183 - OBJECT_CLICK_ACTION + IMG_USE_BAKED_LEFTARM + tooltip + type - integer + string value - 28 - tooltip - This is a flag used with llGetObjectDetails to get the click action.\nThe default is 0 + ff62763f-d60a-9855-890b-0c96f8f8cd98 - OBJECT_CREATOR + IMG_USE_BAKED_LEFTLEG + tooltip + type - integer + string value - 8 - tooltip - Gets the object's creator key. If id is an avatar, a NULL_KEY is returned. + 8e915e25-31d1-cc95-ae08-d58a47488251 - OBJECT_DESC + IMG_USE_BAKED_LOWER + tooltip + type - integer + string value - 2 - tooltip - Gets the object's description. If id is an avatar, an empty string is returned. + 24daea5f-0539-cfcf-047f-fbc40b2786ba - OBJECT_GROUP + IMG_USE_BAKED_SKIRT + tooltip + type - integer + string value - 7 - tooltip - Gets the prims's group key. If id is an avatar, a NULL_KEY is returned. + 43529ce8-7faa-ad92-165a-bc4078371687 - OBJECT_HOVER_HEIGHT + IMG_USE_BAKED_UPPER + tooltip + type - integer + string value - 25 - tooltip - This is a flag used with llGetObjectDetails to get hover height of the avatar\nIf no data is available, 0.0 is returned. + ae2de45c-d252-50b8-5c6e-19f39ce79317 - OBJECT_LAST_OWNER_ID + INVENTORY_ALL + tooltip + type integer value - 27 - tooltip - Gets the object's last owner ID. + -1 - OBJECT_NAME + INVENTORY_ANIMATION + tooltip + type integer value - 1 - tooltip - Gets the object's name. + 20 - OBJECT_OMEGA + INVENTORY_BODYPART + tooltip + type integer value - 29 - tooltip - Gets an object's angular velocity. + 13 - OBJECT_OWNER + INVENTORY_CLOTHING + tooltip + type integer value - 6 - tooltip - Gets an object's owner's key. If id is group owned, a NULL_KEY is returned. + 5 - OBJECT_PRIM_COUNT + INVENTORY_GESTURE + tooltip + type integer value - 30 - tooltip - Gets the prim count of the object. The script and target object must be owned by the same owner + 21 - OBJECT_PATHFINDING_TYPE + INVENTORY_LANDMARK + tooltip + type integer value - 20 - tooltip - Returns the pathfinding setting of any object in the region. It returns an integer matching one of the OPT_* constants. + 3 - OBJECT_PHANTOM + INVENTORY_MATERIAL + tooltip + type integer value - 22 - tooltip - Returns boolean, detailing if phantom is enabled or disabled on the object.\nIf id is an avatar or attachment, 0 is returned. + 57 - OBJECT_PHYSICS + INVENTORY_NONE + tooltip + type integer value - 21 - tooltip - Returns boolean, detailing if physics is enabled or disabled on the object.\nIf id is an avatar or attachment, 0 is returned. + -1 - OBJECT_PHYSICS_COST + INVENTORY_NOTECARD + tooltip + type integer value - 16 - tooltip - + 7 - OBJECT_POS + INVENTORY_OBJECT + tooltip + type integer value - 3 - tooltip - Gets the object's position in region coordinates. + 6 - OBJECT_PRIM_EQUIVALENCE + INVENTORY_SCRIPT + tooltip + type integer value - 13 - tooltip - + 10 - OBJECT_RENDER_WEIGHT + INVENTORY_SETTING + tooltip + type integer value - 24 - tooltip - This is a flag used with llGetObjectDetails to get the Avatar_Rendering_Cost of an avatar, based on values reported by nearby viewers.\nIf no data is available, -1 is returned.\nThe maximum render weight stored by the simulator is 500000. When called against an object, 0 is returned. + 56 - OBJECT_RETURN_PARCEL + INVENTORY_SOUND + tooltip + type integer value - 1 - tooltip - + 1 - OBJECT_RETURN_PARCEL_OWNER + INVENTORY_TEXTURE + tooltip + type integer value - 2 - tooltip - + 0 - OBJECT_RETURN_REGION + JSON_APPEND + tooltip + type integer value - 4 - tooltip - + -1 - OBJECT_REZZER_KEY + JSON_ARRAY + tooltip + type - integer + string value - 32 - tooltip - + \\ufdd2 - OBJECT_ROOT + JSON_DELETE + tooltip + type - integer + string value - 18 - tooltip - Gets the id of the root prim of the object requested.\nIf id is an avatar, return the id of the root prim of the linkset the avatar is sitting on (or the avatar's own id if the avatar is not sitting on an object within the region). + \\ufdd8 - OBJECT_ROT + JSON_FALSE + tooltip + type - integer + string value - 4 - tooltip - Gets the object's rotation. + \\ufdd7 - OBJECT_RUNNING_SCRIPT_COUNT + JSON_INVALID + tooltip + type - integer + string value - 9 - tooltip - + \\ufdd0 - OBJECT_SCRIPT_MEMORY + JSON_NULL + tooltip + type - integer + string value - 11 - tooltip - + \\ufdd5 - OBJECT_SCRIPT_TIME + JSON_NUMBER + tooltip + type - integer + string value - 12 - tooltip - + \\ufdd3 - OBJECT_SERVER_COST + JSON_OBJECT + tooltip + type - integer + string value - 14 - tooltip - + \\ufdd1 - OBJECT_STREAMING_COST + JSON_STRING + tooltip + type - integer + string value - 15 - tooltip - + \\ufdd4 - OBJECT_TEMP_ON_REZ + JSON_TRUE + tooltip + type - integer + string value - 23 - tooltip - Returns boolean, detailing if temporary is enabled or disabled on the object. + \\ufdd6 - OBJECT_TOTAL_INVENTORY_COUNT + KFM_CMD_PAUSE + tooltip + For use with KFM_COMMAND. type integer value - 31 - tooltip - Gets the total inventory count of the object. The script and target object must be owned by the same owner + 2 - OBJECT_TOTAL_SCRIPT_COUNT + KFM_CMD_PLAY + tooltip + For use with KFM_COMMAND. type integer value - 10 - tooltip - + 0 - OBJECT_UNKNOWN_DETAIL + KFM_CMD_STOP + tooltip + For use with KFM_COMMAND. type integer value - -1 - tooltip - + 1 - OBJECT_VELOCITY + KFM_COMMAND + tooltip + type integer value - 5 - tooltip - Gets the object's velocity. + 0 - OPT_AVATAR + KFM_DATA + tooltip + type integer value - 1 - tooltip - Returned for avatars. + 2 - OPT_CHARACTER + KFM_FORWARD + tooltip + For use with KFM_MODE. type integer value - 2 - tooltip - Returned for pathfinding characters. + 0 - OPT_EXCLUSION_VOLUME + KFM_LOOP + tooltip + For use with KFM_MODE. type integer value - 6 - tooltip - Returned for exclusion volumes. + 1 - OPT_LEGACY_LINKSET + KFM_MODE + tooltip + type integer value - 0 - tooltip - Returned for movable obstacles, movable phantoms, physical, and volumedetect objects. + 1 - OPT_MATERIAL_VOLUME + KFM_PING_PONG + tooltip + For use with KFM_MODE. type integer value - 5 - tooltip - Returned for material volumes. + 2 - OPT_OTHER + KFM_REVERSE + tooltip + For use with KFM_MODE. type integer value - -1 - tooltip - Returned for attachments, Linden trees, and grass. + 3 - OPT_STATIC_OBSTACLE + KFM_ROTATION + tooltip + For use with KFM_DATA. type integer value - 4 - tooltip - Returned for static obstacles. + 1 - OPT_WALKABLE + KFM_TRANSLATION + tooltip + For use with KFM_DATA. type integer value - 3 - tooltip - Returned for walkable objects. + 2 - PARCEL_COUNT_GROUP + LAND_LARGE_BRUSH + tooltip + Use a large brush size.\nNOTE: This value is incorrect, a large brush should be 2. type integer value - 2 - tooltip - + 3 - PARCEL_COUNT_OTHER + LAND_LEVEL + tooltip + Action to level the land. type integer value - 3 - tooltip - + 0 - PARCEL_COUNT_OWNER + LAND_LOWER + tooltip + Action to lower the land. type integer value - 1 - tooltip - + 2 - PARCEL_COUNT_SELECTED + LAND_MEDIUM_BRUSH + tooltip + Use a medium brush size.\nNOTE: This value is incorrect, a medium brush should be 1. type integer value - 4 - tooltip - + 2 - PARCEL_COUNT_TEMP + LAND_NOISE + tooltip + type integer value - 5 - tooltip - + 4 - PARCEL_COUNT_TOTAL + LAND_RAISE + tooltip + Action to raise the land. type integer value - 0 - tooltip - + 1 - PARCEL_DETAILS_AREA + LAND_REVERT + tooltip + type integer value - 4 - tooltip - The parcel's area, in square meters. (5 chars.). + 5 - PARCEL_DETAILS_DESC + LAND_SMALL_BRUSH + tooltip + Use a small brush size.\nNOTE: This value is incorrect, a small brush should be 0. type integer value - 1 - tooltip - The description of the parcel. (127 chars). + 1 - PARCEL_DETAILS_GROUP + LAND_SMOOTH + tooltip + type integer value - 3 - tooltip - The parcel group's key. (36 chars.). + 3 - PARCEL_DETAILS_ID + LINKSETDATA_DELETE + tooltip + A name:value pair has been removed from the linkset datastore. type integer value - 5 - tooltip - The parcel's key. (36 chars.). + 2 - PARCEL_DETAILS_NAME + LINKSETDATA_EMEMORY + tooltip + A name:value pair was too large to write to the linkset datastore. type integer value - 0 - tooltip - The name of the parcel. (63 chars.). + 1 - PARCEL_DETAILS_OWNER + LINKSETDATA_ENOKEY + tooltip + The key supplied was empty. type integer value - 2 - tooltip - The parcel owner's key. (36 chars.). + 2 - PARCEL_DETAILS_SEE_AVATARS + LINKSETDATA_EPROTECTED + tooltip + The name:value pair has been protected from overwrite in the linkset datastore. type integer value - 6 - tooltip - The parcel's avatar visibility setting. (1 char.). + 3 - PARCEL_FLAG_ALLOW_ALL_OBJECT_ENTRY + LINKSETDATA_MULTIDELETE + tooltip + A CSV list of names removed from the linkset datastore. type integer value - 0x08000000 - tooltip - + 3 - PARCEL_FLAG_ALLOW_CREATE_GROUP_OBJECTS + LINKSETDATA_NOTFOUND + tooltip + The named key was not found in the datastore. type integer value - 0x4000000 - tooltip - + 4 - PARCEL_FLAG_ALLOW_CREATE_OBJECTS + LINKSETDATA_NOUPDATE + tooltip + The value written to a name in the keystore is the same as the value already there. type integer value - 0x40 - tooltip - + 5 - PARCEL_FLAG_ALLOW_DAMAGE + LINKSETDATA_OK + tooltip + The name:value pair was written to the datastore. type integer value - 0x20 - tooltip - + 0 - PARCEL_FLAG_ALLOW_FLY + LINKSETDATA_RESET + tooltip + The linkset datastore has been reset. type integer value - 0x1 - tooltip - + 0 - PARCEL_FLAG_ALLOW_GROUP_OBJECT_ENTRY + LINKSETDATA_UPDATE + tooltip + A name:value pair in the linkset datastore has been changed or created. type integer value - 0x10000000 - tooltip - + 1 - PARCEL_FLAG_ALLOW_GROUP_SCRIPTS + LINK_ALL_CHILDREN + tooltip + This targets every object except the root in the linked set. type integer value - 0x2000000 - tooltip - + -3 - PARCEL_FLAG_ALLOW_LANDMARK + LINK_ALL_OTHERS + tooltip + This targets every object in the linked set except the object with the script. type integer value - 0x8 - tooltip - + -2 - PARCEL_FLAG_ALLOW_SCRIPTS + LINK_ROOT + tooltip + This targets the root of the linked set. type integer value - 0x2 - tooltip - + 1 - PARCEL_FLAG_ALLOW_TERRAFORM + LINK_SET + tooltip + This targets every object in the linked set. type integer value - 0x10 - tooltip - + -1 - PARCEL_FLAG_LOCAL_SOUND_ONLY + LINK_THIS + tooltip + The link number of the prim containing the script. type integer value - 0x8000 - tooltip - + -4 - PARCEL_FLAG_RESTRICT_PUSHOBJECT + LIST_STAT_GEOMETRIC_MEAN + tooltip + type integer value - 0x200000 - tooltip - + 9 - PARCEL_FLAG_USE_ACCESS_GROUP + LIST_STAT_MAX + tooltip + type integer value - 0x100 - tooltip - + 2 - PARCEL_FLAG_USE_ACCESS_LIST + LIST_STAT_MEAN + tooltip + type integer value - 0x200 - tooltip - + 3 - PARCEL_FLAG_USE_BAN_LIST + LIST_STAT_MEDIAN + tooltip + type integer value - 0x400 - tooltip - + 4 - PARCEL_FLAG_USE_LAND_PASS_LIST + LIST_STAT_MIN + tooltip + type integer value - 0x800 - tooltip - + 1 - PARCEL_MEDIA_COMMAND_AGENT + LIST_STAT_NUM_COUNT + tooltip + type integer value - 7 - tooltip - + 8 - PARCEL_MEDIA_COMMAND_AUTO_ALIGN + LIST_STAT_RANGE + tooltip + type integer value - 9 - tooltip - + 0 - PARCEL_MEDIA_COMMAND_DESC + LIST_STAT_STD_DEV + tooltip + type integer value - 12 - tooltip - Use this to get or set the parcel media description. + 5 - PARCEL_MEDIA_COMMAND_LOOP + LIST_STAT_SUM + tooltip + type integer value - 3 - tooltip - + 6 - PARCEL_MEDIA_COMMAND_LOOP_SET + LIST_STAT_SUM_SQUARES + tooltip + type integer value - 13 - tooltip - Used to get or set the parcel's media looping variable. + 7 - PARCEL_MEDIA_COMMAND_PAUSE + LOOP + tooltip + Loop the texture animation. type integer value - 1 - tooltip - + 0x2 - PARCEL_MEDIA_COMMAND_PLAY + MASK_BASE + tooltip + type integer value - 2 - tooltip - + 0 - PARCEL_MEDIA_COMMAND_SIZE + MASK_COMBINED + tooltip + Fold permissions for object inventory into results. type integer value - 11 - tooltip - Use this to get or set the parcel media pixel resolution. + 0x10 - PARCEL_MEDIA_COMMAND_STOP + MASK_EVERYONE + tooltip + type integer value - 0 - tooltip - + 3 - PARCEL_MEDIA_COMMAND_TEXTURE + MASK_GROUP + tooltip + type integer value - 4 - tooltip - + 2 - PARCEL_MEDIA_COMMAND_TIME + MASK_NEXT + tooltip + type integer value - 6 - tooltip - + 4 - PARCEL_MEDIA_COMMAND_TYPE + MASK_OWNER + tooltip + type integer value - 10 - tooltip - Use this to get or set the parcel media MIME type (e.g. "text/html"). + 1 - PARCEL_MEDIA_COMMAND_UNLOAD + NAK + tooltip + Indicates a notecard read was attempted and the notecard was not yet cached on the server. type - integer + string value - 8 - tooltip - + \\n\\x15\\n - PARCEL_MEDIA_COMMAND_URL + NULL_KEY + tooltip + type - integer + string value - 5 - tooltip - + 00000000-0000-0000-0000-000000000000 - PASS_ALWAYS + OBJECT_ACCOUNT_LEVEL + tooltip + Retrieves the account level of an avatar.\nReturns 0 when the avatar has a basic account,\n 1 when the avatar has a premium account,\n 10 when the avatar has a premium plus account,\n or -1 if the object is not an avatar. type integer value - 1 - tooltip - Always pass the event. + 41 - PASS_NEVER + OBJECT_ANIMATED_COUNT + tooltip + This is a flag used with llGetObjectDetails to get the number of associated animated objects type integer value - 2 - tooltip - Always pass the event. + 39 - PASS_IF_NOT_HANDLED + OBJECT_ANIMATED_SLOTS_AVAILABLE + tooltip + This is a flag used with llGetObjectDetails to get the number of additional animated object attachments allowed. type integer value - 0 - tooltip - Pass the event if there is no script handling the event in the prim. + 40 - PASSIVE + OBJECT_ATTACHED_POINT + tooltip + Gets the attachment point to which the object is attached.\nReturns 0 if the object is not an attachment (or is an avatar, etc). type integer value - 0x4 - tooltip - Static in-world objects. + 19 - PATROL_PAUSE_AT_WAYPOINTS + OBJECT_ATTACHED_SLOTS_AVAILABLE + tooltip + Returns the number of attachment slots available.\nReturns 0 if the object is not an avatar or none are available. type integer value - 0 - tooltip - + 35 - PAY_DEFAULT + OBJECT_BODY_SHAPE_TYPE + tooltip + This is a flag used with llGetObjectDetails to get the body type of the avatar, based on shape data.\nIf no data is available, -1.0 is returned.\nThis is normally between 0 and 1.0, with 0.5 and larger considered 'male' type integer value - -2 - tooltip - + 26 - PAY_HIDE + OBJECT_CHARACTER_TIME + tooltip + Units in seconds type integer value - -1 - tooltip - + 17 - PAYMENT_INFO_ON_FILE + OBJECT_CLICK_ACTION + tooltip + This is a flag used with llGetObjectDetails to get the click action.\nThe default is 0 type integer value - 1 - tooltip - + 28 - PAYMENT_INFO_USED + OBJECT_CREATION_TIME + tooltip + This is a flag used with llGetObjectDetails to get the time this object was created type integer value - 2 - tooltip - + 36 - PERM_ALL + OBJECT_CREATOR + tooltip + Gets the object's creator key. If id is an avatar, a NULL_KEY is returned. type integer value - 0x7FFFFFFF - tooltip - + 8 - PERM_COPY + OBJECT_DAMAGE + tooltip + Gets the damage value assigned to this object. type integer value - 0x8000 - tooltip - + 51 - PERM_MODIFY + OBJECT_DAMAGE_TYPE + tooltip + Gets the damage type, if any, assigned to this object. type integer value - 0x4000 - tooltip - + 52 - PERM_MOVE + OBJECT_DESC + tooltip + Gets the object's description. If id is an avatar, an empty string is returned. type integer value - 0x80000 - tooltip - + 2 - PERM_TRANSFER + OBJECT_GROUP + tooltip + Gets the prims's group key. If id is an avatar, a NULL_KEY is returned. type integer value - 0x2000 - tooltip - + 7 - PERMISSION_ATTACH + OBJECT_GROUP_TAG + tooltip + Gets the agent's current group role tag. If id is an object, an empty is returned. type integer value - 0x20 - tooltip - If this permission is enabled, the object can successfully call llAttachToAvatar to attach to the given avatar. + 33 - PERMISSION_CHANGE_JOINTS + OBJECT_HEALTH + tooltip + Gets current health value for the object. type integer value - 0x100 - tooltip - (not yet implemented) + 50 - PERMISSION_CHANGE_LINKS + OBJECT_HOVER_HEIGHT + tooltip + This is a flag used with llGetObjectDetails to get hover height of the avatar\nIf no data is available, 0.0 is returned. type integer value - 0x80 - tooltip - If this permission is enabled, the object can successfully call llCreateLink, llBreakLink, and llBreakAllLinks to change links to other objects. + 25 - PERMISSION_CHANGE_PERMISSIONS + OBJECT_LAST_OWNER_ID + tooltip + Gets the object's last owner ID. type integer value - 0x200 - tooltip - (not yet implemented) + 27 - PERMISSION_CONTROL_CAMERA + OBJECT_LINK_NUMBER + tooltip + Gets the object's link number or 0 if unlinked. type integer value - 0x800 - tooltip - + 46 - PERMISSION_DEBIT + OBJECT_MASS + tooltip + Get the object's mass type integer value - 0x2 - tooltip - If this permission is enabled, the object can successfully call llGiveMoney or llTransferLindenDollars to debit the owners account. + 43 - PERMISSION_OVERRIDE_ANIMATIONS + OBJECT_MATERIAL + tooltip + Get an object's material setting. type integer value - 0x8000 - tooltip - Permission to override default animations. + 42 - PERMISSION_RELEASE_OWNERSHIP + OBJECT_NAME + tooltip + Gets the object's name. type integer value - 0x40 - tooltip - (not yet implemented) + 1 - PERMISSION_REMAP_CONTROLS + OBJECT_OMEGA + tooltip + Gets an object's angular velocity. type integer value - 0x8 - tooltip - (not yet implemented) + 29 - PERMISSION_RETURN_OBJECTS + OBJECT_OWNER + tooltip + Gets an object's owner's key. If id is group owned, a NULL_KEY is returned. type integer value - 65536 - tooltip - + 6 - PERMISSION_SILENT_ESTATE_MANAGEMENT + OBJECT_PATHFINDING_TYPE + tooltip + Returns the pathfinding setting of any object in the region. It returns an integer matching one of the OPT_* constants. type integer value - 0x4000 - tooltip - A script with this permission does not notify the object owner when it modifies estate access rules via llManageEstateAccess. + 20 - PERMISSION_TAKE_CONTROLS + OBJECT_PERMS + tooltip + Gets the objects permissions type integer value - 0x4 - tooltip - If this permission enabled, the object can successfully call the llTakeControls libray call. + 53 - PERMISSION_TELEPORT + OBJECT_PERMS_COMBINED + tooltip + Gets the object's permissions including any inventory. type integer value - 0x1000 - tooltip - + 54 - PERMISSION_TRACK_CAMERA + OBJECT_PHANTOM + tooltip + Returns boolean, detailing if phantom is enabled or disabled on the object.\nIf id is an avatar or attachment, 0 is returned. type integer value - 0x400 - tooltip - + 22 - PERMISSION_TRIGGER_ANIMATION + OBJECT_PHYSICS + tooltip + Returns boolean, detailing if physics is enabled or disabled on the object.\nIf id is an avatar or attachment, 0 is returned. type integer value - 0x10 - tooltip - If this permission is enabled, the object can successfully call llStartAnimation for the avatar that owns this. + 21 - PI + OBJECT_PHYSICS_COST - type - float - value - 3.14159265 tooltip - 3.14159265 - The number of radians in a semi-circle. - - PI_BY_TWO - + type - float + integer value - 1.57079633 - tooltip - 1.57079633 - The number of radians in a quarter circle. + 16 - PING_PONG + OBJECT_POS + tooltip + Gets the object's position in region coordinates. type integer value - 0x8 - tooltip - Play animation going forwards, then backwards. + 3 - PRIM_ALPHA_MODE + OBJECT_PRIM_COUNT + tooltip + Gets the prim count of the object. The script and target object must be owned by the same owner type integer value - 38 - tooltip - Prim parameter for materials using integer face, integer alpha_mode, integer alpha_cutoff.\nDefines how the alpha channel of the diffuse texture should be rendered.\nValid options for alpha_mode are PRIM_ALPHA_MODE_BLEND, _NONE, _MASK, and _EMISSIVE.\nalpha_cutoff is used only for PRIM_ALPHA_MODE_MASK. + 30 - PRIM_ALPHA_MODE_NONE + OBJECT_PRIM_EQUIVALENCE + tooltip + type integer value - 0 - tooltip - Prim parameter setting for PRIM_ALPHA_MODE.\nIndicates that the diffuse texture's alpha channel should be ignored. + 13 - PRIM_ALPHA_MODE_BLEND + OBJECT_RENDER_WEIGHT + tooltip + This is a flag used with llGetObjectDetails to get the Avatar_Rendering_Cost of an avatar, based on values reported by nearby viewers.\nIf no data is available, -1 is returned.\nThe maximum render weight stored by the simulator is 500000. When called against an object, 0 is returned. type integer value - 1 - tooltip - Prim parameter setting for PRIM_ALPHA_MODE.\nIndicates that the diffuse texture's alpha channel should be rendered as alpha-blended. + 24 - PRIM_ALPHA_MODE_MASK + OBJECT_RETURN_PARCEL + tooltip + type integer value - 2 - tooltip - Prim parameter setting for PRIM_ALPHA_MODE.\nIndicates that the diffuse texture's alpha channel should be rendered as fully opaque for alpha values above alpha_cutoff and fully transparent otherwise. + 1 - PRIM_ALPHA_MODE_EMISSIVE + OBJECT_RETURN_PARCEL_OWNER + tooltip + type integer value - 3 - tooltip - Prim parameter setting for PRIM_ALPHA_MODE.\nIndicates that the diffuse texture's alpha channel should be rendered as an emissivity mask. + 2 - PRIM_BUMP_BARK + OBJECT_RETURN_REGION + tooltip + type integer value - 4 - tooltip - + 4 - PRIM_BUMP_BLOBS + OBJECT_REZZER_KEY + tooltip + type integer value - 12 - tooltip - + 32 - PRIM_BUMP_BRICKS + OBJECT_REZ_TIME + tooltip + Get the time when an object was rezzed. type integer value - 5 - tooltip - + 45 - PRIM_BUMP_BRIGHT + OBJECT_ROOT + tooltip + Gets the id of the root prim of the object requested.\nIf id is an avatar, return the id of the root prim of the linkset the avatar is sitting on (or the avatar's own id if the avatar is not sitting on an object within the region). type integer value - 1 - tooltip - + 18 - PRIM_BUMP_CHECKER + OBJECT_ROT + tooltip + Gets the object's rotation. type integer value - 6 - tooltip - + 4 - PRIM_BUMP_CONCRETE + OBJECT_RUNNING_SCRIPT_COUNT + tooltip + type integer value - 7 - tooltip - + 9 - PRIM_BUMP_DARK + OBJECT_SCALE + tooltip + Gets the object's size. type integer value - 2 - tooltip - + 47 - PRIM_BUMP_DISKS + OBJECT_SCRIPT_MEMORY + tooltip + type integer value - 10 - tooltip - + 11 - PRIM_BUMP_GRAVEL + OBJECT_SCRIPT_TIME + tooltip + type integer value - 11 - tooltip - + 12 - PRIM_BUMP_LARGETILE + OBJECT_SELECT_COUNT + tooltip + This is a flag used with llGetObjectDetails to get the number of avatars selecting any part of the object type integer value - 14 - tooltip - + 37 - PRIM_BUMP_NONE + OBJECT_SERVER_COST + tooltip + type integer value - 0 - tooltip - + 14 - PRIM_BUMP_SHINY + OBJECT_SIT_COUNT + tooltip + This is a flag used with llGetObjectDetails to get the number of avatars sitting on the object type integer value - 19 - tooltip - + 38 - PRIM_BUMP_SIDING + OBJECT_STREAMING_COST + tooltip + type integer value - 13 - tooltip - + 15 - PRIM_BUMP_STONE + OBJECT_TEMP_ATTACHED + tooltip + Returns boolean, indicating if object is a temp attachment. type integer value - 9 - tooltip - + 34 - PRIM_BUMP_STUCCO + OBJECT_TEMP_ON_REZ + tooltip + Returns boolean, detailing if temporary is enabled or disabled on the object. type integer value - 15 - tooltip - + 23 - PRIM_BUMP_SUCTION + OBJECT_TEXT + tooltip + Gets an objects hover text. type integer value - 16 - tooltip - + 44 - PRIM_BUMP_TILE + OBJECT_TEXT_ALPHA + tooltip + Gets the alpha of an objects hover text. type integer value - 8 - tooltip - + 49 - PRIM_BUMP_WEAVE + OBJECT_TEXT_COLOR + tooltip + Gets the color of an objects hover text. type integer value - 17 - tooltip - + 48 - PRIM_BUMP_WOOD + OBJECT_TOTAL_INVENTORY_COUNT + tooltip + Gets the total inventory count of the object. The script and target object must be owned by the same owner type integer value - 3 - tooltip - + 31 - PRIM_CAST_SHADOWS + OBJECT_TOTAL_SCRIPT_COUNT - deprecated - true + tooltip + type integer value - 24 - tooltip - + 10 - PRIM_COLOR + OBJECT_UNKNOWN_DETAIL + tooltip + type integer value - 18 - tooltip - + -1 - PRIM_DESC + OBJECT_VELOCITY + tooltip + Gets the object's velocity. type integer value - 28 - tooltip - + 5 - PRIM_FLEXIBLE + OPT_AVATAR + tooltip + Returned for avatars. type integer value - 21 - tooltip - + 1 - PRIM_FULLBRIGHT + OPT_CHARACTER + tooltip + Returned for pathfinding characters. type integer value - 20 - tooltip - + 2 - PRIM_GLOW + OPT_EXCLUSION_VOLUME + tooltip + Returned for exclusion volumes. type integer value - 25 - tooltip - PRIM_GLOW is used to get or set the glow status of the face. + 6 - PRIM_HOLE_CIRCLE + OPT_LEGACY_LINKSET + tooltip + Returned for movable obstacles, movable phantoms, physical, and volumedetect objects. type integer value - 0x10 - tooltip - + 0 - PRIM_HOLE_DEFAULT + OPT_MATERIAL_VOLUME + tooltip + Returned for material volumes. type integer value - 0x00 - tooltip - + 5 - PRIM_HOLE_SQUARE + OPT_OTHER + tooltip + Returned for attachments, Linden trees, and grass. type integer value - 0x20 - tooltip - + -1 - PRIM_HOLE_TRIANGLE + OPT_STATIC_OBSTACLE + tooltip + Returned for static obstacles. type integer value - 0x30 - tooltip - + 4 - PRIM_LINK_TARGET + OPT_WALKABLE + tooltip + Returned for walkable objects. type integer value - 34 - tooltip - + 3 - PRIM_MATERIAL + PARCEL_COUNT_GROUP + tooltip + type integer value - 2 - tooltip - + 2 - PRIM_MATERIAL_FLESH + PARCEL_COUNT_OTHER + tooltip + type integer value - 4 - tooltip - + 3 - PRIM_MATERIAL_GLASS + PARCEL_COUNT_OWNER + tooltip + type integer value - 2 - tooltip - + 1 - PRIM_MATERIAL_LIGHT + PARCEL_COUNT_SELECTED + tooltip + type integer value - 7 - tooltip - + 4 - PRIM_MATERIAL_METAL + PARCEL_COUNT_TEMP + tooltip + type integer value - 1 - tooltip - + 5 - PRIM_MATERIAL_PLASTIC + PARCEL_COUNT_TOTAL + tooltip + type integer value - 5 - tooltip - + 0 - PRIM_MATERIAL_RUBBER + PARCEL_DETAILS_AREA + tooltip + The parcel's area, in square meters. (5 chars.). type integer value - 6 - tooltip - + 4 - PRIM_MATERIAL_STONE + PARCEL_DETAILS_DESC + tooltip + The description of the parcel. (127 chars). type integer value - 0 - tooltip - + 1 - PRIM_MATERIAL_WOOD + PARCEL_DETAILS_FLAGS + tooltip + Flags set on the parcel type integer value - 3 - tooltip - + 12 - PRIM_MEDIA_ALT_IMAGE_ENABLE + PARCEL_DETAILS_GROUP + tooltip + The parcel group's key. (36 chars.). type integer value - 0 - tooltip - Boolean. Gets/Sets the default image state (the image that the user sees before a piece of media is active) for the chosen face. The default image is specified by Second Life's server for that media type. + 3 - PRIM_MEDIA_AUTO_LOOP + PARCEL_DETAILS_ID + tooltip + The parcel's key. (36 chars.). type integer value - 4 - tooltip - Boolean. Gets/Sets whether auto-looping is enabled. + 5 - PRIM_MEDIA_AUTO_PLAY + PARCEL_DETAILS_LANDING_LOOKAT + tooltip + Lookat vector set for teleport routing. type integer value - 5 - tooltip - Boolean. Gets/Sets whether the media auto-plays when a Resident can view it. + 10 - PRIM_MEDIA_AUTO_SCALE + PARCEL_DETAILS_LANDING_POINT + tooltip + The parcel's landing point, if any. type integer value - 6 - tooltip - Boolean. Gets/Sets whether auto-scaling is enabled. Auto-scaling forces the media to the full size of the texture. + 9 - PRIM_MEDIA_AUTO_ZOOM + PARCEL_DETAILS_NAME + tooltip + The name of the parcel. (63 chars.). type integer value - 7 - tooltip - Boolean. Gets/Sets whether clicking the media triggers auto-zoom and auto-focus on the media. + 0 - PRIM_MEDIA_CONTROLS + PARCEL_DETAILS_OWNER + tooltip + The parcel owner's key. (36 chars.). type integer value - 1 - tooltip - Integer. Gets/Sets the style of controls. Can be either PRIM_MEDIA_CONTROLS_STANDARD or PRIM_MEDIA_CONTROLS_MINI. + 2 - PRIM_MEDIA_CONTROLS_MINI + PARCEL_DETAILS_PRIM_CAPACITY + tooltip + The parcel's prim capacity. type integer value - 1 - tooltip - Mini web navigation controls; does not include an address bar. + 7 - PRIM_MEDIA_CONTROLS_STANDARD + PARCEL_DETAILS_PRIM_USED + tooltip + The number of prims used on this parcel. type integer value - 0 - tooltip - Standard web navigation controls. + 8 - PRIM_MEDIA_CURRENT_URL + PARCEL_DETAILS_SCRIPT_DANGER + tooltip + There are restrictions on this parcel that may impact script execution. type integer value - 2 - tooltip - String. Gets/Sets the current url displayed on the chosen face. Changing this URL causes navigation. 1024 characters Maximum. + 13 - PRIM_MEDIA_FIRST_CLICK_INTERACT + PARCEL_DETAILS_SEE_AVATARS + tooltip + The parcel's avatar visibility setting. (1 char.). type integer value - 8 - tooltip - Boolean. Gets/Sets whether the first click interaction is enabled. + 6 - PRIM_MEDIA_HEIGHT_PIXELS + PARCEL_DETAILS_TP_ROUTING + tooltip + Parcel's teleport routing setting. type integer value - 10 - tooltip - Integer. Gets/Sets the height of the media in pixels. + 11 - PRIM_MEDIA_HOME_URL + PARCEL_FLAG_ALLOW_ALL_OBJECT_ENTRY + tooltip + type integer value - 3 - tooltip - String. Gets/Sets the home URL for the chosen face. 1024 characters maximum. + 0x08000000 - PRIM_MEDIA_MAX_HEIGHT_PIXELS + PARCEL_FLAG_ALLOW_CREATE_GROUP_OBJECTS + tooltip + type integer value - 2048 - tooltip - + 0x4000000 - PRIM_MEDIA_MAX_URL_LENGTH + PARCEL_FLAG_ALLOW_CREATE_OBJECTS + tooltip + type integer value - 1024 - tooltip - + 0x40 - PRIM_MEDIA_MAX_WHITELIST_COUNT + PARCEL_FLAG_ALLOW_DAMAGE + tooltip + type integer value - 64 - tooltip - + 0x20 - PRIM_MEDIA_MAX_WHITELIST_SIZE + PARCEL_FLAG_ALLOW_FLY + tooltip + type integer value - 1024 - tooltip - + 0x1 - PRIM_MEDIA_MAX_WIDTH_PIXELS + PARCEL_FLAG_ALLOW_GROUP_OBJECT_ENTRY + tooltip + type integer value - 2048 - tooltip - + 0x10000000 - PRIM_MEDIA_PARAM_MAX + PARCEL_FLAG_ALLOW_GROUP_SCRIPTS + tooltip + type integer value - 14 - tooltip - + 0x2000000 - PRIM_MEDIA_PERM_ANYONE + PARCEL_FLAG_ALLOW_LANDMARK + tooltip + type integer value - 4 - tooltip - + 0x8 - PRIM_MEDIA_PERM_GROUP + PARCEL_FLAG_ALLOW_SCRIPTS + tooltip + type integer value - 2 - tooltip - + 0x2 - PRIM_MEDIA_PERM_NONE + PARCEL_FLAG_ALLOW_TERRAFORM + tooltip + type integer value - 0 - tooltip - + 0x10 - PRIM_MEDIA_PERM_OWNER + PARCEL_FLAG_LOCAL_SOUND_ONLY + tooltip + type integer value - 1 - tooltip - + 0x8000 - PRIM_MEDIA_PERMS_CONTROL + PARCEL_FLAG_RESTRICT_PUSHOBJECT + tooltip + type integer value - 14 - tooltip - Integer. Gets/Sets the permissions mask that control who can see the media control bar above the object:: PRIM_MEDIA_PERM_ANYONE, PRIM_MEDIA_PERM_GROUP, PRIM_MEDIA_PERM_NONE, PRIM_MEDIA_PERM_OWNER + 0x200000 - PRIM_MEDIA_PERMS_INTERACT + PARCEL_FLAG_USE_ACCESS_GROUP + tooltip + type integer value - 13 - tooltip - Integer. Gets/Sets the permissions mask that control who can interact with the object: PRIM_MEDIA_PERM_ANYONE, PRIM_MEDIA_PERM_GROUP, PRIM_MEDIA_PERM_NONE, PRIM_MEDIA_PERM_OWNER + 0x100 - PRIM_MEDIA_WHITELIST + PARCEL_FLAG_USE_ACCESS_LIST + tooltip + type integer value - 12 - tooltip - String. Gets/Sets the white-list as a string of escaped, comma-separated URLs. This string can hold up to 64 URLs or 1024 characters, whichever comes first. + 0x200 - PRIM_MEDIA_WHITELIST_ENABLE + PARCEL_FLAG_USE_BAN_LIST + tooltip + type integer value - 11 - tooltip - Boolean. Gets/Sets whether navigation is restricted to URLs in PRIM_MEDIA_WHITELIST. + 0x400 - PRIM_MEDIA_WIDTH_PIXELS + PARCEL_FLAG_USE_LAND_PASS_LIST + tooltip + type integer value - 9 - tooltip - Integer. Gets/Sets the width of the media in pixels. + 0x800 - PRIM_NAME + PARCEL_MEDIA_COMMAND_AGENT + tooltip + type integer value - 27 - tooltip - + 7 - PRIM_NORMAL + PARCEL_MEDIA_COMMAND_AUTO_ALIGN + tooltip + type integer value - 37 - tooltip - Prim parameter for materials using integer face, string texture, vector repeats, vector offsets, float rotation_in_radians + 9 - PRIM_OMEGA + PARCEL_MEDIA_COMMAND_DESC + tooltip + Use this to get or set the parcel media description. type integer value - 32 - tooltip - + 12 - PRIM_PHANTOM + PARCEL_MEDIA_COMMAND_LOOP + tooltip + type integer value - 5 - tooltip - + 3 - PRIM_PHYSICS + PARCEL_MEDIA_COMMAND_LOOP_SET + tooltip + Used to get or set the parcel's media looping variable. type integer value - 3 - tooltip - + 13 - PRIM_PHYSICS_SHAPE_CONVEX + PARCEL_MEDIA_COMMAND_PAUSE + tooltip + type integer value - 2 - tooltip - Use the convex hull of the prim shape for physics (this is the default for mesh objects). + 1 - PRIM_PHYSICS_SHAPE_NONE + PARCEL_MEDIA_COMMAND_PLAY + tooltip + type integer value - 1 - tooltip - Ignore this prim in the physics shape. NB: This cannot be applied to the root prim. + 2 - PRIM_PHYSICS_SHAPE_PRIM + PARCEL_MEDIA_COMMAND_SIZE + tooltip + Use this to get or set the parcel media pixel resolution. type integer value - 0 - tooltip - Use the normal prim shape for physics (this is the default for all non-mesh objects). + 11 - PRIM_PHYSICS_SHAPE_TYPE + PARCEL_MEDIA_COMMAND_STOP + tooltip + type integer value - 30 - tooltip - Allows you to set the physics shape type of a prim via lsl. Permitted values are: - PRIM_PHYSICS_SHAPE_NONE, PRIM_PHYSICS_SHAPE_PRIM, PRIM_PHYSICS_SHAPE_CONVEX + 0 - PRIM_POINT_LIGHT + PARCEL_MEDIA_COMMAND_TEXTURE + tooltip + type integer value - 23 - tooltip - + 4 - PRIM_POS_LOCAL + PARCEL_MEDIA_COMMAND_TIME + tooltip + type integer value - 33 - tooltip - + 6 - PRIM_POSITION + PARCEL_MEDIA_COMMAND_TYPE + tooltip + Use this to get or set the parcel media MIME type (e.g. "text/html"). type integer value - 6 - tooltip - + 10 - PRIM_ROT_LOCAL + PARCEL_MEDIA_COMMAND_UNLOAD + tooltip + type integer value - 29 - tooltip - + 8 - PRIM_ROTATION + PARCEL_MEDIA_COMMAND_URL + tooltip + type integer value - 8 - tooltip - + 5 - PRIM_SCULPT_FLAG_INVERT + PASSIVE + tooltip + Static in-world objects. type integer value - 64 - tooltip - Render inside out (inverts the normals). + 0x4 - PRIM_SCULPT_FLAG_MIRROR + PASS_ALWAYS + tooltip + Always pass the event. type integer value - 128 - tooltip - Render an X axis mirror of the sculpty. + 1 - PRIM_SCULPT_TYPE_CYLINDER + PASS_IF_NOT_HANDLED + tooltip + Pass the event if there is no script handling the event in the prim. type integer value - 4 - tooltip - + 0 - PRIM_SCULPT_TYPE_MASK + PASS_NEVER + tooltip + Always pass the event. type integer value - 7 - tooltip - + 2 - PRIM_SCULPT_TYPE_PLANE + PATROL_PAUSE_AT_WAYPOINTS + tooltip + type integer value - 3 - tooltip - + 0 - PRIM_SCULPT_TYPE_SPHERE + PAYMENT_INFO_ON_FILE + tooltip + type integer value - 1 - tooltip - + 1 - PRIM_SCULPT_TYPE_TORUS + PAYMENT_INFO_USED + tooltip + type integer value - 2 - tooltip - + 2 - PRIM_SHINY_HIGH + PAY_DEFAULT + tooltip + type integer value - 3 - tooltip - + -2 - PRIM_SHINY_LOW + PAY_HIDE + tooltip + type integer value - 1 - tooltip - + -1 - PRIM_SHINY_MEDIUM + PERMISSION_ATTACH + tooltip + If this permission is enabled, the object can successfully call llAttachToAvatar to attach to the given avatar. type integer value - 2 - tooltip - + 0x20 - PRIM_SHINY_NONE + PERMISSION_CHANGE_JOINTS + tooltip + (not yet implemented) type integer value - 0 - tooltip - + 0x100 - PRIM_SIZE + PERMISSION_CHANGE_LINKS + tooltip + If this permission is enabled, the object can successfully call llCreateLink, llBreakLink, and llBreakAllLinks to change links to other objects. type integer value - 7 - tooltip - + 0x80 - PRIM_SLICE + PERMISSION_CHANGE_PERMISSIONS + tooltip + (not yet implemented) type integer value - 35 - tooltip - + 0x200 - PRIM_SPECULAR + PERMISSION_CONTROL_CAMERA + tooltip + type integer value - 36 - tooltip - Prim parameter for materials using integer face, string texture, vector repeats, vector offsets, float rotation_in_radians, vector color, integer glossy, integer environment + 0x800 - PRIM_TEMP_ON_REZ + PERMISSION_DEBIT + tooltip + If this permission is enabled, the object can successfully call llGiveMoney or llTransferLindenDollars to debit the owners account. type integer value - 4 - tooltip - + 0x2 - PRIM_TEXGEN + PERMISSION_OVERRIDE_ANIMATIONS + tooltip + Permission to override default animations. type integer value - 22 - tooltip - + 0x8000 - PRIM_TEXGEN_DEFAULT + PERMISSION_RELEASE_OWNERSHIP + tooltip + (not yet implemented) type integer value - 0 - tooltip - + 0x40 - PRIM_TEXGEN_PLANAR + PERMISSION_REMAP_CONTROLS + tooltip + (not yet implemented) type integer value - 1 - tooltip - + 0x8 - PRIM_TEXT + PERMISSION_RETURN_OBJECTS + tooltip + type integer value - 26 - tooltip - + 65536 - PRIM_TEXTURE + PERMISSION_SILENT_ESTATE_MANAGEMENT + tooltip + A script with this permission does not notify the object owner when it modifies estate access rules via llManageEstateAccess. type integer value - 17 - tooltip - + 0x4000 - PRIM_TYPE + PERMISSION_TAKE_CONTROLS + tooltip + If this permission enabled, the object can successfully call the llTakeControls libray call. type integer value - 9 - tooltip - + 0x4 - PRIM_TYPE_BOX + PERMISSION_TELEPORT + tooltip + type integer value - 0 - tooltip - + 0x1000 - PRIM_TYPE_CYLINDER + PERMISSION_TRACK_CAMERA + tooltip + type integer value - 1 - tooltip - + 0x400 - PRIM_TYPE_PRISM + PERMISSION_TRIGGER_ANIMATION + tooltip + If this permission is enabled, the object can successfully call llStartAnimation for the avatar that owns this. type integer value - 2 - tooltip - + 0x10 - PRIM_TYPE_RING + PERM_ALL + tooltip + type integer value - 6 - tooltip - + 0x7FFFFFFF - PRIM_TYPE_SCULPT + PERM_COPY + tooltip + type integer value - 7 - tooltip - + 0x8000 - PRIM_TYPE_SPHERE + PERM_MODIFY + tooltip + type integer value - 3 - tooltip - + 0x4000 - PRIM_TYPE_TORUS + PERM_MOVE + tooltip + type integer value - 4 - tooltip - + 0x80000 - PRIM_TYPE_TUBE + PERM_TRANSFER + tooltip + type integer value - 5 - tooltip - + 0x2000 - PROFILE_NONE + PI + tooltip + 3.14159265 - The number of radians in a semi-circle. type - integer + float value - 0 - tooltip - Disables profiling + 3.14159265 - PROFILE_SCRIPT_MEMORY + PING_PONG + tooltip + Play animation going forwards, then backwards. type integer value - 1 - tooltip - Enables memory profiling + 0x8 - PSYS_PART_BF_DEST_COLOR + PI_BY_TWO + tooltip + 1.57079633 - The number of radians in a quarter circle. type - integer + float value - 2 - tooltip - + 1.57079633 - PSYS_PART_BF_ONE + PRIM_ALLOW_UNSIT + tooltip + Prim parameter for restricting manual standing for seated avatars in an experience.\nIgnored if the avatar was not seated via a call to llSitOnLink. type integer value - 0 - tooltip - + 39 - PSYS_PART_BF_ONE_MINUS_DEST_COLOR + PRIM_ALPHA_MODE + tooltip + Prim parameter for materials using integer face, integer alpha_mode, integer alpha_cutoff.\nDefines how the alpha channel of the diffuse texture should be rendered.\nValid options for alpha_mode are PRIM_ALPHA_MODE_BLEND, _NONE, _MASK, and _EMISSIVE.\nalpha_cutoff is used only for PRIM_ALPHA_MODE_MASK. type integer value - 4 - tooltip - + 38 - PSYS_PART_BF_ONE_MINUS_SOURCE_COLOR + PRIM_ALPHA_MODE_BLEND + tooltip + Prim parameter setting for PRIM_ALPHA_MODE.\nIndicates that the diffuse texture's alpha channel should be rendered as alpha-blended. type integer value - 5 - tooltip - + 1 - PSYS_PART_BF_ONE_MINUS_SOURCE_ALPHA + PRIM_ALPHA_MODE_EMISSIVE + tooltip + Prim parameter setting for PRIM_ALPHA_MODE.\nIndicates that the diffuse texture's alpha channel should be rendered as an emissivity mask. type integer value - 9 - tooltip - + 3 - PSYS_PART_BF_SOURCE_ALPHA + PRIM_ALPHA_MODE_MASK + tooltip + Prim parameter setting for PRIM_ALPHA_MODE.\nIndicates that the diffuse texture's alpha channel should be rendered as fully opaque for alpha values above alpha_cutoff and fully transparent otherwise. type integer value - 7 - tooltip - + 2 - PSYS_PART_BF_SOURCE_COLOR + PRIM_ALPHA_MODE_NONE + tooltip + Prim parameter setting for PRIM_ALPHA_MODE.\nIndicates that the diffuse texture's alpha channel should be ignored. type integer value - 3 - tooltip - + 0 - PSYS_PART_BF_ZERO + PRIM_BUMP_BARK + tooltip + type integer value - 1 - tooltip - + 4 - PSYS_PART_BLEND_FUNC_DEST + PRIM_BUMP_BLOBS + tooltip + type integer value - 25 - tooltip - + 12 - PSYS_PART_BLEND_FUNC_SOURCE + PRIM_BUMP_BRICKS + tooltip + type integer value - 24 - tooltip - + 5 - PSYS_PART_BOUNCE_MASK + PRIM_BUMP_BRIGHT + tooltip + type integer value - 0x4 - tooltip - Particles bounce off of a plane at the objects Z height. + 1 - PSYS_PART_EMISSIVE_MASK + PRIM_BUMP_CHECKER + tooltip + type integer value - 0x100 - tooltip - The particle glows. + 6 - PSYS_PART_END_ALPHA + PRIM_BUMP_CONCRETE + tooltip + type integer value - 4 - tooltip - A float which determines the ending alpha of the object. + 7 - PSYS_PART_END_COLOR + PRIM_BUMP_DARK + tooltip + type integer value - 3 - tooltip - A vector <r, g, b> which determines the ending color of the object. + 2 - PSYS_PART_END_GLOW + PRIM_BUMP_DISKS + tooltip + type integer value - 27 - tooltip - + 10 - PSYS_PART_END_SCALE + PRIM_BUMP_GRAVEL + tooltip + type integer value - 6 - tooltip - A vector <sx, sy, z>, which is the ending size of the particle billboard in meters (z is ignored). + 11 - PSYS_PART_FLAGS + PRIM_BUMP_LARGETILE + tooltip + type integer value - 0 - tooltip - Each particle that is emitted by the particle system is simulated based on the following flags. To use multiple flags, bitwise or (|) them together. + 14 - PSYS_PART_FOLLOW_SRC_MASK + PRIM_BUMP_NONE + tooltip + type integer value - 0x10 - tooltip - The particle position is relative to the source objects position. + 0 - PSYS_PART_FOLLOW_VELOCITY_MASK + PRIM_BUMP_SHINY + tooltip + type integer value - 0x20 - tooltip - The particle orientation is rotated so the vertical axis faces towards the particle velocity. + 19 - PSYS_PART_INTERP_COLOR_MASK + PRIM_BUMP_SIDING + tooltip + type integer value - 0x1 - tooltip - Interpolate both the color and alpha from the start value to the end value. + 13 - PSYS_PART_INTERP_SCALE_MASK + PRIM_BUMP_STONE + tooltip + type integer value - 0x2 - tooltip - Interpolate the particle scale from the start value to the end value. + 9 - PSYS_PART_MAX_AGE + PRIM_BUMP_STUCCO + tooltip + type integer value - 7 - tooltip - Age in seconds of a particle at which it dies. + 15 - PSYS_PART_RIBBON_MASK + PRIM_BUMP_SUCTION + tooltip + type integer value - 0x400 - tooltip - + 16 - PSYS_PART_START_ALPHA + PRIM_BUMP_TILE + tooltip + type integer value - 2 - tooltip - A float which determines the starting alpha of the object. + 8 - PSYS_PART_START_COLOR + PRIM_BUMP_WEAVE + tooltip + type integer value - 1 - tooltip - A vector <r.r, g.g, b.b> which determines the starting color of the object. + 17 - PSYS_PART_START_GLOW + PRIM_BUMP_WOOD + tooltip + type integer value - 26 - tooltip - + 3 - PSYS_PART_START_SCALE + PRIM_CAST_SHADOWS + deprecated + 1 + tooltip + type integer value - 5 - tooltip - A vector <sx, sy, z>, which is the starting size of the particle billboard in meters (z is ignored). + 24 - PSYS_PART_TARGET_LINEAR_MASK + PRIM_CLICK_ACTION + tooltip + type integer value - 0x80 - tooltip - + 43 - PSYS_PART_TARGET_POS_MASK + PRIM_COLLISION_SOUND + tooltip + Collision sound uuid and volume for this prim type integer value - 0x40 - tooltip - The particle heads towards the location of the target object as defined by PSYS_SRC_TARGET_KEY. + 53 - PSYS_PART_WIND_MASK + PRIM_COLOR + tooltip + type integer value - 0x8 - tooltip - Particles have their velocity damped towards the wind velocity. + 18 - PSYS_SRC_ACCEL + PRIM_DAMAGE + tooltip + Damage and damage type assigned to this prim. type integer value - 8 - tooltip - A vector <x, y, z> which is the acceleration to apply on particles. + 51 - PSYS_SRC_ANGLE_BEGIN + PRIM_DESC + tooltip + type integer value - 22 - tooltip - Area in radians specifying where particles will NOT be created (for ANGLE patterns) + 28 - PSYS_SRC_ANGLE_END + PRIM_FLEXIBLE + tooltip + type integer value - 23 - tooltip - Area in radians filled with particles (for ANGLE patterns) (if lower than PSYS_SRC_ANGLE_BEGIN, acts as PSYS_SRC_ANGLE_BEGIN itself, and PSYS_SRC_ANGLE_BEGIN acts as PSYS_SRC_ANGLE_END). + 21 - PSYS_SRC_BURST_PART_COUNT + PRIM_FULLBRIGHT + tooltip + type integer value - 15 - tooltip - How many particles to release in a burst. + 20 - PSYS_SRC_BURST_RADIUS + PRIM_GLOW + tooltip + PRIM_GLOW is used to get or set the glow status of the face. type integer value - 16 - tooltip - What distance from the center of the object to create the particles. + 25 - PSYS_SRC_BURST_RATE + PRIM_GLTF_ALPHA_MODE_BLEND + tooltip + Prim parameter setting for PRIM_GLTF_BASE_COLOR alpha mode "BLEND". type integer value - 13 - tooltip - How often to release a particle burst (float seconds). + 1 - PSYS_SRC_BURST_SPEED_MAX + PRIM_GLTF_ALPHA_MODE_MASK + tooltip + Prim parameter setting for PRIM_GLTF_BASE_COLOR alpha mode "MASK". type integer value - 18 - tooltip - Maximum speed that a particle should be moving. + 2 - PSYS_SRC_BURST_SPEED_MIN + PRIM_GLTF_ALPHA_MODE_OPAQUE + tooltip + Prim parameter setting for PRIM_GLTF_BASE_COLOR alpha mode "OPAQUE". type integer value - 17 - tooltip - Minimum speed that a particle should be moving. + 0 - PSYS_SRC_INNERANGLE + PRIM_GLTF_BASE_COLOR + tooltip + Prim parameter for materials using integer face, string texture, vector repeats, vector offsets, float rotation_in_radians, vector color, integer alpha_mode, integer alpha_cutoff, boolean double_sided.\nValid options for alpha_mode are PRIM_ALPHA_MODE_BLEND, _NONE, and _MASK.\nalpha_cutoff is used only for PRIM_ALPHA_MODE_MASK. type integer value - 10 - tooltip - Specifies the inner angle of the arc created by the PSYS_SRC_PATTERN_ANGLE or PSYS_SRC_PATTERN_ANGLE_CONE source pattern. - The area specified will NOT have particles in it. + 48 - PSYS_SRC_MAX_AGE + PRIM_GLTF_EMISSIVE + tooltip + Prim parameter for GLTF materials using integer face, string texture, vector repeats, vector offsets, float rotation_in_radians, vector color type integer value - 19 - tooltip - How long this particle system should last, 0.0 means forever. + 46 - PSYS_SRC_OMEGA + PRIM_GLTF_METALLIC_ROUGHNESS + tooltip + Prim parameter for GLTF materials using integer face, string texture, vector repeats, vector offsets, float rotation_in_radians, float metallic_factor, float roughness_factor type integer value - 21 - tooltip - Sets the angular velocity to rotate the axis that SRC_PATTERN_ANGLE and SRC_PATTERN_ANGLE_CONE use. + 47 - PSYS_SRC_OUTERANGLE + PRIM_GLTF_NORMAL + tooltip + Prim parameter for GLTF materials using integer face, string texture, vector repeats, vector offsets, float rotation_in_radians type integer value - 11 - tooltip - Specifies the outer angle of the arc created by the PSYS_SRC_PATTERN_ANGLE or PSYS_SRC_PATTERN_ANGLE_CONE source pattern. - The area between the outer and inner angle will be filled with particles. + 45 - PSYS_SRC_PATTERN + PRIM_HEALTH + tooltip + Health value for this prim type integer value - 9 - tooltip - The pattern which is used to generate particles. - Use one of the following values: PSYS_SRC_PATTERN Values. + 52 - PSYS_SRC_PATTERN_ANGLE + PRIM_HOLE_CIRCLE + tooltip + type integer value - 0x04 - tooltip - Shoot particles across a 2 dimensional area defined by the arc created from PSYS_SRC_OUTERANGLE. There will be an open area defined by PSYS_SRC_INNERANGLE within the larger arc. + 0x10 - PSYS_SRC_PATTERN_ANGLE_CONE + PRIM_HOLE_DEFAULT + tooltip + type integer value - 0x08 - tooltip - Shoot particles out in a 3 dimensional cone with an outer arc of PSYS_SRC_OUTERANGLE and an inner open area defined by PSYS_SRC_INNERANGLE. + 0x00 - PSYS_SRC_PATTERN_ANGLE_CONE_EMPTY + PRIM_HOLE_SQUARE + tooltip + type integer value - 0x10 - tooltip - + 0x20 - PSYS_SRC_PATTERN_DROP + PRIM_HOLE_TRIANGLE + tooltip + type integer value - 0x01 - tooltip - Drop particles at the source position. + 0x30 - PSYS_SRC_PATTERN_EXPLODE + PRIM_LINK_TARGET + tooltip + type integer value - 0x02 - tooltip - Shoot particles out in all directions, using the burst parameters. + 34 - PSYS_SRC_TARGET_KEY + PRIM_MATERIAL + tooltip + type integer value - 20 - tooltip - The key of a target object to move towards if PSYS_PART_TARGET_POS_MASK is enabled. + 2 - PSYS_SRC_TEXTURE + PRIM_MATERIAL_FLESH + tooltip + type integer value - 12 - tooltip - An asset name for the texture to use for the particles. + 4 - PU_EVADE_HIDDEN + PRIM_MATERIAL_GLASS + tooltip + type integer value - 0x07 - tooltip - Triggered when an llEvade character thinks it has hidden from its pursuer. + 2 - PU_EVADE_SPOTTED + PRIM_MATERIAL_LIGHT + tooltip + type integer value - 0x08 - tooltip - Triggered when an llEvade character switches from hiding to running + 7 - PU_FAILURE_DYNAMIC_PATHFINDING_DISABLED + PRIM_MATERIAL_METAL + tooltip + type integer value - 10 - tooltip - + 1 - PU_FAILURE_INVALID_GOAL + PRIM_MATERIAL_PLASTIC + tooltip + type integer value - 0x03 - tooltip - Goal is not on the navigation-mesh and cannot be reached. + 5 - PU_FAILURE_INVALID_START + PRIM_MATERIAL_RUBBER + tooltip + type integer value - 0x02 - tooltip - Character cannot navigate from the current location - e.g., the character is off the navmesh or too high above it. + 6 - PU_FAILURE_NO_NAVMESH + PRIM_MATERIAL_STONE + tooltip + type integer value - 0x09 - tooltip - This is a fatal error reported to a character when there is no navmesh for the region. This usually indicates a server failure and users should file a bug report and include the time and region in which they received this message. + 0 - PU_FAILURE_NO_VALID_DESTINATION + PRIM_MATERIAL_WOOD + tooltip + type integer value - 0x06 - tooltip - There is no good place for the character to go - e.g., it is patrolling and all the patrol points are now unreachable. + 3 - PU_FAILURE_OTHER + PRIM_MEDIA_ALT_IMAGE_ENABLE + tooltip + Boolean. Gets/Sets the default image state (the image that the user sees before a piece of media is active) for the chosen face. The default image is specified by Second Life's server for that media type. type integer value - 1000000 - tooltip - + 0 - PU_FAILURE_PARCEL_UNREACHABLE + PRIM_MEDIA_AUTO_LOOP + tooltip + Boolean. Gets/Sets whether auto-looping is enabled. type integer value - 11 - tooltip - + 4 - PU_FAILURE_TARGET_GONE + PRIM_MEDIA_AUTO_PLAY + tooltip + Boolean. Gets/Sets whether the media auto-plays when a Resident can view it. type integer value - 0x05 - tooltip - Target (for llPursue or llEvade) can no longer be tracked - e.g., it left the region or is an avatar that is now more than about 30m outside the region. + 5 - PU_FAILURE_UNREACHABLE + PRIM_MEDIA_AUTO_SCALE + tooltip + Boolean. Gets/Sets whether auto-scaling is enabled. Auto-scaling forces the media to the full size of the texture. type integer value - 0x04 - tooltip - Goal is no longer reachable for some reason - e.g., an obstacle blocks the path. + 6 - PU_GOAL_REACHED + PRIM_MEDIA_AUTO_ZOOM + tooltip + Boolean. Gets/Sets whether clicking the media triggers auto-zoom and auto-focus on the media. type integer value - 0x01 - tooltip - Character has reached the goal and will stop or choose a new goal (if wandering). + 7 - PU_SLOWDOWN_DISTANCE_REACHED + PRIM_MEDIA_CONTROLS + tooltip + Integer. Gets/Sets the style of controls. Can be either PRIM_MEDIA_CONTROLS_STANDARD or PRIM_MEDIA_CONTROLS_MINI. type integer value - 0x00 - tooltip - Character is near current goal. + 1 - PUBLIC_CHANNEL + PRIM_MEDIA_CONTROLS_MINI + tooltip + Mini web navigation controls; does not include an address bar. type integer value - 0 - tooltip - PUBLIC_CHANNEL is an integer constant that, when passed to llSay, llWhisper, or llShout as a channel parameter, will print text to the publicly heard chat channel. + 1 - PURSUIT_FUZZ_FACTOR + PRIM_MEDIA_CONTROLS_STANDARD + tooltip + Standard web navigation controls. type integer value - 3 - tooltip - Selects a random destination near the offset. + 0 - PURSUIT_GOAL_TOLERANCE + PRIM_MEDIA_CURRENT_URL + tooltip + String. Gets/Sets the current url displayed on the chosen face. Changing this URL causes navigation. 1024 characters Maximum. type integer value - 5 - tooltip - + 2 - PURSUIT_INTERCEPT + PRIM_MEDIA_FIRST_CLICK_INTERACT + tooltip + Boolean. Gets/Sets whether the first click interaction is enabled. type integer value - 4 - tooltip - Define whether the character attempts to predict the target's location. + 8 - PURSUIT_OFFSET + PRIM_MEDIA_HEIGHT_PIXELS + tooltip + Integer. Gets/Sets the height of the media in pixels. type integer value - 1 - tooltip - Go to a position offset from the target. + 10 - RAD_TO_DEG + PRIM_MEDIA_HOME_URL + tooltip + String. Gets/Sets the home URL for the chosen face. 1024 characters maximum. type - float + integer value - 57.2957795 - tooltip - 57.2957795 - Number of degrees per radian. You can use this number to convert radians to degrees by multiplying the radians by this number. + 3 - RC_DATA_FLAGS + PRIM_MEDIA_MAX_HEIGHT_PIXELS + tooltip + type integer value - 2 - tooltip - + 2048 - RC_DETECT_PHANTOM + PRIM_MEDIA_MAX_URL_LENGTH + tooltip + type integer value - 1 - tooltip - + 1024 - RC_GET_LINK_NUM + PRIM_MEDIA_MAX_WHITELIST_COUNT + tooltip + type integer value - 4 - tooltip - + 64 - RC_GET_NORMAL + PRIM_MEDIA_MAX_WHITELIST_SIZE + tooltip + type integer value - 1 - tooltip - + 1024 - RC_GET_ROOT_KEY + PRIM_MEDIA_MAX_WIDTH_PIXELS + tooltip + type integer value - 2 - tooltip - + 2048 - RC_MAX_HITS + PRIM_MEDIA_PARAM_MAX + tooltip + type integer value - 3 - tooltip - + 14 - RC_REJECT_AGENTS + PRIM_MEDIA_PERMS_CONTROL + tooltip + Integer. Gets/Sets the permissions mask that control who can see the media control bar above the object:: PRIM_MEDIA_PERM_ANYONE, PRIM_MEDIA_PERM_GROUP, PRIM_MEDIA_PERM_NONE, PRIM_MEDIA_PERM_OWNER type integer value - 1 - tooltip - + 14 - RC_REJECT_LAND + PRIM_MEDIA_PERMS_INTERACT + tooltip + Integer. Gets/Sets the permissions mask that control who can interact with the object: PRIM_MEDIA_PERM_ANYONE, PRIM_MEDIA_PERM_GROUP, PRIM_MEDIA_PERM_NONE, PRIM_MEDIA_PERM_OWNER type integer value - 8 - tooltip - + 13 - RC_REJECT_NONPHYSICAL + PRIM_MEDIA_PERM_ANYONE + tooltip + type integer value - 4 - tooltip - + 4 - RC_REJECT_PHYSICAL + PRIM_MEDIA_PERM_GROUP + tooltip + type integer value - 2 - tooltip - + 2 - RC_REJECT_TYPES + PRIM_MEDIA_PERM_NONE + tooltip + type integer value - 0 - tooltip - + 0 - RCERR_CAST_TIME_EXCEEDED + PRIM_MEDIA_PERM_OWNER + tooltip + type integer value - -3 - tooltip - + 1 - RCERR_SIM_PERF_LOW + PRIM_MEDIA_WHITELIST + tooltip + String. Gets/Sets the white-list as a string of escaped, comma-separated URLs. This string can hold up to 64 URLs or 1024 characters, whichever comes first. type integer value - -2 - tooltip - + 12 - RCERR_UNKNOWN + PRIM_MEDIA_WHITELIST_ENABLE + tooltip + Boolean. Gets/Sets whether navigation is restricted to URLs in PRIM_MEDIA_WHITELIST. type integer value - -1 - tooltip - + 11 - REGION_FLAG_ALLOW_DAMAGE + PRIM_MEDIA_WIDTH_PIXELS + tooltip + Integer. Gets/Sets the width of the media in pixels. type integer value - 0x1 - tooltip - + 9 - REGION_FLAG_ALLOW_DIRECT_TELEPORT + PRIM_NAME + tooltip + type integer value - 0x100000 - tooltip - + 27 - REGION_FLAG_BLOCK_FLY + PRIM_NORMAL + tooltip + Prim parameter for materials using integer face, string texture, vector repeats, vector offsets, float rotation_in_radians type integer value - 0x80000 - tooltip - + 37 - REGION_FLAG_BLOCK_FLYOVER + PRIM_OMEGA + tooltip + type integer value - 0x8000000 - tooltip - + 32 - REGION_FLAG_BLOCK_TERRAFORM + PRIM_PHANTOM + tooltip + type integer value - 0x40 - tooltip - + 5 - REGION_FLAG_DISABLE_COLLISIONS + PRIM_PHYSICS + tooltip + type integer value - 0x1000 - tooltip - + 3 - REGION_FLAG_DISABLE_PHYSICS + PRIM_PHYSICS_SHAPE_CONVEX + tooltip + Use the convex hull of the prim shape for physics (this is the default for mesh objects). type integer value - 0x4000 - tooltip - + 2 - REGION_FLAG_FIXED_SUN + PRIM_PHYSICS_SHAPE_NONE + tooltip + Ignore this prim in the physics shape. NB: This cannot be applied to the root prim. type integer value - 0x10 - tooltip - + 1 - REGION_FLAG_RESTRICT_PUSHOBJECT + PRIM_PHYSICS_SHAPE_PRIM + tooltip + Use the normal prim shape for physics (this is the default for all non-mesh objects). type integer value - 0x400000 - tooltip - + 0 - REGION_FLAG_SANDBOX + PRIM_PHYSICS_SHAPE_TYPE + tooltip + + Allows you to set the physics shape type of a prim via lsl. Permitted values are: + PRIM_PHYSICS_SHAPE_NONE, PRIM_PHYSICS_SHAPE_PRIM, PRIM_PHYSICS_SHAPE_CONVEX + type integer value - 0x100 - tooltip - + 30 - REMOTE_DATA_CHANNEL + PRIM_POINT_LIGHT + tooltip + type integer value - 1 - tooltip - + 23 - REMOTE_DATA_REPLY + PRIM_POSITION + tooltip + type integer value - 3 - tooltip - + 6 - REMOTE_DATA_REQUEST + PRIM_POS_LOCAL + tooltip + type integer value - 2 - tooltip - + 33 - REQUIRE_LINE_OF_SIGHT + PRIM_PROJECTOR + tooltip + type integer value - 2 - tooltip - Define whether the character needs a line-of-sight to give chase. + 42 - RESTITUTION + PRIM_REFLECTION_PROBE + tooltip + Allows you to configure the object as a custom-placed reflection probe, for image-based lighting (IBL). Only objects in the influence volume of the reflection probe object are affected. type integer value - 4 - tooltip - Used with llSetPhysicsMaterial to enable the density value. Must be between 0.0 and 1.0 + 44 - REVERSE + PRIM_REFLECTION_PROBE_BOX + tooltip + This is a flag option used with llGetPrimitiveParams and related functions when the parameter is PRIM_REFLECTION_PROBE. When set, the reflection probe is a box. When unset, the reflection probe is a sphere. type integer value - 0x4 - tooltip - Play animation in reverse direction. + 1 - ROTATE + PRIM_REFLECTION_PROBE_DYNAMIC + tooltip + This is a flag option used with llGetPrimitiveParams and related functions when the parameter is PRIM_REFLECTION_PROBE. When set, the reflection probe includes avatars in IBL effects. When unset, the reflection probe excludes avatars. type integer value - 0x20 - tooltip - Animate texture rotation. + 2 - SCALE + PRIM_REFLECTION_PROBE_MIRROR + tooltip + This is a flag option used with llGetPrimitiveParams and related functions when the parameter is PRIM_REFLECTION_PROBE. When set, the reflection probe acts as a mirror. type integer value - 0x40 - tooltip - Animate the texture scale. + 4 - SCRIPTED + PRIM_RENDER_MATERIAL + tooltip + type integer value - 0x8 - tooltip - Scripted in-world objects. + 49 - SIM_STAT_PCT_CHARS_STEPPED + PRIM_ROTATION + tooltip + type integer value - 0 - tooltip - Returns the % of pathfinding characters skipped each frame, averaged over the last minute.\nThe returned value corresponds to the "Characters Updated" stat in the viewer's Statistics Bar. + 8 - SMOOTH + PRIM_ROT_LOCAL + tooltip + type integer value - 0x10 - tooltip - Slide in the X direction, instead of playing separate frames. + 29 - SQRT2 + PRIM_SCRIPTED_SIT_ONLY + tooltip + Prim parameter for restricting manual sitting on this prim.\nSitting must be initiated via call to llSitOnLink. type - float + integer value - 1.41421356 - tooltip - 1.41421356 - The square root of 2. + 40 - STATUS_BLOCK_GRAB + PRIM_SCULPT_FLAG_ANIMESH + tooltip + Mesh is animated. type integer value - 0x40 - tooltip - Controls whether the object can be grabbed.\nA grab is the default action when in third person, and is available as the hand tool in build mode. This is useful for physical objects that you don't want other people to be able to trivially disturb. The default is FALSE + 32 - STATUS_BLOCK_GRAB_OBJECT + PRIM_SCULPT_FLAG_INVERT + tooltip + Render inside out (inverts the normals). type integer value - 0x400 - tooltip - Prevent click-and-drag movement on all prims in the object. + 64 - STATUS_BOUNDS_ERROR + PRIM_SCULPT_FLAG_MIRROR + tooltip + Render an X axis mirror of the sculpty. type integer value - 1002 - tooltip - Argument(s) passed to function had a bounds error. + 128 - STATUS_CAST_SHADOWS + PRIM_SCULPT_TYPE_CYLINDER + tooltip + type integer value - 0x200 - tooltip - + 4 - STATUS_DIE_AT_EDGE + PRIM_SCULPT_TYPE_MASK + tooltip + type integer value - 0x80 - tooltip - Controls whether the object is returned to the owners inventory if it wanders off the edge of the world.\nIt is useful to set this status TRUE for things like bullets or rockets. The default is TRUE + 7 - STATUS_INTERNAL_ERROR + PRIM_SCULPT_TYPE_MESH + tooltip + type integer value - 1999 - tooltip - An internal error occurred. + 5 - STATUS_MALFORMED_PARAMS + PRIM_SCULPT_TYPE_PLANE + tooltip + type integer value - 1000 - tooltip - Function was called with malformed parameters. + 3 - STATUS_NOT_FOUND + PRIM_SCULPT_TYPE_SPHERE + tooltip + type integer value - 1003 - tooltip - Object or other item was not found. + 1 - STATUS_NOT_SUPPORTED + PRIM_SCULPT_TYPE_TORUS + tooltip + type integer value - 1004 - tooltip - Feature not supported. + 2 - STATUS_OK + PRIM_SHINY_HIGH + tooltip + type integer value - 0 - tooltip - Result of function call was a success. + 3 - STATUS_PHANTOM + PRIM_SHINY_LOW + tooltip + type integer value - 0x10 - tooltip - Controls/indicates whether the object collides or not.\nSetting the value to TRUE makes the object non-colliding with all objects. It is a good idea to use this for most objects that move or rotate, but are non-physical. It is also useful for simulating volumetric lighting. The default is FALSE. + 1 - STATUS_PHYSICS + PRIM_SHINY_MEDIUM + tooltip + type integer value - 0x1 - tooltip - Controls/indicates whether the object moves physically.\nThis controls the same flag that the UI check-box for Physical controls. The default is FALSE. + 2 - STATUS_RETURN_AT_EDGE + PRIM_SHINY_NONE + tooltip + type integer value - 0x100 - tooltip - + 0 - STATUS_ROTATE_X + PRIM_SIT_FLAGS + tooltip + type integer value - 0x2 - tooltip - + 50 - STATUS_ROTATE_Y + PRIM_SIT_TARGET + tooltip + type integer value - 0x4 - tooltip - + 41 - STATUS_ROTATE_Z + PRIM_SIZE + tooltip + type integer value - 0x8 - tooltip - Controls/indicates whether the object can physically rotate around - the specific axis or not. This flag has no meaning - for non-physical objects. Set the value to FALSE - if you want to disable rotation around that axis. The - default is TRUE for a physical object. - A useful example to think about when visualizing - the effect is a sit-and-spin device. They spin around the - Z axis (up) but not around the X or Y axis. + 7 - STATUS_SANDBOX + PRIM_SLICE + tooltip + type integer value - 0x20 - tooltip - Controls/indicates whether the object can cross region boundaries - and move more than 20 meters from its creation - point. The default if FALSE. + 35 - STATUS_TYPE_MISMATCH + PRIM_SPECULAR + tooltip + Prim parameter for materials using integer face, string texture, vector repeats, vector offsets, float rotation_in_radians, vector color, integer glossy, integer environment type integer value - 1001 - tooltip - Argument(s) passed to function had a type mismatch. + 36 - STATUS_WHITELIST_FAILED + PRIM_TEMP_ON_REZ + tooltip + type integer value - 2001 - tooltip - Whitelist Failed. + 4 - STRING_TRIM + PRIM_TEXGEN + tooltip + type integer value - 0x03 - tooltip - + 22 - STRING_TRIM_HEAD + PRIM_TEXGEN_DEFAULT + tooltip + type integer value - 0x01 - tooltip - + 0 - STRING_TRIM_TAIL + PRIM_TEXGEN_PLANAR + tooltip + type integer value - 0x02 - tooltip - + 1 - TEXTURE_BLANK + PRIM_TEXT + tooltip + type - string + integer value - 5748decc-f629-461c-9a36-a35a221fe21f - tooltip - + 26 - TEXTURE_DEFAULT + PRIM_TEXTURE + tooltip + type - string + integer value - 89556747-24cb-43ed-920b-47caed15465f - tooltip - + 17 - TEXTURE_MEDIA + PRIM_TYPE + tooltip + type - string + integer value - 8b5fec65-8d8d-9dc5-cda8-8fdf2716e361 - tooltip - + 9 - TEXTURE_PLYWOOD + PRIM_TYPE_BOX + tooltip + type - string + integer value - 89556747-24cb-43ed-920b-47caed15465f - tooltip - + 0 - TEXTURE_TRANSPARENT + PRIM_TYPE_CYLINDER + tooltip + type - string + integer value - 8dcd4a48-2d37-4909-9f78-f7a9eb4ef903 - tooltip - + 1 - TOUCH_INVALID_FACE + PRIM_TYPE_PRISM + tooltip + type integer value - 0xFFFFFFFF - tooltip - + 2 - TOUCH_INVALID_TEXCOORD + PRIM_TYPE_RING + tooltip + type - vector + integer value - <-1.0, -1.0, 0.0> - tooltip - + 6 - TOUCH_INVALID_VECTOR + PRIM_TYPE_SCULPT + tooltip + type - vector + integer value - <0.0, 0.0, 0.0> - tooltip - + 7 - TRAVERSAL_TYPE + PRIM_TYPE_SPHERE + tooltip + type integer value - 7 - tooltip - One of TRAVERSAL_TYPE_FAST, TRAVERSAL_TYPE_SLOW, and TRAVERSAL_TYPE_NONE. + 3 - TRAVERSAL_TYPE_FAST + PRIM_TYPE_TORUS + tooltip + type integer value - 1 - tooltip - + 4 - TRAVERSAL_TYPE_NONE + PRIM_TYPE_TUBE + tooltip + type integer value - 2 - tooltip - + 5 - TRAVERSAL_TYPE_SLOW + PROFILE_NONE + tooltip + Disables profiling type integer value - 0 - tooltip - + 0 - TRUE + PROFILE_SCRIPT_MEMORY + tooltip + Enables memory profiling type integer value - 1 - tooltip - An integer constant for boolean comparisons. Has the value '1'. + 1 - TWO_PI + PSYS_PART_BF_DEST_COLOR + tooltip + type - float + integer value - 6.28318530 - tooltip - 6.28318530 - The radians of a circle. + 2 - TYPE_FLOAT + PSYS_PART_BF_ONE + tooltip + type integer value - 2 - tooltip - The list entry is a float. + 0 - TYPE_INTEGER + PSYS_PART_BF_ONE_MINUS_DEST_COLOR + tooltip + type integer value - 1 - tooltip - The list entry is an integer. + 4 - TYPE_INVALID + PSYS_PART_BF_ONE_MINUS_SOURCE_ALPHA + tooltip + type integer value - 0 - tooltip - The list entry is invalid. + 9 - TYPE_KEY + PSYS_PART_BF_ONE_MINUS_SOURCE_COLOR + tooltip + type integer value - 4 - tooltip - The list entry is a key. + 5 - TYPE_ROTATION + PSYS_PART_BF_SOURCE_ALPHA + tooltip + type integer value - 6 - tooltip - The list entry is a rotation. + 7 - TYPE_STRING + PSYS_PART_BF_SOURCE_COLOR + tooltip + type integer value - 3 - tooltip - The list entry is a string. + 3 - TYPE_VECTOR + PSYS_PART_BF_ZERO + tooltip + type integer value - 5 - tooltip - The list entry is a vector. + 1 - URL_REQUEST_DENIED + PSYS_PART_BLEND_FUNC_DEST - type - string - value - URL_REQUEST_DENIED tooltip - - - URL_REQUEST_GRANTED - + type - string + integer value - URL_REQUEST_GRANTED - tooltip - + 25 - VEHICLE_ANGULAR_DEFLECTION_EFFICIENCY + PSYS_PART_BLEND_FUNC_SOURCE + tooltip + type integer value - 32 - tooltip - A slider between minimum (0.0) and maximum (1.0) deflection of angular orientation. That is, its a simple scalar for modulating the strength of angular deflection such that the vehicles preferred axis of motion points toward its real velocity. + 24 - VEHICLE_ANGULAR_DEFLECTION_TIMESCALE + PSYS_PART_BOUNCE_MASK + tooltip + Particles bounce off of a plane at the objects Z height. type integer value - 33 - tooltip - The time-scale for exponential success of linear deflection deflection. Its another way to specify the strength of the vehicles tendency to reorient itself so that its preferred axis of motion agrees with its true velocity. + 0x4 - VEHICLE_ANGULAR_FRICTION_TIMESCALE + PSYS_PART_EMISSIVE_MASK + tooltip + The particle glows. type integer value - 17 - tooltip - A vector of timescales for exponential decay of the vehicles angular velocity about its preferred axes of motion (at, left, up). - Range = [0.07, inf) seconds for each element of the vector. + 0x100 - VEHICLE_ANGULAR_MOTOR_DECAY_TIMESCALE + PSYS_PART_END_ALPHA + tooltip + A float which determines the ending alpha of the object. type integer value - 35 - tooltip - The timescale for exponential decay of the angular motors magnitude. + 4 - VEHICLE_ANGULAR_MOTOR_DIRECTION + PSYS_PART_END_COLOR + tooltip + A vector <r, g, b> which determines the ending color of the object. type integer value - 19 - tooltip - The direction and magnitude (in preferred frame) of the vehicles angular motor.The vehicle will accelerate (or decelerate if necessary) to match its velocity to its motor. + 3 - VEHICLE_ANGULAR_MOTOR_TIMESCALE + PSYS_PART_END_GLOW + tooltip + type integer value - 34 - tooltip - The timescale for exponential approach to full angular motor velocity. + 27 - VEHICLE_BANKING_EFFICIENCY + PSYS_PART_END_SCALE + tooltip + A vector <sx, sy, z>, which is the ending size of the particle billboard in meters (z is ignored). type integer value - 38 - tooltip - A slider between anti (-1.0), none (0.0), and maxmum (1.0) banking strength. + 6 - VEHICLE_BANKING_MIX + PSYS_PART_FLAGS + tooltip + Each particle that is emitted by the particle system is simulated based on the following flags. To use multiple flags, bitwise or (|) them together. type integer value - 39 - tooltip - A slider between static (0.0) and dynamic (1.0) banking. "Static" means the banking scales only with the angle of roll, whereas "dynamic" is a term that also scales with the vehicles linear speed. + 0 - VEHICLE_BANKING_TIMESCALE + PSYS_PART_FOLLOW_SRC_MASK + tooltip + The particle position is relative to the source objects position. type integer value - 40 - tooltip - The timescale for banking to exponentially approach its maximum effect. This is another way to scale the strength of the banking effect, however it affects the term that is proportional to the difference between what the banking behavior is trying to do, and what the vehicle is actually doing. + 0x10 - VEHICLE_BUOYANCY + PSYS_PART_FOLLOW_VELOCITY_MASK + tooltip + The particle orientation is rotated so the vertical axis faces towards the particle velocity. type integer value - 27 - tooltip - A slider between minimum (0.0) and maximum anti-gravity (1.0). + 0x20 - VEHICLE_FLAG_CAMERA_DECOUPLED + PSYS_PART_INTERP_COLOR_MASK + tooltip + Interpolate both the color and alpha from the start value to the end value. type integer value - 0x200 - tooltip - + 0x1 - VEHICLE_FLAG_HOVER_GLOBAL_HEIGHT + PSYS_PART_INTERP_SCALE_MASK + tooltip + Interpolate the particle scale from the start value to the end value. type integer value - 0x10 - tooltip - Hover at global height. + 0x2 - VEHICLE_FLAG_HOVER_TERRAIN_ONLY + PSYS_PART_MAX_AGE + tooltip + Age in seconds of a particle at which it dies. type integer value - 0x8 - tooltip - Ignore water height when hovering. + 7 - VEHICLE_FLAG_HOVER_UP_ONLY + PSYS_PART_RIBBON_MASK + tooltip + type integer value - 0x20 - tooltip - Hover does not push down. Use this flag for hovering vehicles that should be able to jump above their hover height. + 0x400 - VEHICLE_FLAG_HOVER_WATER_ONLY + PSYS_PART_START_ALPHA + tooltip + A float which determines the starting alpha of the object. type integer value - 0x4 - tooltip - Ignore terrain height when hovering. + 2 - VEHICLE_FLAG_LIMIT_MOTOR_UP + PSYS_PART_START_COLOR + tooltip + A vector <r.r, g.g, b.b> which determines the starting color of the object. type integer value - 0x40 - tooltip - Prevents ground vehicles from motoring into the sky. + 1 - VEHICLE_FLAG_LIMIT_ROLL_ONLY + PSYS_PART_START_GLOW + tooltip + type integer value - 0x2 - tooltip - For vehicles with vertical attractor that want to be able to climb/dive, for instance, aeroplanes that want to use the banking feature. + 26 - VEHICLE_FLAG_MOUSELOOK_BANK + PSYS_PART_START_SCALE + tooltip + A vector <sx, sy, z>, which is the starting size of the particle billboard in meters (z is ignored). type integer value - 0x100 - tooltip - + 5 - VEHICLE_FLAG_MOUSELOOK_STEER + PSYS_PART_TARGET_LINEAR_MASK + tooltip + type integer value 0x80 - tooltip - - VEHICLE_FLAG_NO_DEFLECTION_UP + PSYS_PART_TARGET_POS_MASK + tooltip + The particle heads towards the location of the target object as defined by PSYS_SRC_TARGET_KEY. type integer value - 0x1 - tooltip - This flag prevents linear deflection parallel to world z-axis. This is useful for preventing ground vehicles with large linear deflection, like bumper cars, from climbing their linear deflection into the sky. + 0x40 - VEHICLE_FLAG_NO_FLY_UP + PSYS_PART_WIND_MASK - deprecated - true + tooltip + Particles have their velocity damped towards the wind velocity. type integer value - 0x1 - tooltip - Old, changed to VEHICLE_FLAG_NO_DEFLECTION_UP + 0x8 - VEHICLE_HOVER_EFFICIENCY + PSYS_SRC_ACCEL + tooltip + A vector <x, y, z> which is the acceleration to apply on particles. type integer value - 25 - tooltip - A slider between minimum (0.0 = bouncy) and maximum (1.0 = fast as possible) damped motion of the hover behavior. + 8 - VEHICLE_HOVER_HEIGHT + PSYS_SRC_ANGLE_BEGIN + tooltip + Area in radians specifying where particles will NOT be created (for ANGLE patterns) type integer value - 24 - tooltip - The height (above the terrain or water, or global) at which the vehicle will try to hover. + 22 - VEHICLE_HOVER_TIMESCALE + PSYS_SRC_ANGLE_END + tooltip + Area in radians filled with particles (for ANGLE patterns) (if lower than PSYS_SRC_ANGLE_BEGIN, acts as PSYS_SRC_ANGLE_BEGIN itself, and PSYS_SRC_ANGLE_BEGIN acts as PSYS_SRC_ANGLE_END). type integer value - 26 - tooltip - Period of time (in seconds) for the vehicle to achieve its hover height. + 23 - VEHICLE_LINEAR_DEFLECTION_EFFICIENCY + PSYS_SRC_BURST_PART_COUNT + tooltip + How many particles to release in a burst. type integer value - 28 - tooltip - A slider between minimum (0.0) and maximum (1.0) deflection of linear velocity. That is, its a simple scalar for modulating the strength of linear deflection. + 15 - VEHICLE_LINEAR_DEFLECTION_TIMESCALE + PSYS_SRC_BURST_RADIUS + tooltip + What distance from the center of the object to create the particles. type integer value - 29 - tooltip - The timescale for exponential success of linear deflection deflection. It is another way to specify how much time it takes for the vehicles linear velocity to be redirected to its preferred axis of motion. + 16 - VEHICLE_LINEAR_FRICTION_TIMESCALE + PSYS_SRC_BURST_RATE + tooltip + How often to release a particle burst (float seconds). type integer value - 16 - tooltip - A vector of timescales for exponential decay of the vehicles linear velocity along its preferred axes of motion (at, left, up). - Range = [0.07, inf) seconds for each element of the vector. + 13 - VEHICLE_LINEAR_MOTOR_DECAY_TIMESCALE + PSYS_SRC_BURST_SPEED_MAX + tooltip + Maximum speed that a particle should be moving. type integer value - 31 - tooltip - The timescale for exponential decay of the linear motors magnitude. + 18 - VEHICLE_LINEAR_MOTOR_DIRECTION + PSYS_SRC_BURST_SPEED_MIN + tooltip + Minimum speed that a particle should be moving. type integer value - 18 - tooltip - The direction and magnitude (in preferred frame) of the vehicles linear motor. The vehicle will accelerate (or decelerate if necessary) to match its velocity to its motor. - Range of magnitude = [0, 30] meters/second. + 17 - VEHICLE_LINEAR_MOTOR_OFFSET + PSYS_SRC_INNERANGLE + tooltip + + Specifies the inner angle of the arc created by the PSYS_SRC_PATTERN_ANGLE or PSYS_SRC_PATTERN_ANGLE_CONE source pattern. + The area specified will NOT have particles in it. + type integer value - 20 - tooltip - + 10 - VEHICLE_LINEAR_MOTOR_TIMESCALE + PSYS_SRC_MAX_AGE + tooltip + How long this particle system should last, 0.0 means forever. type integer value - 30 - tooltip - The timescale for exponential approach to full linear motor velocity. + 19 - VEHICLE_REFERENCE_FRAME + PSYS_SRC_OMEGA + tooltip + Sets the angular velocity to rotate the axis that SRC_PATTERN_ANGLE and SRC_PATTERN_ANGLE_CONE use. type integer value - 44 - tooltip - A rotation of the vehicles preferred axes of motion and orientation (at, left, up) with respect to the vehicles local frame (x, y, z). + 21 - VEHICLE_TYPE_AIRPLANE + PSYS_SRC_OUTERANGLE + tooltip + + Specifies the outer angle of the arc created by the PSYS_SRC_PATTERN_ANGLE or PSYS_SRC_PATTERN_ANGLE_CONE source pattern. + The area between the outer and inner angle will be filled with particles. + type integer value - 4 - tooltip - Uses linear deflection for lift, no hover, and banking to turn.\nSee http://wiki.secondlife.com/wiki/VEHICLE_TYPE_AIRPLANE + 11 - VEHICLE_TYPE_BALLOON + PSYS_SRC_PATTERN + tooltip + + The pattern which is used to generate particles. + Use one of the following values: PSYS_SRC_PATTERN Values. + type integer value - 5 - tooltip - Hover, and friction, but no deflection.\nSee http://wiki.secondlife.com/wiki/VEHICLE_TYPE_BALLOON + 9 - VEHICLE_TYPE_BOAT + PSYS_SRC_PATTERN_ANGLE + tooltip + Shoot particles across a 2 dimensional area defined by the arc created from PSYS_SRC_OUTERANGLE. There will be an open area defined by PSYS_SRC_INNERANGLE within the larger arc. type integer value - 3 - tooltip - Hovers over water with lots of friction and some anglar deflection.\nSee http://wiki.secondlife.com/wiki/VEHICLE_TYPE_BOAT + 0x04 - VEHICLE_TYPE_CAR + PSYS_SRC_PATTERN_ANGLE_CONE + tooltip + Shoot particles out in a 3 dimensional cone with an outer arc of PSYS_SRC_OUTERANGLE and an inner open area defined by PSYS_SRC_INNERANGLE. type integer value - 2 - tooltip - Another vehicle that bounces along the ground but needs the motors to be driven from external controls or timer events.\nSee http://wiki.secondlife.com/wiki/VEHICLE_TYPE_CAR + 0x08 - VEHICLE_TYPE_NONE + PSYS_SRC_PATTERN_ANGLE_CONE_EMPTY + tooltip + type integer value - 0 - tooltip - + 0x10 - VEHICLE_TYPE_SLED + PSYS_SRC_PATTERN_DROP + tooltip + Drop particles at the source position. type integer value - 1 - tooltip - Simple vehicle that bumps along the ground, and likes to move along its local x-axis.\nSee http://wiki.secondlife.com/wiki/VEHICLE_TYPE_SLED + 0x01 - VEHICLE_VERTICAL_ATTRACTION_EFFICIENCY + PSYS_SRC_PATTERN_EXPLODE + tooltip + Shoot particles out in all directions, using the burst parameters. type integer value - 36 - tooltip - A slider between minimum (0.0 = wobbly) and maximum (1.0 = firm as possible) stability of the vehicle to keep itself upright. + 0x02 - VEHICLE_VERTICAL_ATTRACTION_TIMESCALE + PSYS_SRC_TARGET_KEY + tooltip + The key of a target object to move towards if PSYS_PART_TARGET_POS_MASK is enabled. type integer value - 37 - tooltip - The period of wobble, or timescale for exponential approach, of the vehicle to rotate such that its preferred "up" axis is oriented along the worlds "up" axis. + 20 - VERTICAL + PSYS_SRC_TEXTURE + tooltip + An asset name for the texture to use for the particles. type integer value - 0 - tooltip - + 12 - WANDER_PAUSE_AT_WAYPOINTS + PUBLIC_CHANNEL + tooltip + PUBLIC_CHANNEL is an integer constant that, when passed to llSay, llWhisper, or llShout as a channel parameter, will print text to the publicly heard chat channel. type integer value - 0 - tooltip - + 0 - XP_ERROR_EXPERIENCES_DISABLED + PURSUIT_FUZZ_FACTOR + tooltip + Selects a random destination near the offset. type integer value - 2 - tooltip - The region currently has experiences disabled. + 3 - XP_ERROR_EXPERIENCE_DISABLED + PURSUIT_GOAL_TOLERANCE + tooltip + type integer value - 8 - tooltip - The experience owner has temporarily disabled the experience. + 5 - XP_ERROR_EXPERIENCE_SUSPENDED + PURSUIT_INTERCEPT + tooltip + Define whether the character attempts to predict the target's location. type integer value - 9 - tooltip - The experience has been suspended by Linden Customer Support. + 4 - XP_ERROR_INVALID_EXPERIENCE + PURSUIT_OFFSET + tooltip + Go to a position offset from the target. type integer value - 7 - tooltip - The script is associated with an experience that no longer exists. + 1 - XP_ERROR_INVALID_PARAMETERS + PU_EVADE_HIDDEN + tooltip + Triggered when an llEvade character thinks it has hidden from its pursuer. type integer value - 3 + 0x07 + + PU_EVADE_SPOTTED + tooltip - One of the string arguments was too big to fit in the key-value store. + Triggered when an llEvade character switches from hiding to running + type + integer + value + 0x08 - XP_ERROR_KEY_NOT_FOUND + PU_FAILURE_DYNAMIC_PATHFINDING_DISABLED + tooltip + type integer value - 14 + 10 + + PU_FAILURE_INVALID_GOAL + tooltip - The requested key does not exist. + Goal is not on the navigation-mesh and cannot be reached. + type + integer + value + 0x03 - XP_ERROR_MATURITY_EXCEEDED + PU_FAILURE_INVALID_START + tooltip + Character cannot navigate from the current location - e.g., the character is off the navmesh or too high above it. type integer value - 16 + 0x02 + + PU_FAILURE_NO_NAVMESH + tooltip - The content rating of the experience exceeds that of the region. + This is a fatal error reported to a character when there is no navmesh for the region. This usually indicates a server failure and users should file a bug report and include the time and region in which they received this message. + type + integer + value + 0x09 - XP_ERROR_NONE + PU_FAILURE_NO_VALID_DESTINATION + tooltip + There is no good place for the character to go - e.g., it is patrolling and all the patrol points are now unreachable. type integer value - 0 + 0x06 + + PU_FAILURE_OTHER + tooltip - No error was detected. + + type + integer + value + 1000000 - XP_ERROR_NOT_FOUND + PU_FAILURE_PARCEL_UNREACHABLE + tooltip + type integer value - 6 + 11 + + PU_FAILURE_TARGET_GONE + tooltip - The sim was unable to verify the validity of the experience. Retrying after a short wait is advised. + Target (for llPursue or llEvade) can no longer be tracked - e.g., it left the region or is an avatar that is now more than about 30m outside the region. + type + integer + value + 0x05 - XP_ERROR_NOT_PERMITTED + PU_FAILURE_UNREACHABLE + tooltip + Goal is no longer reachable for some reason - e.g., an obstacle blocks the path. type integer value - 4 + 0x04 + + PU_GOAL_REACHED + tooltip - This experience is not allowed to run by the requested agent. + Character has reached the goal and will stop or choose a new goal (if wandering). + type + integer + value + 0x01 - XP_ERROR_NOT_PERMITTED_LAND + PU_SLOWDOWN_DISTANCE_REACHED + tooltip + Character is near current goal. type integer value - 17 + 0x00 + + RAD_TO_DEG + tooltip - This experience is not allowed to run on the current region. + 57.2957795 - Number of degrees per radian. You can use this number to convert radians to degrees by multiplying the radians by this number. + type + float + value + 57.2957795 - XP_ERROR_NO_EXPERIENCE + RCERR_CAST_TIME_EXCEEDED + tooltip + type integer value - 5 + -3 + + RCERR_SIM_PERF_LOW + tooltip - This script is not associated with an experience. + + type + integer + value + -2 - XP_ERROR_QUOTA_EXCEEDED + RCERR_UNKNOWN + tooltip + type integer value - 11 + -1 + + RC_DATA_FLAGS + tooltip - An attempted write data to the key-value store failed due to the data quota being met. + + type + integer + value + 2 - XP_ERROR_RETRY_UPDATE + RC_DETECT_PHANTOM + tooltip + type integer value - 15 + 1 + + RC_GET_LINK_NUM + tooltip - A checked update failed due to an out of date request. + + type + integer + value + 4 - XP_ERROR_STORAGE_EXCEPTION + RC_GET_NORMAL + tooltip + type integer value - 13 + 1 + + RC_GET_ROOT_KEY + tooltip - Unable to communicate with the key-value store. + + type + integer + value + 2 - XP_ERROR_STORE_DISABLED + RC_MAX_HITS + tooltip + type integer value - 12 + 3 + + RC_REJECT_AGENTS + tooltip - The key-value store is currently disabled on this region. + + type + integer + value + 1 - XP_ERROR_THROTTLED + RC_REJECT_LAND + tooltip + type integer value - 1 + 8 + + RC_REJECT_NONPHYSICAL + tooltip - The call failed due to too many recent calls. + + type + integer + value + 4 - XP_ERROR_UNKNOWN_ERROR + RC_REJECT_PHYSICAL + tooltip + type integer value - 10 + 2 + + RC_REJECT_TYPES + tooltip - Other unknown error. + + type + integer + value + 0 - ZERO_ROTATION + REGION_FLAG_ALLOW_DAMAGE + tooltip + type - rotation + integer value - <0.0, 0.0, 0.0, 1.0> + 0x1 + + REGION_FLAG_ALLOW_DIRECT_TELEPORT + tooltip - + + type + integer + value + 0x100000 - ZERO_VECTOR + REGION_FLAG_BLOCK_FLY + tooltip + type - vector + integer value - <0.0, 0.0, 0.0> + 0x80000 + + REGION_FLAG_BLOCK_FLYOVER + tooltip - + + type + integer + value + 0x8000000 - default + REGION_FLAG_BLOCK_TERRAFORM tooltip - All scripts must have a default state, which is the first state entered when the script starts.\nIf another state is defined before the default state, the compiler will report a syntax error. + + type + integer + value + 0x40 - - events - - at_rot_target + REGION_FLAG_DISABLE_COLLISIONS - arguments - + tooltip + + type + integer + value + 0x1000 + + REGION_FLAG_DISABLE_PHYSICS + + tooltip + + type + integer + value + 0x4000 + + REGION_FLAG_FIXED_SUN + + tooltip + + type + integer + value + 0x10 + + REGION_FLAG_RESTRICT_PUSHOBJECT + + tooltip + + type + integer + value + 0x400000 + + REGION_FLAG_SANDBOX + + tooltip + + type + integer + value + 0x100 + + REMOTE_DATA_CHANNEL + + tooltip + + type + integer + value + 1 + + REMOTE_DATA_REPLY + + tooltip + + type + integer + value + 3 + + REMOTE_DATA_REQUEST + + tooltip + + type + integer + value + 2 + + REQUIRE_LINE_OF_SIGHT + + tooltip + Define whether the character needs a line-of-sight to give chase. + type + integer + value + 2 + + RESTITUTION + + tooltip + Used with llSetPhysicsMaterial to enable the density value. Must be between 0.0 and 1.0 + type + integer + value + 4 + + REVERSE + + tooltip + Play animation in reverse direction. + type + integer + value + 0x4 + + REZ_ACCEL + + tooltip + Acceleration forced applied to the rezzed object. [vector force, integer rel] + type + integer + value + 5 + + REZ_DAMAGE + + tooltip + Damage applied by the object when it collides with an agent. [float damage] + type + integer + value + 8 + + REZ_DAMAGE_TYPE + + tooltip + Set the damage type applied when this object collides. + type + integer + value + 12 + + REZ_FLAGS + + tooltip + Rez flags to set on the newly rezzed object. [integer flags] + type + integer + value + 1 + + REZ_FLAG_BLOCK_GRAB_OBJECT + + tooltip + Prevent grabbing the object. + type + integer + value + 0x0080 + + REZ_FLAG_DIE_ON_COLLIDE + + tooltip + Object will die after its first collision. + type + integer + value + 0x0008 + + REZ_FLAG_DIE_ON_NOENTRY + + tooltip + Object will die if it attempts to enter a parcel that it can not. + type + integer + value + 0x0010 + + REZ_FLAG_NO_COLLIDE_FAMILY + + tooltip + Object will not trigger collision events with other objects created by the same rezzer. + type + integer + value + 0x0040 + + REZ_FLAG_NO_COLLIDE_OWNER + + tooltip + Object will not trigger collision events with its owner. + type + integer + value + 0x0020 + + REZ_FLAG_PHANTOM + + tooltip + Make the object phantom on rez. + type + integer + value + 0x0004 + + REZ_FLAG_PHYSICAL + + tooltip + Make the object physical on rez. + type + integer + value + 0x0002 + + REZ_FLAG_TEMP + + tooltip + Flag the object as temp on rez. + type + integer + value + 0x0001 + + REZ_LOCK_AXES + + tooltip + Prevent the object from rotating around some axes. [vector locks] + type + integer + value + 11 + + REZ_OMEGA + + tooltip + Omega applied to the rezzed object. [vector axis, integer rel, float spin, float gain] + type + integer + value + 7 + + REZ_PARAM + + tooltip + Integer value to pass to the object as its rez parameter. [integer param] + type + integer + value + 0 + + REZ_PARAM_STRING + + tooltip + A string value to pass to the object as its rez parameter. [string param] + type + integer + value + 13 + + REZ_POS + + tooltip + Position at which to rez the new object. [vector position, integer rel, integer atroot] + type + integer + value + 2 + + REZ_ROT + + tooltip + Rotation applied to newly rezzed object. [rotation rot, integer rel] + type + integer + value + 3 + + REZ_SOUND + + tooltip + Sound attached to the rezzed object. [string name, float volume, integer loop] + type + integer + value + 9 + + REZ_SOUND_COLLIDE + + tooltip + Sound played by the object on a collision. [string name, float volume] + type + integer + value + 10 + + REZ_VEL + + tooltip + Initial velocity of rezzed object. [vector vel, integer rel, integer inherit] + type + integer + value + 4 + + ROTATE + + tooltip + Animate texture rotation. + type + integer + value + 0x20 + + SCALE + + tooltip + Animate the texture scale. + type + integer + value + 0x40 + + SCRIPTED + + tooltip + Scripted in-world objects. + type + integer + value + 0x8 + + SIM_STAT_ACTIVE_SCRIPT_COUNT + + tooltip + Number of active scripts. + type + integer + value + 12 + + SIM_STAT_AGENT_COUNT + + tooltip + Number of agents in region. + type + integer + value + 10 + + SIM_STAT_AGENT_MS + + tooltip + Time spent in 'agent' segment of simulation frame. + type + integer + value + 7 + + SIM_STAT_AGENT_UPDATES + + tooltip + Agent updates per second. + type + integer + value + 2 + + SIM_STAT_AI_MS + + tooltip + Time spent on AI step. + type + integer + value + 26 + + SIM_STAT_ASSET_DOWNLOADS + + tooltip + Pending asset download count. + type + integer + value + 15 + + SIM_STAT_ASSET_UPLOADS + + tooltip + Pending asset upload count. + type + integer + value + 16 + + SIM_STAT_CHILD_AGENT_COUNT + + tooltip + Number of child agents in region. + type + integer + value + 11 + + SIM_STAT_FRAME_MS + + tooltip + Total frame time. + type + integer + value + 3 + + SIM_STAT_IMAGE_MS + + tooltip + Time spent in 'image' segment of simulation frame. + type + integer + value + 8 + + SIM_STAT_IO_PUMP_MS + + tooltip + Pump IO time. + type + integer + value + 24 + + SIM_STAT_NET_MS + + tooltip + Time spent in 'network' segment of simulation frame. + type + integer + value + 4 + + SIM_STAT_OTHER_MS + + tooltip + Time spent in 'other' segment of simulation frame. + type + integer + value + 5 + + SIM_STAT_PACKETS_IN + + tooltip + Packets in per second. + type + integer + value + 13 + + SIM_STAT_PACKETS_OUT + + tooltip + Packets out per second. + type + integer + value + 14 + + SIM_STAT_PCT_CHARS_STEPPED + + tooltip + Returns the % of pathfinding characters skipped each frame, averaged over the last minute.\nThe returned value corresponds to the "Characters Updated" stat in the viewer's Statistics Bar. + type + integer + value + 0 + + SIM_STAT_PHYSICS_FPS + + tooltip + Physics simulation FPS. + type + integer + value + 1 + + SIM_STAT_PHYSICS_MS + + tooltip + Time spent in 'physics' segment of simulation frame. + type + integer + value + 6 + + SIM_STAT_PHYSICS_OTHER_MS + + tooltip + Physics other time. + type + integer + value + 20 + + SIM_STAT_PHYSICS_SHAPE_MS + + tooltip + Physics shape update time. + type + integer + value + 19 + + SIM_STAT_PHYSICS_STEP_MS + + tooltip + Physics step time. + type + integer + value + 18 + + SIM_STAT_SCRIPT_EPS + + tooltip + Script events per second. + type + integer + value + 21 + + SIM_STAT_SCRIPT_MS + + tooltip + Time spent in 'script' segment of simulation frame. + type + integer + value + 9 + + SIM_STAT_SCRIPT_RUN_PCT + + tooltip + Percent of scripts run during frame. + type + integer + value + 25 + + SIM_STAT_SLEEP_MS + + tooltip + Time spent sleeping. + type + integer + value + 23 + + SIM_STAT_SPARE_MS + + tooltip + Spare time left after frame. + type + integer + value + 22 + + SIM_STAT_UNACKED_BYTES + + tooltip + Total unacknowledged bytes. + type + integer + value + 17 + + SIT_FLAG_ALLOW_UNSIT + + tooltip + The prim allows a seated avatar to stand up. + type + integer + value + 0x0002 + + SIT_FLAG_NO_COLLIDE + + tooltip + The seated avatar's hit box is disabled when seated on this prim. + type + integer + value + 0x0010 + + SIT_FLAG_NO_DAMAGE + + tooltip + Damage will not be forwarded to an avatar seated on this prim. + type + integer + value + 0x0020 + + SIT_FLAG_SCRIPTED_ONLY + + tooltip + An avatar may not manually sit on this prim. + type + integer + value + 0x0004 + + SIT_FLAG_SIT_TARGET + + tooltip + The prim has an explicitly set sit target. + type + integer + value + 0x0001 + + SIT_INVALID_AGENT + + tooltip + Avatar ID did not specify a valid avatar. + type + integer + value + -4 + + SIT_INVALID_LINK + + tooltip + Link ID did not specify a valid prim in the linkset or resolved to multiple prims. + type + integer + value + -5 + + SIT_INVALID_OBJECT + + tooltip + Attempt to force an avatar to sit on an attachment or other invalid target. + type + integer + value + -7 + + SIT_NOT_EXPERIENCE + + tooltip + Attempt to force an avatar to sit outside an experience. + type + integer + value + -1 + + SIT_NO_ACCESS + + tooltip + Avatar does not have access to the parcel containing the target linkset of the forced sit. + type + integer + value + -6 + + SIT_NO_EXPERIENCE_PERMISSION + + tooltip + Avatar has not granted permission to force sits. + type + integer + value + -2 + + SIT_NO_SIT_TARGET + + tooltip + No available sit target in linkset for forced sit. + type + integer + value + -3 + + SKY_AMBIENT + + tooltip + The ambient color of the environment + type + integer + value + 0 + + SKY_BLUE + + tooltip + Blue settings for environment + type + integer + value + 22 + + SKY_CLOUDS + + tooltip + Settings controlling cloud density and configuration + type + integer + value + 2 + + SKY_CLOUD_TEXTURE + + tooltip + Texture ID used by clouds + type + integer + value + 19 + + SKY_DOME + + tooltip + Sky dome information. + type + integer + value + 4 + + SKY_GAMMA + + tooltip + The gamma value applied to the scene. + type + integer + value + 5 + + SKY_GLOW + + tooltip + Glow color applied to the sun and moon. + type + integer + value + 6 + + SKY_HAZE + + tooltip + Haze settings for environment + type + integer + value + 23 + + SKY_LIGHT + + tooltip + Miscellaneous lighting values. + type + integer + value + 8 + + SKY_MOON + + tooltip + Environmental moon details. + type + integer + value + 9 + + SKY_MOON_TEXTURE + + tooltip + Environmental moon texture. + type + integer + value + 20 + + SKY_PLANET + + tooltip + Planet information used in rendering the sky. + type + integer + value + 10 + + SKY_REFLECTION_PROBE_AMBIANCE + + tooltip + Settings the ambience of the reflection probe. + type + integer + value + 24 + + SKY_REFRACTION + + tooltip + Sky refraction parameters for rainbows and optical effects. + type + integer + value + 11 + + SKY_STAR_BRIGHTNESS + + tooltip + Brightness value for the stars. + type + integer + value + 13 + + SKY_SUN + + tooltip + Detailed sun information + type + integer + value + 14 + + SKY_SUN_TEXTURE + + tooltip + Environmental sun texture + type + integer + value + 21 + + SKY_TEXTURE_DEFAULTS + + tooltip + Is the environment using the default textures. + type + integer + value + 1 + + SKY_TRACKS + + tooltip + Track elevations for this region. + type + integer + value + 15 + + SMOOTH + + tooltip + Slide in the X direction, instead of playing separate frames. + type + integer + value + 0x10 + + SOUND_LOOP + + tooltip + Sound will loop until stopped. + type + integer + value + 0x01 + + SOUND_PLAY + + tooltip + Sound will play normally. + type + integer + value + 0x00 + + SOUND_SYNC + + tooltip + Sound will be synchronized with the nearest master. + type + integer + value + 0x04 + + SOUND_TRIGGER + + tooltip + Sound will be triggered at the prim's location and not attached. + type + integer + value + 0x02 + + SQRT2 + + tooltip + 1.41421356 - The square root of 2. + type + float + value + 1.41421356 + + STATUS_BLOCK_GRAB + + tooltip + Controls whether the object can be grabbed.\nA grab is the default action when in third person, and is available as the hand tool in build mode. This is useful for physical objects that you don't want other people to be able to trivially disturb. The default is FALSE + type + integer + value + 0x40 + + STATUS_BLOCK_GRAB_OBJECT + + tooltip + Prevent click-and-drag movement on all prims in the object. + type + integer + value + 0x400 + + STATUS_BOUNDS_ERROR + + tooltip + Argument(s) passed to function had a bounds error. + type + integer + value + 1002 + + STATUS_CAST_SHADOWS + + tooltip + + type + integer + value + 0x200 + + STATUS_DIE_AT_EDGE + + tooltip + Controls whether the object is returned to the owners inventory if it wanders off the edge of the world.\nIt is useful to set this status TRUE for things like bullets or rockets. The default is TRUE + type + integer + value + 0x80 + + STATUS_DIE_AT_NO_ENTRY + + tooltip + Controls whether the object dies if it attempts to enter a parcel that does not allow object entry or does not have enough capacity.\nIt is useful to set this status TRUE for things like bullets or rockets. The default is FALSE + type + integer + value + 0x800 + + STATUS_INTERNAL_ERROR + + tooltip + An internal error occurred. + type + integer + value + 1999 + + STATUS_MALFORMED_PARAMS + + tooltip + Function was called with malformed parameters. + type + integer + value + 1000 + + STATUS_NOT_FOUND + + tooltip + Object or other item was not found. + type + integer + value + 1003 + + STATUS_NOT_SUPPORTED + + tooltip + Feature not supported. + type + integer + value + 1004 + + STATUS_OK + + tooltip + Result of function call was a success. + type + integer + value + 0 + + STATUS_PHANTOM + + tooltip + Controls/indicates whether the object collides or not.\nSetting the value to TRUE makes the object non-colliding with all objects. It is a good idea to use this for most objects that move or rotate, but are non-physical. It is also useful for simulating volumetric lighting. The default is FALSE. + type + integer + value + 0x10 + + STATUS_PHYSICS + + tooltip + Controls/indicates whether the object moves physically.\nThis controls the same flag that the UI check-box for Physical controls. The default is FALSE. + type + integer + value + 0x1 + + STATUS_RETURN_AT_EDGE + + tooltip + + type + integer + value + 0x100 + + STATUS_ROTATE_X + + tooltip + + type + integer + value + 0x2 + + STATUS_ROTATE_Y + + tooltip + + type + integer + value + 0x4 + + STATUS_ROTATE_Z + + tooltip + + Controls/indicates whether the object can physically rotate around + the specific axis or not. This flag has no meaning + for non-physical objects. Set the value to FALSE + if you want to disable rotation around that axis. The + default is TRUE for a physical object. + A useful example to think about when visualizing + the effect is a sit-and-spin device. They spin around the + Z axis (up) but not around the X or Y axis. + + type + integer + value + 0x8 + + STATUS_SANDBOX + + tooltip + + Controls/indicates whether the object can cross region boundaries + and move more than 20 meters from its creation + point. The default if FALSE. + + type + integer + value + 0x20 + + STATUS_TYPE_MISMATCH + + tooltip + Argument(s) passed to function had a type mismatch. + type + integer + value + 1001 + + STATUS_WHITELIST_FAILED + + tooltip + Whitelist Failed. + type + integer + value + 2001 + + STRING_TRIM + + tooltip + + type + integer + value + 0x03 + + STRING_TRIM_HEAD + + tooltip + + type + integer + value + 0x01 + + STRING_TRIM_TAIL + + tooltip + + type + integer + value + 0x02 + + TARGETED_EMAIL_OBJECT_OWNER + + tooltip + Send email to the owner of the object + type + integer + value + 0x02 + + TARGETED_EMAIL_ROOT_CREATOR + + tooltip + Send email to the creator of the root object + type + integer + value + 0x01 + + TERRAIN_DETAIL_1 + + tooltip + + type + integer + value + 0 + + TERRAIN_DETAIL_2 + + tooltip + + type + integer + value + 1 + + TERRAIN_DETAIL_3 + + tooltip + + type + integer + value + 2 + + TERRAIN_DETAIL_4 + + tooltip + + type + integer + value + 3 + + TERRAIN_HEIGHT_RANGE_NE + + tooltip + + type + integer + value + 7 + + TERRAIN_HEIGHT_RANGE_NW + + tooltip + + type + integer + value + 6 + + TERRAIN_HEIGHT_RANGE_SE + + tooltip + + type + integer + value + 5 + + TERRAIN_HEIGHT_RANGE_SW + + tooltip + + type + integer + value + 4 + + TERRAIN_PBR_OFFSET_1 + + tooltip + + type + integer + value + 16 + + TERRAIN_PBR_OFFSET_2 + + tooltip + + type + integer + value + 17 + + TERRAIN_PBR_OFFSET_3 + + tooltip + + type + integer + value + 18 + + TERRAIN_PBR_OFFSET_4 + + tooltip + + type + integer + value + 19 + + TERRAIN_PBR_ROTATION_1 + + tooltip + + type + integer + value + 12 + + TERRAIN_PBR_ROTATION_2 + + tooltip + + type + integer + value + 13 + + TERRAIN_PBR_ROTATION_3 + + tooltip + + type + integer + value + 14 + + TERRAIN_PBR_ROTATION_4 + + tooltip + + type + integer + value + 15 + + TERRAIN_PBR_SCALE_1 + + tooltip + + type + integer + value + 8 + + TERRAIN_PBR_SCALE_2 + + tooltip + + type + integer + value + 9 + + TERRAIN_PBR_SCALE_3 + + tooltip + + type + integer + value + 10 + + TERRAIN_PBR_SCALE_4 + + tooltip + + type + integer + value + 11 + + TEXTURE_BLANK + + tooltip + + type + string + value + 5748decc-f629-461c-9a36-a35a221fe21f + + TEXTURE_DEFAULT + + tooltip + + type + string + value + 89556747-24cb-43ed-920b-47caed15465f + + TEXTURE_MEDIA + + tooltip + + type + string + value + 8b5fec65-8d8d-9dc5-cda8-8fdf2716e361 + + TEXTURE_PLYWOOD + + tooltip + + type + string + value + 89556747-24cb-43ed-920b-47caed15465f + + TEXTURE_TRANSPARENT + + tooltip + + type + string + value + 8dcd4a48-2d37-4909-9f78-f7a9eb4ef903 + + TOUCH_INVALID_FACE + + tooltip + + type + integer + value + -1 + + TOUCH_INVALID_TEXCOORD + + tooltip + + type + vector + value + <-1.0, -1.0, 0.0> + + TOUCH_INVALID_VECTOR + + tooltip + + type + vector + value + <0.0, 0.0, 0.0> + + TP_ROUTING_BLOCKED + + tooltip + Direct teleporting is blocked on this parcel. + type + integer + value + 0 + + TP_ROUTING_FREE + + tooltip + Teleports are unrestricted on this parcel. + type + integer + value + 2 + + TP_ROUTING_LANDINGP + + tooltip + Teleports are routed to a landing point if set on this parcel. + type + integer + value + 1 + + TRANSFER_BAD_OPTS + + tooltip + Invalid inventory options. + type + integer + value + -1 + + TRANSFER_BAD_ROOT + + tooltip + The root path specified in TRANSFER_DEST contained an invalid directory or was reduced to nothing. + type + integer + value + -5 + + TRANSFER_DEST + + tooltip + The root folder to transfer inventory into. + type + integer + value + 0 + + TRANSFER_FLAGS + + tooltip + Flags to control the behavior of inventory transfer. + type + integer + value + 1 + + TRANSFER_FLAG_COPY + + tooltip + Gives a copy of the object being transfered. Implies TRANSFER_FLAG_TAKE. + type + integer + value + 0x0004 + + TRANSFER_FLAG_RESERVED + + tooltip + Reserved for future expansion. + type + integer + value + 0x0001 + + TRANSFER_FLAG_TAKE + + tooltip + On a successful transfer, automatically takes the object into inventory. + type + integer + value + 0x0002 + + TRANSFER_NO_ATTACHMENT + + tooltip + Can not transfer ownership of an attached object. + type + integer + value + -7 + + TRANSFER_NO_ITEMS + + tooltip + No items in the inventory list are eligible for transfer. + type + integer + value + -4 + + TRANSFER_NO_PERMS + + tooltip + The object does not have transfer permissions. + type + integer + value + -6 + + TRANSFER_NO_TARGET + + tooltip + Could not find the receiver in the current region. + type + integer + value + -2 + + TRANSFER_OK + + tooltip + Inventory transfer offer was successfully made. + type + integer + value + 0 + + TRANSFER_THROTTLE + + tooltip + Inventory throttle hit. + type + integer + value + -3 + + TRAVERSAL_TYPE + + tooltip + One of TRAVERSAL_TYPE_FAST, TRAVERSAL_TYPE_SLOW, and TRAVERSAL_TYPE_NONE. + type + integer + value + 7 + + TRAVERSAL_TYPE_FAST + + tooltip + + type + integer + value + 1 + + TRAVERSAL_TYPE_NONE + + tooltip + + type + integer + value + 2 + + TRAVERSAL_TYPE_SLOW + + tooltip + + type + integer + value + 0 + + TRUE + + tooltip + An integer constant for boolean comparisons. Has the value '1'. + type + integer + value + 1 + + TWO_PI + + tooltip + 6.28318530 - The radians of a circle. + type + float + value + 6.28318530 + + TYPE_FLOAT + + tooltip + The list entry is a float. + type + integer + value + 2 + + TYPE_INTEGER + + tooltip + The list entry is an integer. + type + integer + value + 1 + + TYPE_INVALID + + tooltip + The list entry is invalid. + type + integer + value + 0 + + TYPE_KEY + + tooltip + The list entry is a key. + type + integer + value + 4 + + TYPE_ROTATION + + tooltip + The list entry is a rotation. + type + integer + value + 6 + + TYPE_STRING + + tooltip + The list entry is a string. + type + integer + value + 3 + + TYPE_VECTOR + + tooltip + The list entry is a vector. + type + integer + value + 5 + + URL_REQUEST_DENIED + + tooltip + + type + string + value + URL_REQUEST_DENIED + + URL_REQUEST_GRANTED + + tooltip + + type + string + value + URL_REQUEST_GRANTED + + VEHICLE_ANGULAR_DEFLECTION_EFFICIENCY + + tooltip + A slider between minimum (0.0) and maximum (1.0) deflection of angular orientation. That is, its a simple scalar for modulating the strength of angular deflection such that the vehicles preferred axis of motion points toward its real velocity. + type + integer + value + 32 + + VEHICLE_ANGULAR_DEFLECTION_TIMESCALE + + tooltip + The time-scale for exponential success of linear deflection deflection. Its another way to specify the strength of the vehicles tendency to reorient itself so that its preferred axis of motion agrees with its true velocity. + type + integer + value + 33 + + VEHICLE_ANGULAR_FRICTION_TIMESCALE + + tooltip + + A vector of timescales for exponential decay of the vehicles angular velocity about its preferred axes of motion (at, left, up). + Range = [0.07, inf) seconds for each element of the vector. + + type + integer + value + 17 + + VEHICLE_ANGULAR_MOTOR_DECAY_TIMESCALE + + tooltip + The timescale for exponential decay of the angular motors magnitude. + type + integer + value + 35 + + VEHICLE_ANGULAR_MOTOR_DIRECTION + + tooltip + The direction and magnitude (in preferred frame) of the vehicles angular motor.The vehicle will accelerate (or decelerate if necessary) to match its velocity to its motor. + type + integer + value + 19 + + VEHICLE_ANGULAR_MOTOR_TIMESCALE + + tooltip + The timescale for exponential approach to full angular motor velocity. + type + integer + value + 34 + + VEHICLE_BANKING_EFFICIENCY + + tooltip + A slider between anti (-1.0), none (0.0), and maxmum (1.0) banking strength. + type + integer + value + 38 + + VEHICLE_BANKING_MIX + + tooltip + A slider between static (0.0) and dynamic (1.0) banking. "Static" means the banking scales only with the angle of roll, whereas "dynamic" is a term that also scales with the vehicles linear speed. + type + integer + value + 39 + + VEHICLE_BANKING_TIMESCALE + + tooltip + The timescale for banking to exponentially approach its maximum effect. This is another way to scale the strength of the banking effect, however it affects the term that is proportional to the difference between what the banking behavior is trying to do, and what the vehicle is actually doing. + type + integer + value + 40 + + VEHICLE_BUOYANCY + + tooltip + A slider between minimum (0.0) and maximum anti-gravity (1.0). + type + integer + value + 27 + + VEHICLE_FLAG_BLOCK_INTERFERENCE + + tooltip + Prevent other scripts from pushing vehicle. + type + integer + value + 0x400 + + VEHICLE_FLAG_CAMERA_DECOUPLED + + tooltip + + type + integer + value + 0x200 + + VEHICLE_FLAG_HOVER_GLOBAL_HEIGHT + + tooltip + Hover at global height. + type + integer + value + 0x10 + + VEHICLE_FLAG_HOVER_TERRAIN_ONLY + + tooltip + Ignore water height when hovering. + type + integer + value + 0x8 + + VEHICLE_FLAG_HOVER_UP_ONLY + + tooltip + Hover does not push down. Use this flag for hovering vehicles that should be able to jump above their hover height. + type + integer + value + 0x20 + + VEHICLE_FLAG_HOVER_WATER_ONLY + + tooltip + Ignore terrain height when hovering. + type + integer + value + 0x4 + + VEHICLE_FLAG_LIMIT_MOTOR_UP + + tooltip + Prevents ground vehicles from motoring into the sky. + type + integer + value + 0x40 + + VEHICLE_FLAG_LIMIT_ROLL_ONLY + + tooltip + For vehicles with vertical attractor that want to be able to climb/dive, for instance, aeroplanes that want to use the banking feature. + type + integer + value + 0x2 + + VEHICLE_FLAG_MOUSELOOK_BANK + + tooltip + + type + integer + value + 0x100 + + VEHICLE_FLAG_MOUSELOOK_STEER + + tooltip + + type + integer + value + 0x80 + + VEHICLE_FLAG_NO_DEFLECTION_UP + + tooltip + This flag prevents linear deflection parallel to world z-axis. This is useful for preventing ground vehicles with large linear deflection, like bumper cars, from climbing their linear deflection into the sky. + type + integer + value + 0x1 + + VEHICLE_FLAG_NO_FLY_UP + + deprecated + 1 + tooltip + Old, changed to VEHICLE_FLAG_NO_DEFLECTION_UP + type + integer + value + 0x1 + + VEHICLE_HOVER_EFFICIENCY + + tooltip + A slider between minimum (0.0 = bouncy) and maximum (1.0 = fast as possible) damped motion of the hover behavior. + type + integer + value + 25 + + VEHICLE_HOVER_HEIGHT + + tooltip + The height (above the terrain or water, or global) at which the vehicle will try to hover. + type + integer + value + 24 + + VEHICLE_HOVER_TIMESCALE + + tooltip + Period of time (in seconds) for the vehicle to achieve its hover height. + type + integer + value + 26 + + VEHICLE_LINEAR_DEFLECTION_EFFICIENCY + + tooltip + A slider between minimum (0.0) and maximum (1.0) deflection of linear velocity. That is, its a simple scalar for modulating the strength of linear deflection. + type + integer + value + 28 + + VEHICLE_LINEAR_DEFLECTION_TIMESCALE + + tooltip + The timescale for exponential success of linear deflection deflection. It is another way to specify how much time it takes for the vehicles linear velocity to be redirected to its preferred axis of motion. + type + integer + value + 29 + + VEHICLE_LINEAR_FRICTION_TIMESCALE + + tooltip + + A vector of timescales for exponential decay of the vehicles linear velocity along its preferred axes of motion (at, left, up). + Range = [0.07, inf) seconds for each element of the vector. + + type + integer + value + 16 + + VEHICLE_LINEAR_MOTOR_DECAY_TIMESCALE + + tooltip + The timescale for exponential decay of the linear motors magnitude. + type + integer + value + 31 + + VEHICLE_LINEAR_MOTOR_DIRECTION + + tooltip + + The direction and magnitude (in preferred frame) of the vehicles linear motor. The vehicle will accelerate (or decelerate if necessary) to match its velocity to its motor. + Range of magnitude = [0, 30] meters/second. + + type + integer + value + 18 + + VEHICLE_LINEAR_MOTOR_OFFSET + + tooltip + + type + integer + value + 20 + + VEHICLE_LINEAR_MOTOR_TIMESCALE + + tooltip + The timescale for exponential approach to full linear motor velocity. + type + integer + value + 30 + + VEHICLE_REFERENCE_FRAME + + tooltip + A rotation of the vehicles preferred axes of motion and orientation (at, left, up) with respect to the vehicles local frame (x, y, z). + type + integer + value + 44 + + VEHICLE_TYPE_AIRPLANE + + tooltip + Uses linear deflection for lift, no hover, and banking to turn.\nSee http://wiki.secondlife.com/wiki/VEHICLE_TYPE_AIRPLANE + type + integer + value + 4 + + VEHICLE_TYPE_BALLOON + + tooltip + Hover, and friction, but no deflection.\nSee http://wiki.secondlife.com/wiki/VEHICLE_TYPE_BALLOON + type + integer + value + 5 + + VEHICLE_TYPE_BOAT + + tooltip + Hovers over water with lots of friction and some anglar deflection.\nSee http://wiki.secondlife.com/wiki/VEHICLE_TYPE_BOAT + type + integer + value + 3 + + VEHICLE_TYPE_CAR + + tooltip + Another vehicle that bounces along the ground but needs the motors to be driven from external controls or timer events.\nSee http://wiki.secondlife.com/wiki/VEHICLE_TYPE_CAR + type + integer + value + 2 + + VEHICLE_TYPE_NONE + + tooltip + + type + integer + value + 0 + + VEHICLE_TYPE_SLED + + tooltip + Simple vehicle that bumps along the ground, and likes to move along its local x-axis.\nSee http://wiki.secondlife.com/wiki/VEHICLE_TYPE_SLED + type + integer + value + 1 + + VEHICLE_VERTICAL_ATTRACTION_EFFICIENCY + + tooltip + A slider between minimum (0.0 = wobbly) and maximum (1.0 = firm as possible) stability of the vehicle to keep itself upright. + type + integer + value + 36 + + VEHICLE_VERTICAL_ATTRACTION_TIMESCALE + + tooltip + The period of wobble, or timescale for exponential approach, of the vehicle to rotate such that its preferred "up" axis is oriented along the worlds "up" axis. + type + integer + value + 37 + + VERTICAL + + tooltip + + type + integer + value + 0 + + WANDER_PAUSE_AT_WAYPOINTS + + tooltip + + type + integer + value + 0 + + WATER_BLUR_MULTIPLIER + + tooltip + Blur factor. + type + integer + value + 100 + + WATER_FOG + + tooltip + Fog properties when underwater. + type + integer + value + 101 + + WATER_FRESNEL + + tooltip + Fresnel scattering applied to the surface of the water. + type + integer + value + 102 + + WATER_NORMAL_SCALE + + tooltip + Scaling applied to the water normal map. + type + integer + value + 104 + + WATER_NORMAL_TEXTURE + + tooltip + Normal map used for environmental waves. + type + integer + value + 107 + + WATER_REFRACTION + + tooltip + Refraction factors when looking through the surface of the water. + type + integer + value + 105 + + WATER_TEXTURE_DEFAULTS + + tooltip + Is the environment using the default wave map. + type + integer + value + 103 + + WATER_WAVE_DIRECTION + + tooltip + Vectors for the directions of the waves. + type + integer + value + 106 + + XP_ERROR_EXPERIENCES_DISABLED + + tooltip + The region currently has experiences disabled. + type + integer + value + 2 + + XP_ERROR_EXPERIENCE_DISABLED + + tooltip + The experience owner has temporarily disabled the experience. + type + integer + value + 8 + + XP_ERROR_EXPERIENCE_SUSPENDED + + tooltip + The experience has been suspended by Linden Customer Support. + type + integer + value + 9 + + XP_ERROR_INVALID_EXPERIENCE + + tooltip + The script is associated with an experience that no longer exists. + type + integer + value + 7 + + XP_ERROR_INVALID_PARAMETERS + + tooltip + One of the string arguments was too big to fit in the key-value store. + type + integer + value + 3 + + XP_ERROR_KEY_NOT_FOUND + + tooltip + The requested key does not exist. + type + integer + value + 14 + + XP_ERROR_MATURITY_EXCEEDED + + tooltip + The content rating of the experience exceeds that of the region. + type + integer + value + 16 + + XP_ERROR_NONE + + tooltip + No error was detected. + type + integer + value + 0 + + XP_ERROR_NOT_FOUND + + tooltip + The sim was unable to verify the validity of the experience. Retrying after a short wait is advised. + type + integer + value + 6 + + XP_ERROR_NOT_PERMITTED + + tooltip + This experience is not allowed to run by the requested agent. + type + integer + value + 4 + + XP_ERROR_NOT_PERMITTED_LAND + + tooltip + This experience is not allowed to run on the current region. + type + integer + value + 17 + + XP_ERROR_NO_EXPERIENCE + + tooltip + This script is not associated with an experience. + type + integer + value + 5 + + XP_ERROR_QUOTA_EXCEEDED + + tooltip + An attempted write data to the key-value store failed due to the data quota being met. + type + integer + value + 11 + + XP_ERROR_REQUEST_PERM_TIMEOUT + + tooltip + Request timed out; permissions not modified. + type + integer + value + 18 + + XP_ERROR_RETRY_UPDATE + + tooltip + A checked update failed due to an out of date request. + type + integer + value + 15 + + XP_ERROR_STORAGE_EXCEPTION + + tooltip + Unable to communicate with the key-value store. + type + integer + value + 13 + + XP_ERROR_STORE_DISABLED + + tooltip + The key-value store is currently disabled on this region. + type + integer + value + 12 + + XP_ERROR_THROTTLED + + tooltip + The call failed due to too many recent calls. + type + integer + value + 1 + + XP_ERROR_UNKNOWN_ERROR + + tooltip + Other unknown error. + type + integer + value + 10 + + ZERO_ROTATION + + tooltip + + type + rotation + value + <0.0, 0.0, 0.0, 1.0> + + ZERO_VECTOR + + tooltip + + type + vector + value + <0.0, 0.0, 0.0> + + default + + tooltip + + All scripts must have a default state, which is the first state entered when the script starts. + If another state is defined before the default state, the compiler will report a syntax error. + + + + events + + at_rot_target + + arguments + + + TargetNumber + + tooltip + + type + integer + + + + TargetRotation + + tooltip + + type + rotation + + + + CurrentRotation + + tooltip + + type + rotation + + + + tooltip + This event is triggered when a script comes within a defined angle of a target rotation. The range and rotation, are set by a call to llRotTarget. + + at_target + + arguments + + + TargetNumber + + tooltip + + type + integer + + + + TargetPosition + + tooltip + + type + vector + + + + CurrentPosition + + tooltip + + type + vector + + + + tooltip + This event is triggered when the scripted object comes within a defined range of the target position, defined by the llTarget function call. + + attach + + arguments + + + AvatarID + + tooltip + + type + key + + + + tooltip + This event is triggered whenever an object is attached or detached from an avatar. If it is attached, the key of the avatar it is attached to is passed in, otherwise NULL_KEY is. + + changed + + arguments + + + Changed + + tooltip + + type + integer + + + + tooltip + Triggered when various events change the object. The change argument will be a bit-field of CHANGED_* constants. + + collision + + arguments + + + NumberOfCollisions + + tooltip + + type + integer + + + + tooltip + + This event is raised while another object, or avatar, is colliding with the object the script is attached to. + The number of detected objects is passed to the script. Information on those objects may be gathered via the llDetected* functions. + + + collision_end + + arguments + + + NumberOfCollisions + + tooltip + + type + integer + + + + tooltip + + This event is raised when another object, or avatar, stops colliding with the object the script is attached to. + The number of detected objects is passed to the script. Information on those objects may be gathered via the llDetected* library functions. + + + collision_start + + arguments + + + NumberOfCollisions + + tooltip + + type + integer + + + + tooltip + + This event is raised when another object, or avatar, starts colliding with the object the script is attached to. + The number of detected objects is passed to the script. Information on those objects may be gathered via the llDetected* library functions. + + + control + + arguments + + + AvatarID + + tooltip + + type + key + + + + Levels + + tooltip + + type + integer + + + + Edges + + tooltip + + type + integer + + + + tooltip + + Once a script has the ability to grab control inputs from the avatar, this event will be used to pass the commands into the script. + The levels and edges are bit-fields of control constants. + + + dataserver + + arguments + + + RequestID + + tooltip + + type + key + + + + Data + + tooltip + + type + string + + + + tooltip + + This event is triggered when the requested data is returned to the script. + Data may be requested by the llRequestAgentData, llRequestInventoryData, and llGetNotecardLine function calls, for example. + + + email + + arguments + + + Time + + tooltip + + type + string + + + + Address + + tooltip + + type + string + + + + Subject + + tooltip + + type + string + + + + Body + + tooltip + + type + string + + + + NumberRemaining + + tooltip + + type + integer + + + + tooltip + + This event is triggered when an email sent to this script arrives. + The number remaining tells how many more emails are known to be still pending. + + + experience_permissions + + arguments + + + agent_id + + tooltip + ID of the agent approving permission for the Experience. + type + key + + + + tooltip + Triggered when an agent has approved an experience permissions request. + + experience_permissions_denied + + arguments + + + agent_id + + tooltip + ID of the agent denying permission for the Experience. + type + key + + + + Reason + + tooltip + One of the XP_ERROR_... constants describing the reason why the Experience permissions were denied for the agent. + type + integer + + + + tooltip + Describes why the Experience permissions were denied for the agent. + + final_damage + + arguments + + + count + + tooltip + The number of damage events queued. + type + integer + + + + tooltip + Triggered as damage is applied to an avatar or task, after all on_damage events have been processed. + + game_control + + arguments + + + id + + tooltip + UUID of avatar supplying input + type + key + + + + buttons + + tooltip + 32-bit mask of buttons pressed + type + integer + + + + axes + + tooltip + Six float values in range [-1, 1] + type + list + + + + tooltip + This event is raised when game controller input changes. + + http_request + + arguments + + + HTTPRequestID + + tooltip + + type + key + + + + HTTPMethod + + tooltip + + type + string + + + + Body + + tooltip + + type + string + + + + tooltip + Triggered when task receives an HTTP request. + + http_response + + arguments + + + HTTPRequestID + + tooltip + + type + key + + + + Status + + tooltip + + type + integer + + + + Metadata + + tooltip + + type + list + + + + Body + + tooltip + + type + string + + + + tooltip + This event handler is invoked when an HTTP response is received for a pending llHTTPRequest request or if a pending request fails or times out. + + land_collision + + arguments + + + Position + + tooltip + + type + vector + + + + tooltip + This event is raised when the object the script is attached to is colliding with the ground. + + land_collision_end + + arguments + + + Position + + tooltip + + type + vector + + + + tooltip + This event is raised when the object the script is attached to stops colliding with the ground. + + land_collision_start + + arguments + + + Position + + tooltip + + type + vector + + + + tooltip + This event is raised when the object the script is attached to begins to collide with the ground. + + link_message + + arguments + + + SendersLink + + tooltip + + type + integer + + + + Value + + tooltip + + type + integer + + + + Text + + tooltip + + type + string + + + + ID + + tooltip + + type + key + + + + tooltip + Triggered when object receives a link message via llMessageLinked function call. + + linkset_data + + arguments + + + action + + tooltip + + type + integer + + + + name + + tooltip + + type + string + + + + value + + tooltip + + type + string + + + + tooltip + Triggered when a script modifies the linkset datastore. + + listen + + arguments + + + Channel + + tooltip + + type + integer + + + + Name + + tooltip + + type + string + + + + ID + + tooltip + + type + key + + + + Text + + tooltip + + type + string + + + + tooltip + + This event is raised whenever a chat message matching the constraints set in the llListen command is received. The name and ID of the speaker, as well as the message, are passed in as parameters. + Channel 0 is the public chat channel that all avatars see as chat text. Channels 1 through 2,147,483,648 are private channels that are not sent to avatars but other scripts can listen on those channels. + + + money + + arguments + + + Payer + + tooltip + + type + key + + + + Amount + + tooltip + + type + integer + + + + tooltip + This event is triggered when a resident has given an amount of Linden dollars to the object. + + moving_end + + arguments + + tooltip + Triggered whenever an object with this script stops moving. + + moving_start + + arguments + + tooltip + Triggered whenever an object with this script starts moving. + + no_sensor + + arguments + + tooltip + This event is raised when sensors are active, via the llSensor function call, but are not sensing anything. + + not_at_rot_target + + arguments + + tooltip + When a target is set via the llRotTarget function call, but the script is outside the specified angle this event is raised. + + not_at_target + + arguments + + tooltip + When a target is set via the llTarget library call, but the script is outside the specified range this event is raised. + + object_rez + + arguments + + + RezzedObjectsID + + tooltip + + type + key + + + + tooltip + Triggered when an object rezzes another object from its inventory via the llRezObject, or similar, functions. The id is the globally unique key for the object rezzed. + + on_damage + + arguments + + + count + + tooltip + The number of damage events queued. + type + integer + + + + tooltip + Triggered when an avatar or object receives damage. + + on_death + + arguments + + tooltip + Triggered when an avatar reaches 0 health. + + on_rez + + arguments + + + StartParameter + + tooltip + + type + integer + + + + tooltip + Triggered whenever an object is rezzed from inventory or by another object. The start parameter is passed in from the llRezObject call, or zero if from inventory. + + path_update + + arguments + + + Type + + tooltip + + type + integer + + + + Reserved + + tooltip + + type + list + + + + tooltip + This event is called to inform the script of changes within the object's path-finding status. + + remote_data + + arguments + + + EventType + + tooltip + + type + integer + + + + ChannelID + + tooltip + + type + key + + + + MessageID + + tooltip + + type + key + + + + Sender + + tooltip + + type + string + + + + IData + + tooltip + + type + integer + + + + SData + + tooltip + + type + string + + + + tooltip + This event is deprecated. + + run_time_permissions + + arguments + + + PermissionFlags + + tooltip + + type + integer + + + + tooltip + + Scripts need permission from either the owner or the avatar they wish to act on before they may perform certain functions, such as debiting money from their owners account, triggering an animation on an avatar, or capturing control inputs. The llRequestPermissions library function is used to request these permissions and the various permissions integer constants can be supplied. + The integer returned to this event handler contains the current set of permissions flags, so if permissions equal 0 then no permissions are set. + + + sensor + + arguments + + + NumberDetected + + tooltip + + type + integer + + + + tooltip + + This event is raised whenever objects matching the constraints of the llSensor command are detected. + The number of detected objects is passed to the script in the parameter. Information on those objects may be gathered via the llDetected* functions. + + + state_entry + + arguments + + tooltip + The state_entry event occurs whenever a new state is entered, including at program start, and is always the first event handled. + + state_exit + + arguments + + tooltip + The state_exit event occurs whenever the state command is used to transition to another state. It is handled before the new states state_entry event. + + timer + + arguments + + tooltip + This event is raised at regular intervals set by the llSetTimerEvent library function. + + touch + + arguments + + + NumberOfTouches + + tooltip + + type + integer + + + + tooltip + + This event is raised while a user is touching the object the script is attached to. + The number of touching objects is passed to the script in the parameter. + Information on those objects may be gathered via the llDetected* library functions. + + + touch_end + + arguments + + + NumberOfTouches + + tooltip + + type + integer + + + + tooltip + + This event is raised when a user stops touching the object the script is attached to. The number of touches is passed to the script in the parameter. + Information on those objects may be gathered via the llDetected* library functions. + + + touch_start + + arguments + + + NumberOfTouches + + tooltip + + type + integer + + + + tooltip + + This event is raised when a user first touches the object the script is attached to. The number of touches is passed to the script in the parameter. + Information on those objects may be gathered via the llDetected() library functions. + + + transaction_result + + arguments + + + RequestID + + tooltip + + type + key + + + + Success + + tooltip + + type + integer + + + + Message + + tooltip + + type + string + + + + tooltip + Triggered by llTransferMoney() function. + + + functions + + llAbs + + arguments + + + Value + + tooltip + An integer value. + type + integer + + + + energy + 10 + return + integer + sleep + 0 + tooltip + Returns the absolute (positive) version of Value. + + llAcos + + arguments + + + Value + + tooltip + A floating-point value. + type + float + + + + energy + 10 + return + float + sleep + 0 + tooltip + Returns the arc-cosine of Value, in radians. + + llAddToLandBanList + + arguments + + + ID + + tooltip + Agent UUID to add to ban-list. + type + key + + + + Hours + + tooltip + Period, in hours, to ban the avatar for. + type + float + + + + energy + 10 + return + void + sleep + 0.1000000000000000055511151 + tooltip + Add avatar ID to the parcel ban list for the specified number of Hours.\nA value of 0 for Hours will add the agent indefinitely.\nThe smallest value that Hours will accept is 0.01; anything smaller will be seen as 0.\nWhen values that small are used, it seems the function bans in approximately 30 second increments (Probably 36 second increments, as 0.01 of an hour is 36 seconds).\nResidents teleporting to a parcel where they are banned will be redirected to a neighbouring parcel. + + llAddToLandPassList + + arguments + + + ID + + tooltip + Agent UUID to add to pass-list. + type + key + + + + Hours + + tooltip + Period, in hours, to allow the avatar for. + type + float + + + + energy + 10 + return + void + sleep + 0.1000000000000000055511151 + tooltip + Add avatar ID to the land pass list, for a duration of Hours. + + llAdjustDamage + + arguments + + + Number + + tooltip + Damage event index to modify. + type + integer + + + + Damage + + tooltip + New damage amount to apply on this event. + type + float + + + + energy + 10 + return + void + sleep + 0 + tooltip + Changes the amount of damage to be delivered by this damage event. + + llAdjustSoundVolume + + arguments + + + Volume + + tooltip + The volume to set. + type + float + + + + energy + 10 + return + void + sleep + 0.1000000000000000055511151 + tooltip + Adjusts the volume (0.0 - 1.0) of the currently playing attached sound.\nThis function has no effect on sounds started with llTriggerSound. + + llAgentInExperience + + arguments + + + AgentID + + tooltip + + type + key + + + + energy + 10 + return + integer + sleep + 0 + tooltip + + Returns TRUE if the agent is in the Experience and the Experience can run in the current location. + + + llAllowInventoryDrop + + arguments + + + Flag + + tooltip + Boolean, If TRUE allows anyone to drop inventory on prim, FALSE revokes. + type + integer + + + + energy + 10 + return + void + sleep + 0 + tooltip + If Flag == TRUE, users without object modify permissions can still drop inventory items into the object. + + llAngleBetween + + arguments + - TargetNumber + Rot1 + + tooltip + First rotation. + type + rotation + + + + Rot2 + + tooltip + Second rotation. + type + rotation + + + + energy + 10 + return + float + sleep + 0 + tooltip + Returns the angle, in radians, between rotations Rot1 and Rot2. + + llApplyImpulse + + arguments + + + Force + + tooltip + Amount of impulse force to apply. + type + vector + + + + Local + tooltip + Boolean, if TRUE, force is treated as a local directional vector instead of region directional vector. type integer + + + + energy + 10 + return + void + sleep + 0 + tooltip + Applies impulse to the object.\nIf Local == TRUE, apply the Force in local coordinates; otherwise, apply the Force in global coordinates.\nThis function only works on physical objects. + + llApplyRotationalImpulse + + arguments + + + Force + tooltip - + Amount of impulse force to apply. + type + vector - TargetRotation + Local + tooltip + Boolean, if TRUE, uses local axis, if FALSE, uses region axis. type - rotation + integer + + + + energy + 10 + return + void + sleep + 0 + tooltip + Applies rotational impulse to the object.\nIf Local == TRUE, apply the Force in local coordinates; otherwise, apply the Force in global coordinates.\nThis function only works on physical objects. + + llAsin + + arguments + + + Value + tooltip - + A floating-point value. + type + float + + energy + 10 + return + float + sleep + 0 + tooltip + Returns the arc-sine, in radians, of Value. + + llAtan2 + + arguments + - CurrentRotation + y + tooltip + A floating-point value. type - rotation + float + + + + x + tooltip - + A floating-point value. + type + float + energy + 10 + return + float + sleep + 0 tooltip - This event is triggered when a script comes within a defined angle of a target rotation. The range and rotation, are set by a call to llRotTarget. + Returns the arc-tangent2 of y, x. - at_target + llAttachToAvatar arguments - TargetNumber + AttachmentPoint + tooltip + type integer + + + + energy + 10 + return + void + sleep + 0 + tooltip + Attach to avatar at point AttachmentPoint.\nRequires the PERMISSION_ATTACH runtime permission. + + llAttachToAvatarTemp + + arguments + + + AttachPoint + tooltip - + Valid attachment point or ATTACH_* constant. + type + integer + + energy + 10 + return + void + sleep + 0 + tooltip + Follows the same convention as llAttachToAvatar, with the exception that the object will not create new inventory for the user, and will disappear on detach or disconnect. + + llAvatarOnLinkSitTarget + + arguments + - TargetPosition + LinkNumber + + tooltip + Link number (0: unlinked, 1: root prim, >1: child prims) or a LINK_* flag. + type + integer + + + + energy + 10 + return + key + sleep + 0 + tooltip + If an avatar is sitting on the link's sit target, return the avatar's key, NULL_KEY otherwise.\nReturns a key that is the UUID of the user seated on the specified link's prim. + + llAvatarOnSitTarget + + arguments + + energy + 10 + return + key + sleep + 0 + tooltip + If an avatar is seated on the sit target, returns the avatar's key, otherwise NULL_KEY.\nThis only will detect avatars sitting on sit targets defined with llSitTarget. + + llAxes2Rot + + arguments + + + Forward + tooltip + Forward/Back part of rotation. type vector + + + + Left + tooltip - + Left/Right part of rotation. + type + vector - CurrentPosition + Up + tooltip + Up/Down part of rotation. + type + vector + + + + energy + 10 + return + rotation + sleep + 0 + tooltip + Returns the rotation represented by coordinate axes Forward, Left, and Up. + + llAxisAngle2Rot + + arguments + + + Axis + + tooltip + Axis. type vector + + + + Angle + tooltip - + Angle in radians. + type + float + energy + 10 + return + rotation + sleep + 0 tooltip - This event is triggered when the scripted object comes within a defined range of the target position, defined by the llTarget function call. + Returns the rotation that is a generated Angle about Axis. - attach + llBase64ToInteger arguments - AvatarID + Text - type - key tooltip - + + type + string + energy + 10 + return + integer + sleep + 0 tooltip - This event is triggered whenever an object is attached or detached from an avatar. If it is attached, the key of the avatar it is attached to is passed in, otherwise NULL_KEY is. + Returns an integer that is the Text, Base64 decoded as a big endian integer.\nReturns zero if Text is longer then 8 characters. If Text contains fewer then 6 characters, the return value is unpredictable. - changed + llBase64ToString arguments - Changed + Text - type - integer tooltip - + + type + string + energy + 10 + return + string + sleep + 0 tooltip - Triggered when various events change the object. The change argument will be a bit-field of CHANGED_* constants. + Converts a Base64 string to a conventional string.\nIf the conversion creates any unprintable characters, they are converted to question marks. - collision + llBreakAllLinks arguments - - - NumberOfCollisions - - type - integer - tooltip - - - - + + energy + 10 + return + void + sleep + 0 tooltip - This event is raised while another object, or avatar, is colliding with the object the script is attached to. - The number of detected objects is passed to the script. Information on those objects may be gathered via the llDetected* functions. + De-links all prims in the link set (requires permission PERMISSION_CHANGE_LINKS be set). - collision_end + llBreakLink arguments - NumberOfCollisions + LinkNumber + tooltip + type integer - tooltip - + energy + 10 + return + void + sleep + 0 tooltip - This event is raised when another object, or avatar, stops colliding with the object the script is attached to. - The number of detected objects is passed to the script. Information on those objects may be gathered via the llDetected* library functions. + De-links the prim with the given link number (requires permission PERMISSION_CHANGE_LINKS be set). - collision_start + llCSV2List arguments - NumberOfCollisions + Text - type - integer tooltip - + + type + string + energy + 10 + return + list + sleep + 0 tooltip - This event is raised when another object, or avatar, starts colliding with the object the script is attached to. - The number of detected objects is passed to the script. Information on those objects may be gathered via the llDetected* library functions. + Create a list from a string of comma separated values specified in Text. - control + llCastRay arguments - AvatarID + Start - type - key tooltip - + + type + vector - Levels + End - type - integer tooltip - + + type + vector - Edges + Options - type - integer tooltip - + + type + list + energy + 10 + return + list + sleep + 0 tooltip - Once a script has the ability to grab control inputs from the avatar, this event will be used to pass the commands into the script. - The levels and edges are bit-fields of control constants. + Casts a ray into the physics world from 'start' to 'end' and returns data according to details in Options.\nReports collision data for intersections with objects.\nReturn value: [UUID_1, {link_number_1}, hit_position_1, {hit_normal_1}, UUID_2, {link_number_2}, hit_position_2, {hit_normal_2}, ... , status_code] where {} indicates optional data. - dataserver + llCeil arguments - RequestID + Value - type - key tooltip - - - - - Data - + type - string - tooltip - + float + energy + 10 + return + integer + sleep + 0 tooltip - This event is triggered when the requested data is returned to the script. - Data may be requested by the llRequestAgentData, llRequestInventoryData, and llGetNotecardLine function calls, for example. + Returns smallest integer value >= Value. - email + llChar arguments - Time + value - type - string tooltip - - - - - Address - + Unicode value to convert into a string. type - string - tooltip - + integer + + energy + 10 + return + string + sleep + 0 + tooltip + Returns a single character string that is the representation of the unicode value. + + llClearCameraParams + + arguments + + energy + 10 + return + void + sleep + 0 + tooltip + Resets all camera parameters to default values and turns off scripted camera control. + + llClearLinkMedia + + arguments + - Subject + Link - type - string tooltip - - - - - Body - + type - string - tooltip - + integer - NumberRemaining + Face + tooltip + type integer - tooltip - + energy + 10 + return + integer + sleep + 0 tooltip - This event is triggered when an email sent to this script arrives. - The number remaining tells how many more emails are known to be still pending. - - experience_permissions - - arguments - - - agent_id - - type - key - tooltip - ID of the agent approving permission for the Experience. - - - + Clears (deletes) the media and all parameters from the given Face on the linked prim.\nReturns an integer that is a STATUS_* flag, which details the success/failure of the operation. - experience_permissions_denied + llClearPrimMedia arguments - - agent_id - - type - key - tooltip - ID of the agent denying permission for the Experience. - - - - Reason - - type - integer - tooltip - One of the XP_ERROR_... constants describing the reason why the Experience permissions were denied for the agent. - - + + Face + + tooltip + Number of side to clear. + type + integer + + + energy + 10 + return + integer + sleep + 1 tooltip - Describes why the Experience permissions were denied for the agent. + Clears (deletes) the media and all parameters from the given Face.\nReturns an integer that is a STATUS_* flag which details the success/failure of the operation. - http_request + llCloseRemoteDataChannel arguments - HTTPRequestID + ChannelID + tooltip + type key - tooltip - + + energy + 10 + return + void + sleep + 1 + tooltip + This function is deprecated. + + llCloud + + arguments + - HTTPMethod + Offset - type - string tooltip - - - - - Body - + type - string - tooltip - + vector + energy + 10 + return + float + sleep + 0 tooltip - Triggered when task receives an HTTP request. + Returns the cloud density at the object's position + Offset. - http_response + llCollisionFilter arguments - HTTPRequestID - - type - key - tooltip - - - - - Status + ObjectName - type - integer tooltip - + + type + string - Metadata + ObjectID - type - list tooltip - + + type + key - Body + Accept - type - string tooltip - + If TRUE, only accept collisions with ObjectName name AND ObjectID (either is optional), otherwise with objects not ObjectName AND ObjectID. + type + integer + energy + 10 + return + void + sleep + 0 tooltip - This event handler is invoked when an HTTP response is received for a pending llHTTPRequest request or if a pending request fails or times out. + Specify an empty string or NULL_KEY for Accept, to not filter on the corresponding parameter. - land_collision + llCollisionSound arguments - Position + ImpactSound - type - vector tooltip - + + type + string - - tooltip - This event is raised when the object the script is attached to is colliding with the ground. - - land_collision_end - - arguments - - Position + ImpactVolume - type - vector tooltip - + + type + float + energy + 10 + return + void + sleep + 0 tooltip - This event is raised when the object the script is attached to stops colliding with the ground. + Suppress default collision sounds, replace default impact sounds with ImpactSound.\nThe ImpactSound must be in the object inventory.\nSupply an empty string to suppress collision sounds. - land_collision_start + llCollisionSprite arguments - Position + ImpactSprite - type - vector tooltip - + + type + string + energy + 10 + return + void + sleep + 0 tooltip - This event is raised when the object the script is attached to begins to collide with the ground. + Suppress default collision sprites, replace default impact sprite with ImpactSprite; found in the object inventory (empty string to just suppress). - link_message + llComputeHash arguments - SendersLink + Message - type - integer tooltip - - - - - Value - + The message to be hashed. type - integer - tooltip - + string - Text + Algorithm + tooltip + The digest algorithm: md5, sha1, sha224, sha256, sha384, sha512. type string - tooltip - + + energy + 10 + return + string + sleep + 0 + tooltip + Returns hex-encoded Hash string of Message using digest Algorithm. + + llCos + + arguments + - ID + Theta - type - key tooltip - + + type + float + energy + 10 + return + float + sleep + 0 tooltip - Triggered when object receives a link message via llMessageLinked function call. + Returns the cosine of Theta (Theta in radians). - listen + llCreateCharacter arguments - Channel + Options - type - integer tooltip - + + type + list + + energy + 10 + return + void + sleep + 0 + tooltip + Convert link-set to AI/Physics character.\nCreates a path-finding entity, known as a "character", from the object containing the script. Required to activate use of path-finding functions.\nOptions is a list of key/value pairs. + + llCreateKeyValue + + arguments + - Name + Key + tooltip + type string - tooltip - - ID + Value - type - key tooltip - - - - - Text - + type string - tooltip - + energy + 10 + return + key + sleep + 0 tooltip - This event is raised whenever a chat message matching the constraints set in the llListen command is received. The name and ID of the speaker, as well as the message, are passed in as parameters. - Channel 0 is the public chat channel that all avatars see as chat text. Channels 1 through 2,147,483,648 are private channels that are not sent to avatars but other scripts can listen on those channels. + + Starts an asychronous transaction to create a key-value pair. Will fail with XP_ERROR_STORAGE_EXCEPTION if the key already exists. The dataserver callback will be executed with the key returned from this call and a string describing the result. The result is a two element commma-delimited list. The first item is an integer specifying if the transaction succeeded (1) or not (0). In the failure case, the second item will be an integer corresponding to one of the XP_ERROR_... constants. In the success case the second item will be the value passed to the function. + - money + llCreateLink arguments - Payer + TargetPrim + tooltip + Object UUID that is in the same region. type key - tooltip - - Amount + Parent + tooltip + If FALSE, then TargetPrim becomes the root. If TRUE, then the script's object becomes the root. type integer - tooltip - + energy + 10 + return + void + sleep + 0.1000000000000000055511151 tooltip - This event is triggered when a resident has given an amount of Linden dollars to the object. - - moving_end - - arguments - - tooltip - Triggered whenever an object with this script stops moving. - - moving_start - - arguments - - tooltip - Triggered whenever an object with this script starts moving. - - no_sensor - - arguments - - tooltip - This event is raised when sensors are active, via the llSensor function call, but are not sensing anything. - - not_at_rot_target - - arguments - - tooltip - When a target is set via the llRotTarget function call, but the script is outside the specified angle this event is raised. - - not_at_target - - arguments - - tooltip - When a target is set via the llTarget library call, but the script is outside the specified range this event is raised. + Attempt to link the object the script is in, to target (requires permission PERMISSION_CHANGE_LINKS be set).\nRequires permission PERMISSION_CHANGE_LINKS be set. - object_rez + llDamage arguments - RezzedObjectsID + target + tooltip + Agent or task to receive damage. type key + + + + damage + tooltip - + Damage amount to inflict on this target. + type + float - - tooltip - Triggered when an object rezzes another object from its inventory via the llRezObject, or similar, functions. The id is the globally unique key for the object rezzed. - - on_rez - - arguments - - StartParameter + type + tooltip + Damage type to inflict on this target. type integer - tooltip - + energy + 10 + return + void + sleep + 0 tooltip - Triggered whenever an object is rezzed from inventory or by another object. The start parameter is passed in from the llRezObject call, or zero if from inventory. + Generates a damage event on the targeted agent or task. - path_update + llDataSizeKeyValue arguments - - - Type - - type - integer - tooltip - - - + + energy + 10 + return + key + sleep + 0 + tooltip + + Starts an asychronous transaction the request the used and total amount of data allocated for the Experience. The dataserver callback will be executed with the key returned from this call and a string describing the result. The result is commma-delimited list. The first item is an integer specifying if the transaction succeeded (1) or not (0). In the failure case, the second item will be an integer corresponding to one of the XP_ERROR_... constants. In the success case the second item will be the the amount in use and the third item will be the total available. + + + llDeleteCharacter + + arguments + + energy + 10 + return + void + sleep + 0 + tooltip + Convert link-set from AI/Physics character to Physics object.\nConvert the current link-set back to a standard object, removing all path-finding properties. + + llDeleteKeyValue + + arguments + - Reserved + Key - type - list tooltip - + + type + string + energy + 10 + return + key + sleep + 0 tooltip - This event is called to inform the script of changes within the object's path-finding status. + + Starts an asychronous transaction to delete a key-value pair. The dataserver callback will be executed with the key returned from this call and a string describing the result. The result is a two element commma-delimited list. The first item is an integer specifying if the transaction succeeded (1) or not (0). In the failure case, the second item will be an integer corresponding to one of the XP_ERROR_... constants. In the success case the second item will be the value associated with the key. + - remote_data + llDeleteSubList arguments - EventType + Source - type - integer tooltip - + + type + list - ChannelID + Start - type - key tooltip - + + type + integer - MessageID + End - type - key tooltip - + + type + integer + + energy + 10 + return + list + sleep + 0 + tooltip + Removes the slice from start to end and returns the remainder of the list.\nRemove a slice from the list and return the remainder, start and end are inclusive.\nUsing negative numbers for start and/or end causes the index to count backwards from the length of the list, so 0, -1 would delete the entire list.\nIf Start is larger than End the list deleted is the exclusion of the entries; so 6, 4 would delete the entire list except for the 5th. list entry. + + llDeleteSubString + + arguments + - Sender + Source + tooltip + type string - tooltip - - Data + Start + tooltip + type integer - tooltip - - Data + End - type - string tooltip - + + type + integer + energy + 10 + return + string + sleep + 0 tooltip - Triggered by various XML-RPC calls with event_type specifying the type of data. + Removes the indicated sub-string and returns the result.\nStart and End are inclusive.\nUsing negative numbers for Start and/or End causes the index to count backwards from the length of the string, so 0, -1 would delete the entire string.\nIf Start is larger than End, the sub-string is the exclusion of the entries; so 6, 4 would delete the entire string except for the 5th. character. - run_time_permissions + llDerezObject arguments - PermissionFlags + ID - type - integer tooltip - + The ID of an object in the region. + type + key - - tooltip - Scripts need permission from either the owner or the avatar they wish to act on before they may perform certain functions, such as debiting money from their owners account, triggering an animation on an avatar, or capturing control inputs. The llRequestPermissions library function is used to request these permissions and the various permissions integer constants can be supplied. - The integer returned to this event handler contains the current set of permissions flags, so if permissions equal 0 then no permissions are set. - - sensor - - arguments - - NumberDetected + flags + tooltip + Flags for derez behavior. type integer - tooltip - + energy + 10 + return + integer + sleep + 0 tooltip - This event is raised whenever objects matching the constraints of the llSensor command are detected. - The number of detected objects is passed to the script in the parameter. Information on those objects may be gathered via the llDetected* functions. - - state_entry - - arguments - - tooltip - The state_entry event occurs whenever a new state is entered, including at program start, and is always the first event handled. - - state_exit - - arguments - - tooltip - The state_exit event occurs whenever the state command is used to transition to another state. It is handled before the new states state_entry event. + Derezzes an object previously rezzed by a script in this region. Returns TRUE on success or FALSE if the object could not be derezzed. - timer + llDetachFromAvatar arguments - + + energy + 10 + return + void + sleep + 0 tooltip - This event is raised at regular intervals set by the llSetTimerEvent library function. + Remove the object containing the script from the avatar. - touch + llDetectedDamage arguments - NumberOfTouches + Number + tooltip + type integer - tooltip - + energy + 10 + return + list + sleep + 0 tooltip - This event is raised while a user is touching the object the script is attached to. - The number of touching objects is passed to the script in the parameter. - Information on those objects may be gathered via the llDetected* library functions. + Returns a list containing the current damage for the event, the damage type and the original damage delivered. - touch_end + llDetectedGrab arguments - NumberOfTouches + Number + tooltip + type integer - tooltip - + energy + 10 + return + vector + sleep + 0 tooltip - This event is raised when a user stops touching the object the script is attached to. The number of touches is passed to the script in the parameter. - Information on those objects may be gathered via the llDetected* library functions. + Returns the grab offset of a user touching the object.\nReturns <0.0, 0.0, 0.0> if Number is not a valid object. - touch_start + llDetectedGroup arguments - NumberOfTouches + Number + tooltip + type integer - tooltip - + energy + 10 + return + integer + sleep + 0 tooltip - This event is raised when a user first touches the object the script is attached to. The number of touches is passed to the script in the parameter. - Information on those objects may be gathered via the llDetected() library functions. + Returns TRUE if detected object or agent Number has the same user group active as this object.\nIt will return FALSE if the object or agent is in the group, but the group is not active. - transaction_result + llDetectedKey arguments - RequestID + Number - type - key tooltip - - - - - Success - + type integer - tooltip - - - - - Message - - type - string - tooltip - + energy + 10 + return + key + sleep + 0 tooltip - Triggered by llTransferMoney() function. + Returns the key of detected object or avatar number.\nReturns NULL_KEY if Number is not a valid index. - - functions - - llAbs + llDetectedLinkNumber - energy - 10.0 - sleep - 0.0 - return - integer arguments - Value + Number + tooltip + type integer - tooltip - An integer value. + energy + 10 + return + integer + sleep + 0 tooltip - Returns the absolute (positive) version of Value. + Returns the link position of the triggered event for touches and collisions only.\n0 for a non-linked object, 1 for the root of a linked object, 2 for the first child, etc. - llAcos + llDetectedName - energy - 10.0 - sleep - 0.0 - return - float arguments - Value + Number - type - float tooltip - A floating-point value. + + type + integer + energy + 10 + return + string + sleep + 0 tooltip - Returns the arc-cosine of Value, in radians. + Returns the name of detected object or avatar number.\nReturns the name of detected object number.\nReturns empty string if Number is not a valid index. - llAddToLandBanList + llDetectedOwner - energy - 10.0 - sleep - 0.0 - return - void arguments - ID + Number - type - key tooltip - Agent UUID to add to ban-list. - - - - Hours - + type - float - tooltip - Period, in hours, to ban the avatar for. + integer + energy + 10 + return + key + sleep + 0 tooltip - Add avatar ID to the parcel ban list for the specified number of Hours.\nA value of 0 for Hours will add the agent indefinitely.\nThe smallest value that Hours will accept is 0.01; anything smaller will be seen as 0.\nWhen values that small are used, it seems the function bans in approximately 30 second increments (Probably 36 second increments, as 0.01 of an hour is 36 seconds).\nResidents teleporting to a parcel where they are banned will be redirected to a neighbouring parcel. + Returns the key of detected object's owner.\nReturns invalid key if Number is not a valid index. - llAddToLandPassList + llDetectedPos - energy - 10.0 - sleep - 0.1 - return - void arguments - ID - - type - key - tooltip - Agent UUID to add to pass-list. - - - - Hours + Number - type - float tooltip - Period, in hours, to allow the avatar for. + + type + integer + energy + 10 + return + vector + sleep + 0 tooltip - Add avatar ID to the land pass list, for a duration of Hours. + Returns the position of detected object or avatar number.\nReturns <0.0, 0.0, 0.0> if Number is not a valid index. - llAdjustSoundVolume + llDetectedRezzer - energy - 10.0 - sleep - 0.1 - return - void arguments - Volume + Number - type - float tooltip - The volume to set. + + type + integer - tooltip - Adjusts the volume (0.0 - 1.0) of the currently playing attached sound.\nThis function has no effect on sounds started with llTriggerSound. - - llAgentInExperience - energy - 10.0 - sleep - 0.0 + 10 return - integer - arguments - - - AgentID - - type - key - tooltip - - - - + key + sleep + 0 tooltip - - Returns TRUE if the agent is in the Experience and the Experience can run in the current location. - + Returns the key for the rezzer of the detected object. - llAllowInventoryDrop + llDetectedRot - energy - 10.0 - sleep - 0.0 - return - void arguments - Flag + Number + tooltip + type integer - tooltip - Boolean, If TRUE allows anyone to drop inventory on prim, FALSE revokes. + energy + 10 + return + rotation + sleep + 0 tooltip - If Flag == TRUE, users without object modify permissions can still drop inventory items into the object. + Returns the rotation of detected object or avatar number.\nReturns <0.0, 0.0, 0.0, 1.0> if Number is not a valid offset. - llAngleBetween + llDetectedTouchBinormal - energy - 10.0 - sleep - 0.0 - return - float arguments - Rot1 + Index - type - rotation tooltip - First rotation. - - - - Rot2 - + Index of detection information type - rotation - tooltip - Second rotation. + integer + energy + 10 + return + vector + sleep + 0 tooltip - Returns the angle, in radians, between rotations Rot1 and Rot2. + Returns the surface bi-normal for a triggered touch event.\nReturns a vector that is the surface bi-normal (tangent to the surface) where the touch event was triggered. - llApplyImpulse + llDetectedTouchFace - energy - 10.0 - sleep - 0.0 - return - void arguments - Force + Index - type - vector tooltip - Amount of impulse force to apply. - - - - Local - + Index of detection information type integer - tooltip - Boolean, if TRUE, force is treated as a local directional vector instead of region directional vector. + energy + 10 + return + integer + sleep + 0 tooltip - Applies impulse to the object.\nIf Local == TRUE, apply the Force in local coordinates; otherwise, apply the Force in global coordinates.\nThis function only works on physical objects. + Returns the index of the face where the avatar clicked in a triggered touch event. - llApplyRotationalImpulse + llDetectedTouchNormal - energy - 10.0 - sleep - 0.0 - return - void arguments - Force + Index - type - vector tooltip - Amount of impulse force to apply. - - - - Local - + Index of detection information type integer - tooltip - Boolean, if TRUE, uses local axis, if FALSE, uses region axis. + energy + 10 + return + vector + sleep + 0 tooltip - Applies rotational impulse to the object.\nIf Local == TRUE, apply the Force in local coordinates; otherwise, apply the Force in global coordinates.\nThis function only works on physical objects. + Returns the surface normal for a triggered touch event.\nReturns a vector that is the surface normal (perpendicular to the surface) where the touch event was triggered. - llAsin + llDetectedTouchPos - energy - 10.0 - sleep - 0.0 - return - float arguments - Value + Index - type - float tooltip - A floating-point value. + Index of detected information + type + integer + energy + 10 + return + vector + sleep + 0 tooltip - Returns the arc-sine, in radians, of Value. + Returns the position, in region coordinates, where the object was touched in a triggered touch event.\nUnless it is a HUD, in which case it returns the position relative to the attach point. - llAtan2 + llDetectedTouchST - energy - 10.0 - sleep - 0.0 - return - float arguments - y + Index - type - float tooltip - A floating-point value. - - - - x - + Index of detection information type - float - tooltip - A floating-point value. + integer + energy + 10 + return + vector + sleep + 0 tooltip - Returns the arc-tangent2 of y, x. + Returns a vector that is the surface coordinates where the prim was touched.\nThe X and Y vector positions contain the horizontal (S) and vertical (T) face coordinates respectively.\nEach component is in the interval [0.0, 1.0].\nTOUCH_INVALID_TEXCOORD is returned if the surface coordinates cannot be determined (e.g. when the viewer does not support this function). - llAttachToAvatar + llDetectedTouchUV - energy - 10.0 - sleep - 0.0 - return - void arguments - AttachmentPoint + Index + tooltip + Index of detection information type integer - tooltip - - tooltip - Attach to avatar at point AttachmentPoint.\nRequires the PERMISSION_ATTACH runtime permission. - - llAttachToAvatarTemp - energy - 0 + 10 + return + vector sleep 0 - return - void + tooltip + Returns a vector that is the texture coordinates for where the prim was touched.\nThe X and Y vector positions contain the U and V face coordinates respectively.\nTOUCH_INVALID_TEXCOORD is returned if the touch UV coordinates cannot be determined (e.g. when the viewer does not support this function). + + llDetectedType + arguments - AttachPoint + Number + tooltip + type integer - tooltip - Valid attachment point or ATTACH_* constant. + energy + 10 + return + integer + sleep + 0 tooltip - Follows the same convention as llAttachToAvatar, with the exception that the object will not create new inventory for the user, and will disappear on detach or disconnect. + Returns the type (AGENT, ACTIVE, PASSIVE, SCRIPTED) of detected object.\nReturns 0 if number is not a valid index.\nNote that number is a bit-field, so comparisons need to be a bitwise checked. e.g.:\ninteger iType = llDetectedType(0);\n{\n // ...do stuff with the agent\n} - llAvatarOnLinkSitTarget + llDetectedVel - energy - 10.0 - sleep - 0.0 - return - key arguments - LinkNumber + Number + tooltip + type integer - tooltip - Link number (0: unlinked, 1: root prim, >1: child prims) or a LINK_* flag. - tooltip - If an avatar is sitting on the link's sit target, return the avatar's key, NULL_KEY otherwise.\nReturns a key that is the UUID of the user seated on the specified link's prim. - - llAvatarOnSitTarget - energy - 10.0 - sleep - 0.0 + 10 return - key - arguments - + vector + sleep + 0 tooltip - If an avatar is seated on the sit target, returns the avatar's key, otherwise NULL_KEY.\nThis only will detect avatars sitting on sit targets defined with llSitTarget. + Returns the velocity of the detected object Number.\nReturns<0.0, 0.0, 0.0> if Number is not a valid offset. - llAxes2Rot + llDialog - energy - 10.0 - sleep - 0.0 - return - rotation arguments - Forward + AvatarID - type - vector tooltip - Forward/Back part of rotation. + + type + key - Left + Text - type - vector tooltip - Left/Right part of rotation. + + type + string - Up + Buttons + tooltip + type - vector + list + + + + Channel + tooltip - Up/Down part of rotation. + + type + integer + energy + 10 + return + void + sleep + 1 tooltip - Returns the rotation represented by coordinate axes Forward, Left, and Up. + + Shows a dialog box on the avatar's screen with the message.\n + Up to 12 strings in the list form buttons.\n + If a button is clicked, the name is chatted on Channel.\nOpens a "notify box" in the given avatars screen displaying the message.\n + Up to twelve buttons can be specified in a list of strings. When the user clicks a button, the name of the button is said on the specified channel.\n + Channels work just like llSay(), so channel 0 can be heard by everyone.\n + The chat originates at the object's position, not the avatar's position, even though it is said as the avatar (uses avatar's UUID and Name etc.).\n + Examples:\n + llDialog(who, "Are you a boy or a girl?", [ "Boy", "Girl" ], -4913);\n + llDialog(who, "This shows only an OK button.", [], -192);\n + llDialog(who, "This chats so you can 'hear' it.", ["Hooray"], 0); + - llAxisAngle2Rot + llDie + arguments + energy - 10.0 - sleep - 0.0 + 0 return - rotation + void + sleep + 0 + tooltip + Delete the object which holds the script. + + llDumpList2String + arguments - Axis + Source - type - vector tooltip - Axis. + + type + list - Angle + Separator - type - float tooltip - Angle in radians. + + type + string + energy + 10 + return + string + sleep + 0 tooltip - Returns the rotation that is a generated Angle about Axis. + Returns the list as a single string, using Separator between the entries.\nWrite the list out as a single string, using Separator between values. - llBase64ToInteger + llEdgeOfWorld - energy - 10.0 - sleep - 0.0 - return - integer arguments - Text + Position - type - string tooltip - + + type + vector - - tooltip - Returns an integer that is the Text, Base64 decoded as a big endian integer.\nReturns zero if Text is longer then 8 characters. If Text contains fewer then 6 characters, the return value is unpredictable. - - llBase64ToString - - energy - 10.0 - sleep - 0.0 - return - string - arguments - - Text + Direction - type - string tooltip - + + type + vector - tooltip - Converts a Base64 string to a conventional string.\nIf the conversion creates any unprintable characters, they are converted to question marks. - - llBreakAllLinks - energy - 10.0 - sleep - 0.0 + 10 return - void - arguments - + integer + sleep + 0 tooltip - De-links all prims in the link set (requires permission PERMISSION_CHANGE_LINKS be set). + Checks to see whether the border hit by Direction from Position is the edge of the world (has no neighboring region).\nReturns TRUE if the line along Direction from Position hits the edge of the world in the current simulator, returns FALSE if that edge crosses into another simulator. - llBreakLink + llEjectFromLand - energy - 10.0 - sleep - 0.0 - return - void arguments - LinkNumber + AvatarID - type - integer tooltip - + + type + key + energy + 10 + return + void + sleep + 0 tooltip - De-links the prim with the given link number (requires permission PERMISSION_CHANGE_LINKS be set). + Ejects AvatarID from land that you own.\nEjects AvatarID from land that the object owner (group or resident) owns. - llCastRay + llEmail - energy - - sleep - - return - list arguments - Start + Address - type - vector tooltip - + + type + string - End + Subject - type - vector tooltip - + + type + string - Options + Text - type - list tooltip - + + type + string + energy + 10 + return + void + sleep + 20 tooltip - Casts a ray into the physics world from 'start' to 'end' and returns data according to details in Options.\nReports collision data for intersections with objects.\nReturn value: [UUID_1, {link_number_1}, hit_position_1, {hit_normal_1}, UUID_2, {link_number_2}, hit_position_2, {hit_normal_2}, ... , status_code] where {} indicates optional data. + Sends email to Address with Subject and Message.\nSends an email to Address with Subject and Message. - llCeil + llEscapeURL - energy - 10.0 - sleep - 0.0 - return - integer arguments - Value + URL - type - float tooltip - + + type + string - tooltip - Returns smallest integer value >= Value. - - llClearCameraParams - energy - 10.0 - sleep - 0.0 + 10 return - void - arguments - + string + sleep + 0 tooltip - Resets all camera parameters to default values and turns off scripted camera control. + + Returns an escaped/encoded version of url, replacing spaces with %20 etc.\nReturns the string that is the URL-escaped version of URL (replacing spaces with %20, etc.).\n + This function returns the UTF-8 encoded escape codes for selected characters. + - llClearLinkMedia + llEuler2Rot - energy - 0.0 - sleep - 0.0 - return - integer arguments - Link + Vector - type - integer tooltip - - - - - Face - + type - integer - tooltip - + vector + energy + 10 + return + rotation + sleep + 0 tooltip - Clears (deletes) the media and all parameters from the given Face on the linked prim.\nReturns an integer that is a STATUS_* flag, which details the success/failure of the operation. + Returns the rotation representation of the Euler angles.\nReturns the rotation represented by the Euler Angle. - llClearPrimMedia + llEvade - energy - 10.0 - sleep - 0.1 - return - integer arguments - Face + TargetID + tooltip + Agent or object to evade. type - integer + key + + + + Options + tooltip - Number of side to clear. + No options yet. + type + list - tooltip - Clears (deletes) the media and all parameters from the given Face.\nReturns an integer that is a STATUS_* flag which details the success/failure of the operation. - - llCloseRemoteDataChannel - energy - 10.0 - sleep - 1.0 + 10 return void + sleep + 0 + tooltip + Evade a specified target.\nCharacters will (roughly) try to hide from their pursuers if there is a good hiding spot along their fleeing path. Hiding means no direct line of sight from the head of the character (centre of the top of its physics bounding box) to the head of its pursuer and no direct path between the two on the navigation-mesh. + + llExecCharacterCmd + arguments - ChannelID + Command + tooltip + Command to send. type - key + integer + + + + Options + tooltip - + Height for CHARACTER_CMD_JUMP. + type + list + energy + 10 + return + void + sleep + 0 tooltip - Closes the specified XML-RPC channel. + Execute a character command.\nSend a command to the path system.\nCurrently only supports stopping the current path-finding operation or causing the character to jump. - llCloud + llFabs - energy - 10.0 - sleep - 0.0 - return - float arguments - Offset + Value - type - vector tooltip - + + type + float + energy + 10 + return + float + sleep + 0 tooltip - Returns the cloud density at the object's position + Offset. + Returns the positive version of Value.\nReturns the absolute value of Value. - llCollisionFilter + llFindNotecardTextCount - energy - 10.0 - sleep - 0.0 - return - void arguments - ObjectName + NotecardName + tooltip + type string - tooltip - - ObjectID + Pattern - type - key tooltip - + Regex pattern to find in the notecard text. + type + string - Accept + Options - type - integer tooltip - If TRUE, only accept collisions with ObjectName name AND ObjectID (either is optional), otherwise with objects not ObjectName AND ObjectID. + A list of options to control the search. Included for future expansion, should be [] + type + list + energy + 10 + return + key + sleep + 0 tooltip - Specify an empty string or NULL_KEY for Accept, to not filter on the corresponding parameter. + + Searches the text of a cached notecard for lines containing the given pattern and returns the + number of matches found through a dataserver event. + - llCollisionSound + llFindNotecardTextSync - energy - 10.0 - sleep - 0.0 - return - void arguments - ImpactSound + NotecardName + + tooltip + + type + string + + + + Pattern + tooltip + Regex pattern to find in the notecard text. type string + + + + StartMatch + tooltip - + The number of matches to skip before returning values. + type + integer - ImpactVolume + Count + tooltip + The maximum number of matches to return. If 0 this function will return the first 64 matches found. type - float + integer + + + + Options + tooltip - + A list of options to control the search. Included for future expansion, should be [] + type + list + energy + 10 + return + list + sleep + 0 tooltip - Suppress default collision sounds, replace default impact sounds with ImpactSound.\nThe ImpactSound must be in the object inventory.\nSupply an empty string to suppress collision sounds. + + Searches the text of a cached notecard for lines containing the given pattern. + Returns a list of line numbers and column where a match is found. If the notecard is not in + the cache it returns a list containing a single entry of NAK. If no matches are found an + empty list is returned. + - llCollisionSprite + llFleeFrom - energy - 10.0 - sleep - 0.0 - return - void arguments - ImpactSprite + Source - type - string tooltip - + Global coordinate from which to flee. + type + vector - - tooltip - Suppress default collision sprites, replace default impact sprite with ImpactSprite; found in the object inventory (empty string to just suppress). - - llCos - - energy - 10.0 - sleep - 0.0 - return - float - arguments - - Theta + Distance + tooltip + Distance in meters to flee from the source. type float - tooltip - - - tooltip - Returns the cosine of Theta (Theta in radians). - - llCreateCharacter - - energy - - sleep - - return - void - arguments - Options + tooltip + No options available at this time. type list - tooltip - + energy + 10 + return + void + sleep + 0 tooltip - Convert link-set to AI/Physics character.\nCreates a path-finding entity, known as a "character", from the object containing the script. Required to activate use of path-finding functions.\nOptions is a list of key/value pairs. + Flee from a point.\nDirects a character (llCreateCharacter) to keep away from a defined position in the region or adjacent regions. - llCreateKeyValue + llFloor - energy - 10.0 - sleep - 0.0 - return - key arguments - - Key - - type - string - tooltip - - - - - Value - type - string - tooltip - + Value + + tooltip + + type + float + - + energy + 10 + return + integer + sleep + 0 tooltip - - Starts an asychronous transaction to create a key-value pair. Will fail with XP_ERROR_STORAGE_EXCEPTION if the key already exists. The dataserver callback will be executed with the key returned from this call and a string describing the result. The result is a two element commma-delimited list. The first item is an integer specifying if the transaction succeeded (1) or not (0). In the failure case, the second item will be an integer corresponding to one of the XP_ERROR_... constants. In the success case the second item will be the value passed to the function. - + Returns largest integer value <= Value. - llCreateLink + llForceMouselook - energy - 10.0 - sleep - 1.0 - return - void arguments - TargetPrim + Enable - type - key tooltip - Object UUID that is in the same region. - - - - Parent - + Boolean, if TRUE when an avatar sits on the prim, the avatar will be forced into mouse-look mode.\nFALSE is the default setting and will undo a previously set TRUE or do nothing. type integer - tooltip - If FALSE, then TargetPrim becomes the root. If TRUE, then the script's object becomes the root. + energy + 10 + return + void + sleep + 0 tooltip - Attempt to link the object the script is in, to target (requires permission PERMISSION_CHANGE_LINKS be set).\nRequires permission PERMISSION_CHANGE_LINKS be set. + If Enable is TRUE any avatar that sits on this object is forced into mouse-look mode.\nAfter calling this function with Enable set to TRUE, any agent sitting down on the prim will be forced into mouse-look.\nJust like llSitTarget, this changes a permanent property of the prim (not the object) and needs to be reset by calling this function with Enable set to FALSE in order to disable it. - llCSV2List + llFrand - energy - 10.0 - sleep - 0.0 - return - list arguments - Text + Magnitude - type - string tooltip - + + type + float + energy + 10 + return + float + sleep + 0 tooltip - Create a list from a string of comma separated values specified in Text. + Returns a pseudo random number in the range [0, Magnitude] or [Magnitude, 0].\nReturns a pseudo-random number between [0, Magnitude]. - llDataSizeKeyValue + llGenerateKey + arguments + energy - 10.0 - sleep - 0.0 + 10 return key - arguments - + sleep + 0 tooltip - - Starts an asychronous transaction the request the used and total amount of data allocated for the Experience. The dataserver callback will be executed with the key returned from this call and a string describing the result. The result is commma-delimited list. The first item is an integer specifying if the transaction succeeded (1) or not (0). In the failure case, the second item will be an integer corresponding to one of the XP_ERROR_... constants. In the success case the second item will be the the amount in use and the third item will be the total available. - + Generates a key (SHA-1 hash) using UUID generation to create a unique key.\nAs the UUID produced is versioned, it should never return a value of NULL_KEY.\nThe specific UUID version is an implementation detail that has changed in the past and may change again in the future. Do not depend upon the UUID that is returned to be version 5 SHA-1 hash. - llDeleteCharacter + llGetAccel + arguments + energy - - sleep - + 10 return - void - arguments - + vector + sleep + 0 tooltip - Convert link-set from AI/Physics character to Physics object.\nConvert the current link-set back to a standard object, removing all path-finding properties. + Returns the acceleration of the object relative to the region's axes.\nGets the acceleration of the object. - llDeleteKeyValue + llGetAgentInfo - energy - 10.0 - sleep - 0.0 - return - key arguments - - Key - - type - string - tooltip - - - + + AvatarID + + tooltip + + type + key + + + energy + 10 + return + integer + sleep + 0 tooltip - Starts an asychronous transaction to delete a key-value pair. The dataserver callback will be executed with the key returned from this call and a string describing the result. The result is a two element commma-delimited list. The first item is an integer specifying if the transaction succeeded (1) or not (0). In the failure case, the second item will be an integer corresponding to one of the XP_ERROR_... constants. In the success case the second item will be the value associated with the key. + Returns an integer bit-field containing the agent information about id.\n + Returns AGENT_FLYING, AGENT_ATTACHMENTS, AGENT_SCRIPTED, AGENT_SITTING, AGENT_ON_OBJECT, AGENT_MOUSELOOK, AGENT_AWAY, AGENT_BUSY, AGENT_TYPING, AGENT_CROUCHING, AGENT_ALWAYS_RUN, AGENT_WALKING, AGENT_IN_AIR and/or AGENT_FLOATING_VIA_SCRIPTED_ATTACHMENT.\nReturns information about the given agent ID as a bit-field of agent info constants. - llDeleteSubList + llGetAgentLanguage - energy - 10.0 - sleep - 0.0 - return - list arguments - Source + AvatarID - type - list tooltip - + + type + key + + energy + 10 + return + string + sleep + 0 + tooltip + Returns the language code of the preferred interface language of the avatar.\nReturns a string that is the language code of the preferred interface language of the resident. + + llGetAgentList + + arguments + - Start + Scope + tooltip + The scope (region, parcel, parcel same owner) to return agents for. type integer - tooltip - - End + Options - type - integer tooltip - + List of options to apply. Current unused. + type + list + energy + 10 + return + list + sleep + 0 tooltip - Removes the slice from start to end and returns the remainder of the list.\nRemove a slice from the list and return the remainder, start and end are inclusive.\nUsing negative numbers for start and/or end causes the index to count backwards from the length of the list, so 0, -1 would delete the entire list.\nIf Start is larger than End the list deleted is the exclusion of the entries; so 6, 4 would delete the entire list except for the 5th. list entry. + Requests a list of agents currently in the region, limited by the scope parameter.\nReturns a list [key UUID-0, key UUID-1, ..., key UUID-n] or [string error_msg] - returns avatar keys for all agents in the region limited to the area(s) specified by scope - llDeleteSubString + llGetAgentSize - energy - 10.0 - sleep - 0.0 - return - string arguments - Source + AvatarID - type - string tooltip - - - - - Start - + type - integer - tooltip - + key + + energy + 10 + return + vector + sleep + 0 + tooltip + If the avatar is in the same region, returns the size of the bounding box of the requested avatar by id, otherwise returns ZERO_VECTOR.\nIf the agent is in the same region as the object, returns the size of the avatar. + + llGetAlpha + + arguments + - End + Face + tooltip + type integer - tooltip - + energy + 10 + return + float + sleep + 0 tooltip - Removes the indicated sub-string and returns the result.\nStart and End are inclusive.\nUsing negative numbers for Start and/or End causes the index to count backwards from the length of the string, so 0, -1 would delete the entire string.\nIf Start is larger than End, the sub-string is the exclusion of the entries; so 6, 4 would delete the entire string except for the 5th. character. + Returns the alpha value of Face.\nReturns the 'alpha' of the given face. If face is ALL_SIDES the value returned is the mean average of all faces. - llDetachFromAvatar + llGetAndResetTime + arguments + energy - 10.0 - sleep - 0.0 + 10 return - void - arguments - + float + sleep + 0 tooltip - Remove the object containing the script from the avatar. + Returns the script time in seconds and then resets the script timer to zero.\nGets the time in seconds since starting and resets the time to zero. - llDetectedGrab + llGetAnimation - energy - 10.0 - sleep - 0.0 - return - vector arguments - Number + AvatarID - type - integer tooltip - + + type + key + energy + 10 + return + string + sleep + 0 tooltip - Returns the grab offset of a user touching the object.\nReturns <0.0, 0.0, 0.0> if Number is not a valid object. + Returns the name of the currently playing locomotion animation for the avatar id.\nReturns the currently playing animation for the specified avatar ID. - llDetectedGroup + llGetAnimationList - energy - 10.0 - sleep - 0.0 - return - integer arguments - Number + AvatarID - type - integer tooltip - + + type + key + energy + 10 + return + list + sleep + 0 tooltip - Returns TRUE if detected object or agent Number has the same user group active as this object.\nIt will return FALSE if the object or agent is in the group, but the group is not active. + Returns a list of keys of playing animations for an avatar.\nReturns a list of keys of all playing animations for the specified avatar ID. - llDetectedKey + llGetAnimationOverride - energy - 10.0 - sleep - 0.0 - return - key arguments - Number + AnimationState - type - integer tooltip - + + type + string + energy + 10 + return + string + sleep + 0 tooltip - Returns the key of detected object or avatar number.\nReturns NULL_KEY if Number is not a valid index. + Returns a string that is the name of the animation that is used for the specified animation state\nTo use this function the script must obtain either the PERMISSION_OVERRIDE_ANIMATIONS or PERMISSION_TRIGGER_ANIMATION permission (automatically granted to attached objects). - llDetectedLinkNumber + llGetAttached + arguments + energy - 10.0 - sleep - 0.0 + 10 return integer + sleep + 0 + tooltip + Returns the object's attachment point, or 0 if not attached. + + llGetAttachedList + arguments - Number + ID - type - integer tooltip - + Avatar to get attachments + type + key + energy + 10 + return + list + sleep + 0 tooltip - Returns the link position of the triggered event for touches and collisions only.\n0 for a non-linked object, 1 for the root of a linked object, 2 for the first child, etc. + Returns a list of keys of all visible (not HUD) attachments on the avatar identified by the ID argument - llDetectedName + llGetAttachedListFiltered - energy - 10.0 - sleep - 0.0 - return - string arguments - Number + AgentID + tooltip + An agent in the region. type - integer + key + + + + Options + tooltip - + A list of option for inventory transfer. + type + list + energy + 10 + return + list + sleep + 0 tooltip - Returns the name of detected object or avatar number.\nReturns the name of detected object number.\nReturns empty string if Number is not a valid index. + Retrieves a list of attachments on an avatar. - llDetectedOwner + llGetBoundingBox - energy - 10.0 - sleep - 0.0 - return - key arguments - Number + ID - type - integer tooltip - + + type + key + energy + 10 + return + list + sleep + 0 tooltip - Returns the key of detected object's owner.\nReturns invalid key if Number is not a valid index. + Returns the bounding box around the object (including any linked prims) relative to its root prim, as a list in the format [ (vector) min_corner, (vector) max_corner ]. - llDetectedPos + llGetCameraAspect + + arguments + + energy + 10 + return + float + sleep + 0 + tooltip + Returns the current camera aspect ratio (width / height) of the agent who has granted the scripted object PERMISSION_TRACK_CAMERA permissions. If no permissions have been granted: it returns zero. + + llGetCameraFOV + arguments + energy - 10.0 + 10 + return + float sleep - 0.0 + 0 + tooltip + Returns the current camera field of view of the agent who has granted the scripted object PERMISSION_TRACK_CAMERA permissions. If no permissions have been granted: it returns zero. + + llGetCameraPos + + arguments + + energy + 10 return vector - arguments - - - Number - - type - integer - tooltip - - - - + sleep + 0 tooltip - Returns the position of detected object or avatar number.\nReturns <0.0, 0.0, 0.0> if Number is not a valid index. + Returns the current camera position for the agent the task has permissions for.\nReturns the position of the camera, of the user that granted the script PERMISSION_TRACK_CAMERA. If no user has granted the permission, it returns ZERO_VECTOR. - llDetectedRot + llGetCameraRot + arguments + energy - 10.0 - sleep - 0.0 + 10 return rotation - arguments - - - Number - - type - integer - tooltip - - - - + sleep + 0 tooltip - Returns the rotation of detected object or avatar number.\nReturns <0.0, 0.0, 0.0, 1.0> if Number is not a valid offset. + Returns the current camera orientation for the agent the task has permissions for. If no user has granted the PERMISSION_TRACK_CAMERA permission, returns ZERO_ROTATION. - llDetectedTouchBinormal + llGetCenterOfMass + arguments + energy - 10.0 - sleep - 0.0 + 10 return vector + sleep + 0 + tooltip + Returns the prim's centre of mass (unless called from the root prim, where it returns the object's centre of mass). + + llGetClosestNavPoint + arguments - Index + Point - type - integer tooltip - Index of detection information + A point in region-local space. + type + vector - - tooltip - Returns the surface bi-normal for a triggered touch event.\nReturns a vector that is the surface bi-normal (tangent to the surface) where the touch event was triggered. - - llDetectedTouchFace - - energy - 10.0 - sleep - 0.0 - return - integer - arguments - - Index + Options - type - integer tooltip - Index of detection information + No options at this time. + type + list + energy + 10 + return + list + sleep + 0 tooltip - Returns the index of the face where the avatar clicked in a triggered touch event. + Get the closest navigable point to the point provided.\nThe function accepts a point in region-local space (like all the other path-finding methods) and returns either an empty list or a list containing a single vector which is the closest point on the navigation-mesh to the point provided. - llDetectedTouchNormal + llGetColor - energy - 10.0 - sleep - 0.0 - return - vector arguments - Index + Face + tooltip + type integer - tooltip - Index of detection information + energy + 10 + return + vector + sleep + 0 tooltip - Returns the surface normal for a triggered touch event.\nReturns a vector that is the surface normal (perpendicular to the surface) where the touch event was triggered. + Returns the color on Face.\nReturns the color of Face as a vector of red, green, and blue values between 0 and 1. If face is ALL_SIDES the color returned is the mean average of each channel. - llDetectedTouchPos + llGetCreator + arguments + energy - 10.0 - sleep - 0.0 + 10 return - vector - arguments - - - Index - - type - integer - tooltip - Index of detected information - - - + key + sleep + 0 tooltip - Returns the position, in region coordinates, where the object was touched in a triggered touch event.\nUnless it is a HUD, in which case it returns the position relative to the attach point. + Returns a key for the creator of the prim.\nReturns the key of the object's original creator. Similar to llGetOwner. - llDetectedTouchST + llGetDate + arguments + energy - 10.0 - sleep - 0.0 + 10 return - vector - arguments - - - Index - - type - integer - tooltip - Index of detection information - - - + string + sleep + 0 tooltip - Returns a vector that is the surface coordinates where the prim was touched.\nThe X and Y vector positions contain the horizontal (S) and vertical (T) face coordinates respectively.\nEach component is in the interval [0.0, 1.0].\nTOUCH_INVALID_TEXCOORD is returned if the surface coordinates cannot be determined (e.g. when the viewer does not support this function). + Returns the current date in the UTC time zone in the format YYYY-MM-DD.\nReturns the current UTC date as YYYY-MM-DD. - llDetectedTouchUV + llGetDayLength + arguments + energy - 10.0 - sleep - 0.0 + 10 return - vector - arguments - - - Index - - type - integer - tooltip - Index of detection information - - - + integer + sleep + 0 tooltip - Returns a vector that is the texture coordinates for where the prim was touched.\nThe X and Y vector positions contain the U and V face coordinates respectively.\nTOUCH_INVALID_TEXCOORD is returned if the touch UV coordinates cannot be determined (e.g. when the viewer does not support this function). + Returns the number of seconds in a day on this parcel. - llDetectedType + llGetDayOffset + arguments + energy - 10.0 - sleep - 0.0 + 10 return integer + sleep + 0 + tooltip + Returns the number of seconds in a day is offset from midnight in this parcel. + + llGetDisplayName + arguments - Number + AvatarID - type - integer tooltip - + Avatar UUID that is in the same region, or is otherwise known to the region. + type + key + energy + 10 + return + string + sleep + 0 tooltip - Returns the type (AGENT, ACTIVE, PASSIVE, SCRIPTED) of detected object.\nReturns 0 if number is not a valid index.\nNote that number is a bit-field, so comparisons need to be a bitwise checked. e.g.:\ninteger iType = llDetectedType(0);\n{\n // ...do stuff with the agent\n} + Returns the display name of an avatar, if the avatar is connected to the current region, or if the name has been cached. Otherwise, returns an empty string. Use llRequestDisplayName if the avatar may be absent from the region. - llDetectedVel + llGetEnergy + arguments + energy - 10.0 - sleep - 0.0 + 10 return - vector + float + sleep + 0 + tooltip + Returns how much energy is in the object as a percentage of maximum. + + llGetEnv + arguments - Number + DataRequest - type - integer tooltip - + The type of data to request. Any other string will cause an empty string to be returned. + type + string + energy + 10 + return + string + sleep + 0 tooltip - Returns the velocity of the detected object Number.\nReturns<0.0, 0.0, 0.0> if Number is not a valid offset. + Returns a string with the requested data about the region. - llDialog + llGetEnvironment - energy - 10.0 - sleep - 0.1 - return - void arguments - AvatarID + Position - type - key tooltip - - - - - Text - + Location within the region. type - string - tooltip - + vector - Buttons + EnvParams - type - list tooltip - - - - - Channel - + List of environment settings requested for the specified parcel location. type - integer - tooltip - + list - tooltip - Shows a dialog box on the avatar's screen with the message.\n - Up to 12 strings in the list form buttons.\n - If a button is clicked, the name is chatted on Channel.\nOpens a "notify box" in the given avatars screen displaying the message.\n - Up to twelve buttons can be specified in a list of strings. When the user clicks a button, the name of the button is said on the specified channel.\n - Channels work just like llSay(), so channel 0 can be heard by everyone.\n - The chat originates at the object's position, not the avatar's position, even though it is said as the avatar (uses avatar's UUID and Name etc.).\n - Examples:\n - llDialog(who, "Are you a boy or a girl?", [ "Boy", "Girl" ], -4913);\n - llDialog(who, "This shows only an OK button.", [], -192);\n - llDialog(who, "This chats so you can 'hear' it.", ["Hooray"], 0); - - llDie - energy - 0.0 - sleep - 0.0 + 10 return - void - arguments - + list + sleep + 0 tooltip - Delete the object which holds the script. + Returns a string with the requested data about the region. - llDumpList2String + llGetExperienceDetails - energy - 10.0 - sleep - 0.0 - return - string arguments - Source + ExperienceID - type - list tooltip - - - - - Separator - + May be NULL_KEY to retrieve the details for the script's Experience type - string - tooltip - + key + energy + 10 + return + list + sleep + 0 tooltip - Returns the list as a single string, using Separator between the entries.\nWrite the list out as a single string, using Separator between values. + + Returns a list with the following Experience properties: [Experience Name, Owner ID, Group ID, Experience ID, State, State Message]. State is an integer corresponding to one of the constants XP_ERROR_... and State Message is the string returned by llGetExperienceErrorMessage for that integer. + - llEdgeOfWorld + llGetExperienceErrorMessage - energy - 10.0 - sleep - 0.0 - return - integer arguments - Position + Error - type - vector tooltip - - - - - Direction - + An Experience error code to translate. type - vector - tooltip - + integer + energy + 10 + return + string + sleep + 0 tooltip - Checks to see whether the border hit by Direction from Position is the edge of the world (has no neighboring region).\nReturns TRUE if the line along Direction from Position hits the edge of the world in the current simulator, returns FALSE if that edge crosses into another simulator. + + Returns a string describing the error code passed or the string corresponding with XP_ERROR_UNKNOWN_ERROR if the value is not a valid Experience error code. + - llEjectFromLand + llGetForce + arguments + energy - 10.0 + 10 + return + vector sleep - 0.0 + 0 + tooltip + Returns the force (if the script is physical).\nReturns the current force if the script is physical. + + llGetFreeMemory + + arguments + + energy + 10 return - void + integer + sleep + 0 + tooltip + Returns the number of free bytes of memory the script can use.\nReturns the available free space for the current script. This is inaccurate with LSO. + + llGetFreeURLs + arguments - - - AvatarID - - type - key - tooltip - - - - + + energy + 10 + return + integer + sleep + 0 tooltip - Ejects AvatarID from land that you own.\nEjects AvatarID from land that the object owner (group or resident) owns. + Returns the number of available URLs for the current script.\nReturns an integer that is the number of available URLs. - llEmail + llGetGMTclock + arguments + energy - 10.0 + 10 + return + float sleep - 20.0 + 0 + tooltip + Returns the time in seconds since midnight GMT.\nGets the time in seconds since midnight in GMT/UTC. + + llGetGeometricCenter + + arguments + + energy + 10 return - void + vector + sleep + 0 + tooltip + Returns the vector that is the geometric center of the object relative to the root prim. + + llGetHTTPHeader + arguments - Address + HTTPRequestID - type - string tooltip - - - - - Subject - + A valid HTTP request key type - string - tooltip - + key - Text + Header + tooltip + Header value name type string - tooltip - - tooltip - Sends email to Address with Subject and Message.\nSends an email to Address with Subject and Message. - - llEscapeURL - energy - 10.0 - sleep - 0.0 + 10 return string + sleep + 0 + tooltip + Returns the value for header for request_id.\nReturns a string that is the value of the Header for HTTPRequestID. + + llGetHealth + arguments - URL + ID - type - string tooltip - + The ID of an agent or object in the region. + type + key + energy + 10 + return + float + sleep + 0 tooltip - Returns an escaped/encoded version of url, replacing spaces with %20 etc.\nReturns the string that is the URL-escaped version of URL (replacing spaces with %20, etc.).\n - This function returns the UTF-8 encoded escape codes for selected characters. + Returns the current health of an avatar or object in the region. - llEuler2Rot + llGetInventoryAcquireTime - energy - 10.0 - sleep - 0.0 - return - rotation arguments - Vector + InventoryItem - type - vector tooltip - + Name of item in prim inventory. + type + string + energy + 10 + return + string + sleep + 0 tooltip - Returns the rotation representation of the Euler angles.\nReturns the rotation represented by the Euler Angle. + Returns the time at which the item was placed into this prim's inventory as a timestamp. - llEvade + llGetInventoryCreator - energy - - sleep - - return - void arguments - TargetID + InventoryItem - type - key tooltip - Agent or object to evade. - - - - Options - + type - list - tooltip - No options yet. + string + energy + 10 + return + key + sleep + 0 tooltip - Evade a specified target.\nCharacters will (roughly) try to hide from their pursuers if there is a good hiding spot along their fleeing path. Hiding means no direct line of sight from the head of the character (centre of the top of its physics bounding box) to the head of its pursuer and no direct path between the two on the navigation-mesh. + Returns a key for the creator of the inventory item.\nThis function returns the UUID of the creator of item. If item is not found in inventory, the object says "No item named 'name'". - llExecCharacterCmd + llGetInventoryDesc - energy - - sleep - - return - void arguments - Command + InventoryItem - type - integer tooltip - Command to send. - - - - Options - + type - list - tooltip - Height for CHARACTER_CMD_JUMP. + string + energy + 10 + return + string + sleep + 0 tooltip - Execute a character command.\nSend a command to the path system.\nCurrently only supports stopping the current path-finding operation or causing the character to jump. + Returns the item description of the item in inventory. If item is not found in inventory, the object says "No item named 'name'" to the debug channel and returns an empty string. - llFabs + llGetInventoryKey - energy - 10.0 - sleep - 0.0 - return - float arguments - Value + InventoryItem - type - float tooltip - + + type + string + energy + 10 + return + key + sleep + 0 tooltip - Returns the positive version of Value.\nReturns the absolute value of Value. + Returns the key that is the UUID of the inventory named.\nReturns the key of the inventory named. - llFleeFrom + llGetInventoryName - energy - - sleep - - return - void arguments - Source + InventoryType - type - vector tooltip - Global coordinate from which to flee. - - - - Distance - + Inventory item type type - float - tooltip - Distance in meters to flee from the source. + integer - Options + Index - type - list tooltip - No options available at this time. + Index number of inventory item. + type + integer + energy + 10 + return + string + sleep + 0 tooltip - Flee from a point.\nDirects a character (llCreateCharacter) to keep away from a defined position in the region or adjacent regions. + Returns the name of the inventory item of a given type, specified by index number.\nUse the inventory constants INVENTORY_* to specify the type. - llFloor + llGetInventoryNumber - energy - 10.0 - sleep - 0.0 - return - integer arguments - Value + InventoryType - type - float tooltip - + Inventory item type + type + integer + energy + 10 + return + integer + sleep + 0 tooltip - Returns largest integer value <= Value. + Returns the quantity of items of a given type (INVENTORY_* flag) in the prim's inventory.\nUse the inventory constants INVENTORY_* to specify the type. - llForceMouselook + llGetInventoryPermMask - energy - 10.0 - sleep - 0.0 - return - void arguments - Enable + InventoryItem + tooltip + Inventory item name. type - integer + string + + + + BitMask + tooltip - Boolean, if TRUE when an avatar sits on the prim, the avatar will be forced into mouse-look mode.\nFALSE is the default setting and will undo a previously set TRUE or do nothing. + MASK_BASE, MASK_OWNER, MASK_GROUP, MASK_EVERYONE or MASK_NEXT + type + integer + energy + 10 + return + integer + sleep + 0 tooltip - If Enable is TRUE any avatar that sits on this object is forced into mouse-look mode.\nAfter calling this function with Enable set to TRUE, any agent sitting down on the prim will be forced into mouse-look.\nJust like llSitTarget, this changes a permanent property of the prim (not the object) and needs to be reset by calling this function with Enable set to FALSE in order to disable it. + Returns the requested permission mask for the inventory item.\nReturns the requested permission mask for the inventory item defined by InventoryItem. If item is not in the object's inventory, llGetInventoryPermMask returns FALSE and causes the object to say "No item named '<item>'", where "<item>" is item. - llFrand + llGetInventoryType - energy - 10.0 - sleep - 0.0 - return - float arguments - Magnitude + InventoryItem - type - float tooltip - + + type + string - tooltip - Returns a pseudo random number in the range [0, Magnitude] or [Magnitude, 0].\nReturns a pseudo-random number between [0, Magnitude]. - - llGenerateKey - energy - 0 + 10 + return + integer sleep 0 - return - key - arguments - tooltip - Generates a key (SHA-1 hash) using UUID generation to create a unique key.\nAs the UUID produced is versioned, it should never return a value of NULL_KEY.\nThe specific UUID version is an implementation detail that has changed in the past and may change again in the future. Do not depend upon the UUID that is returned to be version 5 SHA-1 hash. + Returns the type of the named inventory item.\nLike all inventory functions, llGetInventoryType is case-sensitive. - llGetAccel + llGetKey + arguments + energy - 10.0 - sleep - 0.0 + 10 return - vector - arguments - + key + sleep + 0 tooltip - Returns the acceleration of the object relative to the region's axes.\nGets the acceleration of the object. + Returns the key of the prim the script is attached to.\nGet the key for the object which has this script. - llGetAgentInfo + llGetLandOwnerAt - energy - 10.0 - sleep - 0.0 - return - integer arguments - AvatarID + Position - type - key tooltip - + + type + vector + energy + 10 + return + key + sleep + 0 tooltip - Returns an integer bit-field containing the agent information about id.\n - Returns AGENT_FLYING, AGENT_ATTACHMENTS, AGENT_SCRIPTED, AGENT_SITTING, AGENT_ON_OBJECT, AGENT_MOUSELOOK, AGENT_AWAY, AGENT_BUSY, AGENT_TYPING, AGENT_CROUCHING, AGENT_ALWAYS_RUN, AGENT_WALKING and/or AGENT_IN_AIR.\nReturns information about the given agent ID as a bit-field of agent info constants. + Returns the key of the land owner, returns NULL_KEY if public.\nReturns the key of the land owner at Position, or NULL_KEY if public. - llGetAgentLanguage + llGetLinkKey - energy - 10.0 - sleep - 0.0 - return - string arguments - AvatarID + LinkNumber - type - key tooltip - + + type + integer + energy + 10 + return + key + sleep + 0 tooltip - Returns the language code of the preferred interface language of the avatar.\nReturns a string that is the language code of the preferred interface language of the resident. + Returns the key of the linked prim LinkNumber.\nReturns the key of LinkNumber in the link set. - llGetAgentList + llGetLinkMedia - energy - 10.0 - sleep - 0.0 - return - list arguments - Scope + LinkNumber + tooltip + Link number (0: unlinked, 1: root prim, >1: child prims) or a LINK_* flag type integer - tooltip - The scope (region, parcel, parcel same owner) to return agents for. - Options + Face - type - list tooltip - List of options to apply. Current unused. + The prim's side number + type + integer - - tooltip - Requests a list of agents currently in the region, limited by the scope parameter.\nReturns a list [key UUID-0, key UUID-1, ..., key UUID-n] or [string error_msg] - returns avatar keys for all agents in the region limited to the area(s) specified by scope - - llGetAgentSize - - energy - 10.0 - sleep - 0.0 - return - vector - arguments - - AvatarID + Parameters - type - key tooltip - + A list of PRIM_* property constants to return values of. + type + list + energy + 10 + return + list + sleep + 0 tooltip - If the avatar is in the same region, returns the size of the bounding box of the requested avatar by id, otherwise returns ZERO_VECTOR.\nIf the agent is in the same region as the object, returns the size of the avatar. + Get the media parameters for a particular face on linked prim, given the desired list of parameter names. Returns a list of values in the order requested. Returns an empty list if no media exists on the face. - llGetAlpha + llGetLinkName - energy - 10.0 - sleep - 0.0 - return - float arguments - Face + LinkNumber + tooltip + type integer - tooltip - + energy + 10 + return + string + sleep + 0 tooltip - Returns the alpha value of Face.\nReturns the 'alpha' of the given face. If face is ALL_SIDES the value returned is the mean average of all faces. + Returns the name of LinkNumber in a link set.\nReturns the name of LinkNumber the link set. - llGetAndResetTime + llGetLinkNumber + arguments + energy - 10.0 - sleep - 0.0 + 10 return - float - arguments - + integer + sleep + 0 tooltip - Returns the script time in seconds and then resets the script timer to zero.\nGets the time in seconds since starting and resets the time to zero. + Returns the link number of the prim containing the script (0 means not linked, 1 the prim is the root, 2 the prim is the first child, etc.).\nReturns the link number of the prim containing the script. 0 means no link, 1 the root, 2 for first child, etc. - llGetAnimation + llGetLinkNumberOfSides - energy - 10.0 - sleep - 0.0 - return - string arguments - AvatarID + LinkNumber - type - key tooltip - + Link number (0: unlinked, 1: root prim, >1: child prims) or a LINK_* flag. + type + integer + energy + 10 + return + integer + sleep + 0 tooltip - Returns the name of the currently playing locomotion animation for the avatar id.\nReturns the currently playing animation for the specified avatar ID. + Returns the number of sides of the specified linked prim.\nReturns an integer that is the number of faces (or sides) of the prim link. - llGetAnimationList + llGetLinkPrimitiveParams - energy - 10.0 - sleep - 0.0 - return - list arguments - AvatarID + LinkNumber + tooltip + Link number (0: unlinked, 1: root prim, >1: child prims) or a LINK_* flag. type - key + integer + + + + Parameters + tooltip - + PRIM_* flags. + type + list - tooltip - Returns a list of keys of playing animations for an avatar.\nReturns a list of keys of all playing animations for the specified avatar ID. - - llGetAnimationOverride - energy - 0 + 10 + return + list sleep 0 - return - string + tooltip + Returns the list of primitive attributes requested in the Parameters list for LinkNumber.\nPRIM_* flags can be broken into three categories, face flags, prim flags, and object flags.\n* Supplying a prim or object flag will return that flags attributes.\n* Face flags require the user to also supply a face index parameter. + + llGetLinkSitFlags + arguments - AnimationState + LinkNumber - type - string tooltip - + Link number (0: unlinked, 1: root prim, >1: child prims) or a LINK_* flag. + type + integer - - tooltip - Returns a string that is the name of the animation that is used for the specified animation state\nTo use this function the script must obtain either the PERMISSION_OVERRIDE_ANIMATIONS or PERMISSION_TRIGGER_ANIMATION permission (automatically granted to attached objects). - - llGetAttached - + energy - 10.0 - sleep - 0.0 + 10 return integer - arguments - + sleep + 0 tooltip - Returns the object's attachment point, or 0 if not attached. + Returns the sit flags set on the specified prim in a linkset. - llGetAttachedList + llGetListEntryType - energy - 10.0 - sleep - 0.0 - return - list arguments - ID + ListVariable + tooltip + type - key + list + + + + Index + tooltip - Avatar to get attachments + + type + integer + energy + 10 + return + integer + sleep + 0 tooltip - Returns a list of keys of all visible (not HUD) attachments on the avatar identified by the ID argument + Returns the type of the index entry in the list (TYPE_INTEGER, TYPE_FLOAT, TYPE_STRING, TYPE_KEY, TYPE_VECTOR, TYPE_ROTATION, or TYPE_INVALID if index is off list).\nReturns the type of the variable at Index in ListVariable. - llGetBoundingBox + llGetListLength - energy - 10.0 - sleep - 0.0 - return - list arguments - ID + ListVariable - type - key tooltip - + + type + list + energy + 10 + return + integer + sleep + 0 tooltip - Returns the bounding box around the object (including any linked prims) relative to its root prim, as a list in the format [ (vector) min_corner, (vector) max_corner ]. + Returns the number of elements in the list.\nReturns the number of elements in ListVariable. - llGetCameraPos + llGetLocalPos + arguments + energy - 10.0 - sleep - 0.0 + 10 return vector - arguments - + sleep + 0 tooltip - Returns the current camera position for the agent the task has permissions for.\nReturns the position of the camera, of the user that granted the script PERMISSION_TRACK_CAMERA. If no user has granted the permission, it returns ZERO_VECTOR. + Returns the position relative to the root.\nReturns the local position of a child object relative to the root. - llGetCameraRot + llGetLocalRot + arguments + energy - 10.0 - sleep - 0.0 + 10 return rotation - arguments - + sleep + 0 tooltip - Returns the current camera orientation for the agent the task has permissions for. If no user has granted the PERMISSION_TRACK_CAMERA permission, returns ZERO_ROTATION. + Returns the rotation local to the root.\nReturns the local rotation of a child object relative to the root. - llGetCenterOfMass + llGetMass + arguments + energy - 10.0 - sleep - 0.0 + 10 return - vector - arguments - + float + sleep + 0 tooltip - Returns the prim's centre of mass (unless called from the root prim, where it returns the object's centre of mass). + Returns the mass of object that the script is attached to.\nReturns the scripted object's mass. When called from a script in a link-set, the parent will return the sum of the link-set weights, while a child will return just its own mass. When called from a script inside an attachment, this function will return the mass of the avatar it's attached to, not its own. - llGetClosestNavPoint + llGetMassMKS + arguments + energy - - sleep - + 10 return - list - arguments - - - Point - - type - vector - tooltip - A point in region-local space. - - - - Options - - type - list - tooltip - No options at this time. - - - + float + sleep + 0 tooltip - Get the closest navigable point to the point provided.\nThe function accepts a point in region-local space (like all the other path-finding methods) and returns either an empty list or a list containing a single vector which is the closest point on the navigation-mesh to the point provided. + Acts as llGetMass(), except that the units of the value returned are Kg. - llGetColor + llGetMaxScaleFactor + arguments + energy - 10.0 - sleep - 0.0 + 10 return - vector - arguments - - - Face - - type - integer - tooltip - - - - + float + sleep + 0 tooltip - Returns the color on Face.\nReturns the color of Face as a vector of red, green, and blue values between 0 and 1. If face is ALL_SIDES the color returned is the mean average of each channel. + Returns the largest multiplicative uniform scale factor that can be successfully applied (via llScaleByFactor()) to the object without violating prim size or linkability rules. - llGetCreator + llGetMemoryLimit + arguments + energy - 10.0 - sleep - 0.0 + 10 return - key - arguments - + integer + sleep + 0 tooltip - Returns a key for the creator of the prim.\nReturns the key of the object's original creator. Similar to llGetOwner. + Get the maximum memory a script can use, in bytes. - llGetDate + llGetMinScaleFactor + arguments + energy - 10.0 - sleep - 0.0 + 10 return - string - arguments - + float + sleep + 0 tooltip - Returns the current date in the UTC time zone in the format YYYY-MM-DD.\nReturns the current UTC date as YYYY-MM-DD. + Returns the smallest multiplicative uniform scale factor that can be successfully applied (via llScaleByFactor()) to the object without violating prim size or linkability rules. - llGetDisplayName + llGetMoonDirection + arguments + energy - 10.0 + 10 + return + vector sleep - 0.0 + 0 + tooltip + Returns a normalized vector of the direction of the moon in the parcel.\nReturns the moon's direction on the simulator in the parcel. + + llGetMoonRotation + + arguments + + energy + 10 return - string + rotation + sleep + 0 + tooltip + Returns the rotation applied to the moon in the parcel. + + llGetNextEmail + arguments - AvatarID + Address + tooltip + type - key + string + + + + Subject + tooltip - Avatar UUID that is in the same region, or is otherwise known to the region. + + type + string - tooltip - Returns the display name of an avatar, if the avatar is connected to the current region, or if the name has been cached. Otherwise, returns an empty string. Use llRequestDisplayName if the avatar may be absent from the region. - - llGetEnergy - energy - 10.0 - sleep - 0.0 + 10 return - float - arguments - + void + sleep + 0 tooltip - Returns how much energy is in the object as a percentage of maximum. + Fetch the next queued email with that matches the given address and/or subject, via the email event.\nIf the parameters are blank, they are not used for filtering. - llGetEnv + llGetNotecardLine - energy - 10.0 - sleep - 0.0 - return - string arguments - DataRequest + NotecardName + tooltip + type string + + + + LineNumber + tooltip - The type of data to request. Any other string will cause an empty string to be returned. + + type + integer + energy + 10 + return + key + sleep + 0.1000000000000000055511151 tooltip - Returns a string with the requested data about the region. + Returns LineNumber from NotecardName via the dataserver event. The line index starts at zero.\nIf the requested line is passed the end of the note-card the dataserver event will return the constant EOF string.\nThe key returned by this function is a unique identifier which will be supplied to the dataserver event in the requested parameter. - llGetExperienceDetails + llGetNotecardLineSync - energy - 10.0 - sleep - 0.0 - return - list arguments - - ExperienceID - - type - key - tooltip - May be NULL_KEY to retrieve the details for the script's Experience - - + + NotecardName + + tooltip + + type + string + + + + LineNumber + + tooltip + + type + integer + + - tooltip - - Returns a list with the following Experience properties: [Experience Name, Owner ID, Group ID, Experience ID, State, State Message]. State is an integer corresponding to one of the constants XP_ERROR_... and State Message is the string returned by llGetExperienceErrorMessage for that integer. - - - llGetExperienceErrorMessage - energy - 10.0 - sleep - 0.0 + 10 return string - arguments - - - Error - - type - integer - tooltip - An Experience error code to translate. - - - - tooltip - - Returns a string describing the error code passed or the string corresponding with XP_ERROR_UNKNOWN_ERROR if the value is not a valid Experience error code. - + sleep + 0 + tooltip + Returns LineNumber from NotecardName. The line index starts at zero.\nIf the requested line is past the end of the note-card the return value will be set to the constant EOF string.\nIf the note-card is not cached on the simulator the return value is the NAK string. - llGetForce + llGetNumberOfNotecardLines + arguments + + + NotecardName + + tooltip + + type + string + + + energy - 10.0 - sleep - 0.0 + 10 return - vector - arguments - + key + sleep + 0.1000000000000000055511151 tooltip - Returns the force (if the script is physical).\nReturns the current force if the script is physical. + Returns the number of lines contained within a notecard via the dataserver event.\nThe key returned by this function is a query ID for identifying the dataserver reply. - llGetFreeMemory + llGetNumberOfPrims + arguments + energy - 10.0 - sleep - 0.0 + 10 return integer - arguments - + sleep + 0 tooltip - Returns the number of free bytes of memory the script can use.\nReturns the available free space for the current script. This is inaccurate with LSO. + Returns the number of prims in a link set the script is attached to.\nReturns the number of prims in (and avatars seated on) the object the script is in. - llGetFreeURLs + llGetNumberOfSides + arguments + energy - 10.0 - sleep - 0.0 + 10 return integer - arguments - + sleep + 0 tooltip - Returns the number of available URLs for the current script.\nReturns an integer that is the number of available URLs. + Returns the number of faces (or sides) of the prim.\nReturns the number of sides of the prim which has the script. - llGetGeometricCenter + llGetObjectAnimationNames + arguments + energy - 10.0 - sleep - 0.0 + 10 return - vector - arguments - + list + sleep + 0 tooltip - Returns the vector that is the geometric center of the object relative to the root prim. + Returns a list of names of playing animations for an object.\nReturns a list of names of all playing animations for the current object. - llGetGMTclock + llGetObjectDesc + arguments + energy - 10.0 - sleep - 0.0 + 10 return - float - arguments - + string + sleep + 0 tooltip - Returns the time in seconds since midnight GMT.\nGets the time in seconds since midnight in GMT/UTC. + Returns the description of the prim the script is attached to.\nReturns the description of the scripted object/prim. You can set the description using llSetObjectDesc. - llGetHTTPHeader + llGetObjectDetails - energy - 10.0 - sleep - 0.0 - return - string arguments - HTTPRequestID + ID + tooltip + Prim or avatar UUID that is in the same region. type key - tooltip - A valid HTTP request key - Header + Parameters - type - string tooltip - Header value name + List of OBJECT_* flags. + type + list + energy + 10 + return + list + sleep + 0 tooltip - Returns the value for header for request_id.\nReturns a string that is the value of the Header for HTTPRequestID. + Returns a list of object details specified in the Parameters list for the object or avatar in the region with key ID.\nParameters are specified by the OBJECT_* constants. - llGetInventoryCreator + llGetObjectLinkKey - energy - 10.0 - sleep - 0.0 - return - key arguments - InventoryItem + id + tooltip + UUID of prim type - string + key + + + + link_no + tooltip - + Link number to retrieve + type + integer - tooltip - Returns a key for the creator of the inventory item.\nThis function returns the UUID of the creator of item. If item is not found in inventory, the object says "No item named 'name'". - - llGetInventoryKey - energy - 10.0 - sleep - 0.0 + 10 return key + sleep + 0 + tooltip + Returns the key of the linked prim link_no in a linkset.\nReturns the key of link_no in the link set specified by id. + + llGetObjectMass + arguments - InventoryItem + ID - type - string tooltip - + + type + key + energy + 10 + return + float + sleep + 0 tooltip - Returns the key that is the UUID of the inventory named.\nReturns the key of the inventory named. + Returns the mass of the avatar or object in the region.\nGets the mass of the object or avatar corresponding to ID. - llGetInventoryName + llGetObjectName + arguments + energy - 10.0 - sleep - 0.0 + 10 return string + sleep + 0 + tooltip + Returns the name of the prim which the script is attached to.\nReturns the name of the prim (not object) which contains the script. + + llGetObjectPermMask + arguments - InventoryType + Category - type - integer tooltip - Inventory item type - - - - Index - + Category is one of MASK_BASE, MASK_OWNER, MASK_GROUP, MASK_EVERYONE, or MASK_NEXT type integer - tooltip - Index number of inventory item. - tooltip - Returns the name of the inventory item of a given type, specified by index number.\nUse the inventory constants INVENTORY_* to specify the type. - - llGetInventoryNumber - energy - 10.0 - sleep - 0.0 + 10 return integer + sleep + 0 + tooltip + Returns the permission mask of the requested category for the object. + + llGetObjectPrimCount + arguments - InventoryType + ObjectID - type - integer tooltip - Inventory item type + + type + key + energy + 10 + return + integer + sleep + 0 tooltip - Returns the quantity of items of a given type (INVENTORY_* flag) in the prim's inventory.\nUse the inventory constants INVENTORY_* to specify the type. + Returns the total number of prims for an object in the region.\nReturns the prim count for any object id in the same region. - llGetInventoryPermMask + llGetOmega + arguments + energy - 10.0 + 10 + return + vector sleep - 0.0 + 0 + tooltip + Returns the rotation velocity in radians per second.\nReturns a vector that is the rotation velocity of the object in radians per second. + + llGetOwner + + arguments + + energy + 10 return - integer + key + sleep + 0 + tooltip + Returns the object owner's UUID.\nReturns the key for the owner of the object. + + llGetOwnerKey + arguments - InventoryItem + ObjectID - type - string tooltip - Inventory item name. - - - - BitMask - + type - integer - tooltip - MASK_BASE, MASK_OWNER, MASK_GROUP, MASK_EVERYONE or MASK_NEXT + key + energy + 10 + return + key + sleep + 0 tooltip - Returns the requested permission mask for the inventory item.\nReturns the requested permission mask for the inventory item defined by InventoryItem. If item is not in the object's inventory, llGetInventoryPermMask returns FALSE and causes the object to say "No item named '<item>'", where "<item>" is item. + Returns the owner of ObjectID.\nReturns the key for the owner of object ObjectID. - llGetInventoryType + llGetParcelDetails - energy - 10.0 - sleep - 0.0 - return - integer arguments - InventoryItem + Position + tooltip + Location within the region. type - string + vector + + + + ParcelDetails + tooltip - + List of details requested for the specified parcel location. + type + list - tooltip - Returns the type of the named inventory item.\nLike all inventory functions, llGetInventoryType is case-sensitive. - - llGetKey - energy - 10.0 - sleep - 0.0 + 10 return - key - arguments - + list + sleep + 0 tooltip - Returns the key of the prim the script is attached to.\nGet the key for the object which has this script. + Returns a list of parcel details specified in the ParcelDetails list for the parcel at Position.\nParameters is one or more of: PARCEL_DETAILS_NAME, _DESC, _OWNER, _GROUP, _AREA, _ID, _SEE_AVATARS.\nReturns a list that is the parcel details specified in ParcelDetails (in the same order) for the parcel at Position. - llGetLandOwnerAt - - energy - 10.0 - sleep - 0.0 - return - key + llGetParcelFlags + arguments Position + tooltip + type vector - tooltip - + energy + 10 + return + integer + sleep + 0 tooltip - Returns the key of the land owner, returns NULL_KEY if public.\nReturns the key of the land owner at Position, or NULL_KEY if public. + Returns a mask of the parcel flags (PARCEL_FLAG_*) for the parcel that includes the point Position.\nReturns a bit-field specifying the parcel flags (PARCEL_FLAG_*) for the parcel at Position. - llGetLinkKey + llGetParcelMaxPrims - energy - 10.0 - sleep - 0.0 - return - key arguments - LinkNumber + Position + tooltip + Region coordinates (z is ignored) of parcel. type - integer + vector + + + + SimWide + tooltip - + Boolean. If FALSE then the return is the maximum prims supported by the parcel. If TRUE then it is the combined number of prims on all parcels in the region owned by the specified parcel's owner. + type + integer + energy + 10 + return + integer + sleep + 0 tooltip - Returns the key of the linked prim LinkNumber.\nReturns the key of LinkNumber in the link set. + Returns the maximum number of prims allowed on the parcel at Position for a given scope.\nThe scope may be set to an individual parcel or the combined resources of all parcels with the same ownership in the region. - llGetLinkMedia + llGetParcelMusicURL + arguments + energy - 0.0 - sleep - 0.0 + 10 return - list + string + sleep + 0 + tooltip + Gets the streaming audio URL for the parcel object is on.\nThe object owner, avatar or group, must also be the land owner. + + llGetParcelPrimCount + arguments - LinkNumber + Position - type - integer tooltip - Link number (0: unlinked, 1: root prim, >1: child prims) or a LINK_* flag + Region coordinates of parcel to query. + type + vector - Face + Category + tooltip + A PARCEL_COUNT_* flag. type integer - tooltip - The prim's side number - Parameters + SimWide - type - list tooltip - A list of PRIM_* property constants to return values of. + Boolean. If FALSE then the return is the maximum prims supported by the parcel. If TRUE then it is the combined number of prims on all parcels in the region owned by the specified parcel's owner. + type + integer + energy + 10 + return + integer + sleep + 0 tooltip - Get the media parameters for a particular face on linked prim, given the desired list of parameter names. Returns a list of values in the order requested. Returns an empty list if no media exists on the face. + Returns the number of prims on the parcel at Position of the given category.\nCategories: PARCEL_COUNT_TOTAL, _OWNER, _GROUP, _OTHER, _SELECTED, _TEMP.\nReturns the number of prims used on the parcel at Position which are in Category.\nIf SimWide is TRUE, it returns the total number of objects for all parcels with matching ownership in the category specified.\nIf SimWide is FALSE, it returns the number of objects on this specific parcel in the category specified - llGetLinkName + llGetParcelPrimOwners - energy - 10.0 - sleep - 0.0 - return - string arguments - LinkNumber + Position - type - integer tooltip - + + type + vector + energy + 10 + return + list + sleep + 2 tooltip - Returns the name of LinkNumber in a link set.\nReturns the name of LinkNumber the link set. + Returns a list of up to 100 residents who own objects on the parcel at Position, with per-owner land impact totals.\nRequires owner-like permissions for the parcel, and for the script owner to be present in the region.\nThe list is formatted as [ key agentKey1, integer agentLI1, key agentKey2, integer agentLI2, ... ], sorted by agent key.\nThe integers are the combined land impacts of the objects owned by the corresponding agents. - llGetLinkNumber + llGetPermissions + arguments + energy - 10.0 - sleep - 0.0 + 10 return integer - arguments - + sleep + 0 tooltip - Returns the link number of the prim containing the script (0 means not linked, 1 the prim is the root, 2 the prim is the first child, etc.).\nReturns the link number of the prim containing the script. 0 means no link, 1 the root, 2 for first child, etc. + Returns an integer bitmask of the permissions that have been granted to the script. Individual permissions can be determined using a bit-wise "and" operation against the PERMISSION_* constants - llGetLinkNumberOfSides + llGetPermissionsKey + arguments + energy - 10.0 - sleep - 0.0 + 10 return - integer - arguments - - - LinkNumber - - type - integer - tooltip - Link number (0: unlinked, 1: root prim, >1: child prims) or a LINK_* flag. - - - + key + sleep + 0 tooltip - Returns the number of sides of the specified linked prim.\nReturns an integer that is the number of faces (or sides) of the prim link. + Returns the key of the avatar that last granted or declined permissions to the script.\nReturns NULL_KEY if permissions were never granted or declined. - llGetLinkPrimitiveParams + llGetPhysicsMaterial + arguments + energy - 10.0 - sleep - 0.0 + 10 return list + sleep + 0 + tooltip + Returns a list of the form [float gravity_multiplier, float restitution, float friction, float density]. + + llGetPos + + arguments + + energy + 10 + return + vector + sleep + 0 + tooltip + Returns the position of the task in region coordinates.\nReturns the vector position of the task in region coordinates. + + llGetPrimMediaParams + arguments - LinkNumber + Face + tooltip + face number type integer - tooltip - Link number (0: unlinked, 1: root prim, >1: child prims) or a LINK_* flag. Parameters + tooltip + One or more PRIM_MEDIA_* flags type list - tooltip - PRIM_* flags. + energy + 10 + return + list + sleep + 1 tooltip - Returns the list of primitive attributes requested in the Parameters list for LinkNumber.\nPRIM_* flags can be broken into three categories, face flags, prim flags, and object flags.\n* Supplying a prim or object flag will return that flags attributes.\n* Face flags require the user to also supply a face index parameter. + Returns the media parameters for a particular face on an object, given the desired list of parameter names, in the order requested. Returns an empty list if no media exists on the face. - llGetListEntryType + llGetPrimitiveParams - energy - 10.0 - sleep - 0.0 - return - integer arguments - ListVariable + Parameters - type - list tooltip - - - - - Index - + PRIM_* flags and face parameters type - integer - tooltip - + list + energy + 10 + return + list + sleep + 0.2000000000000000111022302 tooltip - Returns the type of the index entry in the list (TYPE_INTEGER, TYPE_FLOAT, TYPE_STRING, TYPE_KEY, TYPE_VECTOR, TYPE_ROTATION, or TYPE_INVALID if index is off list).\nReturns the type of the variable at Index in ListVariable. + Returns the primitive parameters specified in the parameters list.\nReturns primitive parameters specified in the Parameters list. - llGetListLength + llGetRegionAgentCount + + arguments + + energy + 10 + return + integer + sleep + 0 + tooltip + Returns the number of avatars in the region.\nReturns an integer that is the number of avatars in the region. + + llGetRegionCorner + arguments + energy - 10.0 + 10 + return + vector sleep - 0.0 + 0 + tooltip + Returns a vector, in meters, that is the global location of the south-west corner of the region which the object is in.\nReturns the Region-Corner of the simulator containing the task. The region-corner is a vector (values in meters) representing distance from the first region. + + llGetRegionDayLength + + arguments + + energy + 10 return integer + sleep + 0 + tooltip + Returns the number of seconds in a day in this region. + + llGetRegionDayOffset + arguments - - - ListVariable - - type - list - tooltip - - - - + + energy + 10 + return + integer + sleep + 0 tooltip - Returns the number of elements in the list.\nReturns the number of elements in ListVariable. + Returns the number of seconds in a day is offset from midnight in this parcel. - llGetLocalPos + llGetRegionFPS + + arguments + + energy + 10 + return + float + sleep + 0 + tooltip + Returns the mean region frames per second. + + llGetRegionFlags + arguments + energy - 10.0 + 10 + return + integer sleep - 0.0 + 0 + tooltip + Returns the region flags (REGION_FLAG_*) for the region the object is in.\nReturns a bit-field specifying the region flags (REGION_FLAG_*) for the region the object is in. + + llGetRegionMoonDirection + + arguments + + energy + 10 return vector - arguments - + sleep + 0 tooltip - Returns the position relative to the root.\nReturns the local position of a child object relative to the root. + Returns a normalized vector of the direction of the moon in the region.\nReturns the moon's direction on the simulator. - llGetLocalRot + llGetRegionMoonRotation + arguments + energy - 10.0 - sleep - 0.0 + 10 return rotation - arguments - + sleep + 0 tooltip - Returns the rotation local to the root.\nReturns the local rotation of a child object relative to the root. + Returns the rotation applied to the moon in the region. - llGetMass + llGetRegionName + arguments + energy - 10.0 - sleep - 0.0 + 10 return - float - arguments - + string + sleep + 0 tooltip - Returns the mass of object that the script is attached to.\nReturns the scripted object's mass. When called from a script in a link-set, the parent will return the sum of the link-set weights, while a child will return just its own mass. When called from a script inside an attachment, this function will return the mass of the avatar it's attached to, not its own. + Returns the current region name. - llGetMassMKS + llGetRegionSunDirection + arguments + energy - - sleep - 0.0 + 10 return - float - arguments - + vector + sleep + 0 tooltip - Acts as llGetMass(), except that the units of the value returned are Kg. + Returns a normalized vector of the direction of the sun in the region.\nReturns the sun's direction on the simulator. - llGetMaxScaleFactor + llGetRegionSunRotation + arguments + energy - 10.0 - sleep - 0.0 + 10 return - float - arguments - + rotation + sleep + 0 tooltip - Returns a float that is the largest scaling factor that can be used with llScaleByFactor to resize the object. This maximum is determined by the Linkability Rules and prim scale limits. + Returns the rotation applied to the sun in the region. - llGetMemoryLimit + llGetRegionTimeDilation + arguments + energy - - sleep - 0.0 + 10 return - integer - arguments - + float + sleep + 0 tooltip - Get the maximum memory a script can use, in bytes. + Returns the current time dilation as a float between 0.0 (full dilation) and 1.0 (no dilation).\nReturns the current time dilation as a float between 0.0 and 1.0. - llGetMinScaleFactor + llGetRegionTimeOfDay + arguments + energy - 10.0 - sleep - 0.0 + 10 return float - arguments - + sleep + 0 tooltip - Returns a float that is the smallest scaling factor that can be used with llScaleByFactor to resize the object. This minimum is determined by the prim scale limits. + Returns the time in seconds since environmental midnight for the entire region. - llGetNextEmail + llGetRenderMaterial - energy - 10.0 - sleep - 0.0 - return - void arguments - Address + Face - type - string tooltip - - - - - Subject - + type - string - tooltip - + integer + energy + 10 + return + string + sleep + 0 tooltip - Fetch the next queued email with that matches the given address and/or subject, via the email event.\nIf the parameters are blank, they are not used for filtering. + Returns a string that is the render material on face (the inventory name if it is a material in the prim's inventory, otherwise the key).\nReturns the render material of a face, if it is found in object inventory, its key otherwise. - llGetNotecardLine + llGetRootPosition + arguments + energy - 10.0 - sleep - 0.1 + 10 return - key - arguments - - - NotecardName - - type - string - tooltip - - - - - LineNumber - - type - integer - tooltip - - - - + vector + sleep + 0 tooltip - Returns LineNumber from NotecardName via the dataserver event. The line index starts at zero.\nIf the requested line is passed the end of the note-card the dataserver event will return the constant EOF string.\nThe key returned by this function is a unique identifier which will be supplied to the dataserver event in the requested parameter. + Returns the position (in region coordinates) of the root prim of the object which the script is attached to.\nThis is used to allow a child prim to determine where the root is. - llGetNumberOfNotecardLines + llGetRootRotation + arguments + energy - 10.0 - sleep - 0.1 + 10 return - key - arguments - - - NotecardName - - type - string - tooltip - - - - + rotation + sleep + 0 tooltip - Returns the number of lines contained within a notecard via the dataserver event.\nThe key returned by this function is a query ID for identifying the dataserver reply. + Returns the rotation (relative to the region) of the root prim of the object which the script is attached to.\nGets the global rotation of the root object of the object script is attached to. - llGetNumberOfPrims + llGetRot + arguments + energy - 10.0 - sleep - 0.0 + 10 return - integer - arguments - + rotation + sleep + 0 tooltip - Returns the number of prims in a link set the script is attached to.\nReturns the number of prims in (and avatars seated on) the object the script is in. + Returns the rotation relative to the region's axes.\nReturns the rotation. - llGetNumberOfSides + llGetSPMaxMemory + arguments + energy - 10.0 - sleep - 0.0 + 10 return integer - arguments - + sleep + 0 tooltip - Returns the number of faces (or sides) of the prim.\nReturns the number of sides of the prim which has the script. + Returns the maximum used memory for the current script. Only valid after using PROFILE_SCRIPT_MEMORY. Non-mono scripts always use 16k.\nReturns the integer of the most bytes used while llScriptProfiler was last active. - llGetObjectDesc + llGetScale + arguments + energy - 10.0 - sleep - 0.0 + 10 return - string - arguments - + vector + sleep + 0 tooltip - Returns the description of the prim the script is attached to.\nReturns the description of the scripted object/prim. You can set the description using llSetObjectDesc. + Returns the scale of the prim.\nReturns a vector that is the scale (dimensions) of the prim. - llGetObjectDetails + llGetScriptName + arguments + energy - 10.0 - sleep - 0.0 + 10 return - list - arguments - - - ID - - type - key - tooltip - Prim or avatar UUID that is in the same region. - - - - Parameters - - type - list - tooltip - List of OBJECT_* flags. - - - + string + sleep + 0 tooltip - Returns a list of object details specified in the Parameters list for the object or avatar in the region with key ID.\nParameters are specified by the OBJECT_* constants. + Returns the name of the script that this function is used in.\nReturns the name of this script. - llGetObjectMass + llGetScriptState - energy - 10.0 - sleep - 0.0 - return - float arguments - ID + ScriptName - type - key tooltip - + + type + string - tooltip - Returns the mass of the avatar or object in the region.\nGets the mass of the object or avatar corresponding to ID. - - llGetObjectName - energy - 10.0 - sleep - 0.0 + 10 return - string - arguments - + integer + sleep + 0 tooltip - Returns the name of the prim which the script is attached to.\nReturns the name of the prim (not object) which contains the script. + Returns TRUE if the script named is running.\nReturns TRUE if ScriptName is running. - llGetObjectPermMask + llGetSimStats - energy - 10.0 - sleep - 0.0 - return - integer arguments - Category + StatType + tooltip + Statistic type. type integer - tooltip - Category is one of MASK_BASE, MASK_OWNER, MASK_GROUP, MASK_EVERYONE, or MASK_NEXT - tooltip - Returns the permission mask of the requested category for the object. - - llGetObjectPrimCount - energy - 10.0 - sleep - 0.0 + 10 return - integer - arguments - - - ObjectID - - type - key - tooltip - - - - + float + sleep + 0 tooltip - Returns the total number of prims for an object in the region.\nReturns the prim count for any object id in the same region. + Returns a float that is the requested statistic. - llGetOmega + llGetSimulatorHostname + arguments + energy - 10.0 - sleep - 0.0 + 10 return - vector - arguments - + string + sleep + 10 tooltip - Returns the rotation velocity in radians per second.\nReturns a vector that is the rotation velocity of the object in radians per second. + Returns the host-name of the machine which the script is running on.\nFor example, "sim225.agni.lindenlab.com". - llGetOwner + llGetStartParameter + arguments + energy - 10.0 - sleep - 0.0 + 10 return - key - arguments - + integer + sleep + 0 tooltip - Returns the object owner's UUID.\nReturns the key for the owner of the object. + Returns an integer that is the script rez parameter.\nIf the object was rezzed by an agent, this function returns 0. - llGetOwnerKey + llGetStartString + arguments + energy - 10.0 - sleep - 0.0 + 10 return - key + string + sleep + 0 + tooltip + Returns an string that is the value passed to llRezObjectWithParams with REZ_PARAM_STRING.\nIf the object was rezzed by an agent, this function returns an empty string. + + llGetStaticPath + arguments - ObjectID + Start - type - key tooltip - + Starting position. + type + vector - - tooltip - Returns the owner of ObjectID.\nReturns the key for the owner of object ObjectID. - - llGetParcelDetails - - energy - 10.0 - sleep - 0.0 - return - list - arguments - - Position + End + tooltip + Ending position. type vector + + + + Radius + tooltip - Location within the region. + Radius of the character that the path is for, between 0.125m and 5.0m. + type + float - ParcelDetails + Parameters + tooltip + Currently only accepts the parameter CHARACTER_TYPE; the options are identical to those used for llCreateCharacter. The default value is CHARACTER_TYPE_NONE. type list - tooltip - List of details requested for the specified parcel location. + energy + 10 + return + list + sleep + 0 tooltip - Returns a list of parcel details specified in the ParcelDetails list for the parcel at Position.\nParameters is one or more of: PARCEL_DETAILS_NAME, _DESC, _OWNER, _GROUP, _AREA, _ID, _SEE_AVATARS.\nReturns a list that is the parcel details specified in ParcelDetails (in the same order) for the parcel at Position. + - llGetParcelFlags + llGetStatus - energy - 10.0 - sleep - 0.0 - return - integer arguments - Position + StatusFlag - type - vector tooltip - + A STATUS_* flag + type + integer - tooltip - Returns a mask of the parcel flags (PARCEL_FLAG_*) for the parcel that includes the point Position.\nReturns a bit-field specifying the parcel flags (PARCEL_FLAG_*) for the parcel at Position. - - llGetParcelMaxPrims - energy - 10.0 - sleep - 0.0 + 10 return integer + sleep + 0 + tooltip + Returns boolean value of the specified status (e.g. STATUS_PHANTOM) of the object the script is attached to. + + llGetSubString + arguments - Position + String - type - vector tooltip - Region coordinates (z is ignored) of parcel. + + type + string - SimWide + Start + tooltip + type integer + + + + End + tooltip - Boolean. If FALSE then the return is the maximum prims supported by the parcel. If TRUE then it is the combined number of prims on all parcels in the region owned by the specified parcel's owner. + + type + integer + energy + 10 + return + string + sleep + 0 tooltip - Returns the maximum number of prims allowed on the parcel at Position for a given scope.\nThe scope may be set to an individual parcel or the combined resources of all parcels with the same ownership in the region. + Returns a sub-string from String, in a range specified by the Start and End indicies (inclusive).\nUsing negative numbers for Start and/or End causes the index to count backwards from the length of the string, so 0, -1 would capture the entire string.\nIf Start is greater than End, the sub string is the exclusion of the entries. - llGetParcelMusicURL + llGetSunDirection + arguments + energy - - sleep - + 10 return - string - arguments - + vector + sleep + 0 tooltip - Gets the streaming audio URL for the parcel object is on.\nThe object owner, avatar or group, must also be the land owner. + Returns a normalized vector of the direction of the sun in the parcel.\nReturns the sun's direction on the simulator in the parcel. - llGetParcelPrimCount + llGetSunRotation + arguments + energy - 10.0 - sleep - 0.0 + 10 return - integer + rotation + sleep + 0 + tooltip + Returns the rotation applied to the sun in the parcel. + + llGetTexture + arguments - Position + Face - type - vector tooltip - Region coordinates of parcel to query. + + type + integer + + energy + 10 + return + string + sleep + 0 + tooltip + Returns a string that is the texture on face (the inventory name if it is a texture in the prim's inventory, otherwise the key).\nReturns the texture of a face, if it is found in object inventory, its key otherwise. + + llGetTextureOffset + + arguments + - Category + Face + tooltip + type integer - tooltip - A PARCEL_COUNT_* flag. + + energy + 10 + return + vector + sleep + 0 + tooltip + Returns the texture offset of face in the x and y components of a vector. + + llGetTextureRot + + arguments + - SimWide + Face + tooltip + type integer - tooltip - Boolean. If FALSE then the return is the maximum prims supported by the parcel. If TRUE then it is the combined number of prims on all parcels in the region owned by the specified parcel's owner. + energy + 10 + return + float + sleep + 0 tooltip - Returns the number of prims on the parcel at Position of the given category.\nCategories: PARCEL_COUNT_TOTAL, _OWNER, _GROUP, _OTHER, _SELECTED, _TEMP.\nReturns the number of prims used on the parcel at Position which are in Category.\nIf SimWide is TRUE, it returns the total number of objects for all parcels with matching ownership in the category specified.\nIf SimWide is FALSE, it returns the number of objects on this specific parcel in the category specified + Returns the texture rotation of side. - llGetParcelPrimOwners + llGetTextureScale - energy - 10.0 - sleep - 2.0 - return - list arguments - Position + Face - type - vector tooltip - + + type + integer + energy + 10 + return + vector + sleep + 0 tooltip - Returns a list of up to 100 residents who own objects on the parcel at Position, with per-owner land impact totals.\nRequires owner-like permissions for the parcel, and for the script owner to be present in the region.\nThe list is formatted as [ key agentKey1, integer agentLI1, key agentKey2, integer agentLI2, ... ], sorted by agent key.\nThe integers are the combined land impacts of the objects owned by the corresponding agents. + Returns the texture scale of side in the x and y components of a vector.\nReturns the texture scale of a side in the x and y components of a vector. - llGetPermissions + llGetTime + arguments + energy - 10.0 + 10 + return + float sleep - 0.0 + 0 + tooltip + Returns the time in seconds since the last region reset, script reset, or call to either llResetTime or llGetAndResetTime. + + llGetTimeOfDay + + arguments + + energy + 10 return - integer + float + sleep + 0 + tooltip + Returns the time in seconds since environmental midnight on the parcel. + + llGetTimestamp + arguments - + + energy + 10 + return + string + sleep + 0 tooltip - Returns an integer bitmask of the permissions that have been granted to the script. Individual permissions can be determined using a bit-wise "and" operation against the PERMISSION_* constants + Returns a time-stamp (UTC time zone) in the format: YYYY-MM-DDThh:mm:ss.ff..fZ. - llGetPermissionsKey + llGetTorque + arguments + energy - 10.0 + 10 + return + vector sleep - 0.0 + 0 + tooltip + Returns the torque (if the script is physical).\nReturns a vector that is the torque (if the script is physical). + + llGetUnixTime + + arguments + + energy + 10 return - key + integer + sleep + 0 + tooltip + Returns the number of seconds elapsed since 00:00 hours, Jan 1, 1970 UTC from the system clock. + + llGetUsedMemory + arguments - + + energy + 10 + return + integer + sleep + 0 tooltip - Returns the key of the avatar that last granted or declined permissions to the script.\nReturns NULL_KEY if permissions were never granted or declined. + Returns the current used memory for the current script. Non-mono scripts always use 16K.\nReturns the integer of the number of bytes of memory currently in use by the script. Non-mono scripts always use 16K. - llGetPhysicsMaterial + llGetUsername + arguments + + + AvatarID + + tooltip + + type + key + + + energy - - sleep - + 10 return - list - arguments - + string + sleep + 0 tooltip - Returns a list of the form [float gravity_multiplier, float restitution, float friction, float density]. + Returns the username of an avatar, if the avatar is connected to the current region, or if the name has been cached. Otherwise, returns an empty string. Use llRequestUsername if the avatar may be absent from the region. - llGetPos + llGetVel + arguments + energy - 10.0 - sleep - 0.0 + 10 return vector - arguments - + sleep + 0 tooltip - Returns the position of the task in region coordinates.\nReturns the vector position of the task in region coordinates. + Returns the velocity of the object.\nReturns a vector that is the velocity of the object. - llGetPrimitiveParams + llGetVisualParams - energy - 10.0 - sleep - 0.2 - return - list arguments + + ID + + tooltip + Avatar UUID in the same region. + type + key + + Parameters + tooltip + List of visual parameter IDs. type list - tooltip - PRIM_* flags and face parameters + energy + 10 + return + list + sleep + 0 tooltip - Returns the primitive parameters specified in the parameters list.\nReturns primitive parameters specified in the Parameters list. + Returns a list of the current value for each requested visual parameter. - llGetPrimMediaParams + llGetWallclock + arguments + energy - 10.0 - sleep - 0.1 + 10 return - list + float + sleep + 0 + tooltip + Returns the time in seconds since midnight California Pacific time (PST/PDT).\nReturns the time in seconds since simulator's time-zone midnight (Pacific Time). + + llGiveAgentInventory + arguments - Face + AgentID + tooltip + An agent in the region. type - integer + key + + + + FolderName + tooltip - face number + Folder name to give to the agent. + type + string - Parameters + InventoryItems + tooltip + Inventory items to give to the agent. type list + + + + Options + tooltip - One or more PRIM_MEDIA_* flags + A list of option for inventory transfer. + type + list - tooltip - Returns the media parameters for a particular face on an object, given the desired list of parameter names, in the order requested. Returns an empty list if no media exists on the face. - - llGetRegionAgentCount - energy - 10.0 - sleep - 0.0 + 10 return integer - arguments - - tooltip - Returns the number of avatars in the region.\nReturns an integer that is the number of avatars in the region. - - llGetRegionCorner - - energy - 10.0 sleep - 0.0 - return - vector - arguments - + 3 tooltip - Returns a vector, in meters, that is the global location of the south-west corner of the region which the object is in.\nReturns the Region-Corner of the simulator containing the task. The region-corner is a vector (values in meters) representing distance from the first region. + Give InventoryItems to the specified agent as a new folder of items, as permitted by the permissions system. The target must be an agent. - llGetRegionFlags + llGiveInventory - energy - 10.0 - sleep - 0.0 - return - integer arguments - - tooltip - Returns the region flags (REGION_FLAG_*) for the region the object is in.\nReturns a bit-field specifying the region flags (REGION_FLAG_*) for the region the object is in. - - llGetRegionFPS - + + + TargetID + + tooltip + + type + key + + + + InventoryItem + + tooltip + + type + string + + + energy - 10.0 - sleep - 0.0 + 10 return - float - arguments - - tooltip - Returns the mean region frames per second. - - llGetRegionName - - energy - 10.0 + void sleep - 0.0 - return - string - arguments - + 0 tooltip - Returns the current region name. + Give InventoryItem to destination represented by TargetID, as permitted by the permissions system.\nTargetID may be any agent or an object in the same region. - llGetRegionTimeDilation + llGiveInventoryList - energy - 10.0 - sleep - 0.0 - return - float arguments - - tooltip - Returns the current time dilation as a float between 0.0 (full dilation) and 1.0 (no dilation).\nReturns the current time dilation as a float between 0.0 and 1.0. - - llGetRootPosition - + + + TargetID + + tooltip + + type + key + + + + FolderName + + tooltip + + type + string + + + + InventoryItems + + tooltip + + type + list + + + energy - 10.0 - sleep - 0.0 + 10 return - vector - arguments - - tooltip - Returns the position (in region coordinates) of the root prim of the object which the script is attached to.\nThis is used to allow a child prim to determine where the root is. - - llGetRootRotation - - energy - 10.0 + void sleep - 0.0 - return - rotation - arguments - + 3 tooltip - Returns the rotation (relative to the region) of the root prim of the object which the script is attached to.\nGets the global rotation of the root object of the object script is attached to. + Give InventoryItems to destination (represented by TargetID) as a new folder of items, as permitted by the permissions system.\nTargetID may be any agent or an object in the same region. If TargetID is an object, the items are passed directly to the object inventory (no folder is created). - llGetRot + llGiveMoney - energy - 10.0 - sleep - 0.0 - return - rotation arguments - - tooltip - Returns the rotation relative to the region's axes.\nReturns the rotation. - - llGetScale - + + + AvatarID + + tooltip + + type + key + + + + Amount + + tooltip + + type + integer + + + energy - 10.0 - sleep - 0.0 + 10 return - vector - arguments - + integer + sleep + 0 tooltip - Returns the scale of the prim.\nReturns a vector that is the scale (dimensions) of the prim. + Transfers Amount of L$ from script owner to AvatarID.\nThis call will silently fail if PERMISSION_DEBIT has not been granted. - llGetScriptName + llGodLikeRezObject + arguments + + + InventoryItemID + + tooltip + + type + key + + + + Position + + tooltip + + type + vector + + + energy - 10.0 - sleep - 0.0 + 10 + god-mode + 1 return - string - arguments - + void + sleep + 0 tooltip - Returns the name of the script that this function is used in.\nReturns the name of this script. + Rez directly off of a UUID if owner has god-bit set. - llGetScriptState + llGround - energy - 10.0 - sleep - 0.0 - return - integer arguments - ScriptName + Offset - type - string tooltip - + + type + vector - tooltip - Returns TRUE if the script named is running.\nReturns TRUE if ScriptName is running. - - llGetSimStats - energy - 0 - sleep - 0 + 10 return float + sleep + 0 + tooltip + Returns the ground height at the object position + offset.\nReturns the ground height at the object's position + Offset. + + llGroundContour + arguments - StatType + Offset - type - integer tooltip - Statistic type. Currently only SIM_STAT_PCT_CHARS_STEPPED is supported. + + type + vector - tooltip - Returns a float that is the requested statistic. - - llGetSimulatorHostname - energy - 10.0 - sleep - 10.0 + 10 return - string - arguments - - tooltip - Returns the host-name of the machine which the script is running on.\nFor example, "sim225.agni.lindenlab.com". - - llGetSPMaxMemory - - energy - + vector sleep - 0.0 - return - integer - arguments - + 0 tooltip - Returns the maximum used memory for the current script. Only valid after using PROFILE_SCRIPT_MEMORY. Non-mono scripts always use 16k.\nReturns the integer of the most bytes used while llScriptProfiler was last active. + Returns the ground contour direction below the object position + Offset.\nReturns the ground contour at the object's position + Offset. - llGetStartParameter + llGroundNormal + arguments + + + Offset + + tooltip + + type + vector + + + energy - 10.0 - sleep - 0.0 + 10 return - integer - arguments - + vector + sleep + 0 tooltip - Returns an integer that is the script rez parameter.\nIf the object was rezzed by an agent, this function returns 0. + Returns the ground normal below the object position + offset.\nReturns the ground contour at the object's position + Offset. - llGetStaticPath + llGroundRepel - energy - 10.0 - sleep - 0.0 - return - list arguments - Start + Height - type - vector tooltip - Starting position. + Distance above the ground. + type + float - End + Water - type - vector tooltip - Ending position. + Boolean, if TRUE then hover above water too. + type + integer - Radius + Tau + tooltip + Seconds to critically damp in. type float - tooltip - Radius of the character that the path is for, between 0.125m and 5.0m. + + energy + 10 + return + void + sleep + 0 + tooltip + + Critically damps to height if within height * 0.5 of level (either above ground level or above the higher of land and water if water == TRUE).\nCritically damps to fHeight if within fHeight * 0.5 of ground or water level.\n + The height is above ground level if iWater is FALSE or above the higher of land and water if iWater is TRUE.\n + Do not use with vehicles. Only works in physics-enabled objects. + + + llGroundSlope + + arguments + - Parameters + Offset - type - list tooltip - Currently only accepts the parameter CHARACTER_TYPE; the options are identical to those used for llCreateCharacter. The default value is CHARACTER_TYPE_NONE. + + type + vector + energy + 10 + return + vector + sleep + 0 tooltip - + Returns the ground slope below the object position + Offset.\nReturns the ground slope at the object position + Offset. - llGetStatus + llHMAC - energy - 10.0 - sleep - 0.0 - return - integer arguments - StatusFlag + Key + tooltip + The PEM-formatted key for the hash digest. type - integer + string + + + + Message + tooltip - A STATUS_* flag + The message to be hashed. + type + string + + + + Algorithm + + tooltip + The digest algorithm: md5, sha1, sha224, sha256, sha384, sha512. + type + string - tooltip - Returns boolean value of the specified status (e.g. STATUS_PHANTOM) of the object the script is attached to. - - llGetSubString - energy - 10.0 - sleep - 0.0 + 10 return string + sleep + 0 + tooltip + Returns the base64-encoded hashed message authentication code (HMAC), of Message using PEM-formatted Key and digest Algorithm (md5, sha1, sha224, sha256, sha384, sha512). + + llHTTPRequest + arguments - String + URL + tooltip + A valid HTTP/HTTPS URL. type string + + + + Parameters + tooltip - + Configuration parameters, specified as HTTP_* flag-value pairs. + type + list - Start + Body + tooltip + Contents of the request. type - integer + string + + + + energy + 10 + return + key + sleep + 0 + tooltip + Sends an HTTP request to the specified URL with the Body of the request and Parameters.\nReturns a key that is a handle identifying the HTTP request made. + + llHTTPResponse + + arguments + + + HTTPRequestID + tooltip - + A valid HTTP request key. + type + key - End + Status + tooltip + HTTP Status (200, 400, 404, etc.). type integer + + + + Body + tooltip - + Contents of the response. + type + string - tooltip - Returns a sub-string from String, in a range specified by the Start and End indicies (inclusive).\nUsing negative numbers for Start and/or End causes the index to count backwards from the length of the string, so 0, -1 would capture the entire string.\nIf Start is greater than End, the sub string is the exclusion of the entries. - - llGetSunDirection - energy - 10.0 - sleep - 0.0 + 10 return - vector - arguments - + void + sleep + 0 tooltip - Returns a normalized vector of the direction of the sun in the region.\nReturns the sun's direction on the simulator. + Responds to an incoming HTTP request which was triggerd by an http_request event within the script. HTTPRequestID specifies the request to respond to (this ID is supplied in the http_request event handler). Status and Body specify the status code and message to respond with. - llGetTexture + llHash + arguments + + + value + + tooltip + + type + string + + + energy - 10.0 - sleep - 0.0 + 10 return - string + integer + sleep + 0 + tooltip + Calculates the 32bit hash value for the provided string. + + llInsertString + arguments - Face + TargetVariable + + tooltip + + type + string + + + + Position + tooltip + type integer + + + + SourceVariable + tooltip - + + type + string + energy + 10 + return + string + sleep + 0 tooltip - Returns a string that is the texture on face (the inventory name if it is a texture in the prim's inventory, otherwise the key).\nReturns the texture of a face, if it is found in object inventory, its key otherwise. + Inserts SourceVariable into TargetVariable at Position, and returns the result.\nInserts SourceVariable into TargetVariable at Position and returns the result. Note this does not alter TargetVariable. - llGetTextureOffset + llInstantMessage - energy - 10.0 - sleep - 0.0 - return - vector arguments - Face + AvatarID + tooltip + type - integer + key + + + + Text + tooltip - + + type + string + energy + 10 + return + void + sleep + 2 tooltip - Returns the texture offset of face in the x and y components of a vector. + IMs Text to the user identified.\nSend Text to the user as an instant message. - llGetTextureRot + llIntegerToBase64 - energy - 10.0 - sleep - 0.0 - return - float arguments - Face + Value + tooltip + type integer - tooltip - + energy + 10 + return + string + sleep + 0 tooltip - Returns the texture rotation of side. + Returns a string that is a Base64 big endian encode of Value.\nEncodes the Value as an 8-character Base64 string. - llGetTextureScale + llIsFriend - energy - 10.0 - sleep - 0.0 - return - vector arguments - Face + agent_id - type - integer tooltip - + Agent ID of another agent in the region. + type + key - tooltip - Returns the texture scale of side in the x and y components of a vector.\nReturns the texture scale of a side in the x and y components of a vector. - - llGetTime - - energy - 10.0 - sleep - 0.0 - return - float - arguments - - tooltip - Returns the time in seconds since the last region reset, script reset, or call to either llResetTime or llGetAndResetTime. - - llGetTimeOfDay - energy - 10.0 - sleep - 0.0 + 10 return - float - arguments - - tooltip - Returns the time in seconds since Second Life midnight or since region up-time, whichever is smaller.\nThe Second Life day cycle is 4 hours. - - llGetTimestamp - - energy - 10.0 + integer sleep - 0.0 - return - string - arguments - + 0 tooltip - Returns a time-stamp (UTC time zone) in the format: YYYY-MM-DDThh:mm:ss.ff..fZ. + Returns TRUE if avatar ID is a friend of the script owner. - llGetTorque + llJson2List - energy - 10.0 - sleep - 0.0 - return - vector arguments - - tooltip - Returns the torque (if the script is physical).\nReturns a vector that is the torque (if the script is physical). - - llGetUnixTime - + + + JSON + + tooltip + + type + string + + + energy - 10.0 - sleep - 0.0 + 10 return - integer - arguments - - tooltip - Returns the number of seconds elapsed since 00:00 hours, Jan 1, 1970 UTC from the system clock. - - llGetUsedMemory - - energy - 10.0 + list sleep - 0.0 - return - integer - arguments - + 0 tooltip - Returns the current used memory for the current script. Non-mono scripts always use 16K.\nReturns the integer of the number of bytes of memory currently in use by the script. Non-mono scripts always use 16K. + Converts the top level of the JSON string to a list. - llGetUsername + llJsonGetValue - energy - 10.0 - sleep - 0.0 - return - string arguments - AvatarID + JSON + tooltip + type - key + string + + + + Specifiers + tooltip - + + type + list - tooltip - Returns the username of an avatar, if the avatar is connected to the current region, or if the name has been cached. Otherwise, returns an empty string. Use llRequestUsername if the avatar may be absent from the region. - - llGetVel - energy - 10.0 - sleep - 0.0 + 10 return - vector - arguments - - tooltip - Returns the velocity of the object.\nReturns a vector that is the velocity of the object. - - llGetWallclock - - energy - 10.0 + string sleep - 0.0 - return - float - arguments - + 0 tooltip - Returns the time in seconds since midnight California Pacific time (PST/PDT).\nReturns the time in seconds since simulator's time-zone midnight (Pacific Time). + Gets the value indicated by Specifiers from the JSON string. - llGiveInventory + llJsonSetValue - energy - 10.0 - sleep - 0.0 - return - void arguments - TargetID + JSON + tooltip + type - key + string + + + + Specifiers + tooltip - + + type + list - InventoryItem + Value + tooltip + type string - tooltip - + energy + 10 + return + string + sleep + 0 tooltip - Give InventoryItem to destination represented by TargetID, as permitted by the permissions system.\nTargetID may be any agent or an object in the same region. + Returns a new JSON string that is the JSON given with the Value indicated by Specifiers set to Value. - llGiveInventoryList + llJsonValueType - energy - 10.0 - sleep - 3.0 - return - void arguments - TargetID + JSON - type - key tooltip - - - - - FolderName - + type string - tooltip - - InventoryItems + Specifiers + tooltip + type list - tooltip - + energy + 10 + return + string + sleep + 0 tooltip - Give InventoryItems to destination (represented by TargetID) as a new folder of items, as permitted by the permissions system.\nTargetID may be any agent or an object in the same region. If TargetID is an object, the items are passed directly to the object inventory (no folder is created). + Returns the type constant (JSON_*) for the value in JSON indicated by Specifiers. - llGiveMoney + llKey2Name - energy - 10.0 - sleep - 0.0 - return - integer arguments - AvatarID + ID - type - key tooltip - - - - - Amount - + Avatar or rezzed prim UUID. type - integer - tooltip - + key + energy + 10 + return + string + sleep + 0 tooltip - Transfers Amount of L$ from script owner to AvatarID.\nThis call will silently fail if PERMISSION_DEBIT has not been granted. + Returns the name of the prim or avatar specified by ID. The ID must be a valid rezzed prim or avatar key in the current simulator, otherwise an empty string is returned.\nFor avatars, the returned name is the legacy name - llGodLikeRezObject + llKeyCountKeyValue - god-mode - true + arguments + energy - 10.0 - sleep - 0.0 + 10 return - void + key + sleep + 0 + tooltip + + Starts an asychronous transaction the request the number of keys in the data store. The dataserver callback will be executed with the key returned from this call and a string describing the result. The result is commma-delimited list. The first item is an integer specifying if the transaction succeeded (1) or not (0). In the failure case, the second item will be an integer corresponding to one of the XP_ERROR_... constants. In the success case the second item will the the number of keys in the system. + + + llKeysKeyValue + arguments - InventoryItemID + First - type - key tooltip - + Index of the first key to return. + type + integer - Position + Count - type - vector tooltip - + The number of keys to return. + type + integer + energy + 10 + return + key + sleep + 0 tooltip - Rez directly off of a UUID if owner has god-bit set. + + Starts an asychronous transaction the request a number of keys from the data store. The dataserver callback will be executed with the key returned from this call and a string describing the result. The result is commma-delimited list. The first item is an integer specifying if the transaction succeeded (1) or not (0). In the failure case, the second item will be an integer corresponding to one of the XP_ERROR_... constants. The error XP_ERROR_KEY_NOT_FOUND is returned if First is greater than or equal to the number of keys in the data store. In the success case the subsequent items will be the keys requested. The number of keys returned may be less than requested if the return value is too large or if there is not enough keys remaining. The order keys are returned is not guaranteed but is stable between subsequent calls as long as no keys are added or removed. Because the keys are returned in a comma-delimited list it is not recommended to use commas in key names if this function is used. + - llGround + llLinear2sRGB - energy - 10.0 - sleep - 0.0 - return - float arguments - Offset + color + tooltip + A color in the linear colorspace. type vector - tooltip - - tooltip - Returns the ground height at the object position + offset.\nReturns the ground height at the object's position + Offset. - - llGroundContour - energy - 10.0 - sleep - 0.0 + 10 return vector + sleep + 0 + tooltip + Converts a color from the linear colorspace to sRGB. + + llLinkAdjustSoundVolume + arguments - Offset + LinkNumber + tooltip + Link number (0: unlinked, 1: root prim, >1: child prims) or a LINK_* flag type - vector + integer + + + + Volume + tooltip - + The volume to set. + type + float + energy + 10 + return + void + sleep + 0 tooltip - Returns the ground contour direction below the object position + Offset.\nReturns the ground contour at the object's position + Offset. + Adjusts the volume (0.0 - 1.0) of the currently playing sound attached to the link.\nThis function has no effect on sounds started with llTriggerSound. - llGroundNormal + llLinkParticleSystem - energy - 10.0 - sleep - 0.0 - return - vector arguments - Offset + LinkNumber + tooltip + Link number (0: unlinked, 1: root prim, >1: child prims) or a LINK_* flag type - vector + integer + + + + Rules + tooltip - + Particle system rules list in the format [ rule1, data1, rule2, data2 . . . ruleN, dataN ] + type + list - tooltip - Returns the ground normal below the object position + offset.\nReturns the ground contour at the object's position + Offset. - - llGroundRepel - energy - 10.0 - sleep - 0.0 + 10 return void + sleep + 0 + tooltip + Creates a particle system in prim LinkNumber based on Rules. An empty list removes a particle system from object.\nList format is [ rule-1, data-1, rule-2, data-2 ... rule-n, data-n ].\nThis is identical to llParticleSystem except that it applies to a specified linked prim and not just the prim the script is in. + + llLinkPlaySound + arguments - Height + LinkNumber - type - float tooltip - Distance above the ground. + Link number (0: unlinked, 1: root prim, >1: child prims) or a LINK_* flag + type + integer - Water + Sound - type - integer tooltip - Boolean, if TRUE then hover above water too. + + type + string - Tau + Volume + tooltip + type float + + + + Flags + tooltip - Seconds to critically damp in. + + type + integer + energy + 10 + return + void + sleep + 0 tooltip - Critically damps to height if within height * 0.5 of level (either above ground level or above the higher of land and water if water == TRUE).\nCritically damps to fHeight if within fHeight * 0.5 of ground or water level.\n - The height is above ground level if iWater is FALSE or above the higher of land and water if iWater is TRUE.\n - Do not use with vehicles. Only works in physics-enabled objects. + Plays Sound, once or looping, at Volume (0.0 - 1.0). The sound may be attached to the link or triggered at its location.\nOnly one sound may be attached to an object at a time, and attaching a new sound or calling llStopSound will stop the previously attached sound. - llGroundSlope + llLinkSetSoundQueueing - energy - 10.0 - sleep - 0.0 - return - vector arguments - Offset + LinkNumber + tooltip + Link number (0: unlinked, 1: root prim, >1: child prims) or a LINK_* flag type - vector + integer + + + + QueueEnable + tooltip - + Boolean, sound queuing for the linked prim: TRUE enables, FALSE disables (default). + type + integer + energy + 10 + return + void + sleep + 0 tooltip - Returns the ground slope below the object position + Offset.\nReturns the ground slope at the object position + Offset. + Limits radius for audibility of scripted sounds (both attached and triggered) to distance Radius around the link. - llHTTPRequest + llLinkSetSoundRadius - energy - 10.0 - sleep - 0.0 - return - key arguments - URL + LinkNumber - type - string tooltip - A valid HTTP/HTTPS URL. - - - - Parameters - + Link number (0: unlinked, 1: root prim, >1: child prims) or a LINK_* flag type - list - tooltip - Configuration parameters, specified as HTTP_* flag-value pairs. + integer - Body + radius - type - string tooltip - Contents of the request. + Maximum distance that sounds can be heard. + type + float - tooltip - Sends an HTTP request to the specified URL with the Body of the request and Parameters.\nReturns a key that is a handle identifying the HTTP request made. - - llHTTPResponse - energy - 10.0 - sleep - 0.0 + 10 return void + sleep + 0 + tooltip + Limits radius for audibility of scripted sounds (both attached and triggered) to distance Radius around the link. + + llLinkSitTarget + arguments - HTTPRequestID + LinkNumber - type - key tooltip - A valid HTTP request key. + Link number (0: unlinked, 1: root prim, >1: child prims) or a LINK_* flag of the prim. + type + integer - Status + Offset - type - integer tooltip - HTTP Status (200, 400, 404, etc.). + Position for the sit target, relative to the prim's position. + type + vector - Body + Rotation - type - string tooltip - Contents of the response. + Rotation (relative to the prim's rotation) for the avatar. + type + rotation + energy + 10 + return + void + sleep + 0 tooltip - Responds to an incoming HTTP request which was triggerd by an http_request event within the script. HTTPRequestID specifies the request to respond to (this ID is supplied in the http_request event handler). Status and Body specify the status code and message to respond with. + Set the sit location for the linked prim(s). If Offset == <0,0,0> clear it.\nSet the sit location for the linked prim(s). The sit location is relative to the prim's position and rotation. - llInsertString + llLinkStopSound - energy - 10.0 - sleep - 0.0 - return - string arguments - TargetVariable + LinkNumber - type - string tooltip - - - - - Position - + Link number (0: unlinked, 1: root prim, >1: child prims) or a LINK_* flag type integer - tooltip - - - - - SourceVariable - - type - string - tooltip - + energy + 10 + return + void + sleep + 0 tooltip - Inserts SourceVariable into TargetVariable at Position, and returns the result.\nInserts SourceVariable into TargetVariable at Position and returns the result. Note this does not alter TargetVariable. + Stops playback of the currently attached sound on a link. - llInstantMessage + llLinksetDataAvailable + arguments + energy - 10.0 - sleep - 2.0 + 10 return - void + integer + sleep + 0 + tooltip + Returns the number of bytes remaining in the linkset's datastore. + + llLinksetDataCountFound + arguments - AvatarID + search - type - key tooltip - - - - - Text - + A regex search string to match against keys in the datastore. type string - tooltip - + energy + 10 + return + integer + sleep + 0 tooltip - IMs Text to the user identified.\nSend Text to the user as an instant message. + Returns the number of keys matching the regular expression passed in the search parameter. - llIntegerToBase64 + llLinksetDataCountKeys + arguments + energy - 10.0 - sleep - 0.0 + 10 return - string + integer + sleep + 0 + tooltip + Returns the number of keys in the linkset's datastore. + + llLinksetDataDelete + arguments - Value + name - type - integer tooltip - + Key to delete from the linkset's datastore. + type + string + energy + 10 + return + integer + sleep + 0 tooltip - Returns a string that is a Base64 big endian encode of Value.\nEncodes the Value as an 8-character Base64 string. + Deletes a name:value pair from the linkset's datastore. - llJson2List + llLinksetDataDeleteFound - energy - 0.0 - sleep - 0.0 - return - list arguments - JSON + search + tooltip + A regex search string to match against keys in the datastore. type string + + + + pass + tooltip - + The pass phrase used to protect key value pairs in the linkset data + type + string + energy + 10 + return + list + sleep + 0 tooltip - Converts the top level of the JSON string to a list. + Deletes all key value pairs in the linkset data where the key matches the regular expression in search. Returns a list consisting of [ #deleted, #not deleted ]. - llJsonGetValue + llLinksetDataDeleteProtected - energy - 0.0 - sleep - 0.0 - return - string arguments - JSON + name + tooltip + Key to delete from the linkset's datastore. type string - tooltip - - Specifiers + pass - type - list tooltip - + Pass phrase to access protected data. + type + string + energy + 10 + return + integer + sleep + 0 tooltip - Gets the value indicated by Specifiers from the JSON string. + Deletes a name:value pair from the linkset's datastore. - llJsonSetValue + llLinksetDataFindKeys - energy - 0.0 - sleep - 0.0 - return - string arguments - JSON + search + tooltip + A regex search string to match against keys in the datastore. type string - tooltip - - Specifiers + start - type - list tooltip - + First entry to return. 0 for start of list. + type + integer - Value + count - type - string tooltip - + Number of entries to return. Less than 1 for all keys. + type + integer + energy + 10 + return + list + sleep + 0 tooltip - Returns a new JSON string that is the JSON given with the Value indicated by Specifiers set to Value. + Returns a list of keys from the linkset's data store matching the search parameter. - llJsonValueType + llLinksetDataListKeys - energy - 0.0 - sleep - 0.0 - return - string arguments - JSON + start - type - string tooltip - + First entry to return. 0 for start of list. + type + integer - Specifiers + count - type - list tooltip - + Number of entries to return. Less than 1 for all keys. + type + integer + energy + 10 + return + list + sleep + 0 tooltip - Returns the type constant (JSON_*) for the value in JSON indicated by Specifiers. + Returns a list of all keys in the linkset datastore. - llKey2Name + llLinksetDataRead - energy - 10.0 - sleep - 0.0 - return - string arguments - ID + name - type - key tooltip - Avatar or rezzed prim UUID. + Key to retrieve from the linkset's datastore. + type + string - tooltip - Returns the name of the prim or avatar specified by ID. The ID must be a valid rezzed prim or avatar key in the current simulator, otherwise an empty string is returned.\nFor avatars, the returned name is the legacy name - - llKeyCountKeyValue - energy - 10.0 - sleep - 0.0 + 10 return - key - arguments - + string + sleep + 0 tooltip - - Starts an asychronous transaction the request the number of keys in the data store. The dataserver callback will be executed with the key returned from this call and a string describing the result. The result is commma-delimited list. The first item is an integer specifying if the transaction succeeded (1) or not (0). In the failure case, the second item will be an integer corresponding to one of the XP_ERROR_... constants. In the success case the second item will the the number of keys in the system. - + Returns the value stored for a key in the linkset. - llKeysKeyValue + llLinksetDataReadProtected - energy - 10.0 - sleep - 0.0 - return - key arguments - - First - - type - integer - tooltip - Index of the first key to return. - - - - Count - - type - integer - tooltip - The number of keys to return. - - + + name + + tooltip + Key to retrieve from the linkset's datastore. + type + string + + + + pass + + tooltip + Pass phrase to access protected data. + type + string + + + energy + 10 + return + string + sleep + 0 tooltip - - Starts an asychronous transaction the request a number of keys from the data store. The dataserver callback will be executed with the key returned from this call and a string describing the result. The result is commma-delimited list. The first item is an integer specifying if the transaction succeeded (1) or not (0). In the failure case, the second item will be an integer corresponding to one of the XP_ERROR_... constants. The error XP_ERROR_KEY_NOT_FOUND is returned if First is greater than or equal to the number of keys in the data store. In the success case the subsequent items will be the keys requested. The number of keys returned may be less than requested if the return value is too large or if there is not enough keys remaining. The order keys are returned is not guaranteed but is stable between subsequent calls as long as no keys are added or removed. Because the keys are returned in a comma-delimited list it is not recommended to use commas in key names if this function is used. - + Returns the value stored for a key in the linkset. - llLinkParticleSystem + llLinksetDataReset + arguments + energy - 10.0 - sleep - 0.0 + 10 return void + sleep + 0 + tooltip + Resets the linkset's data store, erasing all key-value pairs. + + llLinksetDataWrite + arguments - LinkNumber + name - type - integer tooltip - Link number (0: unlinked, 1: root prim, >1: child prims) or a LINK_* flag + key for the name:value pair. + type + string - Rules + value - type - list tooltip - Particle system rules list in the format [ rule1, data1, rule2, data2 . . . ruleN, dataN ] + value to store in the linkset's datastore. + type + string + energy + 10 + return + integer + sleep + 0 tooltip - Creates a particle system in prim LinkNumber based on Rules. An empty list removes a particle system from object.\nList format is [ rule-1, data-1, rule-2, data-2 ... rule-n, data-n ].\nThis is identical to llParticleSystem except that it applies to a specified linked prim and not just the prim the script is in. + Sets a name:value pair in the linkset's datastore - llLinkSitTarget + llLinksetDataWriteProtected - energy - 10.0 - sleep - 0.0 - return - void arguments - LinkNumber + name - type - integer tooltip - Link number (0: unlinked, 1: root prim, >1: child prims) or a LINK_* flag of the prim. + key for the name:value pair. + type + string - Offset + value - type - vector tooltip - Position for the sit target, relative to the prim's position. + value to store in the linkset's datastore. + type + string - Rotation + pass - type - rotation tooltip - Rotation (relative to the prim's rotation) for the avatar. + Pass phrase to access protected data. + type + string + energy + 10 + return + integer + sleep + 0 tooltip - Set the sit location for the linked prim(s). If Offset == <0,0,0> clear it.\nSet the sit location for the linked prim(s). The sit location is relative to the prim's position and rotation. + Sets a name:value pair in the linkset's datastore llList2CSV - energy - 10.0 - sleep - 0.0 - return - string arguments ListVariable + tooltip + type list - tooltip - + energy + 10 + return + string + sleep + 0 tooltip Creates a string of comma separated values from the list.\nCreate a string of comma separated values from the specified list. llList2Float - energy - 10.0 - sleep - 0.0 - return - float arguments ListVariable + tooltip + type list - tooltip - Index + tooltip + type integer - tooltip - + energy + 10 + return + float + sleep + 0 tooltip Copies the float at Index in the list.\nReturns the value at Index in the specified list. If Index describes a location not in the list, or the value cannot be type-cast to a float, then zero is returned. llList2Integer - energy - 10.0 - sleep - 0.0 - return - integer arguments ListVariable + tooltip + type list - tooltip - Index + tooltip + type integer - tooltip - + energy + 10 + return + integer + sleep + 0 tooltip Copies the integer at Index in the list.\nReturns the value at Index in the specified list. If Index describes a location not in the list, or the value cannot be type-cast to an integer, then zero is returned. llList2Json - energy - 0 - sleep - 0 - return - string arguments JsonType - type - string tooltip Type is JSON_ARRAY or JSON_OBJECT. + type + string Values - type - list tooltip List of values to convert. + type + list + energy + 10 + return + string + sleep + 0 tooltip Converts either a strided list of key:value pairs to a JSON_OBJECT, or a list of values to a JSON_ARRAY. llList2Key - energy - 10.0 - sleep - 0.0 - return - key arguments ListVariable + tooltip + type list - tooltip - Index + tooltip + type integer - tooltip - + energy + 10 + return + key + sleep + 0 tooltip Copies the key at Index in the list.\nReturns the value at Index in the specified list. If Index describes a location not in the list, or the value cannot be type-cast to a key, then null string is returned. llList2List + arguments + + + ListVariable + + tooltip + + type + list + + + + Start + + tooltip + + type + integer + + + + End + + tooltip + + type + integer + + + energy - 10.0 - sleep - 0.0 + 10 return list + sleep + 0 + tooltip + Returns a subset of entries from ListVariable, in a range specified by the Start and End indicies (inclusive).\nUsing negative numbers for Start and/or End causes the index to count backwards from the length of the string, so 0, -1 would capture the entire string.\nIf Start is greater than End, the sub string is the exclusion of the entries. + + llList2ListSlice + arguments ListVariable + tooltip + type list - tooltip - Start + tooltip + type integer - tooltip - End + tooltip + + type + integer + + + + Stride + + tooltip + type integer + + + + slice_index + tooltip - + + type + integer + energy + 10 + return + list + sleep + 0 tooltip - Returns a subset of entries from ListVariable, in a range specified by the Start and End indicies (inclusive).\nUsing negative numbers for Start and/or End causes the index to count backwards from the length of the string, so 0, -1 would capture the entire string.\nIf Start is greater than End, the sub string is the exclusion of the entries. + Returns a subset of entries from ListVariable, in a range specified by Start and End indices (inclusive) return the slice_index element of each stride.\n Using negative numbers for Start and/or End causes the index to count backwards from the length of the list. (e.g. 0, -1 captures entire list)\nIf slice_index is less than 0, it is counted backwards from the end of the stride.\n Stride must be a positive integer > 0 or an empy list is returned. If slice_index falls outside range of stride, an empty list is returned. slice_index is zero-based. (e.g. A stride of 2 has valid indices 0,1) llList2ListStrided - energy - 10.0 - sleep - 0.0 - return - list arguments ListVariable + tooltip + type list - tooltip - Start + tooltip + type integer - tooltip - End + tooltip + type integer - tooltip - Stride + tooltip + type integer - tooltip - + energy + 10 + return + list + sleep + 0 tooltip Copies the strided slice of the list from Start to End.\nReturns a copy of the strided slice of the specified list from Start to End. llList2Rot - energy - 10.0 - sleep - 0.0 - return - rotation arguments ListVariable + tooltip + type list - tooltip - Index + tooltip + type integer - tooltip - + energy + 10 + return + rotation + sleep + 0 tooltip Copies the rotation at Index in the list.\nReturns the value at Index in the specified list. If Index describes a location not in the list, or the value cannot be type-cast to rotation, thenZERO_ROTATION is returned. llList2String - energy - 10.0 - sleep - 0.0 - return - string arguments ListVariable + tooltip + type list - tooltip - Index + tooltip + type integer - tooltip - + energy + 10 + return + string + sleep + 0 tooltip Copies the string at Index in the list.\nReturns the value at Index in the specified list as a string. If Index describes a location not in the list then null string is returned. llList2Vector - energy - 10.0 - sleep - 0.0 - return - vector arguments ListVariable + tooltip + type list - tooltip - Index + tooltip + type integer - tooltip - + energy + 10 + return + vector + sleep + 0 tooltip Copies the vector at Index in the list.\nReturns the value at Index in the specified list. If Index describes a location not in the list, or the value cannot be type-cast to a vector, then ZERO_VECTOR is returned. - llListen + llListFindList - energy - 10.0 - sleep - 0.0 - return - integer arguments - Channel + ListVariable - type - integer tooltip - - - - - SpeakersName - + type - string - tooltip - + list - SpeakersID + Find - type - key tooltip - - - - - Text - + type - string - tooltip - + list + energy + 10 + return + integer + sleep + 0 tooltip - Creates a listen callback for Text on Channel from SpeakersName and SpeakersID (SpeakersName, SpeakersID, and/or Text can be empty) and returns an identifier that can be used to deactivate or remove the listen.\nNon-empty values for SpeakersName, SpeakersID, and Text will filter the results accordingly, while empty strings and NULL_KEY will not filter the results, for string and key parameters respectively.\nPUBLIC_CHANNEL is the public chat channel that all avatars see as chat text. DEBUG_CHANNEL is the script debug channel, and is also visible to nearby avatars. All other channels are are not sent to avatars, but may be used to communicate with scripts. + Returns the index of the first instance of Find in ListVariable. Returns -1 if not found.\nReturns the position of the first instance of the Find list in the ListVariable. Returns -1 if not found. - llListenControl + llListFindListNext - energy - 10.0 - sleep - 0.0 - return - void arguments - ChannelHandle + ListVariable - type - integer tooltip - + + type + list - Active + Find - type - integer tooltip - + + type + list - - tooltip - Makes a listen event callback active or inactive. Pass in the value returned from llListen to the iChannelHandle parameter to specify which listener you are controlling.\nUse boolean values to specify Active - - llListenRemove - - energy - 10.0 - sleep - 0.0 - return - void - arguments - - ChannelHandle + Instance + tooltip + type integer - tooltip - - tooltip - Removes a listen event callback. Pass in the value returned from llListen to the iChannelHandle parameter to specify which listener to remove. - - llListFindList - energy - 10.0 - sleep - 0.0 + 10 return integer + sleep + 0 + tooltip + Returns the index of the nth instance of Find in ListVariable. Returns -1 if not found. + + llListFindStrided + arguments ListVariable + tooltip + + type + list + + + + Find + + tooltip + type list + + + + Start + tooltip - + + type + integer - Find + End + tooltip + type - list + integer + + + + Stride + tooltip - + + type + integer + energy + 10 + return + integer + sleep + 0 tooltip - Returns the index of the first instance of Find in ListVariable. Returns -1 if not found.\nReturns the position of the first instance of the Find list in the ListVariable. Returns -1 if not found. + Returns the index of the first instance of Find in ListVariable. Returns -1 if not found.\nReturns the position of the first instance of the Find list in the ListVariable after the start index and before the end index. Steps through ListVariable by stride. Returns -1 if not found. llListInsertList - energy - 10.0 - sleep - 0.0 - return - list arguments Target + tooltip + type list - tooltip - ListVariable + tooltip + type list - tooltip - Position + tooltip + type integer - tooltip - + energy + 10 + return + list + sleep + 0 tooltip Returns a list that contains all the elements from Target but with the elements from ListVariable inserted at Position start.\nReturns a new list, created by inserting ListVariable into the Target list at Position. Note this does not alter the Target. llListRandomize - energy - 10.0 - sleep - 0.0 - return - list arguments ListVariable + tooltip + type list - tooltip - Stride + tooltip + type integer - tooltip - + energy + 10 + return + list + sleep + 0 tooltip Returns a version of the input ListVariable which has been randomized by blocks of size Stride.\nIf the remainder from the length of the list, divided by the stride is non-zero, this function does not randomize the list. llListReplaceList - energy - 10.0 - sleep - 0.0 - return - list arguments Target + tooltip + type list - tooltip - ListVariable + tooltip + type list - tooltip - Start + tooltip + type integer - tooltip - End + tooltip + type integer - tooltip - + energy + 10 + return + list + sleep + 0 tooltip Returns a list that is Target with Start through End removed and ListVariable inserted at Start.\nReturns a list replacing the slice of the Target list from Start to End with the specified ListVariable. Start and End are inclusive, so 0, 1 would replace the first two entries and 0, 0 would replace only the first list entry. llListSort + arguments + + + ListVariable + + tooltip + List to sort. + type + list + + + + Stride + + tooltip + Stride length. + type + integer + + + + Ascending + + tooltip + Boolean. TRUE = result in ascending order, FALSE = result in descending order. + type + integer + + + energy - 10.0 - sleep - 0.0 + 10 return list + sleep + 0 + tooltip + Returns the specified list, sorted into blocks of stride in ascending order (if Ascending is TRUE, otherwise descending). Note that sort only works if the first entry of each block is the same datatype. + + llListSortStrided + arguments ListVariable - type - list tooltip List to sort. + type + list Stride - type - integer tooltip Stride length. + type + integer - Ascending + Sortkey + tooltip + The zero based element within the stride to use as the sort key type integer + + + + Ascending + tooltip Boolean. TRUE = result in ascending order, FALSE = result in descending order. + type + integer + energy + 10 + return + list + sleep + 0 tooltip - Returns the specified list, sorted into blocks of stride in ascending order (if Ascending is TRUE, otherwise descending). Note that sort only works if the first entry of each block is the same datatype. + Returns the specified list, sorted by the specified element into blocks of stride in ascending order (if Ascending is TRUE, otherwise descending). Note that sort only works if the first entry of each block is the same datatype. llListStatistics + arguments + + + Operation + + tooltip + One of LIST_STAT_* values + type + integer + + + + ListVariable + + tooltip + Variable to analyze. + type + list + + + energy - 10.0 - sleep - 0.0 + 10 return float + sleep + 0 + tooltip + Performs a statistical aggregate function, specified by a LIST_STAT_* constant, on ListVariables.\nThis function allows a script to perform a statistical operation as defined by operation on a list composed of integers and floats. + + llListen + arguments - Operation + Channel + tooltip + type integer + + + + SpeakersName + tooltip - One of LIST_STAT_* values + + type + string - ListVariable + SpeakersID + tooltip + type - list + key + + + + Text + tooltip - Variable to analyze. + + type + string + energy + 10 + return + integer + sleep + 0 tooltip - Performs a statistical aggregate function, specified by a LIST_STAT_* constant, on ListVariables.\nThis function allows a script to perform a statistical operation as defined by operation on a list composed of integers and floats. + Creates a listen callback for Text on Channel from SpeakersName and SpeakersID (SpeakersName, SpeakersID, and/or Text can be empty) and returns an identifier that can be used to deactivate or remove the listen.\nNon-empty values for SpeakersName, SpeakersID, and Text will filter the results accordingly, while empty strings and NULL_KEY will not filter the results, for string and key parameters respectively.\nPUBLIC_CHANNEL is the public chat channel that all avatars see as chat text. DEBUG_CHANNEL is the script debug channel, and is also visible to nearby avatars. All other channels are are not sent to avatars, but may be used to communicate with scripts. - llLoadURL + llListenControl + arguments + + + ChannelHandle + + tooltip + + type + integer + + + + Active + + tooltip + + type + integer + + + energy - 10.0 + 10 + return + void sleep - 0.1 + 0 + tooltip + Makes a listen event callback active or inactive. Pass in the value returned from llListen to the iChannelHandle parameter to specify which listener you are controlling.\nUse boolean values to specify Active + + llListenRemove + + arguments + + + ChannelHandle + + tooltip + + type + integer + + + + energy + 10 return void + sleep + 0 + tooltip + Removes a listen event callback. Pass in the value returned from llListen to the iChannelHandle parameter to specify which listener to remove. + + llLoadURL + arguments AvatarID + tooltip + type key - tooltip - Text + tooltip + type string - tooltip - URL + tooltip + type string - tooltip - + energy + 10 + return + void + sleep + 0.1000000000000000055511151 tooltip Shows dialog to avatar AvatarID offering to load web page at URL. If user clicks yes, launches their web browser.\nllLoadURL displays a dialogue box to the user, offering to load the specified web page using the default web browser. - llLog - - energy - 10.0 - sleep - 0.0 - return - float + llLog + arguments Value + tooltip + type float - tooltip - + energy + 10 + return + float + sleep + 0 tooltip Returns the natural logarithm of Value. Returns zero if Value <= 0.\nReturns the base e (natural) logarithm of the specified Value. llLog10 - energy - 10.0 - sleep - 0.0 - return - float arguments Value + tooltip + type float - tooltip - + energy + 10 + return + float + sleep + 0 tooltip Returns the base 10 logarithm of Value. Returns zero if Value <= 0.\nReturns the base 10 (common) logarithm of the specified Value. llLookAt - energy - 10.0 - sleep - 0.0 - return - void arguments Target + tooltip + type vector - tooltip - Strength + tooltip + type float - tooltip - Damping + tooltip + type float - tooltip - + energy + 10 + return + void + sleep + 0 tooltip Cause object name to point its forward axis towards Target, at a force controlled by Strength and Damping.\nGood Strength values are around half the mass of the object and good Damping values are less than 1/10th of the Strength.\nAsymmetrical shapes require smaller Damping. A Strength of 0.0 cancels the look at. llLoopSound - energy - 10.0 - sleep - 0.0 - return - void arguments Sound + tooltip + type string - tooltip - Volume + tooltip + type float - tooltip - + energy + 10 + return + void + sleep + 0 tooltip Plays specified Sound, looping indefinitely, at Volume (0.0 - 1.0).\nOnly one sound may be attached to an object at a time.\nA second call to llLoopSound with the same key will not restart the sound, but the new volume will be used. This allows control over the volume of already playing sounds.\nSetting the volume to 0 is not the same as calling llStopSound; a sound with 0 volume will continue to loop.\nTo restart the sound from the beginning, call llStopSound before calling llLoopSound again. llLoopSoundMaster - energy - 10.0 - sleep - 0.0 - return - void arguments Sound + tooltip + type string - tooltip - Volume + tooltip + type float - tooltip - + energy + 10 + return + void + sleep + 0 tooltip - Plays attached Sound, looping at volume (0.0 - 1.0), and declares it a sync master.\nBehaviour is identical to llLoopSound, with the addition of marking the source as a "Sync Master", causing "Slave" sounds to sync to it. If there are multiple masters within a viewers interest area, the most audible one (a function of both distance and volume) will win out as the master.\nThe use of multiple masters within a small area is unlikely to produce the desired effect. + Plays attached Sound, looping at volume (0.0 - 1.0), and declares it a sync master.\nBehaviour is identical to llLoopSound, with the addition of marking the source as a "Sync Master", causing "Slave" sounds to sync to it. If there are multiple masters within a viewers interest area, the most audible one (a function of both distance and volume) will win out as the master.\nThe use of multiple masters within a small area is unlikely to produce the desired effect. llLoopSoundSlave - energy - 10.0 - sleep - 0.0 - return - void arguments Sound + tooltip + type string - tooltip - Volume + tooltip + type float - tooltip - + energy + 10 + return + void + sleep + 0 tooltip - Plays attached sound looping at volume (0.0 - 1.0), synced to most audible sync master.\nBehaviour is identical to llLoopSound, unless there is a "Sync Master" present.\nIf a Sync Master is already playing the Slave sound will begin playing from the same point the master is in its loop synchronizing the loop points of both sounds.\nIf a Sync Master is started when the Slave is already playing, the Slave will skip to the correct position to sync with the Master. + Plays attached sound looping at volume (0.0 - 1.0), synced to most audible sync master.\nBehaviour is identical to llLoopSound, unless there is a "Sync Master" present.\nIf a Sync Master is already playing the Slave sound will begin playing from the same point the master is in its loop synchronizing the loop points of both sounds.\nIf a Sync Master is started when the Slave is already playing, the Slave will skip to the correct position to sync with the Master. - llMakeExplosion + llMD5String - deprecated - true + arguments + + + Text + + tooltip + + type + string + + + + Nonce + + tooltip + + type + integer + + + energy - 10.0 - sleep - 0.1 + 10 return - void + string + sleep + 0 + tooltip + Returns a string of 32 hex characters that is an RSA Data Security Inc., MD5 Message-Digest Algorithm of Text with Nonce used as the salt.\nReturns a 32-character hex string. (128-bit in binary.) + + llMakeExplosion + arguments Particles + tooltip + type integer - tooltip - Scale + tooltip + type float - tooltip - Velocity + tooltip + type float - tooltip - Lifetime + tooltip + type float - tooltip - Arc + tooltip + type float - tooltip - Texture + tooltip + type string - tooltip - Offset + tooltip + type vector - tooltip - + deprecated + 1 + energy + 10 + return + void + sleep + 0.1000000000000000055511151 tooltip Make a round explosion of particles. Deprecated: Use llParticleSystem instead.\nMake a round explosion of particles using texture from the objects inventory. Deprecated: Use llParticleSystem instead. llMakeFire - deprecated - true - energy - 10.0 - sleep - 0.1 - return - void arguments Particles + tooltip + type integer - tooltip - Scale + tooltip + type float - tooltip - Velocity + tooltip + type float - tooltip - Lifetime + tooltip + type float - tooltip - Arc + tooltip + type float - tooltip - Texture + tooltip + type string - tooltip - Offset + tooltip + type vector - tooltip - + deprecated + 1 + energy + 10 + return + void + sleep + 0.1000000000000000055511151 tooltip Make fire like particles. Deprecated: Use llParticleSystem instead.\nMake fire particles using texture from the objects inventory. Deprecated: Use llParticleSystem instead. llMakeFountain - deprecated - true - energy - 10.0 - sleep - 0.1 - return - void arguments Particles + tooltip + type integer - tooltip - Scale + tooltip + type float - tooltip - Velocity + tooltip + type float - tooltip - Lifetime + tooltip + type float - tooltip - Arc + tooltip + type float - tooltip - Bounce + tooltip + type integer - tooltip - Texture + tooltip + type string - tooltip - Offset + tooltip + type vector - tooltip - Bounce_Offset + tooltip + type float - tooltip - + deprecated + 1 + energy + 10 + return + void + sleep + 0.1000000000000000055511151 tooltip Make a fountain of particles. Deprecated: Use llParticleSystem instead.\nMake a fountain of particles using texture from the objects inventory. Deprecated: Use llParticleSystem instead. llMakeSmoke - deprecated - true - energy - 10.0 - sleep - 0.1 - return - void arguments Particles + tooltip + type integer - tooltip - Scale + tooltip + type float - tooltip - Velocity + tooltip + type float - tooltip - Lifetime + tooltip + type float - tooltip - Arc + tooltip + type float - tooltip - Texture + tooltip + type string - tooltip - Offset + tooltip + type vector - tooltip - + deprecated + 1 + energy + 10 + return + void + sleep + 0.1000000000000000055511151 tooltip Make smoke like particles. Deprecated: Use llParticleSystem instead.\nMake smoky particles using texture from the objects inventory. Deprecated: Use llParticleSystem instead. llManageEstateAccess - energy - - sleep - - return - integer arguments Action - type - integer tooltip One of the ESTATE_ACCESS_ALLOWED_* actions. + type + integer AvatarID - type - key tooltip UUID of the avatar or group to act upon. + type + key + energy + 10 + return + integer + sleep + 0 tooltip - Adds or removes agents from the estate's agent access or ban lists, or groups to the estate's group access list. Action is one of the ESTATE_ACCESS_ALLOWED_* operations to perform.\nReturns an integer representing a boolean, TRUE if the call was successful; FALSE if throttled, invalid action, invalid or null id or object owner is not allowed to manage the estate.\nThe object owner is notified of any changes, unless PERMISSION_SILENT_ESTATE_MANAGEMENT has been granted to the script. + Adds or removes agents from the estate's agent access or ban lists, or groups to the estate's group access list. Action is one of the ESTATE_ACCESS_ALLOWED_* operations to perform.\nReturns an integer representing a boolean, TRUE if the call was successful; FALSE if throttled, invalid action, invalid or null id or object owner is not allowed to manage the estate.\nThe object owner is notified of any changes, unless PERMISSION_SILENT_ESTATE_MANAGEMENT has been granted to the script. - llMapDestination + llMapBeacon - energy - 10.0 - sleep - 1.0 - return - void arguments RegionName + tooltip + Region in which to show the beacon. type string - tooltip - Position + tooltip + Position within region to show the beacon. type vector - tooltip - - Direction + Options - type - vector tooltip - + Options + type + list + energy + 10 + return + void + sleep + 1 tooltip - Opens world map for avatar who touched is is wearing the script, centred on RegionName with Position highlighted. Only works for scripts attached to avatar, or during touch events.\nDirection currently has no effect. + Displays an in world beacon and optionally opens world map for avatar who touched the object or is wearing the script, centered on RegionName with Position highlighted. Only works for scripts attached to avatar, or during touch events. - llMD5String + llMapDestination - energy - 10.0 - sleep - 0.0 - return - string arguments - Text + RegionName + tooltip + type string + + + + Position + tooltip - + + type + vector - Nonce + Direction - type - integer tooltip - + + type + vector + energy + 10 + return + void + sleep + 1 tooltip - Returns a string of 32 hex characters that is an RSA Data Security Inc., MD5 Message-Digest Algorithm of Text with Nonce used as the salt.\nReturns a 32-character hex string. (128-bit in binary.) + Opens world map for avatar who touched is is wearing the script, centred on RegionName with Position highlighted. Only works for scripts attached to avatar, or during touch events.\nDirection currently has no effect. llMessageLinked - energy - 10.0 - sleep - 0.0 - return - void arguments LinkNumber + tooltip + type integer - tooltip - Number + tooltip + type integer - tooltip - Text + tooltip + type string - tooltip - ID + tooltip + type key - tooltip - + energy + 10 + return + void + sleep + 0 tooltip Sends Number, Text, and ID to members of the link set identified by LinkNumber.\nLinkNumber is either a linked number (available through llGetLinkNumber) or a LINK_* constant. llMinEventDelay - energy - 10.0 - sleep - 0.0 - return - void arguments Delay + tooltip + type float - tooltip - + energy + 10 + return + void + sleep + 0 tooltip Set the minimum time between events being handled. - llModifyLand + llModPow - energy - 10.0 - sleep - 0.0 - return - void arguments - Action + Value + tooltip + type integer - tooltip - LAND_LEVEL, LAND_RAISE, LAND_LOWER, LAND_SMOOTH, LAND_NOISE or LAND_REVERT - Area + Power + tooltip + type integer + + + + Modulus + tooltip - 0, 1, 2 (2m x 2m, 4m x 4m, or 8m x 8m) + + type + integer - tooltip - Modify land with action (LAND_LEVEL, LAND_RAISE, LAND_LOWER, LAND_SMOOTH, LAND_NOISE, LAND_REVERT) on size (0, 1, 2, corresponding to 2m x 2m, 4m x 4m, 8m x 8m). - - llModPow - energy - 10.0 - sleep - 1.0 + 10 return integer + sleep + 0 + tooltip + Returns a Value raised to the Power, mod Modulus. ((a**b)%c) b is capped at 0xFFFF (16 bits).\nReturns (Value ^ Power) % Modulus. (Value raised to the Power, Modulus). Value is capped at 0xFFFF (16 bits). + + llModifyLand + arguments - Value + Action - type - integer tooltip - - - - - Power - + LAND_LEVEL, LAND_RAISE, LAND_LOWER, LAND_SMOOTH, LAND_NOISE or LAND_REVERT type integer - tooltip - - Modulus + Area + tooltip + 0, 1, 2 (2m x 2m, 4m x 4m, or 8m x 8m) type integer - tooltip - + energy + 10 + return + void + sleep + 0 tooltip - Returns a Value raised to the Power, mod Modulus. ((a**b)%c) b is capped at 0xFFFF (16 bits).\nReturns (Value ^ Power) % Modulus. (Value raised to the Power, Modulus). Value is capped at 0xFFFF (16 bits). + Modify land with action (LAND_LEVEL, LAND_RAISE, LAND_LOWER, LAND_SMOOTH, LAND_NOISE, LAND_REVERT) on size (0, 1, 2, corresponding to 2m x 2m, 4m x 4m, 8m x 8m). llMoveToTarget - energy - 10.0 - sleep - 0.0 - return - void arguments Target + tooltip + type vector - tooltip - Tau + tooltip + type float - tooltip - + energy + 10 + return + void + sleep + 0 tooltip Critically damp to Target in Tau seconds (if the script is physical).\nCritically damp to position target in tau-seconds if the script is physical. Good tau-values are greater than 0.2. A tau of 0.0 stops the critical damping. - llNavigateTo + llName2Key + arguments + + + Name + + tooltip + Name of agent in region to look up. + type + string + + + energy - - sleep - + 10 return - void + key + sleep + 0 + tooltip + Look up Agent ID for the named agent in the region. + + llNavigateTo + arguments Location - type - vector tooltip Region coordinates for the character to navigate to. + type + vector Options - type - list tooltip List of parameters to control the type of path-finding used. Currently only FORCE_DIRECT_PATH supported. + type + list + energy + 10 + return + void + sleep + 0 tooltip Navigate to destination.\nDirects an object to travel to a defined position in the region or adjacent regions. llOffsetTexture - energy - 10.0 - sleep - 0.2 - return - void arguments OffsetS + tooltip + type float - tooltip - OffsetT + tooltip + type float - tooltip - Face + tooltip + type integer - tooltip - + energy + 10 + return + void + sleep + 0.2000000000000000111022302 tooltip Sets the texture S and T offsets for the chosen Face.\nIf Face is ALL_SIDES this function sets the texture offsets for all faces. + llOpenFloater + + arguments + + + floater_name + + tooltip + Identifier for floater to open + type + string + + + + url + + tooltip + URL to pass to floater + type + string + + + + params + + tooltip + Parameters to apply to open floater + type + list + + + + energy + 10 + return + integer + sleep + 0 + tooltip + Returns the value for header for request_id.\nReturns a string that is the value of the Header for HTTPRequestID. + llOpenRemoteDataChannel + arguments + deprecated - true + 1 energy - 10.0 - sleep - 1.0 + 10 return void - arguments - + sleep + 1 tooltip - Requests a channel to listen for XML-RPC calls. (Deprecated: XML-RPC should not be used. Use http-in instead.)\nWill trigger a remote_data event with type = REMOTE_DATA_CHANNEL and a channel ID (key) once it is available.\nThis channel ID must be referenced in the XML-RPC call to the script (from the internet) -- so the key must somehow get to the external XML-RPC client. + This function is deprecated. - llOverMyLand + llOrd + arguments + + + value + + tooltip + The string to convert to Unicode. + type + string + + + + index + + tooltip + Index of character to convert to unicode. + type + integer + + + energy - 10.0 - sleep - 0.0 + 10 return integer + sleep + 0 + tooltip + Returns the unicode value of the indicated character in the string. + + llOverMyLand + arguments ID + tooltip + type key - tooltip - + energy + 10 + return + integer + sleep + 0 tooltip Returns TRUE if id ID over land owned by the script owner, otherwise FALSE.\nReturns TRUE if key ID is over land owned by the object owner, FALSE otherwise. llOwnerSay - energy - 10.0 - sleep - 0.0 - return - void arguments Text + tooltip + type string - tooltip - + energy + 10 + return + void + sleep + 0 tooltip - says Text to owner only (if owner is in region).\nSays Text to the owner of the object running the script, if the owner has been within the object's simulator since logging into Second Life, regardless of where they may be in-world. + says Text to owner only (if owner is in region).\nSays Text to the owner of the object running the script, if the owner has been within the object's simulator since logging into Second Life, regardless of where they may be in-world. llParcelMediaCommandList - energy - 10.0 - sleep - 2.0 - return - void arguments CommandList - type - list tooltip A list of PARCEL_MEDIA_COMMAND_* flags and their parameters + type + list + energy + 10 + return + void + sleep + 2 tooltip Controls the playback of multimedia resources on a parcel or for an agent, via one or more PARCEL_MEDIA_COMMAND_* arguments specified in CommandList. llParcelMediaQuery - energy - 10.0 - sleep - 2.0 - return - list arguments QueryList + tooltip + type list - tooltip - + energy + 10 + return + list + sleep + 2 tooltip Queries the media properties of the parcel containing the script, via one or more PARCEL_MEDIA_COMMAND_* arguments specified in CommandList.\nThis function will only work if the script is contained within an object owned by the land-owner (or if the land is owned by a group, only if the object has been deeded to the group). llParseString2List - energy - 10.0 - sleep - 0.0 - return - list arguments Text + tooltip + type string - tooltip - Separators + tooltip + type list - tooltip - Spacers + tooltip + type list - tooltip - + energy + 10 + return + list + sleep + 0 tooltip Converts Text into a list, discarding Separators, keeping Spacers (Separators and Spacers must be lists of strings, maximum of 8 each).\nSeparators and Spacers are lists of strings with a maximum of 8 entries each. llParseStringKeepNulls - energy - 10.0 - sleep - 0.0 - return - list arguments Text + tooltip + type string - tooltip - Separators + tooltip + type list - tooltip - Spacers + tooltip + type list - tooltip - + energy + 10 + return + list + sleep + 0 tooltip Breaks Text into a list, discarding separators, keeping spacers, keeping any null values generated. (separators and spacers must be lists of strings, maximum of 8 each).\nllParseStringKeepNulls works almost exactly like llParseString2List, except that if a null is found it will add a null-string instead of discarding it like llParseString2List does. llParticleSystem - energy - 10.0 - sleep - 0.0 - return - void arguments Parameters + tooltip + type list - tooltip - + energy + 10 + return + void + sleep + 0 tooltip Creates a particle system in the prim the script is attached to, based on Parameters. An empty list removes a particle system from object.\nList format is [ rule-1, data-1, rule-2, data-2 ... rule-n, data-n ]. llPassCollisions - energy - 10.0 - sleep - 0.0 - return - void arguments Pass - type - integer tooltip Boolean, if TRUE, collisions are passed from children on to parents. + type + integer + energy + 10 + return + void + sleep + 0 tooltip Configures how collision events are passed to scripts in the linkset.\nIf Pass == TRUE, collisions involving collision-handling scripted child prims are also passed on to the root prim. If Pass == FALSE (default behavior), such collisions will only trigger events in the affected child prim. llPassTouches - energy - 10.0 - sleep - 0.0 - return - void arguments Pass - type - integer tooltip Boolean, if TRUE, touches are passed from children on to parents. + type + integer + energy + 10 + return + void + sleep + 0 tooltip Configures how touch events are passed to scripts in the linkset.\nIf Pass == TRUE, touches involving touch-handling scripted child prims are also passed on to the root prim. If Pass == FALSE (default behavior), such touches will only trigger events in the affected child prim. llPatrolPoints - energy - - sleep - - return - void arguments Points - type - list tooltip A list of vectors for the character to travel through sequentially. The list must contain at least two entries. + type + list Options - type - list tooltip No options available at this time. + type + list + energy + 10 + return + void + sleep + 0 tooltip Patrol a list of points.\nSets the points for a character (llCreateCharacter) to patrol along. llPlaySound + arguments + + + Sound + + tooltip + + type + string + + + + Volume + + tooltip + + type + float + + + energy - 10.0 + 10 + return + void sleep - 0.0 + 0 + tooltip + Plays Sound once, at Volume (0.0 - 1.0) and attached to the object.\nOnly one sound may be attached to an object at a time, and attaching a new sound or calling llStopSound will stop the previously attached sound.\nA second call to llPlaySound with the same sound will not restart the sound, but the new volume will be used, which allows control over the volume of already playing sounds.\nTo restart the sound from the beginning, call llStopSound before calling llPlaySound again. + + llPlaySoundSlave + + arguments + + + Sound + + tooltip + + type + string + + + + Volume + + tooltip + + type + float + + + + energy + 10 return void + sleep + 0 + tooltip + Plays attached Sound once, at Volume (0.0 - 1.0), synced to next loop of most audible sync master.\nBehaviour is identical to llPlaySound, unless there is a "Sync Master" present. If a Sync Master is already playing, the Slave sound will not be played until the Master hits its loop point and returns to the beginning.\nllPlaySoundSlave will play the sound exactly once; if it is desired to have the sound play every time the Master loops, either use llLoopSoundSlave with extra silence padded on the end of the sound or ensure that llPlaySoundSlave is called at least once per loop of the Master. + + llPow + + arguments + + + Value + + tooltip + + type + float + + + + Exponent + + tooltip + + type + float + + + + energy + 10 + return + float + sleep + 0 + tooltip + Returns the Value raised to the power Exponent, or returns 0 and triggers Math Error for imaginary results.\nReturns the Value raised to the Exponent. + + llPreloadSound + arguments Sound + tooltip + type string + + + + energy + 10 + return + void + sleep + 1 + tooltip + Causes nearby viewers to preload the Sound from the object's inventory.\nThis is intended to prevent delays in starting new sounds when called upon. + + llPursue + + arguments + + + TargetID + + tooltip + Agent or object to pursue. + type + key + + + + Options + + tooltip + Parameters for pursuit. + type + list + + + + energy + 10 + return + void + sleep + 0 + tooltip + Chase after a target.\nCauses the character (llCharacter) to pursue the target defined by TargetID. + + llPushObject + + arguments + + + ObjectID + + tooltip + + type + key + + + + Impulse + + tooltip + + type + vector + + + + AngularImpulse + + tooltip + + type + vector + + + + Local + tooltip - + + type + integer + + energy + 10 + return + void + sleep + 0 + tooltip + Applies Impulse and AngularImpulse to ObjectID.\nApplies the supplied impulse and angular impulse to the object specified. + + llReadKeyValue + + arguments + - Volume + Key - type - float tooltip - + + type + string + energy + 10 + return + key + sleep + 0 tooltip - Plays Sound once, at Volume (0.0 - 1.0) and attached to the object.\nOnly one sound may be attached to an object at a time, and attaching a new sound or calling llStopSound will stop the previously attached sound.\nA second call to llPlaySound with the same sound will not restart the sound, but the new volume will be used, which allows control over the volume of already playing sounds.\nTo restart the sound from the beginning, call llStopSound before calling llPlaySound again. + + Starts an asychronous transaction to retrieve the value associated with the key given. Will fail with XP_ERROR_KEY_NOT_FOUND if the key does not exist. The dataserver callback will be executed with the key returned from this call and a string describing the result. The result is a two element commma-delimited list. The first item is an integer specifying if the transaction succeeded (1) or not (0). In the failure case, the second item will be an integer corresponding to one of the XP_ERROR_... constants. In the success case the second item will be the value associated with the key. + - llPlaySoundSlave + llRefreshPrimURL + arguments + energy - 10.0 - sleep - 0.0 + 10 return void + sleep + 20 + tooltip + Reloads the web page shown on the sides of the object. + + llRegionSay + arguments - Sound + Channel - type - string tooltip - + Any integer value except zero. + type + integer - Volume + Text - type - float tooltip - + Message to be transmitted. + type + string + energy + 10 + return + void + sleep + 0 tooltip - Plays attached Sound once, at Volume (0.0 - 1.0), synced to next loop of most audible sync master.\nBehaviour is identical to llPlaySound, unless there is a "Sync Master" present. If a Sync Master is already playing, the Slave sound will not be played until the Master hits its loop point and returns to the beginning.\nllPlaySoundSlave will play the sound exactly once; if it is desired to have the sound play every time the Master loops, either use llLoopSoundSlave with extra silence padded on the end of the sound or ensure that llPlaySoundSlave is called at least once per loop of the Master. + Broadcasts Text to entire region on Channel (except for channel 0). - llPow + llRegionSayTo - energy - 10.0 - sleep - 0.0 - return - float arguments - Value + TargetID - type - float tooltip - + Avatar or object to say to. + type + key - Exponent + Channel + tooltip + Output channel, any integer value. type - float + integer + + + + Text + tooltip - + Message to be transmitted. + type + string - tooltip - Returns the Value raised to the power Exponent, or returns 0 and triggers Math Error for imaginary results.\nReturns the Value raised to the Exponent. - - llPreloadSound - energy - 10.0 - sleep - 1.0 + 10 return void + sleep + 0 + tooltip + Says Text, on Channel, to avatar or object indicated by TargetID (if within region).\nIf TargetID is an avatar and Channel is nonzero, Text can be heard by any attachment on the avatar. + + llReleaseCamera + arguments - Sound + AvatarID - type - string tooltip - + + type + key + deprecated + 1 + energy + 10 + return + void + sleep + 0 tooltip - Causes nearby viewers to preload the Sound from the object's inventory.\nThis is intended to prevent delays in starting new sounds when called upon. + Return camera to agent.\nDeprecated: Use llClearCameraParams instead. - llPursue + llReleaseControls + arguments + energy - - sleep - + 10 return void + sleep + 0 + tooltip + Stop taking inputs.\nStop taking inputs from the avatar. + + llReleaseURL + arguments - TargetID + URL - type - key tooltip - Agent or object to pursue. - - - - Options - + URL to release. type - list - tooltip - Parameters for pursuit. + string - tooltip - Chase after a target.\nCauses the character (llCharacter) to pursue the target defined by TargetID. - - llPushObject - energy - 10.0 - sleep - 0.0 + 10 return void + sleep + 0 + tooltip + Releases the specified URL, which was previously obtained using llRequestURL. Once released, the URL will no longer be usable. + + llRemoteDataReply + arguments - ObjectID + ChannelID + tooltip + type key - tooltip - - Impulse + MessageID - type - vector tooltip - + + type + key - AngularImpulse + sData - type - vector tooltip - + String data to send + type + string - Local + iData + tooltip + Integer data to send type integer - tooltip - - tooltip - Applies Impulse and AngularImpulse to ObjectID.\nApplies the supplied impulse and angular impulse to the object specified. - - llReadKeyValue - + deprecated + 1 energy - 10.0 - sleep - 0.0 + 10 return - key - arguments - - - Key - - type - string - tooltip - - - - + void + sleep + 3 tooltip - - Starts an asychronous transaction to retrieve the value associated with the key given. Will fail with XP_ERROR_KEY_NOT_FOUND if the key does not exist. The dataserver callback will be executed with the key returned from this call and a string describing the result. The result is a two element commma-delimited list. The first item is an integer specifying if the transaction succeeded (1) or not (0). In the failure case, the second item will be an integer corresponding to one of the XP_ERROR_... constants. In the success case the second item will be the value associated with the key. - + This function is deprecated. - llRefreshPrimURL + llRemoteDataSetRegion + arguments + + deprecated + 1 energy - 10.0 - sleep - 20.0 + 10 return void - arguments - + sleep + 0 tooltip - Reloads the web page shown on the sides of the object. + This function is deprecated. - llRegionSay + llRemoteLoadScriptPin - energy - 10.0 - sleep - 0.0 - return - void arguments - Channel + ObjectID - type - integer tooltip - Any integer value except zero. + Target prim to attempt copying into. + type + key - Text + ScriptName + tooltip + Name of the script in current inventory to copy. type string - tooltip - Message to be transmitted. - - tooltip - Broadcasts Text to entire region on Channel (except for channel 0). - - llRegionSayTo - - energy - 10.0 - sleep - 0.0 - return - void - arguments - - TargetID + PIN - type - key tooltip - Avatar or object to say to. + Integer set on target prim as a Personal Information Number code. + type + integer - Channel + Running + tooltip + If the script should be set running in the target prim. type integer - tooltip - Output channel, any integer value. - Text + StartParameter + tooltip + Integer. Parameter passed to the script if set to be running. type - string + integer + + + + energy + 10 + return + void + sleep + 3 + tooltip + If the owner of the object containing this script can modify the object identified by the specified object key, and if the PIN matches the PIN previously set using llSetRemoteScriptAccessPin (on the target prim), then the script will be copied into target. Running is a boolean specifying whether the script should be enabled once copied into the target object. + + llRemoveFromLandBanList + + arguments + + + AvatarID + tooltip - Message to be transmitted. + + type + key - tooltip - Says Text, on Channel, to avatar or object indicated by TargetID (if within region).\nIf TargetID is an avatar and Channel is nonzero, Text can be heard by any attachment on the avatar. - - llReleaseCamera - - deprecated - true energy - 10.0 - sleep - 0.0 + 10 return void + sleep + 0.1000000000000000055511151 + tooltip + Remove avatar from the land ban list.\nRemove specified avatar from the land parcel ban list. + + llRemoveFromLandPassList + arguments AvatarID + tooltip + type key - tooltip - - tooltip - Return camera to agent.\nDeprecated: Use llClearCameraParams instead. - - llReleaseControls - energy - 10.0 - sleep - 0.0 + 10 return void - arguments - + sleep + 0.1000000000000000055511151 tooltip - Stop taking inputs.\nStop taking inputs from the avatar. + Remove avatar from the land pass list.\nRemove specified avatar from the land parcel pass list. - llReleaseURL + llRemoveInventory - energy - 10.0 - sleep - 0.0 - return - void arguments - URL + InventoryItem + tooltip + type string - tooltip - URL to release. - tooltip - Releases the specified URL, which was previously obtained using llRequestURL. Once released, the URL will no longer be usable. - - llRemoteDataReply - - deprecated - true energy - 10.0 - sleep - 3.0 + 10 return void + sleep + 0 + tooltip + Remove the named inventory item.\nRemove the named inventory item from the object inventory. + + llRemoveVehicleFlags + arguments - ChannelID + Vehiclelags - type - key tooltip - + + type + integer + + energy + 10 + return + void + sleep + 0 + tooltip + Removes the enabled bits in 'flags'.\nSets the vehicle flags to FALSE. Valid parameters can be found in the vehicle flags constants section. + + llReplaceAgentEnvironment + + arguments + - MessageID + agent_id + tooltip + type key - tooltip - - sData + transition - type - string tooltip - String data to send + + type + float - iData + environment - type - integer tooltip - Integer data to send + + type + string - tooltip - Send an XML-RPC reply to MessageID on ChannelID with payload of string sData and integer iData. Deprecated: Use HTTP functions/events instead.\nThe size of sData is limited to 254 characters. - - llRemoteDataSetRegion - - deprecated - true energy - 10.0 - sleep - 0.0 + 10 return - void - arguments - + integer + sleep + 0 tooltip - Deprecated: Use HTTP functions/events instead.\nIf an object using remote data channels changes regions, you must call this function to re-register the remote data channels.\nYou do not need to make this call if you don't change regions. + Replaces the entire environment for an agent. Must be used as part of an experience. - llRemoteLoadScriptPin + llReplaceEnvironment - energy - 10.0 - sleep - 3.0 - return - void arguments - ObjectID + position - type - key tooltip - Target prim to attempt copying into. + Location of parcel to change. Use <-1, -1, -1> for entire region. + type + vector - ScriptName + environment + tooltip + + Name of inventory item, or UUID of environment resource to apply. + Use NULL_KEY or empty string to remove environment. + type string - tooltip - Name of the script in current inventory to copy. - PIN + track_no + tooltip + Elevation zone of where to apply environment. Use -1 for all. type integer - tooltip - Integer set on target prim as a Personal Information Number code. - Running + day_length + tooltip + Length of day cycle for this parcel or region. -1 to leave unchanged. type integer - tooltip - If the script should be set running in the target prim. - StartParameter + day_offset + tooltip + Offset from GMT for the day cycle on this parcel or region. -1 to leave unchanged. type integer - tooltip - Integer. Parameter passed to the script if set to be running. + energy + 10 + return + integer + sleep + 0 tooltip - If the owner of the object containing this script can modify the object identified by the specified object key, and if the PIN matches the PIN previously set using llSetRemoteScriptAccessPin (on the target prim), then the script will be copied into target. Running is a boolean specifying whether the script should be enabled once copied into the target object. + Replaces the environment for a parcel or region. - llRemoveFromLandBanList + llReplaceSubString - energy - 10.0 - sleep - 0.0 - return - void arguments - AvatarID + InitialString - type - key tooltip - + The original string in which to hunt for substring matches. + type + string - - tooltip - Remove avatar from the land ban list.\nRemove specified avatar from the land parcel ban list. - - llRemoveFromLandPassList - - energy - 10.0 - sleep - 0.0 - return - void - arguments - - AvatarID + SubString - type - key tooltip - + The original substring to find. + type + string - - tooltip - Remove avatar from the land pass list.\nRemove specified avatar from the land parcel pass list. - - llRemoveInventory - - energy - 10.0 - sleep - 0.0 - return - void - arguments - - InventoryItem + NewSubString + tooltip + The new substring used to replace. type string - tooltip - - - tooltip - Remove the named inventory item.\nRemove the named inventory item from the object inventory. - - llRemoveVehicleFlags - - energy - 10.0 - sleep - 0.0 - return - void - arguments - - Vehiclelags + Count + tooltip + The max number of replacements to make. Zero Count means "replace all". Positive Count moves left to right. Negative moves right to left. type integer - tooltip - + energy + 10 + return + string + sleep + 0 tooltip - Removes the enabled bits in 'flags'.\nSets the vehicle flags to FALSE. Valid parameters can be found in the vehicle flags constants section. + Searches InitialString and replaces instances of SubString with NewSubString. Zero Count means "replace all". Positive Count moves left to right. Negative moves right to left. llRequestAgentData - energy - 10.0 - sleep - 0.1 - return - key arguments AvatarID + tooltip + type key - tooltip - Data + tooltip + type integer - tooltip - + energy + 10 + return + key + sleep + 0.1000000000000000055511151 tooltip Requests data about AvatarID. When data is available the dataserver event will be raised.\nThis function requests data about an avatar. If and when the information is collected, the dataserver event is triggered with the key returned from this function passed in the requested parameter. See the agent data constants (DATA_*) for details about valid values of data and what each will return in the dataserver event. llRequestDisplayName - energy - 10.0 - sleep - 0.0 - return - key arguments AvatarID - type - key tooltip Avatar UUID + type + key + energy + 10 + return + key + sleep + 0 tooltip Requests the display name of the agent. When the display name is available the dataserver event will be raised.\nThe avatar identified does not need to be in the same region or online at the time of the request.\nReturns a key that is used to identify the dataserver event when it is raised. llRequestExperiencePermissions - energy - 10.0 - sleep - 0.0 - return - void arguments - - AgentID - - type - key - tooltip - - - - - unused - - type - string - tooltip - Not used, should be "" - - + + AgentID + + tooltip + + type + key + + + + unused + + tooltip + Not used, should be "" + type + string + + + energy + 10 + return + void + sleep + 0 tooltip Ask the agent for permission to participate in an experience. This request is similar to llRequestPermissions with the following permissions: PERMISSION_TAKE_CONTROLS, PERMISSION_TRIGGER_ANIMATION, PERMISSION_ATTACH, PERMISSION_TRACK_CAMERA, PERMISSION_CONTROL_CAMERA and PERMISSION_TELEPORT. However, unlike llRequestPermissions the decision to allow or block the request is persistent and applies to all scripts using the experience grid wide. Subsequent calls to llRequestExperiencePermissions from scripts in the experience will receive the same response automatically with no user interaction. One of experience_permissions or experience_permissions_denied will be generated in response to this call. Outstanding permission requests will be lost if the script is derezzed, moved to another region or reset. @@ -14842,3967 +19494,4479 @@ llRequestInventoryData - energy - 10.0 - sleep - 1.0 - return - key arguments InventoryItem + tooltip + type string - tooltip - - tooltip - Requests data for the named InventoryItem.\nWhen data is available, the dataserver event will be raised with the key returned from this function in the requested parameter.\nThe only request currently implemented is to request data from landmarks, where the data returned is in the form "<float, float, float>" which can be cast to a vector. This position is in region local coordinates. - - llRequestPermissions - energy - 10.0 - sleep - 0.0 + 10 return - void + key + sleep + 1 + tooltip + Requests data for the named InventoryItem.\nWhen data is available, the dataserver event will be raised with the key returned from this function in the requested parameter.\nThe only request currently implemented is to request data from landmarks, where the data returned is in the form "<float, float, float>" which can be cast to a vector. This position is in region local coordinates. + + llRequestPermissions + arguments AvatarID + tooltip + type key - tooltip - PermissionMask + tooltip + type integer - tooltip - + energy + 10 + return + void + sleep + 0 tooltip Ask AvatarID to allow the script to perform certain actions, specified in the PermissionMask bitmask. PermissionMask should be one or more PERMISSION_* constants. Multiple permissions can be requested simultaneously by ORing the constants together. Many of the permissions requests can only go to object owner.\nThis call will not stop script execution. If the avatar grants the requested permissions, the run_time_permissions event will be called. llRequestSecureURL + arguments + energy - 10.0 - sleep - 0.0 + 10 return key - arguments - + sleep + 0 tooltip Requests one HTTPS:// (SSL) URL for use by this object. The http_request event is triggered with results.\nReturns a key that is the handle used for identifying the request in the http_request event. llRequestSimulatorData - energy - 10.0 - sleep - 1.0 - return - key arguments RegionName + tooltip + type string - tooltip - Data + tooltip + type integer - tooltip - + energy + 10 + return + key + sleep + 1 tooltip Requests the specified Data about RegionName. When the specified data is available, the dataserver event is raised.\nData should use one of the DATA_SIM_* constants.\nReturns a dataserver query ID and triggers the dataserver event when data is found. llRequestURL + arguments + energy - 10.0 - sleep - 0.0 + 10 return key - arguments - + sleep + 0 tooltip Requests one HTTP:// URL for use by this script. The http_request event is triggered with the result of the request.\nReturns a key that is the handle used for identifying the result in the http_request event. - llRequestUsername + llRequestUserKey + arguments + + + Name + + tooltip + Name of agent to look up. + type + string + + + energy - 10.0 - sleep - 0.0 + 10 return key + sleep + 0 + tooltip + Look up Agent ID for the named agent using a historical name. + + llRequestUsername + arguments AvatarID + tooltip + type key - tooltip - + energy + 10 + return + key + sleep + 0 tooltip Requests single-word user-name of an avatar. When data is available the dataserver event will be raised.\nRequests the user-name of the identified agent. When the user-name is available the dataserver event is raised.\nThe agent identified does not need to be in the same region or online at the time of the request.\nReturns a key that is used to identify the dataserver event when it is raised. llResetAnimationOverride - energy - 0 - sleep - 0 - return - void arguments AnimationState + tooltip + type string - tooltip - + energy + 10 + return + void + sleep + 0 tooltip - Resets the animation of the specified animation state to the default value.\nIf animation state equals "ALL", then all animation states are reset. + Resets the animation of the specified animation state to the default value.\nIf animation state equals "ALL", then all animation states are reset. llResetLandBanList + arguments + energy - 10.0 - sleep - 0.0 + 10 return void - arguments - + sleep + 0.1000000000000000055511151 tooltip Removes all residents from the land ban list. llResetLandPassList + arguments + energy - 10.0 - sleep - 0.0 + 10 return void - arguments - + sleep + 0.1000000000000000055511151 tooltip Removes all residents from the land access/pass list. llResetOtherScript - energy - 10.0 - sleep - 0.0 - return - void arguments ScriptName + tooltip + type string - tooltip - + energy + 10 + return + void + sleep + 0 tooltip Resets the named script. llResetScript + arguments + energy - 10.0 - sleep - 0.0 + 10 return void - arguments - + sleep + 0 tooltip Resets the script. llResetTime + arguments + energy - 10.0 - sleep - 0.0 + 10 return void - arguments - + sleep + 0 tooltip Sets the time to zero.\nSets the internal timer to zero. llReturnObjectsByID - energy - 10.0 - sleep - 0.0 - return - integer arguments ObjectIDs - type - list tooltip List of object UUIDs to be returned. + type + list + energy + 10 + return + integer + sleep + 0 tooltip Return objects using their UUIDs.\nRequires the PERMISSION_RETURN_OBJECTS permission and that the script owner owns the parcel the returned objects are in, or is an estate manager or region owner. llReturnObjectsByOwner - energy - 10.0 - sleep - 0.0 - return - integer arguments ID + tooltip + Object owner's UUID. type key - tooltip - Object owner's UUID. Scope + tooltip + type integer - tooltip - + energy + 10 + return + integer + sleep + 0 tooltip Return objects based upon their owner and a scope of parcel, parcel owner, or region.\nRequires the PERMISSION_RETURN_OBJECTS permission and that the script owner owns the parcel the returned objects are in, or is an estate manager or region owner. llRezAtRoot - energy - 200.0 - sleep - 0.1 - return - void arguments InventoryItem + tooltip + type string - tooltip - Position + tooltip + type vector - tooltip - Velocity + tooltip + type vector - tooltip - Rotation + tooltip + type rotation - tooltip - StartParameter + tooltip + type integer - tooltip - - tooltip - Instantiate owner's InventoryItem at Position with Velocity, Rotation and with StartParameter. The last selected root object's location will be set to Position.\nCreates object's inventory item at the given Position, with Velocity, Rotation, and StartParameter. - - llRezObject - energy 200 - sleep - 0.1 return void + sleep + 0.1000000000000000055511151 + tooltip + Instantiate owner's InventoryItem at Position with Velocity, Rotation and with StartParameter. The last selected root object's location will be set to Position.\nCreates object's inventory item at the given Position, with Velocity, Rotation, and StartParameter. + + llRezObject + arguments InventoryItem + tooltip + type string - tooltip - Position + tooltip + type vector - tooltip - Velocity + tooltip + type vector - tooltip - Rotation + tooltip + type rotation - tooltip - StartParameter + tooltip + type integer - tooltip - + energy + 200 + return + void + sleep + 0.1000000000000000055511151 tooltip - Instantiate owners InventoryItem at Position with Velocity, Rotation and with start StartParameter.\nCreates object's inventory item at Position with Velocity and Rotation supplied. The StartParameter value will be available to the newly created object in the on_rez event or through the llGetStartParameter function.\nThe Velocity parameter is ignored if the rezzed object is not physical. + Instantiate owners InventoryItem at Position with Velocity, Rotation and with start StartParameter.\nCreates object's inventory item at Position with Velocity and Rotation supplied. The StartParameter value will be available to the newly created object in the on_rez event or through the llGetStartParameter function.\nThe Velocity parameter is ignored if the rezzed object is not physical. - llRot2Angle + llRezObjectWithParams - energy - 10.0 - sleep - 0.0 - return - float arguments - Rotation + InventoryItem + tooltip + type - rotation + string + + + + Parms + tooltip - + + type + list + energy + 200 + return + key + sleep + 0.1000000000000000055511151 tooltip - Returns the rotation angle represented by Rotation.\nReturns the angle represented by the Rotation. + Instantiate owner's InventoryItem with the given parameters. - llRot2Axis + llRot2Angle - energy - 10.0 - sleep - 0.0 - return - vector arguments Rotation + tooltip + type rotation - tooltip - + energy + 10 + return + float + sleep + 0 tooltip - Returns the rotation axis represented by Rotation.\nReturns the axis represented by the Rotation. + Returns the rotation angle represented by Rotation.\nReturns the angle represented by the Rotation. - llRot2Euler + llRot2Axis - energy - 10.0 - sleep - 0.0 - return - vector arguments Rotation + tooltip + type rotation - tooltip - - tooltip - Returns the Euler representation (roll, pitch, yaw) of Rotation.\nReturns the Euler Angle representation of the Rotation. - - llRot2Fwd - energy - 10.0 - sleep - 0.0 + 10 return vector + sleep + 0 + tooltip + Returns the rotation axis represented by Rotation.\nReturns the axis represented by the Rotation. + + llRot2Euler + arguments Rotation + tooltip + type rotation - tooltip - - tooltip - Returns the forward vector defined by Rotation.\nReturns the forward axis represented by the Rotation. - - llRot2Left - energy - 10.0 - sleep - 0.0 + 10 return vector + sleep + 0 + tooltip + Returns the Euler representation (roll, pitch, yaw) of Rotation.\nReturns the Euler Angle representation of the Rotation. + + llRot2Fwd + arguments Rotation + tooltip + type rotation - tooltip - - tooltip - Returns the left vector defined by Rotation.\nReturns the left axis represented by the Rotation. - - llRot2Up - energy - 10.0 - sleep - 0.0 + 10 return vector + sleep + 0 + tooltip + Returns the forward vector defined by Rotation.\nReturns the forward axis represented by the Rotation. + + llRot2Left + arguments Rotation + tooltip + type rotation - tooltip - + energy + 10 + return + vector + sleep + 0 tooltip - Returns the up vector defined by Rotation.\nReturns the up axis represented by the Rotation. + Returns the left vector defined by Rotation.\nReturns the left axis represented by the Rotation. - llRotateTexture + llRot2Up - energy - 10.0 - sleep - 0.2 - return - void arguments - Radians + Rotation - type - float tooltip - - - - - Face - + type - integer - tooltip - + rotation + energy + 10 + return + vector + sleep + 0 tooltip - Sets the texture rotation for the specified Face to angle Radians.\nIf Face is ALL_SIDES, rotates the texture of all sides. + Returns the up vector defined by Rotation.\nReturns the up axis represented by the Rotation. llRotBetween - energy - 10.0 - sleep - 0.0 - return - rotation arguments Vector1 + tooltip + type vector - tooltip - Vector2 + tooltip + type vector - tooltip - + energy + 10 + return + rotation + sleep + 0 tooltip Returns the rotation to rotate Vector1 to Vector2.\nReturns the rotation needed to rotate Vector1 to Vector2. llRotLookAt - energy - 10.0 - sleep - 0.0 - return - void arguments Rotation + tooltip + type rotation - tooltip - Strength + tooltip + type float - tooltip - Damping + tooltip + type float - tooltip - + energy + 10 + return + void + sleep + 0 tooltip Cause object to rotate to Rotation, with a force function defined by Strength and Damping parameters. Good strength values are around half the mass of the object and good damping values are less than 1/10th of the strength.\nAsymmetrical shapes require smaller damping.\nA strength of 0.0 cancels the look at. llRotTarget - energy - 10.0 - sleep - 0.0 - return - integer arguments Rotation + tooltip + type rotation - tooltip - LeeWay + tooltip + type float - tooltip - + energy + 10 + return + integer + sleep + 0 tooltip Set rotations with error of LeeWay radians as a rotational target, and return an ID for the rotational target.\nThe returned number is a handle that can be used in at_rot_target and llRotTargetRemove. llRotTargetRemove - energy - 10.0 - sleep - 0.0 - return - void arguments Handle + tooltip + type integer - tooltip - + energy + 10 + return + void + sleep + 0 tooltip Removes rotational target number.\nRemove rotational target indicated by the handle. - llRound + llRotateTexture + arguments + + + Radians + + tooltip + + type + float + + + + Face + + tooltip + + type + integer + + + energy - 10.0 - sleep - 0.0 + 10 return - integer + void + sleep + 0.2000000000000000111022302 + tooltip + Sets the texture rotation for the specified Face to angle Radians.\nIf Face is ALL_SIDES, rotates the texture of all sides. + + llRound + arguments Value + tooltip + type float - tooltip - + energy + 10 + return + integer + sleep + 0 tooltip Returns Value rounded to the nearest integer.\nReturns the Value rounded to the nearest integer. - llSameGroup + llSHA1String + arguments + + + Text + + tooltip + + type + string + + + energy - 10.0 + 10 + return + string sleep - 0.0 + 0 + tooltip + Returns a string of 40 hex characters that is the SHA1 security hash of text. + + llSHA256String + + arguments + + + text + + tooltip + + type + string + + + + energy + 10 return - integer + string + sleep + 0 + tooltip + Returns a string of 64 hex characters that is the SHA256 security hash of text. + + llSameGroup + arguments ID + tooltip + type key - tooltip - + energy + 10 + return + integer + sleep + 0 tooltip Returns TRUE if avatar ID is in the same region and has the same active group, otherwise FALSE.\nReturns TRUE if the object or agent identified is in the same simulator and has the same active group as this object. Otherwise, returns FALSE. llSay - energy - 10.0 - sleep - 0.0 - return - void arguments Channel - type - integer tooltip Channel to use to say text on. + type + integer Text - type - string tooltip Text to say. + type + string + energy + 10 + return + void + sleep + 0 tooltip Says Text on Channel.\nThis chat method has a range of 20m radius.\nPUBLIC_CHANNEL is the public chat channel that all avatars see as chat text. DEBUG_CHANNEL is the script debug channel, and is also visible to nearby avatars. All other channels are are not sent to avatars, but may be used to communicate with scripts. llScaleByFactor - energy - 10.0 - sleep - 0.0 - return - integer arguments ScalingFactor - type - float tooltip The multiplier to be used with the prim sizes and their local positions. + type + float + energy + 10 + return + integer + sleep + 0 tooltip Attempts to resize the entire object by ScalingFactor, maintaining the size-position ratios of the prims.\n\nResizing is subject to prim scale limits and linkability limits. This function can not resize the object if the linkset is physical, a pathfinding character, in a keyframed motion, or if resizing would cause the parcel to overflow.\nReturns a boolean (an integer) TRUE if it succeeds, FALSE if it fails. llScaleTexture - energy - 10.0 - sleep - 0.2 - return - void arguments Horizontal + tooltip + type float - tooltip - Vertical + tooltip + type float - tooltip - Face + tooltip + type integer - tooltip - + energy + 10 + return + void + sleep + 0.2000000000000000111022302 tooltip Sets the diffuse texture Horizontal and Vertical repeats on Face of the prim the script is attached to.\nIf Face == ALL_SIDES, all sides are set in one call.\nNegative values for horizontal and vertical will flip the texture. llScriptDanger - energy - 10.0 - sleep - 0.0 - return - integer arguments Position + tooltip + type vector - tooltip - + energy + 10 + return + integer + sleep + 0 tooltip - Returns TRUE if Position is over public land, sandbox land, land that doesn't allow everyone to edit and build, or land that doesn't allow outside scripts.\nReturns true if the position is over public land, land that doesn't allow everyone to edit and build, or land that doesn't allow outside scripts. + Returns TRUE if Position is over public land, sandbox land, land that doesn't allow everyone to edit and build, or land that doesn't allow outside scripts.\nReturns true if the position is over public land, land that doesn't allow everyone to edit and build, or land that doesn't allow outside scripts. llScriptProfiler - energy - 10.0 - sleep - 0.0 - return - void arguments State - type - integer tooltip PROFILE_NONE or PROFILE_SCRIPT_MEMORY flags to control the state. + type + integer + energy + 10 + return + void + sleep + 0 tooltip Enables or disables script profiling options. Currently only supports PROFILE_SCRIPT_MEMORY (Mono only) and PROFILE_NONE.\nMay significantly reduce script performance. llSendRemoteData - deprecated - true - energy - 10.0 - sleep - 3.0 - return - key arguments ChannelID + tooltip + type key - tooltip - Destination + tooltip + type string - tooltip - Value + tooltip + type integer - tooltip - Text + tooltip + type string - tooltip - + deprecated + 1 + energy + 10 + return + key + sleep + 3 tooltip - Deprecated: use HTTP functions and events instead.\nSends an XML-RPC request to Destination through ChannelID with payload of ChannelID (in a string), integer Value and string Text.\nReturns a key that is the message_id for the resulting remote_data events. + This function is deprecated. llSensor - energy - 10.0 - sleep - 0.0 - return - void arguments Name - type - string tooltip Object or avatar name. + type + string ID - type - key tooltip Object or avatar UUID. + type + key Type - type - integer tooltip Bit-field mask of AGENT, AGENT_BY_LEGACY_NAME, AGENT_BY_USERNAME, ACTIVE, PASSIVE, and/or SCRIPTED + type + integer Range - type - float tooltip Distance to scan. 0.0 - 96.0m. + type + float Arc - type - float tooltip Angle, in radians, from the local x-axis of the prim to scan. + type + float + energy + 10 + return + void + sleep + 0 tooltip Performs a single scan for Name and ID with Type (AGENT, ACTIVE, PASSIVE, and/or SCRIPTED) within Range meters and Arc radians of forward vector.\nSpecifying a blank Name, 0 Type, or NULL_KEY ID will prevent filtering results based on that parameter. A range of 0.0 does not perform a scan.\nResults are returned in the sensor and no_sensor events. llSensorRemove + arguments + energy - 10.0 - sleep - 0.0 + 10 return void - arguments - + sleep + 0 tooltip removes sensor.\nRemoves the sensor set by llSensorRepeat. llSensorRepeat - energy - 10.0 - sleep - 0.0 - return - void arguments Name - type - string tooltip Object or avatar name. + type + string ID - type - key tooltip Object or avatar UUID. + type + key Type - type - integer tooltip Bit-field mask of AGENT, AGENT_BY_LEGACY_NAME, AGENT_BY_USERNAME, ACTIVE, PASSIVE, and/or SCRIPTED + type + integer Range - type - float tooltip Distance to scan. 0.0 - 96.0m. + type + float Arc - type - float tooltip Angle, in radians, from the local x-axis of the prim to scan. + type + float Rate - type - float tooltip Period, in seconds, between scans. + type + float + energy + 10 + return + void + sleep + 0 tooltip Initiates a periodic scan every Rate seconds, for Name and ID with Type (AGENT, ACTIVE, PASSIVE, and/or SCRIPTED) within Range meters and Arc radians of forward vector.\nSpecifying a blank Name, 0 Type, or NULL_KEY ID will prevent filtering results based on that parameter. A range of 0.0 does not perform a scan.\nResults are returned in the sensor and no_sensor events. - llSetAlpha + llSetAgentEnvironment + arguments + + + agent_id + + tooltip + Agent to receive new environment settings. + type + key + + + + transition + + tooltip + Number of seconds over which to apply new settings. + type + float + + + + Settings + + tooltip + List of environment settings to replace for agent. + type + list + + + energy - 10.0 + 10 + return + integer sleep - 0.0 + 0 + tooltip + Sets an agent's environmental values to the specified values. Must be used as part of an experience. + + llSetAgentRot + + arguments + + + rot + + tooltip + Rotation to turn the avatar to face. + type + rotation + + + + flags + + tooltip + flags + type + integer + + + + energy + 10 return void + sleep + 0 + tooltip + Sets the avatar rotation to the given value. + + llSetAlpha + arguments Opacity + tooltip + type float - tooltip - Face + tooltip + type integer - tooltip - + energy + 10 + return + void + sleep + 0 tooltip Sets the alpha (opacity) of Face.\nSets the alpha (opacity) value for Face. If Face is ALL_SIDES, sets the alpha for all faces. The alpha value is interpreted as an opacity percentage (1.0 is fully opaque, and 0.2 is mostly transparent). This function will clamp alpha values less than 0.1 to 0.1 and greater than 1.0 to 1. llSetAngularVelocity - energy - - sleep - 0.0 - return - void arguments AngVel - type - vector tooltip The angular velocity to set the object to. + type + vector Local - type - integer tooltip If TRUE, the AngVel is treated as a local directional vector instead of a regional directional vector. + type + integer + energy + 10 + return + void + sleep + 0 tooltip - Sets an object's angular velocity to AngVel, in local coordinates if Local == TRUE (if the script is physical).\nHas no effect on non-physical objects. + Sets an object's angular velocity to AngVel, in local coordinates if Local == TRUE (if the script is physical).\nHas no effect on non-physical objects. llSetAnimationOverride - energy - 0 - sleep - 0 - return - void arguments AnimationState + tooltip + type string - tooltip - AnimationName + tooltip + type string - tooltip - + energy + 10 + return + void + sleep + 0 tooltip Sets the animation (in object inventory) that will play for the given animation state.\nTo use this function the script must obtain the PERMISSION_OVERRIDE_ANIMATIONS permission. llSetBuoyancy - energy - 10.0 - sleep - 0.0 - return - void arguments Buoyancy + tooltip + type float - tooltip - + energy + 10 + return + void + sleep + 0 tooltip Set the tasks buoyancy (0 is none, < 1.0 sinks, 1.0 floats, > 1.0 rises).\nSet the object buoyancy. A value of 0 is none, less than 1.0 sinks, 1.0 floats, and greater than 1.0 rises. llSetCameraAtOffset - energy - 10.0 - sleep - 0.0 - return - void arguments Offset + tooltip + type vector - tooltip - + energy + 10 + return + void + sleep + 0 tooltip - Sets the camera used in this object, at offset, if an avatar sits on it.\nSets the offset that an avatar's camera will be moved to if the avatar sits on the object. + Sets the camera used in this object, at offset, if an avatar sits on it.\nSets the offset that an avatar's camera will be moved to if the avatar sits on the object. llSetCameraEyeOffset - energy - 10.0 - sleep - 0.0 - return - void arguments Offset + tooltip + type vector - tooltip - + energy + 10 + return + void + sleep + 0 tooltip Sets the camera eye offset used in this object if an avatar sits on it. llSetCameraParams - energy - 10.0 - sleep - 0.0 - return - void arguments Parameters + tooltip + type list - tooltip - + energy + 10 + return + void + sleep + 0 tooltip Sets multiple camera parameters at once. List format is [ rule-1, data-1, rule-2, data-2 . . . rule-n, data-n ]. llSetClickAction - energy - 10.0 - sleep - 0.0 - return - void arguments Action - type - integer tooltip A CLICK_ACTION_* flag + type + integer + energy + 10 + return + void + sleep + 0 tooltip Sets the action performed when a prim is clicked upon. llSetColor - energy - 10.0 - sleep - 0.0 - return - void arguments Color + tooltip + type vector - tooltip - Face + tooltip + type integer - tooltip - + energy + 10 + return + void + sleep + 0 tooltip Sets the color, for the face.\nSets the color of the side specified. If Face is ALL_SIDES, sets the color on all faces. llSetContentType - energy - - sleep - - return - void arguments HTTPRequestID + tooltip + A valid http_request() key type key + + + + ContentType + tooltip - A valid http_request() key + Media type to use with any following llHTTPResponse(HTTPRequestID, ...) + type + integer + + energy + 10 + return + void + sleep + 0 + tooltip + Set the media type of an LSL HTTP server response to ContentType.\nHTTPRequestID must be a valid http_request ID. ContentType must be one of the CONTENT_TYPE_* constants. + + llSetDamage + + arguments + - ContentType + Damage - type - integer tooltip - Media type to use with any following llHTTPResponse(HTTPRequestID, ...) + + type + float - tooltip - Set the media type of an LSL HTTP server response to ContentType.\nHTTPRequestID must be a valid http_request ID. ContentType must be one of the CONTENT_TYPE_* constants. - - llSetDamage - energy - 10.0 - sleep - 0.0 + 10 return void + sleep + 0 + tooltip + Sets the amount of damage that will be done to an avatar that this task hits. Task will be killed.\nSets the amount of damage that will be done to an avatar that this object hits. This object will be destroyed on damaging an avatar, and no collision event is triggered. + + llSetEnvironment + arguments - Damage + Position + tooltip + Location within the region. type - float + vector + + + + EnvParams + tooltip - + List of environment settings to change for the specified parcel location. + type + list + energy + 10 + return + integer + sleep + 0 tooltip - Sets the amount of damage that will be done to an avatar that this task hits. Task will be killed.\nSets the amount of damage that will be done to an avatar that this object hits. This object will be destroyed on damaging an avatar, and no collision event is triggered. + Returns a string with the requested data about the region. llSetForce - energy - 10.0 - sleep - 0.0 - return - void arguments Force - type - vector tooltip Directional force. + type + vector Local - type - integer tooltip Boolean, if TRUE uses local axis, if FALSE uses region axis. + type + integer + energy + 10 + return + void + sleep + 0 tooltip Sets Force on object, in object-local coordinates if Local == TRUE (otherwise, the region reference frame is used).\nOnly works on physical objects. llSetForceAndTorque - energy - 10.0 - sleep - 0.0 - return - void arguments Force - type - vector tooltip Directional force. + type + vector Torque - type - vector tooltip Torque force. + type + vector Local - type - integer tooltip Boolean, if TRUE uses local axis, if FALSE uses region axis. + type + integer + energy + 10 + return + void + sleep + 0 tooltip Sets the Force and Torque of object, in object-local coordinates if Local == TRUE (otherwise, the region reference frame is used).\nOnly works on physical objects. - llSetHoverHeight + llSetGroundTexture + arguments + + + Changes + + tooltip + A list of ground texture properties to change. + type + list + + + energy - 10.0 - sleep - 0.0 + 10 return - void + integer + sleep + 0 + tooltip + Changes terrain texture properties in the region. + + llSetHoverHeight + arguments Height - type - float tooltip Distance above the ground. + type + float Water - type - integer tooltip Boolean, if TRUE then hover above water too. + type + integer Tau - type - float tooltip Seconds to critically damp in. + type + float + energy + 10 + return + void + sleep + 0 tooltip Critically damps a physical object to a Height (either above ground level or above the higher of land and water if water == TRUE).\nDo not use with vehicles. Use llStopHover to stop hovering. llSetInventoryPermMask - god-mode - true - energy - 10.0 - sleep - 0.0 - return - void arguments InventoryItem + tooltip + An item in the prim's inventory type string - tooltip - An item in the prim's inventory PermissionFlag - type - integer tooltip MASK_* flag + type + integer PermissionMask - type - integer tooltip Permission bit-field (PERM_* flags) + type + integer + energy + 10 + god-mode + 1 + return + void + sleep + 0 tooltip Sets the given permission mask to the new value on the inventory item. llSetKeyframedMotion - energy - - sleep - - return - void arguments Keyframes - type - list tooltip Strided keyframe list of the form: position, orientation, time. Each keyframe is interpreted relative to the previous transform of the object. + type + list Options + tooltip + type list - tooltip - + energy + 10 + return + void + sleep + 0 tooltip Requests that a non-physical object be key-framed according to key-frame list.\nSpecify a list of times, positions, and orientations to be followed by an object. The object will be smoothly moved between key-frames by the simulator. Collisions with other non-physical or key-framed objects will be ignored (no script events will fire and collision processing will not occur). Collisions with physical objects will be computed and reported, but the key-framed object will be unaffected by those collisions.\nKeyframes is a strided list containing positional, rotational, and time data for each step in the motion. Options is a list containing optional arguments and parameters (specified by KFM_* constants). llSetLinkAlpha - energy - 10.0 - sleep - 0.0 - return - void arguments LinkNumber + tooltip + type integer - tooltip - Opacity + tooltip + type float - tooltip - Face + tooltip + type integer - tooltip - + energy + 10 + return + void + sleep + 0 tooltip If a prim exists in the link chain at LinkNumber, set Face to Opacity.\nSets the Face, on the linked prim specified, to the Opacity. llSetLinkCamera - energy - 10.0 - sleep - 0.0 - return - void arguments LinkNumber - type - integer tooltip Prim link number (0: unlinked, 1: root prim, >1: child prims) or a LINK_* flag + type + integer EyeOffset + tooltip + Offset, relative to the object's centre and expressed in local coordinates, that the camera looks from. type vector - tooltip - Offset, relative to the object's centre and expressed in local coordinates, that the camera looks from. LookOffset + tooltip + Offset, relative to the object's centre and expressed in local coordinates, that the camera looks toward. type vector - tooltip - Offset, relative to the object's centre and expressed in local coordinates, that the camera looks toward. + energy + 10 + return + void + sleep + 0 tooltip Sets the camera eye offset, and the offset that camera is looking at, for avatars that sit on the linked prim. llSetLinkColor + arguments + + + LinkNumber + + tooltip + Link number (0: unlinked, 1: root prim, >1: child prims) or a LINK_* flag. + type + integer + + + + Color + + tooltip + Color in RGB <R.R, G.G, B.B> + type + vector + + + + Face + + tooltip + Side number or ALL_SIDES. + type + integer + + + energy - 10.0 - sleep - 0.0 + 10 return void + sleep + 0 + tooltip + If a task exists in the link chain at LinkNumber, set the Face to color.\nSets the color of the linked child's side, specified by LinkNumber. + + llSetLinkMedia + + arguments + + + Link + + tooltip + Link number (0: unlinked, 1: root prim, >1: child prims). + type + integer + + + + Face + + tooltip + Face number. + type + integer + + + + Parameters + + tooltip + A set of name/value pairs (in no particular order) + type + list + + + + energy + 10 + return + integer + sleep + 0 + tooltip + Set the media parameters for a particular face on linked prim, specified by Link. Returns an integer that is a STATUS_* flag which details the success/failure of the operation(s).\nMediaParameters is a set of name/value pairs in no particular order. Parameters not specified are unchanged, or if new media is added then set to the default specified. + + llSetLinkPrimitiveParams + arguments LinkNumber + tooltip + Link number (0: unlinked, 1: root prim, >1: child prims) or a LINK_* flag type integer - tooltip - Link number (0: unlinked, 1: root prim, >1: child prims) or a LINK_* flag. - Color + Parameters - type - vector tooltip - Color in RGB <R.R, G.G, B.B> - - - - Face - + type - integer - tooltip - Side number or ALL_SIDES. + list + energy + 10 + return + void + sleep + 0.2000000000000000111022302 tooltip - If a task exists in the link chain at LinkNumber, set the Face to color.\nSets the color of the linked child's side, specified by LinkNumber. + Set primitive parameters for LinkNumber based on Parameters.\nSets the parameters (or properties) of any linked prim in one step. - llSetLinkMedia + llSetLinkPrimitiveParamsFast - energy - 0.0 - sleep - 0.0 - return - integer arguments - Link + LinkNumber - type - integer tooltip - Link number (0: unlinked, 1: root prim, >1: child prims). - - - - Face - + Link number (0: unlinked, 1: root prim, >1: child prims) or a LINK_* flag type integer - tooltip - Face number. Parameters + tooltip + type list - tooltip - A set of name/value pairs (in no particular order) - tooltip - Set the media parameters for a particular face on linked prim, specified by Link. Returns an integer that is a STATUS_* flag which details the success/failure of the operation(s).\nMediaParameters is a set of name/value pairs in no particular order. Parameters not specified are unchanged, or if new media is added then set to the default specified. - - llSetLinkPrimitiveParams - energy - 10.0 - sleep - 0.2 + 10 return void + sleep + 0 + tooltip + Set primitive parameters for LinkNumber based on Parameters, without a delay.\nSet parameters for link number, from the list of Parameters, with no built-in script sleep. This function is identical to llSetLinkPrimitiveParams, except without the delay. + + llSetLinkRenderMaterial + arguments LinkNumber + tooltip + type integer - tooltip - Link number (0: unlinked, 1: root prim, >1: child prims) or a LINK_* flag - Parameters + RenderMaterial + tooltip + type - list + string + + + + Face + tooltip - + + type + integer - tooltip - Set primitive parameters for LinkNumber based on Parameters.\nSets the parameters (or properties) of any linked prim in one step. - - llSetLinkPrimitiveParamsFast - energy - 10.0 - sleep - 0.0 + 10 return void + sleep + 0.2000000000000000111022302 + tooltip + Sets the Render Material of Face on a linked prim, specified by LinkNumber. Render Materail may be a UUID or name of a material in prim inventory. + + llSetLinkSitFlags + arguments LinkNumber + tooltip + Link number (0: unlinked, 1: root prim, >1: child prims) or a LINK_* flag. type integer - tooltip - Link number (0: unlinked, 1: root prim, >1: child prims) or a LINK_* flag - Parameters + Flags - type - list tooltip - + The new set of sit flags to apply to the specified prims in this linkset. + type + integer + energy + 10 + return + void + sleep + 0 tooltip - Set primitive parameters for LinkNumber based on Parameters, without a delay.\nSet parameters for link number, from the list of Parameters, with no built-in script sleep. This function is identical to llSetLinkPrimitiveParams, except without the delay. + Returns the sit flags set on the specified prim in a linkset. llSetLinkTexture - energy - 10.0 - sleep - 0.2 - return - void arguments LinkNumber + tooltip + type integer - tooltip - Texture + tooltip + type string - tooltip - Face + tooltip + type integer - tooltip - + energy + 10 + return + void + sleep + 0.2000000000000000111022302 tooltip Sets the Texture of Face on a linked prim, specified by LinkNumber. Texture may be a UUID or name of a texture in prim inventory. llSetLinkTextureAnim - energy - 10.0 - sleep - 0.0 - return - void arguments LinkNumber - type - integer tooltip Link number (0: unlinked, 1: root prim, >1: child prims) or a LINK_* flag to effect + type + integer Mode - type - integer tooltip Bitmask of animation options. + type + integer Face - type - integer tooltip Specifies which object face to animate or ALL_SIDES. + type + integer SizeX - type - integer tooltip Horizontal frames (ignored for ROTATE and SCALE). + type + integer SizeY - type - integer tooltip Vertical frames (ignored for ROTATE and SCALE). + type + integer Start - type - float tooltip Start position/frame number (or radians for ROTATE). + type + float Length - type - float tooltip Specifies the animation duration, in frames (or radians for ROTATE). + type + float Rate - type - float tooltip Specifies the animation playback rate, in frames per second (must be greater than zero). + type + float + energy + 10 + return + void + sleep + 0 tooltip Animates a texture on the prim specified by LinkNumber, by setting the texture scale and offset.\nMode is a bitmask of animation options.\nFace specifies which object face to animate.\nSizeX and SizeY specify the number of horizontal and vertical frames.Start specifes the animation start point.\nLength specifies the animation duration.\nRate specifies the animation playback rate. llSetLocalRot - energy - 10.0 - sleep - 0.2 - return - void arguments Rotation + tooltip + type rotation - tooltip - + energy + 10 + return + void + sleep + 0.2000000000000000111022302 tooltip Sets the rotation of a child prim relative to the root prim. llSetMemoryLimit - energy - 10.0 - sleep - 0.0 - return - integer arguments Limit - type - integer tooltip The amount to reserve, which must be less than the allowed maximum (currently 64KB) and not already have been exceeded. + type + integer + energy + 10 + return + integer + sleep + 0 tooltip Requests Limit bytes to be reserved for this script.\nReturns TRUE or FALSE indicating whether the limit was set successfully.\nThis function has no effect if the script is running in the LSO VM. llSetObjectDesc - energy - 10.0 - sleep - 0.0 - return - void arguments Description + tooltip + type string - tooltip - + energy + 10 + return + void + sleep + 0 tooltip Sets the description of the prim to Description.\nThe description field is limited to 127 characters. llSetObjectName - energy - 10.0 - sleep - 0.0 - return - void arguments Name + tooltip + type string - tooltip - + energy + 10 + return + void + sleep + 0 tooltip - Sets the prim's name to Name. + Sets the prim's name to Name. llSetObjectPermMask - god-mode - true - energy - 10.0 - sleep - 0.0 - return - void arguments PermissionFlag - type - integer tooltip MASK_* flag + type + integer PermissionMask - type - integer tooltip Permission bit-field (PERM_* flags) + type + integer + energy + 10 + god-mode + 1 + return + void + sleep + 0 tooltip Sets the specified PermissionFlag permission to the value specified by PermissionMask on the object the script is attached to. llSetParcelMusicURL - energy - 10.0 - sleep - 2.0 - return - void arguments URL + tooltip + type string - tooltip - + energy + 10 + return + void + sleep + 2 tooltip Sets the streaming audio URL for the parcel the object is on.\nThe object must be owned by the owner of the parcel; if the parcel is group owned the object must be owned by that group. llSetPayPrice - energy - 10.0 - sleep - 0.0 - return - void arguments Price - type - integer tooltip The default price shown in the textu input field. + type + integer QuickButtons + tooltip + Specifies the 4 payment values shown in the payment dialog's buttons (or PAY_HIDE). type list - tooltip - Specifies the 4 payment values shown in the payment dialog's buttons (or PAY_HIDE). + energy + 10 + return + void + sleep + 0 tooltip - Sets the default amount when someone chooses to pay this object.\nPrice is the default price shown in the textu input field. QuickButtons specifies the 4 payment values shown in the payment dialog's buttons.\nInput field and buttons may be hidden with PAY_HIDE constant, and may be set to their default values using PAY_DEFAULT. + Sets the default amount when someone chooses to pay this object.\nPrice is the default price shown in the textu input field. QuickButtons specifies the 4 payment values shown in the payment dialog's buttons.\nInput field and buttons may be hidden with PAY_HIDE constant, and may be set to their default values using PAY_DEFAULT. llSetPhysicsMaterial - energy - - sleep - - return - void arguments MaterialBits - type - integer tooltip A bitmask specifying which of the parameters in the other arguments should be applied to the object. + type + integer GravityMultiplier + tooltip + type float - tooltip - Restitution + tooltip + type float - tooltip - Friction + tooltip + type float - tooltip - Density + tooltip + type float - tooltip - + energy + 10 + return + void + sleep + 0 tooltip - Sets the selected parameters of the object's physics behavior.\nMaterialBits is a bitmask specifying which of the parameters in the other arguments should be applied to the object. GravityMultiplier, Restitution, Friction, and Density are the possible parameters to manipulate. + Sets the selected parameters of the object's physics behavior.\nMaterialBits is a bitmask specifying which of the parameters in the other arguments should be applied to the object. GravityMultiplier, Restitution, Friction, and Density are the possible parameters to manipulate. llSetPos - energy - 10.0 - sleep - 0.2 - return - void arguments Position - type - vector tooltip Region coordinates to move to (within 10m). + type + vector - tooltip - If the object is not physical, this function sets the position of the prim.\nIf the script is in a child prim, Position is treated as root relative and the link-set is adjusted.\nIf the prim is the root prim, the entire object is moved (up to 10m) to Position in region coordinates. - - llSetPrimitiveParams - energy - 10.0 - sleep - 0.2 + 10 return void - arguments - - - Parameters - - type - list - tooltip - A list of changes. - - - + sleep + 0.2000000000000000111022302 tooltip - This function changes the many properties (or "parameters") of a prim in one operation. Parameters is a list of changes. + If the object is not physical, this function sets the position of the prim.\nIf the script is in a child prim, Position is treated as root relative and the link-set is adjusted.\nIf the prim is the root prim, the entire object is moved (up to 10m) to Position in region coordinates. llSetPrimMediaParams - energy - 10.0 - sleep - 1.0 - return - integer arguments Face - type - integer tooltip Face number + type + integer MediaParameters - type - list tooltip A set of name/value pairs (in no particular order) + type + list + energy + 10 + return + integer + sleep + 1 tooltip Sets the MediaParameters for a particular Face on the prim. Returns an integer that is a STATUS_* flag which details the success/failure of the operation(s).\nMediaParameters is a set of name/value pairs in no particular order. Parameters not specified are unchanged, or if new media is added then set to the default specified. llSetPrimURL - deprecated - true - energy - 10.0 - sleep - 20.0 - return - void arguments URL + tooltip + type string - tooltip - + deprecated + 1 + energy + 10 + return + void + sleep + 20 tooltip Deprecated: Use llSetPrimMediaParams instead. - llSetRegionPos + llSetPrimitiveParams + arguments + + + Parameters + + tooltip + A list of changes. + type + list + + + energy - 0.0 - sleep - 0.0 + 10 return - integer + void + sleep + 0.2000000000000000111022302 + tooltip + This function changes the many properties (or "parameters") of a prim in one operation. Parameters is a list of changes. + + llSetRegionPos + arguments Position - type - vector tooltip Vector. The location to move to, in region coordinates. + type + vector + energy + 10 + return + integer + sleep + 0 tooltip Attempts to move the object so that the root prim is within 0.1m of Position.\nReturns an integer boolean, TRUE if the object is successfully placed within 0.1 m of Position, FALSE otherwise.\nPosition may be any location within the region or up to 10m across a region border.\nIf the position is below ground, it will be set to the ground level at that x,y location. llSetRemoteScriptAccessPin - energy - 10.0 - sleep - 0.2 - return - void arguments PIN + tooltip + type integer - tooltip - + energy + 10 + return + void + sleep + 0.2000000000000000111022302 tooltip If PIN is set to a non-zero number, the task will accept remote script loads via llRemoteLoadScriptPin() if it passes in the correct PIN. Othersise, llRemoteLoadScriptPin() is ignored. - llSetRot + llSetRenderMaterial + arguments + + + Material + + tooltip + + type + string + + + + Face + + tooltip + + type + integer + + + energy - 10.0 - sleep - 0.2 + 10 return void + sleep + 0.2000000000000000111022302 + tooltip + Applies Render Material to Face of prim.\nRender Material may be a UUID or name of a material in prim inventory.\nIf Face is ALL_SIDES, set the render material on all faces. + + llSetRot + arguments Rotation + tooltip + type rotation - tooltip - + energy + 10 + return + void + sleep + 0.2000000000000000111022302 tooltip If the object is not physical, this function sets the rotation of the prim.\nIf the script is in a child prim, Rotation is treated as root relative and the link-set is adjusted.\nIf the prim is the root prim, the entire object is rotated to Rotation in the global reference frame. llSetScale - energy - 10.0 - sleep - 0.0 - return - void arguments Scale + tooltip + type vector - tooltip - + energy + 10 + return + void + sleep + 0 tooltip - Sets the prim's scale (size) to Scale. + Sets the prim's scale (size) to Scale. llSetScriptState - energy - 10.0 - sleep - 0.0 - return - void arguments ScriptName + tooltip + type string - tooltip - Running + tooltip + type integer - tooltip - + energy + 10 + return + void + sleep + 0 tooltip Enable or disable the script Running state of Script in the prim. llSetSitText - energy - 10.0 - sleep - 0.0 - return - void arguments Text + tooltip + type string - tooltip - + energy + 10 + return + void + sleep + 0 tooltip - Displays Text rather than 'Sit' in the viewer's context menu. + Displays Text rather than 'Sit' in the viewer's context menu. llSetSoundQueueing - energy - 10.0 - sleep - 0.0 - return - void arguments QueueEnable - type - integer tooltip Boolean, sound queuing: TRUE enables, FALSE disables (default). + type + integer + energy + 10 + return + void + sleep + 0 tooltip Sets whether successive calls to llPlaySound, llLoopSound, etc., (attached sounds) interrupt the currently playing sound.\nThe default for objects is FALSE. Setting this value to TRUE will make the sound wait until the current playing sound reaches its end. The queue is one level deep. llSetSoundRadius - energy - 10.0 - sleep - 0.0 - return - void arguments Radius - type - float tooltip Maximum distance that sounds can be heard. + type + float + energy + 10 + return + void + sleep + 0 tooltip Limits radius for audibility of scripted sounds (both attached and triggered) to distance Radius. llSetStatus - energy - 10.0 - sleep - 0.0 - return - void arguments Status + tooltip + type integer - tooltip - Value + tooltip + type integer - tooltip - + energy + 10 + return + void + sleep + 0 tooltip Sets object status specified in Status bitmask (e.g. STATUS_PHYSICS|STATUS_PHANTOM) to boolean Value.\nFor a full list of STATUS_* constants, see wiki documentation. llSetText - energy - 10.0 - sleep - 0.0 - return - void arguments Text + tooltip + type string - tooltip - Color + tooltip + type vector - tooltip - Opacity + tooltip + type float - tooltip - + energy + 10 + return + void + sleep + 0 tooltip Causes Text to float above the prim, using the specified Color and Opacity. llSetTexture - energy - 10.0 - sleep - 0.2 - return - void arguments Texture + tooltip + type string - tooltip - Face + tooltip + type integer - tooltip - + energy + 10 + return + void + sleep + 0.2000000000000000111022302 tooltip Applies Texture to Face of prim.\nTexture may be a UUID or name of a texture in prim inventory.\nIf Face is ALL_SIDES, set the texture on all faces. llSetTextureAnim - energy - 10.0 - sleep - 0.0 - return - void arguments Mode - type - integer tooltip Mask of Mode flags. + type + integer Face - type - integer tooltip Face number or ALL_SIDES. + type + integer SizeX - type - integer tooltip Horizontal frames (ignored for ROTATE and SCALE). + type + integer SizeY - type - integer tooltip Vertical frames (ignored for ROTATE and SCALE). + type + integer Start - type - float tooltip Start position/frame number (or radians for ROTATE). + type + float Length - type - float tooltip number of frames to display (or radians for ROTATE). + type + float Rate - type - float tooltip Frames per second (must not greater than zero). + type + float + energy + 10 + return + void + sleep + 0 tooltip Animates a texture by setting the texture scale and offset.\nMode is a bitmask of animation options.\nFace specifies which object face to animate.\nSizeX and SizeY specify the number of horizontal and vertical frames.Start specifes the animation start point.\nLength specifies the animation duration.\nRate specifies the animation playback rate. llSetTimerEvent - energy - 10.0 - sleep - 0.0 - return - void arguments Rate + tooltip + type float - tooltip - + energy + 10 + return + void + sleep + 0 tooltip Causes the timer event to be triggered every Rate seconds.\n Passing in 0.0 stops further timer events. llSetTorque - energy - 10.0 - sleep - 0.0 - return - void arguments Torque - type - vector tooltip Torque force. + type + vector Local - type - integer tooltip Boolean, if TRUE uses local axis, if FALSE uses region axis. + type + integer + energy + 10 + return + void + sleep + 0 tooltip - Sets the Torque acting on the script's object, in object-local coordinates if Local == TRUE (otherwise, the region reference frame is used).\nOnly works on physical objects. + Sets the Torque acting on the script's object, in object-local coordinates if Local == TRUE (otherwise, the region reference frame is used).\nOnly works on physical objects. llSetTouchText - energy - 10.0 - sleep - 0.0 - return - void arguments Text + tooltip + type string - tooltip - + energy + 10 + return + void + sleep + 0 tooltip Displays Text in the viewer context menu that acts on a touch. llSetVehicleFlags - energy - 10.0 - sleep - 0.0 - return - void arguments Flags + tooltip + type integer - tooltip - + energy + 10 + return + void + sleep + 0 tooltip Enables the vehicle flags specified in the Flags bitmask.\nValid parameters can be found in the wiki documentation. llSetVehicleFloatParam - energy - 10.0 - sleep - 0.0 - return - void arguments ParameterName + tooltip + type integer - tooltip - ParameterValue + tooltip + type float - tooltip - + energy + 10 + return + void + sleep + 0 tooltip Sets a vehicle float parameter.\nValid parameters can be found in the wiki documentation. llSetVehicleRotationParam - energy - 10.0 - sleep - 0.0 - return - void arguments ParameterName + tooltip + type integer - tooltip - ParameterValue + tooltip + type rotation - tooltip - + energy + 10 + return + void + sleep + 0 tooltip Sets a vehicle rotation parameter.\nValid parameters can be found in the wiki documentation. llSetVehicleType - energy - 10.0 - sleep - 0.0 - return - void arguments Type + tooltip + type integer - tooltip - + energy + 10 + return + void + sleep + 0 tooltip Activates the vehicle action on the object with vehicle preset Type.\nValid Types and an explanation of their characteristics can be found in wiki documentation. llSetVehicleVectorParam - energy - 10.0 - sleep - 0.0 - return - void arguments ParameterName + tooltip + type integer - tooltip - ParameterValue + tooltip + type vector - tooltip - + energy + 10 + return + void + sleep + 0 tooltip Sets a vehicle vector parameter.\nValid parameters can be found in the wiki documentation. llSetVelocity - energy - - sleep - 0.0 - return - void arguments Velocity - type - vector tooltip The velocity to apply. + type + vector Local - type - integer tooltip If TRUE, the Velocity is treated as a local directional vector instead of a regional directional vector. + type + integer + energy + 10 + return + void + sleep + 0 tooltip - If the object is physics-enabled, sets the object's linear velocity to Velocity.\nIf Local==TRUE, Velocity is treated as a local directional vector; otherwise, Velocity is treated as a global directional vector. + If the object is physics-enabled, sets the object's linear velocity to Velocity.\nIf Local==TRUE, Velocity is treated as a local directional vector; otherwise, Velocity is treated as a global directional vector. - llSHA1String + llShout - energy - 10.0 - sleep - 0.0 - return - string arguments + + Channel + + tooltip + + type + integer + + Text + tooltip + type string - tooltip - - tooltip - Returns a string of 40 hex characters that is the SHA1 security Hash of Text. - - llShout - energy - 10.0 - sleep - 0.0 + 10 return void + sleep + 0 + tooltip + Shouts Text on Channel.\nThis chat method has a range of 100m radius.\nPUBLIC_CHANNEL is the public chat channel that all avatars see as chat text. DEBUG_CHANNEL is the script debug channel, and is also visible to nearby avatars. All other channels are are not sent to avatars, but may be used to communicate with scripts. + + llSignRSA + arguments - Channel + PrivateKey - type - integer tooltip - + The PEM-formatted private key + type + string - Text + Message + tooltip + The message contents to sign type string + + + + Algorithm + tooltip - + The digest algorithnm to use: sha1, sha224, sha256, sha384, sha512 + type + string + energy + 10 + return + string + sleep + 0 tooltip - Shouts Text on Channel.\nThis chat method has a range of 100m radius.\nPUBLIC_CHANNEL is the public chat channel that all avatars see as chat text. DEBUG_CHANNEL is the script debug channel, and is also visible to nearby avatars. All other channels are are not sent to avatars, but may be used to communicate with scripts. + Returns the base64-encoded RSA signature of Message using PEM-formatted PrivateKey and digest Algorithm (sha1, sha224, sha256, sha384, sha512). llSin - energy - 10.0 - sleep - 0.0 - return - float arguments Theta + tooltip + type float - tooltip - + energy + 10 + return + float + sleep + 0 tooltip Returns the sine of Theta (Theta in radians). - llSitTarget + llSitOnLink + arguments + + + AvatarID + + tooltip + + type + key + + + + LinkID + + tooltip + + type + integer + + + energy - 10.0 - sleep - 0.0 + 10 return - void + integer + sleep + 0 + tooltip + If agent identified by AvatarID is participating in the experience, sit them on the specified link's sit target. + + llSitTarget + arguments Offset + tooltip + type vector - tooltip - Rotation + tooltip + type rotation - tooltip - + energy + 10 + return + void + sleep + 0 tooltip Set the sit location for this object. If offset == ZERO_VECTOR, clears the sit target. llSleep - energy - 0 - sleep - 0.0 - return - void arguments Time + tooltip + type float - tooltip - + energy + 0 + return + void + sleep + 0 tooltip Put script to sleep for Time seconds. llSound - deprecated - true - energy - 10.0 - sleep - 0.0 - return - void arguments Sound + tooltip + type string - tooltip - Volume + tooltip + type float - tooltip - Queue + tooltip + type integer - tooltip - Loop + tooltip + type integer - tooltip - + deprecated + 1 + energy + 10 + return + void + sleep + 0 tooltip Deprecated: Use llPlaySound instead.\nPlays Sound at Volume and specifies whether the sound should loop and/or be enqueued. llSoundPreload - deprecated - true - energy - 10.0 - sleep - 0.0 - return - void arguments Sound + tooltip + type string - tooltip - + deprecated + 1 + energy + 10 + return + void + sleep + 0 tooltip Deprecated: Use llPreloadSound instead.\nPreloads a sound on viewers within range. llSqrt - energy - 10.0 - sleep - 0.0 - return - float arguments Value + tooltip + type float - tooltip - + energy + 10 + return + float + sleep + 0 tooltip Returns the square root of Value.\nTriggers a math runtime error for imaginary results (if Value < 0.0). llStartAnimation + arguments + + + Animation + + tooltip + + type + string + + + energy - 10.0 - sleep - 0.0 + 10 return void + sleep + 0 + tooltip + This function plays the specified animation from playing on the avatar who received the script's most recent permissions request.\nAnimation may be an animation in task inventory or a built-in animation.\nRequires PERMISSION_TRIGGER_ANIMATION. + + llStartObjectAnimation + arguments Animation + tooltip + type string - tooltip - + energy + 10 + return + void + sleep + 0 tooltip - This function plays the specified animation from playing on the avatar who received the script's most recent permissions request.\nAnimation may be an animation in task inventory or a built-in animation.\nRequires PERMISSION_TRIGGER_ANIMATION. + This function plays the specified animation on the rigged mesh object associated with the current script.\nAnimation may be an animation in task inventory or a built-in animation.\n llStopAnimation - energy - 10.0 - sleep - 0.0 - return - void arguments Animation + tooltip + type string - tooltip - + energy + 10 + return + void + sleep + 0 tooltip - This function stops the specified animation on the avatar who received the script's most recent permissions request.\nAnimation may be an animation in task inventory, a built-in animation, or the uuid of an animation.\nRequires PERMISSION_TRIGGER_ANIMATION. + This function stops the specified animation on the avatar who received the script's most recent permissions request.\nAnimation may be an animation in task inventory, a built-in animation, or the uuid of an animation.\nRequires PERMISSION_TRIGGER_ANIMATION. llStopHover + arguments + energy - 10.0 - sleep - 0.0 + 10 return void - arguments - + sleep + 0 tooltip Stop hovering to a height (due to llSetHoverHeight()). llStopLookAt + arguments + energy - 10.0 - sleep - 0.0 + 10 return void - arguments - + sleep + 0 tooltip Stop causing object to point at a target (due to llLookAt() or llRotLookAt()). llStopMoveToTarget + arguments + energy - 10.0 - sleep - 0.0 + 10 return void - arguments - + sleep + 0 tooltip Stops critically damped motion (due to llMoveToTarget()). - llStopSound + llStopObjectAnimation + arguments + + + Animation + + tooltip + + type + string + + + energy - 10.0 - sleep - 0.0 + 10 return void + sleep + 0 + tooltip + This function stops the specified animation on the rigged mesh object associated with the current script.\nAnimation may be an animation in task inventory, a built-in animation, or the uuid of an animation.\n + + llStopSound + arguments - + + energy + 10 + return + void + sleep + 0 tooltip Stops playback of the currently attached sound. llStringLength - energy - 10.0 - sleep - 0.0 - return - integer arguments Text + tooltip + type string - tooltip - + energy + 10 + return + integer + sleep + 0 tooltip Returns an integer that is the number of characters in Text (not counting the null). llStringToBase64 - energy - 10.0 - sleep - 0.0 - return - string arguments Text + tooltip + type string - tooltip - + energy + 10 + return + string + sleep + 0 tooltip Returns the string Base64 representation of the input string. llStringTrim - energy - 10.0 - sleep - 0.0 - return - string arguments Text - type - string tooltip String to trim + type + string TrimType - type - integer tooltip STRING_TRIM_HEAD, STRING_TRIM_TAIL, or STRING_TRIM. + type + integer + energy + 10 + return + string + sleep + 0 tooltip Outputs a string, eliminating white-space from the start and/or end of the input string Text.\nValid options for TrimType:\nSTRING_TRIM_HEAD: trim all leading spaces in Text\nSTRING_TRIM_TAIL: trim all trailing spaces in Text\nSTRING_TRIM: trim all leading and trailing spaces in Text. llSubStringIndex - energy - 10.0 - sleep - 0.0 - return - integer arguments Text + tooltip + type string - tooltip - Sequence + tooltip + type string - tooltip - + energy + 10 + return + integer + sleep + 0 tooltip Returns an integer that is the index in Text where string pattern Sequence first appears. Returns -1 if not found. llTakeCamera - deprecated - true - energy - 10.0 - sleep - 0.0 - return - void arguments AvatarID + tooltip + type key - tooltip - + deprecated + 1 + energy + 10 + return + void + sleep + 0 tooltip Deprecated: Use llSetCameraParams instead. llTakeControls - energy - 10.0 - sleep - 0.0 - return - void arguments Controls - type - integer tooltip Bit-field of CONTROL_* flags. + type + integer Accept - type - integer tooltip Boolean, determines whether control events are generated. + type + integer PassOn - type - integer tooltip Boolean, determines whether controls are disabled. + type + integer + energy + 10 + return + void + sleep + 0 tooltip Take controls from the agent the script has permissions for.\nIf (Accept == (Controls & input)), send input to the script. PassOn determines whether Controls also perform their normal functions.\nRequires the PERMISSION_TAKE_CONTROLS permission to run. llTan - energy - 10.0 - sleep - 0.0 - return - float arguments Theta + tooltip + type float - tooltip - + energy + 10 + return + float + sleep + 0 tooltip Returns the tangent of Theta (Theta in radians). llTarget - energy - 10.0 - sleep - 0.0 - return - integer arguments Position + tooltip + type vector - tooltip - Range + tooltip + type float - tooltip - + energy + 10 + return + integer + sleep + 0 tooltip This function is to have the script know when it has reached a position.\nIt registers a Position with a Range that triggers at_target and not_at_target events continuously until unregistered. llTargetOmega - energy - 10.0 - sleep - 0.0 - return - void arguments Axis + tooltip + type vector - tooltip - SpinRate + tooltip + type float - tooltip - Gain + tooltip + type float - tooltip - + energy + 10 + return + void + sleep + 0 tooltip Attempt to spin at SpinRate with strength Gain on Axis.\nA spin rate of 0.0 cancels the spin. This function always works in object-local coordinates. llTargetRemove + arguments + + + Target + + tooltip + + type + integer + + + energy - 10.0 - sleep - 0.0 + 10 return void + sleep + 0 + tooltip + Removes positional target Handle registered with llTarget. + + llTargetedEmail + arguments Target + tooltip + + type + integer + + + + Subject + + tooltip + type - integer + string + + + + Text + tooltip - + + type + string + energy + 10 + return + void + sleep + 20 tooltip - Removes positional target Handle registered with llTarget. + Sends an email with Subject and Message to the owner or creator of an object . llTeleportAgent - energy - 0 - sleep - 0 - return - void arguments AvatarID - type - key tooltip UUID of avatar. + type + key LandmarkName - type - string tooltip Name of landmark (in object contents), or empty string, to use. + type + string Position - type - vector tooltip If no landmark was provided, the position within the current region to teleport the avatar to. + type + vector LookAtPoint - type - vector tooltip The position within the target region that the avatar should be turned to face upon arrival. + type + vector + energy + 10 + return + void + sleep + 0 tooltip - Requests a teleport of avatar to a landmark stored in the object's inventory. If no landmark is provided (an empty string), the avatar is teleported to the location position in the current region. In either case, the avatar is turned to face the position given by look_at in local coordinates.\nRequires the PERMISSION_TELEPORT permission. This function can only teleport the owner of the object. + Requests a teleport of avatar to a landmark stored in the object's inventory. If no landmark is provided (an empty string), the avatar is teleported to the location position in the current region. In either case, the avatar is turned to face the position given by look_at in local coordinates.\nRequires the PERMISSION_TELEPORT permission. This function can only teleport the owner of the object. llTeleportAgentGlobalCoords - energy - 0 - sleep - 0 - return - void arguments AvatarID - type - key tooltip UUID of avatar. + type + key GlobalPosition - type - vector tooltip Global coordinates of the destination region. Can be retrieved by using llRequestSimulatorData(region_name, DATA_SIM_POS). + type + vector RegionPosition - type - vector tooltip The position within the target region to teleport the avatar to, if no landmark was provided. + type + vector LookAtPoint - type - vector tooltip The position within the target region that the avatar should be turned to face upon arrival. + type + vector + energy + 10 + return + void + sleep + 0 tooltip Teleports an agent to the RegionPosition local coordinates within a region which is specified by the GlobalPosition global coordinates. The agent lands facing the position defined by LookAtPoint local coordinates.\nRequires the PERMISSION_TELEPORT permission. This function can only teleport the owner of the object. llTeleportAgentHome - energy - 100.0 - sleep - 5.0 - return - void arguments AvatarID + tooltip + type key - tooltip - + energy + 100 + return + void + sleep + 5 tooltip - Teleport agent over the owner's land to agent's home location. + Teleport agent over the owner's land to agent's home location. llTextBox - energy - 10.0 - sleep - 1.0 - return - void arguments AvatarID + tooltip + type key - tooltip - Text + tooltip + type string - tooltip - Channel + tooltip + type integer - tooltip - + energy + 10 + return + void + sleep + 1 tooltip - Opens a dialog for the specified avatar with message Text, which contains a text box for input. Any text that is entered is said on the specified Channel (as if by the avatar) when the "OK" button is clicked. + Opens a dialog for the specified avatar with message Text, which contains a text box for input. Any text that is entered is said on the specified Channel (as if by the avatar) when the "OK" button is clicked. llToLower - energy - 10.0 - sleep - 0.0 - return - string arguments Text + tooltip + type string - tooltip - + energy + 10 + return + string + sleep + 0 tooltip Returns a string that is Text with all lower-case characters. llToUpper - energy - 10.0 - sleep - 0.0 - return - string arguments Text + tooltip + type string - tooltip - + energy + 10 + return + string + sleep + 0 tooltip Returns a string that is Text with all upper-case characters. llTransferLindenDollars - energy - 10.0 - sleep - 0.0 - return - key arguments AvatarID + tooltip + type key - tooltip - Amount + tooltip + type integer - tooltip - + energy + 10 + return + key + sleep + 0 tooltip Transfer Amount of linden dollars (L$) from script owner to AvatarID. Returns a key to a corresponding transaction_result event for the success of the transfer.\nAttempts to send the amount of money to the specified avatar, and trigger a transaction_result event identified by the returned key. - llTriggerSound + llTransferOwnership + arguments + + + AgentID + + tooltip + An agent in the region. + type + key + + + + Flags + + tooltip + Flags to control type of inventory transfer. + type + integer + + + + Params + + tooltip + Extra parameters to llTransferOwnership. None are defined at this time. + type + list + + + energy - 10.0 - sleep - 0.0 + 10 return - void + integer + sleep + 0 + tooltip + Transfers ownership of an object, or a copy of the object to a new agent. + + llTriggerSound + arguments Sound + tooltip + type string - tooltip - Volume + tooltip + type float - tooltip - + energy + 10 + return + void + sleep + 0 tooltip Plays Sound at Volume (0.0 - 1.0), centered at but not attached to object.\nThere is no limit to the number of triggered sounds which can be generated by an object, and calling llTriggerSound does not affect the attached sounds created by llPlaySound and llLoopSound. This is very useful for things like collision noises, explosions, etc. There is no way to stop or alter the volume of a sound triggered by this function. llTriggerSoundLimited - energy - 10.0 - sleep - 0.0 - return - void arguments Sound + tooltip + type string - tooltip - Volume + tooltip + type float - tooltip - TNE + tooltip + type vector - tooltip - BSW + tooltip + type vector - tooltip - + energy + 10 + return + void + sleep + 0 tooltip Plays Sound at Volume (0.0 - 1.0), centered at but not attached to object, limited to axis-aligned bounding box defined by vectors top-north-east (TNE) and bottom-south-west (BSW).\nThere is no limit to the number of triggered sounds which can be generated by an object, and calling llTriggerSound does not affect the attached sounds created by llPlaySound and llLoopSound. This is very useful for things like collision noises, explosions, etc. There is no way to stop or alter the volume of a sound triggered by this function. - llUnescapeURL + llUnSit - energy - 10.0 - sleep - 0.0 - return - string arguments - URL + AvatarID - type - string tooltip - + + type + key - tooltip - Returns the string that is the URL unescaped, replacing "%20" with spaces, etc., version of URL.\nThis function can output raw UTF-8 strings. - - llUnSit - energy - 10.0 - sleep - 0.0 + 10 return void + sleep + 0 + tooltip + If agent identified by AvatarID is sitting on the object the script is attached to or is over land owned by the objects owner, the agent is forced to stand up. + + llUnescapeURL + arguments - AvatarID + URL - type - key tooltip - + + type + string + energy + 10 + return + string + sleep + 0 tooltip - If agent identified by AvatarID is sitting on the object the script is attached to or is over land owned by the objects owner, the agent is forced to stand up. + Returns the string that is the URL unescaped, replacing "%20" with spaces, etc., version of URL.\nThis function can output raw UTF-8 strings. llUpdateCharacter + arguments + + + Options + + tooltip + Character configuration options. Takes the same constants as llCreateCharacter(). + type + list + + + energy - 10.0 - sleep - 0.0 + 10 return void + sleep + 0 + tooltip + Updates settings for a pathfinding character. + + llUpdateKeyValue + arguments - Options + Key + + tooltip + + type + string + + + + Value + + tooltip + + type + string + + + + Checked + tooltip + type - list + integer + + + + OriginalValue + tooltip - Character configuration options. Takes the same constants as llCreateCharacter(). + + type + string - tooltip - Updates settings for a pathfinding character. - - llUpdateKeyValue - energy - 10.0 - sleep - 0.0 + 10 return key - arguments - - - Key - - type - string - tooltip - - - - - Value - - type - string - tooltip - - - - - Checked - - type - integer - tooltip - - - - - OriginalValue - - type - string - tooltip - - - - + sleep + 0 tooltip Starts an asychronous transaction to update the value associated with the key given. The dataserver callback will be executed with the key returned from this call and a string describing the result. The result is a two element commma-delimited list. The first item is an integer specifying if the transaction succeeded (1) or not (0). In the failure case, the second item will be an integer corresponding to one of the XP_ERROR_... constants. In the success case the second item will be the value associated with the key. If Checked is 1 the existing value in the data store must match the OriginalValue passed or XP_ERROR_RETRY_UPDATE will be returned. If Checked is 0 the key will be created if necessary. @@ -18810,349 +23974,419 @@ llVecDist - energy - 10.0 - sleep - 0.0 - return - float arguments Location1 + tooltip + type vector - tooltip - Location2 + tooltip + type vector - tooltip - + energy + 10 + return + float + sleep + 0 tooltip Returns the distance between Location1 and Location2. llVecMag - energy - 10.0 - sleep - 0.0 - return - float arguments Vector + tooltip + type vector - tooltip - + energy + 10 + return + float + sleep + 0 tooltip Returns the magnitude of the vector. llVecNorm - energy - 10.0 - sleep - 0.0 - return - vector arguments Vector + tooltip + type vector - tooltip - + energy + 10 + return + vector + sleep + 0 tooltip Returns normalized vector. - llVolumeDetect + llVerifyRSA + arguments + + + PublicKey + + tooltip + The PEM-formatted public key for signature verifiation. + type + string + + + + Message + + tooltip + The message that was signed. + type + string + + + + Signature + + tooltip + The base64-formatted signature of the message. + type + string + + + + Algorithm + + tooltip + The digest algorithm: sha1, sha224, sha256, sha384, sha512. + type + string + + + energy - 10.0 - sleep - 0.0 + 10 return - void + integer + sleep + 0 + tooltip + Returns TRUE if PublicKey, Message, and Algorithm produce the same base64-formatted Signature. + + llVolumeDetect + arguments DetectEnabled - type - integer tooltip TRUE enables, FALSE disables. + type + integer + energy + 10 + return + void + sleep + 0 tooltip If DetectEnabled = TRUE, object becomes phantom but triggers collision_start and collision_end events when other objects start and stop interpenetrating.\nIf another object (including avatars) interpenetrates it, it will get a collision_start event.\nWhen an object stops interpenetrating, a collision_end event is generated. While the other is inter-penetrating, collision events are NOT generated. llWanderWithin - energy - 10.0 - sleep - 0.0 - return - void arguments Origin - type - vector tooltip Central point to wander about. + type + vector Area - type - vector tooltip Half-extents of an area the character may wander within. (i.e., it can wander from the specified origin by up to +/-Distance.x in x, +/-Distance.y in y, etc.) + type + vector Options - type - list tooltip No options available at this time. + type + list + energy + 10 + return + void + sleep + 0 tooltip Wander within a specified volume.\nSets a character to wander about a central spot within a specified area. llWater - energy - 10.0 - sleep - 0.0 - return - float arguments Offset + tooltip + type vector - tooltip - + energy + 10 + return + float + sleep + 0 tooltip Returns the water height below the object position + Offset. llWhisper - energy - 10.0 - sleep - 0.0 - return - void arguments Channel + tooltip + type integer - tooltip - Text + tooltip + type string - tooltip - + energy + 10 + return + void + sleep + 0 tooltip Whispers Text on Channel.\nThis chat method has a range of 10m radius.\nPUBLIC_CHANNEL is the public chat channel that all avatars see as chat text. DEBUG_CHANNEL is the script debug channel, and is also visible to nearby avatars. All other channels are are not sent to avatars, but may be used to communicate with scripts. llWind - energy - 10.0 - sleep - 0.0 - return - vector arguments Offset + tooltip + type vector - tooltip - + energy + 10 + return + vector + sleep + 0 tooltip Returns the wind velocity at the object position + Offset. - llXorBase64 + llWorldPosToHUD + arguments + + + world_pos + + tooltip + The world-frame position to project into HUD space + type + vector + + + energy - 10.0 - sleep - 0.0 + 10 return - string + vector + sleep + 0 + tooltip + Returns the local position that would put the origin of a HUD object directly over world_pos as viewed by the current camera. + + llXorBase64 + arguments Text1 + tooltip + type string - tooltip - Text2 + tooltip + type string - tooltip - + energy + 10 + return + string + sleep + 0 tooltip Performs an exclusive OR on two Base64 strings and returns a Base64 string. Text2 repeats if it is shorter than Text1. llXorBase64Strings - deprecated - true - energy - 10.0 - sleep - 0.3 - return - string arguments Text1 + tooltip + type string - tooltip - Text2 + tooltip + type string - tooltip - + deprecated + 1 + energy + 10 + return + string + sleep + 0.2999999999999999888977698 tooltip Deprecated: Please use llXorBase64 instead.\nIncorrectly performs an exclusive OR on two Base64 strings and returns a Base64 string. Text2 repeats if it is shorter than Text1.\nRetained for backwards compatibility. llXorBase64StringsCorrect - deprecated - true - energy - 10.0 - sleep - 0.0 - return - string arguments Text1 + tooltip + type string - tooltip - Text2 + tooltip + type string - tooltip - - tooltip - Deprecated: Please use llXorBase64 instead.\nCorrectly (unless nulls are present) performs an exclusive OR on two Base64 strings and returns a Base64 string.\nText2 repeats if it is shorter than Text1. - - llGetMinScaleFactor - + deprecated + 1 energy - 10.0 - sleep - 0.0 + 10 return - float - arguments - + string + sleep + 0 tooltip - Returns the smallest multiplicative uniform scale factor that can be successfully applied (via llScaleByFactor()) to the object without violating prim size or linkability rules. + Deprecated: Please use llXorBase64 instead.\nCorrectly (unless nulls are present) performs an exclusive OR on two Base64 strings and returns a Base64 string.\nText2 repeats if it is shorter than Text1. - llGetMaxScaleFactor + llsRGB2Linear + arguments + + + srgb + + tooltip + A color in the sRGB colorspace. + type + vector + + + energy - 10.0 - sleep - 0.0 + 10 return - float - arguments - + vector + sleep + 0 tooltip - Returns the largest multiplicative uniform scale factor that can be successfully applied (via llScaleByFactor()) to the object without violating prim size or linkability rules. + Converts a color from the sRGB to the linear colorspace. llsd-lsl-syntax-version diff --git a/indra/newview/app_settings/keywords_lua_default.xml b/indra/newview/app_settings/keywords_lua_default.xml new file mode 100644 index 00000000000..97e5a1d3558 --- /dev/null +++ b/indra/newview/app_settings/keywords_lua_default.xml @@ -0,0 +1,29294 @@ + + + + controls + + do + + tooltip + Lua do block: do ... end + + if + + tooltip + Lua if statement: if condition then ... end + + then + + tooltip + Lua then keyword: introduces the block executed when an if condition is true. + + else + + tooltip + Lua else keyword: specifies the alternative block in an if/else statement. + + elseif + + tooltip + Lua elseif keyword: provides an additional conditional branch in an if statement. + + end + + tooltip + Lua end keyword: closes control structures like if, do, while, for, and function. + + for + + tooltip + Lua for loop: for var = start, end, step do ... end + + goto + + tooltip + Lua goto statement: jumps to a specified label. + + return + + tooltip + Lua return statement: returns a value from a function. + + while + + tooltip + Lua while loop: while condition do ... end + + repeat + + tooltip + Lua repeat loop: repeat ... until condition + + until + + tooltip + Lua until keyword: ends a repeat loop by testing a condition. + + function + + tooltip + Lua function keyword: begins a function definition. + + break + + tooltip + Lua break statement: exits the nearest loop. + + local + + tooltip + Lua local keyword: declares a local variable or function. + + in + + tooltip + Lua in keyword: used in generic for loops to iterate over elements. + + not + + tooltip + Lua not operator: performs logical negation. + + and + + tooltip + Lua and operator: performs logical conjunction. + + or + + tooltip + Lua or operator: performs logical disjunction. + + + types + + boolean + + tooltip + Boolean: represents a true or false value. + + number + + tooltip + Double‑precision floating point number. + + string + + tooltip + Text data (UTF‑8). + + table + + tooltip + Collection of key‑value pairs. + + thread + + tooltip + Represents a coroutine. + + userdata + + tooltip + Opaque external data. + + vector + + tooltip + A vector is a data type that contains a set of three float values.\nVectors are used to represent colors (RGB), positions, and directions/velocities. + + uuid + + tooltip + A 128‑bit unique identifier formatted as 36 hexadecimal characters (8‑4‑4‑4‑12), e.g. "A822FF2B-FF02-461D-B45D-DCD10A2DE0C2". + + + constants + + + nil + + tooltip + Lua nil: represents the absence of a useful value. + + true + + tooltip + Lua true: Boolean true value. + + false + + tooltip + Lua false: Boolean false value. + + + ACTIVE + + tooltip + Objects in world that are running a script or currently physically moving. + type + integer + value + 0x2 + + AGENT + + tooltip + Objects in world that are agents. + type + integer + value + 0x1 + + AGENT_ALWAYS_RUN + + tooltip + + type + integer + value + 0x1000 + + AGENT_ATTACHMENTS + + tooltip + The agent has attachments. + type + integer + value + 0x2 + + AGENT_AUTOMATED + + tooltip + The agent has been identified as a scripted agent + type + integer + value + 0x4000 + + AGENT_AUTOPILOT + + tooltip + + type + integer + value + 0x2000 + + AGENT_AWAY + + tooltip + + type + integer + value + 0x40 + + AGENT_BUSY + + tooltip + + type + integer + value + 0x800 + + AGENT_BY_LEGACY_NAME + + tooltip + + type + integer + value + 0x1 + + AGENT_BY_USERNAME + + tooltip + + type + integer + value + 0x10 + + AGENT_CROUCHING + + tooltip + + type + integer + value + 0x400 + + AGENT_FLOATING_VIA_SCRIPTED_ATTACHMENT + + tooltip + The agent is floating via scripted attachment. + type + integer + value + 0x8000 + + AGENT_FLYING + + tooltip + The agent is flying. + type + integer + value + 0x1 + + AGENT_IN_AIR + + tooltip + + type + integer + value + 0x100 + + AGENT_LIST_PARCEL + + tooltip + Agents on the same parcel where the script is running. + type + integer + value + 1 + + AGENT_LIST_PARCEL_OWNER + + tooltip + Agents on any parcel in the region where the parcel owner is the same as the owner of the parcel under the scripted object. + type + integer + value + 2 + + AGENT_LIST_REGION + + tooltip + All agents in the region. + type + integer + value + 4 + + AGENT_MOUSELOOK + + tooltip + + type + integer + value + 0x8 + + AGENT_ON_OBJECT + + tooltip + + type + integer + value + 0x20 + + AGENT_SCRIPTED + + tooltip + The agent has scripted attachments. + type + integer + value + 0x4 + + AGENT_SITTING + + tooltip + + type + integer + value + 0x10 + + AGENT_TYPING + + tooltip + + type + integer + value + 0x200 + + AGENT_WALKING + + tooltip + + type + integer + value + 0x80 + + ALL_SIDES + + tooltip + + type + integer + value + -1 + + ANIM_ON + + tooltip + Texture animation is on. + type + integer + value + 0x1 + + ATTACH_ANY_HUD + + tooltip + Filtering for any HUD attachment. + type + integer + value + -1 + + ATTACH_AVATAR_CENTER + + tooltip + Attach to the avatar's geometric centre. + type + integer + value + 40 + + ATTACH_BACK + + tooltip + Attach to the avatar's back. + type + integer + value + 9 + + ATTACH_BELLY + + tooltip + Attach to the avatar's belly. + type + integer + value + 28 + + ATTACH_CHEST + + tooltip + Attach to the avatar's chest. + type + integer + value + 1 + + ATTACH_CHIN + + tooltip + Attach to the avatar's chin. + type + integer + value + 12 + + ATTACH_FACE_JAW + + tooltip + Attach to the avatar's jaw. + type + integer + value + 47 + + ATTACH_FACE_LEAR + + tooltip + Attach to the avatar's left ear (extended). + type + integer + value + 48 + + ATTACH_FACE_LEYE + + tooltip + Attach to the avatar's left eye (extended). + type + integer + value + 50 + + ATTACH_FACE_REAR + + tooltip + Attach to the avatar's right ear (extended). + type + integer + value + 49 + + ATTACH_FACE_REYE + + tooltip + Attach to the avatar's right eye (extended). + type + integer + value + 51 + + ATTACH_FACE_TONGUE + + tooltip + Attach to the avatar's tongue. + type + integer + value + 52 + + ATTACH_GROIN + + tooltip + Attach to the avatar's groin. + type + integer + value + 53 + + ATTACH_HEAD + + tooltip + Attach to the avatar's head. + type + integer + value + 2 + + ATTACH_HIND_LFOOT + + tooltip + Attach to the avatar's left hind foot. + type + integer + value + 54 + + ATTACH_HIND_RFOOT + + tooltip + Attach to the avatar's right hind foot. + type + integer + value + 55 + + ATTACH_HUD_BOTTOM + + tooltip + + type + integer + value + 37 + + ATTACH_HUD_BOTTOM_LEFT + + tooltip + + type + integer + value + 36 + + ATTACH_HUD_BOTTOM_RIGHT + + tooltip + + type + integer + value + 38 + + ATTACH_HUD_CENTER_1 + + tooltip + + type + integer + value + 35 + + ATTACH_HUD_CENTER_2 + + tooltip + + type + integer + value + 31 + + ATTACH_HUD_TOP_CENTER + + tooltip + + type + integer + value + 33 + + ATTACH_HUD_TOP_LEFT + + tooltip + + type + integer + value + 34 + + ATTACH_HUD_TOP_RIGHT + + tooltip + + type + integer + value + 32 + + ATTACH_LEAR + + tooltip + Attach to the avatar's left ear. + type + integer + value + 13 + + ATTACH_LEFT_PEC + + tooltip + Attach to the avatar's left pectoral. + type + integer + value + 29 + + ATTACH_LEYE + + tooltip + Attach to the avatar's left eye. + type + integer + value + 15 + + ATTACH_LFOOT + + tooltip + Attach to the avatar's left foot. + type + integer + value + 7 + + ATTACH_LHAND + + tooltip + Attach to the avatar's left hand. + type + integer + value + 5 + + ATTACH_LHAND_RING1 + + tooltip + Attach to the avatar's left ring finger. + type + integer + value + 41 + + ATTACH_LHIP + + tooltip + Attach to the avatar's left hip. + type + integer + value + 25 + + ATTACH_LLARM + + tooltip + Attach to the avatar's left lower arm. + type + integer + value + 21 + + ATTACH_LLLEG + + tooltip + Attach to the avatar's lower left leg. + type + integer + value + 27 + + ATTACH_LPEC + + deprecated + 1 + tooltip + Attach to the avatar's right pectoral. (Deprecated, use ATTACH_RIGHT_PEC) + type + integer + value + 30 + + ATTACH_LSHOULDER + + tooltip + Attach to the avatar's left shoulder. + type + integer + value + 3 + + ATTACH_LUARM + + tooltip + Attach to the avatar's left upper arm. + type + integer + value + 20 + + ATTACH_LULEG + + tooltip + Attach to the avatar's lower upper leg. + type + integer + value + 26 + + ATTACH_LWING + + tooltip + Attach to the avatar's left wing. + type + integer + value + 45 + + ATTACH_MOUTH + + tooltip + Attach to the avatar's mouth. + type + integer + value + 11 + + ATTACH_NECK + + tooltip + Attach to the avatar's neck. + type + integer + value + 39 + + ATTACH_NOSE + + tooltip + Attach to the avatar's nose. + type + integer + value + 17 + + ATTACH_PELVIS + + tooltip + Attach to the avatar's pelvis. + type + integer + value + 10 + + ATTACH_REAR + + tooltip + Attach to the avatar's right ear. + type + integer + value + 14 + + ATTACH_REYE + + tooltip + Attach to the avatar's right eye. + type + integer + value + 16 + + ATTACH_RFOOT + + tooltip + Attach to the avatar's right foot. + type + integer + value + 8 + + ATTACH_RHAND + + tooltip + Attach to the avatar's right hand. + type + integer + value + 6 + + ATTACH_RHAND_RING1 + + tooltip + Attach to the avatar's right ring finger. + type + integer + value + 42 + + ATTACH_RHIP + + tooltip + Attach to the avatar's right hip. + type + integer + value + 22 + + ATTACH_RIGHT_PEC + + tooltip + Attach to the avatar's right pectoral. + type + integer + value + 30 + + ATTACH_RLARM + + tooltip + Attach to the avatar's right lower arm. + type + integer + value + 19 + + ATTACH_RLLEG + + tooltip + Attach to the avatar's right lower leg. + type + integer + value + 24 + + ATTACH_RPEC + + deprecated + 1 + tooltip + Attach to the avatar's left pectoral. (deprecated, use ATTACH_LEFT_PEC) + type + integer + value + 29 + + ATTACH_RSHOULDER + + tooltip + Attach to the avatar's right shoulder. + type + integer + value + 4 + + ATTACH_RUARM + + tooltip + Attach to the avatar's right upper arm. + type + integer + value + 18 + + ATTACH_RULEG + + tooltip + Attach to the avatar's right upper leg. + type + integer + value + 23 + + ATTACH_RWING + + tooltip + Attach to the avatar's right wing. + type + integer + value + 46 + + ATTACH_TAIL_BASE + + tooltip + Attach to the avatar's tail base. + type + integer + value + 43 + + ATTACH_TAIL_TIP + + tooltip + Attach to the avatar's tail tip. + type + integer + value + 44 + + AVOID_CHARACTERS + + tooltip + + type + integer + value + 1 + + AVOID_DYNAMIC_OBSTACLES + + tooltip + + type + integer + value + 2 + + AVOID_NONE + + tooltip + + type + integer + value + 0 + + BEACON_MAP + + tooltip + Cause llMapBeacon to optionally display and focus the world map on the avatar's viewer. + type + integer + value + 1 + + CAMERA_ACTIVE + + tooltip + + type + integer + value + 12 + + CAMERA_BEHINDNESS_ANGLE + + tooltip + + type + integer + value + 8 + + CAMERA_BEHINDNESS_LAG + + tooltip + + type + integer + value + 9 + + CAMERA_DISTANCE + + tooltip + + type + integer + value + 7 + + CAMERA_FOCUS + + tooltip + + type + integer + value + 17 + + CAMERA_FOCUS_LAG + + tooltip + + type + integer + value + 6 + + CAMERA_FOCUS_LOCKED + + tooltip + + type + integer + value + 22 + + CAMERA_FOCUS_OFFSET + + tooltip + + type + integer + value + 1 + + CAMERA_FOCUS_THRESHOLD + + tooltip + + type + integer + value + 11 + + CAMERA_PITCH + + tooltip + + type + integer + value + 0 + + CAMERA_POSITION + + tooltip + + type + integer + value + 13 + + CAMERA_POSITION_LAG + + tooltip + + type + integer + value + 5 + + CAMERA_POSITION_LOCKED + + tooltip + + type + integer + value + 21 + + CAMERA_POSITION_THRESHOLD + + tooltip + + type + integer + value + 10 + + CHANGED_ALLOWED_DROP + + tooltip + The object inventory has changed because an item was added through the llAllowInventoryDrop interface. + type + integer + value + 0x40 + + CHANGED_COLOR + + tooltip + The object color has changed. + type + integer + value + 0x2 + + CHANGED_INVENTORY + + tooltip + The object inventory has changed. + type + integer + value + 0x1 + + CHANGED_LINK + + tooltip + The object has linked or its links were broken. + type + integer + value + 0x20 + + CHANGED_MEDIA + + tooltip + + type + integer + value + 0x800 + + CHANGED_OWNER + + tooltip + + type + integer + value + 0x80 + + CHANGED_REGION + + tooltip + + type + integer + value + 0x100 + + CHANGED_REGION_START + + tooltip + + type + integer + value + 0x400 + + CHANGED_RENDER_MATERIAL + + tooltip + The render material has changed. + type + integer + value + 0x1000 + + CHANGED_SCALE + + tooltip + The object scale (size) has changed. + type + integer + value + 0x8 + + CHANGED_SHAPE + + tooltip + The object base shape has changed, e.g., a box to a cylinder. + type + integer + value + 0x4 + + CHANGED_TELEPORT + + tooltip + + type + integer + value + 0x200 + + CHANGED_TEXTURE + + tooltip + The texture offset, scale rotation, or simply the object texture has changed. + type + integer + value + 0x10 + + CHARACTER_ACCOUNT_FOR_SKIPPED_FRAMES + + tooltip + If set to false, character will not attempt to catch up on lost time when pathfinding performance is low, potentially providing more reliable movement (albeit while potentially appearing to be more stuttery). Default is true to match pre-existing behavior. + type + integer + value + 14 + + CHARACTER_AVOIDANCE_MODE + + tooltip + Allows you to specify that a character should not try to avoid other characters, should not try to avoid dynamic obstacles (relatively fast moving objects and avatars), or both. + type + integer + value + 5 + + CHARACTER_CMD_JUMP + + tooltip + Makes the character jump. Requires an additional parameter, the height to jump, between 0.1m and 2.0m. This must be provided as the first element of the llExecCharacterCmd option list. + type + integer + value + 0x01 + + CHARACTER_CMD_SMOOTH_STOP + + tooltip + + type + integer + value + 2 + + CHARACTER_CMD_STOP + + tooltip + Stops any current pathfinding operation. + type + integer + value + 0x00 + + CHARACTER_DESIRED_SPEED + + tooltip + Speed of pursuit in meters per second. + type + integer + value + 1 + + CHARACTER_DESIRED_TURN_SPEED + + tooltip + The character's maximum speed while turning about the Z axis. - Note that this is only loosely enforced. + type + integer + value + 12 + + CHARACTER_LENGTH + + tooltip + Set collision capsule length - cannot be less than two times the radius. + type + integer + value + 3 + + CHARACTER_MAX_ACCEL + + tooltip + The character's maximum acceleration rate. + type + integer + value + 8 + + CHARACTER_MAX_DECEL + + tooltip + The character's maximum deceleration rate. + type + integer + value + 9 + + CHARACTER_MAX_SPEED + + tooltip + The character's maximum speed. + type + integer + value + 13 + + CHARACTER_MAX_TURN_RADIUS + + tooltip + The character's turn radius when travelling at CHARACTER_MAX_TURN_SPEED. + type + integer + value + 10 + + CHARACTER_ORIENTATION + + tooltip + Valid options are: VERTICAL, HORIZONTAL. + type + integer + value + 4 + + CHARACTER_RADIUS + + tooltip + Set collision capsule radius. + type + integer + value + 2 + + CHARACTER_STAY_WITHIN_PARCEL + + tooltip + Determines whether a character can leave its starting parcel.\nTakes a boolean parameter. If TRUE, the character cannot voluntarilly leave the parcel, but can return to it. + type + integer + value + 15 + + CHARACTER_TYPE + + tooltip + Specifies which walk-ability coefficient will be used by this character. + type + integer + value + 6 + + CHARACTER_TYPE_A + + tooltip + + type + integer + value + 0 + + CHARACTER_TYPE_B + + tooltip + + type + integer + value + 1 + + CHARACTER_TYPE_C + + tooltip + + type + integer + value + 2 + + CHARACTER_TYPE_D + + tooltip + + type + integer + value + 3 + + CHARACTER_TYPE_NONE + + tooltip + + type + integer + value + 4 + + CLICK_ACTION_BUY + + tooltip + When the prim is clicked, the buy dialog is opened. + type + integer + value + 2 + + CLICK_ACTION_DISABLED + + tooltip + No click action. No touches detected or passed. + type + integer + value + 8 + + CLICK_ACTION_IGNORE + + tooltip + No click action. Object is invisible to the mouse. + type + integer + value + 9 + + CLICK_ACTION_NONE + + tooltip + Performs the default action: when the prim is clicked, touch events are triggered. + type + integer + value + 0 + + CLICK_ACTION_OPEN + + tooltip + When the prim is clicked, the object inventory dialog is opened. + type + integer + value + 4 + + CLICK_ACTION_OPEN_MEDIA + + tooltip + When the prim is touched, the web media dialog is opened. + type + integer + value + 6 + + CLICK_ACTION_PAY + + tooltip + When the prim is clicked, the pay dialog is opened. + type + integer + value + 3 + + CLICK_ACTION_PLAY + + tooltip + When the prim is clicked, html-on-a-prim is enabled? + type + integer + value + 5 + + CLICK_ACTION_SIT + + tooltip + When the prim is clicked, the avatar sits upon it. + type + integer + value + 1 + + CLICK_ACTION_TOUCH + + tooltip + When the prim is clicked, touch events are triggered. + type + integer + value + 0 + + CLICK_ACTION_ZOOM + + tooltip + Zoom in on object when clicked. + type + integer + value + 7 + + COMBAT_CHANNEL + + tooltip + COMBAT_CHANNEL is an integer constant that, when passed to llRegionSay will add the message to the combat log. A script with a chat listen active on COMBAT_CHANNEL may also monitor the combat log. + type + integer + value + 2147483646 + + COMBAT_LOG_ID + + tooltip + + type + string + value + 45e0fcfa-2268-4490-a51c-3e51bdfe80d1 + + CONTENT_TYPE_ATOM + + tooltip + "application/atom+xml" + type + integer + value + 4 + + CONTENT_TYPE_FORM + + tooltip + "application/x-www-form-urlencoded" + type + integer + value + 7 + + CONTENT_TYPE_HTML + + tooltip + "text/html", only valid for embedded browsers on content owned by the person viewing. Falls back to "text/plain" otherwise. + type + integer + value + 1 + + CONTENT_TYPE_JSON + + tooltip + "application/json" + type + integer + value + 5 + + CONTENT_TYPE_LLSD + + tooltip + "application/llsd+xml" + type + integer + value + 6 + + CONTENT_TYPE_RSS + + tooltip + "application/rss+xml" + type + integer + value + 8 + + CONTENT_TYPE_TEXT + + tooltip + "text/plain" + type + integer + value + 0 + + CONTENT_TYPE_XHTML + + tooltip + "application/xhtml+xml" + type + integer + value + 3 + + CONTENT_TYPE_XML + + tooltip + "application/xml" + type + integer + value + 2 + + CONTROL_BACK + + tooltip + Test for the avatar move back control. + type + integer + value + 0x2 + + CONTROL_DOWN + + tooltip + Test for the avatar move down control. + type + integer + value + 0x20 + + CONTROL_FWD + + tooltip + Test for the avatar move forward control. + type + integer + value + 0x1 + + CONTROL_LBUTTON + + tooltip + Test for the avatar left button control. + type + integer + value + 0x10000000 + + CONTROL_LEFT + + tooltip + Test for the avatar move left control. + type + integer + value + 0x4 + + CONTROL_ML_LBUTTON + + tooltip + Test for the avatar left button control while in mouse look. + type + integer + value + 0x40000000 + + CONTROL_RIGHT + + tooltip + Test for the avatar move right control. + type + integer + value + 0x8 + + CONTROL_ROT_LEFT + + tooltip + Test for the avatar rotate left control. + type + integer + value + 0x100 + + CONTROL_ROT_RIGHT + + tooltip + Test for the avatar rotate right control. + type + integer + value + 0x200 + + CONTROL_UP + + tooltip + Test for the avatar move up control. + type + integer + value + 0x10 + + DAMAGEABLE + + tooltip + Objects in world that are able to process damage. + type + integer + value + 0x20 + + DAMAGE_TYPE_ACID + + tooltip + Damage caused by a caustic substance, such as acid + type + integer + value + 1 + + DAMAGE_TYPE_BLUDGEONING + + tooltip + Damage caused by a blunt object, such as a club. + type + integer + value + 2 + + DAMAGE_TYPE_COLD + + tooltip + Damage inflicted by exposure to extreme cold + type + integer + value + 3 + + DAMAGE_TYPE_ELECTRIC + + tooltip + Damage caused by electricity. + type + integer + value + 4 + + DAMAGE_TYPE_EMOTIONAL + + tooltip + + type + integer + value + 14 + + DAMAGE_TYPE_FIRE + + tooltip + Damage inflicted by exposure to heat or flames. + type + integer + value + 5 + + DAMAGE_TYPE_FORCE + + tooltip + Damage inflicted by a great force or impact. + type + integer + value + 6 + + DAMAGE_TYPE_GENERIC + + tooltip + Generic or legacy damage. + type + integer + value + 0 + + DAMAGE_TYPE_IMPACT + + tooltip + System damage generated by imapact with land or a prim. + type + integer + value + -1 + + DAMAGE_TYPE_NECROTIC + + tooltip + Damage caused by a direct assault on life-force + type + integer + value + 7 + + DAMAGE_TYPE_PIERCING + + tooltip + Damage caused by a piercing object such as a bullet, spear, or arrow. + type + integer + value + 8 + + DAMAGE_TYPE_POISON + + tooltip + Damage caused by poison. + type + integer + value + 9 + + DAMAGE_TYPE_PSYCHIC + + tooltip + Damage caused by a direct assault on the mind. + type + integer + value + 10 + + DAMAGE_TYPE_RADIANT + + tooltip + Damage caused by radiation or extreme light. + type + integer + value + 11 + + DAMAGE_TYPE_SLASHING + + tooltip + Damage caused by a slashing object such as a sword or axe. + type + integer + value + 12 + + DAMAGE_TYPE_SONIC + + tooltip + Damage caused by loud noises, like a Crash Worship concert. + type + integer + value + 13 + + DATA_BORN + + tooltip + The date the agent was born, returned in ISO 8601 format of YYYY-MM-DD. + type + integer + value + 3 + + DATA_NAME + + tooltip + The name of the agent. + type + integer + value + 2 + + DATA_ONLINE + + tooltip + TRUE for online, FALSE for offline. + type + integer + value + 1 + + DATA_PAYINFO + + tooltip + + type + integer + value + 8 + + DATA_RATING + + tooltip + + Returns the agent ratings as a comma separated string of six integers. They are: + 1) Positive rated behaviour + 2) Negative rated behaviour + 3) Positive rated appearance + 4) Negative rated appearance + 5) Positive rated building + 6) Negative rated building + + type + integer + value + 4 + + DATA_SIM_POS + + tooltip + + type + integer + value + 5 + + DATA_SIM_RATING + + tooltip + + type + integer + value + 7 + + DATA_SIM_STATUS + + tooltip + + type + integer + value + 6 + + DEBUG_CHANNEL + + tooltip + DEBUG_CHANNEL is an integer constant that, when passed to llSay, llWhisper, or llShout as a channel parameter, will print text to the Script Warning/Error Window. + type + integer + value + 2147483647 + + DEG_TO_RAD + + tooltip + + 0.017453293 - Number of radians per degree. + You can use this to convert degrees to radians by multiplying the degrees by this number. + + type + float + value + 0.017453293 + + DENSITY + + tooltip + Used with llSetPhysicsMaterial to enable the density value. Must be between 1.0 and 22587.0 (in Kg/m^3 -- see if you can figure out what 22587 represents) + type + integer + value + 1 + + DEREZ_DIE + + tooltip + Causes the object to immediately die. + type + integer + value + 0 + + DEREZ_MAKE_TEMP + + tooltip + The object is made temporary and will be cleaned up at some later timer. + type + integer + value + 1 + + ENVIRONMENT_DAYINFO + + tooltip + Day length, offset and progression. + type + integer + value + 200 + + ENV_INVALID_AGENT + + tooltip + Could not find agent with the specified ID + type + integer + value + -4 + + ENV_INVALID_RULE + + tooltip + Attempted to change an unknown property. + type + integer + value + -5 + + ENV_NOT_EXPERIENCE + + tooltip + Attempt to change environments outside an experience. + type + integer + value + -1 + + ENV_NO_ENVIRONMENT + + tooltip + Could not find environmental settings in object inventory. + type + integer + value + -3 + + ENV_NO_EXPERIENCE_LAND + + tooltip + The experience has not been enabled on this land. + type + integer + value + -7 + + ENV_NO_EXPERIENCE_PERMISSION + + tooltip + Agent has not granted permission to change environments. + type + integer + value + -2 + + ENV_NO_PERMISSIONS + + tooltip + Script does not have permission to modify environment. + type + integer + value + -9 + + ENV_THROTTLE + + tooltip + Could not validate values for environment. + type + integer + value + -8 + + ENV_VALIDATION_FAIL + + tooltip + Could not validate values for environment. + type + integer + value + -6 + + EOF + + tooltip + Indicates the last line of a notecard was read. + type + string + value + \\n\\n\\n + + ERR_GENERIC + + tooltip + + type + integer + value + -1 + + ERR_MALFORMED_PARAMS + + tooltip + + type + integer + value + -3 + + ERR_PARCEL_PERMISSIONS + + tooltip + + type + integer + value + -2 + + ERR_RUNTIME_PERMISSIONS + + tooltip + + type + integer + value + -4 + + ERR_THROTTLED + + tooltip + + type + integer + value + -5 + + ESTATE_ACCESS_ALLOWED_AGENT_ADD + + tooltip + Add the agent to this estate's Allowed Residents list. + type + integer + value + 4 + + ESTATE_ACCESS_ALLOWED_AGENT_REMOVE + + tooltip + Remove the agent from this estate's Allowed Residents list. + type + integer + value + 8 + + ESTATE_ACCESS_ALLOWED_GROUP_ADD + + tooltip + Add the group to this estate's Allowed groups list. + type + integer + value + 16 + + ESTATE_ACCESS_ALLOWED_GROUP_REMOVE + + tooltip + Remove the group from this estate's Allowed groups list. + type + integer + value + 32 + + ESTATE_ACCESS_BANNED_AGENT_ADD + + tooltip + Add the agent to this estate's Banned residents list. + type + integer + value + 64 + + ESTATE_ACCESS_BANNED_AGENT_REMOVE + + tooltip + Remove the agent from this estate's Banned residents list. + type + integer + value + 128 + + FALSE + + tooltip + An integer constant for boolean comparisons. Has the value '0'. + type + integer + value + 0 + + FILTER_FLAGS + + tooltip + Flags to control returned attachments. + type + integer + value + 2 + + FILTER_FLAG_HUDS + + tooltip + Include HUDs with matching experience. + type + integer + value + 0x0001 + + FILTER_INCLUDE + + tooltip + Include attachment point. + type + integer + value + 1 + + FORCE_DIRECT_PATH + + tooltip + Makes character navigate in a straight line toward position. May be set to TRUE or FALSE. + type + integer + value + 1 + + FRICTION + + tooltip + Used with llSetPhysicsMaterial to enable the friction value. Must be between 0.0 and 255.0 + type + integer + value + 2 + + GAME_CONTROL_AXIS_LEFTX + + tooltip + + type + integer + value + 0 + + GAME_CONTROL_AXIS_LEFTY + + tooltip + + type + integer + value + 1 + + GAME_CONTROL_AXIS_RIGHTX + + tooltip + + type + integer + value + 2 + + GAME_CONTROL_AXIS_RIGHTY + + tooltip + + type + integer + value + 3 + + GAME_CONTROL_AXIS_TRIGGERLEFT + + tooltip + + type + integer + value + 4 + + GAME_CONTROL_AXIS_TRIGGERRIGHT + + tooltip + + type + integer + value + 5 + + GAME_CONTROL_BUTTON_A + + tooltip + + type + integer + value + 0x1 + + GAME_CONTROL_BUTTON_B + + tooltip + + type + integer + value + 0x2 + + GAME_CONTROL_BUTTON_BACK + + tooltip + + type + integer + value + 0x10 + + GAME_CONTROL_BUTTON_DPAD_DOWN + + tooltip + + type + integer + value + 0x1000 + + GAME_CONTROL_BUTTON_DPAD_LEFT + + tooltip + + type + integer + value + 0x2000 + + GAME_CONTROL_BUTTON_DPAD_RIGHT + + tooltip + + type + integer + value + 0x4000 + + GAME_CONTROL_BUTTON_DPAD_UP + + tooltip + + type + integer + value + 0x800 + + GAME_CONTROL_BUTTON_GUIDE + + tooltip + + type + integer + value + 0x20 + + GAME_CONTROL_BUTTON_LEFTSHOULDER + + tooltip + + type + integer + value + 0x200 + + GAME_CONTROL_BUTTON_LEFTSTICK + + tooltip + + type + integer + value + 0x80 + + GAME_CONTROL_BUTTON_MISC1 + + tooltip + + type + integer + value + 0x8000 + + GAME_CONTROL_BUTTON_PADDLE1 + + tooltip + + type + integer + value + 0x10000 + + GAME_CONTROL_BUTTON_PADDLE2 + + tooltip + + type + integer + value + 0x20000 + + GAME_CONTROL_BUTTON_PADDLE3 + + tooltip + + type + integer + value + 0x40000 + + GAME_CONTROL_BUTTON_PADDLE4 + + tooltip + + type + integer + value + 0x80000 + + GAME_CONTROL_BUTTON_RIGHTSHOULDER + + tooltip + + type + integer + value + 0x400 + + GAME_CONTROL_BUTTON_RIGHTSTICK + + tooltip + + type + integer + value + 0x100 + + GAME_CONTROL_BUTTON_START + + tooltip + + type + integer + value + 0x40 + + GAME_CONTROL_BUTTON_TOUCHPAD + + tooltip + + type + integer + value + 0x100000 + + GAME_CONTROL_BUTTON_X + + tooltip + + type + integer + value + 0x4 + + GAME_CONTROL_BUTTON_Y + + tooltip + + type + integer + value + 0x8 + + GCNP_RADIUS + + tooltip + + type + integer + value + 0 + + GCNP_STATIC + + tooltip + + type + integer + value + 1 + + GRAVITY_MULTIPLIER + + tooltip + Used with llSetPhysicsMaterial to enable the gravity multiplier value. Must be between -1.0 and +28.0 + type + integer + value + 8 + + HORIZONTAL + + tooltip + + type + integer + value + 1 + + HTTP_ACCEPT + + tooltip + + Provide a string value to be included in the HTTP + accepts header value. This replaces the default Second Life HTTP accepts header. + + type + integer + value + 8 + + HTTP_BODY_MAXLENGTH + + tooltip + + type + integer + value + 2 + + HTTP_BODY_TRUNCATED + + tooltip + + type + integer + value + 0 + + HTTP_CUSTOM_HEADER + + tooltip + Add an extra custom HTTP header to the request. The first string is the name of the parameter to change, e.g. "Pragma", and the second string is the value, e.g. "no-cache". Up to 8 custom headers may be configured per request. Note that certain headers, such as the default headers, are blocked for security reasons. + type + integer + value + 5 + + HTTP_EXTENDED_ERROR + + tooltip + Report extended error information through http_response event. + type + integer + value + 9 + + HTTP_METHOD + + tooltip + + type + integer + value + 0 + + HTTP_MIMETYPE + + tooltip + + type + integer + value + 1 + + HTTP_PRAGMA_NO_CACHE + + tooltip + Allows enabling/disbling of the "Pragma: no-cache" header.\nUsage: [HTTP_PRAGMA_NO_CACHE, integer SendHeader]. When SendHeader is TRUE, the "Pragma: no-cache" header is sent by the script. This matches the default behavior. When SendHeader is FALSE, no "Pragma" header is sent by the script. + type + integer + value + 6 + + HTTP_USER_AGENT + + tooltip + + Provide a string value to be included in the HTTP + User-Agent header value. This is appended to the default value. + + type + integer + value + 7 + + HTTP_VERBOSE_THROTTLE + + tooltip + + type + integer + value + 4 + + HTTP_VERIFY_CERT + + tooltip + + type + integer + value + 3 + + IMG_USE_BAKED_AUX1 + + tooltip + + type + string + value + 9742065b-19b5-297c-858a-29711d539043 + + IMG_USE_BAKED_AUX2 + + tooltip + + type + string + value + 03642e83-2bd1-4eb9-34b4-4c47ed586d2d + + IMG_USE_BAKED_AUX3 + + tooltip + + type + string + value + edd51b77-fc10-ce7a-4b3d-011dfc349e4f + + IMG_USE_BAKED_EYES + + tooltip + + type + string + value + 52cc6bb6-2ee5-e632-d3ad-50197b1dcb8a + + IMG_USE_BAKED_HAIR + + tooltip + + type + string + value + 09aac1fb-6bce-0bee-7d44-caac6dbb6c63 + + IMG_USE_BAKED_HEAD + + tooltip + + type + string + value + 5a9f4a74-30f2-821c-b88d-70499d3e7183 + + IMG_USE_BAKED_LEFTARM + + tooltip + + type + string + value + ff62763f-d60a-9855-890b-0c96f8f8cd98 + + IMG_USE_BAKED_LEFTLEG + + tooltip + + type + string + value + 8e915e25-31d1-cc95-ae08-d58a47488251 + + IMG_USE_BAKED_LOWER + + tooltip + + type + string + value + 24daea5f-0539-cfcf-047f-fbc40b2786ba + + IMG_USE_BAKED_SKIRT + + tooltip + + type + string + value + 43529ce8-7faa-ad92-165a-bc4078371687 + + IMG_USE_BAKED_UPPER + + tooltip + + type + string + value + ae2de45c-d252-50b8-5c6e-19f39ce79317 + + INVENTORY_ALL + + tooltip + + type + integer + value + -1 + + INVENTORY_ANIMATION + + tooltip + + type + integer + value + 20 + + INVENTORY_BODYPART + + tooltip + + type + integer + value + 13 + + INVENTORY_CLOTHING + + tooltip + + type + integer + value + 5 + + INVENTORY_GESTURE + + tooltip + + type + integer + value + 21 + + INVENTORY_LANDMARK + + tooltip + + type + integer + value + 3 + + INVENTORY_MATERIAL + + tooltip + + type + integer + value + 57 + + INVENTORY_NONE + + tooltip + + type + integer + value + -1 + + INVENTORY_NOTECARD + + tooltip + + type + integer + value + 7 + + INVENTORY_OBJECT + + tooltip + + type + integer + value + 6 + + INVENTORY_SCRIPT + + tooltip + + type + integer + value + 10 + + INVENTORY_SETTING + + tooltip + + type + integer + value + 56 + + INVENTORY_SOUND + + tooltip + + type + integer + value + 1 + + INVENTORY_TEXTURE + + tooltip + + type + integer + value + 0 + + JSON_APPEND + + tooltip + + type + integer + value + -1 + + JSON_ARRAY + + tooltip + + type + string + value + \\ufdd2 + + JSON_DELETE + + tooltip + + type + string + value + \\ufdd8 + + JSON_FALSE + + tooltip + + type + string + value + \\ufdd7 + + JSON_INVALID + + tooltip + + type + string + value + \\ufdd0 + + JSON_NULL + + tooltip + + type + string + value + \\ufdd5 + + JSON_NUMBER + + tooltip + + type + string + value + \\ufdd3 + + JSON_OBJECT + + tooltip + + type + string + value + \\ufdd1 + + JSON_STRING + + tooltip + + type + string + value + \\ufdd4 + + JSON_TRUE + + tooltip + + type + string + value + \\ufdd6 + + KFM_CMD_PAUSE + + tooltip + For use with KFM_COMMAND. + type + integer + value + 2 + + KFM_CMD_PLAY + + tooltip + For use with KFM_COMMAND. + type + integer + value + 0 + + KFM_CMD_STOP + + tooltip + For use with KFM_COMMAND. + type + integer + value + 1 + + KFM_COMMAND + + tooltip + + type + integer + value + 0 + + KFM_DATA + + tooltip + + type + integer + value + 2 + + KFM_FORWARD + + tooltip + For use with KFM_MODE. + type + integer + value + 0 + + KFM_LOOP + + tooltip + For use with KFM_MODE. + type + integer + value + 1 + + KFM_MODE + + tooltip + + type + integer + value + 1 + + KFM_PING_PONG + + tooltip + For use with KFM_MODE. + type + integer + value + 2 + + KFM_REVERSE + + tooltip + For use with KFM_MODE. + type + integer + value + 3 + + KFM_ROTATION + + tooltip + For use with KFM_DATA. + type + integer + value + 1 + + KFM_TRANSLATION + + tooltip + For use with KFM_DATA. + type + integer + value + 2 + + LAND_LARGE_BRUSH + + tooltip + Use a large brush size.\nNOTE: This value is incorrect, a large brush should be 2. + type + integer + value + 3 + + LAND_LEVEL + + tooltip + Action to level the land. + type + integer + value + 0 + + LAND_LOWER + + tooltip + Action to lower the land. + type + integer + value + 2 + + LAND_MEDIUM_BRUSH + + tooltip + Use a medium brush size.\nNOTE: This value is incorrect, a medium brush should be 1. + type + integer + value + 2 + + LAND_NOISE + + tooltip + + type + integer + value + 4 + + LAND_RAISE + + tooltip + Action to raise the land. + type + integer + value + 1 + + LAND_REVERT + + tooltip + + type + integer + value + 5 + + LAND_SMALL_BRUSH + + tooltip + Use a small brush size.\nNOTE: This value is incorrect, a small brush should be 0. + type + integer + value + 1 + + LAND_SMOOTH + + tooltip + + type + integer + value + 3 + + LINKSETDATA_DELETE + + tooltip + A name:value pair has been removed from the linkset datastore. + type + integer + value + 2 + + LINKSETDATA_EMEMORY + + tooltip + A name:value pair was too large to write to the linkset datastore. + type + integer + value + 1 + + LINKSETDATA_ENOKEY + + tooltip + The key supplied was empty. + type + integer + value + 2 + + LINKSETDATA_EPROTECTED + + tooltip + The name:value pair has been protected from overwrite in the linkset datastore. + type + integer + value + 3 + + LINKSETDATA_MULTIDELETE + + tooltip + A CSV list of names removed from the linkset datastore. + type + integer + value + 3 + + LINKSETDATA_NOTFOUND + + tooltip + The named key was not found in the datastore. + type + integer + value + 4 + + LINKSETDATA_NOUPDATE + + tooltip + The value written to a name in the keystore is the same as the value already there. + type + integer + value + 5 + + LINKSETDATA_OK + + tooltip + The name:value pair was written to the datastore. + type + integer + value + 0 + + LINKSETDATA_RESET + + tooltip + The linkset datastore has been reset. + type + integer + value + 0 + + LINKSETDATA_UPDATE + + tooltip + A name:value pair in the linkset datastore has been changed or created. + type + integer + value + 1 + + LINK_ALL_CHILDREN + + tooltip + This targets every object except the root in the linked set. + type + integer + value + -3 + + LINK_ALL_OTHERS + + tooltip + This targets every object in the linked set except the object with the script. + type + integer + value + -2 + + LINK_ROOT + + tooltip + This targets the root of the linked set. + type + integer + value + 1 + + LINK_SET + + tooltip + This targets every object in the linked set. + type + integer + value + -1 + + LINK_THIS + + tooltip + The link number of the prim containing the script. + type + integer + value + -4 + + LIST_STAT_GEOMETRIC_MEAN + + tooltip + + type + integer + value + 9 + + LIST_STAT_MAX + + tooltip + + type + integer + value + 2 + + LIST_STAT_MEAN + + tooltip + + type + integer + value + 3 + + LIST_STAT_MEDIAN + + tooltip + + type + integer + value + 4 + + LIST_STAT_MIN + + tooltip + + type + integer + value + 1 + + LIST_STAT_NUM_COUNT + + tooltip + + type + integer + value + 8 + + LIST_STAT_RANGE + + tooltip + + type + integer + value + 0 + + LIST_STAT_STD_DEV + + tooltip + + type + integer + value + 5 + + LIST_STAT_SUM + + tooltip + + type + integer + value + 6 + + LIST_STAT_SUM_SQUARES + + tooltip + + type + integer + value + 7 + + LOOP + + tooltip + Loop the texture animation. + type + integer + value + 0x2 + + MASK_BASE + + tooltip + + type + integer + value + 0 + + MASK_COMBINED + + tooltip + Fold permissions for object inventory into results. + type + integer + value + 0x10 + + MASK_EVERYONE + + tooltip + + type + integer + value + 3 + + MASK_GROUP + + tooltip + + type + integer + value + 2 + + MASK_NEXT + + tooltip + + type + integer + value + 4 + + MASK_OWNER + + tooltip + + type + integer + value + 1 + + NAK + + tooltip + Indicates a notecard read was attempted and the notecard was not yet cached on the server. + type + string + value + \\n\\x15\\n + + NULL_KEY + + tooltip + + type + string + value + 00000000-0000-0000-0000-000000000000 + + OBJECT_ACCOUNT_LEVEL + + tooltip + Retrieves the account level of an avatar.\nReturns 0 when the avatar has a basic account,\n 1 when the avatar has a premium account,\n 10 when the avatar has a premium plus account,\n or -1 if the object is not an avatar. + type + integer + value + 41 + + OBJECT_ANIMATED_COUNT + + tooltip + This is a flag used with llGetObjectDetails to get the number of associated animated objects + type + integer + value + 39 + + OBJECT_ANIMATED_SLOTS_AVAILABLE + + tooltip + This is a flag used with llGetObjectDetails to get the number of additional animated object attachments allowed. + type + integer + value + 40 + + OBJECT_ATTACHED_POINT + + tooltip + Gets the attachment point to which the object is attached.\nReturns 0 if the object is not an attachment (or is an avatar, etc). + type + integer + value + 19 + + OBJECT_ATTACHED_SLOTS_AVAILABLE + + tooltip + Returns the number of attachment slots available.\nReturns 0 if the object is not an avatar or none are available. + type + integer + value + 35 + + OBJECT_BODY_SHAPE_TYPE + + tooltip + This is a flag used with llGetObjectDetails to get the body type of the avatar, based on shape data.\nIf no data is available, -1.0 is returned.\nThis is normally between 0 and 1.0, with 0.5 and larger considered 'male' + type + integer + value + 26 + + OBJECT_CHARACTER_TIME + + tooltip + Units in seconds + type + integer + value + 17 + + OBJECT_CLICK_ACTION + + tooltip + This is a flag used with llGetObjectDetails to get the click action.\nThe default is 0 + type + integer + value + 28 + + OBJECT_CREATION_TIME + + tooltip + This is a flag used with llGetObjectDetails to get the time this object was created + type + integer + value + 36 + + OBJECT_CREATOR + + tooltip + Gets the object's creator key. If id is an avatar, a NULL_KEY is returned. + type + integer + value + 8 + + OBJECT_DAMAGE + + tooltip + Gets the damage value assigned to this object. + type + integer + value + 51 + + OBJECT_DAMAGE_TYPE + + tooltip + Gets the damage type, if any, assigned to this object. + type + integer + value + 52 + + OBJECT_DESC + + tooltip + Gets the object's description. If id is an avatar, an empty string is returned. + type + integer + value + 2 + + OBJECT_GROUP + + tooltip + Gets the prims's group key. If id is an avatar, a NULL_KEY is returned. + type + integer + value + 7 + + OBJECT_GROUP_TAG + + tooltip + Gets the agent's current group role tag. If id is an object, an empty is returned. + type + integer + value + 33 + + OBJECT_HEALTH + + tooltip + Gets current health value for the object. + type + integer + value + 50 + + OBJECT_HOVER_HEIGHT + + tooltip + This is a flag used with llGetObjectDetails to get hover height of the avatar\nIf no data is available, 0.0 is returned. + type + integer + value + 25 + + OBJECT_LAST_OWNER_ID + + tooltip + Gets the object's last owner ID. + type + integer + value + 27 + + OBJECT_LINK_NUMBER + + tooltip + Gets the object's link number or 0 if unlinked. + type + integer + value + 46 + + OBJECT_MASS + + tooltip + Get the object's mass + type + integer + value + 43 + + OBJECT_MATERIAL + + tooltip + Get an object's material setting. + type + integer + value + 42 + + OBJECT_NAME + + tooltip + Gets the object's name. + type + integer + value + 1 + + OBJECT_OMEGA + + tooltip + Gets an object's angular velocity. + type + integer + value + 29 + + OBJECT_OWNER + + tooltip + Gets an object's owner's key. If id is group owned, a NULL_KEY is returned. + type + integer + value + 6 + + OBJECT_PATHFINDING_TYPE + + tooltip + Returns the pathfinding setting of any object in the region. It returns an integer matching one of the OPT_* constants. + type + integer + value + 20 + + OBJECT_PERMS + + tooltip + Gets the objects permissions + type + integer + value + 53 + + OBJECT_PERMS_COMBINED + + tooltip + Gets the object's permissions including any inventory. + type + integer + value + 54 + + OBJECT_PHANTOM + + tooltip + Returns boolean, detailing if phantom is enabled or disabled on the object.\nIf id is an avatar or attachment, 0 is returned. + type + integer + value + 22 + + OBJECT_PHYSICS + + tooltip + Returns boolean, detailing if physics is enabled or disabled on the object.\nIf id is an avatar or attachment, 0 is returned. + type + integer + value + 21 + + OBJECT_PHYSICS_COST + + tooltip + + type + integer + value + 16 + + OBJECT_POS + + tooltip + Gets the object's position in region coordinates. + type + integer + value + 3 + + OBJECT_PRIM_COUNT + + tooltip + Gets the prim count of the object. The script and target object must be owned by the same owner + type + integer + value + 30 + + OBJECT_PRIM_EQUIVALENCE + + tooltip + + type + integer + value + 13 + + OBJECT_RENDER_WEIGHT + + tooltip + This is a flag used with llGetObjectDetails to get the Avatar_Rendering_Cost of an avatar, based on values reported by nearby viewers.\nIf no data is available, -1 is returned.\nThe maximum render weight stored by the simulator is 500000. When called against an object, 0 is returned. + type + integer + value + 24 + + OBJECT_RETURN_PARCEL + + tooltip + + type + integer + value + 1 + + OBJECT_RETURN_PARCEL_OWNER + + tooltip + + type + integer + value + 2 + + OBJECT_RETURN_REGION + + tooltip + + type + integer + value + 4 + + OBJECT_REZZER_KEY + + tooltip + + type + integer + value + 32 + + OBJECT_REZ_TIME + + tooltip + Get the time when an object was rezzed. + type + integer + value + 45 + + OBJECT_ROOT + + tooltip + Gets the id of the root prim of the object requested.\nIf id is an avatar, return the id of the root prim of the linkset the avatar is sitting on (or the avatar's own id if the avatar is not sitting on an object within the region). + type + integer + value + 18 + + OBJECT_ROT + + tooltip + Gets the object's rotation. + type + integer + value + 4 + + OBJECT_RUNNING_SCRIPT_COUNT + + tooltip + + type + integer + value + 9 + + OBJECT_SCALE + + tooltip + Gets the object's size. + type + integer + value + 47 + + OBJECT_SCRIPT_MEMORY + + tooltip + + type + integer + value + 11 + + OBJECT_SCRIPT_TIME + + tooltip + + type + integer + value + 12 + + OBJECT_SELECT_COUNT + + tooltip + This is a flag used with llGetObjectDetails to get the number of avatars selecting any part of the object + type + integer + value + 37 + + OBJECT_SERVER_COST + + tooltip + + type + integer + value + 14 + + OBJECT_SIT_COUNT + + tooltip + This is a flag used with llGetObjectDetails to get the number of avatars sitting on the object + type + integer + value + 38 + + OBJECT_STREAMING_COST + + tooltip + + type + integer + value + 15 + + OBJECT_TEMP_ATTACHED + + tooltip + Returns boolean, indicating if object is a temp attachment. + type + integer + value + 34 + + OBJECT_TEMP_ON_REZ + + tooltip + Returns boolean, detailing if temporary is enabled or disabled on the object. + type + integer + value + 23 + + OBJECT_TEXT + + tooltip + Gets an objects hover text. + type + integer + value + 44 + + OBJECT_TEXT_ALPHA + + tooltip + Gets the alpha of an objects hover text. + type + integer + value + 49 + + OBJECT_TEXT_COLOR + + tooltip + Gets the color of an objects hover text. + type + integer + value + 48 + + OBJECT_TOTAL_INVENTORY_COUNT + + tooltip + Gets the total inventory count of the object. The script and target object must be owned by the same owner + type + integer + value + 31 + + OBJECT_TOTAL_SCRIPT_COUNT + + tooltip + + type + integer + value + 10 + + OBJECT_UNKNOWN_DETAIL + + tooltip + + type + integer + value + -1 + + OBJECT_VELOCITY + + tooltip + Gets the object's velocity. + type + integer + value + 5 + + OPT_AVATAR + + tooltip + Returned for avatars. + type + integer + value + 1 + + OPT_CHARACTER + + tooltip + Returned for pathfinding characters. + type + integer + value + 2 + + OPT_EXCLUSION_VOLUME + + tooltip + Returned for exclusion volumes. + type + integer + value + 6 + + OPT_LEGACY_LINKSET + + tooltip + Returned for movable obstacles, movable phantoms, physical, and volumedetect objects. + type + integer + value + 0 + + OPT_MATERIAL_VOLUME + + tooltip + Returned for material volumes. + type + integer + value + 5 + + OPT_OTHER + + tooltip + Returned for attachments, Linden trees, and grass. + type + integer + value + -1 + + OPT_STATIC_OBSTACLE + + tooltip + Returned for static obstacles. + type + integer + value + 4 + + OPT_WALKABLE + + tooltip + Returned for walkable objects. + type + integer + value + 3 + + PARCEL_COUNT_GROUP + + tooltip + + type + integer + value + 2 + + PARCEL_COUNT_OTHER + + tooltip + + type + integer + value + 3 + + PARCEL_COUNT_OWNER + + tooltip + + type + integer + value + 1 + + PARCEL_COUNT_SELECTED + + tooltip + + type + integer + value + 4 + + PARCEL_COUNT_TEMP + + tooltip + + type + integer + value + 5 + + PARCEL_COUNT_TOTAL + + tooltip + + type + integer + value + 0 + + PARCEL_DETAILS_AREA + + tooltip + The parcel's area, in square meters. (5 chars.). + type + integer + value + 4 + + PARCEL_DETAILS_DESC + + tooltip + The description of the parcel. (127 chars). + type + integer + value + 1 + + PARCEL_DETAILS_FLAGS + + tooltip + Flags set on the parcel + type + integer + value + 12 + + PARCEL_DETAILS_GROUP + + tooltip + The parcel group's key. (36 chars.). + type + integer + value + 3 + + PARCEL_DETAILS_ID + + tooltip + The parcel's key. (36 chars.). + type + integer + value + 5 + + PARCEL_DETAILS_LANDING_LOOKAT + + tooltip + Lookat vector set for teleport routing. + type + integer + value + 10 + + PARCEL_DETAILS_LANDING_POINT + + tooltip + The parcel's landing point, if any. + type + integer + value + 9 + + PARCEL_DETAILS_NAME + + tooltip + The name of the parcel. (63 chars.). + type + integer + value + 0 + + PARCEL_DETAILS_OWNER + + tooltip + The parcel owner's key. (36 chars.). + type + integer + value + 2 + + PARCEL_DETAILS_PRIM_CAPACITY + + tooltip + The parcel's prim capacity. + type + integer + value + 7 + + PARCEL_DETAILS_PRIM_USED + + tooltip + The number of prims used on this parcel. + type + integer + value + 8 + + PARCEL_DETAILS_SCRIPT_DANGER + + tooltip + There are restrictions on this parcel that may impact script execution. + type + integer + value + 13 + + PARCEL_DETAILS_SEE_AVATARS + + tooltip + The parcel's avatar visibility setting. (1 char.). + type + integer + value + 6 + + PARCEL_DETAILS_TP_ROUTING + + tooltip + Parcel's teleport routing setting. + type + integer + value + 11 + + PARCEL_FLAG_ALLOW_ALL_OBJECT_ENTRY + + tooltip + + type + integer + value + 0x08000000 + + PARCEL_FLAG_ALLOW_CREATE_GROUP_OBJECTS + + tooltip + + type + integer + value + 0x4000000 + + PARCEL_FLAG_ALLOW_CREATE_OBJECTS + + tooltip + + type + integer + value + 0x40 + + PARCEL_FLAG_ALLOW_DAMAGE + + tooltip + + type + integer + value + 0x20 + + PARCEL_FLAG_ALLOW_FLY + + tooltip + + type + integer + value + 0x1 + + PARCEL_FLAG_ALLOW_GROUP_OBJECT_ENTRY + + tooltip + + type + integer + value + 0x10000000 + + PARCEL_FLAG_ALLOW_GROUP_SCRIPTS + + tooltip + + type + integer + value + 0x2000000 + + PARCEL_FLAG_ALLOW_LANDMARK + + tooltip + + type + integer + value + 0x8 + + PARCEL_FLAG_ALLOW_SCRIPTS + + tooltip + + type + integer + value + 0x2 + + PARCEL_FLAG_ALLOW_TERRAFORM + + tooltip + + type + integer + value + 0x10 + + PARCEL_FLAG_LOCAL_SOUND_ONLY + + tooltip + + type + integer + value + 0x8000 + + PARCEL_FLAG_RESTRICT_PUSHOBJECT + + tooltip + + type + integer + value + 0x200000 + + PARCEL_FLAG_USE_ACCESS_GROUP + + tooltip + + type + integer + value + 0x100 + + PARCEL_FLAG_USE_ACCESS_LIST + + tooltip + + type + integer + value + 0x200 + + PARCEL_FLAG_USE_BAN_LIST + + tooltip + + type + integer + value + 0x400 + + PARCEL_FLAG_USE_LAND_PASS_LIST + + tooltip + + type + integer + value + 0x800 + + PARCEL_MEDIA_COMMAND_AGENT + + tooltip + + type + integer + value + 7 + + PARCEL_MEDIA_COMMAND_AUTO_ALIGN + + tooltip + + type + integer + value + 9 + + PARCEL_MEDIA_COMMAND_DESC + + tooltip + Use this to get or set the parcel media description. + type + integer + value + 12 + + PARCEL_MEDIA_COMMAND_LOOP + + tooltip + + type + integer + value + 3 + + PARCEL_MEDIA_COMMAND_LOOP_SET + + tooltip + Used to get or set the parcel's media looping variable. + type + integer + value + 13 + + PARCEL_MEDIA_COMMAND_PAUSE + + tooltip + + type + integer + value + 1 + + PARCEL_MEDIA_COMMAND_PLAY + + tooltip + + type + integer + value + 2 + + PARCEL_MEDIA_COMMAND_SIZE + + tooltip + Use this to get or set the parcel media pixel resolution. + type + integer + value + 11 + + PARCEL_MEDIA_COMMAND_STOP + + tooltip + + type + integer + value + 0 + + PARCEL_MEDIA_COMMAND_TEXTURE + + tooltip + + type + integer + value + 4 + + PARCEL_MEDIA_COMMAND_TIME + + tooltip + + type + integer + value + 6 + + PARCEL_MEDIA_COMMAND_TYPE + + tooltip + Use this to get or set the parcel media MIME type (e.g. "text/html"). + type + integer + value + 10 + + PARCEL_MEDIA_COMMAND_UNLOAD + + tooltip + + type + integer + value + 8 + + PARCEL_MEDIA_COMMAND_URL + + tooltip + + type + integer + value + 5 + + PASSIVE + + tooltip + Static in-world objects. + type + integer + value + 0x4 + + PASS_ALWAYS + + tooltip + Always pass the event. + type + integer + value + 1 + + PASS_IF_NOT_HANDLED + + tooltip + Pass the event if there is no script handling the event in the prim. + type + integer + value + 0 + + PASS_NEVER + + tooltip + Always pass the event. + type + integer + value + 2 + + PATROL_PAUSE_AT_WAYPOINTS + + tooltip + + type + integer + value + 0 + + PAYMENT_INFO_ON_FILE + + tooltip + + type + integer + value + 1 + + PAYMENT_INFO_USED + + tooltip + + type + integer + value + 2 + + PAY_DEFAULT + + tooltip + + type + integer + value + -2 + + PAY_HIDE + + tooltip + + type + integer + value + -1 + + PERMISSION_ATTACH + + tooltip + If this permission is enabled, the object can successfully call llAttachToAvatar to attach to the given avatar. + type + integer + value + 0x20 + + PERMISSION_CHANGE_JOINTS + + tooltip + (not yet implemented) + type + integer + value + 0x100 + + PERMISSION_CHANGE_LINKS + + tooltip + If this permission is enabled, the object can successfully call llCreateLink, llBreakLink, and llBreakAllLinks to change links to other objects. + type + integer + value + 0x80 + + PERMISSION_CHANGE_PERMISSIONS + + tooltip + (not yet implemented) + type + integer + value + 0x200 + + PERMISSION_CONTROL_CAMERA + + tooltip + + type + integer + value + 0x800 + + PERMISSION_DEBIT + + tooltip + If this permission is enabled, the object can successfully call llGiveMoney or llTransferLindenDollars to debit the owners account. + type + integer + value + 0x2 + + PERMISSION_OVERRIDE_ANIMATIONS + + tooltip + Permission to override default animations. + type + integer + value + 0x8000 + + PERMISSION_RELEASE_OWNERSHIP + + tooltip + (not yet implemented) + type + integer + value + 0x40 + + PERMISSION_REMAP_CONTROLS + + tooltip + (not yet implemented) + type + integer + value + 0x8 + + PERMISSION_RETURN_OBJECTS + + tooltip + + type + integer + value + 65536 + + PERMISSION_SILENT_ESTATE_MANAGEMENT + + tooltip + A script with this permission does not notify the object owner when it modifies estate access rules via llManageEstateAccess. + type + integer + value + 0x4000 + + PERMISSION_TAKE_CONTROLS + + tooltip + If this permission enabled, the object can successfully call the llTakeControls libray call. + type + integer + value + 0x4 + + PERMISSION_TELEPORT + + tooltip + + type + integer + value + 0x1000 + + PERMISSION_TRACK_CAMERA + + tooltip + + type + integer + value + 0x400 + + PERMISSION_TRIGGER_ANIMATION + + tooltip + If this permission is enabled, the object can successfully call llStartAnimation for the avatar that owns this. + type + integer + value + 0x10 + + PERM_ALL + + tooltip + + type + integer + value + 0x7FFFFFFF + + PERM_COPY + + tooltip + + type + integer + value + 0x8000 + + PERM_MODIFY + + tooltip + + type + integer + value + 0x4000 + + PERM_MOVE + + tooltip + + type + integer + value + 0x80000 + + PERM_TRANSFER + + tooltip + + type + integer + value + 0x2000 + + PI + + tooltip + 3.14159265 - The number of radians in a semi-circle. + type + float + value + 3.14159265 + + PING_PONG + + tooltip + Play animation going forwards, then backwards. + type + integer + value + 0x8 + + PI_BY_TWO + + tooltip + 1.57079633 - The number of radians in a quarter circle. + type + float + value + 1.57079633 + + PRIM_ALLOW_UNSIT + + tooltip + Prim parameter for restricting manual standing for seated avatars in an experience.\nIgnored if the avatar was not seated via a call to llSitOnLink. + type + integer + value + 39 + + PRIM_ALPHA_MODE + + tooltip + Prim parameter for materials using integer face, integer alpha_mode, integer alpha_cutoff.\nDefines how the alpha channel of the diffuse texture should be rendered.\nValid options for alpha_mode are PRIM_ALPHA_MODE_BLEND, _NONE, _MASK, and _EMISSIVE.\nalpha_cutoff is used only for PRIM_ALPHA_MODE_MASK. + type + integer + value + 38 + + PRIM_ALPHA_MODE_BLEND + + tooltip + Prim parameter setting for PRIM_ALPHA_MODE.\nIndicates that the diffuse texture's alpha channel should be rendered as alpha-blended. + type + integer + value + 1 + + PRIM_ALPHA_MODE_EMISSIVE + + tooltip + Prim parameter setting for PRIM_ALPHA_MODE.\nIndicates that the diffuse texture's alpha channel should be rendered as an emissivity mask. + type + integer + value + 3 + + PRIM_ALPHA_MODE_MASK + + tooltip + Prim parameter setting for PRIM_ALPHA_MODE.\nIndicates that the diffuse texture's alpha channel should be rendered as fully opaque for alpha values above alpha_cutoff and fully transparent otherwise. + type + integer + value + 2 + + PRIM_ALPHA_MODE_NONE + + tooltip + Prim parameter setting for PRIM_ALPHA_MODE.\nIndicates that the diffuse texture's alpha channel should be ignored. + type + integer + value + 0 + + PRIM_BUMP_BARK + + tooltip + + type + integer + value + 4 + + PRIM_BUMP_BLOBS + + tooltip + + type + integer + value + 12 + + PRIM_BUMP_BRICKS + + tooltip + + type + integer + value + 5 + + PRIM_BUMP_BRIGHT + + tooltip + + type + integer + value + 1 + + PRIM_BUMP_CHECKER + + tooltip + + type + integer + value + 6 + + PRIM_BUMP_CONCRETE + + tooltip + + type + integer + value + 7 + + PRIM_BUMP_DARK + + tooltip + + type + integer + value + 2 + + PRIM_BUMP_DISKS + + tooltip + + type + integer + value + 10 + + PRIM_BUMP_GRAVEL + + tooltip + + type + integer + value + 11 + + PRIM_BUMP_LARGETILE + + tooltip + + type + integer + value + 14 + + PRIM_BUMP_NONE + + tooltip + + type + integer + value + 0 + + PRIM_BUMP_SHINY + + tooltip + + type + integer + value + 19 + + PRIM_BUMP_SIDING + + tooltip + + type + integer + value + 13 + + PRIM_BUMP_STONE + + tooltip + + type + integer + value + 9 + + PRIM_BUMP_STUCCO + + tooltip + + type + integer + value + 15 + + PRIM_BUMP_SUCTION + + tooltip + + type + integer + value + 16 + + PRIM_BUMP_TILE + + tooltip + + type + integer + value + 8 + + PRIM_BUMP_WEAVE + + tooltip + + type + integer + value + 17 + + PRIM_BUMP_WOOD + + tooltip + + type + integer + value + 3 + + PRIM_CAST_SHADOWS + + deprecated + 1 + tooltip + + type + integer + value + 24 + + PRIM_CLICK_ACTION + + tooltip + + type + integer + value + 43 + + PRIM_COLLISION_SOUND + + tooltip + Collision sound uuid and volume for this prim + type + integer + value + 53 + + PRIM_COLOR + + tooltip + + type + integer + value + 18 + + PRIM_DAMAGE + + tooltip + Damage and damage type assigned to this prim. + type + integer + value + 51 + + PRIM_DESC + + tooltip + + type + integer + value + 28 + + PRIM_FLEXIBLE + + tooltip + + type + integer + value + 21 + + PRIM_FULLBRIGHT + + tooltip + + type + integer + value + 20 + + PRIM_GLOW + + tooltip + PRIM_GLOW is used to get or set the glow status of the face. + type + integer + value + 25 + + PRIM_GLTF_ALPHA_MODE_BLEND + + tooltip + Prim parameter setting for PRIM_GLTF_BASE_COLOR alpha mode "BLEND". + type + integer + value + 1 + + PRIM_GLTF_ALPHA_MODE_MASK + + tooltip + Prim parameter setting for PRIM_GLTF_BASE_COLOR alpha mode "MASK". + type + integer + value + 2 + + PRIM_GLTF_ALPHA_MODE_OPAQUE + + tooltip + Prim parameter setting for PRIM_GLTF_BASE_COLOR alpha mode "OPAQUE". + type + integer + value + 0 + + PRIM_GLTF_BASE_COLOR + + tooltip + Prim parameter for materials using integer face, string texture, vector repeats, vector offsets, float rotation_in_radians, vector color, integer alpha_mode, integer alpha_cutoff, boolean double_sided.\nValid options for alpha_mode are PRIM_ALPHA_MODE_BLEND, _NONE, and _MASK.\nalpha_cutoff is used only for PRIM_ALPHA_MODE_MASK. + type + integer + value + 48 + + PRIM_GLTF_EMISSIVE + + tooltip + Prim parameter for GLTF materials using integer face, string texture, vector repeats, vector offsets, float rotation_in_radians, vector color + type + integer + value + 46 + + PRIM_GLTF_METALLIC_ROUGHNESS + + tooltip + Prim parameter for GLTF materials using integer face, string texture, vector repeats, vector offsets, float rotation_in_radians, float metallic_factor, float roughness_factor + type + integer + value + 47 + + PRIM_GLTF_NORMAL + + tooltip + Prim parameter for GLTF materials using integer face, string texture, vector repeats, vector offsets, float rotation_in_radians + type + integer + value + 45 + + PRIM_HEALTH + + tooltip + Health value for this prim + type + integer + value + 52 + + PRIM_HOLE_CIRCLE + + tooltip + + type + integer + value + 0x10 + + PRIM_HOLE_DEFAULT + + tooltip + + type + integer + value + 0x00 + + PRIM_HOLE_SQUARE + + tooltip + + type + integer + value + 0x20 + + PRIM_HOLE_TRIANGLE + + tooltip + + type + integer + value + 0x30 + + PRIM_LINK_TARGET + + tooltip + + type + integer + value + 34 + + PRIM_MATERIAL + + tooltip + + type + integer + value + 2 + + PRIM_MATERIAL_FLESH + + tooltip + + type + integer + value + 4 + + PRIM_MATERIAL_GLASS + + tooltip + + type + integer + value + 2 + + PRIM_MATERIAL_LIGHT + + tooltip + + type + integer + value + 7 + + PRIM_MATERIAL_METAL + + tooltip + + type + integer + value + 1 + + PRIM_MATERIAL_PLASTIC + + tooltip + + type + integer + value + 5 + + PRIM_MATERIAL_RUBBER + + tooltip + + type + integer + value + 6 + + PRIM_MATERIAL_STONE + + tooltip + + type + integer + value + 0 + + PRIM_MATERIAL_WOOD + + tooltip + + type + integer + value + 3 + + PRIM_MEDIA_ALT_IMAGE_ENABLE + + tooltip + Boolean. Gets/Sets the default image state (the image that the user sees before a piece of media is active) for the chosen face. The default image is specified by Second Life's server for that media type. + type + integer + value + 0 + + PRIM_MEDIA_AUTO_LOOP + + tooltip + Boolean. Gets/Sets whether auto-looping is enabled. + type + integer + value + 4 + + PRIM_MEDIA_AUTO_PLAY + + tooltip + Boolean. Gets/Sets whether the media auto-plays when a Resident can view it. + type + integer + value + 5 + + PRIM_MEDIA_AUTO_SCALE + + tooltip + Boolean. Gets/Sets whether auto-scaling is enabled. Auto-scaling forces the media to the full size of the texture. + type + integer + value + 6 + + PRIM_MEDIA_AUTO_ZOOM + + tooltip + Boolean. Gets/Sets whether clicking the media triggers auto-zoom and auto-focus on the media. + type + integer + value + 7 + + PRIM_MEDIA_CONTROLS + + tooltip + Integer. Gets/Sets the style of controls. Can be either PRIM_MEDIA_CONTROLS_STANDARD or PRIM_MEDIA_CONTROLS_MINI. + type + integer + value + 1 + + PRIM_MEDIA_CONTROLS_MINI + + tooltip + Mini web navigation controls; does not include an address bar. + type + integer + value + 1 + + PRIM_MEDIA_CONTROLS_STANDARD + + tooltip + Standard web navigation controls. + type + integer + value + 0 + + PRIM_MEDIA_CURRENT_URL + + tooltip + String. Gets/Sets the current url displayed on the chosen face. Changing this URL causes navigation. 1024 characters Maximum. + type + integer + value + 2 + + PRIM_MEDIA_FIRST_CLICK_INTERACT + + tooltip + Boolean. Gets/Sets whether the first click interaction is enabled. + type + integer + value + 8 + + PRIM_MEDIA_HEIGHT_PIXELS + + tooltip + Integer. Gets/Sets the height of the media in pixels. + type + integer + value + 10 + + PRIM_MEDIA_HOME_URL + + tooltip + String. Gets/Sets the home URL for the chosen face. 1024 characters maximum. + type + integer + value + 3 + + PRIM_MEDIA_MAX_HEIGHT_PIXELS + + tooltip + + type + integer + value + 2048 + + PRIM_MEDIA_MAX_URL_LENGTH + + tooltip + + type + integer + value + 1024 + + PRIM_MEDIA_MAX_WHITELIST_COUNT + + tooltip + + type + integer + value + 64 + + PRIM_MEDIA_MAX_WHITELIST_SIZE + + tooltip + + type + integer + value + 1024 + + PRIM_MEDIA_MAX_WIDTH_PIXELS + + tooltip + + type + integer + value + 2048 + + PRIM_MEDIA_PARAM_MAX + + tooltip + + type + integer + value + 14 + + PRIM_MEDIA_PERMS_CONTROL + + tooltip + Integer. Gets/Sets the permissions mask that control who can see the media control bar above the object:: PRIM_MEDIA_PERM_ANYONE, PRIM_MEDIA_PERM_GROUP, PRIM_MEDIA_PERM_NONE, PRIM_MEDIA_PERM_OWNER + type + integer + value + 14 + + PRIM_MEDIA_PERMS_INTERACT + + tooltip + Integer. Gets/Sets the permissions mask that control who can interact with the object: PRIM_MEDIA_PERM_ANYONE, PRIM_MEDIA_PERM_GROUP, PRIM_MEDIA_PERM_NONE, PRIM_MEDIA_PERM_OWNER + type + integer + value + 13 + + PRIM_MEDIA_PERM_ANYONE + + tooltip + + type + integer + value + 4 + + PRIM_MEDIA_PERM_GROUP + + tooltip + + type + integer + value + 2 + + PRIM_MEDIA_PERM_NONE + + tooltip + + type + integer + value + 0 + + PRIM_MEDIA_PERM_OWNER + + tooltip + + type + integer + value + 1 + + PRIM_MEDIA_WHITELIST + + tooltip + String. Gets/Sets the white-list as a string of escaped, comma-separated URLs. This string can hold up to 64 URLs or 1024 characters, whichever comes first. + type + integer + value + 12 + + PRIM_MEDIA_WHITELIST_ENABLE + + tooltip + Boolean. Gets/Sets whether navigation is restricted to URLs in PRIM_MEDIA_WHITELIST. + type + integer + value + 11 + + PRIM_MEDIA_WIDTH_PIXELS + + tooltip + Integer. Gets/Sets the width of the media in pixels. + type + integer + value + 9 + + PRIM_NAME + + tooltip + + type + integer + value + 27 + + PRIM_NORMAL + + tooltip + Prim parameter for materials using integer face, string texture, vector repeats, vector offsets, float rotation_in_radians + type + integer + value + 37 + + PRIM_OMEGA + + tooltip + + type + integer + value + 32 + + PRIM_PHANTOM + + tooltip + + type + integer + value + 5 + + PRIM_PHYSICS + + tooltip + + type + integer + value + 3 + + PRIM_PHYSICS_SHAPE_CONVEX + + tooltip + Use the convex hull of the prim shape for physics (this is the default for mesh objects). + type + integer + value + 2 + + PRIM_PHYSICS_SHAPE_NONE + + tooltip + Ignore this prim in the physics shape. NB: This cannot be applied to the root prim. + type + integer + value + 1 + + PRIM_PHYSICS_SHAPE_PRIM + + tooltip + Use the normal prim shape for physics (this is the default for all non-mesh objects). + type + integer + value + 0 + + PRIM_PHYSICS_SHAPE_TYPE + + tooltip + + Allows you to set the physics shape type of a prim via lsl. Permitted values are: + PRIM_PHYSICS_SHAPE_NONE, PRIM_PHYSICS_SHAPE_PRIM, PRIM_PHYSICS_SHAPE_CONVEX + + type + integer + value + 30 + + PRIM_POINT_LIGHT + + tooltip + + type + integer + value + 23 + + PRIM_POSITION + + tooltip + + type + integer + value + 6 + + PRIM_POS_LOCAL + + tooltip + + type + integer + value + 33 + + PRIM_PROJECTOR + + tooltip + + type + integer + value + 42 + + PRIM_REFLECTION_PROBE + + tooltip + Allows you to configure the object as a custom-placed reflection probe, for image-based lighting (IBL). Only objects in the influence volume of the reflection probe object are affected. + type + integer + value + 44 + + PRIM_REFLECTION_PROBE_BOX + + tooltip + This is a flag option used with llGetPrimitiveParams and related functions when the parameter is PRIM_REFLECTION_PROBE. When set, the reflection probe is a box. When unset, the reflection probe is a sphere. + type + integer + value + 1 + + PRIM_REFLECTION_PROBE_DYNAMIC + + tooltip + This is a flag option used with llGetPrimitiveParams and related functions when the parameter is PRIM_REFLECTION_PROBE. When set, the reflection probe includes avatars in IBL effects. When unset, the reflection probe excludes avatars. + type + integer + value + 2 + + PRIM_REFLECTION_PROBE_MIRROR + + tooltip + This is a flag option used with llGetPrimitiveParams and related functions when the parameter is PRIM_REFLECTION_PROBE. When set, the reflection probe acts as a mirror. + type + integer + value + 4 + + PRIM_RENDER_MATERIAL + + tooltip + + type + integer + value + 49 + + PRIM_ROTATION + + tooltip + + type + integer + value + 8 + + PRIM_ROT_LOCAL + + tooltip + + type + integer + value + 29 + + PRIM_SCRIPTED_SIT_ONLY + + tooltip + Prim parameter for restricting manual sitting on this prim.\nSitting must be initiated via call to llSitOnLink. + type + integer + value + 40 + + PRIM_SCULPT_FLAG_ANIMESH + + tooltip + Mesh is animated. + type + integer + value + 32 + + PRIM_SCULPT_FLAG_INVERT + + tooltip + Render inside out (inverts the normals). + type + integer + value + 64 + + PRIM_SCULPT_FLAG_MIRROR + + tooltip + Render an X axis mirror of the sculpty. + type + integer + value + 128 + + PRIM_SCULPT_TYPE_CYLINDER + + tooltip + + type + integer + value + 4 + + PRIM_SCULPT_TYPE_MASK + + tooltip + + type + integer + value + 7 + + PRIM_SCULPT_TYPE_MESH + + tooltip + + type + integer + value + 5 + + PRIM_SCULPT_TYPE_PLANE + + tooltip + + type + integer + value + 3 + + PRIM_SCULPT_TYPE_SPHERE + + tooltip + + type + integer + value + 1 + + PRIM_SCULPT_TYPE_TORUS + + tooltip + + type + integer + value + 2 + + PRIM_SHINY_HIGH + + tooltip + + type + integer + value + 3 + + PRIM_SHINY_LOW + + tooltip + + type + integer + value + 1 + + PRIM_SHINY_MEDIUM + + tooltip + + type + integer + value + 2 + + PRIM_SHINY_NONE + + tooltip + + type + integer + value + 0 + + PRIM_SIT_FLAGS + + tooltip + + type + integer + value + 50 + + PRIM_SIT_TARGET + + tooltip + + type + integer + value + 41 + + PRIM_SIZE + + tooltip + + type + integer + value + 7 + + PRIM_SLICE + + tooltip + + type + integer + value + 35 + + PRIM_SPECULAR + + tooltip + Prim parameter for materials using integer face, string texture, vector repeats, vector offsets, float rotation_in_radians, vector color, integer glossy, integer environment + type + integer + value + 36 + + PRIM_TEMP_ON_REZ + + tooltip + + type + integer + value + 4 + + PRIM_TEXGEN + + tooltip + + type + integer + value + 22 + + PRIM_TEXGEN_DEFAULT + + tooltip + + type + integer + value + 0 + + PRIM_TEXGEN_PLANAR + + tooltip + + type + integer + value + 1 + + PRIM_TEXT + + tooltip + + type + integer + value + 26 + + PRIM_TEXTURE + + tooltip + + type + integer + value + 17 + + PRIM_TYPE + + tooltip + + type + integer + value + 9 + + PRIM_TYPE_BOX + + tooltip + + type + integer + value + 0 + + PRIM_TYPE_CYLINDER + + tooltip + + type + integer + value + 1 + + PRIM_TYPE_PRISM + + tooltip + + type + integer + value + 2 + + PRIM_TYPE_RING + + tooltip + + type + integer + value + 6 + + PRIM_TYPE_SCULPT + + tooltip + + type + integer + value + 7 + + PRIM_TYPE_SPHERE + + tooltip + + type + integer + value + 3 + + PRIM_TYPE_TORUS + + tooltip + + type + integer + value + 4 + + PRIM_TYPE_TUBE + + tooltip + + type + integer + value + 5 + + PROFILE_NONE + + tooltip + Disables profiling + type + integer + value + 0 + + PROFILE_SCRIPT_MEMORY + + tooltip + Enables memory profiling + type + integer + value + 1 + + PSYS_PART_BF_DEST_COLOR + + tooltip + + type + integer + value + 2 + + PSYS_PART_BF_ONE + + tooltip + + type + integer + value + 0 + + PSYS_PART_BF_ONE_MINUS_DEST_COLOR + + tooltip + + type + integer + value + 4 + + PSYS_PART_BF_ONE_MINUS_SOURCE_ALPHA + + tooltip + + type + integer + value + 9 + + PSYS_PART_BF_ONE_MINUS_SOURCE_COLOR + + tooltip + + type + integer + value + 5 + + PSYS_PART_BF_SOURCE_ALPHA + + tooltip + + type + integer + value + 7 + + PSYS_PART_BF_SOURCE_COLOR + + tooltip + + type + integer + value + 3 + + PSYS_PART_BF_ZERO + + tooltip + + type + integer + value + 1 + + PSYS_PART_BLEND_FUNC_DEST + + tooltip + + type + integer + value + 25 + + PSYS_PART_BLEND_FUNC_SOURCE + + tooltip + + type + integer + value + 24 + + PSYS_PART_BOUNCE_MASK + + tooltip + Particles bounce off of a plane at the objects Z height. + type + integer + value + 0x4 + + PSYS_PART_EMISSIVE_MASK + + tooltip + The particle glows. + type + integer + value + 0x100 + + PSYS_PART_END_ALPHA + + tooltip + A float which determines the ending alpha of the object. + type + integer + value + 4 + + PSYS_PART_END_COLOR + + tooltip + A vector <r, g, b> which determines the ending color of the object. + type + integer + value + 3 + + PSYS_PART_END_GLOW + + tooltip + + type + integer + value + 27 + + PSYS_PART_END_SCALE + + tooltip + A vector <sx, sy, z>, which is the ending size of the particle billboard in meters (z is ignored). + type + integer + value + 6 + + PSYS_PART_FLAGS + + tooltip + Each particle that is emitted by the particle system is simulated based on the following flags. To use multiple flags, bitwise or (|) them together. + type + integer + value + 0 + + PSYS_PART_FOLLOW_SRC_MASK + + tooltip + The particle position is relative to the source objects position. + type + integer + value + 0x10 + + PSYS_PART_FOLLOW_VELOCITY_MASK + + tooltip + The particle orientation is rotated so the vertical axis faces towards the particle velocity. + type + integer + value + 0x20 + + PSYS_PART_INTERP_COLOR_MASK + + tooltip + Interpolate both the color and alpha from the start value to the end value. + type + integer + value + 0x1 + + PSYS_PART_INTERP_SCALE_MASK + + tooltip + Interpolate the particle scale from the start value to the end value. + type + integer + value + 0x2 + + PSYS_PART_MAX_AGE + + tooltip + Age in seconds of a particle at which it dies. + type + integer + value + 7 + + PSYS_PART_RIBBON_MASK + + tooltip + + type + integer + value + 0x400 + + PSYS_PART_START_ALPHA + + tooltip + A float which determines the starting alpha of the object. + type + integer + value + 2 + + PSYS_PART_START_COLOR + + tooltip + A vector <r.r, g.g, b.b> which determines the starting color of the object. + type + integer + value + 1 + + PSYS_PART_START_GLOW + + tooltip + + type + integer + value + 26 + + PSYS_PART_START_SCALE + + tooltip + A vector <sx, sy, z>, which is the starting size of the particle billboard in meters (z is ignored). + type + integer + value + 5 + + PSYS_PART_TARGET_LINEAR_MASK + + tooltip + + type + integer + value + 0x80 + + PSYS_PART_TARGET_POS_MASK + + tooltip + The particle heads towards the location of the target object as defined by PSYS_SRC_TARGET_KEY. + type + integer + value + 0x40 + + PSYS_PART_WIND_MASK + + tooltip + Particles have their velocity damped towards the wind velocity. + type + integer + value + 0x8 + + PSYS_SRC_ACCEL + + tooltip + A vector <x, y, z> which is the acceleration to apply on particles. + type + integer + value + 8 + + PSYS_SRC_ANGLE_BEGIN + + tooltip + Area in radians specifying where particles will NOT be created (for ANGLE patterns) + type + integer + value + 22 + + PSYS_SRC_ANGLE_END + + tooltip + Area in radians filled with particles (for ANGLE patterns) (if lower than PSYS_SRC_ANGLE_BEGIN, acts as PSYS_SRC_ANGLE_BEGIN itself, and PSYS_SRC_ANGLE_BEGIN acts as PSYS_SRC_ANGLE_END). + type + integer + value + 23 + + PSYS_SRC_BURST_PART_COUNT + + tooltip + How many particles to release in a burst. + type + integer + value + 15 + + PSYS_SRC_BURST_RADIUS + + tooltip + What distance from the center of the object to create the particles. + type + integer + value + 16 + + PSYS_SRC_BURST_RATE + + tooltip + How often to release a particle burst (float seconds). + type + integer + value + 13 + + PSYS_SRC_BURST_SPEED_MAX + + tooltip + Maximum speed that a particle should be moving. + type + integer + value + 18 + + PSYS_SRC_BURST_SPEED_MIN + + tooltip + Minimum speed that a particle should be moving. + type + integer + value + 17 + + PSYS_SRC_INNERANGLE + + tooltip + + Specifies the inner angle of the arc created by the PSYS_SRC_PATTERN_ANGLE or PSYS_SRC_PATTERN_ANGLE_CONE source pattern. + The area specified will NOT have particles in it. + + type + integer + value + 10 + + PSYS_SRC_MAX_AGE + + tooltip + How long this particle system should last, 0.0 means forever. + type + integer + value + 19 + + PSYS_SRC_OMEGA + + tooltip + Sets the angular velocity to rotate the axis that SRC_PATTERN_ANGLE and SRC_PATTERN_ANGLE_CONE use. + type + integer + value + 21 + + PSYS_SRC_OUTERANGLE + + tooltip + + Specifies the outer angle of the arc created by the PSYS_SRC_PATTERN_ANGLE or PSYS_SRC_PATTERN_ANGLE_CONE source pattern. + The area between the outer and inner angle will be filled with particles. + + type + integer + value + 11 + + PSYS_SRC_PATTERN + + tooltip + + The pattern which is used to generate particles. + Use one of the following values: PSYS_SRC_PATTERN Values. + + type + integer + value + 9 + + PSYS_SRC_PATTERN_ANGLE + + tooltip + Shoot particles across a 2 dimensional area defined by the arc created from PSYS_SRC_OUTERANGLE. There will be an open area defined by PSYS_SRC_INNERANGLE within the larger arc. + type + integer + value + 0x04 + + PSYS_SRC_PATTERN_ANGLE_CONE + + tooltip + Shoot particles out in a 3 dimensional cone with an outer arc of PSYS_SRC_OUTERANGLE and an inner open area defined by PSYS_SRC_INNERANGLE. + type + integer + value + 0x08 + + PSYS_SRC_PATTERN_ANGLE_CONE_EMPTY + + tooltip + + type + integer + value + 0x10 + + PSYS_SRC_PATTERN_DROP + + tooltip + Drop particles at the source position. + type + integer + value + 0x01 + + PSYS_SRC_PATTERN_EXPLODE + + tooltip + Shoot particles out in all directions, using the burst parameters. + type + integer + value + 0x02 + + PSYS_SRC_TARGET_KEY + + tooltip + The key of a target object to move towards if PSYS_PART_TARGET_POS_MASK is enabled. + type + integer + value + 20 + + PSYS_SRC_TEXTURE + + tooltip + An asset name for the texture to use for the particles. + type + integer + value + 12 + + PUBLIC_CHANNEL + + tooltip + PUBLIC_CHANNEL is an integer constant that, when passed to llSay, llWhisper, or llShout as a channel parameter, will print text to the publicly heard chat channel. + type + integer + value + 0 + + PURSUIT_FUZZ_FACTOR + + tooltip + Selects a random destination near the offset. + type + integer + value + 3 + + PURSUIT_GOAL_TOLERANCE + + tooltip + + type + integer + value + 5 + + PURSUIT_INTERCEPT + + tooltip + Define whether the character attempts to predict the target's location. + type + integer + value + 4 + + PURSUIT_OFFSET + + tooltip + Go to a position offset from the target. + type + integer + value + 1 + + PU_EVADE_HIDDEN + + tooltip + Triggered when an llEvade character thinks it has hidden from its pursuer. + type + integer + value + 0x07 + + PU_EVADE_SPOTTED + + tooltip + Triggered when an llEvade character switches from hiding to running + type + integer + value + 0x08 + + PU_FAILURE_DYNAMIC_PATHFINDING_DISABLED + + tooltip + + type + integer + value + 10 + + PU_FAILURE_INVALID_GOAL + + tooltip + Goal is not on the navigation-mesh and cannot be reached. + type + integer + value + 0x03 + + PU_FAILURE_INVALID_START + + tooltip + Character cannot navigate from the current location - e.g., the character is off the navmesh or too high above it. + type + integer + value + 0x02 + + PU_FAILURE_NO_NAVMESH + + tooltip + This is a fatal error reported to a character when there is no navmesh for the region. This usually indicates a server failure and users should file a bug report and include the time and region in which they received this message. + type + integer + value + 0x09 + + PU_FAILURE_NO_VALID_DESTINATION + + tooltip + There is no good place for the character to go - e.g., it is patrolling and all the patrol points are now unreachable. + type + integer + value + 0x06 + + PU_FAILURE_OTHER + + tooltip + + type + integer + value + 1000000 + + PU_FAILURE_PARCEL_UNREACHABLE + + tooltip + + type + integer + value + 11 + + PU_FAILURE_TARGET_GONE + + tooltip + Target (for llPursue or llEvade) can no longer be tracked - e.g., it left the region or is an avatar that is now more than about 30m outside the region. + type + integer + value + 0x05 + + PU_FAILURE_UNREACHABLE + + tooltip + Goal is no longer reachable for some reason - e.g., an obstacle blocks the path. + type + integer + value + 0x04 + + PU_GOAL_REACHED + + tooltip + Character has reached the goal and will stop or choose a new goal (if wandering). + type + integer + value + 0x01 + + PU_SLOWDOWN_DISTANCE_REACHED + + tooltip + Character is near current goal. + type + integer + value + 0x00 + + RAD_TO_DEG + + tooltip + 57.2957795 - Number of degrees per radian. You can use this number to convert radians to degrees by multiplying the radians by this number. + type + float + value + 57.2957795 + + RCERR_CAST_TIME_EXCEEDED + + tooltip + + type + integer + value + -3 + + RCERR_SIM_PERF_LOW + + tooltip + + type + integer + value + -2 + + RCERR_UNKNOWN + + tooltip + + type + integer + value + -1 + + RC_DATA_FLAGS + + tooltip + + type + integer + value + 2 + + RC_DETECT_PHANTOM + + tooltip + + type + integer + value + 1 + + RC_GET_LINK_NUM + + tooltip + + type + integer + value + 4 + + RC_GET_NORMAL + + tooltip + + type + integer + value + 1 + + RC_GET_ROOT_KEY + + tooltip + + type + integer + value + 2 + + RC_MAX_HITS + + tooltip + + type + integer + value + 3 + + RC_REJECT_AGENTS + + tooltip + + type + integer + value + 1 + + RC_REJECT_LAND + + tooltip + + type + integer + value + 8 + + RC_REJECT_NONPHYSICAL + + tooltip + + type + integer + value + 4 + + RC_REJECT_PHYSICAL + + tooltip + + type + integer + value + 2 + + RC_REJECT_TYPES + + tooltip + + type + integer + value + 0 + + REGION_FLAG_ALLOW_DAMAGE + + tooltip + + type + integer + value + 0x1 + + REGION_FLAG_ALLOW_DIRECT_TELEPORT + + tooltip + + type + integer + value + 0x100000 + + REGION_FLAG_BLOCK_FLY + + tooltip + + type + integer + value + 0x80000 + + REGION_FLAG_BLOCK_FLYOVER + + tooltip + + type + integer + value + 0x8000000 + + REGION_FLAG_BLOCK_TERRAFORM + + tooltip + + type + integer + value + 0x40 + + REGION_FLAG_DISABLE_COLLISIONS + + tooltip + + type + integer + value + 0x1000 + + REGION_FLAG_DISABLE_PHYSICS + + tooltip + + type + integer + value + 0x4000 + + REGION_FLAG_FIXED_SUN + + tooltip + + type + integer + value + 0x10 + + REGION_FLAG_RESTRICT_PUSHOBJECT + + tooltip + + type + integer + value + 0x400000 + + REGION_FLAG_SANDBOX + + tooltip + + type + integer + value + 0x100 + + REMOTE_DATA_CHANNEL + + tooltip + + type + integer + value + 1 + + REMOTE_DATA_REPLY + + tooltip + + type + integer + value + 3 + + REMOTE_DATA_REQUEST + + tooltip + + type + integer + value + 2 + + REQUIRE_LINE_OF_SIGHT + + tooltip + Define whether the character needs a line-of-sight to give chase. + type + integer + value + 2 + + RESTITUTION + + tooltip + Used with llSetPhysicsMaterial to enable the density value. Must be between 0.0 and 1.0 + type + integer + value + 4 + + REVERSE + + tooltip + Play animation in reverse direction. + type + integer + value + 0x4 + + REZ_ACCEL + + tooltip + Acceleration forced applied to the rezzed object. [vector force, integer rel] + type + integer + value + 5 + + REZ_DAMAGE + + tooltip + Damage applied by the object when it collides with an agent. [float damage] + type + integer + value + 8 + + REZ_DAMAGE_TYPE + + tooltip + Set the damage type applied when this object collides. + type + integer + value + 12 + + REZ_FLAGS + + tooltip + Rez flags to set on the newly rezzed object. [integer flags] + type + integer + value + 1 + + REZ_FLAG_BLOCK_GRAB_OBJECT + + tooltip + Prevent grabbing the object. + type + integer + value + 0x0080 + + REZ_FLAG_DIE_ON_COLLIDE + + tooltip + Object will die after its first collision. + type + integer + value + 0x0008 + + REZ_FLAG_DIE_ON_NOENTRY + + tooltip + Object will die if it attempts to enter a parcel that it can not. + type + integer + value + 0x0010 + + REZ_FLAG_NO_COLLIDE_FAMILY + + tooltip + Object will not trigger collision events with other objects created by the same rezzer. + type + integer + value + 0x0040 + + REZ_FLAG_NO_COLLIDE_OWNER + + tooltip + Object will not trigger collision events with its owner. + type + integer + value + 0x0020 + + REZ_FLAG_PHANTOM + + tooltip + Make the object phantom on rez. + type + integer + value + 0x0004 + + REZ_FLAG_PHYSICAL + + tooltip + Make the object physical on rez. + type + integer + value + 0x0002 + + REZ_FLAG_TEMP + + tooltip + Flag the object as temp on rez. + type + integer + value + 0x0001 + + REZ_LOCK_AXES + + tooltip + Prevent the object from rotating around some axes. [vector locks] + type + integer + value + 11 + + REZ_OMEGA + + tooltip + Omega applied to the rezzed object. [vector axis, integer rel, float spin, float gain] + type + integer + value + 7 + + REZ_PARAM + + tooltip + Integer value to pass to the object as its rez parameter. [integer param] + type + integer + value + 0 + + REZ_PARAM_STRING + + tooltip + A string value to pass to the object as its rez parameter. [string param] + type + integer + value + 13 + + REZ_POS + + tooltip + Position at which to rez the new object. [vector position, integer rel, integer atroot] + type + integer + value + 2 + + REZ_ROT + + tooltip + Rotation applied to newly rezzed object. [rotation rot, integer rel] + type + integer + value + 3 + + REZ_SOUND + + tooltip + Sound attached to the rezzed object. [string name, float volume, integer loop] + type + integer + value + 9 + + REZ_SOUND_COLLIDE + + tooltip + Sound played by the object on a collision. [string name, float volume] + type + integer + value + 10 + + REZ_VEL + + tooltip + Initial velocity of rezzed object. [vector vel, integer rel, integer inherit] + type + integer + value + 4 + + ROTATE + + tooltip + Animate texture rotation. + type + integer + value + 0x20 + + SCALE + + tooltip + Animate the texture scale. + type + integer + value + 0x40 + + SCRIPTED + + tooltip + Scripted in-world objects. + type + integer + value + 0x8 + + SIM_STAT_ACTIVE_SCRIPT_COUNT + + tooltip + Number of active scripts. + type + integer + value + 12 + + SIM_STAT_AGENT_COUNT + + tooltip + Number of agents in region. + type + integer + value + 10 + + SIM_STAT_AGENT_MS + + tooltip + Time spent in 'agent' segment of simulation frame. + type + integer + value + 7 + + SIM_STAT_AGENT_UPDATES + + tooltip + Agent updates per second. + type + integer + value + 2 + + SIM_STAT_AI_MS + + tooltip + Time spent on AI step. + type + integer + value + 26 + + SIM_STAT_ASSET_DOWNLOADS + + tooltip + Pending asset download count. + type + integer + value + 15 + + SIM_STAT_ASSET_UPLOADS + + tooltip + Pending asset upload count. + type + integer + value + 16 + + SIM_STAT_CHILD_AGENT_COUNT + + tooltip + Number of child agents in region. + type + integer + value + 11 + + SIM_STAT_FRAME_MS + + tooltip + Total frame time. + type + integer + value + 3 + + SIM_STAT_IMAGE_MS + + tooltip + Time spent in 'image' segment of simulation frame. + type + integer + value + 8 + + SIM_STAT_IO_PUMP_MS + + tooltip + Pump IO time. + type + integer + value + 24 + + SIM_STAT_NET_MS + + tooltip + Time spent in 'network' segment of simulation frame. + type + integer + value + 4 + + SIM_STAT_OTHER_MS + + tooltip + Time spent in 'other' segment of simulation frame. + type + integer + value + 5 + + SIM_STAT_PACKETS_IN + + tooltip + Packets in per second. + type + integer + value + 13 + + SIM_STAT_PACKETS_OUT + + tooltip + Packets out per second. + type + integer + value + 14 + + SIM_STAT_PCT_CHARS_STEPPED + + tooltip + Returns the % of pathfinding characters skipped each frame, averaged over the last minute.\nThe returned value corresponds to the "Characters Updated" stat in the viewer's Statistics Bar. + type + integer + value + 0 + + SIM_STAT_PHYSICS_FPS + + tooltip + Physics simulation FPS. + type + integer + value + 1 + + SIM_STAT_PHYSICS_MS + + tooltip + Time spent in 'physics' segment of simulation frame. + type + integer + value + 6 + + SIM_STAT_PHYSICS_OTHER_MS + + tooltip + Physics other time. + type + integer + value + 20 + + SIM_STAT_PHYSICS_SHAPE_MS + + tooltip + Physics shape update time. + type + integer + value + 19 + + SIM_STAT_PHYSICS_STEP_MS + + tooltip + Physics step time. + type + integer + value + 18 + + SIM_STAT_SCRIPT_EPS + + tooltip + Script events per second. + type + integer + value + 21 + + SIM_STAT_SCRIPT_MS + + tooltip + Time spent in 'script' segment of simulation frame. + type + integer + value + 9 + + SIM_STAT_SCRIPT_RUN_PCT + + tooltip + Percent of scripts run during frame. + type + integer + value + 25 + + SIM_STAT_SLEEP_MS + + tooltip + Time spent sleeping. + type + integer + value + 23 + + SIM_STAT_SPARE_MS + + tooltip + Spare time left after frame. + type + integer + value + 22 + + SIM_STAT_UNACKED_BYTES + + tooltip + Total unacknowledged bytes. + type + integer + value + 17 + + SIT_FLAG_ALLOW_UNSIT + + tooltip + The prim allows a seated avatar to stand up. + type + integer + value + 0x0002 + + SIT_FLAG_NO_COLLIDE + + tooltip + The seated avatar's hit box is disabled when seated on this prim. + type + integer + value + 0x0010 + + SIT_FLAG_NO_DAMAGE + + tooltip + Damage will not be forwarded to an avatar seated on this prim. + type + integer + value + 0x0020 + + SIT_FLAG_SCRIPTED_ONLY + + tooltip + An avatar may not manually sit on this prim. + type + integer + value + 0x0004 + + SIT_FLAG_SIT_TARGET + + tooltip + The prim has an explicitly set sit target. + type + integer + value + 0x0001 + + SIT_INVALID_AGENT + + tooltip + Avatar ID did not specify a valid avatar. + type + integer + value + -4 + + SIT_INVALID_LINK + + tooltip + Link ID did not specify a valid prim in the linkset or resolved to multiple prims. + type + integer + value + -5 + + SIT_INVALID_OBJECT + + tooltip + Attempt to force an avatar to sit on an attachment or other invalid target. + type + integer + value + -7 + + SIT_NOT_EXPERIENCE + + tooltip + Attempt to force an avatar to sit outside an experience. + type + integer + value + -1 + + SIT_NO_ACCESS + + tooltip + Avatar does not have access to the parcel containing the target linkset of the forced sit. + type + integer + value + -6 + + SIT_NO_EXPERIENCE_PERMISSION + + tooltip + Avatar has not granted permission to force sits. + type + integer + value + -2 + + SIT_NO_SIT_TARGET + + tooltip + No available sit target in linkset for forced sit. + type + integer + value + -3 + + SKY_AMBIENT + + tooltip + The ambient color of the environment + type + integer + value + 0 + + SKY_BLUE + + tooltip + Blue settings for environment + type + integer + value + 22 + + SKY_CLOUDS + + tooltip + Settings controlling cloud density and configuration + type + integer + value + 2 + + SKY_CLOUD_TEXTURE + + tooltip + Texture ID used by clouds + type + integer + value + 19 + + SKY_DOME + + tooltip + Sky dome information. + type + integer + value + 4 + + SKY_GAMMA + + tooltip + The gamma value applied to the scene. + type + integer + value + 5 + + SKY_GLOW + + tooltip + Glow color applied to the sun and moon. + type + integer + value + 6 + + SKY_HAZE + + tooltip + Haze settings for environment + type + integer + value + 23 + + SKY_LIGHT + + tooltip + Miscellaneous lighting values. + type + integer + value + 8 + + SKY_MOON + + tooltip + Environmental moon details. + type + integer + value + 9 + + SKY_MOON_TEXTURE + + tooltip + Environmental moon texture. + type + integer + value + 20 + + SKY_PLANET + + tooltip + Planet information used in rendering the sky. + type + integer + value + 10 + + SKY_REFLECTION_PROBE_AMBIANCE + + tooltip + Settings the ambience of the reflection probe. + type + integer + value + 24 + + SKY_REFRACTION + + tooltip + Sky refraction parameters for rainbows and optical effects. + type + integer + value + 11 + + SKY_STAR_BRIGHTNESS + + tooltip + Brightness value for the stars. + type + integer + value + 13 + + SKY_SUN + + tooltip + Detailed sun information + type + integer + value + 14 + + SKY_SUN_TEXTURE + + tooltip + Environmental sun texture + type + integer + value + 21 + + SKY_TEXTURE_DEFAULTS + + tooltip + Is the environment using the default textures. + type + integer + value + 1 + + SKY_TRACKS + + tooltip + Track elevations for this region. + type + integer + value + 15 + + SMOOTH + + tooltip + Slide in the X direction, instead of playing separate frames. + type + integer + value + 0x10 + + SOUND_LOOP + + tooltip + Sound will loop until stopped. + type + integer + value + 0x01 + + SOUND_PLAY + + tooltip + Sound will play normally. + type + integer + value + 0x00 + + SOUND_SYNC + + tooltip + Sound will be synchronized with the nearest master. + type + integer + value + 0x04 + + SOUND_TRIGGER + + tooltip + Sound will be triggered at the prim's location and not attached. + type + integer + value + 0x02 + + SQRT2 + + tooltip + 1.41421356 - The square root of 2. + type + float + value + 1.41421356 + + STATUS_BLOCK_GRAB + + tooltip + Controls whether the object can be grabbed.\nA grab is the default action when in third person, and is available as the hand tool in build mode. This is useful for physical objects that you don't want other people to be able to trivially disturb. The default is FALSE + type + integer + value + 0x40 + + STATUS_BLOCK_GRAB_OBJECT + + tooltip + Prevent click-and-drag movement on all prims in the object. + type + integer + value + 0x400 + + STATUS_BOUNDS_ERROR + + tooltip + Argument(s) passed to function had a bounds error. + type + integer + value + 1002 + + STATUS_CAST_SHADOWS + + tooltip + + type + integer + value + 0x200 + + STATUS_DIE_AT_EDGE + + tooltip + Controls whether the object is returned to the owners inventory if it wanders off the edge of the world.\nIt is useful to set this status TRUE for things like bullets or rockets. The default is TRUE + type + integer + value + 0x80 + + STATUS_DIE_AT_NO_ENTRY + + tooltip + Controls whether the object dies if it attempts to enter a parcel that does not allow object entry or does not have enough capacity.\nIt is useful to set this status TRUE for things like bullets or rockets. The default is FALSE + type + integer + value + 0x800 + + STATUS_INTERNAL_ERROR + + tooltip + An internal error occurred. + type + integer + value + 1999 + + STATUS_MALFORMED_PARAMS + + tooltip + Function was called with malformed parameters. + type + integer + value + 1000 + + STATUS_NOT_FOUND + + tooltip + Object or other item was not found. + type + integer + value + 1003 + + STATUS_NOT_SUPPORTED + + tooltip + Feature not supported. + type + integer + value + 1004 + + STATUS_OK + + tooltip + Result of function call was a success. + type + integer + value + 0 + + STATUS_PHANTOM + + tooltip + Controls/indicates whether the object collides or not.\nSetting the value to TRUE makes the object non-colliding with all objects. It is a good idea to use this for most objects that move or rotate, but are non-physical. It is also useful for simulating volumetric lighting. The default is FALSE. + type + integer + value + 0x10 + + STATUS_PHYSICS + + tooltip + Controls/indicates whether the object moves physically.\nThis controls the same flag that the UI check-box for Physical controls. The default is FALSE. + type + integer + value + 0x1 + + STATUS_RETURN_AT_EDGE + + tooltip + + type + integer + value + 0x100 + + STATUS_ROTATE_X + + tooltip + + type + integer + value + 0x2 + + STATUS_ROTATE_Y + + tooltip + + type + integer + value + 0x4 + + STATUS_ROTATE_Z + + tooltip + + Controls/indicates whether the object can physically rotate around + the specific axis or not. This flag has no meaning + for non-physical objects. Set the value to FALSE + if you want to disable rotation around that axis. The + default is TRUE for a physical object. + A useful example to think about when visualizing + the effect is a sit-and-spin device. They spin around the + Z axis (up) but not around the X or Y axis. + + type + integer + value + 0x8 + + STATUS_SANDBOX + + tooltip + + Controls/indicates whether the object can cross region boundaries + and move more than 20 meters from its creation + point. The default if FALSE. + + type + integer + value + 0x20 + + STATUS_TYPE_MISMATCH + + tooltip + Argument(s) passed to function had a type mismatch. + type + integer + value + 1001 + + STATUS_WHITELIST_FAILED + + tooltip + Whitelist Failed. + type + integer + value + 2001 + + STRING_TRIM + + tooltip + + type + integer + value + 0x03 + + STRING_TRIM_HEAD + + tooltip + + type + integer + value + 0x01 + + STRING_TRIM_TAIL + + tooltip + + type + integer + value + 0x02 + + TARGETED_EMAIL_OBJECT_OWNER + + tooltip + Send email to the owner of the object + type + integer + value + 0x02 + + TARGETED_EMAIL_ROOT_CREATOR + + tooltip + Send email to the creator of the root object + type + integer + value + 0x01 + + TERRAIN_DETAIL_1 + + tooltip + + type + integer + value + 0 + + TERRAIN_DETAIL_2 + + tooltip + + type + integer + value + 1 + + TERRAIN_DETAIL_3 + + tooltip + + type + integer + value + 2 + + TERRAIN_DETAIL_4 + + tooltip + + type + integer + value + 3 + + TERRAIN_HEIGHT_RANGE_NE + + tooltip + + type + integer + value + 7 + + TERRAIN_HEIGHT_RANGE_NW + + tooltip + + type + integer + value + 6 + + TERRAIN_HEIGHT_RANGE_SE + + tooltip + + type + integer + value + 5 + + TERRAIN_HEIGHT_RANGE_SW + + tooltip + + type + integer + value + 4 + + TERRAIN_PBR_OFFSET_1 + + tooltip + + type + integer + value + 16 + + TERRAIN_PBR_OFFSET_2 + + tooltip + + type + integer + value + 17 + + TERRAIN_PBR_OFFSET_3 + + tooltip + + type + integer + value + 18 + + TERRAIN_PBR_OFFSET_4 + + tooltip + + type + integer + value + 19 + + TERRAIN_PBR_ROTATION_1 + + tooltip + + type + integer + value + 12 + + TERRAIN_PBR_ROTATION_2 + + tooltip + + type + integer + value + 13 + + TERRAIN_PBR_ROTATION_3 + + tooltip + + type + integer + value + 14 + + TERRAIN_PBR_ROTATION_4 + + tooltip + + type + integer + value + 15 + + TERRAIN_PBR_SCALE_1 + + tooltip + + type + integer + value + 8 + + TERRAIN_PBR_SCALE_2 + + tooltip + + type + integer + value + 9 + + TERRAIN_PBR_SCALE_3 + + tooltip + + type + integer + value + 10 + + TERRAIN_PBR_SCALE_4 + + tooltip + + type + integer + value + 11 + + TEXTURE_BLANK + + tooltip + + type + string + value + 5748decc-f629-461c-9a36-a35a221fe21f + + TEXTURE_DEFAULT + + tooltip + + type + string + value + 89556747-24cb-43ed-920b-47caed15465f + + TEXTURE_MEDIA + + tooltip + + type + string + value + 8b5fec65-8d8d-9dc5-cda8-8fdf2716e361 + + TEXTURE_PLYWOOD + + tooltip + + type + string + value + 89556747-24cb-43ed-920b-47caed15465f + + TEXTURE_TRANSPARENT + + tooltip + + type + string + value + 8dcd4a48-2d37-4909-9f78-f7a9eb4ef903 + + TOUCH_INVALID_FACE + + tooltip + + type + integer + value + -1 + + TOUCH_INVALID_TEXCOORD + + tooltip + + type + vector + value + <-1.0, -1.0, 0.0> + + TOUCH_INVALID_VECTOR + + tooltip + + type + vector + value + <0.0, 0.0, 0.0> + + TP_ROUTING_BLOCKED + + tooltip + Direct teleporting is blocked on this parcel. + type + integer + value + 0 + + TP_ROUTING_FREE + + tooltip + Teleports are unrestricted on this parcel. + type + integer + value + 2 + + TP_ROUTING_LANDINGP + + tooltip + Teleports are routed to a landing point if set on this parcel. + type + integer + value + 1 + + TRANSFER_BAD_OPTS + + tooltip + Invalid inventory options. + type + integer + value + -1 + + TRANSFER_BAD_ROOT + + tooltip + The root path specified in TRANSFER_DEST contained an invalid directory or was reduced to nothing. + type + integer + value + -5 + + TRANSFER_DEST + + tooltip + The root folder to transfer inventory into. + type + integer + value + 0 + + TRANSFER_FLAGS + + tooltip + Flags to control the behavior of inventory transfer. + type + integer + value + 1 + + TRANSFER_FLAG_COPY + + tooltip + Gives a copy of the object being transfered. Implies TRANSFER_FLAG_TAKE. + type + integer + value + 0x0004 + + TRANSFER_FLAG_RESERVED + + tooltip + Reserved for future expansion. + type + integer + value + 0x0001 + + TRANSFER_FLAG_TAKE + + tooltip + On a successful transfer, automatically takes the object into inventory. + type + integer + value + 0x0002 + + TRANSFER_NO_ATTACHMENT + + tooltip + Can not transfer ownership of an attached object. + type + integer + value + -7 + + TRANSFER_NO_ITEMS + + tooltip + No items in the inventory list are eligible for transfer. + type + integer + value + -4 + + TRANSFER_NO_PERMS + + tooltip + The object does not have transfer permissions. + type + integer + value + -6 + + TRANSFER_NO_TARGET + + tooltip + Could not find the receiver in the current region. + type + integer + value + -2 + + TRANSFER_OK + + tooltip + Inventory transfer offer was successfully made. + type + integer + value + 0 + + TRANSFER_THROTTLE + + tooltip + Inventory throttle hit. + type + integer + value + -3 + + TRAVERSAL_TYPE + + tooltip + One of TRAVERSAL_TYPE_FAST, TRAVERSAL_TYPE_SLOW, and TRAVERSAL_TYPE_NONE. + type + integer + value + 7 + + TRAVERSAL_TYPE_FAST + + tooltip + + type + integer + value + 1 + + TRAVERSAL_TYPE_NONE + + tooltip + + type + integer + value + 2 + + TRAVERSAL_TYPE_SLOW + + tooltip + + type + integer + value + 0 + + TRUE + + tooltip + An integer constant for boolean comparisons. Has the value '1'. + type + integer + value + 1 + + TWO_PI + + tooltip + 6.28318530 - The radians of a circle. + type + float + value + 6.28318530 + + TYPE_FLOAT + + tooltip + The list entry is a float. + type + integer + value + 2 + + TYPE_INTEGER + + tooltip + The list entry is an integer. + type + integer + value + 1 + + TYPE_INVALID + + tooltip + The list entry is invalid. + type + integer + value + 0 + + TYPE_KEY + + tooltip + The list entry is a key. + type + integer + value + 4 + + TYPE_ROTATION + + tooltip + The list entry is a rotation. + type + integer + value + 6 + + TYPE_STRING + + tooltip + The list entry is a string. + type + integer + value + 3 + + TYPE_VECTOR + + tooltip + The list entry is a vector. + type + integer + value + 5 + + URL_REQUEST_DENIED + + tooltip + + type + string + value + URL_REQUEST_DENIED + + URL_REQUEST_GRANTED + + tooltip + + type + string + value + URL_REQUEST_GRANTED + + VEHICLE_ANGULAR_DEFLECTION_EFFICIENCY + + tooltip + A slider between minimum (0.0) and maximum (1.0) deflection of angular orientation. That is, its a simple scalar for modulating the strength of angular deflection such that the vehicles preferred axis of motion points toward its real velocity. + type + integer + value + 32 + + VEHICLE_ANGULAR_DEFLECTION_TIMESCALE + + tooltip + The time-scale for exponential success of linear deflection deflection. Its another way to specify the strength of the vehicles tendency to reorient itself so that its preferred axis of motion agrees with its true velocity. + type + integer + value + 33 + + VEHICLE_ANGULAR_FRICTION_TIMESCALE + + tooltip + + A vector of timescales for exponential decay of the vehicles angular velocity about its preferred axes of motion (at, left, up). + Range = [0.07, inf) seconds for each element of the vector. + + type + integer + value + 17 + + VEHICLE_ANGULAR_MOTOR_DECAY_TIMESCALE + + tooltip + The timescale for exponential decay of the angular motors magnitude. + type + integer + value + 35 + + VEHICLE_ANGULAR_MOTOR_DIRECTION + + tooltip + The direction and magnitude (in preferred frame) of the vehicles angular motor.The vehicle will accelerate (or decelerate if necessary) to match its velocity to its motor. + type + integer + value + 19 + + VEHICLE_ANGULAR_MOTOR_TIMESCALE + + tooltip + The timescale for exponential approach to full angular motor velocity. + type + integer + value + 34 + + VEHICLE_BANKING_EFFICIENCY + + tooltip + A slider between anti (-1.0), none (0.0), and maxmum (1.0) banking strength. + type + integer + value + 38 + + VEHICLE_BANKING_MIX + + tooltip + A slider between static (0.0) and dynamic (1.0) banking. "Static" means the banking scales only with the angle of roll, whereas "dynamic" is a term that also scales with the vehicles linear speed. + type + integer + value + 39 + + VEHICLE_BANKING_TIMESCALE + + tooltip + The timescale for banking to exponentially approach its maximum effect. This is another way to scale the strength of the banking effect, however it affects the term that is proportional to the difference between what the banking behavior is trying to do, and what the vehicle is actually doing. + type + integer + value + 40 + + VEHICLE_BUOYANCY + + tooltip + A slider between minimum (0.0) and maximum anti-gravity (1.0). + type + integer + value + 27 + + VEHICLE_FLAG_BLOCK_INTERFERENCE + + tooltip + Prevent other scripts from pushing vehicle. + type + integer + value + 0x400 + + VEHICLE_FLAG_CAMERA_DECOUPLED + + tooltip + + type + integer + value + 0x200 + + VEHICLE_FLAG_HOVER_GLOBAL_HEIGHT + + tooltip + Hover at global height. + type + integer + value + 0x10 + + VEHICLE_FLAG_HOVER_TERRAIN_ONLY + + tooltip + Ignore water height when hovering. + type + integer + value + 0x8 + + VEHICLE_FLAG_HOVER_UP_ONLY + + tooltip + Hover does not push down. Use this flag for hovering vehicles that should be able to jump above their hover height. + type + integer + value + 0x20 + + VEHICLE_FLAG_HOVER_WATER_ONLY + + tooltip + Ignore terrain height when hovering. + type + integer + value + 0x4 + + VEHICLE_FLAG_LIMIT_MOTOR_UP + + tooltip + Prevents ground vehicles from motoring into the sky. + type + integer + value + 0x40 + + VEHICLE_FLAG_LIMIT_ROLL_ONLY + + tooltip + For vehicles with vertical attractor that want to be able to climb/dive, for instance, aeroplanes that want to use the banking feature. + type + integer + value + 0x2 + + VEHICLE_FLAG_MOUSELOOK_BANK + + tooltip + + type + integer + value + 0x100 + + VEHICLE_FLAG_MOUSELOOK_STEER + + tooltip + + type + integer + value + 0x80 + + VEHICLE_FLAG_NO_DEFLECTION_UP + + tooltip + This flag prevents linear deflection parallel to world z-axis. This is useful for preventing ground vehicles with large linear deflection, like bumper cars, from climbing their linear deflection into the sky. + type + integer + value + 0x1 + + VEHICLE_FLAG_NO_FLY_UP + + deprecated + 1 + tooltip + Old, changed to VEHICLE_FLAG_NO_DEFLECTION_UP + type + integer + value + 0x1 + + VEHICLE_HOVER_EFFICIENCY + + tooltip + A slider between minimum (0.0 = bouncy) and maximum (1.0 = fast as possible) damped motion of the hover behavior. + type + integer + value + 25 + + VEHICLE_HOVER_HEIGHT + + tooltip + The height (above the terrain or water, or global) at which the vehicle will try to hover. + type + integer + value + 24 + + VEHICLE_HOVER_TIMESCALE + + tooltip + Period of time (in seconds) for the vehicle to achieve its hover height. + type + integer + value + 26 + + VEHICLE_LINEAR_DEFLECTION_EFFICIENCY + + tooltip + A slider between minimum (0.0) and maximum (1.0) deflection of linear velocity. That is, its a simple scalar for modulating the strength of linear deflection. + type + integer + value + 28 + + VEHICLE_LINEAR_DEFLECTION_TIMESCALE + + tooltip + The timescale for exponential success of linear deflection deflection. It is another way to specify how much time it takes for the vehicles linear velocity to be redirected to its preferred axis of motion. + type + integer + value + 29 + + VEHICLE_LINEAR_FRICTION_TIMESCALE + + tooltip + + A vector of timescales for exponential decay of the vehicles linear velocity along its preferred axes of motion (at, left, up). + Range = [0.07, inf) seconds for each element of the vector. + + type + integer + value + 16 + + VEHICLE_LINEAR_MOTOR_DECAY_TIMESCALE + + tooltip + The timescale for exponential decay of the linear motors magnitude. + type + integer + value + 31 + + VEHICLE_LINEAR_MOTOR_DIRECTION + + tooltip + + The direction and magnitude (in preferred frame) of the vehicles linear motor. The vehicle will accelerate (or decelerate if necessary) to match its velocity to its motor. + Range of magnitude = [0, 30] meters/second. + + type + integer + value + 18 + + VEHICLE_LINEAR_MOTOR_OFFSET + + tooltip + + type + integer + value + 20 + + VEHICLE_LINEAR_MOTOR_TIMESCALE + + tooltip + The timescale for exponential approach to full linear motor velocity. + type + integer + value + 30 + + VEHICLE_REFERENCE_FRAME + + tooltip + A rotation of the vehicles preferred axes of motion and orientation (at, left, up) with respect to the vehicles local frame (x, y, z). + type + integer + value + 44 + + VEHICLE_TYPE_AIRPLANE + + tooltip + Uses linear deflection for lift, no hover, and banking to turn.\nSee http://wiki.secondlife.com/wiki/VEHICLE_TYPE_AIRPLANE + type + integer + value + 4 + + VEHICLE_TYPE_BALLOON + + tooltip + Hover, and friction, but no deflection.\nSee http://wiki.secondlife.com/wiki/VEHICLE_TYPE_BALLOON + type + integer + value + 5 + + VEHICLE_TYPE_BOAT + + tooltip + Hovers over water with lots of friction and some anglar deflection.\nSee http://wiki.secondlife.com/wiki/VEHICLE_TYPE_BOAT + type + integer + value + 3 + + VEHICLE_TYPE_CAR + + tooltip + Another vehicle that bounces along the ground but needs the motors to be driven from external controls or timer events.\nSee http://wiki.secondlife.com/wiki/VEHICLE_TYPE_CAR + type + integer + value + 2 + + VEHICLE_TYPE_NONE + + tooltip + + type + integer + value + 0 + + VEHICLE_TYPE_SLED + + tooltip + Simple vehicle that bumps along the ground, and likes to move along its local x-axis.\nSee http://wiki.secondlife.com/wiki/VEHICLE_TYPE_SLED + type + integer + value + 1 + + VEHICLE_VERTICAL_ATTRACTION_EFFICIENCY + + tooltip + A slider between minimum (0.0 = wobbly) and maximum (1.0 = firm as possible) stability of the vehicle to keep itself upright. + type + integer + value + 36 + + VEHICLE_VERTICAL_ATTRACTION_TIMESCALE + + tooltip + The period of wobble, or timescale for exponential approach, of the vehicle to rotate such that its preferred "up" axis is oriented along the worlds "up" axis. + type + integer + value + 37 + + VERTICAL + + tooltip + + type + integer + value + 0 + + WANDER_PAUSE_AT_WAYPOINTS + + tooltip + + type + integer + value + 0 + + WATER_BLUR_MULTIPLIER + + tooltip + Blur factor. + type + integer + value + 100 + + WATER_FOG + + tooltip + Fog properties when underwater. + type + integer + value + 101 + + WATER_FRESNEL + + tooltip + Fresnel scattering applied to the surface of the water. + type + integer + value + 102 + + WATER_NORMAL_SCALE + + tooltip + Scaling applied to the water normal map. + type + integer + value + 104 + + WATER_NORMAL_TEXTURE + + tooltip + Normal map used for environmental waves. + type + integer + value + 107 + + WATER_REFRACTION + + tooltip + Refraction factors when looking through the surface of the water. + type + integer + value + 105 + + WATER_TEXTURE_DEFAULTS + + tooltip + Is the environment using the default wave map. + type + integer + value + 103 + + WATER_WAVE_DIRECTION + + tooltip + Vectors for the directions of the waves. + type + integer + value + 106 + + XP_ERROR_EXPERIENCES_DISABLED + + tooltip + The region currently has experiences disabled. + type + integer + value + 2 + + XP_ERROR_EXPERIENCE_DISABLED + + tooltip + The experience owner has temporarily disabled the experience. + type + integer + value + 8 + + XP_ERROR_EXPERIENCE_SUSPENDED + + tooltip + The experience has been suspended by Linden Customer Support. + type + integer + value + 9 + + XP_ERROR_INVALID_EXPERIENCE + + tooltip + The script is associated with an experience that no longer exists. + type + integer + value + 7 + + XP_ERROR_INVALID_PARAMETERS + + tooltip + One of the string arguments was too big to fit in the key-value store. + type + integer + value + 3 + + XP_ERROR_KEY_NOT_FOUND + + tooltip + The requested key does not exist. + type + integer + value + 14 + + XP_ERROR_MATURITY_EXCEEDED + + tooltip + The content rating of the experience exceeds that of the region. + type + integer + value + 16 + + XP_ERROR_NONE + + tooltip + No error was detected. + type + integer + value + 0 + + XP_ERROR_NOT_FOUND + + tooltip + The sim was unable to verify the validity of the experience. Retrying after a short wait is advised. + type + integer + value + 6 + + XP_ERROR_NOT_PERMITTED + + tooltip + This experience is not allowed to run by the requested agent. + type + integer + value + 4 + + XP_ERROR_NOT_PERMITTED_LAND + + tooltip + This experience is not allowed to run on the current region. + type + integer + value + 17 + + XP_ERROR_NO_EXPERIENCE + + tooltip + This script is not associated with an experience. + type + integer + value + 5 + + XP_ERROR_QUOTA_EXCEEDED + + tooltip + An attempted write data to the key-value store failed due to the data quota being met. + type + integer + value + 11 + + XP_ERROR_REQUEST_PERM_TIMEOUT + + tooltip + Request timed out; permissions not modified. + type + integer + value + 18 + + XP_ERROR_RETRY_UPDATE + + tooltip + A checked update failed due to an out of date request. + type + integer + value + 15 + + XP_ERROR_STORAGE_EXCEPTION + + tooltip + Unable to communicate with the key-value store. + type + integer + value + 13 + + XP_ERROR_STORE_DISABLED + + tooltip + The key-value store is currently disabled on this region. + type + integer + value + 12 + + XP_ERROR_THROTTLED + + tooltip + The call failed due to too many recent calls. + type + integer + value + 1 + + XP_ERROR_UNKNOWN_ERROR + + tooltip + Other unknown error. + type + integer + value + 10 + + ZERO_ROTATION + + tooltip + + type + rotation + value + <0.0, 0.0, 0.0, 1.0> + + ZERO_VECTOR + + tooltip + + type + vector + value + <0.0, 0.0, 0.0> + + default + + tooltip + + All scripts must have a default state, which is the first state entered when the script starts. + If another state is defined before the default state, the compiler will report a syntax error. + + + + events + + at_rot_target + + arguments + + + TargetNumber + + tooltip + + type + integer + + + + TargetRotation + + tooltip + + type + rotation + + + + CurrentRotation + + tooltip + + type + rotation + + + + tooltip + This event is triggered when a script comes within a defined angle of a target rotation. The range and rotation, are set by a call to llRotTarget. + + at_target + + arguments + + + TargetNumber + + tooltip + + type + integer + + + + TargetPosition + + tooltip + + type + vector + + + + CurrentPosition + + tooltip + + type + vector + + + + tooltip + This event is triggered when the scripted object comes within a defined range of the target position, defined by the llTarget function call. + + attach + + arguments + + + AvatarID + + tooltip + + type + key + + + + tooltip + This event is triggered whenever an object is attached or detached from an avatar. If it is attached, the key of the avatar it is attached to is passed in, otherwise NULL_KEY is. + + changed + + arguments + + + Changed + + tooltip + + type + integer + + + + tooltip + Triggered when various events change the object. The change argument will be a bit-field of CHANGED_* constants. + + collision + + arguments + + + NumberOfCollisions + + tooltip + + type + integer + + + + tooltip + + This event is raised while another object, or avatar, is colliding with the object the script is attached to. + The number of detected objects is passed to the script. Information on those objects may be gathered via the llDetected* functions. + + + collision_end + + arguments + + + NumberOfCollisions + + tooltip + + type + integer + + + + tooltip + + This event is raised when another object, or avatar, stops colliding with the object the script is attached to. + The number of detected objects is passed to the script. Information on those objects may be gathered via the llDetected* library functions. + + + collision_start + + arguments + + + NumberOfCollisions + + tooltip + + type + integer + + + + tooltip + + This event is raised when another object, or avatar, starts colliding with the object the script is attached to. + The number of detected objects is passed to the script. Information on those objects may be gathered via the llDetected* library functions. + + + control + + arguments + + + AvatarID + + tooltip + + type + key + + + + Levels + + tooltip + + type + integer + + + + Edges + + tooltip + + type + integer + + + + tooltip + + Once a script has the ability to grab control inputs from the avatar, this event will be used to pass the commands into the script. + The levels and edges are bit-fields of control constants. + + + dataserver + + arguments + + + RequestID + + tooltip + + type + key + + + + Data + + tooltip + + type + string + + + + tooltip + + This event is triggered when the requested data is returned to the script. + Data may be requested by the llRequestAgentData, llRequestInventoryData, and llGetNotecardLine function calls, for example. + + + email + + arguments + + + Time + + tooltip + + type + string + + + + Address + + tooltip + + type + string + + + + Subject + + tooltip + + type + string + + + + Body + + tooltip + + type + string + + + + NumberRemaining + + tooltip + + type + integer + + + + tooltip + + This event is triggered when an email sent to this script arrives. + The number remaining tells how many more emails are known to be still pending. + + + experience_permissions + + arguments + + + agent_id + + tooltip + ID of the agent approving permission for the Experience. + type + key + + + + tooltip + Triggered when an agent has approved an experience permissions request. + + experience_permissions_denied + + arguments + + + agent_id + + tooltip + ID of the agent denying permission for the Experience. + type + key + + + + Reason + + tooltip + One of the XP_ERROR_... constants describing the reason why the Experience permissions were denied for the agent. + type + integer + + + + tooltip + Describes why the Experience permissions were denied for the agent. + + final_damage + + arguments + + + count + + tooltip + The number of damage events queued. + type + integer + + + + tooltip + Triggered as damage is applied to an avatar or task, after all on_damage events have been processed. + + game_control + + arguments + + + id + + tooltip + UUID of avatar supplying input + type + key + + + + buttons + + tooltip + 32-bit mask of buttons pressed + type + integer + + + + axes + + tooltip + Six float values in range [-1, 1] + type + list + + + + tooltip + This event is raised when game controller input changes. + + http_request + + arguments + + + HTTPRequestID + + tooltip + + type + key + + + + HTTPMethod + + tooltip + + type + string + + + + Body + + tooltip + + type + string + + + + tooltip + Triggered when task receives an HTTP request. + + http_response + + arguments + + + HTTPRequestID + + tooltip + + type + key + + + + Status + + tooltip + + type + integer + + + + Metadata + + tooltip + + type + list + + + + Body + + tooltip + + type + string + + + + tooltip + This event handler is invoked when an HTTP response is received for a pending llHTTPRequest request or if a pending request fails or times out. + + land_collision + + arguments + + + Position + + tooltip + + type + vector + + + + tooltip + This event is raised when the object the script is attached to is colliding with the ground. + + land_collision_end + + arguments + + + Position + + tooltip + + type + vector + + + + tooltip + This event is raised when the object the script is attached to stops colliding with the ground. + + land_collision_start + + arguments + + + Position + + tooltip + + type + vector + + + + tooltip + This event is raised when the object the script is attached to begins to collide with the ground. + + link_message + + arguments + + + SendersLink + + tooltip + + type + integer + + + + Value + + tooltip + + type + integer + + + + Text + + tooltip + + type + string + + + + ID + + tooltip + + type + key + + + + tooltip + Triggered when object receives a link message via llMessageLinked function call. + + linkset_data + + arguments + + + action + + tooltip + + type + integer + + + + name + + tooltip + + type + string + + + + value + + tooltip + + type + string + + + + tooltip + Triggered when a script modifies the linkset datastore. + + listen + + arguments + + + Channel + + tooltip + + type + integer + + + + Name + + tooltip + + type + string + + + + ID + + tooltip + + type + key + + + + Text + + tooltip + + type + string + + + + tooltip + + This event is raised whenever a chat message matching the constraints set in the llListen command is received. The name and ID of the speaker, as well as the message, are passed in as parameters. + Channel 0 is the public chat channel that all avatars see as chat text. Channels 1 through 2,147,483,648 are private channels that are not sent to avatars but other scripts can listen on those channels. + + + money + + arguments + + + Payer + + tooltip + + type + key + + + + Amount + + tooltip + + type + integer + + + + tooltip + This event is triggered when a resident has given an amount of Linden dollars to the object. + + moving_end + + arguments + + tooltip + Triggered whenever an object with this script stops moving. + + moving_start + + arguments + + tooltip + Triggered whenever an object with this script starts moving. + + no_sensor + + arguments + + tooltip + This event is raised when sensors are active, via the llSensor function call, but are not sensing anything. + + not_at_rot_target + + arguments + + tooltip + When a target is set via the llRotTarget function call, but the script is outside the specified angle this event is raised. + + not_at_target + + arguments + + tooltip + When a target is set via the llTarget library call, but the script is outside the specified range this event is raised. + + object_rez + + arguments + + + RezzedObjectsID + + tooltip + + type + key + + + + tooltip + Triggered when an object rezzes another object from its inventory via the llRezObject, or similar, functions. The id is the globally unique key for the object rezzed. + + on_damage + + arguments + + + count + + tooltip + The number of damage events queued. + type + integer + + + + tooltip + Triggered when an avatar or object receives damage. + + on_death + + arguments + + tooltip + Triggered when an avatar reaches 0 health. + + on_rez + + arguments + + + StartParameter + + tooltip + + type + integer + + + + tooltip + Triggered whenever an object is rezzed from inventory or by another object. The start parameter is passed in from the llRezObject call, or zero if from inventory. + + path_update + + arguments + + + Type + + tooltip + + type + integer + + + + Reserved + + tooltip + + type + list + + + + tooltip + This event is called to inform the script of changes within the object's path-finding status. + + remote_data + + arguments + + + EventType + + tooltip + + type + integer + + + + ChannelID + + tooltip + + type + key + + + + MessageID + + tooltip + + type + key + + + + Sender + + tooltip + + type + string + + + + IData + + tooltip + + type + integer + + + + SData + + tooltip + + type + string + + + + tooltip + This event is deprecated. + + run_time_permissions + + arguments + + + PermissionFlags + + tooltip + + type + integer + + + + tooltip + + Scripts need permission from either the owner or the avatar they wish to act on before they may perform certain functions, such as debiting money from their owners account, triggering an animation on an avatar, or capturing control inputs. The llRequestPermissions library function is used to request these permissions and the various permissions integer constants can be supplied. + The integer returned to this event handler contains the current set of permissions flags, so if permissions equal 0 then no permissions are set. + + + sensor + + arguments + + + NumberDetected + + tooltip + + type + integer + + + + tooltip + + This event is raised whenever objects matching the constraints of the llSensor command are detected. + The number of detected objects is passed to the script in the parameter. Information on those objects may be gathered via the llDetected* functions. + + + state_entry + + arguments + + tooltip + The state_entry event occurs whenever a new state is entered, including at program start, and is always the first event handled. + + state_exit + + arguments + + tooltip + The state_exit event occurs whenever the state command is used to transition to another state. It is handled before the new states state_entry event. + + timer + + arguments + + tooltip + This event is raised at regular intervals set by the llSetTimerEvent library function. + + touch + + arguments + + + NumberOfTouches + + tooltip + + type + integer + + + + tooltip + + This event is raised while a user is touching the object the script is attached to. + The number of touching objects is passed to the script in the parameter. + Information on those objects may be gathered via the llDetected* library functions. + + + touch_end + + arguments + + + NumberOfTouches + + tooltip + + type + integer + + + + tooltip + + This event is raised when a user stops touching the object the script is attached to. The number of touches is passed to the script in the parameter. + Information on those objects may be gathered via the llDetected* library functions. + + + touch_start + + arguments + + + NumberOfTouches + + tooltip + + type + integer + + + + tooltip + + This event is raised when a user first touches the object the script is attached to. The number of touches is passed to the script in the parameter. + Information on those objects may be gathered via the llDetected() library functions. + + + transaction_result + + arguments + + + RequestID + + tooltip + + type + key + + + + Success + + tooltip + + type + integer + + + + Message + + tooltip + + type + string + + + + tooltip + Triggered by llTransferMoney() function. + + + functions + + + assert + + arguments + + + value + + tooltip + The value to check for truthiness. + type + any + + + + message + + tooltip + Optional error message to display if the value is not truthy. + type + string? + + + + energy + 10 + return + any + sleep + 0 + tooltip + Checks if the value is truthy; if not, raises an error with the optional message. + + error + + arguments + + + obj + + tooltip + The error object to raise. + type + any + + + + level + + tooltip + Optional level to attribute the error to in the call stack. + type + number? + + + + energy + 10 + return + void + sleep + 0 + tooltip + Raises an error with the specified object and optional call stack level. + + gcinfo + + energy + 10 + return + number + sleep + 0 + tooltip + Returns the total heap size in kilobytes. + + getfenv + + arguments + + + target + + tooltip + Optional function or stack index to get the environment table for. + type + (function | number)? + + + + energy + 10 + return + table + sleep + 0 + tooltip + Returns the environment table for the specified function or stack index. + + getmetatable + + arguments + + + obj + + tooltip + The object to get the metatable for. + type + any + + + + energy + 10 + return + table? + sleep + 0 + tooltip + Returns the metatable for the specified object. + + next + + arguments + + + t + + tooltip + The table to traverse. + type + table + + + + i + + tooltip + Optional key to start traversal after. + type + any? + + + + energy + 10 + return + (any, any)? + sleep + 0 + tooltip + Returns the next key-value pair in the table traversal order. + + newproxy + + arguments + + + mt + + tooltip + Optional boolean to create a modifiable metatable. + type + boolean? + + + + energy + 10 + return + userdata + sleep + 0 + tooltip + Creates a new untyped userdata object with an optional metatable. + + print + + arguments + + + args + + tooltip + Arguments to print to standard output. + type + ...any + + + + energy + 10 + return + void + sleep + 0 + tooltip + Prints all arguments to standard output using Tab as a separator. + + rawequal + + arguments + + + a + + tooltip + First object to compare. + type + any + + + + b + + tooltip + Second object to compare. + type + any + + + + energy + 10 + return + boolean + sleep + 0 + tooltip + Returns true if a and b have the same type and value. + + rawget + + arguments + + + t + + tooltip + The table to perform the lookup on. + type + table + + + + k + + tooltip + The key to look up in the table. + type + any + + + + energy + 10 + return + any? + sleep + 0 + tooltip + Performs a table lookup bypassing metatables. + + rawset + + arguments + + + t + + tooltip + The table to assign the value to. + type + table + + + + k + + tooltip + The key to assign the value to. + type + any + + + + v + + tooltip + The value to assign. + type + any + + + + energy + 10 + return + void + sleep + 0 + tooltip + Assigns a value to a table field bypassing metatables. + + select + + arguments + + + i + + tooltip + The index or '#' to count arguments. + type + string | number + + + + args + + tooltip + The arguments to select from. + type + ...any + + + + energy + 10 + return + any + sleep + 0 + tooltip + Returns a subset of arguments or the number of arguments. + + setfenv + + arguments + + + target + + tooltip + The function or stack index to set the environment for. + type + function | number + + + + env + + tooltip + The environment table to set. + type + table + + + + energy + 10 + return + void + sleep + 0 + tooltip + Changes the environment table for the specified function or stack index. + + setmetatable + + arguments + + + t + + tooltip + The table to set the metatable for. + type + table + + + + mt + + tooltip + The metatable to set. + type + table? + + + + energy + 10 + return + void + sleep + 0 + tooltip + Changes the metatable for the given table. + + tonumber + + arguments + + + s + + tooltip + The string to convert to a number. + type + string + + + + base + + tooltip + Optional base for the conversion. + type + number? + + + + energy + 10 + return + number? + sleep + 0 + tooltip + Converts the input string to a number in the specified base. + + tostring + + arguments + + + obj + + tooltip + The object to convert to a string. + type + any + + + + energy + 10 + return + string + sleep + 0 + tooltip + Converts the input object to a string. + + type + + arguments + + + obj + + tooltip + The object to get the type of. + type + any + + + + energy + 10 + return + string + sleep + 0 + tooltip + Returns the type of the object as a string. + + typeof + + arguments + + + obj + + tooltip + The object to get the type of. + type + any + + + + energy + 10 + return + string + sleep + 0 + tooltip + Returns the type of the object, including custom userdata types. + + ipairs + + arguments + + + t + + tooltip + The table to iterate over. + type + table + + + + energy + 10 + return + iterator + sleep + 0 + tooltip + Returns an iterator for numeric key-value pairs in the table. + + pairs + + arguments + + + t + + tooltip + The table to iterate over. + type + table + + + + energy + 10 + return + iterator + sleep + 0 + tooltip + Returns an iterator for all key-value pairs in the table. + + pcall + + arguments + + + f + + tooltip + A function to be called. + type + function + + + + args + + tooltip + Arguments to pass to the function. + type + variadic + + + + energy + 10 + return + boolean, variadic + sleep + 0 + tooltip + Calls function f with parameters args, returning success and function results or an error. + + xpcall + + arguments + + + f + + tooltip + A function to be called. + type + function + + + + e + + tooltip + Error handler function. + type + function + + + + args + + tooltip + Arguments to pass to the function. + type + variadic + + + + energy + 10 + return + boolean, variadic + sleep + 0 + tooltip + Calls function f with parameters args, handling errors with e if they occur. + + unpack + + arguments + + + a + + tooltip + Array from which to extract values. + type + array + + + + f + + tooltip + Starting index (optional, defaults to 1). + type + number + + + + t + + tooltip + Ending index (optional, defaults to #a). + type + number + + + + energy + 10 + return + variadic + sleep + 0 + tooltip + Returns values from an array in the specified index range. + + + math + + energy + -1.0 + tooltip + math namespace. + + math.abs + + arguments + + + n + + tooltip + A number. + type + number + + + + energy + 10 + return + number + sleep + 0 + tooltip + Returns the absolute value of n. + + math.acos + + arguments + + + n + + tooltip + A number in the range [-1, 1]. + type + number + + + + energy + 10 + return + number + sleep + 0 + tooltip + Returns the arc cosine of n in radians. + + math.asin + + arguments + + + n + + tooltip + A number in the range [-1, 1]. + type + number + + + + energy + 10 + return + number + sleep + 0 + tooltip + Returns the arc sine of n in radians. + + math.atan2 + + arguments + + + y + + tooltip + The y-coordinate. + type + number + + + + x + + tooltip + The x-coordinate. + type + number + + + + energy + 10 + return + number + sleep + 0 + tooltip + Returns the arc tangent of y/x in radians. + + math.atan + + arguments + + + n + + tooltip + A number. + type + number + + + + energy + 10 + return + number + sleep + 0 + tooltip + Returns the arc tangent of n in radians. + + math.ceil + + arguments + + + n + + tooltip + A number. + type + number + + + + energy + 10 + return + number + sleep + 0 + tooltip + Rounds n upwards to the next integer boundary. + + math.cosh + + arguments + + + n + + tooltip + A number to compute the hyperbolic cosine of. + type + number + + + + energy + 10 + return + number + sleep + 0 + tooltip + Returns the hyperbolic cosine of n. + + math.cos + + arguments + + + n + + tooltip + An angle in radians. + type + number + + + + energy + 10 + return + number + sleep + 0 + tooltip + Returns the cosine of n. + + math.deg + + arguments + + + n + + tooltip + A value in radians. + type + number + + + + energy + 10 + return + number + sleep + 0 + tooltip + Converts n from radians to degrees. + + math.exp + + arguments + + + n + + tooltip + A number to compute e^n. + type + number + + + + energy + 10 + return + number + sleep + 0 + tooltip + Returns the base-e exponent of n. + + math.floor + + arguments + + + n + + tooltip + A number to round down. + type + number + + + + energy + 10 + return + number + sleep + 0 + tooltip + Rounds n down to the previous integer. + + math.fmod + + arguments + + + x + + tooltip + The dividend. + type + number + + + + y + + tooltip + The divisor. + type + number + + + + energy + 10 + return + number + sleep + 0 + tooltip + Returns the remainder of x modulo y, rounded towards zero. + + math.frexp + + arguments + + + n + + tooltip + A number to split into significand and exponent. + type + number + + + + energy + 10 + return + array + sleep + 0 + tooltip + Splits n into a significand and exponent. + + math.ldexp + + arguments + + + s + + tooltip + The significand. + type + number + + + + e + + tooltip + The exponent. + type + number + + + + energy + 10 + return + number + sleep + 0 + tooltip + Returns s * 2^e. + + math.lerp + + arguments + + + a + + tooltip + Start value. + type + number + + + + b + + tooltip + End value. + type + number + + + + t + + tooltip + Interpolation factor. + type + number + + + + energy + 10 + return + number + sleep + 0 + tooltip + Linearly interpolates between a and b using factor t. + + math.log10 + + arguments + + + n + + tooltip + A number to compute base-10 logarithm. + type + number + + + + energy + 10 + return + number + sleep + 0 + tooltip + Returns base-10 logarithm of n. + + math.log + + arguments + + + n + + tooltip + A number to compute logarithm. + type + number + + + + base + + tooltip + Base of the logarithm (default is e). + type + number + + + + energy + 10 + return + number + sleep + 0 + tooltip + Returns logarithm of n in the given base. + + math.max + + arguments + + + list + + tooltip + A list of numbers to find the maximum from. + type + array + + + + energy + 10 + return + number + sleep + 0 + tooltip + Returns the maximum value in the given list. + + math.min + + arguments + + + list + + tooltip + A list of numbers to find the minimum from. + type + array + + + + energy + 10 + return + number + sleep + 0 + tooltip + Returns the minimum value in the given list. + + math.modf + + arguments + + + n + + tooltip + A number to split into integer and fractional parts. + type + number + + + + energy + 10 + return + array + sleep + 0 + tooltip + Returns the integer and fractional parts of n. + + math.pow + + arguments + + + x + + tooltip + Base value. + type + number + + + + y + + tooltip + Exponent value. + type + number + + + + energy + 10 + return + number + sleep + 0 + tooltip + Returns x raised to the power of y. + + math.rad + + arguments + + + n + + tooltip + A value in degrees. + type + number + + + + energy + 10 + return + number + sleep + 0 + tooltip + Converts n from degrees to radians. + + math.random + + arguments + + + min + + tooltip + Minimum value of the range (optional). + type + number + + + + max + + tooltip + Maximum value of the range (optional). + type + number + + + + energy + 10 + return + number + sleep + 0 + tooltip + Returns a random number within the given range. + + math.randomseed + + arguments + + + seed + + tooltip + Seed for the random number generator. + type + number + + + + energy + 10 + return + void + sleep + 0 + tooltip + Sets the seed for the random number generator. + + math.sinh + + arguments + + + n + + tooltip + A number to compute the hyperbolic sine of. + type + number + + + + energy + 10 + return + number + sleep + 0 + tooltip + Returns the hyperbolic sine of n. + + math.sin + + arguments + + + n + + tooltip + An angle in radians. + type + number + + + + energy + 10 + return + number + sleep + 0 + tooltip + Returns the sine of n. + + math.sqrt + + arguments + + + n + + tooltip + A number to compute the square root of. + type + number + + + + energy + 10 + return + number + sleep + 0 + tooltip + Returns the square root of n. + + math.tanh + + arguments + + + n + + tooltip + A number to compute the hyperbolic tangent of. + type + number + + + + energy + 10 + return + number + sleep + 0 + tooltip + Returns the hyperbolic tangent of n. + + math.tan + + arguments + + + n + + tooltip + An angle in radians. + type + number + + + + energy + 10 + return + number + sleep + 0 + tooltip + Returns the tangent of n. + + math.noise + + arguments + + + x + + tooltip + X coordinate for the noise function. + type + number + + + + y + + tooltip + Y coordinate for the noise function (optional). + type + number + + + + z + + tooltip + Z coordinate for the noise function (optional). + type + number + + + + energy + 10 + return + number + sleep + 0 + tooltip + Returns Perlin noise value for the point (x, y, z). + + math.clamp + + arguments + + + n + + tooltip + The value to be clamped. + type + number + + + + min + + tooltip + Minimum allowable value. + type + number + + + + max + + tooltip + Maximum allowable value. + type + number + + + + energy + 10 + return + number + sleep + 0 + tooltip + Returns n clamped between min and max. + + math.sign + + arguments + + + n + + tooltip + A number to get the sign of. + type + number + + + + energy + 10 + return + number + sleep + 0 + tooltip + Returns -1 if n is negative, 1 if positive, and 0 if zero. + + math.round + + arguments + + + n + + tooltip + A number to round to the nearest integer. + type + number + + + + energy + 10 + return + number + sleep + 0 + tooltip + Rounds n to the nearest integer. + + + table + + energy + -1.0 + tooltip + table namespace. + + table.concat + + arguments + + + a + + tooltip + Array of strings. + type + array + + + + sep + + tooltip + Separator string. + type + string + + + + f + + tooltip + Starting index. + type + integer + + + + t + + tooltip + Ending index. + type + integer + + + + energy + 10 + return + string + sleep + 0 + tooltip + Concatenates elements of an array with an optional separator. + + table.foreach + + arguments + + + t + + tooltip + Table to iterate over. + type + table + + + + f + + tooltip + Function applied to each key-value pair. + type + function + + + + energy + 10 + return + various + sleep + 0 + tooltip + Iterates over all key-value pairs in a table. + + table.getn + + arguments + + + t + + tooltip + Table whose length is determined. + type + table + + + + energy + 10 + return + integer + sleep + 0 + tooltip + Returns the number of elements in a table. + + table.maxn + + arguments + + + t + + tooltip + Table to search for the maximum numeric key. + type + table + + + + energy + 10 + return + integer + sleep + 0 + tooltip + Returns the highest numeric key in a table. + + table.insert + + arguments + + + t + + tooltip + Table to insert into. + type + table + + + + i + + tooltip + Position to insert at. + type + integer + + + + v + + tooltip + Value to insert. + type + various + + + + energy + 10 + return + void + sleep + 0 + tooltip + Inserts a value at a specific index in a table. + + table.remove + + arguments + + + t + + tooltip + Table to remove from. + type + table + + + + i + + tooltip + Position to remove. + type + integer + + + + energy + 10 + return + various + sleep + 0 + tooltip + Removes an element from a table at a given index. + + table.sort + + arguments + + + t + + tooltip + Table to be sorted. + type + table + + + + f + + tooltip + Comparison function. + type + function + + + + energy + 10 + return + void + sleep + 0 + tooltip + Sorts a table in ascending order. + + table.pack + + arguments + + + args + + tooltip + Variable arguments. + type + varargs + + + + energy + 10 + return + table + sleep + 0 + tooltip + Packs multiple arguments into a table. + + table.unpack + + arguments + + + a + + tooltip + Table to unpack. + type + table + + + + f + + tooltip + Starting index. + type + integer + + + + t + + tooltip + Ending index. + type + integer + + + + energy + 10 + return + varargs + sleep + 0 + tooltip + Returns unpacked values from a table within a specified range. + + table.move + + arguments + + + a + + tooltip + Source table. + type + table + + + + f + + tooltip + Starting index. + type + integer + + + + t + + tooltip + Ending index. + type + integer + + + + d + + tooltip + Destination index. + type + integer + + + + tt + + tooltip + Optional target table. + type + table + + + + energy + 10 + return + table + sleep + 0 + tooltip + Moves elements from one table to another or within the same table. + + table.create + + arguments + + + n + + tooltip + Number of elements. + type + integer + + + + v + + tooltip + Value to prefill elements with. + type + various + + + + energy + 10 + return + table + sleep + 0 + tooltip + Creates a table with preallocated elements. + + table.find + + arguments + + + t + + tooltip + Table to search in. + type + table + + + + v + + tooltip + Value to find. + type + various + + + + init + + tooltip + Starting index for search. + type + integer + + + + energy + 10 + return + integer + sleep + 0 + tooltip + Finds the first occurrence of a value in a table and returns its index. + + table.clear + + arguments + + + t + + tooltip + Table to clear. + type + table + + + + energy + 10 + return + void + sleep + 0 + tooltip + Clears all elements from a table while keeping its capacity. + + table.freeze + + arguments + + + t + + tooltip + Table to freeze. + type + table + + + + energy + 10 + return + table + sleep + 0 + tooltip + Freezes a table, preventing modifications. + + table.isfrozen + + arguments + + + t + + tooltip + Table to check. + type + table + + + + energy + 10 + return + boolean + sleep + 0 + tooltip + Returns true if a table is frozen. + + table.clone + + arguments + + + t + + tooltip + Table to clone. + type + table + + + + energy + 10 + return + table + sleep + 0 + tooltip + Creates a shallow copy of a table. + + + string + + energy + -1.0 + tooltip + string namespace. + + string.byte + + arguments + + + s + + tooltip + Input string. + type + string + + + + f + + tooltip + Starting index (optional). + type + number + + + + t + + tooltip + Ending index (optional). + type + number + + + + energy + 10 + return + number... + sleep + 0 + tooltip + Returns the numeric code of every byte in the input string within the given range. + + string.char + + arguments + + + args + + tooltip + Byte values to convert to string. + type + number... + + + + energy + 10 + return + string + sleep + 0 + tooltip + Returns a string containing characters for the given byte values. + + string.find + + arguments + + + s + + tooltip + Input string. + type + string + + + + p + + tooltip + Pattern to search for. + type + string + + + + init + + tooltip + Starting position (optional). + type + number + + + + plain + + tooltip + Perform raw search (optional). + type + boolean + + + + energy + 10 + return + number?, number?, string... + sleep + 0 + tooltip + Finds an instance of the pattern in the string. + + string.format + + arguments + + + s + + tooltip + Format string. + type + string + + + + args + + tooltip + Values to format. + type + any... + + + + energy + 10 + return + string + sleep + 0 + tooltip + Formats input values into a string using printf-style format specifiers. + + string.len + + arguments + + + s + + tooltip + Input string. + type + string + + + + energy + 10 + return + number + sleep + 0 + tooltip + Returns the number of bytes in the string. + + string.lower + + arguments + + + s + + tooltip + Input string. + type + string + + + + energy + 10 + return + string + sleep + 0 + tooltip + Returns a lowercase version of the input string. + + string.upper + + arguments + + + s + + tooltip + Input string. + type + string + + + + energy + 10 + return + string + sleep + 0 + tooltip + Returns an uppercase version of the input string. + + string.match + + arguments + + + s + + tooltip + Input string. + type + string + + + + p + + tooltip + Pattern to match. + type + string + + + + init + + tooltip + Starting position (optional). + type + number + + + + energy + 10 + return + string... + sleep + 0 + tooltip + Finds and returns matches for a pattern in the input string. + + string.rep + + arguments + + + s + + tooltip + Input string. + type + string + + + + n + + tooltip + Number of times to repeat the string. + type + number + + + + energy + 10 + return + string + sleep + 0 + tooltip + Returns the input string repeated a given number of times. + + string.reverse + + arguments + + + s + + tooltip + Input string. + type + string + + + + energy + 10 + return + string + sleep + 0 + tooltip + Returns the input string with bytes in reverse order. + + string.sub + + arguments + + + s + + tooltip + Input string. + type + string + + + + f + + tooltip + Start index. + type + number + + + + t + + tooltip + End index (optional). + type + number + + + + energy + 10 + return + string + sleep + 0 + tooltip + Returns a substring from the given range. + + string.gsub + + arguments + + + s + + tooltip + Input string. + type + string + + + + p + + tooltip + Pattern to replace. + type + string + + + + f + + tooltip + Replacement string, function, or table. + type + function | table | string + + + + maxs + + tooltip + Maximum replacements (optional). + type + number + + + + energy + 10 + return + string, number + sleep + 0 + tooltip + Performs pattern-based substitution in a string. + + string.pack + + arguments + + + f + + tooltip + Pack format string. + type + string + + + + args + + tooltip + Values to encode. + type + any... + + + + energy + 10 + return + string + sleep + 0 + tooltip + Packs values into a binary string. + + string.unpack + + arguments + + + f + + tooltip + Pack format string. + type + string + + + + s + + tooltip + Encoded string. + type + string + + + + energy + 10 + return + any... + sleep + 0 + tooltip + Decodes a binary string using a pack format. + + + coroutine + + energy + -1.0 + tooltip + coroutine namespace. + + coroutine.create + + arguments + + + f + + tooltip + A function to be executed by the new coroutine. + type + function + + + + energy + 10 + return + thread + sleep + 0 + tooltip + Returns a new coroutine that, when resumed, will run function f. + + coroutine.running + + arguments + + energy + 10 + return + thread? + sleep + 0 + tooltip + Returns the currently running coroutine, or nil if running in the main coroutine. + + coroutine.status + + arguments + + + co + + tooltip + The coroutine to check status of. + type + thread + + + + energy + 10 + return + string + sleep + 0 + tooltip + Returns the status of the coroutine: "running", "suspended", "normal", or "dead". + + coroutine.wrap + + arguments + + + f + + tooltip + A function to execute in a coroutine. + type + function + + + + energy + 10 + return + function + sleep + 0 + tooltip + Creates a coroutine and returns a function that resumes it. + + coroutine.yield + + arguments + + + args + + tooltip + Values to pass to the resuming code. + type + variadic + + + + energy + 10 + return + variadic + sleep + 0 + tooltip + Yields the current coroutine, passing arguments to the resuming code. + + coroutine.isyieldable + + arguments + + energy + 10 + return + boolean + sleep + 0 + tooltip + Returns true if the coroutine can yield. + + coroutine.resume + + arguments + + + co + + tooltip + The coroutine to resume. + type + thread + + + + args + + tooltip + Arguments to pass to the coroutine. + type + variadic + + + + energy + 10 + return + (boolean, variadic) + sleep + 0 + tooltip + Resumes a coroutine, returning true and results if successful, or false and an error. + + coroutine.close + + arguments + + + co + + tooltip + The coroutine to close. + type + thread + + + + energy + 10 + return + (boolean, any?) + sleep + 0 + tooltip + Closes a coroutine, returning true if successful or false and an error. + + + bit32 + + energy + -1.0 + tooltip + bit32 library functions. + + bit32.arshift + + arguments + + + n + + tooltip + Number to shift. + type + number + + + + i + + tooltip + Number of bits to shift. + type + number + + + + energy + 10 + return + number + sleep + 0 + tooltip + Shifts n by i bits to the right. If i is negative, a left shift is performed. + + bit32.band + + arguments + + + args + + tooltip + Numbers to perform bitwise AND on. + type + array + + + + energy + 10 + return + number + sleep + 0 + tooltip + Performs a bitwise AND operation on input numbers. + + bit32.bnot + + arguments + + + n + + tooltip + Number to negate. + type + number + + + + energy + 10 + return + number + sleep + 0 + tooltip + Returns the bitwise negation of the input number. + + utf8 + + energy + -1.0 + tooltip + UTF-8 library functions. + + utf8.offset + + arguments + + + s + + tooltip + Input string. + type + string + + + + n + + tooltip + Character position. + type + number + + + + i + + tooltip + Starting position (optional). + type + number + + + + energy + 10 + return + number + sleep + 0 + tooltip + Returns the byte offset of the nth Unicode codepoint in string s. + + utf8.char + + arguments + + + args + + tooltip + Unicode codepoints. + type + array + + + + energy + 10 + return + string + sleep + 0 + tooltip + Creates a string from Unicode codepoints. + + utf8.codepoint + + arguments + + + s + + tooltip + Input string. + type + string + + + + i + + tooltip + Starting position (optional). + type + number + + + + j + + tooltip + Ending position (optional). + type + number + + + + energy + 10 + return + array + sleep + 0 + tooltip + Returns the Unicode codepoints in the specified range of string s. + + utf8.len + + arguments + + + s + + tooltip + Input string. + type + string + + + + i + + tooltip + Starting position (optional). + type + number + + + + j + + tooltip + Ending position (optional). + type + number + + + + energy + 10 + return + number + sleep + 0 + tooltip + Returns the number of Unicode codepoints in the specified range of string s. + + utf8.codes + + arguments + + + s + + tooltip + Input string. + type + string + + + + energy + 10 + return + iterator + sleep + 0 + tooltip + Returns an iterator that produces the byte offset and Unicode codepoint for each character in string s. + + + os + + energy + -1.0 + tooltip + os namespace. + + os.clock + + arguments + + energy + 10 + return + number + sleep + 0 + tooltip + Returns a high-precision timestamp in seconds for measuring durations. + + os.date + + arguments + + + s + + tooltip + Optional format string for the date representation. + type + string + + + + t + + tooltip + Optional timestamp to format; defaults to the current time. + type + number + + + + energy + 10 + return + table|string + sleep + 0 + tooltip + Returns a table or string representation of the time based on the provided format. + + os.difftime + + arguments + + + a + + tooltip + First timestamp value. + type + number + + + + b + + tooltip + Second timestamp value. + type + number + + + + energy + 10 + return + number + sleep + 0 + tooltip + Returns the difference in seconds between two timestamps. + + os.time + + arguments + + + t + + tooltip + Optional table with date/time fields; returns the corresponding Unix timestamp. + type + table + + + + energy + 10 + return + number + sleep + 0 + tooltip + Returns the current Unix timestamp or the timestamp of the given date. + + + debug + + energy + -1.0 + tooltip + debug namespace. + + debug.info + + arguments + + + co + + tooltip + Optional thread or function reference. + type + thread|function|number + + + + level + + tooltip + Stack level or function reference for inspection. + type + number + + + + s + + tooltip + String specifying requested information. + type + string + + + + energy + 10 + return + any + sleep + 0 + tooltip + Returns information about a stack frame or function based on specified format. + + debug.traceback + + arguments + + + co + + tooltip + Optional thread reference for traceback. + type + thread + + + + msg + + tooltip + Optional message prepended to the traceback. + type + string + + + + level + + tooltip + Optional stack level to start traceback. + type + number + + + + energy + 10 + return + string + sleep + 0 + tooltip + Returns a human-readable call stack starting from the specified level. + + debug.getinfo + + arguments + + + thread + + tooltip + Optional thread whose stack frame is being inspected. + type + thread + + + + function + + tooltip + Function reference or stack level number. + type + function|number + + + + what + + tooltip + String specifying which fields to retrieve. + type + string + + + + energy + 10 + return + table + sleep + 0 + tooltip + Returns a table containing debug information about a function or stack frame. + + debug.getlocal + + arguments + + + level + + tooltip + Stack level number. + type + number + + + + index + + tooltip + Index of the local variable. + type + number + + + + energy + 10 + return + string|any + sleep + 0 + tooltip + Returns the name and value of a local variable at the specified stack level. + + debug.setlocal + + arguments + + + level + + tooltip + Stack level number. + type + number + + + + index + + tooltip + Index of the local variable. + type + number + + + + value + + tooltip + New value for the local variable. + type + any + + + + energy + 10 + return + boolean + sleep + 0 + tooltip + Sets the value of a local variable at the specified stack level. + + debug.getupvalue + + arguments + + + function + + tooltip + Function whose upvalues are being retrieved. + type + function + + + + index + + tooltip + Index of the upvalue. + type + number + + + + energy + 10 + return + string|any + sleep + 0 + tooltip + Returns the name and value of an upvalue for a given function. + + debug.setupvalue + + arguments + + + function + + tooltip + Function whose upvalues are being modified. + type + function + + + + index + + tooltip + Index of the upvalue. + type + number + + + + value + + tooltip + New value for the upvalue. + type + any + + + + energy + 10 + return + string + sleep + 0 + tooltip + Sets the value of an upvalue for a given function. + + debug.getmetatable + + arguments + + + value + + tooltip + Value whose metatable is retrieved. + type + any + + + + energy + 10 + return + table|nil + sleep + 0 + tooltip + Returns the metatable of the given value, if any. + + debug.setmetatable + + arguments + + + value + + tooltip + Value whose metatable is to be set. + type + any + + + + metatable + + tooltip + Table to be set as the new metatable. + type + table|nil + + + + energy + 10 + return + any + sleep + 0 + tooltip + Sets the metatable for a given value. + + + buffer + + energy + -1.0 + tooltip + buffer namespace. + + buffer.create + + arguments + + + size + + tooltip + Size of the buffer to create. + type + number + + + + energy + 10 + return + buffer + sleep + 0 + tooltip + Creates a buffer of the requested size with all bytes initialized to 0. + + buffer.fromstring + + arguments + + + str + + tooltip + String to initialize the buffer with. + type + string + + + + energy + 10 + return + buffer + sleep + 0 + tooltip + Creates a buffer initialized to the contents of the string. + + buffer.tostring + + arguments + + + b + + tooltip + Buffer to convert to a string. + type + buffer + + + + energy + 10 + return + string + sleep + 0 + tooltip + Returns the buffer data as a string. + + buffer.len + + arguments + + + b + + tooltip + Buffer to get the size of. + type + buffer + + + + energy + 10 + return + number + sleep + 0 + tooltip + Returns the size of the buffer in bytes. + + buffer.readi8 + + arguments + + + b + + tooltip + Buffer to read from. + type + buffer + + + + offset + + tooltip + Byte offset to read from. + type + number + + + + energy + 10 + return + number + sleep + 0 + tooltip + Reads a signed 8-bit integer from the buffer at the given offset. + + buffer.writei8 + + arguments + + + b + + tooltip + Buffer to write to. + type + buffer + + + + offset + + tooltip + Byte offset to write at. + type + number + + + + value + + tooltip + Value to write. + type + number + + + + energy + 10 + return + void + sleep + 0 + tooltip + Writes a signed 8-bit integer to the buffer at the given offset. + + buffer.readstring + + arguments + + + b + + tooltip + Buffer to read from. + type + buffer + + + + offset + + tooltip + Byte offset to start reading. + type + number + + + + count + + tooltip + Number of bytes to read. + type + number + + + + energy + 10 + return + string + sleep + 0 + tooltip + Reads a string of the given length from the buffer at the specified offset. + + buffer.copy + + arguments + + + target + + tooltip + Target buffer to copy into. + type + buffer + + + + targetOffset + + tooltip + Offset in target buffer. + type + number + + + + source + + tooltip + Source buffer to copy from. + type + buffer + + + + sourceOffset + + tooltip + Offset in source buffer (optional). + type + number + + + + count + + tooltip + Number of bytes to copy (optional). + type + number + + + + energy + 10 + return + void + sleep + 0 + tooltip + Copies bytes from the source buffer into the target buffer. + + buffer.fill + + arguments + + + b + + tooltip + Buffer to fill. + type + buffer + + + + offset + + tooltip + Byte offset to start filling. + type + number + + + + value + + tooltip + Value to fill with. + type + number + + + + count + + tooltip + Number of bytes to fill (optional). + type + number + + + + energy + 10 + return + void + sleep + 0 + tooltip + Fills the buffer with the specified value starting at the given offset. + + buffer.readu8 + + arguments + + + b + + tooltip + Buffer to read from. + type + buffer + + + + offset + + tooltip + Byte offset to read from. + type + number + + + + energy + 10 + return + number + sleep + 0 + tooltip + Reads an unsigned 8-bit integer from the buffer at the given offset. + + buffer.writeu8 + + arguments + + + b + + tooltip + Buffer to write to. + type + buffer + + + + offset + + tooltip + Byte offset to write at. + type + number + + + + value + + tooltip + Value to write. + type + number + + + + energy + 10 + return + void + sleep + 0 + tooltip + Writes an unsigned 8-bit integer to the buffer at the given offset. + + buffer.readi16 + + arguments + + + b + + tooltip + Buffer to read from. + type + buffer + + + + offset + + tooltip + Byte offset to read from. + type + number + + + + energy + 10 + return + number + sleep + 0 + tooltip + Reads a signed 16-bit integer from the buffer at the given offset. + + buffer.writei16 + + arguments + + + b + + tooltip + Buffer to write to. + type + buffer + + + + offset + + tooltip + Byte offset to write at. + type + number + + + + value + + tooltip + Value to write. + type + number + + + + energy + 10 + return + void + sleep + 0 + tooltip + Writes a signed 16-bit integer to the buffer at the given offset. + + buffer.readf32 + + arguments + + + b + + tooltip + Buffer to read from. + type + buffer + + + + offset + + tooltip + Byte offset to read from. + type + number + + + + energy + 10 + return + number + sleep + 0 + tooltip + Reads a 32-bit floating-point number from the buffer at the given offset. + + buffer.writef32 + + arguments + + + b + + tooltip + Buffer to write to. + type + buffer + + + + offset + + tooltip + Byte offset to write at. + type + number + + + + value + + tooltip + Value to write. + type + number + + + + energy + 10 + return + void + sleep + 0 + tooltip + Writes a 32-bit floating-point number to the buffer at the given offset. + + buffer.readf64 + + arguments + + + b + + tooltip + Buffer to read from. + type + buffer + + + + offset + + tooltip + Byte offset to read from. + type + number + + + + energy + 10 + return + number + sleep + 0 + tooltip + Reads a 64-bit floating-point number from the buffer at the given offset. + + buffer.writef64 + + arguments + + + b + + tooltip + Buffer to write to. + type + buffer + + + + offset + + tooltip + Byte offset to write at. + type + number + + + + value + + tooltip + Value to write. + type + number + + + + energy + 10 + return + void + sleep + 0 + tooltip + Writes a 64-bit floating-point number to the buffer at the given offset. + + buffer.readu16 + + arguments + + + b + + tooltip + Buffer to read from. + type + buffer + + + + offset + + tooltip + Byte offset to read from. + type + number + + + + energy + 10 + return + number + sleep + 0 + tooltip + Reads an unsigned 16-bit integer from the buffer at the given offset. + + buffer.writeu16 + + arguments + + + b + + tooltip + Buffer to write to. + type + buffer + + + + offset + + tooltip + Byte offset to write at. + type + number + + + + value + + tooltip + Value to write. + type + number + + + + energy + 10 + return + void + sleep + 0 + tooltip + Writes an unsigned 16-bit integer to the buffer at the given offset. + + buffer.readi32 + + arguments + + + b + + tooltip + Buffer to read from. + type + buffer + + + + offset + + tooltip + Byte offset to read from. + type + number + + + + energy + 10 + return + number + sleep + 0 + tooltip + Reads a signed 32-bit integer from the buffer at the given offset. + + buffer.writei32 + + arguments + + + b + + tooltip + Buffer to write to. + type + buffer + + + + offset + + tooltip + Byte offset to write at. + type + number + + + + value + + tooltip + Value to write. + type + number + + + + energy + 10 + return + void + sleep + 0 + tooltip + Writes a signed 32-bit integer to the buffer at the given offset. + + buffer.readu32 + + arguments + + + b + + tooltip + Buffer to read from. + type + buffer + + + + offset + + tooltip + Byte offset to read from. + type + number + + + + energy + 10 + return + number + sleep + 0 + tooltip + Reads an unsigned 32-bit integer from the buffer at the given offset. + + buffer.writeu32 + + arguments + + + b + + tooltip + Buffer to write to. + type + buffer + + + + offset + + tooltip + Byte offset to write at. + type + number + + + + value + + tooltip + Value to write. + type + number + + + + energy + 10 + return + void + sleep + 0 + tooltip + Writes an unsigned 32-bit integer to the buffer at the given offset. + + buffer.readstring + + arguments + + + b + + tooltip + Buffer to read from. + type + buffer + + + + offset + + tooltip + Byte offset to start reading. + type + number + + + + count + + tooltip + Number of bytes to read. + type + number + + + + energy + 10 + return + string + sleep + 0 + tooltip + Reads a string of the given length from the buffer at the specified offset. + + buffer.writestring + + arguments + + + b + + tooltip + Buffer to write to. + type + buffer + + + + offset + + tooltip + Byte offset to write at. + type + number + + + + value + + tooltip + String to write. + type + string + + + + count + + tooltip + Number of bytes to write (optional). + type + number + + + + energy + 10 + return + void + sleep + 0 + tooltip + Writes data from a string into the buffer at the specified offset. + + buffer.copy + + arguments + + + target + + tooltip + Target buffer to copy into. + type + buffer + + + + targetOffset + + tooltip + Offset in target buffer. + type + number + + + + source + + tooltip + Source buffer to copy from. + type + buffer + + + + sourceOffset + + tooltip + Offset in source buffer (optional). + type + number + + + + count + + tooltip + Number of bytes to copy (optional). + type + number + + + + energy + 10 + return + void + sleep + 0 + tooltip + Copies bytes from the source buffer into the target buffer. + + + vector + + energy + -1.0 + tooltip + vector namespace. + + vector.zero + + energy + 10 + return + vector + sleep + 0 + tooltip + Constant vector with all components set to 0. + + vector.one + + energy + 10 + return + vector + sleep + 0 + tooltip + Constant vector with all components set to 1. + + vector.create + + arguments + + + x + + tooltip + X component of the vector. + type + number + + + + y + + tooltip + Y component of the vector. + type + number + + + + z + + tooltip + Z component of the vector. + type + number + + + + w + + tooltip + W component of the vector (optional, defaults to 0 in 4-wide mode). + type + number + + + + energy + 10 + return + vector + sleep + 0 + tooltip + Creates a new vector with the given component values. + + vector.magnitude + + arguments + + + vec + + tooltip + Input vector. + type + vector + + + + energy + 10 + return + number + sleep + 0 + tooltip + Calculates the magnitude of a given vector. + + vector.normalize + + arguments + + + vec + + tooltip + Input vector. + type + vector + + + + energy + 10 + return + vector + sleep + 0 + tooltip + Computes the unit vector of a given vector. + + vector.cross + + arguments + + + vec1 + + tooltip + First input vector. + type + vector + + + + vec2 + + tooltip + Second input vector. + type + vector + + + + energy + 10 + return + vector + sleep + 0 + tooltip + Computes the cross product of two vectors. + + vector.dot + + arguments + + + vec1 + + tooltip + First input vector. + type + vector + + + + vec2 + + tooltip + Second input vector. + type + vector + + + + energy + 10 + return + number + sleep + 0 + tooltip + Computes the dot product of two vectors. + + vector.angle + + arguments + + + vec1 + + tooltip + First input vector. + type + vector + + + + vec2 + + tooltip + Second input vector. + type + vector + + + + axis + + tooltip + Axis to determine the sign of the angle (optional). + type + vector + + + + energy + 10 + return + number + sleep + 0 + tooltip + Computes the angle between two vectors in radians. + + vector.floor + + arguments + + + vec + + tooltip + Input vector. + type + vector + + + + energy + 10 + return + vector + sleep + 0 + tooltip + Applies math.floor to each component of the vector. + + vector.ceil + + arguments + + + vec + + tooltip + Input vector. + type + vector + + + + energy + 10 + return + vector + sleep + 0 + tooltip + Applies math.ceil to each component of the vector. + + vector.abs + + arguments + + + vec + + tooltip + Input vector. + type + vector + + + + energy + 10 + return + vector + sleep + 0 + tooltip + Applies math.abs to each component of the vector. + + vector.sign + + arguments + + + vec + + tooltip + Input vector. + type + vector + + + + energy + 10 + return + vector + sleep + 0 + tooltip + Applies math.sign to each component of the vector. + + vector.clamp + + arguments + + + vec + + tooltip + Input vector to be clamped. + type + vector + + + + min + + tooltip + Minimum vector value. + type + vector + + + + max + + tooltip + Maximum vector value. + type + vector + + + + energy + 10 + return + vector + sleep + 0 + tooltip + Clamps each component of the vector between min and max values. + + vector.max + + arguments + + + vectors + + tooltip + Multiple input vectors. + type + array of vector + + + + energy + 10 + return + vector + sleep + 0 + tooltip + Computes the component-wise maximum of multiple vectors. + + vector.min + + arguments + + + vectors + + tooltip + Multiple input vectors. + type + array of vector + + + + energy + 10 + return + vector + sleep + 0 + tooltip + Computes the component-wise minimum of multiple vectors. + + ll + + + energy + -1.0 + tooltip + ll namespace. + + ll.Abs + + arguments + + + Value + + tooltip + An integer value. + type + integer + + + + energy + 10 + return + integer + sleep + 0 + tooltip + Returns the absolute (positive) version of Value. + + ll.Acos + + arguments + + + Value + + tooltip + A floating-point value. + type + float + + + + energy + 10 + return + float + sleep + 0 + tooltip + Returns the arc-cosine of Value, in radians. + + ll.AddToLandBanList + + arguments + + + ID + + tooltip + Agent UUID to add to ban-list. + type + key + + + + Hours + + tooltip + Period, in hours, to ban the avatar for. + type + float + + + + energy + 10 + return + void + sleep + 0.1000000000000000055511151 + tooltip + Add avatar ID to the parcel ban list for the specified number of Hours.\nA value of 0 for Hours will add the agent indefinitely.\nThe smallest value that Hours will accept is 0.01; anything smaller will be seen as 0.\nWhen values that small are used, it seems the function bans in approximately 30 second increments (Probably 36 second increments, as 0.01 of an hour is 36 seconds).\nResidents teleporting to a parcel where they are banned will be redirected to a neighbouring parcel. + + ll.AddToLandPassList + + arguments + + + ID + + tooltip + Agent UUID to add to pass-list. + type + key + + + + Hours + + tooltip + Period, in hours, to allow the avatar for. + type + float + + + + energy + 10 + return + void + sleep + 0.1000000000000000055511151 + tooltip + Add avatar ID to the land pass list, for a duration of Hours. + + ll.AdjustDamage + + arguments + + + Number + + tooltip + Damage event index to modify. + type + integer + + + + Damage + + tooltip + New damage amount to apply on this event. + type + float + + + + energy + 10 + return + void + sleep + 0 + tooltip + Changes the amount of damage to be delivered by this damage event. + + ll.AdjustSoundVolume + + arguments + + + Volume + + tooltip + The volume to set. + type + float + + + + energy + 10 + return + void + sleep + 0.1000000000000000055511151 + tooltip + Adjusts the volume (0.0 - 1.0) of the currently playing attached sound.\nThis function has no effect on sounds started with llTriggerSound. + + ll.AgentInExperience + + arguments + + + AgentID + + tooltip + + type + key + + + + energy + 10 + return + integer + sleep + 0 + tooltip + + Returns TRUE if the agent is in the Experience and the Experience can run in the current location. + + + ll.AllowInventoryDrop + + arguments + + + Flag + + tooltip + Boolean, If TRUE allows anyone to drop inventory on prim, FALSE revokes. + type + integer + + + + energy + 10 + return + void + sleep + 0 + tooltip + If Flag == TRUE, users without object modify permissions can still drop inventory items into the object. + + ll.AngleBetween + + arguments + + + Rot1 + + tooltip + First rotation. + type + rotation + + + + Rot2 + + tooltip + Second rotation. + type + rotation + + + + energy + 10 + return + float + sleep + 0 + tooltip + Returns the angle, in radians, between rotations Rot1 and Rot2. + + ll.ApplyImpulse + + arguments + + + Force + + tooltip + Amount of impulse force to apply. + type + vector + + + + Local + + tooltip + Boolean, if TRUE, force is treated as a local directional vector instead of region directional vector. + type + integer + + + + energy + 10 + return + void + sleep + 0 + tooltip + Applies impulse to the object.\nIf Local == TRUE, apply the Force in local coordinates; otherwise, apply the Force in global coordinates.\nThis function only works on physical objects. + + ll.ApplyRotationalImpulse + + arguments + + + Force + + tooltip + Amount of impulse force to apply. + type + vector + + + + Local + + tooltip + Boolean, if TRUE, uses local axis, if FALSE, uses region axis. + type + integer + + + + energy + 10 + return + void + sleep + 0 + tooltip + Applies rotational impulse to the object.\nIf Local == TRUE, apply the Force in local coordinates; otherwise, apply the Force in global coordinates.\nThis function only works on physical objects. + + ll.Asin + + arguments + + + Value + + tooltip + A floating-point value. + type + float + + + + energy + 10 + return + float + sleep + 0 + tooltip + Returns the arc-sine, in radians, of Value. + + ll.Atan2 + + arguments + + + y + + tooltip + A floating-point value. + type + float + + + + x + + tooltip + A floating-point value. + type + float + + + + energy + 10 + return + float + sleep + 0 + tooltip + Returns the arc-tangent2 of y, x. + + ll.AttachToAvatar + + arguments + + + AttachmentPoint + + tooltip + + type + integer + + + + energy + 10 + return + void + sleep + 0 + tooltip + Attach to avatar at point AttachmentPoint.\nRequires the PERMISSION_ATTACH runtime permission. + + ll.AttachToAvatarTemp + + arguments + + + AttachPoint + + tooltip + Valid attachment point or ATTACH_* constant. + type + integer + + + + energy + 10 + return + void + sleep + 0 + tooltip + Follows the same convention as llAttachToAvatar, with the exception that the object will not create new inventory for the user, and will disappear on detach or disconnect. + + ll.AvatarOnLinkSitTarget + + arguments + + + LinkNumber + + tooltip + Link number (0: unlinked, 1: root prim, >1: child prims) or a LINK_* flag. + type + integer + + + + energy + 10 + return + key + sleep + 0 + tooltip + If an avatar is sitting on the link's sit target, return the avatar's key, NULL_KEY otherwise.\nReturns a key that is the UUID of the user seated on the specified link's prim. + + ll.AvatarOnSitTarget + + arguments + + energy + 10 + return + key + sleep + 0 + tooltip + If an avatar is seated on the sit target, returns the avatar's key, otherwise NULL_KEY.\nThis only will detect avatars sitting on sit targets defined with llSitTarget. + + ll.Axes2Rot + + arguments + + + Forward + + tooltip + Forward/Back part of rotation. + type + vector + + + + Left + + tooltip + Left/Right part of rotation. + type + vector + + + + Up + + tooltip + Up/Down part of rotation. + type + vector + + + + energy + 10 + return + rotation + sleep + 0 + tooltip + Returns the rotation represented by coordinate axes Forward, Left, and Up. + + ll.AxisAngle2Rot + + arguments + + + Axis + + tooltip + Axis. + type + vector + + + + Angle + + tooltip + Angle in radians. + type + float + + + + energy + 10 + return + rotation + sleep + 0 + tooltip + Returns the rotation that is a generated Angle about Axis. + + ll.Base64ToInteger + + arguments + + + Text + + tooltip + + type + string + + + + energy + 10 + return + integer + sleep + 0 + tooltip + Returns an integer that is the Text, Base64 decoded as a big endian integer.\nReturns zero if Text is longer then 8 characters. If Text contains fewer then 6 characters, the return value is unpredictable. + + ll.Base64ToString + + arguments + + + Text + + tooltip + + type + string + + + + energy + 10 + return + string + sleep + 0 + tooltip + Converts a Base64 string to a conventional string.\nIf the conversion creates any unprintable characters, they are converted to question marks. + + ll.BreakAllLinks + + arguments + + energy + 10 + return + void + sleep + 0 + tooltip + De-links all prims in the link set (requires permission PERMISSION_CHANGE_LINKS be set). + + ll.BreakLink + + arguments + + + LinkNumber + + tooltip + + type + integer + + + + energy + 10 + return + void + sleep + 0 + tooltip + De-links the prim with the given link number (requires permission PERMISSION_CHANGE_LINKS be set). + + ll.CSV2List + + arguments + + + Text + + tooltip + + type + string + + + + energy + 10 + return + list + sleep + 0 + tooltip + Create a list from a string of comma separated values specified in Text. + + ll.CastRay + + arguments + + + Start + + tooltip + + type + vector + + + + End + + tooltip + + type + vector + + + + Options + + tooltip + + type + list + + + + energy + 10 + return + list + sleep + 0 + tooltip + Casts a ray into the physics world from 'start' to 'end' and returns data according to details in Options.\nReports collision data for intersections with objects.\nReturn value: [UUID_1, {link_number_1}, hit_position_1, {hit_normal_1}, UUID_2, {link_number_2}, hit_position_2, {hit_normal_2}, ... , status_code] where {} indicates optional data. + + ll.Ceil + + arguments + + + Value + + tooltip + + type + float + + + + energy + 10 + return + integer + sleep + 0 + tooltip + Returns smallest integer value >= Value. + + ll.Char + + arguments + + + value + + tooltip + Unicode value to convert into a string. + type + integer + + + + energy + 10 + return + string + sleep + 0 + tooltip + Returns a single character string that is the representation of the unicode value. + + ll.ClearCameraParams + + arguments + + energy + 10 + return + void + sleep + 0 + tooltip + Resets all camera parameters to default values and turns off scripted camera control. + + ll.ClearLinkMedia + + arguments + + + Link + + tooltip + + type + integer + + + + Face + + tooltip + + type + integer + + + + energy + 10 + return + integer + sleep + 0 + tooltip + Clears (deletes) the media and all parameters from the given Face on the linked prim.\nReturns an integer that is a STATUS_* flag, which details the success/failure of the operation. + + ll.ClearPrimMedia + + arguments + + + Face + + tooltip + Number of side to clear. + type + integer + + + + energy + 10 + return + integer + sleep + 1 + tooltip + Clears (deletes) the media and all parameters from the given Face.\nReturns an integer that is a STATUS_* flag which details the success/failure of the operation. + + ll.CloseRemoteDataChannel + + arguments + + + ChannelID + + tooltip + + type + key + + + + energy + 10 + return + void + sleep + 1 + tooltip + This function is deprecated. + + ll.Cloud + + arguments + + + Offset + + tooltip + + type + vector + + + + energy + 10 + return + float + sleep + 0 + tooltip + Returns the cloud density at the object's position + Offset. + + ll.CollisionFilter + + arguments + + + ObjectName + + tooltip + + type + string + + + + ObjectID + + tooltip + + type + key + + + + Accept + + tooltip + If TRUE, only accept collisions with ObjectName name AND ObjectID (either is optional), otherwise with objects not ObjectName AND ObjectID. + type + integer + + + + energy + 10 + return + void + sleep + 0 + tooltip + Specify an empty string or NULL_KEY for Accept, to not filter on the corresponding parameter. + + ll.CollisionSound + + arguments + + + ImpactSound + + tooltip + + type + string + + + + ImpactVolume + + tooltip + + type + float + + + + energy + 10 + return + void + sleep + 0 + tooltip + Suppress default collision sounds, replace default impact sounds with ImpactSound.\nThe ImpactSound must be in the object inventory.\nSupply an empty string to suppress collision sounds. + + ll.CollisionSprite + + arguments + + + ImpactSprite + + tooltip + + type + string + + + + energy + 10 + return + void + sleep + 0 + tooltip + Suppress default collision sprites, replace default impact sprite with ImpactSprite; found in the object inventory (empty string to just suppress). + + ll.ComputeHash + + arguments + + + Message + + tooltip + The message to be hashed. + type + string + + + + Algorithm + + tooltip + The digest algorithm: md5, sha1, sha224, sha256, sha384, sha512. + type + string + + + + energy + 10 + return + string + sleep + 0 + tooltip + Returns hex-encoded Hash string of Message using digest Algorithm. + + ll.Cos + + arguments + + + Theta + + tooltip + + type + float + + + + energy + 10 + return + float + sleep + 0 + tooltip + Returns the cosine of Theta (Theta in radians). + + ll.CreateCharacter + + arguments + + + Options + + tooltip + + type + list + + + + energy + 10 + return + void + sleep + 0 + tooltip + Convert link-set to AI/Physics character.\nCreates a path-finding entity, known as a "character", from the object containing the script. Required to activate use of path-finding functions.\nOptions is a list of key/value pairs. + + ll.CreateKeyValue + + arguments + + + Key + + tooltip + + type + string + + + + Value + + tooltip + + type + string + + + + energy + 10 + return + key + sleep + 0 + tooltip + + Starts an asychronous transaction to create a key-value pair. Will fail with XP_ERROR_STORAGE_EXCEPTION if the key already exists. The dataserver callback will be executed with the key returned from this call and a string describing the result. The result is a two element commma-delimited list. The first item is an integer specifying if the transaction succeeded (1) or not (0). In the failure case, the second item will be an integer corresponding to one of the XP_ERROR_... constants. In the success case the second item will be the value passed to the function. + + + ll.CreateLink + + arguments + + + TargetPrim + + tooltip + Object UUID that is in the same region. + type + key + + + + Parent + + tooltip + If FALSE, then TargetPrim becomes the root. If TRUE, then the script's object becomes the root. + type + integer + + + + energy + 10 + return + void + sleep + 0.1000000000000000055511151 + tooltip + Attempt to link the object the script is in, to target (requires permission PERMISSION_CHANGE_LINKS be set).\nRequires permission PERMISSION_CHANGE_LINKS be set. + + ll.Damage + + arguments + + + target + + tooltip + Agent or task to receive damage. + type + key + + + + damage + + tooltip + Damage amount to inflict on this target. + type + float + + + + type + + tooltip + Damage type to inflict on this target. + type + integer + + + + energy + 10 + return + void + sleep + 0 + tooltip + Generates a damage event on the targeted agent or task. + + ll.DataSizeKeyValue + + arguments + + energy + 10 + return + key + sleep + 0 + tooltip + + Starts an asychronous transaction the request the used and total amount of data allocated for the Experience. The dataserver callback will be executed with the key returned from this call and a string describing the result. The result is commma-delimited list. The first item is an integer specifying if the transaction succeeded (1) or not (0). In the failure case, the second item will be an integer corresponding to one of the XP_ERROR_... constants. In the success case the second item will be the the amount in use and the third item will be the total available. + + + ll.DeleteCharacter + + arguments + + energy + 10 + return + void + sleep + 0 + tooltip + Convert link-set from AI/Physics character to Physics object.\nConvert the current link-set back to a standard object, removing all path-finding properties. + + ll.DeleteKeyValue + + arguments + + + Key + + tooltip + + type + string + + + + energy + 10 + return + key + sleep + 0 + tooltip + + Starts an asychronous transaction to delete a key-value pair. The dataserver callback will be executed with the key returned from this call and a string describing the result. The result is a two element commma-delimited list. The first item is an integer specifying if the transaction succeeded (1) or not (0). In the failure case, the second item will be an integer corresponding to one of the XP_ERROR_... constants. In the success case the second item will be the value associated with the key. + + + ll.DeleteSubList + + arguments + + + Source + + tooltip + + type + list + + + + Start + + tooltip + + type + integer + + + + End + + tooltip + + type + integer + + + + energy + 10 + return + list + sleep + 0 + tooltip + Removes the slice from start to end and returns the remainder of the list.\nRemove a slice from the list and return the remainder, start and end are inclusive.\nUsing negative numbers for start and/or end causes the index to count backwards from the length of the list, so 0, -1 would delete the entire list.\nIf Start is larger than End the list deleted is the exclusion of the entries; so 6, 4 would delete the entire list except for the 5th. list entry. + + ll.DeleteSubString + + arguments + + + Source + + tooltip + + type + string + + + + Start + + tooltip + + type + integer + + + + End + + tooltip + + type + integer + + + + energy + 10 + return + string + sleep + 0 + tooltip + Removes the indicated sub-string and returns the result.\nStart and End are inclusive.\nUsing negative numbers for Start and/or End causes the index to count backwards from the length of the string, so 0, -1 would delete the entire string.\nIf Start is larger than End, the sub-string is the exclusion of the entries; so 6, 4 would delete the entire string except for the 5th. character. + + ll.DerezObject + + arguments + + + ID + + tooltip + The ID of an object in the region. + type + key + + + + flags + + tooltip + Flags for derez behavior. + type + integer + + + + energy + 10 + return + integer + sleep + 0 + tooltip + Derezzes an object previously rezzed by a script in this region. Returns TRUE on success or FALSE if the object could not be derezzed. + + ll.DetachFromAvatar + + arguments + + energy + 10 + return + void + sleep + 0 + tooltip + Remove the object containing the script from the avatar. + + ll.DetectedDamage + + arguments + + + Number + + tooltip + + type + integer + + + + energy + 10 + return + list + sleep + 0 + tooltip + Returns a list containing the current damage for the event, the damage type and the original damage delivered. + + ll.DetectedGrab + + arguments + + + Number + + tooltip + + type + integer + + + + energy + 10 + return + vector + sleep + 0 + tooltip + Returns the grab offset of a user touching the object.\nReturns <0.0, 0.0, 0.0> if Number is not a valid object. + + ll.DetectedGroup + + arguments + + + Number + + tooltip + + type + integer + + + + energy + 10 + return + integer + sleep + 0 + tooltip + Returns TRUE if detected object or agent Number has the same user group active as this object.\nIt will return FALSE if the object or agent is in the group, but the group is not active. + + ll.DetectedKey + + arguments + + + Number + + tooltip + + type + integer + + + + energy + 10 + return + key + sleep + 0 + tooltip + Returns the key of detected object or avatar number.\nReturns NULL_KEY if Number is not a valid index. + + ll.DetectedLinkNumber + + arguments + + + Number + + tooltip + + type + integer + + + + energy + 10 + return + integer + sleep + 0 + tooltip + Returns the link position of the triggered event for touches and collisions only.\n0 for a non-linked object, 1 for the root of a linked object, 2 for the first child, etc. + + ll.DetectedName + + arguments + + + Number + + tooltip + + type + integer + + + + energy + 10 + return + string + sleep + 0 + tooltip + Returns the name of detected object or avatar number.\nReturns the name of detected object number.\nReturns empty string if Number is not a valid index. + + ll.DetectedOwner + + arguments + + + Number + + tooltip + + type + integer + + + + energy + 10 + return + key + sleep + 0 + tooltip + Returns the key of detected object's owner.\nReturns invalid key if Number is not a valid index. + + ll.DetectedPos + + arguments + + + Number + + tooltip + + type + integer + + + + energy + 10 + return + vector + sleep + 0 + tooltip + Returns the position of detected object or avatar number.\nReturns <0.0, 0.0, 0.0> if Number is not a valid index. + + ll.DetectedRezzer + + arguments + + + Number + + tooltip + + type + integer + + + + energy + 10 + return + key + sleep + 0 + tooltip + Returns the key for the rezzer of the detected object. + + ll.DetectedRot + + arguments + + + Number + + tooltip + + type + integer + + + + energy + 10 + return + rotation + sleep + 0 + tooltip + Returns the rotation of detected object or avatar number.\nReturns <0.0, 0.0, 0.0, 1.0> if Number is not a valid offset. + + ll.DetectedTouchBinormal + + arguments + + + Index + + tooltip + Index of detection information + type + integer + + + + energy + 10 + return + vector + sleep + 0 + tooltip + Returns the surface bi-normal for a triggered touch event.\nReturns a vector that is the surface bi-normal (tangent to the surface) where the touch event was triggered. + + ll.DetectedTouchFace + + arguments + + + Index + + tooltip + Index of detection information + type + integer + + + + energy + 10 + return + integer + sleep + 0 + tooltip + Returns the index of the face where the avatar clicked in a triggered touch event. + + ll.DetectedTouchNormal + + arguments + + + Index + + tooltip + Index of detection information + type + integer + + + + energy + 10 + return + vector + sleep + 0 + tooltip + Returns the surface normal for a triggered touch event.\nReturns a vector that is the surface normal (perpendicular to the surface) where the touch event was triggered. + + ll.DetectedTouchPos + + arguments + + + Index + + tooltip + Index of detected information + type + integer + + + + energy + 10 + return + vector + sleep + 0 + tooltip + Returns the position, in region coordinates, where the object was touched in a triggered touch event.\nUnless it is a HUD, in which case it returns the position relative to the attach point. + + ll.DetectedTouchST + + arguments + + + Index + + tooltip + Index of detection information + type + integer + + + + energy + 10 + return + vector + sleep + 0 + tooltip + Returns a vector that is the surface coordinates where the prim was touched.\nThe X and Y vector positions contain the horizontal (S) and vertical (T) face coordinates respectively.\nEach component is in the interval [0.0, 1.0].\nTOUCH_INVALID_TEXCOORD is returned if the surface coordinates cannot be determined (e.g. when the viewer does not support this function). + + ll.DetectedTouchUV + + arguments + + + Index + + tooltip + Index of detection information + type + integer + + + + energy + 10 + return + vector + sleep + 0 + tooltip + Returns a vector that is the texture coordinates for where the prim was touched.\nThe X and Y vector positions contain the U and V face coordinates respectively.\nTOUCH_INVALID_TEXCOORD is returned if the touch UV coordinates cannot be determined (e.g. when the viewer does not support this function). + + ll.DetectedType + + arguments + + + Number + + tooltip + + type + integer + + + + energy + 10 + return + integer + sleep + 0 + tooltip + Returns the type (AGENT, ACTIVE, PASSIVE, SCRIPTED) of detected object.\nReturns 0 if number is not a valid index.\nNote that number is a bit-field, so comparisons need to be a bitwise checked. e.g.:\ninteger iType = llDetectedType(0);\n{\n // ...do stuff with the agent\n} + + ll.DetectedVel + + arguments + + + Number + + tooltip + + type + integer + + + + energy + 10 + return + vector + sleep + 0 + tooltip + Returns the velocity of the detected object Number.\nReturns<0.0, 0.0, 0.0> if Number is not a valid offset. + + ll.Dialog + + arguments + + + AvatarID + + tooltip + + type + key + + + + Text + + tooltip + + type + string + + + + Buttons + + tooltip + + type + list + + + + Channel + + tooltip + + type + integer + + + + energy + 10 + return + void + sleep + 1 + tooltip + + Shows a dialog box on the avatar's screen with the message.\n + Up to 12 strings in the list form buttons.\n + If a button is clicked, the name is chatted on Channel.\nOpens a "notify box" in the given avatars screen displaying the message.\n + Up to twelve buttons can be specified in a list of strings. When the user clicks a button, the name of the button is said on the specified channel.\n + Channels work just like llSay(), so channel 0 can be heard by everyone.\n + The chat originates at the object's position, not the avatar's position, even though it is said as the avatar (uses avatar's UUID and Name etc.).\n + Examples:\n + llDialog(who, "Are you a boy or a girl?", [ "Boy", "Girl" ], -4913);\n + llDialog(who, "This shows only an OK button.", [], -192);\n + llDialog(who, "This chats so you can 'hear' it.", ["Hooray"], 0); + + + ll.Die + + arguments + + energy + 0 + return + void + sleep + 0 + tooltip + Delete the object which holds the script. + + ll.DumpList2String + + arguments + + + Source + + tooltip + + type + list + + + + Separator + + tooltip + + type + string + + + + energy + 10 + return + string + sleep + 0 + tooltip + Returns the list as a single string, using Separator between the entries.\nWrite the list out as a single string, using Separator between values. + + ll.EdgeOfWorld + + arguments + + + Position + + tooltip + + type + vector + + + + Direction + + tooltip + + type + vector + + + + energy + 10 + return + integer + sleep + 0 + tooltip + Checks to see whether the border hit by Direction from Position is the edge of the world (has no neighboring region).\nReturns TRUE if the line along Direction from Position hits the edge of the world in the current simulator, returns FALSE if that edge crosses into another simulator. + + ll.EjectFromLand + + arguments + + + AvatarID + + tooltip + + type + key + + + + energy + 10 + return + void + sleep + 0 + tooltip + Ejects AvatarID from land that you own.\nEjects AvatarID from land that the object owner (group or resident) owns. + + ll.Email + + arguments + + + Address + + tooltip + + type + string + + + + Subject + + tooltip + + type + string + + + + Text + + tooltip + + type + string + + + + energy + 10 + return + void + sleep + 20 + tooltip + Sends email to Address with Subject and Message.\nSends an email to Address with Subject and Message. + + ll.EscapeURL + + arguments + + + URL + + tooltip + + type + string + + + + energy + 10 + return + string + sleep + 0 + tooltip + + Returns an escaped/encoded version of url, replacing spaces with %20 etc.\nReturns the string that is the URL-escaped version of URL (replacing spaces with %20, etc.).\n + This function returns the UTF-8 encoded escape codes for selected characters. + + + ll.Euler2Rot + + arguments + + + Vector + + tooltip + + type + vector + + + + energy + 10 + return + rotation + sleep + 0 + tooltip + Returns the rotation representation of the Euler angles.\nReturns the rotation represented by the Euler Angle. + + ll.Evade + + arguments + + + TargetID + + tooltip + Agent or object to evade. + type + key + + + + Options + + tooltip + No options yet. + type + list + + + + energy + 10 + return + void + sleep + 0 + tooltip + Evade a specified target.\nCharacters will (roughly) try to hide from their pursuers if there is a good hiding spot along their fleeing path. Hiding means no direct line of sight from the head of the character (centre of the top of its physics bounding box) to the head of its pursuer and no direct path between the two on the navigation-mesh. + + ll.ExecCharacterCmd + + arguments + + + Command + + tooltip + Command to send. + type + integer + + + + Options + + tooltip + Height for CHARACTER_CMD_JUMP. + type + list + + + + energy + 10 + return + void + sleep + 0 + tooltip + Execute a character command.\nSend a command to the path system.\nCurrently only supports stopping the current path-finding operation or causing the character to jump. + + ll.Fabs + + arguments + + + Value + + tooltip + + type + float + + + + energy + 10 + return + float + sleep + 0 + tooltip + Returns the positive version of Value.\nReturns the absolute value of Value. + + ll.FindNotecardTextCount + + arguments + + + NotecardName + + tooltip + + type + string + + + + Pattern + + tooltip + Regex pattern to find in the notecard text. + type + string + + + + Options + + tooltip + A list of options to control the search. Included for future expansion, should be [] + type + list + + + + energy + 10 + return + key + sleep + 0 + tooltip + + Searches the text of a cached notecard for lines containing the given pattern and returns the + number of matches found through a dataserver event. + + + ll.FindNotecardTextSync + + arguments + + + NotecardName + + tooltip + + type + string + + + + Pattern + + tooltip + Regex pattern to find in the notecard text. + type + string + + + + StartMatch + + tooltip + The number of matches to skip before returning values. + type + integer + + + + Count + + tooltip + The maximum number of matches to return. If 0 this function will return the first 64 matches found. + type + integer + + + + Options + + tooltip + A list of options to control the search. Included for future expansion, should be [] + type + list + + + + energy + 10 + return + list + sleep + 0 + tooltip + + Searches the text of a cached notecard for lines containing the given pattern. + Returns a list of line numbers and column where a match is found. If the notecard is not in + the cache it returns a list containing a single entry of NAK. If no matches are found an + empty list is returned. + + + ll.FleeFrom + + arguments + + + Source + + tooltip + Global coordinate from which to flee. + type + vector + + + + Distance + + tooltip + Distance in meters to flee from the source. + type + float + + + + Options + + tooltip + No options available at this time. + type + list + + + + energy + 10 + return + void + sleep + 0 + tooltip + Flee from a point.\nDirects a character (llCreateCharacter) to keep away from a defined position in the region or adjacent regions. + + ll.Floor + + arguments + + + Value + + tooltip + + type + float + + + + energy + 10 + return + integer + sleep + 0 + tooltip + Returns largest integer value <= Value. + + ll.ForceMouselook + + arguments + + + Enable + + tooltip + Boolean, if TRUE when an avatar sits on the prim, the avatar will be forced into mouse-look mode.\nFALSE is the default setting and will undo a previously set TRUE or do nothing. + type + integer + + + + energy + 10 + return + void + sleep + 0 + tooltip + If Enable is TRUE any avatar that sits on this object is forced into mouse-look mode.\nAfter calling this function with Enable set to TRUE, any agent sitting down on the prim will be forced into mouse-look.\nJust like llSitTarget, this changes a permanent property of the prim (not the object) and needs to be reset by calling this function with Enable set to FALSE in order to disable it. + + ll.Frand + + arguments + + + Magnitude + + tooltip + + type + float + + + + energy + 10 + return + float + sleep + 0 + tooltip + Returns a pseudo random number in the range [0, Magnitude] or [Magnitude, 0].\nReturns a pseudo-random number between [0, Magnitude]. + + ll.GenerateKey + + arguments + + energy + 10 + return + key + sleep + 0 + tooltip + Generates a key (SHA-1 hash) using UUID generation to create a unique key.\nAs the UUID produced is versioned, it should never return a value of NULL_KEY.\nThe specific UUID version is an implementation detail that has changed in the past and may change again in the future. Do not depend upon the UUID that is returned to be version 5 SHA-1 hash. + + ll.GetAccel + + arguments + + energy + 10 + return + vector + sleep + 0 + tooltip + Returns the acceleration of the object relative to the region's axes.\nGets the acceleration of the object. + + ll.GetAgentInfo + + arguments + + + AvatarID + + tooltip + + type + key + + + + energy + 10 + return + integer + sleep + 0 + tooltip + + Returns an integer bit-field containing the agent information about id.\n + Returns AGENT_FLYING, AGENT_ATTACHMENTS, AGENT_SCRIPTED, AGENT_SITTING, AGENT_ON_OBJECT, AGENT_MOUSELOOK, AGENT_AWAY, AGENT_BUSY, AGENT_TYPING, AGENT_CROUCHING, AGENT_ALWAYS_RUN, AGENT_WALKING, AGENT_IN_AIR and/or AGENT_FLOATING_VIA_SCRIPTED_ATTACHMENT.\nReturns information about the given agent ID as a bit-field of agent info constants. + + + ll.GetAgentLanguage + + arguments + + + AvatarID + + tooltip + + type + key + + + + energy + 10 + return + string + sleep + 0 + tooltip + Returns the language code of the preferred interface language of the avatar.\nReturns a string that is the language code of the preferred interface language of the resident. + + ll.GetAgentList + + arguments + + + Scope + + tooltip + The scope (region, parcel, parcel same owner) to return agents for. + type + integer + + + + Options + + tooltip + List of options to apply. Current unused. + type + list + + + + energy + 10 + return + list + sleep + 0 + tooltip + Requests a list of agents currently in the region, limited by the scope parameter.\nReturns a list [key UUID-0, key UUID-1, ..., key UUID-n] or [string error_msg] - returns avatar keys for all agents in the region limited to the area(s) specified by scope + + ll.GetAgentSize + + arguments + + + AvatarID + + tooltip + + type + key + + + + energy + 10 + return + vector + sleep + 0 + tooltip + If the avatar is in the same region, returns the size of the bounding box of the requested avatar by id, otherwise returns ZERO_VECTOR.\nIf the agent is in the same region as the object, returns the size of the avatar. + + ll.GetAlpha + + arguments + + + Face + + tooltip + + type + integer + + + + energy + 10 + return + float + sleep + 0 + tooltip + Returns the alpha value of Face.\nReturns the 'alpha' of the given face. If face is ALL_SIDES the value returned is the mean average of all faces. + + ll.GetAndResetTime + + arguments + + energy + 10 + return + float + sleep + 0 + tooltip + Returns the script time in seconds and then resets the script timer to zero.\nGets the time in seconds since starting and resets the time to zero. + + ll.GetAnimation + + arguments + + + AvatarID + + tooltip + + type + key + + + + energy + 10 + return + string + sleep + 0 + tooltip + Returns the name of the currently playing locomotion animation for the avatar id.\nReturns the currently playing animation for the specified avatar ID. + + ll.GetAnimationList + + arguments + + + AvatarID + + tooltip + + type + key + + + + energy + 10 + return + list + sleep + 0 + tooltip + Returns a list of keys of playing animations for an avatar.\nReturns a list of keys of all playing animations for the specified avatar ID. + + ll.GetAnimationOverride + + arguments + + + AnimationState + + tooltip + + type + string + + + + energy + 10 + return + string + sleep + 0 + tooltip + Returns a string that is the name of the animation that is used for the specified animation state\nTo use this function the script must obtain either the PERMISSION_OVERRIDE_ANIMATIONS or PERMISSION_TRIGGER_ANIMATION permission (automatically granted to attached objects). + + ll.GetAttached + + arguments + + energy + 10 + return + integer + sleep + 0 + tooltip + Returns the object's attachment point, or 0 if not attached. + + ll.GetAttachedList + + arguments + + + ID + + tooltip + Avatar to get attachments + type + key + + + + energy + 10 + return + list + sleep + 0 + tooltip + Returns a list of keys of all visible (not HUD) attachments on the avatar identified by the ID argument + + ll.GetAttachedListFiltered + + arguments + + + AgentID + + tooltip + An agent in the region. + type + key + + + + Options + + tooltip + A list of option for inventory transfer. + type + list + + + + energy + 10 + return + list + sleep + 0 + tooltip + Retrieves a list of attachments on an avatar. + + ll.GetBoundingBox + + arguments + + + ID + + tooltip + + type + key + + + + energy + 10 + return + list + sleep + 0 + tooltip + Returns the bounding box around the object (including any linked prims) relative to its root prim, as a list in the format [ (vector) min_corner, (vector) max_corner ]. + + ll.GetCameraAspect + + arguments + + energy + 10 + return + float + sleep + 0 + tooltip + Returns the current camera aspect ratio (width / height) of the agent who has granted the scripted object PERMISSION_TRACK_CAMERA permissions. If no permissions have been granted: it returns zero. + + ll.GetCameraFOV + + arguments + + energy + 10 + return + float + sleep + 0 + tooltip + Returns the current camera field of view of the agent who has granted the scripted object PERMISSION_TRACK_CAMERA permissions. If no permissions have been granted: it returns zero. + + ll.GetCameraPos + + arguments + + energy + 10 + return + vector + sleep + 0 + tooltip + Returns the current camera position for the agent the task has permissions for.\nReturns the position of the camera, of the user that granted the script PERMISSION_TRACK_CAMERA. If no user has granted the permission, it returns ZERO_VECTOR. + + ll.GetCameraRot + + arguments + + energy + 10 + return + rotation + sleep + 0 + tooltip + Returns the current camera orientation for the agent the task has permissions for. If no user has granted the PERMISSION_TRACK_CAMERA permission, returns ZERO_ROTATION. + + ll.GetCenterOfMass + + arguments + + energy + 10 + return + vector + sleep + 0 + tooltip + Returns the prim's centre of mass (unless called from the root prim, where it returns the object's centre of mass). + + ll.GetClosestNavPoint + + arguments + + + Point + + tooltip + A point in region-local space. + type + vector + + + + Options + + tooltip + No options at this time. + type + list + + + + energy + 10 + return + list + sleep + 0 + tooltip + Get the closest navigable point to the point provided.\nThe function accepts a point in region-local space (like all the other path-finding methods) and returns either an empty list or a list containing a single vector which is the closest point on the navigation-mesh to the point provided. + + ll.GetColor + + arguments + + + Face + + tooltip + + type + integer + + + + energy + 10 + return + vector + sleep + 0 + tooltip + Returns the color on Face.\nReturns the color of Face as a vector of red, green, and blue values between 0 and 1. If face is ALL_SIDES the color returned is the mean average of each channel. + + ll.GetCreator + + arguments + + energy + 10 + return + key + sleep + 0 + tooltip + Returns a key for the creator of the prim.\nReturns the key of the object's original creator. Similar to llGetOwner. + + ll.GetDate + + arguments + + energy + 10 + return + string + sleep + 0 + tooltip + Returns the current date in the UTC time zone in the format YYYY-MM-DD.\nReturns the current UTC date as YYYY-MM-DD. + + ll.GetDayLength + + arguments + + energy + 10 + return + integer + sleep + 0 + tooltip + Returns the number of seconds in a day on this parcel. + + ll.GetDayOffset + + arguments + + energy + 10 + return + integer + sleep + 0 + tooltip + Returns the number of seconds in a day is offset from midnight in this parcel. + + ll.GetDisplayName + + arguments + + + AvatarID + + tooltip + Avatar UUID that is in the same region, or is otherwise known to the region. + type + key + + + + energy + 10 + return + string + sleep + 0 + tooltip + Returns the display name of an avatar, if the avatar is connected to the current region, or if the name has been cached. Otherwise, returns an empty string. Use llRequestDisplayName if the avatar may be absent from the region. + + ll.GetEnergy + + arguments + + energy + 10 + return + float + sleep + 0 + tooltip + Returns how much energy is in the object as a percentage of maximum. + + ll.GetEnv + + arguments + + + DataRequest + + tooltip + The type of data to request. Any other string will cause an empty string to be returned. + type + string + + + + energy + 10 + return + string + sleep + 0 + tooltip + Returns a string with the requested data about the region. + + ll.GetEnvironment + + arguments + + + Position + + tooltip + Location within the region. + type + vector + + + + EnvParams + + tooltip + List of environment settings requested for the specified parcel location. + type + list + + + + energy + 10 + return + list + sleep + 0 + tooltip + Returns a string with the requested data about the region. + + ll.GetExperienceDetails + + arguments + + + ExperienceID + + tooltip + May be NULL_KEY to retrieve the details for the script's Experience + type + key + + + + energy + 10 + return + list + sleep + 0 + tooltip + + Returns a list with the following Experience properties: [Experience Name, Owner ID, Group ID, Experience ID, State, State Message]. State is an integer corresponding to one of the constants XP_ERROR_... and State Message is the string returned by llGetExperienceErrorMessage for that integer. + + + ll.GetExperienceErrorMessage + + arguments + + + Error + + tooltip + An Experience error code to translate. + type + integer + + + + energy + 10 + return + string + sleep + 0 + tooltip + + Returns a string describing the error code passed or the string corresponding with XP_ERROR_UNKNOWN_ERROR if the value is not a valid Experience error code. + + + ll.GetForce + + arguments + + energy + 10 + return + vector + sleep + 0 + tooltip + Returns the force (if the script is physical).\nReturns the current force if the script is physical. + + ll.GetFreeMemory + + arguments + + energy + 10 + return + integer + sleep + 0 + tooltip + Returns the number of free bytes of memory the script can use.\nReturns the available free space for the current script. This is inaccurate with LSO. + + ll.GetFreeURLs + + arguments + + energy + 10 + return + integer + sleep + 0 + tooltip + Returns the number of available URLs for the current script.\nReturns an integer that is the number of available URLs. + + ll.GetGMTclock + + arguments + + energy + 10 + return + float + sleep + 0 + tooltip + Returns the time in seconds since midnight GMT.\nGets the time in seconds since midnight in GMT/UTC. + + ll.GetGeometricCenter + + arguments + + energy + 10 + return + vector + sleep + 0 + tooltip + Returns the vector that is the geometric center of the object relative to the root prim. + + ll.GetHTTPHeader + + arguments + + + HTTPRequestID + + tooltip + A valid HTTP request key + type + key + + + + Header + + tooltip + Header value name + type + string + + + + energy + 10 + return + string + sleep + 0 + tooltip + Returns the value for header for request_id.\nReturns a string that is the value of the Header for HTTPRequestID. + + ll.GetHealth + + arguments + + + ID + + tooltip + The ID of an agent or object in the region. + type + key + + + + energy + 10 + return + float + sleep + 0 + tooltip + Returns the current health of an avatar or object in the region. + + ll.GetInventoryAcquireTime + + arguments + + + InventoryItem + + tooltip + Name of item in prim inventory. + type + string + + + + energy + 10 + return + string + sleep + 0 + tooltip + Returns the time at which the item was placed into this prim's inventory as a timestamp. + + ll.GetInventoryCreator + + arguments + + + InventoryItem + + tooltip + + type + string + + + + energy + 10 + return + key + sleep + 0 + tooltip + Returns a key for the creator of the inventory item.\nThis function returns the UUID of the creator of item. If item is not found in inventory, the object says "No item named 'name'". + + ll.GetInventoryDesc + + arguments + + + InventoryItem + + tooltip + + type + string + + + + energy + 10 + return + string + sleep + 0 + tooltip + Returns the item description of the item in inventory. If item is not found in inventory, the object says "No item named 'name'" to the debug channel and returns an empty string. + + ll.GetInventoryKey + + arguments + + + InventoryItem + + tooltip + + type + string + + + + energy + 10 + return + key + sleep + 0 + tooltip + Returns the key that is the UUID of the inventory named.\nReturns the key of the inventory named. + + ll.GetInventoryName + + arguments + + + InventoryType + + tooltip + Inventory item type + type + integer + + + + Index + + tooltip + Index number of inventory item. + type + integer + + + + energy + 10 + return + string + sleep + 0 + tooltip + Returns the name of the inventory item of a given type, specified by index number.\nUse the inventory constants INVENTORY_* to specify the type. + + ll.GetInventoryNumber + + arguments + + + InventoryType + + tooltip + Inventory item type + type + integer + + + + energy + 10 + return + integer + sleep + 0 + tooltip + Returns the quantity of items of a given type (INVENTORY_* flag) in the prim's inventory.\nUse the inventory constants INVENTORY_* to specify the type. + + ll.GetInventoryPermMask + + arguments + + + InventoryItem + + tooltip + Inventory item name. + type + string + + + + BitMask + + tooltip + MASK_BASE, MASK_OWNER, MASK_GROUP, MASK_EVERYONE or MASK_NEXT + type + integer + + + + energy + 10 + return + integer + sleep + 0 + tooltip + Returns the requested permission mask for the inventory item.\nReturns the requested permission mask for the inventory item defined by InventoryItem. If item is not in the object's inventory, llGetInventoryPermMask returns FALSE and causes the object to say "No item named '<item>'", where "<item>" is item. + + ll.GetInventoryType + + arguments + + + InventoryItem + + tooltip + + type + string + + + + energy + 10 + return + integer + sleep + 0 + tooltip + Returns the type of the named inventory item.\nLike all inventory functions, llGetInventoryType is case-sensitive. + + ll.GetKey + + arguments + + energy + 10 + return + key + sleep + 0 + tooltip + Returns the key of the prim the script is attached to.\nGet the key for the object which has this script. + + ll.GetLandOwnerAt + + arguments + + + Position + + tooltip + + type + vector + + + + energy + 10 + return + key + sleep + 0 + tooltip + Returns the key of the land owner, returns NULL_KEY if public.\nReturns the key of the land owner at Position, or NULL_KEY if public. + + ll.GetLinkKey + + arguments + + + LinkNumber + + tooltip + + type + integer + + + + energy + 10 + return + key + sleep + 0 + tooltip + Returns the key of the linked prim LinkNumber.\nReturns the key of LinkNumber in the link set. + + ll.GetLinkMedia + + arguments + + + LinkNumber + + tooltip + Link number (0: unlinked, 1: root prim, >1: child prims) or a LINK_* flag + type + integer + + + + Face + + tooltip + The prim's side number + type + integer + + + + Parameters + + tooltip + A list of PRIM_* property constants to return values of. + type + list + + + + energy + 10 + return + list + sleep + 0 + tooltip + Get the media parameters for a particular face on linked prim, given the desired list of parameter names. Returns a list of values in the order requested. Returns an empty list if no media exists on the face. + + ll.GetLinkName + + arguments + + + LinkNumber + + tooltip + + type + integer + + + + energy + 10 + return + string + sleep + 0 + tooltip + Returns the name of LinkNumber in a link set.\nReturns the name of LinkNumber the link set. + + ll.GetLinkNumber + + arguments + + energy + 10 + return + integer + sleep + 0 + tooltip + Returns the link number of the prim containing the script (0 means not linked, 1 the prim is the root, 2 the prim is the first child, etc.).\nReturns the link number of the prim containing the script. 0 means no link, 1 the root, 2 for first child, etc. + + ll.GetLinkNumberOfSides + + arguments + + + LinkNumber + + tooltip + Link number (0: unlinked, 1: root prim, >1: child prims) or a LINK_* flag. + type + integer + + + + energy + 10 + return + integer + sleep + 0 + tooltip + Returns the number of sides of the specified linked prim.\nReturns an integer that is the number of faces (or sides) of the prim link. + + ll.GetLinkPrimitiveParams + + arguments + + + LinkNumber + + tooltip + Link number (0: unlinked, 1: root prim, >1: child prims) or a LINK_* flag. + type + integer + + + + Parameters + + tooltip + PRIM_* flags. + type + list + + + + energy + 10 + return + list + sleep + 0 + tooltip + Returns the list of primitive attributes requested in the Parameters list for LinkNumber.\nPRIM_* flags can be broken into three categories, face flags, prim flags, and object flags.\n* Supplying a prim or object flag will return that flags attributes.\n* Face flags require the user to also supply a face index parameter. + + ll.GetLinkSitFlags + + arguments + + + LinkNumber + + tooltip + Link number (0: unlinked, 1: root prim, >1: child prims) or a LINK_* flag. + type + integer + + + + energy + 10 + return + integer + sleep + 0 + tooltip + Returns the sit flags set on the specified prim in a linkset. + + ll.GetListEntryType + + arguments + + + ListVariable + + tooltip + + type + list + + + + Index + + tooltip + + type + integer + + + + energy + 10 + return + integer + sleep + 0 + tooltip + Returns the type of the index entry in the list (TYPE_INTEGER, TYPE_FLOAT, TYPE_STRING, TYPE_KEY, TYPE_VECTOR, TYPE_ROTATION, or TYPE_INVALID if index is off list).\nReturns the type of the variable at Index in ListVariable. + + ll.GetListLength + + arguments + + + ListVariable + + tooltip + + type + list + + + + energy + 10 + return + integer + sleep + 0 + tooltip + Returns the number of elements in the list.\nReturns the number of elements in ListVariable. + + ll.GetLocalPos + + arguments + + energy + 10 + return + vector + sleep + 0 + tooltip + Returns the position relative to the root.\nReturns the local position of a child object relative to the root. + + ll.GetLocalRot + + arguments + + energy + 10 + return + rotation + sleep + 0 + tooltip + Returns the rotation local to the root.\nReturns the local rotation of a child object relative to the root. + + ll.GetMass + + arguments + + energy + 10 + return + float + sleep + 0 + tooltip + Returns the mass of object that the script is attached to.\nReturns the scripted object's mass. When called from a script in a link-set, the parent will return the sum of the link-set weights, while a child will return just its own mass. When called from a script inside an attachment, this function will return the mass of the avatar it's attached to, not its own. + + ll.GetMassMKS + + arguments + + energy + 10 + return + float + sleep + 0 + tooltip + Acts as llGetMass(), except that the units of the value returned are Kg. + + ll.GetMaxScaleFactor + + arguments + + energy + 10 + return + float + sleep + 0 + tooltip + Returns the largest multiplicative uniform scale factor that can be successfully applied (via llScaleByFactor()) to the object without violating prim size or linkability rules. + + ll.GetMemoryLimit + + arguments + + energy + 10 + return + integer + sleep + 0 + tooltip + Get the maximum memory a script can use, in bytes. + + ll.GetMinScaleFactor + + arguments + + energy + 10 + return + float + sleep + 0 + tooltip + Returns the smallest multiplicative uniform scale factor that can be successfully applied (via llScaleByFactor()) to the object without violating prim size or linkability rules. + + ll.GetMoonDirection + + arguments + + energy + 10 + return + vector + sleep + 0 + tooltip + Returns a normalized vector of the direction of the moon in the parcel.\nReturns the moon's direction on the simulator in the parcel. + + ll.GetMoonRotation + + arguments + + energy + 10 + return + rotation + sleep + 0 + tooltip + Returns the rotation applied to the moon in the parcel. + + ll.GetNextEmail + + arguments + + + Address + + tooltip + + type + string + + + + Subject + + tooltip + + type + string + + + + energy + 10 + return + void + sleep + 0 + tooltip + Fetch the next queued email with that matches the given address and/or subject, via the email event.\nIf the parameters are blank, they are not used for filtering. + + ll.GetNotecardLine + + arguments + + + NotecardName + + tooltip + + type + string + + + + LineNumber + + tooltip + + type + integer + + + + energy + 10 + return + key + sleep + 0.1000000000000000055511151 + tooltip + Returns LineNumber from NotecardName via the dataserver event. The line index starts at zero.\nIf the requested line is passed the end of the note-card the dataserver event will return the constant EOF string.\nThe key returned by this function is a unique identifier which will be supplied to the dataserver event in the requested parameter. + + ll.GetNotecardLineSync + + arguments + + + NotecardName + + tooltip + + type + string + + + + LineNumber + + tooltip + + type + integer + + + + energy + 10 + return + string + sleep + 0 + tooltip + Returns LineNumber from NotecardName. The line index starts at zero.\nIf the requested line is past the end of the note-card the return value will be set to the constant EOF string.\nIf the note-card is not cached on the simulator the return value is the NAK string. + + ll.GetNumberOfNotecardLines + + arguments + + + NotecardName + + tooltip + + type + string + + + + energy + 10 + return + key + sleep + 0.1000000000000000055511151 + tooltip + Returns the number of lines contained within a notecard via the dataserver event.\nThe key returned by this function is a query ID for identifying the dataserver reply. + + ll.GetNumberOfPrims + + arguments + + energy + 10 + return + integer + sleep + 0 + tooltip + Returns the number of prims in a link set the script is attached to.\nReturns the number of prims in (and avatars seated on) the object the script is in. + + ll.GetNumberOfSides + + arguments + + energy + 10 + return + integer + sleep + 0 + tooltip + Returns the number of faces (or sides) of the prim.\nReturns the number of sides of the prim which has the script. + + ll.GetObjectAnimationNames + + arguments + + energy + 10 + return + list + sleep + 0 + tooltip + Returns a list of names of playing animations for an object.\nReturns a list of names of all playing animations for the current object. + + ll.GetObjectDesc + + arguments + + energy + 10 + return + string + sleep + 0 + tooltip + Returns the description of the prim the script is attached to.\nReturns the description of the scripted object/prim. You can set the description using llSetObjectDesc. + + ll.GetObjectDetails + + arguments + + + ID + + tooltip + Prim or avatar UUID that is in the same region. + type + key + + + + Parameters + + tooltip + List of OBJECT_* flags. + type + list + + + + energy + 10 + return + list + sleep + 0 + tooltip + Returns a list of object details specified in the Parameters list for the object or avatar in the region with key ID.\nParameters are specified by the OBJECT_* constants. + + ll.GetObjectLinkKey + + arguments + + + id + + tooltip + UUID of prim + type + key + + + + link_no + + tooltip + Link number to retrieve + type + integer + + + + energy + 10 + return + key + sleep + 0 + tooltip + Returns the key of the linked prim link_no in a linkset.\nReturns the key of link_no in the link set specified by id. + + ll.GetObjectMass + + arguments + + + ID + + tooltip + + type + key + + + + energy + 10 + return + float + sleep + 0 + tooltip + Returns the mass of the avatar or object in the region.\nGets the mass of the object or avatar corresponding to ID. + + ll.GetObjectName + + arguments + + energy + 10 + return + string + sleep + 0 + tooltip + Returns the name of the prim which the script is attached to.\nReturns the name of the prim (not object) which contains the script. + + ll.GetObjectPermMask + + arguments + + + Category + + tooltip + Category is one of MASK_BASE, MASK_OWNER, MASK_GROUP, MASK_EVERYONE, or MASK_NEXT + type + integer + + + + energy + 10 + return + integer + sleep + 0 + tooltip + Returns the permission mask of the requested category for the object. + + ll.GetObjectPrimCount + + arguments + + + ObjectID + + tooltip + + type + key + + + + energy + 10 + return + integer + sleep + 0 + tooltip + Returns the total number of prims for an object in the region.\nReturns the prim count for any object id in the same region. + + ll.GetOmega + + arguments + + energy + 10 + return + vector + sleep + 0 + tooltip + Returns the rotation velocity in radians per second.\nReturns a vector that is the rotation velocity of the object in radians per second. + + ll.GetOwner + + arguments + + energy + 10 + return + key + sleep + 0 + tooltip + Returns the object owner's UUID.\nReturns the key for the owner of the object. + + ll.GetOwnerKey + + arguments + + + ObjectID + + tooltip + + type + key + + + + energy + 10 + return + key + sleep + 0 + tooltip + Returns the owner of ObjectID.\nReturns the key for the owner of object ObjectID. + + ll.GetParcelDetails + + arguments + + + Position + + tooltip + Location within the region. + type + vector + + + + ParcelDetails + + tooltip + List of details requested for the specified parcel location. + type + list + + + + energy + 10 + return + list + sleep + 0 + tooltip + Returns a list of parcel details specified in the ParcelDetails list for the parcel at Position.\nParameters is one or more of: PARCEL_DETAILS_NAME, _DESC, _OWNER, _GROUP, _AREA, _ID, _SEE_AVATARS.\nReturns a list that is the parcel details specified in ParcelDetails (in the same order) for the parcel at Position. + + ll.GetParcelFlags + + arguments + + + Position + + tooltip + + type + vector + + + + energy + 10 + return + integer + sleep + 0 + tooltip + Returns a mask of the parcel flags (PARCEL_FLAG_*) for the parcel that includes the point Position.\nReturns a bit-field specifying the parcel flags (PARCEL_FLAG_*) for the parcel at Position. + + ll.GetParcelMaxPrims + + arguments + + + Position + + tooltip + Region coordinates (z is ignored) of parcel. + type + vector + + + + SimWide + + tooltip + Boolean. If FALSE then the return is the maximum prims supported by the parcel. If TRUE then it is the combined number of prims on all parcels in the region owned by the specified parcel's owner. + type + integer + + + + energy + 10 + return + integer + sleep + 0 + tooltip + Returns the maximum number of prims allowed on the parcel at Position for a given scope.\nThe scope may be set to an individual parcel or the combined resources of all parcels with the same ownership in the region. + + ll.GetParcelMusicURL + + arguments + + energy + 10 + return + string + sleep + 0 + tooltip + Gets the streaming audio URL for the parcel object is on.\nThe object owner, avatar or group, must also be the land owner. + + ll.GetParcelPrimCount + + arguments + + + Position + + tooltip + Region coordinates of parcel to query. + type + vector + + + + Category + + tooltip + A PARCEL_COUNT_* flag. + type + integer + + + + SimWide + + tooltip + Boolean. If FALSE then the return is the maximum prims supported by the parcel. If TRUE then it is the combined number of prims on all parcels in the region owned by the specified parcel's owner. + type + integer + + + + energy + 10 + return + integer + sleep + 0 + tooltip + Returns the number of prims on the parcel at Position of the given category.\nCategories: PARCEL_COUNT_TOTAL, _OWNER, _GROUP, _OTHER, _SELECTED, _TEMP.\nReturns the number of prims used on the parcel at Position which are in Category.\nIf SimWide is TRUE, it returns the total number of objects for all parcels with matching ownership in the category specified.\nIf SimWide is FALSE, it returns the number of objects on this specific parcel in the category specified + + ll.GetParcelPrimOwners + + arguments + + + Position + + tooltip + + type + vector + + + + energy + 10 + return + list + sleep + 2 + tooltip + Returns a list of up to 100 residents who own objects on the parcel at Position, with per-owner land impact totals.\nRequires owner-like permissions for the parcel, and for the script owner to be present in the region.\nThe list is formatted as [ key agentKey1, integer agentLI1, key agentKey2, integer agentLI2, ... ], sorted by agent key.\nThe integers are the combined land impacts of the objects owned by the corresponding agents. + + ll.GetPermissions + + arguments + + energy + 10 + return + integer + sleep + 0 + tooltip + Returns an integer bitmask of the permissions that have been granted to the script. Individual permissions can be determined using a bit-wise "and" operation against the PERMISSION_* constants + + ll.GetPermissionsKey + + arguments + + energy + 10 + return + key + sleep + 0 + tooltip + Returns the key of the avatar that last granted or declined permissions to the script.\nReturns NULL_KEY if permissions were never granted or declined. + + ll.GetPhysicsMaterial + + arguments + + energy + 10 + return + list + sleep + 0 + tooltip + Returns a list of the form [float gravity_multiplier, float restitution, float friction, float density]. + + ll.GetPos + + arguments + + energy + 10 + return + vector + sleep + 0 + tooltip + Returns the position of the task in region coordinates.\nReturns the vector position of the task in region coordinates. + + ll.GetPrimMediaParams + + arguments + + + Face + + tooltip + face number + type + integer + + + + Parameters + + tooltip + One or more PRIM_MEDIA_* flags + type + list + + + + energy + 10 + return + list + sleep + 1 + tooltip + Returns the media parameters for a particular face on an object, given the desired list of parameter names, in the order requested. Returns an empty list if no media exists on the face. + + ll.GetPrimitiveParams + + arguments + + + Parameters + + tooltip + PRIM_* flags and face parameters + type + list + + + + energy + 10 + return + list + sleep + 0.2000000000000000111022302 + tooltip + Returns the primitive parameters specified in the parameters list.\nReturns primitive parameters specified in the Parameters list. + + ll.GetRegionAgentCount + + arguments + + energy + 10 + return + integer + sleep + 0 + tooltip + Returns the number of avatars in the region.\nReturns an integer that is the number of avatars in the region. + + ll.GetRegionCorner + + arguments + + energy + 10 + return + vector + sleep + 0 + tooltip + Returns a vector, in meters, that is the global location of the south-west corner of the region which the object is in.\nReturns the Region-Corner of the simulator containing the task. The region-corner is a vector (values in meters) representing distance from the first region. + + ll.GetRegionDayLength + + arguments + + energy + 10 + return + integer + sleep + 0 + tooltip + Returns the number of seconds in a day in this region. + + ll.GetRegionDayOffset + + arguments + + energy + 10 + return + integer + sleep + 0 + tooltip + Returns the number of seconds in a day is offset from midnight in this parcel. + + ll.GetRegionFPS + + arguments + + energy + 10 + return + float + sleep + 0 + tooltip + Returns the mean region frames per second. + + ll.GetRegionFlags + + arguments + + energy + 10 + return + integer + sleep + 0 + tooltip + Returns the region flags (REGION_FLAG_*) for the region the object is in.\nReturns a bit-field specifying the region flags (REGION_FLAG_*) for the region the object is in. + + ll.GetRegionMoonDirection + + arguments + + energy + 10 + return + vector + sleep + 0 + tooltip + Returns a normalized vector of the direction of the moon in the region.\nReturns the moon's direction on the simulator. + + ll.GetRegionMoonRotation + + arguments + + energy + 10 + return + rotation + sleep + 0 + tooltip + Returns the rotation applied to the moon in the region. + + ll.GetRegionName + + arguments + + energy + 10 + return + string + sleep + 0 + tooltip + Returns the current region name. + + ll.GetRegionSunDirection + + arguments + + energy + 10 + return + vector + sleep + 0 + tooltip + Returns a normalized vector of the direction of the sun in the region.\nReturns the sun's direction on the simulator. + + ll.GetRegionSunRotation + + arguments + + energy + 10 + return + rotation + sleep + 0 + tooltip + Returns the rotation applied to the sun in the region. + + ll.GetRegionTimeDilation + + arguments + + energy + 10 + return + float + sleep + 0 + tooltip + Returns the current time dilation as a float between 0.0 (full dilation) and 1.0 (no dilation).\nReturns the current time dilation as a float between 0.0 and 1.0. + + ll.GetRegionTimeOfDay + + arguments + + energy + 10 + return + float + sleep + 0 + tooltip + Returns the time in seconds since environmental midnight for the entire region. + + ll.GetRenderMaterial + + arguments + + + Face + + tooltip + + type + integer + + + + energy + 10 + return + string + sleep + 0 + tooltip + Returns a string that is the render material on face (the inventory name if it is a material in the prim's inventory, otherwise the key).\nReturns the render material of a face, if it is found in object inventory, its key otherwise. + + ll.GetRootPosition + + arguments + + energy + 10 + return + vector + sleep + 0 + tooltip + Returns the position (in region coordinates) of the root prim of the object which the script is attached to.\nThis is used to allow a child prim to determine where the root is. + + ll.GetRootRotation + + arguments + + energy + 10 + return + rotation + sleep + 0 + tooltip + Returns the rotation (relative to the region) of the root prim of the object which the script is attached to.\nGets the global rotation of the root object of the object script is attached to. + + ll.GetRot + + arguments + + energy + 10 + return + rotation + sleep + 0 + tooltip + Returns the rotation relative to the region's axes.\nReturns the rotation. + + ll.GetSPMaxMemory + + arguments + + energy + 10 + return + integer + sleep + 0 + tooltip + Returns the maximum used memory for the current script. Only valid after using PROFILE_SCRIPT_MEMORY. Non-mono scripts always use 16k.\nReturns the integer of the most bytes used while llScriptProfiler was last active. + + ll.GetScale + + arguments + + energy + 10 + return + vector + sleep + 0 + tooltip + Returns the scale of the prim.\nReturns a vector that is the scale (dimensions) of the prim. + + ll.GetScriptName + + arguments + + energy + 10 + return + string + sleep + 0 + tooltip + Returns the name of the script that this function is used in.\nReturns the name of this script. + + ll.GetScriptState + + arguments + + + ScriptName + + tooltip + + type + string + + + + energy + 10 + return + integer + sleep + 0 + tooltip + Returns TRUE if the script named is running.\nReturns TRUE if ScriptName is running. + + ll.GetSimStats + + arguments + + + StatType + + tooltip + Statistic type. + type + integer + + + + energy + 10 + return + float + sleep + 0 + tooltip + Returns a float that is the requested statistic. + + ll.GetSimulatorHostname + + arguments + + energy + 10 + return + string + sleep + 10 + tooltip + Returns the host-name of the machine which the script is running on.\nFor example, "sim225.agni.lindenlab.com". + + ll.GetStartParameter + + arguments + + energy + 10 + return + integer + sleep + 0 + tooltip + Returns an integer that is the script rez parameter.\nIf the object was rezzed by an agent, this function returns 0. + + ll.GetStartString + + arguments + + energy + 10 + return + string + sleep + 0 + tooltip + Returns an string that is the value passed to llRezObjectWithParams with REZ_PARAM_STRING.\nIf the object was rezzed by an agent, this function returns an empty string. + + ll.GetStaticPath + + arguments + + + Start + + tooltip + Starting position. + type + vector + + + + End + + tooltip + Ending position. + type + vector + + + + Radius + + tooltip + Radius of the character that the path is for, between 0.125m and 5.0m. + type + float + + + + Parameters + + tooltip + Currently only accepts the parameter CHARACTER_TYPE; the options are identical to those used for llCreateCharacter. The default value is CHARACTER_TYPE_NONE. + type + list + + + + energy + 10 + return + list + sleep + 0 + tooltip + + + ll.GetStatus + + arguments + + + StatusFlag + + tooltip + A STATUS_* flag + type + integer + + + + energy + 10 + return + integer + sleep + 0 + tooltip + Returns boolean value of the specified status (e.g. STATUS_PHANTOM) of the object the script is attached to. + + ll.GetSubString + + arguments + + + String + + tooltip + + type + string + + + + Start + + tooltip + + type + integer + + + + End + + tooltip + + type + integer + + + + energy + 10 + return + string + sleep + 0 + tooltip + Returns a sub-string from String, in a range specified by the Start and End indicies (inclusive).\nUsing negative numbers for Start and/or End causes the index to count backwards from the length of the string, so 0, -1 would capture the entire string.\nIf Start is greater than End, the sub string is the exclusion of the entries. + + ll.GetSunDirection + + arguments + + energy + 10 + return + vector + sleep + 0 + tooltip + Returns a normalized vector of the direction of the sun in the parcel.\nReturns the sun's direction on the simulator in the parcel. + + ll.GetSunRotation + + arguments + + energy + 10 + return + rotation + sleep + 0 + tooltip + Returns the rotation applied to the sun in the parcel. + + ll.GetTexture + + arguments + + + Face + + tooltip + + type + integer + + + + energy + 10 + return + string + sleep + 0 + tooltip + Returns a string that is the texture on face (the inventory name if it is a texture in the prim's inventory, otherwise the key).\nReturns the texture of a face, if it is found in object inventory, its key otherwise. + + ll.GetTextureOffset + + arguments + + + Face + + tooltip + + type + integer + + + + energy + 10 + return + vector + sleep + 0 + tooltip + Returns the texture offset of face in the x and y components of a vector. + + ll.GetTextureRot + + arguments + + + Face + + tooltip + + type + integer + + + + energy + 10 + return + float + sleep + 0 + tooltip + Returns the texture rotation of side. + + ll.GetTextureScale + + arguments + + + Face + + tooltip + + type + integer + + + + energy + 10 + return + vector + sleep + 0 + tooltip + Returns the texture scale of side in the x and y components of a vector.\nReturns the texture scale of a side in the x and y components of a vector. + + ll.GetTime + + arguments + + energy + 10 + return + float + sleep + 0 + tooltip + Returns the time in seconds since the last region reset, script reset, or call to either llResetTime or llGetAndResetTime. + + ll.GetTimeOfDay + + arguments + + energy + 10 + return + float + sleep + 0 + tooltip + Returns the time in seconds since environmental midnight on the parcel. + + ll.GetTimestamp + + arguments + + energy + 10 + return + string + sleep + 0 + tooltip + Returns a time-stamp (UTC time zone) in the format: YYYY-MM-DDThh:mm:ss.ff..fZ. + + ll.GetTorque + + arguments + + energy + 10 + return + vector + sleep + 0 + tooltip + Returns the torque (if the script is physical).\nReturns a vector that is the torque (if the script is physical). + + ll.GetUnixTime + + arguments + + energy + 10 + return + integer + sleep + 0 + tooltip + Returns the number of seconds elapsed since 00:00 hours, Jan 1, 1970 UTC from the system clock. + + ll.GetUsedMemory + + arguments + + energy + 10 + return + integer + sleep + 0 + tooltip + Returns the current used memory for the current script. Non-mono scripts always use 16K.\nReturns the integer of the number of bytes of memory currently in use by the script. Non-mono scripts always use 16K. + + ll.GetUsername + + arguments + + + AvatarID + + tooltip + + type + key + + + + energy + 10 + return + string + sleep + 0 + tooltip + Returns the username of an avatar, if the avatar is connected to the current region, or if the name has been cached. Otherwise, returns an empty string. Use llRequestUsername if the avatar may be absent from the region. + + ll.GetVel + + arguments + + energy + 10 + return + vector + sleep + 0 + tooltip + Returns the velocity of the object.\nReturns a vector that is the velocity of the object. + + ll.GetVisualParams + + arguments + + + ID + + tooltip + Avatar UUID in the same region. + type + key + + + + Parameters + + tooltip + List of visual parameter IDs. + type + list + + + + energy + 10 + return + list + sleep + 0 + tooltip + Returns a list of the current value for each requested visual parameter. + + ll.GetWallclock + + arguments + + energy + 10 + return + float + sleep + 0 + tooltip + Returns the time in seconds since midnight California Pacific time (PST/PDT).\nReturns the time in seconds since simulator's time-zone midnight (Pacific Time). + + ll.GiveAgentInventory + + arguments + + + AgentID + + tooltip + An agent in the region. + type + key + + + + FolderName + + tooltip + Folder name to give to the agent. + type + string + + + + InventoryItems + + tooltip + Inventory items to give to the agent. + type + list + + + + Options + + tooltip + A list of option for inventory transfer. + type + list + + + + energy + 10 + return + integer + sleep + 3 + tooltip + Give InventoryItems to the specified agent as a new folder of items, as permitted by the permissions system. The target must be an agent. + + ll.GiveInventory + + arguments + + + TargetID + + tooltip + + type + key + + + + InventoryItem + + tooltip + + type + string + + + + energy + 10 + return + void + sleep + 0 + tooltip + Give InventoryItem to destination represented by TargetID, as permitted by the permissions system.\nTargetID may be any agent or an object in the same region. + + ll.GiveInventoryList + + arguments + + + TargetID + + tooltip + + type + key + + + + FolderName + + tooltip + + type + string + + + + InventoryItems + + tooltip + + type + list + + + + energy + 10 + return + void + sleep + 3 + tooltip + Give InventoryItems to destination (represented by TargetID) as a new folder of items, as permitted by the permissions system.\nTargetID may be any agent or an object in the same region. If TargetID is an object, the items are passed directly to the object inventory (no folder is created). + + ll.GiveMoney + + arguments + + + AvatarID + + tooltip + + type + key + + + + Amount + + tooltip + + type + integer + + + + energy + 10 + return + integer + sleep + 0 + tooltip + Transfers Amount of L$ from script owner to AvatarID.\nThis call will silently fail if PERMISSION_DEBIT has not been granted. + + ll.GodLikeRezObject + + arguments + + + InventoryItemID + + tooltip + + type + key + + + + Position + + tooltip + + type + vector + + + + energy + 10 + god-mode + 1 + return + void + sleep + 0 + tooltip + Rez directly off of a UUID if owner has god-bit set. + + ll.Ground + + arguments + + + Offset + + tooltip + + type + vector + + + + energy + 10 + return + float + sleep + 0 + tooltip + Returns the ground height at the object position + offset.\nReturns the ground height at the object's position + Offset. + + ll.GroundContour + + arguments + + + Offset + + tooltip + + type + vector + + + + energy + 10 + return + vector + sleep + 0 + tooltip + Returns the ground contour direction below the object position + Offset.\nReturns the ground contour at the object's position + Offset. + + ll.GroundNormal + + arguments + + + Offset + + tooltip + + type + vector + + + + energy + 10 + return + vector + sleep + 0 + tooltip + Returns the ground normal below the object position + offset.\nReturns the ground contour at the object's position + Offset. + + ll.GroundRepel + + arguments + + + Height + + tooltip + Distance above the ground. + type + float + + + + Water + + tooltip + Boolean, if TRUE then hover above water too. + type + integer + + + + Tau + + tooltip + Seconds to critically damp in. + type + float + + + + energy + 10 + return + void + sleep + 0 + tooltip + + Critically damps to height if within height * 0.5 of level (either above ground level or above the higher of land and water if water == TRUE).\nCritically damps to fHeight if within fHeight * 0.5 of ground or water level.\n + The height is above ground level if iWater is FALSE or above the higher of land and water if iWater is TRUE.\n + Do not use with vehicles. Only works in physics-enabled objects. + + + ll.GroundSlope + + arguments + + + Offset + + tooltip + + type + vector + + + + energy + 10 + return + vector + sleep + 0 + tooltip + Returns the ground slope below the object position + Offset.\nReturns the ground slope at the object position + Offset. + + ll.HMAC + + arguments + + + Key + + tooltip + The PEM-formatted key for the hash digest. + type + string + + + + Message + + tooltip + The message to be hashed. + type + string + + + + Algorithm + + tooltip + The digest algorithm: md5, sha1, sha224, sha256, sha384, sha512. + type + string + + + + energy + 10 + return + string + sleep + 0 + tooltip + Returns the base64-encoded hashed message authentication code (HMAC), of Message using PEM-formatted Key and digest Algorithm (md5, sha1, sha224, sha256, sha384, sha512). + + ll.HTTPRequest + + arguments + + + URL + + tooltip + A valid HTTP/HTTPS URL. + type + string + + + + Parameters + + tooltip + Configuration parameters, specified as HTTP_* flag-value pairs. + type + list + + + + Body + + tooltip + Contents of the request. + type + string + + + + energy + 10 + return + key + sleep + 0 + tooltip + Sends an HTTP request to the specified URL with the Body of the request and Parameters.\nReturns a key that is a handle identifying the HTTP request made. + + ll.HTTPResponse + + arguments + + + HTTPRequestID + + tooltip + A valid HTTP request key. + type + key + + + + Status + + tooltip + HTTP Status (200, 400, 404, etc.). + type + integer + + + + Body + + tooltip + Contents of the response. + type + string + + + + energy + 10 + return + void + sleep + 0 + tooltip + Responds to an incoming HTTP request which was triggerd by an http_request event within the script. HTTPRequestID specifies the request to respond to (this ID is supplied in the http_request event handler). Status and Body specify the status code and message to respond with. + + ll.Hash + + arguments + + + value + + tooltip + + type + string + + + + energy + 10 + return + integer + sleep + 0 + tooltip + Calculates the 32bit hash value for the provided string. + + ll.InsertString + + arguments + + + TargetVariable + + tooltip + + type + string + + + + Position + + tooltip + + type + integer + + + + SourceVariable + + tooltip + + type + string + + + + energy + 10 + return + string + sleep + 0 + tooltip + Inserts SourceVariable into TargetVariable at Position, and returns the result.\nInserts SourceVariable into TargetVariable at Position and returns the result. Note this does not alter TargetVariable. + + ll.InstantMessage + + arguments + + + AvatarID + + tooltip + + type + key + + + + Text + + tooltip + + type + string + + + + energy + 10 + return + void + sleep + 2 + tooltip + IMs Text to the user identified.\nSend Text to the user as an instant message. + + ll.IntegerToBase64 + + arguments + + + Value + + tooltip + + type + integer + + + + energy + 10 + return + string + sleep + 0 + tooltip + Returns a string that is a Base64 big endian encode of Value.\nEncodes the Value as an 8-character Base64 string. + + ll.IsFriend + + arguments + + + agent_id + + tooltip + Agent ID of another agent in the region. + type + key + + + + energy + 10 + return + integer + sleep + 0 + tooltip + Returns TRUE if avatar ID is a friend of the script owner. + + ll.Json2List + + arguments + + + JSON + + tooltip + + type + string + + + + energy + 10 + return + list + sleep + 0 + tooltip + Converts the top level of the JSON string to a list. + + ll.JsonGetValue + + arguments + + + JSON + + tooltip + + type + string + + + + Specifiers + + tooltip + + type + list + + + + energy + 10 + return + string + sleep + 0 + tooltip + Gets the value indicated by Specifiers from the JSON string. + + ll.JsonSetValue + + arguments + + + JSON + + tooltip + + type + string + + + + Specifiers + + tooltip + + type + list + + + + Value + + tooltip + + type + string + + + + energy + 10 + return + string + sleep + 0 + tooltip + Returns a new JSON string that is the JSON given with the Value indicated by Specifiers set to Value. + + ll.JsonValueType + + arguments + + + JSON + + tooltip + + type + string + + + + Specifiers + + tooltip + + type + list + + + + energy + 10 + return + string + sleep + 0 + tooltip + Returns the type constant (JSON_*) for the value in JSON indicated by Specifiers. + + ll.Key2Name + + arguments + + + ID + + tooltip + Avatar or rezzed prim UUID. + type + key + + + + energy + 10 + return + string + sleep + 0 + tooltip + Returns the name of the prim or avatar specified by ID. The ID must be a valid rezzed prim or avatar key in the current simulator, otherwise an empty string is returned.\nFor avatars, the returned name is the legacy name + + ll.KeyCountKeyValue + + arguments + + energy + 10 + return + key + sleep + 0 + tooltip + + Starts an asychronous transaction the request the number of keys in the data store. The dataserver callback will be executed with the key returned from this call and a string describing the result. The result is commma-delimited list. The first item is an integer specifying if the transaction succeeded (1) or not (0). In the failure case, the second item will be an integer corresponding to one of the XP_ERROR_... constants. In the success case the second item will the the number of keys in the system. + + + ll.KeysKeyValue + + arguments + + + First + + tooltip + Index of the first key to return. + type + integer + + + + Count + + tooltip + The number of keys to return. + type + integer + + + + energy + 10 + return + key + sleep + 0 + tooltip + + Starts an asychronous transaction the request a number of keys from the data store. The dataserver callback will be executed with the key returned from this call and a string describing the result. The result is commma-delimited list. The first item is an integer specifying if the transaction succeeded (1) or not (0). In the failure case, the second item will be an integer corresponding to one of the XP_ERROR_... constants. The error XP_ERROR_KEY_NOT_FOUND is returned if First is greater than or equal to the number of keys in the data store. In the success case the subsequent items will be the keys requested. The number of keys returned may be less than requested if the return value is too large or if there is not enough keys remaining. The order keys are returned is not guaranteed but is stable between subsequent calls as long as no keys are added or removed. Because the keys are returned in a comma-delimited list it is not recommended to use commas in key names if this function is used. + + + ll.Linear2sRGB + + arguments + + + color + + tooltip + A color in the linear colorspace. + type + vector + + + + energy + 10 + return + vector + sleep + 0 + tooltip + Converts a color from the linear colorspace to sRGB. + + ll.LinkAdjustSoundVolume + + arguments + + + LinkNumber + + tooltip + Link number (0: unlinked, 1: root prim, >1: child prims) or a LINK_* flag + type + integer + + + + Volume + + tooltip + The volume to set. + type + float + + + + energy + 10 + return + void + sleep + 0 + tooltip + Adjusts the volume (0.0 - 1.0) of the currently playing sound attached to the link.\nThis function has no effect on sounds started with llTriggerSound. + + ll.LinkParticleSystem + + arguments + + + LinkNumber + + tooltip + Link number (0: unlinked, 1: root prim, >1: child prims) or a LINK_* flag + type + integer + + + + Rules + + tooltip + Particle system rules list in the format [ rule1, data1, rule2, data2 . . . ruleN, dataN ] + type + list + + + + energy + 10 + return + void + sleep + 0 + tooltip + Creates a particle system in prim LinkNumber based on Rules. An empty list removes a particle system from object.\nList format is [ rule-1, data-1, rule-2, data-2 ... rule-n, data-n ].\nThis is identical to llParticleSystem except that it applies to a specified linked prim and not just the prim the script is in. + + ll.LinkPlaySound + + arguments + + + LinkNumber + + tooltip + Link number (0: unlinked, 1: root prim, >1: child prims) or a LINK_* flag + type + integer + + + + Sound + + tooltip + + type + string + + + + Volume + + tooltip + + type + float + + + + Flags + + tooltip + + type + integer + + + + energy + 10 + return + void + sleep + 0 + tooltip + Plays Sound, once or looping, at Volume (0.0 - 1.0). The sound may be attached to the link or triggered at its location.\nOnly one sound may be attached to an object at a time, and attaching a new sound or calling llStopSound will stop the previously attached sound. + + ll.LinkSetSoundQueueing + + arguments + + + LinkNumber + + tooltip + Link number (0: unlinked, 1: root prim, >1: child prims) or a LINK_* flag + type + integer + + + + QueueEnable + + tooltip + Boolean, sound queuing for the linked prim: TRUE enables, FALSE disables (default). + type + integer + + + + energy + 10 + return + void + sleep + 0 + tooltip + Limits radius for audibility of scripted sounds (both attached and triggered) to distance Radius around the link. + + ll.LinkSetSoundRadius + + arguments + + + LinkNumber + + tooltip + Link number (0: unlinked, 1: root prim, >1: child prims) or a LINK_* flag + type + integer + + + + radius + + tooltip + Maximum distance that sounds can be heard. + type + float + + + + energy + 10 + return + void + sleep + 0 + tooltip + Limits radius for audibility of scripted sounds (both attached and triggered) to distance Radius around the link. + + ll.LinkSitTarget + + arguments + + + LinkNumber + + tooltip + Link number (0: unlinked, 1: root prim, >1: child prims) or a LINK_* flag of the prim. + type + integer + + + + Offset + + tooltip + Position for the sit target, relative to the prim's position. + type + vector + + + + Rotation + + tooltip + Rotation (relative to the prim's rotation) for the avatar. + type + rotation + + + + energy + 10 + return + void + sleep + 0 + tooltip + Set the sit location for the linked prim(s). If Offset == <0,0,0> clear it.\nSet the sit location for the linked prim(s). The sit location is relative to the prim's position and rotation. + + ll.LinkStopSound + + arguments + + + LinkNumber + + tooltip + Link number (0: unlinked, 1: root prim, >1: child prims) or a LINK_* flag + type + integer + + + + energy + 10 + return + void + sleep + 0 + tooltip + Stops playback of the currently attached sound on a link. + + ll.LinksetDataAvailable + + arguments + + energy + 10 + return + integer + sleep + 0 + tooltip + Returns the number of bytes remaining in the linkset's datastore. + + ll.LinksetDataCountFound + + arguments + + + search + + tooltip + A regex search string to match against keys in the datastore. + type + string + + + + energy + 10 + return + integer + sleep + 0 + tooltip + Returns the number of keys matching the regular expression passed in the search parameter. + + ll.LinksetDataCountKeys + + arguments + + energy + 10 + return + integer + sleep + 0 + tooltip + Returns the number of keys in the linkset's datastore. + + ll.LinksetDataDelete + + arguments + + + name + + tooltip + Key to delete from the linkset's datastore. + type + string + + + + energy + 10 + return + integer + sleep + 0 + tooltip + Deletes a name:value pair from the linkset's datastore. + + ll.LinksetDataDeleteFound + + arguments + + + search + + tooltip + A regex search string to match against keys in the datastore. + type + string + + + + pass + + tooltip + The pass phrase used to protect key value pairs in the linkset data + type + string + + + + energy + 10 + return + list + sleep + 0 + tooltip + Deletes all key value pairs in the linkset data where the key matches the regular expression in search. Returns a list consisting of [ #deleted, #not deleted ]. + + ll.LinksetDataDeleteProtected + + arguments + + + name + + tooltip + Key to delete from the linkset's datastore. + type + string + + + + pass + + tooltip + Pass phrase to access protected data. + type + string + + + + energy + 10 + return + integer + sleep + 0 + tooltip + Deletes a name:value pair from the linkset's datastore. + + ll.LinksetDataFindKeys + + arguments + + + search + + tooltip + A regex search string to match against keys in the datastore. + type + string + + + + start + + tooltip + First entry to return. 0 for start of list. + type + integer + + + + count + + tooltip + Number of entries to return. Less than 1 for all keys. + type + integer + + + + energy + 10 + return + list + sleep + 0 + tooltip + Returns a list of keys from the linkset's data store matching the search parameter. + + ll.LinksetDataListKeys + + arguments + + + start + + tooltip + First entry to return. 0 for start of list. + type + integer + + + + count + + tooltip + Number of entries to return. Less than 1 for all keys. + type + integer + + + + energy + 10 + return + list + sleep + 0 + tooltip + Returns a list of all keys in the linkset datastore. + + ll.LinksetDataRead + + arguments + + + name + + tooltip + Key to retrieve from the linkset's datastore. + type + string + + + + energy + 10 + return + string + sleep + 0 + tooltip + Returns the value stored for a key in the linkset. + + ll.LinksetDataReadProtected + + arguments + + + name + + tooltip + Key to retrieve from the linkset's datastore. + type + string + + + + pass + + tooltip + Pass phrase to access protected data. + type + string + + + + energy + 10 + return + string + sleep + 0 + tooltip + Returns the value stored for a key in the linkset. + + ll.LinksetDataReset + + arguments + + energy + 10 + return + void + sleep + 0 + tooltip + Resets the linkset's data store, erasing all key-value pairs. + + ll.LinksetDataWrite + + arguments + + + name + + tooltip + key for the name:value pair. + type + string + + + + value + + tooltip + value to store in the linkset's datastore. + type + string + + + + energy + 10 + return + integer + sleep + 0 + tooltip + Sets a name:value pair in the linkset's datastore + + ll.LinksetDataWriteProtected + + arguments + + + name + + tooltip + key for the name:value pair. + type + string + + + + value + + tooltip + value to store in the linkset's datastore. + type + string + + + + pass + + tooltip + Pass phrase to access protected data. + type + string + + + + energy + 10 + return + integer + sleep + 0 + tooltip + Sets a name:value pair in the linkset's datastore + + ll.List2CSV + + arguments + + + ListVariable + + tooltip + + type + list + + + + energy + 10 + return + string + sleep + 0 + tooltip + Creates a string of comma separated values from the list.\nCreate a string of comma separated values from the specified list. + + ll.List2Float + + arguments + + + ListVariable + + tooltip + + type + list + + + + Index + + tooltip + + type + integer + + + + energy + 10 + return + float + sleep + 0 + tooltip + Copies the float at Index in the list.\nReturns the value at Index in the specified list. If Index describes a location not in the list, or the value cannot be type-cast to a float, then zero is returned. + + ll.List2Integer + + arguments + + + ListVariable + + tooltip + + type + list + + + + Index + + tooltip + + type + integer + + + + energy + 10 + return + integer + sleep + 0 + tooltip + Copies the integer at Index in the list.\nReturns the value at Index in the specified list. If Index describes a location not in the list, or the value cannot be type-cast to an integer, then zero is returned. + + ll.List2Json + + arguments + + + JsonType + + tooltip + Type is JSON_ARRAY or JSON_OBJECT. + type + string + + + + Values + + tooltip + List of values to convert. + type + list + + + + energy + 10 + return + string + sleep + 0 + tooltip + Converts either a strided list of key:value pairs to a JSON_OBJECT, or a list of values to a JSON_ARRAY. + + ll.List2Key + + arguments + + + ListVariable + + tooltip + + type + list + + + + Index + + tooltip + + type + integer + + + + energy + 10 + return + key + sleep + 0 + tooltip + Copies the key at Index in the list.\nReturns the value at Index in the specified list. If Index describes a location not in the list, or the value cannot be type-cast to a key, then null string is returned. + + ll.List2List + + arguments + + + ListVariable + + tooltip + + type + list + + + + Start + + tooltip + + type + integer + + + + End + + tooltip + + type + integer + + + + energy + 10 + return + list + sleep + 0 + tooltip + Returns a subset of entries from ListVariable, in a range specified by the Start and End indicies (inclusive).\nUsing negative numbers for Start and/or End causes the index to count backwards from the length of the string, so 0, -1 would capture the entire string.\nIf Start is greater than End, the sub string is the exclusion of the entries. + + ll.List2ListSlice + + arguments + + + ListVariable + + tooltip + + type + list + + + + Start + + tooltip + + type + integer + + + + End + + tooltip + + type + integer + + + + Stride + + tooltip + + type + integer + + + + slice_index + + tooltip + + type + integer + + + + energy + 10 + return + list + sleep + 0 + tooltip + Returns a subset of entries from ListVariable, in a range specified by Start and End indices (inclusive) return the slice_index element of each stride.\n Using negative numbers for Start and/or End causes the index to count backwards from the length of the list. (e.g. 0, -1 captures entire list)\nIf slice_index is less than 0, it is counted backwards from the end of the stride.\n Stride must be a positive integer > 0 or an empy list is returned. If slice_index falls outside range of stride, an empty list is returned. slice_index is zero-based. (e.g. A stride of 2 has valid indices 0,1) + + ll.List2ListStrided + + arguments + + + ListVariable + + tooltip + + type + list + + + + Start + + tooltip + + type + integer + + + + End + + tooltip + + type + integer + + + + Stride + + tooltip + + type + integer + + + + energy + 10 + return + list + sleep + 0 + tooltip + Copies the strided slice of the list from Start to End.\nReturns a copy of the strided slice of the specified list from Start to End. + + ll.List2Rot + + arguments + + + ListVariable + + tooltip + + type + list + + + + Index + + tooltip + + type + integer + + + + energy + 10 + return + rotation + sleep + 0 + tooltip + Copies the rotation at Index in the list.\nReturns the value at Index in the specified list. If Index describes a location not in the list, or the value cannot be type-cast to rotation, thenZERO_ROTATION is returned. + + ll.List2String + + arguments + + + ListVariable + + tooltip + + type + list + + + + Index + + tooltip + + type + integer + + + + energy + 10 + return + string + sleep + 0 + tooltip + Copies the string at Index in the list.\nReturns the value at Index in the specified list as a string. If Index describes a location not in the list then null string is returned. + + ll.List2Vector + + arguments + + + ListVariable + + tooltip + + type + list + + + + Index + + tooltip + + type + integer + + + + energy + 10 + return + vector + sleep + 0 + tooltip + Copies the vector at Index in the list.\nReturns the value at Index in the specified list. If Index describes a location not in the list, or the value cannot be type-cast to a vector, then ZERO_VECTOR is returned. + + ll.ListFindList + + arguments + + + ListVariable + + tooltip + + type + list + + + + Find + + tooltip + + type + list + + + + energy + 10 + return + integer + sleep + 0 + tooltip + Returns the index of the first instance of Find in ListVariable. Returns -1 if not found.\nReturns the position of the first instance of the Find list in the ListVariable. Returns -1 if not found. + + ll.ListFindListNext + + arguments + + + ListVariable + + tooltip + + type + list + + + + Find + + tooltip + + type + list + + + + Instance + + tooltip + + type + integer + + + + energy + 10 + return + integer + sleep + 0 + tooltip + Returns the index of the nth instance of Find in ListVariable. Returns -1 if not found. + + ll.ListFindStrided + + arguments + + + ListVariable + + tooltip + + type + list + + + + Find + + tooltip + + type + list + + + + Start + + tooltip + + type + integer + + + + End + + tooltip + + type + integer + + + + Stride + + tooltip + + type + integer + + + + energy + 10 + return + integer + sleep + 0 + tooltip + Returns the index of the first instance of Find in ListVariable. Returns -1 if not found.\nReturns the position of the first instance of the Find list in the ListVariable after the start index and before the end index. Steps through ListVariable by stride. Returns -1 if not found. + + ll.ListInsertList + + arguments + + + Target + + tooltip + + type + list + + + + ListVariable + + tooltip + + type + list + + + + Position + + tooltip + + type + integer + + + + energy + 10 + return + list + sleep + 0 + tooltip + Returns a list that contains all the elements from Target but with the elements from ListVariable inserted at Position start.\nReturns a new list, created by inserting ListVariable into the Target list at Position. Note this does not alter the Target. + + ll.ListRandomize + + arguments + + + ListVariable + + tooltip + + type + list + + + + Stride + + tooltip + + type + integer + + + + energy + 10 + return + list + sleep + 0 + tooltip + Returns a version of the input ListVariable which has been randomized by blocks of size Stride.\nIf the remainder from the length of the list, divided by the stride is non-zero, this function does not randomize the list. + + ll.ListReplaceList + + arguments + + + Target + + tooltip + + type + list + + + + ListVariable + + tooltip + + type + list + + + + Start + + tooltip + + type + integer + + + + End + + tooltip + + type + integer + + + + energy + 10 + return + list + sleep + 0 + tooltip + Returns a list that is Target with Start through End removed and ListVariable inserted at Start.\nReturns a list replacing the slice of the Target list from Start to End with the specified ListVariable. Start and End are inclusive, so 0, 1 would replace the first two entries and 0, 0 would replace only the first list entry. + + ll.ListSort + + arguments + + + ListVariable + + tooltip + List to sort. + type + list + + + + Stride + + tooltip + Stride length. + type + integer + + + + Ascending + + tooltip + Boolean. TRUE = result in ascending order, FALSE = result in descending order. + type + integer + + + + energy + 10 + return + list + sleep + 0 + tooltip + Returns the specified list, sorted into blocks of stride in ascending order (if Ascending is TRUE, otherwise descending). Note that sort only works if the first entry of each block is the same datatype. + + ll.ListSortStrided + + arguments + + + ListVariable + + tooltip + List to sort. + type + list + + + + Stride + + tooltip + Stride length. + type + integer + + + + Sortkey + + tooltip + The zero based element within the stride to use as the sort key + type + integer + + + + Ascending + + tooltip + Boolean. TRUE = result in ascending order, FALSE = result in descending order. + type + integer + + + + energy + 10 + return + list + sleep + 0 + tooltip + Returns the specified list, sorted by the specified element into blocks of stride in ascending order (if Ascending is TRUE, otherwise descending). Note that sort only works if the first entry of each block is the same datatype. + + ll.ListStatistics + + arguments + + + Operation + + tooltip + One of LIST_STAT_* values + type + integer + + + + ListVariable + + tooltip + Variable to analyze. + type + list + + + + energy + 10 + return + float + sleep + 0 + tooltip + Performs a statistical aggregate function, specified by a LIST_STAT_* constant, on ListVariables.\nThis function allows a script to perform a statistical operation as defined by operation on a list composed of integers and floats. + + ll.Listen + + arguments + + + Channel + + tooltip + + type + integer + + + + SpeakersName + + tooltip + + type + string + + + + SpeakersID + + tooltip + + type + key + + + + Text + + tooltip + + type + string + + + + energy + 10 + return + integer + sleep + 0 + tooltip + Creates a listen callback for Text on Channel from SpeakersName and SpeakersID (SpeakersName, SpeakersID, and/or Text can be empty) and returns an identifier that can be used to deactivate or remove the listen.\nNon-empty values for SpeakersName, SpeakersID, and Text will filter the results accordingly, while empty strings and NULL_KEY will not filter the results, for string and key parameters respectively.\nPUBLIC_CHANNEL is the public chat channel that all avatars see as chat text. DEBUG_CHANNEL is the script debug channel, and is also visible to nearby avatars. All other channels are are not sent to avatars, but may be used to communicate with scripts. + + ll.ListenControl + + arguments + + + ChannelHandle + + tooltip + + type + integer + + + + Active + + tooltip + + type + integer + + + + energy + 10 + return + void + sleep + 0 + tooltip + Makes a listen event callback active or inactive. Pass in the value returned from llListen to the iChannelHandle parameter to specify which listener you are controlling.\nUse boolean values to specify Active + + ll.ListenRemove + + arguments + + + ChannelHandle + + tooltip + + type + integer + + + + energy + 10 + return + void + sleep + 0 + tooltip + Removes a listen event callback. Pass in the value returned from llListen to the iChannelHandle parameter to specify which listener to remove. + + ll.LoadURL + + arguments + + + AvatarID + + tooltip + + type + key + + + + Text + + tooltip + + type + string + + + + URL + + tooltip + + type + string + + + + energy + 10 + return + void + sleep + 0.1000000000000000055511151 + tooltip + Shows dialog to avatar AvatarID offering to load web page at URL. If user clicks yes, launches their web browser.\nllLoadURL displays a dialogue box to the user, offering to load the specified web page using the default web browser. + + ll.Log + + arguments + + + Value + + tooltip + + type + float + + + + energy + 10 + return + float + sleep + 0 + tooltip + Returns the natural logarithm of Value. Returns zero if Value <= 0.\nReturns the base e (natural) logarithm of the specified Value. + + ll.Log10 + + arguments + + + Value + + tooltip + + type + float + + + + energy + 10 + return + float + sleep + 0 + tooltip + Returns the base 10 logarithm of Value. Returns zero if Value <= 0.\nReturns the base 10 (common) logarithm of the specified Value. + + ll.LookAt + + arguments + + + Target + + tooltip + + type + vector + + + + Strength + + tooltip + + type + float + + + + Damping + + tooltip + + type + float + + + + energy + 10 + return + void + sleep + 0 + tooltip + Cause object name to point its forward axis towards Target, at a force controlled by Strength and Damping.\nGood Strength values are around half the mass of the object and good Damping values are less than 1/10th of the Strength.\nAsymmetrical shapes require smaller Damping. A Strength of 0.0 cancels the look at. + + ll.LoopSound + + arguments + + + Sound + + tooltip + + type + string + + + + Volume + + tooltip + + type + float + + + + energy + 10 + return + void + sleep + 0 + tooltip + Plays specified Sound, looping indefinitely, at Volume (0.0 - 1.0).\nOnly one sound may be attached to an object at a time.\nA second call to llLoopSound with the same key will not restart the sound, but the new volume will be used. This allows control over the volume of already playing sounds.\nSetting the volume to 0 is not the same as calling llStopSound; a sound with 0 volume will continue to loop.\nTo restart the sound from the beginning, call llStopSound before calling llLoopSound again. + + ll.LoopSoundMaster + + arguments + + + Sound + + tooltip + + type + string + + + + Volume + + tooltip + + type + float + + + + energy + 10 + return + void + sleep + 0 + tooltip + Plays attached Sound, looping at volume (0.0 - 1.0), and declares it a sync master.\nBehaviour is identical to llLoopSound, with the addition of marking the source as a "Sync Master", causing "Slave" sounds to sync to it. If there are multiple masters within a viewers interest area, the most audible one (a function of both distance and volume) will win out as the master.\nThe use of multiple masters within a small area is unlikely to produce the desired effect. + + ll.LoopSoundSlave + + arguments + + + Sound + + tooltip + + type + string + + + + Volume + + tooltip + + type + float + + + + energy + 10 + return + void + sleep + 0 + tooltip + Plays attached sound looping at volume (0.0 - 1.0), synced to most audible sync master.\nBehaviour is identical to llLoopSound, unless there is a "Sync Master" present.\nIf a Sync Master is already playing the Slave sound will begin playing from the same point the master is in its loop synchronizing the loop points of both sounds.\nIf a Sync Master is started when the Slave is already playing, the Slave will skip to the correct position to sync with the Master. + + ll.MD5String + + arguments + + + Text + + tooltip + + type + string + + + + Nonce + + tooltip + + type + integer + + + + energy + 10 + return + string + sleep + 0 + tooltip + Returns a string of 32 hex characters that is an RSA Data Security Inc., MD5 Message-Digest Algorithm of Text with Nonce used as the salt.\nReturns a 32-character hex string. (128-bit in binary.) + + ll.MakeExplosion + + arguments + + + Particles + + tooltip + + type + integer + + + + Scale + + tooltip + + type + float + + + + Velocity + + tooltip + + type + float + + + + Lifetime + + tooltip + + type + float + + + + Arc + + tooltip + + type + float + + + + Texture + + tooltip + + type + string + + + + Offset + + tooltip + + type + vector + + + + deprecated + 1 + energy + 10 + return + void + sleep + 0.1000000000000000055511151 + tooltip + Make a round explosion of particles. Deprecated: Use llParticleSystem instead.\nMake a round explosion of particles using texture from the objects inventory. Deprecated: Use llParticleSystem instead. + + ll.MakeFire + + arguments + + + Particles + + tooltip + + type + integer + + + + Scale + + tooltip + + type + float + + + + Velocity + + tooltip + + type + float + + + + Lifetime + + tooltip + + type + float + + + + Arc + + tooltip + + type + float + + + + Texture + + tooltip + + type + string + + + + Offset + + tooltip + + type + vector + + + + deprecated + 1 + energy + 10 + return + void + sleep + 0.1000000000000000055511151 + tooltip + Make fire like particles. Deprecated: Use llParticleSystem instead.\nMake fire particles using texture from the objects inventory. Deprecated: Use llParticleSystem instead. + + ll.MakeFountain + + arguments + + + Particles + + tooltip + + type + integer + + + + Scale + + tooltip + + type + float + + + + Velocity + + tooltip + + type + float + + + + Lifetime + + tooltip + + type + float + + + + Arc + + tooltip + + type + float + + + + Bounce + + tooltip + + type + integer + + + + Texture + + tooltip + + type + string + + + + Offset + + tooltip + + type + vector + + + + Bounce_Offset + + tooltip + + type + float + + + + deprecated + 1 + energy + 10 + return + void + sleep + 0.1000000000000000055511151 + tooltip + Make a fountain of particles. Deprecated: Use llParticleSystem instead.\nMake a fountain of particles using texture from the objects inventory. Deprecated: Use llParticleSystem instead. + + ll.MakeSmoke + + arguments + + + Particles + + tooltip + + type + integer + + + + Scale + + tooltip + + type + float + + + + Velocity + + tooltip + + type + float + + + + Lifetime + + tooltip + + type + float + + + + Arc + + tooltip + + type + float + + + + Texture + + tooltip + + type + string + + + + Offset + + tooltip + + type + vector + + + + deprecated + 1 + energy + 10 + return + void + sleep + 0.1000000000000000055511151 + tooltip + Make smoke like particles. Deprecated: Use llParticleSystem instead.\nMake smoky particles using texture from the objects inventory. Deprecated: Use llParticleSystem instead. + + ll.ManageEstateAccess + + arguments + + + Action + + tooltip + One of the ESTATE_ACCESS_ALLOWED_* actions. + type + integer + + + + AvatarID + + tooltip + UUID of the avatar or group to act upon. + type + key + + + + energy + 10 + return + integer + sleep + 0 + tooltip + Adds or removes agents from the estate's agent access or ban lists, or groups to the estate's group access list. Action is one of the ESTATE_ACCESS_ALLOWED_* operations to perform.\nReturns an integer representing a boolean, TRUE if the call was successful; FALSE if throttled, invalid action, invalid or null id or object owner is not allowed to manage the estate.\nThe object owner is notified of any changes, unless PERMISSION_SILENT_ESTATE_MANAGEMENT has been granted to the script. + + ll.MapBeacon + + arguments + + + RegionName + + tooltip + Region in which to show the beacon. + type + string + + + + Position + + tooltip + Position within region to show the beacon. + type + vector + + + + Options + + tooltip + Options + type + list + + + + energy + 10 + return + void + sleep + 1 + tooltip + Displays an in world beacon and optionally opens world map for avatar who touched the object or is wearing the script, centered on RegionName with Position highlighted. Only works for scripts attached to avatar, or during touch events. + + ll.MapDestination + + arguments + + + RegionName + + tooltip + + type + string + + + + Position + + tooltip + + type + vector + + + + Direction + + tooltip + + type + vector + + + + energy + 10 + return + void + sleep + 1 + tooltip + Opens world map for avatar who touched is is wearing the script, centred on RegionName with Position highlighted. Only works for scripts attached to avatar, or during touch events.\nDirection currently has no effect. + + ll.MessageLinked + + arguments + + + LinkNumber + + tooltip + + type + integer + + + + Number + + tooltip + + type + integer + + + + Text + + tooltip + + type + string + + + + ID + + tooltip + + type + key + + + + energy + 10 + return + void + sleep + 0 + tooltip + Sends Number, Text, and ID to members of the link set identified by LinkNumber.\nLinkNumber is either a linked number (available through llGetLinkNumber) or a LINK_* constant. + + ll.MinEventDelay + + arguments + + + Delay + + tooltip + + type + float + + + + energy + 10 + return + void + sleep + 0 + tooltip + Set the minimum time between events being handled. + + ll.ModPow + + arguments + + + Value + + tooltip + + type + integer + + + + Power + + tooltip + + type + integer + + + + Modulus + + tooltip + + type + integer + + + + energy + 10 + return + integer + sleep + 0 + tooltip + Returns a Value raised to the Power, mod Modulus. ((a**b)%c) b is capped at 0xFFFF (16 bits).\nReturns (Value ^ Power) % Modulus. (Value raised to the Power, Modulus). Value is capped at 0xFFFF (16 bits). + + ll.ModifyLand + + arguments + + + Action + + tooltip + LAND_LEVEL, LAND_RAISE, LAND_LOWER, LAND_SMOOTH, LAND_NOISE or LAND_REVERT + type + integer + + + + Area + + tooltip + 0, 1, 2 (2m x 2m, 4m x 4m, or 8m x 8m) + type + integer + + + + energy + 10 + return + void + sleep + 0 + tooltip + Modify land with action (LAND_LEVEL, LAND_RAISE, LAND_LOWER, LAND_SMOOTH, LAND_NOISE, LAND_REVERT) on size (0, 1, 2, corresponding to 2m x 2m, 4m x 4m, 8m x 8m). + + ll.MoveToTarget + + arguments + + + Target + + tooltip + + type + vector + + + + Tau + + tooltip + + type + float + + + + energy + 10 + return + void + sleep + 0 + tooltip + Critically damp to Target in Tau seconds (if the script is physical).\nCritically damp to position target in tau-seconds if the script is physical. Good tau-values are greater than 0.2. A tau of 0.0 stops the critical damping. + + ll.Name2Key + + arguments + + + Name + + tooltip + Name of agent in region to look up. + type + string + + + + energy + 10 + return + key + sleep + 0 + tooltip + Look up Agent ID for the named agent in the region. + + ll.NavigateTo + + arguments + + + Location + + tooltip + Region coordinates for the character to navigate to. + type + vector + + + + Options + + tooltip + List of parameters to control the type of path-finding used. Currently only FORCE_DIRECT_PATH supported. + type + list + + + + energy + 10 + return + void + sleep + 0 + tooltip + Navigate to destination.\nDirects an object to travel to a defined position in the region or adjacent regions. + + ll.OffsetTexture + + arguments + + + OffsetS + + tooltip + + type + float + + + + OffsetT + + tooltip + + type + float + + + + Face + + tooltip + + type + integer + + + + energy + 10 + return + void + sleep + 0.2000000000000000111022302 + tooltip + Sets the texture S and T offsets for the chosen Face.\nIf Face is ALL_SIDES this function sets the texture offsets for all faces. + + ll.OpenFloater + + arguments + + + floater_name + + tooltip + Identifier for floater to open + type + string + + + + url + + tooltip + URL to pass to floater + type + string + + + + params + + tooltip + Parameters to apply to open floater + type + list + + + + energy + 10 + return + integer + sleep + 0 + tooltip + Returns the value for header for request_id.\nReturns a string that is the value of the Header for HTTPRequestID. + + ll.OpenRemoteDataChannel + + arguments + + deprecated + 1 + energy + 10 + return + void + sleep + 1 + tooltip + This function is deprecated. + + ll.Ord + + arguments + + + value + + tooltip + The string to convert to Unicode. + type + string + + + + index + + tooltip + Index of character to convert to unicode. + type + integer + + + + energy + 10 + return + integer + sleep + 0 + tooltip + Returns the unicode value of the indicated character in the string. + + ll.OverMyLand + + arguments + + + ID + + tooltip + + type + key + + + + energy + 10 + return + integer + sleep + 0 + tooltip + Returns TRUE if id ID over land owned by the script owner, otherwise FALSE.\nReturns TRUE if key ID is over land owned by the object owner, FALSE otherwise. + + ll.OwnerSay + + arguments + + + Text + + tooltip + + type + string + + + + energy + 10 + return + void + sleep + 0 + tooltip + says Text to owner only (if owner is in region).\nSays Text to the owner of the object running the script, if the owner has been within the object's simulator since logging into Second Life, regardless of where they may be in-world. + + ll.ParcelMediaCommandList + + arguments + + + CommandList + + tooltip + A list of PARCEL_MEDIA_COMMAND_* flags and their parameters + type + list + + + + energy + 10 + return + void + sleep + 2 + tooltip + Controls the playback of multimedia resources on a parcel or for an agent, via one or more PARCEL_MEDIA_COMMAND_* arguments specified in CommandList. + + ll.ParcelMediaQuery + + arguments + + + QueryList + + tooltip + + type + list + + + + energy + 10 + return + list + sleep + 2 + tooltip + Queries the media properties of the parcel containing the script, via one or more PARCEL_MEDIA_COMMAND_* arguments specified in CommandList.\nThis function will only work if the script is contained within an object owned by the land-owner (or if the land is owned by a group, only if the object has been deeded to the group). + + ll.ParseString2List + + arguments + + + Text + + tooltip + + type + string + + + + Separators + + tooltip + + type + list + + + + Spacers + + tooltip + + type + list + + + + energy + 10 + return + list + sleep + 0 + tooltip + Converts Text into a list, discarding Separators, keeping Spacers (Separators and Spacers must be lists of strings, maximum of 8 each).\nSeparators and Spacers are lists of strings with a maximum of 8 entries each. + + ll.ParseStringKeepNulls + + arguments + + + Text + + tooltip + + type + string + + + + Separators + + tooltip + + type + list + + + + Spacers + + tooltip + + type + list + + + + energy + 10 + return + list + sleep + 0 + tooltip + Breaks Text into a list, discarding separators, keeping spacers, keeping any null values generated. (separators and spacers must be lists of strings, maximum of 8 each).\nllParseStringKeepNulls works almost exactly like llParseString2List, except that if a null is found it will add a null-string instead of discarding it like llParseString2List does. + + ll.ParticleSystem + + arguments + + + Parameters + + tooltip + + type + list + + + + energy + 10 + return + void + sleep + 0 + tooltip + Creates a particle system in the prim the script is attached to, based on Parameters. An empty list removes a particle system from object.\nList format is [ rule-1, data-1, rule-2, data-2 ... rule-n, data-n ]. + + ll.PassCollisions + + arguments + + + Pass + + tooltip + Boolean, if TRUE, collisions are passed from children on to parents. + type + integer + + + + energy + 10 + return + void + sleep + 0 + tooltip + Configures how collision events are passed to scripts in the linkset.\nIf Pass == TRUE, collisions involving collision-handling scripted child prims are also passed on to the root prim. If Pass == FALSE (default behavior), such collisions will only trigger events in the affected child prim. + + ll.PassTouches + + arguments + + + Pass + + tooltip + Boolean, if TRUE, touches are passed from children on to parents. + type + integer + + + + energy + 10 + return + void + sleep + 0 + tooltip + Configures how touch events are passed to scripts in the linkset.\nIf Pass == TRUE, touches involving touch-handling scripted child prims are also passed on to the root prim. If Pass == FALSE (default behavior), such touches will only trigger events in the affected child prim. + + ll.PatrolPoints + + arguments + + + Points + + tooltip + A list of vectors for the character to travel through sequentially. The list must contain at least two entries. + type + list + + + + Options + + tooltip + No options available at this time. + type + list + + + + energy + 10 + return + void + sleep + 0 + tooltip + Patrol a list of points.\nSets the points for a character (llCreateCharacter) to patrol along. + + ll.PlaySound + + arguments + + + Sound + + tooltip + + type + string + + + + Volume + + tooltip + + type + float + + + + energy + 10 + return + void + sleep + 0 + tooltip + Plays Sound once, at Volume (0.0 - 1.0) and attached to the object.\nOnly one sound may be attached to an object at a time, and attaching a new sound or calling llStopSound will stop the previously attached sound.\nA second call to llPlaySound with the same sound will not restart the sound, but the new volume will be used, which allows control over the volume of already playing sounds.\nTo restart the sound from the beginning, call llStopSound before calling llPlaySound again. + + ll.PlaySoundSlave + + arguments + + + Sound + + tooltip + + type + string + + + + Volume + + tooltip + + type + float + + + + energy + 10 + return + void + sleep + 0 + tooltip + Plays attached Sound once, at Volume (0.0 - 1.0), synced to next loop of most audible sync master.\nBehaviour is identical to llPlaySound, unless there is a "Sync Master" present. If a Sync Master is already playing, the Slave sound will not be played until the Master hits its loop point and returns to the beginning.\nllPlaySoundSlave will play the sound exactly once; if it is desired to have the sound play every time the Master loops, either use llLoopSoundSlave with extra silence padded on the end of the sound or ensure that llPlaySoundSlave is called at least once per loop of the Master. + + ll.Pow + + arguments + + + Value + + tooltip + + type + float + + + + Exponent + + tooltip + + type + float + + + + energy + 10 + return + float + sleep + 0 + tooltip + Returns the Value raised to the power Exponent, or returns 0 and triggers Math Error for imaginary results.\nReturns the Value raised to the Exponent. + + ll.PreloadSound + + arguments + + + Sound + + tooltip + + type + string + + + + energy + 10 + return + void + sleep + 1 + tooltip + Causes nearby viewers to preload the Sound from the object's inventory.\nThis is intended to prevent delays in starting new sounds when called upon. + + ll.Pursue + + arguments + + + TargetID + + tooltip + Agent or object to pursue. + type + key + + + + Options + + tooltip + Parameters for pursuit. + type + list + + + + energy + 10 + return + void + sleep + 0 + tooltip + Chase after a target.\nCauses the character (llCharacter) to pursue the target defined by TargetID. + + ll.PushObject + + arguments + + + ObjectID + + tooltip + + type + key + + + + Impulse + + tooltip + + type + vector + + + + AngularImpulse + + tooltip + + type + vector + + + + Local + + tooltip + + type + integer + + + + energy + 10 + return + void + sleep + 0 + tooltip + Applies Impulse and AngularImpulse to ObjectID.\nApplies the supplied impulse and angular impulse to the object specified. + + ll.ReadKeyValue + + arguments + + + Key + + tooltip + + type + string + + + + energy + 10 + return + key + sleep + 0 + tooltip + + Starts an asychronous transaction to retrieve the value associated with the key given. Will fail with XP_ERROR_KEY_NOT_FOUND if the key does not exist. The dataserver callback will be executed with the key returned from this call and a string describing the result. The result is a two element commma-delimited list. The first item is an integer specifying if the transaction succeeded (1) or not (0). In the failure case, the second item will be an integer corresponding to one of the XP_ERROR_... constants. In the success case the second item will be the value associated with the key. + + + ll.RefreshPrimURL + + arguments + + energy + 10 + return + void + sleep + 20 + tooltip + Reloads the web page shown on the sides of the object. + + ll.RegionSay + + arguments + + + Channel + + tooltip + Any integer value except zero. + type + integer + + + + Text + + tooltip + Message to be transmitted. + type + string + + + + energy + 10 + return + void + sleep + 0 + tooltip + Broadcasts Text to entire region on Channel (except for channel 0). + + ll.RegionSayTo + + arguments + + + TargetID + + tooltip + Avatar or object to say to. + type + key + + + + Channel + + tooltip + Output channel, any integer value. + type + integer + + + + Text + + tooltip + Message to be transmitted. + type + string + + + + energy + 10 + return + void + sleep + 0 + tooltip + Says Text, on Channel, to avatar or object indicated by TargetID (if within region).\nIf TargetID is an avatar and Channel is nonzero, Text can be heard by any attachment on the avatar. + + ll.ReleaseCamera + + arguments + + + AvatarID + + tooltip + + type + key + + + + deprecated + 1 + energy + 10 + return + void + sleep + 0 + tooltip + Return camera to agent.\nDeprecated: Use llClearCameraParams instead. + + ll.ReleaseControls + + arguments + + energy + 10 + return + void + sleep + 0 + tooltip + Stop taking inputs.\nStop taking inputs from the avatar. + + ll.ReleaseURL + + arguments + + + URL + + tooltip + URL to release. + type + string + + + + energy + 10 + return + void + sleep + 0 + tooltip + Releases the specified URL, which was previously obtained using llRequestURL. Once released, the URL will no longer be usable. + + ll.RemoteDataReply + + arguments + + + ChannelID + + tooltip + + type + key + + + + MessageID + + tooltip + + type + key + + + + sData + + tooltip + String data to send + type + string + + + + iData + + tooltip + Integer data to send + type + integer + + + + deprecated + 1 + energy + 10 + return + void + sleep + 3 + tooltip + This function is deprecated. + + ll.RemoteDataSetRegion + + arguments + + deprecated + 1 + energy + 10 + return + void + sleep + 0 + tooltip + This function is deprecated. + + ll.RemoteLoadScriptPin + + arguments + + + ObjectID + + tooltip + Target prim to attempt copying into. + type + key + + + + ScriptName + + tooltip + Name of the script in current inventory to copy. + type + string + + + + PIN + + tooltip + Integer set on target prim as a Personal Information Number code. + type + integer + + + + Running + + tooltip + If the script should be set running in the target prim. + type + integer + + + + StartParameter + + tooltip + Integer. Parameter passed to the script if set to be running. + type + integer + + + + energy + 10 + return + void + sleep + 3 + tooltip + If the owner of the object containing this script can modify the object identified by the specified object key, and if the PIN matches the PIN previously set using llSetRemoteScriptAccessPin (on the target prim), then the script will be copied into target. Running is a boolean specifying whether the script should be enabled once copied into the target object. + + ll.RemoveFromLandBanList + + arguments + + + AvatarID + + tooltip + + type + key + + + + energy + 10 + return + void + sleep + 0.1000000000000000055511151 + tooltip + Remove avatar from the land ban list.\nRemove specified avatar from the land parcel ban list. + + ll.RemoveFromLandPassList + + arguments + + + AvatarID + + tooltip + + type + key + + + + energy + 10 + return + void + sleep + 0.1000000000000000055511151 + tooltip + Remove avatar from the land pass list.\nRemove specified avatar from the land parcel pass list. + + ll.RemoveInventory + + arguments + + + InventoryItem + + tooltip + + type + string + + + + energy + 10 + return + void + sleep + 0 + tooltip + Remove the named inventory item.\nRemove the named inventory item from the object inventory. + + ll.RemoveVehicleFlags + + arguments + + + Vehiclelags + + tooltip + + type + integer + + + + energy + 10 + return + void + sleep + 0 + tooltip + Removes the enabled bits in 'flags'.\nSets the vehicle flags to FALSE. Valid parameters can be found in the vehicle flags constants section. + + ll.ReplaceAgentEnvironment + + arguments + + + agent_id + + tooltip + + type + key + + + + transition + + tooltip + + type + float + + + + environment + + tooltip + + type + string + + + + energy + 10 + return + integer + sleep + 0 + tooltip + Replaces the entire environment for an agent. Must be used as part of an experience. + + ll.ReplaceEnvironment + + arguments + + + position + + tooltip + Location of parcel to change. Use <-1, -1, -1> for entire region. + type + vector + + + + environment + + tooltip + + Name of inventory item, or UUID of environment resource to apply. + Use NULL_KEY or empty string to remove environment. + + type + string + + + + track_no + + tooltip + Elevation zone of where to apply environment. Use -1 for all. + type + integer + + + + day_length + + tooltip + Length of day cycle for this parcel or region. -1 to leave unchanged. + type + integer + + + + day_offset + + tooltip + Offset from GMT for the day cycle on this parcel or region. -1 to leave unchanged. + type + integer + + + + energy + 10 + return + integer + sleep + 0 + tooltip + Replaces the environment for a parcel or region. + + ll.ReplaceSubString + + arguments + + + InitialString + + tooltip + The original string in which to hunt for substring matches. + type + string + + + + SubString + + tooltip + The original substring to find. + type + string + + + + NewSubString + + tooltip + The new substring used to replace. + type + string + + + + Count + + tooltip + The max number of replacements to make. Zero Count means "replace all". Positive Count moves left to right. Negative moves right to left. + type + integer + + + + energy + 10 + return + string + sleep + 0 + tooltip + Searches InitialString and replaces instances of SubString with NewSubString. Zero Count means "replace all". Positive Count moves left to right. Negative moves right to left. + + ll.RequestAgentData + + arguments + + + AvatarID + + tooltip + + type + key + + + + Data + + tooltip + + type + integer + + + + energy + 10 + return + key + sleep + 0.1000000000000000055511151 + tooltip + Requests data about AvatarID. When data is available the dataserver event will be raised.\nThis function requests data about an avatar. If and when the information is collected, the dataserver event is triggered with the key returned from this function passed in the requested parameter. See the agent data constants (DATA_*) for details about valid values of data and what each will return in the dataserver event. + + ll.RequestDisplayName + + arguments + + + AvatarID + + tooltip + Avatar UUID + type + key + + + + energy + 10 + return + key + sleep + 0 + tooltip + Requests the display name of the agent. When the display name is available the dataserver event will be raised.\nThe avatar identified does not need to be in the same region or online at the time of the request.\nReturns a key that is used to identify the dataserver event when it is raised. + + ll.RequestExperiencePermissions + + arguments + + + AgentID + + tooltip + + type + key + + + + unused + + tooltip + Not used, should be "" + type + string + + + + energy + 10 + return + void + sleep + 0 + tooltip + + Ask the agent for permission to participate in an experience. This request is similar to llRequestPermissions with the following permissions: PERMISSION_TAKE_CONTROLS, PERMISSION_TRIGGER_ANIMATION, PERMISSION_ATTACH, PERMISSION_TRACK_CAMERA, PERMISSION_CONTROL_CAMERA and PERMISSION_TELEPORT. However, unlike llRequestPermissions the decision to allow or block the request is persistent and applies to all scripts using the experience grid wide. Subsequent calls to llRequestExperiencePermissions from scripts in the experience will receive the same response automatically with no user interaction. One of experience_permissions or experience_permissions_denied will be generated in response to this call. Outstanding permission requests will be lost if the script is derezzed, moved to another region or reset. + + + ll.RequestInventoryData + + arguments + + + InventoryItem + + tooltip + + type + string + + + + energy + 10 + return + key + sleep + 1 + tooltip + Requests data for the named InventoryItem.\nWhen data is available, the dataserver event will be raised with the key returned from this function in the requested parameter.\nThe only request currently implemented is to request data from landmarks, where the data returned is in the form "<float, float, float>" which can be cast to a vector. This position is in region local coordinates. + + ll.RequestPermissions + + arguments + + + AvatarID + + tooltip + + type + key + + + + PermissionMask + + tooltip + + type + integer + + + + energy + 10 + return + void + sleep + 0 + tooltip + Ask AvatarID to allow the script to perform certain actions, specified in the PermissionMask bitmask. PermissionMask should be one or more PERMISSION_* constants. Multiple permissions can be requested simultaneously by ORing the constants together. Many of the permissions requests can only go to object owner.\nThis call will not stop script execution. If the avatar grants the requested permissions, the run_time_permissions event will be called. + + ll.RequestSecureURL + + arguments + + energy + 10 + return + key + sleep + 0 + tooltip + Requests one HTTPS:// (SSL) URL for use by this object. The http_request event is triggered with results.\nReturns a key that is the handle used for identifying the request in the http_request event. + + ll.RequestSimulatorData + + arguments + + + RegionName + + tooltip + + type + string + + + + Data + + tooltip + + type + integer + + + + energy + 10 + return + key + sleep + 1 + tooltip + Requests the specified Data about RegionName. When the specified data is available, the dataserver event is raised.\nData should use one of the DATA_SIM_* constants.\nReturns a dataserver query ID and triggers the dataserver event when data is found. + + ll.RequestURL + + arguments + + energy + 10 + return + key + sleep + 0 + tooltip + Requests one HTTP:// URL for use by this script. The http_request event is triggered with the result of the request.\nReturns a key that is the handle used for identifying the result in the http_request event. + + ll.RequestUserKey + + arguments + + + Name + + tooltip + Name of agent to look up. + type + string + + + + energy + 10 + return + key + sleep + 0 + tooltip + Look up Agent ID for the named agent using a historical name. + + ll.RequestUsername + + arguments + + + AvatarID + + tooltip + + type + key + + + + energy + 10 + return + key + sleep + 0 + tooltip + Requests single-word user-name of an avatar. When data is available the dataserver event will be raised.\nRequests the user-name of the identified agent. When the user-name is available the dataserver event is raised.\nThe agent identified does not need to be in the same region or online at the time of the request.\nReturns a key that is used to identify the dataserver event when it is raised. + + ll.ResetAnimationOverride + + arguments + + + AnimationState + + tooltip + + type + string + + + + energy + 10 + return + void + sleep + 0 + tooltip + Resets the animation of the specified animation state to the default value.\nIf animation state equals "ALL", then all animation states are reset. + + ll.ResetLandBanList + + arguments + + energy + 10 + return + void + sleep + 0.1000000000000000055511151 + tooltip + Removes all residents from the land ban list. + + ll.ResetLandPassList + + arguments + + energy + 10 + return + void + sleep + 0.1000000000000000055511151 + tooltip + Removes all residents from the land access/pass list. + + ll.ResetOtherScript + + arguments + + + ScriptName + + tooltip + + type + string + + + + energy + 10 + return + void + sleep + 0 + tooltip + Resets the named script. + + ll.ResetScript + + arguments + + energy + 10 + return + void + sleep + 0 + tooltip + Resets the script. + + ll.ResetTime + + arguments + + energy + 10 + return + void + sleep + 0 + tooltip + Sets the time to zero.\nSets the internal timer to zero. + + ll.ReturnObjectsByID + + arguments + + + ObjectIDs + + tooltip + List of object UUIDs to be returned. + type + list + + + + energy + 10 + return + integer + sleep + 0 + tooltip + Return objects using their UUIDs.\nRequires the PERMISSION_RETURN_OBJECTS permission and that the script owner owns the parcel the returned objects are in, or is an estate manager or region owner. + + ll.ReturnObjectsByOwner + + arguments + + + ID + + tooltip + Object owner's UUID. + type + key + + + + Scope + + tooltip + + type + integer + + + + energy + 10 + return + integer + sleep + 0 + tooltip + Return objects based upon their owner and a scope of parcel, parcel owner, or region.\nRequires the PERMISSION_RETURN_OBJECTS permission and that the script owner owns the parcel the returned objects are in, or is an estate manager or region owner. + + ll.RezAtRoot + + arguments + + + InventoryItem + + tooltip + + type + string + + + + Position + + tooltip + + type + vector + + + + Velocity + + tooltip + + type + vector + + + + Rotation + + tooltip + + type + rotation + + + + StartParameter + + tooltip + + type + integer + + + + energy + 200 + return + void + sleep + 0.1000000000000000055511151 + tooltip + Instantiate owner's InventoryItem at Position with Velocity, Rotation and with StartParameter. The last selected root object's location will be set to Position.\nCreates object's inventory item at the given Position, with Velocity, Rotation, and StartParameter. + + ll.RezObject + + arguments + + + InventoryItem + + tooltip + + type + string + + + + Position + + tooltip + + type + vector + + + + Velocity + + tooltip + + type + vector + + + + Rotation + + tooltip + + type + rotation + + + + StartParameter + + tooltip + + type + integer + + + + energy + 200 + return + void + sleep + 0.1000000000000000055511151 + tooltip + Instantiate owners InventoryItem at Position with Velocity, Rotation and with start StartParameter.\nCreates object's inventory item at Position with Velocity and Rotation supplied. The StartParameter value will be available to the newly created object in the on_rez event or through the llGetStartParameter function.\nThe Velocity parameter is ignored if the rezzed object is not physical. + + ll.RezObjectWithParams + + arguments + + + InventoryItem + + tooltip + + type + string + + + + Parms + + tooltip + + type + list + + + + energy + 200 + return + key + sleep + 0.1000000000000000055511151 + tooltip + Instantiate owner's InventoryItem with the given parameters. + + ll.Rot2Angle + + arguments + + + Rotation + + tooltip + + type + rotation + + + + energy + 10 + return + float + sleep + 0 + tooltip + Returns the rotation angle represented by Rotation.\nReturns the angle represented by the Rotation. + + ll.Rot2Axis + + arguments + + + Rotation + + tooltip + + type + rotation + + + + energy + 10 + return + vector + sleep + 0 + tooltip + Returns the rotation axis represented by Rotation.\nReturns the axis represented by the Rotation. + + ll.Rot2Euler + + arguments + + + Rotation + + tooltip + + type + rotation + + + + energy + 10 + return + vector + sleep + 0 + tooltip + Returns the Euler representation (roll, pitch, yaw) of Rotation.\nReturns the Euler Angle representation of the Rotation. + + ll.Rot2Fwd + + arguments + + + Rotation + + tooltip + + type + rotation + + + + energy + 10 + return + vector + sleep + 0 + tooltip + Returns the forward vector defined by Rotation.\nReturns the forward axis represented by the Rotation. + + ll.Rot2Left + + arguments + + + Rotation + + tooltip + + type + rotation + + + + energy + 10 + return + vector + sleep + 0 + tooltip + Returns the left vector defined by Rotation.\nReturns the left axis represented by the Rotation. + + ll.Rot2Up + + arguments + + + Rotation + + tooltip + + type + rotation + + + + energy + 10 + return + vector + sleep + 0 + tooltip + Returns the up vector defined by Rotation.\nReturns the up axis represented by the Rotation. + + ll.RotBetween + + arguments + + + Vector1 + + tooltip + + type + vector + + + + Vector2 + + tooltip + + type + vector + + + + energy + 10 + return + rotation + sleep + 0 + tooltip + Returns the rotation to rotate Vector1 to Vector2.\nReturns the rotation needed to rotate Vector1 to Vector2. + + ll.RotLookAt + + arguments + + + Rotation + + tooltip + + type + rotation + + + + Strength + + tooltip + + type + float + + + + Damping + + tooltip + + type + float + + + + energy + 10 + return + void + sleep + 0 + tooltip + Cause object to rotate to Rotation, with a force function defined by Strength and Damping parameters. Good strength values are around half the mass of the object and good damping values are less than 1/10th of the strength.\nAsymmetrical shapes require smaller damping.\nA strength of 0.0 cancels the look at. + + ll.RotTarget + + arguments + + + Rotation + + tooltip + + type + rotation + + + + LeeWay + + tooltip + + type + float + + + + energy + 10 + return + integer + sleep + 0 + tooltip + Set rotations with error of LeeWay radians as a rotational target, and return an ID for the rotational target.\nThe returned number is a handle that can be used in at_rot_target and llRotTargetRemove. + + ll.RotTargetRemove + + arguments + + + Handle + + tooltip + + type + integer + + + + energy + 10 + return + void + sleep + 0 + tooltip + Removes rotational target number.\nRemove rotational target indicated by the handle. + + ll.RotateTexture + + arguments + + + Radians + + tooltip + + type + float + + + + Face + + tooltip + + type + integer + + + + energy + 10 + return + void + sleep + 0.2000000000000000111022302 + tooltip + Sets the texture rotation for the specified Face to angle Radians.\nIf Face is ALL_SIDES, rotates the texture of all sides. + + ll.Round + + arguments + + + Value + + tooltip + + type + float + + + + energy + 10 + return + integer + sleep + 0 + tooltip + Returns Value rounded to the nearest integer.\nReturns the Value rounded to the nearest integer. + + ll.SHA1String + + arguments + + + Text + + tooltip + + type + string + + + + energy + 10 + return + string + sleep + 0 + tooltip + Returns a string of 40 hex characters that is the SHA1 security hash of text. + + ll.SHA256String + + arguments + + + text + + tooltip + + type + string + + + + energy + 10 + return + string + sleep + 0 + tooltip + Returns a string of 64 hex characters that is the SHA256 security hash of text. + + ll.SameGroup + + arguments + + + ID + + tooltip + + type + key + + + + energy + 10 + return + integer + sleep + 0 + tooltip + Returns TRUE if avatar ID is in the same region and has the same active group, otherwise FALSE.\nReturns TRUE if the object or agent identified is in the same simulator and has the same active group as this object. Otherwise, returns FALSE. + + ll.Say + + arguments + + + Channel + + tooltip + Channel to use to say text on. + type + integer + + + + Text + + tooltip + Text to say. + type + string + + + + energy + 10 + return + void + sleep + 0 + tooltip + Says Text on Channel.\nThis chat method has a range of 20m radius.\nPUBLIC_CHANNEL is the public chat channel that all avatars see as chat text. DEBUG_CHANNEL is the script debug channel, and is also visible to nearby avatars. All other channels are are not sent to avatars, but may be used to communicate with scripts. + + ll.ScaleByFactor + + arguments + + + ScalingFactor + + tooltip + The multiplier to be used with the prim sizes and their local positions. + type + float + + + + energy + 10 + return + integer + sleep + 0 + tooltip + Attempts to resize the entire object by ScalingFactor, maintaining the size-position ratios of the prims.\n\nResizing is subject to prim scale limits and linkability limits. This function can not resize the object if the linkset is physical, a pathfinding character, in a keyframed motion, or if resizing would cause the parcel to overflow.\nReturns a boolean (an integer) TRUE if it succeeds, FALSE if it fails. + + ll.ScaleTexture + + arguments + + + Horizontal + + tooltip + + type + float + + + + Vertical + + tooltip + + type + float + + + + Face + + tooltip + + type + integer + + + + energy + 10 + return + void + sleep + 0.2000000000000000111022302 + tooltip + Sets the diffuse texture Horizontal and Vertical repeats on Face of the prim the script is attached to.\nIf Face == ALL_SIDES, all sides are set in one call.\nNegative values for horizontal and vertical will flip the texture. + + ll.ScriptDanger + + arguments + + + Position + + tooltip + + type + vector + + + + energy + 10 + return + integer + sleep + 0 + tooltip + Returns TRUE if Position is over public land, sandbox land, land that doesn't allow everyone to edit and build, or land that doesn't allow outside scripts.\nReturns true if the position is over public land, land that doesn't allow everyone to edit and build, or land that doesn't allow outside scripts. + + ll.ScriptProfiler + + arguments + + + State + + tooltip + PROFILE_NONE or PROFILE_SCRIPT_MEMORY flags to control the state. + type + integer + + + + energy + 10 + return + void + sleep + 0 + tooltip + Enables or disables script profiling options. Currently only supports PROFILE_SCRIPT_MEMORY (Mono only) and PROFILE_NONE.\nMay significantly reduce script performance. + + ll.SendRemoteData + + arguments + + + ChannelID + + tooltip + + type + key + + + + Destination + + tooltip + + type + string + + + + Value + + tooltip + + type + integer + + + + Text + + tooltip + + type + string + + + + deprecated + 1 + energy + 10 + return + key + sleep + 3 + tooltip + This function is deprecated. + + ll.Sensor + + arguments + + + Name + + tooltip + Object or avatar name. + type + string + + + + ID + + tooltip + Object or avatar UUID. + type + key + + + + Type + + tooltip + Bit-field mask of AGENT, AGENT_BY_LEGACY_NAME, AGENT_BY_USERNAME, ACTIVE, PASSIVE, and/or SCRIPTED + type + integer + + + + Range + + tooltip + Distance to scan. 0.0 - 96.0m. + type + float + + + + Arc + + tooltip + Angle, in radians, from the local x-axis of the prim to scan. + type + float + + + + energy + 10 + return + void + sleep + 0 + tooltip + Performs a single scan for Name and ID with Type (AGENT, ACTIVE, PASSIVE, and/or SCRIPTED) within Range meters and Arc radians of forward vector.\nSpecifying a blank Name, 0 Type, or NULL_KEY ID will prevent filtering results based on that parameter. A range of 0.0 does not perform a scan.\nResults are returned in the sensor and no_sensor events. + + ll.SensorRemove + + arguments + + energy + 10 + return + void + sleep + 0 + tooltip + removes sensor.\nRemoves the sensor set by llSensorRepeat. + + ll.SensorRepeat + + arguments + + + Name + + tooltip + Object or avatar name. + type + string + + + + ID + + tooltip + Object or avatar UUID. + type + key + + + + Type + + tooltip + Bit-field mask of AGENT, AGENT_BY_LEGACY_NAME, AGENT_BY_USERNAME, ACTIVE, PASSIVE, and/or SCRIPTED + type + integer + + + + Range + + tooltip + Distance to scan. 0.0 - 96.0m. + type + float + + + + Arc + + tooltip + Angle, in radians, from the local x-axis of the prim to scan. + type + float + + + + Rate + + tooltip + Period, in seconds, between scans. + type + float + + + + energy + 10 + return + void + sleep + 0 + tooltip + Initiates a periodic scan every Rate seconds, for Name and ID with Type (AGENT, ACTIVE, PASSIVE, and/or SCRIPTED) within Range meters and Arc radians of forward vector.\nSpecifying a blank Name, 0 Type, or NULL_KEY ID will prevent filtering results based on that parameter. A range of 0.0 does not perform a scan.\nResults are returned in the sensor and no_sensor events. + + ll.SetAgentEnvironment + + arguments + + + agent_id + + tooltip + Agent to receive new environment settings. + type + key + + + + transition + + tooltip + Number of seconds over which to apply new settings. + type + float + + + + Settings + + tooltip + List of environment settings to replace for agent. + type + list + + + + energy + 10 + return + integer + sleep + 0 + tooltip + Sets an agent's environmental values to the specified values. Must be used as part of an experience. + + ll.SetAgentRot + + arguments + + + rot + + tooltip + Rotation to turn the avatar to face. + type + rotation + + + + flags + + tooltip + flags + type + integer + + + + energy + 10 + return + void + sleep + 0 + tooltip + Sets the avatar rotation to the given value. + + ll.SetAlpha + + arguments + + + Opacity + + tooltip + + type + float + + + + Face + + tooltip + + type + integer + + + + energy + 10 + return + void + sleep + 0 + tooltip + Sets the alpha (opacity) of Face.\nSets the alpha (opacity) value for Face. If Face is ALL_SIDES, sets the alpha for all faces. The alpha value is interpreted as an opacity percentage (1.0 is fully opaque, and 0.2 is mostly transparent). This function will clamp alpha values less than 0.1 to 0.1 and greater than 1.0 to 1. + + ll.SetAngularVelocity + + arguments + + + AngVel + + tooltip + The angular velocity to set the object to. + type + vector + + + + Local + + tooltip + If TRUE, the AngVel is treated as a local directional vector instead of a regional directional vector. + type + integer + + + + energy + 10 + return + void + sleep + 0 + tooltip + Sets an object's angular velocity to AngVel, in local coordinates if Local == TRUE (if the script is physical).\nHas no effect on non-physical objects. + + ll.SetAnimationOverride + + arguments + + + AnimationState + + tooltip + + type + string + + + + AnimationName + + tooltip + + type + string + + + + energy + 10 + return + void + sleep + 0 + tooltip + Sets the animation (in object inventory) that will play for the given animation state.\nTo use this function the script must obtain the PERMISSION_OVERRIDE_ANIMATIONS permission. + + ll.SetBuoyancy + + arguments + + + Buoyancy + + tooltip + + type + float + + + + energy + 10 + return + void + sleep + 0 + tooltip + Set the tasks buoyancy (0 is none, < 1.0 sinks, 1.0 floats, > 1.0 rises).\nSet the object buoyancy. A value of 0 is none, less than 1.0 sinks, 1.0 floats, and greater than 1.0 rises. + + ll.SetCameraAtOffset + + arguments + + + Offset + + tooltip + + type + vector + + + + energy + 10 + return + void + sleep + 0 + tooltip + Sets the camera used in this object, at offset, if an avatar sits on it.\nSets the offset that an avatar's camera will be moved to if the avatar sits on the object. + + ll.SetCameraEyeOffset + + arguments + + + Offset + + tooltip + + type + vector + + + + energy + 10 + return + void + sleep + 0 + tooltip + Sets the camera eye offset used in this object if an avatar sits on it. + + ll.SetCameraParams + + arguments + + + Parameters + + tooltip + + type + list + + + + energy + 10 + return + void + sleep + 0 + tooltip + Sets multiple camera parameters at once. List format is [ rule-1, data-1, rule-2, data-2 . . . rule-n, data-n ]. + + ll.SetClickAction + + arguments + + + Action + + tooltip + A CLICK_ACTION_* flag + type + integer + + + + energy + 10 + return + void + sleep + 0 + tooltip + Sets the action performed when a prim is clicked upon. + + ll.SetColor + + arguments + + + Color + + tooltip + + type + vector + + + + Face + + tooltip + + type + integer + + + + energy + 10 + return + void + sleep + 0 + tooltip + Sets the color, for the face.\nSets the color of the side specified. If Face is ALL_SIDES, sets the color on all faces. + + ll.SetContentType + + arguments + + + HTTPRequestID + + tooltip + A valid http_request() key + type + key + + + + ContentType + + tooltip + Media type to use with any following llHTTPResponse(HTTPRequestID, ...) + type + integer + + + + energy + 10 + return + void + sleep + 0 + tooltip + Set the media type of an LSL HTTP server response to ContentType.\nHTTPRequestID must be a valid http_request ID. ContentType must be one of the CONTENT_TYPE_* constants. + + ll.SetDamage + + arguments + + + Damage + + tooltip + + type + float + + + + energy + 10 + return + void + sleep + 0 + tooltip + Sets the amount of damage that will be done to an avatar that this task hits. Task will be killed.\nSets the amount of damage that will be done to an avatar that this object hits. This object will be destroyed on damaging an avatar, and no collision event is triggered. + + ll.SetEnvironment + + arguments + + + Position + + tooltip + Location within the region. + type + vector + + + + EnvParams + + tooltip + List of environment settings to change for the specified parcel location. + type + list + + + + energy + 10 + return + integer + sleep + 0 + tooltip + Returns a string with the requested data about the region. + + ll.SetForce + + arguments + + + Force + + tooltip + Directional force. + type + vector + + + + Local + + tooltip + Boolean, if TRUE uses local axis, if FALSE uses region axis. + type + integer + + + + energy + 10 + return + void + sleep + 0 + tooltip + Sets Force on object, in object-local coordinates if Local == TRUE (otherwise, the region reference frame is used).\nOnly works on physical objects. + + ll.SetForceAndTorque + + arguments + + + Force + + tooltip + Directional force. + type + vector + + + + Torque + + tooltip + Torque force. + type + vector + + + + Local + + tooltip + Boolean, if TRUE uses local axis, if FALSE uses region axis. + type + integer + + + + energy + 10 + return + void + sleep + 0 + tooltip + Sets the Force and Torque of object, in object-local coordinates if Local == TRUE (otherwise, the region reference frame is used).\nOnly works on physical objects. + + ll.SetGroundTexture + + arguments + + + Changes + + tooltip + A list of ground texture properties to change. + type + list + + + + energy + 10 + return + integer + sleep + 0 + tooltip + Changes terrain texture properties in the region. + + ll.SetHoverHeight + + arguments + + + Height + + tooltip + Distance above the ground. + type + float + + + + Water + + tooltip + Boolean, if TRUE then hover above water too. + type + integer + + + + Tau + + tooltip + Seconds to critically damp in. + type + float + + + + energy + 10 + return + void + sleep + 0 + tooltip + Critically damps a physical object to a Height (either above ground level or above the higher of land and water if water == TRUE).\nDo not use with vehicles. Use llStopHover to stop hovering. + + ll.SetInventoryPermMask + + arguments + + + InventoryItem + + tooltip + An item in the prim's inventory + type + string + + + + PermissionFlag + + tooltip + MASK_* flag + type + integer + + + + PermissionMask + + tooltip + Permission bit-field (PERM_* flags) + type + integer + + + + energy + 10 + god-mode + 1 + return + void + sleep + 0 + tooltip + Sets the given permission mask to the new value on the inventory item. + + ll.SetKeyframedMotion + + arguments + + + Keyframes + + tooltip + Strided keyframe list of the form: position, orientation, time. Each keyframe is interpreted relative to the previous transform of the object. + type + list + + + + Options + + tooltip + + type + list + + + + energy + 10 + return + void + sleep + 0 + tooltip + Requests that a non-physical object be key-framed according to key-frame list.\nSpecify a list of times, positions, and orientations to be followed by an object. The object will be smoothly moved between key-frames by the simulator. Collisions with other non-physical or key-framed objects will be ignored (no script events will fire and collision processing will not occur). Collisions with physical objects will be computed and reported, but the key-framed object will be unaffected by those collisions.\nKeyframes is a strided list containing positional, rotational, and time data for each step in the motion. Options is a list containing optional arguments and parameters (specified by KFM_* constants). + + ll.SetLinkAlpha + + arguments + + + LinkNumber + + tooltip + + type + integer + + + + Opacity + + tooltip + + type + float + + + + Face + + tooltip + + type + integer + + + + energy + 10 + return + void + sleep + 0 + tooltip + If a prim exists in the link chain at LinkNumber, set Face to Opacity.\nSets the Face, on the linked prim specified, to the Opacity. + + ll.SetLinkCamera + + arguments + + + LinkNumber + + tooltip + Prim link number (0: unlinked, 1: root prim, >1: child prims) or a LINK_* flag + type + integer + + + + EyeOffset + + tooltip + Offset, relative to the object's centre and expressed in local coordinates, that the camera looks from. + type + vector + + + + LookOffset + + tooltip + Offset, relative to the object's centre and expressed in local coordinates, that the camera looks toward. + type + vector + + + + energy + 10 + return + void + sleep + 0 + tooltip + Sets the camera eye offset, and the offset that camera is looking at, for avatars that sit on the linked prim. + + ll.SetLinkColor + + arguments + + + LinkNumber + + tooltip + Link number (0: unlinked, 1: root prim, >1: child prims) or a LINK_* flag. + type + integer + + + + Color + + tooltip + Color in RGB <R.R, G.G, B.B> + type + vector + + + + Face + + tooltip + Side number or ALL_SIDES. + type + integer + + + + energy + 10 + return + void + sleep + 0 + tooltip + If a task exists in the link chain at LinkNumber, set the Face to color.\nSets the color of the linked child's side, specified by LinkNumber. + + ll.SetLinkMedia + + arguments + + + Link + + tooltip + Link number (0: unlinked, 1: root prim, >1: child prims). + type + integer + + + + Face + + tooltip + Face number. + type + integer + + + + Parameters + + tooltip + A set of name/value pairs (in no particular order) + type + list + + + + energy + 10 + return + integer + sleep + 0 + tooltip + Set the media parameters for a particular face on linked prim, specified by Link. Returns an integer that is a STATUS_* flag which details the success/failure of the operation(s).\nMediaParameters is a set of name/value pairs in no particular order. Parameters not specified are unchanged, or if new media is added then set to the default specified. + + ll.SetLinkPrimitiveParams + + arguments + + + LinkNumber + + tooltip + Link number (0: unlinked, 1: root prim, >1: child prims) or a LINK_* flag + type + integer + + + + Parameters + + tooltip + + type + list + + + + energy + 10 + return + void + sleep + 0.2000000000000000111022302 + tooltip + Set primitive parameters for LinkNumber based on Parameters.\nSets the parameters (or properties) of any linked prim in one step. + + ll.SetLinkPrimitiveParamsFast + + arguments + + + LinkNumber + + tooltip + Link number (0: unlinked, 1: root prim, >1: child prims) or a LINK_* flag + type + integer + + + + Parameters + + tooltip + + type + list + + + + energy + 10 + return + void + sleep + 0 + tooltip + Set primitive parameters for LinkNumber based on Parameters, without a delay.\nSet parameters for link number, from the list of Parameters, with no built-in script sleep. This function is identical to llSetLinkPrimitiveParams, except without the delay. + + ll.SetLinkRenderMaterial + + arguments + + + LinkNumber + + tooltip + + type + integer + + + + RenderMaterial + + tooltip + + type + string + + + + Face + + tooltip + + type + integer + + + + energy + 10 + return + void + sleep + 0.2000000000000000111022302 + tooltip + Sets the Render Material of Face on a linked prim, specified by LinkNumber. Render Materail may be a UUID or name of a material in prim inventory. + + ll.SetLinkSitFlags + + arguments + + + LinkNumber + + tooltip + Link number (0: unlinked, 1: root prim, >1: child prims) or a LINK_* flag. + type + integer + + + + Flags + + tooltip + The new set of sit flags to apply to the specified prims in this linkset. + type + integer + + + + energy + 10 + return + void + sleep + 0 + tooltip + Returns the sit flags set on the specified prim in a linkset. + + ll.SetLinkTexture + + arguments + + + LinkNumber + + tooltip + + type + integer + + + + Texture + + tooltip + + type + string + + + + Face + + tooltip + + type + integer + + + + energy + 10 + return + void + sleep + 0.2000000000000000111022302 + tooltip + Sets the Texture of Face on a linked prim, specified by LinkNumber. Texture may be a UUID or name of a texture in prim inventory. + + ll.SetLinkTextureAnim + + arguments + + + LinkNumber + + tooltip + Link number (0: unlinked, 1: root prim, >1: child prims) or a LINK_* flag to effect + type + integer + + + + Mode + + tooltip + Bitmask of animation options. + type + integer + + + + Face + + tooltip + Specifies which object face to animate or ALL_SIDES. + type + integer + + + + SizeX + + tooltip + Horizontal frames (ignored for ROTATE and SCALE). + type + integer + + + + SizeY + + tooltip + Vertical frames (ignored for ROTATE and SCALE). + type + integer + + + + Start + + tooltip + Start position/frame number (or radians for ROTATE). + type + float + + + + Length + + tooltip + Specifies the animation duration, in frames (or radians for ROTATE). + type + float + + + + Rate + + tooltip + Specifies the animation playback rate, in frames per second (must be greater than zero). + type + float + + + + energy + 10 + return + void + sleep + 0 + tooltip + Animates a texture on the prim specified by LinkNumber, by setting the texture scale and offset.\nMode is a bitmask of animation options.\nFace specifies which object face to animate.\nSizeX and SizeY specify the number of horizontal and vertical frames.Start specifes the animation start point.\nLength specifies the animation duration.\nRate specifies the animation playback rate. + + ll.SetLocalRot + + arguments + + + Rotation + + tooltip + + type + rotation + + + + energy + 10 + return + void + sleep + 0.2000000000000000111022302 + tooltip + Sets the rotation of a child prim relative to the root prim. + + ll.SetMemoryLimit + + arguments + + + Limit + + tooltip + The amount to reserve, which must be less than the allowed maximum (currently 64KB) and not already have been exceeded. + type + integer + + + + energy + 10 + return + integer + sleep + 0 + tooltip + Requests Limit bytes to be reserved for this script.\nReturns TRUE or FALSE indicating whether the limit was set successfully.\nThis function has no effect if the script is running in the LSO VM. + + ll.SetObjectDesc + + arguments + + + Description + + tooltip + + type + string + + + + energy + 10 + return + void + sleep + 0 + tooltip + Sets the description of the prim to Description.\nThe description field is limited to 127 characters. + + ll.SetObjectName + + arguments + + + Name + + tooltip + + type + string + + + + energy + 10 + return + void + sleep + 0 + tooltip + Sets the prim's name to Name. + + ll.SetObjectPermMask + + arguments + + + PermissionFlag + + tooltip + MASK_* flag + type + integer + + + + PermissionMask + + tooltip + Permission bit-field (PERM_* flags) + type + integer + + + + energy + 10 + god-mode + 1 + return + void + sleep + 0 + tooltip + Sets the specified PermissionFlag permission to the value specified by PermissionMask on the object the script is attached to. + + ll.SetParcelMusicURL + + arguments + + + URL + + tooltip + + type + string + + + + energy + 10 + return + void + sleep + 2 + tooltip + Sets the streaming audio URL for the parcel the object is on.\nThe object must be owned by the owner of the parcel; if the parcel is group owned the object must be owned by that group. + + ll.SetPayPrice + + arguments + + + Price + + tooltip + The default price shown in the textu input field. + type + integer + + + + QuickButtons + + tooltip + Specifies the 4 payment values shown in the payment dialog's buttons (or PAY_HIDE). + type + list + + + + energy + 10 + return + void + sleep + 0 + tooltip + Sets the default amount when someone chooses to pay this object.\nPrice is the default price shown in the textu input field. QuickButtons specifies the 4 payment values shown in the payment dialog's buttons.\nInput field and buttons may be hidden with PAY_HIDE constant, and may be set to their default values using PAY_DEFAULT. + + ll.SetPhysicsMaterial + + arguments + + + MaterialBits + + tooltip + A bitmask specifying which of the parameters in the other arguments should be applied to the object. + type + integer + + + + GravityMultiplier + + tooltip + + type + float + + + + Restitution + + tooltip + + type + float + + + + Friction + + tooltip + + type + float + + + + Density + + tooltip + + type + float + + + + energy + 10 + return + void + sleep + 0 + tooltip + Sets the selected parameters of the object's physics behavior.\nMaterialBits is a bitmask specifying which of the parameters in the other arguments should be applied to the object. GravityMultiplier, Restitution, Friction, and Density are the possible parameters to manipulate. + + ll.SetPos + + arguments + + + Position + + tooltip + Region coordinates to move to (within 10m). + type + vector + + + + energy + 10 + return + void + sleep + 0.2000000000000000111022302 + tooltip + If the object is not physical, this function sets the position of the prim.\nIf the script is in a child prim, Position is treated as root relative and the link-set is adjusted.\nIf the prim is the root prim, the entire object is moved (up to 10m) to Position in region coordinates. + + ll.SetPrimMediaParams + + arguments + + + Face + + tooltip + Face number + type + integer + + + + MediaParameters + + tooltip + A set of name/value pairs (in no particular order) + type + list + + + + energy + 10 + return + integer + sleep + 1 + tooltip + Sets the MediaParameters for a particular Face on the prim. Returns an integer that is a STATUS_* flag which details the success/failure of the operation(s).\nMediaParameters is a set of name/value pairs in no particular order. Parameters not specified are unchanged, or if new media is added then set to the default specified. + + ll.SetPrimURL + + arguments + + + URL + + tooltip + + type + string + + + + deprecated + 1 + energy + 10 + return + void + sleep + 20 + tooltip + Deprecated: Use llSetPrimMediaParams instead. + + ll.SetPrimitiveParams + + arguments + + + Parameters + + tooltip + A list of changes. + type + list + + + + energy + 10 + return + void + sleep + 0.2000000000000000111022302 + tooltip + This function changes the many properties (or "parameters") of a prim in one operation. Parameters is a list of changes. + + ll.SetRegionPos + + arguments + + + Position + + tooltip + Vector. The location to move to, in region coordinates. + type + vector + + + + energy + 10 + return + integer + sleep + 0 + tooltip + Attempts to move the object so that the root prim is within 0.1m of Position.\nReturns an integer boolean, TRUE if the object is successfully placed within 0.1 m of Position, FALSE otherwise.\nPosition may be any location within the region or up to 10m across a region border.\nIf the position is below ground, it will be set to the ground level at that x,y location. + + ll.SetRemoteScriptAccessPin + + arguments + + + PIN + + tooltip + + type + integer + + + + energy + 10 + return + void + sleep + 0.2000000000000000111022302 + tooltip + If PIN is set to a non-zero number, the task will accept remote script loads via llRemoteLoadScriptPin() if it passes in the correct PIN. Othersise, llRemoteLoadScriptPin() is ignored. + + ll.SetRenderMaterial + + arguments + + + Material + + tooltip + + type + string + + + + Face + + tooltip + + type + integer + + + + energy + 10 + return + void + sleep + 0.2000000000000000111022302 + tooltip + Applies Render Material to Face of prim.\nRender Material may be a UUID or name of a material in prim inventory.\nIf Face is ALL_SIDES, set the render material on all faces. + + ll.SetRot + + arguments + + + Rotation + + tooltip + + type + rotation + + + + energy + 10 + return + void + sleep + 0.2000000000000000111022302 + tooltip + If the object is not physical, this function sets the rotation of the prim.\nIf the script is in a child prim, Rotation is treated as root relative and the link-set is adjusted.\nIf the prim is the root prim, the entire object is rotated to Rotation in the global reference frame. + + ll.SetScale + + arguments + + + Scale + + tooltip + + type + vector + + + + energy + 10 + return + void + sleep + 0 + tooltip + Sets the prim's scale (size) to Scale. + + ll.SetScriptState + + arguments + + + ScriptName + + tooltip + + type + string + + + + Running + + tooltip + + type + integer + + + + energy + 10 + return + void + sleep + 0 + tooltip + Enable or disable the script Running state of Script in the prim. + + ll.SetSitText + + arguments + + + Text + + tooltip + + type + string + + + + energy + 10 + return + void + sleep + 0 + tooltip + Displays Text rather than 'Sit' in the viewer's context menu. + + ll.SetSoundQueueing + + arguments + + + QueueEnable + + tooltip + Boolean, sound queuing: TRUE enables, FALSE disables (default). + type + integer + + + + energy + 10 + return + void + sleep + 0 + tooltip + Sets whether successive calls to llPlaySound, llLoopSound, etc., (attached sounds) interrupt the currently playing sound.\nThe default for objects is FALSE. Setting this value to TRUE will make the sound wait until the current playing sound reaches its end. The queue is one level deep. + + ll.SetSoundRadius + + arguments + + + Radius + + tooltip + Maximum distance that sounds can be heard. + type + float + + + + energy + 10 + return + void + sleep + 0 + tooltip + Limits radius for audibility of scripted sounds (both attached and triggered) to distance Radius. + + ll.SetStatus + + arguments + + + Status + + tooltip + + type + integer + + + + Value + + tooltip + + type + integer + + + + energy + 10 + return + void + sleep + 0 + tooltip + Sets object status specified in Status bitmask (e.g. STATUS_PHYSICS|STATUS_PHANTOM) to boolean Value.\nFor a full list of STATUS_* constants, see wiki documentation. + + ll.SetText + + arguments + + + Text + + tooltip + + type + string + + + + Color + + tooltip + + type + vector + + + + Opacity + + tooltip + + type + float + + + + energy + 10 + return + void + sleep + 0 + tooltip + Causes Text to float above the prim, using the specified Color and Opacity. + + ll.SetTexture + + arguments + + + Texture + + tooltip + + type + string + + + + Face + + tooltip + + type + integer + + + + energy + 10 + return + void + sleep + 0.2000000000000000111022302 + tooltip + Applies Texture to Face of prim.\nTexture may be a UUID or name of a texture in prim inventory.\nIf Face is ALL_SIDES, set the texture on all faces. + + ll.SetTextureAnim + + arguments + + + Mode + + tooltip + Mask of Mode flags. + type + integer + + + + Face + + tooltip + Face number or ALL_SIDES. + type + integer + + + + SizeX + + tooltip + Horizontal frames (ignored for ROTATE and SCALE). + type + integer + + + + SizeY + + tooltip + Vertical frames (ignored for ROTATE and SCALE). + type + integer + + + + Start + + tooltip + Start position/frame number (or radians for ROTATE). + type + float + + + + Length + + tooltip + number of frames to display (or radians for ROTATE). + type + float + + + + Rate + + tooltip + Frames per second (must not greater than zero). + type + float + + + + energy + 10 + return + void + sleep + 0 + tooltip + Animates a texture by setting the texture scale and offset.\nMode is a bitmask of animation options.\nFace specifies which object face to animate.\nSizeX and SizeY specify the number of horizontal and vertical frames.Start specifes the animation start point.\nLength specifies the animation duration.\nRate specifies the animation playback rate. + + ll.SetTimerEvent + + arguments + + + Rate + + tooltip + + type + float + + + + energy + 10 + return + void + sleep + 0 + tooltip + Causes the timer event to be triggered every Rate seconds.\n Passing in 0.0 stops further timer events. + + ll.SetTorque + + arguments + + + Torque + + tooltip + Torque force. + type + vector + + + + Local + + tooltip + Boolean, if TRUE uses local axis, if FALSE uses region axis. + type + integer + + + + energy + 10 + return + void + sleep + 0 + tooltip + Sets the Torque acting on the script's object, in object-local coordinates if Local == TRUE (otherwise, the region reference frame is used).\nOnly works on physical objects. + + ll.SetTouchText + + arguments + + + Text + + tooltip + + type + string + + + + energy + 10 + return + void + sleep + 0 + tooltip + Displays Text in the viewer context menu that acts on a touch. + + ll.SetVehicleFlags + + arguments + + + Flags + + tooltip + + type + integer + + + + energy + 10 + return + void + sleep + 0 + tooltip + Enables the vehicle flags specified in the Flags bitmask.\nValid parameters can be found in the wiki documentation. + + ll.SetVehicleFloatParam + + arguments + + + ParameterName + + tooltip + + type + integer + + + + ParameterValue + + tooltip + + type + float + + + + energy + 10 + return + void + sleep + 0 + tooltip + Sets a vehicle float parameter.\nValid parameters can be found in the wiki documentation. + + ll.SetVehicleRotationParam + + arguments + + + ParameterName + + tooltip + + type + integer + + + + ParameterValue + + tooltip + + type + rotation + + + + energy + 10 + return + void + sleep + 0 + tooltip + Sets a vehicle rotation parameter.\nValid parameters can be found in the wiki documentation. + + ll.SetVehicleType + + arguments + + + Type + + tooltip + + type + integer + + + + energy + 10 + return + void + sleep + 0 + tooltip + Activates the vehicle action on the object with vehicle preset Type.\nValid Types and an explanation of their characteristics can be found in wiki documentation. + + ll.SetVehicleVectorParam + + arguments + + + ParameterName + + tooltip + + type + integer + + + + ParameterValue + + tooltip + + type + vector + + + + energy + 10 + return + void + sleep + 0 + tooltip + Sets a vehicle vector parameter.\nValid parameters can be found in the wiki documentation. + + ll.SetVelocity + + arguments + + + Velocity + + tooltip + The velocity to apply. + type + vector + + + + Local + + tooltip + If TRUE, the Velocity is treated as a local directional vector instead of a regional directional vector. + type + integer + + + + energy + 10 + return + void + sleep + 0 + tooltip + If the object is physics-enabled, sets the object's linear velocity to Velocity.\nIf Local==TRUE, Velocity is treated as a local directional vector; otherwise, Velocity is treated as a global directional vector. + + ll.Shout + + arguments + + + Channel + + tooltip + + type + integer + + + + Text + + tooltip + + type + string + + + + energy + 10 + return + void + sleep + 0 + tooltip + Shouts Text on Channel.\nThis chat method has a range of 100m radius.\nPUBLIC_CHANNEL is the public chat channel that all avatars see as chat text. DEBUG_CHANNEL is the script debug channel, and is also visible to nearby avatars. All other channels are are not sent to avatars, but may be used to communicate with scripts. + + ll.SignRSA + + arguments + + + PrivateKey + + tooltip + The PEM-formatted private key + type + string + + + + Message + + tooltip + The message contents to sign + type + string + + + + Algorithm + + tooltip + The digest algorithnm to use: sha1, sha224, sha256, sha384, sha512 + type + string + + + + energy + 10 + return + string + sleep + 0 + tooltip + Returns the base64-encoded RSA signature of Message using PEM-formatted PrivateKey and digest Algorithm (sha1, sha224, sha256, sha384, sha512). + + ll.Sin + + arguments + + + Theta + + tooltip + + type + float + + + + energy + 10 + return + float + sleep + 0 + tooltip + Returns the sine of Theta (Theta in radians). + + ll.SitOnLink + + arguments + + + AvatarID + + tooltip + + type + key + + + + LinkID + + tooltip + + type + integer + + + + energy + 10 + return + integer + sleep + 0 + tooltip + If agent identified by AvatarID is participating in the experience, sit them on the specified link's sit target. + + ll.SitTarget + + arguments + + + Offset + + tooltip + + type + vector + + + + Rotation + + tooltip + + type + rotation + + + + energy + 10 + return + void + sleep + 0 + tooltip + Set the sit location for this object. If offset == ZERO_VECTOR, clears the sit target. + + ll.Sleep + + arguments + + + Time + + tooltip + + type + float + + + + energy + 0 + return + void + sleep + 0 + tooltip + Put script to sleep for Time seconds. + + ll.Sound + + arguments + + + Sound + + tooltip + + type + string + + + + Volume + + tooltip + + type + float + + + + Queue + + tooltip + + type + integer + + + + Loop + + tooltip + + type + integer + + + + deprecated + 1 + energy + 10 + return + void + sleep + 0 + tooltip + Deprecated: Use llPlaySound instead.\nPlays Sound at Volume and specifies whether the sound should loop and/or be enqueued. + + ll.SoundPreload + + arguments + + + Sound + + tooltip + + type + string + + + + deprecated + 1 + energy + 10 + return + void + sleep + 0 + tooltip + Deprecated: Use llPreloadSound instead.\nPreloads a sound on viewers within range. + + ll.Sqrt + + arguments + + + Value + + tooltip + + type + float + + + + energy + 10 + return + float + sleep + 0 + tooltip + Returns the square root of Value.\nTriggers a math runtime error for imaginary results (if Value < 0.0). + + ll.StartAnimation + + arguments + + + Animation + + tooltip + + type + string + + + + energy + 10 + return + void + sleep + 0 + tooltip + This function plays the specified animation from playing on the avatar who received the script's most recent permissions request.\nAnimation may be an animation in task inventory or a built-in animation.\nRequires PERMISSION_TRIGGER_ANIMATION. + + ll.StartObjectAnimation + + arguments + + + Animation + + tooltip + + type + string + + + + energy + 10 + return + void + sleep + 0 + tooltip + This function plays the specified animation on the rigged mesh object associated with the current script.\nAnimation may be an animation in task inventory or a built-in animation.\n + + ll.StopAnimation + + arguments + + + Animation + + tooltip + + type + string + + + + energy + 10 + return + void + sleep + 0 + tooltip + This function stops the specified animation on the avatar who received the script's most recent permissions request.\nAnimation may be an animation in task inventory, a built-in animation, or the uuid of an animation.\nRequires PERMISSION_TRIGGER_ANIMATION. + + ll.StopHover + + arguments + + energy + 10 + return + void + sleep + 0 + tooltip + Stop hovering to a height (due to llSetHoverHeight()). + + ll.StopLookAt + + arguments + + energy + 10 + return + void + sleep + 0 + tooltip + Stop causing object to point at a target (due to llLookAt() or llRotLookAt()). + + ll.StopMoveToTarget + + arguments + + energy + 10 + return + void + sleep + 0 + tooltip + Stops critically damped motion (due to llMoveToTarget()). + + ll.StopObjectAnimation + + arguments + + + Animation + + tooltip + + type + string + + + + energy + 10 + return + void + sleep + 0 + tooltip + This function stops the specified animation on the rigged mesh object associated with the current script.\nAnimation may be an animation in task inventory, a built-in animation, or the uuid of an animation.\n + + ll.StopSound + + arguments + + energy + 10 + return + void + sleep + 0 + tooltip + Stops playback of the currently attached sound. + + ll.StringLength + + arguments + + + Text + + tooltip + + type + string + + + + energy + 10 + return + integer + sleep + 0 + tooltip + Returns an integer that is the number of characters in Text (not counting the null). + + ll.StringToBase64 + + arguments + + + Text + + tooltip + + type + string + + + + energy + 10 + return + string + sleep + 0 + tooltip + Returns the string Base64 representation of the input string. + + ll.StringTrim + + arguments + + + Text + + tooltip + String to trim + type + string + + + + TrimType + + tooltip + STRING_TRIM_HEAD, STRING_TRIM_TAIL, or STRING_TRIM. + type + integer + + + + energy + 10 + return + string + sleep + 0 + tooltip + Outputs a string, eliminating white-space from the start and/or end of the input string Text.\nValid options for TrimType:\nSTRING_TRIM_HEAD: trim all leading spaces in Text\nSTRING_TRIM_TAIL: trim all trailing spaces in Text\nSTRING_TRIM: trim all leading and trailing spaces in Text. + + ll.SubStringIndex + + arguments + + + Text + + tooltip + + type + string + + + + Sequence + + tooltip + + type + string + + + + energy + 10 + return + integer + sleep + 0 + tooltip + Returns an integer that is the index in Text where string pattern Sequence first appears. Returns -1 if not found. + + ll.TakeCamera + + arguments + + + AvatarID + + tooltip + + type + key + + + + deprecated + 1 + energy + 10 + return + void + sleep + 0 + tooltip + Deprecated: Use llSetCameraParams instead. + + ll.TakeControls + + arguments + + + Controls + + tooltip + Bit-field of CONTROL_* flags. + type + integer + + + + Accept + + tooltip + Boolean, determines whether control events are generated. + type + integer + + + + PassOn + + tooltip + Boolean, determines whether controls are disabled. + type + integer + + + + energy + 10 + return + void + sleep + 0 + tooltip + Take controls from the agent the script has permissions for.\nIf (Accept == (Controls & input)), send input to the script. PassOn determines whether Controls also perform their normal functions.\nRequires the PERMISSION_TAKE_CONTROLS permission to run. + + ll.Tan + + arguments + + + Theta + + tooltip + + type + float + + + + energy + 10 + return + float + sleep + 0 + tooltip + Returns the tangent of Theta (Theta in radians). + + ll.Target + + arguments + + + Position + + tooltip + + type + vector + + + + Range + + tooltip + + type + float + + + + energy + 10 + return + integer + sleep + 0 + tooltip + This function is to have the script know when it has reached a position.\nIt registers a Position with a Range that triggers at_target and not_at_target events continuously until unregistered. + + ll.TargetOmega + + arguments + + + Axis + + tooltip + + type + vector + + + + SpinRate + + tooltip + + type + float + + + + Gain + + tooltip + + type + float + + + + energy + 10 + return + void + sleep + 0 + tooltip + Attempt to spin at SpinRate with strength Gain on Axis.\nA spin rate of 0.0 cancels the spin. This function always works in object-local coordinates. + + ll.TargetRemove + + arguments + + + Target + + tooltip + + type + integer + + + + energy + 10 + return + void + sleep + 0 + tooltip + Removes positional target Handle registered with llTarget. + + ll.TargetedEmail + + arguments + + + Target + + tooltip + + type + integer + + + + Subject + + tooltip + + type + string + + + + Text + + tooltip + + type + string + + + + energy + 10 + return + void + sleep + 20 + tooltip + Sends an email with Subject and Message to the owner or creator of an object . + + ll.TeleportAgent + + arguments + + + AvatarID + + tooltip + UUID of avatar. + type + key + + + + LandmarkName + + tooltip + Name of landmark (in object contents), or empty string, to use. + type + string + + + + Position + + tooltip + If no landmark was provided, the position within the current region to teleport the avatar to. + type + vector + + + + LookAtPoint + + tooltip + The position within the target region that the avatar should be turned to face upon arrival. + type + vector + + + + energy + 10 + return + void + sleep + 0 + tooltip + Requests a teleport of avatar to a landmark stored in the object's inventory. If no landmark is provided (an empty string), the avatar is teleported to the location position in the current region. In either case, the avatar is turned to face the position given by look_at in local coordinates.\nRequires the PERMISSION_TELEPORT permission. This function can only teleport the owner of the object. + + ll.TeleportAgentGlobalCoords + + arguments + + + AvatarID + + tooltip + UUID of avatar. + type + key + + + + GlobalPosition + + tooltip + Global coordinates of the destination region. Can be retrieved by using llRequestSimulatorData(region_name, DATA_SIM_POS). + type + vector + + + + RegionPosition + + tooltip + The position within the target region to teleport the avatar to, if no landmark was provided. + type + vector + + + + LookAtPoint + + tooltip + The position within the target region that the avatar should be turned to face upon arrival. + type + vector + + + + energy + 10 + return + void + sleep + 0 + tooltip + Teleports an agent to the RegionPosition local coordinates within a region which is specified by the GlobalPosition global coordinates. The agent lands facing the position defined by LookAtPoint local coordinates.\nRequires the PERMISSION_TELEPORT permission. This function can only teleport the owner of the object. + + ll.TeleportAgentHome + + arguments + + + AvatarID + + tooltip + + type + key + + + + energy + 100 + return + void + sleep + 5 + tooltip + Teleport agent over the owner's land to agent's home location. + + ll.TextBox + + arguments + + + AvatarID + + tooltip + + type + key + + + + Text + + tooltip + + type + string + + + + Channel + + tooltip + + type + integer + + + + energy + 10 + return + void + sleep + 1 + tooltip + Opens a dialog for the specified avatar with message Text, which contains a text box for input. Any text that is entered is said on the specified Channel (as if by the avatar) when the "OK" button is clicked. + + ll.ToLower + + arguments + + + Text + + tooltip + + type + string + + + + energy + 10 + return + string + sleep + 0 + tooltip + Returns a string that is Text with all lower-case characters. + + ll.ToUpper + + arguments + + + Text + + tooltip + + type + string + + + + energy + 10 + return + string + sleep + 0 + tooltip + Returns a string that is Text with all upper-case characters. + + ll.TransferLindenDollars + + arguments + + + AvatarID + + tooltip + + type + key + + + + Amount + + tooltip + + type + integer + + + + energy + 10 + return + key + sleep + 0 + tooltip + Transfer Amount of linden dollars (L$) from script owner to AvatarID. Returns a key to a corresponding transaction_result event for the success of the transfer.\nAttempts to send the amount of money to the specified avatar, and trigger a transaction_result event identified by the returned key. + + ll.TransferOwnership + + arguments + + + AgentID + + tooltip + An agent in the region. + type + key + + + + Flags + + tooltip + Flags to control type of inventory transfer. + type + integer + + + + Params + + tooltip + Extra parameters to llTransferOwnership. None are defined at this time. + type + list + + + + energy + 10 + return + integer + sleep + 0 + tooltip + Transfers ownership of an object, or a copy of the object to a new agent. + + ll.TriggerSound + + arguments + + + Sound + + tooltip + + type + string + + + + Volume + + tooltip + + type + float + + + + energy + 10 + return + void + sleep + 0 + tooltip + Plays Sound at Volume (0.0 - 1.0), centered at but not attached to object.\nThere is no limit to the number of triggered sounds which can be generated by an object, and calling llTriggerSound does not affect the attached sounds created by llPlaySound and llLoopSound. This is very useful for things like collision noises, explosions, etc. There is no way to stop or alter the volume of a sound triggered by this function. + + ll.TriggerSoundLimited + + arguments + + + Sound + + tooltip + + type + string + + + + Volume + + tooltip + + type + float + + + + TNE + + tooltip + + type + vector + + + + BSW + + tooltip + + type + vector + + + + energy + 10 + return + void + sleep + 0 + tooltip + Plays Sound at Volume (0.0 - 1.0), centered at but not attached to object, limited to axis-aligned bounding box defined by vectors top-north-east (TNE) and bottom-south-west (BSW).\nThere is no limit to the number of triggered sounds which can be generated by an object, and calling llTriggerSound does not affect the attached sounds created by llPlaySound and llLoopSound. This is very useful for things like collision noises, explosions, etc. There is no way to stop or alter the volume of a sound triggered by this function. + + ll.UnSit + + arguments + + + AvatarID + + tooltip + + type + key + + + + energy + 10 + return + void + sleep + 0 + tooltip + If agent identified by AvatarID is sitting on the object the script is attached to or is over land owned by the objects owner, the agent is forced to stand up. + + ll.UnescapeURL + + arguments + + + URL + + tooltip + + type + string + + + + energy + 10 + return + string + sleep + 0 + tooltip + Returns the string that is the URL unescaped, replacing "%20" with spaces, etc., version of URL.\nThis function can output raw UTF-8 strings. + + ll.UpdateCharacter + + arguments + + + Options + + tooltip + Character configuration options. Takes the same constants as llCreateCharacter(). + type + list + + + + energy + 10 + return + void + sleep + 0 + tooltip + Updates settings for a pathfinding character. + + ll.UpdateKeyValue + + arguments + + + Key + + tooltip + + type + string + + + + Value + + tooltip + + type + string + + + + Checked + + tooltip + + type + integer + + + + OriginalValue + + tooltip + + type + string + + + + energy + 10 + return + key + sleep + 0 + tooltip + + Starts an asychronous transaction to update the value associated with the key given. The dataserver callback will be executed with the key returned from this call and a string describing the result. The result is a two element commma-delimited list. The first item is an integer specifying if the transaction succeeded (1) or not (0). In the failure case, the second item will be an integer corresponding to one of the XP_ERROR_... constants. In the success case the second item will be the value associated with the key. If Checked is 1 the existing value in the data store must match the OriginalValue passed or XP_ERROR_RETRY_UPDATE will be returned. If Checked is 0 the key will be created if necessary. + + + ll.VecDist + + arguments + + + Location1 + + tooltip + + type + vector + + + + Location2 + + tooltip + + type + vector + + + + energy + 10 + return + float + sleep + 0 + tooltip + Returns the distance between Location1 and Location2. + + ll.VecMag + + arguments + + + Vector + + tooltip + + type + vector + + + + energy + 10 + return + float + sleep + 0 + tooltip + Returns the magnitude of the vector. + + ll.VecNorm + + arguments + + + Vector + + tooltip + + type + vector + + + + energy + 10 + return + vector + sleep + 0 + tooltip + Returns normalized vector. + + ll.VerifyRSA + + arguments + + + PublicKey + + tooltip + The PEM-formatted public key for signature verifiation. + type + string + + + + Message + + tooltip + The message that was signed. + type + string + + + + Signature + + tooltip + The base64-formatted signature of the message. + type + string + + + + Algorithm + + tooltip + The digest algorithm: sha1, sha224, sha256, sha384, sha512. + type + string + + + + energy + 10 + return + integer + sleep + 0 + tooltip + Returns TRUE if PublicKey, Message, and Algorithm produce the same base64-formatted Signature. + + ll.VolumeDetect + + arguments + + + DetectEnabled + + tooltip + TRUE enables, FALSE disables. + type + integer + + + + energy + 10 + return + void + sleep + 0 + tooltip + If DetectEnabled = TRUE, object becomes phantom but triggers collision_start and collision_end events when other objects start and stop interpenetrating.\nIf another object (including avatars) interpenetrates it, it will get a collision_start event.\nWhen an object stops interpenetrating, a collision_end event is generated. While the other is inter-penetrating, collision events are NOT generated. + + ll.WanderWithin + + arguments + + + Origin + + tooltip + Central point to wander about. + type + vector + + + + Area + + tooltip + Half-extents of an area the character may wander within. (i.e., it can wander from the specified origin by up to +/-Distance.x in x, +/-Distance.y in y, etc.) + type + vector + + + + Options + + tooltip + No options available at this time. + type + list + + + + energy + 10 + return + void + sleep + 0 + tooltip + Wander within a specified volume.\nSets a character to wander about a central spot within a specified area. + + ll.Water + + arguments + + + Offset + + tooltip + + type + vector + + + + energy + 10 + return + float + sleep + 0 + tooltip + Returns the water height below the object position + Offset. + + ll.Whisper + + arguments + + + Channel + + tooltip + + type + integer + + + + Text + + tooltip + + type + string + + + + energy + 10 + return + void + sleep + 0 + tooltip + Whispers Text on Channel.\nThis chat method has a range of 10m radius.\nPUBLIC_CHANNEL is the public chat channel that all avatars see as chat text. DEBUG_CHANNEL is the script debug channel, and is also visible to nearby avatars. All other channels are are not sent to avatars, but may be used to communicate with scripts. + + ll.Wind + + arguments + + + Offset + + tooltip + + type + vector + + + + energy + 10 + return + vector + sleep + 0 + tooltip + Returns the wind velocity at the object position + Offset. + + ll.WorldPosToHUD + + arguments + + + world_pos + + tooltip + The world-frame position to project into HUD space + type + vector + + + + energy + 10 + return + vector + sleep + 0 + tooltip + Returns the local position that would put the origin of a HUD object directly over world_pos as viewed by the current camera. + + ll.XorBase64 + + arguments + + + Text1 + + tooltip + + type + string + + + + Text2 + + tooltip + + type + string + + + + energy + 10 + return + string + sleep + 0 + tooltip + Performs an exclusive OR on two Base64 strings and returns a Base64 string. Text2 repeats if it is shorter than Text1. + + ll.XorBase64Strings + + arguments + + + Text1 + + tooltip + + type + string + + + + Text2 + + tooltip + + type + string + + + + deprecated + 1 + energy + 10 + return + string + sleep + 0.2999999999999999888977698 + tooltip + Deprecated: Please use llXorBase64 instead.\nIncorrectly performs an exclusive OR on two Base64 strings and returns a Base64 string. Text2 repeats if it is shorter than Text1.\nRetained for backwards compatibility. + + ll.XorBase64StringsCorrect + + arguments + + + Text1 + + tooltip + + type + string + + + + Text2 + + tooltip + + type + string + + + + deprecated + 1 + energy + 10 + return + string + sleep + 0 + tooltip + Deprecated: Please use llXorBase64 instead.\nCorrectly (unless nulls are present) performs an exclusive OR on two Base64 strings and returns a Base64 string.\nText2 repeats if it is shorter than Text1. + + ll.sRGB2Linear + + arguments + + + srgb + + tooltip + A color in the sRGB colorspace. + type + vector + + + + energy + 10 + return + vector + sleep + 0 + tooltip + Converts a color from the sRGB to the linear colorspace. + + + ll.sd-lsl-syntax-version + 2 + + + diff --git a/indra/newview/app_settings/settings.xml b/indra/newview/app_settings/settings.xml index d6a1fbd124f..becd9001fe3 100644 --- a/indra/newview/app_settings/settings.xml +++ b/indra/newview/app_settings/settings.xml @@ -655,6 +655,28 @@ Value 60 + AvatarRotateThresholdSlow + + Comment + Angle between avatar facing and camera facing at which avatar turns to face same direction as camera, when moving slowly (degrees) + Persist + 1 + Type + F32 + Value + 60 + + AvatarRotateThresholdFast + + Comment + Angle between avatar facing and camera facing at which avatar turns to face same direction as camera, when moving fast (degrees) + Persist + 1 + Type + F32 + Value + 2 + AvatarPhysics Comment @@ -4462,13 +4484,24 @@ MainloopTimeoutDefault Comment - Timeout duration for mainloop lock detection, in seconds. + Timeout duration for mainloop lock detection during teleports, login and logout, in seconds. Persist 1 Type F32 Value - 60.0 + 120.0 + + MainloopTimeoutStarted + + Comment + Timeout duration for mainloop lock detection when logged in and not teleporting, in seconds. + Persist + 1 + Type + F32 + Value + 30.0 MapScale @@ -5053,6 +5086,28 @@ Value 0 + MediaPluginPipeWireVolumeCatcher + + Comment + Use PipeWire instead of PulseAudio for controlling web media volume. + Persist + 1 + Type + Boolean + Value + 1 + + MediaPluginForceVLC + + Comment + Force use of VLC based media plugin. (Linux Only) + Persist + 1 + Type + Boolean + Value + 0 + MediaControlFadeTime Comment @@ -7219,7 +7274,7 @@ RenderAnisotropic Comment - Render textures using anisotropic filtering + [OBSOLETE] Render textures using anisotropic filtering Persist 1 Type @@ -7227,6 +7282,17 @@ Value 0 + RenderAnisotropicLevel + + Comment + Anisotropic filtering strength(0(Disable), 2x, 4x, 8x, 16x + Persist + 1 + Type + U32 + Value + 0 + RenderAppleUseMultGL Comment @@ -7263,7 +7329,7 @@ RenderAvatarCloth Comment - DEPRECATED - only false supported - Controls if avatars use wavy cloth + Controls if system avatar clothes use wavy cloth Persist 1 Type @@ -7443,7 +7509,7 @@ RenderHiDPI Comment - Enable support for HiDPI displays, like Retina (macOS ONLY, requires restart) + Enable support for HiDPI displays, like Retina (macOS and Linux ONLY, requires restart) Persist 1 Type @@ -9020,6 +9086,17 @@ Value 16 + RenderReflectionProbeShowTransparent + + Comment + Show reflection probes in the transparency debug view + Persist + 1 + Type + Boolean + Value + 1 + RenderReflectionProbeVolumes Comment @@ -11107,6 +11184,45 @@ Value 0 + ShowPGClassifieds + + Comment + Display results of find classifieds that are flagged as general + Persist + 1 + HideFromEditor + 1 + Type + Boolean + Value + 1 + + ShowMatureClassifieds + + Comment + Display results of find classifieds that are flagged as moderate + Persist + 1 + HideFromEditor + 1 + Type + Boolean + Value + 0 + + ShowAdultClassifieds + + Comment + Display results of find classifieds that are flagged as adult + Persist + 1 + HideFromEditor + 1 + Type + Boolean + Value + 0 + ShowPGSims Comment @@ -11146,6 +11262,54 @@ Value 0 + ShowPGEvents + + Comment + Display results of find events that are flagged as general + Persist + 1 + HideFromEditor + 1 + Type + Boolean + Value + 1 + + ShowMatureGroups + + Comment + Include groups that are flagged as mature to Search results + Persist + 1 + HideFromEditor + 1 + Type + Boolean + Value + 0 + + FindLandArea + + Comment + Enables filtering of land search results by area + Persist + 1 + Type + Boolean + Value + 0 + + FindLandPrice + + Comment + Enables filtering of land search results by price + Persist + 1 + Type + Boolean + Value + 1 + ShowNearClip Comment @@ -13742,13 +13906,13 @@ WatchdogEnabled Comment - Controls whether the thread watchdog timer is activated. Value is boolean. Set to -1 to defer to built-in default. + Controls whether the thread watchdog timer is activated. Value is S32. Set to -1 to defer to built-in default. Persist 0 Type S32 Value - 0 + 1 WaterGLFogDensityScale @@ -13926,6 +14090,50 @@ Value + ExternalWebsocketSyncEnable + + Comment + Enables the Websocket JSONRPC server when doing external script editing. + Persist + 1 + Type + Boolean + Value + 1 + + ExternalWebsocketSyncPort + + Comment + Port that the JSONRPC server listens on when editing + Persist + 1 + Type + S32 + Value + 9020 + + ExternalWebsocketSyncLocal + + Comment + Should the JSONRPC server listen only for local connections. + Persist + 1 + Type + Boolean + Value + 1 + + ExternalWebsocketForwardDebug + + Comment + Forward messages and runtime errors for a script to JSONRPC client. + Persist + 1 + Type + Boolean + Value + 1 + YawFromMousePosition Comment @@ -16421,5 +16629,16 @@ Value 2 + ScriptEditorDisableSyntaxHighlight + + Comment + Disable syntax highlighting in script editor for performance testing + Persist + 1 + Type + Boolean + Value + 0 + diff --git a/indra/newview/app_settings/shaders/class1/deferred/SMAA.glsl b/indra/newview/app_settings/shaders/class1/deferred/SMAA.glsl index 58373089653..0fa4b32fda6 100644 --- a/indra/newview/app_settings/shaders/class1/deferred/SMAA.glsl +++ b/indra/newview/app_settings/shaders/class1/deferred/SMAA.glsl @@ -25,7 +25,6 @@ #extension GL_ARB_texture_rectangle : enable #extension GL_ARB_shader_texture_lod : enable -#extension GL_EXT_gpu_shader4 : enable /*[EXTRA_CODE_HERE]*/ diff --git a/indra/newview/app_settings/shaders/class1/deferred/avatarV.glsl b/indra/newview/app_settings/shaders/class1/deferred/avatarV.glsl index aabbbac12a5..1b1233790e0 100644 --- a/indra/newview/app_settings/shaders/class1/deferred/avatarV.glsl +++ b/indra/newview/app_settings/shaders/class1/deferred/avatarV.glsl @@ -28,6 +28,9 @@ uniform mat4 projection_matrix; in vec3 position; in vec3 normal; in vec2 texcoord0; +#ifdef AVATAR_CLOTH +in vec4 clothing; +#endif mat4 getSkinnedTransform(); @@ -37,6 +40,15 @@ out vec3 vary_normal; out vec2 vary_texcoord0; out vec3 vary_position; +#ifdef AVATAR_CLOTH +uniform vec4 gWindDir; +uniform vec4 gSinWaveParams; +uniform vec4 gGravity; + +const vec4 gMinMaxConstants = vec4(1.0, 0.166666, 0.0083143, .00018542); // #minimax-generated coefficients +const vec4 gPiConstants = vec4(0.159154943, 6.28318530, 3.141592653, 1.5707963); // # {1/2PI, 2PI, PI, PI/2} +#endif + void main() { vary_texcoord0 = texcoord0; @@ -46,16 +58,78 @@ void main() vec4 pos_in = vec4(position.xyz, 1.0); mat4 trans = getSkinnedTransform(); - pos.x = dot(trans[0], pos_in); - pos.y = dot(trans[1], pos_in); - pos.z = dot(trans[2], pos_in); - pos.w = 1.0; norm.x = dot(trans[0].xyz, normal); norm.y = dot(trans[1].xyz, normal); norm.z = dot(trans[2].xyz, normal); norm = normalize(norm); +#ifdef AVATAR_CLOTH + //wind + vec4 windEffect; + windEffect = vec4(dot(norm, gWindDir.xyz)); + pos.x = dot(trans[2], pos_in); + windEffect.xyz = pos.x * vec3(0.015, 0.015, 0.015) + + windEffect.xyz; + windEffect.w = windEffect.w * 2.0 + 1.0; // move wind offset value to [-1, 3] + windEffect.w = windEffect.w*gWindDir.w; // modulate wind strength + + windEffect.xyz = windEffect.xyz*gSinWaveParams.xyz + +vec3(gSinWaveParams.w); // use sin wave params to scale and offset input + + //reduce to period of 2 PI + vec4 temp1, temp0, temp2, offsetPos; + temp1.xyz = windEffect.xyz * gPiConstants.x; // change input as multiple of [0-2PI] to [0-1] + temp0.y = mod(temp1.x,1.0); + windEffect.x = temp0.y * gPiConstants.y; // scale from [0,1] to [0, 2PI] + temp1.z = temp1.z - gPiConstants.w; // shift normal oscillation by PI/2 + temp0.y = mod(temp1.z,1.0); + + windEffect.z = temp0.y * gPiConstants.y; // scale from [0,1] to [0, 2PI] + windEffect.xyz = windEffect.xyz + vec3(-3.141592); // offset to [-PI, PI] + + //calculate sinusoid + vec4 sinWave; + temp1 = windEffect*windEffect; + sinWave = -temp1 * gMinMaxConstants.w + + vec4(gMinMaxConstants.z); // y = -(x^2)/7! + 1/5! + sinWave = sinWave * -temp1 + vec4(gMinMaxConstants.y); // y = -(x^2) * (-(x^2)/7! + 1/5!) + 1/3! + sinWave = sinWave * -temp1 + vec4(gMinMaxConstants.x); // y = -(x^2) * (-(x^2) * (-(x^2)/7! + 1/5!) + 1/3!) + 1 + sinWave = sinWave * windEffect; // y = x * (-(x^2) * (-(x^2) * (-(x^2)/7! + 1/5!) + 1/3!) + 1) + + // sinWave.x holds sin(norm . wind_direction) with primary frequency + // sinWave.y holds sin(norm . wind_direction) with secondary frequency + // sinWave.z hold cos(norm . wind_direction) with primary frequency + sinWave.xyz = sinWave.xyz * gWindDir.w + + vec3(windEffect.w); // multiply by wind strength in gWindDir.w [-wind, wind] + + // add normal facing bias offset [-wind,wind] -> [-wind - .25, wind + 1] + temp1 = vec4(dot(norm, gGravity.xyz)); // how much is this normal facing in direction of gGravity? + temp1 = min(temp1, vec4(0.2,0.0,0.0,0.0)); // clamp [-1, 1] to [-1, 0.2] + temp1 = temp1*vec4(1.5,0.0,0.0,0.0); // scale from [-1,0.2] to [-1.5, 0.3] + sinWave.x = sinWave.x + temp1.x; // add gGravity effect to sinwave (only primary frequency) + sinWave.xyz = sinWave.xyz * clothing.w; // modulate by clothing coverage + + sinWave.xyz = max(sinWave.xyz, vec3(-1.0, -1.0, -1.0)); // clamp to underlying body shape + offsetPos = clothing * sinWave.x; // multiply wind effect times clothing displacement + temp2 = gWindDir*sinWave.z + vec4(norm,0); // calculate normal offset due to wind oscillation + offsetPos = vec4(1.0,1.0,1.0,0.0)*offsetPos+pos_in; // add to offset vertex position, and zero out effect from w + norm += temp2.xyz*2.0; // add sin wave effect on normals (exaggerated) + + //renormalize normal (again) + norm = normalize(norm); + + pos.x = dot(trans[0], offsetPos); + pos.y = dot(trans[1], offsetPos); + pos.z = dot(trans[2], offsetPos); + pos.w = 1.0; +#else + pos.x = dot(trans[0], pos_in); + pos.y = dot(trans[1], pos_in); + pos.z = dot(trans[2], pos_in); + pos.w = 1.0; +#endif + vary_normal = norm; vary_position = pos.xyz; diff --git a/indra/newview/app_settings/shaders/class1/windlight/atmosphericsVarsV.glsl b/indra/newview/app_settings/shaders/class1/windlight/atmosphericsVarsV.glsl index 5d770948c5f..36eac9ed518 100644 --- a/indra/newview/app_settings/shaders/class1/windlight/atmosphericsVarsV.glsl +++ b/indra/newview/app_settings/shaders/class1/windlight/atmosphericsVarsV.glsl @@ -27,10 +27,10 @@ out vec3 vary_AdditiveColor; out vec3 vary_AtmosAttenuation; -vec3 additive_color; -vec3 atmos_attenuation; -vec3 sunlit_color; -vec3 amblit_color; +vec3 additive_color = vec3(1.0, 1.0, 1.0); +vec3 atmos_attenuation = vec3(1.0, 1.0, 1.0); +vec3 sunlit_color = vec3(1.0, 1.0, 1.0); +vec3 amblit_color = vec3(1.0, 1.0, 1.0); vec3 getSunlitColor() { diff --git a/indra/newview/app_settings/shaders/class2/deferred/alphaF.glsl b/indra/newview/app_settings/shaders/class2/deferred/alphaF.glsl index cc9d72fae61..e405a9ea2d5 100644 --- a/indra/newview/app_settings/shaders/class2/deferred/alphaF.glsl +++ b/indra/newview/app_settings/shaders/class2/deferred/alphaF.glsl @@ -250,8 +250,8 @@ void main() vec3 amblit_linear = amblit; vec3 irradiance = amblit; - vec3 glossenv; - vec3 legacyenv; + vec3 glossenv = vec3(0.0); + vec3 legacyenv = vec3(0.0); sampleReflectionProbesLegacy(irradiance, glossenv, legacyenv, frag, pos.xyz, norm.xyz, 0.0, 0.0, true, amblit_linear); diff --git a/indra/newview/app_settings/shaders/class2/deferred/pbralphaF.glsl b/indra/newview/app_settings/shaders/class2/deferred/pbralphaF.glsl index 0418f99459d..5b5827fd67d 100644 --- a/indra/newview/app_settings/shaders/class2/deferred/pbralphaF.glsl +++ b/indra/newview/app_settings/shaders/class2/deferred/pbralphaF.glsl @@ -188,8 +188,8 @@ void main() vec3 radiance = vec3(0); sampleReflectionProbes(irradiance, radiance, vary_position.xy*0.5+0.5, pos.xyz, norm.xyz, gloss, true, amblit); - vec3 diffuseColor; - vec3 specularColor; + vec3 diffuseColor = vec3(0.0); + vec3 specularColor = vec3(0.0); calcDiffuseSpecular(col.rgb, metallic, diffuseColor, specularColor); vec3 v = -normalize(pos.xyz); diff --git a/indra/newview/app_settings/shaders/class3/deferred/fullbrightShinyF.glsl b/indra/newview/app_settings/shaders/class3/deferred/fullbrightShinyF.glsl index 03dc3d71137..32b788d4333 100644 --- a/indra/newview/app_settings/shaders/class3/deferred/fullbrightShinyF.glsl +++ b/indra/newview/app_settings/shaders/class3/deferred/fullbrightShinyF.glsl @@ -78,9 +78,9 @@ void main() float env_intensity = vertex_color.a; - vec3 ambenv; - vec3 glossenv; - vec3 legacyenv; + vec3 ambenv = vec3(1.0); + vec3 glossenv = vec3(0.0); + vec3 legacyenv = vec3(0.0); vec3 norm = normalize(vary_texcoord1.xyz); vec4 spec = vec4(0,0,0,0); sampleReflectionProbesLegacy(ambenv, glossenv, legacyenv, vec2(0), pos.xyz, norm.xyz, spec.a, env_intensity, false, amblit); diff --git a/indra/newview/app_settings/shaders/class3/deferred/materialF.glsl b/indra/newview/app_settings/shaders/class3/deferred/materialF.glsl index 5708fc319fa..f7505fbfe58 100644 --- a/indra/newview/app_settings/shaders/class3/deferred/materialF.glsl +++ b/indra/newview/app_settings/shaders/class3/deferred/materialF.glsl @@ -337,8 +337,8 @@ void main() vec3 amblit_linear = amblit; vec3 ambenv = amblit; - vec3 glossenv; - vec3 legacyenv; + vec3 glossenv = vec3(0.0); + vec3 legacyenv = vec3(0.0); sampleReflectionProbesLegacy(ambenv, glossenv, legacyenv, pos.xy*0.5+0.5, pos.xyz, norm.xyz, glossiness, env, true, amblit_linear); color = ambenv; diff --git a/indra/newview/app_settings/shaders/class3/deferred/softenLightF.glsl b/indra/newview/app_settings/shaders/class3/deferred/softenLightF.glsl index 948387a6eda..b3b8d295b91 100644 --- a/indra/newview/app_settings/shaders/class3/deferred/softenLightF.glsl +++ b/indra/newview/app_settings/shaders/class3/deferred/softenLightF.glsl @@ -180,8 +180,8 @@ void main() adjustIrradiance(irradiance, ambocc); - vec3 diffuseColor; - vec3 specularColor; + vec3 diffuseColor = vec3(0.0); + vec3 specularColor = vec3(0.0); calcDiffuseSpecular(baseColor.rgb, metallic, diffuseColor, specularColor); vec3 v = -normalize(pos.xyz); diff --git a/indra/newview/app_settings/shaders/class3/environment/waterF.glsl b/indra/newview/app_settings/shaders/class3/environment/waterF.glsl index 349f3b9a67d..d5e00f3a3f4 100644 --- a/indra/newview/app_settings/shaders/class3/environment/waterF.glsl +++ b/indra/newview/app_settings/shaders/class3/environment/waterF.glsl @@ -122,9 +122,7 @@ vec3 atmosLighting(vec3 light); vec3 scaleSoftClip(vec3 light); vec3 toneMapNoExposure(vec3 color); -vec3 vN, vT, vB; - -vec3 transform_normal(vec3 vNt) +vec3 transform_normal(vec3 vN, vec3 vT, vec3 vB, vec3 vNt) { return normalize(vNt.x * vT + vNt.y * vB + vNt.z * vN); } @@ -184,9 +182,9 @@ void main() { mirrorClip(vary_position); - vN = vary_normal; - vT = vary_tangent; - vB = cross(vN, vT); + vec3 vN = vary_normal; + vec3 vT = vary_tangent; + vec3 vB = cross(vN, vT); vec3 pos = vary_position.xyz; float linear_depth = 1 / -pos.z; @@ -222,14 +220,14 @@ void main() vec3 waver = wavef*3; - vec3 up = transform_normal(vec3(0,0,1)); + vec3 up = transform_normal(vN, vT, vB, vec3(0,0,1)); float vdu = -dot(viewVec, up)*2; vec3 wave_ibl = wavef * normScale; wave_ibl.z *= 2.0; - wave_ibl = transform_normal(normalize(wave_ibl)); + wave_ibl = transform_normal(vN, vT, vB, normalize(wave_ibl)); - vec3 norm = transform_normal(normalize(wavef)); + vec3 norm = transform_normal(vN, vT, vB, normalize(wavef)); vdu = clamp(vdu, 0, 1); //wavef.z *= max(vdu*vdu*vdu, 0.1); @@ -237,7 +235,7 @@ void main() wavef = normalize(wavef); //wavef = vec3(0, 0, 1); - wavef = transform_normal(wavef); + wavef = transform_normal(vN, vT, vB, wavef); float dist2 = dist; dist = max(dist, 5.0); @@ -312,7 +310,7 @@ void main() vec3 colorEmissive = vec3(0); float ao = 1.0; - vec3 light_dir = transform_normal(lightDir); + vec3 light_dir = transform_normal(vN, vT, vB, lightDir); float NdotV = clamp(abs(dot(norm, v)), 0.001, 1.0); diff --git a/indra/newview/app_settings/types_lua_default.xml b/indra/newview/app_settings/types_lua_default.xml new file mode 100644 index 00000000000..ae0760ef8bf --- /dev/null +++ b/indra/newview/app_settings/types_lua_default.xml @@ -0,0 +1,2707 @@ + + + + version + 1.0.0 + typeAliases + + + name + numeric + definition + + kind + union + types + + boolean + number + + + + + name + uuid_like + definition + + kind + union + types + + string + uuid + + + + + name + list + definition + + kind + array + elementType + + kind + union + types + + string + number + vector + uuid + quaternion + boolean + + + + + + name + lljson_constant + definition + + kind + reference + name + number + + + + name + DetectedEventName + definition + + kind + literal-union + values + + + + + name + NonDetectedEventName + definition + + kind + literal-union + values + + + + + name + EventName + definition + + kind + union + types + + DetectedEventName + NonDetectedEventName + + + + + name + EventHandler + definition + + kind + function + parameters + + + type + any + variadic + true + + + returnType + () + + + + name + DetectedEventHandler + definition + + kind + function + parameters + + + type + + kind + array + elementType + DetectedEvent + + + + returnType + () + + + + name + LLEventsProto + definition + + kind + table + properties + + + name + at_rot_target + type + + kind + union + types + + EventHandler + nil + + + comment + at_rot_target event + + + name + at_target + type + + kind + union + types + + EventHandler + nil + + + comment + at_target event + + + name + attach + type + + kind + union + types + + EventHandler + nil + + + comment + attach event + + + name + changed + type + + kind + union + types + + EventHandler + nil + + + comment + changed event + + + name + control + type + + kind + union + types + + EventHandler + nil + + + comment + control event + + + name + dataserver + type + + kind + union + types + + EventHandler + nil + + + comment + dataserver event + + + name + email + type + + kind + union + types + + EventHandler + nil + + + comment + email event + + + name + experience_permissions + type + + kind + union + types + + EventHandler + nil + + + comment + experience_permissions event + + + name + experience_permissions_denied + type + + kind + union + types + + EventHandler + nil + + + comment + experience_permissions_denied event + + + name + game_control + type + + kind + union + types + + EventHandler + nil + + + comment + game_control event + + + name + http_request + type + + kind + union + types + + EventHandler + nil + + + comment + http_request event + + + name + http_response + type + + kind + union + types + + EventHandler + nil + + + comment + http_response event + + + name + land_collision + type + + kind + union + types + + EventHandler + nil + + + comment + land_collision event + + + name + land_collision_end + type + + kind + union + types + + EventHandler + nil + + + comment + land_collision_end event + + + name + land_collision_start + type + + kind + union + types + + EventHandler + nil + + + comment + land_collision_start event + + + name + link_message + type + + kind + union + types + + EventHandler + nil + + + comment + link_message event + + + name + linkset_data + type + + kind + union + types + + EventHandler + nil + + + comment + linkset_data event + + + name + listen + type + + kind + union + types + + EventHandler + nil + + + comment + listen event + + + name + money + type + + kind + union + types + + EventHandler + nil + + + comment + money event + + + name + moving_end + type + + kind + union + types + + EventHandler + nil + + + comment + moving_end event + + + name + moving_start + type + + kind + union + types + + EventHandler + nil + + + comment + moving_start event + + + name + no_sensor + type + + kind + union + types + + EventHandler + nil + + + comment + no_sensor event + + + name + not_at_rot_target + type + + kind + union + types + + EventHandler + nil + + + comment + not_at_rot_target event + + + name + not_at_target + type + + kind + union + types + + EventHandler + nil + + + comment + not_at_target event + + + name + object_rez + type + + kind + union + types + + EventHandler + nil + + + comment + object_rez event + + + name + on_death + type + + kind + union + types + + EventHandler + nil + + + comment + on_death event + + + name + on_rez + type + + kind + union + types + + EventHandler + nil + + + comment + on_rez event + + + name + path_update + type + + kind + union + types + + EventHandler + nil + + + comment + path_update event + + + name + remote_data + type + + kind + union + types + + EventHandler + nil + + + comment + remote_data event + + + name + run_time_permissions + type + + kind + union + types + + EventHandler + nil + + + comment + run_time_permissions event + + + name + state_entry + type + + kind + union + types + + EventHandler + nil + + + comment + state_entry event + + + name + state_exit + type + + kind + union + types + + EventHandler + nil + + + comment + state_exit event + + + name + timer + type + + kind + union + types + + EventHandler + nil + + + comment + timer event + + + name + transaction_result + type + + kind + union + types + + EventHandler + nil + + + comment + transaction_result event + + + name + touch_start + type + + kind + union + types + + DetectedEventHandler + nil + + + comment + touch_start event + + + name + touch_end + type + + kind + union + types + + DetectedEventHandler + nil + + + comment + touch_end event + + + name + touch + type + + kind + union + types + + DetectedEventHandler + nil + + + comment + touch event + + + name + collision_start + type + + kind + union + types + + DetectedEventHandler + nil + + + comment + collision_start event + + + name + collision + type + + kind + union + types + + DetectedEventHandler + nil + + + comment + collision event + + + name + collision_end + type + + kind + union + types + + DetectedEventHandler + nil + + + comment + collision_end event + + + name + sensor + type + + kind + union + types + + DetectedEventHandler + nil + + + comment + sensor event + + + name + on_damage + type + + kind + union + types + + DetectedEventHandler + nil + + + comment + on_damage event + + + name + final_damage + type + + kind + union + types + + DetectedEventHandler + nil + + + comment + final_damage event + + + methods + + + name + eventNames + parameters + + + name + self + + + returnType + + kind + array + elementType + string + + + + name + listeners + parameters + + + name + self + + + name + eventName + type + EventName + + + returnType + + kind + array + elementType + EventHandler + + + + name + on + parameters + + + name + self + + + name + eventName + type + DetectedEventName + + + name + handler + type + DetectedEventHandler + + + returnType + EventHandler + overloads + + + name + on + parameters + + + name + self + + + name + eventName + type + NonDetectedEventName + + + name + handler + type + EventHandler + + + returnType + EventHandler + + + + + name + once + parameters + + + name + self + + + name + eventName + type + DetectedEventName + + + name + handler + type + DetectedEventHandler + + + returnType + EventHandler + overloads + + + name + once + parameters + + + name + self + + + name + eventName + type + NonDetectedEventName + + + name + handler + type + EventHandler + + + returnType + EventHandler + + + + + name + off + parameters + + + name + self + + + name + eventName + type + EventName + + + name + handler + type + EventHandler + + + returnType + boolean + + + + + + name + LLTimersProto + definition + + kind + table + methods + + + name + every + parameters + + + name + self + + + name + seconds + type + number + + + name + handler + type + + kind + function + parameters + + + type + any + variadic + true + + + returnType + () + + + + returnType + EventHandler + + + name + once + parameters + + + name + self + + + name + seconds + type + number + + + name + handler + type + + kind + function + parameters + + + type + any + variadic + true + + + returnType + () + + + + returnType + EventHandler + + + name + off + parameters + + + name + self + + + name + handler + type + EventHandler + + + returnType + boolean + + + + + + classes + + + name + uuid + properties + + + name + istruthy + type + boolean + comment + property to check if uuid is valid + + + methods + + + name + __tostring + parameters + + + name + self + + + returnType + string + comment + converts uuid to a string + + + + + name + quaternion + properties + + + name + x + type + number + comment + x property of quaternion + + + name + y + type + number + comment + y property of quaternion + + + name + z + type + number + comment + z property of quaternion + + + name + s + type + number + comment + s property of quaternion + + + methods + + + name + __mul + parameters + + + name + self + + + name + other + type + vector + + + returnType + vector + comment + multiply vector/quaternion by quaternion + overloads + + + name + __mul + parameters + + + name + self + + + name + other + type + quaternion + + + returnType + quaternion + comment + multiply vector/quaternion by quaternion + + + + + + + name + vector + properties + + + name + x + type + number + comment + x property of vector + + + name + y + type + number + comment + y property of vector + + + name + z + type + number + comment + z property of vector + + + methods + + + name + __mul + parameters + + + name + self + + + name + other + type + vector + + + returnType + vector + comment + multiply vector by number, vector, or quaternion + overloads + + + name + __mul + parameters + + + name + self + + + name + other + type + quaternion + + + returnType + vector + comment + multiply vector by number, vector, or quaternion + + + name + __mul + parameters + + + name + self + + + name + other + type + number + + + returnType + vector + comment + multiply vector by number, vector, or quaternion + + + + + name + __div + parameters + + + name + self + + + name + other + type + vector + + + returnType + vector + comment + divide vector by number, vector, or quaternion + overloads + + + name + __div + parameters + + + name + self + + + name + other + type + quaternion + + + returnType + vector + comment + divide vector by number, vector, or quaternion + + + name + __div + parameters + + + name + self + + + name + other + type + number + + + returnType + vector + comment + divide vector by number, vector, or quaternion + + + + + name + __idiv + parameters + + + name + self + + + name + other + type + vector + + + returnType + vector + comment + floor divide vector by number, vector, or quaternion + overloads + + + name + __idiv + parameters + + + name + self + + + name + other + type + quaternion + + + returnType + vector + comment + floor divide vector by number, vector, or quaternion + + + name + __idiv + parameters + + + name + self + + + name + other + type + number + + + returnType + vector + comment + floor divide vector by number, vector, or quaternion + + + + + name + __add + parameters + + + name + self + + + name + other + type + vector + + + returnType + vector + comment + add two vectors + + + name + __sub + parameters + + + name + self + + + name + other + type + vector + + + returnType + vector + comment + subtract vector from vector + + + name + __unm + parameters + + + name + self + + + returnType + vector + comment + negate a vector + + + + + name + DetectedEvent + properties + + + name + valid + type + boolean + + + name + index + type + number + + + name + can_change_damage + type + boolean + + + methods + + + + globalVariables + + + name + LLEvents + type + LLEventsProto + comment + LLEvents object + + + name + LLTimers + type + LLTimersProto + comment + LLTimers object + + + name + loadstring + type + nil + comment + loadstring is not available in slua + + + name + getfenv + type + nil + comment + getfenv is not available in slua + + + name + setfenv + type + nil + comment + setfenv is not available in slua + + + globalFunctions + + + name + uuid + parameters + + + name + str + type + string + + + returnType + uuid + comment + Creates a uuid from a string argument + + + name + toquaternion + parameters + + + name + str + type + string + + + returnType + + kind + union + types + + quaternion + nil + + + comment + Creates a quaternion from a string argument in format `<1,1,1,1>` Invalid strings will return `nil` #### Caveat Due to an old error from lsl strings that match upto the closing `>` are interpreted as valid So `<1,1,1,1` and `<1,1,1,1spoon` are both cast to `<1,1,1,1>` When testing if a string is a quaternion or a vector, you should test with `toquaternion` first. + + + name + tovector + parameters + + + name + str + type + string + + + returnType + + kind + union + types + + vector + nil + + + comment + Creates a vector from a string argument in format `<1,1,1>` Invalid strings will return `nil` #### Caveat Due to an old error from lsl strings that match upto the closing `>` are interpreted as valid So `<1,1,1`, `<1,1,1,1` and `<1,1,1spoon` are all cast to `<1,1,1>` When testing if a string is a quaternion or a vector, you should test with `toquaternion` first. + + + name + vector + parameters + + + name + x + type + number + + + name + y + type + number + + + name + z + type + number + + + returnType + vector + comment + Creates a vector from x,y,z + + + name + quaternion + parameters + + + name + x + type + number + + + name + y + type + number + + + name + z + type + number + + + name + s + type + number + + + returnType + quaternion + comment + Creates a quaternion from x,y,z,s + + + modules + + + name + bit32 + functions + + + name + arshift + parameters + + + name + n + type + number + + + name + i + type + number + + + returnType + number + comment + Shifts `n` by `i` bits to the right (if `i` is negative, a left shift is performed instead). The most significant bit of `n` is propagated during the shift. When `i` is larger than `31`, returns an integer with all bits set to the sign bit of `n`. When `i` is smaller than `-31`, `0` is returned + + + name + band + parameters + + + type + number + variadic + true + + + returnType + number + comment + Performs a bitwise and of all input numbers and returns the result. If the function is called with no arguments, an integer with all bits set to `1` is returned. + + + name + bnot + parameters + + + name + n + type + number + + + returnType + number + comment + Returns a bitwise negation of the input number. + + + name + bor + parameters + + + type + number + variadic + true + + + returnType + number + comment + Performs a bitwise or of all input numbers and returns the result. If the function is called with no arguments, `0` is returned. + + + name + btest + parameters + + + type + number + variadic + true + + + returnType + boolean + comment + Perform a bitwise and of all input numbers, and return `true` if the result is not `0`. If the function is called with no arguments, `true` is returned. + + + name + bxor + parameters + + + type + number + variadic + true + + + returnType + number + comment + Performs a bitwise xor (exclusive or) of all input numbers and returns the result. If the function is called with no arguments, `0` is returned. + + + name + byteswap + parameters + + + name + n + type + number + + + returnType + number + comment + Returns n with the order of the bytes swapped. + + + name + countlz + parameters + + + name + n + type + number + + + returnType + number + comment + Returns the number of consecutive zero bits in the 32-bit representation of `n` starting from the left-most (most significant) bit. Returns `32` if `n` is `0`. + + + name + countrz + parameters + + + name + n + type + number + + + returnType + number + comment + Returns the number of consecutive zero bits in the 32-bit representation of `n` starting from the right-most (least significant) bit. Returns `32` if `n` is `0`. + + + name + extract + parameters + + + name + n + type + number + + + name + f + type + number + + + name + w + type + number + + + returnType + number + comment + Extracts bits of `n` at position `f` with `a` width of `w`, and returns the resulting integer. `w` defaults to 1, so a two-argument version of extract returns the bit value at position `f`. Bits are indexed starting at `0`. Errors if `f` and `f+w-1` are not between `0` and `31`. + + + name + lrotate + parameters + + + name + n + type + number + + + name + i + type + number + + + returnType + number + comment + Rotates `n` to the left by `i` bits (if `i` is negative, a right rotate is performed instead) The bits that are shifted past the bit width are shifted back from the right. + + + name + lshift + parameters + + + name + n + type + number + + + name + i + type + number + + + returnType + number + comment + Shifts `n` to the left by `i` bits (if `i` is negative, a right shift is performed instead). When `i` is outside of `[-31..31]` range, returns `0`. + + + name + replace + parameters + + + name + n + type + number + + + name + r + type + number + + + name + f + type + number + + + name + w + type + number? + + + returnType + number + comment + Replaces bits of `n` at position `f` and width `w` with `r`, and returns the resulting integer. `w` defaults to `1`, so a three-argument version of replace changes one bit at position `f` to `r` (which should be `0` or `1`) and returns the result. Bits are indexed starting at `0`. Errors if `f` and `f+w-1` are not between `0` and `31`. + + + name + lrotate + parameters + + + name + n + type + number + + + name + i + type + number + + + returnType + number + comment + Rotates `n` to the left by `i` bits (if `i` is negative, a right rotate is performed instead) The bits that are shifted past the bit width are shifted back from the right. + + + name + rrotate + parameters + + + name + n + type + number + + + name + i + type + number + + + returnType + number + comment + Rotates `n` to the right by `i` bits (if `i` is negative, a left rotate is performed instead) The bits that are shifted past the bit width are shifted back from the left. + + + name + rshift + parameters + + + name + n + type + number + + + name + i + type + number + + + returnType + number + comment + Shifts `n` to the right by `i` bits (if `i` is negative, a left shift is performed instead). When `i` is outside of `[-31..31]` range, returns `0`. + + + + + name + lljson + properties + + + name + _NAME + type + "lljson" + comment + Name of the lljson table + + + name + _VERSION + type + string + comment + Version of the lljson library (based on the lua-cjson library) + + + name + array_mt + type + + kind + array + elementType + + + comment + Metatable for declaring table as an array for json encode + + + name + array_mt + type + + kind + array + elementType + + + comment + Metatable for declaring table as an empty array for json encode + + + name + empty_array + type + lljson_constant + comment + A constant to pass for an empty array to json encode + + + name + null + type + lljson_constant + comment + A constant to pass for null to json encode + + + functions + + + name + decode + parameters + + + name + json + type + string + + + returnType + + kind + union + types + + string + number + vector + uuid + quaternion + boolean + + kind + array + elementType + + + nil + + + comment + decode json string to lua value + + + name + encode + parameters + + + name + value + type + + kind + union + types + + string + number + vector + uuid + quaternion + boolean + + kind + array + elementType + + + nil + + + + + returnType + string + comment + encode lua value as json + + + name + sldecode + parameters + + + name + json + type + string + + + returnType + + kind + union + types + + string + number + vector + uuid + quaternion + boolean + + kind + array + elementType + + + nil + + + comment + decode json string to lua value preserving types + + + name + slencode + parameters + + + name + value + type + + kind + union + types + + string + number + vector + uuid + quaternion + boolean + + kind + array + elementType + + + nil + + + + + name + tight + type + boolean + + + returnType + string + comment + encode lua value as json preserving types. use tight to encode more compactly + + + + + name + llbase64 + functions + + + name + decode + parameters + + + name + base64 + type + string + + + returnType + string + comment + decode a base64 string, to a buffer or string + overloads + + + name + decode + parameters + + + name + base64 + type + string + + + name + asBuffer + type + true + + + returnType + buffer + + + name + decode + parameters + + + name + base64 + type + string + + + name + asBuffer + type + false + + + returnType + string + + + + + name + encode + parameters + + + name + value + type + + kind + union + types + + string + buffer + + + + + returnType + string + comment + encode a string or buffer to base64 + + + + + name + vector + properties + + + name + one + type + vector + comment + A one vector <1,1,1> + + + name + zero + type + vector + comment + A Zero vector <0,0,0> + + + functions + + + name + abs + parameters + + + name + vec + type + vector + + + returnType + vector + comment + Applies `math.abs` to every component of the input vector. + + + name + angle + parameters + + + name + vec1 + type + vector + + + name + vec2 + type + vector + + + name + axis + type + vector? + + + returnType + number + comment + Computes the angle between two vectors in radians. The axis, if specified, is used to determine the sign of the angle. + + + name + ceil + parameters + + + name + vec + type + vector + + + returnType + vector + comment + Applies `math.ceil` to every component of the input vector. + + + name + clamp + parameters + + + name + vec + type + vector + + + name + min + type + vector + + + name + max + type + vector + + + returnType + vector + comment + Applies `math.clamp` to every component of the input vector. + + + name + create + parameters + + + name + x + type + number + + + name + y + type + number + + + name + z + type + number + + + returnType + vector + comment + Creates a new vector with the given component values + + + name + cross + parameters + + + name + vec1 + type + vector + + + name + vec2 + type + vector + + + returnType + vector + comment + Computes the cross product of two vectors. + + + name + dot + parameters + + + name + vec1 + type + vector + + + name + vec2 + type + vector + + + returnType + number + comment + Computes the dot product of two vectors. + + + name + floor + parameters + + + name + vec + type + vector + + + returnType + vector + comment + Applies `math.floor` to every component of the input vector. + + + name + magnitude + parameters + + + name + vec + type + vector + + + returnType + number + comment + Calculates the magnitude of a given vector. + + + name + max + parameters + + + type + vector + variadic + true + + + returnType + vector + comment + Applies `math.max` to the corresponding components of the input vectors. + + + name + min + parameters + + + type + vector + variadic + true + + + returnType + vector + comment + Applies `math.min` to the corresponding components of the input vectors. + + + name + normalize + parameters + + + name + vec + type + vector + + + returnType + vector + comment + Computes the normalized version (unit vector) of a given vector. + + + name + sign + parameters + + + name + vec + type + vector + + + returnType + vector + comment + Applies `math.sign` to every component of the input vector. + + + + + + diff --git a/indra/newview/featuretable.txt b/indra/newview/featuretable.txt index 1090dd8ffb9..eca58938cfa 100644 --- a/indra/newview/featuretable.txt +++ b/indra/newview/featuretable.txt @@ -1,4 +1,4 @@ -version 74 +version 75 // The version number above should be incremented IF AND ONLY IF some // change has been made that is sufficiently important to justify // resetting the graphics preferences of all users to the recommended @@ -27,7 +27,7 @@ version 74 // NOTE: All settings are set to the MIN of applied values, including 'all'! // list all -RenderAnisotropic 1 1 +RenderAnisotropicLevel 1 16 RenderAvatarLODFactor 1 1.0 RenderAvatarPhysicsLODFactor 1 1.0 RenderAvatarMaxNonImpostors 1 16 @@ -92,7 +92,7 @@ RenderReflectionProbeCount 1 256 // Low Graphics Settings // list Low -RenderAnisotropic 1 0 +RenderAnisotropicLevel 1 0 RenderAvatarLODFactor 1 0 RenderAvatarPhysicsLODFactor 1 0 RenderAvatarMaxNonImpostors 1 3 @@ -135,7 +135,7 @@ RenderReflectionProbeCount 1 1 // Medium Low Graphics Settings // list LowMid -RenderAnisotropic 1 0 +RenderAnisotropicLevel 1 2 RenderAvatarLODFactor 1 0.5 RenderAvatarMaxComplexity 1 100000 RenderAvatarPhysicsLODFactor 1 0.75 @@ -178,7 +178,7 @@ RenderReflectionProbeCount 1 32 // Medium Graphics Settings (standard) // list Mid -RenderAnisotropic 1 1 +RenderAnisotropicLevel 1 2 RenderAvatarLODFactor 1 1.0 RenderAvatarMaxComplexity 1 200000 RenderAvatarPhysicsLODFactor 1 1.0 @@ -220,7 +220,7 @@ RenderReflectionProbeCount 1 64 // Medium High Graphics Settings // list MidHigh -RenderAnisotropic 1 1 +RenderAnisotropicLevel 1 4 RenderAvatarLODFactor 1 1.0 RenderAvatarMaxComplexity 1 250000 RenderAvatarPhysicsLODFactor 1 1.0 @@ -262,7 +262,7 @@ RenderReflectionProbeCount 1 64 // High Graphics Settings (SSAO + sun shadows) // list High -RenderAnisotropic 1 1 +RenderAnisotropicLevel 1 4 RenderAvatarLODFactor 1 1.0 RenderAvatarMaxComplexity 1 300000 RenderAvatarPhysicsLODFactor 1 1.0 @@ -301,10 +301,10 @@ RenderMaxTextureResolution 1 2048 RenderReflectionProbeCount 1 128 // -// High Ultra Graphics Settings (deferred + SSAO + all shadows) +// High Ultra Graphics Settings (SSAO + all shadows) // list HighUltra -RenderAnisotropic 1 1 +RenderAnisotropicLevel 1 4 RenderAvatarLODFactor 1 1.0 RenderAvatarMaxComplexity 1 350000 RenderAvatarPhysicsLODFactor 1 1.0 @@ -346,7 +346,7 @@ RenderReflectionProbeCount 1 256 // Ultra graphics (REALLY PURTY!) // list Ultra -RenderAnisotropic 1 1 +RenderAnisotropicLevel 1 8 RenderAvatarLODFactor 1 1.0 RenderAvatarMaxNonImpostors 1 16 RenderAvatarPhysicsLODFactor 1 1.0 @@ -399,11 +399,17 @@ RenderDisableVintageMode 1 0 list VRAMGT512 RenderCompressTextures 1 0 +// +// AF Missing or AF < 2 +// +list AnisotropicMissing +RenderAnisotropicLevel 0 0 + // // "Default" setups for safe, low, medium, high // list safe -RenderAnisotropic 1 0 +RenderAnisotropicLevel 1 0 RenderAvatarMaxNonImpostors 1 16 RenderAvatarMaxComplexity 1 80000 RenderLocalLightCount 1 0 @@ -419,7 +425,7 @@ RenderMaxTextureResolution 1 2048 RenderReflectionProbeCount 0 0 list Intel -RenderAnisotropic 1 0 +RenderAnisotropicLevel 1 0 RenderFSAAType 1 0 RenderFSAASamples 1 0 RenderGLContextCoreProfile 1 0 diff --git a/indra/newview/featuretable_linux.txt b/indra/newview/featuretable_linux.txt index d8d4f084291..a160161ef1c 100644 --- a/indra/newview/featuretable_linux.txt +++ b/indra/newview/featuretable_linux.txt @@ -1,10 +1,10 @@ -version 30 +version 34 // The version number above should be incremented IF AND ONLY IF some // change has been made that is sufficiently important to justify // resetting the graphics preferences of all users to the recommended // defaults. This should be as rare an event as we can manage. -// NOTE: This is mostly identical to featuretable_mac.txt with a few differences +// NOTE: This is mostly identical to featuretable_mac.txt with a few differences // Should be combined into one table // @@ -27,28 +27,28 @@ version 30 // NOTE: All settings are set to the MIN of applied values, including 'all'! // list all -RenderAnisotropic 1 1 -RenderAvatarCloth 1 1 +RenderAnisotropicLevel 1 16 RenderAvatarLODFactor 1 1.0 RenderAvatarPhysicsLODFactor 1 1.0 RenderAvatarMaxNonImpostors 1 16 RenderAvatarMaxComplexity 1 350000 RenderAutoMuteSurfaceAreaLimit 1 1000.0 RenderCubeMap 1 1 -RenderDelayVBUpdate 1 0 RenderFarClip 1 256 RenderFlexTimeFactor 1 1.0 RenderFogRatio 1 4.0 RenderGamma 1 0 RenderGlowResolutionPow 1 9 -RenderGround 1 1 RenderMaxPartCount 1 8192 RenderObjectBump 1 1 -RenderLocalLights 1 1 -RenderReflectionDetail 1 4 +RenderLocalLightCount 1 4096 +RenderTransparentWater 1 1 +RenderReflectionsEnabled 1 1 +RenderReflectionProbeDetail 1 2 RenderTerrainDetail 1 1 RenderTerrainLODFactor 1 2.0 -RenderTransparentWater 1 1 +RenderTerrainPBRDetail 1 0 +RenderTerrainPBRPlanarSampleCount 1 3 RenderTreeLODFactor 1 1.0 RenderVBOEnable 1 1 RenderVBOMappingDisable 1 1 @@ -61,58 +61,38 @@ Disregard128DefaultDrawDistance 1 1 Disregard96DefaultDrawDistance 1 1 RenderCompressTextures 1 1 RenderShaderLightingMaxLevel 1 3 +RenderReflectionProbeLevel 1 3 RenderDeferred 1 1 RenderDeferredSSAO 1 1 -RenderUseAdvancedAtmospherics 1 0 RenderShadowDetail 1 2 -RenderFSAASamples 1 16 +RenderUseStreamVBO 1 1 +RenderFSAAType 1 2 +RenderFSAASamples 1 3 RenderMaxTextureIndex 1 16 +RenderGLContextCoreProfile 1 1 +RenderGLMultiThreadedTextures 1 0 +RenderGLMultiThreadedMedia 1 0 +RenderReflectionProbeResolution 1 128 +RenderScreenSpaceReflections 1 1 RenderMirrors 1 1 - -// -// Low Graphics Settings (fixed function) -// -list LowFixedFunction -RenderAnisotropic 1 0 -RenderAvatarCloth 1 0 -RenderAvatarLODFactor 1 0 -RenderAvatarPhysicsLODFactor 1 0 -RenderAvatarMaxNonImpostors 1 3 -RenderAvatarMaxComplexity 1 25000 -RenderFarClip 1 64 -RenderFlexTimeFactor 1 0 -RenderGlowResolutionPow 1 8 -RenderLocalLights 1 0 -RenderMaxPartCount 1 0 -RenderObjectBump 1 0 -RenderReflectionDetail 1 0 -RenderTerrainDetail 1 0 -RenderTerrainLODFactor 1 1 -RenderTransparentWater 1 0 -RenderTreeLODFactor 1 0 -RenderVolumeLODFactor 1 1.125 -WindLightUseAtmosShaders 1 0 -RenderDeferred 1 0 -RenderDeferredSSAO 1 0 -RenderUseAdvancedAtmospherics 1 0 -RenderShadowDetail 1 0 -WLSkyDetail 1 48 -RenderFSAASamples 1 0 -RenderMirrors 1 0 -RenderHeroProbeResolution 1 256 -RenderHeroProbeDistance 1 4 -RenderHeroProbeUpdateRate 1 6 +RenderHeroProbeResolution 1 2048 +RenderHeroProbeDistance 1 16 +RenderHeroProbeUpdateRate 1 6 RenderHeroProbeConservativeUpdateMultiplier 1 16 +RenderDownScaleMethod 1 0 +RenderCASSharpness 1 1 RenderExposure 1 4 RenderTonemapType 1 1 RenderTonemapMix 1 1 +RenderDisableVintageMode 1 1 +RenderMaxTextureResolution 1 2048 +RenderReflectionProbeCount 1 256 // // Low Graphics Settings // list Low -RenderAnisotropic 1 0 -RenderAvatarCloth 1 0 +RenderAnisotropicLevel 1 0 RenderAvatarLODFactor 1 0 RenderAvatarPhysicsLODFactor 1 0 RenderAvatarMaxNonImpostors 1 3 @@ -120,297 +100,298 @@ RenderAvatarMaxComplexity 1 35000 RenderFarClip 1 64 RenderFlexTimeFactor 1 0 RenderGlowResolutionPow 1 8 -RenderLocalLights 1 0 +RenderLocalLightCount 1 8 RenderMaxPartCount 1 0 -RenderObjectBump 1 0 -RenderReflectionDetail 1 0 +RenderTransparentWater 1 0 +RenderReflectionsEnabled 1 0 +RenderReflectionProbeDetail 1 0 RenderTerrainDetail 1 0 RenderTerrainLODFactor 1 1 -RenderTransparentWater 1 0 +RenderTerrainPBRDetail 1 -4 +RenderTerrainPBRPlanarSampleCount 1 1 RenderTreeLODFactor 1 0 RenderVolumeLODFactor 1 1.125 -WindLightUseAtmosShaders 1 0 -RenderDeferred 1 0 RenderDeferredSSAO 1 0 -RenderUseAdvancedAtmospherics 1 0 RenderShadowDetail 1 0 -WLSkyDetail 1 48 +WLSkyDetail 1 96 +RenderFSAAType 1 0 RenderFSAASamples 1 0 +RenderScreenSpaceReflections 1 0 +RenderReflectionProbeLevel 1 0 RenderMirrors 1 0 RenderHeroProbeResolution 1 256 RenderHeroProbeDistance 1 4 -RenderHeroProbeUpdateRate 1 6 +RenderHeroProbeUpdateRate 1 6 RenderHeroProbeConservativeUpdateMultiplier 1 16 +RenderCASSharpness 1 0 RenderExposure 1 1 RenderTonemapType 1 1 RenderTonemapMix 1 0.7 +RenderDisableVintageMode 1 0 +RenderMaxTextureResolution 1 512 +RenderReflectionProbeCount 1 1 // // Medium Low Graphics Settings // list LowMid -RenderAnisotropic 1 0 -RenderAvatarCloth 1 0 +RenderAnisotropicLevel 1 0 RenderAvatarLODFactor 1 0.5 RenderAvatarMaxComplexity 1 100000 RenderAvatarPhysicsLODFactor 1 0.75 +RenderAvatarMaxNonImpostors 1 5 RenderFarClip 1 96 RenderFlexTimeFactor 1 1.0 RenderGlowResolutionPow 1 8 RenderMaxPartCount 1 2048 -RenderObjectBump 1 1 -RenderLocalLights 1 1 -RenderReflectionDetail 1 0 +RenderLocalLightCount 1 256 +RenderTransparentWater 1 0 +RenderReflectionsEnabled 1 1 +RenderReflectionProbeDetail 1 0 RenderTerrainDetail 1 1 RenderTerrainLODFactor 1 1.0 -RenderTransparentWater 1 1 +RenderTerrainPBRDetail 1 -1 +RenderTerrainPBRPlanarSampleCount 1 1 RenderTreeLODFactor 1 0.5 RenderVolumeLODFactor 1 1.125 -WindLightUseAtmosShaders 1 0 -RenderDeferred 1 0 RenderDeferredSSAO 1 0 -RenderUseAdvancedAtmospherics 1 0 RenderShadowDetail 1 0 -WLSkyDetail 1 48 +WLSkyDetail 1 96 +RenderFSAAType 1 0 RenderFSAASamples 1 0 +RenderScreenSpaceReflections 1 0 +RenderReflectionProbeLevel 1 0 RenderMirrors 1 0 RenderHeroProbeResolution 1 256 RenderHeroProbeDistance 1 6 RenderHeroProbeUpdateRate 1 3 RenderHeroProbeConservativeUpdateMultiplier 1 16 +RenderCASSharpness 1 0 RenderExposure 1 1 RenderTonemapType 1 1 RenderTonemapMix 1 0.7 +RenderDisableVintageMode 1 0 +RenderMaxTextureResolution 1 1024 +RenderReflectionProbeCount 1 32 // // Medium Graphics Settings (standard) // list Mid -RenderAnisotropic 1 1 -RenderAvatarCloth 1 0 +RenderAnisotropicLevel 1 2 RenderAvatarLODFactor 1 1.0 RenderAvatarMaxComplexity 1 200000 RenderAvatarPhysicsLODFactor 1 1.0 +RenderAvatarMaxNonImpostors 1 7 RenderFarClip 1 128 RenderFlexTimeFactor 1 1.0 RenderGlowResolutionPow 1 9 RenderMaxPartCount 1 4096 -RenderObjectBump 1 1 -RenderLocalLights 1 1 -RenderReflectionDetail 1 0 +RenderLocalLightCount 1 512 +RenderTransparentWater 1 0 RenderTerrainDetail 1 1 RenderTerrainLODFactor 1 2.0 -RenderTransparentWater 1 1 +RenderTerrainPBRDetail 1 0 +RenderTerrainPBRPlanarSampleCount 1 1 RenderTreeLODFactor 1 0.5 -RenderVolumeLODFactor 1 1.125 -WindLightUseAtmosShaders 1 1 -RenderDeferred 1 0 +RenderVolumeLODFactor 1 1.25 RenderDeferredSSAO 1 0 -RenderUseAdvancedAtmospherics 1 0 RenderShadowDetail 1 0 -WLSkyDetail 1 48 -RenderFSAASamples 1 2 +WLSkyDetail 1 96 +RenderFSAAType 1 1 +RenderFSAASamples 1 1 +RenderReflectionsEnabled 1 1 +RenderReflectionProbeDetail 1 0 +RenderScreenSpaceReflections 1 0 +RenderReflectionProbeLevel 1 1 RenderMirrors 1 0 RenderHeroProbeResolution 1 512 RenderHeroProbeDistance 1 6 RenderHeroProbeUpdateRate 1 3 RenderHeroProbeConservativeUpdateMultiplier 1 16 +RenderCASSharpness 1 0 RenderExposure 1 1 RenderTonemapType 1 1 RenderTonemapMix 1 0.7 +RenderMaxTextureResolution 1 2048 +RenderReflectionProbeCount 1 64 // -// Medium High Graphics Settings (deferred enabled) +// Medium High Graphics Settings // list MidHigh -RenderAnisotropic 1 1 -RenderAvatarCloth 1 0 +RenderAnisotropicLevel 1 2 RenderAvatarLODFactor 1 1.0 RenderAvatarMaxComplexity 1 250000 RenderAvatarPhysicsLODFactor 1 1.0 +RenderAvatarMaxNonImpostors 1 9 RenderFarClip 1 128 RenderFlexTimeFactor 1 1.0 RenderGlowResolutionPow 1 9 RenderMaxPartCount 1 4096 -RenderObjectBump 1 1 -RenderLocalLights 1 1 -RenderReflectionDetail 1 0 +RenderLocalLightCount 1 1024 +RenderTransparentWater 1 0 RenderTerrainDetail 1 1 RenderTerrainLODFactor 1 2.0 -RenderTransparentWater 1 1 +RenderTerrainPBRDetail 1 0 +RenderTerrainPBRPlanarSampleCount 1 1 RenderTreeLODFactor 1 0.5 -RenderVolumeLODFactor 1 1.125 -WindLightUseAtmosShaders 1 1 -RenderDeferred 1 1 -RenderUseAdvancedAtmospherics 1 0 +RenderVolumeLODFactor 1 1.375 RenderDeferredSSAO 1 0 RenderShadowDetail 1 0 -WLSkyDetail 1 48 -RenderFSAASamples 1 2 +WLSkyDetail 1 96 +RenderFSAAType 1 1 +RenderFSAASamples 1 1 +RenderReflectionsEnabled 1 1 +RenderReflectionProbeDetail 1 1 +RenderScreenSpaceReflections 1 0 +RenderReflectionProbeLevel 1 1 RenderMirrors 1 0 RenderHeroProbeResolution 1 512 RenderHeroProbeDistance 1 6 RenderHeroProbeUpdateRate 1 2 RenderHeroProbeConservativeUpdateMultiplier 1 8 +RenderCASSharpness 1 0 RenderExposure 1 1 RenderTonemapType 1 1 RenderTonemapMix 1 0.7 +RenderMaxTextureResolution 1 2048 +RenderReflectionProbeCount 1 64 // -// High Graphics Settings (deferred + SSAO) +// High Graphics Settings (SSAO + sun shadows) // list High -RenderAnisotropic 1 1 -RenderAvatarCloth 1 0 +RenderAnisotropicLevel 1 4 RenderAvatarLODFactor 1 1.0 RenderAvatarMaxComplexity 1 300000 RenderAvatarPhysicsLODFactor 1 1.0 +RenderAvatarMaxNonImpostors 1 11 RenderFarClip 1 128 RenderFlexTimeFactor 1 1.0 RenderGlowResolutionPow 1 9 RenderMaxPartCount 1 4096 -RenderObjectBump 1 1 -RenderLocalLights 1 1 -RenderReflectionDetail 1 0 +RenderLocalLightCount 1 2048 +RenderTransparentWater 1 1 RenderTerrainDetail 1 1 RenderTerrainLODFactor 1 2.0 -RenderTransparentWater 1 1 +RenderTerrainPBRDetail 1 0 +RenderTerrainPBRPlanarSampleCount 1 3 RenderTreeLODFactor 1 0.5 -RenderVolumeLODFactor 1 1.125 -WindLightUseAtmosShaders 1 1 -RenderDeferred 1 1 +RenderVolumeLODFactor 1 1.5 RenderDeferredSSAO 1 1 -RenderUseAdvancedAtmospherics 1 0 -RenderShadowDetail 1 0 -WLSkyDetail 1 48 +RenderShadowDetail 1 1 +WLSkyDetail 1 96 +RenderFSAAType 1 2 RenderFSAASamples 1 2 +RenderReflectionsEnabled 1 1 +RenderReflectionProbeDetail 1 1 +RenderScreenSpaceReflections 1 0 +RenderReflectionProbeLevel 1 2 RenderMirrors 1 0 RenderHeroProbeResolution 1 512 RenderHeroProbeDistance 1 8 RenderHeroProbeUpdateRate 1 2 RenderHeroProbeConservativeUpdateMultiplier 1 8 +RenderCASSharpness 1 0.4 RenderExposure 1 1 RenderTonemapType 1 1 RenderTonemapMix 1 0.7 +RenderMaxTextureResolution 1 2048 +RenderReflectionProbeCount 1 128 // -// High Ultra Graphics Settings (deferred + SSAO + shadows) +// High Ultra Graphics Settings (SSAO + all shadows) // list HighUltra -RenderAnisotropic 1 1 -RenderAvatarCloth 1 0 +RenderAnisotropicLevel 1 4 RenderAvatarLODFactor 1 1.0 RenderAvatarMaxComplexity 1 350000 RenderAvatarPhysicsLODFactor 1 1.0 +RenderAvatarMaxNonImpostors 1 16 RenderFarClip 1 128 RenderFlexTimeFactor 1 1.0 RenderGlowResolutionPow 1 9 RenderMaxPartCount 1 4096 -RenderObjectBump 1 1 -RenderLocalLights 1 1 -RenderReflectionDetail 1 0 +RenderLocalLightCount 1 4096 RenderTerrainDetail 1 1 RenderTerrainLODFactor 1 2.0 +RenderTerrainPBRDetail 1 0 +RenderTerrainPBRPlanarSampleCount 1 3 RenderTransparentWater 1 1 RenderTreeLODFactor 1 0.5 -RenderVolumeLODFactor 1 1.125 -WindLightUseAtmosShaders 1 1 -RenderDeferred 1 1 +RenderVolumeLODFactor 1 1.75 RenderDeferredSSAO 1 1 -RenderUseAdvancedAtmospherics 1 0 RenderShadowDetail 1 2 -WLSkyDetail 1 48 +WLSkyDetail 1 96 +RenderFSAAType 1 2 RenderFSAASamples 1 2 +RenderReflectionsEnabled 1 1 +RenderReflectionProbeDetail 1 1 +RenderScreenSpaceReflections 1 0 +RenderReflectionProbeLevel 1 3 RenderMirrors 1 0 -RenderHeroProbeResolution 1 512 +RenderHeroProbeResolution 1 1024 RenderHeroProbeDistance 1 16 RenderHeroProbeUpdateRate 1 1 RenderHeroProbeConservativeUpdateMultiplier 1 4 +RenderCASSharpness 1 0.4 RenderExposure 1 1 RenderTonemapType 1 1 RenderTonemapMix 1 0.7 +RenderMaxTextureResolution 1 2048 +RenderReflectionProbeCount 1 256 // // Ultra graphics (REALLY PURTY!) // list Ultra -RenderAnisotropic 1 1 -RenderAvatarCloth 1 1 +RenderAnisotropicLevel 1 8 RenderAvatarLODFactor 1 1.0 +RenderAvatarMaxNonImpostors 1 16 RenderAvatarPhysicsLODFactor 1 1.0 RenderFarClip 1 256 RenderFlexTimeFactor 1 1.0 RenderGlowResolutionPow 1 9 -RenderLocalLights 1 1 +RenderLocalLightCount 1 8192 RenderMaxPartCount 1 8192 -RenderObjectBump 1 1 -RenderReflectionDetail 1 4 RenderTerrainDetail 1 1 RenderTerrainLODFactor 1 2.0 +RenderTerrainPBRDetail 1 0 +RenderTerrainPBRPlanarSampleCount 1 3 RenderTransparentWater 1 1 RenderTreeLODFactor 1 1.0 RenderVolumeLODFactor 1 2.0 WindLightUseAtmosShaders 1 1 WLSkyDetail 1 128 -RenderDeferred 1 1 RenderDeferredSSAO 1 1 -RenderUseAdvancedAtmospherics 1 0 RenderShadowDetail 1 2 -RenderFSAASamples 1 2 +RenderFSAAType 1 2 +RenderFSAASamples 1 3 +RenderReflectionsEnabled 1 1 +RenderReflectionProbeDetail 1 1 +RenderScreenSpaceReflections 1 0 +RenderReflectionProbeLevel 1 3 RenderMirrors 1 0 -RenderHeroProbeResolution 1 1024 +RenderHeroProbeResolution 1 2048 RenderHeroProbeDistance 1 16 RenderHeroProbeUpdateRate 1 1 RenderHeroProbeConservativeUpdateMultiplier 1 4 +RenderCASSharpness 1 0.4 RenderExposure 1 1 RenderTonemapType 1 1 RenderTonemapMix 1 0.7 +RenderMaxTextureResolution 1 2048 +RenderReflectionProbeCount 1 256 // // Class Unknown Hardware (unknown) // list Unknown -RenderVBOEnable 1 0 RenderShadowDetail 1 0 -RenderDeferred 1 0 RenderDeferredSSAO 1 0 -RenderUseAdvancedAtmospherics 1 0 - -// -// Class 0 Hardware (just old) -// -list Class0 -RenderVBOEnable 1 1 - -// -// Class 1 Hardware -// -list Class1 -RenderVBOEnable 1 1 - -// -// Class 2 Hardware -// -list Class2 -RenderVBOEnable 1 1 - -// -// Class 3 Hardware -// -list Class3 -RenderVBOEnable 1 1 - -// -// Class 4 Hardware -// -list Class4 -RenderVBOEnable 1 1 - -// -// Class 5 Hardware -// -list Class5 -RenderVBOEnable 1 1 +RenderMirrors 1 0 +RenderDisableVintageMode 1 0 // // VRAM > 512MB @@ -419,339 +400,58 @@ list VRAMGT512 RenderCompressTextures 1 0 // -// No Pixel Shaders available +// AF Missing or AF < 2 // -list NoPixelShaders -RenderAvatarCloth 0 0 -RenderReflectionDetail 0 0 -WindLightUseAtmosShaders 0 0 -RenderDeferred 0 0 -RenderDeferredSSAO 0 0 -RenderUseAdvancedAtmospherics 0 0 -RenderShadowDetail 0 0 - -// -// No Vertex Shaders available -// -list NoVertexShaders -RenderAvatarCloth 0 0 -RenderReflectionDetail 0 0 -WindLightUseAtmosShaders 0 0 -RenderDeferred 0 0 -RenderDeferredSSAO 0 0 -RenderUseAdvancedAtmospherics 0 0 -RenderShadowDetail 0 0 - -// -// GL_ARB_map_buffer_range exists -// -list MapBufferRange -RenderVBOMappingDisable 1 1 - +list AnisotropicMissing +RenderAnisotropicLevel 0 0 // // "Default" setups for safe, low, medium, high // list safe -RenderAnisotropic 1 0 -RenderAvatarCloth 0 0 +RenderAnisotropicLevel 1 0 RenderAvatarMaxNonImpostors 1 16 RenderAvatarMaxComplexity 1 80000 -RenderObjectBump 0 0 -RenderLocalLights 1 0 +RenderLocalLightCount 1 0 RenderMaxPartCount 1 1024 RenderTerrainDetail 1 0 -RenderVBOEnable 1 0 -RenderReflectionDetail 0 0 -WindLightUseAtmosShaders 0 0 -RenderDeferred 0 0 +RenderTransparentWater 1 0 RenderDeferredSSAO 0 0 -RenderUseAdvancedAtmospherics 0 0 RenderShadowDetail 0 0 - -// -// CPU based feature masks -// - -// 1Ghz or less (equiv) -list CPUSlow -RenderMaxPartCount 1 1024 - -// -// RAM based feature masks -// -list RAM256MB -RenderObjectBump 0 0 - -// -// Graphics card based feature masks -// -list OpenGLPre15 -RenderVBOEnable 1 0 - -list OpenGLPre30 -RenderDeferred 0 0 -RenderMaxTextureIndex 1 1 +RenderReflectionProbeDetail 0 -1 +RenderMirrors 0 0 +RenderDisableVintageMode 1 0 +RenderMaxTextureResolution 1 2048 +RenderReflectionProbeCount 0 0 list Intel -RenderAnisotropic 1 0 -// Avoid some Intel crashes on Linux -RenderCubeMap 0 0 +RenderAnisotropicLevel 1 0 +RenderFSAAType 1 0 RenderFSAASamples 1 0 - -list GeForce2 -RenderAnisotropic 1 0 -RenderMaxPartCount 1 2048 -RenderTerrainDetail 1 0 -RenderVBOEnable 1 1 - -list SiS -UseOcclusion 0 0 - - -list Intel_830M -RenderTerrainDetail 1 0 -RenderVBOEnable 1 0 - -list Intel_845G -RenderTerrainDetail 1 0 -RenderVBOEnable 1 0 - -list Intel_855GM -RenderTerrainDetail 1 0 -RenderVBOEnable 1 0 - -list Intel_865G -RenderTerrainDetail 1 0 -RenderVBOEnable 1 0 - -list Intel_900 -RenderTerrainDetail 1 0 -RenderVBOEnable 1 0 - -list Intel_915GM -RenderTerrainDetail 1 0 -RenderVBOEnable 1 0 - -list Intel_915G -RenderTerrainDetail 1 0 -RenderVBOEnable 1 0 - -list Intel_945GM -RenderTerrainDetail 1 0 -RenderVBOEnable 1 0 - -list Intel_945G -RenderTerrainDetail 1 0 -RenderVBOEnable 1 0 - -list Intel_950 -RenderTerrainDetail 1 0 -RenderVBOEnable 1 0 - -list Intel_965 -RenderTerrainDetail 1 0 -RenderVBOEnable 1 0 -UseOcclusion 0 0 - -list Intel_G33 -RenderTerrainDetail 1 0 -RenderVBOEnable 1 0 - -list Intel_Bear_Lake -RenderTerrainDetail 1 0 -RenderVBOEnable 1 0 - -list Intel_Broadwater -RenderTerrainDetail 1 0 -RenderVBOEnable 1 0 - -list Intel_Brookdale -RenderTerrainDetail 1 0 -RenderVBOEnable 1 0 - -list Intel_Montara -RenderTerrainDetail 1 0 -RenderVBOEnable 1 0 - -list Intel_Springdale -RenderTerrainDetail 1 0 -RenderVBOEnable 1 0 - - -list ATI_FireGL_5200 -RenderVBOEnable 1 0 -WindLightUseAtmosShaders 0 0 - - -list ATI_Mobility_Radeon_7xxx -RenderVBOEnable 0 0 - -list ATI_Radeon_7xxx -RenderVBOEnable 0 0 - -list ATI_All-in-Wonder_Radeon -RenderVBOEnable 0 0 - -list ATI_All-in-Wonder_7500 -RenderVBOEnable 0 0 - -list ATI_Mobility_Radeon_9600 -Disregard96DefaultDrawDistance 1 0 - - -/// tweaked ATI to 96 Draw distance - -list ATI_Radeon_9000 -Disregard96DefaultDrawDistance 1 0 -list ATI_Radeon_9200 -Disregard96DefaultDrawDistance 1 0 -list ATI_Radeon_9500 -Disregard96DefaultDrawDistance 1 0 -list ATI_Radeon_9600 -Disregard96DefaultDrawDistance 1 0 - -/// tweaked ATI to 128 draw distance - -list ATI_Radeon_X300 -Disregard128DefaultDrawDistance 1 0 -list ATI_Radeon_X400 -Disregard128DefaultDrawDistance 1 0 -list ATI_Radeon_X500 -Disregard128DefaultDrawDistance 1 0 -list ATI_Radeon_X600 -Disregard128DefaultDrawDistance 1 0 -list ATI_Radeon_X700 -Disregard128DefaultDrawDistance 1 0 -list ATI_Radeon_X1300 -Disregard128DefaultDrawDistance 1 0 -UseStartScreen 0 0 -list ATI_Radeon_X1400 -Disregard128DefaultDrawDistance 1 0 -list ATI_Radeon_X1500 -Disregard128DefaultDrawDistance 1 0 -UseStartScreen 0 0 -list ATI_Radeon_X1600 -Disregard128DefaultDrawDistance 1 0 -list ATI_Radeon_X1700 -Disregard128DefaultDrawDistance 1 0 -list ATI_Mobility_Radeon_X1xxx -Disregard128DefaultDrawDistance 1 0 -list ATI_Radeon_HD_2300 -Disregard128DefaultDrawDistance 1 0 -list ATI_Radeon_HD_2400 -Disregard128DefaultDrawDistance 1 0 -list ATI_ASUS_AH24xx -Disregard128DefaultDrawDistance 1 0 - - -// Avatar hardware skinning causes invisible avatars -// on various ATI chipsets on drivers before 8.2 - -list ATIOldDriver -RenderAvatarCloth 0 0 -// Avoid driver crashes with some features on Linux with old ATI drivers -UseOcclusion 0 0 -WindLightUseAtmosShaders 0 0 - - -/// Tweaked NVIDIA - -list NVIDIA_GeForce_FX_5100 -Disregard96DefaultDrawDistance 1 0 -list NVIDIA_GeForce_FX_5200 -Disregard96DefaultDrawDistance 1 0 -list NVIDIA_GeForce_FX_5500 -Disregard96DefaultDrawDistance 1 0 -list NVIDIA_GeForce_FX_5600 -Disregard96DefaultDrawDistance 1 0 - -list NVIDIA_GeForce_FX_Go5100 -Disregard96DefaultDrawDistance 1 0 -list NVIDIA_GeForce_FX_Go5200 -Disregard96DefaultDrawDistance 1 0 -list NVIDIA_GeForce_FX_Go5300 -Disregard96DefaultDrawDistance 1 0 -list NVIDIA_GeForce_FX_Go5500 -Disregard96DefaultDrawDistance 1 0 -list NVIDIA_GeForce_FX_Go5600 -Disregard96DefaultDrawDistance 1 0 - -list NVIDIA_GeForce_6100 -Disregard128DefaultDrawDistance 1 0 -list NVIDIA_GeForce_6200 -Disregard128DefaultDrawDistance 1 0 -list NVIDIA_GeForce_6500 -Disregard128DefaultDrawDistance 1 0 -list NVIDIA_GeForce_6600 -Disregard128DefaultDrawDistance 1 0 - -list NVIDIA_G73 -Disregard128DefaultDrawDistance 1 0 - -list NVIDIA_GeForce_Go_6100 -RenderVBOEnable 1 0 -Disregard128DefaultDrawDistance 1 0 -list NVIDIA_GeForce_Go_6200 -RenderVBOEnable 1 0 -Disregard128DefaultDrawDistance 1 0 -list NVIDIA_GeForce_Go_6500 -RenderVBOEnable 1 0 -Disregard128DefaultDrawDistance 1 0 -list NVIDIA_GeForce_Go_6600 -RenderVBOEnable 1 0 -Disregard128DefaultDrawDistance 1 0 -list NVIDIA_GeForce_Go_6700 -RenderVBOEnable 1 0 -Disregard128DefaultDrawDistance 1 0 -list NVIDIA_GeForce_Go_6800 -RenderVBOEnable 1 0 -Disregard128DefaultDrawDistance 1 0 -list NVIDIA_GeForce_Go_6 -RenderVBOEnable 1 0 -Disregard128DefaultDrawDistance 1 0 - -list NVIDIA_GeForce_7000 -RenderShaderLightingMaxLevel 1 2 -list NVIDIA_GeForce_7100 -RenderShaderLightingMaxLevel 1 2 -list NVIDIA_GeForce_7200 -Disregard128DefaultDrawDistance 1 0 -RenderShaderLightingMaxLevel 1 2 -list NVIDIA_GeForce_7300 -Disregard128DefaultDrawDistance 1 0 -RenderShaderLightingMaxLevel 1 2 -list NVIDIA_GeForce_7400 -Disregard128DefaultDrawDistance 1 0 -RenderShaderLightingMaxLevel 1 2 -list NVIDIA_GeForce_7500 -RenderShaderLightingMaxLevel 1 2 -list NVIDIA_GeForce_7600 -RenderShaderLightingMaxLevel 1 2 -list NVIDIA_GeForce_7700 -RenderShaderLightingMaxLevel 1 2 -list NVIDIA_GeForce_7800 -RenderShaderLightingMaxLevel 1 2 -list NVIDIA_GeForce_7900 -RenderShaderLightingMaxLevel 1 2 - -list NVIDIA_GeForce_Go_7200 -Disregard128DefaultDrawDistance 1 0 -RenderShaderLightingMaxLevel 1 2 -list NVIDIA_GeForce_Go_7300 -Disregard128DefaultDrawDistance 1 0 -RenderShaderLightingMaxLevel 1 2 -list NVIDIA_GeForce_Go_7300_LE -RenderShaderLightingMaxLevel 1 2 -list NVIDIA_GeForce_Go_7400 -Disregard128DefaultDrawDistance 1 0 -RenderShaderLightingMaxLevel 1 2 -list NVIDIA_GeForce_Go_7600 -RenderShaderLightingMaxLevel 1 2 -list NVIDIA_GeForce_Go_7700 -RenderShaderLightingMaxLevel 1 2 -list NVIDIA_GeForce_Go_7800 -RenderShaderLightingMaxLevel 1 2 -list NVIDIA_GeForce_Go_7900 -RenderShaderLightingMaxLevel 1 2 +RenderGLContextCoreProfile 1 0 +RenderGLMultiThreadedMedia 1 0 +RenderDownScaleMethod 1 0 + +list AMD +RenderGLMultiThreadedTextures 1 0 + +list NVIDIA +RenderGLMultiThreadedMedia 1 1 + +list GL3 +RenderFSAAType 0 0 +RenderFSAASamples 0 0 +RenderReflectionsEnabled 0 0 +RenderReflectionProbeDetail 0 0 +RenderMirrors 0 0 +RenderGLMultiThreadedTextures 0 0 +RenderGLMultiThreadedMedia 0 0 +RenderDisableVintageMode 1 0 +RenderReflectionProbeCount 0 0 + +list TexUnit16orLess +RenderTerrainPBRDetail 1 -1 + +list VaryingVectors16orLess +RenderTerrainPBRPlanarSampleCount 1 1 diff --git a/indra/newview/featuretable_mac.txt b/indra/newview/featuretable_mac.txt index c3e2dd0c41c..b75df5e3f25 100644 --- a/indra/newview/featuretable_mac.txt +++ b/indra/newview/featuretable_mac.txt @@ -1,4 +1,4 @@ -version 73 +version 74 // The version number above should be incremented IF AND ONLY IF some // change has been made that is sufficiently important to justify // resetting the graphics preferences of all users to the recommended @@ -27,7 +27,7 @@ version 73 // NOTE: All settings are set to the MIN of applied values, including 'all'! // list all -RenderAnisotropic 1 0 +RenderAnisotropicLevel 1 16 RenderAvatarLODFactor 1 1.0 RenderAvatarPhysicsLODFactor 1 1.0 RenderAvatarMaxNonImpostors 1 16 @@ -92,7 +92,7 @@ RenderReflectionProbeCount 1 256 // Low Graphics Settings // list Low -RenderAnisotropic 1 0 +RenderAnisotropicLevel 1 0 RenderAvatarLODFactor 1 0 RenderAvatarPhysicsLODFactor 1 0 RenderAvatarMaxNonImpostors 1 3 @@ -135,7 +135,7 @@ RenderReflectionProbeCount 1 1 // Medium Low Graphics Settings // list LowMid -RenderAnisotropic 1 0 +RenderAnisotropicLevel 1 0 RenderAvatarLODFactor 1 0.5 RenderAvatarMaxComplexity 1 100000 RenderAvatarPhysicsLODFactor 1 0.75 @@ -178,7 +178,7 @@ RenderReflectionProbeCount 1 32 // Medium Graphics Settings (standard) // list Mid -RenderAnisotropic 1 1 +RenderAnisotropicLevel 1 2 RenderAvatarLODFactor 1 1.0 RenderAvatarMaxComplexity 1 200000 RenderAvatarPhysicsLODFactor 1 1.0 @@ -220,7 +220,7 @@ RenderReflectionProbeCount 1 64 // Medium High Graphics Settings // list MidHigh -RenderAnisotropic 1 1 +RenderAnisotropicLevel 1 2 RenderAvatarLODFactor 1 1.0 RenderAvatarMaxComplexity 1 250000 RenderAvatarPhysicsLODFactor 1 1.0 @@ -262,7 +262,7 @@ RenderReflectionProbeCount 1 64 // High Graphics Settings (SSAO + sun shadows) // list High -RenderAnisotropic 1 1 +RenderAnisotropicLevel 1 2 RenderAvatarLODFactor 1 1.0 RenderAvatarMaxComplexity 1 300000 RenderAvatarPhysicsLODFactor 1 1.0 @@ -304,7 +304,7 @@ RenderReflectionProbeCount 1 128 // High Ultra Graphics Settings (SSAO + all shadows) // list HighUltra -RenderAnisotropic 1 1 +RenderAnisotropicLevel 1 2 RenderAvatarLODFactor 1 1.0 RenderAvatarMaxNonImpostors 1 16 RenderAvatarMaxComplexity 1 350000 @@ -346,7 +346,7 @@ RenderReflectionProbeCount 1 256 // Ultra graphics (REALLY PURTY!) // list Ultra -RenderAnisotropic 1 1 +RenderAnisotropicLevel 1 4 RenderAvatarLODFactor 1 1.0 RenderAvatarPhysicsLODFactor 1 1.0 RenderAvatarMaxNonImpostors 1 16 @@ -400,11 +400,18 @@ RenderDisableVintageMode 1 0 list VRAMGT512 RenderCompressTextures 1 0 +// +// +// AF Missing or AF < 2 +// +list AnisotropicMissing +RenderAnisotropicLevel 0 0 + // // "Default" setups for safe, low, medium, high // list safe -RenderAnisotropic 1 0 +RenderAnisotropicLevel 1 0 RenderAvatarMaxNonImpostors 1 16 RenderAvatarMaxComplexity 1 80000 RenderLocalLightCount 1 0 @@ -434,7 +441,7 @@ RenderGLMultiThreadedMedia 1 0 RenderAppleUseMultGL 1 0 list Intel -RenderAnisotropic 1 0 +RenderAnisotropicLevel 1 0 RenderFSAASamples 1 0 RenderGLMultiThreadedTextures 1 0 RenderGLMultiThreadedMedia 1 0 diff --git a/indra/newview/gltf/accessor.cpp b/indra/newview/gltf/accessor.cpp index f0ad3fa5944..900c1da170c 100644 --- a/indra/newview/gltf/accessor.cpp +++ b/indra/newview/gltf/accessor.cpp @@ -213,7 +213,7 @@ bool Buffer::save(Asset& asset, const std::string& folder) bin_file += mUri; - std::ofstream file(bin_file, std::ios::binary); + llofstream file(bin_file, std::ios::binary); if (!file.is_open()) { LL_WARNS("GLTF") << "Failed to open file: " << bin_file << LL_ENDL; diff --git a/indra/newview/gltf/asset.cpp b/indra/newview/gltf/asset.cpp index 28f30ae1c97..187876e3b85 100644 --- a/indra/newview/gltf/asset.cpp +++ b/indra/newview/gltf/asset.cpp @@ -33,10 +33,11 @@ #include "../llviewertexturelist.h" #include "../pipeline.h" #include "buffer_util.h" -#include #include "llimagejpeg.h" #include "../llskinningutil.h" +#include + using namespace LL::GLTF; using namespace boost::json; @@ -928,7 +929,7 @@ bool Asset::save(const std::string& filename) object obj; serialize(obj); std::string buffer = boost::json::serialize(obj, {}); - std::ofstream file(filename, std::ios::binary); + llofstream file(filename, std::ios::binary); file.write(buffer.c_str(), buffer.size()); return true; @@ -961,8 +962,40 @@ LLViewerFetchedTexture* fetch_texture(const LLUUID& id); bool Image::prep(Asset& asset, bool loadIntoVRAM) { mLoadIntoTexturePipe = loadIntoVRAM; + LLUUID id; if (mUri.size() == UUID_STR_SIZE && LLUUID::parseUUID(mUri, &id) && id.notNull()) + { // loaded from an asset, fetch the texture from the asset system + LL_DEBUGS("GLTF") << "Loading image from an id" << id<< LL_ENDL; + } + else if (mUri.find("data:") == 0) + { // embedded in a data URI, load the texture from the URI + LL_WARNS("GLTF") << "Data URIs not yet supported" << LL_ENDL; + return false; + } + + // Image::prepImpl containes code that must run on the main thread + std::promise prep_promise; + std::future prep_future = prep_promise.get_future(); + + LLAppViewer::instance()->postToMainCoro([this, &asset, id, &prep_promise]() mutable { + try { + bool result = prepImpl(asset, id); + prep_promise.set_value(result); + } + catch (...) { + // Propagate exception to the waiting thread + prep_promise.set_exception(std::current_exception()); + } + }); + + // Block until prep is done on the main thread + return prep_future.get(); +} + +bool Image::prepImpl(Asset& asset, const LLUUID& id) +{ + if (id.notNull()) { // loaded from an asset, fetch the texture from the asset system mTexture = fetch_texture(id); } @@ -1090,7 +1123,7 @@ bool Image::save(Asset& asset, const std::string& folder) // set URI to non-j2c file for now, but later we'll want to reference the j2c hash mUri = name + extension; - std::ofstream file(filename, std::ios::binary); + llofstream file(filename, std::ios::binary); file.write((const char*)buffer.mData.data() + bufferView.mByteOffset, bufferView.mByteLength); } else if (mTexture.notNull()) diff --git a/indra/newview/gltf/asset.h b/indra/newview/gltf/asset.h index b9554d753ca..2802664ed37 100644 --- a/indra/newview/gltf/asset.h +++ b/indra/newview/gltf/asset.h @@ -320,6 +320,8 @@ namespace LL void clearData(Asset& asset); bool prep(Asset& asset, bool loadIntoVRAM); + private: + bool prepImpl(Asset& asset, const LLUUID& id); }; // Render Batch -- vertex buffer and list of primitives to render using diff --git a/indra/newview/gltf/llgltfloader.cpp b/indra/newview/gltf/llgltfloader.cpp index 4f8f80129d9..1af98c37306 100644 --- a/indra/newview/gltf/llgltfloader.cpp +++ b/indra/newview/gltf/llgltfloader.cpp @@ -489,7 +489,7 @@ void LLGLTFLoader::processNodeHierarchy(S32 node_idx, std::map } else { - setLoadState(ERROR_MODEL + pModel->getStatus()); + setLoadState(static_cast(ERROR_MODEL) + static_cast(pModel->getStatus())); delete pModel; return; } @@ -602,11 +602,12 @@ LLGLTFLoader::LLGLTFImportMaterial LLGLTFLoader::processMaterial(S32 material_in if (material->mPbrMetallicRoughness.mBaseColorTexture.mIndex >= 0) { S32 texIndex = material->mPbrMetallicRoughness.mBaseColorTexture.mIndex; - std::string filename = processTexture(texIndex, "base_color", material->mName); + std::string full_path; + std::string filename = processTexture(full_path, texIndex, "base_color", material->mName); if (!filename.empty()) { - impMat.mDiffuseMapFilename = filename; + impMat.mDiffuseMapFilename = full_path; impMat.mDiffuseMapLabel = material->mName.empty() ? filename : material->mName; // Check if the texture is already loaded @@ -637,7 +638,7 @@ LLGLTFLoader::LLGLTFImportMaterial LLGLTFLoader::processMaterial(S32 material_in return cachedMat; } -std::string LLGLTFLoader::processTexture(S32 texture_index, const std::string& texture_type, const std::string& material_name) +std::string LLGLTFLoader::processTexture(std::string& full_path_out, S32 texture_index, const std::string& texture_type, const std::string& material_name) { S32 sourceIndex; if (!validateTextureIndex(texture_index, sourceIndex)) @@ -661,6 +662,12 @@ std::string LLGLTFLoader::processTexture(S32 texture_index, const std::string& t { // Uri might be escaped filename = LLURI::unescape(filename); + full_path = dir + gDirUtilp->getDirDelimiter() + filename; + } + + if (gDirUtilp->fileExists(full_path)) + { + full_path_out = full_path; } LL_INFOS("GLTF_IMPORT") << "Found texture: " << filename << " for material: " << material_name << LL_ENDL; @@ -1762,7 +1769,7 @@ std::string LLGLTFLoader::extractTextureToTempFile(S32 textureIndex, const std:: "gltf_embedded_" + texture_type + "_" + std::to_string(sourceIndex) + extension; // Write the image data to the temporary file - std::ofstream temp_file(temp_filename, std::ios::binary); + llofstream temp_file(temp_filename, std::ios::binary); if (temp_file.is_open()) { temp_file.write(reinterpret_cast(data_ptr), data_size); diff --git a/indra/newview/gltf/llgltfloader.h b/indra/newview/gltf/llgltfloader.h index 7aa1a94c201..a847e567a62 100644 --- a/indra/newview/gltf/llgltfloader.h +++ b/indra/newview/gltf/llgltfloader.h @@ -149,7 +149,7 @@ class LLGLTFLoader : public LLModelLoader void processNodeHierarchy(S32 node_idx, std::map& mesh_name_counts, U32 submodel_limit, const LLVolumeParams& volume_params); bool addJointToModelSkin(LLMeshSkinInfo& skin_info, S32 gltf_skin_idx, size_t gltf_joint_idx); LLGLTFImportMaterial processMaterial(S32 material_index, S32 fallback_index); - std::string processTexture(S32 texture_index, const std::string& texture_type, const std::string& material_name); + std::string processTexture(std::string& full_path_out, S32 texture_index, const std::string& texture_type, const std::string& material_name); bool validateTextureIndex(S32 texture_index, S32& source_index); std::string generateMaterialName(S32 material_index, S32 fallback_index = -1); bool populateModelFromMesh(LLModel* pModel, const std::string& base_name, const LL::GLTF::Mesh &mesh, const LL::GLTF::Node &node, material_map& mats); diff --git a/indra/newview/linux_tools/client-readme-joystick.txt b/indra/newview/linux_tools/client-readme-joystick.txt deleted file mode 100644 index 4f89a73ccbe..00000000000 --- a/indra/newview/linux_tools/client-readme-joystick.txt +++ /dev/null @@ -1,78 +0,0 @@ -Second Life - Joystick & SpaceNavigator Support README --=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-= - -WHAT IS IT? --=-=-=-=-=- - -This feature allows the use of a joystick or other supported multi-axis -device for controlling your avatar and camera. - -REQUIREMENTS --=-=-=-=-=-= - -* A joystick or other generic multi-axis input device supported by your chosen - version of Linux - -- OR - - -* A SpaceNavigator device (additional configuration may be required, see below) - -Success has been reported on the following systems so far: -* Ubuntu 7.04 (Feisty) with a generic USB joystick -* Ubuntu 7.04 (Feisty) with a USB 3DConnexion SpaceNavigator -* Ubuntu 6.06 (Dapper) with a generic USB joystick -* Ubuntu 6.06 (Dapper) with a USB 3DConnexion SpaceNavigator - -CONFIGURATION --=-=-=-=-=-=- - -SPACE NAVIGATOR: *Important* - do not install the Linux SpaceNavigator -drivers from the disk included with the device - these are problematic. -Some distributions of Linux (such as Ubuntu, Gentoo and Mandriva) will -need some system configuration to make the SpaceNavigator usable by -applications such as the Second Life Viewer, as follows: - -* Mandriva Linux Configuration: - You need to add two new files to your system. This only needs to be - done once. These files are available at the 'SpaceNavigator support with - udev and Linux input framework' section of - - -* Ubuntu or Gentoo Linux Configuration: - For a quick start, you can simply paste the following line into a terminal - before plugging in your SpaceNavigator - this only needs to be done once: - sudo bash -c 'echo KERNEL==\"event[0-9]*\", SYSFS{idVendor}==\"046d\", SYSFS{idProduct}==\"c626\", SYMLINK+=\"input/spacenavigator\", GROUP=\"plugdev\", MODE=\"664\" > /etc/udev/rules.d/91-spacenavigator-LL.rules ; echo "" > /etc/hal/fdi/policy/3Dconnexion_SpaceNavigator_LL.fdi' - -For more comprehensive Linux SpaceNavigator configuration information please -see the section 'Installing SpaceNavigator without the official driver' here: - - -JOYSTICKS: These should be automatically detected and configured on all -modern distributions of Linux. - -ALL: Your joystick or SpaceNavigator should be plugged-in before you start the -Second Life Viewer, so that it may be detected. If you have multiple input -devices attached, only the first detected SpaceNavigator or joystick device -will be available. - -Once your system recognises your joystick or SpaceNavigator correctly, you -can go into the Second Life Viewer's Preferences dialog, click the 'Input & -Camera' tab, and click the 'Joystick Setup' button. From here you may enable -and disable joystick support and change some configuration settings such as -sensitivity. SpaceNavigator users are recommended to click the -'SpaceNavigator Defaults' button. - -KNOWN PROBLEMS --=-=-=-=-=-=-= - -* If your chosen version of Linux treats your joystick/SpaceNavigator as -if it were a mouse when you plug it in (i.e. it is automatically used to control -your desktop cursor), then the SL Viewer may detect this device *but* will be -unable to use it properly. - -FURTHER PROBLEMS? --=-=-=-=-=-=-=-=- - -Please report further issues to the public Second Life issue-tracker -at (please note, however, that this is not -a support forum). diff --git a/indra/newview/linux_tools/client-readme-voice.txt b/indra/newview/linux_tools/client-readme-voice.txt deleted file mode 100644 index bfefdf3471b..00000000000 --- a/indra/newview/linux_tools/client-readme-voice.txt +++ /dev/null @@ -1,81 +0,0 @@ -Second Life - Linux Voice Support README --=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-= - -WHAT IS IT? --=-=-=-=-=- - -Linux Voice Support is a feature in testing which allows users of the Linux -Second Life client to participate in voice-chat with other residents and -groups inside Second Life, with an appropriate headset/microphone. - -REQUIREMENTS --=-=-=-=-=-= - -* A headset/microphone supported by your chosen version of Linux -* At this time, the PulseAudio audio system is recommended; this software - is already part of most modern (2009+) Linux desktop systems. Alternatively, - the ALSA audio system may be used on systems installed from around - 2007 onwards (again this is likely already installed on your system). - -TESTING YOUR SETTINGS --=-=-=-=-=-=-=-=-=-=- - -* The Second Life region 'Voice Echo Canyon' is a great place for testing -your hardware settings and quality - it will 'echo' your voice back to you -when you speak. - -KNOWN PROBLEMS --=-=-=-=-=-=-= - -* Compatibility with old ALSA-based audio systems (such as Ubuntu Dapper - from 2006) is poor. - -TROUBLESHOOTING --=-=-=-=-=-=-=- - -PROBLEM 1: I don't see a white dot over the head of my avatar or other - Voice-using avatars. -SOLUTION: -a. Ensure that 'Enable voice' is enabled in the 'Sound' section of the - Preferences window, and that you are in a voice-enabled area. -b. If the above does not help, exit Second Life and ensure that any - remaining 'SLVoice' processes (as reported by 'ps', 'top' or similar) - are killed before restarting. - -PROBLEM 2: I have a white dot over my head but I never see (or hear!) anyone - except myself listed in the Active Speakers dialog when I'm sure that other - residents nearby are active Voice users. -SOLUTION: This is an incompatibility between the Voice support and your - system's audio (ALSA) driver version/configuration. -a. Back-up and remove your ~/.asoundrc file, re-test. -b. Check for updates to your kernel, kernel modules and ALSA-related - packages using your Linux distribution's package-manager - install these, - reboot and re-test. -c. Update to the latest version of ALSA manually. For a guide, see the - 'Update to the Latest Version of ALSA' section of this page: - or the official - documentation on the ALSA site: - reboot - and re-test. - -PROBLEM 3: I can hear other people, but they cannot hear me. -SOLUTION: -a. Ensure that you have the 'Speak' button (at the bottom of the Second Life - window) activated while you are trying to speak. -b. Ensure that your microphone jack is inserted into the correct socket of your - sound card, where appropriate. -c. Use your system mixer-setting program (such as the PulseAudio 'volume - control' applet or the ALSA 'alsamixer' program) to ensure that microphone - input is set as the active input source and is not muted. -d. Verify that audio input works in other applications, i.e. Audacity - -PROBLEM 4: Other people just hear bursts of loud noise when I speak. -SOLUTION: -a. Use your system mixer-setting program or the 'alsamixer' program to ensure - that microphone Gain/Boost is not set too high. - -FURTHER PROBLEMS? --=-=-=-=-=-=-=-=- - -Please report further issues to the public Second Life issue-tracker -at (please note, however, that this is not -a support forum). diff --git a/indra/newview/linux_tools/client-readme.txt b/indra/newview/linux_tools/client-readme.txt deleted file mode 100644 index cb8d1af5358..00000000000 --- a/indra/newview/linux_tools/client-readme.txt +++ /dev/null @@ -1,244 +0,0 @@ -Second Life - Linux Beta README --=-=-=-=-=-=-=-=-=-=-=-=-=-=-=- - -This document contains information about the Second Life Linux -client, and isn't meant to serve as an introduction to Second -Life itself - please see . - -1. Introduction -2. System Requirements -3. Installing & Running -4. Known Issues -5. Troubleshooting - 5.1. 'Error creating window.' - 5.2. System hangs - 5.3. Blank window after minimizing it - 5.4. Audio - 5.5. 'Alt' key for camera controls doesn't work - 5.6. In-world streaming movie, music and Flash playback -6. Advanced Troubleshooting - 6.1. Audio - 6.2. OpenGL -7. Obtaining and working with the client source code -8. Getting more help, and reporting problems - - -1. INTRODUCTION --=-=-=-=-=-=-=- - -Hi! This is a BETA release of the Second Life client for Linux. -The 'beta' status means that although we're still smoothing-out a few rough -edges, this version of the client is functionally complete and should -work quite well 'out of the box' for accessing Second Life. - -We encourage you to try it out and let us know of its compatibility -with your system. Be aware that although this is a 'beta' client, it connects -to the main Second Life world and changes you make there are permanent. - -You will have either obtained this client from secondlife.com (the official -site) or from a third-party packager; if you encounter any problems then -we recommend trying the latest official builds from secondlife.com which are -updated often. - -Please enjoy! - - -2. SYSTEM REQUIREMENTS --=-=-=-=-=-=-=-=-=-=-= - -Minimum requirements: - * Internet Connection: Cable or DSL - * Computer Processor: 800MHz Pentium III or Athlon or better - (recommended: 1.5GHz or more) - * Computer Memory: 512MB (recommended: 768MB or more) - * Linux Operating System: A reasonably modern 32-bit Linux environment - is required. If you are running a 64-bit Linux distribution then - you will need its 32-bit compatibility environment installed, but - this configuration is not currently supported. - * PulseAudio or ALSA Linux system sound software. A recent PulseAudio - is the recommended configuration; see README-linux-voice.txt for more - information. - * Video/Graphics Card: - o nVidia GeForce 2, GeForce 4mx, or better (recommend one of the - following: 6700, 6800, 7600, 7800, 7900, 8400, 8500, 8600, - 8800, Go 7400, Go 7600, Go 7800, Go 7900, +) - o OR ATI Radeon 8500, 9250, or better - (nVidia cards are recommended for the Linux client) - - **NOTE**: Second Life absolutely requires you to have recent, correctly- - configured OpenGL 3D drivers for your hardware - the graphics drivers - that came with your operating system may not be good enough! See the - TROUBLESHOOTING section if you encounter problems starting Second Life. - -For a more comfortable experience, the RECOMMENDED hardware for the Second -Life Linux client is very similar to that for Windows, as detailed at: - - - -3. INSTALLING & RUNNING --=-=-=-=-=-=-=-=-=-=-=- - -The Second Life Linux client can entirely run from the directory you have -unpacked it into - no installation step is required. If you wish to -perform a separate installation step anyway, you may run './install.sh' - -Run ./secondlife from the installation directory to start Second Life. - -For in-world MOVIE and MUSIC PLAYBACK, you will need (32-bit) GStreamer 0.10 -installed on your system. This is optional - it is not required for general -client functionality. If you have GStreamer 0.10 installed, the selection of -in-world movies you can successfully play will depend on the GStreamer -plugins you have; if you cannot play a certain in-world movie then you are -probably missing the appropriate GStreamer plugin on your system - you may -be able to install it (see TROUBLESHOOTING). - -User data is stored in the hidden directory ~/.secondlife by default; you may -override this location with the SECONDLIFE_USER_DIR environment variable if -you wish. - - -4. KNOWN ISSUES --=-=-=-=-=-=-=- - -* No significant known issues at this time. - - -5. TROUBLESHOOTING --=-=-=-=-=-=-=-=-= - -The client prints a lot of diagnostic information to the console it was -run from. Most of this is also replicated in ~/.secondlife/logs/SecondLife.log -- this is helpful to read when troubleshooting, especially 'WARNING' and -'ERROR' lines. - -VOICE PROBLEMS? See the separate README-linux-voice.txt file for Voice - troubleshooting information. - -SPACENAVIGATOR OR JOYSTICK PROBLEMS? See the separate - README-linux-joystick.txt file for configuration information. - -PROBLEM 1:- Second Life fails to start up, with a warning on the console like: - 'Error creating window.' or - 'Unable to create window, be sure screen is set at 32-bit color' or - 'SDL: Couldn't find matching GLX visual.' -SOLUTION:- Usually this indicates that your graphics card does not meet - the minimum requirements, or that your system's OpenGL 3D graphics driver is - not updated and configured correctly. If you believe that your graphics - card DOES meet the minimum requirements then you likely need to install the - official so-called 'non-free' nVidia or ATI (fglrx) graphics drivers; we - suggest one of the following options: - * Consult your Linux distribution's documentation for installing these - official drivers. For example, Ubuntu provides documentation here: - - * If your distribution does not make it easy, then you can download the - required Linux drivers straight from your graphics card manufacturer: - - nVidia cards: - - ATI cards: - -PROBLEM 2:- My whole system seems to hang when running Second Life. -SOLUTION:- This is typically a hardware/driver issue. The first thing to - do is to check that you have the most recent official drivers for your - graphics card (see PROBLEM 1). -SOLUTION:- Some residents with ATI cards have reported that running - 'sudo aticonfig --locked-userpages=off' before running Second Life solves - their stability issues. -SOLUTION:- As a last resort, you can disable most of Second Life's advanced - graphics features by editing the 'secondlife' script and removing the '#' - from the line which reads '#export LL_GL_NOEXT=x' - -PROBLEM 3:- After I minimize the Second Life window, it's just blank when - it comes back. -SOLUTION:- Some Linux desktop 'Visual Effects' features are incompatible - with Second Life. One reported solution is to use your desktop - configuration program to disable such effects. For example, on Ubuntu 7.10, - use the desktop toolbar menu to select System -> Preferences -> Appearance, - then change 'Visual Effects' to 'None'. - -PROBLEM 4:- Music and sound effects are silent or very stuttery. -SOLUTION:- The most common solution is to ensure that you have the 'esd' - program (part of the 'esound' package) installed and running before you - start Second Life. Users of Ubuntu (and some other) Linux systems can - simply run the following to install and configure 'esound': - sudo apt-get install esound - For others, simply running 'esd&' from a command-line should get it running. - -PROBLEM 5:- Using the 'Alt' key to control the camera doesn't work or just - moves the Second Life window. -SOLUTION:- Some window managers eat the Alt key for their own purposes; you - can configure your window manager to use a different key instead (for - example, the 'Windows' key!) which will allow the Alt key to function - properly with mouse actions in Second Life and other applications. - -PROBLEM 6:- In-world movie, music, or Flash playback doesn't work for me. -SOLUTION:- You need to have a working installation of GStreamer 0.10; this - is usually an optional package for most versions of Linux. If you have - installed GStreamer 0.10 and you can play some music/movies but not others - then you need to install a wider selection of GStreamer plugins, either - from your vendor (i.e. the 'Ugly' plugins) or an appropriate third party. - For Flash playback, you need to have Flash 10 installed for your normal - web browser (for example, Firefox). PulseAudio is required for Flash - volume control / muting to fully function inside Second Life. - - -6. ADVANCED TROUBLESHOOTING --=-=-=-=-=-=-=-=-=-=-=-=-=- - -The 'secondlife' script which launches Second Life contains some -configuration options for advanced troubleshooters. - -* AUDIO - Edit the 'secondlife' script and you will see these audio - options: LL_BAD_OPENAL_DRIVER, LL_BAD_FMODSTUDIO_DRIVER. - Second Life tries to use OpenAL, FMODSTUDIO (PULSEAUDIO, ALSA) - audio drivers in this order; you may uncomment the corresponding LL_BAD_* - option to skip an audio driver which you believe may be causing you trouble. - -* OPENGL - For advanced troubleshooters, the LL_GL_BLACKLIST option lets - you disable specific GL extensions, each of which is represented by a - letter ("a"-"o"). If you can narrow down a stability problem on your system - to just one or two GL extensions then please post details of your hardware - (and drivers) to the Linux Client Testers forum (see link below) along - with the minimal LL_GL_BLACKLIST which solves your problems. This will help - us to improve stability for your hardware while minimally impacting - performance. - LL_GL_BASICEXT and LL_GL_NOEXT should be commented-out for this to be useful. - - -7. OBTAINING AND WORKING WITH THE CLIENT SOURCE CODE --=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-= - -We're pleased to have released the Second Life client's source code under -an Open Source license compatible with the 'GPL'. To get involved with client -development, please see: - - - -8. GETTING MORE HELP AND REPORTING PROBLEMS --=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=- - -For general help and support with Second Life: - - -For problems and discussion concerning unofficial (not secondlife.com) -releases, please contact your packager or the SLDev mailing list: - - -In-world help: Please use the 'Help' menu in the client for various -non-Linux-specific Second Life help options. - -In-world discussion: There is a 'Linux Client Users' group -inside Second Life which is free to join. You can find it by pressing -the 'Search' button at the bottom of the window and then selecting the -'Groups' tab and searching for 'Linux'. This group is useful for discussing -Linux issues with fellow Linux client users who are online. - -The Second Life Issue Tracker: - -This is the right place for finding known issues and reporting new -bugs in all Second Life releases if you find that the Troubleshooting -section in this file hasn't helped (please note, however, that this is -not a support forum). - -Linux Client Testers forum: - -This is a forum where Linux Client users can help each other out and -discuss the latest updates. diff --git a/indra/newview/linux_tools/launch_url.sh b/indra/newview/linux_tools/launch_url.sh deleted file mode 100755 index 404ea36f260..00000000000 --- a/indra/newview/linux_tools/launch_url.sh +++ /dev/null @@ -1,86 +0,0 @@ -#!/bin/bash - -# This script loads a web page in the 'default' graphical web browser. -# It MUST return immediately (or soon), so the browser should be -# launched in the background (thus no text-only browsers). -# This script does not trust the URL to be well-escaped or shell-safe. -# -# On Unixoids we try, in order of decreasing priority: -# - $BROWSER if set (preferred) -# - Default GNOME browser -# - Default KDE browser -# - x-www-browser -# - The first browser in $BROWSER_COMMANDS that is found. - -URL="$1" - -if [ -z "$URL" ]; then - echo "Usage: $(basename "$0") URL" - exit -fi - -# restore LD_LIBRARY_PATH from SAVED_LD_LIBRARY_PATH if it exists -if [ "${SAVED_LD_LIBRARY_PATH+isset}" = "isset" ]; then - export LD_LIBRARY_PATH="${SAVED_LD_LIBRARY_PATH}" - echo "$0: Restored library path to '${SAVED_LD_LIBRARY_PATH}'" -fi - -# if $BROWSER is defined, use it. -XBROWSER=`echo "$BROWSER" |cut -f1 -d:` -if [ ! -z "$XBROWSER" ]; then - XBROWSER_CMD=`echo "$XBROWSER" |cut -f1 -d' '` - # look for $XBROWSER_CMD either literally or in PATH - if [ -x "$XBROWSER_CMD" ] || which $XBROWSER_CMD >/dev/null; then - # check for %s string, avoiding bash2-ism of [[ ]] - if echo "$XBROWSER" | grep %s >/dev/null; then - # $XBROWSER has %s which needs substituting - echo "$URL" | xargs -r -i%s $XBROWSER & - exit - fi - # $XBROWSER has no %s, tack URL on the end instead - $XBROWSER "$URL" & - exit - fi - echo "$0: Couldn't find the browser specified by \$BROWSER ($BROWSER)" - echo "$0: Trying some others..." -fi - -# Launcher the default GNOME browser. -if [ ! -z "$GNOME_DESKTOP_SESSION_ID" ] && which gnome-open >/dev/null; then - gnome-open "$URL" & - exit -fi - -# Launch the default KDE browser. -if [ ! -z "$KDE_FULL_SESSION" ] && which kfmclient >/dev/null; then - kfmclient openURL "$URL" & - exit -fi - -# List of browser commands that will be tried in the order listed. x-www-browser -# will be tried first, which is a debian alternative. -BROWSER_COMMANDS=" \ - x-www-browser \ - firefox \ - mozilla-firefox \ - iceweasel \ - iceape \ - opera \ - epiphany-browser \ - epiphany-gecko \ - epiphany-webkit \ - epiphany \ - mozilla \ - seamonkey \ - galeon \ - dillo \ - netscape" -for browser_cmd in $BROWSER_COMMANDS; do - if which $browser_cmd >/dev/null; then - $browser_cmd "$URL" & - exit - fi -done - -echo '$0: Failed to find a known browser. Please consider setting the $BROWSER environment variable.' -exit 1 diff --git a/indra/newview/linux_tools/refresh_desktop_app_entry.sh b/indra/newview/linux_tools/refresh_desktop_app_entry.sh index d2b2a732d54..84af7505eab 100755 --- a/indra/newview/linux_tools/refresh_desktop_app_entry.sh +++ b/indra/newview/linux_tools/refresh_desktop_app_entry.sh @@ -3,7 +3,7 @@ SCRIPTSRC=`readlink -f "$0" || echo "$0"` RUN_PATH=`dirname "${SCRIPTSRC}" || echo .` -install_prefix=${RUN_PATH}/.. +install_prefix="$(realpath -- "${RUN_PATH}/..")" function install_desktop_entry() { @@ -13,18 +13,25 @@ function install_desktop_entry() local desktop_entry="\ [Desktop Entry]\n\ Name=Second Life\n\ +GenericName=Second Life Viewer\n\ Comment=Client for the On-line Virtual World, Second Life\n\ +Path=${installation_prefix}\n\ Exec=${installation_prefix}/secondlife\n\ Icon=${installation_prefix}/secondlife_icon.png\n\ Terminal=false\n\ Type=Application\n\ -Categories=Application;Network;\n\ +Categories=Game;Simulation;\n\ StartupNotify=true\n\ +StartupWMClass="com.secondlife.indra.viewer"\n\ X-Desktop-File-Install-Version=3.0" echo " - Installing menu entries in ${desktop_entries_dir}" - mkdir -vp "${desktop_entries_dir}" - echo -e $desktop_entry > "${desktop_entries_dir}/secondlife-viewer.desktop" || "Failed to install application menu!" + WORK_DIR=`mktemp -d` + echo -e $desktop_entry > "${WORK_DIR}/secondlife-viewer.desktop" || "Failed to install application menu!" + desktop-file-install --dir="${desktop_entries_dir}" ${WORK_DIR}/secondlife-viewer.desktop + rm -r $WORK_DIR + + update-desktop-database "${desktop_entries_dir}" } if [ "$UID" == "0" ]; then diff --git a/indra/newview/linux_tools/register_secondlifeprotocol.sh b/indra/newview/linux_tools/register_secondlifeprotocol.sh index 33c34d7a761..d41e6dd6cbb 100755 --- a/indra/newview/linux_tools/register_secondlifeprotocol.sh +++ b/indra/newview/linux_tools/register_secondlifeprotocol.sh @@ -6,43 +6,52 @@ HANDLER="$1" -RUN_PATH=`dirname "$0" || echo .` +SCRIPTSRC=`readlink -f "$0" || echo "$0"` +RUN_PATH=`dirname "${SCRIPTSRC}" || echo .` + +install_prefix="$(realpath -- "${RUN_PATH}/..")" + cd "${RUN_PATH}/.." if [ -z "$HANDLER" ]; then - HANDLER=`pwd`/etc/handle_secondlifeprotocol.sh + HANDLER=$install_prefix/etc/handle_secondlifeprotocol.sh fi -# Register handler for GNOME-aware apps -LLGCONFTOOL2=gconftool-2 -if which ${LLGCONFTOOL2} >/dev/null; then - (${LLGCONFTOOL2} -s -t string /desktop/gnome/url-handlers/secondlife/command "${HANDLER} \"%s\"" && ${LLGCONFTOOL2} -s -t bool /desktop/gnome/url-handlers/secondlife/enabled true) || echo Warning: Did not register secondlife:// handler with GNOME: ${LLGCONFTOOL2} failed. -else - echo Warning: Did not register secondlife:// handler with GNOME: ${LLGCONFTOOL2} not found. -fi +function install_desktop_entry() +{ + local installation_prefix="$1" + local desktop_entries_dir="$2" + + local desktop_entry="\ +[Desktop Entry]\n\ +Name=Second Life SLURL handler\n\ +Path=${installation_prefix}\n\ +Exec=${HANDLER} %u\n\ +Icon=${installation_prefix}/secondlife_icon.png\n\ +Terminal=false\n\ +Type=Application\n\ +StartupNotify=true\n\ +StartupWMClass="com.secondlife.indra.viewer"\n\ +NoDisplay=true\n\ +MimeType=x-scheme-handler/secondlife\n\ +X-Desktop-File-Install-Version=3.0" -# Register handler for KDE-aware apps -for LLKDECONFIG in kde-config kde4-config; do - if [ `which $LLKDECONFIG` ]; then - LLKDEPROTODIR=`$LLKDECONFIG --path services | cut -d ':' -f 1` - if [ -d "$LLKDEPROTODIR" ]; then - LLKDEPROTOFILE=${LLKDEPROTODIR}/secondlife.protocol - cat > ${LLKDEPROTOFILE} < "${WORK_DIR}/${PROTOCOL_HANDLER}" || "Failed to create desktop file!" + desktop-file-install --dir="${desktop_entries_dir}" "${WORK_DIR}/${PROTOCOL_HANDLER}" || "Failed to install desktop file!" + rm -r $WORK_DIR + xdg-mime default "${desktop_entries_dir}/${PROTOCOL_HANDLER}" x-scheme-handler/secondlife + + update-desktop-database "${desktop_entries_dir}" +} + +if [ "$UID" == "0" ]; then + # system-wide + install_desktop_entry "$install_prefix" /usr/local/share/applications +else + # user-specific + install_desktop_entry "$install_prefix" "$HOME/.local/share/applications" +fi diff --git a/indra/newview/linux_tools/wrapper.sh b/indra/newview/linux_tools/wrapper.sh index eb3ead433b7..7e7a9a5e49c 100755 --- a/indra/newview/linux_tools/wrapper.sh +++ b/indra/newview/linux_tools/wrapper.sh @@ -1,48 +1,12 @@ #!/bin/bash -## Here are some configuration options for Linux Client Testers. -## These options are for self-assisted troubleshooting during this beta -## testing phase; you should not usually need to touch them. +## Here are some configuration options for Linux Client Users. -## - Avoids using any FMOD STUDIO audio driver. -#export LL_BAD_FMODSTUDIO_DRIVER=x ## - Avoids using any OpenAL audio driver. #export LL_BAD_OPENAL_DRIVER=x -## - Avoids using the FMOD Studio or FMOD Ex PulseAudio audio driver. -#export LL_BAD_FMOD_PULSEAUDIO=x -## - Avoids using the FMOD Studio or FMOD Ex ALSA audio driver. -#export LL_BAD_FMOD_ALSA=x - -## - Avoids the optional OpenGL extensions which have proven most problematic -## on some hardware. Disabling this option may cause BETTER PERFORMANCE but -## may also cause CRASHES and hangs on some unstable combinations of drivers -## and hardware. -## NOTE: This is now disabled by default. -#export LL_GL_BASICEXT=x - -## - Avoids *all* optional OpenGL extensions. This is the safest and least- -## exciting option. Enable this if you experience stability issues, and -## report whether it helps in the Linux Client Testers forum. -#export LL_GL_NOEXT=x - -## - For advanced troubleshooters, this lets you disable specific GL -## extensions, each of which is represented by a letter a-o. If you can -## narrow down a stability problem on your system to just one or two -## extensions then please post details of your hardware (and drivers) to -## the Linux Client Testers forum along with the minimal -## LL_GL_BLACKLIST which solves your problems. -#export LL_GL_BLACKLIST=abcdefghijklmno - -## - Some ATI/Radeon users report random X server crashes when the mouse -## cursor changes shape. If you suspect that you are a victim of this -## driver bug, try enabling this option and report whether it helps: -#export LL_ATI_MOUSE_CURSOR_BUG=x - -if [ "`uname -m`" = "x86_64" ]; then - echo '64-bit Linux detected.' -fi - +## GL Driver Options +export mesa_glthread=true ## Everything below this line is just for advanced troubleshooters. ##------------------------------------------------------------------- @@ -54,32 +18,8 @@ fi ## an unstripped binary before you run. #export LL_WRAPPER='gdb --args' #export LL_WRAPPER='valgrind --smc-check=all --error-limit=no --log-file=secondlife.vg --leak-check=full --suppressions=/usr/lib/valgrind/glibc-2.5.supp --suppressions=secondlife-i686.supp' - -## - Avoids an often-buggy X feature that doesn't really benefit us anyway. -export SDL_VIDEO_X11_DGAMOUSE=0 - -## - Works around a problem with misconfigured 64-bit systems not finding GL -I386_MULTIARCH="$(dpkg-architecture -ai386 -qDEB_HOST_MULTIARCH 2>/dev/null)" -MULTIARCH_ERR=$? -if [ $MULTIARCH_ERR -eq 0 ]; then - echo 'Multi-arch support detected.' - MULTIARCH_GL_DRIVERS="/usr/lib/${I386_MULTIARCH}/dri" - export LIBGL_DRIVERS_PATH="${LIBGL_DRIVERS_PATH}:${MULTIARCH_GL_DRIVERS}:/usr/lib64/dri:/usr/lib32/dri:/usr/lib/dri" -else - export LIBGL_DRIVERS_PATH="${LIBGL_DRIVERS_PATH}:/usr/lib64/dri:/usr/lib32/dri:/usr/lib/dri" -fi - -## - The 'scim' GTK IM module widely crashes the viewer. Avoid it. -if [ "$GTK_IM_MODULE" = "scim" ]; then - export GTK_IM_MODULE=xim -fi - -## - Automatically work around the ATI mouse cursor crash bug: -## (this workaround is disabled as most fglrx users do not see the bug) -#if lsmod | grep fglrx &>/dev/null ; then -# export LL_ATI_MOUSE_CURSOR_BUG=x -#fi - +#export ASAN_OPTIONS="halt_on_error=0 detect_leaks=1 symbolize=1" +#export UBSAN_OPTIONS="print_stacktrace=1 print_summary=1 halt_on_error=0" ## Nothing worth editing below this line. ##------------------------------------------------------------------- @@ -99,24 +39,7 @@ cd "${RUN_PATH}" ## subprocesses that care. export SAVED_LD_LIBRARY_PATH="${LD_LIBRARY_PATH}" -# if [ -n "$LL_TCMALLOC" ]; then -# tcmalloc_libs='/usr/lib/libtcmalloc.so.0 /usr/lib/libstacktrace.so.0 /lib/libpthread.so.0' -# all=1 -# for f in $tcmalloc_libs; do -# if [ ! -f $f ]; then -# all=0 -# fi -# done -# if [ $all != 1 ]; then -# echo 'Cannot use tcmalloc libraries: components missing' 1>&2 -# else -# export LD_PRELOAD=$(echo $tcmalloc_libs | tr ' ' :) -# if [ -z "$HEAPCHECK" -a -z "$HEAPPROFILE" ]; then -# export HEAPCHECK=${HEAPCHECK:-normal} -# fi -# fi -#fi - +# Add our library directory export LD_LIBRARY_PATH="$PWD/lib:${LD_LIBRARY_PATH}" # Copy "$@" to ARGS array specifically to delete the --skip-gridargs switch. @@ -140,23 +63,4 @@ LL_RUN_ERR=$? if [ $LL_RUN_ERR -ne 0 ]; then # generic error running the binary echo '*** Bad shutdown ($LL_RUN_ERR). ***' - if [ "$(uname -m)" = "x86_64" ]; then - echo - cat << EOFMARKER -You are running the Second Life Viewer on a x86_64 platform. The -most common problems when launching the Viewer (particularly -'bin/do-not-directly-run-secondlife-bin: not found' and 'error while -loading shared libraries') may be solved by installing your Linux -distribution's 32-bit compatibility packages. -For example, on Ubuntu and other Debian-based Linuxes you might run: -$ sudo apt-get install ia32-libs ia32-libs-gtk ia32-libs-kde ia32-libs-sdl -EOFMARKER - fi fi - -echo -echo '*******************************************************' -echo 'This is a BETA release of the Second Life linux client.' -echo 'Thank you for testing!' -echo 'Please see README-linux.txt before reporting problems.' -echo diff --git a/indra/newview/llaccountingcostmanager.cpp b/indra/newview/llaccountingcostmanager.cpp index 54d8ceb85a9..b30fe16c58e 100644 --- a/indra/newview/llaccountingcostmanager.cpp +++ b/indra/newview/llaccountingcostmanager.cpp @@ -53,8 +53,8 @@ void LLAccountingCostManager::accountingCostCoro(std::string url, LLCore::HttpRequest::policy_t httpPolicy(LLCore::HttpRequest::DEFAULT_POLICY_ID); LLCoreHttpUtil::HttpCoroutineAdapter::ptr_t - httpAdapter(new LLCoreHttpUtil::HttpCoroutineAdapter("AccountingCost", httpPolicy)); - LLCore::HttpRequest::ptr_t httpRequest(new LLCore::HttpRequest); + httpAdapter = std::make_shared("accountingCostCoro", httpPolicy); + LLCore::HttpRequest::ptr_t httpRequest = std::make_shared(); try { diff --git a/indra/newview/llagent.cpp b/indra/newview/llagent.cpp index e95d192f726..0d7ad0a1246 100644 --- a/indra/newview/llagent.cpp +++ b/indra/newview/llagent.cpp @@ -437,8 +437,8 @@ LLAgent::LLAgent() : mAutoPilotTargetDist(0.f), mAutoPilotNoProgressFrameCount(0), mAutoPilotRotationThreshold(0.f), - mAutoPilotFinishedCallback(NULL), - mAutoPilotCallbackData(NULL), + mAutoPilotFinishedCallback(nullptr), + mAutoPilotCallbackData(nullptr), mMovementKeysLocked(false), @@ -455,8 +455,8 @@ LLAgent::LLAgent() : mVoiceConnected(false), - mMouselookModeInSignal(NULL), - mMouselookModeOutSignal(NULL) + mMouselookModeInSignal(nullptr), + mMouselookModeOutSignal(nullptr) { for (U32 i = 0; i < TOTAL_CONTROLS; i++) { @@ -464,7 +464,7 @@ LLAgent::LLAgent() : mControlsTakenPassedOnCount[i] = 0; } - mListener.reset(new LLAgentListener(*this)); + mListener = std::make_shared(*this); addParcelChangedCallback(&setCanEditParcel); @@ -4700,9 +4700,9 @@ void LLAgent::requestAgentUserInfoCoro(std::string capurl) { LLCore::HttpRequest::policy_t httpPolicy(LLCore::HttpRequest::DEFAULT_POLICY_ID); LLCoreHttpUtil::HttpCoroutineAdapter::ptr_t - httpAdapter(new LLCoreHttpUtil::HttpCoroutineAdapter("requestAgentUserInfoCoro", httpPolicy)); - LLCore::HttpRequest::ptr_t httpRequest(new LLCore::HttpRequest); - LLCore::HttpOptions::ptr_t httpOpts(new LLCore::HttpOptions); + httpAdapter = std::make_shared("requestAgentUserInfoCoro", httpPolicy); + LLCore::HttpRequest::ptr_t httpRequest = std::make_shared(); + LLCore::HttpOptions::ptr_t httpOpts = std::make_shared(); LLCore::HttpHeaders::ptr_t httpHeaders; httpOpts->setFollowRedirects(true); @@ -4760,9 +4760,9 @@ void LLAgent::updateAgentUserInfoCoro(std::string capurl, std::string directory_ { LLCore::HttpRequest::policy_t httpPolicy(LLCore::HttpRequest::DEFAULT_POLICY_ID); LLCoreHttpUtil::HttpCoroutineAdapter::ptr_t - httpAdapter(new LLCoreHttpUtil::HttpCoroutineAdapter("requestAgentUserInfoCoro", httpPolicy)); - LLCore::HttpRequest::ptr_t httpRequest(new LLCore::HttpRequest); - LLCore::HttpOptions::ptr_t httpOpts(new LLCore::HttpOptions); + httpAdapter = std::make_shared("requestAgentUserInfoCoro", httpPolicy); + LLCore::HttpRequest::ptr_t httpRequest = std::make_shared(); + LLCore::HttpOptions::ptr_t httpOpts = std::make_shared(); LLCore::HttpHeaders::ptr_t httpHeaders; httpOpts->setFollowRedirects(true); diff --git a/indra/newview/llagent.h b/indra/newview/llagent.h index c1d3c6c14b2..3352890d999 100644 --- a/indra/newview/llagent.h +++ b/indra/newview/llagent.h @@ -39,9 +39,10 @@ #include "httprequest.h" #include "llcorehttputil.h" -#include #include +#include + extern const bool ANIMATE; extern const U8 AGENT_STATE_TYPING; // Typing indication extern const U8 AGENT_STATE_EDITING; // Set when agent has objects selected @@ -254,7 +255,7 @@ class LLAgent : public LLOldEvents::LLObservable void changeParcels(); // called by LLViewerParcelMgr when we cross a parcel boundary // Register a boost callback to be called when the agent changes parcels - typedef boost::function parcel_changed_callback_t; + typedef std::function parcel_changed_callback_t; boost::signals2::connection addParcelChangedCallback(parcel_changed_callback_t); private: @@ -756,7 +757,7 @@ class LLAgent : public LLOldEvents::LLObservable void requestEnterGodMode(); void requestLeaveGodMode(); - typedef boost::function god_level_change_callback_t; + typedef std::function god_level_change_callback_t; typedef boost::signals2::signal god_level_change_signal_t; typedef boost::signals2::connection god_level_change_slot_t; @@ -964,8 +965,8 @@ class LLAgent : public LLOldEvents::LLObservable /// Utilities for allowing the the agent sub managers to post and get via /// HTTP using the agent's policy settings and headers. - bool requestPostCapability(const std::string &capName, LLSD &postData, httpCallback_t cbSuccess = NULL, httpCallback_t cbFailure = NULL); - bool requestGetCapability(const std::string &capName, httpCallback_t cbSuccess = NULL, httpCallback_t cbFailure = NULL); + bool requestPostCapability(const std::string &capName, LLSD &postData, httpCallback_t cbSuccess = nullptr, httpCallback_t cbFailure = nullptr); + bool requestGetCapability(const std::string& capName, httpCallback_t cbSuccess = nullptr, httpCallback_t cbFailure = nullptr); LLCore::HttpRequest::policy_t getAgentPolicy() const { return mHttpPolicy; } diff --git a/indra/newview/llagentpicksinfo.cpp b/indra/newview/llagentpicksinfo.cpp index 265e4060ff9..4a5c037f1f5 100644 --- a/indra/newview/llagentpicksinfo.cpp +++ b/indra/newview/llagentpicksinfo.cpp @@ -53,7 +53,7 @@ class LLAgentPicksInfo::LLAgentPicksObserver : public LLAvatarPropertiesObserver LLAvatarPropertiesProcessor::getInstance()->sendAvatarPropertiesRequest(gAgent.getID()); } - typedef boost::function server_respond_callback_t; + typedef std::function server_respond_callback_t; void setServerRespondCallback(const server_respond_callback_t& cb) { diff --git a/indra/newview/llagentwearables.h b/indra/newview/llagentwearables.h index 1e118ffa98a..70da86805cb 100644 --- a/indra/newview/llagentwearables.h +++ b/indra/newview/llagentwearables.h @@ -189,11 +189,11 @@ class LLAgentWearables : public LLInitClass, public LLWearable // Signals //-------------------------------------------------------------------- public: - typedef boost::function loading_started_callback_t; + typedef std::function loading_started_callback_t; typedef boost::signals2::signal loading_started_signal_t; boost::signals2::connection addLoadingStartedCallback(loading_started_callback_t cb); - typedef boost::function loaded_callback_t; + typedef std::function loaded_callback_t; typedef boost::signals2::signal loaded_signal_t; boost::signals2::connection addLoadedCallback(loaded_callback_t cb); diff --git a/indra/newview/llaisapi.cpp b/indra/newview/llaisapi.cpp index 5114ac8a081..1da1647fe83 100644 --- a/indra/newview/llaisapi.cpp +++ b/indra/newview/llaisapi.cpp @@ -861,8 +861,8 @@ void AISAPI::InvokeAISCommandCoro(LLCoreHttpUtil::HttpCoroutineAdapter::ptr_t ht return; } - LLCore::HttpOptions::ptr_t httpOptions(new LLCore::HttpOptions); - LLCore::HttpRequest::ptr_t httpRequest(new LLCore::HttpRequest()); + LLCore::HttpOptions::ptr_t httpOptions = std::make_shared(); + LLCore::HttpRequest::ptr_t httpRequest = std::make_shared(); LLCore::HttpHeaders::ptr_t httpHeaders; httpOptions->setTimeout(HTTP_TIMEOUT); @@ -950,7 +950,7 @@ void AISAPI::InvokeAISCommandCoro(LLCoreHttpUtil::HttpCoroutineAdapter::ptr_t ht LL_DEBUGS("Inventory", "AIS3") << "Result: " << result << LL_ENDL; onUpdateReceived(result, type, body); - if (callback && !callback.empty()) + if (callback != nullptr) { bool needs_callback = true; LLUUID id(LLUUID::null); diff --git a/indra/newview/llaisapi.h b/indra/newview/llaisapi.h index dd490c82683..cfc286da2e8 100644 --- a/indra/newview/llaisapi.h +++ b/indra/newview/llaisapi.h @@ -44,7 +44,7 @@ class AISAPI LIBRARY } ITEM_TYPE; - typedef boost::function completion_t; + typedef std::function completion_t; static bool isAvailable(); static void getCapNames(LLSD& capNames); @@ -89,7 +89,7 @@ class AISAPI static const std::string INVENTORY_CAP_NAME; static const std::string LIBRARY_CAP_NAME; - typedef boost::function < LLSD (LLCoreHttpUtil::HttpCoroutineAdapter::ptr_t, LLCore::HttpRequest::ptr_t, + typedef std::function invokationFn_t; static void EnqueueAISCommand(const std::string &procName, LLCoprocedureManager::CoProcedure_t proc); diff --git a/indra/newview/llappcorehttp.cpp b/indra/newview/llappcorehttp.cpp index f4f19906f13..f3265afebd0 100644 --- a/indra/newview/llappcorehttp.cpp +++ b/indra/newview/llappcorehttp.cpp @@ -145,8 +145,8 @@ LLAppCoreHttp::~LLAppCoreHttp() void LLAppCoreHttp::init() { LLCoreHttpUtil::setPropertyMethods( - boost::bind(&LLControlGroup::getBOOL, boost::ref(gSavedSettings), _1), - boost::bind(&LLControlGroup::declareBOOL, boost::ref(gSavedSettings), _1, _2, _3, LLControlVariable::PERSIST_NONDFT)); + std::bind(&LLControlGroup::getBOOL, std::ref(gSavedSettings), std::placeholders::_1), + std::bind(&LLControlGroup::declareBOOL, std::ref(gSavedSettings), std::placeholders::_1, std::placeholders::_2, std::placeholders::_3, LLControlVariable::PERSIST_NONDFT)); LLCore::LLHttp::initialize(); diff --git a/indra/newview/llappdelegate-objc.mm b/indra/newview/llappdelegate-objc.mm index af18dca1854..409671d9390 100644 --- a/indra/newview/llappdelegate-objc.mm +++ b/indra/newview/llappdelegate-objc.mm @@ -28,15 +28,19 @@ #if defined(LL_BUGSPLAT) #include #include -@import BugsplatMac; +@import CrashReporter; +@import HockeySDK; +@import BugSplatMac; // derived from BugsplatMac's BugsplatTester/AppDelegate.m -@interface LLAppDelegate () +@interface LLAppDelegate () @end #endif #include "llwindowmacosx-objc.h" #include "llappviewermacosx-for-objc.h" #include // Used for Text Input Services ("Safe" API - it's supported) +#include "llversioninfovars.h" + @implementation LLAppDelegate @synthesize window; @@ -68,13 +72,22 @@ - (void) applicationDidFinishLaunching:(NSNotification *)notification #if defined(LL_BUGSPLAT) infos("bugsplat setup"); - // Engage BugsplatStartupManager *before* calling initViewer() to handle + // Engage BugSplat *before* calling initViewer() to handle // any crashes during initialization. // https://www.bugsplat.com/docs/platforms/os-x#initialization - [BugsplatStartupManager sharedManager].autoSubmitCrashReport = YES; - [BugsplatStartupManager sharedManager].askUserDetails = NO; - [BugsplatStartupManager sharedManager].delegate = self; - [[BugsplatStartupManager sharedManager] start]; + + // Initialize BugSplat + [[BugSplat shared] setDelegate:self]; + [[BugSplat shared] setAutoSubmitCrashReport:YES]; + [[BugSplat shared] setPersistUserDetails:NO]; + [[BugSplat shared] setAskUserDetails:NO]; + [BugSplat shared].expirationTimeInterval = 0; + [[BugSplat shared] start]; + + // Optionally, add some attributes to your crash reports. + // Attributes are artibrary key/value pairs that are searchable in the BugSplat dashboard. + // [[BugSplat shared] setValue:@"Value of Plain Attribute" forAttribute:@"PlainAttribute"]; + #endif infos("post-bugsplat setup"); @@ -213,9 +226,54 @@ - (bool) romanScript return true; } +- (void) setBugsplatValue:(nullable NSString *)value forAttribute:(NSString *)attribute +{ #if defined(LL_BUGSPLAT) + //[[BugSplat shared] setValue:@"Value of not so plain Attribute" forAttribute:@"NotSoPlainAttribute"]; + [[BugSplat shared] setValue:value forAttribute:attribute]; +#endif // LL_BUGSPLAT +} + +#if defined(LL_BUGSPLAT) + +- (void)bugSplatWillSendCrashReport:(BugSplat *)bugSplat +{ + infos("bugSplatWillSendCrashReport"); +} + +- (void)bugSplatWillSendCrashReportsAlways:(BugSplat *)bugSplat +{ + infos("bugSplatWillSendCrashReportsAlways"); +} + +- (void)bugSplatDidFinishSendingCrashReport:(BugSplat *)bugSplat +{ + infos("bugSplatDidFinishSendingCrashReport"); + + if(!secondLogPath.empty()) + { + boost::filesystem::remove(secondLogPath); + } + clearDumpLogsDir(); +} + +- (void)bugSplatWillCancelSendingCrashReport:(BugSplat *)bugSplat +{ + infos("bugSplatWillCancelSendingCrashReport"); +} + +- (void)bugSplatWillShowSubmitCrashReportAlert:(BugSplat *)bugSplat +{ + infos("bugSplatWillShowSubmitCrashReportAlert"); +} -- (NSString *)applicationLogForBugsplatStartupManager:(BugsplatStartupManager *)bugsplatStartupManager +- (void)bugSplat:(BugSplat *)bugSplat didFailWithError:(NSError *)error +{ + std::string error_str([[error localizedDescription] UTF8String]); + infos("bugSplat:didFailWithError: " + error_str); +} + +- (NSString *)applicationLogForBugSplat:(BugSplat *)bugSplat; { CrashMetadata& meta(CrashMetadata_instance()); // As of BugsplatMac 1.0.6, userName and userEmail properties are now @@ -226,16 +284,21 @@ - (NSString *)applicationLogForBugsplatStartupManager:(BugsplatStartupManager *) // report we are about to send. infos("applicationLogForBugsplatStartupManager setting userName = '" + meta.agentFullname + '"'); - bugsplatStartupManager.userName = + bugSplat.userName = [NSString stringWithCString:meta.agentFullname.c_str() encoding:NSUTF8StringEncoding]; // Use the email field for OS version, just as we do on Windows, until // BugSplat provides more metadata fields. infos("applicationLogForBugsplatStartupManager setting userEmail = '" + meta.OSInfo + '"'); - bugsplatStartupManager.userEmail = + bugSplat.userEmail = [NSString stringWithCString:meta.OSInfo.c_str() encoding:NSUTF8StringEncoding]; + + //bugSplat.userID = + // [NSString stringWithCString:meta.regionName.c_str() + // encoding:NSUTF8StringEncoding]; + // This strangely-named override method's return value contributes the // User Description metadata field. infos("applicationLogForBugsplatStartupManager -> '" + meta.fatalMessage + "'"); @@ -243,7 +306,8 @@ - (NSString *)applicationLogForBugsplatStartupManager:(BugsplatStartupManager *) encoding:NSUTF8StringEncoding]; } -- (NSString *)applicationKeyForBugsplatStartupManager:(BugsplatStartupManager *)bugsplatStartupManager signal:(NSString *)signal exceptionName:(NSString *)exceptionName exceptionReason:(NSString *)exceptionReason { +- (NSString *)applicationKeyForBugSplat:(BugSplat *)bugSplat signal:(NSString *)signal exceptionName:(NSString *)exceptionName exceptionReason:(NSString *)exceptionReason +{ // TODO: exceptionName, exceptionReason // Windows sends location within region as well, but that's because @@ -258,27 +322,6 @@ - (NSString *)applicationKeyForBugsplatStartupManager:(BugsplatStartupManager *) encoding:NSUTF8StringEncoding]; } -- (NSString *)defaultUserNameForBugsplatStartupManager:(BugsplatStartupManager *)bugsplatStartupManager { - std::string agentFullname(CrashMetadata_instance().agentFullname); - infos("defaultUserNameForBugsplatStartupManager -> '" + agentFullname + "'"); - return [NSString stringWithCString:agentFullname.c_str() - encoding:NSUTF8StringEncoding]; -} - -- (NSString *)defaultUserEmailForBugsplatStartupManager:(BugsplatStartupManager *)bugsplatStartupManager { - // Use the email field for OS version, just as we do on Windows, until - // BugSplat provides more metadata fields. - std::string OSInfo(CrashMetadata_instance().OSInfo); - infos("defaultUserEmailForBugsplatStartupManager -> '" + OSInfo + "'"); - return [NSString stringWithCString:OSInfo.c_str() - encoding:NSUTF8StringEncoding]; -} - -- (void)bugsplatStartupManagerWillSendCrashReport:(BugsplatStartupManager *)bugsplatStartupManager -{ - infos("bugsplatStartupManagerWillSendCrashReport"); -} - struct AttachmentInfo { AttachmentInfo(const std::string& path, const std::string& type): @@ -290,7 +333,7 @@ - (void)bugsplatStartupManagerWillSendCrashReport:(BugsplatStartupManager *)bugs std::string pathname, basename, mimetype; }; -- (NSArray *)attachmentsForBugsplatStartupManager:(BugsplatStartupManager *)bugsplatStartupManager +- (NSArray *)attachmentsForBugSplat:(BugSplat *)bugSplat { const CrashMetadata& metadata(CrashMetadata_instance()); @@ -311,12 +354,12 @@ - (void)bugsplatStartupManagerWillSendCrashReport:(BugsplatStartupManager *)bugs info.push_back(AttachmentInfo(secondLogPath, "text/xml")); } - // We "happen to know" that info[0].basename is "SecondLife.old" -- due to + // We "happen to know" that info[0].basename is "SecondLife.crash" -- due to // the fact that BugsplatMac only notices a crash during the viewer run // following the crash. // The Bugsplat service doesn't respect the MIME type above when returning // the log data to a browser, so take this opportunity to rename the file - // from .old to _log.txt + // from .crash to _log.txt info[0].basename = boost::filesystem::path(info[0].pathname).stem().string() + "_log.txt"; infos("attachmentsForBugsplatStartupManager attaching log " + info[0].basename); @@ -334,8 +377,8 @@ - (void)bugsplatStartupManagerWillSendCrashReport:(BugsplatStartupManager *)bugs encoding:NSUTF8StringEncoding]; NSData *nsdata = [NSData dataWithContentsOfFile:nspathname]; - BugsplatAttachment *attachment = - [[BugsplatAttachment alloc] initWithFilename:nsbasename + BugSplatAttachment *attachment = + [[BugSplatAttachment alloc] initWithFilename:nsbasename attachmentData:nsdata contentType:nsmimetype]; @@ -346,23 +389,6 @@ - (void)bugsplatStartupManagerWillSendCrashReport:(BugsplatStartupManager *)bugs return attachments; } -- (void)bugsplatStartupManagerDidFinishSendingCrashReport:(BugsplatStartupManager *)bugsplatStartupManager -{ - infos("Sent crash report to BugSplat"); - - if(!secondLogPath.empty()) - { - boost::filesystem::remove(secondLogPath); - } - clearDumpLogsDir(); -} - -- (void)bugsplatStartupManager:(BugsplatStartupManager *)bugsplatStartupManager didFailWithError:(NSError *)error -{ - // TODO: message string from NSError - infos("Could not send crash report to BugSplat"); -} - #endif // LL_BUGSPLAT @end diff --git a/indra/newview/llappearancemgr.cpp b/indra/newview/llappearancemgr.cpp index 0d57b33a516..f65aaccddc6 100644 --- a/indra/newview/llappearancemgr.cpp +++ b/indra/newview/llappearancemgr.cpp @@ -3908,7 +3908,7 @@ void LLAppearanceMgr::serverAppearanceUpdateCoro(LLCoreHttpUtil::HttpCoroutineAd LL_DEBUGS("Avatar") << "Will send request for cof_version " << cofVersion << LL_ENDL; bRetry = false; - LLCore::HttpRequest::ptr_t httpRequest(new LLCore::HttpRequest()); + LLCore::HttpRequest::ptr_t httpRequest = std::make_shared(); if (gSavedSettings.getBOOL("DebugForceAppearanceRequestFailure")) { @@ -4379,8 +4379,8 @@ LLAppearanceMgr::LLAppearanceMgr(): outfit_observer.addCOFSavedCallback(boost::bind( &LLAppearanceMgr::setOutfitLocked, this, false)); - mUnlockOutfitTimer.reset(new LLOutfitUnLockTimer((F32)gSavedSettings.getS32( - "OutfitOperationsTimeout"))); + mUnlockOutfitTimer = std::make_unique((F32)gSavedSettings.getS32( + "OutfitOperationsTimeout")); gIdleCallbacks.addFunction(&LLAttachmentsMgr::onIdle, NULL); gIdleCallbacks.addFunction(&LLAppearanceMgr::onIdle, NULL); //sheduling appearance update requests diff --git a/indra/newview/llappearancemgr.h b/indra/newview/llappearancemgr.h index 0a41a91750c..131b6817edc 100644 --- a/indra/newview/llappearancemgr.h +++ b/indra/newview/llappearancemgr.h @@ -235,7 +235,7 @@ class LLAppearanceMgr: public LLSingleton void setAppearanceServiceURL(const std::string& url) { mAppearanceServiceURL = url; } std::string getAppearanceServiceURL() const; - typedef boost::function attachments_changed_callback_t; + typedef std::function attachments_changed_callback_t; typedef boost::signals2::signal attachments_changed_signal_t; boost::signals2::connection setAttachmentsChangedCallback(attachments_changed_callback_t cb); diff --git a/indra/newview/llappviewer.cpp b/indra/newview/llappviewer.cpp index bfd8b1dcc74..5351ed9f08e 100644 --- a/indra/newview/llappviewer.cpp +++ b/indra/newview/llappviewer.cpp @@ -109,6 +109,7 @@ #include "lllocalbitmaps.h" #include "llperfstats.h" #include "llgltfmateriallist.h" +#include "llwebsocketmgr.h" // Linden library includes #include "llavatarnamecache.h" @@ -131,15 +132,17 @@ #include "stringize.h" #include "llcoros.h" #include "llexception.h" -#if !LL_LINUX #include "cef/dullahan_version.h" #include "vlc/libvlc_version.h" -#endif // LL_LINUX #if LL_DARWIN #include "llwindowmacosx.h" #endif +#if LL_SDL_WINDOW +#include "llwindowsdl.h" +#endif + // Third party library includes #include #include @@ -180,7 +183,6 @@ #include "lltracker.h" #include "llviewerparcelmgr.h" #include "llworldmapview.h" -#include "llpostprocess.h" #include "lldebugview.h" #include "llconsole.h" @@ -216,7 +218,6 @@ #include "llfloatersimplesnapshot.h" #include "llfloatersnapshot.h" #include "llsidepanelinventory.h" -#include "llatmosphere.h" // includes for idle() idleShutdown() #include "llviewercontrol.h" @@ -264,10 +265,6 @@ using namespace LL; // define a self-registering event API object #include "llappviewerlistener.h" -#if LL_LINUX && LL_GTK -#include "glib.h" -#endif // (LL_LINUX) && LL_GTK - #ifdef LL_DISCORD #define DISCORDPP_IMPLEMENTATION #include @@ -293,7 +290,7 @@ extern bool gRandomizeFramerate; extern bool gPeriodicSlowFrame; extern bool gDebugGL; -#if LL_DARWIN +#if LL_DARWIN || LL_SDL_WINDOW extern bool gHiDPISupport; #endif @@ -550,7 +547,7 @@ static void settings_to_globals() LLRender::sGLCoreProfile = gSavedSettings.getBOOL("RenderGLContextCoreProfile"); #endif LLRender::sNsightDebugSupport = gSavedSettings.getBOOL("RenderNsightDebugSupport"); - LLImageGL::sGlobalUseAnisotropic = gSavedSettings.getBOOL("RenderAnisotropic"); + LLRender::sAnisotropicFilteringLevel = static_cast(gSavedSettings.getU32("RenderAnisotropicLevel")); LLImageGL::sCompressTextures = gSavedSettings.getBOOL("RenderCompressTextures"); LLVOVolume::sLODFactor = llclamp(gSavedSettings.getF32("RenderVolumeLODFactor"), 0.01f, MAX_LOD_FACTOR); LLVOVolume::sDistanceFactor = 1.f-LLVOVolume::sLODFactor * 0.1f; @@ -576,6 +573,9 @@ static void settings_to_globals() #if LL_DARWIN LLWindowMacOSX::sUseMultGL = gSavedSettings.getBOOL("RenderAppleUseMultGL"); +#endif + +#if LL_DARWIN || LL_SDL_WINDOW gHiDPISupport = gSavedSettings.getBOOL("RenderHiDPI"); #endif } @@ -1113,7 +1113,7 @@ bool LLAppViewer::init() gGLActive = false; -#if LL_RELEASE_FOR_DOWNLOAD +#if LL_RELEASE_FOR_DOWNLOAD && !LL_LINUX // Skip updater if this is a non-interactive instance if (!gSavedSettings.getBOOL("CmdLineSkipUpdater") && !gNonInteractive) { @@ -1171,10 +1171,11 @@ bool LLAppViewer::init() } } else +#endif //LL_RELEASE_FOR_DOWNLOAD { + mUpdaterNotFound = true; LL_WARNS("InitInfo") << "Skipping updater check." << LL_ENDL; } -#endif //LL_RELEASE_FOR_DOWNLOAD { // Iterate over --leap command-line options. But this is a bit tricky: if @@ -1232,8 +1233,8 @@ bool LLAppViewer::init() /// Tell the Coprocedure manager how to discover and store the pool sizes // what I wanted LLCoprocedureManager::getInstance()->setPropertyMethods( - boost::bind(&LLControlGroup::getU32, boost::ref(gSavedSettings), _1), - boost::bind(&LLControlGroup::declareU32, boost::ref(gSavedSettings), _1, _2, _3, LLControlVariable::PERSIST_ALWAYS)); + std::bind(&LLControlGroup::getU32, std::ref(gSavedSettings), std::placeholders::_1), + std::bind(&LLControlGroup::declareU32, std::ref(gSavedSettings), std::placeholders::_1, std::placeholders::_2, std::placeholders::_3, LLControlVariable::PERSIST_ALWAYS)); // TODO: consider moving proxy initialization here or LLCopocedureManager after proxy initialization, may be implement // some other protection to make sure we don't use network before initializng proxy @@ -1347,6 +1348,8 @@ bool LLAppViewer::frame() bool LLAppViewer::doFrame() { + LL_RECORD_BLOCK_TIME(FTM_FRAME); + LL_PROFILE_GPU_ZONE("Frame"); #ifdef LL_DISCORD { LL_PROFILE_ZONE_NAMED("discord_callbacks"); @@ -1354,8 +1357,6 @@ bool LLAppViewer::doFrame() } #endif - LL_RECORD_BLOCK_TIME(FTM_FRAME); - LL_PROFILE_GPU_ZONE("Frame"); { // and now adjust the visuals from previous frame. if(LLPerfStats::tunables.userAutoTuneEnabled && LLPerfStats::tunables.tuningFlag != LLPerfStats::Tunables::Nothing) @@ -1700,8 +1701,6 @@ void LLAppViewer::flushLFSIO() bool LLAppViewer::cleanup() { - LLAtmosphere::cleanupClass(); - //ditch LLVOAvatarSelf instance gAgentAvatarp = NULL; @@ -1879,8 +1878,6 @@ bool LLAppViewer::cleanup() SUBSYSTEM_CLEANUP(LLAvatarAppearance); - SUBSYSTEM_CLEANUP(LLPostProcess); - LLTracker::cleanupInstance(); // *FIX: This is handled in LLAppViewerWin32::cleanup(). @@ -3148,7 +3145,7 @@ bool LLAppViewer::initWindow() // Need to load feature table before cheking to start watchdog. bool use_watchdog = false; - int watchdog_enabled_setting = gSavedSettings.getS32("WatchdogEnabled"); + S32 watchdog_enabled_setting = gSavedSettings.getS32("WatchdogEnabled"); if (watchdog_enabled_setting == -1) { use_watchdog = !LLFeatureManager::getInstance()->isFeatureAvailable("WatchdogDisabled"); @@ -3387,7 +3384,7 @@ LLSD LLAppViewer::getViewerInfo() const info["RENDER_QUALITY"] = (F32)gSavedSettings.getU32("RenderQualityPerformance"); info["TEXTURE_MEMORY"] = LLSD::Integer(gGLManager.mVRAM); -#if LL_DARWIN +#if LL_DARWIN || LL_SDL_WINDOW info["HIDPI"] = gHiDPISupport; #endif @@ -3417,7 +3414,6 @@ LLSD LLAppViewer::getViewerInfo() const info["VOICE_VERSION"] = LLTrans::getString("NotConnected"); } -#if !LL_LINUX std::ostringstream cef_ver_codec; cef_ver_codec << "Dullahan: "; cef_ver_codec << DULLAHAN_VERSION_MAJOR; @@ -3443,11 +3439,7 @@ LLSD LLAppViewer::getViewerInfo() const cef_ver_codec << CHROME_VERSION_PATCH; info["LIBCEF_VERSION"] = cef_ver_codec.str(); -#else - info["LIBCEF_VERSION"] = "Undefined"; -#endif -#if !LL_LINUX std::ostringstream vlc_ver_codec; vlc_ver_codec << LIBVLC_VERSION_MAJOR; vlc_ver_codec << "."; @@ -3455,9 +3447,6 @@ LLSD LLAppViewer::getViewerInfo() const vlc_ver_codec << "."; vlc_ver_codec << LIBVLC_VERSION_REVISION; info["LIBVLC_VERSION"] = vlc_ver_codec.str(); -#else - info["LIBVLC_VERSION"] = "Undefined"; -#endif S32 packets_in = (S32)LLViewerStats::instance().getRecording().getSum(LLStatViewer::PACKETS_IN); if (packets_in > 0) @@ -3622,10 +3611,15 @@ void LLAppViewer::writeSystemInfo() if (! gDebugInfo.has("Dynamic") ) gDebugInfo["Dynamic"] = LLSD::emptyMap(); -#if LL_WINDOWS && !LL_BUGSPLAT +#if LL_DARWIN + // crash processing in CrashMetadataSingleton reads SLLog + gDebugInfo["SLLog"] = gDirUtilp->getExpandedFilename(LL_PATH_LOGS,"SecondLife.crash"); +#elif LL_WINDOWS && !LL_BUGSPLAT gDebugInfo["SLLog"] = gDirUtilp->getExpandedFilename(LL_PATH_DUMP,"SecondLife.log"); #else - //Not ideal but sufficient for good reporting. + // Far from ideal, especially when multiple instances get involved. + // Note that attachmentsForBugSplat expects .old extendion. + // Todo: improve. gDebugInfo["SLLog"] = gDirUtilp->getExpandedFilename(LL_PATH_LOGS,"SecondLife.old"); //LLError::logFileName(); #endif @@ -3948,7 +3942,7 @@ void LLAppViewer::processMarkerFiles() #if LL_WINDOWS && LL_BUGSPLAT // bugsplat will set correct state in bugsplatSendLog // Might be more accurate to rename this one into 'unknown' - gLastExecEvent = LAST_EXEC_FROZE; + gLastExecEvent = LAST_EXEC_UNKNOWN; #else gLastExecEvent = LAST_EXEC_OTHER_CRASH; #endif // LL_WINDOWS @@ -3994,7 +3988,8 @@ void LLAppViewer::processMarkerFiles() { if (markerIsSameVersion(logout_marker_file)) { - gLastExecEvent = LAST_EXEC_LOGOUT_FROZE; + // Either froze, got killed or somehow crash was not caught + gLastExecEvent = LAST_EXEC_LOGOUT_UNKNOWN; LL_INFOS("MarkerFile") << "Logout crash marker '"<< logout_marker_file << "', changing LastExecEvent to LOGOUT_FROZE" << LL_ENDL; } else @@ -4032,6 +4027,22 @@ void LLAppViewer::processMarkerFiles() } LLAPRFile::remove(error_marker_file); } + +#if LL_DARWIN + if (!mSecondInstance && gLastExecEvent != LAST_EXEC_NORMAL) + { + // While windows reports crashes immediately, mac reports next run and + // may take a while to trigger crash report so it has a special file. + // Remove .crash file if exists + std::string old_log_file = gDirUtilp->getExpandedFilename(LL_PATH_LOGS, + "SecondLife.old"); + std::string crash_log_file = gDirUtilp->getExpandedFilename(LL_PATH_LOGS, + "SecondLife.crash"); + LLFile::remove(crash_log_file); + // Rename ".old" log file to ".crash" + LLFile::rename(old_log_file, crash_log_file); + } +#endif } void LLAppViewer::removeMarkerFiles() @@ -4386,6 +4397,8 @@ bool LLAppViewer::initCache() LL_WARNS("AppCache") << "Unable to set cache location" << LL_ENDL; gSavedSettings.setString("CacheLocation", ""); gSavedSettings.setString("CacheLocationTopFolder", ""); + gSavedSettings.setString("NewCacheLocation", ""); + gSavedSettings.setString("NewCacheLocationTopFolder", ""); } const std::string cache_dir = gDirUtilp->getExpandedFilename(LL_PATH_CACHE, cache_dir_name); @@ -4438,7 +4451,7 @@ bool LLAppViewer::initCache() return true; } -void LLAppViewer::addOnIdleCallback(const boost::function& cb) +void LLAppViewer::addOnIdleCallback(const std::function& cb) { gMainloopWork.post(cb); } @@ -4762,6 +4775,11 @@ void LLAppViewer::idle() LLMortician::updateClass(); LLFilePickerThread::clearDead(); //calls LLFilePickerThread::notify() LLDirPickerThread::clearDead(); + + if (LLWebsocketMgr::instanceExists()) + { + LLWebsocketMgr::instance().update(); + } F32 dt_raw = idle_timer.getElapsedTimeAndResetF32(); LLGLTFMaterialList::flushUpdates(); @@ -5800,12 +5818,12 @@ void LLAppViewer::forceExceptionThreadCrash() thread->start(); } -void LLAppViewer::initMainloopTimeout(std::string_view state, F32 secs) +void LLAppViewer::initMainloopTimeout(std::string_view state) { if (!mMainloopTimeout) { mMainloopTimeout = new LLWatchdogTimeout(); - resumeMainloopTimeout(state, secs); + resumeMainloopTimeout(state); } } @@ -5818,17 +5836,11 @@ void LLAppViewer::destroyMainloopTimeout() } } -void LLAppViewer::resumeMainloopTimeout(std::string_view state, F32 secs) +void LLAppViewer::resumeMainloopTimeout(std::string_view state) { if (mMainloopTimeout) { - if (secs < 0.0f) - { - static LLCachedControl mainloop_timeout(gSavedSettings, "MainloopTimeoutDefault", 60.f); - secs = mainloop_timeout; - } - - mMainloopTimeout->setTimeout(secs); + mMainloopTimeout->setTimeout(getMainloopTimeoutSec()); mMainloopTimeout->start(state); } } @@ -5841,23 +5853,33 @@ void LLAppViewer::pauseMainloopTimeout() } } -void LLAppViewer::pingMainloopTimeout(std::string_view state, F32 secs) +void LLAppViewer::pingMainloopTimeout(std::string_view state) { LL_PROFILE_ZONE_SCOPED_CATEGORY_APP; if (mMainloopTimeout) { - if (secs < 0.0f) - { - static LLCachedControl mainloop_timeout(gSavedSettings, "MainloopTimeoutDefault", 60); - secs = mainloop_timeout; - } - - mMainloopTimeout->setTimeout(secs); + mMainloopTimeout->setTimeout(getMainloopTimeoutSec()); mMainloopTimeout->ping(state); } } + +F32 LLAppViewer::getMainloopTimeoutSec() const +{ + if (LLStartUp::getStartupState() == STATE_STARTED + && gAgent.getTeleportState() == LLAgent::TELEPORT_NONE) + { + static LLCachedControl mainloop_started(gSavedSettings, "MainloopTimeoutStarted", 30.f); + return mainloop_started(); + } + else + { + static LLCachedControl mainloop_default(gSavedSettings, "MainloopTimeoutDefault", 120.f); + return mainloop_default(); + } +} + void LLAppViewer::handleLoginComplete() { gLoggedInTime.start(); diff --git a/indra/newview/llappviewer.h b/indra/newview/llappviewer.h index 4f2583cb164..6b0d3e0b27c 100644 --- a/indra/newview/llappviewer.h +++ b/indra/newview/llappviewer.h @@ -77,6 +77,8 @@ typedef enum LAST_EXEC_BAD_ALLOC, LAST_EXEC_MISSING_FILES, LAST_EXEC_GRAPHICS_INIT, + LAST_EXEC_UNKNOWN, + LAST_EXEC_LOGOUT_UNKNOWN, LAST_EXEC_COUNT } eLastExecEvent; @@ -204,11 +206,13 @@ class LLAppViewer : public LLApp // For thread debugging. // llstartup needs to control init. // llworld, send_agent_pause() also controls pause/resume. - void initMainloopTimeout(std::string_view state, F32 secs = -1.0f); + void initMainloopTimeout(std::string_view state); void destroyMainloopTimeout(); void pauseMainloopTimeout(); - void resumeMainloopTimeout(std::string_view state = "", F32 secs = -1.0f); - void pingMainloopTimeout(std::string_view state, F32 secs = -1.0f); + void resumeMainloopTimeout(std::string_view state = ""); + void pingMainloopTimeout(std::string_view state); + + F32 getMainloopTimeoutSec() const; // Handle the 'login completed' event. // *NOTE:Mani Fix this for login abstraction!! @@ -222,7 +226,7 @@ class LLAppViewer : public LLApp return mOnLoginCompleted.connect(cb); } - void addOnIdleCallback(const boost::function& cb); // add a callback to fire (once) when idle + void addOnIdleCallback(const std::function& cb); // add a callback to fire (once) when idle void initGeneralThread(); void purgeUserDataOnExit() { mPurgeUserDataOnExit = true; } diff --git a/indra/newview/llappviewerlinux.cpp b/indra/newview/llappviewerlinux.cpp index 89d19d180b5..c9247718165 100644 --- a/indra/newview/llappviewerlinux.cpp +++ b/indra/newview/llappviewerlinux.cpp @@ -34,30 +34,142 @@ #include "llurldispatcher.h" // SLURL from other app instance #include "llviewernetwork.h" #include "llviewercontrol.h" -#include "llwindowsdl.h" #include "llmd5.h" #include "llfindlocale.h" +#include "llversioninfo.h" #include -#if LL_DBUS_ENABLED -# include "llappviewerlinux_api_dbus.h" +#define SDL_MAIN_USE_CALLBACKS +#include + +#include "SDL3/SDL.h" -// regrettable hacks to give us better runtime compatibility with older systems inside llappviewerlinux_api.h: -#define llg_return_if_fail(COND) do{if (!(COND)) return;}while(0) -#undef g_return_if_fail -#define g_return_if_fail(COND) llg_return_if_fail(COND) -// The generated API -# include "llappviewerlinux_api.h" +#include "llsdl.h" +#include "llwindowsdl.h" + +#ifdef LL_GLIB +#include #endif +#define VIEWERAPI_SERVICE "com.secondlife.ViewerAppAPIService" +#define VIEWERAPI_PATH "/com/secondlife/ViewerAppAPI" +#define VIEWERAPI_INTERFACE "com.secondlife.ViewerAppAPI" + +static const char * DBUS_SERVER = "\n" + " \n" + " \n" + " \n" + " \n" + " \n" + " \n" + " \n" + ""; + +typedef struct +{ + GObject parent; +} ViewerAppAPI; + namespace { int gArgC = 0; char **gArgV = NULL; + LLAppViewerLinux* gViewerAppPtr = NULL; void (*gOldTerminateHandler)() = NULL; } +void check_vm_bloat() +{ +#if LL_LINUX + // watch our own VM and RSS sizes, warn if we bloated rapidly + static const std::string STATS_FILE = "/proc/self/stat"; + FILE *fp = fopen(STATS_FILE.c_str(), "r"); + if (fp) + { + static long long last_vm_size = 0; + static long long last_rss_size = 0; + const long long significant_vm_difference = 250 * 1024*1024; + const long long significant_rss_difference = 50 * 1024*1024; + long long this_vm_size = 0; + long long this_rss_size = 0; + + ssize_t res; + size_t dummy; + char *ptr = nullptr; + for (int i=0; i<22; ++i) // parse past the values we don't want + { + res = getdelim(&ptr, &dummy, ' ', fp); + if (-1 == res) + { + LL_WARNS() << "Unable to parse " << STATS_FILE << LL_ENDL; + goto finally; + } + free(ptr); + ptr = nullptr; + } + // 23rd space-delimited entry is vsize + res = getdelim(&ptr, &dummy, ' ', fp); + llassert(ptr); + if (-1 == res) + { + LL_WARNS() << "Unable to parse " << STATS_FILE << LL_ENDL; + goto finally; + } + this_vm_size = atoll(ptr); + free(ptr); + ptr = nullptr; + // 24th space-delimited entry is RSS + res = getdelim(&ptr, &dummy, ' ', fp); + llassert(ptr); + if (-1 == res) + { + LL_WARNS() << "Unable to parse " << STATS_FILE << LL_ENDL; + goto finally; + } + this_rss_size = getpagesize() * atoll(ptr); + free(ptr); + ptr = nullptr; + + LL_INFOS() << "VM SIZE IS NOW " << (this_vm_size/(1024*1024)) << " MB, RSS SIZE IS NOW " << (this_rss_size/(1024*1024)) << " MB" << LL_ENDL; + + if (llabs(last_vm_size - this_vm_size) > significant_vm_difference) + { + if (this_vm_size > last_vm_size) + { + LL_WARNS() << "VM size grew by " << (this_vm_size - last_vm_size)/(1024*1024) << " MB in last frame" << LL_ENDL; + } + else + { + LL_INFOS() << "VM size shrank by " << (last_vm_size - this_vm_size)/(1024*1024) << " MB in last frame" << LL_ENDL; + } + } + + if (llabs(last_rss_size - this_rss_size) > significant_rss_difference) + { + if (this_rss_size > last_rss_size) + { + LL_WARNS() << "RSS size grew by " << (this_rss_size - last_rss_size)/(1024*1024) << " MB in last frame" << LL_ENDL; + } + else + { + LL_INFOS() << "RSS size shrank by " << (last_rss_size - this_rss_size)/(1024*1024) << " MB in last frame" << LL_ENDL; + } + } + + last_rss_size = this_rss_size; + last_vm_size = this_vm_size; + +finally: + if (ptr) + { + free(ptr); + ptr = nullptr; + } + fclose(fp); + } +#endif // LL_LINUX +} static void exceptionTerminateHandler() { @@ -71,32 +183,85 @@ static void exceptionTerminateHandler() gOldTerminateHandler(); // call old terminate() handler } -int main( int argc, char **argv ) +SDL_AppResult SDL_AppInit(void **appstate, int argc, char **argv) { // Call Tracy first thing to have it allocate memory // https://github.com/wolfpld/tracy/issues/196 LL_PROFILER_FRAME_END; LL_PROFILER_SET_THREAD_NAME("App"); + gSDLMainHandled = true; + gArgC = argc; gArgV = argv; - LLAppViewer* viewer_app_ptr = new LLAppViewerLinux(); + gViewerAppPtr = new LLAppViewerLinux(); // install unexpected exception handler gOldTerminateHandler = std::set_terminate(exceptionTerminateHandler); - bool ok = viewer_app_ptr->init(); + unsetenv( "LD_PRELOAD" ); // Get rid of any preloading, we do not want this to happen during startup of plugins. + + // This needs to be set as early as possible + SDL_SetAppMetadataProperty(SDL_PROP_APP_METADATA_NAME_STRING, LLVersionInfo::getInstance()->getChannel().c_str()); + SDL_SetAppMetadataProperty(SDL_PROP_APP_METADATA_VERSION_STRING, LLVersionInfo::getInstance()->getVersion().c_str()); + SDL_SetAppMetadataProperty(SDL_PROP_APP_METADATA_IDENTIFIER_STRING, "com.secondlife.indra.viewer"); + SDL_SetAppMetadataProperty(SDL_PROP_APP_METADATA_CREATOR_STRING, "Linden Research Inc"); + SDL_SetAppMetadataProperty(SDL_PROP_APP_METADATA_COPYRIGHT_STRING, "Copyright (c) Linden Research, Inc. 2025"); + SDL_SetAppMetadataProperty(SDL_PROP_APP_METADATA_URL_STRING, "https://www.secondlife.com"); + SDL_SetAppMetadataProperty(SDL_PROP_APP_METADATA_TYPE_STRING, "game"); + + bool ok = gViewerAppPtr->init(); if(!ok) { LL_WARNS() << "Application init failed." << LL_ENDL; - return -1; + return SDL_APP_FAILURE; } - // Run the application main loop - while (! viewer_app_ptr->frame()) - {} + return SDL_APP_CONTINUE; +} +SDL_AppResult SDL_AppIterate(void *appstate) +{ + // Run the application main loop + if (!gViewerAppPtr->frame()) + { +#if LL_GLIB + // Pump until we've nothing left to do or passed 1/15th of a + // second pumping for this frame. + static LLTimer pump_timer; + pump_timer.reset(); + pump_timer.setTimerExpirySec(1.0f / 15.0f); + do + { + g_main_context_iteration(g_main_context_default(), false); + } while( g_main_context_pending(g_main_context_default()) && !pump_timer.hasExpired()); +#endif + + // hack - doesn't belong here - but this is just for debugging + if (getenv("LL_DEBUG_BLOAT")) + { + check_vm_bloat(); + } + + return SDL_APP_CONTINUE; + } + + if(LLApp::isError()) + { + return SDL_APP_FAILURE; + } + + return SDL_APP_SUCCESS; +} + +SDL_AppResult SDL_AppEvent(void *appstate, SDL_Event *event) +{ + return LLWindowSDL::handleEvents(*event); +} + +void SDL_AppQuit(void *appstate, SDL_AppResult result) +{ if (!LLApp::isError()) { // @@ -104,29 +269,15 @@ int main( int argc, char **argv ) // the assumption is that the error handler is responsible for doing // app cleanup if there was a problem. // - viewer_app_ptr->cleanup(); + gViewerAppPtr->cleanup(); } - delete viewer_app_ptr; - viewer_app_ptr = NULL; - return 0; -} -LLAppViewerLinux::LLAppViewerLinux() -{ -} - -LLAppViewerLinux::~LLAppViewerLinux() -{ + delete gViewerAppPtr; + gViewerAppPtr = nullptr; } bool LLAppViewerLinux::init() { - // g_thread_init() must be called before *any* use of glib, *and* - // before any mutexes are held, *and* some of our third-party - // libraries likes to use glib functions; in short, do this here - // really early in app startup! - if (!g_thread_supported ()) g_thread_init (NULL); - bool success = LLAppViewer::init(); #if LL_SEND_CRASH_REPORTS @@ -148,7 +299,7 @@ bool LLAppViewerLinux::restoreErrorTrap() } ///////////////////////////////////////// -#if LL_DBUS_ENABLED +#if LL_GLIB typedef struct { @@ -158,101 +309,77 @@ typedef struct static void viewerappapi_init(ViewerAppAPI *server); static void viewerappapi_class_init(ViewerAppAPIClass *klass); -/// - -// regrettable hacks to give us better runtime compatibility with older systems in general -static GType llg_type_register_static_simple_ONCE(GType parent_type, - const gchar *type_name, - guint class_size, - GClassInitFunc class_init, - guint instance_size, - GInstanceInitFunc instance_init, - GTypeFlags flags) -{ - static GTypeInfo type_info; - memset(&type_info, 0, sizeof(type_info)); - - type_info.class_size = class_size; - type_info.class_init = class_init; - type_info.instance_size = instance_size; - type_info.instance_init = instance_init; - - return g_type_register_static(parent_type, type_name, &type_info, flags); -} -#define llg_intern_static_string(S) (S) -#define g_intern_static_string(S) llg_intern_static_string(S) -#define g_type_register_static_simple(parent_type, type_name, class_size, class_init, instance_size, instance_init, flags) llg_type_register_static_simple_ONCE(parent_type, type_name, class_size, class_init, instance_size, instance_init, flags) - G_DEFINE_TYPE(ViewerAppAPI, viewerappapi, G_TYPE_OBJECT); void viewerappapi_class_init(ViewerAppAPIClass *klass) { } -static bool dbus_server_init = false; - -void viewerappapi_init(ViewerAppAPI *server) +static void dispatchSLURL(gchar const *slurl) { - // Connect to the default DBUS, register our service/API. - - if (!dbus_server_init) - { - GError *error = NULL; - - server->connection = lldbus_g_bus_get(DBUS_BUS_SESSION, &error); - if (server->connection) - { - lldbus_g_object_type_install_info(viewerappapi_get_type(), &dbus_glib_viewerapp_object_info); + LL_INFOS() << "Was asked to go to slurl: " << slurl << LL_ENDL; - lldbus_g_connection_register_g_object(server->connection, VIEWERAPI_PATH, G_OBJECT(server)); + std::string url = slurl; + LLMediaCtrl* web = NULL; + const bool trusted_browser = false; + LLURLDispatcher::dispatch(url, "", web, trusted_browser); +} - DBusGProxy *serverproxy = lldbus_g_proxy_new_for_name(server->connection, DBUS_SERVICE_DBUS, DBUS_PATH_DBUS, DBUS_INTERFACE_DBUS); +static void DoMethodeCall (GDBusConnection *connection, + const gchar *sender, + const gchar *object_path, + const gchar *interface_name, + const gchar *method_name, + GVariant *parameters, + GDBusMethodInvocation *invocation, + gpointer user_data) +{ + LL_INFOS() << "DBUS message " << method_name << " from: " << sender << " interface: " << interface_name << LL_ENDL; + const gchar *slurl; - guint request_name_ret_unused; - // akin to org_freedesktop_DBus_request_name - if (lldbus_g_proxy_call(serverproxy, "RequestName", &error, G_TYPE_STRING, VIEWERAPI_SERVICE, G_TYPE_UINT, 0, G_TYPE_INVALID, G_TYPE_UINT, &request_name_ret_unused, G_TYPE_INVALID)) - { - // total success. - dbus_server_init = true; - } - else - { - LL_WARNS() << "Unable to register service name: " << error->message << LL_ENDL; - } + g_variant_get (parameters, "(&s)", &slurl); + dispatchSLURL(slurl); +} - g_object_unref(serverproxy); - } - else +GDBusNodeInfo *gBusNodeInfo = nullptr; +static const GDBusInterfaceVTable interface_vtable = { - g_warning("Unable to connect to dbus: %s", error->message); - } - - if (error) - g_error_free(error); - } + DoMethodeCall + }; +static void busAcquired(GDBusConnection *connection, const gchar *name, gpointer user_data) +{ + auto id = g_dbus_connection_register_object(connection, + VIEWERAPI_PATH, + gBusNodeInfo->interfaces[0], + &interface_vtable, + NULL, /* user_data */ + NULL, /* user_data_free_func */ + NULL); /* GError** */ + g_assert (id > 0); } -gboolean viewer_app_api_GoSLURL(ViewerAppAPI *obj, gchar *slurl, gboolean **success_rtn, GError **error) +static void nameAcquired(GDBusConnection *connection, const gchar *name, gpointer user_data) { - bool success = false; - - LL_INFOS() << "Was asked to go to slurl: " << slurl << LL_ENDL; +} - std::string url = slurl; - LLMediaCtrl* web = NULL; - const bool trusted_browser = false; - if (LLURLDispatcher::dispatch(url, "", web, trusted_browser)) - { - // bring window to foreground, as it has just been "launched" from a URL - // todo: hmm, how to get there from here? - //xxx->mWindow->bringToFront(); - success = true; - } +static void nameLost(GDBusConnection *connection, const gchar *name, gpointer user_data) +{ - *success_rtn = g_new (gboolean, 1); - (*success_rtn)[0] = (gboolean)success; +} +void viewerappapi_init(ViewerAppAPI *server) +{ + gBusNodeInfo = g_dbus_node_info_new_for_xml (DBUS_SERVER, NULL); + g_assert (gBusNodeInfo != NULL); + + g_bus_own_name(G_BUS_TYPE_SESSION, + VIEWERAPI_SERVICE, + G_BUS_NAME_OWNER_FLAGS_NONE, + busAcquired, + nameAcquired, + nameLost, + NULL, + NULL); - return TRUE; // the invokation succeeded, even if the actual dispatch didn't. } /// @@ -260,13 +387,6 @@ gboolean viewer_app_api_GoSLURL(ViewerAppAPI *obj, gchar *slurl, gboolean **succ //virtual bool LLAppViewerLinux::initSLURLHandler() { - if (!grab_dbus_syms(DBUSGLIB_DYLIB_DEFAULT_NAME)) - { - return false; // failed - } - - g_type_init(); - //ViewerAppAPI *api_server = (ViewerAppAPI*) g_object_new(viewerappapi_get_type(), NULL); @@ -276,49 +396,49 @@ bool LLAppViewerLinux::initSLURLHandler() //virtual bool LLAppViewerLinux::sendURLToOtherInstance(const std::string& url) { - if (!grab_dbus_syms(DBUSGLIB_DYLIB_DEFAULT_NAME)) + auto *pBus = g_bus_get_sync(G_BUS_TYPE_SESSION, NULL, nullptr); + + if( !pBus ) { - return false; // failed + LL_WARNS() << "Getting dbus failed." << LL_ENDL; + return false; } - bool success = false; - DBusGConnection *bus; - GError *error = NULL; + auto pProxy = g_dbus_proxy_new_sync(pBus, G_DBUS_PROXY_FLAGS_NONE, nullptr, + VIEWERAPI_SERVICE, VIEWERAPI_PATH, + VIEWERAPI_INTERFACE, nullptr, nullptr); - g_type_init(); - - bus = lldbus_g_bus_get (DBUS_BUS_SESSION, &error); - if (bus) + if( !pProxy ) { - gboolean rtn = FALSE; - DBusGProxy *remote_object = - lldbus_g_proxy_new_for_name(bus, VIEWERAPI_SERVICE, VIEWERAPI_PATH, VIEWERAPI_INTERFACE); - - if (lldbus_g_proxy_call(remote_object, "GoSLURL", &error, - G_TYPE_STRING, url.c_str(), G_TYPE_INVALID, - G_TYPE_BOOLEAN, &rtn, G_TYPE_INVALID)) - { - success = rtn; - } - else - { - LL_INFOS() << "Call-out to other instance failed (perhaps not running): " << error->message << LL_ENDL; - } - - g_object_unref(G_OBJECT(remote_object)); + LL_WARNS() << "Cannot create new dbus proxy." << LL_ENDL; + g_object_unref( pBus ); + return false; } - else + + auto *pArgs = g_variant_new( "(s)", url.c_str() ); + if( !pArgs ) { - LL_WARNS() << "Couldn't connect to session bus: " << error->message << LL_ENDL; + LL_WARNS() << "Cannot create new variant." << LL_ENDL; + g_object_unref( pBus ); + return false; } - if (error) - g_error_free(error); + auto pRes = g_dbus_proxy_call_sync(pProxy, + "GoSLURL", + pArgs, + G_DBUS_CALL_FLAGS_NONE, + -1, nullptr, nullptr); - return success; + + + if( pRes ) + g_variant_unref( pRes ); + g_object_unref( pProxy ); + g_object_unref( pBus ); + return true; } -#else // LL_DBUS_ENABLED +#else // LL_GLIB bool LLAppViewerLinux::initSLURLHandler() { return false; // not implemented without dbus @@ -327,64 +447,10 @@ bool LLAppViewerLinux::sendURLToOtherInstance(const std::string& url) { return false; // not implemented without dbus } -#endif // LL_DBUS_ENABLED +#endif // LL_GLIB void LLAppViewerLinux::initCrashReporting(bool reportFreeze) { - std::string cmd =gDirUtilp->getExecutableDir(); - cmd += gDirUtilp->getDirDelimiter(); -#if LL_LINUX - cmd += "linux-crash-logger.bin"; -#else -# error Unknown platform -#endif - - std::stringstream pid_str; - pid_str << LLApp::getPid(); - std::string logdir = gDirUtilp->getExpandedFilename(LL_PATH_DUMP, ""); - std::string appname = gDirUtilp->getExecutableFilename(); - // launch the actual crash logger - const char * cmdargv[] = - {cmd.c_str(), - "-user", - (char*)LLGridManager::getInstance()->getGridId().c_str(), - "-name", - LLAppViewer::instance()->getSecondLifeTitle().c_str(), - "-pid", - pid_str.str().c_str(), - "-dumpdir", - logdir.c_str(), - "-procname", - appname.c_str(), - NULL}; - fflush(NULL); - - pid_t pid = fork(); - if (pid == 0) - { // child - execv(cmd.c_str(), (char* const*) cmdargv); /* Flawfinder: ignore */ - LL_WARNS() << "execv failure when trying to start " << cmd << LL_ENDL; - _exit(1); // avoid atexit() - } - else - { - if (pid > 0) - { - // DO NOT wait for child proc to die; we want - // the logger to outlive us while we quit to - // free up the screen/keyboard/etc. - ////int childExitStatus; - ////waitpid(pid, &childExitStatus, 0); - } - else - { - LL_WARNS() << "fork failure." << LL_ENDL; - } - } - // Sometimes signals don't seem to quit the viewer. Also, we may - // have been called explicitly instead of from a signal handler. - // Make sure we exit so as to not totally confuse the user. - //_exit(1); // avoid atexit(), else we may re-crash in dtors. } bool LLAppViewerLinux::beingDebugged() @@ -415,7 +481,7 @@ bool LLAppViewerLinux::beingDebugged() base += 1; } - if (strcmp(base, "gdb") == 0) + if (strcmp(base, "gdb") == 0 || strcmp(base, "lldb") == 0) { debugged = yes; } @@ -427,18 +493,6 @@ bool LLAppViewerLinux::beingDebugged() return debugged == yes; } -void LLAppViewerLinux::initLoggingAndGetLastDuration() -{ - // Remove the last stack trace, if any - // This file is no longer created, since the move to Google Breakpad - // The code is left here to clean out any old state in the log dir - std::string old_stack_file = - gDirUtilp->getExpandedFilename(LL_PATH_LOGS,"stack_trace.log"); - LLFile::remove(old_stack_file); - - LLAppViewer::initLoggingAndGetLastDuration(); -} - bool LLAppViewerLinux::initParseCommandLine(LLCommandLineParser& clp) { if (!clp.parseCommandLine(gArgC, gArgV)) diff --git a/indra/newview/llappviewerlinux.h b/indra/newview/llappviewerlinux.h index dde223878da..594bb64243d 100644 --- a/indra/newview/llappviewerlinux.h +++ b/indra/newview/llappviewerlinux.h @@ -27,64 +27,35 @@ #ifndef LL_LLAPPVIEWERLINUX_H #define LL_LLAPPVIEWERLINUX_H -extern "C" { -# include -} - -#if LL_DBUS_ENABLED -extern "C" { -# include -# include -} -#endif - #ifndef LL_LLAPPVIEWER_H #include "llappviewer.h" #endif class LLCommandLineParser; -class LLAppViewerLinux : public LLAppViewer +class LLAppViewerLinux final : public LLAppViewer { public: - LLAppViewerLinux(); - virtual ~LLAppViewerLinux(); + LLAppViewerLinux() = default; + ~LLAppViewerLinux() override = default; // // Main application logic // - virtual bool init(); // Override to do application initialization - std::string generateSerialNumber(); + bool init() override; // Override to do application initialization + std::string generateSerialNumber() override; bool setupSLURLHandler(); protected: - virtual bool beingDebugged(); + bool beingDebugged() override; - virtual bool restoreErrorTrap(); - virtual void initCrashReporting(bool reportFreeze); + bool restoreErrorTrap() override; + void initCrashReporting(bool reportFreeze); - virtual void initLoggingAndGetLastDuration(); - virtual bool initParseCommandLine(LLCommandLineParser& clp); + bool initParseCommandLine(LLCommandLineParser& clp) override; - virtual bool initSLURLHandler(); - virtual bool sendURLToOtherInstance(const std::string& url); + bool initSLURLHandler() override; + bool sendURLToOtherInstance(const std::string& url) override; }; -#if LL_DBUS_ENABLED -typedef struct -{ - GObject parent; - DBusGConnection *connection; -} ViewerAppAPI; - -extern "C" { - gboolean viewer_app_api_GoSLURL(ViewerAppAPI *obj, gchar *slurl, gboolean **success_rtn, GError **error); -} - -#define VIEWERAPI_SERVICE "com.secondlife.ViewerAppAPIService" -#define VIEWERAPI_PATH "/com/secondlife/ViewerAppAPI" -#define VIEWERAPI_INTERFACE "com.secondlife.ViewerAppAPI" - -#endif // LL_DBUS_ENABLED - #endif // LL_LLAPPVIEWERLINUX_H diff --git a/indra/newview/llappviewerlinux_api.h b/indra/newview/llappviewerlinux_api.h deleted file mode 100644 index 3d1324dd197..00000000000 --- a/indra/newview/llappviewerlinux_api.h +++ /dev/null @@ -1,143 +0,0 @@ -/* Generated by dbus-binding-tool; do not edit! */ -/** - * $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$ - */ - -#ifndef __dbus_glib_marshal_viewerapp_MARSHAL_H__ -#define __dbus_glib_marshal_viewerapp_MARSHAL_H__ - -#include - -G_BEGIN_DECLS - -#ifdef G_ENABLE_DEBUG -#define g_marshal_value_peek_boolean(v) g_value_get_boolean (v) -#define g_marshal_value_peek_char(v) g_value_get_char (v) -#define g_marshal_value_peek_uchar(v) g_value_get_uchar (v) -#define g_marshal_value_peek_int(v) g_value_get_int (v) -#define g_marshal_value_peek_uint(v) g_value_get_uint (v) -#define g_marshal_value_peek_long(v) g_value_get_long (v) -#define g_marshal_value_peek_ulong(v) g_value_get_ulong (v) -#define g_marshal_value_peek_int64(v) g_value_get_int64 (v) -#define g_marshal_value_peek_uint64(v) g_value_get_uint64 (v) -#define g_marshal_value_peek_enum(v) g_value_get_enum (v) -#define g_marshal_value_peek_flags(v) g_value_get_flags (v) -#define g_marshal_value_peek_float(v) g_value_get_float (v) -#define g_marshal_value_peek_double(v) g_value_get_double (v) -#define g_marshal_value_peek_string(v) (char*) g_value_get_string (v) -#define g_marshal_value_peek_param(v) g_value_get_param (v) -#define g_marshal_value_peek_boxed(v) g_value_get_boxed (v) -#define g_marshal_value_peek_pointer(v) g_value_get_pointer (v) -#define g_marshal_value_peek_object(v) g_value_get_object (v) -#else /* !G_ENABLE_DEBUG */ -/* WARNING: This code accesses GValues directly, which is UNSUPPORTED API. - * Do not access GValues directly in your code. Instead, use the - * g_value_get_*() functions - */ -#define g_marshal_value_peek_boolean(v) (v)->data[0].v_int -#define g_marshal_value_peek_char(v) (v)->data[0].v_int -#define g_marshal_value_peek_uchar(v) (v)->data[0].v_uint -#define g_marshal_value_peek_int(v) (v)->data[0].v_int -#define g_marshal_value_peek_uint(v) (v)->data[0].v_uint -#define g_marshal_value_peek_long(v) (v)->data[0].v_long -#define g_marshal_value_peek_ulong(v) (v)->data[0].v_ulong -#define g_marshal_value_peek_int64(v) (v)->data[0].v_int64 -#define g_marshal_value_peek_uint64(v) (v)->data[0].v_uint64 -#define g_marshal_value_peek_enum(v) (v)->data[0].v_long -#define g_marshal_value_peek_flags(v) (v)->data[0].v_ulong -#define g_marshal_value_peek_float(v) (v)->data[0].v_float -#define g_marshal_value_peek_double(v) (v)->data[0].v_double -#define g_marshal_value_peek_string(v) (v)->data[0].v_pointer -#define g_marshal_value_peek_param(v) (v)->data[0].v_pointer -#define g_marshal_value_peek_boxed(v) (v)->data[0].v_pointer -#define g_marshal_value_peek_pointer(v) (v)->data[0].v_pointer -#define g_marshal_value_peek_object(v) (v)->data[0].v_pointer -#endif /* !G_ENABLE_DEBUG */ - - -/* BOOLEAN:STRING,POINTER,POINTER (/tmp/dbus-binding-tool-c-marshallers.5XXD8T:1) */ -extern void dbus_glib_marshal_viewerapp_BOOLEAN__STRING_POINTER_POINTER (GClosure *closure, - GValue *return_value, - guint n_param_values, - const GValue *param_values, - gpointer invocation_hint, - gpointer marshal_data); -void -dbus_glib_marshal_viewerapp_BOOLEAN__STRING_POINTER_POINTER (GClosure *closure, - GValue *return_value, - guint n_param_values, - const GValue *param_values, - gpointer invocation_hint, - gpointer marshal_data) -{ - typedef gboolean (*GMarshalFunc_BOOLEAN__STRING_POINTER_POINTER) (gpointer data1, - gpointer arg_1, - gpointer arg_2, - gpointer arg_3, - gpointer data2); - register GMarshalFunc_BOOLEAN__STRING_POINTER_POINTER callback; - register GCClosure *cc = (GCClosure*) closure; - register gpointer data1, data2; - gboolean v_return; - - g_return_if_fail (return_value != NULL); - g_return_if_fail (n_param_values == 4); - - if (G_CCLOSURE_SWAP_DATA (closure)) - { - data1 = closure->data; - data2 = g_value_peek_pointer (param_values + 0); - } - else - { - data1 = g_value_peek_pointer (param_values + 0); - data2 = closure->data; - } - callback = (GMarshalFunc_BOOLEAN__STRING_POINTER_POINTER) (marshal_data ? marshal_data : cc->callback); - - v_return = callback (data1, - g_marshal_value_peek_string (param_values + 1), - g_marshal_value_peek_pointer (param_values + 2), - g_marshal_value_peek_pointer (param_values + 3), - data2); - - g_value_set_boolean (return_value, v_return); -} - -G_END_DECLS - -#endif /* __dbus_glib_marshal_viewerapp_MARSHAL_H__ */ - -#include -static const DBusGMethodInfo dbus_glib_viewerapp_methods[] = { - { (GCallback) viewer_app_api_GoSLURL, dbus_glib_marshal_viewerapp_BOOLEAN__STRING_POINTER_POINTER, 0 }, -}; - -const DBusGObjectInfo dbus_glib_viewerapp_object_info = { - 0, - dbus_glib_viewerapp_methods, - 1, -"com.secondlife.ViewerAppAPI\0GoSLURL\0S\0slurl\0I\0s\0success_ret\0O\0F\0N\0b\0\0\0", -"\0", -"\0" -}; - diff --git a/indra/newview/llappviewerlinux_api.xml b/indra/newview/llappviewerlinux_api.xml deleted file mode 100644 index fac35b7adc8..00000000000 --- a/indra/newview/llappviewerlinux_api.xml +++ /dev/null @@ -1,14 +0,0 @@ - - - - - - - - - - - - - - diff --git a/indra/newview/llappviewerlinux_api_dbus.cpp b/indra/newview/llappviewerlinux_api_dbus.cpp deleted file mode 100644 index 9aed8a98d44..00000000000 --- a/indra/newview/llappviewerlinux_api_dbus.cpp +++ /dev/null @@ -1,126 +0,0 @@ -/** - * @file llappviewerlinux_api_dbus.cpp - * @brief dynamic DBus symbol-grabbing code - * - * $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$ - */ - -#if LL_DBUS_ENABLED - -#include "linden_common.h" - -extern "C" { -#include - -#include "apr_pools.h" -#include "apr_dso.h" -} - -#define DEBUGMSG(...) do { LL_DEBUGS() << llformat(__VA_ARGS__) << LL_ENDL; } while(0) -#define INFOMSG(...) do { LL_INFOS() << llformat(__VA_ARGS__) << LL_ENDL; } while(0) -#define WARNMSG(...) do { LL_WARNS() << llformat(__VA_ARGS__) << LL_ENDL; } while(0) - -#define LL_DBUS_SYM(REQUIRED, DBUSSYM, RTN, ...) RTN (*ll##DBUSSYM)(__VA_ARGS__) = NULL -#include "llappviewerlinux_api_dbus_syms_raw.inc" -#undef LL_DBUS_SYM - -static bool sSymsGrabbed = false; -static apr_pool_t *sSymDBUSDSOMemoryPool = NULL; -static apr_dso_handle_t *sSymDBUSDSOHandleG = NULL; - -bool grab_dbus_syms(std::string dbus_dso_name) -{ - if (sSymsGrabbed) - { - // already have grabbed good syms - return true; - } - - bool sym_error = false; - bool rtn = false; - apr_status_t rv; - apr_dso_handle_t *sSymDBUSDSOHandle = NULL; - -#define LL_DBUS_SYM(REQUIRED, DBUSSYM, RTN, ...) do{rv = apr_dso_sym((apr_dso_handle_sym_t*)&ll##DBUSSYM, sSymDBUSDSOHandle, #DBUSSYM); if (rv != APR_SUCCESS) {INFOMSG("Failed to grab symbol: %s", #DBUSSYM); if (REQUIRED) sym_error = true;} else DEBUGMSG("grabbed symbol: %s from %p", #DBUSSYM, (void*)ll##DBUSSYM);}while(0) - - //attempt to load the shared library - apr_pool_create(&sSymDBUSDSOMemoryPool, NULL); - - if ( APR_SUCCESS == (rv = apr_dso_load(&sSymDBUSDSOHandle, - dbus_dso_name.c_str(), - sSymDBUSDSOMemoryPool) )) - { - INFOMSG("Found DSO: %s", dbus_dso_name.c_str()); - -#include "llappviewerlinux_api_dbus_syms_raw.inc" - - if ( sSymDBUSDSOHandle ) - { - sSymDBUSDSOHandleG = sSymDBUSDSOHandle; - sSymDBUSDSOHandle = NULL; - } - - rtn = !sym_error; - } - else - { - INFOMSG("Couldn't load DSO: %s", dbus_dso_name.c_str()); - rtn = false; // failure - } - - if (sym_error) - { - WARNMSG("Failed to find necessary symbols in DBUS-GLIB libraries."); - } -#undef LL_DBUS_SYM - - sSymsGrabbed = rtn; - return rtn; -} - - -void ungrab_dbus_syms() -{ - // should be safe to call regardless of whether we've - // actually grabbed syms. - - if ( sSymDBUSDSOHandleG ) - { - apr_dso_unload(sSymDBUSDSOHandleG); - sSymDBUSDSOHandleG = NULL; - } - - if ( sSymDBUSDSOMemoryPool ) - { - apr_pool_destroy(sSymDBUSDSOMemoryPool); - sSymDBUSDSOMemoryPool = NULL; - } - - // NULL-out all of the symbols we'd grabbed -#define LL_DBUS_SYM(REQUIRED, DBUSSYM, RTN, ...) do{ll##DBUSSYM = NULL;}while(0) -#include "llappviewerlinux_api_dbus_syms_raw.inc" -#undef LL_DBUS_SYM - - sSymsGrabbed = false; -} - -#endif // LL_DBUS_ENABLED diff --git a/indra/newview/llappviewerlinux_api_dbus_syms_raw.inc b/indra/newview/llappviewerlinux_api_dbus_syms_raw.inc deleted file mode 100644 index c0548e2fba2..00000000000 --- a/indra/newview/llappviewerlinux_api_dbus_syms_raw.inc +++ /dev/null @@ -1,9 +0,0 @@ - -// required symbols to grab -LL_DBUS_SYM(true, dbus_g_bus_get, DBusGConnection*, DBusBusType, GError**); -LL_DBUS_SYM(true, dbus_g_proxy_new_for_name, DBusGProxy*, DBusGConnection*, const char *, const char*, const char*); -LL_DBUS_SYM(true, dbus_g_proxy_call, gboolean, DBusGProxy*, const char*, GError**, GType, ...); -LL_DBUS_SYM(true, dbus_g_object_type_install_info, void, GType, const DBusGObjectInfo*); -LL_DBUS_SYM(true, dbus_g_connection_register_g_object, void, DBusGConnection*, const char*, GObject*); - -// optional symbols to grab diff --git a/indra/newview/llappviewerlistener.h b/indra/newview/llappviewerlistener.h index 5ade3d3e042..8686d6522e0 100644 --- a/indra/newview/llappviewerlistener.h +++ b/indra/newview/llappviewerlistener.h @@ -30,7 +30,7 @@ #define LL_LLAPPVIEWERLISTENER_H #include "lleventapi.h" -#include +#include class LLAppViewer; class LLSD; @@ -39,7 +39,7 @@ class LLSD; class LLAppViewerListener: public LLEventAPI { public: - typedef boost::function LLAppViewerGetter; + typedef std::function LLAppViewerGetter; /// Bind the LLAppViewer instance to use (e.g. LLAppViewer::instance()). LLAppViewerListener(const LLAppViewerGetter& getter); diff --git a/indra/newview/llappviewerwin32.cpp b/indra/newview/llappviewerwin32.cpp index 64b506a3353..d6ea462b890 100644 --- a/indra/newview/llappviewerwin32.cpp +++ b/indra/newview/llappviewerwin32.cpp @@ -72,6 +72,8 @@ #include #include +#include "llversioninfovars.h" + // Bugsplat (http://bugsplat.com) crash reporting tool #ifdef LL_BUGSPLAT #include "BugSplat.h" @@ -176,7 +178,7 @@ namespace LLAppViewer* app = LLAppViewer::instance(); if (!app->isSecondInstance() && !app->errorMarkerExists()) { - // If marker doesn't exist, create a marker with 'other' code for next launch + // If marker doesn't exist, create a marker with 'other' or 'logout' code for next launch // otherwise don't override existing file // Any unmarked crashes will be considered as freezes if (app->logoutRequestSent()) diff --git a/indra/newview/llavatarpropertiesprocessor.cpp b/indra/newview/llavatarpropertiesprocessor.cpp index 7dce6270445..9d9948731fa 100644 --- a/indra/newview/llavatarpropertiesprocessor.cpp +++ b/indra/newview/llavatarpropertiesprocessor.cpp @@ -269,11 +269,11 @@ void LLAvatarPropertiesProcessor::requestAvatarPropertiesCoro(std::string cap_ur LLCore::HttpRequest::policy_t httpPolicy(LLCore::HttpRequest::DEFAULT_POLICY_ID); LLCoreHttpUtil::HttpCoroutineAdapter::ptr_t - httpAdapter(new LLCoreHttpUtil::HttpCoroutineAdapter("requestAvatarPropertiesCoro", httpPolicy)); - LLCore::HttpRequest::ptr_t httpRequest(new LLCore::HttpRequest); + httpAdapter = std::make_shared("requestAvatarPropertiesCoro", httpPolicy); + LLCore::HttpRequest::ptr_t httpRequest = std::make_shared(); LLCore::HttpHeaders::ptr_t httpHeaders; - LLCore::HttpOptions::ptr_t httpOpts(new LLCore::HttpOptions); + LLCore::HttpOptions::ptr_t httpOpts = std::make_shared(); httpOpts->setFollowRedirects(true); std::string finalUrl = cap_url + "/" + avatar_id.asString(); diff --git a/indra/newview/llavatarrenderinfoaccountant.cpp b/indra/newview/llavatarrenderinfoaccountant.cpp index 44f35981b01..309bed6f8b2 100644 --- a/indra/newview/llavatarrenderinfoaccountant.cpp +++ b/indra/newview/llavatarrenderinfoaccountant.cpp @@ -77,9 +77,9 @@ void LLAvatarRenderInfoAccountant::avatarRenderInfoGetCoro(std::string url, U64 { LLCore::HttpRequest::policy_t httpPolicy(LLCore::HttpRequest::DEFAULT_POLICY_ID); LLCoreHttpUtil::HttpCoroutineAdapter::ptr_t - httpAdapter(new LLCoreHttpUtil::HttpCoroutineAdapter("AvatarRenderInfoAccountant", httpPolicy)); - LLCore::HttpRequest::ptr_t httpRequest(new LLCore::HttpRequest); - LLCore::HttpOptions::ptr_t httpOpts(new LLCore::HttpOptions); + httpAdapter = std::make_shared("AvatarRenderInfoAccountant", httpPolicy); + LLCore::HttpRequest::ptr_t httpRequest = std::make_shared(); + LLCore::HttpOptions::ptr_t httpOpts = std::make_shared(); // Going to request each 15 seconds either way, so don't wait // too long and don't repeat @@ -194,9 +194,9 @@ void LLAvatarRenderInfoAccountant::avatarRenderInfoReportCoro(std::string url, U { LLCore::HttpRequest::policy_t httpPolicy(LLCore::HttpRequest::DEFAULT_POLICY_ID); LLCoreHttpUtil::HttpCoroutineAdapter::ptr_t - httpAdapter(new LLCoreHttpUtil::HttpCoroutineAdapter("AvatarRenderInfoAccountant", httpPolicy)); - LLCore::HttpRequest::ptr_t httpRequest(new LLCore::HttpRequest); - LLCore::HttpOptions::ptr_t httpOpts(new LLCore::HttpOptions); + httpAdapter = std::make_shared("AvatarRenderInfoAccountant", httpPolicy); + LLCore::HttpRequest::ptr_t httpRequest = std::make_shared(); + LLCore::HttpOptions::ptr_t httpOpts = std::make_shared(); // Going to request each 60+ seconds, timeout is 30s. // Don't repeat too often, will be sending newer data soon diff --git a/indra/newview/llchiclet.h b/indra/newview/llchiclet.h index 5114c97beb4..c19f7dc1c10 100644 --- a/indra/newview/llchiclet.h +++ b/indra/newview/llchiclet.h @@ -187,7 +187,7 @@ class LLChiclet : public LLUICtrl /*virtual*/ boost::signals2::connection setLeftButtonClickCallback( const commit_callback_t& cb); - typedef boost::function + typedef std::function chiclet_size_changed_callback_t; /** diff --git a/indra/newview/llcofwearables.h b/indra/newview/llcofwearables.h index 6f0e97a98b9..b349f35921e 100644 --- a/indra/newview/llcofwearables.h +++ b/indra/newview/llcofwearables.h @@ -54,7 +54,7 @@ class LLCOFWearables : public LLPanel LLCOFCallbacks() {}; virtual ~LLCOFCallbacks() {}; - typedef boost::function cof_callback_t; + typedef std::function cof_callback_t; cof_callback_t mAddWearable; cof_callback_t mMoveWearableCloser; diff --git a/indra/newview/llcommandlineparser.cpp b/indra/newview/llcommandlineparser.cpp index f21bae98057..0734b125313 100644 --- a/indra/newview/llcommandlineparser.cpp +++ b/indra/newview/llcommandlineparser.cpp @@ -32,7 +32,6 @@ #include #include #include -#include #include "llsdserialize.h" #include "llerror.h" @@ -61,14 +60,7 @@ namespace // List of command-line switches that can't map-to settings variables. // Going forward, we want every new command-line switch to map-to some // settings variable. This list is used to validate that. - const std::set unmapped_options = boost::assign::list_of - ("help") - ("set") - ("setdefault") - ("settings") - ("sessionsettings") - ("usersessionsettings") - ; + const std::set unmapped_options = { "help", "set", "setdefault", "settings", "sessionsettings", "usersessionsettings" }; po::options_description gOptionsDesc; po::positional_options_description gPositionalOptions; @@ -101,7 +93,7 @@ class LLCLPValue : public po::value_semantic_codecvt_helper unsigned mMinTokens; unsigned mMaxTokens; bool mIsComposing; - typedef boost::function1 notify_callback_t; + typedef std::function notify_callback_t; notify_callback_t mNotifyCallback; bool mLastOption; @@ -226,7 +218,7 @@ class LLCLPValue : public po::value_semantic_codecvt_helper // LLCommandLineParser defintions //---------------------------------------------------------------------------- void LLCommandLineParser::addOptionDesc(const std::string& option_name, - boost::function1 notify_callback, + std::function notify_callback, unsigned int token_count, const std::string& description, const std::string& short_name, @@ -255,7 +247,7 @@ void LLCommandLineParser::addOptionDesc(const std::string& option_name, value_desc, description.c_str())); - if(!notify_callback.empty()) + if(notify_callback) { value_desc->setNotifyCallback(notify_callback); } @@ -693,7 +685,7 @@ void LLControlGroupCLP::configure(const std::string& config_filename, LLControlG last_option = option_params["last_option"].asBoolean(); } - boost::function1 callback; + std::function callback; if (! option_params.has("map-to")) { // If this option isn't mapped to a settings variable, is it diff --git a/indra/newview/llcommandlineparser.h b/indra/newview/llcommandlineparser.h index 5279d02c0a5..984bcfbad0f 100644 --- a/indra/newview/llcommandlineparser.h +++ b/indra/newview/llcommandlineparser.h @@ -27,7 +27,7 @@ #ifndef LL_LLCOMMANDLINEPARSER_H #define LL_LLCOMMANDLINEPARSER_H -#include +#include // *NOTE:Mani The following is a forward decl of // boost::program_options::command_line_parser @@ -58,7 +58,7 @@ class LLCommandLineParser */ void addOptionDesc( const std::string& option_name, - boost::function1 notify_callback = 0, + std::function notify_callback = nullptr, unsigned int num_tokens = 0, const std::string& description = LLStringUtil::null, const std::string& short_name = LLStringUtil::null, @@ -121,7 +121,7 @@ class LLCommandLineParser * The parser_func takes an input string, and should return a * name/value pair as the result. */ - typedef boost::function1, const std::string&> parser_func; + typedef std::function(const std::string&)> parser_func; void setCustomParser(parser_func f) { mExtraParser = f; } private: diff --git a/indra/newview/llcompilequeue.cpp b/indra/newview/llcompilequeue.cpp index 552ea75559a..993b30a014e 100644 --- a/indra/newview/llcompilequeue.cpp +++ b/indra/newview/llcompilequeue.cpp @@ -122,9 +122,9 @@ namespace class LLQueuedScriptAssetUpload : public LLScriptAssetUpload { public: - LLQueuedScriptAssetUpload(LLUUID taskId, LLUUID itemId, LLUUID assetId, TargetType_t targetType, + LLQueuedScriptAssetUpload(LLUUID taskId, LLUUID itemId, LLUUID assetId, std::string compileTarget, bool isRunning, std::string scriptName, LLUUID queueId, LLUUID exerienceId, taskUploadFinish_f finish) : - LLScriptAssetUpload(taskId, itemId, targetType, isRunning, + LLScriptAssetUpload(taskId, itemId, compileTarget, isRunning, exerienceId, std::string(), finish, nullptr), mScriptName(scriptName), mQueueId(queueId) @@ -183,9 +183,7 @@ struct LLScriptQueueData // Default constructor LLFloaterScriptQueue::LLFloaterScriptQueue(const LLSD& key) : - LLFloater(key), - mDone(false), - mMono(false) + LLFloater(key) { } @@ -197,7 +195,7 @@ LLFloaterScriptQueue::~LLFloaterScriptQueue() bool LLFloaterScriptQueue::postBuild() { - childSetAction("close",onCloseBtn,this); + childSetAction("close", onCloseBtn, this); getChildView("close")->setEnabled(false); setVisible(true); return true; @@ -222,8 +220,8 @@ bool LLFloaterScriptQueue::start() LLStringUtil::format_map_t args; args["[START]"] = mStartString; - args["[COUNT]"] = llformat ("%d", mObjectList.size()); - buffer = getString ("Starting", args); + args["[COUNT]"] = llformat("%d", mObjectList.size()); + buffer = getString("Starting", args); getChild("queue output")->addSimpleElement(buffer, ADD_BOTTOM); @@ -276,8 +274,8 @@ bool LLFloaterCompileQueue::hasExperience( const LLUUID& id ) const return mExperienceIds.find(id) != mExperienceIds.end(); } -// //Attempt to record this asset ID. If it can not be inserted into the set -// //then it has already been processed so return false. +// Attempt to record this asset ID. If it can not be inserted into the set +// then it has already been processed so return false. void LLFloaterCompileQueue::handleHTTPResponse(std::string pumpName, const LLSD &expresult) { @@ -359,7 +357,7 @@ bool LLFloaterCompileQueue::processScript(LLHandle hfloat LLCheckedHandle floater(hfloater); // Dereferencing floater may fail. If they do they throw LLExeceptionStaleHandle. // which is caught in objectScriptProcessingQueueCoro - bool monocompile = floater->mMono; + std::string compile_target = floater->mCompileTarget; // Initial test to see if we can (or should) attempt to compile the script. LLInventoryItem *item = dynamic_cast(inventory); @@ -467,15 +465,15 @@ bool LLFloaterCompileQueue::processScript(LLHandle hfloat std::string url = object->getRegion()->getCapability("UpdateScriptTask"); { - LLResourceUploadInfo::ptr_t uploadInfo(new LLQueuedScriptAssetUpload(object->getID(), + LLResourceUploadInfo::ptr_t uploadInfo = std::make_shared(object->getID(), inventory->getUUID(), assetId, - monocompile ? LLScriptAssetUpload::MONO : LLScriptAssetUpload::LSL2, + compile_target, true, inventory->getName(), LLUUID(), experienceId, - boost::bind(&LLFloaterCompileQueue::handleHTTPResponse, pump.getName(), _4))); + boost::bind(&LLFloaterCompileQueue::handleHTTPResponse, pump.getName(), _4)); LLViewerAssetUpload::EnqueueInventoryUpload(url, uploadInfo); } diff --git a/indra/newview/llcompilequeue.h b/indra/newview/llcompilequeue.h index 951d4800e8c..8832d76ea4d 100644 --- a/indra/newview/llcompilequeue.h +++ b/indra/newview/llcompilequeue.h @@ -55,7 +55,7 @@ class LLFloaterScriptQueue : public LLFloater/*, public LLVOInventoryListener*/ /*virtual*/ bool postBuild(); - void setMono(bool mono) { mMono = mono; } + void setCompileTarget(std::string target) { mCompileTarget = target; } // addObject() accepts an object id. void addObject(const LLUUID& id, std::string name); @@ -80,8 +80,8 @@ class LLFloaterScriptQueue : public LLFloater/*, public LLVOInventoryListener*/ protected: // UI - LLScrollListCtrl* mMessages; - LLButton* mCloseBtn; + LLScrollListCtrl* mMessages { nullptr }; + LLButton* mCloseBtn { nullptr }; // Object Queue struct ObjectData @@ -93,14 +93,13 @@ class LLFloaterScriptQueue : public LLFloater/*, public LLVOInventoryListener*/ object_data_list_t mObjectList; LLUUID mCurrentObjectID; - bool mDone; + bool mDone { false }; std::string mStartString; - bool mMono; + std::string mCompileTarget { "lsl2" }; - typedef boost::function &, LLInventoryObject*, LLEventPump &)> fnQueueAction_t; + typedef std::function &, LLInventoryObject*, LLEventPump &)> fnQueueAction_t; static void objectScriptProcessingQueueCoro(std::string action, LLHandle hfloater, object_data_list_t objectList, fnQueueAction_t func); - }; //~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ diff --git a/indra/newview/llconversationlog.cpp b/indra/newview/llconversationlog.cpp index 65a068e08d3..4a4985d8ac2 100644 --- a/indra/newview/llconversationlog.cpp +++ b/indra/newview/llconversationlog.cpp @@ -157,7 +157,10 @@ void LLConversation::setListenIMFloaterOpened() // if floater is already opened or this conversation doesn't have unread offline messages if (mHasOfflineIMs && !offline_ims_visible) { - mIMFloaterShowedConnection = LLFloaterIMSession::setIMFloaterShowedCallback(boost::bind(&LLConversation::onIMFloaterShown, this, _1)); + mIMFloaterShowedConnection = LLFloaterIMSession::setIMFloaterShowedCallback([this](const LLUUID& session_id) + { + onIMFloaterShown(session_id); + }); } else { diff --git a/indra/newview/llconversationloglistitem.cpp b/indra/newview/llconversationloglistitem.cpp index 20d5b0175be..e21a772f671 100644 --- a/indra/newview/llconversationloglistitem.cpp +++ b/indra/newview/llconversationloglistitem.cpp @@ -53,7 +53,10 @@ LLConversationLogListItem::LLConversationLogListItem(const LLConversation* conve if (mConversation->hasOfflineMessages() && !ims_are_read) { - mIMFloaterShowedConnection = LLFloaterIMSession::setIMFloaterShowedCallback(boost::bind(&LLConversationLogListItem::onIMFloaterShown, this, _1)); + mIMFloaterShowedConnection = LLFloaterIMSession::setIMFloaterShowedCallback([this](const LLUUID& session_id) + { + onIMFloaterShown(session_id); + }); } } diff --git a/indra/newview/lldirpicker.cpp b/indra/newview/lldirpicker.cpp index e967ff3df29..2dba778e245 100644 --- a/indra/newview/lldirpicker.cpp +++ b/indra/newview/lldirpicker.cpp @@ -37,6 +37,10 @@ #include "llviewercontrol.h" #include "llwin32headers.h" +#if LL_SDL_WINDOW +#include "SDL3/SDL.h" +#endif + #if LL_LINUX || LL_DARWIN # include "llfilepicker.h" #endif @@ -65,7 +69,103 @@ bool LLDirPicker::check_local_file_access_enabled() return true; } -#if LL_WINDOWS +#if LL_SDL_WINDOW + +LLDirPicker::LLDirPicker() : + mFileName(NULL), + mLocked(false) +{ + reset(); +} + +LLDirPicker::~LLDirPicker() +{ +} + +void LLDirPicker::reset() +{ +} + +bool LLDirPicker::getDir(std::string* filename, bool blocking) +{ + return false; +} + +std::string LLDirPicker::getDirName() +{ + return {}; +} + +bool LLDirPicker::getDirModeless(std::string* filename, + void (*callback)(bool, std::string&, void*), + void* userdata) +{ + if (mLocked) + { + return false; + } + + // if local file browsing is turned off, return without opening dialog + if (!check_local_file_access_enabled()) + { + return false; + } + + { + struct LLSDLFileUserdata + { + LLSDLFileUserdata(void (*callback_func)(bool, std::string&, void*), void* callback_userdata) + : mCallback(callback_func), mUserdata(callback_userdata) + { + } + void (*mCallback)(bool, std::string&, void*); + void* mUserdata; + }; + + auto sdl_callback = [](void* userdata, const char* const* filelist, int filter) + { + LLSDLFileUserdata* callback_struct = (LLSDLFileUserdata*)userdata; + + auto* callback_func = callback_struct->mCallback; + auto* callback_data = callback_struct->mUserdata; + delete callback_struct; // delete callback container + + std::string rtn; + if (!filelist) + { + LL_WARNS() << "Error during SDL folder picking: " << SDL_GetError() << LL_ENDL; + callback_func(false, rtn, callback_data); + return; + } + else if (!*filelist) + { + LL_INFOS() << "User did not select any folders. Dialog likely cancelled." << LL_ENDL; + callback_func(false, rtn, callback_data); + return; + } + + while (*filelist) { + rtn = std::string(*filelist); + break; + } + callback_func(true, rtn, callback_data); + + }; + + LLSDLFileUserdata* llfilecallback = new LLSDLFileUserdata(callback, userdata); + + SDL_PropertiesID props = SDL_CreateProperties(); + SDL_SetPointerProperty(props, SDL_PROP_FILE_DIALOG_WINDOW_POINTER, SDL_GL_GetCurrentWindow()); + SDL_ShowFileDialogWithProperties(SDL_FILEDIALOG_OPENFOLDER, sdl_callback, llfilecallback, props); + + SDL_DestroyProperties(props); + } + + return true; +} + + +#elif LL_WINDOWS LLDirPicker::LLDirPicker() : mFileName(NULL), @@ -167,6 +267,13 @@ bool LLDirPicker::getDir(std::string* filename, bool blocking) return success; } +bool LLDirPicker::getDirModeless(std::string* filename, + void (*callback)(bool, std::string&, void*), + void* userdata) +{ + return false; +} + std::string LLDirPicker::getDirName() { return mDir; @@ -195,7 +302,6 @@ void LLDirPicker::reset() } -//static bool LLDirPicker::getDir(std::string* filename, bool blocking) { LLFilePicker::ELoadFilter filter=LLFilePicker::FFLOAD_DIRECTORY; @@ -203,6 +309,13 @@ bool LLDirPicker::getDir(std::string* filename, bool blocking) return mFilePicker->getOpenFile(filter, true); } +bool LLDirPicker::getDirModeless(std::string* filename, + void (*callback)(bool, std::string&, void*), + void* userdata) +{ + return false; +} + std::string LLDirPicker::getDirName() { return mFilePicker->getFirstFile(); @@ -240,23 +353,13 @@ bool LLDirPicker::getDir(std::string* filename, bool blocking) return false; } -#if !LL_MESA_HEADLESS - - if (mFilePicker) - { - GtkWindow* picker = mFilePicker->buildFilePicker(false, true, - "dirpicker"); - - if (picker) - { - gtk_window_set_title(GTK_WINDOW(picker), LLTrans::getString("choose_the_directory").c_str()); - gtk_widget_show_all(GTK_WIDGET(picker)); - gtk_main(); - return (!mFilePicker->getFirstFile().empty()); - } - } -#endif // !LL_MESA_HEADLESS + return false; +} +bool LLDirPicker::getDirModeless(std::string* filename, + void (*callback)(bool, std::string&, void*), + void* userdata) +{ return false; } @@ -290,6 +393,13 @@ bool LLDirPicker::getDir(std::string* filename, bool blocking) return false; } +bool LLDirPicker::getDirModeless(std::string* filename, + void (*callback)(bool, std::string&, void*), + void* userdata) +{ + return false; +} + std::string LLDirPicker::getDirName() { return ""; @@ -303,7 +413,9 @@ std::queue LLDirPickerThread::sDeadQ; void LLDirPickerThread::getFile() { -#if LL_WINDOWS +#if LL_SDL_WINDOW + runModeless(); +#elif LL_WINDOWS start(); #else run(); @@ -333,6 +445,32 @@ void LLDirPickerThread::run() } +void LLDirPickerThread::runModeless() +{ + LLDirPicker picker; + bool result = picker.getDirModeless(&mProposedName, modelessStringCallback, this); + if (!result) + { + LLMutexLock lock(sMutex); + sDeadQ.push(this); + } +} + +void LLDirPickerThread::modelessStringCallback(bool success, + std::string& response, + void* user_data) +{ + LLDirPickerThread* picker = (LLDirPickerThread*)user_data; + { + LLMutexLock lock(sMutex); + if (success) + { + picker->mResponses.push_back(response); + } + sDeadQ.push(picker); + } +} + //static void LLDirPickerThread::initClass() { diff --git a/indra/newview/lldirpicker.h b/indra/newview/lldirpicker.h index dc740caab27..c3619f91f54 100644 --- a/indra/newview/lldirpicker.h +++ b/indra/newview/lldirpicker.h @@ -58,6 +58,9 @@ class LLDirPicker { public: bool getDir(std::string* filename, bool blocking = true); + bool getDirModeless(std::string* filename, + void (*callback)(bool, std::string&, void*), + void* userdata); std::string getDirName(); // clear any lists of buffers or whatever, and make sure the dir @@ -116,6 +119,11 @@ class LLDirPickerThread : public LLThread virtual void run(); + void runModeless(); + static void modelessStringCallback(bool success, + std::string& response, + void* user_data); + virtual void notify(const std::vector& filenames); private: diff --git a/indra/newview/lldndbutton.h b/indra/newview/lldndbutton.h index 277c2aad69b..d503b367e1c 100644 --- a/indra/newview/lldndbutton.h +++ b/indra/newview/lldndbutton.h @@ -47,7 +47,7 @@ class LLDragAndDropButton : public LLButton LLDragAndDropButton(const Params& params); - typedef boost::functiongetOrigin(); LLVector3 cam_to_box_offset = point_to_box_offset(cam_pos_from_agent, av_box); mDistanceWRTCamera = llmax(0.01f, ll_round(cam_to_box_offset.magVec(), 0.01f)); - mVObjp->updateLOD(); + if (mVObjp) + { + mVObjp->updateLOD(); + } return; } } @@ -936,7 +939,10 @@ void LLDrawable::updateDistance(LLCamera& camera, bool force_update) pos -= camera.getOrigin(); mDistanceWRTCamera = ll_round(pos.magVec(), 0.01f); - mVObjp->updateLOD(); + if (mVObjp) + { + mVObjp->updateLOD(); + } } } @@ -948,6 +954,11 @@ void LLDrawable::updateTexture() return; } + if (!mVObjp) + { + return; + } + if (getNumFaces() != mVObjp->getNumTEs()) { //drawable is transitioning its face count return; diff --git a/indra/newview/lldrawable.h b/indra/newview/lldrawable.h index a7ac9da6186..8af044990fb 100644 --- a/indra/newview/lldrawable.h +++ b/indra/newview/lldrawable.h @@ -59,25 +59,15 @@ class LLViewerTexture; const U32 SILHOUETTE_HIGHLIGHT = 0; // All data for new renderer goes into this class. -LL_ALIGN_PREFIX(16) -class LLDrawable +class alignas(16) LLDrawable : public LLViewerOctreeEntryData { LL_ALIGN_NEW; public: typedef std::vector face_list_t; - LLDrawable(const LLDrawable& rhs) - : LLViewerOctreeEntryData(rhs) - { - *this = rhs; - } - - const LLDrawable& operator=(const LLDrawable& rhs) - { - LL_ERRS() << "Illegal operation!" << LL_ENDL; - return *this; - } + LLDrawable(const LLDrawable& rhs) = delete; + const LLDrawable& operator=(const LLDrawable& rhs) = delete; static void initClass(); @@ -313,7 +303,7 @@ class LLDrawable static U32 sNumZombieDrawables; static std::vector > sDeadList; -} LL_ALIGN_POSTFIX(16); +}; inline LLFace* LLDrawable::getFace(const S32 i) const diff --git a/indra/newview/lldrawpool.cpp b/indra/newview/lldrawpool.cpp index e60b3eb5dc5..3eca6059ed0 100644 --- a/indra/newview/lldrawpool.cpp +++ b/indra/newview/lldrawpool.cpp @@ -369,7 +369,7 @@ void LLFacePool::LLOverrideFaceColor::setColor(const LLColor4& color) void LLFacePool::LLOverrideFaceColor::setColor(const LLColor4U& color) { - glColor4ubv(color.mV); + gGL.diffuseColor4ubv(color.mV); } void LLFacePool::LLOverrideFaceColor::setColor(F32 r, F32 g, F32 b, F32 a) diff --git a/indra/newview/lldrawpoolalpha.cpp b/indra/newview/lldrawpoolalpha.cpp index 87b6ce6cb3a..bc45734e667 100644 --- a/indra/newview/lldrawpoolalpha.cpp +++ b/indra/newview/lldrawpoolalpha.cpp @@ -278,7 +278,7 @@ void LLDrawPoolAlpha::forwardRender(bool rigged) void LLDrawPoolAlpha::renderDebugAlpha() { - if (sShowDebugAlpha) + if (sShowDebugAlpha && !gCubeSnapshot) { gHighlightProgram.bind(); gGL.diffuseColor4f(1, 0, 0, 1); diff --git a/indra/newview/lldrawpoolavatar.cpp b/indra/newview/lldrawpoolavatar.cpp index 90ee95d424b..f0f589e7f45 100644 --- a/indra/newview/lldrawpoolavatar.cpp +++ b/indra/newview/lldrawpoolavatar.cpp @@ -794,7 +794,7 @@ void LLDrawPoolAvatar::renderAvatars(LLVOAvatar* single_avatar, S32 pass) return; } - if ((sShaderLevel >= SHADER_LEVEL_CLOTH)) + if (LLPipeline::RenderAvatarCloth) { LLMatrix4 rot_mat; LLViewerCamera::getInstance()->getMatrixToLocal(rot_mat); diff --git a/indra/newview/lldrawpoolavatar.h b/indra/newview/lldrawpoolavatar.h index 1a53861a03d..87a87e225ea 100644 --- a/indra/newview/lldrawpoolavatar.h +++ b/indra/newview/lldrawpoolavatar.h @@ -44,12 +44,6 @@ extern U32 gFrameCount; class LLDrawPoolAvatar : public LLFacePool { public: - enum - { - SHADER_LEVEL_BUMP = 2, - SHADER_LEVEL_CLOTH = 3 - }; - enum { VERTEX_DATA_MASK = LLVertexBuffer::MAP_VERTEX | diff --git a/indra/newview/lldrawpoolbump.cpp b/indra/newview/lldrawpoolbump.cpp index 69003f88fd5..6c151351ff9 100644 --- a/indra/newview/lldrawpoolbump.cpp +++ b/indra/newview/lldrawpoolbump.cpp @@ -55,8 +55,6 @@ // static LLStandardBumpmap gStandardBumpmapList[TEM_BUMPMAP_COUNT]; -LL::WorkQueue::weak_t LLBumpImageList::sMainQueue; -LL::WorkQueue::weak_t LLBumpImageList::sTexUpdateQueue; LLRenderTarget LLBumpImageList::sRenderTarget; // static @@ -629,8 +627,6 @@ void LLBumpImageList::init() llassert( mDarknessEntries.size() == 0 ); LLStandardBumpmap::restoreGL(); - sMainQueue = LL::WorkQueue::getInstance("mainloop"); - sTexUpdateQueue = LL::WorkQueue::getInstance("LLImageGL"); // Share work queue with tex loader. } void LLBumpImageList::clear() diff --git a/indra/newview/lldrawpoolbump.h b/indra/newview/lldrawpoolbump.h index 15976884ca3..e1a468cd185 100644 --- a/indra/newview/lldrawpoolbump.h +++ b/indra/newview/lldrawpoolbump.h @@ -152,8 +152,6 @@ class LLBumpImageList typedef std::unordered_map > bump_image_map_t; bump_image_map_t mBrightnessEntries; bump_image_map_t mDarknessEntries; - static LL::WorkQueue::weak_t sMainQueue; - static LL::WorkQueue::weak_t sTexUpdateQueue; static LLRenderTarget sRenderTarget; }; diff --git a/indra/newview/lldrawpoolterrain.cpp b/indra/newview/lldrawpoolterrain.cpp index 5e676bc5b3d..d75b8d0ac6e 100644 --- a/indra/newview/lldrawpoolterrain.cpp +++ b/indra/newview/lldrawpoolterrain.cpp @@ -636,379 +636,6 @@ void LLDrawPoolTerrain::hilightParcelOwners() } -void LLDrawPoolTerrain::renderFull4TU() -{ - // Hack! Get the region that this draw pool is rendering from! - LLViewerRegion *regionp = mDrawFace[0]->getDrawable()->getVObj()->getRegion(); - LLVLComposition *compp = regionp->getComposition(); - LLViewerTexture *detail_texture0p = compp->mDetailTextures[0]; - LLViewerTexture *detail_texture1p = compp->mDetailTextures[1]; - LLViewerTexture *detail_texture2p = compp->mDetailTextures[2]; - LLViewerTexture *detail_texture3p = compp->mDetailTextures[3]; - - LLVector3d region_origin_global = gAgent.getRegion()->getOriginGlobal(); - F32 offset_x = (F32)fmod(region_origin_global.mdV[VX], 1.0/(F64)sDetailScale)*sDetailScale; - F32 offset_y = (F32)fmod(region_origin_global.mdV[VY], 1.0/(F64)sDetailScale)*sDetailScale; - - LLVector4 tp0, tp1; - - tp0.setVec(sDetailScale, 0.0f, 0.0f, offset_x); - tp1.setVec(0.0f, sDetailScale, 0.0f, offset_y); - - gGL.blendFunc(LLRender::BF_ONE_MINUS_SOURCE_ALPHA, LLRender::BF_SOURCE_ALPHA); - - //---------------------------------------------------------------------------- - // Pass 1/1 - - // - // Stage 0: detail texture 0 - // - gGL.getTexUnit(0)->activate(); - gGL.getTexUnit(0)->bind(detail_texture0p); - - glEnable(GL_TEXTURE_GEN_S); - glEnable(GL_TEXTURE_GEN_T); - glTexGeni(GL_S, GL_TEXTURE_GEN_MODE, GL_OBJECT_LINEAR); - glTexGeni(GL_T, GL_TEXTURE_GEN_MODE, GL_OBJECT_LINEAR); - - glTexGenfv(GL_S, GL_OBJECT_PLANE, tp0.mV); - glTexGenfv(GL_T, GL_OBJECT_PLANE, tp1.mV); - - // - // Stage 1: Generate alpha ramp for detail0/detail1 transition - // - - gGL.getTexUnit(1)->bind(m2DAlphaRampImagep.get()); - gGL.getTexUnit(1)->enable(LLTexUnit::TT_TEXTURE); - gGL.getTexUnit(1)->activate(); - - // - // Stage 2: Interpolate detail1 with existing based on ramp - // - gGL.getTexUnit(2)->bind(detail_texture1p); - gGL.getTexUnit(2)->enable(LLTexUnit::TT_TEXTURE); - gGL.getTexUnit(2)->activate(); - - glEnable(GL_TEXTURE_GEN_S); - glEnable(GL_TEXTURE_GEN_T); - glTexGeni(GL_S, GL_TEXTURE_GEN_MODE, GL_OBJECT_LINEAR); - glTexGeni(GL_T, GL_TEXTURE_GEN_MODE, GL_OBJECT_LINEAR); - glTexGenfv(GL_S, GL_OBJECT_PLANE, tp0.mV); - glTexGenfv(GL_T, GL_OBJECT_PLANE, tp1.mV); - - // - // Stage 3: Modulate with primary (vertex) color for lighting - // - gGL.getTexUnit(3)->bind(detail_texture1p); - gGL.getTexUnit(3)->enable(LLTexUnit::TT_TEXTURE); - gGL.getTexUnit(3)->activate(); - - gGL.getTexUnit(0)->activate(); - - // GL_BLEND disabled by default - drawLoop(); - - //---------------------------------------------------------------------------- - // Second pass - - // Stage 0: Write detail3 into base - // - gGL.getTexUnit(0)->activate(); - gGL.getTexUnit(0)->bind(detail_texture3p); - - glEnable(GL_TEXTURE_GEN_S); - glEnable(GL_TEXTURE_GEN_T); - glTexGeni(GL_S, GL_TEXTURE_GEN_MODE, GL_OBJECT_LINEAR); - glTexGeni(GL_T, GL_TEXTURE_GEN_MODE, GL_OBJECT_LINEAR); - glTexGenfv(GL_S, GL_OBJECT_PLANE, tp0.mV); - glTexGenfv(GL_T, GL_OBJECT_PLANE, tp1.mV); - - // - // Stage 1: Generate alpha ramp for detail2/detail3 transition - // - gGL.getTexUnit(1)->bind(m2DAlphaRampImagep); - gGL.getTexUnit(1)->enable(LLTexUnit::TT_TEXTURE); - gGL.getTexUnit(1)->activate(); - - // Set the texture matrix - gGL.matrixMode(LLRender::MM_TEXTURE); - gGL.loadIdentity(); - gGL.translatef(-2.f, 0.f, 0.f); - - // - // Stage 2: Interpolate detail2 with existing based on ramp - // - gGL.getTexUnit(2)->bind(detail_texture2p); - gGL.getTexUnit(2)->enable(LLTexUnit::TT_TEXTURE); - gGL.getTexUnit(2)->activate(); - - glEnable(GL_TEXTURE_GEN_S); - glEnable(GL_TEXTURE_GEN_T); - glTexGeni(GL_S, GL_TEXTURE_GEN_MODE, GL_OBJECT_LINEAR); - glTexGeni(GL_T, GL_TEXTURE_GEN_MODE, GL_OBJECT_LINEAR); - glTexGenfv(GL_S, GL_OBJECT_PLANE, tp0.mV); - glTexGenfv(GL_T, GL_OBJECT_PLANE, tp1.mV); - - // - // Stage 3: Generate alpha ramp for detail1/detail2 transition - // - gGL.getTexUnit(3)->bind(m2DAlphaRampImagep); - gGL.getTexUnit(3)->enable(LLTexUnit::TT_TEXTURE); - gGL.getTexUnit(3)->activate(); - - // Set the texture matrix - gGL.matrixMode(LLRender::MM_TEXTURE); - gGL.loadIdentity(); - gGL.translatef(-1.f, 0.f, 0.f); - gGL.matrixMode(LLRender::MM_MODELVIEW); - - gGL.getTexUnit(0)->activate(); - { - LLGLEnable blend(GL_BLEND); - drawLoop(); - } - - LLVertexBuffer::unbind(); - // Disable multitexture - gGL.getTexUnit(3)->unbind(LLTexUnit::TT_TEXTURE); - gGL.getTexUnit(3)->disable(); - gGL.getTexUnit(3)->activate(); - - gGL.matrixMode(LLRender::MM_TEXTURE); - gGL.loadIdentity(); - gGL.matrixMode(LLRender::MM_MODELVIEW); - - gGL.getTexUnit(2)->unbind(LLTexUnit::TT_TEXTURE); - gGL.getTexUnit(2)->disable(); - gGL.getTexUnit(2)->activate(); - - glDisable(GL_TEXTURE_GEN_S); - glDisable(GL_TEXTURE_GEN_T); - gGL.matrixMode(LLRender::MM_TEXTURE); - gGL.loadIdentity(); - gGL.matrixMode(LLRender::MM_MODELVIEW); - - gGL.getTexUnit(1)->unbind(LLTexUnit::TT_TEXTURE); - gGL.getTexUnit(1)->disable(); - gGL.getTexUnit(1)->activate(); - - gGL.matrixMode(LLRender::MM_TEXTURE); - gGL.loadIdentity(); - gGL.matrixMode(LLRender::MM_MODELVIEW); - - // Restore blend state - gGL.setSceneBlendType(LLRender::BT_ALPHA); - - //---------------------------------------------------------------------------- - // Restore Texture Unit 0 defaults - - gGL.getTexUnit(0)->activate(); - gGL.getTexUnit(0)->unbind(LLTexUnit::TT_TEXTURE); - - - glDisable(GL_TEXTURE_GEN_S); - glDisable(GL_TEXTURE_GEN_T); - gGL.matrixMode(LLRender::MM_TEXTURE); - gGL.loadIdentity(); - gGL.matrixMode(LLRender::MM_MODELVIEW); -} - -void LLDrawPoolTerrain::renderFull2TU() -{ - // Hack! Get the region that this draw pool is rendering from! - LLViewerRegion *regionp = mDrawFace[0]->getDrawable()->getVObj()->getRegion(); - LLVLComposition *compp = regionp->getComposition(); - LLViewerTexture *detail_texture0p = compp->mDetailTextures[0]; - LLViewerTexture *detail_texture1p = compp->mDetailTextures[1]; - LLViewerTexture *detail_texture2p = compp->mDetailTextures[2]; - LLViewerTexture *detail_texture3p = compp->mDetailTextures[3]; - - LLVector3d region_origin_global = gAgent.getRegion()->getOriginGlobal(); - F32 offset_x = (F32)fmod(region_origin_global.mdV[VX], 1.0/(F64)sDetailScale)*sDetailScale; - F32 offset_y = (F32)fmod(region_origin_global.mdV[VY], 1.0/(F64)sDetailScale)*sDetailScale; - - LLVector4 tp0, tp1; - - tp0.setVec(sDetailScale, 0.0f, 0.0f, offset_x); - tp1.setVec(0.0f, sDetailScale, 0.0f, offset_y); - - gGL.blendFunc(LLRender::BF_ONE_MINUS_SOURCE_ALPHA, LLRender::BF_SOURCE_ALPHA); - - //---------------------------------------------------------------------------- - // Pass 1/4 - - // - // Stage 0: Render detail 0 into base - // - gGL.getTexUnit(0)->bind(detail_texture0p); - glEnable(GL_TEXTURE_GEN_S); - glEnable(GL_TEXTURE_GEN_T); - glTexGeni(GL_S, GL_TEXTURE_GEN_MODE, GL_OBJECT_LINEAR); - glTexGeni(GL_T, GL_TEXTURE_GEN_MODE, GL_OBJECT_LINEAR); - - glTexGenfv(GL_S, GL_OBJECT_PLANE, tp0.mV); - glTexGenfv(GL_T, GL_OBJECT_PLANE, tp1.mV); - - drawLoop(); - - //---------------------------------------------------------------------------- - // Pass 2/4 - - // - // Stage 0: Generate alpha ramp for detail0/detail1 transition - // - gGL.getTexUnit(0)->bind(m2DAlphaRampImagep); - - glDisable(GL_TEXTURE_GEN_S); - glDisable(GL_TEXTURE_GEN_T); - - // - // Stage 1: Write detail1 - // - gGL.getTexUnit(1)->bind(detail_texture1p); - gGL.getTexUnit(1)->enable(LLTexUnit::TT_TEXTURE); - gGL.getTexUnit(1)->activate(); - - glEnable(GL_TEXTURE_GEN_S); - glEnable(GL_TEXTURE_GEN_T); - glTexGeni(GL_S, GL_TEXTURE_GEN_MODE, GL_OBJECT_LINEAR); - glTexGeni(GL_T, GL_TEXTURE_GEN_MODE, GL_OBJECT_LINEAR); - glTexGenfv(GL_S, GL_OBJECT_PLANE, tp0.mV); - glTexGenfv(GL_T, GL_OBJECT_PLANE, tp1.mV); - - gGL.getTexUnit(0)->activate(); - { - LLGLEnable blend(GL_BLEND); - drawLoop(); - } - //---------------------------------------------------------------------------- - // Pass 3/4 - - // - // Stage 0: Generate alpha ramp for detail1/detail2 transition - // - gGL.getTexUnit(0)->bind(m2DAlphaRampImagep); - - // Set the texture matrix - gGL.matrixMode(LLRender::MM_TEXTURE); - gGL.loadIdentity(); - gGL.translatef(-1.f, 0.f, 0.f); - gGL.matrixMode(LLRender::MM_MODELVIEW); - - // - // Stage 1: Write detail2 - // - gGL.getTexUnit(1)->bind(detail_texture2p); - gGL.getTexUnit(1)->enable(LLTexUnit::TT_TEXTURE); - gGL.getTexUnit(1)->activate(); - - glEnable(GL_TEXTURE_GEN_S); - glEnable(GL_TEXTURE_GEN_T); - glTexGeni(GL_S, GL_TEXTURE_GEN_MODE, GL_OBJECT_LINEAR); - glTexGeni(GL_T, GL_TEXTURE_GEN_MODE, GL_OBJECT_LINEAR); - glTexGenfv(GL_S, GL_OBJECT_PLANE, tp0.mV); - glTexGenfv(GL_T, GL_OBJECT_PLANE, tp1.mV); - - { - LLGLEnable blend(GL_BLEND); - drawLoop(); - } - - //---------------------------------------------------------------------------- - // Pass 4/4 - - // - // Stage 0: Generate alpha ramp for detail2/detail3 transition - // - gGL.getTexUnit(0)->activate(); - gGL.getTexUnit(0)->bind(m2DAlphaRampImagep); - // Set the texture matrix - gGL.matrixMode(LLRender::MM_TEXTURE); - gGL.loadIdentity(); - gGL.translatef(-2.f, 0.f, 0.f); - gGL.matrixMode(LLRender::MM_MODELVIEW); - - // Stage 1: Write detail3 - gGL.getTexUnit(1)->bind(detail_texture3p); - gGL.getTexUnit(1)->enable(LLTexUnit::TT_TEXTURE); - gGL.getTexUnit(1)->activate(); - - glEnable(GL_TEXTURE_GEN_S); - glEnable(GL_TEXTURE_GEN_T); - glTexGeni(GL_S, GL_TEXTURE_GEN_MODE, GL_OBJECT_LINEAR); - glTexGeni(GL_T, GL_TEXTURE_GEN_MODE, GL_OBJECT_LINEAR); - glTexGenfv(GL_S, GL_OBJECT_PLANE, tp0.mV); - glTexGenfv(GL_T, GL_OBJECT_PLANE, tp1.mV); - - gGL.getTexUnit(0)->activate(); - { - LLGLEnable blend(GL_BLEND); - drawLoop(); - } - - // Restore blend state - gGL.setSceneBlendType(LLRender::BT_ALPHA); - - // Disable multitexture - - gGL.getTexUnit(1)->unbind(LLTexUnit::TT_TEXTURE); - gGL.getTexUnit(1)->disable(); - gGL.getTexUnit(1)->activate(); - - glDisable(GL_TEXTURE_GEN_S); - glDisable(GL_TEXTURE_GEN_T); - gGL.matrixMode(LLRender::MM_TEXTURE); - gGL.loadIdentity(); - gGL.matrixMode(LLRender::MM_MODELVIEW); - - //---------------------------------------------------------------------------- - // Restore Texture Unit 0 defaults - - gGL.getTexUnit(0)->activate(); - gGL.getTexUnit(0)->unbind(LLTexUnit::TT_TEXTURE); - - glDisable(GL_TEXTURE_GEN_S); - glDisable(GL_TEXTURE_GEN_T); - gGL.matrixMode(LLRender::MM_TEXTURE); - gGL.loadIdentity(); - gGL.matrixMode(LLRender::MM_MODELVIEW); -} - - -void LLDrawPoolTerrain::renderSimple() -{ - LLVector4 tp0, tp1; - - //---------------------------------------------------------------------------- - // Pass 1/1 - - // Stage 0: Base terrain texture pass - mTexturep->addTextureStats(1024.f*1024.f); - - gGL.getTexUnit(0)->activate(); - gGL.getTexUnit(0)->enable(LLTexUnit::TT_TEXTURE); - gGL.getTexUnit(0)->bind(mTexturep); - - LLVector3 origin_agent = mDrawFace[0]->getDrawable()->getVObj()->getRegion()->getOriginAgent(); - F32 tscale = 1.f/256.f; - tp0.setVec(tscale, 0.f, 0.0f, -1.f*(origin_agent.mV[0]/256.f)); - tp1.setVec(0.f, tscale, 0.0f, -1.f*(origin_agent.mV[1]/256.f)); - - sShader->uniform4fv(LLShaderMgr::OBJECT_PLANE_S, 1, tp0.mV); - sShader->uniform4fv(LLShaderMgr::OBJECT_PLANE_T, 1, tp1.mV); - - drawLoop(); - - //---------------------------------------------------------------------------- - // Restore Texture Unit 0 defaults - - gGL.getTexUnit(0)->activate(); - gGL.getTexUnit(0)->unbind(LLTexUnit::TT_TEXTURE); - gGL.matrixMode(LLRender::MM_TEXTURE); - gGL.loadIdentity(); - gGL.matrixMode(LLRender::MM_MODELVIEW); -} - //============================================================================ void LLDrawPoolTerrain::renderOwnership() diff --git a/indra/newview/lldrawpoolterrain.h b/indra/newview/lldrawpoolterrain.h index 23cf253b6a4..49fccc168f4 100644 --- a/indra/newview/lldrawpoolterrain.h +++ b/indra/newview/lldrawpoolterrain.h @@ -73,11 +73,8 @@ class LLDrawPoolTerrain : public LLFacePool protected: void boostTerrainDetailTextures(); - void renderSimple(); void renderOwnership(); - void renderFull2TU(); - void renderFull4TU(); void renderFullShader(); void renderFullShaderTextures(); void renderFullShaderPBR(bool use_local_materials = false); diff --git a/indra/newview/lldrawpoolwlsky.cpp b/indra/newview/lldrawpoolwlsky.cpp index 305215f5413..e6d0b036e0d 100644 --- a/indra/newview/lldrawpoolwlsky.cpp +++ b/indra/newview/lldrawpoolwlsky.cpp @@ -32,7 +32,6 @@ #include "llface.h" #include "llimage.h" #include "llrender.h" -#include "llatmosphere.h" #include "llenvironment.h" #include "llglslshader.h" #include "llgl.h" diff --git a/indra/newview/lldynamictexture.h b/indra/newview/lldynamictexture.h index 375828fefa8..cc5e39c5fb9 100644 --- a/indra/newview/lldynamictexture.h +++ b/indra/newview/lldynamictexture.h @@ -33,7 +33,7 @@ #include "llviewertexture.h" #include "llcamera.h" -class LLViewerDynamicTexture : public LLViewerTexture +class alignas(16) LLViewerDynamicTexture : public LLViewerTexture { LL_ALIGN_NEW public: @@ -90,7 +90,7 @@ class LLViewerDynamicTexture : public LLViewerTexture protected: bool mClamp; LLCoordGL mOrigin; - LL_ALIGN_16(LLCamera mCamera); + LLCamera mCamera; LLRenderTarget* mBoundTarget; diff --git a/indra/newview/llenvironment.cpp b/indra/newview/llenvironment.cpp index 875dac103c8..d942715fff5 100644 --- a/indra/newview/llenvironment.cpp +++ b/indra/newview/llenvironment.cpp @@ -54,7 +54,6 @@ #include "llregioninfomodel.h" -#include "llatmosphere.h" #include "llagent.h" #include "roles_constants.h" #include "llestateinfomodel.h" @@ -965,54 +964,6 @@ LLSettingsWater::ptr_t LLEnvironment::getCurrentWater() const return pwater; } -void LayerConfigToDensityLayer(const LLSD& layerConfig, DensityLayer& layerOut) -{ - layerOut.constant_term = (F32)layerConfig[LLSettingsSky::SETTING_DENSITY_PROFILE_CONSTANT_TERM].asReal(); - layerOut.exp_scale = (F32)layerConfig[LLSettingsSky::SETTING_DENSITY_PROFILE_EXP_SCALE_FACTOR].asReal(); - layerOut.exp_term = (F32)layerConfig[LLSettingsSky::SETTING_DENSITY_PROFILE_EXP_TERM].asReal(); - layerOut.linear_term = (F32)layerConfig[LLSettingsSky::SETTING_DENSITY_PROFILE_LINEAR_TERM].asReal(); - layerOut.width = (F32)layerConfig[LLSettingsSky::SETTING_DENSITY_PROFILE_WIDTH].asReal(); -} - -void LLEnvironment::getAtmosphericModelSettings(AtmosphericModelSettings& settingsOut, const LLSettingsSky::ptr_t &psky) -{ - settingsOut.m_skyBottomRadius = psky->getSkyBottomRadius(); - settingsOut.m_skyTopRadius = psky->getSkyTopRadius(); - settingsOut.m_sunArcRadians = psky->getSunArcRadians(); - settingsOut.m_mieAnisotropy = psky->getMieAnisotropy(); - - LLSD rayleigh = psky->getRayleighConfigs(); - settingsOut.m_rayleighProfile.clear(); - for (LLSD::array_iterator itf = rayleigh.beginArray(); itf != rayleigh.endArray(); ++itf) - { - DensityLayer layer; - LLSD& layerConfig = (*itf); - LayerConfigToDensityLayer(layerConfig, layer); - settingsOut.m_rayleighProfile.push_back(layer); - } - - LLSD mie = psky->getMieConfigs(); - settingsOut.m_mieProfile.clear(); - for (LLSD::array_iterator itf = mie.beginArray(); itf != mie.endArray(); ++itf) - { - DensityLayer layer; - LLSD& layerConfig = (*itf); - LayerConfigToDensityLayer(layerConfig, layer); - settingsOut.m_mieProfile.push_back(layer); - } - settingsOut.m_mieAnisotropy = psky->getMieAnisotropy(); - - LLSD absorption = psky->getAbsorptionConfigs(); - settingsOut.m_absorptionProfile.clear(); - for (LLSD::array_iterator itf = absorption.beginArray(); itf != absorption.endArray(); ++itf) - { - DensityLayer layer; - LLSD& layerConfig = (*itf); - LayerConfigToDensityLayer(layerConfig, layer); - settingsOut.m_absorptionProfile.push_back(layer); - } -} - bool LLEnvironment::canAgentUpdateParcelEnvironment() const { LLParcel *parcel(LLViewerParcelMgr::instance().getAgentOrSelectedParcel()); @@ -2022,8 +1973,8 @@ void LLEnvironment::coroRequestEnvironment(S32 parcel_id, LLEnvironment::environ { LLCore::HttpRequest::policy_t httpPolicy(LLCore::HttpRequest::DEFAULT_POLICY_ID); LLCoreHttpUtil::HttpCoroutineAdapter::ptr_t - httpAdapter(new LLCoreHttpUtil::HttpCoroutineAdapter("ResetEnvironment", httpPolicy)); - LLCore::HttpRequest::ptr_t httpRequest(new LLCore::HttpRequest); + httpAdapter = std::make_shared("ResetEnvironment", httpPolicy); + LLCore::HttpRequest::ptr_t httpRequest = std::make_shared(); std::string url = gAgent.getRegionCapability("ExtEnvironment"); if (url.empty()) @@ -2070,8 +2021,8 @@ void LLEnvironment::coroUpdateEnvironment(S32 parcel_id, S32 track_no, UpdateInf { LLCore::HttpRequest::policy_t httpPolicy(LLCore::HttpRequest::DEFAULT_POLICY_ID); LLCoreHttpUtil::HttpCoroutineAdapter::ptr_t - httpAdapter(new LLCoreHttpUtil::HttpCoroutineAdapter("ResetEnvironment", httpPolicy)); - LLCore::HttpRequest::ptr_t httpRequest(new LLCore::HttpRequest); + httpAdapter = std::make_shared("ResetEnvironment", httpPolicy); + LLCore::HttpRequest::ptr_t httpRequest = std::make_shared(); std::string url = gAgent.getRegionCapability("ExtEnvironment"); if (url.empty()) @@ -2186,8 +2137,8 @@ void LLEnvironment::coroResetEnvironment(S32 parcel_id, S32 track_no, environmen { LLCore::HttpRequest::policy_t httpPolicy(LLCore::HttpRequest::DEFAULT_POLICY_ID); LLCoreHttpUtil::HttpCoroutineAdapter::ptr_t - httpAdapter(new LLCoreHttpUtil::HttpCoroutineAdapter("ResetEnvironment", httpPolicy)); - LLCore::HttpRequest::ptr_t httpRequest(new LLCore::HttpRequest); + httpAdapter = std::make_shared("ResetEnvironment", httpPolicy); + LLCore::HttpRequest::ptr_t httpRequest = std::make_shared(); std::string url = gAgent.getRegionCapability("ExtEnvironment"); if (url.empty()) @@ -2743,13 +2694,6 @@ bool LLEnvironment::DayInstance::setSky(const LLSettingsSky::ptr_t &psky) mSky->update(); mBlenderSky.reset(); - if (gAtmosphere) - { - AtmosphericModelSettings settings; - LLEnvironment::getAtmosphericModelSettings(settings, psky); - gAtmosphere->configureAtmosphericModel(settings); - } - return changed; } @@ -3418,8 +3362,8 @@ namespace { LLCore::HttpRequest::policy_t httpPolicy(LLCore::HttpRequest::DEFAULT_POLICY_ID); LLCoreHttpUtil::HttpCoroutineAdapter::ptr_t - httpAdapter(new LLCoreHttpUtil::HttpCoroutineAdapter("testExperiencesOnParcelCoro", httpPolicy)); - LLCore::HttpRequest::ptr_t httpRequest(new LLCore::HttpRequest); + httpAdapter = std::make_shared("testExperiencesOnParcelCoro", httpPolicy); + LLCore::HttpRequest::ptr_t httpRequest = std::make_shared(); std::string url = gAgent.getRegionCapability("ExperienceQuery"); if (url.empty()) diff --git a/indra/newview/llenvironment.h b/indra/newview/llenvironment.h index f1205a72b7f..217c069705e 100644 --- a/indra/newview/llenvironment.h +++ b/indra/newview/llenvironment.h @@ -36,8 +36,6 @@ #include "llsettingswater.h" #include "llsettingsdaycycle.h" -#include "llatmosphere.h" - #include "llglslshader.h" #include @@ -131,8 +129,6 @@ class LLEnvironment : public LLSimpleton LLSettingsSky::ptr_t getCurrentSky() const; LLSettingsWater::ptr_t getCurrentWater() const; - static void getAtmosphericModelSettings(AtmosphericModelSettings& settingsOut, const LLSettingsSky::ptr_t &psky); - void update(const LLViewerCamera * cam); static void updateGLVariablesForSettings(LLShaderUniforms* uniforms, const LLSettingsBase::ptr_t &psetting); diff --git a/indra/newview/llestateinfomodel.cpp b/indra/newview/llestateinfomodel.cpp index a7d18d85ce4..54be045c3d1 100644 --- a/indra/newview/llestateinfomodel.cpp +++ b/indra/newview/llestateinfomodel.cpp @@ -138,8 +138,8 @@ void LLEstateInfoModel::commitEstateInfoCapsCoro(std::string url) { LLCore::HttpRequest::policy_t httpPolicy(LLCore::HttpRequest::DEFAULT_POLICY_ID); LLCoreHttpUtil::HttpCoroutineAdapter::ptr_t - httpAdapter(new LLCoreHttpUtil::HttpCoroutineAdapter("EstateChangeInfo", httpPolicy)); - LLCore::HttpRequest::ptr_t httpRequest(new LLCore::HttpRequest); + httpAdapter = std::make_shared("EstateChangeInfo", httpPolicy); + LLCore::HttpRequest::ptr_t httpRequest = std::make_shared(); LLSD body; body["estate_name"] = getName(); diff --git a/indra/newview/lleventnotifier.cpp b/indra/newview/lleventnotifier.cpp index 25983f4add3..66a922e288d 100644 --- a/indra/newview/lleventnotifier.cpp +++ b/indra/newview/lleventnotifier.cpp @@ -166,6 +166,14 @@ bool LLEventNotifier::handleResponse(U32 eventId, const LLSD& notification, cons return true; } +bool LLEventNotifier::add(LLEventInfo event) +{ + if (mEventInfoSignal(event)) + return false; + + return add(event.mID, event.mUnixTime, event.mTimeStr, event.mName); +} + bool LLEventNotifier::add(U32 eventId, F64 eventEpoch, const std::string& eventDateStr, const std::string &eventName) { LLEventNotification *new_enp = new LLEventNotification(eventId, eventEpoch, eventDateStr, eventName); @@ -198,20 +206,9 @@ void LLEventNotifier::add(U32 eventId) //static void LLEventNotifier::processEventInfoReply(LLMessageSystem *msg, void **) { - // extract the agent id - LLUUID agent_id; - U32 event_id; - std::string event_name; - std::string eventd_date; - U32 event_time_utc; - - msg->getUUIDFast(_PREHASH_AgentData, _PREHASH_AgentID, agent_id ); - msg->getU32("EventData", "EventID", event_id); - msg->getString("EventData", "Name", event_name); - msg->getString("EventData", "Date", eventd_date); - msg->getU32("EventData", "DateUTC", event_time_utc); - - gEventNotifier.add(event_id, (F64)event_time_utc, eventd_date, event_name); + LLEventInfo info; + info.unpack(msg); + gEventNotifier.add(info); } @@ -296,6 +293,52 @@ void LLEventNotifier::serverPushRequest(U32 event_id, bool add) gAgent.sendReliableMessage(); } +void LLEventInfo::unpack(LLMessageSystem* msg) +{ + U32 event_id; + msg->getU32("EventData", "EventID", event_id); + mID = event_id; + + msg->getString("EventData", "Name", mName); + + msg->getString("EventData", "Category", mCategoryStr); + + msg->getString("EventData", "Date", mTimeStr); + + U32 duration; + msg->getU32("EventData", "Duration", duration); + mDuration = duration; + + U32 date; + msg->getU32("EventData", "DateUTC", date); + mUnixTime = date; + + msg->getString("EventData", "Desc", mDesc); + + std::string buffer; + msg->getString("EventData", "Creator", buffer); + mRunByID = LLUUID(buffer); + + U32 foo; + msg->getU32("EventData", "Cover", foo); + + mHasCover = foo ? true : false; + if (mHasCover) + { + U32 cover; + msg->getU32("EventData", "Amount", cover); + mCover = cover; + } + + msg->getString("EventData", "SimName", mSimName); + + msg->getVector3d("EventData", "GlobalPos", mPosGlobal); + + // Mature content + U32 event_flags; + msg->getU32("EventData", "EventFlags", event_flags); + mEventFlags = event_flags; +} LLEventNotification::LLEventNotification(U32 eventId, F64 eventEpoch, const std::string& eventDateStr, const std::string &eventName) : mEventID(eventId), diff --git a/indra/newview/lleventnotifier.h b/indra/newview/lleventnotifier.h index 030c9abb871..2a9295129d1 100644 --- a/indra/newview/lleventnotifier.h +++ b/indra/newview/lleventnotifier.h @@ -33,6 +33,24 @@ class LLEventNotification; class LLMessageSystem; +struct LLEventInfo +{ + void unpack(LLMessageSystem* msg); + + std::string mName; + U32 mID; + std::string mDesc; + std::string mCategoryStr; + U32 mDuration; + std::string mTimeStr; + LLUUID mRunByID; + std::string mSimName; + LLVector3d mPosGlobal; + F64 mUnixTime; // seconds from 1970 + BOOL mHasCover; + U32 mCover; + U32 mEventFlags; +}; class LLEventNotifier { @@ -42,6 +60,7 @@ class LLEventNotifier void update(); // Notify the user of the event if it's coming up bool add(U32 eventId, F64 eventEpoch, const std::string& eventDateStr, const std::string &eventName); + bool add(LLEventInfo event); void add(U32 eventId); @@ -56,9 +75,13 @@ class LLEventNotifier static void processEventInfoReply(LLMessageSystem *msg, void **); + typedef boost::signals2::signal info_received_signal_t; + boost::signals2::connection setEventInfoCallback(const info_received_signal_t::slot_type& cb) { return mEventInfoSignal.connect(cb); }; + protected: en_map mEventNotifications; - LLFrameTimer mNotificationTimer; + LLFrameTimer mNotificationTimer; + info_received_signal_t mEventInfoSignal; }; diff --git a/indra/newview/lleventpoll.cpp b/indra/newview/lleventpoll.cpp index 86c58a3497b..de3752d879d 100644 --- a/indra/newview/lleventpoll.cpp +++ b/indra/newview/lleventpoll.cpp @@ -90,7 +90,7 @@ namespace Details { LLAppCoreHttp & app_core_http(LLAppViewer::instance()->getAppCoreHttp()); - mHttpRequest = LLCore::HttpRequest::ptr_t(new LLCore::HttpRequest); + mHttpRequest = std::make_shared(); mHttpPolicy = app_core_http.getPolicy(LLAppCoreHttp::AP_LONG_POLL); mSenderIp = sender.getIPandPort(); } @@ -144,7 +144,7 @@ namespace Details void LLEventPollImpl::eventPollCoro(std::string url) { - LLCoreHttpUtil::HttpCoroutineAdapter::ptr_t httpAdapter(new LLCoreHttpUtil::HttpCoroutineAdapter("EventPoller", mHttpPolicy)); + LLCoreHttpUtil::HttpCoroutineAdapter::ptr_t httpAdapter = std::make_shared("EventPoller", mHttpPolicy); LLSD acknowledge; int errorCount = 0; int counter = mCounter; // saved on the stack for logging. @@ -156,7 +156,7 @@ namespace Details // This is a loop with its own waitToRetry implementation, // so disable retries. - LLCore::HttpOptions::ptr_t httpOpts(new LLCore::HttpOptions); + LLCore::HttpOptions::ptr_t httpOpts = std::make_shared(); httpOpts->setRetries(0); LL::WorkQueue::ptr_t main_queue = nullptr; diff --git a/indra/newview/llexperiencelog.cpp b/indra/newview/llexperiencelog.cpp index ce10fba2cac..b86474c5ca0 100644 --- a/indra/newview/llexperiencelog.cpp +++ b/indra/newview/llexperiencelog.cpp @@ -279,6 +279,6 @@ void LLExperienceLog::setNotifyNewEvent( bool val ) } else if( val && !mNotifyConnection.connected()) { - mNotifyConnection = addUpdateSignal(boost::function(LLExperienceLog::notify)); + mNotifyConnection = addUpdateSignal(std::function(LLExperienceLog::notify)); } } diff --git a/indra/newview/llexternaleditor.cpp b/indra/newview/llexternaleditor.cpp index 3decd15bbdb..193a42f9f6d 100644 --- a/indra/newview/llexternaleditor.cpp +++ b/indra/newview/llexternaleditor.cpp @@ -44,8 +44,20 @@ LLExternalEditor::EErrorCode LLExternalEditor::setCommand(const std::string& env std::string cmd = findCommand(env_var, override); if (cmd.empty()) { - LL_WARNS() << "Editor command is empty or not set" << LL_ENDL; - return EC_NOT_SPECIFIED; + LL_INFOS() << "Editor command is empty or not set, falling back to OS open handler" << LL_ENDL; +#if LL_WINDOWS + static const std::string os_cmd = "%SystemRoot%\\explorer.exe \"%s\""; +#elif LL_DARWIN + static const std::string os_cmd = "/usr/bin/open \"%s\""; +#elif LL_LINUX + static const std::string os_cmd = "/usr/bin/xdg-open \"%s\""; +#endif + cmd = findCommand("", os_cmd); + if (cmd.empty()) + { + LL_WARNS() << "Failed to find OS open handler \"" << cmd << "\"" << LL_ENDL; + return EC_NOT_SPECIFIED; + } } string_vec_t tokens; diff --git a/indra/newview/llface.cpp b/indra/newview/llface.cpp index f08ef8d24a8..37802fa1750 100644 --- a/indra/newview/llface.cpp +++ b/indra/newview/llface.cpp @@ -58,12 +58,6 @@ #include "llmeshrepository.h" #include "llskinningutil.h" -#if LL_LINUX -// Work-around spurious used before init warning on Vector4a -// -#pragma GCC diagnostic ignored "-Wuninitialized" -#endif - #define LL_MAX_INDICES_COUNT 1000000 static LLStaticHashedString sTextureIndexIn("texture_index_in"); @@ -646,7 +640,7 @@ void LLFace::renderOneWireframe(const LLColor4 &color, F32 fogCfx, bool wirefram LLGLEnable offset(GL_POLYGON_OFFSET_LINE); glPolygonOffset(3.f, 3.f); - glLineWidth(5.f); + gGL.setLineWidth(5.f); glPolygonMode(GL_FRONT_AND_BACK, GL_LINE); renderFace(mDrawablep, this); } diff --git a/indra/newview/llface.h b/indra/newview/llface.h index 65637fbf859..df31e9ea908 100644 --- a/indra/newview/llface.h +++ b/indra/newview/llface.h @@ -58,16 +58,8 @@ class alignas(16) LLFace { LL_ALIGN_NEW public: - LLFace(const LLFace& rhs) - { - *this = rhs; - } - - const LLFace& operator=(const LLFace& rhs) - { - LL_ERRS() << "Illegal operation!" << LL_ENDL; - return *this; - } + LLFace(const LLFace& rhs) = delete; + const LLFace& operator=(const LLFace& rhs) = delete; enum EMasks { @@ -127,7 +119,7 @@ class alignas(16) LLFace void setIndexInTex(U32 ch, S32 index) { llassert(ch < LLRender::NUM_TEXTURE_CHANNELS); mIndexInTex[ch] = index; } void setWorldMatrix(const LLMatrix4& mat); - const LLTextureEntry* getTextureEntry() const { return mVObjp->getTE(mTEOffset); } + const LLTextureEntry* getTextureEntry() const { return mVObjp ? mVObjp->getTE(mTEOffset) : nullptr; } LLFacePool* getPool() const { return mDrawPoolp; } U32 getPoolType() const { return mPoolType; } diff --git a/indra/newview/llfasttimerview.cpp b/indra/newview/llfasttimerview.cpp index 8056983c7c8..cce6eeb19dd 100644 --- a/indra/newview/llfasttimerview.cpp +++ b/indra/newview/llfasttimerview.cpp @@ -1057,8 +1057,7 @@ void LLFastTimerView::drawLineGraph() //fatten highlighted timer if (mHoverID == idp) { - gGL.flush(); - glLineWidth(3); + gGL.setLineWidth(3); } llassert(idp->getIndex() < sTimerColors.size()); @@ -1118,8 +1117,7 @@ void LLFastTimerView::drawLineGraph() if (mHoverID == idp) { - gGL.flush(); - glLineWidth(1); + gGL.setLineWidth(1.f); } if (idp->getTreeNode().mCollapsed) diff --git a/indra/newview/llfeaturemanager.cpp b/indra/newview/llfeaturemanager.cpp index bbf67ffb367..6d6dc675de8 100644 --- a/indra/newview/llfeaturemanager.cpp +++ b/indra/newview/llfeaturemanager.cpp @@ -30,7 +30,6 @@ #include #include -#include #include "llfeaturemanager.h" #include "lldir.h" @@ -184,15 +183,15 @@ void LLFeatureList::dump() } } -static const std::vector sGraphicsLevelNames = boost::assign::list_of - ("Low") - ("LowMid") - ("Mid") - ("MidHigh") - ("High") - ("HighUltra") - ("Ultra") -; +static const std::vector sGraphicsLevelNames = { + "Low", + "LowMid", + "Mid", + "MidHigh", + "High", + "HighUltra", + "Ultra" +}; U32 LLFeatureManager::getMaxGraphicsLevel() const { @@ -260,7 +259,6 @@ bool LLFeatureManager::loadFeatureTables() // *TODO - if I or anyone else adds something else to the skipped list // make this data driven. Put it in the feature table and parse it // correctly - mSkippedFeatures.insert("RenderAnisotropic"); mSkippedFeatures.insert("RenderGamma"); mSkippedFeatures.insert("RenderVBOEnable"); mSkippedFeatures.insert("RenderFogRatio"); @@ -509,17 +507,16 @@ bool LLFeatureManager::loadGPUClass() mGPUClass = GPU_CLASS_5; } - #if LL_WINDOWS - const F32Gigabytes MIN_PHYSICAL_MEMORY(8); - LLMemory::updateMemoryInfo(); + #if LL_WINDOWS || LL_LINUX + const F32Gigabytes MIN_PHYSICAL_MEMORY(8); F32Gigabytes physical_mem = LLMemory::getMaxMemKB(); if (MIN_PHYSICAL_MEMORY > physical_mem && mGPUClass > GPU_CLASS_1) { // reduce quality on systems that don't have enough memory mGPUClass = (EGPUClass)(mGPUClass - 1); } - #endif //LL_WINDOWS + #endif //LL_WINDOWS || LL_LINUX } //end if benchmark else { @@ -755,6 +752,10 @@ void LLFeatureManager::applyBaseMasks() { maskFeatures("VRAMLT2GB"); } + if (!gGLManager.mHasAnisotropic || 2.f > gGLManager.mMaxAnisotropy) + { + maskFeatures("AnisotropicMissing"); + } if (gGLManager.mGLVersion < 3.99f) { maskFeatures("GL3"); diff --git a/indra/newview/llfilepicker.cpp b/indra/newview/llfilepicker.cpp index 0e754c95612..2c5c6900d35 100644 --- a/indra/newview/llfilepicker.cpp +++ b/indra/newview/llfilepicker.cpp @@ -36,7 +36,7 @@ #include "llviewercontrol.h" #include "llwindow.h" // beforeDialog() -#if LL_SDL +#if LL_SDL_WINDOW #include "llwindowsdl.h" // for some X/GTK utils to help with filepickers #endif // LL_SDL @@ -50,7 +50,7 @@ LLFilePicker LLFilePicker::sInstance; -#if LL_WINDOWS +#if LL_WINDOWS && !LL_SDL_WINDOW #define SOUND_FILTER L"Sounds (*.wav)\0*.wav\0" #define IMAGE_FILTER L"Images (*.tga; *.bmp; *.jpg; *.jpeg; *.png)\0*.tga;*.bmp;*.jpg;*.jpeg;*.png\0" #define ANIM_FILTER L"Animations (*.bvh; *.anim)\0*.bvh;*.anim\0" @@ -82,7 +82,7 @@ LLFilePicker::LLFilePicker() { reset(); -#if LL_WINDOWS +#if LL_WINDOWS && !LL_SDL_WINDOW mOFN.lStructSize = sizeof(OPENFILENAMEW); mOFN.hwndOwner = NULL; // Set later mOFN.hInstance = NULL; @@ -102,7 +102,7 @@ LLFilePicker::LLFilePicker() mOFN.lpfnHook = NULL; mOFN.lpTemplateName = NULL; mFilesW[0] = '\0'; -#elif LL_DARWIN +#elif LL_DARWIN && !LL_SDL_WINDOW mPickOptions = 0; #endif @@ -167,7 +167,452 @@ void LLFilePicker::reset() mCurrentFile = 0; } -#if LL_WINDOWS +#if LL_SDL_WINDOW + +namespace +{ + std::vector setupLoadFilter(LLFilePicker::ELoadFilter filter) + { + std::vector filter_vec; + + switch (filter) + { + case LLFilePicker::FFLOAD_ALL: + case LLFilePicker::FFLOAD_EXE: + filter_vec.push_back({ "All Files (*.*)", "*" }); + filter_vec.push_back({ "Sounds (*.wav)", "wav" }); + filter_vec.push_back({ "Images (*.tga; *.bmp; *.jpg; *.jpeg; *.png)", "tga;bmp;jpg;jpeg;png" }); + filter_vec.push_back({ "Animations (*.bvh; *.anim)", "bvh;anim" }); + filter_vec.push_back({ "GLTF Files (*.gltf; *.glb)", "gltf;glb" }); + break; + case LLFilePicker::FFLOAD_WAV: + filter_vec.push_back({ "Sounds (*.wav)", "wav" }); + break; + case LLFilePicker::FFLOAD_IMAGE: + filter_vec.push_back({ "Images (*.tga; *.bmp; *.jpg; *.jpeg; *.png)", "tga;bmp;jpg;jpeg;png" }); + break; + case LLFilePicker::FFLOAD_ANIM: + filter_vec.push_back({ "Animations (*.bvh; *.anim)", "bvh;anim" }); + break; + case LLFilePicker::FFLOAD_GLTF: + filter_vec.push_back({ "glTF (*.gltf; *.glb)", "gltf;glb" }); + break; + case LLFilePicker::FFLOAD_COLLADA: + filter_vec.push_back({ "Scene (*.dae)", "dae" }); + break; + case LLFilePicker::FFLOAD_XML: + filter_vec.push_back({ "XML files (*.xml)", "xml" }); + break; + case LLFilePicker::FFLOAD_SLOBJECT: + filter_vec.push_back({ "Objects (*.slobject)", "slobject" }); + break; + case LLFilePicker::FFLOAD_RAW: + filter_vec.push_back({ "RAW files (*.raw)", "raw" }); + break; + case LLFilePicker::FFLOAD_MODEL: + filter_vec.push_back({ "Model files (*.dae)", "dae" }); + filter_vec.push_back({ "GLTF Files (*.gltf; *.glb)", "gltf;glb" }); + break; + case LLFilePicker::FFLOAD_MATERIAL: + filter_vec.push_back({ "GLTF Files (*.gltf; *.glb)", "gltf;glb" }); + break; + case LLFilePicker::FFLOAD_MATERIAL_TEXTURE: + filter_vec.push_back({ "GLTF Import (*.gltf; *.glb; *.tga; *.bmp; *.jpg; *.jpeg; *.png)", "gltf;glb;tga;bmp;jpg;jpeg;png" }); + filter_vec.push_back({ "GLTF Files (*.gltf; *.glb)", "gltf;glb" }); + filter_vec.push_back({ "Images (*.tga; *.bmp; *.jpg; *.jpeg; *.png)", "tga;bmp;jpg;jpeg;png" }); + break; + case LLFilePicker::FFLOAD_HDRI: + filter_vec.push_back({ "HDRI Files (*.exr)", "exr" }); + break; + case LLFilePicker::FFLOAD_SCRIPT: + filter_vec.push_back({ "Script files (*.lsl)", "lsl" }); + break; + case LLFilePicker::FFLOAD_DICTIONARY: + filter_vec.push_back({ "Dictionary files (*.dic; *.xcu)", "dic;xcu" }); + break; + default: + break; + } + return filter_vec; + } +} + +bool LLFilePicker::getOpenFile(ELoadFilter filter, bool blocking) +{ + LL_ERRS() << "NOT IMPLEMENTED" << LL_ENDL; + return false; +} + +bool LLFilePicker::getOpenFileModeless(ELoadFilter filter, + void (*callback)(bool, std::vector&, void*), + void* userdata) +{ + if (mLocked) + { + return false; + } + + // if local file browsing is turned off, return without opening dialog + if (!check_local_file_access_enabled()) + { + return false; + } + + auto file_filters = setupLoadFilter(filter); + + reset(); + + { + struct LLSDLFileUserdata + { + LLSDLFileUserdata(void (*callback_func)(bool, std::vector&, void*), void* callback_userdata) + : mCallback(callback_func), mUserdata(callback_userdata) + { + } + void (*mCallback)(bool, std::vector&, void*); + void* mUserdata; + }; + + auto sdl_callback = [](void* userdata, const char* const* filelist, int filter) + { + LLSDLFileUserdata* callback_struct = (LLSDLFileUserdata*)userdata; + + auto* callback_func = callback_struct->mCallback; + auto* callback_data = callback_struct->mUserdata; + delete callback_struct; // delete callback container + + std::vector rtn; + + if (!filelist) + { + LL_WARNS() << "Error during SDL file picking: " << SDL_GetError() << LL_ENDL; + callback_func(false, rtn, callback_data); + return; + } + else if (!*filelist) + { + LL_INFOS() << "User did not select any file. Dialog likely cancelled." << LL_ENDL; + callback_func(false, rtn, callback_data); + return; + } + + while (*filelist) + { + rtn.push_back(std::string(*filelist)); + filelist++; + } + + callback_func(true, rtn, callback_data); + + }; + + LLSDLFileUserdata* llfilecallback = new LLSDLFileUserdata(callback, userdata); + + SDL_PropertiesID props = SDL_CreateProperties(); + SDL_SetPointerProperty(props, SDL_PROP_FILE_DIALOG_FILTERS_POINTER, file_filters.data()); + SDL_SetNumberProperty(props, SDL_PROP_FILE_DIALOG_NFILTERS_NUMBER, file_filters.size()); + SDL_SetPointerProperty(props, SDL_PROP_FILE_DIALOG_WINDOW_POINTER, SDL_GL_GetCurrentWindow()); + SDL_SetBooleanProperty(props, SDL_PROP_FILE_DIALOG_MANY_BOOLEAN, false); + + SDL_ShowFileDialogWithProperties(SDL_FILEDIALOG_OPENFILE, sdl_callback, llfilecallback, props); + + SDL_DestroyProperties(props); + } + return true; +} + +bool LLFilePicker::getMultipleOpenFiles(ELoadFilter filter, bool blocking) +{ + LL_ERRS() << "NOT IMPLEMENTED" << LL_ENDL; + return false; +} + +bool LLFilePicker::getMultipleOpenFilesModeless(ELoadFilter filter, + void (*callback)(bool, std::vector&, void*), + void* userdata) +{ + if (mLocked) + { + return false; + } + + // if local file browsing is turned off, return without opening dialog + if (!check_local_file_access_enabled()) + { + return false; + } + + auto file_filters = setupLoadFilter(filter); + + reset(); + + { + struct LLSDLFileUserdata + { + LLSDLFileUserdata(void (*callback_func)(bool, std::vector&, void*), void* callback_userdata) + : mCallback(callback_func), mUserdata(callback_userdata) + { + } + void (*mCallback)(bool, std::vector&, void*); + void* mUserdata; + }; + + auto sdl_callback = [](void* userdata, const char* const* filelist, int filter) + { + LLSDLFileUserdata* callback_struct = (LLSDLFileUserdata*)userdata; + + auto* callback_func = callback_struct->mCallback; + auto* callback_data = callback_struct->mUserdata; + delete callback_struct; // delete callback container + + std::vector rtn; + + if (!filelist) + { + LL_WARNS() << "Error during SDL file picking: " << SDL_GetError() << LL_ENDL; + callback_func(false, rtn, callback_data); + return; + } + else if (!*filelist) + { + LL_INFOS() << "User did not select any file. Dialog likely cancelled." << LL_ENDL; + callback_func(false, rtn, callback_data); + return; + } + + while (*filelist) + { + rtn.push_back(std::string(*filelist)); + filelist++; + } + + callback_func(true, rtn, callback_data); + + }; + + LLSDLFileUserdata* llfilecallback = new LLSDLFileUserdata(callback, userdata); + + SDL_PropertiesID props = SDL_CreateProperties(); + SDL_SetPointerProperty(props, SDL_PROP_FILE_DIALOG_FILTERS_POINTER, file_filters.data()); + SDL_SetNumberProperty(props, SDL_PROP_FILE_DIALOG_NFILTERS_NUMBER, file_filters.size()); + SDL_SetPointerProperty(props, SDL_PROP_FILE_DIALOG_WINDOW_POINTER, SDL_GL_GetCurrentWindow()); + SDL_SetBooleanProperty(props, SDL_PROP_FILE_DIALOG_MANY_BOOLEAN, true); + + SDL_ShowFileDialogWithProperties(SDL_FILEDIALOG_OPENFILE, sdl_callback, llfilecallback, props); + + SDL_DestroyProperties(props); + } + + return true; +} + +bool LLFilePicker::getSaveFile(ESaveFilter filter, const std::string& filename, bool blocking) +{ + LL_ERRS() << "NOT IMPLEMENTED" << LL_ENDL; + return false; +} + +bool LLFilePicker::getSaveFileModeless(ESaveFilter filter, + const std::string& filename, + void (*callback)(bool, std::string&, void*), + void* userdata) +{ + if (mLocked) + { + return false; + } + + // if local file browsing is turned off, return without opening dialog + if (!check_local_file_access_enabled()) + { + return false; + } + + std::string default_filename; + if (!filename.empty()) + { + default_filename = filename; + } + + std::vector file_filters; + + switch (filter) + { + case FFSAVE_ALL: + file_filters.push_back({ "All Files (*.*)", "*" }); + file_filters.push_back({ "WAV Sounds (*.wav)", "wav" }); + file_filters.push_back({ "Targa, Bitmap Images (*.tga; *.bmp)", "tga;bmp" }); + break; + case FFSAVE_WAV: + if (default_filename.empty()) + { + default_filename = "untitled.wav"; + } + file_filters.push_back({ "WAV Sounds (*.wav)", "wav" }); + break; + case FFSAVE_TGA: + if (default_filename.empty()) + { + default_filename = "untitled.tga"; + } + file_filters.push_back({ "Targa Images (*.tga)", "tga" }); + break; + case FFSAVE_BMP: + if (default_filename.empty()) + { + default_filename = "untitled.bmp"; + } + file_filters.push_back({ "Bitmap Images (*.bmp)", "bmp" }); + break; + case FFSAVE_PNG: + if (default_filename.empty()) + { + default_filename = "untitled.png"; + } + file_filters.push_back({ "PNG Images (*.png)", "png" }); + break; + case FFSAVE_TGAPNG: + if (default_filename.empty()) + { + //PNG by default + default_filename = "untitled.png"; + } + file_filters.push_back({ "PNG Images (*.png)", "png" }); + file_filters.push_back({ "Targa Images (*.tga)", "tga" }); + break; + + case FFSAVE_JPEG: + if (default_filename.empty()) + { + default_filename = "untitled.jpeg"; + } + file_filters.push_back({ "JPEG Images (*.jpg *.jpeg)", "jpg;jpeg" }); + break; + case FFSAVE_AVI: + if (default_filename.empty()) + { + default_filename = "untitled.avi"; + } + file_filters.push_back({ "AVI Movie File (*.avi)", "avi" }); + break; + case FFSAVE_ANIM: + if (default_filename.empty()) + { + default_filename = "untitled.xaf"; + } + file_filters.push_back({ "XAF Anim File (*.xaf)", "xaf" }); + break; + case FFSAVE_GLTF: + if (default_filename.empty()) + { + default_filename = "untitled.gltf"; + } + file_filters.push_back({ "glTF Asset File (*.gltf)", "gltf" }); + break; + case FFSAVE_XML: + if (default_filename.empty()) + { + default_filename = "untitled.xml"; + } + file_filters.push_back({ "XML File (*.xml)", "xml" }); + break; + case FFSAVE_COLLADA: + if (default_filename.empty()) + { + default_filename = "untitled.collada"; + } + file_filters.push_back({ "COLLADA File (*.collada)", "collada" }); + break; + case FFSAVE_RAW: + if (default_filename.empty()) + { + default_filename = "untitled.raw"; + } + file_filters.push_back({ "RAW files (*.raw)", "raw" }); + break; + case FFSAVE_J2C: + if (default_filename.empty()) + { + default_filename = "untitled.j2c"; + } + file_filters.push_back({ "Compressed Images (*.j2c)", "j2c" }); + break; + case FFSAVE_SCRIPT: + if (default_filename.empty()) + { + default_filename = "untitled.lsl"; + } + file_filters.push_back({ "LSL Files (*.lsl)", "lsl" }); + break; + default: + return false; + } + + reset(); + + { + struct LLSDLFileUserdata + { + LLSDLFileUserdata(void (*callback_func)(bool, std::string&, void*), void* callback_userdata) + : mCallback(callback_func), mUserdata(callback_userdata) + { + } + void (*mCallback)(bool, std::string&, void*); + void* mUserdata; + }; + + auto sdl_callback = [](void* userdata, const char* const* filelist, int filter) + { + LLSDLFileUserdata* callback_struct = (LLSDLFileUserdata*)userdata; + + auto* callback_func = callback_struct->mCallback; + auto* callback_data = callback_struct->mUserdata; + delete callback_struct; // delete callback container + + std::string rtn; + if (!filelist) + { + LL_WARNS() << "Error during SDL file picking: " << SDL_GetError() << LL_ENDL; + callback_func(false, rtn, callback_data); + return; + } + else if (!*filelist) + { + LL_INFOS() << "User did not select any file. Dialog likely cancelled." << LL_ENDL; + callback_func(false, rtn, callback_data); + return; + } + + while (*filelist) { + rtn = std::string(*filelist); + break; + } + callback_func(true, rtn, callback_data); + + }; + + LLSDLFileUserdata* llfilecallback = new LLSDLFileUserdata(callback, userdata); + + SDL_PropertiesID props = SDL_CreateProperties(); + SDL_SetPointerProperty(props, SDL_PROP_FILE_DIALOG_FILTERS_POINTER, file_filters.data()); + SDL_SetNumberProperty(props, SDL_PROP_FILE_DIALOG_NFILTERS_NUMBER, file_filters.size()); + SDL_SetPointerProperty(props, SDL_PROP_FILE_DIALOG_WINDOW_POINTER, SDL_GL_GetCurrentWindow()); + + // Disabled default file name functionality currently due to inconsistency between various SDL3 backends + // if(!default_filename.empty()) + // { + // SDL_SetStringProperty(props, SDL_PROP_FILE_DIALOG_LOCATION_STRING, default_filename.c_str()); + // } + SDL_SetBooleanProperty(props, SDL_PROP_FILE_DIALOG_MANY_BOOLEAN, false); + + SDL_ShowFileDialogWithProperties(SDL_FILEDIALOG_SAVEFILE, sdl_callback, llfilecallback, props); + + SDL_DestroyProperties(props); + } + + return true; +} +#elif LL_WINDOWS bool LLFilePicker::setupFilter(ELoadFilter filter) { @@ -1107,488 +1552,6 @@ bool LLFilePicker::getSaveFileModeless(ESaveFilter filter, #elif LL_LINUX -# if LL_GTK - -// static -void LLFilePicker::add_to_selectedfiles(gpointer data, gpointer user_data) -{ - // We need to run g_filename_to_utf8 in the user's locale - std::string saved_locale(setlocale(LC_ALL, NULL)); - setlocale(LC_ALL, ""); - - LLFilePicker* picker = (LLFilePicker*) user_data; - GError *error = NULL; - gchar* filename_utf8 = g_filename_to_utf8((gchar*)data, - -1, NULL, NULL, &error); - if (error) - { - // *FIXME. - // This condition should really be notified to the user, e.g. - // through a message box. Just logging it is inappropriate. - - // g_filename_display_name is ideal, but >= glib 2.6, so: - // a hand-rolled hacky makeASCII which disallows control chars - std::string display_name; - for (const gchar *str = (const gchar *)data; *str; str++) - { - display_name += (char)((*str >= 0x20 && *str <= 0x7E) ? *str : '?'); - } - LL_WARNS() << "g_filename_to_utf8 failed on \"" << display_name << "\": " << error->message << LL_ENDL; - } - - if (filename_utf8) - { - picker->mFiles.push_back(std::string(filename_utf8)); - LL_DEBUGS() << "ADDED FILE " << filename_utf8 << LL_ENDL; - g_free(filename_utf8); - } - - setlocale(LC_ALL, saved_locale.c_str()); -} - -// static -void LLFilePicker::chooser_responder(GtkWidget *widget, gint response, gpointer user_data) -{ - LLFilePicker* picker = (LLFilePicker*)user_data; - - LL_DEBUGS() << "GTK DIALOG RESPONSE " << response << LL_ENDL; - - if (response == GTK_RESPONSE_ACCEPT) - { - GSList *file_list = gtk_file_chooser_get_filenames(GTK_FILE_CHOOSER(widget)); - g_slist_foreach(file_list, (GFunc)add_to_selectedfiles, user_data); - g_slist_foreach(file_list, (GFunc)g_free, NULL); - g_slist_free (file_list); - } - - // let's save the extension of the last added file(considering current filter) - GtkFileFilter *gfilter = gtk_file_chooser_get_filter(GTK_FILE_CHOOSER(widget)); - if(gfilter) - { - std::string filter = gtk_file_filter_get_name(gfilter); - - if(filter == LLTrans::getString("png_image_files")) - { - picker->mCurrentExtension = ".png"; - } - else if(filter == LLTrans::getString("targa_image_files")) - { - picker->mCurrentExtension = ".tga"; - } - } - - // set the default path for this usage context. - const char* cur_folder = gtk_file_chooser_get_current_folder(GTK_FILE_CHOOSER(widget)); - if (cur_folder != NULL) - { - picker->mContextToPathMap[picker->mCurContextName] = cur_folder; - } - - gtk_widget_destroy(widget); - gtk_main_quit(); -} - - -GtkWindow* LLFilePicker::buildFilePicker(bool is_save, bool is_folder, std::string context) -{ -#ifndef LL_MESA_HEADLESS - if (LLWindowSDL::ll_try_gtk_init()) - { - GtkWidget *win = NULL; - GtkFileChooserAction pickertype = - is_save? - (is_folder? - GTK_FILE_CHOOSER_ACTION_CREATE_FOLDER : - GTK_FILE_CHOOSER_ACTION_SAVE) : - (is_folder? - GTK_FILE_CHOOSER_ACTION_SELECT_FOLDER : - GTK_FILE_CHOOSER_ACTION_OPEN); - - win = gtk_file_chooser_dialog_new(NULL, NULL, - pickertype, - GTK_STOCK_CANCEL, - GTK_RESPONSE_CANCEL, - is_folder ? - GTK_STOCK_APPLY : - (is_save ? - GTK_STOCK_SAVE : - GTK_STOCK_OPEN), - GTK_RESPONSE_ACCEPT, - (gchar *)NULL); - mCurContextName = context; - - // get the default path for this usage context if it's been - // seen before. - std::map::iterator - this_path = mContextToPathMap.find(context); - if (this_path != mContextToPathMap.end()) - { - gtk_file_chooser_set_current_folder - (GTK_FILE_CHOOSER(win), - this_path->second.c_str()); - } - -# if LL_X11 - // Make GTK tell the window manager to associate this - // dialog with our non-GTK raw X11 window, which should try - // to keep it on top etc. - Window XWindowID = LLWindowSDL::get_SDL_XWindowID(); - if (None != XWindowID) - { - gtk_widget_realize(GTK_WIDGET(win)); // so we can get its gdkwin - GdkWindow *gdkwin = gdk_window_foreign_new(XWindowID); - gdk_window_set_transient_for(GTK_WIDGET(win)->window, - gdkwin); - } - else - { - LL_WARNS() << "Hmm, couldn't get xwid to use for transient." << LL_ENDL; - } -# endif //LL_X11 - - g_signal_connect (GTK_FILE_CHOOSER(win), - "response", - G_CALLBACK(LLFilePicker::chooser_responder), - this); - - gtk_window_set_modal(GTK_WINDOW(win), TRUE); - - /* GTK 2.6: if (is_folder) - gtk_file_chooser_set_show_hidden(GTK_FILE_CHOOSER(win), - TRUE); */ - - return GTK_WINDOW(win); - } - else - { - return NULL; - } -#else - return NULL; -#endif //LL_MESA_HEADLESS -} - -static void add_common_filters_to_gtkchooser(GtkFileFilter *gfilter, - GtkWindow *picker, - std::string filtername) -{ - gtk_file_filter_set_name(gfilter, filtername.c_str()); - gtk_file_chooser_add_filter(GTK_FILE_CHOOSER(picker), - gfilter); - GtkFileFilter *allfilter = gtk_file_filter_new(); - gtk_file_filter_add_pattern(allfilter, "*"); - gtk_file_filter_set_name(allfilter, LLTrans::getString("all_files").c_str()); - gtk_file_chooser_add_filter(GTK_FILE_CHOOSER(picker), allfilter); - gtk_file_chooser_set_filter(GTK_FILE_CHOOSER(picker), gfilter); -} - -static std::string add_simple_pattern_filter_to_gtkchooser(GtkWindow *picker, - std::string pattern, - std::string filtername) -{ - GtkFileFilter *gfilter = gtk_file_filter_new(); - gtk_file_filter_add_pattern(gfilter, pattern.c_str()); - add_common_filters_to_gtkchooser(gfilter, picker, filtername); - return filtername; -} - -static std::string add_simple_mime_filter_to_gtkchooser(GtkWindow *picker, - std::string mime, - std::string filtername) -{ - GtkFileFilter *gfilter = gtk_file_filter_new(); - gtk_file_filter_add_mime_type(gfilter, mime.c_str()); - add_common_filters_to_gtkchooser(gfilter, picker, filtername); - return filtername; -} - -static std::string add_wav_filter_to_gtkchooser(GtkWindow *picker) -{ - return add_simple_mime_filter_to_gtkchooser(picker, "audio/x-wav", - LLTrans::getString("sound_files") + " (*.wav)"); -} - -static std::string add_anim_filter_to_gtkchooser(GtkWindow *picker) -{ - GtkFileFilter *gfilter = gtk_file_filter_new(); - gtk_file_filter_add_pattern(gfilter, "*.bvh"); - gtk_file_filter_add_pattern(gfilter, "*.anim"); - std::string filtername = LLTrans::getString("animation_files") + " (*.bvh; *.anim)"; - add_common_filters_to_gtkchooser(gfilter, picker, filtername); - return filtername; -} - -static std::string add_xml_filter_to_gtkchooser(GtkWindow *picker) -{ - return add_simple_pattern_filter_to_gtkchooser(picker, "*.xml", - LLTrans::getString("xml_files") + " (*.xml)"); -} - -static std::string add_collada_filter_to_gtkchooser(GtkWindow *picker) -{ - return add_simple_pattern_filter_to_gtkchooser(picker, "*.dae", - LLTrans::getString("scene_files") + " (*.dae)"); -} - -static std::string add_imageload_filter_to_gtkchooser(GtkWindow *picker) -{ - GtkFileFilter *gfilter = gtk_file_filter_new(); - gtk_file_filter_add_pattern(gfilter, "*.tga"); - gtk_file_filter_add_mime_type(gfilter, HTTP_CONTENT_IMAGE_JPEG.c_str()); - gtk_file_filter_add_mime_type(gfilter, HTTP_CONTENT_IMAGE_PNG.c_str()); - gtk_file_filter_add_mime_type(gfilter, HTTP_CONTENT_IMAGE_BMP.c_str()); - std::string filtername = LLTrans::getString("image_files") + " (*.tga; *.bmp; *.jpg; *.png)"; - add_common_filters_to_gtkchooser(gfilter, picker, filtername); - return filtername; -} - -static std::string add_script_filter_to_gtkchooser(GtkWindow *picker) -{ - return add_simple_mime_filter_to_gtkchooser(picker, HTTP_CONTENT_TEXT_PLAIN, - LLTrans::getString("script_files") + " (*.lsl)"); -} - -static std::string add_dictionary_filter_to_gtkchooser(GtkWindow *picker) -{ - return add_simple_mime_filter_to_gtkchooser(picker, HTTP_CONTENT_TEXT_PLAIN, - LLTrans::getString("dictionary_files") + " (*.dic; *.xcu)"); -} - -static std::string add_save_texture_filter_to_gtkchooser(GtkWindow *picker) -{ - GtkFileFilter *gfilter_tga = gtk_file_filter_new(); - GtkFileFilter *gfilter_png = gtk_file_filter_new(); - - gtk_file_filter_add_pattern(gfilter_tga, "*.tga"); - gtk_file_filter_add_mime_type(gfilter_png, "image/png"); - std::string caption = LLTrans::getString("save_texture_image_files") + " (*.tga; *.png)"; - gtk_file_filter_set_name(gfilter_tga, LLTrans::getString("targa_image_files").c_str()); - gtk_file_filter_set_name(gfilter_png, LLTrans::getString("png_image_files").c_str()); - - gtk_file_chooser_add_filter(GTK_FILE_CHOOSER(picker), - gfilter_png); - gtk_file_chooser_add_filter(GTK_FILE_CHOOSER(picker), - gfilter_tga); - return caption; -} - -bool LLFilePicker::getSaveFile( ESaveFilter filter, const std::string& filename, bool blocking ) -{ - bool rtn = false; - - // if local file browsing is turned off, return without opening dialog - if (!check_local_file_access_enabled()) - { - return false; - } - - gViewerWindow->getWindow()->beforeDialog(); - - reset(); - - GtkWindow* picker = buildFilePicker(true, false, "savefile"); - - if (picker) - { - std::string suggest_name = "untitled"; - std::string suggest_ext = ""; - std::string caption = LLTrans::getString("save_file_verb") + " "; - switch (filter) - { - case FFSAVE_WAV: - caption += add_wav_filter_to_gtkchooser(picker); - suggest_ext = ".wav"; - break; - case FFSAVE_TGA: - caption += add_simple_pattern_filter_to_gtkchooser - (picker, "*.tga", LLTrans::getString("targa_image_files") + " (*.tga)"); - suggest_ext = ".tga"; - break; - case FFSAVE_BMP: - caption += add_simple_mime_filter_to_gtkchooser - (picker, HTTP_CONTENT_IMAGE_BMP, LLTrans::getString("bitmap_image_files") + " (*.bmp)"); - suggest_ext = ".bmp"; - break; - case FFSAVE_PNG: - caption += add_simple_mime_filter_to_gtkchooser - (picker, "image/png", LLTrans::getString("png_image_files") + " (*.png)"); - suggest_ext = ".png"; - break; - case FFSAVE_TGAPNG: - caption += add_save_texture_filter_to_gtkchooser(picker); - suggest_ext = ".png"; - break; - case FFSAVE_AVI: - caption += add_simple_mime_filter_to_gtkchooser - (picker, "video/x-msvideo", - LLTrans::getString("avi_movie_file") + " (*.avi)"); - suggest_ext = ".avi"; - break; - case FFSAVE_ANIM: - caption += add_simple_pattern_filter_to_gtkchooser - (picker, "*.xaf", LLTrans::getString("xaf_animation_file") + " (*.xaf)"); - suggest_ext = ".xaf"; - break; - case FFSAVE_XML: - caption += add_simple_pattern_filter_to_gtkchooser - (picker, "*.xml", LLTrans::getString("xml_file") + " (*.xml)"); - suggest_ext = ".xml"; - break; - case FFSAVE_RAW: - caption += add_simple_pattern_filter_to_gtkchooser - (picker, "*.raw", LLTrans::getString("raw_file") + " (*.raw)"); - suggest_ext = ".raw"; - break; - case FFSAVE_J2C: - // *TODO: Should this be 'image/j2c' ? - caption += add_simple_mime_filter_to_gtkchooser - (picker, "images/jp2", - LLTrans::getString("compressed_image_files") + " (*.j2c)"); - suggest_ext = ".j2c"; - break; - case FFSAVE_SCRIPT: - caption += add_script_filter_to_gtkchooser(picker); - suggest_ext = ".lsl"; - break; - default:; - break; - } - - gtk_window_set_title(GTK_WINDOW(picker), caption.c_str()); - - if (filename.empty()) - { - suggest_name += suggest_ext; - - gtk_file_chooser_set_current_name - (GTK_FILE_CHOOSER(picker), - suggest_name.c_str()); - } - else - { - gtk_file_chooser_set_current_name - (GTK_FILE_CHOOSER(picker), filename.c_str()); - } - - gtk_widget_show_all(GTK_WIDGET(picker)); - - gtk_main(); - - rtn = (getFileCount() == 1); - - if(rtn && filter == FFSAVE_TGAPNG) - { - std::string selected_file = mFiles.back(); - mFiles.pop_back(); - mFiles.push_back(selected_file + mCurrentExtension); - } - } - - gViewerWindow->getWindow()->afterDialog(); - - return rtn; -} - -bool LLFilePicker::getOpenFile( ELoadFilter filter, bool blocking ) -{ - bool rtn = false; - - // if local file browsing is turned off, return without opening dialog - if (!check_local_file_access_enabled()) - { - return false; - } - - gViewerWindow->getWindow()->beforeDialog(); - - reset(); - - GtkWindow* picker = buildFilePicker(false, false, "openfile"); - - if (picker) - { - std::string caption = LLTrans::getString("load_file_verb") + " "; - std::string filtername = ""; - switch (filter) - { - case FFLOAD_WAV: - filtername = add_wav_filter_to_gtkchooser(picker); - break; - case FFLOAD_ANIM: - filtername = add_anim_filter_to_gtkchooser(picker); - break; - case FFLOAD_XML: - filtername = add_xml_filter_to_gtkchooser(picker); - break; - case FFLOAD_GLTF: - filtername = dead_code_should_blow_up_here(picker); - break; - case FFLOAD_COLLADA: - filtername = add_collada_filter_to_gtkchooser(picker); - break; - case FFLOAD_IMAGE: - filtername = add_imageload_filter_to_gtkchooser(picker); - break; - case FFLOAD_SCRIPT: - filtername = add_script_filter_to_gtkchooser(picker); - break; - case FFLOAD_DICTIONARY: - filtername = add_dictionary_filter_to_gtkchooser(picker); - break; - default:; - break; - } - - caption += filtername; - - gtk_window_set_title(GTK_WINDOW(picker), caption.c_str()); - - gtk_widget_show_all(GTK_WIDGET(picker)); - gtk_main(); - - rtn = (getFileCount() == 1); - } - - gViewerWindow->getWindow()->afterDialog(); - - return rtn; -} - -bool LLFilePicker::getMultipleOpenFiles( ELoadFilter filter, bool blocking) -{ - bool rtn = false; - - // if local file browsing is turned off, return without opening dialog - if (!check_local_file_access_enabled()) - { - return false; - } - - gViewerWindow->getWindow()->beforeDialog(); - - reset(); - - GtkWindow* picker = buildFilePicker(false, false, "openfile"); - - if (picker) - { - gtk_file_chooser_set_select_multiple (GTK_FILE_CHOOSER(picker), - TRUE); - - gtk_window_set_title(GTK_WINDOW(picker), LLTrans::getString("load_files").c_str()); - - gtk_widget_show_all(GTK_WIDGET(picker)); - gtk_main(); - rtn = !mFiles.empty(); - } - - gViewerWindow->getWindow()->afterDialog(); - - return rtn; -} - -# else // LL_GTK - // Hacky stubs designed to facilitate fake getSaveFile and getOpenFile with // static results, when we don't have a real filepicker. @@ -1676,8 +1639,6 @@ bool LLFilePicker::getMultipleOpenFilesModeless(ELoadFilter filter, return false; } -#endif // LL_GTK - #else // not implemented bool LLFilePicker::getSaveFile( ESaveFilter filter, const std::string& filename ) diff --git a/indra/newview/llfilepicker.h b/indra/newview/llfilepicker.h index 75ff14f4cfd..5a4da61ccaa 100644 --- a/indra/newview/llfilepicker.h +++ b/indra/newview/llfilepicker.h @@ -35,6 +35,8 @@ #include "stdtypes.h" +#include + #if LL_DARWIN #include @@ -43,7 +45,6 @@ #undef check #undef require -#include #include "llstring.h" #endif @@ -54,19 +55,8 @@ #include #endif -extern "C" { -// mostly for Linux, possible on others -#if LL_GTK -# include "gtk/gtk.h" -#endif // LL_GTK -} - class LLFilePicker { -#ifdef LL_GTK - friend class LLDirPicker; - friend void chooser_responder(GtkWidget *, gint, gpointer); -#endif // LL_GTK public: // calling this before main() is undefined static LLFilePicker& instance( void ) { return sInstance; } @@ -161,14 +151,14 @@ class LLFilePicker // is enabled and if not, tidy up and indicate we're not allowed to do this. bool check_local_file_access_enabled(); -#if LL_WINDOWS +#if LL_WINDOWS && !LL_SDL_WINDOW OPENFILENAMEW mOFN; // for open and save dialogs WCHAR mFilesW[FILENAME_BUFFER_SIZE]; bool setupFilter(ELoadFilter filter); #endif -#if LL_DARWIN +#if LL_DARWIN && !LL_SDL_WINDOW S32 mPickOptions; std::vector mFileVector; @@ -184,28 +174,12 @@ class LLFilePicker void *userdata); #endif -#if LL_GTK - static void add_to_selectedfiles(gpointer data, gpointer user_data); - static void chooser_responder(GtkWidget *widget, gint response, gpointer user_data); - // we remember the last path that was accessed for a particular usage - std::map mContextToPathMap; - std::string mCurContextName; - // we also remember the extension of the last added file. - std::string mCurrentExtension; -#endif - std::vector mFiles; S32 mCurrentFile; bool mLocked; static LLFilePicker sInstance; -protected: -#if LL_GTK - GtkWindow* buildFilePicker(bool is_save, bool is_folder, - std::string context = "generic"); -#endif - public: // don't call these directly please. LLFilePicker(); diff --git a/indra/newview/llfilepicker_mac.h b/indra/newview/llfilepicker_mac.h index 77cc8540bca..d0374c5a087 100644 --- a/indra/newview/llfilepicker_mac.h +++ b/indra/newview/llfilepicker_mac.h @@ -42,6 +42,9 @@ std::unique_ptr> doLoadDialog(const std::vector* allowed_types, unsigned int flags); +// doLoadDialogModeless if window does not exists creates a modeless +// window, if it does exist, creates a 'sheet' that does not block +// thread but blocks window interractions void doLoadDialogModeless(const std::vector* allowed_types, unsigned int flags, void (*callback)(bool, std::vector&, void*), diff --git a/indra/newview/llfilepicker_mac.mm b/indra/newview/llfilepicker_mac.mm index 6cb7c4ad51c..6921cd61017 100644 --- a/indra/newview/llfilepicker_mac.mm +++ b/indra/newview/llfilepicker_mac.mm @@ -114,38 +114,73 @@ void doLoadDialogModeless(const std::vector* allowed_types, @autoreleasepool { - // Note: might need to return and save this panel - // so that it does not close immediately NSOpenPanel *panel = init_panel(allowed_types,flags); + NSWindow *mainWindow = [NSApp mainWindow]; - [panel beginWithCompletionHandler:^(NSModalResponse result) + if (mainWindow) { - std::vector outfiles; - if (result == NSModalResponseOK) + [panel beginSheetModalForWindow:mainWindow + completionHandler:^(NSModalResponse result) { - NSArray *filesToOpen = [panel URLs]; - int i, count = [filesToOpen count]; - - if (count > 0) + std::vector outfiles; + if (result == NSModalResponseOK) { - - for (i=0; i 0) + { + + for (i=0; i outfiles; + if (result == NSModalResponseOK) + { + NSArray *filesToOpen = [panel URLs]; + int i, count = [filesToOpen count]; + + if (count > 0) + { + + for (i=0; imDrawable->getScale(); - F32 source_section_length = scale.mV[VZ] / (F32)(1<=0; section -= num_steps) { LLFlexibleObjectSection *last_source_section = &source[section>>step_shift]; diff --git a/indra/newview/llfloater360capture.cpp b/indra/newview/llfloater360capture.cpp index 25970f8a089..95e7b9af41f 100644 --- a/indra/newview/llfloater360capture.cpp +++ b/indra/newview/llfloater360capture.cpp @@ -716,7 +716,7 @@ void LLFloater360Capture::onSaveLocalBtn() { // region name and URL std::string region_name; // no sensible default - std::string region_url("http://secondlife.com"); + std::string region_url("https://secondlife.com"); LLViewerRegion* region = gAgent.getRegion(); if (region) { diff --git a/indra/newview/llfloaterabout.cpp b/indra/newview/llfloaterabout.cpp index a6419f5ad49..05f6c4a8676 100644 --- a/indra/newview/llfloaterabout.cpp +++ b/indra/newview/llfloaterabout.cpp @@ -105,7 +105,7 @@ class LLFloaterAbout static const std::string sCheckUpdateListenerName; static void startFetchServerReleaseNotes(); - static void fetchServerReleaseNotesCoro(const std::string& cap_url); + static void fetchServerReleaseNotesCoro(const std::string cap_url); static void handleServerReleaseNotes(LLSD results); }; @@ -227,12 +227,12 @@ void LLFloaterAbout::startFetchServerReleaseNotes() } /*static*/ -void LLFloaterAbout::fetchServerReleaseNotesCoro(const std::string& cap_url) +void LLFloaterAbout::fetchServerReleaseNotesCoro(const std::string cap_url) { LLCoreHttpUtil::HttpCoroutineAdapter::ptr_t - httpAdapter(new LLCoreHttpUtil::HttpCoroutineAdapter("fetchServerReleaseNotesCoro", LLCore::HttpRequest::DEFAULT_POLICY_ID)); - LLCore::HttpRequest::ptr_t httpRequest(new LLCore::HttpRequest); - LLCore::HttpOptions::ptr_t httpOpts(new LLCore::HttpOptions); + httpAdapter = std::make_shared("fetchServerReleaseNotesCoro", LLCore::HttpRequest::DEFAULT_POLICY_ID); + LLCore::HttpRequest::ptr_t httpRequest = std::make_shared(); + LLCore::HttpOptions::ptr_t httpOpts = std::make_shared(); httpOpts->setWantHeaders(true); httpOpts->setFollowRedirects(false); diff --git a/indra/newview/llfloateravatarpicker.cpp b/indra/newview/llfloateravatarpicker.cpp index 08a54b7369b..c7851013c7f 100644 --- a/indra/newview/llfloateravatarpicker.cpp +++ b/indra/newview/llfloateravatarpicker.cpp @@ -34,6 +34,7 @@ #include "llfloaterreg.h" #include "llimview.h" // for gIMMgr #include "lltooldraganddrop.h" // for LLToolDragAndDrop +#include "lltrans.h" #include "llviewercontrol.h" #include "llviewerregion.h" // getCapability() #include "llworld.h" @@ -405,15 +406,50 @@ bool LLFloaterAvatarPicker::visibleItemsSelected() const } /*static*/ -void LLFloaterAvatarPicker::findCoro(std::string url, LLUUID queryID, std::string name) +void LLFloaterAvatarPicker::findByIdCoro(std::string url, LLUUID query_id, LLUUID agent_id, std::string floater_key) { LLCore::HttpRequest::policy_t httpPolicy(LLCore::HttpRequest::DEFAULT_POLICY_ID); LLCoreHttpUtil::HttpCoroutineAdapter::ptr_t - httpAdapter(new LLCoreHttpUtil::HttpCoroutineAdapter("genericPostCoro", httpPolicy)); - LLCore::HttpRequest::ptr_t httpRequest(new LLCore::HttpRequest); - LLCore::HttpOptions::ptr_t httpOpts(new LLCore::HttpOptions); + httpAdapter = std::make_shared("findByIdCoro", httpPolicy); + LLCore::HttpRequest::ptr_t httpRequest = std::make_shared(); + LLCore::HttpOptions::ptr_t httpOpts = std::make_shared(); - LL_INFOS("HttpCoroutineAdapter", "genericPostCoro") << "Generic POST for " << url << LL_ENDL; + httpOpts->setTimeout(AVATAR_PICKER_SEARCH_TIMEOUT); + + LLSD result = httpAdapter->getAndSuspend(httpRequest, url, httpOpts); + + LL_DEBUGS("Agent") << result << LL_ENDL; + + LLSD httpResults = result[LLCoreHttpUtil::HttpCoroutineAdapter::HTTP_RESULTS]; + LLCore::HttpStatus status = LLCoreHttpUtil::HttpCoroutineAdapter::getStatusFromLLSD(httpResults); + + if (status || (status == LLCore::HttpStatus(HTTP_BAD_REQUEST))) + { + result.erase(LLCoreHttpUtil::HttpCoroutineAdapter::HTTP_RESULTS); + } + else + { + result["failure_reason"] = status.toString(); + } + + LLFloaterAvatarPicker* floater = + LLFloaterReg::findTypedInstance("avatar_picker", floater_key); + if (floater) + { + floater->processResponse(query_id, result); + } +} + +/*static*/ +void LLFloaterAvatarPicker::findByNameCoro(std::string url, LLUUID queryID, std::string name) +{ + LLCore::HttpRequest::policy_t httpPolicy(LLCore::HttpRequest::DEFAULT_POLICY_ID); + LLCoreHttpUtil::HttpCoroutineAdapter::ptr_t + httpAdapter = std::make_shared("findByNameCoro", httpPolicy); + LLCore::HttpRequest::ptr_t httpRequest = std::make_shared(); + LLCore::HttpOptions::ptr_t httpOpts = std::make_shared(); + + LL_INFOS("HttpCoroutineAdapter", "genericPostCoro", "Agent") << "Generic POST for " << url << LL_ENDL; httpOpts->setTimeout(AVATAR_PICKER_SEARCH_TIMEOUT); @@ -447,6 +483,7 @@ void LLFloaterAvatarPicker::find() std::string text = getChild("Edit")->getValue().asString(); + LLUUID agent_id; size_t separator_index = text.find_first_of(" ._"); if (separator_index != text.npos) { @@ -458,51 +495,92 @@ void LLFloaterAvatarPicker::find() text = first; } } + else if (!text.empty()) + { + agent_id.set(text); + } mQueryID.generate(); + mNumResultsReturned = 0; - std::string url; - url.reserve(128); // avoid a memory allocation or two + getChild("SearchResults")->deleteAllItems(); + getChild("SearchResults")->setCommentText(getString("searching")); + getChildView("ok_btn")->setEnabled(false); - LLViewerRegion* region = gAgent.getRegion(); - if(region) + if (agent_id.notNull()) { - url = region->getCapability("AvatarPickerSearch"); - // Prefer use of capabilities to search on both SLID and display name - if (!url.empty()) + // Search by uuid + // While cache could have been nicer, it neither has a failure callback, nor + // can cleanup in case of an invalid uuid. So we go directly to the capability. + LLViewerRegion* region = gAgent.getRegion(); + if (region) { - // capability urls don't end in '/', but we need one to parse - // query parameters correctly - if (url.size() > 0 && url[url.size()-1] != '/') + std::string url; + url.reserve(128); + url = region->getCapability("GetDisplayNames"); + if (!url.empty()) { - url += "/"; - } - url += "?page_size=100&names="; - std::replace(text.begin(), text.end(), '.', ' '); - url += LLURI::escape(text); - LL_INFOS() << "avatar picker " << url << LL_ENDL; + // capability urls don't end in '/', but we need one to parse + // query parameters correctly + if (url[url.size() - 1] != '/') + { + url += "/"; + } + url += "?ids="; + url += agent_id.asString(); + LL_DEBUGS("Agent") << "avatar picker " << url << LL_ENDL; - LLCoros::instance().launch("LLFloaterAvatarPicker::findCoro", - boost::bind(&LLFloaterAvatarPicker::findCoro, url, mQueryID, getKey().asString())); + LLCoros::instance().launch("LLFloaterAvatarPicker::findCoro", + boost::bind(&LLFloaterAvatarPicker::findByIdCoro, url, mQueryID, agent_id, getKey().asString())); + } + else + { + LLSD content; + content["failure_reason"] = LLTrans::getString("ServerUnavailable"); + processResponse(mQueryID, content); + } } - else + } + else + { + std::string url; + url.reserve(128); // avoid a memory allocation or two + + LLViewerRegion* region = gAgent.getRegion(); + if (region) { - LLMessageSystem* msg = gMessageSystem; - msg->newMessage("AvatarPickerRequest"); - msg->nextBlock("AgentData"); - msg->addUUID("AgentID", gAgent.getID()); - msg->addUUID("SessionID", gAgent.getSessionID()); - msg->addUUID("QueryID", mQueryID); // not used right now - msg->nextBlock("Data"); - msg->addString("Name", text); - gAgent.sendReliableMessage(); + url = region->getCapability("AvatarPickerSearch"); + // Prefer use of capabilities to search on both SLID and display name + if (!url.empty()) + { + // capability urls don't end in '/', but we need one to parse + // query parameters correctly + if (url.size() > 0 && url[url.size() - 1] != '/') + { + url += "/"; + } + url += "?page_size=100&names="; + std::replace(text.begin(), text.end(), '.', ' '); + url += LLURI::escape(text); + LL_DEBUGS("Agent") << "avatar picker " << url << LL_ENDL; + + LLCoros::instance().launch("LLFloaterAvatarPicker::findCoro", + boost::bind(&LLFloaterAvatarPicker::findByNameCoro, url, mQueryID, getKey().asString())); + } + else + { + LLMessageSystem* msg = gMessageSystem; + msg->newMessage("AvatarPickerRequest"); + msg->nextBlock("AgentData"); + msg->addUUID("AgentID", gAgent.getID()); + msg->addUUID("SessionID", gAgent.getSessionID()); + msg->addUUID("QueryID", mQueryID); // not used right now + msg->nextBlock("Data"); + msg->addString("Name", text); + gAgent.sendReliableMessage(); + } } } - getChild("SearchResults")->deleteAllItems(); - getChild("SearchResults")->setCommentText(getString("searching")); - - getChildView("ok_btn")->setEnabled(false); - mNumResultsReturned = 0; } void LLFloaterAvatarPicker::setAllowMultiple(bool allow_multiple) diff --git a/indra/newview/llfloateravatarpicker.h b/indra/newview/llfloateravatarpicker.h index 330f1a12266..1761497f835 100644 --- a/indra/newview/llfloateravatarpicker.h +++ b/indra/newview/llfloateravatarpicker.h @@ -43,7 +43,7 @@ class LLFloaterAvatarPicker :public LLFloater typedef validate_signal_t::slot_type validate_callback_t; // The callback function will be called with an avatar name and UUID. - typedef boost::function&)> select_callback_t; + typedef std::function&)> select_callback_t; // Call this to select an avatar. static LLFloaterAvatarPicker* show(select_callback_t callback, bool allow_multiple = false, @@ -86,7 +86,8 @@ class LLFloaterAvatarPicker :public LLFloater void populateFriend(); bool visibleItemsSelected() const; // Returns true if any items in the current tab are selected. - static void findCoro(std::string url, LLUUID mQueryID, std::string mName); + static void findByIdCoro(std::string url, LLUUID query_id, LLUUID agent_id, std::string floater_key); + static void findByNameCoro(std::string url, LLUUID mQueryID, std::string mName); void find(); void setAllowMultiple(bool allow_multiple); LLScrollListCtrl* getActiveList(); diff --git a/indra/newview/llfloaterbanduration.h b/indra/newview/llfloaterbanduration.h index 4793b524f7c..0f8944a56a8 100644 --- a/indra/newview/llfloaterbanduration.h +++ b/indra/newview/llfloaterbanduration.h @@ -31,7 +31,7 @@ class LLFloaterBanDuration : public LLFloater { - typedef boost::function select_callback_t; + typedef std::function select_callback_t; public: LLFloaterBanDuration(const LLSD& target); diff --git a/indra/newview/llfloaterbulkupload.cpp b/indra/newview/llfloaterbulkupload.cpp index b898cb28b61..d11e9949f61 100644 --- a/indra/newview/llfloaterbulkupload.cpp +++ b/indra/newview/llfloaterbulkupload.cpp @@ -41,6 +41,7 @@ LLFloaterBulkUpload::LLFloaterBulkUpload(const LLSD& key) mUploadCost = key["upload_cost"].asInteger(); mUploadCount = key["upload_count"].asInteger(); mHas2kTextures = key["has_2k_textures"].asBoolean(); + mDestinationFolderId = key["dest"]; if (key["files"].isArray()) { const LLSD& files = key["files"]; @@ -125,7 +126,7 @@ void LLFloaterBulkUpload::onUpload2KCheckBox() void LLFloaterBulkUpload::onClickUpload() { - do_bulk_upload(mFiles, mAllow2kTextures); + do_bulk_upload(mFiles, mAllow2kTextures, mDestinationFolderId); closeFloater(); } diff --git a/indra/newview/llfloaterbulkupload.h b/indra/newview/llfloaterbulkupload.h index d07dc8eabe4..3d3004d84d6 100644 --- a/indra/newview/llfloaterbulkupload.h +++ b/indra/newview/llfloaterbulkupload.h @@ -59,6 +59,7 @@ class LLFloaterBulkUpload : public LLModalDialog std::vector mFiles; bool mAllow2kTextures = true; bool mHas2kTextures = false; + LLUUID mDestinationFolderId; S32 mUploadCost = 0; S32 mUploadCount = 0; }; diff --git a/indra/newview/llfloaterbvhpreview.cpp b/indra/newview/llfloaterbvhpreview.cpp index 392079efe43..3acf28044c0 100644 --- a/indra/newview/llfloaterbvhpreview.cpp +++ b/indra/newview/llfloaterbvhpreview.cpp @@ -1021,7 +1021,7 @@ void LLFloaterBvhPreview::onBtnOK(void* userdata) std::string desc = floaterp->getChild("description_form")->getValue().asString(); S32 expected_upload_cost = LLAgentBenefitsMgr::current().getAnimationUploadCost(); - LLResourceUploadInfo::ptr_t assetUploadInfo(new LLResourceUploadInfo( + LLResourceUploadInfo::ptr_t assetUploadInfo = std::make_shared( floaterp->mTransactionID, LLAssetType::AT_ANIMATION, name, desc, 0, LLFolderType::FT_NONE, LLInventoryType::IT_ANIMATION, @@ -1029,7 +1029,7 @@ void LLFloaterBvhPreview::onBtnOK(void* userdata) LLFloaterPerms::getGroupPerms("Uploads"), LLFloaterPerms::getEveryonePerms("Uploads"), expected_upload_cost, - floaterp->mDestinationFolderId)); + floaterp->mDestinationFolderId); upload_new_resource(assetUploadInfo); } diff --git a/indra/newview/llfloaterdirectory.cpp b/indra/newview/llfloaterdirectory.cpp new file mode 100644 index 00000000000..e062ca7ac6d --- /dev/null +++ b/indra/newview/llfloaterdirectory.cpp @@ -0,0 +1,100 @@ +/** + * @file llfloaterdirectory.cpp + * @brief The legacy "Search" floater + * + * $LicenseInfo:firstyear=2025&license=viewerlgpl$ + * Second Life Viewer Source Code + * Copyright (C) 2025, Linden Research, Inc. + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; + * version 2.1 of the License only. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA + * + * Linden Research, Inc., 945 Battery Street, San Francisco, CA 94111 USA + * $/LicenseInfo$ + */ + +#include "llviewerprecompiledheaders.h" + +#include "llfloaterdirectory.h" + +#include "llpaneldirevents.h" +#include "llpaneleventinfo.h" +#include "llpaneldirland.h" +#include "llpaneldirpeople.h" +#include "llpaneldirgroups.h" +#include "llpaneldirplaces.h" +#include "llpaneldirclassified.h" +#include "llpaneldirweb.h" +#include "llscrollbar.h" +#include "llviewercontrol.h" +#include "llpanelavatar.h" +#include "llpanelclassified.h" +#include "llpanelgroup.h" +#include "llpanelplaces.h" +#include "llpanelprofile.h" + +LLFloaterDirectory::LLFloaterDirectory(const std::string& name) +: LLFloater(name), + mPanelAvatarp(nullptr), + mPanelGroupp(nullptr), + mPanelPlacep(nullptr), + mPanelClassifiedp(nullptr), + mPanelEventp(nullptr) +{ +} + +LLFloaterDirectory::~LLFloaterDirectory() +{ +} + +bool LLFloaterDirectory::postBuild() +{ + const std::vector panel_names = { + "panel_dir_classified", + "panel_dir_events", + "panel_dir_places", + "panel_dir_land", + "panel_dir_people", + "panel_dir_groups" }; + + for (const std::string& panel_name : panel_names) + { + if (LLPanelDirBrowser* panel_tab = findChild(panel_name)) + { + panel_tab->setFloaterDirectory(this); + } + } + findChild("panel_dir_web")->setFloaterDirectory(this); + + mPanelAvatarp = findChild("panel_profile_secondlife"); + mPanelAvatarp->setAllowEdit(false); + mPanelGroupp = findChild("panel_group_info_sidetray"); + mPanelGroupp->hideBackBtn(); + mPanelPlacep = findChild("panel_places"); + mPanelPlacep->hideBackBtn(); + mPanelClassifiedp = findChild("panel_classified_info"); + mPanelClassifiedp->setBackgroundVisible(false); + mPanelEventp = findChild("panel_event_info"); + + return true; +} + +void LLFloaterDirectory::hideAllDetailPanels() +{ + if (mPanelAvatarp) mPanelAvatarp->setVisible(false); + if (mPanelGroupp) mPanelGroupp->setVisible(false); + if (mPanelPlacep) mPanelPlacep->setVisible(false); + if (mPanelClassifiedp) mPanelClassifiedp->setVisible(false); + if (mPanelEventp) mPanelEventp->setVisible(false); +} diff --git a/indra/newview/llfloaterdirectory.h b/indra/newview/llfloaterdirectory.h new file mode 100644 index 00000000000..de788443be6 --- /dev/null +++ b/indra/newview/llfloaterdirectory.h @@ -0,0 +1,81 @@ +/** + * @file llfloaterdirectory.h + * @brief The legacy "Search" floater + * + * $LicenseInfo:firstyear=2025&license=viewerlgpl$ + * Second Life Viewer Source Code + * Copyright (C) 2025, Linden Research, Inc. + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; + * version 2.1 of the License only. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA + * + * Linden Research, Inc., 945 Battery Street, San Francisco, CA 94111 USA + * $/LicenseInfo$ + */ + +#ifndef LL_LLFLOATERDIRECTORY_H +#define LL_LLFLOATERDIRECTORY_H + +#include "llfloater.h" +#include "lltabcontainer.h" + +#include "llpaneldirevents.h" +#include "llpaneldirland.h" +#include "llpaneldirpeople.h" +#include "llpaneldirgroups.h" +#include "llpaneldirplaces.h" +#include "llpaneldirclassified.h" + +class LLDirectoryCore; +class LLPanelDirBrowser; + +class LLPanelDirAdvanced; +class LLPanelDirClassified; +class LLPanelDirEvents; +class LLPanelDirGroups; +class LLPanelDirLand; +class LLPanelDirPeople; +class LLPanelDirPlaces; + +class LLPanelProfileSecondLife; +class LLPanelEventInfo; +class LLPanelGroup; +class LLPanelPlaces; +class LLPanelClassifiedInfo; + +// Floater to find people, places, things +class LLFloaterDirectory : public LLFloater +{ +public: + LLFloaterDirectory(const std::string& name); + /*virtual*/ ~LLFloaterDirectory(); + + void hideAllDetailPanels(); + + bool postBuild() override; + +public: + LLPanelProfileSecondLife* mPanelAvatarp; + LLPanelEventInfo* mPanelEventp; + LLPanelGroup* mPanelGroupp; + LLPanelPlaces* mPanelPlacep; + LLPanelClassifiedInfo* mPanelClassifiedp; + +private: + static LLFloaterDirectory *sInstance; +}; + +//extern BOOL gDisplayEventHack; + +#endif // LL_LLDIRECTORYFLOATER_H diff --git a/indra/newview/llfloateremojipicker.h b/indra/newview/llfloateremojipicker.h index b807adb67da..88d288b1414 100644 --- a/indra/newview/llfloateremojipicker.h +++ b/indra/newview/llfloateremojipicker.h @@ -40,8 +40,8 @@ class LLFloaterEmojiPicker : public LLFloater public: // The callback function will be called with an emoji char. - typedef boost::function pick_callback_t; - typedef boost::function close_callback_t; + typedef std::function pick_callback_t; + typedef std::function close_callback_t; LLFloaterEmojiPicker(const LLSD& key); diff --git a/indra/newview/llfloaterexperiencepicker.h b/indra/newview/llfloaterexperiencepicker.h index 0a001478f1c..d0fb611bd42 100644 --- a/indra/newview/llfloaterexperiencepicker.h +++ b/indra/newview/llfloaterexperiencepicker.h @@ -38,9 +38,9 @@ class LLFloaterExperiencePicker : public LLFloater { public: - typedef boost::function select_callback_t; + typedef std::function select_callback_t; // filter function for experiences, return true if the experience should be hidden. - typedef boost::function filter_function; + typedef std::function filter_function; typedef std::vector filter_list; static LLFloaterExperiencePicker* show( select_callback_t callback, const LLUUID& key, bool allow_multiple, bool close_on_select, filter_list filters, LLView * frustumOrigin); diff --git a/indra/newview/llfloaterexperiences.cpp b/indra/newview/llfloaterexperiences.cpp index e79055fdaec..999a473a49c 100644 --- a/indra/newview/llfloaterexperiences.cpp +++ b/indra/newview/llfloaterexperiences.cpp @@ -171,7 +171,7 @@ void LLFloaterExperiences::onOpen( const LLSD& key ) refreshContents(); return; } - region->setCapabilitiesReceivedCallback(boost::bind(&LLFloaterExperiences::refreshContents, this)); + mCapsReceivedConnection = region->setCapabilitiesReceivedCallback(boost::bind(&LLFloaterExperiences::refreshContents, this)); return; } } @@ -231,6 +231,7 @@ bool LLFloaterExperiences::updatePermissions( const LLSD& permission ) void LLFloaterExperiences::onClose( bool app_quitting ) { + mCapsReceivedConnection.disconnect(); LLEventPumps::instance().obtain("experience_permission").stopListening("LLFloaterExperiences"); LLFloater::onClose(app_quitting); } @@ -365,10 +366,10 @@ void LLFloaterExperiences::retrieveExperienceListCoro(std::string url, { LLCore::HttpRequest::policy_t httpPolicy(LLCore::HttpRequest::DEFAULT_POLICY_ID); LLCoreHttpUtil::HttpCoroutineAdapter::ptr_t - httpAdapter(new LLCoreHttpUtil::HttpCoroutineAdapter("retrieveExperienceListCoro", httpPolicy)); - LLCore::HttpRequest::ptr_t httpRequest(new LLCore::HttpRequest); - LLCore::HttpOptions::ptr_t httpOptions(new LLCore::HttpOptions); - LLCore::HttpHeaders::ptr_t httpHeaders(new LLCore::HttpHeaders); + httpAdapter = std::make_shared("retrieveExperienceListCoro", httpPolicy); + LLCore::HttpRequest::ptr_t httpRequest = std::make_shared(); + LLCore::HttpOptions::ptr_t httpOptions = std::make_shared(); + LLCore::HttpHeaders::ptr_t httpHeaders = std::make_shared(); if (url.empty()) @@ -406,7 +407,7 @@ void LLFloaterExperiences::retrieveExperienceListCoro(std::string url, { const LLSD& ids = result[it->first]; tab->setExperienceList(ids); - if (!cback.empty()) + if (cback != nullptr) { cback(tab, result); } diff --git a/indra/newview/llfloaterexperiences.h b/indra/newview/llfloaterexperiences.h index 5e657767d23..ec5f52d2f7a 100644 --- a/indra/newview/llfloaterexperiences.h +++ b/indra/newview/llfloaterexperiences.h @@ -43,7 +43,7 @@ class LLFloaterExperiences : static LLFloaterExperiences* findInstance(); protected: typedef std::map NameMap_t; - typedef boost::function Callback_t; + typedef std::function Callback_t; void clearFromRecent(const LLSD& ids); void resizeToTabs(); @@ -65,12 +65,13 @@ class LLFloaterExperiences : const std::string &errorNotify, Callback_t cback); private: - typedef boost::function < LLSD(LLCoreHttpUtil::HttpCoroutineAdapter::ptr_t, LLCore::HttpRequest::ptr_t, + typedef std::function invokationFn_t; static void retrieveExperienceListCoro(std::string url, LLHandle hparent, NameMap_t tabMapping, std::string errorNotify, Callback_t cback, invokationFn_t invoker); std::vector mPrepurchaseIds; + boost::signals2::scoped_connection mCapsReceivedConnection; }; #endif //LL_LLFLOATEREXPERIENCES_H diff --git a/indra/newview/llfloatergesture.cpp b/indra/newview/llfloatergesture.cpp index 936096d8fec..21ae98d380d 100644 --- a/indra/newview/llfloatergesture.cpp +++ b/indra/newview/llfloatergesture.cpp @@ -320,15 +320,29 @@ void LLFloaterGesture::addGesture(const LLUUID& item_id , LLMultiGesture* gestur if (gesture) { + element["columns"][0]["column"] = "active"; + element["columns"][0]["type"] = "icon"; if (gesture->mPlaying) { font_style = "BOLD"; + element["columns"][0]["value"] = "Activate_Checkmark"; } + + // Only add "playing" if we've got the name, less confusing. JC item_name = gesture->mName; - element["columns"][0]["column"] = "trigger"; - element["columns"][0]["value"] = gesture->mTrigger; - element["columns"][0]["font"]["name"] = "SANSSERIF"; - element["columns"][0]["font"]["style"] = font_style; + if (item && gesture->mPlaying) + { + item_name += " " + getString("playing"); + } + element["columns"][1]["column"] = "name"; + element["columns"][1]["value"] = item_name; + element["columns"][1]["font"]["name"] = "SANSSERIF"; + element["columns"][1]["font"]["style"] = font_style; + + element["columns"][2]["column"] = "trigger"; + element["columns"][2]["value"] = gesture->mTrigger; + element["columns"][2]["font"]["name"] = "SANSSERIF"; + element["columns"][2]["font"]["style"] = font_style; std::string key_string; std::string buffer; @@ -345,45 +359,38 @@ void LLFloaterGesture::addGesture(const LLUUID& item_id , LLMultiGesture* gestur gesture->mKey); } - element["columns"][1]["column"] = "shortcut"; - element["columns"][1]["value"] = buffer; - element["columns"][1]["font"]["name"] = "SANSSERIF"; - element["columns"][1]["font"]["style"] = font_style; - // hidden column for sorting - element["columns"][2]["column"] = "key"; - element["columns"][2]["value"] = key_string; - element["columns"][2]["font"]["name"] = "SANSSERIF"; - element["columns"][2]["font"]["style"] = font_style; - - // Only add "playing" if we've got the name, less confusing. JC - if (item && gesture->mPlaying) - { - item_name += " " + getString("playing"); - } - element["columns"][3]["column"] = "name"; - element["columns"][3]["value"] = item_name; + element["columns"][3]["column"] = "key"; + element["columns"][3]["value"] = key_string; element["columns"][3]["font"]["name"] = "SANSSERIF"; element["columns"][3]["font"]["style"] = font_style; + + element["columns"][4]["column"] = "shortcut"; + element["columns"][4]["value"] = buffer; + element["columns"][4]["font"]["name"] = "SANSSERIF"; + element["columns"][4]["font"]["style"] = font_style; } else { - element["columns"][0]["column"] = "trigger"; + element["columns"][0]["column"] = "active"; + element["columns"][0]["type"] = "icon"; element["columns"][0]["value"] = ""; - element["columns"][0]["font"]["name"] = "SANSSERIF"; - element["columns"][0]["font"]["style"] = font_style; - element["columns"][1]["column"] = "shortcut"; - element["columns"][1]["value"] = "---"; + element["columns"][1]["column"] = "name"; + element["columns"][1]["value"] = item_name; element["columns"][1]["font"]["name"] = "SANSSERIF"; element["columns"][1]["font"]["style"] = font_style; - element["columns"][2]["column"] = "key"; - element["columns"][2]["value"] = "~~~"; + element["columns"][2]["column"] = "trigger"; + element["columns"][2]["value"] = ""; element["columns"][2]["font"]["name"] = "SANSSERIF"; element["columns"][2]["font"]["style"] = font_style; - element["columns"][3]["column"] = "name"; - element["columns"][3]["value"] = item_name; + element["columns"][3]["column"] = "key"; + element["columns"][3]["value"] = "~~~"; element["columns"][3]["font"]["name"] = "SANSSERIF"; element["columns"][3]["font"]["style"] = font_style; + element["columns"][4]["column"] = "shortcut"; + element["columns"][4]["value"] = "---"; + element["columns"][4]["font"]["name"] = "SANSSERIF"; + element["columns"][4]["font"]["style"] = font_style; } LL_DEBUGS("Gesture") << "Added gesture [" << item_name << "]" << LL_ENDL; @@ -391,9 +398,18 @@ void LLFloaterGesture::addGesture(const LLUUID& item_id , LLMultiGesture* gestur LLScrollListItem* sl_item = list->addElement(element, ADD_BOTTOM); if(sl_item) { - LLFontGL::StyleFlags style = LLGestureMgr::getInstance()->isGestureActive(item_id) ? LLFontGL::BOLD : LLFontGL::NORMAL; - // *TODO find out why ["font"]["style"] does not affect font style - ((LLScrollListText*)sl_item->getColumn(0))->setFontStyle(style); + if (LLGestureMgr::getInstance()->isGestureActive(item_id)) + { + // If gesture was not yet loaded, will have to set active state here + ((LLScrollListIcon*)sl_item->getColumn(0))->setValue("Activate_Checkmark"); + ((LLScrollListIcon*)sl_item->getColumn(0))->setIconSize(10); + ((LLScrollListText*)sl_item->getColumn(1))->setFontStyle(LLFontGL::BOLD); + } + else + { + ((LLScrollListIcon*)sl_item->getColumn(0))->setValue(""); + ((LLScrollListText*)sl_item->getColumn(1))->setFontStyle(LLFontGL::NORMAL); + } } } diff --git a/indra/newview/llfloatergridstatus.cpp b/indra/newview/llfloatergridstatus.cpp index b6b844b307b..e8e36b5c932 100644 --- a/indra/newview/llfloatergridstatus.cpp +++ b/indra/newview/llfloatergridstatus.cpp @@ -90,10 +90,10 @@ void LLFloaterGridStatus::getGridStatusRSSCoro() LLCore::HttpRequest::policy_t httpPolicy(LLCore::HttpRequest::DEFAULT_POLICY_ID); LLCoreHttpUtil::HttpCoroutineAdapter::ptr_t - httpAdapter(new LLCoreHttpUtil::HttpCoroutineAdapter("getGridStatusRSSCoro", httpPolicy)); - LLCore::HttpRequest::ptr_t httpRequest(new LLCore::HttpRequest); - LLCore::HttpOptions::ptr_t httpOpts(new LLCore::HttpOptions); - LLCore::HttpHeaders::ptr_t httpHeaders(new LLCore::HttpHeaders); + httpAdapter = std::make_shared("getGridStatusRSSCoro", httpPolicy); + LLCore::HttpRequest::ptr_t httpRequest = std::make_shared(); + LLCore::HttpOptions::ptr_t httpOpts = std::make_shared(); + LLCore::HttpHeaders::ptr_t httpHeaders = std::make_shared(); httpOpts->setSSLVerifyPeer(false); // We want this data even if SSL fails httpHeaders->append(HTTP_OUT_HEADER_CONTENT_TYPE, HTTP_CONTENT_TEXT_XML); diff --git a/indra/newview/llfloatergroups.h b/indra/newview/llfloatergroups.h index be6ced40bf5..93a6deb0a31 100644 --- a/indra/newview/llfloatergroups.h +++ b/indra/newview/llfloatergroups.h @@ -40,8 +40,9 @@ #include "lluuid.h" #include "llfloater.h" +#include "llevent.h" + #include -#include #include class LLUICtrl; diff --git a/indra/newview/llfloaterimagepreview.cpp b/indra/newview/llfloaterimagepreview.cpp index c9248072732..bbff3e4c865 100644 --- a/indra/newview/llfloaterimagepreview.cpp +++ b/indra/newview/llfloaterimagepreview.cpp @@ -280,7 +280,7 @@ void LLFloaterImagePreview::onBtnOK() LLFileSystem fmt_file(new_asset_id, LLAssetType::AT_TEXTURE, LLFileSystem::WRITE); fmt_file.write(formatted->getData(), formatted->getDataSize()); - LLResourceUploadInfo::ptr_t assetUploadInfo(new LLResourceUploadInfo( + LLResourceUploadInfo::ptr_t assetUploadInfo = std::make_shared( tid, LLAssetType::AT_TEXTURE, getChild("name_form")->getValue().asString(), getChild("description_form")->getValue().asString(), @@ -289,8 +289,9 @@ void LLFloaterImagePreview::onBtnOK() LLFloaterPerms::getNextOwnerPerms("Uploads"), LLFloaterPerms::getGroupPerms("Uploads"), LLFloaterPerms::getEveryonePerms("Uploads"), - expected_upload_cost - )); + expected_upload_cost, + mDestinationFolderId + ); upload_new_resource(assetUploadInfo); } diff --git a/indra/newview/llfloaterimnearbychat.cpp b/indra/newview/llfloaterimnearbychat.cpp index b649514bff8..f0d696361ae 100644 --- a/indra/newview/llfloaterimnearbychat.cpp +++ b/indra/newview/llfloaterimnearbychat.cpp @@ -907,7 +907,7 @@ class LLChatCommandHandler : public LLCommandHandler { public: // not allowed from outside the app - LLChatCommandHandler() : LLCommandHandler("chat", UNTRUSTED_BLOCK) { } + LLChatCommandHandler() : LLCommandHandler("chat", UNTRUSTED_CLICK_ONLY) { } // Your code here bool handle(const LLSD& tokens, diff --git a/indra/newview/llfloaterimnearbychathandler.cpp b/indra/newview/llfloaterimnearbychathandler.cpp index c920a3c8989..b1071884174 100644 --- a/indra/newview/llfloaterimnearbychathandler.cpp +++ b/indra/newview/llfloaterimnearbychathandler.cpp @@ -44,6 +44,7 @@ #include "llfloaterimcontainer.h" #include "llrootview.h" #include "lllayoutstack.h" +#include "llscripteditorws.h" //add LLFloaterIMNearbyChatHandler to LLNotificationsUI namespace using namespace LLNotificationsUI; @@ -87,7 +88,7 @@ class LLFloaterIMNearbyChatScreenChannel: public LLScreenChannelBase void addChat (LLSD& chat); void arrangeToasts (); - typedef boost::function create_toast_panel_callback_t; + typedef std::function create_toast_panel_callback_t; void setCreatePanelCallback(create_toast_panel_callback_t value) { m_create_toast_panel_callback_t = value;} void onToastDestroyed (LLToast* toast, bool app_quitting); @@ -335,6 +336,7 @@ void LLFloaterIMNearbyChatScreenChannel::addChat(LLSD& chat) { if (!gSavedSettings.getBOOL("ShowScriptErrors")) return; + if (gSavedSettings.getS32("ShowScriptErrorsLocation") == 1) return; } @@ -526,6 +528,15 @@ void LLFloaterIMNearbyChatHandler::processChat(const LLChat& chat_msg, if (!gSavedSettings.getBOOL("ShowScriptErrors")) return; + if (gSavedSettings.getBOOL("ExternalWebsocketSyncEnable") && gSavedSettings.getBOOL("ExternalWebsocketForwardDebug")) + { + LLScriptEditorWSServer::ptr_t server = LLScriptEditorWSServer::getServer(); + if (server) + { + server->forwardChatToIDE(chat_msg); + } + } + // don't process debug messages from not owned objects, see EXT-7762 if (gAgentID != chat_msg.mOwnerID) { @@ -545,6 +556,16 @@ void LLFloaterIMNearbyChatHandler::processChat(const LLChat& chat_msg, return; } } + else if ((chat_msg.mChatType == CHAT_TYPE_OWNER) && + gSavedSettings.getBOOL("ExternalWebsocketSyncEnable") && + gSavedSettings.getBOOL("ExternalWebsocketForwardDebug")) + { + LLScriptEditorWSServer::ptr_t server = LLScriptEditorWSServer::getServer(); + if (server) + { + server->forwardChatToIDE(chat_msg); + } + } nearby_chat->addMessage(chat_msg, true, args); diff --git a/indra/newview/llfloaterland.cpp b/indra/newview/llfloaterland.cpp index 5c5219bcdd9..ebc91255d90 100644 --- a/indra/newview/llfloaterland.cpp +++ b/indra/newview/llfloaterland.cpp @@ -108,18 +108,6 @@ class LLParcelSelectionObserver : public LLParcelObserver virtual void changed() { LLFloaterLand::refreshAll(); } }; -// class needed to get full access to textbox inside checkbox, because LLCheckBoxCtrl::setLabel() has string as its argument. -// It was introduced while implementing EXT-4706 -class LLCheckBoxWithTBAcess : public LLCheckBoxCtrl -{ -public: - LLTextBox* getTextBox() - { - return mLabel; - } -}; - - class LLPanelLandExperiences : public LLPanel { @@ -2176,12 +2164,11 @@ void LLPanelLandOptions::refresh() mMatureCtrl->setVisible(true); LLStyle::Params style; style.image(LLUI::getUIImage(gFloaterView->getParentFloater(this)->getString("maturity_icon_moderate"))); - LLCheckBoxWithTBAcess* fullaccess_mature_ctrl = (LLCheckBoxWithTBAcess*)mMatureCtrl; - fullaccess_mature_ctrl->getTextBox()->setText(LLStringExplicit("")); - fullaccess_mature_ctrl->getTextBox()->appendImageSegment(style); - fullaccess_mature_ctrl->getTextBox()->appendText(getString("mature_check_mature"), false); - fullaccess_mature_ctrl->setToolTip(getString("mature_check_mature_tooltip")); - fullaccess_mature_ctrl->reshape(fullaccess_mature_ctrl->getRect().getWidth(), fullaccess_mature_ctrl->getRect().getHeight(), false); + mMatureCtrl->getTextBox()->setText(LLStringExplicit("")); + mMatureCtrl->getTextBox()->appendImageSegment(style); + mMatureCtrl->getTextBox()->appendText(getString("mature_check_mature"), false); + mMatureCtrl->setToolTip(getString("mature_check_mature_tooltip")); + mMatureCtrl->reshape(mMatureCtrl->getRect().getWidth(), mMatureCtrl->getRect().getHeight(), false); // they can see the checkbox, but its disposition depends on the // state of the region diff --git a/indra/newview/llfloatermodeluploadbase.cpp b/indra/newview/llfloatermodeluploadbase.cpp index ec4f7593ca1..dd53d0ffcf5 100644 --- a/indra/newview/llfloatermodeluploadbase.cpp +++ b/indra/newview/llfloatermodeluploadbase.cpp @@ -66,8 +66,8 @@ void LLFloaterModelUploadBase::requestAgentUploadPermissionsCoro(std::string url { LLCore::HttpRequest::policy_t httpPolicy(LLCore::HttpRequest::DEFAULT_POLICY_ID); LLCoreHttpUtil::HttpCoroutineAdapter::ptr_t - httpAdapter(new LLCoreHttpUtil::HttpCoroutineAdapter("MeshUploadFlag", httpPolicy)); - LLCore::HttpRequest::ptr_t httpRequest(new LLCore::HttpRequest); + httpAdapter = std::make_shared("MeshUploadFlag", httpPolicy); + LLCore::HttpRequest::ptr_t httpRequest = std::make_shared(); LLSD result = httpAdapter->getAndSuspend(httpRequest, url); diff --git a/indra/newview/llfloatermyscripts.cpp b/indra/newview/llfloatermyscripts.cpp index 0283855f154..8685243867e 100644 --- a/indra/newview/llfloatermyscripts.cpp +++ b/indra/newview/llfloatermyscripts.cpp @@ -93,8 +93,8 @@ void LLFloaterMyScripts::getAttachmentLimitsCoro(std::string url) { LLCore::HttpRequest::policy_t httpPolicy(LLCore::HttpRequest::DEFAULT_POLICY_ID); LLCoreHttpUtil::HttpCoroutineAdapter::ptr_t - httpAdapter(new LLCoreHttpUtil::HttpCoroutineAdapter("getAttachmentLimitsCoro", httpPolicy)); - LLCore::HttpRequest::ptr_t httpRequest(new LLCore::HttpRequest); + httpAdapter = std::make_shared("getAttachmentLimitsCoro", httpPolicy); + LLCore::HttpRequest::ptr_t httpRequest = std::make_shared(); LLSD result = httpAdapter->getAndSuspend(httpRequest, url); diff --git a/indra/newview/llfloaternotificationstabbed.cpp b/indra/newview/llfloaternotificationstabbed.cpp index e571011acfe..8eeba095b2b 100644 --- a/indra/newview/llfloaternotificationstabbed.cpp +++ b/indra/newview/llfloaternotificationstabbed.cpp @@ -45,7 +45,6 @@ LLFloaterNotificationsTabbed::LLFloaterNotificationsTabbed(const LLSD& key) : LL mGroupNoticeMessageList(NULL), mTransactionMessageList(NULL), mSystemMessageList(NULL), - mNotificationsSeparator(NULL), mNotificationsTabContainer(NULL), NOTIFICATION_TABBED_ANCHOR_NAME("notification_well_panel"), IM_WELL_ANCHOR_NAME("im_well_panel"), @@ -54,7 +53,7 @@ LLFloaterNotificationsTabbed::LLFloaterNotificationsTabbed(const LLSD& key) : LL { setOverlapsScreenChannel(true); mNotificationUpdates.reset(new NotificationTabbedChannel(this)); - mNotificationsSeparator = new LLNotificationSeparator(); + mNotificationsSeparator = std::make_unique(); } //--------------------------------------------------------------------------------- @@ -117,6 +116,7 @@ void LLFloaterNotificationsTabbed::setSysWellChiclet(LLSysWellChiclet* chiclet) //--------------------------------------------------------------------------------- LLFloaterNotificationsTabbed::~LLFloaterNotificationsTabbed() { + mNotificationsSeparator.reset(); } //--------------------------------------------------------------------------------- diff --git a/indra/newview/llfloaternotificationstabbed.h b/indra/newview/llfloaternotificationstabbed.h index 87e880c8d27..49dfe6033fb 100644 --- a/indra/newview/llfloaternotificationstabbed.h +++ b/indra/newview/llfloaternotificationstabbed.h @@ -162,7 +162,7 @@ class LLFloaterNotificationsTabbed : public LLTransientDockableFloater LLNotificationListView* mGroupNoticeMessageList; LLNotificationListView* mTransactionMessageList; LLNotificationListView* mSystemMessageList; - LLNotificationSeparator* mNotificationsSeparator; + std::unique_ptr mNotificationsSeparator; LLTabContainer* mNotificationsTabContainer; LLButton* mDeleteAllBtn; LLButton* mCollapseAllBtn; diff --git a/indra/newview/llfloaterpay.cpp b/indra/newview/llfloaterpay.cpp index e4e7c4ee399..d5e45c09e30 100644 --- a/indra/newview/llfloaterpay.cpp +++ b/indra/newview/llfloaterpay.cpp @@ -127,8 +127,8 @@ const S32 PAY_AMOUNT_NOTIFICATION = 200; LLFloaterPay::LLFloaterPay(const LLSD& key) : LLFloater(key), mCallbackData(), - mCallback(NULL), - mObjectNameText(NULL), + mCallback(nullptr), + mObjectNameText(nullptr), mTargetUUID(key.asUUID()), mTargetIsGroup(false), mHaveName(false) @@ -154,7 +154,7 @@ bool LLFloaterPay::postBuild() { S32 i = 0; - give_money_ptr info = give_money_ptr(new LLGiveMoneyInfo(this, PAY_BUTTON_DEFAULT_0)); + give_money_ptr info = std::make_shared(this, PAY_BUTTON_DEFAULT_0); mCallbackData.push_back(info); childSetAction("fastpay 1", boost::bind(LLFloaterPay::onGive, info)); @@ -164,7 +164,7 @@ bool LLFloaterPay::postBuild() mQuickPayInfo[i] = info; ++i; - info = give_money_ptr(new LLGiveMoneyInfo(this, PAY_BUTTON_DEFAULT_1)); + info = std::make_shared(this, PAY_BUTTON_DEFAULT_1); mCallbackData.push_back(info); childSetAction("fastpay 5", boost::bind(LLFloaterPay::onGive, info)); @@ -174,7 +174,7 @@ bool LLFloaterPay::postBuild() mQuickPayInfo[i] = info; ++i; - info = give_money_ptr(new LLGiveMoneyInfo(this, PAY_BUTTON_DEFAULT_2)); + info = std::make_shared(this, PAY_BUTTON_DEFAULT_2); mCallbackData.push_back(info); childSetAction("fastpay 10", boost::bind(LLFloaterPay::onGive, info)); @@ -184,7 +184,7 @@ bool LLFloaterPay::postBuild() mQuickPayInfo[i] = info; ++i; - info = give_money_ptr(new LLGiveMoneyInfo(this, PAY_BUTTON_DEFAULT_3)); + info = std::make_shared(this, PAY_BUTTON_DEFAULT_3); mCallbackData.push_back(info); childSetAction("fastpay 20", boost::bind(LLFloaterPay::onGive, info)); diff --git a/indra/newview/llfloaterperms.cpp b/indra/newview/llfloaterperms.cpp index 7311f0deb65..4c3578119ee 100644 --- a/indra/newview/llfloaterperms.cpp +++ b/indra/newview/llfloaterperms.cpp @@ -209,8 +209,8 @@ void LLFloaterPermsDefault::updateCapCoro(std::string url) std::string previousReason; LLCore::HttpRequest::policy_t httpPolicy(LLCore::HttpRequest::DEFAULT_POLICY_ID); LLCoreHttpUtil::HttpCoroutineAdapter::ptr_t - httpAdapter(new LLCoreHttpUtil::HttpCoroutineAdapter("genericPostCoro", httpPolicy)); - LLCore::HttpRequest::ptr_t httpRequest(new LLCore::HttpRequest); + httpAdapter = std::make_shared("updateCapCoro", httpPolicy); + LLCore::HttpRequest::ptr_t httpRequest = std::make_shared(); LLSD postData = LLSD::emptyMap(); postData["default_object_perm_masks"]["Group"] = diff --git a/indra/newview/llfloaterpostprocess.cpp b/indra/newview/llfloaterpostprocess.cpp deleted file mode 100644 index 616c13cdc79..00000000000 --- a/indra/newview/llfloaterpostprocess.cpp +++ /dev/null @@ -1,229 +0,0 @@ -/** - * @file llfloaterpostprocess.cpp - * @brief LLFloaterPostProcess class definition - * - * $LicenseInfo:firstyear=2007&license=viewerlgpl$ - * Second Life Viewer Source Code - * Copyright (C) 2010, Linden Research, Inc. - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; - * version 2.1 of the License only. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA - * - * Linden Research, Inc., 945 Battery Street, San Francisco, CA 94111 USA - * $/LicenseInfo$ - */ - -#include "llviewerprecompiledheaders.h" - -#include "llfloaterpostprocess.h" - -#include "llsliderctrl.h" -#include "llcheckboxctrl.h" -#include "llnotificationsutil.h" -#include "lluictrlfactory.h" -#include "llviewerdisplay.h" -#include "llpostprocess.h" -#include "llcombobox.h" -#include "lllineeditor.h" -#include "llviewerwindow.h" - - -LLFloaterPostProcess::LLFloaterPostProcess(const LLSD& key) - : LLFloater(key) -{ -} - -LLFloaterPostProcess::~LLFloaterPostProcess() -{ - - -} -bool LLFloaterPostProcess::postBuild() -{ - /// Color Filter Callbacks - childSetCommitCallback("ColorFilterToggle", &LLFloaterPostProcess::onBoolToggle, (char*)"enable_color_filter"); - //childSetCommitCallback("ColorFilterGamma", &LLFloaterPostProcess::onFloatControlMoved, &(gPostProcess->tweaks.gamma())); - childSetCommitCallback("ColorFilterBrightness", &LLFloaterPostProcess::onFloatControlMoved, (char*)"brightness"); - childSetCommitCallback("ColorFilterSaturation", &LLFloaterPostProcess::onFloatControlMoved, (char*)"saturation"); - childSetCommitCallback("ColorFilterContrast", &LLFloaterPostProcess::onFloatControlMoved, (char*)"contrast"); - - childSetCommitCallback("ColorFilterBaseR", &LLFloaterPostProcess::onColorControlRMoved, (char*)"contrast_base"); - childSetCommitCallback("ColorFilterBaseG", &LLFloaterPostProcess::onColorControlGMoved, (char*)"contrast_base"); - childSetCommitCallback("ColorFilterBaseB", &LLFloaterPostProcess::onColorControlBMoved, (char*)"contrast_base"); - childSetCommitCallback("ColorFilterBaseI", &LLFloaterPostProcess::onColorControlIMoved, (char*)"contrast_base"); - - /// Night Vision Callbacks - childSetCommitCallback("NightVisionToggle", &LLFloaterPostProcess::onBoolToggle, (char*)"enable_night_vision"); - childSetCommitCallback("NightVisionBrightMult", &LLFloaterPostProcess::onFloatControlMoved, (char*)"brightness_multiplier"); - childSetCommitCallback("NightVisionNoiseSize", &LLFloaterPostProcess::onFloatControlMoved, (char*)"noise_size"); - childSetCommitCallback("NightVisionNoiseStrength", &LLFloaterPostProcess::onFloatControlMoved, (char*)"noise_strength"); - - /// Bloom Callbacks - childSetCommitCallback("BloomToggle", &LLFloaterPostProcess::onBoolToggle, (char*)"enable_bloom"); - childSetCommitCallback("BloomExtract", &LLFloaterPostProcess::onFloatControlMoved, (char*)"extract_low"); - childSetCommitCallback("BloomSize", &LLFloaterPostProcess::onFloatControlMoved, (char*)"bloom_width"); - childSetCommitCallback("BloomStrength", &LLFloaterPostProcess::onFloatControlMoved, (char*)"bloom_strength"); - - // Effect loading and saving. - LLComboBox* comboBox = getChild("PPEffectsCombo"); - getChild("PPLoadEffect")->setCommitCallback(boost::bind(&LLFloaterPostProcess::onLoadEffect, this, comboBox)); - comboBox->setCommitCallback(boost::bind(&LLFloaterPostProcess::onChangeEffectName, this, _1)); - - LLLineEditor* editBox = getChild("PPEffectNameEditor"); - getChild("PPSaveEffect")->setCommitCallback(boost::bind(&LLFloaterPostProcess::onSaveEffect, this, editBox)); - - syncMenu(); - return true; -} - -// Bool Toggle -void LLFloaterPostProcess::onBoolToggle(LLUICtrl* ctrl, void* userData) -{ - char const * boolVariableName = (char const *)userData; - - // check the bool - LLCheckBoxCtrl* cbCtrl = static_cast(ctrl); - gPostProcess->tweaks[boolVariableName] = cbCtrl->getValue(); -} - -// Float Moved -void LLFloaterPostProcess::onFloatControlMoved(LLUICtrl* ctrl, void* userData) -{ - char const * floatVariableName = (char const *)userData; - LLSliderCtrl* sldrCtrl = static_cast(ctrl); - gPostProcess->tweaks[floatVariableName] = sldrCtrl->getValue(); -} - -// Color Moved -void LLFloaterPostProcess::onColorControlRMoved(LLUICtrl* ctrl, void* userData) -{ - char const * floatVariableName = (char const *)userData; - LLSliderCtrl* sldrCtrl = static_cast(ctrl); - gPostProcess->tweaks[floatVariableName][0] = sldrCtrl->getValue(); -} - -// Color Moved -void LLFloaterPostProcess::onColorControlGMoved(LLUICtrl* ctrl, void* userData) -{ - char const * floatVariableName = (char const *)userData; - LLSliderCtrl* sldrCtrl = static_cast(ctrl); - gPostProcess->tweaks[floatVariableName][1] = sldrCtrl->getValue(); -} - -// Color Moved -void LLFloaterPostProcess::onColorControlBMoved(LLUICtrl* ctrl, void* userData) -{ - char const * floatVariableName = (char const *)userData; - LLSliderCtrl* sldrCtrl = static_cast(ctrl); - gPostProcess->tweaks[floatVariableName][2] = sldrCtrl->getValue(); -} - -// Color Moved -void LLFloaterPostProcess::onColorControlIMoved(LLUICtrl* ctrl, void* userData) -{ - char const * floatVariableName = (char const *)userData; - LLSliderCtrl* sldrCtrl = static_cast(ctrl); - gPostProcess->tweaks[floatVariableName][3] = sldrCtrl->getValue(); -} - -void LLFloaterPostProcess::onLoadEffect(LLComboBox* comboBox) -{ - LLSD::String effectName(comboBox->getSelectedValue().asString()); - - gPostProcess->setSelectedEffect(effectName); - - syncMenu(); -} - -void LLFloaterPostProcess::onSaveEffect(LLLineEditor* editBox) -{ - std::string effectName(editBox->getValue().asString()); - - if (gPostProcess->mAllEffects.has(effectName)) - { - LLSD payload; - payload["effect_name"] = effectName; - LLNotificationsUtil::add("PPSaveEffectAlert", LLSD(), payload, boost::bind(&LLFloaterPostProcess::saveAlertCallback, this, _1, _2)); - } - else - { - gPostProcess->saveEffect(effectName); - syncMenu(); - } -} - -void LLFloaterPostProcess::onChangeEffectName(LLUICtrl* ctrl) -{ - // get the combo box and name - LLLineEditor* editBox = getChild("PPEffectNameEditor"); - - // set the parameter's new name - editBox->setValue(ctrl->getValue()); -} - -bool LLFloaterPostProcess::saveAlertCallback(const LLSD& notification, const LLSD& response) -{ - S32 option = LLNotificationsUtil::getSelectedOption(notification, response); - - // if they choose save, do it. Otherwise, don't do anything - if (option == 0) - { - gPostProcess->saveEffect(notification["payload"]["effect_name"].asString()); - - syncMenu(); - } - return false; -} - -void LLFloaterPostProcess::syncMenu() -{ - // add the combo boxe contents - LLComboBox* comboBox = getChild("PPEffectsCombo"); - - comboBox->removeall(); - - LLSD::map_const_iterator currEffect; - for(currEffect = gPostProcess->mAllEffects.beginMap(); - currEffect != gPostProcess->mAllEffects.endMap(); - ++currEffect) - { - comboBox->add(currEffect->first); - } - - // set the current effect as selected. - comboBox->selectByValue(gPostProcess->getSelectedEffect()); - - /// Sync Color Filter Menu - getChild("ColorFilterToggle")->setValue(gPostProcess->tweaks.useColorFilter()); - //getChild("ColorFilterGamma")->setValue(gPostProcess->tweaks.gamma()); - getChild("ColorFilterBrightness")->setValue(gPostProcess->tweaks.brightness()); - getChild("ColorFilterSaturation")->setValue(gPostProcess->tweaks.saturation()); - getChild("ColorFilterContrast")->setValue(gPostProcess->tweaks.contrast()); - getChild("ColorFilterBaseR")->setValue(gPostProcess->tweaks.contrastBaseR()); - getChild("ColorFilterBaseG")->setValue(gPostProcess->tweaks.contrastBaseG()); - getChild("ColorFilterBaseB")->setValue(gPostProcess->tweaks.contrastBaseB()); - getChild("ColorFilterBaseI")->setValue(gPostProcess->tweaks.contrastBaseIntensity()); - - /// Sync Night Vision Menu - getChild("NightVisionToggle")->setValue(gPostProcess->tweaks.useNightVisionShader()); - getChild("NightVisionBrightMult")->setValue(gPostProcess->tweaks.brightMult()); - getChild("NightVisionNoiseSize")->setValue(gPostProcess->tweaks.noiseSize()); - getChild("NightVisionNoiseStrength")->setValue(gPostProcess->tweaks.noiseStrength()); - - /// Sync Bloom Menu - getChild("BloomToggle")->setValue(LLSD(gPostProcess->tweaks.useBloomShader())); - getChild("BloomExtract")->setValue(gPostProcess->tweaks.extractLow()); - getChild("BloomSize")->setValue(gPostProcess->tweaks.bloomWidth()); - getChild("BloomStrength")->setValue(gPostProcess->tweaks.bloomStrength()); -} diff --git a/indra/newview/llfloaterpostprocess.h b/indra/newview/llfloaterpostprocess.h deleted file mode 100644 index 50b48d84107..00000000000 --- a/indra/newview/llfloaterpostprocess.h +++ /dev/null @@ -1,72 +0,0 @@ -/** - * @file llfloaterpostprocess.h - * @brief LLFloaterPostProcess class definition - * - * $LicenseInfo:firstyear=2007&license=viewerlgpl$ - * Second Life Viewer Source Code - * Copyright (C) 2010, Linden Research, Inc. - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; - * version 2.1 of the License only. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA - * - * Linden Research, Inc., 945 Battery Street, San Francisco, CA 94111 USA - * $/LicenseInfo$ - */ - -#ifndef LL_LLFLOATERPOSTPROCESS_H -#define LL_LLFLOATERPOSTPROCESS_H - -#include "llfloater.h" - -class LLButton; -class LLComboBox; -class LLLineEditor; -class LLSliderCtrl; -class LLTabContainer; -class LLPanelPermissions; -class LLPanelObject; -class LLPanelVolume; -class LLPanelContents; -class LLPanelFace; - -/** - * Menu for adjusting the post process settings of the world - */ -class LLFloaterPostProcess : public LLFloater -{ -public: - - LLFloaterPostProcess(const LLSD& key); - virtual ~LLFloaterPostProcess(); - bool postBuild(); - - /// post process callbacks - static void onBoolToggle(LLUICtrl* ctrl, void* userData); - static void onFloatControlMoved(LLUICtrl* ctrl, void* userData); - static void onColorControlRMoved(LLUICtrl* ctrl, void* userData); - static void onColorControlGMoved(LLUICtrl* ctrl, void* userData); - static void onColorControlBMoved(LLUICtrl* ctrl, void* userData); - static void onColorControlIMoved(LLUICtrl* ctrl, void* userData); - void onLoadEffect(LLComboBox* comboBox); - void onSaveEffect(LLLineEditor* editBox); - void onChangeEffectName(LLUICtrl* ctrl); - - /// prompts a user when overwriting an effect - bool saveAlertCallback(const LLSD& notification, const LLSD& response); - - /// sync up sliders - void syncMenu(); -}; - -#endif diff --git a/indra/newview/llfloaterpreference.cpp b/indra/newview/llfloaterpreference.cpp index 99161d8d931..b0f9ec2b19d 100644 --- a/indra/newview/llfloaterpreference.cpp +++ b/indra/newview/llfloaterpreference.cpp @@ -346,6 +346,7 @@ LLFloaterPreference::LLFloaterPreference(const LLSD& key) mCommitCallbackRegistrar.add("Pref.RememberedUsernames", boost::bind(&LLFloaterPreference::onClickRememberedUsernames, this)); mCommitCallbackRegistrar.add("Pref.SpellChecker", boost::bind(&LLFloaterPreference::onClickSpellChecker, this)); mCommitCallbackRegistrar.add("Pref.Advanced", boost::bind(&LLFloaterPreference::onClickAdvanced, this)); + mCommitCallbackRegistrar.add("Pref.Scripting", boost::bind(&LLFloaterPreference::onClickScriptingPerfs, this)); sSkin = gSavedSettings.getString("SkinCurrent"); @@ -410,11 +411,11 @@ void LLFloaterPreference::saveAvatarPropertiesCoro(const std::string cap_url, bo { LLCore::HttpRequest::policy_t httpPolicy(LLCore::HttpRequest::DEFAULT_POLICY_ID); LLCoreHttpUtil::HttpCoroutineAdapter::ptr_t - httpAdapter(new LLCoreHttpUtil::HttpCoroutineAdapter("put_avatar_properties_coro", httpPolicy)); - LLCore::HttpRequest::ptr_t httpRequest(new LLCore::HttpRequest); + httpAdapter = std::make_shared("put_avatar_properties_coro", httpPolicy); + LLCore::HttpRequest::ptr_t httpRequest = std::make_shared(); LLCore::HttpHeaders::ptr_t httpHeaders; - LLCore::HttpOptions::ptr_t httpOpts(new LLCore::HttpOptions); + LLCore::HttpOptions::ptr_t httpOpts = std::make_shared(); httpOpts->setFollowRedirects(true); std::string finalUrl = cap_url + "/" + gAgentID.asString(); @@ -1354,7 +1355,7 @@ void LLFloaterPreference::onChangeQuality(const LLSD& data) if (level >= LVL_HIGH && mLastQualityLevel < level) { constexpr U32 LOW_MEM_THRESHOLD = 4097; - U32 total_mem = (U32Megabytes)LLMemory::getMaxMemKB(); + U32 total_mem = U32Megabytes(LLMemory::getMaxMemKB()); if (total_mem < LOW_MEM_THRESHOLD) { LLSD args; @@ -1848,6 +1849,11 @@ void LLFloaterPreference::onClickAdvanced() } } +void LLFloaterPreference::onClickScriptingPerfs() +{ + LLFloaterReg::showInstance("scripting_settings"); +} + void LLFloaterPreference::onClickActionChange() { updateClickActionControls(); @@ -2068,7 +2074,7 @@ class LLPanelPreference::Updater : public LLEventTimer public: - typedef boost::function callback_t; + typedef std::function callback_t; Updater(callback_t cb, F32 period) :LLEventTimer(period), @@ -3511,7 +3517,7 @@ void LLFloaterPreference::collectSearchableItems() LLTabContainer *pRoot = getChild< LLTabContainer >( "pref core" ); if( mFilterEdit && pRoot ) { - mSearchData.reset(new ll::prefs::SearchData() ); + mSearchData = std::make_unique(); ll::prefs::TabContainerDataPtr pRootTabcontainer = ll::prefs::TabContainerDataPtr( new ll::prefs::TabContainerData ); pRootTabcontainer->mTabContainer = pRoot; diff --git a/indra/newview/llfloaterpreference.h b/indra/newview/llfloaterpreference.h index a2aa3ee8de0..831a650c45f 100644 --- a/indra/newview/llfloaterpreference.h +++ b/indra/newview/llfloaterpreference.h @@ -191,6 +191,7 @@ class LLFloaterPreference : public LLFloater, public LLAvatarPropertiesObserver, void onClickRenderExceptions(); void onClickAutoAdjustments(); void onClickAdvanced(); + void onClickScriptingPerfs(); void applyUIColor(LLUICtrl* ctrl, const LLSD& param); void getUIColor(LLUICtrl* ctrl, const LLSD& param); void onLogChatHistorySaved(); diff --git a/indra/newview/llfloaterpreferencesgraphicsadvanced.cpp b/indra/newview/llfloaterpreferencesgraphicsadvanced.cpp index a8a1e507a85..96c2e1e1e42 100644 --- a/indra/newview/llfloaterpreferencesgraphicsadvanced.cpp +++ b/indra/newview/llfloaterpreferencesgraphicsadvanced.cpp @@ -81,7 +81,7 @@ bool LLFloaterPreferenceGraphicsAdvanced::postBuild() } } -#if !LL_DARWIN +#if !LL_DARWIN && !LL_SDL_WINDOW LLCheckBoxCtrl *use_HiDPI = getChild("use HiDPI"); use_HiDPI->setVisible(false); #endif @@ -340,6 +340,12 @@ void LLFloaterPreferenceGraphicsAdvanced::disableUnavailableSettings() tonemapMix->setEnabled(is_not_vintage); exposureSlider->setEnabled(is_not_vintage); cas_slider->setEnabled(is_not_vintage); + + LLComboBox* ctrl_anisotropic = getChild("anisotropic_filter"); + if (!LLFeatureManager::instance().isFeatureAvailable("RenderAnisotropicLevel")) + { + ctrl_anisotropic->setEnabled(false); + } } void LLFloaterPreferenceGraphicsAdvanced::refreshEnabledState() @@ -384,6 +390,20 @@ void LLFloaterPreferenceGraphicsAdvanced::refreshEnabledState() getChildView("antialiasing restart")->setVisible(!LLFeatureManager::getInstance()->isFeatureAvailable("RenderDeferred")); + LLComboBox* af_combo = getChild("anisotropic_filter"); + if (2.f > gGLManager.mMaxAnisotropy) { + af_combo->remove("2x"); + } + if (4.f > gGLManager.mMaxAnisotropy) { + af_combo->remove("4x"); + } + if (8.f > gGLManager.mMaxAnisotropy) { + af_combo->remove("8x"); + } + if (16.f > gGLManager.mMaxAnisotropy) { + af_combo->remove("16x"); + } + // now turn off any features that are unavailable disableUnavailableSettings(); } diff --git a/indra/newview/llfloaterregioninfo.cpp b/indra/newview/llfloaterregioninfo.cpp index 5ec7e94fcc6..4cb6e7be964 100644 --- a/indra/newview/llfloaterregioninfo.cpp +++ b/indra/newview/llfloaterregioninfo.cpp @@ -94,7 +94,6 @@ #include "llmeshrepository.h" #include "llfloaterregionrestarting.h" #include "llpanelexperiencelisteditor.h" -#include #include "llpanelexperiencepicker.h" #include "llexperiencecache.h" #include "llpanelexperiences.h" @@ -4048,8 +4047,8 @@ void LLPanelEstateAccess::updateLists() void LLPanelEstateAccess::requestEstateGetAccessCoro(std::string url) { LLCore::HttpRequest::policy_t httpPolicy(LLCore::HttpRequest::DEFAULT_POLICY_ID); - LLCoreHttpUtil::HttpCoroutineAdapter::ptr_t httpAdapter(new LLCoreHttpUtil::HttpCoroutineAdapter("requestEstateGetAccessoCoro", httpPolicy)); - LLCore::HttpRequest::ptr_t httpRequest(new LLCore::HttpRequest); + LLCoreHttpUtil::HttpCoroutineAdapter::ptr_t httpAdapter = std::make_shared("requestEstateGetAccessoCoro", httpPolicy); + LLCore::HttpRequest::ptr_t httpRequest = std::make_shared(); LLSD result = httpAdapter->getAndSuspend(httpRequest, url); diff --git a/indra/newview/llfloaterregioninfo.h b/indra/newview/llfloaterregioninfo.h index 0036df9c3d7..e0f65315d55 100644 --- a/indra/newview/llfloaterregioninfo.h +++ b/indra/newview/llfloaterregioninfo.h @@ -515,8 +515,8 @@ class LLPanelEstateAccess : public LLPanelRegionInfo void searchAgent(LLNameListCtrl* listCtrl, const std::string& search_string); void copyListToClipboard(std::string list_name); - bool mPendingUpdate; - bool mCtrlsEnabled; + bool mPendingUpdate = false; + bool mCtrlsEnabled = false; }; #endif diff --git a/indra/newview/llfloaterregionrestartschedule.cpp b/indra/newview/llfloaterregionrestartschedule.cpp index 59bcb22dcee..cd699efd5b8 100644 --- a/indra/newview/llfloaterregionrestartschedule.cpp +++ b/indra/newview/llfloaterregionrestartschedule.cpp @@ -272,9 +272,9 @@ void LLFloaterRegionRestartSchedule::requestRegionShcheduleCoro(std::string url, { LLCore::HttpRequest::policy_t httpPolicy(LLCore::HttpRequest::DEFAULT_POLICY_ID); LLCoreHttpUtil::HttpCoroutineAdapter::ptr_t - httpAdapter(new LLCoreHttpUtil::HttpCoroutineAdapter("RegionShcheduleRequest", httpPolicy)); - LLCore::HttpRequest::ptr_t httpRequest(new LLCore::HttpRequest); - LLCore::HttpOptions::ptr_t httpOpts(new LLCore::HttpOptions); + httpAdapter = std::make_shared("RegionShcheduleRequest", httpPolicy); + LLCore::HttpRequest::ptr_t httpRequest = std::make_shared(); + LLCore::HttpOptions::ptr_t httpOpts = std::make_shared(); httpOpts->setWantHeaders(true); @@ -367,9 +367,9 @@ void LLFloaterRegionRestartSchedule::setRegionShcheduleCoro(std::string url, LLS { LLCore::HttpRequest::policy_t httpPolicy(LLCore::HttpRequest::DEFAULT_POLICY_ID); LLCoreHttpUtil::HttpCoroutineAdapter::ptr_t - httpAdapter(new LLCoreHttpUtil::HttpCoroutineAdapter("RegionShcheduleSetter", httpPolicy)); - LLCore::HttpRequest::ptr_t httpRequest(new LLCore::HttpRequest); - LLCore::HttpOptions::ptr_t httpOpts(new LLCore::HttpOptions); + httpAdapter = std::make_shared("RegionShcheduleSetter", httpPolicy); + LLCore::HttpRequest::ptr_t httpRequest = std::make_shared(); + LLCore::HttpOptions::ptr_t httpOpts = std::make_shared(); httpOpts->setWantHeaders(true); diff --git a/indra/newview/llfloaterreporter.cpp b/indra/newview/llfloaterreporter.cpp index e2c6305f4f4..7e7eb91636b 100644 --- a/indra/newview/llfloaterreporter.cpp +++ b/indra/newview/llfloaterreporter.cpp @@ -417,8 +417,8 @@ void LLFloaterReporter::requestAbuseCategoriesCoro(std::string url, LLHandle("requestAbuseCategoriesCoro", httpPolicy); + LLCore::HttpRequest::ptr_t httpRequest = std::make_shared(); LLSD result = httpAdapter->getAndSuspend(httpRequest, url); @@ -860,7 +860,7 @@ void LLFloaterReporter::sendReportViaCaps(std::string url, std::string sshot_url if(!sshot_url.empty()) { // try to upload screenshot - LLResourceUploadInfo::ptr_t uploadInfo(new LLARScreenShotUploader(report, mResourceDatap->mAssetInfo.mUuid, mResourceDatap->mAssetInfo.mType)); + LLResourceUploadInfo::ptr_t uploadInfo = std::make_shared(report, mResourceDatap->mAssetInfo.mUuid, mResourceDatap->mAssetInfo.mType); LLViewerAssetUpload::EnqueueInventoryUpload(sshot_url, uploadInfo); } else diff --git a/indra/newview/llfloaterscripting.cpp b/indra/newview/llfloaterscripting.cpp new file mode 100644 index 00000000000..0719ced58df --- /dev/null +++ b/indra/newview/llfloaterscripting.cpp @@ -0,0 +1,106 @@ +/** + * @file llfloaterscripting.cpp + * @brief Asset creation permission preferences. + * @author Jonathan Yap + * + * $LicenseInfo:firstyear=2001&license=viewerlgpl$ + * Second Life Viewer Source Code + * Copyright (C) 2025, Linden Research, Inc. + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; + * version 2.1 of the License only. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA + * + * Linden Research, Inc., 945 Battery Street, San Francisco, CA 94111 USA + * $/LicenseInfo$ + */ + +#include "llviewerprecompiledheaders.h" +#include "llcheckboxctrl.h" +#include "llfloaterscripting.h" +#include "llviewercontrol.h" +#include "llviewerwindow.h" +#include "lluictrlfactory.h" +#include "llpermissions.h" +#include "llagent.h" +#include "llviewerregion.h" +#include "llnotificationsutil.h" +#include "llsdserialize.h" +#include "llvoavatar.h" +#include "llcorehttputil.h" +#include "lleventfilter.h" +#include "lleventcoro.h" +#include "llviewermenufile.h" +#include "llappviewer.h" + +namespace +{ + class LLEditorPicker : public LLFilePickerThread + { + public: + LLEditorPicker(LLFloaterScripting *floater): + LLFilePickerThread(LLFilePicker::FFLOAD_EXE) + { + mHandle = floater->getDerivedHandle(); + } + void notify(const std::vector& filenames) override + { + if (LLAppViewer::instance()->quitRequested()) + { + return; + } + + LLFloaterScripting* floater = mHandle.get(); + if (floater && !filenames.empty()) + { + floater->pickedEditor(filenames.front()); + } + } + + private: + LLHandle mHandle; + }; + +} + +LLFloaterScripting::LLFloaterScripting(const LLSD& seed) + : LLFloater(seed) +{ + mCommitCallbackRegistrar.add("ScriptingSettings.CLOSE", boost::bind(&LLFloaterScripting::onClickClose, this)); + mCommitCallbackRegistrar.add("ScriptingSettings.BROWSE", boost::bind(&LLFloaterScripting::onClickBrowse, this)); +} + +bool LLFloaterScripting::postBuild() +{ + refresh(); + return true; +} + +void LLFloaterScripting::onClickClose() +{ + closeFloater(); +} + +void LLFloaterScripting::onClickBrowse() +{ + (new LLEditorPicker(this))->getFile(); +} + +void LLFloaterScripting::pickedEditor(std::string_view editor) +{ + assert_main_thread(); + std::stringstream cmdline; + cmdline << "\"" << editor << "\" \"%s\""; + + gSavedSettings.setString("ExternalEditor", cmdline.str()); +} diff --git a/indra/newview/llfloaterscripting.h b/indra/newview/llfloaterscripting.h new file mode 100644 index 00000000000..ca7bd3e091a --- /dev/null +++ b/indra/newview/llfloaterscripting.h @@ -0,0 +1,49 @@ +/** + * @file llfloaterscripting.h + * @brief Asset creation permission preferences. + * @author Jonathan Yap + * + * $LicenseInfo:firstyear=2002&license=viewerlgpl$ + * Second Life Viewer Source Code + * Copyright (C) 2025, 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$ + */ + +#pragma once + +#include "llfloater.h" +#include "lleventcoro.h" +#include "llcoros.h" + +class LLFloaterScripting : public LLFloater +{ + friend class LLFloaterReg; + +public: + bool postBuild() override; + void onClickClose(); + void onClickBrowse(); + + void pickedEditor(std::string_view editor); + +private: + LLFloaterScripting(const LLSD& seed); + +}; + diff --git a/indra/newview/llfloaterscriptlimits.cpp b/indra/newview/llfloaterscriptlimits.cpp index b3452a25c5a..58d624a7d09 100644 --- a/indra/newview/llfloaterscriptlimits.cpp +++ b/indra/newview/llfloaterscriptlimits.cpp @@ -178,8 +178,8 @@ void LLPanelScriptLimitsRegionMemory::getLandScriptResourcesCoro(std::string url { LLCore::HttpRequest::policy_t httpPolicy(LLCore::HttpRequest::DEFAULT_POLICY_ID); LLCoreHttpUtil::HttpCoroutineAdapter::ptr_t - httpAdapter(new LLCoreHttpUtil::HttpCoroutineAdapter("getLandScriptResourcesCoro", httpPolicy)); - LLCore::HttpRequest::ptr_t httpRequest(new LLCore::HttpRequest); + httpAdapter = std::make_shared("getLandScriptResourcesCoro", httpPolicy); + LLCore::HttpRequest::ptr_t httpRequest = std::make_shared(); LLSD postData; @@ -222,8 +222,8 @@ void LLPanelScriptLimitsRegionMemory::getLandScriptSummaryCoro(std::string url) { LLCore::HttpRequest::policy_t httpPolicy(LLCore::HttpRequest::DEFAULT_POLICY_ID); LLCoreHttpUtil::HttpCoroutineAdapter::ptr_t - httpAdapter(new LLCoreHttpUtil::HttpCoroutineAdapter("getLandScriptSummaryCoro", httpPolicy)); - LLCore::HttpRequest::ptr_t httpRequest(new LLCore::HttpRequest); + httpAdapter = std::make_shared("getLandScriptSummaryCoro", httpPolicy); + LLCore::HttpRequest::ptr_t httpRequest = std::make_shared(); LLSD result = httpAdapter->getAndSuspend(httpRequest, url); @@ -274,8 +274,8 @@ void LLPanelScriptLimitsRegionMemory::getLandScriptDetailsCoro(std::string url) { LLCore::HttpRequest::policy_t httpPolicy(LLCore::HttpRequest::DEFAULT_POLICY_ID); LLCoreHttpUtil::HttpCoroutineAdapter::ptr_t - httpAdapter(new LLCoreHttpUtil::HttpCoroutineAdapter("getLandScriptDetailsCoro", httpPolicy)); - LLCore::HttpRequest::ptr_t httpRequest(new LLCore::HttpRequest); + httpAdapter = std::make_shared("getLandScriptDetailsCoro", httpPolicy); + LLCore::HttpRequest::ptr_t httpRequest = std::make_shared(); LLSD result = httpAdapter->getAndSuspend(httpRequest, url); @@ -487,13 +487,13 @@ void LLPanelScriptLimitsRegionMemory::setRegionDetails(LLSD content) names_requested.push_back(owner_id); if (is_group_owned) { - gCacheName->getGroup(owner_id, + mGroupNameCacheConnection = gCacheName->getGroup(owner_id, boost::bind(&LLPanelScriptLimitsRegionMemory::onNameCache, this, _1, _2)); } else { - LLAvatarNameCache::get(owner_id, + mAvatarNameCacheConnection = LLAvatarNameCache::get(owner_id, boost::bind(&LLPanelScriptLimitsRegionMemory::onAvatarNameCache, this, _1, _2)); } diff --git a/indra/newview/llfloaterscriptlimits.h b/indra/newview/llfloaterscriptlimits.h index e1eb8cb079d..fe96bfbf3a6 100644 --- a/indra/newview/llfloaterscriptlimits.h +++ b/indra/newview/llfloaterscriptlimits.h @@ -136,6 +136,9 @@ class LLPanelScriptLimitsRegionMemory : public LLPanelScriptLimitsInfo, LLRemote std::vector mObjectListItems; + boost::signals2::scoped_connection mAvatarNameCacheConnection; + boost::signals2::scoped_connection mGroupNameCacheConnection; + void getLandScriptResourcesCoro(std::string url); void getLandScriptSummaryCoro(std::string url); void getLandScriptDetailsCoro(std::string url); diff --git a/indra/newview/llfloatersimplesnapshot.cpp b/indra/newview/llfloatersimplesnapshot.cpp index c0de8ab8116..55b39d91932 100644 --- a/indra/newview/llfloatersimplesnapshot.cpp +++ b/indra/newview/llfloatersimplesnapshot.cpp @@ -54,11 +54,11 @@ void post_thumbnail_image_coro(std::string cap_url, std::string path_to_image, L { LLCore::HttpRequest::policy_t httpPolicy(LLCore::HttpRequest::DEFAULT_POLICY_ID); LLCoreHttpUtil::HttpCoroutineAdapter::ptr_t - httpAdapter(new LLCoreHttpUtil::HttpCoroutineAdapter("post_profile_image_coro", httpPolicy)); - LLCore::HttpRequest::ptr_t httpRequest(new LLCore::HttpRequest); + httpAdapter = std::make_shared("post_profile_image_coro", httpPolicy); + LLCore::HttpRequest::ptr_t httpRequest = std::make_shared(); LLCore::HttpHeaders::ptr_t httpHeaders; - LLCore::HttpOptions::ptr_t httpOpts(new LLCore::HttpOptions); + LLCore::HttpOptions::ptr_t httpOpts = std::make_shared(); httpOpts->setFollowRedirects(true); LLSD result = httpAdapter->postAndSuspend(httpRequest, cap_url, first_data, httpOpts, httpHeaders); @@ -87,9 +87,9 @@ void post_thumbnail_image_coro(std::string cap_url, std::string path_to_image, L // Upload the image - LLCore::HttpRequest::ptr_t uploaderhttpRequest(new LLCore::HttpRequest); - LLCore::HttpHeaders::ptr_t uploaderhttpHeaders(new LLCore::HttpHeaders); - LLCore::HttpOptions::ptr_t uploaderhttpOpts(new LLCore::HttpOptions); + LLCore::HttpRequest::ptr_t uploaderhttpRequest = std::make_shared(); + LLCore::HttpHeaders::ptr_t uploaderhttpHeaders = std::make_shared(); + LLCore::HttpOptions::ptr_t uploaderhttpOpts = std::make_shared(); S64 length; { diff --git a/indra/newview/llfloatersimplesnapshot.h b/indra/newview/llfloatersimplesnapshot.h index 487e77469cc..5620a15d879 100644 --- a/indra/newview/llfloatersimplesnapshot.h +++ b/indra/newview/llfloatersimplesnapshot.h @@ -63,7 +63,7 @@ class LLFloaterSimpleSnapshot : public LLFloaterSnapshotBase void postSave(); - typedef boost::function completion_t; + typedef std::function completion_t; void setComplectionCallback(completion_t callback) { mUploadCompletionCallback = callback; } static void uploadThumbnail(const std::string &file_path, const LLUUID &inventory_id, diff --git a/indra/newview/llfloatertos.cpp b/indra/newview/llfloatertos.cpp index 8eec5b753ad..da4b5097381 100644 --- a/indra/newview/llfloatertos.cpp +++ b/indra/newview/llfloatertos.cpp @@ -248,9 +248,9 @@ void LLFloaterTOS::testSiteIsAliveCoro(LLHandle handle, std::string u { LLCore::HttpRequest::policy_t httpPolicy(LLCore::HttpRequest::DEFAULT_POLICY_ID); LLCoreHttpUtil::HttpCoroutineAdapter::ptr_t - httpAdapter(new LLCoreHttpUtil::HttpCoroutineAdapter("genericPostCoro", httpPolicy)); - LLCore::HttpRequest::ptr_t httpRequest(new LLCore::HttpRequest); - LLCore::HttpOptions::ptr_t httpOpts = LLCore::HttpOptions::ptr_t(new LLCore::HttpOptions); + httpAdapter = std::make_shared("testSiteIsAliveCoro", httpPolicy); + LLCore::HttpRequest::ptr_t httpRequest = std::make_shared(); + LLCore::HttpOptions::ptr_t httpOpts = std::make_shared(); httpOpts->setWantHeaders(true); httpOpts->setHeadersOnly(true); diff --git a/indra/newview/llfloatertos.h b/indra/newview/llfloatertos.h index 3bec4da58d0..82a8c8ac5ae 100644 --- a/indra/newview/llfloatertos.h +++ b/indra/newview/llfloatertos.h @@ -30,7 +30,6 @@ #include "llmodaldialog.h" #include "llassetstorage.h" #include "llmediactrl.h" -#include #include "lleventcoro.h" #include "llcoros.h" diff --git a/indra/newview/llfloaterurlentry.cpp b/indra/newview/llfloaterurlentry.cpp index 2f1857ec613..9696c3d3f8c 100644 --- a/indra/newview/llfloaterurlentry.cpp +++ b/indra/newview/llfloaterurlentry.cpp @@ -201,10 +201,10 @@ void LLFloaterURLEntry::getMediaTypeCoro(std::string url, LLHandle pa { LLCore::HttpRequest::policy_t httpPolicy(LLCore::HttpRequest::DEFAULT_POLICY_ID); LLCoreHttpUtil::HttpCoroutineAdapter::ptr_t - httpAdapter(new LLCoreHttpUtil::HttpCoroutineAdapter("getMediaTypeCoro", httpPolicy)); - LLCore::HttpRequest::ptr_t httpRequest(new LLCore::HttpRequest); - LLCore::HttpHeaders::ptr_t httpHeaders(new LLCore::HttpHeaders); - LLCore::HttpOptions::ptr_t httpOpts = LLCore::HttpOptions::ptr_t(new LLCore::HttpOptions); + httpAdapter = std::make_shared("getMediaTypeCoro", httpPolicy); + LLCore::HttpRequest::ptr_t httpRequest = std::make_shared(); + LLCore::HttpHeaders::ptr_t httpHeaders = std::make_shared(); + LLCore::HttpOptions::ptr_t httpOpts = std::make_shared(); httpOpts->setFollowRedirects(true); httpOpts->setHeadersOnly(true); diff --git a/indra/newview/llfriendcard.cpp b/indra/newview/llfriendcard.cpp index 5300627cec4..b9f19b52474 100644 --- a/indra/newview/llfriendcard.cpp +++ b/indra/newview/llfriendcard.cpp @@ -136,7 +136,7 @@ bool LLFindAgentCallingCard::operator()(LLInventoryCategory* cat, LLInventoryIte class LLInitialFriendCardsFetch : public LLInventoryFetchDescendentsObserver { public: - typedef boost::function callback_t; + typedef std::function callback_t; LLInitialFriendCardsFetch(const LLUUID& folder_id, callback_t cb) : diff --git a/indra/newview/llfriendcard.h b/indra/newview/llfriendcard.h index e3bd25aae72..f6c0a991bc7 100644 --- a/indra/newview/llfriendcard.h +++ b/indra/newview/llfriendcard.h @@ -96,7 +96,7 @@ class LLFriendCardsManager void syncFriendCardsFolders(); private: - typedef boost::function callback_t; + typedef std::function callback_t; diff --git a/indra/newview/llgesturemgr.cpp b/indra/newview/llgesturemgr.cpp index 1bbeba43ec3..550af7af533 100644 --- a/indra/newview/llgesturemgr.cpp +++ b/indra/newview/llgesturemgr.cpp @@ -71,7 +71,7 @@ LLGestureMgr::LLGestureMgr() mLoadingCount(0) { gInventory.addObserver(this); - mListener.reset(new LLGestureListener()); + mListener = std::make_shared(); } diff --git a/indra/newview/llgesturemgr.h b/indra/newview/llgesturemgr.h index 8db36c6d899..e10bc8bbb42 100644 --- a/indra/newview/llgesturemgr.h +++ b/indra/newview/llgesturemgr.h @@ -54,7 +54,7 @@ class LLGestureMgr : public LLSingleton, public LLInventoryFetchIt ~LLGestureMgr(); public: - typedef boost::function gesture_loaded_callback_t; + typedef std::function gesture_loaded_callback_t; // Maps inventory item_id to gesture typedef std::map item_map_t; typedef std::map callback_map_t; diff --git a/indra/newview/llglsandbox.cpp b/indra/newview/llglsandbox.cpp index 112008172e3..cb1068943e2 100644 --- a/indra/newview/llglsandbox.cpp +++ b/indra/newview/llglsandbox.cpp @@ -728,8 +728,7 @@ void LLViewerObjectList::renderObjectBeacons() S32 line_width = debug_beacon.mLineWidth; if (line_width != last_line_width) { - gGL.flush(); - glLineWidth( (F32)line_width ); + gGL.setLineWidth( (F32)line_width ); last_line_width = line_width; } @@ -758,8 +757,7 @@ void LLViewerObjectList::renderObjectBeacons() S32 line_width = debug_beacon.mLineWidth; if (line_width != last_line_width) { - gGL.flush(); - glLineWidth( (F32)line_width ); + gGL.setLineWidth( (F32)line_width ); last_line_width = line_width; } @@ -773,7 +771,7 @@ void LLViewerObjectList::renderObjectBeacons() } gGL.flush(); - glLineWidth(1.f); + gGL.setLineWidth(1.f); for (std::vector::iterator iter = mDebugBeacons.begin(); iter != mDebugBeacons.end(); ++iter) { @@ -808,7 +806,7 @@ void LLSky::renderSunMoonBeacons(const LLVector3& pos_agent, const LLVector3& di { pos_end.mV[i] = pos_agent.mV[i] + (50 * direction.mV[i]); } - glLineWidth((GLfloat)LLPipeline::DebugBeaconLineWidth); + gGL.setLineWidth((GLfloat)LLPipeline::DebugBeaconLineWidth); gGL.begin(LLRender::LINES); color.mV[3] *= 0.5f; gGL.color4fv(color.mV); @@ -819,7 +817,7 @@ void LLSky::renderSunMoonBeacons(const LLVector3& pos_agent, const LLVector3& di gGL.end(); gGL.flush(); - glLineWidth(1.f); + gGL.setLineWidth(1.f); } diff --git a/indra/newview/llgltfmateriallist.cpp b/indra/newview/llgltfmateriallist.cpp index 3e4aadc3815..ac8477a615d 100644 --- a/indra/newview/llgltfmateriallist.cpp +++ b/indra/newview/llgltfmateriallist.cpp @@ -723,9 +723,9 @@ void LLGLTFMaterialList::modifyMaterialCoro(std::string cap_url, LLSD overrides, { LLCore::HttpRequest::policy_t httpPolicy(LLCore::HttpRequest::DEFAULT_POLICY_ID); LLCoreHttpUtil::HttpCoroutineAdapter::ptr_t - httpAdapter(new LLCoreHttpUtil::HttpCoroutineAdapter("modifyMaterialCoro", httpPolicy)); - LLCore::HttpRequest::ptr_t httpRequest(new LLCore::HttpRequest); - LLCore::HttpOptions::ptr_t httpOpts(new LLCore::HttpOptions); + httpAdapter = std::make_shared("modifyMaterialCoro", httpPolicy); + LLCore::HttpRequest::ptr_t httpRequest = std::make_shared(); + LLCore::HttpOptions::ptr_t httpOpts = std::make_shared(); LLCore::HttpHeaders::ptr_t httpHeaders; httpOpts->setFollowRedirects(true); diff --git a/indra/newview/llgltfmaterialpreviewmgr.cpp b/indra/newview/llgltfmaterialpreviewmgr.cpp index 5a6e9565aec..446742f3160 100644 --- a/indra/newview/llgltfmaterialpreviewmgr.cpp +++ b/indra/newview/llgltfmaterialpreviewmgr.cpp @@ -428,7 +428,7 @@ bool LLGLTFPreviewTexture::render() glClearColor(0, 0, 0, 0); glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT); - LLGLDepthTest(GL_FALSE); + LLGLDepthTest depth(GL_FALSE); LLGLDisable stencil(GL_STENCIL_TEST); LLGLDisable scissor(GL_SCISSOR_TEST); SetTemporarily no_dof(&LLPipeline::RenderDepthOfField, false); @@ -462,7 +462,7 @@ bool LLGLTFPreviewTexture::render() // Set up camera and viewport const LLVector3 origin(0.0, 0.0, 0.0); camera.lookAt(origin, object_position); - camera.setAspect((F32)(mFullHeight / mFullWidth)); + camera.setAspect((F32)(mFullWidth / mFullHeight)); const LLRect texture_rect(0, mFullHeight, mFullWidth, 0); camera.setPerspective(NOT_FOR_SELECTION, texture_rect.mLeft, texture_rect.mBottom, texture_rect.getWidth(), texture_rect.getHeight(), false, camera.getNear(), MAX_FAR_CLIP*2.f); @@ -520,21 +520,17 @@ bool LLGLTFPreviewTexture::render() // *HACK: Hide mExposureMap from generateExposure gPipeline.mExposureMap.swapFBORefs(gPipeline.mLastExposure); - gPipeline.copyScreenSpaceReflections(&screen, &gPipeline.mSceneMap); gPipeline.generateLuminance(&screen, &gPipeline.mLuminanceMap); gPipeline.generateExposure(&gPipeline.mLuminanceMap, &gPipeline.mExposureMap, /*use_history = */ false); gPipeline.gammaCorrect(&screen, &gPipeline.mPostPingMap); LLVertexBuffer::unbind(); gPipeline.generateGlow(&gPipeline.mPostPingMap); gPipeline.combineGlow(&gPipeline.mPostPingMap, &screen); - gPipeline.renderDoF(&screen, &gPipeline.mPostPingMap); - gPipeline.applyFXAA(&gPipeline.mPostPingMap, &screen); // *HACK: Restore mExposureMap (it will be consumed by generateExposure next frame) gPipeline.mExposureMap.swapFBORefs(gPipeline.mLastExposure); // Final render - gDeferredPostNoDoFProgram.bind(); // From LLPipeline::renderFinalize: "Whatever is last in the above post processing chain should _always_ be rendered directly here. If not, expect problems." diff --git a/indra/newview/llgroupmgr.cpp b/indra/newview/llgroupmgr.cpp index d53b36e59f0..e0da7622799 100644 --- a/indra/newview/llgroupmgr.cpp +++ b/indra/newview/llgroupmgr.cpp @@ -1975,8 +1975,8 @@ void LLGroupMgr::getGroupBanRequestCoro(std::string url, LLUUID group_id) { LLCore::HttpRequest::policy_t httpPolicy(LLCore::HttpRequest::DEFAULT_POLICY_ID); LLCoreHttpUtil::HttpCoroutineAdapter::ptr_t - httpAdapter(new LLCoreHttpUtil::HttpCoroutineAdapter("groupMembersRequest", httpPolicy)); - LLCore::HttpRequest::ptr_t httpRequest(new LLCore::HttpRequest); + httpAdapter = std::make_shared("groupMembersRequest", httpPolicy); + LLCore::HttpRequest::ptr_t httpRequest = std::make_shared(); std::string finalUrl = url + "?group_id=" + group_id.asString(); @@ -2004,10 +2004,10 @@ void LLGroupMgr::postGroupBanRequestCoro(std::string url, LLUUID group_id, { LLCore::HttpRequest::policy_t httpPolicy(LLCore::HttpRequest::DEFAULT_POLICY_ID); LLCoreHttpUtil::HttpCoroutineAdapter::ptr_t - httpAdapter(new LLCoreHttpUtil::HttpCoroutineAdapter("groupMembersRequest", httpPolicy)); - LLCore::HttpRequest::ptr_t httpRequest(new LLCore::HttpRequest); - LLCore::HttpHeaders::ptr_t httpHeaders(new LLCore::HttpHeaders); - LLCore::HttpOptions::ptr_t httpOptions(new LLCore::HttpOptions); + httpAdapter = std::make_shared("groupMembersRequest", httpPolicy); + LLCore::HttpRequest::ptr_t httpRequest = std::make_shared(); + LLCore::HttpHeaders::ptr_t httpHeaders = std::make_shared(); + LLCore::HttpOptions::ptr_t httpOptions = std::make_shared(); httpOptions->setFollowRedirects(false); @@ -2141,9 +2141,9 @@ void LLGroupMgr::groupMembersRequestCoro(std::string url, LLUUID group_id, U32 p << ", sort_column: " << sort_column << ", sort_descending: " << sort_descending << LL_ENDL; LLCore::HttpRequest::policy_t httpPolicy(LLCore::HttpRequest::DEFAULT_POLICY_ID); LLCoreHttpUtil::HttpCoroutineAdapter::ptr_t - httpAdapter(new LLCoreHttpUtil::HttpCoroutineAdapter("groupMembersRequest", httpPolicy)); - LLCore::HttpRequest::ptr_t httpRequest(new LLCore::HttpRequest); - LLCore::HttpOptions::ptr_t httpOpts(new LLCore::HttpOptions); + httpAdapter = std::make_shared("groupMembersRequest", httpPolicy); + LLCore::HttpRequest::ptr_t httpRequest = std::make_shared(); + LLCore::HttpOptions::ptr_t httpOpts = std::make_shared(); LLSD postData = LLSD::emptyMap(); postData["group_id"] = group_id; diff --git a/indra/newview/llimprocessing.cpp b/indra/newview/llimprocessing.cpp index 7cd0171a370..779ed725acb 100644 --- a/indra/newview/llimprocessing.cpp +++ b/indra/newview/llimprocessing.cpp @@ -202,9 +202,19 @@ void inventory_offer_handler(LLOfferInfo* info) auto indx = msg.find(" ( http://slurl.com/secondlife/"); if (indx == std::string::npos) { - // try to find new slurl host + // https + indx = msg.find(" ( https://slurl.com/secondlife/"); + } + if (indx == std::string::npos) + { + // try to find new slurl http host indx = msg.find(" ( http://maps.secondlife.com/secondlife/"); } + if (indx == std::string::npos) + { + // try to find new slurl https host + indx = msg.find(" ( https://maps.secondlife.com/secondlife/"); + } if (indx >= 0) { LLStringUtil::truncate(msg, indx); @@ -1551,8 +1561,8 @@ void LLIMProcessing::requestOfflineMessagesCoro(std::string url) { LLCore::HttpRequest::policy_t httpPolicy(LLCore::HttpRequest::DEFAULT_POLICY_ID); LLCoreHttpUtil::HttpCoroutineAdapter::ptr_t - httpAdapter(new LLCoreHttpUtil::HttpCoroutineAdapter("requestOfflineMessagesCoro", httpPolicy)); - LLCore::HttpRequest::ptr_t httpRequest(new LLCore::HttpRequest); + httpAdapter = std::make_shared("requestOfflineMessagesCoro", httpPolicy); + LLCore::HttpRequest::ptr_t httpRequest = std::make_shared(); LLSD result = httpAdapter->getAndSuspend(httpRequest, url); diff --git a/indra/newview/llimview.cpp b/indra/newview/llimview.cpp index bda4afcc04b..ad01e11d483 100644 --- a/indra/newview/llimview.cpp +++ b/indra/newview/llimview.cpp @@ -429,8 +429,8 @@ void startConferenceCoro(std::string url, { LLCore::HttpRequest::policy_t httpPolicy(LLCore::HttpRequest::DEFAULT_POLICY_ID); LLCoreHttpUtil::HttpCoroutineAdapter::ptr_t - httpAdapter(new LLCoreHttpUtil::HttpCoroutineAdapter("ConferenceChatStart", httpPolicy)); - LLCore::HttpRequest::ptr_t httpRequest(new LLCore::HttpRequest); + httpAdapter = std::make_shared("ConferenceChatStart", httpPolicy); + LLCore::HttpRequest::ptr_t httpRequest = std::make_shared(); LLSD postData; postData["method"] = "start conference"; @@ -478,8 +478,8 @@ void startConferenceCoro(std::string url, void startP2PVoiceCoro(std::string url, LLUUID sessionID, LLUUID creatorId, LLUUID otherParticipantId) { LLCore::HttpRequest::policy_t httpPolicy(LLCore::HttpRequest::DEFAULT_POLICY_ID); - LLCoreHttpUtil::HttpCoroutineAdapter::ptr_t httpAdapter(new LLCoreHttpUtil::HttpCoroutineAdapter("StartP2PVoiceCoro", httpPolicy)); - LLCore::HttpRequest::ptr_t httpRequest(new LLCore::HttpRequest); + LLCoreHttpUtil::HttpCoroutineAdapter::ptr_t httpAdapter = std::make_shared("StartP2PVoiceCoro", httpPolicy); + LLCore::HttpRequest::ptr_t httpRequest = std::make_shared(); LLSD postData; postData["method"] = "start p2p voice"; @@ -518,8 +518,8 @@ void chatterBoxInvitationCoro(std::string url, LLUUID sessionId, LLIMMgr::EInvit { LLCore::HttpRequest::policy_t httpPolicy(LLCore::HttpRequest::DEFAULT_POLICY_ID); LLCoreHttpUtil::HttpCoroutineAdapter::ptr_t - httpAdapter(new LLCoreHttpUtil::HttpCoroutineAdapter("ConferenceInviteStart", httpPolicy)); - LLCore::HttpRequest::ptr_t httpRequest(new LLCore::HttpRequest); + httpAdapter = std::make_shared("ConferenceInviteStart", httpPolicy); + LLCore::HttpRequest::ptr_t httpRequest = std::make_shared(); LLSD postData; postData["method"] = "accept invitation"; @@ -636,8 +636,8 @@ void chatterBoxHistoryCoro(std::string url, LLUUID sessionId, std::string from, { // if parameters from, message and timestamp have values, they are a message that opened chat LLCore::HttpRequest::policy_t httpPolicy(LLCore::HttpRequest::DEFAULT_POLICY_ID); LLCoreHttpUtil::HttpCoroutineAdapter::ptr_t - httpAdapter(new LLCoreHttpUtil::HttpCoroutineAdapter("ChatHistory", httpPolicy)); - LLCore::HttpRequest::ptr_t httpRequest(new LLCore::HttpRequest); + httpAdapter = std::make_shared("ChatHistory", httpPolicy); + LLCore::HttpRequest::ptr_t httpRequest = std::make_shared(); LLSD postData; postData["method"] = "fetch history"; diff --git a/indra/newview/llinventorybridge.cpp b/indra/newview/llinventorybridge.cpp index e322d3ae284..848f28f933a 100644 --- a/indra/newview/llinventorybridge.cpp +++ b/indra/newview/llinventorybridge.cpp @@ -3316,7 +3316,7 @@ bool move_inv_category_world_to_agent(const LLUUID& object_id, if (drop && accept) { - std::shared_ptr move_inv(new LLMoveInv); + std::shared_ptr move_inv = std::make_shared(); move_inv->mObjectID = object_id; move_inv->mCategoryID = category_id; move_inv->mCallback = callback; @@ -5989,7 +5989,7 @@ bool LLFolderBridge::dragItemIntoFolder(LLInventoryItem* inv_item, if (accept && drop) { LLUUID item_id = inv_item->getUUID(); - std::shared_ptr move_inv (new LLMoveInv()); + std::shared_ptr move_inv = std::make_shared(); move_inv->mObjectID = inv_item->getParentUUID(); two_uuids_t item_pair(mUUID, item_id); move_inv->mMoveList.push_back(item_pair); diff --git a/indra/newview/llinventorybridge.h b/indra/newview/llinventorybridge.h index d96adbd1d21..decb2c05287 100644 --- a/indra/newview/llinventorybridge.h +++ b/indra/newview/llinventorybridge.h @@ -239,7 +239,7 @@ class LLItemBridge : public LLInvFVBridge const LLUUID& uuid) : LLInvFVBridge(inventory, root, uuid) {} - typedef boost::function slurl_callback_t; + typedef std::function slurl_callback_t; virtual void performAction(LLInventoryModel* model, std::string action); virtual void selectItem(); @@ -833,7 +833,7 @@ void rez_attachment(LLViewerInventoryItem* item, bool move_inv_category_world_to_agent(const LLUUID& object_id, const LLUUID& category_id, bool drop, - std::function callback = NULL, + std::function callback = nullptr, void* user_data = NULL, LLInventoryFilter* filter = NULL); diff --git a/indra/newview/llinventoryfunctions.cpp b/indra/newview/llinventoryfunctions.cpp index e6b33453d51..3cc57e851f1 100644 --- a/indra/newview/llinventoryfunctions.cpp +++ b/indra/newview/llinventoryfunctions.cpp @@ -1758,7 +1758,7 @@ bool sort_alpha(const LLViewerInventoryCategory* cat1, const LLViewerInventoryCa // The only inventory changes that are done is to move and sort folders containing no-copy items to stock folders. // @pending_callbacks - how many callbacks we are waiting for, must be inited before use // @result - true if things validate, false if issues are raised, must be inited before use -typedef boost::function validation_result_callback_t; +typedef std::function validation_result_callback_t; void validate_marketplacelistings( LLInventoryCategory* cat, validation_result_callback_t cb_result, diff --git a/indra/newview/llinventoryfunctions.h b/indra/newview/llinventoryfunctions.h index 77a2a188773..eba67be3138 100644 --- a/indra/newview/llinventoryfunctions.h +++ b/indra/newview/llinventoryfunctions.h @@ -151,13 +151,13 @@ class LLMarketplaceValidator: public LLSingleton LOG_CLASS(LLMarketplaceValidator); public: - typedef boost::function validation_msg_callback_t; - typedef boost::function validation_done_callback_t; + typedef std::function validation_msg_callback_t; + typedef std::function validation_done_callback_t; void validateMarketplaceListings( const LLUUID &category_id, - validation_done_callback_t cb_done = NULL, - validation_msg_callback_t cb_msg = NULL, + validation_done_callback_t cb_done = nullptr, + validation_msg_callback_t cb_msg = nullptr, bool fix_hierarchy = true, S32 depth = -1); diff --git a/indra/newview/llinventorygallery.cpp b/indra/newview/llinventorygallery.cpp index c54af7d9f14..f77088e0b16 100644 --- a/indra/newview/llinventorygallery.cpp +++ b/indra/newview/llinventorygallery.cpp @@ -1816,8 +1816,8 @@ void LLInventoryGallery::paste(const LLUUID& dest, const LLUUID& marketplacelistings_id) { LLHandle handle = getHandle(); - std::function on_copy_callback = NULL; - LLPointer cb = NULL; + std::function on_copy_callback = nullptr; + LLPointer cb = nullptr; if (dest == mFolderID) { on_copy_callback = [handle](const LLUUID& inv_item) @@ -3582,12 +3582,12 @@ bool dragItemIntoFolder(LLUUID folder_id, LLInventoryItem* inv_item, bool drop, if (accept && drop) { - std::shared_ptr move_inv (new LLMoveInv()); + std::shared_ptr move_inv = std::make_shared(); move_inv->mObjectID = inv_item->getParentUUID(); std::pair item_pair(folder_id, inv_item->getUUID()); move_inv->mMoveList.push_back(item_pair); - move_inv->mCallback = NULL; - move_inv->mUserData = NULL; + move_inv->mCallback = nullptr; + move_inv->mUserData = nullptr; if (is_move) { warn_move_inventory(object, move_inv); diff --git a/indra/newview/llinventorygallery.h b/indra/newview/llinventorygallery.h index 7f53f9998da..a53637a477a 100644 --- a/indra/newview/llinventorygallery.h +++ b/indra/newview/llinventorygallery.h @@ -44,14 +44,14 @@ class LLGalleryGestureObserver; class LLInventoryGalleryContextMenu; -typedef boost::function callback_t; +typedef std::function callback_t; class LLInventoryGallery : public LLPanel, public LLEditMenuHandler { public: typedef boost::signals2::signal selection_change_signal_t; - typedef boost::function selection_change_callback_t; + typedef std::function selection_change_callback_t; typedef std::deque selection_deque; struct Params diff --git a/indra/newview/llinventorygallerymenu.cpp b/indra/newview/llinventorygallerymenu.cpp index eda93e3e79d..2c3909cc79d 100644 --- a/indra/newview/llinventorygallerymenu.cpp +++ b/indra/newview/llinventorygallerymenu.cpp @@ -334,11 +334,11 @@ void LLInventoryGalleryContextMenu::doToSelected(const LLSD& userdata) } else if ("copy_slurl" == action) { - boost::function copy_slurl_cb = [](LLLandmark* landmark) + std::function copy_slurl_cb = [](LLLandmark* landmark) { LLVector3d global_pos; landmark->getGlobalPos(global_pos); - boost::function copy_slurl_to_clipboard_cb = [](const std::string& slurl) + std::function copy_slurl_to_clipboard_cb = [](const std::string& slurl) { gViewerWindow->getWindow()->copyTextToClipboard(utf8str_to_wstring(slurl)); LLSD args; @@ -362,7 +362,7 @@ void LLInventoryGalleryContextMenu::doToSelected(const LLSD& userdata) } else if ("show_on_map" == action) { - boost::function show_on_map_cb = [](LLLandmark* landmark) + std::function show_on_map_cb = [](LLLandmark* landmark) { LLVector3d landmark_global_pos; if (landmark->getGlobalPos(landmark_global_pos)) diff --git a/indra/newview/llinventoryitemslist.cpp b/indra/newview/llinventoryitemslist.cpp index 73cc9536920..15735ebde36 100644 --- a/indra/newview/llinventoryitemslist.cpp +++ b/indra/newview/llinventoryitemslist.cpp @@ -51,6 +51,7 @@ LLInventoryItemsList::LLInventoryItemsList(const LLInventoryItemsList::Params& p : LLFlatListViewEx(p) , mRefreshState(REFRESH_COMPLETE) , mForceRefresh(false) +, mNeedsArrange(true) { // TODO: mCommitOnSelectionChange is set to "false" in LLFlatListView // but reset to true in all derived classes. This settings might need to @@ -144,6 +145,7 @@ void LLInventoryItemsList::updateSelection() bool LLInventoryItemsList::doIdle() { if (mRefreshState == REFRESH_COMPLETE) return true; // done + LL_PROFILE_ZONE_SCOPED; if (isInVisibleChain() || mForceRefresh || !getFilterSubString().empty()) { @@ -165,7 +167,7 @@ void LLInventoryItemsList::idle(void* user_data) using namespace std::chrono; auto start = steady_clock::now(); - const milliseconds time_limit = milliseconds(3); + const milliseconds time_limit = milliseconds(2); const auto end_time = start + time_limit; S32 max_update_count = 50; @@ -218,8 +220,6 @@ void LLInventoryItemsList::refresh() mRefreshState = REFRESH_LIST_SORT; } - rearrangeItems(); - notifyParentItemsRectChanged(); break; } case REFRESH_LIST_ERASE: @@ -229,10 +229,21 @@ void LLInventoryItemsList::refresh() for (; mRemovedItems.end() != it; ++it) { // don't filter items right away - removeItemByUUID(*it, false); + removeItemByUUID(*it, false /*don't rearrange*/); } mRemovedItems.clear(); - mRefreshState = REFRESH_LIST_SORT; // fix visibility and arrange + mRefreshState = REFRESH_LIST_SORT; // fix visibility + + // Assume that visible items were removed. + if (getVisible()) + { + rearrangeItems(); + notifyParentItemsRectChanged(); + } + else + { + mNeedsArrange = true; + } break; } case REFRESH_LIST_APPEND: @@ -275,18 +286,25 @@ void LLInventoryItemsList::refresh() LLSD action; action.with("match_filter", cur_filter); + bool new_visible_items = false; pairs_const_iterator_t pair_it = panel_list.begin(); for (; pair_it != panel_list.end(); ++pair_it) { item_pair_t* item_pair = *pair_it; if (item_pair->first->getParent() != NULL) { - updateItemVisibility(item_pair->first, action); + new_visible_items |= updateItemVisibility(item_pair->first, action); } } - rearrangeItems(); - notifyParentItemsRectChanged(); + mNeedsArrange |= new_visible_items; + if (mNeedsArrange && getVisible()) + { + // show changes now + rearrangeItems(); + notifyParentItemsRectChanged(); + mNeedsArrange = false; + } if (mAddedItems.size() > 0) { @@ -304,16 +322,33 @@ void LLInventoryItemsList::refresh() { LL_PROFILE_ZONE_NAMED("items_refresh_sort"); // Filter, sort, rearrange and notify parent about shape changes - filterItems(true, true); + if (filterItems(true, true)) + { + mNeedsArrange = false; // just rearranged + } if (mAddedItems.size() == 0) { + if (mNeedsArrange) + { + // Done, last chance to rearrange + rearrangeItems(); + notifyParentItemsRectChanged(); + mNeedsArrange = false; + } // After list building completed, select items that had been requested to select before list was build updateSelection(); mRefreshState = REFRESH_COMPLETE; } else { + if (mNeedsArrange && getVisible()) + { + // show changes now + rearrangeItems(); + notifyParentItemsRectChanged(); + mNeedsArrange = false; + } mRefreshState = REFRESH_LIST_APPEND; } break; @@ -347,6 +382,7 @@ void LLInventoryItemsList::computeDifference( LLPanel* LLInventoryItemsList::createNewItem(LLViewerInventoryItem* item) { + LL_PROFILE_ZONE_SCOPED; if (!item) { LL_WARNS() << "No inventory item. Couldn't create flat list item." << LL_ENDL; diff --git a/indra/newview/llinventoryitemslist.h b/indra/newview/llinventoryitemslist.h index b20c27eec8b..f80d6b31b81 100644 --- a/indra/newview/llinventoryitemslist.h +++ b/indra/newview/llinventoryitemslist.h @@ -117,6 +117,7 @@ class LLInventoryItemsList : public LLFlatListViewEx }; ERefreshStates mRefreshState; + bool mNeedsArrange = true; private: uuid_vec_t mIDs; // IDs of items that were added in refreshList(). diff --git a/indra/newview/llinventorylistitem.cpp b/indra/newview/llinventorylistitem.cpp index 5fb5b0f23f0..a435a4f7c7c 100644 --- a/indra/newview/llinventorylistitem.cpp +++ b/indra/newview/llinventorylistitem.cpp @@ -69,6 +69,7 @@ LLPanelInventoryListItemBase::Params::Params() LLPanelInventoryListItemBase* LLPanelInventoryListItemBase::create(LLViewerInventoryItem* item) { + LL_PROFILE_ZONE_SCOPED_CATEGORY_UI; LLPanelInventoryListItemBase* list_item = NULL; if (item) { @@ -189,6 +190,7 @@ void LLPanelInventoryListItemBase::setShowWidget(LLUICtrl* ctrl, bool show) bool LLPanelInventoryListItemBase::postBuild() { + LL_PROFILE_ZONE_SCOPED_CATEGORY_UI; LLViewerInventoryItem* inv_item = getItem(); if (inv_item) { diff --git a/indra/newview/llinventorymodel.cpp b/indra/newview/llinventorymodel.cpp index 2dfc3b014f5..043fd7003d6 100644 --- a/indra/newview/llinventorymodel.cpp +++ b/indra/newview/llinventorymodel.cpp @@ -1037,7 +1037,7 @@ void LLInventoryModel::createNewCategory(const LLUUID& parent_id, { if (new_category.isNull()) { - if (callback && !callback.empty()) + if (callback) { callback(new_category); } @@ -1064,7 +1064,7 @@ void LLInventoryModel::createNewCategory(const LLUUID& parent_id, updateCategory(cat); } - if (callback && !callback.empty()) + if (callback) { callback(new_category); } @@ -1107,9 +1107,9 @@ void LLInventoryModel::createNewCategoryCoro(std::string url, LLSD postData, inv { LLCore::HttpRequest::policy_t httpPolicy(LLCore::HttpRequest::DEFAULT_POLICY_ID); LLCoreHttpUtil::HttpCoroutineAdapter::ptr_t - httpAdapter(new LLCoreHttpUtil::HttpCoroutineAdapter("createNewCategoryCoro", httpPolicy)); - LLCore::HttpRequest::ptr_t httpRequest(new LLCore::HttpRequest); - LLCore::HttpOptions::ptr_t httpOpts(new LLCore::HttpOptions); + httpAdapter = std::make_shared("createNewCategoryCoro", httpPolicy); + LLCore::HttpRequest::ptr_t httpRequest = std::make_shared(); + LLCore::HttpOptions::ptr_t httpOpts = std::make_shared(); httpOpts->setWantHeaders(true); @@ -3257,11 +3257,11 @@ void LLInventoryModel::initHttpRequest() mHttpRequestFG = new LLCore::HttpRequest; mHttpRequestBG = new LLCore::HttpRequest; - mHttpOptions = LLCore::HttpOptions::ptr_t(new LLCore::HttpOptions); + mHttpOptions = std::make_shared(); mHttpOptions->setTransferTimeout(300); mHttpOptions->setUseRetryAfter(true); // mHttpOptions->setTrace(2); // Do tracing of requests - mHttpHeaders = LLCore::HttpHeaders::ptr_t(new LLCore::HttpHeaders); + mHttpHeaders = std::make_shared(); mHttpHeaders->append(HTTP_OUT_HEADER_CONTENT_TYPE, HTTP_CONTENT_LLSD_XML); mHttpHeaders->append(HTTP_OUT_HEADER_ACCEPT, HTTP_CONTENT_LLSD_XML); mHttpPolicyClass = app_core_http.getPolicy(LLAppCoreHttp::AP_INVENTORY); diff --git a/indra/newview/llinventorymodel.h b/indra/newview/llinventorymodel.h index d28743357e2..2859923df90 100644 --- a/indra/newview/llinventorymodel.h +++ b/indra/newview/llinventorymodel.h @@ -122,9 +122,8 @@ class LLInventoryModel FetchItemHttpHandler(const LLSD & request_sd); virtual ~FetchItemHttpHandler(); - protected: - FetchItemHttpHandler(const FetchItemHttpHandler &); // Not defined - void operator=(const FetchItemHttpHandler &); // Not defined + FetchItemHttpHandler(const FetchItemHttpHandler&) = delete; + FetchItemHttpHandler& operator=(const FetchItemHttpHandler&) = delete; public: virtual void onCompleted(LLCore::HttpHandle handle, LLCore::HttpResponse * response); @@ -489,7 +488,7 @@ class LLInventoryModel void createNewCategory(const LLUUID& parent_id, LLFolderType::EType preferred_type, const std::string& name, - inventory_func_type callback = NULL, + inventory_func_type callback = nullptr, const LLUUID& thumbnail_id = LLUUID::null); protected: // Internal methods that add inventory and make sure that all of diff --git a/indra/newview/llinventorymodelbackgroundfetch.cpp b/indra/newview/llinventorymodelbackgroundfetch.cpp index 2cf15549578..1e5f771ba78 100644 --- a/indra/newview/llinventorymodelbackgroundfetch.cpp +++ b/indra/newview/llinventorymodelbackgroundfetch.cpp @@ -125,9 +125,8 @@ class BGItemHttpHandler : public LLInventoryModel::FetchItemHttpHandler LLInventoryModelBackgroundFetch::instance().incrFetchCount(-1); } -protected: - BGItemHttpHandler(const BGItemHttpHandler&); // Not defined - void operator=(const BGItemHttpHandler&); // Not defined + BGItemHttpHandler(const BGItemHttpHandler&) = delete; + BGItemHttpHandler& operator=(const BGItemHttpHandler&) = delete; }; @@ -159,8 +158,8 @@ class BGFolderHttpHandler : public LLCore::HttpHandler } protected: - BGFolderHttpHandler(const BGFolderHttpHandler&); // Not defined - void operator=(const BGFolderHttpHandler&); // Not defined + BGFolderHttpHandler(const BGFolderHttpHandler&) = delete; + BGFolderHttpHandler& operator=(const BGFolderHttpHandler&) = delete; public: virtual void onCompleted(LLCore::HttpHandle handle, LLCore::HttpResponse* response); @@ -886,31 +885,34 @@ void LLInventoryModelBackgroundFetch::bulkFetchViaAis(const FetchQueueInfo& fetc static LLCachedControl ais_batch(gSavedSettings, "BatchSizeAIS3", 20); S32 batch_limit = llclamp(ais_batch(), 1, 40); - for (LLInventoryModel::cat_array_t::iterator it = categories->begin(); - it != categories->end(); - ++it) + if (categories) { - LLViewerInventoryCategory* child_cat = (*it); - if (LLViewerInventoryCategory::VERSION_UNKNOWN != child_cat->getVersion() - || child_cat->getFetching() >= target_state) + for (LLInventoryModel::cat_array_t::iterator it = categories->begin(); + it != categories->end(); + ++it) { - continue; - } + LLViewerInventoryCategory* child_cat = (*it); + if (LLViewerInventoryCategory::VERSION_UNKNOWN != child_cat->getVersion() + || child_cat->getFetching() >= target_state) + { + continue; + } - if (child_cat->getPreferredType() == LLFolderType::FT_MARKETPLACE_LISTINGS) - { - // special case, marketplace will fetch that as needed - continue; - } + if (child_cat->getPreferredType() == LLFolderType::FT_MARKETPLACE_LISTINGS) + { + // special case, marketplace will fetch that as needed + continue; + } - children.emplace_back(child_cat->getUUID()); - mExpectedFolderIds.emplace_back(child_cat->getUUID()); - child_cat->setFetching(target_state); + children.emplace_back(child_cat->getUUID()); + mExpectedFolderIds.emplace_back(child_cat->getUUID()); + child_cat->setFetching(target_state); - if (children.size() >= batch_limit) - { - content_done = false; - break; + if (children.size() >= batch_limit) + { + content_done = false; + break; + } } } @@ -940,14 +942,17 @@ void LLInventoryModelBackgroundFetch::bulkFetchViaAis(const FetchQueueInfo& fetc // This will have a bit of overlap with onAISContentCalback, // but something else might have downloaded folders, so verify // every child that is complete has it's children done as well - for (LLInventoryModel::cat_array_t::iterator it = categories->begin(); - it != categories->end(); - ++it) + if (categories) { - LLViewerInventoryCategory* child_cat = (*it); - if (LLViewerInventoryCategory::VERSION_UNKNOWN != child_cat->getVersion()) + for (LLInventoryModel::cat_array_t::iterator it = categories->begin(); + it != categories->end(); + ++it) { - mFetchFolderQueue.emplace_back(child_cat->getUUID(), FT_RECURSIVE); + LLViewerInventoryCategory* child_cat = (*it); + if (LLViewerInventoryCategory::VERSION_UNKNOWN != child_cat->getVersion()) + { + mFetchFolderQueue.emplace_back(child_cat->getUUID(), FT_RECURSIVE); + } } } } @@ -998,12 +1003,15 @@ void LLInventoryModelBackgroundFetch::bulkFetchViaAis(const FetchQueueInfo& fetc LLInventoryModel::cat_array_t* categories(NULL); LLInventoryModel::item_array_t* items(NULL); gInventory.getDirectDescendentsOf(cat_id, categories, items); - for (LLInventoryModel::cat_array_t::const_iterator it = categories->begin(); - it != categories->end(); - ++it) + if (categories) { - // not emplace_front to not cause an infinite loop - mFetchFolderQueue.emplace_back((*it)->getUUID(), FT_RECURSIVE); + for (LLInventoryModel::cat_array_t::const_iterator it = categories->begin(); + it != categories->end(); + ++it) + { + // not emplace_front to not cause an infinite loop + mFetchFolderQueue.emplace_back((*it)->getUUID(), FT_RECURSIVE); + } } } } @@ -1208,7 +1216,7 @@ void LLInventoryModelBackgroundFetch::bulkFetch() if (! url.empty()) { - LLCore::HttpHandler::ptr_t handler(new BGFolderHttpHandler(folder_request_body, recursive_cats)); + LLCore::HttpHandler::ptr_t handler = std::make_shared(folder_request_body, recursive_cats); gInventory.requestPost(false, url, folder_request_body, handler, "Inventory Folder"); } } @@ -1219,7 +1227,7 @@ void LLInventoryModelBackgroundFetch::bulkFetch() if (! url.empty()) { - LLCore::HttpHandler::ptr_t handler(new BGFolderHttpHandler(folder_request_body_lib, recursive_cats)); + LLCore::HttpHandler::ptr_t handler = std::make_shared(folder_request_body_lib, recursive_cats); gInventory.requestPost(false, url, folder_request_body_lib, handler, "Library Folder"); } } @@ -1235,7 +1243,7 @@ void LLInventoryModelBackgroundFetch::bulkFetch() { LLSD body; body["items"] = item_request_body; - LLCore::HttpHandler::ptr_t handler(new BGItemHttpHandler(body)); + LLCore::HttpHandler::ptr_t handler = std::make_shared(body); gInventory.requestPost(false, url, body, handler, "Inventory Item"); } } @@ -1248,7 +1256,7 @@ void LLInventoryModelBackgroundFetch::bulkFetch() { LLSD body; body["items"] = item_request_body_lib; - LLCore::HttpHandler::ptr_t handler(new BGItemHttpHandler(body)); + LLCore::HttpHandler::ptr_t handler = std::make_shared(body); gInventory.requestPost(false, url, body, handler, "Library Item"); } } @@ -1534,7 +1542,7 @@ void BGFolderHttpHandler::processFailure(LLCore::HttpStatus status, LLCore::Http { LLSD request_body; request_body["folders"] = folders; - LLCore::HttpHandler::ptr_t handler(new BGFolderHttpHandler(request_body, recursive_cats)); + LLCore::HttpHandler::ptr_t handler = std::make_shared(request_body, recursive_cats); gInventory.requestPost(false, url, request_body, handler, "Inventory Folder"); recursive_cats.clear(); folders.clear(); @@ -1544,7 +1552,7 @@ void BGFolderHttpHandler::processFailure(LLCore::HttpStatus status, LLCore::Http LLSD request_body; request_body["folders"] = folders; - LLCore::HttpHandler::ptr_t handler(new BGFolderHttpHandler(request_body, recursive_cats)); + LLCore::HttpHandler::ptr_t handler = std::make_shared(request_body, recursive_cats); gInventory.requestPost(false, url, request_body, handler, "Inventory Folder"); return; } diff --git a/indra/newview/llinventorymodelbackgroundfetch.h b/indra/newview/llinventorymodelbackgroundfetch.h index 2e9f69ee295..ef6fa06e9fd 100644 --- a/indra/newview/llinventorymodelbackgroundfetch.h +++ b/indra/newview/llinventorymodelbackgroundfetch.h @@ -53,7 +53,7 @@ class LLInventoryModelBackgroundFetch : public LLSingleton nullary_func_t; + typedef std::function nullary_func_t; // AIS3 only, Fetches folder and everything links inside the folder point to // Intended for outfits void fetchFolderAndLinks(const LLUUID& cat_id, nullary_func_t callback); @@ -78,7 +78,7 @@ class LLInventoryModelBackgroundFetch : public LLSingleton folders_fetched_callback_t; + typedef std::function folders_fetched_callback_t; boost::signals2::connection setFetchCompletionCallback(folders_fetched_callback_t cb); void addRequestAtFront(const LLUUID& id, bool recursive, bool is_category); diff --git a/indra/newview/llinventoryobserver.cpp b/indra/newview/llinventoryobserver.cpp index ac22be9d5af..a50d6b579e0 100644 --- a/indra/newview/llinventoryobserver.cpp +++ b/indra/newview/llinventoryobserver.cpp @@ -249,7 +249,7 @@ void fetch_items_from_llsd(const LLSD& items_llsd) if (!url.empty()) { body[i]["agent_id"] = gAgent.getID(); - LLCore::HttpHandler::ptr_t handler(new LLInventoryModel::FetchItemHttpHandler(body[i])); + LLCore::HttpHandler::ptr_t handler = std::make_shared(body[i]); gInventory.requestPost(true, url, body[i], handler, (i ? "Library Item" : "Inventory Item")); continue; } diff --git a/indra/newview/llinventoryobserver.h b/indra/newview/llinventoryobserver.h index 12d6c445212..99cb9ec8118 100644 --- a/indra/newview/llinventoryobserver.h +++ b/indra/newview/llinventoryobserver.h @@ -258,7 +258,7 @@ class LLInventoryCompletionObserver : public LLInventoryObserver class LLInventoryCategoriesObserver : public LLInventoryObserver { public: - typedef boost::function callback_t; + typedef std::function callback_t; LLInventoryCategoriesObserver() {}; virtual void changed(U32 mask); diff --git a/indra/newview/llinventorypanel.cpp b/indra/newview/llinventorypanel.cpp index a935ede1860..cde87ede9b6 100644 --- a/indra/newview/llinventorypanel.cpp +++ b/indra/newview/llinventorypanel.cpp @@ -113,7 +113,7 @@ class LLInventoryPanelObserver : public LLInventoryObserver class LLInvPanelComplObserver : public LLInventoryCompletionObserver { public: - typedef boost::function callback_t; + typedef std::function callback_t; LLInvPanelComplObserver(callback_t cb) : mCallback(cb) @@ -627,7 +627,7 @@ void LLInventoryPanel::itemChanged(const LLUUID& item_id, U32 mask, const LLInve // This could be anything. For now, just refresh the item. if (mask & LLInventoryObserver::INTERNAL) { - if (view_item) + if (view_item && view_item->getViewModelItem()) { view_item->refresh(); } @@ -646,7 +646,7 @@ void LLInventoryPanel::itemChanged(const LLUUID& item_id, U32 mask, const LLInve if (mask & LLInventoryObserver::UPDATE_FAVORITE) { - if (view_item) + if (view_item && view_item->getViewModelItem()) { view_item->refresh(); LLFolderViewFolder* parent = view_item->getParentFolder(); @@ -1595,7 +1595,7 @@ void LLInventoryPanel::setSelection(const LLUUID& obj_id, bool take_keyboard_foc setSelectionByID(obj_id, take_keyboard_focus); } -void LLInventoryPanel::setSelectCallback(const boost::function& items, bool user_action)>& cb) +void LLInventoryPanel::setSelectCallback(const std::function& items, bool user_action)>& cb) { if (mFolderRoot.get()) { @@ -2762,7 +2762,7 @@ void LLInventorySingleFolderPanel::updateSingleFolderRoot() mFolderRoot.get()->setFollowsAll(); mFolderRoot.get()->addChild(mFolderRoot.get()->mStatusTextBox); - if (!mSelectionCallback.empty()) + if (mSelectionCallback != nullptr) { mFolderRoot.get()->setSelectCallback(mSelectionCallback); } diff --git a/indra/newview/llinventorypanel.h b/indra/newview/llinventorypanel.h index 50333709fc6..dc2e304ab35 100644 --- a/indra/newview/llinventorypanel.h +++ b/indra/newview/llinventorypanel.h @@ -37,6 +37,7 @@ #include "llinventorymodel.h" #include "llscrollcontainer.h" #include "lluictrlfactory.h" +#include #include class LLInvFVBridge; @@ -182,7 +183,7 @@ class LLInventoryPanel : public LLPanel // Call this method to set the selection. void openAllFolders(); void setSelection(const LLUUID& obj_id, bool take_keyboard_focus); - void setSelectCallback(const boost::function& items, bool user_action)>& cb); + void setSelectCallback(const std::function& items, bool user_action)>& cb); void clearSelection(); selected_items_t getSelectedItems() const; @@ -374,7 +375,7 @@ class LLInventoryPanel : public LLPanel virtual LLFolderViewFolder* createFolderViewFolder(LLInvFVBridge * bridge, bool allow_drop); virtual LLFolderViewItem* createFolderViewItem(LLInvFVBridge * bridge); - boost::function& items, bool user_action)> mSelectionCallback; + std::function& items, bool user_action)> mSelectionCallback; // buildViewsTree does not include some checks and is meant // for recursive use, use buildNewViews() for first call @@ -436,7 +437,7 @@ class LLInventorySingleFolderPanel : public LLInventoryPanel std::list getNavBackwardList() { return mBackwardFolders; } std::list getNavForwardList() { return mForwardFolders; } - typedef boost::function root_changed_callback_t; + typedef std::function root_changed_callback_t; boost::signals2::connection setRootChangedCallback(root_changed_callback_t cb); protected: diff --git a/indra/newview/lllandmarkactions.h b/indra/newview/lllandmarkactions.h index 1abf10e1102..0996dfed296 100644 --- a/indra/newview/lllandmarkactions.h +++ b/indra/newview/lllandmarkactions.h @@ -39,8 +39,8 @@ class LLLandmark; class LLLandmarkActions { public: - typedef boost::function slurl_callback_t; - typedef boost::function region_name_and_coords_callback_t; + typedef std::function slurl_callback_t; + typedef std::function region_name_and_coords_callback_t; /** * @brief Fetches landmark LLViewerInventoryItems for the given landmark name. @@ -107,7 +107,7 @@ class LLLandmarkActions * * @return pointer to loaded landmark from gLandmarkList or NULL if landmark does not exist or wasn't loaded. */ - static LLLandmark* getLandmark(const LLUUID& landmarkInventoryItemID, LLLandmarkList::loaded_callback_t cb = NULL); + static LLLandmark* getLandmark(const LLUUID& landmarkInventoryItemID, LLLandmarkList::loaded_callback_t cb = nullptr); /** * @brief Performs standard action of copying of SLURL from landmark to user's clipboard. diff --git a/indra/newview/lllandmarklist.h b/indra/newview/lllandmarklist.h index 508148abde5..fb8b5a19608 100644 --- a/indra/newview/lllandmarklist.h +++ b/indra/newview/lllandmarklist.h @@ -27,7 +27,7 @@ #ifndef LL_LLLANDMARKLIST_H #define LL_LLLANDMARKLIST_H -#include +#include #include #include "lllandmark.h" #include "lluuid.h" @@ -40,7 +40,7 @@ class LLInventoryItem; class LLLandmarkList { public: - typedef boost::function loaded_callback_t; + typedef std::function loaded_callback_t; LLLandmarkList() {} ~LLLandmarkList(); @@ -50,7 +50,7 @@ class LLLandmarkList //const LLLandmark* getNext() { return mList.getNextData(); } bool assetExists(const LLUUID& asset_uuid); - LLLandmark* getAsset(const LLUUID& asset_uuid, loaded_callback_t cb = NULL); + LLLandmark* getAsset(const LLUUID& asset_uuid, loaded_callback_t cb = nullptr); static void processGetAssetReply( const LLUUID& uuid, LLAssetType::EType type, diff --git a/indra/newview/lllistcontextmenu.h b/indra/newview/lllistcontextmenu.h index 4b515a3b269..cb2ca5260f3 100644 --- a/indra/newview/lllistcontextmenu.h +++ b/indra/newview/lllistcontextmenu.h @@ -63,7 +63,7 @@ class LLListContextMenu virtual void hide(); protected: - typedef boost::function functor_t; + typedef std::function functor_t; virtual LLContextMenu* createMenu() = 0; diff --git a/indra/newview/lllocationhistory.h b/indra/newview/lllocationhistory.h index ca9b81457c7..34cb83367f0 100644 --- a/indra/newview/lllocationhistory.h +++ b/indra/newview/lllocationhistory.h @@ -29,10 +29,9 @@ #include "llsingleton.h" // for LLSingleton +#include #include #include -#include -#include #include class LLSD; @@ -115,7 +114,7 @@ class LLLocationHistory: public LLSingleton }; typedef std::vector location_list_t; - typedef boost::function history_changed_callback_t; + typedef std::function history_changed_callback_t; typedef boost::signals2::signal history_changed_signal_t; diff --git a/indra/newview/lllocationinputctrl.h b/indra/newview/lllocationinputctrl.h index 56e5555ba5b..7a62f960648 100644 --- a/indra/newview/lllocationinputctrl.h +++ b/indra/newview/lllocationinputctrl.h @@ -194,7 +194,7 @@ class LLLocationInputCtrl boost::signals2::connection mLocationHistoryConnection; boost::signals2::connection mRegionCrossingSlot; LLPathfindingNavMesh::navmesh_slot_t mNavMeshSlot; - bool mIsNavMeshDirty; + bool mIsNavMeshDirty = false; LLUIImage* mLandmarkImageOn; LLUIImage* mLandmarkImageOff; LLPointer mIconMaturityGeneral; @@ -206,7 +206,7 @@ class LLLocationInputCtrl std::string mEditLandmarkTooltip; // this field holds a human-readable form of the location string, it is needed to be able to compare copy-pated value and real location std::string mHumanReadableLocation; - bool isHumanReadableLocationVisible; + bool isHumanReadableLocationVisible = false; std::string mMaturityHelpTopic; }; diff --git a/indra/newview/lllogininstance.cpp b/indra/newview/lllogininstance.cpp index 41cec4f074e..e9d68723d37 100644 --- a/indra/newview/lllogininstance.cpp +++ b/indra/newview/lllogininstance.cpp @@ -80,7 +80,7 @@ std::string construct_start_string(); LLLoginInstance::LLLoginInstance() : - mLoginModule(new LLLogin()), + mLoginModule(std::make_unique()), mNotifications(NULL), mLoginState("offline"), mSaveMFA(true), diff --git a/indra/newview/lllogininstance.h b/indra/newview/lllogininstance.h index 941b378b14a..54ce51720f7 100644 --- a/indra/newview/lllogininstance.h +++ b/indra/newview/lllogininstance.h @@ -29,7 +29,6 @@ #include "lleventdispatcher.h" #include "lleventapi.h" -#include #include // std::shared_ptr #include "llsecapi.h" class LLLogin; diff --git a/indra/newview/llmaniprotate.cpp b/indra/newview/llmaniprotate.cpp index 5bdf3f81b5f..4bf1b134ef1 100644 --- a/indra/newview/llmaniprotate.cpp +++ b/indra/newview/llmaniprotate.cpp @@ -274,7 +274,6 @@ void LLManipRotate::render() } LLGLEnable cull_face(GL_CULL_FACE); - LLGLEnable clip_plane0(GL_CLIP_PLANE0); LLGLDepthTest gls_depth(GL_FALSE); //LLGLDisable gls_stencil(GL_STENCIL_TEST); diff --git a/indra/newview/llmaniptranslate.cpp b/indra/newview/llmaniptranslate.cpp index 0888f630e8d..9bcfd9e2c02 100644 --- a/indra/newview/llmaniptranslate.cpp +++ b/indra/newview/llmaniptranslate.cpp @@ -695,24 +695,28 @@ bool LLManipTranslate::handleHover(S32 x, S32 y, MASK mask) // handle attachments in local space if (object->isAttachment() && object->mDrawable.notNull()) { - // calculate local version of relative move - LLQuaternion objWorldRotation = object->mDrawable->mXform.getParent()->getWorldRotation(); - objWorldRotation.transQuat(); + LLXform* object_xform_parent = object->mDrawable->mXform.getParent(); + if (object_xform_parent) + { + // calculate local version of relative move + LLQuaternion objWorldRotation = object_xform_parent->getWorldRotation(); + objWorldRotation.transQuat(); - LLVector3 old_position_local = object->getPosition(); - LLVector3 new_position_local = selectNode->mSavedPositionLocal + (clamped_relative_move_f * objWorldRotation); + LLVector3 old_position_local = object->getPosition(); + LLVector3 new_position_local = selectNode->mSavedPositionLocal + (clamped_relative_move_f * objWorldRotation); - //RN: I forget, but we need to do this because of snapping which doesn't often result - // in position changes even when the mouse moves - object->setPosition(new_position_local); - rebuild(object); - gAgentAvatarp->clampAttachmentPositions(); - new_position_local = object->getPosition(); + //RN: I forget, but we need to do this because of snapping which doesn't often result + // in position changes even when the mouse moves + object->setPosition(new_position_local); + rebuild(object); + gAgentAvatarp->clampAttachmentPositions(); + new_position_local = object->getPosition(); - if (selectNode->mIndividualSelection) - { - // counter-translate child objects if we are moving the root as an individual - object->resetChildrenPosition(old_position_local - new_position_local, true); + if (selectNode->mIndividualSelection) + { + // counter-translate child objects if we are moving the root as an individual + object->resetChildrenPosition(old_position_local - new_position_local, true); + } } } else diff --git a/indra/newview/llmarketplacefunctions.cpp b/indra/newview/llmarketplacefunctions.cpp index 7b8211ded81..d1d4641df3e 100644 --- a/indra/newview/llmarketplacefunctions.cpp +++ b/indra/newview/llmarketplacefunctions.cpp @@ -206,10 +206,10 @@ namespace LLMarketplaceImport { LLCore::HttpRequest::policy_t httpPolicy(LLCore::HttpRequest::DEFAULT_POLICY_ID); LLCoreHttpUtil::HttpCoroutineAdapter::ptr_t - httpAdapter(new LLCoreHttpUtil::HttpCoroutineAdapter("marketplacePostCoro", httpPolicy)); - LLCore::HttpRequest::ptr_t httpRequest(new LLCore::HttpRequest); - LLCore::HttpHeaders::ptr_t httpHeaders(new LLCore::HttpHeaders); - LLCore::HttpOptions::ptr_t httpOpts(new LLCore::HttpOptions); + httpAdapter = std::make_shared("marketplacePostCoro", httpPolicy); + LLCore::HttpRequest::ptr_t httpRequest = std::make_shared(); + LLCore::HttpHeaders::ptr_t httpHeaders = std::make_shared(); + LLCore::HttpOptions::ptr_t httpOpts = std::make_shared(); httpOpts->setWantHeaders(true); httpOpts->setFollowRedirects(true); @@ -267,17 +267,17 @@ namespace LLMarketplaceImport { LLCore::HttpRequest::policy_t httpPolicy(LLCore::HttpRequest::DEFAULT_POLICY_ID); LLCoreHttpUtil::HttpCoroutineAdapter::ptr_t - httpAdapter(new LLCoreHttpUtil::HttpCoroutineAdapter("marketplaceGetCoro", httpPolicy)); - LLCore::HttpRequest::ptr_t httpRequest(new LLCore::HttpRequest); + httpAdapter = std::make_shared("marketplaceGetCoro", httpPolicy); + LLCore::HttpRequest::ptr_t httpRequest = std::make_shared(); LLCore::HttpHeaders::ptr_t httpHeaders; - LLCore::HttpOptions::ptr_t httpOpts(new LLCore::HttpOptions); + LLCore::HttpOptions::ptr_t httpOpts = std::make_shared(); httpOpts->setWantHeaders(true); httpOpts->setFollowRedirects(!sMarketplaceCookie.empty()); if (buildHeaders) { - httpHeaders = LLCore::HttpHeaders::ptr_t(new LLCore::HttpHeaders); + httpHeaders = std::make_shared(); httpHeaders->append(HTTP_OUT_HEADER_ACCEPT, "*/*"); httpHeaders->append(HTTP_OUT_HEADER_COOKIE, sMarketplaceCookie); @@ -450,17 +450,14 @@ LLMarketplaceInventoryImporter::LLMarketplaceInventoryImporter() , mImportInProgress(false) , mInitialized(false) , mMarketPlaceStatus(MarketplaceStatusCodes::MARKET_PLACE_NOT_INITIALIZED) - , mErrorInitSignal(NULL) - , mStatusChangedSignal(NULL) - , mStatusReportSignal(NULL) { } boost::signals2::connection LLMarketplaceInventoryImporter::setInitializationErrorCallback(const status_report_signal_t::slot_type& cb) { - if (mErrorInitSignal == NULL) + if (mErrorInitSignal == nullptr) { - mErrorInitSignal = new status_report_signal_t(); + mErrorInitSignal = std::make_unique(); } return mErrorInitSignal->connect(cb); @@ -468,9 +465,9 @@ boost::signals2::connection LLMarketplaceInventoryImporter::setInitializationErr boost::signals2::connection LLMarketplaceInventoryImporter::setStatusChangedCallback(const status_changed_signal_t::slot_type& cb) { - if (mStatusChangedSignal == NULL) + if (mStatusChangedSignal == nullptr) { - mStatusChangedSignal = new status_changed_signal_t(); + mStatusChangedSignal = std::make_unique(); } return mStatusChangedSignal->connect(cb); @@ -478,9 +475,9 @@ boost::signals2::connection LLMarketplaceInventoryImporter::setStatusChangedCall boost::signals2::connection LLMarketplaceInventoryImporter::setStatusReportCallback(const status_report_signal_t::slot_type& cb) { - if (mStatusReportSignal == NULL) + if (mStatusReportSignal == nullptr) { - mStatusReportSignal = new status_report_signal_t(); + mStatusReportSignal = std::make_unique(); } return mStatusReportSignal->connect(cb); @@ -717,8 +714,6 @@ LLMarketplaceTuple::LLMarketplaceTuple(const LLUUID& folder_id, S32 listing_id, LLMarketplaceData::LLMarketplaceData() : mMarketPlaceStatus(MarketplaceStatusCodes::MARKET_PLACE_NOT_INITIALIZED), mMarketPlaceDataFetched(MarketplaceFetchCodes::MARKET_FETCH_NOT_DONE), - mStatusUpdatedSignal(NULL), - mDataFetchedSignal(NULL), mDirtyCount(false) { mInventoryObserver = new LLMarketplaceInventoryObserver; @@ -752,9 +747,9 @@ LLSD LLMarketplaceData::getMarketplaceStringSubstitutions() void LLMarketplaceData::initializeSLM(const status_updated_signal_t::slot_type& cb) { - if (mStatusUpdatedSignal == NULL) + if (mStatusUpdatedSignal == nullptr) { - mStatusUpdatedSignal = new status_updated_signal_t(); + mStatusUpdatedSignal = std::make_unique(); } mStatusUpdatedSignal->connect(cb); @@ -783,9 +778,9 @@ void LLMarketplaceData::getMerchantStatusCoro() { LLCore::HttpRequest::policy_t httpPolicy(LLCore::HttpRequest::DEFAULT_POLICY_ID); LLCoreHttpUtil::HttpCoroutineAdapter::ptr_t - httpAdapter(new LLCoreHttpUtil::HttpCoroutineAdapter("getMerchantStatusCoro", httpPolicy)); - LLCore::HttpRequest::ptr_t httpRequest(new LLCore::HttpRequest); - LLCore::HttpOptions::ptr_t httpOpts(new LLCore::HttpOptions); + httpAdapter = std::make_shared("getMerchantStatusCoro", httpPolicy); + LLCore::HttpRequest::ptr_t httpRequest = std::make_shared(); + LLCore::HttpOptions::ptr_t httpOpts = std::make_shared(); httpOpts->setFollowRedirects(true); @@ -842,7 +837,7 @@ void LLMarketplaceData::setDataFetchedSignal(const status_updated_signal_t::slot { if (mDataFetchedSignal == NULL) { - mDataFetchedSignal = new status_updated_signal_t(); + mDataFetchedSignal = std::make_unique(); } mDataFetchedSignal->connect(cb); } @@ -861,9 +856,9 @@ void LLMarketplaceData::getSLMListingsCoro(LLUUID folderId) { LLCore::HttpRequest::policy_t httpPolicy(LLCore::HttpRequest::DEFAULT_POLICY_ID); LLCoreHttpUtil::HttpCoroutineAdapter::ptr_t - httpAdapter(new LLCoreHttpUtil::HttpCoroutineAdapter("getMerchantStatusCoro", httpPolicy)); - LLCore::HttpRequest::ptr_t httpRequest(new LLCore::HttpRequest); - LLCore::HttpHeaders::ptr_t httpHeaders(new LLCore::HttpHeaders); + httpAdapter = std::make_shared("getSLMListingsCoro", httpPolicy); + LLCore::HttpRequest::ptr_t httpRequest = std::make_shared(); + LLCore::HttpHeaders::ptr_t httpHeaders = std::make_shared(); httpHeaders->append("Accept", "application/json"); httpHeaders->append("Content-Type", "application/json"); @@ -926,9 +921,9 @@ void LLMarketplaceData::getSingleListingCoro(S32 listingId, LLUUID folderId) { LLCore::HttpRequest::policy_t httpPolicy(LLCore::HttpRequest::DEFAULT_POLICY_ID); LLCoreHttpUtil::HttpCoroutineAdapter::ptr_t - httpAdapter(new LLCoreHttpUtil::HttpCoroutineAdapter("getMerchantStatusCoro", httpPolicy)); - LLCore::HttpRequest::ptr_t httpRequest(new LLCore::HttpRequest); - LLCore::HttpHeaders::ptr_t httpHeaders(new LLCore::HttpHeaders); + httpAdapter = std::make_shared("getSingleListingCoro", httpPolicy); + LLCore::HttpRequest::ptr_t httpRequest = std::make_shared(); + LLCore::HttpHeaders::ptr_t httpHeaders = std::make_shared(); httpHeaders->append("Accept", "application/json"); httpHeaders->append("Content-Type", "application/json"); @@ -997,9 +992,9 @@ void LLMarketplaceData::createSLMListingCoro(LLUUID folderId, LLUUID versionId, { LLCore::HttpRequest::policy_t httpPolicy(LLCore::HttpRequest::DEFAULT_POLICY_ID); LLCoreHttpUtil::HttpCoroutineAdapter::ptr_t - httpAdapter(new LLCoreHttpUtil::HttpCoroutineAdapter("getMerchantStatusCoro", httpPolicy)); - LLCore::HttpRequest::ptr_t httpRequest(new LLCore::HttpRequest); - LLCore::HttpHeaders::ptr_t httpHeaders(new LLCore::HttpHeaders); + httpAdapter = std::make_shared("createSLMListingCoro", httpPolicy); + LLCore::HttpRequest::ptr_t httpRequest = std::make_shared(); + LLCore::HttpHeaders::ptr_t httpHeaders = std::make_shared(); httpHeaders->append("Accept", "application/json"); httpHeaders->append("Content-Type", "application/json"); @@ -1071,9 +1066,9 @@ void LLMarketplaceData::updateSLMListingCoro(LLUUID folderId, S32 listingId, LLU { LLCore::HttpRequest::policy_t httpPolicy(LLCore::HttpRequest::DEFAULT_POLICY_ID); LLCoreHttpUtil::HttpCoroutineAdapter::ptr_t - httpAdapter(new LLCoreHttpUtil::HttpCoroutineAdapter("getMerchantStatusCoro", httpPolicy)); - LLCore::HttpRequest::ptr_t httpRequest(new LLCore::HttpRequest); - LLCore::HttpHeaders::ptr_t httpHeaders(new LLCore::HttpHeaders); + httpAdapter = std::make_shared("updateSLMListingCoro", httpPolicy); + LLCore::HttpRequest::ptr_t httpRequest = std::make_shared(); + LLCore::HttpHeaders::ptr_t httpHeaders = std::make_shared(); httpHeaders->append("Accept", "application/json"); httpHeaders->append("Content-Type", "application/json"); @@ -1166,9 +1161,9 @@ void LLMarketplaceData::associateSLMListingCoro(LLUUID folderId, S32 listingId, { LLCore::HttpRequest::policy_t httpPolicy(LLCore::HttpRequest::DEFAULT_POLICY_ID); LLCoreHttpUtil::HttpCoroutineAdapter::ptr_t - httpAdapter(new LLCoreHttpUtil::HttpCoroutineAdapter("getMerchantStatusCoro", httpPolicy)); - LLCore::HttpRequest::ptr_t httpRequest(new LLCore::HttpRequest); - LLCore::HttpHeaders::ptr_t httpHeaders(new LLCore::HttpHeaders); + httpAdapter = std::make_shared("associateSLMListingCoro", httpPolicy); + LLCore::HttpRequest::ptr_t httpRequest = std::make_shared(); + LLCore::HttpHeaders::ptr_t httpHeaders = std::make_shared(); httpHeaders->append("Accept", "application/json"); httpHeaders->append("Content-Type", "application/json"); @@ -1247,9 +1242,9 @@ void LLMarketplaceData::deleteSLMListingCoro(S32 listingId) { LLCore::HttpRequest::policy_t httpPolicy(LLCore::HttpRequest::DEFAULT_POLICY_ID); LLCoreHttpUtil::HttpCoroutineAdapter::ptr_t - httpAdapter(new LLCoreHttpUtil::HttpCoroutineAdapter("getMerchantStatusCoro", httpPolicy)); - LLCore::HttpRequest::ptr_t httpRequest(new LLCore::HttpRequest); - LLCore::HttpHeaders::ptr_t httpHeaders(new LLCore::HttpHeaders); + httpAdapter = std::make_shared("deleteSLMListingCoro", httpPolicy); + LLCore::HttpRequest::ptr_t httpRequest = std::make_shared(); + LLCore::HttpHeaders::ptr_t httpHeaders = std::make_shared(); httpHeaders->append("Accept", "application/json"); httpHeaders->append("Content-Type", "application/json"); diff --git a/indra/newview/llmarketplacefunctions.h b/indra/newview/llmarketplacefunctions.h index 281743c1d6c..59c7dddc33b 100644 --- a/indra/newview/llmarketplacefunctions.h +++ b/indra/newview/llmarketplacefunctions.h @@ -28,15 +28,11 @@ #ifndef LL_LLMARKETPLACEFUNCTIONS_H #define LL_LLMARKETPLACEFUNCTIONS_H - -#include -#include -#include - +#include "llsd.h" #include "llsingleton.h" #include "llstring.h" - +#include namespace MarketplaceErrorCodes { @@ -113,9 +109,9 @@ class LLMarketplaceInventoryImporter bool mInitialized; U32 mMarketPlaceStatus; - status_report_signal_t * mErrorInitSignal; - status_changed_signal_t * mStatusChangedSignal; - status_report_signal_t * mStatusReportSignal; + std::unique_ptr mErrorInitSignal; + std::unique_ptr mStatusChangedSignal; + std::unique_ptr mStatusReportSignal; }; @@ -276,13 +272,13 @@ class LLMarketplaceData // Handling Marketplace connection and inventory connection U32 mMarketPlaceStatus; std::string mMarketPlaceFailureReason; - status_updated_signal_t* mStatusUpdatedSignal; + std::unique_ptr mStatusUpdatedSignal; LLInventoryObserver* mInventoryObserver; bool mDirtyCount; // If true, stock count value need to be updated at the next check // Update data U32 mMarketPlaceDataFetched; - status_updated_signal_t* mDataFetchedSignal; + std::unique_ptr mDataFetchedSignal; std::set mPendingUpdateSet; // Listing folders waiting for validation diff --git a/indra/newview/llmarketplacenotifications.h b/indra/newview/llmarketplacenotifications.h index a602b930dec..0b03bde16c2 100644 --- a/indra/newview/llmarketplacenotifications.h +++ b/indra/newview/llmarketplacenotifications.h @@ -30,7 +30,7 @@ #include -#include +#include // @@ -48,7 +48,7 @@ namespace LLMarketplaceInventoryNotifications { void update(); - typedef boost::function NoCopyCallbackFunction; + typedef std::function NoCopyCallbackFunction; void addNoCopyNotification(const LLSD& payload, const NoCopyCallbackFunction& cb); }; diff --git a/indra/newview/llmaterialeditor.cpp b/indra/newview/llmaterialeditor.cpp index cac72bb0858..4e14f416e9b 100644 --- a/indra/newview/llmaterialeditor.cpp +++ b/indra/newview/llmaterialeditor.cpp @@ -494,7 +494,7 @@ bool LLMaterialEditor::postBuild() refreshUploadCost(); } - boost::function changes_callback = [this](LLUICtrl * ctrl, void* userData) + std::function changes_callback = [this](LLUICtrl * ctrl, void* userData) { const U32 *flag = (const U32*)userData; markChangesUnsaved(*flag); @@ -1987,12 +1987,14 @@ void LLMaterialEditor::loadMaterialFromFile(const std::string& filename, S32 ind { // Prespecified material LLMaterialEditor* me = (LLMaterialEditor*)LLFloaterReg::getInstance("material_editor"); + me->mUploadFolder = dest_folder; me->loadMaterial(model_in, filename, index); } else if (model_in.materials.size() == 1) { // Only one material, just load it LLMaterialEditor* me = (LLMaterialEditor*)LLFloaterReg::getInstance("material_editor"); + me->mUploadFolder = dest_folder; me->loadMaterial(model_in, filename, 0); } else @@ -2018,11 +2020,12 @@ void LLMaterialEditor::loadMaterialFromFile(const std::string& filename, S32 ind material_list.push_back(LLTrans::getString("material_batch_import_text")); LLFloaterComboOptions::showUI( - [model_in, filename](const std::string& option, S32 index) + [model_in, filename, dest_folder](const std::string& option, S32 index) { if (index >= 0) // -1 on cancel { LLMaterialEditor* me = (LLMaterialEditor*)LLFloaterReg::getInstance("material_editor"); + me->mUploadFolder = dest_folder; me->loadMaterial(model_in, filename, index); } }, @@ -2448,7 +2451,7 @@ void LLMaterialEditor::loadMaterial(const tinygltf::Model &model_in, const std:: if (index == model_in.materials.size()) { // bulk upload all the things - upload_bulk({ filename }, LLFilePicker::FFLOAD_MATERIAL, true, LLUUID::null); + upload_bulk({ filename }, LLFilePicker::FFLOAD_MATERIAL, true, mUploadFolder); return; } diff --git a/indra/newview/llmaterialmgr.cpp b/indra/newview/llmaterialmgr.cpp index ee5e5b438eb..4dc3f958aa6 100644 --- a/indra/newview/llmaterialmgr.cpp +++ b/indra/newview/llmaterialmgr.cpp @@ -67,7 +67,7 @@ class LLMaterialHttpHandler : public LLHttpSDHandler { public: - typedef boost::function CallbackFunction; + typedef std::function CallbackFunction; typedef std::shared_ptr ptr_t; LLMaterialHttpHandler(const std::string& method, CallbackFunction cback); @@ -137,9 +137,9 @@ LLMaterialMgr::LLMaterialMgr(): { LLAppCoreHttp & app_core_http(LLAppViewer::instance()->getAppCoreHttp()); - mHttpRequest = LLCore::HttpRequest::ptr_t(new LLCore::HttpRequest()); - mHttpHeaders = LLCore::HttpHeaders::ptr_t(new LLCore::HttpHeaders()); - mHttpOptions = LLCore::HttpOptions::ptr_t(new LLCore::HttpOptions()); + mHttpRequest = std::make_shared(); + mHttpHeaders = std::make_shared(); + mHttpOptions = std::make_shared(); mHttpPolicy = app_core_http.getPolicy(LLAppCoreHttp::AP_MATERIALS); mMaterials.insert(std::pair(LLMaterialID::null, LLMaterialPtr(NULL))); @@ -234,7 +234,7 @@ boost::signals2::connection LLMaterialMgr::get(const LLUUID& region_id, const LL get_callback_map_t::iterator itCallback = mGetCallbacks.find(material_id); if (itCallback == mGetCallbacks.end()) { - std::pair ret = mGetCallbacks.insert(std::pair(material_id, new get_callback_t())); + std::pair ret = mGetCallbacks.emplace(material_id, std::make_unique()); itCallback = ret.first; } connection = itCallback->second->connect(cb);; @@ -279,7 +279,7 @@ boost::signals2::connection LLMaterialMgr::getTE(const LLUUID& region_id, const get_callback_te_map_t::iterator itCallback = mGetTECallbacks.find(te_mat_pair); if (itCallback == mGetTECallbacks.end()) { - std::pair ret = mGetTECallbacks.insert(std::pair(te_mat_pair, new get_callback_te_t())); + std::pair ret = mGetTECallbacks.emplace(te_mat_pair, std::make_unique()); itCallback = ret.first; } connection = itCallback->second->connect(cb); @@ -317,7 +317,7 @@ boost::signals2::connection LLMaterialMgr::getAll(const LLUUID& region_id, LLMat getall_callback_map_t::iterator itCallback = mGetAllCallbacks.find(region_id); if (mGetAllCallbacks.end() == itCallback) { - std::pair ret = mGetAllCallbacks.insert(std::pair(region_id, new getall_callback_t())); + std::pair ret = mGetAllCallbacks.emplace(region_id, std::make_unique()); itCallback = ret.first; } return itCallback->second->connect(cb);; @@ -329,8 +329,8 @@ void LLMaterialMgr::put(const LLUUID& object_id, const U8 te, const LLMaterial& if (mPutQueue.end() == itQueue) { LL_DEBUGS("Materials") << "mPutQueue insert object " << object_id << LL_ENDL; - mPutQueue.insert(std::pair(object_id, facematerial_map_t())); - itQueue = mPutQueue.find(object_id); + auto ret = mPutQueue.emplace(object_id, facematerial_map_t()); + itQueue = ret.first; } facematerial_map_t::iterator itFace = itQueue->second.find(te); @@ -361,7 +361,7 @@ void LLMaterialMgr::setLocalMaterial(const LLUUID& region_id, LLMaterialPtr mate } LL_DEBUGS("Materials") << "region " << region_id << "new local material id " << material_id << LL_ENDL; - mMaterials.insert(std::pair(material_id, material_ptr)); + mMaterials.emplace(material_id, material_ptr); setMaterialCallbacks(material_id, material_ptr); @@ -376,7 +376,7 @@ const LLMaterialPtr LLMaterialMgr::setMaterial(const LLUUID& region_id, const LL { LL_DEBUGS("Materials") << "new material" << LL_ENDL; LLMaterialPtr newMaterial(new LLMaterial(material_data)); - std::pair ret = mMaterials.insert(std::pair(material_id, newMaterial)); + std::pair ret = mMaterials.emplace(material_id, newMaterial); itMaterial = ret.first; } @@ -400,7 +400,6 @@ void LLMaterialMgr::setMaterialCallbacks(const LLMaterialID& material_id, const if (itCallbackTE != mGetTECallbacks.end()) { (*itCallbackTE->second)(material_id, material_ptr, te_mat_pair.te); - delete itCallbackTE->second; mGetTECallbacks.erase(itCallbackTE); } } @@ -410,7 +409,6 @@ void LLMaterialMgr::setMaterialCallbacks(const LLMaterialID& material_id, const { (*itCallback->second)(material_id, material_ptr); - delete itCallback->second; mGetCallbacks.erase(itCallback); } } @@ -509,7 +507,6 @@ void LLMaterialMgr::onGetAllResponse(bool success, const LLSD& content, const LL { (*itCallback->second)(region_id, materials); - delete itCallback->second; mGetAllCallbacks.erase(itCallback); } @@ -549,11 +546,11 @@ void LLMaterialMgr::onPutResponse(bool success, const LLSD& content) { llassert(response_data.isArray()); LL_DEBUGS("Materials") << "response has "<< response_data.size() << " materials" << LL_ENDL; +#ifdef SHOW_ASSERT // same condition that controls llassert() for (LLSD::array_const_iterator faceIter = response_data.beginArray(); faceIter != response_data.endArray(); ++faceIter) { -# ifdef SHOW_ASSERT // same condition that controls llassert() const LLSD& face_data = *faceIter; // conditional to avoid unused variable warning -# endif + llassert(face_data.isMap()); llassert(face_data.has(MATERIALS_CAP_OBJECT_ID_FIELD)); @@ -570,6 +567,7 @@ void LLMaterialMgr::onPutResponse(bool success, const LLSD& content) // *TODO: do we really still need to process this? } +#endif } } @@ -684,9 +682,9 @@ void LLMaterialMgr::processGetQueue() LLSD postData = LLSD::emptyMap(); postData[MATERIALS_CAP_ZIP_FIELD] = materialBinary; - LLCore::HttpHandler::ptr_t handler(new LLMaterialHttpHandler("POST", + LLCore::HttpHandler::ptr_t handler = std::make_shared("POST", boost::bind(&LLMaterialMgr::onGetResponse, this, _1, _2, region_id) - )); + ); LL_DEBUGS("Materials") << "POSTing to region '" << regionp->getName() << "' at '" << capURL << " for " << materialsData.size() << " materials." << "\ndata: " << ll_pretty_print_sd(materialsData) << LL_ENDL; @@ -864,9 +862,9 @@ void LLMaterialMgr::processGetAllQueueCoro(LLUUID regionId) LL_DEBUGS("Materials") << "GET all for region " << regionId << "url " << capURL << LL_ENDL; - LLCoreHttpUtil::HttpCoroutineAdapter::ptr_t httpAdapter( - new LLCoreHttpUtil::HttpCoroutineAdapter("processGetAllQueue", LLCore::HttpRequest::DEFAULT_POLICY_ID)); - LLCore::HttpRequest::ptr_t httpRequest(new LLCore::HttpRequest()); + LLCoreHttpUtil::HttpCoroutineAdapter::ptr_t + httpAdapter = std::make_shared("processGetAllQueue", LLCore::HttpRequest::DEFAULT_POLICY_ID); + LLCore::HttpRequest::ptr_t httpRequest = std::make_shared(); LLSD result = httpAdapter->getAndSuspend(httpRequest, capURL); @@ -973,9 +971,9 @@ void LLMaterialMgr::processPutQueue() LL_DEBUGS("Materials") << "put for " << itRequest->second.size() << " faces to region " << itRequest->first->getName() << LL_ENDL; - LLCore::HttpHandler::ptr_t handler (new LLMaterialHttpHandler("PUT", + LLCore::HttpHandler::ptr_t handler = std::make_shared("PUT", boost::bind(&LLMaterialMgr::onPutResponse, this, _1, _2) - )); + ); LLCore::HttpHandle handle = LLCoreHttpUtil::requestPutWithLLSD( mHttpRequest, mHttpPolicy, capURL, diff --git a/indra/newview/llmaterialmgr.h b/indra/newview/llmaterialmgr.h index 1279b77ad4e..ac4c18d60c9 100644 --- a/indra/newview/llmaterialmgr.h +++ b/indra/newview/llmaterialmgr.h @@ -110,13 +110,13 @@ class LLMaterialMgr : public LLSingleton typedef std::map get_queue_t; typedef std::pair pending_material_t; typedef std::map get_pending_map_t; - typedef std::map get_callback_map_t; + typedef std::map> get_callback_map_t; - typedef boost::unordered_map get_callback_te_map_t; + typedef boost::unordered_map> get_callback_te_map_t; typedef std::set getall_queue_t; typedef std::map getall_pending_map_t; - typedef std::map getall_callback_map_t; + typedef std::map> getall_callback_map_t; typedef std::map facematerial_map_t; typedef std::map put_queue_t; diff --git a/indra/newview/llmediactrl.cpp b/indra/newview/llmediactrl.cpp index c7b60b2fd56..809628cf6c2 100644 --- a/indra/newview/llmediactrl.cpp +++ b/indra/newview/llmediactrl.cpp @@ -1030,10 +1030,6 @@ void LLMediaCtrl::handleMediaEvent(LLPluginClassMedia* self, EMediaEvent event) case MEDIA_EVENT_NAVIGATE_COMPLETE: { LL_DEBUGS("Media") << "Media event: MEDIA_EVENT_NAVIGATE_COMPLETE, result string is: " << self->getNavigateResultString() << LL_ENDL; - if(mHidingInitialLoad) - { - mHidingInitialLoad = false; - } }; break; diff --git a/indra/newview/llmediactrl.h b/indra/newview/llmediactrl.h index a644ef30719..d2735a009b2 100644 --- a/indra/newview/llmediactrl.h +++ b/indra/newview/llmediactrl.h @@ -202,7 +202,6 @@ class LLMediaCtrl : mStretchToFill, mMaintainAspectRatio, mHideLoading, - mHidingInitialLoad, mClearCache, mHoverTextChanged, mDecoupleTextureSize, diff --git a/indra/newview/llmediadataclient.cpp b/indra/newview/llmediadataclient.cpp index 83a6e660191..50236587acc 100644 --- a/indra/newview/llmediadataclient.cpp +++ b/indra/newview/llmediadataclient.cpp @@ -172,9 +172,9 @@ LLMediaDataClient::LLMediaDataClient(F32 queue_timer_delay, F32 retry_timer_dela mMaxSortedQueueSize(max_sorted_queue_size), mMaxRoundRobinQueueSize(max_round_robin_queue_size), mQueueTimerIsRunning(false), - mHttpRequest(new LLCore::HttpRequest()), - mHttpHeaders(new LLCore::HttpHeaders()), - mHttpOpts(new LLCore::HttpOptions()), + mHttpRequest(std::make_shared()), + mHttpHeaders(std::make_shared()), + mHttpOpts(std::make_shared()), mHttpPolicy(LLCore::HttpRequest::DEFAULT_POLICY_ID) { // *TODO: Look up real Policy ID @@ -660,7 +660,7 @@ void LLMediaDataClient::Handler::onFailure(LLCore::HttpResponse * response, LLCo void LLObjectMediaDataClient::fetchMedia(LLMediaDataClientObject *object) { // Create a get request and put it in the queue. - enqueue(Request::ptr_t(new RequestGet(object, this))); + enqueue(std::make_shared(object, this)); } const char *LLObjectMediaDataClient::getCapabilityName() const @@ -880,14 +880,14 @@ LLSD LLObjectMediaDataClient::RequestGet::getPayload() const LLCore::HttpHandler::ptr_t LLObjectMediaDataClient::RequestGet::createHandler() { - return LLCore::HttpHandler::ptr_t(new LLObjectMediaDataClient::Handler(shared_from_this())); + return std::make_shared(shared_from_this()); } void LLObjectMediaDataClient::updateMedia(LLMediaDataClientObject *object) { // Create an update request and put it in the queue. - enqueue(Request::ptr_t(new RequestUpdate(object, this))); + enqueue(std::make_shared(object, this)); } LLObjectMediaDataClient::RequestUpdate::RequestUpdate(LLMediaDataClientObject *obj, LLMediaDataClient *mdc): @@ -917,7 +917,7 @@ LLSD LLObjectMediaDataClient::RequestUpdate::getPayload() const LLCore::HttpHandler::ptr_t LLObjectMediaDataClient::RequestUpdate::createHandler() { // This just uses the base class's responder. - return LLCore::HttpHandler::ptr_t(new LLMediaDataClient::Handler(shared_from_this())); + return std::make_shared(shared_from_this()); } void LLObjectMediaDataClient::Handler::onSuccess(LLCore::HttpResponse * response, const LLSD &content) @@ -1037,7 +1037,7 @@ void LLObjectMediaNavigateClient::navigate(LLMediaDataClientObject *object, U8 t // LL_INFOS("LLMediaDataClient") << "navigate() initiated: " << ll_print_sd(sd_payload) << LL_ENDL; // Create a get request and put it in the queue. - enqueue(Request::ptr_t(new RequestNavigate(object, this, texture_index, url))); + enqueue(std::make_shared(object, this, texture_index, url)); } LLObjectMediaNavigateClient::RequestNavigate::RequestNavigate(LLMediaDataClientObject *obj, LLMediaDataClient *mdc, U8 texture_index, const std::string &url): @@ -1058,7 +1058,7 @@ LLSD LLObjectMediaNavigateClient::RequestNavigate::getPayload() const LLCore::HttpHandler::ptr_t LLObjectMediaNavigateClient::RequestNavigate::createHandler() { - return LLCore::HttpHandler::ptr_t(new LLObjectMediaNavigateClient::Handler(shared_from_this())); + return std::make_shared(shared_from_this()); } void LLObjectMediaNavigateClient::Handler::onSuccess(LLCore::HttpResponse * response, const LLSD &content) diff --git a/indra/newview/llmeshrepository.cpp b/indra/newview/llmeshrepository.cpp index 413f02b723e..0ed1e01ff88 100644 --- a/indra/newview/llmeshrepository.cpp +++ b/indra/newview/llmeshrepository.cpp @@ -654,12 +654,10 @@ class LLMeshHandlerBase : public LLCore::HttpHandler, mRequestedBytes(requested_bytes) {} - virtual ~LLMeshHandlerBase() - {} + virtual ~LLMeshHandlerBase() = default; -protected: - LLMeshHandlerBase(const LLMeshHandlerBase &); // Not defined - void operator=(const LLMeshHandlerBase &); // Not defined + LLMeshHandlerBase(const LLMeshHandlerBase &) = delete; + LLMeshHandlerBase& operator=(const LLMeshHandlerBase&) = delete; public: virtual void onCompleted(LLCore::HttpHandle handle, LLCore::HttpResponse * response); @@ -693,9 +691,8 @@ class LLMeshHeaderHandler : public LLMeshHandlerBase } virtual ~LLMeshHeaderHandler(); -protected: - LLMeshHeaderHandler(const LLMeshHeaderHandler &); // Not defined - void operator=(const LLMeshHeaderHandler &); // Not defined + LLMeshHeaderHandler(const LLMeshHeaderHandler&) = delete; + LLMeshHeaderHandler& operator=(const LLMeshHeaderHandler&) = delete; public: virtual void processData(LLCore::BufferArray * body, S32 body_offset, U8 * data, S32 data_size); @@ -719,9 +716,8 @@ class LLMeshLODHandler : public LLMeshHandlerBase } virtual ~LLMeshLODHandler(); -protected: - LLMeshLODHandler(const LLMeshLODHandler &); // Not defined - void operator=(const LLMeshLODHandler &); // Not defined + LLMeshLODHandler(const LLMeshLODHandler&) = delete; + LLMeshLODHandler& operator=(const LLMeshLODHandler&) = delete; public: virtual void processData(LLCore::BufferArray * body, S32 body_offset, U8 * data, S32 data_size); @@ -750,9 +746,8 @@ class LLMeshSkinInfoHandler : public LLMeshHandlerBase } virtual ~LLMeshSkinInfoHandler(); -protected: - LLMeshSkinInfoHandler(const LLMeshSkinInfoHandler &); // Not defined - void operator=(const LLMeshSkinInfoHandler &); // Not defined + LLMeshSkinInfoHandler(const LLMeshSkinInfoHandler&) = delete; + LLMeshSkinInfoHandler& operator=(const LLMeshSkinInfoHandler&) = delete; void processSkin(U8* data, S32 data_size); @@ -778,9 +773,8 @@ class LLMeshDecompositionHandler : public LLMeshHandlerBase {} virtual ~LLMeshDecompositionHandler(); -protected: - LLMeshDecompositionHandler(const LLMeshDecompositionHandler &); // Not defined - void operator=(const LLMeshDecompositionHandler &); // Not defined + LLMeshDecompositionHandler(const LLMeshDecompositionHandler&) = delete; + LLMeshDecompositionHandler& operator=(const LLMeshDecompositionHandler&) = delete; public: virtual void processData(LLCore::BufferArray * body, S32 body_offset, U8 * data, S32 data_size); @@ -804,9 +798,8 @@ class LLMeshPhysicsShapeHandler : public LLMeshHandlerBase {} virtual ~LLMeshPhysicsShapeHandler(); -protected: - LLMeshPhysicsShapeHandler(const LLMeshPhysicsShapeHandler &); // Not defined - void operator=(const LLMeshPhysicsShapeHandler &); // Not defined + LLMeshPhysicsShapeHandler(const LLMeshPhysicsShapeHandler&) = delete; + LLMeshPhysicsShapeHandler& operator=(const LLMeshPhysicsShapeHandler&) = delete; public: virtual void processData(LLCore::BufferArray * body, S32 body_offset, U8 * data, S32 data_size); @@ -943,20 +936,20 @@ LLMeshRepoThread::LLMeshRepoThread() mSkinMapMutex = new LLMutex(); mSignal = new LLCondition(); mHttpRequest = new LLCore::HttpRequest; - mHttpOptions = LLCore::HttpOptions::ptr_t(new LLCore::HttpOptions); + mHttpOptions = std::make_shared(); mHttpOptions->setTransferTimeout(SMALL_MESH_XFER_TIMEOUT); mHttpOptions->setUseRetryAfter(gSavedSettings.getBOOL("MeshUseHttpRetryAfter")); - mHttpLargeOptions = LLCore::HttpOptions::ptr_t(new LLCore::HttpOptions); + mHttpLargeOptions = std::make_shared(); mHttpLargeOptions->setTransferTimeout(LARGE_MESH_XFER_TIMEOUT); mHttpLargeOptions->setUseRetryAfter(gSavedSettings.getBOOL("MeshUseHttpRetryAfter")); - mHttpHeaders = LLCore::HttpHeaders::ptr_t(new LLCore::HttpHeaders); + mHttpHeaders = std::make_shared(); mHttpHeaders->append(HTTP_OUT_HEADER_ACCEPT, HTTP_CONTENT_VND_LL_MESH); mHttpPolicyClass = app_core_http.getPolicy(LLAppCoreHttp::AP_MESH2); mHttpLargePolicyClass = app_core_http.getPolicy(LLAppCoreHttp::AP_LARGE_MESH); // Lod processing is expensive due to the number of requests // and a need to do expensive cacheOptimize(). - mMeshThreadPool.reset(new LL::ThreadPool("MeshLodProcessing", 2)); + mMeshThreadPool = std::make_unique("MeshLodProcessing", 2); mMeshThreadPool->start(); } @@ -1653,7 +1646,7 @@ bool LLMeshRepoThread::fetchMeshSkinInfo(const LLUUID& mesh_id) if (!http_url.empty()) { - LLMeshHandlerBase::ptr_t handler(new LLMeshSkinInfoHandler(mesh_id, offset, size)); + LLMeshHandlerBase::ptr_t handler = std::make_shared(mesh_id, offset, size); LLCore::HttpHandle handle = getByteRange(http_url, offset, size, handler); if (LLCORE_HTTP_HANDLE_INVALID == handle) { @@ -1761,7 +1754,7 @@ bool LLMeshRepoThread::fetchMeshDecomposition(const LLUUID& mesh_id) if (!http_url.empty()) { - LLMeshHandlerBase::ptr_t handler(new LLMeshDecompositionHandler(mesh_id, offset, size)); + LLMeshHandlerBase::ptr_t handler = std::make_shared(mesh_id, offset, size); LLCore::HttpHandle handle = getByteRange(http_url, offset, size, handler); if (LLCORE_HTTP_HANDLE_INVALID == handle) { @@ -1860,7 +1853,7 @@ bool LLMeshRepoThread::fetchMeshPhysicsShape(const LLUUID& mesh_id) if (!http_url.empty()) { - LLMeshHandlerBase::ptr_t handler(new LLMeshPhysicsShapeHandler(mesh_id, offset, size)); + LLMeshHandlerBase::ptr_t handler = std::make_shared(mesh_id, offset, size); LLCore::HttpHandle handle = getByteRange(http_url, offset, size, handler); if (LLCORE_HTTP_HANDLE_INVALID == handle) { @@ -1988,7 +1981,7 @@ bool LLMeshRepoThread::fetchMeshHeader(const LLVolumeParams& mesh_params) //within the first 4KB //NOTE -- this will break of headers ever exceed 4KB - LLMeshHandlerBase::ptr_t handler(new LLMeshHeaderHandler(mesh_params, 0, MESH_HEADER_SIZE)); + LLMeshHandlerBase::ptr_t handler = std::make_shared(mesh_params, 0, MESH_HEADER_SIZE); LLCore::HttpHandle handle = getByteRange(http_url, 0, MESH_HEADER_SIZE, handler); if (LLCORE_HTTP_HANDLE_INVALID == handle) { @@ -2164,7 +2157,7 @@ bool LLMeshRepoThread::fetchMeshLOD(const LLVolumeParams& mesh_params, S32 lod) { LL_DEBUGS(LOG_MESH) << "Mesh/Cache: Mesh body for ID " << mesh_id << " - was retrieved from the simulator." << LL_ENDL; - LLMeshHandlerBase::ptr_t handler(new LLMeshLODHandler(mesh_params, lod, offset, size)); + LLMeshHandlerBase::ptr_t handler = std::make_shared(mesh_params, lod, offset, size); LLCore::HttpHandle handle = getByteRange(http_url, offset, size, handler); if (LLCORE_HTTP_HANDLE_INVALID == handle) { @@ -2611,11 +2604,11 @@ LLMeshUploadThread::LLMeshUploadThread(LLMeshUploadThread::instance_list_t& data mMeshUploadTimeOut = gSavedSettings.getS32("MeshUploadTimeOut"); mHttpRequest = new LLCore::HttpRequest; - mHttpOptions = LLCore::HttpOptions::ptr_t(new LLCore::HttpOptions); + mHttpOptions = std::make_shared(); mHttpOptions->setTransferTimeout(mMeshUploadTimeOut); mHttpOptions->setUseRetryAfter(gSavedSettings.getBOOL("MeshUseHttpRetryAfter")); mHttpOptions->setRetries(UPLOAD_RETRY_LIMIT); - mHttpHeaders = LLCore::HttpHeaders::ptr_t(new LLCore::HttpHeaders); + mHttpHeaders = std::make_shared(); mHttpHeaders->append(HTTP_OUT_HEADER_CONTENT_TYPE, HTTP_CONTENT_LLSD_XML); mHttpPolicyClass = LLAppViewer::instance()->getAppCoreHttp().getPolicy(LLAppCoreHttp::AP_UPLOADS); } @@ -4321,7 +4314,7 @@ S32 LLMeshRepository::loadMesh(LLVOVolume* vobj, const LLVolumeParams& mesh_para else { //first request for this mesh - std::shared_ptr request(new PendingRequestLOD(mesh_params, new_lod)); + std::shared_ptr request = std::make_shared(mesh_params, new_lod); mPendingRequests.emplace_back(request); mLoadingMeshes[new_lod][mesh_id].initData(vobj, request); LLMeshRepository::sLODPending++; @@ -4503,7 +4496,7 @@ void LLMeshRepository::notifyLoadedMeshes() // erase from background thread mThread->mWorkQueue.post([=, this]() { - LLMutexLock(mThread->mSkinMapMutex); + LLMutexLock skin_lock(mThread->mSkinMapMutex); mThread->mSkinMap.erase(id); }); } @@ -4819,7 +4812,7 @@ const LLMeshSkinInfo* LLMeshRepository::getSkinInfo(const LLUUID& mesh_id, LLVOV else { //first request for this mesh - std::shared_ptr request(new PendingRequestUUID(mesh_id, MESH_REQUEST_SKIN)); + std::shared_ptr request = std::make_shared(mesh_id, MESH_REQUEST_SKIN); mLoadingSkins[mesh_id].initData(requesting_obj, request); mPendingRequests.emplace_back(request); } diff --git a/indra/newview/llmodelpreview.cpp b/indra/newview/llmodelpreview.cpp index 6b1fbdce4c3..ed5ab354393 100644 --- a/indra/newview/llmodelpreview.cpp +++ b/indra/newview/llmodelpreview.cpp @@ -3597,11 +3597,11 @@ bool LLModelPreview::render() gGL.diffuseColor4fv(PREVIEW_EDGE_COL.mV); if (show_edges) { - glLineWidth(PREVIEW_EDGE_WIDTH); + gGL.setLineWidth(PREVIEW_EDGE_WIDTH); glPolygonMode(GL_FRONT_AND_BACK, GL_LINE); buffer->drawRange(LLRender::TRIANGLES, 0, buffer->getNumVerts() - 1, buffer->getNumIndices(), 0); glPolygonMode(GL_FRONT_AND_BACK, GL_FILL); - glLineWidth(1.f); + gGL.setLineWidth(1.f); } buffer->unmapBuffer(); } @@ -3649,7 +3649,7 @@ bool LLModelPreview::render() LLPhysicsDecomp* decomp = gMeshRepo.mDecompThread; if (decomp) { - LLMutexLock(decomp->mMutex); + LLMutexLock decomp_lock(decomp->mMutex); LLModel::Decomposition& physics = model->mPhysics; @@ -3724,12 +3724,12 @@ bool LLModelPreview::render() buffer->drawRange(LLRender::TRIANGLES, 0, buffer->getNumVerts() - 1, buffer->getNumIndices(), 0); gGL.diffuseColor4fv(PREVIEW_PSYH_EDGE_COL.mV); - glLineWidth(PREVIEW_PSYH_EDGE_WIDTH); + gGL.setLineWidth(PREVIEW_PSYH_EDGE_WIDTH); glPolygonMode(GL_FRONT_AND_BACK, GL_LINE); buffer->drawRange(LLRender::TRIANGLES, 0, buffer->getNumVerts() - 1, buffer->getNumIndices(), 0); glPolygonMode(GL_FRONT_AND_BACK, GL_FILL); - glLineWidth(1.f); + gGL.setLineWidth(1.f); buffer->unmapBuffer(); } @@ -3741,7 +3741,7 @@ bool LLModelPreview::render() // only do this if mDegenerate was set in the preceding mesh checks [Check this if the ordering ever breaks] if (mHasDegenerate) { - glLineWidth(PREVIEW_DEG_EDGE_WIDTH); + gGL.setLineWidth(PREVIEW_DEG_EDGE_WIDTH); glPointSize(PREVIEW_DEG_POINT_SIZE); gPipeline.enableLightsFullbright(); //show degenerate triangles @@ -3770,7 +3770,7 @@ bool LLModelPreview::render() LLPhysicsDecomp* decomp = gMeshRepo.mDecompThread; if (decomp) { - LLMutexLock(decomp->mMutex); + LLMutexLock decomp_lock(decomp->mMutex); LLModel::Decomposition& physics = model->mPhysics; @@ -3811,7 +3811,7 @@ bool LLModelPreview::render() gGL.popMatrix(); } - glLineWidth(1.f); + gGL.setLineWidth(1.f); glPointSize(1.f); gPipeline.enableLightsPreview(); gGL.setSceneBlendType(LLRender::BT_ALPHA); @@ -3933,11 +3933,11 @@ bool LLModelPreview::render() { gGL.getTexUnit(0)->unbind(LLTexUnit::TT_TEXTURE); gGL.diffuseColor4fv(PREVIEW_EDGE_COL.mV); - glLineWidth(PREVIEW_EDGE_WIDTH); + gGL.setLineWidth(PREVIEW_EDGE_WIDTH); glPolygonMode(GL_FRONT_AND_BACK, GL_LINE); buffer->draw(LLRender::TRIANGLES, buffer->getNumIndices(), 0); glPolygonMode(GL_FRONT_AND_BACK, GL_FILL); - glLineWidth(1.f); + gGL.setLineWidth(1.f); } } } diff --git a/indra/newview/llmutelist.cpp b/indra/newview/llmutelist.cpp index f6d635f51f8..9157e348332 100644 --- a/indra/newview/llmutelist.cpp +++ b/indra/newview/llmutelist.cpp @@ -190,7 +190,7 @@ LLMuteList::~LLMuteList() void LLMuteList::cleanupSingleton() { - LLAvatarNameCache::getInstance()->setAccountNameChangedCallback(NULL); + LLAvatarNameCache::getInstance()->setAccountNameChangedCallback(nullptr); } bool LLMuteList::isLinden(const std::string& name) diff --git a/indra/newview/llnamelistctrl.h b/indra/newview/llnamelistctrl.h index dde85f4d290..ffff21c95c1 100644 --- a/indra/newview/llnamelistctrl.h +++ b/indra/newview/llnamelistctrl.h @@ -210,12 +210,12 @@ class LLNameListCtrl boost::signals2::signal mIconClickedSignal; public: - boost::signals2::connection setOnNameListCompleteCallback(boost::function onNameListCompleteCallback) + boost::signals2::connection setOnNameListCompleteCallback(std::function onNameListCompleteCallback) { return mNameListCompleteSignal.connect(onNameListCompleteCallback); } - boost::signals2::connection setIconClickedCallback(boost::function cb) + boost::signals2::connection setIconClickedCallback(std::function cb) { return mIconClickedSignal.connect(cb); } diff --git a/indra/newview/llnotificationlistitem.h b/indra/newview/llnotificationlistitem.h index 2ed90e31b21..b3283ca642c 100644 --- a/indra/newview/llnotificationlistitem.h +++ b/indra/newview/llnotificationlistitem.h @@ -84,7 +84,7 @@ class LLNotificationListItem : public LLPanel virtual void onMouseLeave(S32 x, S32 y, MASK mask); //callbacks - typedef boost::function item_callback_t; + typedef std::function item_callback_t; typedef boost::signals2::signal item_signal_t; item_signal_t mOnItemClose; item_signal_t mOnItemClick; @@ -156,8 +156,8 @@ class LLGroupNotificationListItem LLTextBox* mGroupNameBoxExp; private: - LLGroupNotificationListItem(const LLGroupNotificationListItem &); - LLGroupNotificationListItem & operator=(LLGroupNotificationListItem &); + LLGroupNotificationListItem(const LLGroupNotificationListItem&) = delete; + LLGroupNotificationListItem& operator=(LLGroupNotificationListItem&) = delete; void setGroupName(std::string name); bool updateFromCache(); @@ -175,8 +175,8 @@ class LLGroupInviteNotificationListItem private: friend class LLNotificationListItem; LLGroupInviteNotificationListItem(const Params& p); - LLGroupInviteNotificationListItem(const LLGroupInviteNotificationListItem &); - LLGroupInviteNotificationListItem & operator=(LLGroupInviteNotificationListItem &); + LLGroupInviteNotificationListItem(const LLGroupInviteNotificationListItem&) = delete; + LLGroupInviteNotificationListItem& operator=(LLGroupInviteNotificationListItem&) = delete; void setFee(S32 fee); @@ -202,8 +202,8 @@ class LLGroupNoticeNotificationListItem private: friend class LLNotificationListItem; LLGroupNoticeNotificationListItem(const Params& p); - LLGroupNoticeNotificationListItem(const LLGroupNoticeNotificationListItem &); - LLGroupNoticeNotificationListItem & operator=(LLGroupNoticeNotificationListItem &); + LLGroupNoticeNotificationListItem(const LLGroupNoticeNotificationListItem&) = delete; + LLGroupNoticeNotificationListItem& operator=(LLGroupNoticeNotificationListItem&) = delete; void setSender(std::string sender); void onClickAttachment(); @@ -226,8 +226,8 @@ class LLTransactionNotificationListItem : public LLNotificationListItem private: friend class LLNotificationListItem; LLTransactionNotificationListItem(const Params& p); - LLTransactionNotificationListItem(const LLTransactionNotificationListItem &); - LLTransactionNotificationListItem & operator=(LLTransactionNotificationListItem &); + LLTransactionNotificationListItem(const LLTransactionNotificationListItem&) = delete; + LLTransactionNotificationListItem& operator=(LLTransactionNotificationListItem&) = delete; LLAvatarIconCtrl* mAvatarIcon; LLAvatarIconCtrl* mAvatarIconExp; }; @@ -239,8 +239,8 @@ class LLSystemNotificationListItem : public LLNotificationListItem private: friend class LLNotificationListItem; LLSystemNotificationListItem(const Params& p); - LLSystemNotificationListItem(const LLSystemNotificationListItem &); - LLSystemNotificationListItem & operator=(LLSystemNotificationListItem &); + LLSystemNotificationListItem(const LLSystemNotificationListItem&) = delete; + LLSystemNotificationListItem & operator=(LLSystemNotificationListItem &) = delete; LLIconCtrl* mSystemNotificationIcon; LLIconCtrl* mSystemNotificationIconExp; bool mIsCaution; diff --git a/indra/newview/llnotificationmanager.cpp b/indra/newview/llnotificationmanager.cpp index 505f276f8c5..29f11f7ca6f 100644 --- a/indra/newview/llnotificationmanager.cpp +++ b/indra/newview/llnotificationmanager.cpp @@ -60,7 +60,7 @@ void LLNotificationManager::init() mChannels.emplace_back(new LLBrowserNotification()); mChannels.emplace_back(new LLIMHandler()); - mChatHandler = std::shared_ptr(new LLFloaterIMNearbyChatHandler()); + mChatHandler = std::make_shared(); } //-------------------------------------------------------------------------- diff --git a/indra/newview/llnotificationstorage.cpp b/indra/newview/llnotificationstorage.cpp index 75bafb87859..5cec35fc880 100644 --- a/indra/newview/llnotificationstorage.cpp +++ b/indra/newview/llnotificationstorage.cpp @@ -41,7 +41,7 @@ #include "llregistry.h" #include "llviewermessage.h" -typedef boost::function responder_constructor_t; +typedef std::function responder_constructor_t; class LLResponderRegistry : public LLRegistrySingleton { diff --git a/indra/newview/lloutfitgallery.cpp b/indra/newview/lloutfitgallery.cpp index 8589afae06f..8a070babcd2 100644 --- a/indra/newview/lloutfitgallery.cpp +++ b/indra/newview/lloutfitgallery.cpp @@ -988,6 +988,8 @@ LLOutfitGalleryItem::LLOutfitGalleryItem(const Params& p) mSelected(false), mWorn(false), mDefaultImage(true), + mHidden(false), + mFavorite(false), mOutfitName(""), mUUID(LLUUID()) { diff --git a/indra/newview/lloutfitobserver.h b/indra/newview/lloutfitobserver.h index ebf0ba1a127..431f37f78cf 100644 --- a/indra/newview/lloutfitobserver.h +++ b/indra/newview/lloutfitobserver.h @@ -75,7 +75,7 @@ class LLOutfitObserver: public LLInventoryObserver, public LLSingletonsetCommitCallback(boost::bind(&LLOutfitsList::onListSelectionChange, this, _1)); // Setting list refresh callback to apply filter on list change. - list->setRefreshCompleteCallback(boost::bind(&LLOutfitsList::onRefreshComplete, this, _1)); + list->setRefreshCompleteCallback([this, tab](LLUICtrl* ctrl, const LLSD& sd) + { + onRefreshComplete(ctrl, tab); + }); list->setRightMouseDownCallback(boost::bind(&LLOutfitsList::onWearableItemsListRightClick, this, _1, _2, _3)); @@ -294,7 +297,7 @@ void LLOutfitsList::updateRemovedCategory(LLUUID cat_id) if (outfits_iter != mOutfitsMap.end()) { const LLUUID& outfit_id = outfits_iter->first; - LLAccordionCtrlTab* tab = outfits_iter->second; + LLOutfitAccordionCtrlTab* tab = outfits_iter->second; // An outfit is removed from the list. Do the following: // 1. Remove outfit category from observer to stop monitoring its changes. @@ -322,11 +325,11 @@ void LLOutfitsList::onHighlightBaseOutfit(LLUUID base_id, LLUUID prev_id) { if (mOutfitsMap[prev_id]) { - ((LLOutfitAccordionCtrlTab*)mOutfitsMap[prev_id])->setOutfitSelected(false); + mOutfitsMap[prev_id]->setOutfitSelected(false); } if (mOutfitsMap[base_id]) { - ((LLOutfitAccordionCtrlTab*)mOutfitsMap[base_id])->setOutfitSelected(true); + mOutfitsMap[base_id]->setOutfitSelected(true); } } @@ -370,7 +373,7 @@ void LLOutfitsList::onSetSelectedOutfitByUUID(const LLUUID& outfit_uuid) { if (outfit_uuid == iter->first) { - LLAccordionCtrlTab* tab = iter->second; + LLOutfitAccordionCtrlTab* tab = iter->second; if (!tab) continue; LLWearableItemsList* list = dynamic_cast(tab->getAccordionView()); @@ -464,7 +467,7 @@ void LLOutfitsList::onCollapseAllFolders() iter != mOutfitsMap.end(); ++iter) { - LLAccordionCtrlTab* tab = iter->second; + LLOutfitAccordionCtrlTab* tab = iter->second; if(tab && tab->isExpanded()) { tab->changeOpenClose(true); @@ -478,7 +481,7 @@ void LLOutfitsList::onExpandAllFolders() iter != mOutfitsMap.end(); ++iter) { - LLAccordionCtrlTab* tab = iter->second; + LLOutfitAccordionCtrlTab* tab = iter->second; if(tab && !tab->isExpanded()) { tab->changeOpenClose(false); @@ -501,7 +504,7 @@ void LLOutfitsList::updateChangedCategoryName(LLViewerInventoryCategory *cat, st if (outfits_iter != mOutfitsMap.end()) { // Update tab name with the new category name. - LLOutfitAccordionCtrlTab* tab = (LLOutfitAccordionCtrlTab*) outfits_iter->second; + LLOutfitAccordionCtrlTab* tab = outfits_iter->second; if (tab) { tab->setName(name); @@ -554,7 +557,7 @@ void LLOutfitsList::deselectOutfit(const LLUUID& category_id) LLOutfitListBase::deselectOutfit(category_id); } -void LLOutfitsList::restoreOutfitSelection(LLAccordionCtrlTab* tab, const LLUUID& category_id) +void LLOutfitsList::restoreOutfitSelection(LLOutfitAccordionCtrlTab* tab, const LLUUID& category_id) { // Try restoring outfit selection after filtering. if (mAccordion->getSelectedTab() == tab) @@ -563,23 +566,21 @@ void LLOutfitsList::restoreOutfitSelection(LLAccordionCtrlTab* tab, const LLUUID } } -void LLOutfitsList::onRefreshComplete(LLUICtrl* ctrl) +void LLOutfitsList::onRefreshComplete(LLUICtrl* ctrl, LLOutfitAccordionCtrlTab* tab) { if (!ctrl || getFilterSubString().empty()) return; - for (outfits_map_t::iterator - iter = mOutfitsMap.begin(), - iter_end = mOutfitsMap.end(); - iter != iter_end; ++iter) + LLWearableItemsList* list = dynamic_cast(tab->getAccordionView()); + if (list != ctrl) { - LLAccordionCtrlTab* tab = iter->second; - if (!tab) continue; - - LLWearableItemsList* list = dynamic_cast(tab->getAccordionView()); - if (list != ctrl) continue; - - applyFilterToTab(iter->first, tab, getFilterSubString()); + llassert(false); + LL_WARNS() << "LLOutfitsList::onRefreshComplete: ctrl does not match tab's list!" << LL_ENDL; + return; + } + if (tab->getFilterGeneration() != getFilterGeneration()) + { + applyFilterToTab(tab->getFolderID(), tab, getFilterSubString()); } } @@ -592,7 +593,7 @@ void LLOutfitsList::onFilterSubStringChanged(const std::string& new_string, cons while (iter != iter_end) { const LLUUID& category_id = iter->first; - LLAccordionCtrlTab* tab = iter++->second; + LLOutfitAccordionCtrlTab* tab = iter++->second; if (!tab) continue; LLWearableItemsList* list = dynamic_cast(tab->getAccordionView()); @@ -631,9 +632,10 @@ void LLOutfitsList::onFilterSubStringChanged(const std::string& new_string, cons void LLOutfitsList::applyFilterToTab( const LLUUID& category_id, - LLAccordionCtrlTab* tab, + LLOutfitAccordionCtrlTab* tab, const std::string& filter_substring) { + LL_PROFILE_ZONE_SCOPED; if (!tab) return; LLWearableItemsList* list = dynamic_cast(tab->getAccordionView()); if (!list) return; @@ -645,6 +647,7 @@ void LLOutfitsList::applyFilterToTab( LLStringUtil::toUpper(cur_filter); tab->setTitle(tab->getTitle(), cur_filter); + tab->setFilterGeneration(getFilterGeneration()); if (std::string::npos == title.find(cur_filter)) { @@ -768,7 +771,7 @@ void LLOutfitsList::onCOFChanged() outfits_map_t::iterator map_iter = mOutfitsMap.begin(), map_end = mOutfitsMap.end(); while (map_iter != map_end) { - LLAccordionCtrlTab* tab = (map_iter++)->second; + LLOutfitAccordionCtrlTab* tab = (map_iter++)->second; if (!tab) continue; LLWearableItemsList* list = dynamic_cast(tab->getAccordionView()); @@ -799,7 +802,7 @@ void LLOutfitsList::sortOutfits() void LLOutfitsList::onOutfitRightClick(LLUICtrl* ctrl, S32 x, S32 y, const LLUUID& cat_id) { - LLAccordionCtrlTab* tab = dynamic_cast(ctrl); + LLOutfitAccordionCtrlTab* tab = dynamic_cast(ctrl); if (mOutfitMenu && is_tab_header_clicked(tab, y) && cat_id.notNull()) { // Focus tab header to trigger tab selection change. @@ -822,7 +825,7 @@ void LLOutfitsList::handleInvFavColorChange() ++iter) { if (!iter->second) continue; - LLOutfitAccordionCtrlTab* tab = (LLOutfitAccordionCtrlTab*)iter->second; + LLOutfitAccordionCtrlTab* tab = iter->second; // refresh font color tab->setFavorite(tab->getFavorite()); @@ -849,7 +852,7 @@ void LLOutfitsList::onChangeSortOrder(const LLSD& userdata) { for (outfits_map_t::value_type& outfit : mOutfitsMap) { - LLAccordionCtrlTab* tab = outfit.second; + LLOutfitAccordionCtrlTab* tab = outfit.second; const LLUUID& category_id = outfit.first; if (!tab) continue; @@ -890,7 +893,7 @@ LLOutfitListGearMenuBase* LLOutfitsList::createGearMenu() } -bool is_tab_header_clicked(LLAccordionCtrlTab* tab, S32 y) +bool is_tab_header_clicked(LLOutfitAccordionCtrlTab* tab, S32 y) { if(!tab || !tab->getHeaderVisible()) return false; diff --git a/indra/newview/lloutfitslist.h b/indra/newview/lloutfitslist.h index 0bf5becb055..bcf7e45696a 100644 --- a/indra/newview/lloutfitslist.h +++ b/indra/newview/lloutfitslist.h @@ -38,14 +38,13 @@ #include "lltoggleablemenu.h" #include "llviewermenu.h" -class LLAccordionCtrlTab; +class LLOutfitAccordionCtrlTab; class LLInventoryCategoriesObserver; class LLOutfitListGearMenuBase; class LLOutfitListSortMenuBase; class LLWearableItemsList; class LLListContextMenu; - /** * @class LLOutfitTabNameComparator * @@ -76,7 +75,7 @@ class LLOutfitTabFavComparator : public LLAccordionCtrl::LLTabComparator class LLOutfitListBase : public LLPanelAppearanceTab { public: - typedef boost::function selection_change_callback_t; + typedef std::function selection_change_callback_t; typedef boost::signals2::signal selection_change_signal_t; LLOutfitListBase(); @@ -266,7 +265,10 @@ class LLOutfitAccordionCtrlTab : public LLAccordionCtrlTab void setFavorite(bool is_favorite); bool getFavorite() const { return mIsFavorite; } + LLUUID getFolderID() const { return mFolderID; } void setOutfitSelected(bool val); + U32 getFilterGeneration() const { return mFilterGeneration; } + void setFilterGeneration(U32 generation) { mFilterGeneration = generation; } static LLUIImage* sFavoriteIcon; static LLUIColor sFgColor; @@ -284,6 +286,7 @@ class LLOutfitAccordionCtrlTab : public LLAccordionCtrlTab LLUUID mFolderID; bool mIsFavorite = false; bool mIsSelected = false; + U32 mFilterGeneration = 0; }; /** * @class LLOutfitsList @@ -386,20 +389,20 @@ class LLOutfitsList : public LLOutfitListBase * * A tab may be hidden if it doesn't match current filter. */ - void restoreOutfitSelection(LLAccordionCtrlTab* tab, const LLUUID& category_id); + void restoreOutfitSelection(LLOutfitAccordionCtrlTab* tab, const LLUUID& category_id); /** * Called upon list refresh event to update tab visibility depending on * the results of applying filter to the title and list items of the tab. */ - void onRefreshComplete(LLUICtrl* ctrl); + void onRefreshComplete(LLUICtrl* ctrl, LLOutfitAccordionCtrlTab* tab); /** * Applies filter to the given tab * * @see applyFilter() */ - void applyFilterToTab(const LLUUID& category_id, LLAccordionCtrlTab* tab, const std::string& filter_substring); + void applyFilterToTab(const LLUUID& category_id, LLOutfitAccordionCtrlTab* tab, const std::string& filter_substring); /** * Returns true if all selected items can be worn. @@ -426,7 +429,7 @@ class LLOutfitsList : public LLOutfitListBase typedef wearables_lists_map_t::value_type wearables_lists_map_value_t; wearables_lists_map_t mSelectedListsMap; - typedef std::map outfits_map_t; + typedef std::map outfits_map_t; typedef outfits_map_t::value_type outfits_map_value_t; outfits_map_t mOutfitsMap; diff --git a/indra/newview/llpanelappearancetab.cpp b/indra/newview/llpanelappearancetab.cpp index 3ee4ab8e511..ef04d7f13f5 100644 --- a/indra/newview/llpanelappearancetab.cpp +++ b/indra/newview/llpanelappearancetab.cpp @@ -40,6 +40,7 @@ void LLPanelAppearanceTab::setFilterSubString(const std::string& new_string) { std::string old_string = mFilterSubString; mFilterSubString = new_string; + mFilterGeneration++; onFilterSubStringChanged(mFilterSubString, old_string); } @@ -52,6 +53,7 @@ void LLPanelAppearanceTab::checkFilterSubString() { std::string old_string = mFilterSubString; mFilterSubString = sRecentFilterSubString; + mFilterGeneration++; onFilterSubStringChanged(mFilterSubString, old_string); } } diff --git a/indra/newview/llpanelappearancetab.h b/indra/newview/llpanelappearancetab.h index e088c3e6f0f..936fe2aec79 100644 --- a/indra/newview/llpanelappearancetab.h +++ b/indra/newview/llpanelappearancetab.h @@ -48,6 +48,7 @@ class LLPanelAppearanceTab : public LLPanel virtual void getSelectedItemsUUIDs(uuid_vec_t& selected_uuids) const {} const std::string& getFilterSubString() { return mFilterSubString; } + U32 getFilterGeneration() { return mFilterGeneration; } virtual void updateMenuItemsVisibility() = 0; virtual LLToggleableMenu* getGearMenu() = 0; @@ -63,6 +64,7 @@ class LLPanelAppearanceTab : public LLPanel private: std::string mFilterSubString; + U32 mFilterGeneration = 0; static std::string sRecentFilterSubString; }; diff --git a/indra/newview/llpanelavatar.cpp b/indra/newview/llpanelavatar.cpp index 0e72771bd8c..35624436b38 100644 --- a/indra/newview/llpanelavatar.cpp +++ b/indra/newview/llpanelavatar.cpp @@ -126,11 +126,11 @@ static void put_avatar_properties_coro(std::string cap_url, LLUUID agent_id, LLS { LLCore::HttpRequest::policy_t httpPolicy(LLCore::HttpRequest::DEFAULT_POLICY_ID); LLCoreHttpUtil::HttpCoroutineAdapter::ptr_t - httpAdapter(new LLCoreHttpUtil::HttpCoroutineAdapter("put_avatar_properties_coro", httpPolicy)); - LLCore::HttpRequest::ptr_t httpRequest(new LLCore::HttpRequest); + httpAdapter = std::make_shared("put_avatar_properties_coro", httpPolicy); + LLCore::HttpRequest::ptr_t httpRequest = std::make_shared(); LLCore::HttpHeaders::ptr_t httpHeaders; - LLCore::HttpOptions::ptr_t httpOpts(new LLCore::HttpOptions); + LLCore::HttpOptions::ptr_t httpOpts = std::make_shared(); httpOpts->setFollowRedirects(true); std::string finalUrl = cap_url + "/" + agent_id.asString(); diff --git a/indra/newview/llpanelblockedlist.cpp b/indra/newview/llpanelblockedlist.cpp index 7d55ba32651..69f51b03b67 100644 --- a/indra/newview/llpanelblockedlist.cpp +++ b/indra/newview/llpanelblockedlist.cpp @@ -263,7 +263,7 @@ void LLPanelBlockedList::callbackBlockByName(const std::string& text) // Constructor/Destructor LLFloaterGetBlockedObjectName::LLFloaterGetBlockedObjectName(const LLSD& key) : LLFloater(key) -, mGetObjectNameCallback(NULL) +, mGetObjectNameCallback(nullptr) { } diff --git a/indra/newview/llpanelblockedlist.h b/indra/newview/llpanelblockedlist.h index 1f470199ceb..782a44bc5be 100644 --- a/indra/newview/llpanelblockedlist.h +++ b/indra/newview/llpanelblockedlist.h @@ -95,7 +95,7 @@ class LLFloaterGetBlockedObjectName : public LLFloater { friend class LLFloaterReg; public: - typedef boost::function get_object_name_callback_t; + typedef std::function get_object_name_callback_t; bool postBuild() override; diff --git a/indra/newview/llpanelclassified.cpp b/indra/newview/llpanelclassified.cpp index 449a670de97..aefda39fb97 100644 --- a/indra/newview/llpanelclassified.cpp +++ b/indra/newview/llpanelclassified.cpp @@ -153,8 +153,10 @@ void LLPanelClassifiedInfo::reshape(S32 width, S32 height, bool called_from_pare void LLPanelClassifiedInfo::onOpen(const LLSD& key) { + bool from_search = key.has("from_search") ? key["from_search"].asBoolean() : false; + LLUUID avatar_id = key["classified_creator_id"]; - if(avatar_id.isNull()) + if(avatar_id.isNull() && !from_search) { return; } diff --git a/indra/newview/llpanelcontents.cpp b/indra/newview/llpanelcontents.cpp index 7910bcb41db..bc99899c270 100644 --- a/indra/newview/llpanelcontents.cpp +++ b/indra/newview/llpanelcontents.cpp @@ -60,6 +60,7 @@ #include "llviewerwindow.h" #include "llworld.h" #include "llfloaterperms.h" +#include "llviewerassetupload.h" // // Imported globals @@ -220,12 +221,25 @@ void LLPanelContents::clearContents() // Static functions // +// See below comment in `onClickNewScript()` about this hack :( +static const std::string DEFAULT_SLUA_SCRIPT = R"( +function LLEvents.touch_start(detected) + ll.Say(0, "Touched.") +end + +local function main() + print("Hello, Avatar!") +end + +main() +)"; + // static void LLPanelContents::onClickNewScript(void *userdata) { const bool children_ok = true; LLViewerObject* object = LLSelectMgr::getInstance()->getSelection()->getFirstRootObject(children_ok); - if(object) + if (object) { LLPermissions perm; perm.init(gAgent.getID(), gAgent.getID(), LLUUID::null, LLUUID::null); @@ -239,6 +253,101 @@ void LLPanelContents::onClickNewScript(void *userdata) PERM_MOVE | LLFloaterPerms::getNextOwnerPerms("Scripts")); std::string desc; LLViewerAssetType::generateDescriptionFor(LLAssetType::AT_LSL_TEXT, desc); + + // -------------------------------------------------------------------------------------------------- + // Begin hack + // + // The current state of the server doesn't allow specifying a default script template, + // so we have to update its code immediately after creation instead. + // + // Moreover, _PREHASH_RezScript has more complex server-side logic than _PREHASH_CreateInventoryItem, + // which changes the item's attributes, such as its name and UUID. The simplest way to mitigate this + // is to create a temporary item in the user's inventory, modify it as in create_inventory_item()'s + // callback, and then call _PREHASH_RezScript to move it into the object's inventory. + // + // This temporary workaround should be removed after a server-side fix. + // See https://github.com/secondlife/viewer/issues/3731 for more information. + // + LLViewerRegion* region = object->getRegion(); + if (region && region->simulatorFeaturesReceived()) + { + LLSD simulatorFeatures; + region->getSimulatorFeatures(simulatorFeatures); + if (simulatorFeatures["LuaScriptsEnabled"].asBoolean()) + { + if (std::string::size_type pos = desc.find("lsl2"); pos != std::string::npos) + { + desc.replace(pos, 4, "SLua"); + } + + auto scriptCreationCallback = [object](const LLUUID& inv_item) + { + if (!inv_item.isNull()) + { + LLViewerInventoryItem* item = gInventory.getItem(inv_item); + if (item) + { + auto scriptUploadFinished = [object, item](LLUUID itemId, LLUUID newAssetId, LLUUID newItemId, LLSD response) + { + LLPointer new_script = new LLViewerInventoryItem(item); + object->saveScript(new_script, true, true); + + // Delete the temporary item from the user's inventory after rezzing it in the object's inventory + ms_sleep(50); + LLMessageSystem* msg = gMessageSystem; + msg->newMessageFast(_PREHASH_RemoveInventoryItem); + msg->nextBlockFast(_PREHASH_AgentData); + msg->addUUIDFast(_PREHASH_AgentID, gAgent.getID()); + msg->addUUIDFast(_PREHASH_SessionID, gAgent.getSessionID()); + msg->nextBlockFast(_PREHASH_InventoryData); + msg->addUUIDFast(_PREHASH_ItemID, item->getUUID()); + gAgent.sendReliableMessage(); + + gInventory.deleteObject(item->getUUID()); + gInventory.notifyObservers(); + }; + + std::string url = gAgent.getRegion()->getCapability("UpdateScriptAgent"); + if (!url.empty()) + { + LLResourceUploadInfo::ptr_t uploadInfo(std::make_shared( + item->getUUID(), + "luau", + DEFAULT_SLUA_SCRIPT, + scriptUploadFinished, + nullptr)); + + LLViewerAssetUpload::EnqueueInventoryUpload(url, uploadInfo); + } + } + } + }; + LLPointer cb = new LLBoostFuncInventoryCallback(scriptCreationCallback); + + LLMessageSystem* msg = gMessageSystem; + msg->newMessageFast(_PREHASH_CreateInventoryItem); + msg->nextBlock(_PREHASH_AgentData); + msg->addUUIDFast(_PREHASH_AgentID, gAgent.getID()); + msg->addUUIDFast(_PREHASH_SessionID, gAgent.getSessionID()); + msg->nextBlock(_PREHASH_InventoryBlock); + msg->addU32Fast(_PREHASH_CallbackID, gInventoryCallbacks.registerCB(cb)); + msg->addUUIDFast(_PREHASH_FolderID, gInventory.getRootFolderID()); + msg->addUUIDFast(_PREHASH_TransactionID, LLTransactionID::tnull); + msg->addU32Fast(_PREHASH_NextOwnerMask, PERM_MOVE | PERM_TRANSFER); + msg->addS8Fast(_PREHASH_Type, LLAssetType::AT_LSL_TEXT); + msg->addS8Fast(_PREHASH_InvType, LLInventoryType::IT_LSL); + msg->addU8Fast(_PREHASH_WearableType, NO_INV_SUBTYPE); + msg->addStringFast(_PREHASH_Name, "New Script"); + msg->addStringFast(_PREHASH_Description, desc); + + gAgent.sendReliableMessage(); + return; + } + } + // + // End hack + // -------------------------------------------------------------------------------------------------- + LLPointer new_item = new LLViewerInventoryItem( LLUUID::null, diff --git a/indra/newview/llpaneldirbrowser.cpp b/indra/newview/llpaneldirbrowser.cpp new file mode 100644 index 00000000000..8c981cad55a --- /dev/null +++ b/indra/newview/llpaneldirbrowser.cpp @@ -0,0 +1,1169 @@ +/** + * @file llpaneldirbrowser.cpp + * @brief Base class for panels in the legacy Search directory. + * + * $LicenseInfo:firstyear=2025&license=viewerlgpl$ + * Second Life Viewer Source Code + * Copyright (C) 2025, 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$ + */ + +// Base class for the various search panels/results browsers +// in the Find floater. For example, Find > Popular Places +// is derived from this. + +#include "llviewerprecompiledheaders.h" + +#include "llpaneldirbrowser.h" + +// linden library includes +#include "lldir.h" +#include "lleventflags.h" +#include "llqueryflags.h" +#include "message.h" + +// viewer project includes +#include "llagent.h" +#include "llbutton.h" +#include "llcheckboxctrl.h" +#include "llcombobox.h" +#include "lllineeditor.h" +#include "llnotificationsutil.h" +#include "llpanelavatar.h" +#include "llpanelgroup.h" +#include "llpanelclassified.h" +#include "llpaneldirevents.h" +#include "llpaneldirland.h" +#include "llproductinforequest.h" +#include "llscrolllistctrl.h" +#include "lltextbox.h" +#include "lltrans.h" +#include "llviewercontrol.h" +#include "llfloaterdirectory.h" +#include "llpanelprofile.h" +#include "llpanelplaces.h" +#include "llpaneleventinfo.h" + + +std::map gDirBrowserInstances; + +LLPanelDirBrowser::LLPanelDirBrowser() +: LLPanel(), + mSearchID(), + mWantSelectID(), + mCurrentSortColumn("name"), + mCurrentSortAscending(true), + mSearchStart(0), + mResultsPerPage(RESULTS_PER_PAGE_DEFAULT), + mResultsReceived(0), + mMinSearchChars(1), + mResultsContents(), + mHaveSearchResults(false), + mDidAutoSelect(true), + mLastResultTimer(), + mFloaterDirectory(nullptr) +{ +} + +bool LLPanelDirBrowser::postBuild() +{ + childSetCommitCallback("results", onCommitList, this); + + mPrevPageBtn = getChild("prev_btn"); + mNextPageBtn = getChild("next_btn"); + + mPrevPageBtn->setClickedCallback([this](LLUICtrl*, const LLSD&){ prevPage(); }); + mPrevPageBtn->setVisible(false); + + mNextPageBtn->setClickedCallback([this](LLUICtrl*, const LLSD&) { nextPage(); }); + mNextPageBtn->setVisible(false); + + return true; +} + +LLPanelDirBrowser::~LLPanelDirBrowser() +{ + // Children all cleaned up by default view destructor. + gDirBrowserInstances.erase(mSearchID); +} + +// virtual +void LLPanelDirBrowser::draw() +{ + // HACK: If the results panel has data, we want to select the first + // item. Unfortunately, we don't know when the find is actually done, + // so only do this if it's been some time since the last packet of + // results was received. + if (mLastResultTimer.getElapsedTimeF32() > 0.5) + { + if (!mDidAutoSelect && + !childHasFocus("results")) + { + LLCtrlListInterface *list = childGetListInterface("results"); + if (list) + { + if (list->getCanSelect()) + { + list->selectFirstItem(); // select first item by default + childSetFocus("results", true); + } + // Request specific data from the server + onCommitList(NULL, this); + } + } + mDidAutoSelect = true; + } + + LLPanel::draw(); +} + + +// virtual +void LLPanelDirBrowser::nextPage() +{ + mSearchStart += mResultsPerPage; + mPrevPageBtn->setVisible(true); + + performQuery(); +} + + +// virtual +void LLPanelDirBrowser::prevPage() +{ + mSearchStart -= mResultsPerPage; + mPrevPageBtn->setVisible(mSearchStart > 0); + + performQuery(); +} + + +void LLPanelDirBrowser::resetSearchStart() +{ + mSearchStart = 0; + mNextPageBtn->setVisible(false); + mPrevPageBtn->setVisible(false); +} + +// protected +void LLPanelDirBrowser::updateResultCount() +{ + LLScrollListCtrl* list = getChild("results"); + + S32 result_count = list->getItemCount(); + std::string result_text; + + if (!mHaveSearchResults) result_count = 0; + + if (mNextPageBtn && mNextPageBtn->getVisible()) + { + // Item count be off by a few if bogus items sent from database + // Just use the number of results per page. JC + result_text = llformat(">%d found", mResultsPerPage); + } + else + { + result_text = llformat("%d found", result_count); + } + + childSetValue("result_text", result_text); + + if (result_count == 0) + { + // add none found response + if (list->getItemCount() == 0) + { + list->setCommentText(std::string("None found.")); // *TODO: Translate + list->operateOnAll(LLCtrlListInterface::OP_DESELECT); + } + } + else + { + childEnable("results"); + } +} + +// static +std::string LLPanelDirBrowser::filterShortWords(const std::string source_string, int shortest_word_length, bool& was_filtered) +{ + // degenerate case + if ( source_string.length() < 1 ) + return ""; + + std::stringstream codec( source_string ); + std::string each_word; + std::vector< std::string > all_words; + + while( codec >> each_word ) + all_words.push_back( each_word ); + + std::ostringstream dest_string( "" ); + + was_filtered = false; + + std::vector< std::string >::iterator iter = all_words.begin(); + while( iter != all_words.end() ) + { + if ( (int)(*iter).length() >= shortest_word_length ) + { + dest_string << *iter; + dest_string << " "; + } + else + { + was_filtered = true; + } + + ++iter; + }; + + return dest_string.str(); +} + +void LLPanelDirBrowser::selectByUUID(const LLUUID& id) +{ + LLCtrlListInterface *list = childGetListInterface("results"); + if (!list) return; + bool found = list->setCurrentByID(id); + if (found) + { + // we got it, don't wait for network + // Don't bother looking for this in the draw loop. + mWantSelectID.setNull(); + // Make sure UI updates. + onCommitList(NULL, this); + } + else + { + // waiting for this item from the network + mWantSelectID = id; + } +} + +void LLPanelDirBrowser::selectEventByID(S32 event_id) +{ + if (mFloaterDirectory) + { + if (mFloaterDirectory->mPanelEventp) + { + mFloaterDirectory->mPanelEventp->setVisible(true); + mFloaterDirectory->mPanelEventp->setEventID(event_id); + } + } +} + +void LLPanelDirBrowser::getSelectedInfo(LLUUID* id, S32 *type) +{ + LLCtrlListInterface *list = childGetListInterface("results"); + if (!list) return; + + LLSD id_sd = childGetValue("results"); + + *id = id_sd.asUUID(); + + std::string id_str = id_sd.asString(); + *type = mResultsContents[id_str]["type"]; +} + + +// static +void LLPanelDirBrowser::onCommitList(LLUICtrl* ctrl, void* data) +{ + LLPanelDirBrowser* self = (LLPanelDirBrowser*)data; + LLCtrlListInterface *list = self->childGetListInterface("results"); + if (!list) return; + + // Start with everyone invisible + if (self->mFloaterDirectory) + { + self->mFloaterDirectory->hideAllDetailPanels(); + } + + if (!list->getCanSelect()) + { + return; + } + + std::string id_str = self->childGetValue("results").asString(); + if (id_str.empty()) + { + return; + } + + LLSD item_id = list->getCurrentID(); + S32 type = self->mResultsContents[id_str]["type"]; + if (type == EVENT_CODE) + { + // all but events use the UUID above + item_id = self->mResultsContents[id_str]["event_id"]; + } + //std::string name = self->mResultsContents[id_str]["name"].asString(); + self->showDetailPanel(type, item_id); +} + +void LLPanelDirBrowser::showDetailPanel(S32 type, LLSD id) +{ + switch(type) + { + case AVATAR_CODE: + if (mFloaterDirectory && mFloaterDirectory->mPanelAvatarp) + { + mFloaterDirectory->mPanelAvatarp->setVisible(true); + mFloaterDirectory->mPanelAvatarp->onOpen(id); + mFloaterDirectory->mPanelAvatarp->updateData(); + } + break; + case GROUP_CODE: + if (mFloaterDirectory && mFloaterDirectory->mPanelGroupp) + { + mFloaterDirectory->mPanelGroupp->setVisible(true); + mFloaterDirectory->mPanelGroupp->onOpen(LLSD().with("group_id", id)); + } + break; + case PLACE_CODE: + case FOR_SALE_CODE: + case AUCTION_CODE: + if (mFloaterDirectory && mFloaterDirectory->mPanelPlacep) + { + mFloaterDirectory->mPanelPlacep->setVisible(true); + LLSD key; + key["type"] = "remote_place"; + key["id"]= id; + mFloaterDirectory->mPanelPlacep->onOpen(key); + } + break; + case CLASSIFIED_CODE: + if (mFloaterDirectory && mFloaterDirectory->mPanelClassifiedp) + { + mFloaterDirectory->mPanelClassifiedp->setVisible(true); + LLSD key; + key["classified_id"] = id; + key["from_search"] = true; + mFloaterDirectory->mPanelClassifiedp->onOpen(key); + } + break; + case EVENT_CODE: + { + U32 event_id = (U32)id.asInteger(); + showEvent(event_id); + } + break; + default: + { + LL_WARNS() << "Unknown event type!" << LL_ENDL; + } + break; + } +} + + +void LLPanelDirBrowser::showEvent(const U32 event_id) +{ + // Start with everyone invisible + if (mFloaterDirectory) + { + mFloaterDirectory->hideAllDetailPanels(); + if (mFloaterDirectory->mPanelEventp) + { + mFloaterDirectory->mPanelEventp->setVisible(true); + mFloaterDirectory->mPanelEventp->setEventID(event_id); + } + } +} + +void LLPanelDirBrowser::processDirPeopleReply(LLMessageSystem *msg, void**) +{ + LLUUID query_id; + std::string first_name; + std::string last_name; + LLUUID agent_id; + + msg->getUUIDFast(_PREHASH_QueryData,_PREHASH_QueryID, query_id); + + LLPanelDirBrowser* self = get_if_there(gDirBrowserInstances, query_id, (LLPanelDirBrowser*)NULL); + if (!self) + { + // data from an old query + return; + } + + self->mHaveSearchResults = true; + + LLCtrlListInterface *list = self->childGetListInterface("results"); + if (!list) return; + + if (!list->getCanSelect()) + { + list->operateOnAll(LLCtrlListInterface::OP_DELETE); + self->mResultsContents = LLSD(); + } + + S32 rows = msg->getNumberOfBlocksFast(_PREHASH_QueryReplies); + self->mResultsReceived += rows; + + rows = self->showNextButton(rows); + + for (S32 i = 0; i < rows; i++) + { + msg->getStringFast(_PREHASH_QueryReplies,_PREHASH_FirstName, first_name, i); + msg->getStringFast(_PREHASH_QueryReplies,_PREHASH_LastName, last_name, i); + msg->getUUIDFast( _PREHASH_QueryReplies,_PREHASH_AgentID, agent_id, i); + // msg->getU8Fast( _PREHASH_QueryReplies,_PREHASH_Online, online, i); + // unused + // msg->getStringFast(_PREHASH_QueryReplies,_PREHASH_Group, group, i); + // msg->getS32Fast( _PREHASH_QueryReplies,_PREHASH_Reputation, reputation, i); + + if (agent_id.isNull()) + { + continue; + } + + LLSD content; + + LLSD row; + row["id"] = agent_id; + + // We don't show online status in the finder anymore, + // so just use the 'offline' icon as the generic 'person' icon + row["columns"][0]["column"] = "icon"; + row["columns"][0]["type"] = "icon"; + row["columns"][0]["value"] = "icon_avatar_offline.tga"; + + content["type"] = AVATAR_CODE; + + std::string fullname = first_name + " " + last_name; + row["columns"][1]["column"] = "name"; + row["columns"][1]["value"] = fullname; + row["columns"][1]["font"] = "SANSSERIF"; + + content["name"] = fullname; + + list->addElement(row); + self->mResultsContents[agent_id.asString()] = content; + } + + list->sortByColumn(self->mCurrentSortColumn, self->mCurrentSortAscending); + self->updateResultCount(); + + // Poke the result received timer + self->mLastResultTimer.reset(); + self->mDidAutoSelect = false; +} + + +void LLPanelDirBrowser::processDirPlacesReply(LLMessageSystem* msg, void**) +{ + LLUUID agent_id; + LLUUID query_id; + LLUUID parcel_id; + std::string name; + bool is_for_sale = false; + bool is_auction = false; + F32 dwell; + + msg->getUUID("AgentData", "AgentID", agent_id); + msg->getUUID("QueryData", "QueryID", query_id ); + + if (msg->getNumberOfBlocks("StatusData")) + { + U32 status; + msg->getU32("StatusData", "Status", status); + if (status & STATUS_SEARCH_PLACES_BANNEDWORD) + { + LLNotificationsUtil::add("SearchWordBanned"); + } + } + + LLPanelDirBrowser* self = get_if_there(gDirBrowserInstances, query_id, (LLPanelDirBrowser*)NULL); + if (!self) + { + // data from an old query + return; + } + + self->mHaveSearchResults = true; + + LLCtrlListInterface *list = self->childGetListInterface("results"); + if (!list) return; + + if (!list->getCanSelect()) + { + list->operateOnAll(LLCtrlListInterface::OP_DELETE); + self->mResultsContents = LLSD(); + } + + S32 count = msg->getNumberOfBlocks("QueryReplies"); + self->mResultsReceived += count; + + count = self->showNextButton(count); + + for (S32 i = 0; i < count ; i++) + { + msg->getUUID("QueryReplies", "ParcelID", parcel_id, i); + msg->getString("QueryReplies", "Name", name, i); + msg->getBOOL("QueryReplies", "ForSale", is_for_sale, i); + msg->getBOOL("QueryReplies", "Auction", is_auction, i); + msg->getF32("QueryReplies", "Dwell", dwell, i); + + if (parcel_id.isNull()) + { + continue; + } + + LLSD content; + S32 type; + + LLSD row = self->createLandSale(parcel_id, is_auction, is_for_sale, name, &type); + + content["type"] = type; + content["name"] = name; + + std::string buffer = llformat("%.0f", (F64)dwell); + row["columns"][2]["column"] = "dwell"; + row["columns"][2]["value"] = buffer; + row["columns"][2]["font"] = "SansSerifSmall"; + + list->addElement(row); + self->mResultsContents[parcel_id.asString()] = content; + } + + list->sortByColumn(self->mCurrentSortColumn, self->mCurrentSortAscending); + self->updateResultCount(); + + // Poke the result received timer + self->mLastResultTimer.reset(); + self->mDidAutoSelect = false; +} + + +void LLPanelDirBrowser::processDirEventsReply(LLMessageSystem* msg, void**) +{ + LLUUID agent_id; + LLUUID query_id; + LLUUID owner_id; + std::string name; + std::string date; + bool show_pg = gSavedSettings.getBOOL("ShowPGEvents"); + bool show_mature = gSavedSettings.getBOOL("ShowMatureEvents"); + bool show_adult = gSavedSettings.getBOOL("ShowAdultEvents"); + + msg->getUUID("AgentData", "AgentID", agent_id); + msg->getUUID("QueryData", "QueryID", query_id ); + + LLPanelDirBrowser* self = get_if_there(gDirBrowserInstances, query_id, (LLPanelDirBrowser*)NULL); + if (!self) + { + return; + } + + if (msg->getNumberOfBlocks("StatusData")) + { + U32 status; + msg->getU32("StatusData", "Status", status); + if (status & STATUS_SEARCH_EVENTS_BANNEDWORD) + { + LLNotificationsUtil::add("SearchWordBanned"); + } + } + + self->mHaveSearchResults = true; + + LLCtrlListInterface *list = self->childGetListInterface("results"); + if (!list) return; + + if (!list->getCanSelect()) + { + list->operateOnAll(LLCtrlListInterface::OP_DELETE); + self->mResultsContents = LLSD(); + } + + S32 rows = msg->getNumberOfBlocks("QueryReplies"); + self->mResultsReceived += rows; + + rows = self->showNextButton(rows); + + for (S32 i = 0; i < rows; i++) + { + U32 event_id; + U32 unix_time; + U32 event_flags; + + msg->getUUID("QueryReplies", "OwnerID", owner_id, i); + msg->getString("QueryReplies", "Name", name, i); + msg->getU32("QueryReplies", "EventID", event_id, i); + msg->getString("QueryReplies", "Date", date, i); + msg->getU32("QueryReplies", "UnixTime", unix_time, i); + msg->getU32("QueryReplies", "EventFlags", event_flags, i); + + // Skip empty events + if (owner_id.isNull()) + { + //RN: should this check event_id instead? + LL_WARNS() << "skipped event due to owner_id null, event_id " << event_id << LL_ENDL; + continue; + } + + // skip events that don't match the flags + // there's no PG flag, so we make sure neither adult nor mature is set + if (((event_flags & (EVENT_FLAG_ADULT | EVENT_FLAG_MATURE)) == EVENT_FLAG_NONE) && !show_pg) + { + //llwarns << "Skipped pg event because we're not showing pg, event_id " << event_id << llendl; + continue; + } + + if ((event_flags & EVENT_FLAG_MATURE) && !show_mature) + { + //llwarns << "Skipped mature event because we're not showing mature, event_id " << event_id << llendl; + continue; + } + + if ((event_flags & EVENT_FLAG_ADULT) && !show_adult) + { + //llwarns << "Skipped adult event because we're not showing adult, event_id " << event_id << llendl; + continue; + } + + LLSD content; + + content["type"] = EVENT_CODE; + content["name"] = name; + content["event_id"] = (S32)event_id; + + LLSD row; + row["id"] = llformat("%u", event_id); + + // Column 0 - event icon + LLUUID image_id; + if (event_flags == EVENT_FLAG_ADULT) + { + row["columns"][0]["column"] = "icon"; + row["columns"][0]["type"] = "icon"; + row["columns"][0]["value"] = "icon_event_adult.tga"; + } + else if (event_flags == EVENT_FLAG_MATURE) + { + row["columns"][0]["column"] = "icon"; + row["columns"][0]["type"] = "icon"; + row["columns"][0]["value"] = "icon_event_mature.tga"; + } + else + { + row["columns"][0]["column"] = "icon"; + row["columns"][0]["type"] = "icon"; + row["columns"][0]["value"] = "icon_event.tga"; + } + + row["columns"][1]["column"] = "name"; + row["columns"][1]["value"] = name; + row["columns"][1]["font"] = "SANSSERIF"; + + row["columns"][2]["column"] = "date"; + row["columns"][2]["value"] = date; + row["columns"][2]["font"] = "SansSerifSmall"; + + row["columns"][3]["column"] = "time"; + row["columns"][3]["value"] = llformat("%u", unix_time); + row["columns"][3]["font"] = "SansSerifSmall"; + + list->addElement(row, ADD_TOP /*ADD_SORTED*/); + + std::string id_str = llformat("%u", event_id); + self->mResultsContents[id_str] = content; + } + + list->sortByColumn(self->mCurrentSortColumn, self->mCurrentSortAscending); + self->updateResultCount(); + + // Poke the result received timer + self->mLastResultTimer.reset(); + self->mDidAutoSelect = false; +} + + +// static +void LLPanelDirBrowser::processDirGroupsReply(LLMessageSystem* msg, void**) +{ + S32 i; + + LLUUID query_id; + LLUUID group_id; + std::string group_name; + S32 members; + F32 search_order; + + msg->getUUIDFast(_PREHASH_QueryData,_PREHASH_QueryID, query_id ); + + LLPanelDirBrowser* self = get_if_there(gDirBrowserInstances, query_id, (LLPanelDirBrowser*)NULL); + if (!self) + { + return; + } + + self->mHaveSearchResults = true; + + LLCtrlListInterface *list = self->childGetListInterface("results"); + if (!list) return; + + if (!list->getCanSelect()) + { + list->operateOnAll(LLCtrlListInterface::OP_DELETE); + self->mResultsContents = LLSD(); + } + + S32 rows = msg->getNumberOfBlocksFast(_PREHASH_QueryReplies); + self->mResultsReceived += rows; + + rows = self->showNextButton(rows); + + for (i = 0; i < rows; i++) + { + msg->getUUIDFast(_PREHASH_QueryReplies, _PREHASH_GroupID, group_id, i ); + msg->getStringFast(_PREHASH_QueryReplies, _PREHASH_GroupName, group_name, i); + msg->getS32Fast(_PREHASH_QueryReplies, _PREHASH_Members, members, i ); + msg->getF32Fast(_PREHASH_QueryReplies, _PREHASH_SearchOrder, search_order, i ); + + if (group_id.isNull()) + { + continue; + } + + LLSD content; + content["type"] = GROUP_CODE; + content["name"] = group_name; + + LLSD row; + row["id"] = group_id; + + LLUUID image_id; + row["columns"][0]["column"] = "icon"; + row["columns"][0]["type"] = "icon"; + row["columns"][0]["value"] = "icon_group.tga"; + + row["columns"][1]["column"] = "name"; + row["columns"][1]["value"] = group_name; + row["columns"][1]["font"] = "SANSSERIF"; + + row["columns"][2]["column"] = "members"; + row["columns"][2]["value"] = members; + row["columns"][2]["font"] = "SansSerifSmall"; + + row["columns"][3]["column"] = "score"; + row["columns"][3]["value"] = search_order; + + list->addElement(row); + self->mResultsContents[group_id.asString()] = content; + } + list->sortByColumn(self->mCurrentSortColumn, self->mCurrentSortAscending); + self->updateResultCount(); + + // Poke the result received timer + self->mLastResultTimer.reset(); + self->mDidAutoSelect = false; +} + + +// static +void LLPanelDirBrowser::processDirClassifiedReply(LLMessageSystem* msg, void**) +{ + S32 i; + S32 num_new_rows; + + LLUUID agent_id; + LLUUID query_id; + + msg->getUUID("AgentData", "AgentID", agent_id); + if (agent_id != gAgent.getID()) + { + LL_WARNS() << "Message for wrong agent " << agent_id + << " in processDirClassifiedReply" << LL_ENDL; + return; + } + + msg->getUUID("QueryData", "QueryID", query_id); + LLPanelDirBrowser* self = get_if_there(gDirBrowserInstances, query_id, (LLPanelDirBrowser*)NULL); + if (!self) + { + return; + } + + if (msg->getNumberOfBlocks("StatusData")) + { + U32 status; + msg->getU32("StatusData", "Status", status); + if (status & STATUS_SEARCH_CLASSIFIEDS_BANNEDWORD) + { + LLNotificationsUtil::add("SearchWordBanned"); + } + } + + self->mHaveSearchResults = true; + + LLCtrlListInterface *list = self->childGetListInterface("results"); + if (!list) return; + + if (!list->getCanSelect()) + { + list->operateOnAll(LLCtrlListInterface::OP_DELETE); + self->mResultsContents = LLSD(); + } + + num_new_rows = msg->getNumberOfBlocksFast(_PREHASH_QueryReplies); + self->mResultsReceived += num_new_rows; + + num_new_rows = self->showNextButton(num_new_rows); + for (i = 0; i < num_new_rows; i++) + { + LLUUID classified_id; + std::string name; + U32 creation_date = 0; // unix timestamp + U32 expiration_date = 0; // future use + S32 price_for_listing = 0; + msg->getUUID("QueryReplies", "ClassifiedID", classified_id, i); + msg->getString("QueryReplies", "Name", name, i); + msg->getU32("QueryReplies","CreationDate",creation_date,i); + msg->getU32("QueryReplies","ExpirationDate",expiration_date,i); + msg->getS32("QueryReplies","PriceForListing",price_for_listing,i); + + if ( classified_id.notNull() ) + { + self->addClassified(list, classified_id, name, creation_date, price_for_listing); + + LLSD content; + content["type"] = CLASSIFIED_CODE; + content["name"] = name; + self->mResultsContents[classified_id.asString()] = content; + } + } + // The server does the initial sort, by price paid per listing and date. JC + self->updateResultCount(); + + // Poke the result received timer + self->mLastResultTimer.reset(); + self->mDidAutoSelect = false; +} + +void LLPanelDirBrowser::processDirLandReply(LLMessageSystem *msg, void**) +{ + LLUUID agent_id; + LLUUID query_id; + LLUUID parcel_id; + std::string name; + std::string land_sku; + std::string land_type; + bool auction = false; + bool for_sale = false; + S32 sale_price; + S32 actual_area; + + msg->getUUID("AgentData", "AgentID", agent_id); + msg->getUUID("QueryData", "QueryID", query_id ); + + LLPanelDirBrowser* browser = get_if_there(gDirBrowserInstances, query_id, (LLPanelDirBrowser*)NULL); + if (!browser) + { + // data from an old query + return; + } + + // Only handled by LLPanelDirLand + LLPanelDirLand* self = (LLPanelDirLand*)browser; + + self->mHaveSearchResults = true; + + LLCtrlListInterface *list = self->childGetListInterface("results"); + if (!list) return; + + if (!list->getCanSelect()) + { + list->operateOnAll(LLCtrlListInterface::OP_DELETE); + self->mResultsContents = LLSD(); + } + + bool use_price = gSavedSettings.getBOOL("FindLandPrice"); + S32 limit_price = self->childGetValue("priceedit").asInteger(); + + bool use_area = gSavedSettings.getBOOL("FindLandArea"); + S32 limit_area = self->childGetValue("areaedit").asInteger(); + + S32 i; + S32 count = msg->getNumberOfBlocks("QueryReplies"); + self->mResultsReceived += count; + + S32 non_auction_count = 0; + for (i = 0; i < count; i++) + { + msg->getUUID("QueryReplies", "ParcelID", parcel_id, i); + msg->getString("QueryReplies", "Name", name, i); + msg->getBOOL("QueryReplies", "Auction", auction, i); + msg->getBOOL("QueryReplies", "ForSale", for_sale, i); + msg->getS32("QueryReplies", "SalePrice", sale_price, i); + msg->getS32("QueryReplies", "ActualArea", actual_area, i); + + if ( msg->getSizeFast(_PREHASH_QueryReplies, i, _PREHASH_ProductSKU) > 0 ) + { + msg->getStringFast(_PREHASH_QueryReplies, _PREHASH_ProductSKU, land_sku, i); + land_type = LLProductInfoRequestManager::instance().getDescriptionForSku(land_sku); + } + else + { + land_sku.clear(); + land_type = LLTrans::getString("land_type_unknown"); + } + + if (parcel_id.isNull()) continue; + + if (use_price && (sale_price > limit_price)) continue; + + if (use_area && (actual_area < limit_area)) continue; + + LLSD content; + S32 type; + + LLSD row = self->createLandSale(parcel_id, auction, for_sale, name, &type); + + content["type"] = type; + content["name"] = name; + content["landtype"] = land_type; + + std::string buffer = "Auction"; + if (!auction) + { + buffer = llformat("%d", sale_price); + non_auction_count++; + } + row["columns"][2]["column"] = "price"; + row["columns"][2]["value"] = buffer; + row["columns"][2]["font"] = "SansSerifSmall"; + + buffer = llformat("%d", actual_area); + row["columns"][3]["column"] = "area"; + row["columns"][3]["value"] = buffer; + row["columns"][3]["font"] = "SansSerifSmall"; + + if (!auction) + { + F32 price_per_meter; + if (actual_area > 0) + { + price_per_meter = (F32)sale_price / (F32)actual_area; + } + else + { + price_per_meter = 0.f; + } + // Prices are usually L$1 - L$10 / meter + buffer = llformat("%.1f", price_per_meter); + row["columns"][4]["column"] = "per_meter"; + row["columns"][4]["value"] = buffer; + row["columns"][4]["font"] = "SansSerifSmall"; + } + else + { + // Auctions start at L$1 per meter + row["columns"][4]["column"] = "per_meter"; + row["columns"][4]["value"] = "1.0"; + row["columns"][4]["font"] = "SansSerifSmall"; + } + + row["columns"][5]["column"] = "landtype"; + row["columns"][5]["value"] = land_type; + row["columns"][5]["font"] = "SansSerifSmall"; + + list->addElement(row); + self->mResultsContents[parcel_id.asString()] = content; + } + + // All auction results are shown on the first page + // But they don't count towards the 100 / page limit + // So figure out the next button here, when we know how many aren't auctions + count = self->showNextButton(non_auction_count); + + self->updateResultCount(); + + // Poke the result received timer + self->mLastResultTimer.reset(); + self->mDidAutoSelect = false; +} + +void LLPanelDirBrowser::addClassified(LLCtrlListInterface *list, const LLUUID& pick_id, const std::string& name, const U32 creation_date, const S32 price_for_listing) +{ + std::string type = llformat("%d", CLASSIFIED_CODE); + + LLSD row; + row["id"] = pick_id; + + row["columns"][0]["column"] = "icon"; + row["columns"][0]["type"] = "icon"; + row["columns"][0]["value"] = "icon_top_pick.tga"; + + row["columns"][1]["column"] = "name"; + row["columns"][1]["value"] = name; + row["columns"][1]["font"] = "SANSSERIF"; + + row["columns"][2]["column"] = "price"; + row["columns"][2]["value"] = price_for_listing; + row["columns"][2]["font"] = "SansSerifSmall"; + + list->addElement(row); +} + +LLSD LLPanelDirBrowser::createLandSale(const LLUUID& parcel_id, bool is_auction, bool is_for_sale, const std::string& name, S32 *type) +{ + LLSD row; + row["id"] = parcel_id; + LLUUID image_id; + + // Icon and type + if(is_auction) + { + row["columns"][0]["column"] = "icon"; + row["columns"][0]["type"] = "icon"; + row["columns"][0]["value"] = "icon_auction.tga"; + + *type = AUCTION_CODE; + } + else if (is_for_sale) + { + row["columns"][0]["column"] = "icon"; + row["columns"][0]["type"] = "icon"; + row["columns"][0]["value"] = "icon_for_sale.tga"; + + *type = FOR_SALE_CODE; + } + else + { + row["columns"][0]["column"] = "icon"; + row["columns"][0]["type"] = "icon"; + row["columns"][0]["value"] = "icon_place.tga"; + + *type = PLACE_CODE; + } + + row["columns"][1]["column"] = "name"; + row["columns"][1]["value"] = name; + row["columns"][1]["font"] = "SANSSERIF"; + + return row; +} + +void LLPanelDirBrowser::setupNewSearch() +{ + LLScrollListCtrl* list = getChild("results"); + + gDirBrowserInstances.erase(mSearchID); + // Make a new query ID + mSearchID.generate(); + + gDirBrowserInstances.emplace(mSearchID, this); + + // ready the list for results + list->operateOnAll(LLCtrlListInterface::OP_DELETE); + list->setCommentText(LLTrans::getString("Searching")); + list->setEnabled(false); + + mResultsReceived = 0; + mHaveSearchResults = false; + + // Set all panels to be invisible + mFloaterDirectory->hideAllDetailPanels(); + + updateResultCount(); +} + + +// static +// called from calssifieds, events, groups, land, people, and places +void LLPanelDirBrowser::onClickSearchCore(void* userdata) +{ + LLPanelDirBrowser* self = (LLPanelDirBrowser*)userdata; + if (!self) return; + + self->resetSearchStart(); + self->performQuery(); +} + + +// static +void LLPanelDirBrowser::sendDirFindQuery( + LLMessageSystem* msg, + const LLUUID& query_id, + const std::string& text, + U32 flags, + S32 query_start) +{ + msg->newMessage("DirFindQuery"); + msg->nextBlock("AgentData"); + msg->addUUID("AgentID", gAgent.getID()); + msg->addUUID("SessionID", gAgent.getSessionID()); + msg->nextBlock("QueryData"); + msg->addUUID("QueryID", query_id); + msg->addString("QueryText", text); + msg->addU32("QueryFlags", flags); + msg->addS32("QueryStart", query_start); + gAgent.sendReliableMessage(); +} + + +void LLPanelDirBrowser::onKeystrokeName(LLLineEditor* line, void* data) +{ + LLPanelDirBrowser *self = (LLPanelDirBrowser*)data; + if (line->getLength() >= (S32)self->mMinSearchChars) + { + self->setDefaultBtn( "Search" ); + self->childEnable("Search"); + } + else + { + self->setDefaultBtn(); + self->childDisable("Search"); + } +} + +// setup results when shown +void LLPanelDirBrowser::onVisibilityChange(bool new_visibility) +{ + if (new_visibility) + { + onCommitList(NULL, this); + } + LLPanel::onVisibilityChange(new_visibility); +} + +S32 LLPanelDirBrowser::showNextButton(S32 rows) +{ + // HACK: This hack doesn't work for llpaneldirfind (ALL) + // because other data is being returned as well. + if ( getName() != "find_all_old_panel") + { + // HACK: The (mResultsPerPage)+1th entry indicates there are 'more' + bool show_next = (mResultsReceived > mResultsPerPage); + mNextPageBtn->setVisible(show_next); + if (show_next) + { + rows -= (mResultsReceived - mResultsPerPage); + } + } + else + { + // Hide page buttons + mNextPageBtn->setVisible(false); + mPrevPageBtn->setVisible(false); + } + return rows; +} diff --git a/indra/newview/llpaneldirbrowser.h b/indra/newview/llpaneldirbrowser.h new file mode 100644 index 00000000000..f422affc4bd --- /dev/null +++ b/indra/newview/llpaneldirbrowser.h @@ -0,0 +1,167 @@ +/** + * @file llpaneldirbrowser.h + * @brief Base class for panels in the legacy Search directory. + * + * $LicenseInfo:firstyear=2025&license=viewerlgpl$ + * Second Life Viewer Source Code + * Copyright (C) 2025, Linden Research, Inc. + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; + * version 2.1 of the License only. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA + * + * Linden Research, Inc., 945 Battery Street, San Francisco, CA 94111 USA + * $/LicenseInfo$ + */ + +#ifndef LL_LLPANELDIRBROWSER_H +#define LL_LLPANELDIRBROWSER_H + +#include "llpanel.h" + +#include "llframetimer.h" + +class LLMessageSystem; +class LLFloaterDirectory; +class LLLineEditor; + +class LLPanelDirBrowser: public LLPanel +{ +public: + LLPanelDirBrowser(); + virtual ~LLPanelDirBrowser(); + + bool postBuild() override; + void setFloaterDirectory(LLFloaterDirectory* floater) { mFloaterDirectory = floater; } + + // Use to get periodic updates. + void draw() override; + + void onVisibilityChange(bool curVisibilityIn) override; + + // Redo your search for the prev/next page of results + virtual void prevPage(); + virtual void nextPage(); + void resetSearchStart(); + // Do the current query (used by prevPage/nextPage) + virtual void performQuery() {}; + + const LLUUID& getSearchID() const { return mSearchID; } + + // Select the line in the scroll list control with this ID, + // either now or when data arrives from the server. + void selectByUUID(const LLUUID& id); + + void selectEventByID(S32 event_id); + + void getSelectedInfo(LLUUID* id, S32 *type); + + void showDetailPanel(S32 type, LLSD item_id); + // type is EVENT_CODE, PLACE_CODE, etc. from below. + // item_id is integer for events, UUID for all others. + + // from llpaneldirbase + void setupNewSearch(); + + // default handler for clicking the search button resets the + // next/prev state and performs the query. + // Expects a pointer to an LLPanelDirBrowser object. + static void onClickSearchCore(void* userdata); + + // query_start indicates the first result row to + // return, usually 0 or 100 or 200 because the searches + // return a max of 100 rows + static void sendDirFindQuery( + LLMessageSystem* msg, + const LLUUID& query_id, + const std::string& text, + U32 flags, + S32 query_start); + + void showEvent(const U32 event_id); + + static void onCommitList(LLUICtrl* ctrl, void* data); + + static void processDirPeopleReply(LLMessageSystem* msg, void**); + static void processDirPlacesReply(LLMessageSystem* msg, void**); + static void processDirEventsReply(LLMessageSystem* msg, void**); + static void processDirGroupsReply(LLMessageSystem* msg, void**); + static void processDirClassifiedReply(LLMessageSystem* msg, void**); + static void processDirLandReply(LLMessageSystem *msg, void**); + + std::string filterShortWords( const std::string source_string, int shortest_word_length, bool& was_filtered ); + +protected: + void updateResultCount(); + + void addClassified(LLCtrlListInterface *list, const LLUUID& classified_id, const std::string& name, const U32 creation_date, const S32 price_for_listing); + LLSD createLandSale(const LLUUID& parcel_id, bool is_auction, bool is_for_sale, const std::string& name, S32 *type); + + static void onKeystrokeName(LLLineEditor* line, void* data); + + // If this is a search for a panel like "people_panel" (and not the "all" panel) + // optionally show the "Next" button. Return the actual number of + // rows to display. + S32 showNextButton(S32 rows); + +protected: + LLUUID mSearchID; // Unique ID for a pending search + LLUUID mWantSelectID; // scroll item to select on arrival + std::string mCurrentSortColumn; + bool mCurrentSortAscending; + // Some searches return a max of 100 items per page, so we can + // start the search from the 100th item rather than the 0th, etc. + S32 mSearchStart; + // Places is 100 per page, events is 200 per page + S32 mResultsPerPage; + S32 mResultsReceived; + + U32 mMinSearchChars; + + LLSD mResultsContents; + + bool mHaveSearchResults; + bool mDidAutoSelect; + LLFrameTimer mLastResultTimer; + + LLFloaterDirectory* mFloaterDirectory; + LLButton* mPrevPageBtn; + LLButton* mNextPageBtn; +}; + +constexpr S32 RESULTS_PER_PAGE_DEFAULT = 100; +constexpr S32 RESULTS_PER_PAGE_EVENTS = 200; + +// Codes used for sorting by type. +const S32 INVALID_CODE = -1; +const S32 EVENT_CODE = 0; +const S32 PLACE_CODE = 1; +// We no longer show online vs. offline in search result icons. +//const S32 ONLINE_CODE = 2; +//const S32 OFFLINE_CODE = 3; +const S32 AVATAR_CODE = 3; +const S32 GROUP_CODE = 4; +const S32 CLASSIFIED_CODE = 5; +const S32 FOR_SALE_CODE = 6; // for sale place +const S32 AUCTION_CODE = 7; // for auction place +const S32 POPULAR_CODE = 8; // popular by dwell + +// mask values for search flags +const S32 SEARCH_NONE = 0; // should try not to send this to the search engine +const S32 SEARCH_PG = 1; +const S32 SEARCH_MATURE = 2; +const S32 SEARCH_ADULT = 4; + +extern std::map gDirBrowserInstances; + +#endif // LL_LLPANELDIRBROWSER_H diff --git a/indra/newview/llpaneldirclassified.cpp b/indra/newview/llpaneldirclassified.cpp new file mode 100644 index 00000000000..ca625b956b4 --- /dev/null +++ b/indra/newview/llpaneldirclassified.cpp @@ -0,0 +1,109 @@ +/** + * @file llpaneldirclassified.cpp + * @brief Classified panel in the legacy Search directory. + * + * $LicenseInfo:firstyear=2025&license=viewerlgpl$ + * Second Life Viewer Source Code + * Copyright (C) 2025, Linden Research, Inc. + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; + * version 2.1 of the License only. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA + * + * Linden Research, Inc., 945 Battery Street, San Francisco, CA 94111 USA + * $/LicenseInfo$ + */ + +#include "llviewerprecompiledheaders.h" + +#include "llpaneldirclassified.h" + +#include "llclassifiedflags.h" + +#include "llfontgl.h" +#include "message.h" +#include "llqueryflags.h" + +#include "llagent.h" +#include "llbutton.h" +#include "llcontrol.h" +#include "llcombobox.h" +#include "llclassifiedinfo.h" +#include "lluiconstants.h" +#include "llpaneldirbrowser.h" +#include "lltextbox.h" + +#include "llcheckboxctrl.h" +#include "llfloaterdirectory.h" +#include "lllineeditor.h" +#include "llsearcheditor.h" +#include "llviewermenu.h" +#include "llnotificationsutil.h" + +static LLPanelInjector t_panel_dir_classified("panel_dir_classified"); + +LLPanelDirClassified::LLPanelDirClassified() +: LLPanelDirBrowser() +{ +} + +bool LLPanelDirClassified::postBuild() +{ + LLPanelDirBrowser::postBuild(); + + childSetAction("Search", onClickSearchCore, this); + setDefaultBtn("Search"); + return true; +} + +LLPanelDirClassified::~LLPanelDirClassified() +{ +} + +void LLPanelDirClassified::performQuery() +{ + static LLUICachedControl inc_pg("ShowPGClassifieds", true); + static LLUICachedControl inc_mature("ShowMatureClassifieds", false); + static LLUICachedControl inc_adult("ShowAdultClassifieds", false); + + if (!(inc_pg || inc_mature || inc_adult)) + { + LLNotificationsUtil::add("NoContentToSearch"); + return; + } + + // This sets mSearchID and clears the list of results + setupNewSearch(); + + // send the message + LLMessageSystem *msg = gMessageSystem; + msg->newMessageFast(_PREHASH_DirClassifiedQuery); + msg->nextBlockFast(_PREHASH_AgentData); + msg->addUUIDFast(_PREHASH_AgentID, gAgent.getID() ); + msg->addUUIDFast(_PREHASH_SessionID, gAgent.getSessionID()); + + bool filter_auto_renew = false; + U32 query_flags = pack_classified_flags_request(filter_auto_renew, inc_pg, + inc_mature && gAgent.canAccessMature(), + inc_adult && gAgent.canAccessAdult()); + U32 category = childGetValue("Category").asInteger(); + + msg->nextBlockFast(_PREHASH_QueryData); + msg->addUUIDFast(_PREHASH_QueryID, mSearchID ); + msg->addStringFast(_PREHASH_QueryText, childGetValue("name").asString()); + msg->addU32Fast(_PREHASH_QueryFlags, query_flags); + msg->addU32Fast(_PREHASH_Category, category); + msg->addS32Fast(_PREHASH_QueryStart,mSearchStart); + + gAgent.sendReliableMessage(); +} diff --git a/indra/newview/llpaneldirclassified.h b/indra/newview/llpaneldirclassified.h new file mode 100644 index 00000000000..6682f739297 --- /dev/null +++ b/indra/newview/llpaneldirclassified.h @@ -0,0 +1,55 @@ +/** + * @file llpaneldirclassified.h + * @brief Classified panel in the legacy Search directory. + * + * $LicenseInfo:firstyear=2025&license=viewerlgpl$ + * Second Life Viewer Source Code + * Copyright (C) 2025, Linden Research, Inc. + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; + * version 2.1 of the License only. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA + * + * Linden Research, Inc., 945 Battery Street, San Francisco, CA 94111 USA + * $/LicenseInfo$ + */ + +#ifndef LL_LLPANELDIRCLASSIFIED_H +#define LL_LLPANELDIRCLASSIFIED_H + +#include "llpaneldirbrowser.h" + +// UI class forward declarations +class LLButton; +class LLCheckBoxCtrl; +class LLComboBox; +class LLLineEditor; +class LLScrollListCtrl; + +class LLPanelDirClassified : public LLPanelDirBrowser +{ +public: + LLPanelDirClassified(); + /*virtual*/ ~LLPanelDirClassified(); + + bool postBuild(); + + // Request the classifieds from the database + void performQuery(); + +protected: + // onClickNext and onClickPrev are special case searches + static void onClickSearch(void *userdata); +}; + +#endif diff --git a/indra/newview/llpaneldirevents.cpp b/indra/newview/llpaneldirevents.cpp new file mode 100644 index 00000000000..227ed877cdd --- /dev/null +++ b/indra/newview/llpaneldirevents.cpp @@ -0,0 +1,248 @@ +/** + * @file llpaneldirevents.cpp + * @brief Events panel in the legacy Search directory. + * + * $LicenseInfo:firstyear=2025&license=viewerlgpl$ + * Second Life Viewer Source Code + * Copyright (C) 2025, Linden Research, Inc. + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; + * version 2.1 of the License only. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA + * + * Linden Research, Inc., 945 Battery Street, San Francisco, CA 94111 USA + * $/LicenseInfo$ + */ + +#include "llviewerprecompiledheaders.h" + +#include "llpaneldirevents.h" + +#include + +// linden library includes +#include "message.h" +#include "llqueryflags.h" + +// viewer project includes +#include "llagent.h" +#include "llviewercontrol.h" +#include "llnotificationsutil.h" +#include "llpaneldirbrowser.h" +#include "llresmgr.h" +#include "lluiconstants.h" +#include "llappviewer.h" + +static LLPanelInjector t_panel_dir_events("panel_dir_events"); + +constexpr S32 DAY_TO_SEC = 24 * 60 * 60; + +LLPanelDirEvents::LLPanelDirEvents() + : LLPanelDirBrowser(), + mDay(0) +{ + // more results per page for this + mResultsPerPage = RESULTS_PER_PAGE_EVENTS; +} + +bool LLPanelDirEvents::postBuild() +{ + LLPanelDirBrowser::postBuild(); + + childSetCommitCallback("date_mode", onDateModeCallback, this); + + childSetAction("back_btn", onBackBtn, this); + childSetAction("forward_btn", onForwardBtn, this); + + childSetCommitCallback("mature", onCommitMature, this); + + childSetAction("Search", LLPanelDirBrowser::onClickSearchCore, this); + setDefaultBtn("Search"); + + onDateModeCallback(NULL, this); + + mCurrentSortColumn = "time"; + + setDay(0); // for today + + return true; +} + +LLPanelDirEvents::~LLPanelDirEvents() +{ +} + +void LLPanelDirEvents::setDay(S32 day) +{ + mDay = day; + + // Get time UTC + time_t utc_time = time_corrected(); + + // Correct for offset + utc_time += day * DAY_TO_SEC; + + // There's only one internal tm buffer. + struct tm* internal_time; + + // Convert to Pacific, based on server's opinion of whether + // it's daylight savings time there. + internal_time = utc_to_pacific_time(utc_time, is_daylight_savings()); + + std::string buffer = llformat("%d/%d", + 1 + internal_time->tm_mon, // Jan = 0 + internal_time->tm_mday); // 2001 = 101 + childSetValue("date_text", buffer); +} + +// virtual +void LLPanelDirEvents::performQuery() +{ + // event_id 0 will perform no delete action. + performQueryOrDelete(0); +} + +void LLPanelDirEvents::performQueryOrDelete(U32 event_id) +{ + S32 relative_day = mDay; + // Update the date field to show the date IN THE SERVER'S + // TIME ZONE, as that is what will be displayed in each event + + // Get time UTC + time_t utc_time = time_corrected(); + + // Correct for offset + utc_time += relative_day * DAY_TO_SEC; + + // There's only one internal tm buffer. + struct tm* internal_time; + + // Convert to Pacific, based on server's opinion of whether + // it's daylight savings time there. + internal_time = utc_to_pacific_time(utc_time, is_daylight_savings()); + + std::string buffer = llformat("%d/%d", + 1 + internal_time->tm_mon, // Jan = 0 + internal_time->tm_mday); // 2001 = 101 + childSetValue("date_text", buffer); + + // Record the relative day so back and forward buttons + // offset from this day. + mDay = relative_day; + + static LLUICachedControl incpg("ShowPGEvents", true); + static LLUICachedControl incmature("ShowMatureEvents", false); + static LLUICachedControl incadult("ShowAdultEvents", false); + + U32 scope = DFQ_DATE_EVENTS; + if (incpg) scope |= DFQ_INC_PG; + if (incmature && gAgent.canAccessMature()) scope |= DFQ_INC_MATURE; + if (incadult && gAgent.canAccessAdult()) scope |= DFQ_INC_ADULT; + + if ( !( scope & (DFQ_INC_PG | DFQ_INC_MATURE | DFQ_INC_ADULT ))) + { + LLNotificationsUtil::add("NoContentToSearch"); + return; + } + + setupNewSearch(); + + std::ostringstream params; + + // Date mode for the search + if ("current" == childGetValue("date_mode").asString()) + { + params << "u|"; + } + else + { + params << mDay << "|"; + } + + // Categories are stored in the database in table indra.event_category + // XML must match. + U32 cat_id = childGetValue("category_combo").asInteger(); + + params << cat_id << "|"; + params << childGetValue("event_search_text").asString(); + + // send the message + if (0 == event_id) + { + sendDirFindQuery(gMessageSystem, mSearchID, params.str(), scope, mSearchStart); + } + else + { + // This delete will also perform a query. + LLMessageSystem* msg = gMessageSystem; + + msg->newMessageFast(_PREHASH_EventGodDelete); + + msg->nextBlockFast(_PREHASH_AgentData); + msg->addUUIDFast(_PREHASH_AgentID, gAgent.getID()); + msg->addUUIDFast(_PREHASH_SessionID, gAgent.getSessionID()); + + msg->nextBlockFast(_PREHASH_EventData); + msg->addU32Fast(_PREHASH_EventID, event_id); + + msg->nextBlockFast(_PREHASH_QueryData); + msg->addUUIDFast(_PREHASH_QueryID, mSearchID); + msg->addStringFast(_PREHASH_QueryText, params.str()); + msg->addU32Fast(_PREHASH_QueryFlags, scope); + msg->addS32Fast(_PREHASH_QueryStart, mSearchStart); + gAgent.sendReliableMessage(); + } +} + +// static +void LLPanelDirEvents::onDateModeCallback(LLUICtrl* ctrl, void *data) +{ + LLPanelDirEvents* self = (LLPanelDirEvents*)data; + if (self->childGetValue("date_mode").asString() == "date") + { + self->childEnable("forward_btn"); + self->childEnable("back_btn"); + } + else + { + self->childDisable("forward_btn"); + self->childDisable("back_btn"); + } +} + +// static +void LLPanelDirEvents::onBackBtn(void* data) +{ + LLPanelDirEvents* self = (LLPanelDirEvents*)data; + self->resetSearchStart(); + self->setDay(self->mDay - 1); + self->performQuery(); +} + + +// static +void LLPanelDirEvents::onForwardBtn(void* data) +{ + LLPanelDirEvents* self = (LLPanelDirEvents*)data; + self->resetSearchStart(); + self->setDay(self->mDay + 1); + self->performQuery(); +} + + +// static +void LLPanelDirEvents::onCommitMature(LLUICtrl* ctrl, void* data) +{ + // just perform another search + onClickSearchCore(data); +} diff --git a/indra/newview/llpaneldirevents.h b/indra/newview/llpaneldirevents.h new file mode 100644 index 00000000000..596abc5f0e4 --- /dev/null +++ b/indra/newview/llpaneldirevents.h @@ -0,0 +1,61 @@ +/** + * @file llpaneldirevents.h + * @brief Events panel in the legacy Search directory. + * + * $LicenseInfo:firstyear=2025&license=viewerlgpl$ + * Second Life Viewer Source Code + * Copyright (C) 2025, Linden Research, Inc. + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; + * version 2.1 of the License only. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA + * + * Linden Research, Inc., 945 Battery Street, San Francisco, CA 94111 USA + * $/LicenseInfo$ + */ + +#ifndef LL_LLPANELDIREVENTS_H +#define LL_LLPANELDIREVENTS_H + +#include "llpaneldirbrowser.h" + +class LLUICtrl; +class LLPanelDirBrowser; + +class LLPanelDirEvents : public LLPanelDirBrowser +{ +public: + LLPanelDirEvents(); + virtual ~LLPanelDirEvents(); + + bool postBuild() override; + + /*virtual*/ void performQuery() override; + + void performQueryOrDelete(U32 event_id); + + // pass 0 for today, 1 for tomorrow + void setDay(S32 day); + +protected: + static void onDateModeCallback(LLUICtrl* ctrl, void *data); + static void onBackBtn(void* data); + static void onForwardBtn(void* data); + static void onCommitMature(LLUICtrl* ctrl, void* data); + +protected: + S32 mDay; // 0 = today, 1 = tomorrow +}; + + +#endif diff --git a/indra/newview/llpaneldirgroups.cpp b/indra/newview/llpaneldirgroups.cpp new file mode 100644 index 00000000000..992d92091cf --- /dev/null +++ b/indra/newview/llpaneldirgroups.cpp @@ -0,0 +1,90 @@ +/** + * @file llpaneldirgroups.cpp + * @brief Groups panel in the legacy Search directory. + * + * $LicenseInfo:firstyear=2025&license=viewerlgpl$ + * Second Life Viewer Source Code + * Copyright (C) 2025, Linden Research, Inc. + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; + * version 2.1 of the License only. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA + * + * Linden Research, Inc., 945 Battery Street, San Francisco, CA 94111 USA + * $/LicenseInfo$ + */ + +#include "llviewerprecompiledheaders.h" + +#include "llpaneldirgroups.h" + +#include "llagent.h" +#include "llqueryflags.h" +#include "llviewercontrol.h" +#include "llsearcheditor.h" + +static LLPanelInjector t_panel_dir_groups("panel_dir_groups"); + +LLPanelDirGroups::LLPanelDirGroups() + : LLPanelDirBrowser() +{ + mMinSearchChars = 3; +} + + +bool LLPanelDirGroups::postBuild() +{ + LLPanelDirBrowser::postBuild(); + + //getChild("name")->setKeystrokeCallback(boost::bind(&LLPanelDirBrowser::onKeystrokeName, _1, _2), NULL); + + childSetAction("Search", &LLPanelDirBrowser::onClickSearchCore, this); + setDefaultBtn( "Search" ); + + return true; +} + +LLPanelDirGroups::~LLPanelDirGroups() +{ +} + +// virtual +void LLPanelDirGroups::performQuery() +{ + if (childGetValue("name").asString().length() < mMinSearchChars) + { + return; + } + + setupNewSearch(); + + // groups + U32 scope = DFQ_GROUPS; + + // Check group mature filter. + if ( !gSavedSettings.getBOOL("ShowMatureGroups") || gAgent.isTeen() ) + { + scope |= DFQ_FILTER_MATURE; + } + + mCurrentSortColumn = "score"; + mCurrentSortAscending = false; + + // send the message + sendDirFindQuery( + gMessageSystem, + mSearchID, + childGetValue("name").asString(), + scope, + mSearchStart); +} diff --git a/indra/newview/llpaneldirgroups.h b/indra/newview/llpaneldirgroups.h new file mode 100644 index 00000000000..1e10353e2ad --- /dev/null +++ b/indra/newview/llpaneldirgroups.h @@ -0,0 +1,45 @@ +/** + * @file llpaneldirgroups.h + * @brief Groups panel in the legacy Search directory. + * + * $LicenseInfo:firstyear=2025&license=viewerlgpl$ + * Second Life Viewer Source Code + * Copyright (C) 2025, Linden Research, Inc. + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; + * version 2.1 of the License only. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA + * + * Linden Research, Inc., 945 Battery Street, San Francisco, CA 94111 USA + * $/LicenseInfo$ + */ + +#ifndef LLPANELDIRGROUPS_H +#define LLPANELDIRGROUPS_H + +#include "llpaneldirbrowser.h" + +class LLPanelDirGroups : public LLPanelDirBrowser +{ +public: + LLPanelDirGroups(); + virtual ~LLPanelDirGroups(); + + /*virtual*/ bool postBuild(); + + /*virtual*/ void performQuery(); + + static void onClickSearch(void *userdata); +}; + +#endif diff --git a/indra/newview/llpaneldirland.cpp b/indra/newview/llpaneldirland.cpp new file mode 100644 index 00000000000..53c58d8fa91 --- /dev/null +++ b/indra/newview/llpaneldirland.cpp @@ -0,0 +1,247 @@ +/** + * @file llpaneldirland.cpp + * @brief Land panel in the legacy Search directory. + * + * $LicenseInfo:firstyear=2025&license=viewerlgpl$ + * Second Life Viewer Source Code + * Copyright (C) 2025, Linden Research, Inc. + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; + * version 2.1 of the License only. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA + * + * Linden Research, Inc., 945 Battery Street, San Francisco, CA 94111 USA + * $/LicenseInfo$ + */ + +#include "llviewerprecompiledheaders.h" + +#include "llpaneldirland.h" + +#include "llagent.h" +#include "llcheckboxctrl.h" +#include "llcombobox.h" +#include "lllineeditor.h" +#include "llnotificationsutil.h" +#include "llqueryflags.h" +#include "llscrolllistctrl.h" +#include "llstatusbar.h" +#include "lltextbox.h" +#include "llviewercontrol.h" +#include "llviewermessage.h" + +//----------------------------------------------------------------------------- +// Constants +//----------------------------------------------------------------------------- + +static const char FIND_ALL[] = "All Types"; +static const char FIND_AUCTION[] = "Auction"; +static const char FIND_MAINLANDSALES[] = "Mainland Sales"; +static const char FIND_ESTATESALES[] = "Estate Sales"; + +static LLPanelInjector t_panel_dir_land("panel_dir_land"); + +LLPanelDirLand::LLPanelDirLand() + : LLPanelDirBrowser() +{ +} + +bool LLPanelDirLand::postBuild() +{ + LLPanelDirBrowser::postBuild(); + + childSetValue("type", gSavedSettings.getString("FindLandType")); + + bool adult_enabled = gAgent.canAccessAdult(); + bool mature_enabled = gAgent.canAccessMature(); + childSetVisible("incpg", true); + if (!mature_enabled) + { + childSetValue("incmature", false); + childDisable("incmature"); + } + if (!adult_enabled) + { + childSetValue("incadult", false); + childDisable("incadult"); + } + + childSetCommitCallback("pricecheck", onCommitPrice, this); + childSetCommitCallback("areacheck", onCommitArea, this); + + if (gStatusBar) + { + childSetValue("priceedit", gStatusBar->getBalance()); + } + childSetEnabled("priceedit", gSavedSettings.getBOOL("FindLandPrice")); + LLLineEditor* priceedit = getChild("priceedit"); + priceedit->setPrevalidateInput(LLTextValidate::validateNonNegativeS32); + + childSetEnabled("areaedit", gSavedSettings.getBOOL("FindLandArea")); + LLLineEditor* areaedit = getChild("areaedit"); + areaedit->setPrevalidateInput(LLTextValidate::validateNonNegativeS32); + + childSetAction("Search", onClickSearchCore, this); + setDefaultBtn("Search"); + + mCurrentSortColumn = "per_meter"; + + LLScrollListCtrl* results = getChild("results"); + if (results) + { + results->setSortChangedCallback(boost::bind(&LLPanelDirLand::onClickSort, this)); + results->sortByColumn(mCurrentSortColumn,mCurrentSortAscending); + } + + return true; +} + +LLPanelDirLand::~LLPanelDirLand() +{ + // Children all cleaned up by default view destructor. +} + +void LLPanelDirLand::onClickSort() +{ + performQuery(); +} + +// static +void LLPanelDirLand::onCommitPrice(LLUICtrl* ctrl, void* data) +{ + LLPanelDirLand* self = (LLPanelDirLand*)data; + LLCheckBoxCtrl* check = (LLCheckBoxCtrl*)ctrl; + + if (!self || !check) return; + self->childSetEnabled("priceedit", check->get()); +} + +// static +void LLPanelDirLand::onCommitArea(LLUICtrl* ctrl, void* data) +{ + LLPanelDirLand* self = (LLPanelDirLand*)data; + LLCheckBoxCtrl* check = (LLCheckBoxCtrl*)ctrl; + + if (!self || !check) return; + self->childSetEnabled("areaedit", check->get()); +} + +void LLPanelDirLand::performQuery() +{ + static LLUICachedControl inc_pg("ShowPGLand", true); + static LLUICachedControl inc_mature("ShowMatureLand", false); + static LLUICachedControl inc_adult("ShowAdultLand", false); + if (!(inc_pg || inc_mature || inc_adult)) + { + LLNotificationsUtil::add("NoContentToSearch"); + return; + } + + LLMessageSystem* msg = gMessageSystem; + + setupNewSearch(); + + // We could change the UI to allow arbitrary combinations of these options + U32 search_type = ST_ALL; + const std::string& type = childGetValue("type").asString(); + if(!type.empty()) + { + if (FIND_AUCTION == type) search_type = ST_AUCTION; + else if(FIND_MAINLANDSALES == type) search_type = ST_MAINLAND; + else if(FIND_ESTATESALES == type) search_type = ST_ESTATE; + } + + U32 query_flags = 0x0; + if (gAgent.wantsPGOnly()) query_flags |= DFQ_PG_SIMS_ONLY; + + bool adult_enabled = gAgent.canAccessAdult(); + bool mature_enabled = gAgent.canAccessMature(); + + if (inc_pg) + { + query_flags |= DFQ_INC_PG; + } + + if (inc_mature && mature_enabled) + { + query_flags |= DFQ_INC_MATURE; + } + + if (inc_adult && adult_enabled) + { + query_flags |= DFQ_INC_ADULT; + } + + // Add old flags in case we are talking to an old dataserver + if (inc_pg && !inc_mature) + { + query_flags |= DFQ_PG_SIMS_ONLY; + } + + if (!inc_pg && inc_mature) + { + query_flags |= DFQ_MATURE_SIMS_ONLY; + } + + LLScrollListCtrl* list = getChild("results"); + if (list) + { + std::string sort_name = list->getSortColumnName(); + BOOL sort_asc = list->getSortAscending(); + + if (sort_name == "name") + { + query_flags |= DFQ_NAME_SORT; + } + else if (sort_name == "price") + { + query_flags |= DFQ_PRICE_SORT; + } + else if (sort_name == "per_meter") + { + query_flags |= DFQ_PER_METER_SORT; + } + else if (sort_name == "area") + { + query_flags |= DFQ_AREA_SORT; + } + + if (sort_asc) + { + query_flags |= DFQ_SORT_ASC; + } + } + + if (childGetValue("pricecheck").asBoolean()) + { + query_flags |= DFQ_LIMIT_BY_PRICE; + } + + if (childGetValue("areacheck").asBoolean()) + { + query_flags |= DFQ_LIMIT_BY_AREA; + } + + msg->newMessage("DirLandQuery"); + msg->nextBlock("AgentData"); + msg->addUUID("AgentID", gAgent.getID()); + msg->addUUID("SessionID", gAgent.getSessionID()); + msg->nextBlock("QueryData"); + msg->addUUID("QueryID", getSearchID()); + msg->addU32("QueryFlags", query_flags); + msg->addU32("SearchType", search_type); + msg->addS32("Price", childGetValue("priceedit").asInteger()); + msg->addS32("Area", childGetValue("areaedit").asInteger()); + msg->addS32Fast(_PREHASH_QueryStart,mSearchStart); + gAgent.sendReliableMessage(); +} diff --git a/indra/newview/llpaneldirland.h b/indra/newview/llpaneldirland.h new file mode 100644 index 00000000000..197c4cdc3df --- /dev/null +++ b/indra/newview/llpaneldirland.h @@ -0,0 +1,53 @@ +/** + * @file llpaneldirland.h + * @brief Land panel in the legacy Search directory. + * + * $LicenseInfo:firstyear=2025&license=viewerlgpl$ + * Second Life Viewer Source Code + * Copyright (C) 2025, Linden Research, Inc. + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; + * version 2.1 of the License only. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA + * + * Linden Research, Inc., 945 Battery Street, San Francisco, CA 94111 USA + * $/LicenseInfo$ + */ + +#ifndef LL_LLPANELDIRLAND_H +#define LL_LLPANELDIRLAND_H + +#include "llpaneldirbrowser.h" + +class LLUICtrl; +class LLPanelDirBrowser; + +class LLPanelDirLand : public LLPanelDirBrowser +{ +public: + LLPanelDirLand(); + /*virtual*/ ~LLPanelDirLand(); + + bool postBuild(); + + void performQuery(); + +protected: + void onClickSort(); + static void onCommitPrice(LLUICtrl* ctrl, void* data); + static void onCommitArea(LLUICtrl* ctrl, void* data); + +}; + + +#endif diff --git a/indra/newview/llpaneldirpeople.cpp b/indra/newview/llpaneldirpeople.cpp new file mode 100644 index 00000000000..6a55e3bc7c5 --- /dev/null +++ b/indra/newview/llpaneldirpeople.cpp @@ -0,0 +1,105 @@ +/** + * @file llpaneldirpeople.cpp + * @brief People panel in the legacy Search directory. + * + * $LicenseInfo:firstyear=2025&license=viewerlgpl$ + * Second Life Viewer Source Code + * Copyright (C) 2025, Linden Research, Inc. + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; + * version 2.1 of the License only. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA + * + * Linden Research, Inc., 945 Battery Street, San Francisco, CA 94111 USA + * $/LicenseInfo$ + */ + +#include "llviewerprecompiledheaders.h" + +#include "llpaneldirpeople.h" +#include "llviewerwindow.h" +#include "llsearcheditor.h" + +// viewer project includes +#include "llqueryflags.h" +#include "llnotificationsutil.h" + +static LLPanelInjector t_panel_dir_people("panel_dir_people"); + +LLPanelDirPeople::LLPanelDirPeople() +: LLPanelDirBrowser() +{ + mMinSearchChars = 3; +} + +bool LLPanelDirPeople::postBuild() +{ + LLPanelDirBrowser::postBuild(); + + //getChild("name")->setKeystrokeCallback(boost::bind(&LLPanelDirBrowser::onKeystrokeName, _1, _2), NULL); + + childSetAction("Search", &LLPanelDirBrowser::onClickSearchCore, this); + setDefaultBtn( "Search" ); + + return true; +} + +LLPanelDirPeople::~LLPanelDirPeople() +{ +} + +// virtual +void LLPanelDirPeople::performQuery() +{ + if (childGetValue("name").asString().length() < mMinSearchChars) + { + return; + } + + // filter short words out of the query string + // and indidate if we did have to filter it + // The shortest username is 2 characters long. + const S32 SHORTEST_WORD_LEN = 2; + bool query_was_filtered = false; + std::string query_string = LLPanelDirBrowser::filterShortWords( + childGetValue("name").asString(), + SHORTEST_WORD_LEN, + query_was_filtered ); + + // possible we threw away all the short words in the query so check length + if ( query_string.length() < mMinSearchChars ) + { + LLNotificationsUtil::add("SeachFilteredOnShortWordsEmpty"); + return; + }; + + // if we filtered something out, display a popup + if ( query_was_filtered ) + { + LLSD args; + args["FINALQUERY"] = query_string; + LLNotificationsUtil::add("SeachFilteredOnShortWords", args); + }; + + setupNewSearch(); + + U32 scope = DFQ_PEOPLE; + + // send the message + sendDirFindQuery( + gMessageSystem, + mSearchID, + query_string, + scope, + mSearchStart); +} diff --git a/indra/newview/llpaneldirpeople.h b/indra/newview/llpaneldirpeople.h new file mode 100644 index 00000000000..a8a7d17cb23 --- /dev/null +++ b/indra/newview/llpaneldirpeople.h @@ -0,0 +1,48 @@ +/** + * @file llpaneldirpeople.h + * @brief People panel in the legacy Search directory. + * + * $LicenseInfo:firstyear=2025&license=viewerlgpl$ + * Second Life Viewer Source Code + * Copyright (C) 2025, Linden Research, Inc. + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; + * version 2.1 of the License only. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA + * + * Linden Research, Inc., 945 Battery Street, San Francisco, CA 94111 USA + * $/LicenseInfo$ + */ + +#ifndef LL_LLPANELDIRPEOPLE_H +#define LL_LLPANELDIRPEOPLE_H + +#include "llpaneldirbrowser.h" +class LLLineEditor; +class LLFloaterDirectory; + +class LLPanelDirPeople : public LLPanelDirBrowser +{ +public: + LLPanelDirPeople(); + virtual ~LLPanelDirPeople(); + + /*virtual*/ bool postBuild(); + + /*virtual*/ void performQuery(); + + static void onClickSearch(void *userdata); + static void onKeystrokeName(LLLineEditor* line, void* data); +}; + +#endif diff --git a/indra/newview/llpaneldirplaces.cpp b/indra/newview/llpaneldirplaces.cpp new file mode 100644 index 00000000000..2d545660383 --- /dev/null +++ b/indra/newview/llpaneldirplaces.cpp @@ -0,0 +1,185 @@ +/** + * @file llpaneldirplaces.cpp + * @brief Places panel in the legacy Search directory. + * + * $LicenseInfo:firstyear=2025&license=viewerlgpl$ + * Second Life Viewer Source Code + * Copyright (C) 2025, Linden Research, Inc. + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; + * version 2.1 of the License only. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA + * + * Linden Research, Inc., 945 Battery Street, San Francisco, CA 94111 USA + * $/LicenseInfo$ + */ + +#include "llviewerprecompiledheaders.h" + +#include "llpaneldirplaces.h" + +#include "message.h" +#include "llparcel.h" +#include "llregionflags.h" +#include "llqueryflags.h" + +#include "llagent.h" +#include "llbutton.h" +#include "llcheckboxctrl.h" +#include "llcombobox.h" +#include "llfloaterdirectory.h" +#include "lllineeditor.h" +#include "llnotificationsutil.h" +#include "llpaneldirbrowser.h" +#include "llsearcheditor.h" +#include "lltextbox.h" +#include "llviewercontrol.h" + +static LLPanelInjector t_panel_dir_people("panel_dir_places"); + +LLPanelDirPlaces::LLPanelDirPlaces() + : LLPanelDirBrowser() +{ + mMinSearchChars = 3; +} + +bool LLPanelDirPlaces::postBuild() +{ + LLPanelDirBrowser::postBuild(); + + //getChild("name")->setKeystrokeCallback(boost::bind(&LLPanelDirBrowser::onKeystrokeName, _1, _2), NULL); + + childSetAction("Search", &LLPanelDirBrowser::onClickSearchCore, this); + setDefaultBtn("Search"); + + mCurrentSortColumn = "dwell"; + mCurrentSortAscending = false; + + return true; +} + +LLPanelDirPlaces::~LLPanelDirPlaces() +{ +} + +// virtual +void LLPanelDirPlaces::performQuery() +{ + std::string place_name = childGetValue("name").asString(); + if (place_name.length() < mMinSearchChars) + { + return; + } + + // "hi " is three chars but not a long-enough search + std::string query_string = place_name; + LLStringUtil::trim( query_string ); + bool query_was_filtered = (query_string != place_name); + + // possible we threw away all the short words in the query so check length + if ( query_string.length() < mMinSearchChars ) + { + LLNotificationsUtil::add("SeachFilteredOnShortWordsEmpty"); + return; + }; + + // if we filtered something out, display a popup + if ( query_was_filtered ) + { + LLSD args; + args["FINALQUERY"] = query_string; + LLNotificationsUtil::add("SeachFilteredOnShortWords", args); + }; + + std::string catstring = childGetValue("Category").asString(); + + // Because LLParcel::C_ANY is -1, must do special check + S32 category = 0; + if (catstring == "any") + { + category = LLParcel::C_ANY; + } + else + { + category = LLParcel::getCategoryFromString(catstring); + } + + U32 flags = 0x0; + bool adult_enabled = gAgent.canAccessAdult(); + bool mature_enabled = gAgent.canAccessMature(); + + static LLUICachedControl inc_pg("ShowPGSims", true); + static LLUICachedControl inc_mature("ShowMatureSims", false); + static LLUICachedControl inc_adult("ShowAdultSims", false); + + if (inc_pg) + { + flags |= DFQ_INC_PG; + } + + if (inc_mature && mature_enabled) + { + flags |= DFQ_INC_MATURE; + } + + if (inc_adult && adult_enabled) + { + flags |= DFQ_INC_ADULT; + } + + if (0x0 == flags) + { + LLNotificationsUtil::add("NoContentToSearch"); + return; + } + + queryCore(query_string, category, flags); +} + +void LLPanelDirPlaces::initialQuery() +{ + // All Linden locations in PG/Mature sims, any name. + U32 flags = DFQ_INC_PG | DFQ_INC_MATURE; + queryCore(LLStringUtil::null, LLParcel::C_LINDEN, flags); +} + +void LLPanelDirPlaces::queryCore(const std::string& name, S32 category, U32 flags) +{ + setupNewSearch(); + +// JC: Sorting by dwell severely impacts the performance of the query. +// Instead of sorting on the dataserver, we sort locally once the results +// are received. +// IW: Re-enabled dwell sort based on new 3-character minimum description +// Hopefully we'll move to next-gen Find before this becomes a big problem + + flags |= DFQ_DWELL_SORT; + + LLMessageSystem* msg = gMessageSystem; + + msg->newMessage("DirPlacesQuery"); + msg->nextBlock("AgentData"); + msg->addUUID("AgentID", gAgent.getID()); + msg->addUUID("SessionID", gAgent.getSessionID()); + msg->nextBlock("QueryData"); + msg->addUUID("QueryID", getSearchID()); + msg->addString("QueryText", name); + msg->addU32("QueryFlags", flags); + msg->addS8("Category", (S8)category); + // No longer support queries by region name, too many regions + // for combobox, no easy way to do autocomplete. JC + msg->addString("SimName", ""); + msg->addS32Fast(_PREHASH_QueryStart,mSearchStart); + gAgent.sendReliableMessage(); +} + diff --git a/indra/newview/llpaneldirplaces.h b/indra/newview/llpaneldirplaces.h new file mode 100644 index 00000000000..069414ebf54 --- /dev/null +++ b/indra/newview/llpaneldirplaces.h @@ -0,0 +1,51 @@ +/** + * @file llpaneldirplaces.h + * @brief Places panel in the legacy Search directory. + * + * $LicenseInfo:firstyear=2025&license=viewerlgpl$ + * Second Life Viewer Source Code + * Copyright (C) 2025, Linden Research, Inc. + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; + * version 2.1 of the License only. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA + * + * Linden Research, Inc., 945 Battery Street, San Francisco, CA 94111 USA + * $/LicenseInfo$ + */ + +#ifndef LL_LLPANELDIRPLACES_H +#define LL_LLPANELDIRPLACES_H + +#include "llpaneldirbrowser.h" + +class LLLineEditor; + +class LLPanelDirPlaces : public LLPanelDirBrowser +{ +public: + LLPanelDirPlaces(); + virtual ~LLPanelDirPlaces(); + + bool postBuild() override; + + void performQuery() override; + + // Initially fill in some data for the panel. + void initialQuery(); + +private: + void queryCore(const std::string& name, S32 category, U32 flags); +}; + +#endif diff --git a/indra/newview/llpaneldirweb.cpp b/indra/newview/llpaneldirweb.cpp new file mode 100644 index 00000000000..9e76bb81a65 --- /dev/null +++ b/indra/newview/llpaneldirweb.cpp @@ -0,0 +1,148 @@ +/** + * @file llpaneldirweb.cpp + * @brief Web panel in the legacy Search directory. + * + * $LicenseInfo:firstyear=2025&license=viewerlgpl$ + * Second Life Viewer Source Code + * Copyright (C) 2025, Linden Research, Inc. + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; + * version 2.1 of the License only. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA + * + * Linden Research, Inc., 945 Battery Street, San Francisco, CA 94111 USA + * $/LicenseInfo$ + */ + +#include "llviewerprecompiledheaders.h" + +#include "llpaneldirweb.h" + +#include "llagent.h" +#include "llbutton.h" +#include "llfloaterdirectory.h" +#include "lltextbox.h" +#include "llviewercontrol.h" +#include "llweb.h" + +static LLPanelInjector t_panel_dir_web("panel_dir_web"); + +LLPanelDirWeb::LLPanelDirWeb() +: LLPanel(), + mFloaterDirectory(nullptr), + mWebBrowser(nullptr) +{ +} + +bool LLPanelDirWeb::postBuild() +{ + childSetAction("home_btn", onClickHome, this); + + mBtnBack = getChild("back_btn"); + mBtnForward = getChild("forward_btn"); + mStatusBarText = getChild("statusbartext"); + + mBtnBack->setClickedCallback([this](LLUICtrl*, const LLSD&) { mWebBrowser->navigateBack(); }); + mBtnForward->setClickedCallback([this](LLUICtrl*, const LLSD&) { mWebBrowser->navigateForward(); }); + + mWebBrowser = findChild("web_search"); + navigateToDefaultPage(); + mWebBrowser->addObserver(this); + + return true; +} + +void LLPanelDirWeb::draw() +{ + // Asynchronous so we need to keep checking + mBtnBack->setEnabled(mWebBrowser->canNavigateBack()); + mBtnForward->setEnabled(mWebBrowser->canNavigateForward()); + + LLPanel::draw(); +} + +LLPanelDirWeb::~LLPanelDirWeb() +{ +} + +// When we show any browser-based view, we want to hide all +// the right-side XUI detail panels. +// virtual +void LLPanelDirWeb::onVisibilityChange(bool new_visibility) +{ + if (new_visibility && mFloaterDirectory) + { + mFloaterDirectory->hideAllDetailPanels(); + } + LLPanel::onVisibilityChange(new_visibility); +} + +void LLPanelDirWeb::navigateToDefaultPage() +{ + std::string url = gSavedSettings.getString("SearchURL"); + + LLSD subs; + subs["QUERY"] = ""; + subs["TYPE"] = "standard"; + // Default to PG + std::string maturity = "g"; + if (gAgent.prefersAdult()) + { + // PG,Mature,Adult + maturity = "gma"; + } + else if (gAgent.prefersMature()) + { + // PG,Mature + maturity = "gm"; + } + subs["MATURITY"] = maturity; + url = LLWeb::expandURLSubstitutions(url, subs); + mWebBrowser->navigateTo(url, HTTP_CONTENT_TEXT_HTML); +} + +// static +void LLPanelDirWeb::onClickHome( void* data ) +{ + LLPanelDirWeb* self = (LLPanelDirWeb*)data; + if (!self) + return; + self->navigateToDefaultPage(); +} + +void LLPanelDirWeb::handleMediaEvent(LLPluginClassMedia* self, EMediaEvent event) +{ + if (event == MEDIA_EVENT_LOCATION_CHANGED) + { + const std::string url = self->getLocation(); + if (url.length()) + mStatusBarText->setText(url); + } + else if (event == MEDIA_EVENT_NAVIGATE_COMPLETE) + { + // we populate the status bar with URLs as they change so clear it now we're done + const std::string end_str = ""; + mStatusBarText->setText(end_str); + } + else if (event == MEDIA_EVENT_STATUS_TEXT_CHANGED) + { + const std::string text = self->getStatusText(); + if (text.length()) + mStatusBarText->setText(text); + } + else if (event == MEDIA_EVENT_LINK_HOVERED) + { + const std::string link = self->getHoverLink(); + mStatusBarText->setText(link); + } +} diff --git a/indra/newview/llpaneldirweb.h b/indra/newview/llpaneldirweb.h new file mode 100644 index 00000000000..db7bdc4a6a7 --- /dev/null +++ b/indra/newview/llpaneldirweb.h @@ -0,0 +1,63 @@ +/** + * @file llpaneldirweb.h + * @brief Web panel in the legacy Search directory. + * + * $LicenseInfo:firstyear=2025&license=viewerlgpl$ + * Second Life Viewer Source Code + * Copyright (C) 2025, Linden Research, Inc. + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; + * version 2.1 of the License only. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA + * + * Linden Research, Inc., 945 Battery Street, San Francisco, CA 94111 USA + * $/LicenseInfo$ + */ + +#ifndef LL_LLPANELDIRWEB_H +#define LL_LLPANELDIRWEB_H + +#include "llpanel.h" +#include "llmediactrl.h" + +class LLTextBox; +class LLFloaterDirectory; +class LLWebBrowserCtrlObserver; + +class LLPanelDirWeb : public LLPanel, public LLViewerMediaObserver +{ +public: + LLPanelDirWeb(); + ~LLPanelDirWeb(); + + bool postBuild() override; + void onVisibilityChange(bool new_visibility) override; + void draw() override; + + void handleMediaEvent(LLPluginClassMedia* self, EMediaEvent event) override; + + void navigateToDefaultPage(); + + void setFloaterDirectory(LLFloaterDirectory* floater) { mFloaterDirectory = floater; } + +protected: + static void onClickHome( void* data ); + + LLButton* mBtnBack; + LLButton* mBtnForward; + LLTextBox* mStatusBarText; + LLFloaterDirectory* mFloaterDirectory; + LLMediaCtrl* mWebBrowser; +}; + +#endif diff --git a/indra/newview/llpaneleditsky.cpp b/indra/newview/llpaneleditsky.cpp index 3d376251ff5..578206a7681 100644 --- a/indra/newview/llpaneleditsky.cpp +++ b/indra/newview/llpaneleditsky.cpp @@ -35,7 +35,6 @@ #include "llvirtualtrackball.h" #include "llsettingssky.h" #include "llenvironment.h" -#include "llatmosphere.h" #include "llviewercontrol.h" namespace @@ -926,13 +925,6 @@ void LLPanelSettingsSkyDensityTab::updateProfile() mSkySettings->setAbsorptionConfigs(absorption_config); mSkySettings->update(); setIsDirty(); - - if (gAtmosphere) - { - AtmosphericModelSettings atmospheric_settings; - LLEnvironment::getAtmosphericModelSettings(atmospheric_settings, mSkySettings); - gAtmosphere->configureAtmosphericModel(atmospheric_settings); - } } void LLPanelSettingsSkyDensityTab::onRayleighExponentialChanged() diff --git a/indra/newview/llpaneleditwearable.cpp b/indra/newview/llpaneleditwearable.cpp index 282b6d4a0aa..8bcb6e9ec37 100644 --- a/indra/newview/llpaneleditwearable.cpp +++ b/indra/newview/llpaneleditwearable.cpp @@ -438,7 +438,7 @@ template const LLEditWearableDictionary::PickerControlEntry* get_picker_entry (const ETextureIndex index) { return NULL; } -typedef boost::function function_t; +typedef std::function function_t; typedef struct PickerControlEntryNamePredicate { diff --git a/indra/newview/llpaneleventinfo.cpp b/indra/newview/llpaneleventinfo.cpp new file mode 100644 index 00000000000..43b20b38510 --- /dev/null +++ b/indra/newview/llpaneleventinfo.cpp @@ -0,0 +1,195 @@ +/** + * @file llpaneleventinfo.cpp + * @brief Info panel for events in the legacy Search + * + * $LicenseInfo:firstyear=2025&license=viewerlgpl$ + * Second Life Viewer Source Code + * Copyright (C) 2025, Linden Research, Inc. + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; + * version 2.1 of the License only. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA + * + * Linden Research, Inc., 945 Battery Street, San Francisco, CA 94111 USA + * $/LicenseInfo$ + */ + +#include "llviewerprecompiledheaders.h" + +#include "llpaneleventinfo.h" + +#include "llagent.h" +#include "llbutton.h" +#include "lleventflags.h" +#include "llfloaterreg.h" +#include "llfloaterworldmap.h" +#include "lltextbox.h" +#include "llviewertexteditor.h" +#include "llworldmap.h" + +static LLPanelInjector t_panel_event_info("panel_event_info"); + +LLPanelEventInfo::LLPanelEventInfo() + : LLPanel() +{ +} + +LLPanelEventInfo::~LLPanelEventInfo() +{ + if (mEventInfoConnection.connected()) + { + mEventInfoConnection.disconnect(); + } +} + +bool LLPanelEventInfo::postBuild() +{ + mTBName = getChild("event_name"); + + mTBCategory = getChild("event_category"); + mTBDate = getChild("event_date"); + mTBDuration = getChild("event_duration"); + mTBDesc = getChild("event_desc"); + mTBDesc->setWordWrap(true); + + mTBRunBy = getChild("event_runby"); + mTBLocation = getChild("event_location"); + mTBCover = getChild("event_cover"); + + mTeleportBtn = getChild( "teleport_btn"); + mTeleportBtn->setClickedCallback(boost::bind(&LLPanelEventInfo::onClickTeleport, this)); + + mMapBtn = getChild( "map_btn"); + mMapBtn->setClickedCallback(boost::bind(&LLPanelEventInfo::onClickMap, this)); + + mNotifyBtn = getChild( "notify_btn"); + mNotifyBtn->setClickedCallback(boost::bind(&LLPanelEventInfo::onClickNotify, this)); + + mEventInfoConnection = gEventNotifier.setEventInfoCallback(boost::bind(&LLPanelEventInfo::processEventInfoReply, this, _1)); + + return true; +} + +void LLPanelEventInfo::setEventID(const U32 event_id) +{ + mEventID = event_id; + + if (event_id != 0) + { + sendEventInfoRequest(); + } +} + +void LLPanelEventInfo::sendEventInfoRequest() +{ + LLMessageSystem *msg = gMessageSystem; + + msg->newMessageFast(_PREHASH_EventInfoRequest); + msg->nextBlockFast(_PREHASH_AgentData); + msg->addUUIDFast(_PREHASH_AgentID, gAgent.getID() ); + msg->addUUIDFast(_PREHASH_SessionID, gAgent.getSessionID() ); + msg->nextBlockFast(_PREHASH_EventData); + msg->addU32Fast(_PREHASH_EventID, mEventID); + gAgent.sendReliableMessage(); +} + +bool LLPanelEventInfo::processEventInfoReply(LLEventInfo event) +{ + if (event.mID != getEventID()) + return false; + + mTBName->setText(event.mName); + mTBName->setToolTip(event.mName); + mTBCategory->setText(event.mCategoryStr); + mTBDate->setText(event.mTimeStr); + mTBDesc->setText(event.mDesc); + mTBRunBy->setText(LLSLURL("agent", event.mRunByID, "inspect").getSLURLString()); + + mTBDuration->setText(llformat("%d:%.2d", event.mDuration / 60, event.mDuration % 60)); + + if (!event.mHasCover) + { + mTBCover->setText(getString("none")); + } + else + { + mTBCover->setText(llformat("%d", event.mCover)); + } + + mTBLocation->setText(LLSLURL(event.mSimName, event.mPosGlobal).getSLURLString()); + + if (event.mEventFlags & EVENT_FLAG_MATURE) + { + childSetVisible("event_mature_yes", true); + childSetVisible("event_mature_no", false); + } + else + { + childSetVisible("event_mature_yes", false); + childSetVisible("event_mature_no", true); + } + + if (event.mUnixTime < time_corrected()) + { + mNotifyBtn->setEnabled(false); + } + else + { + mNotifyBtn->setEnabled(true); + } + + if (gEventNotifier.hasNotification(event.mID)) + { + mNotifyBtn->setLabel(getString("dont_notify")); + } + else + { + mNotifyBtn->setLabel(getString("notify")); + } + mEventInfo = event; + return true; +} + +void LLPanelEventInfo::onClickTeleport() +{ + LLFloaterWorldMap* world_map = LLFloaterWorldMap::getInstance(); + if (world_map) + { + world_map->trackLocation(mEventInfo.mPosGlobal); + gAgent.teleportViaLocation(mEventInfo.mPosGlobal); + } +} + +void LLPanelEventInfo::onClickMap() +{ + LLFloaterWorldMap* world_map = LLFloaterWorldMap::getInstance(); + if (world_map) + { + world_map->trackLocation(mEventInfo.mPosGlobal); + LLFloaterReg::showInstance("world_map", "center"); + } +} + +void LLPanelEventInfo::onClickNotify() +{ + if (!gEventNotifier.hasNotification(mEventID)) + { + gEventNotifier.add(mEventInfo.mID, mEventInfo.mUnixTime, mEventInfo.mTimeStr, mEventInfo.mName); + mNotifyBtn->setLabel(getString("dont_notify")); + } + else + { + gEventNotifier.remove(mEventInfo.mID); + mNotifyBtn->setLabel(getString("notify")); + } +} diff --git a/indra/newview/llpaneleventinfo.h b/indra/newview/llpaneleventinfo.h new file mode 100644 index 00000000000..4f0e547493d --- /dev/null +++ b/indra/newview/llpaneleventinfo.h @@ -0,0 +1,76 @@ +/** + * @file llpaneleventinfo.h + * @brief Info panel for events in the legacy Search + * + * $LicenseInfo:firstyear=2025&license=viewerlgpl$ + * Second Life Viewer Source Code + * Copyright (C) 2025, Linden Research, Inc. + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; + * version 2.1 of the License only. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA + * + * Linden Research, Inc., 945 Battery Street, San Francisco, CA 94111 USA + * $/LicenseInfo$ + */ + +#ifndef LL_LLPANELEVENTINFO_H +#define LL_LLPANELEVENTINFO_H + +#include "lleventnotifier.h" + +class LLTextBox; +class LLTextEditor; +class LLButton; + +class LLPanelEventInfo : public LLPanel +{ +public: + LLPanelEventInfo(); + /*virtual*/ ~LLPanelEventInfo(); + + /*virtual*/ bool postBuild() override; + + void setEventID(const U32 event_id); + void sendEventInfoRequest(); + + bool processEventInfoReply(LLEventInfo event); + + U32 getEventID() { return mEventID; } + +protected: + void onClickTeleport(); + void onClickMap(); + void onClickNotify(); + +protected: + LLTextBox* mTBName; + LLTextBox* mTBCategory; + LLTextBox* mTBDate; + LLTextBox* mTBDuration; + LLTextEditor* mTBDesc; + + LLTextBox* mTBRunBy; + LLTextBox* mTBLocation; + LLTextBox* mTBCover; + + LLButton* mTeleportBtn; + LLButton* mMapBtn; + LLButton* mNotifyBtn; + + U32 mEventID; + LLEventInfo mEventInfo; + boost::signals2::connection mEventInfoConnection; +}; + +#endif // LL_LLPANELEVENTINFO_H diff --git a/indra/newview/llpanelexperiencelisteditor.h b/indra/newview/llpanelexperiencelisteditor.h index 7ff1ddac5a0..70bc2ecd3cb 100644 --- a/indra/newview/llpanelexperiencelisteditor.h +++ b/indra/newview/llpanelexperiencelisteditor.h @@ -42,7 +42,7 @@ class LLPanelExperienceListEditor : public LLPanel typedef boost::signals2::signal list_changed_signal_t; // filter function for experiences, return true if the experience should be hidden. - typedef boost::function experience_function; + typedef std::function experience_function; typedef std::vector filter_list; typedef LLHandle PickerHandle; LLPanelExperienceListEditor(); diff --git a/indra/newview/llpanelexperiencepicker.h b/indra/newview/llpanelexperiencepicker.h index 72c0b1b74de..5cde0a03fba 100644 --- a/indra/newview/llpanelexperiencepicker.h +++ b/indra/newview/llpanelexperiencepicker.h @@ -39,9 +39,9 @@ class LLPanelExperiencePicker : public LLPanel friend class LLExperienceSearchResponder; friend class LLFloaterExperiencePicker; - typedef boost::function select_callback_t; + typedef std::function select_callback_t; // filter function for experiences, return true if the experience should be hidden. - typedef boost::function filter_function; + typedef std::function filter_function; typedef std::vector filter_list; LLPanelExperiencePicker(); diff --git a/indra/newview/llpanelface.cpp b/indra/newview/llpanelface.cpp index 182b6489147..de8ab95deea 100644 --- a/indra/newview/llpanelface.cpp +++ b/indra/newview/llpanelface.cpp @@ -1166,26 +1166,22 @@ void LLPanelFace::updateUI(bool force_set_values /*false*/) bool missing_asset = false; { LLGLenum image_format = GL_RGB; + bool has_alpha = false; bool identical_image_format = false; - LLSelectedTE::getImageFormat(image_format, identical_image_format, missing_asset); + LLSelectedTE::getImageFormat(image_format, has_alpha, identical_image_format, missing_asset); if (!missing_asset) { - mIsAlpha = false; + mIsAlpha = has_alpha; switch (image_format) { case GL_RGBA: case GL_ALPHA: - { - mIsAlpha = true; - } - break; - case GL_RGB: break; default: { - LL_WARNS() << "Unexpected tex format in LLPanelFace...resorting to no alpha" << LL_ENDL; + LL_WARNS() << "Unexpected tex format in LLPanelFace..." << LL_ENDL; } break; } @@ -3292,23 +3288,22 @@ void LLPanelFace::onSelectTexture() sendTexture(); LLGLenum image_format; + bool has_alpha; bool identical_image_format = false; bool missing_asset = false; - LLSelectedTE::getImageFormat(image_format, identical_image_format, missing_asset); + LLSelectedTE::getImageFormat(image_format, has_alpha, identical_image_format, missing_asset); - U32 alpha_mode = LLMaterial::DIFFUSE_ALPHA_MODE_NONE; if (!missing_asset) { + U32 alpha_mode = has_alpha ? LLMaterial::DIFFUSE_ALPHA_MODE_BLEND : LLMaterial::DIFFUSE_ALPHA_MODE_NONE; switch (image_format) { case GL_RGBA: case GL_ALPHA: - alpha_mode = LLMaterial::DIFFUSE_ALPHA_MODE_BLEND; - break; case GL_RGB: break; default: - LL_WARNS() << "Unexpected tex format in LLPanelFace...resorting to no alpha" << LL_ENDL; + LL_WARNS() << "Unexpected tex format in LLPanelFace..." << LL_ENDL; break; } @@ -5258,12 +5253,13 @@ void LLPanelFace::LLSelectedTE::getFace(LLFace*& face_to_return, bool& identical identical_face = LLSelectMgr::getInstance()->getSelection()->getSelectedTEValue(&get_te_face_func, face_to_return, false, (LLFace*)nullptr); } -void LLPanelFace::LLSelectedTE::getImageFormat(LLGLenum& image_format_to_return, bool& identical_face, bool& missing_asset) +void LLPanelFace::LLSelectedTE::getImageFormat(LLGLenum& image_format_to_return, bool& has_alpha, bool& identical_face, bool& missing_asset) { struct LLSelectedTEGetmatId : public LLSelectedTEFunctor { LLSelectedTEGetmatId() : mImageFormat(GL_RGB) + , mHasAlpha(false) , mIdentical(true) , mMissingAsset(false) , mFirstRun(true) @@ -5278,6 +5274,10 @@ void LLPanelFace::LLSelectedTE::getImageFormat(LLGLenum& image_format_to_return, { format = image->getPrimaryFormat(); missing = image->isMissingAsset(); + if (format == GL_RGBA || format == GL_ALPHA) + { + mHasAlpha = true; + } } if (mFirstRun) @@ -5294,6 +5294,7 @@ void LLPanelFace::LLSelectedTE::getImageFormat(LLGLenum& image_format_to_return, return true; } LLGLenum mImageFormat; + bool mHasAlpha; bool mIdentical; bool mMissingAsset; bool mFirstRun; @@ -5301,6 +5302,7 @@ void LLPanelFace::LLSelectedTE::getImageFormat(LLGLenum& image_format_to_return, LLSelectMgr::getInstance()->getSelection()->applyToTEs(&func); image_format_to_return = func.mImageFormat; + has_alpha = func.mHasAlpha; identical_face = func.mIdentical; missing_asset = func.mMissingAsset; } diff --git a/indra/newview/llpanelface.h b/indra/newview/llpanelface.h index 8a8460204c3..63fee6bab8d 100644 --- a/indra/newview/llpanelface.h +++ b/indra/newview/llpanelface.h @@ -697,7 +697,7 @@ class LLPanelFace : public LLPanel { public: static void getFace(class LLFace*& face_to_return, bool& identical_face); - static void getImageFormat(LLGLenum& image_format_to_return, bool& identical_face, bool& missing_asset); + static void getImageFormat(LLGLenum& image_format_to_return, bool& has_alpha, bool& identical_face, bool& missing_asset); static void getTexId(LLUUID& id, bool& identical); static void getPbrMaterialId(LLUUID& id, bool& identical, bool& has_pbr, bool& has_faces_without_pbr); static void getObjectScaleS(F32& scale_s, bool& identical); diff --git a/indra/newview/llpanelgroup.cpp b/indra/newview/llpanelgroup.cpp index 65aa1876b07..ecb66f9cea4 100644 --- a/indra/newview/llpanelgroup.cpp +++ b/indra/newview/llpanelgroup.cpp @@ -231,6 +231,12 @@ void LLPanelGroup::onBackBtnClick() } } +void LLPanelGroup::hideBackBtn() +{ + childSetVisible("back", false); + setBackgroundVisible(false); +} + void LLPanelGroup::onBtnRefresh(void* user_data) { LLPanelGroup* self = static_cast(user_data); diff --git a/indra/newview/llpanelgroup.h b/indra/newview/llpanelgroup.h index fa0e1d4104b..b43a93bc400 100644 --- a/indra/newview/llpanelgroup.h +++ b/indra/newview/llpanelgroup.h @@ -87,6 +87,7 @@ class LLPanelGroup : public LLPanel, const std::string& inventory_name, LLOfferInfo* inventory_offer); + void hideBackBtn(); protected: virtual void update(LLGroupChange gc); diff --git a/indra/newview/llpanellogin.cpp b/indra/newview/llpanellogin.cpp index ed80c8b7320..fe9145bf712 100644 --- a/indra/newview/llpanellogin.cpp +++ b/indra/newview/llpanellogin.cpp @@ -183,7 +183,7 @@ LLPanelLogin::LLPanelLogin(const LLRect &rect, : LLPanel(), mCallback(callback), mCallbackData(cb_data), - mListener(new LLPanelLoginListener(this)), + mListener(std::make_unique(this)), mFirstLoginThisInstall(gSavedSettings.getBOOL("FirstLoginThisInstall")), mUsernameLength(0), mPasswordLength(0), diff --git a/indra/newview/llpanelmediasettingssecurity.cpp b/indra/newview/llpanelmediasettingssecurity.cpp index 6e4e9f426d1..68e2808a830 100644 --- a/indra/newview/llpanelmediasettingssecurity.cpp +++ b/indra/newview/llpanelmediasettingssecurity.cpp @@ -220,7 +220,7 @@ const std::string LLPanelMediaSettingsSecurity::makeValidUrl( const std::string& if ( candidate_url.scheme().empty() ) { // build a URL comprised of default scheme and the original fragment - const std::string default_scheme( "http://" ); + const std::string default_scheme( "https://" ); return default_scheme + src_url; }; diff --git a/indra/newview/llpaneloutfitedit.cpp b/indra/newview/llpaneloutfitedit.cpp index a9e860d2ef0..2ddc09736f2 100644 --- a/indra/newview/llpaneloutfitedit.cpp +++ b/indra/newview/llpaneloutfitedit.cpp @@ -1309,7 +1309,7 @@ void LLPanelOutfitEdit::showFilteredWearablesListView(LLWearableType::EType type showWearablesListView(); //e_list_view_item_type implicitly contains LLWearableType::EType starting from LVIT_SHAPE - applyListViewFilter(static_cast(LVIT_SHAPE + type)); + applyListViewFilter(static_cast(static_cast(LVIT_SHAPE) + static_cast(type))); mWearableItemsList->setMenuWearableType(type); } diff --git a/indra/newview/llpanelpeople.cpp b/indra/newview/llpanelpeople.cpp index 33599357a3e..64e0a8c429c 100644 --- a/indra/newview/llpanelpeople.cpp +++ b/indra/newview/llpanelpeople.cpp @@ -251,7 +251,7 @@ static LLPanelInjector t_people("panel_people"); class LLPanelPeople::Updater { public: - typedef boost::function callback_t; + typedef std::function callback_t; Updater(callback_t cb) : mCallback(cb) { diff --git a/indra/newview/llpanelplaces.cpp b/indra/newview/llpanelplaces.cpp index 7deb1d9fd42..5435a79e16e 100644 --- a/indra/newview/llpanelplaces.cpp +++ b/indra/newview/llpanelplaces.cpp @@ -651,7 +651,7 @@ void LLPanelPlaces::onFilterEdit(const std::string& search_string, bool force_fi void LLPanelPlaces::onTabSelected() { mActivePanel = dynamic_cast(mTabContainer->getCurrentPanel()); - if (!mActivePanel) + if (!mActivePanel || !mTabsCreated) return; onFilterEdit(mActivePanel->getFilterSubString(), true); @@ -1335,6 +1335,13 @@ LLPanelPlaceInfo* LLPanelPlaces::getCurrentInfoPanel() return NULL; } +void LLPanelPlaces::hideBackBtn() +{ + mPlaceProfileBackBtn->setVisible(false); + setBackgroundVisible(false); + mPlaceProfile->setBackgroundVisible(false); +} + static bool is_agent_in_selected_parcel(LLParcel* parcel) { LLViewerParcelMgr* parcel_mgr = LLViewerParcelMgr::getInstance(); diff --git a/indra/newview/llpanelplaces.h b/indra/newview/llpanelplaces.h index fc04d8d45db..8360380b22a 100644 --- a/indra/newview/llpanelplaces.h +++ b/indra/newview/llpanelplaces.h @@ -81,6 +81,8 @@ class LLPanelPlaces : public LLPanel /*virtual*/ S32 notifyParent(const LLSD& info); + void hideBackBtn(); + private: void onLandmarkLoaded(LLLandmark* landmark); void onFilterEdit(const std::string& search_string, bool force_filter); diff --git a/indra/newview/llpanelprofile.cpp b/indra/newview/llpanelprofile.cpp index 6ea9cd2b92f..34d2d4d6a51 100644 --- a/indra/newview/llpanelprofile.cpp +++ b/indra/newview/llpanelprofile.cpp @@ -106,11 +106,11 @@ LLUUID post_profile_image(std::string cap_url, const LLSD &first_data, std::stri { LLCore::HttpRequest::policy_t httpPolicy(LLCore::HttpRequest::DEFAULT_POLICY_ID); LLCoreHttpUtil::HttpCoroutineAdapter::ptr_t - httpAdapter(new LLCoreHttpUtil::HttpCoroutineAdapter("post_profile_image_coro", httpPolicy)); - LLCore::HttpRequest::ptr_t httpRequest(new LLCore::HttpRequest); + httpAdapter = std::make_shared("post_profile_image_coro", httpPolicy); + LLCore::HttpRequest::ptr_t httpRequest = std::make_shared(); LLCore::HttpHeaders::ptr_t httpHeaders; - LLCore::HttpOptions::ptr_t httpOpts(new LLCore::HttpOptions); + LLCore::HttpOptions::ptr_t httpOpts = std::make_shared(); httpOpts->setFollowRedirects(true); LLSD result = httpAdapter->postAndSuspend(httpRequest, cap_url, first_data, httpOpts, httpHeaders); @@ -138,9 +138,9 @@ LLUUID post_profile_image(std::string cap_url, const LLSD &first_data, std::stri } // Upload the image - LLCore::HttpRequest::ptr_t uploaderhttpRequest(new LLCore::HttpRequest); - LLCore::HttpHeaders::ptr_t uploaderhttpHeaders(new LLCore::HttpHeaders); - LLCore::HttpOptions::ptr_t uploaderhttpOpts(new LLCore::HttpOptions); + LLCore::HttpRequest::ptr_t uploaderhttpRequest = std::make_shared(); + LLCore::HttpHeaders::ptr_t uploaderhttpHeaders = std::make_shared(); + LLCore::HttpOptions::ptr_t uploaderhttpOpts = std::make_shared(); S64 length; { @@ -693,6 +693,7 @@ LLPanelProfileSecondLife::LLPanelProfileSecondLife() , mWaitingForImageUpload(false) , mAllowPublish(false) , mHideAge(false) + , mAllowEdit(true) { } @@ -709,6 +710,10 @@ LLPanelProfileSecondLife::~LLPanelProfileSecondLife() { mAvatarNameCacheConnection.disconnect(); } + if (mMenuNameCacheConnection.connected()) + { + mMenuNameCacheConnection.disconnect(); + } } bool LLPanelProfileSecondLife::postBuild() @@ -757,14 +762,15 @@ void LLPanelProfileSecondLife::onOpen(const LLSD& key) LLUUID avatar_id = getAvatarId(); bool own_profile = getSelfProfile(); + bool allow_edit = own_profile && mAllowEdit; mGroupList->setShowNone(!own_profile); - childSetVisible("notes_panel", !own_profile); - childSetVisible("settings_panel", own_profile); - childSetVisible("about_buttons_panel", own_profile); + childSetVisible("notes_panel", !allow_edit); + childSetVisible("settings_panel", allow_edit); + childSetVisible("about_buttons_panel", allow_edit); - if (own_profile) + if (allow_edit) { // Group list control cannot toggle ForAgent loading // Less than ideal, but viewing own profile via search is edge case @@ -789,7 +795,7 @@ void LLPanelProfileSecondLife::onOpen(const LLSD& key) mAgentActionMenuButton->setMenu("menu_profile_other.xml", LLMenuButton::MP_BOTTOM_RIGHT); } - mDescriptionEdit->setParseHTML(!own_profile); + mDescriptionEdit->setParseHTML(!allow_edit); if (!own_profile) { @@ -1022,7 +1028,7 @@ void LLPanelProfileSecondLife::fillCommonData(const LLAvatarData* avatar_data) if (getSelfProfile()) { mAllowPublish = avatar_data->flags & AVATAR_ALLOW_PUBLISH; - mShowInSearchCombo->setValue(mAllowPublish); + mShowInSearchCombo->setValue(mAllowPublish ? LLSD::Integer(1) : LLSD::Integer(0)); } } @@ -1280,7 +1286,7 @@ void LLPanelProfileSecondLife::setLoaded() { mHideAgeCombo->setEnabled(true); } - mDescriptionEdit->setEnabled(true); + mDescriptionEdit->setEnabled(mAllowEdit); } } @@ -1456,7 +1462,7 @@ void LLPanelProfileSecondLife::onCommitMenu(const LLSD& userdata) } else if (item_name == "edit_display_name") { - LLAvatarNameCache::get(getAvatarId(), boost::bind(&LLPanelProfileSecondLife::onAvatarNameCacheSetName, this, _1, _2)); + mMenuNameCacheConnection = LLAvatarNameCache::get(getAvatarId(), boost::bind(&LLPanelProfileSecondLife::onAvatarNameCacheSetName, this, _1, _2)); LLFirstUse::setDisplayName(false); } else if (item_name == "edit_partner") diff --git a/indra/newview/llpanelprofile.h b/indra/newview/llpanelprofile.h index c207a4162a3..c993ec547ae 100644 --- a/indra/newview/llpanelprofile.h +++ b/indra/newview/llpanelprofile.h @@ -111,6 +111,8 @@ class LLPanelProfileSecondLife void processProperties(void* data, EAvatarProcessorType type) override; + void setAllowEdit(bool allow_edit) { mAllowEdit = allow_edit; } + protected: /** * Process profile related data received from server. @@ -207,8 +209,10 @@ class LLPanelProfileSecondLife bool mWaitingForImageUpload; bool mAllowPublish; bool mHideAge; + bool mAllowEdit; std::string mDescriptionText; boost::signals2::connection mAvatarNameCacheConnection; + boost::signals2::connection mMenuNameCacheConnection; }; diff --git a/indra/newview/llpanelwearing.cpp b/indra/newview/llpanelwearing.cpp index 3aedde74c69..4fcce50df14 100644 --- a/indra/newview/llpanelwearing.cpp +++ b/indra/newview/llpanelwearing.cpp @@ -466,8 +466,8 @@ void LLPanelWearing::getAttachmentLimitsCoro(std::string url) { LLCore::HttpRequest::policy_t httpPolicy(LLCore::HttpRequest::DEFAULT_POLICY_ID); LLCoreHttpUtil::HttpCoroutineAdapter::ptr_t - httpAdapter(new LLCoreHttpUtil::HttpCoroutineAdapter("getAttachmentLimitsCoro", httpPolicy)); - LLCore::HttpRequest::ptr_t httpRequest(new LLCore::HttpRequest); + httpAdapter = std::make_shared("getAttachmentLimitsCoro", httpPolicy); + LLCore::HttpRequest::ptr_t httpRequest = std::make_shared(); LLSD result = httpAdapter->getAndSuspend(httpRequest, url); diff --git a/indra/newview/llparticipantlist.cpp b/indra/newview/llparticipantlist.cpp index 9ef9c26411d..c6a88dbada4 100644 --- a/indra/newview/llparticipantlist.cpp +++ b/indra/newview/llparticipantlist.cpp @@ -41,7 +41,7 @@ LLParticipantList::LLParticipantList(LLSpeakerMgr* data_source, LLFolderViewModelInterface& root_view_model) : LLConversationItemSession(data_source->getSessionID(), root_view_model), mSpeakerMgr(data_source), - mValidateSpeakerCallback(NULL) + mValidateSpeakerCallback(nullptr) { mSpeakerAddListener = new SpeakerAddListener(*this); mSpeakerRemoveListener = new SpeakerRemoveListener(*this); diff --git a/indra/newview/llparticipantlist.h b/indra/newview/llparticipantlist.h index 7cb29a6211b..4b4334c6f97 100644 --- a/indra/newview/llparticipantlist.h +++ b/indra/newview/llparticipantlist.h @@ -27,8 +27,8 @@ #ifndef LL_PARTICIPANTLIST_H #define LL_PARTICIPANTLIST_H -#include "llviewerprecompiledheaders.h" #include "llconversationmodel.h" +#include "llevent.h" class LLSpeakerMgr; class LLUICtrl; @@ -38,7 +38,7 @@ class LLParticipantList : public LLConversationItemSession LOG_CLASS(LLParticipantList); public: - typedef boost::function validate_speaker_callback_t; + typedef std::function validate_speaker_callback_t; LLParticipantList(LLSpeakerMgr* data_source, LLFolderViewModelInterface& root_view_model); ~LLParticipantList(); diff --git a/indra/newview/llpathfindingcharacterlist.cpp b/indra/newview/llpathfindingcharacterlist.cpp index 1366ba6c6ff..8e03492381f 100644 --- a/indra/newview/llpathfindingcharacterlist.cpp +++ b/indra/newview/llpathfindingcharacterlist.cpp @@ -65,7 +65,7 @@ void LLPathfindingCharacterList::parseCharacterListData(const LLSD& pCharacterLi continue; const std::string& uuid(characterDataIter->first); const LLSD& characterData = characterDataIter->second; - LLPathfindingObjectPtr character(new LLPathfindingCharacter(uuid, characterData)); + LLPathfindingObjectPtr character = std::make_shared(uuid, characterData); objectMap.insert(std::pair(uuid, character)); } } diff --git a/indra/newview/llpathfindinglinksetlist.cpp b/indra/newview/llpathfindinglinksetlist.cpp index 2012d7a0946..81efb0a6fce 100644 --- a/indra/newview/llpathfindinglinksetlist.cpp +++ b/indra/newview/llpathfindinglinksetlist.cpp @@ -206,7 +206,7 @@ void LLPathfindingLinksetList::parseLinksetListData(const LLSD& pLinksetListData const LLSD& linksetData = linksetDataIter->second; if(linksetData.size() != 0) { - LLPathfindingObjectPtr linksetPtr(new LLPathfindingLinkset(uuid, linksetData)); + LLPathfindingObjectPtr linksetPtr = std::make_shared(uuid, linksetData); objectMap.insert(std::pair(uuid, linksetPtr)); } } diff --git a/indra/newview/llpathfindingmanager.cpp b/indra/newview/llpathfindingmanager.cpp index 84a62b3cbf0..412e25a7b1d 100644 --- a/indra/newview/llpathfindingmanager.cpp +++ b/indra/newview/llpathfindingmanager.cpp @@ -34,7 +34,6 @@ #include #include -#include #include #include "llagent.h" @@ -451,8 +450,8 @@ void LLPathfindingManager::navMeshStatusRequestCoro(std::string url, U64 regionH { LLCore::HttpRequest::policy_t httpPolicy(LLCore::HttpRequest::DEFAULT_POLICY_ID); LLCoreHttpUtil::HttpCoroutineAdapter::ptr_t - httpAdapter(new LLCoreHttpUtil::HttpCoroutineAdapter("NavMeshStatusRequest", httpPolicy)); - LLCore::HttpRequest::ptr_t httpRequest(new LLCore::HttpRequest); + httpAdapter = std::make_shared("NavMeshStatusRequest", httpPolicy); + LLCore::HttpRequest::ptr_t httpRequest = std::make_shared(); LLViewerRegion *region = LLWorld::getInstance()->getRegionFromHandle(regionHandle); if (!region) @@ -541,8 +540,8 @@ void LLPathfindingManager::navAgentStateRequestCoro(std::string url) { LLCore::HttpRequest::policy_t httpPolicy(LLCore::HttpRequest::DEFAULT_POLICY_ID); LLCoreHttpUtil::HttpCoroutineAdapter::ptr_t - httpAdapter(new LLCoreHttpUtil::HttpCoroutineAdapter("NavAgentStateRequest", httpPolicy)); - LLCore::HttpRequest::ptr_t httpRequest(new LLCore::HttpRequest); + httpAdapter = std::make_shared("NavAgentStateRequest", httpPolicy); + LLCore::HttpRequest::ptr_t httpRequest = std::make_shared(); LLSD result = httpAdapter->getAndSuspend(httpRequest, url); @@ -569,8 +568,8 @@ void LLPathfindingManager::navMeshRebakeCoro(std::string url, rebake_navmesh_cal { LLCore::HttpRequest::policy_t httpPolicy(LLCore::HttpRequest::DEFAULT_POLICY_ID); LLCoreHttpUtil::HttpCoroutineAdapter::ptr_t - httpAdapter(new LLCoreHttpUtil::HttpCoroutineAdapter("NavMeshRebake", httpPolicy)); - LLCore::HttpRequest::ptr_t httpRequest(new LLCore::HttpRequest); + httpAdapter = std::make_shared("NavMeshRebake", httpPolicy); + LLCore::HttpRequest::ptr_t httpRequest = std::make_shared(); LLSD postData = LLSD::emptyMap(); @@ -598,8 +597,8 @@ void LLPathfindingManager::linksetObjectsCoro(std::string url, LinksetsResponder { LLCore::HttpRequest::policy_t httpPolicy(LLCore::HttpRequest::DEFAULT_POLICY_ID); LLCoreHttpUtil::HttpCoroutineAdapter::ptr_t - httpAdapter(new LLCoreHttpUtil::HttpCoroutineAdapter("LinksetObjects", httpPolicy)); - LLCore::HttpRequest::ptr_t httpRequest(new LLCore::HttpRequest); + httpAdapter = std::make_shared("LinksetObjects", httpPolicy); + LLCore::HttpRequest::ptr_t httpRequest = std::make_shared(); LLSD result; @@ -634,8 +633,8 @@ void LLPathfindingManager::linksetTerrainCoro(std::string url, LinksetsResponder { LLCore::HttpRequest::policy_t httpPolicy(LLCore::HttpRequest::DEFAULT_POLICY_ID); LLCoreHttpUtil::HttpCoroutineAdapter::ptr_t - httpAdapter(new LLCoreHttpUtil::HttpCoroutineAdapter("LinksetTerrain", httpPolicy)); - LLCore::HttpRequest::ptr_t httpRequest(new LLCore::HttpRequest); + httpAdapter = std::make_shared("LinksetTerrain", httpPolicy); + LLCore::HttpRequest::ptr_t httpRequest = std::make_shared(); LLSD result; @@ -669,8 +668,8 @@ void LLPathfindingManager::charactersCoro(std::string url, request_id_t requestI { LLCore::HttpRequest::policy_t httpPolicy(LLCore::HttpRequest::DEFAULT_POLICY_ID); LLCoreHttpUtil::HttpCoroutineAdapter::ptr_t - httpAdapter(new LLCoreHttpUtil::HttpCoroutineAdapter("LinksetTerrain", httpPolicy)); - LLCore::HttpRequest::ptr_t httpRequest(new LLCore::HttpRequest); + httpAdapter = std::make_shared("charactersCoro", httpPolicy); + LLCore::HttpRequest::ptr_t httpRequest = std::make_shared(); LLSD result = httpAdapter->getAndSuspend(httpRequest, url); diff --git a/indra/newview/llpathfindingmanager.h b/indra/newview/llpathfindingmanager.h index 663cb3cf346..d2092664674 100644 --- a/indra/newview/llpathfindingmanager.h +++ b/indra/newview/llpathfindingmanager.h @@ -27,10 +27,10 @@ #ifndef LL_LLPATHFINDINGMANAGER_H #define LL_LLPATHFINDINGMANAGER_H +#include #include #include -#include #include #include "llpathfindinglinkset.h" @@ -76,21 +76,21 @@ class LLPathfindingManager : public LLSingleton void requestGetNavMeshForRegion(LLViewerRegion *pRegion, bool pIsGetStatusOnly); typedef U32 request_id_t; - typedef boost::function object_request_callback_t; + typedef std::function object_request_callback_t; void requestGetLinksets(request_id_t pRequestId, object_request_callback_t pLinksetsCallback) const; void requestSetLinksets(request_id_t pRequestId, const LLPathfindingObjectListPtr &pLinksetListPtr, LLPathfindingLinkset::ELinksetUse pLinksetUse, S32 pA, S32 pB, S32 pC, S32 pD, object_request_callback_t pLinksetsCallback) const; void requestGetCharacters(request_id_t pRequestId, object_request_callback_t pCharactersCallback) const; - typedef boost::function agent_state_callback_t; + typedef std::function agent_state_callback_t; typedef boost::signals2::signal agent_state_signal_t; typedef boost::signals2::connection agent_state_slot_t; agent_state_slot_t registerAgentStateListener(agent_state_callback_t pAgentStateCallback); void requestGetAgentState(); - typedef boost::function rebake_navmesh_callback_t; + typedef std::function rebake_navmesh_callback_t; void requestRebakeNavMesh(rebake_navmesh_callback_t pRebakeNavMeshCallback); protected: diff --git a/indra/newview/llpathfindingnavmesh.cpp b/indra/newview/llpathfindingnavmesh.cpp index c9fbeba2f3e..5bb33a65f27 100644 --- a/indra/newview/llpathfindingnavmesh.cpp +++ b/indra/newview/llpathfindingnavmesh.cpp @@ -139,7 +139,8 @@ void LLPathfindingNavMesh::handleNavMeshResult(const LLSD &pContent, U32 pNavMes ENavMeshRequestStatus status; if ( pContent.has(NAVMESH_DATA_FIELD) ) { - const LLSD::Binary &value = pContent.get(NAVMESH_DATA_FIELD).asBinary(); + LLSD nav_data = pContent.get(NAVMESH_DATA_FIELD); + const LLSD::Binary& value = nav_data.asBinary(); auto binSize = value.size(); std::string newStr(reinterpret_cast(&value[0]), binSize); std::istringstream streamdecomp( newStr ); diff --git a/indra/newview/llpathfindingnavmesh.h b/indra/newview/llpathfindingnavmesh.h index d838a1a51c0..44397c9118b 100644 --- a/indra/newview/llpathfindingnavmesh.h +++ b/indra/newview/llpathfindingnavmesh.h @@ -27,9 +27,9 @@ #ifndef LL_LLPATHFINDINGNAVMESH_H #define LL_LLPATHFINDINGNAVMESH_H +#include #include -#include #include #include "llpathfindingnavmeshstatus.h" @@ -54,7 +54,7 @@ class LLPathfindingNavMesh kNavMeshRequestError } ENavMeshRequestStatus; - typedef boost::function navmesh_callback_t; + typedef std::function navmesh_callback_t; typedef boost::signals2::signal navmesh_signal_t; typedef boost::signals2::connection navmesh_slot_t; diff --git a/indra/newview/llpathfindingnavmeshzone.h b/indra/newview/llpathfindingnavmeshzone.h index e770efa0d00..8f7750d4c56 100644 --- a/indra/newview/llpathfindingnavmeshzone.h +++ b/indra/newview/llpathfindingnavmeshzone.h @@ -27,9 +27,9 @@ #ifndef LL_LLPATHFINDINGNAVMESHZONE_H #define LL_LLPATHFINDINGNAVMESHZONE_H +#include #include -#include #include #include "llpathfindingnavmesh.h" @@ -62,7 +62,7 @@ class LLPathfindingNavMeshZone kNavMeshZoneComplete } ENavMeshZoneStatus; - typedef boost::function navmesh_zone_callback_t; + typedef std::function navmesh_zone_callback_t; typedef boost::signals2::signal navmesh_zone_signal_t; typedef boost::signals2::connection navmesh_zone_slot_t; @@ -81,7 +81,7 @@ class LLPathfindingNavMeshZone protected: private: - typedef boost::function navmesh_location_callback_t; + typedef std::function navmesh_location_callback_t; class NavMeshLocation { public: diff --git a/indra/newview/llpathfindingobject.h b/indra/newview/llpathfindingobject.h index 79a796dd602..bf27f114f5c 100644 --- a/indra/newview/llpathfindingobject.h +++ b/indra/newview/llpathfindingobject.h @@ -27,9 +27,9 @@ #ifndef LL_LLPATHFINDINGOBJECT_H #define LL_LLPATHFINDINGOBJECT_H +#include #include -#include #include #include "llavatarname.h" @@ -61,7 +61,7 @@ class LLPathfindingObject inline bool isGroupOwned() const {return mIsGroupOwned;}; inline const LLVector3& getLocation() const {return mLocation;}; - typedef boost::function name_callback_t; + typedef std::function name_callback_t; typedef boost::signals2::signal name_signal_t; typedef boost::signals2::connection name_connection_t; diff --git a/indra/newview/llpathfindingpathtool.cpp b/indra/newview/llpathfindingpathtool.cpp index 61791492e76..57f4aefadf9 100644 --- a/indra/newview/llpathfindingpathtool.cpp +++ b/indra/newview/llpathfindingpathtool.cpp @@ -30,7 +30,6 @@ #include "llpathfindingpathtool.h" -#include #include #include "llagent.h" diff --git a/indra/newview/llpathfindingpathtool.h b/indra/newview/llpathfindingpathtool.h index 189b9d49541..f6b4500f0fa 100644 --- a/indra/newview/llpathfindingpathtool.h +++ b/indra/newview/llpathfindingpathtool.h @@ -27,7 +27,7 @@ #ifndef LL_LLPATHFINDINGPATHTOOL_H #define LL_LLPATHFINDINGPATHTOOL_H -#include +#include #include #include "llpathinglib.h" @@ -62,7 +62,7 @@ class LLPathfindingPathTool : public LLTool, public LLSingleton path_event_callback_t; + typedef std::function path_event_callback_t; typedef boost::signals2::signal path_event_signal_t; typedef boost::signals2::connection path_event_slot_t; diff --git a/indra/newview/llpbrterrainfeatures.cpp b/indra/newview/llpbrterrainfeatures.cpp index bb771c6963a..d652e23dd5d 100644 --- a/indra/newview/llpbrterrainfeatures.cpp +++ b/indra/newview/llpbrterrainfeatures.cpp @@ -86,9 +86,9 @@ void LLPBRTerrainFeatures::queryRegionCoro(std::string cap_url, LLUUID region_id { LLCore::HttpRequest::policy_t httpPolicy(LLCore::HttpRequest::DEFAULT_POLICY_ID); LLCoreHttpUtil::HttpCoroutineAdapter::ptr_t - httpAdapter(new LLCoreHttpUtil::HttpCoroutineAdapter("queryRegionCoro", httpPolicy)); - LLCore::HttpRequest::ptr_t httpRequest(new LLCore::HttpRequest); - LLCore::HttpOptions::ptr_t httpOpts(new LLCore::HttpOptions); + httpAdapter = std::make_shared("queryRegionCoro", httpPolicy); + LLCore::HttpRequest::ptr_t httpRequest = std::make_shared(); + LLCore::HttpOptions::ptr_t httpOpts = std::make_shared(); LLCore::HttpHeaders::ptr_t httpHeaders; httpOpts->setFollowRedirects(true); @@ -159,9 +159,9 @@ void LLPBRTerrainFeatures::modifyRegionCoro(std::string cap_url, LLSD updates, v { LLCore::HttpRequest::policy_t httpPolicy(LLCore::HttpRequest::DEFAULT_POLICY_ID); LLCoreHttpUtil::HttpCoroutineAdapter::ptr_t - httpAdapter(new LLCoreHttpUtil::HttpCoroutineAdapter("modifyRegionCoro", httpPolicy)); - LLCore::HttpRequest::ptr_t httpRequest(new LLCore::HttpRequest); - LLCore::HttpOptions::ptr_t httpOpts(new LLCore::HttpOptions); + httpAdapter = std::make_shared("modifyRegionCoro", httpPolicy); + LLCore::HttpRequest::ptr_t httpRequest = std::make_shared(); + LLCore::HttpOptions::ptr_t httpOpts = std::make_shared(); LLCore::HttpHeaders::ptr_t httpHeaders; httpOpts->setFollowRedirects(true); diff --git a/indra/newview/llpersistentnotificationstorage.cpp b/indra/newview/llpersistentnotificationstorage.cpp index e06d025f592..1cc311e1b57 100644 --- a/indra/newview/llpersistentnotificationstorage.cpp +++ b/indra/newview/llpersistentnotificationstorage.cpp @@ -141,7 +141,7 @@ void LLPersistentNotificationStorage::loadNotifications() ++notification_it) { LLSD notification_params = *notification_it; - LLNotificationPtr notification(new LLNotification(notification_params)); + LLNotificationPtr notification = std::make_shared(notification_params); LLNotificationResponderPtr responder(createResponder(notification_params["name"], notification_params["responder"])); notification->setResponseFunctor(responder); diff --git a/indra/newview/llpopupview.cpp b/indra/newview/llpopupview.cpp index cc55b3c8db2..16149b7e33c 100644 --- a/indra/newview/llpopupview.cpp +++ b/indra/newview/llpopupview.cpp @@ -94,8 +94,8 @@ void LLPopupView::draw() LLPanel::draw(); } -bool LLPopupView::handleMouseEvent(boost::function func, - boost::function predicate, +bool LLPopupView::handleMouseEvent(std::function func, + std::function predicate, S32 x, S32 y, bool close_popups) { diff --git a/indra/newview/llpopupview.h b/indra/newview/llpopupview.h index 4a888661850..8c0db623acc 100644 --- a/indra/newview/llpopupview.h +++ b/indra/newview/llpopupview.h @@ -55,7 +55,7 @@ class LLPopupView : public LLPanel popup_list_t getCurrentPopups() { return mPopups; } private: - bool handleMouseEvent(boost::function, boost::function, S32 x, S32 y, bool close_popups); + bool handleMouseEvent(std::function, std::function, S32 x, S32 y, bool close_popups); popup_list_t mPopups; }; #endif //LL_LLROOTVIEW_H diff --git a/indra/newview/llpostcard.h b/indra/newview/llpostcard.h index cfe6f3951d0..11178aa0273 100644 --- a/indra/newview/llpostcard.h +++ b/indra/newview/llpostcard.h @@ -40,7 +40,7 @@ class LLPostCard LOG_CLASS(LLPostCard); public: - typedef boost::function result_callback_t; + typedef std::function result_callback_t; static void setPostResultCallback(result_callback_t cb) { mResultCallback = cb; } static void reportPostResult(bool ok); diff --git a/indra/newview/llpresetsmanager.cpp b/indra/newview/llpresetsmanager.cpp index afd58af0563..84455bb6798 100644 --- a/indra/newview/llpresetsmanager.cpp +++ b/indra/newview/llpresetsmanager.cpp @@ -26,8 +26,6 @@ #include "llviewerprecompiledheaders.h" -#include - #include "llpresetsmanager.h" #include "lldiriterator.h" @@ -250,17 +248,17 @@ void LLPresetsManager::settingChanged() void LLPresetsManager::getControlNames(std::vector& names) { - const std::vector camera_controls = boost::assign::list_of + const std::vector camera_controls = { // From panel_preferences_move.xml - ("CameraAngle") - ("CameraOffsetScale") + "CameraAngle", + "CameraOffsetScale", // From llagentcamera.cpp - ("CameraOffsetBuild") - ("TrackFocusObject") - ("CameraOffsetRearView") - ("FocusOffsetRearView") - ("AvatarSitRotation") - ; + "CameraOffsetBuild", + "TrackFocusObject", + "CameraOffsetRearView", + "FocusOffsetRearView", + "AvatarSitRotation", + }; names = camera_controls; } diff --git a/indra/newview/llpreviewscript.cpp b/indra/newview/llpreviewscript.cpp index c2aa4925bd8..b3e53df6d88 100644 --- a/indra/newview/llpreviewscript.cpp +++ b/indra/newview/llpreviewscript.cpp @@ -53,6 +53,7 @@ #include "llslider.h" #include "lltooldraganddrop.h" #include "llfilesystem.h" +#include "lllogchat.h" #include "llagent.h" #include "llmenugl.h" @@ -64,22 +65,12 @@ #include "llviewerobject.h" #include "llviewerobjectlist.h" #include "llviewerregion.h" -#include "llkeyboard.h" -#include "llscrollcontainer.h" -#include "llcheckboxctrl.h" #include "llscripteditor.h" -#include "llselectmgr.h" -#include "lltooldraganddrop.h" -#include "llscrolllistctrl.h" #include "lltextbox.h" -#include "llslider.h" -#include "lldir.h" -#include "llcombobox.h" #include "llviewerstats.h" #include "llviewerwindow.h" #include "lluictrlfactory.h" #include "llmediactrl.h" -#include "lluictrlfactory.h" #include "lltrans.h" #include "llviewercontrol.h" #include "llappviewer.h" @@ -90,20 +81,10 @@ #include "lltoggleablemenu.h" #include "llmenubutton.h" #include "llinventoryfunctions.h" +#include "llwebsocketmgr.h" +#include "llscripteditorws.h" +#include -const std::string HELLO_LSL = - "default\n" - "{\n" - " state_entry()\n" - " {\n" - " llSay(0, \"Hello, Avatar!\");\n" - " }\n" - "\n" - " touch_start(integer total_number)\n" - " {\n" - " llSay(0, \"Touched.\");\n" - " }\n" - "}\n"; const std::string HELP_LSL_PORTAL_TOPIC = "LSL_Portal"; const std::string DEFAULT_SCRIPT_NAME = "New Script"; // *TODO:Translate? @@ -119,6 +100,42 @@ static bool have_script_upload_cap(LLUUID& object_id) return object && (! object->getRegion()->getCapability("UpdateScriptTask").empty()); } +static bool have_lua_enabled(const LLUUID& object_id) +{ + LLViewerRegion* region = nullptr; + LLViewerObject* object = gObjectList.findObject(object_id); + if (object) + { + region = object->getRegion(); + } + else + { + region = gAgent.getRegion(); + } + + if (region && region->simulatorFeaturesReceived()) + { + LLSD simulatorFeatures; + region->getSimulatorFeatures(simulatorFeatures); + return simulatorFeatures["LuaScriptsEnabled"].asBoolean(); + } + + return false; +} + +// TEMPORARY: Quick check to see if the code is Lua +// since we don't have another way to determine the language yet +static bool is_lua_script(const std::string& code) +{ + // Check for LSL's signature "default" state pattern + std::regex lsl_pattern("\\s*default\\s*\\{"); + if (std::regex_search(code, lsl_pattern)) + return false; + + // "default" state not found, assuming it's Lua + return true; +} + /// --------------------------------------------------------------------------- /// LLLiveLSLFile /// --------------------------------------------------------------------------- @@ -373,9 +390,9 @@ LLScriptEdCore::LLScriptEdCore( LLScriptEdContainer* container, const std::string& sample, const LLHandle& floater_handle, - void (*load_callback)(void*), - void (*save_callback)(void*, bool), - void (*search_replace_callback) (void* userdata), + script_ed_callback_t load_callback, + save_callback_t save_callback, + script_ed_callback_t search_replace_callback, void* userdata, bool live, S32 bottom_pad) @@ -391,7 +408,6 @@ LLScriptEdCore::LLScriptEdCore( mLastHelpToken(NULL), mLiveHelpHistorySize(0), mEnableSave(false), - mLiveFile(NULL), mLive(live), mContainer(container), mHasScriptData(false), @@ -423,7 +439,6 @@ LLScriptEdCore::~LLScriptEdCore() } } - delete mLiveFile; if (mSyntaxIDConnection.connected()) { mSyntaxIDConnection.disconnect(); @@ -441,42 +456,37 @@ void LLLiveLSLEditor::experienceChanged() } } -void LLLiveLSLEditor::onViewProfile( LLUICtrl *ui, void* userdata ) +void LLLiveLSLEditor::onViewProfile() { - LLLiveLSLEditor* self = (LLLiveLSLEditor*)userdata; - - LLUUID id; - if(self->mExperienceEnabled->get()) + if (mExperienceEnabled->get()) { - id=self->mScriptEd->getAssociatedExperience(); - if(id.notNull()) + LLUUID id = mScriptEd->getAssociatedExperience(); + if (id.notNull()) { LLFloaterReg::showInstance("experience_profile", id, true); } } - } -void LLLiveLSLEditor::onToggleExperience( LLUICtrl *ui, void* userdata ) +void LLLiveLSLEditor::onToggleExperience() { - LLLiveLSLEditor* self = (LLLiveLSLEditor*)userdata; - LLUUID id; - if(self->mExperienceEnabled->get()) + if (mExperienceEnabled->get()) { - if(self->mScriptEd->getAssociatedExperience().isNull()) + if (mScriptEd->getAssociatedExperience().isNull()) { - id=self->mExperienceIds.beginArray()->asUUID(); + id = mExperienceIds.beginArray()->asUUID(); } } - if(id != self->mScriptEd->getAssociatedExperience()) + if (id != mScriptEd->getAssociatedExperience()) { - self->mScriptEd->enableSave(self->getIsModifiable()); + mScriptEd->enableSave(getIsModifiable()); } - self->mScriptEd->setAssociatedExperience(id); - self->updateExperiencePanel(); + mScriptEd->setAssociatedExperience(id); + + updateExperiencePanel(); } bool LLScriptEdCore::postBuild() @@ -501,6 +511,7 @@ bool LLScriptEdCore::postBuild() // Intialise keyword highlighting for the current simulator's version of LSL LLSyntaxIdLSL::getInstance()->initialize(); + LLSyntaxLua::getInstance()->initialize(); processKeywords(); mCommitCallbackRegistrar.add("FontSize.Set", boost::bind(&LLScriptEdCore::onChangeFontSize, this, _2)); @@ -510,14 +521,31 @@ bool LLScriptEdCore::postBuild() "menu_lsl_font_size.xml", gMenuHolder, LLViewerMenuHolderGL::child_registry_t::instance()); getChild("font_btn")->setMenu(context_menu, LLMenuButton::MP_BOTTOM_LEFT, true); + + bool lua_scripts_enabled = have_lua_enabled(LLUUID::null); + mCompileTarget = getChild("compile_target"); + if (LLScrollListItem* luau_item = mCompileTarget->findItemByValue("luau")) + { + luau_item->setEnabled(lua_scripts_enabled); + } + if (LLScrollListItem* lsl_luau_item = mCompileTarget->findItemByValue("lsl-luau")) + { + lsl_luau_item->setEnabled(lua_scripts_enabled); + } + return true; } void LLScriptEdCore::processKeywords() +{ + processKeywords(mEditor->getIsLuauLanguage()); +} + +void LLScriptEdCore::processKeywords(bool luau_language) { LL_DEBUGS("SyntaxLSL") << "Processing keywords" << LL_ENDL; mEditor->clearSegments(); - mEditor->initKeywords(); + mEditor->initKeywords(luau_language); mEditor->loadKeywords(); string_vec_t primary_keywords; @@ -536,6 +564,8 @@ void LLScriptEdCore::processKeywords() secondary_keywords.push_back( wstring_to_utf8str(token->getToken()) ); } } + + mFunctions->removeall(); for (string_vec_t::const_iterator iter = primary_keywords.begin(); iter!= primary_keywords.end(); ++iter) { @@ -691,13 +721,13 @@ bool LLScriptEdCore::writeToFile(const std::string& filename) void LLScriptEdCore::sync() { // Sync with external editor. - if (mLiveFile) + if (mContainer->mLiveFile) { - std::string tmp_file = mLiveFile->filename(); + std::string tmp_file = mContainer->mLiveFile->filename(); llstat s; if (LLFile::stat(tmp_file, &s) == 0) // file exists { - mLiveFile->ignoreNextUpdate(); + mContainer->mLiveFile->ignoreNextUpdate(); writeToFile(tmp_file); } } @@ -1083,15 +1113,21 @@ void LLScriptEdCore::doSave( bool close_after_save ) void LLScriptEdCore::openInExternalEditor() { - delete mLiveFile; // deletes file + //if (mContainer->mLiveFile) + //{ + // // If already open in an external editor, just return + // return; + //} // Generate a suitable filename std::string script_name = mScriptName; - std::string forbidden_chars = "<>:\"\\/|?*"; - for (std::string::iterator c = forbidden_chars.begin(); c != forbidden_chars.end(); c++) - { - script_name.erase(std::remove(script_name.begin(), script_name.end(), *c), script_name.end()); - } + + static const std::set forbidden_chars{ '<', '>', ':', '"', '\\', '/', '|', '?', '*' }; + script_name.erase( + std::remove_if(script_name.begin(), script_name.end(), [](char c) { + return forbidden_chars.contains(c); + }), script_name.end()); + std::string filename = mContainer->getTmpFileName(script_name); // Save the script to a temporary file. @@ -1105,9 +1141,18 @@ void LLScriptEdCore::openInExternalEditor() writeToFile(filename); } + if (mContainer->mLiveFile && mContainer->mLiveFile->filename() != filename) + { // The name may have changed if we changed the type of scipt being edited. + delete mContainer->mLiveFile; + mContainer->mLiveFile = NULL; + } // Start watching file changes. - mLiveFile = new LLLiveLSLFile(filename, boost::bind(&LLScriptEdContainer::onExternalChange, mContainer, _1)); - mLiveFile->addToEventTimer(); + if (!mContainer->mLiveFile) + { + mContainer->mLiveFile = new LLLiveLSLFile(filename, boost::bind(&LLScriptEdContainer::onExternalChange, mContainer, _1)); + mContainer->mLiveFile->addToEventTimer(); + } + mContainer->startWebsocketServer(); // Open it in external editor. { @@ -1376,15 +1421,15 @@ void LLLiveLSLEditor::updateExperiencePanel() mExperienceEnabled->setEnabled(false); mExperienceEnabled->setToolTip(getString("no_experiences")); } - getChild("view_profile")->setVisible(false); + mViewProfileButton->setVisible(false); } else { mExperienceEnabled->setToolTip(getString("experience_enabled")); mExperienceEnabled->setEnabled(getIsModifiable()); - mExperiences->setVisible(true); mExperienceEnabled->set(true); - getChild("view_profile")->setToolTip(getString("show_experience_profile")); + mExperiences->setVisible(true); + mViewProfileButton->setToolTip(getString("show_experience_profile")); buildExperienceList(); } } @@ -1453,7 +1498,7 @@ void LLLiveLSLEditor::buildExperienceList() mExperiences->setEnabled(true); mExperiences->sortByName(true); mExperiences->setCurrentByIndex(mExperiences->getCurrentIndex()); - getChild("view_profile")->setVisible(true); + mViewProfileButton->setVisible(true); } } @@ -1463,8 +1508,6 @@ void LLScriptEdCore::setAssociatedExperience( const LLUUID& experience_id ) mAssociatedExperience = experience_id; } - - void LLLiveLSLEditor::requestExperiences() { if (!getIsModifiable()) @@ -1503,11 +1546,42 @@ void LLLiveLSLEditor::receiveExperienceIds(LLSD result, LLHandlemEditor->getIsLuauLanguage() ? ".luau" : ".lsl"; + + if (script_name.empty()) + { + return std::string(LLFile::tmpdir()) + "sl_script_" + script_id_hash_str + script_extension; + } + else + { + return std::string(LLFile::tmpdir()) + "sl_script_" + script_name + "_" + script_id_hash_str + script_extension; + } +} + +std::string LLScriptEdContainer::getUniqueHash() const { // Take script inventory item id (within the object inventory) // to consideration so that it's possible to edit multiple scripts @@ -1515,18 +1589,65 @@ std::string LLScriptEdContainer::getTmpFileName(const std::string& script_name) std::string script_id = mObjectUUID.asString() + "_" + mItemUUID.asString(); // Use MD5 sum to make the file name shorter and not exceed maximum path length. - char script_id_hash_str[33]; /* Flawfinder: ignore */ - LLMD5 script_id_hash((const U8 *)script_id.c_str()); + char script_id_hash_str[33]; /* Flawfinder: ignore */ + LLMD5 script_id_hash((const U8*)script_id.c_str()); script_id_hash.hex_digest(script_id_hash_str); - if (script_name.empty()) + return std::string(script_id_hash_str); +} + +std::string LLScriptEdContainer::getErrorLogFileName(const std::string& script_path) +{ + if (script_path.empty()) { - return std::string(LLFile::tmpdir()) + "sl_script_" + script_id_hash_str + ".lsl"; + return std::string(); } - else + + return script_path + ".log"; +} + +bool LLScriptEdContainer::logErrorsToFile(const LLSD& compile_errors) +{ + if (!isOpenInExternalEditor()) + { + return false; + } + + std::string script_path = getTmpFileName(mScriptEd->mScriptName); + std::string log_path = getErrorLogFileName(script_path); + + llofstream file(log_path.c_str()); + if (!file.is_open()) + { + LL_WARNS() << "Unable to open error log file: " << log_path << LL_ENDL; + return false; + } + + // Write timestamp + std::string timestamp = LLLogChat::timestamp2LogString(0, true); + file << "// " << timestamp << "\n\n"; + + // Write errors + for (LLSD::array_const_iterator line = compile_errors.beginArray(); + line < compile_errors.endArray(); + line++) + { + std::string error_message = line->asString(); + LLStringUtil::stripNonprintable(error_message); + file << error_message << "\n"; + } + + file.close(); + + // Create a log file handler if we don't already have one, + // this is needed to delete the temporary log file properly + if (!mLiveLogFile && !log_path.empty()) { - return std::string(LLFile::tmpdir()) + "sl_script_" + script_name + "_" + script_id_hash_str + ".lsl"; + // Empty callback since we don't need to react to file changes + mLiveLogFile = new LLLiveLSLFile(log_path, [](const std::string& filename) { return true; }); } + + return true; } bool LLScriptEdContainer::onExternalChange(const std::string& filename) @@ -1556,6 +1677,63 @@ bool LLScriptEdContainer::handleKeyHere(KEY key, MASK mask) return true; } +void LLScriptEdContainer::startWebsocketServer() +{ + if (gSavedSettings.getBOOL("ExternalWebsocketSyncEnable")) + { + // Attempt to find an existing server + LLWebsocketMgr& wsmgr = LLWebsocketMgr::instance(); + LLScriptEditorWSServer::ptr_t server = + std::static_pointer_cast( + wsmgr.findServerByName(LLScriptEditorWSServer::DEFAULT_SERVER_NAME)); + + if (!server) + { // We couldn't find one, so create it + U16 server_port = static_cast(gSavedSettings.getS32("ExternalWebsocketSyncPort")); + bool server_localhost = gSavedSettings.getBOOL("ExternalWebsocketSyncLocal"); + server = std::make_shared(LLScriptEditorWSServer::DEFAULT_SERVER_NAME, server_port, server_localhost); + wsmgr.addServer(server); + } + + bool is_running = server->isRunning(); + if (!is_running) + { // Server isn't running, so start it + is_running = wsmgr.startServer(LLScriptEditorWSServer::DEFAULT_SERVER_NAME); + } + + if (!is_running && !server->isRunning()) + { // Failed to start the server + LL_WARNS() << "Failed to start script editor websocket server" << LL_ENDL; + return; + } + + std::string script_id_hash_str(getUniqueHash()); + server->subscribeScriptEditor(mObjectUUID, mItemUUID, mScriptEd->mScriptName, getHandle(), script_id_hash_str); + mWebSocketServer = server; + } +} + +void LLScriptEdContainer::unsubscribeScript() +{ + auto server = mWebSocketServer.lock(); + if (server) + { + std::string script_id_hash_str(getUniqueHash()); + server->sendUnsubscribeScriptEditor(script_id_hash_str); + server->unsubscribeEditor(script_id_hash_str); + } +} + +void LLScriptEdContainer::sendCompileResults(LLSD& params) +{ + auto server = mWebSocketServer.lock(); + if (server) + { + std::string script_id_hash_str(getUniqueHash()); + server->sendCompileResults(script_id_hash_str, params); + } +} + /// --------------------------------------------------------------------------- /// LLPreviewLSL /// --------------------------------------------------------------------------- @@ -1580,7 +1758,7 @@ void* LLPreviewLSL::createScriptEdPanel(void* userdata) self->mScriptEd = new LLScriptEdCore( self, - HELLO_LSL, + std::string(), self->getHandle(), LLPreviewLSL::onLoad, LLPreviewLSL::onSave, @@ -1624,6 +1802,9 @@ bool LLPreviewLSL::postBuild() childSetCommitCallback("desc", LLPreview::onText, this); getChild("desc")->setPrevalidate(&LLTextValidate::validateASCIIPrintableNoPipe); + mScriptEd->mCompileTarget = getChild("compile_target"); + mScriptEd->mCompileTarget->setCommitCallback([&](LLUICtrl*, const LLSD&) { onCompileTargetChanged(); }); + return LLPreview::postBuild(); } @@ -1649,6 +1830,15 @@ void LLPreviewLSL::callbackLSLCompileSucceeded() LL_INFOS() << "LSL Bytecode saved" << LL_ENDL; mScriptEd->mErrorList->setCommentText(LLTrans::getString("CompileSuccessful")); mScriptEd->mErrorList->setCommentText(LLTrans::getString("SaveComplete")); + + if (isOpenInExternalEditor()) + { + LLSD success_msg; + success_msg.append(LLTrans::getString("CompileSuccessful")); + success_msg.append(LLTrans::getString("SaveComplete")); + logErrorsToFile(success_msg); + } + closeIfNeeded(); } @@ -1668,6 +1858,12 @@ void LLPreviewLSL::callbackLSLCompileFailed(const LLSD& compile_errors) row["columns"][0]["font"] = "OCRA"; mScriptEd->mErrorList->addElement(row); } + + if (isOpenInExternalEditor()) + { + logErrorsToFile(compile_errors); + } + mScriptEd->selectFirstError(); closeIfNeeded(); } @@ -1718,12 +1914,6 @@ void LLPreviewLSL::loadAsset() getChildView("lock")->setVisible( !is_modifiable); mScriptEd->getChildView("Insert...")->setEnabled(is_modifiable); } - else - { - mScriptEd->setScriptText(std::string(HELLO_LSL), true); - mScriptEd->setEnableEditing(true); - mAssetStatus = PREVIEW_ASSET_LOADED; - } } @@ -1781,6 +1971,7 @@ void LLPreviewLSL::finishedLSLUpload(LLUUID itemId, LLSD response) { preview->callbackLSLCompileFailed(response["errors"]); } + preview->sendCompileResults(response); } } @@ -1804,6 +1995,12 @@ bool LLPreviewLSL::failedLSLUpload(LLUUID itemId, LLUUID taskId, LLSD response, LLSD errors; errors.append(LLTrans::getString("UploadFailed") + reason); preview->callbackLSLCompileFailed(errors); + + LLSD message; + message["compiled"] = false; + message["errors"] = errors; + preview->sendCompileResults(message); + return true; } @@ -1839,11 +2036,12 @@ void LLPreviewLSL::saveIfNeeded(bool sync /*= true*/) mPendingUploads++; if (!url.empty()) { + std::string compile_target(mScriptEd->mCompileTarget->getValue()); std::string buffer(mScriptEd->mEditor->getText()); LLUUID old_asset_id = inv_item->getAssetUUID().isNull() ? mScriptEd->getAssetID() : inv_item->getAssetUUID(); - LLResourceUploadInfo::ptr_t uploadInfo(std::make_shared(mItemUUID, buffer, + LLResourceUploadInfo::ptr_t uploadInfo(std::make_shared(mItemUUID, compile_target, buffer, [old_asset_id](LLUUID itemId, LLUUID, LLUUID, LLSD response) { LLFileSystem::removeFile(old_asset_id, LLAssetType::AT_LSL_TEXT); LLPreviewLSL::finishedLSLUpload(itemId, response); @@ -1855,6 +2053,11 @@ void LLPreviewLSL::saveIfNeeded(bool sync /*= true*/) } } +void LLPreviewLSL::onCompileTargetChanged() +{ + mScriptEd->processKeywords(mScriptEd->mCompileTarget->getValue().asString() == "luau"); +} + // static void LLPreviewLSL::onLoadComplete(const LLUUID& asset_uuid, LLAssetType::EType type, void* user_data, S32 status, LLExtStat ext_status) @@ -1896,6 +2099,12 @@ void LLPreviewLSL::onLoadComplete(const LLUUID& asset_uuid, LLAssetType::EType t preview->mScriptEd->setEnableEditing(is_modifiable); preview->mScriptEd->setAssetID(asset_uuid); preview->mAssetStatus = PREVIEW_ASSET_LOADED; + + // Temporary hack to determine if the script is LSL or SLua when loaded from the inventory. + bool is_lua = is_lua_script(std::string(buffer.begin(), buffer.end())); + preview->mScriptEd->mEditor->setLuauLanguage(is_lua); + preview->mScriptEd->mCompileTarget->setValue(is_lua ? "luau" : "lsl-luau"); + preview->mScriptEd->processKeywords(is_lua); } else { @@ -1933,7 +2142,7 @@ void* LLLiveLSLEditor::createScriptEdPanel(void* userdata) self->mScriptEd = new LLScriptEdCore( self, - HELLO_LSL, + std::string(), self->getHandle(), &LLLiveLSLEditor::onLoad, &LLLiveLSLEditor::onSave, @@ -1961,28 +2170,26 @@ LLLiveLSLEditor::LLLiveLSLEditor(const LLSD& key) : bool LLLiveLSLEditor::postBuild() { - childSetCommitCallback("running", LLLiveLSLEditor::onRunningCheckboxClicked, this); - getChildView("running")->setEnabled(false); - - childSetAction("Reset",&LLLiveLSLEditor::onReset,this); - getChildView("Reset")->setEnabled(true); - - mMonoCheckbox = getChild("mono"); - childSetCommitCallback("mono", &LLLiveLSLEditor::onMonoCheckboxClicked, this); - getChildView("mono")->setEnabled(true); - - mScriptEd->mEditor->makePristine(); - mScriptEd->mEditor->setFocus(true); + mResetButton = getChild("Reset"); + mResetButton->setClickedCallback([&](LLUICtrl*, const LLSD&) { onReset(); }); + mRunningCheckbox = getChild("running"); + mRunningCheckbox->setCommitCallback([&](LLUICtrl*, const LLSD&) { onRunningCheckboxClicked(); }); mExperiences = getChild("Experiences..."); - mExperiences->setCommitCallback(boost::bind(&LLLiveLSLEditor::experienceChanged, this)); + mExperiences->setCommitCallback([&](LLUICtrl*, const LLSD&) { experienceChanged(); }); mExperienceEnabled = getChild("enable_xp"); + mExperienceEnabled->setCommitCallback([&](LLUICtrl*, const LLSD&) { onToggleExperience(); }); - childSetCommitCallback("enable_xp", onToggleExperience, this); - childSetCommitCallback("view_profile", onViewProfile, this); + mViewProfileButton = getChild("view_profile"); + mViewProfileButton->setClickedCallback([&](LLUICtrl*, const LLSD&) { onViewProfile(); }); + mScriptEd->mEditor->makePristine(); + mScriptEd->mEditor->setFocus(true); + + mScriptEd->mCompileTarget = getChild("compile_target"); + mScriptEd->mCompileTarget->setCommitCallback([&](LLUICtrl*, const LLSD&) { onCompileTargetChanged(); }); return LLPreview::postBuild(); } @@ -1995,7 +2202,16 @@ void LLLiveLSLEditor::callbackLSLCompileSucceeded(const LLUUID& task_id, LL_DEBUGS() << "LSL Bytecode saved" << LL_ENDL; mScriptEd->mErrorList->setCommentText(LLTrans::getString("CompileSuccessful")); mScriptEd->mErrorList->setCommentText(LLTrans::getString("SaveComplete")); - getChild("running")->set(is_script_running); + + if (isOpenInExternalEditor()) + { + LLSD success_msg; + success_msg.append(LLTrans::getString("CompileSuccessful")); + success_msg.append(LLTrans::getString("SaveComplete")); + logErrorsToFile(success_msg); + } + + mRunningCheckbox->set(is_script_running); mIsSaving = false; closeIfNeeded(); } @@ -2004,6 +2220,7 @@ void LLLiveLSLEditor::callbackLSLCompileSucceeded(const LLUUID& task_id, void LLLiveLSLEditor::callbackLSLCompileFailed(const LLSD& compile_errors) { LL_DEBUGS() << "Compile failed!" << LL_ENDL; + for(LLSD::array_const_iterator line = compile_errors.beginArray(); line < compile_errors.endArray(); line++) @@ -2016,6 +2233,12 @@ void LLLiveLSLEditor::callbackLSLCompileFailed(const LLSD& compile_errors) row["columns"][0]["font"] = "OCRA"; mScriptEd->mErrorList->addElement(row); } + + if (isOpenInExternalEditor()) + { + logErrorsToFile(compile_errors); + } + mScriptEd->selectFirstError(); mIsSaving = false; closeIfNeeded(); @@ -2058,9 +2281,10 @@ void LLLiveLSLEditor::loadAsset() { mItem = new LLViewerInventoryItem(item); // request the text from the object - LLSD* user_data = new LLSD(); - user_data->with("taskid", mObjectUUID).with("itemid", mItemUUID); - gAssetStorage->getInvItemAsset(object->getRegion()->getHost(), + LLSD* user_data = new LLSD(); + user_data->with("taskid", mObjectUUID).with("itemid", mItemUUID); + gAssetStorage->getInvItemAsset( + object->getRegion()->getHost(), gAgent.getID(), gAgent.getSessionID(), item->getPermissions().getOwner(), @@ -2068,8 +2292,8 @@ void LLLiveLSLEditor::loadAsset() item->getUUID(), item->getAssetUUID(), item->getType(), - &LLLiveLSLEditor::onLoadComplete, - (void*)user_data, + LLLiveLSLEditor::onLoadComplete, + user_data, true); LLMessageSystem* msg = gMessageSystem; msg->newMessageFast(_PREHASH_GetScriptRunning); @@ -2108,26 +2332,6 @@ void LLLiveLSLEditor::loadAsset() */ } } - else - { - mScriptEd->setScriptText(std::string(HELLO_LSL), true); - mScriptEd->enableSave(false); - LLPermissions perm; - perm.init(gAgent.getID(), gAgent.getID(), LLUUID::null, gAgent.getGroupID()); - perm.initMasks(PERM_ALL, PERM_ALL, PERM_NONE, PERM_NONE, PERM_MOVE | PERM_TRANSFER); - mItem = new LLViewerInventoryItem(mItemUUID, - mObjectUUID, - perm, - LLUUID::null, - LLAssetType::AT_LSL_TEXT, - LLInventoryType::IT_LSL, - DEFAULT_SCRIPT_NAME, - DEFAULT_SCRIPT_DESC, - LLSaleInfo::DEFAULT, - LLInventoryItemFlags::II_FLAGS_NONE, - time_corrected()); - mAssetStatus = PREVIEW_ASSET_LOADED; - } requestExperiences(); } @@ -2203,14 +2407,9 @@ void LLLiveLSLEditor::loadScriptText(const LLUUID &uuid, LLAssetType::EType type } -void LLLiveLSLEditor::onRunningCheckboxClicked( LLUICtrl*, void* userdata ) +void LLLiveLSLEditor::onRunningCheckboxClicked() { - LLLiveLSLEditor* self = (LLLiveLSLEditor*) userdata; - LLViewerObject* object = gObjectList.findObject( self->mObjectUUID ); - LLCheckBoxCtrl* runningCheckbox = self->getChild("running"); - bool running = runningCheckbox->get(); - //self->mRunningCheckbox->get(); - if( object ) + if (LLViewerObject* object = gObjectList.findObject(mObjectUUID)) { LLMessageSystem* msg = gMessageSystem; msg->newMessageFast(_PREHASH_SetScriptRunning); @@ -2218,24 +2417,21 @@ void LLLiveLSLEditor::onRunningCheckboxClicked( LLUICtrl*, void* userdata ) msg->addUUIDFast(_PREHASH_AgentID, gAgent.getID()); msg->addUUIDFast(_PREHASH_SessionID, gAgent.getSessionID()); msg->nextBlockFast(_PREHASH_Script); - msg->addUUIDFast(_PREHASH_ObjectID, self->mObjectUUID); - msg->addUUIDFast(_PREHASH_ItemID, self->mItemUUID); - msg->addBOOLFast(_PREHASH_Running, running); + msg->addUUIDFast(_PREHASH_ObjectID, mObjectUUID); + msg->addUUIDFast(_PREHASH_ItemID, mItemUUID); + msg->addBOOLFast(_PREHASH_Running, mRunningCheckbox->get()); msg->sendReliable(object->getRegion()->getHost()); } else { - runningCheckbox->set(!running); + mRunningCheckbox->set(!mRunningCheckbox->get()); LLNotificationsUtil::add("CouldNotStartStopScript"); } } -void LLLiveLSLEditor::onReset(void *userdata) +void LLLiveLSLEditor::onReset() { - LLLiveLSLEditor* self = (LLLiveLSLEditor*) userdata; - - LLViewerObject* object = gObjectList.findObject( self->mObjectUUID ); - if(object) + if (LLViewerObject* object = gObjectList.findObject(mObjectUUID)) { LLMessageSystem* msg = gMessageSystem; msg->newMessageFast(_PREHASH_ScriptReset); @@ -2243,8 +2439,8 @@ void LLLiveLSLEditor::onReset(void *userdata) msg->addUUIDFast(_PREHASH_AgentID, gAgent.getID()); msg->addUUIDFast(_PREHASH_SessionID, gAgent.getSessionID()); msg->nextBlockFast(_PREHASH_Script); - msg->addUUIDFast(_PREHASH_ObjectID, self->mObjectUUID); - msg->addUUIDFast(_PREHASH_ItemID, self->mItemUUID); + msg->addUUIDFast(_PREHASH_ObjectID, mObjectUUID); + msg->addUUIDFast(_PREHASH_ItemID, mItemUUID); msg->sendReliable(object->getRegion()->getHost()); } else @@ -2256,34 +2452,33 @@ void LLLiveLSLEditor::onReset(void *userdata) void LLLiveLSLEditor::draw() { LLViewerObject* object = gObjectList.findObject(mObjectUUID); - LLCheckBoxCtrl* runningCheckbox = getChild( "running"); - if(object && mAskedForRunningInfo && mHaveRunningInfo) + if (object && mAskedForRunningInfo && mHaveRunningInfo) { - if(object->permAnyOwner()) + if (object->permAnyOwner()) { - runningCheckbox->setLabel(getString("script_running")); - runningCheckbox->setEnabled(!mIsSaving); + mRunningCheckbox->setLabel(getString("script_running")); + mRunningCheckbox->setEnabled(!mIsSaving); } else { - runningCheckbox->setLabel(getString("public_objects_can_not_run")); - runningCheckbox->setEnabled(false); + mRunningCheckbox->setLabel(getString("public_objects_can_not_run")); + mRunningCheckbox->setEnabled(false); // *FIX: Set it to false so that the ui is correct for // a box that is released to public. It could be // incorrect after a release/claim cycle, but will be // correct after clicking on it. - runningCheckbox->set(false); - mMonoCheckbox->set(false); + mRunningCheckbox->set(false); + mScriptEd->mCompileTarget->clear(); } } - else if(!object) + else if (!object) { // HACK: Display this information in the title bar. // Really ought to put in main window. setTitle(LLTrans::getString("ObjectOutOfRange")); - runningCheckbox->setEnabled(false); - mMonoCheckbox->setEnabled(false); + mRunningCheckbox->setEnabled(false); + mScriptEd->mCompileTarget->setEnabled(false); // object may have fallen out of range. mHaveRunningInfo = false; } @@ -2340,6 +2535,8 @@ void LLLiveLSLEditor::finishLSLUpload(LLUUID itemId, LLUUID taskId, LLUUID newAs { preview->callbackLSLCompileFailed(response["errors"]); } + response["is_running"] = isRunning; + preview->sendCompileResults(response); } } @@ -2390,7 +2587,7 @@ void LLLiveLSLEditor::saveIfNeeded(bool sync /*= true*/) mScriptEd->sync(); } - bool isRunning = getChild("running")->get(); + bool is_running = mRunningCheckbox->get(); getWindow()->incBusyCount(); mPendingUploads++; @@ -2398,17 +2595,18 @@ void LLLiveLSLEditor::saveIfNeeded(bool sync /*= true*/) if (!url.empty()) { + std::string compile_target(mScriptEd->mCompileTarget->getValue()); std::string buffer(mScriptEd->mEditor->getText()); LLUUID old_asset_id = mScriptEd->getAssetID(); LLResourceUploadInfo::ptr_t uploadInfo(std::make_shared(mObjectUUID, mItemUUID, - monoChecked() ? LLScriptAssetUpload::MONO : LLScriptAssetUpload::LSL2, - isRunning, mScriptEd->getAssociatedExperience(), buffer, - [isRunning, old_asset_id](LLUUID itemId, LLUUID taskId, LLUUID newAssetId, LLSD response) { - LLFileSystem::removeFile(old_asset_id, LLAssetType::AT_LSL_TEXT); - LLLiveLSLEditor::finishLSLUpload(itemId, taskId, newAssetId, response, isRunning); - }, - nullptr)); // needs failure handling? + compile_target, is_running, mScriptEd->getAssociatedExperience(), buffer, + [is_running, old_asset_id](LLUUID item_id, LLUUID task_id, LLUUID new_asset_id, LLSD response) + { + LLFileSystem::removeFile(old_asset_id, LLAssetType::AT_LSL_TEXT); + LLLiveLSLEditor::finishLSLUpload(item_id, task_id, new_asset_id, response, is_running); + }, + nullptr)); // needs failure handling? LLViewerAssetUpload::EnqueueInventoryUpload(url, uploadInfo); } @@ -2461,28 +2659,60 @@ void LLLiveLSLEditor::processScriptRunningReply(LLMessageSystem* msg, void**) if (LLLiveLSLEditor* instance = LLFloaterReg::findTypedInstance("preview_scriptedit", floater_key)) { instance->mHaveRunningInfo = true; + bool running; msg->getBOOLFast(_PREHASH_Script, _PREHASH_Running, running); - LLCheckBoxCtrl* runningCheckbox = instance->getChild("running"); - runningCheckbox->set(running); - bool mono; - msg->getBOOLFast(_PREHASH_Script, "Mono", mono); - LLCheckBoxCtrl* monoCheckbox = instance->getChild("mono"); - monoCheckbox->setEnabled(instance->getIsModifiable() && have_script_upload_cap(object_id)); - monoCheckbox->set(mono); + instance->mRunningCheckbox->set(running); + + bool mono = false, luau = false, luau_language = false; + msg->getBOOLFast(_PREHASH_Script, _PREHASH_Mono, mono); + msg->getBOOLFast(_PREHASH_Script, _PREHASH_Luau, luau); // Luau compiler is enabled + msg->getBOOLFast(_PREHASH_Script, _PREHASH_LuauLanguage, luau_language); + + std::string compile_target; + if (luau) + { + if (luau_language) + { + compile_target = "luau"; + } + else + { + compile_target = "lsl-luau"; // Luau compiler running in LSL compatibility mode + } + } + else if (mono) + { + compile_target = "mono"; + } + else + { + compile_target = "lsl2"; + } + + instance->mScriptEd->mCompileTarget->setValue(compile_target); + instance->mScriptEd->processKeywords(luau && luau_language); // Use Luau syntax highlighting for Luau scripts + + bool lua_scripts_enabled = have_lua_enabled(object_id); + if (LLScrollListItem* luau_item = instance->mScriptEd->mCompileTarget->findItemByValue("luau")) + { + luau_item->setEnabled(lua_scripts_enabled); + } + if (LLScrollListItem* lsl_luau_item = instance->mScriptEd->mCompileTarget->findItemByValue("lsl-luau")) + { + lsl_luau_item->setEnabled(lua_scripts_enabled); + } + + instance->mScriptEd->mCompileTarget->setEnabled(instance->getIsModifiable() && have_script_upload_cap(object_id)); } } -void LLLiveLSLEditor::onMonoCheckboxClicked(LLUICtrl*, void* userdata) +void LLLiveLSLEditor::onCompileTargetChanged() { - LLLiveLSLEditor* self = static_cast(userdata); - self->mMonoCheckbox->setEnabled(have_script_upload_cap(self->mObjectUUID)); - self->mScriptEd->enableSave(self->getIsModifiable()); -} + mScriptEd->mCompileTarget->setEnabled(have_script_upload_cap(mObjectUUID)); + mScriptEd->enableSave(getIsModifiable()); -bool LLLiveLSLEditor::monoChecked() const -{ - return mMonoCheckbox && mMonoCheckbox->getValue(); + mScriptEd->processKeywords(mScriptEd->mCompileTarget->getValue().asString() == "luau"); } void LLLiveLSLEditor::setAssociatedExperience( LLHandle editor, const LLSD& experience ) diff --git a/indra/newview/llpreviewscript.h b/indra/newview/llpreviewscript.h index 0bbe5402079..922a0f2a38b 100644 --- a/indra/newview/llpreviewscript.h +++ b/indra/newview/llpreviewscript.h @@ -54,19 +54,20 @@ class LLScriptEdContainer; class LLFloaterGotoLine; class LLFloaterExperienceProfile; class LLScriptMovedObserver; +class LLScriptEditorWSServer; class LLLiveLSLFile : public LLLiveFile { public: - typedef boost::function change_callback_t; + typedef std::function change_callback_t; LLLiveLSLFile(std::string file_path, change_callback_t change_cb); - ~LLLiveLSLFile(); + ~LLLiveLSLFile() override; void ignoreNextUpdate() { mIgnoreNextUpdate = true; } protected: - /*virtual*/ bool loadFile(); + bool loadFile() override; change_callback_t mOnChangeCallback; bool mIgnoreNextUpdate; @@ -82,26 +83,34 @@ class LLScriptEdCore : public LLPanel friend class LLScriptEdContainer; friend class LLFloaterGotoLine; +public: + typedef boost::function script_ed_callback_t; + typedef boost::function save_callback_t; + protected: // Supposed to be invoked only by the container. LLScriptEdCore( LLScriptEdContainer* container, const std::string& sample, const LLHandle& floater_handle, - void (*load_callback)(void* userdata), - void (*save_callback)(void* userdata, bool close_after_save), - void (*search_replace_callback)(void* userdata), + script_ed_callback_t load_callback, + save_callback_t save_callback, + script_ed_callback_t search_replace_callback, void* userdata, bool live, S32 bottom_pad = 0); // pad below bottom row of buttons public: - ~LLScriptEdCore(); + ~LLScriptEdCore() override; void initMenu(); void processKeywords(); + void processKeywords(bool luau_language); + LLScriptEditor* getEditor() const { return mEditor; } + LLKeywords& getKeywords() const { return mEditor->getKeywords(); } + bool isLuauLanguage() const { return mEditor->getIsLuauLanguage(); } - virtual void draw(); - /*virtual*/ bool postBuild(); + void draw() override; + bool postBuild() override; bool canClose(); void setEnableEditing(bool enable); bool canLoadOrSaveToFile( void* userdata ); @@ -134,33 +143,32 @@ class LLScriptEdCore : public LLPanel static bool enableSaveToFileMenu(void* userdata); static bool enableLoadFromFileMenu(void* userdata); - virtual bool hasAccelerators() const { return true; } + bool hasAccelerators() const override { return true; } LLUUID getAssociatedExperience()const; void setAssociatedExperience( const LLUUID& experience_id ); - void setScriptName(const std::string& name){mScriptName = name;}; + void setScriptName(const std::string& name) { mScriptName = name; } - void setItemRemoved(bool script_removed){mScriptRemoved = script_removed;}; + void setItemRemoved(bool script_removed) { mScriptRemoved = script_removed; } void setAssetID( const LLUUID& asset_id){ mAssetID = asset_id; }; LLUUID getAssetID() const { return mAssetID; } - bool isFontSizeChecked(const LLSD &userdata); - void onChangeFontSize(const LLSD &size_name); + bool isFontSizeChecked(const LLSD &userdata); + void onChangeFontSize(const LLSD &size_name); + + bool handleKeyHere(KEY key, MASK mask) override; + void selectAll() { mEditor->selectAll(); } - virtual bool handleKeyHere(KEY key, MASK mask); - void selectAll() { mEditor->selectAll(); } + void enableSave(bool b) { mEnableSave = b; } + bool hasChanged() const; private: void onBtnDynamicHelp(); void onBtnUndoChanges(); - bool hasChanged() const; - void selectFirstError(); - void enableSave(bool b) {mEnableSave = b;} - protected: void deleteBridges(); void setHelpPage(const std::string& help_string); @@ -175,9 +183,9 @@ class LLScriptEdCore : public LLPanel std::string mSampleText; std::string mScriptName; LLScriptEditor* mEditor; - void (*mLoadCallback)(void* userdata); - void (*mSaveCallback)(void* userdata, bool close_after_save); - void (*mSearchReplaceCallback) (void* userdata); + script_ed_callback_t mLoadCallback; + save_callback_t mSaveCallback; + script_ed_callback_t mSearchReplaceCallback; void* mUserdata; LLComboBox *mFunctions; bool mForceClose; @@ -190,19 +198,18 @@ class LLScriptEdCore : public LLPanel S32 mLiveHelpHistorySize; bool mEnableSave; bool mHasScriptData; - LLLiveLSLFile* mLiveFile; LLUUID mAssociatedExperience; bool mScriptRemoved; bool mSaveDialogShown; LLUUID mAssetID; LLTextBox* mLineCol = nullptr; LLButton* mSaveBtn = nullptr; + LLComboBox* mCompileTarget = nullptr; LLScriptEdContainer* mContainer; // parent view -public: + public: boost::signals2::connection mSyntaxIDConnection; - }; class LLScriptEdContainer : public LLPreview @@ -211,15 +218,30 @@ class LLScriptEdContainer : public LLPreview public: LLScriptEdContainer(const LLSD& key); + ~LLScriptEdContainer() override; + + bool handleKeyHere(KEY key, MASK mask) override; - bool handleKeyHere(KEY key, MASK mask); + void startWebsocketServer(); + void unsubscribeScript(); + void sendCompileResults(LLSD&); + + LLScriptEdCore* getScriptEdCore() const { return mScriptEd; } protected: - std::string getTmpFileName(const std::string& script_name); + std::string getTmpFileName(const std::string& script_name) const; + std::string getUniqueHash() const; + std::string getErrorLogFileName(const std::string& script_path); bool onExternalChange(const std::string& filename); virtual void saveIfNeeded(bool sync = true) = 0; + bool logErrorsToFile(const LLSD& compile_errors); + bool isOpenInExternalEditor() const { return mLiveFile != nullptr; } LLScriptEdCore* mScriptEd; + LLLiveLSLFile* mLiveFile = nullptr; + LLLiveLSLFile* mLiveLogFile = nullptr; + + std::weak_ptr mWebSocketServer; }; // Used to view and edit an LSL script from your inventory. @@ -227,7 +249,7 @@ class LLPreviewLSL : public LLScriptEdContainer { public: LLPreviewLSL(const LLSD& key ); - ~LLPreviewLSL(); + ~LLPreviewLSL() override; LLUUID getScriptID() { return mItemUUID; } @@ -236,15 +258,16 @@ class LLPreviewLSL : public LLScriptEdContainer virtual void callbackLSLCompileSucceeded(); virtual void callbackLSLCompileFailed(const LLSD& compile_errors); - /*virtual*/ bool postBuild(); + bool postBuild() override; protected: - virtual void draw(); - virtual bool canClose(); + void draw() override; + bool canClose() override; void closeIfNeeded(); - virtual void loadAsset(); - /*virtual*/ void saveIfNeeded(bool sync = true); + void loadAsset() override; + void saveIfNeeded(bool sync = true) override; + void onCompileTargetChanged(); static void onSearchReplace(void* userdata); static void onLoad(void* userdata); @@ -265,10 +288,8 @@ class LLPreviewLSL : public LLScriptEdContainer S32 mPendingUploads; LLScriptMovedObserver* mItemObserver; - }; - // Used to view and edit an LSL script that is attached to an object. class LLLiveLSLEditor : public LLScriptEdContainer { @@ -276,7 +297,6 @@ class LLLiveLSLEditor : public LLScriptEdContainer public: LLLiveLSLEditor(const LLSD& key); - static void processScriptRunningReply(LLMessageSystem* msg, void**); virtual void callbackLSLCompileSucceeded(const LLUUID& task_id, @@ -284,13 +304,13 @@ class LLLiveLSLEditor : public LLScriptEdContainer bool is_script_running); virtual void callbackLSLCompileFailed(const LLSD& compile_errors); - /*virtual*/ bool postBuild(); + bool postBuild() override; void setIsNew() { mIsNew = true; } static void setAssociatedExperience( LLHandle editor, const LLSD& experience ); - static void onToggleExperience(LLUICtrl *ui, void* userdata); - static void onViewProfile(LLUICtrl *ui, void* userdata); + void onToggleExperience(); + void onViewProfile(); void setExperienceIds(const LLSD& experience_ids); void buildExperienceList(); @@ -300,15 +320,15 @@ class LLLiveLSLEditor : public LLScriptEdContainer void setObjectName(std::string name) { mObjectName = name; } + bool getIsModifiable() const { return mIsModifiable; } // Evaluated on load assert + private: - virtual bool canClose(); + bool canClose() override; void closeIfNeeded(); - virtual void draw(); - - virtual void loadAsset(); - /*virtual*/ void saveIfNeeded(bool sync = true); - bool monoChecked() const; + void draw() override; + void loadAsset() override; + void saveIfNeeded(bool sync = true) override; static void onSearchReplace(void* userdata); static void onLoad(void* userdata); @@ -317,14 +337,14 @@ class LLLiveLSLEditor : public LLScriptEdContainer static void onLoadComplete(const LLUUID& asset_uuid, LLAssetType::EType type, void* user_data, S32 status, LLExtStat ext_status); - static void onRunningCheckboxClicked(LLUICtrl*, void* userdata); - static void onReset(void* userdata); + void onRunningCheckboxClicked(); + void onReset(); void loadScriptText(const LLUUID &uuid, LLAssetType::EType type); static void* createScriptEdPanel(void* userdata); - static void onMonoCheckboxClicked(LLUICtrl*, void* userdata); + void onCompileTargetChanged(); static void finishLSLUpload(LLUUID itemId, LLUUID taskId, LLUUID newAssetId, LLSD response, bool isRunning); static void receiveExperienceIds(LLSD result, LLHandle parent); @@ -342,19 +362,17 @@ class LLLiveLSLEditor : public LLScriptEdContainer S32 mPendingUploads; bool mIsSaving; + bool mIsModifiable; - bool getIsModifiable() const { return mIsModifiable; } // Evaluated on load assert - - LLCheckBoxCtrl* mMonoCheckbox; - bool mIsModifiable; - - - LLComboBox* mExperiences; - LLCheckBoxCtrl* mExperienceEnabled; - LLSD mExperienceIds; + LLButton* mResetButton { nullptr }; + LLCheckBoxCtrl* mRunningCheckbox { nullptr }; + LLComboBox* mExperiences { nullptr }; + LLCheckBoxCtrl* mExperienceEnabled { nullptr }; + LLButton* mViewProfileButton { nullptr }; + LLSD mExperienceIds; LLHandle mExperienceProfile; - std::string mObjectName; + std::string mObjectName; }; #endif // LL_LLPREVIEWSCRIPT_H diff --git a/indra/newview/llproductinforequest.cpp b/indra/newview/llproductinforequest.cpp index 728cb224312..d962622dfdc 100644 --- a/indra/newview/llproductinforequest.cpp +++ b/indra/newview/llproductinforequest.cpp @@ -70,8 +70,8 @@ void LLProductInfoRequestManager::getLandDescriptionsCoro(std::string url) { LLCore::HttpRequest::policy_t httpPolicy(LLCore::HttpRequest::DEFAULT_POLICY_ID); LLCoreHttpUtil::HttpCoroutineAdapter::ptr_t - httpAdapter(new LLCoreHttpUtil::HttpCoroutineAdapter("genericPostCoro", httpPolicy)); - LLCore::HttpRequest::ptr_t httpRequest(new LLCore::HttpRequest); + httpAdapter = std::make_shared("getLandDescriptionsCoro", httpPolicy); + LLCore::HttpRequest::ptr_t httpRequest = std::make_shared(); LLSD result = httpAdapter->getAndSuspend(httpRequest, url); diff --git a/indra/newview/llremoteparcelrequest.cpp b/indra/newview/llremoteparcelrequest.cpp index d0aa1af2f31..f89afd38ab6 100644 --- a/indra/newview/llremoteparcelrequest.cpp +++ b/indra/newview/llremoteparcelrequest.cpp @@ -201,8 +201,8 @@ void LLRemoteParcelInfoProcessor::regionParcelInfoCoro(std::string url, { LLCore::HttpRequest::policy_t httpPolicy(LLCore::HttpRequest::DEFAULT_POLICY_ID); LLCoreHttpUtil::HttpCoroutineAdapter::ptr_t - httpAdapter(new LLCoreHttpUtil::HttpCoroutineAdapter("RemoteParcelRequest", httpPolicy)); - LLCore::HttpRequest::ptr_t httpRequest(new LLCore::HttpRequest); + httpAdapter = std::make_shared("RemoteParcelRequest", httpPolicy); + LLCore::HttpRequest::ptr_t httpRequest = std::make_shared(); LLSD bodyData; diff --git a/indra/newview/llscripteditor.cpp b/indra/newview/llscripteditor.cpp index 59cf3ac02b4..2a9dd73936c 100644 --- a/indra/newview/llscripteditor.cpp +++ b/indra/newview/llscripteditor.cpp @@ -45,7 +45,8 @@ LLScriptEditor::Params::Params() LLScriptEditor::LLScriptEditor(const Params& p) : LLTextEditor(p) , mShowLineNumbers(p.show_line_numbers), - mUseDefaultFontSize(p.default_font_size) + mUseDefaultFontSize(p.default_font_size), + mLuauLanguage(false) { if (mShowLineNumbers) { @@ -141,20 +142,24 @@ void LLScriptEditor::drawLineNumbers() } } -void LLScriptEditor::initKeywords() +void LLScriptEditor::initKeywords(bool luau_language) { - mKeywords.initialize(LLSyntaxIdLSL::getInstance()->getKeywordsXML()); + mKeywordsLua.initialize(LLSyntaxLua::getInstance()->getKeywordsXML(), true); + mKeywordsLSL.initialize(LLSyntaxIdLSL::getInstance()->getKeywordsXML(), false); + + mLuauLanguage = luau_language; + } void LLScriptEditor::loadKeywords() { LL_PROFILE_ZONE_SCOPED; - mKeywords.processTokens(); + getKeywords().processTokens(); LLStyleConstSP style = new LLStyle(LLStyle::Params().font(getScriptFont()).color(mDefaultColor.get())); segment_vec_t segment_list; - mKeywords.findSegments(&segment_list, getWText(), *this, style); + getKeywords().findSegments(&segment_list, getWText(), *this, style); mSegments.clear(); segment_set_t::iterator insert_it = mSegments.begin(); @@ -166,7 +171,7 @@ void LLScriptEditor::loadKeywords() void LLScriptEditor::updateSegments() { - if (mReflowIndex < S32_MAX && mKeywords.isLoaded() && mParseOnTheFly) + if (mReflowIndex < S32_MAX && getKeywords().isLoaded() && mParseOnTheFly) { LL_PROFILE_ZONE_SCOPED; @@ -174,7 +179,7 @@ void LLScriptEditor::updateSegments() // HACK: No non-ascii keywords for now segment_vec_t segment_list; - mKeywords.findSegments(&segment_list, getWText(), *this, style); + getKeywords().findSegments(&segment_list, getWText(), *this, style); clearSegments(); for (segment_vec_t::iterator list_it = segment_list.begin(); list_it != segment_list.end(); ++list_it) @@ -194,6 +199,21 @@ void LLScriptEditor::clearSegments() } } +LLKeywords::keyword_iterator_t LLScriptEditor::keywordsBegin() +{ + return getKeywords().begin(); +} + +LLKeywords::keyword_iterator_t LLScriptEditor::keywordsEnd() +{ + return getKeywords().end(); +} + +LLKeywords& LLScriptEditor::getKeywords() +{ + return mLuauLanguage ? mKeywordsLua : mKeywordsLSL; +} + // Most of this is shamelessly copied from LLTextBase void LLScriptEditor::drawSelectionBackground() { @@ -218,7 +238,6 @@ void LLScriptEditor::drawSelectionBackground() ++rect_it) { LLRect selection_rect = *rect_it; - selection_rect = *rect_it; selection_rect.translate(mVisibleTextRect.mLeft - content_display_rect.mLeft, mVisibleTextRect.mBottom - content_display_rect.mBottom); gl_rect_2d(selection_rect, selection_color); } diff --git a/indra/newview/llscripteditor.h b/indra/newview/llscripteditor.h index 1632ebe8341..2d98110f75a 100644 --- a/indra/newview/llscripteditor.h +++ b/indra/newview/llscripteditor.h @@ -41,17 +41,20 @@ class LLScriptEditor : public LLTextEditor Params(); }; - virtual ~LLScriptEditor() {}; + ~LLScriptEditor() override {}; // LLView override - virtual void draw(); - bool postBuild(); + void draw() override; + bool postBuild() override; - void initKeywords(); + void initKeywords(bool luau_language = false); void loadKeywords(); - /* virtual */ void clearSegments(); - LLKeywords::keyword_iterator_t keywordsBegin() { return mKeywords.begin(); } - LLKeywords::keyword_iterator_t keywordsEnd() { return mKeywords.end(); } + void clearSegments(); + LLKeywords::keyword_iterator_t keywordsBegin(); + LLKeywords::keyword_iterator_t keywordsEnd(); + LLKeywords& getKeywords(); + bool getIsLuauLanguage() { return mLuauLanguage; } + void setLuauLanguage(bool luau_language) { mLuauLanguage = luau_language; } static std::string getScriptFontSize(); LLFontGL* getScriptFont(); @@ -63,12 +66,13 @@ class LLScriptEditor : public LLTextEditor private: void drawLineNumbers(); - /* virtual */ void updateSegments(); - /* virtual */ void drawSelectionBackground(); - void loadKeywords(const std::string& filename_keywords, - const std::string& filename_colors); + void updateSegments() override; + void drawSelectionBackground() override; + + LLKeywords mKeywordsLua; + LLKeywords mKeywordsLSL; + bool mLuauLanguage; - LLKeywords mKeywords; bool mShowLineNumbers; bool mUseDefaultFontSize; }; diff --git a/indra/newview/llscripteditorws.cpp b/indra/newview/llscripteditorws.cpp new file mode 100644 index 00000000000..814157e86c2 --- /dev/null +++ b/indra/newview/llscripteditorws.cpp @@ -0,0 +1,830 @@ +/** + * @file llscripteditorws.cpp + * @brief JSON-RPC 2.0 WebSocket server implementation for external script editor integration + * + * $LicenseInfo:firstyear=2025&license=viewerlgpl$ + * Second Life Viewer Source Code + * Copyright (C) 2025, Linden Research, Inc. + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; + * version 2.1 of the License only. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA + * + * Linden Research, Inc., 945 Battery Street, San Francisco, CA 94111 USA + * $/LicenseInfo$ + */ + +#include "llviewerprecompiledheaders.h" +#include "llscripteditorws.h" +#include "llpreviewscript.h" +#include "llappviewer.h" +#include "lltrans.h" +#include "lldate.h" +#include "llerror.h" +#include "lluuid.h" +#include "llversioninfo.h" +#include "llagent.h" +#include "llregex.h" +#include "llviewerobject.h" +#include "llviewerobjectlist.h" +#include "llchat.h" + +//======================================================================== +LLScriptEditorWSServer::LLScriptEditorWSServer(const std::string& name, U16 port, bool local_only) + : LLJSONRPCServer(name, port, local_only) +{ + LL_INFOS("ScriptEditorWS") << "Created JSON-RPC script editor server: " << name + << " on port " << port << LL_ENDL; +} + +LLScriptEditorWSServer::ptr_t LLScriptEditorWSServer::getServer() +{ + if (!LLWebsocketMgr::instanceExists()) + { + return nullptr; + } + LLWebsocketMgr& wsmgr = LLWebsocketMgr::instance(); + return std::static_pointer_cast( + wsmgr.findServerByName(LLScriptEditorWSServer::DEFAULT_SERVER_NAME)); +} + + +LLWebsocketMgr::WSConnection::ptr_t LLScriptEditorWSServer::connectionFactory(LLWebsocketMgr::WSServer::ptr_t server, + LLWebsocketMgr::connection_h handle) +{ + auto connection = std::make_shared(server, handle); + mActiveConnections[connection->getConnectionID()] = connection; + + // Call setupConnectionMethods to register any global methods + setupConnectionMethods(connection); + + return connection; +} + +void LLScriptEditorWSServer::onStarted() +{ + LLSyntaxIdLSL& syntax_id_mgr = LLSyntaxIdLSL::instance(); + wptr_t that(std::static_pointer_cast(shared_from_this())); + + mLastSyntaxId = syntax_id_mgr.getSyntaxID(); + mLanguageChangeSignal = syntax_id_mgr.addSyntaxIDCallback( + [that]() + { + auto server = that.lock(); + if (server && server->isRunning()) + { + server->broadcastLanguageChange(); + } + }); +} + +void LLScriptEditorWSServer::onStopped() +{ + mLanguageChangeSignal.disconnect(); + mLastSyntaxId.setNull(); +} + +void LLScriptEditorWSServer::onConnectionOpened(const LLWebsocketMgr::WSConnection::ptr_t& connection) +{ + // Call parent class to handle JSON-RPC setup and standard methods + LLJSONRPCServer::onConnectionOpened(connection); + + LL_INFOS("ScriptEditorWS") << "New script editor client connected via JSON-RPC" << LL_ENDL; + +} + +void LLScriptEditorWSServer::onConnectionClosed(const LLWebsocketMgr::WSConnection::ptr_t& connection) +{ + // Call parent class to handle JSON-RPC cleanup + LLJSONRPCServer::onConnectionClosed(connection); + + LL_INFOS("ScriptEditorWS") << "Script editor client disconnected" << LL_ENDL; + + // Remove from active connections + auto script_connection = std::dynamic_pointer_cast(connection); + if (script_connection) + { + U32 connection_id = script_connection->getConnectionID(); + unsubscribeConnection(connection_id); + mActiveConnections.erase(connection_id); + + LL_DEBUGS("ScriptEditorWS") << "Removed connection from active connections. Total: " + << mActiveConnections.size() << LL_ENDL; + // TODO: When connections reach 0, stop the server after a timeout. + } +} + +bool LLScriptEditorWSServer::subscribeScriptEditor(const LLUUID& object_id, const LLUUID& item_id, std::string_view script_name, + const LLHandle& editor_handle, const std::string& script_id) +{ + if (!editor_handle.isDead()) + { + auto it = mSubscriptions.find(script_id); + if (it == mSubscriptions.end()) + { // Don't re-add if already subscribed + mSubscriptions.emplace(script_id, + LLScriptEditorWSServer::EditorSubscription(object_id, item_id, script_name, editor_handle)); + return false; + } + else + { // Update existing subscription with new editor handle + it->second.mEditorHandle = editor_handle; + } + return true; + } + return false; +} + +void LLScriptEditorWSServer::unsubscribeEditor(const std::string &script_id) +{ + auto it = mSubscriptions.find(script_id); + if (it != mSubscriptions.end()) + { + S32 connection_id = it->second.mConnectionID; + auto connection = it->second.mConnection.lock(); + mSubscriptions.erase(it); + ptrdiff_t count = std::count_if(mSubscriptions.begin(), mSubscriptions.end(), [connection_id](const auto& pair) { + return pair.second.mConnectionID == connection_id; + }); + if (connection && !count) + { // We have removed the last subscription, close the connection + LL_DEBUGS("ScriptEditorWS") << "Closing connection ID " << connection_id << + " as last subscription was removed" << LL_ENDL; + connection->sendDisconnect(LLScriptEditorWSConnection::REASON_EDITOR_CLOSED, "Editor closed"); + } + + } +} + +void LLScriptEditorWSServer::unsubscribeConnection(U32 connection_id) +{ + for (auto it = mSubscriptions.begin(); it != mSubscriptions.end(); ) + { + if (it->second.mConnectionID == connection_id) + { + LL_DEBUGS("ScriptEditorWS") << "Unsubscribing script " << it->first + << " from connection ID " << connection_id << LL_ENDL; + it = mSubscriptions.erase(it); + } + else + { + ++it; + } + } +} + +LLScriptEditorWSServer::SubscriptionError_t LLScriptEditorWSServer::updateScriptSubscription(const std::string &script_id, U32 connection_id) +{ + auto it = mSubscriptions.find(script_id); + if (it != mSubscriptions.end()) + { + if (it->second.mEditorHandle.isDead()) + { + unsubscribeEditor(script_id); + return SUBSCRIPTION_INVALID_EDITOR; + } + + auto con_it = mActiveConnections.find(connection_id); + if (con_it == mActiveConnections.end()) + { + return SUBSCRIPTION_INTERNAL_ERROR; + } + + if ((it->second.mConnectionID != 0) && !it->second.mConnection.expired() + && it->second.mConnection.lock()->isConnected()) + { + LL_WARNS("ScriptEditorWS") << "Script " << script_id << " is already subscribed on connection ID " << it->second.mConnectionID + << ", cannot subscribe again on connection ID " << connection_id << LL_ENDL; + // In the future we may want to support multiple connections per script. + // That would imply it was open in multiple editors. + return SUBSCRIPTION_ALREADY_SUBSCRIBED; + } + + it->second.mConnectionID = connection_id; + it->second.mConnection = con_it->second; + return SUBSCRIPTION_SUCCESS; + } + return SUBSCRIPTION_INVALID_SUBSCRIPTION; +} + + +LLHandle LLScriptEditorWSServer::findEditorForScript(const std::string& script_id) const +{ + auto it = mSubscriptions.find(script_id); + if (it != mSubscriptions.end()) + { + return it->second.mEditorHandle; + } + return LLHandle(); +} + +std::set LLScriptEditorWSServer::getActiveScripts() const +{ + std::set active_scripts; + for (const auto& [script_id, subinfo] : mSubscriptions) + { + if (!subinfo.mEditorHandle.isDead()) + { + active_scripts.insert(script_id); + } + } + return active_scripts; +} + +void LLScriptEditorWSServer::setupConnectionMethods(LLJSONRPCConnection::ptr_t connection) +{ + // Call parent class to register global JSON-RPC methods + LLJSONRPCServer::setupConnectionMethods(connection); + + // Cast to our specific connection type to access script editor functionality + auto script_connection = std::dynamic_pointer_cast(connection); + if (script_connection) + { + LL_DEBUGS("ScriptEditorWS") << "Setting up script editor connection methods" << LL_ENDL; + wptr_t that(std::static_pointer_cast(shared_from_this())); + + U32 connection_id = script_connection->getConnectionID(); + + script_connection->registerMethod("language.syntax.id", + [that](const std::string&, const LLSD&, const LLSD&) -> LLSD + { + auto server = that.lock(); + if (server) + { + return server->handleLanguageIdRequest(); + } + return LLSD(); + }); + script_connection->registerMethod("language.syntax", + [that](const std::string&, const LLSD&, const LLSD& params) + { + auto server = that.lock(); + if (server) + { + return server->handleSyntaxRequest(params); + } + return LLSD(); + }); + script_connection->registerMethod("script.subscribe", + [that, connection_id](const std::string&, const LLSD&, const LLSD& params) -> LLSD + { + auto server = that.lock(); + if (server) + { + return server->handleScriptSubscribe(connection_id, params); + } + return LLSD(); + }); + script_connection->registerMethod("script.unsubscribe", [](const std::string&, const LLSD&, const LLSD& params) -> LLSD + { // this is a notification, no response expected + return LLSD(); + }); + // script_connection->registerMethod("language.syntax", ) + } +} + +void LLScriptEditorWSServer::broadcastLanguageChange() +{ + LLUUID syntax_id = LLSyntaxIdLSL::instance().getSyntaxID(); + + if (syntax_id != mLastSyntaxId) + { + mLastSyntaxId = syntax_id; + LLSD params; + params["id"] = syntax_id; + + if (isRunning()) + { + broadcastNotification("language.syntax.change", params); + } + } +} + +LLSD LLScriptEditorWSServer::handleLanguageIdRequest() const +{ + LLSD response; + + response["id"] = mLastSyntaxId; + return response; +} + +LLSD LLScriptEditorWSServer::handleSyntaxRequest(const LLSD& params) const +{ + LLSD response(LLSD::emptyMap()); + std::string category = params["kind"].asString(); + + if (category.empty()) + { + response["error"] = "No syntax category specified"; + response["success"] = false; + return response; + } + + response["id"] = mLastSyntaxId; + if (category == "defs.lua") + { + response["defs"] = LLSyntaxLua::instance().getTypesXML(); + response["success"] = response["defs"].isDefined(); + } + else if (category == "defs.lsl") + { + response["defs"] = LLSyntaxIdLSL::instance().getKeywordsXML(); + response["success"] = response["defs"].isDefined(); + } + else + { + response["error"] = "Unknown syntax category requested"; + response["success"] = false; + } + return response; +} + +LLSD LLScriptEditorWSServer::handleScriptSubscribe(U32 connection_id, const LLSD& params) +{ + LLSD response(LLSD::emptyMap()); + + std::string script_id = params["script_id"].asString(); + std::string script_name = params["script_name"].asString(); + std::string language = params["script_language"].asString(); + + SubscriptionError_t result = updateScriptSubscription(script_id, connection_id); + + response["script_id"] = script_id; + response["success"] = (result == SUBSCRIPTION_SUCCESS); + response["status"] = result; + + LL_WARNS_IF(result != SUBSCRIPTION_SUCCESS, "ScriptEditorWS") + << "Script connect request for script " << script_id << " failed with status " << result << LL_ENDL; + switch (result) + { + case SUBSCRIPTION_SUCCESS: + response["message"] = "OK"; + break; + case SUBSCRIPTION_INVALID_EDITOR: + response["message"] = "Invalid editor handle"; + break; + case SUBSCRIPTION_INVALID_SUBSCRIPTION: + response["message"] = "No subscription found for script"; + break; + case SUBSCRIPTION_ALREADY_SUBSCRIBED: + response["message"] = "Script already subscribed"; + break; + case SUBSCRIPTION_INTERNAL_ERROR: + response["message"] = "Internal server error"; + break; + } + + if (result == SUBSCRIPTION_SUCCESS) + { + auto it = mSubscriptions.find(script_id); + if (it != mSubscriptions.end()) + { + LLViewerObject* object = gObjectList.findObject((*it).second.mObjectID); + response["object_id"] = (*it).second.mObjectID; + //response["object_name"] = object ? object->getName() : "Unknown"; + response["item_id"] = (*it).second.mItemID; + } + } + + return response; +} + +LLSD LLScriptEditorWSServer::handleScriptUnsubscribe(U32 connection_id, const LLSD& params) +{ + std::string script_id = params["script_id"].asString(); + + auto it = mSubscriptions.find(script_id); + if (it != mSubscriptions.end() && (it->second.mConnectionID == connection_id)) + { + unsubscribeEditor(script_id); + } + return LLSD(); +} + +void LLScriptEditorWSServer::notifyScript(const std::string& script_id, const std::string &method, const LLSD& message) const +{ + auto it = mSubscriptions.find(script_id); + if (it != mSubscriptions.end()) + { + auto connection = it->second.mConnection.lock(); + if (connection) + { + connection->notify(method, message); + } + } +} + + +void LLScriptEditorWSServer::sendUnsubscribeScriptEditor(const std::string& script_id) +{ + LLSD params; + params["script_id"] = script_id; + + notifyScript(script_id, "script.unsubscribe", params); +} + +void LLScriptEditorWSServer::sendCompileResults(const std::string &script_id, const LLSD &results) const +{ + LLHandle editor_handle = findEditorForScript(script_id); + if (editor_handle.isDead()) + { + return; + } + LLScriptEdContainer* editor = dynamic_cast(editor_handle.get()); + if (!editor) + { + return; + } + LLScriptEdCore* core = editor->getScriptEdCore(); + bool is_lua = core && (core->isLuauLanguage()); + + LLSD params; + params["script_id"] = script_id; + params["success"] = results["compiled"].asBoolean(); + params["running"] = results["is_running"].asBoolean(); + if (results.has("errors")) + { + params["errors"] = LLSD::emptyArray(); + + if (is_lua) + { // lua errors: ":line: message", line is 1-based + const static boost::regex lua_err_regex(R"(^[^:]*:(\d+): (.+)$)"); + + for (const auto& err : llsd::inArray(results["errors"])) + { + boost::smatch match; + LLSD err_entry; + + err_entry["column"] = 0; // TODO: Lua compiler does not provide column info + err_entry["level"] = "ERROR"; + + if (boost::regex_match(err.asString(), match, lua_err_regex)) + { + S32 line_number = std::stoi(match[1].str()); + std::string message = match[2].str(); + + err_entry["row"] = line_number; + err_entry["message"] = message; + } + else + { + err_entry["row"] = 0; + err_entry["message"] = err.asString(); + } + params["errors"].append(err_entry); + } + } + else + { // lsl errors: "(line, column) : SEVERITY : message", line and column are 0-based + static const boost::regex lsl_err_regex(R"(\((\d+), (\d+)\) : ([^:]+) : (.+))"); + + for (const auto& err : llsd::inArray(results["errors"])) + { + boost::smatch match; + LLSD err_entry; + + if (boost::regex_match(err.asString(), match, lsl_err_regex)) + { + S32 line_number = std::stoi(match[1].str()); + S32 col_number = std::stoi(match[2].str()); + std::string severity = match[3].str(); + std::string message = match[4].str(); + + err_entry["row"] = line_number + 1; + err_entry["column"] = col_number + 1; + err_entry["level"] = severity; + err_entry["message"] = message; + err_entry["format"] = "lsl"; + } + else + { + err_entry["row"] = 0; + err_entry["column"] = 0; + err_entry["level"] = "ERROR"; + err_entry["message"] = err.asString(); + err_entry["format"] = "lsl"; + } + params["errors"].append(err_entry); + } + } + } + + notifyScript(script_id, "script.compiled", params); +} + +void LLScriptEditorWSServer::forwardChatToIDE(const LLChat& chat_msg) const +{ + auto it = std::find_if(mSubscriptions.begin(), mSubscriptions.end(), + [&chat_msg](const auto& pair) { return (pair.second.mObjectID == chat_msg.mFromID); }); + + if (it == mSubscriptions.end()) + { // Not a script we are tracking + return; + } + + bool is_error = false; + std::string error_message; + std::string object_name; + std::string script_name; + S32 line_number = 0; + // We have at least one script from this object, we will forward the message to the IDE + // but first we need to see if it is a runtime error + std::vector lines = LLStringUtil::getTokens(chat_msg.mText, "\n"); + // If this is a runtime error, the first line will look like: " [script: