diff options
Diffstat (limited to 'linden')
261 files changed, 9221 insertions, 3787 deletions
diff --git a/linden/doc/contributions.txt b/linden/doc/contributions.txt index 705dfb6..dbb18f2 100644 --- a/linden/doc/contributions.txt +++ b/linden/doc/contributions.txt | |||
@@ -2,24 +2,28 @@ Linden Lab would like to acknowledge source code contributions from the | |||
2 | following residents. The Second Life resident name is given below, | 2 | following residents. The Second Life resident name is given below, |
3 | along with the issue identifier corresponding to the patches we've | 3 | along with the issue identifier corresponding to the patches we've |
4 | received from them. To see more about these contributions, visit | 4 | received from them. To see more about these contributions, visit |
5 | http://jira.secondlife.com/ , and enter the issue identifier. | 5 | http://jira.secondlife.com/ and enter the issue identifier. |
6 | 6 | ||
7 | Alissa Sabre - VWR-81, VWR-83 | 7 | Alissa Sabre - VWR-81, VWR-83, VWR-414, VWR-415 |
8 | blino Nakamura - VWR-17 | 8 | blino Nakamura - VWR-17 |
9 | bushing Spatula - VWR-424 | ||
9 | Drewan Keats - VWR-28 | 10 | Drewan Keats - VWR-28 |
10 | Dylan Haskell - VWR-72 | 11 | Dylan Haskell - VWR-72 |
11 | Dzonatas Sol - VWR-198 | 12 | Dzonatas Sol - VWR-198 |
12 | Eddy Stryker - VWR-15, VWR-23 | 13 | Eddy Stryker - VWR-15, VWR-23 |
14 | Gigs Taggart - VWR-71, VWR-326 | ||
13 | Ginko Bayliss - VWR-4 | 15 | Ginko Bayliss - VWR-4 |
14 | Hiro Sommambulist - VWR-66, VWR-97, VWR-100, VWR-105, VWR-108, VWR-118 | 16 | Hikkoshi Sakai - VWR-429 |
15 | Jacek Antonelli - VWR-188 | 17 | Hiro Sommambulist - VWR-66, VWR-97, VWR-100, VWR-105, VWR-108, VWR-118, VWR-136 |
18 | Jacek Antonelli - VWR-165, VWR-188 | ||
16 | Joghert LeSabre - VWR-64 | 19 | Joghert LeSabre - VWR-64 |
17 | Kage Pixel - VWR-11 | 20 | Kage Pixel - VWR-11 |
18 | Kunnis Basiat - VWR-82 | 21 | Kunnis Basiat - VWR-82 |
19 | Paul Churchill - VWR-20 | 22 | Paul Churchill - VWR-20 |
20 | Paula Innis - VWR-30 | 23 | Paula Innis - VWR-30 |
21 | Peekay Semyorka - VWR-7, VWR-19, VWR-49 | 24 | Peekay Semyorka - VWR-7, VWR-19, VWR-49 |
25 | SignpostMarv Martin - VWR-154, VWR-155 | ||
22 | SpacedOut Frye - VWR-57, VWR-94, VWR-121, VWR-123 | 26 | SpacedOut Frye - VWR-57, VWR-94, VWR-121, VWR-123 |
23 | Strife Onizuka - VWR-74, VWR-85, SVC-9 | 27 | Strife Onizuka - SVC-9, VWR-74, VWR-85, VWR-148 |
24 | Zipherius Turas - VWR-76, VWR-77 | 28 | Zipherius Turas - VWR-76, VWR-77 |
25 | 29 | ||
diff --git a/linden/indra/SConstruct b/linden/indra/SConstruct index 0174b2d..cbf2029 100644 --- a/linden/indra/SConstruct +++ b/linden/indra/SConstruct | |||
@@ -55,6 +55,7 @@ opts.AddOptions( | |||
55 | allowed_values=('client', 'server', 'all')), | 55 | allowed_values=('client', 'server', 'all')), |
56 | BoolOption('DISTCC', 'Enabled distcc', True), | 56 | BoolOption('DISTCC', 'Enabled distcc', True), |
57 | BoolOption('MOZLIB', 'Enabled llmozlib/mozilla support', True), | 57 | BoolOption('MOZLIB', 'Enabled llmozlib/mozilla support', True), |
58 | BoolOption('FMOD', 'Enabled FMOD audio support', True), | ||
58 | BoolOption('COLORGCC', 'Enabled colorgcc', True), | 59 | BoolOption('COLORGCC', 'Enabled colorgcc', True), |
59 | EnumOption('GRID', 'Client package\'s default grid', 'default', | 60 | EnumOption('GRID', 'Client package\'s default grid', 'default', |
60 | allowed_values=('default', 'aditi', 'agni', 'dmz', 'durga', 'firstlook', 'ganga', 'shakti', 'siva', 'soma', 'uma', 'vaak')), | 61 | allowed_values=('default', 'aditi', 'agni', 'dmz', 'durga', 'firstlook', 'ganga', 'shakti', 'siva', 'soma', 'uma', 'vaak')), |
@@ -68,6 +69,7 @@ arch = optenv['ARCH'] | |||
68 | target_param = optenv['BTARGET'] | 69 | target_param = optenv['BTARGET'] |
69 | enable_distcc = optenv['DISTCC'] | 70 | enable_distcc = optenv['DISTCC'] |
70 | enable_mozlib = optenv['MOZLIB'] | 71 | enable_mozlib = optenv['MOZLIB'] |
72 | enable_fmod = optenv['FMOD'] | ||
71 | enable_colorgcc = optenv['COLORGCC'] | 73 | enable_colorgcc = optenv['COLORGCC'] |
72 | grid = optenv['GRID'] | 74 | grid = optenv['GRID'] |
73 | opensource = optenv['OPENSOURCE'] | 75 | opensource = optenv['OPENSOURCE'] |
@@ -180,7 +182,7 @@ for build_target in targets: | |||
180 | flags += '-DLL_LINUX=1 ' | 182 | flags += '-DLL_LINUX=1 ' |
181 | if build_target == 'client': | 183 | if build_target == 'client': |
182 | flags += '-DAPPID=secondlife -DLL_SDL=1 ' | 184 | flags += '-DAPPID=secondlife -DLL_SDL=1 ' |
183 | if arch == 'x86_64' or arch == 'x86_64cross': | 185 | if arch == 'x86_64' or arch == 'x86_64cross' or not enable_fmod: |
184 | flags += '-DLL_FMOD=0 ' | 186 | flags += '-DLL_FMOD=0 ' |
185 | flags += '-DLL_X11=1 -DLL_GTK=1 ' | 187 | flags += '-DLL_X11=1 -DLL_GTK=1 ' |
186 | client_external_libs += [ 'gtk-x11-2.0', 'elfio' ] | 188 | client_external_libs += [ 'gtk-x11-2.0', 'elfio' ] |
@@ -302,13 +304,14 @@ for build_target in targets: | |||
302 | list_file = open('./' + module + '/' + source_fname, 'r') | 304 | list_file = open('./' + module + '/' + source_fname, 'r') |
303 | list = Split(list_file.read()) | 305 | list = Split(list_file.read()) |
304 | for x in list: | 306 | for x in list: |
305 | file = os.path.join(build_dir, x) | 307 | if not x.startswith('#'): |
306 | if x == 'newsim/lltask.cpp': | 308 | file = os.path.join(build_dir, x) |
307 | print 'Found lltask!' | 309 | if x == 'newsim/lltask.cpp': |
308 | obj = env_no_distcc.Object(file) | 310 | print 'Found lltask!' |
309 | new_list.append(obj) | 311 | obj = env_no_distcc.Object(file) |
310 | else: | 312 | new_list.append(obj) |
311 | new_list.append(file) | 313 | else: |
314 | new_list.append(file) | ||
312 | list_file.close() | 315 | list_file.close() |
313 | except IOError, val: | 316 | except IOError, val: |
314 | print 'Error: unable to open file list',source_fname, | 317 | print 'Error: unable to open file list',source_fname, |
@@ -415,7 +418,7 @@ for build_target in targets: | |||
415 | 418 | ||
416 | external_libs = client_external_libs + common_external_libs + [ 'freetype', 'jpeg', 'SDL', 'GL', 'GLU', 'ogg', 'vorbisenc', 'vorbisfile', 'vorbis', 'db-4.2', 'openjpeg' ] | 419 | external_libs = client_external_libs + common_external_libs + [ 'freetype', 'jpeg', 'SDL', 'GL', 'GLU', 'ogg', 'vorbisenc', 'vorbisfile', 'vorbis', 'db-4.2', 'openjpeg' ] |
417 | 420 | ||
418 | if arch != 'x86_64' and arch != 'x86_64cross': | 421 | if arch != 'x86_64' and arch != 'x86_64cross' and enable_fmod: |
419 | external_libs += [ 'fmod-3.75' ] | 422 | external_libs += [ 'fmod-3.75' ] |
420 | 423 | ||
421 | external_libs.remove('cares') | 424 | external_libs.remove('cares') |
@@ -492,7 +495,7 @@ for build_target in targets: | |||
492 | 495 | ||
493 | # Dataserver | 496 | # Dataserver |
494 | Depends('dataserver/dataserver', 'launcher/launcher' + file_suffix) | 497 | Depends('dataserver/dataserver', 'launcher/launcher' + file_suffix) |
495 | external_libs = common_external_libs + ['boost_regex-gcc-mt', 'mysqlclient'] | 498 | external_libs = common_external_libs + ['boost_regex-gcc-mt', 'mysqlclient', 'tcmalloc', 'stacktrace'] |
496 | internal_libs = [ 'llcharacter', 'lldatabase', 'llimage', 'llinventory', | 499 | internal_libs = [ 'llcharacter', 'lldatabase', 'llimage', 'llinventory', |
497 | 'llscene', 'llmessage', 'llvfs', 'llxml', 'llcommon', 'llmath' ] | 500 | 'llscene', 'llmessage', 'llvfs', 'llxml', 'llcommon', 'llmath' ] |
498 | create_executable('dataserver/dataserver' + file_suffix, 'dataserver', | 501 | create_executable('dataserver/dataserver' + file_suffix, 'dataserver', |
@@ -535,7 +538,7 @@ for build_target in targets: | |||
535 | 538 | ||
536 | # Simulator | 539 | # Simulator |
537 | Depends('newsim/simulator' + file_suffix, 'mapserver/mapserver' + file_suffix) | 540 | Depends('newsim/simulator' + file_suffix, 'mapserver/mapserver' + file_suffix) |
538 | external_libs = common_external_libs + ['hkdynamics', 'hkgeometry', 'hkmath', 'hkbase', 'hkcollide', 'hkactions', 'boost_regex-gcc-mt', 'dl', 'kdu', 'mysqlclient', 'iconv'] | 541 | external_libs = common_external_libs + ['hkdynamics', 'hkgeometry', 'hkmath', 'hkbase', 'hkcollide', 'hkactions', 'boost_regex-gcc-mt', 'dl', 'kdu', 'mysqlclient', 'iconv', 'tcmalloc', 'stacktrace'] |
539 | internal_libs = [ 'lscript', 'llprimitive', | 542 | internal_libs = [ 'lscript', 'llprimitive', |
540 | 'llscene', 'llhavok', 'llinventory', 'llimage', | 543 | 'llscene', 'llhavok', 'llinventory', 'llimage', |
541 | 'llcharacter', 'llxml', 'lldatabase', 'llkdustatic', | 544 | 'llcharacter', 'llxml', 'lldatabase', 'llkdustatic', |
diff --git a/linden/indra/llaudio/audioengine.cpp b/linden/indra/llaudio/audioengine.cpp index edfa123..d5c2a40 100644 --- a/linden/indra/llaudio/audioengine.cpp +++ b/linden/indra/llaudio/audioengine.cpp | |||
@@ -134,28 +134,22 @@ void LLAudioEngine::shutdown() | |||
134 | 134 | ||
135 | // Clean up channels | 135 | // Clean up channels |
136 | S32 i; | 136 | S32 i; |
137 | if (mChannels) | 137 | for (i = 0; i < MAX_CHANNELS; i++) |
138 | { | 138 | { |
139 | for (i = 0; i < MAX_CHANNELS; i++) | 139 | if (mChannels[i]) |
140 | { | 140 | { |
141 | if (mChannels[i]) | 141 | delete mChannels[i]; |
142 | { | 142 | mChannels[i] = NULL; |
143 | delete mChannels[i]; | ||
144 | mChannels[i] = NULL; | ||
145 | } | ||
146 | } | 143 | } |
147 | } | 144 | } |
148 | 145 | ||
149 | // Clean up buffers | 146 | // Clean up buffers |
150 | if (mBuffers) | 147 | for (i = 0; i < MAX_BUFFERS; i++) |
151 | { | 148 | { |
152 | for (i = 0; i < MAX_BUFFERS; i++) | 149 | if (mBuffers[i]) |
153 | { | 150 | { |
154 | if (mBuffers[i]) | 151 | delete mBuffers[i]; |
155 | { | 152 | mBuffers[i] = NULL; |
156 | delete mBuffers[i]; | ||
157 | mBuffers[i] = NULL; | ||
158 | } | ||
159 | } | 153 | } |
160 | } | 154 | } |
161 | } | 155 | } |
@@ -575,7 +569,7 @@ LLAudioChannel * LLAudioEngine::getFreeChannel(const F32 priority) | |||
575 | } | 569 | } |
576 | } | 570 | } |
577 | 571 | ||
578 | if (min_priority > priority) | 572 | if (min_priority > priority || !min_channelp) |
579 | { | 573 | { |
580 | // All playing channels have higher priority, return. | 574 | // All playing channels have higher priority, return. |
581 | return NULL; | 575 | return NULL; |
diff --git a/linden/indra/llaudio/audioengine_fmod.cpp b/linden/indra/llaudio/audioengine_fmod.cpp index 485b95b..4574a57 100644 --- a/linden/indra/llaudio/audioengine_fmod.cpp +++ b/linden/indra/llaudio/audioengine_fmod.cpp | |||
@@ -950,7 +950,7 @@ void LLAudioEngine_FMOD::pauseInternetStream(int pause) | |||
950 | stopInternetStream(); | 950 | stopInternetStream(); |
951 | } | 951 | } |
952 | } | 952 | } |
953 | else if (mInternetStreamURL) | 953 | else |
954 | { | 954 | { |
955 | startInternetStream(mInternetStreamURL); | 955 | startInternetStream(mInternetStreamURL); |
956 | } | 956 | } |
diff --git a/linden/indra/llcharacter/llkeyframemotion.cpp b/linden/indra/llcharacter/llkeyframemotion.cpp index 94e45b6..e5d610a 100644 --- a/linden/indra/llcharacter/llkeyframemotion.cpp +++ b/linden/indra/llcharacter/llkeyframemotion.cpp | |||
@@ -1409,6 +1409,7 @@ BOOL LLKeyframeMotion::deserialize(LLDataPacker& dp) | |||
1409 | if (!success) | 1409 | if (!success) |
1410 | { | 1410 | { |
1411 | llwarns << "can't read rotation key (" << k << ")" << llendl; | 1411 | llwarns << "can't read rotation key (" << k << ")" << llendl; |
1412 | delete rot_key; | ||
1412 | return FALSE; | 1413 | return FALSE; |
1413 | } | 1414 | } |
1414 | 1415 | ||
@@ -1527,6 +1528,7 @@ BOOL LLKeyframeMotion::deserialize(LLDataPacker& dp) | |||
1527 | if (!dp.unpackU8(byte, "chain_length")) | 1528 | if (!dp.unpackU8(byte, "chain_length")) |
1528 | { | 1529 | { |
1529 | llwarns << "can't read constraint chain length" << llendl; | 1530 | llwarns << "can't read constraint chain length" << llendl; |
1531 | delete constraintp; | ||
1530 | return FALSE; | 1532 | return FALSE; |
1531 | } | 1533 | } |
1532 | constraintp->mChainLength = (S32) byte; | 1534 | constraintp->mChainLength = (S32) byte; |
@@ -1534,6 +1536,7 @@ BOOL LLKeyframeMotion::deserialize(LLDataPacker& dp) | |||
1534 | if (!dp.unpackU8(byte, "constraint_type")) | 1536 | if (!dp.unpackU8(byte, "constraint_type")) |
1535 | { | 1537 | { |
1536 | llwarns << "can't read constraint type" << llendl; | 1538 | llwarns << "can't read constraint type" << llendl; |
1539 | delete constraintp; | ||
1537 | return FALSE; | 1540 | return FALSE; |
1538 | } | 1541 | } |
1539 | constraintp->mConstraintType = (EConstraintType)byte; | 1542 | constraintp->mConstraintType = (EConstraintType)byte; |
@@ -1543,6 +1546,7 @@ BOOL LLKeyframeMotion::deserialize(LLDataPacker& dp) | |||
1543 | if (!dp.unpackBinaryDataFixed(bin_data, BIN_DATA_LENGTH, "source_volume")) | 1546 | if (!dp.unpackBinaryDataFixed(bin_data, BIN_DATA_LENGTH, "source_volume")) |
1544 | { | 1547 | { |
1545 | llwarns << "can't read source volume name" << llendl; | 1548 | llwarns << "can't read source volume name" << llendl; |
1549 | delete constraintp; | ||
1546 | return FALSE; | 1550 | return FALSE; |
1547 | } | 1551 | } |
1548 | 1552 | ||
@@ -1553,12 +1557,14 @@ BOOL LLKeyframeMotion::deserialize(LLDataPacker& dp) | |||
1553 | if (!dp.unpackVector3(constraintp->mSourceConstraintOffset, "source_offset")) | 1557 | if (!dp.unpackVector3(constraintp->mSourceConstraintOffset, "source_offset")) |
1554 | { | 1558 | { |
1555 | llwarns << "can't read constraint source offset" << llendl; | 1559 | llwarns << "can't read constraint source offset" << llendl; |
1560 | delete constraintp; | ||
1556 | return FALSE; | 1561 | return FALSE; |
1557 | } | 1562 | } |
1558 | 1563 | ||
1559 | if (!dp.unpackBinaryDataFixed(bin_data, BIN_DATA_LENGTH, "target_volume")) | 1564 | if (!dp.unpackBinaryDataFixed(bin_data, BIN_DATA_LENGTH, "target_volume")) |
1560 | { | 1565 | { |
1561 | llwarns << "can't read target volume name" << llendl; | 1566 | llwarns << "can't read target volume name" << llendl; |
1567 | delete constraintp; | ||
1562 | return FALSE; | 1568 | return FALSE; |
1563 | } | 1569 | } |
1564 | 1570 | ||
@@ -1578,12 +1584,14 @@ BOOL LLKeyframeMotion::deserialize(LLDataPacker& dp) | |||
1578 | if (!dp.unpackVector3(constraintp->mTargetConstraintOffset, "target_offset")) | 1584 | if (!dp.unpackVector3(constraintp->mTargetConstraintOffset, "target_offset")) |
1579 | { | 1585 | { |
1580 | llwarns << "can't read constraint target offset" << llendl; | 1586 | llwarns << "can't read constraint target offset" << llendl; |
1587 | delete constraintp; | ||
1581 | return FALSE; | 1588 | return FALSE; |
1582 | } | 1589 | } |
1583 | 1590 | ||
1584 | if (!dp.unpackVector3(constraintp->mTargetConstraintDir, "target_dir")) | 1591 | if (!dp.unpackVector3(constraintp->mTargetConstraintDir, "target_dir")) |
1585 | { | 1592 | { |
1586 | llwarns << "can't read constraint target direction" << llendl; | 1593 | llwarns << "can't read constraint target direction" << llendl; |
1594 | delete constraintp; | ||
1587 | return FALSE; | 1595 | return FALSE; |
1588 | } | 1596 | } |
1589 | 1597 | ||
@@ -1596,24 +1604,28 @@ BOOL LLKeyframeMotion::deserialize(LLDataPacker& dp) | |||
1596 | if (!dp.unpackF32(constraintp->mEaseInStartTime, "ease_in_start")) | 1604 | if (!dp.unpackF32(constraintp->mEaseInStartTime, "ease_in_start")) |
1597 | { | 1605 | { |
1598 | llwarns << "can't read constraint ease in start time" << llendl; | 1606 | llwarns << "can't read constraint ease in start time" << llendl; |
1607 | delete constraintp; | ||
1599 | return FALSE; | 1608 | return FALSE; |
1600 | } | 1609 | } |
1601 | 1610 | ||
1602 | if (!dp.unpackF32(constraintp->mEaseInStopTime, "ease_in_stop")) | 1611 | if (!dp.unpackF32(constraintp->mEaseInStopTime, "ease_in_stop")) |
1603 | { | 1612 | { |
1604 | llwarns << "can't read constraint ease in stop time" << llendl; | 1613 | llwarns << "can't read constraint ease in stop time" << llendl; |
1614 | delete constraintp; | ||
1605 | return FALSE; | 1615 | return FALSE; |
1606 | } | 1616 | } |
1607 | 1617 | ||
1608 | if (!dp.unpackF32(constraintp->mEaseOutStartTime, "ease_out_start")) | 1618 | if (!dp.unpackF32(constraintp->mEaseOutStartTime, "ease_out_start")) |
1609 | { | 1619 | { |
1610 | llwarns << "can't read constraint ease out start time" << llendl; | 1620 | llwarns << "can't read constraint ease out start time" << llendl; |
1621 | delete constraintp; | ||
1611 | return FALSE; | 1622 | return FALSE; |
1612 | } | 1623 | } |
1613 | 1624 | ||
1614 | if (!dp.unpackF32(constraintp->mEaseOutStopTime, "ease_out_stop")) | 1625 | if (!dp.unpackF32(constraintp->mEaseOutStopTime, "ease_out_stop")) |
1615 | { | 1626 | { |
1616 | llwarns << "can't read constraint ease out stop time" << llendl; | 1627 | llwarns << "can't read constraint ease out stop time" << llendl; |
1628 | delete constraintp; | ||
1617 | return FALSE; | 1629 | return FALSE; |
1618 | } | 1630 | } |
1619 | 1631 | ||
@@ -1739,29 +1751,7 @@ BOOL LLKeyframeMotion::serialize(LLDataPacker& dp) const | |||
1739 | success &= dp.packVector3(shared_constraintp->mSourceConstraintOffset, "source_offset"); | 1751 | success &= dp.packVector3(shared_constraintp->mSourceConstraintOffset, "source_offset"); |
1740 | if (shared_constraintp->mConstraintTargetType == TYPE_GROUND) | 1752 | if (shared_constraintp->mConstraintTargetType == TYPE_GROUND) |
1741 | { | 1753 | { |
1742 | success &= dp.packU8(shared_constraintp->mChainLength, "chain_length"); | 1754 | snprintf(volume_name,sizeof(volume_name), "%s", "GROUND"); /* Flawfinder: ignore */ |
1743 | success &= dp.packU8(shared_constraintp->mConstraintType, "constraint_type"); | ||
1744 | char volume_name[16]; /* Flawfinder: ignore */ | ||
1745 | snprintf(volume_name, sizeof(volume_name), "%s", /* Flawfinder: ignore */ | ||
1746 | mCharacter->findCollisionVolume(shared_constraintp->mSourceConstraintVolume)->getName().c_str()); | ||
1747 | success &= dp.packBinaryDataFixed((U8*)volume_name, 16, "source_volume"); | ||
1748 | success &= dp.packVector3(shared_constraintp->mSourceConstraintOffset, "source_offset"); | ||
1749 | if (shared_constraintp->mConstraintTargetType == TYPE_GROUND) | ||
1750 | { | ||
1751 | snprintf(volume_name,sizeof(volume_name), "%s", "GROUND"); /* Flawfinder: ignore */ | ||
1752 | } | ||
1753 | else | ||
1754 | { | ||
1755 | snprintf(volume_name, sizeof(volume_name),"%s", /* Flawfinder: ignore */ | ||
1756 | mCharacter->findCollisionVolume(shared_constraintp->mTargetConstraintVolume)->getName().c_str()); | ||
1757 | } | ||
1758 | success &= dp.packBinaryDataFixed((U8*)volume_name, 16, "target_volume"); | ||
1759 | success &= dp.packVector3(shared_constraintp->mTargetConstraintOffset, "target_offset"); | ||
1760 | success &= dp.packVector3(shared_constraintp->mTargetConstraintDir, "target_dir"); | ||
1761 | success &= dp.packF32(shared_constraintp->mEaseInStartTime, "ease_in_start"); | ||
1762 | success &= dp.packF32(shared_constraintp->mEaseInStopTime, "ease_in_stop"); | ||
1763 | success &= dp.packF32(shared_constraintp->mEaseOutStartTime, "ease_out_start"); | ||
1764 | success &= dp.packF32(shared_constraintp->mEaseOutStopTime, "ease_out_stop"); | ||
1765 | } | 1755 | } |
1766 | else | 1756 | else |
1767 | { | 1757 | { |
@@ -1967,39 +1957,46 @@ void LLKeyframeMotion::onLoadComplete(LLVFS *vfs, | |||
1967 | // create an instance of this motion (it may or may not already exist) | 1957 | // create an instance of this motion (it may or may not already exist) |
1968 | LLKeyframeMotion* motionp = (LLKeyframeMotion*) character->createMotion(asset_uuid); | 1958 | LLKeyframeMotion* motionp = (LLKeyframeMotion*) character->createMotion(asset_uuid); |
1969 | 1959 | ||
1970 | if (0 == status && motionp) | 1960 | if (motionp) |
1971 | { | 1961 | { |
1972 | if (motionp->mAssetStatus == ASSET_LOADED) | 1962 | if (0 == status) |
1973 | { | ||
1974 | // asset already loaded | ||
1975 | return; | ||
1976 | } | ||
1977 | LLVFile file(vfs, asset_uuid, type, LLVFile::READ); | ||
1978 | S32 size = file.getSize(); | ||
1979 | |||
1980 | U8* buffer = new U8[size]; | ||
1981 | file.read((U8*)buffer, size); /*Flawfinder: ignore*/ | ||
1982 | |||
1983 | lldebugs << "Loading keyframe data for: " << motionp->getName() << ":" << motionp->getID() << " (" << size << " bytes)" << llendl; | ||
1984 | |||
1985 | LLDataPackerBinaryBuffer dp(buffer, size); | ||
1986 | if (motionp->deserialize(dp)) | ||
1987 | { | 1963 | { |
1988 | motionp->mAssetStatus = ASSET_LOADED; | 1964 | if (motionp->mAssetStatus == ASSET_LOADED) |
1965 | { | ||
1966 | // asset already loaded | ||
1967 | return; | ||
1968 | } | ||
1969 | LLVFile file(vfs, asset_uuid, type, LLVFile::READ); | ||
1970 | S32 size = file.getSize(); | ||
1971 | |||
1972 | U8* buffer = new U8[size]; | ||
1973 | file.read((U8*)buffer, size); /*Flawfinder: ignore*/ | ||
1974 | |||
1975 | lldebugs << "Loading keyframe data for: " << motionp->getName() << ":" << motionp->getID() << " (" << size << " bytes)" << llendl; | ||
1976 | |||
1977 | LLDataPackerBinaryBuffer dp(buffer, size); | ||
1978 | if (motionp->deserialize(dp)) | ||
1979 | { | ||
1980 | motionp->mAssetStatus = ASSET_LOADED; | ||
1981 | } | ||
1982 | else | ||
1983 | { | ||
1984 | llwarns << "Failed to decode asset for animation " << motionp->getName() << ":" << motionp->getID() << llendl; | ||
1985 | motionp->mAssetStatus = ASSET_FETCH_FAILED; | ||
1986 | } | ||
1987 | |||
1988 | delete []buffer; | ||
1989 | } | 1989 | } |
1990 | else | 1990 | else |
1991 | { | 1991 | { |
1992 | llwarns << "Failed to decode asset for animation " << motionp->getName() << ":" << motionp->getID() << llendl; | 1992 | llwarns << "Failed to load asset for animation " << motionp->getName() << ":" << motionp->getID() << llendl; |
1993 | motionp->mAssetStatus = ASSET_FETCH_FAILED; | 1993 | motionp->mAssetStatus = ASSET_FETCH_FAILED; |
1994 | } | 1994 | } |
1995 | |||
1996 | delete []buffer; | ||
1997 | |||
1998 | } | 1995 | } |
1999 | else | 1996 | else |
2000 | { | 1997 | { |
2001 | llwarns << "Failed to load asset for animation " << motionp->getName() << ":" << motionp->getID() << llendl; | 1998 | // motionp is NULL |
2002 | motionp->mAssetStatus = ASSET_FETCH_FAILED; | 1999 | llwarns << "Failed to createMotion() for asset UUID " << asset_uuid << llendl; |
2003 | } | 2000 | } |
2004 | } | 2001 | } |
2005 | 2002 | ||
diff --git a/linden/indra/llcharacter/llkeyframemotionparam.cpp b/linden/indra/llcharacter/llkeyframemotionparam.cpp index 5970909..d24b8a6 100644 --- a/linden/indra/llcharacter/llkeyframemotionparam.cpp +++ b/linden/indra/llcharacter/llkeyframemotionparam.cpp | |||
@@ -187,6 +187,12 @@ BOOL LLKeyframeMotionParam::onUpdate(F32 time, U8* joint_mask) | |||
187 | ParameterizedMotion* firstMotion = NULL; | 187 | ParameterizedMotion* firstMotion = NULL; |
188 | ParameterizedMotion* secondMotion = NULL; | 188 | ParameterizedMotion* secondMotion = NULL; |
189 | 189 | ||
190 | if (NULL == paramValue) // unexpected, but... | ||
191 | { | ||
192 | llwarns << "paramValue == NULL" << llendl; | ||
193 | continue; | ||
194 | } | ||
195 | |||
190 | for (ParameterizedMotion* paramMotion = motionList->getFirstData(); paramMotion; paramMotion = motionList->getNextData()) | 196 | for (ParameterizedMotion* paramMotion = motionList->getFirstData(); paramMotion; paramMotion = motionList->getNextData()) |
191 | { | 197 | { |
192 | paramMotion->first->onUpdate(time, joint_mask); | 198 | paramMotion->first->onUpdate(time, joint_mask); |
diff --git a/linden/indra/llcharacter/llstatemachine.cpp b/linden/indra/llcharacter/llstatemachine.cpp index 1ad81be..d7ecae4 100644 --- a/linden/indra/llcharacter/llstatemachine.cpp +++ b/linden/indra/llcharacter/llstatemachine.cpp | |||
@@ -362,28 +362,28 @@ void LLStateMachine::processTransition(LLFSMTransition& transition, void* user_d | |||
362 | { | 362 | { |
363 | llassert(mStateDiagram); | 363 | llassert(mStateDiagram); |
364 | 364 | ||
365 | if (NULL == mCurrentState) | ||
366 | { | ||
367 | llwarns << "mCurrentState == NULL; aborting processTransition()" << llendl; | ||
368 | return; | ||
369 | } | ||
370 | |||
365 | LLFSMState* new_state = mStateDiagram->processTransition(*mCurrentState, transition); | 371 | LLFSMState* new_state = mStateDiagram->processTransition(*mCurrentState, transition); |
366 | 372 | ||
373 | if (NULL == new_state) | ||
374 | { | ||
375 | llwarns << "new_state == NULL; aborting processTransition()" << llendl; | ||
376 | return; | ||
377 | } | ||
378 | |||
367 | mLastTransition = &transition; | 379 | mLastTransition = &transition; |
368 | mLastState = mCurrentState; | 380 | mLastState = mCurrentState; |
369 | 381 | ||
370 | if (*mCurrentState != *new_state) | 382 | if (*mCurrentState != *new_state) |
371 | { | 383 | { |
372 | if (mCurrentState && new_state && *mCurrentState != *new_state) | 384 | mCurrentState->onExit(user_data); |
373 | { | 385 | mCurrentState = new_state; |
374 | mCurrentState->onExit(user_data); | 386 | mCurrentState->onEntry(user_data); |
375 | } | ||
376 | if (new_state) | ||
377 | { | ||
378 | if (!mCurrentState || *mCurrentState != *new_state) | ||
379 | { | ||
380 | mCurrentState = new_state; | ||
381 | if (mCurrentState) | ||
382 | { | ||
383 | mCurrentState->onEntry(user_data); | ||
384 | } | ||
385 | } | ||
386 | } | ||
387 | #if FSM_PRINT_STATE_TRANSITIONS | 387 | #if FSM_PRINT_STATE_TRANSITIONS |
388 | llinfos << "Entering state " << mCurrentState->getName() << | 388 | llinfos << "Entering state " << mCurrentState->getName() << |
389 | " on transition " << transition.getName() << " from state " << | 389 | " on transition " << transition.getName() << " from state " << |
diff --git a/linden/indra/llcharacter/llvisualparam.cpp b/linden/indra/llcharacter/llvisualparam.cpp index de163eb..d1c08f9 100644 --- a/linden/indra/llcharacter/llvisualparam.cpp +++ b/linden/indra/llcharacter/llvisualparam.cpp | |||
@@ -232,16 +232,16 @@ void LLVisualParam::setWeight(F32 weight, BOOL set_by_user) | |||
232 | //----------------------------------------------------------------------------- | 232 | //----------------------------------------------------------------------------- |
233 | void LLVisualParam::setAnimationTarget(F32 target_value, BOOL set_by_user) | 233 | void LLVisualParam::setAnimationTarget(F32 target_value, BOOL set_by_user) |
234 | { | 234 | { |
235 | if (getGroup() == VISUAL_PARAM_GROUP_TWEAKABLE) | 235 | if (mInfo) |
236 | { | 236 | { |
237 | if (mInfo) | 237 | if (getGroup() == VISUAL_PARAM_GROUP_TWEAKABLE) |
238 | { | 238 | { |
239 | mTargetWeight = llclamp(target_value, mInfo->mMinWeight, mInfo->mMaxWeight); | 239 | mTargetWeight = llclamp(target_value, mInfo->mMinWeight, mInfo->mMaxWeight); |
240 | } | 240 | } |
241 | else | 241 | } |
242 | { | 242 | else |
243 | mTargetWeight = target_value; | 243 | { |
244 | } | 244 | mTargetWeight = target_value; |
245 | } | 245 | } |
246 | mIsAnimating = TRUE; | 246 | mIsAnimating = TRUE; |
247 | 247 | ||
diff --git a/linden/indra/llcommon/llstat.cpp b/linden/indra/llcommon/llstat.cpp index 4e43923..7e6090f 100644 --- a/linden/indra/llcommon/llstat.cpp +++ b/linden/indra/llcommon/llstat.cpp | |||
@@ -119,9 +119,9 @@ void LLStatAccum::impl::sum(F64 value, U64 when) | |||
119 | } | 119 | } |
120 | if (when < mLastTime) | 120 | if (when < mLastTime) |
121 | { | 121 | { |
122 | // JAMESDEBUG spams on Athlon | 122 | // This happens a LOT on some dual core systems. |
123 | //llwarns << "LLStatAccum::sum clock has gone backwards from " | 123 | lldebugs << "LLStatAccum::sum clock has gone backwards from " |
124 | // << mLastTime << " to " << when << ", resetting" << llendl; | 124 | << mLastTime << " to " << when << ", resetting" << llendl; |
125 | 125 | ||
126 | reset(when); | 126 | reset(when); |
127 | return; | 127 | return; |
diff --git a/linden/indra/llcommon/llstring.h b/linden/indra/llcommon/llstring.h index d901e61..8a2c24c 100644 --- a/linden/indra/llcommon/llstring.h +++ b/linden/indra/llcommon/llstring.h | |||
@@ -1043,7 +1043,7 @@ void LLStringBase<T>::copyInto(std::basic_string<T>& dst, const std::basic_strin | |||
1043 | } | 1043 | } |
1044 | else | 1044 | else |
1045 | { | 1045 | { |
1046 | LLWString tail = dst.substr(offset); | 1046 | std::basic_string<T> tail = dst.substr(offset); |
1047 | 1047 | ||
1048 | dst = dst.substr(0, offset); | 1048 | dst = dst.substr(0, offset); |
1049 | dst += src; | 1049 | dst += src; |
diff --git a/linden/indra/llcommon/llstringtable.h b/linden/indra/llcommon/llstringtable.h index 337d937..8d91680 100644 --- a/linden/indra/llcommon/llstringtable.h +++ b/linden/indra/llcommon/llstringtable.h | |||
@@ -48,12 +48,6 @@ | |||
48 | #include <hash_map> | 48 | #include <hash_map> |
49 | #endif | 49 | #endif |
50 | 50 | ||
51 | // string_table.h | ||
52 | // LLStringTable class header file | ||
53 | // Provides a _fast_ method for finding unique copies of strings | ||
54 | // | ||
55 | // Copyright 2001-2002, Linden Research, Inc. | ||
56 | |||
57 | const U32 MAX_STRINGS_LENGTH = 256; | 51 | const U32 MAX_STRINGS_LENGTH = 256; |
58 | 52 | ||
59 | class LLStringTableEntry | 53 | class LLStringTableEntry |
diff --git a/linden/indra/llcommon/lluri.cpp b/linden/indra/llcommon/lluri.cpp index f85f294..c838b25 100644 --- a/linden/indra/llcommon/lluri.cpp +++ b/linden/indra/llcommon/lluri.cpp | |||
@@ -114,6 +114,13 @@ namespace | |||
114 | { return LLURI::escape(s, unreserved() + ":@!$'()*+,="); } // sub_delims - "&;" + ":@" | 114 | { return LLURI::escape(s, unreserved() + ":@!$'()*+,="); } // sub_delims - "&;" + ":@" |
115 | } | 115 | } |
116 | 116 | ||
117 | // TODO: USE CURL!! After http textures gets merged everywhere. | ||
118 | // static | ||
119 | std::string LLURI::escape(const std::string& str) | ||
120 | { | ||
121 | return escape(str,unreserved() + ":@!$'()*+,="); | ||
122 | } | ||
123 | |||
117 | LLURI::LLURI() | 124 | LLURI::LLURI() |
118 | { | 125 | { |
119 | } | 126 | } |
@@ -238,24 +245,11 @@ LLURI LLURI::buildHTTP(const std::string& prefix, | |||
238 | const LLSD& path, | 245 | const LLSD& path, |
239 | const LLSD& query) | 246 | const LLSD& query) |
240 | { | 247 | { |
241 | LLURI result = buildHTTP(prefix, path); | 248 | LLURI uri = buildHTTP(prefix, path); |
249 | uri.mEscapedQuery = mapToQueryString(query); | ||
242 | // break out and escape each query component | 250 | // break out and escape each query component |
243 | if (query.isMap()) | 251 | uri.mEscapedOpaque += "?" + uri.mEscapedQuery ; |
244 | { | 252 | return uri; |
245 | for (LLSD::map_const_iterator it = query.beginMap(); | ||
246 | it != query.endMap(); | ||
247 | it++) | ||
248 | { | ||
249 | result.mEscapedQuery += escapeQueryVariable(it->first) + | ||
250 | (it->second.isUndefined() ? "" : "=" + escapeQueryValue(it->second.asString())) + | ||
251 | "&"; | ||
252 | } | ||
253 | if (query.size() > 0) | ||
254 | { | ||
255 | result.mEscapedOpaque += "?" + result.mEscapedQuery; | ||
256 | } | ||
257 | } | ||
258 | return result; | ||
259 | } | 253 | } |
260 | 254 | ||
261 | // static | 255 | // static |
@@ -275,7 +269,6 @@ LLURI LLURI::buildHTTP(const std::string& host, | |||
275 | return LLURI::buildHTTP(llformat("%s:%u", host.c_str(), port), path, query); | 269 | return LLURI::buildHTTP(llformat("%s:%u", host.c_str(), port), path, query); |
276 | } | 270 | } |
277 | 271 | ||
278 | |||
279 | namespace { | 272 | namespace { |
280 | LLURI buildBackboneURL(LLApp* app, | 273 | LLURI buildBackboneURL(LLApp* app, |
281 | const std::string& p1 = "", | 274 | const std::string& p1 = "", |
@@ -317,6 +310,23 @@ LLURI LLURI::buildBulkAgentNamesURI(LLApp* app) | |||
317 | } | 310 | } |
318 | 311 | ||
319 | // static | 312 | // static |
313 | LLURI LLURI::buildBulkAgentNamesURI(LLApp* app) | ||
314 | { | ||
315 | std::string host = "localhost:12040"; | ||
316 | |||
317 | if (app) | ||
318 | { | ||
319 | host = app->getOption("backbone-host-port").asString(); | ||
320 | } | ||
321 | |||
322 | LLSD path = LLSD::emptyArray(); | ||
323 | path.append("agent"); | ||
324 | path.append("names"); | ||
325 | |||
326 | return buildHTTP(host, path); | ||
327 | } | ||
328 | |||
329 | // static | ||
320 | LLURI LLURI::buildAgentSessionURI(const LLUUID& agent_id, LLApp* app) | 330 | LLURI LLURI::buildAgentSessionURI(const LLUUID& agent_id, LLApp* app) |
321 | { | 331 | { |
322 | return buildBackboneURL(app, "agent", agent_id.asString(), "session"); | 332 | return buildBackboneURL(app, "agent", agent_id.asString(), "session"); |
@@ -341,6 +351,24 @@ LLURI LLURI::buildAgentNameURI(const LLUUID& agent_id, LLApp* app) | |||
341 | } | 351 | } |
342 | 352 | ||
343 | // static | 353 | // static |
354 | LLURI LLURI::buildAgentNameURI(const LLUUID& agent_id, LLApp* app) | ||
355 | { | ||
356 | std::string host = "localhost:12040"; | ||
357 | |||
358 | if (app) | ||
359 | { | ||
360 | host = app->getOption("backbone-host-port").asString(); | ||
361 | } | ||
362 | |||
363 | LLSD path = LLSD::emptyArray(); | ||
364 | path.append("agent"); | ||
365 | path.append(agent_id); | ||
366 | path.append("name"); | ||
367 | |||
368 | return buildHTTP(host, path); | ||
369 | } | ||
370 | |||
371 | // static | ||
344 | LLURI LLURI::buildAgentLoginInfoURI(const LLUUID& agent_id, const std::string& dataserver) | 372 | LLURI LLURI::buildAgentLoginInfoURI(const LLUUID& agent_id, const std::string& dataserver) |
345 | { | 373 | { |
346 | LLSD path = LLSD::emptyArray(); | 374 | LLSD path = LLSD::emptyArray(); |
@@ -492,3 +520,23 @@ LLSD LLURI::queryMap(std::string escaped_query_string) | |||
492 | return result; | 520 | return result; |
493 | } | 521 | } |
494 | 522 | ||
523 | std::string LLURI::mapToQueryString(const LLSD& queryMap) | ||
524 | { | ||
525 | std::string query_string; | ||
526 | |||
527 | if (queryMap.isMap()) | ||
528 | { | ||
529 | for (LLSD::map_const_iterator iter = queryMap.beginMap(); | ||
530 | iter != queryMap.endMap(); | ||
531 | iter++) | ||
532 | { | ||
533 | query_string += escapeQueryVariable(iter->first) + | ||
534 | (iter->second.isUndefined() ? "" : "=" + escapeQueryValue(iter->second.asString())) + "&" ; | ||
535 | } | ||
536 | //if (queryMap.size() > 0) | ||
537 | //{ | ||
538 | // query_string += "?" + query_string ; | ||
539 | //} | ||
540 | } | ||
541 | return query_string; | ||
542 | } | ||
diff --git a/linden/indra/llcommon/lluri.h b/linden/indra/llcommon/lluri.h index 77de595..d1499b8 100644 --- a/linden/indra/llcommon/lluri.h +++ b/linden/indra/llcommon/lluri.h | |||
@@ -90,9 +90,11 @@ public: | |||
90 | std::string query() const; // ex.: "x=34", section after "?" | 90 | std::string query() const; // ex.: "x=34", section after "?" |
91 | LLSD queryMap() const; // above decoded into a map | 91 | LLSD queryMap() const; // above decoded into a map |
92 | static LLSD queryMap(std::string escaped_query_string); | 92 | static LLSD queryMap(std::string escaped_query_string); |
93 | static std::string mapToQueryString(const LLSD& queryMap); | ||
93 | 94 | ||
94 | // Escaping Utilities | 95 | // Escaping Utilities |
95 | // Escape a string by urlencoding all the characters that aren't in the allowed string. | 96 | // Escape a string by urlencoding all the characters that aren't in the allowed string. |
97 | static std::string escape(const std::string& str); | ||
96 | static std::string escape(const std::string& str, const std::string & allowed); | 98 | static std::string escape(const std::string& str, const std::string & allowed); |
97 | static std::string unescape(const std::string& str); | 99 | static std::string unescape(const std::string& str); |
98 | 100 | ||
diff --git a/linden/indra/llcommon/llversion.h b/linden/indra/llcommon/llversion.h index 426eff0..a76551d 100644 --- a/linden/indra/llcommon/llversion.h +++ b/linden/indra/llcommon/llversion.h | |||
@@ -31,7 +31,7 @@ | |||
31 | 31 | ||
32 | const S32 LL_VERSION_MAJOR = 1; | 32 | const S32 LL_VERSION_MAJOR = 1; |
33 | const S32 LL_VERSION_MINOR = 15; | 33 | const S32 LL_VERSION_MINOR = 15; |
34 | const S32 LL_VERSION_PATCH = 0; | 34 | const S32 LL_VERSION_PATCH = 1; |
35 | const S32 LL_VERSION_BUILD = 2; | 35 | const S32 LL_VERSION_BUILD = 3; |
36 | 36 | ||
37 | #endif | 37 | #endif |
diff --git a/linden/indra/llimage/llimage.cpp b/linden/indra/llimage/llimage.cpp index a7d8bdd..5175314 100644 --- a/linden/indra/llimage/llimage.cpp +++ b/linden/indra/llimage/llimage.cpp | |||
@@ -1422,7 +1422,7 @@ void LLImageFormatted::sanityCheck() | |||
1422 | 1422 | ||
1423 | BOOL LLImageFormatted::copyData(U8 *data, S32 size) | 1423 | BOOL LLImageFormatted::copyData(U8 *data, S32 size) |
1424 | { | 1424 | { |
1425 | if ( (data && data != getData()) || (size != getDataSize()) ) | 1425 | if ( data && ((data != getData()) || (size != getDataSize())) ) |
1426 | { | 1426 | { |
1427 | deleteData(); | 1427 | deleteData(); |
1428 | allocateData(size); | 1428 | allocateData(size); |
diff --git a/linden/indra/llinventory/files.lst b/linden/indra/llinventory/files.lst index c96cd03..b918b06 100644 --- a/linden/indra/llinventory/files.lst +++ b/linden/indra/llinventory/files.lst | |||
@@ -1,6 +1,7 @@ | |||
1 | llinventory/llcategory.cpp | 1 | llinventory/llcategory.cpp |
2 | llinventory/lleconomy.cpp | 2 | llinventory/lleconomy.cpp |
3 | llinventory/llinventory.cpp | 3 | llinventory/llinventory.cpp |
4 | llinventory/llinventorytype.cpp | ||
4 | llinventory/lllandmark.cpp | 5 | llinventory/lllandmark.cpp |
5 | llinventory/llnotecard.cpp | 6 | llinventory/llnotecard.cpp |
6 | llinventory/llparcel.cpp | 7 | llinventory/llparcel.cpp |
diff --git a/linden/indra/llinventory/lleconomy.cpp b/linden/indra/llinventory/lleconomy.cpp index 837acfe..e3e909b 100644 --- a/linden/indra/llinventory/lleconomy.cpp +++ b/linden/indra/llinventory/lleconomy.cpp | |||
@@ -32,6 +32,8 @@ | |||
32 | #include "message.h" | 32 | #include "message.h" |
33 | #include "v3math.h" | 33 | #include "v3math.h" |
34 | 34 | ||
35 | LLGlobalEconomy *gGlobalEconomy = NULL; | ||
36 | |||
35 | LLGlobalEconomy::LLGlobalEconomy() | 37 | LLGlobalEconomy::LLGlobalEconomy() |
36 | : mObjectCount( -1 ), | 38 | : mObjectCount( -1 ), |
37 | mObjectCapacity( -1 ), | 39 | mObjectCapacity( -1 ), |
diff --git a/linden/indra/llinventory/lleconomy.h b/linden/indra/llinventory/lleconomy.h index b381663..acda67e 100644 --- a/linden/indra/llinventory/lleconomy.h +++ b/linden/indra/llinventory/lleconomy.h | |||
@@ -133,4 +133,6 @@ private: | |||
133 | 133 | ||
134 | }; | 134 | }; |
135 | 135 | ||
136 | extern LLGlobalEconomy* gGlobalEconomy; | ||
137 | |||
136 | #endif | 138 | #endif |
diff --git a/linden/indra/llinventory/llinventory.cpp b/linden/indra/llinventory/llinventory.cpp index 85fc47f..93c480e 100644 --- a/linden/indra/llinventory/llinventory.cpp +++ b/linden/indra/llinventory/llinventory.cpp | |||
@@ -40,8 +40,6 @@ | |||
40 | 40 | ||
41 | #include "llsdutil.h" | 41 | #include "llsdutil.h" |
42 | 42 | ||
43 | #include "llsdutil.h" | ||
44 | |||
45 | ///---------------------------------------------------------------------------- | 43 | ///---------------------------------------------------------------------------- |
46 | /// exported functions | 44 | /// exported functions |
47 | ///---------------------------------------------------------------------------- | 45 | ///---------------------------------------------------------------------------- |
@@ -67,187 +65,8 @@ static const std::string INV_CREATION_DATE_LABEL("created_at"); | |||
67 | const U8 TASK_INVENTORY_ITEM_KEY = 0; | 65 | const U8 TASK_INVENTORY_ITEM_KEY = 0; |
68 | const U8 TASK_INVENTORY_ASSET_KEY = 1; | 66 | const U8 TASK_INVENTORY_ASSET_KEY = 1; |
69 | 67 | ||
70 | const LLUUID MAGIC_ID("3c115e51-04f4-523c-9fa6-98aff1034730"); | 68 | const LLUUID MAGIC_ID("3c115e51-04f4-523c-9fa6-98aff1034730"); |
71 | |||
72 | // helper function which returns true if inventory type and asset type | ||
73 | // are potentially compatible. For example, an attachment must be an | ||
74 | // object, but a wearable can be a bodypart or clothing asset. | ||
75 | bool inventory_and_asset_types_match( | ||
76 | LLInventoryType::EType inventory_type, | ||
77 | LLAssetType::EType asset_type); | ||
78 | |||
79 | 69 | ||
80 | ///---------------------------------------------------------------------------- | ||
81 | /// Class LLInventoryType | ||
82 | ///---------------------------------------------------------------------------- | ||
83 | |||
84 | // Unlike asset type names, not limited to 8 characters. | ||
85 | // Need not match asset type names. | ||
86 | static const char* INVENTORY_TYPE_NAMES[LLInventoryType::IT_COUNT] = | ||
87 | { | ||
88 | "texture", // 0 | ||
89 | "sound", | ||
90 | "callcard", | ||
91 | "landmark", | ||
92 | NULL, | ||
93 | NULL, // 5 | ||
94 | "object", | ||
95 | "notecard", | ||
96 | "category", | ||
97 | "root", | ||
98 | "script", // 10 | ||
99 | NULL, | ||
100 | NULL, | ||
101 | NULL, | ||
102 | NULL, | ||
103 | "snapshot", // 15 | ||
104 | NULL, | ||
105 | "attach", | ||
106 | "wearable", | ||
107 | "animation", | ||
108 | "gesture", // 20 | ||
109 | }; | ||
110 | |||
111 | // This table is meant for decoding to human readable form. Put any | ||
112 | // and as many printable characters you want in each one. | ||
113 | // See also LLAssetType::mAssetTypeHumanNames | ||
114 | static const char* INVENTORY_TYPE_HUMAN_NAMES[LLInventoryType::IT_COUNT] = | ||
115 | { | ||
116 | "texture", // 0 | ||
117 | "sound", | ||
118 | "calling card", | ||
119 | "landmark", | ||
120 | NULL, | ||
121 | NULL, // 5 | ||
122 | "object", | ||
123 | "note card", | ||
124 | "folder", | ||
125 | "root", | ||
126 | "script", // 10 | ||
127 | NULL, | ||
128 | NULL, | ||
129 | NULL, | ||
130 | NULL, | ||
131 | "snapshot", // 15 | ||
132 | NULL, | ||
133 | "attachment", | ||
134 | "wearable", | ||
135 | "animation", | ||
136 | "gesture", // 20 | ||
137 | }; | ||
138 | |||
139 | // Maps asset types to the default inventory type for that kind of asset. | ||
140 | // Thus, "Lost and Found" is a "Category" | ||
141 | static const LLInventoryType::EType | ||
142 | DEFAULT_ASSET_FOR_INV_TYPE[LLAssetType::AT_COUNT] = | ||
143 | { | ||
144 | LLInventoryType::IT_TEXTURE, // AT_TEXTURE | ||
145 | LLInventoryType::IT_SOUND, // AT_SOUND | ||
146 | LLInventoryType::IT_CALLINGCARD, // AT_CALLINGCARD | ||
147 | LLInventoryType::IT_LANDMARK, // AT_LANDMARK | ||
148 | LLInventoryType::IT_LSL, // AT_SCRIPT | ||
149 | LLInventoryType::IT_WEARABLE, // AT_CLOTHING | ||
150 | LLInventoryType::IT_OBJECT, // AT_OBJECT | ||
151 | LLInventoryType::IT_NOTECARD, // AT_NOTECARD | ||
152 | LLInventoryType::IT_CATEGORY, // AT_CATEGORY | ||
153 | LLInventoryType::IT_ROOT_CATEGORY, // AT_ROOT_CATEGORY | ||
154 | LLInventoryType::IT_LSL, // AT_LSL_TEXT | ||
155 | LLInventoryType::IT_LSL, // AT_LSL_BYTECODE | ||
156 | LLInventoryType::IT_TEXTURE, // AT_TEXTURE_TGA | ||
157 | LLInventoryType::IT_WEARABLE, // AT_BODYPART | ||
158 | LLInventoryType::IT_CATEGORY, // AT_TRASH | ||
159 | LLInventoryType::IT_CATEGORY, // AT_SNAPSHOT_CATEGORY | ||
160 | LLInventoryType::IT_CATEGORY, // AT_LOST_AND_FOUND | ||
161 | LLInventoryType::IT_SOUND, // AT_SOUND_WAV | ||
162 | LLInventoryType::IT_NONE, // AT_IMAGE_TGA | ||
163 | LLInventoryType::IT_NONE, // AT_IMAGE_JPEG | ||
164 | LLInventoryType::IT_ANIMATION, // AT_ANIMATION | ||
165 | LLInventoryType::IT_GESTURE, // AT_GESTURE | ||
166 | }; | ||
167 | |||
168 | static const int MAX_POSSIBLE_ASSET_TYPES = 2; | ||
169 | static const LLAssetType::EType | ||
170 | INVENTORY_TO_ASSET_TYPE[LLInventoryType::IT_COUNT][MAX_POSSIBLE_ASSET_TYPES] = | ||
171 | { | ||
172 | { LLAssetType::AT_TEXTURE, LLAssetType::AT_NONE }, // IT_TEXTURE | ||
173 | { LLAssetType::AT_SOUND, LLAssetType::AT_NONE }, // IT_SOUND | ||
174 | { LLAssetType::AT_CALLINGCARD, LLAssetType::AT_NONE }, // IT_CALLINGCARD | ||
175 | { LLAssetType::AT_LANDMARK, LLAssetType::AT_NONE }, // IT_LANDMARK | ||
176 | { LLAssetType::AT_NONE, LLAssetType::AT_NONE }, | ||
177 | { LLAssetType::AT_NONE, LLAssetType::AT_NONE }, | ||
178 | { LLAssetType::AT_OBJECT, LLAssetType::AT_NONE }, // IT_OBJECT | ||
179 | { LLAssetType::AT_NOTECARD, LLAssetType::AT_NONE }, // IT_NOTECARD | ||
180 | { LLAssetType::AT_NONE, LLAssetType::AT_NONE }, // IT_CATEGORY | ||
181 | { LLAssetType::AT_NONE, LLAssetType::AT_NONE }, // IT_ROOT_CATEGORY | ||
182 | { LLAssetType::AT_LSL_TEXT, LLAssetType::AT_LSL_BYTECODE }, // IT_LSL | ||
183 | { LLAssetType::AT_NONE, LLAssetType::AT_NONE }, | ||
184 | { LLAssetType::AT_NONE, LLAssetType::AT_NONE }, | ||
185 | { LLAssetType::AT_NONE, LLAssetType::AT_NONE }, | ||
186 | { LLAssetType::AT_NONE, LLAssetType::AT_NONE }, | ||
187 | { LLAssetType::AT_TEXTURE, LLAssetType::AT_NONE }, // IT_SNAPSHOT | ||
188 | { LLAssetType::AT_NONE, LLAssetType::AT_NONE }, | ||
189 | { LLAssetType::AT_OBJECT, LLAssetType::AT_NONE }, // IT_ATTACHMENT | ||
190 | { LLAssetType::AT_CLOTHING, LLAssetType::AT_BODYPART }, // IT_WEARABLE | ||
191 | { LLAssetType::AT_ANIMATION, LLAssetType::AT_NONE }, // IT_ANIMATION | ||
192 | { LLAssetType::AT_GESTURE, LLAssetType::AT_NONE }, // IT_GESTURE | ||
193 | }; | ||
194 | |||
195 | // static | ||
196 | const char* LLInventoryType::lookup(EType type) | ||
197 | { | ||
198 | if((type >= 0) && (type < IT_COUNT)) | ||
199 | { | ||
200 | return INVENTORY_TYPE_NAMES[S32(type)]; | ||
201 | } | ||
202 | else | ||
203 | { | ||
204 | return NULL; | ||
205 | } | ||
206 | } | ||
207 | |||
208 | // static | ||
209 | LLInventoryType::EType LLInventoryType::lookup(const char* name) | ||
210 | { | ||
211 | for(S32 i = 0; i < IT_COUNT; ++i) | ||
212 | { | ||
213 | if((INVENTORY_TYPE_NAMES[i]) | ||
214 | && (0 == strcmp(name, INVENTORY_TYPE_NAMES[i]))) | ||
215 | { | ||
216 | // match | ||
217 | return (EType)i; | ||
218 | } | ||
219 | } | ||
220 | return IT_NONE; | ||
221 | } | ||
222 | |||
223 | // XUI:translate | ||
224 | // translation from a type to a human readable form. | ||
225 | // static | ||
226 | const char* LLInventoryType::lookupHumanReadable(EType type) | ||
227 | { | ||
228 | if((type >= 0) && (type < IT_COUNT)) | ||
229 | { | ||
230 | return INVENTORY_TYPE_HUMAN_NAMES[S32(type)]; | ||
231 | } | ||
232 | else | ||
233 | { | ||
234 | return NULL; | ||
235 | } | ||
236 | } | ||
237 | |||
238 | // return the default inventory for the given asset type. | ||
239 | // static | ||
240 | LLInventoryType::EType LLInventoryType::defaultForAssetType(LLAssetType::EType asset_type) | ||
241 | { | ||
242 | if((asset_type >= 0) && (asset_type < LLAssetType::AT_COUNT)) | ||
243 | { | ||
244 | return DEFAULT_ASSET_FOR_INV_TYPE[S32(asset_type)]; | ||
245 | } | ||
246 | else | ||
247 | { | ||
248 | return IT_NONE; | ||
249 | } | ||
250 | } | ||
251 | 70 | ||
252 | ///---------------------------------------------------------------------------- | 71 | ///---------------------------------------------------------------------------- |
253 | /// Class LLInventoryObject | 72 | /// Class LLInventoryObject |
@@ -351,10 +170,6 @@ BOOL LLInventoryObject::importLegacyStream(std::istream& input_stream) | |||
351 | { | 170 | { |
352 | input_stream.getline(buffer, MAX_STRING); | 171 | input_stream.getline(buffer, MAX_STRING); |
353 | sscanf(buffer, " %254s %254s", keyword, valuestr); /* Flawfinder: ignore */ | 172 | sscanf(buffer, " %254s %254s", keyword, valuestr); /* Flawfinder: ignore */ |
354 | if(!keyword) | ||
355 | { | ||
356 | continue; | ||
357 | } | ||
358 | if(0 == strcmp("{",keyword)) | 173 | if(0 == strcmp("{",keyword)) |
359 | { | 174 | { |
360 | continue; | 175 | continue; |
@@ -722,10 +537,6 @@ BOOL LLInventoryItem::importFile(FILE* fp) | |||
722 | { | 537 | { |
723 | fgets(buffer, MAX_STRING, fp); | 538 | fgets(buffer, MAX_STRING, fp); |
724 | sscanf(buffer, " %254s %254s", keyword, valuestr); /* Flawfinder: ignore */ | 539 | sscanf(buffer, " %254s %254s", keyword, valuestr); /* Flawfinder: ignore */ |
725 | if(!keyword) | ||
726 | { | ||
727 | continue; | ||
728 | } | ||
729 | if(0 == strcmp("{",keyword)) | 540 | if(0 == strcmp("{",keyword)) |
730 | { | 541 | { |
731 | continue; | 542 | continue; |
@@ -927,10 +738,6 @@ BOOL LLInventoryItem::importLegacyStream(std::istream& input_stream) | |||
927 | buffer, | 738 | buffer, |
928 | " %254s %254s", | 739 | " %254s %254s", |
929 | keyword, valuestr); | 740 | keyword, valuestr); |
930 | if(!keyword) | ||
931 | { | ||
932 | continue; | ||
933 | } | ||
934 | if(0 == strcmp("{",keyword)) | 741 | if(0 == strcmp("{",keyword)) |
935 | { | 742 | { |
936 | continue; | 743 | continue; |
@@ -1419,7 +1226,8 @@ void LLInventoryItem::unpackBinaryBucket(U8* bin_bucket, S32 bin_bucket_size) | |||
1419 | } | 1226 | } |
1420 | else | 1227 | else |
1421 | { | 1228 | { |
1422 | llerrs << "unpackBinaryBucket failed. item_buffer or bin_bucket is Null." << llendl; | 1229 | llerrs << "unpackBinaryBucket failed. item_buffer or bin_bucket is Null." << llendl; |
1230 | delete[] item_buffer; | ||
1423 | return; | 1231 | return; |
1424 | } | 1232 | } |
1425 | item_buffer[bin_bucket_size] = '\0'; | 1233 | item_buffer[bin_bucket_size] = '\0'; |
@@ -1588,10 +1396,6 @@ BOOL LLInventoryCategory::importFile(FILE* fp) | |||
1588 | buffer, | 1396 | buffer, |
1589 | " %254s %254s", | 1397 | " %254s %254s", |
1590 | keyword, valuestr); | 1398 | keyword, valuestr); |
1591 | if(!keyword) | ||
1592 | { | ||
1593 | continue; | ||
1594 | } | ||
1595 | if(0 == strcmp("{",keyword)) | 1399 | if(0 == strcmp("{",keyword)) |
1596 | { | 1400 | { |
1597 | continue; | 1401 | continue; |
@@ -1671,10 +1475,6 @@ BOOL LLInventoryCategory::importLegacyStream(std::istream& input_stream) | |||
1671 | buffer, | 1475 | buffer, |
1672 | " %254s %254s", | 1476 | " %254s %254s", |
1673 | keyword, valuestr); | 1477 | keyword, valuestr); |
1674 | if(!keyword) | ||
1675 | { | ||
1676 | continue; | ||
1677 | } | ||
1678 | if(0 == strcmp("{",keyword)) | 1478 | if(0 == strcmp("{",keyword)) |
1679 | { | 1479 | { |
1680 | continue; | 1480 | continue; |
@@ -1739,25 +1539,6 @@ BOOL LLInventoryCategory::exportLegacyStream(std::ostream& output_stream, BOOL) | |||
1739 | /// Local function definitions | 1539 | /// Local function definitions |
1740 | ///---------------------------------------------------------------------------- | 1540 | ///---------------------------------------------------------------------------- |
1741 | 1541 | ||
1742 | bool inventory_and_asset_types_match( | ||
1743 | LLInventoryType::EType inventory_type, | ||
1744 | LLAssetType::EType asset_type) | ||
1745 | { | ||
1746 | bool rv = false; | ||
1747 | if((inventory_type >= 0) && (inventory_type < LLInventoryType::IT_COUNT)) | ||
1748 | { | ||
1749 | for(S32 i = 0; i < MAX_POSSIBLE_ASSET_TYPES; ++i) | ||
1750 | { | ||
1751 | if(INVENTORY_TO_ASSET_TYPE[inventory_type][i] == asset_type) | ||
1752 | { | ||
1753 | rv = true; | ||
1754 | break; | ||
1755 | } | ||
1756 | } | ||
1757 | } | ||
1758 | return rv; | ||
1759 | } | ||
1760 | |||
1761 | LLSD ll_create_sd_from_inventory_item(LLPointer<LLInventoryItem> item) | 1542 | LLSD ll_create_sd_from_inventory_item(LLPointer<LLInventoryItem> item) |
1762 | { | 1543 | { |
1763 | LLSD rv; | 1544 | LLSD rv; |
diff --git a/linden/indra/llinventory/llinventory.h b/linden/indra/llinventory/llinventory.h index 6e64412..b24fe79 100644 --- a/linden/indra/llinventory/llinventory.h +++ b/linden/indra/llinventory/llinventory.h | |||
@@ -33,6 +33,7 @@ | |||
33 | 33 | ||
34 | #include "llassetstorage.h" | 34 | #include "llassetstorage.h" |
35 | #include "lldarray.h" | 35 | #include "lldarray.h" |
36 | #include "llinventorytype.h" | ||
36 | #include "llmemtype.h" | 37 | #include "llmemtype.h" |
37 | #include "llpermissions.h" | 38 | #include "llpermissions.h" |
38 | #include "llsaleinfo.h" | 39 | #include "llsaleinfo.h" |
@@ -51,63 +52,6 @@ enum | |||
51 | MAX_INVENTORY_BUFFER_SIZE = 1024 | 52 | MAX_INVENTORY_BUFFER_SIZE = 1024 |
52 | }; | 53 | }; |
53 | 54 | ||
54 | //~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ | ||
55 | // Class LLInventoryType | ||
56 | // | ||
57 | // Class used to encapsulate operations around inventory type. | ||
58 | //~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ | ||
59 | |||
60 | class LLInventoryType | ||
61 | { | ||
62 | public: | ||
63 | enum EType | ||
64 | { | ||
65 | IT_TEXTURE = 0, | ||
66 | IT_SOUND = 1, | ||
67 | IT_CALLINGCARD = 2, | ||
68 | IT_LANDMARK = 3, | ||
69 | //IT_SCRIPT = 4, | ||
70 | //IT_CLOTHING = 5, | ||
71 | IT_OBJECT = 6, | ||
72 | IT_NOTECARD = 7, | ||
73 | IT_CATEGORY = 8, | ||
74 | IT_ROOT_CATEGORY = 9, | ||
75 | IT_LSL = 10, | ||
76 | //IT_LSL_BYTECODE = 11, | ||
77 | //IT_TEXTURE_TGA = 12, | ||
78 | //IT_BODYPART = 13, | ||
79 | //IT_TRASH = 14, | ||
80 | IT_SNAPSHOT = 15, | ||
81 | //IT_LOST_AND_FOUND = 16, | ||
82 | IT_ATTACHMENT = 17, | ||
83 | IT_WEARABLE = 18, | ||
84 | IT_ANIMATION = 19, | ||
85 | IT_GESTURE = 20, | ||
86 | IT_COUNT = 21, | ||
87 | |||
88 | IT_NONE = -1 | ||
89 | }; | ||
90 | |||
91 | // machine transation between type and strings | ||
92 | static EType lookup(const char* name); | ||
93 | static const char* lookup(EType type); | ||
94 | |||
95 | // translation from a type to a human readable form. | ||
96 | static const char* lookupHumanReadable(EType type); | ||
97 | |||
98 | // return the default inventory for the given asset type. | ||
99 | static EType defaultForAssetType(LLAssetType::EType asset_type); | ||
100 | |||
101 | private: | ||
102 | // don't instantiate or derive one of these objects | ||
103 | LLInventoryType( void ) {} | ||
104 | ~LLInventoryType( void ) {} | ||
105 | |||
106 | //private: | ||
107 | // static const char* mInventoryTypeNames[]; | ||
108 | // static const char* mInventoryTypeHumanNames[]; | ||
109 | // static LLInventoryType::EType mInventoryAssetType[]; | ||
110 | }; | ||
111 | 55 | ||
112 | 56 | ||
113 | //~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ | 57 | //~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ |
diff --git a/linden/indra/llinventory/llinventory.vcproj b/linden/indra/llinventory/llinventory.vcproj index 1c76808..66c580e 100644 --- a/linden/indra/llinventory/llinventory.vcproj +++ b/linden/indra/llinventory/llinventory.vcproj | |||
@@ -158,6 +158,9 @@ | |||
158 | RelativePath=".\llinventory.cpp"> | 158 | RelativePath=".\llinventory.cpp"> |
159 | </File> | 159 | </File> |
160 | <File | 160 | <File |
161 | RelativePath=".\llinventorytype.cpp"> | ||
162 | </File> | ||
163 | <File | ||
161 | RelativePath=".\lllandmark.cpp"> | 164 | RelativePath=".\lllandmark.cpp"> |
162 | </File> | 165 | </File> |
163 | <File | 166 | <File |
@@ -193,6 +196,9 @@ | |||
193 | RelativePath=".\llinventory.h"> | 196 | RelativePath=".\llinventory.h"> |
194 | </File> | 197 | </File> |
195 | <File | 198 | <File |
199 | RelativePath=".\llinventorytype.h"> | ||
200 | </File> | ||
201 | <File | ||
196 | RelativePath=".\lllandmark.h"> | 202 | RelativePath=".\lllandmark.h"> |
197 | </File> | 203 | </File> |
198 | <File | 204 | <File |
@@ -228,6 +234,9 @@ | |||
228 | Filter="rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe;resx" | 234 | Filter="rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe;resx" |
229 | UniqueIdentifier="{67DA6AB6-F800-4c08-8B7A-83BB121AAD01}"> | 235 | UniqueIdentifier="{67DA6AB6-F800-4c08-8B7A-83BB121AAD01}"> |
230 | </Filter> | 236 | </Filter> |
237 | <File | ||
238 | RelativePath=".\files.lst"> | ||
239 | </File> | ||
231 | </Files> | 240 | </Files> |
232 | <Globals> | 241 | <Globals> |
233 | </Globals> | 242 | </Globals> |
diff --git a/linden/indra/llinventory/llinventorytype.cpp b/linden/indra/llinventory/llinventorytype.cpp new file mode 100644 index 0000000..96dfb5e --- /dev/null +++ b/linden/indra/llinventory/llinventorytype.cpp | |||
@@ -0,0 +1,222 @@ | |||
1 | /** | ||
2 | * @file llinventorytype.cpp | ||
3 | * @brief Inventory item type, more specific than an asset type. | ||
4 | * | ||
5 | * Copyright (c) 2001-2007, Linden Research, Inc. | ||
6 | * | ||
7 | * Second Life Viewer Source Code | ||
8 | * The source code in this file ("Source Code") is provided by Linden Lab | ||
9 | * to you under the terms of the GNU General Public License, version 2.0 | ||
10 | * ("GPL"), unless you have obtained a separate licensing agreement | ||
11 | * ("Other License"), formally executed by you and Linden Lab. Terms of | ||
12 | * the GPL can be found in doc/GPL-license.txt in this distribution, or | ||
13 | * online at http://secondlife.com/developers/opensource/gplv2 | ||
14 | * | ||
15 | * There are special exceptions to the terms and conditions of the GPL as | ||
16 | * it is applied to this Source Code. View the full text of the exception | ||
17 | * in the file doc/FLOSS-exception.txt in this software distribution, or | ||
18 | * online at http://secondlife.com/developers/opensource/flossexception | ||
19 | * | ||
20 | * By copying, modifying or distributing this software, you acknowledge | ||
21 | * that you have read and understood your obligations described above, | ||
22 | * and agree to abide by those obligations. | ||
23 | * | ||
24 | * ALL LINDEN LAB SOURCE CODE IS PROVIDED "AS IS." LINDEN LAB MAKES NO | ||
25 | * WARRANTIES, EXPRESS, IMPLIED OR OTHERWISE, REGARDING ITS ACCURACY, | ||
26 | * COMPLETENESS OR PERFORMANCE. | ||
27 | */ | ||
28 | |||
29 | #include "linden_common.h" | ||
30 | |||
31 | #include "llinventorytype.h" | ||
32 | |||
33 | ///---------------------------------------------------------------------------- | ||
34 | /// Class LLInventoryType | ||
35 | ///---------------------------------------------------------------------------- | ||
36 | |||
37 | // Unlike asset type names, not limited to 8 characters. | ||
38 | // Need not match asset type names. | ||
39 | static const char* INVENTORY_TYPE_NAMES[LLInventoryType::IT_COUNT] = | ||
40 | { | ||
41 | "texture", // 0 | ||
42 | "sound", | ||
43 | "callcard", | ||
44 | "landmark", | ||
45 | NULL, | ||
46 | NULL, // 5 | ||
47 | "object", | ||
48 | "notecard", | ||
49 | "category", | ||
50 | "root", | ||
51 | "script", // 10 | ||
52 | NULL, | ||
53 | NULL, | ||
54 | NULL, | ||
55 | NULL, | ||
56 | "snapshot", // 15 | ||
57 | NULL, | ||
58 | "attach", | ||
59 | "wearable", | ||
60 | "animation", | ||
61 | "gesture", // 20 | ||
62 | }; | ||
63 | |||
64 | // This table is meant for decoding to human readable form. Put any | ||
65 | // and as many printable characters you want in each one. | ||
66 | // See also LLAssetType::mAssetTypeHumanNames | ||
67 | static const char* INVENTORY_TYPE_HUMAN_NAMES[LLInventoryType::IT_COUNT] = | ||
68 | { | ||
69 | "texture", // 0 | ||
70 | "sound", | ||
71 | "calling card", | ||
72 | "landmark", | ||
73 | NULL, | ||
74 | NULL, // 5 | ||
75 | "object", | ||
76 | "note card", | ||
77 | "folder", | ||
78 | "root", | ||
79 | "script", // 10 | ||
80 | NULL, | ||
81 | NULL, | ||
82 | NULL, | ||
83 | NULL, | ||
84 | "snapshot", // 15 | ||
85 | NULL, | ||
86 | "attachment", | ||
87 | "wearable", | ||
88 | "animation", | ||
89 | "gesture", // 20 | ||
90 | }; | ||
91 | |||
92 | // Maps asset types to the default inventory type for that kind of asset. | ||
93 | // Thus, "Lost and Found" is a "Category" | ||
94 | static const LLInventoryType::EType | ||
95 | DEFAULT_ASSET_FOR_INV_TYPE[LLAssetType::AT_COUNT] = | ||
96 | { | ||
97 | LLInventoryType::IT_TEXTURE, // AT_TEXTURE | ||
98 | LLInventoryType::IT_SOUND, // AT_SOUND | ||
99 | LLInventoryType::IT_CALLINGCARD, // AT_CALLINGCARD | ||
100 | LLInventoryType::IT_LANDMARK, // AT_LANDMARK | ||
101 | LLInventoryType::IT_LSL, // AT_SCRIPT | ||
102 | LLInventoryType::IT_WEARABLE, // AT_CLOTHING | ||
103 | LLInventoryType::IT_OBJECT, // AT_OBJECT | ||
104 | LLInventoryType::IT_NOTECARD, // AT_NOTECARD | ||
105 | LLInventoryType::IT_CATEGORY, // AT_CATEGORY | ||
106 | LLInventoryType::IT_ROOT_CATEGORY, // AT_ROOT_CATEGORY | ||
107 | LLInventoryType::IT_LSL, // AT_LSL_TEXT | ||
108 | LLInventoryType::IT_LSL, // AT_LSL_BYTECODE | ||
109 | LLInventoryType::IT_TEXTURE, // AT_TEXTURE_TGA | ||
110 | LLInventoryType::IT_WEARABLE, // AT_BODYPART | ||
111 | LLInventoryType::IT_CATEGORY, // AT_TRASH | ||
112 | LLInventoryType::IT_CATEGORY, // AT_SNAPSHOT_CATEGORY | ||
113 | LLInventoryType::IT_CATEGORY, // AT_LOST_AND_FOUND | ||
114 | LLInventoryType::IT_SOUND, // AT_SOUND_WAV | ||
115 | LLInventoryType::IT_NONE, // AT_IMAGE_TGA | ||
116 | LLInventoryType::IT_NONE, // AT_IMAGE_JPEG | ||
117 | LLInventoryType::IT_ANIMATION, // AT_ANIMATION | ||
118 | LLInventoryType::IT_GESTURE, // AT_GESTURE | ||
119 | }; | ||
120 | |||
121 | static const int MAX_POSSIBLE_ASSET_TYPES = 2; | ||
122 | static const LLAssetType::EType | ||
123 | INVENTORY_TO_ASSET_TYPE[LLInventoryType::IT_COUNT][MAX_POSSIBLE_ASSET_TYPES] = | ||
124 | { | ||
125 | { LLAssetType::AT_TEXTURE, LLAssetType::AT_NONE }, // IT_TEXTURE | ||
126 | { LLAssetType::AT_SOUND, LLAssetType::AT_NONE }, // IT_SOUND | ||
127 | { LLAssetType::AT_CALLINGCARD, LLAssetType::AT_NONE }, // IT_CALLINGCARD | ||
128 | { LLAssetType::AT_LANDMARK, LLAssetType::AT_NONE }, // IT_LANDMARK | ||
129 | { LLAssetType::AT_NONE, LLAssetType::AT_NONE }, | ||
130 | { LLAssetType::AT_NONE, LLAssetType::AT_NONE }, | ||
131 | { LLAssetType::AT_OBJECT, LLAssetType::AT_NONE }, // IT_OBJECT | ||
132 | { LLAssetType::AT_NOTECARD, LLAssetType::AT_NONE }, // IT_NOTECARD | ||
133 | { LLAssetType::AT_NONE, LLAssetType::AT_NONE }, // IT_CATEGORY | ||
134 | { LLAssetType::AT_NONE, LLAssetType::AT_NONE }, // IT_ROOT_CATEGORY | ||
135 | { LLAssetType::AT_LSL_TEXT, LLAssetType::AT_LSL_BYTECODE }, // IT_LSL | ||
136 | { LLAssetType::AT_NONE, LLAssetType::AT_NONE }, | ||
137 | { LLAssetType::AT_NONE, LLAssetType::AT_NONE }, | ||
138 | { LLAssetType::AT_NONE, LLAssetType::AT_NONE }, | ||
139 | { LLAssetType::AT_NONE, LLAssetType::AT_NONE }, | ||
140 | { LLAssetType::AT_TEXTURE, LLAssetType::AT_NONE }, // IT_SNAPSHOT | ||
141 | { LLAssetType::AT_NONE, LLAssetType::AT_NONE }, | ||
142 | { LLAssetType::AT_OBJECT, LLAssetType::AT_NONE }, // IT_ATTACHMENT | ||
143 | { LLAssetType::AT_CLOTHING, LLAssetType::AT_BODYPART }, // IT_WEARABLE | ||
144 | { LLAssetType::AT_ANIMATION, LLAssetType::AT_NONE }, // IT_ANIMATION | ||
145 | { LLAssetType::AT_GESTURE, LLAssetType::AT_NONE }, // IT_GESTURE | ||
146 | }; | ||
147 | |||
148 | // static | ||
149 | const char* LLInventoryType::lookup(EType type) | ||
150 | { | ||
151 | if((type >= 0) && (type < IT_COUNT)) | ||
152 | { | ||
153 | return INVENTORY_TYPE_NAMES[S32(type)]; | ||
154 | } | ||
155 | else | ||
156 | { | ||
157 | return NULL; | ||
158 | } | ||
159 | } | ||
160 | |||
161 | // static | ||
162 | LLInventoryType::EType LLInventoryType::lookup(const char* name) | ||
163 | { | ||
164 | for(S32 i = 0; i < IT_COUNT; ++i) | ||
165 | { | ||
166 | if((INVENTORY_TYPE_NAMES[i]) | ||
167 | && (0 == strcmp(name, INVENTORY_TYPE_NAMES[i]))) | ||
168 | { | ||
169 | // match | ||
170 | return (EType)i; | ||
171 | } | ||
172 | } | ||
173 | return IT_NONE; | ||
174 | } | ||
175 | |||
176 | // XUI:translate | ||
177 | // translation from a type to a human readable form. | ||
178 | // static | ||
179 | const char* LLInventoryType::lookupHumanReadable(EType type) | ||
180 | { | ||
181 | if((type >= 0) && (type < IT_COUNT)) | ||
182 | { | ||
183 | return INVENTORY_TYPE_HUMAN_NAMES[S32(type)]; | ||
184 | } | ||
185 | else | ||
186 | { | ||
187 | return NULL; | ||
188 | } | ||
189 | } | ||
190 | |||
191 | // return the default inventory for the given asset type. | ||
192 | // static | ||
193 | LLInventoryType::EType LLInventoryType::defaultForAssetType(LLAssetType::EType asset_type) | ||
194 | { | ||
195 | if((asset_type >= 0) && (asset_type < LLAssetType::AT_COUNT)) | ||
196 | { | ||
197 | return DEFAULT_ASSET_FOR_INV_TYPE[S32(asset_type)]; | ||
198 | } | ||
199 | else | ||
200 | { | ||
201 | return IT_NONE; | ||
202 | } | ||
203 | } | ||
204 | |||
205 | bool inventory_and_asset_types_match( | ||
206 | LLInventoryType::EType inventory_type, | ||
207 | LLAssetType::EType asset_type) | ||
208 | { | ||
209 | bool rv = false; | ||
210 | if((inventory_type >= 0) && (inventory_type < LLInventoryType::IT_COUNT)) | ||
211 | { | ||
212 | for(S32 i = 0; i < MAX_POSSIBLE_ASSET_TYPES; ++i) | ||
213 | { | ||
214 | if(INVENTORY_TO_ASSET_TYPE[inventory_type][i] == asset_type) | ||
215 | { | ||
216 | rv = true; | ||
217 | break; | ||
218 | } | ||
219 | } | ||
220 | } | ||
221 | return rv; | ||
222 | } | ||
diff --git a/linden/indra/llinventory/llinventorytype.h b/linden/indra/llinventory/llinventorytype.h new file mode 100644 index 0000000..7d34c87 --- /dev/null +++ b/linden/indra/llinventory/llinventorytype.h | |||
@@ -0,0 +1,94 @@ | |||
1 | /** | ||
2 | * @file llinventorytype.h | ||
3 | * @brief Inventory item type, more specific than an asset type. | ||
4 | * | ||
5 | * Copyright (c) 2001-2007, Linden Research, Inc. | ||
6 | * | ||
7 | * Second Life Viewer Source Code | ||
8 | * The source code in this file ("Source Code") is provided by Linden Lab | ||
9 | * to you under the terms of the GNU General Public License, version 2.0 | ||
10 | * ("GPL"), unless you have obtained a separate licensing agreement | ||
11 | * ("Other License"), formally executed by you and Linden Lab. Terms of | ||
12 | * the GPL can be found in doc/GPL-license.txt in this distribution, or | ||
13 | * online at http://secondlife.com/developers/opensource/gplv2 | ||
14 | * | ||
15 | * There are special exceptions to the terms and conditions of the GPL as | ||
16 | * it is applied to this Source Code. View the full text of the exception | ||
17 | * in the file doc/FLOSS-exception.txt in this software distribution, or | ||
18 | * online at http://secondlife.com/developers/opensource/flossexception | ||
19 | * | ||
20 | * By copying, modifying or distributing this software, you acknowledge | ||
21 | * that you have read and understood your obligations described above, | ||
22 | * and agree to abide by those obligations. | ||
23 | * | ||
24 | * ALL LINDEN LAB SOURCE CODE IS PROVIDED "AS IS." LINDEN LAB MAKES NO | ||
25 | * WARRANTIES, EXPRESS, IMPLIED OR OTHERWISE, REGARDING ITS ACCURACY, | ||
26 | * COMPLETENESS OR PERFORMANCE. | ||
27 | */ | ||
28 | |||
29 | #ifndef LLINVENTORYTYPE_H | ||
30 | #define LLINVENTORYTYPE_H | ||
31 | |||
32 | #include "llassettype.h" | ||
33 | |||
34 | //~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ | ||
35 | // Class LLInventoryType | ||
36 | // | ||
37 | // Class used to encapsulate operations around inventory type. | ||
38 | //~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ | ||
39 | |||
40 | class LLInventoryType | ||
41 | { | ||
42 | public: | ||
43 | enum EType | ||
44 | { | ||
45 | IT_TEXTURE = 0, | ||
46 | IT_SOUND = 1, | ||
47 | IT_CALLINGCARD = 2, | ||
48 | IT_LANDMARK = 3, | ||
49 | //IT_SCRIPT = 4, | ||
50 | //IT_CLOTHING = 5, | ||
51 | IT_OBJECT = 6, | ||
52 | IT_NOTECARD = 7, | ||
53 | IT_CATEGORY = 8, | ||
54 | IT_ROOT_CATEGORY = 9, | ||
55 | IT_LSL = 10, | ||
56 | //IT_LSL_BYTECODE = 11, | ||
57 | //IT_TEXTURE_TGA = 12, | ||
58 | //IT_BODYPART = 13, | ||
59 | //IT_TRASH = 14, | ||
60 | IT_SNAPSHOT = 15, | ||
61 | //IT_LOST_AND_FOUND = 16, | ||
62 | IT_ATTACHMENT = 17, | ||
63 | IT_WEARABLE = 18, | ||
64 | IT_ANIMATION = 19, | ||
65 | IT_GESTURE = 20, | ||
66 | IT_COUNT = 21, | ||
67 | |||
68 | IT_NONE = -1 | ||
69 | }; | ||
70 | |||
71 | // machine transation between type and strings | ||
72 | static EType lookup(const char* name); | ||
73 | static const char* lookup(EType type); | ||
74 | |||
75 | // translation from a type to a human readable form. | ||
76 | static const char* lookupHumanReadable(EType type); | ||
77 | |||
78 | // return the default inventory for the given asset type. | ||
79 | static EType defaultForAssetType(LLAssetType::EType asset_type); | ||
80 | |||
81 | private: | ||
82 | // don't instantiate or derive one of these objects | ||
83 | LLInventoryType( void ); | ||
84 | ~LLInventoryType( void ); | ||
85 | }; | ||
86 | |||
87 | // helper function which returns true if inventory type and asset type | ||
88 | // are potentially compatible. For example, an attachment must be an | ||
89 | // object, but a wearable can be a bodypart or clothing asset. | ||
90 | bool inventory_and_asset_types_match( | ||
91 | LLInventoryType::EType inventory_type, | ||
92 | LLAssetType::EType asset_type); | ||
93 | |||
94 | #endif | ||
diff --git a/linden/indra/llinventory/llparcel.cpp b/linden/indra/llinventory/llparcel.cpp index c37a4d6..5b2052f 100644 --- a/linden/indra/llinventory/llparcel.cpp +++ b/linden/indra/llinventory/llparcel.cpp | |||
@@ -1214,6 +1214,24 @@ BOOL LLParcel::exportStream(std::ostream& output_stream) | |||
1214 | return TRUE; | 1214 | return TRUE; |
1215 | } | 1215 | } |
1216 | 1216 | ||
1217 | // virtual | ||
1218 | LLSD LLParcel::asLLSD() const | ||
1219 | { | ||
1220 | LLSD p; | ||
1221 | p["parcel-id"] = getID(); | ||
1222 | p["name"] = getName(); | ||
1223 | p["desc"] = getDesc(); | ||
1224 | p["owner-id"] = getOwnerID(); | ||
1225 | p["group-id"] = getGroupID(); | ||
1226 | p["group-owned"] = (bool)getIsGroupOwned(); | ||
1227 | p["auction-id"] = (S32)getAuctionID(); | ||
1228 | p["snapshot-id"] = getSnapshotID(); | ||
1229 | p["authorized-buyer-id"] = getAuthorizedBuyerID(); | ||
1230 | p["sale-price"] = getSalePrice(); | ||
1231 | p["parcel-flags"] = (S32)getParcelFlags(); | ||
1232 | // NOTE: This list is incomplete, as this is used only for search. JC | ||
1233 | return p; | ||
1234 | } | ||
1217 | 1235 | ||
1218 | // Assumes we are in a block "ParcelData" | 1236 | // Assumes we are in a block "ParcelData" |
1219 | void LLParcel::packMessage(LLMessageSystem* msg) | 1237 | void LLParcel::packMessage(LLMessageSystem* msg) |
@@ -1786,7 +1804,7 @@ const char* category_to_ui_string(LLParcel::ECategory category) | |||
1786 | else | 1804 | else |
1787 | { | 1805 | { |
1788 | // C_ANY = -1 , but the "Any" string is at the end of the list | 1806 | // C_ANY = -1 , but the "Any" string is at the end of the list |
1789 | index = ((S32) LLParcel::C_COUNT) + 1; | 1807 | index = ((S32) LLParcel::C_COUNT); |
1790 | } | 1808 | } |
1791 | return PARCEL_CATEGORY_UI_STRING[index]; | 1809 | return PARCEL_CATEGORY_UI_STRING[index]; |
1792 | } | 1810 | } |
diff --git a/linden/indra/llinventory/llparcel.h b/linden/indra/llinventory/llparcel.h index 29e393a..cc20182 100644 --- a/linden/indra/llinventory/llparcel.h +++ b/linden/indra/llinventory/llparcel.h | |||
@@ -246,6 +246,7 @@ public: | |||
246 | BOOL importStream(std::istream& input_stream); | 246 | BOOL importStream(std::istream& input_stream); |
247 | BOOL importAccessEntry(std::istream& input_stream, LLAccessEntry* entry); | 247 | BOOL importAccessEntry(std::istream& input_stream, LLAccessEntry* entry); |
248 | BOOL exportStream(std::ostream& output_stream); | 248 | BOOL exportStream(std::ostream& output_stream); |
249 | virtual LLSD asLLSD() const; | ||
249 | 250 | ||
250 | void packMessage(LLMessageSystem* msg); | 251 | void packMessage(LLMessageSystem* msg); |
251 | void unpackMessage(LLMessageSystem* msg); | 252 | void unpackMessage(LLMessageSystem* msg); |
@@ -274,7 +275,7 @@ public: | |||
274 | BOOL removeFromBanList(const LLUUID& agent_id); | 275 | BOOL removeFromBanList(const LLUUID& agent_id); |
275 | 276 | ||
276 | // ACCESSORS | 277 | // ACCESSORS |
277 | const LLUUID& getID() { return mID; } | 278 | const LLUUID& getID() const { return mID; } |
278 | const char* getName() const { return mName.c_str(); } | 279 | const char* getName() const { return mName.c_str(); } |
279 | const char* getDesc() const { return mDesc.c_str(); } | 280 | const char* getDesc() const { return mDesc.c_str(); } |
280 | const char* getMusicURL() const { return mMusicURL.c_str(); } | 281 | const char* getMusicURL() const { return mMusicURL.c_str(); } |
@@ -283,14 +284,13 @@ public: | |||
283 | const U8 getMediaAutoScale() const { return mMediaAutoScale; } | 284 | const U8 getMediaAutoScale() const { return mMediaAutoScale; } |
284 | S32 getLocalID() const { return mLocalID; } | 285 | S32 getLocalID() const { return mLocalID; } |
285 | const LLUUID& getOwnerID() const { return mOwnerID; } | 286 | const LLUUID& getOwnerID() const { return mOwnerID; } |
286 | const LLUUID& getGroupID() const { return mGroupID; } | 287 | const LLUUID& getGroupID() const { return mGroupID; } |
287 | //const char* getGroupName() const { return mGroupName.c_str(); } | ||
288 | S32 getPassPrice() const { return mPassPrice; } | 288 | S32 getPassPrice() const { return mPassPrice; } |
289 | F32 getPassHours() const { return mPassHours; } | 289 | F32 getPassHours() const { return mPassHours; } |
290 | BOOL getIsGroupOwned() const { return mGroupOwned; } | 290 | BOOL getIsGroupOwned() const { return mGroupOwned; } |
291 | 291 | ||
292 | U32 getAuctionID() { return mAuctionID; } | 292 | U32 getAuctionID() const { return mAuctionID; } |
293 | bool isInEscrow() const { return mInEscrow; } | 293 | bool isInEscrow() const { return mInEscrow; } |
294 | 294 | ||
295 | BOOL isPublic() const; | 295 | BOOL isPublic() const; |
296 | 296 | ||
diff --git a/linden/indra/llinventory/llpermissions.cpp b/linden/indra/llinventory/llpermissions.cpp index 86ab57c..ae4360a 100644 --- a/linden/indra/llinventory/llpermissions.cpp +++ b/linden/indra/llinventory/llpermissions.cpp | |||
@@ -531,10 +531,6 @@ BOOL LLPermissions::importFile(FILE* fp) | |||
531 | buffer, | 531 | buffer, |
532 | " %255s %255s", | 532 | " %255s %255s", |
533 | keyword, valuestr); | 533 | keyword, valuestr); |
534 | if (!keyword) | ||
535 | { | ||
536 | continue; | ||
537 | } | ||
538 | if (!strcmp("{", keyword)) | 534 | if (!strcmp("{", keyword)) |
539 | { | 535 | { |
540 | continue; | 536 | continue; |
@@ -669,10 +665,6 @@ BOOL LLPermissions::importLegacyStream(std::istream& input_stream) | |||
669 | buffer, | 665 | buffer, |
670 | " %255s %255s", | 666 | " %255s %255s", |
671 | keyword, valuestr); | 667 | keyword, valuestr); |
672 | if (!keyword) | ||
673 | { | ||
674 | continue; | ||
675 | } | ||
676 | if (!strcmp("{", keyword)) | 668 | if (!strcmp("{", keyword)) |
677 | { | 669 | { |
678 | continue; | 670 | continue; |
diff --git a/linden/indra/llmath/llcamera.cpp b/linden/indra/llmath/llcamera.cpp index 2197066..c32bb67 100644 --- a/linden/indra/llmath/llcamera.cpp +++ b/linden/indra/llmath/llcamera.cpp | |||
@@ -506,7 +506,7 @@ void LLCamera::calcAgentFrustumPlanes(LLVector3* frust) | |||
506 | mAgentPlanes[3] = planeFromPoints(frust[1], frust[0], frust[4]); | 506 | mAgentPlanes[3] = planeFromPoints(frust[1], frust[0], frust[4]); |
507 | 507 | ||
508 | //cache plane octant facing mask for use in AABBInFrustum | 508 | //cache plane octant facing mask for use in AABBInFrustum |
509 | for (int i = 0; i < 8; i++) | 509 | for (int i = 0; i < 6; i++) |
510 | { | 510 | { |
511 | U8 mask = 0; | 511 | U8 mask = 0; |
512 | LLPlane p = mAgentPlanes[i]; | 512 | LLPlane p = mAgentPlanes[i]; |
diff --git a/linden/indra/llmath/llmath.h b/linden/indra/llmath/llmath.h index dbd825d..dd44e0c 100644 --- a/linden/indra/llmath/llmath.h +++ b/linden/indra/llmath/llmath.h | |||
@@ -99,6 +99,27 @@ inline BOOL is_approx_equal(F32 x, F32 y) | |||
99 | return (abs((S32) ((U32&)x - (U32&)y) ) < COMPARE_MANTISSA_UP_TO_BIT); | 99 | return (abs((S32) ((U32&)x - (U32&)y) ) < COMPARE_MANTISSA_UP_TO_BIT); |
100 | } | 100 | } |
101 | 101 | ||
102 | inline BOOL is_approx_equal_fraction(F32 x, F32 y, U32 frac_bits) | ||
103 | { | ||
104 | BOOL ret = TRUE; | ||
105 | F32 diff = (F32) fabs(x - y); | ||
106 | |||
107 | S32 diffInt = (S32) diff; | ||
108 | S32 diffFracTolerance = (S32) ((diff - (F32) diffInt) * (1 << frac_bits)); | ||
109 | |||
110 | // if integer portion is not equal, not enough bits were used for packing | ||
111 | // so error out since either the use case is not correct OR there is | ||
112 | // an issue with pack/unpack. should fail in either case. | ||
113 | // for decimal portion, make sure that the delta is no more than 1 | ||
114 | // based on the number of bits used for packing decimal portion. | ||
115 | if (diffInt != 0 || diffFracTolerance > 1) | ||
116 | { | ||
117 | ret = FALSE; | ||
118 | } | ||
119 | |||
120 | return ret; | ||
121 | } | ||
122 | |||
102 | inline S32 llabs(const S32 a) | 123 | inline S32 llabs(const S32 a) |
103 | { | 124 | { |
104 | return S32(labs(a)); | 125 | return S32(labs(a)); |
diff --git a/linden/indra/llmath/llrand.cpp b/linden/indra/llmath/llrand.cpp index f62bd71..e6c4cc5 100644 --- a/linden/indra/llmath/llrand.cpp +++ b/linden/indra/llmath/llrand.cpp | |||
@@ -106,7 +106,7 @@ inline F64 ll_internal_random_double() | |||
106 | // occasionally give an obviously incorrect random number -- like | 106 | // occasionally give an obviously incorrect random number -- like |
107 | // 5^15 or something. Sooooo, clamp it as described above. | 107 | // 5^15 or something. Sooooo, clamp it as described above. |
108 | F64 rv = gRandomGenerator(); | 108 | F64 rv = gRandomGenerator(); |
109 | if(!((rv >= 0.0) && (rv < 1.0))) return 0.0; | 109 | if(!((rv >= 0.0) && (rv < 1.0))) return fmod(rv, 1.0); |
110 | return rv; | 110 | return rv; |
111 | } | 111 | } |
112 | 112 | ||
@@ -114,7 +114,7 @@ inline F32 ll_internal_random_float() | |||
114 | { | 114 | { |
115 | // The clamping rules are described above. | 115 | // The clamping rules are described above. |
116 | F32 rv = (F32)gRandomGenerator(); | 116 | F32 rv = (F32)gRandomGenerator(); |
117 | if(!((rv >= 0.0f) && (rv < 1.0f))) return 0.0f; | 117 | if(!((rv >= 0.0f) && (rv < 1.0f))) return fmod(rv, 1.f); |
118 | return rv; | 118 | return rv; |
119 | } | 119 | } |
120 | #endif | 120 | #endif |
diff --git a/linden/indra/llmath/lluuid.cpp b/linden/indra/llmath/lluuid.cpp index 78dc8e6..0fed6b3 100644 --- a/linden/indra/llmath/lluuid.cpp +++ b/linden/indra/llmath/lluuid.cpp | |||
@@ -486,7 +486,7 @@ S32 LLUUID::getNodeID(unsigned char * node_id) | |||
486 | Ncb.ncb_command = NCBASTAT; | 486 | Ncb.ncb_command = NCBASTAT; |
487 | Ncb.ncb_lana_num = lenum.lana[i]; | 487 | Ncb.ncb_lana_num = lenum.lana[i]; |
488 | 488 | ||
489 | strcpy( (char *)Ncb.ncb_callname, "* " ); /* Flawfinder: ignore */ | 489 | strcpy( (char *)Ncb.ncb_callname, "* " ); /* Flawfinder: ignore */ |
490 | Ncb.ncb_buffer = (unsigned char *)&Adapter; | 490 | Ncb.ncb_buffer = (unsigned char *)&Adapter; |
491 | Ncb.ncb_length = sizeof(Adapter); | 491 | Ncb.ncb_length = sizeof(Adapter); |
492 | 492 | ||
diff --git a/linden/indra/llmath/llvolume.cpp b/linden/indra/llmath/llvolume.cpp index bb3b24d..89644a5 100644 --- a/linden/indra/llmath/llvolume.cpp +++ b/linden/indra/llmath/llvolume.cpp | |||
@@ -742,10 +742,6 @@ BOOL LLProfileParams::importFile(FILE *fp) | |||
742 | buffer, | 742 | buffer, |
743 | " %255s %255s", | 743 | " %255s %255s", |
744 | keyword, valuestr); | 744 | keyword, valuestr); |
745 | if (!keyword) | ||
746 | { | ||
747 | continue; | ||
748 | } | ||
749 | if (!strcmp("{", keyword)) | 745 | if (!strcmp("{", keyword)) |
750 | { | 746 | { |
751 | continue; | 747 | continue; |
@@ -818,10 +814,6 @@ BOOL LLProfileParams::importLegacyStream(std::istream& input_stream) | |||
818 | " %255s %255s", | 814 | " %255s %255s", |
819 | keyword, | 815 | keyword, |
820 | valuestr); | 816 | valuestr); |
821 | if (!keyword) | ||
822 | { | ||
823 | continue; | ||
824 | } | ||
825 | if (!strcmp("{", keyword)) | 817 | if (!strcmp("{", keyword)) |
826 | { | 818 | { |
827 | continue; | 819 | continue; |
@@ -1245,10 +1237,6 @@ BOOL LLPathParams::importFile(FILE *fp) | |||
1245 | buffer, | 1237 | buffer, |
1246 | " %255s %255s", | 1238 | " %255s %255s", |
1247 | keyword, valuestr); | 1239 | keyword, valuestr); |
1248 | if (!keyword) | ||
1249 | { | ||
1250 | continue; | ||
1251 | } | ||
1252 | if (!strcmp("{", keyword)) | 1240 | if (!strcmp("{", keyword)) |
1253 | { | 1241 | { |
1254 | continue; | 1242 | continue; |
@@ -1389,10 +1377,6 @@ BOOL LLPathParams::importLegacyStream(std::istream& input_stream) | |||
1389 | buffer, | 1377 | buffer, |
1390 | " %255s %255s", | 1378 | " %255s %255s", |
1391 | keyword, valuestr); | 1379 | keyword, valuestr); |
1392 | if (!keyword) | ||
1393 | { | ||
1394 | continue; | ||
1395 | } | ||
1396 | if (!strcmp("{", keyword)) | 1380 | if (!strcmp("{", keyword)) |
1397 | { | 1381 | { |
1398 | continue; | 1382 | continue; |
@@ -3287,6 +3271,9 @@ BOOL LLVolume::cleanupTriangleData( const S32 num_input_vertices, | |||
3287 | if (new_num_triangles == 0) | 3271 | if (new_num_triangles == 0) |
3288 | { | 3272 | { |
3289 | llwarns << "Created volume object with 0 faces." << llendl; | 3273 | llwarns << "Created volume object with 0 faces." << llendl; |
3274 | delete[] new_triangles; | ||
3275 | delete[] vertex_mapping; | ||
3276 | delete[] new_vertices; | ||
3290 | return FALSE; | 3277 | return FALSE; |
3291 | } | 3278 | } |
3292 | 3279 | ||
@@ -3381,10 +3368,6 @@ BOOL LLVolumeParams::importFile(FILE *fp) | |||
3381 | { | 3368 | { |
3382 | fgets(buffer, BUFSIZE, fp); | 3369 | fgets(buffer, BUFSIZE, fp); |
3383 | sscanf(buffer, " %255s", keyword); /* Flawfinder: ignore */ | 3370 | sscanf(buffer, " %255s", keyword); /* Flawfinder: ignore */ |
3384 | if (!keyword) | ||
3385 | { | ||
3386 | continue; | ||
3387 | } | ||
3388 | if (!strcmp("{", keyword)) | 3371 | if (!strcmp("{", keyword)) |
3389 | { | 3372 | { |
3390 | continue; | 3373 | continue; |
@@ -3435,10 +3418,6 @@ BOOL LLVolumeParams::importLegacyStream(std::istream& input_stream) | |||
3435 | { | 3418 | { |
3436 | input_stream.getline(buffer, BUFSIZE); | 3419 | input_stream.getline(buffer, BUFSIZE); |
3437 | sscanf(buffer, " %255s", keyword); | 3420 | sscanf(buffer, " %255s", keyword); |
3438 | if (!keyword) | ||
3439 | { | ||
3440 | continue; | ||
3441 | } | ||
3442 | if (!strcmp("{", keyword)) | 3421 | if (!strcmp("{", keyword)) |
3443 | { | 3422 | { |
3444 | continue; | 3423 | continue; |
diff --git a/linden/indra/llmessage/llassetstorage.cpp b/linden/indra/llmessage/llassetstorage.cpp index 4f4fc0c..c8610a7 100644 --- a/linden/indra/llmessage/llassetstorage.cpp +++ b/linden/indra/llmessage/llassetstorage.cpp | |||
@@ -57,10 +57,6 @@ LLAssetStorage *gAssetStorage = NULL; | |||
57 | 57 | ||
58 | const LLUUID CATEGORIZE_LOST_AND_FOUND_ID("00000000-0000-0000-0000-000000000010"); | 58 | const LLUUID CATEGORIZE_LOST_AND_FOUND_ID("00000000-0000-0000-0000-000000000010"); |
59 | 59 | ||
60 | const F32 LL_ASSET_STORAGE_TIMEOUT = 300.0f; // anything that takes longer than this will abort | ||
61 | |||
62 | |||
63 | |||
64 | ///---------------------------------------------------------------------------- | 60 | ///---------------------------------------------------------------------------- |
65 | /// LLAssetInfo | 61 | /// LLAssetInfo |
66 | ///---------------------------------------------------------------------------- | 62 | ///---------------------------------------------------------------------------- |
@@ -837,43 +833,6 @@ void LLAssetStorage::downloadInvItemCompleteCallback( | |||
837 | // Store routines | 833 | // Store routines |
838 | ///////////////////////////////////////////////////////////////////////////////////////////////////////////////// | 834 | ///////////////////////////////////////////////////////////////////////////////////////////////////////////////// |
839 | 835 | ||
840 | // virtual | ||
841 | void LLAssetStorage::cancelStoreAsset( | ||
842 | const LLUUID& uuid, | ||
843 | LLAssetType::EType atype) | ||
844 | { | ||
845 | bool do_callback = true; | ||
846 | LLAssetRequest* req = NULL; | ||
847 | |||
848 | if(mPendingUploads.size() > 0) | ||
849 | { | ||
850 | req = mPendingUploads.front(); | ||
851 | if((req->getUUID() == uuid) && (req->getType() == atype)) | ||
852 | { | ||
853 | // This is probably because the request is in progress - do | ||
854 | // not attempt to cancel. | ||
855 | do_callback = false; | ||
856 | } | ||
857 | } | ||
858 | |||
859 | if (mPendingLocalUploads.size() > 0) | ||
860 | { | ||
861 | req = mPendingLocalUploads.front(); | ||
862 | if((req->getUUID() == uuid) && (req->getType() == atype)) | ||
863 | { | ||
864 | // This is probably because the request is in progress - do | ||
865 | // not attempt to cancel. | ||
866 | do_callback = false; | ||
867 | } | ||
868 | } | ||
869 | |||
870 | if (do_callback) | ||
871 | { | ||
872 | // clear it out of the upload queue if it is there. | ||
873 | _callUploadCallbacks(uuid, atype, FALSE); | ||
874 | } | ||
875 | } | ||
876 | |||
877 | // static | 836 | // static |
878 | void LLAssetStorage::uploadCompleteCallback(const LLUUID& uuid, void *user_data, S32 result) // StoreAssetData callback (fixed) | 837 | void LLAssetStorage::uploadCompleteCallback(const LLUUID& uuid, void *user_data, S32 result) // StoreAssetData callback (fixed) |
879 | { | 838 | { |
diff --git a/linden/indra/llmessage/llassetstorage.h b/linden/indra/llmessage/llassetstorage.h index 3c7a709..f80a77d 100644 --- a/linden/indra/llmessage/llassetstorage.h +++ b/linden/indra/llmessage/llassetstorage.h | |||
@@ -48,6 +48,10 @@ class LLAssetStorage; | |||
48 | class LLVFS; | 48 | class LLVFS; |
49 | class LLSD; | 49 | class LLSD; |
50 | 50 | ||
51 | // anything that takes longer than this to download will abort. | ||
52 | // HTTP Uploads also timeout if they take longer than this. | ||
53 | const F32 LL_ASSET_STORAGE_TIMEOUT = 5 * 60.0f; | ||
54 | |||
51 | class LLAssetInfo | 55 | class LLAssetInfo |
52 | { | 56 | { |
53 | protected: | 57 | protected: |
@@ -264,13 +268,6 @@ public: | |||
264 | bool store_local = false, | 268 | bool store_local = false, |
265 | const LLUUID& requesting_agent_id = LLUUID::null); | 269 | const LLUUID& requesting_agent_id = LLUUID::null); |
266 | 270 | ||
267 | // This call will attempt to clear a store asset. This will only | ||
268 | // attempt to cancel an upload that has not yet begun. The | ||
269 | // callback will be called with an error code. | ||
270 | virtual void cancelStoreAsset( | ||
271 | const LLUUID& uuid, | ||
272 | LLAssetType::EType oatype); | ||
273 | |||
274 | virtual void checkForTimeouts(); | 271 | virtual void checkForTimeouts(); |
275 | 272 | ||
276 | void getEstateAsset(const LLHost &object_sim, const LLUUID &agent_id, const LLUUID &session_id, | 273 | void getEstateAsset(const LLHost &object_sim, const LLUUID &agent_id, const LLUUID &session_id, |
diff --git a/linden/indra/llmessage/llcachename.cpp b/linden/indra/llmessage/llcachename.cpp index 5df62b3..1cc7e09 100644 --- a/linden/indra/llmessage/llcachename.cpp +++ b/linden/indra/llmessage/llcachename.cpp | |||
@@ -52,6 +52,10 @@ const char* CN_NONE = "(none)"; | |||
52 | const char* CN_HIPPOS = "(hippos)"; | 52 | const char* CN_HIPPOS = "(hippos)"; |
53 | const F32 HIPPO_PROBABILITY = 0.01f; | 53 | const F32 HIPPO_PROBABILITY = 0.01f; |
54 | 54 | ||
55 | // We track name requests in flight for up to this long. | ||
56 | // We won't re-request a name during this time | ||
57 | const U32 PENDING_TIMEOUT_SECS = 5 * 60; | ||
58 | |||
55 | // File version number | 59 | // File version number |
56 | const S32 CN_FILE_VERSION = 2; | 60 | const S32 CN_FILE_VERSION = 2; |
57 | 61 | ||
@@ -182,8 +186,9 @@ namespace { | |||
182 | } | 186 | } |
183 | 187 | ||
184 | 188 | ||
185 | typedef std::vector<LLUUID> AskQueue; | 189 | typedef std::set<LLUUID> AskQueue; |
186 | typedef std::vector<PendingReply> ReplyQueue; | 190 | typedef std::vector<PendingReply> ReplyQueue; |
191 | typedef std::map<LLUUID,U32> PendingQueue; | ||
187 | typedef std::map<LLUUID, LLCacheNameEntry*> Cache; | 192 | typedef std::map<LLUUID, LLCacheNameEntry*> Cache; |
188 | typedef std::vector<LLCacheNameCallback> Observers; | 193 | typedef std::vector<LLCacheNameCallback> Observers; |
189 | }; | 194 | }; |
@@ -200,6 +205,9 @@ public: | |||
200 | AskQueue mAskNameQueue; | 205 | AskQueue mAskNameQueue; |
201 | AskQueue mAskGroupQueue; | 206 | AskQueue mAskGroupQueue; |
202 | // UUIDs to ask our upstream host about | 207 | // UUIDs to ask our upstream host about |
208 | |||
209 | PendingQueue mPendingQueue; | ||
210 | // UUIDs that have been requested but are not in cache yet. | ||
203 | 211 | ||
204 | ReplyQueue mReplyQueue; | 212 | ReplyQueue mReplyQueue; |
205 | // requests awaiting replies from us | 213 | // requests awaiting replies from us |
@@ -214,6 +222,7 @@ public: | |||
214 | void processPendingAsks(); | 222 | void processPendingAsks(); |
215 | void processPendingReplies(); | 223 | void processPendingReplies(); |
216 | void sendRequest(const char* msg_name, const AskQueue& queue); | 224 | void sendRequest(const char* msg_name, const AskQueue& queue); |
225 | bool isRequestPending(const LLUUID& id); | ||
217 | 226 | ||
218 | // Message system callbacks. | 227 | // Message system callbacks. |
219 | void processUUIDRequest(LLMessageSystem* msg, bool isGroup); | 228 | void processUUIDRequest(LLMessageSystem* msg, bool isGroup); |
@@ -456,7 +465,10 @@ BOOL LLCacheName::getName(const LLUUID& id, char* first, char* last) | |||
456 | : CN_WAITING); | 465 | : CN_WAITING); |
457 | strcpy(last, ""); /*Flawfinder: ignore*/ | 466 | strcpy(last, ""); /*Flawfinder: ignore*/ |
458 | 467 | ||
459 | impl.mAskNameQueue.push_back(id); | 468 | if (!impl.isRequestPending(id)) |
469 | { | ||
470 | impl.mAskNameQueue.insert(id); | ||
471 | } | ||
460 | return FALSE; | 472 | return FALSE; |
461 | } | 473 | } |
462 | 474 | ||
@@ -496,8 +508,10 @@ BOOL LLCacheName::getGroupName(const LLUUID& id, char* group) | |||
496 | // The function signature needs to change to pass in the length | 508 | // The function signature needs to change to pass in the length |
497 | // of first and last. | 509 | // of first and last. |
498 | strcpy(group, CN_WAITING); /*Flawfinder: ignore*/ | 510 | strcpy(group, CN_WAITING); /*Flawfinder: ignore*/ |
499 | 511 | if (!impl.isRequestPending(id)) | |
500 | impl.mAskGroupQueue.push_back(id); | 512 | { |
513 | impl.mAskGroupQueue.insert(id); | ||
514 | } | ||
501 | return FALSE; | 515 | return FALSE; |
502 | } | 516 | } |
503 | } | 517 | } |
@@ -525,13 +539,16 @@ void LLCacheName::get(const LLUUID& id, BOOL is_group, LLCacheNameCallback callb | |||
525 | } | 539 | } |
526 | else | 540 | else |
527 | { | 541 | { |
528 | if (!is_group) | 542 | if (!impl.isRequestPending(id)) |
529 | { | ||
530 | impl.mAskNameQueue.push_back(id); | ||
531 | } | ||
532 | else | ||
533 | { | 543 | { |
534 | impl.mAskGroupQueue.push_back(id); | 544 | if (!is_group) |
545 | { | ||
546 | impl.mAskNameQueue.insert(id); | ||
547 | } | ||
548 | else | ||
549 | { | ||
550 | impl.mAskGroupQueue.insert(id); | ||
551 | } | ||
535 | } | 552 | } |
536 | impl.mReplyQueue.push_back(PendingReply(id, callback, user_data)); | 553 | impl.mReplyQueue.push_back(PendingReply(id, callback, user_data)); |
537 | } | 554 | } |
@@ -570,6 +587,19 @@ void LLCacheName::deleteEntriesOlderThan(S32 secs) | |||
570 | impl.mCache.erase(curiter); | 587 | impl.mCache.erase(curiter); |
571 | } | 588 | } |
572 | } | 589 | } |
590 | |||
591 | // These are pending requests that we never heard back from. | ||
592 | U32 pending_expire_time = now - PENDING_TIMEOUT_SECS; | ||
593 | for(PendingQueue::iterator p_iter = impl.mPendingQueue.begin(); | ||
594 | p_iter != impl.mPendingQueue.end(); ) | ||
595 | { | ||
596 | PendingQueue::iterator p_curitor = p_iter++; | ||
597 | |||
598 | if (p_curitor->second < pending_expire_time) | ||
599 | { | ||
600 | impl.mPendingQueue.erase(p_curitor); | ||
601 | } | ||
602 | } | ||
573 | } | 603 | } |
574 | 604 | ||
575 | 605 | ||
@@ -599,6 +629,18 @@ void LLCacheName::dump() | |||
599 | } | 629 | } |
600 | } | 630 | } |
601 | 631 | ||
632 | void LLCacheName::dumpStats() | ||
633 | { | ||
634 | llinfos << "Queue sizes: " | ||
635 | << " Cache=" << impl.mCache.size() | ||
636 | << " AskName=" << impl.mAskNameQueue.size() | ||
637 | << " AskGroup=" << impl.mAskGroupQueue.size() | ||
638 | << " Pending=" << impl.mPendingQueue.size() | ||
639 | << " Reply=" << impl.mReplyQueue.size() | ||
640 | << " Observers=" << impl.mObservers.size() | ||
641 | << llendl; | ||
642 | } | ||
643 | |||
602 | void LLCacheName::Impl::processPendingAsks() | 644 | void LLCacheName::Impl::processPendingAsks() |
603 | { | 645 | { |
604 | sendRequest(_PREHASH_UUIDNameRequest, mAskNameQueue); | 646 | sendRequest(_PREHASH_UUIDNameRequest, mAskNameQueue); |
@@ -702,7 +744,23 @@ void LLCacheName::Impl::notifyObservers(const LLUUID& id, | |||
702 | } | 744 | } |
703 | } | 745 | } |
704 | 746 | ||
747 | bool LLCacheName::Impl::isRequestPending(const LLUUID& id) | ||
748 | { | ||
749 | U32 now = (U32)time(NULL); | ||
750 | U32 expire_time = now - PENDING_TIMEOUT_SECS; | ||
705 | 751 | ||
752 | PendingQueue::iterator iter = mPendingQueue.find(id); | ||
753 | |||
754 | if (iter == mPendingQueue.end() | ||
755 | || (iter->second < expire_time) ) | ||
756 | { | ||
757 | mPendingQueue[id] = now; | ||
758 | return false; | ||
759 | } | ||
760 | |||
761 | return true; | ||
762 | } | ||
763 | |||
706 | void LLCacheName::Impl::processUUIDRequest(LLMessageSystem* msg, bool isGroup) | 764 | void LLCacheName::Impl::processUUIDRequest(LLMessageSystem* msg, bool isGroup) |
707 | { | 765 | { |
708 | // You should only get this message if the cache is at the simulator | 766 | // You should only get this message if the cache is at the simulator |
@@ -740,13 +798,16 @@ void LLCacheName::Impl::processUUIDRequest(LLMessageSystem* msg, bool isGroup) | |||
740 | } | 798 | } |
741 | else | 799 | else |
742 | { | 800 | { |
743 | if (isGroup) | 801 | if (!isRequestPending(id)) |
744 | { | 802 | { |
745 | mAskGroupQueue.push_back(id); | 803 | if (isGroup) |
746 | } | 804 | { |
747 | else | 805 | mAskGroupQueue.insert(id); |
748 | { | 806 | } |
749 | mAskNameQueue.push_back(id); | 807 | else |
808 | { | ||
809 | mAskNameQueue.insert(id); | ||
810 | } | ||
750 | } | 811 | } |
751 | 812 | ||
752 | mReplyQueue.push_back(PendingReply(id, fromHost)); | 813 | mReplyQueue.push_back(PendingReply(id, fromHost)); |
@@ -770,6 +831,8 @@ void LLCacheName::Impl::processUUIDReply(LLMessageSystem* msg, bool isGroup) | |||
770 | mCache[id] = entry; | 831 | mCache[id] = entry; |
771 | } | 832 | } |
772 | 833 | ||
834 | mPendingQueue.erase(id); | ||
835 | |||
773 | entry->mIsGroup = isGroup; | 836 | entry->mIsGroup = isGroup; |
774 | entry->mCreateTime = (U32)time(NULL); | 837 | entry->mCreateTime = (U32)time(NULL); |
775 | if (!isGroup) | 838 | if (!isGroup) |
diff --git a/linden/indra/llmessage/llcachename.h b/linden/indra/llmessage/llcachename.h index 9009b1f..7d606e6 100644 --- a/linden/indra/llmessage/llcachename.h +++ b/linden/indra/llmessage/llcachename.h | |||
@@ -98,7 +98,8 @@ public: | |||
98 | void deleteEntriesOlderThan(S32 secs); | 98 | void deleteEntriesOlderThan(S32 secs); |
99 | 99 | ||
100 | // Debugging | 100 | // Debugging |
101 | void dump(); | 101 | void dump(); // Dumps the contents of the cache |
102 | void dumpStats(); // Dumps the sizes of the cache and associated queues. | ||
102 | 103 | ||
103 | private: | 104 | private: |
104 | class Impl; | 105 | class Impl; |
diff --git a/linden/indra/llmessage/llcircuit.cpp b/linden/indra/llmessage/llcircuit.cpp index 5e93e0a..239c1df 100644 --- a/linden/indra/llmessage/llcircuit.cpp +++ b/linden/indra/llmessage/llcircuit.cpp | |||
@@ -1167,13 +1167,13 @@ std::ostream& operator<<(std::ostream& s, LLCircuitData& circuit) | |||
1167 | return s; | 1167 | return s; |
1168 | } | 1168 | } |
1169 | 1169 | ||
1170 | const char* LLCircuitData::getInfoString() const | 1170 | const LLString LLCircuitData::getInfoString() const |
1171 | { | 1171 | { |
1172 | std::ostringstream info; | 1172 | std::ostringstream info; |
1173 | info << "Circuit: " << mHost << std::endl | 1173 | info << "Circuit: " << mHost << std::endl |
1174 | << (mbAlive ? "Alive" : "Not Alive") << std::endl | 1174 | << (mbAlive ? "Alive" : "Not Alive") << std::endl |
1175 | << "Age: " << mExistenceTimer.getElapsedTimeF32() << std::endl; | 1175 | << "Age: " << mExistenceTimer.getElapsedTimeF32() << std::endl; |
1176 | return info.str().c_str(); | 1176 | return LLString(info.str()); |
1177 | } | 1177 | } |
1178 | 1178 | ||
1179 | void LLCircuitData::dumpResendCountAndReset() | 1179 | void LLCircuitData::dumpResendCountAndReset() |
@@ -1197,7 +1197,7 @@ std::ostream& operator<<(std::ostream& s, LLCircuit &circuit) | |||
1197 | return s; | 1197 | return s; |
1198 | } | 1198 | } |
1199 | 1199 | ||
1200 | const char* LLCircuit::getInfoString() const | 1200 | const LLString LLCircuit::getInfoString() const |
1201 | { | 1201 | { |
1202 | std::ostringstream info; | 1202 | std::ostringstream info; |
1203 | info << "Circuit Info:" << std::endl; | 1203 | info << "Circuit Info:" << std::endl; |
@@ -1207,7 +1207,7 @@ const char* LLCircuit::getInfoString() const | |||
1207 | { | 1207 | { |
1208 | info << (*it).second->getInfoString() << std::endl; | 1208 | info << (*it).second->getInfoString() << std::endl; |
1209 | } | 1209 | } |
1210 | return info.str().c_str(); | 1210 | return LLString(info.str()); |
1211 | } | 1211 | } |
1212 | 1212 | ||
1213 | void LLCircuit::getCircuitRange( | 1213 | void LLCircuit::getCircuitRange( |
diff --git a/linden/indra/llmessage/llcircuit.h b/linden/indra/llmessage/llcircuit.h index e3a5779..1eea203 100644 --- a/linden/indra/llmessage/llcircuit.h +++ b/linden/indra/llmessage/llcircuit.h | |||
@@ -151,7 +151,7 @@ public: | |||
151 | // | 151 | // |
152 | void checkPeriodTime(); // Reset per-period counters if necessary. | 152 | void checkPeriodTime(); // Reset per-period counters if necessary. |
153 | friend std::ostream& operator<<(std::ostream& s, LLCircuitData &circuit); | 153 | friend std::ostream& operator<<(std::ostream& s, LLCircuitData &circuit); |
154 | const char* getInfoString() const; | 154 | const LLString getInfoString() const; |
155 | 155 | ||
156 | friend class LLCircuit; | 156 | friend class LLCircuit; |
157 | friend class LLMessageSystem; | 157 | friend class LLMessageSystem; |
@@ -297,7 +297,7 @@ public: | |||
297 | void sendAcks(); | 297 | void sendAcks(); |
298 | 298 | ||
299 | friend std::ostream& operator<<(std::ostream& s, LLCircuit &circuit); | 299 | friend std::ostream& operator<<(std::ostream& s, LLCircuit &circuit); |
300 | const char* getInfoString() const; | 300 | const LLString getInfoString() const; |
301 | 301 | ||
302 | void dumpResends(); | 302 | void dumpResends(); |
303 | 303 | ||
diff --git a/linden/indra/llmessage/lldatapacker.cpp b/linden/indra/llmessage/lldatapacker.cpp index 2448c40..3cdaa25 100644 --- a/linden/indra/llmessage/lldatapacker.cpp +++ b/linden/indra/llmessage/lldatapacker.cpp | |||
@@ -972,11 +972,11 @@ BOOL LLDataPackerAsciiBuffer::packF32(const F32 value, const char *name) | |||
972 | int numCopied = 0; | 972 | int numCopied = 0; |
973 | if (mWriteEnabled) | 973 | if (mWriteEnabled) |
974 | { | 974 | { |
975 | numCopied = snprintf(mCurBufferp,getBufferSize()-getCurrentSize(),"%g\n", value); /* Flawfinder: ignore */ | 975 | numCopied = snprintf(mCurBufferp,getBufferSize()-getCurrentSize(),"%f\n", value); /* Flawfinder: ignore */ |
976 | } | 976 | } |
977 | else | 977 | else |
978 | { | 978 | { |
979 | numCopied = snprintf(DUMMY_BUFFER, sizeof(DUMMY_BUFFER), "%g\n", value); /* Flawfinder: ignore */ | 979 | numCopied = snprintf(DUMMY_BUFFER, sizeof(DUMMY_BUFFER), "%f\n", value); /* Flawfinder: ignore */ |
980 | } | 980 | } |
981 | // snprintf returns number of bytes that would have been written | 981 | // snprintf returns number of bytes that would have been written |
982 | // had the output not being truncated. In that case, it will | 982 | // had the output not being truncated. In that case, it will |
@@ -1004,7 +1004,7 @@ BOOL LLDataPackerAsciiBuffer::unpackF32(F32 &value, const char *name) | |||
1004 | return FALSE; | 1004 | return FALSE; |
1005 | } | 1005 | } |
1006 | 1006 | ||
1007 | sscanf(valuestr,"%g", &value); | 1007 | sscanf(valuestr,"%f", &value); |
1008 | return success; | 1008 | return success; |
1009 | } | 1009 | } |
1010 | 1010 | ||
@@ -1016,11 +1016,11 @@ BOOL LLDataPackerAsciiBuffer::packColor4(const LLColor4 &value, const char *name | |||
1016 | int numCopied = 0; | 1016 | int numCopied = 0; |
1017 | if (mWriteEnabled) | 1017 | if (mWriteEnabled) |
1018 | { | 1018 | { |
1019 | numCopied = snprintf(mCurBufferp,getBufferSize()-getCurrentSize(),"%g %g %g %g\n", value.mV[0], value.mV[1], value.mV[2], value.mV[3]); /* Flawfinder: ignore */ | 1019 | numCopied = snprintf(mCurBufferp,getBufferSize()-getCurrentSize(),"%f %f %f %f\n", value.mV[0], value.mV[1], value.mV[2], value.mV[3]); /* Flawfinder: ignore */ |
1020 | } | 1020 | } |
1021 | else | 1021 | else |
1022 | { | 1022 | { |
1023 | numCopied = snprintf(DUMMY_BUFFER,sizeof(DUMMY_BUFFER),"%g %g %g %g\n", value.mV[0], value.mV[1], value.mV[2], value.mV[3]); /* Flawfinder: ignore */ | 1023 | numCopied = snprintf(DUMMY_BUFFER,sizeof(DUMMY_BUFFER),"%f %f %f %f\n", value.mV[0], value.mV[1], value.mV[2], value.mV[3]); /* Flawfinder: ignore */ |
1024 | } | 1024 | } |
1025 | // snprintf returns number of bytes that would have been written | 1025 | // snprintf returns number of bytes that would have been written |
1026 | // had the output not being truncated. In that case, it will | 1026 | // had the output not being truncated. In that case, it will |
@@ -1048,7 +1048,7 @@ BOOL LLDataPackerAsciiBuffer::unpackColor4(LLColor4 &value, const char *name) | |||
1048 | return FALSE; | 1048 | return FALSE; |
1049 | } | 1049 | } |
1050 | 1050 | ||
1051 | sscanf(valuestr,"%g %g %g %g", &value.mV[0], &value.mV[1], &value.mV[2], &value.mV[3]); | 1051 | sscanf(valuestr,"%f %f %f %f", &value.mV[0], &value.mV[1], &value.mV[2], &value.mV[3]); |
1052 | return success; | 1052 | return success; |
1053 | } | 1053 | } |
1054 | 1054 | ||
@@ -1109,11 +1109,11 @@ BOOL LLDataPackerAsciiBuffer::packVector2(const LLVector2 &value, const char *na | |||
1109 | int numCopied = 0; | 1109 | int numCopied = 0; |
1110 | if (mWriteEnabled) | 1110 | if (mWriteEnabled) |
1111 | { | 1111 | { |
1112 | numCopied = snprintf(mCurBufferp,getBufferSize()-getCurrentSize(),"%g %g\n", value.mV[0], value.mV[1]); /* Flawfinder: ignore */ | 1112 | numCopied = snprintf(mCurBufferp,getBufferSize()-getCurrentSize(),"%f %f\n", value.mV[0], value.mV[1]); /* Flawfinder: ignore */ |
1113 | } | 1113 | } |
1114 | else | 1114 | else |
1115 | { | 1115 | { |
1116 | numCopied = snprintf(DUMMY_BUFFER,sizeof(DUMMY_BUFFER),"%g %g\n", value.mV[0], value.mV[1]); /* Flawfinder: ignore */ | 1116 | numCopied = snprintf(DUMMY_BUFFER,sizeof(DUMMY_BUFFER),"%f %f\n", value.mV[0], value.mV[1]); /* Flawfinder: ignore */ |
1117 | } | 1117 | } |
1118 | // snprintf returns number of bytes that would have been written | 1118 | // snprintf returns number of bytes that would have been written |
1119 | // had the output not being truncated. In that case, it will | 1119 | // had the output not being truncated. In that case, it will |
@@ -1141,7 +1141,7 @@ BOOL LLDataPackerAsciiBuffer::unpackVector2(LLVector2 &value, const char *name) | |||
1141 | return FALSE; | 1141 | return FALSE; |
1142 | } | 1142 | } |
1143 | 1143 | ||
1144 | sscanf(valuestr,"%g %g", &value.mV[0], &value.mV[1]); | 1144 | sscanf(valuestr,"%f %f", &value.mV[0], &value.mV[1]); |
1145 | return success; | 1145 | return success; |
1146 | } | 1146 | } |
1147 | 1147 | ||
@@ -1153,11 +1153,11 @@ BOOL LLDataPackerAsciiBuffer::packVector3(const LLVector3 &value, const char *na | |||
1153 | int numCopied = 0; | 1153 | int numCopied = 0; |
1154 | if (mWriteEnabled) | 1154 | if (mWriteEnabled) |
1155 | { | 1155 | { |
1156 | numCopied = snprintf(mCurBufferp,getBufferSize()-getCurrentSize(),"%g %g %g\n", value.mV[0], value.mV[1], value.mV[2]); /* Flawfinder: ignore */ | 1156 | numCopied = snprintf(mCurBufferp,getBufferSize()-getCurrentSize(),"%f %f %f\n", value.mV[0], value.mV[1], value.mV[2]); /* Flawfinder: ignore */ |
1157 | } | 1157 | } |
1158 | else | 1158 | else |
1159 | { | 1159 | { |
1160 | numCopied = snprintf(DUMMY_BUFFER,sizeof(DUMMY_BUFFER),"%g %g %g\n", value.mV[0], value.mV[1], value.mV[2]); /* Flawfinder: ignore */ | 1160 | numCopied = snprintf(DUMMY_BUFFER,sizeof(DUMMY_BUFFER),"%f %f %f\n", value.mV[0], value.mV[1], value.mV[2]); /* Flawfinder: ignore */ |
1161 | } | 1161 | } |
1162 | // snprintf returns number of bytes that would have been written | 1162 | // snprintf returns number of bytes that would have been written |
1163 | // had the output not being truncated. In that case, it will | 1163 | // had the output not being truncated. In that case, it will |
@@ -1185,7 +1185,7 @@ BOOL LLDataPackerAsciiBuffer::unpackVector3(LLVector3 &value, const char *name) | |||
1185 | return FALSE; | 1185 | return FALSE; |
1186 | } | 1186 | } |
1187 | 1187 | ||
1188 | sscanf(valuestr,"%g %g %g", &value.mV[0], &value.mV[1], &value.mV[2]); | 1188 | sscanf(valuestr,"%f %f %f", &value.mV[0], &value.mV[1], &value.mV[2]); |
1189 | return success; | 1189 | return success; |
1190 | } | 1190 | } |
1191 | 1191 | ||
@@ -1196,11 +1196,11 @@ BOOL LLDataPackerAsciiBuffer::packVector4(const LLVector4 &value, const char *na | |||
1196 | int numCopied = 0; | 1196 | int numCopied = 0; |
1197 | if (mWriteEnabled) | 1197 | if (mWriteEnabled) |
1198 | { | 1198 | { |
1199 | numCopied = snprintf(mCurBufferp,getBufferSize()-getCurrentSize(),"%g %g %g %g\n", value.mV[0], value.mV[1], value.mV[2], value.mV[3]); /* Flawfinder: ignore */ | 1199 | numCopied = snprintf(mCurBufferp,getBufferSize()-getCurrentSize(),"%f %f %f %f\n", value.mV[0], value.mV[1], value.mV[2], value.mV[3]); /* Flawfinder: ignore */ |
1200 | } | 1200 | } |
1201 | else | 1201 | else |
1202 | { | 1202 | { |
1203 | numCopied = snprintf(DUMMY_BUFFER,sizeof(DUMMY_BUFFER),"%g %g %g %g\n", value.mV[0], value.mV[1], value.mV[2], value.mV[3]); /* Flawfinder: ignore */ | 1203 | numCopied = snprintf(DUMMY_BUFFER,sizeof(DUMMY_BUFFER),"%f %f %f %f\n", value.mV[0], value.mV[1], value.mV[2], value.mV[3]); /* Flawfinder: ignore */ |
1204 | } | 1204 | } |
1205 | // snprintf returns number of bytes that would have been written | 1205 | // snprintf returns number of bytes that would have been written |
1206 | // had the output not being truncated. In that case, it will | 1206 | // had the output not being truncated. In that case, it will |
@@ -1228,7 +1228,7 @@ BOOL LLDataPackerAsciiBuffer::unpackVector4(LLVector4 &value, const char *name) | |||
1228 | return FALSE; | 1228 | return FALSE; |
1229 | } | 1229 | } |
1230 | 1230 | ||
1231 | sscanf(valuestr,"%g %g %g %g", &value.mV[0], &value.mV[1], &value.mV[2], &value.mV[3]); | 1231 | sscanf(valuestr,"%f %f %f %f", &value.mV[0], &value.mV[1], &value.mV[2], &value.mV[3]); |
1232 | return success; | 1232 | return success; |
1233 | } | 1233 | } |
1234 | 1234 | ||
@@ -1359,6 +1359,19 @@ BOOL LLDataPackerAsciiBuffer::getValueStr(const char *name, char *out_value, S32 | |||
1359 | return success; | 1359 | return success; |
1360 | } | 1360 | } |
1361 | 1361 | ||
1362 | // helper function used by LLDataPackerAsciiFile | ||
1363 | // to convert F32 into a string. This is to avoid | ||
1364 | // << operator writing F32 value into a stream | ||
1365 | // since it does not seem to preserve the float value | ||
1366 | std::string convertF32ToString(F32 val) | ||
1367 | { | ||
1368 | std::string str; | ||
1369 | char buf[20]; | ||
1370 | snprintf(buf, 20, "%f", val); | ||
1371 | str = buf; | ||
1372 | return str; | ||
1373 | } | ||
1374 | |||
1362 | //--------------------------------------------------------------------------- | 1375 | //--------------------------------------------------------------------------- |
1363 | // LLDataPackerAsciiFile implementation | 1376 | // LLDataPackerAsciiFile implementation |
1364 | //--------------------------------------------------------------------------- | 1377 | //--------------------------------------------------------------------------- |
@@ -1633,11 +1646,11 @@ BOOL LLDataPackerAsciiFile::packF32(const F32 value, const char *name) | |||
1633 | writeIndentedName(name); | 1646 | writeIndentedName(name); |
1634 | if (mFP) | 1647 | if (mFP) |
1635 | { | 1648 | { |
1636 | fprintf(mFP,"%g\n", value); | 1649 | fprintf(mFP,"%f\n", value); |
1637 | } | 1650 | } |
1638 | else if (mOutputStream) | 1651 | else if (mOutputStream) |
1639 | { | 1652 | { |
1640 | *mOutputStream <<"" << value << "\n"; | 1653 | *mOutputStream <<"" << convertF32ToString(value) << "\n"; |
1641 | } | 1654 | } |
1642 | return success; | 1655 | return success; |
1643 | } | 1656 | } |
@@ -1652,7 +1665,7 @@ BOOL LLDataPackerAsciiFile::unpackF32(F32 &value, const char *name) | |||
1652 | return FALSE; | 1665 | return FALSE; |
1653 | } | 1666 | } |
1654 | 1667 | ||
1655 | sscanf(valuestr,"%g", &value); | 1668 | sscanf(valuestr,"%f", &value); |
1656 | return success; | 1669 | return success; |
1657 | } | 1670 | } |
1658 | 1671 | ||
@@ -1663,11 +1676,11 @@ BOOL LLDataPackerAsciiFile::packColor4(const LLColor4 &value, const char *name) | |||
1663 | writeIndentedName(name); | 1676 | writeIndentedName(name); |
1664 | if (mFP) | 1677 | if (mFP) |
1665 | { | 1678 | { |
1666 | fprintf(mFP,"%g %g %g %g\n", value.mV[0], value.mV[1], value.mV[2], value.mV[3]); | 1679 | fprintf(mFP,"%f %f %f %f\n", value.mV[0], value.mV[1], value.mV[2], value.mV[3]); |
1667 | } | 1680 | } |
1668 | else if (mOutputStream) | 1681 | else if (mOutputStream) |
1669 | { | 1682 | { |
1670 | *mOutputStream << value.mV[0] << " " << value.mV[1] << " " << value.mV[2] << " " << value.mV[3] << "\n"; | 1683 | *mOutputStream << convertF32ToString(value.mV[0]) << " " << convertF32ToString(value.mV[1]) << " " << convertF32ToString(value.mV[2]) << " " << convertF32ToString(value.mV[3]) << "\n"; |
1671 | } | 1684 | } |
1672 | return success; | 1685 | return success; |
1673 | } | 1686 | } |
@@ -1682,7 +1695,7 @@ BOOL LLDataPackerAsciiFile::unpackColor4(LLColor4 &value, const char *name) | |||
1682 | return FALSE; | 1695 | return FALSE; |
1683 | } | 1696 | } |
1684 | 1697 | ||
1685 | sscanf(valuestr,"%g %g %g %g", &value.mV[0], &value.mV[1], &value.mV[2], &value.mV[3]); | 1698 | sscanf(valuestr,"%f %f %f %f", &value.mV[0], &value.mV[1], &value.mV[2], &value.mV[3]); |
1686 | return success; | 1699 | return success; |
1687 | } | 1700 | } |
1688 | 1701 | ||
@@ -1728,11 +1741,11 @@ BOOL LLDataPackerAsciiFile::packVector2(const LLVector2 &value, const char *name | |||
1728 | writeIndentedName(name); | 1741 | writeIndentedName(name); |
1729 | if (mFP) | 1742 | if (mFP) |
1730 | { | 1743 | { |
1731 | fprintf(mFP,"%g %g\n", value.mV[0], value.mV[1]); | 1744 | fprintf(mFP,"%f %f\n", value.mV[0], value.mV[1]); |
1732 | } | 1745 | } |
1733 | else if (mOutputStream) | 1746 | else if (mOutputStream) |
1734 | { | 1747 | { |
1735 | *mOutputStream << value.mV[0] << " " << value.mV[1] << "\n"; | 1748 | *mOutputStream << convertF32ToString(value.mV[0]) << " " << convertF32ToString(value.mV[1]) << "\n"; |
1736 | } | 1749 | } |
1737 | return success; | 1750 | return success; |
1738 | } | 1751 | } |
@@ -1747,7 +1760,7 @@ BOOL LLDataPackerAsciiFile::unpackVector2(LLVector2 &value, const char *name) | |||
1747 | return FALSE; | 1760 | return FALSE; |
1748 | } | 1761 | } |
1749 | 1762 | ||
1750 | sscanf(valuestr,"%g %g", &value.mV[0], &value.mV[1]); | 1763 | sscanf(valuestr,"%f %f", &value.mV[0], &value.mV[1]); |
1751 | return success; | 1764 | return success; |
1752 | } | 1765 | } |
1753 | 1766 | ||
@@ -1758,11 +1771,11 @@ BOOL LLDataPackerAsciiFile::packVector3(const LLVector3 &value, const char *name | |||
1758 | writeIndentedName(name); | 1771 | writeIndentedName(name); |
1759 | if (mFP) | 1772 | if (mFP) |
1760 | { | 1773 | { |
1761 | fprintf(mFP,"%g %g %g\n", value.mV[0], value.mV[1], value.mV[2]); | 1774 | fprintf(mFP,"%f %f %f\n", value.mV[0], value.mV[1], value.mV[2]); |
1762 | } | 1775 | } |
1763 | else if (mOutputStream) | 1776 | else if (mOutputStream) |
1764 | { | 1777 | { |
1765 | *mOutputStream << value.mV[0] << " " << value.mV[1] << " " << value.mV[2] << "\n"; | 1778 | *mOutputStream << convertF32ToString(value.mV[0]) << " " << convertF32ToString(value.mV[1]) << " " << convertF32ToString(value.mV[2]) << "\n"; |
1766 | } | 1779 | } |
1767 | return success; | 1780 | return success; |
1768 | } | 1781 | } |
@@ -1777,7 +1790,7 @@ BOOL LLDataPackerAsciiFile::unpackVector3(LLVector3 &value, const char *name) | |||
1777 | return FALSE; | 1790 | return FALSE; |
1778 | } | 1791 | } |
1779 | 1792 | ||
1780 | sscanf(valuestr,"%g %g %g", &value.mV[0], &value.mV[1], &value.mV[2]); | 1793 | sscanf(valuestr,"%f %f %f", &value.mV[0], &value.mV[1], &value.mV[2]); |
1781 | return success; | 1794 | return success; |
1782 | } | 1795 | } |
1783 | 1796 | ||
@@ -1787,11 +1800,11 @@ BOOL LLDataPackerAsciiFile::packVector4(const LLVector4 &value, const char *name | |||
1787 | writeIndentedName(name); | 1800 | writeIndentedName(name); |
1788 | if (mFP) | 1801 | if (mFP) |
1789 | { | 1802 | { |
1790 | fprintf(mFP,"%g %g %g %g\n", value.mV[0], value.mV[1], value.mV[2], value.mV[3]); | 1803 | fprintf(mFP,"%f %f %f %f\n", value.mV[0], value.mV[1], value.mV[2], value.mV[3]); |
1791 | } | 1804 | } |
1792 | else if (mOutputStream) | 1805 | else if (mOutputStream) |
1793 | { | 1806 | { |
1794 | *mOutputStream << value.mV[0] << " " << value.mV[1] << " " << value.mV[2] << " " << value.mV[3] << "\n"; | 1807 | *mOutputStream << convertF32ToString(value.mV[0]) << " " << convertF32ToString(value.mV[1]) << " " << convertF32ToString(value.mV[2]) << " " << convertF32ToString(value.mV[3]) << "\n"; |
1795 | } | 1808 | } |
1796 | return success; | 1809 | return success; |
1797 | } | 1810 | } |
@@ -1806,7 +1819,7 @@ BOOL LLDataPackerAsciiFile::unpackVector4(LLVector4 &value, const char *name) | |||
1806 | return FALSE; | 1819 | return FALSE; |
1807 | } | 1820 | } |
1808 | 1821 | ||
1809 | sscanf(valuestr,"%g %g %g %g", &value.mV[0], &value.mV[1], &value.mV[2], &value.mV[3]); | 1822 | sscanf(valuestr,"%f %f %f %f", &value.mV[0], &value.mV[1], &value.mV[2], &value.mV[3]); |
1810 | return success; | 1823 | return success; |
1811 | } | 1824 | } |
1812 | 1825 | ||
@@ -1848,7 +1861,8 @@ BOOL LLDataPackerAsciiFile::unpackUUID(LLUUID &value, const char *name) | |||
1848 | 1861 | ||
1849 | void LLDataPackerAsciiFile::writeIndentedName(const char *name) | 1862 | void LLDataPackerAsciiFile::writeIndentedName(const char *name) |
1850 | { | 1863 | { |
1851 | char indent_buf[64]; /*Flawfinder: ignore*/ | 1864 | std::string indent_buf; |
1865 | indent_buf.reserve(mIndent+1); | ||
1852 | 1866 | ||
1853 | S32 i; | 1867 | S32 i; |
1854 | for(i = 0; i < mIndent; i++) | 1868 | for(i = 0; i < mIndent; i++) |
@@ -1858,11 +1872,11 @@ void LLDataPackerAsciiFile::writeIndentedName(const char *name) | |||
1858 | indent_buf[i] = 0; | 1872 | indent_buf[i] = 0; |
1859 | if (mFP) | 1873 | if (mFP) |
1860 | { | 1874 | { |
1861 | fprintf(mFP,"%s%s\t",indent_buf, name); | 1875 | fprintf(mFP,"%s%s\t",indent_buf.c_str(), name); |
1862 | } | 1876 | } |
1863 | else if (mOutputStream) | 1877 | else if (mOutputStream) |
1864 | { | 1878 | { |
1865 | *mOutputStream << indent_buf << name << "\t"; | 1879 | *mOutputStream << indent_buf.c_str() << name << "\t"; |
1866 | } | 1880 | } |
1867 | } | 1881 | } |
1868 | 1882 | ||
diff --git a/linden/indra/llmessage/llhttpassetstorage.cpp b/linden/indra/llmessage/llhttpassetstorage.cpp index 8e328ce..5a0cdad 100644 --- a/linden/indra/llmessage/llhttpassetstorage.cpp +++ b/linden/indra/llmessage/llhttpassetstorage.cpp | |||
@@ -34,6 +34,7 @@ | |||
34 | #include <sys/stat.h> | 34 | #include <sys/stat.h> |
35 | 35 | ||
36 | #include "indra_constants.h" | 36 | #include "indra_constants.h" |
37 | #include "message.h" | ||
37 | #include "llvfile.h" | 38 | #include "llvfile.h" |
38 | #include "llvfs.h" | 39 | #include "llvfs.h" |
39 | 40 | ||
@@ -517,6 +518,8 @@ void LLHTTPAssetStorage::storeAssetData( | |||
517 | callback(LLUUID::null, user_data, LL_ERR_CANNOT_OPEN_FILE); | 518 | callback(LLUUID::null, user_data, LL_ERR_CANNOT_OPEN_FILE); |
518 | } | 519 | } |
519 | } | 520 | } |
521 | // Coverity CID-269 says there's a leak of 'legacy' here, but | ||
522 | // legacyStoreDataCallback() will delete it somewhere down the line. | ||
520 | } | 523 | } |
521 | 524 | ||
522 | // virtual | 525 | // virtual |
@@ -937,9 +940,45 @@ void LLHTTPAssetStorage::checkForTimeouts() | |||
937 | } while (curl_msg && queue_length > 0); | 940 | } while (curl_msg && queue_length > 0); |
938 | 941 | ||
939 | 942 | ||
943 | // Cleanup | ||
944 | // We want to bump to the back of the line any running uploads that have timed out. | ||
945 | bumpTimedOutUploads(); | ||
946 | |||
940 | LLAssetStorage::checkForTimeouts(); | 947 | LLAssetStorage::checkForTimeouts(); |
941 | } | 948 | } |
942 | 949 | ||
950 | void LLHTTPAssetStorage::bumpTimedOutUploads() | ||
951 | { | ||
952 | // No point bumping currently running uploads if there are no others in line. | ||
953 | if (!(mPendingUploads.size() > mRunningUploads.size())) | ||
954 | { | ||
955 | return; | ||
956 | } | ||
957 | |||
958 | F64 mt_secs = LLMessageSystem::getMessageTimeSeconds(); | ||
959 | |||
960 | // deletePendingRequest will modify the mRunningUploads list so we don't want to iterate over it. | ||
961 | request_list_t temp_running = mRunningUploads; | ||
962 | |||
963 | request_list_t::iterator it = temp_running.begin(); | ||
964 | request_list_t::iterator end = temp_running.end(); | ||
965 | for ( ; it != end; ++it) | ||
966 | { | ||
967 | //request_list_t::iterator curiter = iter++; | ||
968 | LLAssetRequest* req = *it; | ||
969 | |||
970 | if ( LL_ASSET_STORAGE_TIMEOUT < (mt_secs - req->mTime) ) | ||
971 | { | ||
972 | llwarns << "Asset upload request timed out for " | ||
973 | << req->getUUID() << "." | ||
974 | << LLAssetType::lookup(req->getType()) | ||
975 | << ", bumping to the back of the line!" << llendl; | ||
976 | |||
977 | deletePendingRequest(RT_UPLOAD, req->getType(), req->getUUID()); | ||
978 | } | ||
979 | } | ||
980 | } | ||
981 | |||
943 | // static | 982 | // static |
944 | size_t LLHTTPAssetStorage::curlDownCallback(void *data, size_t size, size_t nmemb, void *user_data) | 983 | size_t LLHTTPAssetStorage::curlDownCallback(void *data, size_t size, size_t nmemb, void *user_data) |
945 | { | 984 | { |
diff --git a/linden/indra/llmessage/llhttpassetstorage.h b/linden/indra/llmessage/llhttpassetstorage.h index b5ab56b..2977301 100644 --- a/linden/indra/llmessage/llhttpassetstorage.h +++ b/linden/indra/llmessage/llhttpassetstorage.h | |||
@@ -133,6 +133,10 @@ private: | |||
133 | // This will return the correct base URI for any http asset request | 133 | // This will return the correct base URI for any http asset request |
134 | std::string getBaseURL(const LLUUID& asset_id, LLAssetType::EType asset_type); | 134 | std::string getBaseURL(const LLUUID& asset_id, LLAssetType::EType asset_type); |
135 | 135 | ||
136 | // Check for running uploads that have timed out | ||
137 | // Bump these to the back of the line to let other uploads complete. | ||
138 | void bumpTimedOutUploads(); | ||
139 | |||
136 | protected: | 140 | protected: |
137 | std::string mBaseURL; | 141 | std::string mBaseURL; |
138 | std::string mLocalBaseURL; | 142 | std::string mLocalBaseURL; |
diff --git a/linden/indra/llmessage/llhttpclient.cpp b/linden/indra/llmessage/llhttpclient.cpp index 1d38a13..8cb8344 100644 --- a/linden/indra/llmessage/llhttpclient.cpp +++ b/linden/indra/llmessage/llhttpclient.cpp | |||
@@ -37,6 +37,7 @@ | |||
37 | #include "llsdserialize.h" | 37 | #include "llsdserialize.h" |
38 | #include "llvfile.h" | 38 | #include "llvfile.h" |
39 | #include "llvfs.h" | 39 | #include "llvfs.h" |
40 | #include "lluri.h" | ||
40 | 41 | ||
41 | #include "message.h" | 42 | #include "message.h" |
42 | #include <curl/curl.h> | 43 | #include <curl/curl.h> |
@@ -283,6 +284,14 @@ void LLHTTPClient::get(const std::string& url, ResponderPtr responder, const F32 | |||
283 | request(url, LLURLRequest::HTTP_GET, NULL, responder, timeout); | 284 | request(url, LLURLRequest::HTTP_GET, NULL, responder, timeout); |
284 | } | 285 | } |
285 | 286 | ||
287 | void LLHTTPClient::get(const std::string& url, const LLSD& query, ResponderPtr responder, const F32 timeout) | ||
288 | { | ||
289 | LLURI uri; | ||
290 | |||
291 | uri = LLURI::buildHTTP(url, LLSD::emptyArray(), query); | ||
292 | get(uri.asString(), responder, timeout); | ||
293 | } | ||
294 | |||
286 | // A simple class for managing data returned from a curl http request. | 295 | // A simple class for managing data returned from a curl http request. |
287 | class LLHTTPBuffer | 296 | class LLHTTPBuffer |
288 | { | 297 | { |
diff --git a/linden/indra/llmessage/llhttpclient.h b/linden/indra/llmessage/llhttpclient.h index 136577c..c2dfb5d 100644 --- a/linden/indra/llmessage/llhttpclient.h +++ b/linden/indra/llmessage/llhttpclient.h | |||
@@ -73,6 +73,7 @@ public: | |||
73 | typedef boost::intrusive_ptr<Responder> ResponderPtr; | 73 | typedef boost::intrusive_ptr<Responder> ResponderPtr; |
74 | 74 | ||
75 | static void get(const std::string& url, ResponderPtr, const F32 timeout=HTTP_REQUEST_EXPIRY_SECS); | 75 | static void get(const std::string& url, ResponderPtr, const F32 timeout=HTTP_REQUEST_EXPIRY_SECS); |
76 | static void get(const std::string& url, const LLSD& query, ResponderPtr, const F32 timeout=HTTP_REQUEST_EXPIRY_SECS); | ||
76 | static void put(const std::string& url, const LLSD& body, ResponderPtr, const F32 timeout=HTTP_REQUEST_EXPIRY_SECS); | 77 | static void put(const std::string& url, const LLSD& body, ResponderPtr, const F32 timeout=HTTP_REQUEST_EXPIRY_SECS); |
77 | ///< non-blocking | 78 | ///< non-blocking |
78 | static void post(const std::string& url, const LLSD& body, ResponderPtr, const F32 timeout=HTTP_REQUEST_EXPIRY_SECS); | 79 | static void post(const std::string& url, const LLSD& body, ResponderPtr, const F32 timeout=HTTP_REQUEST_EXPIRY_SECS); |
diff --git a/linden/indra/llmessage/lliohttpserver.cpp b/linden/indra/llmessage/lliohttpserver.cpp index 9ea7272..d7fc54e 100644 --- a/linden/indra/llmessage/lliohttpserver.cpp +++ b/linden/indra/llmessage/lliohttpserver.cpp | |||
@@ -29,9 +29,8 @@ | |||
29 | */ | 29 | */ |
30 | 30 | ||
31 | #include "linden_common.h" | 31 | #include "linden_common.h" |
32 | #include "lliohttpserver.h" | ||
33 | 32 | ||
34 | #include "boost/tokenizer.hpp" | 33 | #include "lliohttpserver.h" |
35 | 34 | ||
36 | #include "llapr.h" | 35 | #include "llapr.h" |
37 | #include "llbuffer.h" | 36 | #include "llbuffer.h" |
@@ -46,9 +45,12 @@ | |||
46 | #include "llsd.h" | 45 | #include "llsd.h" |
47 | #include "llsdserialize_xml.h" | 46 | #include "llsdserialize_xml.h" |
48 | #include "llstl.h" | 47 | #include "llstl.h" |
48 | #include "lltimer.h" | ||
49 | 49 | ||
50 | #include <sstream> | 50 | #include <sstream> |
51 | 51 | ||
52 | #include "boost/tokenizer.hpp" | ||
53 | |||
52 | static const char HTTP_VERSION_STR[] = "HTTP/1.0"; | 54 | static const char HTTP_VERSION_STR[] = "HTTP/1.0"; |
53 | static const std::string CONTEXT_REQUEST("request"); | 55 | static const std::string CONTEXT_REQUEST("request"); |
54 | static const std::string HTTP_VERB_GET("GET"); | 56 | static const std::string HTTP_VERB_GET("GET"); |
@@ -56,6 +58,8 @@ static const std::string HTTP_VERB_PUT("PUT"); | |||
56 | static const std::string HTTP_VERB_POST("POST"); | 58 | static const std::string HTTP_VERB_POST("POST"); |
57 | static const std::string HTTP_VERB_DELETE("DELETE"); | 59 | static const std::string HTTP_VERB_DELETE("DELETE"); |
58 | 60 | ||
61 | static LLIOHTTPServer::timing_callback_t sTimingCallback = NULL; | ||
62 | static void* sTimingCallbackData = NULL; | ||
59 | 63 | ||
60 | class LLHTTPPipe : public LLIOPipe | 64 | class LLHTTPPipe : public LLIOPipe |
61 | { | 65 | { |
@@ -151,6 +155,12 @@ LLIOPipe::EStatus LLHTTPPipe::process_impl( | |||
151 | // TODO: Babbage: Parameterize parser? | 155 | // TODO: Babbage: Parameterize parser? |
152 | LLBufferStream istr(channels, buffer.get()); | 156 | LLBufferStream istr(channels, buffer.get()); |
153 | 157 | ||
158 | static LLTimer timer; | ||
159 | if (sTimingCallback) | ||
160 | { | ||
161 | timer.reset(); | ||
162 | } | ||
163 | |||
154 | std::string verb = context[CONTEXT_REQUEST]["verb"]; | 164 | std::string verb = context[CONTEXT_REQUEST]["verb"]; |
155 | if(verb == HTTP_VERB_GET) | 165 | if(verb == HTTP_VERB_GET) |
156 | { | 166 | { |
@@ -179,6 +189,18 @@ LLIOPipe::EStatus LLHTTPPipe::process_impl( | |||
179 | mResponse->methodNotAllowed(); | 189 | mResponse->methodNotAllowed(); |
180 | } | 190 | } |
181 | 191 | ||
192 | if (sTimingCallback) | ||
193 | { | ||
194 | LLHTTPNode::Description desc; | ||
195 | mNode.describe(desc); | ||
196 | LLSD info = desc.getInfo(); | ||
197 | std::string timing_name = info["description"]; | ||
198 | timing_name += " "; | ||
199 | timing_name += verb; | ||
200 | F32 delta = timer.getElapsedTimeF32(); | ||
201 | sTimingCallback(timing_name.c_str(), delta, sTimingCallbackData); | ||
202 | } | ||
203 | |||
182 | // Log Internal Server Errors | 204 | // Log Internal Server Errors |
183 | if(mStatusCode == 500) | 205 | if(mStatusCode == 500) |
184 | { | 206 | { |
@@ -819,9 +841,9 @@ LLIOPipe::EStatus LLHTTPResponder::process_impl( | |||
819 | } | 841 | } |
820 | 842 | ||
821 | 843 | ||
822 | 844 | // static | |
823 | void LLCreateHTTPPipe(LLPumpIO::chain_t& chain, | 845 | void LLIOHTTPServer::createPipe(LLPumpIO::chain_t& chain, |
824 | const LLHTTPNode& root, const LLSD& ctx) | 846 | const LLHTTPNode& root, const LLSD& ctx) |
825 | { | 847 | { |
826 | chain.push_back(LLIOPipe::ptr_t(new LLHTTPResponder(root, ctx))); | 848 | chain.push_back(LLIOPipe::ptr_t(new LLHTTPResponder(root, ctx))); |
827 | } | 849 | } |
@@ -832,7 +854,7 @@ class LLHTTPResponseFactory : public LLChainIOFactory | |||
832 | public: | 854 | public: |
833 | bool build(LLPumpIO::chain_t& chain, LLSD ctx) const | 855 | bool build(LLPumpIO::chain_t& chain, LLSD ctx) const |
834 | { | 856 | { |
835 | LLCreateHTTPPipe(chain, mTree, ctx); | 857 | LLIOHTTPServer::createPipe(chain, mTree, ctx); |
836 | return true; | 858 | return true; |
837 | } | 859 | } |
838 | 860 | ||
@@ -843,7 +865,8 @@ private: | |||
843 | }; | 865 | }; |
844 | 866 | ||
845 | 867 | ||
846 | LLHTTPNode& LLCreateHTTPServer( | 868 | // static |
869 | LLHTTPNode& LLIOHTTPServer::create( | ||
847 | apr_pool_t* pool, LLPumpIO& pump, U16 port) | 870 | apr_pool_t* pool, LLPumpIO& pump, U16 port) |
848 | { | 871 | { |
849 | LLSocket::ptr_t socket = LLSocket::create( | 872 | LLSocket::ptr_t socket = LLSocket::create( |
@@ -867,3 +890,10 @@ LLHTTPNode& LLCreateHTTPServer( | |||
867 | return factory->getRootNode(); | 890 | return factory->getRootNode(); |
868 | } | 891 | } |
869 | 892 | ||
893 | // static | ||
894 | void LLIOHTTPServer::setTimingCallback(timing_callback_t callback, | ||
895 | void* data) | ||
896 | { | ||
897 | sTimingCallback = callback; | ||
898 | sTimingCallbackData = data; | ||
899 | } | ||
diff --git a/linden/indra/llmessage/lliohttpserver.h b/linden/indra/llmessage/lliohttpserver.h index 64dce63..8a6c8d4 100644 --- a/linden/indra/llmessage/lliohttpserver.h +++ b/linden/indra/llmessage/lliohttpserver.h | |||
@@ -36,7 +36,12 @@ | |||
36 | 36 | ||
37 | class LLPumpIO; | 37 | class LLPumpIO; |
38 | 38 | ||
39 | LLHTTPNode& LLCreateHTTPServer(apr_pool_t* pool, LLPumpIO& pump, U16 port); | 39 | class LLIOHTTPServer |
40 | { | ||
41 | public: | ||
42 | typedef void (*timing_callback_t)(const char* hashed_name, F32 time, void* data); | ||
43 | |||
44 | static LLHTTPNode& create(apr_pool_t* pool, LLPumpIO& pump, U16 port); | ||
40 | /**< Creates an HTTP wire server on the pump for the given TCP port. | 45 | /**< Creates an HTTP wire server on the pump for the given TCP port. |
41 | * | 46 | * |
42 | * Returns the root node of the new server. Add LLHTTPNode instances | 47 | * Returns the root node of the new server. Add LLHTTPNode instances |
@@ -51,14 +56,23 @@ LLHTTPNode& LLCreateHTTPServer(apr_pool_t* pool, LLPumpIO& pump, U16 port); | |||
51 | * for example), use the helper templates below. | 56 | * for example), use the helper templates below. |
52 | */ | 57 | */ |
53 | 58 | ||
54 | void LLCreateHTTPPipe(LLPumpIO::chain_t& chain, | 59 | static void createPipe(LLPumpIO::chain_t& chain, |
55 | const LLHTTPNode& root, const LLSD& ctx); | 60 | const LLHTTPNode& root, const LLSD& ctx); |
56 | /**< Create a pipe on the chain that handles HTTP requests. | 61 | /**< Create a pipe on the chain that handles HTTP requests. |
57 | * The requests are served by the node tree given at root. | 62 | * The requests are served by the node tree given at root. |
58 | * | 63 | * |
59 | * This is primarily useful for unit testing. | 64 | * This is primarily useful for unit testing. |
60 | */ | 65 | */ |
61 | 66 | ||
67 | static void setTimingCallback(timing_callback_t callback, void* data); | ||
68 | /**< Register a callback function that will be called every time | ||
69 | * a GET, PUT, POST, or DELETE is handled. | ||
70 | * | ||
71 | * This is used to time the LLHTTPNode handler code, which often hits | ||
72 | * the database or does other, slow operations. JC | ||
73 | */ | ||
74 | }; | ||
75 | |||
62 | /* @name Helper Templates | 76 | /* @name Helper Templates |
63 | * | 77 | * |
64 | * These templates make it easy to create nodes that use thier own protocol | 78 | * These templates make it easy to create nodes that use thier own protocol |
diff --git a/linden/indra/llmessage/lliosocket.cpp b/linden/indra/llmessage/lliosocket.cpp index af22180..0ceb436 100644 --- a/linden/indra/llmessage/lliosocket.cpp +++ b/linden/indra/llmessage/lliosocket.cpp | |||
@@ -423,23 +423,35 @@ LLIOPipe::EStatus LLIOSocketWriter::process_impl( | |||
423 | bool done = false; | 423 | bool done = false; |
424 | while(it != end) | 424 | while(it != end) |
425 | { | 425 | { |
426 | |||
426 | PUMP_DEBUG; | 427 | PUMP_DEBUG; |
427 | if((*it).isOnChannel(channels.in())) | 428 | if((*it).isOnChannel(channels.in())) |
428 | { | 429 | { |
429 | PUMP_DEBUG; | 430 | PUMP_DEBUG; |
430 | // *FIX: check return code - sockets will fail (broken, etc.) | 431 | // *FIX: check return code - sockets will fail (broken, etc.) |
431 | len = (apr_size_t)segment.size(); | 432 | len = (apr_size_t)segment.size(); |
432 | apr_socket_send( | 433 | apr_status_t status = apr_socket_send( |
433 | mDestination->getSocket(), | 434 | mDestination->getSocket(), |
434 | (const char*)segment.data(), | 435 | (const char*)segment.data(), |
435 | &len); | 436 | &len); |
437 | // We sometimes get a 'non-blocking socket operation could not be | ||
438 | // completed immediately' error from apr_socket_send. In this | ||
439 | // case we break and the data will be sent the next time the chain | ||
440 | // is pumped. | ||
441 | #if LL_WINDOWS | ||
442 | if (status == 730035) | ||
443 | break; | ||
444 | #endif | ||
436 | mLastWritten = segment.data() + len - 1; | 445 | mLastWritten = segment.data() + len - 1; |
446 | |||
437 | PUMP_DEBUG; | 447 | PUMP_DEBUG; |
438 | if((S32)len < segment.size()) | 448 | if((S32)len < segment.size()) |
439 | { | 449 | { |
440 | break; | 450 | break; |
441 | } | 451 | } |
452 | |||
442 | } | 453 | } |
454 | |||
443 | ++it; | 455 | ++it; |
444 | if(it != end) | 456 | if(it != end) |
445 | { | 457 | { |
@@ -449,6 +461,7 @@ LLIOPipe::EStatus LLIOSocketWriter::process_impl( | |||
449 | { | 461 | { |
450 | done = true; | 462 | done = true; |
451 | } | 463 | } |
464 | |||
452 | } | 465 | } |
453 | PUMP_DEBUG; | 466 | PUMP_DEBUG; |
454 | if(done && eos) | 467 | if(done && eos) |
diff --git a/linden/indra/llmessage/llmail.cpp b/linden/indra/llmessage/llmail.cpp index 793cb19..633a2a3 100644 --- a/linden/indra/llmessage/llmail.cpp +++ b/linden/indra/llmessage/llmail.cpp | |||
@@ -64,7 +64,7 @@ static apr_sockaddr_t* gSockAddr; | |||
64 | static apr_socket_t* gMailSocket; | 64 | static apr_socket_t* gMailSocket; |
65 | 65 | ||
66 | // According to RFC2822 | 66 | // According to RFC2822 |
67 | static const boost::regex valid_subject_chars("[\\x1-\\x9\\xb\\xc\\xe-\\x7f]+"); | 67 | static const boost::regex valid_subject_chars("[\\x1-\\x9\\xb\\xc\\xe-\\x7f]*"); |
68 | bool connect_smtp(); | 68 | bool connect_smtp(); |
69 | void disconnect_smtp(); | 69 | void disconnect_smtp(); |
70 | 70 | ||
diff --git a/linden/indra/llmessage/llmessage.vcproj b/linden/indra/llmessage/llmessage.vcproj index ac16f52..d3e0d89 100644 --- a/linden/indra/llmessage/llmessage.vcproj +++ b/linden/indra/llmessage/llmessage.vcproj | |||
@@ -440,6 +440,9 @@ | |||
440 | RelativePath=".\llhttpsender.h"> | 440 | RelativePath=".\llhttpsender.h"> |
441 | </File> | 441 | </File> |
442 | <File | 442 | <File |
443 | RelativePath=".\llhttpnode.h"> | ||
444 | </File> | ||
445 | <File | ||
443 | RelativePath=".\llinstantmessage.h"> | 446 | RelativePath=".\llinstantmessage.h"> |
444 | </File> | 447 | </File> |
445 | <File | 448 | <File |
diff --git a/linden/indra/llmessage/llpacketbuffer.cpp b/linden/indra/llmessage/llpacketbuffer.cpp index 69144f5..525569d 100644 --- a/linden/indra/llmessage/llpacketbuffer.cpp +++ b/linden/indra/llmessage/llpacketbuffer.cpp | |||
@@ -42,11 +42,13 @@ LLPacketBuffer::LLPacketBuffer(const LLHost &host, const char *datap, const S32 | |||
42 | { | 42 | { |
43 | llerrs << "Sending packet > " << NET_BUFFER_SIZE << " of size " << size << llendl; | 43 | llerrs << "Sending packet > " << NET_BUFFER_SIZE << " of size " << size << llendl; |
44 | } | 44 | } |
45 | 45 | else // we previously relied on llerrs being fatal to not get here... | |
46 | if (datap != NULL) | ||
47 | { | 46 | { |
48 | memcpy(mData, datap, size); /*Flawfinder: ignore*/ | 47 | if (datap != NULL) |
49 | mSize = size; | 48 | { |
49 | memcpy(mData, datap, size); | ||
50 | mSize = size; | ||
51 | } | ||
50 | } | 52 | } |
51 | 53 | ||
52 | } | 54 | } |
diff --git a/linden/indra/llmessage/llregionflags.h b/linden/indra/llmessage/llregionflags.h index 6a23544..fb9bf5b 100644 --- a/linden/indra/llmessage/llregionflags.h +++ b/linden/indra/llmessage/llregionflags.h | |||
@@ -63,7 +63,7 @@ const U32 REGION_FLAGS_SKIP_COLLISIONS = (1 << 12); // Pin all non agent rigid | |||
63 | const U32 REGION_FLAGS_SKIP_SCRIPTS = (1 << 13); | 63 | const U32 REGION_FLAGS_SKIP_SCRIPTS = (1 << 13); |
64 | const U32 REGION_FLAGS_SKIP_PHYSICS = (1 << 14); // Skip all physics | 64 | const U32 REGION_FLAGS_SKIP_PHYSICS = (1 << 14); // Skip all physics |
65 | const U32 REGION_FLAGS_EXTERNALLY_VISIBLE = (1 << 15); | 65 | const U32 REGION_FLAGS_EXTERNALLY_VISIBLE = (1 << 15); |
66 | const U32 REGION_FLAGS_MAINLAND_VISIBLE = (1 << 16); | 66 | //const U32 REGION_FLAGS_MAINLAND_VISIBLE = (1 << 16); |
67 | const U32 REGION_FLAGS_PUBLIC_ALLOWED = (1 << 17); | 67 | const U32 REGION_FLAGS_PUBLIC_ALLOWED = (1 << 17); |
68 | const U32 REGION_FLAGS_BLOCK_DWELL = (1 << 18); | 68 | const U32 REGION_FLAGS_BLOCK_DWELL = (1 << 18); |
69 | 69 | ||
@@ -99,7 +99,6 @@ const U32 REGION_FLAGS_PRELUDE_UNSET = REGION_FLAGS_ALLOW_LANDMARK | |||
99 | | REGION_FLAGS_ALLOW_SET_HOME; | 99 | | REGION_FLAGS_ALLOW_SET_HOME; |
100 | 100 | ||
101 | const U32 REGION_FLAGS_ESTATE_MASK = REGION_FLAGS_EXTERNALLY_VISIBLE | 101 | const U32 REGION_FLAGS_ESTATE_MASK = REGION_FLAGS_EXTERNALLY_VISIBLE |
102 | | REGION_FLAGS_MAINLAND_VISIBLE | ||
103 | | REGION_FLAGS_PUBLIC_ALLOWED | 102 | | REGION_FLAGS_PUBLIC_ALLOWED |
104 | | REGION_FLAGS_SUN_FIXED | 103 | | REGION_FLAGS_SUN_FIXED |
105 | | REGION_FLAGS_DENY_ANONYMOUS | 104 | | REGION_FLAGS_DENY_ANONYMOUS |
diff --git a/linden/indra/llmessage/lltransfermanager.cpp b/linden/indra/llmessage/lltransfermanager.cpp index 12e1728..f42ce45 100644 --- a/linden/indra/llmessage/lltransfermanager.cpp +++ b/linden/indra/llmessage/lltransfermanager.cpp | |||
@@ -958,6 +958,7 @@ void LLTransferTargetChannel::requestTransfer( | |||
958 | if (!ttp) | 958 | if (!ttp) |
959 | { | 959 | { |
960 | llwarns << "LLTransferManager::requestTransfer aborting due to target creation failure!" << llendl; | 960 | llwarns << "LLTransferManager::requestTransfer aborting due to target creation failure!" << llendl; |
961 | return; | ||
961 | } | 962 | } |
962 | 963 | ||
963 | ttp->applyParams(target_params); | 964 | ttp->applyParams(target_params); |
diff --git a/linden/indra/llmessage/llurlrequest.cpp b/linden/indra/llmessage/llurlrequest.cpp index b3dfb52..1c7648b 100644 --- a/linden/indra/llmessage/llurlrequest.cpp +++ b/linden/indra/llmessage/llurlrequest.cpp | |||
@@ -544,7 +544,10 @@ size_t headerCallback(void* data, size_t size, size_t nmemb, void* user) | |||
544 | int statusCode = atoi(status.c_str()); | 544 | int statusCode = atoi(status.c_str()); |
545 | if (statusCode > 0) | 545 | if (statusCode > 0) |
546 | { | 546 | { |
547 | complete->httpStatus((U32)statusCode, reason); | 547 | if (complete) |
548 | { | ||
549 | complete->httpStatus((U32)statusCode, reason); | ||
550 | } | ||
548 | } | 551 | } |
549 | } | 552 | } |
550 | 553 | ||
diff --git a/linden/indra/llmessage/llxfer_file.cpp b/linden/indra/llmessage/llxfer_file.cpp index 297d163..33db248 100644 --- a/linden/indra/llmessage/llxfer_file.cpp +++ b/linden/indra/llmessage/llxfer_file.cpp | |||
@@ -82,7 +82,8 @@ void LLXfer_File::init (const LLString& local_filename, BOOL delete_local_on_com | |||
82 | 82 | ||
83 | if (!local_filename.empty()) | 83 | if (!local_filename.empty()) |
84 | { | 84 | { |
85 | strncpy(mLocalFilename, local_filename.c_str(), LL_MAX_PATH); /* Flawfinder : ignore */ | 85 | strncpy(mLocalFilename, local_filename.c_str(), LL_MAX_PATH-1); |
86 | mLocalFilename[LL_MAX_PATH-1] = '\0'; // stupid strncpy. | ||
86 | 87 | ||
87 | // You can only automatically delete .tmp file as a safeguard against nasty messages. | 88 | // You can only automatically delete .tmp file as a safeguard against nasty messages. |
88 | mDeleteLocalOnCompletion = (delete_local_on_completion && (strstr(mLocalFilename,".tmp") == &mLocalFilename[strlen(mLocalFilename)-4])); /* Flawfinder : ignore */ | 89 | mDeleteLocalOnCompletion = (delete_local_on_completion && (strstr(mLocalFilename,".tmp") == &mLocalFilename[strlen(mLocalFilename)-4])); /* Flawfinder : ignore */ |
@@ -117,19 +118,21 @@ void LLXfer_File::free () | |||
117 | /////////////////////////////////////////////////////////// | 118 | /////////////////////////////////////////////////////////// |
118 | 119 | ||
119 | S32 LLXfer_File::initializeRequest(U64 xfer_id, | 120 | S32 LLXfer_File::initializeRequest(U64 xfer_id, |
120 | const LLString& local_filename, | 121 | const LLString& local_filename, |
121 | const LLString& remote_filename, | 122 | const LLString& remote_filename, |
122 | ELLPath remote_path, | 123 | ELLPath remote_path, |
123 | const LLHost& remote_host, | 124 | const LLHost& remote_host, |
124 | BOOL delete_remote_on_completion, | 125 | BOOL delete_remote_on_completion, |
125 | void (*callback)(void**,S32), | 126 | void (*callback)(void**,S32), |
126 | void** user_data) | 127 | void** user_data) |
127 | { | 128 | { |
128 | S32 retval = 0; // presume success | 129 | S32 retval = 0; // presume success |
129 | 130 | ||
130 | mID = xfer_id; | 131 | mID = xfer_id; |
131 | strncpy(mLocalFilename, local_filename.c_str(), LL_MAX_PATH); /* Flawfinder : ignore */ | 132 | strncpy(mLocalFilename, local_filename.c_str(), LL_MAX_PATH-1); |
132 | strncpy(mRemoteFilename,remote_filename.c_str(), LL_MAX_PATH); /* Flawfinder : ignore */ | 133 | mLocalFilename[LL_MAX_PATH-1] = '\0'; // stupid strncpy. |
134 | strncpy(mRemoteFilename,remote_filename.c_str(), LL_MAX_PATH-1); | ||
135 | mRemoteFilename[LL_MAX_PATH-1] = '\0'; // stupid strncpy. | ||
133 | mRemotePath = remote_path; | 136 | mRemotePath = remote_path; |
134 | mRemoteHost = remote_host; | 137 | mRemoteHost = remote_host; |
135 | mDeleteRemoteOnCompletion = delete_remote_on_completion; | 138 | mDeleteRemoteOnCompletion = delete_remote_on_completion; |
diff --git a/linden/indra/llmessage/llxfer_mem.cpp b/linden/indra/llmessage/llxfer_mem.cpp index e9b4224..0f055c8 100644 --- a/linden/indra/llmessage/llxfer_mem.cpp +++ b/linden/indra/llmessage/llxfer_mem.cpp | |||
@@ -162,7 +162,8 @@ S32 LLXfer_Mem::initializeRequest(U64 xfer_id, | |||
162 | mCallbackDataHandle = user_data; | 162 | mCallbackDataHandle = user_data; |
163 | mCallbackResult = LL_ERR_NOERR; | 163 | mCallbackResult = LL_ERR_NOERR; |
164 | 164 | ||
165 | strncpy(mRemoteFilename, remote_filename.c_str(), LL_MAX_PATH); /* Flawfinder : ignore */ | 165 | strncpy(mRemoteFilename, remote_filename.c_str(), LL_MAX_PATH-1); |
166 | mRemoteFilename[LL_MAX_PATH-1] = '\0'; // stupid strncpy. | ||
166 | mRemotePath = remote_path; | 167 | mRemotePath = remote_path; |
167 | mDeleteRemoteOnCompletion = delete_remote_on_completion; | 168 | mDeleteRemoteOnCompletion = delete_remote_on_completion; |
168 | 169 | ||
diff --git a/linden/indra/llmessage/llxfermanager.cpp b/linden/indra/llmessage/llxfermanager.cpp index 914488e..7758a32 100644 --- a/linden/indra/llmessage/llxfermanager.cpp +++ b/linden/indra/llmessage/llxfermanager.cpp | |||
@@ -223,8 +223,8 @@ LLXfer *LLXferManager::findXfer (U64 id, LLXfer *list_head) | |||
223 | 223 | ||
224 | void LLXferManager::removeXfer (LLXfer *delp, LLXfer **list_head) | 224 | void LLXferManager::removeXfer (LLXfer *delp, LLXfer **list_head) |
225 | { | 225 | { |
226 | LLXfer *xferp; | 226 | // This function assumes that delp will only occur in the list |
227 | 227 | // zero or one times. | |
228 | if (delp) | 228 | if (delp) |
229 | { | 229 | { |
230 | if (*list_head == delp) | 230 | if (*list_head == delp) |
@@ -234,14 +234,14 @@ void LLXferManager::removeXfer (LLXfer *delp, LLXfer **list_head) | |||
234 | } | 234 | } |
235 | else | 235 | else |
236 | { | 236 | { |
237 | xferp = *list_head; | 237 | LLXfer *xferp = *list_head; |
238 | while (xferp->mNext) | 238 | while (xferp->mNext) |
239 | { | 239 | { |
240 | if (xferp->mNext == delp) | 240 | if (xferp->mNext == delp) |
241 | { | 241 | { |
242 | xferp->mNext = delp->mNext; | 242 | xferp->mNext = delp->mNext; |
243 | delete (delp); | 243 | delete (delp); |
244 | continue; | 244 | break; |
245 | } | 245 | } |
246 | xferp = xferp->mNext; | 246 | xferp = xferp->mNext; |
247 | } | 247 | } |
diff --git a/linden/indra/llmessage/message.cpp b/linden/indra/llmessage/message.cpp index ef22b63..29f232c 100644 --- a/linden/indra/llmessage/message.cpp +++ b/linden/indra/llmessage/message.cpp | |||
@@ -535,6 +535,8 @@ void LLMessageSystem::loadTemplateFile(const char* filename) | |||
535 | if(!filename) | 535 | if(!filename) |
536 | { | 536 | { |
537 | llerrs << "No template filename specified" << llendl; | 537 | llerrs << "No template filename specified" << llendl; |
538 | mbError = TRUE; | ||
539 | return; | ||
538 | } | 540 | } |
539 | 541 | ||
540 | char token[MAX_MESSAGE_INTERNAL_NAME_SIZE]; /* Flawfinder: ignore */ | 542 | char token[MAX_MESSAGE_INTERNAL_NAME_SIZE]; /* Flawfinder: ignore */ |
@@ -655,6 +657,13 @@ void LLMessageSystem::loadTemplateFile(const char* filename) | |||
655 | // add data! | 657 | // add data! |
656 | // we've gotten a complete variable! hooray! | 658 | // we've gotten a complete variable! hooray! |
657 | // add it! | 659 | // add it! |
660 | if (NULL == templatep) | ||
661 | { | ||
662 | llerrs << "Trying to addTemplate a NULL templatep during load." << llendl; | ||
663 | mbError = TRUE; | ||
664 | fclose(messagefilep); | ||
665 | return; | ||
666 | } | ||
658 | addTemplate(templatep); | 667 | addTemplate(templatep); |
659 | 668 | ||
660 | //llinfos << "Read template: "templatep->mNametemp_str | 669 | //llinfos << "Read template: "templatep->mNametemp_str |
@@ -672,7 +681,13 @@ void LLMessageSystem::loadTemplateFile(const char* filename) | |||
672 | // add data! | 681 | // add data! |
673 | // we've gotten a complete variable! hooray! | 682 | // we've gotten a complete variable! hooray! |
674 | // add it to template | 683 | // add it to template |
675 | 684 | if (NULL == templatep) | |
685 | { | ||
686 | llerrs << "Trying to addBlock to NULL templatep during load." << llendl; | ||
687 | mbError = TRUE; | ||
688 | fclose(messagefilep); | ||
689 | return; | ||
690 | } | ||
676 | templatep->addBlock(blockp); | 691 | templatep->addBlock(blockp); |
677 | 692 | ||
678 | // start working on it! | 693 | // start working on it! |
@@ -876,10 +891,24 @@ void LLMessageSystem::loadTemplateFile(const char* filename) | |||
876 | 891 | ||
877 | if (strcmp(token, "Trusted") == 0) | 892 | if (strcmp(token, "Trusted") == 0) |
878 | { | 893 | { |
894 | if (NULL == templatep) | ||
895 | { | ||
896 | llerrs << "Trying to setTrust for NULL templatep during load." << llendl; | ||
897 | mbError = TRUE; | ||
898 | fclose(messagefilep); | ||
899 | return; | ||
900 | } | ||
879 | templatep->setTrust(MT_TRUST); | 901 | templatep->setTrust(MT_TRUST); |
880 | } | 902 | } |
881 | else if (strcmp(token, "NotTrusted") == 0) | 903 | else if (strcmp(token, "NotTrusted") == 0) |
882 | { | 904 | { |
905 | if (NULL == templatep) | ||
906 | { | ||
907 | llerrs << "Trying to setTrust for NULL templatep during load." << llendl; | ||
908 | mbError = TRUE; | ||
909 | fclose(messagefilep); | ||
910 | return; | ||
911 | } | ||
883 | templatep->setTrust(MT_NOTRUST); | 912 | templatep->setTrust(MT_NOTRUST); |
884 | } | 913 | } |
885 | else | 914 | else |
@@ -912,10 +941,24 @@ void LLMessageSystem::loadTemplateFile(const char* filename) | |||
912 | 941 | ||
913 | if(0 == strcmp(token, "Unencoded")) | 942 | if(0 == strcmp(token, "Unencoded")) |
914 | { | 943 | { |
944 | if (NULL == templatep) | ||
945 | { | ||
946 | llerrs << "Trying to setEncoding for NULL templatep during load." << llendl; | ||
947 | mbError = TRUE; | ||
948 | fclose(messagefilep); | ||
949 | return; | ||
950 | } | ||
915 | templatep->setEncoding(ME_UNENCODED); | 951 | templatep->setEncoding(ME_UNENCODED); |
916 | } | 952 | } |
917 | else if(0 == strcmp(token, "Zerocoded")) | 953 | else if(0 == strcmp(token, "Zerocoded")) |
918 | { | 954 | { |
955 | if (NULL == templatep) | ||
956 | { | ||
957 | llerrs << "Trying to setEncoding for NULL templatep during load." << llendl; | ||
958 | mbError = TRUE; | ||
959 | fclose(messagefilep); | ||
960 | return; | ||
961 | } | ||
919 | templatep->setEncoding(ME_ZEROCODED); | 962 | templatep->setEncoding(ME_ZEROCODED); |
920 | } | 963 | } |
921 | else | 964 | else |
diff --git a/linden/indra/llprimitive/llprimitive.cpp b/linden/indra/llprimitive/llprimitive.cpp index e2cf7e3..9ab44f7 100644 --- a/linden/indra/llprimitive/llprimitive.cpp +++ b/linden/indra/llprimitive/llprimitive.cpp | |||
@@ -797,14 +797,14 @@ const char * LLPrimitive::pCodeToString(const LLPCode pcode) | |||
797 | { | 797 | { |
798 | snprintf(mask, sizeof(mask), "hemi"); /* Flawfinder: ignore */ | 798 | snprintf(mask, sizeof(mask), "hemi"); /* Flawfinder: ignore */ |
799 | } | 799 | } |
800 | else if (mask != 0) | 800 | else |
801 | { | 801 | { |
802 | snprintf(mask, sizeof(mask), "%x", mask_code); /* Flawfinder: ignore */ | 802 | snprintf(mask, sizeof(mask), "%x", mask_code); /* Flawfinder: ignore */ |
803 | } | 803 | } |
804 | else | 804 | |
805 | { | 805 | // extra sanity against snprintf() being naturally crap |
806 | mask[0] = 0; | 806 | mask[sizeof(mask)-1] = '\0'; |
807 | } | 807 | shape[sizeof(shape)-1] = '\0'; |
808 | 808 | ||
809 | if (mask[0]) | 809 | if (mask[0]) |
810 | { | 810 | { |
@@ -815,6 +815,11 @@ const char * LLPrimitive::pCodeToString(const LLPCode pcode) | |||
815 | snprintf(pcode_string, sizeof(pcode_string), "%s", shape); /* Flawfinder: ignore */ | 815 | snprintf(pcode_string, sizeof(pcode_string), "%s", shape); /* Flawfinder: ignore */ |
816 | } | 816 | } |
817 | } | 817 | } |
818 | |||
819 | // Be really sure that pcode_string is nul-terminated after we've | ||
820 | // been using crappy snprintf() to build it. | ||
821 | pcode_string[sizeof(pcode_string)-1] = '\0'; | ||
822 | |||
818 | return pcode_string; | 823 | return pcode_string; |
819 | } | 824 | } |
820 | 825 | ||
diff --git a/linden/indra/llrender/llfontgl.cpp b/linden/indra/llrender/llfontgl.cpp index 7ee89c7..23f02c2 100644 --- a/linden/indra/llrender/llfontgl.cpp +++ b/linden/indra/llrender/llfontgl.cpp | |||
@@ -70,7 +70,7 @@ const F32 PIXEL_BORDER_THRESHOLD = 0.0001f; | |||
70 | const F32 PIXEL_CORRECTION_DISTANCE = 0.01f; | 70 | const F32 PIXEL_CORRECTION_DISTANCE = 0.01f; |
71 | 71 | ||
72 | const F32 PAD_AMT = 0.5f; | 72 | const F32 PAD_AMT = 0.5f; |
73 | const F32 DROP_SHADOW_STRENGTH = 0.3f; | 73 | const F32 DROP_SHADOW_SOFT_STRENGTH = 0.3f; |
74 | 74 | ||
75 | F32 llfont_round_x(F32 x) | 75 | F32 llfont_round_x(F32 x) |
76 | { | 76 | { |
@@ -106,6 +106,14 @@ U8 LLFontGL::getStyleFromString(const LLString &style) | |||
106 | { | 106 | { |
107 | ret |= UNDERLINE; | 107 | ret |= UNDERLINE; |
108 | } | 108 | } |
109 | if (style.find("SHADOW") != style.npos) | ||
110 | { | ||
111 | ret |= DROP_SHADOW; | ||
112 | } | ||
113 | if (style.find("SOFT_SHADOW") != style.npos) | ||
114 | { | ||
115 | ret |= DROP_SHADOW_SOFT; | ||
116 | } | ||
109 | return ret; | 117 | return ret; |
110 | } | 118 | } |
111 | 119 | ||
@@ -571,14 +579,14 @@ S32 LLFontGL::render(const LLWString &wstr, | |||
571 | } | 579 | } |
572 | 580 | ||
573 | F32 drop_shadow_strength = 0.f; | 581 | F32 drop_shadow_strength = 0.f; |
574 | if (style & DROP_SHADOW) | 582 | if (style & (DROP_SHADOW | DROP_SHADOW_SOFT)) |
575 | { | 583 | { |
576 | F32 luminance; | 584 | F32 luminance; |
577 | color.calcHSL(NULL, NULL, &luminance); | 585 | color.calcHSL(NULL, NULL, &luminance); |
578 | drop_shadow_strength = clamp_rescale(luminance, 0.35f, 0.6f, 0.f, DROP_SHADOW_STRENGTH); | 586 | drop_shadow_strength = clamp_rescale(luminance, 0.35f, 0.6f, 0.f, 1.f); |
579 | if (luminance < 0.35f) | 587 | if (luminance < 0.35f) |
580 | { | 588 | { |
581 | style = style & ~DROP_SHADOW; | 589 | style = style & ~(DROP_SHADOW | DROP_SHADOW_SOFT); |
582 | } | 590 | } |
583 | } | 591 | } |
584 | 592 | ||
@@ -769,6 +777,7 @@ S32 LLFontGL::render(const LLWString &wstr, | |||
769 | if (!fgi) | 777 | if (!fgi) |
770 | { | 778 | { |
771 | llerrs << "Missing Glyph Info" << llendl; | 779 | llerrs << "Missing Glyph Info" << llendl; |
780 | break; | ||
772 | } | 781 | } |
773 | if ((start_x + scaled_max_pixels) < (cur_x + fgi->mXBearing + fgi->mWidth)) | 782 | if ((start_x + scaled_max_pixels) < (cur_x + fgi->mXBearing + fgi->mWidth)) |
774 | { | 783 | { |
@@ -1334,10 +1343,10 @@ void LLFontGL::drawGlyph(const LLRectf& screen_rect, const LLRectf& uv_rect, con | |||
1334 | renderQuad(screen_rect_offset, uv_rect, slant_offset); | 1343 | renderQuad(screen_rect_offset, uv_rect, slant_offset); |
1335 | } | 1344 | } |
1336 | } | 1345 | } |
1337 | else if (style & DROP_SHADOW) | 1346 | else if (style & DROP_SHADOW_SOFT) |
1338 | { | 1347 | { |
1339 | LLColor4 shadow_color = LLFontGL::sShadowColor; | 1348 | LLColor4 shadow_color = LLFontGL::sShadowColor; |
1340 | shadow_color.mV[VALPHA] = color.mV[VALPHA] * drop_shadow_strength; | 1349 | shadow_color.mV[VALPHA] = color.mV[VALPHA] * drop_shadow_strength * DROP_SHADOW_SOFT_STRENGTH; |
1341 | glColor4fv(shadow_color.mV); | 1350 | glColor4fv(shadow_color.mV); |
1342 | for (S32 pass = 0; pass < 5; pass++) | 1351 | for (S32 pass = 0; pass < 5; pass++) |
1343 | { | 1352 | { |
@@ -1367,6 +1376,17 @@ void LLFontGL::drawGlyph(const LLRectf& screen_rect, const LLRectf& uv_rect, con | |||
1367 | glColor4fv(color.mV); | 1376 | glColor4fv(color.mV); |
1368 | renderQuad(screen_rect, uv_rect, slant_offset); | 1377 | renderQuad(screen_rect, uv_rect, slant_offset); |
1369 | } | 1378 | } |
1379 | else if (style & DROP_SHADOW) | ||
1380 | { | ||
1381 | LLColor4 shadow_color = LLFontGL::sShadowColor; | ||
1382 | shadow_color.mV[VALPHA] = color.mV[VALPHA] * drop_shadow_strength; | ||
1383 | glColor4fv(shadow_color.mV); | ||
1384 | LLRectf screen_rect_shadow = screen_rect; | ||
1385 | screen_rect_shadow.translate(1.f, -1.f); | ||
1386 | renderQuad(screen_rect_shadow, uv_rect, slant_offset); | ||
1387 | glColor4fv(color.mV); | ||
1388 | renderQuad(screen_rect, uv_rect, slant_offset); | ||
1389 | } | ||
1370 | else // normal rendering | 1390 | else // normal rendering |
1371 | { | 1391 | { |
1372 | glColor4fv(color.mV); | 1392 | glColor4fv(color.mV); |
diff --git a/linden/indra/llrender/llfontgl.h b/linden/indra/llrender/llfontgl.h index 98a7a55..2cd62c6 100644 --- a/linden/indra/llrender/llfontgl.h +++ b/linden/indra/llrender/llfontgl.h | |||
@@ -65,7 +65,8 @@ public: | |||
65 | BOLD = 1, | 65 | BOLD = 1, |
66 | ITALIC = 2, | 66 | ITALIC = 2, |
67 | UNDERLINE = 4, | 67 | UNDERLINE = 4, |
68 | DROP_SHADOW = 8 | 68 | DROP_SHADOW = 8, |
69 | DROP_SHADOW_SOFT = 16 | ||
69 | }; | 70 | }; |
70 | 71 | ||
71 | // Takes a string with potentially several flags, i.e. "NORMAL|BOLD|ITALIC" | 72 | // Takes a string with potentially several flags, i.e. "NORMAL|BOLD|ITALIC" |
diff --git a/linden/indra/llrender/llimagegl.cpp b/linden/indra/llrender/llimagegl.cpp index 464507e..e2c4a59 100644 --- a/linden/indra/llrender/llimagegl.cpp +++ b/linden/indra/llrender/llimagegl.cpp | |||
@@ -129,19 +129,27 @@ void LLImageGL::bindExternalTexture(LLGLuint gl_name, S32 stage, LLGLenum bind_t | |||
129 | // static | 129 | // static |
130 | void LLImageGL::unbindTexture(S32 stage, LLGLenum bind_target) | 130 | void LLImageGL::unbindTexture(S32 stage, LLGLenum bind_target) |
131 | { | 131 | { |
132 | glActiveTextureARB(GL_TEXTURE0_ARB + stage); | 132 | // LLGLSLShader can return -1 |
133 | glClientActiveTextureARB(GL_TEXTURE0_ARB + stage); | 133 | if (stage >= 0) |
134 | glBindTexture(bind_target, 0); | 134 | { |
135 | sCurrentBoundTextures[stage] = 0; | 135 | glActiveTextureARB(GL_TEXTURE0_ARB + stage); |
136 | glClientActiveTextureARB(GL_TEXTURE0_ARB + stage); | ||
137 | glBindTexture(bind_target, 0); | ||
138 | sCurrentBoundTextures[stage] = 0; | ||
139 | } | ||
136 | } | 140 | } |
137 | 141 | ||
138 | // static (duplicated for speed and to avoid GL_TEXTURE_2D default argument which requires GL header dependency) | 142 | // static (duplicated for speed and to avoid GL_TEXTURE_2D default argument which requires GL header dependency) |
139 | void LLImageGL::unbindTexture(S32 stage) | 143 | void LLImageGL::unbindTexture(S32 stage) |
140 | { | 144 | { |
141 | glActiveTextureARB(GL_TEXTURE0_ARB + stage); | 145 | // LLGLSLShader can return -1 |
142 | glClientActiveTextureARB(GL_TEXTURE0_ARB + stage); | 146 | if (stage >= 0) |
143 | glBindTexture(GL_TEXTURE_2D, 0); | 147 | { |
144 | sCurrentBoundTextures[stage] = 0; | 148 | glActiveTextureARB(GL_TEXTURE0_ARB + stage); |
149 | glClientActiveTextureARB(GL_TEXTURE0_ARB + stage); | ||
150 | glBindTexture(GL_TEXTURE_2D, 0); | ||
151 | sCurrentBoundTextures[stage] = 0; | ||
152 | } | ||
145 | } | 153 | } |
146 | 154 | ||
147 | // static | 155 | // static |
diff --git a/linden/indra/llui/llbutton.cpp b/linden/indra/llui/llbutton.cpp index d35dd57..1d44537 100644 --- a/linden/indra/llui/llbutton.cpp +++ b/linden/indra/llui/llbutton.cpp | |||
@@ -648,7 +648,7 @@ void LLButton::draw() | |||
648 | mGLFont->render(label, 0, (F32)x, (F32)(LLBUTTON_V_PAD + y_offset), | 648 | mGLFont->render(label, 0, (F32)x, (F32)(LLBUTTON_V_PAD + y_offset), |
649 | label_color, | 649 | label_color, |
650 | mHAlign, LLFontGL::BOTTOM, | 650 | mHAlign, LLFontGL::BOTTOM, |
651 | mDropShadowedText ? LLFontGL::DROP_SHADOW : LLFontGL::NORMAL, | 651 | mDropShadowedText ? LLFontGL::DROP_SHADOW_SOFT : LLFontGL::NORMAL, |
652 | U32_MAX, drawable_width, | 652 | U32_MAX, drawable_width, |
653 | NULL, FALSE, FALSE); | 653 | NULL, FALSE, FALSE); |
654 | } | 654 | } |
diff --git a/linden/indra/llui/llcombobox.cpp b/linden/indra/llui/llcombobox.cpp index 983dd43..e00454a 100644 --- a/linden/indra/llui/llcombobox.cpp +++ b/linden/indra/llui/llcombobox.cpp | |||
@@ -55,8 +55,7 @@ S32 LLCOMBOBOX_WIDTH = 0; | |||
55 | 55 | ||
56 | LLComboBox::LLComboBox( const LLString& name, const LLRect &rect, const LLString& label, | 56 | LLComboBox::LLComboBox( const LLString& name, const LLRect &rect, const LLString& label, |
57 | void (*commit_callback)(LLUICtrl*,void*), | 57 | void (*commit_callback)(LLUICtrl*,void*), |
58 | void *callback_userdata, | 58 | void *callback_userdata |
59 | S32 list_width | ||
60 | ) | 59 | ) |
61 | : LLUICtrl(name, rect, TRUE, commit_callback, callback_userdata, | 60 | : LLUICtrl(name, rect, TRUE, commit_callback, callback_userdata, |
62 | FOLLOWS_LEFT | FOLLOWS_TOP), | 61 | FOLLOWS_LEFT | FOLLOWS_TOP), |
@@ -99,10 +98,7 @@ LLComboBox::LLComboBox( const LLString& name, const LLRect &rect, const LLString | |||
99 | addChild(mButton); | 98 | addChild(mButton); |
100 | 99 | ||
101 | // Default size, will be set by arrange() call in button callback. | 100 | // Default size, will be set by arrange() call in button callback. |
102 | if (list_width == 0) | 101 | S32 list_width = mRect.getWidth() + SCROLLBAR_SIZE; |
103 | { | ||
104 | list_width = mRect.getWidth() + SCROLLBAR_SIZE; | ||
105 | } | ||
106 | r.setOriginAndSize(0, 16, list_width, 220); | 102 | r.setOriginAndSize(0, 16, list_width, 220); |
107 | 103 | ||
108 | // disallow multiple selection | 104 | // disallow multiple selection |
@@ -503,12 +499,14 @@ void LLComboBox::showList() | |||
503 | 499 | ||
504 | LLRect rect = mList->getRect(); | 500 | LLRect rect = mList->getRect(); |
505 | 501 | ||
502 | S32 list_width = mRect.getWidth() + SCROLLBAR_SIZE; | ||
503 | |||
506 | if (mListPosition == BELOW) | 504 | if (mListPosition == BELOW) |
507 | { | 505 | { |
508 | if (rect.getHeight() <= -root_view_local.mBottom) | 506 | if (rect.getHeight() <= -root_view_local.mBottom) |
509 | { | 507 | { |
510 | // Move rect so it hangs off the bottom of this view | 508 | // Move rect so it hangs off the bottom of this view |
511 | rect.setLeftTopAndSize(0, 0, rect.getWidth(), rect.getHeight() ); | 509 | rect.setLeftTopAndSize(0, 0, list_width, rect.getHeight() ); |
512 | } | 510 | } |
513 | else | 511 | else |
514 | { | 512 | { |
@@ -516,12 +514,12 @@ void LLComboBox::showList() | |||
516 | if (-root_view_local.mBottom > root_view_local.mTop - mRect.getHeight()) | 514 | if (-root_view_local.mBottom > root_view_local.mTop - mRect.getHeight()) |
517 | { | 515 | { |
518 | // Move rect so it hangs off the bottom of this view | 516 | // Move rect so it hangs off the bottom of this view |
519 | rect.setLeftTopAndSize(0, 0, rect.getWidth(), llmin(-root_view_local.mBottom, rect.getHeight())); | 517 | rect.setLeftTopAndSize(0, 0, list_width, llmin(-root_view_local.mBottom, rect.getHeight())); |
520 | } | 518 | } |
521 | else | 519 | else |
522 | { | 520 | { |
523 | // move rect so it stacks on top of this view (clipped to size of screen) | 521 | // move rect so it stacks on top of this view (clipped to size of screen) |
524 | rect.setOriginAndSize(0, mRect.getHeight(), rect.getWidth(), llmin(root_view_local.mTop - mRect.getHeight(), rect.getHeight())); | 522 | rect.setOriginAndSize(0, mRect.getHeight(), list_width, llmin(root_view_local.mTop - mRect.getHeight(), rect.getHeight())); |
525 | } | 523 | } |
526 | } | 524 | } |
527 | } | 525 | } |
@@ -530,7 +528,7 @@ void LLComboBox::showList() | |||
530 | if (rect.getHeight() <= root_view_local.mTop - mRect.getHeight()) | 528 | if (rect.getHeight() <= root_view_local.mTop - mRect.getHeight()) |
531 | { | 529 | { |
532 | // move rect so it stacks on top of this view (clipped to size of screen) | 530 | // move rect so it stacks on top of this view (clipped to size of screen) |
533 | rect.setOriginAndSize(0, mRect.getHeight(), rect.getWidth(), llmin(root_view_local.mTop - mRect.getHeight(), rect.getHeight())); | 531 | rect.setOriginAndSize(0, mRect.getHeight(), list_width, llmin(root_view_local.mTop - mRect.getHeight(), rect.getHeight())); |
534 | } | 532 | } |
535 | else | 533 | else |
536 | { | 534 | { |
@@ -538,12 +536,12 @@ void LLComboBox::showList() | |||
538 | if (-root_view_local.mBottom > root_view_local.mTop - mRect.getHeight()) | 536 | if (-root_view_local.mBottom > root_view_local.mTop - mRect.getHeight()) |
539 | { | 537 | { |
540 | // Move rect so it hangs off the bottom of this view | 538 | // Move rect so it hangs off the bottom of this view |
541 | rect.setLeftTopAndSize(0, 0, rect.getWidth(), llmin(-root_view_local.mBottom, rect.getHeight())); | 539 | rect.setLeftTopAndSize(0, 0, list_width, llmin(-root_view_local.mBottom, rect.getHeight())); |
542 | } | 540 | } |
543 | else | 541 | else |
544 | { | 542 | { |
545 | // move rect so it stacks on top of this view (clipped to size of screen) | 543 | // move rect so it stacks on top of this view (clipped to size of screen) |
546 | rect.setOriginAndSize(0, mRect.getHeight(), rect.getWidth(), llmin(root_view_local.mTop - mRect.getHeight(), rect.getHeight())); | 544 | rect.setOriginAndSize(0, mRect.getHeight(), list_width, llmin(root_view_local.mTop - mRect.getHeight(), rect.getHeight())); |
547 | } | 545 | } |
548 | } | 546 | } |
549 | 547 | ||
diff --git a/linden/indra/llui/llcombobox.h b/linden/indra/llui/llcombobox.h index 8c317ee..d77224a 100644 --- a/linden/indra/llui/llcombobox.h +++ b/linden/indra/llui/llcombobox.h | |||
@@ -65,8 +65,7 @@ public: | |||
65 | const LLRect &rect, | 65 | const LLRect &rect, |
66 | const LLString& label, | 66 | const LLString& label, |
67 | void (*commit_callback)(LLUICtrl*, void*) = NULL, | 67 | void (*commit_callback)(LLUICtrl*, void*) = NULL, |
68 | void *callback_userdata = NULL, | 68 | void *callback_userdata = NULL |
69 | S32 list_width = 0 | ||
70 | ); | 69 | ); |
71 | virtual ~LLComboBox(); | 70 | virtual ~LLComboBox(); |
72 | 71 | ||
diff --git a/linden/indra/llui/lldraghandle.cpp b/linden/indra/llui/lldraghandle.cpp index 9e80c99..a3d28ad 100644 --- a/linden/indra/llui/lldraghandle.cpp +++ b/linden/indra/llui/lldraghandle.cpp | |||
@@ -122,6 +122,7 @@ void LLDragHandleTop::setTitle(const LLString& title) | |||
122 | const LLFontGL* font = gResMgr->getRes( LLFONT_SANSSERIF ); | 122 | const LLFontGL* font = gResMgr->getRes( LLFONT_SANSSERIF ); |
123 | mTitleBox = new LLTextBox( "Drag Handle Title", mRect, trimmed_title, font ); | 123 | mTitleBox = new LLTextBox( "Drag Handle Title", mRect, trimmed_title, font ); |
124 | mTitleBox->setFollows(FOLLOWS_TOP | FOLLOWS_LEFT | FOLLOWS_RIGHT); | 124 | mTitleBox->setFollows(FOLLOWS_TOP | FOLLOWS_LEFT | FOLLOWS_RIGHT); |
125 | mTitleBox->setFontStyle(LLFontGL::DROP_SHADOW_SOFT); | ||
125 | reshapeTitleBox(); | 126 | reshapeTitleBox(); |
126 | 127 | ||
127 | // allow empty titles, as default behavior replaces them with title box name | 128 | // allow empty titles, as default behavior replaces them with title box name |
diff --git a/linden/indra/llui/llfloater.cpp b/linden/indra/llui/llfloater.cpp index 12758b3..1613fd7 100644 --- a/linden/indra/llui/llfloater.cpp +++ b/linden/indra/llui/llfloater.cpp | |||
@@ -696,7 +696,13 @@ void LLFloater::translate(S32 x, S32 y) | |||
696 | 696 | ||
697 | BOOL LLFloater::canSnapTo(LLView* other_view) | 697 | BOOL LLFloater::canSnapTo(LLView* other_view) |
698 | { | 698 | { |
699 | if (other_view && other_view != getParent()) | 699 | if (NULL == other_view) |
700 | { | ||
701 | llwarns << "other_view is NULL" << llendl; | ||
702 | return FALSE; | ||
703 | } | ||
704 | |||
705 | if (other_view != getParent()) | ||
700 | { | 706 | { |
701 | LLFloater* other_floaterp = (LLFloater*)other_view; | 707 | LLFloater* other_floaterp = (LLFloater*)other_view; |
702 | 708 | ||
@@ -1933,7 +1939,11 @@ void LLFloaterView::bringToFront(LLFloater* child, BOOL give_focus) | |||
1933 | LLFloater* floaterp = (LLFloater*)(*view_it); | 1939 | LLFloater* floaterp = (LLFloater*)(*view_it); |
1934 | sendChildToFront(floaterp); | 1940 | sendChildToFront(floaterp); |
1935 | 1941 | ||
1936 | floaterp->setMinimized(FALSE); | 1942 | // always unminimize dependee, but allow dependents to stay minimized |
1943 | if (!floaterp->isDependent()) | ||
1944 | { | ||
1945 | floaterp->setMinimized(FALSE); | ||
1946 | } | ||
1937 | } | 1947 | } |
1938 | floaters_to_move.clear(); | 1948 | floaters_to_move.clear(); |
1939 | 1949 | ||
@@ -1945,7 +1955,9 @@ void LLFloaterView::bringToFront(LLFloater* child, BOOL give_focus) | |||
1945 | if (dependent) | 1955 | if (dependent) |
1946 | { | 1956 | { |
1947 | sendChildToFront(dependent); | 1957 | sendChildToFront(dependent); |
1948 | dependent->setMinimized(FALSE); | 1958 | //don't un-minimize dependent windows automatically |
1959 | // respect user's wishes | ||
1960 | //dependent->setMinimized(FALSE); | ||
1949 | } | 1961 | } |
1950 | ++dependent_it; | 1962 | ++dependent_it; |
1951 | } | 1963 | } |
@@ -2555,6 +2567,7 @@ void LLMultiFloater::addFloater(LLFloater* floaterp, BOOL select_added_floater, | |||
2555 | if (!mTabContainer) | 2567 | if (!mTabContainer) |
2556 | { | 2568 | { |
2557 | llerrs << "Tab Container used without having been initialized." << llendl; | 2569 | llerrs << "Tab Container used without having been initialized." << llendl; |
2570 | return; | ||
2558 | } | 2571 | } |
2559 | 2572 | ||
2560 | if (floaterp->getHost() == this) | 2573 | if (floaterp->getHost() == this) |
@@ -2718,7 +2731,7 @@ void LLMultiFloater::setVisible(BOOL visible) | |||
2718 | BOOL LLMultiFloater::handleKeyHere(KEY key, MASK mask, BOOL called_from_parent) | 2731 | BOOL LLMultiFloater::handleKeyHere(KEY key, MASK mask, BOOL called_from_parent) |
2719 | { | 2732 | { |
2720 | if (getEnabled() | 2733 | if (getEnabled() |
2721 | && mask == (MASK_CONTROL|MASK_SHIFT)) | 2734 | && mask == MASK_CONTROL) |
2722 | { | 2735 | { |
2723 | if (key == 'W') | 2736 | if (key == 'W') |
2724 | { | 2737 | { |
diff --git a/linden/indra/llui/lllineeditor.cpp b/linden/indra/llui/lllineeditor.cpp index ec156ba..a2cd9af 100644 --- a/linden/indra/llui/lllineeditor.cpp +++ b/linden/indra/llui/lllineeditor.cpp | |||
@@ -711,11 +711,11 @@ S32 LLLineEditor::prevWordPos(S32 cursorPos) const | |||
711 | S32 LLLineEditor::nextWordPos(S32 cursorPos) const | 711 | S32 LLLineEditor::nextWordPos(S32 cursorPos) const |
712 | { | 712 | { |
713 | const LLWString& wtext = mText.getWString(); | 713 | const LLWString& wtext = mText.getWString(); |
714 | while( (cursorPos < getLength()) && isPartOfWord( wtext[cursorPos+1] ) ) | 714 | while( (cursorPos < getLength()) && isPartOfWord( wtext[cursorPos] ) ) |
715 | { | 715 | { |
716 | cursorPos++; | 716 | cursorPos++; |
717 | } | 717 | } |
718 | while( (cursorPos < getLength()) && (wtext[cursorPos+1] == ' ') ) | 718 | while( (cursorPos < getLength()) && (wtext[cursorPos] == ' ') ) |
719 | { | 719 | { |
720 | cursorPos++; | 720 | cursorPos++; |
721 | } | 721 | } |
@@ -1035,7 +1035,8 @@ BOOL LLLineEditor::handleSpecialKey(KEY key, MASK mask) | |||
1035 | break; | 1035 | break; |
1036 | 1036 | ||
1037 | case KEY_LEFT: | 1037 | case KEY_LEFT: |
1038 | if (!mIgnoreArrowKeys) | 1038 | if (!mIgnoreArrowKeys |
1039 | && mask != MASK_ALT) | ||
1039 | { | 1040 | { |
1040 | if( hasSelection() ) | 1041 | if( hasSelection() ) |
1041 | { | 1042 | { |
@@ -1060,7 +1061,8 @@ BOOL LLLineEditor::handleSpecialKey(KEY key, MASK mask) | |||
1060 | break; | 1061 | break; |
1061 | 1062 | ||
1062 | case KEY_RIGHT: | 1063 | case KEY_RIGHT: |
1063 | if (!mIgnoreArrowKeys) | 1064 | if (!mIgnoreArrowKeys |
1065 | && mask != MASK_ALT) | ||
1064 | { | 1066 | { |
1065 | if (hasSelection()) | 1067 | if (hasSelection()) |
1066 | { | 1068 | { |
diff --git a/linden/indra/llui/llmemberlistener.h b/linden/indra/llui/llmemberlistener.h index 92e7278..92e7278 100755..100644 --- a/linden/indra/llui/llmemberlistener.h +++ b/linden/indra/llui/llmemberlistener.h | |||
diff --git a/linden/indra/llui/llmenugl.cpp b/linden/indra/llui/llmenugl.cpp index 1920aac..9530f26 100644 --- a/linden/indra/llui/llmenugl.cpp +++ b/linden/indra/llui/llmenugl.cpp | |||
@@ -517,7 +517,7 @@ void LLMenuItemGL::draw( void ) | |||
517 | U8 font_style = mStyle; | 517 | U8 font_style = mStyle; |
518 | if (LLMenuItemGL::sDropShadowText && getEnabled() && !mDrawTextDisabled ) | 518 | if (LLMenuItemGL::sDropShadowText && getEnabled() && !mDrawTextDisabled ) |
519 | { | 519 | { |
520 | font_style |= LLFontGL::DROP_SHADOW; | 520 | font_style |= LLFontGL::DROP_SHADOW_SOFT; |
521 | } | 521 | } |
522 | 522 | ||
523 | if ( getEnabled() && getHighlight() ) | 523 | if ( getEnabled() && getHighlight() ) |
@@ -729,14 +729,18 @@ void LLMenuItemTearOffGL::doIt() | |||
729 | 729 | ||
730 | LLFloater* parent_floater = LLFloater::getFloaterByHandle(mParentHandle); | 730 | LLFloater* parent_floater = LLFloater::getFloaterByHandle(mParentHandle); |
731 | LLFloater* tear_off_menu = LLTearOffMenu::create(getMenu()); | 731 | LLFloater* tear_off_menu = LLTearOffMenu::create(getMenu()); |
732 | if (parent_floater && tear_off_menu) | 732 | |
733 | if (tear_off_menu) | ||
733 | { | 734 | { |
734 | parent_floater->addDependentFloater(tear_off_menu, FALSE); | 735 | if (parent_floater) |
735 | } | 736 | { |
737 | parent_floater->addDependentFloater(tear_off_menu, FALSE); | ||
738 | } | ||
736 | 739 | ||
737 | // give focus to torn off menu because it will have been taken away | 740 | // give focus to torn off menu because it will have |
738 | // when parent menu closes | 741 | // been taken away when parent menu closes |
739 | tear_off_menu->setFocus(TRUE); | 742 | tear_off_menu->setFocus(TRUE); |
743 | } | ||
740 | } | 744 | } |
741 | LLMenuItemGL::doIt(); | 745 | LLMenuItemGL::doIt(); |
742 | } | 746 | } |
@@ -1744,7 +1748,7 @@ void LLMenuItemBranchDownGL::draw( void ) | |||
1744 | U8 font_style = mStyle; | 1748 | U8 font_style = mStyle; |
1745 | if (LLMenuItemGL::sDropShadowText && getEnabled() && !mDrawTextDisabled ) | 1749 | if (LLMenuItemGL::sDropShadowText && getEnabled() && !mDrawTextDisabled ) |
1746 | { | 1750 | { |
1747 | font_style |= LLFontGL::DROP_SHADOW; | 1751 | font_style |= LLFontGL::DROP_SHADOW_SOFT; |
1748 | } | 1752 | } |
1749 | 1753 | ||
1750 | LLColor4 color; | 1754 | LLColor4 color; |
diff --git a/linden/indra/llui/llpanel.cpp b/linden/indra/llui/llpanel.cpp index 9e444c1..f0b5b25 100644 --- a/linden/indra/llui/llpanel.cpp +++ b/linden/indra/llui/llpanel.cpp | |||
@@ -362,7 +362,7 @@ BOOL LLPanel::handleKeyHere( KEY key, MASK mask, BOOL called_from_parent ) | |||
362 | // If we have a default button, click it when | 362 | // If we have a default button, click it when |
363 | // return is pressed, unless current focus is a return-capturing button | 363 | // return is pressed, unless current focus is a return-capturing button |
364 | // in which case *that* button will handle the return key | 364 | // in which case *that* button will handle the return key |
365 | if (!(cur_focus->getWidgetType() == WIDGET_TYPE_BUTTON && static_cast<LLButton *>(cur_focus)->getCommitOnReturn())) | 365 | if (cur_focus && !(cur_focus->getWidgetType() == WIDGET_TYPE_BUTTON && static_cast<LLButton *>(cur_focus)->getCommitOnReturn())) |
366 | { | 366 | { |
367 | // RETURN key means hit default button in this case | 367 | // RETURN key means hit default button in this case |
368 | if (key == KEY_RETURN && mask == MASK_NONE | 368 | if (key == KEY_RETURN && mask == MASK_NONE |
diff --git a/linden/indra/llui/lltabcontainer.cpp b/linden/indra/llui/lltabcontainer.cpp index db09717..61cfde4 100644 --- a/linden/indra/llui/lltabcontainer.cpp +++ b/linden/indra/llui/lltabcontainer.cpp | |||
@@ -941,8 +941,8 @@ void LLTabContainer::addTabPanel(LLPanel* child, | |||
941 | else | 941 | else |
942 | { | 942 | { |
943 | LLString tooltip = trimmed_label; | 943 | LLString tooltip = trimmed_label; |
944 | tooltip += "\nCtrl-[ for previous tab"; | 944 | tooltip += "\nAlt-Left arrow for previous tab"; |
945 | tooltip += "\nCtrl-] for next tab"; | 945 | tooltip += "\nAlt-Right arrow for next tab"; |
946 | 946 | ||
947 | LLButton* btn = new LLButton( | 947 | LLButton* btn = new LLButton( |
948 | LLString(child->getName()) + " tab", | 948 | LLString(child->getName()) + " tab", |
@@ -1486,12 +1486,12 @@ BOOL LLTabContainer::handleKeyHere(KEY key, MASK mask, BOOL called_from_parent) | |||
1486 | if (!gFocusMgr.childHasKeyboardFocus(this)) return FALSE; | 1486 | if (!gFocusMgr.childHasKeyboardFocus(this)) return FALSE; |
1487 | 1487 | ||
1488 | BOOL handled = FALSE; | 1488 | BOOL handled = FALSE; |
1489 | if (key == '[' && mask == MASK_CONTROL) | 1489 | if (key == KEY_LEFT && mask == MASK_ALT) |
1490 | { | 1490 | { |
1491 | selectPrevTab(); | 1491 | selectPrevTab(); |
1492 | handled = TRUE; | 1492 | handled = TRUE; |
1493 | } | 1493 | } |
1494 | else if (key == ']' && mask == MASK_CONTROL) | 1494 | else if (key == KEY_RIGHT && mask == MASK_ALT) |
1495 | { | 1495 | { |
1496 | selectNextTab(); | 1496 | selectNextTab(); |
1497 | handled = TRUE; | 1497 | handled = TRUE; |
diff --git a/linden/indra/llui/lltabcontainervertical.cpp b/linden/indra/llui/lltabcontainervertical.cpp index a921b4b..317b7ca 100644 --- a/linden/indra/llui/lltabcontainervertical.cpp +++ b/linden/indra/llui/lltabcontainervertical.cpp | |||
@@ -557,12 +557,12 @@ BOOL LLTabContainerVertical::handleKeyHere(KEY key, MASK mask, BOOL called_from_ | |||
557 | BOOL handled = FALSE; | 557 | BOOL handled = FALSE; |
558 | if (getEnabled()) | 558 | if (getEnabled()) |
559 | { | 559 | { |
560 | if (key == '[' && mask == MASK_CONTROL) | 560 | if (key == KEY_LEFT && mask == MASK_ALT) |
561 | { | 561 | { |
562 | selectPrevTab(); | 562 | selectPrevTab(); |
563 | handled = TRUE; | 563 | handled = TRUE; |
564 | } | 564 | } |
565 | else if (key == ']' && mask == MASK_CONTROL) | 565 | else if (key == KEY_RIGHT && mask == MASK_ALT) |
566 | { | 566 | { |
567 | selectNextTab(); | 567 | selectNextTab(); |
568 | handled = TRUE; | 568 | handled = TRUE; |
diff --git a/linden/indra/llui/lltextbox.cpp b/linden/indra/llui/lltextbox.cpp index 884d638..c4f2cea 100644 --- a/linden/indra/llui/lltextbox.cpp +++ b/linden/indra/llui/lltextbox.cpp | |||
@@ -48,7 +48,7 @@ LLTextBox::LLTextBox(const LLString& name, const LLRect& rect, const LLString& t | |||
48 | mBorderColor( LLUI::sColorsGroup->getColor( "DefaultHighlightLight" ) ), | 48 | mBorderColor( LLUI::sColorsGroup->getColor( "DefaultHighlightLight" ) ), |
49 | mBackgroundVisible( FALSE ), | 49 | mBackgroundVisible( FALSE ), |
50 | mBorderVisible( FALSE ), | 50 | mBorderVisible( FALSE ), |
51 | mDropshadowVisible( TRUE ), | 51 | mFontStyle(LLFontGL::DROP_SHADOW_SOFT), |
52 | mBorderDropShadowVisible( FALSE ), | 52 | mBorderDropShadowVisible( FALSE ), |
53 | mHPad(0), | 53 | mHPad(0), |
54 | mVPad(0), | 54 | mVPad(0), |
@@ -73,7 +73,7 @@ LLTextBox::LLTextBox(const LLString& name, const LLString& text, F32 max_width, | |||
73 | mBorderColor(LLUI::sColorsGroup->getColor("DefaultHighlightLight")), | 73 | mBorderColor(LLUI::sColorsGroup->getColor("DefaultHighlightLight")), |
74 | mBackgroundVisible(FALSE), | 74 | mBackgroundVisible(FALSE), |
75 | mBorderVisible(FALSE), | 75 | mBorderVisible(FALSE), |
76 | mDropshadowVisible(TRUE), | 76 | mFontStyle(LLFontGL::DROP_SHADOW_SOFT), |
77 | mBorderDropShadowVisible(FALSE), | 77 | mBorderDropShadowVisible(FALSE), |
78 | mHPad(0), | 78 | mHPad(0), |
79 | mVPad(0), | 79 | mVPad(0), |
@@ -363,7 +363,7 @@ void LLTextBox::drawText( S32 x, S32 y, const LLColor4& color ) | |||
363 | S32 line_length = *iter; | 363 | S32 line_length = *iter; |
364 | mFontGL->render(mText.getWString(), cur_pos, (F32)x, (F32)y, color, | 364 | mFontGL->render(mText.getWString(), cur_pos, (F32)x, (F32)y, color, |
365 | mHAlign, mVAlign, | 365 | mHAlign, mVAlign, |
366 | mDropshadowVisible ? LLFontGL::DROP_SHADOW : LLFontGL::NORMAL, | 366 | mFontStyle, |
367 | line_length, mRect.getWidth(), NULL, TRUE ); | 367 | line_length, mRect.getWidth(), NULL, TRUE ); |
368 | cur_pos += line_length + 1; | 368 | cur_pos += line_length + 1; |
369 | y -= llfloor(mFontGL->getLineHeight()); | 369 | y -= llfloor(mFontGL->getLineHeight()); |
@@ -373,7 +373,7 @@ void LLTextBox::drawText( S32 x, S32 y, const LLColor4& color ) | |||
373 | { | 373 | { |
374 | mFontGL->render(mText.getWString(), 0, (F32)x, (F32)y, color, | 374 | mFontGL->render(mText.getWString(), 0, (F32)x, (F32)y, color, |
375 | mHAlign, mVAlign, | 375 | mHAlign, mVAlign, |
376 | mDropshadowVisible ? LLFontGL::DROP_SHADOW : LLFontGL::NORMAL, | 376 | mFontStyle, |
377 | S32_MAX, mRect.getWidth(), NULL, TRUE); | 377 | S32_MAX, mRect.getWidth(), NULL, TRUE); |
378 | } | 378 | } |
379 | } | 379 | } |
@@ -406,8 +406,6 @@ LLXMLNodePtr LLTextBox::getXML(bool save_children) const | |||
406 | 406 | ||
407 | node->createChild("border_visible", TRUE)->setBoolValue(mBorderVisible); | 407 | node->createChild("border_visible", TRUE)->setBoolValue(mBorderVisible); |
408 | 408 | ||
409 | node->createChild("drop_shadow_visible", TRUE)->setBoolValue(mDropshadowVisible); | ||
410 | |||
411 | node->createChild("border_drop_shadow_visible", TRUE)->setBoolValue(mBorderDropShadowVisible); | 409 | node->createChild("border_drop_shadow_visible", TRUE)->setBoolValue(mBorderDropShadowVisible); |
412 | 410 | ||
413 | node->createChild("h_pad", TRUE)->setIntValue(mHPad); | 411 | node->createChild("h_pad", TRUE)->setIntValue(mHPad); |
@@ -447,6 +445,12 @@ LLView* LLTextBox::fromXML(LLXMLNodePtr node, LLView *parent, LLUICtrlFactory *f | |||
447 | 445 | ||
448 | text_box->initFromXML(node, parent); | 446 | text_box->initFromXML(node, parent); |
449 | 447 | ||
448 | LLString font_style; | ||
449 | if (node->getAttributeString("font-style", font_style)) | ||
450 | { | ||
451 | text_box->mFontStyle = LLFontGL::getStyleFromString(font_style); | ||
452 | } | ||
453 | |||
450 | if(node->hasAttribute("text_color")) | 454 | if(node->hasAttribute("text_color")) |
451 | { | 455 | { |
452 | LLColor4 color; | 456 | LLColor4 color; |
diff --git a/linden/indra/llui/lltextbox.h b/linden/indra/llui/lltextbox.h index 45d6acb..e8d4690 100644 --- a/linden/indra/llui/lltextbox.h +++ b/linden/indra/llui/lltextbox.h | |||
@@ -74,7 +74,7 @@ public: | |||
74 | 74 | ||
75 | void setBackgroundVisible(BOOL visible) { mBackgroundVisible = visible; } | 75 | void setBackgroundVisible(BOOL visible) { mBackgroundVisible = visible; } |
76 | void setBorderVisible(BOOL visible) { mBorderVisible = visible; } | 76 | void setBorderVisible(BOOL visible) { mBorderVisible = visible; } |
77 | void setDropshadowVisible(BOOL visible) { mDropshadowVisible = visible; } | 77 | void setFontStyle(U8 style) { mFontStyle = style; } |
78 | void setBorderDropshadowVisible(BOOL visible){ mBorderDropShadowVisible = visible; } | 78 | void setBorderDropshadowVisible(BOOL visible){ mBorderDropShadowVisible = visible; } |
79 | void setHPad(S32 pixels) { mHPad = pixels; } | 79 | void setHPad(S32 pixels) { mHPad = pixels; } |
80 | void setVPad(S32 pixels) { mVPad = pixels; } | 80 | void setVPad(S32 pixels) { mVPad = pixels; } |
@@ -112,7 +112,7 @@ protected: | |||
112 | BOOL mBackgroundVisible; | 112 | BOOL mBackgroundVisible; |
113 | BOOL mBorderVisible; | 113 | BOOL mBorderVisible; |
114 | 114 | ||
115 | BOOL mDropshadowVisible; // Draws black dropshadow below and to the right of the text. | 115 | U8 mFontStyle; // style bit flags for font |
116 | BOOL mBorderDropShadowVisible; | 116 | BOOL mBorderDropShadowVisible; |
117 | 117 | ||
118 | S32 mHPad; | 118 | S32 mHPad; |
diff --git a/linden/indra/llui/lltexteditor.cpp b/linden/indra/llui/lltexteditor.cpp index 787eba5..ba991c2 100644 --- a/linden/indra/llui/lltexteditor.cpp +++ b/linden/indra/llui/lltexteditor.cpp | |||
@@ -723,11 +723,11 @@ S32 LLTextEditor::prevWordPos(S32 cursorPos) const | |||
723 | S32 LLTextEditor::nextWordPos(S32 cursorPos) const | 723 | S32 LLTextEditor::nextWordPos(S32 cursorPos) const |
724 | { | 724 | { |
725 | const LLWString& wtext = mWText; | 725 | const LLWString& wtext = mWText; |
726 | while( (cursorPos < getLength()) && isPartOfWord( wtext[cursorPos+1] ) ) | 726 | while( (cursorPos < getLength()) && isPartOfWord( wtext[cursorPos] ) ) |
727 | { | 727 | { |
728 | cursorPos++; | 728 | cursorPos++; |
729 | } | 729 | } |
730 | while( (cursorPos < getLength()) && (wtext[cursorPos+1] == ' ') ) | 730 | while( (cursorPos < getLength()) && (wtext[cursorPos] == ' ') ) |
731 | { | 731 | { |
732 | cursorPos++; | 732 | cursorPos++; |
733 | } | 733 | } |
@@ -3667,10 +3667,18 @@ void LLTextEditor::pruneSegments() | |||
3667 | break; // done | 3667 | break; // done |
3668 | } | 3668 | } |
3669 | } | 3669 | } |
3670 | // erase invalid segments | 3670 | if (iter != mSegments.end()) |
3671 | ++iter; | 3671 | { |
3672 | std::for_each(iter, mSegments.end(), DeletePointer()); | 3672 | // erase invalid segments |
3673 | mSegments.erase(iter, mSegments.end()); | 3673 | ++iter; |
3674 | std::for_each(iter, mSegments.end(), DeletePointer()); | ||
3675 | mSegments.erase(iter, mSegments.end()); | ||
3676 | } | ||
3677 | else | ||
3678 | { | ||
3679 | llwarns << "Tried to erase end of empty LLTextEditor" | ||
3680 | << llendl; | ||
3681 | } | ||
3674 | } | 3682 | } |
3675 | 3683 | ||
3676 | void LLTextEditor::findEmbeddedItemSegments() | 3684 | void LLTextEditor::findEmbeddedItemSegments() |
diff --git a/linden/indra/llui/llui.cpp b/linden/indra/llui/llui.cpp index 9d689b5..a725281 100644 --- a/linden/indra/llui/llui.cpp +++ b/linden/indra/llui/llui.cpp | |||
@@ -421,6 +421,12 @@ void gl_draw_scaled_image_with_border(S32 x, S32 y, S32 border_width, S32 border | |||
421 | stop_glerror(); | 421 | stop_glerror(); |
422 | F32 border_scale = 1.f; | 422 | F32 border_scale = 1.f; |
423 | 423 | ||
424 | if (NULL == image) | ||
425 | { | ||
426 | llwarns << "image == NULL; aborting function" << llendl; | ||
427 | return; | ||
428 | } | ||
429 | |||
424 | if (border_height * 2 > height) | 430 | if (border_height * 2 > height) |
425 | { | 431 | { |
426 | border_scale = (F32)height / ((F32)border_height * 2.f); | 432 | border_scale = (F32)height / ((F32)border_height * 2.f); |
@@ -599,6 +605,12 @@ void gl_draw_rotated_image(S32 x, S32 y, F32 degrees, LLImageGL* image, const LL | |||
599 | 605 | ||
600 | void gl_draw_scaled_rotated_image(S32 x, S32 y, S32 width, S32 height, F32 degrees, LLImageGL* image, const LLColor4& color) | 606 | void gl_draw_scaled_rotated_image(S32 x, S32 y, S32 width, S32 height, F32 degrees, LLImageGL* image, const LLColor4& color) |
601 | { | 607 | { |
608 | if (NULL == image) | ||
609 | { | ||
610 | llwarns << "image == NULL; aborting function" << llendl; | ||
611 | return; | ||
612 | } | ||
613 | |||
602 | LLGLSUIDefault gls_ui; | 614 | LLGLSUIDefault gls_ui; |
603 | 615 | ||
604 | glPushMatrix(); | 616 | glPushMatrix(); |
@@ -639,6 +651,12 @@ void gl_draw_scaled_rotated_image(S32 x, S32 y, S32 width, S32 height, F32 degre | |||
639 | 651 | ||
640 | void gl_draw_scaled_image_inverted(S32 x, S32 y, S32 width, S32 height, LLImageGL* image, const LLColor4& color) | 652 | void gl_draw_scaled_image_inverted(S32 x, S32 y, S32 width, S32 height, LLImageGL* image, const LLColor4& color) |
641 | { | 653 | { |
654 | if (NULL == image) | ||
655 | { | ||
656 | llwarns << "image == NULL; aborting function" << llendl; | ||
657 | return; | ||
658 | } | ||
659 | |||
642 | LLGLSUIDefault gls_ui; | 660 | LLGLSUIDefault gls_ui; |
643 | 661 | ||
644 | glPushMatrix(); | 662 | glPushMatrix(); |
diff --git a/linden/indra/llui/lluistring.cpp b/linden/indra/llui/lluistring.cpp index 49b6fca..49b6fca 100755..100644 --- a/linden/indra/llui/lluistring.cpp +++ b/linden/indra/llui/lluistring.cpp | |||
diff --git a/linden/indra/llui/lluistring.h b/linden/indra/llui/lluistring.h index 37792aa..37792aa 100755..100644 --- a/linden/indra/llui/lluistring.h +++ b/linden/indra/llui/lluistring.h | |||
diff --git a/linden/indra/llui/llviewborder.cpp b/linden/indra/llui/llviewborder.cpp index 4c2b602..84f396b 100644 --- a/linden/indra/llui/llviewborder.cpp +++ b/linden/indra/llui/llviewborder.cpp | |||
@@ -59,7 +59,7 @@ LLViewBorder::LLViewBorder( const LLString& name, const LLRect& rect, EBevel bev | |||
59 | } | 59 | } |
60 | 60 | ||
61 | // virtual | 61 | // virtual |
62 | BOOL LLViewBorder::isCtrl() | 62 | BOOL LLViewBorder::isCtrl() const |
63 | { | 63 | { |
64 | return FALSE; | 64 | return FALSE; |
65 | } | 65 | } |
diff --git a/linden/indra/llui/llviewborder.h b/linden/indra/llui/llviewborder.h index 7e5de4b..38d6c9f 100644 --- a/linden/indra/llui/llviewborder.h +++ b/linden/indra/llui/llviewborder.h | |||
@@ -54,7 +54,7 @@ public: | |||
54 | virtual EWidgetType getWidgetType() const; | 54 | virtual EWidgetType getWidgetType() const; |
55 | virtual LLString getWidgetTag() const; | 55 | virtual LLString getWidgetTag() const; |
56 | 56 | ||
57 | virtual BOOL isCtrl(); | 57 | virtual BOOL isCtrl() const; |
58 | 58 | ||
59 | // llview functionality | 59 | // llview functionality |
60 | virtual void draw(); | 60 | virtual void draw(); |
diff --git a/linden/indra/llvfs/llvfs.cpp b/linden/indra/llvfs/llvfs.cpp index a41aa78..b83d12c 100644 --- a/linden/indra/llvfs/llvfs.cpp +++ b/linden/indra/llvfs/llvfs.cpp | |||
@@ -307,6 +307,8 @@ LLVFS::LLVFS(const char *index_filename, const char *data_filename, const BOOL r | |||
307 | { | 307 | { |
308 | llwarns << "Couldn't open vfs data file after trying many alternates" << llendl; | 308 | llwarns << "Couldn't open vfs data file after trying many alternates" << llendl; |
309 | mValid = VFSVALID_BAD_CANNOT_CREATE; | 309 | mValid = VFSVALID_BAD_CANNOT_CREATE; |
310 | delete[] temp_index; | ||
311 | delete[] temp_data; | ||
310 | return; | 312 | return; |
311 | } | 313 | } |
312 | 314 | ||
@@ -394,7 +396,6 @@ LLVFS::LLVFS(const char *index_filename, const char *data_filename, const BOOL r | |||
394 | // to heal after some errors. JC | 396 | // to heal after some errors. JC |
395 | if (block->mLength > 0 && | 397 | if (block->mLength > 0 && |
396 | (U32)block->mLength <= data_size && | 398 | (U32)block->mLength <= data_size && |
397 | block->mLocation >= 0 && | ||
398 | block->mLocation < data_size && | 399 | block->mLocation < data_size && |
399 | block->mSize > 0 && | 400 | block->mSize > 0 && |
400 | block->mSize <= block->mLength && | 401 | block->mSize <= block->mLength && |
@@ -435,7 +436,7 @@ LLVFS::LLVFS(const char *index_filename, const char *data_filename, const BOOL r | |||
435 | delete block; | 436 | delete block; |
436 | } | 437 | } |
437 | 438 | ||
438 | tmp_ptr += block->SERIAL_SIZE; | 439 | tmp_ptr += LLVFSFileBlock::SERIAL_SIZE; |
439 | } | 440 | } |
440 | delete[] buffer; | 441 | delete[] buffer; |
441 | 442 | ||
@@ -658,6 +659,7 @@ void LLVFS::presizeDataFile(const U32 size) | |||
658 | if (!mDataFP) | 659 | if (!mDataFP) |
659 | { | 660 | { |
660 | llerrs << "LLVFS::presizeDataFile() with no data file open" << llendl; | 661 | llerrs << "LLVFS::presizeDataFile() with no data file open" << llendl; |
662 | return; | ||
661 | } | 663 | } |
662 | 664 | ||
663 | // we're creating this file for the first time, size it | 665 | // we're creating this file for the first time, size it |
@@ -1731,7 +1733,6 @@ void LLVFS::audit() | |||
1731 | 1733 | ||
1732 | // do sanity check on this block | 1734 | // do sanity check on this block |
1733 | if (block->mLength >= 0 && | 1735 | if (block->mLength >= 0 && |
1734 | block->mLocation >= 0 && | ||
1735 | block->mSize >= 0 && | 1736 | block->mSize >= 0 && |
1736 | block->mSize <= block->mLength && | 1737 | block->mSize <= block->mLength && |
1737 | block->mFileType >= LLAssetType::AT_NONE && | 1738 | block->mFileType >= LLAssetType::AT_NONE && |
diff --git a/linden/indra/llwindow/llwindow_vc8.vcproj b/linden/indra/llwindow/llwindow_vc8.vcproj index b04477f..4d6bbcb 100644 --- a/linden/indra/llwindow/llwindow_vc8.vcproj +++ b/linden/indra/llwindow/llwindow_vc8.vcproj | |||
@@ -4,6 +4,7 @@ | |||
4 | Version="8.00" | 4 | Version="8.00" |
5 | Name="llwindow" | 5 | Name="llwindow" |
6 | ProjectGUID="{B5B53617-416F-404A-BF10-22EBCCA0E4FB}" | 6 | ProjectGUID="{B5B53617-416F-404A-BF10-22EBCCA0E4FB}" |
7 | RootNamespace="llwindow" | ||
7 | Keyword="Win32Proj" | 8 | Keyword="Win32Proj" |
8 | > | 9 | > |
9 | <Platforms> | 10 | <Platforms> |
@@ -40,17 +41,15 @@ | |||
40 | <Tool | 41 | <Tool |
41 | Name="VCCLCompilerTool" | 42 | Name="VCCLCompilerTool" |
42 | Optimization="0" | 43 | Optimization="0" |
43 | AdditionalIncludeDirectories="..\llcommon;..\llmath;..\llxml;..\llvfs;..\llmessage;..\llscene;..\llimage;..\..\libraries\i686-win32\include;..\..\libraries\include\" | 44 | AdditionalIncludeDirectories="..\llcommon;..\llmath;..\llxml;..\llvfs;..\llmessage;..\llscene;..\llimage;"..\..\libraries\i686-win32\include";..\..\libraries\include\;Logitech_LCD;Logitech_LCD\LCDUI" |
44 | PreprocessorDefinitions="WIN32;_DEBUG;_LIB;LL_WINDOWS;_CRT_SECURE_NO_DEPRECATE;_CRT_NONSTDC_NO_DEPRECATE;_USE_32BIT_TIME_T;LL_DEBUG" | 45 | PreprocessorDefinitions="WIN32;_DEBUG;_LIB;LL_WINDOWS;LL_DEBUG" |
45 | MinimalRebuild="true" | 46 | MinimalRebuild="true" |
46 | BasicRuntimeChecks="3" | 47 | BasicRuntimeChecks="3" |
47 | RuntimeLibrary="1" | 48 | RuntimeLibrary="1" |
48 | StructMemberAlignment="4" | 49 | StructMemberAlignment="4" |
49 | TreatWChar_tAsBuiltInType="false" | ||
50 | ForceConformanceInForLoopScope="true" | 50 | ForceConformanceInForLoopScope="true" |
51 | UsePrecompiledHeader="0" | 51 | UsePrecompiledHeader="0" |
52 | WarningLevel="3" | 52 | WarningLevel="3" |
53 | WarnAsError="true" | ||
54 | Detect64BitPortabilityProblems="false" | 53 | Detect64BitPortabilityProblems="false" |
55 | DebugInformationFormat="4" | 54 | DebugInformationFormat="4" |
56 | /> | 55 | /> |
@@ -108,16 +107,12 @@ | |||
108 | /> | 107 | /> |
109 | <Tool | 108 | <Tool |
110 | Name="VCCLCompilerTool" | 109 | Name="VCCLCompilerTool" |
111 | AdditionalIncludeDirectories="..\llcommon;..\llmath;..\llxml;..\llvfs;..\llmessage;..\llscene;..\llimage;..\..\libraries\i686-win32\include;..\..\libraries\include\" | 110 | AdditionalIncludeDirectories="..\llcommon;..\llmath;..\llxml;..\llvfs;..\llmessage;..\llscene;..\llimage;"..\..\libraries\i686-win32\include";..\..\libraries\include\;Logitech_LCD;Logitech_LCD\LCDUI" |
112 | PreprocessorDefinitions="WIN32;NDEBUG;_LIB;LL_WINDOWS;_CRT_SECURE_NO_DEPRECATE;_CRT_NONSTDC_NO_DEPRECATE;_USE_32BIT_TIME_T;LL_RELEASE" | 111 | PreprocessorDefinitions="WIN32;NDEBUG;_LIB;LL_WINDOWS;_CRT_SECURE_NO_DEPRECATE;_CRT_NONSTDC_NO_DEPRECATE;_USE_32BIT_TIME_T;LL_RELEASE" |
113 | RuntimeLibrary="0" | ||
114 | StructMemberAlignment="0" | ||
115 | TreatWChar_tAsBuiltInType="false" | 112 | TreatWChar_tAsBuiltInType="false" |
116 | ForceConformanceInForLoopScope="true" | 113 | ForceConformanceInForLoopScope="true" |
117 | UsePrecompiledHeader="0" | ||
118 | WarningLevel="3" | 114 | WarningLevel="3" |
119 | WarnAsError="true" | 115 | WarnAsError="true" |
120 | Detect64BitPortabilityProblems="false" | ||
121 | DebugInformationFormat="3" | 116 | DebugInformationFormat="3" |
122 | /> | 117 | /> |
123 | <Tool | 118 | <Tool |
@@ -175,8 +170,8 @@ | |||
175 | <Tool | 170 | <Tool |
176 | Name="VCCLCompilerTool" | 171 | Name="VCCLCompilerTool" |
177 | Optimization="0" | 172 | Optimization="0" |
178 | AdditionalIncludeDirectories="..\llcommon;..\llmath;..\llxml;..\llvfs;..\llmessage;..\llscene;..\llimage;..\..\libraries\i686-win32\include;..\..\libraries\include\GLMESA;..\..\libraries\i686-win32\include;..\..\libraries\include\" | 173 | AdditionalIncludeDirectories="..\llcommon;..\llmath;..\llxml;..\llvfs;..\llmessage;..\llscene;..\llimage;"..\..\libraries\i686-win32\include";..\..\libraries\include\GLMESA;..\..\libraries\include\;Logitech_LCD;Logitech_LCD\LCDUI" |
179 | PreprocessorDefinitions="WIN32;_DEBUG;_LIB;LL_WINDOWS;_CRT_SECURE_NO_DEPRECATE;_CRT_NONSTDC_NO_DEPRECATE;_USE_32BIT_TIME_T;LL_DEBUG;LL_MESA;LL_MESA_HEADLESS" | 174 | PreprocessorDefinitions="WIN32;_DEBUG;_LIB;LL_WINDOWS;LL_DEBUG;LL_MESA;LL_MESA_HEADLESS" |
180 | MinimalRebuild="true" | 175 | MinimalRebuild="true" |
181 | BasicRuntimeChecks="3" | 176 | BasicRuntimeChecks="3" |
182 | RuntimeLibrary="1" | 177 | RuntimeLibrary="1" |
@@ -184,7 +179,6 @@ | |||
184 | ForceConformanceInForLoopScope="true" | 179 | ForceConformanceInForLoopScope="true" |
185 | UsePrecompiledHeader="0" | 180 | UsePrecompiledHeader="0" |
186 | WarningLevel="3" | 181 | WarningLevel="3" |
187 | WarnAsError="true" | ||
188 | Detect64BitPortabilityProblems="false" | 182 | Detect64BitPortabilityProblems="false" |
189 | DebugInformationFormat="4" | 183 | DebugInformationFormat="4" |
190 | /> | 184 | /> |
@@ -243,15 +237,13 @@ | |||
243 | <Tool | 237 | <Tool |
244 | Name="VCCLCompilerTool" | 238 | Name="VCCLCompilerTool" |
245 | Optimization="0" | 239 | Optimization="0" |
246 | AdditionalIncludeDirectories="..\llcommon;..\llmath;..\llxml;..\llvfs;..\llmessage;..\llscene;..\llimage;..\..\libraries\i686-win32\include;..\..\libraries\include\" | 240 | AdditionalIncludeDirectories="..\llcommon;..\llmath;..\llxml;..\llvfs;..\llmessage;..\llscene;..\llimage;"..\..\libraries\i686-win32\include";..\..\libraries\include\;Logitech_LCD;Logitech_LCD\LCDUI" |
247 | PreprocessorDefinitions="WIN32;NDEBUG;_LIB;LL_WINDOWS;_CRT_SECURE_NO_DEPRECATE;_CRT_NONSTDC_NO_DEPRECATE;_USE_32BIT_TIME_T;LL_RELEASE" | 241 | PreprocessorDefinitions="WIN32;NDEBUG;_LIB;LL_WINDOWS;LL_RELEASE" |
248 | RuntimeLibrary="0" | 242 | RuntimeLibrary="0" |
249 | StructMemberAlignment="0" | 243 | StructMemberAlignment="0" |
250 | TreatWChar_tAsBuiltInType="false" | ||
251 | ForceConformanceInForLoopScope="true" | 244 | ForceConformanceInForLoopScope="true" |
252 | UsePrecompiledHeader="0" | 245 | UsePrecompiledHeader="0" |
253 | WarningLevel="3" | 246 | WarningLevel="3" |
254 | WarnAsError="true" | ||
255 | Detect64BitPortabilityProblems="false" | 247 | Detect64BitPortabilityProblems="false" |
256 | DebugInformationFormat="3" | 248 | DebugInformationFormat="3" |
257 | /> | 249 | /> |
@@ -386,6 +378,222 @@ | |||
386 | UniqueIdentifier="{67DA6AB6-F800-4c08-8B7A-83BB121AAD01}" | 378 | UniqueIdentifier="{67DA6AB6-F800-4c08-8B7A-83BB121AAD01}" |
387 | > | 379 | > |
388 | </Filter> | 380 | </Filter> |
381 | <Filter | ||
382 | Name="Logitech LCD" | ||
383 | > | ||
384 | <Filter | ||
385 | Name="Header Files" | ||
386 | > | ||
387 | <File | ||
388 | RelativePath=".\Logitech_LCD\EZ_LCD.h" | ||
389 | > | ||
390 | </File> | ||
391 | <File | ||
392 | RelativePath=".\Logitech_LCD\EZ_LCD_Defines.h" | ||
393 | > | ||
394 | </File> | ||
395 | <File | ||
396 | RelativePath=".\Logitech_LCD\EZ_LCD_Page.h" | ||
397 | > | ||
398 | </File> | ||
399 | <File | ||
400 | RelativePath=".\Logitech_LCD\LCD.h" | ||
401 | > | ||
402 | </File> | ||
403 | <File | ||
404 | RelativePath=".\Logitech_LCD\lglcd.h" | ||
405 | > | ||
406 | </File> | ||
407 | </Filter> | ||
408 | <Filter | ||
409 | Name="Source Files" | ||
410 | > | ||
411 | <File | ||
412 | RelativePath=".\Logitech_LCD\EZ_LCD.cpp" | ||
413 | > | ||
414 | </File> | ||
415 | <File | ||
416 | RelativePath=".\Logitech_LCD\EZ_LCD_Page.cpp" | ||
417 | > | ||
418 | </File> | ||
419 | <File | ||
420 | RelativePath=".\Logitech_LCD\LCD.cpp" | ||
421 | > | ||
422 | </File> | ||
423 | </Filter> | ||
424 | <Filter | ||
425 | Name="SDK" | ||
426 | > | ||
427 | <Filter | ||
428 | Name="Header Files" | ||
429 | > | ||
430 | <File | ||
431 | RelativePath=".\Logitech_LCD\LCDUI\LCDAnimatedBitmap.h" | ||
432 | > | ||
433 | </File> | ||
434 | <File | ||
435 | RelativePath=".\Logitech_LCD\LCDUI\LCDBase.h" | ||
436 | > | ||
437 | </File> | ||
438 | <File | ||
439 | RelativePath=".\Logitech_LCD\LCDUI\LCDBitmap.h" | ||
440 | > | ||
441 | </File> | ||
442 | <File | ||
443 | RelativePath=".\Logitech_LCD\LCDUI\LCDCollection.h" | ||
444 | > | ||
445 | </File> | ||
446 | <File | ||
447 | RelativePath=".\Logitech_LCD\LCDUI\LCDGfx.h" | ||
448 | > | ||
449 | </File> | ||
450 | <File | ||
451 | RelativePath=".\Logitech_LCD\LCDUI\LCDIcon.h" | ||
452 | > | ||
453 | </File> | ||
454 | <File | ||
455 | RelativePath=".\Logitech_LCD\LCDUI\LCDManager.h" | ||
456 | > | ||
457 | </File> | ||
458 | <File | ||
459 | RelativePath=".\Logitech_LCD\LCDUI\LCDOutput.h" | ||
460 | > | ||
461 | </File> | ||
462 | <File | ||
463 | RelativePath=".\Logitech_LCD\LCDUI\LCDProgressBar.h" | ||
464 | > | ||
465 | </File> | ||
466 | <File | ||
467 | RelativePath=".\Logitech_LCD\LCDUI\LCDScrollingText.h" | ||
468 | > | ||
469 | </File> | ||
470 | <File | ||
471 | RelativePath=".\Logitech_LCD\LCDUI\LCDStreamingText.h" | ||
472 | > | ||
473 | </File> | ||
474 | <File | ||
475 | RelativePath=".\Logitech_LCD\LCDUI\LCDText.h" | ||
476 | > | ||
477 | </File> | ||
478 | </Filter> | ||
479 | <Filter | ||
480 | Name="Source Files" | ||
481 | > | ||
482 | <File | ||
483 | RelativePath=".\Logitech_LCD\LCDUI\LCDAnimatedBitmap.cpp" | ||
484 | > | ||
485 | </File> | ||
486 | <File | ||
487 | RelativePath=".\Logitech_LCD\LCDUI\LCDBase.cpp" | ||
488 | > | ||
489 | </File> | ||
490 | <File | ||
491 | RelativePath=".\Logitech_LCD\LCDUI\LCDBitmap.cpp" | ||
492 | > | ||
493 | </File> | ||
494 | <File | ||
495 | RelativePath=".\Logitech_LCD\LCDUI\LCDCollection.cpp" | ||
496 | > | ||
497 | </File> | ||
498 | <File | ||
499 | RelativePath=".\Logitech_LCD\LCDUI\LCDGfx.cpp" | ||
500 | > | ||
501 | </File> | ||
502 | <File | ||
503 | RelativePath=".\Logitech_LCD\LCDUI\LCDIcon.cpp" | ||
504 | > | ||
505 | </File> | ||
506 | <File | ||
507 | RelativePath=".\Logitech_LCD\LCDUI\LCDManager.cpp" | ||
508 | > | ||
509 | </File> | ||
510 | <File | ||
511 | RelativePath=".\Logitech_LCD\LCDUI\LCDOutput.cpp" | ||
512 | > | ||
513 | </File> | ||
514 | <File | ||
515 | RelativePath=".\Logitech_LCD\LCDUI\LCDProgressBar.cpp" | ||
516 | > | ||
517 | </File> | ||
518 | <File | ||
519 | RelativePath=".\Logitech_LCD\LCDUI\LCDScrollingText.cpp" | ||
520 | > | ||
521 | </File> | ||
522 | <File | ||
523 | RelativePath=".\Logitech_LCD\LCDUI\LCDStreamingText.cpp" | ||
524 | > | ||
525 | <FileConfiguration | ||
526 | Name="Debug|Win32" | ||
527 | > | ||
528 | <Tool | ||
529 | Name="VCCLCompilerTool" | ||
530 | WarningLevel="0" | ||
531 | /> | ||
532 | </FileConfiguration> | ||
533 | <FileConfiguration | ||
534 | Name="Release|Win32" | ||
535 | > | ||
536 | <Tool | ||
537 | Name="VCCLCompilerTool" | ||
538 | WarningLevel="0" | ||
539 | /> | ||
540 | </FileConfiguration> | ||
541 | <FileConfiguration | ||
542 | Name="DebugMesaHeadless|Win32" | ||
543 | > | ||
544 | <Tool | ||
545 | Name="VCCLCompilerTool" | ||
546 | WarningLevel="0" | ||
547 | /> | ||
548 | </FileConfiguration> | ||
549 | <FileConfiguration | ||
550 | Name="ReleaseNoOpt|Win32" | ||
551 | > | ||
552 | <Tool | ||
553 | Name="VCCLCompilerTool" | ||
554 | WarningLevel="0" | ||
555 | /> | ||
556 | </FileConfiguration> | ||
557 | </File> | ||
558 | <File | ||
559 | RelativePath=".\Logitech_LCD\LCDUI\LCDText.cpp" | ||
560 | > | ||
561 | <FileConfiguration | ||
562 | Name="Debug|Win32" | ||
563 | > | ||
564 | <Tool | ||
565 | Name="VCCLCompilerTool" | ||
566 | WarningLevel="0" | ||
567 | /> | ||
568 | </FileConfiguration> | ||
569 | <FileConfiguration | ||
570 | Name="Release|Win32" | ||
571 | > | ||
572 | <Tool | ||
573 | Name="VCCLCompilerTool" | ||
574 | WarningLevel="0" | ||
575 | /> | ||
576 | </FileConfiguration> | ||
577 | <FileConfiguration | ||
578 | Name="DebugMesaHeadless|Win32" | ||
579 | > | ||
580 | <Tool | ||
581 | Name="VCCLCompilerTool" | ||
582 | WarningLevel="0" | ||
583 | /> | ||
584 | </FileConfiguration> | ||
585 | <FileConfiguration | ||
586 | Name="ReleaseNoOpt|Win32" | ||
587 | > | ||
588 | <Tool | ||
589 | Name="VCCLCompilerTool" | ||
590 | WarningLevel="0" | ||
591 | /> | ||
592 | </FileConfiguration> | ||
593 | </File> | ||
594 | </Filter> | ||
595 | </Filter> | ||
596 | </Filter> | ||
389 | </Files> | 597 | </Files> |
390 | <Globals> | 598 | <Globals> |
391 | </Globals> | 599 | </Globals> |
diff --git a/linden/indra/llwindow/llwindowsdl.cpp b/linden/indra/llwindow/llwindowsdl.cpp index c375e32..f7b4071 100644 --- a/linden/indra/llwindow/llwindowsdl.cpp +++ b/linden/indra/llwindow/llwindowsdl.cpp | |||
@@ -1,6 +1,6 @@ | |||
1 | /** | 1 | /** |
2 | * @file llwindowsdl.cpp | 2 | * @file llwindowsdl.cpp |
3 | * @brief Platform-dependent implementation of llwindow | 3 | * @brief SDL implementation of LLWindow class |
4 | * | 4 | * |
5 | * Copyright (c) 2001-2007, Linden Research, Inc. | 5 | * Copyright (c) 2001-2007, Linden Research, Inc. |
6 | * | 6 | * |
@@ -55,12 +55,6 @@ | |||
55 | 55 | ||
56 | extern BOOL gDebugWindowProc; | 56 | extern BOOL gDebugWindowProc; |
57 | 57 | ||
58 | // culled from winuser.h | ||
59 | //const S32 WHEEL_DELTA = 120; /* Value for rolling one detent */ | ||
60 | // On the Mac, the scroll wheel reports a delta of 1 for each detent. | ||
61 | // There's also acceleration for faster scrolling, based on a slider in the system preferences. | ||
62 | const S32 WHEEL_DELTA = 1; /* Value for rolling one detent */ | ||
63 | const S32 BITS_PER_PIXEL = 32; | ||
64 | const S32 MAX_NUM_RESOLUTIONS = 32; | 58 | const S32 MAX_NUM_RESOLUTIONS = 32; |
65 | 59 | ||
66 | // | 60 | // |
@@ -74,37 +68,11 @@ const S32 MAX_NUM_RESOLUTIONS = 32; | |||
74 | // TOFU HACK -- (*exactly* the same hack as LLWindowMacOSX for a similar | 68 | // TOFU HACK -- (*exactly* the same hack as LLWindowMacOSX for a similar |
75 | // set of reasons): Stash a pointer to the LLWindowSDL object here and | 69 | // set of reasons): Stash a pointer to the LLWindowSDL object here and |
76 | // maintain in the constructor and destructor. This assumes that there will | 70 | // maintain in the constructor and destructor. This assumes that there will |
77 | // be only one object of this class at any time. Hopefully this is true. | 71 | // be only one object of this class at any time. Currently this is true. |
78 | static LLWindowSDL *gWindowImplementation = NULL; | 72 | static LLWindowSDL *gWindowImplementation = NULL; |
79 | 73 | ||
80 | static BOOL was_fullscreen = FALSE; | 74 | static BOOL was_fullscreen = FALSE; |
81 | 75 | ||
82 | // Cross-platform bits: | ||
83 | |||
84 | void show_window_creation_error(const char* title) | ||
85 | { | ||
86 | llwarns << title << llendl; | ||
87 | shell_open( "help/window_creation_error.html"); | ||
88 | /* | ||
89 | OSMessageBox( | ||
90 | "Second Life is unable to run because it can't set up your display.\n" | ||
91 | "We need to be able to make a 32-bit color window at 1024x768, with\n" | ||
92 | "an 8 bit alpha channel.\n" | ||
93 | "\n" | ||
94 | "First, be sure your monitor is set to True Color (32-bit) in\n" | ||
95 | "Start -> Control Panels -> Display -> Settings.\n" | ||
96 | "\n" | ||
97 | "Otherwise, this may be due to video card driver issues.\n" | ||
98 | "Please make sure you have the latest video card drivers installed.\n" | ||
99 | "ATI drivers are available at http://www.ati.com/\n" | ||
100 | "nVidia drivers are available at http://www.nvidia.com/\n" | ||
101 | "\n" | ||
102 | "If you continue to receive this message, contact customer service.", | ||
103 | title, | ||
104 | OSMB_OK); | ||
105 | */ | ||
106 | } | ||
107 | |||
108 | 76 | ||
109 | void maybe_lock_display(void) | 77 | void maybe_lock_display(void) |
110 | { | 78 | { |
@@ -275,7 +243,7 @@ LLWindowSDL::LLWindowSDL(char *title, S32 x, S32 y, S32 width, | |||
275 | #endif // LL_GTK | 243 | #endif // LL_GTK |
276 | 244 | ||
277 | // Get the original aspect ratio of the main device. | 245 | // Get the original aspect ratio of the main device. |
278 | mOriginalAspectRatio = 1024.0 / 768.0; // !!! FIXME //(double)CGDisplayPixelsWide(mDisplay) / (double)CGDisplayPixelsHigh(mDisplay); | 246 | mOriginalAspectRatio = 1024.0 / 768.0; // !!! *FIX: ? //(double)CGDisplayPixelsWide(mDisplay) / (double)CGDisplayPixelsHigh(mDisplay); |
279 | 247 | ||
280 | if (!title) | 248 | if (!title) |
281 | title = "SDL Window"; // *FIX: (???) | 249 | title = "SDL Window"; // *FIX: (???) |
@@ -325,6 +293,105 @@ static SDL_Surface *Load_BMP_Resource(const char *basename) | |||
325 | return SDL_LoadBMP(path_buffer); | 293 | return SDL_LoadBMP(path_buffer); |
326 | } | 294 | } |
327 | 295 | ||
296 | #if LL_X11 | ||
297 | // This is an XFree86/XOrg-specific hack for detecting the amount of Video RAM | ||
298 | // on this machine. It works by searching /var/log/var/log/Xorg.?.log or | ||
299 | // /var/log/XFree86.?.log for a ': VideoRAM: (%d+) kB' regex, where '?' is | ||
300 | // the X11 display number derived from $DISPLAY | ||
301 | static int x11_detect_VRAM_kb_fp(FILE *fp) | ||
302 | { | ||
303 | const int line_buf_size = 1000; | ||
304 | char line_buf[line_buf_size]; | ||
305 | while (fgets(line_buf, line_buf_size, fp)) | ||
306 | { | ||
307 | //lldebugs << "XLOG: " << line_buf << llendl; | ||
308 | |||
309 | // Why the ad-hoc parser instead of using a regex? Our | ||
310 | // favourite regex implementation - libboost_regex - is | ||
311 | // quite a heavy and troublesome dependency for the client, so | ||
312 | // it seems a shame to introduce it for such a simple task. | ||
313 | const char part1_template[] = ": VideoRAM: "; | ||
314 | const char part2_template[] = " kB"; | ||
315 | char *part1 = strstr(line_buf, part1_template); | ||
316 | if (part1) // found start of matching line | ||
317 | { | ||
318 | part1 = &part1[strlen(part1_template)]; // -> after | ||
319 | char *part2 = strstr(part1, part2_template); | ||
320 | if (part2) // found end of matching line | ||
321 | { | ||
322 | // now everything between part1 and part2 is | ||
323 | // supposed to be numeric, describing the | ||
324 | // number of kB of Video RAM supported | ||
325 | int rtn = 0; | ||
326 | for (; part1 < part2; ++part1) | ||
327 | { | ||
328 | //lldebugs << "kB" << *part1 << llendl; | ||
329 | if (*part1 < '0' || *part1 > '9') | ||
330 | { | ||
331 | // unexpected char, abort parse | ||
332 | rtn = 0; | ||
333 | break; | ||
334 | } | ||
335 | rtn *= 10; | ||
336 | rtn += (*part1) - '0'; | ||
337 | } | ||
338 | if (rtn > 0) | ||
339 | { | ||
340 | // got the kB number. return it now. | ||
341 | return rtn; | ||
342 | } | ||
343 | } | ||
344 | } | ||
345 | } | ||
346 | return 0; // 'could not detect' | ||
347 | } | ||
348 | static int x11_detect_VRAM_kb() | ||
349 | { | ||
350 | std::string x_log_location("/var/log/"); | ||
351 | std::string fname; | ||
352 | int rtn = 0; // 'could not detect' | ||
353 | int display_num = 0; | ||
354 | FILE *fp; | ||
355 | char *display_env = getenv("DISPLAY"); // e.g. :0 or :0.0 or :1.0 etc | ||
356 | // parse DISPLAY number so we can go grab the right log file | ||
357 | if (display_env[0] == ':' && | ||
358 | display_env[1] >= '0' && display_env[1] <= '9') | ||
359 | { | ||
360 | display_num = display_env[1] - '0'; | ||
361 | } | ||
362 | |||
363 | // *TODO: we could be smarter and see which of Xorg/XFree86 has the | ||
364 | // freshest time-stamp. | ||
365 | |||
366 | // Try XOrg log first | ||
367 | fname = x_log_location; | ||
368 | fname += "Xorg."; | ||
369 | fname += ('0' + display_num); | ||
370 | fname += ".log"; | ||
371 | fp = fopen(fname.c_str(), "r"); | ||
372 | if (fp) | ||
373 | { | ||
374 | rtn = x11_detect_VRAM_kb_fp(fp); | ||
375 | fclose(fp); | ||
376 | } | ||
377 | // Try old XFree86 log otherwise | ||
378 | if (rtn == 0) | ||
379 | { | ||
380 | fname = x_log_location; | ||
381 | fname += "XFree86."; | ||
382 | fname += ('0' + display_num); | ||
383 | fname += ".log"; | ||
384 | fp = fopen(fname.c_str(), "r"); | ||
385 | if (fp) | ||
386 | { | ||
387 | rtn = x11_detect_VRAM_kb_fp(fp); | ||
388 | fclose(fp); | ||
389 | } | ||
390 | } | ||
391 | return rtn; | ||
392 | } | ||
393 | #endif // LL_X11 | ||
394 | |||
328 | BOOL LLWindowSDL::createContext(int x, int y, int width, int height, int bits, BOOL fullscreen, BOOL disable_vsync) | 395 | BOOL LLWindowSDL::createContext(int x, int y, int width, int height, int bits, BOOL fullscreen, BOOL disable_vsync) |
329 | { | 396 | { |
330 | //bool glneedsinit = false; | 397 | //bool glneedsinit = false; |
@@ -511,67 +578,40 @@ BOOL LLWindowSDL::createContext(int x, int y, int width, int height, int bits, B | |||
511 | { | 578 | { |
512 | llinfos << "createContext: SKIPPING - !fullscreen, but +mWindow " << width << "x" << height << "x" << bits << llendl; | 579 | llinfos << "createContext: SKIPPING - !fullscreen, but +mWindow " << width << "x" << height << "x" << bits << llendl; |
513 | } | 580 | } |
514 | 581 | ||
515 | /*if (!load_all_glsyms(gllibname)) | 582 | // Detect video memory size. |
516 | { | 583 | # if LL_X11 |
517 | SDL_QuitSubSystem(SDL_INIT_VIDEO); | 584 | gGLManager.mVRAM = x11_detect_VRAM_kb() / 1024; |
518 | return FALSE; | ||
519 | }*/ | ||
520 | |||
521 | gGLManager.mVRAM = videoInfo->video_mem / 1024; | ||
522 | if (gGLManager.mVRAM != 0) | 585 | if (gGLManager.mVRAM != 0) |
523 | { | 586 | { |
524 | llinfos << "Detected " << gGLManager.mVRAM << "MB VRAM." << llendl; | 587 | llinfos << "X11 log-parser detected " << gGLManager.mVRAM << "MB VRAM." << llendl; |
525 | } | 588 | } else |
526 | // If VRAM is not detected, that is handled later | 589 | # endif // LL_X11 |
527 | 590 | { | |
528 | #if 0 // *FIX: all video cards suck under Linux. :) | 591 | // fallback to letting SDL detect VRAM. |
529 | // Since we just created the context, it needs to be set up. | 592 | // note: I've not seen SDL's detection ever actually find |
530 | glNeedsInit = TRUE; | 593 | // VRAM != 0, but if SDL *does* detect it then that's a bonus. |
531 | if(glNeedsInit) | 594 | gGLManager.mVRAM = videoInfo->video_mem / 1024; |
532 | { | 595 | if (gGLManager.mVRAM != 0) |
533 | // Check for some explicitly unsupported cards. | ||
534 | const char* RENDERER = (const char*) glGetString(GL_RENDERER); | ||
535 | |||
536 | const char* CARD_LIST[] = | ||
537 | { "RAGE 128", | ||
538 | "RIVA TNT2", | ||
539 | "Intel 810", | ||
540 | "3Dfx/Voodoo3", | ||
541 | "Radeon 7000", | ||
542 | "Radeon 7200", | ||
543 | "Radeon 7500", | ||
544 | "Radeon DDR", | ||
545 | "Radeon VE", | ||
546 | "GDI Generic" }; | ||
547 | const S32 CARD_COUNT = sizeof(CARD_LIST)/sizeof(char*); | ||
548 | |||
549 | // Future candidates: | ||
550 | // ProSavage/Twister | ||
551 | // SuperSavage | ||
552 | |||
553 | S32 i; | ||
554 | for (i = 0; i < CARD_COUNT; i++) | ||
555 | { | 596 | { |
556 | if (check_for_card(RENDERER, CARD_LIST[i])) | 597 | llinfos << "SDL detected " << gGLManager.mVRAM << "MB VRAM." << llendl; |
557 | { | ||
558 | close(); | ||
559 | shell_open( "help/unsupported_card.html" ); | ||
560 | return FALSE; | ||
561 | } | ||
562 | } | 598 | } |
563 | } | 599 | } |
564 | #endif | 600 | // If VRAM is not detected, that is handled later |
565 | 601 | ||
566 | GLint depthBits, stencilBits, redBits, greenBits, blueBits, alphaBits; | 602 | // *TODO: Now would be an appropriate time to check for some |
603 | // explicitly unsupported cards. | ||
604 | //const char* RENDERER = (const char*) glGetString(GL_RENDERER); | ||
567 | 605 | ||
568 | glGetIntegerv(GL_RED_BITS, &redBits); | 606 | GLint depthBits, stencilBits, redBits, greenBits, blueBits, alphaBits; |
569 | glGetIntegerv(GL_GREEN_BITS, &greenBits); | ||
570 | glGetIntegerv(GL_BLUE_BITS, &blueBits); | ||
571 | glGetIntegerv(GL_ALPHA_BITS, &alphaBits); | ||
572 | glGetIntegerv(GL_DEPTH_BITS, &depthBits); | ||
573 | glGetIntegerv(GL_STENCIL_BITS, &stencilBits); | ||
574 | 607 | ||
608 | glGetIntegerv(GL_RED_BITS, &redBits); | ||
609 | glGetIntegerv(GL_GREEN_BITS, &greenBits); | ||
610 | glGetIntegerv(GL_BLUE_BITS, &blueBits); | ||
611 | glGetIntegerv(GL_ALPHA_BITS, &alphaBits); | ||
612 | glGetIntegerv(GL_DEPTH_BITS, &depthBits); | ||
613 | glGetIntegerv(GL_STENCIL_BITS, &stencilBits); | ||
614 | |||
575 | llinfos << "GL buffer:" << llendl | 615 | llinfos << "GL buffer:" << llendl |
576 | llinfos << " Red Bits " << S32(redBits) << llendl | 616 | llinfos << " Red Bits " << S32(redBits) << llendl |
577 | llinfos << " Green Bits " << S32(greenBits) << llendl | 617 | llinfos << " Green Bits " << S32(greenBits) << llendl |
@@ -1022,7 +1062,9 @@ void LLWindowSDL::beforeDialog() | |||
1022 | { | 1062 | { |
1023 | // Everything that we/SDL asked for should happen before we | 1063 | // Everything that we/SDL asked for should happen before we |
1024 | // potentially hand control over to GTK. | 1064 | // potentially hand control over to GTK. |
1065 | maybe_lock_display(); | ||
1025 | XSync(mSDL_Display, False); | 1066 | XSync(mSDL_Display, False); |
1067 | maybe_unlock_display(); | ||
1026 | } | 1068 | } |
1027 | #endif // LL_X11 | 1069 | #endif // LL_X11 |
1028 | 1070 | ||
@@ -1066,6 +1108,7 @@ void LLWindowSDL::x11_set_urgent(BOOL urgent) | |||
1066 | 1108 | ||
1067 | llinfos << "X11 hint for urgency, " << urgent << llendl; | 1109 | llinfos << "X11 hint for urgency, " << urgent << llendl; |
1068 | 1110 | ||
1111 | maybe_lock_display(); | ||
1069 | wm_hints = XGetWMHints(mSDL_Display, mSDL_XWindowID); | 1112 | wm_hints = XGetWMHints(mSDL_Display, mSDL_XWindowID); |
1070 | if (!wm_hints) | 1113 | if (!wm_hints) |
1071 | wm_hints = XAllocWMHints(); | 1114 | wm_hints = XAllocWMHints(); |
@@ -1078,6 +1121,7 @@ void LLWindowSDL::x11_set_urgent(BOOL urgent) | |||
1078 | XSetWMHints(mSDL_Display, mSDL_XWindowID, wm_hints); | 1121 | XSetWMHints(mSDL_Display, mSDL_XWindowID, wm_hints); |
1079 | XFree(wm_hints); | 1122 | XFree(wm_hints); |
1080 | XSync(mSDL_Display, False); | 1123 | XSync(mSDL_Display, False); |
1124 | maybe_unlock_display(); | ||
1081 | } | 1125 | } |
1082 | } | 1126 | } |
1083 | #endif // LL_X11 | 1127 | #endif // LL_X11 |
@@ -1782,10 +1826,12 @@ BOOL LLWindowSDL::SDLReallyCaptureInput(BOOL capture) | |||
1782 | { | 1826 | { |
1783 | //llinfos << "X11 POINTER GRABBY" << llendl; | 1827 | //llinfos << "X11 POINTER GRABBY" << llendl; |
1784 | //newmode = SDL_WM_GrabInput(wantmode); | 1828 | //newmode = SDL_WM_GrabInput(wantmode); |
1829 | maybe_lock_display(); | ||
1785 | result = XGrabPointer(mSDL_Display, mSDL_XWindowID, | 1830 | result = XGrabPointer(mSDL_Display, mSDL_XWindowID, |
1786 | True, 0, GrabModeAsync, | 1831 | True, 0, GrabModeAsync, |
1787 | GrabModeAsync, | 1832 | GrabModeAsync, |
1788 | None, None, CurrentTime); | 1833 | None, None, CurrentTime); |
1834 | maybe_unlock_display(); | ||
1789 | if (GrabSuccess == result) | 1835 | if (GrabSuccess == result) |
1790 | newmode = SDL_GRAB_ON; | 1836 | newmode = SDL_GRAB_ON; |
1791 | else | 1837 | else |
@@ -1795,10 +1841,12 @@ BOOL LLWindowSDL::SDLReallyCaptureInput(BOOL capture) | |||
1795 | //llinfos << "X11 POINTER UNGRABBY" << llendl; | 1841 | //llinfos << "X11 POINTER UNGRABBY" << llendl; |
1796 | newmode = SDL_GRAB_OFF; | 1842 | newmode = SDL_GRAB_OFF; |
1797 | //newmode = SDL_WM_GrabInput(SDL_GRAB_OFF); | 1843 | //newmode = SDL_WM_GrabInput(SDL_GRAB_OFF); |
1798 | 1844 | ||
1845 | maybe_lock_display(); | ||
1799 | XUngrabPointer(mSDL_Display, CurrentTime); | 1846 | XUngrabPointer(mSDL_Display, CurrentTime); |
1800 | // Make sure the ungrab happens RIGHT NOW. | 1847 | // Make sure the ungrab happens RIGHT NOW. |
1801 | XSync(mSDL_Display, False); | 1848 | XSync(mSDL_Display, False); |
1849 | maybe_unlock_display(); | ||
1802 | } else | 1850 | } else |
1803 | { | 1851 | { |
1804 | newmode = SDL_GRAB_QUERY; // neutral | 1852 | newmode = SDL_GRAB_QUERY; // neutral |
@@ -1875,7 +1923,7 @@ void LLWindowSDL::gatherInput() | |||
1875 | std::string saved_locale = setlocale(LC_ALL, NULL); | 1923 | std::string saved_locale = setlocale(LC_ALL, NULL); |
1876 | 1924 | ||
1877 | // Do a limited number of pumps so SL doesn't starve! | 1925 | // Do a limited number of pumps so SL doesn't starve! |
1878 | // FIXME - this should ideally be time-limited, not count-limited. | 1926 | // *TODO: this should ideally be time-limited, not count-limited. |
1879 | gtk_main_iteration_do(0); // Always do one non-blocking pump | 1927 | gtk_main_iteration_do(0); // Always do one non-blocking pump |
1880 | for (int iter=0; iter<10; ++iter) | 1928 | for (int iter=0; iter<10; ++iter) |
1881 | if (gtk_events_pending()) | 1929 | if (gtk_events_pending()) |
@@ -2101,8 +2149,8 @@ static SDL_Cursor *makeSDLCursorFromBMP(const char *filename, int hotx, int hoty | |||
2101 | if (bmpsurface && bmpsurface->w%8==0) | 2149 | if (bmpsurface && bmpsurface->w%8==0) |
2102 | { | 2150 | { |
2103 | SDL_Surface *cursurface; | 2151 | SDL_Surface *cursurface; |
2104 | llinfos << "Loaded cursor file " << filename << " " | 2152 | lldebugs << "Loaded cursor file " << filename << " " |
2105 | << bmpsurface->w << "x" << bmpsurface->h << llendl; | 2153 | << bmpsurface->w << "x" << bmpsurface->h << llendl; |
2106 | cursurface = SDL_CreateRGBSurface (SDL_SWSURFACE, | 2154 | cursurface = SDL_CreateRGBSurface (SDL_SWSURFACE, |
2107 | bmpsurface->w, | 2155 | bmpsurface->w, |
2108 | bmpsurface->h, | 2156 | bmpsurface->h, |
@@ -2282,14 +2330,14 @@ void LLWindowSDL::hideCursor() | |||
2282 | { | 2330 | { |
2283 | if(!mCursorHidden) | 2331 | if(!mCursorHidden) |
2284 | { | 2332 | { |
2285 | // llinfos << "hideCursor: hiding" << llendl; | 2333 | // llinfos << "hideCursor: hiding" << llendl; |
2286 | mCursorHidden = TRUE; | 2334 | mCursorHidden = TRUE; |
2287 | mHideCursorPermanent = TRUE; | 2335 | mHideCursorPermanent = TRUE; |
2288 | SDL_ShowCursor(0); | 2336 | SDL_ShowCursor(0); |
2289 | } | 2337 | } |
2290 | else | 2338 | else |
2291 | { | 2339 | { |
2292 | // llinfos << "hideCursor: already hidden" << llendl; | 2340 | // llinfos << "hideCursor: already hidden" << llendl; |
2293 | } | 2341 | } |
2294 | 2342 | ||
2295 | adjustCursorDecouple(); | 2343 | adjustCursorDecouple(); |
@@ -2299,14 +2347,14 @@ void LLWindowSDL::showCursor() | |||
2299 | { | 2347 | { |
2300 | if(mCursorHidden) | 2348 | if(mCursorHidden) |
2301 | { | 2349 | { |
2302 | // llinfos << "showCursor: showing" << llendl; | 2350 | // llinfos << "showCursor: showing" << llendl; |
2303 | mCursorHidden = FALSE; | 2351 | mCursorHidden = FALSE; |
2304 | mHideCursorPermanent = FALSE; | 2352 | mHideCursorPermanent = FALSE; |
2305 | SDL_ShowCursor(1); | 2353 | SDL_ShowCursor(1); |
2306 | } | 2354 | } |
2307 | else | 2355 | else |
2308 | { | 2356 | { |
2309 | // llinfos << "showCursor: already visible" << llendl; | 2357 | // llinfos << "showCursor: already visible" << llendl; |
2310 | } | 2358 | } |
2311 | 2359 | ||
2312 | adjustCursorDecouple(); | 2360 | adjustCursorDecouple(); |
@@ -2332,7 +2380,8 @@ void LLWindowSDL::hideCursorUntilMouseMove() | |||
2332 | 2380 | ||
2333 | 2381 | ||
2334 | // | 2382 | // |
2335 | // LLSplashScreenSDL | 2383 | // LLSplashScreenSDL - I don't think we'll bother to implement this; it's |
2384 | // fairly obsolete at this point. | ||
2336 | // | 2385 | // |
2337 | LLSplashScreenSDL::LLSplashScreenSDL() | 2386 | LLSplashScreenSDL::LLSplashScreenSDL() |
2338 | { | 2387 | { |
@@ -2350,7 +2399,6 @@ void LLSplashScreenSDL::updateImpl(const char* mesg) | |||
2350 | { | 2399 | { |
2351 | } | 2400 | } |
2352 | 2401 | ||
2353 | |||
2354 | void LLSplashScreenSDL::hideImpl() | 2402 | void LLSplashScreenSDL::hideImpl() |
2355 | { | 2403 | { |
2356 | } | 2404 | } |
@@ -2438,7 +2486,7 @@ S32 OSMessageBoxSDL(const char* text, const char* caption, U32 type) | |||
2438 | G_CALLBACK (response_callback), | 2486 | G_CALLBACK (response_callback), |
2439 | &response); | 2487 | &response); |
2440 | 2488 | ||
2441 | // we should be able to us a gtk_dialog_run(), but it's | 2489 | // we should be able to use a gtk_dialog_run(), but it's |
2442 | // apparently not written to exist in a world without a higher | 2490 | // apparently not written to exist in a world without a higher |
2443 | // gtk_main(), so we manage its signal/destruction outselves. | 2491 | // gtk_main(), so we manage its signal/destruction outselves. |
2444 | gtk_widget_show_all (win); | 2492 | gtk_widget_show_all (win); |
@@ -2460,7 +2508,7 @@ S32 OSMessageBoxSDL(const char* text, const char* caption, U32 type) | |||
2460 | } | 2508 | } |
2461 | else | 2509 | else |
2462 | { | 2510 | { |
2463 | fprintf(stderr, "MSGBOX: %s: %s\n", caption, text); | 2511 | llinfos << "MSGBOX: " << caption << ": " << text << llendl; |
2464 | llinfos << "Skipping dialog because we're in fullscreen mode or GTK is not happy." << llendl; | 2512 | llinfos << "Skipping dialog because we're in fullscreen mode or GTK is not happy." << llendl; |
2465 | rtn = OSBTN_OK; | 2513 | rtn = OSBTN_OK; |
2466 | } | 2514 | } |
@@ -2556,7 +2604,7 @@ BOOL LLWindowSDL::dialog_color_picker ( F32 *r, F32 *g, F32 *b) | |||
2556 | #else | 2604 | #else |
2557 | S32 OSMessageBoxSDL(const char* text, const char* caption, U32 type) | 2605 | S32 OSMessageBoxSDL(const char* text, const char* caption, U32 type) |
2558 | { | 2606 | { |
2559 | fprintf(stderr, "MSGBOX: %s: %s\n", caption, text); | 2607 | llinfos << "MSGBOX: " << caption << ": " << text << llendl; |
2560 | return 0; | 2608 | return 0; |
2561 | } | 2609 | } |
2562 | 2610 | ||
@@ -2573,11 +2621,15 @@ void spawn_web_browser(const char* escaped_url) | |||
2573 | llinfos << "spawn_web_browser: " << escaped_url << llendl; | 2621 | llinfos << "spawn_web_browser: " << escaped_url << llendl; |
2574 | 2622 | ||
2575 | #if LL_LINUX | 2623 | #if LL_LINUX |
2576 | # if LL_X11 | 2624 | # if LL_X11 |
2577 | if (gWindowImplementation && | 2625 | if (gWindowImplementation && gWindowImplementation->mSDL_Display) |
2578 | gWindowImplementation->mSDL_Display) // Just in case - before forking. | 2626 | { |
2627 | maybe_lock_display(); | ||
2628 | // Just in case - before forking. | ||
2579 | XSync(gWindowImplementation->mSDL_Display, False); | 2629 | XSync(gWindowImplementation->mSDL_Display, False); |
2580 | # endif // LL_X11 | 2630 | maybe_unlock_display(); |
2631 | } | ||
2632 | # endif // LL_X11 | ||
2581 | 2633 | ||
2582 | std::string cmd; | 2634 | std::string cmd; |
2583 | cmd = gDirUtilp->getAppRODataDir().c_str(); | 2635 | cmd = gDirUtilp->getAppRODataDir().c_str(); |
@@ -2615,8 +2667,8 @@ void spawn_web_browser(const char* escaped_url) | |||
2615 | 2667 | ||
2616 | void shell_open( const char* file_path ) | 2668 | void shell_open( const char* file_path ) |
2617 | { | 2669 | { |
2618 | // *FIX: (???) | 2670 | // *TODO: This function is deprecated and should probably go away. |
2619 | fprintf(stderr, "shell_open: %s\n", file_path); | 2671 | llwarns << "Deprecated shell_open(): " << file_path << llendl; |
2620 | } | 2672 | } |
2621 | 2673 | ||
2622 | void *LLWindowSDL::getPlatformWindow() | 2674 | void *LLWindowSDL::getPlatformWindow() |
@@ -2624,18 +2676,14 @@ void *LLWindowSDL::getPlatformWindow() | |||
2624 | #if LL_GTK && LL_LIBXUL_ENABLED | 2676 | #if LL_GTK && LL_LIBXUL_ENABLED |
2625 | if (ll_try_gtk_init()) | 2677 | if (ll_try_gtk_init()) |
2626 | { | 2678 | { |
2679 | maybe_lock_display(); | ||
2627 | GtkWidget *win = gtk_window_new(GTK_WINDOW_TOPLEVEL); | 2680 | GtkWidget *win = gtk_window_new(GTK_WINDOW_TOPLEVEL); |
2628 | 2681 | ||
2629 | // These hacks were attempts to get Gecko to see the keyboard, | ||
2630 | // but I think they're doomed to fail. | ||
2631 | //GdkWindow *gdkwin = gdk_window_foreign_new(SDL_XWindowID); | ||
2632 | //GTK_WIDGET(win)->window = gdkwin; | ||
2633 | //gtk_widget_set_parent_window(win, gdkwin); | ||
2634 | |||
2635 | // show the hidden-widget while debugging (needs mozlib change) | 2682 | // show the hidden-widget while debugging (needs mozlib change) |
2636 | //gtk_widget_show_all(GTK_WIDGET(win)); | 2683 | //gtk_widget_show_all(GTK_WIDGET(win)); |
2637 | 2684 | ||
2638 | gtk_widget_realize(GTK_WIDGET(win)); | 2685 | gtk_widget_realize(GTK_WIDGET(win)); |
2686 | maybe_unlock_display(); | ||
2639 | return win; | 2687 | return win; |
2640 | } | 2688 | } |
2641 | #endif // LL_GTK && LL_LIBXUL_ENABLED | 2689 | #endif // LL_GTK && LL_LIBXUL_ENABLED |
@@ -2645,8 +2693,18 @@ void *LLWindowSDL::getPlatformWindow() | |||
2645 | 2693 | ||
2646 | void LLWindowSDL::bringToFront() | 2694 | void LLWindowSDL::bringToFront() |
2647 | { | 2695 | { |
2648 | // *FIX: (???) | 2696 | // This is currently used when we are 'launched' to a specific |
2649 | fprintf(stderr, "bringToFront\n"); | 2697 | // map position externally. |
2698 | llinfos << "bringToFront" << llendl; | ||
2699 | #if LL_X11 | ||
2700 | if (mSDL_Display && !mFullscreen) | ||
2701 | { | ||
2702 | maybe_lock_display(); | ||
2703 | XRaiseWindow(mSDL_Display, mSDL_XWindowID); | ||
2704 | XSync(mSDL_Display, False); | ||
2705 | maybe_unlock_display(); | ||
2706 | } | ||
2707 | #endif // LL_X11 | ||
2650 | } | 2708 | } |
2651 | 2709 | ||
2652 | #endif // LL_SDL | 2710 | #endif // LL_SDL |
diff --git a/linden/indra/llwindow/llwindowwin32.cpp b/linden/indra/llwindow/llwindowwin32.cpp index 7c3ec01..3c2e730 100644 --- a/linden/indra/llwindow/llwindowwin32.cpp +++ b/linden/indra/llwindow/llwindowwin32.cpp | |||
@@ -54,8 +54,12 @@ | |||
54 | #include "indra_constants.h" | 54 | #include "indra_constants.h" |
55 | 55 | ||
56 | // culled from winuser.h | 56 | // culled from winuser.h |
57 | #ifndef WM_MOUSEWHEEL /* Added to be compatible with later SDK's */ | ||
57 | const S32 WM_MOUSEWHEEL = 0x020A; | 58 | const S32 WM_MOUSEWHEEL = 0x020A; |
59 | #endif | ||
60 | #ifndef WHEEL_DELTA /* Added to be compatible with later SDK's */ | ||
58 | const S32 WHEEL_DELTA = 120; /* Value for rolling one detent */ | 61 | const S32 WHEEL_DELTA = 120; /* Value for rolling one detent */ |
62 | #endif | ||
59 | const S32 MAX_MESSAGE_PER_UPDATE = 20; | 63 | const S32 MAX_MESSAGE_PER_UPDATE = 20; |
60 | const S32 BITS_PER_PIXEL = 32; | 64 | const S32 BITS_PER_PIXEL = 32; |
61 | const S32 MAX_NUM_RESOLUTIONS = 32; | 65 | const S32 MAX_NUM_RESOLUTIONS = 32; |
@@ -1646,7 +1650,7 @@ void LLWindowWin32::setCursor(ECursorType cursor) | |||
1646 | } | 1650 | } |
1647 | } | 1651 | } |
1648 | 1652 | ||
1649 | ECursorType LLWindowWin32::getCursor() | 1653 | ECursorType LLWindowWin32::getCursor() const |
1650 | { | 1654 | { |
1651 | return mCurrentCursor; | 1655 | return mCurrentCursor; |
1652 | } | 1656 | } |
@@ -2299,7 +2303,7 @@ BOOL LLWindowWin32::convertCoords(LLCoordGL from, LLCoordScreen *to) | |||
2299 | 2303 | ||
2300 | BOOL LLWindowWin32::isClipboardTextAvailable() | 2304 | BOOL LLWindowWin32::isClipboardTextAvailable() |
2301 | { | 2305 | { |
2302 | return IsClipboardFormatAvailable(CF_UNICODETEXT) || IsClipboardFormatAvailable( CF_TEXT ); | 2306 | return IsClipboardFormatAvailable(CF_UNICODETEXT); |
2303 | } | 2307 | } |
2304 | 2308 | ||
2305 | 2309 | ||
@@ -2326,27 +2330,6 @@ BOOL LLWindowWin32::pasteTextFromClipboard(LLWString &dst) | |||
2326 | CloseClipboard(); | 2330 | CloseClipboard(); |
2327 | } | 2331 | } |
2328 | } | 2332 | } |
2329 | else if (IsClipboardFormatAvailable(CF_TEXT)) | ||
2330 | { | ||
2331 | // This must be an OLD OS. We don't do non-ASCII for old OSes | ||
2332 | if (OpenClipboard(mWindowHandle)) | ||
2333 | { | ||
2334 | HGLOBAL h_data = GetClipboardData(CF_TEXT); | ||
2335 | if (h_data) | ||
2336 | { | ||
2337 | char* str = (char*) GlobalLock(h_data); | ||
2338 | if (str) | ||
2339 | { | ||
2340 | // Strip non-ASCII characters | ||
2341 | dst = utf8str_to_wstring(mbcsstring_makeASCII(str)); | ||
2342 | LLWString::removeCRLF(dst); | ||
2343 | GlobalUnlock(h_data); | ||
2344 | success = TRUE; | ||
2345 | } | ||
2346 | } | ||
2347 | CloseClipboard(); | ||
2348 | } | ||
2349 | } | ||
2350 | 2333 | ||
2351 | return success; | 2334 | return success; |
2352 | } | 2335 | } |
@@ -2383,30 +2366,6 @@ BOOL LLWindowWin32::copyTextToClipboard(const LLWString& wstr) | |||
2383 | } | 2366 | } |
2384 | } | 2367 | } |
2385 | 2368 | ||
2386 | // Also provide a copy as raw ASCII text. | ||
2387 | LLWString ascii_string(wstr); | ||
2388 | LLWString::_makeASCII(ascii_string); | ||
2389 | LLWString::addCRLF(ascii_string); | ||
2390 | std::string out_s = wstring_to_utf8str(ascii_string); | ||
2391 | const size_t size = (out_s.length() + 1) * sizeof(char); | ||
2392 | |||
2393 | // Memory is allocated and then ownership of it is transfered to the system. | ||
2394 | HGLOBAL hglobal_copy = GlobalAlloc(GMEM_MOVEABLE, size); | ||
2395 | if (hglobal_copy) | ||
2396 | { | ||
2397 | char* copy = (char*) GlobalLock(hglobal_copy); | ||
2398 | if( copy ) | ||
2399 | { | ||
2400 | memcpy(copy, out_s.c_str(), size); /* Flawfinder: ignore */ | ||
2401 | GlobalUnlock(hglobal_copy); | ||
2402 | |||
2403 | if (SetClipboardData(CF_TEXT, hglobal_copy)) | ||
2404 | { | ||
2405 | success = TRUE; | ||
2406 | } | ||
2407 | } | ||
2408 | } | ||
2409 | |||
2410 | CloseClipboard(); | 2369 | CloseClipboard(); |
2411 | } | 2370 | } |
2412 | 2371 | ||
diff --git a/linden/indra/llwindow/llwindowwin32.h b/linden/indra/llwindow/llwindowwin32.h index 040c9ab..691c648 100644 --- a/linden/indra/llwindow/llwindowwin32.h +++ b/linden/indra/llwindow/llwindowwin32.h | |||
@@ -65,7 +65,7 @@ public: | |||
65 | /*virtual*/ void hideCursorUntilMouseMove(); | 65 | /*virtual*/ void hideCursorUntilMouseMove(); |
66 | /*virtual*/ BOOL isCursorHidden(); | 66 | /*virtual*/ BOOL isCursorHidden(); |
67 | /*virtual*/ void setCursor(ECursorType cursor); | 67 | /*virtual*/ void setCursor(ECursorType cursor); |
68 | /*virtual*/ ECursorType getCursor(); | 68 | /*virtual*/ ECursorType getCursor() const; |
69 | /*virtual*/ void captureMouse(); | 69 | /*virtual*/ void captureMouse(); |
70 | /*virtual*/ void releaseMouse(); | 70 | /*virtual*/ void releaseMouse(); |
71 | /*virtual*/ void setMouseClipping( BOOL b ); | 71 | /*virtual*/ void setMouseClipping( BOOL b ); |
diff --git a/linden/indra/llxml/llxmlnode.cpp b/linden/indra/llxml/llxmlnode.cpp index eb48b41..b83555a 100644 --- a/linden/indra/llxml/llxmlnode.cpp +++ b/linden/indra/llxml/llxmlnode.cpp | |||
@@ -311,6 +311,12 @@ void XMLCALL StartXMLNode(void *userData, | |||
311 | // Set the parent-child relationship with the current active node | 311 | // Set the parent-child relationship with the current active node |
312 | LLXMLNode* parent = (LLXMLNode *)userData; | 312 | LLXMLNode* parent = (LLXMLNode *)userData; |
313 | 313 | ||
314 | if (NULL == parent) | ||
315 | { | ||
316 | llwarns << "parent (userData) is NULL; aborting function" << llendl; | ||
317 | return; | ||
318 | } | ||
319 | |||
314 | new_node_ptr->mParser = parent->mParser; | 320 | new_node_ptr->mParser = parent->mParser; |
315 | 321 | ||
316 | // Set the current active node to the new node | 322 | // Set the current active node to the new node |
diff --git a/linden/indra/lscript/lscript_alloc.h b/linden/indra/lscript/lscript_alloc.h index b195e3a..8179446 100644 --- a/linden/indra/lscript/lscript_alloc.h +++ b/linden/indra/lscript/lscript_alloc.h | |||
@@ -287,7 +287,9 @@ inline LLScriptLibData *lsa_bubble_sort(LLScriptLibData *src, S32 stride, S32 as | |||
287 | 287 | ||
288 | src->mListp = NULL; | 288 | src->mListp = NULL; |
289 | 289 | ||
290 | return sortarray[0]; | 290 | temp = sortarray[0]; |
291 | delete[] sortarray; | ||
292 | return temp; | ||
291 | } | 293 | } |
292 | 294 | ||
293 | 295 | ||
diff --git a/linden/indra/lscript/lscript_compile/lscript_tree.cpp b/linden/indra/lscript/lscript_compile/lscript_tree.cpp index 1d7cc7b..df679ed 100644 --- a/linden/indra/lscript/lscript_compile/lscript_tree.cpp +++ b/linden/indra/lscript/lscript_compile/lscript_tree.cpp | |||
@@ -9936,6 +9936,8 @@ void LLScriptScript::recurse(FILE *fp, S32 tabs, S32 tabsize, LSCRIPTCompilePass | |||
9936 | 9936 | ||
9937 | code->build(fp, bcfp); | 9937 | code->build(fp, bcfp); |
9938 | fclose(bcfp); | 9938 | fclose(bcfp); |
9939 | |||
9940 | delete code; | ||
9939 | } | 9941 | } |
9940 | break; | 9942 | break; |
9941 | case LSCP_EMIT_CIL_ASSEMBLY: | 9943 | case LSCP_EMIT_CIL_ASSEMBLY: |
diff --git a/linden/indra/lscript/lscript_execute/lscript_execute.cpp b/linden/indra/lscript/lscript_execute/lscript_execute.cpp index cc2c141..4d8389a 100644 --- a/linden/indra/lscript/lscript_execute/lscript_execute.cpp +++ b/linden/indra/lscript/lscript_execute/lscript_execute.cpp | |||
@@ -1,4 +1,4 @@ | |||
1 | /** | 1 | /** |
2 | * @file lscript_execute.cpp | 2 | * @file lscript_execute.cpp |
3 | * @brief classes to execute bytecode | 3 | * @brief classes to execute bytecode |
4 | * | 4 | * |
@@ -75,7 +75,7 @@ LLScriptExecute::LLScriptExecute(FILE *fp) | |||
75 | 75 | ||
76 | LLScriptExecute::LLScriptExecute(U8 *buffer) | 76 | LLScriptExecute::LLScriptExecute(U8 *buffer) |
77 | { | 77 | { |
78 | mBuffer = buffer; | 78 | mBuffer = buffer; |
79 | 79 | ||
80 | init(); | 80 | init(); |
81 | } | 81 | } |
@@ -1001,7 +1001,7 @@ BOOL run_loadgsp(U8 *buffer, S32 &offset, BOOL b_print, const LLUUID &id) | |||
1001 | S32 address = lscript_global_get(buffer, arg); | 1001 | S32 address = lscript_global_get(buffer, arg); |
1002 | if (address) | 1002 | if (address) |
1003 | lsa_decrease_ref_count(buffer, address); | 1003 | lsa_decrease_ref_count(buffer, address); |
1004 | 1004 | ||
1005 | lscript_global_store(buffer, arg, value); | 1005 | lscript_global_store(buffer, arg, value); |
1006 | return FALSE; | 1006 | return FALSE; |
1007 | } | 1007 | } |
@@ -1019,7 +1019,7 @@ BOOL run_loadglp(U8 *buffer, S32 &offset, BOOL b_print, const LLUUID &id) | |||
1019 | S32 address = lscript_global_get(buffer, arg); | 1019 | S32 address = lscript_global_get(buffer, arg); |
1020 | if (address) | 1020 | if (address) |
1021 | lsa_decrease_ref_count(buffer, address); | 1021 | lsa_decrease_ref_count(buffer, address); |
1022 | 1022 | ||
1023 | lscript_global_store(buffer, arg, value); | 1023 | lscript_global_store(buffer, arg, value); |
1024 | return FALSE; | 1024 | return FALSE; |
1025 | } | 1025 | } |
@@ -1386,14 +1386,31 @@ void integer_integer_operation(U8 *buffer, LSCRIPTOpCodesEnum opcode) | |||
1386 | result = lside * rside; | 1386 | result = lside * rside; |
1387 | break; | 1387 | break; |
1388 | case LOPC_DIV: | 1388 | case LOPC_DIV: |
1389 | if (rside) | 1389 | if (rside){ |
1390 | result = lside / rside; | 1390 | if( ( rside == -1 ) || ( rside == 0xffffffff ) )// division by -1 can have funny results: multiplication is OK: SL-31252 |
1391 | { | ||
1392 | result = -1 * lside; | ||
1393 | } | ||
1394 | else | ||
1395 | { | ||
1396 | result = lside / rside; | ||
1397 | } | ||
1398 | } | ||
1391 | else | 1399 | else |
1392 | set_fault(buffer, LSRF_MATH); | 1400 | set_fault(buffer, LSRF_MATH); |
1393 | break; | 1401 | break; |
1394 | case LOPC_MOD: | 1402 | case LOPC_MOD: |
1395 | if (rside) | 1403 | if (rside) |
1396 | result = lside % rside; | 1404 | { |
1405 | if (rside == -1 || rside == 1 ) // mod(1) = mod(-1) = 0: SL-31252 | ||
1406 | { | ||
1407 | result = 0; | ||
1408 | } | ||
1409 | else | ||
1410 | { | ||
1411 | result = lside % rside; | ||
1412 | } | ||
1413 | } | ||
1397 | else | 1414 | else |
1398 | set_fault(buffer, LSRF_MATH); | 1415 | set_fault(buffer, LSRF_MATH); |
1399 | break; | 1416 | break; |
@@ -2945,14 +2962,14 @@ BOOL run_return(U8 *buffer, S32 &offset, BOOL b_print, const LLUUID &id) | |||
2945 | return FALSE; | 2962 | return FALSE; |
2946 | } | 2963 | } |
2947 | 2964 | ||
2948 | S32 axtoi(char *hexStg) | 2965 | S32 axtoi(char *hexStg) |
2949 | { | 2966 | { |
2950 | S32 n = 0; // position in string | 2967 | S32 n = 0; // position in string |
2951 | S32 m = 0; // position in digit[] to shift | 2968 | S32 m = 0; // position in digit[] to shift |
2952 | S32 count; // loop index | 2969 | S32 count; // loop index |
2953 | S32 intValue = 0; // integer value of hex string | 2970 | S32 intValue = 0; // integer value of hex string |
2954 | S32 digit[9]; // hold values to convert | 2971 | S32 digit[9]; // hold values to convert |
2955 | while (n < 8) | 2972 | while (n < 8) |
2956 | { | 2973 | { |
2957 | if (hexStg[n]=='\0') | 2974 | if (hexStg[n]=='\0') |
2958 | break; | 2975 | break; |
@@ -2968,7 +2985,7 @@ S32 axtoi(char *hexStg) | |||
2968 | count = n; | 2985 | count = n; |
2969 | m = n - 1; | 2986 | m = n - 1; |
2970 | n = 0; | 2987 | n = 0; |
2971 | while(n < count) | 2988 | while(n < count) |
2972 | { | 2989 | { |
2973 | // digit[n] is value of hex digit at position n | 2990 | // digit[n] is value of hex digit at position n |
2974 | // (m << 2) is the number of positions to shift | 2991 | // (m << 2) is the number of positions to shift |
@@ -3140,7 +3157,7 @@ BOOL run_cast(U8 *buffer, S32 &offset, BOOL b_print, const LLUUID &id) | |||
3140 | bytestream2char(arg, buffer, string); | 3157 | bytestream2char(arg, buffer, string); |
3141 | F32 dest = (F32)atof(arg); | 3158 | F32 dest = (F32)atof(arg); |
3142 | 3159 | ||
3143 | 3160 | ||
3144 | lscript_push(buffer, dest); | 3161 | lscript_push(buffer, dest); |
3145 | delete [] arg; | 3162 | delete [] arg; |
3146 | } | 3163 | } |
@@ -3338,7 +3355,7 @@ BOOL run_cast(U8 *buffer, S32 &offset, BOOL b_print, const LLUUID &id) | |||
3338 | delete list_root; | 3355 | delete list_root; |
3339 | char *tmp = strdup(dest.str().c_str()); | 3356 | char *tmp = strdup(dest.str().c_str()); |
3340 | LLScriptLibData *string = new LLScriptLibData(tmp); | 3357 | LLScriptLibData *string = new LLScriptLibData(tmp); |
3341 | free(tmp); | 3358 | free(tmp); |
3342 | tmp = NULL; | 3359 | tmp = NULL; |
3343 | S32 destaddress = lsa_heap_add_data(buffer, string, get_max_heap_size(buffer), TRUE); | 3360 | S32 destaddress = lsa_heap_add_data(buffer, string, get_max_heap_size(buffer), TRUE); |
3344 | lscript_push(buffer, destaddress); | 3361 | lscript_push(buffer, destaddress); |
@@ -3393,7 +3410,7 @@ void lscript_stacktol_pop_variable(LLScriptLibData *data, U8 *buffer, char type) | |||
3393 | break; | 3410 | break; |
3394 | case LST_KEY: | 3411 | case LST_KEY: |
3395 | data->mType = LST_KEY; | 3412 | data->mType = LST_KEY; |
3396 | 3413 | ||
3397 | base_address = lscript_pop_int(buffer); | 3414 | base_address = lscript_pop_int(buffer); |
3398 | // this bit of nastiness is to get around that code paths to local variables can result in lack of initialization | 3415 | // this bit of nastiness is to get around that code paths to local variables can result in lack of initialization |
3399 | // and function clean up of ref counts isn't based on scope (a mistake, I know) | 3416 | // and function clean up of ref counts isn't based on scope (a mistake, I know) |
@@ -3617,48 +3634,53 @@ BOOL run_print(U8 *buffer, S32 &offset, BOOL b_print, const LLUUID &id) | |||
3617 | void lscript_run(char *filename, BOOL b_debug) | 3634 | void lscript_run(char *filename, BOOL b_debug) |
3618 | { | 3635 | { |
3619 | LLTimer timer; | 3636 | LLTimer timer; |
3620 | char *error; | ||
3621 | BOOL b_state; | ||
3622 | LLScriptExecute *execute = NULL; | ||
3623 | if (filename == NULL) | 3637 | if (filename == NULL) |
3624 | { | 3638 | { |
3625 | llerrs << "filename is empty" << llendl; | 3639 | llerrs << "filename is NULL" << llendl; |
3626 | // Just reporting error is likely not enough. Need | 3640 | // Just reporting error is likely not enough. Need |
3627 | // to check how to abort or error out gracefully | 3641 | // to check how to abort or error out gracefully |
3628 | // from this function. XXXTBD | 3642 | // from this function. XXXTBD |
3629 | } | 3643 | } |
3630 | FILE* file = LLFile::fopen(filename, "r"); /* Flawfinder: ignore */ | 3644 | else |
3631 | if (file) | ||
3632 | { | ||
3633 | execute = new LLScriptExecute(file); | ||
3634 | fclose(file); | ||
3635 | } | ||
3636 | file = LLFile::fopen(filename, "r"); /* Flawfinder: ignore */ | ||
3637 | if (file) | ||
3638 | { | ||
3639 | FILE* fp = LLFile::fopen("lscript.parse", "w"); /*Flawfinder: ignore*/ | ||
3640 | LLScriptLSOParse *parse = new LLScriptLSOParse(file); | ||
3641 | parse->printData(fp); | ||
3642 | fclose(file); | ||
3643 | fclose(fp); | ||
3644 | } | ||
3645 | file = LLFile::fopen(filename, "r"); /*Flawfinder: ignore*/ | ||
3646 | if (file && execute) | ||
3647 | { | 3645 | { |
3648 | timer.reset(); | 3646 | char *error; |
3649 | while (!execute->run(b_debug, LLUUID::null, &error, b_state)) | 3647 | BOOL b_state; |
3650 | ; | 3648 | LLScriptExecute *execute = NULL; |
3651 | F32 time = timer.getElapsedTimeF32(); | 3649 | |
3652 | F32 ips = execute->mInstructionCount / time; | 3650 | FILE* file = LLFile::fopen(filename, "r"); |
3653 | llinfos << execute->mInstructionCount << " instructions in " << time << " seconds" << llendl; | 3651 | if (file) |
3654 | llinfos << ips/1000 << "K instructions per second" << llendl; | 3652 | { |
3655 | printf("ip: 0x%X\n", get_register(execute->mBuffer, LREG_IP)); | 3653 | execute = new LLScriptExecute(file); |
3656 | printf("sp: 0x%X\n", get_register(execute->mBuffer, LREG_SP)); | 3654 | // note: LLScriptExecute() closes file for us |
3657 | printf("bp: 0x%X\n", get_register(execute->mBuffer, LREG_BP)); | 3655 | } |
3658 | printf("hr: 0x%X\n", get_register(execute->mBuffer, LREG_HR)); | 3656 | file = LLFile::fopen(filename, "r"); |
3659 | printf("hp: 0x%X\n", get_register(execute->mBuffer, LREG_HP)); | 3657 | if (file) |
3660 | delete execute; | 3658 | { |
3661 | fclose(file); | 3659 | FILE* fp = LLFile::fopen("lscript.parse", "w"); /*Flawfinder: ignore*/ |
3660 | LLScriptLSOParse *parse = new LLScriptLSOParse(file); | ||
3661 | parse->printData(fp); | ||
3662 | delete parse; | ||
3663 | fclose(file); | ||
3664 | fclose(fp); | ||
3665 | } | ||
3666 | file = LLFile::fopen(filename, "r"); | ||
3667 | if (file && execute) | ||
3668 | { | ||
3669 | timer.reset(); | ||
3670 | while (!execute->run(b_debug, LLUUID::null, &error, b_state)) | ||
3671 | ; | ||
3672 | F32 time = timer.getElapsedTimeF32(); | ||
3673 | F32 ips = execute->mInstructionCount / time; | ||
3674 | llinfos << execute->mInstructionCount << " instructions in " << time << " seconds" << llendl; | ||
3675 | llinfos << ips/1000 << "K instructions per second" << llendl; | ||
3676 | printf("ip: 0x%X\n", get_register(execute->mBuffer, LREG_IP)); | ||
3677 | printf("sp: 0x%X\n", get_register(execute->mBuffer, LREG_SP)); | ||
3678 | printf("bp: 0x%X\n", get_register(execute->mBuffer, LREG_BP)); | ||
3679 | printf("hr: 0x%X\n", get_register(execute->mBuffer, LREG_HR)); | ||
3680 | printf("hp: 0x%X\n", get_register(execute->mBuffer, LREG_HP)); | ||
3681 | delete execute; | ||
3682 | fclose(file); | ||
3683 | } | ||
3662 | } | 3684 | } |
3663 | } | 3685 | } |
3664 | 3686 | ||
@@ -3679,7 +3701,7 @@ void lscript_pop_variable(LLScriptLibData *data, U8 *buffer, char type) | |||
3679 | break; | 3701 | break; |
3680 | case 'k': | 3702 | case 'k': |
3681 | data->mType = LST_KEY; | 3703 | data->mType = LST_KEY; |
3682 | 3704 | ||
3683 | base_address = lscript_pop_int(buffer); | 3705 | base_address = lscript_pop_int(buffer); |
3684 | // this bit of nastiness is to get around that code paths to local variables can result in lack of initialization | 3706 | // this bit of nastiness is to get around that code paths to local variables can result in lack of initialization |
3685 | // and function clean up of ref counts isn't based on scope (a mistake, I know) | 3707 | // and function clean up of ref counts isn't based on scope (a mistake, I know) |
diff --git a/linden/indra/lscript/lscript_execute/lscript_readlso.cpp b/linden/indra/lscript/lscript_execute/lscript_readlso.cpp index d750535..077e47c 100644 --- a/linden/indra/lscript/lscript_execute/lscript_readlso.cpp +++ b/linden/indra/lscript/lscript_execute/lscript_readlso.cpp | |||
@@ -42,7 +42,6 @@ LLScriptLSOParse::LLScriptLSOParse(FILE *fp) | |||
42 | mRawData = new U8[filesize]; | 42 | mRawData = new U8[filesize]; |
43 | fseek(fp, 0, SEEK_SET); | 43 | fseek(fp, 0, SEEK_SET); |
44 | fread(mRawData, 1, filesize, fp); | 44 | fread(mRawData, 1, filesize, fp); |
45 | fclose(fp); | ||
46 | 45 | ||
47 | initOpCodePrinting(); | 46 | initOpCodePrinting(); |
48 | } | 47 | } |
diff --git a/linden/indra/lscript/lscript_library/lscript_library.cpp b/linden/indra/lscript/lscript_library/lscript_library.cpp index ec1cc03..7d38621 100644 --- a/linden/indra/lscript/lscript_library/lscript_library.cpp +++ b/linden/indra/lscript/lscript_library/lscript_library.cpp | |||
@@ -401,7 +401,7 @@ void LLScriptLibrary::init() | |||
401 | addFunction(new LLScriptLibraryFunction(10.f, 0.f, dummy_func, "llSetCameraParams", NULL, "l", "llSetCameraParams(list rules)\nSets multiple camera parameters at once.\nList format is [ rule1, data1, rule2, data2 . . . rulen, datan ]")); | 401 | addFunction(new LLScriptLibraryFunction(10.f, 0.f, dummy_func, "llSetCameraParams", NULL, "l", "llSetCameraParams(list rules)\nSets multiple camera parameters at once.\nList format is [ rule1, data1, rule2, data2 . . . rulen, datan ]")); |
402 | addFunction(new LLScriptLibraryFunction(10.f, 0.f, dummy_func, "llClearCameraParams", NULL, NULL, "llClearCameraParams()\nResets all camera parameters to default values and turns off scripted camera control.")); | 402 | addFunction(new LLScriptLibraryFunction(10.f, 0.f, dummy_func, "llClearCameraParams", NULL, NULL, "llClearCameraParams()\nResets all camera parameters to default values and turns off scripted camera control.")); |
403 | 403 | ||
404 | addFunction(new LLScriptLibraryFunction(10.f, 0.f, dummy_func, "llListStatistics", "f", "il", "integer llListStatistics(integer operation, list l)\nPerform statistical aggregate functions on list l using LIST_STAT_* operations.")); | 404 | addFunction(new LLScriptLibraryFunction(10.f, 0.f, dummy_func, "llListStatistics", "f", "il", "float llListStatistics(integer operation, list l)\nPerform statistical aggregate functions on list l using LIST_STAT_* operations.")); |
405 | addFunction(new LLScriptLibraryFunction(10.f, 0.f, dummy_func, "llGetUnixTime", "i", NULL, "integer llGetUnixTime()\nGet the number of seconds elapsed since 00:00 hours, Jan 1, 1970 UTC from the system clock.")); | 405 | addFunction(new LLScriptLibraryFunction(10.f, 0.f, dummy_func, "llGetUnixTime", "i", NULL, "integer llGetUnixTime()\nGet the number of seconds elapsed since 00:00 hours, Jan 1, 1970 UTC from the system clock.")); |
406 | addFunction(new LLScriptLibraryFunction(10.f, 0.f, dummy_func, "llGetParcelFlags", "i", "v", "integer llGetParcelFlags(vector pos)\nGet the parcel flags (PARCEL_FLAG_*) for the parcel including the point pos.")); | 406 | addFunction(new LLScriptLibraryFunction(10.f, 0.f, dummy_func, "llGetParcelFlags", "i", "v", "integer llGetParcelFlags(vector pos)\nGet the parcel flags (PARCEL_FLAG_*) for the parcel including the point pos.")); |
407 | addFunction(new LLScriptLibraryFunction(10.f, 0.f, dummy_func, "llGetRegionFlags", "i", NULL, "integer llGetRegionFlags()\nGet the region flags (REGION_FLAG_*) for the region the object is in.")); | 407 | addFunction(new LLScriptLibraryFunction(10.f, 0.f, dummy_func, "llGetRegionFlags", "i", NULL, "integer llGetRegionFlags()\nGet the region flags (REGION_FLAG_*) for the region the object is in.")); |
@@ -548,12 +548,7 @@ void LLScriptLibData::print_separator(std::ostream& ostr, BOOL b_prepend_sep, ch | |||
548 | } | 548 | } |
549 | //print(ostr, FALSE); | 549 | //print(ostr, FALSE); |
550 | { | 550 | { |
551 | BOOL b_prepend_comma = FALSE; | ||
552 | char tmp[1024]; /* Flawfinder: ignore */ | 551 | char tmp[1024]; /* Flawfinder: ignore */ |
553 | if (b_prepend_comma) | ||
554 | { | ||
555 | ostr << ", "; | ||
556 | } | ||
557 | switch (mType) | 552 | switch (mType) |
558 | { | 553 | { |
559 | case LST_INTEGER: | 554 | case LST_INTEGER: |
diff --git a/linden/indra/newview/English.lproj/InfoPlist.strings b/linden/indra/newview/English.lproj/InfoPlist.strings index 54687b1..e9cd858 100644 --- a/linden/indra/newview/English.lproj/InfoPlist.strings +++ b/linden/indra/newview/English.lproj/InfoPlist.strings | |||
@@ -1,5 +1,5 @@ | |||
1 | /* Localized versions of Info.plist keys */ | 1 | /* Localized versions of Info.plist keys */ |
2 | 2 | ||
3 | CFBundleName = "Second Life"; | 3 | CFBundleName = "Second Life"; |
4 | CFBundleShortVersionString = "Second Life version 1.15.0.2"; | 4 | CFBundleShortVersionString = "Second Life version 1.15.1.3"; |
5 | CFBundleGetInfoString = "Second Life version 1.15.0.2, Copyright 2004-2007 Linden Research, Inc."; | 5 | CFBundleGetInfoString = "Second Life version 1.15.1.3, Copyright 2004-2007 Linden Research, Inc."; |
diff --git a/linden/indra/newview/Info-SecondLife.plist b/linden/indra/newview/Info-SecondLife.plist index 0908e18..108f716 100644 --- a/linden/indra/newview/Info-SecondLife.plist +++ b/linden/indra/newview/Info-SecondLife.plist | |||
@@ -32,7 +32,7 @@ | |||
32 | </dict> | 32 | </dict> |
33 | </array> | 33 | </array> |
34 | <key>CFBundleVersion</key> | 34 | <key>CFBundleVersion</key> |
35 | <string>1.15.0.2</string> | 35 | <string>1.15.1.3</string> |
36 | <key>CSResourcesFileMapped</key> | 36 | <key>CSResourcesFileMapped</key> |
37 | <true/> | 37 | <true/> |
38 | </dict> | 38 | </dict> |
diff --git a/linden/indra/newview/app_settings/keys.ini b/linden/indra/newview/app_settings/keys.ini index b7fc6f9..3a1e9ea 100644 --- a/linden/indra/newview/app_settings/keys.ini +++ b/linden/indra/newview/app_settings/keys.ini | |||
@@ -235,6 +235,13 @@ EDIT PAD_PGUP ALT jump | |||
235 | EDIT PAD_PGDN ALT push_down | 235 | EDIT PAD_PGDN ALT push_down |
236 | EDIT PAD_ENTER ALT start_chat | 236 | EDIT PAD_ENTER ALT start_chat |
237 | 237 | ||
238 | SITTING A ALT spin_around_cw | ||
239 | SITTING D ALT spin_around_ccw | ||
240 | SITTING W ALT move_forward | ||
241 | SITTING S ALT move_backward | ||
242 | SITTING E ALT spin_over_sitting | ||
243 | SITTING C ALT spin_under_sitting | ||
244 | |||
238 | SITTING LEFT ALT spin_around_cw | 245 | SITTING LEFT ALT spin_around_cw |
239 | SITTING RIGHT ALT spin_around_ccw | 246 | SITTING RIGHT ALT spin_around_ccw |
240 | SITTING UP ALT move_forward | 247 | SITTING UP ALT move_forward |
@@ -242,6 +249,21 @@ SITTING DOWN ALT move_backward | |||
242 | SITTING PGUP ALT spin_over | 249 | SITTING PGUP ALT spin_over |
243 | SITTING PGDN ALT spin_under | 250 | SITTING PGDN ALT spin_under |
244 | 251 | ||
252 | SITTING A CTL_ALT spin_around_cw | ||
253 | SITTING D CTL_ALT spin_around_ccw | ||
254 | SITTING W CTL_ALT spin_over | ||
255 | SITTING S CTL_ALT spin_under | ||
256 | SITTING E CTL_ALT spin_over | ||
257 | SITTING C CTL_ALT spin_under | ||
258 | |||
259 | SITTING LEFT CTL_ALT spin_around_cw | ||
260 | SITTING RIGHT CTL_ALT spin_around_ccw | ||
261 | SITTING UP CTL_ALT spin_over | ||
262 | SITTING DOWN CTL_ALT spin_under | ||
263 | SITTING PGUP CTL_ALT spin_over | ||
264 | SITTING PGDN CTL_ALT spin_under | ||
265 | |||
266 | |||
245 | SITTING A NONE spin_around_cw_sitting | 267 | SITTING A NONE spin_around_cw_sitting |
246 | SITTING D NONE spin_around_ccw_sitting | 268 | SITTING D NONE spin_around_ccw_sitting |
247 | SITTING W NONE move_forward_sitting | 269 | SITTING W NONE move_forward_sitting |
diff --git a/linden/indra/newview/featuretable_linux.txt b/linden/indra/newview/featuretable_linux.txt new file mode 100644 index 0000000..6c7acfa --- /dev/null +++ b/linden/indra/newview/featuretable_linux.txt | |||
@@ -0,0 +1,173 @@ | |||
1 | version 10 | ||
2 | |||
3 | // NOTE: This is mostly identical to featuretable.txt with a few differences | ||
4 | // Should be combined into one table | ||
5 | |||
6 | // | ||
7 | // Generates lists of feature mask that can be applied on top of each other. | ||
8 | // | ||
9 | // // Begin comments | ||
10 | // list <name> | ||
11 | // Starts a feature list named <name> | ||
12 | // <name> <available> <recommended> | ||
13 | // <name> is the name of a feature | ||
14 | // <available> is 0 or 1, whether the feature is available | ||
15 | // <recommended> is an S32 which is the recommended value | ||
16 | // | ||
17 | // For now, the first list read sets up all of the default values | ||
18 | // | ||
19 | |||
20 | |||
21 | // | ||
22 | // All contains everything at their default settings for high end machines | ||
23 | // NOTE: All settings are set to the MIN of applied values, including 'all'! | ||
24 | // | ||
25 | list all | ||
26 | RenderVBO 1 1 | ||
27 | RenderAniso 1 0 | ||
28 | RenderAvatarMode 1 2 | ||
29 | RenderAvatarVP 1 1 | ||
30 | RenderDistance 1 128 | ||
31 | RenderLighting 1 1 | ||
32 | RenderObjectBump 1 1 | ||
33 | RenderParticleCount 1 4096 | ||
34 | RenderRippleWater 1 1 | ||
35 | RenderTerrainDetail 1 2 | ||
36 | VertexShaderEnable 1 1 | ||
37 | |||
38 | // | ||
39 | // Class 0 Hardware (Unknown or just old) | ||
40 | // | ||
41 | list Class0 | ||
42 | VertexShaderEnable 1 0 | ||
43 | RenderVBO 1 0 | ||
44 | RenderDistance 1 64 | ||
45 | RenderAvatarVP 1 0 | ||
46 | RenderAvatarMode 1 0 | ||
47 | RenderLighting 1 0 | ||
48 | RenderObjectBump 1 0 | ||
49 | RenderRippleWater 1 0 | ||
50 | |||
51 | // | ||
52 | // Class 1 Hardware | ||
53 | // | ||
54 | list Class1 | ||
55 | VertexShaderEnable 1 0 | ||
56 | RenderVBO 1 1 | ||
57 | RenderDistance 1 96 | ||
58 | RenderAvatarVP 1 1 | ||
59 | RenderAvatarMode 1 0 | ||
60 | RenderLighting 1 0 | ||
61 | RenderObjectBump 1 0 | ||
62 | RenderRippleWater 1 0 | ||
63 | |||
64 | // | ||
65 | // Class 2 Hardware (make it purty) | ||
66 | // | ||
67 | list Class2 | ||
68 | VertexShaderEnable 1 1 | ||
69 | RenderAvatarVP 1 1 | ||
70 | RenderAvatarMode 1 1 | ||
71 | RenderLighting 1 1 | ||
72 | RenderObjectBump 1 1 | ||
73 | RenderRippleWater 1 1 | ||
74 | |||
75 | // | ||
76 | // Class 3 Hardware (make it purty) | ||
77 | // | ||
78 | list Class3 | ||
79 | VertexShaderEnable 1 1 | ||
80 | RenderAvatarVP 1 1 | ||
81 | RenderAvatarMode 1 1 | ||
82 | RenderLighting 1 1 | ||
83 | RenderObjectBump 1 1 | ||
84 | RenderRippleWater 1 1 | ||
85 | |||
86 | // | ||
87 | // No Pixel Shaders available | ||
88 | // | ||
89 | list NoPixelShaders | ||
90 | VertexShaderEnable 0 0 | ||
91 | RenderAvatarVP 0 0 | ||
92 | |||
93 | // | ||
94 | // No Vertex Shaders available | ||
95 | // | ||
96 | list NoVertexShaders | ||
97 | VertexShaderEnable 0 0 | ||
98 | RenderAvatarVP 0 0 | ||
99 | |||
100 | // | ||
101 | // "Default" setups for safe, low, medium, high | ||
102 | // | ||
103 | list safe | ||
104 | RenderVBO 1 0 | ||
105 | RenderAniso 1 0 | ||
106 | RenderAvatarVP 0 0 | ||
107 | RenderLighting 1 0 | ||
108 | RenderParticleCount 1 1024 | ||
109 | RenderTerrainDetail 1 0 | ||
110 | |||
111 | |||
112 | list low | ||
113 | RenderVBO 1 0 | ||
114 | RenderAniso 1 0 | ||
115 | RenderLighting 1 0 | ||
116 | |||
117 | list medium | ||
118 | RenderLighting 1 0 | ||
119 | |||
120 | |||
121 | // | ||
122 | // CPU based feature masks | ||
123 | // | ||
124 | |||
125 | // 1Ghz or less (equiv) | ||
126 | list CPUSlow | ||
127 | RenderParticleCount 1 1024 | ||
128 | |||
129 | |||
130 | // | ||
131 | // RAM based feature masks | ||
132 | // | ||
133 | list RAM256MB | ||
134 | RenderObjectBump 0 0 | ||
135 | |||
136 | |||
137 | // | ||
138 | // Graphics card based feature masks | ||
139 | // | ||
140 | list OpenGLPre15 | ||
141 | RenderVBO 1 0 | ||
142 | |||
143 | list Intel | ||
144 | RenderVBO 1 0 | ||
145 | RenderAniso 1 0 | ||
146 | RenderLighting 1 0 | ||
147 | RenderTerrainDetail 1 0 | ||
148 | |||
149 | list GeForce2 | ||
150 | RenderVBO 1 1 | ||
151 | RenderAniso 1 0 | ||
152 | RenderLighting 1 0 | ||
153 | RenderParticleCount 1 2048 | ||
154 | RenderTerrainDetail 1 0 | ||
155 | |||
156 | list GeForce3 | ||
157 | |||
158 | list ATI | ||
159 | |||
160 | list Radeon8500 | ||
161 | RenderLighting 1 0 | ||
162 | RenderParticleCount 1 4096 | ||
163 | |||
164 | // Hacked to be paranoid "safe" | ||
165 | list Radeon9700 | ||
166 | RenderParticleCount 1 4096 | ||
167 | |||
168 | // Hacked to be paranoid "safe" | ||
169 | list MobilityRadeon9000 | ||
170 | RenderLighting 1 0 | ||
171 | RenderParticleCount 1 4096 | ||
172 | |||
173 | list GeForceFX | ||
diff --git a/linden/indra/newview/files.lst b/linden/indra/newview/files.lst index 8fdd239..2967bed 100644 --- a/linden/indra/newview/files.lst +++ b/linden/indra/newview/files.lst | |||
@@ -282,6 +282,7 @@ newview/llviewerjoystick.cpp | |||
282 | newview/llviewerkeyboard.cpp | 282 | newview/llviewerkeyboard.cpp |
283 | newview/llviewerlayer.cpp | 283 | newview/llviewerlayer.cpp |
284 | newview/llviewermenu.cpp | 284 | newview/llviewermenu.cpp |
285 | newview/llviewermenufile.cpp | ||
285 | newview/llviewermessage.cpp | 286 | newview/llviewermessage.cpp |
286 | newview/llviewernetwork.cpp | 287 | newview/llviewernetwork.cpp |
287 | newview/llviewerobject.cpp | 288 | newview/llviewerobject.cpp |
diff --git a/linden/indra/newview/gpu_table.txt b/linden/indra/newview/gpu_table.txt index 4e6373d..a6d1dee 100644 --- a/linden/indra/newview/gpu_table.txt +++ b/linden/indra/newview/gpu_table.txt | |||
@@ -22,11 +22,9 @@ ATI All-in-Wonder X1800 .*ATI.*All-in-Wonder X18.* 3 | |||
22 | ATI All-in-Wonder X1900 .*ATI.*All-in-Wonder X19.* 3 | 22 | ATI All-in-Wonder X1900 .*ATI.*All-in-Wonder X19.* 3 |
23 | ATI ASUS X1xxx .*ASUS X1.* 3 | 23 | ATI ASUS X1xxx .*ASUS X1.* 3 |
24 | ATI Mobility Radeon X1xxx .*ATI.*Mobility.*X1.* 2 | 24 | ATI Mobility Radeon X1xxx .*ATI.*Mobility.*X1.* 2 |
25 | // HACK: We crash on startup on some Mobility Radeon chips, with 1.15.0 | 25 | ATI Mobility Radeon X3xx .*ATI.*Mobility.*X3.* 1 |
26 | // in FMOD (!). Try defaulting them to class 0. JC | 26 | ATI Mobility Radeon X6xx .*ATI.*Mobility.*X6.* 1 |
27 | ATI Mobility Radeon X3xx .*ATI.*Mobility.*X3.* 0 | 27 | ATI Mobility Radeon X7xx .*ATI.*Mobility.*X7.* 1 |
28 | ATI Mobility Radeon X6xx .*ATI.*Mobility.*X6.* 0 | ||
29 | ATI Mobility Radeon X7xx .*ATI.*Mobility.*X7.* 0 | ||
30 | ATI Radeon OpenGL .*ATI.*Radeon OpenGL.* 3 | 28 | ATI Radeon OpenGL .*ATI.*Radeon OpenGL.* 3 |
31 | ATI Diamond X1xxx .*ATI.*Diamond.*X1.* 3 | 29 | ATI Diamond X1xxx .*ATI.*Diamond.*X1.* 3 |
32 | ATI FireGL 5xxx .*ATI.*FireGL V5.* 3 | 30 | ATI FireGL 5xxx .*ATI.*FireGL V5.* 3 |
diff --git a/linden/indra/newview/linux_tools/client-readme.txt b/linden/indra/newview/linux_tools/client-readme.txt index cabb034..63086c8 100644 --- a/linden/indra/newview/linux_tools/client-readme.txt +++ b/linden/indra/newview/linux_tools/client-readme.txt | |||
@@ -97,7 +97,6 @@ the Alpha release of the Linux client. | |||
97 | implemented on the Linux client and are therefore known not to work properly | 97 | implemented on the Linux client and are therefore known not to work properly |
98 | at this time: | 98 | at this time: |
99 | * QuickTime movie playback and movie recording | 99 | * QuickTime movie playback and movie recording |
100 | * Video memory detection | ||
101 | * Full Unicode font rendering | 100 | * Full Unicode font rendering |
102 | * Auto-updater | 101 | * Auto-updater |
103 | 102 | ||
diff --git a/linden/indra/newview/linux_tools/launch_url.sh b/linden/indra/newview/linux_tools/launch_url.sh index 564e834..a1c6f5d 100755 --- a/linden/indra/newview/linux_tools/launch_url.sh +++ b/linden/indra/newview/linux_tools/launch_url.sh | |||
@@ -1,5 +1,5 @@ | |||
1 | #!/bin/sh | 1 | #!/bin/sh |
2 | # bash v1.14+ expected | 2 | # Script tested with: bash 1.14, bash 3.1.17, zsh 4.2.5, ksh 1993-12-28 |
3 | 3 | ||
4 | # This script loads a web page in the 'default' graphical web browser. | 4 | # This script loads a web page in the 'default' graphical web browser. |
5 | # It MUST return immediately (or soon), so the browser should be | 5 | # It MUST return immediately (or soon), so the browser should be |
diff --git a/linden/indra/newview/linux_tools/wrapper.sh b/linden/indra/newview/linux_tools/wrapper.sh index cdc36a8..5f128e8 100755 --- a/linden/indra/newview/linux_tools/wrapper.sh +++ b/linden/indra/newview/linux_tools/wrapper.sh | |||
@@ -1,4 +1,6 @@ | |||
1 | #!/bin/sh | 1 | #!/bin/sh |
2 | # Script tested with: bash 1.14, bash 3.1.17, zsh 4.2.5, ksh 1993-12-28 | ||
3 | |||
2 | ## Here are some configuration options for Linux Client Alpha Testers. | 4 | ## Here are some configuration options for Linux Client Alpha Testers. |
3 | ## These options are for self-assisted troubleshooting during this alpha | 5 | ## These options are for self-assisted troubleshooting during this alpha |
4 | ## testing phase; you should not usually need to touch them. | 6 | ## testing phase; you should not usually need to touch them. |
diff --git a/linden/indra/newview/llagent.cpp b/linden/indra/newview/llagent.cpp index ff16682..85c268b 100644 --- a/linden/indra/newview/llagent.cpp +++ b/linden/indra/newview/llagent.cpp | |||
@@ -7081,7 +7081,7 @@ void LLAgent::queryWearableCache() | |||
7081 | // Look up affected baked textures. | 7081 | // Look up affected baked textures. |
7082 | // If they exist: | 7082 | // If they exist: |
7083 | // disallow updates for affected layersets (until dataserver responds with cache request.) | 7083 | // disallow updates for affected layersets (until dataserver responds with cache request.) |
7084 | // If cache miss…turn updates back on and invalidate composite. | 7084 | // If cache miss, turn updates back on and invalidate composite. |
7085 | // If cache hit, modify baked texture entries. | 7085 | // If cache hit, modify baked texture entries. |
7086 | // | 7086 | // |
7087 | // Cache requests contain list of hashes for each baked texture entry. | 7087 | // Cache requests contain list of hashes for each baked texture entry. |
diff --git a/linden/indra/newview/llassetuploadresponders.cpp b/linden/indra/newview/llassetuploadresponders.cpp index 821bb2a..26c606f 100644 --- a/linden/indra/newview/llassetuploadresponders.cpp +++ b/linden/indra/newview/llassetuploadresponders.cpp | |||
@@ -21,7 +21,7 @@ | |||
21 | #include "lluploaddialog.h" | 21 | #include "lluploaddialog.h" |
22 | #include "llviewerobject.h" | 22 | #include "llviewerobject.h" |
23 | #include "llviewerobjectlist.h" | 23 | #include "llviewerobjectlist.h" |
24 | #include "llviewermenu.h" | 24 | #include "llviewermenufile.h" |
25 | #include "llviewerwindow.h" | 25 | #include "llviewerwindow.h" |
26 | #include "viewer.h" | 26 | #include "viewer.h" |
27 | 27 | ||
diff --git a/linden/indra/newview/llcallingcard.cpp b/linden/indra/newview/llcallingcard.cpp index 22e7f23..3e00f40 100644 --- a/linden/indra/newview/llcallingcard.cpp +++ b/linden/indra/newview/llcallingcard.cpp | |||
@@ -269,12 +269,28 @@ S32 LLAvatarTracker::addBuddyList(const LLAvatarTracker::buddy_map_t& buds) | |||
269 | for(buddy_map_t::const_iterator itr = buds.begin(); itr != buds.end(); ++itr) | 269 | for(buddy_map_t::const_iterator itr = buds.begin(); itr != buds.end(); ++itr) |
270 | { | 270 | { |
271 | agent_id = (*itr).first; | 271 | agent_id = (*itr).first; |
272 | if(mBuddyInfo.find(agent_id) == mBuddyInfo.end()) | 272 | buddy_map_t::const_iterator existing_buddy = mBuddyInfo.find(agent_id); |
273 | if(existing_buddy == mBuddyInfo.end()) | ||
273 | { | 274 | { |
274 | ++new_buddy_count; | 275 | ++new_buddy_count; |
275 | mBuddyInfo[agent_id] = (*itr).second; | 276 | mBuddyInfo[agent_id] = (*itr).second; |
276 | gCacheName->getName(agent_id, first, last); | 277 | gCacheName->getName(agent_id, first, last); |
277 | mModifyMask |= LLFriendObserver::ADD; | 278 | mModifyMask |= LLFriendObserver::ADD; |
279 | lldebugs << "Added buddy " << agent_id | ||
280 | << ", " << (mBuddyInfo[agent_id]->isOnline() ? "Online" : "Offline") | ||
281 | << ", TO: " << mBuddyInfo[agent_id]->getRightsGrantedTo() | ||
282 | << ", FROM: " << mBuddyInfo[agent_id]->getRightsGrantedFrom() | ||
283 | << llendl; | ||
284 | } | ||
285 | else | ||
286 | { | ||
287 | LLRelationship* e_r = (*existing_buddy).second; | ||
288 | LLRelationship* n_r = (*itr).second; | ||
289 | llwarns << "!! Add buddy for existing buddy: " << agent_id | ||
290 | << " [" << (e_r->isOnline() ? "Online" : "Offline") << "->" << (n_r->isOnline() ? "Online" : "Offline") | ||
291 | << ", " << e_r->getRightsGrantedTo() << "->" << n_r->getRightsGrantedTo() | ||
292 | << ", " << e_r->getRightsGrantedTo() << "->" << n_r->getRightsGrantedTo() | ||
293 | << "]" << llendl; | ||
278 | } | 294 | } |
279 | } | 295 | } |
280 | 296 | ||
@@ -325,6 +341,12 @@ void LLAvatarTracker::setBuddyOnline(const LLUUID& id, bool is_online) | |||
325 | { | 341 | { |
326 | info->online(is_online); | 342 | info->online(is_online); |
327 | mModifyMask |= LLFriendObserver::ONLINE; | 343 | mModifyMask |= LLFriendObserver::ONLINE; |
344 | lldebugs << "Set buddy " << id << (is_online ? " Online" : " Offline") << llendl; | ||
345 | } | ||
346 | else | ||
347 | { | ||
348 | llwarns << "!! No buddy info found for " << id | ||
349 | << ", setting to " << (is_online ? "Online" : "Offline") << llendl; | ||
328 | } | 350 | } |
329 | } | 351 | } |
330 | 352 | ||
@@ -598,6 +620,7 @@ void LLAvatarTracker::processNotify(LLMessageSystem* msg, bool online) | |||
598 | S32 count = msg->getNumberOfBlocksFast(_PREHASH_AgentBlock); | 620 | S32 count = msg->getNumberOfBlocksFast(_PREHASH_AgentBlock); |
599 | BOOL chat_notify = gSavedSettings.getBOOL("ChatOnlineNotification"); | 621 | BOOL chat_notify = gSavedSettings.getBOOL("ChatOnlineNotification"); |
600 | 622 | ||
623 | lldebugs << "Received " << count << " online notifications **** " << llendl; | ||
601 | if(count > 0) | 624 | if(count > 0) |
602 | { | 625 | { |
603 | LLUUID agent_id; | 626 | LLUUID agent_id; |
@@ -628,6 +651,12 @@ void LLAvatarTracker::processNotify(LLMessageSystem* msg, bool online) | |||
628 | } | 651 | } |
629 | } | 652 | } |
630 | } | 653 | } |
654 | else | ||
655 | { | ||
656 | llwarns << "Received online notification for unknown buddy: " | ||
657 | << agent_id << " is " << (online ? "ONLINE" : "OFFLINE") << llendl; | ||
658 | } | ||
659 | |||
631 | if(tracking_id == agent_id) | 660 | if(tracking_id == agent_id) |
632 | { | 661 | { |
633 | // we were tracking someone who went offline | 662 | // we were tracking someone who went offline |
diff --git a/linden/indra/newview/llchatbar.cpp b/linden/indra/newview/llchatbar.cpp index 02bed33..a6feac7 100644 --- a/linden/indra/newview/llchatbar.cpp +++ b/linden/indra/newview/llchatbar.cpp | |||
@@ -118,9 +118,10 @@ LLChatBar::LLChatBar(const std::string& name, const LLRect& rect) | |||
118 | mInputEditor->setRevertOnEsc( FALSE ); | 118 | mInputEditor->setRevertOnEsc( FALSE ); |
119 | mInputEditor->setIgnoreTab(TRUE); | 119 | mInputEditor->setIgnoreTab(TRUE); |
120 | mInputEditor->setPassDelete(TRUE); | 120 | mInputEditor->setPassDelete(TRUE); |
121 | |||
122 | mInputEditor->setMaxTextLength(1023); | ||
121 | } | 123 | } |
122 | 124 | ||
123 | mInputEditor->setMaxTextLength(1023); | ||
124 | // Build the list of gestures | 125 | // Build the list of gestures |
125 | refreshGestures(); | 126 | refreshGestures(); |
126 | 127 | ||
diff --git a/linden/indra/newview/llcontroldef.cpp b/linden/indra/newview/llcontroldef.cpp index 7989791..11b97b4 100644 --- a/linden/indra/newview/llcontroldef.cpp +++ b/linden/indra/newview/llcontroldef.cpp | |||
@@ -573,7 +573,7 @@ void declare_settings() | |||
573 | 573 | ||
574 | gSavedSettings.declareBOOL("ShowAxes", FALSE, "Render coordinate frame at your position"); | 574 | gSavedSettings.declareBOOL("ShowAxes", FALSE, "Render coordinate frame at your position"); |
575 | 575 | ||
576 | gSavedSettings.declareBOOL("ShowMiniMap", FALSE, "Display mini map on login"); | 576 | gSavedSettings.declareBOOL("ShowMiniMap", TRUE, "Display mini map on login"); |
577 | gSavedSettings.declareBOOL("ShowWorldMap", FALSE, "Display world map on login"); | 577 | gSavedSettings.declareBOOL("ShowWorldMap", FALSE, "Display world map on login"); |
578 | gSavedSettings.declareBOOL("ShowToolBar", TRUE, "Show toolbar at bottom of screen"); | 578 | gSavedSettings.declareBOOL("ShowToolBar", TRUE, "Show toolbar at bottom of screen"); |
579 | gSavedSettings.declareBOOL("ShowCameraControls", FALSE, "Display camera controls on login"); | 579 | gSavedSettings.declareBOOL("ShowCameraControls", FALSE, "Display camera controls on login"); |
@@ -833,7 +833,7 @@ void declare_settings() | |||
833 | // Previews - only width and height are used | 833 | // Previews - only width and height are used |
834 | gSavedSettings.declareRect("PreviewTextureRect", LLRect(0, 400, 400, 0), "Rectangle for texture preview window" ); // Only width and height are used | 834 | gSavedSettings.declareRect("PreviewTextureRect", LLRect(0, 400, 400, 0), "Rectangle for texture preview window" ); // Only width and height are used |
835 | gSavedSettings.declareRect("PreviewScriptRect", LLRect(0, 550, 500, 0), "Rectangle for script preview window" ); // Only width and height are used | 835 | gSavedSettings.declareRect("PreviewScriptRect", LLRect(0, 550, 500, 0), "Rectangle for script preview window" ); // Only width and height are used |
836 | gSavedSettings.declareRect("LSLHelpRect", LLRect(0, 500, 600, 0), "Rectangle for LSL help window" ); // Only width and height are used | 836 | gSavedSettings.declareRect("LSLHelpRect", LLRect(0, 400, 400, 0), "Rectangle for LSL help window" ); // Only width and height are used |
837 | gSavedSettings.declareRect("PreviewLandmarkRect", LLRect(0, 90, 300, 0), "Rectangle for landmark preview window" ); // Only width and height are used | 837 | gSavedSettings.declareRect("PreviewLandmarkRect", LLRect(0, 90, 300, 0), "Rectangle for landmark preview window" ); // Only width and height are used |
838 | gSavedSettings.declareRect("PreviewSoundRect", LLRect(0, 85, 300, 0), "Rectangle for sound preview window" ); // Only width and height are used | 838 | gSavedSettings.declareRect("PreviewSoundRect", LLRect(0, 85, 300, 0), "Rectangle for sound preview window" ); // Only width and height are used |
839 | gSavedSettings.declareRect("PreviewObjectRect", LLRect(0, 85, 300, 0), "Rectangle for object preview window" ); // Only width and height are used | 839 | gSavedSettings.declareRect("PreviewObjectRect", LLRect(0, 85, 300, 0), "Rectangle for object preview window" ); // Only width and height are used |
@@ -1145,15 +1145,18 @@ void declare_settings() | |||
1145 | 1145 | ||
1146 | 1146 | ||
1147 | gSavedSettings.declareBOOL("NotifyMoneyChange", TRUE, "Pop up notifications for all financial transactions"); | 1147 | gSavedSettings.declareBOOL("NotifyMoneyChange", TRUE, "Pop up notifications for all financial transactions"); |
1148 | gSavedSettings.declareBOOL("ShowNewInventory", TRUE, | ||
1149 | "Automatic Previews of new notecards/textures/landmarks"); | ||
1148 | 1150 | ||
1149 | // Bitfield | 1151 | // Bitfield |
1150 | // 1 = by date | 1152 | // 1 = by date |
1151 | // 2 = folders always by name | 1153 | // 2 = folders always by name |
1154 | // 4 = system folders to top | ||
1152 | // This where the default first time user gets his settings. | 1155 | // This where the default first time user gets his settings. |
1153 | gSavedSettings.declareU32("InventorySortOrder", 1 | 2, "Specifies sort key for inventory items (+0 = name, +1 = date, +2 = folders always by name)"); | 1156 | gSavedSettings.declareU32("InventorySortOrder", 1 | 2 | 4, "Specifies sort key for inventory items (+0 = name, +1 = date, +2 = folders always by name, +4 = system folders to top)"); |
1154 | gSavedSettings.declareU32("RecentItemsSortOrder", 1, "Specifies sort key for recent inventory items (+0 = name, +1 = date, +2 = folders always by name)"); | 1157 | gSavedSettings.declareU32("RecentItemsSortOrder", 1, "Specifies sort key for recent inventory items (+0 = name, +1 = date, +2 = folders always by name, +4 = system folders to top)"); |
1155 | gSavedSettings.declareU32("TexturePickerSortOrder", 2, "Specifies sort key for textures in texture picker (+0 = name, +1 = date, +2 = folders always by name)"); | 1158 | gSavedSettings.declareU32("TexturePickerSortOrder", 2, "Specifies sort key for textures in texture picker (+0 = name, +1 = date, +2 = folders always by name, +4 = system folders to top)"); |
1156 | gSavedSettings.declareU32("AvatarPickerSortOrder", 2, "Specifies sort key for textures in avatar picker (+0 = name, +1 = date, +2 = folders always by name)"); | 1159 | gSavedSettings.declareU32("AvatarPickerSortOrder", 2, "Specifies sort key for textures in avatar picker (+0 = name, +1 = date, +2 = folders always by name, +4 = system folders to top)"); |
1157 | 1160 | ||
1158 | // Pixels away from edge that windows snap. | 1161 | // Pixels away from edge that windows snap. |
1159 | gSavedSettings.declareS32("SnapMargin", 10, "Controls maximum distance between windows before they auto-snap together (pixels)"); | 1162 | gSavedSettings.declareS32("SnapMargin", 10, "Controls maximum distance between windows before they auto-snap together (pixels)"); |
diff --git a/linden/indra/newview/lldebugmessagebox.cpp b/linden/indra/newview/lldebugmessagebox.cpp index af500da..e238800 100644 --- a/linden/indra/newview/lldebugmessagebox.cpp +++ b/linden/indra/newview/lldebugmessagebox.cpp | |||
@@ -225,21 +225,21 @@ void LLDebugVarMessageBox::draw() | |||
225 | 225 | ||
226 | if(mAnimate) | 226 | if(mAnimate) |
227 | { | 227 | { |
228 | F32 animated_val = clamp_rescale(fmodf((F32)LLFrameTimer::getElapsedSeconds() / 5.f, 1.f), 0.f, 1.f, 0.f, mSlider1->getMaxValue()); | ||
229 | if (mSlider1) | 228 | if (mSlider1) |
230 | { | 229 | { |
230 | F32 animated_val = clamp_rescale(fmodf((F32)LLFrameTimer::getElapsedSeconds() / 5.f, 1.f), 0.f, 1.f, 0.f, mSlider1->getMaxValue()); | ||
231 | mSlider1->setValue(animated_val); | 231 | mSlider1->setValue(animated_val); |
232 | slider_changed(mSlider1, this); | 232 | slider_changed(mSlider1, this); |
233 | } | 233 | if (mSlider2) |
234 | if (mSlider2) | 234 | { |
235 | { | 235 | mSlider2->setValue(animated_val); |
236 | mSlider2->setValue(animated_val); | 236 | slider_changed(mSlider2, this); |
237 | slider_changed(mSlider2, this); | 237 | } |
238 | } | 238 | if (mSlider3) |
239 | if (mSlider3) | 239 | { |
240 | { | 240 | mSlider3->setValue(animated_val); |
241 | mSlider3->setValue(animated_val); | 241 | slider_changed(mSlider3, this); |
242 | slider_changed(mSlider3, this); | 242 | } |
243 | } | 243 | } |
244 | } | 244 | } |
245 | LLFloater::draw(); | 245 | LLFloater::draw(); |
diff --git a/linden/indra/newview/lldrawpoolavatar.cpp b/linden/indra/newview/lldrawpoolavatar.cpp index debcfe2..b864449 100644 --- a/linden/indra/newview/lldrawpoolavatar.cpp +++ b/linden/indra/newview/lldrawpoolavatar.cpp | |||
@@ -102,7 +102,8 @@ BOOL gRenderAvatar = TRUE; | |||
102 | 102 | ||
103 | S32 LLDrawPoolAvatar::getVertexShaderLevel() const | 103 | S32 LLDrawPoolAvatar::getVertexShaderLevel() const |
104 | { | 104 | { |
105 | return (S32) LLShaderMgr::getVertexShaderLevel(LLShaderMgr::SHADER_AVATAR); | 105 | return sShaderLevel; |
106 | //return (S32) LLShaderMgr::getVertexShaderLevel(LLShaderMgr::SHADER_AVATAR); | ||
106 | } | 107 | } |
107 | 108 | ||
108 | void LLDrawPoolAvatar::prerender() | 109 | void LLDrawPoolAvatar::prerender() |
@@ -197,20 +198,22 @@ void LLDrawPoolAvatar::endFootShadow() | |||
197 | 198 | ||
198 | void LLDrawPoolAvatar::beginRigid() | 199 | void LLDrawPoolAvatar::beginRigid() |
199 | { | 200 | { |
200 | sVertexProgram = &gAvatarEyeballProgram; | 201 | sVertexProgram = NULL; |
202 | sShaderLevel = 0; | ||
201 | glEnableClientState(GL_NORMAL_ARRAY); | 203 | glEnableClientState(GL_NORMAL_ARRAY); |
202 | glEnableClientState(GL_TEXTURE_COORD_ARRAY); | 204 | glEnableClientState(GL_TEXTURE_COORD_ARRAY); |
203 | 205 | ||
204 | if (sShaderLevel > 0) | 206 | /*if (sShaderLevel > 0) |
205 | { //eyeballs render with the specular shader | 207 | { //eyeballs render with the specular shader |
206 | gAvatarEyeballProgram.bind(); | 208 | gAvatarEyeballProgram.bind(); |
207 | gMaterialIndex = gAvatarEyeballProgram.mAttribute[LLShaderMgr::MATERIAL_COLOR]; | 209 | gMaterialIndex = gAvatarEyeballProgram.mAttribute[LLShaderMgr::MATERIAL_COLOR]; |
208 | gSpecularIndex = gAvatarEyeballProgram.mAttribute[LLShaderMgr::SPECULAR_COLOR]; | 210 | gSpecularIndex = gAvatarEyeballProgram.mAttribute[LLShaderMgr::SPECULAR_COLOR]; |
209 | } | 211 | }*/ |
210 | } | 212 | } |
211 | 213 | ||
212 | void LLDrawPoolAvatar::endRigid() | 214 | void LLDrawPoolAvatar::endRigid() |
213 | { | 215 | { |
216 | sShaderLevel = mVertexShaderLevel; | ||
214 | glDisableClientState(GL_NORMAL_ARRAY); | 217 | glDisableClientState(GL_NORMAL_ARRAY); |
215 | glDisableClientState(GL_TEXTURE_COORD_ARRAY); | 218 | glDisableClientState(GL_TEXTURE_COORD_ARRAY); |
216 | } | 219 | } |
diff --git a/linden/indra/newview/lldriverparam.cpp b/linden/indra/newview/lldriverparam.cpp index ce42ad5..463888c 100644 --- a/linden/indra/newview/lldriverparam.cpp +++ b/linden/indra/newview/lldriverparam.cpp | |||
@@ -346,7 +346,7 @@ const LLVector3* LLDriverParam::getNextDistortion(U32 *index, LLPolyMesh **poly_ | |||
346 | 346 | ||
347 | // We're already in the middle of a param's distortions, so get the next one. | 347 | // We're already in the middle of a param's distortions, so get the next one. |
348 | const LLVector3* v = driven->mParam->getNextDistortion( index, poly_mesh ); | 348 | const LLVector3* v = driven->mParam->getNextDistortion( index, poly_mesh ); |
349 | if( !v ) | 349 | if( (!v) && (iter != mDriven.end()) ) |
350 | { | 350 | { |
351 | // This param is finished, so start the next param. It might not have any | 351 | // This param is finished, so start the next param. It might not have any |
352 | // distortions, though, so we have to loop to find the next param that does. | 352 | // distortions, though, so we have to loop to find the next param that does. |
diff --git a/linden/indra/newview/lleventpoll.cpp b/linden/indra/newview/lleventpoll.cpp index 9c5a19d..7430fc3 100644 --- a/linden/indra/newview/lleventpoll.cpp +++ b/linden/indra/newview/lleventpoll.cpp | |||
@@ -79,7 +79,7 @@ LLEventPoll::Impl& LLEventPoll::Impl::start( | |||
79 | 79 | ||
80 | void LLEventPoll::Impl::stop() | 80 | void LLEventPoll::Impl::stop() |
81 | { | 81 | { |
82 | llinfos << "LLEventPoll::Impl::stop <" << mCount << "> " | 82 | lldebugs << "LLEventPoll::Impl::stop <" << mCount << "> " |
83 | << mPollURL << llendl; | 83 | << mPollURL << llendl; |
84 | // there should be a way to stop a LLHTTPClient request in progress | 84 | // there should be a way to stop a LLHTTPClient request in progress |
85 | mDone = true; | 85 | mDone = true; |
diff --git a/linden/indra/newview/llfasttimerview.cpp b/linden/indra/newview/llfasttimerview.cpp index c469d8c..c7be3aa 100644 --- a/linden/indra/newview/llfasttimerview.cpp +++ b/linden/indra/newview/llfasttimerview.cpp | |||
@@ -1108,6 +1108,15 @@ F64 LLFastTimerView::getTime(LLFastTimer::EFastTimerType tidx) | |||
1108 | break; | 1108 | break; |
1109 | } | 1109 | } |
1110 | } | 1110 | } |
1111 | |||
1112 | if (i == FTV_DISPLAY_NUM) | ||
1113 | { | ||
1114 | // walked off the end of ft_display_table without finding | ||
1115 | // the desired timer type | ||
1116 | llwarns << "Timer type " << tidx << " not known." << llendl; | ||
1117 | return F64(0.0); | ||
1118 | } | ||
1119 | |||
1111 | S32 table_idx = i; | 1120 | S32 table_idx = i; |
1112 | 1121 | ||
1113 | // Add child ticks to parent | 1122 | // Add child ticks to parent |
diff --git a/linden/indra/newview/llfeaturemanager.cpp b/linden/indra/newview/llfeaturemanager.cpp index 57fbc64..2a30680 100644 --- a/linden/indra/newview/llfeaturemanager.cpp +++ b/linden/indra/newview/llfeaturemanager.cpp | |||
@@ -60,6 +60,8 @@ extern void write_debug(const std::string& str); | |||
60 | 60 | ||
61 | #if LL_DARWIN | 61 | #if LL_DARWIN |
62 | const char FEATURE_TABLE_FILENAME[] = "featuretable_mac.txt"; | 62 | const char FEATURE_TABLE_FILENAME[] = "featuretable_mac.txt"; |
63 | #elif LL_LINUX | ||
64 | const char FEATURE_TABLE_FILENAME[] = "featuretable_linux.txt"; | ||
63 | #else | 65 | #else |
64 | const char FEATURE_TABLE_FILENAME[] = "featuretable.txt"; | 66 | const char FEATURE_TABLE_FILENAME[] = "featuretable.txt"; |
65 | #endif | 67 | #endif |
diff --git a/linden/indra/newview/llfilepicker.cpp b/linden/indra/newview/llfilepicker.cpp index 971743b..24d3932 100644 --- a/linden/indra/newview/llfilepicker.cpp +++ b/linden/indra/newview/llfilepicker.cpp | |||
@@ -451,8 +451,9 @@ void LLFilePicker::reset() | |||
451 | 451 | ||
452 | void LLFilePicker::buildFilename( void ) | 452 | void LLFilePicker::buildFilename( void ) |
453 | { | 453 | { |
454 | strncpy( mFilename, mFiles, LL_MAX_PATH ); /*Flawfinder: ignore*/ | 454 | strncpy( mFilename, mFiles, LL_MAX_PATH ); |
455 | S32 len = strlen( mFilename ); /*Flawfinder: ignore*/ | 455 | mFilename[LL_MAX_PATH-1] = '\0'; // stupid strncpy |
456 | S32 len = strlen( mFilename ); | ||
456 | 457 | ||
457 | strncat(mFilename,gDirUtilp->getDirDelimiter().c_str(), sizeof(mFilename)-len+1); /*Flawfinder: ignore*/ | 458 | strncat(mFilename,gDirUtilp->getDirDelimiter().c_str(), sizeof(mFilename)-len+1); /*Flawfinder: ignore*/ |
458 | len += strlen(gDirUtilp->getDirDelimiter().c_str()); /*Flawfinder: ignore*/ | 459 | len += strlen(gDirUtilp->getDirDelimiter().c_str()); /*Flawfinder: ignore*/ |
@@ -858,7 +859,10 @@ void LLFilePicker::getFilePath(SInt32 index) | |||
858 | { | 859 | { |
859 | mFiles[0] = 0; | 860 | mFiles[0] = 0; |
860 | if (mFileVector.size()) | 861 | if (mFileVector.size()) |
861 | strncpy(mFiles, mFileVector[index].c_str(), sizeof(mFiles)); /*Flawfinder: ignore*/ | 862 | { |
863 | strncpy(mFiles, mFileVector[index].c_str(), sizeof(mFiles)); | ||
864 | mFiles[sizeof(mFiles)-1] = '\0'; // stupid strncpy | ||
865 | } | ||
862 | } | 866 | } |
863 | 867 | ||
864 | void LLFilePicker::getFileName(SInt32 index) | 868 | void LLFilePicker::getFileName(SInt32 index) |
@@ -868,7 +872,10 @@ void LLFilePicker::getFileName(SInt32 index) | |||
868 | { | 872 | { |
869 | char *start = strrchr(mFileVector[index].c_str(), '/'); | 873 | char *start = strrchr(mFileVector[index].c_str(), '/'); |
870 | if (start && ((start + 1 - mFileVector[index].c_str()) < (mFileVector[index].size()))) | 874 | if (start && ((start + 1 - mFileVector[index].c_str()) < (mFileVector[index].size()))) |
871 | strncpy(mFilename, start + 1, sizeof(mFilename)); /*Flawfinder: ignore*/ | 875 | { |
876 | strncpy(mFilename, start + 1, sizeof(mFilename)); | ||
877 | mFilename[sizeof(mFilename)-1] = '\0';// stupid strncpy | ||
878 | } | ||
872 | } | 879 | } |
873 | } | 880 | } |
874 | 881 | ||
diff --git a/linden/indra/newview/llfloateranimpreview.cpp b/linden/indra/newview/llfloateranimpreview.cpp index 6802fb2..b1f8a53 100644 --- a/linden/indra/newview/llfloateranimpreview.cpp +++ b/linden/indra/newview/llfloateranimpreview.cpp | |||
@@ -54,7 +54,7 @@ | |||
54 | #include "llviewercamera.h" | 54 | #include "llviewercamera.h" |
55 | #include "llviewerobjectlist.h" | 55 | #include "llviewerobjectlist.h" |
56 | #include "llviewerwindow.h" | 56 | #include "llviewerwindow.h" |
57 | #include "llviewermenu.h" | 57 | #include "llviewermenufile.h" // upload_new_resource() |
58 | #include "llvoavatar.h" | 58 | #include "llvoavatar.h" |
59 | #include "pipeline.h" | 59 | #include "pipeline.h" |
60 | #include "viewer.h" | 60 | #include "viewer.h" |
@@ -221,7 +221,7 @@ BOOL LLFloaterAnimPreview::postBuild() | |||
221 | } | 221 | } |
222 | 222 | ||
223 | apr_file_close(fp); | 223 | apr_file_close(fp); |
224 | delete file_buffer; | 224 | delete[] file_buffer; |
225 | } | 225 | } |
226 | } | 226 | } |
227 | 227 | ||
@@ -247,11 +247,11 @@ BOOL LLFloaterAnimPreview::postBuild() | |||
247 | // pass animation data through memory buffer | 247 | // pass animation data through memory buffer |
248 | loaderp->serialize(dp); | 248 | loaderp->serialize(dp); |
249 | dp.reset(); | 249 | dp.reset(); |
250 | BOOL success = motionp->deserialize(dp); | 250 | BOOL success = motionp && motionp->deserialize(dp); |
251 | 251 | ||
252 | delete []buffer; | 252 | delete []buffer; |
253 | 253 | ||
254 | if (motionp && success) | 254 | if (success) |
255 | { | 255 | { |
256 | const LLBBoxLocal &pelvis_bbox = motionp->getPelvisBBox(); | 256 | const LLBBoxLocal &pelvis_bbox = motionp->getPelvisBBox(); |
257 | 257 | ||
diff --git a/linden/indra/newview/llfloateravatarinfo.cpp b/linden/indra/newview/llfloateravatarinfo.cpp index c0351ee..2245d31 100644 --- a/linden/indra/newview/llfloateravatarinfo.cpp +++ b/linden/indra/newview/llfloateravatarinfo.cpp | |||
@@ -195,7 +195,6 @@ void LLFloaterAvatarInfo::showFromDirectory(const LLUUID &avatar_id) | |||
195 | { | 195 | { |
196 | // ...bring that window to front | 196 | // ...bring that window to front |
197 | floater = gAvatarInfoInstances.getData(avatar_id); | 197 | floater = gAvatarInfoInstances.getData(avatar_id); |
198 | floater->open(); /*Flawfinder: ignore*/ | ||
199 | } | 198 | } |
200 | else | 199 | else |
201 | { | 200 | { |
@@ -203,7 +202,10 @@ void LLFloaterAvatarInfo::showFromDirectory(const LLUUID &avatar_id) | |||
203 | avatar_id); | 202 | avatar_id); |
204 | floater->center(); | 203 | floater->center(); |
205 | floater->mPanelAvatarp->setAvatarID(avatar_id, "", ONLINE_STATUS_NO); | 204 | floater->mPanelAvatarp->setAvatarID(avatar_id, "", ONLINE_STATUS_NO); |
206 | floater->open(); /*Flawfinder: ignore*/ | 205 | } |
206 | if(floater) | ||
207 | { | ||
208 | floater->open(); | ||
207 | } | 209 | } |
208 | } | 210 | } |
209 | 211 | ||
diff --git a/linden/indra/newview/llfloaterfriends.cpp b/linden/indra/newview/llfloaterfriends.cpp index 8d39890..d01a24b 100644 --- a/linden/indra/newview/llfloaterfriends.cpp +++ b/linden/indra/newview/llfloaterfriends.cpp | |||
@@ -287,6 +287,7 @@ void LLFloaterFriends::refreshRightsChangeList(U8 state) | |||
287 | bool can_change_online_multiple = true; | 287 | bool can_change_online_multiple = true; |
288 | bool can_change_map_multiple = true; | 288 | bool can_change_map_multiple = true; |
289 | LLTextBox* processing_label = LLUICtrlFactory::getTextBoxByName(this, "process_rights_label"); | 289 | LLTextBox* processing_label = LLUICtrlFactory::getTextBoxByName(this, "process_rights_label"); |
290 | |||
290 | if(!mAllowRightsChange) | 291 | if(!mAllowRightsChange) |
291 | { | 292 | { |
292 | if(processing_label) | 293 | if(processing_label) |
@@ -302,9 +303,10 @@ void LLFloaterFriends::refreshRightsChangeList(U8 state) | |||
302 | processing_label->setVisible(false); | 303 | processing_label->setVisible(false); |
303 | } | 304 | } |
304 | } | 305 | } |
306 | |||
305 | if(state == 1) | 307 | if(state == 1) |
306 | { | 308 | { |
307 | if(!friend_status->isOnline()) | 309 | if(friend_status && !friend_status->isOnline()) |
308 | { | 310 | { |
309 | childSetEnabled("offer_teleport_btn", false); | 311 | childSetEnabled("offer_teleport_btn", false); |
310 | } | 312 | } |
diff --git a/linden/indra/newview/llfloatergroupinfo.cpp b/linden/indra/newview/llfloatergroupinfo.cpp index 348f31f..3e8eae5 100644 --- a/linden/indra/newview/llfloatergroupinfo.cpp +++ b/linden/indra/newview/llfloatergroupinfo.cpp | |||
@@ -191,7 +191,7 @@ void LLFloaterGroupInfo::showNotice(const char* subject, | |||
191 | // We need to clean up that inventory offer. | 191 | // We need to clean up that inventory offer. |
192 | if (inventory_offer) | 192 | if (inventory_offer) |
193 | { | 193 | { |
194 | inventory_offer_callback( 1 , inventory_offer); | 194 | inventory_offer_callback( IOR_DECLINE , inventory_offer); |
195 | } | 195 | } |
196 | return; | 196 | return; |
197 | } | 197 | } |
@@ -203,7 +203,7 @@ void LLFloaterGroupInfo::showNotice(const char* subject, | |||
203 | // We need to clean up that inventory offer. | 203 | // We need to clean up that inventory offer. |
204 | if (inventory_offer) | 204 | if (inventory_offer) |
205 | { | 205 | { |
206 | inventory_offer_callback( 1 , inventory_offer); | 206 | inventory_offer_callback( IOR_DECLINE , inventory_offer); |
207 | } | 207 | } |
208 | return; | 208 | return; |
209 | } | 209 | } |
diff --git a/linden/indra/newview/llfloaterhtml.cpp b/linden/indra/newview/llfloaterhtml.cpp index 519a031..0c5bdcd 100644 --- a/linden/indra/newview/llfloaterhtml.cpp +++ b/linden/indra/newview/llfloaterhtml.cpp | |||
@@ -49,8 +49,12 @@ LLFloaterHtml* LLFloaterHtml::getInstance() | |||
49 | //////////////////////////////////////////////////////////////////////////////// | 49 | //////////////////////////////////////////////////////////////////////////////// |
50 | // | 50 | // |
51 | LLFloaterHtml::LLFloaterHtml() | 51 | LLFloaterHtml::LLFloaterHtml() |
52 | : LLFloater( "HTML Floater" ), | 52 | : LLFloater( "HTML Floater" ) |
53 | |||
54 | #if LL_LIBXUL_ENABLED | ||
55 | , | ||
53 | mWebBrowser( 0 ) | 56 | mWebBrowser( 0 ) |
57 | #endif // LL_LIBXUL_ENABLED | ||
54 | { | 58 | { |
55 | // create floater from its XML definition | 59 | // create floater from its XML definition |
56 | gUICtrlFactory->buildFloater( this, "floater_html.xml" ); | 60 | gUICtrlFactory->buildFloater( this, "floater_html.xml" ); |
@@ -60,6 +64,7 @@ LLFloaterHtml::LLFloaterHtml() | |||
60 | reshape( rect.getWidth(), rect.getHeight(), FALSE ); | 64 | reshape( rect.getWidth(), rect.getHeight(), FALSE ); |
61 | setRect( rect ); | 65 | setRect( rect ); |
62 | 66 | ||
67 | #if LL_LIBXUL_ENABLED | ||
63 | mWebBrowser = LLViewerUICtrlFactory::getWebBrowserByName(this, "html_floater_browser" ); | 68 | mWebBrowser = LLViewerUICtrlFactory::getWebBrowserByName(this, "html_floater_browser" ); |
64 | if ( mWebBrowser ) | 69 | if ( mWebBrowser ) |
65 | { | 70 | { |
@@ -72,7 +77,8 @@ LLFloaterHtml::LLFloaterHtml() | |||
72 | // don't automatically open secondlife links since we want to catch | 77 | // don't automatically open secondlife links since we want to catch |
73 | // special ones that do other stuff (like open F1 Help) | 78 | // special ones that do other stuff (like open F1 Help) |
74 | mWebBrowser->setOpenSecondLifeLinksInMap( false ); | 79 | mWebBrowser->setOpenSecondLifeLinksInMap( false ); |
75 | }; | 80 | } |
81 | #endif // LL_LIBXUL_ENABLED | ||
76 | 82 | ||
77 | childSetAction("close_btn", onClickClose, this); | 83 | childSetAction("close_btn", onClickClose, this); |
78 | setDefaultBtn("close_btn"); | 84 | setDefaultBtn("close_btn"); |
@@ -82,9 +88,11 @@ LLFloaterHtml::LLFloaterHtml() | |||
82 | // | 88 | // |
83 | LLFloaterHtml::~LLFloaterHtml() | 89 | LLFloaterHtml::~LLFloaterHtml() |
84 | { | 90 | { |
91 | #if LL_LIBXUL_ENABLED | ||
85 | // stop observing browser events | 92 | // stop observing browser events |
86 | if ( mWebBrowser ) | 93 | if ( mWebBrowser ) |
87 | mWebBrowser->remObserver( this ); | 94 | mWebBrowser->remObserver( this ); |
95 | #endif // LL_LIBXUL_ENABLED | ||
88 | 96 | ||
89 | // save position of floater | 97 | // save position of floater |
90 | gSavedSettings.setRect( "HtmlFloaterRect", mRect ); | 98 | gSavedSettings.setRect( "HtmlFloaterRect", mRect ); |
@@ -103,9 +111,11 @@ void LLFloaterHtml::show( LLString content_id ) | |||
103 | // set the title | 111 | // set the title |
104 | setTitle( childGetValue( title_str ).asString() ); | 112 | setTitle( childGetValue( title_str ).asString() ); |
105 | 113 | ||
114 | #if LL_LIBXUL_ENABLED | ||
106 | // navigate to the URL | 115 | // navigate to the URL |
107 | if ( mWebBrowser ) | 116 | if ( mWebBrowser ) |
108 | mWebBrowser->navigateTo( childGetValue( url_str ).asString() ); | 117 | mWebBrowser->navigateTo( childGetValue( url_str ).asString() ); |
118 | #endif // LL_LIBXUL_ENABLED | ||
109 | 119 | ||
110 | // make floater appear | 120 | // make floater appear |
111 | setVisibleAndFrontmost(); | 121 | setVisibleAndFrontmost(); |
@@ -131,6 +141,7 @@ void LLFloaterHtml::onClickClose( void* data ) | |||
131 | // | 141 | // |
132 | void LLFloaterHtml::onClickLinkSecondLife( const EventType& eventIn ) | 142 | void LLFloaterHtml::onClickLinkSecondLife( const EventType& eventIn ) |
133 | { | 143 | { |
144 | #if LL_LIBXUL_ENABLED | ||
134 | const std::string protocol( "secondlife://app." ); | 145 | const std::string protocol( "secondlife://app." ); |
135 | 146 | ||
136 | // special 'app' secondlife link (using a different protocol - one that isn't registered in the browser) causes bad | 147 | // special 'app' secondlife link (using a different protocol - one that isn't registered in the browser) causes bad |
@@ -144,11 +155,12 @@ void LLFloaterHtml::onClickLinkSecondLife( const EventType& eventIn ) | |||
144 | if ( LLString::compareInsensitive( cmd.c_str() , "floater.html.help" ) == 0 ) | 155 | if ( LLString::compareInsensitive( cmd.c_str() , "floater.html.help" ) == 0 ) |
145 | { | 156 | { |
146 | gViewerHtmlHelp.show(); | 157 | gViewerHtmlHelp.show(); |
147 | }; | 158 | } |
148 | } | 159 | } |
149 | else | 160 | else |
150 | // regular secondlife link - just open the map as normal | 161 | // regular secondlife link - just open the map as normal |
151 | { | 162 | { |
152 | mWebBrowser->openMapAtlocation( eventIn.getStringValue() ); | 163 | mWebBrowser->openMapAtlocation( eventIn.getStringValue() ); |
153 | }; | 164 | } |
154 | }; \ No newline at end of file | 165 | #endif // LL_LIBXUL_ENABLED |
166 | }; | ||
diff --git a/linden/indra/newview/llfloaterhtml.h b/linden/indra/newview/llfloaterhtml.h index 9a09baf..fef57d0 100644 --- a/linden/indra/newview/llfloaterhtml.h +++ b/linden/indra/newview/llfloaterhtml.h | |||
@@ -51,9 +51,11 @@ class LLFloaterHtml : | |||
51 | 51 | ||
52 | private: | 52 | private: |
53 | LLFloaterHtml(); | 53 | LLFloaterHtml(); |
54 | #if LL_LIBXUL_ENABLED | ||
54 | LLWebBrowserCtrl* mWebBrowser; | 55 | LLWebBrowserCtrl* mWebBrowser; |
56 | #endif // LL_LIBXUL_ENABLED | ||
55 | static LLFloaterHtml* sInstance; | 57 | static LLFloaterHtml* sInstance; |
56 | LLButton* mCloseButton; | 58 | LLButton* mCloseButton; |
57 | }; | 59 | }; |
58 | 60 | ||
59 | #endif \ No newline at end of file | 61 | #endif |
diff --git a/linden/indra/newview/llfloaterimport.cpp b/linden/indra/newview/llfloaterimport.cpp index 72cf2e0..ed71c1b 100644 --- a/linden/indra/newview/llfloaterimport.cpp +++ b/linden/indra/newview/llfloaterimport.cpp | |||
@@ -44,12 +44,13 @@ | |||
44 | #include "llface.h" | 44 | #include "llface.h" |
45 | #include "llinventorymodel.h" | 45 | #include "llinventorymodel.h" |
46 | #include "lllineeditor.h" | 46 | #include "lllineeditor.h" |
47 | #include "llresourcedata.h" | ||
47 | #include "lltextbox.h" | 48 | #include "lltextbox.h" |
48 | #include "lltoolmgr.h" | 49 | #include "lltoolmgr.h" |
49 | #include "llui.h" | 50 | #include "llui.h" |
50 | #include "lluploaddialog.h" | 51 | #include "lluploaddialog.h" |
51 | #include "llviewercamera.h" | 52 | #include "llviewercamera.h" |
52 | #include "llviewermenu.h" | 53 | #include "llviewermenufile.h" // upload_new_resource() |
53 | #include "llviewerwindow.h" | 54 | #include "llviewerwindow.h" |
54 | #include "llvoavatar.h" | 55 | #include "llvoavatar.h" |
55 | #include "pipeline.h" | 56 | #include "pipeline.h" |
@@ -264,9 +265,8 @@ BOOL LLFloaterImport::postBuild() | |||
264 | FILE* fCheck = LLFile::fopen(image_path.c_str(), "rb"); /*Flawfinder: ignore*/ | 265 | FILE* fCheck = LLFile::fopen(image_path.c_str(), "rb"); /*Flawfinder: ignore*/ |
265 | if (fCheck) | 266 | if (fCheck) |
266 | { | 267 | { |
267 | LLMD5 my_md5_hash(fCheck); | 268 | LLMD5 my_md5_hash(fCheck); // this fclose()s fCheck too |
268 | my_md5_hash.hex_digest(md5_hash_string); | 269 | my_md5_hash.hex_digest(md5_hash_string); |
269 | fclose(fCheck); | ||
270 | 270 | ||
271 | llinfos << "hash: " << md5_hash_string << llendl; | 271 | llinfos << "hash: " << md5_hash_string << llendl; |
272 | } | 272 | } |
@@ -474,7 +474,7 @@ void LLFloaterImport::finishImport(ImportAssetInfo *info) | |||
474 | char *buffer = new char[length]; | 474 | char *buffer = new char[length]; |
475 | ll_apr_file_read(fIn, buffer, length); | 475 | ll_apr_file_read(fIn, buffer, length); |
476 | ll_apr_file_write(fOut, buffer, length); | 476 | ll_apr_file_write(fOut, buffer, length); |
477 | delete buffer; | 477 | delete[] buffer; |
478 | generated_file = true; | 478 | generated_file = true; |
479 | apr_file_close(fOut); | 479 | apr_file_close(fOut); |
480 | } | 480 | } |
diff --git a/linden/indra/newview/llfloaterinspect.cpp b/linden/indra/newview/llfloaterinspect.cpp index 1548c0e..80da7b6 100644 --- a/linden/indra/newview/llfloaterinspect.cpp +++ b/linden/indra/newview/llfloaterinspect.cpp | |||
@@ -64,42 +64,54 @@ void LLFloaterInspect::show(void* ignored) | |||
64 | void LLFloaterInspect::onClickCreatorProfile(void* ctrl) | 64 | void LLFloaterInspect::onClickCreatorProfile(void* ctrl) |
65 | { | 65 | { |
66 | if(sInstance->mObjectList->getAllSelected().size() == 0) return; | 66 | if(sInstance->mObjectList->getAllSelected().size() == 0) return; |
67 | LLSelectNode* obj = sInstance->mObjectSelection->getFirstNode(); | 67 | LLScrollListItem* first_selected = |
68 | LLUUID obj_id, creator_id; | 68 | sInstance->mObjectList->getFirstSelected(); |
69 | obj_id = sInstance->mObjectList->getFirstSelected()->getUUID(); | 69 | |
70 | while(obj) | 70 | if (first_selected) |
71 | { | 71 | { |
72 | if(obj_id == obj->getObject()->getID()) | 72 | LLSelectNode* obj= sInstance->mObjectSelection->getFirstNode(); |
73 | LLUUID obj_id, creator_id; | ||
74 | obj_id = first_selected->getUUID(); | ||
75 | while(obj) | ||
73 | { | 76 | { |
74 | creator_id = obj->mPermissions->getCreator(); | 77 | if(obj_id == obj->getObject()->getID()) |
75 | break; | 78 | { |
79 | creator_id = obj->mPermissions->getCreator(); | ||
80 | break; | ||
81 | } | ||
82 | obj = sInstance->mObjectSelection->getNextNode(); | ||
83 | } | ||
84 | if(obj) | ||
85 | { | ||
86 | LLFloaterAvatarInfo::showFromDirectory(creator_id); | ||
76 | } | 87 | } |
77 | obj = sInstance->mObjectSelection->getNextNode(); | ||
78 | } | ||
79 | if(obj) | ||
80 | { | ||
81 | LLFloaterAvatarInfo::showFromDirectory(creator_id); | ||
82 | } | 88 | } |
83 | } | 89 | } |
84 | 90 | ||
85 | void LLFloaterInspect::onClickOwnerProfile(void* ctrl) | 91 | void LLFloaterInspect::onClickOwnerProfile(void* ctrl) |
86 | { | 92 | { |
87 | if(sInstance->mObjectList->getAllSelected().size() == 0) return; | 93 | if(sInstance->mObjectList->getAllSelected().size() == 0) return; |
88 | LLSelectNode* obj = sInstance->mObjectSelection->getFirstNode(); | 94 | LLScrollListItem* first_selected = |
89 | LLUUID obj_id, owner_id; | 95 | sInstance->mObjectList->getFirstSelected(); |
90 | obj_id = sInstance->mObjectList->getFirstSelected()->getUUID(); | 96 | |
91 | while(obj) | 97 | if (first_selected) |
92 | { | 98 | { |
93 | if(obj_id == obj->getObject()->getID()) | 99 | LLSelectNode* obj= sInstance->mObjectSelection->getFirstNode(); |
100 | LLUUID obj_id, owner_id; | ||
101 | obj_id = first_selected->getUUID(); | ||
102 | while(obj) | ||
94 | { | 103 | { |
95 | owner_id = obj->mPermissions->getOwner(); | 104 | if(obj_id == obj->getObject()->getID()) |
96 | break; | 105 | { |
106 | owner_id = obj->mPermissions->getOwner(); | ||
107 | break; | ||
108 | } | ||
109 | obj = sInstance->mObjectSelection->getNextNode(); | ||
110 | } | ||
111 | if(obj) | ||
112 | { | ||
113 | LLFloaterAvatarInfo::showFromDirectory(owner_id); | ||
97 | } | 114 | } |
98 | obj = sInstance->mObjectSelection->getNextNode(); | ||
99 | } | ||
100 | if(obj) | ||
101 | { | ||
102 | LLFloaterAvatarInfo::showFromDirectory(owner_id); | ||
103 | } | 115 | } |
104 | } | 116 | } |
105 | 117 | ||
@@ -125,7 +137,15 @@ LLUUID LLFloaterInspect::getSelectedUUID() | |||
125 | { | 137 | { |
126 | if(sInstance) | 138 | if(sInstance) |
127 | { | 139 | { |
128 | if(sInstance->mObjectList->getAllSelected().size() > 0) return sInstance->mObjectList->getFirstSelected()->getUUID(); | 140 | if(sInstance->mObjectList->getAllSelected().size() > 0) |
141 | { | ||
142 | LLScrollListItem* first_selected = | ||
143 | sInstance->mObjectList->getFirstSelected(); | ||
144 | if (first_selected) | ||
145 | { | ||
146 | return first_selected->getUUID(); | ||
147 | } | ||
148 | } | ||
129 | } | 149 | } |
130 | return LLUUID::null; | 150 | return LLUUID::null; |
131 | } | 151 | } |
@@ -139,7 +159,15 @@ void LLFloaterInspect::refresh() | |||
139 | childSetEnabled("button creator", false); | 159 | childSetEnabled("button creator", false); |
140 | LLUUID selected_uuid; | 160 | LLUUID selected_uuid; |
141 | S32 selected_index = mObjectList->getFirstSelectedIndex(); | 161 | S32 selected_index = mObjectList->getFirstSelectedIndex(); |
142 | if(selected_index > -1) selected_uuid = mObjectList->getFirstSelected()->getUUID(); | 162 | if(selected_index > -1) |
163 | { | ||
164 | LLScrollListItem* first_selected = | ||
165 | mObjectList->getFirstSelected(); | ||
166 | if (first_selected) | ||
167 | { | ||
168 | selected_uuid = first_selected->getUUID(); | ||
169 | } | ||
170 | } | ||
143 | mObjectList->operateOnAll(LLScrollListCtrl::OP_DELETE); | 171 | mObjectList->operateOnAll(LLScrollListCtrl::OP_DELETE); |
144 | //List all transient objects, then all linked objects | 172 | //List all transient objects, then all linked objects |
145 | LLSelectNode* obj = mObjectSelection->getFirstNode(); | 173 | LLSelectNode* obj = mObjectSelection->getFirstNode(); |
diff --git a/linden/indra/newview/llfloaterland.cpp b/linden/indra/newview/llfloaterland.cpp index 9ff44f4..82b50ec 100644 --- a/linden/indra/newview/llfloaterland.cpp +++ b/linden/indra/newview/llfloaterland.cpp | |||
@@ -1996,12 +1996,18 @@ BOOL LLPanelLandOptions::postBuild() | |||
1996 | 1996 | ||
1997 | 1997 | ||
1998 | mSnapshotCtrl = LLUICtrlFactory::getTexturePickerByName(this, "snapshot_ctrl"); | 1998 | mSnapshotCtrl = LLUICtrlFactory::getTexturePickerByName(this, "snapshot_ctrl"); |
1999 | mSnapshotCtrl->setCommitCallback( onCommitAny ); | 1999 | if (mSnapshotCtrl) |
2000 | mSnapshotCtrl->setCallbackUserData( this ); | 2000 | { |
2001 | mSnapshotCtrl->setAllowNoTexture ( TRUE ); | 2001 | mSnapshotCtrl->setCommitCallback( onCommitAny ); |
2002 | mSnapshotCtrl->setImmediateFilterPermMask(PERM_COPY | PERM_TRANSFER); | 2002 | mSnapshotCtrl->setCallbackUserData( this ); |
2003 | mSnapshotCtrl->setNonImmediateFilterPermMask(PERM_COPY | PERM_TRANSFER); | 2003 | mSnapshotCtrl->setAllowNoTexture ( TRUE ); |
2004 | 2004 | mSnapshotCtrl->setImmediateFilterPermMask(PERM_COPY | PERM_TRANSFER); | |
2005 | mSnapshotCtrl->setNonImmediateFilterPermMask(PERM_COPY | PERM_TRANSFER); | ||
2006 | } | ||
2007 | else | ||
2008 | { | ||
2009 | llwarns << "LLUICtrlFactory::getTexturePickerByName() returned NULL for 'snapshot_ctrl'" << llendl; | ||
2010 | } | ||
2005 | 2011 | ||
2006 | 2012 | ||
2007 | mLocationText = LLUICtrlFactory::getTextBoxByName(this, "Landing Point: (none)"); | 2013 | mLocationText = LLUICtrlFactory::getTextBoxByName(this, "Landing Point: (none)"); |
@@ -2333,12 +2339,19 @@ BOOL LLPanelLandMedia::postBuild() | |||
2333 | 2339 | ||
2334 | 2340 | ||
2335 | mMediaTextureCtrl = LLUICtrlFactory::getTexturePickerByName(this, "media texture"); | 2341 | mMediaTextureCtrl = LLUICtrlFactory::getTexturePickerByName(this, "media texture"); |
2336 | mMediaTextureCtrl->setCommitCallback( onCommitAny ); | 2342 | if (mMediaTextureCtrl) |
2337 | mMediaTextureCtrl->setCallbackUserData( this ); | 2343 | { |
2338 | mMediaTextureCtrl->setAllowNoTexture ( TRUE ); | 2344 | mMediaTextureCtrl->setCommitCallback( onCommitAny ); |
2339 | mMediaTextureCtrl->setImmediateFilterPermMask(PERM_COPY | PERM_TRANSFER); | 2345 | mMediaTextureCtrl->setCallbackUserData( this ); |
2340 | mMediaTextureCtrl->setNonImmediateFilterPermMask(PERM_COPY | PERM_TRANSFER); | 2346 | mMediaTextureCtrl->setAllowNoTexture ( TRUE ); |
2341 | 2347 | mMediaTextureCtrl->setImmediateFilterPermMask(PERM_COPY | PERM_TRANSFER); | |
2348 | mMediaTextureCtrl->setNonImmediateFilterPermMask(PERM_COPY | PERM_TRANSFER); | ||
2349 | } | ||
2350 | else | ||
2351 | { | ||
2352 | llwarns << "LLUICtrlFactory::getTexturePickerByName() returned NULL for 'media texure'" << llendl; | ||
2353 | } | ||
2354 | |||
2342 | mMediaAutoScaleCheck = LLUICtrlFactory::getCheckBoxByName(this, "media_auto_scale"); | 2355 | mMediaAutoScaleCheck = LLUICtrlFactory::getCheckBoxByName(this, "media_auto_scale"); |
2343 | childSetCommitCallback("media_auto_scale", onCommitAny, this); | 2356 | childSetCommitCallback("media_auto_scale", onCommitAny, this); |
2344 | 2357 | ||
diff --git a/linden/indra/newview/llfloaternamedesc.cpp b/linden/indra/newview/llfloaternamedesc.cpp index f5ef7dc..5f41b13 100644 --- a/linden/indra/newview/llfloaternamedesc.cpp +++ b/linden/indra/newview/llfloaternamedesc.cpp | |||
@@ -29,6 +29,8 @@ | |||
29 | #include "llviewerprecompiledheaders.h" | 29 | #include "llviewerprecompiledheaders.h" |
30 | 30 | ||
31 | #include "llfloaternamedesc.h" | 31 | #include "llfloaternamedesc.h" |
32 | |||
33 | // project includes | ||
32 | #include "lllineeditor.h" | 34 | #include "lllineeditor.h" |
33 | #include "llresmgr.h" | 35 | #include "llresmgr.h" |
34 | #include "lltextbox.h" | 36 | #include "lltextbox.h" |
@@ -36,13 +38,16 @@ | |||
36 | #include "llviewerwindow.h" | 38 | #include "llviewerwindow.h" |
37 | #include "llfocusmgr.h" | 39 | #include "llfocusmgr.h" |
38 | #include "llradiogroup.h" | 40 | #include "llradiogroup.h" |
39 | #include "llassetstorage.h" | ||
40 | #include "lldbstrings.h" | 41 | #include "lldbstrings.h" |
41 | #include "lldir.h" | 42 | #include "lldir.h" |
42 | #include "llviewercontrol.h" | 43 | #include "llviewercontrol.h" |
43 | #include "llviewermenu.h" | 44 | #include "llviewermenufile.h" // upload_new_resource() |
44 | #include "llvieweruictrlfactory.h" | 45 | #include "llvieweruictrlfactory.h" |
45 | 46 | ||
47 | // linden includes | ||
48 | #include "llassetstorage.h" | ||
49 | #include "llinventorytype.h" | ||
50 | |||
46 | const S32 PREVIEW_LINE_HEIGHT = 19; | 51 | const S32 PREVIEW_LINE_HEIGHT = 19; |
47 | const S32 PREVIEW_CLOSE_BOX_SIZE = 16; | 52 | const S32 PREVIEW_CLOSE_BOX_SIZE = 16; |
48 | const S32 PREVIEW_BORDER_WIDTH = 2; | 53 | const S32 PREVIEW_BORDER_WIDTH = 2; |
diff --git a/linden/indra/newview/llfloaternewim.cpp b/linden/indra/newview/llfloaternewim.cpp index 2fa2b51..1adb37c 100644 --- a/linden/indra/newview/llfloaternewim.cpp +++ b/linden/indra/newview/llfloaternewim.cpp | |||
@@ -74,8 +74,15 @@ BOOL LLFloaterNewIM::postBuild() | |||
74 | childSetAction("start_btn", &LLFloaterNewIM::onStart, this); | 74 | childSetAction("start_btn", &LLFloaterNewIM::onStart, this); |
75 | childSetAction("close_btn", &LLFloaterNewIM::onClickClose, this); | 75 | childSetAction("close_btn", &LLFloaterNewIM::onClickClose, this); |
76 | mSelectionList = LLViewerUICtrlFactory::getNameListByName(this, "user_list"); | 76 | mSelectionList = LLViewerUICtrlFactory::getNameListByName(this, "user_list"); |
77 | mSelectionList->setDoubleClickCallback(&LLFloaterNewIM::onStart); | 77 | if (mSelectionList) |
78 | mSelectionList->setCallbackUserData(this); | 78 | { |
79 | mSelectionList->setDoubleClickCallback(&LLFloaterNewIM::onStart); | ||
80 | mSelectionList->setCallbackUserData(this); | ||
81 | } | ||
82 | else | ||
83 | { | ||
84 | llwarns << "LLViewerUICtrlFactory::getNameListByName() returned NULL for 'user_list'" << llendl; | ||
85 | } | ||
79 | sOnlineDescriptor = childGetValue("online_descriptor").asString(); | 86 | sOnlineDescriptor = childGetValue("online_descriptor").asString(); |
80 | sNameFormat = childGetValue("name_format").asString(); | 87 | sNameFormat = childGetValue("name_format").asString(); |
81 | setDefaultBtn("start_btn"); | 88 | setDefaultBtn("start_btn"); |
diff --git a/linden/indra/newview/llfloaterpreference.cpp b/linden/indra/newview/llfloaterpreference.cpp index dceadf9..963c268 100644 --- a/linden/indra/newview/llfloaterpreference.cpp +++ b/linden/indra/newview/llfloaterpreference.cpp | |||
@@ -156,6 +156,66 @@ LLPreferenceCore::LLPreferenceCore(LLTabContainerCommon* tab_container, LLButton | |||
156 | // addTabPanel(mWebPanel, "Web", FALSE, onTabChanged, this); | 156 | // addTabPanel(mWebPanel, "Web", FALSE, onTabChanged, this); |
157 | } | 157 | } |
158 | 158 | ||
159 | LLPreferenceCore::~LLPreferenceCore() | ||
160 | { | ||
161 | if (mGeneralPanel) | ||
162 | { | ||
163 | delete mGeneralPanel; | ||
164 | mGeneralPanel = NULL; | ||
165 | } | ||
166 | if (mInputPanel) | ||
167 | { | ||
168 | delete mInputPanel; | ||
169 | mInputPanel = NULL; | ||
170 | } | ||
171 | if (mNetworkPanel) | ||
172 | { | ||
173 | delete mNetworkPanel; | ||
174 | mNetworkPanel = NULL; | ||
175 | } | ||
176 | if (mDisplayPanel) | ||
177 | { | ||
178 | delete mDisplayPanel; | ||
179 | mDisplayPanel = NULL; | ||
180 | } | ||
181 | if (mDisplayPanel2) | ||
182 | { | ||
183 | delete mDisplayPanel2; | ||
184 | mDisplayPanel2 = NULL; | ||
185 | } | ||
186 | if (mDisplayPanel3) | ||
187 | { | ||
188 | delete mDisplayPanel3; | ||
189 | mDisplayPanel3 = NULL; | ||
190 | } | ||
191 | if (mAudioPanel) | ||
192 | { | ||
193 | delete mAudioPanel; | ||
194 | mAudioPanel = NULL; | ||
195 | } | ||
196 | if (mPrefsChat) | ||
197 | { | ||
198 | delete mPrefsChat; | ||
199 | mPrefsChat = NULL; | ||
200 | } | ||
201 | if (mPrefsIM) | ||
202 | { | ||
203 | delete mPrefsIM; | ||
204 | mPrefsIM = NULL; | ||
205 | } | ||
206 | if (mMsgPanel) | ||
207 | { | ||
208 | delete mMsgPanel; | ||
209 | mMsgPanel = NULL; | ||
210 | } | ||
211 | //if (mWebPanel) | ||
212 | //{ | ||
213 | // delete mWebPanel; | ||
214 | // mWebPanel = NULL; | ||
215 | //} | ||
216 | } | ||
217 | |||
218 | |||
159 | void LLPreferenceCore::apply() | 219 | void LLPreferenceCore::apply() |
160 | { | 220 | { |
161 | mGeneralPanel->apply(); | 221 | mGeneralPanel->apply(); |
diff --git a/linden/indra/newview/llfloaterpreference.h b/linden/indra/newview/llfloaterpreference.h index dcef6a0..7a6789f 100644 --- a/linden/indra/newview/llfloaterpreference.h +++ b/linden/indra/newview/llfloaterpreference.h | |||
@@ -58,6 +58,7 @@ class LLPreferenceCore | |||
58 | 58 | ||
59 | public: | 59 | public: |
60 | LLPreferenceCore(LLTabContainerCommon* tab_container, LLButton * default_btn); | 60 | LLPreferenceCore(LLTabContainerCommon* tab_container, LLButton * default_btn); |
61 | ~LLPreferenceCore(); | ||
61 | 62 | ||
62 | void apply(); | 63 | void apply(); |
63 | void cancel(); | 64 | void cancel(); |
diff --git a/linden/indra/newview/llfloaterregioninfo.cpp b/linden/indra/newview/llfloaterregioninfo.cpp index 7fa5f6a..682fda8 100644 --- a/linden/indra/newview/llfloaterregioninfo.cpp +++ b/linden/indra/newview/llfloaterregioninfo.cpp | |||
@@ -74,7 +74,6 @@ | |||
74 | const S32 TERRAIN_TEXTURE_COUNT = 4; | 74 | const S32 TERRAIN_TEXTURE_COUNT = 4; |
75 | const S32 CORNER_COUNT = 4; | 75 | const S32 CORNER_COUNT = 4; |
76 | 76 | ||
77 | #define LL_ENABLE_MAINLAND_VISIBLE_CONTROL 0 | ||
78 | 77 | ||
79 | ///---------------------------------------------------------------------------- | 78 | ///---------------------------------------------------------------------------- |
80 | /// Local class declaration | 79 | /// Local class declaration |
@@ -1920,9 +1919,6 @@ BOOL LLPanelEstateInfo::postBuild() | |||
1920 | { | 1919 | { |
1921 | // set up the callbacks for the generic controls | 1920 | // set up the callbacks for the generic controls |
1922 | initCtrl("externally_visible_check"); | 1921 | initCtrl("externally_visible_check"); |
1923 | #if LL_ENABLE_MAINLAND_VISIBLE_CONTROL | ||
1924 | initCtrl("mainland_visible_check"); | ||
1925 | #endif | ||
1926 | initCtrl("use_global_time_check"); | 1922 | initCtrl("use_global_time_check"); |
1927 | initCtrl("fixed_sun_check"); | 1923 | initCtrl("fixed_sun_check"); |
1928 | initCtrl("allow_direct_teleport"); | 1924 | initCtrl("allow_direct_teleport"); |
@@ -1934,9 +1930,6 @@ BOOL LLPanelEstateInfo::postBuild() | |||
1934 | initHelpBtn("use_global_time_help", "HelpEstateUseGlobalTime"); | 1930 | initHelpBtn("use_global_time_help", "HelpEstateUseGlobalTime"); |
1935 | initHelpBtn("fixed_sun_help", "HelpEstateFixedSun"); | 1931 | initHelpBtn("fixed_sun_help", "HelpEstateFixedSun"); |
1936 | initHelpBtn("externally_visible_help", "HelpEstateExternallyVisible"); | 1932 | initHelpBtn("externally_visible_help", "HelpEstateExternallyVisible"); |
1937 | #if LL_ENABLE_MAINLAND_VISIBLE_CONTROL | ||
1938 | initHelpBtn("mainland_visible_help", "HelpEstateMainlandVisible"); | ||
1939 | #endif | ||
1940 | initHelpBtn("allow_direct_teleport_help", "HelpEstateAllowDirectTeleport"); | 1933 | initHelpBtn("allow_direct_teleport_help", "HelpEstateAllowDirectTeleport"); |
1941 | initHelpBtn("allow_resident_help", "HelpEstateAllowResident"); | 1934 | initHelpBtn("allow_resident_help", "HelpEstateAllowResident"); |
1942 | initHelpBtn("allow_group_help", "HelpEstateAllowGroup"); | 1935 | initHelpBtn("allow_group_help", "HelpEstateAllowGroup"); |
@@ -2105,9 +2098,6 @@ void LLPanelEstateInfo::commitEstateInfo() | |||
2105 | void LLPanelEstateInfo::setEstateFlags(U32 flags) | 2098 | void LLPanelEstateInfo::setEstateFlags(U32 flags) |
2106 | { | 2099 | { |
2107 | childSetValue("externally_visible_check", LLSD(flags & REGION_FLAGS_EXTERNALLY_VISIBLE ? TRUE : FALSE) ); | 2100 | childSetValue("externally_visible_check", LLSD(flags & REGION_FLAGS_EXTERNALLY_VISIBLE ? TRUE : FALSE) ); |
2108 | #if LL_ENABLE_MAINLAND_VISIBLE_CONTROL | ||
2109 | childSetValue("mainland_visible_check", LLSD(flags & REGION_FLAGS_MAINLAND_VISIBLE ? TRUE : FALSE) ); | ||
2110 | #endif | ||
2111 | childSetValue("fixed_sun_check", LLSD(flags & REGION_FLAGS_SUN_FIXED ? TRUE : FALSE) ); | 2101 | childSetValue("fixed_sun_check", LLSD(flags & REGION_FLAGS_SUN_FIXED ? TRUE : FALSE) ); |
2112 | childSetValue("allow_direct_teleport", LLSD(flags & REGION_FLAGS_ALLOW_DIRECT_TELEPORT ? TRUE : FALSE) ); | 2102 | childSetValue("allow_direct_teleport", LLSD(flags & REGION_FLAGS_ALLOW_DIRECT_TELEPORT ? TRUE : FALSE) ); |
2113 | childSetValue("deny_anonymous", LLSD(flags & REGION_FLAGS_DENY_ANONYMOUS ? TRUE : FALSE) ); | 2103 | childSetValue("deny_anonymous", LLSD(flags & REGION_FLAGS_DENY_ANONYMOUS ? TRUE : FALSE) ); |
@@ -2124,15 +2114,6 @@ U32 LLPanelEstateInfo::computeEstateFlags() | |||
2124 | { | 2114 | { |
2125 | flags |= REGION_FLAGS_EXTERNALLY_VISIBLE; | 2115 | flags |= REGION_FLAGS_EXTERNALLY_VISIBLE; |
2126 | } | 2116 | } |
2127 | #if LL_ENABLE_MAINLAND_VISIBLE_CONTROL | ||
2128 | // This flag is ignored by everything. 2006-11-17 Phoenix. | ||
2129 | if (childGetValue("mainland_visible_check").asBoolean()) | ||
2130 | { | ||
2131 | flags |= REGION_FLAGS_MAINLAND_VISIBLE; | ||
2132 | } | ||
2133 | #else | ||
2134 | flags |= REGION_FLAGS_MAINLAND_VISIBLE; | ||
2135 | #endif | ||
2136 | 2117 | ||
2137 | if (childGetValue("allow_direct_teleport").asBoolean()) | 2118 | if (childGetValue("allow_direct_teleport").asBoolean()) |
2138 | { | 2119 | { |
diff --git a/linden/indra/newview/llfloaterreporter.cpp b/linden/indra/newview/llfloaterreporter.cpp index 2e44191..bcbab5b 100644 --- a/linden/indra/newview/llfloaterreporter.cpp +++ b/linden/indra/newview/llfloaterreporter.cpp | |||
@@ -66,10 +66,9 @@ | |||
66 | #include "lluploaddialog.h" | 66 | #include "lluploaddialog.h" |
67 | #include "llcallingcard.h" | 67 | #include "llcallingcard.h" |
68 | #include "llviewerobjectlist.h" | 68 | #include "llviewerobjectlist.h" |
69 | #include "llagent.h" | ||
70 | #include "lltoolobjpicker.h" | 69 | #include "lltoolobjpicker.h" |
71 | #include "lltoolmgr.h" | 70 | #include "lltoolmgr.h" |
72 | #include "llviewermenu.h" // for LLResourceData | 71 | #include "llresourcedata.h" // for LLResourceData |
73 | #include "llviewerwindow.h" | 72 | #include "llviewerwindow.h" |
74 | #include "llviewerimagelist.h" | 73 | #include "llviewerimagelist.h" |
75 | #include "llworldmap.h" | 74 | #include "llworldmap.h" |
@@ -965,8 +964,8 @@ void LLFloaterReporter::uploadDoneCallback(const LLUUID &uuid, void *user_data, | |||
965 | self->mScreenID = uuid; | 964 | self->mScreenID = uuid; |
966 | llinfos << "Got screen shot " << uuid << llendl; | 965 | llinfos << "Got screen shot " << uuid << llendl; |
967 | self->sendReportViaLegacy(self->gatherReport()); | 966 | self->sendReportViaLegacy(self->gatherReport()); |
967 | self->close(); | ||
968 | } | 968 | } |
969 | self->close(); | ||
970 | } | 969 | } |
971 | 970 | ||
972 | 971 | ||
diff --git a/linden/indra/newview/llfloatersellland.cpp b/linden/indra/newview/llfloatersellland.cpp index 49cb14e..49cb14e 100755..100644 --- a/linden/indra/newview/llfloatersellland.cpp +++ b/linden/indra/newview/llfloatersellland.cpp | |||
diff --git a/linden/indra/newview/llfloatersellland.h b/linden/indra/newview/llfloatersellland.h index 1f0af61..1f0af61 100755..100644 --- a/linden/indra/newview/llfloatersellland.h +++ b/linden/indra/newview/llfloatersellland.h | |||
diff --git a/linden/indra/newview/llfloatersnapshot.cpp b/linden/indra/newview/llfloatersnapshot.cpp index af58cd9..5008509 100644 --- a/linden/indra/newview/llfloatersnapshot.cpp +++ b/linden/indra/newview/llfloatersnapshot.cpp | |||
@@ -53,7 +53,7 @@ | |||
53 | #include "llviewerstats.h" | 53 | #include "llviewerstats.h" |
54 | #include "llviewercamera.h" | 54 | #include "llviewercamera.h" |
55 | #include "llviewerwindow.h" | 55 | #include "llviewerwindow.h" |
56 | #include "llviewermenu.h" | 56 | #include "llviewermenufile.h" // upload_new_resource() |
57 | #include "llfloaterpostcard.h" | 57 | #include "llfloaterpostcard.h" |
58 | #include "llcheckboxctrl.h" | 58 | #include "llcheckboxctrl.h" |
59 | #include "llradiogroup.h" | 59 | #include "llradiogroup.h" |
diff --git a/linden/indra/newview/llfloatertest.cpp b/linden/indra/newview/llfloatertest.cpp index 510072d..c5e353a 100644 --- a/linden/indra/newview/llfloatertest.cpp +++ b/linden/indra/newview/llfloatertest.cpp | |||
@@ -227,8 +227,7 @@ LLFloaterTestImpl::LLFloaterTestImpl() | |||
227 | combo = new LLComboBox("combo", | 227 | combo = new LLComboBox("combo", |
228 | LLRect(LEFT, y, LEFT+100, y-LLCOMBOBOX_HEIGHT), | 228 | LLRect(LEFT, y, LEFT+100, y-LLCOMBOBOX_HEIGHT), |
229 | "Combobox Label", | 229 | "Combobox Label", |
230 | onCommitCombo, this, | 230 | onCommitCombo, this); |
231 | 150); // list_width | ||
232 | combo->add("first item"); | 231 | combo->add("first item"); |
233 | combo->add("second item"); | 232 | combo->add("second item"); |
234 | combo->add("should go to the top", ADD_TOP); | 233 | combo->add("should go to the top", ADD_TOP); |
diff --git a/linden/indra/newview/llfloatertools.cpp b/linden/indra/newview/llfloatertools.cpp index 0480628..3931acb 100644 --- a/linden/indra/newview/llfloatertools.cpp +++ b/linden/indra/newview/llfloatertools.cpp | |||
@@ -314,8 +314,8 @@ BOOL LLFloaterTools::postBuild() | |||
314 | mTab->setFollows(FOLLOWS_TOP | FOLLOWS_LEFT); | 314 | mTab->setFollows(FOLLOWS_TOP | FOLLOWS_LEFT); |
315 | mTab->setVisible( gSavedSettings.getBOOL("ToolboxShowMore") ); | 315 | mTab->setVisible( gSavedSettings.getBOOL("ToolboxShowMore") ); |
316 | mTab->setBorderVisible(FALSE); | 316 | mTab->setBorderVisible(FALSE); |
317 | mTab->selectFirstTab(); | ||
317 | } | 318 | } |
318 | mTab->selectFirstTab(); | ||
319 | return TRUE; | 319 | return TRUE; |
320 | } | 320 | } |
321 | 321 | ||
diff --git a/linden/indra/newview/llfloatertos.cpp b/linden/indra/newview/llfloatertos.cpp index 6b38ca8..3ea8c49 100644 --- a/linden/indra/newview/llfloatertos.cpp +++ b/linden/indra/newview/llfloatertos.cpp | |||
@@ -182,7 +182,6 @@ BOOL LLFloaterTOS::postBuild() | |||
182 | childSetValue("tos_text", LLSD(mMessage)); | 182 | childSetValue("tos_text", LLSD(mMessage)); |
183 | #endif | 183 | #endif |
184 | 184 | ||
185 | |||
186 | return TRUE; | 185 | return TRUE; |
187 | } | 186 | } |
188 | 187 | ||
diff --git a/linden/indra/newview/llfolderview.cpp b/linden/indra/newview/llfolderview.cpp index 7bc9cd8..ff0ad3f 100644 --- a/linden/indra/newview/llfolderview.cpp +++ b/linden/indra/newview/llfolderview.cpp | |||
@@ -229,6 +229,16 @@ LLFolderViewItem* LLFolderViewItem::getPreviousOpenNode(BOOL include_children) | |||
229 | return itemp; | 229 | return itemp; |
230 | } | 230 | } |
231 | 231 | ||
232 | // is this item something we think we should be showing? | ||
233 | // for example, if we haven't gotten around to filtering it yet, then the answer is yes | ||
234 | // until we find out otherwise | ||
235 | BOOL LLFolderViewItem::potentiallyVisible() | ||
236 | { | ||
237 | // we haven't been checked against min required filter | ||
238 | // or we have and we passed | ||
239 | return getLastFilterGeneration() < getRoot()->getFilter()->getMinRequiredGeneration() || getFiltered(); | ||
240 | } | ||
241 | |||
232 | BOOL LLFolderViewItem::getFiltered() | 242 | BOOL LLFolderViewItem::getFiltered() |
233 | { | 243 | { |
234 | return mFiltered && mLastFilterGeneration >= mRoot->getFilter()->getMinRequiredGeneration(); | 244 | return mFiltered && mLastFilterGeneration >= mRoot->getFilter()->getMinRequiredGeneration(); |
@@ -335,8 +345,7 @@ void LLFolderViewItem::setSelectionFromRoot(LLFolderViewItem* selection, | |||
335 | } | 345 | } |
336 | 346 | ||
337 | // helper function to change the selection from the root. | 347 | // helper function to change the selection from the root. |
338 | void LLFolderViewItem::changeSelectionFromRoot(LLFolderViewItem* selection, | 348 | void LLFolderViewItem::changeSelectionFromRoot(LLFolderViewItem* selection, BOOL selected) |
339 | BOOL selected) | ||
340 | { | 349 | { |
341 | getRoot()->changeSelection(selection, selected); | 350 | getRoot()->changeSelection(selection, selected); |
342 | } | 351 | } |
@@ -358,6 +367,11 @@ LLString LLFolderViewItem::getWidgetTag() const | |||
358 | return LL_FOLDER_VIEW_ITEM_TAG; | 367 | return LL_FOLDER_VIEW_ITEM_TAG; |
359 | } | 368 | } |
360 | 369 | ||
370 | EInventorySortGroup LLFolderViewItem::getSortGroup() | ||
371 | { | ||
372 | return SG_ITEM; | ||
373 | } | ||
374 | |||
361 | // addToFolder() returns TRUE if it succeeds. FALSE otherwise | 375 | // addToFolder() returns TRUE if it succeeds. FALSE otherwise |
362 | BOOL LLFolderViewItem::addToFolder(LLFolderViewFolder* folder, LLFolderView* root) | 376 | BOOL LLFolderViewItem::addToFolder(LLFolderViewFolder* folder, LLFolderView* root) |
363 | { | 377 | { |
@@ -427,8 +441,7 @@ void LLFolderViewItem::dirtyFilter() | |||
427 | // means 'deselect' for a leaf item. Do this optimization after | 441 | // means 'deselect' for a leaf item. Do this optimization after |
428 | // multiple selection is implemented to make sure it all plays nice | 442 | // multiple selection is implemented to make sure it all plays nice |
429 | // together. | 443 | // together. |
430 | BOOL LLFolderViewItem::setSelection(LLFolderViewItem* selection, BOOL open, | 444 | BOOL LLFolderViewItem::setSelection(LLFolderViewItem* selection, BOOL open, BOOL take_keyboard_focus) |
431 | BOOL take_keyboard_focus) | ||
432 | { | 445 | { |
433 | if( selection == this ) | 446 | if( selection == this ) |
434 | { | 447 | { |
@@ -445,8 +458,7 @@ BOOL LLFolderViewItem::setSelection(LLFolderViewItem* selection, BOOL open, | |||
445 | return mIsSelected; | 458 | return mIsSelected; |
446 | } | 459 | } |
447 | 460 | ||
448 | BOOL LLFolderViewItem::changeSelection(LLFolderViewItem* selection, | 461 | BOOL LLFolderViewItem::changeSelection(LLFolderViewItem* selection, BOOL selected) |
449 | BOOL selected) | ||
450 | { | 462 | { |
451 | if(selection == this && mIsSelected != selected) | 463 | if(selection == this && mIsSelected != selected) |
452 | { | 464 | { |
@@ -788,182 +800,174 @@ BOOL LLFolderViewItem::handleDragAndDrop(S32 x, S32 y, MASK mask, BOOL drop, | |||
788 | 800 | ||
789 | void LLFolderViewItem::draw() | 801 | void LLFolderViewItem::draw() |
790 | { | 802 | { |
791 | if( getVisible() ) | 803 | bool possibly_has_children = false; |
804 | bool up_to_date = mListener && mListener->isUpToDate(); | ||
805 | if((up_to_date && hasVisibleChildren() ) || // we fetched our children and some of them have passed the filter... | ||
806 | (!up_to_date && mListener && mListener->hasChildren())) // ...or we know we have children but haven't fetched them (doesn't obey filter) | ||
792 | { | 807 | { |
793 | bool possibly_has_children = false; | 808 | possibly_has_children = true; |
794 | bool up_to_date = mListener && mListener->isUpToDate(); | 809 | } |
795 | if((up_to_date && hasVisibleChildren() ) || // we fetched our children and some of them have passed the filter... | 810 | if(/*mControlLabel[0] != '\0' && */possibly_has_children) |
796 | (!up_to_date && mListener && mListener->hasChildren())) // ...or we know we have children but haven't fetched them (doesn't obey filter) | 811 | { |
797 | { | 812 | LLGLSTexture gls_texture; |
798 | possibly_has_children = true; | 813 | if (mArrowImage) |
799 | } | ||
800 | if(/*mControlLabel[0] != '\0' && */possibly_has_children) | ||
801 | { | 814 | { |
802 | LLGLSTexture gls_texture; | 815 | gl_draw_scaled_rotated_image(mIndentation, mRect.getHeight() - ARROW_SIZE - TEXT_PAD, |
803 | if (mArrowImage) | 816 | ARROW_SIZE, ARROW_SIZE, mControlLabelRotation, mArrowImage, sFgColor); |
804 | { | ||
805 | gl_draw_scaled_rotated_image(mIndentation, mRect.getHeight() - ARROW_SIZE - TEXT_PAD, | ||
806 | ARROW_SIZE, ARROW_SIZE, mControlLabelRotation, mArrowImage, sFgColor); | ||
807 | } | ||
808 | } | 817 | } |
818 | } | ||
809 | 819 | ||
810 | F32 text_left = (F32)(ARROW_SIZE + TEXT_PAD + ICON_WIDTH + ICON_PAD + mIndentation); | 820 | F32 text_left = (F32)(ARROW_SIZE + TEXT_PAD + ICON_WIDTH + ICON_PAD + mIndentation); |
811 | 821 | ||
812 | // If we have keyboard focus, draw selection filled | 822 | // If we have keyboard focus, draw selection filled |
813 | BOOL show_context = getRoot()->getShowSelectionContext(); | 823 | BOOL show_context = getRoot()->getShowSelectionContext(); |
814 | BOOL filled = show_context || (gFocusMgr.getKeyboardFocus() == getRoot()); | 824 | BOOL filled = show_context || (gFocusMgr.getKeyboardFocus() == getRoot()); |
815 | 825 | ||
816 | // always render "current" item, only render other selected items if | 826 | // always render "current" item, only render other selected items if |
817 | // mShowSingleSelection is FALSE | 827 | // mShowSingleSelection is FALSE |
818 | if( mIsSelected ) | 828 | if( mIsSelected ) |
829 | { | ||
830 | LLGLSNoTexture gls_no_texture; | ||
831 | LLColor4 bg_color = sHighlightBgColor; | ||
832 | //const S32 TRAILING_PAD = 5; // It just looks better with this. | ||
833 | if (!mIsCurSelection) | ||
819 | { | 834 | { |
820 | LLGLSNoTexture gls_no_texture; | 835 | // do time-based fade of extra objects |
821 | LLColor4 bg_color = sHighlightBgColor; | 836 | F32 fade_time = getRoot()->getSelectionFadeElapsedTime(); |
822 | //const S32 TRAILING_PAD = 5; // It just looks better with this. | 837 | if (getRoot()->getShowSingleSelection()) |
823 | if (!mIsCurSelection) | ||
824 | { | 838 | { |
825 | // do time-based fade of extra objects | 839 | // fading out |
826 | F32 fade_time = getRoot()->getSelectionFadeElapsedTime(); | 840 | bg_color.mV[VALPHA] = clamp_rescale(fade_time, 0.f, 0.4f, bg_color.mV[VALPHA], 0.f); |
827 | if (getRoot()->getShowSingleSelection()) | ||
828 | { | ||
829 | // fading out | ||
830 | bg_color.mV[VALPHA] = clamp_rescale(fade_time, 0.f, 0.4f, bg_color.mV[VALPHA], 0.f); | ||
831 | } | ||
832 | else | ||
833 | { | ||
834 | // fading in | ||
835 | bg_color.mV[VALPHA] = clamp_rescale(fade_time, 0.f, 0.4f, 0.f, bg_color.mV[VALPHA]); | ||
836 | } | ||
837 | } | 841 | } |
842 | else | ||
843 | { | ||
844 | // fading in | ||
845 | bg_color.mV[VALPHA] = clamp_rescale(fade_time, 0.f, 0.4f, 0.f, bg_color.mV[VALPHA]); | ||
846 | } | ||
847 | } | ||
838 | 848 | ||
849 | gl_rect_2d( | ||
850 | 0, | ||
851 | mRect.getHeight(), | ||
852 | mRect.getWidth() - 2, | ||
853 | llfloor(mRect.getHeight() - sFont->getLineHeight() - ICON_PAD), | ||
854 | bg_color, filled); | ||
855 | if (mIsCurSelection) | ||
856 | { | ||
839 | gl_rect_2d( | 857 | gl_rect_2d( |
840 | 0, | 858 | 0, |
841 | mRect.getHeight(), | 859 | mRect.getHeight(), |
842 | mRect.getWidth() - 2, | 860 | mRect.getWidth() - 2, |
843 | llfloor(mRect.getHeight() - sFont->getLineHeight() - ICON_PAD), | 861 | llfloor(mRect.getHeight() - sFont->getLineHeight() - ICON_PAD), |
844 | bg_color, filled); | 862 | sHighlightFgColor, FALSE); |
845 | if (mIsCurSelection) | ||
846 | { | ||
847 | gl_rect_2d( | ||
848 | 0, | ||
849 | mRect.getHeight(), | ||
850 | mRect.getWidth() - 2, | ||
851 | llfloor(mRect.getHeight() - sFont->getLineHeight() - ICON_PAD), | ||
852 | sHighlightFgColor, FALSE); | ||
853 | } | ||
854 | if (mRect.getHeight() > llround(sFont->getLineHeight()) + ICON_PAD + 2) | ||
855 | { | ||
856 | gl_rect_2d( | ||
857 | 0, | ||
858 | llfloor(mRect.getHeight() - sFont->getLineHeight() - ICON_PAD) - 2, | ||
859 | mRect.getWidth() - 2, | ||
860 | 2, | ||
861 | sHighlightFgColor, FALSE); | ||
862 | if (show_context) | ||
863 | { | ||
864 | gl_rect_2d( | ||
865 | 0, | ||
866 | llfloor(mRect.getHeight() - sFont->getLineHeight() - ICON_PAD) - 2, | ||
867 | mRect.getWidth() - 2, | ||
868 | 2, | ||
869 | sHighlightBgColor, TRUE); | ||
870 | } | ||
871 | } | ||
872 | } | 863 | } |
873 | if (mDragAndDropTarget) | 864 | if (mRect.getHeight() > llround(sFont->getLineHeight()) + ICON_PAD + 2) |
874 | { | 865 | { |
875 | LLGLSNoTexture gls_no_texture; | ||
876 | gl_rect_2d( | 866 | gl_rect_2d( |
877 | 0, | 867 | 0, |
878 | mRect.getHeight(), | 868 | llfloor(mRect.getHeight() - sFont->getLineHeight() - ICON_PAD) - 2, |
879 | mRect.getWidth() - 2, | 869 | mRect.getWidth() - 2, |
880 | llfloor(mRect.getHeight() - sFont->getLineHeight() - ICON_PAD), | 870 | 2, |
881 | sHighlightBgColor, FALSE); | 871 | sHighlightFgColor, FALSE); |
882 | 872 | if (show_context) | |
883 | if (mRect.getHeight() > llround(sFont->getLineHeight()) + ICON_PAD + 2) | ||
884 | { | 873 | { |
885 | gl_rect_2d( | 874 | gl_rect_2d( |
886 | 0, | 875 | 0, |
887 | llfloor(mRect.getHeight() - sFont->getLineHeight() - ICON_PAD) - 2, | 876 | llfloor(mRect.getHeight() - sFont->getLineHeight() - ICON_PAD) - 2, |
888 | mRect.getWidth() - 2, | 877 | mRect.getWidth() - 2, |
889 | 2, | 878 | 2, |
890 | sHighlightBgColor, FALSE); | 879 | sHighlightBgColor, TRUE); |
891 | } | 880 | } |
892 | mDragAndDropTarget = FALSE; | ||
893 | } | 881 | } |
882 | } | ||
883 | if (mDragAndDropTarget) | ||
884 | { | ||
885 | LLGLSNoTexture gls_no_texture; | ||
886 | gl_rect_2d( | ||
887 | 0, | ||
888 | mRect.getHeight(), | ||
889 | mRect.getWidth() - 2, | ||
890 | llfloor(mRect.getHeight() - sFont->getLineHeight() - ICON_PAD), | ||
891 | sHighlightBgColor, FALSE); | ||
894 | 892 | ||
895 | 893 | if (mRect.getHeight() > llround(sFont->getLineHeight()) + ICON_PAD + 2) | |
896 | if(mIcon) | ||
897 | { | 894 | { |
898 | gl_draw_image(mIndentation + ARROW_SIZE + TEXT_PAD, mRect.getHeight() - mIcon->getHeight(), mIcon); | 895 | gl_rect_2d( |
899 | mIcon->addTextureStats( (F32)(mIcon->getWidth() * mIcon->getHeight())); | 896 | 0, |
897 | llfloor(mRect.getHeight() - sFont->getLineHeight() - ICON_PAD) - 2, | ||
898 | mRect.getWidth() - 2, | ||
899 | 2, | ||
900 | sHighlightBgColor, FALSE); | ||
900 | } | 901 | } |
902 | mDragAndDropTarget = FALSE; | ||
903 | } | ||
901 | 904 | ||
902 | if (!mLabel.empty()) | ||
903 | { | ||
904 | // highlight filtered text | ||
905 | BOOL debug_filters = getRoot()->getDebugFilters(); | ||
906 | LLColor4 color = ( (mIsSelected && filled) ? sHighlightFgColor : sFgColor ); | ||
907 | F32 right_x; | ||
908 | F32 y = (F32)mRect.getHeight() - sFont->getLineHeight() - (F32)TEXT_PAD; | ||
909 | 905 | ||
910 | if (debug_filters) | 906 | if(mIcon) |
911 | { | 907 | { |
912 | if (!getFiltered() && !possibly_has_children) | 908 | gl_draw_image(mIndentation + ARROW_SIZE + TEXT_PAD, mRect.getHeight() - mIcon->getHeight(), mIcon); |
913 | { | 909 | mIcon->addTextureStats( (F32)(mIcon->getWidth() * mIcon->getHeight())); |
914 | color.mV[VALPHA] *= 0.5f; | 910 | } |
915 | } | ||
916 | |||
917 | LLColor4 filter_color = mLastFilterGeneration >= getRoot()->getFilter()->getCurrentGeneration() ? LLColor4(0.5f, 0.8f, 0.5f, 1.f) : LLColor4(0.8f, 0.5f, 0.5f, 1.f); | ||
918 | sSmallFont->renderUTF8(mStatusText, 0, text_left, y, filter_color, | ||
919 | LLFontGL::LEFT, LLFontGL::BOTTOM, LLFontGL::NORMAL, | ||
920 | S32_MAX, S32_MAX, &right_x, FALSE ); | ||
921 | text_left = right_x; | ||
922 | } | ||
923 | 911 | ||
924 | sFont->renderUTF8( mLabel, 0, text_left, y, color, | 912 | if (!mLabel.empty()) |
925 | LLFontGL::LEFT, LLFontGL::BOTTOM, mLabelStyle, | 913 | { |
926 | S32_MAX, S32_MAX, &right_x, FALSE ); | 914 | // highlight filtered text |
927 | if (!mLabelSuffix.empty()) | 915 | BOOL debug_filters = getRoot()->getDebugFilters(); |
928 | { | 916 | LLColor4 color = ( (mIsSelected && filled) ? sHighlightFgColor : sFgColor ); |
929 | sFont->renderUTF8( mLabelSuffix, 0, right_x, y, LLColor4(0.75f, 0.85f, 0.85f, 1.f), | 917 | F32 right_x; |
930 | LLFontGL::LEFT, LLFontGL::BOTTOM, mLabelStyle, | 918 | F32 y = (F32)mRect.getHeight() - sFont->getLineHeight() - (F32)TEXT_PAD; |
931 | S32_MAX, S32_MAX, &right_x, FALSE ); | ||
932 | } | ||
933 | 919 | ||
934 | if (mBoxImage.notNull() && mStringMatchOffset != LLString::npos) | 920 | if (debug_filters) |
921 | { | ||
922 | if (!getFiltered() && !possibly_has_children) | ||
935 | { | 923 | { |
936 | // don't draw backgrounds for zero-length strings | 924 | color.mV[VALPHA] *= 0.5f; |
937 | S32 filter_string_length = mRoot->getFilterSubString().size(); | ||
938 | if (filter_string_length > 0) | ||
939 | { | ||
940 | LLString combined_string = mLabel + mLabelSuffix; | ||
941 | S32 left = llround(text_left) + sFont->getWidth(combined_string, 0, mStringMatchOffset) - 1; | ||
942 | S32 right = left + sFont->getWidth(combined_string, mStringMatchOffset, filter_string_length) + 2; | ||
943 | S32 bottom = llfloor(mRect.getHeight() - sFont->getLineHeight() - 3); | ||
944 | S32 top = mRect.getHeight(); | ||
945 | |||
946 | LLViewerImage::bindTexture(mBoxImage); | ||
947 | glColor4fv(sFilterBGColor.mV); | ||
948 | gl_segmented_rect_2d_tex(left, top, right, bottom, mBoxImage->getWidth(), mBoxImage->getHeight(), 16); | ||
949 | F32 match_string_left = text_left + sFont->getWidthF32(combined_string, 0, mStringMatchOffset); | ||
950 | F32 y = (F32)mRect.getHeight() - sFont->getLineHeight() - (F32)TEXT_PAD; | ||
951 | sFont->renderUTF8( combined_string, mStringMatchOffset, match_string_left, y, | ||
952 | sFilterTextColor, LLFontGL::LEFT, LLFontGL::BOTTOM, mLabelStyle, | ||
953 | filter_string_length, S32_MAX, &right_x, FALSE ); | ||
954 | } | ||
955 | } | 925 | } |
926 | |||
927 | LLColor4 filter_color = mLastFilterGeneration >= getRoot()->getFilter()->getCurrentGeneration() ? LLColor4(0.5f, 0.8f, 0.5f, 1.f) : LLColor4(0.8f, 0.5f, 0.5f, 1.f); | ||
928 | sSmallFont->renderUTF8(mStatusText, 0, text_left, y, filter_color, | ||
929 | LLFontGL::LEFT, LLFontGL::BOTTOM, LLFontGL::NORMAL, | ||
930 | S32_MAX, S32_MAX, &right_x, FALSE ); | ||
931 | text_left = right_x; | ||
956 | } | 932 | } |
957 | 933 | ||
958 | if( sDebugRects ) | 934 | sFont->renderUTF8( mLabel, 0, text_left, y, color, |
935 | LLFontGL::LEFT, LLFontGL::BOTTOM, mLabelStyle, | ||
936 | S32_MAX, S32_MAX, &right_x, FALSE ); | ||
937 | if (!mLabelSuffix.empty()) | ||
959 | { | 938 | { |
960 | drawDebugRect(); | 939 | sFont->renderUTF8( mLabelSuffix, 0, right_x, y, LLColor4(0.75f, 0.85f, 0.85f, 1.f), |
940 | LLFontGL::LEFT, LLFontGL::BOTTOM, mLabelStyle, | ||
941 | S32_MAX, S32_MAX, &right_x, FALSE ); | ||
942 | } | ||
943 | |||
944 | if (mBoxImage.notNull() && mStringMatchOffset != LLString::npos) | ||
945 | { | ||
946 | // don't draw backgrounds for zero-length strings | ||
947 | S32 filter_string_length = mRoot->getFilterSubString().size(); | ||
948 | if (filter_string_length > 0) | ||
949 | { | ||
950 | LLString combined_string = mLabel + mLabelSuffix; | ||
951 | S32 left = llround(text_left) + sFont->getWidth(combined_string, 0, mStringMatchOffset) - 1; | ||
952 | S32 right = left + sFont->getWidth(combined_string, mStringMatchOffset, filter_string_length) + 2; | ||
953 | S32 bottom = llfloor(mRect.getHeight() - sFont->getLineHeight() - 3); | ||
954 | S32 top = mRect.getHeight(); | ||
955 | |||
956 | LLViewerImage::bindTexture(mBoxImage); | ||
957 | glColor4fv(sFilterBGColor.mV); | ||
958 | gl_segmented_rect_2d_tex(left, top, right, bottom, mBoxImage->getWidth(), mBoxImage->getHeight(), 16); | ||
959 | F32 match_string_left = text_left + sFont->getWidthF32(combined_string, 0, mStringMatchOffset); | ||
960 | F32 y = (F32)mRect.getHeight() - sFont->getLineHeight() - (F32)TEXT_PAD; | ||
961 | sFont->renderUTF8( combined_string, mStringMatchOffset, match_string_left, y, | ||
962 | sFilterTextColor, LLFontGL::LEFT, LLFontGL::BOTTOM, mLabelStyle, | ||
963 | filter_string_length, S32_MAX, &right_x, FALSE ); | ||
964 | } | ||
961 | } | 965 | } |
962 | } | 966 | } |
963 | else if (mStatusText.size()) | 967 | |
968 | if( sDebugRects ) | ||
964 | { | 969 | { |
965 | // just draw status text | 970 | drawDebugRect(); |
966 | sFont->renderUTF8( mStatusText, 0, 0, 1, sFgColor, LLFontGL::LEFT, LLFontGL::BOTTOM, mLabelStyle, S32_MAX, S32_MAX, NULL, FALSE ); | ||
967 | } | 971 | } |
968 | } | 972 | } |
969 | 973 | ||
@@ -977,7 +981,6 @@ LLFolderViewFolder::LLFolderViewFolder( const LLString& name, LLViewerImage* ico | |||
977 | LLFolderView* root, | 981 | LLFolderView* root, |
978 | LLFolderViewEventListener* listener ): | 982 | LLFolderViewEventListener* listener ): |
979 | LLFolderViewItem( name, icon, 0, root, listener ), // 0 = no create time | 983 | LLFolderViewItem( name, icon, 0, root, listener ), // 0 = no create time |
980 | mSortFunction(sort_item_name), | ||
981 | mIsOpen(FALSE), | 984 | mIsOpen(FALSE), |
982 | mExpanderHighlighted(FALSE), | 985 | mExpanderHighlighted(FALSE), |
983 | mCurHeight(0.f), | 986 | mCurHeight(0.f), |
@@ -1246,7 +1249,7 @@ void LLFolderViewFolder::filter( LLInventoryFilter& filter) | |||
1246 | } | 1249 | } |
1247 | 1250 | ||
1248 | // when applying a filter, matching folders get their contents downloaded first | 1251 | // when applying a filter, matching folders get their contents downloaded first |
1249 | if (filter.isNotDefault() && getFiltered(filter.getMinRequiredGeneration()) && !gInventory.isCategoryComplete(mListener->getUUID())) | 1252 | if (filter.isNotDefault() && getFiltered(filter.getMinRequiredGeneration()) && (mListener && !gInventory.isCategoryComplete(mListener->getUUID()))) |
1250 | { | 1253 | { |
1251 | gInventory.startBackgroundFetch(mListener->getUUID()); | 1254 | gInventory.startBackgroundFetch(mListener->getUUID()); |
1252 | } | 1255 | } |
@@ -1667,7 +1670,8 @@ BOOL LLFolderViewFolder::removeItem(LLFolderViewItem* item) | |||
1667 | { | 1670 | { |
1668 | if(item->remove()) | 1671 | if(item->remove()) |
1669 | { | 1672 | { |
1670 | removeView(item); | 1673 | //RN: this seem unneccessary as remove() moves to trash |
1674 | //removeView(item); | ||
1671 | return TRUE; | 1675 | return TRUE; |
1672 | } | 1676 | } |
1673 | return FALSE; | 1677 | return FALSE; |
@@ -1677,7 +1681,7 @@ BOOL LLFolderViewFolder::removeItem(LLFolderViewItem* item) | |||
1677 | // listeners. | 1681 | // listeners. |
1678 | void LLFolderViewFolder::removeView(LLFolderViewItem* item) | 1682 | void LLFolderViewFolder::removeView(LLFolderViewItem* item) |
1679 | { | 1683 | { |
1680 | if (!item) | 1684 | if (!item || item->getParentFolder() != this) |
1681 | { | 1685 | { |
1682 | return; | 1686 | return; |
1683 | } | 1687 | } |
@@ -1722,23 +1726,8 @@ void LLFolderViewFolder::extractItem( LLFolderViewItem* item ) | |||
1722 | // This is only called for renaming an object because it won't work for date | 1726 | // This is only called for renaming an object because it won't work for date |
1723 | void LLFolderViewFolder::resort(LLFolderViewItem* item) | 1727 | void LLFolderViewFolder::resort(LLFolderViewItem* item) |
1724 | { | 1728 | { |
1725 | std::sort(mItems.begin(), mItems.end(), *mSortFunction); | 1729 | std::sort(mItems.begin(), mItems.end(), mSortFunction); |
1726 | std::sort(mFolders.begin(), mFolders.end(), *mSortFunction); | 1730 | std::sort(mFolders.begin(), mFolders.end(), mSortFunction); |
1727 | //if(mItems.removeData(item)) | ||
1728 | //{ | ||
1729 | // mItems.addDataSorted(item); | ||
1730 | //} | ||
1731 | //else | ||
1732 | //{ | ||
1733 | // // This is an evil downcast. However, it's only doing | ||
1734 | // // pointer comparison to find if (which it should be ) the | ||
1735 | // // item is in the container, so it's pretty safe. | ||
1736 | // LLFolderViewFolder* f = reinterpret_cast<LLFolderViewFolder*>(item); | ||
1737 | // if(mFolders.removeData(f)) | ||
1738 | // { | ||
1739 | // mFolders.addDataSorted(f); | ||
1740 | // } | ||
1741 | //} | ||
1742 | } | 1731 | } |
1743 | 1732 | ||
1744 | bool LLFolderViewFolder::isTrash() | 1733 | bool LLFolderViewFolder::isTrash() |
@@ -1752,65 +1741,22 @@ bool LLFolderViewFolder::isTrash() | |||
1752 | 1741 | ||
1753 | void LLFolderViewFolder::sortBy(U32 order) | 1742 | void LLFolderViewFolder::sortBy(U32 order) |
1754 | { | 1743 | { |
1755 | BOOL sort_order_changed = FALSE; | 1744 | if (!mSortFunction.updateSort(order)) |
1756 | if (!(order & LLInventoryFilter::SO_DATE)) | ||
1757 | { | ||
1758 | if (mSortFunction != sort_item_name) | ||
1759 | { | ||
1760 | mSortFunction = sort_item_name; | ||
1761 | sort_order_changed = TRUE; | ||
1762 | } | ||
1763 | } | ||
1764 | else | ||
1765 | { | 1745 | { |
1766 | if (mSortFunction != sort_item_date) | 1746 | // No changes. |
1767 | { | 1747 | return; |
1768 | mSortFunction = sort_item_date; | ||
1769 | sort_order_changed = TRUE; | ||
1770 | } | ||
1771 | } | 1748 | } |
1772 | 1749 | ||
1750 | // Propegate this change to sub folders | ||
1773 | for (folders_t::iterator iter = mFolders.begin(); | 1751 | for (folders_t::iterator iter = mFolders.begin(); |
1774 | iter != mFolders.end();) | 1752 | iter != mFolders.end();) |
1775 | { | 1753 | { |
1776 | folders_t::iterator fit = iter++; | 1754 | folders_t::iterator fit = iter++; |
1777 | (*fit)->sortBy(order); | 1755 | (*fit)->sortBy(order); |
1778 | } | 1756 | } |
1779 | if (order & LLInventoryFilter::SO_FOLDERS_BY_NAME) | ||
1780 | { | ||
1781 | // sort folders by name if always by name | ||
1782 | std::sort(mFolders.begin(), mFolders.end(), sort_item_name); | ||
1783 | } | ||
1784 | else | ||
1785 | { | ||
1786 | // sort folders by the default sort ordering | ||
1787 | std::sort(mFolders.begin(), mFolders.end(), *mSortFunction); | ||
1788 | 1757 | ||
1789 | // however, if we are at the root of the inventory and we are sorting by date | 1758 | std::sort(mFolders.begin(), mFolders.end(), mSortFunction); |
1790 | if (mListener->getUUID() == gAgent.getInventoryRootID() && order & LLInventoryFilter::SO_DATE) | 1759 | std::sort(mItems.begin(), mItems.end(), mSortFunction); |
1791 | { | ||
1792 | // pull the trash folder and stick it on the end of the list | ||
1793 | LLFolderViewFolder *t = NULL; | ||
1794 | for (folders_t::iterator fit = mFolders.begin(); | ||
1795 | fit != mFolders.end(); ++fit) | ||
1796 | { | ||
1797 | if ((*fit)->isTrash()) | ||
1798 | { | ||
1799 | t = *fit; | ||
1800 | mFolders.erase(fit); | ||
1801 | break; | ||
1802 | } | ||
1803 | } | ||
1804 | if (t) | ||
1805 | { | ||
1806 | mFolders.push_back(t); | ||
1807 | } | ||
1808 | } | ||
1809 | } | ||
1810 | if (sort_order_changed) | ||
1811 | { | ||
1812 | std::sort(mItems.begin(), mItems.end(), *mSortFunction); | ||
1813 | } | ||
1814 | 1760 | ||
1815 | if (order & LLInventoryFilter::SO_DATE) | 1761 | if (order & LLInventoryFilter::SO_DATE) |
1816 | { | 1762 | { |
@@ -1834,19 +1780,39 @@ void LLFolderViewFolder::sortBy(U32 order) | |||
1834 | } | 1780 | } |
1835 | } | 1781 | } |
1836 | 1782 | ||
1837 | void LLFolderViewFolder::setItemSortFunction(sort_order_f ordering) | 1783 | void LLFolderViewFolder::setItemSortOrder(U32 ordering) |
1838 | { | 1784 | { |
1839 | mSortFunction = ordering; | 1785 | if (mSortFunction.updateSort(ordering)) |
1786 | { | ||
1787 | for (folders_t::iterator iter = mFolders.begin(); | ||
1788 | iter != mFolders.end();) | ||
1789 | { | ||
1790 | folders_t::iterator fit = iter++; | ||
1791 | (*fit)->setItemSortOrder(ordering); | ||
1792 | } | ||
1840 | 1793 | ||
1841 | for (folders_t::iterator iter = mFolders.begin(); | 1794 | std::sort(mFolders.begin(), mFolders.end(), mSortFunction); |
1842 | iter != mFolders.end();) | 1795 | std::sort(mItems.begin(), mItems.end(), mSortFunction); |
1796 | } | ||
1797 | } | ||
1798 | |||
1799 | EInventorySortGroup LLFolderViewFolder::getSortGroup() | ||
1800 | { | ||
1801 | if (isTrash()) | ||
1843 | { | 1802 | { |
1844 | folders_t::iterator fit = iter++; | 1803 | return SG_TRASH_FOLDER; |
1845 | (*fit)->setItemSortFunction(ordering); | ||
1846 | } | 1804 | } |
1847 | 1805 | ||
1848 | std::sort(mFolders.begin(), mFolders.end(), *mSortFunction); | 1806 | // Folders that can't be moved are 'system' folders. |
1849 | std::sort(mItems.begin(), mItems.end(), *mSortFunction); | 1807 | if( mListener ) |
1808 | { | ||
1809 | if( !(mListener->isItemMovable()) ) | ||
1810 | { | ||
1811 | return SG_SYSTEM_FOLDER; | ||
1812 | } | ||
1813 | } | ||
1814 | |||
1815 | return SG_NORMAL_FOLDER; | ||
1850 | } | 1816 | } |
1851 | 1817 | ||
1852 | BOOL LLFolderViewFolder::isMovable() | 1818 | BOOL LLFolderViewFolder::isMovable() |
@@ -1917,6 +1883,7 @@ BOOL LLFolderViewFolder::isRemovable() | |||
1917 | // this is an internal method used for adding items to folders. | 1883 | // this is an internal method used for adding items to folders. |
1918 | BOOL LLFolderViewFolder::addItem(LLFolderViewItem* item) | 1884 | BOOL LLFolderViewFolder::addItem(LLFolderViewItem* item) |
1919 | { | 1885 | { |
1886 | |||
1920 | items_t::iterator it = std::lower_bound( | 1887 | items_t::iterator it = std::lower_bound( |
1921 | mItems.begin(), | 1888 | mItems.begin(), |
1922 | mItems.end(), | 1889 | mItems.end(), |
@@ -1945,18 +1912,29 @@ BOOL LLFolderViewFolder::addFolder(LLFolderViewFolder* folder) | |||
1945 | folder->setVisible(FALSE); | 1912 | folder->setVisible(FALSE); |
1946 | addChild( folder ); | 1913 | addChild( folder ); |
1947 | folder->dirtyFilter(); | 1914 | folder->dirtyFilter(); |
1948 | requestArrange(); | 1915 | // rearrange all descendants too, as our indentation level might have changed |
1916 | folder->requestArrange(TRUE); | ||
1949 | return TRUE; | 1917 | return TRUE; |
1950 | } | 1918 | } |
1951 | 1919 | ||
1952 | void LLFolderViewFolder::requestArrange() | 1920 | void LLFolderViewFolder::requestArrange(BOOL include_descendants) |
1953 | { | 1921 | { |
1954 | mLastArrangeGeneration = -1; | 1922 | mLastArrangeGeneration = -1; |
1955 | // flag all items up to root | 1923 | // flag all items up to root |
1956 | if (mParentFolder) | 1924 | if (mParentFolder && !mParentFolder->needsArrange()) |
1957 | { | 1925 | { |
1958 | mParentFolder->requestArrange(); | 1926 | mParentFolder->requestArrange(); |
1959 | } | 1927 | } |
1928 | |||
1929 | if (include_descendants) | ||
1930 | { | ||
1931 | for (folders_t::iterator iter = mFolders.begin(); | ||
1932 | iter != mFolders.end(); | ||
1933 | ++iter) | ||
1934 | { | ||
1935 | (*iter)->requestArrange(TRUE); | ||
1936 | } | ||
1937 | } | ||
1960 | } | 1938 | } |
1961 | 1939 | ||
1962 | void LLFolderViewFolder::toggleOpen() | 1940 | void LLFolderViewFolder::toggleOpen() |
@@ -2002,11 +1980,11 @@ void LLFolderViewFolder::setOpenArrangeRecursively(BOOL open, ERecurseType recur | |||
2002 | } | 1980 | } |
2003 | 1981 | ||
2004 | BOOL LLFolderViewFolder::handleDragAndDropFromChild(MASK mask, | 1982 | BOOL LLFolderViewFolder::handleDragAndDropFromChild(MASK mask, |
2005 | BOOL drop, | 1983 | BOOL drop, |
2006 | EDragAndDropType c_type, | 1984 | EDragAndDropType c_type, |
2007 | void* cargo_data, | 1985 | void* cargo_data, |
2008 | EAcceptance* accept, | 1986 | EAcceptance* accept, |
2009 | LLString& tooltip_msg) | 1987 | LLString& tooltip_msg) |
2010 | { | 1988 | { |
2011 | BOOL accepted = mListener && mListener->dragOrDrop(mask,drop,c_type,cargo_data); | 1989 | BOOL accepted = mListener && mListener->dragOrDrop(mask,drop,c_type,cargo_data); |
2012 | if (accepted) | 1990 | if (accepted) |
@@ -2218,16 +2196,13 @@ void LLFolderViewFolder::draw() | |||
2218 | } | 2196 | } |
2219 | 2197 | ||
2220 | LLFolderViewItem::draw(); | 2198 | LLFolderViewItem::draw(); |
2221 | if( mIsOpen ) | 2199 | |
2200 | // draw children if root folder, or any other folder that is open or animating to closed state | ||
2201 | if( getRoot() == this || (mIsOpen || mCurHeight != mTargetHeight )) | ||
2222 | { | 2202 | { |
2223 | LLView::draw(); | 2203 | LLView::draw(); |
2224 | } | 2204 | } |
2225 | 2205 | ||
2226 | // if (mExpanderHighlighted) | ||
2227 | // { | ||
2228 | // gl_rect_2d(mIndentation - TEXT_PAD, llfloor(mRect.getHeight() - TEXT_PAD), mIndentation + sFont->getWidth(mControlLabel) + TEXT_PAD, llfloor(mRect.getHeight() - sFont->getLineHeight() - TEXT_PAD), sFgColor, FALSE); | ||
2229 | // //sFont->renderUTF8( mControlLabel, 0, mIndentation, llfloor(mRect.getHeight() - sFont->getLineHeight() - TEXT_PAD), sFgColor, LLFontGL::LEFT, LLFontGL::BOTTOM, mLabelStyle, S32_MAX, S32_MAX, NULL, FALSE ); | ||
2230 | // } | ||
2231 | mExpanderHighlighted = FALSE; | 2206 | mExpanderHighlighted = FALSE; |
2232 | } | 2207 | } |
2233 | 2208 | ||
@@ -2237,6 +2212,16 @@ U32 LLFolderViewFolder::getCreationDate() const | |||
2237 | } | 2212 | } |
2238 | 2213 | ||
2239 | 2214 | ||
2215 | BOOL LLFolderViewFolder::potentiallyVisible() | ||
2216 | { | ||
2217 | // folder should be visible by it's own filter status | ||
2218 | return LLFolderViewItem::potentiallyVisible() | ||
2219 | // or one or more of its descendants have passed the minimum filter requirement | ||
2220 | || hasFilteredDescendants(mRoot->getFilter()->getMinRequiredGeneration()) | ||
2221 | // or not all of its descendants have been checked against minimum filter requirement | ||
2222 | || getCompletedFilterGeneration() < getRoot()->getFilter()->getMinRequiredGeneration(); | ||
2223 | } | ||
2224 | |||
2240 | // this does prefix traversal, as folders are listed above their contents | 2225 | // this does prefix traversal, as folders are listed above their contents |
2241 | LLFolderViewItem* LLFolderViewFolder::getNextFromChild( LLFolderViewItem* item, BOOL include_children ) | 2226 | LLFolderViewItem* LLFolderViewFolder::getNextFromChild( LLFolderViewItem* item, BOOL include_children ) |
2242 | { | 2227 | { |
@@ -2456,20 +2441,20 @@ LLFolderViewItem* LLFolderViewFolder::getPreviousFromChild( LLFolderViewItem* it | |||
2456 | class LLSetItemSortFunction : public LLFolderViewFunctor | 2441 | class LLSetItemSortFunction : public LLFolderViewFunctor |
2457 | { | 2442 | { |
2458 | public: | 2443 | public: |
2459 | LLSetItemSortFunction(sort_order_f ordering) | 2444 | LLSetItemSortFunction(U32 ordering) |
2460 | : mSortFunction(ordering) {} | 2445 | : mSortOrder(ordering) {} |
2461 | virtual ~LLSetItemSortFunction() {} | 2446 | virtual ~LLSetItemSortFunction() {} |
2462 | virtual void doFolder(LLFolderViewFolder* folder); | 2447 | virtual void doFolder(LLFolderViewFolder* folder); |
2463 | virtual void doItem(LLFolderViewItem* item); | 2448 | virtual void doItem(LLFolderViewItem* item); |
2464 | 2449 | ||
2465 | sort_order_f mSortFunction; | 2450 | U32 mSortOrder; |
2466 | }; | 2451 | }; |
2467 | 2452 | ||
2468 | 2453 | ||
2469 | // Set the sort order. | 2454 | // Set the sort order. |
2470 | void LLSetItemSortFunction::doFolder(LLFolderViewFolder* folder) | 2455 | void LLSetItemSortFunction::doFolder(LLFolderViewFolder* folder) |
2471 | { | 2456 | { |
2472 | folder->setItemSortFunction(mSortFunction); | 2457 | folder->setItemSortOrder(mSortOrder); |
2473 | } | 2458 | } |
2474 | 2459 | ||
2475 | // Do nothing. | 2460 | // Do nothing. |
@@ -2696,6 +2681,7 @@ BOOL LLFolderView::addFolder( LLFolderViewFolder* folder) | |||
2696 | folder->setVisible(FALSE); | 2681 | folder->setVisible(FALSE); |
2697 | addChild( folder ); | 2682 | addChild( folder ); |
2698 | folder->dirtyFilter(); | 2683 | folder->dirtyFilter(); |
2684 | folder->requestArrange(); | ||
2699 | return TRUE; | 2685 | return TRUE; |
2700 | } | 2686 | } |
2701 | 2687 | ||
@@ -2916,8 +2902,8 @@ BOOL LLFolderView::setSelection(LLFolderViewItem* selection, BOOL open, /* Flaw | |||
2916 | addToSelectionList(selection); | 2902 | addToSelectionList(selection); |
2917 | } | 2903 | } |
2918 | 2904 | ||
2919 | BOOL rv = LLFolderViewFolder::setSelection(selection, open, take_keyboard_focus); /* Flawfinder: ignore */ | 2905 | BOOL rv = LLFolderViewFolder::setSelection(selection, open, take_keyboard_focus); |
2920 | if(open) /* Flawfinder: ignore */ | 2906 | if(open && selection) |
2921 | { | 2907 | { |
2922 | selection->getParentFolder()->requestArrange(); | 2908 | selection->getParentFolder()->requestArrange(); |
2923 | } | 2909 | } |
@@ -2954,11 +2940,6 @@ BOOL LLFolderView::changeSelection(LLFolderViewItem* selection, BOOL selected) | |||
2954 | } | 2940 | } |
2955 | 2941 | ||
2956 | BOOL on_list = (item_iter != mSelectedItems.end()); | 2942 | BOOL on_list = (item_iter != mSelectedItems.end()); |
2957 | if (on_list && mSelectedItems.size() == 1) | ||
2958 | { | ||
2959 | // we are trying to select/deselect the only selected item | ||
2960 | return FALSE; | ||
2961 | } | ||
2962 | 2943 | ||
2963 | if(selected && !on_list) | 2944 | if(selected && !on_list) |
2964 | { | 2945 | { |
@@ -3005,48 +2986,46 @@ S32 LLFolderView::extendSelection(LLFolderViewItem* selection, LLFolderViewItem* | |||
3005 | 2986 | ||
3006 | void LLFolderView::sanitizeSelection() | 2987 | void LLFolderView::sanitizeSelection() |
3007 | { | 2988 | { |
2989 | // store off current item in case it is automatically deselected | ||
2990 | // and we want to preserve context | ||
2991 | LLFolderViewItem* original_selected_item = getCurSelectedItem(); | ||
2992 | |||
3008 | std::vector<LLFolderViewItem*> items_to_remove; | 2993 | std::vector<LLFolderViewItem*> items_to_remove; |
3009 | selected_items_t::iterator item_iter; | 2994 | selected_items_t::iterator item_iter; |
3010 | for (item_iter = mSelectedItems.begin(); item_iter != mSelectedItems.end(); ++item_iter) | 2995 | for (item_iter = mSelectedItems.begin(); item_iter != mSelectedItems.end(); ++item_iter) |
3011 | { | 2996 | { |
3012 | LLFolderViewItem* item = *item_iter; | 2997 | LLFolderViewItem* item = *item_iter; |
3013 | 2998 | ||
3014 | BOOL visible = item->getVisible(); | 2999 | // ensure that each ancestor is open and potentially passes filtering |
3000 | BOOL visible = item->potentiallyVisible(); // initialize from filter state for this item | ||
3001 | // modify with parent open and filters states | ||
3015 | LLFolderViewFolder* parent_folder = item->getParentFolder(); | 3002 | LLFolderViewFolder* parent_folder = item->getParentFolder(); |
3016 | while(visible && parent_folder) | 3003 | while(parent_folder) |
3017 | { | 3004 | { |
3018 | visible = visible && parent_folder->isOpen() && parent_folder->getVisible(); | 3005 | visible = visible && parent_folder->isOpen() && parent_folder->potentiallyVisible(); |
3019 | parent_folder = parent_folder->getParentFolder(); | 3006 | parent_folder = parent_folder->getParentFolder(); |
3020 | } | 3007 | } |
3021 | if (!visible || item->getNumSelectedDescendants() > 0) | 3008 | |
3009 | // deselect item if any ancestor is closed or didn't pass filter requirements. | ||
3010 | if (!visible) | ||
3022 | { | 3011 | { |
3023 | // only deselect self if not visible | 3012 | items_to_remove.push_back(item); |
3024 | // check to see if item failed the filter but was checked against most recent generation | 3013 | } |
3025 | if ((!item->getFiltered() && item->getLastFilterGeneration() >= getFilter()->getMinRequiredGeneration()) | ||
3026 | || (item->getParentFolder() && !item->getParentFolder()->isOpen())) | ||
3027 | { | ||
3028 | item->recursiveDeselect(TRUE); | ||
3029 | items_to_remove.push_back(item); | ||
3030 | } | ||
3031 | else | ||
3032 | { | ||
3033 | item->recursiveDeselect(FALSE); | ||
3034 | } | ||
3035 | 3014 | ||
3036 | selected_items_t::iterator other_item_iter; | 3015 | // disallow nested selections (i.e. folder items plus one or more ancestors) |
3037 | for (other_item_iter = mSelectedItems.begin(); other_item_iter != mSelectedItems.end(); ++other_item_iter) | 3016 | // could check cached mum selections count and only iterate if there are any |
3017 | // but that may be a premature optimization. | ||
3018 | selected_items_t::iterator other_item_iter; | ||
3019 | for (other_item_iter = mSelectedItems.begin(); other_item_iter != mSelectedItems.end(); ++other_item_iter) | ||
3020 | { | ||
3021 | LLFolderViewItem* other_item = *other_item_iter; | ||
3022 | for(LLFolderViewFolder* parent_folder = other_item->getParentFolder(); parent_folder; parent_folder = parent_folder->getParentFolder()) | ||
3038 | { | 3023 | { |
3039 | LLFolderViewItem* other_item = *other_item_iter; | 3024 | if (parent_folder == item) |
3040 | LLFolderViewFolder* parent_folder = other_item->getParentFolder(); | ||
3041 | while (parent_folder) | ||
3042 | { | 3025 | { |
3043 | if (parent_folder == item) | 3026 | // this is a descendent of the current folder, remove from list |
3044 | { | 3027 | items_to_remove.push_back(other_item); |
3045 | // this is a descendent of the current folder, remove from list | 3028 | break; |
3046 | items_to_remove.push_back(other_item); | ||
3047 | break; | ||
3048 | } | ||
3049 | parent_folder = parent_folder->getParentFolder(); | ||
3050 | } | 3029 | } |
3051 | } | 3030 | } |
3052 | } | 3031 | } |
@@ -3055,7 +3034,47 @@ void LLFolderView::sanitizeSelection() | |||
3055 | std::vector<LLFolderViewItem*>::iterator item_it; | 3034 | std::vector<LLFolderViewItem*>::iterator item_it; |
3056 | for (item_it = items_to_remove.begin(); item_it != items_to_remove.end(); ++item_it ) | 3035 | for (item_it = items_to_remove.begin(); item_it != items_to_remove.end(); ++item_it ) |
3057 | { | 3036 | { |
3058 | removeFromSelectionList(*item_it); | 3037 | changeSelection(*item_it, FALSE); // toggle selection (also removes from list) |
3038 | } | ||
3039 | |||
3040 | // if nothing selected after prior constraints... | ||
3041 | if (mSelectedItems.empty()) | ||
3042 | { | ||
3043 | // ...select first available parent of original selection, or "My Inventory" otherwise | ||
3044 | LLFolderViewItem* new_selection = NULL; | ||
3045 | if (original_selected_item) | ||
3046 | { | ||
3047 | for(LLFolderViewFolder* parent_folder = original_selected_item->getParentFolder(); | ||
3048 | parent_folder; | ||
3049 | parent_folder = parent_folder->getParentFolder()) | ||
3050 | { | ||
3051 | if (parent_folder->potentiallyVisible()) | ||
3052 | { | ||
3053 | // give initial selection to first ancestor folder that potentially passes the filter | ||
3054 | if (!new_selection) | ||
3055 | { | ||
3056 | new_selection = parent_folder; | ||
3057 | } | ||
3058 | |||
3059 | // if any ancestor folder of original item is closed, move the selection up | ||
3060 | // to the highest closed | ||
3061 | if (!parent_folder->isOpen()) | ||
3062 | { | ||
3063 | new_selection = parent_folder; | ||
3064 | } | ||
3065 | } | ||
3066 | } | ||
3067 | } | ||
3068 | else | ||
3069 | { | ||
3070 | // nothing selected to start with, so pick "My Inventory" as best guess | ||
3071 | new_selection = getItemByID(gAgent.getInventoryRootID()); | ||
3072 | } | ||
3073 | |||
3074 | if (new_selection) | ||
3075 | { | ||
3076 | setSelection(new_selection, FALSE, FALSE); | ||
3077 | } | ||
3059 | } | 3078 | } |
3060 | } | 3079 | } |
3061 | 3080 | ||
@@ -3232,7 +3251,7 @@ void LLFolderView::removeSelectedItems( void ) | |||
3232 | // create a temporary structure which we will use to remove | 3251 | // create a temporary structure which we will use to remove |
3233 | // items, since the removal will futz with internal data | 3252 | // items, since the removal will futz with internal data |
3234 | // structures. | 3253 | // structures. |
3235 | LLDynamicArray<LLFolderViewItem*> items; | 3254 | std::vector<LLFolderViewItem*> items; |
3236 | S32 count = mSelectedItems.size(); | 3255 | S32 count = mSelectedItems.size(); |
3237 | if(count == 0) return; | 3256 | if(count == 0) return; |
3238 | LLFolderViewItem* item = NULL; | 3257 | LLFolderViewItem* item = NULL; |
@@ -3242,7 +3261,7 @@ void LLFolderView::removeSelectedItems( void ) | |||
3242 | item = *item_it; | 3261 | item = *item_it; |
3243 | if(item->isRemovable()) | 3262 | if(item->isRemovable()) |
3244 | { | 3263 | { |
3245 | items.put(item); | 3264 | items.push_back(item); |
3246 | } | 3265 | } |
3247 | else | 3266 | else |
3248 | { | 3267 | { |
@@ -3252,11 +3271,11 @@ void LLFolderView::removeSelectedItems( void ) | |||
3252 | } | 3271 | } |
3253 | 3272 | ||
3254 | // iterate through the new container. | 3273 | // iterate through the new container. |
3255 | count = items.count(); | 3274 | count = items.size(); |
3256 | LLUUID new_selection_id; | 3275 | LLUUID new_selection_id; |
3257 | if(count == 1) | 3276 | if(count == 1) |
3258 | { | 3277 | { |
3259 | LLFolderViewItem* item_to_delete = items.get(0); | 3278 | LLFolderViewItem* item_to_delete = items[0]; |
3260 | LLFolderViewFolder* parent = item_to_delete->getParentFolder(); | 3279 | LLFolderViewFolder* parent = item_to_delete->getParentFolder(); |
3261 | LLFolderViewItem* new_selection = item_to_delete->getNextOpenNode(FALSE); | 3280 | LLFolderViewItem* new_selection = item_to_delete->getNextOpenNode(FALSE); |
3262 | if (!new_selection) | 3281 | if (!new_selection) |
@@ -3284,7 +3303,7 @@ void LLFolderView::removeSelectedItems( void ) | |||
3284 | { | 3303 | { |
3285 | LLDynamicArray<LLFolderViewEventListener*> listeners; | 3304 | LLDynamicArray<LLFolderViewEventListener*> listeners; |
3286 | LLFolderViewEventListener* listener; | 3305 | LLFolderViewEventListener* listener; |
3287 | LLFolderViewItem* last_item = items.get(count - 1); | 3306 | LLFolderViewItem* last_item = items[count - 1]; |
3288 | LLFolderViewItem* new_selection = last_item->getNextOpenNode(FALSE); | 3307 | LLFolderViewItem* new_selection = last_item->getNextOpenNode(FALSE); |
3289 | while(new_selection && new_selection->isSelected()) | 3308 | while(new_selection && new_selection->isSelected()) |
3290 | { | 3309 | { |
@@ -3309,7 +3328,7 @@ void LLFolderView::removeSelectedItems( void ) | |||
3309 | 3328 | ||
3310 | for(S32 i = 0; i < count; ++i) | 3329 | for(S32 i = 0; i < count; ++i) |
3311 | { | 3330 | { |
3312 | listener = items.get(i)->getListener(); | 3331 | listener = items[i]->getListener(); |
3313 | if(listener && (listeners.find(listener) == LLDynamicArray<LLFolderViewEventListener*>::FAIL)) | 3332 | if(listener && (listeners.find(listener) == LLDynamicArray<LLFolderViewEventListener*>::FAIL)) |
3314 | { | 3333 | { |
3315 | listeners.put(listener); | 3334 | listeners.put(listener); |
@@ -3620,21 +3639,6 @@ void LLFolderView::setFocus(BOOL focus) | |||
3620 | { | 3639 | { |
3621 | if (focus) | 3640 | if (focus) |
3622 | { | 3641 | { |
3623 | // select "My Inventory" if nothing selected | ||
3624 | if (!getCurSelectedItem()) | ||
3625 | { | ||
3626 | LLFolderViewItem* itemp = getItemByID(gAgent.getInventoryRootID()); | ||
3627 | if (itemp) | ||
3628 | { | ||
3629 | setSelection(itemp, FALSE, FALSE); | ||
3630 | } | ||
3631 | } | ||
3632 | |||
3633 | if (mRenamer->getVisible()) | ||
3634 | { | ||
3635 | //RN: commit rename changes when focus is moved, only revert on ESC | ||
3636 | finishRenamingItem(); | ||
3637 | } | ||
3638 | if(!hasFocus()) | 3642 | if(!hasFocus()) |
3639 | { | 3643 | { |
3640 | gEditMenuHandler = this; | 3644 | gEditMenuHandler = this; |
@@ -3954,10 +3958,10 @@ BOOL LLFolderView::search(LLFolderViewItem* first_item, const LLString &search_s | |||
3954 | LLString::toUpper(upper_case_string); | 3958 | LLString::toUpper(upper_case_string); |
3955 | 3959 | ||
3956 | // if nothing selected, select first item in folder | 3960 | // if nothing selected, select first item in folder |
3957 | if (!first_item) | 3961 | if (!search_item) |
3958 | { | 3962 | { |
3959 | // start from first item | 3963 | // start from first item |
3960 | first_item = getNextFromChild(NULL); | 3964 | search_item = getNextFromChild(NULL); |
3961 | } | 3965 | } |
3962 | 3966 | ||
3963 | // search over all open nodes for first substring match (with wrapping) | 3967 | // search over all open nodes for first substring match (with wrapping) |
@@ -4248,8 +4252,6 @@ void LLFolderView::idle(void* user_data) | |||
4248 | // filter to determine visiblity before arranging | 4252 | // filter to determine visiblity before arranging |
4249 | self->filterFromRoot(); | 4253 | self->filterFromRoot(); |
4250 | 4254 | ||
4251 | self->sanitizeSelection(); | ||
4252 | |||
4253 | // automatically show matching items, and select first one | 4255 | // automatically show matching items, and select first one |
4254 | // do this every frame until user puts keyboard focus into the inventory window | 4256 | // do this every frame until user puts keyboard focus into the inventory window |
4255 | // signaling the end of the automatic update | 4257 | // signaling the end of the automatic update |
@@ -4269,6 +4271,8 @@ void LLFolderView::idle(void* user_data) | |||
4269 | self->scrollToShowSelection(); | 4271 | self->scrollToShowSelection(); |
4270 | } | 4272 | } |
4271 | 4273 | ||
4274 | self->sanitizeSelection(); | ||
4275 | |||
4272 | if( self->needsArrange() && self->isInVisibleChain()) | 4276 | if( self->needsArrange() && self->isInVisibleChain()) |
4273 | { | 4277 | { |
4274 | self->arrangeFromRoot(); | 4278 | self->arrangeFromRoot(); |
@@ -4307,33 +4311,71 @@ void LLFolderView::dumpSelectionInformation() | |||
4307 | ///---------------------------------------------------------------------------- | 4311 | ///---------------------------------------------------------------------------- |
4308 | /// Local function definitions | 4312 | /// Local function definitions |
4309 | ///---------------------------------------------------------------------------- | 4313 | ///---------------------------------------------------------------------------- |
4310 | 4314 | bool LLInventorySort::updateSort(U32 order) | |
4311 | bool sort_item_name(LLFolderViewItem* a, LLFolderViewItem* b) | ||
4312 | { | 4315 | { |
4313 | S32 compare = LLString::compareDict(a->getLabel(), b->getLabel()); | 4316 | if (order != mSortOrder) |
4314 | if (0 == compare) | ||
4315 | { | ||
4316 | return (a->getCreationDate() > b->getCreationDate()); | ||
4317 | } | ||
4318 | else | ||
4319 | { | 4317 | { |
4320 | return (compare < 0); | 4318 | mSortOrder = order; |
4319 | mByDate = (order & LLInventoryFilter::SO_DATE); | ||
4320 | mSystemToTop = (order & LLInventoryFilter::SO_SYSTEM_FOLDERS_TO_TOP); | ||
4321 | mFoldersByName = (order & LLInventoryFilter::SO_FOLDERS_BY_NAME); | ||
4322 | return true; | ||
4321 | } | 4323 | } |
4324 | return false; | ||
4322 | } | 4325 | } |
4323 | 4326 | ||
4324 | // BUG: This is very very slow. The getCreationDate() is log n in number | 4327 | bool LLInventorySort::operator()(LLFolderViewItem* a, LLFolderViewItem* b) |
4325 | // of inventory items. | ||
4326 | bool sort_item_date(LLFolderViewItem* a, LLFolderViewItem* b) | ||
4327 | { | 4328 | { |
4328 | U32 first_create = a->getCreationDate(); | 4329 | // We sort by name if we aren't sorting by date |
4329 | U32 second_create = b->getCreationDate(); | 4330 | // OR if these are folders and we are sorting folders by name. |
4330 | if (first_create == second_create) | 4331 | bool by_name = (!mByDate |
4332 | || (mFoldersByName | ||
4333 | && (a->getSortGroup() != SG_ITEM))); | ||
4334 | |||
4335 | if (a->getSortGroup() != b->getSortGroup()) | ||
4336 | { | ||
4337 | if (mSystemToTop) | ||
4338 | { | ||
4339 | // Group order is System Folders, Trash, Normal Folders, Items | ||
4340 | return (a->getSortGroup() < b->getSortGroup()); | ||
4341 | } | ||
4342 | else if (mByDate) | ||
4343 | { | ||
4344 | // Trash needs to go to the bottom if we are sorting by date | ||
4345 | if ( (a->getSortGroup() == SG_TRASH_FOLDER) | ||
4346 | || (b->getSortGroup() == SG_TRASH_FOLDER)) | ||
4347 | { | ||
4348 | return (b->getSortGroup() == SG_TRASH_FOLDER); | ||
4349 | } | ||
4350 | } | ||
4351 | } | ||
4352 | |||
4353 | if (by_name) | ||
4331 | { | 4354 | { |
4332 | return (LLString::compareDict(a->getLabel(), b->getLabel()) < 0); | 4355 | S32 compare = LLString::compareDict(a->getLabel(), b->getLabel()); |
4356 | if (0 == compare) | ||
4357 | { | ||
4358 | return (a->getCreationDate() > b->getCreationDate()); | ||
4359 | } | ||
4360 | else | ||
4361 | { | ||
4362 | return (compare < 0); | ||
4363 | } | ||
4333 | } | 4364 | } |
4334 | else | 4365 | else |
4335 | { | 4366 | { |
4336 | return (first_create > second_create); | 4367 | // BUG: This is very very slow. The getCreationDate() is log n in number |
4368 | // of inventory items. | ||
4369 | U32 first_create = a->getCreationDate(); | ||
4370 | U32 second_create = b->getCreationDate(); | ||
4371 | if (first_create == second_create) | ||
4372 | { | ||
4373 | return (LLString::compareDict(a->getLabel(), b->getLabel()) < 0); | ||
4374 | } | ||
4375 | else | ||
4376 | { | ||
4377 | return (first_create > second_create); | ||
4378 | } | ||
4337 | } | 4379 | } |
4338 | } | 4380 | } |
4339 | 4381 | ||
diff --git a/linden/indra/newview/llfolderview.h b/linden/indra/newview/llfolderview.h index 8acbc8f..ec70b90 100644 --- a/linden/indra/newview/llfolderview.h +++ b/linden/indra/newview/llfolderview.h | |||
@@ -181,6 +181,7 @@ public: | |||
181 | 181 | ||
182 | static const U32 SO_DATE = 1; | 182 | static const U32 SO_DATE = 1; |
183 | static const U32 SO_FOLDERS_BY_NAME = 2; | 183 | static const U32 SO_FOLDERS_BY_NAME = 2; |
184 | static const U32 SO_SYSTEM_FOLDERS_TO_TOP = 4; | ||
184 | 185 | ||
185 | LLInventoryFilter(const LLString& name); | 186 | LLInventoryFilter(const LLString& name); |
186 | virtual ~LLInventoryFilter(); | 187 | virtual ~LLInventoryFilter(); |
@@ -265,6 +266,34 @@ private: | |||
265 | LLString mFilterText; | 266 | LLString mFilterText; |
266 | }; | 267 | }; |
267 | 268 | ||
269 | // These are grouping of inventory types. | ||
270 | // Order matters when sorting system folders to the top. | ||
271 | enum EInventorySortGroup | ||
272 | { | ||
273 | SG_SYSTEM_FOLDER, | ||
274 | SG_TRASH_FOLDER, | ||
275 | SG_NORMAL_FOLDER, | ||
276 | SG_ITEM | ||
277 | }; | ||
278 | |||
279 | class LLInventorySort | ||
280 | { | ||
281 | public: | ||
282 | LLInventorySort() | ||
283 | : mSortOrder(0) { } | ||
284 | |||
285 | // Returns true if order has changed | ||
286 | bool updateSort(U32 order); | ||
287 | U32 getSort() { return mSortOrder; } | ||
288 | |||
289 | bool operator()(LLFolderViewItem* a, LLFolderViewItem* b); | ||
290 | private: | ||
291 | U32 mSortOrder; | ||
292 | bool mByDate; | ||
293 | bool mSystemToTop; | ||
294 | bool mFoldersByName; | ||
295 | }; | ||
296 | |||
268 | //~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ | 297 | //~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ |
269 | // Class LLFolderViewItem | 298 | // Class LLFolderViewItem |
270 | // | 299 | // |
@@ -351,6 +380,8 @@ public: | |||
351 | enum { ARRANGE = TRUE, DO_NOT_ARRANGE = FALSE }; | 380 | enum { ARRANGE = TRUE, DO_NOT_ARRANGE = FALSE }; |
352 | virtual BOOL addToFolder(LLFolderViewFolder* folder, LLFolderView* root); | 381 | virtual BOOL addToFolder(LLFolderViewFolder* folder, LLFolderView* root); |
353 | 382 | ||
383 | virtual EInventorySortGroup getSortGroup(); | ||
384 | |||
354 | // Finds width and height of this object and it's children. Also | 385 | // Finds width and height of this object and it's children. Also |
355 | // makes sure that this view and it's children are the right size. | 386 | // makes sure that this view and it's children are the right size. |
356 | virtual S32 arrange( S32* width, S32* height, S32 filter_generation ); | 387 | virtual S32 arrange( S32* width, S32* height, S32 filter_generation ); |
@@ -449,8 +480,10 @@ public: | |||
449 | 480 | ||
450 | virtual void setStatusText(const LLString& text) { mStatusText = text; } | 481 | virtual void setStatusText(const LLString& text) { mStatusText = text; } |
451 | 482 | ||
452 | BOOL getFiltered(); | 483 | virtual BOOL potentiallyVisible(); // do we know for a fact that this item has been filtered out? |
453 | BOOL getFiltered(S32 filter_generation); | 484 | |
485 | virtual BOOL getFiltered(); | ||
486 | virtual BOOL getFiltered(S32 filter_generation); | ||
454 | virtual void setFiltered(BOOL filtered, S32 filter_generation); | 487 | virtual void setFiltered(BOOL filtered, S32 filter_generation); |
455 | 488 | ||
456 | // change the icon | 489 | // change the icon |
@@ -504,7 +537,7 @@ protected: | |||
504 | typedef std::vector<LLFolderViewFolder*> folders_t; | 537 | typedef std::vector<LLFolderViewFolder*> folders_t; |
505 | items_t mItems; | 538 | items_t mItems; |
506 | folders_t mFolders; | 539 | folders_t mFolders; |
507 | sort_order_f mSortFunction; | 540 | LLInventorySort mSortFunction; |
508 | 541 | ||
509 | BOOL mIsOpen; | 542 | BOOL mIsOpen; |
510 | BOOL mExpanderHighlighted; | 543 | BOOL mExpanderHighlighted; |
@@ -534,6 +567,8 @@ public: | |||
534 | virtual EWidgetType getWidgetType() const; | 567 | virtual EWidgetType getWidgetType() const; |
535 | virtual LLString getWidgetTag() const; | 568 | virtual LLString getWidgetTag() const; |
536 | 569 | ||
570 | virtual BOOL potentiallyVisible(); | ||
571 | |||
537 | LLFolderViewItem* getNextFromChild( LLFolderViewItem*, BOOL include_children = TRUE ); | 572 | LLFolderViewItem* getNextFromChild( LLFolderViewItem*, BOOL include_children = TRUE ); |
538 | LLFolderViewItem* getPreviousFromChild( LLFolderViewItem*, BOOL include_children = TRUE ); | 573 | LLFolderViewItem* getPreviousFromChild( LLFolderViewItem*, BOOL include_children = TRUE ); |
539 | 574 | ||
@@ -546,6 +581,9 @@ public: | |||
546 | 581 | ||
547 | BOOL needsArrange(); | 582 | BOOL needsArrange(); |
548 | 583 | ||
584 | // Returns the sort group (system, trash, folder) for this folder. | ||
585 | virtual EInventorySortGroup getSortGroup(); | ||
586 | |||
549 | virtual void setCompletedFilterGeneration(S32 generation, BOOL recurse_up); | 587 | virtual void setCompletedFilterGeneration(S32 generation, BOOL recurse_up); |
550 | virtual S32 getCompletedFilterGeneration() { return mCompletedFilterGeneration; } | 588 | virtual S32 getCompletedFilterGeneration() { return mCompletedFilterGeneration; } |
551 | 589 | ||
@@ -603,7 +641,7 @@ public: | |||
603 | // This function is called by a child that needs to be resorted. | 641 | // This function is called by a child that needs to be resorted. |
604 | void resort(LLFolderViewItem* item); | 642 | void resort(LLFolderViewItem* item); |
605 | 643 | ||
606 | void setItemSortFunction(sort_order_f ordering); | 644 | void setItemSortOrder(U32 ordering); |
607 | void sortBy(U32); | 645 | void sortBy(U32); |
608 | //BOOL (*func)(LLFolderViewItem* a, LLFolderViewItem* b)); | 646 | //BOOL (*func)(LLFolderViewItem* a, LLFolderViewItem* b)); |
609 | 647 | ||
@@ -617,7 +655,8 @@ public: | |||
617 | virtual void setOpen(BOOL open = TRUE); /* Flawfinder: ignore */ | 655 | virtual void setOpen(BOOL open = TRUE); /* Flawfinder: ignore */ |
618 | 656 | ||
619 | // Called when a child is refreshed. | 657 | // Called when a child is refreshed. |
620 | virtual void requestArrange(); | 658 | // don't rearrange child folder contents unless explicitly requested |
659 | virtual void requestArrange(BOOL include_descendants = FALSE); | ||
621 | 660 | ||
622 | // internal method which doesn't update the entire view. This | 661 | // internal method which doesn't update the entire view. This |
623 | // method was written because the list iterators destroy the state | 662 | // method was written because the list iterators destroy the state |
diff --git a/linden/indra/newview/llgenepool.cpp b/linden/indra/newview/llgenepool.cpp index 95b15f3..3cc57e9 100644 --- a/linden/indra/newview/llgenepool.cpp +++ b/linden/indra/newview/llgenepool.cpp | |||
@@ -223,6 +223,14 @@ void LLGenePool::spawn( EWearableType type ) | |||
223 | 223 | ||
224 | // Only consider archetypes that have the same sex as you have already. | 224 | // Only consider archetypes that have the same sex as you have already. |
225 | LLVisualParam* male_param = avatar->getVisualParam( "male" ); | 225 | LLVisualParam* male_param = avatar->getVisualParam( "male" ); |
226 | |||
227 | if (!male_param) | ||
228 | { | ||
229 | llwarns << "The hard coded \'male\' parameter passed to avatar->getVisualParam() in LLGenePool::spawn() is no longer valid." | ||
230 | << llendl; | ||
231 | return; | ||
232 | } | ||
233 | |||
226 | S32 male_param_id = male_param->getID(); | 234 | S32 male_param_id = male_param->getID(); |
227 | F32 sex_weight = male_param->getWeight(); | 235 | F32 sex_weight = male_param->getWeight(); |
228 | 236 | ||
diff --git a/linden/indra/newview/llgivemoney.cpp b/linden/indra/newview/llgivemoney.cpp index 3722682..e89ab3d 100644 --- a/linden/indra/newview/llgivemoney.cpp +++ b/linden/indra/newview/llgivemoney.cpp | |||
@@ -155,7 +155,7 @@ LLFloaterPay::LLFloaterPay(const std::string& name, | |||
155 | 155 | ||
156 | childSetKeystrokeCallback("amount", &LLFloaterPay::onKeystroke, this); | 156 | childSetKeystrokeCallback("amount", &LLFloaterPay::onKeystroke, this); |
157 | childSetText("amount", last_amount); | 157 | childSetText("amount", last_amount); |
158 | childSetPrevalidate("amount", LLLineEditor::prevalidatePositiveS32); | 158 | childSetPrevalidate("amount", LLLineEditor::prevalidateNonNegativeS32); |
159 | 159 | ||
160 | info = new LLGiveMoneyInfo(this, 0); | 160 | info = new LLGiveMoneyInfo(this, 0); |
161 | mCallbackData.push_back(info); | 161 | mCallbackData.push_back(info); |
@@ -422,14 +422,9 @@ void LLFloaterPay::onKeystroke(LLLineEditor*, void* data) | |||
422 | LLFloaterPay* self = reinterpret_cast<LLFloaterPay*>(data); | 422 | LLFloaterPay* self = reinterpret_cast<LLFloaterPay*>(data); |
423 | if(self) | 423 | if(self) |
424 | { | 424 | { |
425 | if (!self->childGetText("amount").empty()) | 425 | // enable the Pay button when amount is non-empty and positive, disable otherwise |
426 | { | 426 | LLString amtstr = self->childGetText("amount"); |
427 | self->childSetEnabled("pay btn", TRUE); | 427 | self->childSetEnabled("pay btn", !amtstr.empty() && atoi(amtstr.c_str()) > 0); |
428 | } | ||
429 | else | ||
430 | { | ||
431 | self->childSetEnabled("pay btn", FALSE); | ||
432 | } | ||
433 | } | 428 | } |
434 | } | 429 | } |
435 | 430 | ||
diff --git a/linden/indra/newview/llglsandbox.cpp b/linden/indra/newview/llglsandbox.cpp index e14cebe..81806dc 100644 --- a/linden/indra/newview/llglsandbox.cpp +++ b/linden/indra/newview/llglsandbox.cpp | |||
@@ -1134,5 +1134,5 @@ void post_show_depth_buffer() | |||
1134 | } | 1134 | } |
1135 | glDrawPixels(xsize,ysize,GL_RED,GL_UNSIGNED_BYTE,buf); | 1135 | glDrawPixels(xsize,ysize,GL_RED,GL_UNSIGNED_BYTE,buf); |
1136 | 1136 | ||
1137 | delete buf; | 1137 | delete [] buf; |
1138 | } | 1138 | } |
diff --git a/linden/indra/newview/llglslshader.cpp b/linden/indra/newview/llglslshader.cpp index 3f23a66..9c3d707 100644 --- a/linden/indra/newview/llglslshader.cpp +++ b/linden/indra/newview/llglslshader.cpp | |||
@@ -847,7 +847,7 @@ BOOL LLShaderMgr::loadShadersAvatar() | |||
847 | return FALSE; | 847 | return FALSE; |
848 | } | 848 | } |
849 | 849 | ||
850 | if (success) | 850 | /*if (success) |
851 | { | 851 | { |
852 | //load specular (eyeball) vertex program | 852 | //load specular (eyeball) vertex program |
853 | std::string eyeballvertex = "avatar/eyeballV.glsl"; | 853 | std::string eyeballvertex = "avatar/eyeballV.glsl"; |
@@ -865,7 +865,7 @@ BOOL LLShaderMgr::loadShadersAvatar() | |||
865 | { | 865 | { |
866 | llwarns << "Failed to load " << eyeballvertex << llendl; | 866 | llwarns << "Failed to load " << eyeballvertex << llendl; |
867 | } | 867 | } |
868 | } | 868 | }*/ |
869 | 869 | ||
870 | if (success) | 870 | if (success) |
871 | { | 871 | { |
diff --git a/linden/indra/newview/llgroupnotify.cpp b/linden/indra/newview/llgroupnotify.cpp index de9b571..ef20138 100644 --- a/linden/indra/newview/llgroupnotify.cpp +++ b/linden/indra/newview/llgroupnotify.cpp | |||
@@ -162,7 +162,7 @@ LLGroupNotifyBox::LLGroupNotifyBox(const char* subject, | |||
162 | 162 | ||
163 | line = new LLTextBox("title",LLRect(x,y,RIGHT - HPAD,y - LINE_HEIGHT),"Group Notice",LLFontGL::sSansSerifHuge); | 163 | line = new LLTextBox("title",LLRect(x,y,RIGHT - HPAD,y - LINE_HEIGHT),"Group Notice",LLFontGL::sSansSerifHuge); |
164 | line->setHAlign(LLFontGL::RIGHT); | 164 | line->setHAlign(LLFontGL::RIGHT); |
165 | line->setDropshadowVisible(true); | 165 | line->setFontStyle(LLFontGL::DROP_SHADOW_SOFT); |
166 | line->setBorderVisible(FALSE); | 166 | line->setBorderVisible(FALSE); |
167 | line->setColor(LLColor4::white); | 167 | line->setColor(LLColor4::white); |
168 | line->setBackgroundColor( gColors.getColor("GroupNotifyBoxColor") ); | 168 | line->setBackgroundColor( gColors.getColor("GroupNotifyBoxColor") ); |
@@ -177,7 +177,7 @@ LLGroupNotifyBox::LLGroupNotifyBox(const char* subject, | |||
177 | from << "Sent by " << from_name << ", " << group_name; | 177 | from << "Sent by " << from_name << ", " << group_name; |
178 | 178 | ||
179 | line = new LLTextBox("group",LLRect(x,y,RIGHT - HPAD,y - LINE_HEIGHT),from.str().c_str(),LLFontGL::sSansSerif); | 179 | line = new LLTextBox("group",LLRect(x,y,RIGHT - HPAD,y - LINE_HEIGHT),from.str().c_str(),LLFontGL::sSansSerif); |
180 | line->setDropshadowVisible(true); | 180 | line->setFontStyle(LLFontGL::DROP_SHADOW_SOFT); |
181 | line->setHAlign(LLFontGL::RIGHT); | 181 | line->setHAlign(LLFontGL::RIGHT); |
182 | line->setBorderVisible(FALSE); | 182 | line->setBorderVisible(FALSE); |
183 | line->setColor(LLColor4::white); | 183 | line->setColor(LLColor4::white); |
@@ -244,7 +244,7 @@ LLGroupNotifyBox::LLGroupNotifyBox(const char* subject, | |||
244 | line = new LLTextBox("subjecttitle",LLRect(x,y,x + LABEL_WIDTH,y - LINE_HEIGHT),"Attached: ",LLFontGL::sSansSerif); | 244 | line = new LLTextBox("subjecttitle",LLRect(x,y,x + LABEL_WIDTH,y - LINE_HEIGHT),"Attached: ",LLFontGL::sSansSerif); |
245 | line->setBorderVisible(FALSE); | 245 | line->setBorderVisible(FALSE); |
246 | line->setColor(LLColor4::white); | 246 | line->setColor(LLColor4::white); |
247 | line->setDropshadowVisible(TRUE); | 247 | line->setFontStyle(LLFontGL::DROP_SHADOW_SOFT); |
248 | line->setBackgroundColor( gColors.getColor("GroupNotifyBoxColor") ); | 248 | line->setBackgroundColor( gColors.getColor("GroupNotifyBoxColor") ); |
249 | addChild(line); | 249 | addChild(line); |
250 | 250 | ||
@@ -261,7 +261,7 @@ LLGroupNotifyBox::LLGroupNotifyBox(const char* subject, | |||
261 | line->setEnabled(FALSE); | 261 | line->setEnabled(FALSE); |
262 | line->setBorderVisible(TRUE); | 262 | line->setBorderVisible(TRUE); |
263 | line->setDisabledColor(LLColor4::blue4); | 263 | line->setDisabledColor(LLColor4::blue4); |
264 | line->setDropshadowVisible(FALSE); | 264 | line->setFontStyle(LLFontGL::NORMAL); |
265 | line->setBackgroundVisible(true); | 265 | line->setBackgroundVisible(true); |
266 | line->setBackgroundColor( semi_transparent ); | 266 | line->setBackgroundColor( semi_transparent ); |
267 | addChild(line); | 267 | addChild(line); |
@@ -399,7 +399,7 @@ void LLGroupNotifyBox::close() | |||
399 | // Then we need to send the inventory declined message | 399 | // Then we need to send the inventory declined message |
400 | if(mHasInventory) | 400 | if(mHasInventory) |
401 | { | 401 | { |
402 | inventory_offer_callback( 1 , mInventoryOffer); | 402 | inventory_offer_callback(IOR_DECLINE , mInventoryOffer); |
403 | } | 403 | } |
404 | gNotifyBoxView->removeChild(this); | 404 | gNotifyBoxView->removeChild(this); |
405 | 405 | ||
@@ -461,7 +461,7 @@ void LLGroupNotifyBox::onClickSaveInventory(void* data) | |||
461 | { | 461 | { |
462 | LLGroupNotifyBox* self = (LLGroupNotifyBox*)data; | 462 | LLGroupNotifyBox* self = (LLGroupNotifyBox*)data; |
463 | 463 | ||
464 | inventory_offer_callback( 0 , self->mInventoryOffer); | 464 | inventory_offer_callback( IOR_ACCEPT , self->mInventoryOffer); |
465 | 465 | ||
466 | // inventory_offer_callback will delete the offer, so make sure we aren't still pointing to it. | 466 | // inventory_offer_callback will delete the offer, so make sure we aren't still pointing to it. |
467 | self->mInventoryOffer = NULL; | 467 | self->mInventoryOffer = NULL; |
diff --git a/linden/indra/newview/llhoverview.cpp b/linden/indra/newview/llhoverview.cpp index 6807b42..8296e14 100644 --- a/linden/indra/newview/llhoverview.cpp +++ b/linden/indra/newview/llhoverview.cpp | |||
@@ -539,7 +539,6 @@ void LLHoverView::updateText() | |||
539 | // on the land info panel | 539 | // on the land info panel |
540 | if ( !hover_parcel->getAllowModify() ) | 540 | if ( !hover_parcel->getAllowModify() ) |
541 | { | 541 | { |
542 | if (words) line->append(", "); | ||
543 | if ( hover_parcel->getAllowGroupModify() ) | 542 | if ( hover_parcel->getAllowGroupModify() ) |
544 | { | 543 | { |
545 | line->append("Group Build"); | 544 | line->append("Group Build"); |
diff --git a/linden/indra/newview/llhudeffecttrail.cpp b/linden/indra/newview/llhudeffecttrail.cpp index fed3a9e..79c05d7 100644 --- a/linden/indra/newview/llhudeffecttrail.cpp +++ b/linden/indra/newview/llhudeffecttrail.cpp | |||
@@ -112,17 +112,19 @@ void LLHUDEffectSpiral::packData(LLMessageSystem *mesgsys) | |||
112 | 112 | ||
113 | void LLHUDEffectSpiral::unpackData(LLMessageSystem *mesgsys, S32 blocknum) | 113 | void LLHUDEffectSpiral::unpackData(LLMessageSystem *mesgsys, S32 blocknum) |
114 | { | 114 | { |
115 | U8 packed_data[56]; | 115 | const size_t EFFECT_SIZE = 56; |
116 | U8 packed_data[EFFECT_SIZE]; | ||
116 | 117 | ||
117 | LLHUDEffect::unpackData(mesgsys, blocknum); | 118 | LLHUDEffect::unpackData(mesgsys, blocknum); |
118 | LLUUID object_id, target_object_id; | 119 | LLUUID object_id, target_object_id; |
119 | S32 size = mesgsys->getSizeFast(_PREHASH_Effect, blocknum, _PREHASH_TypeData); | 120 | S32 size = mesgsys->getSizeFast(_PREHASH_Effect, blocknum, _PREHASH_TypeData); |
120 | if (size != 56) | 121 | if (size != EFFECT_SIZE) |
121 | { | 122 | { |
122 | llwarns << "Spiral effect with bad size " << size << llendl; | 123 | llwarns << "Spiral effect with bad size " << size << llendl; |
123 | return; | 124 | return; |
124 | } | 125 | } |
125 | mesgsys->getBinaryDataFast(_PREHASH_Effect, _PREHASH_TypeData, packed_data, 56, blocknum); | 126 | mesgsys->getBinaryDataFast(_PREHASH_Effect, _PREHASH_TypeData, |
127 | packed_data, EFFECT_SIZE, blocknum, EFFECT_SIZE); | ||
126 | 128 | ||
127 | htonmemcpy(object_id.mData, packed_data, MVT_LLUUID, 16); | 129 | htonmemcpy(object_id.mData, packed_data, MVT_LLUUID, 16); |
128 | htonmemcpy(target_object_id.mData, packed_data + 16, MVT_LLUUID, 16); | 130 | htonmemcpy(target_object_id.mData, packed_data + 16, MVT_LLUUID, 16); |
diff --git a/linden/indra/newview/llimview.cpp b/linden/indra/newview/llimview.cpp index 38471ad..02578d2 100644 --- a/linden/indra/newview/llimview.cpp +++ b/linden/indra/newview/llimview.cpp | |||
@@ -374,11 +374,21 @@ void LLIMView::addMessage( | |||
374 | } | 374 | } |
375 | else | 375 | else |
376 | { | 376 | { |
377 | //if we have recently requsted to be dropped from a session | ||
378 | //but are still receiving messages from the session, don't make | ||
379 | //a new floater | ||
380 | // if ( mSessionsDropRequested.has(session_id.asString()) ) | ||
381 | // { | ||
382 | // return ; | ||
383 | // } | ||
384 | |||
377 | const char* name = from; | 385 | const char* name = from; |
378 | if(session_name && (strlen(session_name)>1)) | 386 | if(session_name && (strlen(session_name)>1)) |
379 | { | 387 | { |
380 | name = session_name; | 388 | name = session_name; |
381 | } | 389 | } |
390 | |||
391 | |||
382 | floater = createFloater(new_session_id, other_participant_id, name, dialog, FALSE); | 392 | floater = createFloater(new_session_id, other_participant_id, name, dialog, FALSE); |
383 | 393 | ||
384 | // When we get a new IM, and if you are a god, display a bit | 394 | // When we get a new IM, and if you are a god, display a bit |
@@ -502,13 +512,17 @@ LLUUID LLIMView::addSession(const std::string& name, | |||
502 | LLFloaterIMPanel* floater = findFloaterBySession(session_id); | 512 | LLFloaterIMPanel* floater = findFloaterBySession(session_id); |
503 | if(!floater) | 513 | if(!floater) |
504 | { | 514 | { |
505 | // On creation, use the first element of ids as the "other_participant_id" | 515 | // On creation, use the first element of ids as the |
516 | // "other_participant_id" | ||
506 | floater = createFloater(session_id, | 517 | floater = createFloater(session_id, |
507 | other_participant_id, | 518 | other_participant_id, |
508 | name, | 519 | name, |
509 | ids, | 520 | ids, |
510 | dialog, | 521 | dialog, |
511 | TRUE); | 522 | TRUE); |
523 | |||
524 | if ( !floater ) return LLUUID::null; | ||
525 | |||
512 | noteOfflineUsers(floater, ids); | 526 | noteOfflineUsers(floater, ids); |
513 | } | 527 | } |
514 | mTalkFloater->showFloater(floater); | 528 | mTalkFloater->showFloater(floater); |
@@ -528,6 +542,11 @@ void LLIMView::removeSession(const LLUUID& session_id) | |||
528 | mTalkFloater->removeFloater(floater); | 542 | mTalkFloater->removeFloater(floater); |
529 | //mTabContainer->removeTabPanel(floater); | 543 | //mTabContainer->removeTabPanel(floater); |
530 | } | 544 | } |
545 | |||
546 | // if ( session_id.notNull() ) | ||
547 | // { | ||
548 | // mSessionsDropRequested[session_id.asString()] = LLSD(); | ||
549 | // } | ||
531 | } | 550 | } |
532 | 551 | ||
533 | void LLIMView::refresh() | 552 | void LLIMView::refresh() |
@@ -705,6 +724,7 @@ LLFloaterIMPanel* LLIMView::createFloater( | |||
705 | { | 724 | { |
706 | llwarns << "Creating LLFloaterIMPanel with null session ID" << llendl; | 725 | llwarns << "Creating LLFloaterIMPanel with null session ID" << llendl; |
707 | } | 726 | } |
727 | |||
708 | llinfos << "LLIMView::createFloater: from " << other_participant_id | 728 | llinfos << "LLIMView::createFloater: from " << other_participant_id |
709 | << " in session " << session_id << llendl; | 729 | << " in session " << session_id << llendl; |
710 | LLFloaterIMPanel* floater = new LLFloaterIMPanel(session_label, | 730 | LLFloaterIMPanel* floater = new LLFloaterIMPanel(session_label, |
@@ -731,6 +751,7 @@ LLFloaterIMPanel* LLIMView::createFloater( | |||
731 | { | 751 | { |
732 | llwarns << "Creating LLFloaterIMPanel with null session ID" << llendl; | 752 | llwarns << "Creating LLFloaterIMPanel with null session ID" << llendl; |
733 | } | 753 | } |
754 | |||
734 | llinfos << "LLIMView::createFloater: from " << other_participant_id | 755 | llinfos << "LLIMView::createFloater: from " << other_participant_id |
735 | << " in session " << session_id << llendl; | 756 | << " in session " << session_id << llendl; |
736 | LLFloaterIMPanel* floater = new LLFloaterIMPanel(session_label, | 757 | LLFloaterIMPanel* floater = new LLFloaterIMPanel(session_label, |
@@ -805,6 +826,11 @@ void LLIMView::updateFloaterSessionID(const LLUUID& old_session_id, | |||
805 | } | 826 | } |
806 | } | 827 | } |
807 | 828 | ||
829 | void LLIMView::onDropRequestReplyReceived(const LLUUID& session_id) | ||
830 | { | ||
831 | mSessionsDropRequested.erase(session_id.asString()); | ||
832 | } | ||
833 | |||
808 | void onConfirmForceCloseError(S32 option, void* data) | 834 | void onConfirmForceCloseError(S32 option, void* data) |
809 | { | 835 | { |
810 | //only 1 option really | 836 | //only 1 option really |
@@ -869,7 +895,7 @@ public: | |||
869 | 895 | ||
870 | class LLViewerIMSessionEventReply : public LLHTTPNode | 896 | class LLViewerIMSessionEventReply : public LLHTTPNode |
871 | { | 897 | { |
872 | public: | 898 | public: |
873 | virtual void describe(Description& desc) const | 899 | virtual void describe(Description& desc) const |
874 | { | 900 | { |
875 | desc.shortInfo("Used for receiving a reply to a IM session event"); | 901 | desc.shortInfo("Used for receiving a reply to a IM session event"); |
@@ -913,7 +939,7 @@ class LLViewerIMSessionEventReply : public LLHTTPNode | |||
913 | 939 | ||
914 | class LLViewerForceCloseIMSession: public LLHTTPNode | 940 | class LLViewerForceCloseIMSession: public LLHTTPNode |
915 | { | 941 | { |
916 | 942 | public: | |
917 | virtual void post(ResponsePtr response, | 943 | virtual void post(ResponsePtr response, |
918 | const LLSD& context, | 944 | const LLSD& context, |
919 | const LLSD& input) const | 945 | const LLSD& input) const |
@@ -942,11 +968,40 @@ class LLViewerForceCloseIMSession: public LLHTTPNode | |||
942 | } | 968 | } |
943 | }; | 969 | }; |
944 | 970 | ||
971 | class LLViewerIMSessionDropReply : public LLHTTPNode | ||
972 | { | ||
973 | public: | ||
974 | virtual void post(ResponsePtr response, | ||
975 | const LLSD& context, | ||
976 | const LLSD& input) const | ||
977 | { | ||
978 | LLUUID session_id; | ||
979 | bool success; | ||
980 | |||
981 | success = input["body"]["success"].asBoolean(); | ||
982 | session_id = input["body"]["session_id"].asUUID(); | ||
983 | |||
984 | if ( !success ) | ||
985 | { | ||
986 | //throw an error alert? | ||
987 | } | ||
988 | |||
989 | gIMView->onDropRequestReplyReceived(session_id); | ||
990 | } | ||
991 | }; | ||
992 | |||
945 | LLHTTPRegistration<LLViewerIMSessionStartReply> | 993 | LLHTTPRegistration<LLViewerIMSessionStartReply> |
946 | gHTTPRegistrationMessageImsessionstartreply("/message/IMSessionStartReply"); | 994 | gHTTPRegistrationMessageImsessionstartreply( |
995 | "/message/IMSessionStartReply"); | ||
947 | 996 | ||
948 | LLHTTPRegistration<LLViewerIMSessionEventReply> | 997 | LLHTTPRegistration<LLViewerIMSessionEventReply> |
949 | gHTTPRegistrationMessageImsessioneventreply("/message/IMSessionEventReply"); | 998 | gHTTPRegistrationMessageImsessioneventreply( |
999 | "/message/IMSessionEventReply"); | ||
950 | 1000 | ||
951 | LLHTTPRegistration<LLViewerForceCloseIMSession> | 1001 | LLHTTPRegistration<LLViewerForceCloseIMSession> |
952 | gHTTPRegistrationMessageForceCloseImSession("/message/ForceCloseIMSession"); | 1002 | gHTTPRegistrationMessageForceCloseImSession( |
1003 | "/message/ForceCloseIMSession"); | ||
1004 | |||
1005 | LLHTTPRegistration<LLViewerIMSessionDropReply> | ||
1006 | gHTTPRegistrationMessageImSessionDropReply( | ||
1007 | "/message/IMSessionDropReply"); | ||
diff --git a/linden/indra/newview/llimview.h b/linden/indra/newview/llimview.h index 74ea880..c0b0f79 100644 --- a/linden/indra/newview/llimview.h +++ b/linden/indra/newview/llimview.h | |||
@@ -131,6 +131,8 @@ public: | |||
131 | // is no matching panel. | 131 | // is no matching panel. |
132 | LLFloaterIMPanel* findFloaterBySession(const LLUUID& session_id); | 132 | LLFloaterIMPanel* findFloaterBySession(const LLUUID& session_id); |
133 | 133 | ||
134 | void onDropRequestReplyReceived(const LLUUID& session_id); | ||
135 | |||
134 | private: | 136 | private: |
135 | // create a panel and update internal representation for | 137 | // create a panel and update internal representation for |
136 | // consistency. Returns the pointer, caller (the class instance | 138 | // consistency. Returns the pointer, caller (the class instance |
@@ -167,6 +169,8 @@ private: | |||
167 | 169 | ||
168 | // An IM has been received that you haven't seen yet. | 170 | // An IM has been received that you haven't seen yet. |
169 | BOOL mIMReceived; | 171 | BOOL mIMReceived; |
172 | |||
173 | LLSD mSessionsDropRequested; | ||
170 | }; | 174 | }; |
171 | 175 | ||
172 | 176 | ||
diff --git a/linden/indra/newview/llinventoryactions.cpp b/linden/indra/newview/llinventoryactions.cpp index 6452c87..900a729 100644 --- a/linden/indra/newview/llinventoryactions.cpp +++ b/linden/indra/newview/llinventoryactions.cpp | |||
@@ -491,6 +491,23 @@ class LLSetSortBy : public inventory_listener_t | |||
491 | } | 491 | } |
492 | mPtr->getActivePanel()->setSortOrder( order ); | 492 | mPtr->getActivePanel()->setSortOrder( order ); |
493 | } | 493 | } |
494 | else if (sort_field == "systemfolderstotop") | ||
495 | { | ||
496 | U32 order = mPtr->getActivePanel()->getSortOrder(); | ||
497 | if ( order & LLInventoryFilter::SO_SYSTEM_FOLDERS_TO_TOP ) | ||
498 | { | ||
499 | order &= ~LLInventoryFilter::SO_SYSTEM_FOLDERS_TO_TOP; | ||
500 | |||
501 | mPtr->getControl("Inventory.SystemFoldersToTop")->setValue( FALSE ); | ||
502 | } | ||
503 | else | ||
504 | { | ||
505 | order |= LLInventoryFilter::SO_SYSTEM_FOLDERS_TO_TOP; | ||
506 | |||
507 | mPtr->getControl("Inventory.SystemFoldersToTop")->setValue( TRUE ); | ||
508 | } | ||
509 | mPtr->getActivePanel()->setSortOrder( order ); | ||
510 | } | ||
494 | 511 | ||
495 | return true; | 512 | return true; |
496 | } | 513 | } |
diff --git a/linden/indra/newview/llinventorybridge.cpp b/linden/indra/newview/llinventorybridge.cpp index 05334d7..a7b80ae 100644 --- a/linden/indra/newview/llinventorybridge.cpp +++ b/linden/indra/newview/llinventorybridge.cpp | |||
@@ -569,10 +569,10 @@ const char* safe_inv_type_lookup(LLInventoryType::EType inv_type) | |||
569 | } | 569 | } |
570 | 570 | ||
571 | LLInvFVBridge* LLInvFVBridge::createBridge(LLAssetType::EType asset_type, | 571 | LLInvFVBridge* LLInvFVBridge::createBridge(LLAssetType::EType asset_type, |
572 | LLInventoryType::EType inv_type, | 572 | LLInventoryType::EType inv_type, |
573 | LLInventoryPanel* inventory, | 573 | LLInventoryPanel* inventory, |
574 | const LLUUID& uuid, | 574 | const LLUUID& uuid, |
575 | U32 flags) | 575 | U32 flags) |
576 | { | 576 | { |
577 | LLInvFVBridge* new_listener = NULL; | 577 | LLInvFVBridge* new_listener = NULL; |
578 | switch(asset_type) | 578 | switch(asset_type) |
@@ -677,7 +677,11 @@ LLInvFVBridge* LLInvFVBridge::createBridge(LLAssetType::EType asset_type, | |||
677 | break; | 677 | break; |
678 | } | 678 | } |
679 | 679 | ||
680 | new_listener->mInvType = inv_type; | 680 | if (new_listener) |
681 | { | ||
682 | new_listener->mInvType = inv_type; | ||
683 | } | ||
684 | |||
681 | return new_listener; | 685 | return new_listener; |
682 | } | 686 | } |
683 | 687 | ||
@@ -907,16 +911,20 @@ BOOL LLItemBridge::removeItem() | |||
907 | if(!model) return FALSE; | 911 | if(!model) return FALSE; |
908 | LLUUID trash_id = model->findCategoryUUIDForType(LLAssetType::AT_TRASH); | 912 | LLUUID trash_id = model->findCategoryUUIDForType(LLAssetType::AT_TRASH); |
909 | LLViewerInventoryItem* item = getItem(); | 913 | LLViewerInventoryItem* item = getItem(); |
910 | if(item) | 914 | |
915 | // if item is not already in trash | ||
916 | if(item && !model->isObjectDescendentOf(mUUID, trash_id)) | ||
911 | { | 917 | { |
912 | // restamp on move to trash. | 918 | // move to trash, and restamp |
913 | LLInvFVBridge::changeItemParent(model, item, trash_id, TRUE); | 919 | LLInvFVBridge::changeItemParent(model, item, trash_id, TRUE); |
920 | // delete was successful | ||
921 | return TRUE; | ||
922 | } | ||
923 | else | ||
924 | { | ||
925 | // tried to delete already item in trash (should purge?) | ||
926 | return FALSE; | ||
914 | } | 927 | } |
915 | |||
916 | // return false anyway, so that if it's called from the folder | ||
917 | // view, it doesn't remove the view - it's just being moved to the | ||
918 | // trash. | ||
919 | return FALSE; | ||
920 | } | 928 | } |
921 | 929 | ||
922 | BOOL LLItemBridge::isItemCopyable() const | 930 | BOOL LLItemBridge::isItemCopyable() const |
@@ -1462,11 +1470,20 @@ void LLInventoryCopyAndWearObserver::changed(U32 mask) | |||
1462 | { | 1470 | { |
1463 | LLViewerInventoryCategory* category = gInventory.getCategory(mCatID); | 1471 | LLViewerInventoryCategory* category = gInventory.getCategory(mCatID); |
1464 | 1472 | ||
1465 | if (category->getDescendentCount() == mContentsCount) | 1473 | if (NULL == category) |
1466 | { | 1474 | { |
1467 | gInventory.removeObserver(this); | 1475 | llwarns << "gInventory.getCategory(" << mCatID |
1468 | wear_inventory_category(category, FALSE, TRUE); | 1476 | << ") was NULL" << llendl; |
1469 | delete this; | 1477 | } |
1478 | else | ||
1479 | { | ||
1480 | if (category->getDescendentCount() == | ||
1481 | mContentsCount) | ||
1482 | { | ||
1483 | gInventory.removeObserver(this); | ||
1484 | wear_inventory_category(category, FALSE, TRUE); | ||
1485 | delete this; | ||
1486 | } | ||
1470 | } | 1487 | } |
1471 | } | 1488 | } |
1472 | 1489 | ||
@@ -1682,11 +1699,7 @@ BOOL LLFolderBridge::removeItem() | |||
1682 | LLInvFVBridge::changeCategoryParent(model, cat, trash_id, TRUE); | 1699 | LLInvFVBridge::changeCategoryParent(model, cat, trash_id, TRUE); |
1683 | } | 1700 | } |
1684 | 1701 | ||
1685 | // return false anyway, so that if it's called from the folder | 1702 | return TRUE; |
1686 | // view, it doesn't remove the view - it's just being moved to the | ||
1687 | // trash. | ||
1688 | return FALSE; | ||
1689 | |||
1690 | } | 1703 | } |
1691 | 1704 | ||
1692 | BOOL LLFolderBridge::isClipboardPasteable() const | 1705 | BOOL LLFolderBridge::isClipboardPasteable() const |
@@ -2178,10 +2191,13 @@ BOOL LLFolderBridge::dragItemIntoFolder(LLInventoryItem* inv_item, | |||
2178 | // everything in the active window so that we don't follow | 2191 | // everything in the active window so that we don't follow |
2179 | // the selection to its new location (which is very | 2192 | // the selection to its new location (which is very |
2180 | // annoying). | 2193 | // annoying). |
2181 | LLInventoryPanel* active_panel = LLInventoryView::getActiveInventory()->getPanel(); | 2194 | if (LLInventoryView::getActiveInventory()) |
2182 | if (mInventoryPanel != active_panel) | ||
2183 | { | 2195 | { |
2184 | active_panel->unSelectAll(); | 2196 | LLInventoryPanel* active_panel = LLInventoryView::getActiveInventory()->getPanel(); |
2197 | if (active_panel && (mInventoryPanel != active_panel)) | ||
2198 | { | ||
2199 | active_panel->unSelectAll(); | ||
2200 | } | ||
2185 | } | 2201 | } |
2186 | 2202 | ||
2187 | // restamp if the move is into the trash. | 2203 | // restamp if the move is into the trash. |
@@ -3117,7 +3133,16 @@ void LLObjectBridge::performAction(LLFolderView* folder, LLInventoryModel* model | |||
3117 | gMessageSystem->sendReliable( gAgent.getRegion()->getHost() ); | 3133 | gMessageSystem->sendReliable( gAgent.getRegion()->getHost() ); |
3118 | } | 3134 | } |
3119 | // this object might have been selected, so let the selection manager know it's gone now | 3135 | // this object might have been selected, so let the selection manager know it's gone now |
3120 | gSelectMgr->remove(gObjectList.findObject(item->getUUID())); | 3136 | LLViewerObject *found_obj = |
3137 | gObjectList.findObject(item->getUUID()); | ||
3138 | if (found_obj) | ||
3139 | { | ||
3140 | gSelectMgr->remove(found_obj); | ||
3141 | } | ||
3142 | else | ||
3143 | { | ||
3144 | llwarns << "object not found - ignoring" << llendl; | ||
3145 | } | ||
3121 | } | 3146 | } |
3122 | else LLItemBridge::performAction(folder, model, action); | 3147 | else LLItemBridge::performAction(folder, model, action); |
3123 | } | 3148 | } |
@@ -4027,7 +4052,15 @@ void remove_inventory_category_from_avatar_step2( BOOL proceed, void* userdata) | |||
4027 | gMessageSystem->sendReliable( gAgent.getRegion()->getHost() ); | 4052 | gMessageSystem->sendReliable( gAgent.getRegion()->getHost() ); |
4028 | 4053 | ||
4029 | // this object might have been selected, so let the selection manager know it's gone now | 4054 | // this object might have been selected, so let the selection manager know it's gone now |
4030 | gSelectMgr->remove(gObjectList.findObject( obj_item_array.get(i)->getUUID()) ); | 4055 | LLViewerObject *found_obj = gObjectList.findObject( obj_item_array.get(i)->getUUID()); |
4056 | if (found_obj) | ||
4057 | { | ||
4058 | gSelectMgr->remove(found_obj); | ||
4059 | } | ||
4060 | else | ||
4061 | { | ||
4062 | llwarns << "object not found, ignoring" << llendl; | ||
4063 | } | ||
4031 | } | 4064 | } |
4032 | } | 4065 | } |
4033 | 4066 | ||
diff --git a/linden/indra/newview/llinventorybridge.h b/linden/indra/newview/llinventorybridge.h index 1269fa2..1269fa2 100755..100644 --- a/linden/indra/newview/llinventorybridge.h +++ b/linden/indra/newview/llinventorybridge.h | |||
diff --git a/linden/indra/newview/llinventorymodel.cpp b/linden/indra/newview/llinventorymodel.cpp index ddd229b..8e95156 100644 --- a/linden/indra/newview/llinventorymodel.cpp +++ b/linden/indra/newview/llinventorymodel.cpp | |||
@@ -27,6 +27,7 @@ | |||
27 | */ | 27 | */ |
28 | 28 | ||
29 | #include "llviewerprecompiledheaders.h" | 29 | #include "llviewerprecompiledheaders.h" |
30 | |||
30 | #include "llinventorymodel.h" | 31 | #include "llinventorymodel.h" |
31 | 32 | ||
32 | #include "llassetstorage.h" | 33 | #include "llassetstorage.h" |
@@ -41,6 +42,7 @@ | |||
41 | #include "llfocusmgr.h" | 42 | #include "llfocusmgr.h" |
42 | #include "llinventoryview.h" | 43 | #include "llinventoryview.h" |
43 | #include "llviewerinventory.h" | 44 | #include "llviewerinventory.h" |
45 | #include "llviewermessage.h" | ||
44 | #include "llviewerwindow.h" | 46 | #include "llviewerwindow.h" |
45 | #include "viewer.h" | 47 | #include "viewer.h" |
46 | #include "lldbstrings.h" | 48 | #include "lldbstrings.h" |
@@ -2282,7 +2284,7 @@ void LLInventoryModel::processUseCachedInventory(LLMessageSystem* msg, void**) | |||
2282 | void LLInventoryModel::processUpdateCreateInventoryItem(LLMessageSystem* msg, void**) | 2284 | void LLInventoryModel::processUpdateCreateInventoryItem(LLMessageSystem* msg, void**) |
2283 | { | 2285 | { |
2284 | // do accounting and highlight new items if they arrive | 2286 | // do accounting and highlight new items if they arrive |
2285 | if (gInventory.messageUpdateCore(msg, true, true)) | 2287 | if (gInventory.messageUpdateCore(msg, true)) |
2286 | { | 2288 | { |
2287 | U32 callback_id; | 2289 | U32 callback_id; |
2288 | LLUUID item_id; | 2290 | LLUUID item_id; |
@@ -2298,12 +2300,15 @@ void LLInventoryModel::processUpdateCreateInventoryItem(LLMessageSystem* msg, vo | |||
2298 | void LLInventoryModel::processFetchInventoryReply(LLMessageSystem* msg, void**) | 2300 | void LLInventoryModel::processFetchInventoryReply(LLMessageSystem* msg, void**) |
2299 | { | 2301 | { |
2300 | // no accounting | 2302 | // no accounting |
2301 | gInventory.messageUpdateCore(msg, false, false); | 2303 | gInventory.messageUpdateCore(msg, false); |
2302 | } | 2304 | } |
2303 | 2305 | ||
2304 | 2306 | ||
2305 | bool LLInventoryModel::messageUpdateCore(LLMessageSystem* msg, bool account, bool highlight_new) | 2307 | bool LLInventoryModel::messageUpdateCore(LLMessageSystem* msg, bool account) |
2306 | { | 2308 | { |
2309 | //make sure our added inventory observer is active -Gigs | ||
2310 | start_new_inventory_observer(); | ||
2311 | |||
2307 | LLUUID agent_id; | 2312 | LLUUID agent_id; |
2308 | msg->getUUIDFast(_PREHASH_AgentData, _PREHASH_AgentID, agent_id); | 2313 | msg->getUUIDFast(_PREHASH_AgentData, _PREHASH_AgentID, agent_id); |
2309 | if(agent_id != gAgent.getID()) | 2314 | if(agent_id != gAgent.getID()) |
@@ -2312,16 +2317,15 @@ bool LLInventoryModel::messageUpdateCore(LLMessageSystem* msg, bool account, boo | |||
2312 | << llendl; | 2317 | << llendl; |
2313 | return false; | 2318 | return false; |
2314 | } | 2319 | } |
2315 | LLPointer<LLViewerInventoryItem> lastitem; // hack | ||
2316 | item_array_t items; | 2320 | item_array_t items; |
2317 | update_map_t update; | 2321 | update_map_t update; |
2318 | S32 count = msg->getNumberOfBlocksFast(_PREHASH_InventoryData); | 2322 | S32 count = msg->getNumberOfBlocksFast(_PREHASH_InventoryData); |
2319 | bool all_one_folder = true; | 2323 | bool all_one_folder = true; |
2320 | LLUUID folder_id; | 2324 | LLUUID folder_id; |
2325 | // Does this loop ever execute more than once? -Gigs | ||
2321 | for(S32 i = 0; i < count; ++i) | 2326 | for(S32 i = 0; i < count; ++i) |
2322 | { | 2327 | { |
2323 | LLPointer<LLViewerInventoryItem> titem = new LLViewerInventoryItem; | 2328 | LLPointer<LLViewerInventoryItem> titem = new LLViewerInventoryItem; |
2324 | lastitem = titem; | ||
2325 | titem->unpackMessage(msg, _PREHASH_InventoryData, i); | 2329 | titem->unpackMessage(msg, _PREHASH_InventoryData, i); |
2326 | lldebugs << "LLInventoryModel::messageUpdateCore() item id:" | 2330 | lldebugs << "LLInventoryModel::messageUpdateCore() item id:" |
2327 | << titem->getUUID() << llendl; | 2331 | << titem->getUUID() << llendl; |
@@ -2359,6 +2363,7 @@ bool LLInventoryModel::messageUpdateCore(LLMessageSystem* msg, bool account, boo | |||
2359 | } | 2363 | } |
2360 | 2364 | ||
2361 | U32 changes = 0x0; | 2365 | U32 changes = 0x0; |
2366 | //as above, this loop never seems to loop more than once per call | ||
2362 | for (item_array_t::iterator it = items.begin(); it != items.end(); ++it) | 2367 | for (item_array_t::iterator it = items.begin(); it != items.end(); ++it) |
2363 | { | 2368 | { |
2364 | changes |= gInventory.updateItem(*it); | 2369 | changes |= gInventory.updateItem(*it); |
@@ -2366,88 +2371,6 @@ bool LLInventoryModel::messageUpdateCore(LLMessageSystem* msg, bool account, boo | |||
2366 | gInventory.notifyObservers(); | 2371 | gInventory.notifyObservers(); |
2367 | gViewerWindow->getWindow()->decBusyCount(); | 2372 | gViewerWindow->getWindow()->decBusyCount(); |
2368 | 2373 | ||
2369 | // *HACK: Do the 'show' logic for a new item in the inventory if | ||
2370 | // it is a newly created item. | ||
2371 | if (highlight_new | ||
2372 | && (changes & LLInventoryObserver::ADD) == LLInventoryObserver::ADD) | ||
2373 | { | ||
2374 | LLUUID trash_id; | ||
2375 | trash_id = gInventory.findCategoryUUIDForType(LLAssetType::AT_TRASH); | ||
2376 | if(!gInventory.isObjectDescendentOf(lastitem->getUUID(), trash_id)) | ||
2377 | { | ||
2378 | LLMultiPreview* multi_previewp = LLMultiPreview::getAutoOpenInstance(folder_id); | ||
2379 | if (!multi_previewp && all_one_folder && count > 1) | ||
2380 | { | ||
2381 | S32 left, top; | ||
2382 | gFloaterView->getNewFloaterPosition(&left, &top); | ||
2383 | |||
2384 | multi_previewp = new LLMultiPreview(LLRect(left, top, left + 300, top - 100)); | ||
2385 | LLMultiPreview::setAutoOpenInstance(multi_previewp, folder_id); | ||
2386 | } | ||
2387 | |||
2388 | LLFloater::setFloaterHost(multi_previewp); | ||
2389 | |||
2390 | bool show_keep_discard = lastitem->getPermissions().getCreator() != gAgent.getID(); | ||
2391 | switch(lastitem->getType()) | ||
2392 | { | ||
2393 | case LLAssetType::AT_NOTECARD: | ||
2394 | open_notecard( | ||
2395 | lastitem->getUUID(), | ||
2396 | LLString("Note: ") + lastitem->getName(), | ||
2397 | show_keep_discard, | ||
2398 | LLUUID::null, | ||
2399 | FALSE); | ||
2400 | break; | ||
2401 | case LLAssetType::AT_LANDMARK: | ||
2402 | open_landmark( | ||
2403 | lastitem->getUUID(), | ||
2404 | LLString(" ") + lastitem->getName(), | ||
2405 | show_keep_discard, | ||
2406 | LLUUID::null, | ||
2407 | FALSE); | ||
2408 | break; | ||
2409 | case LLAssetType::AT_TEXTURE: | ||
2410 | open_texture( | ||
2411 | lastitem->getUUID(), | ||
2412 | LLString("Texture: ") + lastitem->getName(), | ||
2413 | show_keep_discard, | ||
2414 | LLUUID::null, | ||
2415 | FALSE); | ||
2416 | break; | ||
2417 | default: | ||
2418 | break; | ||
2419 | } | ||
2420 | |||
2421 | LLFloater::setFloaterHost(NULL); | ||
2422 | if (multi_previewp) | ||
2423 | { | ||
2424 | multi_previewp->open(); | ||
2425 | } | ||
2426 | |||
2427 | LLInventoryView* view = LLInventoryView::getActiveInventory(); | ||
2428 | if(view) | ||
2429 | { | ||
2430 | LLUUID lost_and_found_id = gInventory.findCategoryUUIDForType(LLAssetType::AT_LOST_AND_FOUND); | ||
2431 | BOOL inventory_has_focus = gFocusMgr.childHasKeyboardFocus(view); | ||
2432 | BOOL user_is_away = gAwayTimer.getStarted(); | ||
2433 | |||
2434 | // don't select lost and found items if an active user is working in the inventory | ||
2435 | if (!gInventory.isObjectDescendentOf(lastitem->getUUID(), lost_and_found_id) || | ||
2436 | !inventory_has_focus || | ||
2437 | user_is_away) | ||
2438 | { | ||
2439 | LLUICtrl* focus_ctrl = gFocusMgr.getKeyboardFocus(); | ||
2440 | LLFocusMgr::FocusLostCallback callback = gFocusMgr.getFocusCallback(); | ||
2441 | view->getPanel()->setSelection(lastitem->getUUID(), TAKE_FOCUS_NO); | ||
2442 | // HACK to open inventory offers that are | ||
2443 | // accepted. This information really needs to | ||
2444 | // flow through the instant messages and | ||
2445 | // inventory restore keyboard focus | ||
2446 | gFocusMgr.setKeyboardFocus(focus_ctrl, callback); | ||
2447 | } | ||
2448 | } | ||
2449 | } | ||
2450 | } | ||
2451 | return true; | 2374 | return true; |
2452 | } | 2375 | } |
2453 | 2376 | ||
@@ -3452,6 +3375,43 @@ void LLInventoryExistenceObserver::changed(U32 mask) | |||
3452 | } | 3375 | } |
3453 | } | 3376 | } |
3454 | 3377 | ||
3378 | void LLInventoryAddedObserver::changed(U32 mask) | ||
3379 | { | ||
3380 | if(!(mask & LLInventoryObserver::ADD)) | ||
3381 | { | ||
3382 | return; | ||
3383 | } | ||
3384 | |||
3385 | // *HACK: If this was in response to a packet off | ||
3386 | // the network, figure out which item was updated. | ||
3387 | // Code from Gigs Taggert, sin allowed by JC. | ||
3388 | LLMessageSystem* msg = gMessageSystem; | ||
3389 | const char* msg_name = msg->getMessageName(); | ||
3390 | if (!msg_name) return; | ||
3391 | |||
3392 | // We only want newly created inventory items. JC | ||
3393 | if ( strcmp(msg_name, "UpdateCreateInventoryItem") ) | ||
3394 | { | ||
3395 | return; | ||
3396 | } | ||
3397 | |||
3398 | LLPointer<LLViewerInventoryItem> titem = new LLViewerInventoryItem; | ||
3399 | S32 num_blocks = msg->getNumberOfBlocksFast(_PREHASH_InventoryData); | ||
3400 | for(S32 i = 0; i < num_blocks; ++i) | ||
3401 | { | ||
3402 | titem->unpackMessage(msg, _PREHASH_InventoryData, i); | ||
3403 | if (!(titem->getUUID().isNull())) | ||
3404 | { | ||
3405 | //we don't do anything with null keys | ||
3406 | mAdded.push_back(titem->getUUID()); | ||
3407 | } | ||
3408 | } | ||
3409 | if (!mAdded.empty()) | ||
3410 | { | ||
3411 | done(); | ||
3412 | } | ||
3413 | } | ||
3414 | |||
3455 | LLInventoryTransactionObserver::LLInventoryTransactionObserver( | 3415 | LLInventoryTransactionObserver::LLInventoryTransactionObserver( |
3456 | const LLTransactionID& transaction_id) : | 3416 | const LLTransactionID& transaction_id) : |
3457 | mTransactionID(transaction_id) | 3417 | mTransactionID(transaction_id) |
diff --git a/linden/indra/newview/llinventorymodel.h b/linden/indra/newview/llinventorymodel.h index 9867842..78ab0e3 100644 --- a/linden/indra/newview/llinventorymodel.h +++ b/linden/indra/newview/llinventorymodel.h | |||
@@ -29,10 +29,8 @@ | |||
29 | #ifndef LL_LLINVENTORYMODEL_H | 29 | #ifndef LL_LLINVENTORYMODEL_H |
30 | #define LL_LLINVENTORYMODEL_H | 30 | #define LL_LLINVENTORYMODEL_H |
31 | 31 | ||
32 | #include "llassetstorage.h" | 32 | #include "llassettype.h" |
33 | #include "lldarray.h" | 33 | #include "lldarray.h" |
34 | //#include "llskiplist.h" | ||
35 | //#include "llptrskipmap.h" | ||
36 | #include "lluuid.h" | 34 | #include "lluuid.h" |
37 | #include "llpermissionsflags.h" | 35 | #include "llpermissionsflags.h" |
38 | #include "llstring.h" | 36 | #include "llstring.h" |
@@ -387,7 +385,7 @@ protected: | |||
387 | static void processMoveInventoryItem(LLMessageSystem* msg, void**); | 385 | static void processMoveInventoryItem(LLMessageSystem* msg, void**); |
388 | static void processFetchInventoryReply(LLMessageSystem* msg, void**); | 386 | static void processFetchInventoryReply(LLMessageSystem* msg, void**); |
389 | 387 | ||
390 | bool messageUpdateCore(LLMessageSystem* msg, bool do_accounting, bool highlight_new); | 388 | bool messageUpdateCore(LLMessageSystem* msg, bool do_accounting); |
391 | 389 | ||
392 | protected: | 390 | protected: |
393 | // Varaibles used to track what has changed since the last notify. | 391 | // Varaibles used to track what has changed since the last notify. |
@@ -751,6 +749,29 @@ protected: | |||
751 | }; | 749 | }; |
752 | 750 | ||
753 | //~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ | 751 | //~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ |
752 | // Class LLInventoryAddedObserver | ||
753 | // | ||
754 | // This class is used as a base class for doing something when | ||
755 | // a new item arrives in inventory. | ||
756 | // It does not watch for a certain UUID, rather it acts when anything is added | ||
757 | // Derive a class from this class and implement the done() method to do | ||
758 | // something useful. | ||
759 | //~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ | ||
760 | |||
761 | class LLInventoryAddedObserver : public LLInventoryObserver | ||
762 | { | ||
763 | public: | ||
764 | LLInventoryAddedObserver() : mAdded() {} | ||
765 | virtual void changed(U32 mask); | ||
766 | |||
767 | protected: | ||
768 | virtual void done() = 0; | ||
769 | |||
770 | typedef std::vector<LLUUID> item_ref_t; | ||
771 | item_ref_t mAdded; | ||
772 | }; | ||
773 | |||
774 | //~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ | ||
754 | // Class LLInventoryTransactionObserver | 775 | // Class LLInventoryTransactionObserver |
755 | // | 776 | // |
756 | // Class which can be used as a base class for doing something when an | 777 | // Class which can be used as a base class for doing something when an |
diff --git a/linden/indra/newview/llinventoryview.cpp b/linden/indra/newview/llinventoryview.cpp index 900b145..bb70ea4 100644 --- a/linden/indra/newview/llinventoryview.cpp +++ b/linden/indra/newview/llinventoryview.cpp | |||
@@ -451,11 +451,13 @@ void LLInventoryView::init(LLInventoryModel* inventory) | |||
451 | U32 sort_order = gSavedSettings.getU32("InventorySortOrder"); | 451 | U32 sort_order = gSavedSettings.getU32("InventorySortOrder"); |
452 | BOOL sort_by_name = ! ( sort_order & LLInventoryFilter::SO_DATE ); | 452 | BOOL sort_by_name = ! ( sort_order & LLInventoryFilter::SO_DATE ); |
453 | BOOL sort_folders_by_name = ( sort_order & LLInventoryFilter::SO_FOLDERS_BY_NAME ); | 453 | BOOL sort_folders_by_name = ( sort_order & LLInventoryFilter::SO_FOLDERS_BY_NAME ); |
454 | BOOL sort_system_folders_to_top = ( sort_order & LLInventoryFilter::SO_SYSTEM_FOLDERS_TO_TOP ); | ||
454 | 455 | ||
455 | addBoolControl("Inventory.ShowFilters", FALSE); | 456 | addBoolControl("Inventory.ShowFilters", FALSE); |
456 | addBoolControl("Inventory.SortByName", sort_by_name ); | 457 | addBoolControl("Inventory.SortByName", sort_by_name ); |
457 | addBoolControl("Inventory.SortByDate", ! sort_by_name ); | 458 | addBoolControl("Inventory.SortByDate", ! sort_by_name ); |
458 | addBoolControl("Inventory.FoldersAlwaysByName", sort_folders_by_name ); | 459 | addBoolControl("Inventory.FoldersAlwaysByName", sort_folders_by_name ); |
460 | addBoolControl("Inventory.SystemFoldersToTop", sort_system_folders_to_top ); | ||
459 | 461 | ||
460 | mSavedFolderState = new LLSaveFolderState(); | 462 | mSavedFolderState = new LLSaveFolderState(); |
461 | mSavedFolderState->setApply(FALSE); | 463 | mSavedFolderState->setApply(FALSE); |
@@ -637,20 +639,24 @@ void LLInventoryView::onClose(bool app_quitting) | |||
637 | BOOL LLInventoryView::handleKeyHere(KEY key, MASK mask, BOOL called_from_parent) | 639 | BOOL LLInventoryView::handleKeyHere(KEY key, MASK mask, BOOL called_from_parent) |
638 | { | 640 | { |
639 | LLFolderView* root_folder = mActivePanel ? mActivePanel->getRootFolder() : NULL; | 641 | LLFolderView* root_folder = mActivePanel ? mActivePanel->getRootFolder() : NULL; |
640 | // first check for user accepting current search results | 642 | if (root_folder) |
641 | if (!called_from_parent && root_folder&& | ||
642 | mSearchEditor && mSearchEditor->hasFocus() && | ||
643 | (key == KEY_RETURN || key == KEY_DOWN) && mask == MASK_NONE) | ||
644 | { | ||
645 | // move focus to inventory proper | ||
646 | root_folder->setFocus(TRUE); | ||
647 | root_folder->scrollToShowSelection(); | ||
648 | return TRUE; | ||
649 | } | ||
650 | |||
651 | if (root_folder->hasFocus() && key == KEY_UP) | ||
652 | { | 643 | { |
653 | startSearch(); | 644 | // first check for user accepting current search results |
645 | if (!called_from_parent | ||
646 | && mSearchEditor && mSearchEditor->hasFocus() | ||
647 | && (key == KEY_RETURN || key == KEY_DOWN) | ||
648 | && mask == MASK_NONE) | ||
649 | { | ||
650 | // move focus to inventory proper | ||
651 | root_folder->setFocus(TRUE); | ||
652 | root_folder->scrollToShowSelection(); | ||
653 | return TRUE; | ||
654 | } | ||
655 | |||
656 | if (root_folder->hasFocus() && key == KEY_UP) | ||
657 | { | ||
658 | startSearch(); | ||
659 | } | ||
654 | } | 660 | } |
655 | 661 | ||
656 | return LLFloater::handleKeyHere(key, mask, called_from_parent); | 662 | return LLFloater::handleKeyHere(key, mask, called_from_parent); |
@@ -1364,11 +1370,13 @@ void LLInventoryPanel::buildNewViews(const LLUUID& id) | |||
1364 | S32 count; | 1370 | S32 count; |
1365 | 1371 | ||
1366 | if (objectp) | 1372 | if (objectp) |
1367 | { | 1373 | { |
1368 | if (objectp->getType() == LLAssetType::AT_NONE) | 1374 | if (objectp->getType() <= LLAssetType::AT_NONE || |
1375 | objectp->getType() >= LLAssetType::AT_COUNT) | ||
1369 | { | 1376 | { |
1370 | llwarns << "LLInventoryPanel::buildNewViews called with objectp->mType == AT_NONE (shouldn't happen)" << llendl; | 1377 | llwarns << "LLInventoryPanel::buildNewViews called with objectp->mType == " |
1371 | itemp = NULL; | 1378 | << ((S32) objectp->getType()) |
1379 | << " (shouldn't happen)" << llendl; | ||
1372 | } | 1380 | } |
1373 | else if (objectp->getType() == LLAssetType::AT_CATEGORY) // build new view for category | 1381 | else if (objectp->getType() == LLAssetType::AT_CATEGORY) // build new view for category |
1374 | { | 1382 | { |
@@ -1377,19 +1385,16 @@ void LLInventoryPanel::buildNewViews(const LLUUID& id) | |||
1377 | this, | 1385 | this, |
1378 | objectp->getUUID()); | 1386 | objectp->getUUID()); |
1379 | 1387 | ||
1380 | LLFolderViewFolder* folderp = new LLFolderViewFolder(new_listener->getDisplayName(), | 1388 | if (new_listener) |
1381 | new_listener->getIcon(), | ||
1382 | mFolders, | ||
1383 | new_listener); | ||
1384 | if (!(mFolders->getSortOrder() & LLInventoryFilter::SO_DATE)) | ||
1385 | { | ||
1386 | folderp->setItemSortFunction(sort_item_name); | ||
1387 | } | ||
1388 | else | ||
1389 | { | 1389 | { |
1390 | folderp->setItemSortFunction(sort_item_date); | 1390 | LLFolderViewFolder* folderp = new LLFolderViewFolder(new_listener->getDisplayName(), |
1391 | new_listener->getIcon(), | ||
1392 | mFolders, | ||
1393 | new_listener); | ||
1394 | |||
1395 | folderp->setItemSortOrder(mFolders->getSortOrder()); | ||
1396 | itemp = folderp; | ||
1391 | } | 1397 | } |
1392 | itemp = folderp; | ||
1393 | } | 1398 | } |
1394 | else // build new view for item | 1399 | else // build new view for item |
1395 | { | 1400 | { |
@@ -1400,11 +1405,14 @@ void LLInventoryPanel::buildNewViews(const LLUUID& id) | |||
1400 | this, | 1405 | this, |
1401 | item->getUUID(), | 1406 | item->getUUID(), |
1402 | item->getFlags()); | 1407 | item->getFlags()); |
1403 | itemp = new LLFolderViewItem(new_listener->getDisplayName(), | 1408 | if (new_listener) |
1404 | new_listener->getIcon(), | 1409 | { |
1405 | new_listener->getCreationDate(), | 1410 | itemp = new LLFolderViewItem(new_listener->getDisplayName(), |
1406 | mFolders, | 1411 | new_listener->getIcon(), |
1407 | new_listener); | 1412 | new_listener->getCreationDate(), |
1413 | mFolders, | ||
1414 | new_listener); | ||
1415 | } | ||
1408 | } | 1416 | } |
1409 | 1417 | ||
1410 | LLFolderViewFolder* parent_folder = (LLFolderViewFolder*)mFolders->getItemByID(objectp->getParentUUID()); | 1418 | LLFolderViewFolder* parent_folder = (LLFolderViewFolder*)mFolders->getItemByID(objectp->getParentUUID()); |
diff --git a/linden/indra/newview/llnetmap.cpp b/linden/indra/newview/llnetmap.cpp index 35774cb..2105521 100644 --- a/linden/indra/newview/llnetmap.cpp +++ b/linden/indra/newview/llnetmap.cpp | |||
@@ -103,7 +103,7 @@ LLNetMap::LLNetMap( | |||
103 | LLRect major_dir_rect( 0, DIR_HEIGHT, DIR_WIDTH, 0 ); | 103 | LLRect major_dir_rect( 0, DIR_HEIGHT, DIR_WIDTH, 0 ); |
104 | 104 | ||
105 | mTextBoxNorth = new LLTextBox( "N", major_dir_rect ); | 105 | mTextBoxNorth = new LLTextBox( "N", major_dir_rect ); |
106 | mTextBoxNorth->setDropshadowVisible( TRUE ); | 106 | mTextBoxNorth->setFontStyle(LLFontGL::DROP_SHADOW_SOFT); |
107 | addChild( mTextBoxNorth ); | 107 | addChild( mTextBoxNorth ); |
108 | 108 | ||
109 | LLColor4 minor_color( 1.f, 1.f, 1.f, .7f ); | 109 | LLColor4 minor_color( 1.f, 1.f, 1.f, .7f ); |
diff --git a/linden/indra/newview/llpanelavatar.cpp b/linden/indra/newview/llpanelavatar.cpp index fd25775..9c73dad 100644 --- a/linden/indra/newview/llpanelavatar.cpp +++ b/linden/indra/newview/llpanelavatar.cpp | |||
@@ -1522,40 +1522,43 @@ void LLPanelAvatar::resetGroupList() | |||
1522 | { | 1522 | { |
1523 | return; | 1523 | return; |
1524 | } | 1524 | } |
1525 | LLScrollListCtrl* group_list = LLUICtrlFactory::getScrollListByName(mPanelSecondLife,"groups"); | ||
1526 | 1525 | ||
1527 | if (mPanelSecondLife && group_list) | 1526 | if (mPanelSecondLife) |
1528 | { | 1527 | { |
1529 | group_list->deleteAllItems(); | 1528 | LLScrollListCtrl* group_list = LLUICtrlFactory::getScrollListByName(mPanelSecondLife,"groups"); |
1530 | 1529 | if (group_list) | |
1531 | S32 count = gAgent.mGroups.count(); | ||
1532 | LLUUID id; | ||
1533 | |||
1534 | for(S32 i = 0; i < count; ++i) | ||
1535 | { | 1530 | { |
1536 | LLGroupData group_data = gAgent.mGroups.get(i); | 1531 | group_list->deleteAllItems(); |
1537 | id = group_data.mID; | 1532 | |
1538 | std::string group_string; | 1533 | S32 count = gAgent.mGroups.count(); |
1539 | /* Show group title? DUMMY_POWER for Don Grep | 1534 | LLUUID id; |
1540 | if(group_data.mOfficer) | 1535 | |
1541 | { | 1536 | for(S32 i = 0; i < count; ++i) |
1542 | group_string = "Officer of "; | ||
1543 | } | ||
1544 | else | ||
1545 | { | 1537 | { |
1546 | group_string = "Member of "; | 1538 | LLGroupData group_data = gAgent.mGroups.get(i); |
1547 | } | 1539 | id = group_data.mID; |
1548 | */ | 1540 | std::string group_string; |
1541 | /* Show group title? DUMMY_POWER for Don Grep | ||
1542 | if(group_data.mOfficer) | ||
1543 | { | ||
1544 | group_string = "Officer of "; | ||
1545 | } | ||
1546 | else | ||
1547 | { | ||
1548 | group_string = "Member of "; | ||
1549 | } | ||
1550 | */ | ||
1551 | |||
1552 | group_string += group_data.mName; | ||
1549 | 1553 | ||
1550 | group_string += group_data.mName; | 1554 | LLSD row; |
1551 | 1555 | row["columns"][0]["value"] = group_string; | |
1552 | LLSD row; | 1556 | row["columns"][0]["font"] = "SANSSERIF_SMALL"; |
1553 | row["columns"][0]["value"] = group_string; | 1557 | row["columns"][0]["width"] = 0; |
1554 | row["columns"][0]["font"] = "SANSSERIF_SMALL"; | 1558 | group_list->addElement(row); |
1555 | row["columns"][0]["width"] = 0; | 1559 | } |
1556 | group_list->addElement(row); | 1560 | group_list->sortByColumn(0, TRUE); |
1557 | } | 1561 | } |
1558 | group_list->sortByColumn(0, TRUE); | ||
1559 | } | 1562 | } |
1560 | } | 1563 | } |
1561 | 1564 | ||
diff --git a/linden/indra/newview/llpanelcontents.cpp b/linden/indra/newview/llpanelcontents.cpp index 2265ed5..4d138d4 100644 --- a/linden/indra/newview/llpanelcontents.cpp +++ b/linden/indra/newview/llpanelcontents.cpp | |||
@@ -1,4 +1,4 @@ | |||
1 | /** | 1 | /** |
2 | * @file llpanelcontents.cpp | 2 | * @file llpanelcontents.cpp |
3 | * @brief Object contents panel in the tools floater. | 3 | * @brief Object contents panel in the tools floater. |
4 | * | 4 | * |
@@ -101,21 +101,25 @@ LLPanelContents::~LLPanelContents() | |||
101 | void LLPanelContents::getState(LLViewerObject *objectp ) | 101 | void LLPanelContents::getState(LLViewerObject *objectp ) |
102 | { | 102 | { |
103 | if( !objectp ) | 103 | if( !objectp ) |
104 | { | 104 | { |
105 | childSetEnabled("button new script",FALSE); | 105 | childSetEnabled("button new script",FALSE); |
106 | //mBtnNewScript->setEnabled( FALSE ); | 106 | //mBtnNewScript->setEnabled( FALSE ); |
107 | return; | 107 | return; |
108 | } | 108 | } |
109 | 109 | ||
110 | LLUUID group_id; // used for SL-23488 | ||
111 | gSelectMgr->selectGetGroup(group_id); // sets group_id as a side effect SL-23488 | ||
112 | |||
110 | // BUG? Check for all objects being editable? | 113 | // BUG? Check for all objects being editable? |
111 | BOOL editable = gAgent.isGodlike() | 114 | BOOL editable = gAgent.isGodlike() |
112 | || (objectp->permModify() && objectp->permYouOwner()); | 115 | || (objectp->permModify() |
116 | && ( objectp->permYouOwner() || ( !group_id.isNull() && gAgent.isInGroup(group_id) ))); // solves SL-23488 | ||
113 | BOOL all_volume = gSelectMgr->selectionAllPCode( LL_PCODE_VOLUME ); | 117 | BOOL all_volume = gSelectMgr->selectionAllPCode( LL_PCODE_VOLUME ); |
114 | 118 | ||
115 | // Edit script button - ok if object is editable and there's an | 119 | // Edit script button - ok if object is editable and there's an |
116 | // unambiguous destination for the object. | 120 | // unambiguous destination for the object. |
117 | if( editable && | 121 | if( editable && |
118 | all_volume && | 122 | all_volume && |
119 | ((gSelectMgr->getSelection()->getRootObjectCount() == 1) | 123 | ((gSelectMgr->getSelection()->getRootObjectCount() == 1) |
120 | || (gSelectMgr->getSelection()->getObjectCount() == 1))) | 124 | || (gSelectMgr->getSelection()->getObjectCount() == 1))) |
121 | { | 125 | { |
diff --git a/linden/indra/newview/llpaneldisplay.cpp b/linden/indra/newview/llpaneldisplay.cpp index d22d1c2..d79dcb4 100644 --- a/linden/indra/newview/llpaneldisplay.cpp +++ b/linden/indra/newview/llpaneldisplay.cpp | |||
@@ -448,7 +448,6 @@ LLPanelDisplay2::LLPanelDisplay2() | |||
448 | 448 | ||
449 | BOOL LLPanelDisplay2::postBuild() | 449 | BOOL LLPanelDisplay2::postBuild() |
450 | { | 450 | { |
451 | |||
452 | requires("ani", WIDGET_TYPE_CHECKBOX); | 451 | requires("ani", WIDGET_TYPE_CHECKBOX); |
453 | requires("gamma", WIDGET_TYPE_SPINNER); | 452 | requires("gamma", WIDGET_TYPE_SPINNER); |
454 | requires("vbo", WIDGET_TYPE_CHECKBOX); | 453 | requires("vbo", WIDGET_TYPE_CHECKBOX); |
@@ -466,6 +465,14 @@ BOOL LLPanelDisplay2::postBuild() | |||
466 | // Graphics Card Memory | 465 | // Graphics Card Memory |
467 | mRadioVideoCardMem = LLUICtrlFactory::getRadioGroupByName(this, "video card memory radio"); | 466 | mRadioVideoCardMem = LLUICtrlFactory::getRadioGroupByName(this, "video card memory radio"); |
468 | 467 | ||
468 | #if !LL_WINDOWS | ||
469 | // The probe_hardware_checkbox setting is only used in the Windows build | ||
470 | // (It apparently controls a time-consuming DX9 hardware probe.) | ||
471 | // Disable the checkbox everywhere else | ||
472 | gSavedSettings.setBOOL("ProbeHardwareOnStartup", FALSE ); | ||
473 | childSetEnabled("probe_hardware_checkbox", false); | ||
474 | #endif // !LL_WINDOWS | ||
475 | |||
469 | refresh(); | 476 | refresh(); |
470 | 477 | ||
471 | return TRUE; | 478 | return TRUE; |
@@ -490,7 +497,8 @@ void LLPanelDisplay2::refresh() | |||
490 | mParticleCount = gSavedSettings.getS32("RenderMaxPartCount"); | 497 | mParticleCount = gSavedSettings.getS32("RenderMaxPartCount"); |
491 | mCompositeLimit = gSavedSettings.getS32("AvatarCompositeLimit"); | 498 | mCompositeLimit = gSavedSettings.getS32("AvatarCompositeLimit"); |
492 | mDebugBeaconLineWidth = gSavedSettings.getS32("DebugBeaconLineWidth"); | 499 | mDebugBeaconLineWidth = gSavedSettings.getS32("DebugBeaconLineWidth"); |
493 | 500 | mProbeHardwareOnStartup = gSavedSettings.getBOOL("ProbeHardwareOnStartup"); | |
501 | |||
494 | refreshEnabledState(); | 502 | refreshEnabledState(); |
495 | } | 503 | } |
496 | 504 | ||
@@ -521,7 +529,6 @@ void LLPanelDisplay2::apply() | |||
521 | gViewerWindow->restartDisplay(logged_in); | 529 | gViewerWindow->restartDisplay(logged_in); |
522 | } | 530 | } |
523 | 531 | ||
524 | |||
525 | refresh(); | 532 | refresh(); |
526 | } | 533 | } |
527 | 534 | ||
@@ -537,6 +544,7 @@ void LLPanelDisplay2::cancel() | |||
537 | gSavedSettings.setS32("RenderMaxPartCount", mParticleCount); | 544 | gSavedSettings.setS32("RenderMaxPartCount", mParticleCount); |
538 | gSavedSettings.setS32("AvatarCompositeLimit", mCompositeLimit); | 545 | gSavedSettings.setS32("AvatarCompositeLimit", mCompositeLimit); |
539 | gSavedSettings.setS32("DebugBeaconLineWidth", mDebugBeaconLineWidth); | 546 | gSavedSettings.setS32("DebugBeaconLineWidth", mDebugBeaconLineWidth); |
547 | gSavedSettings.setBOOL("ProbeHardwareOnStartup", mProbeHardwareOnStartup ); | ||
540 | } | 548 | } |
541 | 549 | ||
542 | //============================================================================ | 550 | //============================================================================ |
diff --git a/linden/indra/newview/llpaneldisplay.h b/linden/indra/newview/llpaneldisplay.h index b4db723..80aae66 100644 --- a/linden/indra/newview/llpaneldisplay.h +++ b/linden/indra/newview/llpaneldisplay.h | |||
@@ -102,7 +102,7 @@ protected: | |||
102 | S32 mParticleCount; | 102 | S32 mParticleCount; |
103 | S32 mCompositeLimit; | 103 | S32 mCompositeLimit; |
104 | S32 mDebugBeaconLineWidth; | 104 | S32 mDebugBeaconLineWidth; |
105 | 105 | BOOL mProbeHardwareOnStartup; | |
106 | }; | 106 | }; |
107 | 107 | ||
108 | class LLPanelDisplay3 : public LLPanel | 108 | class LLPanelDisplay3 : public LLPanel |
@@ -147,7 +147,6 @@ protected: | |||
147 | F32 mFlexLOD; | 147 | F32 mFlexLOD; |
148 | F32 mTreeLOD; | 148 | F32 mTreeLOD; |
149 | F32 mAvatarLOD; | 149 | F32 mAvatarLOD; |
150 | |||
151 | }; | 150 | }; |
152 | 151 | ||
153 | const S32 LL_MAX_VRAM_INDEX = 6; | 152 | const S32 LL_MAX_VRAM_INDEX = 6; |
diff --git a/linden/indra/newview/llpanelface.cpp b/linden/indra/newview/llpanelface.cpp index 8f24c55..9cbfdc2 100644 --- a/linden/indra/newview/llpanelface.cpp +++ b/linden/indra/newview/llpanelface.cpp | |||
@@ -505,7 +505,16 @@ void LLPanelFace::getState() | |||
505 | { | 505 | { |
506 | F32 shinyf = 0.f; | 506 | F32 shinyf = 0.f; |
507 | identical = allFacesSameValue( &LLPanelFace::valueShiny, &shinyf ); | 507 | identical = allFacesSameValue( &LLPanelFace::valueShiny, &shinyf ); |
508 | childGetSelectionInterface("combobox shininess")->selectNthItem((S32)shinyf); | 508 | LLCtrlSelectionInterface* combobox_shininess = |
509 | childGetSelectionInterface("combobox shininess"); | ||
510 | if (combobox_shininess) | ||
511 | { | ||
512 | combobox_shininess->selectNthItem((S32)shinyf); | ||
513 | } | ||
514 | else | ||
515 | { | ||
516 | llwarns << "failed childGetSelectionInterface for 'combobox shininess'" << llendl; | ||
517 | } | ||
509 | childSetEnabled("combobox shininess",editable); | 518 | childSetEnabled("combobox shininess",editable); |
510 | childSetTentative("combobox shininess",!identical); | 519 | childSetTentative("combobox shininess",!identical); |
511 | childSetEnabled("label shininess",editable); | 520 | childSetEnabled("label shininess",editable); |
@@ -514,7 +523,16 @@ void LLPanelFace::getState() | |||
514 | { | 523 | { |
515 | F32 bumpf = 0.f; | 524 | F32 bumpf = 0.f; |
516 | identical = allFacesSameValue( &LLPanelFace::valueBump, &bumpf ); | 525 | identical = allFacesSameValue( &LLPanelFace::valueBump, &bumpf ); |
517 | childGetSelectionInterface("combobox bumpiness")->selectNthItem((S32)bumpf); | 526 | LLCtrlSelectionInterface* combobox_bumpiness = |
527 | childGetSelectionInterface("combobox bumpiness"); | ||
528 | if (combobox_bumpiness) | ||
529 | { | ||
530 | combobox_bumpiness->selectNthItem((S32)bumpf); | ||
531 | } | ||
532 | else | ||
533 | { | ||
534 | llwarns << "failed childGetSelectionInterface for 'combobox bumpiness'" << llendl; | ||
535 | } | ||
518 | childSetEnabled("combobox bumpiness",editable); | 536 | childSetEnabled("combobox bumpiness",editable); |
519 | childSetTentative("combobox bumpiness",!identical); | 537 | childSetTentative("combobox bumpiness",!identical); |
520 | childSetEnabled("label bumpiness",editable); | 538 | childSetEnabled("label bumpiness",editable); |
@@ -523,8 +541,17 @@ void LLPanelFace::getState() | |||
523 | { | 541 | { |
524 | F32 genf = 0.f; | 542 | F32 genf = 0.f; |
525 | identical = allFacesSameValue( &LLPanelFace::valueTexGen, &genf); | 543 | identical = allFacesSameValue( &LLPanelFace::valueTexGen, &genf); |
526 | S32 selected_texgen = ((S32) genf) >> TEM_TEX_GEN_SHIFT; | 544 | S32 selected_texgen = ((S32) genf) >> TEM_TEX_GEN_SHIFT; |
527 | childGetSelectionInterface("combobox texgen")->selectNthItem(selected_texgen); | 545 | LLCtrlSelectionInterface* combobox_texgen = |
546 | childGetSelectionInterface("combobox texgen"); | ||
547 | if (combobox_texgen) | ||
548 | { | ||
549 | combobox_texgen->selectNthItem(selected_texgen); | ||
550 | } | ||
551 | else | ||
552 | { | ||
553 | llwarns << "failed childGetSelectionInterface for 'combobox texgen'" << llendl; | ||
554 | } | ||
528 | childSetEnabled("combobox texgen",editable); | 555 | childSetEnabled("combobox texgen",editable); |
529 | childSetTentative("combobox texgen",!identical); | 556 | childSetTentative("combobox texgen",!identical); |
530 | childSetEnabled("tex gen",editable); | 557 | childSetEnabled("tex gen",editable); |
diff --git a/linden/indra/newview/llpanelgeneral.cpp b/linden/indra/newview/llpanelgeneral.cpp index 900598a..d60471d 100644 --- a/linden/indra/newview/llpanelgeneral.cpp +++ b/linden/indra/newview/llpanelgeneral.cpp | |||
@@ -105,7 +105,6 @@ BOOL LLPanelGeneral::postBuild() | |||
105 | requires("rotate_mini_map_checkbox", WIDGET_TYPE_CHECKBOX); | 105 | requires("rotate_mini_map_checkbox", WIDGET_TYPE_CHECKBOX); |
106 | requires("friends_online_notify_checkbox", WIDGET_TYPE_CHECKBOX); | 106 | requires("friends_online_notify_checkbox", WIDGET_TYPE_CHECKBOX); |
107 | requires("notify_money_change_checkbox", WIDGET_TYPE_CHECKBOX); | 107 | requires("notify_money_change_checkbox", WIDGET_TYPE_CHECKBOX); |
108 | requires("probe_hardware_checkbox", WIDGET_TYPE_CHECKBOX); | ||
109 | requires("use_system_color_picker_checkbox", WIDGET_TYPE_CHECKBOX); | 108 | requires("use_system_color_picker_checkbox", WIDGET_TYPE_CHECKBOX); |
110 | requires("crash_behavior_combobox", WIDGET_TYPE_COMBO_BOX); | 109 | requires("crash_behavior_combobox", WIDGET_TYPE_COMBO_BOX); |
111 | 110 | ||
@@ -152,14 +151,6 @@ BOOL LLPanelGeneral::postBuild() | |||
152 | 151 | ||
153 | childSetCommitCallback("language_combobox", set_language ); | 152 | childSetCommitCallback("language_combobox", set_language ); |
154 | childSetValue("language_combobox", gSavedSettings.getString("Language")); | 153 | childSetValue("language_combobox", gSavedSettings.getString("Language")); |
155 | |||
156 | #if !LL_WINDOWS | ||
157 | // The probe_hardware_checkbox setting is only used in the Windows build | ||
158 | // (It apparently controls a time-consuming DX9 hardware probe.) | ||
159 | // Disable the checkbox everywhere else | ||
160 | gSavedSettings.setBOOL("ProbeHardwareOnStartup", FALSE ); | ||
161 | childSetEnabled("probe_hardware_checkbox", false); | ||
162 | #endif // !LL_WINDOWS | ||
163 | 154 | ||
164 | refresh(); | 155 | refresh(); |
165 | 156 | ||
@@ -205,7 +196,7 @@ void LLPanelGeneral::refresh() | |||
205 | mAFKTimeout = gSavedSettings.getF32("AFKTimeout"); | 196 | mAFKTimeout = gSavedSettings.getF32("AFKTimeout"); |
206 | mMiniMapRotate = gSavedSettings.getBOOL("MiniMapRotate"); | 197 | mMiniMapRotate = gSavedSettings.getBOOL("MiniMapRotate"); |
207 | mNotifyMoney = gSavedSettings.getBOOL("NotifyMoneyChange"); | 198 | mNotifyMoney = gSavedSettings.getBOOL("NotifyMoneyChange"); |
208 | mProbeHardwareOnStartup = gSavedSettings.getBOOL("ProbeHardwareOnStartup"); | 199 | mShowNewInventory = gSavedSettings.getBOOL("ShowNewInventory"); |
209 | mUseDefaultColor = gSavedSettings.getBOOL("UseDefaultColorPicker"); | 200 | mUseDefaultColor = gSavedSettings.getBOOL("UseDefaultColorPicker"); |
210 | mEffectColor = gSavedSettings.getColor4("EffectColor"); | 201 | mEffectColor = gSavedSettings.getColor4("EffectColor"); |
211 | 202 | ||
@@ -226,7 +217,7 @@ void LLPanelGeneral::cancel() | |||
226 | gSavedSettings.setF32("AFKTimeout", mAFKTimeout ); | 217 | gSavedSettings.setF32("AFKTimeout", mAFKTimeout ); |
227 | gSavedSettings.setBOOL("MiniMapRotate", mMiniMapRotate ); | 218 | gSavedSettings.setBOOL("MiniMapRotate", mMiniMapRotate ); |
228 | gSavedSettings.setBOOL("NotifyMoneyChange", mNotifyMoney ); | 219 | gSavedSettings.setBOOL("NotifyMoneyChange", mNotifyMoney ); |
229 | gSavedSettings.setBOOL("ProbeHardwareOnStartup", mProbeHardwareOnStartup ); | 220 | gSavedSettings.setBOOL("ShowNewInventory", mShowNewInventory); |
230 | gSavedSettings.setBOOL("UseDefaultColorPicker", mUseDefaultColor ); | 221 | gSavedSettings.setBOOL("UseDefaultColorPicker", mUseDefaultColor ); |
231 | gSavedSettings.setColor4("EffectColor", mEffectColor ); | 222 | gSavedSettings.setColor4("EffectColor", mEffectColor ); |
232 | gSavedSettings.setString("Language", mLanguage); | 223 | gSavedSettings.setString("Language", mLanguage); |
diff --git a/linden/indra/newview/llpanelgeneral.h b/linden/indra/newview/llpanelgeneral.h index 9f70560..fe4ff4e 100644 --- a/linden/indra/newview/llpanelgeneral.h +++ b/linden/indra/newview/llpanelgeneral.h | |||
@@ -61,7 +61,7 @@ protected: | |||
61 | BOOL mChatOnlineNotification; | 61 | BOOL mChatOnlineNotification; |
62 | F32 mAFKTimeout; | 62 | F32 mAFKTimeout; |
63 | BOOL mNotifyMoney; | 63 | BOOL mNotifyMoney; |
64 | BOOL mProbeHardwareOnStartup; | 64 | BOOL mShowNewInventory; |
65 | BOOL mUseDefaultColor; | 65 | BOOL mUseDefaultColor; |
66 | LLColor4 mEffectColor; | 66 | LLColor4 mEffectColor; |
67 | BOOL mMiniMapRotate; | 67 | BOOL mMiniMapRotate; |
diff --git a/linden/indra/newview/llpanelgroup.cpp b/linden/indra/newview/llpanelgroup.cpp index 6710c43..47dacf3 100644 --- a/linden/indra/newview/llpanelgroup.cpp +++ b/linden/indra/newview/llpanelgroup.cpp | |||
@@ -660,7 +660,7 @@ void LLPanelGroup::showNotice(const char* subject, | |||
660 | // We need to clean up that inventory offer. | 660 | // We need to clean up that inventory offer. |
661 | if (inventory_offer) | 661 | if (inventory_offer) |
662 | { | 662 | { |
663 | inventory_offer_callback( 1 , inventory_offer); | 663 | inventory_offer_callback( IOR_DECLINE , inventory_offer); |
664 | } | 664 | } |
665 | return; | 665 | return; |
666 | } | 666 | } |
diff --git a/linden/indra/newview/llpanelgroupgeneral.cpp b/linden/indra/newview/llpanelgroupgeneral.cpp index 67a0c31..5ec9651 100644 --- a/linden/indra/newview/llpanelgroupgeneral.cpp +++ b/linden/indra/newview/llpanelgroupgeneral.cpp | |||
@@ -45,10 +45,10 @@ | |||
45 | #include "llnamebox.h" | 45 | #include "llnamebox.h" |
46 | #include "llnamelistctrl.h" | 46 | #include "llnamelistctrl.h" |
47 | #include "llspinctrl.h" | 47 | #include "llspinctrl.h" |
48 | #include "llstatusbar.h" // can_afford_transaction() | ||
48 | #include "lltextbox.h" | 49 | #include "lltextbox.h" |
49 | #include "lltexteditor.h" | 50 | #include "lltexteditor.h" |
50 | #include "lltexturectrl.h" | 51 | #include "lltexturectrl.h" |
51 | #include "llviewermessage.h" | ||
52 | #include "llviewerwindow.h" | 52 | #include "llviewerwindow.h" |
53 | 53 | ||
54 | // static | 54 | // static |
@@ -322,19 +322,27 @@ void LLPanelGroupGeneral::onClickJoin(void *userdata) | |||
322 | 322 | ||
323 | LLGroupMgrGroupData* gdatap = gGroupMgr->getGroupData(self->mGroupID); | 323 | LLGroupMgrGroupData* gdatap = gGroupMgr->getGroupData(self->mGroupID); |
324 | 324 | ||
325 | S32 cost = gdatap->mMembershipFee; | 325 | if (gdatap) |
326 | LLString::format_map_t args; | ||
327 | args["[COST]"] = llformat("%d", cost); | ||
328 | |||
329 | if (can_afford_transaction(cost)) | ||
330 | { | 326 | { |
331 | gViewerWindow->alertXml("JoinGroupCanAfford", args, | 327 | S32 cost = gdatap->mMembershipFee; |
332 | LLPanelGroupGeneral::joinDlgCB, | 328 | LLString::format_map_t args; |
333 | self); | 329 | args["[COST]"] = llformat("%d", cost); |
330 | |||
331 | if (can_afford_transaction(cost)) | ||
332 | { | ||
333 | gViewerWindow->alertXml("JoinGroupCanAfford", args, | ||
334 | LLPanelGroupGeneral::joinDlgCB, | ||
335 | self); | ||
336 | } | ||
337 | else | ||
338 | { | ||
339 | gViewerWindow->alertXml("JoinGroupCannotAfford", args); | ||
340 | } | ||
334 | } | 341 | } |
335 | else | 342 | else |
336 | { | 343 | { |
337 | gViewerWindow->alertXml("JoinGroupCannotAfford", args); | 344 | llwarns << "gGroupMgr->getGroupData(" << self->mGroupID |
345 | << ") was NULL" << llendl; | ||
338 | } | 346 | } |
339 | } | 347 | } |
340 | 348 | ||
diff --git a/linden/indra/newview/llpanelgroupnotices.cpp b/linden/indra/newview/llpanelgroupnotices.cpp index 373f3f2..a001455 100644 --- a/linden/indra/newview/llpanelgroupnotices.cpp +++ b/linden/indra/newview/llpanelgroupnotices.cpp | |||
@@ -204,7 +204,7 @@ LLPanelGroupNotices::~LLPanelGroupNotices() | |||
204 | if (mInventoryOffer) | 204 | if (mInventoryOffer) |
205 | { | 205 | { |
206 | // Cancel the inventory offer. | 206 | // Cancel the inventory offer. |
207 | inventory_offer_callback( 1 , mInventoryOffer); | 207 | inventory_offer_callback( IOR_DECLINE , mInventoryOffer); |
208 | mInventoryOffer = NULL; | 208 | mInventoryOffer = NULL; |
209 | } | 209 | } |
210 | } | 210 | } |
@@ -359,7 +359,7 @@ void LLPanelGroupNotices::onClickOpenAttachment(void* data) | |||
359 | { | 359 | { |
360 | LLPanelGroupNotices* self = (LLPanelGroupNotices*)data; | 360 | LLPanelGroupNotices* self = (LLPanelGroupNotices*)data; |
361 | 361 | ||
362 | inventory_offer_callback( 0 , self->mInventoryOffer); | 362 | inventory_offer_callback( IOR_ACCEPT , self->mInventoryOffer); |
363 | self->mInventoryOffer = NULL; | 363 | self->mInventoryOffer = NULL; |
364 | self->mBtnOpenAttachment->setEnabled(FALSE); | 364 | self->mBtnOpenAttachment->setEnabled(FALSE); |
365 | } | 365 | } |
@@ -398,7 +398,7 @@ void LLPanelGroupNotices::onClickNewMessage(void* data) | |||
398 | 398 | ||
399 | if (self->mInventoryOffer) | 399 | if (self->mInventoryOffer) |
400 | { | 400 | { |
401 | inventory_offer_callback( 1 , self->mInventoryOffer); | 401 | inventory_offer_callback( IOR_DECLINE , self->mInventoryOffer); |
402 | self->mInventoryOffer = NULL; | 402 | self->mInventoryOffer = NULL; |
403 | } | 403 | } |
404 | 404 | ||
@@ -548,7 +548,7 @@ void LLPanelGroupNotices::showNotice(const char* subject, | |||
548 | if (mInventoryOffer) | 548 | if (mInventoryOffer) |
549 | { | 549 | { |
550 | // Cancel the inventory offer for the previously viewed notice | 550 | // Cancel the inventory offer for the previously viewed notice |
551 | inventory_offer_callback( 1 , mInventoryOffer); | 551 | inventory_offer_callback( IOR_DECLINE , mInventoryOffer); |
552 | mInventoryOffer = NULL; | 552 | mInventoryOffer = NULL; |
553 | } | 553 | } |
554 | 554 | ||
diff --git a/linden/indra/newview/llpanelgrouproles.cpp b/linden/indra/newview/llpanelgrouproles.cpp index 266ff12..5765a12 100644 --- a/linden/indra/newview/llpanelgrouproles.cpp +++ b/linden/indra/newview/llpanelgrouproles.cpp | |||
@@ -1323,13 +1323,17 @@ void LLPanelGroupMembersSubTab::onRoleCheck(LLUICtrl* ctrl, void* user_data) | |||
1323 | LLCheckBoxCtrl* check_box = static_cast<LLCheckBoxCtrl*>(ctrl); | 1323 | LLCheckBoxCtrl* check_box = static_cast<LLCheckBoxCtrl*>(ctrl); |
1324 | if (!check_box || !self) return; | 1324 | if (!check_box || !self) return; |
1325 | 1325 | ||
1326 | 1326 | LLScrollListItem* first_selected = | |
1327 | LLUUID role_id = self->mAssignedRolesList->getFirstSelected()->getUUID(); | 1327 | self->mAssignedRolesList->getFirstSelected(); |
1328 | LLRoleMemberChangeType change_type = (check_box->get() ? | 1328 | if (first_selected) |
1329 | RMC_ADD : | 1329 | { |
1330 | RMC_REMOVE); | 1330 | LLUUID role_id = first_selected->getUUID(); |
1331 | 1331 | LLRoleMemberChangeType change_type = (check_box->get() ? | |
1332 | self->handleRoleCheck(role_id, change_type); | 1332 | RMC_ADD : |
1333 | RMC_REMOVE); | ||
1334 | |||
1335 | self->handleRoleCheck(role_id, change_type); | ||
1336 | } | ||
1333 | } | 1337 | } |
1334 | 1338 | ||
1335 | void LLPanelGroupMembersSubTab::handleMemberDoubleClick() | 1339 | void LLPanelGroupMembersSubTab::handleMemberDoubleClick() |
@@ -2056,8 +2060,9 @@ void LLPanelGroupRolesSubTab::update(LLGroupChange gc) | |||
2056 | } | 2060 | } |
2057 | 2061 | ||
2058 | if ((GC_ROLE_MEMBER_DATA == gc || GC_MEMBER_DATA == gc) | 2062 | if ((GC_ROLE_MEMBER_DATA == gc || GC_MEMBER_DATA == gc) |
2059 | && gdatap->isMemberDataComplete() | 2063 | && gdatap |
2060 | && gdatap->isRoleMemberDataComplete()) | 2064 | && gdatap->isMemberDataComplete() |
2065 | && gdatap->isRoleMemberDataComplete()) | ||
2061 | { | 2066 | { |
2062 | buildMembersList(); | 2067 | buildMembersList(); |
2063 | } | 2068 | } |
diff --git a/linden/indra/newview/llpanelinventory.cpp b/linden/indra/newview/llpanelinventory.cpp index 2089a6c..13cee05 100644 --- a/linden/indra/newview/llpanelinventory.cpp +++ b/linden/indra/newview/llpanelinventory.cpp | |||
@@ -1,4 +1,4 @@ | |||
1 | /** | 1 | /** |
2 | * @file llpanelinventory.cpp | 2 | * @file llpanelinventory.cpp |
3 | * @brief LLPanelInventory class implementation | 3 | * @brief LLPanelInventory class implementation |
4 | * | 4 | * |
@@ -72,7 +72,7 @@ | |||
72 | #include "llviewerregion.h" | 72 | #include "llviewerregion.h" |
73 | #include "llviewerimagelist.h" | 73 | #include "llviewerimagelist.h" |
74 | #include "llviewerinventory.h" | 74 | #include "llviewerinventory.h" |
75 | #include "llviewermessage.h" | 75 | #include "llviewermessage.h" |
76 | #include "llviewerobject.h" | 76 | #include "llviewerobject.h" |
77 | #include "llviewerobjectlist.h" | 77 | #include "llviewerobjectlist.h" |
78 | #include "llviewerwindow.h" | 78 | #include "llviewerwindow.h" |
@@ -197,7 +197,7 @@ struct LLBuyInvItemData | |||
197 | LLUUID mTaskID; | 197 | LLUUID mTaskID; |
198 | LLUUID mItemID; | 198 | LLUUID mItemID; |
199 | LLAssetType::EType mType; | 199 | LLAssetType::EType mType; |
200 | 200 | ||
201 | LLBuyInvItemData(const LLUUID& task, | 201 | LLBuyInvItemData(const LLUUID& task, |
202 | const LLUUID& item, | 202 | const LLUUID& item, |
203 | LLAssetType::EType type) : | 203 | LLAssetType::EType type) : |
@@ -217,34 +217,45 @@ void LLTaskInvFVBridge::buyItem() | |||
217 | const LLSaleInfo& sale_info = item->getSaleInfo(); | 217 | const LLSaleInfo& sale_info = item->getSaleInfo(); |
218 | const LLPermissions& perm = item->getPermissions(); | 218 | const LLPermissions& perm = item->getPermissions(); |
219 | const LLString owner_name; // no owner name currently... FIXME? | 219 | const LLString owner_name; // no owner name currently... FIXME? |
220 | |||
221 | LLString::format_map_t args; | ||
222 | args["[PRICE]"] = llformat("%d",sale_info.getSalePrice()); | ||
223 | args["[OWNER]"] = owner_name; | ||
224 | if (sale_info.getSaleType() != LLSaleInfo::FS_CONTENTS) | ||
225 | { | ||
226 | U32 next_owner_mask = perm.getMaskNextOwner(); | ||
227 | args["[MODIFYPERM]"] = LLAlertDialog::getTemplateMessage((next_owner_mask & PERM_MODIFY) ? "PermYes" : "PermNo"); | ||
228 | args["[COPYPERM]"] = LLAlertDialog::getTemplateMessage((next_owner_mask & PERM_COPY) ? "PermYes" : "PermNo"); | ||
229 | args["[RESELLPERM]"] = LLAlertDialog::getTemplateMessage((next_owner_mask & PERM_TRANSFER) ? "PermYes" : "PermNo"); | ||
230 | } | ||
231 | 220 | ||
232 | LLString alertdesc; | 221 | LLViewerObject* obj; |
233 | switch(sale_info.getSaleType()) | 222 | if( ( obj = gObjectList.findObject( mPanel->getTaskUUID() ) ) && obj->isAttachment() ) |
234 | { | 223 | { |
235 | case LLSaleInfo::FS_ORIGINAL: | 224 | gViewerWindow->alertXml("Cannot_Purchase_an_Attachment"); |
236 | alertdesc = owner_name.empty() ? "BuyOriginalNoOwner" : "BuyOriginal"; | 225 | llinfos << "Attempt to purchase an attachment" << llendl; |
237 | break; | ||
238 | case LLSaleInfo::FS_COPY: | ||
239 | default: | ||
240 | alertdesc = owner_name.empty() ? "BuyCopyNoOwner" : "BuyCopy"; | ||
241 | break; | ||
242 | case LLSaleInfo::FS_CONTENTS: | ||
243 | alertdesc = owner_name.empty() ? "BuyContentsNoOwner" : "BuyContents"; | ||
244 | break; | ||
245 | } | 226 | } |
246 | 227 | else | |
247 | gViewerWindow->alertXml(alertdesc, args, LLTaskInvFVBridge::commitBuyItem, (void*)inv); | 228 | { |
229 | |||
230 | |||
231 | LLString::format_map_t args; | ||
232 | args["[PRICE]"] = llformat("%d",sale_info.getSalePrice()); | ||
233 | args["[OWNER]"] = owner_name; | ||
234 | if (sale_info.getSaleType() != LLSaleInfo::FS_CONTENTS) | ||
235 | { | ||
236 | U32 next_owner_mask = perm.getMaskNextOwner(); | ||
237 | args["[MODIFYPERM]"] = LLAlertDialog::getTemplateMessage((next_owner_mask & PERM_MODIFY) ? "PermYes" : "PermNo"); | ||
238 | args["[COPYPERM]"] = LLAlertDialog::getTemplateMessage((next_owner_mask & PERM_COPY) ? "PermYes" : "PermNo"); | ||
239 | args["[RESELLPERM]"] = LLAlertDialog::getTemplateMessage((next_owner_mask & PERM_TRANSFER) ? "PermYes" : "PermNo"); | ||
240 | } | ||
241 | |||
242 | LLString alertdesc; | ||
243 | switch(sale_info.getSaleType()) | ||
244 | { | ||
245 | case LLSaleInfo::FS_ORIGINAL: | ||
246 | alertdesc = owner_name.empty() ? "BuyOriginalNoOwner" : "BuyOriginal"; | ||
247 | break; | ||
248 | case LLSaleInfo::FS_COPY: | ||
249 | default: | ||
250 | alertdesc = owner_name.empty() ? "BuyCopyNoOwner" : "BuyCopy"; | ||
251 | break; | ||
252 | case LLSaleInfo::FS_CONTENTS: | ||
253 | alertdesc = owner_name.empty() ? "BuyContentsNoOwner" : "BuyContents"; | ||
254 | break; | ||
255 | } | ||
256 | |||
257 | gViewerWindow->alertXml(alertdesc, args, LLTaskInvFVBridge::commitBuyItem, (void*)inv); | ||
258 | } | ||
248 | } | 259 | } |
249 | 260 | ||
250 | S32 LLTaskInvFVBridge::getPrice() | 261 | S32 LLTaskInvFVBridge::getPrice() |
@@ -269,7 +280,7 @@ void LLTaskInvFVBridge::commitBuyItem(S32 option, void* data) | |||
269 | { | 280 | { |
270 | LLViewerObject* object = gObjectList.findObject(inv->mTaskID); | 281 | LLViewerObject* object = gObjectList.findObject(inv->mTaskID); |
271 | if(!object || !object->getRegion()) return; | 282 | if(!object || !object->getRegion()) return; |
272 | 283 | ||
273 | 284 | ||
274 | LLMessageSystem* msg = gMessageSystem; | 285 | LLMessageSystem* msg = gMessageSystem; |
275 | msg->newMessageFast(_PREHASH_BuyObjectInventory); | 286 | msg->newMessageFast(_PREHASH_BuyObjectInventory); |
@@ -289,12 +300,12 @@ void LLTaskInvFVBridge::commitBuyItem(S32 option, void* data) | |||
289 | const LLString& LLTaskInvFVBridge::getName() const | 300 | const LLString& LLTaskInvFVBridge::getName() const |
290 | { | 301 | { |
291 | return mName; | 302 | return mName; |
292 | } | 303 | } |
293 | 304 | ||
294 | const LLString& LLTaskInvFVBridge::getDisplayName() const | 305 | const LLString& LLTaskInvFVBridge::getDisplayName() const |
295 | { | 306 | { |
296 | LLInventoryItem* item = findItem(); | 307 | LLInventoryItem* item = findItem(); |
297 | if(item) | 308 | if(item) |
298 | { | 309 | { |
299 | mDisplayName.assign(item->getName()); | 310 | mDisplayName.assign(item->getName()); |
300 | 311 | ||
@@ -316,9 +327,9 @@ const LLString& LLTaskInvFVBridge::getDisplayName() const | |||
316 | mDisplayName.append(" (no transfer)"); | 327 | mDisplayName.append(" (no transfer)"); |
317 | } | 328 | } |
318 | } | 329 | } |
319 | 330 | ||
320 | return mDisplayName; | 331 | return mDisplayName; |
321 | } | 332 | } |
322 | 333 | ||
323 | // BUG: No creation dates for task inventory | 334 | // BUG: No creation dates for task inventory |
324 | U32 LLTaskInvFVBridge::getCreationDate() const | 335 | U32 LLTaskInvFVBridge::getCreationDate() const |
@@ -444,7 +455,7 @@ BOOL LLTaskInvFVBridge::removeItem() | |||
444 | { | 455 | { |
445 | // just do it. | 456 | // just do it. |
446 | object->removeInventory(mUUID); | 457 | object->removeInventory(mUUID); |
447 | return TRUE; | 458 | return TRUE; |
448 | } | 459 | } |
449 | else | 460 | else |
450 | { | 461 | { |
@@ -542,20 +553,20 @@ BOOL LLTaskInvFVBridge::startDrag(EDragAndDropType* type, LLUUID* id) | |||
542 | if((inv = (LLInventoryItem*)object->getInventoryObject(mUUID))) | 553 | if((inv = (LLInventoryItem*)object->getInventoryObject(mUUID))) |
543 | { | 554 | { |
544 | const LLPermissions& perm = inv->getPermissions(); | 555 | const LLPermissions& perm = inv->getPermissions(); |
545 | bool can_copy = gAgent.allowOperation(PERM_COPY, perm, | 556 | bool can_copy = gAgent.allowOperation(PERM_COPY, perm, |
546 | GP_OBJECT_MANIPULATE); | 557 | GP_OBJECT_MANIPULATE); |
547 | if (object->isAttachment() && !can_copy) | 558 | if (object->isAttachment() && !can_copy) |
548 | { | 559 | { |
549 | //RN: no copy contents of attachments cannot be dragged out | 560 | //RN: no copy contents of attachments cannot be dragged out |
550 | // due to a race condition and possible exploit where | 561 | // due to a race condition and possible exploit where |
551 | // attached objects do not update their inventory items | 562 | // attached objects do not update their inventory items |
552 | // when their contents are manipulated | 563 | // when their contents are manipulated |
553 | return FALSE; | 564 | return FALSE; |
554 | } | 565 | } |
555 | if((can_copy && perm.allowTransferTo(gAgent.getID())) | 566 | if((can_copy && perm.allowTransferTo(gAgent.getID())) |
556 | || object->permYouOwner()) | 567 | || object->permYouOwner()) |
557 | // || gAgent.isGodlike()) | 568 | // || gAgent.isGodlike()) |
558 | 569 | ||
559 | { | 570 | { |
560 | *type = LLAssetType::lookupDragAndDropType(inv->getType()); | 571 | *type = LLAssetType::lookupDragAndDropType(inv->getType()); |
561 | 572 | ||
@@ -621,7 +632,7 @@ void LLTaskInvFVBridge::buildContextMenu(LLMenuGL& menu, U32 flags) | |||
621 | std::vector<LLString> items; | 632 | std::vector<LLString> items; |
622 | std::vector<LLString> disabled_items; | 633 | std::vector<LLString> disabled_items; |
623 | 634 | ||
624 | if(gAgent.allowOperation(PERM_OWNER, item->getPermissions(), | 635 | if(gAgent.allowOperation(PERM_OWNER, item->getPermissions(), |
625 | GP_OBJECT_MANIPULATE) | 636 | GP_OBJECT_MANIPULATE) |
626 | && item->getSaleInfo().isForSale()) | 637 | && item->getSaleInfo().isForSale()) |
627 | { | 638 | { |
@@ -755,12 +766,12 @@ BOOL LLTaskCategoryBridge::startDrag(EDragAndDropType* type, LLUUID* id) | |||
755 | if((inv = (LLInventoryItem*)object->getInventoryObject(mUUID))) | 766 | if((inv = (LLInventoryItem*)object->getInventoryObject(mUUID))) |
756 | { | 767 | { |
757 | const LLPermissions& perm = inv->getPermissions(); | 768 | const LLPermissions& perm = inv->getPermissions(); |
758 | bool can_copy = gAgent.allowOperation(PERM_COPY, perm, | 769 | bool can_copy = gAgent.allowOperation(PERM_COPY, perm, |
759 | GP_OBJECT_MANIPULATE); | 770 | GP_OBJECT_MANIPULATE); |
760 | if((can_copy && perm.allowTransferTo(gAgent.getID())) | 771 | if((can_copy && perm.allowTransferTo(gAgent.getID())) |
761 | || object->permYouOwner()) | 772 | || object->permYouOwner()) |
762 | // || gAgent.isGodlike()) | 773 | // || gAgent.isGodlike()) |
763 | 774 | ||
764 | { | 775 | { |
765 | *type = LLAssetType::lookupDragAndDropType(inv->getType()); | 776 | *type = LLAssetType::lookupDragAndDropType(inv->getType()); |
766 | 777 | ||
@@ -776,7 +787,7 @@ BOOL LLTaskCategoryBridge::startDrag(EDragAndDropType* type, LLUUID* id) | |||
776 | BOOL LLTaskCategoryBridge::dragOrDrop(MASK mask, BOOL drop, | 787 | BOOL LLTaskCategoryBridge::dragOrDrop(MASK mask, BOOL drop, |
777 | EDragAndDropType cargo_type, | 788 | EDragAndDropType cargo_type, |
778 | void* cargo_data) | 789 | void* cargo_data) |
779 | { | 790 | { |
780 | //llinfos << "LLTaskCategoryBridge::dragOrDrop()" << llendl; | 791 | //llinfos << "LLTaskCategoryBridge::dragOrDrop()" << llendl; |
781 | BOOL accept = FALSE; | 792 | BOOL accept = FALSE; |
782 | LLViewerObject* object = gObjectList.findObject(mPanel->getTaskUUID()); | 793 | LLViewerObject* object = gObjectList.findObject(mPanel->getTaskUUID()); |
@@ -1060,7 +1071,7 @@ LLTaskLandmarkBridge::LLTaskLandmarkBridge( | |||
1060 | LLTaskInvFVBridge(panel, uuid, name) | 1071 | LLTaskInvFVBridge(panel, uuid, name) |
1061 | { | 1072 | { |
1062 | } | 1073 | } |
1063 | 1074 | ||
1064 | LLViewerImage* LLTaskLandmarkBridge::getIcon() const | 1075 | LLViewerImage* LLTaskLandmarkBridge::getIcon() const |
1065 | { | 1076 | { |
1066 | return get_item_icon(LLAssetType::AT_LANDMARK, LLInventoryType::IT_LANDMARK, 0, FALSE); | 1077 | return get_item_icon(LLAssetType::AT_LANDMARK, LLInventoryType::IT_LANDMARK, 0, FALSE); |
@@ -1091,7 +1102,7 @@ LLTaskCallingCardBridge::LLTaskCallingCardBridge( | |||
1091 | LLTaskInvFVBridge(panel, uuid, name) | 1102 | LLTaskInvFVBridge(panel, uuid, name) |
1092 | { | 1103 | { |
1093 | } | 1104 | } |
1094 | 1105 | ||
1095 | LLViewerImage* LLTaskCallingCardBridge::getIcon() const | 1106 | LLViewerImage* LLTaskCallingCardBridge::getIcon() const |
1096 | { | 1107 | { |
1097 | return get_item_icon(LLAssetType::AT_CALLINGCARD, LLInventoryType::IT_CALLINGCARD, 0, FALSE); | 1108 | return get_item_icon(LLAssetType::AT_CALLINGCARD, LLInventoryType::IT_CALLINGCARD, 0, FALSE); |
@@ -1476,7 +1487,7 @@ LLTaskWearableBridge::LLTaskWearableBridge( | |||
1476 | mAssetType( asset_type ) | 1487 | mAssetType( asset_type ) |
1477 | { | 1488 | { |
1478 | } | 1489 | } |
1479 | 1490 | ||
1480 | LLViewerImage* LLTaskWearableBridge::getIcon() const | 1491 | LLViewerImage* LLTaskWearableBridge::getIcon() const |
1481 | { | 1492 | { |
1482 | return get_item_icon(mAssetType, LLInventoryType::IT_WEARABLE, mFlags, FALSE ); | 1493 | return get_item_icon(mAssetType, LLInventoryType::IT_WEARABLE, mFlags, FALSE ); |
@@ -1648,7 +1659,7 @@ void LLPanelInventory::inventoryChanged(LLViewerObject* object, | |||
1648 | { | 1659 | { |
1649 | if(!object) return; | 1660 | if(!object) return; |
1650 | 1661 | ||
1651 | //llinfos << "invetnory arrived: \n" | 1662 | //llinfos << "invetnory arrived: \n" |
1652 | // << " panel UUID: " << panel->mTaskUUID << "\n" | 1663 | // << " panel UUID: " << panel->mTaskUUID << "\n" |
1653 | // << " task UUID: " << object->mID << llendl; | 1664 | // << " task UUID: " << object->mID << llendl; |
1654 | if(mTaskUUID == object->mID) | 1665 | if(mTaskUUID == object->mID) |
@@ -1686,7 +1697,7 @@ void LLPanelInventory::inventoryChanged(LLViewerObject* object, | |||
1686 | 1697 | ||
1687 | void LLPanelInventory::updateInventory() | 1698 | void LLPanelInventory::updateInventory() |
1688 | { | 1699 | { |
1689 | //llinfos << "inventory arrived: \n" | 1700 | //llinfos << "inventory arrived: \n" |
1690 | // << " panel UUID: " << panel->mTaskUUID << "\n" | 1701 | // << " panel UUID: " << panel->mTaskUUID << "\n" |
1691 | // << " task UUID: " << object->mID << llendl; | 1702 | // << " task UUID: " << object->mID << llendl; |
1692 | // We're still interested in this task's inventory. | 1703 | // We're still interested in this task's inventory. |
@@ -1865,7 +1876,7 @@ void LLPanelInventory::refresh() | |||
1865 | // Otherwise we show the old stuff until the update comes in | 1876 | // Otherwise we show the old stuff until the update comes in |
1866 | clearContents(); | 1877 | clearContents(); |
1867 | 1878 | ||
1868 | // Register for updates from this object, | 1879 | // Register for updates from this object, |
1869 | registerVOInventoryListener(object,NULL); | 1880 | registerVOInventoryListener(object,NULL); |
1870 | } | 1881 | } |
1871 | 1882 | ||
@@ -1978,7 +1989,7 @@ BOOL LLPanelInventory::handleDragAndDrop(S32 x, S32 y, MASK mask, BOOL drop, EDr | |||
1978 | } | 1989 | } |
1979 | } | 1990 | } |
1980 | 1991 | ||
1981 | //static | 1992 | //static |
1982 | void LLPanelInventory::idle(void* user_data) | 1993 | void LLPanelInventory::idle(void* user_data) |
1983 | { | 1994 | { |
1984 | LLPanelInventory* self = (LLPanelInventory*)user_data; | 1995 | LLPanelInventory* self = (LLPanelInventory*)user_data; |
diff --git a/linden/indra/newview/llpanelmsgs.cpp b/linden/indra/newview/llpanelmsgs.cpp index f25d477..3f5314c 100644 --- a/linden/indra/newview/llpanelmsgs.cpp +++ b/linden/indra/newview/llpanelmsgs.cpp | |||
@@ -88,14 +88,33 @@ void LLPanelMsgs::buildLists() | |||
88 | row["columns"][1]["font"] = "SANSSERIF_SMALL"; | 88 | row["columns"][1]["font"] = "SANSSERIF_SMALL"; |
89 | row["columns"][1]["width"] = 160; | 89 | row["columns"][1]["width"] = 160; |
90 | } | 90 | } |
91 | item = mDisabledPopups->addElement(row, ADD_SORTED); | 91 | if (mDisabledPopups) |
92 | { | ||
93 | item = mDisabledPopups->addElement(row, | ||
94 | ADD_SORTED); | ||
95 | } | ||
96 | else | ||
97 | { | ||
98 | llwarns << "(ignore) but also (!mDisabledPopups)" << llendl; | ||
99 | } | ||
92 | } | 100 | } |
93 | else | 101 | else |
94 | { | 102 | { |
95 | item = mEnabledPopups->addElement(row, ADD_SORTED); | 103 | if (mEnabledPopups) |
104 | { | ||
105 | item = mEnabledPopups->addElement(row, | ||
106 | ADD_SORTED); | ||
107 | } | ||
108 | else | ||
109 | { | ||
110 | llwarns << "(!ignore) but also (!mEnabledPopups)" << llendl; | ||
111 | } | ||
96 | } | 112 | } |
97 | 113 | ||
98 | item->setUserdata((void*)&iter->first); | 114 | if (item) |
115 | { | ||
116 | item->setUserdata((void*)&iter->first); | ||
117 | } | ||
99 | } | 118 | } |
100 | } | 119 | } |
101 | 120 | ||
diff --git a/linden/indra/newview/llpanelpermissions.cpp b/linden/indra/newview/llpanelpermissions.cpp index 18ec28e..6e8a4ff 100644 --- a/linden/indra/newview/llpanelpermissions.cpp +++ b/linden/indra/newview/llpanelpermissions.cpp | |||
@@ -726,14 +726,17 @@ void LLPanelPermissions::refresh() | |||
726 | LLSaleInfo::EForSale sale_type = sale_info.getSaleType(); | 726 | LLSaleInfo::EForSale sale_type = sale_info.getSaleType(); |
727 | 727 | ||
728 | LLRadioGroup* RadioSaleType = gUICtrlFactory->getRadioGroupByName(this,"sale type"); | 728 | LLRadioGroup* RadioSaleType = gUICtrlFactory->getRadioGroupByName(this,"sale type"); |
729 | if(RadioSaleType && valid_sale_info) | 729 | if(RadioSaleType) |
730 | { | 730 | { |
731 | RadioSaleType->setSelectedIndex((S32)sale_type - 1); | 731 | if (valid_sale_info) |
732 | } | 732 | { |
733 | else | 733 | RadioSaleType->setSelectedIndex((S32)sale_type - 1); |
734 | { | 734 | } |
735 | // default option is sell copy, determined to be safest | 735 | else |
736 | RadioSaleType->setSelectedIndex((S32)LLSaleInfo::FS_COPY - 1); | 736 | { |
737 | // default option is sell copy, determined to be safest | ||
738 | RadioSaleType->setSelectedIndex((S32)LLSaleInfo::FS_COPY - 1); | ||
739 | } | ||
737 | } | 740 | } |
738 | 741 | ||
739 | if (is_for_sale) | 742 | if (is_for_sale) |
diff --git a/linden/indra/newview/llpatchvertexarray.cpp b/linden/indra/newview/llpatchvertexarray.cpp index bfd4ff4..611ff97 100644 --- a/linden/indra/newview/llpatchvertexarray.cpp +++ b/linden/indra/newview/llpatchvertexarray.cpp | |||
@@ -126,8 +126,16 @@ void LLPatchVertexArray::create(U32 surface_width, U32 patch_width, F32 meters_p | |||
126 | mRenderStridep = new U32 [mPatchOrder + 1]; | 126 | mRenderStridep = new U32 [mPatchOrder + 1]; |
127 | } | 127 | } |
128 | 128 | ||
129 | if (NULL == mRenderLevelp || NULL == mRenderStridep) | ||
130 | { | ||
131 | // init() and some other things all want to deref these | ||
132 | // pointers, so this is serious. | ||
133 | llerrs << "mRenderLevelp or mRenderStridep was NULL; we'd crash soon." << llendl; | ||
134 | return; | ||
135 | } | ||
129 | 136 | ||
130 | // Now that we've allocated memory, we can initialize the arrays... | 137 | // Now that we've allocated memory, we can initialize |
138 | // the arrays... | ||
131 | init(); | 139 | init(); |
132 | } | 140 | } |
133 | 141 | ||
diff --git a/linden/indra/newview/llpolymesh.cpp b/linden/indra/newview/llpolymesh.cpp index cf94142..1edb8f5 100644 --- a/linden/indra/newview/llpolymesh.cpp +++ b/linden/indra/newview/llpolymesh.cpp | |||
@@ -301,6 +301,7 @@ BOOL LLPolyMeshSharedData::loadMesh( const char *fileName ) | |||
301 | if (numRead != 1) | 301 | if (numRead != 1) |
302 | { | 302 | { |
303 | llerrs << "can't read HasWeights flag from " << fileName << llendl; | 303 | llerrs << "can't read HasWeights flag from " << fileName << llendl; |
304 | return FALSE; | ||
304 | } | 305 | } |
305 | if (!isLOD()) | 306 | if (!isLOD()) |
306 | { | 307 | { |
@@ -315,6 +316,7 @@ BOOL LLPolyMeshSharedData::loadMesh( const char *fileName ) | |||
315 | if (numRead != 1) | 316 | if (numRead != 1) |
316 | { | 317 | { |
317 | llerrs << "can't read HasDetailTexCoords flag from " << fileName << llendl; | 318 | llerrs << "can't read HasDetailTexCoords flag from " << fileName << llendl; |
319 | return FALSE; | ||
318 | } | 320 | } |
319 | 321 | ||
320 | //---------------------------------------------------------------- | 322 | //---------------------------------------------------------------- |
@@ -326,6 +328,7 @@ BOOL LLPolyMeshSharedData::loadMesh( const char *fileName ) | |||
326 | if (numRead != 3) | 328 | if (numRead != 3) |
327 | { | 329 | { |
328 | llerrs << "can't read Position from " << fileName << llendl; | 330 | llerrs << "can't read Position from " << fileName << llendl; |
331 | return FALSE; | ||
329 | } | 332 | } |
330 | setPosition( position ); | 333 | setPosition( position ); |
331 | 334 | ||
@@ -338,6 +341,7 @@ BOOL LLPolyMeshSharedData::loadMesh( const char *fileName ) | |||
338 | if (numRead != 3) | 341 | if (numRead != 3) |
339 | { | 342 | { |
340 | llerrs << "can't read RotationAngles from " << fileName << llendl; | 343 | llerrs << "can't read RotationAngles from " << fileName << llendl; |
344 | return FALSE; | ||
341 | } | 345 | } |
342 | 346 | ||
343 | U8 rotationOrder; | 347 | U8 rotationOrder; |
@@ -346,6 +350,7 @@ BOOL LLPolyMeshSharedData::loadMesh( const char *fileName ) | |||
346 | if (numRead != 1) | 350 | if (numRead != 1) |
347 | { | 351 | { |
348 | llerrs << "can't read RotationOrder from " << fileName << llendl; | 352 | llerrs << "can't read RotationOrder from " << fileName << llendl; |
353 | return FALSE; | ||
349 | } | 354 | } |
350 | 355 | ||
351 | rotationOrder = 0; | 356 | rotationOrder = 0; |
@@ -364,6 +369,7 @@ BOOL LLPolyMeshSharedData::loadMesh( const char *fileName ) | |||
364 | if (numRead != 3) | 369 | if (numRead != 3) |
365 | { | 370 | { |
366 | llerrs << "can't read Scale from " << fileName << llendl; | 371 | llerrs << "can't read Scale from " << fileName << llendl; |
372 | return FALSE; | ||
367 | } | 373 | } |
368 | setScale( scale ); | 374 | setScale( scale ); |
369 | 375 | ||
@@ -384,6 +390,7 @@ BOOL LLPolyMeshSharedData::loadMesh( const char *fileName ) | |||
384 | if (numRead != 1) | 390 | if (numRead != 1) |
385 | { | 391 | { |
386 | llerrs << "can't read NumVertices from " << fileName << llendl; | 392 | llerrs << "can't read NumVertices from " << fileName << llendl; |
393 | return FALSE; | ||
387 | } | 394 | } |
388 | 395 | ||
389 | allocateVertexData( numVertices ); | 396 | allocateVertexData( numVertices ); |
@@ -396,6 +403,7 @@ BOOL LLPolyMeshSharedData::loadMesh( const char *fileName ) | |||
396 | if (numRead != numVertices) | 403 | if (numRead != numVertices) |
397 | { | 404 | { |
398 | llerrs << "can't read Coordinates from " << fileName << llendl; | 405 | llerrs << "can't read Coordinates from " << fileName << llendl; |
406 | return FALSE; | ||
399 | } | 407 | } |
400 | 408 | ||
401 | //---------------------------------------------------------------- | 409 | //---------------------------------------------------------------- |
@@ -406,6 +414,7 @@ BOOL LLPolyMeshSharedData::loadMesh( const char *fileName ) | |||
406 | if (numRead != numVertices) | 414 | if (numRead != numVertices) |
407 | { | 415 | { |
408 | llerrs << " can't read Normals from " << fileName << llendl; | 416 | llerrs << " can't read Normals from " << fileName << llendl; |
417 | return FALSE; | ||
409 | } | 418 | } |
410 | 419 | ||
411 | //---------------------------------------------------------------- | 420 | //---------------------------------------------------------------- |
@@ -416,6 +425,7 @@ BOOL LLPolyMeshSharedData::loadMesh( const char *fileName ) | |||
416 | if (numRead != numVertices) | 425 | if (numRead != numVertices) |
417 | { | 426 | { |
418 | llerrs << " can't read Binormals from " << fileName << llendl; | 427 | llerrs << " can't read Binormals from " << fileName << llendl; |
428 | return FALSE; | ||
419 | } | 429 | } |
420 | 430 | ||
421 | 431 | ||
@@ -427,6 +437,7 @@ BOOL LLPolyMeshSharedData::loadMesh( const char *fileName ) | |||
427 | if (numRead != numVertices) | 437 | if (numRead != numVertices) |
428 | { | 438 | { |
429 | llerrs << "can't read TexCoords from " << fileName << llendl; | 439 | llerrs << "can't read TexCoords from " << fileName << llendl; |
440 | return FALSE; | ||
430 | } | 441 | } |
431 | 442 | ||
432 | //---------------------------------------------------------------- | 443 | //---------------------------------------------------------------- |
@@ -439,6 +450,7 @@ BOOL LLPolyMeshSharedData::loadMesh( const char *fileName ) | |||
439 | if (numRead != numVertices) | 450 | if (numRead != numVertices) |
440 | { | 451 | { |
441 | llerrs << "can't read DetailTexCoords from " << fileName << llendl; | 452 | llerrs << "can't read DetailTexCoords from " << fileName << llendl; |
453 | return FALSE; | ||
442 | } | 454 | } |
443 | } | 455 | } |
444 | 456 | ||
@@ -452,6 +464,7 @@ BOOL LLPolyMeshSharedData::loadMesh( const char *fileName ) | |||
452 | if (numRead != numVertices) | 464 | if (numRead != numVertices) |
453 | { | 465 | { |
454 | llerrs << "can't read Weights from " << fileName << llendl; | 466 | llerrs << "can't read Weights from " << fileName << llendl; |
467 | return FALSE; | ||
455 | } | 468 | } |
456 | } | 469 | } |
457 | } | 470 | } |
@@ -465,6 +478,7 @@ BOOL LLPolyMeshSharedData::loadMesh( const char *fileName ) | |||
465 | if (numRead != 1) | 478 | if (numRead != 1) |
466 | { | 479 | { |
467 | llerrs << "can't read NumFaces from " << fileName << llendl; | 480 | llerrs << "can't read NumFaces from " << fileName << llendl; |
481 | return FALSE; | ||
468 | } | 482 | } |
469 | allocateFaceData( numFaces ); | 483 | allocateFaceData( numFaces ); |
470 | 484 | ||
@@ -482,6 +496,7 @@ BOOL LLPolyMeshSharedData::loadMesh( const char *fileName ) | |||
482 | if (numRead != 3) | 496 | if (numRead != 3) |
483 | { | 497 | { |
484 | llerrs << "can't read Face[" << i << "] from " << fileName << llendl; | 498 | llerrs << "can't read Face[" << i << "] from " << fileName << llendl; |
499 | return FALSE; | ||
485 | } | 500 | } |
486 | if (mReferenceData) | 501 | if (mReferenceData) |
487 | { | 502 | { |
@@ -538,6 +553,7 @@ BOOL LLPolyMeshSharedData::loadMesh( const char *fileName ) | |||
538 | if (numRead != 1) | 553 | if (numRead != 1) |
539 | { | 554 | { |
540 | llerrs << "can't read NumSkinJoints from " << fileName << llendl; | 555 | llerrs << "can't read NumSkinJoints from " << fileName << llendl; |
556 | return FALSE; | ||
541 | } | 557 | } |
542 | allocateJointNames( numSkinJoints ); | 558 | allocateJointNames( numSkinJoints ); |
543 | } | 559 | } |
@@ -547,11 +563,13 @@ BOOL LLPolyMeshSharedData::loadMesh( const char *fileName ) | |||
547 | //---------------------------------------------------------------- | 563 | //---------------------------------------------------------------- |
548 | for (i=0; i < numSkinJoints; i++) | 564 | for (i=0; i < numSkinJoints; i++) |
549 | { | 565 | { |
550 | char jointName[64]; /*Flawfinder: ignore*/ | 566 | char jointName[64+1]; |
551 | numRead = fread(jointName, sizeof(jointName), 1, fp); | 567 | numRead = fread(jointName, sizeof(jointName)-1, 1, fp); |
568 | jointName[sizeof(jointName)-1] = '\0'; // ensure nul-termination | ||
552 | if (numRead != 1) | 569 | if (numRead != 1) |
553 | { | 570 | { |
554 | llerrs << "can't read Skin[" << i << "].Name from " << fileName << llendl; | 571 | llerrs << "can't read Skin[" << i << "].Name from " << fileName << llendl; |
572 | return FALSE; | ||
555 | } | 573 | } |
556 | 574 | ||
557 | std::string *jn = &mJointNames[i]; | 575 | std::string *jn = &mJointNames[i]; |
@@ -561,7 +579,8 @@ BOOL LLPolyMeshSharedData::loadMesh( const char *fileName ) | |||
561 | //------------------------------------------------------------------------- | 579 | //------------------------------------------------------------------------- |
562 | // look for morph section | 580 | // look for morph section |
563 | //------------------------------------------------------------------------- | 581 | //------------------------------------------------------------------------- |
564 | char morphName[64]; /*Flawfinder: ignore*/ | 582 | char morphName[64+1]; |
583 | morphName[sizeof(morphName)-1] = '\0'; // ensure nul-termination | ||
565 | while(fread(&morphName, sizeof(char), 64, fp) == 64) | 584 | while(fread(&morphName, sizeof(char), 64, fp) == 64) |
566 | { | 585 | { |
567 | if (!strcmp(morphName, "End Morphs")) | 586 | if (!strcmp(morphName, "End Morphs")) |
@@ -991,6 +1010,13 @@ BOOL LLPolySkeletalDistortionInfo::parseXml(LLXmlTreeNode* node) | |||
991 | 1010 | ||
992 | LLXmlTreeNode* skeletalParam = node->getChildByName("param_skeleton"); | 1011 | LLXmlTreeNode* skeletalParam = node->getChildByName("param_skeleton"); |
993 | 1012 | ||
1013 | if (NULL == skeletalParam) | ||
1014 | { | ||
1015 | llwarns << "Failed to getChildByName(\"param_skeleton\")" | ||
1016 | << llendl; | ||
1017 | return FALSE; | ||
1018 | } | ||
1019 | |||
994 | for( LLXmlTreeNode* bone = skeletalParam->getFirstChild(); bone; bone = skeletalParam->getNextChild() ) | 1020 | for( LLXmlTreeNode* bone = skeletalParam->getFirstChild(); bone; bone = skeletalParam->getNextChild() ) |
995 | { | 1021 | { |
996 | if (bone->hasName("bone")) | 1022 | if (bone->hasName("bone")) |
diff --git a/linden/indra/newview/llpolymorph.cpp b/linden/indra/newview/llpolymorph.cpp index 2d1375d..b36f0e2 100644 --- a/linden/indra/newview/llpolymorph.cpp +++ b/linden/indra/newview/llpolymorph.cpp | |||
@@ -214,6 +214,13 @@ BOOL LLPolyMorphTargetInfo::parseXml(LLXmlTreeNode* node) | |||
214 | 214 | ||
215 | LLXmlTreeNode *paramNode = node->getChildByName("param_morph"); | 215 | LLXmlTreeNode *paramNode = node->getChildByName("param_morph"); |
216 | 216 | ||
217 | if (NULL == paramNode) | ||
218 | { | ||
219 | llwarns << "Failed to getChildByName(\"param_morph\")" | ||
220 | << llendl; | ||
221 | return FALSE; | ||
222 | } | ||
223 | |||
217 | for (LLXmlTreeNode* child_node = paramNode->getFirstChild(); | 224 | for (LLXmlTreeNode* child_node = paramNode->getFirstChild(); |
218 | child_node; | 225 | child_node; |
219 | child_node = paramNode->getNextChild()) | 226 | child_node = paramNode->getNextChild()) |
@@ -256,7 +263,10 @@ LLPolyMorphTarget::LLPolyMorphTarget(LLPolyMesh *poly_mesh) | |||
256 | //----------------------------------------------------------------------------- | 263 | //----------------------------------------------------------------------------- |
257 | LLPolyMorphTarget::~LLPolyMorphTarget() | 264 | LLPolyMorphTarget::~LLPolyMorphTarget() |
258 | { | 265 | { |
259 | delete mVertMask; | 266 | if (mVertMask) |
267 | { | ||
268 | delete mVertMask; | ||
269 | } | ||
260 | } | 270 | } |
261 | 271 | ||
262 | //----------------------------------------------------------------------------- | 272 | //----------------------------------------------------------------------------- |
diff --git a/linden/indra/newview/llpreview.cpp b/linden/indra/newview/llpreview.cpp index 347c6d5..23f31aa 100644 --- a/linden/indra/newview/llpreview.cpp +++ b/linden/indra/newview/llpreview.cpp | |||
@@ -60,6 +60,7 @@ LLPreview::LLPreview(const std::string& name) : | |||
60 | LLFloater(name), | 60 | LLFloater(name), |
61 | mCopyToInvBtn(NULL), | 61 | mCopyToInvBtn(NULL), |
62 | mForceClose(FALSE), | 62 | mForceClose(FALSE), |
63 | mUserResized(FALSE), | ||
63 | mCloseAfterSave(FALSE), | 64 | mCloseAfterSave(FALSE), |
64 | mAssetStatus(PREVIEW_ASSET_UNLOADED) | 65 | mAssetStatus(PREVIEW_ASSET_UNLOADED) |
65 | { | 66 | { |
@@ -76,6 +77,7 @@ LLPreview::LLPreview(const std::string& name, const LLRect& rect, const std::str | |||
76 | mObjectUUID(object_uuid), | 77 | mObjectUUID(object_uuid), |
77 | mCopyToInvBtn( NULL ), | 78 | mCopyToInvBtn( NULL ), |
78 | mForceClose( FALSE ), | 79 | mForceClose( FALSE ), |
80 | mUserResized(FALSE), | ||
79 | mCloseAfterSave(FALSE), | 81 | mCloseAfterSave(FALSE), |
80 | mAssetStatus(PREVIEW_ASSET_UNLOADED) | 82 | mAssetStatus(PREVIEW_ASSET_UNLOADED) |
81 | { | 83 | { |
@@ -189,8 +191,6 @@ void LLPreview::onCommit() | |||
189 | } | 191 | } |
190 | 192 | ||
191 | LLPointer<LLViewerInventoryItem> new_item = new LLViewerInventoryItem(item); | 193 | LLPointer<LLViewerInventoryItem> new_item = new LLViewerInventoryItem(item); |
192 | BOOL has_sale_info = FALSE; | ||
193 | LLSaleInfo sale_info; | ||
194 | new_item->setDescription(childGetText("desc")); | 194 | new_item->setDescription(childGetText("desc")); |
195 | if(mObjectUUID.notNull()) | 195 | if(mObjectUUID.notNull()) |
196 | { | 196 | { |
@@ -222,11 +222,6 @@ void LLPreview::onCommit() | |||
222 | gSelectMgr->deselectAll(); | 222 | gSelectMgr->deselectAll(); |
223 | gSelectMgr->addAsIndividual( obj, SELECT_ALL_TES, FALSE ); | 223 | gSelectMgr->addAsIndividual( obj, SELECT_ALL_TES, FALSE ); |
224 | gSelectMgr->selectionSetObjectDescription( childGetText("desc") ); | 224 | gSelectMgr->selectionSetObjectDescription( childGetText("desc") ); |
225 | |||
226 | if( has_sale_info ) | ||
227 | { | ||
228 | gSelectMgr->selectionSetObjectSaleInfo( sale_info ); | ||
229 | } | ||
230 | 225 | ||
231 | gSelectMgr->deselectAll(); | 226 | gSelectMgr->deselectAll(); |
232 | } | 227 | } |
@@ -487,6 +482,12 @@ LLPreview* LLPreview::getFirstPreviewForSource(const LLUUID& source_id) | |||
487 | return NULL; | 482 | return NULL; |
488 | } | 483 | } |
489 | 484 | ||
485 | void LLPreview::userSetShape(const LLRect& new_rect) | ||
486 | { | ||
487 | userResized(); | ||
488 | LLView::userSetShape(new_rect); | ||
489 | } | ||
490 | |||
490 | // | 491 | // |
491 | // LLMultiPreview | 492 | // LLMultiPreview |
492 | // | 493 | // |
@@ -506,6 +507,15 @@ void LLMultiPreview::open() /*Flawfinder: ignore*/ | |||
506 | } | 507 | } |
507 | } | 508 | } |
508 | 509 | ||
510 | |||
511 | void LLMultiPreview::userSetShape(const LLRect& new_rect) | ||
512 | { | ||
513 | LLPreview* frontmost_preview = (LLPreview*)mTabContainer->getCurrentPanel(); | ||
514 | if (frontmost_preview) frontmost_preview->userResized(); | ||
515 | LLView::userSetShape(new_rect); | ||
516 | } | ||
517 | |||
518 | |||
509 | void LLMultiPreview::tabOpen(LLFloater* opened_floater, bool from_click) | 519 | void LLMultiPreview::tabOpen(LLFloater* opened_floater, bool from_click) |
510 | { | 520 | { |
511 | LLPreview* opened_preview = (LLPreview*)opened_floater; | 521 | LLPreview* opened_preview = (LLPreview*)opened_floater; |
diff --git a/linden/indra/newview/llpreview.h b/linden/indra/newview/llpreview.h index 266bdd1..c8c0355 100644 --- a/linden/indra/newview/llpreview.h +++ b/linden/indra/newview/llpreview.h | |||
@@ -48,6 +48,7 @@ public: | |||
48 | 48 | ||
49 | /*virtual*/void open(); /*Flawfinder: ignore*/ | 49 | /*virtual*/void open(); /*Flawfinder: ignore*/ |
50 | /*virtual*/void tabOpen(LLFloater* opened_floater, bool from_click); | 50 | /*virtual*/void tabOpen(LLFloater* opened_floater, bool from_click); |
51 | /*virtual*/ void userSetShape(const LLRect& new_rect); | ||
51 | 52 | ||
52 | static LLMultiPreview* getAutoOpenInstance(const LLUUID& id); | 53 | static LLMultiPreview* getAutoOpenInstance(const LLUUID& id); |
53 | static void setAutoOpenInstance(LLMultiPreview* previewp, const LLUUID& id); | 54 | static void setAutoOpenInstance(LLMultiPreview* previewp, const LLUUID& id); |
@@ -101,6 +102,9 @@ public: | |||
101 | void addKeepDiscardButtons(); | 102 | void addKeepDiscardButtons(); |
102 | static void onKeepBtn(void* data); | 103 | static void onKeepBtn(void* data); |
103 | static void onDiscardBtn(void* data); | 104 | static void onDiscardBtn(void* data); |
105 | /*virtual*/ void userSetShape(const LLRect& new_rect); | ||
106 | |||
107 | void userResized() { mUserResized = TRUE; }; | ||
104 | 108 | ||
105 | virtual void loadAsset() { mAssetStatus = PREVIEW_ASSET_LOADED; } | 109 | virtual void loadAsset() { mAssetStatus = PREVIEW_ASSET_LOADED; } |
106 | virtual EAssetStatus getAssetStatus() { return mAssetStatus;} | 110 | virtual EAssetStatus getAssetStatus() { return mAssetStatus;} |
@@ -135,6 +139,8 @@ protected: | |||
135 | // Close without saving changes | 139 | // Close without saving changes |
136 | BOOL mForceClose; | 140 | BOOL mForceClose; |
137 | 141 | ||
142 | BOOL mUserResized; | ||
143 | |||
138 | // When closing springs a "Want to save?" dialog, we want | 144 | // When closing springs a "Want to save?" dialog, we want |
139 | // to keep the preview open until the save completes. | 145 | // to keep the preview open until the save completes. |
140 | BOOL mCloseAfterSave; | 146 | BOOL mCloseAfterSave; |
diff --git a/linden/indra/newview/llpreviewgesture.cpp b/linden/indra/newview/llpreviewgesture.cpp index 5f657d3..2bb0108 100644 --- a/linden/indra/newview/llpreviewgesture.cpp +++ b/linden/indra/newview/llpreviewgesture.cpp | |||
@@ -1590,6 +1590,11 @@ LLScrollListItem* LLPreviewGesture::addStep(const std::string& library_text) | |||
1590 | { | 1590 | { |
1591 | step = new LLGestureStepWait(); | 1591 | step = new LLGestureStepWait(); |
1592 | } | 1592 | } |
1593 | else | ||
1594 | { | ||
1595 | llerrs << "Unknown step type: " << library_text << llendl;; | ||
1596 | return NULL; | ||
1597 | } | ||
1593 | 1598 | ||
1594 | // Create an enabled item with this step | 1599 | // Create an enabled item with this step |
1595 | LLSD row; | 1600 | LLSD row; |
@@ -1645,7 +1650,7 @@ void LLPreviewGesture::onClickDelete(void* data) | |||
1645 | 1650 | ||
1646 | LLScrollListItem* item = self->mStepList->getFirstSelected(); | 1651 | LLScrollListItem* item = self->mStepList->getFirstSelected(); |
1647 | S32 selected_index = self->mStepList->getFirstSelectedIndex(); | 1652 | S32 selected_index = self->mStepList->getFirstSelectedIndex(); |
1648 | if (selected_index >= 0) | 1653 | if (item && selected_index >= 0) |
1649 | { | 1654 | { |
1650 | LLGestureStep* step = (LLGestureStep*)item->getUserdata(); | 1655 | LLGestureStep* step = (LLGestureStep*)item->getUserdata(); |
1651 | delete step; | 1656 | delete step; |
diff --git a/linden/indra/newview/llpreviewnotecard.cpp b/linden/indra/newview/llpreviewnotecard.cpp index 1c59bb4..471fe8a 100644 --- a/linden/indra/newview/llpreviewnotecard.cpp +++ b/linden/indra/newview/llpreviewnotecard.cpp | |||
@@ -296,11 +296,12 @@ void LLPreviewNotecard::loadAsset() | |||
296 | { | 296 | { |
297 | // The object that we're trying to look at disappeared, bail. | 297 | // The object that we're trying to look at disappeared, bail. |
298 | llwarns << "Can't find object " << mObjectUUID << " associated with notecard." << llendl; | 298 | llwarns << "Can't find object " << mObjectUUID << " associated with notecard." << llendl; |
299 | mAssetID.setNull(); | 299 | mAssetID.setNull(); |
300 | editor->setText("Unable to find object containing this note."); | 300 | editor->setText("Unable to find object containing this note."); |
301 | editor->makePristine(); | 301 | editor->makePristine(); |
302 | editor->setEnabled(FALSE); | 302 | editor->setEnabled(FALSE); |
303 | mAssetStatus = PREVIEW_ASSET_LOADED; | 303 | mAssetStatus = PREVIEW_ASSET_LOADED; |
304 | delete new_uuid; | ||
304 | return; | 305 | return; |
305 | } | 306 | } |
306 | } | 307 | } |
diff --git a/linden/indra/newview/llpreviewscript.cpp b/linden/indra/newview/llpreviewscript.cpp index 39938d4..86c78a5 100644 --- a/linden/indra/newview/llpreviewscript.cpp +++ b/linden/indra/newview/llpreviewscript.cpp | |||
@@ -470,12 +470,14 @@ void LLScriptEdCore::updateDynamicHelp(BOOL immediate) | |||
470 | LLFloater* help_floater = LLFloater::getFloaterByHandle(mLiveHelpHandle); | 470 | LLFloater* help_floater = LLFloater::getFloaterByHandle(mLiveHelpHandle); |
471 | if (!help_floater) return; | 471 | if (!help_floater) return; |
472 | 472 | ||
473 | #if LL_LIBXUL_ENABLED | ||
473 | // update back and forward buttons | 474 | // update back and forward buttons |
474 | LLButton* fwd_button = LLUICtrlFactory::getButtonByName(help_floater, "fwd_btn"); | 475 | LLButton* fwd_button = LLUICtrlFactory::getButtonByName(help_floater, "fwd_btn"); |
475 | LLButton* back_button = LLUICtrlFactory::getButtonByName(help_floater, "back_btn"); | 476 | LLButton* back_button = LLUICtrlFactory::getButtonByName(help_floater, "back_btn"); |
476 | LLWebBrowserCtrl* browser = LLUICtrlFactory::getWebBrowserCtrlByName(help_floater, "lsl_guide_html"); | 477 | LLWebBrowserCtrl* browser = LLUICtrlFactory::getWebBrowserCtrlByName(help_floater, "lsl_guide_html"); |
477 | back_button->setEnabled(browser->canNavigateBack()); | 478 | back_button->setEnabled(browser->canNavigateBack()); |
478 | fwd_button->setEnabled(browser->canNavigateForward()); | 479 | fwd_button->setEnabled(browser->canNavigateForward()); |
480 | #endif // LL_LIBXUL_ENABLED | ||
479 | 481 | ||
480 | if (!immediate && !gSavedSettings.getBOOL("ScriptHelpFollowsCursor")) | 482 | if (!immediate && !gSavedSettings.getBOOL("ScriptHelpFollowsCursor")) |
481 | { | 483 | { |
@@ -521,7 +523,7 @@ void LLScriptEdCore::updateDynamicHelp(BOOL immediate) | |||
521 | mLiveHelpTimer.stop(); | 523 | mLiveHelpTimer.stop(); |
522 | } | 524 | } |
523 | } | 525 | } |
524 | else | 526 | else if (immediate) |
525 | { | 527 | { |
526 | setHelpPage(""); | 528 | setHelpPage(""); |
527 | } | 529 | } |
@@ -543,7 +545,9 @@ void LLScriptEdCore::setHelpPage(const LLString& help_string) | |||
543 | url_string.setArg("[LSL_STRING]", help_string); | 545 | url_string.setArg("[LSL_STRING]", help_string); |
544 | 546 | ||
545 | addHelpItemToHistory(help_string); | 547 | addHelpItemToHistory(help_string); |
548 | #if LL_LIBXUL_ENABLED | ||
546 | web_browser->navigateTo(url_string); | 549 | web_browser->navigateTo(url_string); |
550 | #endif // LL_LIBXUL_ENABLED | ||
547 | } | 551 | } |
548 | 552 | ||
549 | void LLScriptEdCore::addHelpItemToHistory(const LLString& help_string) | 553 | void LLScriptEdCore::addHelpItemToHistory(const LLString& help_string) |
@@ -675,8 +679,10 @@ void LLScriptEdCore::onBtnDynamicHelp(void* userdata) | |||
675 | live_help_floater->childSetAction("back_btn", onClickBack, userdata); | 679 | live_help_floater->childSetAction("back_btn", onClickBack, userdata); |
676 | live_help_floater->childSetAction("fwd_btn", onClickForward, userdata); | 680 | live_help_floater->childSetAction("fwd_btn", onClickForward, userdata); |
677 | 681 | ||
682 | #if LL_LIBXUL_ENABLED | ||
678 | LLWebBrowserCtrl* browser = LLUICtrlFactory::getWebBrowserCtrlByName(live_help_floater, "lsl_guide_html"); | 683 | LLWebBrowserCtrl* browser = LLUICtrlFactory::getWebBrowserCtrlByName(live_help_floater, "lsl_guide_html"); |
679 | browser->setAlwaysRefresh(TRUE); | 684 | browser->setAlwaysRefresh(TRUE); |
685 | #endif // LL_LIBXUL_ENABLED | ||
680 | 686 | ||
681 | LLComboBox* help_combo = LLUICtrlFactory::getComboBoxByName(live_help_floater, "history_combo"); | 687 | LLComboBox* help_combo = LLUICtrlFactory::getComboBoxByName(live_help_floater, "history_combo"); |
682 | LLKeywordToken *token; | 688 | LLKeywordToken *token; |
@@ -700,6 +706,7 @@ void LLScriptEdCore::onBtnDynamicHelp(void* userdata) | |||
700 | //static | 706 | //static |
701 | void LLScriptEdCore::onClickBack(void* userdata) | 707 | void LLScriptEdCore::onClickBack(void* userdata) |
702 | { | 708 | { |
709 | #if LL_LIBXUL_ENABLED | ||
703 | LLScriptEdCore* corep = (LLScriptEdCore*)userdata; | 710 | LLScriptEdCore* corep = (LLScriptEdCore*)userdata; |
704 | LLFloater* live_help_floater = LLFloater::getFloaterByHandle(corep->mLiveHelpHandle); | 711 | LLFloater* live_help_floater = LLFloater::getFloaterByHandle(corep->mLiveHelpHandle); |
705 | if (live_help_floater) | 712 | if (live_help_floater) |
@@ -710,11 +717,13 @@ void LLScriptEdCore::onClickBack(void* userdata) | |||
710 | browserp->navigateBack(); | 717 | browserp->navigateBack(); |
711 | } | 718 | } |
712 | } | 719 | } |
720 | #endif // LL_LIBXUL_ENABLED | ||
713 | } | 721 | } |
714 | 722 | ||
715 | //static | 723 | //static |
716 | void LLScriptEdCore::onClickForward(void* userdata) | 724 | void LLScriptEdCore::onClickForward(void* userdata) |
717 | { | 725 | { |
726 | #if LL_LIBXUL_ENABLED | ||
718 | LLScriptEdCore* corep = (LLScriptEdCore*)userdata; | 727 | LLScriptEdCore* corep = (LLScriptEdCore*)userdata; |
719 | LLFloater* live_help_floater = LLFloater::getFloaterByHandle(corep->mLiveHelpHandle); | 728 | LLFloater* live_help_floater = LLFloater::getFloaterByHandle(corep->mLiveHelpHandle); |
720 | if (live_help_floater) | 729 | if (live_help_floater) |
@@ -725,6 +734,7 @@ void LLScriptEdCore::onClickForward(void* userdata) | |||
725 | browserp->navigateForward(); | 734 | browserp->navigateForward(); |
726 | } | 735 | } |
727 | } | 736 | } |
737 | #endif // LL_LIBXUL_ENABLED | ||
728 | } | 738 | } |
729 | 739 | ||
730 | // static | 740 | // static |
@@ -757,16 +767,17 @@ void LLScriptEdCore::onHelpComboCommit(LLUICtrl* ctrl, void* userdata) | |||
757 | LLFloater* live_help_floater = LLFloater::getFloaterByHandle(corep->mLiveHelpHandle); | 767 | LLFloater* live_help_floater = LLFloater::getFloaterByHandle(corep->mLiveHelpHandle); |
758 | if (live_help_floater) | 768 | if (live_help_floater) |
759 | { | 769 | { |
760 | LLWebBrowserCtrl* web_browser = gUICtrlFactory->getWebBrowserCtrlByName(live_help_floater, "lsl_guide_html"); | ||
761 | |||
762 | LLString help_string = ctrl->getValue().asString(); | 770 | LLString help_string = ctrl->getValue().asString(); |
763 | 771 | ||
764 | corep->addHelpItemToHistory(help_string); | 772 | corep->addHelpItemToHistory(help_string); |
765 | 773 | ||
774 | #if LL_LIBXUL_ENABLED | ||
775 | LLWebBrowserCtrl* web_browser = gUICtrlFactory->getWebBrowserCtrlByName(live_help_floater, "lsl_guide_html"); | ||
766 | LLUIString url_string = gSavedSettings.getString("LSLHelpURL"); | 776 | LLUIString url_string = gSavedSettings.getString("LSLHelpURL"); |
767 | url_string.setArg("[APP_DIRECTORY]", gDirUtilp->getWorkingDir()); | 777 | url_string.setArg("[APP_DIRECTORY]", gDirUtilp->getWorkingDir()); |
768 | url_string.setArg("[LSL_STRING]", help_string); | 778 | url_string.setArg("[LSL_STRING]", help_string); |
769 | web_browser->navigateTo(url_string); | 779 | web_browser->navigateTo(url_string); |
780 | #endif // LL_LIBXUL_ENABLED | ||
770 | } | 781 | } |
771 | } | 782 | } |
772 | 783 | ||
@@ -1336,10 +1347,6 @@ void LLPreviewLSL::uploadAssetLegacy(const std::string& filename, | |||
1336 | { | 1347 | { |
1337 | break; | 1348 | break; |
1338 | } | 1349 | } |
1339 | else if(!buffer) | ||
1340 | { | ||
1341 | continue; | ||
1342 | } | ||
1343 | else | 1350 | else |
1344 | { | 1351 | { |
1345 | line.assign(buffer); | 1352 | line.assign(buffer); |
@@ -1709,7 +1716,7 @@ void LLLiveLSLEditor::loadAsset(BOOL is_new) | |||
1709 | mScriptEd->mEditor->setEnabled(FALSE); | 1716 | mScriptEd->mEditor->setEnabled(FALSE); |
1710 | mAssetStatus = PREVIEW_ASSET_LOADED; | 1717 | mAssetStatus = PREVIEW_ASSET_LOADED; |
1711 | } | 1718 | } |
1712 | else if(mItem.notNull()) | 1719 | else if(item && mItem.notNull()) |
1713 | { | 1720 | { |
1714 | // request the text from the object | 1721 | // request the text from the object |
1715 | LLUUID* user_data = new LLUUID(mItemID ^ mObjectID); | 1722 | LLUUID* user_data = new LLUUID(mItemID ^ mObjectID); |
@@ -1835,6 +1842,7 @@ void LLLiveLSLEditor::loadScriptText(const char* filename) | |||
1835 | if(!filename) | 1842 | if(!filename) |
1836 | { | 1843 | { |
1837 | llerrs << "Filename is Empty!" << llendl; | 1844 | llerrs << "Filename is Empty!" << llendl; |
1845 | return; | ||
1838 | } | 1846 | } |
1839 | FILE* file = LLFile::fopen(filename, "rb"); /*Flawfinder: ignore*/ | 1847 | FILE* file = LLFile::fopen(filename, "rb"); /*Flawfinder: ignore*/ |
1840 | if(file) | 1848 | if(file) |
@@ -2115,10 +2123,6 @@ void LLLiveLSLEditor::uploadAssetLegacy(const std::string& filename, | |||
2115 | { | 2123 | { |
2116 | break; | 2124 | break; |
2117 | } | 2125 | } |
2118 | else if(!buffer) | ||
2119 | { | ||
2120 | continue; | ||
2121 | } | ||
2122 | else | 2126 | else |
2123 | { | 2127 | { |
2124 | line.assign(buffer); | 2128 | line.assign(buffer); |
diff --git a/linden/indra/newview/llpreviewtexture.cpp b/linden/indra/newview/llpreviewtexture.cpp index 27a9b52..b59846d 100644 --- a/linden/indra/newview/llpreviewtexture.cpp +++ b/linden/indra/newview/llpreviewtexture.cpp | |||
@@ -388,29 +388,23 @@ void LLPreviewTexture::updateAspectRatio() | |||
388 | // If that fails, cut width by half. | 388 | // If that fails, cut width by half. |
389 | S32 client_width = image_width; | 389 | S32 client_width = image_width; |
390 | S32 horiz_pad = 2 * (LLPANEL_BORDER_WIDTH + PREVIEW_PAD) + PREVIEW_RESIZE_HANDLE_SIZE; | 390 | S32 horiz_pad = 2 * (LLPANEL_BORDER_WIDTH + PREVIEW_PAD) + PREVIEW_RESIZE_HANDLE_SIZE; |
391 | S32 vert_pad = PREVIEW_HEADER_SIZE + 2 * CLIENT_RECT_VPAD + LLPANEL_BORDER_WIDTH; | ||
391 | S32 screen_width = gViewerWindow->getWindowWidth(); | 392 | S32 screen_width = gViewerWindow->getWindowWidth(); |
392 | S32 max_client_width = screen_width - horiz_pad; | 393 | S32 max_client_width = screen_width - horiz_pad; |
394 | S32 max_client_height = gViewerWindow->getWindowHeight() - vert_pad; | ||
395 | F32 inv_aspect_ratio = (F32) image_height / (F32) image_width; | ||
393 | 396 | ||
394 | while (client_width > max_client_width) | 397 | while ((client_width > max_client_width) || ( llround(client_width * inv_aspect_ratio) > max_client_height ) ) |
395 | { | 398 | { |
396 | client_width /= 2; | 399 | client_width /= 2; |
397 | } | 400 | } |
398 | 401 | ||
399 | // Demand width at least 128 | ||
400 | if (client_width < 128) | ||
401 | { | ||
402 | client_width = 128; | ||
403 | } | ||
404 | |||
405 | S32 view_width = client_width + horiz_pad; | 402 | S32 view_width = client_width + horiz_pad; |
406 | 403 | ||
407 | // Adjust the height based on the width computed above. | 404 | // Adjust the height based on the width computed above. |
408 | F32 inv_aspect_ratio = (F32) image_height / (F32) image_width; | ||
409 | S32 client_height = llround(client_width * inv_aspect_ratio); | 405 | S32 client_height = llround(client_width * inv_aspect_ratio); |
410 | S32 view_height = | 406 | S32 view_height = client_height + vert_pad; |
411 | PREVIEW_HEADER_SIZE + // header (includes top border) | 407 | |
412 | client_height + 2 * CLIENT_RECT_VPAD + // texture plus uniform spacing (which leaves room for resize handle) | ||
413 | LLPANEL_BORDER_WIDTH; // bottom border | ||
414 | 408 | ||
415 | // set text on dimensions display (should be moved out of here and into a callback of some sort) | 409 | // set text on dimensions display (should be moved out of here and into a callback of some sort) |
416 | childSetTextArg("dimensions", "[WIDTH]", llformat("%d", mImage->mFullWidth)); | 410 | childSetTextArg("dimensions", "[WIDTH]", llformat("%d", mImage->mFullWidth)); |
@@ -453,28 +447,43 @@ void LLPreviewTexture::updateAspectRatio() | |||
453 | } | 447 | } |
454 | } | 448 | } |
455 | 449 | ||
456 | // clamp texture size to fit within actual size of floater after attempting resize | 450 | |
457 | client_width = llmin(client_width, mRect.getWidth() - horiz_pad); | 451 | if (!mUserResized) |
458 | client_height = llmin(client_height, mRect.getHeight() - PREVIEW_HEADER_SIZE - (2 * CLIENT_RECT_VPAD) - LLPANEL_BORDER_WIDTH - info_height); | ||
459 | |||
460 | LLRect window_rect(0, mRect.getHeight(), mRect.getWidth(), 0); | ||
461 | window_rect.mTop -= (PREVIEW_HEADER_SIZE + CLIENT_RECT_VPAD); | ||
462 | window_rect.mBottom += PREVIEW_BORDER + button_height + CLIENT_RECT_VPAD + info_height + CLIENT_RECT_VPAD; | ||
463 | |||
464 | if (getHost()) | ||
465 | { | 452 | { |
466 | // try to keep aspect ratio when hosted, as hosting view can resize without user input | 453 | // clamp texture size to fit within actual size of floater after attempting resize |
467 | mClientRect.setLeftTopAndSize(window_rect.getCenterX() - (client_width / 2), window_rect.mTop, client_width, client_height); | 454 | client_width = llmin(client_width, mRect.getWidth() - horiz_pad); |
455 | client_height = llmin(client_height, mRect.getHeight() - PREVIEW_HEADER_SIZE | ||
456 | - (2 * CLIENT_RECT_VPAD) - LLPANEL_BORDER_WIDTH - info_height); | ||
457 | |||
458 | |||
468 | } | 459 | } |
469 | else | 460 | else |
470 | { | 461 | { |
471 | mClientRect.setLeftTopAndSize(LLPANEL_BORDER_WIDTH + PREVIEW_PAD + 6, | 462 | client_width = mRect.getWidth() - horiz_pad; |
472 | mRect.getHeight() - (PREVIEW_HEADER_SIZE + CLIENT_RECT_VPAD), | 463 | client_height = llround(client_width * inv_aspect_ratio); |
473 | mRect.getWidth() - horiz_pad, | 464 | } |
474 | client_height); | 465 | |
466 | |||
467 | S32 max_height = mRect.getHeight() - PREVIEW_BORDER - button_height | ||
468 | - CLIENT_RECT_VPAD - info_height - CLIENT_RECT_VPAD - PREVIEW_HEADER_SIZE; | ||
469 | max_height = llmax(max_height, 1); | ||
470 | |||
471 | if (client_height > max_height) | ||
472 | { | ||
473 | F32 aspect_ratio = (F32) image_width / (F32) image_height; | ||
474 | client_height = max_height; | ||
475 | client_width = llround(client_height * aspect_ratio); | ||
475 | } | 476 | } |
477 | |||
478 | LLRect window_rect(0, mRect.getHeight(), mRect.getWidth(), 0); | ||
479 | window_rect.mTop -= (PREVIEW_HEADER_SIZE + CLIENT_RECT_VPAD); | ||
480 | window_rect.mBottom += PREVIEW_BORDER + button_height + CLIENT_RECT_VPAD + info_height + CLIENT_RECT_VPAD; | ||
481 | |||
482 | // try to keep aspect ratio when hosted, as hosting view can resize without user input | ||
483 | mClientRect.setLeftTopAndSize(window_rect.getCenterX() - (client_width / 2), window_rect.mTop, client_width, client_height); | ||
476 | } | 484 | } |
477 | 485 | ||
486 | |||
478 | void LLPreviewTexture::loadAsset() | 487 | void LLPreviewTexture::loadAsset() |
479 | { | 488 | { |
480 | mImage = gImageList.getImage(mImageID, MIPMAP_TRUE, FALSE); | 489 | mImage = gImageList.getImage(mImageID, MIPMAP_TRUE, FALSE); |
diff --git a/linden/indra/newview/llresourcedata.h b/linden/indra/newview/llresourcedata.h new file mode 100644 index 0000000..9f5d329 --- /dev/null +++ b/linden/indra/newview/llresourcedata.h | |||
@@ -0,0 +1,44 @@ | |||
1 | /** | ||
2 | * @file llresourcedata.h | ||
3 | * @brief Tracking object for uploads. | ||
4 | * | ||
5 | * Copyright (c) 2006-2007, Linden Research, Inc. | ||
6 | * | ||
7 | * Second Life Viewer Source Code | ||
8 | * The source code in this file ("Source Code") is provided by Linden Lab | ||
9 | * to you under the terms of the GNU General Public License, version 2.0 | ||
10 | * ("GPL"), unless you have obtained a separate licensing agreement | ||
11 | * ("Other License"), formally executed by you and Linden Lab. Terms of | ||
12 | * the GPL can be found in doc/GPL-license.txt in this distribution, or | ||
13 | * online at http://secondlife.com/developers/opensource/gplv2 | ||
14 | * | ||
15 | * There are special exceptions to the terms and conditions of the GPL as | ||
16 | * it is applied to this Source Code. View the full text of the exception | ||
17 | * in the file doc/FLOSS-exception.txt in this software distribution, or | ||
18 | * online at http://secondlife.com/developers/opensource/flossexception | ||
19 | * | ||
20 | * By copying, modifying or distributing this software, you acknowledge | ||
21 | * that you have read and understood your obligations described above, | ||
22 | * and agree to abide by those obligations. | ||
23 | * | ||
24 | * ALL LINDEN LAB SOURCE CODE IS PROVIDED "AS IS." LINDEN LAB MAKES NO | ||
25 | * WARRANTIES, EXPRESS, IMPLIED OR OTHERWISE, REGARDING ITS ACCURACY, | ||
26 | * COMPLETENESS OR PERFORMANCE. | ||
27 | */ | ||
28 | |||
29 | #ifndef LLRESOURCEDATA_H | ||
30 | #define LLRESOURCEDATA_H | ||
31 | |||
32 | #include "llassetstorage.h" | ||
33 | #include "llinventorytype.h" | ||
34 | |||
35 | struct LLResourceData | ||
36 | { | ||
37 | LLAssetInfo mAssetInfo; | ||
38 | LLAssetType::EType mPreferredLocation; | ||
39 | LLInventoryType::EType mInventoryType; | ||
40 | U32 mNextOwnerPerm; | ||
41 | void *mUserData; | ||
42 | }; | ||
43 | |||
44 | #endif | ||
diff --git a/linden/indra/newview/llselectmgr.cpp b/linden/indra/newview/llselectmgr.cpp index 598ded9..ec7ba78 100644 --- a/linden/indra/newview/llselectmgr.cpp +++ b/linden/indra/newview/llselectmgr.cpp | |||
@@ -91,7 +91,6 @@ const S32 MAX_ACTION_QUEUE_SIZE = 20; | |||
91 | const S32 MAX_SILS_PER_FRAME = 50; | 91 | const S32 MAX_SILS_PER_FRAME = 50; |
92 | const S32 MAX_OBJECTS_PER_PACKET = 254; | 92 | const S32 MAX_OBJECTS_PER_PACKET = 254; |
93 | 93 | ||
94 | extern LLGlobalEconomy *gGlobalEconomy; | ||
95 | extern LLUUID gLastHitObjectID; | 94 | extern LLUUID gLastHitObjectID; |
96 | extern LLVector3d gLastHitObjectOffset; | 95 | extern LLVector3d gLastHitObjectOffset; |
97 | 96 | ||
@@ -208,6 +207,20 @@ LLSelectMgr::~LLSelectMgr() | |||
208 | 207 | ||
209 | void LLSelectMgr::updateEffects() | 208 | void LLSelectMgr::updateEffects() |
210 | { | 209 | { |
210 | |||
211 | //keep reference grid objects active | ||
212 | for (LLSelectNode* grid_nodep = mGridObjects.getFirstNode(); | ||
213 | grid_nodep; | ||
214 | grid_nodep = mGridObjects.getNextNode()) | ||
215 | { | ||
216 | LLViewerObject* grid_object = grid_nodep->getObject(); | ||
217 | LLDrawable* drawable = grid_object->mDrawable; | ||
218 | if (drawable) | ||
219 | { | ||
220 | gPipeline.markMoved(drawable); | ||
221 | } | ||
222 | } | ||
223 | |||
211 | if (mEffectsTimer.getElapsedTimeF32() > 1.f) | 224 | if (mEffectsTimer.getElapsedTimeF32() > 1.f) |
212 | { | 225 | { |
213 | mSelectedObjects->updateEffects(); | 226 | mSelectedObjects->updateEffects(); |
@@ -993,7 +1006,7 @@ void LLSelectMgr::getGrid(LLVector3& origin, LLQuaternion &rotation, LLVector3 & | |||
993 | LLVector3 first_grid_obj_pos = grid_object->getRenderPosition(); | 1006 | LLVector3 first_grid_obj_pos = grid_object->getRenderPosition(); |
994 | 1007 | ||
995 | LLVector3 min_extents(F32_MAX, F32_MAX, F32_MAX); | 1008 | LLVector3 min_extents(F32_MAX, F32_MAX, F32_MAX); |
996 | LLVector3 max_extents(F32_MIN, F32_MIN, F32_MIN); | 1009 | LLVector3 max_extents(-min_extents); |
997 | BOOL grid_changed = FALSE; | 1010 | BOOL grid_changed = FALSE; |
998 | LLSelectNode* grid_nodep; | 1011 | LLSelectNode* grid_nodep; |
999 | for (grid_nodep = mGridObjects.getFirstNode(); | 1012 | for (grid_nodep = mGridObjects.getFirstNode(); |
@@ -1001,34 +1014,23 @@ void LLSelectMgr::getGrid(LLVector3& origin, LLQuaternion &rotation, LLVector3 & | |||
1001 | grid_nodep = mGridObjects.getNextNode()) | 1014 | grid_nodep = mGridObjects.getNextNode()) |
1002 | { | 1015 | { |
1003 | grid_object = grid_nodep->getObject(); | 1016 | grid_object = grid_nodep->getObject(); |
1004 | 1017 | LLDrawable* drawable = grid_object->mDrawable; | |
1005 | LLVector3 local_min_extents(F32_MAX, F32_MAX, F32_MAX); | 1018 | if (drawable) |
1006 | LLVector3 local_max_extents(F32_MIN, F32_MIN, F32_MIN); | ||
1007 | |||
1008 | // *FIX: silhouette flag is insufficient as it gets | ||
1009 | // cleared by view update. | ||
1010 | if (!mGridValid || | ||
1011 | grid_object->isChanged(LLXform::SILHOUETTE) | ||
1012 | || (grid_object->getParent() && grid_object->getParent()->isChanged(LLXform::SILHOUETTE))) | ||
1013 | { | 1019 | { |
1014 | getSilhouetteExtents(grid_nodep, mGridRotation, local_min_extents, local_max_extents); | 1020 | const LLVector3* ext = drawable->getSpatialExtents(); |
1021 | update_min_max(min_extents, max_extents, ext[0]); | ||
1022 | update_min_max(min_extents, max_extents, ext[1]); | ||
1015 | grid_changed = TRUE; | 1023 | grid_changed = TRUE; |
1016 | LLVector3 object_offset = (grid_object->getRenderPosition() - first_grid_obj_pos) * ~mGridRotation; | ||
1017 | local_min_extents += object_offset; | ||
1018 | local_max_extents += object_offset; | ||
1019 | } | 1024 | } |
1020 | min_extents.mV[VX] = llmin(min_extents.mV[VX], local_min_extents.mV[VX]); | ||
1021 | min_extents.mV[VY] = llmin(min_extents.mV[VY], local_min_extents.mV[VY]); | ||
1022 | min_extents.mV[VZ] = llmin(min_extents.mV[VZ], local_min_extents.mV[VZ]); | ||
1023 | max_extents.mV[VX] = llmax(max_extents.mV[VX], local_max_extents.mV[VX]); | ||
1024 | max_extents.mV[VY] = llmax(max_extents.mV[VY], local_max_extents.mV[VY]); | ||
1025 | max_extents.mV[VZ] = llmax(max_extents.mV[VZ], local_max_extents.mV[VZ]); | ||
1026 | } | 1025 | } |
1027 | if (grid_changed) | 1026 | if (grid_changed) |
1028 | { | 1027 | { |
1029 | mGridOrigin = lerp(min_extents, max_extents, 0.5f); | 1028 | mGridOrigin = lerp(min_extents, max_extents, 0.5f); |
1030 | mGridOrigin = mGridOrigin * ~mGridRotation; | 1029 | LLDrawable* drawable = grid_object->mDrawable; |
1031 | mGridOrigin += first_grid_obj_pos; | 1030 | if (drawable && drawable->isActive()) |
1031 | { | ||
1032 | mGridOrigin = mGridOrigin * grid_object->getRenderMatrix(); | ||
1033 | } | ||
1032 | mGridScale = (max_extents - min_extents) * 0.5f; | 1034 | mGridScale = (max_extents - min_extents) * 0.5f; |
1033 | } | 1035 | } |
1034 | } | 1036 | } |
@@ -4939,66 +4941,6 @@ void LLSelectMgr::generateSilhouette(LLSelectNode* nodep, const LLVector3& view_ | |||
4939 | } | 4941 | } |
4940 | } | 4942 | } |
4941 | 4943 | ||
4942 | void LLSelectMgr::getSilhouetteExtents(LLSelectNode* nodep, const LLQuaternion& orientation, LLVector3& min_extents, LLVector3& max_extents) | ||
4943 | { | ||
4944 | LLViewerObject* objectp = nodep->getObject(); | ||
4945 | |||
4946 | if (objectp->mDrawable.isNull()) | ||
4947 | { | ||
4948 | return; | ||
4949 | } | ||
4950 | |||
4951 | LLQuaternion test_rot = orientation * ~objectp->getRenderRotation(); | ||
4952 | LLVector3 x_axis_rot = LLVector3::x_axis * test_rot; | ||
4953 | LLVector3 y_axis_rot = LLVector3::y_axis * test_rot; | ||
4954 | LLVector3 z_axis_rot = LLVector3::z_axis * test_rot; | ||
4955 | |||
4956 | x_axis_rot.scaleVec(objectp->mDrawable->getScale()); | ||
4957 | y_axis_rot.scaleVec(objectp->mDrawable->getScale()); | ||
4958 | z_axis_rot.scaleVec(objectp->mDrawable->getScale()); | ||
4959 | |||
4960 | generateSilhouette(nodep, objectp->mDrawable->getPositionAgent() + x_axis_rot * 100.f); | ||
4961 | |||
4962 | S32 num_vertices = nodep->mSilhouetteVertices.size(); | ||
4963 | if (num_vertices) | ||
4964 | { | ||
4965 | min_extents.mV[VY] = llmin(min_extents.mV[VY], nodep->mSilhouetteVertices[0] * y_axis_rot); | ||
4966 | max_extents.mV[VY] = llmax(max_extents.mV[VY], nodep->mSilhouetteVertices[0] * y_axis_rot); | ||
4967 | |||
4968 | min_extents.mV[VZ] = llmin(min_extents.mV[VZ], nodep->mSilhouetteVertices[0] * z_axis_rot); | ||
4969 | max_extents.mV[VZ] = llmax(min_extents.mV[VZ], nodep->mSilhouetteVertices[0] * z_axis_rot); | ||
4970 | |||
4971 | for (S32 vert = 1; vert < num_vertices; vert++) | ||
4972 | { | ||
4973 | F32 y_pos = nodep->mSilhouetteVertices[vert] * y_axis_rot; | ||
4974 | F32 z_pos = nodep->mSilhouetteVertices[vert] * z_axis_rot; | ||
4975 | min_extents.mV[VY] = llmin(y_pos, min_extents.mV[VY]); | ||
4976 | max_extents.mV[VY] = llmax(y_pos, max_extents.mV[VY]); | ||
4977 | min_extents.mV[VZ] = llmin(z_pos, min_extents.mV[VZ]); | ||
4978 | max_extents.mV[VZ] = llmax(z_pos, max_extents.mV[VZ]); | ||
4979 | } | ||
4980 | } | ||
4981 | |||
4982 | generateSilhouette(nodep, objectp->mDrawable->getPositionAgent() + y_axis_rot * 100.f); | ||
4983 | |||
4984 | num_vertices = nodep->mSilhouetteVertices.size(); | ||
4985 | if (num_vertices) | ||
4986 | { | ||
4987 | min_extents.mV[VX] = llmin(min_extents.mV[VX], nodep->mSilhouetteVertices[0] * x_axis_rot); | ||
4988 | max_extents.mV[VX] = llmax(max_extents.mV[VX], nodep->mSilhouetteVertices[0] * x_axis_rot); | ||
4989 | |||
4990 | for (S32 vert = 1; vert < num_vertices; vert++) | ||
4991 | { | ||
4992 | F32 x_pos = nodep->mSilhouetteVertices[vert] * x_axis_rot; | ||
4993 | min_extents.mV[VX] = llmin(x_pos, min_extents.mV[VX]); | ||
4994 | max_extents.mV[VX] = llmax(x_pos, max_extents.mV[VX]); | ||
4995 | } | ||
4996 | } | ||
4997 | |||
4998 | generateSilhouette(nodep, gCamera->getOrigin()); | ||
4999 | } | ||
5000 | |||
5001 | |||
5002 | // | 4944 | // |
5003 | // Utility classes | 4945 | // Utility classes |
5004 | // | 4946 | // |
@@ -6479,6 +6421,8 @@ LLViewerObject* LLObjectSelection::getFirstDeleteableObject(BOOL get_root) | |||
6479 | } | 6421 | } |
6480 | else | 6422 | else |
6481 | { | 6423 | { |
6424 | // We've avoided this path for a while. It may not work. | ||
6425 | llwarns << "!get_root code path may have bitrotted." << llendl; | ||
6482 | for(LLViewerObject* current = getFirstObject(); | 6426 | for(LLViewerObject* current = getFirstObject(); |
6483 | current != NULL; | 6427 | current != NULL; |
6484 | current = getNextObject()) | 6428 | current = getNextObject()) |
diff --git a/linden/indra/newview/llselectmgr.h b/linden/indra/newview/llselectmgr.h index 98c0a7b..96db8e5 100644 --- a/linden/indra/newview/llselectmgr.h +++ b/linden/indra/newview/llselectmgr.h | |||
@@ -492,7 +492,6 @@ private: | |||
492 | ESelectType getSelectTypeForObject(LLViewerObject* object); | 492 | ESelectType getSelectTypeForObject(LLViewerObject* object); |
493 | void addAsFamily(LLDynamicArray<LLViewerObject*>& objects, BOOL add_to_end = FALSE); | 493 | void addAsFamily(LLDynamicArray<LLViewerObject*>& objects, BOOL add_to_end = FALSE); |
494 | void generateSilhouette(LLSelectNode *nodep, const LLVector3& view_point); | 494 | void generateSilhouette(LLSelectNode *nodep, const LLVector3& view_point); |
495 | void getSilhouetteExtents(LLSelectNode* nodep, const LLQuaternion& orientation, LLVector3& min_extents, LLVector3& max_extents); | ||
496 | // Send one message to each region containing an object on selection list. | 495 | // Send one message to each region containing an object on selection list. |
497 | void sendListToRegions( const LLString& message_name, | 496 | void sendListToRegions( const LLString& message_name, |
498 | void (*pack_header)(void *user_data), | 497 | void (*pack_header)(void *user_data), |
diff --git a/linden/indra/newview/llspatialpartition.cpp b/linden/indra/newview/llspatialpartition.cpp index 46b9df9..d62a93e 100644 --- a/linden/indra/newview/llspatialpartition.cpp +++ b/linden/indra/newview/llspatialpartition.cpp | |||
@@ -1180,6 +1180,13 @@ void LLSpatialPartition::move(LLDrawable *drawablep, LLSpatialGroup *curp, BOOL | |||
1180 | { | 1180 | { |
1181 | LLMemType mt(LLMemType::MTYPE_SPACE_PARTITION); | 1181 | LLMemType mt(LLMemType::MTYPE_SPACE_PARTITION); |
1182 | LLFastTimer t(LLFastTimer::FTM_UPDATE_MOVE); | 1182 | LLFastTimer t(LLFastTimer::FTM_UPDATE_MOVE); |
1183 | |||
1184 | // sanity check submitted by open source user bushing Spatula | ||
1185 | // who was seeing crashing here. (See VWR-424 reported by Bunny Mayne) | ||
1186 | if (!drawablep) { | ||
1187 | OCT_ERRS << "LLSpatialPartition::move was passed a bad drawable." << llendl; | ||
1188 | return; | ||
1189 | } | ||
1183 | 1190 | ||
1184 | BOOL was_visible = curp ? curp->isVisible() : FALSE; | 1191 | BOOL was_visible = curp ? curp->isVisible() : FALSE; |
1185 | 1192 | ||
diff --git a/linden/indra/newview/llstartup.cpp b/linden/indra/newview/llstartup.cpp index 585f769..e83aa0d 100644 --- a/linden/indra/newview/llstartup.cpp +++ b/linden/indra/newview/llstartup.cpp | |||
@@ -203,6 +203,7 @@ LLPointer<LLImageGL> gStartImageGL; | |||
203 | static LLHost gAgentSimHost; | 203 | static LLHost gAgentSimHost; |
204 | static BOOL gSkipOptionalUpdate = FALSE; | 204 | static BOOL gSkipOptionalUpdate = FALSE; |
205 | 205 | ||
206 | bool gUseQuickTime = true; | ||
206 | bool gQuickTimeInitialized = false; | 207 | bool gQuickTimeInitialized = false; |
207 | static bool gGotUseCircuitCodeAck = false; | 208 | static bool gGotUseCircuitCodeAck = false; |
208 | LLString gInitialOutfit; | 209 | LLString gInitialOutfit; |
@@ -1867,7 +1868,8 @@ BOOL idle_startup() | |||
1867 | } | 1868 | } |
1868 | 1869 | ||
1869 | #if LL_QUICKTIME_ENABLED // windows only right now but will be ported to mac | 1870 | #if LL_QUICKTIME_ENABLED // windows only right now but will be ported to mac |
1870 | if (!gQuickTimeInitialized) | 1871 | if (gUseQuickTime |
1872 | && !gQuickTimeInitialized) | ||
1871 | { | 1873 | { |
1872 | // initialize quicktime libraries (fails gracefully if quicktime not installed ($QUICKTIME) | 1874 | // initialize quicktime libraries (fails gracefully if quicktime not installed ($QUICKTIME) |
1873 | llinfos << "Initializing QuickTime...." << llendl; | 1875 | llinfos << "Initializing QuickTime...." << llendl; |
diff --git a/linden/indra/newview/llstartup.h b/linden/indra/newview/llstartup.h index 59a433e..7c54b8c 100644 --- a/linden/indra/newview/llstartup.h +++ b/linden/indra/newview/llstartup.h | |||
@@ -82,6 +82,7 @@ enum EStartupState{ | |||
82 | // exorted symbol | 82 | // exorted symbol |
83 | extern S32 gStartupState; | 83 | extern S32 gStartupState; |
84 | extern BOOL gAgentMovementCompleted; | 84 | extern BOOL gAgentMovementCompleted; |
85 | extern bool gUseQuickTime; | ||
85 | extern bool gQuickTimeInitialized; | 86 | extern bool gQuickTimeInitialized; |
86 | extern LLPointer<LLImageGL> gStartImageGL; | 87 | extern LLPointer<LLImageGL> gStartImageGL; |
87 | 88 | ||
diff --git a/linden/indra/newview/llstatusbar.cpp b/linden/indra/newview/llstatusbar.cpp index 58ac8c2..784765b 100644 --- a/linden/indra/newview/llstatusbar.cpp +++ b/linden/indra/newview/llstatusbar.cpp | |||
@@ -643,3 +643,8 @@ void LLStatusBar::onClickBuyLand(void*) | |||
643 | gParcelMgr->selectParcelAt(gAgent.getPositionGlobal()); | 643 | gParcelMgr->selectParcelAt(gAgent.getPositionGlobal()); |
644 | gParcelMgr->startBuyLand(); | 644 | gParcelMgr->startBuyLand(); |
645 | } | 645 | } |
646 | |||
647 | BOOL can_afford_transaction(S32 cost) | ||
648 | { | ||
649 | return((cost <= 0)||((gStatusBar) && (gStatusBar->getBalance() >=cost))); | ||
650 | } | ||
diff --git a/linden/indra/newview/llstatusbar.h b/linden/indra/newview/llstatusbar.h index 52cc236..a072cd9 100644 --- a/linden/indra/newview/llstatusbar.h +++ b/linden/indra/newview/llstatusbar.h | |||
@@ -123,6 +123,9 @@ protected: | |||
123 | LLFrameTimer* mHealthTimer; | 123 | LLFrameTimer* mHealthTimer; |
124 | }; | 124 | }; |
125 | 125 | ||
126 | // *HACK: Status bar owns your cached money balance. JC | ||
127 | BOOL can_afford_transaction(S32 cost); | ||
128 | |||
126 | extern LLStatusBar *gStatusBar; | 129 | extern LLStatusBar *gStatusBar; |
127 | 130 | ||
128 | #endif | 131 | #endif |
diff --git a/linden/indra/newview/lltexlayer.cpp b/linden/indra/newview/lltexlayer.cpp index 237d563..2005e39 100644 --- a/linden/indra/newview/lltexlayer.cpp +++ b/linden/indra/newview/lltexlayer.cpp | |||
@@ -277,7 +277,7 @@ BOOL LLTexLayerSetBuffer::render() | |||
277 | { | 277 | { |
278 | if (!success) | 278 | if (!success) |
279 | { | 279 | { |
280 | delete baked_bump_data; | 280 | delete [] baked_bump_data; |
281 | llinfos << "Failed attempt to bake " << mTexLayerSet->getBodyRegion() << llendl; | 281 | llinfos << "Failed attempt to bake " << mTexLayerSet->getBodyRegion() << llendl; |
282 | mUploadPending = FALSE; | 282 | mUploadPending = FALSE; |
283 | } | 283 | } |
diff --git a/linden/indra/newview/lltexturectrl.cpp b/linden/indra/newview/lltexturectrl.cpp index 1436b62..b5c1ace 100644 --- a/linden/indra/newview/lltexturectrl.cpp +++ b/linden/indra/newview/lltexturectrl.cpp | |||
@@ -410,32 +410,35 @@ BOOL LLFloaterTexturePicker::handleKeyHere(KEY key, MASK mask, BOOL called_from_ | |||
410 | { | 410 | { |
411 | LLFolderView* root_folder = mInventoryPanel->getRootFolder(); | 411 | LLFolderView* root_folder = mInventoryPanel->getRootFolder(); |
412 | 412 | ||
413 | if (!called_from_parent && root_folder && | 413 | if (root_folder && mSearchEdit) |
414 | mSearchEdit && mSearchEdit->hasFocus() && | ||
415 | (key == KEY_RETURN || key == KEY_DOWN) && mask == MASK_NONE) | ||
416 | { | 414 | { |
417 | if (!root_folder->getCurSelectedItem()) | 415 | if (!called_from_parent && mSearchEdit->hasFocus() && |
416 | (key == KEY_RETURN || key == KEY_DOWN) && | ||
417 | mask == MASK_NONE) | ||
418 | { | 418 | { |
419 | LLFolderViewItem* itemp = root_folder->getItemByID(gAgent.getInventoryRootID()); | 419 | if (!root_folder->getCurSelectedItem()) |
420 | if (itemp) | ||
421 | { | 420 | { |
422 | root_folder->setSelection(itemp, FALSE, FALSE); | 421 | LLFolderViewItem* itemp = root_folder->getItemByID(gAgent.getInventoryRootID()); |
422 | if (itemp) | ||
423 | { | ||
424 | root_folder->setSelection(itemp, FALSE, FALSE); | ||
425 | } | ||
423 | } | 426 | } |
427 | root_folder->scrollToShowSelection(); | ||
428 | |||
429 | // move focus to inventory proper | ||
430 | root_folder->setFocus(TRUE); | ||
431 | |||
432 | // treat this as a user selection of the first filtered result | ||
433 | commitIfImmediateSet(); | ||
434 | |||
435 | return TRUE; | ||
424 | } | 436 | } |
425 | root_folder->scrollToShowSelection(); | ||
426 | |||
427 | // move focus to inventory proper | ||
428 | root_folder->setFocus(TRUE); | ||
429 | 437 | ||
430 | // treat this as a user selection of the first filtered result | 438 | if (root_folder->hasFocus() && key == KEY_UP) |
431 | commitIfImmediateSet(); | 439 | { |
432 | 440 | mSearchEdit->focusFirstItem(TRUE); | |
433 | return TRUE; | 441 | } |
434 | } | ||
435 | |||
436 | if (root_folder->hasFocus() && key == KEY_UP) | ||
437 | { | ||
438 | mSearchEdit->focusFirstItem(TRUE); | ||
439 | } | 442 | } |
440 | 443 | ||
441 | return LLFloater::handleKeyHere(key, mask, called_from_parent); | 444 | return LLFloater::handleKeyHere(key, mask, called_from_parent); |
diff --git a/linden/indra/newview/lltooldraganddrop.cpp b/linden/indra/newview/lltooldraganddrop.cpp index 3956402..6196927 100644 --- a/linden/indra/newview/lltooldraganddrop.cpp +++ b/linden/indra/newview/lltooldraganddrop.cpp | |||
@@ -2575,7 +2575,13 @@ EAcceptance LLToolDragAndDrop::dad3dUpdateInventoryCategory( | |||
2575 | LLViewerObject* obj, S32 face, MASK mask, BOOL drop) | 2575 | LLViewerObject* obj, S32 face, MASK mask, BOOL drop) |
2576 | { | 2576 | { |
2577 | lldebugs << "LLToolDragAndDrop::dad3dUpdateInventoryCategory()" << llendl; | 2577 | lldebugs << "LLToolDragAndDrop::dad3dUpdateInventoryCategory()" << llendl; |
2578 | if(mSource != SOURCE_AGENT && mSource != SOURCE_LIBRARY) | 2578 | if (NULL==obj) |
2579 | { | ||
2580 | llwarns << "obj is NULL; aborting func with ACCEPT_NO" << llendl; | ||
2581 | return ACCEPT_NO; | ||
2582 | } | ||
2583 | |||
2584 | if (mSource != SOURCE_AGENT && mSource != SOURCE_LIBRARY) | ||
2579 | { | 2585 | { |
2580 | return ACCEPT_NO; | 2586 | return ACCEPT_NO; |
2581 | } | 2587 | } |
@@ -2591,17 +2597,17 @@ EAcceptance LLToolDragAndDrop::dad3dUpdateInventoryCategory( | |||
2591 | LLInventoryModel::cat_array_t cats; | 2597 | LLInventoryModel::cat_array_t cats; |
2592 | LLInventoryModel::item_array_t items; | 2598 | LLInventoryModel::item_array_t items; |
2593 | gInventory.collectDescendentsIf(cat->getUUID(), | 2599 | gInventory.collectDescendentsIf(cat->getUUID(), |
2594 | cats, | 2600 | cats, |
2595 | items, | 2601 | items, |
2596 | LLInventoryModel::EXCLUDE_TRASH, | 2602 | LLInventoryModel::EXCLUDE_TRASH, |
2597 | droppable); | 2603 | droppable); |
2598 | cats.put(cat); | 2604 | cats.put(cat); |
2599 | if(droppable.countNoCopy() > 0) | 2605 | if(droppable.countNoCopy() > 0) |
2600 | { | 2606 | { |
2601 | llwarns << "*** Need to confirm this step" << llendl; | 2607 | llwarns << "*** Need to confirm this step" << llendl; |
2602 | } | 2608 | } |
2603 | LLViewerObject* root_object = obj; | 2609 | LLViewerObject* root_object = obj; |
2604 | if (obj && obj->getParent()) | 2610 | if (obj->getParent()) |
2605 | { | 2611 | { |
2606 | LLViewerObject* parent_obj = (LLViewerObject*)obj->getParent(); | 2612 | LLViewerObject* parent_obj = (LLViewerObject*)obj->getParent(); |
2607 | if (!parent_obj->isAvatar()) | 2613 | if (!parent_obj->isAvatar()) |
diff --git a/linden/indra/newview/lltoolgrab.cpp b/linden/indra/newview/lltoolgrab.cpp index 502e2be..b56e762 100644 --- a/linden/indra/newview/lltoolgrab.cpp +++ b/linden/indra/newview/lltoolgrab.cpp | |||
@@ -180,6 +180,12 @@ BOOL LLToolGrab::handleObjectHit(LLViewerObject *objectp, S32 x, S32 y, MASK mas | |||
180 | llinfos << "LLToolGrab handleObjectHit " << mMouseDownX << "," << mMouseDownY << llendl; | 180 | llinfos << "LLToolGrab handleObjectHit " << mMouseDownX << "," << mMouseDownY << llendl; |
181 | } | 181 | } |
182 | 182 | ||
183 | if (NULL == objectp) // unexpected | ||
184 | { | ||
185 | llwarns << "objectp was NULL; returning FALSE" << llendl; | ||
186 | return FALSE; | ||
187 | } | ||
188 | |||
183 | if (objectp->isAvatar()) | 189 | if (objectp->isAvatar()) |
184 | { | 190 | { |
185 | if (gGrabTransientTool) | 191 | if (gGrabTransientTool) |
@@ -198,7 +204,7 @@ BOOL LLToolGrab::handleObjectHit(LLViewerObject *objectp, S32 x, S32 y, MASK mas | |||
198 | // objectp = (LLViewerObject *)objectp->getRoot(); | 204 | // objectp = (LLViewerObject *)objectp->getRoot(); |
199 | 205 | ||
200 | LLViewerObject* parent = objectp->getRootEdit(); | 206 | LLViewerObject* parent = objectp->getRootEdit(); |
201 | BOOL script_touch = (objectp && objectp->flagHandleTouch()) || (parent && parent->flagHandleTouch()); | 207 | BOOL script_touch = (objectp->flagHandleTouch()) || (parent && parent->flagHandleTouch()); |
202 | 208 | ||
203 | // Clicks on scripted or physical objects are temporary grabs, so | 209 | // Clicks on scripted or physical objects are temporary grabs, so |
204 | // not "Build mode" | 210 | // not "Build mode" |
diff --git a/linden/indra/newview/lltoolpie.cpp b/linden/indra/newview/lltoolpie.cpp index adc46e2..7231286 100644 --- a/linden/indra/newview/lltoolpie.cpp +++ b/linden/indra/newview/lltoolpie.cpp | |||
@@ -390,11 +390,11 @@ U8 final_click_action(LLViewerObject* obj) | |||
390 | if (obj->isAttachment()) return CLICK_ACTION_NONE; | 390 | if (obj->isAttachment()) return CLICK_ACTION_NONE; |
391 | 391 | ||
392 | U8 click_action = CLICK_ACTION_TOUCH; | 392 | U8 click_action = CLICK_ACTION_TOUCH; |
393 | LLViewerObject* parent = (obj ? obj->getRootEdit() : NULL); | 393 | LLViewerObject* parent = obj->getRootEdit(); |
394 | if ((obj && obj->getClickAction()) | 394 | if (obj->getClickAction() |
395 | || (parent && parent->getClickAction())) | 395 | || (parent && parent->getClickAction())) |
396 | { | 396 | { |
397 | if (obj && obj->getClickAction()) | 397 | if (obj->getClickAction()) |
398 | { | 398 | { |
399 | click_action = obj->getClickAction(); | 399 | click_action = obj->getClickAction(); |
400 | } | 400 | } |
diff --git a/linden/indra/newview/lltoolpipette.cpp b/linden/indra/newview/lltoolpipette.cpp index 139afc2..139afc2 100755..100644 --- a/linden/indra/newview/lltoolpipette.cpp +++ b/linden/indra/newview/lltoolpipette.cpp | |||
diff --git a/linden/indra/newview/lltoolpipette.h b/linden/indra/newview/lltoolpipette.h index 1351084..1351084 100755..100644 --- a/linden/indra/newview/lltoolpipette.h +++ b/linden/indra/newview/lltoolpipette.h | |||
diff --git a/linden/indra/newview/llviewerassetstorage.cpp b/linden/indra/newview/llviewerassetstorage.cpp index c7e9c97..95ef983 100644 --- a/linden/indra/newview/llviewerassetstorage.cpp +++ b/linden/indra/newview/llviewerassetstorage.cpp | |||
@@ -166,21 +166,22 @@ void LLViewerAssetStorage::storeAssetData( | |||
166 | if(!filename) | 166 | if(!filename) |
167 | { | 167 | { |
168 | llerrs << "No filename specified" << llendl; | 168 | llerrs << "No filename specified" << llendl; |
169 | return; | ||
169 | } | 170 | } |
170 | 171 | ||
171 | LLAssetID asset_id = tid.makeAssetID(gAgent.getSecureSessionID()); | 172 | LLAssetID asset_id = tid.makeAssetID(gAgent.getSecureSessionID()); |
172 | llinfos << "LLViewerAssetStorage::storeAssetData (legacy)" << asset_id << ":" << LLAssetType::lookup(asset_type) << llendl; | 173 | llinfos << "LLViewerAssetStorage::storeAssetData (legacy)" << asset_id << ":" << LLAssetType::lookup(asset_type) << llendl; |
173 | 174 | ||
174 | LLLegacyAssetRequest *legacy = new LLLegacyAssetRequest; | ||
175 | |||
176 | llinfos << "ASSET_ID: " << asset_id << llendl; | 175 | llinfos << "ASSET_ID: " << asset_id << llendl; |
177 | 176 | ||
178 | legacy->mUpCallback = callback; | 177 | FILE* fp = LLFile::fopen(filename, "rb"); |
179 | legacy->mUserData = user_data; | ||
180 | |||
181 | FILE* fp = LLFile::fopen(filename, "rb"); /* Flawfinder: ignore */ | ||
182 | if (fp) | 178 | if (fp) |
183 | { | 179 | { |
180 | LLLegacyAssetRequest *legacy = new LLLegacyAssetRequest; | ||
181 | |||
182 | legacy->mUpCallback = callback; | ||
183 | legacy->mUserData = user_data; | ||
184 | |||
184 | LLVFile file(mVFS, asset_id, asset_type, LLVFile::WRITE); | 185 | LLVFile file(mVFS, asset_id, asset_type, LLVFile::WRITE); |
185 | 186 | ||
186 | fseek(fp, 0, SEEK_END); | 187 | fseek(fp, 0, SEEK_END); |
diff --git a/linden/indra/newview/llviewercontrol.cpp b/linden/indra/newview/llviewercontrol.cpp index 61285d5..08abd2d 100644 --- a/linden/indra/newview/llviewercontrol.cpp +++ b/linden/indra/newview/llviewercontrol.cpp | |||
@@ -240,6 +240,14 @@ void LLFloaterSettingsDebug::updateControl(LLControlBase* controlp) | |||
240 | LLSpinCtrl* spinner3 = LLUICtrlFactory::getSpinnerByName(this, "val_spinner_3"); | 240 | LLSpinCtrl* spinner3 = LLUICtrlFactory::getSpinnerByName(this, "val_spinner_3"); |
241 | LLSpinCtrl* spinner4 = LLUICtrlFactory::getSpinnerByName(this, "val_spinner_4"); | 241 | LLSpinCtrl* spinner4 = LLUICtrlFactory::getSpinnerByName(this, "val_spinner_4"); |
242 | LLColorSwatchCtrl* color_swatch = LLUICtrlFactory::getColorSwatchByName(this, "color_swatch"); | 242 | LLColorSwatchCtrl* color_swatch = LLUICtrlFactory::getColorSwatchByName(this, "color_swatch"); |
243 | |||
244 | if (!spinner1 || !spinner2 || !spinner3 || !spinner4 || !color_swatch) | ||
245 | { | ||
246 | llwarns << "Could not find all desired controls by name" | ||
247 | << llendl; | ||
248 | return; | ||
249 | } | ||
250 | |||
243 | spinner1->setVisible(FALSE); | 251 | spinner1->setVisible(FALSE); |
244 | spinner2->setVisible(FALSE); | 252 | spinner2->setVisible(FALSE); |
245 | spinner3->setVisible(FALSE); | 253 | spinner3->setVisible(FALSE); |
diff --git a/linden/indra/newview/llviewerdisplay.cpp b/linden/indra/newview/llviewerdisplay.cpp index c2ef30a..fc288c0 100644 --- a/linden/indra/newview/llviewerdisplay.cpp +++ b/linden/indra/newview/llviewerdisplay.cpp | |||
@@ -564,6 +564,7 @@ void display(BOOL rebuild, F32 zoom_factor, int subfield) | |||
564 | glPushMatrix(); | 564 | glPushMatrix(); |
565 | glMatrixMode(GL_MODELVIEW); | 565 | glMatrixMode(GL_MODELVIEW); |
566 | glPushMatrix(); | 566 | glPushMatrix(); |
567 | |||
567 | if (LLPipeline::sShowHUDAttachments && !gDisconnected && setup_hud_matrices(FALSE)) | 568 | if (LLPipeline::sShowHUDAttachments && !gDisconnected && setup_hud_matrices(FALSE)) |
568 | { | 569 | { |
569 | LLCamera hud_cam = *gCamera; | 570 | LLCamera hud_cam = *gCamera; |
@@ -598,7 +599,7 @@ void display(BOOL rebuild, F32 zoom_factor, int subfield) | |||
598 | LLFastTimer ftm(LLFastTimer::FTM_REBUILD); | 599 | LLFastTimer ftm(LLFastTimer::FTM_REBUILD); |
599 | gPipeline.stateSort(hud_cam); | 600 | gPipeline.stateSort(hud_cam); |
600 | } | 601 | } |
601 | 602 | ||
602 | gPipeline.renderGeom(hud_cam); | 603 | gPipeline.renderGeom(hud_cam); |
603 | 604 | ||
604 | //restore type mask | 605 | //restore type mask |
@@ -657,6 +658,7 @@ BOOL setup_hud_matrices(BOOL for_select) | |||
657 | } | 658 | } |
658 | LLBBox hud_bbox = my_avatarp->getHUDBBox(); | 659 | LLBBox hud_bbox = my_avatarp->getHUDBBox(); |
659 | 660 | ||
661 | |||
660 | // set up transform to encompass bounding box of HUD | 662 | // set up transform to encompass bounding box of HUD |
661 | glMatrixMode(GL_PROJECTION); | 663 | glMatrixMode(GL_PROJECTION); |
662 | glLoadIdentity(); | 664 | glLoadIdentity(); |
@@ -685,7 +687,7 @@ BOOL setup_hud_matrices(BOOL for_select) | |||
685 | glLoadMatrixf(OGL_TO_CFR_ROTATION); // Load Cory's favorite reference frame | 687 | glLoadMatrixf(OGL_TO_CFR_ROTATION); // Load Cory's favorite reference frame |
686 | glTranslatef(-hud_bbox.getCenterLocal().mV[VX] + (hud_depth * 0.5f), 0.f, 0.f); | 688 | glTranslatef(-hud_bbox.getCenterLocal().mV[VX] + (hud_depth * 0.5f), 0.f, 0.f); |
687 | glScalef(zoom_level, zoom_level, zoom_level); | 689 | glScalef(zoom_level, zoom_level, zoom_level); |
688 | 690 | ||
689 | return TRUE; | 691 | return TRUE; |
690 | } | 692 | } |
691 | else | 693 | else |
diff --git a/linden/indra/newview/llviewergenericmessage.cpp b/linden/indra/newview/llviewergenericmessage.cpp index 56b168b..0e1ce49 100644 --- a/linden/indra/newview/llviewergenericmessage.cpp +++ b/linden/indra/newview/llviewergenericmessage.cpp | |||
@@ -1,9 +1,9 @@ | |||
1 | /** | 1 | /** |
2 | * @file llviewergenericmessage.cpp | 2 | * @file llviewergenericmessage.cpp |
3 | * @brief Handle processing of "generic messages" which contain short lists of strings. | 3 | * @brief Handle processing of "generic messages" which contain short lists of strings. |
4 | * @author James Cook | 4 | * @author James Cook |
5 | * | 5 | * |
6 | * Copyright (c) 2007-2007, Linden Research, Inc. | 6 | * Copyright (c) 2007-2007, Linden Research, Inc. |
7 | * | 7 | * |
8 | * Second Life Viewer Source Code | 8 | * Second Life Viewer Source Code |
9 | * The source code in this file ("Source Code") is provided by Linden Lab | 9 | * The source code in this file ("Source Code") is provided by Linden Lab |
@@ -24,74 +24,74 @@ | |||
24 | * | 24 | * |
25 | * ALL LINDEN LAB SOURCE CODE IS PROVIDED "AS IS." LINDEN LAB MAKES NO | 25 | * ALL LINDEN LAB SOURCE CODE IS PROVIDED "AS IS." LINDEN LAB MAKES NO |
26 | * WARRANTIES, EXPRESS, IMPLIED OR OTHERWISE, REGARDING ITS ACCURACY, | 26 | * WARRANTIES, EXPRESS, IMPLIED OR OTHERWISE, REGARDING ITS ACCURACY, |
27 | * COMPLETENESS OR PERFORMANCE. | 27 | * COMPLETENESS OR PERFORMANCE. |
28 | */ | 28 | */ |
29 | 29 | ||
30 | #include "llviewerprecompiledheaders.h" | 30 | #include "llviewerprecompiledheaders.h" |
31 | 31 | ||
32 | #include "llviewergenericmessage.h" | 32 | #include "llviewergenericmessage.h" |
33 | 33 | ||
34 | #include "lldispatcher.h" | 34 | #include "lldispatcher.h" |
35 | #include "lluuid.h" | 35 | #include "lluuid.h" |
36 | #include "message.h" | 36 | #include "message.h" |
37 | 37 | ||
38 | #include "llagent.h" | 38 | #include "llagent.h" |
39 | 39 | ||
40 | 40 | ||
41 | LLDispatcher gGenericDispatcher; | 41 | LLDispatcher gGenericDispatcher; |
42 | 42 | ||
43 | 43 | ||
44 | void send_generic_message(const char* method, | 44 | void send_generic_message(const char* method, |
45 | const std::vector<std::string>& strings, | 45 | const std::vector<std::string>& strings, |
46 | const LLUUID& invoice) | 46 | const LLUUID& invoice) |
47 | { | 47 | { |
48 | LLMessageSystem* msg = gMessageSystem; | 48 | LLMessageSystem* msg = gMessageSystem; |
49 | msg->newMessage("GenericMessage"); | 49 | msg->newMessage("GenericMessage"); |
50 | msg->nextBlockFast(_PREHASH_AgentData); | 50 | msg->nextBlockFast(_PREHASH_AgentData); |
51 | msg->addUUIDFast(_PREHASH_AgentID, gAgent.getID()); | 51 | msg->addUUIDFast(_PREHASH_AgentID, gAgent.getID()); |
52 | msg->addUUIDFast(_PREHASH_SessionID, gAgent.getSessionID()); | 52 | msg->addUUIDFast(_PREHASH_SessionID, gAgent.getSessionID()); |
53 | msg->addUUIDFast(_PREHASH_TransactionID, LLUUID::null); //not used | 53 | msg->addUUIDFast(_PREHASH_TransactionID, LLUUID::null); //not used |
54 | msg->nextBlock("MethodData"); | 54 | msg->nextBlock("MethodData"); |
55 | msg->addString("Method", method); | 55 | msg->addString("Method", method); |
56 | msg->addUUID("Invoice", invoice); | 56 | msg->addUUID("Invoice", invoice); |
57 | if(strings.empty()) | 57 | if(strings.empty()) |
58 | { | 58 | { |
59 | msg->nextBlock("ParamList"); | 59 | msg->nextBlock("ParamList"); |
60 | msg->addString("Parameter", NULL); | 60 | msg->addString("Parameter", NULL); |
61 | } | 61 | } |
62 | else | 62 | else |
63 | { | 63 | { |
64 | std::vector<std::string>::const_iterator it = strings.begin(); | 64 | std::vector<std::string>::const_iterator it = strings.begin(); |
65 | std::vector<std::string>::const_iterator end = strings.end(); | 65 | std::vector<std::string>::const_iterator end = strings.end(); |
66 | for(; it != end; ++it) | 66 | for(; it != end; ++it) |
67 | { | 67 | { |
68 | msg->nextBlock("ParamList"); | 68 | msg->nextBlock("ParamList"); |
69 | msg->addString("Parameter", (*it).c_str()); | 69 | msg->addString("Parameter", (*it).c_str()); |
70 | } | 70 | } |
71 | } | 71 | } |
72 | gAgent.sendReliableMessage(); | 72 | gAgent.sendReliableMessage(); |
73 | } | 73 | } |
74 | 74 | ||
75 | 75 | ||
76 | 76 | ||
77 | void process_generic_message(LLMessageSystem* msg, void**) | 77 | void process_generic_message(LLMessageSystem* msg, void**) |
78 | { | 78 | { |
79 | LLUUID agent_id; | 79 | LLUUID agent_id; |
80 | msg->getUUID("AgentData", "AgentID", agent_id); | 80 | msg->getUUID("AgentData", "AgentID", agent_id); |
81 | if (agent_id != gAgent.getID()) | 81 | if (agent_id != gAgent.getID()) |
82 | { | 82 | { |
83 | llwarns << "GenericMessage for wrong agent" << llendl; | 83 | llwarns << "GenericMessage for wrong agent" << llendl; |
84 | return; | 84 | return; |
85 | } | 85 | } |
86 | 86 | ||
87 | std::string request; | 87 | std::string request; |
88 | LLUUID invoice; | 88 | LLUUID invoice; |
89 | LLDispatcher::sparam_t strings; | 89 | LLDispatcher::sparam_t strings; |
90 | LLDispatcher::unpackMessage(msg, request, invoice, strings); | 90 | LLDispatcher::unpackMessage(msg, request, invoice, strings); |
91 | 91 | ||
92 | if(!gGenericDispatcher.dispatch(request, invoice, strings)) | 92 | if(!gGenericDispatcher.dispatch(request, invoice, strings)) |
93 | { | 93 | { |
94 | llwarns << "GenericMessage " << request << " failed to dispatch" | 94 | llwarns << "GenericMessage " << request << " failed to dispatch" |
95 | << llendl; | 95 | << llendl; |
96 | } | 96 | } |
97 | } | 97 | } |
diff --git a/linden/indra/newview/llviewergenericmessage.h b/linden/indra/newview/llviewergenericmessage.h index cf94d86..b0d02a2 100644 --- a/linden/indra/newview/llviewergenericmessage.h +++ b/linden/indra/newview/llviewergenericmessage.h | |||
@@ -1,9 +1,9 @@ | |||
1 | /** | 1 | /** |
2 | * @file llviewergenericmessage.h | 2 | * @file llviewergenericmessage.h |
3 | * @brief Handle processing of "generic messages" which contain short lists of strings. | 3 | * @brief Handle processing of "generic messages" which contain short lists of strings. |
4 | * @author James Cook | 4 | * @author James Cook |
5 | * | 5 | * |
6 | * Copyright (c) 2007-2007, Linden Research, Inc. | 6 | * Copyright (c) 2007-2007, Linden Research, Inc. |
7 | * | 7 | * |
8 | * Second Life Viewer Source Code | 8 | * Second Life Viewer Source Code |
9 | * The source code in this file ("Source Code") is provided by Linden Lab | 9 | * The source code in this file ("Source Code") is provided by Linden Lab |
@@ -24,23 +24,23 @@ | |||
24 | * | 24 | * |
25 | * ALL LINDEN LAB SOURCE CODE IS PROVIDED "AS IS." LINDEN LAB MAKES NO | 25 | * ALL LINDEN LAB SOURCE CODE IS PROVIDED "AS IS." LINDEN LAB MAKES NO |
26 | * WARRANTIES, EXPRESS, IMPLIED OR OTHERWISE, REGARDING ITS ACCURACY, | 26 | * WARRANTIES, EXPRESS, IMPLIED OR OTHERWISE, REGARDING ITS ACCURACY, |
27 | * COMPLETENESS OR PERFORMANCE. | 27 | * COMPLETENESS OR PERFORMANCE. |
28 | */ | 28 | */ |
29 | 29 | ||
30 | #ifndef LLVIEWERGENERICMESSAGE_H | 30 | #ifndef LLVIEWERGENERICMESSAGE_H |
31 | #define LLVIEWERGENERICMESSAGE_H | 31 | #define LLVIEWERGENERICMESSAGE_H |
32 | 32 | ||
33 | class LLUUID; | 33 | class LLUUID; |
34 | class LLDispatcher; | 34 | class LLDispatcher; |
35 | 35 | ||
36 | 36 | ||
37 | void send_generic_message(const char* method, | 37 | void send_generic_message(const char* method, |
38 | const std::vector<std::string>& strings, | 38 | const std::vector<std::string>& strings, |
39 | const LLUUID& invoice = LLUUID::null); | 39 | const LLUUID& invoice = LLUUID::null); |
40 | 40 | ||
41 | void process_generic_message(LLMessageSystem* msg, void**); | 41 | void process_generic_message(LLMessageSystem* msg, void**); |
42 | 42 | ||
43 | 43 | ||
44 | extern LLDispatcher gGenericDispatcher; | 44 | extern LLDispatcher gGenericDispatcher; |
45 | 45 | ||
46 | #endif | 46 | #endif |
diff --git a/linden/indra/newview/llviewerimagelist.cpp b/linden/indra/newview/llviewerimagelist.cpp index 9da84fa..4e87905 100644 --- a/linden/indra/newview/llviewerimagelist.cpp +++ b/linden/indra/newview/llviewerimagelist.cpp | |||
@@ -125,6 +125,9 @@ void LLViewerImageList::doPreloadImages() | |||
125 | // Set the "white" image | 125 | // Set the "white" image |
126 | LLViewerImage::sWhiteImagep = preloadImage("white.tga", LLUUID::null, TRUE);; | 126 | LLViewerImage::sWhiteImagep = preloadImage("white.tga", LLUUID::null, TRUE);; |
127 | 127 | ||
128 | // Speeds up startup by 4-5 seconds. JC | ||
129 | if (!gPreloadImages) return; | ||
130 | |||
128 | // Preload some images | 131 | // Preload some images |
129 | preloadImage("button_anim_pause.tga", LLUUID::null, FALSE); | 132 | preloadImage("button_anim_pause.tga", LLUUID::null, FALSE); |
130 | preloadImage("button_anim_pause_selected.tga", LLUUID::null, FALSE); | 133 | preloadImage("button_anim_pause_selected.tga", LLUUID::null, FALSE); |
@@ -1116,6 +1119,7 @@ LLPointer<LLImageJ2C> LLViewerImageList::convertToUploadFile(LLPointer<LLImageRa | |||
1116 | S32 LLViewerImageList::getMaxVideoRamSetting(S32 max) | 1119 | S32 LLViewerImageList::getMaxVideoRamSetting(S32 max) |
1117 | { | 1120 | { |
1118 | const U32 vram_settings[] = { 16, 32, 64, 128, 256, 512 }; | 1121 | const U32 vram_settings[] = { 16, 32, 64, 128, 256, 512 }; |
1122 | const S32 num_vram_settings = sizeof(vram_settings) / sizeof(vram_settings[0]); | ||
1119 | 1123 | ||
1120 | U32 max_vram; | 1124 | U32 max_vram; |
1121 | if (gGLManager.mVRAM != 0) | 1125 | if (gGLManager.mVRAM != 0) |
@@ -1144,8 +1148,9 @@ S32 LLViewerImageList::getMaxVideoRamSetting(S32 max) | |||
1144 | { | 1148 | { |
1145 | max_vram = llmin(max_vram, (U32)((F32)system_ram/1.5f)); | 1149 | max_vram = llmin(max_vram, (U32)((F32)system_ram/1.5f)); |
1146 | } | 1150 | } |
1151 | |||
1147 | S32 idx; | 1152 | S32 idx; |
1148 | for (idx=0; idx<=5; idx++) | 1153 | for (idx=0; idx < num_vram_settings; idx++) |
1149 | { | 1154 | { |
1150 | if (idx == max) | 1155 | if (idx == max) |
1151 | break; | 1156 | break; |
@@ -1155,6 +1160,12 @@ S32 LLViewerImageList::getMaxVideoRamSetting(S32 max) | |||
1155 | break; | 1160 | break; |
1156 | } | 1161 | } |
1157 | } | 1162 | } |
1163 | |||
1164 | if( idx == num_vram_settings ) | ||
1165 | { | ||
1166 | idx = num_vram_settings - 1; | ||
1167 | } | ||
1168 | |||
1158 | return idx; | 1169 | return idx; |
1159 | } | 1170 | } |
1160 | 1171 | ||
@@ -1233,12 +1244,20 @@ void LLViewerImageList::receiveImageHeader(LLMessageSystem *msg, void **user_dat | |||
1233 | msg->getU16Fast(_PREHASH_ImageID, _PREHASH_Packets, packets); | 1244 | msg->getU16Fast(_PREHASH_ImageID, _PREHASH_Packets, packets); |
1234 | msg->getU32Fast(_PREHASH_ImageID, _PREHASH_Size, totalbytes); | 1245 | msg->getU32Fast(_PREHASH_ImageID, _PREHASH_Size, totalbytes); |
1235 | 1246 | ||
1236 | U16 data_size = msg->getSizeFast(_PREHASH_ImageData, _PREHASH_Data); | 1247 | S32 data_size = msg->getSizeFast(_PREHASH_ImageData, _PREHASH_Data); |
1237 | if (!data_size) | 1248 | if (!data_size) |
1238 | { | 1249 | { |
1239 | return; | 1250 | return; |
1240 | } | 1251 | } |
1241 | 1252 | if (data_size < 0) | |
1253 | { | ||
1254 | // msg->getSizeFast() is probably trying to tell us there | ||
1255 | // was an error. | ||
1256 | llerrs << "image header chunk size was negative: " | ||
1257 | << data_size << llendl; | ||
1258 | return; | ||
1259 | } | ||
1260 | |||
1242 | // this buffer gets saved off in the packet list | 1261 | // this buffer gets saved off in the packet list |
1243 | U8 *data = new U8[data_size]; | 1262 | U8 *data = new U8[data_size]; |
1244 | msg->getBinaryDataFast(_PREHASH_ImageData, _PREHASH_Data, data, data_size); | 1263 | msg->getBinaryDataFast(_PREHASH_ImageData, _PREHASH_Data, data, data_size); |
@@ -1246,6 +1265,7 @@ void LLViewerImageList::receiveImageHeader(LLMessageSystem *msg, void **user_dat | |||
1246 | LLViewerImage *image = gImageList.getImage(id); | 1265 | LLViewerImage *image = gImageList.getImage(id); |
1247 | if (!image) | 1266 | if (!image) |
1248 | { | 1267 | { |
1268 | delete [] data; | ||
1249 | return; | 1269 | return; |
1250 | } | 1270 | } |
1251 | image->mLastPacketTimer.reset(); | 1271 | image->mLastPacketTimer.reset(); |
@@ -1284,15 +1304,24 @@ void LLViewerImageList::receiveImagePacket(LLMessageSystem *msg, void **user_dat | |||
1284 | //llprintline("Start decode, image header..."); | 1304 | //llprintline("Start decode, image header..."); |
1285 | msg->getUUIDFast(_PREHASH_ImageID, _PREHASH_ID, id); | 1305 | msg->getUUIDFast(_PREHASH_ImageID, _PREHASH_ID, id); |
1286 | msg->getU16Fast(_PREHASH_ImageID, _PREHASH_Packet, packet_num); | 1306 | msg->getU16Fast(_PREHASH_ImageID, _PREHASH_Packet, packet_num); |
1287 | U16 data_size = msg->getSizeFast(_PREHASH_ImageData, _PREHASH_Data); | 1307 | S32 data_size = msg->getSizeFast(_PREHASH_ImageData, _PREHASH_Data); |
1288 | 1308 | ||
1289 | if (!data_size) | 1309 | if (!data_size) |
1290 | { | 1310 | { |
1291 | return; | 1311 | return; |
1292 | } | 1312 | } |
1313 | if (data_size < 0) | ||
1314 | { | ||
1315 | // msg->getSizeFast() is probably trying to tell us there | ||
1316 | // was an error. | ||
1317 | llerrs << "image data chunk size was negative: " | ||
1318 | << data_size << llendl; | ||
1319 | return; | ||
1320 | } | ||
1293 | if (data_size > MTUBYTES) | 1321 | if (data_size > MTUBYTES) |
1294 | { | 1322 | { |
1295 | llerrs << "image data chunk too large: " << data_size << " bytes" << llendl; | 1323 | llerrs << "image data chunk too large: " << data_size << " bytes" << llendl; |
1324 | return; | ||
1296 | } | 1325 | } |
1297 | U8 *data = new U8[data_size]; | 1326 | U8 *data = new U8[data_size]; |
1298 | msg->getBinaryDataFast(_PREHASH_ImageData, _PREHASH_Data, data, data_size); | 1327 | msg->getBinaryDataFast(_PREHASH_ImageData, _PREHASH_Data, data, data_size); |
@@ -1300,6 +1329,7 @@ void LLViewerImageList::receiveImagePacket(LLMessageSystem *msg, void **user_dat | |||
1300 | LLViewerImage *image = gImageList.getImage(id); | 1329 | LLViewerImage *image = gImageList.getImage(id); |
1301 | if (!image) | 1330 | if (!image) |
1302 | { | 1331 | { |
1332 | delete [] data; | ||
1303 | return; | 1333 | return; |
1304 | } | 1334 | } |
1305 | image->mLastPacketTimer.reset(); | 1335 | image->mLastPacketTimer.reset(); |
diff --git a/linden/indra/newview/llviewerinventory.cpp b/linden/indra/newview/llviewerinventory.cpp index 8f23346..d271af5 100644 --- a/linden/indra/newview/llviewerinventory.cpp +++ b/linden/indra/newview/llviewerinventory.cpp | |||
@@ -462,10 +462,6 @@ bool LLViewerInventoryCategory::importFileLocal(FILE* fp) | |||
462 | fgets(buffer, MAX_STRING, fp); | 462 | fgets(buffer, MAX_STRING, fp); |
463 | sscanf( /* Flawfinder: ignore */ | 463 | sscanf( /* Flawfinder: ignore */ |
464 | buffer, " %254s %254s", keyword, valuestr); | 464 | buffer, " %254s %254s", keyword, valuestr); |
465 | if(!keyword) | ||
466 | { | ||
467 | continue; | ||
468 | } | ||
469 | if(0 == strcmp("{",keyword)) | 465 | if(0 == strcmp("{",keyword)) |
470 | { | 466 | { |
471 | continue; | 467 | continue; |
diff --git a/linden/indra/newview/llviewerjointmesh.cpp b/linden/indra/newview/llviewerjointmesh.cpp index 216e29f..c76990c 100644 --- a/linden/indra/newview/llviewerjointmesh.cpp +++ b/linden/indra/newview/llviewerjointmesh.cpp | |||
@@ -216,11 +216,11 @@ S32 LLViewerJointMesh::getBoundJointsByIndex(S32 index, S32 &joint_a, S32& joint | |||
216 | if (render_datap->mSkinJoint) | 216 | if (render_datap->mSkinJoint) |
217 | { | 217 | { |
218 | joint_b = render_datap->mSkinJoint->mJoint->mJointNum; | 218 | joint_b = render_datap->mSkinJoint->mJoint->mJointNum; |
219 | } | ||
220 | 219 | ||
221 | if (joint_a == -1) | 220 | if (joint_a == -1) |
222 | { | 221 | { |
223 | joint_a = render_datap->mSkinJoint->mJoint->getParent()->mJointNum; | 222 | joint_a = render_datap->mSkinJoint->mJoint->getParent()->mJointNum; |
223 | } | ||
224 | } | 224 | } |
225 | num_joints++; | 225 | num_joints++; |
226 | } | 226 | } |
diff --git a/linden/indra/newview/llviewerkeyboard.cpp b/linden/indra/newview/llviewerkeyboard.cpp index f514b2e..fcb1550 100644 --- a/linden/indra/newview/llviewerkeyboard.cpp +++ b/linden/indra/newview/llviewerkeyboard.cpp | |||
@@ -717,15 +717,16 @@ S32 LLViewerKeyboard::loadBindings(const char *filename) | |||
717 | S32 binding_count = 0; | 717 | S32 binding_count = 0; |
718 | S32 line_count = 0; | 718 | S32 line_count = 0; |
719 | 719 | ||
720 | fp = LLFile::fopen(filename, "r"); /* Flawfinder: ignore */ | 720 | if(!filename) |
721 | { | ||
722 | llerrs << " No filename specified" << llendl; | ||
723 | return 0; | ||
724 | } | ||
725 | |||
726 | fp = LLFile::fopen(filename, "r"); | ||
721 | 727 | ||
722 | if (!fp) | 728 | if (!fp) |
723 | { | 729 | { |
724 | if(!filename) | ||
725 | { | ||
726 | llerrs << " No filename specified" << llendl; | ||
727 | return 0; | ||
728 | } | ||
729 | return 0; | 730 | return 0; |
730 | } | 731 | } |
731 | 732 | ||
diff --git a/linden/indra/newview/llviewermenu.cpp b/linden/indra/newview/llviewermenu.cpp index 64f1af8..1ff995e 100644 --- a/linden/indra/newview/llviewermenu.cpp +++ b/linden/indra/newview/llviewermenu.cpp | |||
@@ -34,15 +34,12 @@ | |||
34 | #include <iostream> | 34 | #include <iostream> |
35 | #include <fstream> | 35 | #include <fstream> |
36 | #include <sstream> | 36 | #include <sstream> |
37 | #include <boost/tokenizer.hpp> | ||
38 | 37 | ||
39 | // linden library includes | 38 | // linden library includes |
40 | #include "audioengine.h" | 39 | #include "audioengine.h" |
41 | #include "indra_constants.h" | 40 | #include "indra_constants.h" |
42 | #include "llassetuploadresponders.h" | ||
43 | #include "llassetstorage.h" | 41 | #include "llassetstorage.h" |
44 | #include "llchat.h" | 42 | #include "llchat.h" |
45 | #include "lleconomy.h" | ||
46 | #include "llfocusmgr.h" | 43 | #include "llfocusmgr.h" |
47 | #include "llfontgl.h" | 44 | #include "llfontgl.h" |
48 | #include "llinstantmessage.h" | 45 | #include "llinstantmessage.h" |
@@ -57,7 +54,6 @@ | |||
57 | #include "raytrace.h" | 54 | #include "raytrace.h" |
58 | #include "llsdserialize.h" | 55 | #include "llsdserialize.h" |
59 | #include "lltimer.h" | 56 | #include "lltimer.h" |
60 | #include "vorbisencode.h" | ||
61 | #include "llvfile.h" | 57 | #include "llvfile.h" |
62 | #include "llvolumemgr.h" | 58 | #include "llvolumemgr.h" |
63 | #include "llwindow.h" // for shell_open() | 59 | #include "llwindow.h" // for shell_open() |
@@ -83,7 +79,6 @@ | |||
83 | #include "llfloater.h" | 79 | #include "llfloater.h" |
84 | #include "llfloaterabout.h" | 80 | #include "llfloaterabout.h" |
85 | #include "llfloaterbuycurrency.h" | 81 | #include "llfloaterbuycurrency.h" |
86 | #include "llfloateranimpreview.h" | ||
87 | #include "llfloateravatarinfo.h" | 82 | #include "llfloateravatarinfo.h" |
88 | #include "llfloateravatartextures.h" | 83 | #include "llfloateravatartextures.h" |
89 | #include "llfloaterbuildoptions.h" | 84 | #include "llfloaterbuildoptions.h" |
@@ -104,21 +99,17 @@ | |||
104 | #include "llfloaterhtml.h" | 99 | #include "llfloaterhtml.h" |
105 | #include "llfloaterhtmlhelp.h" | 100 | #include "llfloaterhtmlhelp.h" |
106 | #include "llfloaterhtmlfind.h" | 101 | #include "llfloaterhtmlfind.h" |
107 | #include "llfloaterimport.h" | ||
108 | #include "llfloaterinspect.h" | 102 | #include "llfloaterinspect.h" |
109 | #include "llfloaterland.h" | 103 | #include "llfloaterland.h" |
110 | #include "llfloaterlandholdings.h" | 104 | #include "llfloaterlandholdings.h" |
111 | #include "llfloatermap.h" | 105 | #include "llfloatermap.h" |
112 | #include "llfloaterimagepreview.h" | ||
113 | #include "llfloatermute.h" | 106 | #include "llfloatermute.h" |
114 | #include "llfloaternamedesc.h" | ||
115 | #include "llfloateropenobject.h" | 107 | #include "llfloateropenobject.h" |
116 | #include "llfloaterpermissionsmgr.h" | 108 | #include "llfloaterpermissionsmgr.h" |
117 | #include "llfloaterpreference.h" | 109 | #include "llfloaterpreference.h" |
118 | #include "llfloaterregioninfo.h" | 110 | #include "llfloaterregioninfo.h" |
119 | #include "llfloaterreporter.h" | 111 | #include "llfloaterreporter.h" |
120 | #include "llfloaterscriptdebug.h" | 112 | #include "llfloaterscriptdebug.h" |
121 | #include "llfloatersnapshot.h" | ||
122 | #include "llfloatertest.h" | 113 | #include "llfloatertest.h" |
123 | #include "llfloatertools.h" | 114 | #include "llfloatertools.h" |
124 | #include "llfloaterworldmap.h" | 115 | #include "llfloaterworldmap.h" |
@@ -147,8 +138,6 @@ | |||
147 | #include "llnotify.h" | 138 | #include "llnotify.h" |
148 | #include "llpanelobject.h" | 139 | #include "llpanelobject.h" |
149 | #include "llparcel.h" | 140 | #include "llparcel.h" |
150 | #include "llpreviewscript.h" | ||
151 | #include "llpreviewtexture.h" | ||
152 | #include "llprimitive.h" | 141 | #include "llprimitive.h" |
153 | #include "llresmgr.h" | 142 | #include "llresmgr.h" |
154 | #include "llselectmgr.h" | 143 | #include "llselectmgr.h" |
@@ -176,8 +165,8 @@ | |||
176 | #include "llviewercamera.h" | 165 | #include "llviewercamera.h" |
177 | #include "llviewergenericmessage.h" | 166 | #include "llviewergenericmessage.h" |
178 | #include "llviewergesture.h" | 167 | #include "llviewergesture.h" |
179 | #include "llviewerimagelist.h" | ||
180 | #include "llviewerinventory.h" | 168 | #include "llviewerinventory.h" |
169 | #include "llviewermenufile.h" // init_menu_file() | ||
181 | #include "llviewermessage.h" | 170 | #include "llviewermessage.h" |
182 | #include "llviewernetwork.h" | 171 | #include "llviewernetwork.h" |
183 | #include "llviewerobjectlist.h" | 172 | #include "llviewerobjectlist.h" |
@@ -402,7 +391,6 @@ void handle_god_request_avatar_geometry(void *); // Hack for easy testing of new | |||
402 | void reload_personal_settings_overrides(void *); | 391 | void reload_personal_settings_overrides(void *); |
403 | void force_breakpoint(void *); | 392 | void force_breakpoint(void *); |
404 | void reload_vertex_shader(void *); | 393 | void reload_vertex_shader(void *); |
405 | void flush_animations(void *); | ||
406 | void slow_mo_animations(void *); | 394 | void slow_mo_animations(void *); |
407 | void handle_disconnect_viewer(void *); | 395 | void handle_disconnect_viewer(void *); |
408 | 396 | ||
@@ -467,6 +455,7 @@ void handle_dump_avatar_local_textures(void*); | |||
467 | void handle_debug_avatar_textures(void*); | 455 | void handle_debug_avatar_textures(void*); |
468 | void handle_grab_texture(void*); | 456 | void handle_grab_texture(void*); |
469 | BOOL enable_grab_texture(void*); | 457 | BOOL enable_grab_texture(void*); |
458 | void handle_dump_region_object_cache(void*); | ||
470 | 459 | ||
471 | BOOL menu_ui_enabled(void *user_data); | 460 | BOOL menu_ui_enabled(void *user_data); |
472 | void check_toggle_control( LLUICtrl *, void* user_data ); | 461 | void check_toggle_control( LLUICtrl *, void* user_data ); |
@@ -537,7 +526,7 @@ void pre_init_menus() | |||
537 | LLMenuItemGL::setHighlightFGColor( color ); | 526 | LLMenuItemGL::setHighlightFGColor( color ); |
538 | } | 527 | } |
539 | 528 | ||
540 | void initialize_menu_actions(); | 529 | void initialize_menus(); |
541 | 530 | ||
542 | //----------------------------------------------------------------------------- | 531 | //----------------------------------------------------------------------------- |
543 | // Initialize main menus | 532 | // Initialize main menus |
@@ -565,7 +554,7 @@ void init_menus() | |||
565 | LLMenuGL::sMenuContainer = gMenuHolder; | 554 | LLMenuGL::sMenuContainer = gMenuHolder; |
566 | 555 | ||
567 | // Initialize actions | 556 | // Initialize actions |
568 | initialize_menu_actions(); | 557 | initialize_menus(); |
569 | 558 | ||
570 | /// | 559 | /// |
571 | /// Popup menu | 560 | /// Popup menu |
@@ -965,6 +954,8 @@ void init_debug_world_menu(LLMenuGL* menu) | |||
965 | NULL, | 954 | NULL, |
966 | &menu_check_control, | 955 | &menu_check_control, |
967 | (void*)"FixedWeather")); | 956 | (void*)"FixedWeather")); |
957 | menu->append(new LLMenuItemCallGL("Dump Region Object Cache", | ||
958 | &handle_dump_region_object_cache, NULL, NULL)); | ||
968 | menu->createJumpKeys(); | 959 | menu->createJumpKeys(); |
969 | } | 960 | } |
970 | 961 | ||
@@ -1293,7 +1284,6 @@ void init_debug_avatar_menu(LLMenuGL* menu) | |||
1293 | menu->append(new LLMenuItemCallGL("Force Params to Default", &LLAgent::clearVisualParams, NULL)); | 1284 | menu->append(new LLMenuItemCallGL("Force Params to Default", &LLAgent::clearVisualParams, NULL)); |
1294 | menu->append(new LLMenuItemCallGL("Reload Vertex Shader", &reload_vertex_shader, NULL)); | 1285 | menu->append(new LLMenuItemCallGL("Reload Vertex Shader", &reload_vertex_shader, NULL)); |
1295 | menu->append(new LLMenuItemToggleGL("Animation Info", &LLVOAvatar::sShowAnimationDebug)); | 1286 | menu->append(new LLMenuItemToggleGL("Animation Info", &LLVOAvatar::sShowAnimationDebug)); |
1296 | menu->append(new LLMenuItemCallGL("Flush Animations", &flush_animations, NULL)); | ||
1297 | menu->append(new LLMenuItemCallGL("Slow Motion Animations", &slow_mo_animations, NULL)); | 1287 | menu->append(new LLMenuItemCallGL("Slow Motion Animations", &slow_mo_animations, NULL)); |
1298 | menu->append(new LLMenuItemToggleGL("Show Look At", &LLHUDEffectLookAt::sDebugLookAt)); | 1288 | menu->append(new LLMenuItemToggleGL("Show Look At", &LLHUDEffectLookAt::sDebugLookAt)); |
1299 | menu->append(new LLMenuItemToggleGL("Show Point At", &LLHUDEffectPointAt::sDebugPointAt)); | 1289 | menu->append(new LLMenuItemToggleGL("Show Point At", &LLHUDEffectPointAt::sDebugPointAt)); |
@@ -2041,13 +2031,13 @@ class LLAvatarDebug : public view_listener_t | |||
2041 | if( avatar ) | 2031 | if( avatar ) |
2042 | { | 2032 | { |
2043 | avatar->dumpLocalTextures(); | 2033 | avatar->dumpLocalTextures(); |
2034 | llinfos << "Dumping temporary asset data to simulator logs for avatar " << avatar->getID() << llendl; | ||
2035 | std::vector<std::string> strings; | ||
2036 | strings.push_back(avatar->getID().asString()); | ||
2037 | LLUUID invoice; | ||
2038 | send_generic_message("dumptempassetdata", strings, invoice); | ||
2039 | LLFloaterAvatarTextures::show( avatar->getID() ); | ||
2044 | } | 2040 | } |
2045 | llinfos << "Dumping temporary asset data to simulator logs for avatar " << avatar->getID() << llendl; | ||
2046 | std::vector<std::string> strings; | ||
2047 | strings.push_back(avatar->getID().asString()); | ||
2048 | LLUUID invoice; | ||
2049 | send_generic_message("dumptempassetdata", strings, invoice); | ||
2050 | LLFloaterAvatarTextures::show( avatar->getID() ); | ||
2051 | return true; | 2041 | return true; |
2052 | } | 2042 | } |
2053 | }; | 2043 | }; |
@@ -2337,16 +2327,6 @@ void handle_buy_contents(LLSaleInfo sale_info) | |||
2337 | LLFloaterBuyContents::show(sale_info); | 2327 | LLFloaterBuyContents::show(sale_info); |
2338 | } | 2328 | } |
2339 | 2329 | ||
2340 | class LLFileEnableSaveAs : public view_listener_t | ||
2341 | { | ||
2342 | bool handleEvent(LLPointer<LLEvent> event, const LLSD& userdata) | ||
2343 | { | ||
2344 | bool new_value = gFloaterView->getFrontmost() && gFloaterView->getFrontmost()->canSaveAs(); | ||
2345 | gMenuHolder->findControl(userdata["control"].asString())->setValue(new_value); | ||
2346 | return true; | ||
2347 | } | ||
2348 | }; | ||
2349 | |||
2350 | void handle_region_dump_temp_asset_data(void*) | 2330 | void handle_region_dump_temp_asset_data(void*) |
2351 | { | 2331 | { |
2352 | llinfos << "Dumping temporary asset data to simulator logs" << llendl; | 2332 | llinfos << "Dumping temporary asset data to simulator logs" << llendl; |
@@ -2397,6 +2377,15 @@ void handle_dump_capabilities_info(void *) | |||
2397 | } | 2377 | } |
2398 | } | 2378 | } |
2399 | 2379 | ||
2380 | void handle_dump_region_object_cache(void*) | ||
2381 | { | ||
2382 | LLViewerRegion* regionp = gAgent.getRegion(); | ||
2383 | if (regionp) | ||
2384 | { | ||
2385 | regionp->dumpCache(); | ||
2386 | } | ||
2387 | } | ||
2388 | |||
2400 | void handle_dump_focus(void *) | 2389 | void handle_dump_focus(void *) |
2401 | { | 2390 | { |
2402 | LLView *view = gFocusMgr.getKeyboardFocus(); | 2391 | LLView *view = gFocusMgr.getKeyboardFocus(); |
@@ -4279,7 +4268,10 @@ void show_buy_currency(const char* extra) | |||
4279 | mesg << "Go to " << BUY_CURRENCY_URL << "\nfor information on purchasing currency?"; | 4268 | mesg << "Go to " << BUY_CURRENCY_URL << "\nfor information on purchasing currency?"; |
4280 | 4269 | ||
4281 | LLString::format_map_t args; | 4270 | LLString::format_map_t args; |
4282 | args["[EXTRA]"] = extra; | 4271 | if (extra != NULL) |
4272 | { | ||
4273 | args["[EXTRA]"] = extra; | ||
4274 | } | ||
4283 | args["[URL]"] = BUY_CURRENCY_URL; | 4275 | args["[URL]"] = BUY_CURRENCY_URL; |
4284 | gViewerWindow->alertXml("PromptGoToCurrencyPage", args, | 4276 | gViewerWindow->alertXml("PromptGoToCurrencyPage", args, |
4285 | callback_show_buy_currency); | 4277 | callback_show_buy_currency); |
@@ -4876,906 +4868,6 @@ void toggle_map( void* user_data ) | |||
4876 | } | 4868 | } |
4877 | } | 4869 | } |
4878 | 4870 | ||
4879 | /** | ||
4880 | char* upload_pick(void* data) | ||
4881 | |||
4882 | If applicable, brings up a file chooser in which the user selects a file | ||
4883 | to upload for a particular task. If the file is valid for the given action, | ||
4884 | returns the string to the full path filename, else returns NULL. | ||
4885 | Data is the load filter for the type of file as defined in LLFilePicker. | ||
4886 | **/ | ||
4887 | const char* upload_pick(void* data) | ||
4888 | { | ||
4889 | if( gAgent.cameraMouselook() ) | ||
4890 | { | ||
4891 | gAgent.changeCameraToDefault(); | ||
4892 | // This doesn't seem necessary. JC | ||
4893 | // display(); | ||
4894 | } | ||
4895 | |||
4896 | LLFilePicker::ELoadFilter type; | ||
4897 | if(data) | ||
4898 | { | ||
4899 | type = (LLFilePicker::ELoadFilter)((intptr_t)data); | ||
4900 | } | ||
4901 | else | ||
4902 | { | ||
4903 | type = LLFilePicker::FFLOAD_ALL; | ||
4904 | } | ||
4905 | |||
4906 | LLFilePicker& picker = LLFilePicker::instance(); | ||
4907 | if (!picker.getOpenFile(type)) | ||
4908 | { | ||
4909 | llinfos << "Couldn't import objects from file" << llendl; | ||
4910 | return NULL; | ||
4911 | } | ||
4912 | |||
4913 | const char* filename = picker.getFirstFile(); | ||
4914 | const char* ext = strrchr(filename, '.'); | ||
4915 | |||
4916 | //strincmp doesn't like NULL pointers | ||
4917 | if (ext == NULL) | ||
4918 | { | ||
4919 | const char* short_name = strrchr(filename, | ||
4920 | *gDirUtilp->getDirDelimiter().c_str()); | ||
4921 | |||
4922 | // No extension | ||
4923 | LLStringBase<char>::format_map_t args; | ||
4924 | args["[FILE]"] = LLString(short_name + 1); | ||
4925 | gViewerWindow->alertXml("NoFileExtension", args); | ||
4926 | return NULL; | ||
4927 | } | ||
4928 | else | ||
4929 | { | ||
4930 | //so there is an extension | ||
4931 | //loop over the valid extensions and compare to see | ||
4932 | //if the extension is valid | ||
4933 | |||
4934 | //now grab the set of valid file extensions | ||
4935 | const char* valids = build_extensions_string(type); | ||
4936 | std::string valid_extensions = std::string(valids); | ||
4937 | |||
4938 | BOOL ext_valid = FALSE; | ||
4939 | |||
4940 | typedef boost::tokenizer<boost::char_separator<char> > tokenizer; | ||
4941 | boost::char_separator<char> sep(" "); | ||
4942 | tokenizer tokens(valid_extensions, sep); | ||
4943 | tokenizer::iterator token_iter; | ||
4944 | |||
4945 | //now loop over all valid file extensions | ||
4946 | //and compare them to the extension of the file | ||
4947 | //to be uploaded | ||
4948 | for( token_iter = tokens.begin(); | ||
4949 | token_iter != tokens.end() && ext_valid != TRUE; | ||
4950 | ++token_iter) | ||
4951 | { | ||
4952 | const char* cur_token = token_iter->c_str(); | ||
4953 | |||
4954 | if (0 == strnicmp(cur_token, ext, strlen(cur_token)) || /* Flawfinder: ignore */ | ||
4955 | 0 == strnicmp(cur_token, "*.*", strlen(cur_token))) /* Flawfinder: ignore */ | ||
4956 | { | ||
4957 | //valid extension | ||
4958 | //or the acceptable extension is any | ||
4959 | ext_valid = TRUE; | ||
4960 | } | ||
4961 | }//end for (loop over all tokens) | ||
4962 | |||
4963 | if (ext_valid == FALSE) | ||
4964 | { | ||
4965 | //should only get here if the extension exists | ||
4966 | //but is invalid | ||
4967 | LLStringBase<char>::format_map_t args; | ||
4968 | args["[EXTENSION]"] = ext; | ||
4969 | args["[VALIDS]"] = valids; | ||
4970 | gViewerWindow->alertXml("InvalidFileExtension", args); | ||
4971 | return NULL; | ||
4972 | } | ||
4973 | }//end else (non-null extension) | ||
4974 | |||
4975 | //valid file extension | ||
4976 | |||
4977 | //now we check to see | ||
4978 | //if the file is actually a valid image/sound/etc. | ||
4979 | if (type == LLFilePicker::FFLOAD_WAV) | ||
4980 | { | ||
4981 | // pre-qualify wavs to make sure the format is acceptable | ||
4982 | char error_msg[MAX_STRING]; /* Flawfinder: ignore */ | ||
4983 | if (check_for_invalid_wav_formats(filename,error_msg)) | ||
4984 | { | ||
4985 | llinfos << error_msg << ": " << filename << llendl; | ||
4986 | LLStringBase<char>::format_map_t args; | ||
4987 | args["[FILE]"] = filename; | ||
4988 | gViewerWindow->alertXml( error_msg, args ); | ||
4989 | return NULL; | ||
4990 | } | ||
4991 | }//end if a wave/sound file | ||
4992 | |||
4993 | |||
4994 | return filename; | ||
4995 | } | ||
4996 | |||
4997 | void handle_upload_object(void* data) | ||
4998 | { | ||
4999 | const char* filename = upload_pick(data); | ||
5000 | if (filename) | ||
5001 | { | ||
5002 | // start the import | ||
5003 | LLFloaterImport* floaterp = new LLFloaterImport(filename); | ||
5004 | gUICtrlFactory->buildFloater(floaterp, "floater_import.xml"); | ||
5005 | } | ||
5006 | } | ||
5007 | |||
5008 | class LLFileUploadImage : public view_listener_t | ||
5009 | { | ||
5010 | bool handleEvent(LLPointer<LLEvent> event, const LLSD& userdata) | ||
5011 | { | ||
5012 | const char* filename = upload_pick((void *)(S32)LLFilePicker::FFLOAD_IMAGE); | ||
5013 | if (filename) | ||
5014 | { | ||
5015 | LLFloaterImagePreview* floaterp = new LLFloaterImagePreview(filename); | ||
5016 | gUICtrlFactory->buildFloater(floaterp, "floater_image_preview.xml"); | ||
5017 | } | ||
5018 | return TRUE; | ||
5019 | } | ||
5020 | }; | ||
5021 | |||
5022 | class LLFileUploadSound : public view_listener_t | ||
5023 | { | ||
5024 | bool handleEvent(LLPointer<LLEvent> event, const LLSD& userdata) | ||
5025 | { | ||
5026 | const char* filename = upload_pick((void*)((S32)LLFilePicker::FFLOAD_WAV)); | ||
5027 | if (filename) | ||
5028 | { | ||
5029 | LLFloaterNameDesc* floaterp = new LLFloaterNameDesc(filename); | ||
5030 | gUICtrlFactory->buildFloater(floaterp, "floater_sound_preview.xml"); | ||
5031 | } | ||
5032 | return true; | ||
5033 | } | ||
5034 | }; | ||
5035 | |||
5036 | class LLFileUploadAnim : public view_listener_t | ||
5037 | { | ||
5038 | bool handleEvent(LLPointer<LLEvent> event, const LLSD& userdata) | ||
5039 | { | ||
5040 | const char* filename = upload_pick((void*)((S32)LLFilePicker::FFLOAD_ANIM)); | ||
5041 | if (filename) | ||
5042 | { | ||
5043 | LLFloaterAnimPreview* floaterp = new LLFloaterAnimPreview(filename); | ||
5044 | gUICtrlFactory->buildFloater(floaterp, "floater_animation_preview.xml"); | ||
5045 | } | ||
5046 | return true; | ||
5047 | } | ||
5048 | }; | ||
5049 | |||
5050 | class LLFileUploadBulk : public view_listener_t | ||
5051 | { | ||
5052 | bool handleEvent(LLPointer<LLEvent> event, const LLSD& userdata) | ||
5053 | { | ||
5054 | if( gAgent.cameraMouselook() ) | ||
5055 | { | ||
5056 | gAgent.changeCameraToDefault(); | ||
5057 | } | ||
5058 | |||
5059 | // TODO: | ||
5060 | // Iterate over all files | ||
5061 | // Check extensions for uploadability, cost | ||
5062 | // Check user balance for entire cost | ||
5063 | // Charge user entire cost | ||
5064 | // Loop, uploading | ||
5065 | // If an upload fails, refund the user for that one | ||
5066 | // | ||
5067 | // Also fix single upload to charge first, then refund | ||
5068 | |||
5069 | LLFilePicker& picker = LLFilePicker::instance(); | ||
5070 | if (picker.getMultipleOpenFiles()) | ||
5071 | { | ||
5072 | const char* filename = picker.getFirstFile(); | ||
5073 | const char* name = picker.getDirname(); | ||
5074 | |||
5075 | LLString asset_name = name; | ||
5076 | LLString::replaceNonstandardASCII( asset_name, '?' ); | ||
5077 | LLString::replaceChar(asset_name, '|', '?'); | ||
5078 | LLString::stripNonprintable(asset_name); | ||
5079 | LLString::trim(asset_name); | ||
5080 | |||
5081 | char* asset_name_str = (char*)asset_name.c_str(); | ||
5082 | char* end_p = strrchr(asset_name_str, '.'); // strip extension if exists | ||
5083 | if( !end_p ) | ||
5084 | { | ||
5085 | end_p = asset_name_str + strlen( asset_name_str ); /* Flawfinder: ignore */ | ||
5086 | } | ||
5087 | |||
5088 | S32 len = llmin( (S32) (DB_INV_ITEM_NAME_STR_LEN), (S32) (end_p - asset_name_str) ); | ||
5089 | |||
5090 | asset_name = asset_name.substr( 0, len ); | ||
5091 | |||
5092 | upload_new_resource(filename, asset_name, asset_name, 0, LLAssetType::AT_NONE, LLInventoryType::IT_NONE); // file | ||
5093 | } | ||
5094 | else | ||
5095 | { | ||
5096 | llinfos << "Couldn't import objects from file" << llendl; | ||
5097 | } | ||
5098 | return true; | ||
5099 | } | ||
5100 | }; | ||
5101 | |||
5102 | void upload_error(const char* error_message, const char* label, const std::string filename, const LLStringBase<char>::format_map_t args) | ||
5103 | { | ||
5104 | llwarns << error_message << llendl; | ||
5105 | gViewerWindow->alertXml(label, args); | ||
5106 | if(remove(filename.c_str()) == -1) | ||
5107 | { | ||
5108 | lldebugs << "unable to remove temp file" << llendl; | ||
5109 | } | ||
5110 | LLFilePicker::instance().reset(); | ||
5111 | } | ||
5112 | |||
5113 | class LLFileEnableCloseWindow : public view_listener_t | ||
5114 | { | ||
5115 | bool handleEvent(LLPointer<LLEvent> event, const LLSD& userdata) | ||
5116 | { | ||
5117 | bool new_value = gFloaterView->getFocusedFloater() != NULL || gSnapshotFloaterView->getFocusedFloater() != NULL; | ||
5118 | // horrendously opaque, this code | ||
5119 | gMenuHolder->findControl(userdata["control"].asString())->setValue(new_value); | ||
5120 | return true; | ||
5121 | } | ||
5122 | }; | ||
5123 | |||
5124 | class LLFileCloseWindow : public view_listener_t | ||
5125 | { | ||
5126 | bool handleEvent(LLPointer<LLEvent> event, const LLSD& userdata) | ||
5127 | { | ||
5128 | LLFloater::closeFocusedFloater(); | ||
5129 | |||
5130 | return true; | ||
5131 | } | ||
5132 | }; | ||
5133 | |||
5134 | class LLFileSaveTexture : public view_listener_t | ||
5135 | { | ||
5136 | bool handleEvent(LLPointer<LLEvent> event, const LLSD& userdata) | ||
5137 | { | ||
5138 | LLFloater* top = gFloaterView->getFrontmost(); | ||
5139 | if (top) | ||
5140 | { | ||
5141 | top->saveAs(); | ||
5142 | } | ||
5143 | return true; | ||
5144 | } | ||
5145 | }; | ||
5146 | |||
5147 | class LLFileTakeSnapshot : public view_listener_t | ||
5148 | { | ||
5149 | bool handleEvent(LLPointer<LLEvent> event, const LLSD& userdata) | ||
5150 | { | ||
5151 | LLFloaterSnapshot::show(NULL); | ||
5152 | return true; | ||
5153 | } | ||
5154 | }; | ||
5155 | |||
5156 | class LLFileTakeSnapshotToDisk : public view_listener_t | ||
5157 | { | ||
5158 | bool handleEvent(LLPointer<LLEvent> event, const LLSD& userdata) | ||
5159 | { | ||
5160 | LLPointer<LLImageRaw> raw = new LLImageRaw; | ||
5161 | |||
5162 | S32 width = gViewerWindow->getWindowDisplayWidth(); | ||
5163 | S32 height = gViewerWindow->getWindowDisplayHeight(); | ||
5164 | |||
5165 | if (gSavedSettings.getBOOL("HighResSnapshot")) | ||
5166 | { | ||
5167 | width *= 2; | ||
5168 | height *= 2; | ||
5169 | } | ||
5170 | |||
5171 | if (gViewerWindow->rawSnapshot(raw, | ||
5172 | width, | ||
5173 | height, | ||
5174 | TRUE, | ||
5175 | gSavedSettings.getBOOL("RenderUIInSnapshot"), | ||
5176 | FALSE)) | ||
5177 | { | ||
5178 | if (!gQuietSnapshot) | ||
5179 | { | ||
5180 | gViewerWindow->playSnapshotAnimAndSound(); | ||
5181 | } | ||
5182 | LLImageBase::setSizeOverride(TRUE); | ||
5183 | gViewerWindow->saveImageNumbered(raw); | ||
5184 | LLImageBase::setSizeOverride(FALSE); | ||
5185 | } | ||
5186 | return true; | ||
5187 | } | ||
5188 | }; | ||
5189 | |||
5190 | class LLFileSaveMovie : public view_listener_t | ||
5191 | { | ||
5192 | bool handleEvent(LLPointer<LLEvent> event, const LLSD& userdata) | ||
5193 | { | ||
5194 | LLViewerWindow::saveMovieNumbered(NULL); | ||
5195 | return true; | ||
5196 | } | ||
5197 | }; | ||
5198 | |||
5199 | class LLFileSetWindowSize : public view_listener_t | ||
5200 | { | ||
5201 | bool handleEvent(LLPointer<LLEvent> event, const LLSD& userdata) | ||
5202 | { | ||
5203 | LLString size = userdata.asString(); | ||
5204 | S32 width, height; | ||
5205 | sscanf(size.c_str(), "%d,%d", &width, &height); | ||
5206 | LLViewerWindow::movieSize(width, height); | ||
5207 | return true; | ||
5208 | } | ||
5209 | }; | ||
5210 | |||
5211 | class LLFileQuit : public view_listener_t | ||
5212 | { | ||
5213 | bool handleEvent(LLPointer<LLEvent> event, const LLSD& userdata) | ||
5214 | { | ||
5215 | app_request_quit(); | ||
5216 | return true; | ||
5217 | } | ||
5218 | }; | ||
5219 | |||
5220 | void handle_upload(void* data) | ||
5221 | { | ||
5222 | const char* filename = upload_pick(data); | ||
5223 | if (filename) | ||
5224 | { | ||
5225 | LLFloaterNameDesc* floaterp = new LLFloaterNameDesc(filename); | ||
5226 | gUICtrlFactory->buildFloater(floaterp, "floater_name_description.xml"); | ||
5227 | } | ||
5228 | } | ||
5229 | |||
5230 | void handle_compress_image(void*) | ||
5231 | { | ||
5232 | LLFilePicker& picker = LLFilePicker::instance(); | ||
5233 | if (picker.getOpenFile(LLFilePicker::FFLOAD_IMAGE)) | ||
5234 | { | ||
5235 | std::string infile(picker.getFirstFile()); | ||
5236 | std::string outfile = infile + ".j2c"; | ||
5237 | |||
5238 | llinfos << "Input: " << infile << llendl; | ||
5239 | llinfos << "Output: " << outfile << llendl; | ||
5240 | |||
5241 | BOOL success; | ||
5242 | |||
5243 | success = LLViewerImageList::createUploadFile(infile, outfile, IMG_CODEC_TGA); | ||
5244 | |||
5245 | if (success) | ||
5246 | { | ||
5247 | llinfos << "Compression complete" << llendl; | ||
5248 | } | ||
5249 | else | ||
5250 | { | ||
5251 | llinfos << "Compression failed: " << LLImageBase::getLastError() << llendl; | ||
5252 | } | ||
5253 | } | ||
5254 | } | ||
5255 | |||
5256 | void upload_new_resource(const LLString& src_filename, std::string name, | ||
5257 | std::string desc, S32 compression_info, | ||
5258 | LLAssetType::EType destination_folder_type, | ||
5259 | LLInventoryType::EType inv_type, | ||
5260 | U32 next_owner_perm, | ||
5261 | const LLString& display_name, | ||
5262 | LLAssetStorage::LLStoreAssetCallback callback, | ||
5263 | void *userdata) | ||
5264 | { | ||
5265 | // Generate the temporary UUID. | ||
5266 | LLString filename = gDirUtilp->getTempFilename(); | ||
5267 | LLTransactionID tid; | ||
5268 | LLAssetID uuid; | ||
5269 | |||
5270 | LLStringBase<char>::format_map_t args; | ||
5271 | |||
5272 | LLString ext = src_filename.substr(src_filename.find_last_of('.')); | ||
5273 | LLAssetType::EType asset_type = LLAssetType::AT_NONE; | ||
5274 | char error_message[MAX_STRING]; /* Flawfinder: ignore */ | ||
5275 | error_message[0] = '\0'; | ||
5276 | LLString temp_str; | ||
5277 | |||
5278 | BOOL error = FALSE; | ||
5279 | |||
5280 | if (ext.empty()) | ||
5281 | { | ||
5282 | LLString::size_type offset = filename.find_last_of(gDirUtilp->getDirDelimiter()); | ||
5283 | if (offset != LLString::npos) | ||
5284 | offset++; | ||
5285 | LLString short_name = filename.substr(offset); | ||
5286 | |||
5287 | // No extension | ||
5288 | snprintf(error_message, /* Flawfinder: ignore */ | ||
5289 | MAX_STRING, | ||
5290 | "No file extension for the file: '%s'\nPlease make sure the file has a correct file extension", | ||
5291 | short_name.c_str()); | ||
5292 | args["[FILE]"] = short_name; | ||
5293 | upload_error(error_message, "NofileExtension", filename, args); | ||
5294 | return; | ||
5295 | } | ||
5296 | else if( LLString::compareInsensitive(ext.c_str(),".bmp") == 0 ) | ||
5297 | { | ||
5298 | asset_type = LLAssetType::AT_TEXTURE; | ||
5299 | if (!LLViewerImageList::createUploadFile(src_filename, | ||
5300 | filename, | ||
5301 | IMG_CODEC_BMP )) | ||
5302 | { | ||
5303 | snprintf(error_message, MAX_STRING, "Problem with file %s:\n\n%s\n", /* Flawfinder: ignore */ | ||
5304 | src_filename.c_str(), LLImageBase::getLastError().c_str()); | ||
5305 | args["[FILE]"] = src_filename; | ||
5306 | args["[ERROR]"] = LLImageBase::getLastError(); | ||
5307 | upload_error(error_message, "ProblemWithFile", filename, args); | ||
5308 | return; | ||
5309 | } | ||
5310 | } | ||
5311 | else if( LLString::compareInsensitive(ext.c_str(),".tga") == 0 ) | ||
5312 | { | ||
5313 | asset_type = LLAssetType::AT_TEXTURE; | ||
5314 | if (!LLViewerImageList::createUploadFile(src_filename, | ||
5315 | filename, | ||
5316 | IMG_CODEC_TGA )) | ||
5317 | { | ||
5318 | snprintf(error_message, MAX_STRING, "Problem with file %s:\n\n%s\n", /* Flawfinder: ignore */ | ||
5319 | src_filename.c_str(), LLImageBase::getLastError().c_str()); | ||
5320 | args["[FILE]"] = src_filename; | ||
5321 | args["[ERROR]"] = LLImageBase::getLastError(); | ||
5322 | upload_error(error_message, "ProblemWithFile", filename, args); | ||
5323 | return; | ||
5324 | } | ||
5325 | } | ||
5326 | else if( LLString::compareInsensitive(ext.c_str(),".jpg") == 0 || LLString::compareInsensitive(ext.c_str(),".jpeg") == 0) | ||
5327 | { | ||
5328 | asset_type = LLAssetType::AT_TEXTURE; | ||
5329 | if (!LLViewerImageList::createUploadFile(src_filename, | ||
5330 | filename, | ||
5331 | IMG_CODEC_JPEG )) | ||
5332 | { | ||
5333 | snprintf(error_message, MAX_STRING, "Problem with file %s:\n\n%s\n", /* Flawfinder: ignore */ | ||
5334 | src_filename.c_str(), LLImageBase::getLastError().c_str()); | ||
5335 | args["[FILE]"] = src_filename; | ||
5336 | args["[ERROR]"] = LLImageBase::getLastError(); | ||
5337 | upload_error(error_message, "ProblemWithFile", filename, args); | ||
5338 | return; | ||
5339 | } | ||
5340 | } | ||
5341 | else if(LLString::compareInsensitive(ext.c_str(),".wav") == 0) | ||
5342 | { | ||
5343 | asset_type = LLAssetType::AT_SOUND; // tag it as audio | ||
5344 | S32 encode_result = 0; | ||
5345 | |||
5346 | S32 bitrate = 128; | ||
5347 | |||
5348 | if (compression_info) | ||
5349 | { | ||
5350 | bitrate = compression_info; | ||
5351 | } | ||
5352 | llinfos << "Attempting to encode wav as an ogg file at " << bitrate << "kbps" << llendl; | ||
5353 | |||
5354 | encode_result = encode_vorbis_file_at(src_filename.c_str(), filename.c_str(), bitrate*1000); | ||
5355 | |||
5356 | if (LLVORBISENC_NOERR != encode_result) | ||
5357 | { | ||
5358 | switch(encode_result) | ||
5359 | { | ||
5360 | case LLVORBISENC_DEST_OPEN_ERR: | ||
5361 | snprintf(error_message, MAX_STRING, "Couldn't open temporary compressed sound file for writing: %s\n", filename.c_str()); /* Flawfinder: ignore */ | ||
5362 | args["[FILE]"] = filename; | ||
5363 | upload_error(error_message, "CannotOpenTemporarySoundFile", filename, args); | ||
5364 | break; | ||
5365 | |||
5366 | default: | ||
5367 | snprintf(error_message, MAX_STRING, "Unknown vorbis encode failure on: %s\n", src_filename.c_str()); /* Flawfinder: ignore */ | ||
5368 | args["[FILE]"] = src_filename; | ||
5369 | upload_error(error_message, "UnknownVorbisEncodeFailure", filename, args); | ||
5370 | break; | ||
5371 | } | ||
5372 | return; | ||
5373 | } | ||
5374 | } | ||
5375 | else if(LLString::compareInsensitive(ext.c_str(),".tmp") == 0) | ||
5376 | { | ||
5377 | // This is a generic .lin resource file | ||
5378 | asset_type = LLAssetType::AT_OBJECT; | ||
5379 | FILE* in = LLFile::fopen(src_filename.c_str(), "rb"); /* Flawfinder: ignore */ | ||
5380 | if (in) | ||
5381 | { | ||
5382 | // read in the file header | ||
5383 | char buf[16384]; /* Flawfinder: ignore */ | ||
5384 | S32 read; /* Flawfinder: ignore */ | ||
5385 | S32 version; | ||
5386 | if (fscanf(in, "LindenResource\nversion %d\n", &version)) | ||
5387 | { | ||
5388 | if (2 == version) | ||
5389 | { | ||
5390 | // *NOTE: This buffer size is hard coded into scanf() below. | ||
5391 | char label[MAX_STRING]; /* Flawfinder: ignore */ | ||
5392 | char value[MAX_STRING]; /* Flawfinder: ignore */ | ||
5393 | S32 tokens_read; | ||
5394 | while (fgets(buf, 1024, in)) | ||
5395 | { | ||
5396 | label[0] = '\0'; | ||
5397 | value[0] = '\0'; | ||
5398 | tokens_read = sscanf( /* Flawfinder: ignore */ | ||
5399 | buf, | ||
5400 | "%254s %254s\n", | ||
5401 | label, value); | ||
5402 | |||
5403 | llinfos << "got: " << label << " = " << value | ||
5404 | << llendl; | ||
5405 | |||
5406 | if (EOF == tokens_read) | ||
5407 | { | ||
5408 | fclose(in); | ||
5409 | snprintf(error_message, MAX_STRING, "corrupt resource file: %s", src_filename.c_str()); /* Flawfinder: ignore */ | ||
5410 | args["[FILE]"] = src_filename; | ||
5411 | upload_error(error_message, "CorruptResourceFile", filename, args); | ||
5412 | return; | ||
5413 | } | ||
5414 | |||
5415 | if (2 == tokens_read) | ||
5416 | { | ||
5417 | if (! strcmp("type", label)) | ||
5418 | { | ||
5419 | asset_type = (LLAssetType::EType)(atoi(value)); | ||
5420 | } | ||
5421 | } | ||
5422 | else | ||
5423 | { | ||
5424 | if (! strcmp("_DATA_", label)) | ||
5425 | { | ||
5426 | // below is the data section | ||
5427 | break; | ||
5428 | } | ||
5429 | } | ||
5430 | // other values are currently discarded | ||
5431 | } | ||
5432 | |||
5433 | } | ||
5434 | else | ||
5435 | { | ||
5436 | fclose(in); | ||
5437 | snprintf(error_message, MAX_STRING, "unknown linden resource file version in file: %s", src_filename.c_str()); /* Flawfinder: ignore */ | ||
5438 | args["[FILE]"] = src_filename; | ||
5439 | upload_error(error_message, "UnknownResourceFileVersion", filename, args); | ||
5440 | return; | ||
5441 | } | ||
5442 | } | ||
5443 | else | ||
5444 | { | ||
5445 | // this is an original binary formatted .lin file | ||
5446 | // start over at the beginning of the file | ||
5447 | fseek(in, 0, SEEK_SET); | ||
5448 | |||
5449 | const S32 MAX_ASSET_DESCRIPTION_LENGTH = 256; | ||
5450 | const S32 MAX_ASSET_NAME_LENGTH = 64; | ||
5451 | S32 header_size = 34 + MAX_ASSET_DESCRIPTION_LENGTH + MAX_ASSET_NAME_LENGTH; | ||
5452 | S16 type_num; | ||
5453 | |||
5454 | // read in and throw out most of the header except for the type | ||
5455 | fread(buf, header_size, 1, in); | ||
5456 | memcpy(&type_num, buf + 16, sizeof(S16)); /* Flawfinder: ignore */ | ||
5457 | asset_type = (LLAssetType::EType)type_num; | ||
5458 | } | ||
5459 | |||
5460 | // copy the file's data segment into another file for uploading | ||
5461 | FILE* out = LLFile::fopen(filename.c_str(), "wb"); /* Flawfinder: ignore */ | ||
5462 | if (out) | ||
5463 | { | ||
5464 | while((read = fread(buf, 1, 16384, in))) /* Flawfinder: ignore */ | ||
5465 | { | ||
5466 | fwrite(buf, 1, read, out); /* Flawfinder: ignore */ | ||
5467 | } | ||
5468 | fclose(out); | ||
5469 | } | ||
5470 | else | ||
5471 | { | ||
5472 | fclose(in); | ||
5473 | snprintf(error_message, MAX_STRING, "Unable to create output file: %s", filename.c_str()); /* Flawfinder: ignore */ | ||
5474 | args["[FILE]"] = filename; | ||
5475 | upload_error(error_message, "UnableToCreateOutputFile", filename, args); | ||
5476 | return; | ||
5477 | } | ||
5478 | |||
5479 | fclose(in); | ||
5480 | } | ||
5481 | else | ||
5482 | { | ||
5483 | llinfos << "Couldn't open .lin file " << src_filename << llendl; | ||
5484 | } | ||
5485 | } | ||
5486 | else if (LLString::compareInsensitive(ext.c_str(),".bvh") == 0) | ||
5487 | { | ||
5488 | snprintf(error_message, MAX_STRING, "We do not currently support bulk upload of animation files\n"); /* Flawfinder: ignore */ | ||
5489 | upload_error(error_message, "DoNotSupportBulkAnimationUpload", filename, args); | ||
5490 | return; | ||
5491 | } | ||
5492 | else | ||
5493 | { | ||
5494 | // Unknown extension | ||
5495 | snprintf(error_message, MAX_STRING, "Unknown file extension %s\nExpected .wav, .tga, .bmp, .jpg, .jpeg, or .bvh", ext.c_str()); /* Flawfinder: ignore */ | ||
5496 | error = TRUE;; | ||
5497 | } | ||
5498 | |||
5499 | // gen a new transaction ID for this asset | ||
5500 | tid.generate(); | ||
5501 | |||
5502 | if (!error) | ||
5503 | { | ||
5504 | uuid = tid.makeAssetID(gAgent.getSecureSessionID()); | ||
5505 | // copy this file into the vfs for upload | ||
5506 | S32 file_size; | ||
5507 | apr_file_t* fp = ll_apr_file_open(filename, LL_APR_RB, &file_size); | ||
5508 | if (fp) | ||
5509 | { | ||
5510 | LLVFile file(gVFS, uuid, asset_type, LLVFile::WRITE); | ||
5511 | |||
5512 | file.setMaxSize(file_size); | ||
5513 | |||
5514 | const S32 buf_size = 65536; | ||
5515 | U8 copy_buf[buf_size]; | ||
5516 | while ((file_size = ll_apr_file_read(fp, copy_buf, buf_size))) | ||
5517 | { | ||
5518 | file.write(copy_buf, file_size); | ||
5519 | } | ||
5520 | apr_file_close(fp); | ||
5521 | } | ||
5522 | else | ||
5523 | { | ||
5524 | snprintf(error_message, MAX_STRING, "Unable to access output file: %s", filename.c_str()); /* Flawfinder: ignore */ | ||
5525 | error = TRUE; | ||
5526 | } | ||
5527 | } | ||
5528 | |||
5529 | if (!error) | ||
5530 | { | ||
5531 | LLString t_disp_name = display_name; | ||
5532 | if (t_disp_name.empty()) | ||
5533 | { | ||
5534 | t_disp_name = src_filename; | ||
5535 | } | ||
5536 | upload_new_resource(tid, asset_type, name, desc, compression_info, // tid | ||
5537 | destination_folder_type, inv_type, next_owner_perm, | ||
5538 | display_name, callback, userdata); | ||
5539 | } | ||
5540 | else | ||
5541 | { | ||
5542 | llwarns << error_message << llendl; | ||
5543 | LLStringBase<char>::format_map_t args; | ||
5544 | args["[ERROR_MESSAGE]"] = error_message; | ||
5545 | gViewerWindow->alertXml("ErrorMessage", args); | ||
5546 | if(LLFile::remove(filename.c_str()) == -1) | ||
5547 | { | ||
5548 | lldebugs << "unable to remove temp file" << llendl; | ||
5549 | } | ||
5550 | LLFilePicker::instance().reset(); | ||
5551 | } | ||
5552 | } | ||
5553 | |||
5554 | void upload_new_resource(const LLTransactionID &tid, LLAssetType::EType asset_type, | ||
5555 | std::string name, | ||
5556 | std::string desc, S32 compression_info, | ||
5557 | LLAssetType::EType destination_folder_type, | ||
5558 | LLInventoryType::EType inv_type, | ||
5559 | U32 next_owner_perm, | ||
5560 | const LLString& display_name, | ||
5561 | LLAssetStorage::LLStoreAssetCallback callback, | ||
5562 | void *userdata) | ||
5563 | { | ||
5564 | LLAssetID uuid = tid.makeAssetID(gAgent.getSecureSessionID()); | ||
5565 | |||
5566 | if( LLAssetType::AT_SOUND == asset_type ) | ||
5567 | { | ||
5568 | gViewerStats->incStat(LLViewerStats::ST_UPLOAD_SOUND_COUNT ); | ||
5569 | } | ||
5570 | else | ||
5571 | if( LLAssetType::AT_TEXTURE == asset_type ) | ||
5572 | { | ||
5573 | gViewerStats->incStat(LLViewerStats::ST_UPLOAD_TEXTURE_COUNT ); | ||
5574 | } | ||
5575 | else | ||
5576 | if( LLAssetType::AT_ANIMATION == asset_type) | ||
5577 | { | ||
5578 | gViewerStats->incStat(LLViewerStats::ST_UPLOAD_ANIM_COUNT ); | ||
5579 | } | ||
5580 | |||
5581 | if(LLInventoryType::IT_NONE == inv_type) | ||
5582 | { | ||
5583 | inv_type = LLInventoryType::defaultForAssetType(asset_type); | ||
5584 | } | ||
5585 | LLString::stripNonprintable(name); | ||
5586 | LLString::stripNonprintable(desc); | ||
5587 | if(name.empty()) | ||
5588 | { | ||
5589 | name = "(No Name)"; | ||
5590 | } | ||
5591 | if(desc.empty()) | ||
5592 | { | ||
5593 | desc = "(No Description)"; | ||
5594 | } | ||
5595 | |||
5596 | // At this point, we're ready for the upload. | ||
5597 | LLString upload_message = "Uploading...\n\n"; | ||
5598 | upload_message.append(display_name); | ||
5599 | LLUploadDialog::modalUploadDialog(upload_message); | ||
5600 | |||
5601 | llinfos << "*** Uploading: " << llendl; | ||
5602 | llinfos << "Type: " << LLAssetType::lookup(asset_type) << llendl; | ||
5603 | llinfos << "UUID: " << uuid << llendl; | ||
5604 | llinfos << "Name: " << name << llendl; | ||
5605 | llinfos << "Desc: " << desc << llendl; | ||
5606 | lldebugs << "Folder: " << gInventory.findCategoryUUIDForType(destination_folder_type) << llendl; | ||
5607 | lldebugs << "Asset Type: " << LLAssetType::lookup(asset_type) << llendl; | ||
5608 | std::string url = gAgent.getRegion()->getCapability("NewFileAgentInventory"); | ||
5609 | if (!url.empty()) | ||
5610 | { | ||
5611 | llinfos << "New Agent Inventory via capability" << llendl; | ||
5612 | LLSD body; | ||
5613 | body["folder_id"] = gInventory.findCategoryUUIDForType((destination_folder_type == LLAssetType::AT_NONE) ? asset_type : destination_folder_type); | ||
5614 | body["asset_type"] = LLAssetType::lookup(asset_type); | ||
5615 | body["inventory_type"] = LLInventoryType::lookup(inv_type); | ||
5616 | body["name"] = name; | ||
5617 | body["description"] = desc; | ||
5618 | |||
5619 | std::ostringstream llsdxml; | ||
5620 | LLSDSerialize::toXML(body, llsdxml); | ||
5621 | lldebugs << "posting body to capability: " << llsdxml.str() << llendl; | ||
5622 | LLHTTPClient::post(url, body, new LLNewAgentInventoryResponder(body, uuid, asset_type)); | ||
5623 | } | ||
5624 | else | ||
5625 | { | ||
5626 | llinfos << "NewAgentInventory capability not found, new agent inventory via asset system." << llendl; | ||
5627 | // check for adequate funds | ||
5628 | // TODO: do this check on the sim | ||
5629 | if (LLAssetType::AT_SOUND == asset_type || | ||
5630 | LLAssetType::AT_TEXTURE == asset_type || | ||
5631 | LLAssetType::AT_ANIMATION == asset_type) | ||
5632 | { | ||
5633 | S32 upload_cost = gGlobalEconomy->getPriceUpload(); | ||
5634 | S32 balance = gStatusBar->getBalance(); | ||
5635 | if (balance < upload_cost) | ||
5636 | { | ||
5637 | // insufficient funds, bail on this upload | ||
5638 | LLFloaterBuyCurrency::buyCurrency("Uploading costs", upload_cost); | ||
5639 | return; | ||
5640 | } | ||
5641 | } | ||
5642 | |||
5643 | LLResourceData* data = new LLResourceData; | ||
5644 | data->mAssetInfo.mTransactionID = tid; | ||
5645 | data->mAssetInfo.mUuid = uuid; | ||
5646 | data->mAssetInfo.mType = asset_type; | ||
5647 | data->mAssetInfo.mCreatorID = gAgentID; | ||
5648 | data->mInventoryType = inv_type; | ||
5649 | data->mNextOwnerPerm = next_owner_perm; | ||
5650 | data->mUserData = userdata; | ||
5651 | data->mAssetInfo.setName(name); | ||
5652 | data->mAssetInfo.setDescription(desc); | ||
5653 | data->mPreferredLocation = destination_folder_type; | ||
5654 | |||
5655 | LLAssetStorage::LLStoreAssetCallback asset_callback = &upload_done_callback; | ||
5656 | if (callback) | ||
5657 | { | ||
5658 | asset_callback = callback; | ||
5659 | } | ||
5660 | gAssetStorage->storeAssetData(data->mAssetInfo.mTransactionID, data->mAssetInfo.mType, | ||
5661 | asset_callback, | ||
5662 | (void*)data, | ||
5663 | FALSE); | ||
5664 | } | ||
5665 | } | ||
5666 | |||
5667 | void upload_done_callback(const LLUUID& uuid, void* user_data, S32 result) // StoreAssetData callback (fixed) | ||
5668 | { | ||
5669 | LLResourceData* data = (LLResourceData*)user_data; | ||
5670 | //LLAssetType::EType pref_loc = data->mPreferredLocation; | ||
5671 | BOOL is_balance_sufficient = TRUE; | ||
5672 | if(result >= 0) | ||
5673 | { | ||
5674 | LLAssetType::EType dest_loc = (data->mPreferredLocation == LLAssetType::AT_NONE) ? data->mAssetInfo.mType : data->mPreferredLocation; | ||
5675 | |||
5676 | if (LLAssetType::AT_SOUND == data->mAssetInfo.mType || | ||
5677 | LLAssetType::AT_TEXTURE == data->mAssetInfo.mType || | ||
5678 | LLAssetType::AT_ANIMATION == data->mAssetInfo.mType) | ||
5679 | { | ||
5680 | // Charge the user for the upload. | ||
5681 | LLViewerRegion* region = gAgent.getRegion(); | ||
5682 | S32 upload_cost = gGlobalEconomy->getPriceUpload(); | ||
5683 | |||
5684 | if(!(can_afford_transaction(upload_cost))) | ||
5685 | { | ||
5686 | LLFloaterBuyCurrency::buyCurrency( | ||
5687 | llformat("Uploading %s costs", | ||
5688 | data->mAssetInfo.getName().c_str()), | ||
5689 | upload_cost); | ||
5690 | is_balance_sufficient = FALSE; | ||
5691 | } | ||
5692 | else if(region) | ||
5693 | { | ||
5694 | // Charge user for upload | ||
5695 | gStatusBar->debitBalance(upload_cost); | ||
5696 | |||
5697 | LLMessageSystem* msg = gMessageSystem; | ||
5698 | msg->newMessageFast(_PREHASH_MoneyTransferRequest); | ||
5699 | msg->nextBlockFast(_PREHASH_AgentData); | ||
5700 | msg->addUUIDFast(_PREHASH_AgentID, gAgent.getID()); | ||
5701 | msg->addUUIDFast(_PREHASH_SessionID, gAgent.getSessionID()); | ||
5702 | msg->nextBlockFast(_PREHASH_MoneyData); | ||
5703 | msg->addUUIDFast(_PREHASH_SourceID, gAgent.getID()); | ||
5704 | msg->addUUIDFast(_PREHASH_DestID, LLUUID::null); | ||
5705 | msg->addU8("Flags", 0); | ||
5706 | msg->addS32Fast(_PREHASH_Amount, upload_cost); | ||
5707 | msg->addU8Fast(_PREHASH_AggregatePermNextOwner, (U8)LLAggregatePermissions::AP_EMPTY); | ||
5708 | msg->addU8Fast(_PREHASH_AggregatePermInventory, (U8)LLAggregatePermissions::AP_EMPTY); | ||
5709 | msg->addS32Fast(_PREHASH_TransactionType, TRANS_UPLOAD_CHARGE); | ||
5710 | msg->addStringFast(_PREHASH_Description, NULL); | ||
5711 | msg->sendReliable(region->getHost()); | ||
5712 | } | ||
5713 | } | ||
5714 | |||
5715 | if(is_balance_sufficient) | ||
5716 | { | ||
5717 | // Actually add the upload to inventory | ||
5718 | llinfos << "Adding " << uuid << " to inventory." << llendl; | ||
5719 | LLUUID folder_id(gInventory.findCategoryUUIDForType(dest_loc)); | ||
5720 | if(folder_id.notNull()) | ||
5721 | { | ||
5722 | U32 next_owner_perm = data->mNextOwnerPerm; | ||
5723 | if(PERM_NONE == next_owner_perm) | ||
5724 | { | ||
5725 | next_owner_perm = PERM_MOVE | PERM_TRANSFER; | ||
5726 | } | ||
5727 | create_inventory_item(gAgent.getID(), gAgent.getSessionID(), | ||
5728 | folder_id, data->mAssetInfo.mTransactionID, data->mAssetInfo.getName(), | ||
5729 | data->mAssetInfo.getDescription(), data->mAssetInfo.mType, | ||
5730 | data->mInventoryType, NOT_WEARABLE, next_owner_perm, | ||
5731 | LLPointer<LLInventoryCallback>(NULL)); | ||
5732 | } | ||
5733 | else | ||
5734 | { | ||
5735 | llwarns << "Can't find a folder to put it in" << llendl; | ||
5736 | } | ||
5737 | } | ||
5738 | } | ||
5739 | else // if(result >= 0) | ||
5740 | { | ||
5741 | LLStringBase<char>::format_map_t args; | ||
5742 | args["[FILE]"] = LLInventoryType::lookupHumanReadable(data->mInventoryType); | ||
5743 | args["[REASON]"] = LLString(LLAssetStorage::getErrorString(result)); | ||
5744 | gViewerWindow->alertXml("CannotUploadReason", args); | ||
5745 | } | ||
5746 | |||
5747 | LLUploadDialog::modalUploadFinished(); | ||
5748 | delete data; | ||
5749 | |||
5750 | // *NOTE: This is a pretty big hack. What this does is check the | ||
5751 | // file picker if there are any more pending uploads. If so, | ||
5752 | // upload that file. | ||
5753 | const char* next_file = LLFilePicker::instance().getNextFile(); | ||
5754 | if(is_balance_sufficient && next_file) | ||
5755 | { | ||
5756 | const char* name = LLFilePicker::instance().getDirname(); | ||
5757 | |||
5758 | LLString asset_name = name; | ||
5759 | LLString::replaceNonstandardASCII( asset_name, '?' ); | ||
5760 | LLString::replaceChar(asset_name, '|', '?'); | ||
5761 | LLString::stripNonprintable(asset_name); | ||
5762 | LLString::trim(asset_name); | ||
5763 | |||
5764 | char* asset_name_str = (char*)asset_name.c_str(); | ||
5765 | char* end_p = strrchr(asset_name_str, '.'); // strip extension if exists | ||
5766 | if( !end_p ) | ||
5767 | { | ||
5768 | end_p = asset_name_str + strlen( asset_name_str ); /* Flawfinder: ignore */ | ||
5769 | } | ||
5770 | |||
5771 | S32 len = llmin( (S32) (DB_INV_ITEM_NAME_STR_LEN), (S32) (end_p - asset_name_str) ); | ||
5772 | |||
5773 | asset_name = asset_name.substr( 0, len ); | ||
5774 | |||
5775 | upload_new_resource(next_file, asset_name, asset_name, // file | ||
5776 | 0, LLAssetType::AT_NONE, LLInventoryType::IT_NONE); | ||
5777 | } | ||
5778 | } | ||
5779 | 4871 | ||
5780 | LLUUID gExporterRequestID; | 4872 | LLUUID gExporterRequestID; |
5781 | LLString gExportDirectory; | 4873 | LLString gExportDirectory; |
@@ -7634,15 +6726,6 @@ BOOL enable_not_thirdperson(void*) | |||
7634 | return !gAgent.cameraThirdPerson(); | 6726 | return !gAgent.cameraThirdPerson(); |
7635 | } | 6727 | } |
7636 | 6728 | ||
7637 | class LLFileEnableUpload : public view_listener_t | ||
7638 | { | ||
7639 | bool handleEvent(LLPointer<LLEvent> event, const LLSD& userdata) | ||
7640 | { | ||
7641 | bool new_value = gStatusBar && gGlobalEconomy && (gStatusBar->getBalance() >= gGlobalEconomy->getPriceUpload()); | ||
7642 | gMenuHolder->findControl(userdata["control"].asString())->setValue(new_value); | ||
7643 | return true; | ||
7644 | } | ||
7645 | }; | ||
7646 | 6729 | ||
7647 | BOOL enable_export_selected(void *) | 6730 | BOOL enable_export_selected(void *) |
7648 | { | 6731 | { |
@@ -7857,14 +6940,6 @@ void reload_vertex_shader(void *) | |||
7857 | //THIS WOULD BE AN AWESOME PLACE TO RELOAD SHADERS... just a thought - DaveP | 6940 | //THIS WOULD BE AN AWESOME PLACE TO RELOAD SHADERS... just a thought - DaveP |
7858 | } | 6941 | } |
7859 | 6942 | ||
7860 | void flush_animations(void *) | ||
7861 | { | ||
7862 | if (gAgent.getAvatarObject()) | ||
7863 | { | ||
7864 | gAgent.getAvatarObject()->resetAnimations(); | ||
7865 | } | ||
7866 | } | ||
7867 | |||
7868 | void slow_mo_animations(void*) | 6943 | void slow_mo_animations(void*) |
7869 | { | 6944 | { |
7870 | static BOOL slow_mo = FALSE; | 6945 | static BOOL slow_mo = FALSE; |
@@ -8450,24 +7525,10 @@ class LLToolsSelectTool : public view_listener_t | |||
8450 | } | 7525 | } |
8451 | }; | 7526 | }; |
8452 | 7527 | ||
8453 | void initialize_menu_actions() | 7528 | void initialize_menus() |
8454 | { | 7529 | { |
8455 | // File menu | 7530 | // File menu |
8456 | (new LLFileUploadImage())->registerListener(gMenuHolder, "File.UploadImage"); | 7531 | init_menu_file(); |
8457 | (new LLFileUploadSound())->registerListener(gMenuHolder, "File.UploadSound"); | ||
8458 | (new LLFileUploadAnim())->registerListener(gMenuHolder, "File.UploadAnim"); | ||
8459 | (new LLFileUploadBulk())->registerListener(gMenuHolder, "File.UploadBulk"); | ||
8460 | (new LLFileCloseWindow())->registerListener(gMenuHolder, "File.CloseWindow"); | ||
8461 | (new LLFileEnableCloseWindow())->registerListener(gMenuHolder, "File.EnableCloseWindow"); | ||
8462 | (new LLFileSaveTexture())->registerListener(gMenuHolder, "File.SaveTexture"); | ||
8463 | (new LLFileTakeSnapshot())->registerListener(gMenuHolder, "File.TakeSnapshot"); | ||
8464 | (new LLFileTakeSnapshotToDisk())->registerListener(gMenuHolder, "File.TakeSnapshotToDisk"); | ||
8465 | (new LLFileSaveMovie())->registerListener(gMenuHolder, "File.SaveMovie"); | ||
8466 | (new LLFileSetWindowSize())->registerListener(gMenuHolder, "File.SetWindowSize"); | ||
8467 | (new LLFileQuit())->registerListener(gMenuHolder, "File.Quit"); | ||
8468 | |||
8469 | (new LLFileEnableUpload())->registerListener(gMenuHolder, "File.EnableUpload"); | ||
8470 | (new LLFileEnableSaveAs())->registerListener(gMenuHolder, "File.EnableSaveAs"); | ||
8471 | 7532 | ||
8472 | // Edit menu | 7533 | // Edit menu |
8473 | (new LLEditUndo())->registerListener(gMenuHolder, "Edit.Undo"); | 7534 | (new LLEditUndo())->registerListener(gMenuHolder, "Edit.Undo"); |
diff --git a/linden/indra/newview/llviewermenu.h b/linden/indra/newview/llviewermenu.h index ac2a57a..c223a3a 100644 --- a/linden/indra/newview/llviewermenu.h +++ b/linden/indra/newview/llviewermenu.h | |||
@@ -29,8 +29,6 @@ | |||
29 | #ifndef LL_LLVIEWERMENU_H | 29 | #ifndef LL_LLVIEWERMENU_H |
30 | #define LL_LLVIEWERMENU_H | 30 | #define LL_LLVIEWERMENU_H |
31 | 31 | ||
32 | #include "llassetstorage.h" | ||
33 | #include "llinventory.h" | ||
34 | #include "llmenugl.h" | 32 | #include "llmenugl.h" |
35 | 33 | ||
36 | //newview includes | 34 | //newview includes |
@@ -41,14 +39,6 @@ class LLView; | |||
41 | class LLParcelSelection; | 39 | class LLParcelSelection; |
42 | class LLObjectSelection; | 40 | class LLObjectSelection; |
43 | 41 | ||
44 | struct LLResourceData | ||
45 | { | ||
46 | LLAssetInfo mAssetInfo; | ||
47 | LLAssetType::EType mPreferredLocation; | ||
48 | LLInventoryType::EType mInventoryType; | ||
49 | U32 mNextOwnerPerm; | ||
50 | void *mUserData; | ||
51 | }; | ||
52 | 42 | ||
53 | void pre_init_menus(); | 43 | void pre_init_menus(); |
54 | void init_menus(); | 44 | void init_menus(); |
@@ -114,25 +104,6 @@ bool handle_give_money_dialog(); | |||
114 | bool handle_object_open(); | 104 | bool handle_object_open(); |
115 | bool handle_go_to(); | 105 | bool handle_go_to(); |
116 | 106 | ||
117 | void upload_new_resource(const LLString& src_filename, std::string name, | ||
118 | std::string desc, S32 compression_info, | ||
119 | LLAssetType::EType destination_folder_type, | ||
120 | LLInventoryType::EType inv_type, | ||
121 | U32 next_owner_perm = PERM_NONE, | ||
122 | const LLString& display_name = LLString::null, | ||
123 | LLAssetStorage::LLStoreAssetCallback callback = NULL, | ||
124 | void *userdata = NULL); | ||
125 | |||
126 | void upload_new_resource(const LLTransactionID &tid, LLAssetType::EType type, | ||
127 | std::string name, | ||
128 | std::string desc, S32 compression_info, | ||
129 | LLAssetType::EType destination_folder_type, | ||
130 | LLInventoryType::EType inv_type, | ||
131 | U32 next_owner_perm = PERM_NONE, | ||
132 | const LLString& display_name = LLString::null, | ||
133 | LLAssetStorage::LLStoreAssetCallback callback = NULL, | ||
134 | void *userdata = NULL); | ||
135 | |||
136 | // Export to XML or Collada | 107 | // Export to XML or Collada |
137 | void handle_export_selected( void * ); | 108 | void handle_export_selected( void * ); |
138 | 109 | ||
diff --git a/linden/indra/newview/llviewermenufile.cpp b/linden/indra/newview/llviewermenufile.cpp new file mode 100644 index 0000000..6954b1c --- /dev/null +++ b/linden/indra/newview/llviewermenufile.cpp | |||
@@ -0,0 +1,1022 @@ | |||
1 | /** | ||
2 | * @file llviewermenufile.cpp | ||
3 | * @brief "File" menu in the main menu bar. | ||
4 | * | ||
5 | * Copyright (c) 2002-2007, Linden Research, Inc. | ||
6 | * | ||
7 | * Second Life Viewer Source Code | ||
8 | * The source code in this file ("Source Code") is provided by Linden Lab | ||
9 | * to you under the terms of the GNU General Public License, version 2.0 | ||
10 | * ("GPL"), unless you have obtained a separate licensing agreement | ||
11 | * ("Other License"), formally executed by you and Linden Lab. Terms of | ||
12 | * the GPL can be found in doc/GPL-license.txt in this distribution, or | ||
13 | * online at http://secondlife.com/developers/opensource/gplv2 | ||
14 | * | ||
15 | * There are special exceptions to the terms and conditions of the GPL as | ||
16 | * it is applied to this Source Code. View the full text of the exception | ||
17 | * in the file doc/FLOSS-exception.txt in this software distribution, or | ||
18 | * online at http://secondlife.com/developers/opensource/flossexception | ||
19 | * | ||
20 | * By copying, modifying or distributing this software, you acknowledge | ||
21 | * that you have read and understood your obligations described above, | ||
22 | * and agree to abide by those obligations. | ||
23 | * | ||
24 | * ALL LINDEN LAB SOURCE CODE IS PROVIDED "AS IS." LINDEN LAB MAKES NO | ||
25 | * WARRANTIES, EXPRESS, IMPLIED OR OTHERWISE, REGARDING ITS ACCURACY, | ||
26 | * COMPLETENESS OR PERFORMANCE. | ||
27 | */ | ||
28 | |||
29 | #include "llviewerprecompiledheaders.h" | ||
30 | |||
31 | #include "llviewermenufile.h" | ||
32 | |||
33 | // project includes | ||
34 | #include "llagent.h" | ||
35 | #include "llfilepicker.h" | ||
36 | #include "llfloateranimpreview.h" | ||
37 | #include "llfloaterbuycurrency.h" | ||
38 | #include "llfloaterimagepreview.h" | ||
39 | #include "llfloaterimport.h" | ||
40 | #include "llfloaternamedesc.h" | ||
41 | #include "llfloatersnapshot.h" | ||
42 | #include "llinventorymodel.h" // gInventory | ||
43 | #include "llresourcedata.h" | ||
44 | #include "llstatusbar.h" | ||
45 | #include "llviewercontrol.h" // gSavedSettings | ||
46 | #include "llviewerimagelist.h" | ||
47 | #include "llvieweruictrlfactory.h" | ||
48 | #include "llviewermenu.h" // gMenuHolder | ||
49 | #include "llviewerregion.h" | ||
50 | #include "llviewerstats.h" | ||
51 | #include "llviewerwindow.h" | ||
52 | #include "viewer.h" // app_request_quit() | ||
53 | |||
54 | // linden libraries | ||
55 | #include "llassetuploadresponders.h" | ||
56 | #include "lleconomy.h" | ||
57 | #include "llhttpclient.h" | ||
58 | #include "llmemberlistener.h" | ||
59 | #include "llsdserialize.h" | ||
60 | #include "llstring.h" | ||
61 | #include "lltransactiontypes.h" | ||
62 | #include "lluuid.h" | ||
63 | #include "vorbisencode.h" | ||
64 | |||
65 | // system libraries | ||
66 | #include <boost/tokenizer.hpp> | ||
67 | |||
68 | typedef LLMemberListener<LLView> view_listener_t; | ||
69 | |||
70 | |||
71 | class LLFileEnableSaveAs : public view_listener_t | ||
72 | { | ||
73 | bool handleEvent(LLPointer<LLEvent> event, const LLSD& userdata) | ||
74 | { | ||
75 | bool new_value = gFloaterView->getFrontmost() && gFloaterView->getFrontmost()->canSaveAs(); | ||
76 | gMenuHolder->findControl(userdata["control"].asString())->setValue(new_value); | ||
77 | return true; | ||
78 | } | ||
79 | }; | ||
80 | |||
81 | class LLFileEnableUpload : public view_listener_t | ||
82 | { | ||
83 | bool handleEvent(LLPointer<LLEvent> event, const LLSD& userdata) | ||
84 | { | ||
85 | bool new_value = gStatusBar && gGlobalEconomy && (gStatusBar->getBalance() >= gGlobalEconomy->getPriceUpload()); | ||
86 | gMenuHolder->findControl(userdata["control"].asString())->setValue(new_value); | ||
87 | return true; | ||
88 | } | ||
89 | }; | ||
90 | |||
91 | /** | ||
92 | char* upload_pick(void* data) | ||
93 | |||
94 | If applicable, brings up a file chooser in which the user selects a file | ||
95 | to upload for a particular task. If the file is valid for the given action, | ||
96 | returns the string to the full path filename, else returns NULL. | ||
97 | Data is the load filter for the type of file as defined in LLFilePicker. | ||
98 | **/ | ||
99 | const char* upload_pick(void* data) | ||
100 | { | ||
101 | if( gAgent.cameraMouselook() ) | ||
102 | { | ||
103 | gAgent.changeCameraToDefault(); | ||
104 | // This doesn't seem necessary. JC | ||
105 | // display(); | ||
106 | } | ||
107 | |||
108 | LLFilePicker::ELoadFilter type; | ||
109 | if(data) | ||
110 | { | ||
111 | type = (LLFilePicker::ELoadFilter)((intptr_t)data); | ||
112 | } | ||
113 | else | ||
114 | { | ||
115 | type = LLFilePicker::FFLOAD_ALL; | ||
116 | } | ||
117 | |||
118 | LLFilePicker& picker = LLFilePicker::instance(); | ||
119 | if (!picker.getOpenFile(type)) | ||
120 | { | ||
121 | llinfos << "Couldn't import objects from file" << llendl; | ||
122 | return NULL; | ||
123 | } | ||
124 | |||
125 | const char* filename = picker.getFirstFile(); | ||
126 | const char* ext = strrchr(filename, '.'); | ||
127 | |||
128 | //strincmp doesn't like NULL pointers | ||
129 | if (ext == NULL) | ||
130 | { | ||
131 | const char* short_name = strrchr(filename, | ||
132 | *gDirUtilp->getDirDelimiter().c_str()); | ||
133 | |||
134 | // No extension | ||
135 | LLStringBase<char>::format_map_t args; | ||
136 | args["[FILE]"] = LLString(short_name + 1); | ||
137 | gViewerWindow->alertXml("NoFileExtension", args); | ||
138 | return NULL; | ||
139 | } | ||
140 | else | ||
141 | { | ||
142 | //so there is an extension | ||
143 | //loop over the valid extensions and compare to see | ||
144 | //if the extension is valid | ||
145 | |||
146 | //now grab the set of valid file extensions | ||
147 | const char* valids = build_extensions_string(type); | ||
148 | std::string valid_extensions = std::string(valids); | ||
149 | |||
150 | BOOL ext_valid = FALSE; | ||
151 | |||
152 | typedef boost::tokenizer<boost::char_separator<char> > tokenizer; | ||
153 | boost::char_separator<char> sep(" "); | ||
154 | tokenizer tokens(valid_extensions, sep); | ||
155 | tokenizer::iterator token_iter; | ||
156 | |||
157 | //now loop over all valid file extensions | ||
158 | //and compare them to the extension of the file | ||
159 | //to be uploaded | ||
160 | for( token_iter = tokens.begin(); | ||
161 | token_iter != tokens.end() && ext_valid != TRUE; | ||
162 | ++token_iter) | ||
163 | { | ||
164 | const char* cur_token = token_iter->c_str(); | ||
165 | |||
166 | if (0 == strnicmp(cur_token, ext, strlen(cur_token)) || /* Flawfinder: ignore */ | ||
167 | 0 == strnicmp(cur_token, "*.*", strlen(cur_token))) /* Flawfinder: ignore */ | ||
168 | { | ||
169 | //valid extension | ||
170 | //or the acceptable extension is any | ||
171 | ext_valid = TRUE; | ||
172 | } | ||
173 | }//end for (loop over all tokens) | ||
174 | |||
175 | if (ext_valid == FALSE) | ||
176 | { | ||
177 | //should only get here if the extension exists | ||
178 | //but is invalid | ||
179 | LLStringBase<char>::format_map_t args; | ||
180 | args["[EXTENSION]"] = ext; | ||
181 | args["[VALIDS]"] = valids; | ||
182 | gViewerWindow->alertXml("InvalidFileExtension", args); | ||
183 | return NULL; | ||
184 | } | ||
185 | }//end else (non-null extension) | ||
186 | |||
187 | //valid file extension | ||
188 | |||
189 | //now we check to see | ||
190 | //if the file is actually a valid image/sound/etc. | ||
191 | if (type == LLFilePicker::FFLOAD_WAV) | ||
192 | { | ||
193 | // pre-qualify wavs to make sure the format is acceptable | ||
194 | char error_msg[MAX_STRING]; /* Flawfinder: ignore */ | ||
195 | if (check_for_invalid_wav_formats(filename,error_msg)) | ||
196 | { | ||
197 | llinfos << error_msg << ": " << filename << llendl; | ||
198 | LLStringBase<char>::format_map_t args; | ||
199 | args["[FILE]"] = filename; | ||
200 | gViewerWindow->alertXml( error_msg, args ); | ||
201 | return NULL; | ||
202 | } | ||
203 | }//end if a wave/sound file | ||
204 | |||
205 | |||
206 | return filename; | ||
207 | } | ||
208 | |||
209 | void handle_upload_object(void* data) | ||
210 | { | ||
211 | const char* filename = upload_pick(data); | ||
212 | if (filename) | ||
213 | { | ||
214 | // start the import | ||
215 | LLFloaterImport* floaterp = new LLFloaterImport(filename); | ||
216 | gUICtrlFactory->buildFloater(floaterp, "floater_import.xml"); | ||
217 | } | ||
218 | } | ||
219 | |||
220 | class LLFileUploadImage : public view_listener_t | ||
221 | { | ||
222 | bool handleEvent(LLPointer<LLEvent> event, const LLSD& userdata) | ||
223 | { | ||
224 | const char* filename = upload_pick((void *)(S32)LLFilePicker::FFLOAD_IMAGE); | ||
225 | if (filename) | ||
226 | { | ||
227 | LLFloaterImagePreview* floaterp = new LLFloaterImagePreview(filename); | ||
228 | gUICtrlFactory->buildFloater(floaterp, "floater_image_preview.xml"); | ||
229 | } | ||
230 | return TRUE; | ||
231 | } | ||
232 | }; | ||
233 | |||
234 | class LLFileUploadSound : public view_listener_t | ||
235 | { | ||
236 | bool handleEvent(LLPointer<LLEvent> event, const LLSD& userdata) | ||
237 | { | ||
238 | const char* filename = upload_pick((void*)((S32)LLFilePicker::FFLOAD_WAV)); | ||
239 | if (filename) | ||
240 | { | ||
241 | LLFloaterNameDesc* floaterp = new LLFloaterNameDesc(filename); | ||
242 | gUICtrlFactory->buildFloater(floaterp, "floater_sound_preview.xml"); | ||
243 | } | ||
244 | return true; | ||
245 | } | ||
246 | }; | ||
247 | |||
248 | class LLFileUploadAnim : public view_listener_t | ||
249 | { | ||
250 | bool handleEvent(LLPointer<LLEvent> event, const LLSD& userdata) | ||
251 | { | ||
252 | const char* filename = upload_pick((void*)((S32)LLFilePicker::FFLOAD_ANIM)); | ||
253 | if (filename) | ||
254 | { | ||
255 | LLFloaterAnimPreview* floaterp = new LLFloaterAnimPreview(filename); | ||
256 | gUICtrlFactory->buildFloater(floaterp, "floater_animation_preview.xml"); | ||
257 | } | ||
258 | return true; | ||
259 | } | ||
260 | }; | ||
261 | |||
262 | class LLFileUploadBulk : public view_listener_t | ||
263 | { | ||
264 | bool handleEvent(LLPointer<LLEvent> event, const LLSD& userdata) | ||
265 | { | ||
266 | if( gAgent.cameraMouselook() ) | ||
267 | { | ||
268 | gAgent.changeCameraToDefault(); | ||
269 | } | ||
270 | |||
271 | // TODO: | ||
272 | // Iterate over all files | ||
273 | // Check extensions for uploadability, cost | ||
274 | // Check user balance for entire cost | ||
275 | // Charge user entire cost | ||
276 | // Loop, uploading | ||
277 | // If an upload fails, refund the user for that one | ||
278 | // | ||
279 | // Also fix single upload to charge first, then refund | ||
280 | |||
281 | LLFilePicker& picker = LLFilePicker::instance(); | ||
282 | if (picker.getMultipleOpenFiles()) | ||
283 | { | ||
284 | const char* filename = picker.getFirstFile(); | ||
285 | const char* name = picker.getDirname(); | ||
286 | |||
287 | LLString asset_name = name; | ||
288 | LLString::replaceNonstandardASCII( asset_name, '?' ); | ||
289 | LLString::replaceChar(asset_name, '|', '?'); | ||
290 | LLString::stripNonprintable(asset_name); | ||
291 | LLString::trim(asset_name); | ||
292 | |||
293 | char* asset_name_str = (char*)asset_name.c_str(); | ||
294 | char* end_p = strrchr(asset_name_str, '.'); // strip extension if exists | ||
295 | if( !end_p ) | ||
296 | { | ||
297 | end_p = asset_name_str + strlen( asset_name_str ); /* Flawfinder: ignore */ | ||
298 | } | ||
299 | |||
300 | S32 len = llmin( (S32) (DB_INV_ITEM_NAME_STR_LEN), (S32) (end_p - asset_name_str) ); | ||
301 | |||
302 | asset_name = asset_name.substr( 0, len ); | ||
303 | |||
304 | upload_new_resource(filename, asset_name, asset_name, 0, LLAssetType::AT_NONE, LLInventoryType::IT_NONE); // file | ||
305 | } | ||
306 | else | ||
307 | { | ||
308 | llinfos << "Couldn't import objects from file" << llendl; | ||
309 | } | ||
310 | return true; | ||
311 | } | ||
312 | }; | ||
313 | |||
314 | void upload_error(const char* error_message, const char* label, const std::string filename, const LLStringBase<char>::format_map_t args) | ||
315 | { | ||
316 | llwarns << error_message << llendl; | ||
317 | gViewerWindow->alertXml(label, args); | ||
318 | if(remove(filename.c_str()) == -1) | ||
319 | { | ||
320 | lldebugs << "unable to remove temp file" << llendl; | ||
321 | } | ||
322 | LLFilePicker::instance().reset(); | ||
323 | } | ||
324 | |||
325 | class LLFileEnableCloseWindow : public view_listener_t | ||
326 | { | ||
327 | bool handleEvent(LLPointer<LLEvent> event, const LLSD& userdata) | ||
328 | { | ||
329 | bool new_value = gFloaterView->getFocusedFloater() != NULL || gSnapshotFloaterView->getFocusedFloater() != NULL; | ||
330 | // horrendously opaque, this code | ||
331 | gMenuHolder->findControl(userdata["control"].asString())->setValue(new_value); | ||
332 | return true; | ||
333 | } | ||
334 | }; | ||
335 | |||
336 | class LLFileCloseWindow : public view_listener_t | ||
337 | { | ||
338 | bool handleEvent(LLPointer<LLEvent> event, const LLSD& userdata) | ||
339 | { | ||
340 | LLFloater::closeFocusedFloater(); | ||
341 | |||
342 | return true; | ||
343 | } | ||
344 | }; | ||
345 | |||
346 | class LLFileCloseAllWindows : public view_listener_t | ||
347 | { | ||
348 | bool handleEvent(LLPointer<LLEvent> event, const LLSD& userdata) | ||
349 | { | ||
350 | bool app_quitting = false; | ||
351 | gFloaterView->closeAllChildren(app_quitting); | ||
352 | |||
353 | return true; | ||
354 | } | ||
355 | }; | ||
356 | |||
357 | class LLFileSaveTexture : public view_listener_t | ||
358 | { | ||
359 | bool handleEvent(LLPointer<LLEvent> event, const LLSD& userdata) | ||
360 | { | ||
361 | LLFloater* top = gFloaterView->getFrontmost(); | ||
362 | if (top) | ||
363 | { | ||
364 | top->saveAs(); | ||
365 | } | ||
366 | return true; | ||
367 | } | ||
368 | }; | ||
369 | |||
370 | class LLFileTakeSnapshot : public view_listener_t | ||
371 | { | ||
372 | bool handleEvent(LLPointer<LLEvent> event, const LLSD& userdata) | ||
373 | { | ||
374 | LLFloaterSnapshot::show(NULL); | ||
375 | return true; | ||
376 | } | ||
377 | }; | ||
378 | |||
379 | class LLFileTakeSnapshotToDisk : public view_listener_t | ||
380 | { | ||
381 | bool handleEvent(LLPointer<LLEvent> event, const LLSD& userdata) | ||
382 | { | ||
383 | LLPointer<LLImageRaw> raw = new LLImageRaw; | ||
384 | |||
385 | S32 width = gViewerWindow->getWindowDisplayWidth(); | ||
386 | S32 height = gViewerWindow->getWindowDisplayHeight(); | ||
387 | |||
388 | if (gSavedSettings.getBOOL("HighResSnapshot")) | ||
389 | { | ||
390 | width *= 2; | ||
391 | height *= 2; | ||
392 | } | ||
393 | |||
394 | if (gViewerWindow->rawSnapshot(raw, | ||
395 | width, | ||
396 | height, | ||
397 | TRUE, | ||
398 | gSavedSettings.getBOOL("RenderUIInSnapshot"), | ||
399 | FALSE)) | ||
400 | { | ||
401 | if (!gQuietSnapshot) | ||
402 | { | ||
403 | gViewerWindow->playSnapshotAnimAndSound(); | ||
404 | } | ||
405 | LLImageBase::setSizeOverride(TRUE); | ||
406 | gViewerWindow->saveImageNumbered(raw); | ||
407 | LLImageBase::setSizeOverride(FALSE); | ||
408 | } | ||
409 | return true; | ||
410 | } | ||
411 | }; | ||
412 | |||
413 | class LLFileSaveMovie : public view_listener_t | ||
414 | { | ||
415 | bool handleEvent(LLPointer<LLEvent> event, const LLSD& userdata) | ||
416 | { | ||
417 | LLViewerWindow::saveMovieNumbered(NULL); | ||
418 | return true; | ||
419 | } | ||
420 | }; | ||
421 | |||
422 | class LLFileSetWindowSize : public view_listener_t | ||
423 | { | ||
424 | bool handleEvent(LLPointer<LLEvent> event, const LLSD& userdata) | ||
425 | { | ||
426 | LLString size = userdata.asString(); | ||
427 | S32 width, height; | ||
428 | sscanf(size.c_str(), "%d,%d", &width, &height); | ||
429 | LLViewerWindow::movieSize(width, height); | ||
430 | return true; | ||
431 | } | ||
432 | }; | ||
433 | |||
434 | class LLFileQuit : public view_listener_t | ||
435 | { | ||
436 | bool handleEvent(LLPointer<LLEvent> event, const LLSD& userdata) | ||
437 | { | ||
438 | app_request_quit(); | ||
439 | return true; | ||
440 | } | ||
441 | }; | ||
442 | |||
443 | void handle_upload(void* data) | ||
444 | { | ||
445 | const char* filename = upload_pick(data); | ||
446 | if (filename) | ||
447 | { | ||
448 | LLFloaterNameDesc* floaterp = new LLFloaterNameDesc(filename); | ||
449 | gUICtrlFactory->buildFloater(floaterp, "floater_name_description.xml"); | ||
450 | } | ||
451 | } | ||
452 | |||
453 | void handle_compress_image(void*) | ||
454 | { | ||
455 | LLFilePicker& picker = LLFilePicker::instance(); | ||
456 | if (picker.getOpenFile(LLFilePicker::FFLOAD_IMAGE)) | ||
457 | { | ||
458 | std::string infile(picker.getFirstFile()); | ||
459 | std::string outfile = infile + ".j2c"; | ||
460 | |||
461 | llinfos << "Input: " << infile << llendl; | ||
462 | llinfos << "Output: " << outfile << llendl; | ||
463 | |||
464 | BOOL success; | ||
465 | |||
466 | success = LLViewerImageList::createUploadFile(infile, outfile, IMG_CODEC_TGA); | ||
467 | |||
468 | if (success) | ||
469 | { | ||
470 | llinfos << "Compression complete" << llendl; | ||
471 | } | ||
472 | else | ||
473 | { | ||
474 | llinfos << "Compression failed: " << LLImageBase::getLastError() << llendl; | ||
475 | } | ||
476 | } | ||
477 | } | ||
478 | |||
479 | void upload_new_resource(const LLString& src_filename, std::string name, | ||
480 | std::string desc, S32 compression_info, | ||
481 | LLAssetType::EType destination_folder_type, | ||
482 | LLInventoryType::EType inv_type, | ||
483 | U32 next_owner_perm, | ||
484 | const LLString& display_name, | ||
485 | LLAssetStorage::LLStoreAssetCallback callback, | ||
486 | void *userdata) | ||
487 | { | ||
488 | // Generate the temporary UUID. | ||
489 | LLString filename = gDirUtilp->getTempFilename(); | ||
490 | LLTransactionID tid; | ||
491 | LLAssetID uuid; | ||
492 | |||
493 | LLStringBase<char>::format_map_t args; | ||
494 | |||
495 | LLString ext = src_filename.substr(src_filename.find_last_of('.')); | ||
496 | LLAssetType::EType asset_type = LLAssetType::AT_NONE; | ||
497 | char error_message[MAX_STRING]; /* Flawfinder: ignore */ | ||
498 | error_message[0] = '\0'; | ||
499 | LLString temp_str; | ||
500 | |||
501 | BOOL error = FALSE; | ||
502 | |||
503 | if (ext.empty()) | ||
504 | { | ||
505 | LLString::size_type offset = filename.find_last_of(gDirUtilp->getDirDelimiter()); | ||
506 | if (offset != LLString::npos) | ||
507 | offset++; | ||
508 | LLString short_name = filename.substr(offset); | ||
509 | |||
510 | // No extension | ||
511 | snprintf(error_message, /* Flawfinder: ignore */ | ||
512 | MAX_STRING, | ||
513 | "No file extension for the file: '%s'\nPlease make sure the file has a correct file extension", | ||
514 | short_name.c_str()); | ||
515 | args["[FILE]"] = short_name; | ||
516 | upload_error(error_message, "NofileExtension", filename, args); | ||
517 | return; | ||
518 | } | ||
519 | else if( LLString::compareInsensitive(ext.c_str(),".bmp") == 0 ) | ||
520 | { | ||
521 | asset_type = LLAssetType::AT_TEXTURE; | ||
522 | if (!LLViewerImageList::createUploadFile(src_filename, | ||
523 | filename, | ||
524 | IMG_CODEC_BMP )) | ||
525 | { | ||
526 | snprintf(error_message, MAX_STRING, "Problem with file %s:\n\n%s\n", /* Flawfinder: ignore */ | ||
527 | src_filename.c_str(), LLImageBase::getLastError().c_str()); | ||
528 | args["[FILE]"] = src_filename; | ||
529 | args["[ERROR]"] = LLImageBase::getLastError(); | ||
530 | upload_error(error_message, "ProblemWithFile", filename, args); | ||
531 | return; | ||
532 | } | ||
533 | } | ||
534 | else if( LLString::compareInsensitive(ext.c_str(),".tga") == 0 ) | ||
535 | { | ||
536 | asset_type = LLAssetType::AT_TEXTURE; | ||
537 | if (!LLViewerImageList::createUploadFile(src_filename, | ||
538 | filename, | ||
539 | IMG_CODEC_TGA )) | ||
540 | { | ||
541 | snprintf(error_message, MAX_STRING, "Problem with file %s:\n\n%s\n", /* Flawfinder: ignore */ | ||
542 | src_filename.c_str(), LLImageBase::getLastError().c_str()); | ||
543 | args["[FILE]"] = src_filename; | ||
544 | args["[ERROR]"] = LLImageBase::getLastError(); | ||
545 | upload_error(error_message, "ProblemWithFile", filename, args); | ||
546 | return; | ||
547 | } | ||
548 | } | ||
549 | else if( LLString::compareInsensitive(ext.c_str(),".jpg") == 0 || LLString::compareInsensitive(ext.c_str(),".jpeg") == 0) | ||
550 | { | ||
551 | asset_type = LLAssetType::AT_TEXTURE; | ||
552 | if (!LLViewerImageList::createUploadFile(src_filename, | ||
553 | filename, | ||
554 | IMG_CODEC_JPEG )) | ||
555 | { | ||
556 | snprintf(error_message, MAX_STRING, "Problem with file %s:\n\n%s\n", /* Flawfinder: ignore */ | ||
557 | src_filename.c_str(), LLImageBase::getLastError().c_str()); | ||
558 | args["[FILE]"] = src_filename; | ||
559 | args["[ERROR]"] = LLImageBase::getLastError(); | ||
560 | upload_error(error_message, "ProblemWithFile", filename, args); | ||
561 | return; | ||
562 | } | ||
563 | } | ||
564 | else if(LLString::compareInsensitive(ext.c_str(),".wav") == 0) | ||
565 | { | ||
566 | asset_type = LLAssetType::AT_SOUND; // tag it as audio | ||
567 | S32 encode_result = 0; | ||
568 | |||
569 | S32 bitrate = 128; | ||
570 | |||
571 | if (compression_info) | ||
572 | { | ||
573 | bitrate = compression_info; | ||
574 | } | ||
575 | llinfos << "Attempting to encode wav as an ogg file at " << bitrate << "kbps" << llendl; | ||
576 | |||
577 | encode_result = encode_vorbis_file_at(src_filename.c_str(), filename.c_str(), bitrate*1000); | ||
578 | |||
579 | if (LLVORBISENC_NOERR != encode_result) | ||
580 | { | ||
581 | switch(encode_result) | ||
582 | { | ||
583 | case LLVORBISENC_DEST_OPEN_ERR: | ||
584 | snprintf(error_message, MAX_STRING, "Couldn't open temporary compressed sound file for writing: %s\n", filename.c_str()); /* Flawfinder: ignore */ | ||
585 | args["[FILE]"] = filename; | ||
586 | upload_error(error_message, "CannotOpenTemporarySoundFile", filename, args); | ||
587 | break; | ||
588 | |||
589 | default: | ||
590 | snprintf(error_message, MAX_STRING, "Unknown vorbis encode failure on: %s\n", src_filename.c_str()); /* Flawfinder: ignore */ | ||
591 | args["[FILE]"] = src_filename; | ||
592 | upload_error(error_message, "UnknownVorbisEncodeFailure", filename, args); | ||
593 | break; | ||
594 | } | ||
595 | return; | ||
596 | } | ||
597 | } | ||
598 | else if(LLString::compareInsensitive(ext.c_str(),".tmp") == 0) | ||
599 | { | ||
600 | // This is a generic .lin resource file | ||
601 | asset_type = LLAssetType::AT_OBJECT; | ||
602 | FILE* in = LLFile::fopen(src_filename.c_str(), "rb"); /* Flawfinder: ignore */ | ||
603 | if (in) | ||
604 | { | ||
605 | // read in the file header | ||
606 | char buf[16384]; /* Flawfinder: ignore */ | ||
607 | S32 read; /* Flawfinder: ignore */ | ||
608 | S32 version; | ||
609 | if (fscanf(in, "LindenResource\nversion %d\n", &version)) | ||
610 | { | ||
611 | if (2 == version) | ||
612 | { | ||
613 | // *NOTE: This buffer size is hard coded into scanf() below. | ||
614 | char label[MAX_STRING]; /* Flawfinder: ignore */ | ||
615 | char value[MAX_STRING]; /* Flawfinder: ignore */ | ||
616 | S32 tokens_read; | ||
617 | while (fgets(buf, 1024, in)) | ||
618 | { | ||
619 | label[0] = '\0'; | ||
620 | value[0] = '\0'; | ||
621 | tokens_read = sscanf( /* Flawfinder: ignore */ | ||
622 | buf, | ||
623 | "%254s %254s\n", | ||
624 | label, value); | ||
625 | |||
626 | llinfos << "got: " << label << " = " << value | ||
627 | << llendl; | ||
628 | |||
629 | if (EOF == tokens_read) | ||
630 | { | ||
631 | fclose(in); | ||
632 | snprintf(error_message, MAX_STRING, "corrupt resource file: %s", src_filename.c_str()); /* Flawfinder: ignore */ | ||
633 | args["[FILE]"] = src_filename; | ||
634 | upload_error(error_message, "CorruptResourceFile", filename, args); | ||
635 | return; | ||
636 | } | ||
637 | |||
638 | if (2 == tokens_read) | ||
639 | { | ||
640 | if (! strcmp("type", label)) | ||
641 | { | ||
642 | asset_type = (LLAssetType::EType)(atoi(value)); | ||
643 | } | ||
644 | } | ||
645 | else | ||
646 | { | ||
647 | if (! strcmp("_DATA_", label)) | ||
648 | { | ||
649 | // below is the data section | ||
650 | break; | ||
651 | } | ||
652 | } | ||
653 | // other values are currently discarded | ||
654 | } | ||
655 | |||
656 | } | ||
657 | else | ||
658 | { | ||
659 | fclose(in); | ||
660 | snprintf(error_message, MAX_STRING, "unknown linden resource file version in file: %s", src_filename.c_str()); /* Flawfinder: ignore */ | ||
661 | args["[FILE]"] = src_filename; | ||
662 | upload_error(error_message, "UnknownResourceFileVersion", filename, args); | ||
663 | return; | ||
664 | } | ||
665 | } | ||
666 | else | ||
667 | { | ||
668 | // this is an original binary formatted .lin file | ||
669 | // start over at the beginning of the file | ||
670 | fseek(in, 0, SEEK_SET); | ||
671 | |||
672 | const S32 MAX_ASSET_DESCRIPTION_LENGTH = 256; | ||
673 | const S32 MAX_ASSET_NAME_LENGTH = 64; | ||
674 | S32 header_size = 34 + MAX_ASSET_DESCRIPTION_LENGTH + MAX_ASSET_NAME_LENGTH; | ||
675 | S16 type_num; | ||
676 | |||
677 | // read in and throw out most of the header except for the type | ||
678 | fread(buf, header_size, 1, in); | ||
679 | memcpy(&type_num, buf + 16, sizeof(S16)); /* Flawfinder: ignore */ | ||
680 | asset_type = (LLAssetType::EType)type_num; | ||
681 | } | ||
682 | |||
683 | // copy the file's data segment into another file for uploading | ||
684 | FILE* out = LLFile::fopen(filename.c_str(), "wb"); /* Flawfinder: ignore */ | ||
685 | if (out) | ||
686 | { | ||
687 | while((read = fread(buf, 1, 16384, in))) /* Flawfinder: ignore */ | ||
688 | { | ||
689 | fwrite(buf, 1, read, out); /* Flawfinder: ignore */ | ||
690 | } | ||
691 | fclose(out); | ||
692 | } | ||
693 | else | ||
694 | { | ||
695 | fclose(in); | ||
696 | snprintf(error_message, MAX_STRING, "Unable to create output file: %s", filename.c_str()); /* Flawfinder: ignore */ | ||
697 | args["[FILE]"] = filename; | ||
698 | upload_error(error_message, "UnableToCreateOutputFile", filename, args); | ||
699 | return; | ||
700 | } | ||
701 | |||
702 | fclose(in); | ||
703 | } | ||
704 | else | ||
705 | { | ||
706 | llinfos << "Couldn't open .lin file " << src_filename << llendl; | ||
707 | } | ||
708 | } | ||
709 | else if (LLString::compareInsensitive(ext.c_str(),".bvh") == 0) | ||
710 | { | ||
711 | snprintf(error_message, MAX_STRING, "We do not currently support bulk upload of animation files\n"); /* Flawfinder: ignore */ | ||
712 | upload_error(error_message, "DoNotSupportBulkAnimationUpload", filename, args); | ||
713 | return; | ||
714 | } | ||
715 | else | ||
716 | { | ||
717 | // Unknown extension | ||
718 | snprintf(error_message, MAX_STRING, "Unknown file extension %s\nExpected .wav, .tga, .bmp, .jpg, .jpeg, or .bvh", ext.c_str()); /* Flawfinder: ignore */ | ||
719 | error = TRUE;; | ||
720 | } | ||
721 | |||
722 | // gen a new transaction ID for this asset | ||
723 | tid.generate(); | ||
724 | |||
725 | if (!error) | ||
726 | { | ||
727 | uuid = tid.makeAssetID(gAgent.getSecureSessionID()); | ||
728 | // copy this file into the vfs for upload | ||
729 | S32 file_size; | ||
730 | apr_file_t* fp = ll_apr_file_open(filename, LL_APR_RB, &file_size); | ||
731 | if (fp) | ||
732 | { | ||
733 | LLVFile file(gVFS, uuid, asset_type, LLVFile::WRITE); | ||
734 | |||
735 | file.setMaxSize(file_size); | ||
736 | |||
737 | const S32 buf_size = 65536; | ||
738 | U8 copy_buf[buf_size]; | ||
739 | while ((file_size = ll_apr_file_read(fp, copy_buf, buf_size))) | ||
740 | { | ||
741 | file.write(copy_buf, file_size); | ||
742 | } | ||
743 | apr_file_close(fp); | ||
744 | } | ||
745 | else | ||
746 | { | ||
747 | snprintf(error_message, MAX_STRING, "Unable to access output file: %s", filename.c_str()); /* Flawfinder: ignore */ | ||
748 | error = TRUE; | ||
749 | } | ||
750 | } | ||
751 | |||
752 | if (!error) | ||
753 | { | ||
754 | LLString t_disp_name = display_name; | ||
755 | if (t_disp_name.empty()) | ||
756 | { | ||
757 | t_disp_name = src_filename; | ||
758 | } | ||
759 | upload_new_resource(tid, asset_type, name, desc, compression_info, // tid | ||
760 | destination_folder_type, inv_type, next_owner_perm, | ||
761 | display_name, callback, userdata); | ||
762 | } | ||
763 | else | ||
764 | { | ||
765 | llwarns << error_message << llendl; | ||
766 | LLStringBase<char>::format_map_t args; | ||
767 | args["[ERROR_MESSAGE]"] = error_message; | ||
768 | gViewerWindow->alertXml("ErrorMessage", args); | ||
769 | if(LLFile::remove(filename.c_str()) == -1) | ||
770 | { | ||
771 | lldebugs << "unable to remove temp file" << llendl; | ||
772 | } | ||
773 | LLFilePicker::instance().reset(); | ||
774 | } | ||
775 | } | ||
776 | |||
777 | void upload_done_callback(const LLUUID& uuid, void* user_data, S32 result) // StoreAssetData callback (fixed) | ||
778 | { | ||
779 | LLResourceData* data = (LLResourceData*)user_data; | ||
780 | //LLAssetType::EType pref_loc = data->mPreferredLocation; | ||
781 | BOOL is_balance_sufficient = TRUE; | ||
782 | if(result >= 0) | ||
783 | { | ||
784 | LLAssetType::EType dest_loc = (data->mPreferredLocation == LLAssetType::AT_NONE) ? data->mAssetInfo.mType : data->mPreferredLocation; | ||
785 | |||
786 | if (LLAssetType::AT_SOUND == data->mAssetInfo.mType || | ||
787 | LLAssetType::AT_TEXTURE == data->mAssetInfo.mType || | ||
788 | LLAssetType::AT_ANIMATION == data->mAssetInfo.mType) | ||
789 | { | ||
790 | // Charge the user for the upload. | ||
791 | LLViewerRegion* region = gAgent.getRegion(); | ||
792 | S32 upload_cost = gGlobalEconomy->getPriceUpload(); | ||
793 | |||
794 | if(!(can_afford_transaction(upload_cost))) | ||
795 | { | ||
796 | LLFloaterBuyCurrency::buyCurrency( | ||
797 | llformat("Uploading %s costs", | ||
798 | data->mAssetInfo.getName().c_str()), | ||
799 | upload_cost); | ||
800 | is_balance_sufficient = FALSE; | ||
801 | } | ||
802 | else if(region) | ||
803 | { | ||
804 | // Charge user for upload | ||
805 | gStatusBar->debitBalance(upload_cost); | ||
806 | |||
807 | LLMessageSystem* msg = gMessageSystem; | ||
808 | msg->newMessageFast(_PREHASH_MoneyTransferRequest); | ||
809 | msg->nextBlockFast(_PREHASH_AgentData); | ||
810 | msg->addUUIDFast(_PREHASH_AgentID, gAgent.getID()); | ||
811 | msg->addUUIDFast(_PREHASH_SessionID, gAgent.getSessionID()); | ||
812 | msg->nextBlockFast(_PREHASH_MoneyData); | ||
813 | msg->addUUIDFast(_PREHASH_SourceID, gAgent.getID()); | ||
814 | msg->addUUIDFast(_PREHASH_DestID, LLUUID::null); | ||
815 | msg->addU8("Flags", 0); | ||
816 | msg->addS32Fast(_PREHASH_Amount, upload_cost); | ||
817 | msg->addU8Fast(_PREHASH_AggregatePermNextOwner, (U8)LLAggregatePermissions::AP_EMPTY); | ||
818 | msg->addU8Fast(_PREHASH_AggregatePermInventory, (U8)LLAggregatePermissions::AP_EMPTY); | ||
819 | msg->addS32Fast(_PREHASH_TransactionType, TRANS_UPLOAD_CHARGE); | ||
820 | msg->addStringFast(_PREHASH_Description, NULL); | ||
821 | msg->sendReliable(region->getHost()); | ||
822 | } | ||
823 | } | ||
824 | |||
825 | if(is_balance_sufficient) | ||
826 | { | ||
827 | // Actually add the upload to inventory | ||
828 | llinfos << "Adding " << uuid << " to inventory." << llendl; | ||
829 | LLUUID folder_id(gInventory.findCategoryUUIDForType(dest_loc)); | ||
830 | if(folder_id.notNull()) | ||
831 | { | ||
832 | U32 next_owner_perm = data->mNextOwnerPerm; | ||
833 | if(PERM_NONE == next_owner_perm) | ||
834 | { | ||
835 | next_owner_perm = PERM_MOVE | PERM_TRANSFER; | ||
836 | } | ||
837 | create_inventory_item(gAgent.getID(), gAgent.getSessionID(), | ||
838 | folder_id, data->mAssetInfo.mTransactionID, data->mAssetInfo.getName(), | ||
839 | data->mAssetInfo.getDescription(), data->mAssetInfo.mType, | ||
840 | data->mInventoryType, NOT_WEARABLE, next_owner_perm, | ||
841 | LLPointer<LLInventoryCallback>(NULL)); | ||
842 | } | ||
843 | else | ||
844 | { | ||
845 | llwarns << "Can't find a folder to put it in" << llendl; | ||
846 | } | ||
847 | } | ||
848 | } | ||
849 | else // if(result >= 0) | ||
850 | { | ||
851 | LLStringBase<char>::format_map_t args; | ||
852 | args["[FILE]"] = LLInventoryType::lookupHumanReadable(data->mInventoryType); | ||
853 | args["[REASON]"] = LLString(LLAssetStorage::getErrorString(result)); | ||
854 | gViewerWindow->alertXml("CannotUploadReason", args); | ||
855 | } | ||
856 | |||
857 | LLUploadDialog::modalUploadFinished(); | ||
858 | delete data; | ||
859 | |||
860 | // *NOTE: This is a pretty big hack. What this does is check the | ||
861 | // file picker if there are any more pending uploads. If so, | ||
862 | // upload that file. | ||
863 | const char* next_file = LLFilePicker::instance().getNextFile(); | ||
864 | if(is_balance_sufficient && next_file) | ||
865 | { | ||
866 | const char* name = LLFilePicker::instance().getDirname(); | ||
867 | |||
868 | LLString asset_name = name; | ||
869 | LLString::replaceNonstandardASCII( asset_name, '?' ); | ||
870 | LLString::replaceChar(asset_name, '|', '?'); | ||
871 | LLString::stripNonprintable(asset_name); | ||
872 | LLString::trim(asset_name); | ||
873 | |||
874 | char* asset_name_str = (char*)asset_name.c_str(); | ||
875 | char* end_p = strrchr(asset_name_str, '.'); // strip extension if exists | ||
876 | if( !end_p ) | ||
877 | { | ||
878 | end_p = asset_name_str + strlen( asset_name_str ); /* Flawfinder: ignore */ | ||
879 | } | ||
880 | |||
881 | S32 len = llmin( (S32) (DB_INV_ITEM_NAME_STR_LEN), (S32) (end_p - asset_name_str) ); | ||
882 | |||
883 | asset_name = asset_name.substr( 0, len ); | ||
884 | |||
885 | upload_new_resource(next_file, asset_name, asset_name, // file | ||
886 | 0, LLAssetType::AT_NONE, LLInventoryType::IT_NONE); | ||
887 | } | ||
888 | } | ||
889 | |||
890 | void upload_new_resource(const LLTransactionID &tid, LLAssetType::EType asset_type, | ||
891 | std::string name, | ||
892 | std::string desc, S32 compression_info, | ||
893 | LLAssetType::EType destination_folder_type, | ||
894 | LLInventoryType::EType inv_type, | ||
895 | U32 next_owner_perm, | ||
896 | const LLString& display_name, | ||
897 | LLAssetStorage::LLStoreAssetCallback callback, | ||
898 | void *userdata) | ||
899 | { | ||
900 | LLAssetID uuid = tid.makeAssetID(gAgent.getSecureSessionID()); | ||
901 | |||
902 | if( LLAssetType::AT_SOUND == asset_type ) | ||
903 | { | ||
904 | gViewerStats->incStat(LLViewerStats::ST_UPLOAD_SOUND_COUNT ); | ||
905 | } | ||
906 | else | ||
907 | if( LLAssetType::AT_TEXTURE == asset_type ) | ||
908 | { | ||
909 | gViewerStats->incStat(LLViewerStats::ST_UPLOAD_TEXTURE_COUNT ); | ||
910 | } | ||
911 | else | ||
912 | if( LLAssetType::AT_ANIMATION == asset_type) | ||
913 | { | ||
914 | gViewerStats->incStat(LLViewerStats::ST_UPLOAD_ANIM_COUNT ); | ||
915 | } | ||
916 | |||
917 | if(LLInventoryType::IT_NONE == inv_type) | ||
918 | { | ||
919 | inv_type = LLInventoryType::defaultForAssetType(asset_type); | ||
920 | } | ||
921 | LLString::stripNonprintable(name); | ||
922 | LLString::stripNonprintable(desc); | ||
923 | if(name.empty()) | ||
924 | { | ||
925 | name = "(No Name)"; | ||
926 | } | ||
927 | if(desc.empty()) | ||
928 | { | ||
929 | desc = "(No Description)"; | ||
930 | } | ||
931 | |||
932 | // At this point, we're ready for the upload. | ||
933 | LLString upload_message = "Uploading...\n\n"; | ||
934 | upload_message.append(display_name); | ||
935 | LLUploadDialog::modalUploadDialog(upload_message); | ||
936 | |||
937 | llinfos << "*** Uploading: " << llendl; | ||
938 | llinfos << "Type: " << LLAssetType::lookup(asset_type) << llendl; | ||
939 | llinfos << "UUID: " << uuid << llendl; | ||
940 | llinfos << "Name: " << name << llendl; | ||
941 | llinfos << "Desc: " << desc << llendl; | ||
942 | lldebugs << "Folder: " << gInventory.findCategoryUUIDForType((destination_folder_type == LLAssetType::AT_NONE) ? asset_type : destination_folder_type) << llendl; | ||
943 | lldebugs << "Asset Type: " << LLAssetType::lookup(asset_type) << llendl; | ||
944 | std::string url = gAgent.getRegion()->getCapability("NewFileAgentInventory"); | ||
945 | if (!url.empty()) | ||
946 | { | ||
947 | llinfos << "New Agent Inventory via capability" << llendl; | ||
948 | LLSD body; | ||
949 | body["folder_id"] = gInventory.findCategoryUUIDForType((destination_folder_type == LLAssetType::AT_NONE) ? asset_type : destination_folder_type); | ||
950 | body["asset_type"] = LLAssetType::lookup(asset_type); | ||
951 | body["inventory_type"] = LLInventoryType::lookup(inv_type); | ||
952 | body["name"] = name; | ||
953 | body["description"] = desc; | ||
954 | |||
955 | std::ostringstream llsdxml; | ||
956 | LLSDSerialize::toXML(body, llsdxml); | ||
957 | lldebugs << "posting body to capability: " << llsdxml.str() << llendl; | ||
958 | LLHTTPClient::post(url, body, new LLNewAgentInventoryResponder(body, uuid, asset_type)); | ||
959 | } | ||
960 | else | ||
961 | { | ||
962 | llinfos << "NewAgentInventory capability not found, new agent inventory via asset system." << llendl; | ||
963 | // check for adequate funds | ||
964 | // TODO: do this check on the sim | ||
965 | if (LLAssetType::AT_SOUND == asset_type || | ||
966 | LLAssetType::AT_TEXTURE == asset_type || | ||
967 | LLAssetType::AT_ANIMATION == asset_type) | ||
968 | { | ||
969 | S32 upload_cost = gGlobalEconomy->getPriceUpload(); | ||
970 | S32 balance = gStatusBar->getBalance(); | ||
971 | if (balance < upload_cost) | ||
972 | { | ||
973 | // insufficient funds, bail on this upload | ||
974 | LLFloaterBuyCurrency::buyCurrency("Uploading costs", upload_cost); | ||
975 | return; | ||
976 | } | ||
977 | } | ||
978 | |||
979 | LLResourceData* data = new LLResourceData; | ||
980 | data->mAssetInfo.mTransactionID = tid; | ||
981 | data->mAssetInfo.mUuid = uuid; | ||
982 | data->mAssetInfo.mType = asset_type; | ||
983 | data->mAssetInfo.mCreatorID = gAgentID; | ||
984 | data->mInventoryType = inv_type; | ||
985 | data->mNextOwnerPerm = next_owner_perm; | ||
986 | data->mUserData = userdata; | ||
987 | data->mAssetInfo.setName(name); | ||
988 | data->mAssetInfo.setDescription(desc); | ||
989 | data->mPreferredLocation = destination_folder_type; | ||
990 | |||
991 | LLAssetStorage::LLStoreAssetCallback asset_callback = &upload_done_callback; | ||
992 | if (callback) | ||
993 | { | ||
994 | asset_callback = callback; | ||
995 | } | ||
996 | gAssetStorage->storeAssetData(data->mAssetInfo.mTransactionID, data->mAssetInfo.mType, | ||
997 | asset_callback, | ||
998 | (void*)data, | ||
999 | FALSE); | ||
1000 | } | ||
1001 | } | ||
1002 | |||
1003 | |||
1004 | void init_menu_file() | ||
1005 | { | ||
1006 | (new LLFileUploadImage())->registerListener(gMenuHolder, "File.UploadImage"); | ||
1007 | (new LLFileUploadSound())->registerListener(gMenuHolder, "File.UploadSound"); | ||
1008 | (new LLFileUploadAnim())->registerListener(gMenuHolder, "File.UploadAnim"); | ||
1009 | (new LLFileUploadBulk())->registerListener(gMenuHolder, "File.UploadBulk"); | ||
1010 | (new LLFileCloseWindow())->registerListener(gMenuHolder, "File.CloseWindow"); | ||
1011 | (new LLFileCloseAllWindows())->registerListener(gMenuHolder, "File.CloseAllWindows"); | ||
1012 | (new LLFileEnableCloseWindow())->registerListener(gMenuHolder, "File.EnableCloseWindow"); | ||
1013 | (new LLFileSaveTexture())->registerListener(gMenuHolder, "File.SaveTexture"); | ||
1014 | (new LLFileTakeSnapshot())->registerListener(gMenuHolder, "File.TakeSnapshot"); | ||
1015 | (new LLFileTakeSnapshotToDisk())->registerListener(gMenuHolder, "File.TakeSnapshotToDisk"); | ||
1016 | (new LLFileSaveMovie())->registerListener(gMenuHolder, "File.SaveMovie"); | ||
1017 | (new LLFileSetWindowSize())->registerListener(gMenuHolder, "File.SetWindowSize"); | ||
1018 | (new LLFileQuit())->registerListener(gMenuHolder, "File.Quit"); | ||
1019 | |||
1020 | (new LLFileEnableUpload())->registerListener(gMenuHolder, "File.EnableUpload"); | ||
1021 | (new LLFileEnableSaveAs())->registerListener(gMenuHolder, "File.EnableSaveAs"); | ||
1022 | } | ||
diff --git a/linden/indra/newview/llviewermenufile.h b/linden/indra/newview/llviewermenufile.h new file mode 100644 index 0000000..32806fb --- /dev/null +++ b/linden/indra/newview/llviewermenufile.h | |||
@@ -0,0 +1,59 @@ | |||
1 | /** | ||
2 | * @file llviewermenufile.h | ||
3 | * @brief "File" menu in the main menu bar. | ||
4 | * | ||
5 | * Copyright (c) 2002-2007, Linden Research, Inc. | ||
6 | * | ||
7 | * Second Life Viewer Source Code | ||
8 | * The source code in this file ("Source Code") is provided by Linden Lab | ||
9 | * to you under the terms of the GNU General Public License, version 2.0 | ||
10 | * ("GPL"), unless you have obtained a separate licensing agreement | ||
11 | * ("Other License"), formally executed by you and Linden Lab. Terms of | ||
12 | * the GPL can be found in doc/GPL-license.txt in this distribution, or | ||
13 | * online at http://secondlife.com/developers/opensource/gplv2 | ||
14 | * | ||
15 | * There are special exceptions to the terms and conditions of the GPL as | ||
16 | * it is applied to this Source Code. View the full text of the exception | ||
17 | * in the file doc/FLOSS-exception.txt in this software distribution, or | ||
18 | * online at http://secondlife.com/developers/opensource/flossexception | ||
19 | * | ||
20 | * By copying, modifying or distributing this software, you acknowledge | ||
21 | * that you have read and understood your obligations described above, | ||
22 | * and agree to abide by those obligations. | ||
23 | * | ||
24 | * ALL LINDEN LAB SOURCE CODE IS PROVIDED "AS IS." LINDEN LAB MAKES NO | ||
25 | * WARRANTIES, EXPRESS, IMPLIED OR OTHERWISE, REGARDING ITS ACCURACY, | ||
26 | * COMPLETENESS OR PERFORMANCE. | ||
27 | */ | ||
28 | |||
29 | #ifndef LLVIEWERMENUFILE_H | ||
30 | #define LLVIEWERMENUFILE_H | ||
31 | |||
32 | #include "llassettype.h" | ||
33 | #include "llinventorytype.h" | ||
34 | |||
35 | class LLTransactionID; | ||
36 | |||
37 | |||
38 | void init_menu_file(); | ||
39 | |||
40 | void upload_new_resource(const LLString& src_filename, std::string name, | ||
41 | std::string desc, S32 compression_info, | ||
42 | LLAssetType::EType destination_folder_type, | ||
43 | LLInventoryType::EType inv_type, | ||
44 | U32 next_owner_perm = 0x0, // PERM_NONE | ||
45 | const LLString& display_name = LLString::null, | ||
46 | LLAssetStorage::LLStoreAssetCallback callback = NULL, | ||
47 | void *userdata = NULL); | ||
48 | |||
49 | void upload_new_resource(const LLTransactionID &tid, LLAssetType::EType type, | ||
50 | std::string name, | ||
51 | std::string desc, S32 compression_info, | ||
52 | LLAssetType::EType destination_folder_type, | ||
53 | LLInventoryType::EType inv_type, | ||
54 | U32 next_owner_perm = 0x0, // PERM_NONE | ||
55 | const LLString& display_name = LLString::null, | ||
56 | LLAssetStorage::LLStoreAssetCallback callback = NULL, | ||
57 | void *userdata = NULL); | ||
58 | |||
59 | #endif | ||
diff --git a/linden/indra/newview/llviewermessage.cpp b/linden/indra/newview/llviewermessage.cpp index 5dab363..5eafd9d 100644 --- a/linden/indra/newview/llviewermessage.cpp +++ b/linden/indra/newview/llviewermessage.cpp | |||
@@ -145,8 +145,14 @@ extern BOOL gDebugClicks; | |||
145 | extern void bad_network_handler(); | 145 | extern void bad_network_handler(); |
146 | 146 | ||
147 | // function prototypes | 147 | // function prototypes |
148 | void open_offer(const std::vector<LLUUID>& items); | 148 | void open_offer(const std::vector<LLUUID>& items, const std::string& from_name); |
149 | void friendship_offer_callback(S32 option, void* user_data); | 149 | void friendship_offer_callback(S32 option, void* user_data); |
150 | bool check_offer_throttle(const std::string& from_name, bool check_only); | ||
151 | |||
152 | //inventory offer throttle globals | ||
153 | LLFrameTimer gThrottleTimer; | ||
154 | const U32 OFFER_THROTTLE_MAX_COUNT=5; //number of items per time period | ||
155 | const F32 OFFER_THROTTLE_TIME=10.f; //time period in seconds | ||
150 | 156 | ||
151 | struct LLFriendshipOffer | 157 | struct LLFriendshipOffer |
152 | { | 158 | { |
@@ -195,11 +201,6 @@ void give_money(const LLUUID& uuid, LLViewerRegion* region, S32 amount, BOOL is_ | |||
195 | } | 201 | } |
196 | } | 202 | } |
197 | 203 | ||
198 | BOOL can_afford_transaction(S32 cost) | ||
199 | { | ||
200 | return((cost <= 0)||((gStatusBar) && (gStatusBar->getBalance() >=cost))); | ||
201 | } | ||
202 | |||
203 | void send_complete_agent_movement(const LLHost& sim_host) | 204 | void send_complete_agent_movement(const LLHost& sim_host) |
204 | { | 205 | { |
205 | LLMessageSystem* msg = gMessageSystem; | 206 | LLMessageSystem* msg = gMessageSystem; |
@@ -275,11 +276,19 @@ void process_layer_data(LLMessageSystem *mesgsys, void **user_data) | |||
275 | 276 | ||
276 | mesgsys->getS8Fast(_PREHASH_LayerID, _PREHASH_Type, type); | 277 | mesgsys->getS8Fast(_PREHASH_LayerID, _PREHASH_Type, type); |
277 | size = mesgsys->getSizeFast(_PREHASH_LayerData, _PREHASH_Data); | 278 | size = mesgsys->getSizeFast(_PREHASH_LayerData, _PREHASH_Data); |
278 | if(!size) | 279 | if (0 == size) |
279 | { | 280 | { |
280 | llwarns << "Layer data has zero size." << llendl; | 281 | llwarns << "Layer data has zero size." << llendl; |
281 | return; | 282 | return; |
282 | } | 283 | } |
284 | if (size < 0) | ||
285 | { | ||
286 | // getSizeFast() is probably trying to tell us about an error | ||
287 | llwarns << "getSizeFast() returned negative result: " | ||
288 | << size | ||
289 | << llendl; | ||
290 | return; | ||
291 | } | ||
283 | U8 *datap = new U8[size]; | 292 | U8 *datap = new U8[size]; |
284 | mesgsys->getBinaryDataFast(_PREHASH_LayerData, _PREHASH_Data, datap, size); | 293 | mesgsys->getBinaryDataFast(_PREHASH_LayerData, _PREHASH_Data, datap, size); |
285 | LLVLData *vl_datap = new LLVLData(regionp, type, datap, size); | 294 | LLVLData *vl_datap = new LLVLData(regionp, type, datap, size); |
@@ -326,25 +335,29 @@ void export_complete() | |||
326 | while ((pos = strstr(pos+1, "<sl:image ")) != 0) | 335 | while ((pos = strstr(pos+1, "<sl:image ")) != 0) |
327 | { | 336 | { |
328 | char *pos_check = strstr(pos, "checksum=\""); | 337 | char *pos_check = strstr(pos, "checksum=\""); |
329 | char *pos_uuid = strstr(pos_check, "\">"); | ||
330 | 338 | ||
331 | if (pos_check && pos_uuid) | 339 | if (pos_check) |
332 | { | 340 | { |
333 | char image_uuid_str[UUID_STR_SIZE]; /* Flawfinder: ignore */ | 341 | char *pos_uuid = strstr(pos_check, "\">"); |
334 | memcpy(image_uuid_str, pos_uuid+2, UUID_STR_SIZE-1); /* Flawfinder: ignore */ | ||
335 | image_uuid_str[UUID_STR_SIZE-1] = 0; | ||
336 | 342 | ||
337 | LLUUID image_uuid(image_uuid_str); | 343 | if (pos_uuid) |
344 | { | ||
345 | char image_uuid_str[UUID_STR_SIZE]; /* Flawfinder: ignore */ | ||
346 | memcpy(image_uuid_str, pos_uuid+2, UUID_STR_SIZE-1); /* Flawfinder: ignore */ | ||
347 | image_uuid_str[UUID_STR_SIZE-1] = 0; | ||
348 | |||
349 | LLUUID image_uuid(image_uuid_str); | ||
338 | 350 | ||
339 | llinfos << "Found UUID: " << image_uuid << llendl; | 351 | llinfos << "Found UUID: " << image_uuid << llendl; |
340 | 352 | ||
341 | std::map<LLUUID, LLString>::iterator itor = gImageChecksums.find(image_uuid); | 353 | std::map<LLUUID, LLString>::iterator itor = gImageChecksums.find(image_uuid); |
342 | if (itor != gImageChecksums.end()) | 354 | if (itor != gImageChecksums.end()) |
343 | { | ||
344 | llinfos << "Replacing with checksum: " << itor->second << llendl; | ||
345 | if (itor->second.c_str() != NULL) | ||
346 | { | 355 | { |
347 | memcpy(&pos_check[10], itor->second.c_str(), 32); /* Flawfinder: ignore */ | 356 | llinfos << "Replacing with checksum: " << itor->second << llendl; |
357 | if (itor->second.c_str() != NULL) | ||
358 | { | ||
359 | memcpy(&pos_check[10], itor->second.c_str(), 32); /* Flawfinder: ignore */ | ||
360 | } | ||
348 | } | 361 | } |
349 | } | 362 | } |
350 | } | 363 | } |
@@ -354,7 +367,7 @@ void export_complete() | |||
354 | fwrite(buffer, 1, length, fXMLOut); | 367 | fwrite(buffer, 1, length, fXMLOut); |
355 | fclose(fXMLOut); | 368 | fclose(fXMLOut); |
356 | 369 | ||
357 | delete buffer; | 370 | delete [] buffer; |
358 | } | 371 | } |
359 | 372 | ||
360 | 373 | ||
@@ -432,7 +445,7 @@ void exported_j2c_complete(const LLTSCode status, void *user_data) | |||
432 | char *end = strrchr(file_path, gDirUtilp->getDirDelimiter()[0]); | 445 | char *end = strrchr(file_path, gDirUtilp->getDirDelimiter()[0]); |
433 | end[0] = 0; | 446 | end[0] = 0; |
434 | LLString output_file = llformat("%s/image-%03d.tga", file_path, image_num);//filename; | 447 | LLString output_file = llformat("%s/image-%03d.tga", file_path, image_num);//filename; |
435 | delete file_path; | 448 | delete [] file_path; |
436 | //S32 name_len = output_file.length(); | 449 | //S32 name_len = output_file.length(); |
437 | //strcpy(&output_file[name_len-3], "tga"); | 450 | //strcpy(&output_file[name_len-3], "tga"); |
438 | FILE* fOut = LLFile::fopen(output_file.c_str(), "wb"); /* Flawfinder: ignore */ | 451 | FILE* fOut = LLFile::fopen(output_file.c_str(), "wb"); /* Flawfinder: ignore */ |
@@ -599,31 +612,44 @@ void join_group_callback(S32 option, void* user_data) | |||
599 | class LLOpenAgentOffer : public LLInventoryFetchObserver | 612 | class LLOpenAgentOffer : public LLInventoryFetchObserver |
600 | { | 613 | { |
601 | public: | 614 | public: |
602 | LLOpenAgentOffer() {} | 615 | LLOpenAgentOffer(const std::string& from_name) : mFromName(from_name) {} |
603 | virtual ~LLOpenAgentOffer() {} | 616 | /*virtual*/ void done() |
604 | |||
605 | virtual void done() | ||
606 | { | 617 | { |
607 | open_offer(mComplete); | 618 | open_offer(mComplete, mFromName); |
608 | gInventory.removeObserver(this); | 619 | gInventory.removeObserver(this); |
609 | delete this; | 620 | delete this; |
610 | } | 621 | } |
622 | private: | ||
623 | std::string mFromName; | ||
611 | }; | 624 | }; |
612 | 625 | ||
613 | class LLOpenTaskOffer : public LLInventoryExistenceObserver | 626 | //unlike the FetchObserver for AgentOffer, we only make one |
627 | //instance of the AddedObserver for TaskOffers | ||
628 | //and it never dies. We do this because we don't know the UUID of | ||
629 | //task offers until they are accepted, so we don't wouldn't | ||
630 | //know what to watch for, so instead we just watch for all additions. -Gigs | ||
631 | class LLOpenTaskOffer : public LLInventoryAddedObserver | ||
614 | { | 632 | { |
615 | public: | ||
616 | LLOpenTaskOffer() {} | ||
617 | virtual ~LLOpenTaskOffer() {} | ||
618 | |||
619 | protected: | 633 | protected: |
620 | virtual void done() | 634 | /*virtual*/ void done() |
621 | { | 635 | { |
622 | open_offer(mExist); | 636 | open_offer(mAdded, ""); |
623 | gInventory.removeObserver(this); | 637 | mAdded.clear(); |
624 | delete this; | ||
625 | } | 638 | } |
626 | }; | 639 | }; |
640 | |||
641 | //one global instance to bind them | ||
642 | LLOpenTaskOffer* gNewInventoryObserver=NULL; | ||
643 | |||
644 | void start_new_inventory_observer() | ||
645 | { | ||
646 | if (!gNewInventoryObserver) //task offer observer | ||
647 | { | ||
648 | // Observer is deleted by gInventory | ||
649 | gNewInventoryObserver = new LLOpenTaskOffer; | ||
650 | gInventory.addObserver(gNewInventoryObserver); | ||
651 | } | ||
652 | } | ||
627 | 653 | ||
628 | class LLDiscardAgentOffer : public LLInventoryFetchComboObserver | 654 | class LLDiscardAgentOffer : public LLInventoryFetchComboObserver |
629 | { | 655 | { |
@@ -675,7 +701,71 @@ protected: | |||
675 | }; | 701 | }; |
676 | 702 | ||
677 | 703 | ||
678 | void open_offer(const std::vector<LLUUID>& items) | 704 | //Returns TRUE if we are OK, FALSE if we are throttled |
705 | //Set check_only true if you want to know the throttle status | ||
706 | //without registering a hit -Gigs | ||
707 | bool check_offer_throttle(const std::string& from_name, bool check_only) | ||
708 | { | ||
709 | static U32 throttle_count; | ||
710 | static bool throttle_logged; | ||
711 | LLChat chat; | ||
712 | LLString log_message; | ||
713 | |||
714 | if (!gSavedSettings.getBOOL("ShowNewInventory")) | ||
715 | return false; | ||
716 | |||
717 | if (check_only) | ||
718 | { | ||
719 | return gThrottleTimer.hasExpired(); | ||
720 | } | ||
721 | |||
722 | if(gThrottleTimer.checkExpirationAndReset(OFFER_THROTTLE_TIME)) | ||
723 | { | ||
724 | //llinfos << "Throttle Expired" << llendl; | ||
725 | throttle_count=1; | ||
726 | throttle_logged=false; | ||
727 | return true; | ||
728 | } | ||
729 | else //has not expired | ||
730 | { | ||
731 | //llinfos << "Throttle Not Expired, Count: " << throttle_count << llendl; | ||
732 | // When downloading the initial inventory we get a lot of new items | ||
733 | // coming in and can't tell that from spam. JC | ||
734 | if (gStartupState >= STATE_STARTED | ||
735 | && throttle_count >= OFFER_THROTTLE_MAX_COUNT) | ||
736 | { | ||
737 | if (!throttle_logged) | ||
738 | { | ||
739 | // Use the name of the last item giver, who is probably the person | ||
740 | // spamming you. JC | ||
741 | std::ostringstream message; | ||
742 | message << gSecondLife; | ||
743 | if (!from_name.empty()) | ||
744 | { | ||
745 | message << ": Items coming in too fast from " << from_name; | ||
746 | } | ||
747 | else | ||
748 | { | ||
749 | message << ": Items coming in too fast"; | ||
750 | } | ||
751 | message << ", automatic preview disabled for " | ||
752 | << OFFER_THROTTLE_TIME << " seconds."; | ||
753 | chat.mText = message.str(); | ||
754 | //this is kinda important, so actually put it on screen | ||
755 | LLFloaterChat::addChat(chat, FALSE, FALSE); | ||
756 | throttle_logged=true; | ||
757 | } | ||
758 | return false; | ||
759 | } | ||
760 | else | ||
761 | { | ||
762 | throttle_count++; | ||
763 | return true; | ||
764 | } | ||
765 | } | ||
766 | } | ||
767 | |||
768 | void open_offer(const std::vector<LLUUID>& items, const std::string& from_name) | ||
679 | { | 769 | { |
680 | std::vector<LLUUID>::const_iterator it = items.begin(); | 770 | std::vector<LLUUID>::const_iterator it = items.begin(); |
681 | std::vector<LLUUID>::const_iterator end = items.end(); | 771 | std::vector<LLUUID>::const_iterator end = items.end(); |
@@ -693,33 +783,66 @@ void open_offer(const std::vector<LLUUID>& items) | |||
693 | { | 783 | { |
694 | continue; | 784 | continue; |
695 | } | 785 | } |
696 | switch(item->getType()) | 786 | //if we are throttled, don't display them - Gigs |
787 | if (check_offer_throttle(from_name, false)) | ||
697 | { | 788 | { |
698 | case LLAssetType::AT_NOTECARD: | 789 | // I'm not sure this is a good idea. JC |
699 | open_notecard(*it, LLString("Note: ") + item->getName(), TRUE, LLUUID::null, FALSE); | 790 | // bool show_keep_discard = item->getPermissions().getCreator() != gAgent.getID(); |
700 | break; | 791 | bool show_keep_discard = true; |
701 | case LLAssetType::AT_LANDMARK: | 792 | switch(item->getType()) |
702 | open_landmark(*it, LLString("Landmark: ") + item->getName(), TRUE, LLUUID::null, FALSE); | ||
703 | break; | ||
704 | case LLAssetType::AT_TEXTURE: | ||
705 | open_texture(*it, LLString("Texture: ") + item->getName(), TRUE, LLUUID::null, FALSE); | ||
706 | break; | ||
707 | default: | ||
708 | { | ||
709 | // Don't auto-open the inventory - just select it if we | ||
710 | // already have an active inventory. | ||
711 | LLInventoryView* view = LLInventoryView::getActiveInventory(); | ||
712 | if(view) | ||
713 | { | 793 | { |
714 | LLUICtrl* focus_ctrl = gFocusMgr.getKeyboardFocus(); | 794 | case LLAssetType::AT_NOTECARD: |
715 | LLFocusMgr::FocusLostCallback callback; | 795 | open_notecard(*it, LLString("Note: ") + item->getName(), show_keep_discard, LLUUID::null, FALSE); |
716 | callback = gFocusMgr.getFocusCallback(); | 796 | break; |
717 | view->getPanel()->setSelection(item->getUUID(), TAKE_FOCUS_NO); | 797 | case LLAssetType::AT_LANDMARK: |
718 | gFocusMgr.setKeyboardFocus(focus_ctrl, callback); | 798 | open_landmark(*it, LLString("Landmark: ") + item->getName(), show_keep_discard, LLUUID::null, FALSE); |
799 | break; | ||
800 | case LLAssetType::AT_TEXTURE: | ||
801 | open_texture(*it, LLString("Texture: ") + item->getName(), show_keep_discard, LLUUID::null, FALSE); | ||
802 | break; | ||
803 | default: | ||
719 | break; | 804 | break; |
720 | } | 805 | } |
721 | } | 806 | } |
807 | //highlight item, if it's not in the trash or lost+found | ||
808 | |||
809 | // Don't auto-open the inventory floater | ||
810 | LLInventoryView* view = LLInventoryView::getActiveInventory(); | ||
811 | if(!view) | ||
812 | { | ||
813 | return; | ||
814 | } | ||
815 | |||
816 | //Trash Check | ||
817 | LLUUID trash_id; | ||
818 | trash_id = gInventory.findCategoryUUIDForType(LLAssetType::AT_TRASH); | ||
819 | if(gInventory.isObjectDescendentOf(item->getUUID(), trash_id)) | ||
820 | { | ||
821 | return; | ||
722 | } | 822 | } |
823 | LLUUID lost_and_found_id = gInventory.findCategoryUUIDForType(LLAssetType::AT_LOST_AND_FOUND); | ||
824 | //BOOL inventory_has_focus = gFocusMgr.childHasKeyboardFocus(view); | ||
825 | BOOL user_is_away = gAwayTimer.getStarted(); | ||
826 | |||
827 | // don't select lost and found items if the user is active | ||
828 | if (gInventory.isObjectDescendentOf(item->getUUID(), lost_and_found_id) | ||
829 | && !user_is_away) | ||
830 | { | ||
831 | return; | ||
832 | } | ||
833 | |||
834 | //Not sure about this check. Could make it easy to miss incoming items. -Gigs | ||
835 | //don't dick with highlight while the user is working | ||
836 | //if(inventory_has_focus && !user_is_away) | ||
837 | // break; | ||
838 | //llinfos << "Highlighting" << item->getUUID() << llendl; | ||
839 | //highlight item | ||
840 | |||
841 | LLUICtrl* focus_ctrl = gFocusMgr.getKeyboardFocus(); | ||
842 | LLFocusMgr::FocusLostCallback callback; | ||
843 | callback = gFocusMgr.getFocusCallback(); | ||
844 | view->getPanel()->setSelection(item->getUUID(), TAKE_FOCUS_NO); | ||
845 | gFocusMgr.setKeyboardFocus(focus_ctrl, callback); | ||
723 | } | 846 | } |
724 | } | 847 | } |
725 | 848 | ||
@@ -807,11 +930,11 @@ void inventory_offer_callback(S32 option, void* user_data) | |||
807 | char group_name[MAX_STRING]; /* Flawfinder: ignore */ | 930 | char group_name[MAX_STRING]; /* Flawfinder: ignore */ |
808 | if (gCacheName->getGroupName(info->mFromID, group_name)) | 931 | if (gCacheName->getGroupName(info->mFromID, group_name)) |
809 | { | 932 | { |
810 | from_string = LLString("An object named ") + info->mFromName + " owned by the group '" + group_name + "'"; | 933 | from_string = LLString("An object named '") + info->mFromName + "' owned by the group '" + group_name + "'"; |
811 | } | 934 | } |
812 | else | 935 | else |
813 | { | 936 | { |
814 | from_string = LLString("An object named ") + info->mFromName + " owned by an unknown group"; | 937 | from_string = LLString("An object named '") + info->mFromName + "' owned by an unknown group"; |
815 | } | 938 | } |
816 | } | 939 | } |
817 | else | 940 | else |
@@ -820,11 +943,11 @@ void inventory_offer_callback(S32 option, void* user_data) | |||
820 | char last_name[MAX_STRING]; /* Flawfinder: ignore */ | 943 | char last_name[MAX_STRING]; /* Flawfinder: ignore */ |
821 | if (gCacheName->getName(info->mFromID, first_name, last_name)) | 944 | if (gCacheName->getName(info->mFromID, first_name, last_name)) |
822 | { | 945 | { |
823 | from_string = LLString("An object named ") + info->mFromName + " owned by " + first_name + " " + last_name; | 946 | from_string = LLString("An object named '") + info->mFromName + "' owned by " + first_name + " " + last_name; |
824 | } | 947 | } |
825 | else | 948 | else |
826 | { | 949 | { |
827 | from_string = LLString("An object named ") + info->mFromName + " owned by an unknown user"; | 950 | from_string = LLString("An object named '") + info->mFromName + "' owned by an unknown user"; |
828 | } | 951 | } |
829 | } | 952 | } |
830 | } | 953 | } |
@@ -833,9 +956,11 @@ void inventory_offer_callback(S32 option, void* user_data) | |||
833 | from_string = info->mFromName; | 956 | from_string = info->mFromName; |
834 | } | 957 | } |
835 | 958 | ||
959 | bool busy=FALSE; | ||
960 | |||
836 | switch(option) | 961 | switch(option) |
837 | { | 962 | { |
838 | case 0: | 963 | case IOR_ACCEPT: |
839 | // ACCEPT. The math for the dialog works, because the accept | 964 | // ACCEPT. The math for the dialog works, because the accept |
840 | // for inventory_offered, task_inventory_offer or | 965 | // for inventory_offered, task_inventory_offer or |
841 | // group_notice_inventory is 1 greater than the offer integer value. | 966 | // group_notice_inventory is 1 greater than the offer integer value. |
@@ -846,9 +971,15 @@ void inventory_offer_callback(S32 option, void* user_data) | |||
846 | sizeof(info->mFolderID.mData)); | 971 | sizeof(info->mFolderID.mData)); |
847 | // send the message | 972 | // send the message |
848 | msg->sendReliable(info->mHost); | 973 | msg->sendReliable(info->mHost); |
849 | log_message = info->mFromName + " gave you " + info->mDesc + "."; | 974 | |
850 | chat.mText = log_message; | 975 | //don't spam them if they are getting flooded |
851 | LLFloaterChat::addChatHistory(chat); | 976 | if (check_offer_throttle(info->mFromName, true)) |
977 | { | ||
978 | log_message = info->mFromName + " gave you " + info->mDesc + "."; | ||
979 | chat.mText = log_message; | ||
980 | LLFloaterChat::addChatHistory(chat); | ||
981 | } | ||
982 | |||
852 | // we will want to open this item when it comes back. | 983 | // we will want to open this item when it comes back. |
853 | lldebugs << "Initializing an opener for tid: " << info->mTransactionID | 984 | lldebugs << "Initializing an opener for tid: " << info->mTransactionID |
854 | << llendl; | 985 | << llendl; |
@@ -861,7 +992,7 @@ void inventory_offer_callback(S32 option, void* user_data) | |||
861 | // so we can fetch it out of our inventory. | 992 | // so we can fetch it out of our inventory. |
862 | LLInventoryFetchObserver::item_ref_t items; | 993 | LLInventoryFetchObserver::item_ref_t items; |
863 | items.push_back(info->mObjectID); | 994 | items.push_back(info->mObjectID); |
864 | LLOpenAgentOffer* open_agent_offer = new LLOpenAgentOffer; | 995 | LLOpenAgentOffer* open_agent_offer = new LLOpenAgentOffer(from_string); |
865 | open_agent_offer->fetchItems(items); | 996 | open_agent_offer->fetchItems(items); |
866 | if(catp || (itemp && itemp->isComplete())) | 997 | if(catp || (itemp && itemp->isComplete())) |
867 | { | 998 | { |
@@ -877,22 +1008,10 @@ void inventory_offer_callback(S32 option, void* user_data) | |||
877 | case IM_GROUP_NOTICE: | 1008 | case IM_GROUP_NOTICE: |
878 | case IM_GROUP_NOTICE_REQUESTED: | 1009 | case IM_GROUP_NOTICE_REQUESTED: |
879 | { | 1010 | { |
880 | // This is an offer from a task or group. | 1011 | // This is an offer from a task or group. |
881 | // Because it would be easy | 1012 | // We don't use a new instance of an opener |
882 | // to write a task which would overload your inventory, we | 1013 | // We instead use the singular observer gOpenTaskOffer |
883 | // force the offer to stay in an instant message until | 1014 | // Since it already exists, we don't need to actually do anything |
884 | // accepted. Thus, we have to respond, and then wait for | ||
885 | // the update to come back before we open the item. | ||
886 | LLOpenTaskOffer* open_task_offer = new LLOpenTaskOffer; | ||
887 | open_task_offer->watchItem(info->mObjectID); | ||
888 | if(itemp && itemp->isComplete()) | ||
889 | { | ||
890 | opener->changed(0x0); | ||
891 | } | ||
892 | else | ||
893 | { | ||
894 | opener = open_task_offer; | ||
895 | } | ||
896 | } | 1015 | } |
897 | break; | 1016 | break; |
898 | default: | 1017 | default: |
@@ -901,9 +1020,12 @@ void inventory_offer_callback(S32 option, void* user_data) | |||
901 | } | 1020 | } |
902 | break; | 1021 | break; |
903 | 1022 | ||
904 | case 2: | 1023 | case IOR_BUSY: |
1024 | //Busy falls through to decline. Says to make busy message. | ||
1025 | busy=TRUE; | ||
1026 | case IOR_MUTE: | ||
905 | // MUTE falls through to decline | 1027 | // MUTE falls through to decline |
906 | case 1: | 1028 | case IOR_DECLINE: |
907 | // DECLINE. The math for the dialog works, because the decline | 1029 | // DECLINE. The math for the dialog works, because the decline |
908 | // for inventory_offered, task_inventory_offer or | 1030 | // for inventory_offered, task_inventory_offer or |
909 | // group_notice_inventory is 2 greater than the offer integer value. | 1031 | // group_notice_inventory is 2 greater than the offer integer value. |
@@ -941,7 +1063,7 @@ void inventory_offer_callback(S32 option, void* user_data) | |||
941 | } | 1063 | } |
942 | 1064 | ||
943 | } | 1065 | } |
944 | if (!info->mFromGroup && !info->mFromObject) | 1066 | if (busy || (!info->mFromGroup && !info->mFromObject)) |
945 | { | 1067 | { |
946 | busy_message(msg,info->mFromID); | 1068 | busy_message(msg,info->mFromID); |
947 | } | 1069 | } |
@@ -964,88 +1086,73 @@ void inventory_offer_callback(S32 option, void* user_data) | |||
964 | 1086 | ||
965 | void inventory_offer_handler(LLOfferInfo* info, BOOL from_task) | 1087 | void inventory_offer_handler(LLOfferInfo* info, BOOL from_task) |
966 | { | 1088 | { |
967 | switch(info->mType) | 1089 | |
1090 | //Until throttling is implmented, busy mode should reject inventory instead of silently | ||
1091 | //accepting it. SEE SL-39554 | ||
1092 | if (gAgent.getBusy()) | ||
1093 | { | ||
1094 | inventory_offer_callback(IOR_BUSY, info); | ||
1095 | return; | ||
1096 | } | ||
1097 | |||
1098 | //If muted, don't even go through the messaging stuff. Just curtail the offer here. | ||
1099 | if (gMuteListp->isMuted(info->mFromID, info->mFromName)) | ||
1100 | { | ||
1101 | inventory_offer_callback(IOR_MUTE, info); | ||
1102 | return; | ||
1103 | } | ||
1104 | |||
1105 | if (gSavedSettings.getBOOL("ShowNewInventory") | ||
1106 | && (info->mType == LLAssetType::AT_NOTECARD | ||
1107 | || info->mType == LLAssetType::AT_LANDMARK | ||
1108 | || info->mType == LLAssetType::AT_TEXTURE)) | ||
968 | { | 1109 | { |
969 | // For certain types, just accept the items into the inventory, | 1110 | // For certain types, just accept the items into the inventory, |
970 | // and we'll automatically open them on receipt. | 1111 | // and we'll automatically open them on receipt. |
971 | case LLAssetType::AT_NOTECARD: | 1112 | // 0 = accept button |
972 | case LLAssetType::AT_LANDMARK: | 1113 | inventory_offer_callback(IOR_ACCEPT, info); |
973 | case LLAssetType::AT_TEXTURE: | 1114 | return; |
974 | { | 1115 | } |
975 | // 0 = accept button | 1116 | |
976 | inventory_offer_callback(0, info); | 1117 | LLString::format_map_t args; |
977 | //LLInventoryView::sOpenNextNewItem = TRUE; | 1118 | args["[OBJECTNAME]"] = info->mDesc; |
978 | } | 1119 | args["[OBJECTTYPE]"] = LLAssetType::lookupHumanReadable(info->mType); |
979 | break; | 1120 | |
980 | 1121 | // Name cache callbacks don't store userdata, so can't save | |
981 | case LLAssetType::AT_SOUND: | 1122 | // off the LLOfferInfo. Argh. JC |
982 | case LLAssetType::AT_CALLINGCARD: | 1123 | BOOL name_found = FALSE; |
983 | case LLAssetType::AT_SCRIPT: | 1124 | char first_name[MAX_STRING]; /* Flawfinder: ignore */ |
984 | case LLAssetType::AT_CLOTHING: | 1125 | char last_name[MAX_STRING]; /* Flawfinder: ignore */ |
985 | case LLAssetType::AT_OBJECT: | 1126 | if (info->mFromGroup) |
986 | case LLAssetType::AT_CATEGORY: | 1127 | { |
987 | case LLAssetType::AT_ROOT_CATEGORY: | 1128 | if (gCacheName->getGroupName(info->mFromID, first_name)) |
988 | case LLAssetType::AT_LSL_TEXT: | 1129 | { |
989 | case LLAssetType::AT_LSL_BYTECODE: | 1130 | args["[FIRST]"] = first_name; |
990 | case LLAssetType::AT_TEXTURE_TGA: | 1131 | args["[LAST]"] = ""; |
991 | case LLAssetType::AT_BODYPART: | 1132 | name_found = TRUE; |
992 | case LLAssetType::AT_TRASH: | 1133 | } |
993 | case LLAssetType::AT_SNAPSHOT_CATEGORY: | 1134 | } |
994 | case LLAssetType::AT_LOST_AND_FOUND: | 1135 | else |
995 | case LLAssetType::AT_ANIMATION: | 1136 | { |
996 | case LLAssetType::AT_GESTURE: | 1137 | if (gCacheName->getName(info->mFromID, first_name, last_name)) |
997 | default: | 1138 | { |
998 | { | 1139 | args["[FIRST]"] = first_name; |
999 | LLString::format_map_t args; | 1140 | args["[LAST]"] = last_name; |
1000 | args["[OBJECTNAME]"] = info->mDesc; | 1141 | name_found = TRUE; |
1001 | args["[OBJECTTYPE]"] = LLAssetType::lookupHumanReadable(info->mType); | 1142 | } |
1002 | 1143 | } | |
1003 | // Name cache callbacks don't store userdata, so can't save | 1144 | if (from_task) |
1004 | // off the LLOfferInfo. Argh. JC | 1145 | { |
1005 | BOOL name_found = FALSE; | 1146 | args["[OBJECTFROMNAME]"] = info->mFromName; |
1006 | char first_name[MAX_STRING]; /* Flawfinder: ignore */ | 1147 | LLNotifyBox::showXml(name_found ? "ObjectGiveItem" : "ObjectGiveItemUnknownUser", |
1007 | char last_name[MAX_STRING]; /* Flawfinder: ignore */ | 1148 | args, &inventory_offer_callback, (void*)info); |
1008 | if (info->mFromGroup) | 1149 | } |
1009 | { | 1150 | else |
1010 | if (gCacheName->getGroupName(info->mFromID, first_name)) | 1151 | { |
1011 | { | 1152 | // XUI:translate -> [FIRST] [LAST] |
1012 | args["[FIRST]"] = first_name; | 1153 | args["[NAME]"] = info->mFromName; |
1013 | args["[LAST]"] = ""; | 1154 | LLNotifyBox::showXml("UserGiveItem", args, |
1014 | name_found = TRUE; | 1155 | &inventory_offer_callback, (void*)info); |
1015 | } | ||
1016 | } | ||
1017 | else | ||
1018 | { | ||
1019 | if (gCacheName->getName(info->mFromID, first_name, last_name)) | ||
1020 | { | ||
1021 | args["[FIRST]"] = first_name; | ||
1022 | args["[LAST]"] = last_name; | ||
1023 | name_found = TRUE; | ||
1024 | } | ||
1025 | } | ||
1026 | if (from_task) | ||
1027 | { | ||
1028 | args["[OBJECTFROMNAME]"] = info->mFromName; | ||
1029 | if (name_found) | ||
1030 | { | ||
1031 | LLNotifyBox::showXml("ObjectGiveItem", args, | ||
1032 | &inventory_offer_callback, (void*)info); | ||
1033 | } | ||
1034 | else | ||
1035 | { | ||
1036 | LLNotifyBox::showXml("ObjectGiveItemUnknownUser", args, | ||
1037 | &inventory_offer_callback, (void*)info); | ||
1038 | } | ||
1039 | } | ||
1040 | else | ||
1041 | { | ||
1042 | // XUI:translate -> [FIRST] [LAST] | ||
1043 | args["[NAME]"] = info->mFromName; | ||
1044 | LLNotifyBox::showXml("UserGiveItem", args, | ||
1045 | &inventory_offer_callback, (void*)info); | ||
1046 | } | ||
1047 | break; | ||
1048 | } | ||
1049 | } | 1156 | } |
1050 | } | 1157 | } |
1051 | 1158 | ||
@@ -1538,10 +1645,7 @@ void process_improved_im(LLMessageSystem *msg, void **user_data) | |||
1538 | } | 1645 | } |
1539 | else | 1646 | else |
1540 | { | 1647 | { |
1541 | if (dialog == IM_TASK_INVENTORY_OFFERED) | 1648 | inventory_offer_handler(info, dialog == IM_TASK_INVENTORY_OFFERED); |
1542 | inventory_offer_handler(info, TRUE); | ||
1543 | else | ||
1544 | inventory_offer_handler(info, FALSE); | ||
1545 | } | 1649 | } |
1546 | } | 1650 | } |
1547 | break; | 1651 | break; |
@@ -1760,6 +1864,14 @@ void process_improved_im(LLMessageSystem *msg, void **user_data) | |||
1760 | 1864 | ||
1761 | case IM_GOTO_URL: | 1865 | case IM_GOTO_URL: |
1762 | { | 1866 | { |
1867 | if (binary_bucket_size <= 0) | ||
1868 | { | ||
1869 | llwarns << "bad binary_bucket_size: " | ||
1870 | << binary_bucket_size | ||
1871 | << " - aborting function." << llendl; | ||
1872 | return; | ||
1873 | } | ||
1874 | |||
1763 | char* url = new char[binary_bucket_size]; | 1875 | char* url = new char[binary_bucket_size]; |
1764 | if (url == NULL) | 1876 | if (url == NULL) |
1765 | { | 1877 | { |
@@ -1985,16 +2097,22 @@ void process_offer_callingcard(LLMessageSystem* msg, void**) | |||
1985 | { | 2097 | { |
1986 | // automatically decline offer | 2098 | // automatically decline offer |
1987 | callingcard_offer_callback(1, (void*)offerdata); | 2099 | callingcard_offer_callback(1, (void*)offerdata); |
1988 | return; | 2100 | offerdata = NULL; // pointer was freed by callback |
2101 | } | ||
2102 | else | ||
2103 | { | ||
2104 | LLNotifyBox::showXml("OfferCallingCard", args, | ||
2105 | &callingcard_offer_callback, (void*)offerdata); | ||
2106 | offerdata = NULL; // pointer ownership transferred | ||
1989 | } | 2107 | } |
1990 | |||
1991 | LLNotifyBox::showXml("OfferCallingCard", args, | ||
1992 | &callingcard_offer_callback, (void*)offerdata); | ||
1993 | } | 2108 | } |
1994 | else | 2109 | else |
1995 | { | 2110 | { |
1996 | llwarns << "Calling card offer from an unknown source." << llendl; | 2111 | llwarns << "Calling card offer from an unknown source." << llendl; |
1997 | } | 2112 | } |
2113 | |||
2114 | delete offerdata; // !=NULL if we didn't give ownership away | ||
2115 | offerdata = NULL; | ||
1998 | } | 2116 | } |
1999 | 2117 | ||
2000 | void process_accept_callingcard(LLMessageSystem* msg, void**) | 2118 | void process_accept_callingcard(LLMessageSystem* msg, void**) |
@@ -3609,7 +3727,7 @@ void process_avatar_sit_response(LLMessageSystem *mesgsys, void **user_data) | |||
3609 | if (object) | 3727 | if (object) |
3610 | { | 3728 | { |
3611 | LLVector3 sit_spot = object->getPositionAgent() + (sitPosition * object->getRotation()); | 3729 | LLVector3 sit_spot = object->getPositionAgent() + (sitPosition * object->getRotation()); |
3612 | if (!use_autopilot || (avatar->mIsSitting && avatar->getRoot() == object->getRoot())) | 3730 | if (!use_autopilot || (avatar && avatar->mIsSitting && avatar->getRoot() == object->getRoot())) |
3613 | { | 3731 | { |
3614 | //we're already sitting on this object, so don't autopilot | 3732 | //we're already sitting on this object, so don't autopilot |
3615 | } | 3733 | } |
@@ -5002,9 +5120,10 @@ void onCovenantLoadComplete(LLVFS *vfs, | |||
5002 | 5120 | ||
5003 | if( (file_length > 19) && !strncmp( buffer, "Linden text version", 19 ) ) | 5121 | if( (file_length > 19) && !strncmp( buffer, "Linden text version", 19 ) ) |
5004 | { | 5122 | { |
5005 | LLViewerTextEditor* editor = new LLViewerTextEditor("temp", | 5123 | LLViewerTextEditor* editor = |
5006 | LLRect(0,0,0,0), | 5124 | new LLViewerTextEditor("temp", |
5007 | file_length+1); | 5125 | LLRect(0,0,0,0), |
5126 | file_length+1); | ||
5008 | if( !editor->importBuffer( buffer ) ) | 5127 | if( !editor->importBuffer( buffer ) ) |
5009 | { | 5128 | { |
5010 | llwarns << "Problem importing estate covenant." << llendl; | 5129 | llwarns << "Problem importing estate covenant." << llendl; |
@@ -5020,27 +5139,32 @@ void onCovenantLoadComplete(LLVFS *vfs, | |||
5020 | } | 5139 | } |
5021 | else | 5140 | else |
5022 | { | 5141 | { |
5023 | if( gViewerStats ) | 5142 | llwarns << "Problem importing estate covenant: Covenant file format error." << llendl; |
5024 | { | 5143 | covenant_text = "Problem importing estate covenant: Covenant file format error."; |
5025 | gViewerStats->incStat( LLViewerStats::ST_DOWNLOAD_FAILED ); | 5144 | } |
5026 | } | 5145 | } |
5027 | 5146 | else | |
5028 | if( LL_ERR_ASSET_REQUEST_NOT_IN_DATABASE == status || | 5147 | { |
5029 | LL_ERR_FILE_EMPTY == status) | 5148 | if( gViewerStats ) |
5030 | { | 5149 | { |
5031 | covenant_text = "Estate covenant notecard is missing from database."; | 5150 | gViewerStats->incStat( LLViewerStats::ST_DOWNLOAD_FAILED ); |
5032 | } | ||
5033 | else if (LL_ERR_INSUFFICIENT_PERMISSIONS == status) | ||
5034 | { | ||
5035 | covenant_text = "Insufficient permissions to view estate covenant."; | ||
5036 | } | ||
5037 | else | ||
5038 | { | ||
5039 | covenant_text = "Unable to load estate covenant at this time."; | ||
5040 | } | ||
5041 | |||
5042 | llwarns << "Problem loading notecard: " << status << llendl; | ||
5043 | } | 5151 | } |
5152 | |||
5153 | if( LL_ERR_ASSET_REQUEST_NOT_IN_DATABASE == status || | ||
5154 | LL_ERR_FILE_EMPTY == status) | ||
5155 | { | ||
5156 | covenant_text = "Estate covenant notecard is missing from database."; | ||
5157 | } | ||
5158 | else if (LL_ERR_INSUFFICIENT_PERMISSIONS == status) | ||
5159 | { | ||
5160 | covenant_text = "Insufficient permissions to view estate covenant."; | ||
5161 | } | ||
5162 | else | ||
5163 | { | ||
5164 | covenant_text = "Unable to load estate covenant at this time."; | ||
5165 | } | ||
5166 | |||
5167 | llwarns << "Problem loading notecard: " << status << llendl; | ||
5044 | } | 5168 | } |
5045 | LLPanelEstateCovenant::updateCovenantText(covenant_text, asset_uuid); | 5169 | LLPanelEstateCovenant::updateCovenantText(covenant_text, asset_uuid); |
5046 | LLPanelLandCovenant::updateCovenantText(covenant_text); | 5170 | LLPanelLandCovenant::updateCovenantText(covenant_text); |
diff --git a/linden/indra/newview/llviewermessage.h b/linden/indra/newview/llviewermessage.h index ce8f6a7..14f2cda 100644 --- a/linden/indra/newview/llviewermessage.h +++ b/linden/indra/newview/llviewermessage.h | |||
@@ -48,6 +48,14 @@ class LLViewerRegion; | |||
48 | // Prototypes | 48 | // Prototypes |
49 | // | 49 | // |
50 | 50 | ||
51 | enum InventoryOfferResponse | ||
52 | { | ||
53 | IOR_ACCEPT, | ||
54 | IOR_DECLINE, | ||
55 | IOR_MUTE, | ||
56 | IOR_BUSY | ||
57 | }; | ||
58 | |||
51 | BOOL can_afford_transaction(S32 cost); | 59 | BOOL can_afford_transaction(S32 cost); |
52 | void give_money(const LLUUID& uuid, LLViewerRegion* region, S32 amount, BOOL is_group = FALSE, | 60 | void give_money(const LLUUID& uuid, LLViewerRegion* region, S32 amount, BOOL is_group = FALSE, |
53 | S32 trx_type = TRANS_GIFT, const LLString& desc = LLString::null); | 61 | S32 trx_type = TRANS_GIFT, const LLString& desc = LLString::null); |
@@ -190,6 +198,7 @@ void invalid_message_callback(LLMessageSystem*, void*, EMessageException); | |||
190 | 198 | ||
191 | void process_initiate_download(LLMessageSystem* msg, void**); | 199 | void process_initiate_download(LLMessageSystem* msg, void**); |
192 | void inventory_offer_callback(S32 option, void* user_data); | 200 | void inventory_offer_callback(S32 option, void* user_data); |
201 | void start_new_inventory_observer(); | ||
193 | 202 | ||
194 | struct LLOfferInfo | 203 | struct LLOfferInfo |
195 | { | 204 | { |
diff --git a/linden/indra/newview/llviewerobject.cpp b/linden/indra/newview/llviewerobject.cpp index 5cb65b6..58d57b5 100644 --- a/linden/indra/newview/llviewerobject.cpp +++ b/linden/indra/newview/llviewerobject.cpp | |||
@@ -639,10 +639,10 @@ BOOL LLViewerObject::setDrawableParent(LLDrawable* parentp) | |||
639 | } | 639 | } |
640 | 640 | ||
641 | U32 LLViewerObject::processUpdateMessage(LLMessageSystem *mesgsys, | 641 | U32 LLViewerObject::processUpdateMessage(LLMessageSystem *mesgsys, |
642 | void **user_data, | 642 | void **user_data, |
643 | U32 block_num, | 643 | U32 block_num, |
644 | const EObjectUpdateType update_type, | 644 | const EObjectUpdateType update_type, |
645 | LLDataPacker *dp) | 645 | LLDataPacker *dp) |
646 | { | 646 | { |
647 | LLMemType mt(LLMemType::MTYPE_OBJECT); | 647 | LLMemType mt(LLMemType::MTYPE_OBJECT); |
648 | 648 | ||
@@ -658,6 +658,7 @@ U32 LLViewerObject::processUpdateMessage(LLMessageSystem *mesgsys, | |||
658 | from_region_handle(region_handle, &x, &y); | 658 | from_region_handle(region_handle, &x, &y); |
659 | 659 | ||
660 | llerrs << "Object has invalid region " << x << ":" << y << "!" << llendl; | 660 | llerrs << "Object has invalid region " << x << ":" << y << "!" << llendl; |
661 | return retval; | ||
661 | } | 662 | } |
662 | 663 | ||
663 | U16 time_dilation16; | 664 | U16 time_dilation16; |
@@ -934,7 +935,7 @@ U32 LLViewerObject::processUpdateMessage(LLMessageSystem *mesgsys, | |||
934 | 935 | ||
935 | // Check for appended generic data | 936 | // Check for appended generic data |
936 | S32 data_size = mesgsys->getSizeFast(_PREHASH_ObjectData, block_num, _PREHASH_Data); | 937 | S32 data_size = mesgsys->getSizeFast(_PREHASH_ObjectData, block_num, _PREHASH_Data); |
937 | if (data_size == 0) | 938 | if (data_size <= 0) |
938 | { | 939 | { |
939 | mData = NULL; | 940 | mData = NULL; |
940 | } | 941 | } |
@@ -1757,9 +1758,16 @@ U32 LLViewerObject::processUpdateMessage(LLMessageSystem *mesgsys, | |||
1757 | if (gPingInterpolate) | 1758 | if (gPingInterpolate) |
1758 | { | 1759 | { |
1759 | LLCircuitData *cdp = gMessageSystem->mCircuitInfo.findCircuit(mesgsys->getSender()); | 1760 | LLCircuitData *cdp = gMessageSystem->mCircuitInfo.findCircuit(mesgsys->getSender()); |
1760 | F32 ping_delay = 0.5f * mTimeDilation * ( ((F32)cdp->getPingDelay()) * 0.001f + gFrameDTClamped); | 1761 | if (cdp) |
1761 | LLVector3 diff = getVelocity() * (0.5f*mTimeDilation*(gFrameDTClamped + ((F32)ping_delay)*0.001f)); | 1762 | { |
1762 | new_pos_parent += diff; | 1763 | F32 ping_delay = 0.5f * mTimeDilation * ( ((F32)cdp->getPingDelay()) * 0.001f + gFrameDTClamped); |
1764 | LLVector3 diff = getVelocity() * (0.5f*mTimeDilation*(gFrameDTClamped + ((F32)ping_delay)*0.001f)); | ||
1765 | new_pos_parent += diff; | ||
1766 | } | ||
1767 | else | ||
1768 | { | ||
1769 | llwarns << "findCircuit() returned NULL; skipping interpolation" << llendl; | ||
1770 | } | ||
1763 | } | 1771 | } |
1764 | 1772 | ||
1765 | ////////////////////////// | 1773 | ////////////////////////// |
@@ -4134,7 +4142,7 @@ void LLViewerObject::setAttachedSound(const LLUUID &audio_uuid, const LLUUID& ow | |||
4134 | { | 4142 | { |
4135 | return; | 4143 | return; |
4136 | } | 4144 | } |
4137 | 4145 | ||
4138 | if (audio_uuid.isNull()) | 4146 | if (audio_uuid.isNull()) |
4139 | { | 4147 | { |
4140 | if (mAudioSourcep && mAudioSourcep->isLoop() && !mAudioSourcep->hasPendingPreloads()) | 4148 | if (mAudioSourcep && mAudioSourcep->isLoop() && !mAudioSourcep->hasPendingPreloads()) |
@@ -4169,7 +4177,8 @@ void LLViewerObject::setAttachedSound(const LLUUID &audio_uuid, const LLUUID& ow | |||
4169 | } | 4177 | } |
4170 | } | 4178 | } |
4171 | 4179 | ||
4172 | if ( mAudioSourcep ) | 4180 | // don't clean up before previous sound is done. Solves: SL-33486 |
4181 | if ( mAudioSourcep && mAudioSourcep->isDone() ) | ||
4173 | { | 4182 | { |
4174 | gAudiop->cleanupAudioSource(mAudioSourcep); | 4183 | gAudiop->cleanupAudioSource(mAudioSourcep); |
4175 | mAudioSourcep = NULL; | 4184 | mAudioSourcep = NULL; |
diff --git a/linden/indra/newview/llviewerparceloverlay.cpp b/linden/indra/newview/llviewerparceloverlay.cpp index d5ad910..e31b714 100644 --- a/linden/indra/newview/llviewerparceloverlay.cpp +++ b/linden/indra/newview/llviewerparceloverlay.cpp | |||
@@ -485,20 +485,21 @@ void LLViewerParcelOverlay::updatePropertyLines() | |||
485 | // shuffling. | 485 | // shuffling. |
486 | S32 new_vertex_count = new_vertex_array.count(); | 486 | S32 new_vertex_count = new_vertex_array.count(); |
487 | 487 | ||
488 | // NOTE: If the new_vertex_count is 0 and wasn't 0 previously | 488 | if (!(mVertexArray && mColorArray && new_vertex_count == mVertexCount)) |
489 | // the arrays are still allocated as the arrays aren't set to NULL, etc. | ||
490 | // This won't cause any problems, but might waste a few cycles copying over | ||
491 | // old data. - jwolk | ||
492 | if ( !(mVertexArray && mColorArray && new_vertex_count == mVertexCount) && new_vertex_count > 0 ) | ||
493 | { | 489 | { |
494 | // ...need new arrays | 490 | // ...need new arrays |
495 | delete[] mVertexArray; | 491 | delete[] mVertexArray; |
492 | mVertexArray = NULL; | ||
496 | delete[] mColorArray; | 493 | delete[] mColorArray; |
494 | mColorArray = NULL; | ||
497 | 495 | ||
498 | mVertexCount = new_vertex_count; | 496 | mVertexCount = new_vertex_count; |
499 | 497 | ||
500 | mVertexArray = new F32[3 * mVertexCount]; | 498 | if (new_vertex_count > 0) |
501 | mColorArray = new U8 [4 * mVertexCount]; | 499 | { |
500 | mVertexArray = new F32[3 * mVertexCount]; | ||
501 | mColorArray = new U8 [4 * mVertexCount]; | ||
502 | } | ||
502 | } | 503 | } |
503 | 504 | ||
504 | // Copy the new data into the arrays | 505 | // Copy the new data into the arrays |
diff --git a/linden/indra/newview/llviewerwindow.cpp b/linden/indra/newview/llviewerwindow.cpp index 9498dbd..c57c84a 100644 --- a/linden/indra/newview/llviewerwindow.cpp +++ b/linden/indra/newview/llviewerwindow.cpp | |||
@@ -1504,27 +1504,8 @@ LLViewerWindow::LLViewerWindow( | |||
1504 | // stuff like AGP if we think that it'll crash the viewer. | 1504 | // stuff like AGP if we think that it'll crash the viewer. |
1505 | // | 1505 | // |
1506 | gFeatureManagerp->initGraphicsFeatureMasks(); | 1506 | gFeatureManagerp->initGraphicsFeatureMasks(); |
1507 | |||
1508 | // The ATI Mobility Radeon with 1.15.0 causes crashes in FMOD on startup for | ||
1509 | // unknown reasons, but only if you have an old settings.ini file. | ||
1510 | // In this case, force the graphics settings back to recommended, but only | ||
1511 | // do it once. JC | ||
1512 | std::string gpu_string = gFeatureManagerp->getGPUString(); | ||
1513 | LLString::toLower(gpu_string); | ||
1514 | bool upgrade_to_1_15 = (gSavedSettings.getString("LastRunVersion") != "1.15.0"); | ||
1515 | bool mobility_radeon = (gpu_string.find("mobility radeon") != std::string::npos); | ||
1516 | bool mobility_radeon_upgrade_hack = upgrade_to_1_15 && mobility_radeon; | ||
1517 | if (mobility_radeon_upgrade_hack) | ||
1518 | { | ||
1519 | llinfos << "1.15.0 update on Mobility Radeon" << llendl; | ||
1520 | llinfos << "Forcing recommended graphics settings" << llendl; | ||
1521 | llinfos << "Forcing audio off" << llendl; | ||
1522 | gUseAudio = FALSE; | ||
1523 | } | ||
1524 | |||
1525 | if (gFeatureManagerp->isSafe() | 1507 | if (gFeatureManagerp->isSafe() |
1526 | || (gSavedSettings.getS32("LastFeatureVersion") != gFeatureManagerp->getVersion()) | 1508 | || (gSavedSettings.getS32("LastFeatureVersion") != gFeatureManagerp->getVersion())) |
1527 | || mobility_radeon_upgrade_hack) | ||
1528 | { | 1509 | { |
1529 | gFeatureManagerp->applyRecommendedFeatures(); | 1510 | gFeatureManagerp->applyRecommendedFeatures(); |
1530 | } | 1511 | } |
@@ -1747,7 +1728,7 @@ void LLViewerWindow::initBase() | |||
1747 | mToolTip->setBorderVisible( FALSE ); | 1728 | mToolTip->setBorderVisible( FALSE ); |
1748 | mToolTip->setBackgroundColor( gColors.getColor( "ToolTipBgColor" ) ); | 1729 | mToolTip->setBackgroundColor( gColors.getColor( "ToolTipBgColor" ) ); |
1749 | mToolTip->setBackgroundVisible( TRUE ); | 1730 | mToolTip->setBackgroundVisible( TRUE ); |
1750 | mToolTip->setDropshadowVisible( FALSE ); | 1731 | mToolTip->setFontStyle(LLFontGL::NORMAL); |
1751 | mToolTip->setBorderDropshadowVisible( TRUE ); | 1732 | mToolTip->setBorderDropshadowVisible( TRUE ); |
1752 | mToolTip->setVisible( FALSE ); | 1733 | mToolTip->setVisible( FALSE ); |
1753 | 1734 | ||
diff --git a/linden/indra/newview/llvlcomposition.cpp b/linden/indra/newview/llvlcomposition.cpp index af0fe96..370bf24 100644 --- a/linden/indra/newview/llvlcomposition.cpp +++ b/linden/indra/newview/llvlcomposition.cpp | |||
@@ -126,6 +126,13 @@ BOOL LLVLComposition::generateHeights(const F32 x, const F32 y, | |||
126 | } | 126 | } |
127 | 127 | ||
128 | llassert(mSurfacep); | 128 | llassert(mSurfacep); |
129 | |||
130 | if (!mSurfacep || !mSurfacep->getRegion()) | ||
131 | { | ||
132 | // We don't always have the region yet here.... | ||
133 | return FALSE; | ||
134 | } | ||
135 | |||
129 | S32 x_begin, y_begin, x_end, y_end; | 136 | S32 x_begin, y_begin, x_end, y_end; |
130 | 137 | ||
131 | x_begin = llround( x * mScaleInv ); | 138 | x_begin = llround( x * mScaleInv ); |
diff --git a/linden/indra/newview/llvoavatar.cpp b/linden/indra/newview/llvoavatar.cpp index 25c6eb6..37380a4 100644 --- a/linden/indra/newview/llvoavatar.cpp +++ b/linden/indra/newview/llvoavatar.cpp | |||
@@ -1486,6 +1486,7 @@ void LLVOAvatar::initClass() | |||
1486 | if (!root) | 1486 | if (!root) |
1487 | { | 1487 | { |
1488 | llerrs << "No root node found in avatar configuration file: " << xmlFile << llendl; | 1488 | llerrs << "No root node found in avatar configuration file: " << xmlFile << llendl; |
1489 | return; | ||
1489 | } | 1490 | } |
1490 | 1491 | ||
1491 | //------------------------------------------------------------------------- | 1492 | //------------------------------------------------------------------------- |
@@ -1893,6 +1894,7 @@ void LLVOAvatar::buildCharacter() | |||
1893 | mEyeRightp)) | 1894 | mEyeRightp)) |
1894 | { | 1895 | { |
1895 | llerrs << "Failed to create avatar." << llendl; | 1896 | llerrs << "Failed to create avatar." << llendl; |
1897 | return; | ||
1896 | } | 1898 | } |
1897 | 1899 | ||
1898 | //------------------------------------------------------------------------- | 1900 | //------------------------------------------------------------------------- |
@@ -2461,7 +2463,7 @@ BOOL LLVOAvatar::idleUpdate(LLAgent &agent, LLWorld &world, const F64 &time) | |||
2461 | 2463 | ||
2462 | if (LLVOAvatar::sJointDebug) | 2464 | if (LLVOAvatar::sJointDebug) |
2463 | { | 2465 | { |
2464 | llinfos << getNVPair("FirstName")->getString() << getNVPair("LastName")->getString() << ": joint touches: " << LLJoint::sNumTouches << " updates: " << LLJoint::sNumUpdates << llendl; | 2466 | llinfos << getFullname() << ": joint touches: " << LLJoint::sNumTouches << " updates: " << LLJoint::sNumUpdates << llendl; |
2465 | } | 2467 | } |
2466 | 2468 | ||
2467 | LLJoint::sNumUpdates = 0; | 2469 | LLJoint::sNumUpdates = 0; |
@@ -4809,7 +4811,7 @@ BOOL LLVOAvatar::allocateCollisionVolumes( U32 num ) | |||
4809 | LLJoint *LLVOAvatar::getCharacterJoint( U32 num ) | 4811 | LLJoint *LLVOAvatar::getCharacterJoint( U32 num ) |
4810 | { | 4812 | { |
4811 | if ((S32)num >= mNumJoints | 4813 | if ((S32)num >= mNumJoints |
4812 | || num < 0) | 4814 | || (S32)num < 0) |
4813 | { | 4815 | { |
4814 | return NULL; | 4816 | return NULL; |
4815 | } | 4817 | } |
diff --git a/linden/indra/newview/llvoclouds.cpp b/linden/indra/newview/llvoclouds.cpp index 24084cf..be7c1b1 100644 --- a/linden/indra/newview/llvoclouds.cpp +++ b/linden/indra/newview/llvoclouds.cpp | |||
@@ -126,6 +126,12 @@ BOOL LLVOClouds::updateGeometry(LLDrawable *drawable) | |||
126 | for ( ; face_indx < num_faces; face_indx++) | 126 | for ( ; face_indx < num_faces; face_indx++) |
127 | { | 127 | { |
128 | facep = drawable->getFace(face_indx); | 128 | facep = drawable->getFace(face_indx); |
129 | if (!facep) | ||
130 | { | ||
131 | llwarns << "No facep for index " << face_indx << llendl; | ||
132 | continue; | ||
133 | } | ||
134 | |||
129 | if (isParticle()) | 135 | if (isParticle()) |
130 | { | 136 | { |
131 | facep->setSize(1,1); | 137 | facep->setSize(1,1); |
@@ -143,6 +149,12 @@ BOOL LLVOClouds::updateGeometry(LLDrawable *drawable) | |||
143 | for ( ; face_indx < drawable->getNumFaces(); face_indx++) | 149 | for ( ; face_indx < drawable->getNumFaces(); face_indx++) |
144 | { | 150 | { |
145 | facep = drawable->getFace(face_indx); | 151 | facep = drawable->getFace(face_indx); |
152 | if (!facep) | ||
153 | { | ||
154 | llwarns << "No facep for index " << face_indx << llendl; | ||
155 | continue; | ||
156 | } | ||
157 | |||
146 | facep->setTEOffset(face_indx); | 158 | facep->setTEOffset(face_indx); |
147 | facep->setSize(0,0); | 159 | facep->setSize(0,0); |
148 | } | 160 | } |
diff --git a/linden/indra/newview/llvopartgroup.cpp b/linden/indra/newview/llvopartgroup.cpp index 28aeb29..fbf753a 100644 --- a/linden/indra/newview/llvopartgroup.cpp +++ b/linden/indra/newview/llvopartgroup.cpp | |||
@@ -151,7 +151,7 @@ BOOL LLVOPartGroup::updateGeometry(LLDrawable *drawable) | |||
151 | 151 | ||
152 | if (!num_parts) | 152 | if (!num_parts) |
153 | { | 153 | { |
154 | if (drawable->getNumFaces()) | 154 | if (group && drawable->getNumFaces()) |
155 | { | 155 | { |
156 | group->dirtyGeom(); | 156 | group->dirtyGeom(); |
157 | } | 157 | } |
@@ -206,6 +206,12 @@ BOOL LLVOPartGroup::updateGeometry(LLDrawable *drawable) | |||
206 | count++; | 206 | count++; |
207 | 207 | ||
208 | facep = drawable->getFace(i); | 208 | facep = drawable->getFace(i); |
209 | if (!facep) | ||
210 | { | ||
211 | llwarns << "No face found for index " << i << "!" << llendl; | ||
212 | continue; | ||
213 | } | ||
214 | |||
209 | facep->setTEOffset(i); | 215 | facep->setTEOffset(i); |
210 | const F32 NEAR_PART_DIST_SQ = 5.f*5.f; // Only discard particles > 5 m from the camera | 216 | const F32 NEAR_PART_DIST_SQ = 5.f*5.f; // Only discard particles > 5 m from the camera |
211 | const F32 MIN_PART_AREA = .005f*.005f; // only less than 5 mm x 5 mm at 1 m from camera | 217 | const F32 MIN_PART_AREA = .005f*.005f; // only less than 5 mm x 5 mm at 1 m from camera |
@@ -259,6 +265,11 @@ BOOL LLVOPartGroup::updateGeometry(LLDrawable *drawable) | |||
259 | for (i = count; i < drawable->getNumFaces(); i++) | 265 | for (i = count; i < drawable->getNumFaces(); i++) |
260 | { | 266 | { |
261 | LLFace* facep = drawable->getFace(i); | 267 | LLFace* facep = drawable->getFace(i); |
268 | if (!facep) | ||
269 | { | ||
270 | llwarns << "No face found for index " << i << "!" << llendl; | ||
271 | continue; | ||
272 | } | ||
262 | facep->setTEOffset(i); | 273 | facep->setTEOffset(i); |
263 | facep->setSize(0,0); | 274 | facep->setSize(0,0); |
264 | } | 275 | } |
diff --git a/linden/indra/newview/llwindebug.cpp b/linden/indra/newview/llwindebug.cpp index 6221b85..7433984 100644 --- a/linden/indra/newview/llwindebug.cpp +++ b/linden/indra/newview/llwindebug.cpp | |||
@@ -131,6 +131,8 @@ BOOL LLWinDebug::setupExceptionHandler() | |||
131 | if (!f_mdwp) | 131 | if (!f_mdwp) |
132 | { | 132 | { |
133 | write_debug("No MiniDumpWriteDump!\n"); | 133 | write_debug("No MiniDumpWriteDump!\n"); |
134 | FreeLibrary(hDll); | ||
135 | hDll = NULL; | ||
134 | ok = FALSE; | 136 | ok = FALSE; |
135 | } | 137 | } |
136 | } | 138 | } |
diff --git a/linden/indra/newview/llworldmap.cpp b/linden/indra/newview/llworldmap.cpp index f2a2c90..db7ac19 100644 --- a/linden/indra/newview/llworldmap.cpp +++ b/linden/indra/newview/llworldmap.cpp | |||
@@ -491,7 +491,7 @@ void LLWorldMap::processMapBlockReply(LLMessageSystem* msg, void**) | |||
491 | U32 agent_flags; | 491 | U32 agent_flags; |
492 | msg->getU32Fast(_PREHASH_AgentData, _PREHASH_Flags, agent_flags); | 492 | msg->getU32Fast(_PREHASH_AgentData, _PREHASH_Flags, agent_flags); |
493 | 493 | ||
494 | if (agent_flags < 0 || agent_flags >= MAP_SIM_IMAGE_TYPES) | 494 | if ((S32)agent_flags < 0 || agent_flags >= MAP_SIM_IMAGE_TYPES) |
495 | { | 495 | { |
496 | llwarns << "Invalid map image type returned! " << agent_flags << llendl; | 496 | llwarns << "Invalid map image type returned! " << agent_flags << llendl; |
497 | return; | 497 | return; |
diff --git a/linden/indra/newview/llworldmapview.cpp b/linden/indra/newview/llworldmapview.cpp index 01dd1b8..328af72 100644 --- a/linden/indra/newview/llworldmapview.cpp +++ b/linden/indra/newview/llworldmapview.cpp | |||
@@ -178,7 +178,6 @@ LLWorldMapView::LLWorldMapView(const std::string& name, const LLRect& rect ) | |||
178 | LLRect major_dir_rect( 0, DIR_HEIGHT, DIR_WIDTH, 0 ); | 178 | LLRect major_dir_rect( 0, DIR_HEIGHT, DIR_WIDTH, 0 ); |
179 | 179 | ||
180 | mTextBoxNorth = new LLTextBox( "N", major_dir_rect ); | 180 | mTextBoxNorth = new LLTextBox( "N", major_dir_rect ); |
181 | mTextBoxNorth->setDropshadowVisible( TRUE ); | ||
182 | addChild( mTextBoxNorth ); | 181 | addChild( mTextBoxNorth ); |
183 | 182 | ||
184 | LLColor4 minor_color( 1.f, 1.f, 1.f, .7f ); | 183 | LLColor4 minor_color( 1.f, 1.f, 1.f, .7f ); |
diff --git a/linden/indra/newview/macview.xcodeproj/project.pbxproj b/linden/indra/newview/macview.xcodeproj/project.pbxproj index 9534878..8bc52b1 100644 --- a/linden/indra/newview/macview.xcodeproj/project.pbxproj +++ b/linden/indra/newview/macview.xcodeproj/project.pbxproj | |||
@@ -40,6 +40,8 @@ | |||
40 | 1A758C940A436FD800589675 /* llpanellandobjects.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 1A758C930A436FD800589675 /* llpanellandobjects.cpp */; }; | 40 | 1A758C940A436FD800589675 /* llpanellandobjects.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 1A758C930A436FD800589675 /* llpanellandobjects.cpp */; }; |
41 | 1A758C960A436FDE00589675 /* llpanellandoptions.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 1A758C950A436FDE00589675 /* llpanellandoptions.cpp */; }; | 41 | 1A758C960A436FDE00589675 /* llpanellandoptions.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 1A758C950A436FDE00589675 /* llpanellandoptions.cpp */; }; |
42 | 1A83767E0BA2169600F28979 /* llviewergenericmessage.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 1A83767D0BA2169600F28979 /* llviewergenericmessage.cpp */; }; | 42 | 1A83767E0BA2169600F28979 /* llviewergenericmessage.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 1A83767D0BA2169600F28979 /* llviewergenericmessage.cpp */; }; |
43 | 1A8870D50BCC5A6300E89AA6 /* llinventorytype.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 1A8870D40BCC5A6300E89AA6 /* llinventorytype.cpp */; }; | ||
44 | 1A8870E50BCC5A9500E89AA6 /* llviewermenufile.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 1A8870E40BCC5A9500E89AA6 /* llviewermenufile.cpp */; }; | ||
43 | 1A89230508B12D1000A04AA9 /* llurlwhitelist.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 1A89230308B12D1000A04AA9 /* llurlwhitelist.cpp */; }; | 45 | 1A89230508B12D1000A04AA9 /* llurlwhitelist.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 1A89230308B12D1000A04AA9 /* llurlwhitelist.cpp */; }; |
44 | 1A89230808B12D2E00A04AA9 /* llfloateropenobject.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 1A89230608B12D2E00A04AA9 /* llfloateropenobject.cpp */; }; | 46 | 1A89230808B12D2E00A04AA9 /* llfloateropenobject.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 1A89230608B12D2E00A04AA9 /* llfloateropenobject.cpp */; }; |
45 | 1A89230A08B12D9900A04AA9 /* llmediabase.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 1A89230908B12D9800A04AA9 /* llmediabase.cpp */; }; | 47 | 1A89230A08B12D9900A04AA9 /* llmediabase.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 1A89230908B12D9800A04AA9 /* llmediabase.cpp */; }; |
@@ -850,6 +852,11 @@ | |||
850 | 1A758C990A43700400589675 /* llagentdata.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = llagentdata.h; sourceTree = "<group>"; }; | 852 | 1A758C990A43700400589675 /* llagentdata.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = llagentdata.h; sourceTree = "<group>"; }; |
851 | 1A83767C0BA2169600F28979 /* llviewergenericmessage.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = llviewergenericmessage.h; sourceTree = "<group>"; }; | 853 | 1A83767C0BA2169600F28979 /* llviewergenericmessage.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = llviewergenericmessage.h; sourceTree = "<group>"; }; |
852 | 1A83767D0BA2169600F28979 /* llviewergenericmessage.cpp */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; path = llviewergenericmessage.cpp; sourceTree = "<group>"; }; | 854 | 1A83767D0BA2169600F28979 /* llviewergenericmessage.cpp */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; path = llviewergenericmessage.cpp; sourceTree = "<group>"; }; |
855 | 1A8870D30BCC5A6300E89AA6 /* llinventorytype.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = llinventorytype.h; sourceTree = "<group>"; }; | ||
856 | 1A8870D40BCC5A6300E89AA6 /* llinventorytype.cpp */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; path = llinventorytype.cpp; sourceTree = "<group>"; }; | ||
857 | 1A8870E30BCC5A9500E89AA6 /* llviewermenufile.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = llviewermenufile.h; sourceTree = "<group>"; }; | ||
858 | 1A8870E40BCC5A9500E89AA6 /* llviewermenufile.cpp */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; path = llviewermenufile.cpp; sourceTree = "<group>"; }; | ||
859 | 1A8870E60BCC5AAD00E89AA6 /* llresourcedata.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = llresourcedata.h; sourceTree = "<group>"; }; | ||
853 | 1A89230308B12D1000A04AA9 /* llurlwhitelist.cpp */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; path = llurlwhitelist.cpp; sourceTree = "<group>"; }; | 860 | 1A89230308B12D1000A04AA9 /* llurlwhitelist.cpp */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; path = llurlwhitelist.cpp; sourceTree = "<group>"; }; |
854 | 1A89230408B12D1000A04AA9 /* llurlwhitelist.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = llurlwhitelist.h; sourceTree = "<group>"; }; | 861 | 1A89230408B12D1000A04AA9 /* llurlwhitelist.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = llurlwhitelist.h; sourceTree = "<group>"; }; |
855 | 1A89230608B12D2E00A04AA9 /* llfloateropenobject.cpp */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; path = llfloateropenobject.cpp; sourceTree = "<group>"; }; | 862 | 1A89230608B12D2E00A04AA9 /* llfloateropenobject.cpp */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; path = llfloateropenobject.cpp; sourceTree = "<group>"; }; |
@@ -2334,6 +2341,8 @@ | |||
2334 | 1A83767C0BA2169600F28979 /* llviewergenericmessage.h */, | 2341 | 1A83767C0BA2169600F28979 /* llviewergenericmessage.h */, |
2335 | 1A83767D0BA2169600F28979 /* llviewergenericmessage.cpp */, | 2342 | 1A83767D0BA2169600F28979 /* llviewergenericmessage.cpp */, |
2336 | 9C18425A0B9F951500208356 /* llcaphttpsender.cpp */, | 2343 | 9C18425A0B9F951500208356 /* llcaphttpsender.cpp */, |
2344 | 1A8870E30BCC5A9500E89AA6 /* llviewermenufile.h */, | ||
2345 | 1A8870E40BCC5A9500E89AA6 /* llviewermenufile.cpp */, | ||
2337 | A3C20E4B0BB0BD12007E872B /* llviewerjoystick.cpp */, | 2346 | A3C20E4B0BB0BD12007E872B /* llviewerjoystick.cpp */, |
2338 | A3C20E490BB0BCDF007E872B /* llglslshader.cpp */, | 2347 | A3C20E490BB0BCDF007E872B /* llglslshader.cpp */, |
2339 | AAF5FFD00B13F71900D28A84 /* lltexturecache.cpp */, | 2348 | AAF5FFD00B13F71900D28A84 /* lltexturecache.cpp */, |
@@ -2863,6 +2872,8 @@ | |||
2863 | 6192217F074A9B58005E1F34 /* llinventory */ = { | 2872 | 6192217F074A9B58005E1F34 /* llinventory */ = { |
2864 | isa = PBXGroup; | 2873 | isa = PBXGroup; |
2865 | children = ( | 2874 | children = ( |
2875 | 1A8870D30BCC5A6300E89AA6 /* llinventorytype.h */, | ||
2876 | 1A8870D40BCC5A6300E89AA6 /* llinventorytype.cpp */, | ||
2866 | 913B26970B4DDCDA0030C3EC /* lllandmark.cpp */, | 2877 | 913B26970B4DDCDA0030C3EC /* lllandmark.cpp */, |
2867 | 913B26980B4DDCDA0030C3EC /* lllandmark.h */, | 2878 | 913B26980B4DDCDA0030C3EC /* lllandmark.h */, |
2868 | C1F5D0A30B138AEB00827F1D /* lluserrelations.cpp */, | 2879 | C1F5D0A30B138AEB00827F1D /* lluserrelations.cpp */, |
@@ -3499,6 +3510,7 @@ | |||
3499 | isa = PBXGroup; | 3510 | isa = PBXGroup; |
3500 | children = ( | 3511 | children = ( |
3501 | 9C1842500B9F94F200208356 /* llcaphttpsender.h */, | 3512 | 9C1842500B9F94F200208356 /* llcaphttpsender.h */, |
3513 | 1A8870E60BCC5AAD00E89AA6 /* llresourcedata.h */, | ||
3502 | A3C20E4E0BB0BD49007E872B /* llviewerjoystick.h */, | 3514 | A3C20E4E0BB0BD49007E872B /* llviewerjoystick.h */, |
3503 | A3C20E4D0BB0BD37007E872B /* llglslshader.h */, | 3515 | A3C20E4D0BB0BD37007E872B /* llglslshader.h */, |
3504 | 1AF7C1F20AF6C45000C4BF4A /* llweb.h */, | 3516 | 1AF7C1F20AF6C45000C4BF4A /* llweb.h */, |
@@ -4538,6 +4550,8 @@ | |||
4538 | 9C659A870BAB0B6E00D2EB60 /* llmessageconfig.cpp in Sources */, | 4550 | 9C659A870BAB0B6E00D2EB60 /* llmessageconfig.cpp in Sources */, |
4539 | A3C20E4A0BB0BCDF007E872B /* llglslshader.cpp in Sources */, | 4551 | A3C20E4A0BB0BCDF007E872B /* llglslshader.cpp in Sources */, |
4540 | A3C20E4C0BB0BD12007E872B /* llviewerjoystick.cpp in Sources */, | 4552 | A3C20E4C0BB0BD12007E872B /* llviewerjoystick.cpp in Sources */, |
4553 | 1A8870D50BCC5A6300E89AA6 /* llinventorytype.cpp in Sources */, | ||
4554 | 1A8870E50BCC5A9500E89AA6 /* llviewermenufile.cpp in Sources */, | ||
4541 | ); | 4555 | ); |
4542 | runOnlyForDeploymentPostprocessing = 0; | 4556 | runOnlyForDeploymentPostprocessing = 0; |
4543 | }; | 4557 | }; |
diff --git a/linden/indra/newview/newview.vcproj b/linden/indra/newview/newview.vcproj index 33c2d90..699a2bc 100644 --- a/linden/indra/newview/newview.vcproj +++ b/linden/indra/newview/newview.vcproj | |||
@@ -1121,6 +1121,9 @@ | |||
1121 | RelativePath=".\llviewermenu.cpp"> | 1121 | RelativePath=".\llviewermenu.cpp"> |
1122 | </File> | 1122 | </File> |
1123 | <File | 1123 | <File |
1124 | RelativePath=".\llviewermenufile.cpp"> | ||
1125 | </File> | ||
1126 | <File | ||
1124 | RelativePath=".\llviewermessage.cpp"> | 1127 | RelativePath=".\llviewermessage.cpp"> |
1125 | </File> | 1128 | </File> |
1126 | <File | 1129 | <File |
@@ -1942,6 +1945,9 @@ | |||
1942 | RelativePath=".\llregionposition.h"> | 1945 | RelativePath=".\llregionposition.h"> |
1943 | </File> | 1946 | </File> |
1944 | <File | 1947 | <File |
1948 | RelativePath=".\llresourcedata.h"> | ||
1949 | </File> | ||
1950 | <File | ||
1945 | RelativePath=".\llrig.h"> | 1951 | RelativePath=".\llrig.h"> |
1946 | </File> | 1952 | </File> |
1947 | <File | 1953 | <File |
@@ -2146,6 +2152,9 @@ | |||
2146 | RelativePath=".\llviewermenu.h"> | 2152 | RelativePath=".\llviewermenu.h"> |
2147 | </File> | 2153 | </File> |
2148 | <File | 2154 | <File |
2155 | RelativePath=".\llviewermenufile.h"> | ||
2156 | </File> | ||
2157 | <File | ||
2149 | RelativePath=".\llviewermessage.h"> | 2158 | RelativePath=".\llviewermessage.h"> |
2150 | </File> | 2159 | </File> |
2151 | <File | 2160 | <File |
@@ -2863,6 +2872,9 @@ | |||
2863 | </File> | 2872 | </File> |
2864 | </Filter> | 2873 | </Filter> |
2865 | <File | 2874 | <File |
2875 | RelativePath=".\files.lst"> | ||
2876 | </File> | ||
2877 | <File | ||
2866 | RelativePath=".\llviewerprecompiledheaders.cpp"> | 2878 | RelativePath=".\llviewerprecompiledheaders.cpp"> |
2867 | <FileConfiguration | 2879 | <FileConfiguration |
2868 | Name="Debug|Win32"> | 2880 | Name="Debug|Win32"> |
diff --git a/linden/indra/newview/newview_vc8.vcproj b/linden/indra/newview/newview_vc8.vcproj index e98c4ed..4cb359b 100644 --- a/linden/indra/newview/newview_vc8.vcproj +++ b/linden/indra/newview/newview_vc8.vcproj | |||
@@ -41,13 +41,12 @@ | |||
41 | <Tool | 41 | <Tool |
42 | Name="VCCLCompilerTool" | 42 | Name="VCCLCompilerTool" |
43 | Optimization="0" | 43 | Optimization="0" |
44 | AdditionalIncludeDirectories="..\llcommon;..\llmath;..\llvfs;..\llaudio;..\llmedia;..\llimage;..\llscene;..\llxml;..\llmessage;..\llprimitive;..\llrender;..\llwindow;..\llcharacter;..\llinventory;..\llui;..\lscript;"..\..\libraries\i686-win32\include";..\..\libraries\include\;"..\..\libraries\i686-win32\include\quicktime"" | 44 | AdditionalIncludeDirectories="..\llcommon;..\llmath;..\llvfs;..\llaudio;..\llmedia;..\llimage;..\llscene;..\llxml;..\llmessage;..\llprimitive;..\llrender;..\llwindow;..\llcharacter;..\llinventory;..\llui;..\lscript;"..\..\libraries\i686-win32\include";..\..\libraries\include\;"..\..\libraries\i686-win32\include\quicktime";..\llwindow\Logitech_LCD;..\llwindow\Logitech_LCD\LCDUI" |
45 | PreprocessorDefinitions="WIN32;_DEBUG;LL_WINDOWS;_CRT_SECURE_NO_DEPRECATE;_CRT_NONSTDC_NO_DEPRECATE;_USE_32BIT_TIME_T;LL_DEBUG;XP_WIN;XP_WIN32;MOZILLA_INTERNAL_API" | 45 | PreprocessorDefinitions="WIN32;_DEBUG;LL_WINDOWS;LL_DEBUG;XP_WIN;XP_WIN32;MOZILLA_INTERNAL_API" |
46 | MinimalRebuild="false" | 46 | MinimalRebuild="false" |
47 | BasicRuntimeChecks="3" | 47 | BasicRuntimeChecks="3" |
48 | RuntimeLibrary="1" | 48 | RuntimeLibrary="1" |
49 | StructMemberAlignment="4" | 49 | StructMemberAlignment="4" |
50 | TreatWChar_tAsBuiltInType="false" | ||
51 | ForceConformanceInForLoopScope="true" | 50 | ForceConformanceInForLoopScope="true" |
52 | UsePrecompiledHeader="0" | 51 | UsePrecompiledHeader="0" |
53 | PrecompiledHeaderThrough="llviewerprecompiledheaders.h" | 52 | PrecompiledHeaderThrough="llviewerprecompiledheaders.h" |
@@ -67,7 +66,7 @@ | |||
67 | /> | 66 | /> |
68 | <Tool | 67 | <Tool |
69 | Name="VCLinkerTool" | 68 | Name="VCLinkerTool" |
70 | AdditionalDependencies="advapi32.lib apr-1.lib aprutil-1.lib comdlg32.lib dinput8.lib dsound.lib dxerr8.lib dxguid.lib fmodvc.lib freetype.lib gdi32.lib glu32.lib jpeglib_6b.lib kernel32.lib libboost_regex-vc80-mt-s.lib libcurl.lib libeay32.lib libexpatMT.lib LibOpenJPEG.lib llaudio.lib llmedia.lib llcharacter.lib llcommon.lib llimage.lib llimagej2coj.lib llinventory.lib llmath.lib llmessage.lib llmozlib-vc80.lib llprimitive.lib llrender.lib llui.lib llvfs.lib llwindow.lib llxml.lib lscript_library.lib mswsock.lib netapi32.lib odbc32.lib odbccp32.lib ogg_static_mt.lib ole32.lib oleaut32.lib opengl32.lib qtmlclient.lib shell32.lib ssleay32.lib user32.lib Vfw32.lib vorbis_static_mt.lib vorbisenc_static_mt.lib vorbisfile_static_mt.lib winmm.lib winspool.lib ws2_32.lib xmlrpcepi.lib zlib.lib" | 69 | AdditionalDependencies="advapi32.lib apr-1.lib aprutil-1.lib comdlg32.lib dinput8.lib dsound.lib dxerr8.lib dxguid.lib fmodvc.lib freetype.lib gdi32.lib glu32.lib jpeglib_6b.lib kernel32.lib libboost_regex-vc71-mt-s.lib libcurl.lib libeay32.lib libexpatMT.lib LibOpenJPEG.lib llmozlib.lib mswsock.lib netapi32.lib odbc32.lib odbccp32.lib ogg_static_mt.lib ole32.lib oleaut32.lib opengl32.lib qtmlclient.lib shell32.lib ssleay32.lib user32.lib Vfw32.lib vorbis_static_mt.lib vorbisenc_static_mt.lib vorbisfile_static_mt.lib winmm.lib winspool.lib ws2_32.lib xmlrpcepi.lib zlib.lib lglcd.lib" |
71 | OutputFile="$(ConfigurationName)/debugview.exe" | 70 | OutputFile="$(ConfigurationName)/debugview.exe" |
72 | LinkIncremental="2" | 71 | LinkIncremental="2" |
73 | AdditionalLibraryDirectories=""../lib_$(ConfigurationName)/i686-win32";"../../libraries/i686-win32/lib_debug"" | 72 | AdditionalLibraryDirectories=""../lib_$(ConfigurationName)/i686-win32";"../../libraries/i686-win32/lib_debug"" |
@@ -133,7 +132,7 @@ | |||
133 | Name="VCCLCompilerTool" | 132 | Name="VCCLCompilerTool" |
134 | InlineFunctionExpansion="2" | 133 | InlineFunctionExpansion="2" |
135 | EnableIntrinsicFunctions="true" | 134 | EnableIntrinsicFunctions="true" |
136 | AdditionalIncludeDirectories="..\llcommon;..\llmath;..\llvfs;..\llaudio;..\llmedia;..\llimage;..\llscene;..\llxml;..\llmessage;..\llprimitive;..\llrender;..\llwindow;..\llcharacter;..\llinventory;..\llui;..\lscript;"..\..\libraries\i686-win32\include";..\..\libraries\include\;"..\..\libraries\i686-win32\include\quicktime"" | 135 | AdditionalIncludeDirectories="..\llcommon;..\llmath;..\llvfs;..\llaudio;..\llmedia;..\llimage;..\llscene;..\llxml;..\llmessage;..\llprimitive;..\llrender;..\llwindow;..\llcharacter;..\llinventory;..\llui;..\lscript;"..\..\libraries\i686-win32\include";..\..\libraries\include\;"..\..\libraries\i686-win32\include\quicktime";..\llwindow\Logitech_LCD;..\llwindow\Logitech_LCD\LCDUI" |
137 | PreprocessorDefinitions="WIN32;NDEBUG;_WINDOWS;LL_WINDOWS;_CRT_SECURE_NO_DEPRECATE;_CRT_NONSTDC_NO_DEPRECATE;_USE_32BIT_TIME_T;LL_RELEASE;XP_WIN;XP_WIN32;MOZILLA_INTERNAL_API" | 136 | PreprocessorDefinitions="WIN32;NDEBUG;_WINDOWS;LL_WINDOWS;_CRT_SECURE_NO_DEPRECATE;_CRT_NONSTDC_NO_DEPRECATE;_USE_32BIT_TIME_T;LL_RELEASE;XP_WIN;XP_WIN32;MOZILLA_INTERNAL_API" |
138 | StringPooling="true" | 137 | StringPooling="true" |
139 | RuntimeLibrary="0" | 138 | RuntimeLibrary="0" |
@@ -158,7 +157,7 @@ | |||
158 | /> | 157 | /> |
159 | <Tool | 158 | <Tool |
160 | Name="VCLinkerTool" | 159 | Name="VCLinkerTool" |
161 | AdditionalDependencies="advapi32.lib apr-1.lib aprutil-1.lib comdlg32.lib dinput8.lib dsound.lib dxerr8.lib dxguid.lib fmodvc.lib freetype.lib gdi32.lib glu32.lib jpeglib_6b.lib kernel32.lib libboost_regex-vc80-mt-s.lib libcurl.lib libeay32.lib libexpatMT.lib LibOpenJPEG.lib llaudio.lib llmedia.lib llcharacter.lib llcommon.lib llimage.lib llimagej2coj.lib llinventory.lib llmath.lib llmessage.lib llmozlib-vc80.lib llprimitive.lib llrender.lib llui.lib llvfs.lib llwindow.lib llxml.lib lscript_library.lib mswsock.lib netapi32.lib odbc32.lib odbccp32.lib ogg_static_mt.lib ole32.lib oleaut32.lib opengl32.lib qtmlclient.lib shell32.lib ssleay32.lib user32.lib Vfw32.lib vorbis_static_mt.lib vorbisenc_static_mt.lib vorbisfile_static_mt.lib winmm.lib winspool.lib ws2_32.lib xmlrpcepi.lib zlib.lib" | 160 | AdditionalDependencies="advapi32.lib apr-1.lib aprutil-1.lib comdlg32.lib dinput8.lib dsound.lib dxerr8.lib dxguid.lib fmodvc.lib freetype.lib gdi32.lib glu32.lib jpeglib_6b.lib kernel32.lib libboost_regex-vc80-mt-s.lib libcurl.lib libeay32.lib libexpatMT.lib LibOpenJPEG.lib llaudio.lib llmedia.lib llcharacter.lib llcommon.lib llimage.lib llimagej2coj.lib llinventory.lib llmath.lib llmessage.lib llmozlib-vc80.lib llprimitive.lib llrender.lib llui.lib llvfs.lib llwindow.lib llxml.lib lscript_library.lib mswsock.lib netapi32.lib odbc32.lib odbccp32.lib ogg_static_mt.lib ole32.lib oleaut32.lib opengl32.lib qtmlclient.lib shell32.lib ssleay32.lib user32.lib Vfw32.lib vorbis_static_mt.lib vorbisenc_static_mt.lib vorbisfile_static_mt.lib winmm.lib winspool.lib ws2_32.lib xmlrpcepi.lib zlib.lib lglcd.lib" |
162 | OutputFile="$(ConfigurationName)/newview.exe" | 161 | OutputFile="$(ConfigurationName)/newview.exe" |
163 | LinkIncremental="2" | 162 | LinkIncremental="2" |
164 | AdditionalLibraryDirectories=""../lib_$(ConfigurationName)/i686-win32";"../../libraries/i686-win32/lib_release"" | 163 | AdditionalLibraryDirectories=""../lib_$(ConfigurationName)/i686-win32";"../../libraries/i686-win32/lib_release"" |
@@ -225,12 +224,10 @@ | |||
225 | /> | 224 | /> |
226 | <Tool | 225 | <Tool |
227 | Name="VCCLCompilerTool" | 226 | Name="VCCLCompilerTool" |
228 | WholeProgramOptimization="true" | 227 | AdditionalIncludeDirectories="..\llcommon;..\llmath;..\llvfs;..\llaudio;..\llmedia;..\llimage;..\llscene;..\llxml;..\llmessage;..\llprimitive;..\llrender;..\llwindow;..\llcharacter;..\llinventory;..\llui;..\lscript;"..\..\libraries\i686-win32\include";..\..\libraries\include\;"..\..\libraries\i686-win32\include\quicktime";..\llwindow\Logitech_LCD;..\llwindow\Logitech_LCD\LCDUI" |
229 | AdditionalIncludeDirectories="..\llcommon;..\llmath;..\llvfs;..\llaudio;..\llmedia;..\llimage;..\llscene;..\llxml;..\llmessage;..\llprimitive;..\llrender;..\llwindow;..\llcharacter;..\llinventory;..\llui;..\lscript;"..\..\libraries\i686-win32\include";..\..\libraries\include\;"..\..\libraries\i686-win32\include\quicktime"" | 228 | PreprocessorDefinitions="WIN32;NDEBUG;_WINDOWS;LL_WINDOWS;LL_RELEASE;LL_RELEASE_FOR_DOWNLOAD;XP_WIN;XP_WIN32;MOZILLA_INTERNAL_API" |
230 | PreprocessorDefinitions="WIN32;NDEBUG;_WINDOWS;LL_WINDOWS;_CRT_SECURE_NO_DEPRECATE;_CRT_NONSTDC_NO_DEPRECATE;_USE_32BIT_TIME_T;LL_RELEASE;LL_RELEASE_FOR_DOWNLOAD;XP_WIN;XP_WIN32;MOZILLA_INTERNAL_API" | ||
231 | RuntimeLibrary="0" | 229 | RuntimeLibrary="0" |
232 | StructMemberAlignment="0" | 230 | StructMemberAlignment="0" |
233 | TreatWChar_tAsBuiltInType="false" | ||
234 | UsePrecompiledHeader="2" | 231 | UsePrecompiledHeader="2" |
235 | PrecompiledHeaderThrough="llviewerprecompiledheaders.h" | 232 | PrecompiledHeaderThrough="llviewerprecompiledheaders.h" |
236 | WarningLevel="3" | 233 | WarningLevel="3" |
@@ -249,7 +246,7 @@ | |||
249 | /> | 246 | /> |
250 | <Tool | 247 | <Tool |
251 | Name="VCLinkerTool" | 248 | Name="VCLinkerTool" |
252 | AdditionalDependencies="advapi32.lib apr-1.lib aprutil-1.lib comdlg32.lib dinput8.lib dsound.lib dxerr8.lib dxguid.lib fmodvc.lib freetype.lib gdi32.lib glu32.lib jpeglib_6b.lib kernel32.lib libboost_regex-vc80-mt-s.lib libcurl.lib libeay32.lib libexpatMT.lib LibOpenJPEG.lib llaudio.lib llmedia.lib llcharacter.lib llcommon.lib llimage.lib llimagej2coj.lib llinventory.lib llmath.lib llmessage.lib llmozlib-vc80.lib llprimitive.lib llrender.lib llui.lib llvfs.lib llwindow.lib llxml.lib lscript_library.lib mswsock.lib netapi32.lib odbc32.lib odbccp32.lib ogg_static_mt.lib ole32.lib oleaut32.lib opengl32.lib qtmlclient.lib shell32.lib ssleay32.lib user32.lib Vfw32.lib vorbis_static_mt.lib vorbisenc_static_mt.lib vorbisfile_static_mt.lib winmm.lib winspool.lib ws2_32.lib xmlrpcepi.lib zlib.lib" | 249 | AdditionalDependencies="advapi32.lib apr-1.lib aprutil-1.lib comdlg32.lib dinput8.lib dsound.lib dxerr8.lib dxguid.lib fmodvc.lib freetype.lib gdi32.lib glu32.lib jpeglib_6b.lib kernel32.lib libboost_regex-vc71-mt-s.lib libcurl.lib libeay32.lib libexpatMT.lib LibOpenJPEG.lib llaudio.lib llmedia.lib llcharacter.lib llcommon.lib llimage.lib llimagej2coj.lib llinventory.lib llmath.lib llmessage.lib llmozlib.lib llprimitive.lib llrender.lib llui.lib llvfs.lib llwindow.lib llxml.lib lscript_library.lib mswsock.lib netapi32.lib odbc32.lib odbccp32.lib ogg_static_mt.lib ole32.lib oleaut32.lib opengl32.lib qtmlclient.lib shell32.lib ssleay32.lib user32.lib Vfw32.lib vorbis_static_mt.lib vorbisenc_static_mt.lib vorbisfile_static_mt.lib winmm.lib winspool.lib ws2_32.lib xmlrpcepi.lib zlib.lib lglcd.lib" |
253 | OutputFile="$(ConfigurationName)/SecondLife.exe" | 250 | OutputFile="$(ConfigurationName)/SecondLife.exe" |
254 | LinkIncremental="0" | 251 | LinkIncremental="0" |
255 | AdditionalLibraryDirectories=""../lib_release/i686-win32";"../../libraries/i686-win32/lib_release"" | 252 | AdditionalLibraryDirectories=""../lib_release/i686-win32";"../../libraries/i686-win32/lib_release"" |
@@ -259,7 +256,6 @@ | |||
259 | SubSystem="2" | 256 | SubSystem="2" |
260 | OptimizeReferences="2" | 257 | OptimizeReferences="2" |
261 | EnableCOMDATFolding="2" | 258 | EnableCOMDATFolding="2" |
262 | LinkTimeCodeGeneration="1" | ||
263 | TargetMachine="1" | 259 | TargetMachine="1" |
264 | /> | 260 | /> |
265 | <Tool | 261 | <Tool |
@@ -315,15 +311,13 @@ | |||
315 | <Tool | 311 | <Tool |
316 | Name="VCCLCompilerTool" | 312 | Name="VCCLCompilerTool" |
317 | Optimization="0" | 313 | Optimization="0" |
318 | AdditionalIncludeDirectories="..\llcommon;..\llmath;..\llvfs;..\llaudio;..\llmedia;..\llimage;..\llscene;..\llxml;..\llmessage;..\llprimitive;..\llrender;..\llwindow;..\llcharacter;..\llinventory;..\llui;..\lscript;"..\..\libraries\i686-win32\include";..\..\libraries\include\;"..\..\libraries\i686-win32\include\quicktime"" | 314 | AdditionalIncludeDirectories="..\llcommon;..\llmath;..\llvfs;..\llaudio;..\llmedia;..\llimage;..\llscene;..\llxml;..\llmessage;..\llprimitive;..\llrender;..\llwindow;..\llcharacter;..\llinventory;..\llui;..\lscript;"..\..\libraries\i686-win32\include";..\..\libraries\include\;"..\..\libraries\i686-win32\include\quicktime";..\llwindow\Logitech_LCD;..\llwindow\Logitech_LCD\LCDUI" |
319 | PreprocessorDefinitions="WIN32;NDEBUG;_WINDOWS;LL_WINDOWS;_CRT_SECURE_NO_DEPRECATE;_CRT_NONSTDC_NO_DEPRECATE;_USE_32BIT_TIME_T;LL_RELEASE;XP_WIN;XP_WIN32;MOZILLA_INTERNAL_API" | 315 | PreprocessorDefinitions="WIN32;NDEBUG;_WINDOWS;LL_WINDOWS;LL_RELEASE;XP_WIN;XP_WIN32;MOZILLA_INTERNAL_API" |
320 | RuntimeLibrary="0" | 316 | RuntimeLibrary="0" |
321 | StructMemberAlignment="0" | 317 | StructMemberAlignment="0" |
322 | TreatWChar_tAsBuiltInType="false" | ||
323 | ForceConformanceInForLoopScope="true" | 318 | ForceConformanceInForLoopScope="true" |
324 | UsePrecompiledHeader="2" | 319 | UsePrecompiledHeader="2" |
325 | PrecompiledHeaderThrough="llviewerprecompiledheaders.h" | 320 | PrecompiledHeaderThrough="llviewerprecompiledheaders.h" |
326 | BrowseInformation="1" | ||
327 | WarningLevel="3" | 321 | WarningLevel="3" |
328 | WarnAsError="true" | 322 | WarnAsError="true" |
329 | Detect64BitPortabilityProblems="false" | 323 | Detect64BitPortabilityProblems="false" |
@@ -340,7 +334,7 @@ | |||
340 | /> | 334 | /> |
341 | <Tool | 335 | <Tool |
342 | Name="VCLinkerTool" | 336 | Name="VCLinkerTool" |
343 | AdditionalDependencies="advapi32.lib apr-1.lib aprutil-1.lib comdlg32.lib dinput8.lib dsound.lib dxerr8.lib dxguid.lib fmodvc.lib freetype.lib gdi32.lib glu32.lib jpeglib_6b.lib kernel32.lib libboost_regex-vc80-mt-s.lib libcurl.lib libeay32.lib libexpatMT.lib LibOpenJPEG.lib llaudio.lib llmedia.lib llcharacter.lib llcommon.lib llimage.lib llimagej2coj.lib llinventory.lib llmath.lib llmessage.lib llmozlib-vc80.lib llprimitive.lib llrender.lib llui.lib llvfs.lib llwindow.lib llxml.lib lscript_library.lib mswsock.lib netapi32.lib odbc32.lib odbccp32.lib ogg_static_mt.lib ole32.lib oleaut32.lib opengl32.lib qtmlclient.lib shell32.lib ssleay32.lib user32.lib Vfw32.lib vorbis_static_mt.lib vorbisenc_static_mt.lib vorbisfile_static_mt.lib winmm.lib winspool.lib ws2_32.lib xmlrpcepi.lib zlib.lib" | 337 | AdditionalDependencies="advapi32.lib apr-1.lib aprutil-1.lib comdlg32.lib dinput8.lib dsound.lib dxerr8.lib dxguid.lib fmodvc.lib freetype.lib gdi32.lib glu32.lib jpeglib_6b.lib kernel32.lib libboost_regex-vc71-mt-s.lib libcurl.lib libeay32.lib libexpatMT.lib LibOpenJPEG.lib llmozlib.lib mswsock.lib netapi32.lib odbc32.lib odbccp32.lib ogg_static_mt.lib ole32.lib oleaut32.lib opengl32.lib qtmlclient.lib shell32.lib ssleay32.lib user32.lib Vfw32.lib vorbis_static_mt.lib vorbisenc_static_mt.lib vorbisfile_static_mt.lib winmm.lib winspool.lib ws2_32.lib xmlrpcepi.lib zlib.lib lglcd.lib" |
344 | OutputFile="$(ConfigurationName)/newview_noopt.exe" | 338 | OutputFile="$(ConfigurationName)/newview_noopt.exe" |
345 | LinkIncremental="2" | 339 | LinkIncremental="2" |
346 | AdditionalLibraryDirectories=""../lib_releasenoopt/i686-win32";"../../libraries/i686-win32/lib_release"" | 340 | AdditionalLibraryDirectories=""../lib_releasenoopt/i686-win32";"../../libraries/i686-win32/lib_release"" |
@@ -979,6 +973,10 @@ | |||
979 | > | 973 | > |
980 | </File> | 974 | </File> |
981 | <File | 975 | <File |
976 | RelativePath=".\lllcd.cpp" | ||
977 | > | ||
978 | </File> | ||
979 | <File | ||
982 | RelativePath=".\lllocalanimationobject.cpp" | 980 | RelativePath=".\lllocalanimationobject.cpp" |
983 | > | 981 | > |
984 | </File> | 982 | </File> |
@@ -1175,6 +1173,10 @@ | |||
1175 | > | 1173 | > |
1176 | </File> | 1174 | </File> |
1177 | <File | 1175 | <File |
1176 | RelativePath=".\llpanelLCD.cpp" | ||
1177 | > | ||
1178 | </File> | ||
1179 | <File | ||
1178 | RelativePath=".\llpanellogin.cpp" | 1180 | RelativePath=".\llpanellogin.cpp" |
1179 | > | 1181 | > |
1180 | </File> | 1182 | </File> |
@@ -1753,10 +1755,6 @@ | |||
1753 | > | 1755 | > |
1754 | </File> | 1756 | </File> |
1755 | <File | 1757 | <File |
1756 | RelativePath=".\llagparray.h" | ||
1757 | > | ||
1758 | </File> | ||
1759 | <File | ||
1760 | RelativePath=".\llanimalcontrols.h" | 1758 | RelativePath=".\llanimalcontrols.h" |
1761 | > | 1759 | > |
1762 | </File> | 1760 | </File> |
@@ -1893,18 +1891,10 @@ | |||
1893 | > | 1891 | > |
1894 | </File> | 1892 | </File> |
1895 | <File | 1893 | <File |
1896 | RelativePath=".\lldrawpoolclouds.h" | ||
1897 | > | ||
1898 | </File> | ||
1899 | <File | ||
1900 | RelativePath=".\lldrawpoolground.h" | 1894 | RelativePath=".\lldrawpoolground.h" |
1901 | > | 1895 | > |
1902 | </File> | 1896 | </File> |
1903 | <File | 1897 | <File |
1904 | RelativePath=".\lldrawpoolhud.h" | ||
1905 | > | ||
1906 | </File> | ||
1907 | <File | ||
1908 | RelativePath=".\lldrawpoolsimple.h" | 1898 | RelativePath=".\lldrawpoolsimple.h" |
1909 | > | 1899 | > |
1910 | </File> | 1900 | </File> |
@@ -1925,10 +1915,6 @@ | |||
1925 | > | 1915 | > |
1926 | </File> | 1916 | </File> |
1927 | <File | 1917 | <File |
1928 | RelativePath=".\lldrawpooltreenew.h" | ||
1929 | > | ||
1930 | </File> | ||
1931 | <File | ||
1932 | RelativePath=".\lldrawpoolwater.h" | 1918 | RelativePath=".\lldrawpoolwater.h" |
1933 | > | 1919 | > |
1934 | </File> | 1920 | </File> |
@@ -2337,6 +2323,10 @@ | |||
2337 | > | 2323 | > |
2338 | </File> | 2324 | </File> |
2339 | <File | 2325 | <File |
2326 | RelativePath=".\lllcd.h" | ||
2327 | > | ||
2328 | </File> | ||
2329 | <File | ||
2340 | RelativePath=".\lllightconstants.h" | 2330 | RelativePath=".\lllightconstants.h" |
2341 | > | 2331 | > |
2342 | </File> | 2332 | </File> |
@@ -2537,6 +2527,10 @@ | |||
2537 | > | 2527 | > |
2538 | </File> | 2528 | </File> |
2539 | <File | 2529 | <File |
2530 | RelativePath=".\llpanelLCD.h" | ||
2531 | > | ||
2532 | </File> | ||
2533 | <File | ||
2540 | RelativePath=".\llpanellogin.h" | 2534 | RelativePath=".\llpanellogin.h" |
2541 | > | 2535 | > |
2542 | </File> | 2536 | </File> |
@@ -3041,10 +3035,6 @@ | |||
3041 | > | 3035 | > |
3042 | </File> | 3036 | </File> |
3043 | <File | 3037 | <File |
3044 | RelativePath=".\llvotreenew.h" | ||
3045 | > | ||
3046 | </File> | ||
3047 | <File | ||
3048 | RelativePath=".\llvovolume.h" | 3038 | RelativePath=".\llvovolume.h" |
3049 | > | 3039 | > |
3050 | </File> | 3040 | </File> |
@@ -3487,6 +3477,10 @@ | |||
3487 | > | 3477 | > |
3488 | </File> | 3478 | </File> |
3489 | <File | 3479 | <File |
3480 | RelativePath=".\res\icon1.ico" | ||
3481 | > | ||
3482 | </File> | ||
3483 | <File | ||
3490 | RelativePath=".\Info-SecondLife.plist" | 3484 | RelativePath=".\Info-SecondLife.plist" |
3491 | > | 3485 | > |
3492 | </File> | 3486 | </File> |
@@ -3507,6 +3501,10 @@ | |||
3507 | > | 3501 | > |
3508 | </File> | 3502 | </File> |
3509 | <File | 3503 | <File |
3504 | RelativePath=".\skins\xui\en-us\LCD_text.xml" | ||
3505 | > | ||
3506 | </File> | ||
3507 | <File | ||
3510 | RelativePath=".\res\ll_icon.ico" | 3508 | RelativePath=".\res\ll_icon.ico" |
3511 | > | 3509 | > |
3512 | </File> | 3510 | </File> |
@@ -3751,6 +3749,10 @@ | |||
3751 | > | 3749 | > |
3752 | </File> | 3750 | </File> |
3753 | <File | 3751 | <File |
3752 | RelativePath=".\skins\xui\en-us\panel_preferences_LCD.xml" | ||
3753 | > | ||
3754 | </File> | ||
3755 | <File | ||
3754 | RelativePath=".\skins\xui\en-us\panel_preferences_network.xml" | 3756 | RelativePath=".\skins\xui\en-us\panel_preferences_network.xml" |
3755 | > | 3757 | > |
3756 | </File> | 3758 | </File> |
diff --git a/linden/indra/newview/pipeline.cpp b/linden/indra/newview/pipeline.cpp index 5d4618e..d030ac2 100644 --- a/linden/indra/newview/pipeline.cpp +++ b/linden/indra/newview/pipeline.cpp | |||
@@ -768,6 +768,7 @@ void LLPipeline::updateMoveDampedAsync(LLDrawable* drawablep) | |||
768 | if (!drawablep) | 768 | if (!drawablep) |
769 | { | 769 | { |
770 | llerrs << "updateMove called with NULL drawablep" << llendl; | 770 | llerrs << "updateMove called with NULL drawablep" << llendl; |
771 | return; | ||
771 | } | 772 | } |
772 | if (drawablep->isState(LLDrawable::EARLY_MOVE)) | 773 | if (drawablep->isState(LLDrawable::EARLY_MOVE)) |
773 | { | 774 | { |
@@ -1124,7 +1125,7 @@ void LLPipeline::updateGeom(F32 max_dtime) | |||
1124 | last_bridge = bridge; | 1125 | last_bridge = bridge; |
1125 | 1126 | ||
1126 | BOOL update_complete = TRUE; | 1127 | BOOL update_complete = TRUE; |
1127 | if (drawablep && !drawablep->isDead()) | 1128 | if (!drawablep->isDead()) |
1128 | { | 1129 | { |
1129 | update_complete = updateDrawableGeom(drawablep, FALSE); | 1130 | update_complete = updateDrawableGeom(drawablep, FALSE); |
1130 | count++; | 1131 | count++; |
@@ -1398,7 +1399,9 @@ void LLPipeline::stateSort(LLDrawable* drawablep, LLCamera& camera) | |||
1398 | LLMemType mt(LLMemType::MTYPE_PIPELINE); | 1399 | LLMemType mt(LLMemType::MTYPE_PIPELINE); |
1399 | LLFastTimer ftm(LLFastTimer::FTM_STATESORT_DRAWABLE); | 1400 | LLFastTimer ftm(LLFastTimer::FTM_STATESORT_DRAWABLE); |
1400 | 1401 | ||
1401 | if (drawablep->isDead() || !hasRenderType(drawablep->getRenderType())) | 1402 | if (!drawablep |
1403 | || drawablep->isDead() | ||
1404 | || !hasRenderType(drawablep->getRenderType())) | ||
1402 | { | 1405 | { |
1403 | return; | 1406 | return; |
1404 | } | 1407 | } |
@@ -1412,7 +1415,7 @@ void LLPipeline::stateSort(LLDrawable* drawablep, LLCamera& camera) | |||
1412 | } | 1415 | } |
1413 | } | 1416 | } |
1414 | 1417 | ||
1415 | if (drawablep && (hasRenderType(drawablep->mRenderType))) | 1418 | if (hasRenderType(drawablep->mRenderType)) |
1416 | { | 1419 | { |
1417 | if (!drawablep->isState(LLDrawable::INVISIBLE|LLDrawable::FORCE_INVISIBLE)) | 1420 | if (!drawablep->isState(LLDrawable::INVISIBLE|LLDrawable::FORCE_INVISIBLE)) |
1418 | { | 1421 | { |
@@ -1835,6 +1838,7 @@ void LLPipeline::renderHighlights() | |||
1835 | if (!facep || facep->getDrawable()->isDead()) | 1838 | if (!facep || facep->getDrawable()->isDead()) |
1836 | { | 1839 | { |
1837 | llerrs << "Bad face on selection" << llendl; | 1840 | llerrs << "Bad face on selection" << llendl; |
1841 | return; | ||
1838 | } | 1842 | } |
1839 | 1843 | ||
1840 | facep->renderSelected(mFaceSelectImagep, color); | 1844 | facep->renderSelected(mFaceSelectImagep, color); |
@@ -4045,4 +4049,4 @@ void LLPipeline::renderBloom(GLuint source, GLuint dest, GLuint buffer, U32 res, | |||
4045 | glPopMatrix(); | 4049 | glPopMatrix(); |
4046 | glMatrixMode(GL_MODELVIEW); | 4050 | glMatrixMode(GL_MODELVIEW); |
4047 | glPopMatrix(); | 4051 | glPopMatrix(); |
4048 | } \ No newline at end of file | 4052 | } |
diff --git a/linden/indra/newview/releasenotes.txt b/linden/indra/newview/releasenotes.txt index 2fc26c7..c6c57f0 100644 --- a/linden/indra/newview/releasenotes.txt +++ b/linden/indra/newview/releasenotes.txt | |||
@@ -1,6 +1,54 @@ | |||
1 | Release Notes for Second Life 1.15.1(3) May 14, 2007 | ||
2 | ===================================== | ||
3 | Changes: | ||
4 | * Soft shadow for text is now an option available via the text style flag | ||
5 | * Expanded Tools->Report Bug to include additional information and links | ||
6 | * Alt-Left and Alt-Right switch between tabs in IM | ||
7 | * Ctrl-W closes one tab in IM window (Ctrl-T closes IM window) | ||
8 | * Ctrl-Shift-W closes all windows | ||
9 | * Inventory system folders may be sorted to top | ||
10 | * Busy mode declines notecards and textures and silently sends all other transfers to Inventory | ||
11 | * L$ balance displays "Loading..." (instead of a blank) when first checking your balance | ||
12 | * Minimap is enabled when Second Life runs for the first time | ||
13 | * Texture transfers are limited to 5 items per 10 seconds | ||
14 | |||
15 | Bug fixes: | ||
16 | * Fixed windows maximizing when opening other windows | ||
17 | * Fixed floating text inworld (original hard shadow restored) | ||
18 | * Fixed LSL Help window restoring when clicking on script editor | ||
19 | * Fixed LSL Wiki Help window forgetting its size | ||
20 | * Fixed Ctrl-W closing the floater instead of one IM panel | ||
21 | * Fixed a client crash when deleting an object from inventory | ||
22 | * Fixed avatar eyeball shader | ||
23 | * Fixed closing an inventory folder while selection is inside moves selection to 'My Inventory' | ||
24 | * Fixed nametag text leaving background box while moving | ||
25 | * Fixed graphics cards with unlisted memory sizes defaulting to 16MB | ||
26 | * Fixed right-clicking on self failing if you are wearing a HUD | ||
27 | * Fixed llSetText appearance on HUD attachments | ||
28 | * Fixed Alt-WASD behavior when sitting | ||
29 | * Fixed first digit in Pay dialog cannot be erased | ||
30 | * Fixed reference ruler measuring to region edge instead of reference object | ||
31 | * Fixed permissions on group-owned object's script when group member clicks New Script | ||
32 | * Improved detection of Linux video memory | ||
33 | * VWR-38: Magic Opening Folders | ||
34 | * VWR-42: llSetSoundQueueing() is broken | ||
35 | * VWR-71: Tabulating and moving by word (Ctrl-left, ctrl-right) off-by-one errors in scripting editor. | ||
36 | * VWR-136: Seg fault in llpolymorph.cpp | ||
37 | * VWR-148: llListStatistics tooltip wrong | ||
38 | * VWR-154: typo in en-US/floater_mute.xml 'Resident' not 'resident' | ||
39 | * VWR-155: typo in en-US/floater_mute.xml 'Resident' not 'Person' | ||
40 | * VWR-165: First Digit in the 'Pay' dialog does not erase without entering more digits | ||
41 | * VWR-166: moving of open folders in the inventory to an other indentation level leaves the contents on the previous level | ||
42 | * VWR-192: textures in windows only stretches horizontally | ||
43 | * VWR-326: Allow a 'limit texture recieving' in the client | ||
44 | * VWR-346: Selecting Client>Character>Flush Animations immediately crashes 1.14.0.x | ||
45 | * VWR-379: Fix shell scripts to use bash and not sh when appropriate. | ||
46 | * VWR-414: 8-bit character in llagent.cpp comment confuses Japanese text editors | ||
47 | * VWR-415: Definitions of WM_MOUSEWHEEL and WHEEL_DELTA need conditionals (on Windows) | ||
48 | * VWR-429: add scons option making FMOD optional | ||
49 | |||
1 | Release Notes for Second Life 1.15.0(2) April 25, 2007 | 50 | Release Notes for Second Life 1.15.0(2) April 25, 2007 |
2 | ===================================== | 51 | ===================================== |
3 | |||
4 | Changes: | 52 | Changes: |
5 | * Improved Help menu with links to additional resources | 53 | * Improved Help menu with links to additional resources |
6 | * 'Add as Friend' button added to Profile | 54 | * 'Add as Friend' button added to Profile |
diff --git a/linden/indra/newview/res/newViewRes.rc b/linden/indra/newview/res/newViewRes.rc index e544a39..e9ac143 100644 --- a/linden/indra/newview/res/newViewRes.rc +++ b/linden/indra/newview/res/newViewRes.rc | |||
@@ -227,8 +227,8 @@ TOOLPIPETTE CURSOR "toolpipette.cur" | |||
227 | // | 227 | // |
228 | 228 | ||
229 | VS_VERSION_INFO VERSIONINFO | 229 | VS_VERSION_INFO VERSIONINFO |
230 | FILEVERSION 1,15,0,2 | 230 | FILEVERSION 1,15,1,3 |
231 | PRODUCTVERSION 1,15,0,2 | 231 | PRODUCTVERSION 1,15,1,3 |
232 | FILEFLAGSMASK 0x3fL | 232 | FILEFLAGSMASK 0x3fL |
233 | #ifdef _DEBUG | 233 | #ifdef _DEBUG |
234 | FILEFLAGS 0x1L | 234 | FILEFLAGS 0x1L |
@@ -245,12 +245,12 @@ BEGIN | |||
245 | BEGIN | 245 | BEGIN |
246 | VALUE "CompanyName", "Linden Lab" | 246 | VALUE "CompanyName", "Linden Lab" |
247 | VALUE "FileDescription", "Second Life" | 247 | VALUE "FileDescription", "Second Life" |
248 | VALUE "FileVersion", "1.15.0.2" | 248 | VALUE "FileVersion", "1.15.1.3" |
249 | VALUE "InternalName", "Second Life" | 249 | VALUE "InternalName", "Second Life" |
250 | VALUE "LegalCopyright", "Copyright © 2001-2007, Linden Research, Inc." | 250 | VALUE "LegalCopyright", "Copyright © 2001-2007, Linden Research, Inc." |
251 | VALUE "OriginalFilename", "SecondLife.exe" | 251 | VALUE "OriginalFilename", "SecondLife.exe" |
252 | VALUE "ProductName", "Second Life" | 252 | VALUE "ProductName", "Second Life" |
253 | VALUE "ProductVersion", "1.15.0.2" | 253 | VALUE "ProductVersion", "1.15.1.3" |
254 | END | 254 | END |
255 | END | 255 | END |
256 | BLOCK "VarFileInfo" | 256 | BLOCK "VarFileInfo" |
diff --git a/linden/indra/newview/secondlife setup build uma.bat b/linden/indra/newview/secondlife setup build uma.bat index 72c27fb..ad2d849 100644 --- a/linden/indra/newview/secondlife setup build uma.bat +++ b/linden/indra/newview/secondlife setup build uma.bat | |||
@@ -1,4 +1,4 @@ | |||
1 | @rem Invoke the script which preps then runs the installer. | 1 | @rem Invoke the script which preps then runs the installer. |
2 | @rem This batch file is customized per grid. | 2 | @rem This batch file is customized per grid. |
3 | 3 | ||
4 | @"secondlife setup build.bat" --grid=uma | 4 | @"secondlife setup build.bat" --grid=uma |
diff --git a/linden/indra/newview/secondlife setup build vaak.bat b/linden/indra/newview/secondlife setup build vaak.bat index 2036c33..f957918 100644 --- a/linden/indra/newview/secondlife setup build vaak.bat +++ b/linden/indra/newview/secondlife setup build vaak.bat | |||
@@ -1,4 +1,4 @@ | |||
1 | @rem Invoke the script which preps then runs the installer. | 1 | @rem Invoke the script which preps then runs the installer. |
2 | @rem This batch file is customized per grid. | 2 | @rem This batch file is customized per grid. |
3 | 3 | ||
4 | @"secondlife setup build.bat" --grid=vaak | 4 | @"secondlife setup build.bat" --grid=vaak |
diff --git a/linden/indra/newview/secondlife setup build yami.bat b/linden/indra/newview/secondlife setup build yami.bat index ffc8568..4f88805 100644 --- a/linden/indra/newview/secondlife setup build yami.bat +++ b/linden/indra/newview/secondlife setup build yami.bat | |||
@@ -1,4 +1,4 @@ | |||
1 | @rem Invoke the script which preps then runs the installer. | 1 | @rem Invoke the script which preps then runs the installer. |
2 | @rem This batch file is customized per grid. | 2 | @rem This batch file is customized per grid. |
3 | 3 | ||
4 | @"secondlife setup build.bat" --grid=yami | 4 | @"secondlife setup build.bat" --grid=yami |
diff --git a/linden/indra/newview/skins/xui/en-us/alerts.xml b/linden/indra/newview/skins/xui/en-us/alerts.xml index 265fca8..a783d00 100644 --- a/linden/indra/newview/skins/xui/en-us/alerts.xml +++ b/linden/indra/newview/skins/xui/en-us/alerts.xml | |||
@@ -11,7 +11,7 @@ | |||
11 | <alert modal="true" name="FloaterNotFound"> | 11 | <alert modal="true" name="FloaterNotFound"> |
12 | <message name="message"> | 12 | <message name="message"> |
13 | Floater error: Could not find the following controls: | 13 | Floater error: Could not find the following controls: |
14 | 14 | ||
15 | [CONTROLS] | 15 | [CONTROLS] |
16 | </message> | 16 | </message> |
17 | <option name="OK"> | 17 | <option name="OK"> |
@@ -126,7 +126,7 @@ Enter a brief description of the group's purpose. | |||
126 | <alert modal="true" name="CharacterSnapshotSaved"> | 126 | <alert modal="true" name="CharacterSnapshotSaved"> |
127 | <message name="message"> | 127 | <message name="message"> |
128 | A snapshot of your character has been saved. | 128 | A snapshot of your character has been saved. |
129 | 129 | ||
130 | Visit the Webpage Studio exhibit to see it. | 130 | Visit the Webpage Studio exhibit to see it. |
131 | </message> | 131 | </message> |
132 | </alert> | 132 | </alert> |
@@ -146,8 +146,8 @@ Visit the Webpage Studio exhibit to see it. | |||
146 | </alert> | 146 | </alert> |
147 | <alert modal="true" name="GrantModifyRights"> | 147 | <alert modal="true" name="GrantModifyRights"> |
148 | <message name="message"> | 148 | <message name="message"> |
149 | Granting modify rights to another resident allows them to change | 149 | Granting modify rights to another resident allows them to change |
150 | ANY objects you may have in-world. Be VERY careful when handing | 150 | ANY objects you may have in-world. Be VERY careful when handing |
151 | out this permission. | 151 | out this permission. |
152 | Do you want to grant modify rights for [FIRST_NAME] [LAST_NAME]? | 152 | Do you want to grant modify rights for [FIRST_NAME] [LAST_NAME]? |
153 | </message> | 153 | </message> |
@@ -212,10 +212,10 @@ Do you want to grant modify rights for [FIRST_NAME] [LAST_NAME]? | |||
212 | <alert modal="true" name="CreateGroupCanAfford"> | 212 | <alert modal="true" name="CreateGroupCanAfford"> |
213 | <message name="message"> | 213 | <message name="message"> |
214 | Creating a group costs L$[COST]. | 214 | Creating a group costs L$[COST]. |
215 | 215 | ||
216 | To maintain the group for more than three days, | 216 | To maintain the group for more than three days, |
217 | you must reach a total of three or more members. | 217 | you must reach a total of three or more members. |
218 | 218 | ||
219 | Create group? | 219 | Create group? |
220 | </message> | 220 | </message> |
221 | <option name="Create"> | 221 | <option name="Create"> |
@@ -275,16 +275,16 @@ Are you sure you want to continue? | |||
275 | </alert> | 275 | </alert> |
276 | <alert modal="true" name="AssignDangerousActionWarning"> | 276 | <alert modal="true" name="AssignDangerousActionWarning"> |
277 | <message name="message"> | 277 | <message name="message"> |
278 | You are about to add the Ability '[ACTION_NAME]' to the | 278 | You are about to add the Ability '[ACTION_NAME]' to the |
279 | Role '[ROLE_NAME]'. | 279 | Role '[ROLE_NAME]'. |
280 | 280 | ||
281 | *WARNING* | 281 | *WARNING* |
282 | Any Member in a Role with this Ability can assign themselves-- | 282 | Any Member in a Role with this Ability can assign themselves-- |
283 | and any other member--to Roles that have more powers than they | 283 | and any other member--to Roles that have more powers than they |
284 | currently have, potentially elevating themselves to | 284 | currently have, potentially elevating themselves to |
285 | near-Owner power. Be sure you know what you're doing before | 285 | near-Owner power. Be sure you know what you're doing before |
286 | assigning this Ability. | 286 | assigning this Ability. |
287 | 287 | ||
288 | Add this Ability to '[ROLE_NAME]'? | 288 | Add this Ability to '[ROLE_NAME]'? |
289 | </message> | 289 | </message> |
290 | <option name="Yes"> | 290 | <option name="Yes"> |
@@ -296,14 +296,14 @@ Add this Ability to '[ROLE_NAME]'? | |||
296 | </alert> | 296 | </alert> |
297 | <alert modal="true" name="AssignDangerousAbilityWarning"> | 297 | <alert modal="true" name="AssignDangerousAbilityWarning"> |
298 | <message name="message"> | 298 | <message name="message"> |
299 | You are about to add the Ability '[ACTION_NAME]' to the | 299 | You are about to add the Ability '[ACTION_NAME]' to the |
300 | Role '[ROLE_NAME]'. | 300 | Role '[ROLE_NAME]'. |
301 | 301 | ||
302 | *WARNING* | 302 | *WARNING* |
303 | Any Member in a Role with this Ability can assign themselves-- | 303 | Any Member in a Role with this Ability can assign themselves-- |
304 | and any other member--all Abilities, elevating themselves | 304 | and any other member--all Abilities, elevating themselves |
305 | to near-Owner power. | 305 | to near-Owner power. |
306 | 306 | ||
307 | Add this Ability to '[ROLE_NAME]'? | 307 | Add this Ability to '[ROLE_NAME]'? |
308 | </message> | 308 | </message> |
309 | <option name="Yes"> | 309 | <option name="Yes"> |
@@ -364,7 +364,7 @@ Go to the Second Life web site for more information on partnering? | |||
364 | If this resident has a web profile URL set then you can: | 364 | If this resident has a web profile URL set then you can: |
365 | * Click Load to load the page with the embedded web browser. | 365 | * Click Load to load the page with the embedded web browser. |
366 | * Click Open to view externally in your default web browser. | 366 | * Click Open to view externally in your default web browser. |
367 | 367 | ||
368 | When viewing your profile you can enter any URL as your Web Profile. | 368 | When viewing your profile you can enter any URL as your Web Profile. |
369 | Residents can visit the URL you specify when they view your profile. | 369 | Residents can visit the URL you specify when they view your profile. |
370 | </message> | 370 | </message> |
@@ -373,7 +373,7 @@ Residents can visit the URL you specify when they view your profile. | |||
373 | <message name="message"> | 373 | <message name="message"> |
374 | If this resident has a web profile URL set then you can: | 374 | If this resident has a web profile URL set then you can: |
375 | * Click Open to view externally in your default web browser. | 375 | * Click Open to view externally in your default web browser. |
376 | 376 | ||
377 | When viewing your profile you can enter any URL as your Web Profile. | 377 | When viewing your profile you can enter any URL as your Web Profile. |
378 | Residents can visit the URL you specify when they view your profile. | 378 | Residents can visit the URL you specify when they view your profile. |
379 | </message> | 379 | </message> |
@@ -478,7 +478,7 @@ Please select an individual to sell to if selling for L$0. | |||
478 | <message name="message"> | 478 | <message name="message"> |
479 | The selected [LAND_SIZE] sq. m. land is being set for sale. | 479 | The selected [LAND_SIZE] sq. m. land is being set for sale. |
480 | Your selling price will be L$[SALE_PRICE] and will be authorized for sale to [NAME]. | 480 | Your selling price will be L$[SALE_PRICE] and will be authorized for sale to [NAME]. |
481 | 481 | ||
482 | Would you like to continue making this change? | 482 | Would you like to continue making this change? |
483 | </message> | 483 | </message> |
484 | <option name="Continue"> | 484 | <option name="Continue"> |
@@ -493,10 +493,10 @@ Would you like to continue making this change? | |||
493 | Are you sure you want to return all objects shared with | 493 | Are you sure you want to return all objects shared with |
494 | the group '[NAME]' on this parcel of land | 494 | the group '[NAME]' on this parcel of land |
495 | back to their previous owner's inventory? | 495 | back to their previous owner's inventory? |
496 | 496 | ||
497 | *WARNING* This will delete the non-transferable objects | 497 | *WARNING* This will delete the non-transferable objects |
498 | deeded to the group! | 498 | deeded to the group! |
499 | 499 | ||
500 | Objects: [N] | 500 | Objects: [N] |
501 | </message> | 501 | </message> |
502 | <option name="Return"> | 502 | <option name="Return"> |
@@ -511,7 +511,7 @@ Objects: [N] | |||
511 | Are you sure you want to return all objects owned by the | 511 | Are you sure you want to return all objects owned by the |
512 | resident '[NAME]' on this parcel of land | 512 | resident '[NAME]' on this parcel of land |
513 | back to their inventory? | 513 | back to their inventory? |
514 | 514 | ||
515 | Objects: [N] | 515 | Objects: [N] |
516 | </message> | 516 | </message> |
517 | <option name="Return"> | 517 | <option name="Return"> |
@@ -526,7 +526,7 @@ Objects: [N] | |||
526 | Are you sure you want to return all objects | 526 | Are you sure you want to return all objects |
527 | owned by you on this parcel of land back to | 527 | owned by you on this parcel of land back to |
528 | your inventory? | 528 | your inventory? |
529 | 529 | ||
530 | Objects: [N] | 530 | Objects: [N] |
531 | </message> | 531 | </message> |
532 | <option name="Return"> | 532 | <option name="Return"> |
@@ -542,10 +542,10 @@ Objects: [N] | |||
542 | by you on this parcel of land back to their owner's inventory? | 542 | by you on this parcel of land back to their owner's inventory? |
543 | Transferable objects deeded to a group will be | 543 | Transferable objects deeded to a group will be |
544 | returned to their previous owners. | 544 | returned to their previous owners. |
545 | 545 | ||
546 | *WARNING* This will delete the non-transferable objects | 546 | *WARNING* This will delete the non-transferable objects |
547 | deeded to the group! | 547 | deeded to the group! |
548 | 548 | ||
549 | Objects: [N] | 549 | Objects: [N] |
550 | </message> | 550 | </message> |
551 | <option name="Return"> | 551 | <option name="Return"> |
@@ -561,10 +561,10 @@ Objects: [N] | |||
561 | by [NAME] on this parcel of land back to their owner's inventory? | 561 | by [NAME] on this parcel of land back to their owner's inventory? |
562 | Transferable objects deeded to a group will be | 562 | Transferable objects deeded to a group will be |
563 | returned to their previous owners. | 563 | returned to their previous owners. |
564 | 564 | ||
565 | *WARNING* This will delete the non-transferable objects | 565 | *WARNING* This will delete the non-transferable objects |
566 | deeded to the group! | 566 | deeded to the group! |
567 | 567 | ||
568 | Objects: [N] | 568 | Objects: [N] |
569 | </message> | 569 | </message> |
570 | <option name="Return"> | 570 | <option name="Return"> |
@@ -602,7 +602,7 @@ in this region back to their owner's inventory? | |||
602 | Return the objects on this parcel of land | 602 | Return the objects on this parcel of land |
603 | that are NOT shared with the group [NAME] | 603 | that are NOT shared with the group [NAME] |
604 | back to their owners? | 604 | back to their owners? |
605 | 605 | ||
606 | Objects: [N] | 606 | Objects: [N] |
607 | </message> | 607 | </message> |
608 | <option name="Return"> | 608 | <option name="Return"> |
@@ -690,7 +690,7 @@ The outfit folder contains no clothing, body parts, or attachments. | |||
690 | <alert modal="true" name="MustHaveAccountToLogIn"> | 690 | <alert modal="true" name="MustHaveAccountToLogIn"> |
691 | <message name="message"> | 691 | <message name="message"> |
692 | You must have an account to connect to [SECOND_LIFE]. | 692 | You must have an account to connect to [SECOND_LIFE]. |
693 | 693 | ||
694 | Go to www.secondlife.com to create a new account? | 694 | Go to www.secondlife.com to create a new account? |
695 | </message> | 695 | </message> |
696 | <option name="OK"> | 696 | <option name="OK"> |
@@ -704,10 +704,10 @@ Go to www.secondlife.com to create a new account? | |||
704 | <message name="message"> | 704 | <message name="message"> |
705 | Classified ads appear in the 'Classified' section of the | 705 | Classified ads appear in the 'Classified' section of the |
706 | Search directory for one week. | 706 | Search directory for one week. |
707 | 707 | ||
708 | Fill out your ad, then click 'Publish...' to add it to the | 708 | Fill out your ad, then click 'Publish...' to add it to the |
709 | directory. | 709 | directory. |
710 | 710 | ||
711 | You'll be asked for a price to pay when clicking Publish. | 711 | You'll be asked for a price to pay when clicking Publish. |
712 | Paying more makes your ad appear higher in the list, and | 712 | Paying more makes your ad appear higher in the list, and |
713 | also appear higher when people search for keywords. | 713 | also appear higher when people search for keywords. |
@@ -750,7 +750,7 @@ There is no reimbursement for fees paid. | |||
750 | Some of the display changes that you have made | 750 | Some of the display changes that you have made |
751 | require [SECOND_LIFE] to shut down immediately, | 751 | require [SECOND_LIFE] to shut down immediately, |
752 | which will cause you to lose any work in progress. | 752 | which will cause you to lose any work in progress. |
753 | 753 | ||
754 | Apply those changes and quit | 754 | Apply those changes and quit |
755 | </message> | 755 | </message> |
756 | <option name="ApplyandQuit"> | 756 | <option name="ApplyandQuit"> |
@@ -960,15 +960,6 @@ based on your system configuration. | |||
960 | OK | 960 | OK |
961 | </option> | 961 | </option> |
962 | </alert> | 962 | </alert> |
963 | <alert modal="true" name="DisplaySettingsNoShaders"> | ||
964 | <message name="message"> | ||
965 | [SECOND_LIFE] crashed while initializing graphics drivers. | ||
966 | Shaders will be disabled in order to avoid some common driver errors. | ||
967 | This will disable some graphics features. | ||
968 | We recommend updating your graphics card drivers. | ||
969 | Shaders can be re-enabled in Preferences > Graphics Detail. | ||
970 | </message> | ||
971 | </alert> | ||
972 | <alert modal="true" name="CannotRequestDomain"> | 963 | <alert modal="true" name="CannotRequestDomain"> |
973 | <message name="message"> | 964 | <message name="message"> |
974 | Unable to connect to server. | 965 | Unable to connect to server. |
@@ -980,7 +971,7 @@ Could not request domain name: [HOST] | |||
980 | Unable to find the server domain name. | 971 | Unable to find the server domain name. |
981 | This could be the result of a lost network connection | 972 | This could be the result of a lost network connection |
982 | or a server problem. | 973 | or a server problem. |
983 | 974 | ||
984 | Please try again in a few minutes, or click Help | 975 | Please try again in a few minutes, or click Help |
985 | for advice and a link to the system status web page. | 976 | for advice and a link to the system status web page. |
986 | </message> | 977 | </message> |
@@ -1012,7 +1003,7 @@ please go to the support section and report this problem. | |||
1012 | Often this means that your computer's clock is set incorrectly. | 1003 | Often this means that your computer's clock is set incorrectly. |
1013 | Please go to Control Panels and make sure the time and date | 1004 | Please go to Control Panels and make sure the time and date |
1014 | are set correctly. | 1005 | are set correctly. |
1015 | 1006 | ||
1016 | If you continue to receive this error, please go | 1007 | If you continue to receive this error, please go |
1017 | to the Support section of the SecondLife.com web site | 1008 | to the Support section of the SecondLife.com web site |
1018 | and report the problem. | 1009 | and report the problem. |
@@ -1060,7 +1051,7 @@ SecondLife.com web site. | |||
1060 | <message name="message"> | 1051 | <message name="message"> |
1061 | Unknown problem trying to connect. | 1052 | Unknown problem trying to connect. |
1062 | (Blank error message from server.) | 1053 | (Blank error message from server.) |
1063 | 1054 | ||
1064 | Please try again in a few minutes, or click Help | 1055 | Please try again in a few minutes, or click Help |
1065 | for advice and a link to the system status web page. | 1056 | for advice and a link to the system status web page. |
1066 | </message> | 1057 | </message> |
@@ -1074,7 +1065,7 @@ for advice and a link to the system status web page. | |||
1074 | <alert modal="true" name="CannotConnectNoReplyFromLogin"> | 1065 | <alert modal="true" name="CannotConnectNoReplyFromLogin"> |
1075 | <message name="message"> | 1066 | <message name="message"> |
1076 | Unable to connect. No reply from login database. | 1067 | Unable to connect. No reply from login database. |
1077 | 1068 | ||
1078 | Please try again in a few minutes, or click Help | 1069 | Please try again in a few minutes, or click Help |
1079 | for advice and a link to the system status web page. | 1070 | for advice and a link to the system status web page. |
1080 | </message> | 1071 | </message> |
@@ -1093,10 +1084,10 @@ for advice and a link to the system status web page. | |||
1093 | <alert modal="true" name="FirstRunDialog"> | 1084 | <alert modal="true" name="FirstRunDialog"> |
1094 | <message name="message"> | 1085 | <message name="message"> |
1095 | [SECOND_LIFE] installation is complete. | 1086 | [SECOND_LIFE] installation is complete. |
1096 | 1087 | ||
1097 | If this is your first time using [SECOND_LIFE], you will need to create | 1088 | If this is your first time using [SECOND_LIFE], you will need to create |
1098 | an account before you can log on. | 1089 | an account before you can log on. |
1099 | 1090 | ||
1100 | Return to www.secondlife.com to create a new account? | 1091 | Return to www.secondlife.com to create a new account? |
1101 | </message> | 1092 | </message> |
1102 | <option name="NewAccount..."> | 1093 | <option name="NewAccount..."> |
@@ -1124,7 +1115,7 @@ Please check your network connection. | |||
1124 | <message name="message"> | 1115 | <message name="message"> |
1125 | Unable to connect. Login packet never received by | 1116 | Unable to connect. Login packet never received by |
1126 | login server. | 1117 | login server. |
1127 | 1118 | ||
1128 | Please try again in a few minutes, or click Help | 1119 | Please try again in a few minutes, or click Help |
1129 | for advice and a link to the system status web page. | 1120 | for advice and a link to the system status web page. |
1130 | </message> | 1121 | </message> |
@@ -1137,11 +1128,11 @@ for advice and a link to the system status web page. | |||
1137 | </alert> | 1128 | </alert> |
1138 | <alert modal="true" name="WelcomeToSecondLife"> | 1129 | <alert modal="true" name="WelcomeToSecondLife"> |
1139 | <message name="message"> | 1130 | <message name="message"> |
1140 | Welcome to [SECOND_LIFE]! | 1131 | Welcome to [SECOND_LIFE]! |
1141 | 1132 | ||
1142 | Use arrow keys to walk. | 1133 | Use arrow keys to walk. |
1143 | 1134 | ||
1144 | Please choose the male or female character. | 1135 | Please choose the male or female character. |
1145 | You can change your mind later. | 1136 | You can change your mind later. |
1146 | </message> | 1137 | </message> |
1147 | <option name="Male"> | 1138 | <option name="Male"> |
@@ -1153,10 +1144,10 @@ You can change your mind later. | |||
1153 | </alert> | 1144 | </alert> |
1154 | <alert modal="true" name="WelcomeToSecondLifeSimple"> | 1145 | <alert modal="true" name="WelcomeToSecondLifeSimple"> |
1155 | <message name="message"> | 1146 | <message name="message"> |
1156 | Welcome to [SECOND_LIFE]! | 1147 | Welcome to [SECOND_LIFE]! |
1157 | 1148 | ||
1158 | Use arrow keys to walk. | 1149 | Use arrow keys to walk. |
1159 | 1150 | ||
1160 | Please choose the male or female character. | 1151 | Please choose the male or female character. |
1161 | </message> | 1152 | </message> |
1162 | <option name="Male"> | 1153 | <option name="Male"> |
@@ -1287,7 +1278,7 @@ same region. | |||
1287 | <alert modal="true" name="TakeLockedOrNotOwnedBy"> | 1278 | <alert modal="true" name="TakeLockedOrNotOwnedBy"> |
1288 | <message name="message"> | 1279 | <message name="message"> |
1289 | At least one object is locked or not owned by you. | 1280 | At least one object is locked or not owned by you. |
1290 | If an object is not owned by you and you take it, | 1281 | If an object is not owned by you and you take it, |
1291 | next owner permissions will be applied to it and | 1282 | next owner permissions will be applied to it and |
1292 | possibly restrict your ability to modify or copy it | 1283 | possibly restrict your ability to modify or copy it |
1293 | in the future. | 1284 | in the future. |
@@ -1304,8 +1295,8 @@ Are you sure you want to take these itmes? | |||
1304 | <alert modal="true" name="PromptGoToCurrencyPage"> | 1295 | <alert modal="true" name="PromptGoToCurrencyPage"> |
1305 | <message name="message"> | 1296 | <message name="message"> |
1306 | [EXTRA] | 1297 | [EXTRA] |
1307 | 1298 | ||
1308 | 1299 | ||
1309 | Go to [URL] for information on purchasing currency? | 1300 | Go to [URL] for information on purchasing currency? |
1310 | </message> | 1301 | </message> |
1311 | <option name="GotoPage"> | 1302 | <option name="GotoPage"> |
@@ -1364,50 +1355,50 @@ Expected [VALIDS] | |||
1364 | </alert> | 1355 | </alert> |
1365 | <alert modal="true" name="SoundFileNotRIFF"> | 1356 | <alert modal="true" name="SoundFileNotRIFF"> |
1366 | <message name="message"> | 1357 | <message name="message"> |
1367 | File does not appear to be a RIFF WAVE file: | 1358 | File does not appear to be a RIFF WAVE file: |
1368 | [FILE] | 1359 | [FILE] |
1369 | </message> | 1360 | </message> |
1370 | </alert> | 1361 | </alert> |
1371 | <alert modal="true" name="SoundFileNotPCM"> | 1362 | <alert modal="true" name="SoundFileNotPCM"> |
1372 | <message name="message"> | 1363 | <message name="message"> |
1373 | File does not appear to be a PCM WAVE audio file: | 1364 | File does not appear to be a PCM WAVE audio file: |
1374 | [FILE] | 1365 | [FILE] |
1375 | </message> | 1366 | </message> |
1376 | </alert> | 1367 | </alert> |
1377 | <alert modal="true" name="SoundFileInvalidChannelCount"> | 1368 | <alert modal="true" name="SoundFileInvalidChannelCount"> |
1378 | <message name="message"> | 1369 | <message name="message"> |
1379 | File has invalid number of channels (must be mono or stereo): | 1370 | File has invalid number of channels (must be mono or stereo): |
1380 | [FILE] | 1371 | [FILE] |
1381 | </message> | 1372 | </message> |
1382 | </alert> | 1373 | </alert> |
1383 | <alert modal="true" name="SoundFileInvalidSampleRate"> | 1374 | <alert modal="true" name="SoundFileInvalidSampleRate"> |
1384 | <message name="message"> | 1375 | <message name="message"> |
1385 | File does not appear to be a supported sample rate (must be 44.1k): | 1376 | File does not appear to be a supported sample rate (must be 44.1k): |
1386 | [FILE] | 1377 | [FILE] |
1387 | </message> | 1378 | </message> |
1388 | </alert> | 1379 | </alert> |
1389 | <alert modal="true" name="SoundFileInvalidWordSize"> | 1380 | <alert modal="true" name="SoundFileInvalidWordSize"> |
1390 | <message name="message"> | 1381 | <message name="message"> |
1391 | File does not appear to be a supported word size (must be 8 or 16 bit): | 1382 | File does not appear to be a supported word size (must be 8 or 16 bit): |
1392 | [FILE] | 1383 | [FILE] |
1393 | </message> | 1384 | </message> |
1394 | </alert> | 1385 | </alert> |
1395 | <alert modal="true" name="SoundFileInvalidHeader"> | 1386 | <alert modal="true" name="SoundFileInvalidHeader"> |
1396 | <message name="message"> | 1387 | <message name="message"> |
1397 | Could not find 'data' chunk in WAV header: | 1388 | Could not find 'data' chunk in WAV header: |
1398 | [FILE] | 1389 | [FILE] |
1399 | </message> | 1390 | </message> |
1400 | </alert> | 1391 | </alert> |
1401 | <alert modal="true" name="SoundFileInvalidTooLong"> | 1392 | <alert modal="true" name="SoundFileInvalidTooLong"> |
1402 | <message name="message"> | 1393 | <message name="message"> |
1403 | Audio file is too long (10 second maximum): | 1394 | Audio file is too long (10 second maximum): |
1404 | [FILE] | 1395 | [FILE] |
1405 | </message> | 1396 | </message> |
1406 | </alert> | 1397 | </alert> |
1407 | <alert modal="true" name="ProblemWithFile"> | 1398 | <alert modal="true" name="ProblemWithFile"> |
1408 | <message name="message"> | 1399 | <message name="message"> |
1409 | Problem with file [FILE]: | 1400 | Problem with file [FILE]: |
1410 | 1401 | ||
1411 | [ERROR] | 1402 | [ERROR] |
1412 | </message> | 1403 | </message> |
1413 | </alert> | 1404 | </alert> |
@@ -1679,11 +1670,11 @@ Try selecting a smaller area. | |||
1679 | </alert> | 1670 | </alert> |
1680 | <alert modal="true" name="ParcelCanPlayMusic"> | 1671 | <alert modal="true" name="ParcelCanPlayMusic"> |
1681 | <message name="message"> | 1672 | <message name="message"> |
1682 | This location can play streaming music. | 1673 | This location can play streaming music. |
1683 | 1674 | ||
1684 | Music requires a 768 kbps or faster | 1675 | Music requires a 768 kbps or faster |
1685 | Internet connection. | 1676 | Internet connection. |
1686 | 1677 | ||
1687 | Play music when available? | 1678 | Play music when available? |
1688 | </message> | 1679 | </message> |
1689 | <option name="PlayMusic"> | 1680 | <option name="PlayMusic"> |
@@ -1695,14 +1686,14 @@ Play music when available? | |||
1695 | </alert> | 1686 | </alert> |
1696 | <alert modal="true" name="ParcelCanPlayMedia"> | 1687 | <alert modal="true" name="ParcelCanPlayMedia"> |
1697 | <message name="message"> | 1688 | <message name="message"> |
1698 | This location can play streaming video. | 1689 | This location can play streaming video. |
1699 | 1690 | ||
1700 | Streaming video requires a 768 kbps or | 1691 | Streaming video requires a 768 kbps or |
1701 | faster Internet connection. | 1692 | faster Internet connection. |
1702 | 1693 | ||
1703 | Play streaming video when available? | 1694 | Play streaming video when available? |
1704 | 1695 | ||
1705 | (You can change this option later under | 1696 | (You can change this option later under |
1706 | Preferences > Audio & Video.) | 1697 | Preferences > Audio & Video.) |
1707 | </message> | 1698 | </message> |
1708 | <option name="PlayMedia"> | 1699 | <option name="PlayMedia"> |
@@ -1815,7 +1806,7 @@ The region [REGION] does not allow transfer of land. | |||
1815 | <message name="message"> | 1806 | <message name="message"> |
1816 | Unable to abandon land: | 1807 | Unable to abandon land: |
1817 | You must select an entire parcel to release it. | 1808 | You must select an entire parcel to release it. |
1818 | Try double-clicking to select an entire parcel, or | 1809 | Try double-clicking to select an entire parcel, or |
1819 | first divide your parcel. | 1810 | first divide your parcel. |
1820 | </message> | 1811 | </message> |
1821 | </alert> | 1812 | </alert> |
@@ -1824,7 +1815,7 @@ first divide your parcel. | |||
1824 | You are about to release [AREA] sq. meters of land. | 1815 | You are about to release [AREA] sq. meters of land. |
1825 | Releasing this parcel will remove it from your land | 1816 | Releasing this parcel will remove it from your land |
1826 | holdings, but will not credit any L$. | 1817 | holdings, but will not credit any L$. |
1827 | 1818 | ||
1828 | Release this land? | 1819 | Release this land? |
1829 | </message> | 1820 | </message> |
1830 | <option name="Release"> | 1821 | <option name="Release"> |
@@ -1853,7 +1844,7 @@ and dragging. | |||
1853 | Dividing this land will split this parcel into two | 1844 | Dividing this land will split this parcel into two |
1854 | and each parcel can have its own settings. Some settings | 1845 | and each parcel can have its own settings. Some settings |
1855 | will be reset to defaults after the operation. | 1846 | will be reset to defaults after the operation. |
1856 | 1847 | ||
1857 | Divide land? | 1848 | Divide land? |
1858 | </message> | 1849 | </message> |
1859 | <option name="Divide"> | 1850 | <option name="Divide"> |
@@ -1901,12 +1892,12 @@ and dragging. | |||
1901 | </alert> | 1892 | </alert> |
1902 | <alert modal="true" name="JoinLandWarning"> | 1893 | <alert modal="true" name="JoinLandWarning"> |
1903 | <message name="message"> | 1894 | <message name="message"> |
1904 | Joining this land will create one large parcel | 1895 | Joining this land will create one large parcel |
1905 | out of all parcels intersecting the selected rectangle. | 1896 | out of all parcels intersecting the selected rectangle. |
1906 | 1897 | ||
1907 | You will need to reset the name and options of the | 1898 | You will need to reset the name and options of the |
1908 | new parcel. | 1899 | new parcel. |
1909 | 1900 | ||
1910 | Join land? | 1901 | Join land? |
1911 | </message> | 1902 | </message> |
1912 | <option name="Join"> | 1903 | <option name="Join"> |
@@ -1984,7 +1975,7 @@ and provide details about your network setup. | |||
1984 | <alert modal="true" name="AppEarlyExit"> | 1975 | <alert modal="true" name="AppEarlyExit"> |
1985 | <message name="message"> | 1976 | <message name="message"> |
1986 | [MESSAGE] | 1977 | [MESSAGE] |
1987 | 1978 | ||
1988 | We are unable to recover from this problem. Please | 1979 | We are unable to recover from this problem. Please |
1989 | uninstall and reinstall before trying again. If this | 1980 | uninstall and reinstall before trying again. If this |
1990 | problem persists, check the Tech Support FAQ at: | 1981 | problem persists, check the Tech Support FAQ at: |
@@ -1997,9 +1988,9 @@ www.secondlife.com/support. | |||
1997 | <alert modal="true" name="YouHaveBeenLoggedOut"> | 1988 | <alert modal="true" name="YouHaveBeenLoggedOut"> |
1998 | <message name="message"> | 1989 | <message name="message"> |
1999 | You have been logged out of [SECOND_LIFE]: | 1990 | You have been logged out of [SECOND_LIFE]: |
2000 | 1991 | ||
2001 | [MESSAGE] | 1992 | [MESSAGE] |
2002 | 1993 | ||
2003 | Click Continue to look at existing IM and chat. | 1994 | Click Continue to look at existing IM and chat. |
2004 | You will not be able to perform any other operations. | 1995 | You will not be able to perform any other operations. |
2005 | Click Quit to exit [SECOND_LIFE] immediately. | 1996 | Click Quit to exit [SECOND_LIFE] immediately. |
@@ -2020,10 +2011,10 @@ Please activate another group using Edit -> Groups... | |||
2020 | </alert> | 2011 | </alert> |
2021 | <alert model="true" name="AddFriend" title="Add Friend"> | 2012 | <alert model="true" name="AddFriend" title="Add Friend"> |
2022 | <message name="message"> | 2013 | <message name="message"> |
2023 | Friends can give permissions to | 2014 | Friends can give permissions to |
2024 | track each other on the map and | 2015 | track each other on the map and |
2025 | receive online status updates. | 2016 | receive online status updates. |
2026 | 2017 | ||
2027 | Offer friendship to [NAME]? | 2018 | Offer friendship to [NAME]? |
2028 | </message> | 2019 | </message> |
2029 | <option name="Offer"> | 2020 | <option name="Offer"> |
@@ -2058,9 +2049,9 @@ Offer friendship to [NAME]? | |||
2058 | <alert modal="true" name="GodDeleteAllScriptedPublicObjectsByUser"> | 2049 | <alert modal="true" name="GodDeleteAllScriptedPublicObjectsByUser"> |
2059 | <message name="message"> | 2050 | <message name="message"> |
2060 | Are you sure you want to delete all scripted objects owned by | 2051 | Are you sure you want to delete all scripted objects owned by |
2061 | 2052 | ||
2062 | ** [AVATAR_NAME] ** | 2053 | ** [AVATAR_NAME] ** |
2063 | 2054 | ||
2064 | on all others land in this sim? | 2055 | on all others land in this sim? |
2065 | </message> | 2056 | </message> |
2066 | <option name="DELETE!!"> | 2057 | <option name="DELETE!!"> |
@@ -2073,9 +2064,9 @@ on all others land in this sim? | |||
2073 | <alert modal="true" name="GodDeleteAllScriptedObjectsByUser"> | 2064 | <alert modal="true" name="GodDeleteAllScriptedObjectsByUser"> |
2074 | <message name="message"> | 2065 | <message name="message"> |
2075 | Are you sure you want to DELETE ALL scripted objects owned by | 2066 | Are you sure you want to DELETE ALL scripted objects owned by |
2076 | 2067 | ||
2077 | ** [AVATAR_NAME] ** | 2068 | ** [AVATAR_NAME] ** |
2078 | 2069 | ||
2079 | on ALL LAND in this sim? | 2070 | on ALL LAND in this sim? |
2080 | </message> | 2071 | </message> |
2081 | <option name="!!DELETEALL!!"> | 2072 | <option name="!!DELETEALL!!"> |
@@ -2089,9 +2080,9 @@ on ALL LAND in this sim? | |||
2089 | <message name="message"> | 2080 | <message name="message"> |
2090 | Are you sure you want to DELETE ALL objects (scripted or not) | 2081 | Are you sure you want to DELETE ALL objects (scripted or not) |
2091 | owned by | 2082 | owned by |
2092 | 2083 | ||
2093 | ** [AVATAR_NAME] ** | 2084 | ** [AVATAR_NAME] ** |
2094 | 2085 | ||
2095 | on ALL LAND in this sim? | 2086 | on ALL LAND in this sim? |
2096 | </message> | 2087 | </message> |
2097 | <option name="!!DELETEALL!!"> | 2088 | <option name="!!DELETEALL!!"> |
@@ -2104,7 +2095,7 @@ on ALL LAND in this sim? | |||
2104 | <alert modal="true" name="PublishGroupInfoToWeb"> | 2095 | <alert modal="true" name="PublishGroupInfoToWeb"> |
2105 | <message name="message"> | 2096 | <message name="message"> |
2106 | Selecting the "Publish on the Web" option allows us to publish | 2097 | Selecting the "Publish on the Web" option allows us to publish |
2107 | the group name, insignia, charter, titles, and founder on the | 2098 | the group name, insignia, charter, titles, and founder on the |
2108 | [SECOND_LIFE] website. You are responsible for indicating if any | 2099 | [SECOND_LIFE] website. You are responsible for indicating if any |
2109 | of the above content is considered Mature according to the | 2100 | of the above content is considered Mature according to the |
2110 | Community Standards. | 2101 | Community Standards. |
@@ -2123,7 +2114,7 @@ Community Standards. | |||
2123 | <alert modal="true" name="MinClassifiedPrice"> | 2114 | <alert modal="true" name="MinClassifiedPrice"> |
2124 | <message name="message"> | 2115 | <message name="message"> |
2125 | Price to pay for listing must be at least L$[MIN_PRICE]. | 2116 | Price to pay for listing must be at least L$[MIN_PRICE]. |
2126 | 2117 | ||
2127 | Please enter a higher price. | 2118 | Please enter a higher price. |
2128 | </message> | 2119 | </message> |
2129 | </alert> | 2120 | </alert> |
@@ -2284,11 +2275,11 @@ Please select a smaller area and try again. | |||
2284 | <message name="message"> | 2275 | <message name="message"> |
2285 | By deeding this parcel, the group will be required | 2276 | By deeding this parcel, the group will be required |
2286 | to have and maintain sufficient land use credits. | 2277 | to have and maintain sufficient land use credits. |
2287 | 2278 | ||
2288 | The purchase price of the land is not refunded to | 2279 | The purchase price of the land is not refunded to |
2289 | the owner. If a deeded parcel is sold, the sale | 2280 | the owner. If a deeded parcel is sold, the sale |
2290 | price will be divided evenly among group members. | 2281 | price will be divided evenly among group members. |
2291 | 2282 | ||
2292 | Deed this [AREA] square meters of land to the group | 2283 | Deed this [AREA] square meters of land to the group |
2293 | '[GROUP_NAME]'? | 2284 | '[GROUP_NAME]'? |
2294 | </message> | 2285 | </message> |
@@ -2303,14 +2294,14 @@ Deed this [AREA] square meters of land to the group | |||
2303 | <message name="message"> | 2294 | <message name="message"> |
2304 | By deeding this parcel, the group will be required | 2295 | By deeding this parcel, the group will be required |
2305 | to have and maintain sufficient land use credits. | 2296 | to have and maintain sufficient land use credits. |
2306 | 2297 | ||
2307 | The deed will include a simultaneous land | 2298 | The deed will include a simultaneous land |
2308 | contribution to the group from '[FIRST_NAME] [LAST_NAME]'. | 2299 | contribution to the group from '[FIRST_NAME] [LAST_NAME]'. |
2309 | 2300 | ||
2310 | The purchase price of the land is not refunded to | 2301 | The purchase price of the land is not refunded to |
2311 | the owner. If a deeded parcel is sold, the sale | 2302 | the owner. If a deeded parcel is sold, the sale |
2312 | price will be divided evenly among group members. | 2303 | price will be divided evenly among group members. |
2313 | 2304 | ||
2314 | Deed this [AREA] square meters of land to the group | 2305 | Deed this [AREA] square meters of land to the group |
2315 | '[GROUP_NAME]'? | 2306 | '[GROUP_NAME]'? |
2316 | </message> | 2307 | </message> |
@@ -2344,7 +2335,7 @@ Could not request domain name: [HOST_NAME] | |||
2344 | Unable to find the server domain name. | 2335 | Unable to find the server domain name. |
2345 | This could be the result of a lost network connection | 2336 | This could be the result of a lost network connection |
2346 | or a server problem. | 2337 | or a server problem. |
2347 | 2338 | ||
2348 | Please try again in a few minutes, or click Help | 2339 | Please try again in a few minutes, or click Help |
2349 | for advice and a link to the system status web page. | 2340 | for advice and a link to the system status web page. |
2350 | </message> | 2341 | </message> |
@@ -2383,7 +2374,7 @@ for advice and a link to the system status web page. | |||
2383 | <alert modal="true" name="AvatarMoved"> | 2374 | <alert modal="true" name="AvatarMoved"> |
2384 | <message name="message"> | 2375 | <message name="message"> |
2385 | Your [TYPE] location is not currently available. | 2376 | Your [TYPE] location is not currently available. |
2386 | [HELP] | 2377 | [HELP] |
2387 | You have been moved into a nearby region. | 2378 | You have been moved into a nearby region. |
2388 | </message> | 2379 | </message> |
2389 | </alert> | 2380 | </alert> |
@@ -2397,10 +2388,10 @@ will see you correctly. | |||
2397 | <alert modal="true" name="FirstRun"> | 2388 | <alert modal="true" name="FirstRun"> |
2398 | <message name="message"> | 2389 | <message name="message"> |
2399 | [SECOND_LIFE] installation is complete. | 2390 | [SECOND_LIFE] installation is complete. |
2400 | 2391 | ||
2401 | If this is your first time using [SECOND_LIFE], you will need to create | 2392 | If this is your first time using [SECOND_LIFE], you will need to create |
2402 | an account before you can log on. | 2393 | an account before you can log on. |
2403 | 2394 | ||
2404 | Return to www.secondlife.com to create a new account? | 2395 | Return to www.secondlife.com to create a new account? |
2405 | </message> | 2396 | </message> |
2406 | <option name="NewAccount..."> | 2397 | <option name="NewAccount..."> |
@@ -2421,7 +2412,7 @@ Please check your network connection. | |||
2421 | <message name="message"> | 2412 | <message name="message"> |
2422 | Unable to connect. Login packet never received by | 2413 | Unable to connect. Login packet never received by |
2423 | login server. | 2414 | login server. |
2424 | 2415 | ||
2425 | Please try again in a few minutes, or click Help | 2416 | Please try again in a few minutes, or click Help |
2426 | for advice and a link to the system status web page. | 2417 | for advice and a link to the system status web page. |
2427 | </message> | 2418 | </message> |
@@ -2435,9 +2426,9 @@ for advice and a link to the system status web page. | |||
2435 | <alert modal="true" name="WelcomeNoClothes"> | 2426 | <alert modal="true" name="WelcomeNoClothes"> |
2436 | <message name="message"> | 2427 | <message name="message"> |
2437 | Your character will appear in a moment. | 2428 | Your character will appear in a moment. |
2438 | 2429 | ||
2439 | Use arrow keys to walk. | 2430 | Use arrow keys to walk. |
2440 | 2431 | ||
2441 | Press the F1 key at any time for help or | 2432 | Press the F1 key at any time for help or |
2442 | to learn more about [SECOND_LIFE]. | 2433 | to learn more about [SECOND_LIFE]. |
2443 | </message> | 2434 | </message> |
@@ -2445,12 +2436,12 @@ to learn more about [SECOND_LIFE]. | |||
2445 | <alert modal="true" name="WelcomeChooseSex" nodefault="true"> | 2436 | <alert modal="true" name="WelcomeChooseSex" nodefault="true"> |
2446 | <message name="message"> | 2437 | <message name="message"> |
2447 | Your character will appear in a moment. | 2438 | Your character will appear in a moment. |
2448 | 2439 | ||
2449 | Use arrow keys to walk. | 2440 | Use arrow keys to walk. |
2450 | 2441 | ||
2451 | Press the F1 key at any time for help or | 2442 | Press the F1 key at any time for help or |
2452 | to learn more about [SECOND_LIFE]. | 2443 | to learn more about [SECOND_LIFE]. |
2453 | 2444 | ||
2454 | Please choose the male or female character. | 2445 | Please choose the male or female character. |
2455 | You can change your mind later. | 2446 | You can change your mind later. |
2456 | </message> | 2447 | </message> |
@@ -2479,10 +2470,10 @@ You can change your mind later. | |||
2479 | <alert modal="true" name="FlushMapVisibilityCaches"> | 2470 | <alert modal="true" name="FlushMapVisibilityCaches"> |
2480 | <message name="message"> | 2471 | <message name="message"> |
2481 | This will flush the map caches on this region. | 2472 | This will flush the map caches on this region. |
2482 | 2473 | ||
2483 | This is really only useful for debugging. | 2474 | This is really only useful for debugging. |
2484 | 2475 | ||
2485 | (In production, wait 5 minutes, then everyone's map will | 2476 | (In production, wait 5 minutes, then everyone's map will |
2486 | update after they relog.) | 2477 | update after they relog.) |
2487 | </message> | 2478 | </message> |
2488 | <option name="OK"> | 2479 | <option name="OK"> |
@@ -2543,34 +2534,34 @@ non ALL LAND in this region? | |||
2543 | </alert> | 2534 | </alert> |
2544 | <alert modal="true" name="InvalidTerrainBitDepth"> | 2535 | <alert modal="true" name="InvalidTerrainBitDepth"> |
2545 | <message name="message"> | 2536 | <message name="message"> |
2546 | Couldn't set region textures: | 2537 | Couldn't set region textures: |
2547 | 2538 | ||
2548 | Terrain texture [TEXTURE_NUM] has an invalid bit depth of [TEXTURE_BIT_DEPTH]. | 2539 | Terrain texture [TEXTURE_NUM] has an invalid bit depth of [TEXTURE_BIT_DEPTH]. |
2549 | 2540 | ||
2550 | Replace texture [TEXTURE_NUM] with a 24 bit 512x512 or smaller image | 2541 | Replace texture [TEXTURE_NUM] with a 24 bit 512x512 or smaller image |
2551 | then click "Set" again. | 2542 | then click "Set" again. |
2552 | </message> | 2543 | </message> |
2553 | </alert> | 2544 | </alert> |
2554 | <alert modal="true" name="InvalidTerrainSize"> | 2545 | <alert modal="true" name="InvalidTerrainSize"> |
2555 | <message name="message"> | 2546 | <message name="message"> |
2556 | Couldn't set region textures: | 2547 | Couldn't set region textures: |
2557 | 2548 | ||
2558 | Terrain texture [TEXTURE_NUM] is too large at [TEXTURE_SIZE_X]x[TEXTURE_SIZE_Y]. | 2549 | Terrain texture [TEXTURE_NUM] is too large at [TEXTURE_SIZE_X]x[TEXTURE_SIZE_Y]. |
2559 | 2550 | ||
2560 | Replace texture [TEXTURE_NUM] with a 24 bit 512x512 or smaller image | 2551 | Replace texture [TEXTURE_NUM] with a 24 bit 512x512 or smaller image |
2561 | then click "Set" again. | 2552 | then click "Set" again. |
2562 | </message> | 2553 | </message> |
2563 | </alert> | 2554 | </alert> |
2564 | <alert modal="true" name="RawUploadStarted"> | 2555 | <alert modal="true" name="RawUploadStarted"> |
2565 | <message name="message"> | 2556 | <message name="message"> |
2566 | Upload started. It may take up to two minutes, | 2557 | Upload started. It may take up to two minutes, |
2567 | depending on your connection speed. | 2558 | depending on your connection speed. |
2568 | </message> | 2559 | </message> |
2569 | </alert> | 2560 | </alert> |
2570 | <alert modal="true" name="ConfirmBakeTerrain"> | 2561 | <alert modal="true" name="ConfirmBakeTerrain"> |
2571 | <message name="message"> | 2562 | <message name="message"> |
2572 | Do you really want to bake the current terrain, | 2563 | Do you really want to bake the current terrain, |
2573 | make it the center for terrain raise/lower limits | 2564 | make it the center for terrain raise/lower limits |
2574 | and the default for the 'Revert' tool? | 2565 | and the default for the 'Revert' tool? |
2575 | </message> | 2566 | </message> |
2576 | <option name="Bake"> | 2567 | <option name="Bake"> |
@@ -2618,19 +2609,19 @@ and the default for the 'Revert' tool? | |||
2618 | </alert> | 2609 | </alert> |
2619 | <alert modal="true" name="ClassifiedMustBeAlphanumeric"> | 2610 | <alert modal="true" name="ClassifiedMustBeAlphanumeric"> |
2620 | <message name="message"> | 2611 | <message name="message"> |
2621 | The name of your classified must start with a letter | 2612 | The name of your classified must start with a letter |
2622 | from A to Z or a number. No punctuation is allowed. | 2613 | from A to Z or a number. No punctuation is allowed. |
2623 | </message> | 2614 | </message> |
2624 | </alert> | 2615 | </alert> |
2625 | <alert modal="true" name="CantSetBuyObject"> | 2616 | <alert modal="true" name="CantSetBuyObject"> |
2626 | <message name="message"> | 2617 | <message name="message"> |
2627 | Can't set Buy Object, because the object is not for sale. | 2618 | Can't set Buy Object, because the object is not for sale. |
2628 | Please set the object for sale and try again. | 2619 | Please set the object for sale and try again. |
2629 | </message> | 2620 | </message> |
2630 | </alert> | 2621 | </alert> |
2631 | <alert modal="true" name="FinishedRawDownload"> | 2622 | <alert modal="true" name="FinishedRawDownload"> |
2632 | <message name="message"> | 2623 | <message name="message"> |
2633 | Finished download of raw terrain file to: | 2624 | Finished download of raw terrain file to: |
2634 | [DOWNLOAD_PATH] | 2625 | [DOWNLOAD_PATH] |
2635 | </message> | 2626 | </message> |
2636 | </alert> | 2627 | </alert> |
@@ -2638,7 +2629,7 @@ Please set the object for sale and try again. | |||
2638 | <message name="message"> | 2629 | <message name="message"> |
2639 | A new version of [SECOND_LIFE] is available. | 2630 | A new version of [SECOND_LIFE] is available. |
2640 | [MESSAGE] | 2631 | [MESSAGE] |
2641 | 2632 | ||
2642 | You must download this update to use the system. | 2633 | You must download this update to use the system. |
2643 | </message> | 2634 | </message> |
2644 | <option name="Download"> | 2635 | <option name="Download"> |
@@ -2652,7 +2643,7 @@ You must download this update to use the system. | |||
2652 | <message name="message"> | 2643 | <message name="message"> |
2653 | An updated version of [SECOND_LIFE] is available. | 2644 | An updated version of [SECOND_LIFE] is available. |
2654 | [MESSAGE] | 2645 | [MESSAGE] |
2655 | 2646 | ||
2656 | This update is not required, but we suggest you install it to improve performance and stability. | 2647 | This update is not required, but we suggest you install it to improve performance and stability. |
2657 | </message> | 2648 | </message> |
2658 | <option name="Download"> | 2649 | <option name="Download"> |
@@ -2666,7 +2657,7 @@ This update is not required, but we suggest you install it to improve performanc | |||
2666 | <message name="message"> | 2657 | <message name="message"> |
2667 | An updated version of [SECOND_LIFE] is available. | 2658 | An updated version of [SECOND_LIFE] is available. |
2668 | [MESSAGE] | 2659 | [MESSAGE] |
2669 | 2660 | ||
2670 | This update is not required, but we suggest you install it to improve performance and stability. | 2661 | This update is not required, but we suggest you install it to improve performance and stability. |
2671 | </message> | 2662 | </message> |
2672 | <option name="Download"> | 2663 | <option name="Download"> |
@@ -2682,7 +2673,7 @@ This update is not required, but we suggest you install it to improve performanc | |||
2682 | [MESSAGE] | 2673 | [MESSAGE] |
2683 | 2674 | ||
2684 | You must download this update to use the system. | 2675 | You must download this update to use the system. |
2685 | 2676 | ||
2686 | Download to your Applications folder? | 2677 | Download to your Applications folder? |
2687 | </message> | 2678 | </message> |
2688 | <option name="Download"> | 2679 | <option name="Download"> |
@@ -2696,9 +2687,9 @@ Download to your Applications folder? | |||
2696 | <message name="message"> | 2687 | <message name="message"> |
2697 | An updated version of [SECOND_LIFE] is available. | 2688 | An updated version of [SECOND_LIFE] is available. |
2698 | [MESSAGE] | 2689 | [MESSAGE] |
2699 | 2690 | ||
2700 | This update is not required, but we suggest you install it to improve performance and stability. | 2691 | This update is not required, but we suggest you install it to improve performance and stability. |
2701 | 2692 | ||
2702 | Download to your Applications folder? | 2693 | Download to your Applications folder? |
2703 | </message> | 2694 | </message> |
2704 | <option name="Download"> | 2695 | <option name="Download"> |
@@ -2712,9 +2703,9 @@ Download to your Applications folder? | |||
2712 | <message name="message"> | 2703 | <message name="message"> |
2713 | An updated version of [SECOND_LIFE] is available. | 2704 | An updated version of [SECOND_LIFE] is available. |
2714 | [MESSAGE] | 2705 | [MESSAGE] |
2715 | 2706 | ||
2716 | This update is not required, but we suggest you install it to improve performance and stability. | 2707 | This update is not required, but we suggest you install it to improve performance and stability. |
2717 | 2708 | ||
2718 | Download to your Applications folder? | 2709 | Download to your Applications folder? |
2719 | </message> | 2710 | </message> |
2720 | <option name="Download"> | 2711 | <option name="Download"> |
@@ -2743,10 +2734,10 @@ Download to your Applications folder? | |||
2743 | <message name="message"> | 2734 | <message name="message"> |
2744 | Classified ads appear in the 'Classified' section of the | 2735 | Classified ads appear in the 'Classified' section of the |
2745 | Find directory for one week. | 2736 | Find directory for one week. |
2746 | 2737 | ||
2747 | Fill out your ad, then click 'Publish...' to add it to the | 2738 | Fill out your ad, then click 'Publish...' to add it to the |
2748 | directory. | 2739 | directory. |
2749 | 2740 | ||
2750 | You'll be asked for a price to pay when clicking Publish. | 2741 | You'll be asked for a price to pay when clicking Publish. |
2751 | Paying more makes your ad appear higher in the list, and | 2742 | Paying more makes your ad appear higher in the list, and |
2752 | also appear higher when people search for keywords. | 2743 | also appear higher when people search for keywords. |
@@ -2775,6 +2766,62 @@ also appear higher when people search for keywords. | |||
2775 | Cancel | 2766 | Cancel |
2776 | </option> | 2767 | </option> |
2777 | </alert> | 2768 | </alert> |
2769 | <alert modal="true" name="WebLaunchBugReport101"> | ||
2770 | <message name="message"> | ||
2771 | Visit the [SECOND_LIFE] Wiki and Learn how to Report Bugs Correctly. | ||
2772 | </message> | ||
2773 | <ignore> | ||
2774 | When launching web browser to view the Bug Reporting 101 Wiki | ||
2775 | </ignore> | ||
2776 | <option name="Gotopage"> | ||
2777 | Go to page | ||
2778 | </option> | ||
2779 | <option name="Cancel"> | ||
2780 | Cancel | ||
2781 | </option> | ||
2782 | </alert> | ||
2783 | <alert modal="true" name="WebLaunchSecurityIssues"> | ||
2784 | <message name="message"> | ||
2785 | Visit the [SECOND_LIFE] Wiki for Details of How to Report a Security Issue. | ||
2786 | </message> | ||
2787 | <ignore> | ||
2788 | When launching web browser to view Security Issues Wiki | ||
2789 | </ignore> | ||
2790 | <option name="Gotopage"> | ||
2791 | Go to page | ||
2792 | </option> | ||
2793 | <option name="Cancel"> | ||
2794 | Cancel | ||
2795 | </option> | ||
2796 | </alert> | ||
2797 | <alert modal="true" name="WebLaunchPublicIssue"> | ||
2798 | <message name="message"> | ||
2799 | Visit the [SECOND_LIFE] Public Issue Tracker, Where you can Report Bugs and other Issues. | ||
2800 | </message> | ||
2801 | <ignore> | ||
2802 | When launching web browser to view the Public Issue Tracker | ||
2803 | </ignore> | ||
2804 | <option name="Gotopage"> | ||
2805 | Go to page | ||
2806 | </option> | ||
2807 | <option name="Cancel"> | ||
2808 | Cancel | ||
2809 | </option> | ||
2810 | </alert> | ||
2811 | <alert modal="true" name="WebLaunchPublicIssueHelp"> | ||
2812 | <message name="message"> | ||
2813 | Visit the [SECOND_LIFE] Wiki for info on how to use the Public Issue Tracker. | ||
2814 | </message> | ||
2815 | <ignore> | ||
2816 | When launching web browser to view Public Issue Tracker Wiki | ||
2817 | </ignore> | ||
2818 | <option name="Gotopage"> | ||
2819 | Go to page | ||
2820 | </option> | ||
2821 | <option name="Cancel"> | ||
2822 | Cancel | ||
2823 | </option> | ||
2824 | </alert> | ||
2778 | <alert modal="true" name="WebLaunchForums"> | 2825 | <alert modal="true" name="WebLaunchForums"> |
2779 | <message name="message"> | 2826 | <message name="message"> |
2780 | Search the [SECOND_LIFE] Knowledge Base for the latest tips and tricks. | 2827 | Search the [SECOND_LIFE] Knowledge Base for the latest tips and tricks. |
@@ -2865,7 +2912,7 @@ also appear higher when people search for keywords. | |||
2865 | objects to their owners? Transferable deeded | 2912 | objects to their owners? Transferable deeded |
2866 | objects will be returned to their previous owners. | 2913 | objects will be returned to their previous owners. |
2867 | (All objects returned will return to the folder they were last in.) | 2914 | (All objects returned will return to the folder they were last in.) |
2868 | 2915 | ||
2869 | *WARNING* No-transfer deeded objects will be deleted! | 2916 | *WARNING* No-transfer deeded objects will be deleted! |
2870 | </message> | 2917 | </message> |
2871 | <ignore> | 2918 | <ignore> |
@@ -2931,7 +2978,7 @@ Leave Group? | |||
2931 | </alert> | 2978 | </alert> |
2932 | <alert modal="true" name="MuteByName" title="Mute object by name"> | 2979 | <alert modal="true" name="MuteByName" title="Mute object by name"> |
2933 | <message name="message"> | 2980 | <message name="message"> |
2934 | Mute by name only affects object chat and IM, not sounds. | 2981 | Mute by name only affects object chat and IM, not sounds. |
2935 | You must type the object's name exactly. | 2982 | You must type the object's name exactly. |
2936 | </message> | 2983 | </message> |
2937 | <editline> | 2984 | <editline> |
@@ -3173,13 +3220,13 @@ sent to everyone currently in your estate. | |||
3173 | </alert> | 3220 | </alert> |
3174 | <alert name="ChangeLindenEstate" title="Change Linden Estate"> | 3221 | <alert name="ChangeLindenEstate" title="Change Linden Estate"> |
3175 | <message name="message"> | 3222 | <message name="message"> |
3176 | You are about to change a Linden owned estate (mainland, | 3223 | You are about to change a Linden owned estate (mainland, |
3177 | teen grid, orientation, etc.). | 3224 | teen grid, orientation, etc.). |
3178 | 3225 | ||
3179 | This is EXTREMELY DANGEROUS because it can fundamentally | 3226 | This is EXTREMELY DANGEROUS because it can fundamentally |
3180 | affect the user experience. On the mainland, it will change | 3227 | affect the user experience. On the mainland, it will change |
3181 | thousands of regions and make the spaceserver hiccup. | 3228 | thousands of regions and make the spaceserver hiccup. |
3182 | 3229 | ||
3183 | Proceed? | 3230 | Proceed? |
3184 | </message> | 3231 | </message> |
3185 | <option name="ChangeEstate"> | 3232 | <option name="ChangeEstate"> |
@@ -3191,16 +3238,16 @@ Proceed? | |||
3191 | </alert> | 3238 | </alert> |
3192 | <alert name="ChangeLindenAccess" title="Change Linden Estate Access"> | 3239 | <alert name="ChangeLindenAccess" title="Change Linden Estate Access"> |
3193 | <message name="message"> | 3240 | <message name="message"> |
3194 | You are about to change the access list for a Linden owned | 3241 | You are about to change the access list for a Linden owned |
3195 | estate (mainland, teen grid, orientation, etc.). | 3242 | estate (mainland, teen grid, orientation, etc.). |
3196 | 3243 | ||
3197 | This is DANGEROUS and should only be done to invoke the | 3244 | This is DANGEROUS and should only be done to invoke the |
3198 | hack allowing objects/money to be transfered in/out of | 3245 | hack allowing objects/money to be transfered in/out of |
3199 | a grid. | 3246 | a grid. |
3200 | 3247 | ||
3201 | It will change thousands of regions and make the | 3248 | It will change thousands of regions and make the |
3202 | spaceserver hiccup. | 3249 | spaceserver hiccup. |
3203 | 3250 | ||
3204 | Proceed? | 3251 | Proceed? |
3205 | </message> | 3252 | </message> |
3206 | <option name="ChangeEstate"> | 3253 | <option name="ChangeEstate"> |
@@ -3393,7 +3440,7 @@ Proceed? | |||
3393 | <alert name="PublishClassified"> | 3440 | <alert name="PublishClassified"> |
3394 | <message name="message"> | 3441 | <message name="message"> |
3395 | Remember: Classified ad fees are non-refundable. | 3442 | Remember: Classified ad fees are non-refundable. |
3396 | 3443 | ||
3397 | Publish this classified now for L$[AMOUNT]? | 3444 | Publish this classified now for L$[AMOUNT]? |
3398 | </message> | 3445 | </message> |
3399 | <option name="Publish"> | 3446 | <option name="Publish"> |
@@ -3431,7 +3478,7 @@ sent to everyone in this region. | |||
3431 | <message name="message"> | 3478 | <message name="message"> |
3432 | If this box is checked, land owners will not be able to terraform | 3479 | If this box is checked, land owners will not be able to terraform |
3433 | their land regardless of the per-parcel 'Edit Terrain' setting. | 3480 | their land regardless of the per-parcel 'Edit Terrain' setting. |
3434 | 3481 | ||
3435 | Default: off | 3482 | Default: off |
3436 | </message> | 3483 | </message> |
3437 | </alert> | 3484 | </alert> |
@@ -3439,7 +3486,7 @@ Default: off | |||
3439 | <message name="message"> | 3486 | <message name="message"> |
3440 | If this box is checked, people will not be able to fly in this region | 3487 | If this box is checked, people will not be able to fly in this region |
3441 | regardless of the per-parcel 'Fly' setting. | 3488 | regardless of the per-parcel 'Fly' setting. |
3442 | 3489 | ||
3443 | Default: off | 3490 | Default: off |
3444 | </message> | 3491 | </message> |
3445 | </alert> | 3492 | </alert> |
@@ -3447,18 +3494,18 @@ Default: off | |||
3447 | <message name="message"> | 3494 | <message name="message"> |
3448 | Checking this box enables the health system across all parcels | 3495 | Checking this box enables the health system across all parcels |
3449 | regardless of individual parcel settings. If this box is left | 3496 | regardless of individual parcel settings. If this box is left |
3450 | unchecked, individual parcel owners will still be able to | 3497 | unchecked, individual parcel owners will still be able to |
3451 | activate the health system on their parcels. | 3498 | activate the health system on their parcels. |
3452 | 3499 | ||
3453 | Default: off | 3500 | Default: off |
3454 | </message> | 3501 | </message> |
3455 | </alert> | 3502 | </alert> |
3456 | <alert modal="true" name="HelpRegionAgentLimit" title="Agent Limit"> | 3503 | <alert modal="true" name="HelpRegionAgentLimit" title="Agent Limit"> |
3457 | <message name="message"> | 3504 | <message name="message"> |
3458 | Sets the maximum number of avatars allowed in this region. | 3505 | Sets the maximum number of avatars allowed in this region. |
3459 | Note that the more avatars you have in one region, the worse | 3506 | Note that the more avatars you have in one region, the worse |
3460 | the performance can be. | 3507 | the performance can be. |
3461 | 3508 | ||
3462 | Default: 30 | 3509 | Default: 30 |
3463 | </message> | 3510 | </message> |
3464 | </alert> | 3511 | </alert> |
@@ -3472,7 +3519,7 @@ allowed per region remains 15,000 no matter what the value set for | |||
3472 | Object Bonus. Once this value is set, it should not be lowered until | 3519 | Object Bonus. Once this value is set, it should not be lowered until |
3473 | you are certain that changing it will not force return or deletion of | 3520 | you are certain that changing it will not force return or deletion of |
3474 | the objects currently on parcels. | 3521 | the objects currently on parcels. |
3475 | 3522 | ||
3476 | Default: 1.0 | 3523 | Default: 1.0 |
3477 | </message> | 3524 | </message> |
3478 | </alert> | 3525 | </alert> |
@@ -3482,10 +3529,10 @@ Default: 1.0 | |||
3482 | corner of the screen and in pop-up tips on the map. Maturity | 3529 | corner of the screen and in pop-up tips on the map. Maturity |
3483 | also affects search results - residents can choose not to find | 3530 | also affects search results - residents can choose not to find |
3484 | content in Mature regions. | 3531 | content in Mature regions. |
3485 | 3532 | ||
3486 | The pop-up tips on the map will not change for 5 minutes, because | 3533 | The pop-up tips on the map will not change for 5 minutes, because |
3487 | the system only updates map information periodically. | 3534 | the system only updates map information periodically. |
3488 | 3535 | ||
3489 | Default: PG | 3536 | Default: PG |
3490 | </message> | 3537 | </message> |
3491 | </alert> | 3538 | </alert> |
@@ -3496,49 +3543,49 @@ Agents may only push themselves, or be pushed by scripts owned by | |||
3496 | the owner of a parcel, or that are set to the group of the parcel, | 3543 | the owner of a parcel, or that are set to the group of the parcel, |
3497 | assuming the parcel has a group set/deeded. | 3544 | assuming the parcel has a group set/deeded. |
3498 | Push refers to the llPushObject() LSL function. | 3545 | Push refers to the llPushObject() LSL function. |
3499 | 3546 | ||
3500 | Default: Off | 3547 | Default: Off |
3501 | </message> | 3548 | </message> |
3502 | </alert> | 3549 | </alert> |
3503 | <alert modal="true" name="HelpParcelChanges" title="Parcel Join/Subdivide"> | 3550 | <alert modal="true" name="HelpParcelChanges" title="Parcel Join/Subdivide"> |
3504 | <message name="message"> | 3551 | <message name="message"> |
3505 | Sets whether or not parcels not owned by the estate owner | 3552 | Sets whether or not parcels not owned by the estate owner |
3506 | can be joined or subdivided. | 3553 | can be joined or subdivided. |
3507 | If this option is unchecked: | 3554 | If this option is unchecked: |
3508 | * Only estate owners or managers can join or subdivide parcels. | 3555 | * Only estate owners or managers can join or subdivide parcels. |
3509 | * They may only join or subdivide parcels belonging to the owner, | 3556 | * They may only join or subdivide parcels belonging to the owner, |
3510 | or to a group where they have the appropriate group powers. | 3557 | or to a group where they have the appropriate group powers. |
3511 | If this option is checked: | 3558 | If this option is checked: |
3512 | * All parcel owners can join or subdivide the parcels they own. | 3559 | * All parcel owners can join or subdivide the parcels they own. |
3513 | * For group owned parcels, those with appropriate group powers | 3560 | * For group owned parcels, those with appropriate group powers |
3514 | may join or subdivide parcels. | 3561 | may join or subdivide parcels. |
3515 | 3562 | ||
3516 | Default: Checked | 3563 | Default: Checked |
3517 | </message> | 3564 | </message> |
3518 | </alert> | 3565 | </alert> |
3519 | <alert modal="true" name="RegionMaturityChange" title="Changed Region Maturity"> | 3566 | <alert modal="true" name="RegionMaturityChange" title="Changed Region Maturity"> |
3520 | <message name="message"> | 3567 | <message name="message"> |
3521 | The maturity rating for this region has been updated. | 3568 | The maturity rating for this region has been updated. |
3522 | 3569 | ||
3523 | The world map, however, will take approximately 5 minutes | 3570 | The world map, however, will take approximately 5 minutes |
3524 | to update, because the system only updates map information | 3571 | to update, because the system only updates map information |
3525 | periodically. | 3572 | periodically. |
3526 | </message> | 3573 | </message> |
3527 | </alert> | 3574 | </alert> |
3528 | <alert modal="true" name="HelpRegionLandResell" title="Land Resale"> | 3575 | <alert modal="true" name="HelpRegionLandResell" title="Land Resale"> |
3529 | <message name="message"> | 3576 | <message name="message"> |
3530 | Estate owners and managers can sell any land owned by the estate owner. | 3577 | Estate owners and managers can sell any land owned by the estate owner. |
3531 | If this option is left unchecked, buyers cannot resell their land in this region. | 3578 | If this option is left unchecked, buyers cannot resell their land in this region. |
3532 | If this option is checked, buyers can resell their land in this region. | 3579 | If this option is checked, buyers can resell their land in this region. |
3533 | 3580 | ||
3534 | Default: Disallow | 3581 | Default: Disallow |
3535 | </message> | 3582 | </message> |
3536 | </alert> | 3583 | </alert> |
3537 | <alert modal="true" name="HelpEstateCovenantID" title="Covenant Asset ID"> | 3584 | <alert modal="true" name="HelpEstateCovenantID" title="Covenant Asset ID"> |
3538 | <message name="message"> | 3585 | <message name="message"> |
3539 | Sets the notecard asset ID for the Estate Covenant belonging to this | 3586 | Sets the notecard asset ID for the Estate Covenant belonging to this |
3540 | estate. | 3587 | estate. |
3541 | 3588 | ||
3542 | Default: 00000000-0000-0000-0000-000000000000 or none | 3589 | Default: 00000000-0000-0000-0000-000000000000 or none |
3543 | </message> | 3590 | </message> |
3544 | </alert> | 3591 | </alert> |
@@ -3546,200 +3593,200 @@ Default: 00000000-0000-0000-0000-000000000000 or none | |||
3546 | <message name="message"> | 3593 | <message name="message"> |
3547 | When sim performance is poor, a script may be to blame. Open the | 3594 | When sim performance is poor, a script may be to blame. Open the |
3548 | Statistics Bar (Ctrl-Shift-1). Look at the Simulator Physics FPS. | 3595 | Statistics Bar (Ctrl-Shift-1). Look at the Simulator Physics FPS. |
3549 | If it is lower than 45 then open the 'Time' panel located at the | 3596 | If it is lower than 45 then open the 'Time' panel located at the |
3550 | bottom of the Stats Bar. If Script Time reads 25 ms or higher, click | 3597 | bottom of the Stats Bar. If Script Time reads 25 ms or higher, click |
3551 | the 'Get Top Scripts' button. You will be given the name and location | 3598 | the 'Get Top Scripts' button. You will be given the name and location |
3552 | of scripts that may be causing poor performance. | 3599 | of scripts that may be causing poor performance. |
3553 | 3600 | ||
3554 | Checking the 'Disable Scripts' box and then pressing the 'Apply' | 3601 | Checking the 'Disable Scripts' box and then pressing the 'Apply' |
3555 | button will temporarily disable all scripts in this region. You may | 3602 | button will temporarily disable all scripts in this region. You may |
3556 | need to do this in order to travel to the location of a noted | 3603 | need to do this in order to travel to the location of a noted |
3557 | 'top script'. Once you have arrived at the location, investigate the | 3604 | 'top script'. Once you have arrived at the location, investigate the |
3558 | script to determine if it is causing the problem. You may want to | 3605 | script to determine if it is causing the problem. You may want to |
3559 | contact the owner of the script or delete or return the object. | 3606 | contact the owner of the script or delete or return the object. |
3560 | Uncheck the 'Disable Script' box and then 'Apply' to reactivate | 3607 | Uncheck the 'Disable Script' box and then 'Apply' to reactivate |
3561 | the scripts in the region. | 3608 | the scripts in the region. |
3562 | 3609 | ||
3563 | Default: off | 3610 | Default: off |
3564 | </message> | 3611 | </message> |
3565 | </alert> | 3612 | </alert> |
3566 | <alert modal="true" name="HelpRegionDisableCollisions" title="Disable Collisions"> | 3613 | <alert modal="true" name="HelpRegionDisableCollisions" title="Disable Collisions"> |
3567 | <message name="message"> | 3614 | <message name="message"> |
3568 | When sim performance is poor, physical objects may be to blame. | 3615 | When sim performance is poor, physical objects may be to blame. |
3569 | Open the Statistics Bar (Ctrl-Shift-1). Look at the Simulator | 3616 | Open the Statistics Bar (Ctrl-Shift-1). Look at the Simulator |
3570 | Physics FPS. If it is lower than 45 then open the 'Time' panel | 3617 | Physics FPS. If it is lower than 45 then open the 'Time' panel |
3571 | located at the bottom of the Stats Bar. If Sim Time (Physics) | 3618 | located at the bottom of the Stats Bar. If Sim Time (Physics) |
3572 | reads 20 ms or higher, click the 'Get Top Colliders' button. | 3619 | reads 20 ms or higher, click the 'Get Top Colliders' button. |
3573 | You will be given the name and location of physical objects | 3620 | You will be given the name and location of physical objects |
3574 | that may be causing poor performance. | 3621 | that may be causing poor performance. |
3575 | 3622 | ||
3576 | Checking the 'Disable Collisions' box and then pressing the 'Apply' | 3623 | Checking the 'Disable Collisions' box and then pressing the 'Apply' |
3577 | button will temporarily disable object-object collisions. You may | 3624 | button will temporarily disable object-object collisions. You may |
3578 | need to do this in order to travel to the location of a noted | 3625 | need to do this in order to travel to the location of a noted |
3579 | 'top collider'. Once you have arrived at the location, investigate the | 3626 | 'top collider'. Once you have arrived at the location, investigate the |
3580 | object - is it constantly colliding with other objects? You may want to | 3627 | object - is it constantly colliding with other objects? You may want to |
3581 | contact the owner of the object or delete or return the object. | 3628 | contact the owner of the object or delete or return the object. |
3582 | Uncheck the 'Disable Collisions' box and then 'Apply' to reactivate | 3629 | Uncheck the 'Disable Collisions' box and then 'Apply' to reactivate |
3583 | collisions in the region. | 3630 | collisions in the region. |
3584 | 3631 | ||
3585 | Default: off | 3632 | Default: off |
3586 | </message> | 3633 | </message> |
3587 | </alert> | 3634 | </alert> |
3588 | <alert modal="true" name="HelpRegionDisablePhysics" title="Disable Physics"> | 3635 | <alert modal="true" name="HelpRegionDisablePhysics" title="Disable Physics"> |
3589 | <message name="message"> | 3636 | <message name="message"> |
3590 | Disable Physics is similar to Disable Collisions, except all | 3637 | Disable Physics is similar to Disable Collisions, except all |
3591 | physics simulation is disabled. This means that not only will | 3638 | physics simulation is disabled. This means that not only will |
3592 | objects stop colliding, but avatars will be unable to move. | 3639 | objects stop colliding, but avatars will be unable to move. |
3593 | 3640 | ||
3594 | This should only be used when Disable Collisions does not | 3641 | This should only be used when Disable Collisions does not |
3595 | give back enough performance to the region to investigate | 3642 | give back enough performance to the region to investigate |
3596 | a physics problem or 'Top Collider'. | 3643 | a physics problem or 'Top Collider'. |
3597 | 3644 | ||
3598 | Be sure to re-enable physics when you are done, or avatars | 3645 | Be sure to re-enable physics when you are done, or avatars |
3599 | will continue to be unable to move. | 3646 | will continue to be unable to move. |
3600 | 3647 | ||
3601 | Default: off | 3648 | Default: off |
3602 | </message> | 3649 | </message> |
3603 | </alert> | 3650 | </alert> |
3604 | <alert modal="true" name="HelpRegionTopColliders" title="Top Colliders"> | 3651 | <alert modal="true" name="HelpRegionTopColliders" title="Top Colliders"> |
3605 | <message name="message"> | 3652 | <message name="message"> |
3606 | Show a list of objects experiencing the greatest number | 3653 | Show a list of objects experiencing the greatest number |
3607 | of potential object-object collisions. These objects can | 3654 | of potential object-object collisions. These objects can |
3608 | slow sim performance. Select View > Statistics Bar and | 3655 | slow sim performance. Select View > Statistics Bar and |
3609 | look under Simulator > Time > Sim Time (Physics) to see | 3656 | look under Simulator > Time > Sim Time (Physics) to see |
3610 | if more than 20 ms is being spent in physics. | 3657 | if more than 20 ms is being spent in physics. |
3611 | </message> | 3658 | </message> |
3612 | </alert> | 3659 | </alert> |
3613 | <alert modal="true" name="HelpRegionTopScripts" title="Top Scripts"> | 3660 | <alert modal="true" name="HelpRegionTopScripts" title="Top Scripts"> |
3614 | <message name="message"> | 3661 | <message name="message"> |
3615 | Show a list of objects spending the most time running | 3662 | Show a list of objects spending the most time running |
3616 | LSL scripts. These objects can slow sim performance. | 3663 | LSL scripts. These objects can slow sim performance. |
3617 | Select View > Statistics Bar and look under | 3664 | Select View > Statistics Bar and look under |
3618 | Simulator > Time > Script Time to see if more than | 3665 | Simulator > Time > Script Time to see if more than |
3619 | 25 ms is being spent in scripts. | 3666 | 25 ms is being spent in scripts. |
3620 | </message> | 3667 | </message> |
3621 | </alert> | 3668 | </alert> |
3622 | <alert modal="true" name="HelpRegionRestart" title="Restart Region"> | 3669 | <alert modal="true" name="HelpRegionRestart" title="Restart Region"> |
3623 | <message name="message"> | 3670 | <message name="message"> |
3624 | Restart the server process running this region after a | 3671 | Restart the server process running this region after a |
3625 | two minute warning. All residents in the region will be | 3672 | two minute warning. All residents in the region will be |
3626 | disconnected. The region will save its data, and should | 3673 | disconnected. The region will save its data, and should |
3627 | come back up within 90 seconds. | 3674 | come back up within 90 seconds. |
3628 | 3675 | ||
3629 | Restarting the region will not fix most performance | 3676 | Restarting the region will not fix most performance |
3630 | problems, and should usually be used only when directed. | 3677 | problems, and should usually be used only when directed. |
3631 | </message> | 3678 | </message> |
3632 | </alert> | 3679 | </alert> |
3633 | <alert modal="true" name="HelpRegionWaterHeight" title="Water Height"> | 3680 | <alert modal="true" name="HelpRegionWaterHeight" title="Water Height"> |
3634 | <message name="message"> | 3681 | <message name="message"> |
3635 | This is the height in meters where water appears. If | 3682 | This is the height in meters where water appears. If |
3636 | this setting is anything other than 20 and you have | 3683 | this setting is anything other than 20 and you have |
3637 | water that is adjacent to the edge of world or 'void' | 3684 | water that is adjacent to the edge of world or 'void' |
3638 | water, there will be a visible gap. | 3685 | water, there will be a visible gap. |
3639 | 3686 | ||
3640 | Default: 20 | 3687 | Default: 20 |
3641 | </message> | 3688 | </message> |
3642 | </alert> | 3689 | </alert> |
3643 | <alert modal="true" name="HelpRegionTerrainRaise" title="Terrain Raise"> | 3690 | <alert modal="true" name="HelpRegionTerrainRaise" title="Terrain Raise"> |
3644 | <message name="message"> | 3691 | <message name="message"> |
3645 | This is the distance that parcel owners can raise | 3692 | This is the distance that parcel owners can raise |
3646 | their terrain above the 'baked' terrain default | 3693 | their terrain above the 'baked' terrain default |
3647 | height. | 3694 | height. |
3648 | 3695 | ||
3649 | Default: 4 | 3696 | Default: 4 |
3650 | </message> | 3697 | </message> |
3651 | </alert> | 3698 | </alert> |
3652 | <alert modal="true" name="HelpRegionTerrainLower" title="Terrain Lower"> | 3699 | <alert modal="true" name="HelpRegionTerrainLower" title="Terrain Lower"> |
3653 | <message name="message"> | 3700 | <message name="message"> |
3654 | This is the distance that parcel owners can lower | 3701 | This is the distance that parcel owners can lower |
3655 | their terrain below the 'baked' terrain default | 3702 | their terrain below the 'baked' terrain default |
3656 | height. | 3703 | height. |
3657 | 3704 | ||
3658 | Default: -4 | 3705 | Default: -4 |
3659 | </message> | 3706 | </message> |
3660 | </alert> | 3707 | </alert> |
3661 | <alert modal="true" name="HelpRegionUploadRaw" title="Upload RAW Terrain"> | 3708 | <alert modal="true" name="HelpRegionUploadRaw" title="Upload RAW Terrain"> |
3662 | <message name="message"> | 3709 | <message name="message"> |
3663 | This button uploads a .RAW file to the region you are in. | 3710 | This button uploads a .RAW file to the region you are in. |
3664 | The file must have the correct dimensions/number of channels: | 3711 | The file must have the correct dimensions/number of channels: |
3665 | RGB, 256x256 and 13 channels. The best way to create a | 3712 | RGB, 256x256 and 13 channels. The best way to create a |
3666 | terrain file is to download the existing RAW file. A good | 3713 | terrain file is to download the existing RAW file. A good |
3667 | first step is to modify the first channel (land height), | 3714 | first step is to modify the first channel (land height), |
3668 | and upload it. | 3715 | and upload it. |
3669 | 3716 | ||
3670 | The upload can take up to 45 seconds. Note that uploading a | 3717 | The upload can take up to 45 seconds. Note that uploading a |
3671 | terrain file *will not* move the objects that are on the land, | 3718 | terrain file *will not* move the objects that are on the land, |
3672 | only the terrain itself and the permissions associated with the | 3719 | only the terrain itself and the permissions associated with the |
3673 | parcels. This can result in objects going underground. | 3720 | parcels. This can result in objects going underground. |
3674 | 3721 | ||
3675 | For more information on editing region height fields, go to: | 3722 | For more information on editing region height fields, go to: |
3676 | http://secondlife.com/tiki/tiki-index.php?page=RawTerrainFile | 3723 | http://secondlife.com/tiki/tiki-index.php?page=RawTerrainFile |
3677 | </message> | 3724 | </message> |
3678 | </alert> | 3725 | </alert> |
3679 | <alert modal="true" name="HelpRegionDownloadRaw" title="Download RAW Terrain"> | 3726 | <alert modal="true" name="HelpRegionDownloadRaw" title="Download RAW Terrain"> |
3680 | <message name="message"> | 3727 | <message name="message"> |
3681 | This button downloads a file containing the height field data, | 3728 | This button downloads a file containing the height field data, |
3682 | parcel dimensions, parcel for sale status and some parcel permissions | 3729 | parcel dimensions, parcel for sale status and some parcel permissions |
3683 | for this region. When opening the file in a program such as | 3730 | for this region. When opening the file in a program such as |
3684 | Photoshop you must specify the document's dimensions which | 3731 | Photoshop you must specify the document's dimensions which |
3685 | are: RGB, 256x256 with 13 channels. This terrain file cannot | 3732 | are: RGB, 256x256 with 13 channels. This terrain file cannot |
3686 | be opened in any other way. | 3733 | be opened in any other way. |
3687 | 3734 | ||
3688 | For more information on editing region height fields, go to: | 3735 | For more information on editing region height fields, go to: |
3689 | http://secondlife.com/tiki/tiki-index.php?page=RawTerrainFile | 3736 | http://secondlife.com/tiki/tiki-index.php?page=RawTerrainFile |
3690 | </message> | 3737 | </message> |
3691 | </alert> | 3738 | </alert> |
3692 | <alert modal="true" name="HelpRegionUseEstateSun" title="Use Estate Sun"> | 3739 | <alert modal="true" name="HelpRegionUseEstateSun" title="Use Estate Sun"> |
3693 | <message name="message"> | 3740 | <message name="message"> |
3694 | This checkbox makes the sun position in this region the | 3741 | This checkbox makes the sun position in this region the |
3695 | same as the sun position in the rest of the estate. | 3742 | same as the sun position in the rest of the estate. |
3696 | 3743 | ||
3697 | Default: on | 3744 | Default: on |
3698 | </message> | 3745 | </message> |
3699 | </alert> | 3746 | </alert> |
3700 | <alert modal="true" name="HelpRegionFixedSun" title="Fixed Sun"> | 3747 | <alert modal="true" name="HelpRegionFixedSun" title="Fixed Sun"> |
3701 | <message name="message"> | 3748 | <message name="message"> |
3702 | This checkbox sets the sun position to the position | 3749 | This checkbox sets the sun position to the position |
3703 | in the Phase slider and stops the sun from moving. | 3750 | in the Phase slider and stops the sun from moving. |
3704 | 3751 | ||
3705 | Default: off | 3752 | Default: off |
3706 | </message> | 3753 | </message> |
3707 | </alert> | 3754 | </alert> |
3708 | <alert modal="true" name="HelpRegionBakeTerrain" title="Bake Terrain"> | 3755 | <alert modal="true" name="HelpRegionBakeTerrain" title="Bake Terrain"> |
3709 | <message name="message"> | 3756 | <message name="message"> |
3710 | This button saves the current shape of the terrain as the | 3757 | This button saves the current shape of the terrain as the |
3711 | new default for the region. Once baked, the land can revert | 3758 | new default for the region. Once baked, the land can revert |
3712 | to the saved shape whenever you or others use the Edit Terrain | 3759 | to the saved shape whenever you or others use the Edit Terrain |
3713 | 'Revert' option/tool. The baked terrain is also the middle | 3760 | 'Revert' option/tool. The baked terrain is also the middle |
3714 | point for the terrain raise and lower limits. | 3761 | point for the terrain raise and lower limits. |
3715 | </message> | 3762 | </message> |
3716 | </alert> | 3763 | </alert> |
3717 | <alert modal="true" name="HelpEstateEstateManager" title="Estate Managers"> | 3764 | <alert modal="true" name="HelpEstateEstateManager" title="Estate Managers"> |
3718 | <message name="message"> | 3765 | <message name="message"> |
3719 | An estate manager is a resident to whom you have delegated | 3766 | An estate manager is a resident to whom you have delegated |
3720 | control of region and estate settings. An estate manager | 3767 | control of region and estate settings. An estate manager |
3721 | can change any setting in these panels, except for uploading, | 3768 | can change any setting in these panels, except for uploading, |
3722 | downloading, and baking terrain. In particular, they can | 3769 | downloading, and baking terrain. In particular, they can |
3723 | allow or ban residents from your estate. | 3770 | allow or ban residents from your estate. |
3724 | 3771 | ||
3725 | Estate managers can only be added or removed by the owner | 3772 | Estate managers can only be added or removed by the owner |
3726 | of the estate, not by each other. Please only choose | 3773 | of the estate, not by each other. Please only choose |
3727 | residents you trust as estate managers, as you will be | 3774 | residents you trust as estate managers, as you will be |
3728 | ultimately responsible for their actions. | 3775 | ultimately responsible for their actions. |
3729 | </message> | 3776 | </message> |
3730 | </alert> | 3777 | </alert> |
3731 | <alert modal="true" name="HelpEstateUseGlobalTime" title="Use Global Time"> | 3778 | <alert modal="true" name="HelpEstateUseGlobalTime" title="Use Global Time"> |
3732 | <message name="message"> | 3779 | <message name="message"> |
3733 | This checkbox makes the sun in your estate follow | 3780 | This checkbox makes the sun in your estate follow |
3734 | the same position as on the Linden-owned 'mainland' | 3781 | the same position as on the Linden-owned 'mainland' |
3735 | estates. | 3782 | estates. |
3736 | 3783 | ||
3737 | Default: on | 3784 | Default: on |
3738 | </message> | 3785 | </message> |
3739 | </alert> | 3786 | </alert> |
3740 | <alert modal="true" name="HelpEstateFixedSun" title="Fixed Sun"> | 3787 | <alert modal="true" name="HelpEstateFixedSun" title="Fixed Sun"> |
3741 | <message name="message"> | 3788 | <message name="message"> |
3742 | This checkbox sets the sun position to the position | 3789 | This checkbox sets the sun position to the position |
3743 | in the Phase slider and stops the sun from moving. | 3790 | in the Phase slider and stops the sun from moving. |
3744 | </message> | 3791 | </message> |
3745 | </alert> | 3792 | </alert> |
@@ -3747,91 +3794,91 @@ in the Phase slider and stops the sun from moving. | |||
3747 | <message name="message"> | 3794 | <message name="message"> |
3748 | Sets whether residents who are on other estates can enter this | 3795 | Sets whether residents who are on other estates can enter this |
3749 | estate without being on an access list. | 3796 | estate without being on an access list. |
3750 | 3797 | ||
3751 | Default: on | 3798 | Default: on |
3752 | </message> | 3799 | </message> |
3753 | </alert> | 3800 | </alert> |
3754 | <alert modal="true" name="HelpEstateAllowDirectTeleport" title="Allow Direct Teleport"> | 3801 | <alert modal="true" name="HelpEstateAllowDirectTeleport" title="Allow Direct Teleport"> |
3755 | <message name="message"> | 3802 | <message name="message"> |
3756 | When checked, allows residents to directly teleport to any | 3803 | When checked, allows residents to directly teleport to any |
3757 | point in your estate. When unchecked, residents teleport | 3804 | point in your estate. When unchecked, residents teleport |
3758 | to the nearest telehub. | 3805 | to the nearest telehub. |
3759 | 3806 | ||
3760 | Default: off | 3807 | Default: off |
3761 | </message> | 3808 | </message> |
3762 | </alert> | 3809 | </alert> |
3763 | <alert modal="true" name="HelpEstateAllowResident" title="Allow Access"> | 3810 | <alert modal="true" name="HelpEstateAllowResident" title="Allow Access"> |
3764 | <message name="message"> | 3811 | <message name="message"> |
3765 | If any resident is listed here, access to the estate will be | 3812 | If any resident is listed here, access to the estate will be |
3766 | limited to residents on this list and groups listed below. | 3813 | limited to residents on this list and groups listed below. |
3767 | 3814 | ||
3768 | (If the estate is visible from the mainland, access cannot be | 3815 | (If the estate is visible from the mainland, access cannot be |
3769 | limited to a resident or group list, and these controls will be | 3816 | limited to a resident or group list, and these controls will be |
3770 | disabled. Only the 'access denied' list will be used.) | 3817 | disabled. Only the 'access denied' list will be used.) |
3771 | </message> | 3818 | </message> |
3772 | </alert> | 3819 | </alert> |
3773 | <alert modal="true" name="HelpEstateAllowGroup" title="Allow Group Access"> | 3820 | <alert modal="true" name="HelpEstateAllowGroup" title="Allow Group Access"> |
3774 | <message name="message"> | 3821 | <message name="message"> |
3775 | If any group is listed here, access to the estate will be | 3822 | If any group is listed here, access to the estate will be |
3776 | limited to the groups on this list and residents specifically | 3823 | limited to the groups on this list and residents specifically |
3777 | allowed above. | 3824 | allowed above. |
3778 | 3825 | ||
3779 | (If the estate is visible from the mainland, access cannot be | 3826 | (If the estate is visible from the mainland, access cannot be |
3780 | limited to a resident or group list, and these controls will be | 3827 | limited to a resident or group list, and these controls will be |
3781 | disabled. Only the 'access denied' list will be used.) | 3828 | disabled. Only the 'access denied' list will be used.) |
3782 | </message> | 3829 | </message> |
3783 | </alert> | 3830 | </alert> |
3784 | <alert modal="true" name="HelpEstateBanResident" title="Deny Access"> | 3831 | <alert modal="true" name="HelpEstateBanResident" title="Deny Access"> |
3785 | <message name="message"> | 3832 | <message name="message"> |
3786 | Residents on this list are denied access to your estate, | 3833 | Residents on this list are denied access to your estate, |
3787 | regardless of the allow and group settings above. | 3834 | regardless of the allow and group settings above. |
3788 | 3835 | ||
3789 | Adding a resident to this list will remove them from | 3836 | Adding a resident to this list will remove them from |
3790 | the allow list. | 3837 | the allow list. |
3791 | </message> | 3838 | </message> |
3792 | </alert> | 3839 | </alert> |
3793 | <alert modal="true" name="HelpEstateCovenant" title="Estate Covenant"> | 3840 | <alert modal="true" name="HelpEstateCovenant" title="Estate Covenant"> |
3794 | <message name="message"> | 3841 | <message name="message"> |
3795 | Setting an estate covenant enables you to sell parcels | 3842 | Setting an estate covenant enables you to sell parcels |
3796 | within that estate. If a covenant is not set, you cannot | 3843 | within that estate. If a covenant is not set, you cannot |
3797 | sell the land. The notecard for your covenant can be empty | 3844 | sell the land. The notecard for your covenant can be empty |
3798 | if you do not wish to apply any rules or advise buyers of | 3845 | if you do not wish to apply any rules or advise buyers of |
3799 | anything in relation to the land before they buy it. | 3846 | anything in relation to the land before they buy it. |
3800 | 3847 | ||
3801 | A covenant can be used to communicate rules, guidelines, | 3848 | A covenant can be used to communicate rules, guidelines, |
3802 | cultural information or simply your own expectations to the | 3849 | cultural information or simply your own expectations to the |
3803 | prospective buyer. This can include zoning, building regulations, | 3850 | prospective buyer. This can include zoning, building regulations, |
3804 | payment options or any other information you feel it is | 3851 | payment options or any other information you feel it is |
3805 | important for the new owner to have seen and to have agreed | 3852 | important for the new owner to have seen and to have agreed |
3806 | to before they purchase. | 3853 | to before they purchase. |
3807 | 3854 | ||
3808 | The buyer must agree to the covenant by ticking the check box | 3855 | The buyer must agree to the covenant by ticking the check box |
3809 | before they will be able to finish the purchase. Estate | 3856 | before they will be able to finish the purchase. Estate |
3810 | covenants are always visible in the About Land dialog for | 3857 | covenants are always visible in the About Land dialog for |
3811 | any parcels that have one set. | 3858 | any parcels that have one set. |
3812 | </message> | 3859 | </message> |
3813 | </alert> | 3860 | </alert> |
3814 | <alert modal="true" name="BuyObjectOneOnly" title="Can't Buy Objects"> | 3861 | <alert modal="true" name="BuyObjectOneOnly" title="Can't Buy Objects"> |
3815 | <message name="message"> | 3862 | <message name="message"> |
3816 | Unable to buy more than one object at a time. | 3863 | Unable to buy more than one object at a time. |
3817 | Please select only one object and try again. | 3864 | Please select only one object and try again. |
3818 | </message> | 3865 | </message> |
3819 | </alert> | 3866 | </alert> |
3820 | <alert modal="true" name="BuyObjectOneOwner" title="Can't Buy Objects"> | 3867 | <alert modal="true" name="BuyObjectOneOwner" title="Can't Buy Objects"> |
3821 | <message name="message"> | 3868 | <message name="message"> |
3822 | Cannot buy objects from different owners at the same time. | 3869 | Cannot buy objects from different owners at the same time. |
3823 | Please select only one object and try again. | 3870 | Please select only one object and try again. |
3824 | </message> | 3871 | </message> |
3825 | </alert> | 3872 | </alert> |
3826 | <alert modal="true" name="BuyContentsOneOnly" title="Can't Buy Contents"> | 3873 | <alert modal="true" name="BuyContentsOneOnly" title="Can't Buy Contents"> |
3827 | <message name="message"> | 3874 | <message name="message"> |
3828 | Unable to buy the contents of more than one object at a time. | 3875 | Unable to buy the contents of more than one object at a time. |
3829 | Please select only one object and try again. | 3876 | Please select only one object and try again. |
3830 | </message> | 3877 | </message> |
3831 | </alert> | 3878 | </alert> |
3832 | <alert modal="true" name="BuyContentsOneOwner" title="Can't Buy Contents"> | 3879 | <alert modal="true" name="BuyContentsOneOwner" title="Can't Buy Contents"> |
3833 | <message name="message"> | 3880 | <message name="message"> |
3834 | Cannot buy objects from different owners at the same time. | 3881 | Cannot buy objects from different owners at the same time. |
3835 | Please select only one object and try again. | 3882 | Please select only one object and try again. |
3836 | </message> | 3883 | </message> |
3837 | </alert> | 3884 | </alert> |
@@ -3936,9 +3983,9 @@ They will be copied to your inventory. | |||
3936 | <alert modal="true" name="ConfirmPurchase" nodefault="true"> | 3983 | <alert modal="true" name="ConfirmPurchase" nodefault="true"> |
3937 | <message name="message"> | 3984 | <message name="message"> |
3938 | This transaction will: | 3985 | This transaction will: |
3939 | 3986 | ||
3940 | [ACTION] | 3987 | [ACTION] |
3941 | 3988 | ||
3942 | Are you sure you want to proceed with this purchase? | 3989 | Are you sure you want to proceed with this purchase? |
3943 | </message> | 3990 | </message> |
3944 | <option name="Confirm"> | 3991 | <option name="Confirm"> |
@@ -3951,9 +3998,9 @@ Are you sure you want to proceed with this purchase? | |||
3951 | <alert modal="true" name="ConfirmPurchasePassword" nodefault="true"> | 3998 | <alert modal="true" name="ConfirmPurchasePassword" nodefault="true"> |
3952 | <message name="message"> | 3999 | <message name="message"> |
3953 | This transaction will: | 4000 | This transaction will: |
3954 | 4001 | ||
3955 | [ACTION] | 4002 | [ACTION] |
3956 | 4003 | ||
3957 | Are you sure you want to proceed with this purchase? | 4004 | Are you sure you want to proceed with this purchase? |
3958 | Please re-enter your password and click Confirm. | 4005 | Please re-enter your password and click Confirm. |
3959 | </message> | 4006 | </message> |
@@ -3980,7 +4027,7 @@ will retain their original values. | |||
3980 | <message name="message"> | 4027 | <message name="message"> |
3981 | You have selected 'no copy' inventory items. | 4028 | You have selected 'no copy' inventory items. |
3982 | These items will be moved to your inventory, not copied. | 4029 | These items will be moved to your inventory, not copied. |
3983 | 4030 | ||
3984 | Move the inventory item(s)? | 4031 | Move the inventory item(s)? |
3985 | </message> | 4032 | </message> |
3986 | <ignore> | 4033 | <ignore> |
@@ -3995,12 +4042,12 @@ Move the inventory item(s)? | |||
3995 | </alert> | 4042 | </alert> |
3996 | <alert modal="true" name="MoveInventoryFromScriptedObject"> | 4043 | <alert modal="true" name="MoveInventoryFromScriptedObject"> |
3997 | <message name="message"> | 4044 | <message name="message"> |
3998 | You have selected 'no copy' inventory items. These items | 4045 | You have selected 'no copy' inventory items. These items |
3999 | will be moved to your inventory, not copied. | 4046 | will be moved to your inventory, not copied. |
4000 | 4047 | ||
4001 | Because this object is scripted, moving these items | 4048 | Because this object is scripted, moving these items |
4002 | to your inventory may cause the script to malfunction. | 4049 | to your inventory may cause the script to malfunction. |
4003 | 4050 | ||
4004 | Move the inventory item(s)? | 4051 | Move the inventory item(s)? |
4005 | </message> | 4052 | </message> |
4006 | <ignore> | 4053 | <ignore> |
@@ -4015,9 +4062,9 @@ Move the inventory item(s)? | |||
4015 | </alert> | 4062 | </alert> |
4016 | <alert name="ClickActionNotPayable"> | 4063 | <alert name="ClickActionNotPayable"> |
4017 | <message name="message"> | 4064 | <message name="message"> |
4018 | Warning: The Pay Object click action has been set, but it | 4065 | Warning: The Pay Object click action has been set, but it |
4019 | will only work if a script is added with a money() event. | 4066 | will only work if a script is added with a money() event. |
4020 | This is because residents generally expect that objects | 4067 | This is because residents generally expect that objects |
4021 | will react somehow when money is payed into them. | 4068 | will react somehow when money is payed into them. |
4022 | </message> | 4069 | </message> |
4023 | <ignore> | 4070 | <ignore> |
@@ -4045,48 +4092,48 @@ will react somehow when money is payed into them. | |||
4045 | </alert> | 4092 | </alert> |
4046 | <alert modal="true" name="HelpReportAbuseEmailLL" > | 4093 | <alert modal="true" name="HelpReportAbuseEmailLL" > |
4047 | <message name="message"> | 4094 | <message name="message"> |
4048 | Use this tool to report violations of the Terms of Service | 4095 | Use this tool to report violations of the Terms of Service |
4049 | and Community Standards. See: | 4096 | and Community Standards. See: |
4050 | - | 4097 | - |
4051 | http://secondlife.com/corporate/tos.php | 4098 | http://secondlife.com/corporate/tos.php |
4052 | http://secondlife.com/corporate/cs.php | 4099 | http://secondlife.com/corporate/cs.php |
4053 | - | 4100 | - |
4054 | All reported abuses of the Terms of Service and Community Standards | 4101 | All reported abuses of the Terms of Service and Community Standards |
4055 | are investigated and resolved. You will receive an email informing you | 4102 | are investigated and resolved. You will receive an email informing you |
4056 | of the resolution when it occurs. You can also view the incident | 4103 | of the resolution when it occurs. You can also view the incident |
4057 | resolution on the Police Blotter at: | 4104 | resolution on the Police Blotter at: |
4058 | - | 4105 | - |
4059 | http://secondlife.com/community/blotter.php | 4106 | http://secondlife.com/community/blotter.php |
4060 | </message> | 4107 | </message> |
4061 | </alert> | 4108 | </alert> |
4062 | <alert modal="true" name="HelpReportAbuseEmailEO"> | 4109 | <alert modal="true" name="HelpReportAbuseEmailEO"> |
4063 | <message name="message"> | 4110 | <message name="message"> |
4064 | IMPORTANT: This report will go to the owner of the | 4111 | IMPORTANT: This report will go to the owner of the |
4065 | region you are currently in and not to Linden Lab. | 4112 | region you are currently in and not to Linden Lab. |
4066 | - | 4113 | - |
4067 | As a service to residents and visitors, the owner of | 4114 | As a service to residents and visitors, the owner of |
4068 | the region you are in has elected to receive and resolve | 4115 | the region you are in has elected to receive and resolve |
4069 | all reports originating in this region. Linden Lab will | 4116 | all reports originating in this region. Linden Lab will |
4070 | not investigate reports you file from this location. | 4117 | not investigate reports you file from this location. |
4071 | The region owner will resolve reports based on the local | 4118 | The region owner will resolve reports based on the local |
4072 | rules of this region as outlined in the estate Covenant. | 4119 | rules of this region as outlined in the estate Covenant. |
4073 | (View covenants by going to the World menu and selecting | 4120 | (View covenants by going to the World menu and selecting |
4074 | About Land.) | 4121 | About Land.) |
4075 | - | 4122 | - |
4076 | The resolution of this report applies only to this Region; | 4123 | The resolution of this report applies only to this Region; |
4077 | Residents access to other areas of Second Life will not be | 4124 | Residents access to other areas of Second Life will not be |
4078 | affected by the outcome of this report. Only Linden Lab can | 4125 | affected by the outcome of this report. Only Linden Lab can |
4079 | restrict access to the entirety of Second Life. | 4126 | restrict access to the entirety of Second Life. |
4080 | </message> | 4127 | </message> |
4081 | </alert> | 4128 | </alert> |
4082 | <alert modal="true" name="HelpReportBug"> | 4129 | <alert modal="true" name="HelpReportBug"> |
4083 | <message name="message"> | 4130 | <message name="message"> |
4084 | Use this tool to *only* report technical features that do not perform as | 4131 | Use this tool to *only* report technical features that do not perform as |
4085 | described or expected, please provide as much detail as possible, You | 4132 | described or expected, please provide as much detail as possible, You |
4086 | may reply to the auto-response email to add more details to your report. | 4133 | may reply to the auto-response email to add more details to your report. |
4087 | All bug reports are investigated and assessed. No email response will be sent. | 4134 | All bug reports are investigated and assessed. No email response will be sent. |
4088 | - | 4135 | - |
4089 | If you are having a technical difficulty, please contact Support at: | 4136 | If you are having a technical difficulty, please contact Support at: |
4090 | http://secondlife.com/community/support.php | 4137 | http://secondlife.com/community/support.php |
4091 | - | 4138 | - |
4092 | Note: Incomplete reports will not be investigated | 4139 | Note: Incomplete reports will not be investigated |
@@ -4095,42 +4142,42 @@ Note: Incomplete reports will not be investigated | |||
4095 | <alert modal="true" name="HelpReportAbuseSelectCategory"> | 4142 | <alert modal="true" name="HelpReportAbuseSelectCategory"> |
4096 | <message name="message"> | 4143 | <message name="message"> |
4097 | Please select a category for this abuse report. | 4144 | Please select a category for this abuse report. |
4098 | 4145 | ||
4099 | Selecting a category helps us file and process abuse reports. | 4146 | Selecting a category helps us file and process abuse reports. |
4100 | </message> | 4147 | </message> |
4101 | </alert> | 4148 | </alert> |
4102 | <alert modal="true" name="HelpReportBugSelectCategory"> | 4149 | <alert modal="true" name="HelpReportBugSelectCategory"> |
4103 | <message name="message"> | 4150 | <message name="message"> |
4104 | Please select a category for this bug. | 4151 | Please select a category for this bug. |
4105 | 4152 | ||
4106 | Selecting a category helps us file and process bug reports. | 4153 | Selecting a category helps us file and process bug reports. |
4107 | </message> | 4154 | </message> |
4108 | </alert> | 4155 | </alert> |
4109 | <alert modal="true" name="HelpReportAbuseAbuserNameEmpty"> | 4156 | <alert modal="true" name="HelpReportAbuseAbuserNameEmpty"> |
4110 | <message name="message"> | 4157 | <message name="message"> |
4111 | Please enter the name of the abuser. | 4158 | Please enter the name of the abuser. |
4112 | 4159 | ||
4113 | Entering an accurate value helps us file and process abuse reports. | 4160 | Entering an accurate value helps us file and process abuse reports. |
4114 | </message> | 4161 | </message> |
4115 | </alert> | 4162 | </alert> |
4116 | <alert modal="true" name="HelpReportAbuseAbuserLocationEmpty"> | 4163 | <alert modal="true" name="HelpReportAbuseAbuserLocationEmpty"> |
4117 | <message name="message"> | 4164 | <message name="message"> |
4118 | Please enter the location where the abuse took place. | 4165 | Please enter the location where the abuse took place. |
4119 | 4166 | ||
4120 | Entering an accurate value helps us file and process abuse reports. | 4167 | Entering an accurate value helps us file and process abuse reports. |
4121 | </message> | 4168 | </message> |
4122 | </alert> | 4169 | </alert> |
4123 | <alert modal="true" name="HelpReportAbuseSummaryEmpty"> | 4170 | <alert modal="true" name="HelpReportAbuseSummaryEmpty"> |
4124 | <message name="message"> | 4171 | <message name="message"> |
4125 | Please enter a summary of the abuse that took place. | 4172 | Please enter a summary of the abuse that took place. |
4126 | 4173 | ||
4127 | Entering an accurate summary helps us file and process abuse reports. | 4174 | Entering an accurate summary helps us file and process abuse reports. |
4128 | </message> | 4175 | </message> |
4129 | </alert> | 4176 | </alert> |
4130 | <alert modal="true" name="HelpReportBugSummaryEmpty"> | 4177 | <alert modal="true" name="HelpReportBugSummaryEmpty"> |
4131 | <message name="message"> | 4178 | <message name="message"> |
4132 | Please enter a summary of the bug. | 4179 | Please enter a summary of the bug. |
4133 | 4180 | ||
4134 | Entering an accurate summary helps us file and process bug reports. | 4181 | Entering an accurate summary helps us file and process bug reports. |
4135 | </message> | 4182 | </message> |
4136 | </alert> | 4183 | </alert> |
@@ -4139,7 +4186,7 @@ Entering an accurate summary helps us file and process bug reports. | |||
4139 | Please enter a detailed description of the abuse that took place. | 4186 | Please enter a detailed description of the abuse that took place. |
4140 | Be as specific as you can, including names and the details of the | 4187 | Be as specific as you can, including names and the details of the |
4141 | incident you are reporting. | 4188 | incident you are reporting. |
4142 | 4189 | ||
4143 | Entering an accurate description helps us file and process abuse reports. | 4190 | Entering an accurate description helps us file and process abuse reports. |
4144 | </message> | 4191 | </message> |
4145 | </alert> | 4192 | </alert> |
@@ -4148,24 +4195,24 @@ Entering an accurate description helps us file and process abuse reports. | |||
4148 | Please enter a detailed description of the bug. | 4195 | Please enter a detailed description of the bug. |
4149 | Be as specific as you can, including steps to reproduce the bug | 4196 | Be as specific as you can, including steps to reproduce the bug |
4150 | if possible. | 4197 | if possible. |
4151 | 4198 | ||
4152 | Entering an accurate description helps us file and process bug reports. | 4199 | Entering an accurate description helps us file and process bug reports. |
4153 | </message> | 4200 | </message> |
4154 | </alert> | 4201 | </alert> |
4155 | <alert modal="true" name="HelpReportAbuseContainsCopyright"> | 4202 | <alert modal="true" name="HelpReportAbuseContainsCopyright"> |
4156 | <message name="message"> | 4203 | <message name="message"> |
4157 | Dear Resident, | 4204 | Dear Resident, |
4158 | 4205 | ||
4159 | Reports about copyright infringement can only be submitted | 4206 | Reports about copyright infringement can only be submitted |
4160 | as described at http://secondlife.com/corporate/dmca.php. | 4207 | as described at http://secondlife.com/corporate/dmca.php. |
4161 | 4208 | ||
4162 | Reports concerning copyright infringement will automatically | 4209 | Reports concerning copyright infringement will automatically |
4163 | be discarded if they are submitted through the 'Abuse Report' | 4210 | be discarded if they are submitted through the 'Abuse Report' |
4164 | feature. If your report does not relate to copyright infringement, | 4211 | feature. If your report does not relate to copyright infringement, |
4165 | you may close this window and finish submitting your report. | 4212 | you may close this window and finish submitting your report. |
4166 | 4213 | ||
4167 | Thank you, | 4214 | Thank you, |
4168 | 4215 | ||
4169 | Linden Lab | 4216 | Linden Lab |
4170 | </message> | 4217 | </message> |
4171 | </alert> | 4218 | </alert> |
@@ -4195,7 +4242,7 @@ Do you want to replace it with the selected object? | |||
4195 | You are in Busy Mode, which means you will not | 4242 | You are in Busy Mode, which means you will not |
4196 | receive any items offered in exchange for | 4243 | receive any items offered in exchange for |
4197 | this payment. | 4244 | this payment. |
4198 | 4245 | ||
4199 | Would you like to leave Busy Mode before | 4246 | Would you like to leave Busy Mode before |
4200 | completing this transaction? | 4247 | completing this transaction? |
4201 | </message> | 4248 | </message> |
@@ -4242,9 +4289,9 @@ the contents of your Lost And Found folder? | |||
4242 | <alert modal="true" name="CopySLURL"> | 4289 | <alert modal="true" name="CopySLURL"> |
4243 | <message name="message"> | 4290 | <message name="message"> |
4244 | The following SLURL has been copied to your clipboard: | 4291 | The following SLURL has been copied to your clipboard: |
4245 | 4292 | ||
4246 | [SLURL] | 4293 | [SLURL] |
4247 | 4294 | ||
4248 | Put it in a web page to give others easy access to this location or | 4295 | Put it in a web page to give others easy access to this location or |
4249 | try it out yourself by pasting it into the address bar of your web browser. | 4296 | try it out yourself by pasting it into the address bar of your web browser. |
4250 | </message> | 4297 | </message> |
@@ -4288,4 +4335,11 @@ the contents of your Lost And Found folder? | |||
4288 | OK | 4335 | OK |
4289 | </option> | 4336 | </option> |
4290 | </alert> | 4337 | </alert> |
4338 | <alert modal="true" name="Cannot_Purchase_an_Attachment"> | ||
4339 | <message name="message"> | ||
4340 | Items may not be purchased while | ||
4341 | they are part of an attachment. | ||
4342 | </message> | ||
4343 | </alert> | ||
4344 | |||
4291 | </alerts> | 4345 | </alerts> |
diff --git a/linden/indra/newview/skins/xui/en-us/floater_avatar_picker.xml b/linden/indra/newview/skins/xui/en-us/floater_avatar_picker.xml index a0e6a91..71a3bd4 100644 --- a/linden/indra/newview/skins/xui/en-us/floater_avatar_picker.xml +++ b/linden/indra/newview/skins/xui/en-us/floater_avatar_picker.xml | |||
@@ -6,7 +6,7 @@ | |||
6 | <text bg_visible="false" border_drop_shadow_visible="false" border_visible="false" | 6 | <text bg_visible="false" border_drop_shadow_visible="false" border_visible="false" |
7 | bottom="-40" drop_shadow_visible="true" follows="left|top" | 7 | bottom="-40" drop_shadow_visible="true" follows="left|top" |
8 | font="SansSerifSmall" h_pad="0" halign="left" height="16" hidden="false" | 8 | font="SansSerifSmall" h_pad="0" halign="left" height="16" hidden="false" |
9 | left="12" mouse_opaque="true" name="Type part of the person's name:" | 9 | left="12" mouse_opaque="true" name="Type part of the resident's name:" |
10 | v_pad="0" width="220"> | 10 | v_pad="0" width="220"> |
11 | Type part of the resident's name: | 11 | Type part of the resident's name: |
12 | </text> | 12 | </text> |
@@ -24,7 +24,7 @@ | |||
24 | <text bg_visible="false" border_drop_shadow_visible="false" border_visible="false" | 24 | <text bg_visible="false" border_drop_shadow_visible="false" border_visible="false" |
25 | bottom_delta="-24" drop_shadow_visible="true" follows="left|top" | 25 | bottom_delta="-24" drop_shadow_visible="true" follows="left|top" |
26 | font="SansSerifSmall" h_pad="0" halign="left" height="16" hidden="false" | 26 | font="SansSerifSmall" h_pad="0" halign="left" height="16" hidden="false" |
27 | left="12" mouse_opaque="true" name="Or select a calling card:" v_pad="0" | 27 | left="12" mouse_opaque="true" name="Or select their calling card:" v_pad="0" |
28 | width="220"> | 28 | width="220"> |
29 | Or select a calling card: | 29 | Or select a calling card: |
30 | </text> | 30 | </text> |
diff --git a/linden/indra/newview/skins/xui/en-us/floater_inventory.xml b/linden/indra/newview/skins/xui/en-us/floater_inventory.xml index 52af7a3..d9d8eb8 100755..100644 --- a/linden/indra/newview/skins/xui/en-us/floater_inventory.xml +++ b/linden/indra/newview/skins/xui/en-us/floater_inventory.xml | |||
@@ -149,6 +149,11 @@ | |||
149 | name="Folders Always By Name" width="118"> | 149 | name="Folders Always By Name" width="118"> |
150 | <on_click filter="" function="Inventory.SetSortBy" userdata="foldersalwaysbyname" /> | 150 | <on_click filter="" function="Inventory.SetSortBy" userdata="foldersalwaysbyname" /> |
151 | </menu_item_check> | 151 | </menu_item_check> |
152 | <menu_item_check bottom_delta="-18" control_name="Inventory.SystemFoldersToTop" height="18" | ||
153 | hidden="false" label="System Folders To Top" left="0" mouse_opaque="true" | ||
154 | name="System Folders To Top" width="118"> | ||
155 | <on_click filter="" function="Inventory.SetSortBy" userdata="systemfolderstotop" /> | ||
156 | </menu_item_check> | ||
152 | </menu> | 157 | </menu> |
153 | <menu bottom_delta="28" color="0, 0, 0, 1" drop_shadow="true" height="49" | 158 | <menu bottom_delta="28" color="0, 0, 0, 1" drop_shadow="true" height="49" |
154 | hidden="false" label="Filters" left="0" mouse_opaque="false" name="Filters" | 159 | hidden="false" label="Filters" left="0" mouse_opaque="false" name="Filters" |
diff --git a/linden/indra/newview/skins/xui/en-us/floater_lsl_guide.xml b/linden/indra/newview/skins/xui/en-us/floater_lsl_guide.xml index 29d1fa2..773b54b 100644 --- a/linden/indra/newview/skins/xui/en-us/floater_lsl_guide.xml +++ b/linden/indra/newview/skins/xui/en-us/floater_lsl_guide.xml | |||
@@ -1,23 +1,21 @@ | |||
1 | <?xml version="1.0" encoding="utf-8" standalone="yes" ?> | ||
2 | <floater bottom="-500" can_close="true" can_drag_on_left="false" can_minimize="true" | 1 | <floater bottom="-500" can_close="true" can_drag_on_left="false" can_minimize="true" |
3 | can_resize="true" enabled="true" follows="left|top" height="400" | 2 | can_resize="true" enabled="true" follows="left|top" height="400" |
4 | hidden="false" left="306" min_height="271" min_width="350" | 3 | hidden="false" left="306" min_height="271" min_width="350" |
5 | mouse_opaque="true" name="script ed float" | 4 | mouse_opaque="true" name="script ed float" rect_control="LSLHelpRect" |
6 | title="LSL Wiki" width="370"> | 5 | title="LSL Wiki" width="370"> |
7 | <check_box bottom="-45" enabled="true" follows="top|left" font="SansSerif" | 6 | <check_box bottom="-45" enabled="true" follows="top|left" font="SansSerif" halign="center" |
8 | halign="center" height="20" hidden="false" label="Follow cursor" | 7 | height="20" hidden="false" label="Follow cursor" left="10" |
9 | left="10" mouse_opaque="true" name="lock_check" width="60" /> | 8 | mouse_opaque="true" name="lock_check" width="60" /> |
10 | <combo_box bottom_delta="0" enabled="true" follows="top|left|right" font="SansSerif" | 9 | <combo_box allow_text_entry="true" bottom_delta="0" enabled="true" |
11 | halign="center" height="20" hidden="false" label="Lock" | 10 | follows="top|left|right" font="SansSerif" halign="center" height="20" |
12 | left_delta="100" mouse_opaque="true" name="history_combo" | 11 | hidden="false" label="Lock" left_delta="100" mouse_opaque="true" |
13 | width="90" /> | 12 | name="history_combo" width="90" /> |
14 | <button bottom_delta="0" enabled="true" follows="top|right" font="SansSerif" | 13 | <button bottom_delta="0" enabled="true" follows="top|right" font="SansSerif" |
15 | halign="center" height="20" hidden="false" label="Back" | 14 | halign="center" height="20" hidden="false" label="Back" left_delta="95" |
16 | left_delta="95" mouse_opaque="true" name="back_btn" | 15 | mouse_opaque="true" name="back_btn" width="70" /> |
17 | width="70" /> | ||
18 | <button bottom_delta="0" enabled="true" follows="top|right" font="SansSerif" | 16 | <button bottom_delta="0" enabled="true" follows="top|right" font="SansSerif" |
19 | halign="center" height="20" hidden="false" label="Forward" | 17 | halign="center" height="20" hidden="false" label="Forward" left_delta="75" |
20 | left_delta="75" mouse_opaque="true" name="fwd_btn" | 18 | mouse_opaque="true" name="fwd_btn" width="70" /> |
21 | width="70" /> | 19 | <web_browser bottom="10" follows="left|right|top|bottom" left="10" name="lsl_guide_html" |
22 | <web_browser left="10" right="-10" follows="left|right|top|bottom" bottom="10" top="-50" name="lsl_guide_html"/> | 20 | right="-10" top="-50" /> |
23 | </floater> | 21 | </floater> |
diff --git a/linden/indra/newview/skins/xui/en-us/floater_mute.xml b/linden/indra/newview/skins/xui/en-us/floater_mute.xml index bb45932..132f53a 100644 --- a/linden/indra/newview/skins/xui/en-us/floater_mute.xml +++ b/linden/indra/newview/skins/xui/en-us/floater_mute.xml | |||
@@ -11,8 +11,8 @@ | |||
11 | hidden="false" left="4" mouse_opaque="true" multi_select="false" | 11 | hidden="false" left="4" mouse_opaque="true" multi_select="false" |
12 | name="mutes" tool_tip="List of currently muted residents" width="292" /> | 12 | name="mutes" tool_tip="List of currently muted residents" width="292" /> |
13 | <button bottom="-244" enabled="true" follows="left|bottom" font="SansSerif" | 13 | <button bottom="-244" enabled="true" follows="left|bottom" font="SansSerif" |
14 | halign="center" height="20" hidden="false" label="Mute resident..." | 14 | halign="center" height="20" hidden="false" label="Mute Resident..." |
15 | label_selected="Mute resident..." left="4" mouse_opaque="true" | 15 | label_selected="Mute Resident..." left="4" mouse_opaque="true" |
16 | name="Mute resident..." tool_tip="Pick a resident to mute" width="200" /> | 16 | name="Mute resident..." tool_tip="Pick a resident to mute" width="200" /> |
17 | <button bottom="-268" enabled="true" follows="left|bottom" font="SansSerif" | 17 | <button bottom="-268" enabled="true" follows="left|bottom" font="SansSerif" |
18 | halign="center" height="20" hidden="false" label="Mute object by name..." | 18 | halign="center" height="20" hidden="false" label="Mute object by name..." |
diff --git a/linden/indra/newview/skins/xui/en-us/floater_sell_land.xml b/linden/indra/newview/skins/xui/en-us/floater_sell_land.xml index 13e5f2e..13e5f2e 100755..100644 --- a/linden/indra/newview/skins/xui/en-us/floater_sell_land.xml +++ b/linden/indra/newview/skins/xui/en-us/floater_sell_land.xml | |||
diff --git a/linden/indra/newview/skins/xui/en-us/menu_inventory.xml b/linden/indra/newview/skins/xui/en-us/menu_inventory.xml index bd955e3..bd955e3 100755..100644 --- a/linden/indra/newview/skins/xui/en-us/menu_inventory.xml +++ b/linden/indra/newview/skins/xui/en-us/menu_inventory.xml | |||
diff --git a/linden/indra/newview/skins/xui/en-us/menu_pie_attachment.xml b/linden/indra/newview/skins/xui/en-us/menu_pie_attachment.xml index 66e12f0..66e12f0 100755..100644 --- a/linden/indra/newview/skins/xui/en-us/menu_pie_attachment.xml +++ b/linden/indra/newview/skins/xui/en-us/menu_pie_attachment.xml | |||
diff --git a/linden/indra/newview/skins/xui/en-us/menu_pie_avatar.xml b/linden/indra/newview/skins/xui/en-us/menu_pie_avatar.xml index 91e27b7..91e27b7 100755..100644 --- a/linden/indra/newview/skins/xui/en-us/menu_pie_avatar.xml +++ b/linden/indra/newview/skins/xui/en-us/menu_pie_avatar.xml | |||
diff --git a/linden/indra/newview/skins/xui/en-us/menu_pie_land.xml b/linden/indra/newview/skins/xui/en-us/menu_pie_land.xml index cb06ebf..cb06ebf 100755..100644 --- a/linden/indra/newview/skins/xui/en-us/menu_pie_land.xml +++ b/linden/indra/newview/skins/xui/en-us/menu_pie_land.xml | |||
diff --git a/linden/indra/newview/skins/xui/en-us/menu_pie_object.xml b/linden/indra/newview/skins/xui/en-us/menu_pie_object.xml index e59ac38..e59ac38 100755..100644 --- a/linden/indra/newview/skins/xui/en-us/menu_pie_object.xml +++ b/linden/indra/newview/skins/xui/en-us/menu_pie_object.xml | |||
diff --git a/linden/indra/newview/skins/xui/en-us/menu_pie_self.xml b/linden/indra/newview/skins/xui/en-us/menu_pie_self.xml index 82113d4..82113d4 100755..100644 --- a/linden/indra/newview/skins/xui/en-us/menu_pie_self.xml +++ b/linden/indra/newview/skins/xui/en-us/menu_pie_self.xml | |||
diff --git a/linden/indra/newview/skins/xui/en-us/menu_viewer.xml b/linden/indra/newview/skins/xui/en-us/menu_viewer.xml index d964ec3..6d4840f 100755..100644 --- a/linden/indra/newview/skins/xui/en-us/menu_viewer.xml +++ b/linden/indra/newview/skins/xui/en-us/menu_viewer.xml | |||
@@ -39,6 +39,12 @@ | |||
39 | <on_click function="File.CloseWindow" userdata="" /> | 39 | <on_click function="File.CloseWindow" userdata="" /> |
40 | <on_enable function="File.EnableCloseWindow" userdata="" /> | 40 | <on_enable function="File.EnableCloseWindow" userdata="" /> |
41 | </menu_item_call> | 41 | </menu_item_call> |
42 | <menu_item_call bottom="-113" enabled="true" height="19" hidden="false" label="Close All Windows" | ||
43 | left="0" mouse_opaque="true" name="Close All Windows" shortcut="control|shift|W" | ||
44 | width="243"> | ||
45 | <on_click function="File.CloseAllWindows" userdata="" /> | ||
46 | <on_enable function="File.EnableCloseWindow" userdata="" /> | ||
47 | </menu_item_call> | ||
42 | <menu_item_separator bottom="-121" enabled="true" height="8" hidden="false" label="-----------" | 48 | <menu_item_separator bottom="-121" enabled="true" height="8" hidden="false" label="-----------" |
43 | left="0" mouse_opaque="true" name="separator2" width="243" /> | 49 | left="0" mouse_opaque="true" name="separator2" width="243" /> |
44 | <menu_item_call bottom="-140" enabled="true" height="19" hidden="false" | 50 | <menu_item_call bottom="-140" enabled="true" height="19" hidden="false" |
@@ -771,12 +777,43 @@ | |||
771 | <on_click function="Tools.SelectedScriptAction" userdata="stop" /> | 777 | <on_click function="Tools.SelectedScriptAction" userdata="stop" /> |
772 | <on_enable function="EditableSelected" /> | 778 | <on_enable function="EditableSelected" /> |
773 | </menu_item_call> | 779 | </menu_item_call> |
774 | <menu_item_separator bottom="-411" enabled="true" height="8" hidden="false" label="-----------" | 780 | <menu_item_separator bottom="-411" enabled="true" height="8" hidden="false" label="-----------" |
775 | left="0" mouse_opaque="true" name="separator6" width="250" /> | 781 | left="0" mouse_opaque="true" name="separator7" width="250" /> |
776 | <menu_item_call bottom="-240" enabled="true" height="19" hidden="false" label="Report Bug..." | 782 | <menu bottom="-554" color="0 0 0 1" drop_shadow="true" enabled="true" height="109" |
783 | hidden="false" label="Bug Reporting" left="0" mouse_opaque="false" | ||
784 | name="Select Tool" opaque="true" tear_off="true" create_jump_keys="true" | ||
785 | width="118"> | ||
786 | <menu_item_call bottom="-240" enabled="true" height="19" hidden="false" label="Report Bug..." | ||
777 | left="0" mouse_opaque="true" name="Report Bug..." width="166"> | 787 | left="0" mouse_opaque="true" name="Report Bug..." width="166"> |
778 | <on_click function="ShowFloater" userdata="bug reporter" /> | 788 | <on_click function="ShowFloater" userdata="bug reporter" /> |
779 | </menu_item_call> | 789 | </menu_item_call> |
790 | <menu_item_call bottom="-94" enabled="true" height="19" hidden="false" | ||
791 | label="Bug Reporting 101..." left="0" mouse_opaque="true" | ||
792 | name="Bug Reporing 101..." width="166"> | ||
793 | <on_click function="PromptShowURL" | ||
794 | userdata="WebLaunchBugReport101,https://wiki.secondlife.com/wiki/Bug_Reporting_101" /> | ||
795 | </menu_item_call> | ||
796 | <menu_item_call bottom="-94" enabled="true" height="19" hidden="false" | ||
797 | label="Security Issues..." left="0" mouse_opaque="true" | ||
798 | name="Security Issues..." width="166"> | ||
799 | <on_click function="PromptShowURL" | ||
800 | userdata="WebLaunchSecurityIssues,https://wiki.secondlife.com/wiki/Security_issues" /> | ||
801 | </menu_item_call> | ||
802 | <menu_item_separator bottom="-411" enabled="true" height="8" hidden="false" label="-----------" | ||
803 | left="0" mouse_opaque="true" name="separator7" width="250" /> | ||
804 | <menu_item_call bottom="-94" enabled="true" height="19" hidden="false" | ||
805 | label="Public Issue Tracker..." left="0" mouse_opaque="true" | ||
806 | name="Public Issue Tracker..." width="166"> | ||
807 | <on_click function="PromptShowURL" | ||
808 | userdata="WebLaunchPublicIssue,https://jira.secondlife.com" /> | ||
809 | </menu_item_call> | ||
810 | <menu_item_call bottom="-94" enabled="true" height="19" hidden="false" | ||
811 | label="Public Issue Tracker Help..." left="0" mouse_opaque="true" | ||
812 | name="Publc Issue Tracker Help..." width="166"> | ||
813 | <on_click function="PromptShowURL" | ||
814 | userdata="WebLaunchPublicIssueHelp,https://wiki.secondlife.com/wiki/Issue_tracker" /> | ||
815 | </menu_item_call> | ||
816 | </menu> | ||
780 | </menu> | 817 | </menu> |
781 | <menu bottom="219" color="0 0 0 1" drop_shadow="true" enabled="true" height="317" | 818 | <menu bottom="219" color="0 0 0 1" drop_shadow="true" enabled="true" height="317" |
782 | hidden="false" label="Help" left="227" mouse_opaque="false" name="Help" | 819 | hidden="false" label="Help" left="227" mouse_opaque="false" name="Help" |
diff --git a/linden/indra/newview/skins/xui/en-us/notify.xml b/linden/indra/newview/skins/xui/en-us/notify.xml index 291b1b8..54451ab 100644 --- a/linden/indra/newview/skins/xui/en-us/notify.xml +++ b/linden/indra/newview/skins/xui/en-us/notify.xml | |||
@@ -420,7 +420,7 @@ No scripts will run except those belonging to the land owner. | |||
420 | </notify> | 420 | </notify> |
421 | <notify name="ObjectGiveItem" tip="false"> | 421 | <notify name="ObjectGiveItem" tip="false"> |
422 | <message name="message"> | 422 | <message name="message"> |
423 | An object named [OBJECTFROMNAME] owned by [FIRST] [LAST] has given you a [OBJECTTYPE] named '[OBJECTNAME]'. | 423 | An object named [OBJECTFROMNAME] owned by [FIRST] [LAST] has given you a [OBJECTTYPE] named [OBJECTNAME]. |
424 | </message> | 424 | </message> |
425 | <option name="Keep"> | 425 | <option name="Keep"> |
426 | Keep | 426 | Keep |
@@ -434,7 +434,7 @@ No scripts will run except those belonging to the land owner. | |||
434 | </notify> | 434 | </notify> |
435 | <notify name="ObjectGiveItemUnknownUser" tip="false"> | 435 | <notify name="ObjectGiveItemUnknownUser" tip="false"> |
436 | <message name="message"> | 436 | <message name="message"> |
437 | An object named [OBJECTFROMNAME] owned by (an unknown user) has given you a [OBJECTTYPE] named '[OBJECTNAME]'. | 437 | An object named [OBJECTFROMNAME] owned by (an unknown user) has given you a [OBJECTTYPE] named [OBJECTNAME]. |
438 | </message> | 438 | </message> |
439 | <option name="Keep"> | 439 | <option name="Keep"> |
440 | Keep | 440 | Keep |
diff --git a/linden/indra/newview/skins/xui/en-us/panel_preferences_general.xml b/linden/indra/newview/skins/xui/en-us/panel_preferences_general.xml index a92155a..8297887 100644 --- a/linden/indra/newview/skins/xui/en-us/panel_preferences_general.xml +++ b/linden/indra/newview/skins/xui/en-us/panel_preferences_general.xml | |||
@@ -69,12 +69,11 @@ | |||
69 | label="Notify when Linden dollars (L$) spent or received" left="148" | 69 | label="Notify when Linden dollars (L$) spent or received" left="148" |
70 | mouse_opaque="true" name="notify_money_change_checkbox" radio_style="false" | 70 | mouse_opaque="true" name="notify_money_change_checkbox" radio_style="false" |
71 | width="256" /> | 71 | width="256" /> |
72 | <check_box bottom="-326" control_name="ProbeHardwareOnStartup" enabled="true" | 72 | <check_box bottom="-326" control_name="ShowNewInventory" enabled="true" |
73 | follows="left|top" font="SansSerifSmall" height="16" hidden="false" | 73 | follows="left|top" font="SansSerifSmall" height="16" hidden="false" |
74 | initial_value="false" label="Auto-detect graphics hardware on next startup" | 74 | initial_value="false" label="Automatic previews of new notecards/textures/landmarks" |
75 | left="148" mouse_opaque="true" name="probe_hardware_checkbox" | 75 | left="148" mouse_opaque="true" name="show_new_inventory" |
76 | radio_style="false" | 76 | radio_style="false" |
77 | tool_tip="Second Life automatically configures some graphics settings based on your hardware. If you install new hardware, you should have Second Life detect it again." | ||
78 | width="270" /> | 77 | width="270" /> |
79 | <check_box bottom="-344" control_name="UseDefaultColorPicker" enabled="true" | 78 | <check_box bottom="-344" control_name="UseDefaultColorPicker" enabled="true" |
80 | follows="left|top" font="SansSerifSmall" height="16" hidden="false" | 79 | follows="left|top" font="SansSerifSmall" height="16" hidden="false" |
diff --git a/linden/indra/newview/skins/xui/en-us/panel_preferences_graphics3.xml b/linden/indra/newview/skins/xui/en-us/panel_preferences_graphics3.xml index 3a1f32e..fd48f34 100644 --- a/linden/indra/newview/skins/xui/en-us/panel_preferences_graphics3.xml +++ b/linden/indra/newview/skins/xui/en-us/panel_preferences_graphics3.xml | |||
@@ -109,4 +109,11 @@ | |||
109 | increment="1" initial_val="1" label="Debug Beacon Line Width:" | 109 | increment="1" initial_val="1" label="Debug Beacon Line Width:" |
110 | label_width="138" left="10" max_val="127" min_val="1" mouse_opaque="true" | 110 | label_width="138" left="10" max_val="127" min_val="1" mouse_opaque="true" |
111 | name="debug beacon line width" width="202" /> | 111 | name="debug beacon line width" width="202" /> |
112 | <check_box bottom="-304" control_name="ProbeHardwareOnStartup" enabled="true" | ||
113 | follows="left|top" font="SansSerifSmall" height="16" hidden="false" | ||
114 | initial_value="false" label="Auto-detect graphics hardware on next startup" | ||
115 | left="148" mouse_opaque="true" name="probe_hardware_checkbox" | ||
116 | radio_style="false" | ||
117 | tool_tip="Second Life automatically configures some graphics settings based on your hardware. If you install new hardware, you should have Second Life detect it again." | ||
118 | width="270" /> | ||
112 | </panel> | 119 | </panel> |
diff --git a/linden/indra/newview/skins/xui/en-us/panel_status_bar.xml b/linden/indra/newview/skins/xui/en-us/panel_status_bar.xml index 2ee26d1..9feaafc 100644 --- a/linden/indra/newview/skins/xui/en-us/panel_status_bar.xml +++ b/linden/indra/newview/skins/xui/en-us/panel_status_bar.xml | |||
@@ -18,7 +18,7 @@ | |||
18 | halign="right" height="18" hidden="false" left="-120" mouse_opaque="true" | 18 | halign="right" height="18" hidden="false" left="-120" mouse_opaque="true" |
19 | name="BalanceText" text_color="0 1 0 1" tool_tip="Account Balance" | 19 | name="BalanceText" text_color="0 1 0 1" tool_tip="Account Balance" |
20 | v_pad="2" width="76"> | 20 | v_pad="2" width="76"> |
21 | L$ | 21 | Loading... |
22 | </text> | 22 | </text> |
23 | <button bottom="-18" enabled="true" follows="right|bottom" font="SansSerif" | 23 | <button bottom="-18" enabled="true" follows="right|bottom" font="SansSerif" |
24 | halign="center" height="16" hidden="false" | 24 | halign="center" height="16" hidden="false" |
diff --git a/linden/indra/newview/viewer.cpp b/linden/indra/newview/viewer.cpp index c42ac69..b71c6f2 100644 --- a/linden/indra/newview/viewer.cpp +++ b/linden/indra/newview/viewer.cpp | |||
@@ -27,6 +27,9 @@ | |||
27 | */ | 27 | */ |
28 | 28 | ||
29 | #include "llviewerprecompiledheaders.h" | 29 | #include "llviewerprecompiledheaders.h" |
30 | |||
31 | #include "viewer.h" | ||
32 | |||
30 | #include "llparcel.h" | 33 | #include "llparcel.h" |
31 | #include "llviewerparcelmgr.h" | 34 | #include "llviewerparcelmgr.h" |
32 | #include "llviewerjoystick.h" | 35 | #include "llviewerjoystick.h" |
@@ -104,8 +107,6 @@ | |||
104 | //#define LL_SEND_CRASH_REPORTS 0 | 107 | //#define LL_SEND_CRASH_REPORTS 0 |
105 | 108 | ||
106 | 109 | ||
107 | #include "viewer.h" | ||
108 | |||
109 | // | 110 | // |
110 | // Linden library headers | 111 | // Linden library headers |
111 | // | 112 | // |
@@ -411,8 +412,6 @@ LLFrameTimer gRestoreGLTimer; | |||
411 | BOOL gRestoreGL = FALSE; | 412 | BOOL gRestoreGL = FALSE; |
412 | 413 | ||
413 | 414 | ||
414 | LLGlobalEconomy *gGlobalEconomy = NULL; | ||
415 | |||
416 | // VFS globals - see viewer.h | 415 | // VFS globals - see viewer.h |
417 | LLVFS* gStaticVFS = NULL; | 416 | LLVFS* gStaticVFS = NULL; |
418 | 417 | ||
@@ -485,6 +484,7 @@ static const char USAGE[] = "\n" | |||
485 | "usage:\tviewer [options]\n" | 484 | "usage:\tviewer [options]\n" |
486 | "options:\n" | 485 | "options:\n" |
487 | " -login <first> <last> <password> log in as a user\n" | 486 | " -login <first> <last> <password> log in as a user\n" |
487 | " -autologin log in as last saved user\n" | ||
488 | " -loginuri <URI> login server and CGI script to use\n" | 488 | " -loginuri <URI> login server and CGI script to use\n" |
489 | " -helperuri <URI> helper web CGI prefix to use\n" | 489 | " -helperuri <URI> helper web CGI prefix to use\n" |
490 | " -settings <filename> specify the filename of a\n" | 490 | " -settings <filename> specify the filename of a\n" |
@@ -515,6 +515,8 @@ static const char USAGE[] = "\n" | |||
515 | #if LL_WINDOWS | 515 | #if LL_WINDOWS |
516 | " -noprobe disable hardware probe\n" | 516 | " -noprobe disable hardware probe\n" |
517 | #endif | 517 | #endif |
518 | " -noquicktime disable QuickTime movies, speeds startup\n" | ||
519 | " -nopreload don't preload UI images or sounds, speeds startup\n" | ||
518 | // these seem to be unused | 520 | // these seem to be unused |
519 | //" -noenv turn off environmental effects\n" | 521 | //" -noenv turn off environmental effects\n" |
520 | //" -proxy <proxy_ip> specify the proxy ip address\n" | 522 | //" -proxy <proxy_ip> specify the proxy ip address\n" |
@@ -536,6 +538,8 @@ std::string gChannelName = "Second Life Release"; | |||
536 | 538 | ||
537 | LLUUID gInventoryLibraryOwner; | 539 | LLUUID gInventoryLibraryOwner; |
538 | LLUUID gInventoryLibraryRoot; | 540 | LLUUID gInventoryLibraryRoot; |
541 | bool gPreloadImages = true; | ||
542 | bool gPreloadSounds = true; | ||
539 | 543 | ||
540 | LLString gCmdLineFirstName; | 544 | LLString gCmdLineFirstName; |
541 | LLString gCmdLineLastName; | 545 | LLString gCmdLineLastName; |
@@ -4035,7 +4039,7 @@ void init_audio() | |||
4035 | 4039 | ||
4036 | BOOL mute_audio = gSavedSettings.getBOOL("MuteAudio"); | 4040 | BOOL mute_audio = gSavedSettings.getBOOL("MuteAudio"); |
4037 | 4041 | ||
4038 | if (!mute_audio) | 4042 | if (!mute_audio && gPreloadSounds) |
4039 | { | 4043 | { |
4040 | gAudiop->preloadSound(LLUUID(gSavedSettings.getString("UISndAlert"))); | 4044 | gAudiop->preloadSound(LLUUID(gSavedSettings.getString("UISndAlert"))); |
4041 | gAudiop->preloadSound(LLUUID(gSavedSettings.getString("UISndBadKeystroke"))); | 4045 | gAudiop->preloadSound(LLUUID(gSavedSettings.getString("UISndBadKeystroke"))); |
@@ -4198,8 +4202,13 @@ BOOL add_object( LLPCode pcode, S32 x, S32 y, U8 use_physics ) | |||
4198 | return FALSE; | 4202 | return FALSE; |
4199 | } | 4203 | } |
4200 | 4204 | ||
4201 | if (regionp | 4205 | if (NULL == regionp) |
4202 | && (regionp->getRegionFlags() & REGION_FLAGS_SANDBOX)) | 4206 | { |
4207 | llwarns << "regionp was NULL; aborting function." << llendl; | ||
4208 | return FALSE; | ||
4209 | } | ||
4210 | |||
4211 | if (regionp->getRegionFlags() & REGION_FLAGS_SANDBOX) | ||
4203 | { | 4212 | { |
4204 | LLFirstUse::useSandbox(); | 4213 | LLFirstUse::useSandbox(); |
4205 | } | 4214 | } |
@@ -5692,6 +5701,19 @@ int parse_args(int argc, char **argv) | |||
5692 | { | 5701 | { |
5693 | gProbeHardware = FALSE; | 5702 | gProbeHardware = FALSE; |
5694 | } | 5703 | } |
5704 | else if (!strcmp(argv[j], "-noquicktime")) | ||
5705 | { | ||
5706 | // Developers can log in faster if they don't load all the | ||
5707 | // quicktime dlls. | ||
5708 | gUseQuickTime = false; | ||
5709 | } | ||
5710 | else if (!strcmp(argv[j], "-nopreload")) | ||
5711 | { | ||
5712 | // Developers can log in faster if they don't decode sounds | ||
5713 | // or images on startup, ~5 seconds faster. | ||
5714 | gPreloadSounds = false; | ||
5715 | gPreloadImages = false; | ||
5716 | } | ||
5695 | else if (!strcmp(argv[j], "-purge")) | 5717 | else if (!strcmp(argv[j], "-purge")) |
5696 | { | 5718 | { |
5697 | purge_cache(); | 5719 | purge_cache(); |
diff --git a/linden/indra/newview/viewer.h b/linden/indra/newview/viewer.h index f082e99..141206c 100644 --- a/linden/indra/newview/viewer.h +++ b/linden/indra/newview/viewer.h | |||
@@ -29,44 +29,41 @@ | |||
29 | #ifndef LL_VIEWER_H | 29 | #ifndef LL_VIEWER_H |
30 | #define LL_VIEWER_H | 30 | #define LL_VIEWER_H |
31 | 31 | ||
32 | #include "stdtypes.h" | 32 | // DO NOT ADD DEPENDENCIES HERE |
33 | #include "v3math.h" | 33 | // Almost every file in the viewer depends on this file. |
34 | #include "llcoord.h" | 34 | // If you need to add a shared class, put it in its own |
35 | 35 | // little file. JC | |
36 | #include "lltimer.h" | ||
37 | #include "llframetimer.h" | ||
38 | #include "lluuid.h" | ||
39 | #include "llsys.h" | ||
40 | #include "lltransactiontypes.h" | 36 | #include "lltransactiontypes.h" |
41 | #include "llviewercontrol.h" | 37 | #include "llviewercontrol.h" |
42 | 38 | ||
43 | // ************************************************************ | ||
44 | // Enabled this definition to compile a 'hacked' viewer that | 39 | // Enabled this definition to compile a 'hacked' viewer that |
45 | // allows a hacked godmode to be toggled on and off. | 40 | // allows a hacked godmode to be toggled on and off. |
46 | #define TOGGLE_HACKED_GODLIKE_VIEWER | 41 | #define TOGGLE_HACKED_GODLIKE_VIEWER |
47 | |||
48 | #ifdef TOGGLE_HACKED_GODLIKE_VIEWER | 42 | #ifdef TOGGLE_HACKED_GODLIKE_VIEWER |
49 | extern BOOL gHackGodmode; | 43 | extern BOOL gHackGodmode; |
50 | #endif | 44 | #endif |
51 | // ************************************************************ | 45 | |
52 | 46 | ||
53 | // | 47 | // |
54 | // Forward Declarations | 48 | // Forward Declarations |
55 | // | 49 | // |
56 | class LLVector3d; | 50 | class LLAudioEngine; |
57 | class LLViewerObject; | 51 | class LLFrameTimer; |
58 | class LLMessageSystem; | 52 | class LLMessageSystem; |
59 | class LLHost; | 53 | class LLHost; |
60 | class LLAudioEngine; | ||
61 | class LLViewerRegion; | ||
62 | class LLVFS; | ||
63 | class LLGlobalEconomy; | ||
64 | class LLPieMenu; | 54 | class LLPieMenu; |
65 | class LLWorkerThread; | 55 | class LLWorkerThread; |
66 | class LLTextureFetch; | 56 | class LLTextureFetch; |
67 | class LLTextureCache; | 57 | class LLTextureCache; |
68 | class LLPumpIO; | 58 | class LLPumpIO; |
69 | class LLHTTPNode; | 59 | class LLHTTPNode; |
60 | class LLTimer; | ||
61 | class LLUUID; | ||
62 | class LLVector3; | ||
63 | class LLVector3d; | ||
64 | class LLViewerObject; | ||
65 | class LLViewerRegion; | ||
66 | class LLVFS; | ||
70 | 67 | ||
71 | // | 68 | // |
72 | // Global Variables | 69 | // Global Variables |
@@ -79,6 +76,7 @@ extern BOOL gNoRender; | |||
79 | extern LLMemoryInfo gSysMemory; | 76 | extern LLMemoryInfo gSysMemory; |
80 | extern BOOL gLogMessages; | 77 | extern BOOL gLogMessages; |
81 | extern BOOL gUseAudio; | 78 | extern BOOL gUseAudio; |
79 | extern bool gPreloadImages; | ||
82 | extern BOOL gConnectToSomething; | 80 | extern BOOL gConnectToSomething; |
83 | extern BOOL gGodConnect; | 81 | extern BOOL gGodConnect; |
84 | extern BOOL gRunLocal; | 82 | extern BOOL gRunLocal; |
@@ -143,8 +141,6 @@ extern BOOL gShowObjectUpdates; | |||
143 | extern BOOL gTeleportDisplay; | 141 | extern BOOL gTeleportDisplay; |
144 | extern LLFrameTimer gTeleportDisplayTimer; | 142 | extern LLFrameTimer gTeleportDisplayTimer; |
145 | 143 | ||
146 | extern LLGlobalEconomy *gGlobalEconomy; | ||
147 | |||
148 | extern std::map<S32,LLFrameTimer> gDebugTimers; | 144 | extern std::map<S32,LLFrameTimer> gDebugTimers; |
149 | 145 | ||
150 | // VFS globals - gVFS is for general use | 146 | // VFS globals - gVFS is for general use |
diff --git a/linden/indra/newview/viewer_manifest.py b/linden/indra/newview/viewer_manifest.py index 0c8ef60..2f4eb7c 100755 --- a/linden/indra/newview/viewer_manifest.py +++ b/linden/indra/newview/viewer_manifest.py | |||
@@ -84,7 +84,6 @@ class ViewerManifest(LLManifest): | |||
84 | self.end_prefix("html/*") | 84 | self.end_prefix("html/*") |
85 | self.end_prefix("skins") | 85 | self.end_prefix("skins") |
86 | 86 | ||
87 | self.path("featuretable.txt") | ||
88 | self.path("releasenotes.txt") | 87 | self.path("releasenotes.txt") |
89 | self.path("lsl_guide.html") | 88 | self.path("lsl_guide.html") |
90 | self.path("gpu_table.txt") | 89 | self.path("gpu_table.txt") |
@@ -135,6 +134,8 @@ class WindowsManifest(ViewerManifest): | |||
135 | self.path(self.find_existing_file('ReleaseForDownload/llkdu.dll', 'llkdu.dll', '../../libraries/i686-win32/lib_release/llkdu.dll'), dst='llkdu.dll') | 134 | self.path(self.find_existing_file('ReleaseForDownload/llkdu.dll', 'llkdu.dll', '../../libraries/i686-win32/lib_release/llkdu.dll'), dst='llkdu.dll') |
136 | self.path(src="licenses-win32.txt", dst="licenses.txt") | 135 | self.path(src="licenses-win32.txt", dst="licenses.txt") |
137 | 136 | ||
137 | self.path("featuretable.txt") | ||
138 | |||
138 | # For use in crash reporting (generates minidumps) | 139 | # For use in crash reporting (generates minidumps) |
139 | self.path("dbghelp.dll") | 140 | self.path("dbghelp.dll") |
140 | 141 | ||
@@ -408,6 +409,8 @@ class Linux_i686Manifest(LinuxManifest): | |||
408 | # recurse | 409 | # recurse |
409 | self.end_prefix("res-sdl") | 410 | self.end_prefix("res-sdl") |
410 | 411 | ||
412 | self.path("featuretable_linux.txt") | ||
413 | |||
411 | self.path("app_settings/mozilla-runtime-linux-i686") | 414 | self.path("app_settings/mozilla-runtime-linux-i686") |
412 | 415 | ||
413 | if self.prefix("../../libraries/i686-linux/lib_release_client", "lib"): | 416 | if self.prefix("../../libraries/i686-linux/lib_release_client", "lib"): |
diff --git a/linden/indra/test/common.cpp b/linden/indra/test/common.cpp index 2a88ba0..d32a4ca 100644 --- a/linden/indra/test/common.cpp +++ b/linden/indra/test/common.cpp | |||
@@ -305,7 +305,7 @@ namespace tut | |||
305 | template<> template<> | 305 | template<> template<> |
306 | void sd_object::test<13>() | 306 | void sd_object::test<13>() |
307 | { | 307 | { |
308 | for(S32 i = 0; i < 10000; ++i) | 308 | for(S32 i = 0; i < 1000; ++i) |
309 | { | 309 | { |
310 | // gen up a starting point | 310 | // gen up a starting point |
311 | std::string expected; | 311 | std::string expected; |
diff --git a/linden/indra/test/files.lst b/linden/indra/test/files.lst index b04b0ac..74f8879 100644 --- a/linden/indra/test/files.lst +++ b/linden/indra/test/files.lst | |||
@@ -7,6 +7,7 @@ test/llblowfish_tut.cpp | |||
7 | test/llerror_tut.cpp | 7 | test/llerror_tut.cpp |
8 | test/llhttpclient_tut.cpp | 8 | test/llhttpclient_tut.cpp |
9 | test/llhttpnode_tut.cpp | 9 | test/llhttpnode_tut.cpp |
10 | test/llinventoryparcel_tut.cpp | ||
10 | test/lliohttpserver_tut.cpp | 11 | test/lliohttpserver_tut.cpp |
11 | test/llmime_tut.cpp | 12 | test/llmime_tut.cpp |
12 | test/llmessageconfig_tut.cpp | 13 | test/llmessageconfig_tut.cpp |
@@ -20,6 +21,7 @@ test/llservicebuilder_tut.cpp | |||
20 | test/lltiming_tut.cpp | 21 | test/lltiming_tut.cpp |
21 | test/lltut.cpp | 22 | test/lltut.cpp |
22 | test/lluri_tut.cpp | 23 | test/lluri_tut.cpp |
24 | test/llxfer_tut.cpp | ||
23 | test/math.cpp | 25 | test/math.cpp |
24 | test/reflection_tut.cpp | 26 | test/reflection_tut.cpp |
25 | test/test.cpp | 27 | test/test.cpp |
diff --git a/linden/indra/test/llbitpack_tut.cpp b/linden/indra/test/llbitpack_tut.cpp new file mode 100644 index 0000000..1040a96 --- /dev/null +++ b/linden/indra/test/llbitpack_tut.cpp | |||
@@ -0,0 +1,119 @@ | |||
1 | /** | ||
2 | * @file llbitpack_tut.cpp | ||
3 | * @author Adroit | ||
4 | * @date February 2007 | ||
5 | * @brief llstreamtools test cases. | ||
6 | * | ||
7 | * Copyright (c) 2007-2007, Linden Research, Inc. | ||
8 | * | ||
9 | * The source code in this file ("Source Code") is provided by Linden Lab | ||
10 | * to you under the terms of the GNU General Public License, version 2.0 | ||
11 | * ("GPL"), unless you have obtained a separate licensing agreement | ||
12 | * ("Other License"), formally executed by you and Linden Lab. Terms of | ||
13 | * the GPL can be found in doc/GPL-license.txt in this distribution, or | ||
14 | * online at http://secondlife.com/developers/opensource/gplv2 | ||
15 | * | ||
16 | * There are special exceptions to the terms and conditions of the GPL as | ||
17 | * it is applied to this Source Code. View the full text of the exception | ||
18 | * in the file doc/FLOSS-exception.txt in this software distribution, or | ||
19 | * online at http://secondlife.com/developers/opensource/flossexception | ||
20 | * | ||
21 | * By copying, modifying or distributing this software, you acknowledge | ||
22 | * that you have read and understood your obligations described above, | ||
23 | * and agree to abide by those obligations. | ||
24 | * | ||
25 | * ALL LINDEN LAB SOURCE CODE IS PROVIDED "AS IS." LINDEN LAB MAKES NO | ||
26 | * WARRANTIES, EXPRESS, IMPLIED OR OTHERWISE, REGARDING ITS ACCURACY, | ||
27 | * COMPLETENESS OR PERFORMANCE. | ||
28 | */ | ||
29 | |||
30 | #include <tut/tut.h> | ||
31 | #include "linden_common.h" | ||
32 | #include "bitpack.h" | ||
33 | #include "lltut.h" | ||
34 | |||
35 | |||
36 | namespace tut | ||
37 | { | ||
38 | struct bit_pack | ||
39 | { | ||
40 | }; | ||
41 | typedef test_group<bit_pack> bit_pack_t; | ||
42 | typedef bit_pack_t::object bit_pack_object_t; | ||
43 | tut::bit_pack_t tut_bit_pack("bitpack"); | ||
44 | |||
45 | // pack -> unpack | ||
46 | template<> template<> | ||
47 | void bit_pack_object_t::test<1>() | ||
48 | { | ||
49 | U8 packbuffer[255]; | ||
50 | U8 unpackbuffer[255]; | ||
51 | int pack_bufsize = 0; | ||
52 | int unpack_bufsize = 0; | ||
53 | |||
54 | LLBitPack bitpack(packbuffer, 255); | ||
55 | |||
56 | char str[] = "SecondLife is a 3D virtual world"; | ||
57 | int len = sizeof(str); | ||
58 | pack_bufsize = bitpack.bitPack((U8*) str, len*8); | ||
59 | pack_bufsize = bitpack.flushBitPack(); | ||
60 | |||
61 | LLBitPack bitunpack(packbuffer, pack_bufsize*8); | ||
62 | unpack_bufsize = bitunpack.bitUnpack(unpackbuffer, len*8); | ||
63 | ensure("bitPack: unpack size should be same as string size prior to pack", len == unpack_bufsize); | ||
64 | ensure_memory_matches("str->bitPack->bitUnpack should be equal to string", str, len, unpackbuffer, unpack_bufsize); | ||
65 | } | ||
66 | |||
67 | // pack large, unpack in individual bytes | ||
68 | template<> template<> | ||
69 | void bit_pack_object_t::test<2>() | ||
70 | { | ||
71 | U8 packbuffer[255]; | ||
72 | U8 unpackbuffer[255]; | ||
73 | int pack_bufsize = 0; | ||
74 | int unpack_bufsize = 0; | ||
75 | |||
76 | LLBitPack bitpack(packbuffer, 255); | ||
77 | |||
78 | char str[] = "SecondLife"; | ||
79 | int len = sizeof(str); | ||
80 | pack_bufsize = bitpack.bitPack((U8*) str, len*8); | ||
81 | pack_bufsize = bitpack.flushBitPack(); | ||
82 | |||
83 | LLBitPack bitunpack(packbuffer, pack_bufsize*8); | ||
84 | unpack_bufsize = bitunpack.bitUnpack(&unpackbuffer[0], 8); | ||
85 | ensure("bitPack: individual unpack: 0", unpackbuffer[0] == (U8) str[0]); | ||
86 | unpack_bufsize = bitunpack.bitUnpack(&unpackbuffer[0], 8); | ||
87 | ensure("bitPack: individual unpack: 1", unpackbuffer[0] == (U8) str[1]); | ||
88 | unpack_bufsize = bitunpack.bitUnpack(&unpackbuffer[0], 8); | ||
89 | ensure("bitPack: individual unpack: 2", unpackbuffer[0] == (U8) str[2]); | ||
90 | unpack_bufsize = bitunpack.bitUnpack(&unpackbuffer[0], 8); | ||
91 | ensure("bitPack: individual unpack: 3", unpackbuffer[0] == (U8) str[3]); | ||
92 | unpack_bufsize = bitunpack.bitUnpack(&unpackbuffer[0], 8); | ||
93 | ensure("bitPack: individual unpack: 4", unpackbuffer[0] == (U8) str[4]); | ||
94 | unpack_bufsize = bitunpack.bitUnpack(&unpackbuffer[0], 8); | ||
95 | ensure("bitPack: individual unpack: 5", unpackbuffer[0] == (U8) str[5]); | ||
96 | unpack_bufsize = bitunpack.bitUnpack(unpackbuffer, 8*4); // Life | ||
97 | ensure_memory_matches("bitPack: 4 bytes unpack:", unpackbuffer, 4, str+6, 4); | ||
98 | } | ||
99 | |||
100 | // U32 packing | ||
101 | template<> template<> | ||
102 | void bit_pack_object_t::test<3>() | ||
103 | { | ||
104 | U8 packbuffer[255]; | ||
105 | int pack_bufsize = 0; | ||
106 | |||
107 | LLBitPack bitpack(packbuffer, 255); | ||
108 | U32 num = 0x41fab67a; | ||
109 | pack_bufsize = bitpack.bitPack((U8*)&num, 8*sizeof(U32)); | ||
110 | pack_bufsize = bitpack.flushBitPack(); | ||
111 | |||
112 | LLBitPack bitunpack(packbuffer, pack_bufsize*8); | ||
113 | U32 res = 0; | ||
114 | // since packing and unpacking is done on same machine in the unit test run, | ||
115 | // endianness should not matter | ||
116 | bitunpack.bitUnpack((U8*) &res, sizeof(res)*8); | ||
117 | ensure("U32->bitPack->bitUnpack->U32 should be equal", num == res); | ||
118 | } | ||
119 | } | ||
diff --git a/linden/indra/test/lldatapacker_tut.cpp b/linden/indra/test/lldatapacker_tut.cpp new file mode 100644 index 0000000..71def35 --- /dev/null +++ b/linden/indra/test/lldatapacker_tut.cpp | |||
@@ -0,0 +1,571 @@ | |||
1 | /** | ||
2 | * @file lldatapacker_tut.cpp | ||
3 | * @author Adroit | ||
4 | * @date February 2007 | ||
5 | * @brief LLDataPacker test cases. | ||
6 | * | ||
7 | * Copyright (c) 2007-2007, Linden Research, Inc. | ||
8 | * | ||
9 | * The source code in this file ("Source Code") is provided by Linden Lab | ||
10 | * to you under the terms of the GNU General Public License, version 2.0 | ||
11 | * ("GPL"), unless you have obtained a separate licensing agreement | ||
12 | * ("Other License"), formally executed by you and Linden Lab. Terms of | ||
13 | * the GPL can be found in doc/GPL-license.txt in this distribution, or | ||
14 | * online at http://secondlife.com/developers/opensource/gplv2 | ||
15 | * | ||
16 | * There are special exceptions to the terms and conditions of the GPL as | ||
17 | * it is applied to this Source Code. View the full text of the exception | ||
18 | * in the file doc/FLOSS-exception.txt in this software distribution, or | ||
19 | * online at http://secondlife.com/developers/opensource/flossexception | ||
20 | * | ||
21 | * By copying, modifying or distributing this software, you acknowledge | ||
22 | * that you have read and understood your obligations described above, | ||
23 | * and agree to abide by those obligations. | ||
24 | * | ||
25 | * ALL LINDEN LAB SOURCE CODE IS PROVIDED "AS IS." LINDEN LAB MAKES NO | ||
26 | * WARRANTIES, EXPRESS, IMPLIED OR OTHERWISE, REGARDING ITS ACCURACY, | ||
27 | * COMPLETENESS OR PERFORMANCE. | ||
28 | */ | ||
29 | |||
30 | #include <tut/tut.h> | ||
31 | #include "lltut.h" | ||
32 | #include "linden_common.h" | ||
33 | #include "lldatapacker.h" | ||
34 | #include "v4color.h" | ||
35 | #include "v4coloru.h" | ||
36 | #include "v2math.h" | ||
37 | #include "v3math.h" | ||
38 | #include "v4math.h" | ||
39 | #include "llsdserialize.h" | ||
40 | |||
41 | #define TEST_FILE_NAME "datapacker_test.txt" | ||
42 | namespace tut | ||
43 | { | ||
44 | struct datapacker_test | ||
45 | { | ||
46 | }; | ||
47 | typedef test_group<datapacker_test> datapacker_test_t; | ||
48 | typedef datapacker_test_t::object datapacker_test_object_t; | ||
49 | tut::datapacker_test_t tut_datapacker_test("datapacker_test"); | ||
50 | |||
51 | //*********LLDataPackerBinaryBuffer | ||
52 | template<> template<> | ||
53 | void datapacker_test_object_t::test<1>() | ||
54 | { | ||
55 | U8 packbuf[128]; | ||
56 | F32 f_val1 = 44.44f, f_unpkval1; | ||
57 | F32 f_val2 = 12344.443232f, f_unpkval2; | ||
58 | F32 f_val3 = 44.4456789f, f_unpkval3; | ||
59 | LLDataPackerBinaryBuffer lldp(packbuf,128); | ||
60 | lldp.packFixed( f_val1, "linden_lab", FALSE, 8, 8); | ||
61 | lldp.packFixed( f_val2, "linden_lab", FALSE, 14, 16); | ||
62 | lldp.packFixed( f_val3, "linden_lab", FALSE, 8, 23); | ||
63 | |||
64 | LLDataPackerBinaryBuffer lldp1(packbuf, lldp.getCurrentSize()); | ||
65 | lldp1.unpackFixed(f_unpkval1, "linden_lab", FALSE, 8, 8); | ||
66 | lldp1.unpackFixed(f_unpkval2, "linden_lab", FALSE, 14, 16); | ||
67 | lldp1.unpackFixed(f_unpkval3, "linden_lab", FALSE, 8, 23); | ||
68 | ensure_approximately_equals("LLDataPackerBinaryBuffer::packFixed 8 failed", f_val1, f_unpkval1, 8); | ||
69 | ensure_approximately_equals("LLDataPackerBinaryBuffer::packFixed 16 failed", f_val2, f_unpkval2, 16); | ||
70 | ensure_approximately_equals("LLDataPackerBinaryBuffer::packFixed 23 failed", f_val3, f_unpkval3, 31); | ||
71 | } | ||
72 | |||
73 | template<> template<> | ||
74 | void datapacker_test_object_t::test<2>() | ||
75 | { | ||
76 | U8 packbuf[1024]; | ||
77 | |||
78 | char str[] = "SecondLife is virtual World\0"; | ||
79 | char strBinary[] = "SecondLife is virtual World"; | ||
80 | char strBinaryFixed[] = "Fixed Data"; | ||
81 | S32 sizeBinaryFixed = sizeof(strBinaryFixed); | ||
82 | U8 valU8 = 'C'; | ||
83 | U16 valU16 = 0xFFFF; | ||
84 | U32 valU32 = 0xFFFFFFFF; | ||
85 | S32 valS32 = -94967295; | ||
86 | F32 valF32 = 4354355.44f ; | ||
87 | LLColor4 llcol4(3.3f, 0, 4.4f, 5.5f); | ||
88 | LLColor4U llcol4u(3, 128, 24, 33); | ||
89 | LLVector2 llvec2(333.33f, 444.44f); | ||
90 | LLVector3 llvec3(333.33f, 444.44f, 555.55f); | ||
91 | LLVector4 llvec4(333.33f, 444.44f, 555.55f, 666.66f); | ||
92 | LLUUID uuid; | ||
93 | |||
94 | std::string unpkstr; | ||
95 | char unpkstrBinary[256]; | ||
96 | char unpkstrBinaryFixed[256]; | ||
97 | S32 unpksizeBinary; | ||
98 | U8 unpkvalU8; | ||
99 | U16 unpkvalU16; | ||
100 | U32 unpkvalU32; | ||
101 | S32 unpkvalS32; | ||
102 | F32 unpkvalF32; | ||
103 | LLColor4 unpkllcol4; | ||
104 | LLColor4U unpkllcol4u; | ||
105 | LLVector2 unpkllvec2; | ||
106 | LLVector3 unpkllvec3; | ||
107 | LLVector4 unpkllvec4; | ||
108 | LLUUID unpkuuid; | ||
109 | |||
110 | LLDataPackerBinaryBuffer lldp(packbuf,1024); | ||
111 | lldp.packString(str , "linden_lab_str"); | ||
112 | lldp.packBinaryData((U8*)strBinary, sizeof(strBinary), "linden_lab_bd"); | ||
113 | lldp.packBinaryDataFixed((U8*)strBinaryFixed, sizeBinaryFixed, "linden_lab_bdf"); | ||
114 | lldp.packU8(valU8,"linden_lab_u8"); | ||
115 | lldp.packU16(valU16,"linden_lab_u16"); | ||
116 | lldp.packU32(valU32, "linden_lab_u32"); | ||
117 | lldp.packS32(valS32, "linden_lab_s32"); | ||
118 | lldp.packF32(valF32, "linden_lab_f32"); | ||
119 | lldp.packColor4(llcol4, "linden_lab_col4"); | ||
120 | lldp.packColor4U(llcol4u, "linden_lab_col4u"); | ||
121 | lldp.packVector2(llvec2, "linden_lab_vec2"); | ||
122 | lldp.packVector3(llvec3, "linden_lab_vec3"); | ||
123 | lldp.packVector4(llvec4, "linden_lab_vec4"); | ||
124 | uuid.generate(); | ||
125 | lldp.packUUID(uuid, "linden_lab_uuid"); | ||
126 | |||
127 | S32 cur_size = lldp.getCurrentSize(); | ||
128 | |||
129 | LLDataPackerBinaryBuffer lldp1(packbuf, cur_size); | ||
130 | lldp1.unpackString(unpkstr , "linden_lab_str"); | ||
131 | lldp1.unpackBinaryData((U8*)unpkstrBinary, unpksizeBinary, "linden_lab_bd"); | ||
132 | lldp1.unpackBinaryDataFixed((U8*)unpkstrBinaryFixed, sizeBinaryFixed, "linden_lab_bdf"); | ||
133 | lldp1.unpackU8(unpkvalU8,"linden_lab_u8"); | ||
134 | lldp1.unpackU16(unpkvalU16,"linden_lab_u16"); | ||
135 | lldp1.unpackU32(unpkvalU32, "linden_lab_u32"); | ||
136 | lldp1.unpackS32(unpkvalS32, "linden_lab_s32"); | ||
137 | lldp1.unpackF32(unpkvalF32, "linden_lab_f32"); | ||
138 | lldp1.unpackColor4(unpkllcol4, "linden_lab_col4"); | ||
139 | lldp1.unpackColor4U(unpkllcol4u, "linden_lab_col4u"); | ||
140 | lldp1.unpackVector2(unpkllvec2, "linden_lab_vec2"); | ||
141 | lldp1.unpackVector3(unpkllvec3, "linden_lab_vec3"); | ||
142 | lldp1.unpackVector4(unpkllvec4, "linden_lab_vec4"); | ||
143 | lldp1.unpackUUID(unpkuuid, "linden_lab_uuid"); | ||
144 | |||
145 | ensure("LLDataPackerBinaryBuffer::packString failed", strcmp(str, unpkstr.c_str()) == 0); | ||
146 | ensure("LLDataPackerBinaryBuffer::packBinaryData failed", strcmp(strBinary, unpkstrBinary) == 0); | ||
147 | ensure("LLDataPackerBinaryBuffer::packBinaryDataFixed failed", strcmp(strBinaryFixed, unpkstrBinaryFixed) == 0); | ||
148 | ensure_equals("LLDataPackerBinaryBuffer::packU8 failed", valU8, unpkvalU8); | ||
149 | ensure_equals("LLDataPackerBinaryBuffer::packU16 failed", valU16, unpkvalU16); | ||
150 | ensure_equals("LLDataPackerBinaryBuffer::packU32 failed", valU32, unpkvalU32); | ||
151 | ensure_equals("LLDataPackerBinaryBuffer::packS32 failed", valS32, unpkvalS32); | ||
152 | ensure("LLDataPackerBinaryBuffer::packF32 failed", is_approx_equal(valF32, unpkvalF32)); | ||
153 | ensure_equals("LLDataPackerBinaryBuffer::packColor4 failed", llcol4, unpkllcol4); | ||
154 | ensure_equals("LLDataPackerBinaryBuffer::packColor4U failed", llcol4u, unpkllcol4u); | ||
155 | ensure_equals("LLDataPackerBinaryBuffer::packVector2 failed", llvec2, unpkllvec2); | ||
156 | ensure_equals("LLDataPackerBinaryBuffer::packVector3 failed", llvec3, unpkllvec3); | ||
157 | ensure_equals("LLDataPackerBinaryBuffer::packVector4 failed", llvec4, unpkllvec4); | ||
158 | ensure_equals("LLDataPackerBinaryBuffer::packUUID failed", uuid, unpkuuid); | ||
159 | } | ||
160 | |||
161 | template<> template<> | ||
162 | void datapacker_test_object_t::test<3>() | ||
163 | { | ||
164 | U8 packbuf[128]; | ||
165 | char str[] = "SecondLife is virtual World"; | ||
166 | S32 strSize = sizeof(str); // include '\0' | ||
167 | LLDataPackerBinaryBuffer lldp(packbuf, 128); | ||
168 | lldp.packString(str , "linden_lab"); | ||
169 | |||
170 | ensure("LLDataPackerBinaryBuffer: current size is wrong", strSize == lldp.getCurrentSize()); | ||
171 | ensure("LLDataPackerBinaryBuffer: buffer size is wrong", 128 == lldp.getBufferSize()); | ||
172 | |||
173 | lldp.reset(); | ||
174 | ensure("LLDataPackerBinaryBuffer::reset failed",0 == lldp.getCurrentSize()); | ||
175 | } | ||
176 | |||
177 | template<> template<> | ||
178 | void datapacker_test_object_t::test<4>() | ||
179 | { | ||
180 | U8* packbuf = new U8[128]; | ||
181 | char str[] = "SecondLife is virtual World"; | ||
182 | LLDataPackerBinaryBuffer lldp(packbuf, 128); | ||
183 | lldp.packString(str , "linden_lab"); | ||
184 | lldp.freeBuffer(); | ||
185 | ensure("LLDataPackerBinaryBuffer.freeBuffer failed" , 0 == lldp.getBufferSize()); | ||
186 | |||
187 | } | ||
188 | |||
189 | template<> template<> | ||
190 | void datapacker_test_object_t::test<5>() | ||
191 | { | ||
192 | U8 buf[] = "SecondLife is virtual World"; | ||
193 | S32 size = sizeof(buf); | ||
194 | LLDataPackerBinaryBuffer lldp(buf, size); | ||
195 | U8 new_buf[] = "Its Amazing"; | ||
196 | size = sizeof(new_buf); | ||
197 | lldp.assignBuffer(new_buf, size); | ||
198 | ensure("LLDataPackerBinaryBuffer::assignBuffer failed" , ((lldp.getBufferSize() == size) && (0 == lldp.getCurrentSize()))) ; | ||
199 | } | ||
200 | |||
201 | template<> template<> | ||
202 | void datapacker_test_object_t::test<6>() | ||
203 | { | ||
204 | U8 packbuf[128]; | ||
205 | char str[] = "SecondLife is virtual World"; | ||
206 | LLDataPackerBinaryBuffer lldp(packbuf, 128); | ||
207 | lldp.packString(str , "linden_lab"); | ||
208 | U8 new_buffer[128]; | ||
209 | std::string unpkbuf; | ||
210 | LLDataPackerBinaryBuffer lldp1(new_buffer,128); | ||
211 | lldp1 = lldp; | ||
212 | lldp1.unpackString(unpkbuf, "linden_lab"); | ||
213 | ensure("1. LLDataPackerBinaryBuffer::operator= failed" , lldp1.getBufferSize() == lldp.getBufferSize()); | ||
214 | ensure_equals("2.LLDataPackerBinaryBuffer::operator= failed", str,unpkbuf); | ||
215 | } | ||
216 | |||
217 | //*********LLDataPackerAsciiBuffer | ||
218 | |||
219 | template<> template<> | ||
220 | void datapacker_test_object_t::test<7>() | ||
221 | { | ||
222 | char packbuf[128]; | ||
223 | F32 f_val = 44.44f, f_unpkval; | ||
224 | LLDataPackerAsciiBuffer lldp(packbuf,128); | ||
225 | lldp.packFixed( f_val, "linden_lab", FALSE, 8, 8); | ||
226 | |||
227 | LLDataPackerAsciiBuffer lldp1(packbuf, lldp.getCurrentSize()); | ||
228 | lldp1.unpackFixed(f_unpkval, "linden_lab", FALSE, 8, 8); | ||
229 | ensure_approximately_equals("LLDataPackerAsciiBuffer::packFixed failed", f_val, f_unpkval, 8); | ||
230 | } | ||
231 | |||
232 | template<> template<> | ||
233 | void datapacker_test_object_t::test<8>() | ||
234 | { | ||
235 | char packbuf[1024]; | ||
236 | |||
237 | char str[] = "SecondLife is virtual World\0"; | ||
238 | char strBinary[] = "SecondLife is virtual World"; | ||
239 | char strBinaryFixed[] = "Fixed Data"; | ||
240 | S32 sizeBinaryFixed = sizeof(strBinaryFixed); | ||
241 | U8 valU8 = 'C'; | ||
242 | U16 valU16 = 0xFFFF; | ||
243 | U32 valU32 = 0xFFFFFFFF; | ||
244 | S32 valS32 = -94967295; | ||
245 | F32 valF32 = 4354355.44f ; | ||
246 | LLColor4 llcol4(3.3f, 0, 4.4f, 5.5f); | ||
247 | LLColor4U llcol4u(3, 128, 24, 33); | ||
248 | LLVector2 llvec2(333.33f, 444.44f); | ||
249 | LLVector3 llvec3(333.33f, 444.44f, 555.55f); | ||
250 | LLVector4 llvec4(4354355.44f, 444.44f, 555.55f, 666.66f); | ||
251 | LLUUID uuid; | ||
252 | |||
253 | std::string unpkstr; | ||
254 | char unpkstrBinary[256]; | ||
255 | char unpkstrBinaryFixed[256]; | ||
256 | S32 unpksizeBinary; | ||
257 | U8 unpkvalU8; | ||
258 | U16 unpkvalU16; | ||
259 | U32 unpkvalU32; | ||
260 | S32 unpkvalS32; | ||
261 | F32 unpkvalF32; | ||
262 | LLColor4 unpkllcol4; | ||
263 | LLColor4U unpkllcol4u; | ||
264 | LLVector2 unpkllvec2; | ||
265 | LLVector3 unpkllvec3; | ||
266 | LLVector4 unpkllvec4; | ||
267 | LLUUID unpkuuid; | ||
268 | |||
269 | LLDataPackerAsciiBuffer lldp(packbuf,1024); | ||
270 | lldp.packString(str , "linden_lab_str"); | ||
271 | lldp.packBinaryData((U8*)strBinary, sizeof(strBinary), "linden_lab_bd"); | ||
272 | lldp.packBinaryDataFixed((U8*)strBinaryFixed, sizeBinaryFixed, "linden_lab_bdf"); | ||
273 | lldp.packU8(valU8,"linden_lab_u8"); | ||
274 | lldp.packU16(valU16,"linden_lab_u16"); | ||
275 | lldp.packU32(valU32, "linden_lab_u32"); | ||
276 | lldp.packS32(valS32, "linden_lab_s32"); | ||
277 | lldp.packF32(valF32, "linden_lab_f32"); | ||
278 | lldp.packColor4(llcol4, "linden_lab_col4"); | ||
279 | lldp.packColor4U(llcol4u, "linden_lab_col4u"); | ||
280 | lldp.packVector2(llvec2, "linden_lab_vec2"); | ||
281 | lldp.packVector3(llvec3, "linden_lab_vec3"); | ||
282 | lldp.packVector4(llvec4, "linden_lab_vec4"); | ||
283 | uuid.generate(); | ||
284 | lldp.packUUID(uuid, "linden_lab_uuid"); | ||
285 | |||
286 | S32 cur_size = lldp.getCurrentSize(); | ||
287 | |||
288 | LLDataPackerAsciiBuffer lldp1(packbuf, cur_size); | ||
289 | lldp1.unpackString(unpkstr , "linden_lab_str"); | ||
290 | lldp1.unpackBinaryData((U8*)unpkstrBinary, unpksizeBinary, "linden_lab_bd"); | ||
291 | lldp1.unpackBinaryDataFixed((U8*)unpkstrBinaryFixed, sizeBinaryFixed, "linden_lab_bdf"); | ||
292 | lldp1.unpackU8(unpkvalU8,"linden_lab_u8"); | ||
293 | lldp1.unpackU16(unpkvalU16,"linden_lab_u16"); | ||
294 | lldp1.unpackU32(unpkvalU32, "linden_lab_u32"); | ||
295 | lldp1.unpackS32(unpkvalS32, "linden_lab_s32"); | ||
296 | lldp1.unpackF32(unpkvalF32, "linden_lab_f32"); | ||
297 | lldp1.unpackColor4(unpkllcol4, "linden_lab_col4"); | ||
298 | lldp1.unpackColor4U(unpkllcol4u, "linden_lab_col4u"); | ||
299 | lldp1.unpackVector2(unpkllvec2, "linden_lab_vec2"); | ||
300 | lldp1.unpackVector3(unpkllvec3, "linden_lab_vec3"); | ||
301 | lldp1.unpackVector4(unpkllvec4, "linden_lab_vec4"); | ||
302 | lldp1.unpackUUID(unpkuuid, "linden_lab_uuid"); | ||
303 | |||
304 | ensure("LLDataPackerAsciiBuffer::packString failed", strcmp(str, unpkstr.c_str()) == 0); | ||
305 | ensure("LLDataPackerAsciiBuffer::packBinaryData failed", strcmp(strBinary, unpkstrBinary) == 0); | ||
306 | ensure("LLDataPackerAsciiBuffer::packBinaryDataFixed failed", strcmp(strBinaryFixed, unpkstrBinaryFixed) == 0); | ||
307 | ensure_equals("LLDataPackerAsciiBuffer::packU8 failed", valU8, unpkvalU8); | ||
308 | ensure_equals("LLDataPackerAsciiBuffer::packU16 failed", valU16, unpkvalU16); | ||
309 | ensure_equals("LLDataPackerAsciiBuffer::packU32 failed", valU32, unpkvalU32); | ||
310 | ensure_equals("LLDataPackerAsciiBuffer::packS32 failed", valS32, unpkvalS32); | ||
311 | ensure("LLDataPackerAsciiBuffer::packF32 failed", is_approx_equal(valF32, unpkvalF32)); | ||
312 | ensure_equals("LLDataPackerAsciiBuffer::packColor4 failed", llcol4, unpkllcol4); | ||
313 | ensure_equals("LLDataPackerAsciiBuffer::packColor4U failed", llcol4u, unpkllcol4u); | ||
314 | ensure_equals("LLDataPackerAsciiBuffer::packVector2 failed", llvec2, unpkllvec2); | ||
315 | ensure_equals("LLDataPackerAsciiBuffer::packVector3 failed", llvec3, unpkllvec3); | ||
316 | ensure_equals("LLDataPackerAsciiBuffer::packVector4 failed", llvec4, unpkllvec4); | ||
317 | ensure_equals("LLDataPackerAsciiBuffer::packUUID failed", uuid, unpkuuid); | ||
318 | } | ||
319 | |||
320 | template<> template<> | ||
321 | void datapacker_test_object_t::test<9>() | ||
322 | { | ||
323 | char* packbuf = new char[128]; | ||
324 | char str[] = "SecondLife is virtual World"; | ||
325 | LLDataPackerAsciiBuffer lldp(packbuf, 128); | ||
326 | lldp.packString(str , "linden_lab"); | ||
327 | lldp.freeBuffer(); | ||
328 | ensure("LLDataPackerAsciiBuffer::freeBuffer failed" , 0 == lldp.getBufferSize()); | ||
329 | } | ||
330 | |||
331 | template<> template<> | ||
332 | void datapacker_test_object_t::test<10>() | ||
333 | { | ||
334 | char buf[] = "SecondLife is virtual World"; | ||
335 | S32 size = sizeof(buf); | ||
336 | LLDataPackerAsciiBuffer lldp(buf, size); | ||
337 | char new_buf[] = "Its Amazing"; | ||
338 | size = sizeof(new_buf); | ||
339 | lldp.assignBuffer(new_buf, size); | ||
340 | ensure("LLDataPackerAsciiBuffer::assignBuffer failed" , ((lldp.getBufferSize() == size) && (1 == lldp.getCurrentSize()))) ; | ||
341 | } | ||
342 | |||
343 | //*********LLDataPackerAsciiFile | ||
344 | |||
345 | template<> template<> | ||
346 | void datapacker_test_object_t::test<11>() | ||
347 | { | ||
348 | F32 f_val = 44.44f, f_unpkval; | ||
349 | |||
350 | FILE* fp = fopen(TEST_FILE_NAME, "w+"); | ||
351 | if(!fp) | ||
352 | { | ||
353 | llerrs << "File couldnt be open" <<llendl; | ||
354 | return; | ||
355 | } | ||
356 | |||
357 | LLDataPackerAsciiFile lldp(fp,2); | ||
358 | lldp.packFixed( f_val, "linden_lab", FALSE, 8, 8); | ||
359 | |||
360 | fflush(fp); | ||
361 | fseek(fp,0,SEEK_SET); | ||
362 | LLDataPackerAsciiFile lldp1(fp,2); | ||
363 | |||
364 | lldp1.unpackFixed(f_unpkval, "linden_lab", FALSE, 8, 8); | ||
365 | fclose(fp); | ||
366 | |||
367 | ensure_approximately_equals("LLDataPackerAsciiFile::packFixed failed", f_val, f_unpkval, 8); | ||
368 | } | ||
369 | |||
370 | template<> template<> | ||
371 | void datapacker_test_object_t::test<12>() | ||
372 | { | ||
373 | char str[] = "SecondLife is virtual World\0"; | ||
374 | char strBinary[] = "SecondLife is virtual World"; | ||
375 | char strBinaryFixed[] = "Fixed Data"; | ||
376 | S32 sizeBinaryFixed = sizeof(strBinaryFixed); | ||
377 | U8 valU8 = 'C'; | ||
378 | U16 valU16 = 0xFFFF; | ||
379 | U32 valU32 = 0xFFFFFFFF; | ||
380 | S32 valS32 = -94967295; | ||
381 | F32 valF32 = 4354355.44f ; | ||
382 | LLColor4 llcol4(3.3f, 0, 4.4f, 5.5f); | ||
383 | LLColor4U llcol4u(3, 128, 24, 33); | ||
384 | LLVector2 llvec2(333.33f, 444.44f); | ||
385 | LLVector3 llvec3(333.33f, 444.44f, 555.55f); | ||
386 | LLVector4 llvec4(333.33f, 444.44f, 555.55f, 666.66f); | ||
387 | LLUUID uuid; | ||
388 | |||
389 | std::string unpkstr; | ||
390 | char unpkstrBinary[256]; | ||
391 | char unpkstrBinaryFixed[256]; | ||
392 | S32 unpksizeBinary; | ||
393 | U8 unpkvalU8; | ||
394 | U16 unpkvalU16; | ||
395 | U32 unpkvalU32; | ||
396 | S32 unpkvalS32; | ||
397 | F32 unpkvalF32; | ||
398 | LLColor4 unpkllcol4; | ||
399 | LLColor4U unpkllcol4u; | ||
400 | LLVector2 unpkllvec2; | ||
401 | LLVector3 unpkllvec3; | ||
402 | LLVector4 unpkllvec4; | ||
403 | LLUUID unpkuuid; | ||
404 | |||
405 | FILE* fp = fopen(TEST_FILE_NAME,"w+"); | ||
406 | if(!fp) | ||
407 | { | ||
408 | llerrs << "File couldnt be open" <<llendl; | ||
409 | return; | ||
410 | } | ||
411 | |||
412 | LLDataPackerAsciiFile lldp(fp,2); | ||
413 | |||
414 | lldp.packString(str , "linden_lab_str"); | ||
415 | lldp.packBinaryData((U8*)strBinary, sizeof(strBinary), "linden_lab_bd"); | ||
416 | lldp.packBinaryDataFixed((U8*)strBinaryFixed, sizeBinaryFixed, "linden_lab_bdf"); | ||
417 | lldp.packU8(valU8,"linden_lab_u8"); | ||
418 | lldp.packU16(valU16,"linden_lab_u16"); | ||
419 | lldp.packU32(valU32, "linden_lab_u32"); | ||
420 | lldp.packS32(valS32, "linden_lab_s32"); | ||
421 | lldp.packF32(valF32, "linden_lab_f32"); | ||
422 | lldp.packColor4(llcol4, "linden_lab_col4"); | ||
423 | lldp.packColor4U(llcol4u, "linden_lab_col4u"); | ||
424 | lldp.packVector2(llvec2, "linden_lab_vec2"); | ||
425 | lldp.packVector3(llvec3, "linden_lab_vec3"); | ||
426 | lldp.packVector4(llvec4, "linden_lab_vec4"); | ||
427 | uuid.generate(); | ||
428 | lldp.packUUID(uuid, "linden_lab_uuid"); | ||
429 | |||
430 | fflush(fp); | ||
431 | fseek(fp,0,SEEK_SET); | ||
432 | LLDataPackerAsciiFile lldp1(fp,2); | ||
433 | |||
434 | lldp1.unpackString(unpkstr , "linden_lab_str"); | ||
435 | lldp1.unpackBinaryData((U8*)unpkstrBinary, unpksizeBinary, "linden_lab_bd"); | ||
436 | lldp1.unpackBinaryDataFixed((U8*)unpkstrBinaryFixed, sizeBinaryFixed, "linden_lab_bdf"); | ||
437 | lldp1.unpackU8(unpkvalU8,"linden_lab_u8"); | ||
438 | lldp1.unpackU16(unpkvalU16,"linden_lab_u16"); | ||
439 | lldp1.unpackU32(unpkvalU32, "linden_lab_u32"); | ||
440 | lldp1.unpackS32(unpkvalS32, "linden_lab_s32"); | ||
441 | lldp1.unpackF32(unpkvalF32, "linden_lab_f32"); | ||
442 | lldp1.unpackColor4(unpkllcol4, "linden_lab_col4"); | ||
443 | lldp1.unpackColor4U(unpkllcol4u, "linden_lab_col4u"); | ||
444 | lldp1.unpackVector2(unpkllvec2, "linden_lab_vec2"); | ||
445 | lldp1.unpackVector3(unpkllvec3, "linden_lab_vec3"); | ||
446 | lldp1.unpackVector4(unpkllvec4, "linden_lab_vec4"); | ||
447 | lldp1.unpackUUID(unpkuuid, "linden_lab_uuid"); | ||
448 | |||
449 | fclose(fp); | ||
450 | |||
451 | ensure("LLDataPackerAsciiFile::packString failed", strcmp(str, unpkstr.c_str()) == 0); | ||
452 | ensure("LLDataPackerAsciiFile::packBinaryData failed", strcmp(strBinary, unpkstrBinary) == 0); | ||
453 | ensure("LLDataPackerAsciiFile::packBinaryDataFixed failed", strcmp(strBinaryFixed, unpkstrBinaryFixed) == 0); | ||
454 | ensure_equals("LLDataPackerAsciiFile::packU8 failed", valU8, unpkvalU8); | ||
455 | ensure_equals("LLDataPackerAsciiFile::packU16 failed", valU16, unpkvalU16); | ||
456 | ensure_equals("LLDataPackerAsciiFile::packU32 failed", valU32, unpkvalU32); | ||
457 | ensure_equals("LLDataPackerAsciiFile::packS32 failed", valS32, unpkvalS32); | ||
458 | ensure("LLDataPackerAsciiFile::packF32 failed", is_approx_equal(valF32, unpkvalF32)); | ||
459 | ensure_equals("LLDataPackerAsciiFile::packColor4 failed", llcol4, unpkllcol4); | ||
460 | ensure_equals("LLDataPackerAsciiFile::packColor4U failed", llcol4u, unpkllcol4u); | ||
461 | ensure_equals("LLDataPackerAsciiFile::packVector2 failed", llvec2, unpkllvec2); | ||
462 | ensure_equals("LLDataPackerAsciiFile::packVector3 failed", llvec3, unpkllvec3); | ||
463 | ensure_equals("LLDataPackerAsciiFile::packVector4 failed", llvec4, unpkllvec4); | ||
464 | ensure_equals("LLDataPackerAsciiFile::packUUID failed", uuid, unpkuuid); | ||
465 | } | ||
466 | |||
467 | template<> template<> | ||
468 | void datapacker_test_object_t::test<13>() | ||
469 | { | ||
470 | F32 f_val = 44.44f, f_unpkval; | ||
471 | |||
472 | std::ostringstream ostr; | ||
473 | LLDataPackerAsciiFile lldp(ostr,2); | ||
474 | lldp.packFixed( f_val, "linden_lab", FALSE, 8, 8); | ||
475 | |||
476 | std::istringstream istr(ostr.str()); | ||
477 | LLDataPackerAsciiFile lldp1(istr,2); | ||
478 | |||
479 | lldp1.unpackFixed(f_unpkval, "linden_lab", FALSE, 8, 8); | ||
480 | |||
481 | ensure_approximately_equals("LLDataPackerAsciiFile::packFixed (iostring) failed", f_val, f_unpkval, 8); | ||
482 | } | ||
483 | |||
484 | template<> template<> | ||
485 | void datapacker_test_object_t::test<14>() | ||
486 | { | ||
487 | char str[] = "SecondLife is virtual World\0"; | ||
488 | char strBinary[] = "SecondLife is virtual World"; | ||
489 | char strBinaryFixed[] = "Fixed Data"; | ||
490 | S32 sizeBinaryFixed = sizeof(strBinaryFixed); | ||
491 | U8 valU8 = 'C'; | ||
492 | U16 valU16 = 0xFFFF; | ||
493 | U32 valU32 = 0xFFFFFFFF; | ||
494 | S32 valS32 = -94967295; | ||
495 | F32 valF32 = 4354355.44f ; | ||
496 | LLColor4 llcol4(3.3f, 0, 4.4f, 5.5f); | ||
497 | LLColor4U llcol4u(3, 128, 24, 33); | ||
498 | LLVector2 llvec2(3333333.33f, 444.333344f); | ||
499 | LLVector3 llvec3(3323233.33f, 444.4324f, 555.553232f); | ||
500 | LLVector4 llvec4(333.33233f, 444.4323234f, 55323225.55f, 6323236.66f); | ||
501 | LLUUID uuid; | ||
502 | |||
503 | std::string unpkstr; | ||
504 | char unpkstrBinary[256]; | ||
505 | char unpkstrBinaryFixed[256]; | ||
506 | S32 unpksizeBinary; | ||
507 | U8 unpkvalU8; | ||
508 | U16 unpkvalU16; | ||
509 | U32 unpkvalU32; | ||
510 | S32 unpkvalS32; | ||
511 | F32 unpkvalF32; | ||
512 | LLColor4 unpkllcol4; | ||
513 | LLColor4U unpkllcol4u; | ||
514 | LLVector2 unpkllvec2; | ||
515 | LLVector3 unpkllvec3; | ||
516 | LLVector4 unpkllvec4; | ||
517 | LLUUID unpkuuid; | ||
518 | |||
519 | std::ostringstream ostr; | ||
520 | LLDataPackerAsciiFile lldp(ostr,2); | ||
521 | |||
522 | lldp.packString(str , "linden_lab_str"); | ||
523 | lldp.packBinaryData((U8*)strBinary, sizeof(strBinary), "linden_lab_bd"); | ||
524 | lldp.packBinaryDataFixed((U8*)strBinaryFixed, sizeBinaryFixed, "linden_lab_bdf"); | ||
525 | lldp.packU8(valU8,"linden_lab_u8"); | ||
526 | lldp.packU16(valU16,"linden_lab_u16"); | ||
527 | lldp.packU32(valU32, "linden_lab_u32"); | ||
528 | lldp.packS32(valS32, "linden_lab_s32"); | ||
529 | lldp.packF32(valF32, "linden_lab_f32"); | ||
530 | lldp.packColor4(llcol4, "linden_lab_col4"); | ||
531 | lldp.packColor4U(llcol4u, "linden_lab_col4u"); | ||
532 | lldp.packVector2(llvec2, "linden_lab_vec2"); | ||
533 | lldp.packVector3(llvec3, "linden_lab_vec3"); | ||
534 | lldp.packVector4(llvec4, "linden_lab_vec4"); | ||
535 | uuid.generate(); | ||
536 | lldp.packUUID(uuid, "linden_lab_uuid"); | ||
537 | |||
538 | std::istringstream istr(ostr.str()); | ||
539 | LLDataPackerAsciiFile lldp1(istr,2); | ||
540 | |||
541 | lldp1.unpackString(unpkstr , "linden_lab_str"); | ||
542 | lldp1.unpackBinaryData((U8*)unpkstrBinary, unpksizeBinary, "linden_lab_bd"); | ||
543 | lldp1.unpackBinaryDataFixed((U8*)unpkstrBinaryFixed, sizeBinaryFixed, "linden_lab_bdf"); | ||
544 | lldp1.unpackU8(unpkvalU8,"linden_lab_u8"); | ||
545 | lldp1.unpackU16(unpkvalU16,"linden_lab_u16"); | ||
546 | lldp1.unpackU32(unpkvalU32, "linden_lab_u32"); | ||
547 | lldp1.unpackS32(unpkvalS32, "linden_lab_s32"); | ||
548 | lldp1.unpackF32(unpkvalF32, "linden_lab_f32"); | ||
549 | lldp1.unpackColor4(unpkllcol4, "linden_lab_col4"); | ||
550 | lldp1.unpackColor4U(unpkllcol4u, "linden_lab_col4u"); | ||
551 | lldp1.unpackVector2(unpkllvec2, "linden_lab_vec2"); | ||
552 | lldp1.unpackVector3(unpkllvec3, "linden_lab_vec3"); | ||
553 | lldp1.unpackVector4(unpkllvec4, "linden_lab_vec4"); | ||
554 | lldp1.unpackUUID(unpkuuid, "linden_lab_uuid"); | ||
555 | |||
556 | ensure("LLDataPackerAsciiFile::packString (iostring) failed", strcmp(str, unpkstr.c_str()) == 0); | ||
557 | ensure("LLDataPackerAsciiFile::packBinaryData (iostring) failed", strcmp(strBinary, unpkstrBinary) == 0); | ||
558 | ensure("LLDataPackerAsciiFile::packBinaryDataFixed (iostring) failed", strcmp(strBinaryFixed, unpkstrBinaryFixed) == 0); | ||
559 | ensure_equals("LLDataPackerAsciiFile::packU8 (iostring) failed", valU8, unpkvalU8); | ||
560 | ensure_equals("LLDataPackerAsciiFile::packU16 (iostring) failed", valU16, unpkvalU16); | ||
561 | ensure_equals("LLDataPackerAsciiFile::packU32 (iostring) failed", valU32, unpkvalU32); | ||
562 | ensure_equals("LLDataPackerAsciiFile::packS32 (iostring) failed", valS32, unpkvalS32); | ||
563 | ensure("LLDataPackerAsciiFile::packF32 (iostring) failed", is_approx_equal(valF32, unpkvalF32)); | ||
564 | ensure_equals("LLDataPackerAsciiFile::packColor4 (iostring) failed", llcol4, unpkllcol4); | ||
565 | ensure_equals("LLDataPackerAsciiFile::packColor4U (iostring) failed", llcol4u, unpkllcol4u); | ||
566 | ensure_equals("LLDataPackerAsciiFile::packVector2 (iostring) failed", llvec2, unpkllvec2); | ||
567 | ensure_equals("LLDataPackerAsciiFile::packVector3 (iostring) failed", llvec3, unpkllvec3); | ||
568 | ensure_equals("LLDataPackerAsciiFile::packVector4 (iostring) failed", llvec4, unpkllvec4); | ||
569 | ensure_equals("LLDataPackerAsciiFile::packUUID (iostring) failed", uuid, unpkuuid); | ||
570 | } | ||
571 | } | ||
diff --git a/linden/indra/test/llhttpclient_tut.cpp b/linden/indra/test/llhttpclient_tut.cpp index 7918205..77f1e25 100644 --- a/linden/indra/test/llhttpclient_tut.cpp +++ b/linden/indra/test/llhttpclient_tut.cpp | |||
@@ -34,6 +34,10 @@ | |||
34 | 34 | ||
35 | #include <tut/tut.h> | 35 | #include <tut/tut.h> |
36 | #include "linden_common.h" | 36 | #include "linden_common.h" |
37 | |||
38 | // These are too slow on Windows to actually include in the build. JC | ||
39 | #if !LL_WINDOWS | ||
40 | |||
37 | #include "lltut.h" | 41 | #include "lltut.h" |
38 | #include "llhttpclient.h" | 42 | #include "llhttpclient.h" |
39 | #include "llformat.h" | 43 | #include "llformat.h" |
@@ -98,7 +102,7 @@ namespace tut | |||
98 | 102 | ||
99 | void setupTheServer() | 103 | void setupTheServer() |
100 | { | 104 | { |
101 | LLHTTPNode& root = LLCreateHTTPServer(mPool, *mServerPump, 8888); | 105 | LLHTTPNode& root = LLIOHTTPServer::create(mPool, *mServerPump, 8888); |
102 | 106 | ||
103 | LLHTTPStandardServices::useServices(); | 107 | LLHTTPStandardServices::useServices(); |
104 | LLHTTPRegistrar::buildAllServices(root); | 108 | LLHTTPRegistrar::buildAllServices(root); |
@@ -333,4 +337,7 @@ namespace tut | |||
333 | LLSD body = result["body"]; | 337 | LLSD body = result["body"]; |
334 | ensure_equals("echoed result matches", body.size(), expected.size()); | 338 | ensure_equals("echoed result matches", body.size(), expected.size()); |
335 | } | 339 | } |
340 | |||
336 | } | 341 | } |
342 | |||
343 | #endif // !LL_WINDOWS | ||
diff --git a/linden/indra/test/llinventoryparcel_tut.cpp b/linden/indra/test/llinventoryparcel_tut.cpp new file mode 100644 index 0000000..1a815ca --- /dev/null +++ b/linden/indra/test/llinventoryparcel_tut.cpp | |||
@@ -0,0 +1,70 @@ | |||
1 | /** | ||
2 | * @file llinventoryparcel_tut.cpp | ||
3 | * @author Moss | ||
4 | * @date 2007-04-17 | ||
5 | * | ||
6 | * Copyright (c) 2007-2007, Linden Research, Inc. | ||
7 | * | ||
8 | * Second Life Viewer Source Code | ||
9 | * The source code in this file ("Source Code") is provided by Linden Lab | ||
10 | * to you under the terms of the GNU General Public License, version 2.0 | ||
11 | * ("GPL"), unless you have obtained a separate licensing agreement | ||
12 | * ("Other License"), formally executed by you and Linden Lab. Terms of | ||
13 | * the GPL can be found in doc/GPL-license.txt in this distribution, or | ||
14 | * online at http://secondlife.com/developers/opensource/gplv2 | ||
15 | * | ||
16 | * There are special exceptions to the terms and conditions of the GPL as | ||
17 | * it is applied to this Source Code. View the full text of the exception | ||
18 | * in the file doc/FLOSS-exception.txt in this software distribution, or | ||
19 | * online at http://secondlife.com/developers/opensource/flossexception | ||
20 | * | ||
21 | * By copying, modifying or distributing this software, you acknowledge | ||
22 | * that you have read and understood your obligations described above, | ||
23 | * and agree to abide by those obligations. | ||
24 | * | ||
25 | * ALL LINDEN LAB SOURCE CODE IS PROVIDED "AS IS." LINDEN LAB MAKES NO | ||
26 | * WARRANTIES, EXPRESS, IMPLIED OR OTHERWISE, REGARDING ITS ACCURACY, | ||
27 | * COMPLETENESS OR PERFORMANCE. | ||
28 | */ | ||
29 | |||
30 | #include "linden_common.h" | ||
31 | #include "lltut.h" | ||
32 | |||
33 | #include "llparcel.h" | ||
34 | |||
35 | #include <string> | ||
36 | |||
37 | namespace tut | ||
38 | { | ||
39 | struct llinventoryparcel_data | ||
40 | { | ||
41 | }; | ||
42 | typedef test_group<llinventoryparcel_data> llinventoryparcel_test; | ||
43 | typedef llinventoryparcel_test::object llinventoryparcel_object; | ||
44 | tut::llinventoryparcel_test llinventoryparcel("llinventoryparcel"); | ||
45 | |||
46 | template<> template<> | ||
47 | void llinventoryparcel_object::test<1>() | ||
48 | { | ||
49 | for (S32 i=0; i<LLParcel::C_COUNT; ++i) | ||
50 | { | ||
51 | const char *catstring = LLParcel::getCategoryString(LLParcel::ECategory(i)); | ||
52 | ensure("LLParcel::getCategoryString(i)", | ||
53 | NULL != catstring); | ||
54 | |||
55 | const char *catuistring = LLParcel::getCategoryUIString(LLParcel::ECategory(i)); | ||
56 | ensure("LLParcel::getCategoryUIString(i)", | ||
57 | NULL != catuistring); | ||
58 | |||
59 | ensure_equals("LLParcel::ECategory mapping of string back to enum", LLParcel::getCategoryFromString(catstring), i); | ||
60 | ensure_equals("LLParcel::ECategory mapping of uistring back to enum", LLParcel::getCategoryFromUIString(catuistring), i); | ||
61 | } | ||
62 | |||
63 | // test the C_ANY case, which has to work for UI strings | ||
64 | const char *catuistring = LLParcel::getCategoryUIString(LLParcel::C_ANY); | ||
65 | ensure("LLParcel::getCategoryUIString(C_ANY)", | ||
66 | NULL != catuistring); | ||
67 | |||
68 | ensure_equals("LLParcel::ECategory mapping of uistring back to enum", LLParcel::getCategoryFromUIString(catuistring), LLParcel::C_ANY); | ||
69 | } | ||
70 | } | ||
diff --git a/linden/indra/test/lliohttpserver_tut.cpp b/linden/indra/test/lliohttpserver_tut.cpp index 0d914f2..a5693be 100644 --- a/linden/indra/test/lliohttpserver_tut.cpp +++ b/linden/indra/test/lliohttpserver_tut.cpp | |||
@@ -117,7 +117,7 @@ namespace tut | |||
117 | LLSD context; | 117 | LLSD context; |
118 | 118 | ||
119 | chain.push_back(LLIOPipe::ptr_t(injector)); | 119 | chain.push_back(LLIOPipe::ptr_t(injector)); |
120 | LLCreateHTTPPipe(chain, mRoot, LLSD()); | 120 | LLIOHTTPServer::createPipe(chain, mRoot, LLSD()); |
121 | chain.push_back(LLIOPipe::ptr_t(extractor)); | 121 | chain.push_back(LLIOPipe::ptr_t(extractor)); |
122 | 122 | ||
123 | pump->addChain(chain, DEFAULT_CHAIN_EXPIRY_SECS); | 123 | pump->addChain(chain, DEFAULT_CHAIN_EXPIRY_SECS); |
diff --git a/linden/indra/test/llpartdata_tut.cpp b/linden/indra/test/llpartdata_tut.cpp new file mode 100644 index 0000000..ce2cedc --- /dev/null +++ b/linden/indra/test/llpartdata_tut.cpp | |||
@@ -0,0 +1,217 @@ | |||
1 | /** | ||
2 | * @file llpartdata_tut.cpp | ||
3 | * @author Adroit | ||
4 | * @date March 2007 | ||
5 | * @brief LLPartData and LLPartSysData test cases. | ||
6 | * | ||
7 | * Copyright (c) 2007-2007, Linden Research, Inc. | ||
8 | * | ||
9 | * Second Life Viewer Source Code | ||
10 | * The source code in this file ("Source Code") is provided by Linden Lab | ||
11 | * to you under the terms of the GNU General Public License, version 2.0 | ||
12 | * ("GPL"), unless you have obtained a separate licensing agreement | ||
13 | * ("Other License"), formally executed by you and Linden Lab. Terms of | ||
14 | * the GPL can be found in doc/GPL-license.txt in this distribution, or | ||
15 | * online at http://secondlife.com/developers/opensource/gplv2 | ||
16 | * | ||
17 | * There are special exceptions to the terms and conditions of the GPL as | ||
18 | * it is applied to this Source Code. View the full text of the exception | ||
19 | * in the file doc/FLOSS-exception.txt in this software distribution, or | ||
20 | * online at http://secondlife.com/developers/opensource/flossexception | ||
21 | * | ||
22 | * By copying, modifying or distributing this software, you acknowledge | ||
23 | * that you have read and understood your obligations described above, | ||
24 | * and agree to abide by those obligations. | ||
25 | * | ||
26 | * ALL LINDEN LAB SOURCE CODE IS PROVIDED "AS IS." LINDEN LAB MAKES NO | ||
27 | * WARRANTIES, EXPRESS, IMPLIED OR OTHERWISE, REGARDING ITS ACCURACY, | ||
28 | * COMPLETENESS OR PERFORMANCE. | ||
29 | */ | ||
30 | |||
31 | #include <tut/tut.h> | ||
32 | #include "lltut.h" | ||
33 | #include "linden_common.h" | ||
34 | #include "lldatapacker.h" | ||
35 | #include "llpartdata.h" | ||
36 | #include "v3math.h" | ||
37 | #include "llsdserialize.h" | ||
38 | #include "message.h" | ||
39 | |||
40 | namespace tut | ||
41 | { | ||
42 | |||
43 | struct partdata_test | ||
44 | { | ||
45 | }; | ||
46 | typedef test_group<partdata_test> partdata_test_t; | ||
47 | typedef partdata_test_t::object partdata_test_object_t; | ||
48 | tut::partdata_test_t tut_partdata_test("partdata_test"); | ||
49 | |||
50 | template<> template<> | ||
51 | void partdata_test_object_t::test<1>() | ||
52 | { | ||
53 | LLPartData llpdata,llpdata1; | ||
54 | U8 pkbuf[128]; | ||
55 | |||
56 | llpdata.setFlags(LLPartData::LL_PART_INTERP_COLOR_MASK | LLPartData::LL_PART_INTERP_SCALE_MASK | | ||
57 | LLPartData::LL_PART_BOUNCE_MASK | LLPartData::LL_PART_WIND_MASK | LLPartData::LL_PART_FOLLOW_SRC_MASK | | ||
58 | LLPartData::LL_PART_FOLLOW_VELOCITY_MASK | LLPartData::LL_PART_TARGET_POS_MASK | LLPartData::LL_PART_TARGET_LINEAR_MASK | | ||
59 | LLPartData::LL_PART_EMISSIVE_MASK | LLPartData::LL_PART_BEAM_MASK | LLPartData::LL_PART_DEAD_MASK); | ||
60 | |||
61 | llpdata.setMaxAge(29.3f); | ||
62 | |||
63 | LLVector3 llvec1(1.0f, .5f, .25f); | ||
64 | llpdata.setStartColor(llvec1); | ||
65 | llpdata.setStartAlpha(.7f); | ||
66 | |||
67 | LLVector3 llvec2(.2f, .3f, 1.0f); | ||
68 | llpdata.setEndColor(llvec2); | ||
69 | llpdata.setEndAlpha(1.0f); | ||
70 | |||
71 | llpdata.setStartScale(3.23f, 4.0f); | ||
72 | llpdata.setEndScale(2.4678f, 1.0f); | ||
73 | |||
74 | LLDataPackerBinaryBuffer dp((U8*)pkbuf, 128); | ||
75 | llpdata.pack(dp); | ||
76 | |||
77 | S32 cur_size = dp.getCurrentSize(); | ||
78 | |||
79 | LLDataPackerBinaryBuffer dp1((U8*)pkbuf, cur_size); | ||
80 | llpdata1.unpack(dp1); | ||
81 | |||
82 | ensure("1.mFlags values are different after unpacking", llpdata1.mFlags == llpdata.mFlags); | ||
83 | ensure_approximately_equals("2.mMaxAge values are different after unpacking", llpdata1.mMaxAge, llpdata.mMaxAge, 8); | ||
84 | |||
85 | ensure_approximately_equals("3.mStartColor[0] values are different after unpacking", llpdata1.mStartColor.mV[0], llpdata.mStartColor.mV[0], 8); | ||
86 | ensure_approximately_equals("4.mStartColor[1] values are different after unpacking", llpdata1.mStartColor.mV[1], llpdata.mStartColor.mV[1], 8); | ||
87 | ensure_approximately_equals("5.mStartColor[2] values are different after unpacking", llpdata1.mStartColor.mV[2], llpdata.mStartColor.mV[2], 8); | ||
88 | ensure_approximately_equals("6.mStartColor[3] values are different after unpacking", llpdata1.mStartColor.mV[3], llpdata.mStartColor.mV[3], 8); | ||
89 | |||
90 | ensure_approximately_equals("7.mEndColor[0] values are different after unpacking", llpdata1.mEndColor.mV[0], llpdata.mEndColor.mV[0], 8); | ||
91 | ensure_approximately_equals("8.mEndColor[1] values are different after unpacking", llpdata1.mEndColor.mV[1], llpdata.mEndColor.mV[1], 8); | ||
92 | ensure_approximately_equals("9.mEndColor[2] values are different after unpacking", llpdata1.mEndColor.mV[2], llpdata.mEndColor.mV[2], 8); | ||
93 | ensure_approximately_equals("10.mEndColor[2] values are different after unpacking", llpdata1.mEndColor.mV[3], llpdata.mEndColor.mV[3], 8); | ||
94 | |||
95 | ensure_approximately_equals("11.mStartScale[0] values are different after unpacking", llpdata1.mStartScale.mV[0], llpdata.mStartScale.mV[0], 5); | ||
96 | ensure_approximately_equals("12.mStartScale[1] values are different after unpacking", llpdata1.mStartScale.mV[1], llpdata.mStartScale.mV[1], 5); | ||
97 | |||
98 | ensure_approximately_equals("13.mEndScale[0] values are different after unpacking", llpdata1.mEndScale.mV[0], llpdata.mEndScale.mV[0], 5); | ||
99 | ensure_approximately_equals("14.mEndScale[1] values are different after unpacking", llpdata1.mEndScale.mV[1], llpdata.mEndScale.mV[1], 5); | ||
100 | } | ||
101 | |||
102 | |||
103 | template<> template<> | ||
104 | void partdata_test_object_t::test<2>() | ||
105 | { | ||
106 | LLPartData llpdata,llpdata1; | ||
107 | |||
108 | llpdata.setFlags(LLPartData::LL_PART_INTERP_COLOR_MASK | LLPartData::LL_PART_INTERP_SCALE_MASK | | ||
109 | LLPartData::LL_PART_BOUNCE_MASK | LLPartData::LL_PART_WIND_MASK | LLPartData::LL_PART_FOLLOW_SRC_MASK | | ||
110 | LLPartData::LL_PART_FOLLOW_VELOCITY_MASK | LLPartData::LL_PART_TARGET_POS_MASK | LLPartData::LL_PART_TARGET_LINEAR_MASK | | ||
111 | LLPartData::LL_PART_EMISSIVE_MASK | LLPartData::LL_PART_BEAM_MASK | LLPartData::LL_PART_DEAD_MASK); | ||
112 | |||
113 | llpdata.setMaxAge(29.3f); | ||
114 | |||
115 | LLVector3 llvec1(1.0f, .5f, .25f); | ||
116 | llpdata.setStartColor(llvec1); | ||
117 | llpdata.setStartAlpha(.7f); | ||
118 | |||
119 | LLVector3 llvec2(.2f, .3f, 1.0f); | ||
120 | llpdata.setEndColor(llvec2); | ||
121 | llpdata.setEndAlpha(1.0f); | ||
122 | |||
123 | llpdata.setStartScale(3.23f, 4.0f); | ||
124 | llpdata.setEndScale(2.4678f, 1.0f); | ||
125 | |||
126 | LLSD llsd = llpdata.asLLSD(); | ||
127 | |||
128 | llpdata1.fromLLSD(llsd); | ||
129 | |||
130 | ensure("1.mFlags values are different after unpacking", llpdata1.mFlags == llpdata.mFlags); | ||
131 | ensure_approximately_equals("2.mMaxAge values are different after unpacking", llpdata1.mMaxAge, llpdata.mMaxAge, 8); | ||
132 | |||
133 | ensure_approximately_equals("3.mStartColor[0] values are different after unpacking", llpdata1.mStartColor.mV[0], llpdata.mStartColor.mV[0], 8); | ||
134 | ensure_approximately_equals("4.mStartColor[1] values are different after unpacking", llpdata1.mStartColor.mV[1], llpdata.mStartColor.mV[1], 8); | ||
135 | ensure_approximately_equals("5.mStartColor[2] values are different after unpacking", llpdata1.mStartColor.mV[2], llpdata.mStartColor.mV[2], 8); | ||
136 | ensure_approximately_equals("6.mStartColor[3] values are different after unpacking", llpdata1.mStartColor.mV[3], llpdata.mStartColor.mV[3], 8); | ||
137 | |||
138 | ensure_approximately_equals("7.mEndColor[0] values are different after unpacking", llpdata1.mEndColor.mV[0], llpdata.mEndColor.mV[0], 8); | ||
139 | ensure_approximately_equals("8.mEndColor[1] values are different after unpacking", llpdata1.mEndColor.mV[1], llpdata.mEndColor.mV[1], 8); | ||
140 | ensure_approximately_equals("9.mEndColor[2] values are different after unpacking", llpdata1.mEndColor.mV[2], llpdata.mEndColor.mV[2], 8); | ||
141 | ensure_approximately_equals("10.mEndColor[2] values are different after unpacking", llpdata1.mEndColor.mV[3], llpdata.mEndColor.mV[3], 8); | ||
142 | |||
143 | ensure_approximately_equals("11.mStartScale[0] values are different after unpacking", llpdata1.mStartScale.mV[0], llpdata.mStartScale.mV[0], 5); | ||
144 | ensure_approximately_equals("12.mStartScale[1] values are different after unpacking", llpdata1.mStartScale.mV[1], llpdata.mStartScale.mV[1], 5); | ||
145 | |||
146 | ensure_approximately_equals("13.mEndScale[0] values are different after unpacking", llpdata1.mEndScale.mV[0], llpdata.mEndScale.mV[0], 5); | ||
147 | ensure_approximately_equals("14.mEndScale[1] values are different after unpacking", llpdata1.mEndScale.mV[1], llpdata.mEndScale.mV[1], 5); | ||
148 | } | ||
149 | |||
150 | |||
151 | //*********llpartsysdata*********** | ||
152 | |||
153 | template<> template<> | ||
154 | void partdata_test_object_t::test<3>() | ||
155 | { | ||
156 | LLPartSysData llpsysdata, llpsysdata1; | ||
157 | U8 pkbuf[256]; | ||
158 | llpsysdata.setBurstSpeedMin(33.33f); | ||
159 | ensure("1.mBurstSpeedMin coudnt be set", 33.33f == llpsysdata.mBurstSpeedMin); | ||
160 | |||
161 | llpsysdata.setBurstSpeedMax(44.44f); | ||
162 | ensure("2.mBurstSpeedMax coudnt be set", 44.44f == llpsysdata.mBurstSpeedMax); | ||
163 | |||
164 | llpsysdata.setBurstRadius(45.55f); | ||
165 | ensure("3.mBurstRadius coudnt be set", 45.55f == llpsysdata.mBurstRadius); | ||
166 | |||
167 | LLVector3 llvec(44.44f, 111.11f, -40.4f); | ||
168 | llpsysdata.setPartAccel(llvec); | ||
169 | |||
170 | llpsysdata.mCRC = 0xFFFFFFFF; | ||
171 | llpsysdata.mFlags = 0x20; | ||
172 | |||
173 | llpsysdata.mPattern = LLPartSysData::LL_PART_SRC_PATTERN_ANGLE_CONE_EMPTY; | ||
174 | |||
175 | llpsysdata.mMaxAge = 99.99f; | ||
176 | llpsysdata.mStartAge = 18.5f; | ||
177 | llpsysdata.mInnerAngle = 4.234f; | ||
178 | llpsysdata.mOuterAngle = 7.123f; | ||
179 | llpsysdata.mBurstRate = 245.53f; | ||
180 | llpsysdata.mBurstPartCount = 0xFF; | ||
181 | llpsysdata.mAngularVelocity = llvec; | ||
182 | |||
183 | llpsysdata.mPartImageID.generate(); | ||
184 | llpsysdata.mTargetUUID.generate(); | ||
185 | |||
186 | LLDataPackerBinaryBuffer dp((U8*)pkbuf, 256); | ||
187 | llpsysdata.pack(dp); | ||
188 | S32 cur_size = dp.getCurrentSize(); | ||
189 | LLDataPackerBinaryBuffer dp1((U8*)pkbuf, cur_size); | ||
190 | llpsysdata1.unpack(dp1); | ||
191 | |||
192 | ensure("1.mCRC's not equal", llpsysdata.mCRC == llpsysdata1.mCRC); | ||
193 | ensure("2.mFlags's not equal", llpsysdata.mFlags == llpsysdata1.mFlags); | ||
194 | ensure("3.mPattern's not equal", llpsysdata.mPattern == llpsysdata1.mPattern); | ||
195 | ensure_approximately_equals("4.mMaxAge's not equal", llpsysdata.mMaxAge , llpsysdata1.mMaxAge, 8); | ||
196 | ensure_approximately_equals("5.mStartAge's not equal", llpsysdata.mStartAge, llpsysdata1.mStartAge, 8); | ||
197 | ensure_approximately_equals("6.mOuterAngle's not equal", llpsysdata.mOuterAngle, llpsysdata1.mOuterAngle, 5); | ||
198 | ensure_approximately_equals("7.mInnerAngles's not equal", llpsysdata.mInnerAngle, llpsysdata1.mInnerAngle, 5); | ||
199 | ensure_approximately_equals("8.mBurstRate's not equal", llpsysdata.mBurstRate, llpsysdata1.mBurstRate, 8); | ||
200 | ensure("9.mBurstPartCount's not equal", llpsysdata.mBurstPartCount == llpsysdata1.mBurstPartCount); | ||
201 | |||
202 | ensure_approximately_equals("10.mBurstSpeedMin's not equal", llpsysdata.mBurstSpeedMin, llpsysdata1.mBurstSpeedMin, 8); | ||
203 | ensure_approximately_equals("11.mBurstSpeedMax's not equal", llpsysdata.mBurstSpeedMax, llpsysdata1.mBurstSpeedMax, 8); | ||
204 | |||
205 | ensure_approximately_equals("12.mAngularVelocity's not equal", llpsysdata.mAngularVelocity.mV[0], llpsysdata1.mAngularVelocity.mV[0], 7); | ||
206 | ensure_approximately_equals("13.mAngularVelocity's not equal", llpsysdata.mAngularVelocity.mV[1], llpsysdata1.mAngularVelocity.mV[1], 7); | ||
207 | ensure_approximately_equals("14.mAngularVelocity's not equal", llpsysdata.mAngularVelocity.mV[2], llpsysdata1.mAngularVelocity.mV[2], 7); | ||
208 | |||
209 | ensure_approximately_equals("15.mPartAccel's not equal", llpsysdata.mPartAccel.mV[0], llpsysdata1.mPartAccel.mV[0], 7); | ||
210 | ensure_approximately_equals("16.mPartAccel's not equal", llpsysdata.mPartAccel.mV[1], llpsysdata1.mPartAccel.mV[1], 7); | ||
211 | ensure_approximately_equals("17.mPartAccel's not equal", llpsysdata.mPartAccel.mV[2], llpsysdata1.mPartAccel.mV[2], 7); | ||
212 | |||
213 | ensure("18.mPartImageID's not equal", llpsysdata.mPartImageID == llpsysdata1.mPartImageID); | ||
214 | ensure("19.mTargetUUID's not equal", llpsysdata.mTargetUUID == llpsysdata1.mTargetUUID); | ||
215 | ensure_approximately_equals("20.mBurstRadius's not equal", llpsysdata.mBurstRadius, llpsysdata1.mBurstRadius, 8); | ||
216 | } | ||
217 | } | ||
diff --git a/linden/indra/test/llrandom_tut.cpp b/linden/indra/test/llrandom_tut.cpp index c5b0488..c5b0488 100755..100644 --- a/linden/indra/test/llrandom_tut.cpp +++ b/linden/indra/test/llrandom_tut.cpp | |||
diff --git a/linden/indra/test/llsdserialize_tut.cpp b/linden/indra/test/llsdserialize_tut.cpp index 80a4336..497c529 100644 --- a/linden/indra/test/llsdserialize_tut.cpp +++ b/linden/indra/test/llsdserialize_tut.cpp | |||
@@ -36,6 +36,9 @@ | |||
36 | #include "lltut.h" | 36 | #include "lltut.h" |
37 | #include "llformat.h" | 37 | #include "llformat.h" |
38 | 38 | ||
39 | // These tests take too long to run on Windows. JC | ||
40 | #if !LL_WINDOWS | ||
41 | |||
39 | namespace tut | 42 | namespace tut |
40 | { | 43 | { |
41 | struct sd_xml_data | 44 | struct sd_xml_data |
@@ -577,3 +580,5 @@ namespace tut | |||
577 | multiple values inside an LLSD | 580 | multiple values inside an LLSD |
578 | */ | 581 | */ |
579 | } | 582 | } |
583 | |||
584 | #endif | ||
diff --git a/linden/indra/test/llservicebuilder_tut.cpp b/linden/indra/test/llservicebuilder_tut.cpp index fde0564..762aa46 100644 --- a/linden/indra/test/llservicebuilder_tut.cpp +++ b/linden/indra/test/llservicebuilder_tut.cpp | |||
@@ -1,9 +1,9 @@ | |||
1 | /** | 1 | /** |
2 | * @file llservicebuilder_tut.cpp | 2 | * @file llservicebuilder_tut.cpp |
3 | * @brief LLServiceBuilder unit tests | 3 | * @brief LLServiceBuilder unit tests |
4 | * @date March 2007 | 4 | * @date March 2007 |
5 | * | 5 | * |
6 | * Copyright (c) 2006-2007, Linden Research, Inc. | 6 | * Copyright (c) 2006-2007, Linden Research, Inc. |
7 | * | 7 | * |
8 | * Second Life Viewer Source Code | 8 | * Second Life Viewer Source Code |
9 | * The source code in this file ("Source Code") is provided by Linden Lab | 9 | * The source code in this file ("Source Code") is provided by Linden Lab |
@@ -24,73 +24,73 @@ | |||
24 | * | 24 | * |
25 | * ALL LINDEN LAB SOURCE CODE IS PROVIDED "AS IS." LINDEN LAB MAKES NO | 25 | * ALL LINDEN LAB SOURCE CODE IS PROVIDED "AS IS." LINDEN LAB MAKES NO |
26 | * WARRANTIES, EXPRESS, IMPLIED OR OTHERWISE, REGARDING ITS ACCURACY, | 26 | * WARRANTIES, EXPRESS, IMPLIED OR OTHERWISE, REGARDING ITS ACCURACY, |
27 | * COMPLETENESS OR PERFORMANCE. | 27 | * COMPLETENESS OR PERFORMANCE. |
28 | */ | 28 | */ |
29 | 29 | ||
30 | #include <tut/tut.h> | 30 | #include <tut/tut.h> |
31 | #include "lltut.h" | 31 | #include "lltut.h" |
32 | 32 | ||
33 | #include "llsd.h" | 33 | #include "llsd.h" |
34 | #include "llservicebuilder.h" | 34 | #include "llservicebuilder.h" |
35 | 35 | ||
36 | namespace tut | 36 | namespace tut |
37 | { | 37 | { |
38 | 38 | ||
39 | struct ServiceBuilderTestData { | 39 | struct ServiceBuilderTestData { |
40 | LLServiceBuilder mServiceBuilder; | 40 | LLServiceBuilder mServiceBuilder; |
41 | }; | 41 | }; |
42 | 42 | ||
43 | typedef test_group<ServiceBuilderTestData> ServiceBuilderTestGroup; | 43 | typedef test_group<ServiceBuilderTestData> ServiceBuilderTestGroup; |
44 | typedef ServiceBuilderTestGroup::object ServiceBuilderTestObject; | 44 | typedef ServiceBuilderTestGroup::object ServiceBuilderTestObject; |
45 | 45 | ||
46 | ServiceBuilderTestGroup serviceBuilderTestGroup("ServiceBuilder"); | 46 | ServiceBuilderTestGroup serviceBuilderTestGroup("ServiceBuilder"); |
47 | 47 | ||
48 | template<> template<> | 48 | template<> template<> |
49 | void ServiceBuilderTestObject::test<1>() | 49 | void ServiceBuilderTestObject::test<1>() |
50 | { | 50 | { |
51 | //Simple service build and reply with no mapping | 51 | //Simple service build and reply with no mapping |
52 | LLSD test_block; | 52 | LLSD test_block; |
53 | test_block["service-builder"] = "/agent/name"; | 53 | test_block["service-builder"] = "/agent/name"; |
54 | mServiceBuilder.createServiceDefinition("ServiceBuilderTest", test_block["service-builder"]); | 54 | mServiceBuilder.createServiceDefinition("ServiceBuilderTest", test_block["service-builder"]); |
55 | std::string test_url = mServiceBuilder.buildServiceURI("ServiceBuilderTest"); | 55 | std::string test_url = mServiceBuilder.buildServiceURI("ServiceBuilderTest"); |
56 | ensure_equals("Basic URL Creation", test_url , "/agent/name"); | 56 | ensure_equals("Basic URL Creation", test_url , "/agent/name"); |
57 | } | 57 | } |
58 | 58 | ||
59 | template<> template<> | 59 | template<> template<> |
60 | void ServiceBuilderTestObject::test<2>() | 60 | void ServiceBuilderTestObject::test<2>() |
61 | { | 61 | { |
62 | //Simple replace test | 62 | //Simple replace test |
63 | LLSD test_block; | 63 | LLSD test_block; |
64 | test_block["service-builder"] = "/agent/{$agent-id}/name"; | 64 | test_block["service-builder"] = "/agent/{$agent-id}/name"; |
65 | mServiceBuilder.createServiceDefinition("ServiceBuilderTest", test_block["service-builder"]); | 65 | mServiceBuilder.createServiceDefinition("ServiceBuilderTest", test_block["service-builder"]); |
66 | LLSD data_map; | 66 | LLSD data_map; |
67 | data_map["agent-id"] = "257c631f-a0c5-4f29-8a9f-9031feaae6c6"; | 67 | data_map["agent-id"] = "257c631f-a0c5-4f29-8a9f-9031feaae6c6"; |
68 | std::string test_url = mServiceBuilder.buildServiceURI("ServiceBuilderTest", data_map); | 68 | std::string test_url = mServiceBuilder.buildServiceURI("ServiceBuilderTest", data_map); |
69 | ensure_equals("Replacement URL Creation", test_url , "/agent/257c631f-a0c5-4f29-8a9f-9031feaae6c6/name"); | 69 | ensure_equals("Replacement URL Creation", test_url , "/agent/257c631f-a0c5-4f29-8a9f-9031feaae6c6/name"); |
70 | } | 70 | } |
71 | 71 | ||
72 | template<> template<> | 72 | template<> template<> |
73 | void ServiceBuilderTestObject::test<3>() | 73 | void ServiceBuilderTestObject::test<3>() |
74 | { | 74 | { |
75 | //Incorrect service test | 75 | //Incorrect service test |
76 | LLSD test_block; | 76 | LLSD test_block; |
77 | test_block["service-builder"] = "/agent/{$agent-id}/name"; | 77 | test_block["service-builder"] = "/agent/{$agent-id}/name"; |
78 | mServiceBuilder.createServiceDefinition("ServiceBuilderTest", test_block["service-builder"]); | 78 | mServiceBuilder.createServiceDefinition("ServiceBuilderTest", test_block["service-builder"]); |
79 | std::string test_url = mServiceBuilder.buildServiceURI("ServiceBuilder"); | 79 | std::string test_url = mServiceBuilder.buildServiceURI("ServiceBuilder"); |
80 | ensure_equals("Replacement URL Creation for Non-existant Service", test_url , ""); | 80 | ensure_equals("Replacement URL Creation for Non-existant Service", test_url , ""); |
81 | } | 81 | } |
82 | 82 | ||
83 | template<> template<> | 83 | template<> template<> |
84 | void ServiceBuilderTestObject::test<4>() | 84 | void ServiceBuilderTestObject::test<4>() |
85 | { | 85 | { |
86 | //Incorrect service test | 86 | //Incorrect service test |
87 | LLSD test_block; | 87 | LLSD test_block; |
88 | test_block["service-builder"] = "/agent/{$agent-id}/name"; | 88 | test_block["service-builder"] = "/agent/{$agent-id}/name"; |
89 | mServiceBuilder.createServiceDefinition("ServiceBuilderTest", test_block["service-builder"]); | 89 | mServiceBuilder.createServiceDefinition("ServiceBuilderTest", test_block["service-builder"]); |
90 | LLSD data_map; | 90 | LLSD data_map; |
91 | data_map["agent_id"] = "257c631f-a0c5-4f29-8a9f-9031feaae6c6"; | 91 | data_map["agent_id"] = "257c631f-a0c5-4f29-8a9f-9031feaae6c6"; |
92 | std::string test_url = mServiceBuilder.buildServiceURI("ServiceBuilderTest", data_map); | 92 | std::string test_url = mServiceBuilder.buildServiceURI("ServiceBuilderTest", data_map); |
93 | ensure_equals("Replacement URL Creation for Non-existant Service", test_url , "/agent/{$agent-id}/name"); | 93 | ensure_equals("Replacement URL Creation for Non-existant Service", test_url , "/agent/{$agent-id}/name"); |
94 | } | 94 | } |
95 | } | 95 | } |
96 | 96 | ||
diff --git a/linden/indra/test/llstring_tut.cpp b/linden/indra/test/llstring_tut.cpp new file mode 100644 index 0000000..040955b --- /dev/null +++ b/linden/indra/test/llstring_tut.cpp | |||
@@ -0,0 +1,498 @@ | |||
1 | /** | ||
2 | * @file llstring_tut.cpp | ||
3 | * @author Adroit | ||
4 | * @date 2006-12-24 | ||
5 | * @brief Test cases of llstring.cpp | ||
6 | * | ||
7 | * Copyright (c) 2007-2007, Linden Research, Inc. | ||
8 | * | ||
9 | * The source code in this file ("Source Code") is provided by Linden Lab | ||
10 | * to you under the terms of the GNU General Public License, version 2.0 | ||
11 | * ("GPL"), unless you have obtained a separate licensing agreement | ||
12 | * ("Other License"), formally executed by you and Linden Lab. Terms of | ||
13 | * the GPL can be found in doc/GPL-license.txt in this distribution, or | ||
14 | * online at http://secondlife.com/developers/opensource/gplv2 | ||
15 | * | ||
16 | * There are special exceptions to the terms and conditions of the GPL as | ||
17 | * it is applied to this Source Code. View the full text of the exception | ||
18 | * in the file doc/FLOSS-exception.txt in this software distribution, or | ||
19 | * online at http://secondlife.com/developers/opensource/flossexception | ||
20 | * | ||
21 | * By copying, modifying or distributing this software, you acknowledge | ||
22 | * that you have read and understood your obligations described above, | ||
23 | * and agree to abide by those obligations. | ||
24 | * | ||
25 | * ALL LINDEN LAB SOURCE CODE IS PROVIDED "AS IS." LINDEN LAB MAKES NO | ||
26 | * WARRANTIES, EXPRESS, IMPLIED OR OTHERWISE, REGARDING ITS ACCURACY, | ||
27 | * COMPLETENESS OR PERFORMANCE. | ||
28 | */ | ||
29 | |||
30 | #include <tut/tut.h> | ||
31 | #include "lltut.h" | ||
32 | #include "linden_common.h" | ||
33 | #include "llstring.h" | ||
34 | |||
35 | namespace tut | ||
36 | { | ||
37 | struct string_index | ||
38 | { | ||
39 | }; | ||
40 | typedef test_group<string_index> string_index_t; | ||
41 | typedef string_index_t::object string_index_object_t; | ||
42 | tut::string_index_t tut_string_index("string_test"); | ||
43 | |||
44 | template<> template<> | ||
45 | void string_index_object_t::test<1>() | ||
46 | { | ||
47 | LLString llstr1; | ||
48 | ensure("Empty LLString", (llstr1.size() == 0) && llstr1.empty()); | ||
49 | |||
50 | LLString llstr2("Hello"); | ||
51 | ensure("LLString = Hello", (!strcmp(llstr2.c_str(), "Hello")) && (llstr2.size() == 5) && !llstr2.empty()); | ||
52 | |||
53 | LLString llstr3(llstr2); | ||
54 | ensure("LLString = LLString(LLString)", (!strcmp(llstr3.c_str(), "Hello")) && (llstr3.size() == 5) && !llstr3.empty()); | ||
55 | |||
56 | std::string str("Hello World"); | ||
57 | LLString llstr4(str, 6); | ||
58 | ensure("LLString = LLString(s, size_type pos, size_type n = npos)", (!strcmp(llstr4.c_str(), "World")) && (llstr4.size() == 5) && !llstr4.empty()); | ||
59 | |||
60 | LLString llstr5(str, str.size()); | ||
61 | ensure("LLString = LLString(s, size_type pos, size_type n = npos)", (llstr5.size() == 0) && llstr5.empty()); | ||
62 | |||
63 | LLString llstr6(5, 'A'); | ||
64 | ensure("LLString = LLString(count, c)", (!strcmp(llstr6.c_str(), "AAAAA")) && (llstr6.size() == 5) && !llstr6.empty()); | ||
65 | |||
66 | LLString llstr7("Hello World", 5); | ||
67 | ensure("LLString(s, n)", (!strcmp(llstr7.c_str(), "Hello")) && (llstr7.size() == 5) && !llstr7.empty()); | ||
68 | |||
69 | LLString llstr8("Hello World", 6, 5); | ||
70 | ensure("LLString(s, n, count)", (!strcmp(llstr8.c_str(), "World")) && (llstr8.size() == 5) && !llstr8.empty()); | ||
71 | |||
72 | LLString llstr9("Hello World", sizeof("Hello World")-1, 5); // go past end | ||
73 | ensure("LLString(s, n, count) goes past end", (llstr9.size() == 0) && llstr9.empty()); | ||
74 | } | ||
75 | |||
76 | template<> template<> | ||
77 | void string_index_object_t::test<2>() | ||
78 | { | ||
79 | LLString str("Len=5"); | ||
80 | ensure("isValidIndex failed", LLString::isValidIndex(str, 0) == TRUE && | ||
81 | LLString::isValidIndex(str, 5) == TRUE && | ||
82 | LLString::isValidIndex(str, 6) == FALSE); | ||
83 | |||
84 | LLString str1; | ||
85 | ensure("isValidIndex failed fo rempty string", LLString::isValidIndex(str1, 0) == FALSE); | ||
86 | } | ||
87 | |||
88 | template<> template<> | ||
89 | void string_index_object_t::test<3>() | ||
90 | { | ||
91 | LLString str_val(" Testing the extra whitespaces "); | ||
92 | LLString::trimHead(str_val); | ||
93 | ensure_equals("1: trimHead failed", str_val, "Testing the extra whitespaces "); | ||
94 | |||
95 | LLString str_val1("\n\t\r\n Testing the extra whitespaces "); | ||
96 | LLString::trimHead(str_val1); | ||
97 | ensure_equals("2: trimHead failed", str_val1, "Testing the extra whitespaces "); | ||
98 | } | ||
99 | |||
100 | template<> template<> | ||
101 | void string_index_object_t::test<4>() | ||
102 | { | ||
103 | LLString str_val(" Testing the extra whitespaces "); | ||
104 | LLString::trimTail(str_val); | ||
105 | ensure_equals("1: trimTail failed", str_val, " Testing the extra whitespaces"); | ||
106 | |||
107 | LLString str_val1("\n Testing the extra whitespaces \n\t\r\n "); | ||
108 | LLString::trimTail(str_val1); | ||
109 | ensure_equals("2: trimTail failed", str_val1, "\n Testing the extra whitespaces"); | ||
110 | } | ||
111 | |||
112 | |||
113 | template<> template<> | ||
114 | void string_index_object_t::test<5>() | ||
115 | { | ||
116 | LLString str_val(" \t \r Testing the extra \r\n whitespaces \n \t "); | ||
117 | LLString::trim(str_val); | ||
118 | ensure_equals("1: trim failed", str_val, "Testing the extra \r\n whitespaces"); | ||
119 | } | ||
120 | |||
121 | template<> template<> | ||
122 | void string_index_object_t::test<6>() | ||
123 | { | ||
124 | LLString str("Second LindenLabs"); | ||
125 | LLString::truncate(str, 6); | ||
126 | ensure_equals("1: truncate", str, "Second"); | ||
127 | |||
128 | // further truncate more than the length | ||
129 | LLString::truncate(str, 0); | ||
130 | ensure_equals("2: truncate", str, ""); | ||
131 | } | ||
132 | |||
133 | template<> template<> | ||
134 | void string_index_object_t::test<7>() | ||
135 | { | ||
136 | LLString str_val("SecondLife Source"); | ||
137 | LLString::toUpper(str_val); | ||
138 | ensure_equals("toUpper failed", str_val, "SECONDLIFE SOURCE"); | ||
139 | } | ||
140 | |||
141 | template<> template<> | ||
142 | void string_index_object_t::test<8>() | ||
143 | { | ||
144 | LLString str_val("SecondLife Source"); | ||
145 | LLString::toLower(str_val); | ||
146 | ensure_equals("toLower failed", str_val, "secondlife source"); | ||
147 | } | ||
148 | |||
149 | template<> template<> | ||
150 | void string_index_object_t::test<9>() | ||
151 | { | ||
152 | LLString str_val("Second"); | ||
153 | ensure("1. isHead failed", LLString::isHead(str_val, "SecondLife Source") == TRUE); | ||
154 | ensure("2. isHead failed", LLString::isHead(str_val, " SecondLife Source") == FALSE); | ||
155 | LLString str_val2(""); | ||
156 | ensure("3. isHead failed", LLString::isHead(str_val2, "") == FALSE); | ||
157 | } | ||
158 | |||
159 | template<> template<> | ||
160 | void string_index_object_t::test<10>() | ||
161 | { | ||
162 | LLString str_val("Hello.\n\n Lindenlabs. \n This is \na simple test.\n"); | ||
163 | LLString orig_str_val(str_val); | ||
164 | LLString::addCRLF(str_val); | ||
165 | ensure_equals("addCRLF failed", str_val, "Hello.\r\n\r\n Lindenlabs. \r\n This is \r\na simple test.\r\n"); | ||
166 | LLString::removeCRLF(str_val); | ||
167 | ensure_equals("removeCRLF failed", str_val, orig_str_val); | ||
168 | } | ||
169 | |||
170 | template<> template<> | ||
171 | void string_index_object_t::test<11>() | ||
172 | { | ||
173 | LLString str_val("Hello.\n\n\t \t Lindenlabs. \t\t"); | ||
174 | LLString orig_str_val(str_val); | ||
175 | LLString::replaceTabsWithSpaces(str_val, 1); | ||
176 | ensure_equals("replaceTabsWithSpaces failed", str_val, "Hello.\n\n Lindenlabs. "); | ||
177 | LLString::replaceTabsWithSpaces(orig_str_val, 0); | ||
178 | ensure_equals("replaceTabsWithSpaces failed for 0", orig_str_val, "Hello.\n\n Lindenlabs. "); | ||
179 | |||
180 | str_val = "\t\t\t\t"; | ||
181 | LLString::replaceTabsWithSpaces(str_val, 0); | ||
182 | ensure_equals("replaceTabsWithSpaces failed for all tabs", str_val, ""); | ||
183 | } | ||
184 | |||
185 | template<> template<> | ||
186 | void string_index_object_t::test<12>() | ||
187 | { | ||
188 | LLString str_val("Hello.\n\n\t\t\r\nLindenlabsX."); | ||
189 | LLString::replaceNonstandardASCII(str_val, 'X'); | ||
190 | ensure_equals("replaceNonstandardASCII failed", str_val, "Hello.\n\nXXX\nLindenlabsX."); | ||
191 | } | ||
192 | |||
193 | template<> template<> | ||
194 | void string_index_object_t::test<13>() | ||
195 | { | ||
196 | LLString str_val("Hello.\n\t\r\nABCDEFGHIABABAB"); | ||
197 | LLString::replaceChar(str_val, 'A', 'X'); | ||
198 | ensure_equals("1: replaceChar failed", str_val, "Hello.\n\t\r\nXBCDEFGHIXBXBXB"); | ||
199 | LLString str_val1("Hello.\n\t\r\nABCDEFGHIABABAB"); | ||
200 | } | ||
201 | |||
202 | template<> template<> | ||
203 | void string_index_object_t::test<14>() | ||
204 | { | ||
205 | LLString str_val("Hello.\n\r\t"); | ||
206 | ensure("containsNonprintable failed", LLString::containsNonprintable(str_val) == TRUE); | ||
207 | |||
208 | str_val = "ABC "; | ||
209 | ensure("containsNonprintable failed", LLString::containsNonprintable(str_val) == FALSE); | ||
210 | } | ||
211 | |||
212 | template<> template<> | ||
213 | void string_index_object_t::test<15>() | ||
214 | { | ||
215 | LLString str_val("Hello.\n\r\t Again!"); | ||
216 | LLString::stripNonprintable(str_val); | ||
217 | ensure_equals("stripNonprintable failed", str_val, "Hello. Again!"); | ||
218 | |||
219 | str_val = "\r\n\t\t"; | ||
220 | LLString::stripNonprintable(str_val); | ||
221 | ensure_equals("stripNonprintable resulting in empty string failed", str_val, ""); | ||
222 | } | ||
223 | |||
224 | template<> template<> | ||
225 | void string_index_object_t::test<16>() | ||
226 | { | ||
227 | BOOL value; | ||
228 | LLString str_val("1"); | ||
229 | ensure("convertToBOOL 1 failed", LLString::convertToBOOL(str_val, value) && value); | ||
230 | str_val = "T"; | ||
231 | ensure("convertToBOOL T failed", LLString::convertToBOOL(str_val, value) && value); | ||
232 | str_val = "t"; | ||
233 | ensure("convertToBOOL t failed", LLString::convertToBOOL(str_val, value) && value); | ||
234 | str_val = "TRUE"; | ||
235 | ensure("convertToBOOL TRUE failed", LLString::convertToBOOL(str_val, value) && value); | ||
236 | str_val = "True"; | ||
237 | ensure("convertToBOOL True failed", LLString::convertToBOOL(str_val, value) && value); | ||
238 | str_val = "true"; | ||
239 | ensure("convertToBOOL true failed", LLString::convertToBOOL(str_val, value) && value); | ||
240 | |||
241 | str_val = "0"; | ||
242 | ensure("convertToBOOL 0 failed", LLString::convertToBOOL(str_val, value) && !value); | ||
243 | str_val = "F"; | ||
244 | ensure("convertToBOOL F failed", LLString::convertToBOOL(str_val, value) && !value); | ||
245 | str_val = "f"; | ||
246 | ensure("convertToBOOL f failed", LLString::convertToBOOL(str_val, value) && !value); | ||
247 | str_val = "FALSE"; | ||
248 | ensure("convertToBOOL FASLE failed", LLString::convertToBOOL(str_val, value) && !value); | ||
249 | str_val = "False"; | ||
250 | ensure("convertToBOOL False failed", LLString::convertToBOOL(str_val, value) && !value); | ||
251 | str_val = "false"; | ||
252 | ensure("convertToBOOL false failed", LLString::convertToBOOL(str_val, value) && !value); | ||
253 | |||
254 | str_val = "Tblah"; | ||
255 | ensure("convertToBOOL false failed", !LLString::convertToBOOL(str_val, value)); | ||
256 | } | ||
257 | |||
258 | template<> template<> | ||
259 | void string_index_object_t::test<17>() | ||
260 | { | ||
261 | U8 value; | ||
262 | LLString str_val("255"); | ||
263 | ensure("1: convertToU8 failed", LLString::convertToU8(str_val, value) && value == 255); | ||
264 | |||
265 | str_val = "0"; | ||
266 | ensure("2: convertToU8 failed", LLString::convertToU8(str_val, value) && value == 0); | ||
267 | |||
268 | str_val = "-1"; | ||
269 | ensure("3: convertToU8 failed", !LLString::convertToU8(str_val, value)); | ||
270 | |||
271 | str_val = "256"; // bigger than MAX_U8 | ||
272 | ensure("4: convertToU8 failed", !LLString::convertToU8(str_val, value)); | ||
273 | } | ||
274 | |||
275 | template<> template<> | ||
276 | void string_index_object_t::test<18>() | ||
277 | { | ||
278 | S8 value; | ||
279 | LLString str_val("127"); | ||
280 | ensure("1: convertToS8 failed", LLString::convertToS8(str_val, value) && value == 127); | ||
281 | |||
282 | str_val = "0"; | ||
283 | ensure("2: convertToS8 failed", LLString::convertToS8(str_val, value) && value == 0); | ||
284 | |||
285 | str_val = "-128"; | ||
286 | ensure("3: convertToS8 failed", LLString::convertToS8(str_val, value) && value == -128); | ||
287 | |||
288 | str_val = "128"; // bigger than MAX_S8 | ||
289 | ensure("4: convertToS8 failed", !LLString::convertToS8(str_val, value)); | ||
290 | |||
291 | str_val = "-129"; | ||
292 | ensure("5: convertToS8 failed", !LLString::convertToS8(str_val, value)); | ||
293 | } | ||
294 | |||
295 | template<> template<> | ||
296 | void string_index_object_t::test<19>() | ||
297 | { | ||
298 | S16 value; | ||
299 | LLString str_val("32767"); | ||
300 | ensure("1: convertToS16 failed", LLString::convertToS16(str_val, value) && value == 32767); | ||
301 | |||
302 | str_val = "0"; | ||
303 | ensure("2: convertToS16 failed", LLString::convertToS16(str_val, value) && value == 0); | ||
304 | |||
305 | str_val = "-32768"; | ||
306 | ensure("3: convertToS16 failed", LLString::convertToS16(str_val, value) && value == -32768); | ||
307 | |||
308 | str_val = "32768"; | ||
309 | ensure("4: convertToS16 failed", !LLString::convertToS16(str_val, value)); | ||
310 | |||
311 | str_val = "-32769"; | ||
312 | ensure("5: convertToS16 failed", !LLString::convertToS16(str_val, value)); | ||
313 | } | ||
314 | |||
315 | template<> template<> | ||
316 | void string_index_object_t::test<20>() | ||
317 | { | ||
318 | U16 value; | ||
319 | LLString str_val("65535"); //0xFFFF | ||
320 | ensure("1: convertToU16 failed", LLString::convertToU16(str_val, value) && value == 65535); | ||
321 | |||
322 | str_val = "0"; | ||
323 | ensure("2: convertToU16 failed", LLString::convertToU16(str_val, value) && value == 0); | ||
324 | |||
325 | str_val = "-1"; | ||
326 | ensure("3: convertToU16 failed", !LLString::convertToU16(str_val, value)); | ||
327 | |||
328 | str_val = "65536"; | ||
329 | ensure("4: convertToU16 failed", !LLString::convertToU16(str_val, value)); | ||
330 | } | ||
331 | |||
332 | template<> template<> | ||
333 | void string_index_object_t::test<21>() | ||
334 | { | ||
335 | U32 value; | ||
336 | LLString str_val("4294967295"); //0xFFFFFFFF | ||
337 | ensure("1: convertToU32 failed", LLString::convertToU32(str_val, value) && value == 4294967295); | ||
338 | |||
339 | str_val = "0"; | ||
340 | ensure("2: convertToU32 failed", LLString::convertToU32(str_val, value) && value == 0); | ||
341 | |||
342 | str_val = "-1"; | ||
343 | ensure("3: convertToU32 failed", LLString::convertToU32(str_val, value) && value == 4294967295); | ||
344 | |||
345 | str_val = "4294967296"; | ||
346 | ensure("4: convertToU32 failed", !LLString::convertToU32(str_val, value)); | ||
347 | } | ||
348 | |||
349 | template<> template<> | ||
350 | void string_index_object_t::test<22>() | ||
351 | { | ||
352 | S32 value; | ||
353 | LLString str_val("2147483647"); //0x7FFFFFFF | ||
354 | ensure("1: convertToS32 failed", LLString::convertToS32(str_val, value) && value == 2147483647); | ||
355 | |||
356 | str_val = "0"; | ||
357 | ensure("2: convertToS32 failed", LLString::convertToS32(str_val, value) && value == 0); | ||
358 | |||
359 | str_val = "-2147483648"; | ||
360 | ensure("3: convertToS32 failed", LLString::convertToS32(str_val, value) && value == -2147483648); | ||
361 | |||
362 | str_val = "2147483648"; | ||
363 | ensure("4: convertToS32 failed", !LLString::convertToS32(str_val, value)); | ||
364 | |||
365 | str_val = "-2147483649"; | ||
366 | ensure("5: convertToS32 failed", !LLString::convertToS32(str_val, value)); | ||
367 | } | ||
368 | |||
369 | template<> template<> | ||
370 | void string_index_object_t::test<23>() | ||
371 | { | ||
372 | F32 value; | ||
373 | LLString str_val("2147483647"); //0x7FFFFFFF | ||
374 | ensure("1: convertToF32 failed", LLString::convertToF32(str_val, value) && value == 2147483647); | ||
375 | |||
376 | str_val = "0"; | ||
377 | ensure("2: convertToF32 failed", LLString::convertToF32(str_val, value) && value == 0); | ||
378 | |||
379 | /* Need to find max/min F32 values | ||
380 | str_val = "-2147483648"; | ||
381 | ensure("3: convertToF32 failed", LLString::convertToF32(str_val, value) && value == -2147483648); | ||
382 | |||
383 | str_val = "2147483648"; | ||
384 | ensure("4: convertToF32 failed", !LLString::convertToF32(str_val, value)); | ||
385 | |||
386 | str_val = "-2147483649"; | ||
387 | ensure("5: convertToF32 failed", !LLString::convertToF32(str_val, value)); | ||
388 | */ | ||
389 | } | ||
390 | |||
391 | template<> template<> | ||
392 | void string_index_object_t::test<24>() | ||
393 | { | ||
394 | F64 value; | ||
395 | LLString str_val("9223372036854775807"); //0x7FFFFFFFFFFFFFFF | ||
396 | ensure("1: convertToF64 failed", LLString::convertToF64(str_val, value) && value == 9223372036854775807); | ||
397 | |||
398 | str_val = "0"; | ||
399 | ensure("2: convertToF64 failed", LLString::convertToF64(str_val, value) && value == 0); | ||
400 | |||
401 | /* Need to find max/min F64 values | ||
402 | str_val = "-2147483648"; | ||
403 | ensure("3: convertToF32 failed", LLString::convertToF32(str_val, value) && value == -2147483648); | ||
404 | |||
405 | str_val = "2147483648"; | ||
406 | ensure("4: convertToF32 failed", !LLString::convertToF32(str_val, value)); | ||
407 | |||
408 | str_val = "-2147483649"; | ||
409 | ensure("5: convertToF32 failed", !LLString::convertToF32(str_val, value)); | ||
410 | */ | ||
411 | } | ||
412 | |||
413 | template<> template<> | ||
414 | void string_index_object_t::test<25>() | ||
415 | { | ||
416 | char* str1 = NULL; | ||
417 | char* str2 = NULL; | ||
418 | |||
419 | ensure("1: compareStrings failed", LLString::compareStrings(str1, str2) == 0); | ||
420 | str2 = "A"; | ||
421 | ensure("2: compareStrings failed", LLString::compareStrings(str1, str2) > 0); | ||
422 | ensure("3: compareStrings failed", LLString::compareStrings(str2, str1) < 0); | ||
423 | |||
424 | str1 = "A is smaller than B"; | ||
425 | str2 = "B is greater than A"; | ||
426 | ensure("4: compareStrings failed", LLString::compareStrings(str1, str2) < 0); | ||
427 | |||
428 | str2 = "A is smaller than B"; | ||
429 | ensure("5: compareStrings failed", LLString::compareStrings(str1, str2) == 0); | ||
430 | } | ||
431 | |||
432 | template<> template<> | ||
433 | void string_index_object_t::test<26>() | ||
434 | { | ||
435 | char* str1 = NULL; | ||
436 | char* str2 = NULL; | ||
437 | |||
438 | ensure("1: compareInsensitive failed", LLString::compareInsensitive(str1, str2) == 0); | ||
439 | str2 = "A"; | ||
440 | ensure("2: compareInsensitive failed", LLString::compareInsensitive(str1, str2) > 0); | ||
441 | ensure("3: compareInsensitive failed", LLString::compareInsensitive(str2, str1) < 0); | ||
442 | |||
443 | str1 = "A is equal to a"; | ||
444 | str2 = "a is EQUAL to A"; | ||
445 | ensure("4: compareInsensitive failed", LLString::compareInsensitive(str1, str2) == 0); | ||
446 | } | ||
447 | |||
448 | template<> template<> | ||
449 | void string_index_object_t::test<27>() | ||
450 | { | ||
451 | LLString lhs_str("PROgraM12files"); | ||
452 | LLString rhs_str("PROgram12Files"); | ||
453 | ensure("compareDict 1 failed", LLString::compareDict(lhs_str, rhs_str) < 0); | ||
454 | ensure("precedesDict 1 failed", LLString::precedesDict(lhs_str, rhs_str) == TRUE); | ||
455 | |||
456 | lhs_str = "PROgram12Files"; | ||
457 | rhs_str = "PROgram12Files"; | ||
458 | ensure("compareDict 2 failed", LLString::compareDict(lhs_str, rhs_str) == 0); | ||
459 | ensure("precedesDict 2 failed", LLString::precedesDict(lhs_str, rhs_str) == FALSE); | ||
460 | |||
461 | lhs_str = "PROgram12Files"; | ||
462 | rhs_str = "PROgRAM12FILES"; | ||
463 | ensure("compareDict 3 failed", LLString::compareDict(lhs_str, rhs_str) > 0); | ||
464 | ensure("precedesDict 3 failed", LLString::precedesDict(lhs_str, rhs_str) == FALSE); | ||
465 | } | ||
466 | |||
467 | template<> template<> | ||
468 | void string_index_object_t::test<28>() | ||
469 | { | ||
470 | char str1[] = "First String..."; | ||
471 | char str2[100]; | ||
472 | |||
473 | LLString::copy(str2, str1, 100); | ||
474 | ensure("LLString::copy with enough dest lenght failed", strcmp(str2, str1) == 0); | ||
475 | LLString::copy(str2, str1, sizeof("First")); | ||
476 | ensure("LLString::copy with less dest lenght failed", strcmp(str2, "First") == 0); | ||
477 | } | ||
478 | |||
479 | template<> template<> | ||
480 | void string_index_object_t::test<29>() | ||
481 | { | ||
482 | LLString str1 = "This is the sentence..."; | ||
483 | LLString str2 = "This is the "; | ||
484 | LLString str3 = "first "; | ||
485 | LLString str4 = "This is the first sentence..."; | ||
486 | LLString str5 = "This is the sentence...first "; | ||
487 | LLString dest; | ||
488 | |||
489 | dest = str1; | ||
490 | LLString::copyInto(dest, str3, str2.length()); | ||
491 | ensure("LLString::copyInto insert failed", dest == str4); | ||
492 | |||
493 | dest = str1; | ||
494 | LLString::copyInto(dest, str3, dest.length()); | ||
495 | ensure("LLString::copyInto append failed", dest == str5); | ||
496 | } | ||
497 | } | ||
498 | |||
diff --git a/linden/indra/test/lltut.h b/linden/indra/test/lltut.h index 3e43df8..626ff60 100644 --- a/linden/indra/test/lltut.h +++ b/linden/indra/test/lltut.h | |||
@@ -41,11 +41,27 @@ | |||
41 | 41 | ||
42 | #include "lldate.h" | 42 | #include "lldate.h" |
43 | #include "lluri.h" | 43 | #include "lluri.h" |
44 | #include "llmath.h" | ||
44 | 45 | ||
45 | class LLSD; | 46 | class LLSD; |
46 | 47 | ||
47 | namespace tut | 48 | namespace tut |
48 | { | 49 | { |
50 | inline void ensure_approximately_equals(const char* msg, F32 actual, F32 expected, U32 frac_bits) | ||
51 | { | ||
52 | if(!is_approx_equal_fraction(actual, expected, frac_bits)) | ||
53 | { | ||
54 | std::stringstream ss; | ||
55 | ss << (msg?msg:"") << (msg?": ":"") << "not equal actual: " << actual << " expected: " << expected; | ||
56 | throw tut::failure(ss.str().c_str()); | ||
57 | } | ||
58 | } | ||
59 | |||
60 | inline void ensure_approximately_equals(F32 actual, F32 expected, U32 frac_bits) | ||
61 | { | ||
62 | ensure_approximately_equals(NULL, actual, expected, frac_bits); | ||
63 | } | ||
64 | |||
49 | inline void ensure_memory_matches(const char* msg,const void* actual, U32 actual_len, const void* expected,U32 expected_len) | 65 | inline void ensure_memory_matches(const char* msg,const void* actual, U32 actual_len, const void* expected,U32 expected_len) |
50 | { | 66 | { |
51 | if((expected_len != actual_len) || | 67 | if((expected_len != actual_len) || |
diff --git a/linden/indra/test/llxfer_tut.cpp b/linden/indra/test/llxfer_tut.cpp new file mode 100644 index 0000000..c4665c9 --- /dev/null +++ b/linden/indra/test/llxfer_tut.cpp | |||
@@ -0,0 +1,61 @@ | |||
1 | /** | ||
2 | * @file llxfer_tut.cpp | ||
3 | * @author Moss | ||
4 | * @date 2007-04-17 | ||
5 | * | ||
6 | * Copyright (c) 2007-2007, Linden Research, Inc. | ||
7 | * | ||
8 | * Second Life Viewer Source Code | ||
9 | * The source code in this file ("Source Code") is provided by Linden Lab | ||
10 | * to you under the terms of the GNU General Public License, version 2.0 | ||
11 | * ("GPL"), unless you have obtained a separate licensing agreement | ||
12 | * ("Other License"), formally executed by you and Linden Lab. Terms of | ||
13 | * the GPL can be found in doc/GPL-license.txt in this distribution, or | ||
14 | * online at http://secondlife.com/developers/opensource/gplv2 | ||
15 | * | ||
16 | * There are special exceptions to the terms and conditions of the GPL as | ||
17 | * it is applied to this Source Code. View the full text of the exception | ||
18 | * in the file doc/FLOSS-exception.txt in this software distribution, or | ||
19 | * online at http://secondlife.com/developers/opensource/flossexception | ||
20 | * | ||
21 | * By copying, modifying or distributing this software, you acknowledge | ||
22 | * that you have read and understood your obligations described above, | ||
23 | * and agree to abide by those obligations. | ||
24 | * | ||
25 | * ALL LINDEN LAB SOURCE CODE IS PROVIDED "AS IS." LINDEN LAB MAKES NO | ||
26 | * WARRANTIES, EXPRESS, IMPLIED OR OTHERWISE, REGARDING ITS ACCURACY, | ||
27 | * COMPLETENESS OR PERFORMANCE. | ||
28 | */ | ||
29 | |||
30 | #include "linden_common.h" | ||
31 | #include "lltut.h" | ||
32 | |||
33 | #include "llxfer_file.h" | ||
34 | |||
35 | #include <string> | ||
36 | |||
37 | namespace tut | ||
38 | { | ||
39 | struct llxfer_data | ||
40 | { | ||
41 | }; | ||
42 | typedef test_group<llxfer_data> llxfer_test; | ||
43 | typedef llxfer_test::object llxfer_object; | ||
44 | tut::llxfer_test llxfer("llxfer"); | ||
45 | |||
46 | template<> template<> | ||
47 | void llxfer_object::test<1>() | ||
48 | { | ||
49 | // test that he handle an oversized filename correctly. | ||
50 | LLString oversized_filename; | ||
51 | U32 i; | ||
52 | for (i=0; i<LL_MAX_PATH*2; ++i) // create oversized filename | ||
53 | { | ||
54 | oversized_filename += 'X'; | ||
55 | } | ||
56 | |||
57 | LLXfer_File xff(oversized_filename, FALSE, 1); | ||
58 | ensure("oversized local_filename nul-terminated", | ||
59 | strnlen(xff.getName(), LL_MAX_PATH) < LL_MAX_PATH); | ||
60 | } | ||
61 | } | ||
diff --git a/linden/indra/test/m3math_tut.cpp b/linden/indra/test/m3math_tut.cpp new file mode 100644 index 0000000..62ad365 --- /dev/null +++ b/linden/indra/test/m3math_tut.cpp | |||
@@ -0,0 +1,320 @@ | |||
1 | /** | ||
2 | * @file m3math_tut.cpp | ||
3 | * @author Adroit | ||
4 | * @date March 2007 | ||
5 | * @brief Test cases of m3math.h | ||
6 | * | ||
7 | * Copyright (c) 2007-2007, Linden Research, Inc. | ||
8 | * | ||
9 | * Second Life Viewer Source Code | ||
10 | * The source code in this file ("Source Code") is provided by Linden Lab | ||
11 | * to you under the terms of the GNU General Public License, version 2.0 | ||
12 | * ("GPL"), unless you have obtained a separate licensing agreement | ||
13 | * ("Other License"), formally executed by you and Linden Lab. Terms of | ||
14 | * the GPL can be found in doc/GPL-license.txt in this distribution, or | ||
15 | * online at http://secondlife.com/developers/opensource/gplv2 | ||
16 | * | ||
17 | * There are special exceptions to the terms and conditions of the GPL as | ||
18 | * it is applied to this Source Code. View the full text of the exception | ||
19 | * in the file doc/FLOSS-exception.txt in this software distribution, or | ||
20 | * online at http://secondlife.com/developers/opensource/flossexception | ||
21 | * | ||
22 | * By copying, modifying or distributing this software, you acknowledge | ||
23 | * that you have read and understood your obligations described above, | ||
24 | * and agree to abide by those obligations. | ||
25 | * | ||
26 | * ALL LINDEN LAB SOURCE CODE IS PROVIDED "AS IS." LINDEN LAB MAKES NO | ||
27 | * WARRANTIES, EXPRESS, IMPLIED OR OTHERWISE, REGARDING ITS ACCURACY, | ||
28 | * COMPLETENESS OR PERFORMANCE. | ||
29 | */ | ||
30 | |||
31 | #include <tut/tut.h> | ||
32 | #include "lltut.h" | ||
33 | #include "linden_common.h" | ||
34 | #include "m3math.h" | ||
35 | #include "v3math.h" | ||
36 | #include "v4math.h" | ||
37 | #include "m4math.h" | ||
38 | #include "llquaternion.h" | ||
39 | #include "v3dmath.h" | ||
40 | |||
41 | namespace tut | ||
42 | { | ||
43 | struct m3math_test | ||
44 | { | ||
45 | }; | ||
46 | typedef test_group<m3math_test> m3math_test_t; | ||
47 | typedef m3math_test_t::object m3math_test_object_t; | ||
48 | tut::m3math_test_t tut_m3math_test("m3math_test"); | ||
49 | |||
50 | //test case for identity() fn. | ||
51 | template<> template<> | ||
52 | void m3math_test_object_t::test<1>() | ||
53 | { | ||
54 | LLMatrix3 llmat3_obj; | ||
55 | llmat3_obj.identity(); | ||
56 | ensure("LLMatrix3::identity failed", 1.f == llmat3_obj.mMatrix[0][0] && | ||
57 | 0.f == llmat3_obj.mMatrix[0][1] && | ||
58 | 0.f == llmat3_obj.mMatrix[0][2] && | ||
59 | 0.f == llmat3_obj.mMatrix[1][0] && | ||
60 | 1.f == llmat3_obj.mMatrix[1][1] && | ||
61 | 0.f == llmat3_obj.mMatrix[1][2] && | ||
62 | 0.f == llmat3_obj.mMatrix[2][0] && | ||
63 | 0.f == llmat3_obj.mMatrix[2][1] && | ||
64 | 1.f == llmat3_obj.mMatrix[2][2]); | ||
65 | } | ||
66 | |||
67 | //test case for LLMatrix3& zero() fn. | ||
68 | template<> template<> | ||
69 | void m3math_test_object_t::test<2>() | ||
70 | { | ||
71 | LLMatrix3 llmat3_obj(30, 1, 2, 3); | ||
72 | llmat3_obj.zero(); | ||
73 | |||
74 | ensure("LLMatrix3::zero failed", 0.f == llmat3_obj.zero().mMatrix[0][0] && | ||
75 | 0.f == llmat3_obj.zero().mMatrix[0][1] && | ||
76 | 0.f == llmat3_obj.zero().mMatrix[0][2] && | ||
77 | 0.f == llmat3_obj.zero().mMatrix[1][0] && | ||
78 | 0.f == llmat3_obj.zero().mMatrix[1][1] && | ||
79 | 0.f == llmat3_obj.zero().mMatrix[1][2] && | ||
80 | 0.f == llmat3_obj.zero().mMatrix[2][0] && | ||
81 | 0.f == llmat3_obj.zero().mMatrix[2][1] && | ||
82 | 0.f == llmat3_obj.zero().mMatrix[2][2]); | ||
83 | } | ||
84 | |||
85 | //test case for setRows(const LLVector3 &x_axis, const LLVector3 &y_axis, const LLVector3 &z_axis) fns. | ||
86 | template<> template<> | ||
87 | void m3math_test_object_t::test<3>() | ||
88 | { | ||
89 | LLMatrix3 llmat3_obj; | ||
90 | LLVector3 vect1(2, 1, 4); | ||
91 | LLVector3 vect2(3, 5, 7); | ||
92 | LLVector3 vect3(6, 9, 7); | ||
93 | llmat3_obj.setRows(vect1, vect2, vect3); | ||
94 | ensure("LLVector3::setRows failed ", 2 == llmat3_obj.mMatrix[0][0] && | ||
95 | 1 == llmat3_obj.mMatrix[0][1] && | ||
96 | 4 == llmat3_obj.mMatrix[0][2] && | ||
97 | 3 == llmat3_obj.mMatrix[1][0] && | ||
98 | 5 == llmat3_obj.mMatrix[1][1] && | ||
99 | 7 == llmat3_obj.mMatrix[1][2] && | ||
100 | 6 == llmat3_obj.mMatrix[2][0] && | ||
101 | 9 == llmat3_obj.mMatrix[2][1] && | ||
102 | 7 == llmat3_obj.mMatrix[2][2]); | ||
103 | } | ||
104 | |||
105 | //test case for getFwdRow(), getLeftRow(), getUpRow() fns. | ||
106 | template<> template<> | ||
107 | void m3math_test_object_t::test<4>() | ||
108 | { | ||
109 | LLMatrix3 llmat3_obj; | ||
110 | LLVector3 vect1(2, 1, 4); | ||
111 | LLVector3 vect2(3, 5, 7); | ||
112 | LLVector3 vect3(6, 9, 7); | ||
113 | llmat3_obj.setRows(vect1, vect2, vect3); | ||
114 | |||
115 | ensure("LLVector3::getFwdRow failed ", vect1 == llmat3_obj.getFwdRow()); | ||
116 | ensure("LLVector3::getLeftRow failed ", vect2 == llmat3_obj.getLeftRow()); | ||
117 | ensure("LLVector3::getUpRow failed ", vect3 == llmat3_obj.getUpRow()); | ||
118 | } | ||
119 | |||
120 | //test case for operator*(const LLMatrix3 &a, const LLMatrix3 &b) | ||
121 | template<> template<> | ||
122 | void m3math_test_object_t::test<5>() | ||
123 | { | ||
124 | LLMatrix3 llmat_obj1; | ||
125 | LLMatrix3 llmat_obj2; | ||
126 | LLMatrix3 llmat_obj3; | ||
127 | |||
128 | LLVector3 llvec1(1, 3, 5); | ||
129 | LLVector3 llvec2(3, 6, 1); | ||
130 | LLVector3 llvec3(4, 6, 9); | ||
131 | |||
132 | LLVector3 llvec4(1, 1, 5); | ||
133 | LLVector3 llvec5(3, 6, 8); | ||
134 | LLVector3 llvec6(8, 6, 2); | ||
135 | |||
136 | LLVector3 llvec7(0, 0, 0); | ||
137 | LLVector3 llvec8(0, 0, 0); | ||
138 | LLVector3 llvec9(0, 0, 0); | ||
139 | |||
140 | llmat_obj1.setRows(llvec1, llvec2, llvec3); | ||
141 | llmat_obj2.setRows(llvec4, llvec5, llvec6); | ||
142 | llmat_obj3.setRows(llvec7, llvec8, llvec9); | ||
143 | llmat_obj3 = llmat_obj1 * llmat_obj2; | ||
144 | ensure("LLMatrix3::operator*(const LLMatrix3 &a, const LLMatrix3 &b) failed", | ||
145 | 50 == llmat_obj3.mMatrix[0][0] && | ||
146 | 49 == llmat_obj3.mMatrix[0][1] && | ||
147 | 39 == llmat_obj3.mMatrix[0][2] && | ||
148 | 29 == llmat_obj3.mMatrix[1][0] && | ||
149 | 45 == llmat_obj3.mMatrix[1][1] && | ||
150 | 65 == llmat_obj3.mMatrix[1][2] && | ||
151 | 94 == llmat_obj3.mMatrix[2][0] && | ||
152 | 94 == llmat_obj3.mMatrix[2][1] && | ||
153 | 86 == llmat_obj3.mMatrix[2][2]); | ||
154 | } | ||
155 | |||
156 | |||
157 | //test case for operator*(const LLVector3 &a, const LLMatrix3 &b) | ||
158 | template<> template<> | ||
159 | void m3math_test_object_t::test<6>() | ||
160 | { | ||
161 | |||
162 | LLMatrix3 llmat_obj1; | ||
163 | |||
164 | LLVector3 llvec(1, 3, 5); | ||
165 | LLVector3 res_vec(0, 0, 0); | ||
166 | LLVector3 llvec1(1, 3, 5); | ||
167 | LLVector3 llvec2(3, 6, 1); | ||
168 | LLVector3 llvec3(4, 6, 9); | ||
169 | |||
170 | llmat_obj1.setRows(llvec1, llvec2, llvec3); | ||
171 | res_vec = llvec * llmat_obj1; | ||
172 | |||
173 | LLVector3 expected_result(30, 51, 53); | ||
174 | |||
175 | ensure("LLMatrix3::operator*(const LLVector3 &a, const LLMatrix3 &b) failed", res_vec == expected_result); | ||
176 | } | ||
177 | |||
178 | //test case for operator*(const LLVector3d &a, const LLMatrix3 &b) | ||
179 | template<> template<> | ||
180 | void m3math_test_object_t::test<7>() | ||
181 | { | ||
182 | LLMatrix3 llmat_obj1; | ||
183 | LLVector3d llvec3d1; | ||
184 | LLVector3d llvec3d2(0, 3, 4); | ||
185 | |||
186 | LLVector3 llvec1(1, 3, 5); | ||
187 | LLVector3 llvec2(3, 2, 1); | ||
188 | LLVector3 llvec3(4, 6, 0); | ||
189 | |||
190 | llmat_obj1.setRows(llvec1, llvec2, llvec3); | ||
191 | llvec3d1 = llvec3d2 * llmat_obj1; | ||
192 | |||
193 | LLVector3d expected_result(25, 30, 3); | ||
194 | |||
195 | ensure("LLMatrix3::operator*(const LLVector3 &a, const LLMatrix3 &b) failed", llvec3d1 == expected_result); | ||
196 | } | ||
197 | |||
198 | // test case for operator==(const LLMatrix3 &a, const LLMatrix3 &b) | ||
199 | template<> template<> | ||
200 | void m3math_test_object_t::test<8>() | ||
201 | { | ||
202 | LLMatrix3 llmat_obj1; | ||
203 | LLMatrix3 llmat_obj2; | ||
204 | |||
205 | LLVector3 llvec1(1, 3, 5); | ||
206 | LLVector3 llvec2(3, 6, 1); | ||
207 | LLVector3 llvec3(4, 6, 9); | ||
208 | |||
209 | llmat_obj1.setRows(llvec1, llvec2, llvec3); | ||
210 | llmat_obj2.setRows(llvec1, llvec2, llvec3); | ||
211 | ensure("LLMatrix3::operator==(const LLMatrix3 &a, const LLMatrix3 &b) failed", llmat_obj1 == llmat_obj2); | ||
212 | |||
213 | llmat_obj2.setRows(llvec2, llvec2, llvec3); | ||
214 | ensure("LLMatrix3::operator!=(const LLMatrix3 &a, const LLMatrix3 &b) failed", llmat_obj1 != llmat_obj2); | ||
215 | } | ||
216 | |||
217 | //test case for quaternion() fn. | ||
218 | template<> template<> | ||
219 | void m3math_test_object_t::test<9>() | ||
220 | { | ||
221 | LLMatrix3 llmat_obj1; | ||
222 | LLQuaternion llmat_quat; | ||
223 | |||
224 | LLVector3 llmat1(2.0f, 1.0f, 6.0f); | ||
225 | LLVector3 llmat2(1.0f, 1.0f, 3.0f); | ||
226 | LLVector3 llmat3(1.0f, 7.0f, 5.0f); | ||
227 | |||
228 | llmat_obj1.setRows(llmat1, llmat2, llmat3); | ||
229 | llmat_quat = llmat_obj1.quaternion(); | ||
230 | ensure("LLMatrix3::quaternion failed ", is_approx_equal(-0.66666669f, llmat_quat.mQ[0]) && | ||
231 | is_approx_equal(-0.83333337f, llmat_quat.mQ[1]) && | ||
232 | is_approx_equal(0.0f, llmat_quat.mQ[2]) && | ||
233 | is_approx_equal(1.5f, llmat_quat.mQ[3])); | ||
234 | } | ||
235 | |||
236 | //test case for transpose() fn. | ||
237 | template<> template<> | ||
238 | void m3math_test_object_t::test<10>() | ||
239 | { | ||
240 | LLMatrix3 llmat_obj; | ||
241 | |||
242 | LLVector3 llvec1(1, 2, 3); | ||
243 | LLVector3 llvec2(3, 2, 1); | ||
244 | LLVector3 llvec3(2, 2, 2); | ||
245 | |||
246 | llmat_obj.setRows(llvec1, llvec2, llvec3); | ||
247 | llmat_obj.transpose(); | ||
248 | |||
249 | LLVector3 resllvec1(1, 3, 2); | ||
250 | LLVector3 resllvec2(2, 2, 2); | ||
251 | LLVector3 resllvec3(3, 1, 2); | ||
252 | LLMatrix3 expectedllmat_obj; | ||
253 | expectedllmat_obj.setRows(resllvec1, resllvec2, resllvec3); | ||
254 | |||
255 | ensure("LLMatrix3::transpose failed ", llmat_obj == expectedllmat_obj); | ||
256 | } | ||
257 | |||
258 | //test case for determinant() fn. | ||
259 | template<> template<> | ||
260 | void m3math_test_object_t::test<11>() | ||
261 | { | ||
262 | LLMatrix3 llmat_obj1; | ||
263 | |||
264 | LLVector3 llvec1(1, 2, 3); | ||
265 | LLVector3 llvec2(3, 2, 1); | ||
266 | LLVector3 llvec3(2, 2, 2); | ||
267 | llmat_obj1.setRows(llvec1, llvec2, llvec3); | ||
268 | ensure("LLMatrix3::determinant failed ", 0.0f == llmat_obj1.determinant()); | ||
269 | } | ||
270 | |||
271 | //test case for orthogonalize() fn. | ||
272 | template<> template<> | ||
273 | void m3math_test_object_t::test<12>() | ||
274 | { | ||
275 | LLMatrix3 llmat_obj; | ||
276 | |||
277 | LLVector3 llvec1(1, 4, 3); | ||
278 | LLVector3 llvec2(1, 2, 0); | ||
279 | LLVector3 llvec3(2, 4, 2); | ||
280 | |||
281 | llmat_obj.setRows(llvec1, llvec2, llvec3); | ||
282 | llmat_obj.orthogonalize(); | ||
283 | |||
284 | ensure("LLMatrix3::orthogonalize failed ", is_approx_equal(0.19611613f, llmat_obj.mMatrix[0][0]) && | ||
285 | is_approx_equal(0.78446454f, llmat_obj.mMatrix[0][1]) && | ||
286 | is_approx_equal(0.58834839f, llmat_obj.mMatrix[0][2]) && | ||
287 | is_approx_equal(0.47628206f, llmat_obj.mMatrix[1][0]) && | ||
288 | is_approx_equal(0.44826555f, llmat_obj.mMatrix[1][1]) && | ||
289 | is_approx_equal(-0.75644791f, llmat_obj.mMatrix[1][2]) && | ||
290 | is_approx_equal(-0.85714287f, llmat_obj.mMatrix[2][0]) && | ||
291 | is_approx_equal(0.42857143f, llmat_obj.mMatrix[2][1]) && | ||
292 | is_approx_equal(-0.28571427f, llmat_obj.mMatrix[2][2])); | ||
293 | } | ||
294 | |||
295 | //test case for adjointTranspose() fn. | ||
296 | template<> template<> | ||
297 | void m3math_test_object_t::test<13>() | ||
298 | { | ||
299 | LLMatrix3 llmat_obj; | ||
300 | |||
301 | LLVector3 llvec1(3, 2, 1); | ||
302 | LLVector3 llvec2(6, 2, 1); | ||
303 | LLVector3 llvec3(3, 6, 8); | ||
304 | |||
305 | llmat_obj.setRows(llvec1, llvec2, llvec3); | ||
306 | llmat_obj.adjointTranspose(); | ||
307 | |||
308 | ensure("LLMatrix3::adjointTranspose failed ", 10 == llmat_obj.mMatrix[0][0] && | ||
309 | -45 == llmat_obj.mMatrix[1][0] && | ||
310 | 30 == llmat_obj.mMatrix[2][0] && | ||
311 | -10 == llmat_obj.mMatrix[0][1] && | ||
312 | 21 == llmat_obj.mMatrix[1][1] && | ||
313 | -12 == llmat_obj.mMatrix[2][1] && | ||
314 | 0 == llmat_obj.mMatrix[0][2] && | ||
315 | 3 == llmat_obj.mMatrix[1][2] && | ||
316 | -6 == llmat_obj.mMatrix[2][2]); | ||
317 | } | ||
318 | |||
319 | /* TBD: Need to add test cases for getEulerAngles() and setRot() functions */ | ||
320 | } | ||
diff --git a/linden/indra/test/v2math_tut.cpp b/linden/indra/test/v2math_tut.cpp new file mode 100644 index 0000000..e94a19b --- /dev/null +++ b/linden/indra/test/v2math_tut.cpp | |||
@@ -0,0 +1,447 @@ | |||
1 | /** | ||
2 | * @file v2math_tut.cpp | ||
3 | * @author Adroit | ||
4 | * @date February 2007 | ||
5 | * @brief v2math test cases. | ||
6 | * | ||
7 | * Copyright (c) 2007-2007, Linden Research, Inc. | ||
8 | * | ||
9 | * The source code in this file ("Source Code") is provided by Linden Lab | ||
10 | * to you under the terms of the GNU General Public License, version 2.0 | ||
11 | * ("GPL"), unless you have obtained a separate licensing agreement | ||
12 | * ("Other License"), formally executed by you and Linden Lab. Terms of | ||
13 | * the GPL can be found in doc/GPL-license.txt in this distribution, or | ||
14 | * online at http://secondlife.com/developers/opensource/gplv2 | ||
15 | * | ||
16 | * There are special exceptions to the terms and conditions of the GPL as | ||
17 | * it is applied to this Source Code. View the full text of the exception | ||
18 | * in the file doc/FLOSS-exception.txt in this software distribution, or | ||
19 | * online at http://secondlife.com/developers/opensource/flossexception | ||
20 | * | ||
21 | * By copying, modifying or distributing this software, you acknowledge | ||
22 | * that you have read and understood your obligations described above, | ||
23 | * and agree to abide by those obligations. | ||
24 | * | ||
25 | * ALL LINDEN LAB SOURCE CODE IS PROVIDED "AS IS." LINDEN LAB MAKES NO | ||
26 | * WARRANTIES, EXPRESS, IMPLIED OR OTHERWISE, REGARDING ITS ACCURACY, | ||
27 | * COMPLETENESS OR PERFORMANCE. | ||
28 | */ | ||
29 | |||
30 | #include <tut/tut.h> | ||
31 | #include "lltut.h" | ||
32 | #include "linden_common.h" | ||
33 | #include "v2math.h" | ||
34 | |||
35 | |||
36 | namespace tut | ||
37 | { | ||
38 | struct v2math_data | ||
39 | { | ||
40 | }; | ||
41 | typedef test_group<v2math_data> v2math_test; | ||
42 | typedef v2math_test::object v2math_object; | ||
43 | tut::v2math_test v2math_testcase("v2math"); | ||
44 | |||
45 | template<> template<> | ||
46 | void v2math_object::test<1>() | ||
47 | { | ||
48 | LLVector2 vec2; | ||
49 | ensure("LLVector2:Fail to initialize ", (0.f == vec2.mV[VX] && 0.f == vec2.mV[VY])); | ||
50 | |||
51 | F32 x =2.0f, y = 3.2f ; | ||
52 | LLVector2 vec3(x,y); | ||
53 | ensure("LLVector2(F32 x, F32 y):Fail to initialize ", (x == vec3.mV[VX]) && (y == vec3.mV[VY])); | ||
54 | |||
55 | const F32 vec[2] = {3.2f, 4.5f}; | ||
56 | LLVector2 vec4(vec); | ||
57 | ensure("LLVector2(const F32 *vec):Fail to initialize ", (vec[0] == vec4.mV[VX]) && (vec[1] == vec4.mV[VY])); | ||
58 | |||
59 | vec4.clearVec(); | ||
60 | ensure("clearVec():Fail to clean the values ", (0.f == vec4.mV[VX] && 0.f == vec4.mV[VY])); | ||
61 | |||
62 | vec3.zeroVec(); | ||
63 | ensure("zeroVec():Fail to fill the zero ", (0.f == vec3.mV[VX] && 0.f == vec3.mV[VY])); | ||
64 | } | ||
65 | |||
66 | template<> template<> | ||
67 | void v2math_object::test<2>() | ||
68 | { | ||
69 | F32 x = 123.356f, y = 2387.453f; | ||
70 | LLVector2 vec2,vec3; | ||
71 | vec2.setVec(x, y); | ||
72 | ensure("1:setVec: Fail ", (x == vec2.mV[VX]) && (y == vec2.mV[VY])); | ||
73 | |||
74 | vec3.setVec(vec2); | ||
75 | ensure("2:setVec: Fail " ,(vec2 == vec3)); | ||
76 | |||
77 | vec3.zeroVec(); | ||
78 | const F32 vec[2] = {3.24653f, 457653.4f}; | ||
79 | vec3.setVec(vec); | ||
80 | ensure("3:setVec: Fail ", (vec[0] == vec3.mV[VX]) && (vec[1] == vec3.mV[VY])); | ||
81 | } | ||
82 | |||
83 | template<> template<> | ||
84 | void v2math_object::test<3>() | ||
85 | { | ||
86 | F32 x = 2.2345f, y = 3.5678f ; | ||
87 | LLVector2 vec2(x,y); | ||
88 | ensure("magVecSquared:Fail ", is_approx_equal(vec2.magVecSquared(), (x*x + y*y))); | ||
89 | ensure("magVec:Fail ", is_approx_equal(vec2.magVec(), fsqrtf(x*x + y*y))); | ||
90 | } | ||
91 | |||
92 | template<> template<> | ||
93 | void v2math_object::test<4>() | ||
94 | { | ||
95 | F32 x =-2.0f, y = -3.0f ; | ||
96 | LLVector2 vec2(x,y); | ||
97 | ensure("abs():Fail ", TRUE == vec2.abs() && is_approx_equal(x, 2.f) && is_approx_equal(y, 3.f)); | ||
98 | |||
99 | ensure("isNull():Fail ", FALSE == vec2.isNull()); //Returns TRUE if vector has a _very_small_ length | ||
100 | |||
101 | x =.00000001f, y = .000001001f; | ||
102 | vec2.setVec(x, y); | ||
103 | ensure("isNull(): Fail ", TRUE == vec2.isNull()); | ||
104 | } | ||
105 | |||
106 | template<> template<> | ||
107 | void v2math_object::test<5>() | ||
108 | { | ||
109 | F32 x =1.f, y = 2.f; | ||
110 | LLVector2 vec2(x, y), vec3; | ||
111 | vec3 = vec3.scaleVec(vec2); | ||
112 | ensure("scaleVec: Fail ", vec3.mV[VX] == 0. && vec3.mV[VY] == 0.); | ||
113 | ensure("isExactlyZero(): Fail", TRUE == vec3.isExactlyZero()); | ||
114 | |||
115 | vec3.setVec(2.f, 1.f); | ||
116 | vec3 = vec3.scaleVec(vec2); | ||
117 | ensure("scaleVec: Fail ", (2.f == vec3.mV[VX]) && (2.f == vec3.mV[VY])); | ||
118 | ensure("isExactlyZero():Fail", FALSE == vec3.isExactlyZero()); | ||
119 | } | ||
120 | |||
121 | template<> template<> | ||
122 | void v2math_object::test<6>() | ||
123 | { | ||
124 | F32 x1 =1.f, y1 = 2.f, x2 = -2.3f, y2 = 1.11f; | ||
125 | F32 val1, val2; | ||
126 | LLVector2 vec2(x1, y1), vec3(x2, y2), vec4; | ||
127 | vec4 = vec2 + vec3 ; | ||
128 | val1 = x1+x2; | ||
129 | val2 = y1+y2; | ||
130 | ensure("1:operator+ failed",(val1 == vec4.mV[VX]) && ((val2 == vec4.mV[VY]))); | ||
131 | |||
132 | vec2.clearVec(); | ||
133 | vec3.clearVec(); | ||
134 | x1 = -.235f, y1 = -24.32f, x2 = -2.3f, y2 = 1.f; | ||
135 | vec2.setVec(x1, y1); | ||
136 | vec3.setVec(x2, y2); | ||
137 | vec4 = vec2 + vec3; | ||
138 | val1 = x1+x2; | ||
139 | val2 = y1+y2; | ||
140 | ensure("2:operator+ failed",(val1 == vec4.mV[VX]) && ((val2 == vec4.mV[VY]))); | ||
141 | } | ||
142 | |||
143 | template<> template<> | ||
144 | void v2math_object::test<7>() | ||
145 | { | ||
146 | F32 x1 =1.f, y1 = 2.f, x2 = -2.3f, y2 = 1.11f; | ||
147 | F32 val1, val2; | ||
148 | LLVector2 vec2(x1, y1), vec3(x2, y2), vec4; | ||
149 | vec4 = vec2 - vec3 ; | ||
150 | val1 = x1-x2; | ||
151 | val2 = y1-y2; | ||
152 | ensure("1:operator- failed",(val1 == vec4.mV[VX]) && ((val2 == vec4.mV[VY]))); | ||
153 | |||
154 | vec2.clearVec(); | ||
155 | vec3.clearVec(); | ||
156 | vec4.clearVec(); | ||
157 | x1 = -.235f, y1 = -24.32f, x2 = -2.3f, y2 = 1.f; | ||
158 | vec2.setVec(x1, y1); | ||
159 | vec3.setVec(x2, y2); | ||
160 | vec4 = vec2 - vec3; | ||
161 | val1 = x1-x2; | ||
162 | val2 = y1-y2; | ||
163 | ensure("2:operator- failed",(val1 == vec4.mV[VX]) && ((val2 == vec4.mV[VY]))); | ||
164 | } | ||
165 | |||
166 | template<> template<> | ||
167 | void v2math_object::test<8>() | ||
168 | { | ||
169 | F32 x1 =1.f, y1 = 2.f, x2 = -2.3f, y2 = 1.11f; | ||
170 | F32 val1, val2; | ||
171 | LLVector2 vec2(x1, y1), vec3(x2, y2); | ||
172 | val1 = vec2 * vec3; | ||
173 | val2 = x1*x2 + y1*y2; | ||
174 | ensure("1:operator* failed",(val1 == val2)); | ||
175 | |||
176 | vec3.clearVec(); | ||
177 | F32 mulVal = 4.332f; | ||
178 | vec3 = vec2 * mulVal; | ||
179 | val1 = x1*mulVal; | ||
180 | val2 = y1*mulVal; | ||
181 | ensure("2:operator* failed",(val1 == vec3.mV[VX]) && (val2 == vec3.mV[VY])); | ||
182 | |||
183 | vec3.clearVec(); | ||
184 | vec3 = mulVal * vec2; | ||
185 | ensure("3:operator* failed",(val1 == vec3.mV[VX]) && (val2 == vec3.mV[VY])); | ||
186 | } | ||
187 | |||
188 | template<> template<> | ||
189 | void v2math_object::test<9>() | ||
190 | { | ||
191 | F32 x1 =1.f, y1 = 2.f, div = 3.2f; | ||
192 | F32 val1, val2; | ||
193 | LLVector2 vec2(x1, y1), vec3; | ||
194 | vec3 = vec2 / div; | ||
195 | val1 = x1 / div; | ||
196 | val2 = y1 / div; | ||
197 | ensure("1:operator/ failed", is_approx_equal(val1, vec3.mV[VX]) && is_approx_equal(val2, vec3.mV[VY])); | ||
198 | |||
199 | vec3.clearVec(); | ||
200 | x1 = -.235f, y1 = -24.32f, div = -2.2f; | ||
201 | vec2.setVec(x1, y1); | ||
202 | vec3 = vec2 / div; | ||
203 | val1 = x1 / div; | ||
204 | val2 = y1 / div; | ||
205 | ensure("2:operator/ failed", is_approx_equal(val1, vec3.mV[VX]) && is_approx_equal(val2, vec3.mV[VY])); | ||
206 | } | ||
207 | |||
208 | template<> template<> | ||
209 | void v2math_object::test<10>() | ||
210 | { | ||
211 | F32 x1 =1.f, y1 = 2.f, x2 = -2.3f, y2 = 1.11f; | ||
212 | F32 val1, val2; | ||
213 | LLVector2 vec2(x1, y1), vec3(x2, y2), vec4; | ||
214 | vec4 = vec2 % vec3; | ||
215 | val1 = x1*y2 - x2*y1; | ||
216 | val2 = y1*x2 - y2*x1; | ||
217 | ensure("1:operator% failed",(val1 == vec4.mV[VX]) && (val2 == vec4.mV[VY])); | ||
218 | |||
219 | vec2.clearVec(); | ||
220 | vec3.clearVec(); | ||
221 | vec4.clearVec(); | ||
222 | x1 = -.235f, y1 = -24.32f, x2 = -2.3f, y2 = 1.f; | ||
223 | vec2.setVec(x1, y1); | ||
224 | vec3.setVec(x2, y2); | ||
225 | vec4 = vec2 % vec3; | ||
226 | val1 = x1*y2 - x2*y1; | ||
227 | val2 = y1*x2 - y2*x1; | ||
228 | ensure("2:operator% failed",(val1 == vec4.mV[VX]) && (val2 == vec4.mV[VY])); | ||
229 | } | ||
230 | template<> template<> | ||
231 | void v2math_object::test<11>() | ||
232 | { | ||
233 | F32 x1 =1.f, y1 = 2.f; | ||
234 | LLVector2 vec2(x1, y1), vec3(x1, y1); | ||
235 | ensure("1:operator== failed",(vec2 == vec3)); | ||
236 | |||
237 | vec2.clearVec(); | ||
238 | vec3.clearVec(); | ||
239 | x1 = -.235f, y1 = -24.32f; | ||
240 | vec2.setVec(x1, y1); | ||
241 | vec3.setVec(vec2); | ||
242 | ensure("2:operator== failed",(vec2 == vec3)); | ||
243 | } | ||
244 | |||
245 | template<> template<> | ||
246 | void v2math_object::test<12>() | ||
247 | { | ||
248 | F32 x1 = 1.f, y1 = 2.f,x2 = 2.332f, y2 = -1.23f; | ||
249 | LLVector2 vec2(x1, y1), vec3(x2, y2); | ||
250 | ensure("1:operator!= failed",(vec2 != vec3)); | ||
251 | |||
252 | vec2.clearVec(); | ||
253 | vec3.clearVec(); | ||
254 | vec2.setVec(x1, y1); | ||
255 | vec3.setVec(vec2); | ||
256 | ensure("2:operator!= failed", (FALSE == (vec2 != vec3))); | ||
257 | } | ||
258 | template<> template<> | ||
259 | void v2math_object::test<13>() | ||
260 | { | ||
261 | F32 x1 = 1.f, y1 = 2.f,x2 = 2.332f, y2 = -1.23f; | ||
262 | F32 val1, val2; | ||
263 | LLVector2 vec2(x1, y1), vec3(x2, y2); | ||
264 | vec2 +=vec3; | ||
265 | val1 = x1+x2; | ||
266 | val2 = y1+y2; | ||
267 | ensure("1:operator+= failed",(val1 == vec2.mV[VX]) && (val2 == vec2.mV[VY])); | ||
268 | |||
269 | vec2.setVec(x1, y1); | ||
270 | vec2 -=vec3; | ||
271 | val1 = x1-x2; | ||
272 | val2 = y1-y2; | ||
273 | ensure("2:operator-= failed",(val1 == vec2.mV[VX]) && (val2 == vec2.mV[VY])); | ||
274 | |||
275 | vec2.clearVec(); | ||
276 | vec3.clearVec(); | ||
277 | x1 = -21.000466f, y1 = 2.98382f,x2 = 0.332f, y2 = -01.23f; | ||
278 | vec2.setVec(x1, y1); | ||
279 | vec3.setVec(x2, y2); | ||
280 | vec2 +=vec3; | ||
281 | val1 = x1+x2; | ||
282 | val2 = y1+y2; | ||
283 | ensure("3:operator+= failed",(val1 == vec2.mV[VX]) && (val2 == vec2.mV[VY])); | ||
284 | |||
285 | vec2.setVec(x1, y1); | ||
286 | vec2 -=vec3; | ||
287 | val1 = x1-x2; | ||
288 | val2 = y1-y2; | ||
289 | ensure("4:operator-= failed",(val1 == vec2.mV[VX]) && (val2 == vec2.mV[VY])); | ||
290 | } | ||
291 | |||
292 | template<> template<> | ||
293 | void v2math_object::test<14>() | ||
294 | { | ||
295 | F32 x1 =1.f, y1 = 2.f; | ||
296 | F32 val1, val2, mulVal = 4.332f; | ||
297 | LLVector2 vec2(x1, y1); | ||
298 | vec2 /=mulVal; | ||
299 | val1 = x1 / mulVal; | ||
300 | val2 = y1 / mulVal; | ||
301 | ensure("1:operator/= failed", is_approx_equal(val1, vec2.mV[VX]) && is_approx_equal(val2, vec2.mV[VY])); | ||
302 | |||
303 | vec2.clearVec(); | ||
304 | x1 = .213f, y1 = -2.34f, mulVal = -.23f; | ||
305 | vec2.setVec(x1, y1); | ||
306 | vec2 /=mulVal; | ||
307 | val1 = x1 / mulVal; | ||
308 | val2 = y1 / mulVal; | ||
309 | ensure("2:operator/= failed", is_approx_equal(val1, vec2.mV[VX]) && is_approx_equal(val2, vec2.mV[VY])); | ||
310 | } | ||
311 | |||
312 | template<> template<> | ||
313 | void v2math_object::test<15>() | ||
314 | { | ||
315 | F32 x1 =1.f, y1 = 2.f; | ||
316 | F32 val1, val2, mulVal = 4.332f; | ||
317 | LLVector2 vec2(x1, y1); | ||
318 | vec2 *=mulVal; | ||
319 | val1 = x1*mulVal; | ||
320 | val2 = y1*mulVal; | ||
321 | ensure("1:operator*= failed",(val1 == vec2.mV[VX]) && (val2 == vec2.mV[VY])); | ||
322 | |||
323 | vec2.clearVec(); | ||
324 | x1 = .213f, y1 = -2.34f, mulVal = -.23f; | ||
325 | vec2.setVec(x1, y1); | ||
326 | vec2 *=mulVal; | ||
327 | val1 = x1*mulVal; | ||
328 | val2 = y1*mulVal; | ||
329 | ensure("2:operator*= failed",(val1 == vec2.mV[VX]) && (val2 == vec2.mV[VY])); | ||
330 | } | ||
331 | |||
332 | template<> template<> | ||
333 | void v2math_object::test<16>() | ||
334 | { | ||
335 | F32 x1 =1.f, y1 = 2.f, x2 = -2.3f, y2 = 1.11f; | ||
336 | F32 val1, val2; | ||
337 | LLVector2 vec2(x1, y1), vec3(x2, y2); | ||
338 | vec2 %= vec3; | ||
339 | val1 = x1*y2 - x2*y1; | ||
340 | val2 = y1*x2 - y2*x1; | ||
341 | ensure("1:operator%= failed",(val1 == vec2.mV[VX]) && (val2 == vec2.mV[VY])); | ||
342 | } | ||
343 | |||
344 | template<> template<> | ||
345 | void v2math_object::test<17>() | ||
346 | { | ||
347 | F32 x1 =1.f, y1 = 2.f; | ||
348 | LLVector2 vec2(x1, y1),vec3; | ||
349 | vec3 = -vec2; | ||
350 | ensure("1:operator- failed",(-vec3 == vec2)); | ||
351 | } | ||
352 | |||
353 | template<> template<> | ||
354 | void v2math_object::test<18>() | ||
355 | { | ||
356 | F32 x1 =1.f, y1 = 2.f; | ||
357 | std::ostringstream stream1, stream2; | ||
358 | LLVector2 vec2(x1, y1),vec3; | ||
359 | stream1 << vec2; | ||
360 | vec3.setVec(x1, y1); | ||
361 | stream2 << vec3; | ||
362 | ensure("1:operator << failed",(stream1.str() == stream2.str())); | ||
363 | } | ||
364 | |||
365 | template<> template<> | ||
366 | void v2math_object::test<19>() | ||
367 | { | ||
368 | F32 x1 =1.0f, y1 = 2.0f, x2 = -.32f, y2 = .2234f; | ||
369 | LLVector2 vec2(x1, y1),vec3(x2, y2); | ||
370 | ensure("1:operator < failed",(vec3 < vec2)); | ||
371 | |||
372 | x1 = 1.0f, y1 = 2.0f, x2 = 1.0f, y2 = 3.2234f; | ||
373 | vec2.setVec(x1, y1); | ||
374 | vec3.setVec(x2, y2); | ||
375 | ensure("2:operator < failed", (FALSE == vec3 < vec2)); | ||
376 | } | ||
377 | |||
378 | template<> template<> | ||
379 | void v2math_object::test<20>() | ||
380 | { | ||
381 | F32 x1 =1.0f, y1 = 2.0f; | ||
382 | LLVector2 vec2(x1, y1); | ||
383 | ensure("1:operator [] failed",( x1 == vec2[0])); | ||
384 | ensure("2:operator [] failed",( y1 == vec2[1])); | ||
385 | |||
386 | vec2.clearVec(); | ||
387 | x1 = 23.0f, y1 = -.2361f; | ||
388 | vec2.setVec(x1, y1); | ||
389 | F32 ref1 = vec2[0]; | ||
390 | ensure("3:operator [] failed", ( ref1 == x1)); | ||
391 | F32 ref2 = vec2[1]; | ||
392 | ensure("4:operator [] failed", ( ref2 == y1)); | ||
393 | } | ||
394 | |||
395 | template<> template<> | ||
396 | void v2math_object::test<21>() | ||
397 | { | ||
398 | F32 x1 =1.f, y1 = 2.f, x2 = -.32f, y2 = .2234f; | ||
399 | F32 val1, val2; | ||
400 | LLVector2 vec2(x1, y1),vec3(x2, y2); | ||
401 | val1 = dist_vec_squared2D(vec2, vec3); | ||
402 | val2 = (x1 - x2)*(x1 - x2) + (y1 - y2)* (y1 - y2); | ||
403 | ensure_equals("dist_vec_squared2D values are not equal",val2, val1); | ||
404 | |||
405 | val1 = dist_vec_squared(vec2, vec3); | ||
406 | ensure_equals("dist_vec_squared values are not equal",val2, val1); | ||
407 | |||
408 | val1 = dist_vec(vec2, vec3); | ||
409 | val2 = fsqrtf((x1 - x2)*(x1 - x2) + (y1 - y2)* (y1 - y2)); | ||
410 | ensure_equals("dist_vec values are not equal",val2, val1); | ||
411 | } | ||
412 | |||
413 | template<> template<> | ||
414 | void v2math_object::test<22>() | ||
415 | { | ||
416 | F32 x1 =1.f, y1 = 2.f, x2 = -.32f, y2 = .2234f,fVal = .0121f; | ||
417 | F32 val1, val2; | ||
418 | LLVector2 vec2(x1, y1),vec3(x2, y2); | ||
419 | LLVector2 vec4 = lerp(vec2, vec3, fVal); | ||
420 | val1 = x1 + (x2 - x1) * fVal; | ||
421 | val2 = y1 + (y2 - y1) * fVal; | ||
422 | ensure("lerp values are not equal", ((val1 == vec4.mV[VX]) && (val2 == vec4.mV[VY]))); | ||
423 | } | ||
424 | |||
425 | template<> template<> | ||
426 | void v2math_object::test<23>() | ||
427 | { | ||
428 | F32 x1 =1.f, y1 = 2.f; | ||
429 | F32 val1, val2; | ||
430 | LLVector2 vec2(x1, y1); | ||
431 | |||
432 | F32 vecMag = vec2.normVec(); | ||
433 | F32 mag = fsqrtf(x1*x1 + y1*y1); | ||
434 | |||
435 | F32 oomag = 1.f / mag; | ||
436 | val1 = x1 * oomag; | ||
437 | val2 = y1 * oomag; | ||
438 | |||
439 | ensure("normVec failed", val1 == vec2.mV[VX] && val2 == vec2.mV[VY] && vecMag == mag); | ||
440 | |||
441 | x1 =.00000001f, y1 = 0.f; | ||
442 | |||
443 | vec2.setVec(x1, y1); | ||
444 | vecMag = vec2.normVec(); | ||
445 | ensure("normVec failed should be 0.", 0. == vec2.mV[VX] && 0. == vec2.mV[VY] && vecMag == 0.); | ||
446 | } | ||
447 | } | ||
diff --git a/linden/indra/test/v3dmath_tut.cpp b/linden/indra/test/v3dmath_tut.cpp new file mode 100644 index 0000000..88ade71 --- /dev/null +++ b/linden/indra/test/v3dmath_tut.cpp | |||
@@ -0,0 +1,402 @@ | |||
1 | /** | ||
2 | * @file v3dmath_tut.cpp | ||
3 | * @author Adroit | ||
4 | * @date March 2007 | ||
5 | * @brief v3dmath test cases. | ||
6 | * | ||
7 | * Copyright (c) 2007-2007, Linden Research, Inc. | ||
8 | * | ||
9 | * Second Life Viewer Source Code | ||
10 | * The source code in this file ("Source Code") is provided by Linden Lab | ||
11 | * to you under the terms of the GNU General Public License, version 2.0 | ||
12 | * ("GPL"), unless you have obtained a separate licensing agreement | ||
13 | * ("Other License"), formally executed by you and Linden Lab. Terms of | ||
14 | * the GPL can be found in doc/GPL-license.txt in this distribution, or | ||
15 | * online at http://secondlife.com/developers/opensource/gplv2 | ||
16 | * | ||
17 | * There are special exceptions to the terms and conditions of the GPL as | ||
18 | * it is applied to this Source Code. View the full text of the exception | ||
19 | * in the file doc/FLOSS-exception.txt in this software distribution, or | ||
20 | * online at http://secondlife.com/developers/opensource/flossexception | ||
21 | * | ||
22 | * By copying, modifying or distributing this software, you acknowledge | ||
23 | * that you have read and understood your obligations described above, | ||
24 | * and agree to abide by those obligations. | ||
25 | * | ||
26 | * ALL LINDEN LAB SOURCE CODE IS PROVIDED "AS IS." LINDEN LAB MAKES NO | ||
27 | * WARRANTIES, EXPRESS, IMPLIED OR OTHERWISE, REGARDING ITS ACCURACY, | ||
28 | * COMPLETENESS OR PERFORMANCE. | ||
29 | */ | ||
30 | |||
31 | #include <tut/tut.h> | ||
32 | #include "lltut.h" | ||
33 | #include "llquaternion.h" | ||
34 | #include "m3math.h" | ||
35 | #include "v4math.h" | ||
36 | #include "llsd.h" | ||
37 | #include "v3dmath.h" | ||
38 | #include "v3dmath.h" | ||
39 | |||
40 | namespace tut | ||
41 | { | ||
42 | struct v3dmath_data | ||
43 | { | ||
44 | }; | ||
45 | typedef test_group<v3dmath_data> v3dmath_test; | ||
46 | typedef v3dmath_test::object v3dmath_object; | ||
47 | tut::v3dmath_test v3dmath_testcase("v3dmath"); | ||
48 | |||
49 | template<> template<> | ||
50 | void v3dmath_object::test<1>() | ||
51 | { | ||
52 | LLVector3d vec3D; | ||
53 | ensure("1:LLVector3d:Fail to initialize ", ((0 == vec3D.mdV[VX]) && (0 == vec3D.mdV[VY]) && (0 == vec3D.mdV[VZ]))); | ||
54 | F64 x = 2.32f, y = 1.212f, z = -.12f; | ||
55 | LLVector3d vec3Da(x,y,z); | ||
56 | ensure("2:LLVector3d:Fail to initialize ", ((2.32f == vec3Da.mdV[VX]) && (1.212f == vec3Da.mdV[VY]) && (-.12f == vec3Da.mdV[VZ]))); | ||
57 | const F64 vec[3] = {1.2f ,3.2f, -4.2f}; | ||
58 | LLVector3d vec3Db(vec); | ||
59 | ensure("3:LLVector3d:Fail to initialize ", ((1.2f == vec3Db.mdV[VX]) && (3.2f == vec3Db.mdV[VY]) && (-4.2f == vec3Db.mdV[VZ]))); | ||
60 | LLVector3 vec3((F32)x,(F32)y,(F32)z); | ||
61 | LLVector3d vec3Dc(vec3); | ||
62 | ensure_equals("4:LLVector3d Fail to initialize",vec3Da,vec3Dc); | ||
63 | } | ||
64 | |||
65 | template<> template<> | ||
66 | void v3dmath_object::test<2>() | ||
67 | { | ||
68 | S32 a = -235; | ||
69 | LLSD llsd(a); | ||
70 | LLVector3d vec3d(llsd); | ||
71 | LLSD sd = vec3d.getValue(); | ||
72 | LLVector3d vec3da(sd); | ||
73 | ensure("1:getValue:Fail ", (vec3d == vec3da)); | ||
74 | } | ||
75 | |||
76 | template<> template<> | ||
77 | void v3dmath_object::test<3>() | ||
78 | { | ||
79 | F64 a = 232345521.411132; | ||
80 | LLSD llsd(a); | ||
81 | LLVector3d vec3d; | ||
82 | vec3d.setValue(llsd); | ||
83 | LLSD sd = vec3d.getValue(); | ||
84 | LLVector3d vec3da(sd); | ||
85 | ensure("1:setValue:Fail to initialize ", (vec3d == vec3da)); | ||
86 | } | ||
87 | |||
88 | template<> template<> | ||
89 | void v3dmath_object::test<4>() | ||
90 | { | ||
91 | F64 a[3] = {222231.43222, 12345.2343, -434343.33222}; | ||
92 | LLSD llsd; | ||
93 | llsd[0] = a[0]; | ||
94 | llsd[1] = a[1]; | ||
95 | llsd[2] = a[2]; | ||
96 | LLVector3d vec3D; | ||
97 | vec3D = llsd; | ||
98 | ensure("1:operator=:Fail to initialize ", ((llsd[0].asReal()== vec3D.mdV[VX]) && (llsd[1].asReal() == vec3D.mdV[VY]) && (llsd[2].asReal() == vec3D.mdV[VZ]))); | ||
99 | } | ||
100 | |||
101 | template<> template<> | ||
102 | void v3dmath_object::test<5>() | ||
103 | { | ||
104 | F64 x = 2.32f, y = 1.212f, z = -.12f; | ||
105 | LLVector3d vec3D(x,y,z); | ||
106 | vec3D.clearVec(); | ||
107 | ensure("1:clearVec:Fail to initialize ", ((0 == vec3D.mdV[VX]) && (0 == vec3D.mdV[VY]) && (0 == vec3D.mdV[VZ]))); | ||
108 | vec3D.setVec(x,y,z); | ||
109 | ensure("2:setVec:Fail to initialize ", ((x == vec3D.mdV[VX]) && (y == vec3D.mdV[VY]) && (z == vec3D.mdV[VZ]))); | ||
110 | vec3D.zeroVec(); | ||
111 | ensure("3:zeroVec:Fail to initialize ", ((0 == vec3D.mdV[VX]) && (0 == vec3D.mdV[VY]) && (0 == vec3D.mdV[VZ]))); | ||
112 | vec3D.clearVec(); | ||
113 | LLVector3 vec3((F32)x,(F32)y,(F32)z); | ||
114 | vec3D.setVec(vec3); | ||
115 | ensure("4:setVec:Fail to initialize ", ((x == vec3D.mdV[VX]) && (y == vec3D.mdV[VY]) && (z == vec3D.mdV[VZ]))); | ||
116 | vec3D.clearVec(); | ||
117 | const F64 vec[3] = {x,y,z}; | ||
118 | vec3D.setVec(vec); | ||
119 | ensure("5:setVec:Fail to initialize ", ((x == vec3D.mdV[VX]) && (y == vec3D.mdV[VY]) && (z == vec3D.mdV[VZ]))); | ||
120 | LLVector3d vec3Da; | ||
121 | vec3Da.setVec(vec3D); | ||
122 | ensure_equals("6:setVec: Fail to initialize", vec3D, vec3Da); | ||
123 | } | ||
124 | |||
125 | template<> template<> | ||
126 | void v3dmath_object::test<6>() | ||
127 | { | ||
128 | F64 x = -2.32, y = 1.212, z = -.12; | ||
129 | LLVector3d vec3D(x,y,z); | ||
130 | vec3D.abs(); | ||
131 | ensure("1:abs:Fail ", ((-x == vec3D.mdV[VX]) && (y == vec3D.mdV[VY]) && (-z == vec3D.mdV[VZ]))); | ||
132 | ensure("2:isNull():Fail ", (FALSE == vec3D.isNull())); | ||
133 | vec3D.clearVec(); | ||
134 | x =.00000001, y = .000001001, z = .000001001; | ||
135 | vec3D.setVec(x,y,z); | ||
136 | ensure("3:isNull():Fail ", (TRUE == vec3D.isNull())); | ||
137 | ensure("4:isExactlyZero():Fail ", (FALSE == vec3D.isExactlyZero())); | ||
138 | x =.0000000, y = .00000000, z = .00000000; | ||
139 | vec3D.setVec(x,y,z); | ||
140 | ensure("5:isExactlyZero():Fail ", (TRUE == vec3D.isExactlyZero())); | ||
141 | } | ||
142 | |||
143 | template<> template<> | ||
144 | void v3dmath_object::test<7>() | ||
145 | { | ||
146 | F64 x = -2.32, y = 1.212, z = -.12; | ||
147 | LLVector3d vec3D(x,y,z); | ||
148 | |||
149 | ensure("1:operator [] failed",( x == vec3D[0])); | ||
150 | ensure("2:operator [] failed",( y == vec3D[1])); | ||
151 | ensure("3:operator [] failed",( z == vec3D[2])); | ||
152 | vec3D.clearVec(); | ||
153 | x = 23.23, y = -.2361, z = 3.25; | ||
154 | vec3D.setVec(x,y,z); | ||
155 | F64 &ref1 = vec3D[0]; | ||
156 | ensure("4:operator [] failed",( ref1 == vec3D[0])); | ||
157 | F64 &ref2 = vec3D[1]; | ||
158 | ensure("5:operator [] failed",( ref2 == vec3D[1])); | ||
159 | F64 &ref3 = vec3D[2]; | ||
160 | ensure("6:operator [] failed",( ref3 == vec3D[2])); | ||
161 | } | ||
162 | |||
163 | template<> template<> | ||
164 | void v3dmath_object::test<8>() | ||
165 | { | ||
166 | F32 x = 1.f, y = 2.f, z = -1.f; | ||
167 | LLVector4 vec4(x,y,z); | ||
168 | LLVector3d vec3D; | ||
169 | vec3D = vec4; | ||
170 | ensure("1:operator=:Fail to initialize ", ((vec4.mV[VX] == vec3D.mdV[VX]) && (vec4.mV[VY] == vec3D.mdV[VY]) && (vec4.mV[VZ] == vec3D.mdV[VZ]))); | ||
171 | } | ||
172 | |||
173 | template<> template<> | ||
174 | void v3dmath_object::test<9>() | ||
175 | { | ||
176 | F64 x1 = 1.78787878, y1 = 232322.2121, z1 = -12121.121212; | ||
177 | F64 x2 = 1.2, y2 = 2.5, z2 = 1.; | ||
178 | LLVector3d vec3D(x1,y1,z1),vec3Da(x2,y2,z2),vec3Db; | ||
179 | vec3Db = vec3Da+ vec3D; | ||
180 | ensure("1:operator+:Fail to initialize ", ((x1+x2 == vec3Db.mdV[VX]) && (y1+y2 == vec3Db.mdV[VY]) && (z1+z2 == vec3Db.mdV[VZ]))); | ||
181 | x1 = -2.45, y1 = 2.1, z1 = 3.0; | ||
182 | vec3D.clearVec(); | ||
183 | vec3Da.clearVec(); | ||
184 | vec3D.setVec(x1,y1,z1); | ||
185 | vec3Da += vec3D; | ||
186 | ensure_equals("2:operator+=: Fail to initialize", vec3Da,vec3D); | ||
187 | vec3Da += vec3D; | ||
188 | ensure("3:operator+=:Fail to initialize ", ((2*x1 == vec3Da.mdV[VX]) && (2*y1 == vec3Da.mdV[VY]) && (2*z1 == vec3Da.mdV[VZ]))); | ||
189 | } | ||
190 | |||
191 | template<> template<> | ||
192 | void v3dmath_object::test<10>() | ||
193 | { | ||
194 | F64 x1 = 1., y1 = 2., z1 = -1.1; | ||
195 | F64 x2 = 1.2, y2 = 2.5, z2 = 1.; | ||
196 | LLVector3d vec3D(x1,y1,z1),vec3Da(x2,y2,z2),vec3Db; | ||
197 | vec3Db = vec3Da - vec3D; | ||
198 | ensure("1:operator-:Fail to initialize ", ((x2-x1 == vec3Db.mdV[VX]) && (y2-y1 == vec3Db.mdV[VY]) && (z2-z1 == vec3Db.mdV[VZ]))); | ||
199 | x1 = -2.45, y1 = 2.1, z1 = 3.0; | ||
200 | vec3D.clearVec(); | ||
201 | vec3Da.clearVec(); | ||
202 | vec3D.setVec(x1,y1,z1); | ||
203 | vec3Da -=vec3D; | ||
204 | ensure("2:operator-=:Fail to initialize ", ((2.45 == vec3Da.mdV[VX]) && (-2.1 == vec3Da.mdV[VY]) && (-3.0 == vec3Da.mdV[VZ]))); | ||
205 | vec3Da -= vec3D; | ||
206 | ensure("3:operator-=:Fail to initialize ", ((-2*x1 == vec3Da.mdV[VX]) && (-2*y1 == vec3Da.mdV[VY]) && (-2*z1 == vec3Da.mdV[VZ]))); | ||
207 | } | ||
208 | template<> template<> | ||
209 | void v3dmath_object::test<11>() | ||
210 | { | ||
211 | F64 x1 = 1., y1 = 2., z1 = -1.1; | ||
212 | F64 x2 = 1.2, y2 = 2.5, z2 = 1.; | ||
213 | LLVector3d vec3D(x1,y1,z1),vec3Da(x2,y2,z2); | ||
214 | F64 res = vec3D * vec3Da; | ||
215 | ensure("1:operator* failed",(res == (x1*x2 + y1*y2 + z1*z2))); | ||
216 | vec3Da.clearVec(); | ||
217 | F64 mulVal = 4.2; | ||
218 | vec3Da = vec3D * mulVal; | ||
219 | ensure("2:operator* failed",(x1*mulVal == vec3Da.mdV[VX]) && (y1*mulVal == vec3Da.mdV[VY])&& (z1*mulVal == vec3Da.mdV[VZ])); | ||
220 | vec3Da.clearVec(); | ||
221 | vec3Da = mulVal * vec3D; | ||
222 | ensure("3:operator* failed",(x1*mulVal == vec3Da.mdV[VX]) && (y1*mulVal == vec3Da.mdV[VY])&& (z1*mulVal == vec3Da.mdV[VZ])); | ||
223 | vec3D *= mulVal; | ||
224 | ensure("4:operator*= failed",(x1*mulVal == vec3D.mdV[VX]) && (y1*mulVal == vec3D.mdV[VY])&& (z1*mulVal == vec3D.mdV[VZ])); | ||
225 | } | ||
226 | |||
227 | template<> template<> | ||
228 | void v3dmath_object::test<12>() | ||
229 | { | ||
230 | F64 x1 = 1., y1 = 2., z1 = -1.1; | ||
231 | F64 x2 = 1.2, y2 = 2.5, z2 = 1.; | ||
232 | F64 val1, val2, val3; | ||
233 | LLVector3d vec3D(x1,y1,z1),vec3Da(x2,y2,z2), vec3Db; | ||
234 | vec3Db = vec3D % vec3Da; | ||
235 | val1 = y1*z2 - y2*z1; | ||
236 | val2 = z1*x2 -z2*x1; | ||
237 | val3 = x1*y2-x2*y1; | ||
238 | ensure("1:operator% failed",(val1 == vec3Db.mdV[VX]) && (val2 == vec3Db.mdV[VY]) && (val3 == vec3Db.mdV[VZ])); | ||
239 | vec3D %= vec3Da; | ||
240 | ensure_equals("2:operator%= failed",vec3D,vec3Db); | ||
241 | } | ||
242 | |||
243 | template<> template<> | ||
244 | void v3dmath_object::test<13>() | ||
245 | { | ||
246 | F64 x1 = 1., y1 = 2., z1 = -1.1,div = 4.2; | ||
247 | F64 t = 1.f / div; | ||
248 | LLVector3d vec3D(x1,y1,z1), vec3Da; | ||
249 | vec3Da = vec3D/div; | ||
250 | ensure("1:operator/ failed",(x1*t == vec3Da.mdV[VX]) && (y1*t == vec3Da.mdV[VY])&& (z1*t == vec3Da.mdV[VZ])); | ||
251 | x1 = 1.23, y1 = 4., z1 = -2.32; | ||
252 | vec3D.clearVec(); | ||
253 | vec3Da.clearVec(); | ||
254 | vec3D.setVec(x1,y1,z1); | ||
255 | vec3Da = vec3D/div; | ||
256 | ensure("2:operator/ failed",(x1*t == vec3Da.mdV[VX]) && (y1*t == vec3Da.mdV[VY])&& (z1*t == vec3Da.mdV[VZ])); | ||
257 | vec3D /= div; | ||
258 | ensure("3:operator/= failed",(x1*t == vec3D.mdV[VX]) && (y1*t == vec3D.mdV[VY])&& (z1*t == vec3D.mdV[VZ])); | ||
259 | } | ||
260 | |||
261 | template<> template<> | ||
262 | void v3dmath_object::test<14>() | ||
263 | { | ||
264 | F64 x1 = 1., y1 = 2., z1 = -1.1; | ||
265 | LLVector3d vec3D(x1,y1,z1), vec3Da; | ||
266 | ensure("1:operator!= failed",(TRUE == (vec3D !=vec3Da))); | ||
267 | vec3Da = vec3D; | ||
268 | ensure("2:operator== failed",(vec3D ==vec3Da)); | ||
269 | vec3D.clearVec(); | ||
270 | vec3Da.clearVec(); | ||
271 | x1 = .211, y1 = 21.111, z1 = 23.22; | ||
272 | vec3D.setVec(x1,y1,z1); | ||
273 | vec3Da.setVec(x1,y1,z1); | ||
274 | ensure("3:operator== failed",(vec3D ==vec3Da)); | ||
275 | ensure("4:operator!= failed",(FALSE == (vec3D !=vec3Da))); | ||
276 | } | ||
277 | |||
278 | template<> template<> | ||
279 | void v3dmath_object::test<15>() | ||
280 | { | ||
281 | F64 x1 = 1., y1 = 2., z1 = -1.1; | ||
282 | LLVector3d vec3D(x1,y1,z1), vec3Da; | ||
283 | std::ostringstream stream1, stream2; | ||
284 | stream1 << vec3D; | ||
285 | vec3Da.setVec(x1,y1,z1); | ||
286 | stream2 << vec3Da; | ||
287 | ensure("1:operator << failed",(stream1.str() == stream2.str())); | ||
288 | } | ||
289 | |||
290 | template<> template<> | ||
291 | void v3dmath_object::test<16>() | ||
292 | { | ||
293 | F64 x1 = 1.23, y1 = 2.0, z1 = 4.; | ||
294 | char buf[] = "1.23 2. 4"; | ||
295 | LLVector3d vec3D, vec3Da(x1,y1,z1); | ||
296 | LLVector3d::parseVector3d(buf, &vec3D); | ||
297 | ensure_equals("1:parseVector3d: failed " , vec3D, vec3Da); | ||
298 | } | ||
299 | |||
300 | template<> template<> | ||
301 | void v3dmath_object::test<17>() | ||
302 | { | ||
303 | F64 x1 = 1., y1 = 2., z1 = -1.1; | ||
304 | LLVector3d vec3D(x1,y1,z1), vec3Da; | ||
305 | vec3Da = -vec3D; | ||
306 | ensure("1:operator- failed", (vec3D == - vec3Da)); | ||
307 | } | ||
308 | |||
309 | template<> template<> | ||
310 | void v3dmath_object::test<18>() | ||
311 | { | ||
312 | F64 x = 1., y = 2., z = -1.1; | ||
313 | LLVector3d vec3D(x,y,z); | ||
314 | F64 res = (x*x + y*y + z*z) - vec3D.magVecSquared(); | ||
315 | ensure("1:magVecSquared:Fail ", ((-F_APPROXIMATELY_ZERO <= res)&& (res <=F_APPROXIMATELY_ZERO))); | ||
316 | res = fsqrtf(x*x + y*y + z*z) - vec3D.magVec(); | ||
317 | ensure("2:magVec: Fail ", ((-F_APPROXIMATELY_ZERO <= res)&& (res <=F_APPROXIMATELY_ZERO))); | ||
318 | } | ||
319 | |||
320 | template<> template<> | ||
321 | void v3dmath_object::test<19>() | ||
322 | { | ||
323 | F64 x = 1., y = 2., z = -1.1; | ||
324 | LLVector3d vec3D(x,y,z); | ||
325 | F64 mag = vec3D.normVec(); | ||
326 | mag = 1.f/ mag; | ||
327 | ensure("1:normVec: Fail ", (x* mag == vec3D.mdV[VX]) && (y* mag == vec3D.mdV[VY])&& (z* mag == vec3D.mdV[VZ])); | ||
328 | x = 0.000000001, y = 0.000000001, z = 0.000000001; | ||
329 | vec3D.clearVec(); | ||
330 | vec3D.setVec(x,y,z); | ||
331 | mag = vec3D.normVec(); | ||
332 | ensure("2:normVec: Fail ", (x* mag == vec3D.mdV[VX]) && (y* mag == vec3D.mdV[VY])&& (z* mag == vec3D.mdV[VZ])); | ||
333 | } | ||
334 | |||
335 | template<> template<> | ||
336 | void v3dmath_object::test<20>() | ||
337 | { | ||
338 | F64 x1 = 1111.232222, y1 = 2222222222.22, z1 = 422222222222; | ||
339 | char buf[] = "1111.232222 2222222222.22 422222222222"; | ||
340 | LLVector3d vec3Da, vec3Db(x1,y1,z1); | ||
341 | LLVector3d::parseVector3d(buf, &vec3Da); | ||
342 | ensure_equals("1:parseVector3 failed", vec3Da, vec3Db); | ||
343 | } | ||
344 | |||
345 | template<> template<> | ||
346 | void v3dmath_object::test<21>() | ||
347 | { | ||
348 | F64 x1 = 1., y1 = 2., z1 = -1.1; | ||
349 | F64 x2 = 1.2, y2 = 2.5, z2 = 1.; | ||
350 | F64 val = 2.3f,val1,val2,val3; | ||
351 | val1 = x1 + (x2 - x1)* val; | ||
352 | val2 = y1 + (y2 - y1)* val; | ||
353 | val3 = z1 + (z2 - z1)* val; | ||
354 | LLVector3d vec3Da(x1,y1,z1),vec3Db(x2,y2,z2); | ||
355 | LLVector3d vec3d = lerp(vec3Da,vec3Db,val); | ||
356 | ensure("1:lerp failed", ((val1 ==vec3d.mdV[VX])&& (val2 ==vec3d.mdV[VY]) && (val3 ==vec3d.mdV[VZ]))); | ||
357 | } | ||
358 | |||
359 | template<> template<> | ||
360 | void v3dmath_object::test<22>() | ||
361 | { | ||
362 | F64 x = 2.32, y = 1.212, z = -.12; | ||
363 | F64 min = 0.0001, max = 3.0; | ||
364 | LLVector3d vec3d(x,y,z); | ||
365 | ensure("1:clamp:Fail ", (TRUE == (vec3d.clamp(min, max)))); | ||
366 | x = 0.000001f, z = 5.3f; | ||
367 | vec3d.setVec(x,y,z); | ||
368 | ensure("2:clamp:Fail ", (TRUE == (vec3d.clamp(min, max)))); | ||
369 | } | ||
370 | |||
371 | template<> template<> | ||
372 | void v3dmath_object::test<23>() | ||
373 | { | ||
374 | F64 x = 10., y = 20., z = -15.; | ||
375 | F64 epsilon = .23425; | ||
376 | LLVector3d vec3Da(x,y,z), vec3Db(x,y,z); | ||
377 | ensure("1:are_parallel: Fail ", (TRUE == are_parallel(vec3Da,vec3Db,epsilon))); | ||
378 | F64 x1 = -12., y1 = -20., z1 = -100.; | ||
379 | vec3Db.clearVec(); | ||
380 | vec3Db.setVec(x1,y1,z1); | ||
381 | ensure("2:are_parallel: Fail ", (FALSE == are_parallel(vec3Da,vec3Db,epsilon))); | ||
382 | } | ||
383 | |||
384 | template<> template<> | ||
385 | void v3dmath_object::test<24>() | ||
386 | { | ||
387 | F64 x = 10., y = 20., z = -15.; | ||
388 | F64 angle1, angle2; | ||
389 | LLVector3d vec3Da(x,y,z), vec3Db(x,y,z); | ||
390 | angle1 = angle_between(vec3Da, vec3Db); | ||
391 | ensure("1:angle_between: Fail ", (0 == angle1)); | ||
392 | F64 x1 = -1., y1 = -20., z1 = -1.; | ||
393 | vec3Da.clearVec(); | ||
394 | vec3Da.setVec(x1,y1,z1); | ||
395 | angle2 = angle_between(vec3Da, vec3Db); | ||
396 | vec3Db.normVec(); | ||
397 | vec3Da.normVec(); | ||
398 | F64 angle = vec3Db*vec3Da; | ||
399 | angle = acos(angle); | ||
400 | ensure("2:angle_between: Fail ", (angle == angle2)); | ||
401 | } | ||
402 | } \ No newline at end of file | ||
diff --git a/linden/indra/test/v3math_tut.cpp b/linden/indra/test/v3math_tut.cpp new file mode 100644 index 0000000..36eaca9 --- /dev/null +++ b/linden/indra/test/v3math_tut.cpp | |||
@@ -0,0 +1,568 @@ | |||
1 | /** | ||
2 | * @file v3math_tut.cpp | ||
3 | * @author Adroit | ||
4 | * @date February 2007 | ||
5 | * @brief v3math test cases. | ||
6 | * | ||
7 | * Copyright (c) 2007-2007, Linden Research, Inc. | ||
8 | * | ||
9 | * The source code in this file ("Source Code") is provided by Linden Lab | ||
10 | * to you under the terms of the GNU General Public License, version 2.0 | ||
11 | * ("GPL"), unless you have obtained a separate licensing agreement | ||
12 | * ("Other License"), formally executed by you and Linden Lab. Terms of | ||
13 | * the GPL can be found in doc/GPL-license.txt in this distribution, or | ||
14 | * online at http://secondlife.com/developers/opensource/gplv2 | ||
15 | * | ||
16 | * There are special exceptions to the terms and conditions of the GPL as | ||
17 | * it is applied to this Source Code. View the full text of the exception | ||
18 | * in the file doc/FLOSS-exception.txt in this software distribution, or | ||
19 | * online at http://secondlife.com/developers/opensource/flossexception | ||
20 | * | ||
21 | * By copying, modifying or distributing this software, you acknowledge | ||
22 | * that you have read and understood your obligations described above, | ||
23 | * and agree to abide by those obligations. | ||
24 | * | ||
25 | * ALL LINDEN LAB SOURCE CODE IS PROVIDED "AS IS." LINDEN LAB MAKES NO | ||
26 | * WARRANTIES, EXPRESS, IMPLIED OR OTHERWISE, REGARDING ITS ACCURACY, | ||
27 | * COMPLETENESS OR PERFORMANCE. | ||
28 | */ | ||
29 | |||
30 | #include <tut/tut.h> | ||
31 | #include "lltut.h" | ||
32 | #include "llquaternion.h" | ||
33 | #include "linden_common.h" | ||
34 | #include "llquantize.h" | ||
35 | #include "v3dmath.h" | ||
36 | #include "m3math.h" | ||
37 | #include "v4math.h" | ||
38 | #include "llsd.h" | ||
39 | #include "v3math.h" | ||
40 | |||
41 | |||
42 | namespace tut | ||
43 | { | ||
44 | struct v3math_data | ||
45 | { | ||
46 | }; | ||
47 | typedef test_group<v3math_data> v3math_test; | ||
48 | typedef v3math_test::object v3math_object; | ||
49 | tut::v3math_test v3math_testcase("v3math"); | ||
50 | |||
51 | template<> template<> | ||
52 | void v3math_object::test<1>() | ||
53 | { | ||
54 | LLVector3 vec3; | ||
55 | ensure("1:LLVector3:Fail to initialize ", ((0.f == vec3.mV[VX]) && (0.f == vec3.mV[VY]) && (0.f == vec3.mV[VZ]))); | ||
56 | F32 x = 2.32f, y = 1.212f, z = -.12f; | ||
57 | LLVector3 vec3a(x,y,z); | ||
58 | ensure("2:LLVector3:Fail to initialize ", ((2.32f == vec3a.mV[VX]) && (1.212f == vec3a.mV[VY]) && (-.12f == vec3a.mV[VZ]))); | ||
59 | const F32 vec[3] = {1.2f ,3.2f, -4.2f}; | ||
60 | LLVector3 vec3b(vec); | ||
61 | ensure("3:LLVector3:Fail to initialize ", ((1.2f == vec3b.mV[VX]) && (3.2f == vec3b.mV[VY]) && (-4.2f == vec3b.mV[VZ]))); | ||
62 | } | ||
63 | |||
64 | template<> template<> | ||
65 | void v3math_object::test<2>() | ||
66 | { | ||
67 | F32 x = 2.32f, y = 1.212f, z = -.12f; | ||
68 | LLVector3 vec3(x,y,z); | ||
69 | LLVector3d vector3d(vec3); | ||
70 | LLVector3 vec3a(vector3d); | ||
71 | ensure("1:LLVector3:Fail to initialize ", vec3 == vec3a); | ||
72 | LLVector4 vector4(vec3); | ||
73 | LLVector3 vec3b(vector4); | ||
74 | ensure("2:LLVector3:Fail to initialize ", vec3 == vec3b); | ||
75 | } | ||
76 | |||
77 | template<> template<> | ||
78 | void v3math_object::test<3>() | ||
79 | { | ||
80 | S32 a = 231; | ||
81 | LLSD llsd(a); | ||
82 | LLVector3 vec3(llsd); | ||
83 | LLSD sd = vec3.getValue(); | ||
84 | LLVector3 vec3a(sd); | ||
85 | ensure("1:LLVector3:Fail to initialize ", (vec3 == vec3a)); | ||
86 | } | ||
87 | |||
88 | template<> template<> | ||
89 | void v3math_object::test<4>() | ||
90 | { | ||
91 | S32 a = 231; | ||
92 | LLSD llsd(a); | ||
93 | LLVector3 vec3(llsd),vec3a; | ||
94 | vec3a = vec3; | ||
95 | ensure("1:Operator= Fail to initialize " ,(vec3 == vec3a)); | ||
96 | } | ||
97 | |||
98 | template<> template<> | ||
99 | void v3math_object::test<5>() | ||
100 | { | ||
101 | F32 x = 2.32f, y = 1.212f, z = -.12f; | ||
102 | LLVector3 vec3(x,y,z); | ||
103 | ensure("1:isFinite= Fail to initialize ", (TRUE == vec3.isFinite()));//need more test cases: | ||
104 | vec3.clearVec(); | ||
105 | ensure("2:clearVec:Fail to set values ", ((0.f == vec3.mV[VX]) && (0.f == vec3.mV[VY]) && (0.f == vec3.mV[VZ]))); | ||
106 | vec3.setVec(x,y,z); | ||
107 | ensure("3:setVec:Fail to set values ", ((2.32f == vec3.mV[VX]) && (1.212f == vec3.mV[VY]) && (-.12f == vec3.mV[VZ]))); | ||
108 | vec3.zeroVec(); | ||
109 | ensure("4:zeroVec:Fail to set values ", ((0.f == vec3.mV[VX]) && (0.f == vec3.mV[VY]) && (0.f == vec3.mV[VZ]))); | ||
110 | } | ||
111 | |||
112 | template<> template<> | ||
113 | void v3math_object::test<6>() | ||
114 | { | ||
115 | F32 x = 2.32f, y = 1.212f, z = -.12f; | ||
116 | LLVector3 vec3(x,y,z),vec3a; | ||
117 | vec3.abs(); | ||
118 | ensure("1:abs:Fail ", ((x == vec3.mV[VX]) && (y == vec3.mV[VY]) && (-z == vec3.mV[VZ]))); | ||
119 | vec3a.setVec(vec3); | ||
120 | ensure("2:setVec:Fail to initialize ", (vec3a == vec3)); | ||
121 | const F32 vec[3] = {1.2f ,3.2f, -4.2f}; | ||
122 | vec3.clearVec(); | ||
123 | vec3.setVec(vec); | ||
124 | ensure("3:setVec:Fail to initialize ", ((1.2f == vec3.mV[VX]) && (3.2f == vec3.mV[VY]) && (-4.2f == vec3.mV[VZ]))); | ||
125 | vec3a.clearVec(); | ||
126 | LLVector3d vector3d(vec3); | ||
127 | vec3a.setVec(vector3d); | ||
128 | ensure("4:setVec:Fail to initialize ", (vec3 == vec3a)); | ||
129 | LLVector4 vector4(vec3); | ||
130 | vec3a.clearVec(); | ||
131 | vec3a.setVec(vector4); | ||
132 | ensure("5:setVec:Fail to initialize ", (vec3 == vec3a)); | ||
133 | } | ||
134 | |||
135 | template<> template<> | ||
136 | void v3math_object::test<7>() | ||
137 | { | ||
138 | F32 x = 2.32f, y = 3.212f, z = -.12f; | ||
139 | F32 min = 0.0001f, max = 3.0f; | ||
140 | LLVector3 vec3(x,y,z); | ||
141 | ensure("1:clamp:Fail ", TRUE == vec3.clamp(min, max) && x == vec3.mV[VX] && max == vec3.mV[VY] && min == vec3.mV[VZ]); | ||
142 | x = 1.f, y = 2.2f, z = 2.8f; | ||
143 | vec3.setVec(x,y,z); | ||
144 | ensure("2:clamp:Fail ", FALSE == vec3.clamp(min, max)); | ||
145 | } | ||
146 | |||
147 | template<> template<> | ||
148 | void v3math_object::test<8>() | ||
149 | { | ||
150 | F32 x = 2.32f, y = 1.212f, z = -.12f; | ||
151 | LLVector3 vec3(x,y,z); | ||
152 | ensure("1:magVecSquared:Fail ", is_approx_equal(vec3.magVecSquared(), (x*x + y*y + z*z))); | ||
153 | ensure("2:magVec:Fail ", is_approx_equal(vec3.magVec(), fsqrtf(x*x + y*y + z*z))); | ||
154 | } | ||
155 | |||
156 | template<> template<> | ||
157 | void v3math_object::test<9>() | ||
158 | { | ||
159 | F32 x =-2.0f, y = -3.0f, z = 1.23f ; | ||
160 | LLVector3 vec3(x,y,z); | ||
161 | ensure("1:abs():Fail ", (TRUE == vec3.abs())); | ||
162 | ensure("2:isNull():Fail", (FALSE == vec3.isNull())); //Returns TRUE if vector has a _very_small_ length | ||
163 | x =.00000001f, y = .000001001f, z = .000001001f; | ||
164 | vec3.setVec(x,y,z); | ||
165 | ensure("3:isNull(): Fail ", (TRUE == vec3.isNull())); | ||
166 | } | ||
167 | |||
168 | template<> template<> | ||
169 | void v3math_object::test<10>() | ||
170 | { | ||
171 | F32 x =-2.0f, y = -3.0f, z = 1.f ; | ||
172 | LLVector3 vec3(x,y,z),vec3a; | ||
173 | ensure("1:isExactlyZero():Fail ", (TRUE == vec3a.isExactlyZero())); | ||
174 | vec3a = vec3a.scaleVec(vec3); | ||
175 | ensure("2:scaleVec: Fail ", vec3a.mV[VX] == 0.f && vec3a.mV[VY] == 0.f && vec3a.mV[VZ] == 0.f); | ||
176 | vec3a.setVec(x,y,z); | ||
177 | vec3a = vec3a.scaleVec(vec3); | ||
178 | ensure("3:scaleVec: Fail ", ((4 == vec3a.mV[VX]) && (9 == vec3a.mV[VY]) &&(1 == vec3a.mV[VZ]))); | ||
179 | ensure("4:isExactlyZero():Fail ", (FALSE == vec3.isExactlyZero())); | ||
180 | } | ||
181 | |||
182 | template<> template<> | ||
183 | void v3math_object::test<11>() | ||
184 | { | ||
185 | F32 x =20.0f, y = 30.0f, z = 15.f ; | ||
186 | F32 angle = 100.f; | ||
187 | LLVector3 vec3(x,y,z),vec3a(1.f,2.f,3.f); | ||
188 | vec3a = vec3a.rotVec(angle, vec3); | ||
189 | LLVector3 vec3b(1.f,2.f,3.f); | ||
190 | vec3b = vec3b.rotVec(angle, vec3); | ||
191 | ensure_equals("rotVec():Fail" ,vec3b,vec3a); | ||
192 | } | ||
193 | |||
194 | template<> template<> | ||
195 | void v3math_object::test<12>() | ||
196 | { | ||
197 | F32 x =-2.0f, y = -3.0f, z = 1.f ; | ||
198 | LLVector3 vec3(x,y,z); | ||
199 | ensure("1:operator [] failed",( x == vec3[0])); | ||
200 | ensure("2:operator [] failed",( y == vec3[1])); | ||
201 | ensure("3:operator [] failed",( z == vec3[2])); | ||
202 | |||
203 | vec3.clearVec(); | ||
204 | x = 23.f, y = -.2361f, z = 3.25; | ||
205 | vec3.setVec(x,y,z); | ||
206 | F32 &ref1 = vec3[0]; | ||
207 | ensure("4:operator [] failed",( ref1 == vec3[0])); | ||
208 | F32 &ref2 = vec3[1]; | ||
209 | ensure("5:operator [] failed",( ref2 == vec3[1])); | ||
210 | F32 &ref3 = vec3[2]; | ||
211 | ensure("6:operator [] failed",( ref3 == vec3[2])); | ||
212 | } | ||
213 | |||
214 | template<> template<> | ||
215 | void v3math_object::test<13>() | ||
216 | { | ||
217 | F32 x1 =1.f, y1 = 2.f,z1 = 1.2f, x2 = -2.3f, y2 = 1.11f, z2 = 1234.234f; | ||
218 | F32 val1, val2, val3; | ||
219 | LLVector3 vec3(x1,y1,z1), vec3a(x2,y2,z2), vec3b; | ||
220 | vec3b = vec3 + vec3a ; | ||
221 | val1 = x1+x2; | ||
222 | val2 = y1+y2; | ||
223 | val3 = z1+z2; | ||
224 | ensure("1:operator+ failed",(val1 == vec3b.mV[VX]) && (val2 == vec3b.mV[VY]) && (val3 == vec3b.mV[VZ])); | ||
225 | |||
226 | vec3.clearVec(); | ||
227 | vec3a.clearVec(); | ||
228 | vec3b.clearVec(); | ||
229 | x1 = -.235f, y1 = -24.32f,z1 = 2.13f, x2 = -2.3f, y2 = 1.f, z2 = 34.21f; | ||
230 | vec3.setVec(x1,y1,z1); | ||
231 | vec3a.setVec(x2,y2,z2); | ||
232 | vec3b = vec3 + vec3a; | ||
233 | val1 = x1+x2; | ||
234 | val2 = y1+y2; | ||
235 | val3 = z1+z2; | ||
236 | ensure("2:operator+ failed",(val1 == vec3b.mV[VX]) && (val2 == vec3b.mV[VY]) && (val3 == vec3b.mV[VZ])); | ||
237 | } | ||
238 | |||
239 | template<> template<> | ||
240 | void v3math_object::test<14>() | ||
241 | { | ||
242 | F32 x1 =1.f, y1 = 2.f,z1 = 1.2f, x2 = -2.3f, y2 = 1.11f, z2 = 1234.234f; | ||
243 | F32 val1, val2, val3; | ||
244 | LLVector3 vec3(x1,y1,z1), vec3a(x2,y2,z2), vec3b; | ||
245 | vec3b = vec3 - vec3a ; | ||
246 | val1 = x1-x2; | ||
247 | val2 = y1-y2; | ||
248 | val3 = z1-z2; | ||
249 | ensure("1:operator- failed",(val1 == vec3b.mV[VX]) && (val2 == vec3b.mV[VY]) && (val3 == vec3b.mV[VZ])); | ||
250 | |||
251 | vec3.clearVec(); | ||
252 | vec3a.clearVec(); | ||
253 | vec3b.clearVec(); | ||
254 | x1 = -.235f, y1 = -24.32f,z1 = 2.13f, x2 = -2.3f, y2 = 1.f, z2 = 34.21f; | ||
255 | vec3.setVec(x1,y1,z1); | ||
256 | vec3a.setVec(x2,y2,z2); | ||
257 | vec3b = vec3 - vec3a; | ||
258 | val1 = x1-x2; | ||
259 | val2 = y1-y2; | ||
260 | val3 = z1-z2; | ||
261 | ensure("2:operator- failed",(val1 == vec3b.mV[VX]) && (val2 == vec3b.mV[VY]) && (val3 == vec3b.mV[VZ])); | ||
262 | } | ||
263 | |||
264 | template<> template<> | ||
265 | void v3math_object::test<15>() | ||
266 | { | ||
267 | F32 x1 =1.f, y1 = 2.f,z1 = 1.2f, x2 = -2.3f, y2 = 1.11f, z2 = 1234.234f; | ||
268 | F32 val1, val2, val3; | ||
269 | LLVector3 vec3(x1,y1,z1), vec3a(x2,y2,z2); | ||
270 | val1 = vec3 * vec3a; | ||
271 | val2 = x1*x2 + y1*y2 + z1*z2; | ||
272 | ensure_equals("1:operator* failed",val1,val2); | ||
273 | |||
274 | vec3a.clearVec(); | ||
275 | F32 mulVal = 4.332f; | ||
276 | vec3a = vec3 * mulVal; | ||
277 | val1 = x1*mulVal; | ||
278 | val2 = y1*mulVal; | ||
279 | val3 = z1*mulVal; | ||
280 | ensure("2:operator* failed",(val1 == vec3a.mV[VX]) && (val2 == vec3a.mV[VY])&& (val3 == vec3a.mV[VZ])); | ||
281 | vec3a.clearVec(); | ||
282 | vec3a = mulVal * vec3; | ||
283 | ensure("3:operator* failed ", (val1 == vec3a.mV[VX]) && (val2 == vec3a.mV[VY])&& (val3 == vec3a.mV[VZ])); | ||
284 | } | ||
285 | |||
286 | template<> template<> | ||
287 | void v3math_object::test<16>() | ||
288 | { | ||
289 | F32 x1 =1.f, y1 = 2.f,z1 = 1.2f, x2 = -2.3f, y2 = 1.11f, z2 = 1234.234f; | ||
290 | F32 val1, val2, val3; | ||
291 | LLVector3 vec3(x1,y1,z1), vec3a(x2,y2,z2), vec3b; | ||
292 | vec3b = vec3 % vec3a ; | ||
293 | val1 = y1*z2 - y2*z1; | ||
294 | val2 = z1*x2 -z2*x1; | ||
295 | val3 = x1*y2-x2*y1; | ||
296 | ensure("1:operator% failed",(val1 == vec3b.mV[VX]) && (val2 == vec3b.mV[VY]) && (val3 == vec3b.mV[VZ])); | ||
297 | |||
298 | vec3.clearVec(); | ||
299 | vec3a.clearVec(); | ||
300 | vec3b.clearVec(); | ||
301 | x1 =112.f, y1 = 22.3f,z1 = 1.2f, x2 = -2.3f, y2 = 341.11f, z2 = 1234.234f; | ||
302 | vec3.setVec(x1,y1,z1); | ||
303 | vec3a.setVec(x2,y2,z2); | ||
304 | vec3b = vec3 % vec3a ; | ||
305 | val1 = y1*z2 - y2*z1; | ||
306 | val2 = z1*x2 -z2*x1; | ||
307 | val3 = x1*y2-x2*y1; | ||
308 | ensure("2:operator% failed ", (val1 == vec3b.mV[VX]) && (val2 == vec3b.mV[VY]) && (val3 == vec3b.mV[VZ])); | ||
309 | } | ||
310 | |||
311 | template<> template<> | ||
312 | void v3math_object::test<17>() | ||
313 | { | ||
314 | F32 x1 =1.f, y1 = 2.f,z1 = 1.2f, div = 3.2f; | ||
315 | F32 t = 1.f / div, val1, val2, val3; | ||
316 | LLVector3 vec3(x1,y1,z1), vec3a; | ||
317 | vec3a = vec3 / div; | ||
318 | val1 = x1 * t; | ||
319 | val2 = y1 * t; | ||
320 | val3 = z1 *t; | ||
321 | ensure("1:operator/ failed",(val1 == vec3a.mV[VX]) && (val2 == vec3a.mV[VY]) && (val3 == vec3a.mV[VZ])); | ||
322 | |||
323 | vec3a.clearVec(); | ||
324 | x1 = -.235f, y1 = -24.32f, z1 = .342f, div = -2.2f; | ||
325 | t = 1.f / div; | ||
326 | vec3.setVec(x1,y1,z1); | ||
327 | vec3a = vec3 / div; | ||
328 | val1 = x1 * t; | ||
329 | val2 = y1 * t; | ||
330 | val3 = z1 *t; | ||
331 | ensure("2:operator/ failed",(val1 == vec3a.mV[VX]) && (val2 == vec3a.mV[VY]) && (val3 == vec3a.mV[VZ])); | ||
332 | } | ||
333 | |||
334 | template<> template<> | ||
335 | void v3math_object::test<18>() | ||
336 | { | ||
337 | F32 x1 =1.f, y1 = 2.f,z1 = 1.2f; | ||
338 | LLVector3 vec3(x1,y1,z1), vec3a(x1,y1,z1); | ||
339 | ensure("1:operator== failed",(vec3 == vec3a)); | ||
340 | |||
341 | vec3a.clearVec(); | ||
342 | x1 = -.235f, y1 = -24.32f, z1 = .342f; | ||
343 | vec3.clearVec(); | ||
344 | vec3a.clearVec(); | ||
345 | vec3.setVec(x1,y1,z1); | ||
346 | vec3a.setVec(x1,y1,z1); | ||
347 | ensure("2:operator== failed ", (vec3 == vec3a)); | ||
348 | } | ||
349 | |||
350 | template<> template<> | ||
351 | void v3math_object::test<19>() | ||
352 | { | ||
353 | F32 x1 =1.f, y1 = 2.f,z1 = 1.2f, x2 =112.f, y2 = 2.234f,z2 = 11.2f;; | ||
354 | LLVector3 vec3(x1,y1,z1), vec3a(x2,y2,z2); | ||
355 | ensure("1:operator!= failed",(vec3a != vec3)); | ||
356 | |||
357 | vec3.clearVec(); | ||
358 | vec3.clearVec(); | ||
359 | vec3a.setVec(vec3); | ||
360 | ensure("2:operator!= failed", ( FALSE == (vec3a != vec3))); | ||
361 | } | ||
362 | |||
363 | template<> template<> | ||
364 | void v3math_object::test<20>() | ||
365 | { | ||
366 | F32 x1 =1.f, y1 = 2.f,z1 = 1.2f, x2 =112.f, y2 = 2.2f,z2 = 11.2f;; | ||
367 | LLVector3 vec3(x1,y1,z1), vec3a(x2,y2,z2); | ||
368 | vec3a += vec3; | ||
369 | F32 val1, val2, val3; | ||
370 | val1 = x1+x2; | ||
371 | val2 = y1+y2; | ||
372 | val3 = z1+z2; | ||
373 | ensure("1:operator+= failed",(val1 == vec3a.mV[VX]) && (val2 == vec3a.mV[VY])&& (val3 == vec3a.mV[VZ])); | ||
374 | } | ||
375 | |||
376 | template<> template<> | ||
377 | void v3math_object::test<21>() | ||
378 | { | ||
379 | F32 x1 =1.f, y1 = 2.f,z1 = 1.2f, x2 =112.f, y2 = 2.2f,z2 = 11.2f;; | ||
380 | LLVector3 vec3(x1,y1,z1), vec3a(x2,y2,z2); | ||
381 | vec3a -= vec3; | ||
382 | F32 val1, val2, val3; | ||
383 | val1 = x2-x1; | ||
384 | val2 = y2-y1; | ||
385 | val3 = z2-z1; | ||
386 | ensure("1:operator-= failed",(val1 == vec3a.mV[VX]) && (val2 == vec3a.mV[VY])&& (val3 == vec3a.mV[VZ])); | ||
387 | } | ||
388 | |||
389 | template<> template<> | ||
390 | void v3math_object::test<22>() | ||
391 | { | ||
392 | F32 x1 =1.f, y1 = 2.f,z1 = 1.2f, x2 = -2.3f, y2 = 1.11f, z2 = 1234.234f; | ||
393 | F32 val1,val2,val3; | ||
394 | LLVector3 vec3(x1,y1,z1), vec3a(x2,y2,z2); | ||
395 | vec3a *= vec3; | ||
396 | val1 = x1*x2; | ||
397 | val2 = y1*y2; | ||
398 | val3 = z1*z2; | ||
399 | ensure("1:operator*= failed",(val1 == vec3a.mV[VX]) && (val2 == vec3a.mV[VY])&& (val3 == vec3a.mV[VZ])); | ||
400 | |||
401 | F32 mulVal = 4.332f; | ||
402 | vec3 *=mulVal; | ||
403 | val1 = x1*mulVal; | ||
404 | val2 = y1*mulVal; | ||
405 | val3 = z1*mulVal; | ||
406 | ensure("2:operator*= failed ", (val1 == vec3.mV[VX]) && (val2 == vec3.mV[VY]) && (val3 == vec3.mV[VZ])); | ||
407 | } | ||
408 | |||
409 | template<> template<> | ||
410 | void v3math_object::test<23>() | ||
411 | { | ||
412 | F32 x1 =1.f, y1 = 2.f,z1 = 1.2f, x2 = -2.3f, y2 = 1.11f, z2 = 1234.234f; | ||
413 | LLVector3 vec3(x1,y1,z1), vec3a(x2,y2,z2),vec3b; | ||
414 | vec3b = vec3a % vec3; | ||
415 | vec3a %= vec3; | ||
416 | ensure_equals("1:operator%= failed",vec3a,vec3b); | ||
417 | } | ||
418 | |||
419 | template<> template<> | ||
420 | void v3math_object::test<24>() | ||
421 | { | ||
422 | F32 x1 =1.f, y1 = 2.f,z1 = 1.2f, div = 3.2f; | ||
423 | F32 t = 1.f / div, val1, val2, val3; | ||
424 | LLVector3 vec3a(x1,y1,z1); | ||
425 | vec3a /= div; | ||
426 | val1 = x1 * t; | ||
427 | val2 = y1 * t; | ||
428 | val3 = z1 *t; | ||
429 | ensure("1:operator/= failed",(val1 == vec3a.mV[VX]) && (val2 == vec3a.mV[VY]) && (val3 == vec3a.mV[VZ])); | ||
430 | } | ||
431 | |||
432 | template<> template<> | ||
433 | void v3math_object::test<25>() | ||
434 | { | ||
435 | F32 x1 =1.f, y1 = 2.f,z1 = 1.2f; | ||
436 | LLVector3 vec3(x1,y1,z1), vec3a; | ||
437 | vec3a = -vec3; | ||
438 | ensure("1:operator- failed",(-vec3a == vec3)); | ||
439 | } | ||
440 | |||
441 | template<> template<> | ||
442 | void v3math_object::test<26>() | ||
443 | { | ||
444 | F32 x1 =1.f, y1 = 2.f,z1 = 1.2f; | ||
445 | std::ostringstream stream1, stream2; | ||
446 | LLVector3 vec3(x1,y1,z1), vec3a; | ||
447 | stream1 << vec3; | ||
448 | vec3a.setVec(x1,y1,z1); | ||
449 | stream2 << vec3a; | ||
450 | ensure("1:operator << failed",(stream1.str() == stream2.str())); | ||
451 | } | ||
452 | |||
453 | template<> template<> | ||
454 | void v3math_object::test<27>() | ||
455 | { | ||
456 | F32 x1 =-2.3f, y1 = 2.f,z1 = 1.2f, x2 = 1.3f, y2 = 1.11f, z2 = 1234.234f; | ||
457 | LLVector3 vec3(x1,y1,z1), vec3a(x2,y2,z2); | ||
458 | ensure("1:operator< failed", (TRUE == vec3 < vec3a)); | ||
459 | x1 =-2.3f, y1 = 2.f,z1 = 1.2f, x2 = 1.3f, y2 = 2.f, z2 = 1234.234f; | ||
460 | vec3.setVec(x1,y1,z1); | ||
461 | vec3a.setVec(x2,y2,z2); | ||
462 | ensure("2:operator< failed ", (TRUE == vec3 < vec3a)); | ||
463 | x1 =2.3f, y1 = 2.f,z1 = 1.2f, x2 = 1.3f, | ||
464 | vec3.setVec(x1,y1,z1); | ||
465 | vec3a.setVec(x2,y2,z2); | ||
466 | ensure("3:operator< failed ", (FALSE == vec3 < vec3a)); | ||
467 | } | ||
468 | |||
469 | template<> template<> | ||
470 | void v3math_object::test<28>() | ||
471 | { | ||
472 | F32 x1 =1.23f, y1 = 2.f,z1 = 4.f; | ||
473 | char buf[] = "1.23 2. 4"; | ||
474 | LLVector3 vec3, vec3a(x1,y1,z1); | ||
475 | LLVector3::parseVector3(buf, &vec3); | ||
476 | ensure_equals("1:parseVector3 failed", vec3, vec3a); | ||
477 | } | ||
478 | |||
479 | template<> template<> | ||
480 | void v3math_object::test<29>() | ||
481 | { | ||
482 | F32 x1 =1.f, y1 = 2.f,z1 = 4.f; | ||
483 | LLVector3 vec3(x1,y1,z1),vec3a,vec3b; | ||
484 | vec3a.setVec(1,1,1); | ||
485 | vec3a.scaleVec(vec3); | ||
486 | ensure_equals("1:scaleVec failed", vec3, vec3a); | ||
487 | vec3a.clearVec(); | ||
488 | vec3a.setVec(x1,y1,z1); | ||
489 | vec3a.scaleVec(vec3); | ||
490 | ensure("2:scaleVec failed", ((1.f ==vec3a.mV[VX])&& (4.f ==vec3a.mV[VY]) && (16.f ==vec3a.mV[VZ]))); | ||
491 | } | ||
492 | |||
493 | template<> template<> | ||
494 | void v3math_object::test<30>() | ||
495 | { | ||
496 | F32 x1 =-2.3f, y1 = 2.f,z1 = 1.2f, x2 = 1.3f, y2 = 1.11f, z2 = 1234.234f; | ||
497 | F32 val = 2.3f,val1,val2,val3; | ||
498 | val1 = x1 + (x2 - x1)* val; | ||
499 | val2 = y1 + (y2 - y1)* val; | ||
500 | val3 = z1 + (z2 - z1)* val; | ||
501 | LLVector3 vec3(x1,y1,z1),vec3a(x2,y2,z2); | ||
502 | LLVector3 vec3b = lerp(vec3,vec3a,val); | ||
503 | ensure("1:lerp failed", ((val1 ==vec3b.mV[VX])&& (val2 ==vec3b.mV[VY]) && (val3 ==vec3b.mV[VZ]))); | ||
504 | } | ||
505 | |||
506 | template<> template<> | ||
507 | void v3math_object::test<31>() | ||
508 | { | ||
509 | F32 x1 =-2.3f, y1 = 2.f,z1 = 1.2f, x2 = 1.3f, y2 = 1.f, z2 = 1.f; | ||
510 | F32 val1,val2; | ||
511 | LLVector3 vec3(x1,y1,z1),vec3a(x2,y2,z2); | ||
512 | val1 = dist_vec(vec3,vec3a); | ||
513 | val2 = fsqrtf((x1 - x2)*(x1 - x2) + (y1 - y2)* (y1 - y2) + (z1 - z2)* (z1 -z2)); | ||
514 | ensure_equals("1:dist_vec: Fail ",val2, val1); | ||
515 | val1 = dist_vec_squared(vec3,vec3a); | ||
516 | val2 =((x1 - x2)*(x1 - x2) + (y1 - y2)* (y1 - y2) + (z1 - z2)* (z1 -z2)); | ||
517 | ensure_equals("2:dist_vec_squared: Fail ",val2, val1); | ||
518 | val1 = dist_vec_squared2D(vec3, vec3a); | ||
519 | val2 =(x1 - x2)*(x1 - x2) + (y1 - y2)* (y1 - y2); | ||
520 | ensure_equals("3:dist_vec_squared2D: Fail ",val2, val1); | ||
521 | } | ||
522 | |||
523 | template<> template<> | ||
524 | void v3math_object::test<32>() | ||
525 | { | ||
526 | F32 x =12.3524f, y = -342.f,z = 4.126341f; | ||
527 | LLVector3 vec3(x,y,z); | ||
528 | F32 mag = vec3.normVec(); | ||
529 | mag = 1.f/ mag; | ||
530 | F32 val1 = x* mag, val2 = y* mag, val3 = z* mag; | ||
531 | ensure("1:normVec: Fail ", (val1 == vec3.mV[VX]) && (val2 == vec3.mV[VY])&& (val3 == vec3.mV[VZ])); | ||
532 | x = 0.000000001f, y = 0.f, z = 0.f; | ||
533 | vec3.clearVec(); | ||
534 | vec3.setVec(x,y,z); | ||
535 | mag = vec3.normVec(); | ||
536 | val1 = x* mag, val2 = y* mag, val3 = z* mag; | ||
537 | ensure("2:normVec: Fail ", (mag == 0.) && (0. == vec3.mV[VX]) && (0. == vec3.mV[VY])&& (0. == vec3.mV[VZ])); | ||
538 | } | ||
539 | |||
540 | template<> template<> | ||
541 | void v3math_object::test<33>() | ||
542 | { | ||
543 | F32 x = -202.23412f, y = 123.2312f, z = -89.f; | ||
544 | LLVector3 vec(x,y,z); | ||
545 | vec.snap(2); | ||
546 | ensure("1:snap: Fail ", is_approx_equal(-202.23f, vec.mV[VX]) && is_approx_equal(123.23f, vec.mV[VY]) && is_approx_equal(-89.f, vec.mV[VZ])); | ||
547 | } | ||
548 | |||
549 | template<> template<> | ||
550 | void v3math_object::test<34>() | ||
551 | { | ||
552 | F32 x = 10.f, y = 20.f, z = -15.f; | ||
553 | F32 x1, y1, z1; | ||
554 | F32 lowerxy = 0.f, upperxy = 1.0f, lowerz = -1.0f, upperz = 1.f; | ||
555 | LLVector3 vec3(x,y,z); | ||
556 | vec3.quantize16(lowerxy,upperxy,lowerz,upperz); | ||
557 | x1 = U16_to_F32(F32_to_U16(x, lowerxy, upperxy), lowerxy, upperxy); | ||
558 | y1 = U16_to_F32(F32_to_U16(y, lowerxy, upperxy), lowerxy, upperxy); | ||
559 | z1 = U16_to_F32(F32_to_U16(z, lowerz, upperz), lowerz, upperz); | ||
560 | ensure("1:quantize16: Fail ", (x1 == vec3.mV[VX]) && (y1 == vec3.mV[VY])&& (z1 == vec3.mV[VZ])); | ||
561 | LLVector3 vec3a(x,y,z); | ||
562 | vec3a.quantize8(lowerxy,upperxy,lowerz,upperz); | ||
563 | x1 = U8_to_F32(F32_to_U8(x, lowerxy, upperxy), lowerxy, upperxy); | ||
564 | y1 = U8_to_F32(F32_to_U8(y, lowerxy, upperxy), lowerxy, upperxy); | ||
565 | z1 = U8_to_F32(F32_to_U8(z, lowerz, upperz), lowerz, upperz); | ||
566 | ensure("2:quantize8: Fail ", (x1 == vec3a.mV[VX]) && (y1 == vec3a.mV[VY])&& (z1 == vec3a.mV[VZ])); | ||
567 | } | ||
568 | } \ No newline at end of file | ||
diff --git a/linden/indra/test/xform_tut.cpp b/linden/indra/test/xform_tut.cpp new file mode 100644 index 0000000..b3bc347 --- /dev/null +++ b/linden/indra/test/xform_tut.cpp | |||
@@ -0,0 +1,247 @@ | |||
1 | /** | ||
2 | * @file xform_tut.cpp | ||
3 | * @author Adroit | ||
4 | * @date March 2007 | ||
5 | * @brief Test cases for LLXform | ||
6 | * | ||
7 | * Copyright (c) 2007-2007, Linden Research, Inc. | ||
8 | * | ||
9 | * Second Life Viewer Source Code | ||
10 | * The source code in this file ("Source Code") is provided by Linden Lab | ||
11 | * to you under the terms of the GNU General Public License, version 2.0 | ||
12 | * ("GPL"), unless you have obtained a separate licensing agreement | ||
13 | * ("Other License"), formally executed by you and Linden Lab. Terms of | ||
14 | * the GPL can be found in doc/GPL-license.txt in this distribution, or | ||
15 | * online at http://secondlife.com/developers/opensource/gplv2 | ||
16 | * | ||
17 | * There are special exceptions to the terms and conditions of the GPL as | ||
18 | * it is applied to this Source Code. View the full text of the exception | ||
19 | * in the file doc/FLOSS-exception.txt in this software distribution, or | ||
20 | * online at http://secondlife.com/developers/opensource/flossexception | ||
21 | * | ||
22 | * By copying, modifying or distributing this software, you acknowledge | ||
23 | * that you have read and understood your obligations described above, | ||
24 | * and agree to abide by those obligations. | ||
25 | * | ||
26 | * ALL LINDEN LAB SOURCE CODE IS PROVIDED "AS IS." LINDEN LAB MAKES NO | ||
27 | * WARRANTIES, EXPRESS, IMPLIED OR OTHERWISE, REGARDING ITS ACCURACY, | ||
28 | * COMPLETENESS OR PERFORMANCE. | ||
29 | */ | ||
30 | |||
31 | #include <tut/tut.h> | ||
32 | #include "lltut.h" | ||
33 | #include "linden_common.h" | ||
34 | #include "xform.h" | ||
35 | |||
36 | namespace tut | ||
37 | { | ||
38 | struct xform_test | ||
39 | { | ||
40 | }; | ||
41 | typedef test_group<xform_test> xform_test_t; | ||
42 | typedef xform_test_t::object xform_test_object_t; | ||
43 | tut::xform_test_t tut_xform_test("xform_test"); | ||
44 | |||
45 | //test case for init(), getParent(), getRotation(), getPositionW(), getWorldRotation() fns. | ||
46 | template<> template<> | ||
47 | void xform_test_object_t::test<1>() | ||
48 | { | ||
49 | LLXform xform_obj; | ||
50 | LLVector3 emptyVec(0.f,0.f,0.f); | ||
51 | LLVector3 initialScaleVec(1.f,1.f,1.f); | ||
52 | |||
53 | ensure("LLXform empty constructor failed: ", !xform_obj.getParent() && !xform_obj.isChanged() && | ||
54 | xform_obj.getPosition() == emptyVec && | ||
55 | (xform_obj.getRotation()).isIdentity() && | ||
56 | xform_obj.getScale() == initialScaleVec && | ||
57 | xform_obj.getPositionW() == emptyVec && | ||
58 | (xform_obj.getWorldRotation()).isIdentity() && | ||
59 | !xform_obj.getScaleChildOffset()); | ||
60 | } | ||
61 | |||
62 | // test cases for | ||
63 | // setScale(const LLVector3& scale) | ||
64 | // setScale(const F32 x, const F32 y, const F32 z) | ||
65 | // setRotation(const F32 x, const F32 y, const F32 z) | ||
66 | // setPosition(const F32 x, const F32 y, const F32 z) | ||
67 | // getLocalMat4(LLMatrix4 &mat) | ||
68 | template<> template<> | ||
69 | void xform_test_object_t::test<2>() | ||
70 | { | ||
71 | LLMatrix4 llmat4; | ||
72 | LLXform xform_obj; | ||
73 | |||
74 | F32 x = 3.6f; | ||
75 | F32 y = 5.5f; | ||
76 | F32 z = 4.2f; | ||
77 | F32 w = 0.f; | ||
78 | F32 posz = z + 2.122f; | ||
79 | LLVector3 vec(x, y, z); | ||
80 | xform_obj.setScale(x, y, z); | ||
81 | xform_obj.setPosition(x, y, posz); | ||
82 | ensure("setScale failed: ", xform_obj.getScale() == vec); | ||
83 | |||
84 | vec.setVec(x, y, posz); | ||
85 | ensure("getPosition failed: ", xform_obj.getPosition() == vec); | ||
86 | |||
87 | x = x * 2.f; | ||
88 | y = y + 2.3f; | ||
89 | z = posz * 4.f; | ||
90 | vec.setVec(x, y, z); | ||
91 | xform_obj.setPositionX(x); | ||
92 | xform_obj.setPositionY(y); | ||
93 | xform_obj.setPositionZ(z); | ||
94 | ensure("setPositionX/Y/Z failed: ", xform_obj.getPosition() == vec); | ||
95 | |||
96 | xform_obj.setScaleChildOffset(TRUE); | ||
97 | ensure("setScaleChildOffset failed: ", xform_obj.getScaleChildOffset()); | ||
98 | |||
99 | vec.setVec(x, y, z); | ||
100 | |||
101 | xform_obj.addPosition(vec); | ||
102 | vec += vec; | ||
103 | ensure("addPosition failed: ", xform_obj.getPosition() == vec); | ||
104 | |||
105 | xform_obj.setScale(vec); | ||
106 | ensure("setScale vector failed: ", xform_obj.getScale() == vec); | ||
107 | |||
108 | LLQuaternion quat(x, y, z, w); | ||
109 | xform_obj.setRotation(quat); | ||
110 | ensure("setRotation quat failed: ", xform_obj.getRotation() == quat); | ||
111 | |||
112 | xform_obj.setRotation(x, y, z, w); | ||
113 | ensure("getRotation 2 failed: ", xform_obj.getRotation() == quat); | ||
114 | |||
115 | xform_obj.setRotation(x, y, z); | ||
116 | quat.setQuat(x,y,z); | ||
117 | ensure("setRotation xyz failed: ", xform_obj.getRotation() == quat); | ||
118 | |||
119 | // LLXform::setRotation(const F32 x, const F32 y, const F32 z) | ||
120 | // Does normalization | ||
121 | // LLXform::setRotation(const F32 x, const F32 y, const F32 z, const F32 s) | ||
122 | // Simply copies the individual values - does not do any normalization. | ||
123 | // Is that the expected behavior? | ||
124 | } | ||
125 | |||
126 | // test cases for inline BOOL setParent(LLXform *parent) and getParent() fn. | ||
127 | template<> template<> | ||
128 | void xform_test_object_t::test<3>() | ||
129 | { | ||
130 | LLXform xform_obj; | ||
131 | LLXform par; | ||
132 | LLXform grandpar; | ||
133 | xform_obj.setParent(&par); | ||
134 | par.setParent(&grandpar); | ||
135 | ensure("setParent/getParent failed: ", &par == xform_obj.getParent()); | ||
136 | ensure("getRoot failed: ", &grandpar == xform_obj.getRoot()); | ||
137 | ensure("isRoot failed: ", grandpar.isRoot() && !par.isRoot() && !xform_obj.isRoot()); | ||
138 | ensure("isRootEdit failed: ", grandpar.isRootEdit() && !par.isRootEdit() && !xform_obj.isRootEdit()); | ||
139 | } | ||
140 | |||
141 | template<> template<> | ||
142 | void xform_test_object_t::test<4>() | ||
143 | { | ||
144 | LLXform xform_obj; | ||
145 | xform_obj.setChanged(LLXform::TRANSLATED | LLXform::ROTATED | LLXform::SCALED); | ||
146 | ensure("setChanged/isChanged failed: ", xform_obj.isChanged()); | ||
147 | |||
148 | xform_obj.clearChanged(LLXform::TRANSLATED | LLXform::ROTATED | LLXform::SCALED); | ||
149 | ensure("clearChanged failed: ", !xform_obj.isChanged()); | ||
150 | |||
151 | LLVector3 llvect3(12.4f, -5.6f, 0.34f); | ||
152 | xform_obj.setScale(llvect3); | ||
153 | ensure("setScale did not set SCALED flag: ", xform_obj.isChanged(LLXform::SCALED)); | ||
154 | xform_obj.setPosition(1.2f, 2.3f, 3.4f); | ||
155 | ensure("setScale did not set TRANSLATED flag: ", xform_obj.isChanged(LLXform::TRANSLATED)); | ||
156 | ensure("TRANSLATED reset SCALED flag: ", xform_obj.isChanged(LLXform::TRANSLATED | LLXform::SCALED)); | ||
157 | xform_obj.clearChanged(LLXform::SCALED); | ||
158 | ensure("reset SCALED failed: ", !xform_obj.isChanged(LLXform::SCALED)); | ||
159 | xform_obj.setRotation(1, 2, 3, 4); | ||
160 | ensure("ROTATION flag not set ", xform_obj.isChanged(LLXform::TRANSLATED | LLXform::ROTATED)); | ||
161 | xform_obj.setScale(llvect3); | ||
162 | ensure("ROTATION flag not set ", xform_obj.isChanged(LLXform::MOVED)); | ||
163 | } | ||
164 | |||
165 | //to test init() and getWorldMatrix() fns. | ||
166 | template<> template<> | ||
167 | void xform_test_object_t::test<5>() | ||
168 | { | ||
169 | LLXformMatrix formMatrix_obj; | ||
170 | formMatrix_obj.init(); | ||
171 | LLMatrix4 mat4_obj; | ||
172 | |||
173 | ensure("1. The value is not NULL", 1.f == formMatrix_obj.getWorldMatrix().mMatrix[0][0]); | ||
174 | ensure("2. The value is not NULL", 0.f == formMatrix_obj.getWorldMatrix().mMatrix[0][1]); | ||
175 | ensure("3. The value is not NULL", 0.f == formMatrix_obj.getWorldMatrix().mMatrix[0][2]); | ||
176 | ensure("4. The value is not NULL", 0.f == formMatrix_obj.getWorldMatrix().mMatrix[0][3]); | ||
177 | ensure("5. The value is not NULL", 0.f == formMatrix_obj.getWorldMatrix().mMatrix[1][0]); | ||
178 | ensure("6. The value is not NULL", 1.f == formMatrix_obj.getWorldMatrix().mMatrix[1][1]); | ||
179 | ensure("7. The value is not NULL", 0.f == formMatrix_obj.getWorldMatrix().mMatrix[1][2]); | ||
180 | ensure("8. The value is not NULL", 0.f == formMatrix_obj.getWorldMatrix().mMatrix[1][3]); | ||
181 | ensure("9. The value is not NULL", 0.f == formMatrix_obj.getWorldMatrix().mMatrix[2][0]); | ||
182 | ensure("10. The value is not NULL", 0.f == formMatrix_obj.getWorldMatrix().mMatrix[2][1]); | ||
183 | ensure("11. The value is not NULL", 1.f == formMatrix_obj.getWorldMatrix().mMatrix[2][2]); | ||
184 | ensure("12. The value is not NULL", 0.f == formMatrix_obj.getWorldMatrix().mMatrix[2][3]); | ||
185 | ensure("13. The value is not NULL", 0.f == formMatrix_obj.getWorldMatrix().mMatrix[3][0]); | ||
186 | ensure("14. The value is not NULL", 0.f == formMatrix_obj.getWorldMatrix().mMatrix[3][1]); | ||
187 | ensure("15. The value is not NULL", 0.f == formMatrix_obj.getWorldMatrix().mMatrix[3][2]); | ||
188 | ensure("16. The value is not NULL", 1.f == formMatrix_obj.getWorldMatrix().mMatrix[3][3]); | ||
189 | } | ||
190 | |||
191 | //to test mMin.clearVec() and mMax.clearVec() fns | ||
192 | template<> template<> | ||
193 | void xform_test_object_t::test<6>() | ||
194 | { | ||
195 | LLXformMatrix formMatrix_obj; | ||
196 | formMatrix_obj.init(); | ||
197 | LLVector3 llmin_vec3; | ||
198 | LLVector3 llmax_vec3; | ||
199 | formMatrix_obj.getMinMax(llmin_vec3, llmax_vec3); | ||
200 | ensure("1. The value is not NULL", 0.f == llmin_vec3.mV[0]); | ||
201 | ensure("2. The value is not NULL", 0.f == llmin_vec3.mV[1]); | ||
202 | ensure("3. The value is not NULL", 0.f == llmin_vec3.mV[2]); | ||
203 | ensure("4. The value is not NULL", 0.f == llmin_vec3.mV[0]); | ||
204 | ensure("5. The value is not NULL", 0.f == llmin_vec3.mV[1]); | ||
205 | ensure("6. The value is not NULL", 0.f == llmin_vec3.mV[2]); | ||
206 | } | ||
207 | |||
208 | //test case of update() fn. | ||
209 | template<> template<> | ||
210 | void xform_test_object_t::test<7>() | ||
211 | { | ||
212 | LLXformMatrix formMatrix_obj; | ||
213 | |||
214 | LLXformMatrix parent; | ||
215 | LLVector3 llvecpos(1.0, 2.0, 3.0); | ||
216 | LLVector3 llvecpospar(10.0, 20.0, 30.0); | ||
217 | formMatrix_obj.setPosition(llvecpos); | ||
218 | parent.setPosition(llvecpospar); | ||
219 | |||
220 | LLVector3 llvecparentscale(1.0, 2.0, 0); | ||
221 | parent.setScaleChildOffset(TRUE); | ||
222 | parent.setScale(llvecparentscale); | ||
223 | |||
224 | LLQuaternion quat(1, 2, 3, 4); | ||
225 | LLQuaternion quatparent(5, 6, 7, 8); | ||
226 | formMatrix_obj.setRotation(quat); | ||
227 | parent.setRotation(quatparent); | ||
228 | formMatrix_obj.setParent(&parent); | ||
229 | |||
230 | parent.update(); | ||
231 | formMatrix_obj.update(); | ||
232 | |||
233 | LLVector3 worldPos = llvecpos; | ||
234 | worldPos.scaleVec(llvecparentscale); | ||
235 | worldPos *= quatparent; | ||
236 | worldPos += llvecpospar; | ||
237 | |||
238 | LLQuaternion worldRot = quat * quatparent; | ||
239 | |||
240 | ensure("getWorldPosition failed: ", formMatrix_obj.getWorldPosition() == worldPos); | ||
241 | ensure("getWorldRotation failed: ", formMatrix_obj.getWorldRotation() == worldRot); | ||
242 | |||
243 | ensure("getWorldPosition for parent failed: ", parent.getWorldPosition() == llvecpospar); | ||
244 | ensure("getWorldRotation for parent failed: ", parent.getWorldRotation() == quatparent); | ||
245 | } | ||
246 | } | ||
247 | |||
diff --git a/linden/indra/win_crash_logger/win_crash_logger.cpp b/linden/indra/win_crash_logger/win_crash_logger.cpp index a227faf..ddfca5e 100644 --- a/linden/indra/win_crash_logger/win_crash_logger.cpp +++ b/linden/indra/win_crash_logger/win_crash_logger.cpp | |||
@@ -200,7 +200,8 @@ int APIENTRY WinMain(HINSTANCE hInstance, | |||
200 | { | 200 | { |
201 | i++; | 201 | i++; |
202 | 202 | ||
203 | mbstowcs(gProductName, argv[i], sizeof(gProductName)); | 203 | mbstowcs(gProductName, argv[i], sizeof(gProductName)/sizeof(gProductName[0])); |
204 | gProductName[ sizeof(gProductName)/sizeof(gProductName[0]) - 1 ] = 0; | ||
204 | llinfos << "Got product name " << argv[i] << llendl; | 205 | llinfos << "Got product name " << argv[i] << llendl; |
205 | } | 206 | } |
206 | } | 207 | } |
@@ -389,6 +390,7 @@ class LLFileEncoder | |||
389 | { | 390 | { |
390 | public: | 391 | public: |
391 | LLFileEncoder(const char *formname, const char *filename); | 392 | LLFileEncoder(const char *formname, const char *filename); |
393 | ~LLFileEncoder(); | ||
392 | 394 | ||
393 | BOOL isValid() const { return mIsValid; } | 395 | BOOL isValid() const { return mIsValid; } |
394 | LLString encodeURL(const S32 max_length = 0); | 396 | LLString encodeURL(const S32 max_length = 0); |
@@ -837,6 +839,15 @@ LLFileEncoder::LLFileEncoder(const char *form_name, const char *filename) | |||
837 | mIsValid = TRUE; | 839 | mIsValid = TRUE; |
838 | } | 840 | } |
839 | 841 | ||
842 | LLFileEncoder::~LLFileEncoder() | ||
843 | { | ||
844 | if (mBuf) | ||
845 | { | ||
846 | delete mBuf; | ||
847 | mBuf = NULL; | ||
848 | } | ||
849 | } | ||
850 | |||
840 | LLString LLFileEncoder::encodeURL(const S32 max_length) | 851 | LLString LLFileEncoder::encodeURL(const S32 max_length) |
841 | { | 852 | { |
842 | LLString result = mFormname; | 853 | LLString result = mFormname; |