Merge branch 'develop' into nat/edu-channel
commit
23f2631d59
|
|
@ -0,0 +1,11 @@
|
|||
# Replace tabs with spaces
|
||||
1b68f71348ecf3983b76b40d7940da8377f049b7
|
||||
33418a77b716e122da9778869cdbabe97c83ff37
|
||||
# Trim trailing whitespace
|
||||
a0b3021bdcf76859054fda8e30abb3ed47749e83
|
||||
8444cd9562a6a7b755fcb075864e205122354192
|
||||
863c541ce0b2e3e1e566cc88423d3e87aaedb6ca
|
||||
# Wrong line endings
|
||||
1b67dd855c41f5a0cda7ec2a68d98071986ca703
|
||||
6cc7dd09d5e69cf57e6de7fb568a0ad2693f9c9a
|
||||
e2e37cced861b98de8c1a7c9c0d3a50d2d90e433
|
||||
|
|
@ -0,0 +1,38 @@
|
|||
* text eol=lf
|
||||
|
||||
# VSTool (normalization disabled)
|
||||
indra/tools/vstool/* -text
|
||||
|
||||
# Images
|
||||
*.bmp binary
|
||||
*.BMP binary
|
||||
*.gif binary
|
||||
*.icns binary
|
||||
*.ico binary
|
||||
*.j2c binary
|
||||
*.j2k binary
|
||||
*.jpg binary
|
||||
*.png binary
|
||||
*.tga binary
|
||||
*.tif binary
|
||||
|
||||
# Viewer resources
|
||||
*.db2 binary
|
||||
*.llm binary
|
||||
*.nib binary
|
||||
*.rtf binary
|
||||
*.ttf binary
|
||||
|
||||
# Executables
|
||||
*.dll binary
|
||||
*.exe binary
|
||||
|
||||
# Files with Windows line endings
|
||||
VivoxAUP.txt text eol=crlf
|
||||
FILES_ARE_UNICODE_UTF-16LE.txt text eol=crlf
|
||||
|
||||
# Windows Manifest files
|
||||
*.manifest text eol=crlf
|
||||
|
||||
# Windows Installer Script files (normalization disabled)
|
||||
*.nsi -text
|
||||
|
|
@ -11,8 +11,8 @@ body:
|
|||
- type: textarea
|
||||
attributes:
|
||||
label: Environment
|
||||
description: About Second Life Text
|
||||
placeholder: ex. Second Life Test 7.1.3.240191747 (64bit) ...
|
||||
description: "Please copy the info from the viewer's 'About Second Life' window and paste it here:"
|
||||
placeholder: 'ex. Second Life Release 7.1.8.9375512768 (64bit) ...'
|
||||
validations:
|
||||
required: true
|
||||
|
||||
|
|
|
|||
|
|
@ -1,6 +1,6 @@
|
|||
llappearance:
|
||||
- indra/llappearance/**/*
|
||||
|
||||
|
||||
llaudio:
|
||||
- indra/llaudio/**/*
|
||||
|
||||
|
|
@ -76,3 +76,6 @@ c/cpp:
|
|||
- '**/*.i'
|
||||
- '**/*.inl'
|
||||
- '**/*.y'
|
||||
|
||||
'team:viewer':
|
||||
- '*'
|
||||
|
|
|
|||
|
|
@ -1,26 +1,20 @@
|
|||
name: Build
|
||||
|
||||
on:
|
||||
workflow_dispatch:
|
||||
inputs:
|
||||
release_run:
|
||||
type: boolean
|
||||
description: Do a release of this build
|
||||
default: false
|
||||
pull_request:
|
||||
push:
|
||||
branches: ["main", "release/*", "project/*"]
|
||||
tags: ["Second_Life*"]
|
||||
|
||||
jobs:
|
||||
# The whole point of the setvar job is that we want to set a variable once
|
||||
# that will be consumed by multiple subsequent jobs. We tried setting it in
|
||||
# the global env, but a job.env can't directly reference the global env
|
||||
# context.
|
||||
setvar:
|
||||
# The whole point of the setup job is that we want to set variables once
|
||||
# that will be consumed by multiple subsequent jobs.
|
||||
setup:
|
||||
runs-on: ubuntu-latest
|
||||
outputs:
|
||||
release_run: ${{ steps.setvar.outputs.release_run }}
|
||||
configurations: ${{ steps.setvar.outputs.configurations }}
|
||||
bugsplat_db: ${{ steps.setvar.outputs.bugsplat_db }}
|
||||
env:
|
||||
# Build with a tag like "Second_Life#abcdef0" to generate a release page
|
||||
# (used for builds we are planning to deploy).
|
||||
|
|
@ -28,33 +22,36 @@ jobs:
|
|||
# important to ensure it's the empty string when false. If you omit || '',
|
||||
# its value when false is "false", which is interpreted as true.
|
||||
RELEASE_RUN: ${{ (github.event.inputs.release_run || github.ref_type == 'tag' && startsWith(github.ref_name, 'Second_Life')) && 'Y' || '' }}
|
||||
FROM_FORK: ${{ github.event.pull_request.head.repo.fork }}
|
||||
steps:
|
||||
- name: Set Variable
|
||||
- name: Set Variables
|
||||
id: setvar
|
||||
shell: bash
|
||||
run: |
|
||||
echo "release_run=$RELEASE_RUN" >> "$GITHUB_OUTPUT"
|
||||
|
||||
if [[ "$FROM_FORK" == "true" ]]; then
|
||||
# PR from fork; don't build with Bugsplat, proprietary libs
|
||||
echo 'configurations=["ReleaseOS"]' >> $GITHUB_OUTPUT
|
||||
echo "bugsplat_db=" >> $GITHUB_OUTPUT
|
||||
else
|
||||
echo 'configurations=["Release"]' >> $GITHUB_OUTPUT
|
||||
echo "bugsplat_db=SecondLife_Viewer_2018" >> $GITHUB_OUTPUT
|
||||
fi
|
||||
build:
|
||||
needs: setvar
|
||||
needs: setup
|
||||
strategy:
|
||||
matrix:
|
||||
runner: [windows-large, macos-12-xl]
|
||||
configuration: [Release]
|
||||
Linden: [true]
|
||||
include:
|
||||
- runner: macos-12-xl
|
||||
developer_dir: "/Applications/Xcode_14.0.1.app/Contents/Developer"
|
||||
- runner: windows-large
|
||||
configuration: ReleaseOS
|
||||
Linden: false
|
||||
configuration: ${{ fromJSON(needs.setup.outputs.configurations) }}
|
||||
runs-on: ${{ matrix.runner }}
|
||||
outputs:
|
||||
viewer_channel: ${{ steps.build.outputs.viewer_channel }}
|
||||
viewer_version: ${{ steps.build.outputs.viewer_version }}
|
||||
viewer_branch: ${{ steps.which-branch.outputs.branch }}
|
||||
relnotes: ${{ steps.which-branch.outputs.relnotes }}
|
||||
imagename: ${{ steps.build.outputs.imagename }}
|
||||
imagename: ${{ steps.build.outputs.imagename }}
|
||||
configuration: ${{ matrix.configuration }}
|
||||
env:
|
||||
AUTOBUILD_ADDRSIZE: 64
|
||||
AUTOBUILD_BUILD_ID: ${{ github.run_id }}
|
||||
|
|
@ -67,12 +64,9 @@ jobs:
|
|||
# autobuild-package.xml.
|
||||
AUTOBUILD_VCS_INFO: "true"
|
||||
AUTOBUILD_VSVER: "170"
|
||||
DEVELOPER_DIR: ${{ matrix.developer_dir }}
|
||||
DEVELOPER_DIR: "/Applications/Xcode_14.0.1.app/Contents/Developer"
|
||||
# Ensure that Linden viewer builds engage Bugsplat.
|
||||
BUGSPLAT_DB: ${{ matrix.Linden && 'SecondLife_Viewer_2018' || '' }}
|
||||
# Run BUILD steps for Release configuration.
|
||||
# Run BUILD steps for ReleaseOS configuration only for release runs.
|
||||
BUILD: ${{ (matrix.Linden || needs.setvar.outputs.release_run) && 'Y' || '' }}
|
||||
BUGSPLAT_DB: ${{ needs.setup.outputs.bugsplat_db }}
|
||||
build_coverity: false
|
||||
build_log_dir: ${{ github.workspace }}/.logs
|
||||
build_viewer: true
|
||||
|
|
@ -91,19 +85,16 @@ jobs:
|
|||
variants: ${{ matrix.configuration }}
|
||||
steps:
|
||||
- name: Checkout code
|
||||
if: env.BUILD
|
||||
uses: actions/checkout@v4
|
||||
with:
|
||||
ref: ${{ github.event.pull_request.head.sha || github.sha }}
|
||||
|
||||
- name: Setup python
|
||||
if: env.BUILD
|
||||
uses: actions/setup-python@v5
|
||||
with:
|
||||
python-version: "3.11"
|
||||
|
||||
- name: Checkout build variables
|
||||
if: env.BUILD
|
||||
uses: actions/checkout@v4
|
||||
with:
|
||||
repository: secondlife/build-variables
|
||||
|
|
@ -111,19 +102,16 @@ jobs:
|
|||
path: .build-variables
|
||||
|
||||
- name: Checkout master-message-template
|
||||
if: env.BUILD
|
||||
uses: actions/checkout@v4
|
||||
with:
|
||||
repository: secondlife/master-message-template
|
||||
path: .master-message-template
|
||||
|
||||
- name: Install autobuild and python dependencies
|
||||
if: env.BUILD
|
||||
run: pip3 install autobuild llsd
|
||||
|
||||
- name: Cache autobuild packages
|
||||
id: cache-installables
|
||||
if: env.BUILD
|
||||
uses: actions/cache@v4
|
||||
with:
|
||||
path: .autobuild-installables
|
||||
|
|
@ -132,20 +120,14 @@ jobs:
|
|||
${{ runner.os }}-64-${{ matrix.configuration }}-
|
||||
${{ runner.os }}-64-
|
||||
|
||||
- name: Install windows dependencies
|
||||
if: env.BUILD && runner.os == 'Windows'
|
||||
run: choco install nsis-unicode
|
||||
|
||||
- name: Determine source branch
|
||||
id: which-branch
|
||||
if: env.BUILD
|
||||
uses: secondlife/viewer-build-util/which-branch@v2
|
||||
with:
|
||||
token: ${{ github.token }}
|
||||
|
||||
- name: Build
|
||||
id: build
|
||||
if: env.BUILD
|
||||
shell: bash
|
||||
env:
|
||||
AUTOBUILD_VCS_BRANCH: ${{ steps.which-branch.outputs.branch }}
|
||||
|
|
@ -227,6 +209,9 @@ jobs:
|
|||
if [[ "$edu" == "true" ]]
|
||||
then
|
||||
export viewer_channel="Second Life Release edu"
|
||||
elif [[ "$branch" == "develop" ]];
|
||||
then
|
||||
export viewer_channel="Second Life Develop"
|
||||
else
|
||||
branch=$AUTOBUILD_VCS_BRANCH
|
||||
IFS='/' read -ra ba <<< "$branch"
|
||||
|
|
@ -277,7 +262,7 @@ jobs:
|
|||
echo "artifact=$RUNNER_OS$cfg_suffix" >> $GITHUB_OUTPUT
|
||||
|
||||
- name: Upload executable
|
||||
if: matrix.Linden && steps.build.outputs.viewer_app
|
||||
if: steps.build.outputs.viewer_app
|
||||
uses: actions/upload-artifact@v4
|
||||
with:
|
||||
name: "${{ steps.build.outputs.artifact }}-app"
|
||||
|
|
@ -287,15 +272,12 @@ jobs:
|
|||
# The other upload of nontrivial size is the symbol file. Use a distinct
|
||||
# artifact for that too.
|
||||
- name: Upload symbol file
|
||||
if: matrix.Linden
|
||||
uses: actions/upload-artifact@v4
|
||||
with:
|
||||
name: "${{ steps.build.outputs.artifact }}-symbols"
|
||||
path: |
|
||||
${{ steps.build.outputs.symbolfile }}
|
||||
path: ${{ steps.build.outputs.symbolfile }}
|
||||
|
||||
- name: Upload metadata
|
||||
if: matrix.Linden
|
||||
uses: actions/upload-artifact@v4
|
||||
with:
|
||||
name: "${{ steps.build.outputs.artifact }}-metadata"
|
||||
|
|
@ -306,7 +288,7 @@ jobs:
|
|||
- name: Upload physics package
|
||||
uses: actions/upload-artifact@v4
|
||||
# should only be set for viewer-private
|
||||
if: matrix.Linden && steps.build.outputs.physicstpv
|
||||
if: matrix.configuration == 'Release' && steps.build.outputs.physicstpv
|
||||
with:
|
||||
name: "${{ steps.build.outputs.artifact }}-physics"
|
||||
# emitted by build.sh, zero or one lines
|
||||
|
|
@ -382,37 +364,62 @@ jobs:
|
|||
needs: build
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- name: Download viewer exe
|
||||
uses: actions/download-artifact@v4
|
||||
with:
|
||||
name: Windows-app
|
||||
path: _artifacts
|
||||
- name: Download Windows Symbols
|
||||
if: env.BUGSPLAT_USER && env.BUGSPLAT_PASS
|
||||
uses: actions/download-artifact@v4
|
||||
with:
|
||||
name: Windows-symbols
|
||||
- name: Extract viewer pdb
|
||||
if: env.BUGSPLAT_USER && env.BUGSPLAT_PASS
|
||||
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/viewer-build-util/post-bugsplat-windows@v2
|
||||
uses: secondlife-3p/symbol-upload@v10
|
||||
with:
|
||||
username: ${{ env.BUGSPLAT_USER }}
|
||||
password: ${{ env.BUGSPLAT_PASS }}
|
||||
database: "SecondLife_Viewer_2018"
|
||||
channel: ${{ needs.build.outputs.viewer_channel }}
|
||||
application: ${{ needs.build.outputs.viewer_channel }}
|
||||
version: ${{ needs.build.outputs.viewer_version }}
|
||||
directory: _artifacts
|
||||
files: "**/{SecondLifeViewer.exe,llwebrtc.dll,*.pdb}"
|
||||
|
||||
post-mac-symbols:
|
||||
env:
|
||||
BUGSPLAT_USER: ${{ secrets.BUGSPLAT_USER }}
|
||||
BUGSPLAT_PASS: ${{ secrets.BUGSPLAT_PASS }}
|
||||
needs: build
|
||||
if: needs.build.outputs.configuration == 'Release'
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- name: Download Mac Symbols
|
||||
if: env.BUGSPLAT_USER && env.BUGSPLAT_PASS
|
||||
uses: actions/download-artifact@v4
|
||||
with:
|
||||
name: macOS-symbols
|
||||
- name: Post Mac symbols
|
||||
if: env.BUGSPLAT_USER && env.BUGSPLAT_PASS
|
||||
uses: secondlife/viewer-build-util/post-bugsplat-mac@v2
|
||||
uses: secondlife-3p/symbol-upload@v10
|
||||
with:
|
||||
username: ${{ env.BUGSPLAT_USER }}
|
||||
password: ${{ env.BUGSPLAT_PASS }}
|
||||
database: "SecondLife_Viewer_2018"
|
||||
channel: ${{ needs.build.outputs.viewer_channel }}
|
||||
version: ${{ needs.build.outputs.viewer_version }}
|
||||
application: ${{ needs.build.outputs.viewer_channel }}
|
||||
version: ${{ needs.build.outputs.viewer_version }} (${{ needs.build.outputs.viewer_version }})
|
||||
directory: .
|
||||
files: "**/*.xcarchive.zip"
|
||||
|
||||
release:
|
||||
needs: [setvar, build, sign-and-package-windows, sign-and-package-mac]
|
||||
needs: [setup, build, sign-and-package-windows, sign-and-package-mac]
|
||||
runs-on: ubuntu-latest
|
||||
if: needs.setvar.outputs.release_run
|
||||
if: needs.setup.outputs.release_run
|
||||
steps:
|
||||
- uses: actions/download-artifact@v4
|
||||
with:
|
||||
|
|
|
|||
|
|
@ -1,4 +1,4 @@
|
|||
name: Stale PRs
|
||||
name: Stale PRs
|
||||
on:
|
||||
workflow_dispatch:
|
||||
schedule:
|
||||
|
|
|
|||
|
|
@ -0,0 +1,47 @@
|
|||
name: Tag a Build
|
||||
|
||||
on:
|
||||
# schedule event triggers always run on the default branch
|
||||
# https://docs.github.com/en/actions/using-workflows/events-that-trigger-workflows#schedule
|
||||
schedule:
|
||||
# run "nightly" builds on default branch every mon/wed/fri
|
||||
- cron: "21 2 * * 2,4,6" # 2:21am UTC tues/thurs/sat == 7:21pm PDT mon/wed/fri -- see https://crontab.guru/#21_01_*_*_2,4,6
|
||||
workflow_dispatch:
|
||||
inputs:
|
||||
channel:
|
||||
description: "Channel to configure the build"
|
||||
required: true
|
||||
type: choice
|
||||
default: "Test"
|
||||
options:
|
||||
- "Test"
|
||||
- "Develop"
|
||||
- "Project"
|
||||
- "Release"
|
||||
project:
|
||||
description: "Project Name (used for channel name in project builds, and tag name for all builds)"
|
||||
default: "hippo"
|
||||
# TODO - add an input for selecting another sha to build other than head of branch
|
||||
|
||||
jobs:
|
||||
tag-release:
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- name: Setup Env Vars
|
||||
run: |
|
||||
CHANNEL="${{ inputs.channel }}"
|
||||
echo VIEWER_CHANNEL="Second_Life_${CHANNEL:-Develop}" >> ${GITHUB_ENV}
|
||||
NIGHTLY_DATE=$(date --rfc-3339=date)
|
||||
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
|
||||
with:
|
||||
github-token: ${{ secrets.GITHUB_TOKEN }}
|
||||
script: |
|
||||
github.rest.git.createRef({
|
||||
owner: context.repo.owner,
|
||||
repo: context.repo.repo,
|
||||
ref: "refs/tags/${{ env.VIEWER_CHANNEL }}#${{ env.TAG_ID }}",
|
||||
sha: context.sha
|
||||
})
|
||||
|
|
@ -1,5 +1,5 @@
|
|||
repos:
|
||||
- repo: https://github.com/secondlife/git-hooks.git
|
||||
- repo: https://github.com/secondlife/git-hooks.git
|
||||
rev: v1.0.2
|
||||
hooks:
|
||||
- id: opensource-license
|
||||
|
|
@ -16,3 +16,5 @@ repos:
|
|||
hooks:
|
||||
- id: check-xml
|
||||
- id: mixed-line-ending
|
||||
- id: trailing-whitespace
|
||||
files: \.(cpp|c|h|inl|py|glsl|cmake|yaml|sh)$
|
||||
|
|
|
|||
1018
autobuild.xml
1018
autobuild.xml
File diff suppressed because it is too large
Load Diff
38
build.sh
38
build.sh
|
|
@ -146,12 +146,21 @@ pre_build()
|
|||
&& [ -r "$master_message_template_checkout/message_template.msg" ] \
|
||||
&& template_verifier_master_url="-DTEMPLATE_VERIFIER_MASTER_URL=file://$master_message_template_checkout/message_template.msg"
|
||||
|
||||
RELEASE_CRASH_REPORTING=ON
|
||||
HAVOK=ON
|
||||
RELEASE_CRASH_REPORTING=OFF
|
||||
HAVOK=OFF
|
||||
SIGNING=()
|
||||
if [[ "$arch" == "Darwin" && "$variant" == "Release" ]]
|
||||
then SIGNING=("-DENABLE_SIGNING:BOOL=YES" \
|
||||
"-DSIGNING_IDENTITY:STRING=Developer ID Application: Linden Research, Inc.")
|
||||
if [[ "$variant" != *OS ]]
|
||||
then
|
||||
# Proprietary builds
|
||||
|
||||
RELEASE_CRASH_REPORTING=ON
|
||||
HAVOK=ON
|
||||
|
||||
if [[ "$arch" == "Darwin" ]]
|
||||
then
|
||||
SIGNING=("-DENABLE_SIGNING:BOOL=YES" \
|
||||
"-DSIGNING_IDENTITY:STRING=Developer ID Application: Linden Research, Inc.")
|
||||
fi
|
||||
fi
|
||||
|
||||
if [ "${RELEASE_CRASH_REPORTING:-}" != "OFF" ]
|
||||
|
|
@ -170,7 +179,7 @@ pre_build()
|
|||
# This name is consumed by indra/newview/CMakeLists.txt. Make it
|
||||
# absolute because we've had troubles with relative pathnames.
|
||||
abs_build_dir="$(cd "$build_dir"; pwd)"
|
||||
VIEWER_SYMBOL_FILE="$(native_path "$abs_build_dir/newview/$variant/secondlife-symbols-$symplat-${AUTOBUILD_ADDRSIZE}.tar.xz")"
|
||||
VIEWER_SYMBOL_FILE="$(native_path "$abs_build_dir/symbols/$variant/${viewer_channel}.sym.tar.xz")"
|
||||
fi
|
||||
|
||||
# honor autobuild_configure_parameters same as sling-buildscripts
|
||||
|
|
@ -199,14 +208,14 @@ package_llphysicsextensions_tpv()
|
|||
tpv_status=0
|
||||
# nat 2016-12-21: without HAVOK, can't build PhysicsExtensions_TPV.
|
||||
if [ "$variant" = "Release" -a "${HAVOK:-}" != "OFF" ]
|
||||
then
|
||||
then
|
||||
tpvconfig="$build_dir/packages/llphysicsextensions/autobuild-tpv.xml"
|
||||
test -r "$tpvconfig" || fatal "No llphysicsextensions_tpv autobuild configuration found"
|
||||
# SL-19942: autobuild ignores -c switch if AUTOBUILD_CONFIGURATION set
|
||||
unset AUTOBUILD_CONFIGURATION
|
||||
"$autobuild" build --quiet --config-file "$(native_path "$tpvconfig")" -c Tpv \
|
||||
|| fatal "failed to build llphysicsextensions_tpv"
|
||||
|
||||
|
||||
# capture the package file name for use in upload later...
|
||||
PKGTMP=`mktemp -t pgktpv.XXXXXX`
|
||||
cleanup="$cleanup ; rm $PKGTMP* 2>/dev/null"
|
||||
|
|
@ -239,7 +248,7 @@ build()
|
|||
|| fatal "failed building $variant"
|
||||
echo true >"$build_dir"/build_ok
|
||||
end_section "autobuild $variant"
|
||||
|
||||
|
||||
begin_section "extensions $variant"
|
||||
# Run build extensions
|
||||
if [ -d ${build_dir}/packages/build-extensions ]
|
||||
|
|
@ -312,7 +321,7 @@ begin_section "select viewer channel"
|
|||
# Look for a branch-specific viewer_channel setting
|
||||
# changeset_branch is set in the sling-buildscripts
|
||||
viewer_build_branch=$(echo -n "${changeset_branch:-$(repo_branch ${BUILDSCRIPTS_SRC:-$(pwd)})}" | tr -Cs 'A-Za-z0-9_' '_' | sed -E 's/^_+//; s/_+$//')
|
||||
if [ -n "$viewer_build_branch" ]
|
||||
if [ -n "$viewer_build_branch" ]
|
||||
then
|
||||
branch_viewer_channel_var="${viewer_build_branch}_viewer_channel"
|
||||
if [ -n "${!branch_viewer_channel_var}" ]
|
||||
|
|
@ -434,7 +443,7 @@ do
|
|||
record_event "configure for $variant failed: build skipped"
|
||||
fi
|
||||
|
||||
if ! $succeeded
|
||||
if ! $succeeded
|
||||
then
|
||||
record_event "remaining variants skipped due to $variant failure"
|
||||
break
|
||||
|
|
@ -499,7 +508,7 @@ then
|
|||
fi
|
||||
done
|
||||
end_section "Upload Debian Repository"
|
||||
|
||||
|
||||
else
|
||||
record_event "debian build not enabled"
|
||||
fi
|
||||
|
|
@ -526,9 +535,8 @@ then
|
|||
# nat 2016-12-22: without RELEASE_CRASH_REPORTING, we have no symbol file.
|
||||
if [ "${RELEASE_CRASH_REPORTING:-}" != "OFF" ]
|
||||
then
|
||||
# BugSplat wants to see xcarchive.zip
|
||||
# e.g. build-darwin-x86_64/newview/Release/Second Life Test.xcarchive.zip
|
||||
symbol_file="${build_dir}/newview/${variant}/${viewer_channel}.xcarchive.zip"
|
||||
# e.g. build-darwin-x86_64/symbols/Release/Second Life Test.xarchive.zip
|
||||
symbol_file="${build_dir}/symbols/${variant}/${viewer_channel}.xcarchive.zip"
|
||||
if [[ ! -f "$symbol_file" ]]
|
||||
then
|
||||
# symbol tarball we prep for (e.g.) Breakpad
|
||||
|
|
|
|||
|
|
@ -606,6 +606,7 @@ Henri Beauchamp
|
|||
SL-19110
|
||||
SL-19159
|
||||
[NO JIRA] (fullbright HUD alpha fix)
|
||||
secondlife/viewer#1744
|
||||
herina Bode
|
||||
Hikkoshi Sakai
|
||||
VWR-429
|
||||
|
|
@ -1435,6 +1436,30 @@ Sovereign Engineer
|
|||
SL-18534
|
||||
SL-19690
|
||||
SL-19336
|
||||
secondlife/viewer/pull/1283
|
||||
secondlife/viewer/pull/1287
|
||||
secondlife/viewer/pull/1906
|
||||
secondlife/viewer/pull/1930
|
||||
secondlife/viewer/pull/1941
|
||||
secondlife/viewer/pull/1946
|
||||
secondlife/viewer/pull/1948
|
||||
secondlife/viewer/pull/1950
|
||||
secondlife/viewer/pull/1951
|
||||
secondlife/viewer/pull/2066
|
||||
secondlife/viewer/pull/2077
|
||||
secondlife/viewer/pull/2078
|
||||
secondlife/viewer/pull/2080
|
||||
secondlife/viewer/pull/2085
|
||||
secondlife/viewer/pull/2098
|
||||
secondlife/viewer/pull/2099
|
||||
secondlife/viewer/pull/2105
|
||||
secondlife/viewer/pull/2115
|
||||
secondlife/viewer/pull/2116
|
||||
secondlife/viewer/pull/2124
|
||||
secondlife/viewer/pull/2125
|
||||
secondlife/viewer/pull/2135
|
||||
secondlife/viewer/pull/2136
|
||||
secondlife/viewer/pull/2149
|
||||
SpacedOut Frye
|
||||
VWR-34
|
||||
VWR-45
|
||||
|
|
|
|||
|
|
@ -0,0 +1,12 @@
|
|||
# PBR Materials
|
||||
|
||||
## KHR Texture Transforms
|
||||
|
||||
Texture repeats for PBR materials on prims are based on the [KHR\_texture\_transform](https://github.com/KhronosGroup/glTF/tree/main/extensions/2.0/Khronos/KHR_texture_transform) spec, and thus should be expected to behave according to the spec. We currently suport offset, rotation, and scale from the spec. texCoord is not currently supported.
|
||||
|
||||
PBR materials should have approximately correct lighting based on the normal texture:
|
||||
|
||||
- With default texture transforms, assuming the prim or model has correct normals and tangents
|
||||
- With a texture transform applied, especially rotation or negative scale
|
||||
- With a texture animation applied via `llSetTextureAnim`, especially a rotation animation
|
||||
- Note: Texture animations are not guaranteed to loop when a PBR texture transform is applied
|
||||
|
|
@ -1,13 +1,14 @@
|
|||
# PBR Terrain Appearance
|
||||
|
||||
## Tiling
|
||||
## Tiling Without Texture Transforms
|
||||
|
||||
This section assumes the PBR terrain of the current region and adjacent regions have the default texture transforms.
|
||||
|
||||
The southwest corner of a region with PBR materials should exactly match up with the bottom left corner of the material texture(s).
|
||||
|
||||
If two adjacent regions have the same PBR terrain settings, then:
|
||||
If two adjacent regions have the same PBR terrain settings, then there should not be seams between the two regions at their shared border.
|
||||
|
||||
- There should not be seams between the two regions at their shared border
|
||||
- The ground should not suddenly slide beneath the avatar when moving between regions (except due to movement of the avatar, which is not covered by this test plan)
|
||||
The ground should not suddenly slide beneath the avatar when moving between two PBR terrain regions (except due to movement of the avatar, which is not covered by this test plan)
|
||||
|
||||
## Feature Gating
|
||||
|
||||
|
|
@ -35,3 +36,28 @@ Availability of PBR textures varies by machine and graphics setting:
|
|||
### PBR Alpha
|
||||
|
||||
PBR terrain does not support materials with alpha blend or double-sided. In addition, the viewer does not make any guarantees about what will render behind the terrain if alpha is used.
|
||||
|
||||
## PBR Terrain Texture Transforms
|
||||
|
||||
Like PBR materials on prims, PBR terrain repeats are based on the [KHR\_texture\_transform](https://github.com/KhronosGroup/glTF/tree/main/extensions/2.0/Khronos/KHR_texture_transform) spec, and thus should be expected to behave the same way. We currently suport offset, rotation, and scale from the spec. texCoord is not currently supported.
|
||||
|
||||
The southwest corner of a region, at z=0, is the UV origin for all texture coordinates of the whole region. Unless an offset is also applied, scale and rotation of the terrain texture transforms are relative to that point.
|
||||
|
||||
When an avatar faces north and looks down at flat ground, the textures of the materials should appear to face upright, unless a rotation is applied.
|
||||
|
||||
If triplanar mapping is enabled, and an avatar faces an axially-aligned wall, the textures of the materials should appear to face upright, unless a rotation is applied.
|
||||
|
||||
Textures of materials should not appear mirrored.
|
||||
|
||||
When triplanar mapping is enabled, rotations on the axially aligned walls should apply in the same direction as they would on flat ground.
|
||||
|
||||
## PBR Terrain Normal Textures
|
||||
|
||||
This section assumes terrain normal maps are enabled at the current graphics setting.
|
||||
|
||||
PBR terrain should have approximately correct lighting based on the normal texture:
|
||||
|
||||
- When on flat ground
|
||||
- On cliffs, when triplanar mapping is enabled. Lighting will be somewhat less accurate when the cliff face is not axially aligned.
|
||||
- If no Terrain Texture Transform is applied.
|
||||
- If a Terrain Texture Transform is applied, especially for rotation or negative scale.
|
||||
|
|
|
|||
|
|
@ -12,6 +12,10 @@ All tests in this section assume the PBR terrain feature flag is enabled, and th
|
|||
|
||||
### Feature Availability
|
||||
|
||||
These features are related to UI, where the Region/Estate floater is opened to the terrain Tab.
|
||||
|
||||
#### Feature: PBR Terrain
|
||||
|
||||
On the client, the advanced setting `RenderTerrainPBREnabled` is the PBR terrain feature flag.
|
||||
|
||||
The PBR terrain feature flag should be set automatically when logging in/teleporting to a new region.
|
||||
|
|
@ -29,6 +33,26 @@ When the PBR terrain feature flag is enabled:
|
|||
- The "PBR Metallic Roughness" checkbox should be visible
|
||||
- The user should be able to apply PBR terrain or textures to the region, depending on if the "PBR Metallic Roughness" checkbox is checked.
|
||||
|
||||
#### Feature: PBR Terrain Texture Transforms
|
||||
|
||||
On the client, the advanced setting, `RenderTerrainPBRTransformsEnabled` is the PBR terrain texture transform flag. Generally, this feature should not be expected to work correctly unless the PBR terrain feature is also enabled.
|
||||
|
||||
The PBR terrain texture transform flag should be set automatically when logging in/teleporting to a new region.
|
||||
|
||||
- The flag should be enabled on regions where the PBR terrain texture transform feature is enabled
|
||||
- Otherwise the flag should be disabled
|
||||
|
||||
When the PBR terrain texture transform feature is enabled, the UI of the Terrain tab should be overhauled. Availability of features depends on the type of terrain.
|
||||
|
||||
**Known issue:** The Region/Estate floater may have to be closed/reopened a second time in order for the UI overhaul to take effect, after teleporting between regions that do and do not have the feature flag set.
|
||||
|
||||
When "PBR Metallic Roughness" is checked:
|
||||
|
||||
- There should be a way for the user to change the texture transforms for the terrain in the current region
|
||||
- For each of the four swatches, the user can change the scale, offset, and rotation of that swatch. Nonuniform scale is allowed
|
||||
|
||||
When "PBR Metallic Roughness" is unchecked, the controls for texture transforms should be hidden.
|
||||
|
||||
### Current Composition Type
|
||||
|
||||
When the Region/Estate floater is opened to the terrain Tab, the current terrain should be shown in the four swatches, and the "PBR Metallic Roughness" checkbox should be checked or unchecked accordingly.
|
||||
|
|
@ -65,6 +89,12 @@ If saving the terrain fails for any reason, the terrain should not be updated.
|
|||
|
||||
Unlike a viewer without PBR terrain support, the new viewer will no longer treat textures with alpha channels as invalid.
|
||||
|
||||
### Saving PBR Terrain Texture Transforms
|
||||
|
||||
If "PBR Metallic Roughness" checkbox is checked, a user with saving composition permissions should also be allowed to edit and save PBR texture transforms.
|
||||
|
||||
One texture transform may be set for each material swatch. Setting texture transforms for each individual texture on the material is not currently supported.
|
||||
|
||||
## Graphics Features
|
||||
|
||||
Texture terrain with transparency is not permitted to be applied in the viewer.
|
||||
|
|
|
|||
|
|
@ -0,0 +1,48 @@
|
|||
# PBR Terrain Paintmap
|
||||
|
||||
## Introduction/Disclaimer
|
||||
|
||||
As of 2024-08-06, PBR terrain painting is **WIP**. Currently, there is only a client-side terrain paintmap, with no way to directly edit it. This document will explain how to informally explore this feature and compare it to the existing heightmap with noise. In the future, a testing document will be added for PBR terrain painting.
|
||||
|
||||
## Background
|
||||
|
||||
Historically, PBR terrain in a region has several parameters for controlling its composition. These are:
|
||||
|
||||
- The four materials
|
||||
- The elevation of the terrain, which roughly controls the material, with some noise added on top ("heightmap with noise")
|
||||
- Material Elevation Ranges, which control where the materials start and end
|
||||
|
||||
This allows for some coarse control over terrain composition. For example, you can have one corner of the terrain be a sandy beach and the rest of the coastline be rocky. Or you can have the peaks of your mountains be covered with snow. However, artistic control is limited due to the gradient imposed by the material elevation ranges, and the unpredictability of the noise.
|
||||
|
||||
A terrain painting option would allow for more control over the terrain composition. The first step to getting that working is the paintmap.
|
||||
|
||||
## How to activate the local paintmap
|
||||
|
||||
The local paintmap is a good way to assess the quality of the PBR terrain paintmap. By default, the newly created local paintmap inherits its composition (i.e. where the grass and dirt goes) from the existing terrain. This allows for a direct comparison with the terrain heightmap-with-noise shader.
|
||||
|
||||
Activating the local paintmap is similar to [applying local PBR terrain via the debug settings](https://wiki.secondlife.com/wiki/PBR_Terrain#How_to_apply_PBR_Terrain), but with a couple extra steps.
|
||||
|
||||
You will need:
|
||||
|
||||
- Four fullperm PBR material items to copy UUIDs from
|
||||
- A region with a good variation of elevations which showcase the four composition layers (no special permissions needed)
|
||||
|
||||
Open the Debug Settings menu (Advanced > Show Debug Settings) and search for "terrain". The following relevant options are available:
|
||||
|
||||
- LocalTerrainAsset1
|
||||
- LocalTerrainAsset1
|
||||
- LocalTerrainAsset3
|
||||
- LocalTerrainAsset4
|
||||
- LocalTerrainPaintEnabled
|
||||
- TerrainPaintBitDepth
|
||||
- TerrainPaintResolution
|
||||
|
||||
By setting LocalTerrainAsset1, etc to valid material IDs, you will override the terrain to use those materials.
|
||||
|
||||
The next step is to "bake" the terrain into a paintmap (Develop > Terrain > Create Local Paintmap). This will *automatically* set LocalTerrainPaintEnabled to true. **WARNING:** LocalTerrainPaintEnabled will *not* do anything until one of LocalTerrainAsset1, etc is set.
|
||||
|
||||
You are now looking at the same terrain, but rendered as a paintmap.
|
||||
|
||||
To compare the quality of the paintmap version and the heightmap-with-noise version, toggle LocalTerrainPaintEnabled in Debug Settings.
|
||||
|
||||
To change the bit depth and/or resolution of the paintmap, change TerrainPaintBitDepth and TerrainPaintResolution as desired, then "re-bake" the paintmap (Develop > Terrain > Create Local Paintmap).
|
||||
|
|
@ -506,6 +506,13 @@
|
|||
<boolean>false</boolean>
|
||||
</map>
|
||||
|
||||
<key>VoiceSignalingRequest</key>
|
||||
<map>
|
||||
<key>flavor</key>
|
||||
<string>llsd</string>
|
||||
<key>trusted-sender</key>
|
||||
<boolean>false</boolean>
|
||||
</map>
|
||||
<!-- Server to client -->
|
||||
<key>RequiredVoiceVersion</key>
|
||||
<map>
|
||||
|
|
@ -688,6 +695,9 @@
|
|||
|
||||
<key>ProvisionVoiceAccountRequest</key>
|
||||
<boolean>false</boolean>
|
||||
|
||||
<key>VoiceSignalingRequest</key>
|
||||
<boolean>false</boolean>
|
||||
|
||||
<key>RemoteParcelRequest</key>
|
||||
<boolean>false</boolean>
|
||||
|
|
|
|||
|
|
@ -54,6 +54,7 @@ add_subdirectory(${LIBS_OPEN_PREFIX}llmessage)
|
|||
add_subdirectory(${LIBS_OPEN_PREFIX}llprimitive)
|
||||
add_subdirectory(${LIBS_OPEN_PREFIX}llrender)
|
||||
add_subdirectory(${LIBS_OPEN_PREFIX}llfilesystem)
|
||||
add_subdirectory(${LIBS_OPEN_PREFIX}llwebrtc)
|
||||
add_subdirectory(${LIBS_OPEN_PREFIX}llwindow)
|
||||
add_subdirectory(${LIBS_OPEN_PREFIX}llxml)
|
||||
|
||||
|
|
|
|||
|
|
@ -32,6 +32,10 @@ add_compile_definitions( ADDRESS_SIZE=${ADDRESS_SIZE})
|
|||
# -- which we do. Without one or the other, we get a ton of Boost warnings.
|
||||
add_compile_definitions(BOOST_BIND_GLOBAL_PLACEHOLDERS)
|
||||
|
||||
# Force enable SSE2 instructions in GLM per the manual
|
||||
# https://github.com/g-truc/glm/blob/master/manual.md#section2_10
|
||||
add_compile_definitions(GLM_FORCE_DEFAULT_ALIGNED_GENTYPES=1 GLM_FORCE_SSE2=1)
|
||||
|
||||
# Configure crash reporting
|
||||
set(RELEASE_CRASH_REPORTING OFF CACHE BOOL "Enable use of crash reporting in release builds")
|
||||
set(NON_RELEASE_CRASH_REPORTING OFF CACHE BOOL "Enable use of crash reporting in developer builds")
|
||||
|
|
@ -60,9 +64,7 @@ if (WINDOWS)
|
|||
# http://www.cmake.org/pipermail/cmake/2009-September/032143.html
|
||||
string(REPLACE "/Zm1000" " " CMAKE_CXX_FLAGS ${CMAKE_CXX_FLAGS})
|
||||
|
||||
# zlib has assembly-language object files incompatible with SAFESEH
|
||||
add_link_options(/LARGEADDRESSAWARE
|
||||
/SAFESEH:NO
|
||||
/NODEFAULTLIB:LIBCMT
|
||||
/IGNORE:4099)
|
||||
|
||||
|
|
@ -104,10 +106,8 @@ if (WINDOWS)
|
|||
string(REPLACE "/Zi" "/Z7" CMAKE_CXX_FLAGS_RELWITHDEBINFO "${CMAKE_CXX_FLAGS_RELWITHDEBINFO}")
|
||||
endif()
|
||||
|
||||
# workaround for github runner image breakage:
|
||||
# https://github.com/actions/runner-images/issues/10004#issuecomment-2153445161
|
||||
# can be removed after the above issue is resolved and deployed across GHA
|
||||
add_compile_definitions(_DISABLE_CONSTEXPR_MUTEX_CONSTRUCTOR)
|
||||
# Allow use of sprintf etc
|
||||
add_compile_definitions(_CRT_SECURE_NO_WARNINGS)
|
||||
endif (WINDOWS)
|
||||
|
||||
|
||||
|
|
@ -187,6 +187,10 @@ if (LINUX OR DARWIN)
|
|||
|
||||
list(APPEND GCC_WARNINGS -Wno-reorder -Wno-non-virtual-dtor )
|
||||
|
||||
if (CMAKE_CXX_COMPILER_VERSION VERSION_GREATER_EQUAL 13)
|
||||
list(APPEND GCC_WARNINGS -Wno-unused-but-set-variable -Wno-unused-variable )
|
||||
endif()
|
||||
|
||||
add_compile_options(${GCC_WARNINGS})
|
||||
add_compile_options(-m${ADDRESS_SIZE})
|
||||
endif (LINUX OR DARWIN)
|
||||
|
|
|
|||
|
|
@ -18,6 +18,7 @@ if (WINDOWS)
|
|||
${ARCH_PREBUILT_DIRS_RELEASE}/${APR_selector}apr-1.lib
|
||||
${ARCH_PREBUILT_DIRS_RELEASE}/${APR_selector}aprutil-1.lib
|
||||
)
|
||||
target_compile_definitions( ll::apr INTERFACE APR_DECLARE_STATIC=1 APU_DECLARE_STATIC=1 API_DECLARE_STATIC=1)
|
||||
elseif (DARWIN)
|
||||
if (LLCOMMON_LINK_SHARED)
|
||||
set(APR_selector "0.dylib")
|
||||
|
|
@ -28,16 +29,15 @@ elseif (DARWIN)
|
|||
endif (LLCOMMON_LINK_SHARED)
|
||||
|
||||
target_link_libraries( ll::apr INTERFACE
|
||||
libapr-1.${APR_selector}
|
||||
libaprutil-1.${APRUTIL_selector}
|
||||
${ARCH_PREBUILT_DIRS_RELEASE}/libapr-1.${APR_selector}
|
||||
${ARCH_PREBUILT_DIRS_RELEASE}/libaprutil-1.${APR_selector}
|
||||
iconv
|
||||
)
|
||||
else (WINDOWS)
|
||||
else()
|
||||
target_link_libraries( ll::apr INTERFACE
|
||||
apr-1
|
||||
aprutil-1
|
||||
uuid
|
||||
${ARCH_PREBUILT_DIRS_RELEASE}/libapr-1.a
|
||||
${ARCH_PREBUILT_DIRS_RELEASE}/libaprutil-1.a
|
||||
rt
|
||||
)
|
||||
endif (WINDOWS)
|
||||
endif ()
|
||||
target_include_directories( ll::apr SYSTEM INTERFACE ${LIBS_PREBUILT_DIR}/include/apr-1 )
|
||||
|
|
|
|||
|
|
@ -1,4 +1,5 @@
|
|||
# -*- cmake -*-
|
||||
include(Linking)
|
||||
include(Prebuilt)
|
||||
|
||||
include_guard()
|
||||
|
|
@ -9,8 +10,22 @@ use_prebuilt_binary(ogg_vorbis)
|
|||
target_include_directories( ll::vorbis SYSTEM INTERFACE ${LIBS_PREBUILT_DIR}/include )
|
||||
|
||||
if (WINDOWS)
|
||||
target_link_libraries(ll::vorbis INTERFACE ogg_static vorbis_static vorbisenc_static vorbisfile_static )
|
||||
target_link_libraries(ll::vorbis INTERFACE
|
||||
optimized ${ARCH_PREBUILT_DIRS_RELEASE}/libogg.lib
|
||||
debug ${ARCH_PREBUILT_DIRS_DEBUG}/libogg.lib
|
||||
optimized ${ARCH_PREBUILT_DIRS_RELEASE}/libvorbisenc.lib
|
||||
debug ${ARCH_PREBUILT_DIRS_DEBUG}/libvorbisenc.lib
|
||||
optimized ${ARCH_PREBUILT_DIRS_RELEASE}/libvorbisfile.lib
|
||||
debug ${ARCH_PREBUILT_DIRS_DEBUG}/libvorbisfile.lib
|
||||
optimized ${ARCH_PREBUILT_DIRS_RELEASE}/libvorbis.lib
|
||||
debug ${ARCH_PREBUILT_DIRS_DEBUG}/libvorbis.lib
|
||||
)
|
||||
else (WINDOWS)
|
||||
target_link_libraries(ll::vorbis INTERFACE ogg vorbis vorbisenc vorbisfile )
|
||||
target_link_libraries(ll::vorbis INTERFACE
|
||||
${ARCH_PREBUILT_DIRS_RELEASE}/libogg.a
|
||||
${ARCH_PREBUILT_DIRS_RELEASE}/libvorbisenc.a
|
||||
${ARCH_PREBUILT_DIRS_RELEASE}/libvorbisfile.a
|
||||
${ARCH_PREBUILT_DIRS_RELEASE}/libvorbis.a
|
||||
)
|
||||
endif (WINDOWS)
|
||||
|
||||
|
|
|
|||
|
|
@ -24,7 +24,8 @@ if (WINDOWS)
|
|||
libboost_program_options-mt${addrsfx}
|
||||
libboost_regex-mt${addrsfx}
|
||||
libboost_system-mt${addrsfx}
|
||||
libboost_thread-mt${addrsfx})
|
||||
libboost_thread-mt${addrsfx}
|
||||
libboost_url-mt${addrsfx})
|
||||
elseif (LINUX)
|
||||
target_link_libraries( ll::boost INTERFACE
|
||||
boost_context-mt${addrsfx}
|
||||
|
|
@ -34,7 +35,8 @@ elseif (LINUX)
|
|||
boost_regex-mt${addrsfx}
|
||||
boost_signals-mt${addrsfx}
|
||||
boost_system-mt${addrsfx}
|
||||
boost_thread-mt${addrsfx})
|
||||
boost_thread-mt${addrsfx}
|
||||
boost_url-mt${addrsfx})
|
||||
elseif (DARWIN)
|
||||
target_link_libraries( ll::boost INTERFACE
|
||||
boost_context-mt${addrsfx}
|
||||
|
|
@ -43,7 +45,8 @@ elseif (DARWIN)
|
|||
boost_program_options-mt${addrsfx}
|
||||
boost_regex-mt${addrsfx}
|
||||
boost_system-mt${addrsfx}
|
||||
boost_thread-mt${addrsfx})
|
||||
boost_thread-mt${addrsfx}
|
||||
boost_url-mt${addrsfx})
|
||||
endif (WINDOWS)
|
||||
|
||||
if (LINUX)
|
||||
|
|
|
|||
|
|
@ -23,14 +23,11 @@ set(cmake_SOURCE_FILES
|
|||
DragDrop.cmake
|
||||
EXPAT.cmake
|
||||
FindAutobuild.cmake
|
||||
FMODSTUDIO.cmake
|
||||
FreeType.cmake
|
||||
GLEXT.cmake
|
||||
GLH.cmake
|
||||
GoogleMock.cmake
|
||||
Havok.cmake
|
||||
Hunspell.cmake
|
||||
JsonCpp.cmake
|
||||
LLAddBuildTest.cmake
|
||||
LLAppearance.cmake
|
||||
LLAudio.cmake
|
||||
|
|
@ -60,12 +57,11 @@ set(cmake_SOURCE_FILES
|
|||
Tut.cmake
|
||||
UI.cmake
|
||||
UnixInstall.cmake
|
||||
URIPARSER.cmake
|
||||
Variables.cmake
|
||||
ViewerMiscLibs.cmake
|
||||
VisualLeakDetector.cmake
|
||||
LibVLCPlugin.cmake
|
||||
XmlRpcEpi.cmake
|
||||
WebRTC.cmake
|
||||
xxHash.cmake
|
||||
ZLIBNG.cmake
|
||||
)
|
||||
|
|
|
|||
|
|
@ -1,5 +1,6 @@
|
|||
# -*- cmake -*-
|
||||
include(Prebuilt)
|
||||
include(Linking)
|
||||
|
||||
include_guard()
|
||||
add_library( ll::libcurl INTERFACE IMPORTED )
|
||||
|
|
@ -7,8 +8,18 @@ add_library( ll::libcurl INTERFACE IMPORTED )
|
|||
use_system_binary(libcurl)
|
||||
use_prebuilt_binary(curl)
|
||||
if (WINDOWS)
|
||||
target_link_libraries(ll::libcurl INTERFACE libcurl.lib)
|
||||
else (WINDOWS)
|
||||
target_link_libraries(ll::libcurl INTERFACE libcurl.a)
|
||||
endif (WINDOWS)
|
||||
target_link_libraries(ll::libcurl INTERFACE
|
||||
${ARCH_PREBUILT_DIRS_RELEASE}/libcurl.lib
|
||||
ll::openssl
|
||||
ll::nghttp2
|
||||
ll::zlib-ng
|
||||
)
|
||||
else ()
|
||||
target_link_libraries(ll::libcurl INTERFACE
|
||||
${ARCH_PREBUILT_DIRS_RELEASE}/libcurl.a
|
||||
ll::openssl
|
||||
ll::nghttp2
|
||||
ll::zlib-ng
|
||||
)
|
||||
endif ()
|
||||
target_include_directories( ll::libcurl SYSTEM INTERFACE ${LIBS_PREBUILT_DIR}/include)
|
||||
|
|
|
|||
|
|
@ -7,7 +7,6 @@
|
|||
include(CMakeCopyIfDifferent)
|
||||
include(Linking)
|
||||
include(OPENAL)
|
||||
include(FMODSTUDIO)
|
||||
|
||||
# When we copy our dependent libraries, we almost always want to copy them to
|
||||
# both the Release and the RelWithDebInfo staging directories. This has
|
||||
|
|
@ -50,26 +49,17 @@ if(WINDOWS)
|
|||
endif (ADDRESS_SIZE EQUAL 64)
|
||||
|
||||
#*******************************
|
||||
# Misc shared libs
|
||||
# Misc shared libs
|
||||
|
||||
set(release_src_dir "${ARCH_PREBUILT_DIRS_RELEASE}")
|
||||
set(release_files
|
||||
openjp2.dll
|
||||
libapr-1.dll
|
||||
libaprutil-1.dll
|
||||
nghttp2.dll
|
||||
libhunspell.dll
|
||||
uriparser.dll
|
||||
)
|
||||
|
||||
# OpenSSL
|
||||
if(ADDRESS_SIZE EQUAL 64)
|
||||
set(release_files ${release_files} libcrypto-1_1-x64.dll)
|
||||
set(release_files ${release_files} libssl-1_1-x64.dll)
|
||||
else(ADDRESS_SIZE EQUAL 64)
|
||||
set(release_files ${release_files} libcrypto-1_1.dll)
|
||||
set(release_files ${release_files} libssl-1_1.dll)
|
||||
endif(ADDRESS_SIZE EQUAL 64)
|
||||
if(LLCOMMON_LINK_SHARED)
|
||||
set(release_files ${release_files} libapr-1.dll)
|
||||
set(release_files ${release_files} libaprutil-1.dll)
|
||||
endif()
|
||||
|
||||
# Filenames are different for 32/64 bit BugSplat file and we don't
|
||||
# have any control over them so need to branch.
|
||||
|
|
@ -85,12 +75,6 @@ if(WINDOWS)
|
|||
endif(ADDRESS_SIZE EQUAL 32)
|
||||
endif (USE_BUGSPLAT)
|
||||
|
||||
if (TARGET ll::fmodstudio)
|
||||
# fmodL is included for logging, only one should be picked by manifest
|
||||
set(release_files ${release_files} fmodL.dll)
|
||||
set(release_files ${release_files} fmod.dll)
|
||||
endif ()
|
||||
|
||||
if (TARGET ll::openal)
|
||||
list(APPEND release_files openal32.dll alut.dll)
|
||||
endif ()
|
||||
|
|
@ -105,14 +89,27 @@ if(WINDOWS)
|
|||
set(MSVC_VER 120)
|
||||
elseif (MSVC_VERSION GREATER_EQUAL 1910 AND MSVC_VERSION LESS 1920) # Visual Studio 2017
|
||||
set(MSVC_VER 140)
|
||||
set(MSVC_TOOLSET_VER 141)
|
||||
elseif (MSVC_VERSION GREATER_EQUAL 1920 AND MSVC_VERSION LESS 1930) # Visual Studio 2019
|
||||
set(MSVC_VER 140)
|
||||
set(MSVC_TOOLSET_VER 142)
|
||||
elseif (MSVC_VERSION GREATER_EQUAL 1930 AND MSVC_VERSION LESS 1950) # Visual Studio 2022
|
||||
set(MSVC_VER 140)
|
||||
set(MSVC_TOOLSET_VER 143)
|
||||
else (MSVC80)
|
||||
MESSAGE(WARNING "New MSVC_VERSION ${MSVC_VERSION} of MSVC: adapt Copy3rdPartyLibs.cmake")
|
||||
endif (MSVC80)
|
||||
|
||||
if (MSVC_TOOLSET_VER AND DEFINED ENV{VCTOOLSREDISTDIR})
|
||||
if(ADDRESS_SIZE EQUAL 32)
|
||||
set(redist_find_path "$ENV{VCTOOLSREDISTDIR}x86\\Microsoft.VC${MSVC_TOOLSET_VER}.CRT")
|
||||
else(ADDRESS_SIZE EQUAL 32)
|
||||
set(redist_find_path "$ENV{VCTOOLSREDISTDIR}x64\\Microsoft.VC${MSVC_TOOLSET_VER}.CRT")
|
||||
endif(ADDRESS_SIZE EQUAL 32)
|
||||
get_filename_component(redist_path "${redist_find_path}" ABSOLUTE)
|
||||
MESSAGE(STATUS "VC Runtime redist path: ${redist_path}")
|
||||
endif (MSVC_TOOLSET_VER AND DEFINED ENV{VCTOOLSREDISTDIR})
|
||||
|
||||
if(ADDRESS_SIZE EQUAL 32)
|
||||
# this folder contains the 32bit DLLs.. (yes really!)
|
||||
set(registry_find_path "[HKEY_LOCAL_MACHINE\\SYSTEM\\CurrentControlSet\\Control\\Windows;Directory]/SysWOW64")
|
||||
|
|
@ -131,11 +128,23 @@ if(WINDOWS)
|
|||
# Check each of them.
|
||||
foreach(release_msvc_file
|
||||
msvcp${MSVC_VER}.dll
|
||||
msvcp${MSVC_VER}_1.dll
|
||||
msvcp${MSVC_VER}_2.dll
|
||||
msvcp${MSVC_VER}_atomic_wait.dll
|
||||
msvcp${MSVC_VER}_codecvt_ids.dll
|
||||
msvcr${MSVC_VER}.dll
|
||||
vcruntime${MSVC_VER}.dll
|
||||
vcruntime${MSVC_VER}_1.dll
|
||||
vcruntime${MSVC_VER}_threads.dll
|
||||
)
|
||||
if(EXISTS "${registry_path}/${release_msvc_file}")
|
||||
if(redist_path AND EXISTS "${redist_path}/${release_msvc_file}")
|
||||
MESSAGE(STATUS "Copying redist file from ${redist_path}/${release_msvc_file}")
|
||||
to_staging_dirs(
|
||||
${redist_path}
|
||||
third_party_targets
|
||||
${release_msvc_file})
|
||||
elseif(EXISTS "${registry_path}/${release_msvc_file}")
|
||||
MESSAGE(STATUS "Copying redist file from ${registry_path}/${release_msvc_file}")
|
||||
to_staging_dirs(
|
||||
${registry_path}
|
||||
third_party_targets
|
||||
|
|
@ -163,23 +172,20 @@ elseif(DARWIN)
|
|||
)
|
||||
set(release_src_dir "${ARCH_PREBUILT_DIRS_RELEASE}")
|
||||
set(release_files
|
||||
libapr-1.0.dylib
|
||||
libapr-1.dylib
|
||||
libaprutil-1.0.dylib
|
||||
libaprutil-1.dylib
|
||||
${EXPAT_COPY}
|
||||
libhunspell-1.3.0.dylib
|
||||
libndofdev.dylib
|
||||
libnghttp2.dylib
|
||||
libnghttp2.14.dylib
|
||||
liburiparser.dylib
|
||||
liburiparser.1.dylib
|
||||
liburiparser.1.0.27.dylib
|
||||
)
|
||||
|
||||
if (TARGET ll::fmodstudio)
|
||||
set(debug_files ${debug_files} libfmodL.dylib)
|
||||
set(release_files ${release_files} libfmod.dylib)
|
||||
if(LLCOMMON_LINK_SHARED)
|
||||
set(release_files ${release_files}
|
||||
libapr-1.0.dylib
|
||||
libapr-1.dylib
|
||||
libaprutil-1.0.dylib
|
||||
libaprutil-1.dylib
|
||||
)
|
||||
endif()
|
||||
|
||||
if (TARGET ll::openal)
|
||||
list(APPEND release_files libalut.dylib libopenal.dylib)
|
||||
endif ()
|
||||
|
||||
elseif(LINUX)
|
||||
|
|
@ -208,17 +214,13 @@ elseif(LINUX)
|
|||
set(release_src_dir "${ARCH_PREBUILT_DIRS_RELEASE}")
|
||||
# *FIX - figure out what to do with duplicate libalut.so here -brad
|
||||
set(release_files
|
||||
${EXPAT_COPY}
|
||||
)
|
||||
)
|
||||
|
||||
if( USE_AUTOBUILD_3P )
|
||||
list( APPEND release_files
|
||||
libapr-1.so.0
|
||||
libaprutil-1.so.0
|
||||
libatk-1.0.so
|
||||
libfreetype.so.6.6.2
|
||||
libfreetype.so.6
|
||||
libhunspell-1.3.so.0.0.0
|
||||
libopenjp2.so
|
||||
libuuid.so.16
|
||||
libuuid.so.16.0.22
|
||||
|
|
@ -227,12 +229,14 @@ elseif(LINUX)
|
|||
libgmodule-2.0.so
|
||||
libgobject-2.0.so
|
||||
)
|
||||
endif()
|
||||
|
||||
if (TARGET ll::fmodstudio)
|
||||
set(debug_files ${debug_files} "libfmodL.so")
|
||||
set(release_files ${release_files} "libfmod.so")
|
||||
endif ()
|
||||
if(LLCOMMON_LINK_SHARED)
|
||||
set(release_files ${release_files}
|
||||
libapr-1.so.0
|
||||
libaprutil-1.so.0
|
||||
)
|
||||
endif()
|
||||
endif()
|
||||
|
||||
else(WINDOWS)
|
||||
message(STATUS "WARNING: unrecognized platform for staging 3rd party libs, skipping...")
|
||||
|
|
|
|||
|
|
@ -7,14 +7,13 @@ add_library( ll::expat INTERFACE IMPORTED )
|
|||
use_system_binary(expat)
|
||||
use_prebuilt_binary(expat)
|
||||
if (WINDOWS)
|
||||
target_link_libraries( ll::expat INTERFACE libexpatMT )
|
||||
set(EXPAT_COPY libexpatMT.dll)
|
||||
else (WINDOWS)
|
||||
target_link_libraries( ll::expat INTERFACE expat )
|
||||
if (DARWIN)
|
||||
set(EXPAT_COPY libexpat.1.dylib libexpat.dylib)
|
||||
else ()
|
||||
set(EXPAT_COPY libexpat.so.1 libexpat.so)
|
||||
endif ()
|
||||
endif (WINDOWS)
|
||||
target_compile_definitions( ll::expat INTERFACE XML_STATIC=1)
|
||||
target_link_libraries( ll::expat INTERFACE
|
||||
debug ${ARCH_PREBUILT_DIRS_DEBUG}/libexpatd.lib
|
||||
optimized ${ARCH_PREBUILT_DIRS_RELEASE}/libexpat.lib)
|
||||
else ()
|
||||
target_link_libraries( ll::expat INTERFACE
|
||||
debug ${ARCH_PREBUILT_DIRS_DEBUG}/libexpat.a
|
||||
optimized ${ARCH_PREBUILT_DIRS_RELEASE}/libexpat.a)
|
||||
endif ()
|
||||
target_include_directories( ll::expat SYSTEM INTERFACE ${LIBS_PREBUILT_DIR}/include )
|
||||
|
|
|
|||
|
|
@ -1,48 +0,0 @@
|
|||
# -*- cmake -*-
|
||||
|
||||
include_guard()
|
||||
|
||||
# FMODSTUDIO can be set when launching the make using the argument -DUSE_FMODSTUDIO:BOOL=ON
|
||||
# When building using proprietary binaries though (i.e. having access to LL private servers),
|
||||
# we always build with FMODSTUDIO.
|
||||
if (INSTALL_PROPRIETARY)
|
||||
set(USE_FMODSTUDIO ON CACHE BOOL "Using FMODSTUDIO sound library.")
|
||||
endif (INSTALL_PROPRIETARY)
|
||||
|
||||
# ND: To streamline arguments passed, switch from FMODSTUDIO to USE_FMODSTUDIO
|
||||
# To not break all old build scripts convert old arguments but warn about it
|
||||
if(FMODSTUDIO)
|
||||
message( WARNING "Use of the FMODSTUDIO argument is deprecated, please switch to USE_FMODSTUDIO")
|
||||
set(USE_FMODSTUDIO ${FMODSTUDIO})
|
||||
endif()
|
||||
|
||||
if (USE_FMODSTUDIO)
|
||||
add_library( ll::fmodstudio INTERFACE IMPORTED )
|
||||
target_compile_definitions( ll::fmodstudio INTERFACE LL_FMODSTUDIO=1)
|
||||
|
||||
if (FMODSTUDIO_LIBRARY AND FMODSTUDIO_INCLUDE_DIR)
|
||||
# If the path have been specified in the arguments, use that
|
||||
|
||||
target_link_libraries(ll::fmodstudio INTERFACE ${FMODSTUDIO_LIBRARY})
|
||||
target_include_directories( ll::fmodstudio SYSTEM INTERFACE ${FMODSTUDIO_INCLUDE_DIR})
|
||||
else (FMODSTUDIO_LIBRARY AND FMODSTUDIO_INCLUDE_DIR)
|
||||
# If not, we're going to try to get the package listed in autobuild.xml
|
||||
# Note: if you're not using INSTALL_PROPRIETARY, the package URL should be local (file:/// URL)
|
||||
# as accessing the private LL location will fail if you don't have the credential
|
||||
include(Prebuilt)
|
||||
use_prebuilt_binary(fmodstudio)
|
||||
if (WINDOWS)
|
||||
target_link_libraries( ll::fmodstudio INTERFACE fmod_vc)
|
||||
elseif (DARWIN)
|
||||
#despite files being called libfmod.dylib, we are searching for fmod
|
||||
target_link_libraries( ll::fmodstudio INTERFACE fmod)
|
||||
elseif (LINUX)
|
||||
target_link_libraries( ll::fmodstudio INTERFACE fmod)
|
||||
endif (WINDOWS)
|
||||
|
||||
target_include_directories( ll::fmodstudio SYSTEM INTERFACE ${LIBS_PREBUILT_DIR}/include/fmodstudio)
|
||||
endif (FMODSTUDIO_LIBRARY AND FMODSTUDIO_INCLUDE_DIR)
|
||||
else()
|
||||
set( USE_FMODSTUDIO "OFF")
|
||||
endif ()
|
||||
|
||||
|
|
@ -1,5 +1,6 @@
|
|||
# -*- cmake -*-
|
||||
include(Prebuilt)
|
||||
include(Linking)
|
||||
|
||||
include_guard()
|
||||
add_library( ll::freetype INTERFACE IMPORTED )
|
||||
|
|
@ -7,5 +8,10 @@ add_library( ll::freetype INTERFACE IMPORTED )
|
|||
use_system_binary(freetype)
|
||||
use_prebuilt_binary(freetype)
|
||||
target_include_directories( ll::freetype SYSTEM INTERFACE ${LIBS_PREBUILT_DIR}/include/freetype2/)
|
||||
target_link_libraries( ll::freetype INTERFACE freetype )
|
||||
|
||||
if (WINDOWS)
|
||||
target_link_libraries( ll::freetype INTERFACE ${ARCH_PREBUILT_DIRS_RELEASE}/freetype.lib)
|
||||
else()
|
||||
target_link_libraries( ll::freetype INTERFACE ${ARCH_PREBUILT_DIRS_RELEASE}/libfreetype.a)
|
||||
endif()
|
||||
|
||||
|
|
|
|||
|
|
@ -0,0 +1,7 @@
|
|||
# -*- cmake -*-
|
||||
include(Prebuilt)
|
||||
|
||||
add_library( ll::glm INTERFACE IMPORTED )
|
||||
|
||||
use_system_binary( glm )
|
||||
use_prebuilt_binary(glm)
|
||||
|
|
@ -1,32 +0,0 @@
|
|||
# -*- cmake -*-
|
||||
include(Prebuilt)
|
||||
include(Linking)
|
||||
|
||||
include_guard()
|
||||
|
||||
add_library( ll::googlemock INTERFACE IMPORTED )
|
||||
if(USE_CONAN)
|
||||
target_link_libraries( ll::googlemock INTERFACE CONAN_PKG::gtest )
|
||||
|
||||
#Not very nice, but for the moment we need this for tut.hpp
|
||||
target_include_directories( ll::googlemock SYSTEM INTERFACE ${LIBS_PREBUILT_DIR}/include )
|
||||
return()
|
||||
endif()
|
||||
|
||||
use_prebuilt_binary(googlemock)
|
||||
|
||||
target_include_directories( ll::googlemock SYSTEM INTERFACE ${LIBS_PREBUILT_DIR}/include )
|
||||
|
||||
if (LINUX)
|
||||
# VWR-24366: gmock is underlinked, it needs gtest.
|
||||
target_link_libraries( ll::googlemock INTERFACE gmock gtest)
|
||||
elseif(WINDOWS)
|
||||
target_link_libraries( ll::googlemock INTERFACE gmock)
|
||||
target_include_directories( ll::googlemock SYSTEM INTERFACE
|
||||
${LIBS_PREBUILT_DIR}/include
|
||||
${LIBS_PREBUILT_DIR}/include/gmock)
|
||||
elseif(DARWIN)
|
||||
target_link_libraries( ll::googlemock INTERFACE gmock gtest)
|
||||
endif(LINUX)
|
||||
|
||||
|
||||
|
|
@ -1,4 +1,5 @@
|
|||
# -*- cmake -*-
|
||||
include(Linking)
|
||||
include(Prebuilt)
|
||||
|
||||
include_guard()
|
||||
|
|
@ -8,10 +9,16 @@ add_library( ll::hunspell INTERFACE IMPORTED )
|
|||
use_system_binary(hunspell)
|
||||
use_prebuilt_binary(libhunspell)
|
||||
if (WINDOWS)
|
||||
target_link_libraries( ll::hunspell INTERFACE libhunspell)
|
||||
target_compile_definitions( ll::hunspell INTERFACE HUNSPELL_STATIC=1)
|
||||
target_link_libraries( ll::hunspell INTERFACE
|
||||
debug ${ARCH_PREBUILT_DIRS_DEBUG}/libhunspell.lib
|
||||
optimized ${ARCH_PREBUILT_DIRS_RELEASE}/libhunspell.lib
|
||||
)
|
||||
elseif(DARWIN)
|
||||
target_link_libraries( ll::hunspell INTERFACE hunspell-1.3)
|
||||
target_link_libraries( ll::hunspell INTERFACE ${ARCH_PREBUILT_DIRS_RELEASE}/libhunspell-1.7.a
|
||||
)
|
||||
elseif(LINUX)
|
||||
target_link_libraries( ll::hunspell INTERFACE hunspell-1.3)
|
||||
target_link_libraries( ll::hunspell INTERFACE ${ARCH_PREBUILT_DIRS_RELEASE}/libhunspell-1.7.a
|
||||
)
|
||||
endif()
|
||||
target_include_directories( ll::hunspell SYSTEM INTERFACE ${LIBS_PREBUILT_DIR}/include/hunspell)
|
||||
|
|
|
|||
|
|
@ -7,12 +7,14 @@ include_guard()
|
|||
add_library( ll::libjpeg INTERFACE IMPORTED )
|
||||
|
||||
use_system_binary(libjpeg)
|
||||
use_prebuilt_binary(jpeglib)
|
||||
use_prebuilt_binary(libjpeg-turbo)
|
||||
if (LINUX)
|
||||
target_link_libraries( ll::libjpeg INTERFACE jpeg)
|
||||
target_link_libraries( ll::libjpeg INTERFACE ${ARCH_PREBUILT_DIRS_RELEASE}/libjpeg.a)
|
||||
elseif (DARWIN)
|
||||
target_link_libraries( ll::libjpeg INTERFACE jpeg)
|
||||
target_link_libraries( ll::libjpeg INTERFACE ${ARCH_PREBUILT_DIRS_RELEASE}/libjpeg.a)
|
||||
elseif (WINDOWS)
|
||||
target_link_libraries( ll::libjpeg INTERFACE jpeglib)
|
||||
target_link_libraries( ll::libjpeg INTERFACE
|
||||
debug ${ARCH_PREBUILT_DIRS_DEBUG}/jpeg.lib
|
||||
optimized ${ARCH_PREBUILT_DIRS_RELEASE}/jpeg.lib)
|
||||
endif (LINUX)
|
||||
target_include_directories( ll::libjpeg SYSTEM INTERFACE ${LIBS_PREBUILT_DIR}/include)
|
||||
|
|
|
|||
|
|
@ -1,17 +0,0 @@
|
|||
# -*- cmake -*-
|
||||
|
||||
include(Prebuilt)
|
||||
include_guard()
|
||||
add_library( ll::jsoncpp INTERFACE IMPORTED )
|
||||
|
||||
use_system_binary(jsoncpp)
|
||||
|
||||
use_prebuilt_binary(jsoncpp)
|
||||
if (WINDOWS)
|
||||
target_link_libraries( ll::jsoncpp INTERFACE json_libmd.lib )
|
||||
elseif (DARWIN)
|
||||
target_link_libraries( ll::jsoncpp INTERFACE libjson_darwin_libmt.a )
|
||||
elseif (LINUX)
|
||||
target_link_libraries( ll::jsoncpp INTERFACE libjson_linux-gcc-4.1.3_libmt.a )
|
||||
endif (WINDOWS)
|
||||
target_include_directories( ll::jsoncpp SYSTEM INTERFACE ${LIBS_PREBUILT_DIR}/include)
|
||||
|
|
@ -1,7 +1,6 @@
|
|||
# -*- cmake -*-
|
||||
include(00-Common)
|
||||
include(LLTestCommand)
|
||||
include(GoogleMock)
|
||||
include(bugsplat)
|
||||
include(Tut)
|
||||
|
||||
|
|
@ -19,10 +18,6 @@ MACRO(LL_ADD_PROJECT_UNIT_TESTS project sources)
|
|||
#
|
||||
# More info and examples at: https://wiki.secondlife.com/wiki/How_to_add_unit_tests_to_indra_code
|
||||
|
||||
# This here looks weird, but is needed. It will inject GoogleMock into projects that forgot to include `this` (LLAddBuildTest.cmake)
|
||||
# But through some other means have access to this macro
|
||||
include(GoogleMock)
|
||||
|
||||
if(LL_TEST_VERBOSE)
|
||||
message("LL_ADD_PROJECT_UNIT_TESTS UNITTEST_PROJECT_${project} sources: ${sources}")
|
||||
endif()
|
||||
|
|
@ -41,7 +36,6 @@ MACRO(LL_ADD_PROJECT_UNIT_TESTS project sources)
|
|||
|
||||
set(alltest_LIBRARIES
|
||||
llcommon
|
||||
ll::googlemock
|
||||
)
|
||||
if(NOT "${project}" STREQUAL "llmath")
|
||||
# add llmath as a dep unless the tested module *is* llmath!
|
||||
|
|
@ -204,7 +198,6 @@ FUNCTION(LL_ADD_INTEGRATION_TEST
|
|||
|
||||
set(libraries
|
||||
${library_dependencies}
|
||||
ll::googlemock
|
||||
)
|
||||
|
||||
# Add test executable build target
|
||||
|
|
|
|||
|
|
@ -6,6 +6,3 @@ include(EXPAT)
|
|||
include(Tracy)
|
||||
include(xxHash)
|
||||
include(ZLIBNG)
|
||||
include(JsonCpp)
|
||||
|
||||
include(XmlRpcEpi)
|
||||
|
|
|
|||
|
|
@ -2,11 +2,11 @@
|
|||
|
||||
# these should be moved to their own cmake file
|
||||
include(Prebuilt)
|
||||
include(Linking)
|
||||
include(Boost)
|
||||
|
||||
include_guard()
|
||||
|
||||
add_library( ll::pcre INTERFACE IMPORTED )
|
||||
add_library( ll::minizip-ng INTERFACE IMPORTED )
|
||||
add_library( ll::libxml INTERFACE IMPORTED )
|
||||
add_library( ll::colladadom INTERFACE IMPORTED )
|
||||
|
|
@ -22,21 +22,18 @@ use_system_binary( colladadom )
|
|||
|
||||
use_prebuilt_binary(colladadom)
|
||||
use_prebuilt_binary(minizip-ng) # needed for colladadom
|
||||
use_prebuilt_binary(pcre)
|
||||
use_prebuilt_binary(libxml2)
|
||||
|
||||
target_link_libraries( ll::pcre INTERFACE pcrecpp pcre )
|
||||
|
||||
if (WINDOWS)
|
||||
target_link_libraries( ll::minizip-ng INTERFACE libminizip )
|
||||
target_link_libraries( ll::minizip-ng INTERFACE ${ARCH_PREBUILT_DIRS_RELEASE}/minizip.lib )
|
||||
else()
|
||||
target_link_libraries( ll::minizip-ng INTERFACE minizip )
|
||||
target_link_libraries( ll::minizip-ng INTERFACE ${ARCH_PREBUILT_DIRS_RELEASE}/libminizip.a )
|
||||
endif()
|
||||
|
||||
if (WINDOWS)
|
||||
target_link_libraries( ll::libxml INTERFACE libxml2_a)
|
||||
target_link_libraries( ll::libxml INTERFACE ${ARCH_PREBUILT_DIRS_RELEASE}/libxml2.lib Bcrypt.lib)
|
||||
else()
|
||||
target_link_libraries( ll::libxml INTERFACE xml2)
|
||||
target_link_libraries( ll::libxml INTERFACE ${ARCH_PREBUILT_DIRS_RELEASE}/libxml2.a)
|
||||
endif()
|
||||
|
||||
target_include_directories( ll::colladadom SYSTEM INTERFACE
|
||||
|
|
@ -44,9 +41,9 @@ target_include_directories( ll::colladadom SYSTEM INTERFACE
|
|||
${LIBS_PREBUILT_DIR}/include/collada/1.4
|
||||
)
|
||||
if (WINDOWS)
|
||||
target_link_libraries(ll::colladadom INTERFACE libcollada14dom23-s ll::libxml ll::minizip-ng )
|
||||
target_link_libraries(ll::colladadom INTERFACE ${ARCH_PREBUILT_DIRS_RELEASE}/libcollada14dom23-s.lib ll::libxml ll::minizip-ng )
|
||||
elseif (DARWIN)
|
||||
target_link_libraries(ll::colladadom INTERFACE collada14dom ll::libxml ll::minizip-ng)
|
||||
target_link_libraries(ll::colladadom INTERFACE collada14dom ll::boost ll::libxml ll::minizip-ng)
|
||||
elseif (LINUX)
|
||||
target_link_libraries(ll::colladadom INTERFACE collada14dom ll::libxml ll::minizip-ng)
|
||||
target_link_libraries(ll::colladadom INTERFACE collada14dom ll::boost ll::libxml ll::minizip-ng)
|
||||
endif()
|
||||
|
|
|
|||
|
|
@ -19,6 +19,7 @@ if (WINDOWS OR DARWIN )
|
|||
endif()
|
||||
else()
|
||||
set(SHARED_LIB_STAGING_DIR ${CMAKE_BINARY_DIR}/sharedlibs/$<IF:$<BOOL:${LL_GENERATOR_IS_MULTI_CONFIG}>,$<CONFIG>,>)
|
||||
set(SYMBOLS_STAGING_DIR ${CMAKE_BINARY_DIR}/symbols/$<IF:$<BOOL:${LL_GENERATOR_IS_MULTI_CONFIG}>,$<CONFIG>,>/${VIEWER_CHANNEL})
|
||||
endif()
|
||||
|
||||
if( DARWIN )
|
||||
|
|
|
|||
|
|
@ -8,9 +8,7 @@ use_system_binary(nghttp2)
|
|||
use_prebuilt_binary(nghttp2)
|
||||
if (WINDOWS)
|
||||
target_link_libraries( ll::nghttp2 INTERFACE ${ARCH_PREBUILT_DIRS_RELEASE}/nghttp2.lib)
|
||||
elseif (DARWIN)
|
||||
target_link_libraries( ll::nghttp2 INTERFACE libnghttp2.dylib)
|
||||
else (WINDOWS)
|
||||
target_link_libraries( ll::nghttp2 INTERFACE libnghttp2.a )
|
||||
endif (WINDOWS)
|
||||
else ()
|
||||
target_link_libraries( ll::nghttp2 INTERFACE ${ARCH_PREBUILT_DIRS_RELEASE}/libnghttp2.a)
|
||||
endif ()
|
||||
target_include_directories( ll::nghttp2 SYSTEM INTERFACE ${LIBS_PREBUILT_DIR}/include/nghttp2)
|
||||
|
|
|
|||
|
|
@ -33,6 +33,9 @@ if (USE_OPENAL)
|
|||
alut
|
||||
)
|
||||
else()
|
||||
message(FATAL_ERROR "OpenAL is not available for this platform")
|
||||
target_link_libraries( ll::openal INTERFACE
|
||||
openal
|
||||
alut
|
||||
)
|
||||
endif()
|
||||
endif ()
|
||||
|
|
|
|||
|
|
@ -1,5 +1,6 @@
|
|||
# -*- cmake -*-
|
||||
include(Prebuilt)
|
||||
include(Linking)
|
||||
|
||||
include_guard()
|
||||
add_library( ll::openssl INTERFACE IMPORTED )
|
||||
|
|
@ -7,9 +8,9 @@ add_library( ll::openssl INTERFACE IMPORTED )
|
|||
use_system_binary(openssl)
|
||||
use_prebuilt_binary(openssl)
|
||||
if (WINDOWS)
|
||||
target_link_libraries(ll::openssl INTERFACE libssl libcrypto)
|
||||
target_link_libraries(ll::openssl INTERFACE ${ARCH_PREBUILT_DIRS_RELEASE}/libssl.lib ${ARCH_PREBUILT_DIRS_RELEASE}/libcrypto.lib Crypt32.lib)
|
||||
elseif (LINUX)
|
||||
target_link_libraries(ll::openssl INTERFACE ssl crypto dl)
|
||||
target_link_libraries(ll::openssl INTERFACE ${ARCH_PREBUILT_DIRS_RELEASE}/libssl.a ${ARCH_PREBUILT_DIRS_RELEASE}/libcrypto.a dl)
|
||||
else()
|
||||
target_link_libraries(ll::openssl INTERFACE ssl crypto)
|
||||
endif (WINDOWS)
|
||||
|
|
|
|||
|
|
@ -7,8 +7,8 @@ add_library( ll::libpng INTERFACE IMPORTED )
|
|||
use_system_binary(libpng)
|
||||
use_prebuilt_binary(libpng)
|
||||
if (WINDOWS)
|
||||
target_link_libraries(ll::libpng INTERFACE libpng16)
|
||||
target_link_libraries(ll::libpng INTERFACE ${ARCH_PREBUILT_DIRS_RELEASE}/libpng16.lib)
|
||||
else()
|
||||
target_link_libraries(ll::libpng INTERFACE png16 )
|
||||
target_link_libraries(ll::libpng INTERFACE ${ARCH_PREBUILT_DIRS_RELEASE}/libpng16.a)
|
||||
endif()
|
||||
target_include_directories( ll::libpng SYSTEM INTERFACE ${LIBS_PREBUILT_DIR}/include/libpng16)
|
||||
|
|
|
|||
|
|
@ -3,5 +3,5 @@ include(Prebuilt)
|
|||
|
||||
use_prebuilt_binary(tinyexr)
|
||||
|
||||
set(TINYEXR_INCLUDE_DIR ${LIBS_PREBUILT_DIR}/include/tinyexr)
|
||||
set(TINYEXR_INCLUDE_DIR ${LIBS_PREBUILT_DIR}/include/tinyexr)
|
||||
|
||||
|
|
|
|||
|
|
@ -1,19 +0,0 @@
|
|||
# -*- cmake -*-
|
||||
|
||||
include_guard()
|
||||
|
||||
include(Prebuilt)
|
||||
|
||||
add_library( ll::uriparser INTERFACE IMPORTED )
|
||||
|
||||
use_system_binary( uriparser )
|
||||
|
||||
use_prebuilt_binary(uriparser)
|
||||
if (WINDOWS)
|
||||
target_link_libraries( ll::uriparser INTERFACE uriparser)
|
||||
elseif (LINUX)
|
||||
target_link_libraries( ll::uriparser INTERFACE uriparser)
|
||||
elseif (DARWIN)
|
||||
target_link_libraries( ll::uriparser INTERFACE liburiparser.dylib)
|
||||
endif (WINDOWS)
|
||||
target_include_directories( ll::uriparser SYSTEM INTERFACE ${LIBS_PREBUILT_DIR}/include/uriparser)
|
||||
|
|
@ -5,7 +5,7 @@
|
|||
#
|
||||
# Platform variables:
|
||||
#
|
||||
# DARWIN - Mac OS X
|
||||
# DARWIN - macOS
|
||||
# LINUX - Linux
|
||||
# WINDOWS - Windows
|
||||
|
||||
|
|
|
|||
|
|
@ -0,0 +1,32 @@
|
|||
# -*- cmake -*-
|
||||
include(Linking)
|
||||
include(Prebuilt)
|
||||
|
||||
include_guard()
|
||||
|
||||
add_library( ll::webrtc INTERFACE IMPORTED )
|
||||
target_include_directories( ll::webrtc SYSTEM INTERFACE "${LIBS_PREBUILT_DIR}/include/webrtc" "${LIBS_PREBUILT_DIR}/include/webrtc/third_party/abseil-cpp")
|
||||
use_prebuilt_binary(webrtc)
|
||||
|
||||
if (WINDOWS)
|
||||
target_link_libraries( ll::webrtc INTERFACE webrtc.lib )
|
||||
elseif (DARWIN)
|
||||
FIND_LIBRARY(COREAUDIO_LIBRARY CoreAudio)
|
||||
FIND_LIBRARY(COREGRAPHICS_LIBRARY CoreGraphics)
|
||||
FIND_LIBRARY(AUDIOTOOLBOX_LIBRARY AudioToolbox)
|
||||
FIND_LIBRARY(COREFOUNDATION_LIBRARY CoreFoundation)
|
||||
FIND_LIBRARY(COCOA_LIBRARY Cocoa)
|
||||
|
||||
target_link_libraries( ll::webrtc INTERFACE
|
||||
libwebrtc.a
|
||||
${COREAUDIO_LIBRARY}
|
||||
${AUDIOTOOLBOX_LIBRARY}
|
||||
${COREGRAPHICS_LIBRARY}
|
||||
${COREFOUNDATION_LIBRARY}
|
||||
${COCOA_LIBRARY}
|
||||
)
|
||||
elseif (LINUX)
|
||||
target_link_libraries( ll::webrtc INTERFACE libwebrtc.a X11 )
|
||||
endif (WINDOWS)
|
||||
|
||||
|
||||
|
|
@ -1,11 +0,0 @@
|
|||
# -*- cmake -*-
|
||||
include(Prebuilt)
|
||||
|
||||
include_guard()
|
||||
add_library( ll::xmlrpc-epi INTERFACE IMPORTED )
|
||||
|
||||
use_system_binary( xmlrpc-epi )
|
||||
|
||||
use_prebuilt_binary(xmlrpc-epi)
|
||||
target_link_libraries(ll::xmlrpc-epi INTERFACE xmlrpc-epi )
|
||||
target_include_directories( ll::xmlrpc-epi SYSTEM INTERFACE ${LIBS_PREBUILT_DIR}/include)
|
||||
|
|
@ -12,9 +12,9 @@ endif()
|
|||
|
||||
use_prebuilt_binary(zlib-ng)
|
||||
if (WINDOWS)
|
||||
target_link_libraries( ll::zlib-ng INTERFACE zlib )
|
||||
target_link_libraries( ll::zlib-ng INTERFACE ${ARCH_PREBUILT_DIRS_RELEASE}/zlib.lib )
|
||||
else()
|
||||
target_link_libraries( ll::zlib-ng INTERFACE z )
|
||||
target_link_libraries( ll::zlib-ng INTERFACE ${ARCH_PREBUILT_DIRS_RELEASE}/libz.a )
|
||||
endif (WINDOWS)
|
||||
|
||||
if( NOT LINUX )
|
||||
|
|
|
|||
|
|
@ -116,7 +116,7 @@ BASE_ARGUMENTS=[
|
|||
dict(name='build', description='Build directory.', default=DEFAULT_SRCTREE),
|
||||
dict(name='buildtype', description='Build type (i.e. Debug, Release, RelWithDebInfo).', default=None),
|
||||
dict(name='bundleid',
|
||||
description="""The Mac OS X Bundle identifier.""",
|
||||
description="""The macOS Bundle identifier.""",
|
||||
default="com.secondlife.indra.viewer"),
|
||||
dict(name='channel',
|
||||
description="""The channel to use for updates, packaging, settings name, etc.""",
|
||||
|
|
@ -146,7 +146,7 @@ BASE_ARGUMENTS=[
|
|||
dict(name='signature',
|
||||
description="""This specifies an identity to sign the viewer with, if any.
|
||||
If no value is supplied, the default signature will be used, if any. Currently
|
||||
only used on Mac OS X.""",
|
||||
only used on macOS.""",
|
||||
default=None),
|
||||
dict(name='source',
|
||||
description='Source directory.',
|
||||
|
|
|
|||
|
|
@ -64,19 +64,19 @@ class LLAvatarBoneInfo
|
|||
friend class LLAvatarAppearance;
|
||||
friend class LLAvatarSkeletonInfo;
|
||||
public:
|
||||
LLAvatarBoneInfo() : mIsJoint(FALSE) {}
|
||||
LLAvatarBoneInfo() : mIsJoint(false) {}
|
||||
~LLAvatarBoneInfo()
|
||||
{
|
||||
std::for_each(mChildren.begin(), mChildren.end(), DeletePointer());
|
||||
mChildren.clear();
|
||||
}
|
||||
BOOL parseXml(LLXmlTreeNode* node);
|
||||
bool parseXml(LLXmlTreeNode* node);
|
||||
|
||||
private:
|
||||
std::string mName;
|
||||
std::string mSupport;
|
||||
std::string mAliases;
|
||||
BOOL mIsJoint;
|
||||
bool mIsJoint;
|
||||
LLVector3 mPos;
|
||||
LLVector3 mEnd;
|
||||
LLVector3 mRot;
|
||||
|
|
@ -101,7 +101,7 @@ public:
|
|||
std::for_each(mBoneInfoList.begin(), mBoneInfoList.end(), DeletePointer());
|
||||
mBoneInfoList.clear();
|
||||
}
|
||||
BOOL parseXml(LLXmlTreeNode* node);
|
||||
bool parseXml(LLXmlTreeNode* node);
|
||||
S32 getNumBones() const { return mNumBones; }
|
||||
S32 getNumCollisionVolumes() const { return mNumCollisionVolumes; }
|
||||
|
||||
|
|
@ -164,19 +164,7 @@ LLAvatarAppearanceDefines::LLAvatarAppearanceDictionary* LLAvatarAppearance::sAv
|
|||
|
||||
LLAvatarAppearance::LLAvatarAppearance(LLWearableData* wearable_data) :
|
||||
LLCharacter(),
|
||||
mIsDummy(FALSE),
|
||||
mTexSkinColor( NULL ),
|
||||
mTexHairColor( NULL ),
|
||||
mTexEyeColor( NULL ),
|
||||
mPelvisToFoot(0.f),
|
||||
mHeadOffset(),
|
||||
mRoot(NULL),
|
||||
mWearableData(wearable_data),
|
||||
mNumBones(0),
|
||||
mNumCollisionVolumes(0),
|
||||
mCollisionVolumes(NULL),
|
||||
mIsBuilt(FALSE),
|
||||
mInitFlags(0)
|
||||
mWearableData(wearable_data)
|
||||
{
|
||||
llassert_always(mWearableData);
|
||||
mBakedTextureDatas.resize(LLAvatarAppearanceDefines::BAKED_NUM_INDICES);
|
||||
|
|
@ -222,14 +210,14 @@ void LLAvatarAppearance::initInstance()
|
|||
mesh->setName(mesh_name);
|
||||
mesh->setMeshID(mesh_index);
|
||||
mesh->setPickName(mesh_dict->mPickName);
|
||||
mesh->setIsTransparent(FALSE);
|
||||
mesh->setIsTransparent(false);
|
||||
switch((S32)mesh_index)
|
||||
{
|
||||
case MESH_ID_HAIR:
|
||||
mesh->setIsTransparent(TRUE);
|
||||
mesh->setIsTransparent(true);
|
||||
break;
|
||||
case MESH_ID_SKIRT:
|
||||
mesh->setIsTransparent(TRUE);
|
||||
mesh->setIsTransparent(true);
|
||||
break;
|
||||
case MESH_ID_EYEBALL_LEFT:
|
||||
case MESH_ID_EYEBALL_RIGHT:
|
||||
|
|
@ -331,7 +319,7 @@ void LLAvatarAppearance::initClass(const std::string& avatar_file_name_arg, cons
|
|||
avatar_file_name = gDirUtilp->getExpandedFilename(LL_PATH_CHARACTER,AVATAR_DEFAULT_CHAR + "_lad.xml");
|
||||
}
|
||||
LLXmlTree xml_tree;
|
||||
BOOL success = xml_tree.parseFile( avatar_file_name, FALSE );
|
||||
bool success = xml_tree.parseFile( avatar_file_name, false );
|
||||
if (!success)
|
||||
{
|
||||
LL_ERRS() << "Problem reading avatar configuration file:" << avatar_file_name << LL_ENDL;
|
||||
|
|
@ -537,11 +525,11 @@ void LLAvatarAppearance::computeBodySize()
|
|||
new_body_size.mV[VZ] = mPelvisToFoot +
|
||||
// the sqrt(2) correction below is an approximate
|
||||
// correction to get to the top of the head
|
||||
F_SQRT2 * (skull.mV[VZ] * head_scale.mV[VZ]) +
|
||||
head.mV[VZ] * neck_scale.mV[VZ] +
|
||||
neck.mV[VZ] * chest_scale.mV[VZ] +
|
||||
chest.mV[VZ] * torso_scale.mV[VZ] +
|
||||
torso.mV[VZ] * pelvis_scale.mV[VZ];
|
||||
F_SQRT2 * (skull.mV[VZ] * head_scale.mV[VZ]) +
|
||||
head.mV[VZ] * neck_scale.mV[VZ] +
|
||||
neck.mV[VZ] * chest_scale.mV[VZ] +
|
||||
chest.mV[VZ] * torso_scale.mV[VZ] +
|
||||
torso.mV[VZ] * pelvis_scale.mV[VZ];
|
||||
|
||||
// TODO -- measure the real depth and width
|
||||
new_body_size.mV[VX] = DEFAULT_AGENT_DEPTH;
|
||||
|
|
@ -561,17 +549,17 @@ void LLAvatarAppearance::computeBodySize()
|
|||
//-----------------------------------------------------------------------------
|
||||
// parseSkeletonFile()
|
||||
//-----------------------------------------------------------------------------
|
||||
BOOL LLAvatarAppearance::parseSkeletonFile(const std::string& filename, LLXmlTree& skeleton_xml_tree)
|
||||
bool LLAvatarAppearance::parseSkeletonFile(const std::string& filename, LLXmlTree& skeleton_xml_tree)
|
||||
{
|
||||
//-------------------------------------------------------------------------
|
||||
// parse the file
|
||||
//-------------------------------------------------------------------------
|
||||
BOOL parsesuccess = skeleton_xml_tree.parseFile( filename, FALSE );
|
||||
bool parsesuccess = skeleton_xml_tree.parseFile( filename, false );
|
||||
|
||||
if (!parsesuccess)
|
||||
{
|
||||
LL_ERRS() << "Can't parse skeleton file: " << filename << LL_ENDL;
|
||||
return FALSE;
|
||||
return false;
|
||||
}
|
||||
|
||||
// now sanity check xml file
|
||||
|
|
@ -579,13 +567,13 @@ BOOL LLAvatarAppearance::parseSkeletonFile(const std::string& filename, LLXmlTre
|
|||
if (!root)
|
||||
{
|
||||
LL_ERRS() << "No root node found in avatar skeleton file: " << filename << LL_ENDL;
|
||||
return FALSE;
|
||||
return false;
|
||||
}
|
||||
|
||||
if( !root->hasName( "linden_skeleton" ) )
|
||||
{
|
||||
LL_ERRS() << "Invalid avatar skeleton file header: " << filename << LL_ENDL;
|
||||
return FALSE;
|
||||
return false;
|
||||
}
|
||||
|
||||
std::string version;
|
||||
|
|
@ -593,16 +581,16 @@ BOOL LLAvatarAppearance::parseSkeletonFile(const std::string& filename, LLXmlTre
|
|||
if( !root->getFastAttributeString( version_string, version ) || ((version != "1.0") && (version != "2.0")))
|
||||
{
|
||||
LL_ERRS() << "Invalid avatar skeleton file version: " << version << " in file: " << filename << LL_ENDL;
|
||||
return FALSE;
|
||||
return false;
|
||||
}
|
||||
|
||||
return TRUE;
|
||||
return true;
|
||||
}
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
// setupBone()
|
||||
//-----------------------------------------------------------------------------
|
||||
BOOL LLAvatarAppearance::setupBone(const LLAvatarBoneInfo* info, LLJoint* parent, S32 &volume_num, S32 &joint_num)
|
||||
bool LLAvatarAppearance::setupBone(const LLAvatarBoneInfo* info, LLJoint* parent, S32 &volume_num, S32 &joint_num)
|
||||
{
|
||||
LLJoint* joint = NULL;
|
||||
|
||||
|
|
@ -618,7 +606,7 @@ BOOL LLAvatarAppearance::setupBone(const LLAvatarBoneInfo* info, LLJoint* parent
|
|||
if (!joint)
|
||||
{
|
||||
LL_WARNS() << "Too many bones" << LL_ENDL;
|
||||
return FALSE;
|
||||
return false;
|
||||
}
|
||||
joint->setName( info->mName );
|
||||
}
|
||||
|
|
@ -627,7 +615,7 @@ BOOL LLAvatarAppearance::setupBone(const LLAvatarBoneInfo* info, LLJoint* parent
|
|||
if (volume_num >= (S32)mNumCollisionVolumes)
|
||||
{
|
||||
LL_WARNS() << "Too many collision volumes" << LL_ENDL;
|
||||
return FALSE;
|
||||
return false;
|
||||
}
|
||||
joint = (&mCollisionVolumes[volume_num]);
|
||||
joint->setName( info->mName );
|
||||
|
|
@ -667,17 +655,17 @@ BOOL LLAvatarAppearance::setupBone(const LLAvatarBoneInfo* info, LLJoint* parent
|
|||
{
|
||||
if (!setupBone(child_info, joint, volume_num, joint_num))
|
||||
{
|
||||
return FALSE;
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
return TRUE;
|
||||
return true;
|
||||
}
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
// allocateCharacterJoints()
|
||||
//-----------------------------------------------------------------------------
|
||||
BOOL LLAvatarAppearance::allocateCharacterJoints( U32 num )
|
||||
bool LLAvatarAppearance::allocateCharacterJoints( U32 num )
|
||||
{
|
||||
if (mSkeleton.size() != num)
|
||||
{
|
||||
|
|
@ -686,14 +674,14 @@ BOOL LLAvatarAppearance::allocateCharacterJoints( U32 num )
|
|||
mNumBones = num;
|
||||
}
|
||||
|
||||
return TRUE;
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
// buildSkeleton()
|
||||
//-----------------------------------------------------------------------------
|
||||
BOOL LLAvatarAppearance::buildSkeleton(const LLAvatarSkeletonInfo *info)
|
||||
bool LLAvatarAppearance::buildSkeleton(const LLAvatarSkeletonInfo *info)
|
||||
{
|
||||
LL_DEBUGS("BVH") << "numBones " << info->mNumBones << " numCollisionVolumes " << info->mNumCollisionVolumes << LL_ENDL;
|
||||
|
||||
|
|
@ -701,7 +689,7 @@ BOOL LLAvatarAppearance::buildSkeleton(const LLAvatarSkeletonInfo *info)
|
|||
if (!allocateCharacterJoints(info->mNumBones))
|
||||
{
|
||||
LL_ERRS() << "Can't allocate " << info->mNumBones << " joints" << LL_ENDL;
|
||||
return FALSE;
|
||||
return false;
|
||||
}
|
||||
|
||||
// allocate volumes
|
||||
|
|
@ -710,7 +698,7 @@ BOOL LLAvatarAppearance::buildSkeleton(const LLAvatarSkeletonInfo *info)
|
|||
if (!allocateCollisionVolumes(info->mNumCollisionVolumes))
|
||||
{
|
||||
LL_ERRS() << "Can't allocate " << info->mNumCollisionVolumes << " collision volumes" << LL_ENDL;
|
||||
return FALSE;
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -721,11 +709,11 @@ BOOL LLAvatarAppearance::buildSkeleton(const LLAvatarSkeletonInfo *info)
|
|||
if (!setupBone(bone_info, NULL, current_volume_num, current_joint_num))
|
||||
{
|
||||
LL_ERRS() << "Error parsing bone in skeleton file" << LL_ENDL;
|
||||
return FALSE;
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
return TRUE;
|
||||
return true;
|
||||
}
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
|
|
@ -790,7 +778,7 @@ void LLAvatarAppearance::buildCharacter()
|
|||
//-------------------------------------------------------------------------
|
||||
mRoot->removeAllChildren();
|
||||
mJointMap.clear();
|
||||
mIsBuilt = FALSE;
|
||||
mIsBuilt = false;
|
||||
|
||||
//-------------------------------------------------------------------------
|
||||
// clear mesh data
|
||||
|
|
@ -808,10 +796,10 @@ void LLAvatarAppearance::buildCharacter()
|
|||
//-------------------------------------------------------------------------
|
||||
LLTimer timer;
|
||||
|
||||
BOOL status = loadAvatar();
|
||||
bool status = loadAvatar();
|
||||
stop_glerror();
|
||||
|
||||
// gPrintMessagesThisFrame = TRUE;
|
||||
// gPrintMessagesThisFrame = true;
|
||||
LL_DEBUGS() << "Avatar load took " << timer.getElapsedTimeF32() << " seconds." << LL_ENDL;
|
||||
|
||||
if (!status)
|
||||
|
|
@ -881,12 +869,12 @@ void LLAvatarAppearance::buildCharacter()
|
|||
// SL-315
|
||||
mPelvisp->setPosition( LLVector3(0.0f, 0.0f, 0.0f) );
|
||||
|
||||
mIsBuilt = TRUE;
|
||||
mIsBuilt = true;
|
||||
stop_glerror();
|
||||
|
||||
}
|
||||
|
||||
BOOL LLAvatarAppearance::loadAvatar()
|
||||
bool LLAvatarAppearance::loadAvatar()
|
||||
{
|
||||
// LL_RECORD_BLOCK_TIME(FTM_LOAD_AVATAR);
|
||||
|
||||
|
|
@ -894,7 +882,7 @@ BOOL LLAvatarAppearance::loadAvatar()
|
|||
if( !buildSkeleton(sAvatarSkeletonInfo) )
|
||||
{
|
||||
LL_ERRS() << "avatar file: buildSkeleton() failed" << LL_ENDL;
|
||||
return FALSE;
|
||||
return false;
|
||||
}
|
||||
|
||||
// initialize mJointAliasMap
|
||||
|
|
@ -904,14 +892,14 @@ BOOL LLAvatarAppearance::loadAvatar()
|
|||
if( !loadSkeletonNode() )
|
||||
{
|
||||
LL_ERRS() << "avatar file: loadNodeSkeleton() failed" << LL_ENDL;
|
||||
return FALSE;
|
||||
return false;
|
||||
}
|
||||
|
||||
// avatar_lad.xml : <mesh>
|
||||
if( !loadMeshNodes() )
|
||||
{
|
||||
LL_ERRS() << "avatar file: loadNodeMesh() failed" << LL_ENDL;
|
||||
return FALSE;
|
||||
return false;
|
||||
}
|
||||
|
||||
// avatar_lad.xml : <global_color>
|
||||
|
|
@ -921,13 +909,13 @@ BOOL LLAvatarAppearance::loadAvatar()
|
|||
if( !mTexSkinColor->setInfo( sAvatarXmlInfo->mTexSkinColorInfo ) )
|
||||
{
|
||||
LL_ERRS() << "avatar file: mTexSkinColor->setInfo() failed" << LL_ENDL;
|
||||
return FALSE;
|
||||
return false;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
LL_ERRS() << "<global_color> name=\"skin_color\" not found" << LL_ENDL;
|
||||
return FALSE;
|
||||
return false;
|
||||
}
|
||||
if( sAvatarXmlInfo->mTexHairColorInfo )
|
||||
{
|
||||
|
|
@ -935,13 +923,13 @@ BOOL LLAvatarAppearance::loadAvatar()
|
|||
if( !mTexHairColor->setInfo( sAvatarXmlInfo->mTexHairColorInfo ) )
|
||||
{
|
||||
LL_ERRS() << "avatar file: mTexHairColor->setInfo() failed" << LL_ENDL;
|
||||
return FALSE;
|
||||
return false;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
LL_ERRS() << "<global_color> name=\"hair_color\" not found" << LL_ENDL;
|
||||
return FALSE;
|
||||
return false;
|
||||
}
|
||||
if( sAvatarXmlInfo->mTexEyeColorInfo )
|
||||
{
|
||||
|
|
@ -949,26 +937,26 @@ BOOL LLAvatarAppearance::loadAvatar()
|
|||
if( !mTexEyeColor->setInfo( sAvatarXmlInfo->mTexEyeColorInfo ) )
|
||||
{
|
||||
LL_ERRS() << "avatar file: mTexEyeColor->setInfo() failed" << LL_ENDL;
|
||||
return FALSE;
|
||||
return false;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
LL_ERRS() << "<global_color> name=\"eye_color\" not found" << LL_ENDL;
|
||||
return FALSE;
|
||||
return false;
|
||||
}
|
||||
|
||||
// avatar_lad.xml : <layer_set>
|
||||
if (sAvatarXmlInfo->mLayerInfoList.empty())
|
||||
{
|
||||
LL_ERRS() << "avatar file: missing <layer_set> node" << LL_ENDL;
|
||||
return FALSE;
|
||||
return false;
|
||||
}
|
||||
|
||||
if (sAvatarXmlInfo->mMorphMaskInfoList.empty())
|
||||
{
|
||||
LL_ERRS() << "avatar file: missing <morph_masks> node" << LL_ENDL;
|
||||
return FALSE;
|
||||
return false;
|
||||
}
|
||||
|
||||
// avatar_lad.xml : <morph_masks>
|
||||
|
|
@ -982,7 +970,7 @@ BOOL LLAvatarAppearance::loadAvatar()
|
|||
morph_param = getVisualParam(name->c_str());
|
||||
if (morph_param)
|
||||
{
|
||||
BOOL invert = info->mInvert;
|
||||
bool invert = info->mInvert;
|
||||
addMaskedMorph(baked, morph_param, invert, info->mLayer);
|
||||
}
|
||||
}
|
||||
|
|
@ -1010,24 +998,24 @@ BOOL LLAvatarAppearance::loadAvatar()
|
|||
{
|
||||
delete driver_param;
|
||||
LL_WARNS() << "avatar file: driver_param->parseData() failed" << LL_ENDL;
|
||||
return FALSE;
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
return TRUE;
|
||||
return true;
|
||||
}
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
// loadSkeletonNode(): loads <skeleton> node from XML tree
|
||||
//-----------------------------------------------------------------------------
|
||||
BOOL LLAvatarAppearance::loadSkeletonNode ()
|
||||
bool LLAvatarAppearance::loadSkeletonNode ()
|
||||
{
|
||||
mRoot->addChild( mSkeleton[0] );
|
||||
|
||||
// make meshes children before calling parent version of the function
|
||||
for (LLAvatarJoint* joint : mMeshLOD)
|
||||
{
|
||||
joint->mUpdateXform = FALSE;
|
||||
joint->mUpdateXform = false;
|
||||
joint->setMeshesToChildren();
|
||||
}
|
||||
|
||||
|
|
@ -1064,7 +1052,7 @@ BOOL LLAvatarAppearance::loadSkeletonNode ()
|
|||
if (!param->setInfo(info))
|
||||
{
|
||||
delete param;
|
||||
return FALSE;
|
||||
return false;
|
||||
}
|
||||
else
|
||||
{
|
||||
|
|
@ -1075,13 +1063,13 @@ BOOL LLAvatarAppearance::loadSkeletonNode ()
|
|||
}
|
||||
|
||||
|
||||
return TRUE;
|
||||
return true;
|
||||
}
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
// loadMeshNodes(): loads <mesh> nodes from XML tree
|
||||
//-----------------------------------------------------------------------------
|
||||
BOOL LLAvatarAppearance::loadMeshNodes()
|
||||
bool LLAvatarAppearance::loadMeshNodes()
|
||||
{
|
||||
for (const LLAvatarXmlInfo::LLAvatarMeshInfo* info : sAvatarXmlInfo->mMeshInfoList)
|
||||
{
|
||||
|
|
@ -1090,7 +1078,7 @@ BOOL LLAvatarAppearance::loadMeshNodes()
|
|||
|
||||
LLAvatarJointMesh* mesh = NULL;
|
||||
U8 mesh_id = 0;
|
||||
BOOL found_mesh_id = FALSE;
|
||||
bool found_mesh_id = false;
|
||||
|
||||
/* if (type == "hairMesh")
|
||||
switch(lod)
|
||||
|
|
@ -1103,7 +1091,7 @@ BOOL LLAvatarAppearance::loadMeshNodes()
|
|||
if (type.compare(mesh_dict->mName) == 0)
|
||||
{
|
||||
mesh_id = mesh_index;
|
||||
found_mesh_id = TRUE;
|
||||
found_mesh_id = true;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
|
@ -1117,13 +1105,13 @@ BOOL LLAvatarAppearance::loadMeshNodes()
|
|||
else
|
||||
{
|
||||
LL_WARNS() << "Avatar file: <mesh> has invalid lod setting " << lod << LL_ENDL;
|
||||
return FALSE;
|
||||
return false;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
LL_WARNS() << "Ignoring unrecognized mesh type: " << type << LL_ENDL;
|
||||
return FALSE;
|
||||
return false;
|
||||
}
|
||||
|
||||
// LL_INFOS() << "Parsing mesh data for " << type << "..." << LL_ENDL;
|
||||
|
|
@ -1146,7 +1134,7 @@ BOOL LLAvatarAppearance::loadMeshNodes()
|
|||
{
|
||||
// This should never happen
|
||||
LL_WARNS("Avatar") << "Could not find avatar mesh: " << info->mReferenceMeshName << LL_ENDL;
|
||||
return FALSE;
|
||||
return false;
|
||||
}
|
||||
}
|
||||
else
|
||||
|
|
@ -1158,7 +1146,7 @@ BOOL LLAvatarAppearance::loadMeshNodes()
|
|||
if( !poly_mesh )
|
||||
{
|
||||
LL_WARNS() << "Failed to load mesh of type " << type << LL_ENDL;
|
||||
return FALSE;
|
||||
return false;
|
||||
}
|
||||
|
||||
// Multimap insert
|
||||
|
|
@ -1173,7 +1161,7 @@ BOOL LLAvatarAppearance::loadMeshNodes()
|
|||
if (!param->setInfo((LLPolyMorphTargetInfo*)info_pair.first))
|
||||
{
|
||||
delete param;
|
||||
return FALSE;
|
||||
return false;
|
||||
}
|
||||
else
|
||||
{
|
||||
|
|
@ -1191,15 +1179,15 @@ BOOL LLAvatarAppearance::loadMeshNodes()
|
|||
}
|
||||
}
|
||||
|
||||
return TRUE;
|
||||
return true;
|
||||
}
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
// loadLayerSets()
|
||||
//-----------------------------------------------------------------------------
|
||||
BOOL LLAvatarAppearance::loadLayersets()
|
||||
bool LLAvatarAppearance::loadLayersets()
|
||||
{
|
||||
BOOL success = TRUE;
|
||||
bool success = true;
|
||||
for (LLTexLayerSetInfo* layerset_info : sAvatarXmlInfo->mLayerInfoList)
|
||||
{
|
||||
if (isSelf())
|
||||
|
|
@ -1212,7 +1200,7 @@ BOOL LLAvatarAppearance::loadLayersets()
|
|||
stop_glerror();
|
||||
delete layer_set;
|
||||
LL_WARNS() << "avatar file: layer_set->setInfo() failed" << LL_ENDL;
|
||||
return FALSE;
|
||||
return false;
|
||||
}
|
||||
|
||||
// scan baked textures and associate the layerset with the appropriate one
|
||||
|
|
@ -1234,7 +1222,7 @@ BOOL LLAvatarAppearance::loadLayersets()
|
|||
{
|
||||
LL_WARNS() << "<layer_set> has invalid body_region attribute" << LL_ENDL;
|
||||
delete layer_set;
|
||||
return FALSE;
|
||||
return false;
|
||||
}
|
||||
|
||||
// scan morph masks and let any affected layers know they have an associated morph
|
||||
|
|
@ -1243,12 +1231,12 @@ BOOL LLAvatarAppearance::loadLayersets()
|
|||
LLTexLayerInterface* layer = layer_set->findLayerByName(morph->mLayer);
|
||||
if (layer)
|
||||
{
|
||||
layer->setHasMorph(TRUE);
|
||||
layer->setHasMorph(true);
|
||||
}
|
||||
else
|
||||
{
|
||||
LL_WARNS() << "Could not find layer named " << morph->mLayer << " to set morph flag" << LL_ENDL;
|
||||
success = FALSE;
|
||||
success = false;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -1341,19 +1329,19 @@ LLPolyMesh* LLAvatarAppearance::getUpperBodyMesh()
|
|||
|
||||
|
||||
// virtual
|
||||
BOOL LLAvatarAppearance::isValid() const
|
||||
bool LLAvatarAppearance::isValid() const
|
||||
{
|
||||
// This should only be called on ourself.
|
||||
if (!isSelf())
|
||||
{
|
||||
LL_ERRS() << "Called LLAvatarAppearance::isValid() on when isSelf() == false" << LL_ENDL;
|
||||
}
|
||||
return TRUE;
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
// adds a morph mask to the appropriate baked texture structure
|
||||
void LLAvatarAppearance::addMaskedMorph(EBakedTextureIndex index, LLVisualParam* morph_target, BOOL invert, std::string layer)
|
||||
void LLAvatarAppearance::addMaskedMorph(EBakedTextureIndex index, LLVisualParam* morph_target, bool invert, std::string layer)
|
||||
{
|
||||
if (index < BAKED_NUM_INDICES)
|
||||
{
|
||||
|
|
@ -1364,7 +1352,7 @@ void LLAvatarAppearance::addMaskedMorph(EBakedTextureIndex index, LLVisualParam*
|
|||
|
||||
|
||||
//static
|
||||
BOOL LLAvatarAppearance::teToColorParams( ETextureIndex te, U32 *param_name )
|
||||
bool LLAvatarAppearance::teToColorParams( ETextureIndex te, U32 *param_name )
|
||||
{
|
||||
switch( te )
|
||||
{
|
||||
|
|
@ -1448,10 +1436,10 @@ BOOL LLAvatarAppearance::teToColorParams( ETextureIndex te, U32 *param_name )
|
|||
|
||||
default:
|
||||
llassert(0);
|
||||
return FALSE;
|
||||
return false;
|
||||
}
|
||||
|
||||
return TRUE;
|
||||
return true;
|
||||
}
|
||||
|
||||
void LLAvatarAppearance::setClothesColor( ETextureIndex te, const LLColor4& new_color)
|
||||
|
|
@ -1459,9 +1447,9 @@ void LLAvatarAppearance::setClothesColor( ETextureIndex te, const LLColor4& new_
|
|||
U32 param_name[3];
|
||||
if( teToColorParams( te, param_name ) )
|
||||
{
|
||||
setVisualParamWeight( param_name[0], new_color.mV[VX]);
|
||||
setVisualParamWeight( param_name[1], new_color.mV[VY]);
|
||||
setVisualParamWeight( param_name[2], new_color.mV[VZ]);
|
||||
setVisualParamWeight( param_name[0], new_color.mV[VRED]);
|
||||
setVisualParamWeight( param_name[1], new_color.mV[VGREEN]);
|
||||
setVisualParamWeight( param_name[2], new_color.mV[VBLUE]);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -1471,9 +1459,9 @@ LLColor4 LLAvatarAppearance::getClothesColor( ETextureIndex te )
|
|||
U32 param_name[3];
|
||||
if( teToColorParams( te, param_name ) )
|
||||
{
|
||||
color.mV[VX] = getVisualParamWeight( param_name[0] );
|
||||
color.mV[VY] = getVisualParamWeight( param_name[1] );
|
||||
color.mV[VZ] = getVisualParamWeight( param_name[2] );
|
||||
color.mV[VRED] = getVisualParamWeight( param_name[0] );
|
||||
color.mV[VGREEN] = getVisualParamWeight( param_name[1] );
|
||||
color.mV[VBLUE] = getVisualParamWeight( param_name[2] );
|
||||
}
|
||||
return color;
|
||||
}
|
||||
|
|
@ -1507,7 +1495,7 @@ LLColor4 LLAvatarAppearance::getGlobalColor( const std::string& color_name ) con
|
|||
|
||||
// Unlike most wearable functions, this works for both self and other.
|
||||
// virtual
|
||||
BOOL LLAvatarAppearance::isWearingWearableType(LLWearableType::EType type) const
|
||||
bool LLAvatarAppearance::isWearingWearableType(LLWearableType::EType type) const
|
||||
{
|
||||
return mWearableData->getWearableCount(type) > 0;
|
||||
}
|
||||
|
|
@ -1524,7 +1512,7 @@ LLTexLayerSet* LLAvatarAppearance::getAvatarLayerSet(EBakedTextureIndex baked_in
|
|||
//-----------------------------------------------------------------------------
|
||||
// allocateCollisionVolumes()
|
||||
//-----------------------------------------------------------------------------
|
||||
BOOL LLAvatarAppearance::allocateCollisionVolumes( U32 num )
|
||||
bool LLAvatarAppearance::allocateCollisionVolumes( U32 num )
|
||||
{
|
||||
if (mNumCollisionVolumes !=num)
|
||||
{
|
||||
|
|
@ -1535,27 +1523,27 @@ BOOL LLAvatarAppearance::allocateCollisionVolumes( U32 num )
|
|||
if (!mCollisionVolumes)
|
||||
{
|
||||
LL_WARNS() << "Failed to allocate collision volumes" << LL_ENDL;
|
||||
return FALSE;
|
||||
return false;
|
||||
}
|
||||
|
||||
mNumCollisionVolumes = num;
|
||||
}
|
||||
return TRUE;
|
||||
return true;
|
||||
}
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
// LLAvatarBoneInfo::parseXml()
|
||||
//-----------------------------------------------------------------------------
|
||||
BOOL LLAvatarBoneInfo::parseXml(LLXmlTreeNode* node)
|
||||
bool LLAvatarBoneInfo::parseXml(LLXmlTreeNode* node)
|
||||
{
|
||||
if (node->hasName("bone"))
|
||||
{
|
||||
mIsJoint = TRUE;
|
||||
mIsJoint = true;
|
||||
static LLStdStringHandle name_string = LLXmlTree::addAttributeString("name");
|
||||
if (!node->getFastAttributeString(name_string, mName))
|
||||
{
|
||||
LL_WARNS() << "Bone without name" << LL_ENDL;
|
||||
return FALSE;
|
||||
return false;
|
||||
}
|
||||
|
||||
static LLStdStringHandle aliases_string = LLXmlTree::addAttributeString("aliases");
|
||||
|
|
@ -1563,7 +1551,7 @@ BOOL LLAvatarBoneInfo::parseXml(LLXmlTreeNode* node)
|
|||
}
|
||||
else if (node->hasName("collision_volume"))
|
||||
{
|
||||
mIsJoint = FALSE;
|
||||
mIsJoint = false;
|
||||
static LLStdStringHandle name_string = LLXmlTree::addAttributeString("name");
|
||||
if (!node->getFastAttributeString(name_string, mName))
|
||||
{
|
||||
|
|
@ -1573,28 +1561,28 @@ BOOL LLAvatarBoneInfo::parseXml(LLXmlTreeNode* node)
|
|||
else
|
||||
{
|
||||
LL_WARNS() << "Invalid node " << node->getName() << LL_ENDL;
|
||||
return FALSE;
|
||||
return false;
|
||||
}
|
||||
|
||||
static LLStdStringHandle pos_string = LLXmlTree::addAttributeString("pos");
|
||||
if (!node->getFastAttributeVector3(pos_string, mPos))
|
||||
{
|
||||
LL_WARNS() << "Bone without position" << LL_ENDL;
|
||||
return FALSE;
|
||||
return false;
|
||||
}
|
||||
|
||||
static LLStdStringHandle rot_string = LLXmlTree::addAttributeString("rot");
|
||||
if (!node->getFastAttributeVector3(rot_string, mRot))
|
||||
{
|
||||
LL_WARNS() << "Bone without rotation" << LL_ENDL;
|
||||
return FALSE;
|
||||
return false;
|
||||
}
|
||||
|
||||
static LLStdStringHandle scale_string = LLXmlTree::addAttributeString("scale");
|
||||
if (!node->getFastAttributeVector3(scale_string, mScale))
|
||||
{
|
||||
LL_WARNS() << "Bone without scale" << LL_ENDL;
|
||||
return FALSE;
|
||||
return false;
|
||||
}
|
||||
|
||||
static LLStdStringHandle end_string = LLXmlTree::addAttributeString("end");
|
||||
|
|
@ -1617,7 +1605,7 @@ BOOL LLAvatarBoneInfo::parseXml(LLXmlTreeNode* node)
|
|||
if (!node->getFastAttributeVector3(pivot_string, mPivot))
|
||||
{
|
||||
LL_WARNS() << "Bone without pivot" << LL_ENDL;
|
||||
return FALSE;
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -1629,23 +1617,23 @@ BOOL LLAvatarBoneInfo::parseXml(LLXmlTreeNode* node)
|
|||
if (!child_info->parseXml(child))
|
||||
{
|
||||
delete child_info;
|
||||
return FALSE;
|
||||
return false;
|
||||
}
|
||||
mChildren.push_back(child_info);
|
||||
}
|
||||
return TRUE;
|
||||
return true;
|
||||
}
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
// LLAvatarSkeletonInfo::parseXml()
|
||||
//-----------------------------------------------------------------------------
|
||||
BOOL LLAvatarSkeletonInfo::parseXml(LLXmlTreeNode* node)
|
||||
bool LLAvatarSkeletonInfo::parseXml(LLXmlTreeNode* node)
|
||||
{
|
||||
static LLStdStringHandle num_bones_string = LLXmlTree::addAttributeString("num_bones");
|
||||
if (!node->getFastAttributeS32(num_bones_string, mNumBones))
|
||||
{
|
||||
LL_WARNS() << "Couldn't find number of bones." << LL_ENDL;
|
||||
return FALSE;
|
||||
return false;
|
||||
}
|
||||
|
||||
static LLStdStringHandle num_collision_volumes_string = LLXmlTree::addAttributeString("num_collision_volumes");
|
||||
|
|
@ -1659,11 +1647,11 @@ BOOL LLAvatarSkeletonInfo::parseXml(LLXmlTreeNode* node)
|
|||
{
|
||||
delete info;
|
||||
LL_WARNS() << "Error parsing bone in skeleton file" << LL_ENDL;
|
||||
return FALSE;
|
||||
return false;
|
||||
}
|
||||
mBoneInfoList.push_back(info);
|
||||
}
|
||||
return TRUE;
|
||||
return true;
|
||||
}
|
||||
|
||||
//Make aliases for joint and push to map.
|
||||
|
|
@ -1731,13 +1719,13 @@ const LLAvatarAppearance::joint_alias_map_t& LLAvatarAppearance::getJointAliases
|
|||
//-----------------------------------------------------------------------------
|
||||
// parseXmlSkeletonNode(): parses <skeleton> nodes from XML tree
|
||||
//-----------------------------------------------------------------------------
|
||||
BOOL LLAvatarAppearance::LLAvatarXmlInfo::parseXmlSkeletonNode(LLXmlTreeNode* root)
|
||||
bool LLAvatarAppearance::LLAvatarXmlInfo::parseXmlSkeletonNode(LLXmlTreeNode* root)
|
||||
{
|
||||
LLXmlTreeNode* node = root->getChildByName( "skeleton" );
|
||||
if( !node )
|
||||
{
|
||||
LL_WARNS() << "avatar file: missing <skeleton>" << LL_ENDL;
|
||||
return FALSE;
|
||||
return false;
|
||||
}
|
||||
|
||||
LLXmlTreeNode* child;
|
||||
|
|
@ -1757,14 +1745,14 @@ BOOL LLAvatarAppearance::LLAvatarXmlInfo::parseXmlSkeletonNode(LLXmlTreeNode* ro
|
|||
{
|
||||
LL_WARNS() << "Unknown param type." << LL_ENDL;
|
||||
}
|
||||
return FALSE;
|
||||
return false;
|
||||
}
|
||||
|
||||
LLPolySkeletalDistortionInfo *info = new LLPolySkeletalDistortionInfo;
|
||||
if (!info->parseXml(child))
|
||||
{
|
||||
delete info;
|
||||
return FALSE;
|
||||
return false;
|
||||
}
|
||||
|
||||
mSkeletalDistortionInfoList.push_back(info);
|
||||
|
|
@ -1782,7 +1770,7 @@ BOOL LLAvatarAppearance::LLAvatarXmlInfo::parseXmlSkeletonNode(LLXmlTreeNode* ro
|
|||
{
|
||||
LL_WARNS() << "No name supplied for attachment point." << LL_ENDL;
|
||||
delete info;
|
||||
return FALSE;
|
||||
return false;
|
||||
}
|
||||
|
||||
static LLStdStringHandle joint_string = LLXmlTree::addAttributeString("joint");
|
||||
|
|
@ -1790,19 +1778,19 @@ BOOL LLAvatarAppearance::LLAvatarXmlInfo::parseXmlSkeletonNode(LLXmlTreeNode* ro
|
|||
{
|
||||
LL_WARNS() << "No bone declared in attachment point " << info->mName << LL_ENDL;
|
||||
delete info;
|
||||
return FALSE;
|
||||
return false;
|
||||
}
|
||||
|
||||
static LLStdStringHandle position_string = LLXmlTree::addAttributeString("position");
|
||||
if (child->getFastAttributeVector3(position_string, info->mPosition))
|
||||
{
|
||||
info->mHasPosition = TRUE;
|
||||
info->mHasPosition = true;
|
||||
}
|
||||
|
||||
static LLStdStringHandle rotation_string = LLXmlTree::addAttributeString("rotation");
|
||||
if (child->getFastAttributeVector3(rotation_string, info->mRotationEuler))
|
||||
{
|
||||
info->mHasRotation = TRUE;
|
||||
info->mHasRotation = true;
|
||||
}
|
||||
static LLStdStringHandle group_string = LLXmlTree::addAttributeString("group");
|
||||
if (child->getFastAttributeS32(group_string, info->mGroup))
|
||||
|
|
@ -1816,7 +1804,7 @@ BOOL LLAvatarAppearance::LLAvatarXmlInfo::parseXmlSkeletonNode(LLXmlTreeNode* ro
|
|||
{
|
||||
LL_WARNS() << "No id supplied for attachment point " << info->mName << LL_ENDL;
|
||||
delete info;
|
||||
return FALSE;
|
||||
return false;
|
||||
}
|
||||
|
||||
static LLStdStringHandle slot_string = LLXmlTree::addAttributeString("pie_slice");
|
||||
|
|
@ -1831,13 +1819,13 @@ BOOL LLAvatarAppearance::LLAvatarXmlInfo::parseXmlSkeletonNode(LLXmlTreeNode* ro
|
|||
mAttachmentInfoList.push_back(info);
|
||||
}
|
||||
|
||||
return TRUE;
|
||||
return true;
|
||||
}
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
// parseXmlMeshNodes(): parses <mesh> nodes from XML tree
|
||||
//-----------------------------------------------------------------------------
|
||||
BOOL LLAvatarAppearance::LLAvatarXmlInfo::parseXmlMeshNodes(LLXmlTreeNode* root)
|
||||
bool LLAvatarAppearance::LLAvatarXmlInfo::parseXmlMeshNodes(LLXmlTreeNode* root)
|
||||
{
|
||||
for (LLXmlTreeNode* node = root->getChildByName( "mesh" );
|
||||
node;
|
||||
|
|
@ -1851,7 +1839,7 @@ BOOL LLAvatarAppearance::LLAvatarXmlInfo::parseXmlMeshNodes(LLXmlTreeNode* root)
|
|||
{
|
||||
LL_WARNS() << "Avatar file: <mesh> is missing type attribute. Ignoring element. " << LL_ENDL;
|
||||
delete info;
|
||||
return FALSE; // Ignore this element
|
||||
return false; // Ignore this element
|
||||
}
|
||||
|
||||
static LLStdStringHandle lod_string = LLXmlTree::addAttributeString("lod");
|
||||
|
|
@ -1859,7 +1847,7 @@ BOOL LLAvatarAppearance::LLAvatarXmlInfo::parseXmlMeshNodes(LLXmlTreeNode* root)
|
|||
{
|
||||
LL_WARNS() << "Avatar file: <mesh> is missing lod attribute. Ignoring element. " << LL_ENDL;
|
||||
delete info;
|
||||
return FALSE; // Ignore this element
|
||||
return false; // Ignore this element
|
||||
}
|
||||
|
||||
static LLStdStringHandle file_name_string = LLXmlTree::addAttributeString("file_name");
|
||||
|
|
@ -1867,7 +1855,7 @@ BOOL LLAvatarAppearance::LLAvatarXmlInfo::parseXmlMeshNodes(LLXmlTreeNode* root)
|
|||
{
|
||||
LL_WARNS() << "Avatar file: <mesh> is missing file_name attribute. Ignoring: " << info->mType << LL_ENDL;
|
||||
delete info;
|
||||
return FALSE; // Ignore this element
|
||||
return false; // Ignore this element
|
||||
}
|
||||
|
||||
static LLStdStringHandle reference_string = LLXmlTree::addAttributeString("reference");
|
||||
|
|
@ -1902,7 +1890,7 @@ BOOL LLAvatarAppearance::LLAvatarXmlInfo::parseXmlMeshNodes(LLXmlTreeNode* root)
|
|||
{
|
||||
LL_WARNS() << "Unknown param type." << LL_ENDL;
|
||||
}
|
||||
return FALSE;
|
||||
return false;
|
||||
}
|
||||
|
||||
LLPolyMorphTargetInfo *morphinfo = new LLPolyMorphTargetInfo();
|
||||
|
|
@ -1910,9 +1898,9 @@ BOOL LLAvatarAppearance::LLAvatarXmlInfo::parseXmlMeshNodes(LLXmlTreeNode* root)
|
|||
{
|
||||
delete morphinfo;
|
||||
delete info;
|
||||
return -1;
|
||||
return false;
|
||||
}
|
||||
BOOL shared = FALSE;
|
||||
bool shared = false;
|
||||
static LLStdStringHandle shared_string = LLXmlTree::addAttributeString("shared");
|
||||
child->getFastAttributeBOOL(shared_string, shared);
|
||||
|
||||
|
|
@ -1921,13 +1909,13 @@ BOOL LLAvatarAppearance::LLAvatarXmlInfo::parseXmlMeshNodes(LLXmlTreeNode* root)
|
|||
|
||||
mMeshInfoList.push_back(info);
|
||||
}
|
||||
return TRUE;
|
||||
return true;
|
||||
}
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
// parseXmlColorNodes(): parses <global_color> nodes from XML tree
|
||||
//-----------------------------------------------------------------------------
|
||||
BOOL LLAvatarAppearance::LLAvatarXmlInfo::parseXmlColorNodes(LLXmlTreeNode* root)
|
||||
bool LLAvatarAppearance::LLAvatarXmlInfo::parseXmlColorNodes(LLXmlTreeNode* root)
|
||||
{
|
||||
for (LLXmlTreeNode* color_node = root->getChildByName( "global_color" );
|
||||
color_node;
|
||||
|
|
@ -1942,14 +1930,14 @@ BOOL LLAvatarAppearance::LLAvatarXmlInfo::parseXmlColorNodes(LLXmlTreeNode* root
|
|||
if (mTexSkinColorInfo)
|
||||
{
|
||||
LL_WARNS() << "avatar file: multiple instances of skin_color" << LL_ENDL;
|
||||
return FALSE;
|
||||
return false;
|
||||
}
|
||||
mTexSkinColorInfo = new LLTexGlobalColorInfo;
|
||||
if( !mTexSkinColorInfo->parseXml( color_node ) )
|
||||
{
|
||||
delete_and_clear(mTexSkinColorInfo);
|
||||
LL_WARNS() << "avatar file: mTexSkinColor->parseXml() failed" << LL_ENDL;
|
||||
return FALSE;
|
||||
return false;
|
||||
}
|
||||
}
|
||||
else if( global_color_name == "hair_color" )
|
||||
|
|
@ -1957,14 +1945,14 @@ BOOL LLAvatarAppearance::LLAvatarXmlInfo::parseXmlColorNodes(LLXmlTreeNode* root
|
|||
if (mTexHairColorInfo)
|
||||
{
|
||||
LL_WARNS() << "avatar file: multiple instances of hair_color" << LL_ENDL;
|
||||
return FALSE;
|
||||
return false;
|
||||
}
|
||||
mTexHairColorInfo = new LLTexGlobalColorInfo;
|
||||
if( !mTexHairColorInfo->parseXml( color_node ) )
|
||||
{
|
||||
delete_and_clear(mTexHairColorInfo);
|
||||
LL_WARNS() << "avatar file: mTexHairColor->parseXml() failed" << LL_ENDL;
|
||||
return FALSE;
|
||||
return false;
|
||||
}
|
||||
}
|
||||
else if( global_color_name == "eye_color" )
|
||||
|
|
@ -1972,24 +1960,24 @@ BOOL LLAvatarAppearance::LLAvatarXmlInfo::parseXmlColorNodes(LLXmlTreeNode* root
|
|||
if (mTexEyeColorInfo)
|
||||
{
|
||||
LL_WARNS() << "avatar file: multiple instances of eye_color" << LL_ENDL;
|
||||
return FALSE;
|
||||
return false;
|
||||
}
|
||||
mTexEyeColorInfo = new LLTexGlobalColorInfo;
|
||||
if( !mTexEyeColorInfo->parseXml( color_node ) )
|
||||
{
|
||||
LL_WARNS() << "avatar file: mTexEyeColor->parseXml() failed" << LL_ENDL;
|
||||
return FALSE;
|
||||
return false;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
return TRUE;
|
||||
return true;
|
||||
}
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
// parseXmlLayerNodes(): parses <layer_set> nodes from XML tree
|
||||
//-----------------------------------------------------------------------------
|
||||
BOOL LLAvatarAppearance::LLAvatarXmlInfo::parseXmlLayerNodes(LLXmlTreeNode* root)
|
||||
bool LLAvatarAppearance::LLAvatarXmlInfo::parseXmlLayerNodes(LLXmlTreeNode* root)
|
||||
{
|
||||
for (LLXmlTreeNode* layer_node = root->getChildByName( "layer_set" );
|
||||
layer_node;
|
||||
|
|
@ -2004,16 +1992,16 @@ BOOL LLAvatarAppearance::LLAvatarXmlInfo::parseXmlLayerNodes(LLXmlTreeNode* root
|
|||
{
|
||||
delete layer_info;
|
||||
LL_WARNS() << "avatar file: layer_set->parseXml() failed" << LL_ENDL;
|
||||
return FALSE;
|
||||
return false;
|
||||
}
|
||||
}
|
||||
return TRUE;
|
||||
return true;
|
||||
}
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
// parseXmlDriverNodes(): parses <driver_parameters> nodes from XML tree
|
||||
//-----------------------------------------------------------------------------
|
||||
BOOL LLAvatarAppearance::LLAvatarXmlInfo::parseXmlDriverNodes(LLXmlTreeNode* root)
|
||||
bool LLAvatarAppearance::LLAvatarXmlInfo::parseXmlDriverNodes(LLXmlTreeNode* root)
|
||||
{
|
||||
LLXmlTreeNode* driver = root->getChildByName( "driver_parameters" );
|
||||
if( driver )
|
||||
|
|
@ -2033,23 +2021,23 @@ BOOL LLAvatarAppearance::LLAvatarXmlInfo::parseXmlDriverNodes(LLXmlTreeNode* roo
|
|||
{
|
||||
delete driver_info;
|
||||
LL_WARNS() << "avatar file: driver_param->parseXml() failed" << LL_ENDL;
|
||||
return FALSE;
|
||||
return false;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
return TRUE;
|
||||
return true;
|
||||
}
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
// parseXmlDriverNodes(): parses <driver_parameters> nodes from XML tree
|
||||
//-----------------------------------------------------------------------------
|
||||
BOOL LLAvatarAppearance::LLAvatarXmlInfo::parseXmlMorphNodes(LLXmlTreeNode* root)
|
||||
bool LLAvatarAppearance::LLAvatarXmlInfo::parseXmlMorphNodes(LLXmlTreeNode* root)
|
||||
{
|
||||
LLXmlTreeNode* masks = root->getChildByName( "morph_masks" );
|
||||
if( !masks )
|
||||
{
|
||||
return FALSE;
|
||||
return false;
|
||||
}
|
||||
|
||||
for (LLXmlTreeNode* grand_child = masks->getChildByName( "mask" );
|
||||
|
|
@ -2063,7 +2051,7 @@ BOOL LLAvatarAppearance::LLAvatarXmlInfo::parseXmlMorphNodes(LLXmlTreeNode* root
|
|||
{
|
||||
LL_WARNS() << "No name supplied for morph mask." << LL_ENDL;
|
||||
delete info;
|
||||
return FALSE;
|
||||
return false;
|
||||
}
|
||||
|
||||
static LLStdStringHandle region_string = LLXmlTree::addAttributeString("body_region");
|
||||
|
|
@ -2071,7 +2059,7 @@ BOOL LLAvatarAppearance::LLAvatarXmlInfo::parseXmlMorphNodes(LLXmlTreeNode* root
|
|||
{
|
||||
LL_WARNS() << "No region supplied for morph mask." << LL_ENDL;
|
||||
delete info;
|
||||
return FALSE;
|
||||
return false;
|
||||
}
|
||||
|
||||
static LLStdStringHandle layer_string = LLXmlTree::addAttributeString("layer");
|
||||
|
|
@ -2079,7 +2067,7 @@ BOOL LLAvatarAppearance::LLAvatarXmlInfo::parseXmlMorphNodes(LLXmlTreeNode* root
|
|||
{
|
||||
LL_WARNS() << "No layer supplied for morph mask." << LL_ENDL;
|
||||
delete info;
|
||||
return FALSE;
|
||||
return false;
|
||||
}
|
||||
|
||||
// optional parameter. don't throw a warning if not present.
|
||||
|
|
@ -2089,11 +2077,11 @@ BOOL LLAvatarAppearance::LLAvatarXmlInfo::parseXmlMorphNodes(LLXmlTreeNode* root
|
|||
mMorphMaskInfoList.push_back(info);
|
||||
}
|
||||
|
||||
return TRUE;
|
||||
return true;
|
||||
}
|
||||
|
||||
//virtual
|
||||
LLAvatarAppearance::LLMaskedMorph::LLMaskedMorph(LLVisualParam *morph_target, BOOL invert, std::string layer) :
|
||||
LLAvatarAppearance::LLMaskedMorph::LLMaskedMorph(LLVisualParam *morph_target, bool invert, std::string layer) :
|
||||
mMorphTarget(morph_target),
|
||||
mInvert(invert),
|
||||
mLayer(layer)
|
||||
|
|
|
|||
|
|
@ -70,10 +70,10 @@ public:
|
|||
static void initClass();
|
||||
static void cleanupClass(); // Cleanup data that's only init'd once per class.
|
||||
virtual void initInstance(); // Called after construction to initialize the instance.
|
||||
S32 mInitFlags;
|
||||
virtual BOOL loadSkeletonNode();
|
||||
BOOL loadMeshNodes();
|
||||
BOOL loadLayersets();
|
||||
S32 mInitFlags{ 0 };
|
||||
virtual bool loadSkeletonNode();
|
||||
bool loadMeshNodes();
|
||||
bool loadLayersets();
|
||||
|
||||
|
||||
/** Initialization
|
||||
|
|
@ -108,9 +108,9 @@ public:
|
|||
**/
|
||||
public:
|
||||
virtual bool isSelf() const { return false; } // True if this avatar is for this viewer's agent
|
||||
virtual BOOL isValid() const;
|
||||
virtual BOOL isUsingLocalAppearance() const = 0;
|
||||
virtual BOOL isEditingAppearance() const = 0;
|
||||
virtual bool isValid() const;
|
||||
virtual bool isUsingLocalAppearance() const = 0;
|
||||
virtual bool isEditingAppearance() const = 0;
|
||||
|
||||
bool isBuilt() const { return mIsBuilt; }
|
||||
|
||||
|
|
@ -135,8 +135,8 @@ public:
|
|||
F32 getPelvisToFoot() const { return mPelvisToFoot; }
|
||||
/*virtual*/ LLJoint* getRootJoint() { return mRoot; }
|
||||
|
||||
LLVector3 mHeadOffset; // current head position
|
||||
LLAvatarJoint *mRoot;
|
||||
LLVector3 mHeadOffset{}; // current head position
|
||||
LLAvatarJoint* mRoot{ nullptr };
|
||||
|
||||
typedef std::map<std::string, LLJoint*> joint_map_t;
|
||||
joint_map_t mJointMap;
|
||||
|
|
@ -146,7 +146,7 @@ public:
|
|||
joint_state_map_t mCurrBodySizeState;
|
||||
void compareJointStateMaps(joint_state_map_t& last_state,
|
||||
joint_state_map_t& curr_state);
|
||||
void computeBodySize();
|
||||
void computeBodySize();
|
||||
|
||||
public:
|
||||
typedef std::vector<LLAvatarJoint*> avatar_joint_list_t;
|
||||
|
|
@ -156,16 +156,16 @@ public:
|
|||
|
||||
|
||||
protected:
|
||||
static BOOL parseSkeletonFile(const std::string& filename, LLXmlTree& skeleton_xml_tree);
|
||||
static bool parseSkeletonFile(const std::string& filename, LLXmlTree& skeleton_xml_tree);
|
||||
virtual void buildCharacter();
|
||||
virtual BOOL loadAvatar();
|
||||
virtual bool loadAvatar();
|
||||
|
||||
BOOL setupBone(const LLAvatarBoneInfo* info, LLJoint* parent, S32 ¤t_volume_num, S32 ¤t_joint_num);
|
||||
BOOL allocateCharacterJoints(U32 num);
|
||||
BOOL buildSkeleton(const LLAvatarSkeletonInfo *info);
|
||||
bool setupBone(const LLAvatarBoneInfo* info, LLJoint* parent, S32 ¤t_volume_num, S32 ¤t_joint_num);
|
||||
bool allocateCharacterJoints(U32 num);
|
||||
bool buildSkeleton(const LLAvatarSkeletonInfo *info);
|
||||
|
||||
void clearSkeleton();
|
||||
BOOL mIsBuilt; // state of deferred character building
|
||||
bool mIsBuilt{ false }; // state of deferred character building
|
||||
avatar_joint_list_t mSkeleton;
|
||||
LLVector3OverrideMap mPelvisFixups;
|
||||
joint_alias_map_t mJointAliasMap;
|
||||
|
|
@ -182,30 +182,30 @@ public:
|
|||
LLVector3 mBodySize;
|
||||
LLVector3 mAvatarOffset;
|
||||
protected:
|
||||
F32 mPelvisToFoot;
|
||||
F32 mPelvisToFoot{ 0.f };
|
||||
|
||||
//--------------------------------------------------------------------
|
||||
// Cached pointers to well known joints
|
||||
//--------------------------------------------------------------------
|
||||
public:
|
||||
LLJoint* mPelvisp;
|
||||
LLJoint* mTorsop;
|
||||
LLJoint* mChestp;
|
||||
LLJoint* mNeckp;
|
||||
LLJoint* mHeadp;
|
||||
LLJoint* mSkullp;
|
||||
LLJoint* mEyeLeftp;
|
||||
LLJoint* mEyeRightp;
|
||||
LLJoint* mHipLeftp;
|
||||
LLJoint* mHipRightp;
|
||||
LLJoint* mKneeLeftp;
|
||||
LLJoint* mKneeRightp;
|
||||
LLJoint* mAnkleLeftp;
|
||||
LLJoint* mAnkleRightp;
|
||||
LLJoint* mFootLeftp;
|
||||
LLJoint* mFootRightp;
|
||||
LLJoint* mWristLeftp;
|
||||
LLJoint* mWristRightp;
|
||||
LLJoint* mPelvisp{nullptr};
|
||||
LLJoint* mTorsop{ nullptr };
|
||||
LLJoint* mChestp{ nullptr };
|
||||
LLJoint* mNeckp{ nullptr };
|
||||
LLJoint* mHeadp{ nullptr };
|
||||
LLJoint* mSkullp{ nullptr };
|
||||
LLJoint* mEyeLeftp{ nullptr };
|
||||
LLJoint* mEyeRightp{ nullptr };
|
||||
LLJoint* mHipLeftp{ nullptr };
|
||||
LLJoint* mHipRightp{ nullptr };
|
||||
LLJoint* mKneeLeftp{ nullptr };
|
||||
LLJoint* mKneeRightp{ nullptr };
|
||||
LLJoint* mAnkleLeftp{ nullptr };
|
||||
LLJoint* mAnkleRightp{ nullptr };
|
||||
LLJoint* mFootLeftp{ nullptr };
|
||||
LLJoint* mFootRightp{ nullptr };
|
||||
LLJoint* mWristLeftp{ nullptr };
|
||||
LLJoint* mWristRightp{ nullptr };
|
||||
|
||||
//--------------------------------------------------------------------
|
||||
// XML parse tree
|
||||
|
|
@ -225,14 +225,14 @@ protected:
|
|||
** RENDERING
|
||||
**/
|
||||
public:
|
||||
BOOL mIsDummy; // for special views and animated object controllers; local to viewer
|
||||
bool mIsDummy{ false }; // for special views and animated object controllers; local to viewer
|
||||
|
||||
//--------------------------------------------------------------------
|
||||
// Morph masks
|
||||
//--------------------------------------------------------------------
|
||||
public:
|
||||
void addMaskedMorph(LLAvatarAppearanceDefines::EBakedTextureIndex index, LLVisualParam* morph_target, BOOL invert, std::string layer);
|
||||
virtual void applyMorphMask(U8* tex_data, S32 width, S32 height, S32 num_components, LLAvatarAppearanceDefines::EBakedTextureIndex index = LLAvatarAppearanceDefines::BAKED_NUM_INDICES) = 0;
|
||||
void addMaskedMorph(LLAvatarAppearanceDefines::EBakedTextureIndex index, LLVisualParam* morph_target, bool invert, std::string layer);
|
||||
virtual void applyMorphMask(const U8* tex_data, S32 width, S32 height, S32 num_components, LLAvatarAppearanceDefines::EBakedTextureIndex index = LLAvatarAppearanceDefines::BAKED_NUM_INDICES) = 0;
|
||||
|
||||
/** Rendering
|
||||
** **
|
||||
|
|
@ -279,7 +279,7 @@ protected:
|
|||
public:
|
||||
void setClothesColor(LLAvatarAppearanceDefines::ETextureIndex te, const LLColor4& new_color);
|
||||
LLColor4 getClothesColor(LLAvatarAppearanceDefines::ETextureIndex te);
|
||||
static BOOL teToColorParams(LLAvatarAppearanceDefines::ETextureIndex te, U32 *param_name);
|
||||
static bool teToColorParams(LLAvatarAppearanceDefines::ETextureIndex te, U32 *param_name);
|
||||
|
||||
//--------------------------------------------------------------------
|
||||
// Global colors
|
||||
|
|
@ -288,9 +288,9 @@ public:
|
|||
LLColor4 getGlobalColor(const std::string& color_name ) const;
|
||||
virtual void onGlobalColorChanged(const LLTexGlobalColor* global_color) = 0;
|
||||
protected:
|
||||
LLTexGlobalColor* mTexSkinColor;
|
||||
LLTexGlobalColor* mTexHairColor;
|
||||
LLTexGlobalColor* mTexEyeColor;
|
||||
LLTexGlobalColor* mTexSkinColor{ nullptr };
|
||||
LLTexGlobalColor* mTexHairColor{ nullptr };
|
||||
LLTexGlobalColor* mTexEyeColor{ nullptr };
|
||||
|
||||
//--------------------------------------------------------------------
|
||||
// Visibility
|
||||
|
|
@ -309,11 +309,11 @@ public:
|
|||
public:
|
||||
LLWearableData* getWearableData() { return mWearableData; }
|
||||
const LLWearableData* getWearableData() const { return mWearableData; }
|
||||
virtual BOOL isTextureDefined(LLAvatarAppearanceDefines::ETextureIndex te, U32 index = 0 ) const = 0;
|
||||
virtual BOOL isWearingWearableType(LLWearableType::EType type ) const;
|
||||
virtual bool isTextureDefined(LLAvatarAppearanceDefines::ETextureIndex te, U32 index = 0 ) const = 0;
|
||||
virtual bool isWearingWearableType(LLWearableType::EType type ) const;
|
||||
|
||||
private:
|
||||
LLWearableData* mWearableData;
|
||||
LLWearableData* mWearableData{ nullptr };
|
||||
|
||||
/********************************************************************************
|
||||
** **
|
||||
|
|
@ -331,11 +331,11 @@ protected:
|
|||
struct BakedTextureData
|
||||
{
|
||||
LLUUID mLastTextureID;
|
||||
LLTexLayerSet* mTexLayerSet; // Only exists for self
|
||||
bool mIsLoaded;
|
||||
bool mIsUsed;
|
||||
LLAvatarAppearanceDefines::ETextureIndex mTextureIndex;
|
||||
U32 mMaskTexName;
|
||||
LLTexLayerSet* mTexLayerSet{ nullptr }; // Only exists for self
|
||||
bool mIsLoaded{ false };
|
||||
bool mIsUsed{ false };
|
||||
LLAvatarAppearanceDefines::ETextureIndex mTextureIndex{ LLAvatarAppearanceDefines::ETextureIndex::TEX_INVALID };
|
||||
U32 mMaskTexName{ 0 };
|
||||
// Stores pointers to the joint meshes that this baked texture deals with
|
||||
avatar_joint_mesh_list_t mJointMeshes;
|
||||
morph_list_t mMaskedMorphs;
|
||||
|
|
@ -352,11 +352,11 @@ protected:
|
|||
// Collision volumes
|
||||
//--------------------------------------------------------------------
|
||||
public:
|
||||
S32 mNumBones;
|
||||
S32 mNumCollisionVolumes;
|
||||
LLAvatarJointCollisionVolume* mCollisionVolumes;
|
||||
S32 mNumBones{ 0 };
|
||||
S32 mNumCollisionVolumes{ 0 };
|
||||
LLAvatarJointCollisionVolume* mCollisionVolumes{ nullptr };
|
||||
protected:
|
||||
BOOL allocateCollisionVolumes(U32 num);
|
||||
bool allocateCollisionVolumes(U32 num);
|
||||
|
||||
/** Physics
|
||||
** **
|
||||
|
|
@ -372,16 +372,16 @@ protected:
|
|||
LLAvatarXmlInfo();
|
||||
~LLAvatarXmlInfo();
|
||||
|
||||
BOOL parseXmlSkeletonNode(LLXmlTreeNode* root);
|
||||
BOOL parseXmlMeshNodes(LLXmlTreeNode* root);
|
||||
BOOL parseXmlColorNodes(LLXmlTreeNode* root);
|
||||
BOOL parseXmlLayerNodes(LLXmlTreeNode* root);
|
||||
BOOL parseXmlDriverNodes(LLXmlTreeNode* root);
|
||||
BOOL parseXmlMorphNodes(LLXmlTreeNode* root);
|
||||
bool parseXmlSkeletonNode(LLXmlTreeNode* root);
|
||||
bool parseXmlMeshNodes(LLXmlTreeNode* root);
|
||||
bool parseXmlColorNodes(LLXmlTreeNode* root);
|
||||
bool parseXmlLayerNodes(LLXmlTreeNode* root);
|
||||
bool parseXmlDriverNodes(LLXmlTreeNode* root);
|
||||
bool parseXmlMorphNodes(LLXmlTreeNode* root);
|
||||
|
||||
struct LLAvatarMeshInfo
|
||||
{
|
||||
typedef std::pair<LLViewerVisualParamInfo*,BOOL> morph_info_pair_t; // LLPolyMorphTargetInfo stored here
|
||||
typedef std::pair<LLViewerVisualParamInfo*,bool> morph_info_pair_t; // LLPolyMorphTargetInfo stored here
|
||||
typedef std::vector<morph_info_pair_t> morph_info_list_t;
|
||||
|
||||
LLAvatarMeshInfo() : mLOD(0), mMinPixelArea(.1f) {}
|
||||
|
|
@ -410,8 +410,8 @@ protected:
|
|||
struct LLAvatarAttachmentInfo
|
||||
{
|
||||
LLAvatarAttachmentInfo()
|
||||
: mGroup(-1), mAttachmentID(-1), mPieMenuSlice(-1), mVisibleFirstPerson(FALSE),
|
||||
mIsHUDAttachment(FALSE), mHasPosition(FALSE), mHasRotation(FALSE) {}
|
||||
: mGroup(-1), mAttachmentID(-1), mPieMenuSlice(-1), mVisibleFirstPerson(false),
|
||||
mIsHUDAttachment(false), mHasPosition(false), mHasRotation(false) {}
|
||||
std::string mName;
|
||||
std::string mJointName;
|
||||
LLVector3 mPosition;
|
||||
|
|
@ -419,10 +419,10 @@ protected:
|
|||
S32 mGroup;
|
||||
S32 mAttachmentID;
|
||||
S32 mPieMenuSlice;
|
||||
BOOL mVisibleFirstPerson;
|
||||
BOOL mIsHUDAttachment;
|
||||
BOOL mHasPosition;
|
||||
BOOL mHasRotation;
|
||||
bool mVisibleFirstPerson;
|
||||
bool mIsHUDAttachment;
|
||||
bool mHasPosition;
|
||||
bool mHasRotation;
|
||||
};
|
||||
typedef std::vector<LLAvatarAttachmentInfo*> attachment_info_list_t;
|
||||
attachment_info_list_t mAttachmentInfoList;
|
||||
|
|
@ -440,11 +440,11 @@ protected:
|
|||
struct LLAvatarMorphInfo
|
||||
{
|
||||
LLAvatarMorphInfo()
|
||||
: mInvert(FALSE) {}
|
||||
: mInvert(false) {}
|
||||
std::string mName;
|
||||
std::string mRegion;
|
||||
std::string mLayer;
|
||||
BOOL mInvert;
|
||||
bool mInvert;
|
||||
};
|
||||
|
||||
typedef std::vector<LLAvatarMorphInfo*> morph_info_list_t;
|
||||
|
|
@ -455,10 +455,10 @@ protected:
|
|||
class LLMaskedMorph
|
||||
{
|
||||
public:
|
||||
LLMaskedMorph(LLVisualParam *morph_target, BOOL invert, std::string layer);
|
||||
LLMaskedMorph(LLVisualParam *morph_target, bool invert, std::string layer);
|
||||
|
||||
LLVisualParam *mMorphTarget;
|
||||
BOOL mInvert;
|
||||
bool mInvert;
|
||||
std::string mLayer;
|
||||
};
|
||||
/** Support Classes
|
||||
|
|
|
|||
|
|
@ -39,56 +39,56 @@ using namespace LLAvatarAppearanceDefines;
|
|||
|
||||
LLAvatarAppearanceDictionary::Textures::Textures()
|
||||
{
|
||||
addEntry(TEX_HEAD_BODYPAINT, new TextureEntry("head_bodypaint", TRUE, BAKED_NUM_INDICES, "", LLWearableType::WT_SKIN));
|
||||
addEntry(TEX_UPPER_SHIRT, new TextureEntry("upper_shirt", TRUE, BAKED_NUM_INDICES, "UIImgDefaultShirtUUID", LLWearableType::WT_SHIRT));
|
||||
addEntry(TEX_LOWER_PANTS, new TextureEntry("lower_pants", TRUE, BAKED_NUM_INDICES, "UIImgDefaultPantsUUID", LLWearableType::WT_PANTS));
|
||||
addEntry(TEX_EYES_IRIS, new TextureEntry("eyes_iris", TRUE, BAKED_NUM_INDICES, "UIImgDefaultEyesUUID", LLWearableType::WT_EYES));
|
||||
addEntry(TEX_HAIR, new TextureEntry("hair_grain", TRUE, BAKED_NUM_INDICES, "UIImgDefaultHairUUID", LLWearableType::WT_HAIR));
|
||||
addEntry(TEX_UPPER_BODYPAINT, new TextureEntry("upper_bodypaint", TRUE, BAKED_NUM_INDICES, "", LLWearableType::WT_SKIN));
|
||||
addEntry(TEX_LOWER_BODYPAINT, new TextureEntry("lower_bodypaint", TRUE, BAKED_NUM_INDICES, "", LLWearableType::WT_SKIN));
|
||||
addEntry(TEX_LOWER_SHOES, new TextureEntry("lower_shoes", TRUE, BAKED_NUM_INDICES, "UIImgDefaultShoesUUID", LLWearableType::WT_SHOES));
|
||||
addEntry(TEX_LOWER_SOCKS, new TextureEntry("lower_socks", TRUE, BAKED_NUM_INDICES, "UIImgDefaultSocksUUID", LLWearableType::WT_SOCKS));
|
||||
addEntry(TEX_UPPER_JACKET, new TextureEntry("upper_jacket", TRUE, BAKED_NUM_INDICES, "UIImgDefaultJacketUUID", LLWearableType::WT_JACKET));
|
||||
addEntry(TEX_LOWER_JACKET, new TextureEntry("lower_jacket", TRUE, BAKED_NUM_INDICES, "UIImgDefaultJacketUUID", LLWearableType::WT_JACKET));
|
||||
addEntry(TEX_UPPER_GLOVES, new TextureEntry("upper_gloves", TRUE, BAKED_NUM_INDICES, "UIImgDefaultGlovesUUID", LLWearableType::WT_GLOVES));
|
||||
addEntry(TEX_UPPER_UNDERSHIRT, new TextureEntry("upper_undershirt", TRUE, BAKED_NUM_INDICES, "UIImgDefaultUnderwearUUID", LLWearableType::WT_UNDERSHIRT));
|
||||
addEntry(TEX_LOWER_UNDERPANTS, new TextureEntry("lower_underpants", TRUE, BAKED_NUM_INDICES, "UIImgDefaultUnderwearUUID", LLWearableType::WT_UNDERPANTS));
|
||||
addEntry(TEX_SKIRT, new TextureEntry("skirt", TRUE, BAKED_NUM_INDICES, "UIImgDefaultSkirtUUID", LLWearableType::WT_SKIRT));
|
||||
addEntry(TEX_HEAD_BODYPAINT, new TextureEntry("head_bodypaint", true, BAKED_NUM_INDICES, "", LLWearableType::WT_SKIN));
|
||||
addEntry(TEX_UPPER_SHIRT, new TextureEntry("upper_shirt", true, BAKED_NUM_INDICES, "UIImgDefaultShirtUUID", LLWearableType::WT_SHIRT));
|
||||
addEntry(TEX_LOWER_PANTS, new TextureEntry("lower_pants", true, BAKED_NUM_INDICES, "UIImgDefaultPantsUUID", LLWearableType::WT_PANTS));
|
||||
addEntry(TEX_EYES_IRIS, new TextureEntry("eyes_iris", true, BAKED_NUM_INDICES, "UIImgDefaultEyesUUID", LLWearableType::WT_EYES));
|
||||
addEntry(TEX_HAIR, new TextureEntry("hair_grain", true, BAKED_NUM_INDICES, "UIImgDefaultHairUUID", LLWearableType::WT_HAIR));
|
||||
addEntry(TEX_UPPER_BODYPAINT, new TextureEntry("upper_bodypaint", true, BAKED_NUM_INDICES, "", LLWearableType::WT_SKIN));
|
||||
addEntry(TEX_LOWER_BODYPAINT, new TextureEntry("lower_bodypaint", true, BAKED_NUM_INDICES, "", LLWearableType::WT_SKIN));
|
||||
addEntry(TEX_LOWER_SHOES, new TextureEntry("lower_shoes", true, BAKED_NUM_INDICES, "UIImgDefaultShoesUUID", LLWearableType::WT_SHOES));
|
||||
addEntry(TEX_LOWER_SOCKS, new TextureEntry("lower_socks", true, BAKED_NUM_INDICES, "UIImgDefaultSocksUUID", LLWearableType::WT_SOCKS));
|
||||
addEntry(TEX_UPPER_JACKET, new TextureEntry("upper_jacket", true, BAKED_NUM_INDICES, "UIImgDefaultJacketUUID", LLWearableType::WT_JACKET));
|
||||
addEntry(TEX_LOWER_JACKET, new TextureEntry("lower_jacket", true, BAKED_NUM_INDICES, "UIImgDefaultJacketUUID", LLWearableType::WT_JACKET));
|
||||
addEntry(TEX_UPPER_GLOVES, new TextureEntry("upper_gloves", true, BAKED_NUM_INDICES, "UIImgDefaultGlovesUUID", LLWearableType::WT_GLOVES));
|
||||
addEntry(TEX_UPPER_UNDERSHIRT, new TextureEntry("upper_undershirt", true, BAKED_NUM_INDICES, "UIImgDefaultUnderwearUUID", LLWearableType::WT_UNDERSHIRT));
|
||||
addEntry(TEX_LOWER_UNDERPANTS, new TextureEntry("lower_underpants", true, BAKED_NUM_INDICES, "UIImgDefaultUnderwearUUID", LLWearableType::WT_UNDERPANTS));
|
||||
addEntry(TEX_SKIRT, new TextureEntry("skirt", true, BAKED_NUM_INDICES, "UIImgDefaultSkirtUUID", LLWearableType::WT_SKIRT));
|
||||
|
||||
addEntry(TEX_LOWER_ALPHA, new TextureEntry("lower_alpha", TRUE, BAKED_NUM_INDICES, "UIImgDefaultAlphaUUID", LLWearableType::WT_ALPHA));
|
||||
addEntry(TEX_UPPER_ALPHA, new TextureEntry("upper_alpha", TRUE, BAKED_NUM_INDICES, "UIImgDefaultAlphaUUID", LLWearableType::WT_ALPHA));
|
||||
addEntry(TEX_HEAD_ALPHA, new TextureEntry("head_alpha", TRUE, BAKED_NUM_INDICES, "UIImgDefaultAlphaUUID", LLWearableType::WT_ALPHA));
|
||||
addEntry(TEX_EYES_ALPHA, new TextureEntry("eyes_alpha", TRUE, BAKED_NUM_INDICES, "UIImgDefaultAlphaUUID", LLWearableType::WT_ALPHA));
|
||||
addEntry(TEX_HAIR_ALPHA, new TextureEntry("hair_alpha", TRUE, BAKED_NUM_INDICES, "UIImgDefaultAlphaUUID", LLWearableType::WT_ALPHA));
|
||||
addEntry(TEX_LOWER_ALPHA, new TextureEntry("lower_alpha", true, BAKED_NUM_INDICES, "UIImgDefaultAlphaUUID", LLWearableType::WT_ALPHA));
|
||||
addEntry(TEX_UPPER_ALPHA, new TextureEntry("upper_alpha", true, BAKED_NUM_INDICES, "UIImgDefaultAlphaUUID", LLWearableType::WT_ALPHA));
|
||||
addEntry(TEX_HEAD_ALPHA, new TextureEntry("head_alpha", true, BAKED_NUM_INDICES, "UIImgDefaultAlphaUUID", LLWearableType::WT_ALPHA));
|
||||
addEntry(TEX_EYES_ALPHA, new TextureEntry("eyes_alpha", true, BAKED_NUM_INDICES, "UIImgDefaultAlphaUUID", LLWearableType::WT_ALPHA));
|
||||
addEntry(TEX_HAIR_ALPHA, new TextureEntry("hair_alpha", true, BAKED_NUM_INDICES, "UIImgDefaultAlphaUUID", LLWearableType::WT_ALPHA));
|
||||
|
||||
addEntry(TEX_HEAD_TATTOO, new TextureEntry("head_tattoo", TRUE, BAKED_NUM_INDICES, "", LLWearableType::WT_TATTOO));
|
||||
addEntry(TEX_UPPER_TATTOO, new TextureEntry("upper_tattoo", TRUE, BAKED_NUM_INDICES, "", LLWearableType::WT_TATTOO));
|
||||
addEntry(TEX_LOWER_TATTOO, new TextureEntry("lower_tattoo", TRUE, BAKED_NUM_INDICES, "", LLWearableType::WT_TATTOO));
|
||||
addEntry(TEX_HEAD_TATTOO, new TextureEntry("head_tattoo", true, BAKED_NUM_INDICES, "", LLWearableType::WT_TATTOO));
|
||||
addEntry(TEX_UPPER_TATTOO, new TextureEntry("upper_tattoo", true, BAKED_NUM_INDICES, "", LLWearableType::WT_TATTOO));
|
||||
addEntry(TEX_LOWER_TATTOO, new TextureEntry("lower_tattoo", true, BAKED_NUM_INDICES, "", LLWearableType::WT_TATTOO));
|
||||
|
||||
addEntry(TEX_HEAD_UNIVERSAL_TATTOO, new TextureEntry("head_universal_tattoo", TRUE, BAKED_NUM_INDICES, "", LLWearableType::WT_UNIVERSAL));
|
||||
addEntry(TEX_UPPER_UNIVERSAL_TATTOO, new TextureEntry("upper_universal_tattoo", TRUE, BAKED_NUM_INDICES, "", LLWearableType::WT_UNIVERSAL));
|
||||
addEntry(TEX_LOWER_UNIVERSAL_TATTOO, new TextureEntry("lower_universal_tattoo", TRUE, BAKED_NUM_INDICES, "", LLWearableType::WT_UNIVERSAL));
|
||||
addEntry(TEX_SKIRT_TATTOO, new TextureEntry("skirt_tattoo", TRUE, BAKED_NUM_INDICES, "", LLWearableType::WT_UNIVERSAL));
|
||||
addEntry(TEX_HAIR_TATTOO, new TextureEntry("hair_tattoo", TRUE, BAKED_NUM_INDICES, "", LLWearableType::WT_UNIVERSAL));
|
||||
addEntry(TEX_EYES_TATTOO, new TextureEntry("eyes_tattoo", TRUE, BAKED_NUM_INDICES, "", LLWearableType::WT_UNIVERSAL));
|
||||
addEntry(TEX_LEFT_ARM_TATTOO, new TextureEntry("leftarm_tattoo", TRUE, BAKED_NUM_INDICES, "", LLWearableType::WT_UNIVERSAL));
|
||||
addEntry(TEX_LEFT_LEG_TATTOO, new TextureEntry("leftleg_tattoo", TRUE, BAKED_NUM_INDICES, "", LLWearableType::WT_UNIVERSAL));
|
||||
addEntry(TEX_AUX1_TATTOO, new TextureEntry("aux1_tattoo", TRUE, BAKED_NUM_INDICES, "", LLWearableType::WT_UNIVERSAL));
|
||||
addEntry(TEX_AUX2_TATTOO, new TextureEntry("aux2_tattoo", TRUE, BAKED_NUM_INDICES, "", LLWearableType::WT_UNIVERSAL));
|
||||
addEntry(TEX_AUX3_TATTOO, new TextureEntry("aux3_tattoo", TRUE, BAKED_NUM_INDICES, "", LLWearableType::WT_UNIVERSAL));
|
||||
addEntry(TEX_HEAD_UNIVERSAL_TATTOO, new TextureEntry("head_universal_tattoo", true, BAKED_NUM_INDICES, "", LLWearableType::WT_UNIVERSAL));
|
||||
addEntry(TEX_UPPER_UNIVERSAL_TATTOO, new TextureEntry("upper_universal_tattoo", true, BAKED_NUM_INDICES, "", LLWearableType::WT_UNIVERSAL));
|
||||
addEntry(TEX_LOWER_UNIVERSAL_TATTOO, new TextureEntry("lower_universal_tattoo", true, BAKED_NUM_INDICES, "", LLWearableType::WT_UNIVERSAL));
|
||||
addEntry(TEX_SKIRT_TATTOO, new TextureEntry("skirt_tattoo", true, BAKED_NUM_INDICES, "", LLWearableType::WT_UNIVERSAL));
|
||||
addEntry(TEX_HAIR_TATTOO, new TextureEntry("hair_tattoo", true, BAKED_NUM_INDICES, "", LLWearableType::WT_UNIVERSAL));
|
||||
addEntry(TEX_EYES_TATTOO, new TextureEntry("eyes_tattoo", true, BAKED_NUM_INDICES, "", LLWearableType::WT_UNIVERSAL));
|
||||
addEntry(TEX_LEFT_ARM_TATTOO, new TextureEntry("leftarm_tattoo", true, BAKED_NUM_INDICES, "", LLWearableType::WT_UNIVERSAL));
|
||||
addEntry(TEX_LEFT_LEG_TATTOO, new TextureEntry("leftleg_tattoo", true, BAKED_NUM_INDICES, "", LLWearableType::WT_UNIVERSAL));
|
||||
addEntry(TEX_AUX1_TATTOO, new TextureEntry("aux1_tattoo", true, BAKED_NUM_INDICES, "", LLWearableType::WT_UNIVERSAL));
|
||||
addEntry(TEX_AUX2_TATTOO, new TextureEntry("aux2_tattoo", true, BAKED_NUM_INDICES, "", LLWearableType::WT_UNIVERSAL));
|
||||
addEntry(TEX_AUX3_TATTOO, new TextureEntry("aux3_tattoo", true, BAKED_NUM_INDICES, "", LLWearableType::WT_UNIVERSAL));
|
||||
|
||||
|
||||
addEntry(TEX_HEAD_BAKED, new TextureEntry("head-baked", FALSE, BAKED_HEAD, "head"));
|
||||
addEntry(TEX_UPPER_BAKED, new TextureEntry("upper-baked", FALSE, BAKED_UPPER, "upper"));
|
||||
addEntry(TEX_LOWER_BAKED, new TextureEntry("lower-baked", FALSE, BAKED_LOWER, "lower"));
|
||||
addEntry(TEX_EYES_BAKED, new TextureEntry("eyes-baked", FALSE, BAKED_EYES, "eyes"));
|
||||
addEntry(TEX_HAIR_BAKED, new TextureEntry("hair-baked", FALSE, BAKED_HAIR, "hair"));
|
||||
addEntry(TEX_SKIRT_BAKED, new TextureEntry("skirt-baked", FALSE, BAKED_SKIRT, "skirt"));
|
||||
addEntry(TEX_LEFT_ARM_BAKED, new TextureEntry("leftarm-baked", FALSE, BAKED_LEFT_ARM, "leftarm"));
|
||||
addEntry(TEX_LEFT_LEG_BAKED, new TextureEntry("leftleg-baked", FALSE, BAKED_LEFT_LEG, "leftleg"));
|
||||
addEntry(TEX_AUX1_BAKED, new TextureEntry("aux1-baked", FALSE, BAKED_AUX1, "aux1"));
|
||||
addEntry(TEX_AUX2_BAKED, new TextureEntry("aux2-baked", FALSE, BAKED_AUX2, "aux2"));
|
||||
addEntry(TEX_AUX3_BAKED, new TextureEntry("aux3-baked", FALSE, BAKED_AUX3, "aux3"));
|
||||
addEntry(TEX_HEAD_BAKED, new TextureEntry("head-baked", false, BAKED_HEAD, "head"));
|
||||
addEntry(TEX_UPPER_BAKED, new TextureEntry("upper-baked", false, BAKED_UPPER, "upper"));
|
||||
addEntry(TEX_LOWER_BAKED, new TextureEntry("lower-baked", false, BAKED_LOWER, "lower"));
|
||||
addEntry(TEX_EYES_BAKED, new TextureEntry("eyes-baked", false, BAKED_EYES, "eyes"));
|
||||
addEntry(TEX_HAIR_BAKED, new TextureEntry("hair-baked", false, BAKED_HAIR, "hair"));
|
||||
addEntry(TEX_SKIRT_BAKED, new TextureEntry("skirt-baked", false, BAKED_SKIRT, "skirt"));
|
||||
addEntry(TEX_LEFT_ARM_BAKED, new TextureEntry("leftarm-baked", false, BAKED_LEFT_ARM, "leftarm"));
|
||||
addEntry(TEX_LEFT_LEG_BAKED, new TextureEntry("leftleg-baked", false, BAKED_LEFT_LEG, "leftleg"));
|
||||
addEntry(TEX_AUX1_BAKED, new TextureEntry("aux1-baked", false, BAKED_AUX1, "aux1"));
|
||||
addEntry(TEX_AUX2_BAKED, new TextureEntry("aux2-baked", false, BAKED_AUX2, "aux2"));
|
||||
addEntry(TEX_AUX3_BAKED, new TextureEntry("aux3-baked", false, BAKED_AUX3, "aux3"));
|
||||
}
|
||||
|
||||
LLAvatarAppearanceDictionary::BakedTextures::BakedTextures()
|
||||
|
|
@ -303,15 +303,15 @@ LLWearableType::EType LLAvatarAppearanceDictionary::getTEWearableType(ETextureIn
|
|||
}
|
||||
|
||||
// static
|
||||
BOOL LLAvatarAppearanceDictionary::isBakedImageId(const LLUUID& id)
|
||||
bool LLAvatarAppearanceDictionary::isBakedImageId(const LLUUID& id)
|
||||
{
|
||||
if ((id == IMG_USE_BAKED_EYES) || (id == IMG_USE_BAKED_HAIR) || (id == IMG_USE_BAKED_HEAD) || (id == IMG_USE_BAKED_LOWER) || (id == IMG_USE_BAKED_SKIRT) || (id == IMG_USE_BAKED_UPPER)
|
||||
|| (id == IMG_USE_BAKED_LEFTARM) || (id == IMG_USE_BAKED_LEFTLEG) || (id == IMG_USE_BAKED_AUX1) || (id == IMG_USE_BAKED_AUX2) || (id == IMG_USE_BAKED_AUX3) )
|
||||
{
|
||||
return TRUE;
|
||||
return true;
|
||||
}
|
||||
|
||||
return FALSE;
|
||||
return false;
|
||||
}
|
||||
|
||||
// static
|
||||
|
|
|
|||
|
|
@ -40,7 +40,7 @@ namespace LLAvatarAppearanceDefines
|
|||
extern const S32 SCRATCH_TEX_WIDTH;
|
||||
extern const S32 SCRATCH_TEX_HEIGHT;
|
||||
|
||||
static const U32 AVATAR_HOVER = 11001;
|
||||
static constexpr U32 AVATAR_HOVER = 11001;
|
||||
|
||||
//--------------------------------------------------------------------
|
||||
// Enums
|
||||
|
|
@ -167,10 +167,10 @@ public:
|
|||
const std::string mDefaultImageName;
|
||||
const LLWearableType::EType mWearableType;
|
||||
// It's either a local texture xor baked
|
||||
BOOL mIsLocalTexture;
|
||||
BOOL mIsBakedTexture;
|
||||
bool mIsLocalTexture;
|
||||
bool mIsBakedTexture;
|
||||
// If it's a local texture, it may be used by a baked texture
|
||||
BOOL mIsUsedByBakedTexture;
|
||||
bool mIsUsedByBakedTexture;
|
||||
EBakedTextureIndex mBakedTextureIndex;
|
||||
};
|
||||
|
||||
|
|
@ -244,7 +244,7 @@ public:
|
|||
// Given a texture entry, determine which wearable type owns it.
|
||||
LLWearableType::EType getTEWearableType(ETextureIndex index) const;
|
||||
|
||||
static BOOL isBakedImageId(const LLUUID& id);
|
||||
static bool isBakedImageId(const LLUUID& id);
|
||||
static EBakedTextureIndex assetIdToBakedTextureIndex(const LLUUID& id);
|
||||
static LLUUID localTextureIndexToMagicId(ETextureIndex t);
|
||||
|
||||
|
|
|
|||
|
|
@ -40,7 +40,7 @@ const F32 DEFAULT_AVATAR_JOINT_LOD = 0.0f;
|
|||
//-----------------------------------------------------------------------------
|
||||
// Static Data
|
||||
//-----------------------------------------------------------------------------
|
||||
BOOL LLAvatarJoint::sDisableLOD = FALSE;
|
||||
bool LLAvatarJoint::sDisableLOD = false;
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
// LLAvatarJoint()
|
||||
|
|
@ -66,13 +66,13 @@ LLAvatarJoint::LLAvatarJoint(const std::string &name, LLJoint *parent) :
|
|||
|
||||
void LLAvatarJoint::init()
|
||||
{
|
||||
mValid = FALSE;
|
||||
mValid = false;
|
||||
mComponents = SC_JOINT | SC_BONE | SC_AXES;
|
||||
mMinPixelArea = DEFAULT_AVATAR_JOINT_LOD;
|
||||
mPickName = PN_DEFAULT;
|
||||
mVisible = TRUE;
|
||||
mVisible = true;
|
||||
mMeshID = 0;
|
||||
mIsTransparent = FALSE;
|
||||
mIsTransparent = false;
|
||||
}
|
||||
|
||||
|
||||
|
|
@ -88,7 +88,7 @@ LLAvatarJoint::~LLAvatarJoint()
|
|||
//--------------------------------------------------------------------
|
||||
// setValid()
|
||||
//--------------------------------------------------------------------
|
||||
void LLAvatarJoint::setValid( BOOL valid, BOOL recursive )
|
||||
void LLAvatarJoint::setValid( bool valid, bool recursive )
|
||||
{
|
||||
//----------------------------------------------------------------
|
||||
// set visibility for this joint
|
||||
|
|
@ -103,7 +103,7 @@ void LLAvatarJoint::setValid( BOOL valid, BOOL recursive )
|
|||
for (LLJoint* child : mChildren)
|
||||
{
|
||||
LLAvatarJoint* joint = static_cast<LLAvatarJoint*>(child);
|
||||
joint->setValid(valid, TRUE);
|
||||
joint->setValid(valid, true);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -112,7 +112,7 @@ void LLAvatarJoint::setValid( BOOL valid, BOOL recursive )
|
|||
//--------------------------------------------------------------------
|
||||
// setSkeletonComponents()
|
||||
//--------------------------------------------------------------------
|
||||
void LLAvatarJoint::setSkeletonComponents( U32 comp, BOOL recursive )
|
||||
void LLAvatarJoint::setSkeletonComponents( U32 comp, bool recursive )
|
||||
{
|
||||
mComponents = comp;
|
||||
if (recursive)
|
||||
|
|
@ -125,7 +125,7 @@ void LLAvatarJoint::setSkeletonComponents( U32 comp, BOOL recursive )
|
|||
}
|
||||
}
|
||||
|
||||
void LLAvatarJoint::setVisible(BOOL visible, BOOL recursive)
|
||||
void LLAvatarJoint::setVisible(bool visible, bool recursive)
|
||||
{
|
||||
mVisible = visible;
|
||||
|
||||
|
|
@ -148,7 +148,7 @@ void LLAvatarJoint::updateFaceSizes(U32 &num_vertices, U32& num_indices, F32 pix
|
|||
}
|
||||
}
|
||||
|
||||
void LLAvatarJoint::updateFaceData(LLFace *face, F32 pixel_area, BOOL damp_wind, bool terse_update)
|
||||
void LLAvatarJoint::updateFaceData(LLFace *face, F32 pixel_area, bool damp_wind, bool terse_update)
|
||||
{
|
||||
for (LLJoint* child : mChildren)
|
||||
{
|
||||
|
|
@ -167,10 +167,10 @@ void LLAvatarJoint::updateJointGeometry()
|
|||
}
|
||||
|
||||
|
||||
BOOL LLAvatarJoint::updateLOD(F32 pixel_area, BOOL activate)
|
||||
bool LLAvatarJoint::updateLOD(F32 pixel_area, bool activate)
|
||||
{
|
||||
BOOL lod_changed = FALSE;
|
||||
BOOL found_lod = FALSE;
|
||||
bool lod_changed = false;
|
||||
bool found_lod = false;
|
||||
|
||||
for (LLJoint* child : mChildren)
|
||||
{
|
||||
|
|
@ -180,18 +180,18 @@ BOOL LLAvatarJoint::updateLOD(F32 pixel_area, BOOL activate)
|
|||
if (found_lod || jointLOD == DEFAULT_AVATAR_JOINT_LOD)
|
||||
{
|
||||
// we've already found a joint to enable, so enable the rest as alternatives
|
||||
lod_changed |= joint->updateLOD(pixel_area, TRUE);
|
||||
lod_changed |= joint->updateLOD(pixel_area, true);
|
||||
}
|
||||
else
|
||||
{
|
||||
if (pixel_area >= jointLOD || sDisableLOD)
|
||||
{
|
||||
lod_changed |= joint->updateLOD(pixel_area, TRUE);
|
||||
found_lod = TRUE;
|
||||
lod_changed |= joint->updateLOD(pixel_area, true);
|
||||
found_lod = true;
|
||||
}
|
||||
else
|
||||
{
|
||||
lod_changed |= joint->updateLOD(pixel_area, FALSE);
|
||||
lod_changed |= joint->updateLOD(pixel_area, false);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -222,11 +222,11 @@ void LLAvatarJoint::setMeshesToChildren()
|
|||
|
||||
LLAvatarJointCollisionVolume::LLAvatarJointCollisionVolume()
|
||||
{
|
||||
mUpdateXform = FALSE;
|
||||
mUpdateXform = false;
|
||||
}
|
||||
|
||||
/*virtual*/
|
||||
U32 LLAvatarJointCollisionVolume::render( F32 pixelArea, BOOL first_pass, BOOL is_dummy )
|
||||
U32 LLAvatarJointCollisionVolume::render( F32 pixelArea, bool first_pass, bool is_dummy )
|
||||
{
|
||||
LL_ERRS() << "Cannot call render() on LLAvatarJointCollisionVolume" << LL_ENDL;
|
||||
return 0;
|
||||
|
|
@ -234,7 +234,7 @@ U32 LLAvatarJointCollisionVolume::render( F32 pixelArea, BOOL first_pass, BOOL i
|
|||
|
||||
LLVector3 LLAvatarJointCollisionVolume::getVolumePos(LLVector3 &offset)
|
||||
{
|
||||
mUpdateXform = TRUE;
|
||||
mUpdateXform = true;
|
||||
|
||||
LLVector3 result = offset;
|
||||
result.scaleVec(getScale());
|
||||
|
|
|
|||
|
|
@ -52,17 +52,17 @@ public:
|
|||
virtual ~LLAvatarJoint();
|
||||
|
||||
// Gets the validity of this joint
|
||||
BOOL getValid() { return mValid; }
|
||||
bool getValid() { return mValid; }
|
||||
|
||||
// Sets the validity of this joint
|
||||
virtual void setValid( BOOL valid, BOOL recursive=FALSE );
|
||||
virtual void setValid( bool valid, bool recursive=false );
|
||||
|
||||
// Returns true if this object is transparent.
|
||||
// This is used to determine in which order to draw objects.
|
||||
virtual BOOL isTransparent() { return mIsTransparent; }
|
||||
virtual bool isTransparent() { return mIsTransparent; }
|
||||
|
||||
// Returns true if this object should inherit scale modifiers from its immediate parent
|
||||
virtual BOOL inheritScale() { return FALSE; }
|
||||
virtual bool inheritScale() { return false; }
|
||||
|
||||
enum Components
|
||||
{
|
||||
|
|
@ -72,7 +72,7 @@ public:
|
|||
};
|
||||
|
||||
// Selects which skeleton components to draw
|
||||
void setSkeletonComponents( U32 comp, BOOL recursive = TRUE );
|
||||
void setSkeletonComponents( U32 comp, bool recursive = true );
|
||||
|
||||
// Returns which skeleton components are enables for drawing
|
||||
U32 getSkeletonComponents() { return mComponents; }
|
||||
|
|
@ -90,34 +90,34 @@ public:
|
|||
void setPickName(LLJointPickName name) { mPickName = name; }
|
||||
LLJointPickName getPickName() { return mPickName; }
|
||||
|
||||
void setVisible( BOOL visible, BOOL recursive );
|
||||
void setVisible( bool visible, bool recursive );
|
||||
|
||||
// Takes meshes in mMeshParts and sets each one as a child joint
|
||||
void setMeshesToChildren();
|
||||
|
||||
// LLViewerJoint interface
|
||||
virtual U32 render( F32 pixelArea, BOOL first_pass = TRUE, BOOL is_dummy = FALSE ) = 0;
|
||||
virtual U32 render( F32 pixelArea, bool first_pass = true, bool is_dummy = false ) = 0;
|
||||
virtual void updateFaceSizes(U32 &num_vertices, U32& num_indices, F32 pixel_area);
|
||||
virtual void updateFaceData(LLFace *face, F32 pixel_area, BOOL damp_wind = FALSE, bool terse_update = false);
|
||||
virtual BOOL updateLOD(F32 pixel_area, BOOL activate);
|
||||
virtual void updateFaceData(LLFace *face, F32 pixel_area, bool damp_wind = false, bool terse_update = false);
|
||||
virtual bool updateLOD(F32 pixel_area, bool activate);
|
||||
virtual void updateJointGeometry();
|
||||
virtual void dump();
|
||||
|
||||
|
||||
public:
|
||||
static BOOL sDisableLOD;
|
||||
static bool sDisableLOD;
|
||||
avatar_joint_mesh_list_t mMeshParts; //LLViewerJointMesh*
|
||||
void setMeshID( S32 id ) {mMeshID = id;}
|
||||
|
||||
protected:
|
||||
void init();
|
||||
|
||||
BOOL mValid;
|
||||
BOOL mIsTransparent;
|
||||
bool mValid;
|
||||
bool mIsTransparent;
|
||||
U32 mComponents;
|
||||
F32 mMinPixelArea;
|
||||
LLJointPickName mPickName;
|
||||
BOOL mVisible;
|
||||
bool mVisible;
|
||||
S32 mMeshID;
|
||||
};
|
||||
|
||||
|
|
@ -127,8 +127,8 @@ public:
|
|||
LLAvatarJointCollisionVolume();
|
||||
virtual ~LLAvatarJointCollisionVolume() {};
|
||||
|
||||
/*virtual*/ BOOL inheritScale() { return TRUE; }
|
||||
/*virtual*/ U32 render( F32 pixelArea, BOOL first_pass = TRUE, BOOL is_dummy = FALSE );
|
||||
/*virtual*/ bool inheritScale() { return true; }
|
||||
/*virtual*/ U32 render( F32 pixelArea, bool first_pass = true, bool is_dummy = false );
|
||||
|
||||
void renderCollision();
|
||||
|
||||
|
|
|
|||
|
|
@ -102,7 +102,7 @@ LLSkinJoint::~LLSkinJoint()
|
|||
//-----------------------------------------------------------------------------
|
||||
// LLSkinJoint::setupSkinJoint()
|
||||
//-----------------------------------------------------------------------------
|
||||
BOOL LLSkinJoint::setupSkinJoint( LLAvatarJoint *joint)
|
||||
bool LLSkinJoint::setupSkinJoint( LLAvatarJoint *joint)
|
||||
{
|
||||
// find the named joint
|
||||
mJoint = joint;
|
||||
|
|
@ -119,7 +119,7 @@ BOOL LLSkinJoint::setupSkinJoint( LLAvatarJoint *joint)
|
|||
mRootToParentJointSkinOffset = totalSkinOffset(getBaseSkeletonAncestor(joint));
|
||||
mRootToParentJointSkinOffset = -mRootToParentJointSkinOffset;
|
||||
|
||||
return TRUE;
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
|
|
@ -129,7 +129,7 @@ BOOL LLSkinJoint::setupSkinJoint( LLAvatarJoint *joint)
|
|||
//-----------------------------------------------------------------------------
|
||||
//-----------------------------------------------------------------------------
|
||||
|
||||
BOOL LLAvatarJointMesh::sPipelineRender = FALSE;
|
||||
bool LLAvatarJointMesh::sPipelineRender = false;
|
||||
U32 LLAvatarJointMesh::sClothingMaskImageName = 0;
|
||||
LLColor4 LLAvatarJointMesh::sClothingInnerColor;
|
||||
|
||||
|
|
@ -149,7 +149,7 @@ LLAvatarJointMesh::LLAvatarJointMesh()
|
|||
mColor[2] = 1.0f;
|
||||
mColor[3] = 1.0f;
|
||||
mShiny = 0.0f;
|
||||
mCullBackFaces = TRUE;
|
||||
mCullBackFaces = true;
|
||||
|
||||
mMesh = NULL;
|
||||
|
||||
|
|
@ -159,11 +159,11 @@ LLAvatarJointMesh::LLAvatarJointMesh()
|
|||
mFace = NULL;
|
||||
|
||||
mMeshID = 0;
|
||||
mUpdateXform = FALSE;
|
||||
mUpdateXform = false;
|
||||
|
||||
mValid = FALSE;
|
||||
mValid = false;
|
||||
|
||||
mIsTransparent = FALSE;
|
||||
mIsTransparent = false;
|
||||
}
|
||||
|
||||
|
||||
|
|
@ -182,11 +182,11 @@ LLAvatarJointMesh::~LLAvatarJointMesh()
|
|||
//-----------------------------------------------------------------------------
|
||||
// LLAvatarJointMesh::allocateSkinData()
|
||||
//-----------------------------------------------------------------------------
|
||||
BOOL LLAvatarJointMesh::allocateSkinData( U32 numSkinJoints )
|
||||
bool LLAvatarJointMesh::allocateSkinData( U32 numSkinJoints )
|
||||
{
|
||||
mSkinJoints = new LLSkinJoint[ numSkinJoints ];
|
||||
mNumSkinJoints = numSkinJoints;
|
||||
return TRUE;
|
||||
return true;
|
||||
}
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
|
|
@ -247,12 +247,12 @@ void LLAvatarJointMesh::setTexture( LLGLTexture *texture )
|
|||
{
|
||||
mLayerSet = NULL;
|
||||
//texture->bindTexture(0);
|
||||
//texture->setClamp(TRUE, TRUE);
|
||||
//texture->setClamp(true, true);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
BOOL LLAvatarJointMesh::hasGLTexture() const
|
||||
bool LLAvatarJointMesh::hasGLTexture() const
|
||||
{
|
||||
return mTexture.notNull() && mTexture->hasGLTexture();
|
||||
}
|
||||
|
|
@ -272,7 +272,7 @@ void LLAvatarJointMesh::setLayerSet( LLTexLayerSet* layer_set )
|
|||
}
|
||||
}
|
||||
|
||||
BOOL LLAvatarJointMesh::hasComposite() const
|
||||
bool LLAvatarJointMesh::hasComposite() const
|
||||
{
|
||||
return (mLayerSet && mLayerSet->hasComposite());
|
||||
}
|
||||
|
|
|
|||
|
|
@ -49,7 +49,7 @@ class LLSkinJoint
|
|||
public:
|
||||
LLSkinJoint();
|
||||
~LLSkinJoint();
|
||||
BOOL setupSkinJoint( LLAvatarJoint *joint);
|
||||
bool setupSkinJoint( LLAvatarJoint *joint);
|
||||
|
||||
LLAvatarJoint *mJoint;
|
||||
LLVector3 mRootToJointSkinOffset;
|
||||
|
|
@ -69,7 +69,7 @@ protected:
|
|||
LLTexLayerSet* mLayerSet; // ptr to a layer set owned by the avatar
|
||||
U32 mTestImageName; // handle to a temporary texture for previewing uploads
|
||||
LLPolyMesh* mMesh; // ptr to a global polymesh
|
||||
BOOL mCullBackFaces; // true by default
|
||||
bool mCullBackFaces; // true by default
|
||||
LLFace* mFace; // ptr to a face w/ AGP copy of mesh
|
||||
|
||||
U32 mFaceIndexCount;
|
||||
|
|
@ -79,7 +79,7 @@ protected:
|
|||
S32 mMeshID;
|
||||
|
||||
public:
|
||||
static BOOL sPipelineRender;
|
||||
static bool sPipelineRender;
|
||||
//RN: this is here for testing purposes
|
||||
static U32 sClothingMaskImageName;
|
||||
static LLColor4 sClothingInnerColor;
|
||||
|
|
@ -104,14 +104,14 @@ public:
|
|||
// Sets the shape texture
|
||||
void setTexture( LLGLTexture *texture );
|
||||
|
||||
BOOL hasGLTexture() const;
|
||||
bool hasGLTexture() const;
|
||||
|
||||
void setTestTexture( U32 name ) { mTestImageName = name; }
|
||||
|
||||
// Sets layer set responsible for a dynamic shape texture (takes precedence over normal texture)
|
||||
void setLayerSet( LLTexLayerSet* layer_set );
|
||||
|
||||
BOOL hasComposite() const;
|
||||
bool hasComposite() const;
|
||||
|
||||
// Gets the poly mesh
|
||||
LLPolyMesh *getMesh();
|
||||
|
|
@ -122,20 +122,17 @@ public:
|
|||
// Sets up joint matrix data for rendering
|
||||
void setupJoint(LLAvatarJoint* current_joint);
|
||||
|
||||
// Render time method to upload batches of joint matrices
|
||||
void uploadJointMatrices();
|
||||
|
||||
// Sets ID for picking
|
||||
void setMeshID( S32 id ) {mMeshID = id;}
|
||||
|
||||
// Gets ID for picking
|
||||
S32 getMeshID() { return mMeshID; }
|
||||
|
||||
void setIsTransparent(BOOL is_transparent) { mIsTransparent = is_transparent; }
|
||||
void setIsTransparent(bool is_transparent) { mIsTransparent = is_transparent; }
|
||||
|
||||
private:
|
||||
// Allocate skin data
|
||||
BOOL allocateSkinData( U32 numSkinJoints );
|
||||
bool allocateSkinData( U32 numSkinJoints );
|
||||
|
||||
// Free skin data
|
||||
void freeSkinData();
|
||||
|
|
|
|||
|
|
@ -41,16 +41,16 @@ LLDriverParamInfo::LLDriverParamInfo() :
|
|||
{
|
||||
}
|
||||
|
||||
BOOL LLDriverParamInfo::parseXml(LLXmlTreeNode* node)
|
||||
bool LLDriverParamInfo::parseXml(LLXmlTreeNode* node)
|
||||
{
|
||||
llassert( node->hasName( "param" ) && node->getChildByName( "param_driver" ) );
|
||||
|
||||
if( !LLViewerVisualParamInfo::parseXml( node ))
|
||||
return FALSE;
|
||||
return false;
|
||||
|
||||
LLXmlTreeNode* param_driver_node = node->getChildByName( "param_driver" );
|
||||
if( !param_driver_node )
|
||||
return FALSE;
|
||||
return false;
|
||||
|
||||
for (LLXmlTreeNode* child = param_driver_node->getChildByName( "driven" );
|
||||
child;
|
||||
|
|
@ -90,10 +90,10 @@ BOOL LLDriverParamInfo::parseXml(LLXmlTreeNode* node)
|
|||
else
|
||||
{
|
||||
LL_ERRS() << "<driven> Unable to resolve driven parameter: " << driven_id << LL_ENDL;
|
||||
return FALSE;
|
||||
return false;
|
||||
}
|
||||
}
|
||||
return TRUE;
|
||||
return true;
|
||||
}
|
||||
|
||||
//virtual
|
||||
|
|
@ -187,18 +187,18 @@ LLDriverParam::~LLDriverParam()
|
|||
{
|
||||
}
|
||||
|
||||
BOOL LLDriverParam::setInfo(LLDriverParamInfo *info)
|
||||
bool LLDriverParam::setInfo(LLDriverParamInfo *info)
|
||||
{
|
||||
llassert(mInfo == NULL);
|
||||
if (info->mID < 0)
|
||||
return FALSE;
|
||||
return false;
|
||||
mInfo = info;
|
||||
mID = info->mID;
|
||||
info->mDriverParam = this;
|
||||
|
||||
setWeight(getDefaultWeight());
|
||||
|
||||
return TRUE;
|
||||
return true;
|
||||
}
|
||||
|
||||
/*virtual*/ LLViewerVisualParam* LLDriverParam::cloneParam(LLWearable* wearable) const
|
||||
|
|
@ -422,7 +422,7 @@ const LLVector4a* LLDriverParam::getNextDistortion(U32 *index, LLPolyMesh **po
|
|||
|
||||
S32 LLDriverParam::getDrivenParamsCount() const
|
||||
{
|
||||
return mDriven.size();
|
||||
return static_cast<S32>(mDriven.size());
|
||||
}
|
||||
|
||||
const LLViewerVisualParam* LLDriverParam::getDrivenParam(S32 index) const
|
||||
|
|
@ -461,25 +461,25 @@ void LLDriverParam::stopAnimating()
|
|||
|
||||
for(LLDrivenEntry& driven : mDriven)
|
||||
{
|
||||
driven.mParam->setAnimating(FALSE);
|
||||
driven.mParam->setAnimating(false);
|
||||
}
|
||||
}
|
||||
|
||||
/*virtual*/
|
||||
BOOL LLDriverParam::linkDrivenParams(visual_param_mapper mapper, BOOL only_cross_params)
|
||||
bool LLDriverParam::linkDrivenParams(visual_param_mapper mapper, bool only_cross_params)
|
||||
{
|
||||
BOOL success = TRUE;
|
||||
bool success = true;
|
||||
for (LLDrivenEntryInfo& driven_info : getInfo()->mDrivenInfoList)
|
||||
{
|
||||
S32 driven_id = driven_info.mDrivenID;
|
||||
|
||||
// check for already existing links. Do not overwrite.
|
||||
BOOL found = FALSE;
|
||||
bool found = false;
|
||||
for (auto& driven : mDriven)
|
||||
{
|
||||
if (driven.mInfo->mDrivenID == driven_id)
|
||||
{
|
||||
found = TRUE;
|
||||
found = true;
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -494,7 +494,7 @@ BOOL LLDriverParam::linkDrivenParams(visual_param_mapper mapper, BOOL only_cross
|
|||
}
|
||||
else
|
||||
{
|
||||
success = FALSE;
|
||||
success = false;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -65,7 +65,7 @@ public:
|
|||
LLDriverParamInfo();
|
||||
/*virtual*/ ~LLDriverParamInfo() {};
|
||||
|
||||
/*virtual*/ BOOL parseXml(LLXmlTreeNode* node);
|
||||
/*virtual*/ bool parseXml(LLXmlTreeNode* node);
|
||||
|
||||
/*virtual*/ void toStream(std::ostream &out);
|
||||
|
||||
|
|
@ -90,7 +90,7 @@ public:
|
|||
// Special: These functions are overridden by child classes
|
||||
LLDriverParamInfo* getInfo() const { return (LLDriverParamInfo*)mInfo; }
|
||||
// This sets mInfo and calls initialization functions
|
||||
BOOL setInfo(LLDriverParamInfo* info);
|
||||
bool setInfo(LLDriverParamInfo* info);
|
||||
|
||||
LLAvatarAppearance* getAvatarAppearance() { return mAvatarAppearance; }
|
||||
const LLAvatarAppearance* getAvatarAppearance() const { return mAvatarAppearance; }
|
||||
|
|
@ -104,7 +104,7 @@ public:
|
|||
/*virtual*/ void setWeight(F32 weight);
|
||||
/*virtual*/ void setAnimationTarget(F32 target_value);
|
||||
/*virtual*/ void stopAnimating();
|
||||
/*virtual*/ BOOL linkDrivenParams(visual_param_mapper mapper, BOOL only_cross_params);
|
||||
/*virtual*/ bool linkDrivenParams(visual_param_mapper mapper, bool only_cross_params);
|
||||
/*virtual*/ void resetDrivenParams();
|
||||
|
||||
// LLViewerVisualParam Virtual functions
|
||||
|
|
@ -130,10 +130,10 @@ protected:
|
|||
|
||||
LL_ALIGN_16(LLVector4a mDefaultVec); // temp holder
|
||||
entry_list_t mDriven;
|
||||
LLViewerVisualParam* mCurrentDistortionParam;
|
||||
LLViewerVisualParam* mCurrentDistortionParam{ nullptr };
|
||||
// Backlink only; don't make this an LLPointer.
|
||||
LLAvatarAppearance* mAvatarAppearance;
|
||||
LLWearable* mWearablep;
|
||||
LLAvatarAppearance* mAvatarAppearance{ nullptr };
|
||||
LLWearable* mWearablep{ nullptr };
|
||||
};
|
||||
|
||||
#endif // LL_LLDRIVERPARAM_H
|
||||
|
|
|
|||
|
|
@ -36,14 +36,14 @@
|
|||
|
||||
|
||||
LLLocalTextureObject::LLLocalTextureObject() :
|
||||
mIsBakedReady(FALSE),
|
||||
mIsBakedReady(false),
|
||||
mDiscard(MAX_DISCARD_LEVEL+1)
|
||||
{
|
||||
mImage = NULL;
|
||||
}
|
||||
|
||||
LLLocalTextureObject::LLLocalTextureObject(LLGLTexture* image, const LLUUID& id) :
|
||||
mIsBakedReady(FALSE),
|
||||
mIsBakedReady(false),
|
||||
mDiscard(MAX_DISCARD_LEVEL+1)
|
||||
{
|
||||
mImage = image;
|
||||
|
|
@ -109,7 +109,7 @@ LLTexLayer* LLLocalTextureObject::getTexLayer(const std::string &name)
|
|||
|
||||
U32 LLLocalTextureObject::getNumTexLayers() const
|
||||
{
|
||||
return mTexLayers.size();
|
||||
return static_cast<U32>(mTexLayers.size());
|
||||
}
|
||||
|
||||
LLUUID LLLocalTextureObject::getID() const
|
||||
|
|
@ -122,7 +122,7 @@ S32 LLLocalTextureObject::getDiscard() const
|
|||
return mDiscard;
|
||||
}
|
||||
|
||||
BOOL LLLocalTextureObject::getBakedReady() const
|
||||
bool LLLocalTextureObject::getBakedReady() const
|
||||
{
|
||||
return mIsBakedReady;
|
||||
}
|
||||
|
|
@ -132,11 +132,11 @@ void LLLocalTextureObject::setImage(LLGLTexture* new_image)
|
|||
mImage = new_image;
|
||||
}
|
||||
|
||||
BOOL LLLocalTextureObject::setTexLayer(LLTexLayer *new_tex_layer, U32 index)
|
||||
bool LLLocalTextureObject::setTexLayer(LLTexLayer *new_tex_layer, U32 index)
|
||||
{
|
||||
if (index >= getNumTexLayers() )
|
||||
{
|
||||
return FALSE;
|
||||
return false;
|
||||
}
|
||||
|
||||
if (new_tex_layer == NULL)
|
||||
|
|
@ -153,47 +153,47 @@ BOOL LLLocalTextureObject::setTexLayer(LLTexLayer *new_tex_layer, U32 index)
|
|||
}
|
||||
mTexLayers[index] = layer;
|
||||
|
||||
return TRUE;
|
||||
return true;
|
||||
}
|
||||
|
||||
BOOL LLLocalTextureObject::addTexLayer(LLTexLayer *new_tex_layer, LLWearable *wearable)
|
||||
bool LLLocalTextureObject::addTexLayer(LLTexLayer *new_tex_layer, LLWearable *wearable)
|
||||
{
|
||||
if (new_tex_layer == NULL)
|
||||
{
|
||||
return FALSE;
|
||||
return false;
|
||||
}
|
||||
|
||||
LLTexLayer *layer = new LLTexLayer(*new_tex_layer, wearable);
|
||||
layer->setLTO(this);
|
||||
mTexLayers.push_back(layer);
|
||||
return TRUE;
|
||||
return true;
|
||||
}
|
||||
|
||||
BOOL LLLocalTextureObject::addTexLayer(LLTexLayerTemplate *new_tex_layer, LLWearable *wearable)
|
||||
bool LLLocalTextureObject::addTexLayer(LLTexLayerTemplate *new_tex_layer, LLWearable *wearable)
|
||||
{
|
||||
if (new_tex_layer == NULL)
|
||||
{
|
||||
return FALSE;
|
||||
return false;
|
||||
}
|
||||
|
||||
LLTexLayer *layer = new LLTexLayer(*new_tex_layer, this, wearable);
|
||||
layer->setLTO(this);
|
||||
mTexLayers.push_back(layer);
|
||||
return TRUE;
|
||||
return true;
|
||||
}
|
||||
|
||||
BOOL LLLocalTextureObject::removeTexLayer(U32 index)
|
||||
bool LLLocalTextureObject::removeTexLayer(U32 index)
|
||||
{
|
||||
if (index >= getNumTexLayers())
|
||||
{
|
||||
return FALSE;
|
||||
return false;
|
||||
}
|
||||
tex_layer_vec_t::iterator iter = mTexLayers.begin();
|
||||
iter += index;
|
||||
|
||||
delete *iter;
|
||||
mTexLayers.erase(iter);
|
||||
return TRUE;
|
||||
return true;
|
||||
}
|
||||
|
||||
void LLLocalTextureObject::setID(LLUUID new_id)
|
||||
|
|
@ -206,7 +206,7 @@ void LLLocalTextureObject::setDiscard(S32 new_discard)
|
|||
mDiscard = new_discard;
|
||||
}
|
||||
|
||||
void LLLocalTextureObject::setBakedReady(BOOL ready)
|
||||
void LLLocalTextureObject::setBakedReady(bool ready)
|
||||
{
|
||||
mIsBakedReady = ready;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -53,17 +53,17 @@ public:
|
|||
U32 getNumTexLayers() const;
|
||||
LLUUID getID() const;
|
||||
S32 getDiscard() const;
|
||||
BOOL getBakedReady() const;
|
||||
bool getBakedReady() const;
|
||||
|
||||
void setImage(LLGLTexture* new_image);
|
||||
BOOL setTexLayer(LLTexLayer *new_tex_layer, U32 index);
|
||||
BOOL addTexLayer(LLTexLayer *new_tex_layer, LLWearable *wearable);
|
||||
BOOL addTexLayer(LLTexLayerTemplate *new_tex_layer, LLWearable *wearable);
|
||||
BOOL removeTexLayer(U32 index);
|
||||
bool setTexLayer(LLTexLayer *new_tex_layer, U32 index);
|
||||
bool addTexLayer(LLTexLayer *new_tex_layer, LLWearable *wearable);
|
||||
bool addTexLayer(LLTexLayerTemplate *new_tex_layer, LLWearable *wearable);
|
||||
bool removeTexLayer(U32 index);
|
||||
|
||||
void setID(LLUUID new_id);
|
||||
void setDiscard(S32 new_discard);
|
||||
void setBakedReady(BOOL ready);
|
||||
void setBakedReady(bool ready);
|
||||
|
||||
protected:
|
||||
|
||||
|
|
@ -78,7 +78,7 @@ private:
|
|||
|
||||
LLUUID mID;
|
||||
|
||||
BOOL mIsBakedReady;
|
||||
bool mIsBakedReady;
|
||||
S32 mDiscard;
|
||||
};
|
||||
|
||||
|
|
|
|||
|
|
@ -72,8 +72,8 @@ LLPolyMeshSharedData::LLPolyMeshSharedData()
|
|||
mTexCoords = NULL;
|
||||
mDetailTexCoords = NULL;
|
||||
mWeights = NULL;
|
||||
mHasWeights = FALSE;
|
||||
mHasDetailTexCoords = FALSE;
|
||||
mHasWeights = false;
|
||||
mHasDetailTexCoords = false;
|
||||
|
||||
mNumFaces = 0;
|
||||
mFaces = NULL;
|
||||
|
|
@ -225,7 +225,7 @@ U32 LLPolyMeshSharedData::getNumKB()
|
|||
//-----------------------------------------------------------------------------
|
||||
// LLPolyMeshSharedData::allocateVertexData()
|
||||
//-----------------------------------------------------------------------------
|
||||
BOOL LLPolyMeshSharedData::allocateVertexData( U32 numVertices )
|
||||
bool LLPolyMeshSharedData::allocateVertexData( U32 numVertices )
|
||||
{
|
||||
U32 i;
|
||||
mBaseCoords = (LLVector4a*) ll_aligned_malloc_16(numVertices*sizeof(LLVector4a));
|
||||
|
|
@ -243,34 +243,34 @@ BOOL LLPolyMeshSharedData::allocateVertexData( U32 numVertices )
|
|||
mWeights[i] = 0.f;
|
||||
}
|
||||
mNumVertices = numVertices;
|
||||
return TRUE;
|
||||
return true;
|
||||
}
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
// LLPolyMeshSharedData::allocateFaceData()
|
||||
//-----------------------------------------------------------------------------
|
||||
BOOL LLPolyMeshSharedData::allocateFaceData( U32 numFaces )
|
||||
bool LLPolyMeshSharedData::allocateFaceData( U32 numFaces )
|
||||
{
|
||||
mFaces = new LLPolyFace[ numFaces ];
|
||||
mNumFaces = numFaces;
|
||||
mNumTriangleIndices = mNumFaces * 3;
|
||||
return TRUE;
|
||||
return true;
|
||||
}
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
// LLPolyMeshSharedData::allocateJointNames()
|
||||
//-----------------------------------------------------------------------------
|
||||
BOOL LLPolyMeshSharedData::allocateJointNames( U32 numJointNames )
|
||||
bool LLPolyMeshSharedData::allocateJointNames( U32 numJointNames )
|
||||
{
|
||||
mJointNames = new std::string[ numJointNames ];
|
||||
mNumJointNames = numJointNames;
|
||||
return TRUE;
|
||||
return true;
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------
|
||||
// LLPolyMeshSharedData::loadMesh()
|
||||
//--------------------------------------------------------------------
|
||||
BOOL LLPolyMeshSharedData::loadMesh( const std::string& fileName )
|
||||
bool LLPolyMeshSharedData::loadMesh( const std::string& fileName )
|
||||
{
|
||||
//-------------------------------------------------------------------------
|
||||
// Open the file
|
||||
|
|
@ -278,13 +278,13 @@ BOOL LLPolyMeshSharedData::loadMesh( const std::string& fileName )
|
|||
if(fileName.empty())
|
||||
{
|
||||
LL_ERRS() << "Filename is Empty!" << LL_ENDL;
|
||||
return FALSE;
|
||||
return false;
|
||||
}
|
||||
LLFILE* fp = LLFile::fopen(fileName, "rb"); /*Flawfinder: ignore*/
|
||||
if (!fp)
|
||||
{
|
||||
LL_ERRS() << "can't open: " << fileName << LL_ENDL;
|
||||
return FALSE;
|
||||
return false;
|
||||
}
|
||||
|
||||
//-------------------------------------------------------------------------
|
||||
|
|
@ -299,7 +299,7 @@ BOOL LLPolyMeshSharedData::loadMesh( const std::string& fileName )
|
|||
//-------------------------------------------------------------------------
|
||||
// Check for proper binary header
|
||||
//-------------------------------------------------------------------------
|
||||
BOOL status = FALSE;
|
||||
bool status = false;
|
||||
if ( strncmp(header, HEADER_BINARY, strlen(HEADER_BINARY)) == 0 ) /*Flawfinder: ignore*/
|
||||
{
|
||||
LL_DEBUGS() << "Loading " << fileName << LL_ENDL;
|
||||
|
|
@ -317,11 +317,11 @@ BOOL LLPolyMeshSharedData::loadMesh( const std::string& fileName )
|
|||
if (numRead != 1)
|
||||
{
|
||||
LL_ERRS() << "can't read HasWeights flag from " << fileName << LL_ENDL;
|
||||
return FALSE;
|
||||
return false;
|
||||
}
|
||||
if (!isLOD())
|
||||
{
|
||||
mHasWeights = (hasWeights==0) ? FALSE : TRUE;
|
||||
mHasWeights = hasWeights > 0;
|
||||
}
|
||||
|
||||
//----------------------------------------------------------------
|
||||
|
|
@ -332,7 +332,7 @@ BOOL LLPolyMeshSharedData::loadMesh( const std::string& fileName )
|
|||
if (numRead != 1)
|
||||
{
|
||||
LL_ERRS() << "can't read HasDetailTexCoords flag from " << fileName << LL_ENDL;
|
||||
return FALSE;
|
||||
return false;
|
||||
}
|
||||
|
||||
//----------------------------------------------------------------
|
||||
|
|
@ -344,7 +344,7 @@ BOOL LLPolyMeshSharedData::loadMesh( const std::string& fileName )
|
|||
if (numRead != 3)
|
||||
{
|
||||
LL_ERRS() << "can't read Position from " << fileName << LL_ENDL;
|
||||
return FALSE;
|
||||
return false;
|
||||
}
|
||||
setPosition( position );
|
||||
|
||||
|
|
@ -357,7 +357,7 @@ BOOL LLPolyMeshSharedData::loadMesh( const std::string& fileName )
|
|||
if (numRead != 3)
|
||||
{
|
||||
LL_ERRS() << "can't read RotationAngles from " << fileName << LL_ENDL;
|
||||
return FALSE;
|
||||
return false;
|
||||
}
|
||||
|
||||
U8 rotationOrder;
|
||||
|
|
@ -366,7 +366,7 @@ BOOL LLPolyMeshSharedData::loadMesh( const std::string& fileName )
|
|||
if (numRead != 1)
|
||||
{
|
||||
LL_ERRS() << "can't read RotationOrder from " << fileName << LL_ENDL;
|
||||
return FALSE;
|
||||
return false;
|
||||
}
|
||||
|
||||
rotationOrder = 0;
|
||||
|
|
@ -385,7 +385,7 @@ BOOL LLPolyMeshSharedData::loadMesh( const std::string& fileName )
|
|||
if (numRead != 3)
|
||||
{
|
||||
LL_ERRS() << "can't read Scale from " << fileName << LL_ENDL;
|
||||
return FALSE;
|
||||
return false;
|
||||
}
|
||||
setScale( scale );
|
||||
|
||||
|
|
@ -406,7 +406,7 @@ BOOL LLPolyMeshSharedData::loadMesh( const std::string& fileName )
|
|||
if (numRead != 1)
|
||||
{
|
||||
LL_ERRS() << "can't read NumVertices from " << fileName << LL_ENDL;
|
||||
return FALSE;
|
||||
return false;
|
||||
}
|
||||
|
||||
allocateVertexData( numVertices );
|
||||
|
|
@ -421,7 +421,7 @@ BOOL LLPolyMeshSharedData::loadMesh( const std::string& fileName )
|
|||
if (numRead != 3)
|
||||
{
|
||||
LL_ERRS() << "can't read Coordinates from " << fileName << LL_ENDL;
|
||||
return FALSE;
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -435,7 +435,7 @@ BOOL LLPolyMeshSharedData::loadMesh( const std::string& fileName )
|
|||
if (numRead != 3)
|
||||
{
|
||||
LL_ERRS() << " can't read Normals from " << fileName << LL_ENDL;
|
||||
return FALSE;
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -449,7 +449,7 @@ BOOL LLPolyMeshSharedData::loadMesh( const std::string& fileName )
|
|||
if (numRead != 3)
|
||||
{
|
||||
LL_ERRS() << " can't read Binormals from " << fileName << LL_ENDL;
|
||||
return FALSE;
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -461,7 +461,7 @@ BOOL LLPolyMeshSharedData::loadMesh( const std::string& fileName )
|
|||
if (numRead != numVertices)
|
||||
{
|
||||
LL_ERRS() << "can't read TexCoords from " << fileName << LL_ENDL;
|
||||
return FALSE;
|
||||
return false;
|
||||
}
|
||||
|
||||
//----------------------------------------------------------------
|
||||
|
|
@ -474,7 +474,7 @@ BOOL LLPolyMeshSharedData::loadMesh( const std::string& fileName )
|
|||
if (numRead != numVertices)
|
||||
{
|
||||
LL_ERRS() << "can't read DetailTexCoords from " << fileName << LL_ENDL;
|
||||
return FALSE;
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -488,7 +488,7 @@ BOOL LLPolyMeshSharedData::loadMesh( const std::string& fileName )
|
|||
if (numRead != numVertices)
|
||||
{
|
||||
LL_ERRS() << "can't read Weights from " << fileName << LL_ENDL;
|
||||
return FALSE;
|
||||
return false;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -502,7 +502,7 @@ BOOL LLPolyMeshSharedData::loadMesh( const std::string& fileName )
|
|||
if (numRead != 1)
|
||||
{
|
||||
LL_ERRS() << "can't read NumFaces from " << fileName << LL_ENDL;
|
||||
return FALSE;
|
||||
return false;
|
||||
}
|
||||
allocateFaceData( numFaces );
|
||||
|
||||
|
|
@ -520,7 +520,7 @@ BOOL LLPolyMeshSharedData::loadMesh( const std::string& fileName )
|
|||
if (numRead != 3)
|
||||
{
|
||||
LL_ERRS() << "can't read Face[" << i << "] from " << fileName << LL_ENDL;
|
||||
return FALSE;
|
||||
return false;
|
||||
}
|
||||
if (mReferenceData)
|
||||
{
|
||||
|
|
@ -577,7 +577,7 @@ BOOL LLPolyMeshSharedData::loadMesh( const std::string& fileName )
|
|||
if (numRead != 1)
|
||||
{
|
||||
LL_ERRS() << "can't read NumSkinJoints from " << fileName << LL_ENDL;
|
||||
return FALSE;
|
||||
return false;
|
||||
}
|
||||
allocateJointNames( numSkinJoints );
|
||||
}
|
||||
|
|
@ -593,7 +593,7 @@ BOOL LLPolyMeshSharedData::loadMesh( const std::string& fileName )
|
|||
if (numRead != 1)
|
||||
{
|
||||
LL_ERRS() << "can't read Skin[" << i << "].Name from " << fileName << LL_ENDL;
|
||||
return FALSE;
|
||||
return false;
|
||||
}
|
||||
|
||||
std::string *jn = &mJointNames[i];
|
||||
|
|
@ -615,7 +615,7 @@ BOOL LLPolyMeshSharedData::loadMesh( const std::string& fileName )
|
|||
std::string morph_name(morphName);
|
||||
LLPolyMorphData* morph_data = new LLPolyMorphData(morph_name);
|
||||
|
||||
BOOL result = morph_data->loadBinary(fp, this);
|
||||
bool result = morph_data->loadBinary(fp, this);
|
||||
|
||||
if (!result)
|
||||
{
|
||||
|
|
@ -705,12 +705,12 @@ BOOL LLPolyMeshSharedData::loadMesh( const std::string& fileName )
|
|||
}
|
||||
}
|
||||
|
||||
status = TRUE;
|
||||
status = true;
|
||||
}
|
||||
else
|
||||
{
|
||||
LL_ERRS() << "invalid mesh file header: " << fileName << LL_ENDL;
|
||||
status = FALSE;
|
||||
status = false;
|
||||
}
|
||||
|
||||
if (0 == mNumJointNames)
|
||||
|
|
@ -983,7 +983,7 @@ void LLPolyMesh::initializeForMorph()
|
|||
LLVector4a::memcpyNonAliased16((F32*) mScaledBinormals, (F32*) mSharedData->mBaseNormals, sizeof(LLVector4a) * mSharedData->mNumVertices);
|
||||
LLVector4a::memcpyNonAliased16((F32*) mTexCoords, (F32*) mSharedData->mTexCoords, sizeof(LLVector2) * (mSharedData->mNumVertices + mSharedData->mNumVertices%2));
|
||||
|
||||
for (U32 i = 0; i < mSharedData->mNumVertices; ++i)
|
||||
for (S32 i = 0; i < mSharedData->mNumVertices; ++i)
|
||||
{
|
||||
mClothingWeights[i].clear();
|
||||
}
|
||||
|
|
|
|||
|
|
@ -79,8 +79,8 @@ private:
|
|||
LLVector2 *mDetailTexCoords;
|
||||
F32 *mWeights;
|
||||
|
||||
BOOL mHasWeights;
|
||||
BOOL mHasDetailTexCoords;
|
||||
bool mHasWeights;
|
||||
bool mHasDetailTexCoords;
|
||||
|
||||
// face data
|
||||
S32 mNumFaces;
|
||||
|
|
@ -119,17 +119,17 @@ private:
|
|||
void setRotation( const LLQuaternion &rot ) { mRotation = rot; }
|
||||
void setScale( const LLVector3 &scale ) { mScale = scale; }
|
||||
|
||||
BOOL allocateVertexData( U32 numVertices );
|
||||
bool allocateVertexData( U32 numVertices );
|
||||
|
||||
BOOL allocateFaceData( U32 numFaces );
|
||||
bool allocateFaceData( U32 numFaces );
|
||||
|
||||
BOOL allocateJointNames( U32 numJointNames );
|
||||
bool allocateJointNames( U32 numJointNames );
|
||||
|
||||
// Retrieve the number of KB of memory used by this instance
|
||||
U32 getNumKB();
|
||||
|
||||
// Load mesh data from file
|
||||
BOOL loadMesh( const std::string& fileName );
|
||||
bool loadMesh( const std::string& fileName );
|
||||
|
||||
public:
|
||||
void genIndices(S32 offset);
|
||||
|
|
@ -138,7 +138,7 @@ public:
|
|||
|
||||
const S32 *getSharedVert(S32 vert);
|
||||
|
||||
BOOL isLOD() { return (mReferenceData != NULL); }
|
||||
bool isLOD() { return (mReferenceData != NULL); }
|
||||
};
|
||||
|
||||
|
||||
|
|
@ -204,13 +204,13 @@ public:
|
|||
}
|
||||
|
||||
// Returns whether or not the mesh has detail texture coords
|
||||
BOOL hasDetailTexCoords() {
|
||||
bool hasDetailTexCoords() {
|
||||
llassert (mSharedData);
|
||||
return mSharedData->mHasDetailTexCoords;
|
||||
}
|
||||
|
||||
// Returns whether or not the mesh has vertex weights
|
||||
BOOL hasWeights() const{
|
||||
bool hasWeights() const{
|
||||
llassert (mSharedData);
|
||||
return mSharedData->mHasWeights;
|
||||
}
|
||||
|
|
@ -316,7 +316,7 @@ public:
|
|||
// Get indices
|
||||
U32* getIndices() { return mSharedData ? mSharedData->mTriangleIndices : NULL; }
|
||||
|
||||
BOOL isLOD() { return mSharedData && mSharedData->isLOD(); }
|
||||
bool isLOD() { return mSharedData && mSharedData->isLOD(); }
|
||||
|
||||
void setAvatar(LLAvatarAppearance* avatarp) { mAvatarp = avatarp; }
|
||||
LLAvatarAppearance* getAvatar() { return mAvatarp; }
|
||||
|
|
|
|||
|
|
@ -104,17 +104,17 @@ LLPolyMorphData::~LLPolyMorphData()
|
|||
//-----------------------------------------------------------------------------
|
||||
// loadBinary()
|
||||
//-----------------------------------------------------------------------------
|
||||
BOOL LLPolyMorphData::loadBinary(LLFILE *fp, LLPolyMeshSharedData *mesh)
|
||||
bool LLPolyMorphData::loadBinary(LLFILE *fp, LLPolyMeshSharedData *mesh)
|
||||
{
|
||||
S32 numVertices;
|
||||
S32 numRead;
|
||||
size_t numRead;
|
||||
|
||||
numRead = fread(&numVertices, sizeof(S32), 1, fp);
|
||||
llendianswizzle(&numVertices, sizeof(S32), 1);
|
||||
if (numRead != 1)
|
||||
{
|
||||
LL_WARNS() << "Can't read number of morph target vertices" << LL_ENDL;
|
||||
return FALSE;
|
||||
return false;
|
||||
}
|
||||
|
||||
//-------------------------------------------------------------------------
|
||||
|
|
@ -151,14 +151,14 @@ BOOL LLPolyMorphData::loadBinary(LLFILE *fp, LLPolyMeshSharedData *mesh)
|
|||
if (numRead != 1)
|
||||
{
|
||||
LL_WARNS() << "Can't read morph target vertex number" << LL_ENDL;
|
||||
return FALSE;
|
||||
return false;
|
||||
}
|
||||
|
||||
if (mVertexIndices[v] > 10000)
|
||||
{
|
||||
// Bad install? These are usually .llm files from 'character' fodler
|
||||
LL_WARNS() << "Bad morph index " << v << ": " << mVertexIndices[v] << LL_ENDL;
|
||||
return FALSE;
|
||||
return false;
|
||||
}
|
||||
|
||||
|
||||
|
|
@ -167,7 +167,7 @@ BOOL LLPolyMorphData::loadBinary(LLFILE *fp, LLPolyMeshSharedData *mesh)
|
|||
if (numRead != 3)
|
||||
{
|
||||
LL_WARNS() << "Can't read morph target vertex coordinates" << LL_ENDL;
|
||||
return FALSE;
|
||||
return false;
|
||||
}
|
||||
|
||||
F32 magnitude = mCoords[v].getLength3().getF32();
|
||||
|
|
@ -187,7 +187,7 @@ BOOL LLPolyMorphData::loadBinary(LLFILE *fp, LLPolyMeshSharedData *mesh)
|
|||
if (numRead != 3)
|
||||
{
|
||||
LL_WARNS() << "Can't read morph target normal" << LL_ENDL;
|
||||
return FALSE;
|
||||
return false;
|
||||
}
|
||||
|
||||
numRead = fread(&mBinormals[v], sizeof(F32), 3, fp);
|
||||
|
|
@ -195,7 +195,7 @@ BOOL LLPolyMorphData::loadBinary(LLFILE *fp, LLPolyMeshSharedData *mesh)
|
|||
if (numRead != 3)
|
||||
{
|
||||
LL_WARNS() << "Can't read morph target binormal" << LL_ENDL;
|
||||
return FALSE;
|
||||
return false;
|
||||
}
|
||||
|
||||
|
||||
|
|
@ -204,7 +204,7 @@ BOOL LLPolyMorphData::loadBinary(LLFILE *fp, LLPolyMeshSharedData *mesh)
|
|||
if (numRead != 2)
|
||||
{
|
||||
LL_WARNS() << "Can't read morph target uv" << LL_ENDL;
|
||||
return FALSE;
|
||||
return false;
|
||||
}
|
||||
|
||||
mNumIndices++;
|
||||
|
|
@ -213,7 +213,7 @@ BOOL LLPolyMorphData::loadBinary(LLFILE *fp, LLPolyMeshSharedData *mesh)
|
|||
mAvgDistortion.mul(1.f/(F32)mNumIndices);
|
||||
mAvgDistortion.normalize3fast();
|
||||
|
||||
return TRUE;
|
||||
return true;
|
||||
}
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
|
|
@ -256,23 +256,23 @@ void LLPolyMorphData::freeData()
|
|||
// LLPolyMorphTargetInfo()
|
||||
//-----------------------------------------------------------------------------
|
||||
LLPolyMorphTargetInfo::LLPolyMorphTargetInfo()
|
||||
: mIsClothingMorph(FALSE)
|
||||
: mIsClothingMorph(false)
|
||||
{
|
||||
}
|
||||
|
||||
BOOL LLPolyMorphTargetInfo::parseXml(LLXmlTreeNode* node)
|
||||
bool LLPolyMorphTargetInfo::parseXml(LLXmlTreeNode* node)
|
||||
{
|
||||
llassert( node->hasName( "param" ) && node->getChildByName( "param_morph" ) );
|
||||
|
||||
if (!LLViewerVisualParamInfo::parseXml(node))
|
||||
return FALSE;
|
||||
return false;
|
||||
|
||||
// Get mixed-case name
|
||||
static LLStdStringHandle name_string = LLXmlTree::addAttributeString("name");
|
||||
if( !node->getFastAttributeString( name_string, mMorphName ) )
|
||||
{
|
||||
LL_WARNS() << "Avatar file: <param> is missing name attribute" << LL_ENDL;
|
||||
return FALSE; // Continue, ignoring this tag
|
||||
return false; // Continue, ignoring this tag
|
||||
}
|
||||
|
||||
static LLStdStringHandle clothing_morph_string = LLXmlTree::addAttributeString("clothing_morph");
|
||||
|
|
@ -284,7 +284,7 @@ BOOL LLPolyMorphTargetInfo::parseXml(LLXmlTreeNode* node)
|
|||
{
|
||||
LL_WARNS() << "Failed to getChildByName(\"param_morph\")"
|
||||
<< LL_ENDL;
|
||||
return FALSE;
|
||||
return false;
|
||||
}
|
||||
|
||||
for (LLXmlTreeNode* child_node = paramNode->getFirstChild();
|
||||
|
|
@ -310,7 +310,7 @@ BOOL LLPolyMorphTargetInfo::parseXml(LLXmlTreeNode* node)
|
|||
}
|
||||
}
|
||||
|
||||
return TRUE;
|
||||
return true;
|
||||
}
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
|
|
@ -353,11 +353,11 @@ LLPolyMorphTarget::~LLPolyMorphTarget()
|
|||
//-----------------------------------------------------------------------------
|
||||
// setInfo()
|
||||
//-----------------------------------------------------------------------------
|
||||
BOOL LLPolyMorphTarget::setInfo(LLPolyMorphTargetInfo* info)
|
||||
bool LLPolyMorphTarget::setInfo(LLPolyMorphTargetInfo* info)
|
||||
{
|
||||
llassert(mInfo == NULL);
|
||||
if (info->mID < 0)
|
||||
return FALSE;
|
||||
return false;
|
||||
mInfo = info;
|
||||
mID = info->mID;
|
||||
setWeight(getDefaultWeight());
|
||||
|
|
@ -384,8 +384,8 @@ BOOL LLPolyMorphTarget::setInfo(LLPolyMorphTargetInfo* info)
|
|||
if (!mMorphData)
|
||||
{
|
||||
const std::string driven_tag = "_Driven";
|
||||
U32 pos = morph_param_name.find(driven_tag);
|
||||
if (pos > 0)
|
||||
auto pos = morph_param_name.find(driven_tag);
|
||||
if (pos != std::string::npos && pos > 0)
|
||||
{
|
||||
morph_param_name = morph_param_name.substr(0,pos);
|
||||
mMorphData = mMesh->getMorphData(morph_param_name);
|
||||
|
|
@ -394,9 +394,9 @@ BOOL LLPolyMorphTarget::setInfo(LLPolyMorphTargetInfo* info)
|
|||
if (!mMorphData)
|
||||
{
|
||||
LL_WARNS() << "No morph target named " << morph_param_name << " found in mesh." << LL_ENDL;
|
||||
return FALSE; // Continue, ignoring this tag
|
||||
return false; // Continue, ignoring this tag
|
||||
}
|
||||
return TRUE;
|
||||
return true;
|
||||
}
|
||||
|
||||
/*virtual*/ LLViewerVisualParam* LLPolyMorphTarget::cloneParam(LLWearable* wearable) const
|
||||
|
|
@ -408,7 +408,7 @@ BOOL LLPolyMorphTarget::setInfo(LLPolyMorphTargetInfo* info)
|
|||
//-----------------------------------------------------------------------------
|
||||
// parseData()
|
||||
//-----------------------------------------------------------------------------
|
||||
BOOL LLPolyMorphTarget::parseData(LLXmlTreeNode* node)
|
||||
bool LLPolyMorphTarget::parseData(LLXmlTreeNode* node)
|
||||
{
|
||||
LLPolyMorphTargetInfo* info = new LLPolyMorphTargetInfo;
|
||||
|
||||
|
|
@ -416,9 +416,9 @@ BOOL LLPolyMorphTarget::parseData(LLXmlTreeNode* node)
|
|||
if (!setInfo(info))
|
||||
{
|
||||
delete info;
|
||||
return FALSE;
|
||||
return false;
|
||||
}
|
||||
return TRUE;
|
||||
return true;
|
||||
}
|
||||
#endif
|
||||
|
||||
|
|
@ -557,7 +557,7 @@ void LLPolyMorphTarget::apply( ESex avatar_sex )
|
|||
}
|
||||
if (mLastWeight != mLastWeight)
|
||||
{
|
||||
mLastWeight = mCurWeight+.001;
|
||||
mLastWeight = mCurWeight+.001f;
|
||||
}
|
||||
|
||||
// perform differential update of morph
|
||||
|
|
@ -659,7 +659,7 @@ void LLPolyMorphTarget::apply( ESex avatar_sex )
|
|||
//-----------------------------------------------------------------------------
|
||||
// applyMask()
|
||||
//-----------------------------------------------------------------------------
|
||||
void LLPolyMorphTarget::applyMask(U8 *maskTextureData, S32 width, S32 height, S32 num_components, BOOL invert)
|
||||
void LLPolyMorphTarget::applyMask(const U8 *maskTextureData, S32 width, S32 height, S32 num_components, bool invert)
|
||||
{
|
||||
LLVector4a *clothing_weights = getInfo()->mIsClothingMorph ? mMesh->getWritableClothingWeights() : NULL;
|
||||
|
||||
|
|
@ -749,7 +749,7 @@ void LLPolyMorphTarget::applyVolumeChanges(F32 delta_weight)
|
|||
LLPolyVertexMask::LLPolyVertexMask(LLPolyMorphData* morph_data)
|
||||
: mWeights(new F32[morph_data->mNumIndices]),
|
||||
mMorphData(morph_data),
|
||||
mWeightsGenerated(FALSE)
|
||||
mWeightsGenerated(false)
|
||||
{
|
||||
llassert(mMorphData != NULL);
|
||||
llassert(mMorphData->mNumIndices > 0);
|
||||
|
|
@ -780,10 +780,10 @@ LLPolyVertexMask::~LLPolyVertexMask()
|
|||
//-----------------------------------------------------------------------------
|
||||
// generateMask()
|
||||
//-----------------------------------------------------------------------------
|
||||
void LLPolyVertexMask::generateMask(U8 *maskTextureData, S32 width, S32 height, S32 num_components, BOOL invert, LLVector4a *clothing_weights)
|
||||
void LLPolyVertexMask::generateMask(const U8 *maskTextureData, S32 width, S32 height, S32 num_components, bool invert, LLVector4a *clothing_weights)
|
||||
{
|
||||
// RN debug output that uses Image Debugger (http://www.cs.unc.edu/~baxter/projects/imdebug/)
|
||||
// BOOL debugImg = FALSE;
|
||||
// bool debugImg = false;
|
||||
// if (debugImg)
|
||||
// {
|
||||
// if (invert)
|
||||
|
|
@ -827,7 +827,7 @@ void LLPolyVertexMask::generateMask(U8 *maskTextureData, S32 width, S32 height,
|
|||
clothing_weights[vertIndex].getF32ptr()[VW] = mWeights[index];
|
||||
}
|
||||
}
|
||||
mWeightsGenerated = TRUE;
|
||||
mWeightsGenerated = true;
|
||||
}
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
|
|
|
|||
|
|
@ -49,7 +49,7 @@ public:
|
|||
~LLPolyMorphData();
|
||||
LLPolyMorphData(const LLPolyMorphData &rhs);
|
||||
|
||||
BOOL loadBinary(LLFILE* fp, LLPolyMeshSharedData *mesh);
|
||||
bool loadBinary(LLFILE* fp, LLPolyMeshSharedData *mesh);
|
||||
const std::string& getName() { return mName; }
|
||||
|
||||
public:
|
||||
|
|
@ -84,14 +84,14 @@ public:
|
|||
LLPolyVertexMask(const LLPolyVertexMask& pOther);
|
||||
~LLPolyVertexMask();
|
||||
|
||||
void generateMask(U8 *maskData, S32 width, S32 height, S32 num_components, BOOL invert, LLVector4a *clothing_weights);
|
||||
void generateMask(const U8 *maskData, S32 width, S32 height, S32 num_components, bool invert, LLVector4a *clothing_weights);
|
||||
F32* getMorphMaskWeights();
|
||||
|
||||
|
||||
protected:
|
||||
F32* mWeights;
|
||||
LLPolyMorphData *mMorphData;
|
||||
BOOL mWeightsGenerated;
|
||||
bool mWeightsGenerated;
|
||||
|
||||
};
|
||||
|
||||
|
|
@ -129,11 +129,11 @@ public:
|
|||
LLPolyMorphTargetInfo();
|
||||
/*virtual*/ ~LLPolyMorphTargetInfo() {};
|
||||
|
||||
/*virtual*/ BOOL parseXml(LLXmlTreeNode* node);
|
||||
/*virtual*/ bool parseXml(LLXmlTreeNode* node);
|
||||
|
||||
protected:
|
||||
std::string mMorphName;
|
||||
BOOL mIsClothingMorph;
|
||||
bool mIsClothingMorph;
|
||||
typedef std::vector<LLPolyVolumeMorphInfo> volume_info_list_t;
|
||||
volume_info_list_t mVolumeInfoList;
|
||||
};
|
||||
|
|
@ -154,12 +154,12 @@ public:
|
|||
// Special: These functions are overridden by child classes
|
||||
LLPolyMorphTargetInfo* getInfo() const { return (LLPolyMorphTargetInfo*)mInfo; }
|
||||
// This sets mInfo and calls initialization functions
|
||||
BOOL setInfo(LLPolyMorphTargetInfo *info);
|
||||
bool setInfo(LLPolyMorphTargetInfo *info);
|
||||
|
||||
/*virtual*/ LLViewerVisualParam* cloneParam(LLWearable* wearable) const;
|
||||
|
||||
// LLVisualParam Virtual functions
|
||||
///*virtual*/ BOOL parseData(LLXmlTreeNode* node);
|
||||
///*virtual*/ bool parseData(LLXmlTreeNode* node);
|
||||
/*virtual*/ void apply( ESex sex );
|
||||
|
||||
// LLViewerVisualParam Virtual functions
|
||||
|
|
@ -170,7 +170,7 @@ public:
|
|||
/*virtual*/ const LLVector4a* getFirstDistortion(U32 *index, LLPolyMesh **poly_mesh);
|
||||
/*virtual*/ const LLVector4a* getNextDistortion(U32 *index, LLPolyMesh **poly_mesh);
|
||||
|
||||
void applyMask(U8 *maskData, S32 width, S32 height, S32 num_components, BOOL invert);
|
||||
void applyMask(const U8 *maskData, S32 width, S32 height, S32 num_components, bool invert);
|
||||
void addPendingMorphMask() { mNumMorphMasksPending++; }
|
||||
|
||||
void applyVolumeChanges(F32 delta_weight); // SL-315 - for resetSkeleton()
|
||||
|
|
@ -183,7 +183,7 @@ protected:
|
|||
LLPolyVertexMask * mVertMask;
|
||||
ESex mLastSex;
|
||||
// number of morph masks that haven't been generated, must be 0 before this morph is applied
|
||||
BOOL mNumMorphMasksPending;
|
||||
S32 mNumMorphMasksPending;
|
||||
|
||||
typedef std::vector<LLPolyVolumeMorph> volume_list_t;
|
||||
volume_list_t mVolumeMorphs;
|
||||
|
|
|
|||
|
|
@ -45,12 +45,12 @@ LLPolySkeletalDistortionInfo::LLPolySkeletalDistortionInfo()
|
|||
{
|
||||
}
|
||||
|
||||
BOOL LLPolySkeletalDistortionInfo::parseXml(LLXmlTreeNode* node)
|
||||
bool LLPolySkeletalDistortionInfo::parseXml(LLXmlTreeNode* node)
|
||||
{
|
||||
llassert( node->hasName( "param" ) && node->getChildByName( "param_skeleton" ) );
|
||||
|
||||
if (!LLViewerVisualParamInfo::parseXml(node))
|
||||
return FALSE;
|
||||
return false;
|
||||
|
||||
LLXmlTreeNode* skeletalParam = node->getChildByName("param_skeleton");
|
||||
|
||||
|
|
@ -58,7 +58,7 @@ BOOL LLPolySkeletalDistortionInfo::parseXml(LLXmlTreeNode* node)
|
|||
{
|
||||
LL_WARNS() << "Failed to getChildByName(\"param_skeleton\")"
|
||||
<< LL_ENDL;
|
||||
return FALSE;
|
||||
return false;
|
||||
}
|
||||
|
||||
for( LLXmlTreeNode* bone = skeletalParam->getFirstChild(); bone; bone = skeletalParam->getNextChild() )
|
||||
|
|
@ -68,7 +68,7 @@ BOOL LLPolySkeletalDistortionInfo::parseXml(LLXmlTreeNode* node)
|
|||
std::string name;
|
||||
LLVector3 scale;
|
||||
LLVector3 pos;
|
||||
BOOL haspos = FALSE;
|
||||
bool haspos = false;
|
||||
|
||||
static LLStdStringHandle name_string = LLXmlTree::addAttributeString("name");
|
||||
if (!bone->getFastAttributeString(name_string, name))
|
||||
|
|
@ -88,7 +88,7 @@ BOOL LLPolySkeletalDistortionInfo::parseXml(LLXmlTreeNode* node)
|
|||
static LLStdStringHandle offset_string = LLXmlTree::addAttributeString("offset");
|
||||
if (bone->getFastAttributeVector3(offset_string, pos))
|
||||
{
|
||||
haspos = TRUE;
|
||||
haspos = true;
|
||||
}
|
||||
mBoneInfoList.push_back(LLPolySkeletalBoneInfo(name, scale, pos, haspos));
|
||||
}
|
||||
|
|
@ -98,7 +98,7 @@ BOOL LLPolySkeletalDistortionInfo::parseXml(LLXmlTreeNode* node)
|
|||
continue;
|
||||
}
|
||||
}
|
||||
return TRUE;
|
||||
return true;
|
||||
}
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
|
|
@ -133,11 +133,11 @@ LLPolySkeletalDistortion::~LLPolySkeletalDistortion()
|
|||
{
|
||||
}
|
||||
|
||||
BOOL LLPolySkeletalDistortion::setInfo(LLPolySkeletalDistortionInfo *info)
|
||||
bool LLPolySkeletalDistortion::setInfo(LLPolySkeletalDistortionInfo *info)
|
||||
{
|
||||
if (info->mID < 0)
|
||||
{
|
||||
return FALSE;
|
||||
return false;
|
||||
}
|
||||
mInfo = info;
|
||||
mID = info->mID;
|
||||
|
|
@ -151,7 +151,7 @@ BOOL LLPolySkeletalDistortion::setInfo(LLPolySkeletalDistortionInfo *info)
|
|||
// There's no point continuing after this error - means
|
||||
// that either the skeleton or lad file is broken.
|
||||
LL_WARNS() << "Joint " << bone_info.mBoneName << " not found." << LL_ENDL;
|
||||
return FALSE;
|
||||
return false;
|
||||
}
|
||||
|
||||
// store it
|
||||
|
|
@ -174,7 +174,7 @@ BOOL LLPolySkeletalDistortion::setInfo(LLPolySkeletalDistortionInfo *info)
|
|||
mJointOffsets[joint] = bone_info.mPositionDeformation;
|
||||
}
|
||||
}
|
||||
return TRUE;
|
||||
return true;
|
||||
}
|
||||
|
||||
/*virtual*/ LLViewerVisualParam* LLPolySkeletalDistortion::cloneParam(LLWearable* wearable) const
|
||||
|
|
|
|||
|
|
@ -51,7 +51,7 @@ class LLAvatarAppearance;
|
|||
//-----------------------------------------------------------------------------
|
||||
struct LLPolySkeletalBoneInfo
|
||||
{
|
||||
LLPolySkeletalBoneInfo(std::string &name, LLVector3 &scale, LLVector3 &pos, BOOL haspos)
|
||||
LLPolySkeletalBoneInfo(std::string &name, LLVector3 &scale, LLVector3 &pos, bool haspos)
|
||||
: mBoneName(name),
|
||||
mScaleDeformation(scale),
|
||||
mPositionDeformation(pos),
|
||||
|
|
@ -59,7 +59,7 @@ struct LLPolySkeletalBoneInfo
|
|||
std::string mBoneName;
|
||||
LLVector3 mScaleDeformation;
|
||||
LLVector3 mPositionDeformation;
|
||||
BOOL mHasPositionDeformation;
|
||||
bool mHasPositionDeformation;
|
||||
};
|
||||
|
||||
class alignas(16) LLPolySkeletalDistortionInfo : public LLViewerVisualParamInfo
|
||||
|
|
@ -71,7 +71,7 @@ public:
|
|||
LLPolySkeletalDistortionInfo();
|
||||
/*virtual*/ ~LLPolySkeletalDistortionInfo() {};
|
||||
|
||||
/*virtual*/ BOOL parseXml(LLXmlTreeNode* node);
|
||||
/*virtual*/ bool parseXml(LLXmlTreeNode* node);
|
||||
|
||||
protected:
|
||||
typedef std::vector<LLPolySkeletalBoneInfo> bone_info_list_t;
|
||||
|
|
@ -92,12 +92,12 @@ public:
|
|||
// Special: These functions are overridden by child classes
|
||||
LLPolySkeletalDistortionInfo* getInfo() const { return (LLPolySkeletalDistortionInfo*)mInfo; }
|
||||
// This sets mInfo and calls initialization functions
|
||||
BOOL setInfo(LLPolySkeletalDistortionInfo *info);
|
||||
bool setInfo(LLPolySkeletalDistortionInfo *info);
|
||||
|
||||
/*virtual*/ LLViewerVisualParam* cloneParam(LLWearable* wearable) const;
|
||||
|
||||
// LLVisualParam Virtual functions
|
||||
///*virtual*/ BOOL parseData(LLXmlTreeNode* node);
|
||||
///*virtual*/ bool parseData(LLXmlTreeNode* node);
|
||||
/*virtual*/ void apply( ESex sex );
|
||||
|
||||
// LLViewerVisualParam Virtual functions
|
||||
|
|
|
|||
|
|
@ -48,7 +48,7 @@ LLTexGlobalColor::~LLTexGlobalColor()
|
|||
//std::for_each(mParamColorList.begin(), mParamColorList.end(), DeletePointer());
|
||||
}
|
||||
|
||||
BOOL LLTexGlobalColor::setInfo(LLTexGlobalColorInfo *info)
|
||||
bool LLTexGlobalColor::setInfo(LLTexGlobalColorInfo *info)
|
||||
{
|
||||
llassert(mInfo == NULL);
|
||||
mInfo = info;
|
||||
|
|
@ -58,15 +58,15 @@ BOOL LLTexGlobalColor::setInfo(LLTexGlobalColorInfo *info)
|
|||
for (LLTexLayerParamColorInfo* color_info : mInfo->mParamColorInfoList)
|
||||
{
|
||||
LLTexParamGlobalColor* param_color = new LLTexParamGlobalColor(this);
|
||||
if (!param_color->setInfo(color_info, TRUE))
|
||||
if (!param_color->setInfo(color_info, true))
|
||||
{
|
||||
mInfo = NULL;
|
||||
return FALSE;
|
||||
return false;
|
||||
}
|
||||
mParamGlobalColorList.push_back(param_color);
|
||||
}
|
||||
|
||||
return TRUE;
|
||||
return true;
|
||||
}
|
||||
|
||||
LLColor4 LLTexGlobalColor::getColor() const
|
||||
|
|
@ -135,14 +135,14 @@ LLTexGlobalColorInfo::~LLTexGlobalColorInfo()
|
|||
mParamColorInfoList.clear();
|
||||
}
|
||||
|
||||
BOOL LLTexGlobalColorInfo::parseXml(LLXmlTreeNode* node)
|
||||
bool LLTexGlobalColorInfo::parseXml(LLXmlTreeNode* node)
|
||||
{
|
||||
// name attribute
|
||||
static LLStdStringHandle name_string = LLXmlTree::addAttributeString("name");
|
||||
if (!node->getFastAttributeString(name_string, mName))
|
||||
{
|
||||
LL_WARNS() << "<global_color> element is missing name attribute." << LL_ENDL;
|
||||
return FALSE;
|
||||
return false;
|
||||
}
|
||||
// <param> sub-element
|
||||
for (LLXmlTreeNode* child = node->getChildByName("param");
|
||||
|
|
@ -156,10 +156,10 @@ BOOL LLTexGlobalColorInfo::parseXml(LLXmlTreeNode* node)
|
|||
if (!info->parseXml(child))
|
||||
{
|
||||
delete info;
|
||||
return FALSE;
|
||||
return false;
|
||||
}
|
||||
mParamColorInfoList.push_back(info);
|
||||
}
|
||||
}
|
||||
return TRUE;
|
||||
return true;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -42,7 +42,7 @@ public:
|
|||
|
||||
LLTexGlobalColorInfo* getInfo() const { return mInfo; }
|
||||
// This sets mInfo and calls initialization functions
|
||||
BOOL setInfo(LLTexGlobalColorInfo *info);
|
||||
bool setInfo(LLTexGlobalColorInfo *info);
|
||||
|
||||
LLAvatarAppearance* getAvatarAppearance() const { return mAvatarAppearance; }
|
||||
LLColor4 getColor() const;
|
||||
|
|
@ -62,7 +62,7 @@ public:
|
|||
LLTexGlobalColorInfo();
|
||||
~LLTexGlobalColorInfo();
|
||||
|
||||
BOOL parseXml(LLXmlTreeNode* node);
|
||||
bool parseXml(LLXmlTreeNode* node);
|
||||
|
||||
private:
|
||||
param_color_info_list_t mParamColorInfoList;
|
||||
|
|
|
|||
|
|
@ -59,17 +59,17 @@ public:
|
|||
LLTexLayerInfo();
|
||||
~LLTexLayerInfo();
|
||||
|
||||
BOOL parseXml(LLXmlTreeNode* node);
|
||||
BOOL createVisualParams(LLAvatarAppearance *appearance);
|
||||
BOOL isUserSettable() { return mLocalTexture != -1; }
|
||||
bool parseXml(LLXmlTreeNode* node);
|
||||
bool createVisualParams(LLAvatarAppearance *appearance);
|
||||
bool isUserSettable() { return mLocalTexture != -1; }
|
||||
S32 getLocalTexture() const { return mLocalTexture; }
|
||||
BOOL getOnlyAlpha() const { return mUseLocalTextureAlphaOnly; }
|
||||
bool getOnlyAlpha() const { return mUseLocalTextureAlphaOnly; }
|
||||
std::string getName() const { return mName; }
|
||||
|
||||
private:
|
||||
std::string mName;
|
||||
|
||||
BOOL mWriteAllChannels; // Don't use masking. Just write RGBA into buffer,
|
||||
bool mWriteAllChannels; // Don't use masking. Just write RGBA into buffer,
|
||||
LLTexLayerInterface::ERenderPass mRenderPass;
|
||||
|
||||
std::string mGlobalColor;
|
||||
|
|
@ -77,11 +77,11 @@ private:
|
|||
|
||||
S32 mLocalTexture;
|
||||
std::string mStaticImageFileName;
|
||||
BOOL mStaticImageIsMask;
|
||||
BOOL mUseLocalTextureAlphaOnly; // Ignore RGB channels from the input texture. Use alpha as a mask
|
||||
BOOL mIsVisibilityMask;
|
||||
bool mStaticImageIsMask;
|
||||
bool mUseLocalTextureAlphaOnly; // Ignore RGB channels from the input texture. Use alpha as a mask
|
||||
bool mIsVisibilityMask;
|
||||
|
||||
typedef std::vector< std::pair< std::string,BOOL > > morph_name_list_t;
|
||||
typedef std::vector< std::pair< std::string,bool > > morph_name_list_t;
|
||||
morph_name_list_t mMorphNameList;
|
||||
param_color_info_list_t mParamColorInfoList;
|
||||
param_alpha_info_list_t mParamAlphaInfoList;
|
||||
|
|
@ -106,7 +106,7 @@ void LLTexLayerSetBuffer::pushProjection() const
|
|||
gGL.matrixMode(LLRender::MM_PROJECTION);
|
||||
gGL.pushMatrix();
|
||||
gGL.loadIdentity();
|
||||
gGL.ortho(0.0f, getCompositeWidth(), 0.0f, getCompositeHeight(), -1.0f, 1.0f);
|
||||
gGL.ortho(0.0f, (F32)getCompositeWidth(), 0.0f, (F32)getCompositeHeight(), -1.0f, 1.0f);
|
||||
|
||||
gGL.matrixMode(LLRender::MM_MODELVIEW);
|
||||
gGL.pushMatrix();
|
||||
|
|
@ -130,17 +130,17 @@ void LLTexLayerSetBuffer::preRenderTexLayerSet()
|
|||
}
|
||||
|
||||
// virtual
|
||||
void LLTexLayerSetBuffer::postRenderTexLayerSet(BOOL success)
|
||||
void LLTexLayerSetBuffer::postRenderTexLayerSet(bool success)
|
||||
{
|
||||
popProjection();
|
||||
}
|
||||
|
||||
BOOL LLTexLayerSetBuffer::renderTexLayerSet(LLRenderTarget* bound_target)
|
||||
bool LLTexLayerSetBuffer::renderTexLayerSet(LLRenderTarget* bound_target)
|
||||
{
|
||||
// Default color mask for tex layer render
|
||||
gGL.setColorMask(true, true);
|
||||
|
||||
BOOL success = TRUE;
|
||||
bool success = true;
|
||||
|
||||
gAlphaMaskProgram.bind();
|
||||
gAlphaMaskProgram.setMinimumAlpha(0.004f);
|
||||
|
|
@ -175,7 +175,7 @@ LLTexLayerSetInfo::LLTexLayerSetInfo() :
|
|||
mBodyRegion( "" ),
|
||||
mWidth( 512 ),
|
||||
mHeight( 512 ),
|
||||
mClearAlpha( TRUE )
|
||||
mClearAlpha( true )
|
||||
{
|
||||
}
|
||||
|
||||
|
|
@ -185,12 +185,12 @@ LLTexLayerSetInfo::~LLTexLayerSetInfo( )
|
|||
mLayerInfoList.clear();
|
||||
}
|
||||
|
||||
BOOL LLTexLayerSetInfo::parseXml(LLXmlTreeNode* node)
|
||||
bool LLTexLayerSetInfo::parseXml(LLXmlTreeNode* node)
|
||||
{
|
||||
llassert( node->hasName( "layer_set" ) );
|
||||
if( !node->hasName( "layer_set" ) )
|
||||
{
|
||||
return FALSE;
|
||||
return false;
|
||||
}
|
||||
|
||||
// body_region
|
||||
|
|
@ -198,20 +198,20 @@ BOOL LLTexLayerSetInfo::parseXml(LLXmlTreeNode* node)
|
|||
if( !node->getFastAttributeString( body_region_string, mBodyRegion ) )
|
||||
{
|
||||
LL_WARNS() << "<layer_set> is missing body_region attribute" << LL_ENDL;
|
||||
return FALSE;
|
||||
return false;
|
||||
}
|
||||
|
||||
// width, height
|
||||
static LLStdStringHandle width_string = LLXmlTree::addAttributeString("width");
|
||||
if( !node->getFastAttributeS32( width_string, mWidth ) )
|
||||
{
|
||||
return FALSE;
|
||||
return false;
|
||||
}
|
||||
|
||||
static LLStdStringHandle height_string = LLXmlTree::addAttributeString("height");
|
||||
if( !node->getFastAttributeS32( height_string, mHeight ) )
|
||||
{
|
||||
return FALSE;
|
||||
return false;
|
||||
}
|
||||
|
||||
// Optional alpha component to apply after all compositing is complete.
|
||||
|
|
@ -230,11 +230,11 @@ BOOL LLTexLayerSetInfo::parseXml(LLXmlTreeNode* node)
|
|||
if( !info->parseXml( child ))
|
||||
{
|
||||
delete info;
|
||||
return FALSE;
|
||||
return false;
|
||||
}
|
||||
mLayerInfoList.push_back( info );
|
||||
}
|
||||
return TRUE;
|
||||
return true;
|
||||
}
|
||||
|
||||
// creates visual params without generating layersets or layers
|
||||
|
|
@ -252,11 +252,11 @@ void LLTexLayerSetInfo::createVisualParams(LLAvatarAppearance *appearance)
|
|||
// An ordered set of texture layers that get composited into a single texture.
|
||||
//-----------------------------------------------------------------------------
|
||||
|
||||
BOOL LLTexLayerSet::sHasCaches = FALSE;
|
||||
bool LLTexLayerSet::sHasCaches = false;
|
||||
|
||||
LLTexLayerSet::LLTexLayerSet(LLAvatarAppearance* const appearance) :
|
||||
mAvatarAppearance( appearance ),
|
||||
mIsVisible( TRUE ),
|
||||
mIsVisible( true ),
|
||||
mBakedTexIndex(LLAvatarAppearanceDefines::BAKED_HEAD),
|
||||
mInfo( NULL )
|
||||
{
|
||||
|
|
@ -277,7 +277,7 @@ LLTexLayerSet::~LLTexLayerSet()
|
|||
// setInfo
|
||||
//-----------------------------------------------------------------------------
|
||||
|
||||
BOOL LLTexLayerSet::setInfo(const LLTexLayerSetInfo *info)
|
||||
bool LLTexLayerSet::setInfo(const LLTexLayerSetInfo *info)
|
||||
{
|
||||
llassert(mInfo == NULL);
|
||||
mInfo = info;
|
||||
|
|
@ -299,7 +299,7 @@ BOOL LLTexLayerSet::setInfo(const LLTexLayerSetInfo *info)
|
|||
if (!layer->setInfo(layer_info, NULL))
|
||||
{
|
||||
mInfo = NULL;
|
||||
return FALSE;
|
||||
return false;
|
||||
}
|
||||
if (!layer->isVisibilityMask())
|
||||
{
|
||||
|
|
@ -315,7 +315,7 @@ BOOL LLTexLayerSet::setInfo(const LLTexLayerSetInfo *info)
|
|||
|
||||
stop_glerror();
|
||||
|
||||
return TRUE;
|
||||
return true;
|
||||
}
|
||||
|
||||
#if 0 // obsolete
|
||||
|
|
@ -323,21 +323,21 @@ BOOL LLTexLayerSet::setInfo(const LLTexLayerSetInfo *info)
|
|||
// parseData
|
||||
//-----------------------------------------------------------------------------
|
||||
|
||||
BOOL LLTexLayerSet::parseData(LLXmlTreeNode* node)
|
||||
bool LLTexLayerSet::parseData(LLXmlTreeNode* node)
|
||||
{
|
||||
LLTexLayerSetInfo *info = new LLTexLayerSetInfo;
|
||||
|
||||
if (!info->parseXml(node))
|
||||
{
|
||||
delete info;
|
||||
return FALSE;
|
||||
return false;
|
||||
}
|
||||
if (!setInfo(info))
|
||||
{
|
||||
delete info;
|
||||
return FALSE;
|
||||
return false;
|
||||
}
|
||||
return TRUE;
|
||||
return true;
|
||||
}
|
||||
#endif
|
||||
|
||||
|
|
@ -354,10 +354,10 @@ void LLTexLayerSet::deleteCaches()
|
|||
}
|
||||
|
||||
|
||||
BOOL LLTexLayerSet::render( S32 x, S32 y, S32 width, S32 height, LLRenderTarget* bound_target )
|
||||
bool LLTexLayerSet::render( S32 x, S32 y, S32 width, S32 height, LLRenderTarget* bound_target )
|
||||
{
|
||||
BOOL success = TRUE;
|
||||
mIsVisible = TRUE;
|
||||
bool success = true;
|
||||
mIsVisible = true;
|
||||
|
||||
if (mMaskLayerList.size() > 0)
|
||||
{
|
||||
|
|
@ -365,7 +365,7 @@ BOOL LLTexLayerSet::render( S32 x, S32 y, S32 width, S32 height, LLRenderTarget*
|
|||
{
|
||||
if (layer->isInvisibleAlphaMask())
|
||||
{
|
||||
mIsVisible = FALSE;
|
||||
mIsVisible = false;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -425,7 +425,7 @@ BOOL LLTexLayerSet::render( S32 x, S32 y, S32 width, S32 height, LLRenderTarget*
|
|||
}
|
||||
|
||||
|
||||
BOOL LLTexLayerSet::isBodyRegion(const std::string& region) const
|
||||
bool LLTexLayerSet::isBodyRegion(const std::string& region) const
|
||||
{
|
||||
return mInfo->mBodyRegion == region;
|
||||
}
|
||||
|
|
@ -484,7 +484,7 @@ void LLTexLayerSet::renderAlphaMaskTextures(S32 x, S32 y, S32 width, S32 height,
|
|||
{
|
||||
gGL.flush();
|
||||
{
|
||||
LLGLTexture* tex = LLTexLayerStaticImageList::getInstance()->getTexture(info->mStaticAlphaFileName, TRUE);
|
||||
LLGLTexture* tex = LLTexLayerStaticImageList::getInstance()->getTexture(info->mStaticAlphaFileName, true);
|
||||
if( tex )
|
||||
{
|
||||
LLGLSUIDefault gls_ui;
|
||||
|
|
@ -528,21 +528,21 @@ void LLTexLayerSet::renderAlphaMaskTextures(S32 x, S32 y, S32 width, S32 height,
|
|||
gGL.setSceneBlendType(LLRender::BT_ALPHA);
|
||||
}
|
||||
|
||||
void LLTexLayerSet::applyMorphMask(U8* tex_data, S32 width, S32 height, S32 num_components)
|
||||
void LLTexLayerSet::applyMorphMask(const U8* tex_data, S32 width, S32 height, S32 num_components)
|
||||
{
|
||||
mAvatarAppearance->applyMorphMask(tex_data, width, height, num_components, mBakedTexIndex);
|
||||
}
|
||||
|
||||
BOOL LLTexLayerSet::isMorphValid() const
|
||||
bool LLTexLayerSet::isMorphValid() const
|
||||
{
|
||||
for(const LLTexLayerInterface* layer : mLayerList)
|
||||
{
|
||||
if (layer && !layer->isMorphValid())
|
||||
{
|
||||
return FALSE;
|
||||
return false;
|
||||
}
|
||||
}
|
||||
return TRUE;
|
||||
return true;
|
||||
}
|
||||
|
||||
void LLTexLayerSet::invalidateMorphMasks()
|
||||
|
|
@ -561,13 +561,13 @@ void LLTexLayerSet::invalidateMorphMasks()
|
|||
// LLTexLayerInfo
|
||||
//-----------------------------------------------------------------------------
|
||||
LLTexLayerInfo::LLTexLayerInfo() :
|
||||
mWriteAllChannels( FALSE ),
|
||||
mWriteAllChannels( false ),
|
||||
mRenderPass(LLTexLayer::RP_COLOR),
|
||||
mFixedColor( 0.f, 0.f, 0.f, 0.f ),
|
||||
mLocalTexture( -1 ),
|
||||
mStaticImageIsMask( FALSE ),
|
||||
mUseLocalTextureAlphaOnly(FALSE),
|
||||
mIsVisibilityMask(FALSE)
|
||||
mStaticImageIsMask( false ),
|
||||
mUseLocalTextureAlphaOnly(false),
|
||||
mIsVisibilityMask(false)
|
||||
{
|
||||
}
|
||||
|
||||
|
|
@ -579,7 +579,7 @@ LLTexLayerInfo::~LLTexLayerInfo( )
|
|||
mParamAlphaInfoList.clear();
|
||||
}
|
||||
|
||||
BOOL LLTexLayerInfo::parseXml(LLXmlTreeNode* node)
|
||||
bool LLTexLayerInfo::parseXml(LLXmlTreeNode* node)
|
||||
{
|
||||
llassert( node->hasName( "layer" ) );
|
||||
|
||||
|
|
@ -587,7 +587,7 @@ BOOL LLTexLayerInfo::parseXml(LLXmlTreeNode* node)
|
|||
static LLStdStringHandle name_string = LLXmlTree::addAttributeString("name");
|
||||
if( !node->getFastAttributeString( name_string, mName ) )
|
||||
{
|
||||
return FALSE;
|
||||
return false;
|
||||
}
|
||||
|
||||
static LLStdStringHandle write_all_channels_string = LLXmlTree::addAttributeString("write_all_channels");
|
||||
|
|
@ -609,7 +609,7 @@ BOOL LLTexLayerInfo::parseXml(LLXmlTreeNode* node)
|
|||
node->getFastAttributeString( global_color_string, mGlobalColor );
|
||||
|
||||
// Visibility mask (optional)
|
||||
BOOL is_visibility;
|
||||
bool is_visibility;
|
||||
static LLStdStringHandle visibility_mask_string = LLXmlTree::addAttributeString("visibility_mask");
|
||||
if (node->getFastAttributeBOOL(visibility_mask_string, is_visibility))
|
||||
{
|
||||
|
|
@ -657,13 +657,13 @@ BOOL LLTexLayerInfo::parseXml(LLXmlTreeNode* node)
|
|||
if (mLocalTexture == TEX_NUM_INDICES)
|
||||
{
|
||||
LL_WARNS() << "<texture> element has invalid local_texture attribute: " << mName << " " << local_texture_name << LL_ENDL;
|
||||
return FALSE;
|
||||
return false;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
LL_WARNS() << "<texture> element is missing a required attribute. " << mName << LL_ENDL;
|
||||
return FALSE;
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -675,10 +675,10 @@ BOOL LLTexLayerInfo::parseXml(LLXmlTreeNode* node)
|
|||
static LLStdStringHandle morph_name_string = LLXmlTree::addAttributeString("morph_name");
|
||||
if (maskNode->getFastAttributeString(morph_name_string, morph_name))
|
||||
{
|
||||
BOOL invert = FALSE;
|
||||
bool invert = false;
|
||||
static LLStdStringHandle invert_string = LLXmlTree::addAttributeString("invert");
|
||||
maskNode->getFastAttributeBOOL(invert_string, invert);
|
||||
mMorphNameList.push_back(std::pair<std::string,BOOL>(morph_name,invert));
|
||||
mMorphNameList.push_back(std::pair<std::string,bool>(morph_name,invert));
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -694,7 +694,7 @@ BOOL LLTexLayerInfo::parseXml(LLXmlTreeNode* node)
|
|||
if (!info->parseXml(child))
|
||||
{
|
||||
delete info;
|
||||
return FALSE;
|
||||
return false;
|
||||
}
|
||||
mParamColorInfoList.push_back(info);
|
||||
}
|
||||
|
|
@ -705,37 +705,37 @@ BOOL LLTexLayerInfo::parseXml(LLXmlTreeNode* node)
|
|||
if (!info->parseXml(child))
|
||||
{
|
||||
delete info;
|
||||
return FALSE;
|
||||
return false;
|
||||
}
|
||||
mParamAlphaInfoList.push_back(info);
|
||||
}
|
||||
}
|
||||
|
||||
return TRUE;
|
||||
return true;
|
||||
}
|
||||
|
||||
BOOL LLTexLayerInfo::createVisualParams(LLAvatarAppearance *appearance)
|
||||
bool LLTexLayerInfo::createVisualParams(LLAvatarAppearance *appearance)
|
||||
{
|
||||
BOOL success = TRUE;
|
||||
bool success = true;
|
||||
for (LLTexLayerParamColorInfo* color_info : mParamColorInfoList)
|
||||
{
|
||||
LLTexLayerParamColor* param_color = new LLTexLayerParamColor(appearance);
|
||||
if (!param_color->setInfo(color_info, TRUE))
|
||||
if (!param_color->setInfo(color_info, true))
|
||||
{
|
||||
LL_WARNS() << "NULL TexLayer Color Param could not be added to visual param list. Deleting." << LL_ENDL;
|
||||
delete param_color;
|
||||
success = FALSE;
|
||||
success = false;
|
||||
}
|
||||
}
|
||||
|
||||
for (LLTexLayerParamAlphaInfo* alpha_info : mParamAlphaInfoList)
|
||||
{
|
||||
LLTexLayerParamAlpha* param_alpha = new LLTexLayerParamAlpha(appearance);
|
||||
if (!param_alpha->setInfo(alpha_info, TRUE))
|
||||
if (!param_alpha->setInfo(alpha_info, true))
|
||||
{
|
||||
LL_WARNS() << "NULL TexLayer Alpha Param could not be added to visual param list. Deleting." << LL_ENDL;
|
||||
delete param_alpha;
|
||||
success = FALSE;
|
||||
success = false;
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -744,9 +744,9 @@ BOOL LLTexLayerInfo::createVisualParams(LLAvatarAppearance *appearance)
|
|||
|
||||
LLTexLayerInterface::LLTexLayerInterface(LLTexLayerSet* const layer_set):
|
||||
mTexLayerSet( layer_set ),
|
||||
mMorphMasksValid( FALSE ),
|
||||
mMorphMasksValid( false ),
|
||||
mInfo(NULL),
|
||||
mHasMorph(FALSE)
|
||||
mHasMorph(false)
|
||||
{
|
||||
}
|
||||
|
||||
|
|
@ -760,7 +760,7 @@ LLTexLayerInterface::LLTexLayerInterface(const LLTexLayerInterface &layer, LLWea
|
|||
mHasMorph = layer.mHasMorph;
|
||||
}
|
||||
|
||||
BOOL LLTexLayerInterface::setInfo(const LLTexLayerInfo *info, LLWearable* wearable ) // This sets mInfo and calls initialization functions
|
||||
bool LLTexLayerInterface::setInfo(const LLTexLayerInfo *info, LLWearable* wearable ) // This sets mInfo and calls initialization functions
|
||||
{
|
||||
// setInfo should only be called once. Code is not robust enough to handle redefinition of a texlayer.
|
||||
// Not a critical warning, but could be useful for debugging later issues. -Nyx
|
||||
|
|
@ -778,10 +778,10 @@ BOOL LLTexLayerInterface::setInfo(const LLTexLayerInfo *info, LLWearable* wearab
|
|||
if (!wearable)
|
||||
{
|
||||
param_color = new LLTexLayerParamColor(this);
|
||||
if (!param_color->setInfo(color_info, TRUE))
|
||||
if (!param_color->setInfo(color_info, true))
|
||||
{
|
||||
mInfo = NULL;
|
||||
return FALSE;
|
||||
return false;
|
||||
}
|
||||
}
|
||||
else
|
||||
|
|
@ -790,7 +790,7 @@ BOOL LLTexLayerInterface::setInfo(const LLTexLayerInfo *info, LLWearable* wearab
|
|||
if (!param_color)
|
||||
{
|
||||
mInfo = NULL;
|
||||
return FALSE;
|
||||
return false;
|
||||
}
|
||||
}
|
||||
mParamColorList.push_back( param_color );
|
||||
|
|
@ -803,10 +803,10 @@ BOOL LLTexLayerInterface::setInfo(const LLTexLayerInfo *info, LLWearable* wearab
|
|||
if (!wearable)
|
||||
{
|
||||
param_alpha = new LLTexLayerParamAlpha( this );
|
||||
if (!param_alpha->setInfo(alpha_info, TRUE))
|
||||
if (!param_alpha->setInfo(alpha_info, true))
|
||||
{
|
||||
mInfo = NULL;
|
||||
return FALSE;
|
||||
return false;
|
||||
}
|
||||
}
|
||||
else
|
||||
|
|
@ -815,13 +815,13 @@ BOOL LLTexLayerInterface::setInfo(const LLTexLayerInfo *info, LLWearable* wearab
|
|||
if (!param_alpha)
|
||||
{
|
||||
mInfo = NULL;
|
||||
return FALSE;
|
||||
return false;
|
||||
}
|
||||
}
|
||||
mParamAlphaList.push_back( param_alpha );
|
||||
}
|
||||
|
||||
return TRUE;
|
||||
return true;
|
||||
}
|
||||
|
||||
/*virtual*/ void LLTexLayerInterface::requestUpdate()
|
||||
|
|
@ -893,14 +893,14 @@ const std::string& LLTexLayerInterface::getGlobalColor() const
|
|||
return mInfo->mGlobalColor;
|
||||
}
|
||||
|
||||
BOOL LLTexLayerInterface::isVisibilityMask() const
|
||||
bool LLTexLayerInterface::isVisibilityMask() const
|
||||
{
|
||||
return mInfo->mIsVisibilityMask;
|
||||
}
|
||||
|
||||
void LLTexLayerInterface::invalidateMorphMasks()
|
||||
{
|
||||
mMorphMasksValid = FALSE;
|
||||
mMorphMasksValid = false;
|
||||
}
|
||||
|
||||
LLViewerVisualParam* LLTexLayerInterface::getVisualParamPtr(S32 index) const
|
||||
|
|
@ -980,7 +980,7 @@ void LLTexLayer::asLLSD(LLSD& sd) const
|
|||
// setInfo
|
||||
//-----------------------------------------------------------------------------
|
||||
|
||||
BOOL LLTexLayer::setInfo(const LLTexLayerInfo* info, LLWearable* wearable )
|
||||
bool LLTexLayer::setInfo(const LLTexLayerInfo* info, LLWearable* wearable )
|
||||
{
|
||||
return LLTexLayerInterface::setInfo(info, wearable);
|
||||
}
|
||||
|
|
@ -1020,14 +1020,14 @@ void LLTexLayer::calculateTexLayerColor(const param_color_list_t ¶m_list, LL
|
|||
}
|
||||
}
|
||||
|
||||
BOOL LLTexLayer::render(S32 x, S32 y, S32 width, S32 height, LLRenderTarget* bound_target)
|
||||
bool LLTexLayer::render(S32 x, S32 y, S32 width, S32 height, LLRenderTarget* bound_target)
|
||||
{
|
||||
// *TODO: Is this correct?
|
||||
//gPipeline.disableLights();
|
||||
stop_glerror();
|
||||
|
||||
LLColor4 net_color;
|
||||
BOOL color_specified = findNetColor(&net_color);
|
||||
bool color_specified = findNetColor(&net_color);
|
||||
|
||||
if (mTexLayerSet->getAvatarAppearance()->mIsDummy)
|
||||
{
|
||||
|
|
@ -1035,15 +1035,15 @@ BOOL LLTexLayer::render(S32 x, S32 y, S32 width, S32 height, LLRenderTarget* bou
|
|||
net_color = LLAvatarAppearance::getDummyColor();
|
||||
}
|
||||
|
||||
BOOL success = TRUE;
|
||||
bool success = true;
|
||||
|
||||
// If you can't see the layer, don't render it.
|
||||
if( is_approx_zero( net_color.mV[VW] ) )
|
||||
if( is_approx_zero( net_color.mV[VALPHA] ) )
|
||||
{
|
||||
return success;
|
||||
}
|
||||
|
||||
BOOL alpha_mask_specified = FALSE;
|
||||
bool alpha_mask_specified = false;
|
||||
param_alpha_list_t::const_iterator iter = mParamAlphaList.begin();
|
||||
if( iter != mParamAlphaList.end() )
|
||||
{
|
||||
|
|
@ -1051,7 +1051,7 @@ BOOL LLTexLayer::render(S32 x, S32 y, S32 width, S32 height, LLRenderTarget* bou
|
|||
// However, we can't do this optimization if we have morph masks that need updating.
|
||||
/* if (!mHasMorph)
|
||||
{
|
||||
BOOL skip_layer = TRUE;
|
||||
bool skip_layer = true;
|
||||
|
||||
while( iter != mParamAlphaList.end() )
|
||||
{
|
||||
|
|
@ -1059,7 +1059,7 @@ BOOL LLTexLayer::render(S32 x, S32 y, S32 width, S32 height, LLRenderTarget* bou
|
|||
|
||||
if( !param->getSkip() )
|
||||
{
|
||||
skip_layer = FALSE;
|
||||
skip_layer = false;
|
||||
break;
|
||||
}
|
||||
|
||||
|
|
@ -1074,7 +1074,7 @@ BOOL LLTexLayer::render(S32 x, S32 y, S32 width, S32 height, LLRenderTarget* bou
|
|||
|
||||
const bool force_render = true;
|
||||
renderMorphMasks(x, y, width, height, net_color, bound_target, force_render);
|
||||
alpha_mask_specified = TRUE;
|
||||
alpha_mask_specified = true;
|
||||
gGL.flush();
|
||||
gGL.blendFunc(LLRender::BF_DEST_ALPHA, LLRender::BF_ONE_MINUS_DEST_ALPHA);
|
||||
}
|
||||
|
|
@ -1115,7 +1115,7 @@ BOOL LLTexLayer::render(S32 x, S32 y, S32 width, S32 height, LLRenderTarget* bou
|
|||
|
||||
LLTexUnit::eTextureAddressMode old_mode = tex->getAddressMode();
|
||||
|
||||
gGL.getTexUnit(0)->bind(tex, TRUE);
|
||||
gGL.getTexUnit(0)->bind(tex, true);
|
||||
gGL.getTexUnit(0)->setTextureAddressMode(LLTexUnit::TAM_CLAMP);
|
||||
|
||||
gl_rect_2d_simple_tex( width, height );
|
||||
|
|
@ -1130,7 +1130,7 @@ BOOL LLTexLayer::render(S32 x, S32 y, S32 width, S32 height, LLRenderTarget* bou
|
|||
}
|
||||
// else
|
||||
// {
|
||||
// success = FALSE;
|
||||
// success = false;
|
||||
// }
|
||||
}
|
||||
}
|
||||
|
|
@ -1141,13 +1141,13 @@ BOOL LLTexLayer::render(S32 x, S32 y, S32 width, S32 height, LLRenderTarget* bou
|
|||
LLGLTexture* tex = LLTexLayerStaticImageList::getInstance()->getTexture(getInfo()->mStaticImageFileName, getInfo()->mStaticImageIsMask);
|
||||
if( tex )
|
||||
{
|
||||
gGL.getTexUnit(0)->bind(tex, TRUE);
|
||||
gGL.getTexUnit(0)->bind(tex, true);
|
||||
gl_rect_2d_simple_tex( width, height );
|
||||
gGL.getTexUnit(0)->unbind(LLTexUnit::TT_TEXTURE);
|
||||
}
|
||||
else
|
||||
{
|
||||
success = FALSE;
|
||||
success = false;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -1199,7 +1199,7 @@ const U8* LLTexLayer::getAlphaData() const
|
|||
return (iter2 == mAlphaCache.end()) ? 0 : iter2->second;
|
||||
}
|
||||
|
||||
BOOL LLTexLayer::findNetColor(LLColor4* net_color) const
|
||||
bool LLTexLayer::findNetColor(LLColor4* net_color) const
|
||||
{
|
||||
// Color is either:
|
||||
// * one or more color parameters (weighted colors) (which may make use of a global color or fixed color)
|
||||
|
|
@ -1213,7 +1213,7 @@ BOOL LLTexLayer::findNetColor(LLColor4* net_color) const
|
|||
{
|
||||
net_color->setVec( mTexLayerSet->getAvatarAppearance()->getGlobalColor( getInfo()->mGlobalColor ) );
|
||||
}
|
||||
else if (getInfo()->mFixedColor.mV[VW])
|
||||
else if (getInfo()->mFixedColor.mV[VALPHA])
|
||||
{
|
||||
net_color->setVec( getInfo()->mFixedColor );
|
||||
}
|
||||
|
|
@ -1223,29 +1223,29 @@ BOOL LLTexLayer::findNetColor(LLColor4* net_color) const
|
|||
}
|
||||
|
||||
calculateTexLayerColor(mParamColorList, *net_color);
|
||||
return TRUE;
|
||||
return true;
|
||||
}
|
||||
|
||||
if( !getGlobalColor().empty() )
|
||||
{
|
||||
net_color->setVec( mTexLayerSet->getAvatarAppearance()->getGlobalColor( getGlobalColor() ) );
|
||||
return TRUE;
|
||||
return true;
|
||||
}
|
||||
|
||||
if( getInfo()->mFixedColor.mV[VW] )
|
||||
if( getInfo()->mFixedColor.mV[VALPHA] )
|
||||
{
|
||||
net_color->setVec( getInfo()->mFixedColor );
|
||||
return TRUE;
|
||||
return true;
|
||||
}
|
||||
|
||||
net_color->setToWhite();
|
||||
|
||||
return FALSE; // No need to draw a separate colored polygon
|
||||
return false; // No need to draw a separate colored polygon
|
||||
}
|
||||
|
||||
BOOL LLTexLayer::blendAlphaTexture(S32 x, S32 y, S32 width, S32 height)
|
||||
bool LLTexLayer::blendAlphaTexture(S32 x, S32 y, S32 width, S32 height)
|
||||
{
|
||||
BOOL success = TRUE;
|
||||
bool success = true;
|
||||
|
||||
gGL.flush();
|
||||
|
||||
|
|
@ -1255,14 +1255,14 @@ BOOL LLTexLayer::blendAlphaTexture(S32 x, S32 y, S32 width, S32 height)
|
|||
if( tex )
|
||||
{
|
||||
gAlphaMaskProgram.setMinimumAlpha(0.f);
|
||||
gGL.getTexUnit(0)->bind(tex, TRUE);
|
||||
gGL.getTexUnit(0)->bind(tex, true);
|
||||
gl_rect_2d_simple_tex( width, height );
|
||||
gGL.getTexUnit(0)->unbind(LLTexUnit::TT_TEXTURE);
|
||||
gAlphaMaskProgram.setMinimumAlpha(0.004f);
|
||||
}
|
||||
else
|
||||
{
|
||||
success = FALSE;
|
||||
success = false;
|
||||
}
|
||||
}
|
||||
else
|
||||
|
|
@ -1297,7 +1297,7 @@ void LLTexLayer::renderMorphMasks(S32 x, S32 y, S32 width, S32 height, const LLC
|
|||
return;
|
||||
}
|
||||
LL_PROFILE_ZONE_SCOPED;
|
||||
BOOL success = TRUE;
|
||||
bool success = true;
|
||||
|
||||
llassert( !mParamAlphaList.empty() );
|
||||
|
||||
|
|
@ -1342,7 +1342,7 @@ void LLTexLayer::renderMorphMasks(S32 x, S32 y, S32 width, S32 height, const LLC
|
|||
{
|
||||
LLTexUnit::eTextureAddressMode old_mode = tex->getAddressMode();
|
||||
|
||||
gGL.getTexUnit(0)->bind(tex, TRUE);
|
||||
gGL.getTexUnit(0)->bind(tex, true);
|
||||
gGL.getTexUnit(0)->setTextureAddressMode(LLTexUnit::TAM_CLAMP);
|
||||
|
||||
gl_rect_2d_simple_tex( width, height );
|
||||
|
|
@ -1359,7 +1359,7 @@ void LLTexLayer::renderMorphMasks(S32 x, S32 y, S32 width, S32 height, const LLC
|
|||
{
|
||||
if( (tex->getComponents() == 4) || (tex->getComponents() == 1) )
|
||||
{
|
||||
gGL.getTexUnit(0)->bind(tex, TRUE);
|
||||
gGL.getTexUnit(0)->bind(tex, true);
|
||||
gl_rect_2d_simple_tex( width, height );
|
||||
gGL.getTexUnit(0)->unbind(LLTexUnit::TT_TEXTURE);
|
||||
}
|
||||
|
|
@ -1373,7 +1373,7 @@ void LLTexLayer::renderMorphMasks(S32 x, S32 y, S32 width, S32 height, const LLC
|
|||
|
||||
// Draw a rectangle with the layer color to multiply the alpha by that color's alpha.
|
||||
// Note: we're still using gGL.blendFunc( GL_DST_ALPHA, GL_ZERO );
|
||||
if ( !is_approx_equal(layer_color.mV[VW], 1.f) )
|
||||
if ( !is_approx_equal(layer_color.mV[VALPHA], 1.f) )
|
||||
{
|
||||
gGL.getTexUnit(0)->unbind(LLTexUnit::TT_TEXTURE);
|
||||
gGL.color4fv(layer_color.mV);
|
||||
|
|
@ -1480,7 +1480,7 @@ void LLTexLayer::renderMorphMasks(S32 x, S32 y, S32 width, S32 height, const LLC
|
|||
|
||||
getTexLayerSet()->getAvatarAppearance()->dirtyMesh();
|
||||
|
||||
mMorphMasksValid = TRUE;
|
||||
mMorphMasksValid = true;
|
||||
getTexLayerSet()->applyMorphMask(alpha_data, width, height, 1);
|
||||
}
|
||||
}
|
||||
|
|
@ -1513,17 +1513,17 @@ void LLTexLayer::addAlphaMask(U8 *data, S32 originX, S32 originY, S32 width, S32
|
|||
}
|
||||
}
|
||||
|
||||
/*virtual*/ BOOL LLTexLayer::isInvisibleAlphaMask() const
|
||||
/*virtual*/ bool LLTexLayer::isInvisibleAlphaMask() const
|
||||
{
|
||||
if (mLocalTextureObject)
|
||||
{
|
||||
if (mLocalTextureObject->getID() == IMG_INVISIBLE)
|
||||
{
|
||||
return TRUE;
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
return FALSE;
|
||||
return false;
|
||||
}
|
||||
|
||||
LLUUID LLTexLayer::getUUID() const
|
||||
|
|
@ -1582,7 +1582,7 @@ LLTexLayerTemplate::~LLTexLayerTemplate()
|
|||
// setInfo
|
||||
//-----------------------------------------------------------------------------
|
||||
|
||||
/*virtual*/ BOOL LLTexLayerTemplate::setInfo(const LLTexLayerInfo* info, LLWearable* wearable )
|
||||
/*virtual*/ bool LLTexLayerTemplate::setInfo(const LLTexLayerInfo* info, LLWearable* wearable )
|
||||
{
|
||||
return LLTexLayerInterface::setInfo(info, wearable);
|
||||
}
|
||||
|
|
@ -1631,14 +1631,14 @@ LLTexLayer* LLTexLayerTemplate::getLayer(U32 i) const
|
|||
return layer;
|
||||
}
|
||||
|
||||
/*virtual*/ BOOL LLTexLayerTemplate::render(S32 x, S32 y, S32 width, S32 height, LLRenderTarget* bound_target)
|
||||
/*virtual*/ bool LLTexLayerTemplate::render(S32 x, S32 y, S32 width, S32 height, LLRenderTarget* bound_target)
|
||||
{
|
||||
if(!mInfo)
|
||||
{
|
||||
return FALSE ;
|
||||
return false ;
|
||||
}
|
||||
|
||||
BOOL success = TRUE;
|
||||
bool success = true;
|
||||
updateWearableCache();
|
||||
for (LLWearable* wearable : mWearableCache)
|
||||
{
|
||||
|
|
@ -1663,9 +1663,9 @@ LLTexLayer* LLTexLayerTemplate::getLayer(U32 i) const
|
|||
return success;
|
||||
}
|
||||
|
||||
/*virtual*/ BOOL LLTexLayerTemplate::blendAlphaTexture( S32 x, S32 y, S32 width, S32 height) // Multiplies a single alpha texture against the frame buffer
|
||||
/*virtual*/ bool LLTexLayerTemplate::blendAlphaTexture( S32 x, S32 y, S32 width, S32 height) // Multiplies a single alpha texture against the frame buffer
|
||||
{
|
||||
BOOL success = TRUE;
|
||||
bool success = true;
|
||||
U32 num_wearables = updateWearableCache();
|
||||
for (U32 i = 0; i < num_wearables; i++)
|
||||
{
|
||||
|
|
@ -1689,7 +1689,7 @@ LLTexLayer* LLTexLayerTemplate::getLayer(U32 i) const
|
|||
}
|
||||
}
|
||||
|
||||
/*virtual*/ void LLTexLayerTemplate::setHasMorph(BOOL newval)
|
||||
/*virtual*/ void LLTexLayerTemplate::setHasMorph(bool newval)
|
||||
{
|
||||
mHasMorph = newval;
|
||||
U32 num_wearables = updateWearableCache();
|
||||
|
|
@ -1716,7 +1716,7 @@ LLTexLayer* LLTexLayerTemplate::getLayer(U32 i) const
|
|||
}
|
||||
}
|
||||
|
||||
/*virtual*/ BOOL LLTexLayerTemplate::isInvisibleAlphaMask() const
|
||||
/*virtual*/ bool LLTexLayerTemplate::isInvisibleAlphaMask() const
|
||||
{
|
||||
U32 num_wearables = updateWearableCache();
|
||||
for (U32 i = 0; i < num_wearables; i++)
|
||||
|
|
@ -1726,12 +1726,12 @@ LLTexLayer* LLTexLayerTemplate::getLayer(U32 i) const
|
|||
{
|
||||
if (layer->isInvisibleAlphaMask())
|
||||
{
|
||||
return TRUE;
|
||||
return true;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return FALSE;
|
||||
return false;
|
||||
}
|
||||
|
||||
|
||||
|
|
@ -1853,7 +1853,7 @@ LLImageTGA* LLTexLayerStaticImageList::getImageTGA(const std::string& file_name)
|
|||
|
||||
// Returns a GL Image (without a backing ImageRaw) that contains the decoded data from a tga file named file_name.
|
||||
// Caches the result to speed identical subsequent requests.
|
||||
LLGLTexture* LLTexLayerStaticImageList::getTexture(const std::string& file_name, BOOL is_mask)
|
||||
LLGLTexture* LLTexLayerStaticImageList::getTexture(const std::string& file_name, bool is_mask)
|
||||
{
|
||||
LL_PROFILE_ZONE_SCOPED;
|
||||
LLPointer<LLGLTexture> tex;
|
||||
|
|
@ -1867,7 +1867,7 @@ LLGLTexture* LLTexLayerStaticImageList::getTexture(const std::string& file_name,
|
|||
else
|
||||
{
|
||||
llassert(gTextureManagerBridgep);
|
||||
tex = gTextureManagerBridgep->getLocalTexture( FALSE );
|
||||
tex = gTextureManagerBridgep->getLocalTexture( false );
|
||||
LLPointer<LLImageRaw> image_raw = new LLImageRaw;
|
||||
if( loadImageRaw( file_name, image_raw ) )
|
||||
{
|
||||
|
|
@ -1883,7 +1883,7 @@ LLGLTexture* LLTexLayerStaticImageList::getTexture(const std::string& file_name,
|
|||
|
||||
image_raw->copyUnscaledAlphaMask(alpha_image_raw, LLColor4U::black);
|
||||
}
|
||||
tex->createGLTexture(0, image_raw, 0, TRUE, LLGLTexture::LOCAL);
|
||||
tex->createGLTexture(0, image_raw, 0, true, LLGLTexture::LOCAL);
|
||||
|
||||
gGL.getTexUnit(0)->bind(tex);
|
||||
tex->setAddressMode(LLTexUnit::TAM_CLAMP);
|
||||
|
|
@ -1901,11 +1901,11 @@ LLGLTexture* LLTexLayerStaticImageList::getTexture(const std::string& file_name,
|
|||
}
|
||||
|
||||
// Reads a .tga file, decodes it, and puts the decoded data in image_raw.
|
||||
// Returns TRUE if successful.
|
||||
BOOL LLTexLayerStaticImageList::loadImageRaw(const std::string& file_name, LLImageRaw* image_raw)
|
||||
// Returns true if successful.
|
||||
bool LLTexLayerStaticImageList::loadImageRaw(const std::string& file_name, LLImageRaw* image_raw)
|
||||
{
|
||||
LL_PROFILE_ZONE_SCOPED;
|
||||
BOOL success = FALSE;
|
||||
bool success = false;
|
||||
std::string path;
|
||||
path = gDirUtilp->getExpandedFilename(LL_PATH_CHARACTER,file_name);
|
||||
LLPointer<LLImageTGA> image_tga = new LLImageTGA( path );
|
||||
|
|
|
|||
|
|
@ -65,13 +65,13 @@ public:
|
|||
LLTexLayerInterface(const LLTexLayerInterface &layer, LLWearable *wearable);
|
||||
virtual ~LLTexLayerInterface() {}
|
||||
|
||||
virtual BOOL render(S32 x, S32 y, S32 width, S32 height, LLRenderTarget* bound_target) = 0;
|
||||
virtual bool render(S32 x, S32 y, S32 width, S32 height, LLRenderTarget* bound_target) = 0;
|
||||
virtual void deleteCaches() = 0;
|
||||
virtual BOOL blendAlphaTexture(S32 x, S32 y, S32 width, S32 height) = 0;
|
||||
virtual BOOL isInvisibleAlphaMask() const = 0;
|
||||
virtual bool blendAlphaTexture(S32 x, S32 y, S32 width, S32 height) = 0;
|
||||
virtual bool isInvisibleAlphaMask() const = 0;
|
||||
|
||||
const LLTexLayerInfo* getInfo() const { return mInfo; }
|
||||
virtual BOOL setInfo(const LLTexLayerInfo *info, LLWearable* wearable); // sets mInfo, calls initialization functions
|
||||
virtual bool setInfo(const LLTexLayerInfo *info, LLWearable* wearable); // sets mInfo, calls initialization functions
|
||||
LLWearableType::EType getWearableType() const;
|
||||
LLAvatarAppearanceDefines::ETextureIndex getLocalTextureIndex() const;
|
||||
|
||||
|
|
@ -80,16 +80,16 @@ public:
|
|||
LLTexLayerSet* const getTexLayerSet() { return mTexLayerSet; }
|
||||
|
||||
void invalidateMorphMasks();
|
||||
virtual void setHasMorph(BOOL newval) { mHasMorph = newval; }
|
||||
BOOL hasMorph() const { return mHasMorph; }
|
||||
BOOL isMorphValid() const { return mMorphMasksValid; }
|
||||
virtual void setHasMorph(bool newval) { mHasMorph = newval; }
|
||||
bool hasMorph() const { return mHasMorph; }
|
||||
bool isMorphValid() const { return mMorphMasksValid; }
|
||||
|
||||
void requestUpdate();
|
||||
virtual void gatherAlphaMasks(U8 *data, S32 originX, S32 originY, S32 width, S32 height, LLRenderTarget* bound_target) = 0;
|
||||
BOOL hasAlphaParams() const { return !mParamAlphaList.empty(); }
|
||||
bool hasAlphaParams() const { return !mParamAlphaList.empty(); }
|
||||
|
||||
ERenderPass getRenderPass() const;
|
||||
BOOL isVisibilityMask() const;
|
||||
bool isVisibilityMask() const;
|
||||
|
||||
virtual void asLLSD(LLSD& sd) const {}
|
||||
|
||||
|
|
@ -100,8 +100,8 @@ protected:
|
|||
protected:
|
||||
LLTexLayerSet* const mTexLayerSet;
|
||||
const LLTexLayerInfo* mInfo;
|
||||
BOOL mMorphMasksValid;
|
||||
BOOL mHasMorph;
|
||||
bool mMorphMasksValid;
|
||||
bool mHasMorph;
|
||||
|
||||
// Layers can have either mParamColorList, mGlobalColor, or mFixedColor. They are looked for in that order.
|
||||
param_color_list_t mParamColorList;
|
||||
|
|
@ -121,13 +121,13 @@ public:
|
|||
LLTexLayerTemplate(LLTexLayerSet* const layer_set, LLAvatarAppearance* const appearance);
|
||||
LLTexLayerTemplate(const LLTexLayerTemplate &layer);
|
||||
/*virtual*/ ~LLTexLayerTemplate();
|
||||
/*virtual*/ BOOL render(S32 x, S32 y, S32 width, S32 height, LLRenderTarget* bound_target);
|
||||
/*virtual*/ BOOL setInfo(const LLTexLayerInfo *info, LLWearable* wearable); // This sets mInfo and calls initialization functions
|
||||
/*virtual*/ BOOL blendAlphaTexture(S32 x, S32 y, S32 width, S32 height); // Multiplies a single alpha texture against the frame buffer
|
||||
/*virtual*/ bool render(S32 x, S32 y, S32 width, S32 height, LLRenderTarget* bound_target);
|
||||
/*virtual*/ bool setInfo(const LLTexLayerInfo *info, LLWearable* wearable); // This sets mInfo and calls initialization functions
|
||||
/*virtual*/ bool blendAlphaTexture(S32 x, S32 y, S32 width, S32 height); // Multiplies a single alpha texture against the frame buffer
|
||||
/*virtual*/ void gatherAlphaMasks(U8 *data, S32 originX, S32 originY, S32 width, S32 height, LLRenderTarget* bound_target);
|
||||
/*virtual*/ void setHasMorph(BOOL newval);
|
||||
/*virtual*/ void setHasMorph(bool newval);
|
||||
/*virtual*/ void deleteCaches();
|
||||
/*virtual*/ BOOL isInvisibleAlphaMask() const;
|
||||
/*virtual*/ bool isInvisibleAlphaMask() const;
|
||||
protected:
|
||||
U32 updateWearableCache() const;
|
||||
LLTexLayer* getLayer(U32 i) const;
|
||||
|
|
@ -151,18 +151,18 @@ public:
|
|||
LLTexLayer(const LLTexLayerTemplate &layer_template, LLLocalTextureObject *lto, LLWearable *wearable);
|
||||
/*virtual*/ ~LLTexLayer();
|
||||
|
||||
/*virtual*/ BOOL setInfo(const LLTexLayerInfo *info, LLWearable* wearable); // This sets mInfo and calls initialization functions
|
||||
/*virtual*/ BOOL render(S32 x, S32 y, S32 width, S32 height, LLRenderTarget* bound_target);
|
||||
/*virtual*/ bool setInfo(const LLTexLayerInfo *info, LLWearable* wearable); // This sets mInfo and calls initialization functions
|
||||
/*virtual*/ bool render(S32 x, S32 y, S32 width, S32 height, LLRenderTarget* bound_target);
|
||||
|
||||
/*virtual*/ void deleteCaches();
|
||||
const U8* getAlphaData() const;
|
||||
|
||||
BOOL findNetColor(LLColor4* color) const;
|
||||
/*virtual*/ BOOL blendAlphaTexture(S32 x, S32 y, S32 width, S32 height); // Multiplies a single alpha texture against the frame buffer
|
||||
bool findNetColor(LLColor4* color) const;
|
||||
/*virtual*/ bool blendAlphaTexture(S32 x, S32 y, S32 width, S32 height); // Multiplies a single alpha texture against the frame buffer
|
||||
/*virtual*/ void gatherAlphaMasks(U8 *data, S32 originX, S32 originY, S32 width, S32 height, LLRenderTarget* bound_target);
|
||||
void renderMorphMasks(S32 x, S32 y, S32 width, S32 height, const LLColor4 &layer_color, LLRenderTarget* bound_target, bool force_render);
|
||||
void addAlphaMask(U8 *data, S32 originX, S32 originY, S32 width, S32 height, LLRenderTarget* bound_target);
|
||||
/*virtual*/ BOOL isInvisibleAlphaMask() const;
|
||||
/*virtual*/ bool isInvisibleAlphaMask() const;
|
||||
|
||||
void setLTO(LLLocalTextureObject *lto) { mLocalTextureObject = lto; }
|
||||
LLLocalTextureObject* getLTO() { return mLocalTextureObject; }
|
||||
|
|
@ -197,14 +197,14 @@ public:
|
|||
void gatherMorphMaskAlpha(U8 *data, S32 origin_x, S32 origin_y, S32 width, S32 height, LLRenderTarget* bound_target);
|
||||
|
||||
const LLTexLayerSetInfo* getInfo() const { return mInfo; }
|
||||
BOOL setInfo(const LLTexLayerSetInfo *info); // This sets mInfo and calls initialization functions
|
||||
bool setInfo(const LLTexLayerSetInfo *info); // This sets mInfo and calls initialization functions
|
||||
|
||||
BOOL render(S32 x, S32 y, S32 width, S32 height, LLRenderTarget* bound_target = nullptr);
|
||||
bool render(S32 x, S32 y, S32 width, S32 height, LLRenderTarget* bound_target = nullptr);
|
||||
void renderAlphaMaskTextures(S32 x, S32 y, S32 width, S32 height, LLRenderTarget* bound_target = nullptr, bool forceClear = false);
|
||||
|
||||
BOOL isBodyRegion(const std::string& region) const;
|
||||
void applyMorphMask(U8* tex_data, S32 width, S32 height, S32 num_components);
|
||||
BOOL isMorphValid() const;
|
||||
bool isBodyRegion(const std::string& region) const;
|
||||
void applyMorphMask(const U8* tex_data, S32 width, S32 height, S32 num_components);
|
||||
bool isMorphValid() const;
|
||||
virtual void requestUpdate() = 0;
|
||||
void invalidateMorphMasks();
|
||||
void deleteCaches();
|
||||
|
|
@ -213,12 +213,12 @@ public:
|
|||
|
||||
LLAvatarAppearance* getAvatarAppearance() const { return mAvatarAppearance; }
|
||||
const std::string getBodyRegionName() const;
|
||||
BOOL hasComposite() const { return (mComposite.notNull()); }
|
||||
bool hasComposite() const { return (mComposite.notNull()); }
|
||||
LLAvatarAppearanceDefines::EBakedTextureIndex getBakedTexIndex() const { return mBakedTexIndex; }
|
||||
void setBakedTexIndex(LLAvatarAppearanceDefines::EBakedTextureIndex index) { mBakedTexIndex = index; }
|
||||
BOOL isVisible() const { return mIsVisible; }
|
||||
bool isVisible() const { return mIsVisible; }
|
||||
|
||||
static BOOL sHasCaches;
|
||||
static bool sHasCaches;
|
||||
|
||||
protected:
|
||||
typedef std::vector<LLTexLayerInterface *> layer_list_t;
|
||||
|
|
@ -226,7 +226,7 @@ protected:
|
|||
layer_list_t mMaskLayerList;
|
||||
LLPointer<LLTexLayerSetBuffer> mComposite;
|
||||
LLAvatarAppearance* const mAvatarAppearance; // note: backlink only; don't make this an LLPointer.
|
||||
BOOL mIsVisible;
|
||||
bool mIsVisible;
|
||||
|
||||
LLAvatarAppearanceDefines::EBakedTextureIndex mBakedTexIndex;
|
||||
const LLTexLayerSetInfo* mInfo;
|
||||
|
|
@ -243,7 +243,7 @@ class LLTexLayerSetInfo
|
|||
public:
|
||||
LLTexLayerSetInfo();
|
||||
~LLTexLayerSetInfo();
|
||||
BOOL parseXml(LLXmlTreeNode* node);
|
||||
bool parseXml(LLXmlTreeNode* node);
|
||||
void createVisualParams(LLAvatarAppearance *appearance);
|
||||
S32 getWidth() const { return mWidth; }
|
||||
S32 getHeight() const { return mHeight; }
|
||||
|
|
@ -252,7 +252,7 @@ protected:
|
|||
S32 mWidth;
|
||||
S32 mHeight;
|
||||
std::string mStaticAlphaFileName;
|
||||
BOOL mClearAlpha; // Set alpha to 1 for this layerset (if there is no mStaticAlphaFileName)
|
||||
bool mClearAlpha; // Set alpha to 1 for this layerset (if there is no mStaticAlphaFileName)
|
||||
typedef std::vector<LLTexLayerInfo*> layer_info_list_t;
|
||||
layer_info_list_t mLayerInfoList;
|
||||
};
|
||||
|
|
@ -274,13 +274,13 @@ protected:
|
|||
void pushProjection() const;
|
||||
void popProjection() const;
|
||||
virtual void preRenderTexLayerSet();
|
||||
virtual void midRenderTexLayerSet(BOOL success) {}
|
||||
virtual void postRenderTexLayerSet(BOOL success);
|
||||
virtual void midRenderTexLayerSet(bool success) {}
|
||||
virtual void postRenderTexLayerSet(bool success);
|
||||
virtual S32 getCompositeOriginX() const = 0;
|
||||
virtual S32 getCompositeOriginY() const = 0;
|
||||
virtual S32 getCompositeWidth() const = 0;
|
||||
virtual S32 getCompositeHeight() const = 0;
|
||||
BOOL renderTexLayerSet(LLRenderTarget* bound_target);
|
||||
bool renderTexLayerSet(LLRenderTarget* bound_target);
|
||||
|
||||
LLTexLayerSet* const mTexLayerSet;
|
||||
};
|
||||
|
|
@ -294,12 +294,12 @@ class LLTexLayerStaticImageList : public LLSingleton<LLTexLayerStaticImageList>
|
|||
LLSINGLETON(LLTexLayerStaticImageList);
|
||||
~LLTexLayerStaticImageList();
|
||||
public:
|
||||
LLGLTexture* getTexture(const std::string& file_name, BOOL is_mask);
|
||||
LLGLTexture* getTexture(const std::string& file_name, bool is_mask);
|
||||
LLImageTGA* getImageTGA(const std::string& file_name);
|
||||
void deleteCachedImages();
|
||||
void dumpByteCount() const;
|
||||
protected:
|
||||
BOOL loadImageRaw(const std::string& file_name, LLImageRaw* image_raw);
|
||||
bool loadImageRaw(const std::string& file_name, LLImageRaw* image_raw);
|
||||
private:
|
||||
LLStringTable mImageNames;
|
||||
typedef std::map<const char*, LLPointer<LLGLTexture> > texture_map_t;
|
||||
|
|
|
|||
|
|
@ -69,7 +69,7 @@ LLTexLayerParam::LLTexLayerParam(const LLTexLayerParam& pOther)
|
|||
{
|
||||
}
|
||||
|
||||
BOOL LLTexLayerParam::setInfo(LLViewerVisualParamInfo *info, BOOL add_to_appearance)
|
||||
bool LLTexLayerParam::setInfo(LLViewerVisualParamInfo *info, bool add_to_appearance)
|
||||
{
|
||||
LLViewerVisualParam::setInfo(info);
|
||||
|
||||
|
|
@ -79,7 +79,7 @@ BOOL LLTexLayerParam::setInfo(LLViewerVisualParamInfo *info, BOOL add_to_appeara
|
|||
this->setParamLocation(mAvatarAppearance->isSelf() ? LOC_AV_SELF : LOC_AV_OTHER);
|
||||
}
|
||||
|
||||
return TRUE;
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
|
|
@ -123,8 +123,8 @@ LLTexLayerParamAlpha::LLTexLayerParamAlpha(LLTexLayerInterface* layer)
|
|||
mCachedProcessedTexture(NULL),
|
||||
mStaticImageTGA(),
|
||||
mStaticImageRaw(),
|
||||
mNeedsCreateTexture(FALSE),
|
||||
mStaticImageInvalid(FALSE),
|
||||
mNeedsCreateTexture(false),
|
||||
mStaticImageInvalid(false),
|
||||
mAvgDistortionVec(1.f, 1.f, 1.f),
|
||||
mCachedEffectiveWeight(0.f)
|
||||
{
|
||||
|
|
@ -136,8 +136,8 @@ LLTexLayerParamAlpha::LLTexLayerParamAlpha(LLAvatarAppearance* appearance)
|
|||
mCachedProcessedTexture(NULL),
|
||||
mStaticImageTGA(),
|
||||
mStaticImageRaw(),
|
||||
mNeedsCreateTexture(FALSE),
|
||||
mStaticImageInvalid(FALSE),
|
||||
mNeedsCreateTexture(false),
|
||||
mStaticImageInvalid(false),
|
||||
mAvgDistortionVec(1.f, 1.f, 1.f),
|
||||
mCachedEffectiveWeight(0.f)
|
||||
{
|
||||
|
|
@ -173,10 +173,10 @@ void LLTexLayerParamAlpha::deleteCaches()
|
|||
mStaticImageTGA = NULL; // deletes image
|
||||
mCachedProcessedTexture = NULL;
|
||||
mStaticImageRaw = NULL;
|
||||
mNeedsCreateTexture = FALSE;
|
||||
mNeedsCreateTexture = false;
|
||||
}
|
||||
|
||||
BOOL LLTexLayerParamAlpha::getMultiplyBlend() const
|
||||
bool LLTexLayerParamAlpha::getMultiplyBlend() const
|
||||
{
|
||||
return ((LLTexLayerParamAlphaInfo *)getInfo())->mMultiplyBlend;
|
||||
}
|
||||
|
|
@ -216,7 +216,7 @@ void LLTexLayerParamAlpha::setAnimationTarget(F32 target_value)
|
|||
|
||||
mTargetWeight = target_value;
|
||||
setWeight(target_value);
|
||||
mIsAnimating = TRUE;
|
||||
mIsAnimating = true;
|
||||
if (mNext)
|
||||
{
|
||||
mNext->setAnimationTarget(target_value);
|
||||
|
|
@ -231,11 +231,11 @@ void LLTexLayerParamAlpha::animate(F32 delta)
|
|||
}
|
||||
}
|
||||
|
||||
BOOL LLTexLayerParamAlpha::getSkip() const
|
||||
bool LLTexLayerParamAlpha::getSkip() const
|
||||
{
|
||||
if (!mTexLayer)
|
||||
{
|
||||
return TRUE;
|
||||
return true;
|
||||
}
|
||||
|
||||
const LLAvatarAppearance *appearance = mTexLayer->getTexLayerSet()->getAvatarAppearance();
|
||||
|
|
@ -245,24 +245,24 @@ BOOL LLTexLayerParamAlpha::getSkip() const
|
|||
F32 effective_weight = (appearance->getSex() & getSex()) ? mCurWeight : getDefaultWeight();
|
||||
if (is_approx_zero(effective_weight))
|
||||
{
|
||||
return TRUE;
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
LLWearableType::EType type = (LLWearableType::EType)getWearableType();
|
||||
if ((type != LLWearableType::WT_INVALID) && !appearance->isWearingWearableType(type))
|
||||
{
|
||||
return TRUE;
|
||||
return true;
|
||||
}
|
||||
|
||||
return FALSE;
|
||||
return false;
|
||||
}
|
||||
|
||||
|
||||
BOOL LLTexLayerParamAlpha::render(S32 x, S32 y, S32 width, S32 height)
|
||||
bool LLTexLayerParamAlpha::render(S32 x, S32 y, S32 width, S32 height)
|
||||
{
|
||||
LL_PROFILE_ZONE_SCOPED;
|
||||
BOOL success = TRUE;
|
||||
bool success = true;
|
||||
|
||||
if (!mTexLayer)
|
||||
{
|
||||
|
|
@ -270,7 +270,7 @@ BOOL LLTexLayerParamAlpha::render(S32 x, S32 y, S32 width, S32 height)
|
|||
}
|
||||
|
||||
F32 effective_weight = (mTexLayer->getTexLayerSet()->getAvatarAppearance()->getSex() & getSex()) ? mCurWeight : getDefaultWeight();
|
||||
BOOL weight_changed = effective_weight != mCachedEffectiveWeight;
|
||||
bool weight_changed = effective_weight != mCachedEffectiveWeight;
|
||||
if (getSkip())
|
||||
{
|
||||
return success;
|
||||
|
|
@ -294,13 +294,13 @@ BOOL LLTexLayerParamAlpha::render(S32 x, S32 y, S32 width, S32 height)
|
|||
// Don't load the image file until we actually need it the first time. Like now.
|
||||
mStaticImageTGA = LLTexLayerStaticImageList::getInstance()->getImageTGA(info->mStaticImageFileName);
|
||||
// We now have something in one of our caches
|
||||
LLTexLayerSet::sHasCaches |= mStaticImageTGA.notNull() ? TRUE : FALSE;
|
||||
LLTexLayerSet::sHasCaches |= mStaticImageTGA.notNull();
|
||||
|
||||
if (mStaticImageTGA.isNull())
|
||||
{
|
||||
LL_WARNS() << "Unable to load static file: " << info->mStaticImageFileName << LL_ENDL;
|
||||
mStaticImageInvalid = TRUE; // don't try again.
|
||||
return FALSE;
|
||||
mStaticImageInvalid = true; // don't try again.
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -316,10 +316,10 @@ BOOL LLTexLayerParamAlpha::render(S32 x, S32 y, S32 width, S32 height)
|
|||
if (!mCachedProcessedTexture)
|
||||
{
|
||||
llassert(gTextureManagerBridgep);
|
||||
mCachedProcessedTexture = gTextureManagerBridgep->getLocalTexture(image_tga_width, image_tga_height, 1, FALSE);
|
||||
mCachedProcessedTexture = gTextureManagerBridgep->getLocalTexture(image_tga_width, image_tga_height, 1, false);
|
||||
|
||||
// We now have something in one of our caches
|
||||
LLTexLayerSet::sHasCaches |= mCachedProcessedTexture ? TRUE : FALSE;
|
||||
LLTexLayerSet::sHasCaches |= mCachedProcessedTexture.notNull();
|
||||
|
||||
mCachedProcessedTexture->setExplicitFormat(GL_ALPHA8, GL_ALPHA);
|
||||
}
|
||||
|
|
@ -328,7 +328,7 @@ BOOL LLTexLayerParamAlpha::render(S32 x, S32 y, S32 width, S32 height)
|
|||
mStaticImageRaw = NULL;
|
||||
mStaticImageRaw = new LLImageRaw;
|
||||
mStaticImageTGA->decodeAndProcess(mStaticImageRaw, info->mDomain, effective_weight);
|
||||
mNeedsCreateTexture = TRUE;
|
||||
mNeedsCreateTexture = true;
|
||||
LL_DEBUGS() << "Built Cached Alpha: " << info->mStaticImageFileName << ": (" << mStaticImageRaw->getWidth() << ", " << mStaticImageRaw->getHeight() << ") " << "Domain: " << info->mDomain << " Weight: " << effective_weight << LL_ENDL;
|
||||
}
|
||||
|
||||
|
|
@ -339,7 +339,7 @@ BOOL LLTexLayerParamAlpha::render(S32 x, S32 y, S32 width, S32 height)
|
|||
if (mNeedsCreateTexture)
|
||||
{
|
||||
mCachedProcessedTexture->createGLTexture(0, mStaticImageRaw);
|
||||
mNeedsCreateTexture = FALSE;
|
||||
mNeedsCreateTexture = false;
|
||||
gGL.getTexUnit(0)->bind(mCachedProcessedTexture);
|
||||
mCachedProcessedTexture->setAddressMode(LLTexUnit::TAM_CLAMP);
|
||||
}
|
||||
|
|
@ -372,23 +372,23 @@ BOOL LLTexLayerParamAlpha::render(S32 x, S32 y, S32 width, S32 height)
|
|||
// LLTexLayerParamAlphaInfo
|
||||
//-----------------------------------------------------------------------------
|
||||
LLTexLayerParamAlphaInfo::LLTexLayerParamAlphaInfo() :
|
||||
mMultiplyBlend(FALSE),
|
||||
mSkipIfZeroWeight(FALSE),
|
||||
mMultiplyBlend(false),
|
||||
mSkipIfZeroWeight(false),
|
||||
mDomain(0.f)
|
||||
{
|
||||
}
|
||||
|
||||
BOOL LLTexLayerParamAlphaInfo::parseXml(LLXmlTreeNode* node)
|
||||
bool LLTexLayerParamAlphaInfo::parseXml(LLXmlTreeNode* node)
|
||||
{
|
||||
llassert(node->hasName("param") && node->getChildByName("param_alpha"));
|
||||
|
||||
if (!LLViewerVisualParamInfo::parseXml(node))
|
||||
return FALSE;
|
||||
return false;
|
||||
|
||||
LLXmlTreeNode* param_alpha_node = node->getChildByName("param_alpha");
|
||||
if (!param_alpha_node)
|
||||
{
|
||||
return FALSE;
|
||||
return false;
|
||||
}
|
||||
|
||||
static LLStdStringHandle tga_file_string = LLXmlTree::addAttributeString("tga_file");
|
||||
|
|
@ -410,7 +410,7 @@ BOOL LLTexLayerParamAlphaInfo::parseXml(LLXmlTreeNode* node)
|
|||
static LLStdStringHandle domain_string = LLXmlTree::addAttributeString("domain");
|
||||
param_alpha_node->getFastAttributeF32(domain_string, mDomain);
|
||||
|
||||
return TRUE;
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
|
|
@ -464,10 +464,10 @@ LLColor4 LLTexLayerParamColor::getNetColor() const
|
|||
F32 weight = scaled_weight - index_start;
|
||||
const LLColor4 *start = &info->mColors[ index_start ];
|
||||
const LLColor4 *end = &info->mColors[ index_end ];
|
||||
return LLColor4((1.f - weight) * start->mV[VX] + weight * end->mV[VX],
|
||||
(1.f - weight) * start->mV[VY] + weight * end->mV[VY],
|
||||
(1.f - weight) * start->mV[VZ] + weight * end->mV[VZ],
|
||||
(1.f - weight) * start->mV[VW] + weight * end->mV[VW]);
|
||||
return LLColor4((1.f - weight) * start->mV[VRED] + weight * end->mV[VRED],
|
||||
(1.f - weight) * start->mV[VGREEN] + weight * end->mV[VGREEN],
|
||||
(1.f - weight) * start->mV[VBLUE] + weight * end->mV[VBLUE],
|
||||
(1.f - weight) * start->mV[VALPHA] + weight * end->mV[VALPHA]);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -514,7 +514,7 @@ void LLTexLayerParamColor::setAnimationTarget(F32 target_value)
|
|||
// set value first then set interpolating flag to ignore further updates
|
||||
mTargetWeight = target_value;
|
||||
setWeight(target_value);
|
||||
mIsAnimating = TRUE;
|
||||
mIsAnimating = true;
|
||||
if (mNext)
|
||||
{
|
||||
mNext->setAnimationTarget(target_value);
|
||||
|
|
@ -538,17 +538,17 @@ LLTexLayerParamColorInfo::LLTexLayerParamColorInfo() :
|
|||
{
|
||||
}
|
||||
|
||||
BOOL LLTexLayerParamColorInfo::parseXml(LLXmlTreeNode *node)
|
||||
bool LLTexLayerParamColorInfo::parseXml(LLXmlTreeNode *node)
|
||||
{
|
||||
llassert(node->hasName("param") && node->getChildByName("param_color"));
|
||||
|
||||
if (!LLViewerVisualParamInfo::parseXml(node))
|
||||
return FALSE;
|
||||
return false;
|
||||
|
||||
LLXmlTreeNode* param_color_node = node->getChildByName("param_color");
|
||||
if (!param_color_node)
|
||||
{
|
||||
return FALSE;
|
||||
return false;
|
||||
}
|
||||
|
||||
std::string op_string;
|
||||
|
|
@ -581,14 +581,14 @@ BOOL LLTexLayerParamColorInfo::parseXml(LLXmlTreeNode *node)
|
|||
if (!mNumColors)
|
||||
{
|
||||
LL_WARNS() << "<param_color> is missing <value> sub-elements" << LL_ENDL;
|
||||
return FALSE;
|
||||
return false;
|
||||
}
|
||||
|
||||
if ((mOperation == LLTexLayerParamColor::OP_BLEND) && (mNumColors != 1))
|
||||
{
|
||||
LL_WARNS() << "<param_color> with operation\"blend\" must have exactly one <value>" << LL_ENDL;
|
||||
return FALSE;
|
||||
return false;
|
||||
}
|
||||
|
||||
return TRUE;
|
||||
return true;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -48,7 +48,7 @@ class LLTexLayerParam : public LLViewerVisualParam
|
|||
public:
|
||||
LLTexLayerParam(LLTexLayerInterface *layer);
|
||||
LLTexLayerParam(LLAvatarAppearance *appearance);
|
||||
/*virtual*/ BOOL setInfo(LLViewerVisualParamInfo *info, BOOL add_to_appearance);
|
||||
/*virtual*/ bool setInfo(LLViewerVisualParamInfo *info, bool add_to_appearance);
|
||||
/*virtual*/ LLViewerVisualParam* cloneParam(LLWearable* wearable) const = 0;
|
||||
|
||||
protected:
|
||||
|
|
@ -74,7 +74,7 @@ public:
|
|||
/*virtual*/ LLViewerVisualParam* cloneParam(LLWearable* wearable = NULL) const;
|
||||
|
||||
// LLVisualParam Virtual functions
|
||||
///*virtual*/ BOOL parseData(LLXmlTreeNode* node);
|
||||
///*virtual*/ bool parseData(LLXmlTreeNode* node);
|
||||
/*virtual*/ void apply( ESex avatar_sex ) {}
|
||||
/*virtual*/ void setWeight(F32 weight);
|
||||
/*virtual*/ void setAnimationTarget(F32 target_value);
|
||||
|
|
@ -89,10 +89,10 @@ public:
|
|||
/*virtual*/ const LLVector4a* getNextDistortion(U32 *index, LLPolyMesh **poly_mesh) { index = 0; poly_mesh = NULL; return NULL;};
|
||||
|
||||
// New functions
|
||||
BOOL render( S32 x, S32 y, S32 width, S32 height );
|
||||
BOOL getSkip() const;
|
||||
bool render( S32 x, S32 y, S32 width, S32 height );
|
||||
bool getSkip() const;
|
||||
void deleteCaches();
|
||||
BOOL getMultiplyBlend() const;
|
||||
bool getMultiplyBlend() const;
|
||||
|
||||
private:
|
||||
LLTexLayerParamAlpha(const LLTexLayerParamAlpha& pOther);
|
||||
|
|
@ -100,8 +100,8 @@ private:
|
|||
LLPointer<LLGLTexture> mCachedProcessedTexture;
|
||||
LLPointer<LLImageTGA> mStaticImageTGA;
|
||||
LLPointer<LLImageRaw> mStaticImageRaw;
|
||||
std::atomic<BOOL> mNeedsCreateTexture;
|
||||
BOOL mStaticImageInvalid;
|
||||
std::atomic<bool> mNeedsCreateTexture;
|
||||
bool mStaticImageInvalid;
|
||||
LL_ALIGN_16(LLVector4a mAvgDistortionVec);
|
||||
F32 mCachedEffectiveWeight;
|
||||
|
||||
|
|
@ -120,12 +120,12 @@ public:
|
|||
LLTexLayerParamAlphaInfo();
|
||||
/*virtual*/ ~LLTexLayerParamAlphaInfo() {};
|
||||
|
||||
/*virtual*/ BOOL parseXml(LLXmlTreeNode* node);
|
||||
/*virtual*/ bool parseXml(LLXmlTreeNode* node);
|
||||
|
||||
private:
|
||||
std::string mStaticImageFileName;
|
||||
BOOL mMultiplyBlend;
|
||||
BOOL mSkipIfZeroWeight;
|
||||
bool mMultiplyBlend;
|
||||
bool mSkipIfZeroWeight;
|
||||
F32 mDomain;
|
||||
};
|
||||
//
|
||||
|
|
@ -157,7 +157,7 @@ public:
|
|||
/*virtual*/ LLViewerVisualParam* cloneParam(LLWearable* wearable = NULL) const;
|
||||
|
||||
// LLVisualParam Virtual functions
|
||||
///*virtual*/ BOOL parseData(LLXmlTreeNode* node);
|
||||
///*virtual*/ bool parseData(LLXmlTreeNode* node);
|
||||
/*virtual*/ void apply( ESex avatar_sex ) {}
|
||||
/*virtual*/ void setWeight(F32 weight);
|
||||
/*virtual*/ void setAnimationTarget(F32 target_value);
|
||||
|
|
@ -189,7 +189,7 @@ class LLTexLayerParamColorInfo : public LLViewerVisualParamInfo
|
|||
public:
|
||||
LLTexLayerParamColorInfo();
|
||||
virtual ~LLTexLayerParamColorInfo() {};
|
||||
BOOL parseXml( LLXmlTreeNode* node );
|
||||
bool parseXml( LLXmlTreeNode* node );
|
||||
LLTexLayerParamColor::EColorOperation getOperation() const { return mOperation; }
|
||||
private:
|
||||
enum { MAX_COLOR_VALUES = 20 };
|
||||
|
|
|
|||
|
|
@ -39,12 +39,12 @@
|
|||
LLViewerVisualParamInfo::LLViewerVisualParamInfo()
|
||||
:
|
||||
mWearableType( LLWearableType::WT_INVALID ),
|
||||
mCrossWearable(FALSE),
|
||||
mCrossWearable(false),
|
||||
mCamDist( 0.5f ),
|
||||
mCamAngle( 0.f ),
|
||||
mCamElevation( 0.f ),
|
||||
mEditGroupDisplayOrder( 0 ),
|
||||
mShowSimple(FALSE),
|
||||
mShowSimple(false),
|
||||
mSimpleMin(0.f),
|
||||
mSimpleMax(100.f)
|
||||
{
|
||||
|
|
@ -57,12 +57,12 @@ LLViewerVisualParamInfo::~LLViewerVisualParamInfo()
|
|||
//-----------------------------------------------------------------------------
|
||||
// parseXml()
|
||||
//-----------------------------------------------------------------------------
|
||||
BOOL LLViewerVisualParamInfo::parseXml(LLXmlTreeNode *node)
|
||||
bool LLViewerVisualParamInfo::parseXml(LLXmlTreeNode *node)
|
||||
{
|
||||
llassert( node->hasName( "param" ) );
|
||||
|
||||
if (!LLVisualParamInfo::parseXml(node))
|
||||
return FALSE;
|
||||
return false;
|
||||
|
||||
// VIEWER SPECIFIC PARAMS
|
||||
|
||||
|
|
@ -82,7 +82,7 @@ BOOL LLViewerVisualParamInfo::parseXml(LLXmlTreeNode *node)
|
|||
static LLStdStringHandle cross_wearable_string = LLXmlTree::addAttributeString("cross_wearable");
|
||||
if (!node->getFastAttributeBOOL(cross_wearable_string, mCrossWearable))
|
||||
{
|
||||
mCrossWearable = FALSE;
|
||||
mCrossWearable = false;
|
||||
}
|
||||
|
||||
// Optional camera offsets from the current joint center. Used for generating "hints" (thumbnails).
|
||||
|
|
@ -107,7 +107,7 @@ BOOL LLViewerVisualParamInfo::parseXml(LLXmlTreeNode *node)
|
|||
|
||||
params_loaded++;
|
||||
|
||||
return TRUE;
|
||||
return true;
|
||||
}
|
||||
|
||||
/*virtual*/ void LLViewerVisualParamInfo::toStream(std::ostream &out)
|
||||
|
|
@ -146,15 +146,15 @@ LLViewerVisualParam::~LLViewerVisualParam()
|
|||
// setInfo()
|
||||
//-----------------------------------------------------------------------------
|
||||
|
||||
BOOL LLViewerVisualParam::setInfo(LLViewerVisualParamInfo *info)
|
||||
bool LLViewerVisualParam::setInfo(LLViewerVisualParamInfo *info)
|
||||
{
|
||||
llassert(mInfo == NULL);
|
||||
if (info->mID < 0)
|
||||
return FALSE;
|
||||
return false;
|
||||
mInfo = info;
|
||||
mID = info->mID;
|
||||
setWeight(getDefaultWeight());
|
||||
return TRUE;
|
||||
return true;
|
||||
}
|
||||
|
||||
/*
|
||||
|
|
@ -166,14 +166,14 @@ BOOL LLViewerVisualParam::setInfo(LLViewerVisualParamInfo *info)
|
|||
//-----------------------------------------------------------------------------
|
||||
// parseData()
|
||||
//-----------------------------------------------------------------------------
|
||||
BOOL LLViewerVisualParam::parseData(LLXmlTreeNode *node)
|
||||
bool LLViewerVisualParam::parseData(LLXmlTreeNode *node)
|
||||
{
|
||||
LLViewerVisualParamInfo* info = new LLViewerVisualParamInfo;
|
||||
|
||||
info->parseXml(node);
|
||||
if (!setInfo(info))
|
||||
return FALSE;
|
||||
return false;
|
||||
|
||||
return TRUE;
|
||||
return true;
|
||||
}
|
||||
*/
|
||||
|
|
|
|||
|
|
@ -43,19 +43,19 @@ public:
|
|||
LLViewerVisualParamInfo();
|
||||
/*virtual*/ ~LLViewerVisualParamInfo();
|
||||
|
||||
/*virtual*/ BOOL parseXml(LLXmlTreeNode* node);
|
||||
/*virtual*/ bool parseXml(LLXmlTreeNode* node);
|
||||
|
||||
/*virtual*/ void toStream(std::ostream &out);
|
||||
|
||||
protected:
|
||||
S32 mWearableType;
|
||||
BOOL mCrossWearable;
|
||||
bool mCrossWearable;
|
||||
std::string mEditGroup;
|
||||
F32 mCamDist;
|
||||
F32 mCamAngle; // degrees
|
||||
F32 mCamElevation;
|
||||
F32 mEditGroupDisplayOrder;
|
||||
BOOL mShowSimple; // show edit controls when in "simple ui" mode?
|
||||
bool mShowSimple; // show edit controls when in "simple ui" mode?
|
||||
F32 mSimpleMin; // when in simple UI, apply this minimum, range 0.f to 100.f
|
||||
F32 mSimpleMax; // when in simple UI, apply this maximum, range 0.f to 100.f
|
||||
};
|
||||
|
|
@ -75,12 +75,12 @@ public:
|
|||
// Special: These functions are overridden by child classes
|
||||
LLViewerVisualParamInfo *getInfo() const { return (LLViewerVisualParamInfo*)mInfo; };
|
||||
// This sets mInfo and calls initialization functions
|
||||
BOOL setInfo(LLViewerVisualParamInfo *info);
|
||||
bool setInfo(LLViewerVisualParamInfo *info);
|
||||
|
||||
virtual LLViewerVisualParam* cloneParam(LLWearable* wearable) const = 0;
|
||||
|
||||
// LLVisualParam Virtual functions
|
||||
///*virtual*/ BOOL parseData(LLXmlTreeNode* node);
|
||||
///*virtual*/ bool parseData(LLXmlTreeNode* node);
|
||||
|
||||
// New Virtual functions
|
||||
virtual F32 getTotalDistortion() = 0;
|
||||
|
|
@ -99,11 +99,11 @@ public:
|
|||
F32 getCameraAngle() const { return getInfo()->mCamAngle; } // degrees
|
||||
F32 getCameraElevation() const { return getInfo()->mCamElevation; }
|
||||
|
||||
BOOL getShowSimple() const { return getInfo()->mShowSimple; }
|
||||
bool getShowSimple() const { return getInfo()->mShowSimple; }
|
||||
F32 getSimpleMin() const { return getInfo()->mSimpleMin; }
|
||||
F32 getSimpleMax() const { return getInfo()->mSimpleMax; }
|
||||
|
||||
BOOL getCrossWearable() const { return getInfo()->mCrossWearable; }
|
||||
bool getCrossWearable() const { return getInfo()->mCrossWearable; }
|
||||
|
||||
protected:
|
||||
LLViewerVisualParam(const LLViewerVisualParam& pOther);
|
||||
|
|
|
|||
|
|
@ -86,16 +86,16 @@ LLAssetType::EType LLWearable::getAssetType() const
|
|||
return LLWearableType::getInstance()->getAssetType(mType);
|
||||
}
|
||||
|
||||
BOOL LLWearable::exportFile(const std::string& filename) const
|
||||
bool LLWearable::exportFile(const std::string& filename) const
|
||||
{
|
||||
llofstream ofs(filename.c_str(), std::ios_base::out | std::ios_base::trunc | std::ios_base::binary);
|
||||
return ofs.is_open() && exportStream(ofs);
|
||||
}
|
||||
|
||||
// virtual
|
||||
BOOL LLWearable::exportStream( std::ostream& output_stream ) const
|
||||
bool LLWearable::exportStream( std::ostream& output_stream ) const
|
||||
{
|
||||
if (!output_stream.good()) return FALSE;
|
||||
if (!output_stream.good()) return false;
|
||||
|
||||
// header and version
|
||||
output_stream << "LLWearable version " << mDefinitionVersion << "\n";
|
||||
|
|
@ -107,13 +107,13 @@ BOOL LLWearable::exportStream( std::ostream& output_stream ) const
|
|||
// permissions
|
||||
if( !mPermissions.exportLegacyStream( output_stream ) )
|
||||
{
|
||||
return FALSE;
|
||||
return false;
|
||||
}
|
||||
|
||||
// sale info
|
||||
if( !mSaleInfo.exportLegacyStream( output_stream ) )
|
||||
{
|
||||
return FALSE;
|
||||
return false;
|
||||
}
|
||||
|
||||
// wearable type
|
||||
|
|
@ -139,7 +139,7 @@ BOOL LLWearable::exportStream( std::ostream& output_stream ) const
|
|||
const LLUUID& image_id = te_pair.second->getID();
|
||||
output_stream << te << " " << image_id << "\n";
|
||||
}
|
||||
return TRUE;
|
||||
return true;
|
||||
}
|
||||
|
||||
void LLWearable::createVisualParams(LLAvatarAppearance *avatarp)
|
||||
|
|
@ -307,7 +307,7 @@ LLWearable::EImportResult LLWearable::importStream( std::istream& input_stream,
|
|||
// permissions. Thus, we read that out, and fix legacy
|
||||
// objects. It's possible this op would fail, but it should pick
|
||||
// up the vast majority of the tasks.
|
||||
BOOL has_perm_mask = FALSE;
|
||||
bool has_perm_mask = false;
|
||||
U32 perm_mask = 0;
|
||||
if( !mSaleInfo.importLegacyStream(input_stream, has_perm_mask, perm_mask) )
|
||||
{
|
||||
|
|
@ -469,11 +469,11 @@ LLWearable::EImportResult LLWearable::importStream( std::istream& input_stream,
|
|||
return LLWearable::SUCCESS;
|
||||
}
|
||||
|
||||
BOOL LLWearable::getNextPopulatedLine(std::istream& input_stream, char* buffer, U32 buffer_size)
|
||||
bool LLWearable::getNextPopulatedLine(std::istream& input_stream, char* buffer, U32 buffer_size)
|
||||
{
|
||||
if (!input_stream.good())
|
||||
{
|
||||
return FALSE;
|
||||
return false;
|
||||
}
|
||||
|
||||
do
|
||||
|
|
@ -636,7 +636,7 @@ void LLWearable::addVisualParam(LLVisualParam *param)
|
|||
{
|
||||
delete mVisualParamIndexMap[param->getID()];
|
||||
}
|
||||
param->setIsDummy(FALSE);
|
||||
param->setIsDummy(false);
|
||||
param->setParamLocation(LOC_WEARABLE);
|
||||
mVisualParamIndexMap[param->getID()] = param;
|
||||
mSavedVisualParamMap[param->getID()] = param->getDefaultWeight();
|
||||
|
|
@ -744,7 +744,7 @@ void LLWearable::writeToAvatar(LLAvatarAppearance* avatarp)
|
|||
std::string terse_F32_to_string(F32 f)
|
||||
{
|
||||
std::string r = llformat("%.2f", f);
|
||||
S32 len = r.length();
|
||||
auto len = r.length();
|
||||
|
||||
// "1.20" -> "1.2"
|
||||
// "24.00" -> "24."
|
||||
|
|
|
|||
|
|
@ -80,9 +80,9 @@ public:
|
|||
SUCCESS,
|
||||
BAD_HEADER
|
||||
};
|
||||
BOOL exportFile(const std::string& filename) const;
|
||||
bool exportFile(const std::string& filename) const;
|
||||
EImportResult importFile(const std::string& filename, LLAvatarAppearance* avatarp );
|
||||
virtual BOOL exportStream( std::ostream& output_stream ) const;
|
||||
virtual bool exportStream( std::ostream& output_stream ) const;
|
||||
virtual EImportResult importStream( std::istream& input_stream, LLAvatarAppearance* avatarp );
|
||||
|
||||
static void setCurrentDefinitionVersion( S32 version ) { LLWearable::sCurrentDefinitionVersion = version; }
|
||||
|
|
@ -118,7 +118,7 @@ protected:
|
|||
void destroyTextures();
|
||||
void createVisualParams(LLAvatarAppearance *avatarp);
|
||||
void createLayers(S32 te, LLAvatarAppearance *avatarp);
|
||||
BOOL getNextPopulatedLine(std::istream& input_stream, char* buffer, U32 buffer_size);
|
||||
bool getNextPopulatedLine(std::istream& input_stream, char* buffer, U32 buffer_size);
|
||||
|
||||
static S32 sCurrentDefinitionVersion; // Depends on the current state of the avatar_lad.xml.
|
||||
S32 mDefinitionVersion; // Depends on the state of the avatar_lad.xml when this asset was created.
|
||||
|
|
|
|||
|
|
@ -86,7 +86,7 @@ void LLWearableData::setWearable(const LLWearableType::EType type, U32 index, LL
|
|||
{
|
||||
wearable_vec[index] = wearable;
|
||||
old_wearable->setUpdated();
|
||||
const BOOL removed = FALSE;
|
||||
const bool removed = false;
|
||||
wearableUpdated(wearable, removed);
|
||||
}
|
||||
}
|
||||
|
|
@ -105,14 +105,14 @@ void LLWearableData::pushWearable(const LLWearableType::EType type,
|
|||
mWearableDatas[type].push_back(wearable);
|
||||
if (trigger_updated)
|
||||
{
|
||||
const BOOL removed = FALSE;
|
||||
const bool removed = false;
|
||||
wearableUpdated(wearable, removed);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// virtual
|
||||
void LLWearableData::wearableUpdated(LLWearable *wearable, BOOL removed)
|
||||
void LLWearableData::wearableUpdated(LLWearable *wearable, bool removed)
|
||||
{
|
||||
wearable->setUpdated();
|
||||
if (!removed)
|
||||
|
|
@ -144,7 +144,7 @@ void LLWearableData::eraseWearable(const LLWearableType::EType type, U32 index)
|
|||
if (wearable)
|
||||
{
|
||||
mWearableDatas[type].erase(mWearableDatas[type].begin() + index);
|
||||
const BOOL removed = TRUE;
|
||||
const bool removed = true;
|
||||
wearableUpdated(wearable, removed);
|
||||
}
|
||||
}
|
||||
|
|
@ -200,11 +200,11 @@ void LLWearableData::pullCrossWearableValues(const LLWearableType::EType type)
|
|||
}
|
||||
|
||||
|
||||
BOOL LLWearableData::getWearableIndex(const LLWearable *wearable, U32& index_found) const
|
||||
bool LLWearableData::getWearableIndex(const LLWearable *wearable, U32& index_found) const
|
||||
{
|
||||
if (wearable == NULL)
|
||||
{
|
||||
return FALSE;
|
||||
return false;
|
||||
}
|
||||
|
||||
const LLWearableType::EType type = wearable->getType();
|
||||
|
|
@ -212,7 +212,7 @@ BOOL LLWearableData::getWearableIndex(const LLWearable *wearable, U32& index_fou
|
|||
if (wearable_iter == mWearableDatas.end())
|
||||
{
|
||||
LL_WARNS() << "tried to get wearable index with an invalid type!" << LL_ENDL;
|
||||
return FALSE;
|
||||
return false;
|
||||
}
|
||||
const wearableentry_vec_t& wearable_vec = wearable_iter->second;
|
||||
for(U32 index = 0; index < wearable_vec.size(); index++)
|
||||
|
|
@ -220,11 +220,11 @@ BOOL LLWearableData::getWearableIndex(const LLWearable *wearable, U32& index_fou
|
|||
if (wearable_vec[index] == wearable)
|
||||
{
|
||||
index_found = index;
|
||||
return TRUE;
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
return FALSE;
|
||||
return false;
|
||||
}
|
||||
|
||||
U32 LLWearableData::getClothingLayerCount() const
|
||||
|
|
@ -242,7 +242,7 @@ U32 LLWearableData::getClothingLayerCount() const
|
|||
return count;
|
||||
}
|
||||
|
||||
BOOL LLWearableData::canAddWearable(const LLWearableType::EType type) const
|
||||
bool LLWearableData::canAddWearable(const LLWearableType::EType type) const
|
||||
{
|
||||
LLAssetType::EType a_type = LLWearableType::getInstance()->getAssetType(type);
|
||||
if (a_type==LLAssetType::AT_CLOTHING)
|
||||
|
|
@ -255,13 +255,13 @@ BOOL LLWearableData::canAddWearable(const LLWearableType::EType type) const
|
|||
}
|
||||
else
|
||||
{
|
||||
return FALSE;
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
BOOL LLWearableData::isOnTop(LLWearable* wearable) const
|
||||
bool LLWearableData::isOnTop(LLWearable* wearable) const
|
||||
{
|
||||
if (!wearable) return FALSE;
|
||||
if (!wearable) return false;
|
||||
const LLWearableType::EType type = wearable->getType();
|
||||
return ( getTopWearable(type) == wearable );
|
||||
}
|
||||
|
|
@ -334,7 +334,7 @@ U32 LLWearableData::getWearableCount(const LLWearableType::EType type) const
|
|||
return 0;
|
||||
}
|
||||
const wearableentry_vec_t& wearable_vec = wearable_iter->second;
|
||||
return wearable_vec.size();
|
||||
return static_cast<U32>(wearable_vec.size());
|
||||
}
|
||||
|
||||
U32 LLWearableData::getWearableCount(const U32 tex_index) const
|
||||
|
|
|
|||
|
|
@ -60,11 +60,11 @@ public:
|
|||
const LLWearable* getBottomWearable(const LLWearableType::EType type) const;
|
||||
U32 getWearableCount(const LLWearableType::EType type) const;
|
||||
U32 getWearableCount(const U32 tex_index) const;
|
||||
BOOL getWearableIndex(const LLWearable *wearable, U32& index) const;
|
||||
bool getWearableIndex(const LLWearable *wearable, U32& index) const;
|
||||
U32 getClothingLayerCount() const;
|
||||
BOOL canAddWearable(const LLWearableType::EType type) const;
|
||||
bool canAddWearable(const LLWearableType::EType type) const;
|
||||
|
||||
BOOL isOnTop(LLWearable* wearable) const;
|
||||
bool isOnTop(LLWearable* wearable) const;
|
||||
|
||||
static const U32 MAX_CLOTHING_LAYERS = 60;
|
||||
|
||||
|
|
@ -76,7 +76,7 @@ protected:
|
|||
void setWearable(const LLWearableType::EType type, U32 index, LLWearable *wearable);
|
||||
void pushWearable(const LLWearableType::EType type, LLWearable *wearable,
|
||||
bool trigger_updated = true);
|
||||
virtual void wearableUpdated(LLWearable *wearable, BOOL removed);
|
||||
virtual void wearableUpdated(LLWearable *wearable, bool removed);
|
||||
void eraseWearable(LLWearable *wearable);
|
||||
void eraseWearable(const LLWearableType::EType type, U32 index);
|
||||
void clearWearableType(const LLWearableType::EType type);
|
||||
|
|
|
|||
|
|
@ -32,27 +32,27 @@
|
|||
|
||||
LLWearableType::LLWearableDictionary::LLWearableDictionary(LLTranslationBridge::ptr_t& trans)
|
||||
{
|
||||
addEntry(LLWearableType::WT_SHAPE, new WearableEntry(trans, "shape", "New Shape", LLAssetType::AT_BODYPART, LLInventoryType::ICONNAME_BODYPART_SHAPE, FALSE, FALSE));
|
||||
addEntry(LLWearableType::WT_SKIN, new WearableEntry(trans, "skin", "New Skin", LLAssetType::AT_BODYPART, LLInventoryType::ICONNAME_BODYPART_SKIN, FALSE, FALSE));
|
||||
addEntry(LLWearableType::WT_HAIR, new WearableEntry(trans, "hair", "New Hair", LLAssetType::AT_BODYPART, LLInventoryType::ICONNAME_BODYPART_HAIR, FALSE, FALSE));
|
||||
addEntry(LLWearableType::WT_EYES, new WearableEntry(trans, "eyes", "New Eyes", LLAssetType::AT_BODYPART, LLInventoryType::ICONNAME_BODYPART_EYES, FALSE, FALSE));
|
||||
addEntry(LLWearableType::WT_SHIRT, new WearableEntry(trans, "shirt", "New Shirt", LLAssetType::AT_CLOTHING, LLInventoryType::ICONNAME_CLOTHING_SHIRT, FALSE, TRUE));
|
||||
addEntry(LLWearableType::WT_PANTS, new WearableEntry(trans, "pants", "New Pants", LLAssetType::AT_CLOTHING, LLInventoryType::ICONNAME_CLOTHING_PANTS, FALSE, TRUE));
|
||||
addEntry(LLWearableType::WT_SHOES, new WearableEntry(trans, "shoes", "New Shoes", LLAssetType::AT_CLOTHING, LLInventoryType::ICONNAME_CLOTHING_SHOES, FALSE, TRUE));
|
||||
addEntry(LLWearableType::WT_SOCKS, new WearableEntry(trans, "socks", "New Socks", LLAssetType::AT_CLOTHING, LLInventoryType::ICONNAME_CLOTHING_SOCKS, FALSE, TRUE));
|
||||
addEntry(LLWearableType::WT_JACKET, new WearableEntry(trans, "jacket", "New Jacket", LLAssetType::AT_CLOTHING, LLInventoryType::ICONNAME_CLOTHING_JACKET, FALSE, TRUE));
|
||||
addEntry(LLWearableType::WT_GLOVES, new WearableEntry(trans, "gloves", "New Gloves", LLAssetType::AT_CLOTHING, LLInventoryType::ICONNAME_CLOTHING_GLOVES, FALSE, TRUE));
|
||||
addEntry(LLWearableType::WT_UNDERSHIRT, new WearableEntry(trans, "undershirt", "New Undershirt", LLAssetType::AT_CLOTHING, LLInventoryType::ICONNAME_CLOTHING_UNDERSHIRT, FALSE, TRUE));
|
||||
addEntry(LLWearableType::WT_UNDERPANTS, new WearableEntry(trans, "underpants", "New Underpants", LLAssetType::AT_CLOTHING, LLInventoryType::ICONNAME_CLOTHING_UNDERPANTS, FALSE, TRUE));
|
||||
addEntry(LLWearableType::WT_SKIRT, new WearableEntry(trans, "skirt", "New Skirt", LLAssetType::AT_CLOTHING, LLInventoryType::ICONNAME_CLOTHING_SKIRT, FALSE, TRUE));
|
||||
addEntry(LLWearableType::WT_ALPHA, new WearableEntry(trans, "alpha", "New Alpha", LLAssetType::AT_CLOTHING, LLInventoryType::ICONNAME_CLOTHING_ALPHA, FALSE, TRUE));
|
||||
addEntry(LLWearableType::WT_TATTOO, new WearableEntry(trans, "tattoo", "New Tattoo", LLAssetType::AT_CLOTHING, LLInventoryType::ICONNAME_CLOTHING_TATTOO, FALSE, TRUE));
|
||||
addEntry(LLWearableType::WT_UNIVERSAL, new WearableEntry(trans, "universal", "New Universal", LLAssetType::AT_CLOTHING, LLInventoryType::ICONNAME_CLOTHING_UNIVERSAL, FALSE, TRUE));
|
||||
addEntry(LLWearableType::WT_SHAPE, new WearableEntry(trans, "shape", "New Shape", LLAssetType::AT_BODYPART, LLInventoryType::ICONNAME_BODYPART_SHAPE, false, false));
|
||||
addEntry(LLWearableType::WT_SKIN, new WearableEntry(trans, "skin", "New Skin", LLAssetType::AT_BODYPART, LLInventoryType::ICONNAME_BODYPART_SKIN, false, false));
|
||||
addEntry(LLWearableType::WT_HAIR, new WearableEntry(trans, "hair", "New Hair", LLAssetType::AT_BODYPART, LLInventoryType::ICONNAME_BODYPART_HAIR, false, false));
|
||||
addEntry(LLWearableType::WT_EYES, new WearableEntry(trans, "eyes", "New Eyes", LLAssetType::AT_BODYPART, LLInventoryType::ICONNAME_BODYPART_EYES, false, false));
|
||||
addEntry(LLWearableType::WT_SHIRT, new WearableEntry(trans, "shirt", "New Shirt", LLAssetType::AT_CLOTHING, LLInventoryType::ICONNAME_CLOTHING_SHIRT, false, true));
|
||||
addEntry(LLWearableType::WT_PANTS, new WearableEntry(trans, "pants", "New Pants", LLAssetType::AT_CLOTHING, LLInventoryType::ICONNAME_CLOTHING_PANTS, false, true));
|
||||
addEntry(LLWearableType::WT_SHOES, new WearableEntry(trans, "shoes", "New Shoes", LLAssetType::AT_CLOTHING, LLInventoryType::ICONNAME_CLOTHING_SHOES, false, true));
|
||||
addEntry(LLWearableType::WT_SOCKS, new WearableEntry(trans, "socks", "New Socks", LLAssetType::AT_CLOTHING, LLInventoryType::ICONNAME_CLOTHING_SOCKS, false, true));
|
||||
addEntry(LLWearableType::WT_JACKET, new WearableEntry(trans, "jacket", "New Jacket", LLAssetType::AT_CLOTHING, LLInventoryType::ICONNAME_CLOTHING_JACKET, false, true));
|
||||
addEntry(LLWearableType::WT_GLOVES, new WearableEntry(trans, "gloves", "New Gloves", LLAssetType::AT_CLOTHING, LLInventoryType::ICONNAME_CLOTHING_GLOVES, false, true));
|
||||
addEntry(LLWearableType::WT_UNDERSHIRT, new WearableEntry(trans, "undershirt", "New Undershirt", LLAssetType::AT_CLOTHING, LLInventoryType::ICONNAME_CLOTHING_UNDERSHIRT, false, true));
|
||||
addEntry(LLWearableType::WT_UNDERPANTS, new WearableEntry(trans, "underpants", "New Underpants", LLAssetType::AT_CLOTHING, LLInventoryType::ICONNAME_CLOTHING_UNDERPANTS, false, true));
|
||||
addEntry(LLWearableType::WT_SKIRT, new WearableEntry(trans, "skirt", "New Skirt", LLAssetType::AT_CLOTHING, LLInventoryType::ICONNAME_CLOTHING_SKIRT, false, true));
|
||||
addEntry(LLWearableType::WT_ALPHA, new WearableEntry(trans, "alpha", "New Alpha", LLAssetType::AT_CLOTHING, LLInventoryType::ICONNAME_CLOTHING_ALPHA, false, true));
|
||||
addEntry(LLWearableType::WT_TATTOO, new WearableEntry(trans, "tattoo", "New Tattoo", LLAssetType::AT_CLOTHING, LLInventoryType::ICONNAME_CLOTHING_TATTOO, false, true));
|
||||
addEntry(LLWearableType::WT_UNIVERSAL, new WearableEntry(trans, "universal", "New Universal", LLAssetType::AT_CLOTHING, LLInventoryType::ICONNAME_CLOTHING_UNIVERSAL, false, true));
|
||||
|
||||
addEntry(LLWearableType::WT_PHYSICS, new WearableEntry(trans, "physics", "New Physics", LLAssetType::AT_CLOTHING, LLInventoryType::ICONNAME_CLOTHING_PHYSICS, TRUE, TRUE));
|
||||
addEntry(LLWearableType::WT_PHYSICS, new WearableEntry(trans, "physics", "New Physics", LLAssetType::AT_CLOTHING, LLInventoryType::ICONNAME_CLOTHING_PHYSICS, true, true));
|
||||
|
||||
addEntry(LLWearableType::WT_INVALID, new WearableEntry(trans, "invalid", "Invalid Wearable", LLAssetType::AT_NONE, LLInventoryType::ICONNAME_UNKNOWN, FALSE, FALSE));
|
||||
addEntry(LLWearableType::WT_NONE, new WearableEntry(trans, "none", "Invalid Wearable", LLAssetType::AT_NONE, LLInventoryType::ICONNAME_NONE, FALSE, FALSE));
|
||||
addEntry(LLWearableType::WT_INVALID, new WearableEntry(trans, "invalid", "Invalid Wearable", LLAssetType::AT_NONE, LLInventoryType::ICONNAME_UNKNOWN, false, false));
|
||||
addEntry(LLWearableType::WT_NONE, new WearableEntry(trans, "none", "Invalid Wearable", LLAssetType::AT_NONE, LLInventoryType::ICONNAME_NONE, false, false));
|
||||
}
|
||||
|
||||
|
||||
|
|
@ -112,17 +112,17 @@ LLInventoryType::EIconName LLWearableType::getIconName(LLWearableType::EType typ
|
|||
return entry->mIconName;
|
||||
}
|
||||
|
||||
BOOL LLWearableType::getDisableCameraSwitch(LLWearableType::EType type)
|
||||
bool LLWearableType::getDisableCameraSwitch(LLWearableType::EType type)
|
||||
{
|
||||
const WearableEntry *entry = mDictionary.lookup(type);
|
||||
if (!entry) return FALSE;
|
||||
if (!entry) return false;
|
||||
return entry->mDisableCameraSwitch;
|
||||
}
|
||||
|
||||
BOOL LLWearableType::getAllowMultiwear(LLWearableType::EType type)
|
||||
bool LLWearableType::getAllowMultiwear(LLWearableType::EType type)
|
||||
{
|
||||
const WearableEntry *entry = mDictionary.lookup(type);
|
||||
if (!entry) return FALSE;
|
||||
if (!entry) return false;
|
||||
return entry->mAllowMultiwear;
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -72,8 +72,8 @@ public:
|
|||
LLAssetType::EType getAssetType(EType type);
|
||||
EType typeNameToType(const std::string& type_name);
|
||||
LLInventoryType::EIconName getIconName(EType type);
|
||||
BOOL getDisableCameraSwitch(EType type);
|
||||
BOOL getAllowMultiwear(EType type);
|
||||
bool getDisableCameraSwitch(EType type);
|
||||
bool getAllowMultiwear(EType type);
|
||||
|
||||
static EType inventoryFlagsToWearableType(U32 flags);
|
||||
|
||||
|
|
@ -85,8 +85,8 @@ private:
|
|||
const std::string& default_new_name,
|
||||
LLAssetType::EType assetType,
|
||||
LLInventoryType::EIconName iconName,
|
||||
BOOL disable_camera_switch = FALSE,
|
||||
BOOL allow_multiwear = TRUE) :
|
||||
bool disable_camera_switch = false,
|
||||
bool allow_multiwear = true) :
|
||||
LLDictionaryEntry(name),
|
||||
mAssetType(assetType),
|
||||
mDefaultNewName(default_new_name),
|
||||
|
|
@ -101,8 +101,8 @@ private:
|
|||
const std::string mLabel;
|
||||
const std::string mDefaultNewName;
|
||||
LLInventoryType::EIconName mIconName;
|
||||
BOOL mDisableCameraSwitch;
|
||||
BOOL mAllowMultiwear;
|
||||
bool mDisableCameraSwitch;
|
||||
bool mAllowMultiwear;
|
||||
};
|
||||
|
||||
class LLWearableDictionary : public LLDictionary<LLWearableType::EType, WearableEntry>
|
||||
|
|
|
|||
|
|
@ -4,7 +4,6 @@ project(llaudio)
|
|||
|
||||
include(00-Common)
|
||||
include(LLAudio)
|
||||
include(FMODSTUDIO)
|
||||
include(OPENAL)
|
||||
include(LLCommon)
|
||||
|
||||
|
|
@ -25,20 +24,6 @@ set(llaudio_HEADER_FILES
|
|||
llwindgen.h
|
||||
)
|
||||
|
||||
if (TARGET ll::fmodstudio)
|
||||
list(APPEND llaudio_SOURCE_FILES
|
||||
llaudioengine_fmodstudio.cpp
|
||||
lllistener_fmodstudio.cpp
|
||||
llstreamingaudio_fmodstudio.cpp
|
||||
)
|
||||
|
||||
list(APPEND llaudio_HEADER_FILES
|
||||
llaudioengine_fmodstudio.h
|
||||
lllistener_fmodstudio.h
|
||||
llstreamingaudio_fmodstudio.h
|
||||
)
|
||||
endif ()
|
||||
|
||||
if (TARGET ll::openal)
|
||||
list(APPEND llaudio_SOURCE_FILES
|
||||
llaudioengine_openal.cpp
|
||||
|
|
|
|||
|
|
@ -70,22 +70,22 @@ public:
|
|||
|
||||
LLVorbisDecodeState(const LLUUID &uuid, const std::string &out_filename);
|
||||
|
||||
BOOL initDecode();
|
||||
BOOL decodeSection(); // Return TRUE if done.
|
||||
BOOL finishDecode();
|
||||
bool initDecode();
|
||||
bool decodeSection(); // Return true if done.
|
||||
bool finishDecode();
|
||||
|
||||
void flushBadFile();
|
||||
|
||||
void ioComplete(S32 bytes) { mBytesRead = bytes; }
|
||||
BOOL isValid() const { return mValid; }
|
||||
BOOL isDone() const { return mDone; }
|
||||
bool isValid() const { return mValid; }
|
||||
bool isDone() const { return mDone; }
|
||||
const LLUUID &getUUID() const { return mUUID; }
|
||||
|
||||
protected:
|
||||
virtual ~LLVorbisDecodeState();
|
||||
|
||||
BOOL mValid;
|
||||
BOOL mDone;
|
||||
bool mValid;
|
||||
bool mDone;
|
||||
LLAtomicS32 mBytesRead;
|
||||
LLUUID mUUID;
|
||||
|
||||
|
|
@ -164,8 +164,8 @@ long cache_tell (void *datasource)
|
|||
|
||||
LLVorbisDecodeState::LLVorbisDecodeState(const LLUUID &uuid, const std::string &out_filename)
|
||||
{
|
||||
mDone = FALSE;
|
||||
mValid = FALSE;
|
||||
mDone = false;
|
||||
mValid = false;
|
||||
mBytesRead = -1;
|
||||
mUUID = uuid;
|
||||
mInFilep = NULL;
|
||||
|
|
@ -188,7 +188,7 @@ LLVorbisDecodeState::~LLVorbisDecodeState()
|
|||
}
|
||||
|
||||
|
||||
BOOL LLVorbisDecodeState::initDecode()
|
||||
bool LLVorbisDecodeState::initDecode()
|
||||
{
|
||||
ov_callbacks cache_callbacks;
|
||||
cache_callbacks.read_func = cache_read;
|
||||
|
|
@ -204,14 +204,14 @@ BOOL LLVorbisDecodeState::initDecode()
|
|||
LL_WARNS("AudioEngine") << "unable to open vorbis source vfile for reading" << LL_ENDL;
|
||||
delete mInFilep;
|
||||
mInFilep = NULL;
|
||||
return FALSE;
|
||||
return false;
|
||||
}
|
||||
|
||||
S32 r = ov_open_callbacks(mInFilep, &mVF, NULL, 0, cache_callbacks);
|
||||
if(r < 0)
|
||||
{
|
||||
LL_WARNS("AudioEngine") << r << " Input to vorbis decode does not appear to be an Ogg bitstream: " << mUUID << LL_ENDL;
|
||||
return(FALSE);
|
||||
return(false);
|
||||
}
|
||||
|
||||
S32 sample_count = (S32)ov_pcm_total(&mVF, -1);
|
||||
|
|
@ -260,7 +260,7 @@ BOOL LLVorbisDecodeState::initDecode()
|
|||
}
|
||||
delete mInFilep;
|
||||
mInFilep = NULL;
|
||||
return FALSE;
|
||||
return false;
|
||||
}
|
||||
|
||||
try
|
||||
|
|
@ -273,7 +273,7 @@ BOOL LLVorbisDecodeState::initDecode()
|
|||
LL_WARNS("AudioEngine") << "Out of memory when trying to alloc buffer: " << size_guess << LL_ENDL;
|
||||
delete mInFilep;
|
||||
mInFilep = NULL;
|
||||
return FALSE;
|
||||
return false;
|
||||
}
|
||||
|
||||
{
|
||||
|
|
@ -360,31 +360,31 @@ BOOL LLVorbisDecodeState::initDecode()
|
|||
// fprintf(stderr,"\nDecoded length: %ld samples\n", (long)ov_pcm_total(&vf,-1));
|
||||
// fprintf(stderr,"Encoded by: %s\n\n",ov_comment(&vf,-1)->vendor);
|
||||
//}
|
||||
return TRUE;
|
||||
return true;
|
||||
}
|
||||
|
||||
BOOL LLVorbisDecodeState::decodeSection()
|
||||
bool LLVorbisDecodeState::decodeSection()
|
||||
{
|
||||
if (!mInFilep)
|
||||
{
|
||||
LL_WARNS("AudioEngine") << "No cache file to decode in vorbis!" << LL_ENDL;
|
||||
return TRUE;
|
||||
return true;
|
||||
}
|
||||
if (mDone)
|
||||
{
|
||||
// LL_WARNS("AudioEngine") << "Already done with decode, aborting!" << LL_ENDL;
|
||||
return TRUE;
|
||||
return true;
|
||||
}
|
||||
char pcmout[4096]; /*Flawfinder: ignore*/
|
||||
|
||||
BOOL eof = FALSE;
|
||||
bool eof = false;
|
||||
long ret=ov_read(&mVF, pcmout, sizeof(pcmout), 0, 2, 1, &mCurrentSection);
|
||||
if (ret == 0)
|
||||
{
|
||||
/* EOF */
|
||||
eof = TRUE;
|
||||
mDone = TRUE;
|
||||
mValid = TRUE;
|
||||
eof = true;
|
||||
mDone = true;
|
||||
mValid = true;
|
||||
// LL_INFOS("AudioEngine") << "Vorbis EOF" << LL_ENDL;
|
||||
}
|
||||
else if (ret < 0)
|
||||
|
|
@ -394,10 +394,10 @@ BOOL LLVorbisDecodeState::decodeSection()
|
|||
|
||||
LL_WARNS("AudioEngine") << "BAD vorbis decode in decodeSection." << LL_ENDL;
|
||||
|
||||
mValid = FALSE;
|
||||
mDone = TRUE;
|
||||
// We're done, return TRUE.
|
||||
return TRUE;
|
||||
mValid = false;
|
||||
mDone = true;
|
||||
// We're done, return true.
|
||||
return true;
|
||||
}
|
||||
else
|
||||
{
|
||||
|
|
@ -409,12 +409,12 @@ BOOL LLVorbisDecodeState::decodeSection()
|
|||
return eof;
|
||||
}
|
||||
|
||||
BOOL LLVorbisDecodeState::finishDecode()
|
||||
bool LLVorbisDecodeState::finishDecode()
|
||||
{
|
||||
if (!isValid())
|
||||
{
|
||||
LL_WARNS("AudioEngine") << "Bogus vorbis decode state for " << getUUID() << ", aborting!" << LL_ENDL;
|
||||
return TRUE; // We've finished
|
||||
return true; // We've finished
|
||||
}
|
||||
|
||||
if (mFileHandle == LLLFSThread::nullHandle())
|
||||
|
|
@ -422,7 +422,7 @@ BOOL LLVorbisDecodeState::finishDecode()
|
|||
ov_clear(&mVF);
|
||||
|
||||
// write "data" chunk length, in little-endian format
|
||||
S32 data_length = mWAVBuffer.size() - WAV_HEADER_SIZE;
|
||||
S32 data_length = static_cast<S32>(mWAVBuffer.size()) - WAV_HEADER_SIZE;
|
||||
mWAVBuffer[40] = (data_length) & 0x000000FF;
|
||||
mWAVBuffer[41] = (data_length >> 8) & 0x000000FF;
|
||||
mWAVBuffer[42] = (data_length >> 16) & 0x000000FF;
|
||||
|
|
@ -463,7 +463,7 @@ BOOL LLVorbisDecodeState::finishDecode()
|
|||
{
|
||||
memcpy(&mWAVBuffer[WAV_HEADER_SIZE], pcmout, (2 * fade_length)); /*Flawfinder: ignore*/
|
||||
}
|
||||
S32 near_end = mWAVBuffer.size() - (2 * fade_length);
|
||||
S32 near_end = static_cast<S32>(mWAVBuffer.size()) - (2 * fade_length);
|
||||
if ((S32)mWAVBuffer.size() >= ( near_end + 2* fade_length))
|
||||
{
|
||||
memcpy(pcmout, &mWAVBuffer[near_end], (2 * fade_length)); /*Flawfinder: ignore*/
|
||||
|
|
@ -487,11 +487,11 @@ BOOL LLVorbisDecodeState::finishDecode()
|
|||
if (36 == data_length)
|
||||
{
|
||||
LL_WARNS("AudioEngine") << "BAD Vorbis decode in finishDecode!" << LL_ENDL;
|
||||
mValid = FALSE;
|
||||
return TRUE; // we've finished
|
||||
mValid = false;
|
||||
return true; // we've finished
|
||||
}
|
||||
mBytesRead = -1;
|
||||
mFileHandle = LLLFSThread::sLocal->write(mOutFilename, &mWAVBuffer[0], 0, mWAVBuffer.size(),
|
||||
mFileHandle = LLLFSThread::sLocal->write(mOutFilename, &mWAVBuffer[0], 0, static_cast<S32>(mWAVBuffer.size()),
|
||||
new WriteResponder(this));
|
||||
}
|
||||
|
||||
|
|
@ -502,21 +502,21 @@ BOOL LLVorbisDecodeState::finishDecode()
|
|||
if (mBytesRead == 0)
|
||||
{
|
||||
LL_WARNS("AudioEngine") << "Unable to write file in LLVorbisDecodeState::finishDecode" << LL_ENDL;
|
||||
mValid = FALSE;
|
||||
return TRUE; // we've finished
|
||||
mValid = false;
|
||||
return true; // we've finished
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
return FALSE; // not done
|
||||
return false; // not done
|
||||
}
|
||||
}
|
||||
|
||||
mDone = TRUE;
|
||||
mDone = true;
|
||||
|
||||
LL_DEBUGS("AudioEngine") << "Finished decode for " << getUUID() << LL_ENDL;
|
||||
|
||||
return TRUE;
|
||||
return true;
|
||||
}
|
||||
|
||||
void LLVorbisDecodeState::flushBadFile()
|
||||
|
|
@ -779,23 +779,26 @@ void LLAudioDecodeMgr::processQueue()
|
|||
mImpl->processQueue();
|
||||
}
|
||||
|
||||
BOOL LLAudioDecodeMgr::addDecodeRequest(const LLUUID &uuid)
|
||||
bool LLAudioDecodeMgr::addDecodeRequest(const LLUUID &uuid)
|
||||
{
|
||||
if (gAudiop && gAudiop->hasDecodedFile(uuid))
|
||||
{
|
||||
// Already have a decoded version, don't need to decode it.
|
||||
LL_DEBUGS("AudioEngine") << "addDecodeRequest for " << uuid << " has decoded file already" << LL_ENDL;
|
||||
return TRUE;
|
||||
return true;
|
||||
}
|
||||
|
||||
if (gAssetStorage->hasLocalAsset(uuid, LLAssetType::AT_SOUND))
|
||||
{
|
||||
// Just put it on the decode queue.
|
||||
// Just put it on the decode queue it if it's not already in the queue
|
||||
LL_DEBUGS("AudioEngine") << "addDecodeRequest for " << uuid << " has local asset file already" << LL_ENDL;
|
||||
mImpl->mDecodeQueue.push_back(uuid);
|
||||
return TRUE;
|
||||
if (std::find(mImpl->mDecodeQueue.begin(), mImpl->mDecodeQueue.end(), uuid) == mImpl->mDecodeQueue.end())
|
||||
{
|
||||
mImpl->mDecodeQueue.emplace_back(uuid);
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
LL_DEBUGS("AudioEngine") << "addDecodeRequest for " << uuid << " no file available" << LL_ENDL;
|
||||
return FALSE;
|
||||
return false;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -43,7 +43,7 @@ class LLAudioDecodeMgr : public LLSingleton<LLAudioDecodeMgr>
|
|||
~LLAudioDecodeMgr();
|
||||
public:
|
||||
void processQueue();
|
||||
BOOL addDecodeRequest(const LLUUID &uuid);
|
||||
bool addDecodeRequest(const LLUUID &uuid);
|
||||
void addAudioRequest(const LLUUID &uuid);
|
||||
|
||||
protected:
|
||||
|
|
|
|||
|
|
@ -1827,7 +1827,17 @@ bool LLAudioData::load()
|
|||
{
|
||||
// Hrm. Right now, let's unset the buffer, since it's empty.
|
||||
gAudiop->cleanupBuffer(mBufferp);
|
||||
mBufferp = NULL;
|
||||
mBufferp = nullptr;
|
||||
|
||||
if (!gDirUtilp->fileExists(wav_path))
|
||||
{
|
||||
mHasLocalData = false;
|
||||
mHasDecodedData = false;
|
||||
mHasCompletedDecode = false;
|
||||
mHasDecodeFailed = false;
|
||||
mHasWAVLoadFailed = false;
|
||||
gAudiop->preloadSound(mID);
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -265,7 +265,7 @@ public:
|
|||
|
||||
void preload(const LLUUID &audio_id); // Only used for preloading UI sounds, now.
|
||||
|
||||
void addAudioData(LLAudioData *adp, bool set_current = TRUE);
|
||||
void addAudioData(LLAudioData *adp, bool set_current = true);
|
||||
|
||||
void setForcedPriority(const bool ambient) { mForcedPriority = ambient; }
|
||||
bool isForcedPriority() const { return mForcedPriority; }
|
||||
|
|
|
|||
|
|
@ -1,756 +0,0 @@
|
|||
/**
|
||||
* @file audioengine_fmodstudio.cpp
|
||||
* @brief Implementation of LLAudioEngine class abstracting the audio
|
||||
* support as a FMODSTUDIO implementation
|
||||
*
|
||||
* $LicenseInfo:firstyear=2020&license=viewerlgpl$
|
||||
* Second Life Viewer Source Code
|
||||
* Copyright (C) 2020, 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 "llstreamingaudio.h"
|
||||
#include "llstreamingaudio_fmodstudio.h"
|
||||
|
||||
#include "llaudioengine_fmodstudio.h"
|
||||
#include "lllistener_fmodstudio.h"
|
||||
|
||||
#include "llerror.h"
|
||||
#include "llmath.h"
|
||||
#include "llrand.h"
|
||||
|
||||
#include "fmodstudio/fmod.hpp"
|
||||
#include "fmodstudio/fmod_errors.h"
|
||||
#include "lldir.h"
|
||||
#include "llapr.h"
|
||||
|
||||
#include "sound_ids.h"
|
||||
|
||||
FMOD_RESULT F_CALLBACK windCallback(FMOD_DSP_STATE *dsp_state, float *inbuffer, float *outbuffer, unsigned int length, int inchannels, int *outchannels);
|
||||
|
||||
FMOD::ChannelGroup *LLAudioEngine_FMODSTUDIO::mChannelGroups[LLAudioEngine::AUDIO_TYPE_COUNT] = {0};
|
||||
|
||||
LLAudioEngine_FMODSTUDIO::LLAudioEngine_FMODSTUDIO(bool enable_profiler)
|
||||
: mInited(false),
|
||||
mWindGen(NULL),
|
||||
mWindDSP(NULL),
|
||||
mSystem(NULL),
|
||||
mEnableProfiler(enable_profiler),
|
||||
mWindDSPDesc(NULL)
|
||||
{
|
||||
}
|
||||
|
||||
|
||||
LLAudioEngine_FMODSTUDIO::~LLAudioEngine_FMODSTUDIO()
|
||||
{
|
||||
// mWindDSPDesc, mWindGen and mWindDSP get cleaned up on cleanupWind in LLAudioEngine::shutdown()
|
||||
// mSystem gets cleaned up at shutdown()
|
||||
}
|
||||
|
||||
|
||||
static inline bool Check_FMOD_Error(FMOD_RESULT result, const char *string)
|
||||
{
|
||||
if (result == FMOD_OK)
|
||||
return false;
|
||||
LL_DEBUGS("FMOD") << string << " Error: " << FMOD_ErrorString(result) << LL_ENDL;
|
||||
return true;
|
||||
}
|
||||
|
||||
bool LLAudioEngine_FMODSTUDIO::init(void* userdata, const std::string &app_title)
|
||||
{
|
||||
U32 version;
|
||||
FMOD_RESULT result;
|
||||
|
||||
LL_DEBUGS("AppInit") << "LLAudioEngine_FMODSTUDIO::init() initializing FMOD" << LL_ENDL;
|
||||
|
||||
result = FMOD::System_Create(&mSystem);
|
||||
if (Check_FMOD_Error(result, "FMOD::System_Create"))
|
||||
return false;
|
||||
|
||||
//will call LLAudioEngine_FMODSTUDIO::allocateListener, which needs a valid mSystem pointer.
|
||||
LLAudioEngine::init(userdata, app_title);
|
||||
|
||||
result = mSystem->getVersion(&version);
|
||||
Check_FMOD_Error(result, "FMOD::System::getVersion");
|
||||
|
||||
if (version < FMOD_VERSION)
|
||||
{
|
||||
LL_WARNS("AppInit") << "FMOD Studio version mismatch, actual: " << version
|
||||
<< " expected:" << FMOD_VERSION << LL_ENDL;
|
||||
}
|
||||
|
||||
// In this case, all sounds, PLUS wind and stream will be software.
|
||||
result = mSystem->setSoftwareChannels(LL_MAX_AUDIO_CHANNELS + 2);
|
||||
Check_FMOD_Error(result, "FMOD::System::setSoftwareChannels");
|
||||
|
||||
FMOD_ADVANCEDSETTINGS settings;
|
||||
memset(&settings, 0, sizeof(settings));
|
||||
settings.cbSize = sizeof(FMOD_ADVANCEDSETTINGS);
|
||||
settings.resamplerMethod = FMOD_DSP_RESAMPLER_LINEAR;
|
||||
|
||||
result = mSystem->setAdvancedSettings(&settings);
|
||||
Check_FMOD_Error(result, "FMOD::System::setAdvancedSettings");
|
||||
|
||||
// FMOD_INIT_THREAD_UNSAFE Disables thread safety for API calls.
|
||||
// Only use this if FMOD is being called from a single thread, and if Studio API is not being used.
|
||||
U32 fmod_flags = FMOD_INIT_NORMAL | FMOD_INIT_3D_RIGHTHANDED | FMOD_INIT_THREAD_UNSAFE;
|
||||
if (mEnableProfiler)
|
||||
{
|
||||
fmod_flags |= FMOD_INIT_PROFILE_ENABLE;
|
||||
}
|
||||
|
||||
#if LL_LINUX
|
||||
bool audio_ok = false;
|
||||
|
||||
if (!audio_ok)
|
||||
{
|
||||
const char* env_string = getenv("LL_BAD_FMOD_PULSEAUDIO");
|
||||
if (NULL == env_string)
|
||||
{
|
||||
LL_DEBUGS("AppInit") << "Trying PulseAudio audio output..." << LL_ENDL;
|
||||
if (mSystem->setOutput(FMOD_OUTPUTTYPE_PULSEAUDIO) == FMOD_OK &&
|
||||
(result = mSystem->init(LL_MAX_AUDIO_CHANNELS + 2, fmod_flags, const_cast<char*>(app_title.c_str()))) == FMOD_OK)
|
||||
{
|
||||
LL_DEBUGS("AppInit") << "PulseAudio output initialized OKAY" << LL_ENDL;
|
||||
audio_ok = true;
|
||||
}
|
||||
else
|
||||
{
|
||||
Check_FMOD_Error(result, "PulseAudio audio output FAILED to initialize");
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
LL_DEBUGS("AppInit") << "PulseAudio audio output SKIPPED" << LL_ENDL;
|
||||
}
|
||||
}
|
||||
if (!audio_ok)
|
||||
{
|
||||
const char* env_string = getenv("LL_BAD_FMOD_ALSA");
|
||||
if (NULL == env_string)
|
||||
{
|
||||
LL_DEBUGS("AppInit") << "Trying ALSA audio output..." << LL_ENDL;
|
||||
if (mSystem->setOutput(FMOD_OUTPUTTYPE_ALSA) == FMOD_OK &&
|
||||
(result = mSystem->init(LL_MAX_AUDIO_CHANNELS + 2, fmod_flags, 0)) == FMOD_OK)
|
||||
{
|
||||
LL_DEBUGS("AppInit") << "ALSA audio output initialized OKAY" << LL_ENDL;
|
||||
audio_ok = true;
|
||||
}
|
||||
else
|
||||
{
|
||||
Check_FMOD_Error(result, "ALSA audio output FAILED to initialize");
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
LL_DEBUGS("AppInit") << "ALSA audio output SKIPPED" << LL_ENDL;
|
||||
}
|
||||
}
|
||||
if (!audio_ok)
|
||||
{
|
||||
LL_WARNS("AppInit") << "Overall audio init failure." << LL_ENDL;
|
||||
return false;
|
||||
}
|
||||
|
||||
// We're interested in logging which output method we
|
||||
// ended up with, for QA purposes.
|
||||
FMOD_OUTPUTTYPE output_type;
|
||||
mSystem->getOutput(&output_type);
|
||||
switch (output_type)
|
||||
{
|
||||
case FMOD_OUTPUTTYPE_NOSOUND:
|
||||
LL_INFOS("AppInit") << "Audio output: NoSound" << LL_ENDL; break;
|
||||
case FMOD_OUTPUTTYPE_PULSEAUDIO:
|
||||
LL_INFOS("AppInit") << "Audio output: PulseAudio" << LL_ENDL; break;
|
||||
case FMOD_OUTPUTTYPE_ALSA:
|
||||
LL_INFOS("AppInit") << "Audio output: ALSA" << LL_ENDL; break;
|
||||
default:
|
||||
LL_INFOS("AppInit") << "Audio output: Unknown!" << LL_ENDL; break;
|
||||
};
|
||||
#else // LL_LINUX
|
||||
|
||||
// initialize the FMOD engine
|
||||
// number of channel in this case looks to be identiacal to number of max simultaneously
|
||||
// playing objects and we can set practically any number
|
||||
result = mSystem->init(LL_MAX_AUDIO_CHANNELS + 2, fmod_flags, 0);
|
||||
if (Check_FMOD_Error(result, "Error initializing FMOD Studio with default settins, retrying with other format"))
|
||||
{
|
||||
result = mSystem->setSoftwareFormat(44100, FMOD_SPEAKERMODE_STEREO, 0/*- ignore*/);
|
||||
if (Check_FMOD_Error(result, "Error setting sotware format. Can't init."))
|
||||
{
|
||||
return false;
|
||||
}
|
||||
result = mSystem->init(LL_MAX_AUDIO_CHANNELS + 2, fmod_flags, 0);
|
||||
}
|
||||
if (Check_FMOD_Error(result, "Error initializing FMOD Studio"))
|
||||
{
|
||||
// If it fails here and (result == FMOD_ERR_OUTPUT_CREATEBUFFER),
|
||||
// we can retry with other settings
|
||||
return false;
|
||||
}
|
||||
#endif
|
||||
|
||||
LL_INFOS("AppInit") << "LLAudioEngine_FMODSTUDIO::init() FMOD Studio initialized correctly" << LL_ENDL;
|
||||
|
||||
int r_numbuffers, r_samplerate, r_channels;
|
||||
unsigned int r_bufferlength;
|
||||
char r_name[512];
|
||||
int latency = 100;
|
||||
mSystem->getDSPBufferSize(&r_bufferlength, &r_numbuffers);
|
||||
LL_INFOS("AppInit") << "LLAudioEngine_FMODSTUDIO::init(): r_bufferlength=" << r_bufferlength << " bytes" << LL_ENDL;
|
||||
LL_INFOS("AppInit") << "LLAudioEngine_FMODSTUDIO::init(): r_numbuffers=" << r_numbuffers << LL_ENDL;
|
||||
|
||||
mSystem->getDriverInfo(0, r_name, 511, NULL, &r_samplerate, NULL, &r_channels);
|
||||
r_name[511] = '\0';
|
||||
LL_INFOS("AppInit") << "LLAudioEngine_FMODSTUDIO::init(): r_name=\"" << r_name << "\"" << LL_ENDL;
|
||||
|
||||
if (r_samplerate != 0)
|
||||
latency = (int)(1000.0f * r_bufferlength * r_numbuffers / r_samplerate);
|
||||
LL_INFOS("AppInit") << "LLAudioEngine_FMODSTUDIO::init(): latency=" << latency << "ms" << LL_ENDL;
|
||||
|
||||
mInited = true;
|
||||
|
||||
LL_INFOS("AppInit") << "LLAudioEngine_FMODSTUDIO::init(): initialization complete." << LL_ENDL;
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
std::string LLAudioEngine_FMODSTUDIO::getDriverName(bool verbose)
|
||||
{
|
||||
llassert_always(mSystem);
|
||||
if (verbose)
|
||||
{
|
||||
U32 version;
|
||||
if (!Check_FMOD_Error(mSystem->getVersion(&version), "FMOD::System::getVersion"))
|
||||
{
|
||||
return llformat("FMOD Studio %1x.%02x.%02x", version >> 16, version >> 8 & 0x000000FF, version & 0x000000FF);
|
||||
}
|
||||
}
|
||||
return "FMOD STUDIO";
|
||||
}
|
||||
|
||||
|
||||
// create our favourite FMOD-native streaming audio implementation
|
||||
LLStreamingAudioInterface *LLAudioEngine_FMODSTUDIO::createDefaultStreamingAudioImpl() const
|
||||
{
|
||||
return new LLStreamingAudio_FMODSTUDIO(mSystem);
|
||||
}
|
||||
|
||||
|
||||
void LLAudioEngine_FMODSTUDIO::allocateListener(void)
|
||||
{
|
||||
mListenerp = (LLListener *) new LLListener_FMODSTUDIO(mSystem);
|
||||
if (!mListenerp)
|
||||
{
|
||||
LL_WARNS("FMOD") << "Listener creation failed" << LL_ENDL;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
void LLAudioEngine_FMODSTUDIO::shutdown()
|
||||
{
|
||||
stopInternetStream();
|
||||
|
||||
LL_INFOS("FMOD") << "About to LLAudioEngine::shutdown()" << LL_ENDL;
|
||||
LLAudioEngine::shutdown();
|
||||
|
||||
LL_INFOS("FMOD") << "LLAudioEngine_FMODSTUDIO::shutdown() closing FMOD Studio" << LL_ENDL;
|
||||
if (mSystem)
|
||||
{
|
||||
mSystem->close();
|
||||
mSystem->release();
|
||||
}
|
||||
LL_INFOS("FMOD") << "LLAudioEngine_FMODSTUDIO::shutdown() done closing FMOD Studio" << LL_ENDL;
|
||||
|
||||
delete mListenerp;
|
||||
mListenerp = NULL;
|
||||
}
|
||||
|
||||
|
||||
LLAudioBuffer * LLAudioEngine_FMODSTUDIO::createBuffer()
|
||||
{
|
||||
return new LLAudioBufferFMODSTUDIO(mSystem);
|
||||
}
|
||||
|
||||
|
||||
LLAudioChannel * LLAudioEngine_FMODSTUDIO::createChannel()
|
||||
{
|
||||
return new LLAudioChannelFMODSTUDIO(mSystem);
|
||||
}
|
||||
|
||||
bool LLAudioEngine_FMODSTUDIO::initWind()
|
||||
{
|
||||
mNextWindUpdate = 0.0;
|
||||
|
||||
if (!mWindDSPDesc)
|
||||
{
|
||||
mWindDSPDesc = new FMOD_DSP_DESCRIPTION();
|
||||
}
|
||||
|
||||
if (!mWindDSP)
|
||||
{
|
||||
memset(mWindDSPDesc, 0, sizeof(*mWindDSPDesc)); //Set everything to zero
|
||||
strncpy(mWindDSPDesc->name, "Wind Unit", sizeof(mWindDSPDesc->name));
|
||||
mWindDSPDesc->pluginsdkversion = FMOD_PLUGIN_SDK_VERSION;
|
||||
mWindDSPDesc->read = &windCallback; // Assign callback - may be called from arbitrary threads
|
||||
if (Check_FMOD_Error(mSystem->createDSP(mWindDSPDesc, &mWindDSP), "FMOD::createDSP"))
|
||||
return false;
|
||||
|
||||
if (mWindGen)
|
||||
delete mWindGen;
|
||||
|
||||
int frequency = 44100;
|
||||
|
||||
FMOD_SPEAKERMODE mode;
|
||||
if (Check_FMOD_Error(mSystem->getSoftwareFormat(&frequency, &mode, nullptr), "FMOD::System::getSoftwareFormat"))
|
||||
{
|
||||
cleanupWind();
|
||||
return false;
|
||||
}
|
||||
|
||||
mWindGen = new LLWindGen<MIXBUFFERFORMAT>((U32)frequency);
|
||||
|
||||
if (Check_FMOD_Error(mWindDSP->setUserData((void*)mWindGen), "FMOD::DSP::setUserData"))
|
||||
{
|
||||
cleanupWind();
|
||||
return false;
|
||||
}
|
||||
if (Check_FMOD_Error(mWindDSP->setChannelFormat(FMOD_CHANNELMASK_STEREO, 2, mode), "FMOD::DSP::setChannelFormat"))
|
||||
{
|
||||
cleanupWind();
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
// *TODO: Should this guard against multiple plays?
|
||||
if (Check_FMOD_Error(mSystem->playDSP(mWindDSP, nullptr, false, nullptr), "FMOD::System::playDSP"))
|
||||
{
|
||||
cleanupWind();
|
||||
return false;
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
void LLAudioEngine_FMODSTUDIO::cleanupWind()
|
||||
{
|
||||
if (mWindDSP)
|
||||
{
|
||||
FMOD::ChannelGroup* master_group = NULL;
|
||||
if (!Check_FMOD_Error(mSystem->getMasterChannelGroup(&master_group), "FMOD::System::getMasterChannelGroup")
|
||||
&& master_group)
|
||||
{
|
||||
master_group->removeDSP(mWindDSP);
|
||||
}
|
||||
mWindDSP->release();
|
||||
mWindDSP = NULL;
|
||||
}
|
||||
|
||||
delete mWindDSPDesc;
|
||||
mWindDSPDesc = NULL;
|
||||
|
||||
delete mWindGen;
|
||||
mWindGen = NULL;
|
||||
}
|
||||
|
||||
|
||||
//-----------------------------------------------------------------------
|
||||
void LLAudioEngine_FMODSTUDIO::updateWind(LLVector3 wind_vec, F32 camera_height_above_water)
|
||||
{
|
||||
LLVector3 wind_pos;
|
||||
F64 pitch;
|
||||
F64 center_freq;
|
||||
|
||||
if (!mEnableWind)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
if (mWindUpdateTimer.checkExpirationAndReset(LL_WIND_UPDATE_INTERVAL))
|
||||
{
|
||||
|
||||
// wind comes in as Linden coordinate (+X = forward, +Y = left, +Z = up)
|
||||
// need to convert this to the conventional orientation DS3D and OpenAL use
|
||||
// where +X = right, +Y = up, +Z = backwards
|
||||
|
||||
wind_vec.setVec(-wind_vec.mV[1], wind_vec.mV[2], -wind_vec.mV[0]);
|
||||
|
||||
// cerr << "Wind update" << endl;
|
||||
|
||||
pitch = 1.0 + mapWindVecToPitch(wind_vec);
|
||||
center_freq = 80.0 * pow(pitch, 2.5*(mapWindVecToGain(wind_vec) + 1.0));
|
||||
|
||||
mWindGen->mTargetFreq = (F32)center_freq;
|
||||
mWindGen->mTargetGain = (F32)mapWindVecToGain(wind_vec) * mMaxWindGain;
|
||||
mWindGen->mTargetPanGainR = (F32)mapWindVecToPan(wind_vec);
|
||||
}
|
||||
}
|
||||
|
||||
//-----------------------------------------------------------------------
|
||||
void LLAudioEngine_FMODSTUDIO::setInternalGain(F32 gain)
|
||||
{
|
||||
if (!mInited)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
gain = llclamp(gain, 0.0f, 1.0f);
|
||||
|
||||
FMOD::ChannelGroup* master_group = NULL;
|
||||
if (!Check_FMOD_Error(mSystem->getMasterChannelGroup(&master_group), "FMOD::System::getMasterChannelGroup")
|
||||
&& master_group)
|
||||
{
|
||||
master_group->setVolume(gain);
|
||||
}
|
||||
|
||||
LLStreamingAudioInterface *saimpl = getStreamingAudioImpl();
|
||||
if (saimpl)
|
||||
{
|
||||
// fmod likes its streaming audio channel gain re-asserted after
|
||||
// master volume change.
|
||||
saimpl->setGain(saimpl->getGain());
|
||||
}
|
||||
}
|
||||
|
||||
//
|
||||
// LLAudioChannelFMODSTUDIO implementation
|
||||
//
|
||||
|
||||
LLAudioChannelFMODSTUDIO::LLAudioChannelFMODSTUDIO(FMOD::System *system) : LLAudioChannel(), mSystemp(system), mChannelp(NULL), mLastSamplePos(0)
|
||||
{
|
||||
}
|
||||
|
||||
|
||||
LLAudioChannelFMODSTUDIO::~LLAudioChannelFMODSTUDIO()
|
||||
{
|
||||
cleanup();
|
||||
}
|
||||
|
||||
bool LLAudioChannelFMODSTUDIO::updateBuffer()
|
||||
{
|
||||
if (!mCurrentSourcep)
|
||||
{
|
||||
// This channel isn't associated with any source, nothing
|
||||
// to be updated
|
||||
return false;
|
||||
}
|
||||
|
||||
if (LLAudioChannel::updateBuffer())
|
||||
{
|
||||
// Base class update returned true, which means that we need to actually
|
||||
// set up the channel for a different buffer.
|
||||
|
||||
LLAudioBufferFMODSTUDIO *bufferp = (LLAudioBufferFMODSTUDIO *)mCurrentSourcep->getCurrentBuffer();
|
||||
|
||||
// Grab the FMOD sample associated with the buffer
|
||||
FMOD::Sound *soundp = bufferp->getSound();
|
||||
if (!soundp)
|
||||
{
|
||||
// This is bad, there should ALWAYS be a sound associated with a legit
|
||||
// buffer.
|
||||
LL_ERRS() << "No FMOD sound!" << LL_ENDL;
|
||||
return false;
|
||||
}
|
||||
|
||||
|
||||
// Actually play the sound. Start it off paused so we can do all the necessary
|
||||
// setup.
|
||||
if (!mChannelp)
|
||||
{
|
||||
FMOD_RESULT result = getSystem()->playSound(soundp, NULL /*free channel?*/, true, &mChannelp);
|
||||
Check_FMOD_Error(result, "FMOD::System::playSound");
|
||||
}
|
||||
|
||||
// Setting up channel mChannelID
|
||||
}
|
||||
|
||||
// If we have a source for the channel, we need to update its gain.
|
||||
if (mCurrentSourcep)
|
||||
{
|
||||
// SJB: warnings can spam and hurt framerate, disabling
|
||||
//FMOD_RESULT result;
|
||||
|
||||
mChannelp->setVolume(getSecondaryGain() * mCurrentSourcep->getGain());
|
||||
//Check_FMOD_Error(result, "FMOD::Channel::setVolume");
|
||||
|
||||
mChannelp->setMode(mCurrentSourcep->isLoop() ? FMOD_LOOP_NORMAL : FMOD_LOOP_OFF);
|
||||
/*if(Check_FMOD_Error(result, "FMOD::Channel::setMode"))
|
||||
{
|
||||
S32 index;
|
||||
mChannelp->getIndex(&index);
|
||||
LL_WARNS() << "Channel " << index << "Source ID: " << mCurrentSourcep->getID()
|
||||
<< " at " << mCurrentSourcep->getPositionGlobal() << LL_ENDL;
|
||||
}*/
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
void LLAudioChannelFMODSTUDIO::update3DPosition()
|
||||
{
|
||||
if (!mChannelp)
|
||||
{
|
||||
// We're not actually a live channel (i.e., we're not playing back anything)
|
||||
return;
|
||||
}
|
||||
|
||||
LLAudioBufferFMODSTUDIO *bufferp = (LLAudioBufferFMODSTUDIO *)mCurrentBufferp;
|
||||
if (!bufferp)
|
||||
{
|
||||
// We don't have a buffer associated with us (should really have been picked up
|
||||
// by the above if.
|
||||
return;
|
||||
}
|
||||
|
||||
if (mCurrentSourcep->isForcedPriority())
|
||||
{
|
||||
// Prioritized UI and preview sounds don't need to do any positional updates.
|
||||
set3DMode(false);
|
||||
}
|
||||
else
|
||||
{
|
||||
// Localized sound. Update the position and velocity of the sound.
|
||||
set3DMode(true);
|
||||
|
||||
LLVector3 float_pos;
|
||||
float_pos.setVec(mCurrentSourcep->getPositionGlobal());
|
||||
FMOD_RESULT result = mChannelp->set3DAttributes((FMOD_VECTOR*)float_pos.mV, (FMOD_VECTOR*)mCurrentSourcep->getVelocity().mV);
|
||||
Check_FMOD_Error(result, "FMOD::Channel::set3DAttributes");
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
void LLAudioChannelFMODSTUDIO::updateLoop()
|
||||
{
|
||||
if (!mChannelp)
|
||||
{
|
||||
// May want to clear up the loop/sample counters.
|
||||
return;
|
||||
}
|
||||
|
||||
//
|
||||
// Hack: We keep track of whether we looped or not by seeing when the
|
||||
// sample position looks like it's going backwards. Not reliable; may
|
||||
// yield false negatives.
|
||||
//
|
||||
U32 cur_pos;
|
||||
mChannelp->getPosition(&cur_pos, FMOD_TIMEUNIT_PCMBYTES);
|
||||
|
||||
if (cur_pos < (U32)mLastSamplePos)
|
||||
{
|
||||
mLoopedThisFrame = true;
|
||||
}
|
||||
mLastSamplePos = cur_pos;
|
||||
}
|
||||
|
||||
|
||||
void LLAudioChannelFMODSTUDIO::cleanup()
|
||||
{
|
||||
if (!mChannelp)
|
||||
{
|
||||
// Aborting cleanup with no channel handle.
|
||||
return;
|
||||
}
|
||||
|
||||
//Cleaning up channel mChannelID
|
||||
Check_FMOD_Error(mChannelp->stop(), "FMOD::Channel::stop");
|
||||
|
||||
mCurrentBufferp = NULL;
|
||||
mChannelp = NULL;
|
||||
}
|
||||
|
||||
|
||||
void LLAudioChannelFMODSTUDIO::play()
|
||||
{
|
||||
if (!mChannelp)
|
||||
{
|
||||
LL_WARNS() << "Playing without a channel handle, aborting" << LL_ENDL;
|
||||
return;
|
||||
}
|
||||
|
||||
Check_FMOD_Error(mChannelp->setPaused(false), "FMOD::Channel::pause");
|
||||
|
||||
getSource()->setPlayedOnce(true);
|
||||
|
||||
if (LLAudioEngine_FMODSTUDIO::mChannelGroups[getSource()->getType()])
|
||||
mChannelp->setChannelGroup(LLAudioEngine_FMODSTUDIO::mChannelGroups[getSource()->getType()]);
|
||||
}
|
||||
|
||||
|
||||
void LLAudioChannelFMODSTUDIO::playSynced(LLAudioChannel *channelp)
|
||||
{
|
||||
LLAudioChannelFMODSTUDIO *fmod_channelp = (LLAudioChannelFMODSTUDIO*)channelp;
|
||||
if (!(fmod_channelp->mChannelp && mChannelp))
|
||||
{
|
||||
// Don't have channels allocated to both the master and the slave
|
||||
return;
|
||||
}
|
||||
|
||||
U32 cur_pos;
|
||||
if (Check_FMOD_Error(mChannelp->getPosition(&cur_pos, FMOD_TIMEUNIT_PCMBYTES), "Unable to retrieve current position"))
|
||||
return;
|
||||
|
||||
cur_pos %= mCurrentBufferp->getLength();
|
||||
|
||||
// Try to match the position of our sync master
|
||||
Check_FMOD_Error(mChannelp->setPosition(cur_pos, FMOD_TIMEUNIT_PCMBYTES), "Unable to set current position");
|
||||
|
||||
// Start us playing
|
||||
play();
|
||||
}
|
||||
|
||||
|
||||
bool LLAudioChannelFMODSTUDIO::isPlaying()
|
||||
{
|
||||
if (!mChannelp)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
bool paused, playing;
|
||||
mChannelp->getPaused(&paused);
|
||||
mChannelp->isPlaying(&playing);
|
||||
return !paused && playing;
|
||||
}
|
||||
|
||||
|
||||
//
|
||||
// LLAudioChannelFMODSTUDIO implementation
|
||||
//
|
||||
|
||||
|
||||
LLAudioBufferFMODSTUDIO::LLAudioBufferFMODSTUDIO(FMOD::System *system) : mSystemp(system), mSoundp(NULL)
|
||||
{
|
||||
}
|
||||
|
||||
|
||||
LLAudioBufferFMODSTUDIO::~LLAudioBufferFMODSTUDIO()
|
||||
{
|
||||
if (mSoundp)
|
||||
{
|
||||
mSoundp->release();
|
||||
mSoundp = NULL;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
bool LLAudioBufferFMODSTUDIO::loadWAV(const std::string& filename)
|
||||
{
|
||||
// Try to open a wav file from disk. This will eventually go away, as we don't
|
||||
// really want to block doing this.
|
||||
if (filename.empty())
|
||||
{
|
||||
// invalid filename, abort.
|
||||
return false;
|
||||
}
|
||||
|
||||
if (!gDirUtilp->fileExists(filename))
|
||||
{
|
||||
// File not found, abort.
|
||||
return false;
|
||||
}
|
||||
|
||||
if (mSoundp)
|
||||
{
|
||||
// If there's already something loaded in this buffer, clean it up.
|
||||
mSoundp->release();
|
||||
mSoundp = NULL;
|
||||
}
|
||||
|
||||
FMOD_MODE base_mode = FMOD_LOOP_NORMAL;
|
||||
FMOD_CREATESOUNDEXINFO exinfo;
|
||||
memset(&exinfo, 0, sizeof(exinfo));
|
||||
exinfo.cbsize = sizeof(exinfo);
|
||||
exinfo.suggestedsoundtype = FMOD_SOUND_TYPE_WAV; //Hint to speed up loading.
|
||||
// Load up the wav file into an fmod sample (since 1.05 fmod studio expects everything in UTF-8)
|
||||
FMOD_RESULT result = getSystem()->createSound(filename.c_str(), base_mode, &exinfo, &mSoundp);
|
||||
|
||||
if (result != FMOD_OK)
|
||||
{
|
||||
// We failed to load the file for some reason.
|
||||
LL_WARNS() << "Could not load data '" << filename << "': " << FMOD_ErrorString(result) << LL_ENDL;
|
||||
|
||||
//
|
||||
// If we EVER want to load wav files provided by end users, we need
|
||||
// to rethink this!
|
||||
//
|
||||
// file is probably corrupt - remove it.
|
||||
LLFile::remove(filename);
|
||||
return false;
|
||||
}
|
||||
|
||||
// Everything went well, return true
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
U32 LLAudioBufferFMODSTUDIO::getLength()
|
||||
{
|
||||
if (!mSoundp)
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
|
||||
U32 length;
|
||||
mSoundp->getLength(&length, FMOD_TIMEUNIT_PCMBYTES);
|
||||
return length;
|
||||
}
|
||||
|
||||
|
||||
void LLAudioChannelFMODSTUDIO::set3DMode(bool use3d)
|
||||
{
|
||||
FMOD_MODE current_mode;
|
||||
if (mChannelp->getMode(¤t_mode) != FMOD_OK)
|
||||
return;
|
||||
FMOD_MODE new_mode = current_mode;
|
||||
new_mode &= ~(use3d ? FMOD_2D : FMOD_3D);
|
||||
new_mode |= use3d ? FMOD_3D : FMOD_2D;
|
||||
|
||||
if (current_mode != new_mode)
|
||||
{
|
||||
mChannelp->setMode(new_mode);
|
||||
}
|
||||
}
|
||||
|
||||
// *NOTE: This is almost certainly being called on the mixer thread,
|
||||
// not the main thread. May have implications for callees or audio
|
||||
// engine shutdown.
|
||||
|
||||
FMOD_RESULT F_CALLBACK windCallback(FMOD_DSP_STATE *dsp_state, float *inbuffer, float *outbuffer, unsigned int length, int inchannels, int *outchannels)
|
||||
{
|
||||
// inbuffer = fmod's original mixbuffer.
|
||||
// outbuffer = the buffer passed from the previous DSP unit.
|
||||
// length = length in samples at this mix time.
|
||||
|
||||
LLWindGen<LLAudioEngine_FMODSTUDIO::MIXBUFFERFORMAT> *windgen = NULL;
|
||||
FMOD::DSP *thisdsp = (FMOD::DSP *)dsp_state->instance;
|
||||
|
||||
thisdsp->getUserData((void **)&windgen);
|
||||
|
||||
if (windgen)
|
||||
{
|
||||
windgen->windGenerate((LLAudioEngine_FMODSTUDIO::MIXBUFFERFORMAT *)outbuffer, length);
|
||||
}
|
||||
|
||||
return FMOD_OK;
|
||||
}
|
||||
|
|
@ -1,131 +0,0 @@
|
|||
/**
|
||||
* @file audioengine_fmodstudio.h
|
||||
* @brief Definition of LLAudioEngine class abstracting the audio
|
||||
* support as a FMODSTUDIO implementation
|
||||
*
|
||||
* $LicenseInfo:firstyear=2020&license=viewerlgpl$
|
||||
* Second Life Viewer Source Code
|
||||
* Copyright (C) 2020, 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_AUDIOENGINE_FMODSTUDIO_H
|
||||
#define LL_AUDIOENGINE_FMODSTUDIO_H
|
||||
|
||||
#include "llaudioengine.h"
|
||||
#include "llwindgen.h"
|
||||
|
||||
//Stubs
|
||||
class LLAudioStreamManagerFMODSTUDIO;
|
||||
namespace FMOD
|
||||
{
|
||||
class System;
|
||||
class Channel;
|
||||
class ChannelGroup;
|
||||
class Sound;
|
||||
class DSP;
|
||||
}
|
||||
typedef struct FMOD_DSP_DESCRIPTION FMOD_DSP_DESCRIPTION;
|
||||
|
||||
//Interfaces
|
||||
class LLAudioEngine_FMODSTUDIO : public LLAudioEngine
|
||||
{
|
||||
public:
|
||||
LLAudioEngine_FMODSTUDIO(bool enable_profiler);
|
||||
virtual ~LLAudioEngine_FMODSTUDIO();
|
||||
|
||||
// initialization/startup/shutdown
|
||||
virtual bool init(void *user_data, const std::string &app_title);
|
||||
virtual std::string getDriverName(bool verbose);
|
||||
virtual LLStreamingAudioInterface* createDefaultStreamingAudioImpl() const;
|
||||
virtual void allocateListener();
|
||||
|
||||
virtual void shutdown();
|
||||
|
||||
/*virtual*/ bool initWind();
|
||||
/*virtual*/ void cleanupWind();
|
||||
|
||||
/*virtual*/void updateWind(LLVector3 direction, F32 camera_height_above_water);
|
||||
|
||||
typedef F32 MIXBUFFERFORMAT;
|
||||
|
||||
FMOD::System *getSystem() const {return mSystem;}
|
||||
protected:
|
||||
/*virtual*/ LLAudioBuffer *createBuffer(); // Get a free buffer, or flush an existing one if you have to.
|
||||
/*virtual*/ LLAudioChannel *createChannel(); // Create a new audio channel.
|
||||
|
||||
/*virtual*/ void setInternalGain(F32 gain);
|
||||
|
||||
bool mInited;
|
||||
|
||||
LLWindGen<MIXBUFFERFORMAT> *mWindGen;
|
||||
|
||||
FMOD_DSP_DESCRIPTION *mWindDSPDesc;
|
||||
FMOD::DSP *mWindDSP;
|
||||
FMOD::System *mSystem;
|
||||
bool mEnableProfiler;
|
||||
|
||||
public:
|
||||
static FMOD::ChannelGroup *mChannelGroups[LLAudioEngine::AUDIO_TYPE_COUNT];
|
||||
};
|
||||
|
||||
|
||||
class LLAudioChannelFMODSTUDIO : public LLAudioChannel
|
||||
{
|
||||
public:
|
||||
LLAudioChannelFMODSTUDIO(FMOD::System *audioengine);
|
||||
virtual ~LLAudioChannelFMODSTUDIO();
|
||||
|
||||
protected:
|
||||
/*virtual*/ void play();
|
||||
/*virtual*/ void playSynced(LLAudioChannel *channelp);
|
||||
/*virtual*/ void cleanup();
|
||||
/*virtual*/ bool isPlaying();
|
||||
|
||||
/*virtual*/ bool updateBuffer();
|
||||
/*virtual*/ void update3DPosition();
|
||||
/*virtual*/ void updateLoop();
|
||||
|
||||
void set3DMode(bool use3d);
|
||||
protected:
|
||||
FMOD::System *getSystem() const {return mSystemp;}
|
||||
FMOD::System *mSystemp;
|
||||
FMOD::Channel *mChannelp;
|
||||
S32 mLastSamplePos;
|
||||
};
|
||||
|
||||
|
||||
class LLAudioBufferFMODSTUDIO : public LLAudioBuffer
|
||||
{
|
||||
public:
|
||||
LLAudioBufferFMODSTUDIO(FMOD::System *audioengine);
|
||||
virtual ~LLAudioBufferFMODSTUDIO();
|
||||
|
||||
/*virtual*/ bool loadWAV(const std::string& filename);
|
||||
/*virtual*/ U32 getLength();
|
||||
friend class LLAudioChannelFMODSTUDIO;
|
||||
protected:
|
||||
FMOD::System *getSystem() const {return mSystemp;}
|
||||
FMOD::System *mSystemp;
|
||||
FMOD::Sound *getSound() const{ return mSoundp; }
|
||||
FMOD::Sound *mSoundp;
|
||||
};
|
||||
|
||||
|
||||
#endif // LL_AUDIOENGINE_FMODSTUDIO_H
|
||||
|
|
@ -135,10 +135,19 @@ void LLAudioEngine_OpenAL::shutdown()
|
|||
LL_INFOS() << "About to LLAudioEngine::shutdown()" << LL_ENDL;
|
||||
LLAudioEngine::shutdown();
|
||||
|
||||
// If a subsequent error occurs while there is still an error recorded
|
||||
// internally, the second error will simply be ignored.
|
||||
// Clear previous error to make sure we will captuare a valid failure reason
|
||||
ALenum error = alutGetError();
|
||||
if (error != ALUT_ERROR_NO_ERROR)
|
||||
{
|
||||
LL_WARNS() << "Uncleared error state prior to shutdown: "
|
||||
<< alutGetErrorString(error) << LL_ENDL;
|
||||
}
|
||||
|
||||
LL_INFOS() << "About to alutExit()" << LL_ENDL;
|
||||
if(!alutExit())
|
||||
{
|
||||
LL_WARNS() << "Nuts." << LL_ENDL;
|
||||
LL_WARNS() << "LLAudioEngine_OpenAL::shutdown() ALUT shutdown failed: " << alutGetErrorString (alutGetError ()) << LL_ENDL;
|
||||
}
|
||||
|
||||
|
|
@ -518,7 +527,7 @@ void LLAudioEngine_OpenAL::updateWind(LLVector3 wind_vec, F32 camera_altitude)
|
|||
}
|
||||
|
||||
alBufferData(buffer,
|
||||
AL_FORMAT_STEREO16,
|
||||
AL_FORMAT_STEREO_FLOAT32,
|
||||
mWindGen->windGenerate(mWindBuf,
|
||||
mWindBufSamples),
|
||||
mWindBufBytes,
|
||||
|
|
|
|||
|
|
@ -57,9 +57,9 @@ class LLAudioEngine_OpenAL : public LLAudioEngine
|
|||
/*virtual*/ void updateWind(LLVector3 direction, F32 camera_altitude);
|
||||
|
||||
private:
|
||||
typedef S16 WIND_SAMPLE_T;
|
||||
typedef F32 WIND_SAMPLE_T;
|
||||
LLWindGen<WIND_SAMPLE_T> *mWindGen;
|
||||
S16 *mWindBuf;
|
||||
F32 *mWindBuf;
|
||||
U32 mWindBufFreq;
|
||||
U32 mWindBufSamples;
|
||||
U32 mWindBufBytes;
|
||||
|
|
|
|||
|
|
@ -1,136 +0,0 @@
|
|||
/**
|
||||
* @file listener_fmodstudio.cpp
|
||||
* @brief Implementation of LISTENER class abstracting the audio
|
||||
* support as a FMODSTUDIO implementation
|
||||
*
|
||||
* $LicenseInfo:firstyear=2020&license=viewerlgpl$
|
||||
* Second Life Viewer Source Code
|
||||
* Copyright (C) 2020, 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 "llaudioengine.h"
|
||||
#include "lllistener_fmodstudio.h"
|
||||
#include "fmodstudio/fmod.hpp"
|
||||
|
||||
//-----------------------------------------------------------------------
|
||||
// constructor
|
||||
//-----------------------------------------------------------------------
|
||||
LLListener_FMODSTUDIO::LLListener_FMODSTUDIO(FMOD::System *system)
|
||||
{
|
||||
mSystem = system;
|
||||
init();
|
||||
}
|
||||
|
||||
//-----------------------------------------------------------------------
|
||||
LLListener_FMODSTUDIO::~LLListener_FMODSTUDIO()
|
||||
{
|
||||
}
|
||||
|
||||
//-----------------------------------------------------------------------
|
||||
void LLListener_FMODSTUDIO::init(void)
|
||||
{
|
||||
// do inherited
|
||||
LLListener::init();
|
||||
mDopplerFactor = 1.0f;
|
||||
mRolloffFactor = 1.0f;
|
||||
}
|
||||
|
||||
//-----------------------------------------------------------------------
|
||||
void LLListener_FMODSTUDIO::translate(LLVector3 offset)
|
||||
{
|
||||
LLListener::translate(offset);
|
||||
|
||||
mSystem->set3DListenerAttributes(0, (FMOD_VECTOR*)mPosition.mV, NULL, (FMOD_VECTOR*)mListenAt.mV, (FMOD_VECTOR*)mListenUp.mV);
|
||||
}
|
||||
|
||||
//-----------------------------------------------------------------------
|
||||
void LLListener_FMODSTUDIO::setPosition(LLVector3 pos)
|
||||
{
|
||||
LLListener::setPosition(pos);
|
||||
|
||||
mSystem->set3DListenerAttributes(0, (FMOD_VECTOR*)mPosition.mV, NULL, (FMOD_VECTOR*)mListenAt.mV, (FMOD_VECTOR*)mListenUp.mV);
|
||||
}
|
||||
|
||||
//-----------------------------------------------------------------------
|
||||
void LLListener_FMODSTUDIO::setVelocity(LLVector3 vel)
|
||||
{
|
||||
LLListener::setVelocity(vel);
|
||||
|
||||
mSystem->set3DListenerAttributes(0, NULL, (FMOD_VECTOR*)mVelocity.mV, (FMOD_VECTOR*)mListenAt.mV, (FMOD_VECTOR*)mListenUp.mV);
|
||||
}
|
||||
|
||||
//-----------------------------------------------------------------------
|
||||
void LLListener_FMODSTUDIO::orient(LLVector3 up, LLVector3 at)
|
||||
{
|
||||
LLListener::orient(up, at);
|
||||
|
||||
// at = -at; by default Fmod studio is 'left-handed' but we are providing
|
||||
// flag FMOD_INIT_3D_RIGHTHANDED so no correction are needed
|
||||
|
||||
mSystem->set3DListenerAttributes(0, NULL, NULL, (FMOD_VECTOR*)at.mV, (FMOD_VECTOR*)up.mV);
|
||||
}
|
||||
|
||||
//-----------------------------------------------------------------------
|
||||
void LLListener_FMODSTUDIO::commitDeferredChanges()
|
||||
{
|
||||
if (!mSystem)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
mSystem->update();
|
||||
}
|
||||
|
||||
|
||||
void LLListener_FMODSTUDIO::setRolloffFactor(F32 factor)
|
||||
{
|
||||
//An internal FMOD optimization skips 3D updates if there have not been changes to the 3D sound environment.
|
||||
// (this was true for FMODex, looks to be still true for FMOD STUDIO, but needs a recheck)
|
||||
//Sadly, a change in rolloff is not accounted for, thus we must touch the listener properties as well.
|
||||
//In short: Changing the position ticks a dirtyflag inside fmod, which makes it not skip 3D processing next update call.
|
||||
if (mRolloffFactor != factor)
|
||||
{
|
||||
LLVector3 pos = mPosition - LLVector3(0.f, 0.f, .1f);
|
||||
mSystem->set3DListenerAttributes(0, (FMOD_VECTOR*)pos.mV, NULL, NULL, NULL);
|
||||
mSystem->set3DListenerAttributes(0, (FMOD_VECTOR*)mPosition.mV, NULL, NULL, NULL);
|
||||
}
|
||||
mRolloffFactor = factor;
|
||||
mSystem->set3DSettings(mDopplerFactor, 1.f, mRolloffFactor);
|
||||
}
|
||||
|
||||
|
||||
F32 LLListener_FMODSTUDIO::getRolloffFactor()
|
||||
{
|
||||
return mRolloffFactor;
|
||||
}
|
||||
|
||||
|
||||
void LLListener_FMODSTUDIO::setDopplerFactor(F32 factor)
|
||||
{
|
||||
mDopplerFactor = factor;
|
||||
mSystem->set3DSettings(mDopplerFactor, 1.f, mRolloffFactor);
|
||||
}
|
||||
|
||||
|
||||
F32 LLListener_FMODSTUDIO::getDopplerFactor()
|
||||
{
|
||||
return mDopplerFactor;
|
||||
}
|
||||
|
|
@ -1,65 +0,0 @@
|
|||
/**
|
||||
* @file listener_fmodstudio.h
|
||||
* @brief Description of LISTENER class abstracting the audio support
|
||||
* as an FMOD 3D implementation
|
||||
*
|
||||
* $LicenseInfo:firstyear=2020&license=viewerlgpl$
|
||||
* Second Life Viewer Source Code
|
||||
* Copyright (C) 2020, 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_LISTENER_FMODSTUDIO_H
|
||||
#define LL_LISTENER_FMODSTUDIO_H
|
||||
|
||||
#include "lllistener.h"
|
||||
|
||||
//Stubs
|
||||
namespace FMOD
|
||||
{
|
||||
class System;
|
||||
}
|
||||
|
||||
//Interfaces
|
||||
class LLListener_FMODSTUDIO : public LLListener
|
||||
{
|
||||
public:
|
||||
LLListener_FMODSTUDIO(FMOD::System *system);
|
||||
virtual ~LLListener_FMODSTUDIO();
|
||||
virtual void init();
|
||||
|
||||
virtual void translate(LLVector3 offset);
|
||||
virtual void setPosition(LLVector3 pos);
|
||||
virtual void setVelocity(LLVector3 vel);
|
||||
virtual void orient(LLVector3 up, LLVector3 at);
|
||||
virtual void commitDeferredChanges();
|
||||
|
||||
virtual void setDopplerFactor(F32 factor);
|
||||
virtual F32 getDopplerFactor();
|
||||
virtual void setRolloffFactor(F32 factor);
|
||||
virtual F32 getRolloffFactor();
|
||||
protected:
|
||||
FMOD::System *mSystem;
|
||||
F32 mDopplerFactor;
|
||||
F32 mRolloffFactor;
|
||||
};
|
||||
|
||||
#endif
|
||||
|
||||
|
||||
|
|
@ -32,6 +32,7 @@
|
|||
|
||||
#include "AL/al.h"
|
||||
#include "AL/alut.h"
|
||||
#include "AL/alext.h"
|
||||
|
||||
class LLListener_OpenAL : public LLListener
|
||||
{
|
||||
|
|
|
|||
|
|
@ -1,481 +0,0 @@
|
|||
/**
|
||||
* @file streamingaudio_fmodstudio.cpp
|
||||
* @brief LLStreamingAudio_FMODSTUDIO implementation
|
||||
*
|
||||
* $LicenseInfo:firstyear=2020&license=viewerlgpl$
|
||||
* Second Life Viewer Source Code
|
||||
* Copyright (C) 2020, 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 "llmath.h"
|
||||
|
||||
#include "fmodstudio/fmod.hpp"
|
||||
#include "fmodstudio/fmod_errors.h"
|
||||
|
||||
#include "llstreamingaudio_fmodstudio.h"
|
||||
|
||||
|
||||
class LLAudioStreamManagerFMODSTUDIO
|
||||
{
|
||||
public:
|
||||
LLAudioStreamManagerFMODSTUDIO(FMOD::System *system, const std::string& url);
|
||||
FMOD::Channel* startStream();
|
||||
bool stopStream(); // Returns true if the stream was successfully stopped.
|
||||
bool ready();
|
||||
|
||||
const std::string& getURL() { return mInternetStreamURL; }
|
||||
|
||||
FMOD_OPENSTATE getOpenState(unsigned int* percentbuffered = NULL, bool* starving = NULL, bool* diskbusy = NULL);
|
||||
protected:
|
||||
FMOD::System* mSystem;
|
||||
FMOD::Channel* mStreamChannel;
|
||||
FMOD::Sound* mInternetStream;
|
||||
bool mReady;
|
||||
|
||||
std::string mInternetStreamURL;
|
||||
};
|
||||
|
||||
|
||||
|
||||
//---------------------------------------------------------------------------
|
||||
// Internet Streaming
|
||||
//---------------------------------------------------------------------------
|
||||
LLStreamingAudio_FMODSTUDIO::LLStreamingAudio_FMODSTUDIO(FMOD::System *system) :
|
||||
mSystem(system),
|
||||
mCurrentInternetStreamp(NULL),
|
||||
mFMODInternetStreamChannelp(NULL),
|
||||
mGain(1.0f),
|
||||
mRetryCount(0)
|
||||
{
|
||||
// Number of milliseconds of audio to buffer for the audio card.
|
||||
// Must be larger than the usual Second Life frame stutter time.
|
||||
const U32 buffer_seconds = 10; //sec
|
||||
const U32 estimated_bitrate = 128; //kbit/sec
|
||||
FMOD_RESULT result = mSystem->setStreamBufferSize(estimated_bitrate * buffer_seconds * 128/*bytes/kbit*/, FMOD_TIMEUNIT_RAWBYTES);
|
||||
if (result != FMOD_OK)
|
||||
{
|
||||
LL_WARNS("FMOD") << "setStreamBufferSize error: " << FMOD_ErrorString(result) << LL_ENDL;
|
||||
}
|
||||
|
||||
// Here's where we set the size of the network buffer and some buffering
|
||||
// parameters. In this case we want a network buffer of 16k, we want it
|
||||
// to prebuffer 40% of that when we first connect, and we want it
|
||||
// to rebuffer 80% of that whenever we encounter a buffer underrun.
|
||||
|
||||
// Leave the net buffer properties at the default.
|
||||
//FSOUND_Stream_Net_SetBufferProperties(20000, 40, 80);
|
||||
}
|
||||
|
||||
|
||||
LLStreamingAudio_FMODSTUDIO::~LLStreamingAudio_FMODSTUDIO()
|
||||
{
|
||||
if (mCurrentInternetStreamp)
|
||||
{
|
||||
// Isn't supposed to hapen, stream should be clear by now,
|
||||
// and if it does, we are likely going to crash.
|
||||
LL_WARNS("FMOD") << "mCurrentInternetStreamp not null on shutdown!" << LL_ENDL;
|
||||
stop();
|
||||
}
|
||||
|
||||
// Kill dead internet streams, if possible
|
||||
killDeadStreams();
|
||||
|
||||
if (!mDeadStreams.empty())
|
||||
{
|
||||
// LLStreamingAudio_FMODSTUDIO was inited on startup
|
||||
// and should be destroyed on shutdown, it should
|
||||
// wait for streams to die to not cause crashes or
|
||||
// leaks.
|
||||
// Ideally we need to wait on some kind of callback
|
||||
// to release() streams correctly, but 200 ms should
|
||||
// be enough and we can't wait forever.
|
||||
LL_INFOS("FMOD") << "Waiting for " << (S32)mDeadStreams.size() << " streams to stop" << LL_ENDL;
|
||||
for (S32 i = 0; i < 20; i++)
|
||||
{
|
||||
const U32 ms_delay = 10;
|
||||
ms_sleep(ms_delay); // rude, but not many options here
|
||||
killDeadStreams();
|
||||
if (mDeadStreams.empty())
|
||||
{
|
||||
LL_INFOS("FMOD") << "All streams stopped after " << (S32)((i + 1) * ms_delay) << "ms" << LL_ENDL;
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (!mDeadStreams.empty())
|
||||
{
|
||||
LL_WARNS("FMOD") << "Failed to kill some audio streams" << LL_ENDL;
|
||||
}
|
||||
}
|
||||
|
||||
void LLStreamingAudio_FMODSTUDIO::killDeadStreams()
|
||||
{
|
||||
std::list<LLAudioStreamManagerFMODSTUDIO *>::iterator iter;
|
||||
for (iter = mDeadStreams.begin(); iter != mDeadStreams.end();)
|
||||
{
|
||||
LLAudioStreamManagerFMODSTUDIO *streamp = *iter;
|
||||
if (streamp->stopStream())
|
||||
{
|
||||
LL_INFOS("FMOD") << "Closed dead stream" << LL_ENDL;
|
||||
delete streamp;
|
||||
iter = mDeadStreams.erase(iter);
|
||||
}
|
||||
else
|
||||
{
|
||||
iter++;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void LLStreamingAudio_FMODSTUDIO::start(const std::string& url)
|
||||
{
|
||||
//if (!mInited)
|
||||
//{
|
||||
// LL_WARNS() << "startInternetStream before audio initialized" << LL_ENDL;
|
||||
// return;
|
||||
//}
|
||||
|
||||
// "stop" stream but don't clear url, etc. in case url == mInternetStreamURL
|
||||
stop();
|
||||
|
||||
if (!url.empty())
|
||||
{
|
||||
LL_INFOS("FMOD") << "Starting internet stream: " << url << LL_ENDL;
|
||||
mCurrentInternetStreamp = new LLAudioStreamManagerFMODSTUDIO(mSystem, url);
|
||||
mURL = url;
|
||||
}
|
||||
else
|
||||
{
|
||||
LL_INFOS("FMOD") << "Set internet stream to null" << LL_ENDL;
|
||||
mURL.clear();
|
||||
}
|
||||
|
||||
mRetryCount = 0;
|
||||
}
|
||||
|
||||
|
||||
void LLStreamingAudio_FMODSTUDIO::update()
|
||||
{
|
||||
// Kill dead internet streams, if possible
|
||||
killDeadStreams();
|
||||
|
||||
// Don't do anything if there are no streams playing
|
||||
if (!mCurrentInternetStreamp)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
unsigned int progress;
|
||||
bool starving;
|
||||
bool diskbusy;
|
||||
FMOD_OPENSTATE open_state = mCurrentInternetStreamp->getOpenState(&progress, &starving, &diskbusy);
|
||||
|
||||
if (open_state == FMOD_OPENSTATE_READY)
|
||||
{
|
||||
// Stream is live
|
||||
|
||||
// start the stream if it's ready
|
||||
if (!mFMODInternetStreamChannelp &&
|
||||
(mFMODInternetStreamChannelp = mCurrentInternetStreamp->startStream()))
|
||||
{
|
||||
// Reset volume to previously set volume
|
||||
setGain(getGain());
|
||||
mFMODInternetStreamChannelp->setPaused(false);
|
||||
}
|
||||
mRetryCount = 0;
|
||||
}
|
||||
else if (open_state == FMOD_OPENSTATE_ERROR)
|
||||
{
|
||||
LL_INFOS("FMOD") << "State: FMOD_OPENSTATE_ERROR"
|
||||
<< " Progress: " << U32(progress)
|
||||
<< " Starving: " << S32(starving)
|
||||
<< " Diskbusy: " << S32(diskbusy) << LL_ENDL;
|
||||
if (mRetryCount < 2)
|
||||
{
|
||||
// Retry
|
||||
std::string url = mURL;
|
||||
stop(); // might drop mURL, drops mCurrentInternetStreamp
|
||||
|
||||
mRetryCount++;
|
||||
|
||||
if (!url.empty())
|
||||
{
|
||||
LL_INFOS("FMOD") << "Restarting internet stream: " << url << ", attempt " << (mRetryCount + 1) << LL_ENDL;
|
||||
mCurrentInternetStreamp = new LLAudioStreamManagerFMODSTUDIO(mSystem, url);
|
||||
mURL = url;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
stop();
|
||||
}
|
||||
return;
|
||||
}
|
||||
|
||||
if (mFMODInternetStreamChannelp)
|
||||
{
|
||||
FMOD::Sound *sound = NULL;
|
||||
|
||||
if (mFMODInternetStreamChannelp->getCurrentSound(&sound) == FMOD_OK && sound)
|
||||
{
|
||||
FMOD_TAG tag;
|
||||
S32 tagcount, dirtytagcount;
|
||||
|
||||
if (sound->getNumTags(&tagcount, &dirtytagcount) == FMOD_OK && dirtytagcount)
|
||||
{
|
||||
for (S32 i = 0; i < tagcount; ++i)
|
||||
{
|
||||
if (sound->getTag(NULL, i, &tag) != FMOD_OK)
|
||||
continue;
|
||||
|
||||
if (tag.type == FMOD_TAGTYPE_FMOD)
|
||||
{
|
||||
if (!strcmp(tag.name, "Sample Rate Change"))
|
||||
{
|
||||
LL_INFOS("FMOD") << "Stream forced changing sample rate to " << *((float *)tag.data) << LL_ENDL;
|
||||
mFMODInternetStreamChannelp->setFrequency(*((float *)tag.data));
|
||||
}
|
||||
continue;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (starving)
|
||||
{
|
||||
bool paused = false;
|
||||
mFMODInternetStreamChannelp->getPaused(&paused);
|
||||
if (!paused)
|
||||
{
|
||||
LL_INFOS("FMOD") << "Stream starvation detected! Pausing stream until buffer nearly full." << LL_ENDL;
|
||||
LL_INFOS("FMOD") << " (diskbusy=" << diskbusy << ")" << LL_ENDL;
|
||||
LL_INFOS("FMOD") << " (progress=" << progress << ")" << LL_ENDL;
|
||||
mFMODInternetStreamChannelp->setPaused(true);
|
||||
}
|
||||
}
|
||||
else if (progress > 80)
|
||||
{
|
||||
mFMODInternetStreamChannelp->setPaused(false);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void LLStreamingAudio_FMODSTUDIO::stop()
|
||||
{
|
||||
if (mFMODInternetStreamChannelp)
|
||||
{
|
||||
mFMODInternetStreamChannelp->setPaused(true);
|
||||
mFMODInternetStreamChannelp->setPriority(0);
|
||||
mFMODInternetStreamChannelp = NULL;
|
||||
}
|
||||
|
||||
if (mCurrentInternetStreamp)
|
||||
{
|
||||
LL_INFOS("FMOD") << "Stopping internet stream: " << mCurrentInternetStreamp->getURL() << LL_ENDL;
|
||||
if (mCurrentInternetStreamp->stopStream())
|
||||
{
|
||||
delete mCurrentInternetStreamp;
|
||||
}
|
||||
else
|
||||
{
|
||||
LL_WARNS("FMOD") << "Pushing stream to dead list: " << mCurrentInternetStreamp->getURL() << LL_ENDL;
|
||||
mDeadStreams.push_back(mCurrentInternetStreamp);
|
||||
}
|
||||
mCurrentInternetStreamp = NULL;
|
||||
//mURL.clear();
|
||||
}
|
||||
}
|
||||
|
||||
void LLStreamingAudio_FMODSTUDIO::pause(int pauseopt)
|
||||
{
|
||||
if (pauseopt < 0)
|
||||
{
|
||||
pauseopt = mCurrentInternetStreamp ? 1 : 0;
|
||||
}
|
||||
|
||||
if (pauseopt)
|
||||
{
|
||||
if (mCurrentInternetStreamp)
|
||||
{
|
||||
LL_INFOS("FMOD") << "Pausing internet stream" << LL_ENDL;
|
||||
stop();
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
start(getURL());
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
// A stream is "playing" if it has been requested to start. That
|
||||
// doesn't necessarily mean audio is coming out of the speakers.
|
||||
int LLStreamingAudio_FMODSTUDIO::isPlaying()
|
||||
{
|
||||
if (mCurrentInternetStreamp)
|
||||
{
|
||||
return 1; // Active and playing
|
||||
}
|
||||
else if (!mURL.empty())
|
||||
{
|
||||
return 2; // "Paused"
|
||||
}
|
||||
else
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
F32 LLStreamingAudio_FMODSTUDIO::getGain()
|
||||
{
|
||||
return mGain;
|
||||
}
|
||||
|
||||
|
||||
std::string LLStreamingAudio_FMODSTUDIO::getURL()
|
||||
{
|
||||
return mURL;
|
||||
}
|
||||
|
||||
|
||||
void LLStreamingAudio_FMODSTUDIO::setGain(F32 vol)
|
||||
{
|
||||
mGain = vol;
|
||||
|
||||
if (mFMODInternetStreamChannelp)
|
||||
{
|
||||
vol = llclamp(vol * vol, 0.f, 1.f); //should vol be squared here?
|
||||
|
||||
mFMODInternetStreamChannelp->setVolume(vol);
|
||||
}
|
||||
}
|
||||
|
||||
///////////////////////////////////////////////////////
|
||||
// manager of possibly-multiple internet audio streams
|
||||
|
||||
LLAudioStreamManagerFMODSTUDIO::LLAudioStreamManagerFMODSTUDIO(FMOD::System *system, const std::string& url) :
|
||||
mSystem(system),
|
||||
mStreamChannel(NULL),
|
||||
mInternetStream(NULL),
|
||||
mReady(false)
|
||||
{
|
||||
mInternetStreamURL = url;
|
||||
|
||||
FMOD_RESULT result = mSystem->createStream(url.c_str(), FMOD_2D | FMOD_NONBLOCKING | FMOD_IGNORETAGS, 0, &mInternetStream);
|
||||
|
||||
if (result != FMOD_OK)
|
||||
{
|
||||
LL_WARNS("FMOD") << "Couldn't open fmod stream, error "
|
||||
<< FMOD_ErrorString(result)
|
||||
<< LL_ENDL;
|
||||
mReady = false;
|
||||
return;
|
||||
}
|
||||
|
||||
mReady = true;
|
||||
}
|
||||
|
||||
FMOD::Channel *LLAudioStreamManagerFMODSTUDIO::startStream()
|
||||
{
|
||||
// We need a live and opened stream before we try and play it.
|
||||
if (!mInternetStream || getOpenState() != FMOD_OPENSTATE_READY)
|
||||
{
|
||||
LL_WARNS("FMOD") << "No internet stream to start playing!" << LL_ENDL;
|
||||
return NULL;
|
||||
}
|
||||
|
||||
if (mStreamChannel)
|
||||
return mStreamChannel; //Already have a channel for this stream.
|
||||
|
||||
FMOD_RESULT result = mSystem->playSound(mInternetStream, NULL, true, &mStreamChannel);
|
||||
if (result != FMOD_OK)
|
||||
{
|
||||
LL_WARNS("FMOD") << FMOD_ErrorString(result) << LL_ENDL;
|
||||
}
|
||||
return mStreamChannel;
|
||||
}
|
||||
|
||||
bool LLAudioStreamManagerFMODSTUDIO::stopStream()
|
||||
{
|
||||
if (mInternetStream)
|
||||
{
|
||||
|
||||
|
||||
bool close = true;
|
||||
switch (getOpenState())
|
||||
{
|
||||
case FMOD_OPENSTATE_CONNECTING:
|
||||
close = false;
|
||||
break;
|
||||
default:
|
||||
close = true;
|
||||
}
|
||||
|
||||
if (close)
|
||||
{
|
||||
mInternetStream->release();
|
||||
mStreamChannel = NULL;
|
||||
mInternetStream = NULL;
|
||||
return true;
|
||||
}
|
||||
else
|
||||
{
|
||||
return false;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
FMOD_OPENSTATE LLAudioStreamManagerFMODSTUDIO::getOpenState(unsigned int* percentbuffered, bool* starving, bool* diskbusy)
|
||||
{
|
||||
FMOD_OPENSTATE state;
|
||||
FMOD_RESULT result = mInternetStream->getOpenState(&state, percentbuffered, starving, diskbusy);
|
||||
if (result != FMOD_OK)
|
||||
{
|
||||
LL_WARNS("FMOD") << FMOD_ErrorString(result) << LL_ENDL;
|
||||
}
|
||||
return state;
|
||||
}
|
||||
|
||||
void LLStreamingAudio_FMODSTUDIO::setBufferSizes(U32 streambuffertime, U32 decodebuffertime)
|
||||
{
|
||||
FMOD_RESULT result = mSystem->setStreamBufferSize(streambuffertime / 1000 * 128 * 128, FMOD_TIMEUNIT_RAWBYTES);
|
||||
if (result != FMOD_OK)
|
||||
{
|
||||
LL_WARNS("FMOD") << "setStreamBufferSize error: " << FMOD_ErrorString(result) << LL_ENDL;
|
||||
return;
|
||||
}
|
||||
FMOD_ADVANCEDSETTINGS settings;
|
||||
memset(&settings, 0, sizeof(settings));
|
||||
settings.cbSize = sizeof(settings);
|
||||
settings.defaultDecodeBufferSize = decodebuffertime;//ms
|
||||
result = mSystem->setAdvancedSettings(&settings);
|
||||
if (result != FMOD_OK)
|
||||
{
|
||||
LL_WARNS("FMOD") << "setAdvancedSettings error: " << FMOD_ErrorString(result) << LL_ENDL;
|
||||
}
|
||||
}
|
||||
|
|
@ -1,76 +0,0 @@
|
|||
/**
|
||||
* @file streamingaudio_fmodstudio.h
|
||||
* @brief Definition of LLStreamingAudio_FMODSTUDIO implementation
|
||||
*
|
||||
* $LicenseInfo:firstyear=2020&license=viewerlgpl$
|
||||
* Second Life Viewer Source Code
|
||||
* Copyright (C) 2020, 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_STREAMINGAUDIO_FMODSTUDIO_H
|
||||
#define LL_STREAMINGAUDIO_FMODSTUDIO_H
|
||||
|
||||
#include "stdtypes.h" // from llcommon
|
||||
|
||||
#include "llstreamingaudio.h"
|
||||
#include "lltimer.h"
|
||||
|
||||
//Stubs
|
||||
class LLAudioStreamManagerFMODSTUDIO;
|
||||
namespace FMOD
|
||||
{
|
||||
class System;
|
||||
class Channel;
|
||||
}
|
||||
|
||||
//Interfaces
|
||||
class LLStreamingAudio_FMODSTUDIO : public LLStreamingAudioInterface
|
||||
{
|
||||
public:
|
||||
LLStreamingAudio_FMODSTUDIO(FMOD::System *system);
|
||||
/*virtual*/ ~LLStreamingAudio_FMODSTUDIO();
|
||||
|
||||
/*virtual*/ void start(const std::string& url);
|
||||
/*virtual*/ void stop();
|
||||
/*virtual*/ void pause(S32 pause);
|
||||
/*virtual*/ void update();
|
||||
/*virtual*/ S32 isPlaying();
|
||||
/*virtual*/ void setGain(F32 vol);
|
||||
/*virtual*/ F32 getGain();
|
||||
/*virtual*/ std::string getURL();
|
||||
|
||||
/*virtual*/ bool supportsAdjustableBufferSizes(){return true;}
|
||||
/*virtual*/ void setBufferSizes(U32 streambuffertime, U32 decodebuffertime);
|
||||
private:
|
||||
void killDeadStreams();
|
||||
|
||||
FMOD::System *mSystem;
|
||||
|
||||
LLAudioStreamManagerFMODSTUDIO *mCurrentInternetStreamp;
|
||||
FMOD::Channel *mFMODInternetStreamChannelp;
|
||||
std::list<LLAudioStreamManagerFMODSTUDIO *> mDeadStreams;
|
||||
|
||||
std::string mURL;
|
||||
F32 mGain;
|
||||
S32 mRetryCount;
|
||||
};
|
||||
|
||||
|
||||
#endif // LL_STREAMINGAUDIO_FMODSTUDIO_H
|
||||
|
|
@ -75,7 +75,7 @@ S32 check_for_invalid_wav_formats(const std::string& in_fname, std::string& erro
|
|||
U32 chunk_length = 0;
|
||||
U32 raw_data_length = 0;
|
||||
U32 bytes_per_sec = 0;
|
||||
BOOL uncompressed_pcm = FALSE;
|
||||
bool uncompressed_pcm = false;
|
||||
|
||||
unsigned char wav_header[44]; /*Flawfinder: ignore*/
|
||||
|
||||
|
|
@ -133,7 +133,7 @@ S32 check_for_invalid_wav_formats(const std::string& in_fname, std::string& erro
|
|||
{
|
||||
if ((wav_header[8] == 0x01) && (wav_header[9] == 0x00))
|
||||
{
|
||||
uncompressed_pcm = TRUE;
|
||||
uncompressed_pcm = true;
|
||||
}
|
||||
num_channels = ((U16) wav_header[11] << 8) + wav_header[10];
|
||||
sample_rate = ((U32) wav_header[15] << 24)
|
||||
|
|
|
|||
|
|
@ -367,7 +367,7 @@ const char *LLAnimationLibrary::animStateToString( const LLUUID& state )
|
|||
//-----------------------------------------------------------------------------
|
||||
// Return the animation state for a given name
|
||||
//-----------------------------------------------------------------------------
|
||||
LLUUID LLAnimationLibrary::stringToAnimState( const std::string& name, BOOL allow_ids )
|
||||
LLUUID LLAnimationLibrary::stringToAnimState( const std::string& name, bool allow_ids )
|
||||
{
|
||||
std::string lower_case_name(name);
|
||||
LLStringUtil::toLower(lower_case_name);
|
||||
|
|
@ -391,7 +391,7 @@ LLUUID LLAnimationLibrary::stringToAnimState( const std::string& name, BOOL allo
|
|||
else if (allow_ids)
|
||||
{
|
||||
// try to convert string to LLUUID
|
||||
id.set(name, FALSE);
|
||||
id.set(name, false);
|
||||
}
|
||||
|
||||
return id;
|
||||
|
|
|
|||
|
|
@ -220,7 +220,7 @@ public:
|
|||
// Return the animation state for the given name.
|
||||
// Retun NULL if the name is invalid.
|
||||
//-----------------------------------------------------------------------------
|
||||
LLUUID stringToAnimState( const std::string& name, BOOL allow_ids = TRUE );
|
||||
LLUUID stringToAnimState( const std::string& name, bool allow_ids = true );
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
// Associate an anim state with a name
|
||||
|
|
|
|||
|
|
@ -184,7 +184,7 @@ LLBVHLoader::LLBVHLoader(const char* buffer, ELoadStatus &loadStatus, S32 &error
|
|||
LL_DEBUGS("BVH") << "After translations and optimize" << LL_ENDL;
|
||||
dumpBVHInfo();
|
||||
|
||||
mInitialized = TRUE;
|
||||
mInitialized = true;
|
||||
}
|
||||
|
||||
|
||||
|
|
@ -227,7 +227,7 @@ ELoadStatus LLBVHLoader::loadTranslationTable(const char *fileName)
|
|||
//--------------------------------------------------------------------
|
||||
// load data one line at a time
|
||||
//--------------------------------------------------------------------
|
||||
BOOL loadingGlobals = FALSE;
|
||||
bool loadingGlobals = false;
|
||||
while ( getLine(fp) )
|
||||
{
|
||||
//----------------------------------------------------------------
|
||||
|
|
@ -251,7 +251,7 @@ ELoadStatus LLBVHLoader::loadTranslationTable(const char *fileName)
|
|||
|
||||
if (strcmp(name, "GLOBALS")==0)
|
||||
{
|
||||
loadingGlobals = TRUE;
|
||||
loadingGlobals = true;
|
||||
continue;
|
||||
}
|
||||
}
|
||||
|
|
@ -298,7 +298,7 @@ ELoadStatus LLBVHLoader::loadTranslationTable(const char *fileName)
|
|||
|
||||
if ( sscanf(mLine, " %*s = %f %f", &loop_in, &loop_out) == 2 )
|
||||
{
|
||||
mLoop = TRUE;
|
||||
mLoop = true;
|
||||
}
|
||||
else if ( sscanf(mLine, " %*s = %127s", trueFalse) == 1 ) /* Flawfinder: ignore */
|
||||
{
|
||||
|
|
@ -496,8 +496,8 @@ void LLBVHLoader::makeTranslation(std::string alias_name, std::string joint_name
|
|||
|
||||
if (joint_name == "mPelvis")
|
||||
{
|
||||
newTrans.mRelativePositionKey = TRUE;
|
||||
newTrans.mRelativeRotationKey = TRUE;
|
||||
newTrans.mRelativePositionKey = true;
|
||||
newTrans.mRelativeRotationKey = true;
|
||||
}
|
||||
|
||||
}
|
||||
|
|
@ -609,7 +609,7 @@ ELoadStatus LLBVHLoader::loadBVHFile(const char *buffer, char* error_text, S32 &
|
|||
//--------------------------------------------------------------------
|
||||
// consume joints
|
||||
//--------------------------------------------------------------------
|
||||
while (TRUE)
|
||||
while (true)
|
||||
{
|
||||
//----------------------------------------------------------------
|
||||
// get next line
|
||||
|
|
@ -969,7 +969,7 @@ void LLBVHLoader::applyTranslations()
|
|||
if ( trans.mIgnore )
|
||||
{
|
||||
//LL_INFOS() << "NOTE: Ignoring " << joint->mName.c_str() << LL_ENDL;
|
||||
joint->mIgnore = TRUE;
|
||||
joint->mIgnore = true;
|
||||
continue;
|
||||
}
|
||||
|
||||
|
|
@ -983,10 +983,10 @@ void LLBVHLoader::applyTranslations()
|
|||
}
|
||||
|
||||
//Allow joint position changes as of SL-318
|
||||
joint->mIgnorePositions = FALSE;
|
||||
joint->mIgnorePositions = false;
|
||||
if (joint->mNumChannels == 3)
|
||||
{
|
||||
joint->mIgnorePositions = TRUE;
|
||||
joint->mIgnorePositions = true;
|
||||
}
|
||||
|
||||
//----------------------------------------------------------------
|
||||
|
|
@ -995,13 +995,13 @@ void LLBVHLoader::applyTranslations()
|
|||
if ( trans.mRelativePositionKey )
|
||||
{
|
||||
// LL_INFOS() << "NOTE: Removing 1st position offset from all keys for " << joint->mOutName.c_str() << LL_ENDL;
|
||||
joint->mRelativePositionKey = TRUE;
|
||||
joint->mRelativePositionKey = true;
|
||||
}
|
||||
|
||||
if ( trans.mRelativeRotationKey )
|
||||
{
|
||||
// LL_INFOS() << "NOTE: Removing 1st rotation from all keys for " << joint->mOutName.c_str() << LL_ENDL;
|
||||
joint->mRelativeRotationKey = TRUE;
|
||||
joint->mRelativeRotationKey = true;
|
||||
}
|
||||
|
||||
if ( trans.mRelativePosition.magVec() > 0.0f )
|
||||
|
|
@ -1065,8 +1065,8 @@ void LLBVHLoader::optimize()
|
|||
|
||||
for (Joint* joint : mJoints)
|
||||
{
|
||||
BOOL pos_changed = FALSE;
|
||||
BOOL rot_changed = FALSE;
|
||||
bool pos_changed = false;
|
||||
bool rot_changed = false;
|
||||
|
||||
if ( ! joint->mIgnore )
|
||||
{
|
||||
|
|
@ -1079,7 +1079,7 @@ void LLBVHLoader::optimize()
|
|||
// no keys?
|
||||
if (first_key == joint->mKeys.end())
|
||||
{
|
||||
joint->mIgnore = TRUE;
|
||||
joint->mIgnore = true;
|
||||
continue;
|
||||
}
|
||||
|
||||
|
|
@ -1092,13 +1092,13 @@ void LLBVHLoader::optimize()
|
|||
{
|
||||
// *FIX: use single frame to move pelvis
|
||||
// if only one keyframe force output for this joint
|
||||
rot_changed = TRUE;
|
||||
rot_changed = true;
|
||||
}
|
||||
else
|
||||
{
|
||||
// if more than one keyframe, use first frame as reference and skip to second
|
||||
first_key->mIgnorePos = TRUE;
|
||||
first_key->mIgnoreRot = TRUE;
|
||||
first_key->mIgnorePos = true;
|
||||
first_key->mIgnoreRot = true;
|
||||
++ki;
|
||||
}
|
||||
|
||||
|
|
@ -1119,7 +1119,7 @@ void LLBVHLoader::optimize()
|
|||
joint->mNumPosKeys++;
|
||||
if (dist_vec_squared(LLVector3(ki_prev->mPos), first_frame_pos) > POSITION_MOTION_THRESHOLD_SQUARED)
|
||||
{
|
||||
pos_changed = TRUE;
|
||||
pos_changed = true;
|
||||
}
|
||||
}
|
||||
else
|
||||
|
|
@ -1132,12 +1132,12 @@ void LLBVHLoader::optimize()
|
|||
|
||||
if (dist_vec_squared(current_pos, first_frame_pos) > POSITION_MOTION_THRESHOLD_SQUARED)
|
||||
{
|
||||
pos_changed = TRUE;
|
||||
pos_changed = true;
|
||||
}
|
||||
|
||||
if (dist_vec_squared(interp_pos, test_pos) < POSITION_KEYFRAME_THRESHOLD_SQUARED)
|
||||
{
|
||||
ki_prev->mIgnorePos = TRUE;
|
||||
ki_prev->mIgnorePos = true;
|
||||
numPosFramesConsidered++;
|
||||
}
|
||||
else
|
||||
|
|
@ -1158,7 +1158,7 @@ void LLBVHLoader::optimize()
|
|||
|
||||
if (rot_test > ROTATION_MOTION_THRESHOLD)
|
||||
{
|
||||
rot_changed = TRUE;
|
||||
rot_changed = true;
|
||||
}
|
||||
}
|
||||
else
|
||||
|
|
@ -1180,7 +1180,7 @@ void LLBVHLoader::optimize()
|
|||
rot_test = x_delta + y_delta;
|
||||
if (rot_test > ROTATION_MOTION_THRESHOLD)
|
||||
{
|
||||
rot_changed = TRUE;
|
||||
rot_changed = true;
|
||||
}
|
||||
x_delta = dist_vec(LLVector3::x_axis * interp_rot, LLVector3::x_axis * test_rot);
|
||||
y_delta = dist_vec(LLVector3::y_axis * interp_rot, LLVector3::y_axis * test_rot);
|
||||
|
|
@ -1202,9 +1202,9 @@ void LLBVHLoader::optimize()
|
|||
// because it's significantly faster.
|
||||
if (diff_max > 0)
|
||||
{
|
||||
if (ki_max->mIgnoreRot == TRUE)
|
||||
if (ki_max->mIgnoreRot)
|
||||
{
|
||||
ki_max->mIgnoreRot = FALSE;
|
||||
ki_max->mIgnoreRot = false;
|
||||
joint->mNumRotKeys++;
|
||||
}
|
||||
diff_max = 0;
|
||||
|
|
@ -1213,7 +1213,7 @@ void LLBVHLoader::optimize()
|
|||
else
|
||||
{
|
||||
// This keyframe isn't significant enough, throw it away.
|
||||
ki_prev->mIgnoreRot = TRUE;
|
||||
ki_prev->mIgnoreRot = true;
|
||||
numRotFramesConsidered++;
|
||||
// Store away the keyframe that has the largest deviation from the interpolated line, for insertion later.
|
||||
if (rot_test > diff_max)
|
||||
|
|
@ -1232,7 +1232,7 @@ void LLBVHLoader::optimize()
|
|||
if (!(pos_changed || rot_changed))
|
||||
{
|
||||
//LL_INFOS() << "Ignoring joint " << joint->mName << LL_ENDL;
|
||||
joint->mIgnore = TRUE;
|
||||
joint->mIgnore = true;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -1245,13 +1245,13 @@ void LLBVHLoader::reset()
|
|||
mDuration = 0.0f;
|
||||
|
||||
mPriority = 2;
|
||||
mLoop = FALSE;
|
||||
mLoop = false;
|
||||
mLoopInPoint = 0.f;
|
||||
mLoopOutPoint = 0.f;
|
||||
mEaseIn = 0.3f;
|
||||
mEaseOut = 0.3f;
|
||||
mHand = 1;
|
||||
mInitialized = FALSE;
|
||||
mInitialized = false;
|
||||
|
||||
mEmoteName = "";
|
||||
mLineNumber = 0;
|
||||
|
|
@ -1262,19 +1262,19 @@ void LLBVHLoader::reset()
|
|||
//------------------------------------------------------------------------
|
||||
// LLBVHLoader::getLine()
|
||||
//------------------------------------------------------------------------
|
||||
BOOL LLBVHLoader::getLine(apr_file_t* fp)
|
||||
bool LLBVHLoader::getLine(apr_file_t* fp)
|
||||
{
|
||||
if (apr_file_eof(fp) == APR_EOF)
|
||||
{
|
||||
return FALSE;
|
||||
return false;
|
||||
}
|
||||
if ( apr_file_gets(mLine, BVH_PARSER_LINE_SIZE, fp) == APR_SUCCESS)
|
||||
{
|
||||
mLineNumber++;
|
||||
return TRUE;
|
||||
return true;
|
||||
}
|
||||
|
||||
return FALSE;
|
||||
return false;
|
||||
}
|
||||
|
||||
// returns required size of output buffer
|
||||
|
|
@ -1287,7 +1287,7 @@ U32 LLBVHLoader::getOutputSize()
|
|||
}
|
||||
|
||||
// writes contents to datapacker
|
||||
BOOL LLBVHLoader::serialize(LLDataPacker& dp)
|
||||
bool LLBVHLoader::serialize(LLDataPacker& dp)
|
||||
{
|
||||
F32 time;
|
||||
|
||||
|
|
@ -1496,5 +1496,5 @@ BOOL LLBVHLoader::serialize(LLDataPacker& dp)
|
|||
}
|
||||
|
||||
|
||||
return TRUE;
|
||||
return true;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -71,8 +71,8 @@ struct Key
|
|||
|
||||
F32 mPos[3];
|
||||
F32 mRot[3];
|
||||
BOOL mIgnorePos;
|
||||
BOOL mIgnoreRot;
|
||||
bool mIgnorePos;
|
||||
bool mIgnoreRot;
|
||||
};
|
||||
|
||||
|
||||
|
|
@ -89,10 +89,10 @@ struct Joint
|
|||
Joint(const char *name)
|
||||
{
|
||||
mName = name;
|
||||
mIgnore = FALSE;
|
||||
mIgnorePositions = FALSE;
|
||||
mRelativePositionKey = FALSE;
|
||||
mRelativeRotationKey = FALSE;
|
||||
mIgnore = false;
|
||||
mIgnorePositions = false;
|
||||
mRelativePositionKey = false;
|
||||
mRelativeRotationKey = false;
|
||||
mOutName = name;
|
||||
mOrder[0] = 'X';
|
||||
mOrder[1] = 'Y';
|
||||
|
|
@ -111,10 +111,10 @@ struct Joint
|
|||
LLVector3 mRelativePosition;
|
||||
//
|
||||
std::string mName;
|
||||
BOOL mIgnore;
|
||||
BOOL mIgnorePositions;
|
||||
BOOL mRelativePositionKey;
|
||||
BOOL mRelativeRotationKey;
|
||||
bool mIgnore;
|
||||
bool mIgnorePositions;
|
||||
bool mRelativePositionKey;
|
||||
bool mRelativeRotationKey;
|
||||
std::string mOutName;
|
||||
std::string mMergeParentName;
|
||||
std::string mMergeChildName;
|
||||
|
|
@ -161,18 +161,18 @@ class Translation
|
|||
public:
|
||||
Translation()
|
||||
{
|
||||
mIgnore = FALSE;
|
||||
mIgnorePositions = FALSE;
|
||||
mRelativePositionKey = FALSE;
|
||||
mRelativeRotationKey = FALSE;
|
||||
mIgnore = false;
|
||||
mIgnorePositions = false;
|
||||
mRelativePositionKey = false;
|
||||
mRelativeRotationKey = false;
|
||||
mPriorityModifier = 0;
|
||||
}
|
||||
|
||||
std::string mOutName;
|
||||
BOOL mIgnore;
|
||||
BOOL mIgnorePositions;
|
||||
BOOL mRelativePositionKey;
|
||||
BOOL mRelativeRotationKey;
|
||||
bool mIgnore;
|
||||
bool mIgnorePositions;
|
||||
bool mRelativePositionKey;
|
||||
bool mRelativeRotationKey;
|
||||
LLMatrix3 mFrameMatrix;
|
||||
LLMatrix3 mOffsetMatrix;
|
||||
LLVector3 mRelativePosition;
|
||||
|
|
@ -293,7 +293,7 @@ public:
|
|||
U32 getOutputSize();
|
||||
|
||||
// writes contents to datapacker
|
||||
BOOL serialize(LLDataPacker& dp);
|
||||
bool serialize(LLDataPacker& dp);
|
||||
|
||||
// flags redundant keyframe data
|
||||
void optimize();
|
||||
|
|
@ -302,13 +302,13 @@ public:
|
|||
|
||||
F32 getDuration() { return mDuration; }
|
||||
|
||||
BOOL isInitialized() { return mInitialized; }
|
||||
bool isInitialized() { return mInitialized; }
|
||||
|
||||
ELoadStatus getStatus() { return mStatus; }
|
||||
|
||||
protected:
|
||||
// Consumes one line of input from file.
|
||||
BOOL getLine(apr_file_t *fp);
|
||||
bool getLine(apr_file_t *fp);
|
||||
|
||||
// parser state
|
||||
char mLine[BVH_PARSER_LINE_SIZE]; /* Flawfinder: ignore */
|
||||
|
|
@ -322,7 +322,7 @@ protected:
|
|||
TranslationMap mTranslations;
|
||||
|
||||
S32 mPriority;
|
||||
BOOL mLoop;
|
||||
bool mLoop;
|
||||
F32 mLoopInPoint;
|
||||
F32 mLoopOutPoint;
|
||||
F32 mEaseIn;
|
||||
|
|
@ -330,7 +330,7 @@ protected:
|
|||
S32 mHand;
|
||||
std::string mEmoteName;
|
||||
|
||||
BOOL mInitialized;
|
||||
bool mInitialized;
|
||||
ELoadStatus mStatus;
|
||||
|
||||
// computed values
|
||||
|
|
|
|||
|
|
@ -38,8 +38,8 @@
|
|||
|
||||
LLStringTable LLCharacter::sVisualParamNames(1024);
|
||||
|
||||
std::vector< LLCharacter* > LLCharacter::sInstances;
|
||||
BOOL LLCharacter::sAllowInstancesChange = TRUE ;
|
||||
std::list< LLCharacter* > LLCharacter::sInstances;
|
||||
bool LLCharacter::sAllowInstancesChange = true ;
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
// LLCharacter()
|
||||
|
|
@ -53,7 +53,6 @@ LLCharacter::LLCharacter()
|
|||
mSkeletonSerialNum( 0 )
|
||||
{
|
||||
llassert_always(sAllowInstancesChange) ;
|
||||
sInstances.push_back(this);
|
||||
|
||||
mMotionController.setCharacter( this );
|
||||
mPauseRequest = new LLPauseRequestHandle();
|
||||
|
|
@ -66,28 +65,12 @@ LLCharacter::LLCharacter()
|
|||
//-----------------------------------------------------------------------------
|
||||
LLCharacter::~LLCharacter()
|
||||
{
|
||||
for (LLVisualParam *param = getFirstVisualParam();
|
||||
param;
|
||||
param = getNextVisualParam())
|
||||
for (const auto& it : mVisualParamIndexMap)
|
||||
{
|
||||
delete param;
|
||||
delete it.second;
|
||||
}
|
||||
|
||||
U32 i ;
|
||||
U32 size = sInstances.size() ;
|
||||
for(i = 0 ; i < size ; i++)
|
||||
{
|
||||
if(sInstances[i] == this)
|
||||
{
|
||||
break ;
|
||||
}
|
||||
}
|
||||
|
||||
llassert_always(i < size) ;
|
||||
|
||||
llassert_always(sAllowInstancesChange) ;
|
||||
sInstances[i] = sInstances[size - 1] ;
|
||||
sInstances.pop_back() ;
|
||||
}
|
||||
|
||||
|
||||
|
|
@ -114,7 +97,7 @@ LLJoint *LLCharacter::getJoint( const std::string &name )
|
|||
//-----------------------------------------------------------------------------
|
||||
// registerMotion()
|
||||
//-----------------------------------------------------------------------------
|
||||
BOOL LLCharacter::registerMotion( const LLUUID& id, LLMotionConstructor create )
|
||||
bool LLCharacter::registerMotion( const LLUUID& id, LLMotionConstructor create )
|
||||
{
|
||||
return mMotionController.registerMotion(id, create);
|
||||
}
|
||||
|
|
@ -147,7 +130,7 @@ LLMotion* LLCharacter::createMotion( const LLUUID &id )
|
|||
//-----------------------------------------------------------------------------
|
||||
// startMotion()
|
||||
//-----------------------------------------------------------------------------
|
||||
BOOL LLCharacter::startMotion(const LLUUID &id, F32 start_offset)
|
||||
bool LLCharacter::startMotion(const LLUUID &id, F32 start_offset)
|
||||
{
|
||||
return mMotionController.startMotion(id, start_offset);
|
||||
}
|
||||
|
|
@ -156,7 +139,7 @@ BOOL LLCharacter::startMotion(const LLUUID &id, F32 start_offset)
|
|||
//-----------------------------------------------------------------------------
|
||||
// stopMotion()
|
||||
//-----------------------------------------------------------------------------
|
||||
BOOL LLCharacter::stopMotion(const LLUUID& id, BOOL stop_immediate)
|
||||
bool LLCharacter::stopMotion(const LLUUID& id, bool stop_immediate)
|
||||
{
|
||||
return mMotionController.stopMotionLocally(id, stop_immediate);
|
||||
}
|
||||
|
|
@ -164,7 +147,7 @@ BOOL LLCharacter::stopMotion(const LLUUID& id, BOOL stop_immediate)
|
|||
//-----------------------------------------------------------------------------
|
||||
// isMotionActive()
|
||||
//-----------------------------------------------------------------------------
|
||||
BOOL LLCharacter::isMotionActive(const LLUUID& id)
|
||||
bool LLCharacter::isMotionActive(const LLUUID& id)
|
||||
{
|
||||
LLMotion *motionp = mMotionController.findMotion(id);
|
||||
if (motionp)
|
||||
|
|
@ -172,7 +155,7 @@ BOOL LLCharacter::isMotionActive(const LLUUID& id)
|
|||
return mMotionController.isMotionActive(motionp);
|
||||
}
|
||||
|
||||
return FALSE;
|
||||
return false;
|
||||
}
|
||||
|
||||
|
||||
|
|
@ -279,22 +262,22 @@ void LLCharacter::removeAnimationData(std::string name)
|
|||
//-----------------------------------------------------------------------------
|
||||
// setVisualParamWeight()
|
||||
//-----------------------------------------------------------------------------
|
||||
BOOL LLCharacter::setVisualParamWeight(const LLVisualParam* which_param, F32 weight)
|
||||
bool LLCharacter::setVisualParamWeight(const LLVisualParam* which_param, F32 weight)
|
||||
{
|
||||
S32 index = which_param->getID();
|
||||
visual_param_index_map_t::iterator index_iter = mVisualParamIndexMap.find(index);
|
||||
if (index_iter != mVisualParamIndexMap.end())
|
||||
{
|
||||
index_iter->second->setWeight(weight);
|
||||
return TRUE;
|
||||
return true;
|
||||
}
|
||||
return FALSE;
|
||||
return false;
|
||||
}
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
// setVisualParamWeight()
|
||||
//-----------------------------------------------------------------------------
|
||||
BOOL LLCharacter::setVisualParamWeight(const char* param_name, F32 weight)
|
||||
bool LLCharacter::setVisualParamWeight(const char* param_name, F32 weight)
|
||||
{
|
||||
std::string tname(param_name);
|
||||
LLStringUtil::toLower(tname);
|
||||
|
|
@ -303,25 +286,25 @@ BOOL LLCharacter::setVisualParamWeight(const char* param_name, F32 weight)
|
|||
if (name_iter != mVisualParamNameMap.end())
|
||||
{
|
||||
name_iter->second->setWeight(weight);
|
||||
return TRUE;
|
||||
return true;
|
||||
}
|
||||
LL_WARNS() << "LLCharacter::setVisualParamWeight() Invalid visual parameter: " << param_name << LL_ENDL;
|
||||
return FALSE;
|
||||
return false;
|
||||
}
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
// setVisualParamWeight()
|
||||
//-----------------------------------------------------------------------------
|
||||
BOOL LLCharacter::setVisualParamWeight(S32 index, F32 weight)
|
||||
bool LLCharacter::setVisualParamWeight(S32 index, F32 weight)
|
||||
{
|
||||
visual_param_index_map_t::iterator index_iter = mVisualParamIndexMap.find(index);
|
||||
if (index_iter != mVisualParamIndexMap.end())
|
||||
{
|
||||
index_iter->second->setWeight(weight);
|
||||
return TRUE;
|
||||
return true;
|
||||
}
|
||||
LL_WARNS() << "LLCharacter::setVisualParamWeight() Invalid visual parameter index: " << index << LL_ENDL;
|
||||
return FALSE;
|
||||
return false;
|
||||
}
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
|
|
|
|||
|
|
@ -125,7 +125,7 @@ public:
|
|||
//-------------------------------------------------------------------------
|
||||
// registers a motion with the character
|
||||
// returns true if successfull
|
||||
BOOL registerMotion( const LLUUID& id, LLMotionConstructor create );
|
||||
bool registerMotion( const LLUUID& id, LLMotionConstructor create );
|
||||
|
||||
void removeMotion( const LLUUID& id );
|
||||
|
||||
|
|
@ -137,13 +137,13 @@ public:
|
|||
|
||||
// start a motion
|
||||
// returns true if successful, false if an error occurred
|
||||
virtual BOOL startMotion( const LLUUID& id, F32 start_offset = 0.f);
|
||||
virtual bool startMotion( const LLUUID& id, F32 start_offset = 0.f);
|
||||
|
||||
// stop a motion
|
||||
virtual BOOL stopMotion( const LLUUID& id, BOOL stop_immediate = FALSE );
|
||||
virtual bool stopMotion( const LLUUID& id, bool stop_immediate = false );
|
||||
|
||||
// is this motion active?
|
||||
BOOL isMotionActive( const LLUUID& id );
|
||||
bool isMotionActive( const LLUUID& id );
|
||||
|
||||
// Event handler for motion deactivation.
|
||||
// Called when a motion has completely stopped and has been deactivated.
|
||||
|
|
@ -156,7 +156,7 @@ public:
|
|||
void updateMotions(e_update_t update_type);
|
||||
|
||||
LLAnimPauseRequest requestPause();
|
||||
BOOL areAnimationsPaused() const { return mMotionController.isPaused(); }
|
||||
bool areAnimationsPaused() const { return mMotionController.isPaused(); }
|
||||
void setAnimTimeFactor(F32 factor) { mMotionController.setTimeFactor(factor); }
|
||||
void setTimeStep(F32 time_step) { mMotionController.setTimeStep(time_step); }
|
||||
|
||||
|
|
@ -190,9 +190,9 @@ public:
|
|||
void addVisualParam(LLVisualParam *param);
|
||||
void addSharedVisualParam(LLVisualParam *param);
|
||||
|
||||
virtual BOOL setVisualParamWeight(const LLVisualParam *which_param, F32 weight);
|
||||
virtual BOOL setVisualParamWeight(const char* param_name, F32 weight);
|
||||
virtual BOOL setVisualParamWeight(S32 index, F32 weight);
|
||||
virtual bool setVisualParamWeight(const LLVisualParam *which_param, F32 weight);
|
||||
virtual bool setVisualParamWeight(const char* param_name, F32 weight);
|
||||
virtual bool setVisualParamWeight(S32 index, F32 weight);
|
||||
|
||||
// get visual param weight by param or name
|
||||
F32 getVisualParamWeight(LLVisualParam *distortion);
|
||||
|
|
@ -245,6 +245,24 @@ public:
|
|||
S32 getVisualParamCount() const { return (S32)mVisualParamIndexMap.size(); }
|
||||
LLVisualParam* getVisualParam(const char *name);
|
||||
|
||||
void animateTweakableVisualParams(F32 delta)
|
||||
{
|
||||
for (auto& it : mVisualParamIndexMap)
|
||||
{
|
||||
if (it.second->isTweakable())
|
||||
{
|
||||
it.second->animate(delta);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void applyAllVisualParams(ESex avatar_sex)
|
||||
{
|
||||
for (auto& it : mVisualParamIndexMap)
|
||||
{
|
||||
it.second->apply(avatar_sex);
|
||||
}
|
||||
}
|
||||
|
||||
ESex getSex() const { return mSex; }
|
||||
void setSex( ESex sex ) { mSex = sex; }
|
||||
|
|
@ -255,8 +273,8 @@ public:
|
|||
U32 getSkeletonSerialNum() const { return mSkeletonSerialNum; }
|
||||
void setSkeletonSerialNum( U32 num ) { mSkeletonSerialNum = num; }
|
||||
|
||||
static std::vector< LLCharacter* > sInstances;
|
||||
static BOOL sAllowInstancesChange ; //debug use
|
||||
static std::list< LLCharacter* > sInstances;
|
||||
static bool sAllowInstancesChange ; //debug use
|
||||
|
||||
virtual void setHoverOffset(const LLVector3& hover_offset, bool send_update=true) { mHoverOffset = hover_offset; }
|
||||
const LLVector3& getHoverOffset() const { return mHoverOffset; }
|
||||
|
|
|
|||
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in New Issue