Merge branch 'master' of https://vcs.firestormviewer.org/phoenix-firestorm
# Conflicts: # indra/llcommon/llsdserialize.cpp # indra/llcommon/llsdserialize.h # indra/newview/llmeshrepository.cppmaster
commit
7731ee8d50
|
|
@ -44,15 +44,28 @@ jobs:
|
|||
run: echo "FS_GRID=-DOPENSIM:BOOL=ON" >> $GITHUB_ENV
|
||||
shell: bash
|
||||
|
||||
- name: Set channel name
|
||||
if: matrix.addrsize == '64'
|
||||
run: echo "FS_RELEASE_CHAN=Releasex64" >> $GITHUB_ENV
|
||||
- name: find channel from Branch name
|
||||
run: |
|
||||
if [[ "${{ github.ref_name }}" == *"Release"* ]]; then
|
||||
FS_RELEASE_CHAN="Release"
|
||||
else
|
||||
FS_RELEASE_CHAN="Beta"
|
||||
fi
|
||||
if [[ "${{ matrix.addrsize }}" == "64" ]]; then
|
||||
FS_RELEASE_CHAN="${FS_RELEASE_CHAN}x64"
|
||||
fi
|
||||
echo "FS_RELEASE_CHAN=\"${FS_RELEASE_CHAN}\"" >> $GITHUB_ENV
|
||||
echo "Building for channel ${FS_RELEASE_CHAN}"
|
||||
shell: bash
|
||||
|
||||
- name: Set channel name for 32 bit
|
||||
if: matrix.addrsize == '32'
|
||||
run: echo "FS_RELEASE_CHAN=Release" >> $GITHUB_ENV
|
||||
shell: bash
|
||||
# - name: Set channel name
|
||||
# if: matrix.addrsize == '64'
|
||||
# run: echo "FS_RELEASE_CHAN=Releasex64" >> $GITHUB_ENV
|
||||
# shell: bash
|
||||
|
||||
# - name: Set channel name for 32 bit
|
||||
# if: matrix.addrsize == '32'
|
||||
# shell: bash
|
||||
|
||||
- name: Set SL flag
|
||||
if: matrix.grid == 'sl'
|
||||
|
|
|
|||
|
|
@ -19,12 +19,8 @@ debian/files
|
|||
debian/secondlife-appearance-utility*
|
||||
debian/secondlife-viewer*
|
||||
indra/.distcc
|
||||
build-vc80/
|
||||
build-vc100/
|
||||
build-vc120/
|
||||
build-vc[0-9]*-32*/
|
||||
build-vc[0-9]*-64*/
|
||||
build-vc160-64/
|
||||
build-vc[0-9]*-32**
|
||||
build-vc[0-9]*-64**
|
||||
indra/CMakeFiles
|
||||
indra/build-vc[0-9]*
|
||||
indra/lib/mono/1.0/*.dll
|
||||
|
|
|
|||
|
|
@ -540,9 +540,9 @@
|
|||
<key>archive</key>
|
||||
<map>
|
||||
<key>hash</key>
|
||||
<string>b6357ef3a0ec37877a5831820f25094e</string>
|
||||
<string>178b16ee9ff67986c8c14413ee68218e</string>
|
||||
<key>url</key>
|
||||
<string>https://automated-builds-secondlife-com.s3.amazonaws.com/ct2/80557/759704/apr_suite-1.4.5.558565-darwin64-558565.tar.bz2</string>
|
||||
<string>https://automated-builds-secondlife-com.s3.amazonaws.com/ct2/107593/938535/apr_suite-1.4.5.576669-darwin64-576669.tar.bz2</string>
|
||||
</map>
|
||||
<key>name</key>
|
||||
<string>darwin64</string>
|
||||
|
|
@ -552,9 +552,9 @@
|
|||
<key>archive</key>
|
||||
<map>
|
||||
<key>hash</key>
|
||||
<string>5c3c29851edd837d5f9518618c4a303b</string>
|
||||
<string>45acdda717f95ce9169de9f49199c066</string>
|
||||
<key>url</key>
|
||||
<string>http://3p.firestormviewer.org/apr_suite-1.4.5.180841559-linux64-180841559.tar.bz2</string>
|
||||
<string>http://3p.firestormviewer.org/apr_suite-1.4.5.230351228-linux64-230351228.tar.bz2</string>
|
||||
</map>
|
||||
<key>name</key>
|
||||
<string>linux64</string>
|
||||
|
|
@ -564,9 +564,9 @@
|
|||
<key>archive</key>
|
||||
<map>
|
||||
<key>hash</key>
|
||||
<string>cb48ac069440f6dcd564cfa9fd02a4c2</string>
|
||||
<string>d2997cad03dbd0d70a060276b5671480</string>
|
||||
<key>url</key>
|
||||
<string>https://automated-builds-secondlife-com.s3.amazonaws.com/ct2/80556/759710/apr_suite-1.4.5.558565-windows-558565.tar.bz2</string>
|
||||
<string>https://automated-builds-secondlife-com.s3.amazonaws.com/ct2/107594/938548/apr_suite-1.4.5.576669-windows-576669.tar.bz2</string>
|
||||
</map>
|
||||
<key>name</key>
|
||||
<string>windows</string>
|
||||
|
|
@ -576,16 +576,16 @@
|
|||
<key>archive</key>
|
||||
<map>
|
||||
<key>hash</key>
|
||||
<string>646dc3828d9c39fb1e77c4eec44ed739</string>
|
||||
<string>ec24f5945faa8f13807b83eeaeb994f8</string>
|
||||
<key>url</key>
|
||||
<string>https://automated-builds-secondlife-com.s3.amazonaws.com/ct2/80555/759709/apr_suite-1.4.5.558565-windows64-558565.tar.bz2</string>
|
||||
<string>https://automated-builds-secondlife-com.s3.amazonaws.com/ct2/107592/938547/apr_suite-1.4.5.576669-windows64-576669.tar.bz2</string>
|
||||
</map>
|
||||
<key>name</key>
|
||||
<string>windows64</string>
|
||||
</map>
|
||||
</map>
|
||||
<key>version</key>
|
||||
<string>1.4.5.558565</string>
|
||||
<string>1.4.5.576669</string>
|
||||
</map>
|
||||
<key>boost</key>
|
||||
<map>
|
||||
|
|
@ -988,9 +988,9 @@
|
|||
<key>archive</key>
|
||||
<map>
|
||||
<key>hash</key>
|
||||
<string>d3f4d83e7b81673731ece92125473b00</string>
|
||||
<string>ad7b9fc10184e8145731f45ae400bfd1</string>
|
||||
<key>url</key>
|
||||
<string>http://3p.firestormviewer.org/dullahan-1.12.2.202209171157_91.1.23_g04c8d56_chromium-91.0.4472.164-linux64-222600157.tar.bz2</string>
|
||||
<string>http://3p.firestormviewer.org/dullahan-1.12.2.202210012157_92.0.27_g274abcf_chromium-92.0.4515.159-linux64-222741156.tar.bz2</string>
|
||||
</map>
|
||||
<key>name</key>
|
||||
<string>linux64</string>
|
||||
|
|
@ -1098,11 +1098,11 @@
|
|||
<key>archive</key>
|
||||
<map>
|
||||
<key>hash</key>
|
||||
<string>a45bb657d668b7f1b4fa4c88eb81a80a</string>
|
||||
<string>e610f49fa7ed5b10b0cc6409b9bf4afc</string>
|
||||
<key>hash_algorithm</key>
|
||||
<string>md5</string>
|
||||
<key>url</key>
|
||||
<string>file:///opt/firestorm/fmodstudio-2.02.09-linux64-222891103.tar.bz2</string>
|
||||
<string>file:///opt/firestorm/fmodstudio-2.02.11-linux64-230190114.tar.bz2</string>
|
||||
</map>
|
||||
<key>name</key>
|
||||
<string>linux64</string>
|
||||
|
|
@ -1112,11 +1112,11 @@
|
|||
<key>archive</key>
|
||||
<map>
|
||||
<key>hash</key>
|
||||
<string>6dd278518e791dbc2841e337feb295db</string>
|
||||
<string>8b2fff1a0a7e057da99fdade1f9e82ff</string>
|
||||
<key>hash_algorithm</key>
|
||||
<string>md5</string>
|
||||
<key>url</key>
|
||||
<string>file:///c:/cygwin/opt/firestorm/fmodstudio-2.02.09-windows-222890940.tar.bz2</string>
|
||||
<string>file:///c:/cygwin/opt/firestorm/fmodstudio-2.02.11-windows-230181802.tar.bz2</string>
|
||||
</map>
|
||||
<key>name</key>
|
||||
<string>windows</string>
|
||||
|
|
@ -1126,18 +1126,18 @@
|
|||
<key>archive</key>
|
||||
<map>
|
||||
<key>hash</key>
|
||||
<string>1b7ced6f750b12f0d014556705019534</string>
|
||||
<string>6cf457e2268ed83326c6d77f3475e8f5</string>
|
||||
<key>hash_algorithm</key>
|
||||
<string>md5</string>
|
||||
<key>url</key>
|
||||
<string>file:///c:/cygwin/opt/firestorm/fmodstudio-2.02.09-windows64-222890941.tar.bz2</string>
|
||||
<string>file:///c:/cygwin/opt/firestorm/fmodstudio-2.02.11-windows64-230181820.tar.bz2</string>
|
||||
</map>
|
||||
<key>name</key>
|
||||
<string>windows64</string>
|
||||
</map>
|
||||
</map>
|
||||
<key>version</key>
|
||||
<string>2.02.09</string>
|
||||
<string>2.02.11</string>
|
||||
</map>
|
||||
<key>fontconfig</key>
|
||||
<map>
|
||||
|
|
@ -1892,9 +1892,9 @@
|
|||
<key>archive</key>
|
||||
<map>
|
||||
<key>hash</key>
|
||||
<string>c1c9e32e21f3c34d91ed045b2ca91f24</string>
|
||||
<string>7a0059748d0b8733f2f9ce434cf604b8</string>
|
||||
<key>url</key>
|
||||
<string>https://automated-builds-secondlife-com.s3.amazonaws.com/ct2/87781/805801/libpng-1.6.8.563850-darwin64-563850.tar.bz2</string>
|
||||
<string>https://automated-builds-secondlife-com.s3.amazonaws.com/ct2/107514/937867/libpng-1.6.38.576621-darwin64-576621.tar.bz2</string>
|
||||
</map>
|
||||
<key>name</key>
|
||||
<string>darwin64</string>
|
||||
|
|
@ -1916,9 +1916,9 @@
|
|||
<key>archive</key>
|
||||
<map>
|
||||
<key>hash</key>
|
||||
<string>642e9cf95c8ccd0eb34f6d7a40df585a</string>
|
||||
<string>3112013186ad60b0fc270a398d4dd499</string>
|
||||
<key>url</key>
|
||||
<string>https://automated-builds-secondlife-com.s3.amazonaws.com/ct2/87782/805831/libpng-1.6.8.563850-windows-563850.tar.bz2</string>
|
||||
<string>https://automated-builds-secondlife-com.s3.amazonaws.com/ct2/107513/937823/libpng-1.6.38.576621-windows-576621.tar.bz2</string>
|
||||
</map>
|
||||
<key>name</key>
|
||||
<string>windows</string>
|
||||
|
|
@ -1928,16 +1928,16 @@
|
|||
<key>archive</key>
|
||||
<map>
|
||||
<key>hash</key>
|
||||
<string>ce46aa0f171d97626c4a3940347cecd7</string>
|
||||
<string>7c6bfcdb0d6162587cdbc436f595dd02</string>
|
||||
<key>url</key>
|
||||
<string>https://automated-builds-secondlife-com.s3.amazonaws.com/ct2/87780/805832/libpng-1.6.8.563850-windows64-563850.tar.bz2</string>
|
||||
<string>https://automated-builds-secondlife-com.s3.amazonaws.com/ct2/107512/937822/libpng-1.6.38.576621-windows64-576621.tar.bz2</string>
|
||||
</map>
|
||||
<key>name</key>
|
||||
<string>windows64</string>
|
||||
</map>
|
||||
</map>
|
||||
<key>version</key>
|
||||
<string>1.6.8.563850</string>
|
||||
<string>1.6.38.576621</string>
|
||||
</map>
|
||||
<key>libuuid</key>
|
||||
<map>
|
||||
|
|
@ -2217,9 +2217,9 @@
|
|||
<key>archive</key>
|
||||
<map>
|
||||
<key>hash</key>
|
||||
<string>e584491b67916c502233b23c6e4e44be</string>
|
||||
<string>8ee0979f3808568b5d8940b9b4f52e94</string>
|
||||
<key>url</key>
|
||||
<string>file:///opt/firestorm/llphysicsextensions_tpv-1.0.571939-darwin64-571939.tar.bz2</string>
|
||||
<string>file:///opt/firestorm/llphysicsextensions_tpv-1.0.577418-darwin64-577418.tar.bz2</string>
|
||||
</map>
|
||||
<key>name</key>
|
||||
<string>darwin64</string>
|
||||
|
|
@ -2241,9 +2241,9 @@
|
|||
<key>archive</key>
|
||||
<map>
|
||||
<key>hash</key>
|
||||
<string>534b3af2266f37151e629af7552f4cf2</string>
|
||||
<string>7638421f5df1fef9f98d608be8d8de14</string>
|
||||
<key>url</key>
|
||||
<string>file:///c:/cygwin/opt/firestorm/llphysicsextensions_tpv-1.0.571939-windows-571939.tar.bz2</string>
|
||||
<string>file:///c:/cygwin/opt/firestorm/llphysicsextensions_tpv-1.0.577418-windows-577418.tar.bz2</string>
|
||||
</map>
|
||||
<key>name</key>
|
||||
<string>windows</string>
|
||||
|
|
@ -2253,16 +2253,16 @@
|
|||
<key>archive</key>
|
||||
<map>
|
||||
<key>hash</key>
|
||||
<string>9c39018c783443ee4b4eb368c937aeb3</string>
|
||||
<string>c0ccb2a5d721ea130c1e05c4f223e0ec</string>
|
||||
<key>url</key>
|
||||
<string>file:///c:/cygwin/opt/firestorm/llphysicsextensions_tpv-1.0.571939-windows64-571939.tar.bz2</string>
|
||||
<string>file:///c:/cygwin/opt/firestorm/llphysicsextensions_tpv-1.0.577418-windows64-577418.tar.bz2</string>
|
||||
</map>
|
||||
<key>name</key>
|
||||
<string>windows</string>
|
||||
</map>
|
||||
</map>
|
||||
<key>version</key>
|
||||
<string>1.0.571939</string>
|
||||
<string>1.0.577418</string>
|
||||
</map>
|
||||
<key>mesa</key>
|
||||
<map>
|
||||
|
|
@ -2708,9 +2708,9 @@ Copyright (c) 2012, 2014, 2015, 2016 nghttp2 contributors</string>
|
|||
<key>archive</key>
|
||||
<map>
|
||||
<key>hash</key>
|
||||
<string>53966a7ba6342395acb7ce15bc3fbe0a</string>
|
||||
<string>8114c6a7e499ea20d325db0de08ce30a</string>
|
||||
<key>url</key>
|
||||
<string>http://3p.firestormviewer.org/openjpeg-2.3.1.203000304-darwin-203000304.tar.bz2</string>
|
||||
<string>https://automated-builds-secondlife-com.s3.amazonaws.com/ct2/105469/923024/openjpeg-2.5.0.575496-darwin64-575496.tar.bz2</string>
|
||||
</map>
|
||||
<key>name</key>
|
||||
<string>darwin64</string>
|
||||
|
|
@ -2720,9 +2720,9 @@ Copyright (c) 2012, 2014, 2015, 2016 nghttp2 contributors</string>
|
|||
<key>archive</key>
|
||||
<map>
|
||||
<key>hash</key>
|
||||
<string>b7be1d6116fb5848ab2beef19b6a8b15</string>
|
||||
<string>b1dad7c841118a3b6e03a01722d1846a</string>
|
||||
<key>url</key>
|
||||
<string>http://3p.firestormviewer.org/openjpeg-2.3.1.202991551-linux64-202991551.tar.bz2</string>
|
||||
<string>http://3p.firestormviewer.org/openjpeg-2.5.0.230362345-linux64-230362345.tar.bz2</string>
|
||||
</map>
|
||||
<key>name</key>
|
||||
<string>linux64</string>
|
||||
|
|
@ -2732,9 +2732,9 @@ Copyright (c) 2012, 2014, 2015, 2016 nghttp2 contributors</string>
|
|||
<key>archive</key>
|
||||
<map>
|
||||
<key>hash</key>
|
||||
<string>ba2034b4a372fd46c3e09f56bede38a7</string>
|
||||
<string>edc9388870d951632a6d595792293e05</string>
|
||||
<key>url</key>
|
||||
<string>http://3p.firestormviewer.org/openjpeg-2.4.0.211361403-windows-211361403.tar.bz2</string>
|
||||
<string>https://automated-builds-secondlife-com.s3.amazonaws.com/ct2/105472/923036/openjpeg-2.5.0.575496-windows-575496.tar.bz2</string>
|
||||
</map>
|
||||
<key>name</key>
|
||||
<string>windows</string>
|
||||
|
|
@ -2744,16 +2744,16 @@ Copyright (c) 2012, 2014, 2015, 2016 nghttp2 contributors</string>
|
|||
<key>archive</key>
|
||||
<map>
|
||||
<key>hash</key>
|
||||
<string>d7ac606703a9330a2d8a3f7276cb6894</string>
|
||||
<string>b95f0732f2388ebb0ddf33d4a30e0ff1</string>
|
||||
<key>url</key>
|
||||
<string>http://3p.firestormviewer.org/openjpeg-2.4.0.211361407-windows64-211361407.tar.bz2</string>
|
||||
<string>https://automated-builds-secondlife-com.s3.amazonaws.com/ct2/105471/923037/openjpeg-2.5.0.575496-windows64-575496.tar.bz2</string>
|
||||
</map>
|
||||
<key>name</key>
|
||||
<string>windows64</string>
|
||||
</map>
|
||||
</map>
|
||||
<key>version</key>
|
||||
<string>2.4.0</string>
|
||||
<string>2.5.0.575496</string>
|
||||
</map>
|
||||
<key>openssl</key>
|
||||
<map>
|
||||
|
|
|
|||
|
|
@ -285,6 +285,7 @@ Beq Janus
|
|||
SL-15709
|
||||
SL-16021
|
||||
SL-16027
|
||||
SL-18592
|
||||
SL-18637
|
||||
Beth Walcher
|
||||
Bezilon Kasei
|
||||
|
|
@ -376,6 +377,7 @@ Charlie Sazaland
|
|||
Chaser Zaks
|
||||
BUG-225599
|
||||
BUG-227485
|
||||
SL-16874
|
||||
Cherry Cheevers
|
||||
ChickyBabes Zuzu
|
||||
Chorazin Allen
|
||||
|
|
@ -1395,6 +1397,7 @@ Sovereign Engineer
|
|||
OPEN-343
|
||||
SL-11625
|
||||
BUG-229030
|
||||
SL-14696
|
||||
SL-14705
|
||||
SL-14706
|
||||
SL-14707
|
||||
|
|
@ -1402,6 +1405,12 @@ Sovereign Engineer
|
|||
SL-14732
|
||||
SL-15096
|
||||
SL-16127
|
||||
SL-18249
|
||||
SL-18394
|
||||
SL-18412
|
||||
SL-18497
|
||||
SL-18525
|
||||
SL-18534
|
||||
SpacedOut Frye
|
||||
VWR-34
|
||||
VWR-45
|
||||
|
|
@ -1664,6 +1673,8 @@ Zi Ree
|
|||
VWR-25588
|
||||
STORM-1790
|
||||
STORM-1842
|
||||
SL-18348
|
||||
SL-18593
|
||||
Zipherius Turas
|
||||
VWR-76
|
||||
VWR-77
|
||||
|
|
|
|||
|
|
@ -154,7 +154,7 @@ for dir in dirs:
|
|||
full_file = os.path.join(args.path_to_directory, dir, file)
|
||||
md5 = get_md5(full_file)
|
||||
base_name = os.path.basename(file)
|
||||
if "-Release-" in base_name:
|
||||
if "-Release-" in base_name or "-Beta-" in base_name:
|
||||
wordsize = "32"
|
||||
else:
|
||||
wordsize = "64"
|
||||
|
|
@ -191,20 +191,24 @@ for dir in dirs:
|
|||
platform = f"{platforms_printable[dir]}"
|
||||
for grid in ["SL", "OS"]:
|
||||
grid_printable = f"{grids_printable[grid]}"
|
||||
print (f"{platform} for {grid_printable} ({wordsize}-bit)")
|
||||
print ( "{}/{}/{}".format(download_root,dir,os.path.basename(file_dict[f"{grid}{dir}{wordsize}"])) )
|
||||
print ()
|
||||
print ( "MD5: {}".format(md5_dict[f"{grid}{dir}{wordsize}"]) )
|
||||
print ()
|
||||
if(dir == "windows"):
|
||||
# Need to do 32 bit as well
|
||||
wordsize = "32"
|
||||
try:
|
||||
print (f"{platform} for {grid_printable} ({wordsize}-bit)")
|
||||
print ( "{}/{}/{}".format(download_root,dir,os.path.basename(file_dict[f"{grid}{dir}{wordsize}"])) )
|
||||
print ()
|
||||
print ( "MD5: {}".format(md5_dict[f"{grid}{dir}{wordsize}"]) )
|
||||
print ()
|
||||
wordsize = "64"
|
||||
if(dir == "windows"):
|
||||
# Need to do 32 bit as well
|
||||
wordsize = "32"
|
||||
print (f"{platform} for {grid_printable} ({wordsize}-bit)")
|
||||
print ( "{}/{}/{}".format(download_root,dir,os.path.basename(file_dict[f"{grid}{dir}{wordsize}"])) )
|
||||
print ()
|
||||
print ( "MD5: {}".format(md5_dict[f"{grid}{dir}{wordsize}"]) )
|
||||
print ()
|
||||
wordsize = "64"
|
||||
except KeyError:
|
||||
print (f"{platform} for {grid_printable} ({wordsize}-bit) - NOT AVAILABLE")
|
||||
print ()
|
||||
|
||||
print('''
|
||||
-------------------------------------------------------------------------------------------------------''')
|
||||
|
|
|
|||
|
|
@ -115,6 +115,9 @@ if(WINDOWS)
|
|||
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 1940) # 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)
|
||||
|
|
@ -250,11 +253,11 @@ elseif(LINUX)
|
|||
${EXPAT_COPY}
|
||||
libhunspell-1.3.so.0.0.0
|
||||
libopenal.so
|
||||
#libopenjpeg.so
|
||||
#libopenjp2.so
|
||||
libuuid.so.16
|
||||
libuuid.so.16.0.22
|
||||
libfontconfig.so.1.10.1
|
||||
libfontconfig.so.1
|
||||
#libfontconfig.so.1.10.1 # <FS:PC> fontconfig and freetype should be taken from the
|
||||
#libfontconfig.so.1 # user's system, and not be packaged with the viewer
|
||||
libaprutil-1.so.0
|
||||
libapr-1.so.0
|
||||
)
|
||||
|
|
|
|||
|
|
@ -16,9 +16,10 @@ FIND_PATH(OPENJPEG_INCLUDE_DIR openjpeg.h
|
|||
/usr/include/openjpeg-2.1
|
||||
/usr/include/openjpeg
|
||||
/usr/include
|
||||
include/openjpeg
|
||||
)
|
||||
|
||||
SET(OPENJPEG_NAMES ${OPENJPEG_NAMES} openjpeg openjp2)
|
||||
SET(OPENJPEG_NAMES ${OPENJPEG_NAMES} openjp2)
|
||||
FIND_LIBRARY(OPENJPEG_LIBRARY
|
||||
NAMES ${OPENJPEG_NAMES}
|
||||
PATHS /usr/lib /usr/local/lib
|
||||
|
|
|
|||
|
|
@ -6,14 +6,14 @@ if (USESYSTEMLIBS)
|
|||
|
||||
pkg_check_modules(FREETYPE REQUIRED freetype2)
|
||||
else (USESYSTEMLIBS)
|
||||
use_prebuilt_binary(freetype)
|
||||
set(FREETYPE_INCLUDE_DIRS ${LIBS_PREBUILT_DIR}/include)
|
||||
set(FREETYPE_INCLUDE_DIRS ${LIBS_PREBUILT_DIR}/include/freetype2) #<FS:ND/> Also add freetype2 to search dir, or some includes will fail.
|
||||
# <FS:ND> Linux links this via UI.cmake
|
||||
if( NOT LINUX )
|
||||
if (LINUX) # <FS:PC> linux fontconfig and freetype should come
|
||||
find_package(Freetype REQUIRED) # from the user's system
|
||||
else (LINUX) # Linux links this via llwindow/CMakeLists
|
||||
use_prebuilt_binary(freetype)
|
||||
set(FREETYPE_INCLUDE_DIRS ${LIBS_PREBUILT_DIR}/include)
|
||||
set(FREETYPE_INCLUDE_DIRS ${LIBS_PREBUILT_DIR}/include/freetype2) #<FS:ND/> Also add freetype2 to search dir, or some includes will fail.
|
||||
set(FREETYPE_LIBRARIES freetype)
|
||||
endif()
|
||||
# </FS:ND>
|
||||
endif (USESYSTEMLIBS)
|
||||
|
||||
link_directories(${FREETYPE_LIBRARY_DIRS})
|
||||
|
|
|
|||
|
|
@ -8,8 +8,7 @@ if (USESYSTEMLIBS)
|
|||
include(FindOpenJPEG)
|
||||
else (USESYSTEMLIBS)
|
||||
use_prebuilt_binary(openjpeg)
|
||||
|
||||
set(OPENJPEG_LIBRARIES openjp2)
|
||||
|
||||
set(OPENJPEG_LIBRARIES openjp2)
|
||||
set(OPENJPEG_INCLUDE_DIR ${LIBS_PREBUILT_DIR}/include/openjpeg)
|
||||
endif (USESYSTEMLIBS)
|
||||
|
|
|
|||
|
|
@ -47,7 +47,7 @@ else (USESYSTEMLIBS)
|
|||
if (LINUX)
|
||||
set(UI_LIB_NAMES
|
||||
libfltk.a
|
||||
libfreetype.a
|
||||
# libfreetype.a # <FS:PC> fontconfig and freetype should be taken from the user's system, and not be packaged with the viewer
|
||||
)
|
||||
|
||||
foreach(libname ${UI_LIB_NAMES})
|
||||
|
|
|
|||
|
|
@ -4,7 +4,8 @@ include(Prebuilt)
|
|||
if (NOT USESYSTEMLIBS)
|
||||
if (LINUX)
|
||||
use_prebuilt_binary(libuuid)
|
||||
use_prebuilt_binary(fontconfig)
|
||||
find_package(Fontconfig REQUIRED) # <FS:PC> fontconfig and freetype should be taken from the
|
||||
# use_prebuilt_binary(fontconfig) # user's system, and not be packaged with the viewer
|
||||
endif (LINUX)
|
||||
use_prebuilt_binary(libhunspell)
|
||||
use_prebuilt_binary(slvoice)
|
||||
|
|
|
|||
|
|
@ -296,7 +296,12 @@ LLAvatarAppearance::~LLAvatarAppearance()
|
|||
}
|
||||
}
|
||||
|
||||
if (mRoot) mRoot->removeAllChildren();
|
||||
if (mRoot)
|
||||
{
|
||||
mRoot->removeAllChildren();
|
||||
delete mRoot;
|
||||
mRoot = nullptr;
|
||||
}
|
||||
mJointMap.clear();
|
||||
|
||||
clearSkeleton();
|
||||
|
|
|
|||
|
|
@ -76,7 +76,7 @@ LLLocalTextureObject::LLLocalTextureObject(const LLLocalTextureObject& lto) :
|
|||
|
||||
LLLocalTextureObject::~LLLocalTextureObject()
|
||||
{
|
||||
delete_and_clear(mTexLayers); // <FS:Ansariel> Mem-leak fix by Drake Arconis
|
||||
delete_and_clear(mTexLayers);
|
||||
}
|
||||
|
||||
LLGLTexture* LLLocalTextureObject::getImage() const
|
||||
|
|
|
|||
|
|
@ -1224,7 +1224,7 @@ void LLKeyframeMotion::applyConstraint(JointConstraint* constraint, F32 time, U8
|
|||
BOOL LLKeyframeMotion::deserialize(LLDataPacker& dp, const LLUUID& asset_id, bool allow_invalid_joints)
|
||||
{
|
||||
BOOL old_version = FALSE;
|
||||
mJointMotionList = new LLKeyframeMotion::JointMotionList;
|
||||
std::unique_ptr<LLKeyframeMotion::JointMotionList> joint_motion_list(new LLKeyframeMotion::JointMotionList);
|
||||
|
||||
//-------------------------------------------------------------------------
|
||||
// get base priority
|
||||
|
|
@ -1236,14 +1236,12 @@ BOOL LLKeyframeMotion::deserialize(LLDataPacker& dp, const LLUUID& asset_id, boo
|
|||
if (!dp.unpackU16(version, "version"))
|
||||
{
|
||||
LL_WARNS() << "can't read version number for animation " << asset_id << LL_ENDL;
|
||||
delete mJointMotionList; // <FS:Ansariel> Mem-leak fix by Drake Arconis
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
if (!dp.unpackU16(sub_version, "sub_version"))
|
||||
{
|
||||
LL_WARNS() << "can't read sub version number for animation " << asset_id << LL_ENDL;
|
||||
delete mJointMotionList; // <FS:Ansariel> Mem-leak fix by Drake Arconis
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
|
|
@ -1256,7 +1254,6 @@ BOOL LLKeyframeMotion::deserialize(LLDataPacker& dp, const LLUUID& asset_id, boo
|
|||
#if LL_RELEASE
|
||||
LL_WARNS() << "Bad animation version " << version << "." << sub_version
|
||||
<< " for animation " << asset_id << LL_ENDL;
|
||||
delete mJointMotionList; // <FS:Ansariel> Mem-leak fix by Drake Arconis
|
||||
return FALSE;
|
||||
#else
|
||||
LL_ERRS() << "Bad animation version " << version << "." << sub_version
|
||||
|
|
@ -1268,89 +1265,80 @@ BOOL LLKeyframeMotion::deserialize(LLDataPacker& dp, const LLUUID& asset_id, boo
|
|||
{
|
||||
LL_WARNS() << "can't read animation base_priority"
|
||||
<< " for animation " << asset_id << LL_ENDL;
|
||||
delete mJointMotionList; // <FS:Ansariel> Mem-leak fix by Drake Arconis
|
||||
return FALSE;
|
||||
}
|
||||
mJointMotionList->mBasePriority = (LLJoint::JointPriority) temp_priority;
|
||||
joint_motion_list->mBasePriority = (LLJoint::JointPriority) temp_priority;
|
||||
|
||||
if (mJointMotionList->mBasePriority >= LLJoint::ADDITIVE_PRIORITY)
|
||||
if (joint_motion_list->mBasePriority >= LLJoint::ADDITIVE_PRIORITY)
|
||||
{
|
||||
mJointMotionList->mBasePriority = (LLJoint::JointPriority)((S32)LLJoint::ADDITIVE_PRIORITY-1);
|
||||
mJointMotionList->mMaxPriority = mJointMotionList->mBasePriority;
|
||||
joint_motion_list->mBasePriority = (LLJoint::JointPriority)((S32)LLJoint::ADDITIVE_PRIORITY-1);
|
||||
joint_motion_list->mMaxPriority = joint_motion_list->mBasePriority;
|
||||
}
|
||||
else if (mJointMotionList->mBasePriority < LLJoint::USE_MOTION_PRIORITY)
|
||||
else if (joint_motion_list->mBasePriority < LLJoint::USE_MOTION_PRIORITY)
|
||||
{
|
||||
LL_WARNS() << "bad animation base_priority " << mJointMotionList->mBasePriority
|
||||
LL_WARNS() << "bad animation base_priority " << joint_motion_list->mBasePriority
|
||||
<< " for animation " << asset_id << LL_ENDL;
|
||||
delete mJointMotionList; // <FS:Ansariel> Mem-leak fix by Drake Arconis
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
//-------------------------------------------------------------------------
|
||||
// get duration
|
||||
//-------------------------------------------------------------------------
|
||||
if (!dp.unpackF32(mJointMotionList->mDuration, "duration"))
|
||||
if (!dp.unpackF32(joint_motion_list->mDuration, "duration"))
|
||||
{
|
||||
LL_WARNS() << "can't read duration"
|
||||
<< " for animation " << asset_id << LL_ENDL;
|
||||
delete mJointMotionList; // <FS:Ansariel> Mem-leak fix by Drake Arconis
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
if (mJointMotionList->mDuration > MAX_ANIM_DURATION ||
|
||||
!llfinite(mJointMotionList->mDuration))
|
||||
if (joint_motion_list->mDuration > MAX_ANIM_DURATION ||
|
||||
!llfinite(joint_motion_list->mDuration))
|
||||
{
|
||||
LL_WARNS() << "invalid animation duration"
|
||||
<< " for animation " << asset_id << LL_ENDL;
|
||||
delete mJointMotionList; // <FS:Ansariel> Mem-leak fix by Drake Arconis
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
//-------------------------------------------------------------------------
|
||||
// get emote (optional)
|
||||
//-------------------------------------------------------------------------
|
||||
if (!dp.unpackString(mJointMotionList->mEmoteName, "emote_name"))
|
||||
if (!dp.unpackString(joint_motion_list->mEmoteName, "emote_name"))
|
||||
{
|
||||
LL_WARNS() << "can't read optional_emote_animation"
|
||||
<< " for animation " << asset_id << LL_ENDL;
|
||||
delete mJointMotionList; // <FS:Ansariel> Mem-leak fix by Drake Arconis
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
if(mJointMotionList->mEmoteName==mID.asString())
|
||||
if(joint_motion_list->mEmoteName==mID.asString())
|
||||
{
|
||||
LL_WARNS() << "Malformed animation mEmoteName==mID"
|
||||
<< " for animation " << asset_id << LL_ENDL;
|
||||
delete mJointMotionList; // <FS:Ansariel> Mem-leak fix by Drake Arconis
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
//-------------------------------------------------------------------------
|
||||
// get loop
|
||||
//-------------------------------------------------------------------------
|
||||
if (!dp.unpackF32(mJointMotionList->mLoopInPoint, "loop_in_point") ||
|
||||
!llfinite(mJointMotionList->mLoopInPoint))
|
||||
if (!dp.unpackF32(joint_motion_list->mLoopInPoint, "loop_in_point") ||
|
||||
!llfinite(joint_motion_list->mLoopInPoint))
|
||||
{
|
||||
LL_WARNS() << "can't read loop point"
|
||||
<< " for animation " << asset_id << LL_ENDL;
|
||||
delete mJointMotionList; // <FS:Ansariel> Mem-leak fix by Drake Arconis
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
if (!dp.unpackF32(mJointMotionList->mLoopOutPoint, "loop_out_point") ||
|
||||
!llfinite(mJointMotionList->mLoopOutPoint))
|
||||
if (!dp.unpackF32(joint_motion_list->mLoopOutPoint, "loop_out_point") ||
|
||||
!llfinite(joint_motion_list->mLoopOutPoint))
|
||||
{
|
||||
LL_WARNS() << "can't read loop point"
|
||||
<< " for animation " << asset_id << LL_ENDL;
|
||||
delete mJointMotionList; // <FS:Ansariel> Mem-leak fix by Drake Arconis
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
if (!dp.unpackS32(mJointMotionList->mLoop, "loop"))
|
||||
if (!dp.unpackS32(joint_motion_list->mLoop, "loop"))
|
||||
{
|
||||
LL_WARNS() << "can't read loop"
|
||||
<< " for animation " << asset_id << LL_ENDL;
|
||||
delete mJointMotionList; // <FS:Ansariel> Mem-leak fix by Drake Arconis
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
|
|
@ -1360,27 +1348,25 @@ BOOL LLKeyframeMotion::deserialize(LLDataPacker& dp, const LLUUID& asset_id, boo
|
|||
if (female_land_anim == asset_id || formal_female_land_anim == asset_id)
|
||||
{
|
||||
LL_WARNS() << "Animation(" << asset_id << ") won't be looped." << LL_ENDL;
|
||||
mJointMotionList->mLoop = FALSE;
|
||||
joint_motion_list->mLoop = FALSE;
|
||||
}
|
||||
|
||||
//-------------------------------------------------------------------------
|
||||
// get easeIn and easeOut
|
||||
//-------------------------------------------------------------------------
|
||||
if (!dp.unpackF32(mJointMotionList->mEaseInDuration, "ease_in_duration") ||
|
||||
!llfinite(mJointMotionList->mEaseInDuration))
|
||||
if (!dp.unpackF32(joint_motion_list->mEaseInDuration, "ease_in_duration") ||
|
||||
!llfinite(joint_motion_list->mEaseInDuration))
|
||||
{
|
||||
LL_WARNS() << "can't read easeIn"
|
||||
<< " for animation " << asset_id << LL_ENDL;
|
||||
delete mJointMotionList; // <FS:Ansariel> Mem-leak fix by Drake Arconis
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
if (!dp.unpackF32(mJointMotionList->mEaseOutDuration, "ease_out_duration") ||
|
||||
!llfinite(mJointMotionList->mEaseOutDuration))
|
||||
if (!dp.unpackF32(joint_motion_list->mEaseOutDuration, "ease_out_duration") ||
|
||||
!llfinite(joint_motion_list->mEaseOutDuration))
|
||||
{
|
||||
LL_WARNS() << "can't read easeOut"
|
||||
<< " for animation " << asset_id << LL_ENDL;
|
||||
delete mJointMotionList; // <FS:Ansariel> Mem-leak fix by Drake Arconis
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
|
|
@ -1392,7 +1378,6 @@ BOOL LLKeyframeMotion::deserialize(LLDataPacker& dp, const LLUUID& asset_id, boo
|
|||
{
|
||||
LL_WARNS() << "can't read hand pose"
|
||||
<< " for animation " << asset_id << LL_ENDL;
|
||||
delete mJointMotionList; // <FS:Ansariel> Mem-leak fix by Drake Arconis
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
|
|
@ -1400,11 +1385,10 @@ BOOL LLKeyframeMotion::deserialize(LLDataPacker& dp, const LLUUID& asset_id, boo
|
|||
{
|
||||
LL_WARNS() << "invalid LLHandMotion::eHandPose index: " << word
|
||||
<< " for animation " << asset_id << LL_ENDL;
|
||||
delete mJointMotionList; // <FS:Ansariel> Mem-leak fix by Drake Arconis
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
mJointMotionList->mHandPose = (LLHandMotion::eHandPose)word;
|
||||
joint_motion_list->mHandPose = (LLHandMotion::eHandPose)word;
|
||||
|
||||
//-------------------------------------------------------------------------
|
||||
// get number of joint motions
|
||||
|
|
@ -1414,7 +1398,6 @@ BOOL LLKeyframeMotion::deserialize(LLDataPacker& dp, const LLUUID& asset_id, boo
|
|||
{
|
||||
LL_WARNS() << "can't read number of joints"
|
||||
<< " for animation " << asset_id << LL_ENDL;
|
||||
delete mJointMotionList; // <FS:Ansariel> Mem-leak fix by Drake Arconis
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
|
|
@ -1422,19 +1405,17 @@ BOOL LLKeyframeMotion::deserialize(LLDataPacker& dp, const LLUUID& asset_id, boo
|
|||
{
|
||||
LL_WARNS() << "no joints"
|
||||
<< " for animation " << asset_id << LL_ENDL;
|
||||
delete mJointMotionList; // <FS:Ansariel> Mem-leak fix by Drake Arconis
|
||||
return FALSE;
|
||||
}
|
||||
else if (num_motions > LL_CHARACTER_MAX_ANIMATED_JOINTS)
|
||||
{
|
||||
LL_WARNS() << "too many joints"
|
||||
<< " for animation " << asset_id << LL_ENDL;
|
||||
delete mJointMotionList; // <FS:Ansariel> Mem-leak fix by Drake Arconis
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
mJointMotionList->mJointMotionArray.clear();
|
||||
mJointMotionList->mJointMotionArray.reserve(num_motions);
|
||||
joint_motion_list->mJointMotionArray.clear();
|
||||
joint_motion_list->mJointMotionArray.reserve(num_motions);
|
||||
mJointStates.clear();
|
||||
mJointStates.reserve(num_motions);
|
||||
|
||||
|
|
@ -1445,14 +1426,13 @@ BOOL LLKeyframeMotion::deserialize(LLDataPacker& dp, const LLUUID& asset_id, boo
|
|||
for(U32 i=0; i<num_motions; ++i)
|
||||
{
|
||||
JointMotion* joint_motion = new JointMotion;
|
||||
mJointMotionList->mJointMotionArray.push_back(joint_motion);
|
||||
joint_motion_list->mJointMotionArray.push_back(joint_motion);
|
||||
|
||||
std::string joint_name;
|
||||
if (!dp.unpackString(joint_name, "joint_name"))
|
||||
{
|
||||
LL_WARNS() << "can't read joint name"
|
||||
<< " for animation " << asset_id << LL_ENDL;
|
||||
delete mJointMotionList; // <FS:Ansariel> Mem-leak fix by Drake Arconis
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
|
|
@ -1460,7 +1440,6 @@ BOOL LLKeyframeMotion::deserialize(LLDataPacker& dp, const LLUUID& asset_id, boo
|
|||
{
|
||||
LL_WARNS() << "attempted to animate special " << joint_name << " joint"
|
||||
<< " for animation " << asset_id << LL_ENDL;
|
||||
delete mJointMotionList; // <FS:Ansariel> Mem-leak fix by Drake Arconis
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
|
|
@ -1507,7 +1486,6 @@ BOOL LLKeyframeMotion::deserialize(LLDataPacker& dp, const LLUUID& asset_id, boo
|
|||
{
|
||||
LL_WARNS() << "can't read joint priority."
|
||||
<< " for animation " << asset_id << LL_ENDL;
|
||||
delete mJointMotionList; // <FS:Ansariel> Mem-leak fix by Drake Arconis
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
|
|
@ -1515,15 +1493,14 @@ BOOL LLKeyframeMotion::deserialize(LLDataPacker& dp, const LLUUID& asset_id, boo
|
|||
{
|
||||
LL_WARNS() << "joint priority unknown - too low."
|
||||
<< " for animation " << asset_id << LL_ENDL;
|
||||
delete mJointMotionList; // <FS:Ansariel> Mem-leak fix by Drake Arconis
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
joint_motion->mPriority = (LLJoint::JointPriority)joint_priority;
|
||||
if (joint_priority != LLJoint::USE_MOTION_PRIORITY &&
|
||||
joint_priority > mJointMotionList->mMaxPriority)
|
||||
joint_priority > joint_motion_list->mMaxPriority)
|
||||
{
|
||||
mJointMotionList->mMaxPriority = (LLJoint::JointPriority)joint_priority;
|
||||
joint_motion_list->mMaxPriority = (LLJoint::JointPriority)joint_priority;
|
||||
}
|
||||
|
||||
joint_state->setPriority((LLJoint::JointPriority)joint_priority);
|
||||
|
|
@ -1535,7 +1512,6 @@ BOOL LLKeyframeMotion::deserialize(LLDataPacker& dp, const LLUUID& asset_id, boo
|
|||
{
|
||||
LL_WARNS() << "can't read number of rotation keys"
|
||||
<< " for animation " << asset_id << LL_ENDL;
|
||||
delete mJointMotionList; // <FS:Ansariel> Mem-leak fix by Drake Arconis
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
|
|
@ -1562,7 +1538,6 @@ BOOL LLKeyframeMotion::deserialize(LLDataPacker& dp, const LLUUID& asset_id, boo
|
|||
{
|
||||
LL_WARNS() << "can't read rotation key (" << k << ")"
|
||||
<< " for animation " << asset_id << LL_ENDL;
|
||||
delete mJointMotionList; // <FS:Ansariel> Mem-leak fix by Drake Arconis
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
|
|
@ -1573,17 +1548,15 @@ BOOL LLKeyframeMotion::deserialize(LLDataPacker& dp, const LLUUID& asset_id, boo
|
|||
{
|
||||
LL_WARNS() << "can't read rotation key (" << k << ")"
|
||||
<< " for animation " << asset_id << LL_ENDL;
|
||||
delete mJointMotionList; // <FS:Ansariel> Mem-leak fix by Drake Arconis
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
time = U16_to_F32(time_short, 0.f, mJointMotionList->mDuration);
|
||||
time = U16_to_F32(time_short, 0.f, joint_motion_list->mDuration);
|
||||
|
||||
if (time < 0 || time > mJointMotionList->mDuration)
|
||||
if (time < 0 || time > joint_motion_list->mDuration)
|
||||
{
|
||||
LL_WARNS() << "invalid frame time"
|
||||
<< " for animation " << asset_id << LL_ENDL;
|
||||
delete mJointMotionList; // <FS:Ansariel> Mem-leak fix by Drake Arconis
|
||||
return FALSE;
|
||||
}
|
||||
}
|
||||
|
|
@ -1593,40 +1566,58 @@ BOOL LLKeyframeMotion::deserialize(LLDataPacker& dp, const LLUUID& asset_id, boo
|
|||
LLVector3 rot_angles;
|
||||
U16 x, y, z;
|
||||
|
||||
BOOL success = TRUE;
|
||||
|
||||
if (old_version)
|
||||
{
|
||||
success = dp.unpackVector3(rot_angles, "rot_angles") && rot_angles.isFinite();
|
||||
if (!dp.unpackVector3(rot_angles, "rot_angles"))
|
||||
{
|
||||
LL_WARNS() << "can't read rot_angles in rotation key (" << k << ")" << LL_ENDL;
|
||||
return FALSE;
|
||||
}
|
||||
if (!rot_angles.isFinite())
|
||||
{
|
||||
LL_WARNS() << "non-finite angle in rotation key (" << k << ")" << LL_ENDL;
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
LLQuaternion::Order ro = StringToOrder("ZYX");
|
||||
rot_key.mRotation = mayaQ(rot_angles.mV[VX], rot_angles.mV[VY], rot_angles.mV[VZ], ro);
|
||||
}
|
||||
else
|
||||
{
|
||||
success &= dp.unpackU16(x, "rot_angle_x");
|
||||
success &= dp.unpackU16(y, "rot_angle_y");
|
||||
success &= dp.unpackU16(z, "rot_angle_z");
|
||||
if (!dp.unpackU16(x, "rot_angle_x"))
|
||||
{
|
||||
LL_WARNS() << "can't read rot_angle_x in rotation key (" << k << ")" << LL_ENDL;
|
||||
return FALSE;
|
||||
}
|
||||
if (!dp.unpackU16(y, "rot_angle_y"))
|
||||
{
|
||||
LL_WARNS() << "can't read rot_angle_y in rotation key (" << k << ")" << LL_ENDL;
|
||||
return FALSE;
|
||||
}
|
||||
if (!dp.unpackU16(z, "rot_angle_z"))
|
||||
{
|
||||
LL_WARNS() << "can't read rot_angle_z in rotation key (" << k << ")" << LL_ENDL;
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
LLVector3 rot_vec;
|
||||
rot_vec.mV[VX] = U16_to_F32(x, -1.f, 1.f);
|
||||
rot_vec.mV[VY] = U16_to_F32(y, -1.f, 1.f);
|
||||
rot_vec.mV[VZ] = U16_to_F32(z, -1.f, 1.f);
|
||||
|
||||
if(!rot_vec.isFinite())
|
||||
{
|
||||
LL_WARNS() << "non-finite angle in rotation key (" << k << ")"
|
||||
<< " for animation " << asset_id << LL_ENDL;
|
||||
return FALSE;
|
||||
}
|
||||
rot_key.mRotation.unpackFromVector3(rot_vec);
|
||||
}
|
||||
|
||||
if( !(rot_key.mRotation.isFinite()) )
|
||||
if(!rot_key.mRotation.isFinite())
|
||||
{
|
||||
LL_WARNS() << "non-finite angle in rotation key"
|
||||
LL_WARNS() << "non-finite angle in rotation key (" << k << ")"
|
||||
<< " for animation " << asset_id << LL_ENDL;
|
||||
success = FALSE;
|
||||
}
|
||||
|
||||
if (!success)
|
||||
{
|
||||
LL_WARNS() << "can't read rotation key (" << k << ")"
|
||||
<< " for animation " << asset_id << LL_ENDL;
|
||||
delete mJointMotionList; // <FS:Ansariel> Mem-leak fix by Drake Arconis
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
|
|
@ -1640,7 +1631,6 @@ BOOL LLKeyframeMotion::deserialize(LLDataPacker& dp, const LLUUID& asset_id, boo
|
|||
{
|
||||
LL_WARNS() << "can't read number of position keys"
|
||||
<< " for animation " << asset_id << LL_ENDL;
|
||||
delete mJointMotionList; // <FS:Ansariel> Mem-leak fix by Drake Arconis
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
|
|
@ -1667,7 +1657,6 @@ BOOL LLKeyframeMotion::deserialize(LLDataPacker& dp, const LLUUID& asset_id, boo
|
|||
{
|
||||
LL_WARNS() << "can't read position key (" << k << ")"
|
||||
<< " for animation " << asset_id << LL_ENDL;
|
||||
delete mJointMotionList; // <FS:Ansariel> Mem-leak fix by Drake Arconis
|
||||
return FALSE;
|
||||
}
|
||||
}
|
||||
|
|
@ -1677,18 +1666,19 @@ BOOL LLKeyframeMotion::deserialize(LLDataPacker& dp, const LLUUID& asset_id, boo
|
|||
{
|
||||
LL_WARNS() << "can't read position key (" << k << ")"
|
||||
<< " for animation " << asset_id << LL_ENDL;
|
||||
delete mJointMotionList; // <FS:Ansariel> Mem-leak fix by Drake Arconis
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
pos_key.mTime = U16_to_F32(time_short, 0.f, mJointMotionList->mDuration);
|
||||
pos_key.mTime = U16_to_F32(time_short, 0.f, joint_motion_list->mDuration);
|
||||
}
|
||||
|
||||
BOOL success = TRUE;
|
||||
|
||||
if (old_version)
|
||||
{
|
||||
success = dp.unpackVector3(pos_key.mPosition, "pos");
|
||||
if (!dp.unpackVector3(pos_key.mPosition, "pos"))
|
||||
{
|
||||
LL_WARNS() << "can't read pos in position key (" << k << ")" << LL_ENDL;
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
//MAINT-6162
|
||||
pos_key.mPosition.mV[VX] = llclamp( pos_key.mPosition.mV[VX], -LL_MAX_PELVIS_OFFSET, LL_MAX_PELVIS_OFFSET);
|
||||
|
|
@ -1700,27 +1690,31 @@ BOOL LLKeyframeMotion::deserialize(LLDataPacker& dp, const LLUUID& asset_id, boo
|
|||
{
|
||||
U16 x, y, z;
|
||||
|
||||
success &= dp.unpackU16(x, "pos_x");
|
||||
success &= dp.unpackU16(y, "pos_y");
|
||||
success &= dp.unpackU16(z, "pos_z");
|
||||
if (!dp.unpackU16(x, "pos_x"))
|
||||
{
|
||||
LL_WARNS() << "can't read pos_x in position key (" << k << ")" << LL_ENDL;
|
||||
return FALSE;
|
||||
}
|
||||
if (!dp.unpackU16(y, "pos_y"))
|
||||
{
|
||||
LL_WARNS() << "can't read pos_y in position key (" << k << ")" << LL_ENDL;
|
||||
return FALSE;
|
||||
}
|
||||
if (!dp.unpackU16(z, "pos_z"))
|
||||
{
|
||||
LL_WARNS() << "can't read pos_z in position key (" << k << ")" << LL_ENDL;
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
pos_key.mPosition.mV[VX] = U16_to_F32(x, -LL_MAX_PELVIS_OFFSET, LL_MAX_PELVIS_OFFSET);
|
||||
pos_key.mPosition.mV[VY] = U16_to_F32(y, -LL_MAX_PELVIS_OFFSET, LL_MAX_PELVIS_OFFSET);
|
||||
pos_key.mPosition.mV[VZ] = U16_to_F32(z, -LL_MAX_PELVIS_OFFSET, LL_MAX_PELVIS_OFFSET);
|
||||
}
|
||||
|
||||
if( !(pos_key.mPosition.isFinite()) )
|
||||
if(!pos_key.mPosition.isFinite())
|
||||
{
|
||||
LL_WARNS() << "non-finite position in key"
|
||||
<< " for animation " << asset_id << LL_ENDL;
|
||||
success = FALSE;
|
||||
}
|
||||
|
||||
if (!success)
|
||||
{
|
||||
LL_WARNS() << "can't read position key (" << k << ")"
|
||||
<< " for animation " << asset_id << LL_ENDL;
|
||||
delete mJointMotionList; // <FS:Ansariel> Mem-leak fix by Drake Arconis
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
|
|
@ -1728,7 +1722,7 @@ BOOL LLKeyframeMotion::deserialize(LLDataPacker& dp, const LLUUID& asset_id, boo
|
|||
|
||||
if (is_pelvis)
|
||||
{
|
||||
mJointMotionList->mPelvisBBox.addPoint(pos_key.mPosition);
|
||||
joint_motion_list->mPelvisBBox.addPoint(pos_key.mPosition);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -1743,7 +1737,6 @@ BOOL LLKeyframeMotion::deserialize(LLDataPacker& dp, const LLUUID& asset_id, boo
|
|||
{
|
||||
LL_WARNS() << "can't read number of constraints"
|
||||
<< " for animation " << asset_id << LL_ENDL;
|
||||
delete mJointMotionList; // <FS:Ansariel> Mem-leak fix by Drake Arconis
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
|
|
@ -1761,25 +1754,21 @@ BOOL LLKeyframeMotion::deserialize(LLDataPacker& dp, const LLUUID& asset_id, boo
|
|||
for(S32 i = 0; i < num_constraints; ++i)
|
||||
{
|
||||
// read in constraint data
|
||||
JointConstraintSharedData* constraintp = new JointConstraintSharedData;
|
||||
std::unique_ptr<JointConstraintSharedData> constraintp(new JointConstraintSharedData);
|
||||
U8 byte = 0;
|
||||
|
||||
if (!dp.unpackU8(byte, "chain_length"))
|
||||
{
|
||||
LL_WARNS() << "can't read constraint chain length"
|
||||
<< " for animation " << asset_id << LL_ENDL;
|
||||
delete constraintp;
|
||||
delete mJointMotionList; // <FS:Ansariel> Mem-leak fix by Drake Arconis
|
||||
return FALSE;
|
||||
}
|
||||
constraintp->mChainLength = (S32) byte;
|
||||
|
||||
if((U32)constraintp->mChainLength > mJointMotionList->getNumJointMotions())
|
||||
if((U32)constraintp->mChainLength > joint_motion_list->getNumJointMotions())
|
||||
{
|
||||
LL_WARNS() << "invalid constraint chain length"
|
||||
<< " for animation " << asset_id << LL_ENDL;
|
||||
delete constraintp;
|
||||
delete mJointMotionList; // <FS:Ansariel> Mem-leak fix by Drake Arconis
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
|
|
@ -1787,8 +1776,6 @@ BOOL LLKeyframeMotion::deserialize(LLDataPacker& dp, const LLUUID& asset_id, boo
|
|||
{
|
||||
LL_WARNS() << "can't read constraint type"
|
||||
<< " for animation " << asset_id << LL_ENDL;
|
||||
delete constraintp;
|
||||
delete mJointMotionList; // <FS:Ansariel> Mem-leak fix by Drake Arconis
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
|
|
@ -1796,8 +1783,6 @@ BOOL LLKeyframeMotion::deserialize(LLDataPacker& dp, const LLUUID& asset_id, boo
|
|||
{
|
||||
LL_WARNS() << "invalid constraint type"
|
||||
<< " for animation " << asset_id << LL_ENDL;
|
||||
delete constraintp;
|
||||
delete mJointMotionList; // <FS:Ansariel> Mem-leak fix by Drake Arconis
|
||||
return FALSE;
|
||||
}
|
||||
constraintp->mConstraintType = (EConstraintType)byte;
|
||||
|
|
@ -1808,8 +1793,6 @@ BOOL LLKeyframeMotion::deserialize(LLDataPacker& dp, const LLUUID& asset_id, boo
|
|||
{
|
||||
LL_WARNS() << "can't read source volume name"
|
||||
<< " for animation " << asset_id << LL_ENDL;
|
||||
delete constraintp;
|
||||
delete mJointMotionList; // <FS:Ansariel> Mem-leak fix by Drake Arconis
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
|
|
@ -1820,8 +1803,6 @@ BOOL LLKeyframeMotion::deserialize(LLDataPacker& dp, const LLUUID& asset_id, boo
|
|||
{
|
||||
LL_WARNS() << "not a valid source constraint volume " << str
|
||||
<< " for animation " << asset_id << LL_ENDL;
|
||||
delete constraintp;
|
||||
delete mJointMotionList; // <FS:Beq> avoid mem-leak as per others
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
|
|
@ -1829,8 +1810,6 @@ BOOL LLKeyframeMotion::deserialize(LLDataPacker& dp, const LLUUID& asset_id, boo
|
|||
{
|
||||
LL_WARNS() << "can't read constraint source offset"
|
||||
<< " for animation " << asset_id << LL_ENDL;
|
||||
delete constraintp;
|
||||
delete mJointMotionList; // <FS:Ansariel> Mem-leak fix by Drake Arconis
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
|
|
@ -1838,8 +1817,6 @@ BOOL LLKeyframeMotion::deserialize(LLDataPacker& dp, const LLUUID& asset_id, boo
|
|||
{
|
||||
LL_WARNS() << "non-finite constraint source offset"
|
||||
<< " for animation " << asset_id << LL_ENDL;
|
||||
delete constraintp;
|
||||
delete mJointMotionList; // <FS:Ansariel> Mem-leak fix by Drake Arconis
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
|
|
@ -1847,8 +1824,6 @@ BOOL LLKeyframeMotion::deserialize(LLDataPacker& dp, const LLUUID& asset_id, boo
|
|||
{
|
||||
LL_WARNS() << "can't read target volume name"
|
||||
<< " for animation " << asset_id << LL_ENDL;
|
||||
delete constraintp;
|
||||
delete mJointMotionList; // <FS:Ansariel> Mem-leak fix by Drake Arconis
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
|
|
@ -1867,8 +1842,6 @@ BOOL LLKeyframeMotion::deserialize(LLDataPacker& dp, const LLUUID& asset_id, boo
|
|||
{
|
||||
LL_WARNS() << "not a valid target constraint volume " << str
|
||||
<< " for animation " << asset_id << LL_ENDL;
|
||||
delete constraintp;
|
||||
delete mJointMotionList; // <FS:Beq> avoid mem-leak as per others
|
||||
return FALSE;
|
||||
}
|
||||
}
|
||||
|
|
@ -1877,8 +1850,6 @@ BOOL LLKeyframeMotion::deserialize(LLDataPacker& dp, const LLUUID& asset_id, boo
|
|||
{
|
||||
LL_WARNS() << "can't read constraint target offset"
|
||||
<< " for animation " << asset_id << LL_ENDL;
|
||||
delete constraintp;
|
||||
delete mJointMotionList; // <FS:Ansariel> Mem-leak fix by Drake Arconis
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
|
|
@ -1886,8 +1857,6 @@ BOOL LLKeyframeMotion::deserialize(LLDataPacker& dp, const LLUUID& asset_id, boo
|
|||
{
|
||||
LL_WARNS() << "non-finite constraint target offset"
|
||||
<< " for animation " << asset_id << LL_ENDL;
|
||||
delete constraintp;
|
||||
delete mJointMotionList; // <FS:Ansariel> Mem-leak fix by Drake Arconis
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
|
|
@ -1895,8 +1864,6 @@ BOOL LLKeyframeMotion::deserialize(LLDataPacker& dp, const LLUUID& asset_id, boo
|
|||
{
|
||||
LL_WARNS() << "can't read constraint target direction"
|
||||
<< " for animation " << asset_id << LL_ENDL;
|
||||
delete constraintp;
|
||||
delete mJointMotionList; // <FS:Ansariel> Mem-leak fix by Drake Arconis
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
|
|
@ -1904,8 +1871,6 @@ BOOL LLKeyframeMotion::deserialize(LLDataPacker& dp, const LLUUID& asset_id, boo
|
|||
{
|
||||
LL_WARNS() << "non-finite constraint target direction"
|
||||
<< " for animation " << asset_id << LL_ENDL;
|
||||
delete constraintp;
|
||||
delete mJointMotionList; // <FS:Ansariel> Mem-leak fix by Drake Arconis
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
|
|
@ -1919,8 +1884,6 @@ BOOL LLKeyframeMotion::deserialize(LLDataPacker& dp, const LLUUID& asset_id, boo
|
|||
{
|
||||
LL_WARNS() << "can't read constraint ease in start time"
|
||||
<< " for animation " << asset_id << LL_ENDL;
|
||||
delete constraintp;
|
||||
delete mJointMotionList; // <FS:Ansariel> Mem-leak fix by Drake Arconis
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
|
|
@ -1928,8 +1891,6 @@ BOOL LLKeyframeMotion::deserialize(LLDataPacker& dp, const LLUUID& asset_id, boo
|
|||
{
|
||||
LL_WARNS() << "can't read constraint ease in stop time"
|
||||
<< " for animation " << asset_id << LL_ENDL;
|
||||
delete constraintp;
|
||||
delete mJointMotionList; // <FS:Ansariel> Mem-leak fix by Drake Arconis
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
|
|
@ -1937,8 +1898,6 @@ BOOL LLKeyframeMotion::deserialize(LLDataPacker& dp, const LLUUID& asset_id, boo
|
|||
{
|
||||
LL_WARNS() << "can't read constraint ease out start time"
|
||||
<< " for animation " << asset_id << LL_ENDL;
|
||||
delete constraintp;
|
||||
delete mJointMotionList; // <FS:Ansariel> Mem-leak fix by Drake Arconis
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
|
|
@ -1946,36 +1905,31 @@ BOOL LLKeyframeMotion::deserialize(LLDataPacker& dp, const LLUUID& asset_id, boo
|
|||
{
|
||||
LL_WARNS() << "can't read constraint ease out stop time"
|
||||
<< " for animation " << asset_id << LL_ENDL;
|
||||
delete constraintp;
|
||||
delete mJointMotionList; // <FS:Ansariel> Mem-leak fix by Drake Arconis
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
mJointMotionList->mConstraints.push_front(constraintp);
|
||||
|
||||
constraintp->mJointStateIndices = new S32[constraintp->mChainLength + 1]; // note: mChainLength is size-limited - comes from a byte
|
||||
|
||||
LLJoint* joint = mCharacter->findCollisionVolume(constraintp->mSourceConstraintVolume);
|
||||
// get joint to which this collision volume is attached
|
||||
if (!joint)
|
||||
{
|
||||
delete mJointMotionList; // <FS:Ansariel> Mem-leak fix by Drake Arconis
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
constraintp->mJointStateIndices = new S32[constraintp->mChainLength + 1]; // note: mChainLength is size-limited - comes from a byte
|
||||
|
||||
for (S32 i = 0; i < constraintp->mChainLength + 1; i++)
|
||||
{
|
||||
LLJoint* parent = joint->getParent();
|
||||
if (!parent)
|
||||
{
|
||||
LL_WARNS() << "Joint with no parent: " << joint->getName()
|
||||
<< " Emote: " << mJointMotionList->mEmoteName
|
||||
<< " Emote: " << joint_motion_list->mEmoteName
|
||||
<< " for animation " << asset_id << LL_ENDL;
|
||||
delete mJointMotionList; // <FS:Ansariel> Mem-leak fix by Drake Arconis
|
||||
return FALSE;
|
||||
}
|
||||
joint = parent;
|
||||
constraintp->mJointStateIndices[i] = -1;
|
||||
for (U32 j = 0; j < mJointMotionList->getNumJointMotions(); j++)
|
||||
for (U32 j = 0; j < joint_motion_list->getNumJointMotions(); j++)
|
||||
{
|
||||
LLJoint* constraint_joint = getJoint(j);
|
||||
|
||||
|
|
@ -1983,7 +1937,6 @@ BOOL LLKeyframeMotion::deserialize(LLDataPacker& dp, const LLUUID& asset_id, boo
|
|||
{
|
||||
LL_WARNS() << "Invalid joint " << j
|
||||
<< " for animation " << asset_id << LL_ENDL;
|
||||
delete mJointMotionList; // <FS:Ansariel> Mem-leak fix by Drake Arconis
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
|
|
@ -1997,17 +1950,16 @@ BOOL LLKeyframeMotion::deserialize(LLDataPacker& dp, const LLUUID& asset_id, boo
|
|||
{
|
||||
LL_WARNS() << "No joint index for constraint " << i
|
||||
<< " for animation " << asset_id << LL_ENDL;
|
||||
// <FS:Ansariel> Mem-leak fix by Drake Arconis
|
||||
//delete constraintp;
|
||||
delete mJointMotionList;
|
||||
// </FS:Ansariel>
|
||||
return FALSE;
|
||||
}
|
||||
}
|
||||
|
||||
joint_motion_list->mConstraints.push_front(constraintp.release());
|
||||
}
|
||||
}
|
||||
|
||||
// *FIX: support cleanup of old keyframe data
|
||||
mJointMotionList = joint_motion_list.release(); // release from unique_ptr to member;
|
||||
LLKeyframeDataCache::addKeyframeData(getID(), mJointMotionList);
|
||||
mAssetStatus = ASSET_LOADED;
|
||||
|
||||
|
|
|
|||
|
|
@ -287,25 +287,15 @@ std::string LLCoros::launch(const std::string& prefix, const callable_t& callabl
|
|||
return name;
|
||||
}
|
||||
|
||||
namespace
|
||||
{
|
||||
|
||||
#if LL_WINDOWS
|
||||
|
||||
static const U32 STATUS_MSC_EXCEPTION = 0xE06D7363; // compiler specific
|
||||
|
||||
U32 cpp_exception_filter(U32 code, struct _EXCEPTION_POINTERS *exception_infop, const std::string& name)
|
||||
U32 exception_filter(U32 code, struct _EXCEPTION_POINTERS *exception_infop)
|
||||
{
|
||||
// C++ exceptions were logged in toplevelTryWrapper, but not SEH
|
||||
// log SEH exceptions here, to make sure it gets into bugsplat's
|
||||
// report and because __try won't allow std::string operations
|
||||
if (code != STATUS_MSC_EXCEPTION)
|
||||
{
|
||||
LL_WARNS() << "SEH crash in " << name << ", code: " << code << LL_ENDL;
|
||||
}
|
||||
// Handle bugsplat here, since GetExceptionInformation() can only be
|
||||
// called from within filter for __except(filter), not from __except's {}
|
||||
// Bugsplat should get all exceptions, C++ and SEH
|
||||
LLApp::instance()->reportCrashToBugsplat(exception_infop);
|
||||
|
||||
// Only convert non C++ exceptions.
|
||||
if (code == STATUS_MSC_EXCEPTION)
|
||||
{
|
||||
// C++ exception, go on
|
||||
|
|
@ -318,28 +308,38 @@ U32 cpp_exception_filter(U32 code, struct _EXCEPTION_POINTERS *exception_infop,
|
|||
}
|
||||
}
|
||||
|
||||
void LLCoros::sehHandle(const std::string& name, const LLCoros::callable_t& callable)
|
||||
void sehandle(const LLCoros::callable_t& callable)
|
||||
{
|
||||
__try
|
||||
{
|
||||
LLCoros::toplevelTryWrapper(name, callable);
|
||||
callable();
|
||||
}
|
||||
__except (cpp_exception_filter(GetExceptionCode(), GetExceptionInformation(), name))
|
||||
__except (exception_filter(GetExceptionCode(), GetExceptionInformation()))
|
||||
{
|
||||
// convert to C++ styled exception for handlers other than bugsplat
|
||||
// convert to C++ styled exception
|
||||
// Note: it might be better to use _se_set_translator
|
||||
// if you want exception to inherit full callstack
|
||||
//
|
||||
// in case of bugsplat this will get to exceptionTerminateHandler and
|
||||
// looks like fiber will terminate application after that
|
||||
char integer_string[512];
|
||||
sprintf(integer_string, "SEH crash in %s, code: %lu\n", name.c_str(), GetExceptionCode());
|
||||
sprintf(integer_string, "SEH, code: %lu\n", GetExceptionCode());
|
||||
throw std::exception(integer_string);
|
||||
}
|
||||
}
|
||||
#endif
|
||||
|
||||
void LLCoros::toplevelTryWrapper(const std::string& name, const callable_t& callable)
|
||||
#else // ! LL_WINDOWS
|
||||
|
||||
inline void sehandle(const LLCoros::callable_t& callable)
|
||||
{
|
||||
callable();
|
||||
}
|
||||
|
||||
#endif // ! LL_WINDOWS
|
||||
|
||||
} // anonymous namespace
|
||||
|
||||
// Top-level wrapper around caller's coroutine callable.
|
||||
// Normally we like to pass strings and such by const reference -- but in this
|
||||
// case, we WANT to copy both the name and the callable to our local stack!
|
||||
void LLCoros::toplevel(std::string name, callable_t callable)
|
||||
{
|
||||
// keep the CoroData on this top-level function's stack frame
|
||||
CoroData corodata(name);
|
||||
|
|
@ -349,12 +349,12 @@ void LLCoros::toplevelTryWrapper(const std::string& name, const callable_t& call
|
|||
// run the code the caller actually wants in the coroutine
|
||||
try
|
||||
{
|
||||
callable();
|
||||
sehandle(callable);
|
||||
}
|
||||
catch (const Stop& exc)
|
||||
{
|
||||
LL_INFOS("LLCoros") << "coroutine " << name << " terminating because "
|
||||
<< exc.what() << LL_ENDL;
|
||||
<< exc.what() << LL_ENDL;
|
||||
}
|
||||
catch (const LLContinueError&)
|
||||
{
|
||||
|
|
@ -365,36 +365,14 @@ void LLCoros::toplevelTryWrapper(const std::string& name, const callable_t& call
|
|||
}
|
||||
catch (...)
|
||||
{
|
||||
#if LL_WINDOWS
|
||||
// Any OTHER kind of uncaught exception will cause the viewer to
|
||||
// crash, SEH handling should catch it and report to bugsplat.
|
||||
LOG_UNHANDLED_EXCEPTION(STRINGIZE("coroutine " << name));
|
||||
// to not modify callstack
|
||||
throw;
|
||||
#else
|
||||
// Stash any OTHER kind of uncaught exception in the rethrow() queue
|
||||
// to be rethrown by the main fiber.
|
||||
LL_WARNS("LLCoros") << "Capturing uncaught exception in coroutine "
|
||||
<< name << LL_ENDL;
|
||||
LLCoros::instance().saveException(name, std::current_exception());
|
||||
#endif
|
||||
}
|
||||
}
|
||||
|
||||
// Top-level wrapper around caller's coroutine callable.
|
||||
// Normally we like to pass strings and such by const reference -- but in this
|
||||
// case, we WANT to copy both the name and the callable to our local stack!
|
||||
void LLCoros::toplevel(std::string name, callable_t callable)
|
||||
{
|
||||
#if LL_WINDOWS
|
||||
// Because SEH can's have unwinding, need to call a wrapper
|
||||
// 'try' is inside SEH handling to not catch LLContinue
|
||||
sehHandle(name, callable);
|
||||
#else
|
||||
toplevelTryWrapper(name, callable);
|
||||
#endif
|
||||
}
|
||||
|
||||
//static
|
||||
void LLCoros::checkStop()
|
||||
{
|
||||
|
|
|
|||
|
|
@ -307,11 +307,7 @@ public:
|
|||
|
||||
private:
|
||||
std::string generateDistinctName(const std::string& prefix) const;
|
||||
void toplevelTryWrapper(const std::string& name, const callable_t& callable);
|
||||
#if LL_WINDOWS
|
||||
void sehHandle(const std::string& name, const callable_t& callable); // calls toplevelTryWrapper
|
||||
#endif
|
||||
void toplevel(std::string name, callable_t callable); // calls sehHandle or toplevelTryWrapper
|
||||
void toplevel(std::string name, callable_t callable);
|
||||
struct CoroData;
|
||||
static CoroData& get_CoroData(const std::string& caller);
|
||||
void saveException(const std::string& name, std::exception_ptr exc);
|
||||
|
|
|
|||
|
|
@ -952,7 +952,7 @@ namespace LLError
|
|||
for (a = sets.beginArray(), end = sets.endArray(); a != end; ++a)
|
||||
{
|
||||
const LLSD& entry = *a;
|
||||
if (entry.isMap() && !entry.emptyMap())
|
||||
if (entry.isMap() && entry.size() != 0)
|
||||
{
|
||||
ELevel level = decodeLevel(entry["level"]);
|
||||
|
||||
|
|
|
|||
|
|
@ -40,6 +40,12 @@
|
|||
|
||||
#include <boost/static_assert.hpp>
|
||||
|
||||
// <FS:Ansariel> Disable C6011 code analyses warning for now popping up everywhere because of the LL_ENDL / LLERROR_CRASH macro
|
||||
#if LL_WINDOWS
|
||||
#pragma warning (disable : 6011)
|
||||
#endif
|
||||
// </FS:Ansariel>
|
||||
|
||||
// <FS:ND> Supress some false positives of PVS Studio.
|
||||
// They are misleading as there is opossibly a pointr taken behid the array and that pointer is passed down. But it's never dereferenced.
|
||||
//-V:llassert_always:557
|
||||
|
|
|
|||
|
|
@ -34,10 +34,9 @@
|
|||
#include <iostream>
|
||||
#include "apr_base64.h"
|
||||
|
||||
// <FS:Beq pp Rye> Add non-allocating variants of unzip_llsd
|
||||
#include <boost/iostreams/device/array.hpp>
|
||||
#include <boost/iostreams/stream.hpp>
|
||||
// </FS:Beq pp Rye>
|
||||
|
||||
#ifdef LL_USESYSTEMLIBS
|
||||
# include <zlib.h>
|
||||
#else
|
||||
|
|
@ -2132,8 +2131,8 @@ std::string zip_llsd(LLSD& data)
|
|||
{ //copy result into output
|
||||
if (strm.avail_out >= CHUNK)
|
||||
{
|
||||
// free(output);
|
||||
if( output )
|
||||
deflateEnd(&strm);
|
||||
if(output)
|
||||
free(output);
|
||||
LL_WARNS() << "Failed to compress LLSD block." << LL_ENDL;
|
||||
return std::string();
|
||||
|
|
@ -2157,8 +2156,8 @@ std::string zip_llsd(LLSD& data)
|
|||
}
|
||||
else
|
||||
{
|
||||
// free(output);
|
||||
if( output )
|
||||
deflateEnd(&strm);
|
||||
if(output)
|
||||
free(output);
|
||||
LL_WARNS() << "Failed to compress LLSD block." << LL_ENDL;
|
||||
return std::string();
|
||||
|
|
@ -2170,8 +2169,7 @@ std::string zip_llsd(LLSD& data)
|
|||
|
||||
std::string result((char*) output, size);
|
||||
deflateEnd(&strm);
|
||||
// free(output);
|
||||
if( output )
|
||||
if(output)
|
||||
free(output);
|
||||
|
||||
return result;
|
||||
|
|
@ -2182,148 +2180,8 @@ std::string zip_llsd(LLSD& data)
|
|||
// and deserializes from that copy using LLSDSerialize
|
||||
LLUZipHelper::EZipRresult LLUZipHelper::unzip_llsd(LLSD& data, std::istream& is, S32 size)
|
||||
{
|
||||
// <FS:Beq pp Rye> Add non-allocating variants of unzip_llsd
|
||||
// U8* result = NULL;
|
||||
// llssize cur_size = 0;
|
||||
// z_stream strm;
|
||||
|
||||
// const U32 CHUNK = 65536;
|
||||
|
||||
// U8 *in = new(std::nothrow) U8[size];
|
||||
// if (!in)
|
||||
// {
|
||||
// return ZR_MEM_ERROR;
|
||||
// }
|
||||
// is.read((char*) in, size);
|
||||
|
||||
// U8 out[CHUNK];
|
||||
|
||||
// strm.zalloc = Z_NULL;
|
||||
// strm.zfree = Z_NULL;
|
||||
// strm.opaque = Z_NULL;
|
||||
// strm.avail_in = size;
|
||||
// strm.next_in = in;
|
||||
|
||||
// S32 ret = inflateInit(&strm);
|
||||
|
||||
// do
|
||||
// {
|
||||
// strm.avail_out = CHUNK;
|
||||
// strm.next_out = out;
|
||||
// ret = inflate(&strm, Z_NO_FLUSH);
|
||||
// if (ret == Z_STREAM_ERROR)
|
||||
// {
|
||||
// LL_DEBUGS() << "Unzip error: Z_STREAM_ERROR" << LL_ENDL; // <FS>
|
||||
// inflateEnd(&strm);
|
||||
// // free(result);
|
||||
// if( result )
|
||||
// free(result);
|
||||
// delete [] in;
|
||||
// return ZR_DATA_ERROR;
|
||||
// }
|
||||
|
||||
// switch (ret)
|
||||
// {
|
||||
// case Z_NEED_DICT:
|
||||
// ret = Z_DATA_ERROR;
|
||||
// case Z_DATA_ERROR:
|
||||
// case Z_MEM_ERROR:
|
||||
// LL_DEBUGS() << "Unzip error: " << ret << LL_ENDL; // <FS>
|
||||
// inflateEnd(&strm);
|
||||
// // free(result);
|
||||
// if( result )
|
||||
// free(result);
|
||||
// delete [] in;
|
||||
// return ZR_MEM_ERROR;
|
||||
// break;
|
||||
// }
|
||||
|
||||
// U32 have = CHUNK-strm.avail_out;
|
||||
|
||||
// U8* new_result = (U8*)realloc(result, cur_size + have);
|
||||
// if (new_result == NULL)
|
||||
// {
|
||||
// inflateEnd(&strm);
|
||||
// if (result)
|
||||
// {
|
||||
// free(result);
|
||||
// }
|
||||
// delete[] in;
|
||||
// return ZR_MEM_ERROR;
|
||||
// }
|
||||
// result = new_result;
|
||||
// memcpy(result+cur_size, out, have);
|
||||
// cur_size += have;
|
||||
|
||||
// } while (ret == Z_OK);
|
||||
|
||||
// inflateEnd(&strm);
|
||||
// delete [] in;
|
||||
|
||||
// if (ret != Z_STREAM_END)
|
||||
// {
|
||||
// LL_DEBUGS() << "Unzip error: !Z_STREAM_END" << LL_ENDL; // <FS>
|
||||
// // free(result);
|
||||
// if( result )
|
||||
// free(result);
|
||||
// return ZR_DATA_ERROR;
|
||||
// }
|
||||
|
||||
// //result now points to the decompressed LLSD block
|
||||
// {
|
||||
// std::istringstream istr;
|
||||
// // Since we are using this for meshes, data we are dealing with tend to be large.
|
||||
// // So string can potentially fail to allocate, make sure this won't cause problems
|
||||
// try
|
||||
// {
|
||||
// std::string res_str((char*)result, cur_size);
|
||||
|
||||
// std::string deprecated_header("<? LLSD/Binary ?>");
|
||||
|
||||
// if (res_str.substr(0, deprecated_header.size()) == deprecated_header)
|
||||
// {
|
||||
// res_str = res_str.substr(deprecated_header.size() + 1, cur_size);
|
||||
// }
|
||||
// cur_size = res_str.size();
|
||||
|
||||
// istr.str(res_str);
|
||||
// }
|
||||
// #ifdef LL_WINDOWS
|
||||
// catch (std::length_error)
|
||||
// {
|
||||
// // free(result);
|
||||
// if( result )
|
||||
// free(result);
|
||||
// return ZR_SIZE_ERROR;
|
||||
// }
|
||||
// #endif
|
||||
// catch (std::bad_alloc&)
|
||||
// {
|
||||
// // free(result);
|
||||
// if( result )
|
||||
// free(result);
|
||||
// return ZR_MEM_ERROR;
|
||||
// }
|
||||
|
||||
// if (!LLSDSerialize::fromBinary(data, istr, cur_size, UNZIP_LLSD_MAX_DEPTH))
|
||||
// {
|
||||
// // free(result);
|
||||
// if( result )
|
||||
// free(result);
|
||||
// return ZR_PARSE_ERROR;
|
||||
// }
|
||||
// }
|
||||
|
||||
// // free(result);
|
||||
// if( result )
|
||||
// free(result);
|
||||
// return ZR_OK;
|
||||
std::unique_ptr<U8[]> in;
|
||||
try
|
||||
{
|
||||
in = std::unique_ptr<U8[]>(new U8[size]);
|
||||
}
|
||||
catch(const std::bad_alloc&)
|
||||
std::unique_ptr<U8[]> in = std::unique_ptr<U8[]>(new(std::nothrow) U8[size]);
|
||||
if (!in)
|
||||
{
|
||||
return ZR_MEM_ERROR;
|
||||
}
|
||||
|
|
@ -2338,19 +2196,12 @@ LLUZipHelper::EZipRresult LLUZipHelper::unzip_llsd(LLSD& data, const U8* in, S32
|
|||
llssize cur_size = 0;
|
||||
z_stream strm;
|
||||
|
||||
constexpr U32 CHUNK = 1024 * 256;
|
||||
constexpr U32 CHUNK = 1024 * 512;
|
||||
|
||||
static thread_local std::unique_ptr<U8[]> out;
|
||||
if (!out)
|
||||
{
|
||||
try
|
||||
{
|
||||
out = std::unique_ptr<U8[]>(new U8[CHUNK]);
|
||||
}
|
||||
catch (const std::bad_alloc&)
|
||||
{
|
||||
return ZR_MEM_ERROR;
|
||||
}
|
||||
out = std::unique_ptr<U8[]>(new(std::nothrow) U8[CHUNK]);
|
||||
}
|
||||
|
||||
strm.zalloc = Z_NULL;
|
||||
|
|
@ -2360,16 +2211,7 @@ LLUZipHelper::EZipRresult LLUZipHelper::unzip_llsd(LLSD& data, const U8* in, S32
|
|||
strm.next_in = const_cast<U8*>(in);
|
||||
|
||||
S32 ret = inflateInit(&strm);
|
||||
switch (ret)
|
||||
{
|
||||
case Z_STREAM_ERROR:
|
||||
return ZR_DATA_ERROR;
|
||||
case Z_VERSION_ERROR:
|
||||
return ZR_VERSION_ERROR;
|
||||
case Z_MEM_ERROR:
|
||||
return ZR_MEM_ERROR;
|
||||
}
|
||||
|
||||
|
||||
do
|
||||
{
|
||||
strm.avail_out = CHUNK;
|
||||
|
|
@ -2381,7 +2223,9 @@ LLUZipHelper::EZipRresult LLUZipHelper::unzip_llsd(LLSD& data, const U8* in, S32
|
|||
case Z_DATA_ERROR:
|
||||
{
|
||||
inflateEnd(&strm);
|
||||
free(result);
|
||||
// free(result);
|
||||
if( result )
|
||||
free(result);
|
||||
return ZR_DATA_ERROR;
|
||||
}
|
||||
case Z_STREAM_ERROR:
|
||||
|
|
@ -2395,7 +2239,9 @@ LLUZipHelper::EZipRresult LLUZipHelper::unzip_llsd(LLSD& data, const U8* in, S32
|
|||
case Z_MEM_ERROR:
|
||||
{
|
||||
inflateEnd(&strm);
|
||||
free(result);
|
||||
// free(result);
|
||||
if( result )
|
||||
free(result);
|
||||
return ZR_MEM_ERROR;
|
||||
}
|
||||
}
|
||||
|
|
@ -2422,7 +2268,9 @@ LLUZipHelper::EZipRresult LLUZipHelper::unzip_llsd(LLSD& data, const U8* in, S32
|
|||
|
||||
if (ret != Z_STREAM_END)
|
||||
{
|
||||
free(result);
|
||||
// free(result);
|
||||
if( result )
|
||||
free(result);
|
||||
return ZR_DATA_ERROR;
|
||||
}
|
||||
|
||||
|
|
@ -2434,12 +2282,16 @@ LLUZipHelper::EZipRresult LLUZipHelper::unzip_llsd(LLSD& data, const U8* in, S32
|
|||
|
||||
if (!LLSDSerialize::fromBinary(data, istrm, cur_size, UNZIP_LLSD_MAX_DEPTH))
|
||||
{
|
||||
free(result);
|
||||
// free(result);
|
||||
if( result )
|
||||
free(result);
|
||||
return ZR_PARSE_ERROR;
|
||||
}
|
||||
}
|
||||
|
||||
free(result);
|
||||
// free(result);
|
||||
if( result )
|
||||
free(result);
|
||||
return ZR_OK;
|
||||
}
|
||||
// </FS:Beq pp Rye>
|
||||
|
|
@ -2448,120 +2300,120 @@ LLUZipHelper::EZipRresult LLUZipHelper::unzip_llsd(LLSD& data, const U8* in, S32
|
|||
//and trailers are different for the formats.
|
||||
U8* unzip_llsdNavMesh( bool& valid, size_t& outsize, std::istream& is, S32 size )
|
||||
{
|
||||
// <FS:Beq pp Rye> Add non-allocating variants of unzip_llsd
|
||||
// if (size == 0)
|
||||
// {
|
||||
// LL_WARNS() << "No data to unzip." << LL_ENDL;
|
||||
// return NULL;
|
||||
// }
|
||||
// <FS:Beq pp Rye> Add non-allocating variants of unzip_llsd
|
||||
// if (size == 0)
|
||||
// {
|
||||
// LL_WARNS() << "No data to unzip." << LL_ENDL;
|
||||
// return NULL;
|
||||
// }
|
||||
|
||||
// U8* result = NULL;
|
||||
// U32 cur_size = 0;
|
||||
// z_stream strm;
|
||||
|
||||
// const U32 CHUNK = 0x4000;
|
||||
// U8* result = NULL;
|
||||
// U32 cur_size = 0;
|
||||
// z_stream strm;
|
||||
|
||||
// U8 *in = new(std::nothrow) U8[size];
|
||||
// if (in == NULL)
|
||||
// {
|
||||
// LL_WARNS() << "Memory allocation failure." << LL_ENDL;
|
||||
// return NULL;
|
||||
// }
|
||||
// is.read((char*) in, size);
|
||||
// const U32 CHUNK = 0x4000;
|
||||
|
||||
// U8 out[CHUNK];
|
||||
|
||||
// strm.zalloc = Z_NULL;
|
||||
// strm.zfree = Z_NULL;
|
||||
// strm.opaque = Z_NULL;
|
||||
// strm.avail_in = size;
|
||||
// strm.next_in = in;
|
||||
// U8 *in = new(std::nothrow) U8[size];
|
||||
// if (in == NULL)
|
||||
// {
|
||||
// LL_WARNS() << "Memory allocation failure." << LL_ENDL;
|
||||
// return NULL;
|
||||
// }
|
||||
// is.read((char*) in, size);
|
||||
|
||||
// valid = true; // <FS:ND/> Default is all okay.
|
||||
// S32 ret = inflateInit2(&strm, windowBits | ENABLE_ZLIB_GZIP );
|
||||
// do
|
||||
// {
|
||||
// strm.avail_out = CHUNK;
|
||||
// strm.next_out = out;
|
||||
// ret = inflate(&strm, Z_NO_FLUSH);
|
||||
// if (ret == Z_STREAM_ERROR)
|
||||
// {
|
||||
// inflateEnd(&strm);
|
||||
// // free(result);
|
||||
// if( result )
|
||||
// free(result);
|
||||
// delete [] in;
|
||||
// in = NULL; result = NULL;// <FS:ND> Or we get a double free aftr the while loop ...
|
||||
// valid = false;
|
||||
// }
|
||||
|
||||
// switch (ret)
|
||||
// {
|
||||
// case Z_NEED_DICT:
|
||||
// ret = Z_DATA_ERROR;
|
||||
// case Z_DATA_ERROR:
|
||||
// case Z_MEM_ERROR:
|
||||
// inflateEnd(&strm);
|
||||
// // free(result);
|
||||
// if( result )
|
||||
// free(result);
|
||||
// delete [] in;
|
||||
// valid = false;
|
||||
// in = NULL; result = NULL;// <FS:ND> Or we get a double free aftr the while loop ...
|
||||
// break;
|
||||
// }
|
||||
// U8 out[CHUNK];
|
||||
|
||||
// if( valid ) {// <FS:ND> in case this stream is invalid, do not pass the already freed buffer to realloc.
|
||||
|
||||
// U32 have = CHUNK-strm.avail_out;
|
||||
// strm.zalloc = Z_NULL;
|
||||
// strm.zfree = Z_NULL;
|
||||
// strm.opaque = Z_NULL;
|
||||
// strm.avail_in = size;
|
||||
// strm.next_in = in;
|
||||
|
||||
// U8* new_result = (U8*) realloc(result, cur_size + have);
|
||||
// if (new_result == NULL)
|
||||
// {
|
||||
// LL_WARNS() << "Failed to unzip LLSD NavMesh block: can't reallocate memory, current size: " << cur_size
|
||||
// << " bytes; requested " << cur_size + have
|
||||
// << " bytes; total syze: ." << size << " bytes."
|
||||
// << LL_ENDL;
|
||||
// inflateEnd(&strm);
|
||||
// if (result)
|
||||
// {
|
||||
// free(result);
|
||||
// }
|
||||
// delete[] in;
|
||||
// valid = false;
|
||||
// return NULL;
|
||||
// }
|
||||
// result = new_result;
|
||||
// memcpy(result+cur_size, out, have);
|
||||
// cur_size += have;
|
||||
// valid = true; // <FS:ND/> Default is all okay.
|
||||
// S32 ret = inflateInit2(&strm, windowBits | ENABLE_ZLIB_GZIP );
|
||||
// do
|
||||
// {
|
||||
// strm.avail_out = CHUNK;
|
||||
// strm.next_out = out;
|
||||
// ret = inflate(&strm, Z_NO_FLUSH);
|
||||
// if (ret == Z_STREAM_ERROR)
|
||||
// {
|
||||
// inflateEnd(&strm);
|
||||
// // free(result);
|
||||
// if( result )
|
||||
// free(result);
|
||||
// delete [] in;
|
||||
// in = NULL; result = NULL;// <FS:ND> Or we get a double free aftr the while loop ...
|
||||
// valid = false;
|
||||
// }
|
||||
|
||||
// } // </FS:ND>
|
||||
// switch (ret)
|
||||
// {
|
||||
// case Z_NEED_DICT:
|
||||
// ret = Z_DATA_ERROR;
|
||||
// case Z_DATA_ERROR:
|
||||
// case Z_MEM_ERROR:
|
||||
// inflateEnd(&strm);
|
||||
// // free(result);
|
||||
// if( result )
|
||||
// free(result);
|
||||
// delete [] in;
|
||||
// valid = false;
|
||||
// in = NULL; result = NULL;// <FS:ND> Or we get a double free aftr the while loop ...
|
||||
// break;
|
||||
// }
|
||||
|
||||
// } while (ret == Z_OK);
|
||||
// if( valid ) {// <FS:ND> in case this stream is invalid, do not pass the already freed buffer to realloc.
|
||||
|
||||
// inflateEnd(&strm);
|
||||
// delete [] in;
|
||||
// U32 have = CHUNK-strm.avail_out;
|
||||
|
||||
// if (ret != Z_STREAM_END)
|
||||
// {
|
||||
// // <FS:ND> result might have been freed above. And calling free with a null pointer is not defined.
|
||||
// // free(result);
|
||||
// if( result )
|
||||
// free(result);
|
||||
// // </FS:ND>
|
||||
|
||||
// valid = false;
|
||||
// return NULL;
|
||||
// }
|
||||
// U8* new_result = (U8*) realloc(result, cur_size + have);
|
||||
// if (new_result == NULL)
|
||||
// {
|
||||
// LL_WARNS() << "Failed to unzip LLSD NavMesh block: can't reallocate memory, current size: " << cur_size
|
||||
// << " bytes; requested " << cur_size + have
|
||||
// << " bytes; total syze: ." << size << " bytes."
|
||||
// << LL_ENDL;
|
||||
// inflateEnd(&strm);
|
||||
// if (result)
|
||||
// {
|
||||
// free(result);
|
||||
// }
|
||||
// delete[] in;
|
||||
// valid = false;
|
||||
// return NULL;
|
||||
// }
|
||||
// result = new_result;
|
||||
// memcpy(result+cur_size, out, have);
|
||||
// cur_size += have;
|
||||
|
||||
// //result now points to the decompressed LLSD block
|
||||
// {
|
||||
// outsize= cur_size;
|
||||
// valid = true;
|
||||
// }
|
||||
// } // </FS:ND>
|
||||
|
||||
// return result;
|
||||
// }
|
||||
// } while (ret == Z_OK);
|
||||
|
||||
// inflateEnd(&strm);
|
||||
// delete [] in;
|
||||
|
||||
// if (ret != Z_STREAM_END)
|
||||
// {
|
||||
// // <FS:ND> result might have been freed above. And calling free with a null pointer is not defined.
|
||||
// // free(result);
|
||||
// if( result )
|
||||
// free(result);
|
||||
// // </FS:ND>
|
||||
|
||||
// valid = false;
|
||||
// return NULL;
|
||||
// }
|
||||
|
||||
// //result now points to the decompressed LLSD block
|
||||
// {
|
||||
// outsize= cur_size;
|
||||
// valid = true;
|
||||
// }
|
||||
|
||||
// return result;
|
||||
// }
|
||||
if (size == 0)
|
||||
{
|
||||
LL_WARNS() << "No data to unzip." << LL_ENDL;
|
||||
|
|
@ -2578,33 +2430,33 @@ U8* unzip_llsdNavMesh( bool& valid, size_t& outsize, std::istream& is, S32 size
|
|||
return nullptr;
|
||||
}
|
||||
|
||||
is.read((char*) in.get(), size);
|
||||
is.read((char*)in.get(), size);
|
||||
return unzip_llsdNavMesh(valid, outsize, in.get(), size);
|
||||
}
|
||||
|
||||
U8* unzip_llsdNavMesh( bool& valid, unsigned int& outsize, const U8* in, S32 size )
|
||||
U8* unzip_llsdNavMesh(bool& valid, unsigned int& outsize, const U8* in, S32 size)
|
||||
{
|
||||
if (size == 0)
|
||||
{
|
||||
LL_WARNS() << "No data to unzip." << LL_ENDL;
|
||||
return nullptr;
|
||||
}
|
||||
U8* result = NULL;
|
||||
U8* result = nullptr;
|
||||
U32 cur_size = 0;
|
||||
z_stream strm;
|
||||
|
||||
|
||||
const U32 CHUNK = 0x4000;
|
||||
|
||||
U8 out[CHUNK];
|
||||
|
||||
|
||||
strm.zalloc = Z_NULL;
|
||||
strm.zfree = Z_NULL;
|
||||
strm.opaque = Z_NULL;
|
||||
strm.avail_in = size;
|
||||
strm.next_in = const_cast<U8*>(in);
|
||||
|
||||
|
||||
S32 ret = inflateInit2(&strm, windowBits | ENABLE_ZLIB_GZIP );
|
||||
|
||||
S32 ret = inflateInit2(&strm, windowBits | ENABLE_ZLIB_GZIP);
|
||||
do
|
||||
{
|
||||
strm.avail_out = CHUNK;
|
||||
|
|
@ -2614,26 +2466,26 @@ U8* unzip_llsdNavMesh( bool& valid, unsigned int& outsize, const U8* in, S32 siz
|
|||
{
|
||||
inflateEnd(&strm);
|
||||
free(result);
|
||||
return NULL;
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
|
||||
switch (ret)
|
||||
{
|
||||
case Z_NEED_DICT:
|
||||
ret = Z_DATA_ERROR;
|
||||
// [[fallthrough]]; // <FS:Beq> TODO when we have C++17 compilation.
|
||||
[[fallthrough]];
|
||||
case Z_DATA_ERROR:
|
||||
case Z_MEM_ERROR:
|
||||
inflateEnd(&strm);
|
||||
free(result);
|
||||
valid = false;
|
||||
return NULL;
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
U32 have = CHUNK-strm.avail_out;
|
||||
U32 have = CHUNK - strm.avail_out;
|
||||
|
||||
U8* new_result = (U8*) realloc(result, cur_size + have);
|
||||
if (new_result == NULL)
|
||||
U8* new_result = (U8*)realloc(result, cur_size + have);
|
||||
if (!new_result)
|
||||
{
|
||||
LL_WARNS() << "Failed to unzip LLSD NavMesh block: can't reallocate memory, current size: " << cur_size
|
||||
<< " bytes; requested " << cur_size + have
|
||||
|
|
@ -2645,10 +2497,10 @@ U8* unzip_llsdNavMesh( bool& valid, unsigned int& outsize, const U8* in, S32 siz
|
|||
free(result);
|
||||
}
|
||||
valid = false;
|
||||
return NULL;
|
||||
return nullptr;
|
||||
}
|
||||
result = new_result;
|
||||
memcpy(result+cur_size, out, have);
|
||||
memcpy(result + cur_size, out, have);
|
||||
cur_size += have;
|
||||
|
||||
} while (ret == Z_OK);
|
||||
|
|
@ -2659,17 +2511,18 @@ U8* unzip_llsdNavMesh( bool& valid, unsigned int& outsize, const U8* in, S32 siz
|
|||
{
|
||||
free(result);
|
||||
valid = false;
|
||||
return NULL;
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
//result now points to the decompressed LLSD block
|
||||
{
|
||||
outsize= cur_size;
|
||||
valid = true;
|
||||
outsize = cur_size;
|
||||
valid = true;
|
||||
}
|
||||
|
||||
return result;
|
||||
}
|
||||
// </FS:Beq pp Rye>
|
||||
|
||||
char* strip_deprecated_header(char* in, llssize& cur_size, llssize* header_size)
|
||||
{
|
||||
|
|
@ -2689,4 +2542,4 @@ char* strip_deprecated_header(char* in, llssize& cur_size, llssize* header_size)
|
|||
|
||||
return in;
|
||||
}
|
||||
// </FS:Beq pp Rye>
|
||||
|
||||
|
|
|
|||
|
|
@ -858,14 +858,12 @@ public:
|
|||
ZR_SIZE_ERROR,
|
||||
ZR_DATA_ERROR,
|
||||
ZR_PARSE_ERROR,
|
||||
// <FS:Beq pp Rye> Add non-allocating variants of unzip_llsd
|
||||
ZR_BUFFER_ERROR,
|
||||
ZR_VERSION_ERROR
|
||||
// </FS:Beq>
|
||||
ZR_BUFFER_ERROR,
|
||||
ZR_VERSION_ERROR
|
||||
} EZipRresult;
|
||||
// return OK or reason for failure
|
||||
static EZipRresult unzip_llsd(LLSD& data, std::istream& is, S32 size);
|
||||
static EZipRresult unzip_llsd(LLSD& data, const U8* in, S32 size); // <FS:Beq pp Rye/> Add non-allocating variants of unzip_llsd
|
||||
static EZipRresult unzip_llsd(LLSD& data, const U8* in, S32 size);
|
||||
};
|
||||
|
||||
//dirty little zip functions -- yell at davep
|
||||
|
|
@ -878,5 +876,4 @@ LL_COMMON_API U8* unzip_llsdNavMesh(bool& valid, unsigned int& outsize, const U8
|
|||
|
||||
// returns a pointer to the array or past the array if the deprecated header exists
|
||||
LL_COMMON_API char* strip_deprecated_header(char* in, llssize& cur_size, llssize* header_size = nullptr);
|
||||
// </FS:Beq>
|
||||
#endif // LL_LLSDSERIALIZE_H
|
||||
|
|
|
|||
|
|
@ -1027,44 +1027,6 @@ LLUUID::LLUUID()
|
|||
// </FS>
|
||||
}
|
||||
|
||||
// Copy constructor
|
||||
LLUUID::LLUUID(const LLUUID& rhs)
|
||||
{
|
||||
LL_PROFILE_ZONE_SCOPED;
|
||||
// <FS> Fix for misaligned unsigned ints in LLUUID; by Sovereign Engineer / Shyotl Kuhr
|
||||
//U32 *tmp = (U32 *)mData;
|
||||
//U32 *rhstmp = (U32 *)rhs.mData;
|
||||
//tmp[0] = rhstmp[0];
|
||||
//tmp[1] = rhstmp[1];
|
||||
//tmp[2] = rhstmp[2];
|
||||
//tmp[3] = rhstmp[3];
|
||||
memcpy(mData, rhs.mData, sizeof(mData));
|
||||
// </FS>
|
||||
}
|
||||
|
||||
LLUUID::~LLUUID()
|
||||
{
|
||||
}
|
||||
|
||||
// Assignment
|
||||
LLUUID& LLUUID::operator=(const LLUUID& rhs)
|
||||
{
|
||||
LL_PROFILE_ZONE_SCOPED;
|
||||
// <FS> Fix for misaligned unsigned ints in LLUUID; by Sovereign Engineer / Shyotl Kuhr
|
||||
//// No need to check the case where this==&rhs. The branch is slower than the write.
|
||||
//U32 *tmp = (U32 *)mData;
|
||||
//U32 *rhstmp = (U32 *)rhs.mData;
|
||||
//tmp[0] = rhstmp[0];
|
||||
//tmp[1] = rhstmp[1];
|
||||
//tmp[2] = rhstmp[2];
|
||||
//tmp[3] = rhstmp[3];
|
||||
|
||||
memcpy(mData, rhs.mData, sizeof(mData));
|
||||
// </FS>
|
||||
return *this;
|
||||
}
|
||||
|
||||
|
||||
LLUUID::LLUUID(const char *in_string)
|
||||
{
|
||||
if (!in_string || in_string[0] == 0)
|
||||
|
|
|
|||
|
|
@ -29,11 +29,10 @@
|
|||
#include <iostream>
|
||||
#include <set>
|
||||
#include <vector>
|
||||
#include <cstring> // <FS:Beq> for std::memmove
|
||||
#include "stdtypes.h"
|
||||
#include "llpreprocessor.h"
|
||||
#include <boost/functional/hash.hpp>
|
||||
#include "llprofiler.h"
|
||||
|
||||
class LLMutex;
|
||||
|
||||
const S32 UUID_BYTES = 16;
|
||||
|
|
@ -56,12 +55,7 @@ public:
|
|||
LLUUID();
|
||||
explicit LLUUID(const char *in_string); // Convert from string.
|
||||
explicit LLUUID(const std::string& in_string); // Convert from string.
|
||||
LLUUID(const LLUUID &in);
|
||||
LLUUID(LLUUID&& rhs) noexcept { LL_PROFILE_ZONE_SCOPED; std::memmove(mData, rhs.mData, sizeof(mData));};
|
||||
LLUUID &operator=(const LLUUID &rhs);
|
||||
LLUUID &operator=(LLUUID &&rhs) noexcept { LL_PROFILE_ZONE_SCOPED; std::memmove(mData, rhs.mData, sizeof(mData));return *this;};
|
||||
|
||||
~LLUUID();
|
||||
~LLUUID() = default;
|
||||
|
||||
//
|
||||
// MANIPULATORS
|
||||
|
|
@ -189,6 +183,9 @@ public:
|
|||
|
||||
U8 mData[UUID_BYTES];
|
||||
};
|
||||
static_assert(std::is_trivially_copyable<LLUUID>::value, "LLUUID must be trivial copy");
|
||||
static_assert(std::is_trivially_move_assignable<LLUUID>::value, "LLUUID must be trivial move");
|
||||
static_assert(std::is_standard_layout<LLUUID>::value, "LLUUID must be a standard layout type");
|
||||
|
||||
typedef std::vector<LLUUID> uuid_vec_t;
|
||||
typedef std::set<LLUUID> uuid_set_t;
|
||||
|
|
|
|||
|
|
@ -248,8 +248,6 @@ namespace LL
|
|||
TimePoint until = TimePoint::clock::now() + std::chrono::hours(24);
|
||||
pop_result popped = tryPopUntil_(lock, until, tt);
|
||||
if (popped == POPPED)
|
||||
// <FS:Ansariel> Prevent RVO elision
|
||||
//return std::move(tt);
|
||||
return tt;
|
||||
|
||||
// DONE: throw, just as super::pop() does
|
||||
|
|
|
|||
|
|
@ -66,16 +66,16 @@ LLDir_Mac::LLDir_Mac()
|
|||
|
||||
const std::string secondLifeString = "Firestorm";
|
||||
|
||||
std::string *executablepathstr = getSystemExecutableFolder();
|
||||
std::string executablepathstr = getSystemExecutableFolder();
|
||||
|
||||
//NOTE: LLINFOS/LLERRS will not output to log here. The streams are not initialized.
|
||||
|
||||
if (executablepathstr)
|
||||
if (!executablepathstr.empty())
|
||||
{
|
||||
// mExecutablePathAndName
|
||||
mExecutablePathAndName = *executablepathstr;
|
||||
mExecutablePathAndName = executablepathstr;
|
||||
|
||||
boost::filesystem::path executablepath(*executablepathstr);
|
||||
boost::filesystem::path executablepath(executablepathstr);
|
||||
|
||||
# ifndef BOOST_SYSTEM_NO_DEPRECATED
|
||||
#endif
|
||||
|
|
@ -83,8 +83,8 @@ LLDir_Mac::LLDir_Mac()
|
|||
mExecutableDir = executablepath.parent_path().string();
|
||||
|
||||
// mAppRODataDir
|
||||
std::string *resourcepath = getSystemResourceFolder();
|
||||
mAppRODataDir = *resourcepath;
|
||||
std::string resourcepath = getSystemResourceFolder();
|
||||
mAppRODataDir = resourcepath;
|
||||
|
||||
// *NOTE: When running in a dev tree, use the copy of
|
||||
// skins in indra/newview/ rather than in the application bundle. This
|
||||
|
|
@ -110,11 +110,11 @@ LLDir_Mac::LLDir_Mac()
|
|||
}
|
||||
|
||||
// mOSUserDir
|
||||
std::string *appdir = getSystemApplicationSupportFolder();
|
||||
std::string appdir = getSystemApplicationSupportFolder();
|
||||
std::string rootdir;
|
||||
|
||||
//Create root directory
|
||||
if (CreateDirectory(*appdir, secondLifeString, &rootdir))
|
||||
if (CreateDirectory(appdir, secondLifeString, &rootdir))
|
||||
{
|
||||
|
||||
// Save the full path to the folder
|
||||
|
|
@ -128,12 +128,10 @@ LLDir_Mac::LLDir_Mac()
|
|||
}
|
||||
|
||||
//mOSCacheDir
|
||||
std::string *cachedir = getSystemCacheFolder();
|
||||
|
||||
if (cachedir)
|
||||
|
||||
std::string cachedir = getSystemCacheFolder();
|
||||
if (!cachedir.empty())
|
||||
{
|
||||
mOSCacheDir = *cachedir;
|
||||
mOSCacheDir = cachedir;
|
||||
//TODO: This changes from ~/Library/Cache/Secondlife to ~/Library/Cache/com.app.secondlife/Secondlife. Last dir level could go away.
|
||||
//<FS:TS> Adjust the cache directory to match what's expected in lldir.
|
||||
//CreateDirectory(mOSCacheDir, secondLifeString, NULL);
|
||||
|
|
@ -159,12 +157,10 @@ LLDir_Mac::LLDir_Mac()
|
|||
|
||||
// mTempDir
|
||||
//Aura 120920 boost::filesystem::temp_directory_path() not yet implemented on mac. :(
|
||||
std::string *tmpdir = getSystemTempFolder();
|
||||
if (tmpdir)
|
||||
std::string tmpdir = getSystemTempFolder();
|
||||
if (!tmpdir.empty())
|
||||
{
|
||||
|
||||
CreateDirectory(*tmpdir, secondLifeString, &mTempDir);
|
||||
if (tmpdir) delete tmpdir;
|
||||
CreateDirectory(tmpdir, secondLifeString, &mTempDir);
|
||||
}
|
||||
|
||||
mWorkingDir = getCurPath();
|
||||
|
|
|
|||
|
|
@ -33,11 +33,11 @@
|
|||
|
||||
#include <iostream>
|
||||
|
||||
std::string* getSystemTempFolder();
|
||||
std::string* getSystemCacheFolder();
|
||||
std::string* getSystemApplicationSupportFolder();
|
||||
std::string* getSystemResourceFolder();
|
||||
std::string* getSystemExecutableFolder();
|
||||
std::string getSystemTempFolder();
|
||||
std::string getSystemCacheFolder();
|
||||
std::string getSystemApplicationSupportFolder();
|
||||
std::string getSystemResourceFolder();
|
||||
std::string getSystemExecutableFolder();
|
||||
|
||||
|
||||
#endif // LL_LLDIR_UTILS_OBJC_H
|
||||
|
|
|
|||
|
|
@ -30,75 +30,75 @@
|
|||
#include "lldir_utils_objc.h"
|
||||
#import <Cocoa/Cocoa.h>
|
||||
|
||||
std::string* getSystemTempFolder()
|
||||
std::string getSystemTempFolder()
|
||||
{
|
||||
NSAutoreleasePool *pool = [[NSAutoreleasePool alloc] init];
|
||||
NSString * tempDir = NSTemporaryDirectory();
|
||||
if (tempDir == nil)
|
||||
tempDir = @"/tmp";
|
||||
std::string *result = ( new std::string([tempDir UTF8String]) );
|
||||
[pool release];
|
||||
std::string result;
|
||||
@autoreleasepool {
|
||||
NSString * tempDir = NSTemporaryDirectory();
|
||||
if (tempDir == nil)
|
||||
tempDir = @"/tmp";
|
||||
result = std::string([tempDir UTF8String]);
|
||||
}
|
||||
|
||||
return result;
|
||||
}
|
||||
|
||||
//findSystemDirectory scoped exclusively to this file.
|
||||
std::string* findSystemDirectory(NSSearchPathDirectory searchPathDirectory,
|
||||
std::string findSystemDirectory(NSSearchPathDirectory searchPathDirectory,
|
||||
NSSearchPathDomainMask domainMask)
|
||||
{
|
||||
NSAutoreleasePool *pool = [[NSAutoreleasePool alloc] init];
|
||||
|
||||
std::string *result = nil;
|
||||
NSString *path = nil;
|
||||
|
||||
// Search for the path
|
||||
NSArray* paths = NSSearchPathForDirectoriesInDomains(searchPathDirectory,
|
||||
domainMask,
|
||||
YES);
|
||||
if ([paths count])
|
||||
{
|
||||
path = [paths objectAtIndex:0];
|
||||
//HACK: Always attempt to create directory, ignore errors.
|
||||
NSError *error = nil;
|
||||
|
||||
[[NSFileManager defaultManager] createDirectoryAtPath:path withIntermediateDirectories:YES attributes:nil error:&error];
|
||||
|
||||
std::string result;
|
||||
@autoreleasepool {
|
||||
NSString *path = nil;
|
||||
|
||||
result = new std::string([path UTF8String]);
|
||||
// Search for the path
|
||||
NSArray* paths = NSSearchPathForDirectoriesInDomains(searchPathDirectory,
|
||||
domainMask,
|
||||
YES);
|
||||
if ([paths count])
|
||||
{
|
||||
path = [paths objectAtIndex:0];
|
||||
//HACK: Always attempt to create directory, ignore errors.
|
||||
NSError *error = nil;
|
||||
|
||||
[[NSFileManager defaultManager] createDirectoryAtPath:path withIntermediateDirectories:YES attributes:nil error:&error];
|
||||
|
||||
|
||||
result = std::string([path UTF8String]);
|
||||
}
|
||||
}
|
||||
[pool release];
|
||||
return result;
|
||||
}
|
||||
|
||||
std::string* getSystemExecutableFolder()
|
||||
std::string getSystemExecutableFolder()
|
||||
{
|
||||
NSAutoreleasePool *pool = [[NSAutoreleasePool alloc] init];
|
||||
|
||||
NSString *bundlePath = [[NSBundle mainBundle] executablePath];
|
||||
std::string *result = (new std::string([bundlePath UTF8String]));
|
||||
[pool release];
|
||||
std::string result;
|
||||
@autoreleasepool {
|
||||
NSString *bundlePath = [[NSBundle mainBundle] executablePath];
|
||||
result = std::string([bundlePath UTF8String]);
|
||||
}
|
||||
|
||||
return result;
|
||||
}
|
||||
|
||||
std::string* getSystemResourceFolder()
|
||||
std::string getSystemResourceFolder()
|
||||
{
|
||||
NSAutoreleasePool *pool = [[NSAutoreleasePool alloc] init];
|
||||
|
||||
NSString *bundlePath = [[NSBundle mainBundle] resourcePath];
|
||||
std::string *result = (new std::string([bundlePath UTF8String]));
|
||||
[pool release];
|
||||
std::string result;
|
||||
@autoreleasepool {
|
||||
NSString *bundlePath = [[NSBundle mainBundle] resourcePath];
|
||||
result = std::string([bundlePath UTF8String]);
|
||||
}
|
||||
|
||||
return result;
|
||||
}
|
||||
|
||||
std::string* getSystemCacheFolder()
|
||||
std::string getSystemCacheFolder()
|
||||
{
|
||||
return findSystemDirectory (NSCachesDirectory,
|
||||
NSUserDomainMask);
|
||||
}
|
||||
|
||||
std::string* getSystemApplicationSupportFolder()
|
||||
std::string getSystemApplicationSupportFolder()
|
||||
{
|
||||
return findSystemDirectory (NSApplicationSupportDirectory,
|
||||
NSUserDomainMask);
|
||||
|
|
|
|||
|
|
@ -257,12 +257,7 @@ void LLPngWrapper::normalizeImage()
|
|||
png_set_strip_16(mReadPngPtr);
|
||||
}
|
||||
|
||||
#if LL_DARWIN
|
||||
const F64 SCREEN_GAMMA = 1.8;
|
||||
#else
|
||||
const F64 SCREEN_GAMMA = 2.2;
|
||||
#endif
|
||||
|
||||
if (png_get_gAMA(mReadPngPtr, mReadInfoPtr, &mGamma))
|
||||
{
|
||||
png_set_gamma(mReadPngPtr, SCREEN_GAMMA, mGamma);
|
||||
|
|
|
|||
File diff suppressed because it is too large
Load Diff
|
|
@ -52,6 +52,12 @@
|
|||
#include "llmeshoptimizer.h"
|
||||
#include "lltimer.h"
|
||||
|
||||
// <FS:Zi> Use Alchemy's vertex cache optimizer for Linux. Thank you!
|
||||
#ifdef LL_LINUX
|
||||
#include "meshoptimizer/meshoptimizer.h"
|
||||
#endif
|
||||
// </FS:Zi> Use Alchemy's vertex cache optimizer for Linux. Thank you!
|
||||
|
||||
#define DEBUG_SILHOUETTE_BINORMALS 0
|
||||
#define DEBUG_SILHOUETTE_NORMALS 0 // TomY: Use this to display normals using the silhouette
|
||||
#define DEBUG_SILHOUETTE_EDGE_MAP 0 // DaveP: Use this to display edge map using the silhouette
|
||||
|
|
@ -2406,13 +2412,12 @@ bool LLVolume::unpackVolumeFaces(std::istream& is, S32 size)
|
|||
LL_DEBUGS("MeshStreaming") << "Failed to unzip LLSD blob for LoD with code " << uzip_result << " , will probably fetch from sim again." << LL_ENDL;
|
||||
return false;
|
||||
}
|
||||
// <FS:Beq pp Rye> Add non-allocating variants of of unpackVolumeFaces
|
||||
return unpackVolumeFacesInternal(mdl);
|
||||
}
|
||||
|
||||
bool LLVolume::unpackVolumeFaces(U8* in_data, S32 size)
|
||||
{
|
||||
//input stream is now pointing at a zlib compressed block of LLSD
|
||||
//input data is now pointing at a zlib compressed block of LLSD
|
||||
//decompress block
|
||||
LLSD mdl;
|
||||
U32 uzip_result = LLUZipHelper::unzip_llsd(mdl, in_data, size);
|
||||
|
|
@ -2426,7 +2431,6 @@ bool LLVolume::unpackVolumeFaces(U8* in_data, S32 size)
|
|||
|
||||
bool LLVolume::unpackVolumeFacesInternal(const LLSD& mdl)
|
||||
{
|
||||
// </FS:Beq pp Rye>
|
||||
{
|
||||
U32 face_count = mdl.size();
|
||||
|
||||
|
|
@ -5434,6 +5438,204 @@ public:
|
|||
}
|
||||
};
|
||||
|
||||
// <FS:Zi> Use Alchemy's vertex cache optimizer for Linux. Thank you!
|
||||
#ifdef LL_LINUX
|
||||
|
||||
bool allocateVertices(LLVolumeFace* self, S32 num_verts)
|
||||
{
|
||||
bool copy = false;
|
||||
|
||||
if (!copy || !num_verts)
|
||||
{
|
||||
ll_aligned_free<64>(self->mPositions);
|
||||
self->mPositions = nullptr;
|
||||
self->mNormals = nullptr;
|
||||
self->mTexCoords = nullptr;
|
||||
}
|
||||
|
||||
if (num_verts)
|
||||
{
|
||||
const U32 new_vsize = num_verts * sizeof(LLVector4a);
|
||||
const U32 new_nsize = new_vsize;
|
||||
const U32 new_tcsize = (num_verts * sizeof(LLVector2) + 0xF) & ~0xF;
|
||||
const U32 new_size = new_vsize + new_nsize + new_tcsize;
|
||||
|
||||
//allocate new buffer space
|
||||
LLVector4a* old_buf = self->mPositions;
|
||||
self->mPositions = (LLVector4a*)ll_aligned_malloc<64>(new_size);
|
||||
if (!self->mPositions)
|
||||
{
|
||||
LL_WARNS("LLVOLUME") << "Allocation of positions vector[" << new_size << "] failed. " << LL_ENDL;
|
||||
return false;
|
||||
}
|
||||
self->mNormals = self->mPositions + num_verts;
|
||||
self->mTexCoords = (LLVector2*)(self->mNormals + num_verts);
|
||||
|
||||
if (copy && old_buf)
|
||||
{
|
||||
U32 verts_to_copy = std::min(self->mNumVertices, num_verts);
|
||||
if (verts_to_copy)
|
||||
{
|
||||
const U32 old_vsize = verts_to_copy * sizeof(LLVector4a);
|
||||
const U32 old_nsize = old_vsize;
|
||||
const U32 old_tcsize = (verts_to_copy * sizeof(LLVector2) + 0xF) & ~0xF;
|
||||
|
||||
LLVector4a::memcpyNonAliased16((F32*)self->mPositions, (F32*)old_buf, old_vsize);
|
||||
LLVector4a::memcpyNonAliased16((F32*)self->mNormals, (F32*)(old_buf + self->mNumVertices), old_nsize);
|
||||
LLVector4a::memcpyNonAliased16((F32*)self->mTexCoords, (F32*)(old_buf + self->mNumVertices * 2), old_tcsize);
|
||||
}
|
||||
ll_aligned_free<64>(old_buf);
|
||||
}
|
||||
}
|
||||
|
||||
self->mNumAllocatedVertices = num_verts;
|
||||
return true;
|
||||
}
|
||||
|
||||
bool LLVolumeFace::cacheOptimize()
|
||||
{
|
||||
llassert(!mOptimized);
|
||||
mOptimized = TRUE;
|
||||
|
||||
if (mNumVertices < 3 || mNumIndices < 3)
|
||||
{ //nothing to do
|
||||
return true;
|
||||
}
|
||||
|
||||
struct buffer_data_t {
|
||||
void** dst; // Double pointer to volume attribute data. Avoids fixup after reallocating buffers on resize.
|
||||
void* scratch; // Scratch buffer. Allocated with vert count from meshopt_generateVertexRemapMulti
|
||||
size_t stride; // Stride between continguous attributes
|
||||
};
|
||||
std::vector<meshopt_Stream> streams; // Contains data necessary for meshopt_generateVertexRemapMulti call
|
||||
std::vector<buffer_data_t> buffers; // Contains data necessary for meshopt_remapVertexBuffer calls.
|
||||
|
||||
{
|
||||
static struct { size_t offs; size_t size; size_t stride; } ref_streams[] = {
|
||||
{ (U64) &mPositions - (U64) this, sizeof(float) * 3, sizeof(mPositions[0]) },
|
||||
{ (U64) &mNormals - (U64) this, sizeof(float) * 3, sizeof(mNormals[0]) }, // Subsection of mPositions allocation
|
||||
{ (U64) &mTexCoords - (U64) this, sizeof(float) * 2, sizeof(mTexCoords[0]) }, // Subsection of mPositions allocation
|
||||
{ (U64) &mTangents - (U64) this, sizeof(float) * 3, sizeof(mTangents[0]) },
|
||||
{ (U64) &mWeights - (U64) this, sizeof(float) * 3, sizeof(mWeights[0]) },
|
||||
};
|
||||
|
||||
for (size_t i = 0; i < sizeof(ref_streams) / sizeof(ref_streams[0]); ++i)
|
||||
{
|
||||
void** ptr = reinterpret_cast<void**>((char*)this + ref_streams[i].offs);
|
||||
if (*ptr)
|
||||
{
|
||||
streams.push_back({ *ptr, ref_streams[i].size, ref_streams[i].stride });
|
||||
buffers.push_back({ ptr, nullptr, ref_streams[i].stride });
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
std::vector<unsigned int> remap;
|
||||
try
|
||||
{
|
||||
remap.reserve(mNumIndices);
|
||||
}
|
||||
catch (const std::bad_alloc&)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
size_t total_vertices = meshopt_generateVertexRemapMulti(remap.data(), mIndices, mNumIndices, mNumVertices, streams.data(), streams.size());
|
||||
meshopt_remapIndexBuffer(mIndices, mIndices, mNumIndices, remap.data());
|
||||
bool failed = false;
|
||||
for (auto& entry : buffers)
|
||||
{
|
||||
// Create scratch buffer for attribute data. Avoids extra allocs in meshopt_remapVertexBuffer calls
|
||||
void* buf_tmp = ll_aligned_malloc_16(entry.stride * total_vertices);
|
||||
if (!buf_tmp)
|
||||
{
|
||||
failed = true;
|
||||
break;
|
||||
}
|
||||
entry.scratch = buf_tmp;
|
||||
// Write to scratch buffer
|
||||
meshopt_remapVertexBuffer(entry.scratch, *entry.dst, mNumVertices, entry.stride, remap.data());
|
||||
}
|
||||
|
||||
if (failed)
|
||||
{
|
||||
for (auto& entry : buffers)
|
||||
{
|
||||
// Release scratch buffer
|
||||
ll_aligned_free_16(entry.scratch);
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
if (mNumAllocatedVertices != total_vertices)
|
||||
{
|
||||
// New allocations will be transparently accessable through dereffing dest_buffers.
|
||||
if (!allocateVertices(this, total_vertices))
|
||||
{
|
||||
for (auto& entry : buffers)
|
||||
{
|
||||
// Release scratch buffer
|
||||
ll_aligned_free_16(entry.scratch);
|
||||
}
|
||||
allocateVertices(this, 0);
|
||||
allocateWeights(0);
|
||||
allocateTangents(0);
|
||||
return false;
|
||||
}
|
||||
|
||||
if (mWeights)
|
||||
{
|
||||
allocateWeights(total_vertices);
|
||||
if(!mWeights)
|
||||
{
|
||||
for (auto& entry : buffers)
|
||||
{
|
||||
// Release scratch buffer
|
||||
ll_aligned_free_16(entry.scratch);
|
||||
}
|
||||
allocateVertices(this, 0);
|
||||
allocateWeights(0);
|
||||
allocateTangents(0);
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
if (mTangents)
|
||||
{
|
||||
allocateTangents(total_vertices);
|
||||
if(!mTangents)
|
||||
{
|
||||
for (auto& entry : buffers)
|
||||
{
|
||||
// Release scratch buffer
|
||||
ll_aligned_free_16(entry.scratch);
|
||||
}
|
||||
allocateVertices(this, 0);
|
||||
allocateWeights(0);
|
||||
allocateTangents(0);
|
||||
return false;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
meshopt_optimizeVertexCache(mIndices, mIndices, mNumIndices, total_vertices);
|
||||
//meshopt_optimizeOverdraw(mIndices, mIndices, mNumIndices, (float*)buffers[0].scratch, total_vertices, buffers[0].stride, 1.05f);
|
||||
meshopt_optimizeVertexFetchRemap(remap.data(), mIndices, mNumIndices, total_vertices);
|
||||
meshopt_remapIndexBuffer(mIndices, mIndices, mNumIndices, remap.data());
|
||||
for (auto& entry : buffers)
|
||||
{
|
||||
// Write to llvolume attribute buffer
|
||||
meshopt_remapVertexBuffer(*entry.dst, entry.scratch, total_vertices, entry.stride, remap.data());
|
||||
// Release scratch buffer
|
||||
ll_aligned_free_16(entry.scratch);
|
||||
}
|
||||
mNumVertices = total_vertices;
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
#else
|
||||
// </FS:Zi> Use Alchemy's vertex cache optimizer for Linux. Thank you!
|
||||
|
||||
bool LLVolumeFace::cacheOptimize()
|
||||
{ //optimize for vertex cache according to Forsyth method:
|
||||
|
|
@ -5449,7 +5651,7 @@ bool LLVolumeFace::cacheOptimize()
|
|||
// windows version.
|
||||
//
|
||||
|
||||
#ifndef LL_LINUX
|
||||
// #ifndef LL_LINUX // <FS:Zi> Use Alchemy's vertex cache optimizer for Linux. Thank you!
|
||||
LLVCacheLRU cache;
|
||||
|
||||
if (mNumVertices < 3 || mNumIndices < 3)
|
||||
|
|
@ -5693,10 +5895,11 @@ bool LLVolumeFace::cacheOptimize()
|
|||
|
||||
//std::string result = llformat("ACMR pre/post: %.3f/%.3f -- %d triangles %d breaks", pre_acmr, post_acmr, mNumIndices/3, breaks);
|
||||
//LL_INFOS() << result << LL_ENDL;
|
||||
#endif
|
||||
// #endif // <FS:Zi> Use Alchemy's vertex cache optimizer for Linux. Thank you!
|
||||
|
||||
return true;
|
||||
}
|
||||
#endif // <FS:Zi> Use Alchemy's vertex cache optimizer for Linux. Thank you!
|
||||
|
||||
void LLVolumeFace::createOctree(F32 scaler, const LLVector4a& center, const LLVector4a& size)
|
||||
{
|
||||
|
|
@ -6643,15 +6846,48 @@ void LLVolumeFace::pushVertex(const LLVector4a& pos, const LLVector4a& norm, con
|
|||
|
||||
void LLVolumeFace::allocateTangents(S32 num_verts)
|
||||
{
|
||||
// <FS:Zi> Use Alchemy's vertex cache optimizer for Linux. Thank you!
|
||||
#ifdef LL_LINUX
|
||||
ll_aligned_free_16(mTangents);
|
||||
mTangents = nullptr;
|
||||
if (num_verts)
|
||||
{
|
||||
mTangents = (LLVector4a*)ll_aligned_malloc_16(sizeof(LLVector4a)*num_verts);
|
||||
if (!mTangents)
|
||||
{
|
||||
LL_WARNS("LLVOLUME") << "Allocation of binormals[" << sizeof(LLVector4a)*num_verts << "] failed" << LL_ENDL;
|
||||
return;
|
||||
}
|
||||
}
|
||||
return;
|
||||
#else
|
||||
// </FS:Zi> Use Alchemy's vertex cache optimizer for Linux. Thank you!
|
||||
ll_aligned_free_16(mTangents);
|
||||
mTangents = (LLVector4a*) ll_aligned_malloc_16(sizeof(LLVector4a)*num_verts);
|
||||
#endif // <FS:Zi> Use Alchemy's vertex cache optimizer for Linux. Thank you!
|
||||
}
|
||||
|
||||
void LLVolumeFace::allocateWeights(S32 num_verts)
|
||||
{
|
||||
// <FS:Zi> Use Alchemy's vertex cache optimizer for Linux. Thank you!
|
||||
#ifdef LL_LINUX
|
||||
ll_aligned_free_16(mWeights);
|
||||
mWeights = nullptr;
|
||||
if (num_verts)
|
||||
{
|
||||
mWeights = (LLVector4a*)ll_aligned_malloc_16(sizeof(LLVector4a)*num_verts);
|
||||
if (!mWeights)
|
||||
{
|
||||
LL_WARNS("LLVOLUME") << "Allocation of weights[" << sizeof(LLVector4a) * num_verts << "] failed" << LL_ENDL;
|
||||
return;
|
||||
}
|
||||
}
|
||||
return;
|
||||
#else
|
||||
// </FS:Zi> Use Alchemy's vertex cache optimizer for Linux. Thank you!
|
||||
ll_aligned_free_16(mWeights);
|
||||
mWeights = (LLVector4a*)ll_aligned_malloc_16(sizeof(LLVector4a)*num_verts);
|
||||
|
||||
#endif // <FS:Zi> Use Alchemy's vertex cache optimizer for Linux. Thank you!
|
||||
}
|
||||
|
||||
void LLVolumeFace::allocateJointIndices(S32 num_verts)
|
||||
|
|
|
|||
|
|
@ -1113,14 +1113,12 @@ protected:
|
|||
BOOL generate();
|
||||
void createVolumeFaces();
|
||||
public:
|
||||
virtual bool unpackVolumeFaces(std::istream& is, S32 size);
|
||||
// <FS:Beq pp Rye> Add non-allocating variants of of unpackVolumeFaces
|
||||
bool unpackVolumeFaces(std::istream& is, S32 size);
|
||||
bool unpackVolumeFaces(U8* in_data, S32 size);
|
||||
private:
|
||||
bool unpackVolumeFacesInternal(const LLSD& mdl);
|
||||
|
||||
public:
|
||||
// </FS:Beq pp Rye>
|
||||
virtual void setMeshAssetLoaded(BOOL loaded);
|
||||
virtual BOOL isMeshAssetLoaded();
|
||||
|
||||
|
|
|
|||
|
|
@ -754,14 +754,13 @@ BOOL LLDataPackerAsciiBuffer::packString(const std::string& value, const char *n
|
|||
|
||||
BOOL LLDataPackerAsciiBuffer::unpackString(std::string& value, const char *name)
|
||||
{
|
||||
BOOL success = TRUE;
|
||||
char valuestr[DP_BUFSIZE]; /*Flawfinder: ignore*/
|
||||
if (!getValueStr(name, valuestr, DP_BUFSIZE)) // NULL terminated
|
||||
{
|
||||
return FALSE;
|
||||
}
|
||||
value = valuestr;
|
||||
return success;
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
|
||||
|
|
|
|||
|
|
@ -482,7 +482,7 @@ static apr_status_t tcp_blocking_handshake(LLSocket::ptr_t handle, char * dataou
|
|||
|
||||
apr_size_t expected_len = outlen;
|
||||
|
||||
handle->setBlocking(1000);
|
||||
handle->setBlocking(100000); // <FS:Beq/> extend the arbitrary timeout value to 100ms. this should be more than enough for most LAN proxies and plenty for a localhost
|
||||
|
||||
rv = apr_socket_send(apr_socket, dataout, &outlen);
|
||||
if (APR_SUCCESS != rv)
|
||||
|
|
@ -498,7 +498,7 @@ static apr_status_t tcp_blocking_handshake(LLSocket::ptr_t handle, char * dataou
|
|||
rv = -1;
|
||||
}
|
||||
|
||||
ms_sleep(1);
|
||||
// ms_sleep(1); // <FS:Beq/> remove the unnecessary sleep.
|
||||
|
||||
if (APR_SUCCESS == rv)
|
||||
{
|
||||
|
|
|
|||
|
|
@ -92,7 +92,7 @@ namespace tut
|
|||
Sync sync;
|
||||
int foo = 0;
|
||||
LLCoprocedureManager::instance().initializePool("PoolName");
|
||||
LLUUID queueId = LLCoprocedureManager::instance().enqueueCoprocedure("PoolName", "ProcName",
|
||||
LLCoprocedureManager::instance().enqueueCoprocedure("PoolName", "ProcName",
|
||||
[&foo, &sync] (LLCoreHttpUtil::HttpCoroutineAdapter::ptr_t & ptr, const LLUUID & id) {
|
||||
sync.bump();
|
||||
foo = 1;
|
||||
|
|
|
|||
|
|
@ -107,9 +107,9 @@ protected:
|
|||
static std::string getElementLabel(daeElement *element);
|
||||
static size_t getSuffixPosition(std::string label);
|
||||
static std::string getLodlessLabel(daeElement *element);
|
||||
|
||||
static std::string preprocessDAE(std::string filename);
|
||||
static LODSuffixArray sLODSuffix; // <FS:Beq/> mesh loader suffix configuration
|
||||
public: // <FS:Beq/> open up for local mesh to use
|
||||
static std::string preprocessDAE(std::string filename);
|
||||
|
||||
private:
|
||||
U32 mGeneratedModelLimit; // Attempt to limit amount of generated submodels
|
||||
|
|
|
|||
|
|
@ -1429,6 +1429,16 @@ LLMeshSkinInfo::LLMeshSkinInfo(LLSD& skin):
|
|||
fromLLSD(skin);
|
||||
}
|
||||
|
||||
LLMeshSkinInfo::LLMeshSkinInfo(const LLUUID& mesh_id, LLSD& skin) :
|
||||
mMeshID(mesh_id),
|
||||
mPelvisOffset(0.0),
|
||||
mLockScaleIfJointPosition(false),
|
||||
mInvalidJointsScrubbed(false),
|
||||
mJointNumsInitialized(false)
|
||||
{
|
||||
fromLLSD(skin);
|
||||
}
|
||||
|
||||
void LLMeshSkinInfo::fromLLSD(LLSD& skin)
|
||||
{
|
||||
if (skin.has("joint_names"))
|
||||
|
|
|
|||
|
|
@ -43,12 +43,13 @@ class domMesh;
|
|||
#define MAX_MODEL_FACES 8
|
||||
|
||||
LL_ALIGN_PREFIX(16)
|
||||
class LLMeshSkinInfo
|
||||
class LLMeshSkinInfo : public LLRefCount
|
||||
{
|
||||
LL_ALIGN_NEW
|
||||
public:
|
||||
LLMeshSkinInfo();
|
||||
LLMeshSkinInfo(LLSD& data);
|
||||
LLMeshSkinInfo(const LLUUID& mesh_id, LLSD& data);
|
||||
void fromLLSD(LLSD& data);
|
||||
LLSD asLLSD(bool include_joints, bool lock_scale_if_joint_position) const;
|
||||
void updateHash();
|
||||
|
|
|
|||
|
|
@ -515,6 +515,17 @@ LLFlatListView::LLFlatListView(const LLFlatListView::Params& p)
|
|||
}
|
||||
};
|
||||
|
||||
LLFlatListView::~LLFlatListView()
|
||||
{
|
||||
for (pairs_iterator_t it = mItemPairs.begin(); it != mItemPairs.end(); ++it)
|
||||
{
|
||||
mItemsPanel->removeChild((*it)->first);
|
||||
(*it)->first->die();
|
||||
delete *it;
|
||||
}
|
||||
mItemPairs.clear();
|
||||
}
|
||||
|
||||
// virtual
|
||||
void LLFlatListView::draw()
|
||||
{
|
||||
|
|
|
|||
|
|
@ -307,6 +307,7 @@ public:
|
|||
|
||||
virtual S32 notify(const LLSD& info) ;
|
||||
|
||||
virtual ~LLFlatListView();
|
||||
protected:
|
||||
|
||||
/** Pairs LLpanel representing a single item LLPanel and LLSD associated with it */
|
||||
|
|
|
|||
|
|
@ -163,6 +163,7 @@ LLFolderView::LLFolderView(const Params& p)
|
|||
: LLFolderViewFolder(p),
|
||||
mScrollContainer( NULL ),
|
||||
mPopupMenuHandle(),
|
||||
mMenuFileName(p.options_menu),
|
||||
mAllowMultiSelect(p.allow_multiselect),
|
||||
mAllowDrag(p.allow_drag),
|
||||
mShowEmptyMessage(p.show_empty_message),
|
||||
|
|
@ -186,6 +187,7 @@ LLFolderView::LLFolderView(const Params& p)
|
|||
mDragStartY(0),
|
||||
// [/SL:KB]
|
||||
mCallbackRegistrar(NULL),
|
||||
mEnableRegistrar(NULL),
|
||||
mUseEllipses(p.use_ellipses),
|
||||
mDraggingOverItem(NULL),
|
||||
mStatusTextBox(NULL),
|
||||
|
|
@ -248,17 +250,6 @@ LLFolderView::LLFolderView(const Params& p)
|
|||
mStatusTextBox->setFollowsTop();
|
||||
addChild(mStatusTextBox);
|
||||
|
||||
|
||||
// make the popup menu available
|
||||
llassert(LLMenuGL::sMenuContainer != NULL);
|
||||
LLMenuGL* menu = LLUICtrlFactory::getInstance()->createFromFile<LLMenuGL>(p.options_menu, LLMenuGL::sMenuContainer, LLMenuHolderGL::child_registry_t::instance());
|
||||
if (!menu)
|
||||
{
|
||||
menu = LLUICtrlFactory::getDefaultWidget<LLMenuGL>("inventory_menu");
|
||||
}
|
||||
menu->setBackgroundColor(LLUIColorTable::instance().getColor("MenuPopupBgColor"));
|
||||
mPopupMenuHandle = menu->getHandle();
|
||||
|
||||
mViewModelItem->openItem();
|
||||
|
||||
mAreChildrenInited = true; // root folder is a special case due to not being loaded normally, assume that it's inited.
|
||||
|
|
@ -280,6 +271,7 @@ LLFolderView::~LLFolderView( void )
|
|||
mStatusTextBox = NULL;
|
||||
|
||||
if (mPopupMenuHandle.get()) mPopupMenuHandle.get()->die();
|
||||
mPopupMenuHandle.markDead();
|
||||
|
||||
mAutoOpenItems.removeAllNodes();
|
||||
clearSelection();
|
||||
|
|
@ -1534,22 +1526,56 @@ BOOL LLFolderView::handleRightMouseDown( S32 x, S32 y, MASK mask )
|
|||
BOOL handled = childrenHandleRightMouseDown(x, y, mask) != NULL;
|
||||
S32 count = mSelectedItems.size();
|
||||
|
||||
LLMenuGL* menu = (LLMenuGL*)mPopupMenuHandle.get();
|
||||
LLMenuGL* menu = static_cast<LLMenuGL*>(mPopupMenuHandle.get());
|
||||
if (!menu)
|
||||
{
|
||||
if (mCallbackRegistrar)
|
||||
{
|
||||
mCallbackRegistrar->pushScope();
|
||||
}
|
||||
if (mEnableRegistrar)
|
||||
{
|
||||
mEnableRegistrar->pushScope();
|
||||
}
|
||||
llassert(LLMenuGL::sMenuContainer != NULL);
|
||||
menu = LLUICtrlFactory::getInstance()->createFromFile<LLMenuGL>(mMenuFileName, LLMenuGL::sMenuContainer, LLMenuHolderGL::child_registry_t::instance());
|
||||
if (!menu)
|
||||
{
|
||||
menu = LLUICtrlFactory::getDefaultWidget<LLMenuGL>("inventory_menu");
|
||||
}
|
||||
menu->setBackgroundColor(LLUIColorTable::instance().getColor("MenuPopupBgColor"));
|
||||
mPopupMenuHandle = menu->getHandle();
|
||||
if (mEnableRegistrar)
|
||||
{
|
||||
mEnableRegistrar->popScope();
|
||||
}
|
||||
if (mCallbackRegistrar)
|
||||
{
|
||||
mCallbackRegistrar->popScope();
|
||||
}
|
||||
}
|
||||
bool hide_folder_menu = mSuppressFolderMenu && isFolderSelected();
|
||||
if ((handled
|
||||
&& ( count > 0 && (hasVisibleChildren()) ) // show menu only if selected items are visible
|
||||
&& menu ) &&
|
||||
if (menu && (handled
|
||||
&& ( count > 0 && (hasVisibleChildren()) )) && // show menu only if selected items are visible
|
||||
!hide_folder_menu)
|
||||
{
|
||||
if (mCallbackRegistrar)
|
||||
{
|
||||
mCallbackRegistrar->pushScope();
|
||||
}
|
||||
if (mEnableRegistrar)
|
||||
{
|
||||
mEnableRegistrar->pushScope();
|
||||
}
|
||||
|
||||
updateMenuOptions(menu);
|
||||
|
||||
menu->updateParent(LLMenuGL::sMenuContainer);
|
||||
LLMenuGL::showPopup(this, menu, x, y);
|
||||
if (mEnableRegistrar)
|
||||
{
|
||||
mEnableRegistrar->popScope();
|
||||
}
|
||||
if (mCallbackRegistrar)
|
||||
{
|
||||
mCallbackRegistrar->popScope();
|
||||
|
|
@ -1627,7 +1653,7 @@ void LLFolderView::deleteAllChildren()
|
|||
{
|
||||
closeRenamer();
|
||||
if (mPopupMenuHandle.get()) mPopupMenuHandle.get()->die();
|
||||
mPopupMenuHandle = LLHandle<LLView>();
|
||||
mPopupMenuHandle.markDead();
|
||||
mScrollContainer = NULL;
|
||||
mRenameItem = NULL;
|
||||
mRenamer = NULL;
|
||||
|
|
|
|||
|
|
@ -240,6 +240,7 @@ public:
|
|||
bool showItemLinkOverlays() { return mShowItemLinkOverlays; }
|
||||
|
||||
void setCallbackRegistrar(LLUICtrl::CommitCallbackRegistry::ScopedRegistrar* registrar) { mCallbackRegistrar = registrar; }
|
||||
void setEnableRegistrar(LLUICtrl::EnableCallbackRegistry::ScopedRegistrar* registrar) { mEnableRegistrar = registrar; }
|
||||
|
||||
LLPanel* getParentPanel() { return mParentPanel.get(); }
|
||||
// DEBUG only
|
||||
|
|
@ -277,6 +278,7 @@ protected:
|
|||
|
||||
protected:
|
||||
LLHandle<LLView> mPopupMenuHandle;
|
||||
std::string mMenuFileName;
|
||||
|
||||
selected_items_t mSelectedItems;
|
||||
bool mKeyboardSelection,
|
||||
|
|
@ -336,6 +338,7 @@ protected:
|
|||
LLFolderViewItem* mDraggingOverItem; // See EXT-719
|
||||
|
||||
LLUICtrl::CommitCallbackRegistry::ScopedRegistrar* mCallbackRegistrar;
|
||||
LLUICtrl::EnableCallbackRegistry::ScopedRegistrar* mEnableRegistrar;
|
||||
|
||||
public:
|
||||
static F32 sAutoOpenTime;
|
||||
|
|
|
|||
|
|
@ -432,21 +432,15 @@ public:
|
|||
mFilter(filter)
|
||||
{}
|
||||
|
||||
virtual ~LLFolderViewModel()
|
||||
{
|
||||
delete mSorter;
|
||||
mSorter = NULL;
|
||||
delete mFilter;
|
||||
mFilter = NULL;
|
||||
}
|
||||
virtual ~LLFolderViewModel() {}
|
||||
|
||||
virtual SortType& getSorter() { return *mSorter; }
|
||||
virtual const SortType& getSorter() const { return *mSorter; }
|
||||
virtual void setSorter(const SortType& sorter) { mSorter = new SortType(sorter); requestSortAll(); }
|
||||
virtual void setSorter(const SortType& sorter) { mSorter.reset(new SortType(sorter)); requestSortAll(); }
|
||||
|
||||
virtual FilterType& getFilter() { return *mFilter; }
|
||||
virtual const FilterType& getFilter() const { return *mFilter; }
|
||||
virtual void setFilter(const FilterType& filter) { mFilter = new FilterType(filter); }
|
||||
virtual void setFilter(const FilterType& filter) { mFilter.reset(new FilterType(filter)); }
|
||||
|
||||
// By default, we assume the content is available. If a network fetch mechanism is implemented for the model,
|
||||
// this method needs to be overloaded and return the relevant fetch status.
|
||||
|
|
@ -484,8 +478,8 @@ public:
|
|||
}
|
||||
|
||||
protected:
|
||||
SortType* mSorter;
|
||||
FilterType* mFilter;
|
||||
std::unique_ptr<SortType> mSorter;
|
||||
std::unique_ptr<FilterType> mFilter;
|
||||
};
|
||||
|
||||
#endif // LLFOLDERVIEWMODEL_H
|
||||
|
|
|
|||
|
|
@ -164,8 +164,6 @@ LLLineEditor::LLLineEditor(const LLLineEditor::Params& p)
|
|||
mHighlightColor(p.highlight_color()),
|
||||
mPreeditBgColor(p.preedit_bg_color()),
|
||||
mGLFont(p.font),
|
||||
// <FS:Ansariel> Delay context menu initialization if LLMenuGL::sMenuContainer is still NULL
|
||||
mDelayedInit(false),
|
||||
mContextMenuHandle(),
|
||||
mAutoreplaceCallback()
|
||||
{
|
||||
|
|
@ -212,24 +210,6 @@ LLLineEditor::LLLineEditor(const LLLineEditor::Params& p)
|
|||
|
||||
setPrevalidateInput(p.prevalidate_input_callback());
|
||||
setPrevalidate(p.prevalidate_callback());
|
||||
|
||||
// <FS:Ansariel> Delay context menu initialization if LLMenuGL::sMenuContainer is still NULL
|
||||
if (LLMenuGL::sMenuContainer)
|
||||
{
|
||||
// </FS:Ansariel>
|
||||
llassert(LLMenuGL::sMenuContainer != NULL);
|
||||
LLContextMenu* menu = LLUICtrlFactory::instance().createFromFile<LLContextMenu>
|
||||
("menu_text_editor.xml",
|
||||
LLMenuGL::sMenuContainer,
|
||||
LLMenuHolderGL::child_registry_t::instance());
|
||||
setContextMenu(menu);
|
||||
// <FS:Ansariel> Delay context menu initialization if LLMenuGL::sMenuContainer is still NULL
|
||||
}
|
||||
else
|
||||
{
|
||||
mDelayedInit = true;
|
||||
}
|
||||
// </FS:Ansariel>
|
||||
}
|
||||
|
||||
LLLineEditor::~LLLineEditor()
|
||||
|
|
@ -244,9 +224,6 @@ LLLineEditor::~LLLineEditor()
|
|||
}
|
||||
setContextMenu(NULL);
|
||||
|
||||
// <FS:Ansariel> Delay context menu initialization if LLMenuGL::sMenuContainer is still NULL
|
||||
mDelayedInit = false;
|
||||
|
||||
// calls onCommit() while LLLineEditor still valid
|
||||
gFocusMgr.releaseFocusIfNeeded( this );
|
||||
}
|
||||
|
|
@ -1660,10 +1637,7 @@ BOOL LLLineEditor::handleKeyHere(KEY key, MASK mask )
|
|||
KEY_SHIFT != key &&
|
||||
KEY_CONTROL != key &&
|
||||
KEY_ALT != key &&
|
||||
// <FS> Capslock deselecting text
|
||||
//KEY_CAPSLOCK )
|
||||
KEY_CAPSLOCK != key)
|
||||
// </FS>
|
||||
{
|
||||
deselect();
|
||||
}
|
||||
|
|
@ -2759,24 +2733,16 @@ LLWString LLLineEditor::getConvertedText() const
|
|||
void LLLineEditor::showContextMenu(S32 x, S32 y, bool set_cursor_pos)
|
||||
// </FS:Ansariel>
|
||||
{
|
||||
//LLContextMenu* menu = static_cast<LLContextMenu*>(mContextMenuHandle.get());
|
||||
// <FS:Ansariel> Delay context menu initialization if LLMenuGL::sMenuContainer is still NULL
|
||||
LLContextMenu* menu = NULL;
|
||||
if (mDelayedInit && !mContextMenuHandle.get())
|
||||
LLContextMenu* menu = static_cast<LLContextMenu*>(mContextMenuHandle.get());
|
||||
if (!menu)
|
||||
{
|
||||
llassert(LLMenuGL::sMenuContainer != NULL);
|
||||
menu = LLUICtrlFactory::instance().createFromFile<LLContextMenu>
|
||||
menu = LLUICtrlFactory::createFromFile<LLContextMenu>
|
||||
("menu_text_editor.xml",
|
||||
LLMenuGL::sMenuContainer,
|
||||
LLMenuHolderGL::child_registry_t::instance());
|
||||
LLMenuGL::sMenuContainer,
|
||||
LLMenuHolderGL::child_registry_t::instance());
|
||||
setContextMenu(menu);
|
||||
}
|
||||
else
|
||||
{
|
||||
menu = static_cast<LLContextMenu*>(mContextMenuHandle.get());
|
||||
}
|
||||
mDelayedInit = false;
|
||||
// </FS:Ansariel>
|
||||
|
||||
if (menu)
|
||||
{
|
||||
|
|
@ -2827,8 +2793,6 @@ void LLLineEditor::setContextMenu(LLContextMenu* new_context_menu)
|
|||
{
|
||||
menu->die();
|
||||
mContextMenuHandle.markDead();
|
||||
// <FS:Ansariel> Delay context menu initialization if LLMenuGL::sMenuContainer is still NULL
|
||||
mDelayedInit = false;
|
||||
}
|
||||
|
||||
if (new_context_menu)
|
||||
|
|
|
|||
|
|
@ -422,9 +422,6 @@ protected:
|
|||
|
||||
LLHandle<LLContextMenu> mContextMenuHandle;
|
||||
|
||||
// <FS:Ansariel> Delay context menu initialization if LLMenuGL::sMenuContainer is still NULL
|
||||
bool mDelayedInit;
|
||||
|
||||
private:
|
||||
// Instances that by default point to the statics but can be overidden in XML.
|
||||
LLPointer<LLUIImage> mBgImage;
|
||||
|
|
|
|||
|
|
@ -4125,12 +4125,7 @@ void LLTearOffMenu::closeTearOff()
|
|||
|
||||
LLContextMenuBranch::LLContextMenuBranch(const LLContextMenuBranch::Params& p)
|
||||
: LLMenuItemGL(p)
|
||||
//mBranch( p.branch()->getHandle() ) // <FS> Context menu memory leak fix by Rye Mutt
|
||||
{
|
||||
// <FS> Context menu memory leak fix by Rye Mutt
|
||||
//mBranch.get()->hide();
|
||||
//mBranch.get()->setParentMenuItem(this);
|
||||
// </FS>
|
||||
LLContextMenu* branch = static_cast<LLContextMenu*>(p.branch);
|
||||
if (branch)
|
||||
{
|
||||
|
|
@ -4140,7 +4135,6 @@ LLContextMenuBranch::LLContextMenuBranch(const LLContextMenuBranch::Params& p)
|
|||
}
|
||||
}
|
||||
|
||||
// <FS> Context menu memory leak fix by Rye Mutt
|
||||
LLContextMenuBranch::~LLContextMenuBranch()
|
||||
{
|
||||
if (mBranch.get())
|
||||
|
|
@ -4148,30 +4142,21 @@ LLContextMenuBranch::~LLContextMenuBranch()
|
|||
mBranch.get()->die();
|
||||
}
|
||||
}
|
||||
// </FS>
|
||||
|
||||
// called to rebuild the draw label
|
||||
void LLContextMenuBranch::buildDrawLabel( void )
|
||||
{
|
||||
// <FS> Context menu memory leak fix by Rye Mutt
|
||||
auto menu = getBranch();
|
||||
if (menu)
|
||||
// </FS>
|
||||
{
|
||||
// default enablement is this -- if any of the subitems are
|
||||
// enabled, this item is enabled. JC
|
||||
// <FS> Context menu memory leak fix by Rye Mutt
|
||||
//U32 sub_count = mBranch.get()->getItemCount();
|
||||
U32 sub_count = menu->getItemCount();
|
||||
// </FS>
|
||||
U32 i;
|
||||
BOOL any_enabled = FALSE;
|
||||
for (i = 0; i < sub_count; i++)
|
||||
{
|
||||
// <FS> Context menu memory leak fix by Rye Mutt
|
||||
//LLMenuItemGL* item = mBranch.get()->getItem(i);
|
||||
LLMenuItemGL* item = menu->getItem(i);
|
||||
// </FS>
|
||||
item->buildDrawLabel();
|
||||
if (item->getEnabled() && !item->getDrawTextDisabled() )
|
||||
{
|
||||
|
|
@ -4193,28 +4178,18 @@ void LLContextMenuBranch::buildDrawLabel( void )
|
|||
|
||||
void LLContextMenuBranch::showSubMenu()
|
||||
{
|
||||
// <FS> Context menu memory leak fix by Rye Mutt
|
||||
//LLMenuItemGL* menu_item = mBranch.get()->getParentMenuItem();
|
||||
//if (menu_item != NULL && menu_item->getVisible())
|
||||
//{
|
||||
// S32 center_x;
|
||||
// S32 center_y;
|
||||
// localPointToScreen(getRect().getWidth(), getRect().getHeight() , ¢er_x, ¢er_y);
|
||||
// mBranch.get()->show(center_x, center_y);
|
||||
//}
|
||||
auto menu = getBranch();
|
||||
if (menu)
|
||||
if(menu)
|
||||
{
|
||||
LLMenuItemGL* menu_item = menu->getParentMenuItem();
|
||||
if (menu_item != NULL && menu_item->getVisible())
|
||||
{
|
||||
S32 center_x;
|
||||
S32 center_y;
|
||||
localPointToScreen(getRect().getWidth(), getRect().getHeight() , ¢er_x, ¢er_y);
|
||||
localPointToScreen(getRect().getWidth(), getRect().getHeight(), ¢er_x, ¢er_y);
|
||||
menu->show(center_x, center_y);
|
||||
}
|
||||
}
|
||||
// </FS>
|
||||
}
|
||||
|
||||
// onCommit() - do the primary funcationality of the menu item.
|
||||
|
|
@ -4227,15 +4202,6 @@ void LLContextMenuBranch::setHighlight( BOOL highlight )
|
|||
{
|
||||
if (highlight == getHighlight()) return;
|
||||
LLMenuItemGL::setHighlight(highlight);
|
||||
// <FS> Context menu memory leak fix by Rye Mutt
|
||||
//if( highlight )
|
||||
//{
|
||||
// showSubMenu();
|
||||
//}
|
||||
//else
|
||||
//{
|
||||
// mBranch.get()->hide();
|
||||
//}
|
||||
auto menu = getBranch();
|
||||
if (menu)
|
||||
{
|
||||
|
|
@ -4248,7 +4214,6 @@ void LLContextMenuBranch::setHighlight( BOOL highlight )
|
|||
menu->hide();
|
||||
}
|
||||
}
|
||||
// </FS>
|
||||
}
|
||||
|
||||
|
||||
|
|
|
|||
|
|
@ -754,11 +754,7 @@ public:
|
|||
|
||||
LLContextMenuBranch(const Params&);
|
||||
|
||||
// <FS> Context menu memory leak fix by Rye Mutt
|
||||
//virtual ~LLContextMenuBranch()
|
||||
//{}
|
||||
virtual ~LLContextMenuBranch();
|
||||
// </FS>
|
||||
|
||||
// called to rebuild the draw label
|
||||
virtual void buildDrawLabel( void );
|
||||
|
|
|
|||
|
|
@ -92,7 +92,7 @@ LLMultiSlider::LLMultiSlider(const LLMultiSlider::Params& p)
|
|||
mMouseDownSignal(NULL),
|
||||
mMouseUpSignal(NULL)
|
||||
{
|
||||
mValue.emptyMap();
|
||||
mValue = LLSD::emptyMap();
|
||||
mCurSlider = LLStringUtil::null;
|
||||
|
||||
if (mOrientation == HORIZONTAL)
|
||||
|
|
|
|||
|
|
@ -201,7 +201,6 @@ LLScrollListCtrl::LLScrollListCtrl(const LLScrollListCtrl::Params& p)
|
|||
mHighlightedItem(-1),
|
||||
mBorder(NULL),
|
||||
mSortCallback(NULL),
|
||||
mPopupMenu(NULL),
|
||||
mCommentTextView(NULL),
|
||||
mNumDynamicWidthColumns(0),
|
||||
mTotalStaticColumnWidth(0),
|
||||
|
|
@ -412,6 +411,13 @@ LLScrollListCtrl::~LLScrollListCtrl()
|
|||
mItemList.clear();
|
||||
clearColumns(); //clears columns and deletes headers
|
||||
delete mIsFriendSignal;
|
||||
|
||||
auto menu = mPopupMenuHandle.get();
|
||||
if (menu)
|
||||
{
|
||||
menu->die();
|
||||
mPopupMenuHandle.markDead();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
|
@ -1423,20 +1429,20 @@ LLScrollListItem* LLScrollListCtrl::getItemByLabel(const std::string& label, BOO
|
|||
}
|
||||
|
||||
|
||||
BOOL LLScrollListCtrl::selectItemByPrefix(const std::string& target, BOOL case_sensitive)
|
||||
BOOL LLScrollListCtrl::selectItemByPrefix(const std::string& target, BOOL case_sensitive, S32 column)
|
||||
{
|
||||
return selectItemByPrefix(utf8str_to_wstring(target), case_sensitive);
|
||||
return selectItemByPrefix(utf8str_to_wstring(target), case_sensitive, column);
|
||||
}
|
||||
|
||||
// Selects first enabled item that has a name where the name's first part matched the target string.
|
||||
// Returns false if item not found.
|
||||
BOOL LLScrollListCtrl::selectItemByPrefix(const LLWString& target, BOOL case_sensitive)
|
||||
BOOL LLScrollListCtrl::selectItemByPrefix(const LLWString& target, BOOL case_sensitive, S32 column)
|
||||
// <FS:Ansariel> Allow selection by substring match
|
||||
{
|
||||
return selectItemByStringMatch(target, true, case_sensitive);
|
||||
}
|
||||
|
||||
BOOL LLScrollListCtrl::selectItemByStringMatch(const LLWString& target, bool prefix_match, BOOL case_sensitive)
|
||||
BOOL LLScrollListCtrl::selectItemByStringMatch(const LLWString& target, bool prefix_match, BOOL case_sensitive, S32 column)
|
||||
// </FS:Ansariel>
|
||||
{
|
||||
BOOL found = FALSE;
|
||||
|
|
@ -1452,7 +1458,7 @@ BOOL LLScrollListCtrl::selectItemByStringMatch(const LLWString& target, bool pre
|
|||
{
|
||||
LLScrollListItem* item = *iter;
|
||||
// Only select enabled items with matching names
|
||||
LLScrollListCell* cellp = item->getColumn(getSearchColumn());
|
||||
LLScrollListCell* cellp = item->getColumn(column == -1 ? getSearchColumn() : column);
|
||||
BOOL select = cellp ? item->getEnabled() && ('\0' == cellp->getValue().asString()[0]) : FALSE;
|
||||
if (select)
|
||||
{
|
||||
|
|
@ -1475,7 +1481,7 @@ BOOL LLScrollListCtrl::selectItemByStringMatch(const LLWString& target, bool pre
|
|||
LLScrollListItem* item = *iter;
|
||||
|
||||
// Only select enabled items with matching names
|
||||
LLScrollListCell* cellp = item->getColumn(getSearchColumn());
|
||||
LLScrollListCell* cellp = item->getColumn(column == -1 ? getSearchColumn() : column);
|
||||
if (!cellp)
|
||||
{
|
||||
continue;
|
||||
|
|
@ -2252,17 +2258,23 @@ BOOL LLScrollListCtrl::handleRightMouseDown(S32 x, S32 y, MASK mask)
|
|||
|
||||
// create the context menu from the XUI file and display it
|
||||
std::string menu_name = is_group ? "menu_url_group.xml" : "menu_url_agent.xml";
|
||||
delete mPopupMenu;
|
||||
llassert(LLMenuGL::sMenuContainer != NULL);
|
||||
mPopupMenu = LLUICtrlFactory::getInstance()->createFromFile<LLContextMenu>(
|
||||
menu_name, LLMenuGL::sMenuContainer, LLMenuHolderGL::child_registry_t::instance());
|
||||
if (mPopupMenu)
|
||||
auto menu = mPopupMenuHandle.get();
|
||||
if (menu)
|
||||
{
|
||||
menu->die();
|
||||
mPopupMenuHandle.markDead();
|
||||
}
|
||||
llassert(LLMenuGL::sMenuContainer != NULL);
|
||||
menu = LLUICtrlFactory::getInstance()->createFromFile<LLContextMenu>(
|
||||
menu_name, LLMenuGL::sMenuContainer, LLMenuHolderGL::child_registry_t::instance());
|
||||
if (menu)
|
||||
{
|
||||
mPopupMenuHandle = menu->getHandle();
|
||||
if (mIsFriendSignal)
|
||||
{
|
||||
bool isFriend = *(*mIsFriendSignal)(uuid);
|
||||
LLView* addFriendButton = mPopupMenu->getChild<LLView>("add_friend");
|
||||
LLView* removeFriendButton = mPopupMenu->getChild<LLView>("remove_friend");
|
||||
LLView* addFriendButton = menu->getChild<LLView>("add_friend");
|
||||
LLView* removeFriendButton = menu->getChild<LLView>("remove_friend");
|
||||
|
||||
if (addFriendButton && removeFriendButton)
|
||||
{
|
||||
|
|
@ -2271,8 +2283,8 @@ BOOL LLScrollListCtrl::handleRightMouseDown(S32 x, S32 y, MASK mask)
|
|||
}
|
||||
}
|
||||
|
||||
mPopupMenu->show(x, y);
|
||||
LLMenuGL::showPopup(this, mPopupMenu, x, y);
|
||||
menu->show(x, y);
|
||||
LLMenuGL::showPopup(this, menu, x, y);
|
||||
return TRUE;
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -270,12 +270,12 @@ public:
|
|||
virtual LLScrollListItem* addSimpleElement(const std::string& value, EAddPosition pos = ADD_BOTTOM, const LLSD& id = LLSD());
|
||||
|
||||
BOOL selectItemByLabel( const std::string& item, BOOL case_sensitive = TRUE, S32 column = 0 ); // FALSE if item not found
|
||||
BOOL selectItemByPrefix(const std::string& target, BOOL case_sensitive = TRUE);
|
||||
BOOL selectItemByPrefix(const LLWString& target, BOOL case_sensitive = TRUE);
|
||||
BOOL selectItemByPrefix(const std::string& target, BOOL case_sensitive = TRUE, S32 column = -1);
|
||||
BOOL selectItemByPrefix(const LLWString& target, BOOL case_sensitive = TRUE, S32 column = -1);
|
||||
// <FS:Ansariel> Allow selection by substring match
|
||||
BOOL selectItemBySubstring(const std::string& target, BOOL case_sensitive = TRUE);
|
||||
BOOL selectItemBySubstring(const LLWString& target, BOOL case_sensitive = TRUE);
|
||||
BOOL selectItemByStringMatch(const LLWString& target, bool prefix_match, BOOL case_sensitive = TRUE);
|
||||
BOOL selectItemByStringMatch(const LLWString& target, bool prefix_match, BOOL case_sensitive = TRUE, S32 column = -1);
|
||||
// </FS:Ansariel>
|
||||
LLScrollListItem* getItemByLabel( const std::string& item, BOOL case_sensitive = TRUE, S32 column = 0 );
|
||||
const std::string getSelectedItemLabel(S32 column = 0) const;
|
||||
|
|
@ -565,7 +565,7 @@ private:
|
|||
|
||||
S32 mHighlightedItem;
|
||||
class LLViewBorder* mBorder;
|
||||
LLContextMenu *mPopupMenu;
|
||||
LLHandle<LLContextMenu> mPopupMenuHandle;
|
||||
|
||||
LLView *mCommentTextView;
|
||||
|
||||
|
|
|
|||
|
|
@ -1583,12 +1583,10 @@ void LLTabContainer::selectLastTab()
|
|||
|
||||
void LLTabContainer::selectNextTab()
|
||||
{
|
||||
// <FS:Ansariel> FIRE-15580: Crash fix (division by 0)
|
||||
if (mTabList.size() == 0)
|
||||
{
|
||||
return;
|
||||
}
|
||||
// </FS:Ansariel>
|
||||
if (mTabList.size() == 0)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
BOOL tab_has_focus = FALSE;
|
||||
if (mCurrentTabIdx >= 0 && mTabList[mCurrentTabIdx]->mButton->hasFocus())
|
||||
|
|
|
|||
|
|
@ -303,6 +303,12 @@ LLTextBase::LLTextBase(const LLTextBase::Params &p)
|
|||
LLTextBase::~LLTextBase()
|
||||
{
|
||||
mSegments.clear();
|
||||
LLContextMenu* menu = static_cast<LLContextMenu*>(mPopupMenuHandle.get());
|
||||
if (menu)
|
||||
{
|
||||
menu->die();
|
||||
mPopupMenuHandle.markDead();
|
||||
}
|
||||
delete mURLClickSignal;
|
||||
delete mIsFriendSignal;
|
||||
delete mIsObjectBlockedSignal;
|
||||
|
|
|
|||
|
|
@ -258,7 +258,6 @@ LLTextEditor::LLTextEditor(const LLTextEditor::Params& p) :
|
|||
mMouseDownY(0),
|
||||
mTabsToNextField(p.ignore_tab),
|
||||
mPrevalidateFunc(p.prevalidate_callback()),
|
||||
mContextMenu(NULL),
|
||||
mShowContextMenu(p.show_context_menu),
|
||||
mEnableTooltipPaste(p.enable_tooltip_paste),
|
||||
mPassDelete(FALSE),
|
||||
|
|
@ -303,8 +302,13 @@ LLTextEditor::~LLTextEditor()
|
|||
// Scrollbar is deleted by LLView
|
||||
std::for_each(mUndoStack.begin(), mUndoStack.end(), DeletePointer());
|
||||
mUndoStack.clear();
|
||||
// context menu is owned by menu holder, not us
|
||||
//delete mContextMenu;
|
||||
// Mark the menu as dead or its retained in memory till shutdown.
|
||||
LLContextMenu* menu = static_cast<LLContextMenu*>(mContextMenuHandle.get());
|
||||
if(menu)
|
||||
{
|
||||
menu->die();
|
||||
mContextMenuHandle.markDead();
|
||||
}
|
||||
}
|
||||
|
||||
////////////////////////////////////////////////////////////
|
||||
|
|
@ -2236,19 +2240,19 @@ void LLTextEditor::setEnabled(BOOL enabled)
|
|||
void LLTextEditor::showContextMenu(S32 x, S32 y, bool set_cursor_pos)
|
||||
// </FS:Ansariel>
|
||||
{
|
||||
if (!mContextMenu)
|
||||
LLContextMenu* menu = static_cast<LLContextMenu*>(mContextMenuHandle.get());
|
||||
if (!menu)
|
||||
{
|
||||
llassert(LLMenuGL::sMenuContainer != NULL);
|
||||
mContextMenu = LLUICtrlFactory::instance().createFromFile<LLContextMenu>("menu_text_editor.xml",
|
||||
menu = LLUICtrlFactory::createFromFile<LLContextMenu>("menu_text_editor.xml",
|
||||
LLMenuGL::sMenuContainer,
|
||||
LLMenuHolderGL::child_registry_t::instance());
|
||||
// <FS:Beq> FIRE-31081 defend against null this prt exception in setItemVisible found in BugSplat
|
||||
if(!mContextMenu)
|
||||
{
|
||||
LL_WARNS() << "Failed to create context menu 'menu_text_editor'" << LL_ENDL;
|
||||
return;
|
||||
}
|
||||
// </FS:Beq>
|
||||
if(!menu)
|
||||
{
|
||||
LL_WARNS() << "Failed to create menu for LLTextEditor: " << getName() << LL_ENDL;
|
||||
return;
|
||||
}
|
||||
mContextMenuHandle = menu->getHandle();
|
||||
}
|
||||
|
||||
// Route menu to this class
|
||||
|
|
@ -2295,11 +2299,11 @@ void LLTextEditor::showContextMenu(S32 x, S32 y, bool set_cursor_pos)
|
|||
}
|
||||
}
|
||||
|
||||
mContextMenu->setItemVisible("Suggestion Separator", (use_spellcheck) && (!mSuggestionList.empty()));
|
||||
mContextMenu->setItemVisible("Add to Dictionary", (use_spellcheck) && (is_misspelled));
|
||||
mContextMenu->setItemVisible("Add to Ignore", (use_spellcheck) && (is_misspelled));
|
||||
mContextMenu->setItemVisible("Spellcheck Separator", (use_spellcheck) && (is_misspelled));
|
||||
mContextMenu->show(screen_x, screen_y, this);
|
||||
menu->setItemVisible("Suggestion Separator", (use_spellcheck) && (!mSuggestionList.empty()));
|
||||
menu->setItemVisible("Add to Dictionary", (use_spellcheck) && (is_misspelled));
|
||||
menu->setItemVisible("Add to Ignore", (use_spellcheck) && (is_misspelled));
|
||||
menu->setItemVisible("Spellcheck Separator", (use_spellcheck) && (is_misspelled));
|
||||
menu->show(screen_x, screen_y, this);
|
||||
}
|
||||
|
||||
|
||||
|
|
|
|||
|
|
@ -345,7 +345,7 @@ private:
|
|||
keystroke_signal_t mKeystrokeSignal;
|
||||
LLTextValidate::validate_func_t mPrevalidateFunc;
|
||||
|
||||
LLContextMenu* mContextMenu;
|
||||
LLHandle<LLContextMenu> mContextMenuHandle;
|
||||
}; // end class LLTextEditor
|
||||
|
||||
// Build time optimization, generate once in .cpp file
|
||||
|
|
|
|||
|
|
@ -162,7 +162,12 @@ LLToolBar::LLToolBar(const LLToolBar::Params& p)
|
|||
|
||||
LLToolBar::~LLToolBar()
|
||||
{
|
||||
delete mPopupMenuHandle.get();
|
||||
auto menu = mPopupMenuHandle.get();
|
||||
if (menu)
|
||||
{
|
||||
menu->die();
|
||||
mPopupMenuHandle.markDead();
|
||||
}
|
||||
delete mButtonAddSignal;
|
||||
delete mButtonEnterSignal;
|
||||
delete mButtonLeaveSignal;
|
||||
|
|
|
|||
|
|
@ -45,7 +45,7 @@ bool LLTransUtil::parseStrings(const std::string& xml_filename, const std::set<s
|
|||
if (!success)
|
||||
{
|
||||
gDirUtilp->dumpCurrentDirectories(LLError::LEVEL_WARN);
|
||||
LL_ERRS() << "Couldn't load string table " << xml_filename << ". Please reinstall viewer from https://secondlife.com/support/downloads/ and contact https://support.secondlife.com if issue persists after reinstall." << LL_ENDL;
|
||||
LL_ERRS() << "Couldn't load string table " << xml_filename << ". Please reinstall viewer from https://www.firestormviewer.org/choose-your-platform/ and contact https://www.firestormviewer.org/support if issue persists after reinstall." << LL_ENDL;
|
||||
return false;
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -163,7 +163,7 @@ void LLUIColorTable::insertFromParams(const Params& p, string_color_map_t& table
|
|||
iter != visited_refs.end();
|
||||
++iter)
|
||||
{
|
||||
LL_WARNS() << iter->first << " references a non-existent color" << LL_ENDL;
|
||||
LL_WARNS() << iter->first << " references a non-existent color: " << iter->second->second << LL_ENDL;
|
||||
unresolved_refs.erase(iter->second);
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -67,6 +67,7 @@ set(viewer_HEADER_FILES
|
|||
# Libraries on which this library depends, needed for Linux builds
|
||||
# Sort by high-level to low-level
|
||||
if (LINUX)
|
||||
find_package(Fontconfig REQUIRED) # <FS:PC> fontconfig and freetype should be taken from the user's system
|
||||
set(llwindow_LINK_LIBRARIES
|
||||
${LLCOMMON_LIBRARIES}
|
||||
${LLIMAGE_LIBRARIES}
|
||||
|
|
@ -77,8 +78,10 @@ if (LINUX)
|
|||
${LLXML_LIBRARIES}
|
||||
${UI_LIBRARIES} # for GTK
|
||||
sdl
|
||||
libfontconfig.a # For FCInit and other FC* functions.
|
||||
libfreetype.a
|
||||
# libfontconfig.a # <FS:PC> fontconfig and freetype should
|
||||
# libfreetype.a # be taken from the user's system,
|
||||
Freetype::Freetype # and not be packaged with
|
||||
Fontconfig::Fontconfig # the viewer
|
||||
)
|
||||
|
||||
if( USE_SDL1 )
|
||||
|
|
|
|||
|
|
@ -1108,7 +1108,7 @@ LLSD LLDXHardware::getDisplayInfo()
|
|||
}
|
||||
|
||||
LCleanup:
|
||||
if (ret.emptyMap())
|
||||
if (!ret.isMap() || (ret.size() == 0))
|
||||
{
|
||||
LL_INFOS() << "Failed to get data, cleaning up" << LL_ENDL;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -83,7 +83,7 @@ int createNSApp(int argc, const char **argv);
|
|||
void setupCocoa();
|
||||
bool pasteBoardAvailable();
|
||||
bool copyToPBoard(const unsigned short *str, unsigned int len);
|
||||
const unsigned short *copyFromPBoard();
|
||||
unsigned short *copyFromPBoard();
|
||||
CursorRef createImageCursor(const char *fullpath, int hotspotX, int hotspotY);
|
||||
short releaseImageCursor(CursorRef ref);
|
||||
short setImageCursor(CursorRef ref);
|
||||
|
|
|
|||
|
|
@ -49,14 +49,12 @@ void setupCocoa()
|
|||
|
||||
if(!inited)
|
||||
{
|
||||
NSAutoreleasePool *pool = [[NSAutoreleasePool alloc] init];
|
||||
|
||||
// The following prevents the Cocoa command line parser from trying to open 'unknown' arguements as documents.
|
||||
// ie. running './secondlife -set Language fr' would cause a pop-up saying can't open document 'fr'
|
||||
// when init'ing the Cocoa App window.
|
||||
[[NSUserDefaults standardUserDefaults] setObject:@"NO" forKey:@"NSTreatUnknownArgumentsAsOpen"];
|
||||
|
||||
[pool release];
|
||||
@autoreleasepool {
|
||||
// The following prevents the Cocoa command line parser from trying to open 'unknown' arguements as documents.
|
||||
// ie. running './secondlife -set Language fr' would cause a pop-up saying can't open document 'fr'
|
||||
// when init'ing the Cocoa App window.
|
||||
[[NSUserDefaults standardUserDefaults] setObject:@"NO" forKey:@"NSTreatUnknownArgumentsAsOpen"];
|
||||
}
|
||||
|
||||
inited = true;
|
||||
}
|
||||
|
|
@ -64,13 +62,13 @@ void setupCocoa()
|
|||
|
||||
bool copyToPBoard(const unsigned short *str, unsigned int len)
|
||||
{
|
||||
NSAutoreleasePool *pool = [[NSAutoreleasePool alloc]init];
|
||||
NSPasteboard *pboard = [NSPasteboard generalPasteboard];
|
||||
[pboard clearContents];
|
||||
|
||||
NSArray *contentsToPaste = [[NSArray alloc] initWithObjects:[NSString stringWithCharacters:str length:len], nil];
|
||||
[pool release];
|
||||
return [pboard writeObjects:contentsToPaste];
|
||||
@autoreleasepool {
|
||||
NSPasteboard *pboard = [NSPasteboard generalPasteboard];
|
||||
[pboard clearContents];
|
||||
|
||||
NSArray *contentsToPaste = [[[NSArray alloc] initWithObjects:[NSString stringWithCharacters:str length:len], nil] autorelease];
|
||||
return [pboard writeObjects:contentsToPaste];
|
||||
}
|
||||
}
|
||||
|
||||
bool pasteBoardAvailable()
|
||||
|
|
@ -79,45 +77,39 @@ bool pasteBoardAvailable()
|
|||
return [[NSPasteboard generalPasteboard] canReadObjectForClasses:classArray options:[NSDictionary dictionary]];
|
||||
}
|
||||
|
||||
const unsigned short *copyFromPBoard()
|
||||
unsigned short *copyFromPBoard()
|
||||
{
|
||||
NSAutoreleasePool *pool = [[NSAutoreleasePool alloc]init];
|
||||
NSPasteboard *pboard = [NSPasteboard generalPasteboard];
|
||||
NSArray *classArray = [NSArray arrayWithObject:[NSString class]];
|
||||
NSString *str = NULL;
|
||||
BOOL ok = [pboard canReadObjectForClasses:classArray options:[NSDictionary dictionary]];
|
||||
if (ok)
|
||||
{
|
||||
NSArray *objToPaste = [pboard readObjectsForClasses:classArray options:[NSDictionary dictionary]];
|
||||
str = [objToPaste objectAtIndex:0];
|
||||
}
|
||||
NSUInteger len = [str length];
|
||||
|
||||
// <FS:ND> add+1 for 0-terminator.
|
||||
// unichar* temp = (unichar*)calloc([str length]+1, sizeof(unichar));
|
||||
unichar* buffer = (unichar*)calloc(len+1, sizeof(unichar));
|
||||
// </FS:ND>
|
||||
|
||||
[str getCharacters:buffer range:NSMakeRange(0, len)];
|
||||
[pool release];
|
||||
return buffer;
|
||||
@autoreleasepool {
|
||||
NSPasteboard *pboard = [NSPasteboard generalPasteboard];
|
||||
NSArray *classArray = [NSArray arrayWithObject:[NSString class]];
|
||||
NSString *str = NULL;
|
||||
BOOL ok = [pboard canReadObjectForClasses:classArray options:[NSDictionary dictionary]];
|
||||
if (ok)
|
||||
{
|
||||
NSArray *objToPaste = [pboard readObjectsForClasses:classArray options:[NSDictionary dictionary]];
|
||||
str = [objToPaste objectAtIndex:0];
|
||||
}
|
||||
NSUInteger str_len = [str length];
|
||||
unichar* temp = (unichar*)calloc(str_len+1, sizeof(unichar));
|
||||
[str getCharacters:temp range:NSMakeRange(0, str_len)];
|
||||
return temp;
|
||||
}
|
||||
}
|
||||
|
||||
CursorRef createImageCursor(const char *fullpath, int hotspotX, int hotspotY)
|
||||
{
|
||||
NSAutoreleasePool *pool = [[NSAutoreleasePool alloc] init];
|
||||
|
||||
// extra retain on the NSCursor since we want it to live for the lifetime of the app.
|
||||
NSCursor *cursor =
|
||||
[[[NSCursor alloc]
|
||||
initWithImage:
|
||||
[[[NSImage alloc] initWithContentsOfFile:
|
||||
[NSString stringWithUTF8String:fullpath]
|
||||
]autorelease]
|
||||
hotSpot:NSMakePoint(hotspotX, hotspotY)
|
||||
]retain];
|
||||
|
||||
[pool release];
|
||||
NSCursor *cursor = nil;
|
||||
@autoreleasepool {
|
||||
// extra retain on the NSCursor since we want it to live for the lifetime of the app.
|
||||
cursor =
|
||||
[[[NSCursor alloc]
|
||||
initWithImage:
|
||||
[[[NSImage alloc] initWithContentsOfFile:
|
||||
[NSString stringWithUTF8String:fullpath]
|
||||
] autorelease]
|
||||
hotSpot:NSMakePoint(hotspotX, hotspotY)
|
||||
] retain];
|
||||
}
|
||||
|
||||
return (CursorRef)cursor;
|
||||
}
|
||||
|
|
@ -184,10 +176,10 @@ OSErr releaseImageCursor(CursorRef ref)
|
|||
{
|
||||
if( ref != NULL )
|
||||
{
|
||||
NSAutoreleasePool *pool = [[NSAutoreleasePool alloc] init];
|
||||
NSCursor *cursor = (NSCursor*)ref;
|
||||
[cursor release];
|
||||
[pool release];
|
||||
@autoreleasepool {
|
||||
NSCursor *cursor = (NSCursor*)ref;
|
||||
[cursor autorelease];
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
|
|
@ -201,10 +193,10 @@ OSErr setImageCursor(CursorRef ref)
|
|||
{
|
||||
if( ref != NULL )
|
||||
{
|
||||
NSAutoreleasePool *pool = [[NSAutoreleasePool alloc] init];
|
||||
NSCursor *cursor = (NSCursor*)ref;
|
||||
[cursor set];
|
||||
[pool release];
|
||||
@autoreleasepool {
|
||||
NSCursor *cursor = (NSCursor*)ref;
|
||||
[cursor set];
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
|
|
@ -425,24 +417,26 @@ void requestUserAttention()
|
|||
|
||||
long showAlert(std::string text, std::string title, int type)
|
||||
{
|
||||
NSAlert *alert = [[NSAlert alloc] init];
|
||||
|
||||
[alert setMessageText:[NSString stringWithCString:title.c_str() encoding:[NSString defaultCStringEncoding]]];
|
||||
[alert setInformativeText:[NSString stringWithCString:text.c_str() encoding:[NSString defaultCStringEncoding]]];
|
||||
if (type == 0)
|
||||
{
|
||||
[alert addButtonWithTitle:@"Okay"];
|
||||
} else if (type == 1)
|
||||
{
|
||||
[alert addButtonWithTitle:@"Okay"];
|
||||
[alert addButtonWithTitle:@"Cancel"];
|
||||
} else if (type == 2)
|
||||
{
|
||||
[alert addButtonWithTitle:@"Yes"];
|
||||
[alert addButtonWithTitle:@"No"];
|
||||
long ret = 0;
|
||||
@autoreleasepool {
|
||||
NSAlert *alert = [[[NSAlert alloc] init] autorelease];
|
||||
|
||||
[alert setMessageText:[NSString stringWithCString:title.c_str() encoding:[NSString defaultCStringEncoding]]];
|
||||
[alert setInformativeText:[NSString stringWithCString:text.c_str() encoding:[NSString defaultCStringEncoding]]];
|
||||
if (type == 0)
|
||||
{
|
||||
[alert addButtonWithTitle:@"Okay"];
|
||||
} else if (type == 1)
|
||||
{
|
||||
[alert addButtonWithTitle:@"Okay"];
|
||||
[alert addButtonWithTitle:@"Cancel"];
|
||||
} else if (type == 2)
|
||||
{
|
||||
[alert addButtonWithTitle:@"Yes"];
|
||||
[alert addButtonWithTitle:@"No"];
|
||||
}
|
||||
ret = [alert runModal];
|
||||
}
|
||||
long ret = [alert runModal];
|
||||
[alert dealloc];
|
||||
|
||||
if (ret == NSAlertFirstButtonReturn)
|
||||
{
|
||||
|
|
|
|||
|
|
@ -678,11 +678,11 @@ BOOL LLWindowMacOSX::createContext(int x, int y, int width, int height, int bits
|
|||
|
||||
if (cgl_err != kCGLNoError )
|
||||
{
|
||||
LL_DEBUGS("GLInit") << "Multi-threaded OpenGL not available." << LL_ENDL;
|
||||
LL_INFOS("GLInit") << "Multi-threaded OpenGL not available." << LL_ENDL;
|
||||
}
|
||||
else
|
||||
{
|
||||
LL_DEBUGS("GLInit") << "Multi-threaded OpenGL enabled." << LL_ENDL;
|
||||
LL_INFOS("GLInit") << "Multi-threaded OpenGL enabled." << LL_ENDL;
|
||||
}
|
||||
}
|
||||
makeFirstResponder(mWindow, mGLView);
|
||||
|
|
@ -1256,10 +1256,13 @@ BOOL LLWindowMacOSX::isClipboardTextAvailable()
|
|||
}
|
||||
|
||||
BOOL LLWindowMacOSX::pasteTextFromClipboard(LLWString &dst)
|
||||
{
|
||||
//llutf16string str(copyFromPBoard());
|
||||
dst = utf16str_to_wstring(copyFromPBoard());
|
||||
LLWStringUtil::removeCRLF(dst); // <FS:CR>
|
||||
{
|
||||
unsigned short* pboard_data = copyFromPBoard(); // must free returned data
|
||||
llutf16string str(pboard_data);
|
||||
free(pboard_data);
|
||||
|
||||
dst = utf16str_to_wstring(str);
|
||||
LLWStringUtil::removeCRLF(dst); // <FS:CR>;
|
||||
if (dst != L"")
|
||||
{
|
||||
return true;
|
||||
|
|
@ -1291,7 +1294,7 @@ LLWindow::LLWindowResolution* LLWindowMacOSX::getSupportedResolutions(S32 &num_r
|
|||
{
|
||||
if (!mSupportedResolutions)
|
||||
{
|
||||
CFArrayRef modes = CGDisplayAvailableModes(mDisplay);
|
||||
CFArrayRef modes = CGDisplayCopyAllDisplayModes(mDisplay, nullptr);
|
||||
|
||||
if(modes != NULL)
|
||||
{
|
||||
|
|
@ -1330,6 +1333,7 @@ LLWindow::LLWindowResolution* LLWindowMacOSX::getSupportedResolutions(S32 &num_r
|
|||
}
|
||||
}
|
||||
}
|
||||
CFRelease(modes);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -232,6 +232,7 @@ protected:
|
|||
BOOL mLanguageTextInputAllowed;
|
||||
LLPreeditor* mPreeditor;
|
||||
|
||||
public:
|
||||
static BOOL sUseMultGL;
|
||||
|
||||
friend class LLWindowManager;
|
||||
|
|
|
|||
|
|
@ -437,7 +437,7 @@ LLWindowSDL::LLWindowSDL(LLWindowCallbacks* callbacks,
|
|||
const std::string& title, S32 x, S32 y, S32 width,
|
||||
S32 height, U32 flags,
|
||||
BOOL fullscreen, BOOL clearBg,
|
||||
BOOL disable_vsync, BOOL use_gl,
|
||||
BOOL enable_vsync, BOOL use_gl,
|
||||
// <FS:LO> Legacy cursor setting from main program
|
||||
//BOOL ignore_pixel_depth, U32 fsaa_samples,)
|
||||
BOOL ignore_pixel_depth, U32 fsaa_samples, BOOL useLegacyCursors)
|
||||
|
|
@ -483,7 +483,7 @@ LLWindowSDL::LLWindowSDL(LLWindowCallbacks* callbacks,
|
|||
mWindowTitle = title;
|
||||
|
||||
// Create the GL context and set it up for windowed or fullscreen, as appropriate.
|
||||
if(createContext(x, y, width, height, 32, fullscreen, disable_vsync))
|
||||
if(createContext(x, y, width, height, 32, fullscreen, enable_vsync))
|
||||
{
|
||||
gGLManager.initGL();
|
||||
|
||||
|
|
@ -667,7 +667,7 @@ void LLWindowSDL::setTitle(const std::string &title)
|
|||
SDL_WM_SetCaption(title.c_str(), title.c_str());
|
||||
}
|
||||
|
||||
BOOL LLWindowSDL::createContext(int x, int y, int width, int height, int bits, BOOL fullscreen, BOOL disable_vsync)
|
||||
BOOL LLWindowSDL::createContext(int x, int y, int width, int height, int bits, BOOL fullscreen, BOOL enable_vsync)
|
||||
{
|
||||
//bool glneedsinit = false;
|
||||
|
||||
|
|
@ -1001,7 +1001,7 @@ BOOL LLWindowSDL::createContext(int x, int y, int width, int height, int bits, B
|
|||
|
||||
|
||||
// changing fullscreen resolution, or switching between windowed and fullscreen mode.
|
||||
BOOL LLWindowSDL::switchContext(BOOL fullscreen, const LLCoordScreen &size, BOOL disable_vsync, const LLCoordScreen * const posp)
|
||||
BOOL LLWindowSDL::switchContext(BOOL fullscreen, const LLCoordScreen &size, BOOL enable_vsync, const LLCoordScreen * const posp)
|
||||
{
|
||||
const BOOL needsRebuild = TRUE; // Just nuke the context and start over.
|
||||
BOOL result = true;
|
||||
|
|
@ -1011,7 +1011,7 @@ BOOL LLWindowSDL::switchContext(BOOL fullscreen, const LLCoordScreen &size, BOOL
|
|||
if(needsRebuild)
|
||||
{
|
||||
destroyContext();
|
||||
result = createContext(0, 0, size.mX, size.mY, 0, fullscreen, disable_vsync);
|
||||
result = createContext(0, 0, size.mX, size.mY, 0, fullscreen, enable_vsync);
|
||||
if (result)
|
||||
{
|
||||
gGLManager.initGL();
|
||||
|
|
|
|||
|
|
@ -69,7 +69,7 @@ public:
|
|||
/*virtual*/ BOOL setPosition(LLCoordScreen position);
|
||||
/*virtual*/ BOOL setSizeImpl(LLCoordScreen size);
|
||||
/*virtual*/ BOOL setSizeImpl(LLCoordWindow size);
|
||||
/*virtual*/ BOOL switchContext(BOOL fullscreen, const LLCoordScreen &size, BOOL disable_vsync, const LLCoordScreen * const posp = NULL);
|
||||
/*virtual*/ BOOL switchContext(BOOL fullscreen, const LLCoordScreen &size, BOOL enable_vsync, const LLCoordScreen * const posp = NULL);
|
||||
/*virtual*/ BOOL setCursorPosition(LLCoordWindow position);
|
||||
/*virtual*/ BOOL getCursorPosition(LLCoordWindow *position);
|
||||
/*virtual*/ void showCursor();
|
||||
|
|
@ -159,7 +159,7 @@ public:
|
|||
protected:
|
||||
LLWindowSDL(LLWindowCallbacks* callbacks,
|
||||
const std::string& title, int x, int y, int width, int height, U32 flags,
|
||||
BOOL fullscreen, BOOL clearBg, BOOL disable_vsync, BOOL use_gl,
|
||||
BOOL fullscreen, BOOL clearBg, BOOL enable_vsync, BOOL use_gl,
|
||||
//BOOL ignore_pixel_depth, U32 fsaa_samples);
|
||||
BOOL ignore_pixel_depth, U32 fsaa_samples, BOOL useLegacyCursors); // <FS:LO> Legacy cursor setting from main program
|
||||
~LLWindowSDL();
|
||||
|
|
@ -186,7 +186,7 @@ protected:
|
|||
//
|
||||
|
||||
// create or re-create the GL context/window. Called from the constructor and switchContext().
|
||||
BOOL createContext(int x, int y, int width, int height, int bits, BOOL fullscreen, BOOL disable_vsync);
|
||||
BOOL createContext(int x, int y, int width, int height, int bits, BOOL fullscreen, BOOL enable_vsync);
|
||||
void destroyContext();
|
||||
void setupFailure(const std::string& text, const std::string& caption, U32 type);
|
||||
void fixWindowSize(void);
|
||||
|
|
@ -263,4 +263,4 @@ public:
|
|||
S32 OSMessageBoxSDL(const std::string& text, const std::string& caption, U32 type);
|
||||
|
||||
#endif //LL_LLWINDOWSDL_H
|
||||
#endif
|
||||
#endif
|
||||
|
|
|
|||
|
|
@ -382,7 +382,7 @@ LLWindowSDL::LLWindowSDL(LLWindowCallbacks* callbacks,
|
|||
const std::string& title, S32 x, S32 y, S32 width,
|
||||
S32 height, U32 flags,
|
||||
BOOL fullscreen, BOOL clearBg,
|
||||
BOOL disable_vsync, BOOL use_gl,
|
||||
BOOL enable_vsync, BOOL use_gl,
|
||||
// <FS:LO> Legacy cursor setting from main program
|
||||
//BOOL ignore_pixel_depth, U32 fsaa_samples,)
|
||||
BOOL ignore_pixel_depth, U32 fsaa_samples, BOOL useLegacyCursors)
|
||||
|
|
@ -427,7 +427,7 @@ LLWindowSDL::LLWindowSDL(LLWindowCallbacks* callbacks,
|
|||
mWindowTitle = title;
|
||||
|
||||
// Create the GL context and set it up for windowed or fullscreen, as appropriate.
|
||||
if(createContext(x, y, width, height, 32, fullscreen, disable_vsync))
|
||||
if(createContext(x, y, width, height, 32, fullscreen, enable_vsync))
|
||||
{
|
||||
gGLManager.initGL();
|
||||
|
||||
|
|
@ -663,7 +663,7 @@ void LLWindowSDL::tryFindFullscreenSize( int &width, int &height )
|
|||
}
|
||||
}
|
||||
|
||||
BOOL LLWindowSDL::createContext(int x, int y, int width, int height, int bits, BOOL fullscreen, BOOL disable_vsync)
|
||||
BOOL LLWindowSDL::createContext(int x, int y, int width, int height, int bits, BOOL fullscreen, BOOL enable_vsync)
|
||||
{
|
||||
//bool glneedsinit = false;
|
||||
|
||||
|
|
@ -739,7 +739,6 @@ BOOL LLWindowSDL::createContext(int x, int y, int width, int height, int bits, B
|
|||
// We need stencil support for a few (minor) things.
|
||||
if (stencilBits)
|
||||
SDL_GL_SetAttribute(SDL_GL_STENCIL_SIZE, stencilBits);
|
||||
// *FIX: try to toggle vsync here?
|
||||
|
||||
SDL_GL_SetAttribute(SDL_GL_DOUBLEBUFFER, 1);
|
||||
|
||||
|
|
@ -763,7 +762,11 @@ BOOL LLWindowSDL::createContext(int x, int y, int width, int height, int bits, B
|
|||
setupFailure("GL Context creation error creation error", "Error", OSMB_OK);
|
||||
return FALSE;
|
||||
}
|
||||
// SDL_GL_SetSwapInterval(1);
|
||||
|
||||
// FIRE-32559: This *should* work, but for some reason aftrer login vsync always acts as if it's disabled, so
|
||||
// the flag will get set again later in void LLViewerWindow::setStartupComplete() -Zi
|
||||
toggleVSync(enable_vsync);
|
||||
|
||||
mSurface = SDL_GetWindowSurface( mWindow );
|
||||
}
|
||||
|
||||
|
|
@ -921,7 +924,7 @@ BOOL LLWindowSDL::createContext(int x, int y, int width, int height, int bits, B
|
|||
|
||||
|
||||
// changing fullscreen resolution, or switching between windowed and fullscreen mode.
|
||||
BOOL LLWindowSDL::switchContext(BOOL fullscreen, const LLCoordScreen &size, BOOL disable_vsync, const LLCoordScreen * const posp)
|
||||
BOOL LLWindowSDL::switchContext(BOOL fullscreen, const LLCoordScreen &size, BOOL enable_vsync, const LLCoordScreen * const posp)
|
||||
{
|
||||
const BOOL needsRebuild = TRUE; // Just nuke the context and start over.
|
||||
BOOL result = true;
|
||||
|
|
@ -931,7 +934,7 @@ BOOL LLWindowSDL::switchContext(BOOL fullscreen, const LLCoordScreen &size, BOOL
|
|||
if(needsRebuild)
|
||||
{
|
||||
destroyContext();
|
||||
result = createContext(0, 0, size.mX, size.mY, 0, fullscreen, disable_vsync);
|
||||
result = createContext(0, 0, size.mX, size.mY, 0, fullscreen, enable_vsync);
|
||||
if (result)
|
||||
{
|
||||
gGLManager.initGL();
|
||||
|
|
@ -2731,7 +2734,31 @@ void LLWindowSDL::destroySharedContext(void* context)
|
|||
|
||||
void LLWindowSDL::toggleVSync(bool enable_vsync)
|
||||
{
|
||||
SDL_GL_SetSwapInterval(enable_vsync);
|
||||
if (enable_vsync)
|
||||
{
|
||||
// try adaptive vsync first (-1) and if that fails, try regular vsync (1)
|
||||
if (SDL_GL_SetSwapInterval(-1) == -1)
|
||||
{
|
||||
LL_INFOS() << "Failed to enable adaptive vsync, trying regular vsync" << LL_ENDL;
|
||||
if (SDL_GL_SetSwapInterval(1) == -1)
|
||||
{
|
||||
LL_WARNS() << "Failed to enable vsync" << LL_ENDL;
|
||||
}
|
||||
else
|
||||
{
|
||||
LL_DEBUGS() << "Vsync enabled" << LL_ENDL;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
LL_DEBUGS() << "Adaptive vsync enabled" << LL_ENDL;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
SDL_GL_SetSwapInterval(0);
|
||||
LL_DEBUGS() << "Vsync disabled" << LL_ENDL;
|
||||
}
|
||||
}
|
||||
// </FS:Zi>
|
||||
|
||||
|
|
|
|||
|
|
@ -65,7 +65,7 @@ public:
|
|||
/*virtual*/ BOOL setPosition(LLCoordScreen position);
|
||||
/*virtual*/ BOOL setSizeImpl(LLCoordScreen size);
|
||||
/*virtual*/ BOOL setSizeImpl(LLCoordWindow size);
|
||||
/*virtual*/ BOOL switchContext(BOOL fullscreen, const LLCoordScreen &size, BOOL disable_vsync, const LLCoordScreen * const posp = NULL);
|
||||
/*virtual*/ BOOL switchContext(BOOL fullscreen, const LLCoordScreen &size, BOOL enable_vsync, const LLCoordScreen * const posp = NULL);
|
||||
// <FS:Zi> Make shared context work on Linux for multithreaded OpenGL
|
||||
void* createSharedContext() override;
|
||||
void makeContextCurrent(void* context) override;
|
||||
|
|
@ -162,7 +162,7 @@ public:
|
|||
protected:
|
||||
LLWindowSDL(LLWindowCallbacks* callbacks,
|
||||
const std::string& title, int x, int y, int width, int height, U32 flags,
|
||||
BOOL fullscreen, BOOL clearBg, BOOL disable_vsync, BOOL use_gl,
|
||||
BOOL fullscreen, BOOL clearBg, BOOL enable_vsync, BOOL use_gl,
|
||||
//BOOL ignore_pixel_depth, U32 fsaa_samples);
|
||||
BOOL ignore_pixel_depth, U32 fsaa_samples, BOOL useLegacyCursors); // <FS:LO> Legacy cursor setting from main program
|
||||
~LLWindowSDL();
|
||||
|
|
@ -189,7 +189,7 @@ protected:
|
|||
//
|
||||
|
||||
// create or re-create the GL context/window. Called from the constructor and switchContext().
|
||||
BOOL createContext(int x, int y, int width, int height, int bits, BOOL fullscreen, BOOL disable_vsync);
|
||||
BOOL createContext(int x, int y, int width, int height, int bits, BOOL fullscreen, BOOL enable_vsync);
|
||||
void destroyContext();
|
||||
void setupFailure(const std::string& text, const std::string& caption, U32 type);
|
||||
void fixWindowSize(void);
|
||||
|
|
|
|||
|
|
@ -3472,24 +3472,45 @@ BOOL LLWindowWin32::getClientRectInScreenSpace( RECT* rectp )
|
|||
|
||||
void LLWindowWin32::flashIcon(F32 seconds)
|
||||
{
|
||||
if (mWindowHandle && (GetFocus() != mWindowHandle || GetForegroundWindow() != mWindowHandle))
|
||||
{
|
||||
mWindowThread->post([=]()
|
||||
{
|
||||
FLASHWINFO flash_info;
|
||||
// <FS:Ansariel> FIRE-32105: Application icon flashes also while viewer has focus
|
||||
//if (mWindowHandle && (GetFocus() != mWindowHandle || GetForegroundWindow() != mWindowHandle))
|
||||
//{
|
||||
// mWindowThread->post([=]()
|
||||
// {
|
||||
// FLASHWINFO flash_info;
|
||||
|
||||
flash_info.cbSize = sizeof(FLASHWINFO);
|
||||
flash_info.hwnd = mWindowHandle;
|
||||
flash_info.dwFlags = FLASHW_TRAY;
|
||||
// <FS:Ansariel> FIRE-23498: Tray icon flash functions randomly
|
||||
//flash_info.uCount = UINT(seconds / ICON_FLASH_TIME);
|
||||
//flash_info.dwTimeout = DWORD(1000.f * ICON_FLASH_TIME); // milliseconds
|
||||
flash_info.uCount = UINT(ll_round(seconds / ICON_FLASH_TIME));
|
||||
flash_info.dwTimeout = DWORD(ll_round(1000.f * ICON_FLASH_TIME)); // milliseconds
|
||||
// </FS:Ansariel>
|
||||
FlashWindowEx(&flash_info);
|
||||
});
|
||||
}
|
||||
// flash_info.cbSize = sizeof(FLASHWINFO);
|
||||
// flash_info.hwnd = mWindowHandle;
|
||||
// flash_info.dwFlags = FLASHW_TRAY;
|
||||
// // <FS:Ansariel> FIRE-23498: Tray icon flash functions randomly
|
||||
// //flash_info.uCount = UINT(seconds / ICON_FLASH_TIME);
|
||||
// //flash_info.dwTimeout = DWORD(1000.f * ICON_FLASH_TIME); // milliseconds
|
||||
// flash_info.uCount = UINT(ll_round(seconds / ICON_FLASH_TIME));
|
||||
// flash_info.dwTimeout = DWORD(ll_round(1000.f * ICON_FLASH_TIME)); // milliseconds
|
||||
// // </FS:Ansariel>
|
||||
// FlashWindowEx(&flash_info);
|
||||
// });
|
||||
//}
|
||||
|
||||
mWindowThread->post([=]()
|
||||
{
|
||||
if (mWindowHandle && (GetFocus() != mWindowHandle || GetForegroundWindow() != mWindowHandle))
|
||||
{
|
||||
FLASHWINFO flash_info;
|
||||
|
||||
flash_info.cbSize = sizeof(FLASHWINFO);
|
||||
flash_info.hwnd = mWindowHandle;
|
||||
flash_info.dwFlags = FLASHW_TRAY;
|
||||
// <FS:Ansariel> FIRE-23498: Tray icon flash functions randomly
|
||||
//flash_info.uCount = UINT(seconds / ICON_FLASH_TIME);
|
||||
//flash_info.dwTimeout = DWORD(1000.f * ICON_FLASH_TIME); // milliseconds
|
||||
flash_info.uCount = UINT(ll_round(seconds / ICON_FLASH_TIME));
|
||||
flash_info.dwTimeout = DWORD(ll_round(1000.f * ICON_FLASH_TIME)); // milliseconds
|
||||
// </FS:Ansariel>
|
||||
FlashWindowEx(&flash_info);
|
||||
}
|
||||
});
|
||||
// </FS:Ansariel>
|
||||
}
|
||||
|
||||
F32 LLWindowWin32::getGamma()
|
||||
|
|
|
|||
|
|
@ -2058,32 +2058,49 @@ endif (WINDOWS)
|
|||
|
||||
# Add the xui files. This is handy for searching for xui elements
|
||||
# from within the IDE.
|
||||
set(viewer_XUI_FILES
|
||||
skins/default/colors.xml
|
||||
skins/default/default_languages.xml
|
||||
skins/default/textures/textures.xml
|
||||
)
|
||||
file(GLOB DEFAULT_XUI_FILE_GLOB_LIST
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/skins/*/xui/en/*.xml)
|
||||
list(APPEND viewer_XUI_FILES ${DEFAULT_XUI_FILE_GLOB_LIST})
|
||||
# <FS:Ansariel> Make all XUI files accessible in Visual Studio
|
||||
#set(viewer_XUI_FILES
|
||||
# skins/default/colors.xml
|
||||
# skins/default/default_languages.xml
|
||||
# skins/default/textures/textures.xml
|
||||
# )
|
||||
#file(GLOB DEFAULT_XUI_FILE_GLOB_LIST
|
||||
# ${CMAKE_CURRENT_SOURCE_DIR}/skins/*/xui/en/*.xml)
|
||||
#list(APPEND viewer_XUI_FILES ${DEFAULT_XUI_FILE_GLOB_LIST})
|
||||
|
||||
file(GLOB DEFAULT_WIDGET_FILE_GLOB_LIST
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/skins/*/xui/en/widgets/*.xml)
|
||||
list(APPEND viewer_XUI_FILES ${DEFAULT_WIDGET_FILE_GLOB_LIST})
|
||||
#file(GLOB DEFAULT_WIDGET_FILE_GLOB_LIST
|
||||
# ${CMAKE_CURRENT_SOURCE_DIR}/skins/*/xui/en/widgets/*.xml)
|
||||
#list(APPEND viewer_XUI_FILES ${DEFAULT_WIDGET_FILE_GLOB_LIST})
|
||||
|
||||
# Cannot append empty lists in CMake, wait until we have files here.
|
||||
#file(GLOB SILVER_WIDGET_FILE_GLOB_LIST
|
||||
# ${CMAKE_CURRENT_SOURCE_DIR}/skins/silver/xui/en-us/widgets/*.xml)
|
||||
#list(APPEND viewer_XUI_FILES ${SILVER_WIDGET_FILE_GLOB_LIST})
|
||||
## Cannot append empty lists in CMake, wait until we have files here.
|
||||
##file(GLOB SILVER_WIDGET_FILE_GLOB_LIST
|
||||
## ${CMAKE_CURRENT_SOURCE_DIR}/skins/silver/xui/en-us/widgets/*.xml)
|
||||
##list(APPEND viewer_XUI_FILES ${SILVER_WIDGET_FILE_GLOB_LIST})
|
||||
|
||||
list(SORT viewer_XUI_FILES)
|
||||
#list(SORT viewer_XUI_FILES)
|
||||
|
||||
source_group("XUI Files" FILES ${viewer_XUI_FILES})
|
||||
#source_group("XUI Files" FILES ${viewer_XUI_FILES})
|
||||
|
||||
set_source_files_properties(${viewer_XUI_FILES}
|
||||
#set_source_files_properties(${viewer_XUI_FILES}
|
||||
# PROPERTIES HEADER_FILE_ONLY TRUE)
|
||||
|
||||
#list(APPEND viewer_SOURCE_FILES ${viewer_XUI_FILES})
|
||||
|
||||
file(GLOB_RECURSE viewer_XUI_FILES LIST_DIRECTORIES FALSE
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/skins/*.xml)
|
||||
source_group(TREE ${CMAKE_CURRENT_SOURCE_DIR}/skins PREFIX "XUI Files" FILES ${viewer_XUI_FILES})
|
||||
set_source_files_properties(${viewer_XUI_FILES}
|
||||
PROPERTIES HEADER_FILE_ONLY TRUE)
|
||||
|
||||
list(APPEND viewer_SOURCE_FILES ${viewer_XUI_FILES})
|
||||
# </FS:Ansariel>
|
||||
|
||||
file(GLOB_RECURSE viewer_SHADER_FILES LIST_DIRECTORIES FALSE
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/app_settings/shaders/*.glsl)
|
||||
source_group(TREE ${CMAKE_CURRENT_SOURCE_DIR}/app_settings/shaders PREFIX "Shaders" FILES ${viewer_SHADER_FILES})
|
||||
set_source_files_properties(${viewer_SHADER_FILES}
|
||||
PROPERTIES HEADER_FILE_ONLY TRUE)
|
||||
list(APPEND viewer_SOURCE_FILES ${viewer_SHADER_FILES})
|
||||
|
||||
|
||||
set(viewer_APPSETTINGS_FILES
|
||||
app_settings/anim.ini
|
||||
|
|
@ -2238,9 +2255,9 @@ if (WINDOWS)
|
|||
set_target_properties(${VIEWER_BINARY_NAME}
|
||||
PROPERTIES
|
||||
# *TODO -reenable this once we get server usage sorted out
|
||||
LINK_FLAGS "/debug /NODEFAULTLIB:LIBCMT /SUBSYSTEM:WINDOWS /LARGEADDRESSAWARE"
|
||||
LINK_FLAGS_DEBUG "/NODEFAULTLIB:\"LIBCMT;LIBCMTD;MSVCRT\" /INCREMENTAL:NO /LARGEADDRESSAWARE"
|
||||
LINK_FLAGS_RELEASE "/FORCE:MULTIPLE /MAP\"secondlife-bin.MAP\" /OPT:REF /LARGEADDRESSAWARE"
|
||||
LINK_FLAGS "/debug /NODEFAULTLIB:LIBCMT /SUBSYSTEM:WINDOWS /LARGEADDRESSAWARE /LTCG"
|
||||
LINK_FLAGS_DEBUG "/NODEFAULTLIB:\"LIBCMT;LIBCMTD;MSVCRT\" /INCREMENTAL:NO /LARGEADDRESSAWARE /LTCG"
|
||||
LINK_FLAGS_RELEASE "/FORCE:MULTIPLE /MAP\"secondlife-bin.MAP\" /OPT:REF /LARGEADDRESSAWARE /LTCG"
|
||||
)
|
||||
|
||||
if(USE_PRECOMPILED_HEADERS)
|
||||
|
|
@ -2267,18 +2284,17 @@ if (WINDOWS)
|
|||
# The following commented dependencies are determined at variably at build time. Can't do this here.
|
||||
${CMAKE_SOURCE_DIR}/../etc/message.xml
|
||||
${CMAKE_SOURCE_DIR}/../scripts/messages/message_template.msg
|
||||
${SHARED_LIB_STAGING_DIR}/${CMAKE_CFG_INTDIR}/llcommon.dll
|
||||
# ${SHARED_LIB_STAGING_DIR}/${CMAKE_CFG_INTDIR}/llcommon.dll # <FS:Ansariel> Doesn't exist
|
||||
${SHARED_LIB_STAGING_DIR}/${CMAKE_CFG_INTDIR}/libapr-1.dll
|
||||
${SHARED_LIB_STAGING_DIR}/${CMAKE_CFG_INTDIR}/libaprutil-1.dll
|
||||
${SHARED_LIB_STAGING_DIR}/${CMAKE_CFG_INTDIR}/libapriconv-1.dll
|
||||
# <FS:Beq> Restore GLOD build dependencies
|
||||
${SHARED_LIB_STAGING_DIR}/Release/glod.dll
|
||||
${SHARED_LIB_STAGING_DIR}/RelWithDebInfo/glod.dll
|
||||
${SHARED_LIB_STAGING_DIR}/Debug/glod.dll
|
||||
# </FS:Beq>
|
||||
${SHARED_LIB_STAGING_DIR}/Release/libcollada14dom22.dll
|
||||
${SHARED_LIB_STAGING_DIR}/RelWithDebInfo/libcollada14dom22.dll
|
||||
${SHARED_LIB_STAGING_DIR}/Debug/libcollada14dom22-d.dll
|
||||
#${SHARED_LIB_STAGING_DIR}/Release/libcollada14dom22.dll # <FS:Ansariel> Doesn't exist
|
||||
#${SHARED_LIB_STAGING_DIR}/RelWithDebInfo/libcollada14dom22.dll # <FS:Ansariel> Doesn't exist
|
||||
#${SHARED_LIB_STAGING_DIR}/Debug/libcollada14dom22-d.dll # <FS:Ansariel> Doesn't exist
|
||||
# <FS:Ansariel> Only copy OpenJPEG dll if needed
|
||||
#${SHARED_LIB_STAGING_DIR}/Release/openjp2.dll
|
||||
#${SHARED_LIB_STAGING_DIR}/RelWithDebInfo/openjp2.dll
|
||||
|
|
@ -2286,13 +2302,13 @@ if (WINDOWS)
|
|||
# </FS:Ansariel>
|
||||
${SHARED_LIB_STAGING_DIR}/Release/libhunspell.dll
|
||||
${SHARED_LIB_STAGING_DIR}/RelWithDebInfo/libhunspell.dll
|
||||
${SHARED_LIB_STAGING_DIR}/Debug/libhunspell.dll
|
||||
# ${SHARED_LIB_STAGING_DIR}/Debug/libhunspell.dll # <FS:Ansariel> Doesn't exist
|
||||
${SHARED_LIB_STAGING_DIR}/Release/uriparser.dll
|
||||
${SHARED_LIB_STAGING_DIR}/RelWithDebInfo/uriparser.dll
|
||||
${SHARED_LIB_STAGING_DIR}/${CMAKE_CFG_INTDIR}/SLVoice.exe
|
||||
${SHARED_LIB_STAGING_DIR}/${CMAKE_CFG_INTDIR}/libsndfile-1.dll
|
||||
${SHARED_LIB_STAGING_DIR}/${CMAKE_CFG_INTDIR}/vivoxoal.dll
|
||||
${SHARED_LIB_STAGING_DIR}/${CMAKE_CFG_INTDIR}/ca-bundle.crt
|
||||
#${SHARED_LIB_STAGING_DIR}/${CMAKE_CFG_INTDIR}/SLVoice.exe # <FS:Ansariel> Doesn't exist
|
||||
#${SHARED_LIB_STAGING_DIR}/${CMAKE_CFG_INTDIR}/libsndfile-1.dll # <FS:Ansariel> Doesn't exist
|
||||
#${SHARED_LIB_STAGING_DIR}/${CMAKE_CFG_INTDIR}/vivoxoal.dll # <FS:Ansariel> Doesn't exist
|
||||
#${SHARED_LIB_STAGING_DIR}/${CMAKE_CFG_INTDIR}/ca-bundle.crt # <FS:Ansariel> Doesn't exist
|
||||
${GOOGLE_PERF_TOOLS_SOURCE}
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/licenses-win32.txt
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/featuretable.txt
|
||||
|
|
@ -2334,7 +2350,7 @@ if (WINDOWS)
|
|||
list(APPEND COPY_INPUT_DEPENDENCIES
|
||||
${SHARED_LIB_STAGING_DIR}/Release/fmod.dll
|
||||
${SHARED_LIB_STAGING_DIR}/RelWithDebInfo/fmod.dll
|
||||
${SHARED_LIB_STAGING_DIR}/Debug/fmodL.dll
|
||||
#${SHARED_LIB_STAGING_DIR}/Debug/fmodL.dll # <FS:Ansariel> Doesn't exist
|
||||
)
|
||||
endif (FMODSTUDIO)
|
||||
|
||||
|
|
|
|||
|
|
@ -1 +1 @@
|
|||
6.6.9
|
||||
6.6.10
|
||||
|
|
|
|||
|
|
@ -23427,6 +23427,17 @@ Change of this parameter will affect the layout of buttons in notification toast
|
|||
<key>Value</key>
|
||||
<integer>0</integer>
|
||||
</map>
|
||||
<key>DebugSettingsHideDefault</key>
|
||||
<map>
|
||||
<key>Comment</key>
|
||||
<string>Show non-default settings only in Debug Settings list</string>
|
||||
<key>Persist</key>
|
||||
<integer>0</integer>
|
||||
<key>Type</key>
|
||||
<string>Boolean</string>
|
||||
<key>Value</key>
|
||||
<integer>0</integer>
|
||||
</map>
|
||||
<key>FSNetMapPhantomOpacity</key>
|
||||
<map>
|
||||
<key>Comment</key>
|
||||
|
|
|
|||
|
|
@ -25,6 +25,17 @@
|
|||
|
||||
/*[EXTRA_CODE_HERE]*/
|
||||
|
||||
// Inputs
|
||||
VARYING vec4 vary_HazeColor;
|
||||
VARYING float vary_LightNormPosDot;
|
||||
|
||||
uniform sampler2D rainbow_map;
|
||||
uniform sampler2D halo_map;
|
||||
|
||||
uniform float moisture_level;
|
||||
uniform float droplet_radius;
|
||||
uniform float ice_level;
|
||||
|
||||
#ifdef DEFINE_GL_FRAGCOLOR
|
||||
out vec4 frag_data[3];
|
||||
#else
|
||||
|
|
@ -35,11 +46,34 @@ out vec4 frag_data[3];
|
|||
// The fragment shader for the sky
|
||||
/////////////////////////////////////////////////////////////////////////
|
||||
|
||||
VARYING vec4 vary_HazeColor;
|
||||
vec3 rainbow(float d)
|
||||
{
|
||||
// 'Interesting' values of d are -0.75 .. -0.825, i.e. when view vec nearly opposite of sun vec
|
||||
// Rainbox tex is mapped with REPEAT, so -.75 as tex coord is same as 0.25. -0.825 -> 0.175. etc.
|
||||
// SL-13629
|
||||
// Unfortunately the texture is inverted, so we need to invert the y coord, but keep the 'interesting'
|
||||
// part within the same 0.175..0.250 range, i.e. d = (1 - d) - 1.575
|
||||
d = clamp(-0.575 - d, 0.0, 1.0);
|
||||
|
||||
// With the colors in the lower 1/4 of the texture, inverting the coords leaves most of it inaccessible.
|
||||
// So, we can stretch the texcoord above the colors (ie > 0.25) to fill the entire remaining coordinate
|
||||
// space. This improves gradation, reduces banding within the rainbow interior. (1-0.25) / (0.425/0.25) = 4.2857
|
||||
float interior_coord = max(0.0, d - 0.25) * 4.2857;
|
||||
d = clamp(d, 0.0, 0.25) + interior_coord;
|
||||
|
||||
float rad = (droplet_radius - 5.0f) / 1024.0f;
|
||||
return pow(texture2D(rainbow_map, vec2(rad+0.5, d)).rgb, vec3(1.8)) * moisture_level;
|
||||
}
|
||||
|
||||
vec3 halo22(float d)
|
||||
{
|
||||
d = clamp(d, 0.1, 1.0);
|
||||
float v = sqrt(clamp(1 - (d * d), 0, 1));
|
||||
return texture2D(halo_map, vec2(0, v)).rgb * ice_level;
|
||||
}
|
||||
|
||||
/// Soft clips the light with a gamma correction
|
||||
vec3 scaleSoftClip(vec3 light);
|
||||
vec3 srgb_to_linear(vec3 c);
|
||||
|
||||
void main()
|
||||
{
|
||||
|
|
@ -48,14 +82,18 @@ void main()
|
|||
// the fragment) if the sky wouldn't show up because the clouds
|
||||
// are fully opaque.
|
||||
|
||||
vec4 color;
|
||||
color = vary_HazeColor;
|
||||
vec4 color = vary_HazeColor;
|
||||
|
||||
float rel_pos_lightnorm = vary_LightNormPosDot;
|
||||
float optic_d = rel_pos_lightnorm;
|
||||
vec3 halo_22 = halo22(optic_d);
|
||||
color.rgb += rainbow(optic_d);
|
||||
color.rgb += halo_22;
|
||||
color.rgb *= 2.;
|
||||
color.rgb = scaleSoftClip(color.rgb);
|
||||
|
||||
/// Gamma correct for WL (soft clip effect).
|
||||
frag_data[0] = vec4(color.rgb, 0.0);
|
||||
// Gamma correct for WL (soft clip effect).
|
||||
frag_data[0] = vec4(color.rgb, 1.0);
|
||||
frag_data[1] = vec4(0.0,0.0,0.0,0.0);
|
||||
frag_data[2] = vec4(0.0,0.0,0.0,1.0); //1.0 in norm.w masks off fog
|
||||
|
||||
|
|
|
|||
|
|
@ -33,6 +33,7 @@ ATTRIBUTE vec3 position;
|
|||
|
||||
// Output parameters
|
||||
VARYING vec4 vary_HazeColor;
|
||||
VARYING float vary_LightNormPosDot;
|
||||
|
||||
// Inputs
|
||||
uniform vec3 camPosLocal;
|
||||
|
|
@ -72,27 +73,29 @@ void main()
|
|||
vec3 rel_pos = position.xyz - camPosLocal.xyz + vec3(0, 50, 0);
|
||||
|
||||
// Adj position vector to clamp altitude
|
||||
if (rel_pos.y > 0)
|
||||
if (rel_pos.y > 0.)
|
||||
{
|
||||
rel_pos *= (max_y / rel_pos.y);
|
||||
}
|
||||
if (rel_pos.y < 0)
|
||||
if (rel_pos.y < 0.)
|
||||
{
|
||||
rel_pos *= (-32000. / rel_pos.y);
|
||||
}
|
||||
|
||||
// Can normalize then
|
||||
vec3 rel_pos_norm = normalize(rel_pos);
|
||||
// Normalized
|
||||
vec3 rel_pos_norm = normalize(rel_pos);
|
||||
float rel_pos_len = length(rel_pos);
|
||||
|
||||
float rel_pos_len = length(rel_pos);
|
||||
// Grab this value and pass to frag shader for rainbows
|
||||
float rel_pos_lightnorm_dot = dot(rel_pos_norm, lightnorm.xyz);
|
||||
vary_LightNormPosDot = rel_pos_lightnorm_dot;
|
||||
|
||||
// Initialize temp variables
|
||||
vec4 sunlight = (sun_up_factor == 1) ? sunlight_color : moonlight_color;
|
||||
vec4 light_atten;
|
||||
|
||||
// Sunlight attenuation effect (hue and brightness) due to atmosphere
|
||||
// this is used later for sunlight modulation at various altitudes
|
||||
light_atten = (blue_density + vec4(haze_density * 0.25)) * (density_multiplier * max_y);
|
||||
vec4 light_atten = (blue_density + vec4(haze_density * 0.25)) * (density_multiplier * max_y);
|
||||
|
||||
// Calculate relative weights
|
||||
vec4 combined_haze = abs(blue_density) + vec4(abs(haze_density));
|
||||
|
|
@ -112,7 +115,7 @@ void main()
|
|||
combined_haze = exp(-combined_haze * density_dist);
|
||||
|
||||
// Compute haze glow
|
||||
float haze_glow = 1.0 - dot(rel_pos_norm, lightnorm.xyz);
|
||||
float haze_glow = 1.0 - rel_pos_lightnorm_dot;
|
||||
// haze_glow is 0 at the sun and increases away from sun
|
||||
haze_glow = max(haze_glow, .001);
|
||||
// Set a minimum "angle" (smaller glow.y allows tighter, brighter hotspot)
|
||||
|
|
@ -123,30 +126,30 @@ void main()
|
|||
|
||||
// Add "minimum anti-solar illumination"
|
||||
// For sun, add to glow. For moon, remove glow entirely. SL-13768
|
||||
haze_glow = (sun_moon_glow_factor < 1.0) ? 0.0 : (haze_glow + 0.25);
|
||||
haze_glow = (sun_moon_glow_factor < 1.0) ? 0.0 : (sun_moon_glow_factor * (haze_glow + 0.25));
|
||||
|
||||
vec4 color =
|
||||
(blue_horizon * blue_weight * (sunlight + ambient_color) + (haze_horizon * haze_weight) * (sunlight * haze_glow + ambient_color));
|
||||
// Haze color above cloud
|
||||
vec4 color = (blue_horizon * blue_weight * (sunlight + ambient_color)
|
||||
+ (haze_horizon * haze_weight) * (sunlight * haze_glow + ambient_color));
|
||||
|
||||
// Final atmosphere additive
|
||||
color *= (1. - combined_haze);
|
||||
|
||||
// Increase ambient when there are more clouds
|
||||
vec4 tmpAmbient = ambient_color;
|
||||
tmpAmbient += max(vec4(0), (1. - ambient_color)) * cloud_shadow * 0.5;
|
||||
vec4 ambient = ambient_color + max(vec4(0), (1. - ambient_color)) * cloud_shadow * 0.5;
|
||||
|
||||
// Dim sunlight by cloud shadow percentage
|
||||
sunlight *= max(0.0, (1. - cloud_shadow));
|
||||
|
||||
// Haze color below cloud
|
||||
vec4 additiveColorBelowCloud =
|
||||
(blue_horizon * blue_weight * (sunlight + tmpAmbient) + (haze_horizon * haze_weight) * (sunlight * haze_glow + tmpAmbient));
|
||||
vec4 add_below_cloud = (blue_horizon * blue_weight * (sunlight + ambient)
|
||||
+ (haze_horizon * haze_weight) * (sunlight * haze_glow + ambient));
|
||||
|
||||
// Attenuate cloud color by atmosphere
|
||||
combined_haze = sqrt(combined_haze); // less atmos opacity (more transparency) below clouds
|
||||
|
||||
// At horizon, blend high altitude sky color towards the darker color below the clouds
|
||||
color += (additiveColorBelowCloud - color) * (1. - sqrt(combined_haze));
|
||||
color += (add_below_cloud - color) * (1. - sqrt(combined_haze));
|
||||
|
||||
// Haze color above cloud
|
||||
vary_HazeColor = color;
|
||||
|
|
|
|||
|
|
@ -1,199 +0,0 @@
|
|||
/**
|
||||
* @file class2/deferred/skyF.glsl
|
||||
*
|
||||
* $LicenseInfo:firstyear=2005&license=viewerlgpl$
|
||||
* Second Life Viewer Source Code
|
||||
* Copyright (C) 2005, 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$
|
||||
*/
|
||||
|
||||
uniform mat4 modelview_projection_matrix;
|
||||
|
||||
// SKY ////////////////////////////////////////////////////////////////////////
|
||||
// The vertex shader for creating the atmospheric sky
|
||||
///////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
// Inputs
|
||||
uniform vec3 camPosLocal;
|
||||
|
||||
uniform vec4 lightnorm;
|
||||
uniform vec4 sunlight_color;
|
||||
uniform vec4 moonlight_color;
|
||||
uniform int sun_up_factor;
|
||||
uniform vec4 ambient_color;
|
||||
uniform vec4 blue_horizon;
|
||||
uniform vec4 blue_density;
|
||||
uniform float haze_horizon;
|
||||
uniform float haze_density;
|
||||
|
||||
uniform float cloud_shadow;
|
||||
uniform float density_multiplier;
|
||||
uniform float distance_multiplier;
|
||||
uniform float max_y;
|
||||
|
||||
uniform vec4 glow;
|
||||
uniform float sun_moon_glow_factor;
|
||||
|
||||
uniform vec4 cloud_color;
|
||||
|
||||
#ifdef DEFINE_GL_FRAGCOLOR
|
||||
out vec4 frag_data[3];
|
||||
#else
|
||||
#define frag_data gl_FragData
|
||||
#endif
|
||||
|
||||
VARYING vec3 pos;
|
||||
|
||||
/////////////////////////////////////////////////////////////////////////
|
||||
// The fragment shader for the sky
|
||||
/////////////////////////////////////////////////////////////////////////
|
||||
|
||||
uniform sampler2D rainbow_map;
|
||||
uniform sampler2D halo_map;
|
||||
|
||||
uniform float moisture_level;
|
||||
uniform float droplet_radius;
|
||||
uniform float ice_level;
|
||||
|
||||
vec3 rainbow(float d)
|
||||
{
|
||||
// d is the dot product of view and sun directions, so ranging -1.0..1.0
|
||||
// 'interesting' values of d are the range -0.75..-0.825, when view is nearly opposite of sun vec
|
||||
// Rainbox texture mode is GL_REPEAT, so tc of -.75 is equiv to 0.25, -0.825 equiv to 0.175.
|
||||
|
||||
// SL-13629 Rainbow texture has colors within the correct .175...250 range, but order is inverted.
|
||||
// Rather than replace the texture, we mirror and translate the y tc to keep the colors within the
|
||||
// interesting range, but in reversed order: i.e. d = (1 - d) - 1.575
|
||||
d = clamp(-0.575 - d, 0.0, 1.0);
|
||||
|
||||
// With the colors in the lower 1/4 of the texture, inverting the coords leaves most of it inaccessible.
|
||||
// So, we can stretch the texcoord above the colors (ie > 0.25) to fill the entire remaining coordinate
|
||||
// space. This improves gradation, reduces banding within the rainbow interior. (1-0.25) / (0.425/0.25) = 4.2857
|
||||
float interior_coord = max(0.0, d - 0.25) * 4.2857;
|
||||
d = clamp(d, 0.0, 0.25) + interior_coord;
|
||||
|
||||
float rad = (droplet_radius - 5.0f) / 1024.0f;
|
||||
return pow(texture2D(rainbow_map, vec2(rad, d)).rgb, vec3(1.8)) * moisture_level;
|
||||
}
|
||||
|
||||
vec3 halo22(float d)
|
||||
{
|
||||
d = clamp(d, 0.1, 1.0);
|
||||
float v = sqrt(clamp(1 - (d * d), 0, 1));
|
||||
return texture2D(halo_map, vec2(0, v)).rgb * ice_level;
|
||||
}
|
||||
|
||||
/// Soft clips the light with a gamma correction
|
||||
vec3 scaleSoftClip(vec3 light);
|
||||
|
||||
void main()
|
||||
{
|
||||
// World / view / projection
|
||||
// Get relative position (offset why?)
|
||||
vec3 rel_pos = pos.xyz - camPosLocal.xyz + vec3(0, 50, 0);
|
||||
|
||||
// Adj position vector to clamp altitude
|
||||
if (rel_pos.y > 0.)
|
||||
{
|
||||
rel_pos *= (max_y / rel_pos.y);
|
||||
}
|
||||
if (rel_pos.y < 0.)
|
||||
{
|
||||
rel_pos *= (-32000. / rel_pos.y);
|
||||
}
|
||||
|
||||
// Normalized
|
||||
vec3 rel_pos_norm = normalize(rel_pos);
|
||||
float rel_pos_len = length(rel_pos);
|
||||
|
||||
// Initialize temp variables
|
||||
vec4 sunlight = (sun_up_factor == 1) ? sunlight_color : moonlight_color;
|
||||
|
||||
// Sunlight attenuation effect (hue and brightness) due to atmosphere
|
||||
// this is used later for sunlight modulation at various altitudes
|
||||
vec4 light_atten = (blue_density + vec4(haze_density * 0.25)) * (density_multiplier * max_y);
|
||||
|
||||
// Calculate relative weights
|
||||
vec4 combined_haze = abs(blue_density) + vec4(abs(haze_density));
|
||||
vec4 blue_weight = blue_density / combined_haze;
|
||||
vec4 haze_weight = haze_density / combined_haze;
|
||||
|
||||
// Compute sunlight from rel_pos & lightnorm (for long rays like sky)
|
||||
float off_axis = 1.0 / max(1e-6, max(0, rel_pos_norm.y) + lightnorm.y);
|
||||
sunlight *= exp(-light_atten * off_axis);
|
||||
|
||||
// Distance
|
||||
float density_dist = rel_pos_len * density_multiplier;
|
||||
|
||||
// Transparency (-> combined_haze)
|
||||
// ATI Bugfix -- can't store combined_haze*density_dist in a variable because the ati
|
||||
// compiler gets confused.
|
||||
combined_haze = exp(-combined_haze * density_dist);
|
||||
|
||||
// Compute haze glow
|
||||
float haze_glow = dot(rel_pos_norm, lightnorm.xyz);
|
||||
haze_glow = 1. - haze_glow;
|
||||
// haze_glow is 0 at the sun and increases away from sun
|
||||
haze_glow = max(haze_glow, .001);
|
||||
// Set a minimum "angle" (smaller glow.y allows tighter, brighter hotspot)
|
||||
haze_glow *= glow.x;
|
||||
// Higher glow.x gives dimmer glow (because next step is 1 / "angle")
|
||||
haze_glow = pow(haze_glow, glow.z);
|
||||
// glow.z should be negative, so we're doing a sort of (1 / "angle") function
|
||||
|
||||
// Add "minimum anti-solar illumination"
|
||||
// For sun, add to glow. For moon, remove glow entirely. SL-13768
|
||||
haze_glow = (sun_moon_glow_factor < 1.0) ? 0.0 : (sun_moon_glow_factor * (haze_glow + 0.25));
|
||||
|
||||
// Haze color above cloud
|
||||
vec4 color = blue_horizon * blue_weight * (sunlight + ambient_color)
|
||||
+ haze_horizon * haze_weight * (sunlight * haze_glow + ambient_color);
|
||||
|
||||
// Final atmosphere additive
|
||||
color *= (1. - combined_haze);
|
||||
|
||||
// Increase ambient when there are more clouds
|
||||
// TODO 9/20: DJH what does this do? max(0,(1-ambient)) will change the color
|
||||
vec4 ambient = ambient_color + max(vec4(0), (1. - ambient_color)) * cloud_shadow * 0.5;
|
||||
|
||||
// Dim sunlight by cloud shadow percentage
|
||||
sunlight *= max(0.0, (1. - cloud_shadow));
|
||||
|
||||
// Haze color below cloud
|
||||
vec4 add_below_cloud = blue_horizon * blue_weight * (sunlight + ambient)
|
||||
+ haze_horizon * haze_weight * (sunlight * haze_glow + ambient);
|
||||
|
||||
// Attenuate cloud color by atmosphere
|
||||
combined_haze = sqrt(combined_haze); // less atmos opacity (more transparency) below clouds
|
||||
|
||||
// At horizon, blend high altitude sky color towards the darker color below the clouds
|
||||
color += (add_below_cloud - color) * (1. - sqrt(combined_haze));
|
||||
|
||||
float optic_d = dot(rel_pos_norm, lightnorm.xyz);
|
||||
vec3 halo_22 = halo22(optic_d);
|
||||
color.rgb += rainbow(optic_d);
|
||||
color.rgb += halo_22;
|
||||
color.rgb *= 2.;
|
||||
color.rgb = scaleSoftClip(color.rgb);
|
||||
|
||||
// Gamma correct for WL (soft clip effect).
|
||||
frag_data[0] = vec4(color.rgb, 1.0);
|
||||
frag_data[1] = vec4(0.0, 0.0, 0.0, 0.0);
|
||||
frag_data[2] = vec4(0.0, 0.0, 0.0, 1.0); // 1.0 in norm.w masks off fog
|
||||
}
|
||||
|
|
@ -1,42 +0,0 @@
|
|||
/**
|
||||
* @file WLSkyV.glsl
|
||||
*
|
||||
* $LicenseInfo:firstyear=2005&license=viewerlgpl$
|
||||
* Second Life Viewer Source Code
|
||||
* Copyright (C) 2005, 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$
|
||||
*/
|
||||
|
||||
uniform mat4 modelview_projection_matrix;
|
||||
|
||||
ATTRIBUTE vec3 position;
|
||||
|
||||
// SKY ////////////////////////////////////////////////////////////////////////
|
||||
// The vertex shader for creating the atmospheric sky
|
||||
///////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
VARYING vec3 pos;
|
||||
|
||||
void main()
|
||||
{
|
||||
|
||||
// World / view / projection
|
||||
pos = position.xyz;
|
||||
gl_Position = modelview_projection_matrix * vec4(position.xyz, 1.0);
|
||||
}
|
||||
|
|
@ -149,7 +149,8 @@ public:
|
|||
mNeedsTimeBox(true),
|
||||
mTimeBoxTextBox(NULL),
|
||||
mHeaderLayoutStack(NULL),
|
||||
mAvatarNameCacheConnection()
|
||||
mAvatarNameCacheConnection(),
|
||||
mTime(0)
|
||||
{}
|
||||
|
||||
static FSChatHistoryHeader* createInstance(const std::string& file_name)
|
||||
|
|
@ -1262,9 +1263,7 @@ FSChatHistory::FSChatHistory(const FSChatHistory::Params& p)
|
|||
|
||||
LLSD FSChatHistory::getValue() const
|
||||
{
|
||||
LLSD* text=new LLSD();
|
||||
text->assign(getText());
|
||||
return *text;
|
||||
return LLSD(getText());
|
||||
}
|
||||
|
||||
FSChatHistory::~FSChatHistory()
|
||||
|
|
|
|||
|
|
@ -106,7 +106,7 @@ bool FSContactsFriendsMenu::enableContextMenuItem(const LLSD& userdata)
|
|||
{
|
||||
if (mUUIDs.size() == 1)
|
||||
{
|
||||
return (FSRadar::getInstance()->getEntry(mUUIDs.front()) != NULL);
|
||||
return FSRadar::getInstance()->getEntry(mUUIDs.front()) != nullptr;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
|
@ -126,7 +126,7 @@ bool FSContactsFriendsMenu::enableContextMenuItem(const LLSD& userdata)
|
|||
{
|
||||
if (mUUIDs.size() == 1)
|
||||
{
|
||||
return (FSRadar::getInstance()->getEntry(mUUIDs.front()) != NULL);
|
||||
return FSRadar::getInstance()->getEntry(mUUIDs.front()) != nullptr;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -38,12 +38,12 @@
|
|||
#include "fslslpreprocviewer.h"
|
||||
#include "llagent.h"
|
||||
#include "llappviewer.h"
|
||||
#include "llinventoryfunctions.h"
|
||||
#include "lltrans.h"
|
||||
#include "llfilesystem.h"
|
||||
#include "llviewercontrol.h"
|
||||
#include "llcompilequeue.h"
|
||||
#include "llfilesystem.h"
|
||||
#include "llinventoryfunctions.h"
|
||||
#include "llnotificationsutil.h"
|
||||
#include "lltrans.h"
|
||||
#include "llviewercontrol.h"
|
||||
|
||||
#ifdef __GNUC__
|
||||
// There is a sprintf( ... "%d", size_t_value) buried inside boost::wave. In order to not mess with system header, I rather disable that warning here.
|
||||
|
|
@ -53,7 +53,7 @@
|
|||
class ScriptMatches : public LLInventoryCollectFunctor
|
||||
{
|
||||
public:
|
||||
ScriptMatches(const std::string& name)
|
||||
ScriptMatches(std::string_view name)
|
||||
{
|
||||
mName = name;
|
||||
}
|
||||
|
|
@ -70,7 +70,7 @@ private:
|
|||
std::string mName;
|
||||
};
|
||||
|
||||
LLUUID FSLSLPreprocessor::findInventoryByName(std::string name)
|
||||
std::optional<LLUUID> FSLSLPreprocessor::findInventoryByName(std::string_view name)
|
||||
{
|
||||
LLInventoryModel::cat_array_t cats;
|
||||
LLInventoryModel::item_array_t items;
|
||||
|
|
@ -81,17 +81,11 @@ LLUUID FSLSLPreprocessor::findInventoryByName(std::string name)
|
|||
{
|
||||
return items.front()->getUUID();
|
||||
}
|
||||
return LLUUID::null;
|
||||
return std::nullopt;
|
||||
}
|
||||
|
||||
|
||||
std::map<std::string,LLUUID> FSLSLPreprocessor::cached_assetids;
|
||||
|
||||
#if !defined(LL_DARWIN) || defined(DARWINPREPROC)
|
||||
|
||||
//apparently LL #defined this function which happens to precisely match
|
||||
//a boost::wave function name, destroying the internet, silly grey furries
|
||||
#undef equivalent
|
||||
std::map<std::string, LLUUID> FSLSLPreprocessor::cached_assetids;
|
||||
|
||||
// Work around stupid Microsoft STL warning
|
||||
#ifdef LL_WINDOWS
|
||||
|
|
@ -131,20 +125,14 @@ using namespace boost::regex_constants;
|
|||
std::string FSLSLPreprocessor::encode(const std::string& script)
|
||||
{
|
||||
std::string otext = FSLSLPreprocessor::decode(script);
|
||||
|
||||
bool mono = mono_directive(script);
|
||||
|
||||
|
||||
otext = boost::regex_replace(otext, boost::regex("([/*])(?=[/*|])", boost::regex::perl), "$1|");
|
||||
|
||||
//otext = curl_escape(otext.c_str(), otext.size());
|
||||
|
||||
otext = encode_start + otext + encode_end;
|
||||
|
||||
otext += "\n//nfo_preprocessor_version 0";
|
||||
|
||||
|
||||
//otext += "\n//^ = determine what featureset is supported";
|
||||
otext += llformat("\n//program_version %s", LLAppViewer::instance()->getWindowTitle().c_str());
|
||||
|
||||
|
||||
time_t utc_time = time_corrected();
|
||||
std::string timeStr ="["+LLTrans::getString ("TimeMonth")+"]/["
|
||||
+LLTrans::getString ("TimeDay")+"]/["
|
||||
|
|
@ -156,10 +144,9 @@ std::string FSLSLPreprocessor::encode(const std::string& script)
|
|||
substitution["datetime"] = (S32) utc_time;
|
||||
LLStringUtil::format (timeStr, substitution);
|
||||
otext += "\n//last_compiled " + timeStr;
|
||||
|
||||
otext += "\n";
|
||||
|
||||
if (mono)
|
||||
|
||||
if (mono_directive(script))
|
||||
{
|
||||
otext += "//mono\n";
|
||||
}
|
||||
|
|
@ -173,19 +160,19 @@ std::string FSLSLPreprocessor::encode(const std::string& script)
|
|||
|
||||
std::string FSLSLPreprocessor::decode(const std::string& script)
|
||||
{
|
||||
static S32 startpoint = encode_start.length();
|
||||
|
||||
static const S32 startpoint = encode_start.length();
|
||||
|
||||
std::string tip = script.substr(0, startpoint);
|
||||
|
||||
|
||||
if (tip != encode_start)
|
||||
{
|
||||
LL_DEBUGS("FSLSLPreprocessor") << "No start" << LL_ENDL;
|
||||
//if(sp != -1)trigger warningg/error?
|
||||
return script;
|
||||
}
|
||||
|
||||
|
||||
S32 end = script.find(encode_end);
|
||||
|
||||
|
||||
if (end == -1)
|
||||
{
|
||||
LL_DEBUGS("FSLSLPreprocessor") << "No end" << LL_ENDL;
|
||||
|
|
@ -196,11 +183,8 @@ std::string FSLSLPreprocessor::decode(const std::string& script)
|
|||
LL_DEBUGS("FSLSLPreprocessor") << "data = " << data << LL_ENDL;
|
||||
|
||||
std::string otext = data;
|
||||
|
||||
otext = boost::regex_replace(otext, boost::regex("([/*])\\|", boost::regex::perl), "$1");
|
||||
|
||||
//otext = curl_unescape(otext.c_str(),otext.length());
|
||||
|
||||
return otext;
|
||||
}
|
||||
|
||||
|
|
@ -211,13 +195,13 @@ static std::string scopeript2(std::string& top, S32 fstart, char left = '{', cha
|
|||
{
|
||||
return "begin out of bounds";
|
||||
}
|
||||
|
||||
|
||||
S32 cursor = fstart;
|
||||
bool noscoped = true;
|
||||
bool in_literal = false;
|
||||
S32 count = 0;
|
||||
char ltoken = ' ';
|
||||
|
||||
|
||||
do
|
||||
{
|
||||
char token = top.at(cursor);
|
||||
|
|
@ -253,7 +237,7 @@ static std::string scopeript2(std::string& top, S32 fstart, char left = '{', cha
|
|||
return "end out of bounds";
|
||||
}
|
||||
|
||||
return top.substr(fstart,(cursor-fstart));
|
||||
return top.substr(fstart, (cursor - fstart));
|
||||
}
|
||||
|
||||
static inline S32 const_iterator_to_pos(std::string::const_iterator begin, std::string::const_iterator cursor)
|
||||
|
|
@ -317,7 +301,6 @@ static void shredder(std::string& text)
|
|||
|
||||
std::string FSLSLPreprocessor::lslopt(std::string script)
|
||||
{
|
||||
|
||||
try
|
||||
{
|
||||
std::string bottom;
|
||||
|
|
@ -409,17 +392,12 @@ std::string FSLSLPreprocessor::lslopt(std::string script)
|
|||
do
|
||||
{
|
||||
repass = false;
|
||||
std::map<std::string, std::string>::iterator func_it;
|
||||
for (func_it = functions.begin(); func_it != functions.end(); func_it++)
|
||||
for (const auto& [funcname, function] : functions)
|
||||
{
|
||||
|
||||
std::string funcname = func_it->first;
|
||||
|
||||
if (kept_functions.find(funcname) == kept_functions.end())
|
||||
{
|
||||
|
||||
boost::smatch calls;
|
||||
//funcname has to be [a-zA-Z0-9_]+, so we know it's safe
|
||||
//funcname has to be [a-zA-Z0-9_]+, so we know it's safe
|
||||
boost::regex findcalls(std::string() +
|
||||
rDOT_MATCHES_NEWLINE
|
||||
"(?<![A-Za-z0-9_])(" + funcname + ")" rOPT_SPC "\\(" // a call to the function...
|
||||
|
|
@ -439,7 +417,6 @@ std::string FSLSLPreprocessor::lslopt(std::string script)
|
|||
{
|
||||
if (calls[1].matched)
|
||||
{
|
||||
std::string function = func_it->second;
|
||||
kept_functions.insert(funcname);
|
||||
bottom = function + bottom;
|
||||
repass = true;
|
||||
|
|
@ -456,11 +433,9 @@ std::string FSLSLPreprocessor::lslopt(std::string script)
|
|||
while (repass);
|
||||
|
||||
// Find variable invocations and add the declarations back if used.
|
||||
|
||||
std::vector<std::pair<std::string, std::string> >::reverse_iterator var_it;
|
||||
for (var_it = gvars.rbegin(); var_it != gvars.rend(); var_it++)
|
||||
{
|
||||
|
||||
std::string varname = var_it->first;
|
||||
boost::regex findvcalls(std::string() + rDOT_MATCHES_NEWLINE
|
||||
"(?<![a-zA-Z0-9_.])(" + varname + ")(?![a-zA-Z0-9_\"])" // invocation of the variable
|
||||
|
|
@ -509,6 +484,7 @@ std::string FSLSLPreprocessor::lslopt(std::string script)
|
|||
display_error(err);
|
||||
throw;
|
||||
}
|
||||
|
||||
return script;
|
||||
}
|
||||
|
||||
|
|
@ -546,9 +522,9 @@ struct ProcCacheInfo
|
|||
FSLSLPreprocessor* self;
|
||||
};
|
||||
|
||||
static inline std::string shortfile(std::string in)
|
||||
static inline std::string shortfile(const std::string& in)
|
||||
{
|
||||
return boost::filesystem::path(std::string(in)).filename().string();
|
||||
return boost::filesystem::path(in).filename().string();
|
||||
}
|
||||
|
||||
|
||||
|
|
@ -556,22 +532,21 @@ class trace_include_files : public boost::wave::context_policies::default_prepro
|
|||
{
|
||||
public:
|
||||
trace_include_files(FSLSLPreprocessor* proc)
|
||||
: mProc(proc)
|
||||
: mProc(proc)
|
||||
{
|
||||
mAssetStack.push(LLUUID::null.asString());
|
||||
mFileStack.push(proc->mMainScriptName);
|
||||
}
|
||||
|
||||
|
||||
template <typename ContextT>
|
||||
bool found_include_directive(ContextT const& ctx, std::string const &filename, bool include_next)
|
||||
{
|
||||
std::string cfilename = filename.substr(1, filename.length() - 2);
|
||||
LL_DEBUGS("FSLSLPreprocessor") << cfilename << ":found_include_directive" << LL_ENDL;
|
||||
LLUUID item_id = FSLSLPreprocessor::findInventoryByName(cfilename);
|
||||
if (item_id.notNull())
|
||||
std::optional<LLUUID> item_id = FSLSLPreprocessor::findInventoryByName(cfilename);
|
||||
if (item_id.has_value())
|
||||
{
|
||||
LLViewerInventoryItem* item = gInventory.getItem(item_id);
|
||||
LLViewerInventoryItem* item = gInventory.getItem(item_id.value());
|
||||
if (item)
|
||||
{
|
||||
std::map<std::string,LLUUID>::iterator it = mProc->cached_assetids.find(cfilename);
|
||||
|
|
@ -605,8 +580,8 @@ public:
|
|||
info->self = mProc;
|
||||
LLPermissions perm(((LLInventoryItem*)item)->getPermissions());
|
||||
gAssetStorage->getInvItemAsset(LLHost(),
|
||||
gAgent.getID(),
|
||||
gAgent.getSessionID(),
|
||||
gAgentID,
|
||||
gAgentSessionID,
|
||||
perm.getOwner(),
|
||||
LLUUID::null,
|
||||
item->getUUID(),
|
||||
|
|
@ -624,7 +599,6 @@ public:
|
|||
{
|
||||
//todo check on HDD in user defined dir for file in question
|
||||
}
|
||||
//++include_depth;
|
||||
return false;
|
||||
}
|
||||
|
||||
|
|
@ -633,11 +607,10 @@ public:
|
|||
std::string const &relname, std::string const& absname,
|
||||
bool is_system_include)
|
||||
{
|
||||
|
||||
ContextT& usefulctx = const_cast<ContextT&>(ctx);
|
||||
std::string id;
|
||||
std::string filename = shortfile(relname);//boost::filesystem::path(std::string(relname)).filename();
|
||||
std::map<std::string,LLUUID>::iterator it = mProc->cached_assetids.find(filename);
|
||||
std::string filename = shortfile(relname);
|
||||
std::map<std::string, LLUUID>::iterator it = mProc->cached_assetids.find(filename);
|
||||
if (it != mProc->cached_assetids.end())
|
||||
{
|
||||
id = mProc->cached_assetids[filename].asString();
|
||||
|
|
@ -707,7 +680,6 @@ private:
|
|||
|
||||
void cache_script(std::string name, std::string content)
|
||||
{
|
||||
|
||||
content += "\n";/*hack!*/
|
||||
LL_DEBUGS("FSLSLPreprocessor") << "writing " << name << " to cache" << LL_ENDL;
|
||||
std::string path = gDirUtilp->getExpandedFilename(LL_PATH_CACHE, "lslpreproc", name);
|
||||
|
|
@ -752,15 +724,16 @@ void FSLSLPreprocessor::FSProcCacheCallback(const LLUUID& iuuid, LLAssetType::ET
|
|||
args["[FILENAME]"] = name;
|
||||
self->display_message(LLTrans::getString("fs_preprocessor_cache_completed", args));
|
||||
cache_script(name, content);
|
||||
std::set<std::string>::iterator loc = self->caching_files.find(name);
|
||||
if (loc != self->caching_files.end())
|
||||
if (std::set<std::string>::iterator loc = self->caching_files.find(name); loc != self->caching_files.end())
|
||||
{
|
||||
LL_DEBUGS("FSLSLPreprocessor") << "finalizing cache" << LL_ENDL;
|
||||
self->caching_files.erase(loc);
|
||||
//self->cached_files.insert(name);
|
||||
if(uuid.isNull())uuid.generate();
|
||||
if (uuid.isNull())
|
||||
{
|
||||
uuid.generate();
|
||||
}
|
||||
item->setAssetUUID(uuid);
|
||||
self->cached_assetids[name] = uuid;//.insert(uuid.asString());
|
||||
self->cached_assetids[name] = uuid;
|
||||
self->start_process();
|
||||
}
|
||||
else
|
||||
|
|
@ -797,12 +770,11 @@ void FSLSLPreprocessor::preprocess_script(BOOL close, bool sync, bool defcache)
|
|||
caching_files.clear();
|
||||
LLStringUtil::format_map_t args;
|
||||
display_message(LLTrans::getString("fs_preprocessor_starting"));
|
||||
|
||||
LLFile::mkdir(gDirUtilp->getExpandedFilename(LL_PATH_CACHE,"") + gDirUtilp->getDirDelimiter() + "lslpreproc");
|
||||
std::string script = mCore->mEditor->getText();
|
||||
|
||||
LLFile::mkdir(gDirUtilp->getExpandedFilename(LL_PATH_CACHE, "lslpreproc"));
|
||||
if (mMainScriptName.empty())//more sanity
|
||||
{
|
||||
const LLInventoryItem* item = NULL;
|
||||
const LLInventoryItem* item = nullptr;
|
||||
LLPreview* preview = (LLPreview*)mCore->mUserdata;
|
||||
if (preview)
|
||||
{
|
||||
|
|
@ -818,34 +790,33 @@ void FSLSLPreprocessor::preprocess_script(BOOL close, bool sync, bool defcache)
|
|||
mMainScriptName = "(Unknown)";
|
||||
}
|
||||
}
|
||||
std::string name = mMainScriptName;
|
||||
cached_assetids[name] = LLUUID::null;
|
||||
cache_script(name, script);
|
||||
cached_assetids[mMainScriptName] = LLUUID::null;
|
||||
cache_script(mMainScriptName, mCore->mEditor->getText());
|
||||
//start the party
|
||||
start_process();
|
||||
}
|
||||
|
||||
void FSLSLPreprocessor::preprocess_script(const LLUUID& asset_id, LLScriptQueueData* data, LLAssetType::EType type, const std::string& script_data)
|
||||
{
|
||||
if(!data)
|
||||
if (!data)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
std::string script = FSLSLPreprocessor::decode(script_data);
|
||||
|
||||
|
||||
mScript = script;
|
||||
mAssetID = asset_id;
|
||||
mData = data;
|
||||
mType = type;
|
||||
|
||||
|
||||
mDefinitionCaching = false;
|
||||
caching_files.clear();
|
||||
LLStringUtil::format_map_t args;
|
||||
display_message(LLTrans::getString("fs_preprocessor_starting"));
|
||||
|
||||
LLFile::mkdir(gDirUtilp->getExpandedFilename(LL_PATH_CACHE,"") + gDirUtilp->getDirDelimiter() + "lslpreproc");
|
||||
|
||||
|
||||
LLFile::mkdir(gDirUtilp->getExpandedFilename(LL_PATH_CACHE, "lslpreproc"));
|
||||
|
||||
if (mData->mItem)
|
||||
{
|
||||
mMainScriptName = mData->mItem->getName();
|
||||
|
|
@ -854,10 +825,9 @@ void FSLSLPreprocessor::preprocess_script(const LLUUID& asset_id, LLScriptQueueD
|
|||
{
|
||||
mMainScriptName = "(Unknown)";
|
||||
}
|
||||
|
||||
std::string name = mMainScriptName;
|
||||
cached_assetids[name] = LLUUID::null;
|
||||
cache_script(name, script);
|
||||
|
||||
cached_assetids[mMainScriptName] = LLUUID::null;
|
||||
cache_script(mMainScriptName, script);
|
||||
//start the party
|
||||
start_process();
|
||||
}
|
||||
|
|
@ -974,13 +944,6 @@ static inline std::string quicklabel()
|
|||
return std::string("c") + randstr(5, "0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz");
|
||||
}
|
||||
|
||||
/* unused:
|
||||
static std::string minimalize_whitespace(std::string in)
|
||||
{
|
||||
return boost::regex_replace(in, boost::regex("\\s*",boost::regex::perl), "\n");
|
||||
}
|
||||
*/
|
||||
|
||||
static std::string reformat_switch_statements(std::string script, bool &lackDefault)
|
||||
{
|
||||
std::string buffer = script;
|
||||
|
|
@ -1274,11 +1237,11 @@ void FSLSLPreprocessor::start_process()
|
|||
}
|
||||
input = oaux.str();
|
||||
}
|
||||
|
||||
|
||||
//Make sure wave does not complain about missing newline at end of script.
|
||||
input += "\n";
|
||||
std::string output;
|
||||
|
||||
|
||||
std::string name = mMainScriptName;
|
||||
bool lazy_lists = gSavedSettings.getBOOL("_NACL_PreProcLSLLazyLists");
|
||||
bool use_switch = gSavedSettings.getBOOL("_NACL_PreProcLSLSwitch");
|
||||
|
|
@ -1327,7 +1290,7 @@ void FSLSLPreprocessor::start_process()
|
|||
ctx.set_language(boost::wave::enable_long_long(ctx.get_language()));
|
||||
ctx.set_language(boost::wave::enable_prefer_pp_numbers(ctx.get_language()));
|
||||
ctx.set_language(boost::wave::enable_variadics(ctx.get_language()));
|
||||
|
||||
|
||||
std::string path = gDirUtilp->getExpandedFilename(LL_PATH_CACHE,"") + gDirUtilp->getDirDelimiter() + "lslpreproc" + gDirUtilp->getDirDelimiter();
|
||||
ctx.add_include_path(path.c_str());
|
||||
if (enable_hdd_include)
|
||||
|
|
@ -1447,7 +1410,7 @@ void FSLSLPreprocessor::start_process()
|
|||
display_error(err);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
if (preprocessor_enabled && !errored)
|
||||
{
|
||||
FAILDEBUG
|
||||
|
|
@ -1534,7 +1497,7 @@ void FSLSLPreprocessor::start_process()
|
|||
output = lslopt(output);
|
||||
}
|
||||
catch(...)
|
||||
{
|
||||
{
|
||||
errored = true;
|
||||
display_error(LLTrans::getString("fs_preprocessor_optimizer_unexpected_exception"));
|
||||
}
|
||||
|
|
@ -1584,7 +1547,7 @@ void FSLSLPreprocessor::start_process()
|
|||
|
||||
if (mStandalone)
|
||||
{
|
||||
LLFloaterCompileQueue::scriptPreprocComplete(mAssetID, mData, mType, output);
|
||||
LLFloaterCompileQueue::scriptPreprocComplete(mData, mType, output);
|
||||
}
|
||||
else
|
||||
{
|
||||
|
|
@ -1605,66 +1568,20 @@ void FSLSLPreprocessor::start_process()
|
|||
mWaving = false;
|
||||
}
|
||||
|
||||
#else
|
||||
|
||||
std::string FSLSLPreprocessor::encode(const std::string& script)
|
||||
{
|
||||
LLStringUtil::format_map_t args;
|
||||
args["[WHERE]"] = "encode";
|
||||
display_error(LLTrans::getString("fs_preprocessor_not_supported", args));
|
||||
return script;
|
||||
}
|
||||
|
||||
std::string FSLSLPreprocessor::decode(const std::string& script)
|
||||
{
|
||||
LLStringUtil::format_map_t args;
|
||||
args["[WHERE]"] = "decode";
|
||||
display_error(LLTrans::getString("fs_preprocessor_not_supported", args));
|
||||
return script;
|
||||
}
|
||||
|
||||
std::string FSLSLPreprocessor::lslopt(std::string script)
|
||||
{
|
||||
LLStringUtil::format_map_t args;
|
||||
args["[WHERE]"] = "lslopt";
|
||||
display_error(LLTrans::getString("fs_preprocessor_not_supported", args));
|
||||
return script;
|
||||
}
|
||||
|
||||
void FSLSLPreprocessor::FSProcCacheCallback(LLVFS *vfs, const LLUUID& uuid, LLAssetType::EType type, void *userdata, S32 result, LLExtStat extstat)
|
||||
{
|
||||
}
|
||||
|
||||
void FSLSLPreprocessor::preprocess_script(BOOL close, bool sync, bool defcache)
|
||||
{
|
||||
FSLSLPreProcViewer* outfield = mCore->mPostEditor;
|
||||
if (outfield)
|
||||
{
|
||||
outfield->setText(LLStringExplicit(mCore->mEditor->getText()));
|
||||
}
|
||||
mCore->doSaveComplete((void*)mCore, close, sync);
|
||||
}
|
||||
|
||||
void FSLSLPreprocessor::preprocess_script(const LLUUID& asset_id, LLScriptQueueData* data, LLAssetType::EType type, const std::string& script_data)
|
||||
{
|
||||
LLFloaterCompileQueue::scriptPreprocComplete(asset_id, data, type, script_data);
|
||||
}
|
||||
|
||||
#endif
|
||||
|
||||
void FSLSLPreprocessor::display_message(const std::string& err)
|
||||
void FSLSLPreprocessor::display_message(std::string_view msg)
|
||||
{
|
||||
if (mStandalone)
|
||||
{
|
||||
LLFloaterCompileQueue::scriptLogMessage(mData, err);
|
||||
LLFloaterCompileQueue::scriptLogMessage(mData, msg);
|
||||
}
|
||||
else
|
||||
{
|
||||
mCore->mErrorList->addCommentText(err);
|
||||
mCore->mErrorList->addCommentText(msg.data());
|
||||
}
|
||||
}
|
||||
|
||||
void FSLSLPreprocessor::display_error(const std::string& err)
|
||||
void FSLSLPreprocessor::display_error(std::string_view err)
|
||||
{
|
||||
if (mStandalone)
|
||||
{
|
||||
|
|
@ -1673,14 +1590,13 @@ void FSLSLPreprocessor::display_error(const std::string& err)
|
|||
else
|
||||
{
|
||||
LLSD row;
|
||||
row["columns"][0]["value"] = err;
|
||||
row["columns"][0]["value"] = err.data();
|
||||
row["columns"][0]["font"] = "SANSSERIF_SMALL";
|
||||
mCore->mErrorList->addElement(row);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
bool FSLSLPreprocessor::mono_directive(std::string const& text, bool agent_inv)
|
||||
bool FSLSLPreprocessor::mono_directive(std::string_view text, bool agent_inv)
|
||||
{
|
||||
bool domono = agent_inv;
|
||||
|
||||
|
|
|
|||
|
|
@ -37,16 +37,13 @@
|
|||
#include "llviewerprecompiledheaders.h"
|
||||
#include "llpreviewscript.h"
|
||||
|
||||
#define DARWINPREPROC
|
||||
//force preproc on mac
|
||||
|
||||
struct LLScriptQueueData;
|
||||
|
||||
class FSLSLPreprocessor
|
||||
{
|
||||
LOG_CLASS(FSLSLPreprocessor);
|
||||
public:
|
||||
|
||||
public:
|
||||
FSLSLPreprocessor(LLScriptEdCore* corep)
|
||||
: mCore(corep), mWaving(false), mClose(FALSE), mSync(false), mStandalone(false)
|
||||
{}
|
||||
|
|
@ -55,23 +52,21 @@ public:
|
|||
: mWaving(false), mClose(FALSE), mSync(false), mStandalone(true)
|
||||
{}
|
||||
|
||||
static bool mono_directive(std::string const& text, bool agent_inv = true);
|
||||
static bool mono_directive(std::string_view text, bool agent_inv = true);
|
||||
std::string encode(const std::string& script);
|
||||
std::string decode(const std::string& script);
|
||||
|
||||
std::string lslopt(std::string script);
|
||||
std::string lslcomp(std::string script);
|
||||
|
||||
static LLUUID findInventoryByName(std::string name);
|
||||
static std::optional<LLUUID> findInventoryByName(std::string_view name);
|
||||
static void FSProcCacheCallback(const LLUUID& uuid, LLAssetType::EType type,
|
||||
void *userdata, S32 result, LLExtStat extstat);
|
||||
void preprocess_script(BOOL close = FALSE, bool sync = false, bool defcache = false);
|
||||
void preprocess_script(const LLUUID& asset_id, LLScriptQueueData* data, LLAssetType::EType type, const std::string& script_data);
|
||||
void start_process();
|
||||
void display_message(const std::string& err);
|
||||
void display_error(const std::string& err);
|
||||
|
||||
std::string uncollide_string_literals(std::string script);
|
||||
void display_message(std::string_view msg);
|
||||
void display_error(std::string_view err);
|
||||
|
||||
//dual function, determines if files have been modified this session and if we have cached them
|
||||
//also assetids exposed in-preprocessing as a predefined macro for use in include once style include files, e.g. #define THISFILE file_ ## __ASSETIDRAW__
|
||||
|
|
@ -85,8 +80,6 @@ public:
|
|||
//(it seems rather dumb that readable scripts don't show the asset id without a DL, but thats beside the point.)
|
||||
static std::map<std::string, LLUUID> cached_assetids;
|
||||
|
||||
static std::map<std::string, std::string> decollided_literals;
|
||||
|
||||
std::set<std::string> caching_files;
|
||||
std::set<std::string> defcached_files;
|
||||
bool mDefinitionCaching;
|
||||
|
|
@ -96,7 +89,7 @@ public:
|
|||
BOOL mClose;
|
||||
bool mSync;
|
||||
std::string mMainScriptName;
|
||||
|
||||
|
||||
// Compile queue
|
||||
bool mStandalone;
|
||||
std::string mScript;
|
||||
|
|
|
|||
|
|
@ -85,15 +85,15 @@ LLContextMenu* FSNameListAvatarMenu::createMenu()
|
|||
bool FSNameListAvatarMenu::enableContextMenuItem(const LLSD& userdata)
|
||||
{
|
||||
std::string item = userdata.asString();
|
||||
bool isSelf = mUUIDs.size() > 0 && mUUIDs.front() == gAgentID;
|
||||
bool isSelf = !mUUIDs.empty() && mUUIDs.front() == gAgentID;
|
||||
|
||||
if (item == "remove_friend")
|
||||
{
|
||||
bool result = (mUUIDs.size() > 0);
|
||||
bool result = !mUUIDs.empty();
|
||||
|
||||
for (uuid_vec_t::const_iterator it = mUUIDs.begin(); it != mUUIDs.end(); ++it)
|
||||
for (const auto& avid : mUUIDs)
|
||||
{
|
||||
if (!LLAvatarActions::isFriend(*it))
|
||||
if (!LLAvatarActions::isFriend(avid))
|
||||
{
|
||||
result = false;
|
||||
break;
|
||||
|
|
@ -127,14 +127,14 @@ bool FSNameListAvatarMenu::enableContextMenuItem(const LLSD& userdata)
|
|||
else if (mUUIDs.size() > 1)
|
||||
{
|
||||
// Prevent starting a conference if IMs are blocked for a member
|
||||
for (uuid_vec_t::const_iterator it = mUUIDs.begin(); it != mUUIDs.end(); ++it)
|
||||
for (const auto& avid : mUUIDs)
|
||||
{
|
||||
if ((*it) == gAgentID)
|
||||
if (avid == gAgentID)
|
||||
{
|
||||
continue;
|
||||
}
|
||||
|
||||
if (!RlvActions::canStartIM(*it))
|
||||
if (!RlvActions::canStartIM(avid))
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
|
@ -147,7 +147,7 @@ bool FSNameListAvatarMenu::enableContextMenuItem(const LLSD& userdata)
|
|||
{
|
||||
if (mUUIDs.size() == 1)
|
||||
{
|
||||
return (!isSelf && FSRadar::getInstance()->getEntry(mUUIDs.front()) != NULL);
|
||||
return (!isSelf && FSRadar::getInstance()->getEntry(mUUIDs.front()) != nullptr);
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
|
@ -167,7 +167,7 @@ bool FSNameListAvatarMenu::enableContextMenuItem(const LLSD& userdata)
|
|||
{
|
||||
if (mUUIDs.size() == 1)
|
||||
{
|
||||
return (!isSelf && FSRadar::getInstance()->getEntry(mUUIDs.front()) != NULL);
|
||||
return (!isSelf && FSRadar::getInstance()->getEntry(mUUIDs.front()) != nullptr);
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
|
@ -191,14 +191,14 @@ bool FSNameListAvatarMenu::enableContextMenuItem(const LLSD& userdata)
|
|||
|
||||
void FSNameListAvatarMenu::offerTeleport()
|
||||
{
|
||||
uuid_vec_t uuids;
|
||||
uuid_vec_t uuids{};
|
||||
uuids.reserve(mUUIDs.size());
|
||||
for (uuid_vec_t::const_iterator it = mUUIDs.begin(); it != mUUIDs.end(); ++it)
|
||||
for (const auto& avid : mUUIDs)
|
||||
{
|
||||
// Skip ourself if sending a TP to more than one agent
|
||||
if ((*it) != gAgentID)
|
||||
if (avid != gAgentID)
|
||||
{
|
||||
uuids.push_back(*it);
|
||||
uuids.emplace_back(avid);
|
||||
}
|
||||
}
|
||||
LLAvatarActions::offerTeleport(uuids);
|
||||
|
|
@ -216,14 +216,14 @@ void FSNameListAvatarMenu::onTrackAvatarMenuItemClick()
|
|||
|
||||
void FSNameListAvatarMenu::addToContactSet()
|
||||
{
|
||||
uuid_vec_t uuids;
|
||||
uuid_vec_t uuids{};
|
||||
uuids.reserve(mUUIDs.size());
|
||||
for (uuid_vec_t::const_iterator it = mUUIDs.begin(); it != mUUIDs.end(); ++it)
|
||||
for (const auto& avid : mUUIDs)
|
||||
{
|
||||
// Skip ourself if adding more than one agent
|
||||
if ((*it) != gAgentID)
|
||||
if (avid != gAgentID)
|
||||
{
|
||||
uuids.push_back(*it);
|
||||
uuids.emplace_back(avid);
|
||||
}
|
||||
}
|
||||
LLAvatarActions::addToContactSet(uuids);
|
||||
|
|
|
|||
|
|
@ -78,13 +78,13 @@ static LLPanelInjector<FSPanelRadar> t_fs_panel_radar("fs_panel_radar");
|
|||
|
||||
FSPanelRadar::FSPanelRadar()
|
||||
: LLPanel(),
|
||||
mRadarGearButton(NULL),
|
||||
mOptionsButton(NULL),
|
||||
mMiniMap(NULL),
|
||||
mRadarGearButton(nullptr),
|
||||
mOptionsButton(nullptr),
|
||||
mMiniMap(nullptr),
|
||||
mFilterSubString(LLStringUtil::null),
|
||||
mFilterSubStringOrig(LLStringUtil::null),
|
||||
mRadarList(NULL),
|
||||
mVisibleCheckFunction(NULL),
|
||||
mRadarList(nullptr),
|
||||
mVisibleCheckFunction(),
|
||||
mUpdateSignalConnection(),
|
||||
mFSRadarColumnConfigConnection(),
|
||||
mLastResizeDelta(0)
|
||||
|
|
@ -215,10 +215,9 @@ LLUUID FSPanelRadar::getCurrentItemID() const
|
|||
|
||||
void FSPanelRadar::getCurrentItemIDs(uuid_vec_t& selected_uuids) const
|
||||
{
|
||||
std::vector<LLScrollListItem*> selected_items = mRadarList->getAllSelected();
|
||||
for (std::vector<LLScrollListItem*>::iterator it = selected_items.begin(); it != selected_items.end(); ++it)
|
||||
for (auto selected_item : mRadarList->getAllSelected())
|
||||
{
|
||||
selected_uuids.push_back((*it)->getUUID());
|
||||
selected_uuids.emplace_back(selected_item->getUUID());
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -314,7 +313,7 @@ void FSPanelRadar::requestUpdate()
|
|||
|
||||
void FSPanelRadar::updateList(const std::vector<LLSD>& entries, const LLSD& stats)
|
||||
{
|
||||
if (mVisibleCheckFunction && !mVisibleCheckFunction())
|
||||
if (!mVisibleCheckFunction.empty() && !mVisibleCheckFunction())
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
|
@ -331,11 +330,10 @@ void FSPanelRadar::updateList(const std::vector<LLSD>& entries, const LLSD& stat
|
|||
{
|
||||
last_selected_id = mRadarList->getLastSelectedItem()->getUUID();
|
||||
}
|
||||
std::vector<LLScrollListItem*> selected_items = mRadarList->getAllSelected();
|
||||
uuid_vec_t selected_ids;
|
||||
for (std::vector<LLScrollListItem*>::iterator it = selected_items.begin(); it != selected_items.end(); ++it)
|
||||
for (auto selected_item : mRadarList->getAllSelected())
|
||||
{
|
||||
selected_ids.push_back((*it)->getUUID());
|
||||
selected_ids.emplace_back(selected_item->getUUID());
|
||||
}
|
||||
S32 lastScroll = mRadarList->getScrollPos();
|
||||
|
||||
|
|
@ -346,11 +344,10 @@ void FSPanelRadar::updateList(const std::vector<LLSD>& entries, const LLSD& stat
|
|||
mRadarList->setNeedsSort(false);
|
||||
|
||||
mRadarList->clearRows();
|
||||
const std::vector<LLSD>::const_iterator it_end = entries.end();
|
||||
for (std::vector<LLSD>::const_iterator it = entries.begin(); it != it_end; ++it)
|
||||
for (const auto& avdata : entries)
|
||||
{
|
||||
LLSD entry = (*it)["entry"];
|
||||
LLSD options = (*it)["options"];
|
||||
LLSD entry = avdata["entry"];
|
||||
LLSD options = avdata["options"];
|
||||
|
||||
LLSD row_data;
|
||||
row_data["value"] = entry["id"];
|
||||
|
|
@ -480,7 +477,7 @@ void FSPanelRadar::onColumnDisplayModeChanged()
|
|||
std::vector<LLScrollListColumn::Params> column_params = mRadarList->getColumnInitParams();
|
||||
S32 column_padding = mRadarList->getColumnPadding();
|
||||
|
||||
LLFloater* parent_floater = NULL;
|
||||
LLFloater* parent_floater = nullptr;
|
||||
LLView* parent = getParent();
|
||||
while (parent)
|
||||
{
|
||||
|
|
@ -508,10 +505,8 @@ void FSPanelRadar::onColumnDisplayModeChanged()
|
|||
mRadarList->clearColumns();
|
||||
mRadarList->updateLayout();
|
||||
|
||||
std::vector<LLScrollListColumn::Params>::iterator param_it;
|
||||
for (param_it = column_params.begin(); param_it != column_params.end(); ++param_it)
|
||||
for (const auto& p : column_params)
|
||||
{
|
||||
LLScrollListColumn::Params p = *param_it;
|
||||
default_width += (p.width.pixel_width.getValue() + column_padding);
|
||||
|
||||
LLScrollListColumn::Params params;
|
||||
|
|
|
|||
|
|
@ -112,10 +112,9 @@ FSRadar::~FSRadar()
|
|||
{
|
||||
delete mRadarListUpdater;
|
||||
|
||||
entry_map_t::iterator em_it_end = mEntryList.end();
|
||||
for (entry_map_t::iterator em_it = mEntryList.begin(); em_it != em_it_end; ++em_it)
|
||||
for (const auto& [av_id, entry] : mEntryList)
|
||||
{
|
||||
delete em_it->second;
|
||||
delete entry;
|
||||
}
|
||||
|
||||
if (mShowUsernamesCallbackConnection.connected())
|
||||
|
|
@ -134,7 +133,7 @@ FSRadar::~FSRadar()
|
|||
}
|
||||
}
|
||||
|
||||
void FSRadar::radarAlertMsg(const LLUUID& agent_id, const LLAvatarName& av_name, const std::string& postMsg)
|
||||
void FSRadar::radarAlertMsg(const LLUUID& agent_id, const LLAvatarName& av_name, std::string_view postMsg)
|
||||
{
|
||||
// <FS:CR> Milkshake-style radar alerts
|
||||
static LLCachedControl<bool> sFSMilkshakeRadarToasts(gSavedSettings, "FSMilkshakeRadarToasts", false);
|
||||
|
|
@ -144,7 +143,7 @@ void FSRadar::radarAlertMsg(const LLUUID& agent_id, const LLAvatarName& av_name,
|
|||
LLSD payload = agent_id;
|
||||
LLSD args;
|
||||
args["NAME"] = FSRadarEntry::getRadarName(av_name);
|
||||
args["MESSAGE"] = postMsg;
|
||||
args["MESSAGE"] = static_cast<std::string>(postMsg);
|
||||
LLNotificationsUtil::add("RadarAlert",
|
||||
args,
|
||||
payload.with("respond_on_mousedown", TRUE),
|
||||
|
|
@ -250,20 +249,16 @@ void FSRadar::updateRadarList()
|
|||
|
||||
// Determine lists of new added and removed avatars
|
||||
uuid_vec_t current_vec, added_vec, removed_vec;
|
||||
uuid_vec_t::iterator vec_it_end;
|
||||
entry_map_t::iterator em_it_end = mEntryList.end();
|
||||
current_vec.reserve(mEntryList.size());
|
||||
for (entry_map_t::iterator em_it = mEntryList.begin(); em_it != em_it_end; ++em_it)
|
||||
for (const auto& [av_id, entry] : mEntryList)
|
||||
{
|
||||
current_vec.push_back(em_it->first);
|
||||
current_vec.emplace_back(av_id);
|
||||
}
|
||||
LLCommonUtils::computeDifference(avatar_ids, current_vec, added_vec, removed_vec);
|
||||
|
||||
// Remove old avatars from our list
|
||||
vec_it_end = removed_vec.end();
|
||||
for (uuid_vec_t::iterator it = removed_vec.begin(); it != vec_it_end; ++it)
|
||||
for (const auto& avid : removed_vec)
|
||||
{
|
||||
LLUUID avid = *it;
|
||||
entry_map_t::iterator found = mEntryList.find(avid);
|
||||
if (found != mEntryList.end())
|
||||
{
|
||||
|
|
@ -273,10 +268,8 @@ void FSRadar::updateRadarList()
|
|||
}
|
||||
|
||||
// Add new avatars
|
||||
vec_it_end = added_vec.end();
|
||||
for (uuid_vec_t::iterator it = added_vec.begin(); it != vec_it_end; ++it)
|
||||
for (const auto& avid : added_vec)
|
||||
{
|
||||
LLUUID avid = *it;
|
||||
mEntryList[avid] = new FSRadarEntry(avid);
|
||||
}
|
||||
|
||||
|
|
@ -695,11 +688,8 @@ void FSRadar::updateRadarList()
|
|||
//
|
||||
if (RlvActions::canShowNearbyAgents())
|
||||
{
|
||||
radarfields_map_t::iterator rf_it_end = mLastRadarSweep.end();
|
||||
for (radarfields_map_t::iterator i = mLastRadarSweep.begin(); i != rf_it_end; ++i)
|
||||
for (const auto& [prevId, rf] : mLastRadarSweep)
|
||||
{
|
||||
LLUUID prevId = i->first;
|
||||
RadarFields rf = i->second;
|
||||
if ((sFSRadarShowMutedAndDerendered || !rf.lastIgnore) && mEntryList.find(prevId) == mEntryList.end())
|
||||
{
|
||||
if (sRadarReportChatRangeLeave && (rf.lastDistance <= chat_range_say) && rf.lastDistance > AVATAR_UNKNOWN_RANGE)
|
||||
|
|
@ -797,24 +787,22 @@ void FSRadar::updateRadarList()
|
|||
//
|
||||
|
||||
mLastRadarSweep.clear();
|
||||
em_it_end = mEntryList.end();
|
||||
for (entry_map_t::iterator em_it = mEntryList.begin(); em_it != em_it_end; ++em_it)
|
||||
for (const auto& [avid, entry] : mEntryList)
|
||||
{
|
||||
FSRadarEntry* ent = em_it->second;
|
||||
RadarFields rf;
|
||||
rf.lastDistance = ent->mRange;
|
||||
rf.lastIgnore = ent->mIgnore;
|
||||
rf.lastDistance = entry->mRange;
|
||||
rf.lastIgnore = entry->mIgnore;
|
||||
rf.lastRegion = LLUUID::null;
|
||||
if (ent->mGlobalPos != LLVector3d(0.0, 0.0, 0.0))
|
||||
if (entry->mGlobalPos != LLVector3d(0.0, 0.0, 0.0))
|
||||
{
|
||||
LLViewerRegion* lastRegion = world->getRegionFromPosGlobal(ent->mGlobalPos);
|
||||
LLViewerRegion* lastRegion = world->getRegionFromPosGlobal(entry->mGlobalPos);
|
||||
if (lastRegion)
|
||||
{
|
||||
rf.lastRegion = lastRegion->getRegionID();
|
||||
}
|
||||
}
|
||||
|
||||
mLastRadarSweep[ent->mID] = rf;
|
||||
mLastRadarSweep[entry->mID] = rf;
|
||||
}
|
||||
|
||||
//
|
||||
|
|
@ -857,7 +845,7 @@ FSRadarEntry* FSRadar::getEntry(const LLUUID& avatar_id)
|
|||
entry_map_t::iterator found = mEntryList.find(avatar_id);
|
||||
if (found == mEntryList.end())
|
||||
{
|
||||
return NULL;
|
||||
return nullptr;
|
||||
}
|
||||
return found->second;
|
||||
}
|
||||
|
|
@ -1026,7 +1014,7 @@ void FSRadar::updateTracking()
|
|||
}
|
||||
}
|
||||
|
||||
void FSRadar::zoomAvatar(const LLUUID& avatar_id, const std::string& name)
|
||||
void FSRadar::zoomAvatar(const LLUUID& avatar_id, std::string_view name)
|
||||
{
|
||||
if (LLAvatarActions::canZoomIn(avatar_id))
|
||||
{
|
||||
|
|
@ -1035,7 +1023,7 @@ void FSRadar::zoomAvatar(const LLUUID& avatar_id, const std::string& name)
|
|||
else
|
||||
{
|
||||
LLStringUtil::format_map_t args;
|
||||
args["AVATARNAME"] = name.c_str();
|
||||
args["AVATARNAME"] = static_cast<std::string>(name);
|
||||
report_to_nearby_chat(LLTrans::getString("camera_no_focus", args));
|
||||
}
|
||||
}
|
||||
|
|
@ -1060,9 +1048,17 @@ void FSRadar::updateName(const LLUUID& avatar_id)
|
|||
|
||||
void FSRadar::updateAgeAlertCheck()
|
||||
{
|
||||
const entry_map_t::iterator it_end = mEntryList.end();
|
||||
for (entry_map_t::iterator it = mEntryList.begin(); it != it_end; ++it)
|
||||
for (auto& [av_id, entry] : mEntryList)
|
||||
{
|
||||
it->second->checkAge();
|
||||
entry->checkAge();
|
||||
}
|
||||
}
|
||||
|
||||
void FSRadar::updateNotes(const LLUUID& avatar_id, std::string_view notes)
|
||||
{
|
||||
FSRadarEntry* entry = getEntry(avatar_id);
|
||||
if (entry)
|
||||
{
|
||||
entry->setNotes(notes);
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -67,11 +67,12 @@ public:
|
|||
entry_map_t getRadarList() { return mEntryList; }
|
||||
|
||||
void startTracking(const LLUUID& avatar_id);
|
||||
void zoomAvatar(const LLUUID& avatar_id, const std::string& name);
|
||||
void zoomAvatar(const LLUUID& avatar_id, std::string_view name);
|
||||
void teleportToAvatar(const LLUUID& targetAv);
|
||||
void requestRadarChannelAlertSync();
|
||||
void updateNames();
|
||||
void updateName(const LLUUID& avatar_id);
|
||||
void updateNotes(const LLUUID& avatar_id, std::string_view notes);
|
||||
|
||||
static void onRadarNameFmtClicked(const LLSD& userdata);
|
||||
static bool radarNameFmtCheck(const LLSD& userdata);
|
||||
|
|
@ -112,7 +113,7 @@ private:
|
|||
void updateRadarList();
|
||||
void updateTracking();
|
||||
void checkTracking();
|
||||
void radarAlertMsg(const LLUUID& agent_id, const LLAvatarName& av_name, const std::string& postMsg);
|
||||
void radarAlertMsg(const LLUUID& agent_id, const LLAvatarName& av_name, std::string_view postMsg);
|
||||
void updateAgeAlertCheck();
|
||||
|
||||
Updater* mRadarListUpdater;
|
||||
|
|
|
|||
|
|
@ -39,12 +39,12 @@ FSRadarEntry::FSRadarEntry(const LLUUID& avid)
|
|||
mUserName(LLStringUtil::null),
|
||||
mDisplayName(LLStringUtil::null),
|
||||
mRange(0.f),
|
||||
mFirstSeen(time(NULL)),
|
||||
mFirstSeen(time(nullptr)),
|
||||
mGlobalPos(LLVector3d(0.0, 0.0, 0.0)),
|
||||
mRegion(LLUUID::null),
|
||||
mStatus(0),
|
||||
mZOffset(0.f),
|
||||
mLastZOffsetTime(time(NULL)),
|
||||
mLastZOffsetTime(time(nullptr)),
|
||||
mAge(-1),
|
||||
mIsLinden(false),
|
||||
mIgnore(false),
|
||||
|
|
@ -126,8 +126,7 @@ void FSRadarEntry::processProperties(void* data, EAvatarProcessorType type)
|
|||
LLAvatarNotes* avatar_notes = static_cast<LLAvatarNotes*>(data);
|
||||
if (avatar_notes && avatar_notes->agent_id == gAgentID && avatar_notes->target_id == mID && !gRlvHandler.hasBehaviour(RLV_BHVR_SHOWNAMES))
|
||||
{
|
||||
mNotes = avatar_notes->notes;
|
||||
LLStringUtil::trim(mNotes);
|
||||
setNotes(avatar_notes->notes);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -191,3 +190,9 @@ void FSRadarEntry::checkAge()
|
|||
mAgeAlertPerformed = true;
|
||||
}
|
||||
}
|
||||
|
||||
void FSRadarEntry::setNotes(std::string_view notes)
|
||||
{
|
||||
mNotes = notes;
|
||||
LLStringUtil::trim(mNotes);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -63,6 +63,8 @@ public:
|
|||
|
||||
static std::string getRadarName(const LLAvatarName& av_name);
|
||||
|
||||
void setNotes(std::string_view notes);
|
||||
|
||||
private:
|
||||
void updateName();
|
||||
void onAvatarNameCache(const LLUUID& av_id, const LLAvatarName& av_name);
|
||||
|
|
|
|||
|
|
@ -57,7 +57,7 @@ exportMutliArchDRIPath() {
|
|||
|
||||
## Help fontconfig find its default configuration file, otherwise the viewer will stall
|
||||
## with Fontconfig error: Cannot load default config file
|
||||
export FONTCONFIG_PATH=/etc/fonts
|
||||
# export FONTCONFIG_PATH=/etc/fonts
|
||||
|
||||
if [ "`uname -m`" = "x86_64" ]; then
|
||||
echo '64-bit Linux detected.'
|
||||
|
|
|
|||
|
|
@ -96,11 +96,7 @@ void LLAccountingCostManager::accountingCostCoro(std::string url,
|
|||
LLSD dataToPost = LLSD::emptyMap();
|
||||
dataToPost[keystr.c_str()] = objectList;
|
||||
|
||||
LLAccountingCostObserver* observer = observerHandle.get();
|
||||
LLUUID transactionId = observer->getTransactionID();
|
||||
observer = NULL;
|
||||
|
||||
|
||||
LLAccountingCostObserver* observer = NULL;
|
||||
|
||||
LLSD results = httpAdapter->postAndSuspend(httpRequest, url, dataToPost);
|
||||
|
||||
|
|
|
|||
|
|
@ -46,6 +46,7 @@
|
|||
|
||||
- (void)dealloc
|
||||
{
|
||||
[currentInputLanguage release];
|
||||
[super dealloc];
|
||||
}
|
||||
|
||||
|
|
@ -199,17 +200,17 @@
|
|||
|
||||
- (bool) romanScript
|
||||
{
|
||||
// How to add support for new languages with the input window:
|
||||
// Simply append this array with the language code (ja for japanese, ko for korean, zh for chinese, etc.)
|
||||
NSArray *nonRomanScript = [[NSArray alloc] initWithObjects:@"ja", @"ko", @"zh-Hant", @"zh-Hans", nil];
|
||||
bool ret = true;
|
||||
if ([nonRomanScript containsObject:currentInputLanguage])
|
||||
{
|
||||
ret = false;
|
||||
@autoreleasepool {
|
||||
// How to add support for new languages with the input window:
|
||||
// Simply append this array with the language code (ja for japanese, ko for korean, zh for chinese, etc.)
|
||||
NSArray* nonRomanScript = @[@"ja", @"ko", @"zh-Hant", @"zh-Hans"];
|
||||
if ([nonRomanScript containsObject:currentInputLanguage])
|
||||
{
|
||||
return false;
|
||||
}
|
||||
}
|
||||
[nonRomanScript release];
|
||||
|
||||
return ret;
|
||||
return true;
|
||||
}
|
||||
|
||||
#if defined(LL_BUGSPLAT)
|
||||
|
|
|
|||
|
|
@ -4504,7 +4504,7 @@ void LLAppearanceMgr::makeNewOutfitLinks(const std::string& new_folder_name, boo
|
|||
// existence of AIS as an indicator the fix is present. Does
|
||||
// not actually use AIS to create the category.
|
||||
inventory_func_type func = boost::bind(&LLAppearanceMgr::onOutfitFolderCreated,this,_1,show_panel);
|
||||
LLUUID folder_id = gInventory.createNewCategory(
|
||||
gInventory.createNewCategory(
|
||||
parent_id,
|
||||
LLFolderType::FT_OUTFIT,
|
||||
new_folder_name,
|
||||
|
|
|
|||
|
|
@ -150,6 +150,10 @@
|
|||
#include "vlc/libvlc_version.h"
|
||||
#endif // LL_LINUX
|
||||
|
||||
#if LL_DARWIN
|
||||
#include "llwindowmacosx.h"
|
||||
#endif
|
||||
|
||||
// Third party library includes
|
||||
#include <boost/bind.hpp>
|
||||
#include <boost/foreach.hpp>
|
||||
|
|
@ -638,6 +642,7 @@ static void settings_to_globals()
|
|||
LLWorldMapView::setScaleSetting(gSavedSettings.getF32("MapScale"));
|
||||
|
||||
#if LL_DARWIN
|
||||
LLWindowMacOSX::sUseMultGL = gSavedSettings.getBOOL("RenderAppleUseMultGL");
|
||||
gHiDPISupport = gSavedSettings.getBOOL("RenderHiDPI");
|
||||
#endif
|
||||
}
|
||||
|
|
@ -1836,7 +1841,10 @@ bool LLAppViewer::doFrame()
|
|||
{
|
||||
// Sleep if we're not rendering, or the window is minimized.
|
||||
static LLCachedControl<S32> s_background_yield_time(gSavedSettings, "BackgroundYieldTime", 40);
|
||||
S32 milliseconds_to_sleep = llclamp((S32)s_background_yield_time, 0, 1000);
|
||||
// <FS:Ansariel> FIRE-32722: Make sure to idle if actually minimized
|
||||
//S32 milliseconds_to_sleep = llclamp((S32)s_background_yield_time, 0, 1000);
|
||||
S32 milliseconds_to_sleep = llclamp((S32)s_background_yield_time, (gViewerWindow && gViewerWindow->getWindow()->getMinimized()) ? 1 : 0, 1000);
|
||||
// </FS:Ansariel>
|
||||
// don't sleep when BackgroundYieldTime set to 0, since this will still yield to other threads
|
||||
// of equal priority on Windows
|
||||
if (milliseconds_to_sleep > 0)
|
||||
|
|
@ -2025,7 +2033,8 @@ bool LLAppViewer::cleanup()
|
|||
{
|
||||
if (!isSecondInstance())
|
||||
{
|
||||
LLSceneMonitor::instance().dumpToFile(gDirUtilp->getExpandedFilename(LL_PATH_LOGS, "scene_monitor_results.csv"));
|
||||
std::string dump_path = gDirUtilp->getExpandedFilename(LL_PATH_LOGS, "scene_monitor_results.csv");
|
||||
LLSceneMonitor::instance().dumpToFile(dump_path);
|
||||
}
|
||||
LLSceneMonitor::deleteSingleton();
|
||||
}
|
||||
|
|
@ -2931,15 +2940,15 @@ bool LLAppViewer::initConfiguration()
|
|||
if (gDirUtilp->fileExists(settings_file_list))
|
||||
{
|
||||
LL_ERRS() << "Cannot load default configuration file settings_files.xml. "
|
||||
<< "Please reinstall viewer from https://secondlife.com/support/downloads/ "
|
||||
<< "and contact https://support.secondlife.com if issue persists after reinstall."
|
||||
<< "Please reinstall viewer from https://www.firestormviewer.org/choose-your-platform/ "
|
||||
<< "and contact https://www.firestormviewer.org/support if issue persists after reinstall."
|
||||
<< LL_ENDL;
|
||||
}
|
||||
else
|
||||
{
|
||||
LL_ERRS() << "Default configuration file settings_files.xml not found. "
|
||||
<< "Please reinstall viewer from https://secondlife.com/support/downloads/ "
|
||||
<< "and contact https://support.secondlife.com if issue persists after reinstall."
|
||||
<< "Please reinstall viewer from https://www.firestormviewer.org/choose-your-platform/ "
|
||||
<< "and contact https://www.firestormviewer.org/support if issue persists after reinstall."
|
||||
<< LL_ENDL;
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -364,11 +364,10 @@ void LLAvatarRenderInfoAccountant::getRenderInfoFromRegion(LLViewerRegion * regi
|
|||
}
|
||||
}
|
||||
|
||||
// static
|
||||
// Called every frame - send render weight requests to every region
|
||||
void LLAvatarRenderInfoAccountant::idle()
|
||||
{
|
||||
if (mRenderInfoScanTimer.hasExpired())
|
||||
if (mRenderInfoScanTimer.hasExpired() && !LLApp::isExiting())
|
||||
{
|
||||
LL_DEBUGS("AvatarRenderInfo") << "Scanning regions for render info updates"
|
||||
<< LL_ENDL;
|
||||
|
|
|
|||
|
|
@ -43,7 +43,7 @@ class LLBuyCurrencyHTMLHandler :
|
|||
{
|
||||
public:
|
||||
// requests will be throttled from a non-trusted browser
|
||||
LLBuyCurrencyHTMLHandler() : LLCommandHandler( "buycurrencyhtml", UNTRUSTED_ALLOW ) {}
|
||||
LLBuyCurrencyHTMLHandler() : LLCommandHandler( "buycurrencyhtml", UNTRUSTED_THROTTLE) {}
|
||||
|
||||
bool handle(const LLSD& params, const LLSD& query_map, LLMediaCtrl* web)
|
||||
{
|
||||
|
|
|
|||
|
|
@ -723,8 +723,7 @@ void LLAvatarTracker::processChange(LLMessageSystem* msg)
|
|||
{
|
||||
if(mBuddyInfo.find(agent_id) != mBuddyInfo.end())
|
||||
{
|
||||
if (((mBuddyInfo[agent_id]->getRightsGrantedFrom() ^ new_rights) & LLRelationship::GRANT_MODIFY_OBJECTS)
|
||||
&& !gAgent.isDoNotDisturb())
|
||||
if (((mBuddyInfo[agent_id]->getRightsGrantedFrom() ^ new_rights) & LLRelationship::GRANT_MODIFY_OBJECTS))
|
||||
{
|
||||
LLSD args;
|
||||
// <FS:Ansariel> Always show complete name in rights dialogs
|
||||
|
|
@ -803,19 +802,18 @@ void LLAvatarTracker::processNotify(LLMessageSystem* msg, bool online)
|
|||
// we were tracking someone who went offline
|
||||
deleteTrackingData();
|
||||
}
|
||||
// } <FS:Beq/> [FIRE-32324] least invasive change move this brace after the if. LL fix should follow sometime soon
|
||||
//[FIX FIRE-3522 : SJ] Notify Online/Offline to Nearby Chat even if chat_notify isnt true
|
||||
|
||||
// <FS:PP> Attempt to speed up things a little
|
||||
// if(chat_notify||LGGContactSets::getInstance()->notifyForFriend(agent_id)||gSavedSettings.getBOOL("OnlineOfflinetoNearbyChat"))
|
||||
static LLCachedControl<bool> OnlineOfflinetoNearbyChat(gSavedSettings, "OnlineOfflinetoNearbyChat");
|
||||
if(chat_notify || LGGContactSets::getInstance()->notifyForFriend(agent_id) || OnlineOfflinetoNearbyChat)
|
||||
// </FS:PP>
|
||||
{
|
||||
// Look up the name of this agent for the notification
|
||||
LLAvatarNameCache::get(agent_id,boost::bind(&on_avatar_name_cache_notify,_1, _2, online, payload));
|
||||
|
||||
//[FIX FIRE-3522 : SJ] Notify Online/Offline to Nearby Chat even if chat_notify isnt true
|
||||
// <FS:PP> Attempt to speed up things a little
|
||||
// if(chat_notify||LGGContactSets::getInstance()->notifyForFriend(agent_id)||gSavedSettings.getBOOL("OnlineOfflinetoNearbyChat"))
|
||||
static LLCachedControl<bool> OnlineOfflinetoNearbyChat(gSavedSettings, "OnlineOfflinetoNearbyChat");
|
||||
if(chat_notify || LGGContactSets::getInstance()->notifyForFriend(agent_id) || OnlineOfflinetoNearbyChat)
|
||||
// </FS:PP>
|
||||
{
|
||||
// Look up the name of this agent for the notification
|
||||
LLAvatarNameCache::get(agent_id,boost::bind(&on_avatar_name_cache_notify,_1, _2, online, payload));
|
||||
}
|
||||
}
|
||||
} // <FS:Beq/> [FIRE-32324] least invasive change move this brace after the if
|
||||
|
||||
mModifyMask |= LLFriendObserver::ONLINE;
|
||||
instance().notifyObservers();
|
||||
|
|
|
|||
|
|
@ -155,6 +155,18 @@ public:
|
|||
{
|
||||
mAvatarNameCacheConnection.disconnect();
|
||||
}
|
||||
auto menu = mPopupMenuHandleAvatar.get();
|
||||
if (menu)
|
||||
{
|
||||
menu->die();
|
||||
mPopupMenuHandleAvatar.markDead();
|
||||
}
|
||||
menu = mPopupMenuHandleObject.get();
|
||||
if (menu)
|
||||
{
|
||||
menu->die();
|
||||
mPopupMenuHandleObject.markDead();
|
||||
}
|
||||
}
|
||||
|
||||
BOOL handleMouseUp(S32 x, S32 y, MASK mask)
|
||||
|
|
@ -587,36 +599,6 @@ public:
|
|||
|
||||
BOOL postBuild()
|
||||
{
|
||||
LLUICtrl::CommitCallbackRegistry::ScopedRegistrar registrar;
|
||||
LLUICtrl::EnableCallbackRegistry::ScopedRegistrar registrar_enable;
|
||||
|
||||
registrar.add("AvatarIcon.Action", boost::bind(&LLChatHistoryHeader::onAvatarIconContextMenuItemClicked, this, _2));
|
||||
registrar_enable.add("AvatarIcon.Check", boost::bind(&LLChatHistoryHeader::onAvatarIconContextMenuItemChecked, this, _2));
|
||||
registrar_enable.add("AvatarIcon.Enable", boost::bind(&LLChatHistoryHeader::onAvatarIconContextMenuItemEnabled, this, _2));
|
||||
registrar_enable.add("AvatarIcon.Visible", boost::bind(&LLChatHistoryHeader::onAvatarIconContextMenuItemVisible, this, _2));
|
||||
registrar.add("ObjectIcon.Action", boost::bind(&LLChatHistoryHeader::onObjectIconContextMenuItemClicked, this, _2));
|
||||
registrar_enable.add("ObjectIcon.Visible", boost::bind(&LLChatHistoryHeader::onObjectIconContextMenuItemVisible, this, _2));
|
||||
|
||||
LLMenuGL* menu = LLUICtrlFactory::getInstance()->createFromFile<LLMenuGL>("menu_avatar_icon.xml", gMenuHolder, LLViewerMenuHolderGL::child_registry_t::instance());
|
||||
if (menu)
|
||||
{
|
||||
mPopupMenuHandleAvatar = menu->getHandle();
|
||||
}
|
||||
else
|
||||
{
|
||||
LL_WARNS() << " Failed to create menu_avatar_icon.xml" << LL_ENDL;
|
||||
}
|
||||
|
||||
menu = LLUICtrlFactory::getInstance()->createFromFile<LLMenuGL>("menu_object_icon.xml", gMenuHolder, LLViewerMenuHolderGL::child_registry_t::instance());
|
||||
if (menu)
|
||||
{
|
||||
mPopupMenuHandleObject = menu->getHandle();
|
||||
}
|
||||
else
|
||||
{
|
||||
LL_WARNS() << " Failed to create menu_object_icon.xml" << LL_ENDL;
|
||||
}
|
||||
|
||||
setDoubleClickCallback(boost::bind(&LLChatHistoryHeader::showInspector, this));
|
||||
|
||||
setMouseEnterCallback(boost::bind(&LLChatHistoryHeader::showInfoCtrl, this));
|
||||
|
|
@ -937,13 +919,53 @@ protected:
|
|||
void showObjectContextMenu(S32 x,S32 y)
|
||||
{
|
||||
LLMenuGL* menu = (LLMenuGL*)mPopupMenuHandleObject.get();
|
||||
if(menu)
|
||||
if (!menu)
|
||||
{
|
||||
LLUICtrl::CommitCallbackRegistry::ScopedRegistrar registrar;
|
||||
LLUICtrl::EnableCallbackRegistry::ScopedRegistrar registrar_enable;
|
||||
registrar.add("ObjectIcon.Action", boost::bind(&LLChatHistoryHeader::onObjectIconContextMenuItemClicked, this, _2));
|
||||
registrar_enable.add("ObjectIcon.Visible", boost::bind(&LLChatHistoryHeader::onObjectIconContextMenuItemVisible, this, _2));
|
||||
|
||||
menu = LLUICtrlFactory::getInstance()->createFromFile<LLMenuGL>("menu_object_icon.xml", gMenuHolder, LLViewerMenuHolderGL::child_registry_t::instance());
|
||||
if (menu)
|
||||
{
|
||||
mPopupMenuHandleObject = menu->getHandle();
|
||||
menu->updateParent(LLMenuGL::sMenuContainer);
|
||||
LLMenuGL::showPopup(this, menu, x, y);
|
||||
}
|
||||
else
|
||||
{
|
||||
LL_WARNS() << " Failed to create menu_object_icon.xml" << LL_ENDL;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
LLMenuGL::showPopup(this, menu, x, y);
|
||||
}
|
||||
}
|
||||
|
||||
void showAvatarContextMenu(S32 x,S32 y)
|
||||
{
|
||||
LLMenuGL* menu = (LLMenuGL*)mPopupMenuHandleAvatar.get();
|
||||
if (!menu)
|
||||
{
|
||||
LLUICtrl::CommitCallbackRegistry::ScopedRegistrar registrar;
|
||||
LLUICtrl::EnableCallbackRegistry::ScopedRegistrar registrar_enable;
|
||||
registrar.add("AvatarIcon.Action", boost::bind(&LLChatHistoryHeader::onAvatarIconContextMenuItemClicked, this, _2));
|
||||
registrar_enable.add("AvatarIcon.Check", boost::bind(&LLChatHistoryHeader::onAvatarIconContextMenuItemChecked, this, _2));
|
||||
registrar_enable.add("AvatarIcon.Enable", boost::bind(&LLChatHistoryHeader::onAvatarIconContextMenuItemEnabled, this, _2));
|
||||
registrar_enable.add("AvatarIcon.Visible", boost::bind(&LLChatHistoryHeader::onAvatarIconContextMenuItemVisible, this, _2));
|
||||
|
||||
menu = LLUICtrlFactory::getInstance()->createFromFile<LLMenuGL>("menu_avatar_icon.xml", gMenuHolder, LLViewerMenuHolderGL::child_registry_t::instance());
|
||||
if (menu)
|
||||
{
|
||||
mPopupMenuHandleAvatar = menu->getHandle();
|
||||
}
|
||||
else
|
||||
{
|
||||
LL_WARNS() << " Failed to create menu_avatar_icon.xml" << LL_ENDL;
|
||||
}
|
||||
}
|
||||
|
||||
if(menu)
|
||||
{
|
||||
|
|
@ -1142,10 +1164,7 @@ LLChatHistory::LLChatHistory(const LLChatHistory::Params& p)
|
|||
|
||||
LLSD LLChatHistory::getValue() const
|
||||
{
|
||||
LLSD* text=new LLSD();
|
||||
text->assign(mEditor->getText());
|
||||
return *text;
|
||||
|
||||
return LLSD(mEditor->getText());
|
||||
}
|
||||
|
||||
LLChatHistory::~LLChatHistory()
|
||||
|
|
|
|||
|
|
@ -98,7 +98,6 @@ LLSysWellChiclet::LLSysWellChiclet(const Params& p)
|
|||
, mMaxDisplayedCount(p.max_displayed_count)
|
||||
, mIsNewMessagesState(false)
|
||||
, mFlashToLitTimer(NULL)
|
||||
, mContextMenu(NULL)
|
||||
{
|
||||
LLButton::Params button_params = p.button;
|
||||
mButton = LLUICtrlFactory::create<LLButton>(button_params);
|
||||
|
|
@ -110,6 +109,12 @@ LLSysWellChiclet::LLSysWellChiclet(const Params& p)
|
|||
LLSysWellChiclet::~LLSysWellChiclet()
|
||||
{
|
||||
mFlashToLitTimer->unset();
|
||||
LLContextMenu* menu = static_cast<LLContextMenu*>(mContextMenuHandle.get());
|
||||
if (menu)
|
||||
{
|
||||
menu->die();
|
||||
mContextMenuHandle.markDead();
|
||||
}
|
||||
}
|
||||
|
||||
void LLSysWellChiclet::setCounter(S32 counter)
|
||||
|
|
@ -176,14 +181,16 @@ void LLSysWellChiclet::updateWidget(bool is_window_empty)
|
|||
// virtual
|
||||
BOOL LLSysWellChiclet::handleRightMouseDown(S32 x, S32 y, MASK mask)
|
||||
{
|
||||
if(!mContextMenu)
|
||||
LLContextMenu* menu_avatar = mContextMenuHandle.get();
|
||||
if(!menu_avatar)
|
||||
{
|
||||
createMenu();
|
||||
menu_avatar = mContextMenuHandle.get();
|
||||
}
|
||||
if (mContextMenu)
|
||||
if (menu_avatar)
|
||||
{
|
||||
mContextMenu->show(x, y);
|
||||
LLMenuGL::showPopup(this, mContextMenu, x, y);
|
||||
menu_avatar->show(x, y);
|
||||
LLMenuGL::showPopup(this, menu_avatar, x, y);
|
||||
}
|
||||
return TRUE;
|
||||
}
|
||||
|
|
@ -207,6 +214,13 @@ LLIMWellChiclet::LLIMWellChiclet(const Params& p)
|
|||
|
||||
LLIMWellChiclet::~LLIMWellChiclet()
|
||||
{
|
||||
LLContextMenu* menu = static_cast<LLContextMenu*>(mContextMenuHandle.get());
|
||||
if (menu)
|
||||
{
|
||||
menu->die();
|
||||
mContextMenuHandle.markDead();
|
||||
}
|
||||
|
||||
LLIMWellWindow* im_well_window = LLIMWellWindow::findInstance();
|
||||
if (im_well_window)
|
||||
{
|
||||
|
|
@ -237,7 +251,7 @@ bool LLIMWellChiclet::enableMenuItem(const LLSD& user_data)
|
|||
|
||||
void LLIMWellChiclet::createMenu()
|
||||
{
|
||||
if(mContextMenu)
|
||||
if(mContextMenuHandle.get())
|
||||
{
|
||||
LL_WARNS() << "Menu already exists" << LL_ENDL;
|
||||
return;
|
||||
|
|
@ -251,10 +265,14 @@ void LLIMWellChiclet::createMenu()
|
|||
enable_registrar.add("IMWellChicletMenu.EnableItem",
|
||||
boost::bind(&LLIMWellChiclet::enableMenuItem, this, _2));
|
||||
|
||||
mContextMenu = LLUICtrlFactory::getInstance()->createFromFile<LLContextMenu>
|
||||
LLContextMenu* menu = LLUICtrlFactory::getInstance()->createFromFile<LLContextMenu>
|
||||
("menu_fs_im_well_button.xml",
|
||||
LLMenuGL::sMenuContainer,
|
||||
LLViewerMenuHolderGL::child_registry_t::instance());
|
||||
if (menu)
|
||||
{
|
||||
mContextMenuHandle = menu->getHandle();
|
||||
}
|
||||
}
|
||||
|
||||
void LLIMWellChiclet::messageCountChanged(const LLSD& session_data)
|
||||
|
|
@ -358,7 +376,7 @@ bool LLNotificationChiclet::enableMenuItem(const LLSD& user_data)
|
|||
|
||||
void LLNotificationChiclet::createMenu()
|
||||
{
|
||||
if(mContextMenu)
|
||||
if(mContextMenuHandle.get())
|
||||
{
|
||||
LL_WARNS() << "Menu already exists" << LL_ENDL;
|
||||
return;
|
||||
|
|
@ -373,10 +391,14 @@ void LLNotificationChiclet::createMenu()
|
|||
boost::bind(&LLNotificationChiclet::enableMenuItem, this, _2));
|
||||
|
||||
llassert(LLMenuGL::sMenuContainer != NULL);
|
||||
mContextMenu = LLUICtrlFactory::getInstance()->createFromFile<LLContextMenu>
|
||||
LLContextMenu* menu = LLUICtrlFactory::getInstance()->createFromFile<LLContextMenu>
|
||||
("menu_notification_well_button.xml",
|
||||
LLMenuGL::sMenuContainer,
|
||||
LLViewerMenuHolderGL::child_registry_t::instance());
|
||||
if (menu)
|
||||
{
|
||||
mContextMenuHandle = menu->getHandle();
|
||||
}
|
||||
}
|
||||
|
||||
/*virtual*/
|
||||
|
|
@ -492,12 +514,21 @@ LLIMChiclet::LLIMChiclet(const LLIMChiclet::Params& p)
|
|||
, mCounterCtrl(NULL)
|
||||
// </FS:Ansariel> [FS communication UI]
|
||||
, mChicletButton(NULL)
|
||||
, mPopupMenu(NULL)
|
||||
{
|
||||
// <FS:Ansariel> [FS communication UI]
|
||||
enableCounterControl(p.enable_counter);
|
||||
}
|
||||
|
||||
LLIMChiclet::~LLIMChiclet()
|
||||
{
|
||||
auto menu = mPopupMenuHandle.get();
|
||||
if (menu)
|
||||
{
|
||||
menu->die();
|
||||
mPopupMenuHandle.markDead();
|
||||
}
|
||||
}
|
||||
|
||||
/* virtual*/
|
||||
BOOL LLIMChiclet::postBuild()
|
||||
{
|
||||
|
|
@ -688,16 +719,18 @@ LLIMChiclet::EType LLIMChiclet::getIMSessionType(const LLUUID& session_id)
|
|||
|
||||
BOOL LLIMChiclet::handleRightMouseDown(S32 x, S32 y, MASK mask)
|
||||
{
|
||||
if(!mPopupMenu)
|
||||
auto menu = static_cast<LLMenuGL*>(mPopupMenuHandle.get());
|
||||
if(!menu)
|
||||
{
|
||||
createPopupMenu();
|
||||
menu = static_cast<LLMenuGL*>(mPopupMenuHandle.get());
|
||||
}
|
||||
|
||||
if (mPopupMenu)
|
||||
if (menu)
|
||||
{
|
||||
updateMenuItems();
|
||||
mPopupMenu->arrangeAndClear();
|
||||
LLMenuGL::showPopup(this, mPopupMenu, x, y);
|
||||
menu->arrangeAndClear();
|
||||
LLMenuGL::showPopup(this, menu, x, y);
|
||||
}
|
||||
|
||||
return TRUE;
|
||||
|
|
@ -705,15 +738,16 @@ BOOL LLIMChiclet::handleRightMouseDown(S32 x, S32 y, MASK mask)
|
|||
|
||||
void LLIMChiclet::hidePopupMenu()
|
||||
{
|
||||
if (mPopupMenu)
|
||||
auto menu = mPopupMenuHandle.get();
|
||||
if (menu)
|
||||
{
|
||||
mPopupMenu->setVisible(FALSE);
|
||||
menu->setVisible(FALSE);
|
||||
}
|
||||
}
|
||||
|
||||
bool LLIMChiclet::canCreateMenu()
|
||||
{
|
||||
if(mPopupMenu)
|
||||
if(mPopupMenuHandle.get())
|
||||
{
|
||||
LL_WARNS() << "Menu already exists" << LL_ENDL;
|
||||
return false;
|
||||
|
|
@ -784,17 +818,17 @@ void LLIMP2PChiclet::setOtherParticipantId(const LLUUID& other_participant_id)
|
|||
|
||||
void LLIMP2PChiclet::updateMenuItems()
|
||||
{
|
||||
if(!mPopupMenu)
|
||||
if(!mPopupMenuHandle.get())
|
||||
return;
|
||||
if(getSessionId().isNull())
|
||||
return;
|
||||
|
||||
FSFloaterIM* open_im_floater = FSFloaterIM::findInstance(getSessionId());
|
||||
bool open_window_exists = open_im_floater && open_im_floater->getVisible();
|
||||
mPopupMenu->getChild<LLUICtrl>("Send IM")->setEnabled(!open_window_exists);
|
||||
mPopupMenuHandle.get()->getChild<LLUICtrl>("Send IM")->setEnabled(!open_window_exists);
|
||||
|
||||
bool is_friend = LLAvatarActions::isFriend(getOtherParticipantId());
|
||||
mPopupMenu->getChild<LLUICtrl>("Add Friend")->setEnabled(!is_friend);
|
||||
mPopupMenuHandle.get()->getChild<LLUICtrl>("Add Friend")->setEnabled(!is_friend);
|
||||
}
|
||||
|
||||
void LLIMP2PChiclet::createPopupMenu()
|
||||
|
|
@ -805,8 +839,12 @@ void LLIMP2PChiclet::createPopupMenu()
|
|||
LLUICtrl::CommitCallbackRegistry::ScopedRegistrar registrar;
|
||||
registrar.add("IMChicletMenu.Action", boost::bind(&LLIMP2PChiclet::onMenuItemClicked, this, _2));
|
||||
|
||||
mPopupMenu = LLUICtrlFactory::getInstance()->createFromFile<LLMenuGL>
|
||||
LLMenuGL* menu = LLUICtrlFactory::getInstance()->createFromFile<LLMenuGL>
|
||||
("menu_fs_imchiclet_p2p.xml", gMenuHolder, LLViewerMenuHolderGL::child_registry_t::instance());
|
||||
if (menu)
|
||||
{
|
||||
mPopupMenuHandle = menu->getHandle();
|
||||
}
|
||||
}
|
||||
|
||||
void LLIMP2PChiclet::onMenuItemClicked(const LLSD& user_data)
|
||||
|
|
@ -925,8 +963,12 @@ void LLAdHocChiclet::createPopupMenu()
|
|||
LLUICtrl::CommitCallbackRegistry::ScopedRegistrar registrar;
|
||||
registrar.add("IMChicletMenu.Action", boost::bind(&LLAdHocChiclet::onMenuItemClicked, this, _2));
|
||||
|
||||
mPopupMenu = LLUICtrlFactory::getInstance()->createFromFile<LLMenuGL>
|
||||
auto menu = LLUICtrlFactory::getInstance()->createFromFile<LLMenuGL>
|
||||
("menu_fs_imchiclet_adhoc.xml", gMenuHolder, LLViewerMenuHolderGL::child_registry_t::instance());
|
||||
if (menu)
|
||||
{
|
||||
mPopupMenuHandle = menu->getHandle();
|
||||
}
|
||||
}
|
||||
|
||||
void LLAdHocChiclet::onMenuItemClicked(const LLSD& user_data)
|
||||
|
|
@ -1060,14 +1102,14 @@ void LLIMGroupChiclet::changed(LLGroupChange gc)
|
|||
|
||||
void LLIMGroupChiclet::updateMenuItems()
|
||||
{
|
||||
if(!mPopupMenu)
|
||||
if(!mPopupMenuHandle.get())
|
||||
return;
|
||||
if(getSessionId().isNull())
|
||||
return;
|
||||
|
||||
FSFloaterIM* open_im_floater = FSFloaterIM::findInstance(getSessionId());
|
||||
bool open_window_exists = open_im_floater && open_im_floater->getVisible();
|
||||
mPopupMenu->getChild<LLUICtrl>("Chat")->setEnabled(!open_window_exists);
|
||||
mPopupMenuHandle.get()->getChild<LLUICtrl>("Chat")->setEnabled(!open_window_exists);
|
||||
}
|
||||
|
||||
void LLIMGroupChiclet::createPopupMenu()
|
||||
|
|
@ -1078,8 +1120,12 @@ void LLIMGroupChiclet::createPopupMenu()
|
|||
LLUICtrl::CommitCallbackRegistry::ScopedRegistrar registrar;
|
||||
registrar.add("IMChicletMenu.Action", boost::bind(&LLIMGroupChiclet::onMenuItemClicked, this, _2));
|
||||
|
||||
mPopupMenu = LLUICtrlFactory::getInstance()->createFromFile<LLMenuGL>
|
||||
auto menu = LLUICtrlFactory::getInstance()->createFromFile<LLMenuGL>
|
||||
("menu_fs_imchiclet_group.xml", gMenuHolder, LLViewerMenuHolderGL::child_registry_t::instance());
|
||||
if (menu)
|
||||
{
|
||||
mPopupMenuHandle = menu->getHandle();
|
||||
}
|
||||
}
|
||||
|
||||
void LLIMGroupChiclet::onMenuItemClicked(const LLSD& user_data)
|
||||
|
|
@ -2010,8 +2056,13 @@ void LLScriptChiclet::createPopupMenu()
|
|||
LLUICtrl::CommitCallbackRegistry::ScopedRegistrar registrar;
|
||||
registrar.add("ScriptChiclet.Action", boost::bind(&LLScriptChiclet::onMenuItemClicked, this, _2));
|
||||
|
||||
mPopupMenu = LLUICtrlFactory::getInstance()->createFromFile<LLMenuGL>
|
||||
LLMenuGL* menu = LLUICtrlFactory::getInstance()->createFromFile<LLMenuGL>
|
||||
("menu_script_chiclet.xml", gMenuHolder, LLViewerMenuHolderGL::child_registry_t::instance());
|
||||
if (menu)
|
||||
{
|
||||
mPopupMenuHandle = menu->getHandle();
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
//////////////////////////////////////////////////////////////////////////
|
||||
|
|
@ -2095,8 +2146,12 @@ void LLInvOfferChiclet::createPopupMenu()
|
|||
LLUICtrl::CommitCallbackRegistry::ScopedRegistrar registrar;
|
||||
registrar.add("InvOfferChiclet.Action", boost::bind(&LLInvOfferChiclet::onMenuItemClicked, this, _2));
|
||||
|
||||
mPopupMenu = LLUICtrlFactory::getInstance()->createFromFile<LLMenuGL>
|
||||
LLMenuGL* menu = LLUICtrlFactory::getInstance()->createFromFile<LLMenuGL>
|
||||
("menu_inv_offer_chiclet.xml", gMenuHolder, LLViewerMenuHolderGL::child_registry_t::instance());
|
||||
if (menu)
|
||||
{
|
||||
mPopupMenuHandle = menu->getHandle();
|
||||
}
|
||||
}
|
||||
|
||||
// EOF
|
||||
|
|
|
|||
|
|
@ -325,7 +325,7 @@ public:
|
|||
{};
|
||||
|
||||
|
||||
virtual ~LLIMChiclet() {};
|
||||
virtual ~LLIMChiclet();
|
||||
|
||||
/**
|
||||
* It is used for default setting up of chicklet:click handler, etc.
|
||||
|
|
@ -456,7 +456,7 @@ protected:
|
|||
|
||||
bool canCreateMenu();
|
||||
|
||||
LLMenuGL* mPopupMenu;
|
||||
LLHandle<LLUICtrl> mPopupMenuHandle;
|
||||
|
||||
bool mShowSpeaker;
|
||||
bool mCounterEnabled;
|
||||
|
|
@ -633,6 +633,8 @@ public:
|
|||
*/
|
||||
/*virtual*/ S32 getCounter() { return mCounterCtrl->getCounter(); }
|
||||
|
||||
/*virtual*/ ~LLIMP2PChiclet() {};
|
||||
|
||||
protected:
|
||||
LLIMP2PChiclet(const Params& p);
|
||||
friend class LLUICtrlFactory;
|
||||
|
|
@ -705,6 +707,8 @@ public:
|
|||
*/
|
||||
/*virtual*/ S32 getCounter() { return mCounterCtrl->getCounter(); }
|
||||
|
||||
/*virtual*/ ~LLAdHocChiclet() {};
|
||||
|
||||
protected:
|
||||
LLAdHocChiclet(const Params& p);
|
||||
friend class LLUICtrlFactory;
|
||||
|
|
@ -884,7 +888,7 @@ protected:
|
|||
bool mIsNewMessagesState;
|
||||
|
||||
LLFlashTimer* mFlashToLitTimer;
|
||||
LLContextMenu* mContextMenu;
|
||||
LLHandle<LLContextMenu> mContextMenuHandle;
|
||||
};
|
||||
|
||||
class LLNotificationChiclet : public LLSysWellChiclet
|
||||
|
|
|
|||
|
|
@ -39,6 +39,7 @@
|
|||
#define THROTTLE_PERIOD 5 // required seconds between throttled commands
|
||||
|
||||
static LLCommandDispatcherListener sCommandDispatcherListener;
|
||||
const std::string LLCommandHandler::NAV_TYPE_CLICKED = "clicked";
|
||||
|
||||
//---------------------------------------------------------------------------
|
||||
// Underlying registry for command handlers, not directly accessible.
|
||||
|
|
@ -64,6 +65,9 @@ public:
|
|||
bool trusted_browser);
|
||||
|
||||
private:
|
||||
void notifySlurlBlocked();
|
||||
void notifySlurlThrottled();
|
||||
|
||||
friend LLSD LLCommandDispatcher::enumerate();
|
||||
std::map<std::string, LLCommandHandlerInfo> mMap;
|
||||
};
|
||||
|
|
@ -96,8 +100,6 @@ bool LLCommandHandlerRegistry::dispatch(const std::string& cmd,
|
|||
const std::string& nav_type,
|
||||
bool trusted_browser)
|
||||
{
|
||||
static bool slurl_blocked = false;
|
||||
static bool slurl_throttled = false;
|
||||
static F64 last_throttle_time = 0.0;
|
||||
F64 cur_time = 0.0;
|
||||
std::map<std::string, LLCommandHandlerInfo>::iterator it = mMap.find(cmd);
|
||||
|
|
@ -115,44 +117,45 @@ bool LLCommandHandlerRegistry::dispatch(const std::string& cmd,
|
|||
// block request from external browser, but report as
|
||||
// "handled" because it was well formatted.
|
||||
LL_WARNS_ONCE("SLURL") << "Blocked SLURL command from untrusted browser" << LL_ENDL;
|
||||
if (! slurl_blocked)
|
||||
{
|
||||
if (LLStartUp::getStartupState() >= STATE_BROWSER_INIT)
|
||||
{
|
||||
// Note: commands can arrive before we initialize everything we need for Notification.
|
||||
LLNotificationsUtil::add("BlockedSLURL");
|
||||
}
|
||||
slurl_blocked = true;
|
||||
}
|
||||
notifySlurlBlocked();
|
||||
return true;
|
||||
|
||||
case LLCommandHandler::UNTRUSTED_CLICK_ONLY:
|
||||
if (nav_type == LLCommandHandler::NAV_TYPE_CLICKED
|
||||
&& info.mHandler->canHandleUntrusted(params, query_map, web, nav_type))
|
||||
{
|
||||
break;
|
||||
}
|
||||
LL_WARNS_ONCE("SLURL") << "Blocked SLURL click-only command " << cmd << " from untrusted browser" << LL_ENDL;
|
||||
notifySlurlBlocked();
|
||||
return true;
|
||||
|
||||
case LLCommandHandler::UNTRUSTED_THROTTLE:
|
||||
// if users actually click on a link, we don't need to throttle it
|
||||
// (throttling mechanism is used to prevent an avalanche of clicks via
|
||||
// javascript
|
||||
if ( nav_type == "clicked" )
|
||||
{
|
||||
break;
|
||||
}
|
||||
//skip initial request from external browser before STATE_BROWSER_INIT
|
||||
if (LLStartUp::getStartupState() == STATE_FIRST)
|
||||
{
|
||||
return true;
|
||||
}
|
||||
if (!info.mHandler->canHandleUntrusted(params, query_map, web, nav_type))
|
||||
{
|
||||
LL_WARNS_ONCE("SLURL") << "Blocked SLURL command from untrusted browser" << LL_ENDL;
|
||||
notifySlurlBlocked();
|
||||
return true;
|
||||
}
|
||||
// if users actually click on a link, we don't need to throttle it
|
||||
// (throttling mechanism is used to prevent an avalanche of clicks via
|
||||
// javascript
|
||||
if (nav_type == LLCommandHandler::NAV_TYPE_CLICKED)
|
||||
{
|
||||
break;
|
||||
}
|
||||
cur_time = LLTimer::getElapsedSeconds();
|
||||
if (cur_time < last_throttle_time + THROTTLE_PERIOD)
|
||||
{
|
||||
// block request from external browser if it happened
|
||||
// within THROTTLE_PERIOD seconds of the last command
|
||||
LL_WARNS_ONCE("SLURL") << "Throttled SLURL command from untrusted browser" << LL_ENDL;
|
||||
if (! slurl_throttled)
|
||||
{
|
||||
if (LLStartUp::getStartupState() >= STATE_BROWSER_INIT)
|
||||
{
|
||||
LLNotificationsUtil::add("ThrottledSLURL");
|
||||
}
|
||||
slurl_throttled = true;
|
||||
}
|
||||
notifySlurlThrottled();
|
||||
return true;
|
||||
}
|
||||
last_throttle_time = cur_time;
|
||||
|
|
@ -163,6 +166,34 @@ bool LLCommandHandlerRegistry::dispatch(const std::string& cmd,
|
|||
return info.mHandler->handle(params, query_map, web);
|
||||
}
|
||||
|
||||
void LLCommandHandlerRegistry::notifySlurlBlocked()
|
||||
{
|
||||
static bool slurl_blocked = false;
|
||||
if (!slurl_blocked)
|
||||
{
|
||||
if (LLStartUp::getStartupState() >= STATE_BROWSER_INIT)
|
||||
{
|
||||
// Note: commands can arrive before we initialize everything we need for Notification.
|
||||
LLNotificationsUtil::add("BlockedSLURL");
|
||||
}
|
||||
slurl_blocked = true;
|
||||
}
|
||||
}
|
||||
|
||||
void LLCommandHandlerRegistry::notifySlurlThrottled()
|
||||
{
|
||||
static bool slurl_throttled = false;
|
||||
if (!slurl_throttled)
|
||||
{
|
||||
if (LLStartUp::getStartupState() >= STATE_BROWSER_INIT)
|
||||
{
|
||||
// Note: commands can arrive before we initialize everything we need for Notification.
|
||||
LLNotificationsUtil::add("ThrottledSLURL");
|
||||
}
|
||||
slurl_throttled = true;
|
||||
}
|
||||
}
|
||||
|
||||
//---------------------------------------------------------------------------
|
||||
// Automatic registration of commands, runs before main()
|
||||
//---------------------------------------------------------------------------
|
||||
|
|
@ -230,6 +261,7 @@ symbol_info symbols[] =
|
|||
{
|
||||
ent(LLCommandHandler::UNTRUSTED_ALLOW), // allow commands from untrusted browsers
|
||||
ent(LLCommandHandler::UNTRUSTED_BLOCK), // ignore commands from untrusted browsers
|
||||
ent(LLCommandHandler::UNTRUSTED_CLICK_ONLY), // allow untrusted, but only if clicked
|
||||
ent(LLCommandHandler::UNTRUSTED_THROTTLE) // allow untrusted, but only a few per min.
|
||||
};
|
||||
|
||||
|
|
|
|||
|
|
@ -65,9 +65,12 @@ public:
|
|||
{
|
||||
UNTRUSTED_ALLOW, // allow commands from untrusted browsers
|
||||
UNTRUSTED_BLOCK, // ignore commands from untrusted browsers
|
||||
UNTRUSTED_CLICK_ONLY, // allow untrusted, but only if clicked
|
||||
UNTRUSTED_THROTTLE // allow untrusted, but only a few per min.
|
||||
};
|
||||
|
||||
static const std::string NAV_TYPE_CLICKED;
|
||||
|
||||
LLCommandHandler(const char* command, EUntrustedAccess untrusted_access);
|
||||
// Automatically registers object to get called when
|
||||
// command is executed. All commands can be processed
|
||||
|
|
@ -76,6 +79,13 @@ public:
|
|||
|
||||
virtual ~LLCommandHandler();
|
||||
|
||||
virtual bool canHandleUntrusted(
|
||||
const LLSD& params,
|
||||
const LLSD& query_map,
|
||||
LLMediaCtrl* web,
|
||||
const std::string& nav_type)
|
||||
{ return true; }
|
||||
|
||||
virtual bool handle(const LLSD& params,
|
||||
const LLSD& query_map,
|
||||
LLMediaCtrl* web) = 0;
|
||||
|
|
|
|||
|
|
@ -1114,28 +1114,23 @@ void LLFloaterCompileQueue::finishLSLUpload(LLUUID itemId, LLUUID taskId, LLUUID
|
|||
|
||||
// This is the callback after the script has been processed by preproc
|
||||
// static
|
||||
void LLFloaterCompileQueue::scriptPreprocComplete(const LLUUID& asset_id, LLScriptQueueData* data, LLAssetType::EType type, const std::string& script_text)
|
||||
void LLFloaterCompileQueue::scriptPreprocComplete(LLScriptQueueData* data, LLAssetType::EType type, const std::string& script_text)
|
||||
{
|
||||
LL_INFOS() << "LLFloaterCompileQueue::scriptPreprocComplete()" << LL_ENDL;
|
||||
if (!data)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
LLFloaterCompileQueue* queue = LLFloaterReg::findTypedInstance<LLFloaterCompileQueue>("compile_queue", data->mQueueID);
|
||||
|
||||
if (queue)
|
||||
{
|
||||
std::string filename;
|
||||
std::string uuid_str;
|
||||
asset_id.toString(uuid_str);
|
||||
filename = gDirUtilp->getExpandedFilename(LL_PATH_CACHE,uuid_str) + llformat(".%s",LLAssetType::lookup(type));
|
||||
|
||||
const bool is_running = true;
|
||||
constexpr bool is_running{ true };
|
||||
LLViewerObject* object = gObjectList.findObject(data->mTaskId);
|
||||
if (object)
|
||||
{
|
||||
std::string scriptName = data->mItem->getName();
|
||||
std::string url = object->getRegion()->getCapability("UpdateScriptTask");
|
||||
const std::string scriptName = data->mItem->getName();
|
||||
const std::string url = object->getRegion() ? object->getRegion()->getCapability("UpdateScriptTask") : std::string();
|
||||
if (!url.empty())
|
||||
{
|
||||
queue->addProcessingMessage("CompileQueuePreprocessingComplete", LLSD().with("SCRIPT", scriptName));
|
||||
|
|
@ -1166,7 +1161,7 @@ void LLFloaterCompileQueue::scriptPreprocComplete(const LLUUID& asset_id, LLScri
|
|||
}
|
||||
|
||||
// static
|
||||
void LLFloaterCompileQueue::scriptLogMessage(LLScriptQueueData* data, std::string message)
|
||||
void LLFloaterCompileQueue::scriptLogMessage(LLScriptQueueData* data, std::string_view message)
|
||||
{
|
||||
if (!data)
|
||||
{
|
||||
|
|
@ -1175,7 +1170,7 @@ void LLFloaterCompileQueue::scriptLogMessage(LLScriptQueueData* data, std::strin
|
|||
LLFloaterCompileQueue* queue = LLFloaterReg::findTypedInstance<LLFloaterCompileQueue>("compile_queue", data->mQueueID);
|
||||
if (queue)
|
||||
{
|
||||
queue->addStringMessage(message);
|
||||
queue->addStringMessage(static_cast<std::string>(message));
|
||||
}
|
||||
}
|
||||
// </FS:KC>
|
||||
|
|
|
|||
|
|
@ -150,8 +150,8 @@ public:
|
|||
|
||||
// <FS:KC> [LSL PreProc]
|
||||
static void finishLSLUpload(LLUUID itemId, LLUUID taskId, LLUUID newAssetId, LLSD response, std::string scriptName, LLUUID queueId);
|
||||
static void scriptPreprocComplete(const LLUUID& asset_id, LLScriptQueueData* data, LLAssetType::EType type, const std::string& script_text);
|
||||
static void scriptLogMessage(LLScriptQueueData* data, std::string message);
|
||||
static void scriptPreprocComplete(LLScriptQueueData* data, LLAssetType::EType type, const std::string& script_text);
|
||||
static void scriptLogMessage(LLScriptQueueData* data, std::string_view message);
|
||||
protected:
|
||||
LLFloaterCompileQueue(const LLSD& key);
|
||||
virtual ~LLFloaterCompileQueue();
|
||||
|
|
|
|||
|
|
@ -691,7 +691,6 @@ namespace
|
|||
if (!injection->mBlendIn)
|
||||
mix = 1.0 - mix;
|
||||
stringset_t dummy;
|
||||
LLUUID cloud_noise_id = getCloudNoiseTextureId();
|
||||
F64 value = this->mSettings[injection->mKeyName].asReal();
|
||||
if (this->getCloudNoiseTextureId().isNull())
|
||||
{
|
||||
|
|
@ -3231,7 +3230,7 @@ bool LLEnvironment::loadFromSettings()
|
|||
LL_INFOS("ENVIRONMENT") << "Unable to open previous session environment file " << user_filepath << LL_ENDL;
|
||||
}
|
||||
|
||||
if (!env_data.isMap() || env_data.emptyMap())
|
||||
if (!env_data.isMap() || (env_data.size() == 0))
|
||||
{
|
||||
LL_DEBUGS("ENVIRONMENT") << "Empty map loaded from: " << user_filepath << LL_ENDL;
|
||||
return false;
|
||||
|
|
|
|||
|
|
@ -643,9 +643,9 @@ BOOL LLFilePicker::getSaveFile(ESaveFilter filter, const std::string& filename,
|
|||
|
||||
#elif LL_DARWIN
|
||||
|
||||
std::vector<std::string>* LLFilePicker::navOpenFilterProc(ELoadFilter filter) //(AEDesc *theItem, void *info, void *callBackUD, NavFilterModes filterMode)
|
||||
std::unique_ptr<std::vector<std::string>> LLFilePicker::navOpenFilterProc(ELoadFilter filter) //(AEDesc *theItem, void *info, void *callBackUD, NavFilterModes filterMode)
|
||||
{
|
||||
std::vector<std::string> *allowedv = new std::vector< std::string >;
|
||||
std::unique_ptr<std::vector<std::string>> allowedv(new std::vector< std::string >);
|
||||
switch(filter)
|
||||
{
|
||||
case FFLOAD_ALL:
|
||||
|
|
@ -730,9 +730,9 @@ bool LLFilePicker::doNavChooseDialog(ELoadFilter filter)
|
|||
|
||||
gViewerWindow->getWindow()->beforeDialog();
|
||||
|
||||
std::vector<std::string> *allowed_types=navOpenFilterProc(filter);
|
||||
std::unique_ptr<std::vector<std::string>> allowed_types = navOpenFilterProc(filter);
|
||||
|
||||
std::vector<std::string> *filev = doLoadDialog(allowed_types,
|
||||
std::unique_ptr<std::vector<std::string>> filev = doLoadDialog(allowed_types.get(),
|
||||
mPickOptions);
|
||||
|
||||
gViewerWindow->getWindow()->afterDialog();
|
||||
|
|
@ -873,7 +873,7 @@ bool LLFilePicker::doNavSaveDialog(ESaveFilter filter, const std::string& filena
|
|||
gViewerWindow->getWindow()->beforeDialog();
|
||||
|
||||
// Run the dialog
|
||||
std::string* filev = doSaveDialog(&namestring,
|
||||
std::unique_ptr<std::string> filev = doSaveDialog(&namestring,
|
||||
&type,
|
||||
&creator,
|
||||
&extension,
|
||||
|
|
|
|||
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in New Issue