Merge from viewer-development
commit
01cdeb0cdd
44
.hgtags
44
.hgtags
|
|
@ -1,3 +1,4 @@
|
|||
bb38ff1a763738609e1b3cada6d15fa61e5e84b9 2.1.1-release
|
||||
003dd9461bfa479049afcc34545ab3431b147c7c v2start
|
||||
08398e650c222336bb2b6de0cd3bba944aef11b4 2-1rn1
|
||||
0962101bfa7df0643a6e625786025fe7f8a6dc97 2-1-beta-2
|
||||
|
|
@ -26,3 +27,46 @@ c6e6324f5be1401f077ad18a4a0f6b46451c2f7b last_sprint
|
|||
7076e22f9f43f479a4ea75eac447a36364bead5a beta_2.1.3
|
||||
7076e22f9f43f479a4ea75eac447a36364bead5a 2.2.0-beta1
|
||||
9822eb3e25f7fe0c28ffd8aba45c507caa383cbc 2.2.0-beta2
|
||||
b0cd7e150009809a0b5b0a9d5785cd4bb230413a 2.2.0-beta3
|
||||
00a831292231faad7e44c69f76cb96f175b8dfad 2.2.0-beta4
|
||||
98e0d6df638429fd2f0476667504bd5a6b298def 2.3.0-beta1
|
||||
1415e6538d54fd5d568ee88343424d57c6803c2c 2.2.0-release
|
||||
98e0d6df638429fd2f0476667504bd5a6b298def 2.3.0-start
|
||||
a3c12342b1af0951b8aa3b828aacef17fcea8178 2.3.0-beta1
|
||||
db0fe9bb65187f365e58a717dd23d0f4754a9c1d 2.3.0-beta2
|
||||
6ad3d6fa35a4e320e9ce442fce2bf9c7fc852556 2.3.0-beta3
|
||||
6ad3d6fa35a4e320e9ce442fce2bf9c7fc852556 2.3.0-release
|
||||
dbc206fc61d89ff4cfe15aade0bf0c7bc7fee1c9 2.4.0-start
|
||||
dc6483491b4af559060bccaef8e9045a303212dd 2.4.0-beta1
|
||||
dc6483491b4af559060bccaef8e9045a303212dd 2.4.0-beta1
|
||||
3bc1f50a72e117f4d4ad8d555f0c785ea8cc201e 2.4.0-beta1
|
||||
25bd6007e3d2fc15db9326ed4b18a24a5969a46a 2.4.0-beta2
|
||||
1ed382c6a08ba3850b6ce9061bc551ddece0ea07 2.4.0-release
|
||||
a82e5b1e22c7f90e3c7977d146b80588f004ed0d 2.5.0-start
|
||||
76f586a8e22b1abe6b2339758c8ac0fa718975de 76f586a8e22b
|
||||
76f586a8e22b1abe6b2339758c8ac0fa718975de 76f586a8e22b
|
||||
0000000000000000000000000000000000000000 76f586a8e22b
|
||||
0000000000000000000000000000000000000000 76f586a8e22b
|
||||
345b17e7cf630db77e840b4fe3451bd476d750a3 76f586a8e22b
|
||||
345b17e7cf630db77e840b4fe3451bd476d750a3 2.5.0-beta1
|
||||
345b17e7cf630db77e840b4fe3451bd476d750a3 76f586a8e22b
|
||||
0000000000000000000000000000000000000000 76f586a8e22b
|
||||
54d772d8687c69b1d773f6ce14bbc7bdc9d6c05f 2.5.0-beta2
|
||||
7076e22f9f43f479a4ea75eac447a36364bead5a DRTVWR-5_2.2.0-beta1
|
||||
9822eb3e25f7fe0c28ffd8aba45c507caa383cbc DRTVWR-3_2.2.0-beta2
|
||||
b0cd7e150009809a0b5b0a9d5785cd4bb230413a DRTVWR-7_2.2.0-beta3
|
||||
1415e6538d54fd5d568ee88343424d57c6803c2c DRTVWR-8_2.2.0-release
|
||||
a3c12342b1af0951b8aa3b828aacef17fcea8178 DRTVWR-14_2.3.0-beta1
|
||||
db0fe9bb65187f365e58a717dd23d0f4754a9c1d DRTVWR-17_2.3.0-beta2
|
||||
6ad3d6fa35a4e320e9ce442fce2bf9c7fc852556 DRTVWR-20_2.3.0-beta3
|
||||
6ad3d6fa35a4e320e9ce442fce2bf9c7fc852556 DRTVWR-13_2.3.0-release
|
||||
3bc1f50a72e117f4d4ad8d555f0c785ea8cc201e DRTVWR-26_2.4.0-beta1
|
||||
25bd6007e3d2fc15db9326ed4b18a24a5969a46a DRTVWR-27_2.4.0-beta2
|
||||
1ed382c6a08ba3850b6ce9061bc551ddece0ea07 DRTVWR-25_2.4.0-release
|
||||
345b17e7cf630db77e840b4fe3451bd476d750a3 DRTVWR-32_2.5.0-beta1
|
||||
54d772d8687c69b1d773f6ce14bbc7bdc9d6c05f DRTVWR-33_2.5.0-beta2
|
||||
b723921b5c711bd24dbe77dc76ef488b544dac78 2.5.0-beta3
|
||||
b723921b5c711bd24dbe77dc76ef488b544dac78 DRTVWR-34_2.5.0-beta3
|
||||
b723921b5c711bd24dbe77dc76ef488b544dac78 2.5.0-release
|
||||
b723921b5c711bd24dbe77dc76ef488b544dac78 DRTVWR-31_2.5.0-release
|
||||
92e58e51776a4f8c29069b1a62ff21454d2085f0 2.6.0-start
|
||||
|
|
|
|||
49
BuildParams
49
BuildParams
|
|
@ -14,6 +14,9 @@ public_build = true
|
|||
# Update Public Inworld Build Status Indicators
|
||||
email_status_this_is_os = true
|
||||
|
||||
# Limit extent of codeticket updates to revisions after...
|
||||
codeticket_since = 2.2.0-release
|
||||
|
||||
# ========================================
|
||||
# Viewer Development
|
||||
# ========================================
|
||||
|
|
@ -23,6 +26,7 @@ viewer-development.show_changes_since = last_sprint
|
|||
|
||||
# Build Settings
|
||||
viewer-development_coverity.coverity_product = viewer
|
||||
viewer-development_coverity.run_tests = false
|
||||
viewer-development.build_debug_release_separately = true
|
||||
|
||||
# Notifications - to configure email notices, add a setting like this:
|
||||
|
|
@ -51,6 +55,7 @@ viewer-release.viewer_channel = "Second Life Release"
|
|||
viewer-release.login_channel = "Second Life Release"
|
||||
viewer-release.build_debug_release_separately = true
|
||||
viewer-release.build_viewer_update_version_manager = true
|
||||
viewer-release.release-viewer.jira = DRTVWR-13
|
||||
|
||||
# ========================================
|
||||
# aimee
|
||||
|
|
@ -102,6 +107,26 @@ gooey.login_channel = "Second Life Alpha"
|
|||
gooey.viewer_grid = agni
|
||||
gooey.build_viewer_update_version_manager = false
|
||||
|
||||
# ========================================
|
||||
# Display Names project
|
||||
# ========================================
|
||||
|
||||
#viewer-identity-evolution.email = leyla@lindenlab.com
|
||||
viewer-identity.build_Debug = false
|
||||
viewer-identity.build_RelWithDebInfo = false
|
||||
viewer-identity.build_viewer = true
|
||||
viewer-identity.build_server = false
|
||||
viewer-identity.build_server_tests = false
|
||||
viewer-identity.build_Linux = true
|
||||
viewer-identity.build_hg_bundle = true
|
||||
viewer-identity.bulld_docs = true
|
||||
viewer-identity.viewer_channel = "Second Life Project Viewer"
|
||||
viewer-identity.login_channel = "Second Life Project Viewer"
|
||||
viewer-identity.viewer_grid = aditi
|
||||
viewer-identity.build_viewer_update_version_manager = false
|
||||
|
||||
|
||||
|
||||
# ========================================
|
||||
# palange
|
||||
# ========================================
|
||||
|
|
@ -185,5 +210,29 @@ viewer-tut-teamcity.email = enus@lindenlab.com
|
|||
viewer-tut-teamcity.build_server = false
|
||||
viewer-tut-teamcity.build_server_tests = false
|
||||
|
||||
# ========================================
|
||||
# experience
|
||||
# ========================================
|
||||
viewer-experience.public_build = false
|
||||
viewer-experience.viewer_channel = "Second Life SkyLight Viewer"
|
||||
viewer-experience.login_channel = "Second Life SkyLight Viewer"
|
||||
|
||||
# =================================================================
|
||||
# asset delivery 2010 projects
|
||||
# =================================================================
|
||||
viewer-asset-delivery.viewer_channel = "Second Life Development"
|
||||
viewer-asset-delivery.login_channel = "Second Life Development"
|
||||
viewer-asset-delivery.build_viewer_update_version_manager = false
|
||||
viewer-asset-delivery.email = monty@lindenlab.com
|
||||
viewer-asset-delivery.build_server = false
|
||||
viewer-asset-delivery.build_server_tests = false
|
||||
|
||||
viewer-asset-delivery-metrics.viewer_channel = "Second Life Development"
|
||||
viewer-asset-delivery-metrics.login_channel = "Second Life Development"
|
||||
viewer-asset-delivery-metrics.build_viewer_update_version_manager = false
|
||||
viewer-asset-delivery-metrics.email = monty@lindenlab.com
|
||||
viewer-asset-delivery-metrics.build_server = false
|
||||
viewer-asset-delivery-metrics.build_server_tests = false
|
||||
|
||||
|
||||
# eof
|
||||
|
|
|
|||
28
build.sh
28
build.sh
|
|
@ -59,12 +59,15 @@ pre_build()
|
|||
-t $variant \
|
||||
-G "$cmake_generator" \
|
||||
configure \
|
||||
-DGRID:STRING="$viewer_grid" \
|
||||
-DVIEWER_CHANNEL:STRING="$viewer_channel" \
|
||||
-DVIEWER_LOGIN_CHANNEL:STRING="$login_channel" \
|
||||
-DINSTALL_PROPRIETARY:BOOL=ON \
|
||||
-DRELEASE_CRASH_REPORTING:BOOL=ON \
|
||||
-DLOCALIZESETUP:BOOL=ON \
|
||||
-DPACKAGE:BOOL=ON \
|
||||
-DCMAKE_VERBOSE_MAKEFILE:BOOL=TRUE
|
||||
-DCMAKE_VERBOSE_MAKEFILE:BOOL=TRUE \
|
||||
-DLL_TESTS:BOOL="$run_tests"
|
||||
end_section "Pre$variant"
|
||||
}
|
||||
|
||||
|
|
@ -168,13 +171,7 @@ do
|
|||
mkdir -p "$build_dir"
|
||||
if pre_build "$variant" "$build_dir" >> "$build_log" 2>&1
|
||||
then
|
||||
if $build_link_parallel
|
||||
then
|
||||
begin_section BuildParallel
|
||||
( build "$variant" "$build_dir" > "$build_dir/build.log" 2>&1 ) &
|
||||
build_processes="$build_processes $!"
|
||||
end_section BuildParallel
|
||||
elif $build_coverity
|
||||
if $build_coverity
|
||||
then
|
||||
mkdir -p "$build_dir/cvbuild"
|
||||
coverity_config=`cygpath --windows "$coverity_dir/config/coverity_config.xml"`
|
||||
|
|
@ -196,7 +193,6 @@ do
|
|||
begin_section CovAnalyze\
|
||||
&&\
|
||||
"$coverity_dir"/bin/cov-analyze\
|
||||
--cxx\
|
||||
--security\
|
||||
--concurrency\
|
||||
--dir "$coverity_tmpdir"\
|
||||
|
|
@ -207,14 +203,14 @@ do
|
|||
begin_section CovCommit\
|
||||
&&\
|
||||
"$coverity_dir"/bin/cov-commit-defects\
|
||||
--product "$coverity_product"\
|
||||
--stream "$coverity_product"\
|
||||
--dir "$coverity_tmpdir"\
|
||||
--remote "$coverity_server"\
|
||||
--host "$coverity_server"\
|
||||
--strip-path "$coverity_root"\
|
||||
--target "$branch/$arch"\
|
||||
--version "$revision"\
|
||||
--description "$repo: $variant $revision"\
|
||||
--user admin --password admin\
|
||||
--user admin --password coverity\
|
||||
>> "$build_log" 2>&1\
|
||||
|| record_failure "Coverity Build Failed"
|
||||
# since any step could have failed, rely on the enclosing block to close any pending sub-blocks
|
||||
|
|
@ -225,9 +221,15 @@ do
|
|||
then
|
||||
upload_item log "$build_dir"/cvbuild/build-log.txt text/plain
|
||||
fi
|
||||
elif $build_link_parallel
|
||||
then
|
||||
begin_section BuildParallel
|
||||
( build "$variant" "$build_dir" > "$build_dir/build.log" 2>&1 ) &
|
||||
build_processes="$build_processes $!"
|
||||
end_section BuildParallel
|
||||
else
|
||||
begin_section "Build$variant"
|
||||
build "$variant" "$build_dir" > "$build_log" 2>&1
|
||||
build "$variant" "$build_dir" >> "$build_log" 2>&1
|
||||
begin_section Tests
|
||||
grep --line-buffered "^##teamcity" "$build_log"
|
||||
end_section Tests
|
||||
|
|
|
|||
|
|
@ -61,21 +61,45 @@ Aimee Trescothick
|
|||
Alejandro Rosenthal
|
||||
VWR-1184
|
||||
Aleric Inglewood
|
||||
SNOW-240
|
||||
SNOW-522
|
||||
SNOW-626
|
||||
SNOW-756
|
||||
SNOW-764
|
||||
SNOW-800
|
||||
VWR-10001
|
||||
VWR-10579
|
||||
VWR-10759
|
||||
VWR-10837
|
||||
VWR-12691
|
||||
VWR-12984
|
||||
VWR-13040
|
||||
VWR-13996
|
||||
VWR-14426
|
||||
VWR-24247
|
||||
VWR-24251
|
||||
VWR-24252
|
||||
VWR-24254
|
||||
VWR-24261
|
||||
VWR-24315
|
||||
VWR-24317
|
||||
VWR-24320
|
||||
VWR-24321
|
||||
VWR-24354
|
||||
VWR-24519
|
||||
SNOW-84
|
||||
SNOW-477
|
||||
SNOW-744
|
||||
SNOW-766
|
||||
STORM-163
|
||||
STORM-955
|
||||
STORM-960
|
||||
Ales Beaumont
|
||||
VWR-9352
|
||||
SNOW-240
|
||||
Alexandrea Fride
|
||||
STORM-255
|
||||
STORM-960
|
||||
Alissa Sabre
|
||||
VWR-81
|
||||
VWR-83
|
||||
|
|
@ -124,6 +148,7 @@ Alissa Sabre
|
|||
VWR-12617
|
||||
VWR-12620
|
||||
VWR-12789
|
||||
SNOW-322
|
||||
Angus Boyd
|
||||
VWR-592
|
||||
Ann Congrejo
|
||||
|
|
@ -140,6 +165,7 @@ Asuka Neely
|
|||
Balp Allen
|
||||
VWR-4157
|
||||
Be Holder
|
||||
SNOW-322
|
||||
SNOW-397
|
||||
Benja Kepler
|
||||
VWR-746
|
||||
|
|
@ -170,9 +196,11 @@ Boroondas Gupte
|
|||
SNOW-610
|
||||
SNOW-624
|
||||
SNOW-737
|
||||
STORM-318
|
||||
VWR-233
|
||||
VWR-20583
|
||||
VWR-20891
|
||||
VWR-23455
|
||||
WEB-262
|
||||
Bulli Schumann
|
||||
CT-218
|
||||
|
|
@ -202,6 +230,12 @@ Catherine Pfeffer
|
|||
Celierra Darling
|
||||
VWR-1274
|
||||
VWR-6975
|
||||
Coaldust Numbers
|
||||
VWR-1095
|
||||
Cron Stardust
|
||||
VWR-10579
|
||||
Cypren Christenson
|
||||
STORM-417
|
||||
Dale Glass
|
||||
VWR-120
|
||||
VWR-560
|
||||
|
|
@ -343,7 +377,24 @@ JB Kraft
|
|||
Joghert LeSabre
|
||||
VWR-64
|
||||
Jonathan Yap
|
||||
STORM-435
|
||||
STORM-523
|
||||
STORM-596
|
||||
STORM-615
|
||||
STORM-616
|
||||
STORM-643
|
||||
STORM-679
|
||||
STORM-723
|
||||
STORM-726
|
||||
STORM-737
|
||||
STORM-785
|
||||
STORM-812
|
||||
STORM-829
|
||||
STORM-844
|
||||
STORM-869
|
||||
VWR-17801
|
||||
VWR-24347
|
||||
STORM-975
|
||||
Kage Pixel
|
||||
VWR-11
|
||||
Ken March
|
||||
|
|
@ -357,6 +408,10 @@ Khyota Wulluf
|
|||
VWR-9966
|
||||
Kitty Barnett
|
||||
VWR-19699
|
||||
STORM-288
|
||||
STORM-799
|
||||
STORM-800
|
||||
VWR-24217
|
||||
Kunnis Basiat
|
||||
VWR-82
|
||||
VWR-102
|
||||
|
|
@ -381,6 +436,8 @@ Malwina Dollinger
|
|||
CT-138
|
||||
march Korda
|
||||
SVC-1020
|
||||
Marine Kelley
|
||||
STORM-281
|
||||
Matthew Dowd
|
||||
VWR-1344
|
||||
VWR-1651
|
||||
|
|
@ -402,6 +459,7 @@ McCabe Maxsted
|
|||
VWR-8689
|
||||
VWR-9007
|
||||
Michelle2 Zenovka
|
||||
STORM-477
|
||||
VWR-2652
|
||||
VWR-2662
|
||||
VWR-2834
|
||||
|
|
@ -529,6 +587,7 @@ Pf Shan
|
|||
CT-230
|
||||
CT-231
|
||||
CT-321
|
||||
SNOW-422
|
||||
princess niven
|
||||
VWR-5733
|
||||
CT-85
|
||||
|
|
@ -562,8 +621,11 @@ Robin Cornelius
|
|||
SNOW-585
|
||||
SNOW-599
|
||||
SNOW-747
|
||||
STORM-422
|
||||
STORM-960
|
||||
VWR-2488
|
||||
VWR-9557
|
||||
VWR-10579
|
||||
VWR-11128
|
||||
VWR-12533
|
||||
VWR-12587
|
||||
|
|
@ -585,6 +647,9 @@ Salahzar Stenvaag
|
|||
CT-321
|
||||
Sammy Frederix
|
||||
VWR-6186
|
||||
Satomi Ahn
|
||||
STORM-501
|
||||
STORM-229
|
||||
Scrippy Scofield
|
||||
VWR-3748
|
||||
Seg Baphomet
|
||||
|
|
@ -606,6 +671,8 @@ Sergen Davies
|
|||
CT-321
|
||||
Shawn Kaufmat
|
||||
SNOW-240
|
||||
Siana Gearz
|
||||
STORM-960
|
||||
SignpostMarv Martin
|
||||
VWR-153
|
||||
VWR-154
|
||||
|
|
@ -643,6 +710,7 @@ Strife Onizuka
|
|||
VWR-183
|
||||
VWR-2265
|
||||
VWR-4111
|
||||
SNOW-691
|
||||
Tayra Dagostino
|
||||
SNOW-517
|
||||
SNOW-543
|
||||
|
|
@ -690,11 +758,14 @@ Thickbrick Sleaford
|
|||
VWR-9287
|
||||
VWR-13483
|
||||
VWR-13947
|
||||
VWR-24420
|
||||
Thraxis Epsilon
|
||||
SVC-371
|
||||
VWR-383
|
||||
tiamat bingyi
|
||||
CT-246
|
||||
Tofu Buzzard
|
||||
STORM-546
|
||||
TraductoresAnonimos Alter
|
||||
CT-324
|
||||
Tue Torok
|
||||
|
|
@ -706,6 +777,10 @@ Tue Torok
|
|||
CT-74
|
||||
Twisted Laws
|
||||
SNOW-352
|
||||
STORM-466
|
||||
STORM-467
|
||||
STORM-844
|
||||
STORM-643
|
||||
Vadim Bigbear
|
||||
VWR-2681
|
||||
Vector Hastings
|
||||
|
|
@ -740,6 +815,23 @@ Whoops Babii
|
|||
VWR-8298
|
||||
Wilton Lundquist
|
||||
VWR-7682
|
||||
WolfPup Lowenhar
|
||||
SNOW-622
|
||||
SNOW-772
|
||||
STORM-102
|
||||
STORM-103
|
||||
STORM-143
|
||||
STORM-255
|
||||
STORM-256
|
||||
STORM-288
|
||||
STORM-535
|
||||
STORM-544
|
||||
STORM-654
|
||||
STORM-674
|
||||
STORM-776
|
||||
STORM-825
|
||||
VWR-20741
|
||||
VWR-20933
|
||||
Zai Lynch
|
||||
VWR-19505
|
||||
Zarkonnen Decosta
|
||||
|
|
|
|||
|
|
@ -370,6 +370,14 @@
|
|||
</map>
|
||||
|
||||
<!-- Server to client -->
|
||||
<key>DisplayNameUpdate</key>
|
||||
<map>
|
||||
<key>flavor</key>
|
||||
<string>llsd</string>
|
||||
<key>trusted-sender</key>
|
||||
<boolean>true</boolean>
|
||||
</map>
|
||||
|
||||
<key>ParcelVoiceInfo</key>
|
||||
<map>
|
||||
<key>flavor</key>
|
||||
|
|
@ -426,6 +434,22 @@
|
|||
<boolean>true</boolean>
|
||||
</map>
|
||||
|
||||
<key>SetDisplayNameReply</key>
|
||||
<map>
|
||||
<key>flavor</key>
|
||||
<string>llsd</string>
|
||||
<key>trusted-sender</key>
|
||||
<boolean>true</boolean>
|
||||
</map>
|
||||
|
||||
<key>SimConsoleResponse</key>
|
||||
<map>
|
||||
<key>flavor</key>
|
||||
<string>llsd</string>
|
||||
<key>trusted-sender</key>
|
||||
<boolean>true</boolean>
|
||||
</map>
|
||||
|
||||
<key>DirLandReply</key>
|
||||
<map>
|
||||
<key>flavor</key>
|
||||
|
|
@ -654,20 +678,17 @@
|
|||
<key>EstateChangeInfo</key>
|
||||
<boolean>true</boolean>
|
||||
|
||||
<key>FetchInventoryDescendents</key>
|
||||
<key>FetchInventoryDescendents2</key>
|
||||
<boolean>false</boolean>
|
||||
|
||||
<key>WebFetchInventoryDescendents</key>
|
||||
<boolean>true</boolean>
|
||||
<key>FetchInventory2</key>
|
||||
<boolean>false</boolean>
|
||||
|
||||
<key>FetchInventory</key>
|
||||
<boolean>true</boolean>
|
||||
<key>FetchLibDescendents2</key>
|
||||
<boolean>false</boolean>
|
||||
|
||||
<key>FetchLibDescendents</key>
|
||||
<boolean>true</boolean>
|
||||
|
||||
<key>FetchLib</key>
|
||||
<boolean>true</boolean>
|
||||
<key>FetchLib2</key>
|
||||
<boolean>false</boolean>
|
||||
|
||||
<key>UploadBakedTexture</key>
|
||||
<boolean>true</boolean>
|
||||
|
|
|
|||
|
|
@ -22,7 +22,10 @@ set(CMAKE_MODULE_PATH "${CMAKE_SOURCE_DIR}/cmake")
|
|||
include(Variables)
|
||||
|
||||
if (DARWIN)
|
||||
cmake_minimum_required(VERSION 2.6.2 FATAL_ERROR)
|
||||
# 2.6.4 fixes a Mac bug in get_target_property(... "SLPlugin" LOCATION):
|
||||
# before that version it returns "pathname/SLPlugin", whereas the correct
|
||||
# answer is "pathname/SLPlugin.app/Contents/MacOS/SLPlugin".
|
||||
cmake_minimum_required(VERSION 2.6.4 FATAL_ERROR)
|
||||
endif (DARWIN)
|
||||
|
||||
if (NOT CMAKE_BUILD_TYPE)
|
||||
|
|
@ -40,6 +43,7 @@ add_subdirectory(${LIBS_OPEN_PREFIX}llaudio)
|
|||
add_subdirectory(${LIBS_OPEN_PREFIX}llcharacter)
|
||||
add_subdirectory(${LIBS_OPEN_PREFIX}llcommon)
|
||||
add_subdirectory(${LIBS_OPEN_PREFIX}llimage)
|
||||
add_subdirectory(${LIBS_OPEN_PREFIX}llkdu)
|
||||
add_subdirectory(${LIBS_OPEN_PREFIX}llimagej2coj)
|
||||
add_subdirectory(${LIBS_OPEN_PREFIX}llinventory)
|
||||
add_subdirectory(${LIBS_OPEN_PREFIX}llmath)
|
||||
|
|
@ -50,10 +54,6 @@ add_subdirectory(${LIBS_OPEN_PREFIX}llvfs)
|
|||
add_subdirectory(${LIBS_OPEN_PREFIX}llwindow)
|
||||
add_subdirectory(${LIBS_OPEN_PREFIX}llxml)
|
||||
|
||||
if (EXISTS ${LIBS_CLOSED_DIR}llkdu)
|
||||
add_subdirectory(${LIBS_CLOSED_PREFIX}llkdu)
|
||||
endif (EXISTS ${LIBS_CLOSED_DIR}llkdu)
|
||||
|
||||
add_subdirectory(${LIBS_OPEN_PREFIX}lscript)
|
||||
|
||||
if (WINDOWS AND EXISTS ${LIBS_CLOSED_DIR}copy_win_scripts)
|
||||
|
|
|
|||
|
|
@ -4,27 +4,28 @@
|
|||
|
||||
include(Variables)
|
||||
|
||||
|
||||
# Portable compilation flags.
|
||||
|
||||
if (EXISTS ${CMAKE_SOURCE_DIR}/llphysics)
|
||||
# The release build should only offer to send crash reports if we're
|
||||
# building from a Linden internal source tree.
|
||||
set(release_crash_reports 1)
|
||||
else (EXISTS ${CMAKE_SOURCE_DIR}/llphysics)
|
||||
set(release_crash_reports 0)
|
||||
endif (EXISTS ${CMAKE_SOURCE_DIR}/llphysics)
|
||||
|
||||
set(CMAKE_CXX_FLAGS_DEBUG "-D_DEBUG -DLL_DEBUG=1")
|
||||
set(CMAKE_CXX_FLAGS_RELEASE
|
||||
"-DLL_RELEASE=1 -DLL_RELEASE_FOR_DOWNLOAD=1 -D_SECURE_SCL=0 -DLL_SEND_CRASH_REPORTS=${release_crash_reports} -DNDEBUG")
|
||||
"-DLL_RELEASE=1 -DLL_RELEASE_FOR_DOWNLOAD=1 -D_SECURE_SCL=0 -DNDEBUG")
|
||||
|
||||
set(CMAKE_CXX_FLAGS_RELWITHDEBINFO
|
||||
"-DLL_RELEASE=1 -D_SECURE_SCL=0 -DLL_SEND_CRASH_REPORTS=0 -DNDEBUG -DLL_RELEASE_WITH_DEBUG_INFO=1")
|
||||
"-DLL_RELEASE=1 -D_SECURE_SCL=0 -DNDEBUG -DLL_RELEASE_WITH_DEBUG_INFO=1")
|
||||
|
||||
# Configure crash reporting
|
||||
set(RELEASE_CRASH_REPORTING OFF CACHE BOOL "Enable use of crash reporting in release builds")
|
||||
set(NON_RELEASE_CRASH_REPORTING OFF CACHE BOOL "Enable use of crash reporting in developer builds")
|
||||
|
||||
if(RELEASE_CRASH_REPORTING)
|
||||
set(CMAKE_CXX_FLAGS_RELEASE "${CMAKE_CXX_FLAGS_RELEASE} -DLL_SEND_CRASH_REPORTS=1")
|
||||
endif()
|
||||
|
||||
if(NON_RELEASE_CRASH_REPORTING)
|
||||
set(CMAKE_CXX_FLAGS_RELWITHDEBINFO "${CMAKE_CXX_FLAGS_RELWITHDEBINFO} -DLL_SEND_CRASH_REPORTS=1")
|
||||
set(CMAKE_CXX_FLAGS_DEBUG "${CMAKE_CXX_FLAGS_DEBUG} -DLL_SEND_CRASH_REPORTS=1")
|
||||
endif()
|
||||
|
||||
# Don't bother with a MinSizeRel build.
|
||||
|
||||
set(CMAKE_CONFIGURATION_TYPES "RelWithDebInfo;Release;Debug" CACHE STRING
|
||||
"Supported build types." FORCE)
|
||||
|
||||
|
|
@ -38,10 +39,10 @@ if (WINDOWS)
|
|||
set(CMAKE_CXX_FLAGS_DEBUG "${CMAKE_CXX_FLAGS_DEBUG} /Od /Zi /MDd /MP"
|
||||
CACHE STRING "C++ compiler debug options" FORCE)
|
||||
set(CMAKE_CXX_FLAGS_RELWITHDEBINFO
|
||||
"${CMAKE_CXX_FLAGS_RELWITHDEBINFO} /Od /Zi /MD /MP"
|
||||
"${CMAKE_CXX_FLAGS_RELWITHDEBINFO} /Od /Zi /MD /MP /Ob2"
|
||||
CACHE STRING "C++ compiler release-with-debug options" FORCE)
|
||||
set(CMAKE_CXX_FLAGS_RELEASE
|
||||
"${CMAKE_CXX_FLAGS_RELEASE} ${LL_CXX_FLAGS} /O2 /Zi /MD /MP"
|
||||
"${CMAKE_CXX_FLAGS_RELEASE} ${LL_CXX_FLAGS} /O2 /Zi /MD /MP /Ob2"
|
||||
CACHE STRING "C++ compiler release options" FORCE)
|
||||
|
||||
set(CMAKE_CXX_STANDARD_LIBRARIES "")
|
||||
|
|
|
|||
|
|
@ -6,6 +6,11 @@ set(DB_FIND_REQUIRED ON)
|
|||
if (STANDALONE)
|
||||
include(FindBerkeleyDB)
|
||||
else (STANDALONE)
|
||||
set(DB_LIBRARIES db-4.2)
|
||||
if (LINUX)
|
||||
# Need to add dependency pthread explicitely to support ld.gold.
|
||||
set(DB_LIBRARIES db-4.2 pthread)
|
||||
else (LINUX)
|
||||
set(DB_LIBRARIES db-4.2)
|
||||
endif (LINUX)
|
||||
set(DB_INCLUDE_DIRS ${LIBS_PREBUILT_DIR}/include)
|
||||
endif (STANDALONE)
|
||||
|
|
|
|||
|
|
@ -26,12 +26,14 @@ set(cmake_SOURCE_FILES
|
|||
FindBerkeleyDB.cmake
|
||||
FindCARes.cmake
|
||||
FindELFIO.cmake
|
||||
FindFMOD.cmake
|
||||
FindGooglePerfTools.cmake
|
||||
FindMono.cmake
|
||||
FindMT.cmake
|
||||
FindMySQL.cmake
|
||||
FindOpenJPEG.cmake
|
||||
FindXmlRpcEpi.cmake
|
||||
FindZLIB.cmake
|
||||
FMOD.cmake
|
||||
FreeType.cmake
|
||||
GStreamer010Plugin.cmake
|
||||
|
|
|
|||
|
|
@ -10,10 +10,10 @@ else (STANDALONE)
|
|||
use_prebuilt_binary(curl)
|
||||
if (WINDOWS)
|
||||
set(CURL_LIBRARIES
|
||||
debug libcurld
|
||||
optimized libcurl)
|
||||
debug libcurld.lib
|
||||
optimized libcurl.lib)
|
||||
else (WINDOWS)
|
||||
set(CURL_LIBRARIES curl)
|
||||
set(CURL_LIBRARIES libcurl.a)
|
||||
endif (WINDOWS)
|
||||
set(CURL_INCLUDE_DIRS ${LIBS_PREBUILT_DIR}/include)
|
||||
endif (STANDALONE)
|
||||
|
|
|
|||
|
|
@ -55,25 +55,10 @@ if(WINDOWS)
|
|||
set(release_files ${release_files} libtcmalloc_minimal.dll)
|
||||
endif(USE_GOOGLE_PERFTOOLS)
|
||||
|
||||
if (FMOD_SDK_DIR)
|
||||
set(fmod_files fmod.dll)
|
||||
endif (FMOD_SDK_DIR)
|
||||
|
||||
#*******************************
|
||||
# LLKDU
|
||||
set(internal_llkdu_path "${CMAKE_SOURCE_DIR}/llkdu")
|
||||
if(NOT EXISTS ${internal_llkdu_path})
|
||||
if (EXISTS "${debug_src_dir}/llkdu.dll")
|
||||
set(debug_llkdu_src "${debug_src_dir}/llkdu.dll")
|
||||
set(debug_llkdu_dst "${SHARED_LIB_STAGING_DIR_DEBUG}/llkdu.dll")
|
||||
endif (EXISTS "${debug_src_dir}/llkdu.dll")
|
||||
|
||||
if (EXISTS "${release_src_dir}/llkdu.dll")
|
||||
set(release_llkdu_src "${release_src_dir}/llkdu.dll")
|
||||
set(release_llkdu_dst "${SHARED_LIB_STAGING_DIR_RELEASE}/llkdu.dll")
|
||||
set(relwithdebinfo_llkdu_dst "${SHARED_LIB_STAGING_DIR_RELWITHDEBINFO}/llkdu.dll")
|
||||
endif (EXISTS "${release_src_dir}/llkdu.dll")
|
||||
endif (NOT EXISTS ${internal_llkdu_path})
|
||||
if (FMOD)
|
||||
set(debug_files ${debug_files} fmod.dll)
|
||||
set(release_files ${release_files} fmod.dll)
|
||||
endif (FMOD)
|
||||
|
||||
#*******************************
|
||||
# Copy MS C runtime dlls, required for packaging.
|
||||
|
|
@ -81,6 +66,7 @@ if(WINDOWS)
|
|||
if (MSVC80)
|
||||
FIND_PATH(debug_msvc8_redist_path msvcr80d.dll
|
||||
PATHS
|
||||
${MSVC_DEBUG_REDIST_PATH}
|
||||
[HKEY_LOCAL_MACHINE\\SOFTWARE\\Microsoft\\VisualStudio\\8.0\\Setup\\VC;ProductDir]/redist/Debug_NonRedist/x86/Microsoft.VC80.DebugCRT
|
||||
NO_DEFAULT_PATH
|
||||
NO_DEFAULT_PATH
|
||||
|
|
@ -105,6 +91,7 @@ if (MSVC80)
|
|||
|
||||
FIND_PATH(release_msvc8_redist_path msvcr80.dll
|
||||
PATHS
|
||||
${MSVC_REDIST_PATH}
|
||||
[HKEY_LOCAL_MACHINE\\SOFTWARE\\Microsoft\\VisualStudio\\8.0\\Setup\\VC;ProductDir]/redist/x86/Microsoft.VC80.CRT
|
||||
NO_DEFAULT_PATH
|
||||
NO_DEFAULT_PATH
|
||||
|
|
@ -173,21 +160,6 @@ elseif(DARWIN)
|
|||
# fmod is statically linked on darwin
|
||||
set(fmod_files "")
|
||||
|
||||
#*******************************
|
||||
# LLKDU
|
||||
set(internal_llkdu_path "${CMAKE_SOURCE_DIR}/llkdu")
|
||||
if(NOT EXISTS ${internal_llkdu_path})
|
||||
if (EXISTS "${debug_src_dir}/libllkdu.dylib")
|
||||
set(debug_llkdu_src "${debug_src_dir}/libllkdu.dylib")
|
||||
set(debug_llkdu_dst "${SHARED_LIB_STAGING_DIR_DEBUG}/libllkdu.dylib")
|
||||
endif (EXISTS "${debug_src_dir}/libllkdu.dylib")
|
||||
|
||||
if (EXISTS "${release_src_dir}/libllkdu.dylib")
|
||||
set(release_llkdu_src "${release_src_dir}/libllkdu.dylib")
|
||||
set(release_llkdu_dst "${SHARED_LIB_STAGING_DIR_RELEASE}/libllkdu.dylib")
|
||||
set(relwithdebinfo_llkdu_dst "${SHARED_LIB_STAGING_DIR_RELWITHDEBINFO}/libllkdu.dylib")
|
||||
endif (EXISTS "${release_src_dir}/libllkdu.dylib")
|
||||
endif (NOT EXISTS ${internal_llkdu_path})
|
||||
elseif(LINUX)
|
||||
# linux is weird, multiple side by side configurations aren't supported
|
||||
# and we don't seem to have any debug shared libs built yet anyways...
|
||||
|
|
@ -237,25 +209,10 @@ elseif(LINUX)
|
|||
libssl.so.0.9.7
|
||||
)
|
||||
|
||||
if (FMOD_SDK_DIR)
|
||||
set(fmod_files "libfmod-3.75.so")
|
||||
endif (FMOD_SDK_DIR)
|
||||
if (FMOD)
|
||||
set(release_files ${release_files} "libfmod-3.75.so")
|
||||
endif (FMOD)
|
||||
|
||||
#*******************************
|
||||
# LLKDU
|
||||
set(internal_llkdu_path "${CMAKE_SOURCE_DIR}/llkdu")
|
||||
if(NOT EXISTS ${internal_llkdu_path})
|
||||
if (EXISTS "${debug_src_dir}/libllkdu.so")
|
||||
set(debug_llkdu_src "${debug_src_dir}/libllkdu.so")
|
||||
set(debug_llkdu_dst "${SHARED_LIB_STAGING_DIR_DEBUG}/libllkdu.so")
|
||||
endif (EXISTS "${debug_src_dir}/libllkdu.so")
|
||||
|
||||
if (EXISTS "${release_src_dir}/libllkdu.so")
|
||||
set(release_llkdu_src "${release_src_dir}/libllkdu.so")
|
||||
set(release_llkdu_dst "${SHARED_LIB_STAGING_DIR_RELEASE}/libllkdu.so")
|
||||
set(relwithdebinfo_llkdu_dst "${SHARED_LIB_STAGING_DIR_RELWITHDEBINFO}/libllkdu.so")
|
||||
endif (EXISTS "${release_src_dir}/libllkdu.so")
|
||||
endif(NOT EXISTS ${internal_llkdu_path})
|
||||
else(WINDOWS)
|
||||
message(STATUS "WARNING: unrecognized platform for staging 3rd party libs, skipping...")
|
||||
set(vivox_src_dir "${CMAKE_SOURCE_DIR}/newview/vivox-runtime/i686-linux")
|
||||
|
|
@ -357,41 +314,6 @@ if (FMOD_SDK_DIR)
|
|||
set(all_targets ${all_targets} ${out_targets})
|
||||
endif (FMOD_SDK_DIR)
|
||||
|
||||
#*******************************
|
||||
# LLKDU
|
||||
set(internal_llkdu_path "${CMAKE_SOURCE_DIR}/llkdu")
|
||||
if(NOT EXISTS ${internal_llkdu_path})
|
||||
if (EXISTS "${debug_llkdu_src}")
|
||||
ADD_CUSTOM_COMMAND(
|
||||
OUTPUT ${debug_llkdu_dst}
|
||||
COMMAND ${CMAKE_COMMAND} -E copy_if_different ${debug_llkdu_src} ${debug_llkdu_dst}
|
||||
DEPENDS ${debug_llkdu_src}
|
||||
COMMENT "Copying llkdu.dll ${SHARED_LIB_STAGING_DIR_DEBUG}"
|
||||
)
|
||||
set(third_party_targets ${third_party_targets} $} ${debug_llkdu_dst})
|
||||
endif (EXISTS "${debug_llkdu_src}")
|
||||
|
||||
if (EXISTS "${release_llkdu_src}")
|
||||
ADD_CUSTOM_COMMAND(
|
||||
OUTPUT ${release_llkdu_dst}
|
||||
COMMAND ${CMAKE_COMMAND} -E copy_if_different ${release_llkdu_src} ${release_llkdu_dst}
|
||||
DEPENDS ${release_llkdu_src}
|
||||
COMMENT "Copying llkdu.dll ${SHARED_LIB_STAGING_DIR_RELEASE}"
|
||||
)
|
||||
set(third_party_targets ${third_party_targets} ${release_llkdu_dst})
|
||||
|
||||
ADD_CUSTOM_COMMAND(
|
||||
OUTPUT ${relwithdebinfo_llkdu_dst}
|
||||
COMMAND ${CMAKE_COMMAND} -E copy_if_different ${release_llkdu_src} ${relwithdebinfo_llkdu_dst}
|
||||
DEPENDS ${release_llkdu_src}
|
||||
COMMENT "Copying llkdu.dll ${SHARED_LIB_STAGING_DIR_RELWITHDEBINFO}"
|
||||
)
|
||||
set(third_party_targets ${third_party_targets} ${relwithdebinfo_llkdu_dst})
|
||||
endif (EXISTS "${release_llkdu_src}")
|
||||
|
||||
endif (NOT EXISTS ${internal_llkdu_path})
|
||||
|
||||
|
||||
if(NOT STANDALONE)
|
||||
add_custom_target(
|
||||
stage_third_party_libs ALL
|
||||
|
|
|
|||
|
|
@ -1,64 +1,26 @@
|
|||
# -*- cmake -*-
|
||||
|
||||
include(Linking)
|
||||
|
||||
if(INSTALL_PROPRIETARY)
|
||||
include(Prebuilt)
|
||||
use_prebuilt_binary(fmod)
|
||||
endif(INSTALL_PROPRIETARY)
|
||||
|
||||
find_library(FMOD_LIBRARY_RELEASE
|
||||
NAMES fmod fmodvc fmod-3.75
|
||||
PATHS
|
||||
${ARCH_PREBUILT_DIRS_RELEASE}
|
||||
)
|
||||
|
||||
find_library(FMOD_LIBRARY_DEBUG
|
||||
NAMES fmod fmodvc fmod-3.75
|
||||
PATHS
|
||||
${ARCH_PREBUILT_DIRS_DEBUG}
|
||||
)
|
||||
|
||||
if (FMOD_LIBRARY_RELEASE AND FMOD_LIBRARY_DEBUG)
|
||||
set(FMOD_LIBRARY
|
||||
debug ${FMOD_LIBRARY_DEBUG}
|
||||
optimized ${FMOD_LIBRARY_RELEASE})
|
||||
elseif (FMOD_LIBRARY_RELEASE)
|
||||
set(FMOD_LIBRARY ${FMOD_LIBRARY_RELEASE})
|
||||
endif (FMOD_LIBRARY_RELEASE AND FMOD_LIBRARY_DEBUG)
|
||||
|
||||
if (NOT FMOD_LIBRARY)
|
||||
set(FMOD_SDK_DIR CACHE PATH "Path to the FMOD SDK.")
|
||||
if (FMOD_SDK_DIR)
|
||||
find_library(FMOD_LIBRARY
|
||||
NAMES fmodvc fmod-3.75 fmod
|
||||
PATHS
|
||||
${FMOD_SDK_DIR}/api/lib
|
||||
${FMOD_SDK_DIR}/api
|
||||
${FMOD_SDK_DIR}/lib
|
||||
${FMOD_SDK_DIR}
|
||||
)
|
||||
endif (FMOD_SDK_DIR)
|
||||
endif (NOT FMOD_LIBRARY)
|
||||
|
||||
find_path(FMOD_INCLUDE_DIR fmod.h
|
||||
${LIBS_PREBUILT_DIR}/include
|
||||
${FMOD_SDK_DIR}/api/inc
|
||||
${FMOD_SDK_DIR}/inc
|
||||
${FMOD_SDK_DIR}
|
||||
)
|
||||
|
||||
if (FMOD_LIBRARY AND FMOD_INCLUDE_DIR)
|
||||
set(FMOD ON CACHE BOOL "Use closed source FMOD sound library.")
|
||||
else (FMOD_LIBRARY AND FMOD_INCLUDE_DIR)
|
||||
set(FMOD_LIBRARY "")
|
||||
set(FMOD_INCLUDE_DIR "")
|
||||
if (FMOD)
|
||||
message(STATUS "No support for FMOD audio (need to set FMOD_SDK_DIR?)")
|
||||
endif (FMOD)
|
||||
set(FMOD OFF CACHE BOOL "Use closed source FMOD sound library.")
|
||||
endif (FMOD_LIBRARY AND FMOD_INCLUDE_DIR)
|
||||
set(FMOD ON CACHE BOOL "Use FMOD sound library.")
|
||||
|
||||
if (FMOD)
|
||||
message(STATUS "Building with FMOD audio support")
|
||||
if (STANDALONE)
|
||||
set(FMOD_FIND_REQUIRED ON)
|
||||
include(FindFMOD)
|
||||
else (STANDALONE)
|
||||
if (INSTALL_PROPRIETARY)
|
||||
include(Prebuilt)
|
||||
use_prebuilt_binary(fmod)
|
||||
endif (INSTALL_PROPRIETARY)
|
||||
|
||||
if (WINDOWS)
|
||||
set(FMOD_LIBRARY fmod)
|
||||
elseif (DARWIN)
|
||||
set(FMOD_LIBRARY fmod)
|
||||
elseif (LINUX)
|
||||
set(FMOD_LIBRARY fmod-3.75)
|
||||
endif (WINDOWS)
|
||||
|
||||
SET(FMOD_LIBRARIES ${FMOD_LIBRARY})
|
||||
set(FMOD_INCLUDE_DIR ${LIBS_PREBUILT_DIR}/include)
|
||||
endif (STANDALONE)
|
||||
endif (FMOD)
|
||||
|
|
|
|||
|
|
@ -0,0 +1,44 @@
|
|||
# -*- cmake -*-
|
||||
|
||||
# - Find FMOD
|
||||
# Find the FMOD includes and library
|
||||
# This module defines
|
||||
# FMOD_INCLUDE_DIR, where to find fmod.h and fmod_errors.h
|
||||
# FMOD_LIBRARIES, the libraries needed to use FMOD.
|
||||
# FMOD, If false, do not try to use FMOD.
|
||||
# also defined, but not for general use are
|
||||
# FMOD_LIBRARY, where to find the FMOD library.
|
||||
|
||||
FIND_PATH(FMOD_INCLUDE_DIR fmod.h PATH_SUFFIXES fmod)
|
||||
|
||||
SET(FMOD_NAMES ${FMOD_NAMES} fmod fmodvc fmod-3.75)
|
||||
FIND_LIBRARY(FMOD_LIBRARY
|
||||
NAMES ${FMOD_NAMES}
|
||||
PATH_SUFFIXES fmod
|
||||
)
|
||||
|
||||
IF (FMOD_LIBRARY AND FMOD_INCLUDE_DIR)
|
||||
SET(FMOD_LIBRARIES ${FMOD_LIBRARY})
|
||||
SET(FMOD_FOUND "YES")
|
||||
ELSE (FMOD_LIBRARY AND FMOD_INCLUDE_DIR)
|
||||
SET(FMOD_FOUND "NO")
|
||||
ENDIF (FMOD_LIBRARY AND FMOD_INCLUDE_DIR)
|
||||
|
||||
IF (FMOD_FOUND)
|
||||
IF (NOT FMOD_FIND_QUIETLY)
|
||||
MESSAGE(STATUS "Found FMOD: ${FMOD_LIBRARIES}")
|
||||
ENDIF (NOT FMOD_FIND_QUIETLY)
|
||||
ELSE (FMOD_FOUND)
|
||||
IF (FMOD_FIND_REQUIRED)
|
||||
MESSAGE(FATAL_ERROR "Could not find FMOD library")
|
||||
ENDIF (FMOD_FIND_REQUIRED)
|
||||
ENDIF (FMOD_FOUND)
|
||||
|
||||
# Deprecated declarations.
|
||||
SET (NATIVE_FMOD_INCLUDE_PATH ${FMOD_INCLUDE_DIR} )
|
||||
GET_FILENAME_COMPONENT (NATIVE_FMOD_LIB_PATH ${FMOD_LIBRARY} PATH)
|
||||
|
||||
MARK_AS_ADVANCED(
|
||||
FMOD_LIBRARY
|
||||
FMOD_INCLUDE_DIR
|
||||
)
|
||||
|
|
@ -21,7 +21,12 @@ EXEC_PROGRAM(${CMAKE_CXX_COMPILER}
|
|||
OUTPUT_STRIP_TRAILING_WHITESPACE
|
||||
)
|
||||
|
||||
# Try to find a library that was compiled with the same compiler version as we currently use.
|
||||
SET(JSONCPP_NAMES ${JSONCPP_NAMES} libjson_linux-gcc-${_gcc_COMPILER_VERSION}_libmt.so)
|
||||
IF (STANDALONE)
|
||||
# On standalone, assume that the system installed library was compiled with the used compiler.
|
||||
SET(JSONCPP_NAMES ${JSONCPP_NAMES} libjson.so)
|
||||
ENDIF (STANDALONE)
|
||||
FIND_LIBRARY(JSONCPP_LIBRARY
|
||||
NAMES ${JSONCPP_NAMES}
|
||||
PATHS /usr/lib /usr/local/lib
|
||||
|
|
|
|||
|
|
@ -0,0 +1,62 @@
|
|||
# -*- cmake -*-
|
||||
|
||||
# - Find llqtwebkit
|
||||
# Find the llqtwebkit includes and library
|
||||
# This module defines
|
||||
# LLQTWEBKIT_INCLUDE_DIR, where to find llqtwebkit.h, etc.
|
||||
# LLQTWEBKIT_LIBRARY, the llqtwebkit library with full path.
|
||||
# LLQTWEBKIT_FOUND, If false, do not try to use llqtwebkit.
|
||||
# also defined, but not for general use are
|
||||
# LLQTWEBKIT_LIBRARIES, the libraries needed to use llqtwebkit.
|
||||
# LLQTWEBKIT_LIBRARY_DIRS, where to find the llqtwebkit library.
|
||||
# LLQTWEBKIT_DEFINITIONS - You should add_definitions(${LLQTWEBKIT_DEFINITIONS})
|
||||
# before compiling code that includes llqtwebkit library files.
|
||||
|
||||
# Try to use pkg-config first.
|
||||
# This allows to have two different libllqtwebkit packages installed:
|
||||
# one for viewer 2.x and one for viewer 1.x.
|
||||
include(FindPkgConfig)
|
||||
if (PKG_CONFIG_FOUND)
|
||||
if (LLQtWebkit_FIND_REQUIRED AND LLQtWebkit_FIND_VERSION)
|
||||
set(_PACKAGE_ARGS libllqtwebkit>=${LLQtWebkit_FIND_VERSION} REQUIRED)
|
||||
else (LLQtWebkit_FIND_REQUIRED AND LLQtWebkit_FIND_VERSION)
|
||||
set(_PACKAGE_ARGS libllqtwebkit)
|
||||
endif (LLQtWebkit_FIND_REQUIRED AND LLQtWebkit_FIND_VERSION)
|
||||
if (NOT "${CMAKE_MAJOR_VERSION}.${CMAKE_MINOR_VERSION}" VERSION_LESS "2.8")
|
||||
# As virtually nobody will have a pkg-config file for this, do this check always quiet.
|
||||
# Unfortunately cmake 2.8 or higher is required for pkg_check_modules to have a 'QUIET'.
|
||||
set(_PACKAGE_ARGS ${_PACKAGE_ARGS} QUIET)
|
||||
endif ()
|
||||
pkg_check_modules(LLQTWEBKIT ${_PACKAGE_ARGS})
|
||||
endif (PKG_CONFIG_FOUND)
|
||||
set(LLQTWEBKIT_DEFINITIONS ${LLQTWEBKIT_CFLAGS_OTHER})
|
||||
|
||||
find_path(LLQTWEBKIT_INCLUDE_DIR llqtwebkit.h NO_SYSTEM_ENVIRONMENT_PATH HINTS ${LLQTWEBKIT_INCLUDE_DIRS})
|
||||
|
||||
find_library(LLQTWEBKIT_LIBRARY NAMES llqtwebkit NO_SYSTEM_ENVIRONMENT_PATH HINTS ${LLQTWEBKIT_LIBRARY_DIRS})
|
||||
|
||||
if (NOT PKG_CONFIG_FOUND OR NOT LLQTWEBKIT_FOUND) # If pkg-config couldn't find it, pretend we don't have pkg-config.
|
||||
set(LLQTWEBKIT_LIBRARIES llqtwebkit)
|
||||
get_filename_component(LLQTWEBKIT_LIBRARY_DIRS ${LLQTWEBKIT_LIBRARY} PATH)
|
||||
endif (NOT PKG_CONFIG_FOUND OR NOT LLQTWEBKIT_FOUND)
|
||||
|
||||
# Handle the QUIETLY and REQUIRED arguments and set LLQTWEBKIT_FOUND
|
||||
# to TRUE if all listed variables are TRUE.
|
||||
include(FindPackageHandleStandardArgs)
|
||||
find_package_handle_standard_args(
|
||||
LLQTWEBKIT
|
||||
DEFAULT_MSG
|
||||
LLQTWEBKIT_LIBRARY
|
||||
LLQTWEBKIT_INCLUDE_DIR
|
||||
LLQTWEBKIT_LIBRARIES
|
||||
LLQTWEBKIT_LIBRARY_DIRS
|
||||
)
|
||||
|
||||
mark_as_advanced(
|
||||
LLQTWEBKIT_LIBRARY
|
||||
LLQTWEBKIT_INCLUDE_DIR
|
||||
LLQTWEBKIT_LIBRARIES
|
||||
LLQTWEBKIT_LIBRARY_DIRS
|
||||
LLQTWEBKIT_DEFINITIONS
|
||||
)
|
||||
|
||||
|
|
@ -0,0 +1,39 @@
|
|||
# -*- cmake -*-
|
||||
|
||||
# - Find NDOF
|
||||
# Find the NDOF includes and library
|
||||
# This module defines
|
||||
# NDOF_INCLUDE_DIR, where to find ndofdev_external.h, etc.
|
||||
# NDOF_LIBRARY, the library needed to use NDOF.
|
||||
# NDOF_FOUND, If false, do not try to use NDOF.
|
||||
|
||||
find_path(NDOF_INCLUDE_DIR ndofdev_external.h
|
||||
PATH_SUFFIXES ndofdev
|
||||
)
|
||||
|
||||
set(NDOF_NAMES ${NDOF_NAMES} ndofdev libndofdev)
|
||||
find_library(NDOF_LIBRARY
|
||||
NAMES ${NDOF_NAMES}
|
||||
)
|
||||
|
||||
if (NDOF_LIBRARY AND NDOF_INCLUDE_DIR)
|
||||
set(NDOF_FOUND "YES")
|
||||
else (NDOF_LIBRARY AND NDOF_INCLUDE_DIR)
|
||||
set(NDOF_FOUND "NO")
|
||||
endif (NDOF_LIBRARY AND NDOF_INCLUDE_DIR)
|
||||
|
||||
|
||||
if (NDOF_FOUND)
|
||||
if (NOT NDOF_FIND_QUIETLY)
|
||||
message(STATUS "Found NDOF: Library in '${NDOF_LIBRARY}' and header in '${NDOF_INCLUDE_DIR}' ")
|
||||
endif (NOT NDOF_FIND_QUIETLY)
|
||||
else (NDOF_FOUND)
|
||||
if (NDOF_FIND_REQUIRED)
|
||||
message(FATAL_ERROR " * * *\nCould not find NDOF library!\nIf you don't need Space Navigator Joystick support you can skip this test by configuring with -DNDOF:BOOL=OFF\n * * *")
|
||||
endif (NDOF_FIND_REQUIRED)
|
||||
endif (NDOF_FOUND)
|
||||
|
||||
mark_as_advanced(
|
||||
NDOF_LIBRARY
|
||||
NDOF_INCLUDE_DIR
|
||||
)
|
||||
|
|
@ -3,12 +3,11 @@
|
|||
# - Find Tut
|
||||
# Find the Tut unit test framework includes and library
|
||||
# This module defines
|
||||
# TUT_INCLUDE_DIR, where to find tut.h, etc.
|
||||
# TUT_INCLUDE_DIR, where to find tut/tut.hpp.
|
||||
# TUT_FOUND, If false, do not try to use Tut.
|
||||
|
||||
find_path(TUT_INCLUDE_DIR tut.h
|
||||
/usr/local/include/
|
||||
/usr/include
|
||||
find_path(TUT_INCLUDE_DIR tut/tut.hpp
|
||||
NO_SYSTEM_ENVIRONMENT_PATH
|
||||
)
|
||||
|
||||
if (TUT_INCLUDE_DIR)
|
||||
|
|
|
|||
|
|
@ -0,0 +1,46 @@
|
|||
# -*- cmake -*-
|
||||
|
||||
# - Find zlib
|
||||
# Find the ZLIB includes and library
|
||||
# This module defines
|
||||
# ZLIB_INCLUDE_DIRS, where to find zlib.h, etc.
|
||||
# ZLIB_LIBRARIES, the libraries needed to use zlib.
|
||||
# ZLIB_FOUND, If false, do not try to use zlib.
|
||||
#
|
||||
# This FindZLIB is about 43 times as fast the one provided with cmake (2.8.x),
|
||||
# because it doesn't look up the version of zlib, resulting in a dramatic
|
||||
# speed up for configure (from 4 minutes 22 seconds to 6 seconds).
|
||||
#
|
||||
# Note: Since this file is only used for standalone, the windows
|
||||
# specific parts were left out.
|
||||
|
||||
FIND_PATH(ZLIB_INCLUDE_DIR zlib.h
|
||||
NO_SYSTEM_ENVIRONMENT_PATH
|
||||
)
|
||||
|
||||
FIND_LIBRARY(ZLIB_LIBRARY z)
|
||||
|
||||
if (ZLIB_LIBRARY AND ZLIB_INCLUDE_DIR)
|
||||
SET(ZLIB_INCLUDE_DIRS ${ZLIB_INCLUDE_DIR})
|
||||
SET(ZLIB_LIBRARIES ${ZLIB_LIBRARY})
|
||||
SET(ZLIB_FOUND "YES")
|
||||
else (ZLIB_LIBRARY AND ZLIB_INCLUDE_DIR)
|
||||
SET(ZLIB_FOUND "NO")
|
||||
endif (ZLIB_LIBRARY AND ZLIB_INCLUDE_DIR)
|
||||
|
||||
if (ZLIB_FOUND)
|
||||
if (NOT ZLIB_FIND_QUIETLY)
|
||||
message(STATUS "Found ZLIB: ${ZLIB_LIBRARIES}")
|
||||
SET(ZLIB_FIND_QUIETLY TRUE)
|
||||
endif (NOT ZLIB_FIND_QUIETLY)
|
||||
else (ZLIB_FOUND)
|
||||
if (ZLIB_FIND_REQUIRED)
|
||||
message(FATAL_ERROR "Could not find ZLIB library")
|
||||
endif (ZLIB_FIND_REQUIRED)
|
||||
endif (ZLIB_FOUND)
|
||||
|
||||
mark_as_advanced(
|
||||
ZLIB_LIBRARY
|
||||
ZLIB_INCLUDE_DIR
|
||||
)
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
|
|
@ -129,7 +129,15 @@ INCLUDE(GoogleMock)
|
|||
ENDIF(LL_TEST_VERBOSE)
|
||||
# Add to project
|
||||
TARGET_LINK_LIBRARIES(PROJECT_${project}_TEST_${name} ${alltest_LIBRARIES} ${alltest_DEP_TARGETS} ${${name}_test_additional_PROJECTS} ${${name}_test_additional_LIBRARIES} )
|
||||
|
||||
# Compile-time Definitions
|
||||
GET_SOURCE_FILE_PROPERTY(${name}_test_additional_CFLAGS ${source} LL_TEST_ADDITIONAL_CFLAGS)
|
||||
IF(NOT ${name}_test_additional_CFLAGS MATCHES NOTFOUND)
|
||||
SET_TARGET_PROPERTIES(PROJECT_${project}_TEST_${name} PROPERTIES COMPILE_FLAGS ${${name}_test_additional_CFLAGS} )
|
||||
IF(LL_TEST_VERBOSE)
|
||||
MESSAGE("LL_ADD_PROJECT_UNIT_TESTS ${name}_test_additional_CFLAGS ${${name}_test_additional_CFLAGS}")
|
||||
ENDIF(LL_TEST_VERBOSE)
|
||||
ENDIF(NOT ${name}_test_additional_CFLAGS MATCHES NOTFOUND)
|
||||
|
||||
#
|
||||
# Setup test targets
|
||||
#
|
||||
|
|
@ -197,6 +205,9 @@ FUNCTION(LL_ADD_INTEGRATION_TEST
|
|||
endif(TEST_DEBUG)
|
||||
ADD_EXECUTABLE(INTEGRATION_TEST_${testname} ${source_files})
|
||||
SET_TARGET_PROPERTIES(INTEGRATION_TEST_${testname} PROPERTIES RUNTIME_OUTPUT_DIRECTORY "${EXE_STAGING_DIR}")
|
||||
if(STANDALONE)
|
||||
SET_TARGET_PROPERTIES(INTEGRATION_TEST_${testname} PROPERTIES COMPILE_FLAGS -I"${TUT_INCLUDE_DIR}")
|
||||
endif(STANDALONE)
|
||||
|
||||
# Add link deps to the executable
|
||||
if(TEST_DEBUG)
|
||||
|
|
|
|||
|
|
@ -13,7 +13,14 @@ set(LLCOMMON_INCLUDE_DIRS
|
|||
${Boost_INCLUDE_DIRS}
|
||||
)
|
||||
|
||||
set(LLCOMMON_LIBRARIES llcommon)
|
||||
if (LINUX)
|
||||
# In order to support using ld.gold on linux, we need to explicitely
|
||||
# specify all libraries that llcommon uses.
|
||||
# llcommon uses `clock_gettime' which is provided by librt on linux.
|
||||
set(LLCOMMON_LIBRARIES llcommon rt)
|
||||
else (LINUX)
|
||||
set(LLCOMMON_LIBRARIES llcommon)
|
||||
endif (LINUX)
|
||||
|
||||
add_definitions(${TCMALLOC_FLAG})
|
||||
|
||||
|
|
|
|||
|
|
@ -1,7 +1,20 @@
|
|||
# -*- cmake -*-
|
||||
include(Prebuilt)
|
||||
|
||||
# USE_KDU can be set when launching cmake or develop.py as an option using the argument -DUSE_KDU:BOOL=ON
|
||||
# When building using proprietary binaries though (i.e. having access to LL private servers), we always build with KDU
|
||||
if (INSTALL_PROPRIETARY AND NOT STANDALONE)
|
||||
use_prebuilt_binary(kdu)
|
||||
set(LLKDU_LIBRARY llkdu)
|
||||
set(USE_KDU ON)
|
||||
endif (INSTALL_PROPRIETARY AND NOT STANDALONE)
|
||||
|
||||
if (USE_KDU)
|
||||
use_prebuilt_binary(kdu)
|
||||
if (WINDOWS)
|
||||
set(KDU_LIBRARY kdu.lib)
|
||||
else (WINDOWS)
|
||||
set(KDU_LIBRARY libkdu.a)
|
||||
endif (WINDOWS)
|
||||
set(KDU_INCLUDE_DIR ${LIBS_PREBUILT_DIR}/include/kdu)
|
||||
set(LLKDU_INCLUDE_DIRS ${LIBS_OPEN_DIR}/llkdu)
|
||||
set(LLKDU_LIBRARIES llkdu)
|
||||
endif (USE_KDU)
|
||||
|
|
|
|||
|
|
@ -5,4 +5,10 @@ set(LLPLUGIN_INCLUDE_DIRS
|
|||
${LIBS_OPEN_DIR}/llplugin
|
||||
)
|
||||
|
||||
set(LLPLUGIN_LIBRARIES llplugin)
|
||||
if (LINUX)
|
||||
# In order to support using ld.gold on linux, we need to explicitely
|
||||
# specify all libraries that llplugin uses.
|
||||
set(LLPLUGIN_LIBRARIES llplugin pthread)
|
||||
else (LINUX)
|
||||
set(LLPLUGIN_LIBRARIES llplugin)
|
||||
endif (LINUX)
|
||||
|
|
|
|||
|
|
@ -1,14 +1,32 @@
|
|||
# -*- cmake -*-
|
||||
include(Prebuilt)
|
||||
|
||||
use_prebuilt_binary(ndofdev)
|
||||
set(NDOF ON CACHE BOOL "Use NDOF space navigator joystick library.")
|
||||
|
||||
if (WINDOWS OR DARWIN OR LINUX)
|
||||
if (NDOF)
|
||||
if (STANDALONE)
|
||||
set(NDOF_FIND_REQUIRED ON)
|
||||
include(FindNDOF)
|
||||
else (STANDALONE)
|
||||
use_prebuilt_binary(ndofdev)
|
||||
|
||||
if (WINDOWS)
|
||||
set(NDOF_LIBRARY libndofdev)
|
||||
elseif (DARWIN OR LINUX)
|
||||
set(NDOF_LIBRARY ndofdev)
|
||||
endif (WINDOWS)
|
||||
|
||||
set(NDOF_INCLUDE_DIR ${ARCH_PREBUILT_DIRS}/include/ndofdev)
|
||||
set(NDOF_FOUND 1)
|
||||
endif (STANDALONE)
|
||||
endif (NDOF)
|
||||
|
||||
if (NDOF_FOUND)
|
||||
add_definitions(-DLIB_NDOF=1)
|
||||
endif (WINDOWS OR DARWIN OR LINUX)
|
||||
include_directories(${NDOF_INCLUDE_DIR})
|
||||
else (NDOF_FOUND)
|
||||
message(STATUS "Building without N-DoF joystick support")
|
||||
set(NDOF_INCLUDE_DIR "")
|
||||
set(NDOF_LIBRARY "")
|
||||
endif (NDOF_FOUND)
|
||||
|
||||
if (WINDOWS)
|
||||
set(NDOF_LIBRARY libndofdev)
|
||||
elseif (DARWIN OR LINUX)
|
||||
set(NDOF_LIBRARY ndofdev)
|
||||
endif (WINDOWS)
|
||||
|
|
|
|||
|
|
@ -1,7 +1,7 @@
|
|||
# -*- cmake -*-
|
||||
include(Prebuilt)
|
||||
|
||||
set(PULSEAUDIO ON CACHE BOOL "Build with PulseAudio support, if available.")
|
||||
set(PULSEAUDIO OFF CACHE BOOL "Build with PulseAudio support, if available.")
|
||||
|
||||
if (PULSEAUDIO)
|
||||
if (STANDALONE)
|
||||
|
|
|
|||
|
|
@ -9,10 +9,12 @@ if (WINDOWS)
|
|||
NAMES python25.exe python23.exe python.exe
|
||||
NO_DEFAULT_PATH # added so that cmake does not find cygwin python
|
||||
PATHS
|
||||
[HKEY_LOCAL_MACHINE\\SOFTWARE\\Python\\PythonCore\\2.7\\InstallPath]
|
||||
[HKEY_LOCAL_MACHINE\\SOFTWARE\\Python\\PythonCore\\2.6\\InstallPath]
|
||||
[HKEY_LOCAL_MACHINE\\SOFTWARE\\Python\\PythonCore\\2.5\\InstallPath]
|
||||
[HKEY_LOCAL_MACHINE\\SOFTWARE\\Python\\PythonCore\\2.4\\InstallPath]
|
||||
[HKEY_LOCAL_MACHINE\\SOFTWARE\\Python\\PythonCore\\2.3\\InstallPath]
|
||||
[HKEY_CURRENT_USER\\SOFTWARE\\Python\\PythonCore\\2.7\\InstallPath]
|
||||
[HKEY_CURRENT_USER\\SOFTWARE\\Python\\PythonCore\\2.6\\InstallPath]
|
||||
[HKEY_CURRENT_USER\\SOFTWARE\\Python\\PythonCore\\2.5\\InstallPath]
|
||||
[HKEY_CURRENT_USER\\SOFTWARE\\Python\\PythonCore\\2.4\\InstallPath]
|
||||
|
|
|
|||
|
|
@ -7,8 +7,9 @@ macro (check_message_template _target)
|
|||
TARGET ${_target}
|
||||
POST_BUILD
|
||||
COMMAND ${PYTHON_EXECUTABLE}
|
||||
ARGS ${SCRIPTS_DIR}/template_verifier.py
|
||||
--mode=development --cache_master
|
||||
COMMENT "Verifying message template"
|
||||
ARGS ${SCRIPTS_DIR}/md5check.py
|
||||
3f19d130400c547de36278a6b6f9b028
|
||||
${SCRIPTS_DIR}/messages/message_template.msg
|
||||
COMMENT "Verifying message template - See http://wiki.secondlife.com/wiki/Template_verifier.py"
|
||||
)
|
||||
endmacro (check_message_template)
|
||||
|
|
|
|||
|
|
@ -6,7 +6,6 @@ set(TUT_FIND_QUIETLY TRUE)
|
|||
|
||||
if (STANDALONE)
|
||||
include(FindTut)
|
||||
include_directories(${TUT_INCLUDE_DIR})
|
||||
else (STANDALONE)
|
||||
use_prebuilt_binary(tut)
|
||||
endif (STANDALONE)
|
||||
|
|
|
|||
|
|
@ -87,7 +87,7 @@ if (${CMAKE_SYSTEM_NAME} MATCHES "Darwin")
|
|||
if (NOT CMAKE_OSX_DEPLOYMENT_TARGET)
|
||||
# NOTE: setting -isysroot is NOT adequate: http://lists.apple.com/archives/Xcode-users/2007/Oct/msg00696.html
|
||||
# see http://public.kitware.com/Bug/view.php?id=9959 + poppy
|
||||
set(CMAKE_OSX_SYSROOT /Developer/SDKs/MacOSX10.4u.sdk)
|
||||
set(CMAKE_OSX_SYSROOT /Developer/SDKs/MacOSX10.5.sdk)
|
||||
set(CMAKE_OSX_DEPLOYMENT_TARGET 10.4)
|
||||
endif (NOT CMAKE_OSX_DEPLOYMENT_TARGET)
|
||||
|
||||
|
|
|
|||
|
|
@ -3,7 +3,7 @@ include(Prebuilt)
|
|||
|
||||
if (NOT STANDALONE)
|
||||
use_prebuilt_binary(libuuid)
|
||||
use_prebuilt_binary(vivox)
|
||||
use_prebuilt_binary(slvoice)
|
||||
use_prebuilt_binary(fontconfig)
|
||||
endif(NOT STANDALONE)
|
||||
|
||||
|
|
|
|||
|
|
@ -3,6 +3,29 @@ include(Linking)
|
|||
include(Prebuilt)
|
||||
|
||||
if (STANDALONE)
|
||||
# The minimal version, 4.4.3, is rather arbitrary: it's the version in Debian/Lenny.
|
||||
find_package(Qt4 4.4.3 COMPONENTS QtCore QtGui QtNetwork QtOpenGL QtWebKit REQUIRED)
|
||||
include(${QT_USE_FILE})
|
||||
set(QTDIR $ENV{QTDIR})
|
||||
if (QTDIR AND NOT "${QT_BINARY_DIR}" STREQUAL "${QTDIR}/bin")
|
||||
message(FATAL_ERROR "\"${QT_BINARY_DIR}\" is unequal \"${QTDIR}/bin\"; "
|
||||
"Qt is found by looking for qmake in your PATH. "
|
||||
"Please set your PATH such that 'qmake' is found in \$QTDIR/bin, "
|
||||
"or unset QTDIR if the found Qt is correct.")
|
||||
endif (QTDIR AND NOT "${QT_BINARY_DIR}" STREQUAL "${QTDIR}/bin")
|
||||
find_package(LLQtWebkit REQUIRED QUIET)
|
||||
# Add the plugins.
|
||||
set(QT_PLUGIN_LIBRARIES)
|
||||
foreach(qlibname qgif qjpeg)
|
||||
find_library(QT_PLUGIN_${qlibname} ${qlibname} PATHS ${QT_PLUGINS_DIR}/imageformats NO_DEFAULT_PATH)
|
||||
if (QT_PLUGIN_${qlibname})
|
||||
list(APPEND QT_PLUGIN_LIBRARIES ${QT_PLUGIN_${qlibname}})
|
||||
else (QT_PLUGIN_${qtlibname})
|
||||
message(FATAL_ERROR "Could not find the Qt plugin ${qlibname} in \"${QT_PLUGINS_DIR}/imageformats\"!")
|
||||
endif (QT_PLUGIN_${qlibname})
|
||||
endforeach(qlibname)
|
||||
# qjpeg depends on libjpeg
|
||||
list(APPEND QT_PLUGIN_LIBRARIES jpeg)
|
||||
set(WEBKITLIBPLUGIN OFF CACHE BOOL
|
||||
"WEBKITLIBPLUGIN support for the llplugin/llmedia test apps.")
|
||||
else (STANDALONE)
|
||||
|
|
@ -35,7 +58,7 @@ elseif (DARWIN)
|
|||
)
|
||||
elseif (LINUX)
|
||||
if (STANDALONE)
|
||||
set(WEBKIT_PLUGIN_LIBRARIES llqtwebkit)
|
||||
set(WEBKIT_PLUGIN_LIBRARIES ${LLQTWEBKIT_LIBRARY} ${QT_LIBRARIES} ${QT_PLUGIN_LIBRARIES})
|
||||
else (STANDALONE)
|
||||
set(WEBKIT_PLUGIN_LIBRARIES
|
||||
llqtwebkit
|
||||
|
|
|
|||
|
|
@ -24,7 +24,7 @@ myprog somearg otherarg
|
|||
|
||||
$LicenseInfo:firstyear=2009&license=viewerlgpl$
|
||||
Second Life Viewer Source Code
|
||||
Copyright (C) 2010, Linden Research, Inc.
|
||||
Copyright (C) 2009-2010, Linden Research, Inc.
|
||||
|
||||
This library is free software; you can redistribute it and/or
|
||||
modify it under the terms of the GNU Lesser General Public
|
||||
|
|
|
|||
|
|
@ -10,6 +10,7 @@ include(00-Common)
|
|||
include(LLCommon)
|
||||
include(LLImage)
|
||||
include(LLImageJ2COJ) # ugh, needed for images
|
||||
include(LLKDU)
|
||||
include(LLMath)
|
||||
include(LLMessage)
|
||||
include(LLRender)
|
||||
|
|
@ -71,6 +72,11 @@ endif (DARWIN)
|
|||
target_link_libraries(llui_libtest
|
||||
llui
|
||||
llmessage
|
||||
${LLRENDER_LIBRARIES}
|
||||
${LLIMAGE_LIBRARIES}
|
||||
${LLKDU_LIBRARIES}
|
||||
${KDU_LIBRARY}
|
||||
${LLIMAGEJ2COJ_LIBRARIES}
|
||||
${OS_LIBRARIES}
|
||||
${GOOGLE_PERFTOOLS_LIBRARIES}
|
||||
)
|
||||
|
|
|
|||
|
|
@ -174,7 +174,7 @@ void export_test_floaters()
|
|||
std::string delim = gDirUtilp->getDirDelimiter();
|
||||
std::string xui_dir = get_xui_dir() + "en" + delim;
|
||||
std::string filename;
|
||||
while (gDirUtilp->getNextFileInDir(xui_dir, "floater_test_*.xml", filename, false))
|
||||
while (gDirUtilp->getNextFileInDir(xui_dir, "floater_test_*.xml", filename))
|
||||
{
|
||||
if (filename.find("_new.xml") != std::string::npos)
|
||||
{
|
||||
|
|
|
|||
|
|
@ -4,7 +4,7 @@
|
|||
|
||||
$LicenseInfo:firstyear=2006&license=viewerlgpl$
|
||||
Second Life Viewer Source Code
|
||||
Copyright (C) 2010, Linden Research, Inc.
|
||||
Copyright (C) 2006-2010, Linden Research, Inc.
|
||||
|
||||
This library is free software; you can redistribute it and/or
|
||||
modify it under the terms of the GNU Lesser General Public
|
||||
|
|
|
|||
|
|
@ -52,20 +52,22 @@ def get_HKLM_registry_value(key_str, value_str):
|
|||
|
||||
def find_vc_dir():
|
||||
supported_versions = (r'8.0', r'9.0')
|
||||
supported_products = (r'VisualStudio', r'VCExpress')
|
||||
value_str = (r'ProductDir')
|
||||
|
||||
for version in supported_versions:
|
||||
key_str = (r'SOFTWARE\Microsoft\VisualStudio\%s\Setup\VC' %
|
||||
version)
|
||||
try:
|
||||
return get_HKLM_registry_value(key_str, value_str)
|
||||
except WindowsError, err:
|
||||
x64_key_str = (r'SOFTWARE\Wow6432Node\Microsoft\VisualStudio\%s\Setup\VS' %
|
||||
version)
|
||||
for product in supported_products:
|
||||
for version in supported_versions:
|
||||
key_str = (r'SOFTWARE\Microsoft\%s\%s\Setup\VC' %
|
||||
(product, version))
|
||||
try:
|
||||
return get_HKLM_registry_value(x64_key_str, value_str)
|
||||
except:
|
||||
print >> sys.stderr, "Didn't find MS VC version %s " % version
|
||||
return get_HKLM_registry_value(key_str, value_str)
|
||||
except WindowsError, err:
|
||||
x64_key_str = (r'SOFTWARE\Wow6432Node\Microsoft\VisualStudio\%s\Setup\VS' %
|
||||
version)
|
||||
try:
|
||||
return get_HKLM_registry_value(x64_key_str, value_str)
|
||||
except:
|
||||
print >> sys.stderr, "Didn't find MS %s version %s " % (product,version)
|
||||
|
||||
raise
|
||||
|
||||
|
|
|
|||
|
|
@ -49,6 +49,7 @@ const guint ROTATE_IMAGE_TIMEOUT = 8000;
|
|||
typedef struct _updater_app_state {
|
||||
std::string app_name;
|
||||
std::string url;
|
||||
std::string file;
|
||||
std::string image_dir;
|
||||
std::string dest_dir;
|
||||
std::string strings_dirs;
|
||||
|
|
@ -113,7 +114,7 @@ BOOL install_package(std::string package_file, std::string destination);
|
|||
BOOL spawn_viewer(UpdaterAppState *app_state);
|
||||
|
||||
extern "C" {
|
||||
void on_window_closed(GtkWidget *sender, gpointer state);
|
||||
void on_window_closed(GtkWidget *sender, GdkEvent *event, gpointer state);
|
||||
gpointer worker_thread_cb(gpointer *data);
|
||||
int download_progress_cb(gpointer data, double t, double d, double utotal, double ulnow);
|
||||
gboolean rotate_image_cb(gpointer data);
|
||||
|
|
@ -216,11 +217,11 @@ gboolean rotate_image_cb(gpointer data)
|
|||
std::string next_image_filename(std::string& image_path)
|
||||
{
|
||||
std::string image_filename;
|
||||
gDirUtilp->getNextFileInDir(image_path, "/*.jpg", image_filename, true);
|
||||
gDirUtilp->getNextFileInDir(image_path, "/*.jpg", image_filename);
|
||||
return image_path + "/" + image_filename;
|
||||
}
|
||||
|
||||
void on_window_closed(GtkWidget *sender, gpointer data)
|
||||
void on_window_closed(GtkWidget *sender, GdkEvent* event, gpointer data)
|
||||
{
|
||||
UpdaterAppState *app_state;
|
||||
|
||||
|
|
@ -266,85 +267,95 @@ gpointer worker_thread_cb(gpointer data)
|
|||
CURLcode result;
|
||||
FILE *package_file;
|
||||
GError *error = NULL;
|
||||
char *tmp_filename = NULL;
|
||||
int fd;
|
||||
|
||||
//g_return_val_if_fail (data != NULL, NULL);
|
||||
app_state = (UpdaterAppState *) data;
|
||||
|
||||
try {
|
||||
// create temporary file to store the package.
|
||||
fd = g_file_open_tmp
|
||||
("secondlife-update-XXXXXX", &tmp_filename, &error);
|
||||
if (error != NULL)
|
||||
|
||||
if(!app_state->url.empty())
|
||||
{
|
||||
llerrs << "Unable to create temporary file: "
|
||||
<< error->message
|
||||
<< llendl;
|
||||
char* tmp_local_filename = NULL;
|
||||
// create temporary file to store the package.
|
||||
fd = g_file_open_tmp
|
||||
("secondlife-update-XXXXXX", &tmp_local_filename, &error);
|
||||
if (error != NULL)
|
||||
{
|
||||
llerrs << "Unable to create temporary file: "
|
||||
<< error->message
|
||||
<< llendl;
|
||||
|
||||
g_error_free(error);
|
||||
throw 0;
|
||||
g_error_free(error);
|
||||
throw 0;
|
||||
}
|
||||
|
||||
if(tmp_local_filename != NULL)
|
||||
{
|
||||
app_state->file = tmp_local_filename;
|
||||
g_free(tmp_local_filename);
|
||||
}
|
||||
|
||||
package_file = fdopen(fd, "wb");
|
||||
if (package_file == NULL)
|
||||
{
|
||||
llerrs << "Failed to create temporary file: "
|
||||
<< app_state->file.c_str()
|
||||
<< llendl;
|
||||
|
||||
gdk_threads_enter();
|
||||
display_error(app_state->window,
|
||||
LLTrans::getString("UpdaterFailDownloadTitle"),
|
||||
LLTrans::getString("UpdaterFailUpdateDescriptive"));
|
||||
gdk_threads_leave();
|
||||
throw 0;
|
||||
}
|
||||
|
||||
// initialize curl and start downloading the package
|
||||
llinfos << "Downloading package: " << app_state->url << llendl;
|
||||
|
||||
curl = curl_easy_init();
|
||||
if (curl == NULL)
|
||||
{
|
||||
llerrs << "Failed to initialize libcurl" << llendl;
|
||||
|
||||
gdk_threads_enter();
|
||||
display_error(app_state->window,
|
||||
LLTrans::getString("UpdaterFailDownloadTitle"),
|
||||
LLTrans::getString("UpdaterFailUpdateDescriptive"));
|
||||
gdk_threads_leave();
|
||||
throw 0;
|
||||
}
|
||||
|
||||
curl_easy_setopt(curl, CURLOPT_URL, app_state->url.c_str());
|
||||
curl_easy_setopt(curl, CURLOPT_NOSIGNAL, TRUE);
|
||||
curl_easy_setopt(curl, CURLOPT_FOLLOWLOCATION, TRUE);
|
||||
curl_easy_setopt(curl, CURLOPT_WRITEDATA, package_file);
|
||||
curl_easy_setopt(curl, CURLOPT_NOPROGRESS, FALSE);
|
||||
curl_easy_setopt(curl, CURLOPT_PROGRESSFUNCTION,
|
||||
&download_progress_cb);
|
||||
curl_easy_setopt(curl, CURLOPT_PROGRESSDATA, app_state);
|
||||
|
||||
result = curl_easy_perform(curl);
|
||||
fclose(package_file);
|
||||
curl_easy_cleanup(curl);
|
||||
|
||||
if (result)
|
||||
{
|
||||
llerrs << "Failed to download update: "
|
||||
<< app_state->url
|
||||
<< llendl;
|
||||
|
||||
gdk_threads_enter();
|
||||
display_error(app_state->window,
|
||||
LLTrans::getString("UpdaterFailDownloadTitle"),
|
||||
LLTrans::getString("UpdaterFailUpdateDescriptive"));
|
||||
gdk_threads_leave();
|
||||
|
||||
throw 0;
|
||||
}
|
||||
}
|
||||
|
||||
package_file = fdopen(fd, "wb");
|
||||
if (package_file == NULL)
|
||||
{
|
||||
llerrs << "Failed to create temporary file: "
|
||||
<< tmp_filename
|
||||
<< llendl;
|
||||
|
||||
gdk_threads_enter();
|
||||
display_error(app_state->window,
|
||||
LLTrans::getString("UpdaterFailDownloadTitle"),
|
||||
LLTrans::getString("UpdaterFailUpdateDescriptive"));
|
||||
gdk_threads_leave();
|
||||
throw 0;
|
||||
}
|
||||
|
||||
// initialize curl and start downloading the package
|
||||
llinfos << "Downloading package: " << app_state->url << llendl;
|
||||
|
||||
curl = curl_easy_init();
|
||||
if (curl == NULL)
|
||||
{
|
||||
llerrs << "Failed to initialize libcurl" << llendl;
|
||||
|
||||
gdk_threads_enter();
|
||||
display_error(app_state->window,
|
||||
LLTrans::getString("UpdaterFailDownloadTitle"),
|
||||
LLTrans::getString("UpdaterFailUpdateDescriptive"));
|
||||
gdk_threads_leave();
|
||||
throw 0;
|
||||
}
|
||||
|
||||
curl_easy_setopt(curl, CURLOPT_URL, app_state->url.c_str());
|
||||
curl_easy_setopt(curl, CURLOPT_NOSIGNAL, TRUE);
|
||||
curl_easy_setopt(curl, CURLOPT_FOLLOWLOCATION, TRUE);
|
||||
curl_easy_setopt(curl, CURLOPT_WRITEDATA, package_file);
|
||||
curl_easy_setopt(curl, CURLOPT_NOPROGRESS, FALSE);
|
||||
curl_easy_setopt(curl, CURLOPT_PROGRESSFUNCTION,
|
||||
&download_progress_cb);
|
||||
curl_easy_setopt(curl, CURLOPT_PROGRESSDATA, app_state);
|
||||
|
||||
result = curl_easy_perform(curl);
|
||||
fclose(package_file);
|
||||
curl_easy_cleanup(curl);
|
||||
|
||||
if (result)
|
||||
{
|
||||
llerrs << "Failed to download update: "
|
||||
<< app_state->url
|
||||
<< llendl;
|
||||
|
||||
gdk_threads_enter();
|
||||
display_error(app_state->window,
|
||||
LLTrans::getString("UpdaterFailDownloadTitle"),
|
||||
LLTrans::getString("UpdaterFailUpdateDescriptive"));
|
||||
gdk_threads_leave();
|
||||
|
||||
throw 0;
|
||||
}
|
||||
|
||||
|
||||
// now pulse the progres bar back and forth while the package is
|
||||
// being unpacked
|
||||
gdk_threads_enter();
|
||||
|
|
@ -357,7 +368,7 @@ gpointer worker_thread_cb(gpointer data)
|
|||
|
||||
// *TODO: if the destination is not writable, terminate this
|
||||
// thread and show file chooser?
|
||||
if (!install_package(tmp_filename, app_state->dest_dir))
|
||||
if (!install_package(app_state->file.c_str(), app_state->dest_dir))
|
||||
{
|
||||
llwarns << "Failed to install package to destination: "
|
||||
<< app_state->dest_dir
|
||||
|
|
@ -392,15 +403,6 @@ gpointer worker_thread_cb(gpointer data)
|
|||
app_state->failure = TRUE;
|
||||
}
|
||||
|
||||
// FIXME: delete package file also if delete-event is raised on window
|
||||
if (tmp_filename != NULL)
|
||||
{
|
||||
if (gDirUtilp->fileExists(tmp_filename))
|
||||
{
|
||||
LLFile::remove(tmp_filename);
|
||||
}
|
||||
}
|
||||
|
||||
gdk_threads_enter();
|
||||
updater_app_quit(app_state);
|
||||
gdk_threads_leave();
|
||||
|
|
@ -712,7 +714,7 @@ BOOL spawn_viewer(UpdaterAppState *app_state)
|
|||
|
||||
void show_usage_and_exit()
|
||||
{
|
||||
std::cout << "Usage: linux-updater --url URL --name NAME --dest PATH --stringsdir PATH1,PATH2 --stringsfile FILE"
|
||||
std::cout << "Usage: linux-updater <--url URL | --file FILE> --name NAME --dest PATH --stringsdir PATH1,PATH2 --stringsfile FILE"
|
||||
<< "[--image-dir PATH]"
|
||||
<< std::endl;
|
||||
exit(1);
|
||||
|
|
@ -728,6 +730,10 @@ void parse_args_and_init(int argc, char **argv, UpdaterAppState *app_state)
|
|||
{
|
||||
app_state->url = argv[i];
|
||||
}
|
||||
else if ((!strcmp(argv[i], "--file")) && (++i < argc))
|
||||
{
|
||||
app_state->file = argv[i];
|
||||
}
|
||||
else if ((!strcmp(argv[i], "--name")) && (++i < argc))
|
||||
{
|
||||
app_state->app_name = argv[i];
|
||||
|
|
@ -756,7 +762,7 @@ void parse_args_and_init(int argc, char **argv, UpdaterAppState *app_state)
|
|||
}
|
||||
|
||||
if (app_state->app_name.empty()
|
||||
|| app_state->url.empty()
|
||||
|| (app_state->url.empty() && app_state->file.empty())
|
||||
|| app_state->dest_dir.empty())
|
||||
{
|
||||
show_usage_and_exit();
|
||||
|
|
@ -771,10 +777,10 @@ void parse_args_and_init(int argc, char **argv, UpdaterAppState *app_state)
|
|||
|
||||
int main(int argc, char **argv)
|
||||
{
|
||||
UpdaterAppState app_state;
|
||||
UpdaterAppState* app_state = new UpdaterAppState;
|
||||
GThread *worker_thread;
|
||||
|
||||
parse_args_and_init(argc, argv, &app_state);
|
||||
parse_args_and_init(argc, argv, app_state);
|
||||
|
||||
// Initialize logger, and rename old log file
|
||||
gDirUtilp->initAppDirs("SecondLife");
|
||||
|
|
@ -797,17 +803,29 @@ int main(int argc, char **argv)
|
|||
gtk_init(&argc, &argv);
|
||||
|
||||
// create UI
|
||||
updater_app_ui_init(&app_state);
|
||||
updater_app_ui_init(app_state);
|
||||
|
||||
//llinfos << "SAMPLE TRANSLATION IS: " << LLTrans::getString("LoginInProgress") << llendl;
|
||||
|
||||
// create download thread
|
||||
worker_thread = g_thread_create
|
||||
(GThreadFunc(worker_thread_cb), &app_state, FALSE, NULL);
|
||||
(GThreadFunc(worker_thread_cb), app_state, FALSE, NULL);
|
||||
|
||||
gdk_threads_enter();
|
||||
gtk_main();
|
||||
gdk_threads_leave();
|
||||
|
||||
return (app_state.failure == FALSE) ? 0 : 1;
|
||||
// Delete the file only if created from url download.
|
||||
if(!app_state->url.empty() && !app_state->file.empty())
|
||||
{
|
||||
if (gDirUtilp->fileExists(app_state->file))
|
||||
{
|
||||
LLFile::remove(app_state->file);
|
||||
}
|
||||
}
|
||||
|
||||
bool success = !app_state->failure;
|
||||
delete app_state;
|
||||
return success ? 0 : 1;
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -14,7 +14,6 @@ include(LLVFS)
|
|||
|
||||
include_directories(
|
||||
${LLAUDIO_INCLUDE_DIRS}
|
||||
${FMOD_INCLUDE_DIR}
|
||||
${LLCOMMON_INCLUDE_DIRS}
|
||||
${LLMATH_INCLUDE_DIRS}
|
||||
${LLMESSAGE_INCLUDE_DIRS}
|
||||
|
|
@ -45,6 +44,10 @@ set(llaudio_HEADER_FILES
|
|||
)
|
||||
|
||||
if (FMOD)
|
||||
include_directories(
|
||||
${FMOD_INCLUDE_DIR}
|
||||
)
|
||||
|
||||
list(APPEND llaudio_SOURCE_FILES
|
||||
llaudioengine_fmod.cpp
|
||||
lllistener_fmod.cpp
|
||||
|
|
|
|||
|
|
@ -97,7 +97,11 @@ void LLAudioEngine::setDefaults()
|
|||
}
|
||||
|
||||
mMasterGain = 1.f;
|
||||
mInternalGain = 0.f;
|
||||
// Setting mInternalGain to an out of range value fixes the issue reported in STORM-830.
|
||||
// There is an edge case in setMasterGain during startup which prevents setInternalGain from
|
||||
// being called if the master volume setting and mInternalGain both equal 0, so using -1 forces
|
||||
// the if statement in setMasterGain to execute when the viewer starts up.
|
||||
mInternalGain = -1.f;
|
||||
mNextWindUpdate = 0.f;
|
||||
|
||||
mStreamingAudioImpl = NULL;
|
||||
|
|
@ -1557,6 +1561,10 @@ bool LLAudioSource::hasPendingPreloads() const
|
|||
LLAudioData *adp = iter->second;
|
||||
// note: a bad UUID will forever be !hasDecodedData()
|
||||
// but also !hasValidData(), hence the check for hasValidData()
|
||||
if (!adp)
|
||||
{
|
||||
continue;
|
||||
}
|
||||
if (!adp->hasDecodedData() && adp->hasValidData())
|
||||
{
|
||||
// This source is still waiting for a preload
|
||||
|
|
|
|||
|
|
@ -120,6 +120,13 @@ S32 check_for_invalid_wav_formats(const std::string& in_fname, std::string& erro
|
|||
+ ((U32) wav_header[5] << 8)
|
||||
+ wav_header[4];
|
||||
|
||||
if (chunk_length > physical_file_size - file_pos - 4)
|
||||
{
|
||||
infile.close();
|
||||
error_msg = "SoundFileInvalidChunkSize";
|
||||
return(LLVORBISENC_CHUNK_SIZE_ERR);
|
||||
}
|
||||
|
||||
// llinfos << "chunk found: '" << wav_header[0] << wav_header[1] << wav_header[2] << wav_header[3] << "'" << llendl;
|
||||
|
||||
if (!(strncmp((char *)&(wav_header[0]),"fmt ",4)))
|
||||
|
|
|
|||
|
|
@ -38,6 +38,7 @@ const S32 LLVORBISENC_MULTICHANNEL_ERR = 7; // can't do stereo
|
|||
const S32 LLVORBISENC_UNSUPPORTED_SAMPLE_RATE = 8; // unsupported sample rate
|
||||
const S32 LLVORBISENC_UNSUPPORTED_WORD_SIZE = 9; // unsupported word size
|
||||
const S32 LLVORBISENC_CLIP_TOO_LONG = 10; // source file is too long
|
||||
const S32 LLVORBISENC_CHUNK_SIZE_ERR = 11; // chunk size is wrong
|
||||
|
||||
const F32 LLVORBIS_CLIP_MAX_TIME = 10.0f;
|
||||
const U8 LLVORBIS_CLIP_MAX_CHANNELS = 2;
|
||||
|
|
|
|||
|
|
@ -33,145 +33,145 @@
|
|||
#include "llanimationstates.h"
|
||||
#include "llstring.h"
|
||||
|
||||
const LLUUID ANIM_AGENT_AFRAID = LLUUID("6b61c8e8-4747-0d75-12d7-e49ff207a4ca");
|
||||
const LLUUID ANIM_AGENT_AIM_BAZOOKA_R = LLUUID("b5b4a67d-0aee-30d2-72cd-77b333e932ef");
|
||||
const LLUUID ANIM_AGENT_AIM_BOW_L = LLUUID("46bb4359-de38-4ed8-6a22-f1f52fe8f506");
|
||||
const LLUUID ANIM_AGENT_AIM_HANDGUN_R = LLUUID("3147d815-6338-b932-f011-16b56d9ac18b");
|
||||
const LLUUID ANIM_AGENT_AIM_RIFLE_R = LLUUID("ea633413-8006-180a-c3ba-96dd1d756720");
|
||||
const LLUUID ANIM_AGENT_ANGRY = LLUUID("5747a48e-073e-c331-f6f3-7c2149613d3e");
|
||||
const LLUUID ANIM_AGENT_AWAY = LLUUID("fd037134-85d4-f241-72c6-4f42164fedee");
|
||||
const LLUUID ANIM_AGENT_BACKFLIP = LLUUID("c4ca6188-9127-4f31-0158-23c4e2f93304");
|
||||
const LLUUID ANIM_AGENT_BELLY_LAUGH = LLUUID("18b3a4b5-b463-bd48-e4b6-71eaac76c515");
|
||||
const LLUUID ANIM_AGENT_BLOW_KISS = LLUUID("db84829b-462c-ee83-1e27-9bbee66bd624");
|
||||
const LLUUID ANIM_AGENT_BORED = LLUUID("b906c4ba-703b-1940-32a3-0c7f7d791510");
|
||||
const LLUUID ANIM_AGENT_BOW = LLUUID("82e99230-c906-1403-4d9c-3889dd98daba");
|
||||
const LLUUID ANIM_AGENT_BRUSH = LLUUID("349a3801-54f9-bf2c-3bd0-1ac89772af01");
|
||||
const LLUUID ANIM_AGENT_BUSY = LLUUID("efcf670c-2d18-8128-973a-034ebc806b67");
|
||||
const LLUUID ANIM_AGENT_CLAP = LLUUID("9b0c1c4e-8ac7-7969-1494-28c874c4f668");
|
||||
const LLUUID ANIM_AGENT_COURTBOW = LLUUID("9ba1c942-08be-e43a-fb29-16ad440efc50");
|
||||
const LLUUID ANIM_AGENT_CROUCH = LLUUID("201f3fdf-cb1f-dbec-201f-7333e328ae7c");
|
||||
const LLUUID ANIM_AGENT_CROUCHWALK = LLUUID("47f5f6fb-22e5-ae44-f871-73aaaf4a6022");
|
||||
const LLUUID ANIM_AGENT_CRY = LLUUID("92624d3e-1068-f1aa-a5ec-8244585193ed");
|
||||
const LLUUID ANIM_AGENT_CUSTOMIZE = LLUUID("038fcec9-5ebd-8a8e-0e2e-6e71a0a1ac53");
|
||||
const LLUUID ANIM_AGENT_CUSTOMIZE_DONE = LLUUID("6883a61a-b27b-5914-a61e-dda118a9ee2c");
|
||||
const LLUUID ANIM_AGENT_DANCE1 = LLUUID("b68a3d7c-de9e-fc87-eec8-543d787e5b0d");
|
||||
const LLUUID ANIM_AGENT_DANCE2 = LLUUID("928cae18-e31d-76fd-9cc9-2f55160ff818");
|
||||
const LLUUID ANIM_AGENT_DANCE3 = LLUUID("30047778-10ea-1af7-6881-4db7a3a5a114");
|
||||
const LLUUID ANIM_AGENT_DANCE4 = LLUUID("951469f4-c7b2-c818-9dee-ad7eea8c30b7");
|
||||
const LLUUID ANIM_AGENT_DANCE5 = LLUUID("4bd69a1d-1114-a0b4-625f-84e0a5237155");
|
||||
const LLUUID ANIM_AGENT_DANCE6 = LLUUID("cd28b69b-9c95-bb78-3f94-8d605ff1bb12");
|
||||
const LLUUID ANIM_AGENT_DANCE7 = LLUUID("a54d8ee2-28bb-80a9-7f0c-7afbbe24a5d6");
|
||||
const LLUUID ANIM_AGENT_DANCE8 = LLUUID("b0dc417c-1f11-af36-2e80-7e7489fa7cdc");
|
||||
const LLUUID ANIM_AGENT_DEAD = LLUUID("57abaae6-1d17-7b1b-5f98-6d11a6411276");
|
||||
const LLUUID ANIM_AGENT_DRINK = LLUUID("0f86e355-dd31-a61c-fdb0-3a96b9aad05f");
|
||||
const LLUUID ANIM_AGENT_EMBARRASSED = LLUUID("514af488-9051-044a-b3fc-d4dbf76377c6");
|
||||
const LLUUID ANIM_AGENT_EXPRESS_AFRAID = LLUUID("aa2df84d-cf8f-7218-527b-424a52de766e");
|
||||
const LLUUID ANIM_AGENT_EXPRESS_ANGER = LLUUID("1a03b575-9634-b62a-5767-3a679e81f4de");
|
||||
const LLUUID ANIM_AGENT_EXPRESS_BORED = LLUUID("214aa6c1-ba6a-4578-f27c-ce7688f61d0d");
|
||||
const LLUUID ANIM_AGENT_EXPRESS_CRY = LLUUID("d535471b-85bf-3b4d-a542-93bea4f59d33");
|
||||
const LLUUID ANIM_AGENT_EXPRESS_DISDAIN = LLUUID("d4416ff1-09d3-300f-4183-1b68a19b9fc1");
|
||||
const LLUUID ANIM_AGENT_EXPRESS_EMBARRASSED = LLUUID("0b8c8211-d78c-33e8-fa28-c51a9594e424");
|
||||
const LLUUID ANIM_AGENT_EXPRESS_FROWN = LLUUID("fee3df48-fa3d-1015-1e26-a205810e3001");
|
||||
const LLUUID ANIM_AGENT_EXPRESS_KISS = LLUUID("1e8d90cc-a84e-e135-884c-7c82c8b03a14");
|
||||
const LLUUID ANIM_AGENT_EXPRESS_LAUGH = LLUUID("62570842-0950-96f8-341c-809e65110823");
|
||||
const LLUUID ANIM_AGENT_EXPRESS_OPEN_MOUTH = LLUUID("d63bc1f9-fc81-9625-a0c6-007176d82eb7");
|
||||
const LLUUID ANIM_AGENT_EXPRESS_REPULSED = LLUUID("f76cda94-41d4-a229-2872-e0296e58afe1");
|
||||
const LLUUID ANIM_AGENT_EXPRESS_SAD = LLUUID("eb6ebfb2-a4b3-a19c-d388-4dd5c03823f7");
|
||||
const LLUUID ANIM_AGENT_EXPRESS_SHRUG = LLUUID("a351b1bc-cc94-aac2-7bea-a7e6ebad15ef");
|
||||
const LLUUID ANIM_AGENT_EXPRESS_SMILE = LLUUID("b7c7c833-e3d3-c4e3-9fc0-131237446312");
|
||||
const LLUUID ANIM_AGENT_EXPRESS_SURPRISE = LLUUID("728646d9-cc79-08b2-32d6-937f0a835c24");
|
||||
const LLUUID ANIM_AGENT_EXPRESS_TONGUE_OUT = LLUUID("835965c6-7f2f-bda2-5deb-2478737f91bf");
|
||||
const LLUUID ANIM_AGENT_EXPRESS_TOOTHSMILE = LLUUID("b92ec1a5-e7ce-a76b-2b05-bcdb9311417e");
|
||||
const LLUUID ANIM_AGENT_EXPRESS_WINK = LLUUID("da020525-4d94-59d6-23d7-81fdebf33148");
|
||||
const LLUUID ANIM_AGENT_EXPRESS_WORRY = LLUUID("9c05e5c7-6f07-6ca4-ed5a-b230390c3950");
|
||||
const LLUUID ANIM_AGENT_FALLDOWN = LLUUID("666307d9-a860-572d-6fd4-c3ab8865c094");
|
||||
const LLUUID ANIM_AGENT_FEMALE_RUN_NEW = LLUUID("85995026-eade-5d78-d364-94a64512cb66");
|
||||
const LLUUID ANIM_AGENT_FEMALE_WALK = LLUUID("f5fc7433-043d-e819-8298-f519a119b688");
|
||||
const LLUUID ANIM_AGENT_FEMALE_WALK_NEW = LLUUID("d60c41d2-7c24-7074-d3fa-6101cea22a51");
|
||||
const LLUUID ANIM_AGENT_FINGER_WAG = LLUUID("c1bc7f36-3ba0-d844-f93c-93be945d644f");
|
||||
const LLUUID ANIM_AGENT_FIST_PUMP = LLUUID("7db00ccd-f380-f3ee-439d-61968ec69c8a");
|
||||
const LLUUID ANIM_AGENT_FLY = LLUUID("aec4610c-757f-bc4e-c092-c6e9caf18daf");
|
||||
const LLUUID ANIM_AGENT_FLYSLOW = LLUUID("2b5a38b2-5e00-3a97-a495-4c826bc443e6");
|
||||
const LLUUID ANIM_AGENT_HELLO = LLUUID("9b29cd61-c45b-5689-ded2-91756b8d76a9");
|
||||
const LLUUID ANIM_AGENT_HOLD_BAZOOKA_R = LLUUID("ef62d355-c815-4816-2474-b1acc21094a6");
|
||||
const LLUUID ANIM_AGENT_HOLD_BOW_L = LLUUID("8b102617-bcba-037b-86c1-b76219f90c88");
|
||||
const LLUUID ANIM_AGENT_HOLD_HANDGUN_R = LLUUID("efdc1727-8b8a-c800-4077-975fc27ee2f2");
|
||||
const LLUUID ANIM_AGENT_HOLD_RIFLE_R = LLUUID("3d94bad0-c55b-7dcc-8763-033c59405d33");
|
||||
const LLUUID ANIM_AGENT_HOLD_THROW_R = LLUUID("7570c7b5-1f22-56dd-56ef-a9168241bbb6");
|
||||
const LLUUID ANIM_AGENT_HOVER = LLUUID("4ae8016b-31b9-03bb-c401-b1ea941db41d");
|
||||
const LLUUID ANIM_AGENT_HOVER_DOWN = LLUUID("20f063ea-8306-2562-0b07-5c853b37b31e");
|
||||
const LLUUID ANIM_AGENT_HOVER_UP = LLUUID("62c5de58-cb33-5743-3d07-9e4cd4352864");
|
||||
const LLUUID ANIM_AGENT_IMPATIENT = LLUUID("5ea3991f-c293-392e-6860-91dfa01278a3");
|
||||
const LLUUID ANIM_AGENT_JUMP = LLUUID("2305bd75-1ca9-b03b-1faa-b176b8a8c49e");
|
||||
const LLUUID ANIM_AGENT_JUMP_FOR_JOY = LLUUID("709ea28e-1573-c023-8bf8-520c8bc637fa");
|
||||
const LLUUID ANIM_AGENT_KISS_MY_BUTT = LLUUID("19999406-3a3a-d58c-a2ac-d72e555dcf51");
|
||||
const LLUUID ANIM_AGENT_LAND = LLUUID("7a17b059-12b2-41b1-570a-186368b6aa6f");
|
||||
const LLUUID ANIM_AGENT_LAUGH_SHORT = LLUUID("ca5b3f14-3194-7a2b-c894-aa699b718d1f");
|
||||
const LLUUID ANIM_AGENT_MEDIUM_LAND = LLUUID("f4f00d6e-b9fe-9292-f4cb-0ae06ea58d57");
|
||||
const LLUUID ANIM_AGENT_MOTORCYCLE_SIT = LLUUID("08464f78-3a8e-2944-cba5-0c94aff3af29");
|
||||
const LLUUID ANIM_AGENT_MUSCLE_BEACH = LLUUID("315c3a41-a5f3-0ba4-27da-f893f769e69b");
|
||||
const LLUUID ANIM_AGENT_NO = LLUUID("5a977ed9-7f72-44e9-4c4c-6e913df8ae74");
|
||||
const LLUUID ANIM_AGENT_NO_UNHAPPY = LLUUID("d83fa0e5-97ed-7eb2-e798-7bd006215cb4");
|
||||
const LLUUID ANIM_AGENT_NYAH_NYAH = LLUUID("f061723d-0a18-754f-66ee-29a44795a32f");
|
||||
const LLUUID ANIM_AGENT_ONETWO_PUNCH = LLUUID("eefc79be-daae-a239-8c04-890f5d23654a");
|
||||
const LLUUID ANIM_AGENT_PEACE = LLUUID("b312b10e-65ab-a0a4-8b3c-1326ea8e3ed9");
|
||||
const LLUUID ANIM_AGENT_POINT_ME = LLUUID("17c024cc-eef2-f6a0-3527-9869876d7752");
|
||||
const LLUUID ANIM_AGENT_POINT_YOU = LLUUID("ec952cca-61ef-aa3b-2789-4d1344f016de");
|
||||
const LLUUID ANIM_AGENT_PRE_JUMP = LLUUID("7a4e87fe-de39-6fcb-6223-024b00893244");
|
||||
const LLUUID ANIM_AGENT_PUNCH_LEFT = LLUUID("f3300ad9-3462-1d07-2044-0fef80062da0");
|
||||
const LLUUID ANIM_AGENT_PUNCH_RIGHT = LLUUID("c8e42d32-7310-6906-c903-cab5d4a34656");
|
||||
const LLUUID ANIM_AGENT_REPULSED = LLUUID("36f81a92-f076-5893-dc4b-7c3795e487cf");
|
||||
const LLUUID ANIM_AGENT_ROUNDHOUSE_KICK = LLUUID("49aea43b-5ac3-8a44-b595-96100af0beda");
|
||||
const LLUUID ANIM_AGENT_RPS_COUNTDOWN = LLUUID("35db4f7e-28c2-6679-cea9-3ee108f7fc7f");
|
||||
const LLUUID ANIM_AGENT_RPS_PAPER = LLUUID("0836b67f-7f7b-f37b-c00a-460dc1521f5a");
|
||||
const LLUUID ANIM_AGENT_RPS_ROCK = LLUUID("42dd95d5-0bc6-6392-f650-777304946c0f");
|
||||
const LLUUID ANIM_AGENT_RPS_SCISSORS = LLUUID("16803a9f-5140-e042-4d7b-d28ba247c325");
|
||||
const LLUUID ANIM_AGENT_RUN = LLUUID("05ddbff8-aaa9-92a1-2b74-8fe77a29b445");
|
||||
const LLUUID ANIM_AGENT_RUN_NEW = LLUUID("1ab1b236-cd08-21e6-0cbc-0d923fc6eca2");
|
||||
const LLUUID ANIM_AGENT_SAD = LLUUID("0eb702e2-cc5a-9a88-56a5-661a55c0676a");
|
||||
const LLUUID ANIM_AGENT_SALUTE = LLUUID("cd7668a6-7011-d7e2-ead8-fc69eff1a104");
|
||||
const LLUUID ANIM_AGENT_SHOOT_BOW_L = LLUUID("e04d450d-fdb5-0432-fd68-818aaf5935f8");
|
||||
const LLUUID ANIM_AGENT_SHOUT = LLUUID("6bd01860-4ebd-127a-bb3d-d1427e8e0c42");
|
||||
const LLUUID ANIM_AGENT_SHRUG = LLUUID("70ea714f-3a97-d742-1b01-590a8fcd1db5");
|
||||
const LLUUID ANIM_AGENT_SIT = LLUUID("1a5fe8ac-a804-8a5d-7cbd-56bd83184568");
|
||||
const LLUUID ANIM_AGENT_SIT_FEMALE = LLUUID("b1709c8d-ecd3-54a1-4f28-d55ac0840782");
|
||||
const LLUUID ANIM_AGENT_SIT_GENERIC = LLUUID("245f3c54-f1c0-bf2e-811f-46d8eeb386e7");
|
||||
const LLUUID ANIM_AGENT_SIT_GROUND = LLUUID("1c7600d6-661f-b87b-efe2-d7421eb93c86");
|
||||
const LLUUID ANIM_AGENT_SIT_GROUND_CONSTRAINED = LLUUID("1a2bd58e-87ff-0df8-0b4c-53e047b0bb6e");
|
||||
const LLUUID ANIM_AGENT_SIT_TO_STAND = LLUUID("a8dee56f-2eae-9e7a-05a2-6fb92b97e21e");
|
||||
const LLUUID ANIM_AGENT_SLEEP = LLUUID("f2bed5f9-9d44-39af-b0cd-257b2a17fe40");
|
||||
const LLUUID ANIM_AGENT_SMOKE_IDLE = LLUUID("d2f2ee58-8ad1-06c9-d8d3-3827ba31567a");
|
||||
const LLUUID ANIM_AGENT_SMOKE_INHALE = LLUUID("6802d553-49da-0778-9f85-1599a2266526");
|
||||
const LLUUID ANIM_AGENT_SMOKE_THROW_DOWN = LLUUID("0a9fb970-8b44-9114-d3a9-bf69cfe804d6");
|
||||
const LLUUID ANIM_AGENT_SNAPSHOT = LLUUID("eae8905b-271a-99e2-4c0e-31106afd100c");
|
||||
const LLUUID ANIM_AGENT_STAND = LLUUID("2408fe9e-df1d-1d7d-f4ff-1384fa7b350f");
|
||||
const LLUUID ANIM_AGENT_STANDUP = LLUUID("3da1d753-028a-5446-24f3-9c9b856d9422");
|
||||
const LLUUID ANIM_AGENT_STAND_1 = LLUUID("15468e00-3400-bb66-cecc-646d7c14458e");
|
||||
const LLUUID ANIM_AGENT_STAND_2 = LLUUID("370f3a20-6ca6-9971-848c-9a01bc42ae3c");
|
||||
const LLUUID ANIM_AGENT_STAND_3 = LLUUID("42b46214-4b44-79ae-deb8-0df61424ff4b");
|
||||
const LLUUID ANIM_AGENT_STAND_4 = LLUUID("f22fed8b-a5ed-2c93-64d5-bdd8b93c889f");
|
||||
const LLUUID ANIM_AGENT_STRETCH = LLUUID("80700431-74ec-a008-14f8-77575e73693f");
|
||||
const LLUUID ANIM_AGENT_STRIDE = LLUUID("1cb562b0-ba21-2202-efb3-30f82cdf9595");
|
||||
const LLUUID ANIM_AGENT_SURF = LLUUID("41426836-7437-7e89-025d-0aa4d10f1d69");
|
||||
const LLUUID ANIM_AGENT_SURPRISE = LLUUID("313b9881-4302-73c0-c7d0-0e7a36b6c224");
|
||||
const LLUUID ANIM_AGENT_SWORD_STRIKE = LLUUID("85428680-6bf9-3e64-b489-6f81087c24bd");
|
||||
const LLUUID ANIM_AGENT_TALK = LLUUID("5c682a95-6da4-a463-0bf6-0f5b7be129d1");
|
||||
const LLUUID ANIM_AGENT_TANTRUM = LLUUID("11000694-3f41-adc2-606b-eee1d66f3724");
|
||||
const LLUUID ANIM_AGENT_THROW_R = LLUUID("aa134404-7dac-7aca-2cba-435f9db875ca");
|
||||
const LLUUID ANIM_AGENT_TRYON_SHIRT = LLUUID("83ff59fe-2346-f236-9009-4e3608af64c1");
|
||||
const LLUUID ANIM_AGENT_TURNLEFT = LLUUID("56e0ba0d-4a9f-7f27-6117-32f2ebbf6135");
|
||||
const LLUUID ANIM_AGENT_TURNRIGHT = LLUUID("2d6daa51-3192-6794-8e2e-a15f8338ec30");
|
||||
const LLUUID ANIM_AGENT_TYPE = LLUUID("c541c47f-e0c0-058b-ad1a-d6ae3a4584d9");
|
||||
const LLUUID ANIM_AGENT_WALK = LLUUID("6ed24bd8-91aa-4b12-ccc7-c97c857ab4e0");
|
||||
const LLUUID ANIM_AGENT_WALK_NEW = LLUUID("33339176-7ddc-9397-94a4-bf3403cbc8f5");
|
||||
const LLUUID ANIM_AGENT_WHISPER = LLUUID("7693f268-06c7-ea71-fa21-2b30d6533f8f");
|
||||
const LLUUID ANIM_AGENT_WHISTLE = LLUUID("b1ed7982-c68e-a982-7561-52a88a5298c0");
|
||||
const LLUUID ANIM_AGENT_WINK = LLUUID("869ecdad-a44b-671e-3266-56aef2e3ac2e");
|
||||
const LLUUID ANIM_AGENT_WINK_HOLLYWOOD = LLUUID("c0c4030f-c02b-49de-24ba-2331f43fe41c");
|
||||
const LLUUID ANIM_AGENT_WORRY = LLUUID("9f496bd2-589a-709f-16cc-69bf7df1d36c");
|
||||
const LLUUID ANIM_AGENT_YES = LLUUID("15dd911d-be82-2856-26db-27659b142875");
|
||||
const LLUUID ANIM_AGENT_YES_HAPPY = LLUUID("b8c8b2a3-9008-1771-3bfc-90924955ab2d");
|
||||
const LLUUID ANIM_AGENT_YOGA_FLOAT = LLUUID("42ecd00b-9947-a97c-400a-bbc9174c7aeb");
|
||||
LLUUID const ANIM_AGENT_AFRAID ("6b61c8e8-4747-0d75-12d7-e49ff207a4ca");
|
||||
LLUUID const ANIM_AGENT_AIM_BAZOOKA_R ("b5b4a67d-0aee-30d2-72cd-77b333e932ef");
|
||||
LLUUID const ANIM_AGENT_AIM_BOW_L ("46bb4359-de38-4ed8-6a22-f1f52fe8f506");
|
||||
LLUUID const ANIM_AGENT_AIM_HANDGUN_R ("3147d815-6338-b932-f011-16b56d9ac18b");
|
||||
LLUUID const ANIM_AGENT_AIM_RIFLE_R ("ea633413-8006-180a-c3ba-96dd1d756720");
|
||||
LLUUID const ANIM_AGENT_ANGRY ("5747a48e-073e-c331-f6f3-7c2149613d3e");
|
||||
LLUUID const ANIM_AGENT_AWAY ("fd037134-85d4-f241-72c6-4f42164fedee");
|
||||
LLUUID const ANIM_AGENT_BACKFLIP ("c4ca6188-9127-4f31-0158-23c4e2f93304");
|
||||
LLUUID const ANIM_AGENT_BELLY_LAUGH ("18b3a4b5-b463-bd48-e4b6-71eaac76c515");
|
||||
LLUUID const ANIM_AGENT_BLOW_KISS ("db84829b-462c-ee83-1e27-9bbee66bd624");
|
||||
LLUUID const ANIM_AGENT_BORED ("b906c4ba-703b-1940-32a3-0c7f7d791510");
|
||||
LLUUID const ANIM_AGENT_BOW ("82e99230-c906-1403-4d9c-3889dd98daba");
|
||||
LLUUID const ANIM_AGENT_BRUSH ("349a3801-54f9-bf2c-3bd0-1ac89772af01");
|
||||
LLUUID const ANIM_AGENT_BUSY ("efcf670c-2d18-8128-973a-034ebc806b67");
|
||||
LLUUID const ANIM_AGENT_CLAP ("9b0c1c4e-8ac7-7969-1494-28c874c4f668");
|
||||
LLUUID const ANIM_AGENT_COURTBOW ("9ba1c942-08be-e43a-fb29-16ad440efc50");
|
||||
LLUUID const ANIM_AGENT_CROUCH ("201f3fdf-cb1f-dbec-201f-7333e328ae7c");
|
||||
LLUUID const ANIM_AGENT_CROUCHWALK ("47f5f6fb-22e5-ae44-f871-73aaaf4a6022");
|
||||
LLUUID const ANIM_AGENT_CRY ("92624d3e-1068-f1aa-a5ec-8244585193ed");
|
||||
LLUUID const ANIM_AGENT_CUSTOMIZE ("038fcec9-5ebd-8a8e-0e2e-6e71a0a1ac53");
|
||||
LLUUID const ANIM_AGENT_CUSTOMIZE_DONE ("6883a61a-b27b-5914-a61e-dda118a9ee2c");
|
||||
LLUUID const ANIM_AGENT_DANCE1 ("b68a3d7c-de9e-fc87-eec8-543d787e5b0d");
|
||||
LLUUID const ANIM_AGENT_DANCE2 ("928cae18-e31d-76fd-9cc9-2f55160ff818");
|
||||
LLUUID const ANIM_AGENT_DANCE3 ("30047778-10ea-1af7-6881-4db7a3a5a114");
|
||||
LLUUID const ANIM_AGENT_DANCE4 ("951469f4-c7b2-c818-9dee-ad7eea8c30b7");
|
||||
LLUUID const ANIM_AGENT_DANCE5 ("4bd69a1d-1114-a0b4-625f-84e0a5237155");
|
||||
LLUUID const ANIM_AGENT_DANCE6 ("cd28b69b-9c95-bb78-3f94-8d605ff1bb12");
|
||||
LLUUID const ANIM_AGENT_DANCE7 ("a54d8ee2-28bb-80a9-7f0c-7afbbe24a5d6");
|
||||
LLUUID const ANIM_AGENT_DANCE8 ("b0dc417c-1f11-af36-2e80-7e7489fa7cdc");
|
||||
LLUUID const ANIM_AGENT_DEAD ("57abaae6-1d17-7b1b-5f98-6d11a6411276");
|
||||
LLUUID const ANIM_AGENT_DRINK ("0f86e355-dd31-a61c-fdb0-3a96b9aad05f");
|
||||
LLUUID const ANIM_AGENT_EMBARRASSED ("514af488-9051-044a-b3fc-d4dbf76377c6");
|
||||
LLUUID const ANIM_AGENT_EXPRESS_AFRAID ("aa2df84d-cf8f-7218-527b-424a52de766e");
|
||||
LLUUID const ANIM_AGENT_EXPRESS_ANGER ("1a03b575-9634-b62a-5767-3a679e81f4de");
|
||||
LLUUID const ANIM_AGENT_EXPRESS_BORED ("214aa6c1-ba6a-4578-f27c-ce7688f61d0d");
|
||||
LLUUID const ANIM_AGENT_EXPRESS_CRY ("d535471b-85bf-3b4d-a542-93bea4f59d33");
|
||||
LLUUID const ANIM_AGENT_EXPRESS_DISDAIN ("d4416ff1-09d3-300f-4183-1b68a19b9fc1");
|
||||
LLUUID const ANIM_AGENT_EXPRESS_EMBARRASSED ("0b8c8211-d78c-33e8-fa28-c51a9594e424");
|
||||
LLUUID const ANIM_AGENT_EXPRESS_FROWN ("fee3df48-fa3d-1015-1e26-a205810e3001");
|
||||
LLUUID const ANIM_AGENT_EXPRESS_KISS ("1e8d90cc-a84e-e135-884c-7c82c8b03a14");
|
||||
LLUUID const ANIM_AGENT_EXPRESS_LAUGH ("62570842-0950-96f8-341c-809e65110823");
|
||||
LLUUID const ANIM_AGENT_EXPRESS_OPEN_MOUTH ("d63bc1f9-fc81-9625-a0c6-007176d82eb7");
|
||||
LLUUID const ANIM_AGENT_EXPRESS_REPULSED ("f76cda94-41d4-a229-2872-e0296e58afe1");
|
||||
LLUUID const ANIM_AGENT_EXPRESS_SAD ("eb6ebfb2-a4b3-a19c-d388-4dd5c03823f7");
|
||||
LLUUID const ANIM_AGENT_EXPRESS_SHRUG ("a351b1bc-cc94-aac2-7bea-a7e6ebad15ef");
|
||||
LLUUID const ANIM_AGENT_EXPRESS_SMILE ("b7c7c833-e3d3-c4e3-9fc0-131237446312");
|
||||
LLUUID const ANIM_AGENT_EXPRESS_SURPRISE ("728646d9-cc79-08b2-32d6-937f0a835c24");
|
||||
LLUUID const ANIM_AGENT_EXPRESS_TONGUE_OUT ("835965c6-7f2f-bda2-5deb-2478737f91bf");
|
||||
LLUUID const ANIM_AGENT_EXPRESS_TOOTHSMILE ("b92ec1a5-e7ce-a76b-2b05-bcdb9311417e");
|
||||
LLUUID const ANIM_AGENT_EXPRESS_WINK ("da020525-4d94-59d6-23d7-81fdebf33148");
|
||||
LLUUID const ANIM_AGENT_EXPRESS_WORRY ("9c05e5c7-6f07-6ca4-ed5a-b230390c3950");
|
||||
LLUUID const ANIM_AGENT_FALLDOWN ("666307d9-a860-572d-6fd4-c3ab8865c094");
|
||||
LLUUID const ANIM_AGENT_FEMALE_RUN_NEW ("85995026-eade-5d78-d364-94a64512cb66");
|
||||
LLUUID const ANIM_AGENT_FEMALE_WALK ("f5fc7433-043d-e819-8298-f519a119b688");
|
||||
LLUUID const ANIM_AGENT_FEMALE_WALK_NEW ("d60c41d2-7c24-7074-d3fa-6101cea22a51");
|
||||
LLUUID const ANIM_AGENT_FINGER_WAG ("c1bc7f36-3ba0-d844-f93c-93be945d644f");
|
||||
LLUUID const ANIM_AGENT_FIST_PUMP ("7db00ccd-f380-f3ee-439d-61968ec69c8a");
|
||||
LLUUID const ANIM_AGENT_FLY ("aec4610c-757f-bc4e-c092-c6e9caf18daf");
|
||||
LLUUID const ANIM_AGENT_FLYSLOW ("2b5a38b2-5e00-3a97-a495-4c826bc443e6");
|
||||
LLUUID const ANIM_AGENT_HELLO ("9b29cd61-c45b-5689-ded2-91756b8d76a9");
|
||||
LLUUID const ANIM_AGENT_HOLD_BAZOOKA_R ("ef62d355-c815-4816-2474-b1acc21094a6");
|
||||
LLUUID const ANIM_AGENT_HOLD_BOW_L ("8b102617-bcba-037b-86c1-b76219f90c88");
|
||||
LLUUID const ANIM_AGENT_HOLD_HANDGUN_R ("efdc1727-8b8a-c800-4077-975fc27ee2f2");
|
||||
LLUUID const ANIM_AGENT_HOLD_RIFLE_R ("3d94bad0-c55b-7dcc-8763-033c59405d33");
|
||||
LLUUID const ANIM_AGENT_HOLD_THROW_R ("7570c7b5-1f22-56dd-56ef-a9168241bbb6");
|
||||
LLUUID const ANIM_AGENT_HOVER ("4ae8016b-31b9-03bb-c401-b1ea941db41d");
|
||||
LLUUID const ANIM_AGENT_HOVER_DOWN ("20f063ea-8306-2562-0b07-5c853b37b31e");
|
||||
LLUUID const ANIM_AGENT_HOVER_UP ("62c5de58-cb33-5743-3d07-9e4cd4352864");
|
||||
LLUUID const ANIM_AGENT_IMPATIENT ("5ea3991f-c293-392e-6860-91dfa01278a3");
|
||||
LLUUID const ANIM_AGENT_JUMP ("2305bd75-1ca9-b03b-1faa-b176b8a8c49e");
|
||||
LLUUID const ANIM_AGENT_JUMP_FOR_JOY ("709ea28e-1573-c023-8bf8-520c8bc637fa");
|
||||
LLUUID const ANIM_AGENT_KISS_MY_BUTT ("19999406-3a3a-d58c-a2ac-d72e555dcf51");
|
||||
LLUUID const ANIM_AGENT_LAND ("7a17b059-12b2-41b1-570a-186368b6aa6f");
|
||||
LLUUID const ANIM_AGENT_LAUGH_SHORT ("ca5b3f14-3194-7a2b-c894-aa699b718d1f");
|
||||
LLUUID const ANIM_AGENT_MEDIUM_LAND ("f4f00d6e-b9fe-9292-f4cb-0ae06ea58d57");
|
||||
LLUUID const ANIM_AGENT_MOTORCYCLE_SIT ("08464f78-3a8e-2944-cba5-0c94aff3af29");
|
||||
LLUUID const ANIM_AGENT_MUSCLE_BEACH ("315c3a41-a5f3-0ba4-27da-f893f769e69b");
|
||||
LLUUID const ANIM_AGENT_NO ("5a977ed9-7f72-44e9-4c4c-6e913df8ae74");
|
||||
LLUUID const ANIM_AGENT_NO_UNHAPPY ("d83fa0e5-97ed-7eb2-e798-7bd006215cb4");
|
||||
LLUUID const ANIM_AGENT_NYAH_NYAH ("f061723d-0a18-754f-66ee-29a44795a32f");
|
||||
LLUUID const ANIM_AGENT_ONETWO_PUNCH ("eefc79be-daae-a239-8c04-890f5d23654a");
|
||||
LLUUID const ANIM_AGENT_PEACE ("b312b10e-65ab-a0a4-8b3c-1326ea8e3ed9");
|
||||
LLUUID const ANIM_AGENT_POINT_ME ("17c024cc-eef2-f6a0-3527-9869876d7752");
|
||||
LLUUID const ANIM_AGENT_POINT_YOU ("ec952cca-61ef-aa3b-2789-4d1344f016de");
|
||||
LLUUID const ANIM_AGENT_PRE_JUMP ("7a4e87fe-de39-6fcb-6223-024b00893244");
|
||||
LLUUID const ANIM_AGENT_PUNCH_LEFT ("f3300ad9-3462-1d07-2044-0fef80062da0");
|
||||
LLUUID const ANIM_AGENT_PUNCH_RIGHT ("c8e42d32-7310-6906-c903-cab5d4a34656");
|
||||
LLUUID const ANIM_AGENT_REPULSED ("36f81a92-f076-5893-dc4b-7c3795e487cf");
|
||||
LLUUID const ANIM_AGENT_ROUNDHOUSE_KICK ("49aea43b-5ac3-8a44-b595-96100af0beda");
|
||||
LLUUID const ANIM_AGENT_RPS_COUNTDOWN ("35db4f7e-28c2-6679-cea9-3ee108f7fc7f");
|
||||
LLUUID const ANIM_AGENT_RPS_PAPER ("0836b67f-7f7b-f37b-c00a-460dc1521f5a");
|
||||
LLUUID const ANIM_AGENT_RPS_ROCK ("42dd95d5-0bc6-6392-f650-777304946c0f");
|
||||
LLUUID const ANIM_AGENT_RPS_SCISSORS ("16803a9f-5140-e042-4d7b-d28ba247c325");
|
||||
LLUUID const ANIM_AGENT_RUN ("05ddbff8-aaa9-92a1-2b74-8fe77a29b445");
|
||||
LLUUID const ANIM_AGENT_RUN_NEW ("1ab1b236-cd08-21e6-0cbc-0d923fc6eca2");
|
||||
LLUUID const ANIM_AGENT_SAD ("0eb702e2-cc5a-9a88-56a5-661a55c0676a");
|
||||
LLUUID const ANIM_AGENT_SALUTE ("cd7668a6-7011-d7e2-ead8-fc69eff1a104");
|
||||
LLUUID const ANIM_AGENT_SHOOT_BOW_L ("e04d450d-fdb5-0432-fd68-818aaf5935f8");
|
||||
LLUUID const ANIM_AGENT_SHOUT ("6bd01860-4ebd-127a-bb3d-d1427e8e0c42");
|
||||
LLUUID const ANIM_AGENT_SHRUG ("70ea714f-3a97-d742-1b01-590a8fcd1db5");
|
||||
LLUUID const ANIM_AGENT_SIT ("1a5fe8ac-a804-8a5d-7cbd-56bd83184568");
|
||||
LLUUID const ANIM_AGENT_SIT_FEMALE ("b1709c8d-ecd3-54a1-4f28-d55ac0840782");
|
||||
LLUUID const ANIM_AGENT_SIT_GENERIC ("245f3c54-f1c0-bf2e-811f-46d8eeb386e7");
|
||||
LLUUID const ANIM_AGENT_SIT_GROUND ("1c7600d6-661f-b87b-efe2-d7421eb93c86");
|
||||
LLUUID const ANIM_AGENT_SIT_GROUND_CONSTRAINED("1a2bd58e-87ff-0df8-0b4c-53e047b0bb6e");
|
||||
LLUUID const ANIM_AGENT_SIT_TO_STAND ("a8dee56f-2eae-9e7a-05a2-6fb92b97e21e");
|
||||
LLUUID const ANIM_AGENT_SLEEP ("f2bed5f9-9d44-39af-b0cd-257b2a17fe40");
|
||||
LLUUID const ANIM_AGENT_SMOKE_IDLE ("d2f2ee58-8ad1-06c9-d8d3-3827ba31567a");
|
||||
LLUUID const ANIM_AGENT_SMOKE_INHALE ("6802d553-49da-0778-9f85-1599a2266526");
|
||||
LLUUID const ANIM_AGENT_SMOKE_THROW_DOWN ("0a9fb970-8b44-9114-d3a9-bf69cfe804d6");
|
||||
LLUUID const ANIM_AGENT_SNAPSHOT ("eae8905b-271a-99e2-4c0e-31106afd100c");
|
||||
LLUUID const ANIM_AGENT_STAND ("2408fe9e-df1d-1d7d-f4ff-1384fa7b350f");
|
||||
LLUUID const ANIM_AGENT_STANDUP ("3da1d753-028a-5446-24f3-9c9b856d9422");
|
||||
LLUUID const ANIM_AGENT_STAND_1 ("15468e00-3400-bb66-cecc-646d7c14458e");
|
||||
LLUUID const ANIM_AGENT_STAND_2 ("370f3a20-6ca6-9971-848c-9a01bc42ae3c");
|
||||
LLUUID const ANIM_AGENT_STAND_3 ("42b46214-4b44-79ae-deb8-0df61424ff4b");
|
||||
LLUUID const ANIM_AGENT_STAND_4 ("f22fed8b-a5ed-2c93-64d5-bdd8b93c889f");
|
||||
LLUUID const ANIM_AGENT_STRETCH ("80700431-74ec-a008-14f8-77575e73693f");
|
||||
LLUUID const ANIM_AGENT_STRIDE ("1cb562b0-ba21-2202-efb3-30f82cdf9595");
|
||||
LLUUID const ANIM_AGENT_SURF ("41426836-7437-7e89-025d-0aa4d10f1d69");
|
||||
LLUUID const ANIM_AGENT_SURPRISE ("313b9881-4302-73c0-c7d0-0e7a36b6c224");
|
||||
LLUUID const ANIM_AGENT_SWORD_STRIKE ("85428680-6bf9-3e64-b489-6f81087c24bd");
|
||||
LLUUID const ANIM_AGENT_TALK ("5c682a95-6da4-a463-0bf6-0f5b7be129d1");
|
||||
LLUUID const ANIM_AGENT_TANTRUM ("11000694-3f41-adc2-606b-eee1d66f3724");
|
||||
LLUUID const ANIM_AGENT_THROW_R ("aa134404-7dac-7aca-2cba-435f9db875ca");
|
||||
LLUUID const ANIM_AGENT_TRYON_SHIRT ("83ff59fe-2346-f236-9009-4e3608af64c1");
|
||||
LLUUID const ANIM_AGENT_TURNLEFT ("56e0ba0d-4a9f-7f27-6117-32f2ebbf6135");
|
||||
LLUUID const ANIM_AGENT_TURNRIGHT ("2d6daa51-3192-6794-8e2e-a15f8338ec30");
|
||||
LLUUID const ANIM_AGENT_TYPE ("c541c47f-e0c0-058b-ad1a-d6ae3a4584d9");
|
||||
LLUUID const ANIM_AGENT_WALK ("6ed24bd8-91aa-4b12-ccc7-c97c857ab4e0");
|
||||
LLUUID const ANIM_AGENT_WALK_NEW ("33339176-7ddc-9397-94a4-bf3403cbc8f5");
|
||||
LLUUID const ANIM_AGENT_WHISPER ("7693f268-06c7-ea71-fa21-2b30d6533f8f");
|
||||
LLUUID const ANIM_AGENT_WHISTLE ("b1ed7982-c68e-a982-7561-52a88a5298c0");
|
||||
LLUUID const ANIM_AGENT_WINK ("869ecdad-a44b-671e-3266-56aef2e3ac2e");
|
||||
LLUUID const ANIM_AGENT_WINK_HOLLYWOOD ("c0c4030f-c02b-49de-24ba-2331f43fe41c");
|
||||
LLUUID const ANIM_AGENT_WORRY ("9f496bd2-589a-709f-16cc-69bf7df1d36c");
|
||||
LLUUID const ANIM_AGENT_YES ("15dd911d-be82-2856-26db-27659b142875");
|
||||
LLUUID const ANIM_AGENT_YES_HAPPY ("b8c8b2a3-9008-1771-3bfc-90924955ab2d");
|
||||
LLUUID const ANIM_AGENT_YOGA_FLOAT ("42ecd00b-9947-a97c-400a-bbc9174c7aeb");
|
||||
|
||||
LLUUID AGENT_WALK_ANIMS[] = {ANIM_AGENT_WALK, ANIM_AGENT_RUN, ANIM_AGENT_CROUCHWALK, ANIM_AGENT_TURNLEFT, ANIM_AGENT_TURNRIGHT};
|
||||
S32 NUM_AGENT_WALK_ANIMS = LL_ARRAY_SIZE(AGENT_WALK_ANIMS);
|
||||
|
|
|
|||
|
|
@ -33,6 +33,7 @@ set(llcommon_SOURCE_FILES
|
|||
llapp.cpp
|
||||
llapr.cpp
|
||||
llassettype.cpp
|
||||
llavatarname.cpp
|
||||
llbase32.cpp
|
||||
llbase64.cpp
|
||||
llcommon.cpp
|
||||
|
|
@ -69,6 +70,7 @@ set(llcommon_SOURCE_FILES
|
|||
llmemorystream.cpp
|
||||
llmemtype.cpp
|
||||
llmetrics.cpp
|
||||
llmetricperformancetester.cpp
|
||||
llmortician.cpp
|
||||
lloptioninterface.cpp
|
||||
llptrto.cpp
|
||||
|
|
@ -91,6 +93,7 @@ set(llcommon_SOURCE_FILES
|
|||
llstringtable.cpp
|
||||
llsys.cpp
|
||||
llthread.cpp
|
||||
llthreadsafequeue.cpp
|
||||
lltimer.cpp
|
||||
lluri.cpp
|
||||
lluuid.cpp
|
||||
|
|
@ -115,6 +118,7 @@ set(llcommon_HEADER_FILES
|
|||
llallocator.h
|
||||
llallocator_heap_profile.h
|
||||
llagentconstants.h
|
||||
llavatarname.h
|
||||
llapp.h
|
||||
llapr.h
|
||||
llassettype.h
|
||||
|
|
@ -184,6 +188,7 @@ set(llcommon_HEADER_FILES
|
|||
llmemorystream.h
|
||||
llmemtype.h
|
||||
llmetrics.h
|
||||
llmetricperformancetester.h
|
||||
llmortician.h
|
||||
llnametable.h
|
||||
lloptioninterface.h
|
||||
|
|
@ -221,6 +226,7 @@ set(llcommon_HEADER_FILES
|
|||
llstringtable.h
|
||||
llsys.h
|
||||
llthread.h
|
||||
llthreadsafequeue.h
|
||||
lltimer.h
|
||||
lltreeiterators.h
|
||||
lluri.h
|
||||
|
|
|
|||
|
|
@ -245,9 +245,6 @@ const U8 SIM_ACCESS_ADULT = 42; // Seriously Adult Only
|
|||
const U8 SIM_ACCESS_DOWN = 254;
|
||||
const U8 SIM_ACCESS_MAX = SIM_ACCESS_ADULT;
|
||||
|
||||
// group constants
|
||||
const S32 MAX_AGENT_GROUPS = 25;
|
||||
|
||||
// attachment constants
|
||||
const S32 MAX_AGENT_ATTACHMENTS = 38;
|
||||
const U8 ATTACHMENT_ADD = 0x80;
|
||||
|
|
@ -300,6 +297,14 @@ const U32 START_LOCATION_ID_COUNT = 6;
|
|||
// group constants
|
||||
const U32 GROUP_MIN_SIZE = 2;
|
||||
|
||||
// gMaxAgentGroups is now sent by login.cgi, which
|
||||
// looks it up from globals.xml.
|
||||
//
|
||||
// For now we need an old default value however,
|
||||
// so the viewer can be deployed ahead of login.cgi.
|
||||
//
|
||||
const S32 DEFAULT_MAX_AGENT_GROUPS = 25;
|
||||
|
||||
// radius within which a chat message is fully audible
|
||||
const F32 CHAT_WHISPER_RADIUS = 10.f;
|
||||
const F32 CHAT_NORMAL_RADIUS = 20.f;
|
||||
|
|
|
|||
|
|
@ -90,6 +90,10 @@ S32 LL_HEARTBEAT_SIGNAL = (SIGRTMAX >= 0) ? (SIGRTMAX-0) : SIGUSR2;
|
|||
// the static application instance
|
||||
LLApp* LLApp::sApplication = NULL;
|
||||
|
||||
// Allows the generation of core files for post mortem under gdb
|
||||
// and disables crashlogger
|
||||
BOOL LLApp::sDisableCrashlogger = FALSE;
|
||||
|
||||
// Local flag for whether or not to do logging in signal handlers.
|
||||
//static
|
||||
BOOL LLApp::sLogInSignal = FALSE;
|
||||
|
|
@ -461,11 +465,30 @@ bool LLApp::isQuitting()
|
|||
return (APP_STATUS_QUITTING == sStatus);
|
||||
}
|
||||
|
||||
// static
|
||||
bool LLApp::isExiting()
|
||||
{
|
||||
return isQuitting() || isError();
|
||||
}
|
||||
|
||||
void LLApp::disableCrashlogger()
|
||||
{
|
||||
// Disable Breakpad exception handler.
|
||||
if (mExceptionHandler != 0)
|
||||
{
|
||||
delete mExceptionHandler;
|
||||
mExceptionHandler = 0;
|
||||
}
|
||||
|
||||
sDisableCrashlogger = TRUE;
|
||||
}
|
||||
|
||||
// static
|
||||
bool LLApp::isCrashloggerDisabled()
|
||||
{
|
||||
return (sDisableCrashlogger == TRUE);
|
||||
}
|
||||
|
||||
#if !LL_WINDOWS
|
||||
// static
|
||||
U32 LLApp::getSigChildCount()
|
||||
|
|
@ -799,6 +822,15 @@ void default_unix_signal_handler(int signum, siginfo_t *info, void *)
|
|||
{
|
||||
llwarns << "Signal handler - Flagging error status and waiting for shutdown" << llendl;
|
||||
}
|
||||
|
||||
if (LLApp::isCrashloggerDisabled()) // Don't gracefully handle any signal, crash and core for a gdb post mortem
|
||||
{
|
||||
clear_signals();
|
||||
llwarns << "Fatal signal received, not handling the crash here, passing back to operating system" << llendl;
|
||||
raise(signum);
|
||||
return;
|
||||
}
|
||||
|
||||
// Flag status to ERROR, so thread_error does its work.
|
||||
LLApp::setError();
|
||||
// Block in the signal handler until somebody says that we're done.
|
||||
|
|
|
|||
|
|
@ -189,6 +189,11 @@ public:
|
|||
//
|
||||
virtual bool mainLoop() = 0; // Override for the application main loop. Needs to at least gracefully notice the QUITTING state and exit.
|
||||
|
||||
//
|
||||
// Crash logging
|
||||
//
|
||||
void disableCrashlogger(); // Let the OS handle the crashes
|
||||
static bool isCrashloggerDisabled(); // Get the here above set value
|
||||
|
||||
//
|
||||
// Application status
|
||||
|
|
@ -280,6 +285,7 @@ protected:
|
|||
static void setStatus(EAppStatus status); // Use this to change the application status.
|
||||
static EAppStatus sStatus; // Reflects current application status
|
||||
static BOOL sErrorThreadRunning; // Set while the error thread is running
|
||||
static BOOL sDisableCrashlogger; // Let the OS handle crashes for us.
|
||||
|
||||
#if !LL_WINDOWS
|
||||
static LLAtomicU32* sSigChildCount; // Number of SIGCHLDs received.
|
||||
|
|
|
|||
|
|
@ -28,6 +28,7 @@
|
|||
|
||||
#include "linden_common.h"
|
||||
#include "llapr.h"
|
||||
#include "apr_dso.h"
|
||||
|
||||
apr_pool_t *gAPRPoolp = NULL; // Global APR memory pool
|
||||
LLVolatileAPRPool *LLAPRFile::sAPRFilePoolp = NULL ; //global volatile APR memory pool.
|
||||
|
|
@ -279,14 +280,31 @@ bool ll_apr_warn_status(apr_status_t status)
|
|||
{
|
||||
if(APR_SUCCESS == status) return false;
|
||||
char buf[MAX_STRING]; /* Flawfinder: ignore */
|
||||
apr_strerror(status, buf, MAX_STRING);
|
||||
apr_strerror(status, buf, sizeof(buf));
|
||||
LL_WARNS("APR") << "APR: " << buf << LL_ENDL;
|
||||
return true;
|
||||
}
|
||||
|
||||
bool ll_apr_warn_status(apr_status_t status, apr_dso_handle_t *handle)
|
||||
{
|
||||
bool result = ll_apr_warn_status(status);
|
||||
// Despite observed truncation of actual Mac dylib load errors, increasing
|
||||
// this buffer to more than MAX_STRING doesn't help: it appears that APR
|
||||
// stores the output in a fixed 255-character internal buffer. (*sigh*)
|
||||
char buf[MAX_STRING]; /* Flawfinder: ignore */
|
||||
apr_dso_error(handle, buf, sizeof(buf));
|
||||
LL_WARNS("APR") << "APR: " << buf << LL_ENDL;
|
||||
return result;
|
||||
}
|
||||
|
||||
void ll_apr_assert_status(apr_status_t status)
|
||||
{
|
||||
llassert(ll_apr_warn_status(status) == false);
|
||||
llassert(! ll_apr_warn_status(status));
|
||||
}
|
||||
|
||||
void ll_apr_assert_status(apr_status_t status, apr_dso_handle_t *handle)
|
||||
{
|
||||
llassert(! ll_apr_warn_status(status, handle));
|
||||
}
|
||||
|
||||
//---------------------------------------------------------------------
|
||||
|
|
|
|||
|
|
@ -53,6 +53,8 @@
|
|||
extern LL_COMMON_API apr_thread_mutex_t* gLogMutexp;
|
||||
extern apr_thread_mutex_t* gCallStacksLogMutexp;
|
||||
|
||||
struct apr_dso_handle_t;
|
||||
|
||||
/**
|
||||
* @brief initialize the common apr constructs -- apr itself, the
|
||||
* global pool, and a mutex.
|
||||
|
|
@ -259,8 +261,11 @@ public:
|
|||
* @return Returns <code>true</code> if status is an error condition.
|
||||
*/
|
||||
bool LL_COMMON_API ll_apr_warn_status(apr_status_t status);
|
||||
/// There's a whole other APR error-message function if you pass a DSO handle.
|
||||
bool LL_COMMON_API ll_apr_warn_status(apr_status_t status, apr_dso_handle_t* handle);
|
||||
|
||||
void LL_COMMON_API ll_apr_assert_status(apr_status_t status);
|
||||
void LL_COMMON_API ll_apr_assert_status(apr_status_t status, apr_dso_handle_t* handle);
|
||||
|
||||
extern "C" LL_COMMON_API apr_pool_t* gAPRPoolp; // Global APR memory pool
|
||||
|
||||
|
|
|
|||
|
|
@ -46,10 +46,10 @@ const U32 AVATAR_TRANSACTED = 0x1 << 3; // whether avatar has actively used p
|
|||
const U32 AVATAR_ONLINE = 0x1 << 4; // the online status of this avatar, if known.
|
||||
const U32 AVATAR_AGEVERIFIED = 0x1 << 5; // whether avatar has been age-verified
|
||||
|
||||
static const std::string VISIBILITY_DEFAULT("default");
|
||||
static const std::string VISIBILITY_HIDDEN("hidden");
|
||||
static const std::string VISIBILITY_VISIBLE("visible");
|
||||
static const std::string VISIBILITY_INVISIBLE("invisible");
|
||||
char const* const VISIBILITY_DEFAULT = "default";
|
||||
char const* const VISIBILITY_HIDDEN = "hidden";
|
||||
char const* const VISIBILITY_VISIBLE = "visible";
|
||||
char const* const VISIBILITY_INVISIBLE = "invisible";
|
||||
|
||||
#endif
|
||||
|
||||
|
|
|
|||
|
|
@ -0,0 +1,113 @@
|
|||
/**
|
||||
* @file llavatarname.cpp
|
||||
* @brief Represents name-related data for an avatar, such as the
|
||||
* username/SLID ("bobsmith123" or "james.linden") and the display
|
||||
* name ("James Cook")
|
||||
*
|
||||
* $LicenseInfo:firstyear=2010&license=viewerlgpl$
|
||||
* Second Life Viewer Source Code
|
||||
* Copyright (C) 2010, Linden Research, Inc.
|
||||
*
|
||||
* This library is free software; you can redistribute it and/or
|
||||
* modify it under the terms of the GNU Lesser General Public
|
||||
* License as published by the Free Software Foundation;
|
||||
* version 2.1 of the License only.
|
||||
*
|
||||
* This library is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
* Lesser General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU Lesser General Public
|
||||
* License along with this library; if not, write to the Free Software
|
||||
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
|
||||
*
|
||||
* Linden Research, Inc., 945 Battery Street, San Francisco, CA 94111 USA
|
||||
* $/LicenseInfo$
|
||||
*/
|
||||
#include "linden_common.h"
|
||||
|
||||
#include "llavatarname.h"
|
||||
|
||||
#include "lldate.h"
|
||||
#include "llsd.h"
|
||||
|
||||
// Store these in pre-built std::strings to avoid memory allocations in
|
||||
// LLSD map lookups
|
||||
static const std::string USERNAME("username");
|
||||
static const std::string DISPLAY_NAME("display_name");
|
||||
static const std::string LEGACY_FIRST_NAME("legacy_first_name");
|
||||
static const std::string LEGACY_LAST_NAME("legacy_last_name");
|
||||
static const std::string IS_DISPLAY_NAME_DEFAULT("is_display_name_default");
|
||||
static const std::string DISPLAY_NAME_EXPIRES("display_name_expires");
|
||||
static const std::string DISPLAY_NAME_NEXT_UPDATE("display_name_next_update");
|
||||
|
||||
LLAvatarName::LLAvatarName()
|
||||
: mUsername(),
|
||||
mDisplayName(),
|
||||
mLegacyFirstName(),
|
||||
mLegacyLastName(),
|
||||
mIsDisplayNameDefault(false),
|
||||
mIsTemporaryName(false),
|
||||
mExpires(F64_MAX),
|
||||
mNextUpdate(0.0)
|
||||
{ }
|
||||
|
||||
bool LLAvatarName::operator<(const LLAvatarName& rhs) const
|
||||
{
|
||||
if (mUsername == rhs.mUsername)
|
||||
return mDisplayName < rhs.mDisplayName;
|
||||
else
|
||||
return mUsername < rhs.mUsername;
|
||||
}
|
||||
|
||||
LLSD LLAvatarName::asLLSD() const
|
||||
{
|
||||
LLSD sd;
|
||||
sd[USERNAME] = mUsername;
|
||||
sd[DISPLAY_NAME] = mDisplayName;
|
||||
sd[LEGACY_FIRST_NAME] = mLegacyFirstName;
|
||||
sd[LEGACY_LAST_NAME] = mLegacyLastName;
|
||||
sd[IS_DISPLAY_NAME_DEFAULT] = mIsDisplayNameDefault;
|
||||
sd[DISPLAY_NAME_EXPIRES] = LLDate(mExpires);
|
||||
sd[DISPLAY_NAME_NEXT_UPDATE] = LLDate(mNextUpdate);
|
||||
return sd;
|
||||
}
|
||||
|
||||
void LLAvatarName::fromLLSD(const LLSD& sd)
|
||||
{
|
||||
mUsername = sd[USERNAME].asString();
|
||||
mDisplayName = sd[DISPLAY_NAME].asString();
|
||||
mLegacyFirstName = sd[LEGACY_FIRST_NAME].asString();
|
||||
mLegacyLastName = sd[LEGACY_LAST_NAME].asString();
|
||||
mIsDisplayNameDefault = sd[IS_DISPLAY_NAME_DEFAULT].asBoolean();
|
||||
LLDate expires = sd[DISPLAY_NAME_EXPIRES];
|
||||
mExpires = expires.secondsSinceEpoch();
|
||||
LLDate next_update = sd[DISPLAY_NAME_NEXT_UPDATE];
|
||||
mNextUpdate = next_update.secondsSinceEpoch();
|
||||
}
|
||||
|
||||
std::string LLAvatarName::getCompleteName() const
|
||||
{
|
||||
std::string name;
|
||||
if (!mUsername.empty())
|
||||
{
|
||||
name = mDisplayName + " (" + mUsername + ")";
|
||||
}
|
||||
else
|
||||
{
|
||||
// ...display names are off, legacy name is in mDisplayName
|
||||
name = mDisplayName;
|
||||
}
|
||||
return name;
|
||||
}
|
||||
|
||||
std::string LLAvatarName::getLegacyName() const
|
||||
{
|
||||
std::string name;
|
||||
name.reserve( mLegacyFirstName.size() + 1 + mLegacyLastName.size() );
|
||||
name = mLegacyFirstName;
|
||||
name += " ";
|
||||
name += mLegacyLastName;
|
||||
return name;
|
||||
}
|
||||
|
|
@ -0,0 +1,95 @@
|
|||
/**
|
||||
* @file llavatarname.h
|
||||
* @brief Represents name-related data for an avatar, such as the
|
||||
* username/SLID ("bobsmith123" or "james.linden") and the display
|
||||
* name ("James Cook")
|
||||
*
|
||||
* $LicenseInfo:firstyear=2010&license=viewerlgpl$
|
||||
* Second Life Viewer Source Code
|
||||
* Copyright (C) 2010, Linden Research, Inc.
|
||||
*
|
||||
* This library is free software; you can redistribute it and/or
|
||||
* modify it under the terms of the GNU Lesser General Public
|
||||
* License as published by the Free Software Foundation;
|
||||
* version 2.1 of the License only.
|
||||
*
|
||||
* This library is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
* Lesser General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU Lesser General Public
|
||||
* License along with this library; if not, write to the Free Software
|
||||
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
|
||||
*
|
||||
* Linden Research, Inc., 945 Battery Street, San Francisco, CA 94111 USA
|
||||
* $/LicenseInfo$
|
||||
*/
|
||||
#ifndef LLAVATARNAME_H
|
||||
#define LLAVATARNAME_H
|
||||
|
||||
#include <string>
|
||||
|
||||
class LLSD;
|
||||
|
||||
class LL_COMMON_API LLAvatarName
|
||||
{
|
||||
public:
|
||||
LLAvatarName();
|
||||
|
||||
bool operator<(const LLAvatarName& rhs) const;
|
||||
|
||||
LLSD asLLSD() const;
|
||||
|
||||
void fromLLSD(const LLSD& sd);
|
||||
|
||||
// For normal names, returns "James Linden (james.linden)"
|
||||
// When display names are disabled returns just "James Linden"
|
||||
std::string getCompleteName() const;
|
||||
|
||||
// Returns "James Linden" or "bobsmith123 Resident" for backwards
|
||||
// compatibility with systems like voice and muting
|
||||
// *TODO: Eliminate this in favor of username only
|
||||
std::string getLegacyName() const;
|
||||
|
||||
// "bobsmith123" or "james.linden", US-ASCII only
|
||||
std::string mUsername;
|
||||
|
||||
// "Jose' Sanchez" or "James Linden", UTF-8 encoded Unicode
|
||||
// Contains data whether or not user has explicitly set
|
||||
// a display name; may duplicate their username.
|
||||
std::string mDisplayName;
|
||||
|
||||
// For "James Linden", "James"
|
||||
// For "bobsmith123", "bobsmith123"
|
||||
// Used to communicate with legacy systems like voice and muting which
|
||||
// rely on old-style names.
|
||||
// *TODO: Eliminate this in favor of username only
|
||||
std::string mLegacyFirstName;
|
||||
|
||||
// For "James Linden", "Linden"
|
||||
// For "bobsmith123", "Resident"
|
||||
// see above for rationale
|
||||
std::string mLegacyLastName;
|
||||
|
||||
// If true, both display name and SLID were generated from
|
||||
// a legacy first and last name, like "James Linden (james.linden)"
|
||||
bool mIsDisplayNameDefault;
|
||||
|
||||
// Under error conditions, we may insert "dummy" records with
|
||||
// names like "???" into caches as placeholders. These can be
|
||||
// shown in UI, but are not serialized.
|
||||
bool mIsTemporaryName;
|
||||
|
||||
// Names can change, so need to keep track of when name was
|
||||
// last checked.
|
||||
// Unix time-from-epoch seconds for efficiency
|
||||
F64 mExpires;
|
||||
|
||||
// You can only change your name every N hours, so record
|
||||
// when the next update is allowed
|
||||
// Unix time-from-epoch seconds
|
||||
F64 mNextUpdate;
|
||||
};
|
||||
|
||||
#endif
|
||||
|
|
@ -28,7 +28,6 @@
|
|||
#ifndef LL_LLCHAT_H
|
||||
#define LL_LLCHAT_H
|
||||
|
||||
#include "llstring.h"
|
||||
#include "lluuid.h"
|
||||
#include "v3math.h"
|
||||
|
||||
|
|
@ -71,7 +70,7 @@ typedef enum e_chat_style
|
|||
class LLChat
|
||||
{
|
||||
public:
|
||||
LLChat(const std::string& text = LLStringUtil::null)
|
||||
LLChat(const std::string& text = std::string())
|
||||
: mText(text),
|
||||
mFromName(),
|
||||
mFromID(),
|
||||
|
|
|
|||
|
|
@ -51,7 +51,7 @@ public:
|
|||
|
||||
LLDynamicArray(S32 size=0) : std::vector<Type>(size) { if (size < BlockSize) std::vector<Type>::reserve(BlockSize); }
|
||||
|
||||
void reset() { std::vector<Type>::resize(0); }
|
||||
void reset() { std::vector<Type>::clear(); }
|
||||
|
||||
// ACCESSORS
|
||||
const Type& get(S32 index) const { return std::vector<Type>::operator[](index); }
|
||||
|
|
|
|||
|
|
@ -78,7 +78,9 @@ protected:
|
|||
virtual Index notFound() const
|
||||
{
|
||||
// default is to assert
|
||||
llassert(false);
|
||||
// don't assert -- makes it impossible to work on mesh-development and viewer-development simultaneously
|
||||
// -- davep 2010.10.29
|
||||
//llassert(false);
|
||||
return Index(-1);
|
||||
}
|
||||
void addEntry(Index index, Entry *entry)
|
||||
|
|
|
|||
|
|
@ -475,7 +475,7 @@ void LLEventPump::stopListening(const std::string& name)
|
|||
*****************************************************************************/
|
||||
bool LLEventStream::post(const LLSD& event)
|
||||
{
|
||||
if (! mEnabled)
|
||||
if (! mEnabled || !mSignal)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
|
@ -515,6 +515,8 @@ bool LLEventQueue::post(const LLSD& event)
|
|||
|
||||
void LLEventQueue::flush()
|
||||
{
|
||||
if(!mSignal) return;
|
||||
|
||||
// Consider the case when a given listener on this LLEventQueue posts yet
|
||||
// another event on the same queue. If we loop over mEventQueue directly,
|
||||
// we'll end up processing all those events during the same flush() call
|
||||
|
|
|
|||
|
|
@ -56,6 +56,7 @@ bool LLFastTimer::sPauseHistory = 0;
|
|||
bool LLFastTimer::sResetHistory = 0;
|
||||
LLFastTimer::CurTimerData LLFastTimer::sCurTimerData;
|
||||
BOOL LLFastTimer::sLog = FALSE;
|
||||
std::string LLFastTimer::sLogName = "";
|
||||
BOOL LLFastTimer::sMetricLog = FALSE;
|
||||
LLMutex* LLFastTimer::sLogLock = NULL;
|
||||
std::queue<LLSD> LLFastTimer::sLogQueue;
|
||||
|
|
|
|||
|
|
@ -211,6 +211,7 @@ public:
|
|||
static std::queue<LLSD> sLogQueue;
|
||||
static BOOL sLog;
|
||||
static BOOL sMetricLog;
|
||||
static std::string sLogName;
|
||||
static bool sPauseHistory;
|
||||
static bool sResetHistory;
|
||||
static U64 sTimerCycles;
|
||||
|
|
|
|||
|
|
@ -92,6 +92,17 @@ LLFILE* LLFile::_fsopen(const std::string& filename, const char* mode, int shari
|
|||
#endif
|
||||
}
|
||||
|
||||
int LLFile::close(LLFILE * file)
|
||||
{
|
||||
int ret_value = 0;
|
||||
if (file)
|
||||
{
|
||||
ret_value = fclose(file);
|
||||
}
|
||||
return ret_value;
|
||||
}
|
||||
|
||||
|
||||
int LLFile::remove(const std::string& filename)
|
||||
{
|
||||
#if LL_WINDOWS
|
||||
|
|
@ -318,7 +329,12 @@ void llofstream::close()
|
|||
if(is_open())
|
||||
{
|
||||
if (_Filebuffer->close() == 0)
|
||||
{
|
||||
_Myios::setstate(ios_base::failbit); /*Flawfinder: ignore*/
|
||||
}
|
||||
delete _Filebuffer;
|
||||
_Filebuffer = NULL;
|
||||
_ShouldClose = false;
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -71,6 +71,8 @@ public:
|
|||
static LLFILE* fopen(const std::string& filename,const char* accessmode); /* Flawfinder: ignore */
|
||||
static LLFILE* _fsopen(const std::string& filename,const char* accessmode,int sharingFlag);
|
||||
|
||||
static int close(LLFILE * file);
|
||||
|
||||
// perms is a permissions mask like 0777 or 0700. In most cases it will
|
||||
// be overridden by the user's umask. It is ignored on Windows.
|
||||
static int mkdir(const std::string& filename, int perms = 0700);
|
||||
|
|
|
|||
|
|
@ -181,7 +181,7 @@ const S32 OBJECT_GROUP = 7;
|
|||
const S32 OBJECT_CREATOR = 8;
|
||||
|
||||
// llTextBox() magic token string - yes this is a hack. sue me.
|
||||
const std::string TEXTBOX_MAGIC_TOKEN = "!!llTextBox!!";
|
||||
char const* const TEXTBOX_MAGIC_TOKEN = "!!llTextBox!!";
|
||||
|
||||
// changed() event flags
|
||||
const U32 CHANGED_NONE = 0x0;
|
||||
|
|
|
|||
|
|
@ -26,7 +26,11 @@
|
|||
|
||||
#include "linden_common.h"
|
||||
|
||||
|
||||
//#if MEM_TRACK_MEM
|
||||
#include "llthread.h"
|
||||
//#endif
|
||||
|
||||
#if defined(LL_WINDOWS)
|
||||
//# include <windows.h>
|
||||
# include <psapi.h>
|
||||
|
|
@ -39,9 +43,9 @@
|
|||
#endif
|
||||
|
||||
#include "llmemory.h"
|
||||
|
||||
#include "llsys.h"
|
||||
#include "llframetimer.h"
|
||||
|
||||
//----------------------------------------------------------------------------
|
||||
|
||||
//static
|
||||
|
|
@ -239,6 +243,20 @@ U64 LLMemory::getCurrentRSS()
|
|||
return counters.WorkingSetSize;
|
||||
}
|
||||
|
||||
//static
|
||||
U32 LLMemory::getWorkingSetSize()
|
||||
{
|
||||
PROCESS_MEMORY_COUNTERS pmc ;
|
||||
U32 ret = 0 ;
|
||||
|
||||
if (GetProcessMemoryInfo( GetCurrentProcess(), &pmc, sizeof(pmc)) )
|
||||
{
|
||||
ret = pmc.WorkingSetSize ;
|
||||
}
|
||||
|
||||
return ret ;
|
||||
}
|
||||
|
||||
#elif defined(LL_DARWIN)
|
||||
|
||||
/*
|
||||
|
|
@ -285,6 +303,11 @@ U64 LLMemory::getCurrentRSS()
|
|||
return residentSize;
|
||||
}
|
||||
|
||||
U32 LLMemory::getWorkingSetSize()
|
||||
{
|
||||
return 0 ;
|
||||
}
|
||||
|
||||
#elif defined(LL_LINUX)
|
||||
|
||||
U64 LLMemory::getCurrentRSS()
|
||||
|
|
@ -319,6 +342,11 @@ bail:
|
|||
return rss;
|
||||
}
|
||||
|
||||
U32 LLMemory::getWorkingSetSize()
|
||||
{
|
||||
return 0 ;
|
||||
}
|
||||
|
||||
#elif LL_SOLARIS
|
||||
#include <sys/types.h>
|
||||
#include <sys/stat.h>
|
||||
|
|
@ -347,6 +375,12 @@ U64 LLMemory::getCurrentRSS()
|
|||
|
||||
return((U64)proc_psinfo.pr_rssize * 1024);
|
||||
}
|
||||
|
||||
U32 LLMemory::getWorkingSetSize()
|
||||
{
|
||||
return 0 ;
|
||||
}
|
||||
|
||||
#else
|
||||
|
||||
U64 LLMemory::getCurrentRSS()
|
||||
|
|
@ -354,8 +388,148 @@ U64 LLMemory::getCurrentRSS()
|
|||
return 0;
|
||||
}
|
||||
|
||||
U32 LLMemory::getWorkingSetSize()
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
|
||||
#endif
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
#if MEM_TRACK_MEM
|
||||
#include "llframetimer.h"
|
||||
|
||||
//static
|
||||
LLMemTracker* LLMemTracker::sInstance = NULL ;
|
||||
|
||||
LLMemTracker::LLMemTracker()
|
||||
{
|
||||
mLastAllocatedMem = LLMemory::getWorkingSetSize() ;
|
||||
mCapacity = 128 ;
|
||||
mCurIndex = 0 ;
|
||||
mCounter = 0 ;
|
||||
mDrawnIndex = 0 ;
|
||||
mPaused = FALSE ;
|
||||
|
||||
mMutexp = new LLMutex(NULL) ;
|
||||
mStringBuffer = new char*[128] ;
|
||||
mStringBuffer[0] = new char[mCapacity * 128] ;
|
||||
for(S32 i = 1 ; i < mCapacity ; i++)
|
||||
{
|
||||
mStringBuffer[i] = mStringBuffer[i-1] + 128 ;
|
||||
}
|
||||
}
|
||||
|
||||
LLMemTracker::~LLMemTracker()
|
||||
{
|
||||
delete[] mStringBuffer[0] ;
|
||||
delete[] mStringBuffer;
|
||||
delete mMutexp ;
|
||||
}
|
||||
|
||||
//static
|
||||
LLMemTracker* LLMemTracker::getInstance()
|
||||
{
|
||||
if(!sInstance)
|
||||
{
|
||||
sInstance = new LLMemTracker() ;
|
||||
}
|
||||
return sInstance ;
|
||||
}
|
||||
|
||||
//static
|
||||
void LLMemTracker::release()
|
||||
{
|
||||
if(sInstance)
|
||||
{
|
||||
delete sInstance ;
|
||||
sInstance = NULL ;
|
||||
}
|
||||
}
|
||||
|
||||
//static
|
||||
void LLMemTracker::track(const char* function, const int line)
|
||||
{
|
||||
static const S32 MIN_ALLOCATION = 0 ; //1KB
|
||||
|
||||
if(mPaused)
|
||||
{
|
||||
return ;
|
||||
}
|
||||
|
||||
U32 allocated_mem = LLMemory::getWorkingSetSize() ;
|
||||
|
||||
LLMutexLock lock(mMutexp) ;
|
||||
|
||||
S32 delta_mem = allocated_mem - mLastAllocatedMem ;
|
||||
mLastAllocatedMem = allocated_mem ;
|
||||
|
||||
if(delta_mem <= 0)
|
||||
{
|
||||
return ; //occupied memory does not grow
|
||||
}
|
||||
|
||||
if(delta_mem < MIN_ALLOCATION)
|
||||
{
|
||||
return ;
|
||||
}
|
||||
|
||||
char* buffer = mStringBuffer[mCurIndex++] ;
|
||||
F32 time = (F32)LLFrameTimer::getElapsedSeconds() ;
|
||||
S32 hours = (S32)(time / (60*60));
|
||||
S32 mins = (S32)((time - hours*(60*60)) / 60);
|
||||
S32 secs = (S32)((time - hours*(60*60) - mins*60));
|
||||
strcpy(buffer, function) ;
|
||||
sprintf(buffer + strlen(function), " line: %d DeltaMem: %d (bytes) Time: %d:%02d:%02d", line, delta_mem, hours,mins,secs) ;
|
||||
|
||||
if(mCounter < mCapacity)
|
||||
{
|
||||
mCounter++ ;
|
||||
}
|
||||
if(mCurIndex >= mCapacity)
|
||||
{
|
||||
mCurIndex = 0 ;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
//static
|
||||
void LLMemTracker::preDraw(BOOL pause)
|
||||
{
|
||||
mMutexp->lock() ;
|
||||
|
||||
mPaused = pause ;
|
||||
mDrawnIndex = mCurIndex - 1;
|
||||
mNumOfDrawn = 0 ;
|
||||
}
|
||||
|
||||
//static
|
||||
void LLMemTracker::postDraw()
|
||||
{
|
||||
mMutexp->unlock() ;
|
||||
}
|
||||
|
||||
//static
|
||||
const char* LLMemTracker::getNextLine()
|
||||
{
|
||||
if(mNumOfDrawn >= mCounter)
|
||||
{
|
||||
return NULL ;
|
||||
}
|
||||
mNumOfDrawn++;
|
||||
|
||||
if(mDrawnIndex < 0)
|
||||
{
|
||||
mDrawnIndex = mCapacity - 1 ;
|
||||
}
|
||||
|
||||
return mStringBuffer[mDrawnIndex--] ;
|
||||
}
|
||||
|
||||
#endif //MEM_TRACK_MEM
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
//minimum block sizes (page size) for small allocation, medium allocation, large allocation
|
||||
|
|
|
|||
|
|
@ -26,6 +26,7 @@
|
|||
#ifndef LLMEMORY_H
|
||||
#define LLMEMORY_H
|
||||
|
||||
#include "llmemtype.h"
|
||||
extern S32 gTotalDAlloc;
|
||||
extern S32 gTotalDAUse;
|
||||
extern S32 gDACount;
|
||||
|
|
@ -42,7 +43,7 @@ public:
|
|||
// Return the resident set size of the current process, in bytes.
|
||||
// Return value is zero if not known.
|
||||
static U64 getCurrentRSS();
|
||||
|
||||
static U32 getWorkingSetSize();
|
||||
static void* tryToAlloc(void* address, U32 size);
|
||||
static void initMaxHeapSizeGB(F32 max_heap_size_gb, BOOL prevent_heap_failure);
|
||||
static void updateMemoryInfo() ;
|
||||
|
|
@ -63,6 +64,51 @@ private:
|
|||
static BOOL sEnableMemoryFailurePrevention;
|
||||
};
|
||||
|
||||
//----------------------------------------------------------------------------
|
||||
#if MEM_TRACK_MEM
|
||||
class LLMutex ;
|
||||
class LL_COMMON_API LLMemTracker
|
||||
{
|
||||
private:
|
||||
LLMemTracker() ;
|
||||
~LLMemTracker() ;
|
||||
|
||||
public:
|
||||
static void release() ;
|
||||
static LLMemTracker* getInstance() ;
|
||||
|
||||
void track(const char* function, const int line) ;
|
||||
void preDraw(BOOL pause) ;
|
||||
void postDraw() ;
|
||||
const char* getNextLine() ;
|
||||
|
||||
private:
|
||||
static LLMemTracker* sInstance ;
|
||||
|
||||
char** mStringBuffer ;
|
||||
S32 mCapacity ;
|
||||
U32 mLastAllocatedMem ;
|
||||
S32 mCurIndex ;
|
||||
S32 mCounter;
|
||||
S32 mDrawnIndex;
|
||||
S32 mNumOfDrawn;
|
||||
BOOL mPaused;
|
||||
LLMutex* mMutexp ;
|
||||
};
|
||||
|
||||
#define MEM_TRACK_RELEASE LLMemTracker::release() ;
|
||||
#define MEM_TRACK LLMemTracker::getInstance()->track(__FUNCTION__, __LINE__) ;
|
||||
|
||||
#else // MEM_TRACK_MEM
|
||||
|
||||
#define MEM_TRACK_RELEASE
|
||||
#define MEM_TRACK
|
||||
|
||||
#endif // MEM_TRACK_MEM
|
||||
|
||||
//----------------------------------------------------------------------------
|
||||
|
||||
|
||||
//
|
||||
//class LLPrivateMemoryPool defines a private memory pool for an application to use, so the application does not
|
||||
//need to access the heap directly fro each memory allocation. Throught this, the allocation speed is faster,
|
||||
|
|
@ -195,7 +241,7 @@ public:
|
|||
void dump() ;
|
||||
U32 getTotalAllocatedSize() ;
|
||||
U32 getTotalReservedSize() {return mReservedPoolSize;}
|
||||
|
||||
|
||||
private:
|
||||
void lock() ;
|
||||
void unlock() ;
|
||||
|
|
|
|||
|
|
@ -229,3 +229,4 @@ char const * LLMemType::getNameFromID(S32 id)
|
|||
return DeclareMemType::mNameList[id];
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
|
|
|
|||
|
|
@ -0,0 +1,254 @@
|
|||
/**
|
||||
* @file llmetricperformancetester.cpp
|
||||
* @brief LLMetricPerformanceTesterBasic and LLMetricPerformanceTesterWithSession classes implementation
|
||||
*
|
||||
* $LicenseInfo:firstyear=2004&license=viewerlgpl$
|
||||
* Second Life Viewer Source Code
|
||||
* Copyright (C) 2010, Linden Research, Inc.
|
||||
*
|
||||
* This library is free software; you can redistribute it and/or
|
||||
* modify it under the terms of the GNU Lesser General Public
|
||||
* License as published by the Free Software Foundation;
|
||||
* version 2.1 of the License only.
|
||||
*
|
||||
* This library is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
* Lesser General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU Lesser General Public
|
||||
* License along with this library; if not, write to the Free Software
|
||||
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
|
||||
*
|
||||
* Linden Research, Inc., 945 Battery Street, San Francisco, CA 94111 USA
|
||||
* $/LicenseInfo$
|
||||
*/
|
||||
|
||||
#include "linden_common.h"
|
||||
|
||||
#include "indra_constants.h"
|
||||
#include "llerror.h"
|
||||
#include "llsdserialize.h"
|
||||
#include "llstat.h"
|
||||
#include "lltreeiterators.h"
|
||||
#include "llmetricperformancetester.h"
|
||||
|
||||
//----------------------------------------------------------------------------------------------
|
||||
// LLMetricPerformanceTesterBasic : static methods and testers management
|
||||
//----------------------------------------------------------------------------------------------
|
||||
|
||||
LLMetricPerformanceTesterBasic::name_tester_map_t LLMetricPerformanceTesterBasic::sTesterMap ;
|
||||
|
||||
/*static*/
|
||||
void LLMetricPerformanceTesterBasic::cleanClass()
|
||||
{
|
||||
for (name_tester_map_t::iterator iter = sTesterMap.begin() ; iter != sTesterMap.end() ; ++iter)
|
||||
{
|
||||
delete iter->second ;
|
||||
}
|
||||
sTesterMap.clear() ;
|
||||
}
|
||||
|
||||
/*static*/
|
||||
BOOL LLMetricPerformanceTesterBasic::addTester(LLMetricPerformanceTesterBasic* tester)
|
||||
{
|
||||
llassert_always(tester != NULL);
|
||||
std::string name = tester->getTesterName() ;
|
||||
if (getTester(name))
|
||||
{
|
||||
llerrs << "Tester name is already used by some other tester : " << name << llendl ;
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
sTesterMap.insert(std::make_pair(name, tester));
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
/*static*/
|
||||
LLMetricPerformanceTesterBasic* LLMetricPerformanceTesterBasic::getTester(std::string name)
|
||||
{
|
||||
// Check for the requested metric name
|
||||
name_tester_map_t::iterator found_it = sTesterMap.find(name) ;
|
||||
if (found_it != sTesterMap.end())
|
||||
{
|
||||
return found_it->second ;
|
||||
}
|
||||
return NULL ;
|
||||
}
|
||||
|
||||
/*static*/
|
||||
// Return TRUE if this metric is requested or if the general default "catch all" metric is requested
|
||||
BOOL LLMetricPerformanceTesterBasic::isMetricLogRequested(std::string name)
|
||||
{
|
||||
return (LLFastTimer::sMetricLog && ((LLFastTimer::sLogName == name) || (LLFastTimer::sLogName == DEFAULT_METRIC_NAME)));
|
||||
}
|
||||
|
||||
|
||||
//----------------------------------------------------------------------------------------------
|
||||
// LLMetricPerformanceTesterBasic : Tester instance methods
|
||||
//----------------------------------------------------------------------------------------------
|
||||
|
||||
LLMetricPerformanceTesterBasic::LLMetricPerformanceTesterBasic(std::string name) :
|
||||
mName(name),
|
||||
mCount(0)
|
||||
{
|
||||
if (mName == std::string())
|
||||
{
|
||||
llerrs << "LLMetricPerformanceTesterBasic construction invalid : Empty name passed to constructor" << llendl ;
|
||||
}
|
||||
|
||||
mValidInstance = LLMetricPerformanceTesterBasic::addTester(this) ;
|
||||
}
|
||||
|
||||
LLMetricPerformanceTesterBasic::~LLMetricPerformanceTesterBasic()
|
||||
{
|
||||
}
|
||||
|
||||
void LLMetricPerformanceTesterBasic::preOutputTestResults(LLSD* sd)
|
||||
{
|
||||
incrementCurrentCount() ;
|
||||
(*sd)[getCurrentLabelName()]["Name"] = mName ;
|
||||
}
|
||||
|
||||
void LLMetricPerformanceTesterBasic::postOutputTestResults(LLSD* sd)
|
||||
{
|
||||
LLMutexLock lock(LLFastTimer::sLogLock);
|
||||
LLFastTimer::sLogQueue.push((*sd));
|
||||
}
|
||||
|
||||
void LLMetricPerformanceTesterBasic::outputTestResults()
|
||||
{
|
||||
LLSD sd;
|
||||
|
||||
preOutputTestResults(&sd) ;
|
||||
outputTestRecord(&sd) ;
|
||||
postOutputTestResults(&sd) ;
|
||||
}
|
||||
|
||||
void LLMetricPerformanceTesterBasic::addMetric(std::string str)
|
||||
{
|
||||
mMetricStrings.push_back(str) ;
|
||||
}
|
||||
|
||||
/*virtual*/
|
||||
void LLMetricPerformanceTesterBasic::analyzePerformance(std::ofstream* os, LLSD* base, LLSD* current)
|
||||
{
|
||||
resetCurrentCount() ;
|
||||
|
||||
std::string current_label = getCurrentLabelName();
|
||||
BOOL in_base = (*base).has(current_label) ;
|
||||
BOOL in_current = (*current).has(current_label) ;
|
||||
|
||||
while(in_base || in_current)
|
||||
{
|
||||
LLSD::String label = current_label ;
|
||||
|
||||
if(in_base && in_current)
|
||||
{
|
||||
*os << llformat("%s\n", label.c_str()) ;
|
||||
|
||||
for(U32 index = 0 ; index < mMetricStrings.size() ; index++)
|
||||
{
|
||||
switch((*current)[label][ mMetricStrings[index] ].type())
|
||||
{
|
||||
case LLSD::TypeInteger:
|
||||
compareTestResults(os, mMetricStrings[index],
|
||||
(S32)((*base)[label][ mMetricStrings[index] ].asInteger()), (S32)((*current)[label][ mMetricStrings[index] ].asInteger())) ;
|
||||
break ;
|
||||
case LLSD::TypeReal:
|
||||
compareTestResults(os, mMetricStrings[index],
|
||||
(F32)((*base)[label][ mMetricStrings[index] ].asReal()), (F32)((*current)[label][ mMetricStrings[index] ].asReal())) ;
|
||||
break;
|
||||
default:
|
||||
llerrs << "unsupported metric " << mMetricStrings[index] << " LLSD type: " << (S32)(*current)[label][ mMetricStrings[index] ].type() << llendl ;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
incrementCurrentCount();
|
||||
current_label = getCurrentLabelName();
|
||||
in_base = (*base).has(current_label) ;
|
||||
in_current = (*current).has(current_label) ;
|
||||
}
|
||||
}
|
||||
|
||||
/*virtual*/
|
||||
void LLMetricPerformanceTesterBasic::compareTestResults(std::ofstream* os, std::string metric_string, S32 v_base, S32 v_current)
|
||||
{
|
||||
*os << llformat(" ,%s, %d, %d, %d, %.4f\n", metric_string.c_str(), v_base, v_current,
|
||||
v_current - v_base, (v_base != 0) ? 100.f * v_current / v_base : 0) ;
|
||||
}
|
||||
|
||||
/*virtual*/
|
||||
void LLMetricPerformanceTesterBasic::compareTestResults(std::ofstream* os, std::string metric_string, F32 v_base, F32 v_current)
|
||||
{
|
||||
*os << llformat(" ,%s, %.4f, %.4f, %.4f, %.4f\n", metric_string.c_str(), v_base, v_current,
|
||||
v_current - v_base, (fabs(v_base) > 0.0001f) ? 100.f * v_current / v_base : 0.f ) ;
|
||||
}
|
||||
|
||||
//----------------------------------------------------------------------------------------------
|
||||
// LLMetricPerformanceTesterWithSession
|
||||
//----------------------------------------------------------------------------------------------
|
||||
|
||||
LLMetricPerformanceTesterWithSession::LLMetricPerformanceTesterWithSession(std::string name) :
|
||||
LLMetricPerformanceTesterBasic(name),
|
||||
mBaseSessionp(NULL),
|
||||
mCurrentSessionp(NULL)
|
||||
{
|
||||
}
|
||||
|
||||
LLMetricPerformanceTesterWithSession::~LLMetricPerformanceTesterWithSession()
|
||||
{
|
||||
if (mBaseSessionp)
|
||||
{
|
||||
delete mBaseSessionp ;
|
||||
mBaseSessionp = NULL ;
|
||||
}
|
||||
if (mCurrentSessionp)
|
||||
{
|
||||
delete mCurrentSessionp ;
|
||||
mCurrentSessionp = NULL ;
|
||||
}
|
||||
}
|
||||
|
||||
/*virtual*/
|
||||
void LLMetricPerformanceTesterWithSession::analyzePerformance(std::ofstream* os, LLSD* base, LLSD* current)
|
||||
{
|
||||
// Load the base session
|
||||
resetCurrentCount() ;
|
||||
mBaseSessionp = loadTestSession(base) ;
|
||||
|
||||
// Load the current session
|
||||
resetCurrentCount() ;
|
||||
mCurrentSessionp = loadTestSession(current) ;
|
||||
|
||||
if (!mBaseSessionp || !mCurrentSessionp)
|
||||
{
|
||||
llerrs << "Error loading test sessions." << llendl ;
|
||||
}
|
||||
|
||||
// Compare
|
||||
compareTestSessions(os) ;
|
||||
|
||||
// Release memory
|
||||
if (mBaseSessionp)
|
||||
{
|
||||
delete mBaseSessionp ;
|
||||
mBaseSessionp = NULL ;
|
||||
}
|
||||
if (mCurrentSessionp)
|
||||
{
|
||||
delete mCurrentSessionp ;
|
||||
mCurrentSessionp = NULL ;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
//----------------------------------------------------------------------------------------------
|
||||
// LLTestSession
|
||||
//----------------------------------------------------------------------------------------------
|
||||
|
||||
LLMetricPerformanceTesterWithSession::LLTestSession::~LLTestSession()
|
||||
{
|
||||
}
|
||||
|
||||
|
|
@ -0,0 +1,206 @@
|
|||
/**
|
||||
* @file llmetricperformancetester.h
|
||||
* @brief LLMetricPerformanceTesterBasic and LLMetricPerformanceTesterWithSession classes definition
|
||||
*
|
||||
* $LicenseInfo:firstyear=2004&license=viewerlgpl$
|
||||
* Second Life Viewer Source Code
|
||||
* Copyright (C) 2010, Linden Research, Inc.
|
||||
*
|
||||
* This library is free software; you can redistribute it and/or
|
||||
* modify it under the terms of the GNU Lesser General Public
|
||||
* License as published by the Free Software Foundation;
|
||||
* version 2.1 of the License only.
|
||||
*
|
||||
* This library is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
* Lesser General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU Lesser General Public
|
||||
* License along with this library; if not, write to the Free Software
|
||||
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
|
||||
*
|
||||
* Linden Research, Inc., 945 Battery Street, San Francisco, CA 94111 USA
|
||||
* $/LicenseInfo$
|
||||
*/
|
||||
|
||||
#ifndef LL_METRICPERFORMANCETESTER_H
|
||||
#define LL_METRICPERFORMANCETESTER_H
|
||||
|
||||
char const* const DEFAULT_METRIC_NAME = "metric";
|
||||
|
||||
/**
|
||||
* @class LLMetricPerformanceTesterBasic
|
||||
* @brief Performance Metric Base Class
|
||||
*/
|
||||
class LL_COMMON_API LLMetricPerformanceTesterBasic
|
||||
{
|
||||
public:
|
||||
/**
|
||||
* @brief Creates a basic tester instance.
|
||||
* @param[in] name - Unique string identifying this tester instance.
|
||||
*/
|
||||
LLMetricPerformanceTesterBasic(std::string name);
|
||||
virtual ~LLMetricPerformanceTesterBasic();
|
||||
|
||||
/**
|
||||
* @return Returns true if the instance has been added to the tester map.
|
||||
* Need to be tested after creation of a tester instance so to know if the tester is correctly handled.
|
||||
* A tester might not be added to the map if another tester with the same name already exists.
|
||||
*/
|
||||
BOOL isValid() const { return mValidInstance; }
|
||||
|
||||
/**
|
||||
* @brief Write a set of test results to the log LLSD.
|
||||
*/
|
||||
void outputTestResults() ;
|
||||
|
||||
/**
|
||||
* @brief Compare the test results.
|
||||
* By default, compares the test results against the baseline one by one, item by item,
|
||||
* in the increasing order of the LLSD record counter, starting from the first one.
|
||||
*/
|
||||
virtual void analyzePerformance(std::ofstream* os, LLSD* base, LLSD* current) ;
|
||||
|
||||
/**
|
||||
* @return Returns the number of the test metrics in this tester instance.
|
||||
*/
|
||||
S32 getNumberOfMetrics() const { return mMetricStrings.size() ;}
|
||||
/**
|
||||
* @return Returns the metric name at index
|
||||
* @param[in] index - Index on the list of metrics managed by this tester instance.
|
||||
*/
|
||||
std::string getMetricName(S32 index) const { return mMetricStrings[index] ;}
|
||||
|
||||
protected:
|
||||
/**
|
||||
* @return Returns the name of this tester instance.
|
||||
*/
|
||||
std::string getTesterName() const { return mName ;}
|
||||
|
||||
/**
|
||||
* @brief Insert a new metric to be managed by this tester instance.
|
||||
* @param[in] str - Unique string identifying the new metric.
|
||||
*/
|
||||
void addMetric(std::string str) ;
|
||||
|
||||
/**
|
||||
* @brief Compare test results, provided in 2 flavors: compare integers and compare floats.
|
||||
* @param[out] os - Formatted output string holding the compared values.
|
||||
* @param[in] metric_string - Name of the metric.
|
||||
* @param[in] v_base - Base value of the metric.
|
||||
* @param[in] v_current - Current value of the metric.
|
||||
*/
|
||||
virtual void compareTestResults(std::ofstream* os, std::string metric_string, S32 v_base, S32 v_current) ;
|
||||
virtual void compareTestResults(std::ofstream* os, std::string metric_string, F32 v_base, F32 v_current) ;
|
||||
|
||||
/**
|
||||
* @brief Reset internal record count. Count starts with 1.
|
||||
*/
|
||||
void resetCurrentCount() { mCount = 1; }
|
||||
/**
|
||||
* @brief Increment internal record count.
|
||||
*/
|
||||
void incrementCurrentCount() { mCount++; }
|
||||
/**
|
||||
* @return Returns the label to be used for the current count. It's "TesterName"-"Count".
|
||||
*/
|
||||
std::string getCurrentLabelName() const { return llformat("%s-%d", mName.c_str(), mCount) ;}
|
||||
|
||||
/**
|
||||
* @brief Write a test record to the LLSD. Implementers need to overload this method.
|
||||
* @param[out] sd - The LLSD record to store metric data into.
|
||||
*/
|
||||
virtual void outputTestRecord(LLSD* sd) = 0 ;
|
||||
|
||||
private:
|
||||
void preOutputTestResults(LLSD* sd) ;
|
||||
void postOutputTestResults(LLSD* sd) ;
|
||||
|
||||
std::string mName ; // Name of this tester instance
|
||||
S32 mCount ; // Current record count
|
||||
BOOL mValidInstance; // TRUE if the instance is managed by the map
|
||||
std::vector< std::string > mMetricStrings ; // Metrics strings
|
||||
|
||||
// Static members managing the collection of testers
|
||||
public:
|
||||
// Map of all the tester instances in use
|
||||
typedef std::map< std::string, LLMetricPerformanceTesterBasic* > name_tester_map_t;
|
||||
static name_tester_map_t sTesterMap ;
|
||||
|
||||
/**
|
||||
* @return Returns a pointer to the tester
|
||||
* @param[in] name - Name of the tester instance queried.
|
||||
*/
|
||||
static LLMetricPerformanceTesterBasic* getTester(std::string name) ;
|
||||
|
||||
/**
|
||||
* @return Returns TRUE if that metric *or* the default catch all metric has been requested to be logged
|
||||
* @param[in] name - Name of the tester queried.
|
||||
*/
|
||||
static BOOL isMetricLogRequested(std::string name);
|
||||
|
||||
/**
|
||||
* @return Returns TRUE if there's a tester defined, FALSE otherwise.
|
||||
*/
|
||||
static BOOL hasMetricPerformanceTesters() { return !sTesterMap.empty() ;}
|
||||
/**
|
||||
* @brief Delete all testers and reset the tester map
|
||||
*/
|
||||
static void cleanClass() ;
|
||||
|
||||
private:
|
||||
// Add a tester to the map. Returns false if adding fails.
|
||||
static BOOL addTester(LLMetricPerformanceTesterBasic* tester) ;
|
||||
};
|
||||
|
||||
/**
|
||||
* @class LLMetricPerformanceTesterWithSession
|
||||
* @brief Performance Metric Class with custom session
|
||||
*/
|
||||
class LL_COMMON_API LLMetricPerformanceTesterWithSession : public LLMetricPerformanceTesterBasic
|
||||
{
|
||||
public:
|
||||
/**
|
||||
* @param[in] name - Unique string identifying this tester instance.
|
||||
*/
|
||||
LLMetricPerformanceTesterWithSession(std::string name);
|
||||
virtual ~LLMetricPerformanceTesterWithSession();
|
||||
|
||||
/**
|
||||
* @brief Compare the test results.
|
||||
* This will be loading the base and current sessions and compare them using the virtual
|
||||
* abstract methods loadTestSession() and compareTestSessions()
|
||||
*/
|
||||
virtual void analyzePerformance(std::ofstream* os, LLSD* base, LLSD* current) ;
|
||||
|
||||
protected:
|
||||
/**
|
||||
* @class LLMetricPerformanceTesterWithSession::LLTestSession
|
||||
* @brief Defines an interface for the two abstract virtual functions loadTestSession() and compareTestSessions()
|
||||
*/
|
||||
class LL_COMMON_API LLTestSession
|
||||
{
|
||||
public:
|
||||
virtual ~LLTestSession() ;
|
||||
};
|
||||
|
||||
/**
|
||||
* @brief Convert an LLSD log into a test session.
|
||||
* @param[in] log - The LLSD record
|
||||
* @return Returns the record as a test session
|
||||
*/
|
||||
virtual LLMetricPerformanceTesterWithSession::LLTestSession* loadTestSession(LLSD* log) = 0;
|
||||
|
||||
/**
|
||||
* @brief Compare the base session and the target session. Assumes base and current sessions have been loaded.
|
||||
* @param[out] os - The comparison result as a standard stream
|
||||
*/
|
||||
virtual void compareTestSessions(std::ofstream* os) = 0;
|
||||
|
||||
LLTestSession* mBaseSessionp;
|
||||
LLTestSession* mCurrentSessionp;
|
||||
};
|
||||
|
||||
#endif
|
||||
|
||||
|
|
@ -58,6 +58,11 @@ void LLProcessLauncher::setWorkingDirectory(const std::string &dir)
|
|||
mWorkingDir = dir;
|
||||
}
|
||||
|
||||
const std::string& LLProcessLauncher::getExecutable() const
|
||||
{
|
||||
return mExecutable;
|
||||
}
|
||||
|
||||
void LLProcessLauncher::clearArguments()
|
||||
{
|
||||
mLaunchArguments.clear();
|
||||
|
|
@ -260,14 +265,7 @@ int LLProcessLauncher::launch(void)
|
|||
delete[] fake_argv;
|
||||
|
||||
mProcessID = id;
|
||||
|
||||
// At this point, the child process will have been created (since that's how vfork works -- the child borrowed our execution context until it forked)
|
||||
// If the process doesn't exist at this point, the exec failed.
|
||||
if(!isRunning())
|
||||
{
|
||||
result = -1;
|
||||
}
|
||||
|
||||
|
||||
return result;
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -47,6 +47,8 @@ public:
|
|||
void setExecutable(const std::string &executable);
|
||||
void setWorkingDirectory(const std::string &dir);
|
||||
|
||||
const std::string& getExecutable() const;
|
||||
|
||||
void clearArguments();
|
||||
void addArgument(const std::string &arg);
|
||||
void addArgument(const char *arg);
|
||||
|
|
|
|||
|
|
@ -179,7 +179,7 @@ public:
|
|||
void waitOnPending();
|
||||
void printQueueStats();
|
||||
|
||||
S32 getPending();
|
||||
virtual S32 getPending();
|
||||
bool getThreaded() { return mThreaded ? true : false; }
|
||||
|
||||
// Request accessors
|
||||
|
|
|
|||
|
|
@ -731,14 +731,17 @@ void LLStringOps::setupDatetimeInfo (bool daylight)
|
|||
|
||||
nowT = time (NULL);
|
||||
|
||||
tmpT = localtime (&nowT);
|
||||
localT = mktime (tmpT);
|
||||
|
||||
tmpT = gmtime (&nowT);
|
||||
gmtT = mktime (tmpT);
|
||||
|
||||
tmpT = localtime (&nowT);
|
||||
localT = mktime (tmpT);
|
||||
|
||||
sLocalTimeOffset = (long) (gmtT - localT);
|
||||
|
||||
if (tmpT->tm_isdst)
|
||||
{
|
||||
sLocalTimeOffset -= 60 * 60; // 1 hour
|
||||
}
|
||||
|
||||
sPacificDaylightTime = daylight;
|
||||
sPacificTimeOffset = (sPacificDaylightTime? 7 : 8 ) * 60 * 60;
|
||||
|
|
|
|||
|
|
@ -63,9 +63,6 @@ void *APR_THREAD_FUNC LLThread::staticRun(apr_thread_t *apr_threadp, void *datap
|
|||
{
|
||||
LLThread *threadp = (LLThread *)datap;
|
||||
|
||||
// Set thread state to running
|
||||
threadp->mStatus = RUNNING;
|
||||
|
||||
// Run the user supplied function
|
||||
threadp->run();
|
||||
|
||||
|
|
@ -147,26 +144,45 @@ void LLThread::shutdown()
|
|||
{
|
||||
// This thread just wouldn't stop, even though we gave it time
|
||||
llwarns << "LLThread::~LLThread() exiting thread before clean exit!" << llendl;
|
||||
// Put a stake in its heart.
|
||||
apr_thread_exit(mAPRThreadp, -1);
|
||||
return;
|
||||
}
|
||||
mAPRThreadp = NULL;
|
||||
}
|
||||
|
||||
delete mRunCondition;
|
||||
mRunCondition = 0;
|
||||
|
||||
if (mIsLocalPool)
|
||||
if (mIsLocalPool && mAPRPoolp)
|
||||
{
|
||||
apr_pool_destroy(mAPRPoolp);
|
||||
mAPRPoolp = 0;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
void LLThread::start()
|
||||
{
|
||||
apr_thread_create(&mAPRThreadp, NULL, staticRun, (void *)this, mAPRPoolp);
|
||||
llassert(isStopped());
|
||||
|
||||
// Set thread state to running
|
||||
mStatus = RUNNING;
|
||||
|
||||
// We won't bother joining
|
||||
apr_thread_detach(mAPRThreadp);
|
||||
apr_status_t status =
|
||||
apr_thread_create(&mAPRThreadp, NULL, staticRun, (void *)this, mAPRPoolp);
|
||||
|
||||
if(status == APR_SUCCESS)
|
||||
{
|
||||
// We won't bother joining
|
||||
apr_thread_detach(mAPRThreadp);
|
||||
}
|
||||
else
|
||||
{
|
||||
mStatus = STOPPED;
|
||||
llwarns << "failed to start thread " << mName << llendl;
|
||||
ll_apr_warn_status(status);
|
||||
}
|
||||
}
|
||||
|
||||
//============================================================================
|
||||
|
|
|
|||
|
|
@ -0,0 +1,109 @@
|
|||
/**
|
||||
* @file llthread.cpp
|
||||
*
|
||||
* $LicenseInfo:firstyear=2004&license=viewerlgpl$
|
||||
* Second Life Viewer Source Code
|
||||
* Copyright (C) 2010, Linden Research, Inc.
|
||||
*
|
||||
* This library is free software; you can redistribute it and/or
|
||||
* modify it under the terms of the GNU Lesser General Public
|
||||
* License as published by the Free Software Foundation;
|
||||
* version 2.1 of the License only.
|
||||
*
|
||||
* This library is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
* Lesser General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU Lesser General Public
|
||||
* License along with this library; if not, write to the Free Software
|
||||
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
|
||||
*
|
||||
* Linden Research, Inc., 945 Battery Street, San Francisco, CA 94111 USA
|
||||
* $/LicenseInfo$
|
||||
*/
|
||||
|
||||
#include "linden_common.h"
|
||||
#include <apr_pools.h>
|
||||
#include <apr_queue.h>
|
||||
#include "llthreadsafequeue.h"
|
||||
|
||||
|
||||
|
||||
// LLThreadSafeQueueImplementation
|
||||
//-----------------------------------------------------------------------------
|
||||
|
||||
|
||||
LLThreadSafeQueueImplementation::LLThreadSafeQueueImplementation(apr_pool_t * pool, unsigned int capacity):
|
||||
mOwnsPool(pool == 0),
|
||||
mPool(pool),
|
||||
mQueue(0)
|
||||
{
|
||||
if(mOwnsPool) {
|
||||
apr_status_t status = apr_pool_create(&mPool, 0);
|
||||
if(status != APR_SUCCESS) throw LLThreadSafeQueueError("failed to allocate pool");
|
||||
} else {
|
||||
; // No op.
|
||||
}
|
||||
|
||||
apr_status_t status = apr_queue_create(&mQueue, capacity, mPool);
|
||||
if(status != APR_SUCCESS) throw LLThreadSafeQueueError("failed to allocate queue");
|
||||
}
|
||||
|
||||
|
||||
LLThreadSafeQueueImplementation::~LLThreadSafeQueueImplementation()
|
||||
{
|
||||
if(mQueue != 0) {
|
||||
if(apr_queue_size(mQueue) != 0) llwarns <<
|
||||
"terminating queue which still contains " << apr_queue_size(mQueue) <<
|
||||
" elements;" << "memory will be leaked" << LL_ENDL;
|
||||
apr_queue_term(mQueue);
|
||||
}
|
||||
if(mOwnsPool && (mPool != 0)) apr_pool_destroy(mPool);
|
||||
}
|
||||
|
||||
|
||||
void LLThreadSafeQueueImplementation::pushFront(void * element)
|
||||
{
|
||||
apr_status_t status = apr_queue_push(mQueue, element);
|
||||
|
||||
if(status == APR_EINTR) {
|
||||
throw LLThreadSafeQueueInterrupt();
|
||||
} else if(status != APR_SUCCESS) {
|
||||
throw LLThreadSafeQueueError("push failed");
|
||||
} else {
|
||||
; // Success.
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
bool LLThreadSafeQueueImplementation::tryPushFront(void * element){
|
||||
return apr_queue_trypush(mQueue, element) == APR_SUCCESS;
|
||||
}
|
||||
|
||||
|
||||
void * LLThreadSafeQueueImplementation::popBack(void)
|
||||
{
|
||||
void * element;
|
||||
apr_status_t status = apr_queue_pop(mQueue, &element);
|
||||
|
||||
if(status == APR_EINTR) {
|
||||
throw LLThreadSafeQueueInterrupt();
|
||||
} else if(status != APR_SUCCESS) {
|
||||
throw LLThreadSafeQueueError("pop failed");
|
||||
} else {
|
||||
return element;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
bool LLThreadSafeQueueImplementation::tryPopBack(void *& element)
|
||||
{
|
||||
return apr_queue_trypop(mQueue, &element) == APR_SUCCESS;
|
||||
}
|
||||
|
||||
|
||||
size_t LLThreadSafeQueueImplementation::size()
|
||||
{
|
||||
return apr_queue_size(mQueue);
|
||||
}
|
||||
|
|
@ -0,0 +1,205 @@
|
|||
/**
|
||||
* @file llthreadsafequeue.h
|
||||
* @brief Base classes for thread, mutex and condition handling.
|
||||
*
|
||||
* $LicenseInfo:firstyear=2004&license=viewerlgpl$
|
||||
* Second Life Viewer Source Code
|
||||
* Copyright (C) 2010, Linden Research, Inc.
|
||||
*
|
||||
* This library is free software; you can redistribute it and/or
|
||||
* modify it under the terms of the GNU Lesser General Public
|
||||
* License as published by the Free Software Foundation;
|
||||
* version 2.1 of the License only.
|
||||
*
|
||||
* This library is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
* Lesser General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU Lesser General Public
|
||||
* License along with this library; if not, write to the Free Software
|
||||
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
|
||||
*
|
||||
* Linden Research, Inc., 945 Battery Street, San Francisco, CA 94111 USA
|
||||
* $/LicenseInfo$
|
||||
*/
|
||||
|
||||
#ifndef LL_LLTHREADSAFEQUEUE_H
|
||||
#define LL_LLTHREADSAFEQUEUE_H
|
||||
|
||||
|
||||
#include <string>
|
||||
#include <stdexcept>
|
||||
|
||||
|
||||
struct apr_pool_t; // From apr_pools.h
|
||||
class LLThreadSafeQueueImplementation; // See below.
|
||||
|
||||
|
||||
//
|
||||
// A general queue exception.
|
||||
//
|
||||
class LL_COMMON_API LLThreadSafeQueueError:
|
||||
public std::runtime_error
|
||||
{
|
||||
public:
|
||||
LLThreadSafeQueueError(std::string const & message):
|
||||
std::runtime_error(message)
|
||||
{
|
||||
; // No op.
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
//
|
||||
// An exception raised when blocking operations are interrupted.
|
||||
//
|
||||
class LL_COMMON_API LLThreadSafeQueueInterrupt:
|
||||
public LLThreadSafeQueueError
|
||||
{
|
||||
public:
|
||||
LLThreadSafeQueueInterrupt(void):
|
||||
LLThreadSafeQueueError("queue operation interrupted")
|
||||
{
|
||||
; // No op.
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
struct apr_queue_t; // From apr_queue.h
|
||||
|
||||
|
||||
//
|
||||
// Implementation details.
|
||||
//
|
||||
class LL_COMMON_API LLThreadSafeQueueImplementation
|
||||
{
|
||||
public:
|
||||
LLThreadSafeQueueImplementation(apr_pool_t * pool, unsigned int capacity);
|
||||
~LLThreadSafeQueueImplementation();
|
||||
void pushFront(void * element);
|
||||
bool tryPushFront(void * element);
|
||||
void * popBack(void);
|
||||
bool tryPopBack(void *& element);
|
||||
size_t size();
|
||||
|
||||
private:
|
||||
bool mOwnsPool;
|
||||
apr_pool_t * mPool;
|
||||
apr_queue_t * mQueue;
|
||||
};
|
||||
|
||||
|
||||
//
|
||||
// Implements a thread safe FIFO.
|
||||
//
|
||||
template<typename ElementT>
|
||||
class LLThreadSafeQueue
|
||||
{
|
||||
public:
|
||||
typedef ElementT value_type;
|
||||
|
||||
// If the pool is set to NULL one will be allocated and managed by this
|
||||
// queue.
|
||||
LLThreadSafeQueue(apr_pool_t * pool = 0, unsigned int capacity = 1024);
|
||||
|
||||
// Add an element to the front of queue (will block if the queue has
|
||||
// reached capacity).
|
||||
//
|
||||
// This call will raise an interrupt error if the queue is deleted while
|
||||
// the caller is blocked.
|
||||
void pushFront(ElementT const & element);
|
||||
|
||||
// Try to add an element to the front ofqueue without blocking. Returns
|
||||
// true only if the element was actually added.
|
||||
bool tryPushFront(ElementT const & element);
|
||||
|
||||
// Pop the element at the end of the queue (will block if the queue is
|
||||
// empty).
|
||||
//
|
||||
// This call will raise an interrupt error if the queue is deleted while
|
||||
// the caller is blocked.
|
||||
ElementT popBack(void);
|
||||
|
||||
// Pop an element from the end of the queue if there is one available.
|
||||
// Returns true only if an element was popped.
|
||||
bool tryPopBack(ElementT & element);
|
||||
|
||||
// Returns the size of the queue.
|
||||
size_t size();
|
||||
|
||||
private:
|
||||
LLThreadSafeQueueImplementation mImplementation;
|
||||
};
|
||||
|
||||
|
||||
|
||||
// LLThreadSafeQueue
|
||||
//-----------------------------------------------------------------------------
|
||||
|
||||
|
||||
template<typename ElementT>
|
||||
LLThreadSafeQueue<ElementT>::LLThreadSafeQueue(apr_pool_t * pool, unsigned int capacity):
|
||||
mImplementation(pool, capacity)
|
||||
{
|
||||
; // No op.
|
||||
}
|
||||
|
||||
|
||||
template<typename ElementT>
|
||||
void LLThreadSafeQueue<ElementT>::pushFront(ElementT const & element)
|
||||
{
|
||||
ElementT * elementCopy = new ElementT(element);
|
||||
try {
|
||||
mImplementation.pushFront(elementCopy);
|
||||
} catch (LLThreadSafeQueueInterrupt) {
|
||||
delete elementCopy;
|
||||
throw;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
template<typename ElementT>
|
||||
bool LLThreadSafeQueue<ElementT>::tryPushFront(ElementT const & element)
|
||||
{
|
||||
ElementT * elementCopy = new ElementT(element);
|
||||
bool result = mImplementation.tryPushFront(elementCopy);
|
||||
if(!result) delete elementCopy;
|
||||
return result;
|
||||
}
|
||||
|
||||
|
||||
template<typename ElementT>
|
||||
ElementT LLThreadSafeQueue<ElementT>::popBack(void)
|
||||
{
|
||||
ElementT * element = reinterpret_cast<ElementT *> (mImplementation.popBack());
|
||||
ElementT result(*element);
|
||||
delete element;
|
||||
return result;
|
||||
}
|
||||
|
||||
|
||||
template<typename ElementT>
|
||||
bool LLThreadSafeQueue<ElementT>::tryPopBack(ElementT & element)
|
||||
{
|
||||
void * storedElement;
|
||||
bool result = mImplementation.tryPopBack(storedElement);
|
||||
if(result) {
|
||||
ElementT * elementPtr = reinterpret_cast<ElementT *>(storedElement);
|
||||
element = *elementPtr;
|
||||
delete elementPtr;
|
||||
} else {
|
||||
; // No op.
|
||||
}
|
||||
return result;
|
||||
}
|
||||
|
||||
|
||||
template<typename ElementT>
|
||||
size_t LLThreadSafeQueue<ElementT>::size(void)
|
||||
{
|
||||
return mImplementation.size();
|
||||
}
|
||||
|
||||
|
||||
#endif
|
||||
|
|
@ -28,10 +28,14 @@
|
|||
#define LL_LLVERSIONVIEWER_H
|
||||
|
||||
const S32 LL_VERSION_MAJOR = 2;
|
||||
const S32 LL_VERSION_MINOR = 2;
|
||||
const S32 LL_VERSION_PATCH = 1;
|
||||
const S32 LL_VERSION_MINOR = 7;
|
||||
const S32 LL_VERSION_PATCH = 0;
|
||||
const S32 LL_VERSION_BUILD = 0;
|
||||
|
||||
const char * const LL_CHANNEL = "Second Life Developer";
|
||||
|
||||
#if LL_DARWIN
|
||||
const char * const LL_VERSION_BUNDLE_ID = "com.secondlife.indra.viewer";
|
||||
#endif
|
||||
|
||||
#endif
|
||||
|
|
|
|||
|
|
@ -52,7 +52,6 @@ enum LLRoleChangeType
|
|||
//
|
||||
|
||||
// KNOWN HOLES: use these for any single bit powers you need
|
||||
// bit 0x1 << 41
|
||||
// bit 0x1 << 46
|
||||
// bit 0x1 << 49 and above
|
||||
|
||||
|
|
@ -103,6 +102,8 @@ const U64 GP_LAND_ALLOW_FLY = 0x1 << 24; // Bypass Fly Restriction
|
|||
const U64 GP_LAND_ALLOW_CREATE = 0x1 << 25; // Bypass Create/Edit Objects Restriction
|
||||
const U64 GP_LAND_ALLOW_LANDMARK = 0x1 << 26; // Bypass Landmark Restriction
|
||||
const U64 GP_LAND_ALLOW_SET_HOME = 0x1 << 28; // Bypass Set Home Point Restriction
|
||||
const U64 GP_LAND_ALLOW_HOLD_EVENT = 0x1LL << 41; // Allowed to hold events on group-owned land
|
||||
|
||||
|
||||
// Parcel Access
|
||||
const U64 GP_LAND_MANAGE_ALLOWED = 0x1 << 29; // Manage Allowed List
|
||||
|
|
|
|||
|
|
@ -3,12 +3,13 @@
|
|||
project(llimage)
|
||||
|
||||
include(00-Common)
|
||||
include(LLAddBuildTest)
|
||||
include(LLCommon)
|
||||
include(LLImage)
|
||||
include(LLMath)
|
||||
include(LLVFS)
|
||||
include(ZLIB)
|
||||
include(LLAddBuildTest)
|
||||
include(Tut)
|
||||
|
||||
include_directories(
|
||||
${LLCOMMON_INCLUDE_DIRS}
|
||||
|
|
@ -57,11 +58,18 @@ add_library (llimage ${llimage_SOURCE_FILES})
|
|||
# Sort by high-level to low-level
|
||||
target_link_libraries(llimage
|
||||
llcommon
|
||||
llimagej2coj # *HACK: In theory a noop for KDU builds?
|
||||
${JPEG_LIBRARIES}
|
||||
${PNG_LIBRARIES}
|
||||
${ZLIB_LIBRARIES}
|
||||
)
|
||||
|
||||
# Add tests
|
||||
#ADD_BUILD_TEST(llimageworker llimage)
|
||||
if (LL_TESTS)
|
||||
SET(llimage_TEST_SOURCE_FILES
|
||||
llimageworker.cpp
|
||||
)
|
||||
LL_ADD_PROJECT_UNIT_TESTS(llimage "${llimage_TEST_SOURCE_FILES}")
|
||||
endif (LL_TESTS)
|
||||
|
||||
|
||||
|
||||
|
|
|
|||
|
|
@ -54,7 +54,6 @@ LLPrivateMemoryPool* LLImageBase::sPrivatePoolp = NULL ;
|
|||
void LLImage::initClass()
|
||||
{
|
||||
sMutex = new LLMutex(NULL);
|
||||
LLImageJ2C::openDSO();
|
||||
|
||||
LLImageBase::createPrivatePool() ;
|
||||
}
|
||||
|
|
@ -62,7 +61,6 @@ void LLImage::initClass()
|
|||
//static
|
||||
void LLImage::cleanupClass()
|
||||
{
|
||||
LLImageJ2C::closeDSO();
|
||||
delete sMutex;
|
||||
sMutex = NULL;
|
||||
|
||||
|
|
@ -329,11 +327,11 @@ LLImageRaw::LLImageRaw(U8 *data, U16 width, U16 height, S8 components)
|
|||
++sRawImageCount;
|
||||
}
|
||||
|
||||
LLImageRaw::LLImageRaw(const std::string& filename, bool j2c_lowest_mip_only)
|
||||
: LLImageBase()
|
||||
{
|
||||
createFromFile(filename, j2c_lowest_mip_only);
|
||||
}
|
||||
//LLImageRaw::LLImageRaw(const std::string& filename, bool j2c_lowest_mip_only)
|
||||
// : LLImageBase()
|
||||
//{
|
||||
// createFromFile(filename, j2c_lowest_mip_only);
|
||||
//}
|
||||
|
||||
LLImageRaw::~LLImageRaw()
|
||||
{
|
||||
|
|
@ -1237,7 +1235,7 @@ file_extensions[] =
|
|||
{ "png", IMG_CODEC_PNG }
|
||||
};
|
||||
#define NUM_FILE_EXTENSIONS LL_ARRAY_SIZE(file_extensions)
|
||||
|
||||
#if 0
|
||||
static std::string find_file(std::string &name, S8 *codec)
|
||||
{
|
||||
std::string tname;
|
||||
|
|
@ -1255,7 +1253,7 @@ static std::string find_file(std::string &name, S8 *codec)
|
|||
}
|
||||
return std::string("");
|
||||
}
|
||||
|
||||
#endif
|
||||
EImageCodec LLImageBase::getCodecFromExtension(const std::string& exten)
|
||||
{
|
||||
for (int i=0; i<(int)(NUM_FILE_EXTENSIONS); i++)
|
||||
|
|
@ -1265,7 +1263,7 @@ EImageCodec LLImageBase::getCodecFromExtension(const std::string& exten)
|
|||
}
|
||||
return IMG_CODEC_INVALID;
|
||||
}
|
||||
|
||||
#if 0
|
||||
bool LLImageRaw::createFromFile(const std::string &filename, bool j2c_lowest_mip_only)
|
||||
{
|
||||
std::string name = filename;
|
||||
|
|
@ -1372,7 +1370,7 @@ bool LLImageRaw::createFromFile(const std::string &filename, bool j2c_lowest_mip
|
|||
|
||||
return true;
|
||||
}
|
||||
|
||||
#endif
|
||||
//---------------------------------------------------------------------------
|
||||
// LLImageFormatted
|
||||
//---------------------------------------------------------------------------
|
||||
|
|
|
|||
|
|
@ -171,7 +171,7 @@ public:
|
|||
LLImageRaw(U16 width, U16 height, S8 components);
|
||||
LLImageRaw(U8 *data, U16 width, U16 height, S8 components);
|
||||
// Construct using createFromFile (used by tools)
|
||||
LLImageRaw(const std::string& filename, bool j2c_lowest_mip_only = false);
|
||||
//LLImageRaw(const std::string& filename, bool j2c_lowest_mip_only = false);
|
||||
|
||||
/*virtual*/ void deleteData();
|
||||
/*virtual*/ U8* allocateData(S32 size = -1);
|
||||
|
|
@ -233,7 +233,7 @@ public:
|
|||
|
||||
protected:
|
||||
// Create an image from a local file (generally used in tools)
|
||||
bool createFromFile(const std::string& filename, bool j2c_lowest_mip_only = false);
|
||||
//bool createFromFile(const std::string& filename, bool j2c_lowest_mip_only = false);
|
||||
|
||||
void copyLineScaled( U8* in, U8* out, S32 in_pixel_len, S32 out_pixel_len, S32 in_pixel_step, S32 out_pixel_step );
|
||||
void compositeRowScaled4onto3( U8* in, U8* out, S32 in_pixel_len, S32 out_pixel_len );
|
||||
|
|
|
|||
|
|
@ -30,6 +30,9 @@
|
|||
|
||||
#include "llimagedimensionsinfo.h"
|
||||
|
||||
// Value is true if one of Libjpeg's functions has encountered an error while working.
|
||||
static bool sJpegErrorEncountered = false;
|
||||
|
||||
bool LLImageDimensionsInfo::load(const std::string& src_filename,U32 codec)
|
||||
{
|
||||
clean();
|
||||
|
|
@ -101,9 +104,17 @@ bool LLImageDimensionsInfo::getImageDimensionsPng()
|
|||
return true;
|
||||
}
|
||||
|
||||
// Called instead of exit() if Libjpeg encounters an error.
|
||||
void on_jpeg_error(j_common_ptr cinfo)
|
||||
{
|
||||
(void) cinfo;
|
||||
sJpegErrorEncountered = true;
|
||||
llwarns << "Libjpeg has encountered an error!" << llendl;
|
||||
}
|
||||
|
||||
bool LLImageDimensionsInfo::getImageDimensionsJpeg()
|
||||
{
|
||||
sJpegErrorEncountered = false;
|
||||
clean();
|
||||
FILE *fp = fopen (mSrcFilename.c_str(), "rb");
|
||||
if (fp == NULL)
|
||||
|
|
@ -115,6 +126,9 @@ bool LLImageDimensionsInfo::getImageDimensionsJpeg()
|
|||
jpeg_error_mgr jerr;
|
||||
jpeg_decompress_struct cinfo;
|
||||
cinfo.err = jpeg_std_error(&jerr);
|
||||
// Call our function instead of exit() if Libjpeg encounters an error.
|
||||
// This is done to avoid crash in this case (STORM-472).
|
||||
cinfo.err->error_exit = on_jpeg_error;
|
||||
|
||||
jpeg_create_decompress (&cinfo);
|
||||
jpeg_stdio_src (&cinfo, fp);
|
||||
|
|
@ -128,6 +142,6 @@ bool LLImageDimensionsInfo::getImageDimensionsJpeg()
|
|||
jpeg_destroy_decompress(&cinfo);
|
||||
fclose(fp);
|
||||
|
||||
return true;
|
||||
return !sJpegErrorEncountered;
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -24,148 +24,32 @@
|
|||
*/
|
||||
#include "linden_common.h"
|
||||
|
||||
#include "apr_pools.h"
|
||||
#include "apr_dso.h"
|
||||
|
||||
#include "lldir.h"
|
||||
#include "llimagej2c.h"
|
||||
#include "llmemtype.h"
|
||||
#include "lltimer.h"
|
||||
#include "llmath.h"
|
||||
|
||||
typedef LLImageJ2CImpl* (*CreateLLImageJ2CFunction)();
|
||||
typedef void (*DestroyLLImageJ2CFunction)(LLImageJ2CImpl*);
|
||||
typedef const char* (*EngineInfoLLImageJ2CFunction)();
|
||||
|
||||
//some "private static" variables so we only attempt to load
|
||||
//dynamic libaries once
|
||||
CreateLLImageJ2CFunction j2cimpl_create_func;
|
||||
DestroyLLImageJ2CFunction j2cimpl_destroy_func;
|
||||
EngineInfoLLImageJ2CFunction j2cimpl_engineinfo_func;
|
||||
apr_pool_t *j2cimpl_dso_memory_pool;
|
||||
apr_dso_handle_t *j2cimpl_dso_handle;
|
||||
|
||||
//Declare the prototype for theses functions here, their functionality
|
||||
//will be implemented in other files which define a derived LLImageJ2CImpl
|
||||
//but only ONE static library which has the implementation for this
|
||||
//function should ever be included
|
||||
// Declare the prototype for theses functions here. Their functionality
|
||||
// will be implemented in other files which define a derived LLImageJ2CImpl
|
||||
// but only ONE static library which has the implementation for these
|
||||
// functions should ever be included.
|
||||
LLImageJ2CImpl* fallbackCreateLLImageJ2CImpl();
|
||||
void fallbackDestroyLLImageJ2CImpl(LLImageJ2CImpl* impl);
|
||||
const char* fallbackEngineInfoLLImageJ2CImpl();
|
||||
|
||||
//static
|
||||
//Loads the required "create", "destroy" and "engineinfo" functions needed
|
||||
void LLImageJ2C::openDSO()
|
||||
{
|
||||
//attempt to load a DSO and get some functions from it
|
||||
std::string dso_name;
|
||||
std::string dso_path;
|
||||
|
||||
bool all_functions_loaded = false;
|
||||
apr_status_t rv;
|
||||
|
||||
#if LL_WINDOWS
|
||||
dso_name = "llkdu.dll";
|
||||
#elif LL_DARWIN
|
||||
dso_name = "libllkdu.dylib";
|
||||
#else
|
||||
dso_name = "libllkdu.so";
|
||||
#endif
|
||||
|
||||
dso_path = gDirUtilp->findFile(dso_name,
|
||||
gDirUtilp->getAppRODataDir(),
|
||||
gDirUtilp->getExecutableDir());
|
||||
|
||||
j2cimpl_dso_handle = NULL;
|
||||
j2cimpl_dso_memory_pool = NULL;
|
||||
|
||||
//attempt to load the shared library
|
||||
apr_pool_create(&j2cimpl_dso_memory_pool, NULL);
|
||||
rv = apr_dso_load(&j2cimpl_dso_handle,
|
||||
dso_path.c_str(),
|
||||
j2cimpl_dso_memory_pool);
|
||||
|
||||
//now, check for success
|
||||
if ( rv == APR_SUCCESS )
|
||||
{
|
||||
//found the dynamic library
|
||||
//now we want to load the functions we're interested in
|
||||
CreateLLImageJ2CFunction create_func = NULL;
|
||||
DestroyLLImageJ2CFunction dest_func = NULL;
|
||||
EngineInfoLLImageJ2CFunction engineinfo_func = NULL;
|
||||
|
||||
rv = apr_dso_sym((apr_dso_handle_sym_t*)&create_func,
|
||||
j2cimpl_dso_handle,
|
||||
"createLLImageJ2CKDU");
|
||||
if ( rv == APR_SUCCESS )
|
||||
{
|
||||
//we've loaded the create function ok
|
||||
//we need to delete via the DSO too
|
||||
//so lets check for a destruction function
|
||||
rv = apr_dso_sym((apr_dso_handle_sym_t*)&dest_func,
|
||||
j2cimpl_dso_handle,
|
||||
"destroyLLImageJ2CKDU");
|
||||
if ( rv == APR_SUCCESS )
|
||||
{
|
||||
//we've loaded the destroy function ok
|
||||
rv = apr_dso_sym((apr_dso_handle_sym_t*)&engineinfo_func,
|
||||
j2cimpl_dso_handle,
|
||||
"engineInfoLLImageJ2CKDU");
|
||||
if ( rv == APR_SUCCESS )
|
||||
{
|
||||
//ok, everything is loaded alright
|
||||
j2cimpl_create_func = create_func;
|
||||
j2cimpl_destroy_func = dest_func;
|
||||
j2cimpl_engineinfo_func = engineinfo_func;
|
||||
all_functions_loaded = true;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if ( !all_functions_loaded )
|
||||
{
|
||||
//something went wrong with the DSO or function loading..
|
||||
//fall back onto our satefy impl creation function
|
||||
|
||||
#if 0
|
||||
// precious verbose debugging, sadly we can't use our
|
||||
// 'llinfos' stream etc. this early in the initialisation seq.
|
||||
char errbuf[256];
|
||||
fprintf(stderr, "failed to load syms from DSO %s (%s)\n",
|
||||
dso_name.c_str(), dso_path.c_str());
|
||||
apr_strerror(rv, errbuf, sizeof(errbuf));
|
||||
fprintf(stderr, "error: %d, %s\n", rv, errbuf);
|
||||
apr_dso_error(j2cimpl_dso_handle, errbuf, sizeof(errbuf));
|
||||
fprintf(stderr, "dso-error: %d, %s\n", rv, errbuf);
|
||||
#endif
|
||||
|
||||
if ( j2cimpl_dso_handle )
|
||||
{
|
||||
apr_dso_unload(j2cimpl_dso_handle);
|
||||
j2cimpl_dso_handle = NULL;
|
||||
}
|
||||
|
||||
if ( j2cimpl_dso_memory_pool )
|
||||
{
|
||||
apr_pool_destroy(j2cimpl_dso_memory_pool);
|
||||
j2cimpl_dso_memory_pool = NULL;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
//static
|
||||
void LLImageJ2C::closeDSO()
|
||||
{
|
||||
if ( j2cimpl_dso_handle ) apr_dso_unload(j2cimpl_dso_handle);
|
||||
if (j2cimpl_dso_memory_pool) apr_pool_destroy(j2cimpl_dso_memory_pool);
|
||||
}
|
||||
// Test data gathering handle
|
||||
LLImageCompressionTester* LLImageJ2C::sTesterp = NULL ;
|
||||
const std::string sTesterName("ImageCompressionTester");
|
||||
|
||||
//static
|
||||
std::string LLImageJ2C::getEngineInfo()
|
||||
{
|
||||
if (!j2cimpl_engineinfo_func)
|
||||
j2cimpl_engineinfo_func = fallbackEngineInfoLLImageJ2CImpl;
|
||||
|
||||
return j2cimpl_engineinfo_func();
|
||||
return fallbackEngineInfoLLImageJ2CImpl();
|
||||
}
|
||||
|
||||
LLImageJ2C::LLImageJ2C() : LLImageFormatted(IMG_CODEC_J2C),
|
||||
|
|
@ -175,47 +59,32 @@ LLImageJ2C::LLImageJ2C() : LLImageFormatted(IMG_CODEC_J2C),
|
|||
mReversible(FALSE),
|
||||
mAreaUsedForDataSizeCalcs(0)
|
||||
{
|
||||
//We assume here that if we wanted to create via
|
||||
//a dynamic library that the approriate open calls were made
|
||||
//before any calls to this constructor.
|
||||
|
||||
//Therefore, a NULL creation function pointer here means
|
||||
//we either did not want to create using functions from the dynamic
|
||||
//library or there were issues loading it, either way
|
||||
//use our fall back
|
||||
if ( !j2cimpl_create_func )
|
||||
{
|
||||
j2cimpl_create_func = fallbackCreateLLImageJ2CImpl;
|
||||
}
|
||||
|
||||
mImpl = j2cimpl_create_func();
|
||||
mImpl = fallbackCreateLLImageJ2CImpl();
|
||||
|
||||
// Clear data size table
|
||||
for( S32 i = 0; i <= MAX_DISCARD_LEVEL; i++)
|
||||
{ // Array size is MAX_DISCARD_LEVEL+1
|
||||
mDataSizes[i] = 0;
|
||||
}
|
||||
|
||||
// If that test log has ben requested but not yet created, create it
|
||||
if (LLMetricPerformanceTesterBasic::isMetricLogRequested(sTesterName) && !LLMetricPerformanceTesterBasic::getTester(sTesterName))
|
||||
{
|
||||
sTesterp = new LLImageCompressionTester() ;
|
||||
if (!sTesterp->isValid())
|
||||
{
|
||||
delete sTesterp;
|
||||
sTesterp = NULL;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// virtual
|
||||
LLImageJ2C::~LLImageJ2C()
|
||||
{
|
||||
//We assume here that if we wanted to destroy via
|
||||
//a dynamic library that the approriate open calls were made
|
||||
//before any calls to this destructor.
|
||||
|
||||
//Therefore, a NULL creation function pointer here means
|
||||
//we either did not want to destroy using functions from the dynamic
|
||||
//library or there were issues loading it, either way
|
||||
//use our fall back
|
||||
if ( !j2cimpl_destroy_func )
|
||||
{
|
||||
j2cimpl_destroy_func = fallbackDestroyLLImageJ2CImpl;
|
||||
}
|
||||
|
||||
if ( mImpl )
|
||||
{
|
||||
j2cimpl_destroy_func(mImpl);
|
||||
fallbackDestroyLLImageJ2CImpl(mImpl);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -280,6 +149,7 @@ BOOL LLImageJ2C::decode(LLImageRaw *raw_imagep, F32 decode_time)
|
|||
// Returns TRUE to mean done, whether successful or not.
|
||||
BOOL LLImageJ2C::decodeChannels(LLImageRaw *raw_imagep, F32 decode_time, S32 first_channel, S32 max_channel_count )
|
||||
{
|
||||
LLTimer elapsed;
|
||||
LLMemType mt1(mMemType);
|
||||
|
||||
BOOL res = TRUE;
|
||||
|
|
@ -318,6 +188,21 @@ BOOL LLImageJ2C::decodeChannels(LLImageRaw *raw_imagep, F32 decode_time, S32 fir
|
|||
LLImage::setLastError(mLastError);
|
||||
}
|
||||
|
||||
LLImageCompressionTester* tester = (LLImageCompressionTester*)LLMetricPerformanceTesterBasic::getTester(sTesterName);
|
||||
if (tester)
|
||||
{
|
||||
// Decompression stat gathering
|
||||
// Note that we *do not* take into account the decompression failures data so we might overestimate the time spent processing
|
||||
|
||||
// Always add the decompression time to the stat
|
||||
tester->updateDecompressionStats(elapsed.getElapsedTimeF32()) ;
|
||||
if (res)
|
||||
{
|
||||
// The whole data stream is finally decompressed when res is returned as TRUE
|
||||
tester->updateDecompressionStats(this->getDataSize(), raw_imagep->getDataSize()) ;
|
||||
}
|
||||
}
|
||||
|
||||
return res;
|
||||
}
|
||||
|
||||
|
|
@ -330,6 +215,7 @@ BOOL LLImageJ2C::encode(const LLImageRaw *raw_imagep, F32 encode_time)
|
|||
|
||||
BOOL LLImageJ2C::encode(const LLImageRaw *raw_imagep, const char* comment_text, F32 encode_time)
|
||||
{
|
||||
LLTimer elapsed;
|
||||
LLMemType mt1(mMemType);
|
||||
resetLastError();
|
||||
BOOL res = mImpl->encodeImpl(*this, *raw_imagep, comment_text, encode_time, mReversible);
|
||||
|
|
@ -337,6 +223,22 @@ BOOL LLImageJ2C::encode(const LLImageRaw *raw_imagep, const char* comment_text,
|
|||
{
|
||||
LLImage::setLastError(mLastError);
|
||||
}
|
||||
|
||||
LLImageCompressionTester* tester = (LLImageCompressionTester*)LLMetricPerformanceTesterBasic::getTester(sTesterName);
|
||||
if (tester)
|
||||
{
|
||||
// Compression stat gathering
|
||||
// Note that we *do not* take into account the compression failures cases so we night overestimate the time spent processing
|
||||
|
||||
// Always add the compression time to the stat
|
||||
tester->updateCompressionStats(elapsed.getElapsedTimeF32()) ;
|
||||
if (res)
|
||||
{
|
||||
// The whole data stream is finally compressed when res is returned as TRUE
|
||||
tester->updateCompressionStats(this->getDataSize(), raw_imagep->getDataSize()) ;
|
||||
}
|
||||
}
|
||||
|
||||
return res;
|
||||
}
|
||||
|
||||
|
|
@ -540,3 +442,125 @@ void LLImageJ2C::updateRawDiscardLevel()
|
|||
LLImageJ2CImpl::~LLImageJ2CImpl()
|
||||
{
|
||||
}
|
||||
|
||||
//----------------------------------------------------------------------------------------------
|
||||
// Start of LLImageCompressionTester
|
||||
//----------------------------------------------------------------------------------------------
|
||||
LLImageCompressionTester::LLImageCompressionTester() : LLMetricPerformanceTesterBasic(sTesterName)
|
||||
{
|
||||
addMetric("Time Decompression (s)");
|
||||
addMetric("Volume In Decompression (kB)");
|
||||
addMetric("Volume Out Decompression (kB)");
|
||||
addMetric("Decompression Ratio (x:1)");
|
||||
addMetric("Perf Decompression (kB/s)");
|
||||
|
||||
addMetric("Time Compression (s)");
|
||||
addMetric("Volume In Compression (kB)");
|
||||
addMetric("Volume Out Compression (kB)");
|
||||
addMetric("Compression Ratio (x:1)");
|
||||
addMetric("Perf Compression (kB/s)");
|
||||
|
||||
mRunBytesInDecompression = 0;
|
||||
mRunBytesInCompression = 0;
|
||||
|
||||
mTotalBytesInDecompression = 0;
|
||||
mTotalBytesOutDecompression = 0;
|
||||
mTotalBytesInCompression = 0;
|
||||
mTotalBytesOutCompression = 0;
|
||||
|
||||
mTotalTimeDecompression = 0.0f;
|
||||
mTotalTimeCompression = 0.0f;
|
||||
}
|
||||
|
||||
LLImageCompressionTester::~LLImageCompressionTester()
|
||||
{
|
||||
LLImageJ2C::sTesterp = NULL;
|
||||
}
|
||||
|
||||
//virtual
|
||||
void LLImageCompressionTester::outputTestRecord(LLSD *sd)
|
||||
{
|
||||
std::string currentLabel = getCurrentLabelName();
|
||||
|
||||
F32 decompressionPerf = 0.0f;
|
||||
F32 compressionPerf = 0.0f;
|
||||
F32 decompressionRate = 0.0f;
|
||||
F32 compressionRate = 0.0f;
|
||||
|
||||
F32 totalkBInDecompression = (F32)(mTotalBytesInDecompression) / 1000.0;
|
||||
F32 totalkBOutDecompression = (F32)(mTotalBytesOutDecompression) / 1000.0;
|
||||
F32 totalkBInCompression = (F32)(mTotalBytesInCompression) / 1000.0;
|
||||
F32 totalkBOutCompression = (F32)(mTotalBytesOutCompression) / 1000.0;
|
||||
|
||||
if (!is_approx_zero(mTotalTimeDecompression))
|
||||
{
|
||||
decompressionPerf = totalkBInDecompression / mTotalTimeDecompression;
|
||||
}
|
||||
if (!is_approx_zero(totalkBInDecompression))
|
||||
{
|
||||
decompressionRate = totalkBOutDecompression / totalkBInDecompression;
|
||||
}
|
||||
if (!is_approx_zero(mTotalTimeCompression))
|
||||
{
|
||||
compressionPerf = totalkBInCompression / mTotalTimeCompression;
|
||||
}
|
||||
if (!is_approx_zero(totalkBOutCompression))
|
||||
{
|
||||
compressionRate = totalkBInCompression / totalkBOutCompression;
|
||||
}
|
||||
|
||||
(*sd)[currentLabel]["Time Decompression (s)"] = (LLSD::Real)mTotalTimeDecompression;
|
||||
(*sd)[currentLabel]["Volume In Decompression (kB)"] = (LLSD::Real)totalkBInDecompression;
|
||||
(*sd)[currentLabel]["Volume Out Decompression (kB)"]= (LLSD::Real)totalkBOutDecompression;
|
||||
(*sd)[currentLabel]["Decompression Ratio (x:1)"] = (LLSD::Real)decompressionRate;
|
||||
(*sd)[currentLabel]["Perf Decompression (kB/s)"] = (LLSD::Real)decompressionPerf;
|
||||
|
||||
(*sd)[currentLabel]["Time Compression (s)"] = (LLSD::Real)mTotalTimeCompression;
|
||||
(*sd)[currentLabel]["Volume In Compression (kB)"] = (LLSD::Real)totalkBInCompression;
|
||||
(*sd)[currentLabel]["Volume Out Compression (kB)"] = (LLSD::Real)totalkBOutCompression;
|
||||
(*sd)[currentLabel]["Compression Ratio (x:1)"] = (LLSD::Real)compressionRate;
|
||||
(*sd)[currentLabel]["Perf Compression (kB/s)"] = (LLSD::Real)compressionPerf;
|
||||
}
|
||||
|
||||
void LLImageCompressionTester::updateCompressionStats(const F32 deltaTime)
|
||||
{
|
||||
mTotalTimeCompression += deltaTime;
|
||||
}
|
||||
|
||||
void LLImageCompressionTester::updateCompressionStats(const S32 bytesCompress, const S32 bytesRaw)
|
||||
{
|
||||
mTotalBytesInCompression += bytesRaw;
|
||||
mRunBytesInCompression += bytesRaw;
|
||||
mTotalBytesOutCompression += bytesCompress;
|
||||
if (mRunBytesInCompression > (1000000))
|
||||
{
|
||||
// Output everything
|
||||
outputTestResults();
|
||||
// Reset the compression data of the run
|
||||
mRunBytesInCompression = 0;
|
||||
}
|
||||
}
|
||||
|
||||
void LLImageCompressionTester::updateDecompressionStats(const F32 deltaTime)
|
||||
{
|
||||
mTotalTimeDecompression += deltaTime;
|
||||
}
|
||||
|
||||
void LLImageCompressionTester::updateDecompressionStats(const S32 bytesIn, const S32 bytesOut)
|
||||
{
|
||||
mTotalBytesInDecompression += bytesIn;
|
||||
mRunBytesInDecompression += bytesIn;
|
||||
mTotalBytesOutDecompression += bytesOut;
|
||||
if (mRunBytesInDecompression > (1000000))
|
||||
{
|
||||
// Output everything
|
||||
outputTestResults();
|
||||
// Reset the decompression data of the run
|
||||
mRunBytesInDecompression = 0;
|
||||
}
|
||||
}
|
||||
|
||||
//----------------------------------------------------------------------------------------------
|
||||
// End of LLTexturePipelineTester
|
||||
//----------------------------------------------------------------------------------------------
|
||||
|
||||
|
|
|
|||
|
|
@ -29,8 +29,11 @@
|
|||
|
||||
#include "llimage.h"
|
||||
#include "llassettype.h"
|
||||
#include "llmetricperformancetester.h"
|
||||
|
||||
class LLImageJ2CImpl;
|
||||
class LLImageCompressionTester ;
|
||||
|
||||
class LLImageJ2C : public LLImageFormatted
|
||||
{
|
||||
protected:
|
||||
|
|
@ -69,14 +72,13 @@ public:
|
|||
static S32 calcHeaderSizeJ2C();
|
||||
static S32 calcDataSizeJ2C(S32 w, S32 h, S32 comp, S32 discard_level, F32 rate = 0.f);
|
||||
|
||||
static void openDSO();
|
||||
static void closeDSO();
|
||||
static std::string getEngineInfo();
|
||||
|
||||
|
||||
protected:
|
||||
friend class LLImageJ2CImpl;
|
||||
friend class LLImageJ2COJ;
|
||||
friend class LLImageJ2CKDU;
|
||||
friend class LLImageCompressionTester;
|
||||
void decodeFailed();
|
||||
void updateRawDiscardLevel();
|
||||
|
||||
|
|
@ -90,6 +92,9 @@ protected:
|
|||
BOOL mReversible;
|
||||
LLImageJ2CImpl *mImpl;
|
||||
std::string mLastError;
|
||||
|
||||
// Image compression/decompression tester
|
||||
static LLImageCompressionTester* sTesterp;
|
||||
};
|
||||
|
||||
// Derive from this class to implement JPEG2000 decoding
|
||||
|
|
@ -118,4 +123,40 @@ protected:
|
|||
|
||||
#define LINDEN_J2C_COMMENT_PREFIX "LL_"
|
||||
|
||||
//
|
||||
// This class is used for performance data gathering only.
|
||||
// Tracks the image compression / decompression data,
|
||||
// records and outputs them to the log file.
|
||||
//
|
||||
class LLImageCompressionTester : public LLMetricPerformanceTesterBasic
|
||||
{
|
||||
public:
|
||||
LLImageCompressionTester();
|
||||
~LLImageCompressionTester();
|
||||
|
||||
void updateDecompressionStats(const F32 deltaTime) ;
|
||||
void updateDecompressionStats(const S32 bytesIn, const S32 bytesOut) ;
|
||||
void updateCompressionStats(const F32 deltaTime) ;
|
||||
void updateCompressionStats(const S32 bytesIn, const S32 bytesOut) ;
|
||||
|
||||
protected:
|
||||
/*virtual*/ void outputTestRecord(LLSD* sd);
|
||||
|
||||
private:
|
||||
//
|
||||
// Data size
|
||||
//
|
||||
U32 mTotalBytesInDecompression; // Total bytes fed to decompressor
|
||||
U32 mTotalBytesOutDecompression; // Total bytes produced by decompressor
|
||||
U32 mTotalBytesInCompression; // Total bytes fed to compressor
|
||||
U32 mTotalBytesOutCompression; // Total bytes produced by compressor
|
||||
U32 mRunBytesInDecompression; // Bytes fed to decompressor in this run
|
||||
U32 mRunBytesInCompression; // Bytes fed to compressor in this run
|
||||
//
|
||||
// Time
|
||||
//
|
||||
F32 mTotalTimeDecompression; // Total time spent in computing decompression
|
||||
F32 mTotalTimeCompression; // Total time spent in computing compression
|
||||
};
|
||||
|
||||
#endif
|
||||
|
|
|
|||
|
|
@ -38,6 +38,12 @@ LLImageDecodeThread::LLImageDecodeThread(bool threaded)
|
|||
mCreationMutex = new LLMutex(getAPRPool());
|
||||
}
|
||||
|
||||
//virtual
|
||||
LLImageDecodeThread::~LLImageDecodeThread()
|
||||
{
|
||||
delete mCreationMutex ;
|
||||
}
|
||||
|
||||
// MAIN THREAD
|
||||
// virtual
|
||||
S32 LLImageDecodeThread::update(U32 max_time_ms)
|
||||
|
|
|
|||
|
|
@ -73,6 +73,8 @@ public:
|
|||
|
||||
public:
|
||||
LLImageDecodeThread(bool threaded = true);
|
||||
virtual ~LLImageDecodeThread();
|
||||
|
||||
handle_t decodeImage(LLImageFormatted* image,
|
||||
U32 priority, S32 discard, BOOL needs_aux,
|
||||
Responder* responder);
|
||||
|
|
|
|||
|
|
@ -50,8 +50,6 @@ LLPngWrapper::LLPngWrapper()
|
|||
mCompressionType( 0 ),
|
||||
mFilterMethod( 0 ),
|
||||
mFinalSize( 0 ),
|
||||
mHasBKGD(false),
|
||||
mBackgroundColor(),
|
||||
mGamma(0.f)
|
||||
{
|
||||
}
|
||||
|
|
@ -111,9 +109,9 @@ void LLPngWrapper::writeFlush(png_structp png_ptr)
|
|||
}
|
||||
|
||||
// Read the PNG file using the libpng. The low-level interface is used here
|
||||
// because we want to do various transformations (including setting the
|
||||
// matte background if any, and applying gama) which can't be done with
|
||||
// the high-level interface. The scanline also begins at the bottom of
|
||||
// because we want to do various transformations (including applying gama)
|
||||
// which can't be done with the high-level interface.
|
||||
// The scanline also begins at the bottom of
|
||||
// the image (per SecondLife conventions) instead of at the top, so we
|
||||
// must assign row-pointers in "reverse" order.
|
||||
BOOL LLPngWrapper::readPng(U8* src, LLImageRaw* rawImage, ImageInfo *infop)
|
||||
|
|
@ -201,8 +199,7 @@ void LLPngWrapper::normalizeImage()
|
|||
// 2. Convert grayscales to RGB
|
||||
// 3. Create alpha layer from transparency
|
||||
// 4. Ensure 8-bpp for all images
|
||||
// 5. Apply background matte if any
|
||||
// 6. Set (or guess) gamma
|
||||
// 5. Set (or guess) gamma
|
||||
|
||||
if (mColorType == PNG_COLOR_TYPE_PALETTE)
|
||||
{
|
||||
|
|
@ -229,12 +226,6 @@ void LLPngWrapper::normalizeImage()
|
|||
{
|
||||
png_set_strip_16(mReadPngPtr);
|
||||
}
|
||||
mHasBKGD = png_get_bKGD(mReadPngPtr, mReadInfoPtr, &mBackgroundColor);
|
||||
if (mHasBKGD)
|
||||
{
|
||||
png_set_background(mReadPngPtr, mBackgroundColor,
|
||||
PNG_BACKGROUND_GAMMA_FILE, 1, 1.0);
|
||||
}
|
||||
|
||||
#if LL_DARWIN
|
||||
const F64 SCREEN_GAMMA = 1.8;
|
||||
|
|
@ -261,7 +252,6 @@ void LLPngWrapper::updateMetaData()
|
|||
mBitDepth = png_get_bit_depth(mReadPngPtr, mReadInfoPtr);
|
||||
mColorType = png_get_color_type(mReadPngPtr, mReadInfoPtr);
|
||||
mChannels = png_get_channels(mReadPngPtr, mReadInfoPtr);
|
||||
mHasBKGD = png_get_bKGD(mReadPngPtr, mReadInfoPtr, &mBackgroundColor);
|
||||
}
|
||||
|
||||
// Method to write raw image into PNG at dest. The raw scanline begins
|
||||
|
|
|
|||
|
|
@ -88,9 +88,6 @@ private:
|
|||
|
||||
U32 mFinalSize;
|
||||
|
||||
bool mHasBKGD;
|
||||
png_color_16p mBackgroundColor;
|
||||
|
||||
F64 mGamma;
|
||||
|
||||
std::string mErrorMessage;
|
||||
|
|
|
|||
|
|
@ -26,10 +26,8 @@
|
|||
*/
|
||||
|
||||
// Precompiled header: almost always required for newview cpp files
|
||||
#include <list>
|
||||
#include <map>
|
||||
#include <algorithm>
|
||||
// Class to test
|
||||
#include "linden_common.h"
|
||||
// Class to test
|
||||
#include "../llimageworker.h"
|
||||
// For timer class
|
||||
#include "../llcommon/lltimer.h"
|
||||
|
|
@ -44,7 +42,17 @@
|
|||
// * Do not make any assumption as to how those classes or methods work (i.e. don't copy/paste code)
|
||||
// * A simulator for a class can be implemented here. Please comment and document thoroughly.
|
||||
|
||||
LLImageBase::LLImageBase() {}
|
||||
LLImageBase::LLImageBase()
|
||||
: mData(NULL),
|
||||
mDataSize(0),
|
||||
mWidth(0),
|
||||
mHeight(0),
|
||||
mComponents(0),
|
||||
mBadBufferAllocation(false),
|
||||
mAllowOverSize(false),
|
||||
mMemType(LLMemType::MTYPE_IMAGEBASE)
|
||||
{
|
||||
}
|
||||
LLImageBase::~LLImageBase() {}
|
||||
void LLImageBase::dump() { }
|
||||
void LLImageBase::sanityCheck() { }
|
||||
|
|
|
|||
|
|
@ -90,6 +90,12 @@ void info_callback(const char* msg, void*)
|
|||
lldebugs << "LLImageJ2COJ: " << chomp(msg) << llendl;
|
||||
}
|
||||
|
||||
// Divide a by 2 to the power of b and round upwards
|
||||
int ceildivpow2(int a, int b)
|
||||
{
|
||||
return (a + (1 << b) - 1) >> b;
|
||||
}
|
||||
|
||||
|
||||
LLImageJ2COJ::LLImageJ2COJ()
|
||||
: LLImageJ2CImpl()
|
||||
|
|
|
|||
|
|
@ -34,17 +34,11 @@ class LLImageJ2COJ : public LLImageJ2CImpl
|
|||
public:
|
||||
LLImageJ2COJ();
|
||||
virtual ~LLImageJ2COJ();
|
||||
|
||||
protected:
|
||||
/*virtual*/ BOOL getMetadata(LLImageJ2C &base);
|
||||
/*virtual*/ BOOL decodeImpl(LLImageJ2C &base, LLImageRaw &raw_image, F32 decode_time, S32 first_channel, S32 max_channel_count);
|
||||
/*virtual*/ BOOL encodeImpl(LLImageJ2C &base, const LLImageRaw &raw_image, const char* comment_text, F32 encode_time=0.0,
|
||||
BOOL reversible = FALSE);
|
||||
int ceildivpow2(int a, int b)
|
||||
{
|
||||
// Divide a by b to the power of 2 and round upwards.
|
||||
return (a + (1 << b) - 1) >> b;
|
||||
}
|
||||
};
|
||||
|
||||
#endif
|
||||
|
|
|
|||
|
|
@ -61,8 +61,6 @@ static const std::string INV_FOLDER_ID_LABEL_WS("category_id");
|
|||
///----------------------------------------------------------------------------
|
||||
/// Local function declarations, constants, enums, and typedefs
|
||||
///----------------------------------------------------------------------------
|
||||
const U8 TASK_INVENTORY_ITEM_KEY = 0;
|
||||
const U8 TASK_INVENTORY_ASSET_KEY = 1;
|
||||
|
||||
const LLUUID MAGIC_ID("3c115e51-04f4-523c-9fa6-98aff1034730");
|
||||
|
||||
|
|
|
|||
|
|
@ -199,7 +199,7 @@ bool LLNotecard::importStream(std::istream& str)
|
|||
return FALSE;
|
||||
}
|
||||
|
||||
if(text_len > mMaxText)
|
||||
if(text_len > mMaxText || text_len < 0)
|
||||
{
|
||||
llwarns << "Invalid Linden text length: " << text_len << llendl;
|
||||
return FALSE;
|
||||
|
|
|
|||
|
|
@ -108,6 +108,9 @@ std::string build_transfer_message_to_source(
|
|||
std::ostringstream ostr;
|
||||
if(dest_id.isNull())
|
||||
{
|
||||
// *NOTE: Do not change these strings! The viewer matches
|
||||
// them in llviewermessage.cpp to perform localization.
|
||||
// If you need to make changes, add a new, localizable message. JC
|
||||
ostr << "You paid L$" << amount;
|
||||
switch(transaction_type)
|
||||
{
|
||||
|
|
@ -154,6 +157,9 @@ std::string build_transfer_message_to_destination(
|
|||
return description;
|
||||
}
|
||||
std::ostringstream ostr;
|
||||
// *NOTE: Do not change these strings! The viewer matches
|
||||
// them in llviewermessage.cpp to perform localization.
|
||||
// If you need to make changes, add a new, localizable message. JC
|
||||
ostr << source_name << " paid you L$" << amount;
|
||||
append_reason(ostr, transaction_type, description);
|
||||
ostr << ".";
|
||||
|
|
|
|||
|
|
@ -0,0 +1,55 @@
|
|||
# -*- cmake -*-
|
||||
|
||||
project(llkdu)
|
||||
|
||||
# Visual Studio 2005 has a dumb bug that causes it to fail compilation
|
||||
# of KDU if building with both optimisation and /WS (treat warnings as
|
||||
# errors), even when the specific warnings that make it croak are
|
||||
# disabled.
|
||||
|
||||
#set(VS_DISABLE_FATAL_WARNINGS ON)
|
||||
|
||||
include(00-Common)
|
||||
include(LLCommon)
|
||||
include(LLImage)
|
||||
include(LLKDU)
|
||||
include(LLMath)
|
||||
|
||||
include_directories(
|
||||
${LLCOMMON_INCLUDE_DIRS}
|
||||
${LLIMAGE_INCLUDE_DIRS}
|
||||
${KDU_INCLUDE_DIR}
|
||||
${LLMATH_INCLUDE_DIRS}
|
||||
)
|
||||
|
||||
set(llkdu_SOURCE_FILES
|
||||
llimagej2ckdu.cpp
|
||||
llkdumem.cpp
|
||||
)
|
||||
|
||||
set(llkdu_HEADER_FILES
|
||||
CMakeLists.txt
|
||||
|
||||
llimagej2ckdu.h
|
||||
llkdumem.h
|
||||
)
|
||||
|
||||
set_source_files_properties(${llkdu_HEADER_FILES}
|
||||
PROPERTIES HEADER_FILE_ONLY TRUE)
|
||||
|
||||
list(APPEND llkdu_SOURCE_FILES ${llkdu_HEADER_FILES})
|
||||
|
||||
if (USE_KDU)
|
||||
add_library (${LLKDU_LIBRARIES} ${llkdu_SOURCE_FILES})
|
||||
|
||||
# Add tests
|
||||
if (LL_TESTS)
|
||||
include(LLAddBuildTest)
|
||||
include(Tut)
|
||||
SET(llkdu_TEST_SOURCE_FILES
|
||||
llimagej2ckdu.cpp
|
||||
)
|
||||
LL_ADD_PROJECT_UNIT_TESTS(llkdu "${llkdu_TEST_SOURCE_FILES}")
|
||||
endif (LL_TESTS)
|
||||
|
||||
endif (USE_KDU)
|
||||
File diff suppressed because it is too large
Load Diff
|
|
@ -0,0 +1,90 @@
|
|||
/**
|
||||
* @file llimagej2ckdu.h
|
||||
* @brief This is an implementation of JPEG2000 encode/decode using Kakadu
|
||||
*
|
||||
* $LicenseInfo:firstyear=2010&license=viewerlgpl$
|
||||
* Second Life Viewer Source Code
|
||||
* Copyright (C) 2010, Linden Research, Inc.
|
||||
*
|
||||
* This library is free software; you can redistribute it and/or
|
||||
* modify it under the terms of the GNU Lesser General Public
|
||||
* License as published by the Free Software Foundation;
|
||||
* version 2.1 of the License only.
|
||||
*
|
||||
* This library is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
* Lesser General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU Lesser General Public
|
||||
* License along with this library; if not, write to the Free Software
|
||||
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
|
||||
*
|
||||
* Linden Research, Inc., 945 Battery Street, San Francisco, CA 94111 USA
|
||||
* $/LicenseInfo$
|
||||
*/
|
||||
|
||||
#ifndef LL_LLIMAGEJ2CKDU_H
|
||||
#define LL_LLIMAGEJ2CKDU_H
|
||||
|
||||
#include "llimagej2c.h"
|
||||
|
||||
//
|
||||
// KDU core header files
|
||||
//
|
||||
#include "kdu_elementary.h"
|
||||
#include "kdu_messaging.h"
|
||||
#include "kdu_params.h"
|
||||
#include "kdu_compressed.h"
|
||||
#include "kdu_sample_processing.h"
|
||||
|
||||
class LLKDUDecodeState;
|
||||
class LLKDUMemSource;
|
||||
|
||||
class LLImageJ2CKDU : public LLImageJ2CImpl
|
||||
{
|
||||
public:
|
||||
enum ECodeStreamMode
|
||||
{
|
||||
MODE_FAST = 0,
|
||||
MODE_RESILIENT = 1,
|
||||
MODE_FUSSY = 2
|
||||
};
|
||||
LLImageJ2CKDU();
|
||||
virtual ~LLImageJ2CKDU();
|
||||
|
||||
protected:
|
||||
/*virtual*/ BOOL getMetadata(LLImageJ2C &base);
|
||||
/*virtual*/ BOOL decodeImpl(LLImageJ2C &base, LLImageRaw &raw_image, F32 decode_time, S32 first_channel, S32 max_channel_count);
|
||||
/*virtual*/ BOOL encodeImpl(LLImageJ2C &base, const LLImageRaw &raw_image, const char* comment_text, F32 encode_time=0.0,
|
||||
BOOL reversible=FALSE);
|
||||
|
||||
private:
|
||||
void setupCodeStream(LLImageJ2C &base, BOOL keep_codestream, ECodeStreamMode mode);
|
||||
void cleanupCodeStream();
|
||||
BOOL initDecode(LLImageJ2C &base, LLImageRaw &raw_image, F32 decode_time, ECodeStreamMode mode, S32 first_channel, S32 max_channel_count );
|
||||
|
||||
// Encode variable
|
||||
LLKDUMemSource *mInputp;
|
||||
kdu_codestream *mCodeStreamp;
|
||||
kdu_coords *mTPosp; // tile position
|
||||
kdu_dims *mTileIndicesp;
|
||||
|
||||
// Temporary variables for in-progress decodes...
|
||||
LLImageRaw *mRawImagep;
|
||||
LLKDUDecodeState *mDecodeState;
|
||||
};
|
||||
|
||||
#if LL_WINDOWS
|
||||
# define LLSYMEXPORT __declspec(dllexport)
|
||||
#elif LL_LINUX
|
||||
# define LLSYMEXPORT __attribute__ ((visibility("default")))
|
||||
#else
|
||||
# define LLSYMEXPORT
|
||||
#endif
|
||||
|
||||
extern "C" LLSYMEXPORT const char* engineInfoLLImageJ2CKDU();
|
||||
extern "C" LLSYMEXPORT LLImageJ2CKDU* createLLImageJ2CKDU();
|
||||
extern "C" LLSYMEXPORT void destroyLLImageJ2CKDU(LLImageJ2CKDU* kdu);
|
||||
|
||||
#endif
|
||||
|
|
@ -0,0 +1,196 @@
|
|||
/**
|
||||
* @file llkdumem.cpp
|
||||
* @brief Helper class for kdu memory management
|
||||
*
|
||||
* $LicenseInfo:firstyear=2010&license=viewerlgpl$
|
||||
* Second Life Viewer Source Code
|
||||
* Copyright (C) 2010, Linden Research, Inc.
|
||||
*
|
||||
* This library is free software; you can redistribute it and/or
|
||||
* modify it under the terms of the GNU Lesser General Public
|
||||
* License as published by the Free Software Foundation;
|
||||
* version 2.1 of the License only.
|
||||
*
|
||||
* This library is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
* Lesser General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU Lesser General Public
|
||||
* License along with this library; if not, write to the Free Software
|
||||
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
|
||||
*
|
||||
* Linden Research, Inc., 945 Battery Street, San Francisco, CA 94111 USA
|
||||
* $/LicenseInfo$
|
||||
*/
|
||||
|
||||
#include "linden_common.h"
|
||||
#include "llkdumem.h"
|
||||
#include "llerror.h"
|
||||
|
||||
#if defined(LL_WINDOWS)
|
||||
# pragma warning(disable: 4702) // unreachable code
|
||||
#endif
|
||||
|
||||
LLKDUMemIn::LLKDUMemIn(const U8 *data,
|
||||
const U32 size,
|
||||
const U16 width,
|
||||
const U16 height,
|
||||
const U8 in_num_components,
|
||||
siz_params *siz)
|
||||
{
|
||||
U8 n;
|
||||
|
||||
first_comp_idx = 0;
|
||||
rows = height;
|
||||
cols = width;
|
||||
num_components = in_num_components;
|
||||
alignment_bytes = 0;
|
||||
|
||||
for (n=0; n<3; ++n)
|
||||
{
|
||||
precision[n] = 0;
|
||||
}
|
||||
|
||||
for (n=0; n < num_components; ++n)
|
||||
{
|
||||
siz->set(Sdims,n,0,rows);
|
||||
siz->set(Sdims,n,1,cols);
|
||||
siz->set(Ssigned,n,0,false);
|
||||
siz->set(Sprecision,n,0,8);
|
||||
}
|
||||
incomplete_lines = NULL;
|
||||
free_lines = NULL;
|
||||
num_unread_rows = rows;
|
||||
|
||||
mData = data;
|
||||
mDataSize = size;
|
||||
mCurPos = 0;
|
||||
}
|
||||
|
||||
LLKDUMemIn::~LLKDUMemIn()
|
||||
{
|
||||
if ((num_unread_rows > 0) || (incomplete_lines != NULL))
|
||||
{
|
||||
kdu_warning w;
|
||||
w << "Not all rows of image components "
|
||||
<< first_comp_idx << " through "
|
||||
<< first_comp_idx+num_components-1
|
||||
<< " were consumed!";
|
||||
}
|
||||
image_line_buf *tmp;
|
||||
while ((tmp=incomplete_lines) != NULL)
|
||||
{
|
||||
incomplete_lines = tmp->next;
|
||||
delete tmp;
|
||||
}
|
||||
while ((tmp=free_lines) != NULL)
|
||||
{
|
||||
free_lines = tmp->next;
|
||||
delete tmp;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
bool LLKDUMemIn::get(int comp_idx, kdu_line_buf &line, int x_tnum)
|
||||
{
|
||||
int idx = comp_idx - this->first_comp_idx;
|
||||
assert((idx >= 0) && (idx < num_components));
|
||||
x_tnum = x_tnum*num_components+idx;
|
||||
image_line_buf *scan, *prev=NULL;
|
||||
for (scan=incomplete_lines; scan != NULL; prev=scan, scan=scan->next)
|
||||
{
|
||||
assert(scan->next_x_tnum >= x_tnum);
|
||||
if (scan->next_x_tnum == x_tnum)
|
||||
{
|
||||
break;
|
||||
}
|
||||
}
|
||||
if (scan == NULL)
|
||||
{ // Need to read a new image line.
|
||||
assert(x_tnum == 0); // Must consume in very specific order.
|
||||
if (num_unread_rows == 0)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
if ((scan = free_lines) == NULL)
|
||||
{
|
||||
scan = new image_line_buf(cols+3,num_components);
|
||||
}
|
||||
free_lines = scan->next;
|
||||
if (prev == NULL)
|
||||
{
|
||||
incomplete_lines = scan;
|
||||
}
|
||||
else
|
||||
{
|
||||
prev->next = scan;
|
||||
}
|
||||
|
||||
// Copy from image buffer into scan.
|
||||
memcpy(scan->buf, mData+mCurPos, cols*num_components);
|
||||
mCurPos += cols*num_components;
|
||||
|
||||
num_unread_rows--;
|
||||
scan->accessed_samples = 0;
|
||||
scan->next_x_tnum = 0;
|
||||
}
|
||||
|
||||
assert((cols-scan->accessed_samples) >= line.get_width());
|
||||
|
||||
int comp_offset = idx;
|
||||
kdu_byte *sp = scan->buf+num_components*scan->accessed_samples + comp_offset;
|
||||
int n=line.get_width();
|
||||
|
||||
if (line.get_buf32() != NULL)
|
||||
{
|
||||
kdu_sample32 *dp = line.get_buf32();
|
||||
if (line.is_absolute())
|
||||
{ // 32-bit absolute integers
|
||||
for (; n > 0; n--, sp+=num_components, dp++)
|
||||
{
|
||||
dp->ival = ((kdu_int32)(*sp)) - 128;
|
||||
}
|
||||
}
|
||||
else
|
||||
{ // true 32-bit floats
|
||||
for (; n > 0; n--, sp+=num_components, dp++)
|
||||
{
|
||||
dp->fval = (((float)(*sp)) / 256.0F) - 0.5F;
|
||||
}
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
kdu_sample16 *dp = line.get_buf16();
|
||||
if (line.is_absolute())
|
||||
{ // 16-bit absolute integers
|
||||
for (; n > 0; n--, sp+=num_components, dp++)
|
||||
{
|
||||
dp->ival = ((kdu_int16)(*sp)) - 128;
|
||||
}
|
||||
}
|
||||
else
|
||||
{ // 16-bit normalized representation.
|
||||
for (; n > 0; n--, sp+=num_components, dp++)
|
||||
{
|
||||
dp->ival = (((kdu_int16)(*sp)) - 128) << (KDU_FIX_POINT-8);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
scan->next_x_tnum++;
|
||||
if (idx == (num_components-1))
|
||||
{
|
||||
scan->accessed_samples += line.get_width();
|
||||
}
|
||||
if (scan->accessed_samples == cols)
|
||||
{ // Send empty line to free list.
|
||||
assert(scan == incomplete_lines);
|
||||
incomplete_lines = scan->next;
|
||||
scan->next = free_lines;
|
||||
free_lines = scan;
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
|
@ -0,0 +1,145 @@
|
|||
/**
|
||||
* @file llkdumem.h
|
||||
* @brief Helper class for kdu memory management
|
||||
*
|
||||
* $LicenseInfo:firstyear=2010&license=viewerlgpl$
|
||||
* Second Life Viewer Source Code
|
||||
* Copyright (C) 2010, Linden Research, Inc.
|
||||
*
|
||||
* This library is free software; you can redistribute it and/or
|
||||
* modify it under the terms of the GNU Lesser General Public
|
||||
* License as published by the Free Software Foundation;
|
||||
* version 2.1 of the License only.
|
||||
*
|
||||
* This library is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
* Lesser General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU Lesser General Public
|
||||
* License along with this library; if not, write to the Free Software
|
||||
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
|
||||
*
|
||||
* Linden Research, Inc., 945 Battery Street, San Francisco, CA 94111 USA
|
||||
* $/LicenseInfo$
|
||||
*/
|
||||
|
||||
#ifndef LL_LLKDUMEM_H
|
||||
#define LL_LLKDUMEM_H
|
||||
|
||||
// Support classes for reading and writing from memory buffers in KDU
|
||||
#include "kdu_image.h"
|
||||
#include "kdu_elementary.h"
|
||||
#include "kdu_messaging.h"
|
||||
#include "kdu_params.h"
|
||||
#include "kdu_compressed.h"
|
||||
#include "kdu_sample_processing.h"
|
||||
#include "image_local.h"
|
||||
#include "stdtypes.h"
|
||||
|
||||
class LLKDUMemSource: public kdu_compressed_source
|
||||
{
|
||||
public: // Member functions
|
||||
LLKDUMemSource(U8 *input_buffer, U32 size)
|
||||
{
|
||||
mData = input_buffer;
|
||||
mSize = size;
|
||||
mCurPos = 0;
|
||||
}
|
||||
|
||||
~LLKDUMemSource()
|
||||
{
|
||||
}
|
||||
|
||||
int read(kdu_byte *buf, int num_bytes)
|
||||
{
|
||||
U32 num_out;
|
||||
num_out = num_bytes;
|
||||
|
||||
if ((mSize - mCurPos) < (U32)num_bytes)
|
||||
{
|
||||
num_out = mSize -mCurPos;
|
||||
}
|
||||
memcpy(buf, mData + mCurPos, num_out);
|
||||
mCurPos += num_out;
|
||||
return num_out;
|
||||
}
|
||||
|
||||
void reset()
|
||||
{
|
||||
mCurPos = 0;
|
||||
}
|
||||
|
||||
private: // Data
|
||||
U8 *mData;
|
||||
U32 mSize;
|
||||
U32 mCurPos;
|
||||
};
|
||||
|
||||
class LLKDUMemTarget: public kdu_compressed_target
|
||||
{
|
||||
public: // Member functions
|
||||
LLKDUMemTarget(U8 *output_buffer, U32 &output_size, const U32 buffer_size)
|
||||
{
|
||||
mData = output_buffer;
|
||||
mSize = buffer_size;
|
||||
mCurPos = 0;
|
||||
mOutputSize = &output_size;
|
||||
}
|
||||
|
||||
~LLKDUMemTarget()
|
||||
{
|
||||
}
|
||||
|
||||
bool write(const kdu_byte *buf, int num_bytes)
|
||||
{
|
||||
U32 num_out;
|
||||
num_out = num_bytes;
|
||||
|
||||
if ((mSize - mCurPos) < (U32)num_bytes)
|
||||
{
|
||||
num_out = mSize - mCurPos;
|
||||
memcpy(mData + mCurPos, buf, num_out);
|
||||
return false;
|
||||
}
|
||||
memcpy(mData + mCurPos, buf, num_out);
|
||||
mCurPos += num_out;
|
||||
*mOutputSize = mCurPos;
|
||||
return true;
|
||||
}
|
||||
|
||||
private: // Data
|
||||
U8 *mData;
|
||||
U32 mSize;
|
||||
U32 mCurPos;
|
||||
U32 *mOutputSize;
|
||||
};
|
||||
|
||||
class LLKDUMemIn : public kdu_image_in_base
|
||||
{
|
||||
public: // Member functions
|
||||
LLKDUMemIn(const U8 *data,
|
||||
const U32 size,
|
||||
const U16 rows,
|
||||
const U16 cols,
|
||||
U8 in_num_components,
|
||||
siz_params *siz);
|
||||
~LLKDUMemIn();
|
||||
|
||||
bool get(int comp_idx, kdu_line_buf &line, int x_tnum);
|
||||
|
||||
private: // Data
|
||||
const U8 *mData;
|
||||
int first_comp_idx;
|
||||
int num_components;
|
||||
int rows, cols;
|
||||
int alignment_bytes; // Number of 0's at end of each line.
|
||||
int precision[3];
|
||||
image_line_buf *incomplete_lines; // Each "sample" represents a full pixel
|
||||
image_line_buf *free_lines;
|
||||
int num_unread_rows;
|
||||
|
||||
U32 mCurPos;
|
||||
U32 mDataSize;
|
||||
};
|
||||
#endif
|
||||
|
|
@ -0,0 +1,248 @@
|
|||
/**
|
||||
* @file llimagej2ckdu_test.cpp
|
||||
* @author Merov Linden
|
||||
* @date 2010-12-17
|
||||
*
|
||||
* $LicenseInfo:firstyear=2006&license=viewerlgpl$
|
||||
* Second Life Viewer Source Code
|
||||
* Copyright (C) 2010, Linden Research, Inc.
|
||||
*
|
||||
* This library is free software; you can redistribute it and/or
|
||||
* modify it under the terms of the GNU Lesser General Public
|
||||
* License as published by the Free Software Foundation;
|
||||
* version 2.1 of the License only.
|
||||
*
|
||||
* This library is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
* Lesser General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU Lesser General Public
|
||||
* License along with this library; if not, write to the Free Software
|
||||
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
|
||||
*
|
||||
* Linden Research, Inc., 945 Battery Street, San Francisco, CA 94111 USA
|
||||
* $/LicenseInfo$
|
||||
*/
|
||||
|
||||
#include "linden_common.h"
|
||||
// Class to test
|
||||
#include "../llimagej2ckdu.h"
|
||||
#include "../llkdumem.h"
|
||||
// Tut header
|
||||
#include "../test/lltut.h"
|
||||
|
||||
// -------------------------------------------------------------------------------------------
|
||||
// Stubbing: Declarations required to link and run the class being tested
|
||||
// Notes:
|
||||
// * Add here stubbed implementation of the few classes and methods used in the class to be tested
|
||||
// * Add as little as possible (let the link errors guide you)
|
||||
// * Do not make any assumption as to how those classes or methods work (i.e. don't copy/paste code)
|
||||
// * A simulator for a class can be implemented here. Please comment and document thoroughly.
|
||||
|
||||
// End Stubbing
|
||||
// -------------------------------------------------------------------------------------------
|
||||
// Stubb the LL Image Classes
|
||||
LLImageRaw::LLImageRaw() { }
|
||||
LLImageRaw::~LLImageRaw() { }
|
||||
U8* LLImageRaw::allocateData(S32 ) { return NULL; }
|
||||
void LLImageRaw::deleteData() { }
|
||||
U8* LLImageRaw::reallocateData(S32 ) { return NULL; }
|
||||
BOOL LLImageRaw::resize(U16, U16, S8) { return TRUE; } // this method always returns TRUE...
|
||||
|
||||
LLImageBase::LLImageBase()
|
||||
: mData(NULL),
|
||||
mDataSize(0),
|
||||
mWidth(0),
|
||||
mHeight(0),
|
||||
mComponents(0),
|
||||
mBadBufferAllocation(false),
|
||||
mAllowOverSize(false),
|
||||
mMemType(LLMemType::MTYPE_IMAGEBASE)
|
||||
{ }
|
||||
LLImageBase::~LLImageBase() { }
|
||||
U8* LLImageBase::allocateData(S32 ) { return NULL; }
|
||||
void LLImageBase::deleteData() { }
|
||||
void LLImageBase::dump() { }
|
||||
const U8* LLImageBase::getData() const { return NULL; }
|
||||
U8* LLImageBase::getData() { return NULL; }
|
||||
U8* LLImageBase::reallocateData(S32 ) { return NULL; }
|
||||
void LLImageBase::sanityCheck() { }
|
||||
void LLImageBase::setSize(S32 , S32 , S32 ) { }
|
||||
|
||||
LLImageJ2CImpl::~LLImageJ2CImpl() { }
|
||||
|
||||
LLImageFormatted::LLImageFormatted(S8 ) { }
|
||||
LLImageFormatted::~LLImageFormatted() { }
|
||||
U8* LLImageFormatted::allocateData(S32 ) { return NULL; }
|
||||
S32 LLImageFormatted::calcDataSize(S32 ) { return 0; }
|
||||
S32 LLImageFormatted::calcDiscardLevelBytes(S32 ) { return 0; }
|
||||
BOOL LLImageFormatted::decodeChannels(LLImageRaw*, F32, S32, S32) { return FALSE; }
|
||||
BOOL LLImageFormatted::copyData(U8 *, S32) { return TRUE; } // this method always returns TRUE...
|
||||
void LLImageFormatted::deleteData() { }
|
||||
void LLImageFormatted::dump() { }
|
||||
U8* LLImageFormatted::reallocateData(S32 ) { return NULL; }
|
||||
void LLImageFormatted::resetLastError() { }
|
||||
void LLImageFormatted::sanityCheck() { }
|
||||
void LLImageFormatted::setLastError(const std::string& , const std::string& ) { }
|
||||
|
||||
LLImageJ2C::LLImageJ2C() : LLImageFormatted(IMG_CODEC_J2C) { }
|
||||
LLImageJ2C::~LLImageJ2C() { }
|
||||
S32 LLImageJ2C::calcDataSize(S32 ) { return 0; }
|
||||
S32 LLImageJ2C::calcDiscardLevelBytes(S32 ) { return 0; }
|
||||
S32 LLImageJ2C::calcHeaderSize() { return 0; }
|
||||
BOOL LLImageJ2C::decode(LLImageRaw*, F32) { return FALSE; }
|
||||
BOOL LLImageJ2C::decodeChannels(LLImageRaw*, F32, S32, S32 ) { return FALSE; }
|
||||
void LLImageJ2C::decodeFailed() { }
|
||||
BOOL LLImageJ2C::encode(const LLImageRaw*, F32) { return FALSE; }
|
||||
S8 LLImageJ2C::getRawDiscardLevel() { return 0; }
|
||||
void LLImageJ2C::resetLastError() { }
|
||||
void LLImageJ2C::setLastError(const std::string&, const std::string&) { }
|
||||
BOOL LLImageJ2C::updateData() { return FALSE; }
|
||||
void LLImageJ2C::updateRawDiscardLevel() { }
|
||||
|
||||
LLKDUMemIn::LLKDUMemIn(const U8*, const U32, const U16, const U16, const U8, siz_params*) { }
|
||||
LLKDUMemIn::~LLKDUMemIn() { }
|
||||
bool LLKDUMemIn::get(int, kdu_line_buf&, int) { return false; }
|
||||
|
||||
// Stub Kakadu Library calls
|
||||
kdu_tile_comp kdu_tile::access_component(int ) { kdu_tile_comp a; return a; }
|
||||
void kdu_tile::close(kdu_thread_env* ) { }
|
||||
int kdu_tile::get_num_components() { return 0; }
|
||||
bool kdu_tile::get_ycc() { return false; }
|
||||
void kdu_tile::set_components_of_interest(int , const int* ) { }
|
||||
kdu_resolution kdu_tile_comp::access_resolution() { kdu_resolution a; return a; }
|
||||
int kdu_tile_comp::get_bit_depth(bool ) { return 8; }
|
||||
bool kdu_tile_comp::get_reversible() { return false; }
|
||||
kdu_subband kdu_resolution::access_subband(int ) { kdu_subband a; return a; }
|
||||
void kdu_resolution::get_dims(kdu_dims& ) { }
|
||||
int kdu_resolution::which() { return 0; }
|
||||
kdu_decoder::kdu_decoder(kdu_subband , kdu_sample_allocator*, bool , float, int, kdu_thread_env*, kdu_thread_queue*) { }
|
||||
kdu_synthesis::kdu_synthesis(kdu_resolution, kdu_sample_allocator*, bool, float, kdu_thread_env*, kdu_thread_queue*) { }
|
||||
kdu_params::kdu_params(const char*, bool, bool, bool, bool, bool) { }
|
||||
kdu_params::~kdu_params() { }
|
||||
void kdu_params::set(const char* , int , int , bool ) { }
|
||||
void kdu_params::set(const char* , int , int , int ) { }
|
||||
void kdu_params::finalize_all(bool ) { }
|
||||
void kdu_params::copy_from(kdu_params*, int, int, int, int, int, bool, bool, bool) { }
|
||||
bool kdu_params::parse_string(const char*) { return false; }
|
||||
bool kdu_params::get(const char*, int, int, bool&, bool, bool, bool) { return false; }
|
||||
bool kdu_params::get(const char*, int, int, float&, bool, bool, bool) { return false; }
|
||||
bool kdu_params::get(const char*, int, int, int&, bool, bool, bool) { return false; }
|
||||
kdu_params* kdu_params::access_relation(int, int, int, bool) { return NULL; }
|
||||
kdu_params* kdu_params::access_cluster(const char*) { return NULL; }
|
||||
void kdu_codestream::set_fast() { }
|
||||
void kdu_codestream::set_fussy() { }
|
||||
void kdu_codestream::get_dims(int, kdu_dims&, bool ) { }
|
||||
void kdu_codestream::change_appearance(bool, bool, bool) { }
|
||||
void kdu_codestream::get_tile_dims(kdu_coords, int, kdu_dims&, bool ) { }
|
||||
void kdu_codestream::destroy() { }
|
||||
void kdu_codestream::collect_timing_stats(int ) { }
|
||||
void kdu_codestream::set_max_bytes(kdu_long, bool, bool ) { }
|
||||
void kdu_codestream::get_valid_tiles(kdu_dims& ) { }
|
||||
void kdu_codestream::create(siz_params*, kdu_compressed_target*, kdu_dims*, int, kdu_long ) { }
|
||||
void kdu_codestream::create(kdu_compressed_source*, kdu_thread_env*) { }
|
||||
void kdu_codestream::apply_input_restrictions( int, int, int, int, kdu_dims*, kdu_component_access_mode ) { }
|
||||
void kdu_codestream::get_subsampling(int , kdu_coords&, bool ) { }
|
||||
void kdu_codestream::flush(kdu_long *, int , kdu_uint16 *, bool, bool, double, kdu_thread_env*) { }
|
||||
void kdu_codestream::set_resilient(bool ) { }
|
||||
int kdu_codestream::get_num_components(bool ) { return 0; }
|
||||
siz_params* kdu_codestream::access_siz() { return NULL; }
|
||||
kdu_tile kdu_codestream::open_tile(kdu_coords , kdu_thread_env* ) { kdu_tile a; return a; }
|
||||
kdu_codestream_comment kdu_codestream::add_comment() { kdu_codestream_comment a; return a; }
|
||||
bool kdu_codestream_comment::put_text(const char*) { return false; }
|
||||
void kdu_customize_warnings(kdu_message*) { }
|
||||
void kdu_customize_errors(kdu_message*) { }
|
||||
void kdu_convert_ycc_to_rgb(kdu_line_buf&, kdu_line_buf&, kdu_line_buf&, int) { }
|
||||
kdu_long kdu_multi_analysis::create(kdu_codestream, kdu_tile, bool, kdu_roi_image*, bool, int, kdu_thread_env*, kdu_thread_queue*, bool ) { kdu_long a = 0; return a; }
|
||||
siz_params::siz_params() : kdu_params(NULL, false, false, false, false, false) { }
|
||||
void siz_params::finalize(bool ) { }
|
||||
void siz_params::copy_with_xforms(kdu_params*, int, int, bool, bool, bool) { }
|
||||
int siz_params::write_marker_segment(kdu_output*, kdu_params*, int) { return 0; }
|
||||
bool siz_params::check_marker_segment(kdu_uint16, int, kdu_byte a[], int&) { return false; }
|
||||
bool siz_params::read_marker_segment(kdu_uint16, int, kdu_byte a[], int) { return false; }
|
||||
|
||||
// -------------------------------------------------------------------------------------------
|
||||
// TUT
|
||||
// -------------------------------------------------------------------------------------------
|
||||
|
||||
namespace tut
|
||||
{
|
||||
// Test wrapper declarations
|
||||
struct llimagej2ckdu_test
|
||||
{
|
||||
// Derived test class
|
||||
class LLTestImageJ2CKDU : public LLImageJ2CKDU
|
||||
{
|
||||
public:
|
||||
// Provides public access to some protected methods for testing
|
||||
BOOL callGetMetadata(LLImageJ2C &base) { return getMetadata(base); }
|
||||
BOOL callDecodeImpl(LLImageJ2C &base, LLImageRaw &raw_image, F32 decode_time, S32 first_channel, S32 max_channel_count)
|
||||
{
|
||||
return decodeImpl(base, raw_image, decode_time, first_channel, max_channel_count);
|
||||
}
|
||||
BOOL callEncodeImpl(LLImageJ2C &base, const LLImageRaw &raw_image, const char* comment_text)
|
||||
{
|
||||
return encodeImpl(base, raw_image, comment_text);
|
||||
}
|
||||
};
|
||||
// Instance to be tested
|
||||
LLTestImageJ2CKDU* mImage;
|
||||
|
||||
// Constructor and destructor of the test wrapper
|
||||
llimagej2ckdu_test()
|
||||
{
|
||||
mImage = new LLTestImageJ2CKDU;
|
||||
}
|
||||
~llimagej2ckdu_test()
|
||||
{
|
||||
delete mImage;
|
||||
}
|
||||
};
|
||||
|
||||
// Tut templating thingamagic: test group, object and test instance
|
||||
typedef test_group<llimagej2ckdu_test> llimagej2ckdu_t;
|
||||
typedef llimagej2ckdu_t::object llimagej2ckdu_object_t;
|
||||
tut::llimagej2ckdu_t tut_llimagej2ckdu("LLImageJ2CKDU");
|
||||
|
||||
// ---------------------------------------------------------------------------------------
|
||||
// Test functions
|
||||
// Notes:
|
||||
// * Test as many as you possibly can without requiring a full blown simulation of everything
|
||||
// * The tests are executed in sequence so the test instance state may change between calls
|
||||
// * Remember that you cannot test private methods with tut
|
||||
// ---------------------------------------------------------------------------------------
|
||||
|
||||
// Test 1 : test getMetadata()
|
||||
template<> template<>
|
||||
void llimagej2ckdu_object_t::test<1>()
|
||||
{
|
||||
LLImageJ2C* image = new LLImageJ2C();
|
||||
BOOL res = mImage->callGetMetadata(*image);
|
||||
// Trying to set up a data stream with all NIL values and stubbed KDU will "work" and return TRUE
|
||||
// Note that is linking with KDU, that call will throw an exception and fail, returning FALSE
|
||||
ensure("getMetadata() test failed", res == TRUE);
|
||||
}
|
||||
|
||||
// Test 2 : test decodeImpl()
|
||||
template<> template<>
|
||||
void llimagej2ckdu_object_t::test<2>()
|
||||
{
|
||||
LLImageJ2C* image = new LLImageJ2C();
|
||||
LLImageRaw* raw = new LLImageRaw();
|
||||
BOOL res = mImage->callDecodeImpl(*image, *raw, 0.0, 0, 0);
|
||||
// Decoding returns TRUE whenever there's nothing else to do, including if decoding failed, so we'll get TRUE here
|
||||
ensure("decodeImpl() test failed", res == TRUE);
|
||||
}
|
||||
|
||||
// Test 3 : test encodeImpl()
|
||||
template<> template<>
|
||||
void llimagej2ckdu_object_t::test<3>()
|
||||
{
|
||||
LLImageJ2C* image = new LLImageJ2C();
|
||||
LLImageRaw* raw = new LLImageRaw();
|
||||
BOOL res = mImage->callEncodeImpl(*image, *raw, NULL);
|
||||
// Encoding returns TRUE unless an exception was raised, so we'll get TRUE here though nothing really was done
|
||||
ensure("encodeImpl() test failed", res == TRUE);
|
||||
}
|
||||
}
|
||||
|
|
@ -89,6 +89,19 @@ void LLBBox::addBBoxAgent(const LLBBox& b)
|
|||
}
|
||||
}
|
||||
|
||||
LLBBox LLBBox::getAxisAligned() const
|
||||
{
|
||||
// no rotation = axis aligned rotation
|
||||
LLBBox aligned(mPosAgent, LLQuaternion(), LLVector3(), LLVector3());
|
||||
|
||||
// add the center point so that it's not empty
|
||||
aligned.addPointAgent(mPosAgent);
|
||||
|
||||
// add our BBox
|
||||
aligned.addBBoxAgent(*this);
|
||||
|
||||
return aligned;
|
||||
}
|
||||
|
||||
void LLBBox::expand( F32 delta )
|
||||
{
|
||||
|
|
@ -147,6 +160,15 @@ BOOL LLBBox::containsPointAgent(const LLVector3& p) const
|
|||
return containsPointLocal(point_local);
|
||||
}
|
||||
|
||||
LLVector3 LLBBox::getMinAgent() const
|
||||
{
|
||||
return localToAgent(mMinLocal);
|
||||
}
|
||||
|
||||
LLVector3 LLBBox::getMaxAgent() const
|
||||
{
|
||||
return localToAgent(mMaxLocal);
|
||||
}
|
||||
|
||||
/*
|
||||
LLBBox operator*(const LLBBox &a, const LLMatrix4 &b)
|
||||
|
|
|
|||
|
|
@ -51,9 +51,11 @@ public:
|
|||
const LLVector3& getPositionAgent() const { return mPosAgent; }
|
||||
const LLQuaternion& getRotation() const { return mRotation; }
|
||||
|
||||
LLVector3 getMinAgent() const;
|
||||
const LLVector3& getMinLocal() const { return mMinLocal; }
|
||||
void setMinLocal( const LLVector3& min ) { mMinLocal = min; }
|
||||
|
||||
LLVector3 getMaxAgent() const;
|
||||
const LLVector3& getMaxLocal() const { return mMaxLocal; }
|
||||
void setMaxLocal( const LLVector3& max ) { mMaxLocal = max; }
|
||||
|
||||
|
|
@ -80,6 +82,8 @@ public:
|
|||
LLVector3 localToAgentBasis(const LLVector3& v) const;
|
||||
LLVector3 agentToLocalBasis(const LLVector3& v) const;
|
||||
|
||||
// Get the smallest possible axis aligned bbox that contains this bbox
|
||||
LLBBox getAxisAligned() const;
|
||||
|
||||
// friend LLBBox operator*(const LLBBox& a, const LLMatrix4& b);
|
||||
|
||||
|
|
|
|||
|
|
@ -703,6 +703,7 @@ void LLCamera::calculateFrustumPlanes(F32 left, F32 right, F32 top, F32 bottom)
|
|||
mLocalPlanes[PLANE_BOTTOM].setVec( a, c, b);
|
||||
|
||||
//calculate center and radius squared of frustum in world absolute coordinates
|
||||
static LLVector3 const X_AXIS(1.f, 0.f, 0.f);
|
||||
mFrustCenter = X_AXIS*mFarPlane*0.5f;
|
||||
mFrustCenter = transformToAbsolute(mFrustCenter);
|
||||
mFrustRadiusSquared = mFarPlane*0.5f;
|
||||
|
|
|
|||
|
|
@ -50,15 +50,6 @@ const F32 MIN_FAR_PLANE = 0.2f;
|
|||
static const F32 MIN_FIELD_OF_VIEW = 5.0f * DEG_TO_RAD;
|
||||
static const F32 MAX_FIELD_OF_VIEW = 175.f * DEG_TO_RAD;
|
||||
|
||||
static const LLVector3 X_AXIS(1.f,0.f,0.f);
|
||||
static const LLVector3 Y_AXIS(0.f,1.f,0.f);
|
||||
static const LLVector3 Z_AXIS(0.f,0.f,1.f);
|
||||
|
||||
static const LLVector3 NEG_X_AXIS(-1.f,0.f,0.f);
|
||||
static const LLVector3 NEG_Y_AXIS(0.f,-1.f,0.f);
|
||||
static const LLVector3 NEG_Z_AXIS(0.f,0.f,-1.f);
|
||||
|
||||
|
||||
// An LLCamera is an LLCoorFrame with a view frustum.
|
||||
// This means that it has several methods for moving it around
|
||||
// that are inherited from the LLCoordFrame() class :
|
||||
|
|
|
|||
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in New Issue